Hi guys I am currently working on a turn-based RPG that will require me to create numerous abilities with little overlap. I've been looking to other games to see how their ability and combat system is design and has run into issues regarding the data structure.  For the purpose of this question let's look at Pokemon RED & BLUE's ability system. Here are a few things that abilities can do:   Target User or Target Enemy or Both (i.e. Self Destruct) Has an Accuracy Value Has 1-2 Element value Has PP Value Is either a Special or Normal attack type (determines which stat is used to calculate the damage value.) Increase / Decrease a primary Stat for the battle (ATK, DEF, SATK, SDEF, SPD, LUK) Increase / Decrease overall Accuracy of the target by X% for Y turns (or the entire combat.) Increase / Decrease overall Evasion of the target by X% for Y turns (or the entire combat.) Deal Damage to Target for X amount (Where X can be based on calculated from the ability's base damage value, or using the damage taken that turn i.e. Counter) Heal the Target for X amount (Where X can be based on calculated from the ability's base power OR based on damage dealt by the ability, i.e. Absorb) Skips X Turn (i.e. Dig) Critical chance * X for this attack. Has X% chance to apply Status Effect Y (Y being: Burn, Confuse, Sleep, Poison, etc) 1 Hit KO Target Cannot be hit for X turn (i.e. Dig) Hits X times (Taking the ability's Accuracy value into account each time.) Forces the attack to happen first Forces the attack to happen last   I believe there may be many more. Now, Pokemon abilities can manifest a combination of any number of the above properties, usually no more than 3-4. For example: - Counter = Skip 1 turn and deals damage to the enemy equal to 2x the damage received that turn as long as it's a Normal or Fighting move. - Dig = Skip 1 turn, cannot be attacked that turn, deal damage next turn. - Absorb = Deals damage, at the same time heal the user for 1/2 the damage dealt. - Self Destruct = Kills self and deal huge damage to the enemy. - Comet Punch = Hits the enemy 2-5 times (each time the hit chance is 85%)  As you can see, this gets quite complex. The examples cited above are just a few of the abilities that the game have and with those capabilities, it's possible to create quite a varied set of abilities that do not overlap.  The problem I am facing is 2 folds:   How would I design the data structure that would allow me to keep adding new abilities like this into the Database after the system has already been written? How would the combat system actually handle the data once it's pulled out?   I assume that it will have to involve some form of scripting... and unstructured data structure like NoSQL so some abilities can have some things and some do not (like skipping turns.) However, how is this normally done? Do I store each ability as a blob somehow and handle them differently in code? That also means that the code MUST be able to handle ALL possible combinations (which will make the combat system extremely complex and time consuming to build?) Or did Pokemon just hard coded all the abilities (which seems quite impractical?)  Here's what we currently have for our ability data structure: (in JSON)  {     "name"     : "Ability Name",     "accuracy" : 0.85,     "base"     : 50,     "type"     : 0,              // (0 = normal, 1 = special)     "target"   : 0,              // (0 = self, 1 = enemy, 2 = both)     "PP"       : 30,     "element1" : 1,              // (0 - 16, for each element)     "element2" : 2,     "blob"     : { ... } }   This will allow for something like the above, but the code would still have to handle all the possible combination of the blob. Would my understanding be correct here?  Any insight would be extremely appreciated.  P.S. - If this question need to be reworded somehow to make it clearer, please let me know... it's an extremely complex problem so I did as best I could, but would appreciate feedback. Thanks!

Overview:  Lots of games with RPG-like statistics allow for character "buffs", ranging from simple "Deal 25% extra damage" to more complicated things like "Deal 15 damage back to attackers when hit."  The specifics of each type of buff aren't really relevant.  I'm looking for a (presumably object-oriented) way to handle arbitrary buffs.  Details:  In my particular case, I have multiple characters in a turn-based battle environment, so I envisioned buffs being tied to events like "OnTurnStart", "OnReceiveDamage", etc.  Perhaps each buff is a subclass of a main Buff abstract class, where only the relevant events are overloaded.  Then each character could have a vector of buffs currently applied.  Does this solution make sense?  I can certainly see dozens of event types being necessary, it feels like making a new subclass for each buff is overkill, and it doesn't seem to allow for any buff "interactions".  That is, if I wanted to implement a cap on damage boosts so that even if you had 10 different buffs which all give 25% extra damage, you only do 100% extra instead of 250% extra.  And there's more complicated situations that ideally I could control.  I'm sure everyone can come up with examples of how more sophisticated buffs can potentially interact with each other in a way that as a game developer I may not want.  As a relatively inexperienced C++ programmer (I generally have used C in embedded systems), I feel like my solution is simplistic and probably doesn't take full advantage of the object-oriented language.  Thoughts?  Has anyone here designed a fairly robust buff system before?  Edit: Regarding Answer(s):  I selected an answer primarily based on good detail and a solid answer to the question I asked, but reading the responses gave me some more insight.  Perhaps unsurprisingly, the different systems or tweaked systems seem to apply better to certain situations.  What system works best for my game will depend on the types, variance, and number of buffs I intend to be able to apply.  For a game like Diablo 3 (mentioned below), where nearly any bit of equipment can change a buff's strength, the buffs are just character stats system seems like a good idea whenever possible.  For the turn-based situation I'm in, the event-based approach may be more suitable.  In any case, I'm still hoping someone comes along with a fancy "OO" magic bullet which will allow for me to apply a +2 move distance per turn buff, a deal 50% of damage taken back to the attacker buff, and a automatically teleport to a nearby tile when attacked from 3 or more tiles away buff in a single system without turning a +5 strength buff into its own subclass.  I think the closest thing is the answer I marked, but the floor is still open.  Thanks to everyone for the input.


I'm new to hardware and am coming from a software background. I have an SoC that will be powered by a supply generating 5V and 1A. I'm trying to figure out what are the safe ranges of volts/amps/ohms that I can use for various components that I'll be connecting to this SoC. For instance, say I want to add a transceiver to the SoC so that it can communicate with some other device:   Does the transceiver need to be rated above or below or exactly at 5V? Does the transceiver need to be rated above or below or exactly at 1A? Any resistance/ohm regulations/ranges that I need to consider?   I guess I'm trying to learn how to make a decision like the following:     My power supply is 5V and 1A. I see that Transceiver A is rated for 3V and 500mA. Perhaps its fine that its only rated for 500mA and that it will be receiving 1A, but perhaps it's not fine that its only rated for 3V but it will be receiving 5V. Hence, I would not want to use this particular transceiver.   Even if the logic in the blurb above is wrong (from an electrical standpoint), it underscores what I'm trying to understand here: given a known power supply, how do component ratings (for volts, amps, ohms) affect my decision of whether to use them or not?

Power supplies are available in a wide range of voltage and current ratings.  If I have a device that has specific voltage and current ratings, how do those relate to the power ratings I need to specify?  What if I don't know the device's specs, but am replacing a previous power supply with particular ratings?  Is it OK to go lower voltage, or should it always be higher?  What about current?  I don't want a 10 A supply to damage my 1 A device.


I have these two URIs:  http://www.google.de/blank.gif  http://www.google.de/sub/  I want the relative path from http://www.google.de/sub/ to http://www.google.de/blank.gif so that the result is ../blank.gif  URI.relativize() does not work here :/  Thanks!

Given two absolute paths, e.g.  /var/data/stuff/xyz.dat /var/data   How can one create a relative path that uses the second path as its base? In the example above, the result should be: ./stuff/xyz.dat


Isn't mass a fixed and an intrinsic property of a particle? How can we talk about eigenstates of the mass in the context of neutrinos?

I am aware that flavor $\neq$ mass eigenstate, which is how mixing happens, but whenever someone talks about neutrino oscillations they tend to state without motivation that when neutrinos are actually propagating, they are doing so in a mass eigenstate. Presumably this is glossed over because it is a deep and basic artifact of quantum mechanics that I'm missing, but I'm having trouble coming up with it.  I had some help  where they say      The mass eigenstates are the free-particle solution to the wave equation[...]   but I suppose "why is that" could be a more basic reformulation of my question! Why can't mass be time-dependent in the wave equation, yielding (I would think) eigenstates that don't have well-defined mass?


I have a script that I need to run an application which, at the end, changes the working directory.  (I'm modifying an ".sh" script and am new to Unix.) I then need to run some commands in that new directory.  I won't know what the directory will be before running the application.  If I run the script as I would run things myself, the directory doesn't change until after I've run the entire script. I'd like to do this about a dozen times in a row so I'd rather not wait (sometimes hours) for each step to run another separate script myself.  Is there a way to run the application, have the directory change, then run additional work in that directory all in one go?  Edit: Here's the basics of my script.   dset takes a parameter (ex. "10") and puts me in a directory.  I create a subdirectory "../10" adjacent to it and move files to that new subdirectory.  . dset 10 mkdir ../10 mv tmp.out ../10

I want to run a script to simply change the current working directory:  #!/bin/bash cd web/www/project   But, after I run it, the current pwd remains unchanged! How can I do that?


I use  code for Cryptography home work assignment and can't understand line# 59 thanks for the helpers.

I'm someone who writes code just for fun and haven't really delved into it in either an academic or professional setting, so stuff like these bitwise operators really escapes me.  I was reading an article about JavaScript, which apparently supports bitwise operations. I keep seeing this operation mentioned in places, and I've tried reading about to figure out what exactly it is, but I just don't seem to get it at all. So what are they? Clear examples would be great! :D  Just a few more questions - what are some practical applications of bitwise operations? When might you use them?


How do you find the marginal distribution of a Poisson distribution given a gamma(a,b) prior?

I want to calculate the posterior distribution given a gamma-prior and a poisson likelihood. The task is from a textbook and I just have the solutions (without a walkthrough). Please find all given information in the following:  Given information:  $m$ countries each with a population of $n_i$; $y_i$ is the number of people having a disease; $y_i$ is a poisson random variable with mean $\frac{n_i*\lambda}{100}$  The prior distribution for $\lambda$: $\lambda \sim Gamma(a_0,b_0)$  Task:  Show that the posterior distribution is also a gamma distribution with $a_m = a_0 + \sum_{i = 1}^{m}y_i$ and $b_m = b_0 + \sum_{i = 1}^{m} \frac{n_i}{100}$  My solution:  $Posterior \propto Likelihood \times Prior$  $p(\theta|y) \propto \prod_{i=1}^{m}(\theta^{y_i}e^{-\theta})\times \theta^{a_0-1}e^{-b_0\theta}$  $p(\theta|y) \propto \theta^{\sum_{i = 1}^{m}y_i}e^{-m\theta}\times \theta^{a_0-1}e^{-b_0\theta}$  $p(\theta|y) \propto \theta^{\sum_{i = 1}^{m}y_i+a_0-1}e^{-\theta(m+b_0)}$  $a_m = a_0 + \sum_{i = 1}^{m}y_i$  $b_m = b_0 + m \neq b_0 + \sum_{i = 1}^{m} \frac{n_i}{100}$  I think I am doing a mistake, because I don't know how to incorporate the information that the mean of $y_i$ is given as $\frac{n_i*\lambda}{100}$. Or do I just have to transform $b_m$ somehow? Can someone may give me a hint?   Thank you already in advance!  Edit 1: Considering first advices  $Likelihood: p(y | \theta) \propto \prod_{i=1}^{m}(\frac{n_i\lambda}{100})^{y_i}e^{-\frac{n_i\lambda}{100}}$  $\propto \prod_{i = 1}^{m} ((\frac{n_i}{100})^{y_i})\lambda^{\sum_{i=1}^{m}y_i}e^{-\lambda\sum_{i=1}^{m}\frac{n_i}{100}}$  $\propto \lambda^{\sum_{i=1}^{m}y_i}e^{-\lambda\sum_{i=1}^{m}\frac{n_i}{100}}$  Is the transformation of $\prod_{i=1}^{m}$ I did from the first to the second step correct?


Just curious as to why the current nvidia drivers are not the latest.   Not a complaint, and not interested particularly upgrading beyond Ubuntu's current drivers.  This is not a GENERAL QUESTION about packages, it is about a specific version of of Ubuntu and also about about specific proprietary drivers, nvidia.

Why are packages in the official Ubuntu repositories older than the latest (upstream) versions from Debian Sid, PPAs, the authors, etc.?


From googling I don't see that it's common to say 'I need change from 100 euros'.  So what's the proper way to say this?

Are the following expressions grammatically correct? If not, how should I correct each?   Giving 10 dollars to the store clerk:    Can I get some change in quarters? Can I get some quarters in exchange? Can you make change for one dollar into quarters? Can you break up one dollar into quarters? Can you exchange one dollar for quarters?


I would like to create geometry and model it (not sculpt it), as to have a cloth-like effect, wrapped around a blade's handle (reference image shows this).   How would I go about doing this? When I attempt to do so, twisting a plane, or a cube, provides certain "artefacts" due to the fact that the rotation is alongside the Z axis for 180 degrees (out of logical reasons, having to align everything perfectly).  To summarise: How do I twist a mesh as to create the overlapping cloth effect?  Issue seen here:

I have attached an image as an example below. I want to twist a rectangle. Do I have to convert that rectangle into a curve or into mesh and then twist it with ctrl+T?   Please explain with an example.


If your clan is wining like 20-3, and you have 1 attack left, can you put it on a base that someone else has already attacked, and get bonus loot?  How many times can bonus loot be claimed on a single base? Can different team mates attack the same base and all 3 star it and get the loot?

I have been playing clash of clans, and I want to 1 star a farming person in war and get a ton of loot. (I can't do any better to anyone else). My clan says to wait until the near end of the war, but idk if I will still get loot if someone already got at least 1 star.


Is it true that:  $$\lim_{x \rightarrow 0} x\log_{n}(x) = 0 \quad ; \quad n \in \mathbb{R}$$

I was thinking about the reasons behind $0^0=1$ and I remember one of my friends studying math arguing about the continuity of the function $x^x$ in $0$. But when I write as $$x^x=e^{x\ln x}$$ I am now looking at $$\lim_{x\rightarrow 0} x\ln x$$ Graphically I can see in Mathematica that it goes to $0.$ But I can't calculate by using a Taylor expansion, because I can't expand log around $0$. How do you prove that?


How can I enter Unicode emoji into programs on Ubuntu using only the keyboard?  I'm trying [ctrl] + [shift], 1F1E6 in terminal but the find window ends up poping up when I get to F.

The title pretty much says it all: how can I type Unicode characters - specifically the em-dash —?


So I have this matrix  $$     \begin{pmatrix}     -2 & 0 & 0 \\     3 & 1 & -6 \\     0 & 0 & -2 \\     \end{pmatrix} $$  Finding Nul(A+2Id) gives me  $$     \begin{pmatrix}     0 & 0 & 0 \\     3 & 3 & -6 \\     0 & 0 & 0 \\     \end{pmatrix} $$  On the answers sheet it says to solve the homogeneous system associated with A + 2Id which gives us   Nul(A+2Id)=Span $$     \begin{pmatrix}     1 & -1  \\     1 & 1  \\     1 & 0  \\     \end{pmatrix} $$  I am completely lost on how to find the Span Nul(A+2Id)=Span $$     \begin{pmatrix}     1 & -1  \\     1 & 1  \\     1 & 0  \\     \end{pmatrix} $$  Can somebody please help me with the steps in order to get to this solution ?  Moreover, on the answers sheet is states  Since the dimension of the eigenspace E(λ1) is equal to 2 we observe that the ma- trix A is diagonalizable.  How do i know from this solution that the eigenspace E(λ1) is equal to 2?  Thanks!

So i have this $3\times 3$ matrix  $$     \begin{pmatrix}     -2 & 0 & 0 \\     3 & 1 & -6 \\     0 & 0 & -2 \\     \end{pmatrix} $$  I want to check if the matrix is diagonizable. First thing i do is find the roots : namely $\lambda_1 = −2$ of multiplicity $2,$ and $\lambda_2 = 1$ of multiplicity $1.$  In order to ensure that the matrix is diagonalizable we need to find a basis of $\mathbb{R}^3$ whose elements are eigenvectors for $A.$ In particular, since we have the eigenvalue $\lambda_1=-2$ having multiplicity $2$ we need to check that the dimension of the eigenspace $E(\lambda_1)$ is equal to $2.$ We compute the eigenspaces of $A.$  $\DeclareMathOperator\Nul{Nul}$On the answer sheet is says that we need to find $\Nul(A+2Id)$... but why $2Id?$ Isn't is supposed to be $-2,$ so $\Nul(-2Id-A)$??   I do not understand this $\Nul(A+2Id).$ I always thought that we should compute $\Nul(-2Id-A),$ so what do i need to do ?   $\Nul(-2Id-A)$ gives me a different result from $\Nul(A+2Id).$  Does that mean that since $-2$ has a multiplicity of $2,$ we need to work with $2$ and not $-2$?  Somebody please help with a clear and simple explanation ! Thanks!


I just started reading about JAVA and I want to make a little program that when using Scanner is I type "yes", "no" or just something random I will get different messages.The problem if with the lines:   if (LEAVE == "yes") {         System.out.println("ok, lets go");      if (LEAVE == "no") {         System.out.println("you dont have a choice"); } else {         System.out.println("it's a yes or no question");   I receive the error : Operator "==" cannot be applied to "java.util.scanner", "java.lang.String". I saw on a site that it would be better if I replaced "==" with .equals,but I still get an error..  Help please :S  Code below:  package com.company; import java.util.Scanner; public class Main {      public static void main(String[] args) {         Scanner LEAVE = new Scanner(System.in);          System.out.println("do you want to answer this test?");         LEAVE.next();          System.out.println("first q: would you leave the hotel?");         LEAVE.next();         if (LEAVE == "yes") {             System.out.println("ok, lets go");         }         LEAVE.nextLine();         if (LEAVE == "no") {             System.out.println("you dont have a choice");             LEAVE.nextLine();         } else {             System.out.println("it's a yes or no question");          }     }}

I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug.  Is == bad? When should it and should it not be used? What's the difference?


Consider the following structure over $\mathbb{N_0}$: $2, 2 + 3^n, 2 + 3^{n + 1}, ..., 2 + 3^{n + 3}$. Here we have five numbers and it's not hard to prove that exactly one if them is divisible by $5$. What about general result? Consider a general structure over $\mathbb{N_0}$: $a, b, p \in \mathbb{N}$): $a, a + b^n, a + b^{n + 1}, ..., a + b^{n + p - 2}.$ Of course, assume $a \not\equiv 0 \pmod p.$ My hypothesis is that exactly one of $a + b^i, i = n, n + 1, ..., n + p - 2$ is divisible by $p$, but does this property holds for any $p, b$? Or maybe just if $(b, p) = 1$ or one of them (or both?) is a prime? How to prove this?

I'm solving a problem, and the solution makes the following statement: "The common difference of the arithmetic sequence 106, 116, 126, ..., 996 is relatively prime to 3. Therefore, given any three consecutive terms, exactly one of them is divisible by 3." Why is this statement true? Where does it come from? Is it generalizable to other numbers?


I recently installed Ubuntu 14.04 on Parallels and VirtualBox. Been trying multiple methods to fixing the resolution with no luck. I am running both these VMs on my mid-2013 MBPr: Intel Iris:   Chipset Model:    Intel Iris   Type: GPU   Bus:  Built-In   VRAM (Total): 1024 MB   Vendor:   Intel (0x8086)   Device ID:    0x0a2e   Revision ID:  0x0009   Displays: Color LCD:   Display Type: Retina LCD   Resolution:   2560 x 1600   Retina:   Yes  I have tried editing my xorg.icof file (never did exist in /etc/X11/ in the first place) -  Tried making sure I added the refresh rate to the file, usually leads to the system not letting me login in. The resolution seems great when I'm installing Ubuntu for the first time. But the moment I reboot it and it logs into my user. It's stuck in 640x320. It's hard to even get around and change settings since I can't see but a fourth of pop-up windows.

I've recently installed Ubuntu on Oracle's Virtualbox.  Now I want to install the guest additions.  I started up my Ubuntu guest OS, clicked "Devices" and chose "Install Guest Additions". Nothing happened, and I don't see the CD icon on my desktop.  How can I make this work?


Hi I would like to know if its possible to develop app using HTML, CSS, Javascript and PhoneGap SDK on a Ubuntu system and uploading the app on to Adobe PhoneGap Build for packaging it into native installation files for iOS,Android and windows.  All I see on the official Adobe PhoneGap guide is, its support for OS's like Mac and Windows only.  I know I could use cordova on Ubuntu, But i need to use Adobe PhoneGap Build for packaging the app.

Can .exe and .msi files (Windows software) be installed in Ubuntu?


I have been looking for a solution to my issue, but I can't find anything.  The matter is the following: - I set up a workflow to start manually to send an email to a specific distribution list, whenever an engineer wants to send a start of test for a vehicle (an item in the list). - When starting the workflow, the engineer will fill out a form (parameters) and then start the workflow.   Is it possible to browse for an attachment when filling out the form, adding in the parameters, and then have it send it in the email through the workflow? I am not able to add the attachment in the workflow. The attachments are in .pdf file and they are located in the engineers' desktop.   Not sure if I am making much sense, please let me know if you would like me to explain myself better.  Any help please?  Thank you

How to Get List Attachment URL's using SharePoint Designer Workflow.


I currently have Ubuntu 10.10 installed and I would like to upgrade to 11.10 (i.e. upgrading by two versions).  There are a couple of issues:    Firstly, I have Matlab installed, and I can't install this myself (I need to get it done by  IT support, which can sometimes be quite difficult).  So I'll need to keep Matlab installed across upgrades.  Secondly, I have custom drivers installed (the NVidia developer drivers for using CUDA) and I'm not sure if this is a problem.  I don't mind reinstalling this however, as they are freely available.   I could click the "upgrade now" button in the update manager, but I will have to do this twice (10.10->11.04->11.10).  Is it possible to put in an Ubuntu 11.10 CD and upgrade my 10.10 install?  Will this leave Matlab installed?    Reinstalling and copying over data might not be an option due to my need for Matlab (proprietary software, eh? :P).

I am currently using Ubuntu 10.04. I know there is a 10.10 release, but can I upgrade directly to 11.04? Could you walk me through the steps please?


Next Friday, I'm going on a 3 day road trip to Spain, and then will stay there for 3 weeks. I will come back in the first week of January.  The problem is that because of the Gilets Jaunes, France is currently in a bit of a mess, to put it mildly: there are frequent riots and blockades, many gas stations have run out of fuel and a number of locations have seen arson and even deaths. It doesn't seem like it's going to stop in the next week, and I've even heard rumours on social media that this might be the start of a new revolution, similar to what happened 50 years ago.  The plan right now is to stay the night somewhere in the middle of France (I think near Poitiers), then drive to Zaragosa via San Sebastian and spend the night and part of the next day there and then drive from there to the Costa Blanca, the end destination of the trip. The trip back would be a 2 day trip on Friday and Saturday with a stay in France, probably in Poitier again.  I'm somewhat concerned about the situation and really want to avoid problems on the trip. I don't want to end up on the side of the road without fuel, I don't want to have to spend the night in a car and I DEFINITELY do not want to end up getting caught in the middle of a riot or worse. Postponing the trip is not an option and we really want to go with a car and not a plane or train.  What things should I be aware of to make the trip go smoothly? Note: I won't be visiting Paris on this trip, so the suggested duplicate isn't quite valid. I will spend most of my time in France on the motorways and the roadside rest stops.

I’ve a date and I really waited long to make this happen. My gifrfriend is a bit worried about the security issue in Paris. Which locals think that the media is exagerrating the issue and the issue is small and non-threatening for tourists?


Apologies this is probably a stupid idea but I am curious and my knowledge of physics is limited as I am 14. So I was wondering if we could use particle accelerators to achieve nuclear fusion. I have found a few other posts about this but they seem to be about unnecessarily high energy accelerators when only approximately 1 MeV seems to be necessary to reach the fraction of the speed of light for fusion.   So it seems that there are two forces involved there is the electromagnetic which causes the protons to repel preventing fusion and has an infinite range. Then there is the strong force which is approximately 137 times stronger than electromagnetic but has a limited range of a femtometer and is necessary for fusion. So basically all that is required is to overcome the Coulomb barrier which requires the protons to be travelling at around 0.05-0.07c and requires approximately 1 MeV according to my research and calculation. This means that 18.6 MeV profit per collision (19.6 MeV per fusion reaction) so that means that over 5.1% of the nuclei need to fuse to gain energy. This seems to be a major flaw as this seems unlikely to happen.   However I was wondering if this could be overcome by using a 1 MeV linear accelerator to accelerate the hydrogen ions at a target which is essentially a very long and dense highly pressurised chamber of deuterium gas where it is almost certain for collisons to occur due to the high amount of atoms?

So I know the basic gist is that fusion power's main issue is sustaining the fusion. I also know that there are two methods. The Torus method and the laser method. The torus magnetically contains plasma and heats it with radiation and accelerates the plasma around to make strong enough collisions that protons fuse. The laser method uses 192 lasers and focuses it on tiny frozen hydrogen pellets and aims to initiate fusion each time pellets are dropped.  The though struck me when we could sorta combine the two designs together. The torus doesn't have to worry about making fusion happen at a specific location but it has issues in that the plasma is unevenly heated and leaks. On the other hand, the laser design is extremely complicated in the level of precision needed and would have to repeat this for every pellet. This lead me to think to make something precise and contained at the same time.  I see that particle colliders are able to direct two beams of protons and have them collide at a specific spot with a very precise energy. Couldn't we tune the energy of the two beams of protons to the energy required for them to fuse? We have the ability to smash them into bits, surely we have the ability to have them fuse. (I'm thinking about the type of collider that circles two beams in opposite directions)  It would be at much lower energies than normal colliders and would be very precise and it would be possible to fuse at a specific location that has greater leeway because for protons that missed collision, they'd just circle around again! Thus protons would efficiently be used and very little would be wasted. There wouldn't be problems of plasma leakage because we are focusing them in a thin tight beam.   It seems that this idea has girth, or I feel this way at least, can someone back me up by offering some calculations on how to calculate the efficiency? How would I go about calculating the two circling beams of protons and at what specific velocity would be needed? etc.


The problem is     how to get the maximum repeated String in an array using only operations on the arrays in java?   so i got into this question in a test and couldn't figure it out. lets suppose we have an array of string.  str1[] = { "abbey", "bob", "caley", "caley", "zeeman", "abbey", "bob", "abbey" } str2[] = { "abbey", "bob", "caley", "caley", "zeeman", "abbey", "bob", "abbey", "caley" }    in  str1 abbey was maximum repeated, so abbey should be returned and   in str2 abbey and caley both have same number of repetitions and hence we take maximum alphabet as the winner and is returned(caley here).  c > a   so i tried till  import java.util.*; public class test {     static String highestRepeated(String[] str) {         int n = str.length, num = 0;         String temp;         String str2[] = new String[n / 2];          for (int k = 0;k < n; k++) {  // outer comparision             for (int l = k + 1; l < n; l++) { // inner comparision                 if (str[k].equals(str[l])) {                     // if matched, increase count                     num++;                 }             }              // I'm stuck here         }          return result;     }      public static void main(String[] args) {         Scanner sc = new Scanner(System.in);         System.out.println("enter how many votes");         int n = sc.nextInt();         String[] str = new String[n];         for (int i = 0; i < n; i++) {             Str[i] = sc.nextLine();          }         String res = highestRepeated(str);         System.out.println(res + " is the winner");     } }   so, how should i take the count of occurrence of each string with and attach it with the string itself.  All this, without using a map and any hashing but just by using arrays?


Let $a,b \in \Bbb{R}$ such that $a<b$ Then Prove that $\:\exists\:$ a continuous function $f:(a,b)\to [a,b]$ such that $f$ is Bijective. I am not sure how to prove formally, But i tested the claim for $f(x)=x$. It is of course injective but not surjective since codomain is different from range. EDIT: As per the link given in the comment section, this is what i understood. First let us assume $f:(a,b)\to [a,b]$ is onto. So $\exists$ $c,d \in (a,b)$ such that $f(c)=a,f(d)=b$. Without loss of generality let $c<d$. Now Since $f$ is continuous, by IVT we have: $$f\left([c,d]\right)=[a,b]$$ But $(a,b)-[c,d]\ne \phi$ So $f$ cannot be injective. Hence if $f$ is Surjective, $f$ cannot be injective. This implies that: If $f$ is Injective, $f$ cannot be surjective. The best example for $f$ to be continuous and injective is $f(x)=x$. But I am unable to find example for $f$ to be continuous and surjective.

Does there exist a continuous bijection from $(0,1)$ to $[0,1]$? Of course the map should not be a proper map.


For ubuntu 12.04 bash scripts, I used to be able to run commands like the example below to overwrite files:  sudo echo 'line1    line2 line3' > /etc/some/config/file.conf   Ever since Ubuntu 14.04, I now have to break it up to get the same behaviour like so:  sudo echo 'line1 line2 line3' | sudo tee /etc/some/config/file.conf   I am guessing this is an extra security measure? Is there some way to go back to the old behaviour?    UPDATE  As some have correctly pointed out, this behaviour is consistent across Ubuntu 12.04 and Ubuntu 14.04. I believe I got mixed but because if one runs the command in a bash script called with sudo, then it executes fine, however, pasting the command into the CLI, it results in permission denied. I was comparing apples with oranges.

When using sudo to allow edits to files, I regularly get 'permission denied'.  For example, my mouse is jittery and sluggish, so I want to disable polling:  sudo echo "options drm_kms_helper poll=N">/etc/modprobe.d/local.conf   I'm prompted for a password, and then get:  bash: /etc/modprobe.d/local.conf: Permission denied   So I tried to do a temporary change to disable polling by using:  sudo echo N> /sys/module/drm_kms_helper/parameters/poll   Yet again the system responded with:  bash: /sys/module/drm_kms_helper/parameters/poll: Permission denied   Any ideas?


I am using the book class to typeset a course I am currently taking. However, a chapter has a long name, and it causes the header to look terrible (the name of the chapter crosses the margins of the paper). Any ideas on how to change the chapter name in the header only, so it would look proper?

I am writing a book and one of my chapters has a very long title. As it can't be displayed correctly on the top of even pages, I provide a "short title name" via the   \chapter[short title]{long title}   command. But then, "short title" appears in the table of contents instead of the original/true/long one.  How can I have the "short title" in the header of even pages, and the "long title" in the ToC and in the "Title header"?  For reference, here is the code I use:  \documentclass[11pt,a4paper]{book} \begin{document} \tableofcontents  \chapter[Short title]{Very vey very very very very very very long title     i can't display in the header} Lorem ipsum dolor sit amet, consectetur adipiscing elit. \end{document}


I have a list of lists, with identical elements, created like this:  list1=[1,2,3] list2=[] for i in range(6):     list2.append(list1) list2   The outcome is:  [[1, 2, 3], [1, 2, 3], [1, 2, 3], [1, 2, 3], [1, 2, 3], [1, 2, 3]]   I want to be able to change the elements of the nested list; for example:  list2[0][0]=4 list2   produces:  [[4, 2, 3], [4, 2, 3], [4, 2, 3], [4, 2, 3], [4, 2, 3], [4, 2, 3]]   But I only want to change the first element of the first list:  [[4, 2, 3], [1, 2, 3], [1, 2, 3], [1, 2, 3], [1, 2, 3], [1, 2, 3]]   How can I do this ? What am I missing in the iterating process ? At the end, I want to be able to reference any element in list1

I needed to create a list of lists in Python, so I typed the following: my_list = [[1] * 4] * 3  The list looked like this: [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]]    Then I changed one of the innermost values: my_list[0][0] = 5  Now my list looks like this: [[5, 1, 1, 1], [5, 1, 1, 1], [5, 1, 1, 1]]    which is not what I wanted or expected. Can someone please explain what's going on, and how to get around it?


Few months back i scheduled shutdown task at 6 A.M in morning using windows 7 task scheduler, now i don't know how to stop that from re-occurring.      I can't find it in the task scheduler.Is there any way to find the shutdown task and delete it or disable it.

I created a custom task from another application (Peachtree), but it never showed up in the Active Tasks list. So, I created it manually from within the Task Scheduler, but the task still hasn't appeared.  I'm afraid I now have two tasks that do the same thing, but I can't change them in any way. What can I do?


For most hosting providers, including cloud hosting, you are given a couple name servers like ns1.hostingprovider.domain and ns2.hostingprovider.domain, which you use for all your domains.  On AWS, for each domain (each hosted zone), you get a bunch of different name servers. Why does it happen? Does it mean that for other hosting providers, all their domains are in the same hosted zone? Should we keep all our domains in the same hosted zone (not sure if this is possible at all).  What I mean is not why we have 4 nameservers instead of 2 but why the nameservers are different for each domain. For example, if I have domains test1.domain and test2.domain, to add them to some hosting provider, I will add nameservers ns1.hostingprovider.domain and ns2.hostingprovider.domain to both domains. But for AWS I will add something like ns-325.awsdns-35.net and ns-2421.awsdns-58.co.uk for one domain and ns-224.awsdns-59.co.uk and ns-147.awsdns-44.org for the other domain. Hope, this makes sense.

I have hosted few zones on AWS Route53. They assigned me four name servers to setup in my DNS records.   When I geolocated those name servers, all of them appear to be located in the same place.  Are all of them installed in one place, or different places?


I was working off of the code provided here:  The test class they provided did not cover the full class. Still being a little new to writing test classes, how could I make sure I get the full coverage? Currently I at 57% with the if statement claiming to not be covered. /* Class provided by Salesforce help document https://help.salesforce.com/articleView?id=entitlements_milestones_trigger.htm&type=5 */ public class MilestoneUtils {     public static void completeMilestone_case(List<Id> caseIds, String milestoneName, DateTime complDate) {                   System.debug('calling MilestoneUtils with these inputs: MilestoneName='                                  +milestoneName+' completeDate='+complDate);         System.debug('Case list with milestones to complete: '+JSON.serializePretty(caseIds));                  List<CaseMilestone> cmsToUpdate = [select Id, completionDate                 from CaseMilestone cm                 where caseId in :caseIds and cm.MilestoneType.Name=:milestoneName                  and completionDate = null limit 1];         if (cmsToUpdate.isEmpty() == false){             for (CaseMilestone cm : cmsToUpdate){                 cm.completionDate = complDate;             }             update cmsToUpdate;         }     } }  Test Class I attempted to write (see link for what salesforce had) /* Test Class provided by Salesforce help document https://help.salesforce.com/articleView?id=entitlements_milestones_trigger.htm&type=5 Modified to meet validation rule requirements */  @isTest private class MilestoneUtils_Test {      static testMethod void TestCompleteMilestone_Case(){         // create data needed to test         // Entitlement is hooked up to account in the background, even when set for case                 List<Account> acts = new List<Account>();         Account myAcc = new Account(Name='TestAct', phone='1001231234');         acts.add(myAcc);          Account busAcc = new Account(Name = 'TestForMS', phone='4567890999');         acts.add(busAcc);         insert acts;         Contact cont = new Contact(FirstName = 'Test', LastName = 'LastName', phone='4567890999', accountid = busAcc.id);         insert(cont);          Id contactId = cont.Id;          Entitlement entl = new Entitlement(Name='TestEntitlement', AccountId=busAcc.Id);         insert entl;          String entlId;         if (entl != null)             entlId = entl.Id;           String milestoneName = 'Test Milestone';                  List<Case> cases = new List<Case>{};         if (entlId != null){             Case c = new Case(Subject = 'Test Case 1 with Entitlement ',                  EntitlementId = entlId, ContactId = contactId, Origin = 'Direct Entry');             cases.add(c);             c = new Case(Subject = 'Test Case 2 with Entitlement ',                  EntitlementId = entlId, ContactId = contactId, Origin = 'Direct Entry');             cases.add(c);         }                   if (cases.isEmpty()==false){             insert cases;             List<Id> caseIds = new List<Id>();             for (Case cL : cases){                 caseIds.add(cL.Id);             }             milestoneUtils.completeMilestone_case(caseIds, milestoneName, System.now());             //check database that completed data has been filled in for this milestone             /*             List<CaseMilestone> milestone_results = [Select Id, CaseId, CompletionDate, MilestoneType.Name                                                       from CaseMilestone cm                                                       where cm.caseId in :caseIds                                                       ];             system.assertEquals(caseIds.size(), milestone_results.size());             */                      }     }      }  Any direction is helpful.

This is a canonical question and answer developed by the community to help address common questions. If you've been directed here, or your question has been closed as a duplicate, please look through the resources here and use them to shape more specific questions. To browse all canonical questions and answers, including more unit test resources, navigate to the  tag.  This canonical question is intended to address several classes of common questions by providing a quick summary and links to comprehensive resources:   How is code coverage obtained and calculated? How do I increase my coverage?  Why can't I cover these lines? Why isn't the body of my loop or conditional statement covered?


Is any epimorphism in the category of magmas surjective? More generally, is the same statement true for the category of sets with an $I$-ary operation, where $I$ is any (possibly infinite) set?   A magma is just a set with any random binary operation on it. It need not be commutative, associative, have an identity, have inverses, etc.

The question says it all, but let me recall the definitions. A magma $(X,\cdot)$ is a set with a binary operation $\cdot:X\times X\to X$ (without any further assumptions like associativity). A morphism between magmas is a map $f:X\to Y$ with $f(a\cdot b)=f(a)\cdot f(b)$ for all $a,b\in X$. A morphism $f$ is epi [mono] if one can cancel it from the right [left] ($g\circ f =h\circ f$  $\Rightarrow g=h$ [respectively $f\circ g=f\circ h$ $\Rightarrow g=h$]).  Using free magmas with one generator shows that monomorphisms are injective. The question is whether epimorphisms are always surjective (in many other categories this fails, e.g. in MONOID).


My computer was acting really strange; the windows were flickering and parts of windows of different applications were partly appearing at random places. Also when I was typing, my computer seemed to automatically selected text and copied it, but it could also be that it just duplicated a part of the screen of a few seconds ago. Hard to describe, but unworkable. My Thinkpad carbon passed all hardware tests and I installed a fresh Ubuntu install. Still the same behavior. I found a solution that I wanted to share.

I'm not sure what's caused it. I haven't changed any system settings. The only thing I've done that may have broken something is updating my software. My update was: upgrade linux-generic-hwe-20.04:amd64 5.8.0.48.54~20.04.32 5.8.0.49.55~20.04.33 upgrade linux-image-generic-hwe-20.04:amd64 5.8.0.48.54~20.04.32  upgrade linux-headers-generic-hwe-20.04:amd64 5.8.0.48.54~20.04.32  upgrade linux-image-extra-virtual:amd64 5.4.0.70.73 5.4.0.71.74 upgrade linux-image-generic:amd64 5.4.0.70.73 5.4.0.71.74 upgrade linux-libc-dev:amd64 5.4.0-70.78 5.4.0-71.79 upgrade libseccomp2:amd64 2.4.3-1ubuntu3.20.04.3 2.5.1-1ubuntu1~20.04.1 upgrade nomachine:amd64 7.3.2-3 7.4.1-3```  Removing nomachine did not solve the problem. It was far worse before, I'm not sure how to describe exactly, but my entire screen's UI was glitching out. So I rebooted and that stopped, but now the terminal text looks like this:  I haven't changed any terminal settings. This seems to be occurring in the entire OS. Here is another example:  Not sure how to go about troubleshooting this? I don't have the time to reinstall the OS, nor do I think I should have to because this is just ridiculous and shouldn't happen. I'm not aware of anything I've done to make the system unstable. Edit Earlier I also tried booting the PC. It failed and got stuck on some command in a terminal (didn't manage to take a photo of what it said). So I rebooted into recovery mode with both available kernels. I was getting strange glitches like this:  That didn't work. So I rebooted the PC normally, and now I somehow logged in fine. Now I'm getting popups saying to report a system error. It says this:  Environment  Ubuntu 20.04.2 LTS GNOME 3.36.8  sudo lshw -class display   *-display        description: VGA compatible controller        product: Xeon E3-1200 v3/4th Gen Core Processor Integrated Graphics Controller        vendor: Intel Corporation        physical id: 2        bus info: pci@0000:00:02.0        version: 06        width: 64 bits        clock: 33MHz        capabilities: msi pm vga_controller bus_master cap_list rom        configuration: driver=i915 latency=0        resources: irq:33 memory:f7800000-f7bfffff memory:e0000000-efffffff ioport:f000(size=64) memory:c0000-dffff  I also did , which passed with 0 errors. Let me know if more details are required.


After I click on a th with the class database-header, my table gets sorted via the post method, but for some reason the click event listener gets removed, so when I click again on a different database-header, nothing happens. What em i doing wrong ?   $(function () {     var user = $('#user');     var databaseHeader = $('.database-header');     var tableContainer = $('.table-container');     var databaseHeaderValue;     var url = './php/table.php';      databaseHeader.click(function () {  /* Checks for the user login div */         if (user.closest('html').length){              databaseHeaderValue = $(this).html();             $.post(url, {'sort' : databaseHeaderValue}, function (data) {                 tableContainer.html(data);             });         }     }); });

I have a bit of code where I am looping through all the select boxes on a page and binding a .hover event to them to do a bit of twiddling with their width on mouse on/off.  This happens on page ready and works just fine.  The problem I have is that any select boxes I add via Ajax or DOM after the initial loop won't have the event bound.  I have found this plugin (), but before I add another 5k to my pages with a plugin, I want to see if anyone knows a way to do this, either with jQuery directly or by another option.


I'm georeferencing an image using gdal and the following command:  gdal_translate -of Gtiff -co tfw=yes -a_ullr 0.016264915466308594 51.505109712517786 -0.0024890899658203125 51.492018739579336 -a_srs EPSG:4326 Penguins.jpg penguins.tif   then I'm generating the tiles using gdal2tiles and the following command:  python gdal2tiles.py -t 'Penguins' -k penguins.tif penguins_gdal   but for some reason the resulting tiles show the image flipped on the y axis even though the tif image is not flipped.  Am I doing something wrong?  Thanks

As an example I have a BSB file from NOAA which is a navigational map. The map has a SRS of WGS84 and a Mercator projection.  I initially translate the file from BSB format to GTiff format using the following command:  gdal_translate -of GTiff 18554_1.kap noaa.tif  I can view this GTiff file using Paint Shop Pro quite fine. I then translate the file from GTiff format to VRT format using the following command:  gdal_translate -of vrt –expand rgba noaa.tif noaa.vrt  I then try to generate a tile matrix set using the following command:  gdal2tiles.py noaa.vrt tiles_folder  Where the map tiles are located in tiles_folder. If I try to open the openmaps.html or google.html, the map zoom in and out looks good. However, on tiles generator like MBTiles, I see tiles swap. See the image below. I am pulling my hair off to get the tiles to line up. I am guessing it is projection error. I am not understanding those projection types. It would great someone can explain it while finding the error. I am planning to use on a tiling  like this. By the way, on GDAL how do I specify the BSB (reference) file that is associated with KAP (data) file? I have seen cases where only one BSB file referred by multiple KAP files.


If $a>b>0$ and $n\in\mathbb{N}$ then $a^{1/n}-b^{1/n}<(a-b)^{1/n}$  I know $f(x)=x^{1/n}-(x-1)^{1/n}$ is strictly decreasing if $x>1$. Since after taking the derivative I get that $f'(x)=\frac{1}{n}x^{\frac{1-n}{n}}-\frac{1}{n}(x-1)^{\frac{1-n}{n}}$ which is decreasing for all $x>1$  Now evaluating $f(1)$ I get just $1$ and evaluating $f\left(\frac{a}{b}\right)$ I get $\frac{a}{b}^{\frac{1}{n}}-\left(\frac{a-b}{b}\right)^{\frac{1}{n}}$. Now I'm not sure how to then show that  $a^{1/n}-b^{1/n}<(a-b)^{1/n}$

Let $a>b>0$ and let $n \in N$ satisfy $n \geq 2$.  Prove that $$a^{1/n}-b^{1/n}<(a-b)^{1/n}.$$  If we let $a=x$ and $b=x-1$, then we need to show that $f(x):=x^{1/n}-(x-1)^{1/n}$ is decreasing for $1\leq x$ (which means that $f'(x)\leq 0$ and $f$ is differentiable), and evaluate $f$ at $1$ and $a/b$.


Is it grammatical to say "My favorite food is apples"? If not, is there a similar language structure that begins with the words "My favorite food" that I could use to explain this? Perhaps it would be grammatical to say "My favorite foods are apples".   I do not want to use the word 'apple' in  the singular form, if possible. I want to use the word 'apples' in plural.   Thank you for reading.

My fish's native habitat is rice fields. My fish's native habitat are rice fields.   Which one is correct? I'm pretty sure it's the first, since 'is' modifies 'habitat,' but it still sounds weird...


When booting the Ubuntu system went wrong and the user is forced to cut off power, there is a feature, that disables automatic selection of grub menu upon next boot.  Normally this is a nice feature to have, but sometimes it gets triggered when I power on the system remotely via WOL.   Is there any way to disable it?

I have Ubuntu Server 11.04, but it is headless (no monitor). The only way I want to be able to access it is remotely via SSH. But, sometimes, say after a power loss, when the server restarts, it will get stuck on the Grub boot menu, and it won't count down. It will just hang there waiting for me to choose the first boot entry. This means I have to go there and plug in a monitor and keyboard.  But I can't do that remotely. How can I force it to continue booting to boot entry 1 (default) regardless of power loss or whatever?


Why can't we tag more than one user in comment? Is that a restriction on some low reputation users or is it for all?

Now this is probably a surprise to many since I always see thousands of comments like :  @Sarfraz, @balpha just told you they did in the first comment he wrote. Also, allowing only one Stack Overflow user to be logged in per IP address would be problematic for networks with shared IPs.  What's surprising is that apparently the notification will trigger only for Sarfraz and not for balpha. As you can see from the :  Only one person can be replied to at a time in a comment. The first one in the string wins.  I propose to increase the limit to let's say 3 or 5 people; it won't hurt (never seen that feature being abused) and especially many people believe it already works that way.


Prove the following equation by counting the non-empty subsets of $\{1,2,\ldots,n\}$ in $2$ different ways:  $1+2+2^2+2^3\ldots+2^{n-1}=2^n-1$.  Let $A=\{1,2\ldots,n\}$. I know from theory that it has $2^n-1$ non-empty subsets, which is the right-hand side of the equation but, how do count the left one?  I've proven it using induction but how can i get to the first part of the equation by counting subsets differently?

How to prove with double counting technique that $1+2+\dots+2^n=2^{n+1} -1$?   I can see, for example, that the right-hand side of the equation counts the cardinality of the powerset of a set with n+1 elements (excluding the empty set): could this be a good idea? Because I don't seem to be able to make the left-hand side fit this idea...


In the midst of a proof I am reading the following lines are present:  For $I\subseteq [a,b]$ and $f,g: [a,b]\to \mathbb{R}$ be integrable on $[a,b]$:  $\inf\{(f+g)(x):x\in I\}\geq \inf\{f(x):x\in I\}+\inf\{g(x):x\in I\}$  and   $\sup\{(f+g)(x):x\in I\}\leq \sup\{f(x):x\in I\}+\sup\{g(x):x\in I\}$.  Why are they true? Some variation of the triangle inequality?

Suppose $D$ is a nonempty bounded subset of reals. Let $f:D \to \mathbb R$ and $g:D \to \mathbb R$. Define $(f+g)(x)=f(x)+g(x)$. Prove $\sup(f+g)(D) \le \sup f(D) + \sup g(D)$ (also prove that $\sup (f+g)$ exists).   I understand why this is the case, just not how to prove it. Left side is pretty much $\sup  (f(x)+g(x))$ and right side is $\sup (f(x) + g(y))$ for $x,\,y \in D$. Basically $f+g$ has to use the same variable and $f(D)+g(D)$ use different ones. But I don't know how to go about proving this.     The second part of the question is to find a specific example where strict inequality holds.    Let $D=\{a,b\}$ and $f: a \to 1,\, b\to 0, \,g: a \to 0,\, b\to 1$. $\sup f(D) = 1,\, \sup g(D) = 1,\, \sup f(D) + \sup g(D) = 2.$ $\sup (f+g)(D) = 1$ (if we choose a, $f+g = 1+0,\, b,\, f+g=0+1$).


I am trying to make a simple Cayley table for Z_5. Here's my attempt: \[    \setlength{\extrarowheight}{3pt}       \begin{array}{l|*{5}{l}}       \oplus & [0] & [1] & [2] & [3] & [4] \\       \hline       [0] & [0] & [1] & [2] & [3] & [4] \\       [1] & [1] & [2] & [3] & [4] & [0] \\       [2] & [2] &[ 3] & [4] & [0] & [1] \\       [3] & [3] & [4] & [0] & [1] & [2] \\       [4] & [4] & [0] & [1] & [2] & [3] \\       \end{array}    \]  I am getting the error message "Illegal unit of measure (pt inserted). If I insert other symbols in the third through sixth rows, such as powers of a, I don't get the error message. For instance, \[       \setlength{\extrarowheight}{3pt}       \begin{array}{l|*{5}{l}}        \oplus & [0] & [1] & [2] & [3] & [4] \\       \hline       [0] & [0] & [1] & [2] & [3] & [4] \\       a   & a   & a^2 & a^3 & a^4  & a^5 \\       a^2 & a^2 & a^3 & a^4 & a^5  & a^6 \\       a^3 & a^3 & a^4 & a^5 & a^6  & a^7 \\       a^4 & a^4 & a^5 & a^6 & a^7  & a^8 \\       \end{array}   \]

\begin{table}[ht] \makebox[\textwidth][c]{     \begin{tabular}{ccccc}         \hline         \hline         [] & [] & [] & [] & []\\         [] & [] & [] & [] & []\\         \hline         \hline     \end{tabular} } \caption{test} \end{table}   I cannot run the above code, latex returned an error about missing number, but I can't see anything I am missing.  And the weirdest thing is that  \begin{table}[ht] \makebox[\textwidth][c]{     \begin{tabular}{ccccc}         \hline         \hline         [] & [] & [] & [] & []\\         \hline         \hline     \end{tabular} } \caption{test} \end{table}   This code works.  Anyone have any idea?


In c++11, if I want to match all txt files starting with only lower characters e.g. [a-z]+\.txt writing in regular expression syntax, why do I have to use double escape which is std::regex txt_regex("[a-z]+\\.txt");  Is there any special meaning for \. in C++?

In templates, where and why do I have to put typename and template on dependent names? What exactly are dependent names anyway?    I have the following code:  template <typename T, typename Tail> // Tail will be a UnionNode too. struct UnionNode : public Tail {     // ...     template<typename U> struct inUnion {         // Q: where to add typename/template here?         typedef Tail::inUnion<U> dummy;      };     template< > struct inUnion<T> {     }; }; template <typename T> // For the last node Tn. struct UnionNode<T, void> {     // ...     template<typename U> struct inUnion {         char fail[ -2 + (sizeof(U)%2) ]; // Cannot be instantiated for any U     };     template< > struct inUnion<T> {     }; };   The problem I have is in the typedef Tail::inUnion<U> dummy line. I'm fairly certain that inUnion is a dependent name, and VC++ is quite right in choking on it. I also know that I should be able to add template somewhere to tell the compiler that inUnion is a template-id. But where exactly? And should it then assume that inUnion is a class template, i.e. inUnion<U> names a type and not a function?


problem:X and Y are topological space. $A \subsetneq X$,$B \subsetneq Y$,$X$ and $ Y$ are connected,then $ X×Y-A×B$ is connected.  I want to use difinition of connnectivity,to prove there no  extist a separation of $ X×Y-A×B$,but I didn't make it.Then i want to use some result about union of connect space to do it as like prove ' a finite product of  connected space is connected',but i don't know how to find connected space such that their union is  $ X×Y-A×B$.

I'm reading topology of Munkres and I have a problem that stuck me for a while. I'm so greatful if anyone can help me with this.     Let $A$ be a proper subset of $X$, and let $B$ is a proper subset of $Y$. If $X$ and $Y$ are connected, show that $$(X\times Y) \setminus (A\times B)$$ is connected.   Thanks so much for your consideration ^^


I am using the images as planes addon and when I add an image it always appears on top no matter how I rotate, I don't know if this is intentional but it didn't use to be like that. I am using 2.90.1 Here are some images explaining. Image A and B are centered in 0,0,0 and they are intersectin in the middle and are perpendicular, yet B appears on top always since I added it after A. I add a screenshot with the bug, and a screenshot of how it should look. And no, it is not a matter of the visibility in the viewport display, it is not x-ray, "in front" is not selected. So I solve it by deleteing the material and adding it again, which doesn't make sense. Any clues? How it looks  How it should look

I have a weird problem with my viewport. As the images show, there are some very basic objects. But some textured objects are shown through other objects, although they should be hidden. It's obvious with the gravel – the object with grass texture should conceal a part of the object with gravel texture. On the other hand, the gravel goes some way under the plain white object, and is hidden by it, as expected.    I'm anything but a noob with Blender, but switched recently to 2.82. This problem happens with different objects and different materials, even with Cycles or Eevee. Could this be a graphical glitch? My PC isn't anything but bleeding edge, more kind of usable ol' buddy. Never had this behavior with 2.79b.  Thanks in advance.


sudo apt-get update and sudo apt-get upgrade gives me this result  E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable) E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?  When I check Software Center it shows me 23 new updates available, but when I try to make update it never finish and all the time there is information about 23 new updates.

I get this error when trying to use apt-get:  E: Could not get lock /var/lib/dpkg/lock - open (11 Resource temporarily unavailable) E: Unable to lock the administration directory (/var/lib/dpkg/) is another process using it?     How can I fix this?


Whenever I open a terminal, I always end up with this same error.  -bash: export: `/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin:/usr/local/hadoop/bin': not a valid identifier   And when I run command lines, I get errors like this:  -bash: sudo: No such file or directory   I can't even edit ~/.bashrc through gedit ~/.bashrc which I think could be the problem. echo $PATH gives me an empty line.  All this stuff happens under my personal account. There's a dedicated hadoop user account, which I created specifically for running hadoop and that works fine without a glitch.  In the process of hadoop setup, which involves editing environment variables, I edited ~/.bashrc as instructed by some tutorials.   What could be the problem, and how might I fix it?

I'm trying to setup cocos2dx in Ubuntu 14.04 LTS but after setting the environmental variables (in .bashrc) I start getting this error:  bash: export: dev/cocos2d-x-3.2/tools/cocos2d-console/bin': not a valid identifier  bash: export:/home/john/android': not a valid identifier  bash: export: dev/android-ndk-r10b': not a valid identifier  bash: export:dev/adt-bundle-linux-x86_64-20140702/sdk': not a valid identifier   And I don't know what to do to fix it.


I want to know how to implement related tags functionality on a site like Stack Overflow.  I have questions coming with a set of tags (maximum of 5) as input for training the system. I then have to find out related tags given a single/double/triple tag as input.   Example -    A user lands on page . Observation: User can see list of related tags along with the counts for the tag 1 - solr (in this case)  The user clicks on one of the related tags, . Observation: The user now sees questions related to both the tags and related tags to both two tags selected together as an entity.   I just need to know an efficient data structure and method to implement the same and am not looking for complete code here. I want to know the implementation part and not the way related tags are defined.  The duplicate suggested question discuss about how those related tags are calculated, not how they are implemented. When we talk about implementation, it means taking about data structures and methods. I know already that it's based on occurrence. Please note that difference.  Let me know if I am unclear in asking my question.

I am in the process of creating a forum where user will be creating tags similar to the way Stack Overflow does.   To allow users to discover more and more questions, I liked the related tags in the right which comes when we visit a page of some particular tag.   So, I wanna know how two tags are considered related ? How can I calculate the distance between tags !  I just need the views or algorithm that can be used to calculate the distance.  Thanks !!


I want to generate monthly report and the total in a year based on position(jawatan) that has been applied. Table 1 : tpermohonan (mohon_id pemohon_id mohon_tarikh mohon_online)     mohon_id pemohon_id mohon_tarikh mohon_tkhluput     1 2 2018-12-23 2019-12-23     Table 2 : kod_jawatan (jawatan_id jawatan_kod jawatan_nama)     jawatan_id jawatan_kod jawatan_nama     1 A0001 accountant     My desired output is :     Bil Jawatan(Position) Jan Feb March Apr May Jun July Aug Sep Oct Nov Dec Total

Maybe this question has been asked already (it should be quite simple). I've Googled loads of phrases  (PIVOT, ROWS to COLUMNS, TRANSPOSE &c.) and all I get is  TSQL this, TSQL that and or Oracle this, Oracle that, proprietary function this, proprietary function that well, you get the picture.  I have a simple table structure - if it was any simpler, it'd be a list :-) - i.e. it's two columns.  stock_date       sku ----------       --- 2016-06-01         0 2016-06-02       123 2016-06-03       123 2016-06-04       123 2016-06-06       123 2016-06-07       123 2016-06-03       245 <... &c...>   There may be many thousands of sku's but the date range will be at most a month or so, but can vary, so the code needs to cater for that.   So, I want to make the stock_date field a column.   sku     1   2   3   4   5   6   7 ---     -   -   -   -   -   -   -  123     0   Y   Y   Y   0   Y   Y 245     0   0   Y.... &c.   Ideally, the code would be dynamic and would work with any server (even MySQL).   But if it has to use common table expressions and/or window functions, that's  OK but not proprietary crosstab or pivot functions.


I've been creating a Bluetooth application, everything works fine from turn On and OFF, search device, visible device, open server, set client. Everything works fine and the device could be paired. But when I want to perform data transfer using Input/OutputStream the crash begin.  The code had NO ERROR, but when performing connectedThread function it crashes. here is the code  private class ConnectedThread extends Thread {      private final BluetoothSocket mySocket;     private final InputStream myInStream;     private final OutputStream myOutStream;      public ConnectedThread(BluetoothSocket socket) {         mySocket = socket;         InputStream tmpIn = null;         OutputStream tmpOut = null;         try {             tmpIn = socket.getInputStream();             tmpOut = socket.getOutputStream();         } catch (IOException e) {         }          myInStream = tmpIn;  <-------MainActivity.Java:623         myOutStream = tmpOut;     }      public void run() {         byte[] buffer = new byte[1024];         int begin = 0;         int bytes = 0;         while (true) {             try {                 bytes += myInStream.read(buffer, bytes, buffer.length - bytes);                 for (int i = begin; i < bytes; i++) {                     if (buffer[i] == "#".getBytes()[0]) {                         myHandler.obtainMessage(1, begin, i, buffer).sendToTarget();                         begin = i + 1;                         if (i == bytes - 1) {                             bytes = 0;                             begin = 0;                         }                     }                 }             } catch (IOException e) {                 break;             }         }     }      public void write(byte[] bytes) {         try {             myOutStream.write(bytes);         } catch (IOException e) {         }     }      public void cancel() {         try {             mySocket.close();         } catch (IOException e) {         }     }       Handler myHandler = new Handler() {         @Override         public void handleMessage(Message msg) {             byte[] writeBuf = (byte[]) msg.obj;             int begin = (int) msg.arg1;             int end = (int) msg.arg2;              switch (msg.what) {                 case 1:                     String writeMessage = new String(writeBuf);                     writeMessage = writeMessage.substring(begin, end);                     break;             }         }     };  }   The connectedThread is trigered from here  transferBtn.setOnClickListener(new View.OnClickListener() {             @Override             public void onClick(View v) {                 ConnectedThread t = new ConnectedThread(socket);<------MainActivity.Java:192                 t.start();         });   The Logcat show this     07-14 02:53:04.937  16812-16812/com.example.heszrave.bluetoothremote E/AndroidRuntime﹕ FATAL EXCEPTION: main       java.lang.NullPointerException               at com.example.heszrave.bluetoothremote.MainActivity$ConnectedThread.(MainActivity.java:623)               at com.example.heszrave.bluetoothremote.MainActivity$6.onClick(MainActivity.java:192)   When I click on MainActivity.Java:623, it pointed to myInStream = tmpIn; for MainActivity.Java:192 it pointed to the firing event ConnectedThread t = new ConnectedThread(socket);

What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them?  What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?


So Ron Weasley crashed a car in the Chamber of Secrets.  Do we know what type of car it is? If not book canon, what about movie canon?

What year is the Harry Potter Ford Anglia?  I Googled using "Harry Potter Ford Anglia" and "Harry Potter Ford Anglia Year" and while I was able to get the model number (Ford Anglia 105E), I wasn't able to find a consensus on what year the Harry Potter Anglia was made. I did learn that the particular model of Ford Anglias in Harry Potter were produced between 1959 and 1967 and have distinctive tailfins and a inwardly curving frame on the rear window.   ★ I usually ask for only canon sources, but I have never seen a reference to the Anglia's year in any of the Harry Potter books or J.K. Rowling interviews, or on Pottermore. Of course if you can find the answer in canon, that's great! Per usual, I am not looking for an answer from the HP Wikia or the Wikipedia.


I am taking output of one script, then piping this putput to grep and piping the output of grep into another script:  ./script1 | grep 'expr' | ./script2   However, the second script never gets any input. Again, nothing gets printed when I substitute script2 with cat and script1 with ping:  ping localhost | grep localhost | cat   Same thing happens if I replace grep with awk:  ping localhost|awk '{print $1}'|cat   What is going on?

Using the top command with redirection works fine:  top > top.log   Now I want to use grep to filter a certain line:  top | grep "my_program" > top.log   But the log file will remain empty. But grep delivers an output when using  top | grep "my_program"   Where my_program has to be replaced by a running program to see some output.  Why does my approach not work ? And how can I fix it ?


I've been working on a project with a faculty member (let's call him S) that is not my advisor (let's call him A). They are in different departments, and have little overlap. I am working on something with S (actually I am doing it mostly by myself, with a bit of advice from S) and am planning on publishing the results. I have shared the project with A, but since it's not his field, I know he has at best a vague understanding of the contents of the paper. However he did give the idea for the methodology, which I used. S has continued giving me advice about this paper, mostly relating to expanding on the theory of the methodology he suggested. I don't think it's very useful (he doesn't understand the context) and would prefer to just go in the direction set with S. However, when it comes to authorship, should I include A? It feels wrong to not include him when he has been giving well-intentioned advice (and supplied a crucial suggestion for the methodology). However, it also doesn't feel right to include him, since he isn't familiar with the rest of the contents of the paper beyond the methodology section.

I understand that in a lot of big-lab fields it is common for the principal investigator to append their name to a paper even if they did not write the paper, design the experiment, or collect data since they spend energy securing funding, and managing the whole lab. What about for small labs?  What are the requirements for a supervisor to be included as an author on a paper, as opposed to just appearing in the acknowledgements? If you are working on your own projects independently of your supervisor, but using funding provided by your supervisor (how does this change when the funding provides resources versus just your salary), are you suppose to add them as authors or just acknowledge the source of funding?


Classical situation: you're working in Photoshop on a PSD file and you want a to export it to PNG or JPG.  Here is the usual way: menu File > Save As > Click on Format > Find PNG in the list and select it > Save > PNG Interlace dialog > OK.  A little shorter is to use CTRL + SHIFT + S to do Save As.   Question: is there a way to do all of this in one or two keyboard shortcuts?  Example: CTRL+SHIFT+J: Export to JPEG, CTRL+SHIFT+P: Export to PNG

When working with an image in Photoshop, I'd like to have a simple keyboard shortcut, like in , that automatically does:   Export > Export As or Export > Save For Web  Resize to biggest dimension = 600px (either width or height) Add suffix _600.jpg to filename   How to do that?  I'm not sure how to edit a recorded macro to do that (add the suffix and choose 600px for the biggest dimension).  Example: you open myphoto.png, you press F6 and then you automatically get myphoto_600.jpg.


I got this array of objects  let item = [   { a: 1 },   { b: 2 } ]   and would like to duplicate array's elements to the same array. Output should be:  [   { a: 1 },   { b: 2 },   { a: 1 },   { b: 2 } ]    Can you help?

How do I append an object (such as a string or number) to an array in JavaScript?


Consider the following example:  try:      print "Try this."      exit(0) except:      print "Failed."      exit(1)   When this simple example is executed, the following is printed to stdout:  Try this. Failed.   Forgive me if there is an obvious answer or if this has already been asked, but why does exit(0) (which should give me a clean exit) throw an exception?    I tried using a try: except: loop in an actual use-case script, and found that the script would exit(1) even when the try condition says to exit(0).  So I guess exit(0) is throwing a(n hidden?) exception of some sort, but why?  It doesn't show the traceback (such as when CTRL + C is used to generate a KeyboardInterrupt exception), and results in unexpected behavior such as in my case when I'm expecting a 0 return and end up with a 1 return.  Is an exception (any exception) the only way to exit a python script?

The docs say that calling sys.exit() raises a SystemExit exception which can be caught in outer levels.  I have a situation in which I want to definitively and unquestionably exit from inside a test case, however the unittest module catches SystemExit and prevents the exit.  This is normally great, but the specific situation I am trying to handle is one where our test framework has detected that it is configured to point to a non-test database.  In this case I want to exit and prevent any further tests from being run.  Of course since unittest traps the SystemExit and continues happily on it's way, it is thwarting me.  The only option I have thought of so far is using ctypes or something similar to call   exit(3) directly but this seems like a pretty fugly hack for something that should be really simple.


Recently I upgraded from Ubuntu 16.04 to 18.04. After the upgrade, I did the usual sudo apt-get update to be sure that I will have the latest updates. But when I tried to update my Nvidia drivers, I tried to detect the recommended one with:   ubuntu-drivers devices   and as usual, I got the recommended drivers and the graphics card model:  == /sys/devices/pci0000:00/0000:00:1c.4/0000:04:00.0 == modalias : pci:v000010DEd00001299sv00001043sd0000105Ebc03sc02i00 vendor   : NVIDIA Corporation model    : GK208BM [GeForce 920M] driver   : nvidia-driver-390 - distro non-free recommended driver   : xserver-xorg-video-nouveau - distro free builtin   So when I input the command:  sudo apt install nvidia-390  After reading the package, building etc., I got this message:  Package nvidia-390 is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source However the following packages replace it:   libnvidia-gl-390  nvidia-kernel-source-390:i386   nvidia-headless-no-dkms-390:i386  libnvidia-gl-390:i386  nvidia-kernel-source-390  nvidia-headless-no-dkms-390 E: Package 'nvidia-390' has no installation candidate   I know it says that is replaced but I observe some "pixel spikes" when I move a window. So did it fail. Should I do something else in order to update the drivers?

I'm using Kubuntu 18.04 and have the Nvidia 396 driver installed. It "feels" quite glitchy, and I'd like to try to the Nvidia 387 driver. I tried removing 396 using:  sudo apt remove --purge nvidia-* sudo apt update sudo apt autoremove   I then tried to install the Nvidia 387 drivers using:  sudo apt install nvidia-387   However, it just installed the Nvidia 390 drivers!?  Any idea how I can install the Nvidia 387 drivers?


Curious as to what the protocol is here for when you want to answer your own question.  Say for example I post a question with code illustrating the question. I later on come up with a solution. Now, even with the "improved" code, it could be better.  Is it taboo to answer your own question?  Or is it better to add the "second version" of the code to the original question? Append, prepend?  Or should I delete the original question, and post a new one with the code I came up with?  Other thoughts?

I might want to answer my own question because:  I arrived at a solution before there were any other correct answers or I like mine better, can I still answer my own question?  I have a folder with lists of code snippets for things I always forget or get wrong, such as regular expressions for processing XML, common WinForms control idioms, etc. Is it considered poor etiquette for Stack Overflow to ask a question I already know the answer to, and then self answer, just so it gets recorded on the website?   Related:          For more information, see "" in the .


I search for hours and get thousands of dicussions but get confused. I'm fresher and I want to simply ask my questions. Where is the location of heap memory and stack memory in RAM? Is it like that, when a certain part of the memory is used as a stack data structure, it is called stack memory? And if the same memory is used as a heap, it is called heap memory? I mean, Are they using same memory location in different times? Or are there separate space for stack and heap in memory? I mean RAM is split into portions for performing stack and heap operations.

Programming language books explain that value types are created on the stack, and reference types are created on the heap, without explaining what these two things are. I haven't read a clear explanation of this.  I understand what a stack is. But,    Where and what are they (physically in a real computer's memory)? To what extent are they controlled by the OS or language run-time? What is their scope? What determines the size of each of them? What makes one faster?


All of sudden I experienced -42 total reputations down by some psycho in Stack Overflow. I know its reversible by system , but is there any way to track/find that user. Kindly provide feature to view the down-voter info too in the question or somewhere else.. my repo in SO is 3700+

Possible Duplicate:          Yeah I got a deranged stalker that keeps downvoting me.  Anyone know how going about identifying such individuals?  (I just got 4 all at the same time just after making a new post).      that was the question I originally asked. Please tell me, what is so wrong with it ?


Searched every where on web but I couldn't find out the formula for this series.  That's why I am asking here.  I tried following following formula:  $((n*(n+1))/2)^n$

I am trying to programmatically solve mathematical problem - get sum of all powers from $1^1$ to $1000^{1000}$. So far I have found solution by simply summing powers, but it takes way to long time and not getting any near to final 1000 integer.  Question - is there a formula for this case : get sum of all number powers  $1^1 + 2^2 + 3^3 + .. 1000^{1000}$ ?


I am building an app in JavaScript. I am trying to get my head around how to use this in a JavaScript closure. Currently, I have the following code:  var ExternalResource = require('ExternalResource'); function MyObject() { }  MyObject.prototype.state = "Closed"; MyObject.prototype.execute = function(options, callback) {   if (!options) {     if (callback) {       callback(-1);     }     return;   }    try {     this.state = 'Connecting';     var client = new ExternalResource.Client();     client.connect(function(err) {       if (err) {         this.state = 'Failed';         if (callback) {           callback(-1, err);         }       } else {         this.state = 'Good';         if (callback) {           callback(1);         }       }     });   } catch (ex) {     if (callback) {       callback(-1, ex);     }   } };   I am currently executing execute by a Jasmine test.   it(' - Connect to a local instance', function(done) {   var myObject = new MyObject();   myObject.execute({}, function() {     expect(myObject.state).toBe('Good');   }); });   When this test gets executed, I see the following error:  Expected 'Connecting' to be 'Good'.   I am sure it has something to do with using this.state in the connect callback. Yet, I'm not certain.  Thank you!

I have a problem with an object I have created that looks something like this:  var myObject = {      AddChildRowEvents: function(row, p2) {         if(document.attachEvent) {             row.attachEvent('onclick', function(){this.DoSomething();});         } else {             row.addEventListener('click', function(){this.DoSomething();}, false);         }     },      DoSomething: function() {         this.SomethingElse(); //<-- Error here, object 'this' does not support this method.     } }   The problem is that when I am inside the 'DoSomething' function, 'this' does not refer to 'myObject' what am I doing wrong?


In the movie Tron: Legacy, there's a conversation:  I'm sure it comes as no surprise, who we have to acclaim. The head of our software design team. A man who's father own, uh, notable history with ENCOM, helped make this company, what it is today. Edward Dillinger.  My question is, why they use "own" in this sentence instead of using "owns" or "owned".  Thanks

I'm not a native speaker, but somehow I assumed my English level to be decent enough for me to offer my help with an English text written by a Japanese colleague. I've fixed the most glaring errors, the few that I could find anyway, and at this point I'm pretty satisfied, but there is still this one sentence that lingers.  So, please tell me exactly how weird does this following sentence sound in your beautiful native ears:     My motivations, the things that always encourage me, are not only that   I love my own hometown, but also that I want my children to love their   own hometown too.   What I'm mostly concerned about is the use of "my own hometown." and "their own hometown". At first it sounded strange to me. But after some research it now sounds completely normal to my ears. (As in, I have no clue at all anymore.)   Isn't the "own" there to add emphasis on whose hometown it is? So "my own hometown" makes it completely redundant? But maybe the usage is still okay? After reading it my mind suggests that "my hometown" and "their hometown" may be separate places, but I don't think this is what the author intended. Do you intercept that meaning as well, or is it negligible?


Prove that if $R$ is a principal ideal ring and $S$ is a multiplicatively closed   subset of $R$ then $S^{-1}R$ is also a principal ideal ring.   Thanks for any insight.

Let $A$ be a commutative ring and $S$ a multiplicative closed subset of $A$. If $A$ is a PID, show that $S^{-1}A$ is a PID.   I've taken an ideal $I$ of $S^{-1}A$ and I've tried to see that is generated by one element; the ideal $I$ has the form $S^{-1}J$ with $J$ an ideal of $A$. $J$ is generated by one element but I can't see why $I$ has to be generated by one element, maybe I'm wrong.


I'm getting that we can neither prove nor disprove it, but it seems there's a definitive answer for this. How to prove or disprove this?

I want to prove the following equation:  $$ f^{-1}(B_{1}\setminus B_{2}) = f^{-1}(B_{1})\setminus f^{-1}(B_{2}) $$  Is this a valid proof? I am not sure, because at one point I am looking at $f(x) \in B_1$, but then $x \in f^{-1}(B_1)$ could be actually some different points.  $$\begin{align*} x \in f^{-1}(B_{1}\setminus B_{2}) &\iff f(x) \in B_{1}\setminus B_{2} \\ &\iff f(x) \in B_{1} \land f(x) \notin B_{2} \\ &\iff x \in f^{-1}(B_{1}) \land x \notin f^{-1}(B_{2}) \\ &\iff x \in f^{-1}(B_{1})\setminus f^{-1}(B_{2}) \end{align*}$$


This problem is equal to prove that  $$8\sum_{n=1}^{\infty}\frac{1}{(2n-1)\sinh((2n-1)\pi)}=\ln2$$ I try to use Fourier transform but failed,how to deal with it?

In reference to  about showing that the following interesting series takes on the value  $$\sum_{n=0}^\infty \frac{1}{(2n+1)\operatorname{sinh}((2n+1)\pi)}=\frac{\log(2)}{8}$$  I tried the approach of using the residue theorem, from which one can show that  $$\sum_{n=-\infty}^\infty f(n) = -\sum_k \mathrm{Res}_{z=z_k} [\pi \cot{\pi z} \: f(z)] $$  where $z_k$ are non-integral poles of $\pi \cot{\pi z} f(z)$.  In this case,   $$f(z) = \frac{\mathrm{csch}{[(2 z+1) \pi]}}{2 z+1}$$  There is a pole of order $1$ at $z=-1/2$.  Note that is is not of order $2$ because $\cot{z} \sim (\pi/2) - z$ as $z \rightarrow \pi/2$.  One may then compute the single residue of $\pi \cot{\pi z} f(z)$ as  $$\mathrm{Res}_{z=z_k} \left [\pi \cot{\pi z} \: \frac{\mathrm{csch}{[(2 z+1) \pi]}}{2 z+1} \right ] = -\frac{\pi}{4} $$  So I get as a value for the posted series as $\pi/8$, which is not correct.  Nevertheless, I cannot locate my error.  Perhaps someone can.  For example, the series obviously converges, and quickly.  But is there an error in my assumption that  $$\lim_{N \rightarrow \infty} \oint_{C_N} dz \: \pi \cot{\pi z} \: \frac{\mathrm{csch}{[(2 z+1) \pi]}}{2 z+1} = 0$$  where $C_N$ is a rectaingle symmetric about the real and imaginary axes, extending from $[-N-1/2,N+1/2]$?  Or is there something else I do not see?


I'm considering moving from stock Ubuntu to Ubuntu Studio. My only concern is the low latency kernel. I've looked into what exactly it is, and know it will be great for my audio work, but I am wondering if it has any downsides?  Does it cause compatibility issues? Does it reduce the lifespan of my hardware?  Basically I am aware of the pros of the low latency kernel, I just want to know what the cons are so I can make an informed decision.  Thanks in advance :)

After installing Ubuntu Studio 12.04, I have found that it uses a low latency kernel.   I searched for an explanation and how to change back it to a real-time or generic one. However, it looks like this part of Linux hasn't been covered to explain the details.   Q: Why choose a low latency kernel over a generic or real-time one?  PS: I have already read the answers from  question and  post.


I have a passport from South Korea, and I have a student visa from the Czech Republic valid from January 2017 to september 2017. I moved to Germany on  31st of August and I'm still here. (6th September)   I'm planning to go back to Prague end of this month to apply for a Czech work permit with my boss (it is after my student visa expires, and this month i'm staying in Germany, so meanwhile I need either a temporary residence permit here in Germany or 3 months visa free status(tourism purpose)).  -i know SOUTH KOREAN national applies to 90/180 days schengen visa free tourism system/law.  I asked Ausländeramt (foreigner office) if I can get a temporary residence permit after explaining my situation, but then the guy said I can stay for 90 days, which is until November without visa/residence permit as a tourist.   Since my Korean and Japanese friends told me that I need to get out of the Schengen area and come back, I thought he didn't understand my situation so I explained again and again. He kept saying I am fine.  And from some posts from here the answers said it will be fine as well.  I am afraid of asking the Ausländeramt guy again (in case I'll need to get a temporary residence permit and if he gets fed up with my emails, he won't give me that lol. yup. Germany).  So my question is, am I entitled to that 3 months(tourism purpose) visa free status in Germany right after the expiration of my student visa from the Czech Republic?   (Just in case you are curious what the foreigner office guy said, this is the last email I got from him (I know what he said in this email.) after explaining my situation and he also has a scan of my passport and visas).  Ein aller letztes Mal. Sie hatten ein tschechisches Nationalvisum, sind dann am 31.08.2017 in die Bundesrepublik Deutschland eingereist. Was bedeutet, dass Sie sich in dieser zu touristischen Zwecken bis zum 29.11.2017 aufhalten können ohne ein Visum zu benötigen. Sollten Sie planen über diesen Zeitraum hinaus in der Bundesrepublik zu bleiben, so brauche ich die bereits von mir angeforderten Unterlagen von Ihnen. Eine andere Möglichkeit besteht nicht.)

I have a 1-year residence permit from one Schengen country that is now expiring. Upon its expiration, I would like to get my 90/180 days validity as a tourist to stay, or return here as soon as possible.  I understand that the tourist short-stay scheme is based on the 90/180 days "counter". But what happens if my previous stay was not tourism but residence (as searching year). Wouldn't that mean that I can quickly exit and re-enter the Schengen area to activate my tourist stay?   Also, is there a way to change this purpose of stay without exiting the Schengen area?


I know how to get a weapon with an enchanment higher than the limit. But can you stack up more of these enchantments on the same item?  For example, could you have Sharpness X and Looting X on one sword?  I've been using this command:  /give @p minecraft:diamond_sword 1 0 {ench[{id:16,lvl:10}]}

I'm trying to create an item that can break certain blocks, but also has a colored name in 1.13.2   Here's the command I'm using.  /give iAugust minecraft:shears{display:{Name:"[{\"text\":\"Arcane Shears\",\"color\":\"aqua\",\"italic\":false,\"bold\":false}]CanDestroy:[minecraft:iron_bars]"}}   But it only has a colored name, and it can't break specific blocks.


Which lens is good for beginner with Nikon D3200? Is there any other better lens to replace combo kit or should I stick with the combo kit only?

I am planning to buy a DSLR soon.  Before I zero in on the model, I want to know whether it is advisable to buy a kit (body + 18-55 lens) or not? OR should I go for the camera-body and the lens separately?


Introduction  I am currently building a multiclass spellcaster, and came across this question:    This discussion appears to hinge on the phrase      as if you were a single-classed member of that class.   from p. 164 of the PHB. However, what that means is never discussed in terms of RAW. The twittersphere has produced , alluded to by @Cambio in his answer to the above question, but twitter is not a platform for discussion, and so justification was not forthcoming. Furthermore, tweets are not RAW.  So, to my specific question:  Do you determine spell slots for individual classes throughout character leveling up, then recalculate at the end (as "as if you were a single-classed member of that class" implies)? Or do you only consider one pool of spell slots as explicitly and specifically outlined on p. 164 of the PHB throughout the entire process of leveling up?   As an example, an answer would indicate how the flow of Wizard 4 dipping a level into Sorcerer at character level 5 would go:   Start at Wizard 4. Add 1 level to character as Sorcerer.   Look at number of spells known on table of p. 100.   Look at spell slots on table of p. 100 for a level 1 Sorcerer.   Determine the number of spells known is 2 and level of spell slots is 1.   Learn two level 1 spells based on the spells known of 1st level and higher  section on page 101 for the Sorcerer class.   Look at the actual spell slots of the character from the table on p. 165.    Or   Start at Wizard 4. Add 1 level to character as Sorcerer.   Look at number of spells known on table of p. 100.   Look at spell slots on table of p. 165.   Determine the number of spells known is 2 and highest level of spell slots is 3.   Learn two spells of levels 1, 2, or 3 based on the spells known of 1st level and higher section on page 101 for the Sorcerer class.

The "Your Spellbook" sidebar for the wizard includes the following line:  Copying a Spell into the Book. When you find a wizard spell of 1st level or higher, you can add it to your spellbook if it is of a level for which you have spell slots and if you can spare the time to decipher and copy it.  Does this mean that a Wizard 1/Cleric 19 can copy any wizard spell they find into their spellbook? Is there anything preventing them from casting these spells?


Can a 2D shape that was created in Illustrator be extruded? The svg file imported successfully, but I have not been able to determine how to extrude the shape into a solid object. Does this require a special add-on?

How can I make a bevel, like in the "Gibson," for my personal inscription? Is there an automatic method to do so?


All suggested  for Windows XP/7/8  PUTS WINDOWS 10 in  HIBERNATION (not in Standby).   1) so, for WINDOWS 10, how to put PC into from CMD (batch file)?  2) is there correct keyboard combination (without "choosing this and that", just direct keyboard combination.)

I know that almost everything on Windows, like opening any sort of application, can be done from the command prompt or from the Run menu.  How can I put my computer to sleep or shut it down? What is the command for that?


If one has only one equation in the align environment, that has basically the same effect as if one had used the equation environment. So, why should we ever use equation, given the greater flexibility of align in terms of handling multiple lines and alignment of equations?

I always use align in my documents, and avoid equation. Is there anything wrong with that? My reasoning behind this: align > equation, so why not use it?


When I download a file with firefox, it always asks me with what program I want to open it with, even when that type of file is recognized by the system, and I can double click on it in Nautilus and have it open properly.  This is an example with a deb file, which opens with Ubuntu Software center (as it should) when I double click on it in Nautilus.    I do not want to look for the required program in /usr/bin or whatever in the Firefox dialog, I want Firefox to recognize my system preferences. What I resort to doing now is choose "Download", open Nautilus and double click on the file...  Why can't Firefox recognize my system settings, and how do I get it to?  Thanks!

No matter what changes i make to file associations (actions) in the 'Applications' tab in Firefox, they're totally ignored. For example, i set .wmv and .avi files to open with 'smplayer' but when i download a file and double-click on it (through the 'Downloads' window), it keeps opening with Totem player.    The default file associations through nautilus ('open with' tab) work fine, i.e. i've set smplayer as the default player and when i double-click a video file it open correctly.  I've tried to delete and recreate mimetypes.rdf but that didn't help.  Any ideas on what else should i check?


Here's what I did:   Completely cleared my browser of all cookies Open a new browser window in Incognito mode Navigate to askubuntu.com and log in Open a new tab and navigate to stackoverflow.com   On its first response, Stack Overflow responds with my user profile photo already populated and my notifications in place!  How did Stack Overflow know that I was logged in to the network? Any cookies set by Ask Ubuntu should not have been accessible (from what I understand) to Stack Overflow – a different domain!  Note: This is not a duplicate of "", which is a progress update that does not go into specifics at all. I am looking at least for a bare bones technical explanation.

Update: Universal login is in place and considered "done". If you see anything weird, please submit new bug reports.   As y'all know, our current flavor of "global authentication" leaves a few things to be desired. It's flaky, requires a page refresh, etc. etc. Wouldn't it be nice if you could just sign in once and be automatically logged in across the network?  We are ready to roll out Stage 1 of Project "Make Authentication Suck Less". It is live as of a few minutes ago. What this means right now:  When you log into any Q&A site on the stackexchange.com domain, you will be automatically logged into all other Q&A sites on the stackexchange.com domain + stackexchange.com itself.   is excluded from this.   , , and other Q&A sites with their own domains will still use the old flow.  We are going to recognize you in some ways on sites where you don't have a profile. This is still a work in progress, but most notably you will see "join this community" in the top bar instead of "sign up" and "log in".   But I use multiple accounts! What do? We aren't intending to break the ability to run multiple accounts. The same guidelines as before still apply — we don't officially support that, you might end up with an accidental automatic merge if you're not careful with your credentials, any interaction between the accounts is right out, and so on. If you're already using different browsers or different browser profiles for your accounts, nothing will change for you. If you are somehow logged into multiple accounts in the same browser... I'm sorry to say, but that's a bug even for our current global auth setup. You will now only be able to log into one at a time, and you'll need to log out when you want to switch. (Or start using different browsers.) What's next:  Remember  we tested a few months ago? It's coming back. Stage 2: bring other domains into the fold (this is also live now) Stage 3: make cross-domain experience smoother and support browsers that reject third-party cookies in all conditions (looking at you, Safari) - this is not currently feasible. Safari users and users who reject third-party cookies will need to sign in separately to every second-level domain (e.g. stackexchange.com, stackoverflow.com, etc).  If you see any issues… Good luck, because you probably can't log in to report them here. =) But seriously, let us know via the contact form linked at the bottom of any page. If you are able to log in, report issues here on meta as normal. So, in conclusion…


If two fraction add up to 1, what is the relation between their denominators? Are their denominators equal?  If $\frac{a}{b}+\frac{c}{d}=1$, then, is what is the relation between $b$ and $d$?  I was working on a problem. To solve the problem i need to know the relation between the denominators of fractions which add up to 1. I have tried to find out a relation by using the given equation but i could not obtain any useful result. I have searched the internet but could not find any help.

I have to show the following:"If the sum of two irreducible fractions with positive denominators is an integer, then the denominators are equal." $$\frac{a}{b}+\frac{c}{d}=k, \text{ where k an integer }$$ Since the fractions are irreducible, $(a,b)=1$ and $(c,d)=1$. Right? But how can I continue??