NullPointerException Error when Reading an Array Element from a File - Java

In my program, I create an attraction and fill out the number of ticket types, is title and cost, and then I exit the program and run it again.  I have a constructor that reads elements from a file. When I then try to read an array element, it gives me a NullPointerException error even though the element is not null.  When I comment out the code block below where the error is located, I get a NumberFormatException error instead for the input string, "Tour Only", so I know it's not null.  fileScanner.nextLine(); for (int i = 0; i < getTicketTypesNum(); i++)     this.ticketTypeTitle[i] = fileScanner.nextLine(); fileScanner.nextLine();   The code in full is below.  Attraction.java  // The constructor. public Attraction(Scanner fileScanner) {   ...    // The data read before the error.   fileScanner.nextLine();   this.ticketTypesNum = Integer.parseInt(fileScanner.nextLine());   fileScanner.nextLine();    fileScanner.nextLine();   for (int i = 0; i < getTicketTypesNum(); i++) {     // Line where the error is located.     this.ticketTypeTitle[i] = fileScanner.nextLine();   }    fileScanner.nextLine();   for (int i = 0; i < getTicketTypesNum(); i++)      this.ticketTypeCost[i] = Integer.parseInt(fileScanner.nextLine());   fileScanner.nextLine();    ... }   // Store the attraction information and write it to file. public void writeData(PrintWriter pw) {   ...    pw.println("Number of Ticket Types:");   pw.println(getTicketTypesNum());   pw.println();    pw.println("Ticket Titles:");   for (int i = 0; i < getTicketTypesNum(); i++)     pw.println(getTicketTypeTitle()[i]);   pw.println();    pw.println("Ticket Costs:");   for (int i = 0; i < getTicketTypesNum(); i++)     pw.println(getTicketTypeCost()[i]);   pw.println();    ... }   If you need more code, I'll edit my question to include more.  Thank you for your help!  UPDATE  I tried commenting out the line where I had the error out and continued running the code, and I get a NullPointerException whenver I have to read an array element.


Can I enter the UK as a UK citizen and resident on an Australian passport?

I'm about to travel to Europe and have misplaced my UK passport. I have an Australian passport which allows me entry to the the European countries in question without a visa.  However, what is the situation with me re-entering the UK on my Australian passport? Given the Australian passport will only let me stay for 90 days if I was not a UK citizen, is this likely to cause a problem when I come to leave or enter again in the future?  I have a UK birth certificate and could probably bring other forms of ID/proof of address if that helps.  Thanks, Andy.


I recently learned an amazing fact via .     "A good forensic examiner can recover the original data from a hard disk that’s been erased as many as nine times"   Curious to understand how this is possible, I looked into how erasing works.  At first sight, the fact above can be explained by the fact that "Most file systems only remove the link to data" (). However, what I found most mystifying, is the following sentence: "But even overwriting parts of the disk with something else or formatting it may not guarantee that the sensitive data is completely unrecoverable". How can that be?


"ORA-01950: no privileges on tablespace 'SYSTEM' " : What error is it?

Earlier I created a user :  SQL>create user suhail identified by password SQL>User created. SQL>Grant create session,create table to suhail; SQL>Grant Succeeded.   but when I login as suhail and try to create a table I get an error saying ORA-01950: no privileges on tablespace 'SYSTEM' .  What error is it ? Why does it occur ?    SQL> connect suhail Enter password: Connected. SQL> create table suhail_table(name char(10)); create table suhail_table(name char(10)) * ERROR at line 1: ORA-01950: no privileges on tablespace 'SYSTEM'   I am using Oracle Database 11g Express Edition Release 11.2.0.2.0


I have a special field in my bibliography, called adsurl, and I would like to display this url in my file as a link.  However, when I try this, href throws a very weird error. It enters some sort of infinite loop where it keeps saying   ! Undefined control sequence.  \filename@simple ...#2\\}\fi \edef \filename@base                                                {#1}   MWE:  \documentclass[a4paper,12pt]{article} \usepackage[utf8]{inputenc} \usepackage{filecontents}  \begin{filecontents*}{\jobname.bib} @online{elk,  author       = {Anne Elk},  title        = {On the Theory of Brontosauruses},  adsurl       = {https://example.edu/~elk/bronto.html}, } \end{filecontents*}   \usepackage[hyperref,backend=biber]{biblatex} \usepackage{hyperref} \addbibresource{\jobname.bib}  \begin{filecontents*}{biblatex-dm.cfg}  \DeclareDatamodelFields[type=field, datatype=literal, skipout=false]{adsurl}  \DeclareDatamodelEntryfields{adsurl} \end{filecontents*}  \begin{document}  \cite{elk} %this works  \citefield{elk}{adsurl} %this also works  \href{\citefield{elk}{adsurl}}{ads} %this does not work \end{document}   How can I get href to accept the output of citefield as url?


Use virt-manager to share files between Linux host and Windows guest?

Is it possible to use "Filesystem Passthrough" virtual hardware option inside virt-manager to share a folder on my Linux host with my Windows guest? I found some tutorials for how to do this with a Linux guest, but when I try this with my Windows guest I receive the following error message when attempting to start the VM:  Error starting domain: Unable to read from monitor: Connection reset by peer  Traceback (most recent call last):   File "/usr/share/virt-manager/virtManager/asyncjob.py", line 100, in cb_wrapper     callback(asyncjob, *args, **kwargs)   File "/usr/share/virt-manager/virtManager/asyncjob.py", line 122, in tmpcb     callback(*args, **kwargs)   File "/usr/share/virt-manager/virtManager/domain.py", line 1210, in startup     self._backend.create()   File "/usr/lib64/python2.7/site-packages/libvirt.py", line 698, in create     if ret == -1: raise libvirtError ('virDomainCreate() failed', dom=self) libvirtError: Unable to read from monitor: Connection reset by peer   I tried sourcing some documentation but all I could find was .


Homomorphism between $\mathbb{Z}_m$ and $\mathbb{Z}_n$ if $m\mid n$

How can I show $\phi:\mathbb{Z}_m \to \mathbb{Z}_n$ defined by $$ \phi(k) = k\mod{n} $$ satisfies $\phi(k +_m l) = \phi(k)+_n \phi(l)$ when $n\mid m$. I have tried using remainder terms but the solution gets messy as I have mod n's and m's and cant get rid of them.


How to deal with an otherwise salvageable post with a spam link?

I'm coming across several posts (mostly questions) recently. They all come from new users. Those posts seem OK: they're on-topic and is only an edit away from a decent post for beginners to SE, except that there's a spam link, usually near the end of the post (So I call those posts otherwise salvageable).  I prefer a red flag but would that be too harsh?  I see this in :     If an otherwise valid post contains vulgar words as an expression of frustration, edit the bad part out instead of flagging the entire post as rude or abusive. If this results in an edit war or rollback war, flag for moderator attention.   It's about the rude or abusive flag. Is it the same for otherwise valid spam posts?    Note: I see this kind of posts on various sites, on some of which I don't have enough rep for full edit privilege.


How to tell if a certain package exists in the apt repos?

I am specifically interested in determining whether a 32-bit version of OpenJDK 8 exists in the apt/Ubuntu repos.  According to , you can install the 32-bit version of the Open JDK 7 packages via:  sudo apt-get install openjdk-7-jre:i386   How can I do the equivalent of an ls -al to see what packages exist for OpenJDK 8, and specifically, the 32-bit ones?


Does Emma Roberts say "not so much on the nose" at time code: 6:28 to 6:34  If it is right, so what does it mean?


I've almost completed the main quest and I've done a few side quests, and now I'm level 24. I am trying to defeat Alduin but I can't pull it off. , so something else is wrong.  My strategy so far has been to send in followers to help me, but they don't die and I do. I have fast healing but I don't have enough mana to keep it up.  What am I doing wrong? What strategy works to defeat Alduin?


Using string functions, how i get values form html attributes in C#?

I have html code like that:

   I am developing function findvalue in C#:  if (line.Contains("title")) {     sTitle = findvalue("title", line); }   findvalue function is simple string opreations function which work like that for this line  find function will retrun News Letter value, similarly I will get value of other attributes like href, src atc


Ubuntu 18.0.4 LTS: Realtek Wifi adapter RTL8723DE HP laptop WIFI SIGNALS TOO WEAK

I installed 18.0.4 LTS as well as rtl8723de drivers  The drivers work only when the wifi device is just close to the laptop..  When the wifi device is even slightly away the laptop cannot connect to the wifi device and errors ut saying "Connection Failed Activation of Network Connection failed"   Another laptop with Windows OS right next to this Ubuntu loaded laptop works fine and connects to the same wifi with 'full' signal strength  I called HP Technical support - HP declined to provide any driver support on laptops loaded with anything other than Windows.  Please help what should I do in order to make my new laptops work.   Thank you.


How to control Bluetooth wireless radio from the command line?

This question is almost the same as , but with one major difference; I want to turn on/off Bluetooth from the command line (bash or similar), NOT from AppleScript - the answers for this I saw on superuser all used AppleScript.  I would guess that networksetup might be useful but have no idea what interface(s) to interact with - I would like an answer including a complete command I can run (and understand) - if device model matters, it's Snow Leopard on MacBook2,1 to MacBook7,1, except MacBook5,1, and if you can only do for 6,1 and 7,1 that's fine.


Is it possible for decision trees to consider less features than in my training set?

I was looking at the decision tree algorithm and I wondered that for example if the training set has 20 features but only 5 features are important and classification can be done by using only them then will my end result decision tree has only 5 features? My understanding is that as decision tree is a kind of greedy based algorithm, so I believe it will only consider those features which can be used for the best fit of the training data and ignore the rest of them.


Joint Probability Functions - How to work out distribution of X-Y?

I dont know how to work out $P(X-Y<a),$ if anyone could help with this it would be appreciated!


How do I stop automatic updates in Windows 10 home?

I've been searching the web and all I can come up with is workarounds or disabling the update service completely.  You used to be able to choose download but don't install or let me decide.  I don't like updates before I have a chance to read up on possible bugs.  I have a few friends who have issues with recent updates.  Is there a way to accomplish this?


Movie where an object is recovered from space and brought back to earth

When no one is looking it starts to assemble either itself or other robot creatures from objects found around the room.  This is NOT one of the recent Transformer movies, it probably dates back to the 80's as I rented it on VHS.


I am wondering if it is possible to add a new property as an extension property to the string class. What I'm looking for is something like this  string.Empty   I would like to make an extension, ex:  string.DisplayNone;   Can I add extension properties to the string C# class that I can call in a similar manner like when I do string.Empty?


I have  code like belowe :  set         {             iDate = (DateTime.Parse(value).ToPersianDateString());         }   ToPersianDateString is a Extension method to convert 2016 to 1395 e.x.  this code work very well but in windows 10, below code , retrun an exception   DateTime.Parse(value)   my value is : Aug 31 2016 12:00AM   Exception message is : String was not recognized as a valid DateTime. why it return error ?  I think problem is Aug .


Usually every simple harmonic question starts with the line:  The block at equilibrium shifted to a position $X_0$ and released.   I found this from the website:       This equation has a sine in it, and a sine graph starts at zero. Using this equation is like starting your mathematical stopwatch in the middle of a pendulum swing: t = 0 is in the center of the oscillation. If, on the other hand, you replace sine with a cosine, then the equation is still correct; you're just starting to measure time at the maximum displacement instead.   Now if this holds true then most of my question in my textbook in which the mass is  slightly displaced from an equilibrium point uses the sin equation instead of cos. Aren't we measuring motion from the Amplitude point at t=0... Why the discrepancy


Turn a LED on and one off, with a single Reed switch

I would like to create a circuit in which a Reed switch is able to switch current between two LED. Is this possible without any IC or others components?  One led is on and one off, until the Reed switch is activated. I saw this working with 2 different load (led and lamp / led and motor) and I'm thinking If the same is possible with 2 LEDs.  5V used in the circuit.  I know there are 2 kind of Reed switch, and I do not care about which to use if it solve the problem. I anyway prefer to use the NO one.


The goods of forcing the user to follow a path

Maybe this is not the best place to ask as this seems to me like a question regarding two fields: marketing and user experience.  Hopefully some of my questions could be solved from the user experience point of view.  I've seen recently many important sites using the mouse hijacking technique to create some full screen scrollable sites, such as:    Apple (in its old iPhone 5C site)       Clearly, besides all the popular believe about the bads of using those kind of sites, there is something GOOD about it.  All those sites are in one way or another an advert kind of site. Trying to sell or show somehow the benefits of their product.  Small texts, big and beautiful images...  They can all be wrong about it, but I like to believe these companies has great UX and marketing teams and that they know what they are doing when they decide to go for one or another design for their products.  Marketing has its own books and rules, and I'm pretty sure there's something good about this design oriented to marketing.  Just wondering if somebody could point me to some articles about the topic or name some benefits from the UX point of view taking into consideration they are all advert sites.  I'm not expecting to read anything about its responsive problems and so on. If the site is designed properly, those shouldn't happen.


Probability of getting two consecutive tails on the $n^{th}$ and $(n-1)^{th}$ toss for a biased coin.

The experiment goes like this. The coin is tossed repeatedly and independently until two successive tails are obtained. And the probability of getting a head is $p$. Let $q_n$ be the probability that we stop at $n^{th}$ coin toss. What is the recursion for $q_n$?


SEO - Delete old indexed pages from Google 301 vs 404?

We're launching new website with new url structure and new content. Domain is the same. Many old pages are indexed by google. Should I use 404 or 301 and redirect to '/' for these old resources? I also want to remove these pages from google index.


Upgrading Firefox fails. lzma error: compressed data is corrupt

Firefox fails to update due to corrupted download (deb)  Preparing to unpack .../firefox_32.0+build1-0ubuntu0.14.04.1_i386.deb ... Unpacking firefox (32.0+build1-0ubuntu0.14.04.1) over (31.0+build1-0ubuntu0.14.04.1) ... dpkg-deb (subprocess): decompressing archive member: lzma error:  compressed data is corrupt dpkg-deb: error: subprocess <decompress> returned error exit status 2 dpkg: error processing archive  /var/cache/apt/archives/firefox_32.0+build1-0ubuntu0.14.04.1_i386.deb (--unpack):  cannot copy extracted data for './usr/lib/firefox/libxul.so' to '/usr/lib/firefox/libxul.so.dpkg-new':   unexpected end of file or stream Please restart all running instances of firefox, or you will experience problems.


How to set use tor DNS as the default DNS?

I want to have all DNS queries passing through tor.  How to set my default DNS to go through tor?  In other word I want to use the IP given by tor-resolve google.com instead of dig google.com.


Using the present tense for future event?

I am not sure if we can use the present for future events. I know we can use the historical present for past event, but I am not sure if we can use the present for future events.  Here's an example sentence where the present is used for future events:     You should ask God "What is the meaning of life" when he judges your   soul.   Is judges being in the present tense ok in this case?


How do I to properly handle spaces in PHP Shell_exec?

I'm running on win2003 server, PHP 526, via the cmd-line.  I have a cmdline string:  $cmd = '  "d:\Prog Files\foo.exe" -p "d:\data path\datadir"  ';     Trying to do this in php code  $out = `$cmd`;       # note use of backticks AKA shell_exec   results in a failure by foo.exe as it interprets the -p arg as "d:\data".  However, the same $cdm string copied to the windows shell cmdline executes successfully.  How do I properly handle spaces in PHP shell_exec?


Story where aliens visit a post-apocalyptic Earth and they find the remnants of humanity

I read this short story a year and a half ago and I can't for the life of me remember where I found it, the name of it nor who wrote it.  It starts off with some aliens, who can only speak from direct contact, from Mars visiting the planet one closer to the sun (Earth) to make some observations, take data, etc. and one of the aliens, who they call a 'poet' decides they wish to stay behind and the captain of the aliens reluctantly lets them go.  The poet then goes on to create a home, and eventually finds a human child who they look over and nurse back to health. Over time they eventually meet an older human who threatens them with a gun before agreeing to assist them. As the story progresses more and more humans congregate to make sort of a town and they start getting better and better until the alien starts to appear sick and dying, so they go into hibernation.  The story ends with the original martians coming back and finding the settlement, now larger, and talking about the poet.


Sometimes we see a mask is used by an actor of a film by which he drastically changes his face. I was under the impression that only after plastic surgery one can change his face. I stumbled upon this question while watching . Here it is shown  changes his face drastically by using such mask to s face. I believe such mask does not exist because from IMDB I found Hrithik had a special appearance(I believe only for the face changing scene) in that movie. I am posting the screenshots to make you guys more clear about which mask I am talking about. Here Don i.e. Shahrukh Khan opens the mask:  Hrithiks Face  Opening the mask  SRK showing his face I remember similar masks were shown in MI 2 and 3. So how is this scenes done if the mask is not real?


How does extending a field affect matrix similitude?

Suppose we have fields $\mathbb{K}_1, \mathbb{K}_2$ such that $$\mathbb{K}_1 \subset \mathbb{K}_2.$$      Question Let $A, B$ be square $n\times n$ matrices over $\mathbb{K}_1$. If there exists $P_2 \in \mathrm{GL}(n, \mathbb{K}_2)$ s.t.       $$ P_2^{-1}AP_2=B, $$      then there exists $P_1 \in \mathrm{GL}(n, \mathbb{K}_1)$ s.t.    $$ P_1^{-1}AP_1=B. $$   Is it true?


How does an IBM ServeRAID controller know which drive to recover during a RAID1 rebuild?

I have an old IBM x3550 7978 server at work, which has a ServeRAID 8k-l RAID controller. I setup RAID 1 on it, and it seems to work great, but before I run any production OS on it, I want to know how the recovery procedure works.  I've spent hours looking through documentation for an answer, but so far haven't found anything. This is what I want to know:  If I unplug drive 2 and boot the OS from drive 1, the RAID will be degraded, but it will boot.  If I then unplug drive 1 and boot the OS from drive 2, the RAID will also be degraded, but will still boot.  If I connect both drives at that point and boot, which does the ServeRAID controller use as the master during the rebuild? The last one that was plugged in? The last one that had writes to it?  There's an answer  that explains that a generic RAID controller will probably use one of the two methods above to pick a master drive to recover. Are there other methods a RAID controller might use to pick a master? Anyone know what method my specific RAID controller might use to pick a master?  Update: I did the above experiment. In it, drive 2 was the first to get unplugged, but the last to have writes. The controller chose to clone drive 2. Was drive 2 definitely chosen because it was the last to have writes to it, or could there be a different reason it was chosen?


What is the right site on the Stack Exchange network for computer science questions?  None of the answers I can think of are remotely satisfying:   : Even if CS questions are acceptable (, which I think shows they're not getting the right audience), where is the expertise to answer them? It would be . Also a site about computer science would need LaTeX markup, which SO lacks. : Same problems as SO, only worse (and the bulk of CS questions would be  there anyway). : That's for  questions only, so what about the other 99%? : That's , but not the other 95%: e.g.  are ok in the abstract but not more implementation-oriented questions (e.g., not data structures). : the proposal was closed as a duplicate (of what? My impression is that the closers mainly had TCS.SE in mind, but that would be based on a mistaken perception of what TCS.SE is about, as seen above). Many different SE sites for subfields of CS: , , , , , … But why not follow the SO and Math.SE model of one big site?    , but that was before SE2.0 which has completely changed the scope.     On a closely related note, I've searched for a number of keywords where I would expect some activity on a computer science Q&A site. (Note: there is definitely a bias in the keywords related to my background — suggestions for an objective keyword list would be welcome — but I wrote the keyword list before I did any searching.) These are topics that are typically taught in undergraduate or graduate courses (so basic questions about them are out of scope for ). I'm only considering hits in questions, since here I'm looking at the kinds of questions people ask, not what people might mention in passing in answers.   strongly normalizing (0) lambda calculus (43) theorem provers (): coq: (13), agda/agda2: (5), twelf (0), isabelle (0) linear logic () abstract interpretation (16 hits total, few in questions, though most are good CS questions) model checking:  (3, not particularly science-y; some questions without the tag are more science-y) bisimulation (0; 3 answers) basic block (71 hits, ranging all over the board; I haven't counted the questions)   What this tells me is that a lot of subjects that I learnt about in CS courses don't receive any questions. There seems to be a gap between the first two undergraduate years or so (mainly introduction to programming and algorithms), which get reasonable coverage at SO, and graduate students' first research projects, which is where TCS.SE starts.    Computer science has more applied topics that don't fit well on Stack Overflow either. For example,  don't seem to fare well.


How do you add multi-line text to a UIButton?

I have the following code...  UILabel *buttonLabel = [[UILabel alloc] initWithFrame:targetButton.bounds]; buttonLabel.text = @"Long text string"; [targetButton addSubview:buttonLabel]; [targetButton bringSubviewToFront:buttonLabel];   ...the idea being that I can have multi-line text for the button, but the text is always obscured by the backgroundImage of the UIButton. A logging call to show the subviews of the button shows that the UILabel has been added, but the text itself cannot be seen. Is this a bug in UIButton or am I doing something wrong?


Is there a way to know how long is left until I can post another question?

When I try to add a second question to a S.E. community and get this:    It makes me a bit depressed. S.E. has great design and UX but I really wish there was a little counter to tell you when you can post next.  Do I have to go hunt my last question through my profile page? Or what's the best way to know in how many minutes I'll be able to post next?


How to hide the [@] in a Minecraft command block

As most Minecraft command blocks makers know, if we use the /say command to output text, this will happen:     [@]Lorem ipsum   The [@] is actually very annoying, how can I remove it?


Are gaussian integrals also valid for complex constants?

In the WP article about , there is an integral solved as: $$K(x,x';t)=\frac{1}{2\pi}\int_{-\infty}^{+\infty}dk\,e^{ik(x-x')} e^{-\frac{i\hbar k^2 t}{2m}}=\left(\frac{m}{2\pi i\hbar t}\right)^{\frac{1}{2}}e^{-\frac{m(x-x')^2}{2i\hbar t}}$$ I was trying to find out how to evaluate the integral, using the method of "completing the squares" at the exponential. But at the end, I came up with $\gamma\int_{-\infty}^{\infty}e^{i\alpha (z-\beta)^2}dz$, where $\gamma$, $\alpha$ and $\beta$ are constants. The answer of the WP can be reached if it is solved as a gaussian integral: $= \gamma \sqrt{\frac{\pi}{i\alpha}}$ But is it valid to use the formula of the gaussian integral for a complex constant? When I look at the main integral (of K), the exponentials are after all oscillating functions, that don't have necessarily  to go to zero at infinity.


Should quantitative predictors be transformed  to be normally distributed?

I am always struggling with normality testing for quantitative predictors (no factors) and transforming them to normality.    If I am running a GLMM and my predictors are really non-normal, should I  transform them as well to try to make them normally distributed?  I know that this is important for the response variable but what should be done with predictors?   P.S.: I really could not find a similar question.


My Google chrome update stop at some percentage

I am using android 9. Google chrome update stop at 56%. Sometimes it stop 82%. I am not able to update fully.


Android spawning a new background Thead through anonymous inner classes. Include new Runnable() or not?

The questions refers specifically to spawning threads through anonymous inner classes, and not at a class level extending Thread / implementing Runnable. If they are the same please explain why.  Can anyone explain what the difference is between these 2 ways of spawning a new background Thread in Android:  1. With new Runnnable      Thread backgroundThread1 = new Thread(new Runnable() {         @Override         public void run() {             // Do stuff in background         }     });     backgroundThread1.start();   2. Without new Runnnable      Thread backgroundThread2 = new Thread() {         @Override         public void run() {             // Do stuff in background         }     };     backgroundThread2.start();


Here's the code,  class Music(models.Model):     visits = models.IntegerField(default=0, blank=True)  def music(request)     ......   Though it's not a good way of doing it but how can I increase 'visits' by +1 whenever view 'music' is requested ?  Please help me, thanks in advance!


What to call someone who knows How to Search for a information?

I am looking for a single word to describe someone who knows how to search for an information in a knowledge base.


I have this Hash Set code and when I try to run my compile method on it I get the Null Pointer Exception: null  error on it. Here is the code:  private void initKeywords() {         keywords = new HashSet<String>();         keywords.add("final");         keywords.add("int");         keywords.add("while");         keywords.add("if");         keywords.add("else");         keywords.add("print");          }      private boolean isIdent(String t) {         if (keywords.contains(t)) {  ***//This is the line I get the Error***             return false;         }         else if (t != null && t.length() > 0 && Character.isLetter(t.charAt(0))) {             return true;         }         else {             return false;         }     }   The other lines that goes along with this error is:   public void compileProgram() {                 System.out.println("compiling " + filename);         while (theToken != null) {             if (equals(theToken, "int") || equals(theToken, "final")) {                 compileDeclaration(true);             } else {                 compileFunction(); //This line is giving an error with the above error             }         }         cs.emit(Machine.HALT);         isCompiled = true;     }    private void compileFunction() {         String fname = theToken;         int entryPoint = cs.getPos();           if (equals(fname, "main")) {             cs.setEntry(entryPoint);         }          if (isIdent(theToken)) theToken = t.token(); ***//This line is giving an error***         else t.error("expecting identifier, got " + theToken);          symTable.allocProc(fname,entryPoint);          accept("(");         compileParamList();         accept(")");         compileCompound(true);         if (equals(fname, "main")) cs.emit(Machine.HALT);         else cs.emit(Machine.RET);     }


Which $n$ can be expressed as $x^2 − y^2$?  Attempt: Any number which is odd or or which is a multiple of 4.


I want to know how I can parse a website using VB.net. Basically There is a table in a page that I need to update the database with what is inside it. So I need to be able to capture whatever is within   and then get all the columns and rows and put them in a datatable object. Any help is appreciated


Proving $\sum\limits_{k=0}^n \binom{n}{k} = 2^n$ by counting in two ways

Prove $$\sum_{k=0}^n {n \choose k}=2^n$$ by proving that both sides of the formula represent the number of subsets of a set of $n$ elements. For the left side use the addition rule for counting after partitioning the collection of all subsets according to size. And for the right side use the product rule for counting after identifying a subset $A \subset \{1, 2, ..., n\}$ with the sequence of zeros and ones which is the indicator of $A$.


Install Sierra on Macbook Pro shipped with High Sierra

New MBP purchase shipped with High Sierra. I'd like to downgrade to Sierra but am running into the issue that you can't install a version of the OS lower than what was shipped. The explanation I found is that the drivers don't exist, but I know for a fact that the drivers exist since there is another MBP at my company shipped just a few months prior with the same specs, running Sierra. Is there any way to force this laptop to boot into a bootable Sierra install USB drive so I can perform the downgrade? I can't even get this laptop to boot from a live Linux USB, I just get a giant "No" icon. It seems li  I've tried to sidestep it a few ways, none of which have worked. I'm now thinking of trying to clone the hard drive from the other MBP I have that's running Sierra onto the new one. I wish I knew how Apple was able to perform this restriction. I imagine it's just a piece of information somewhere with a version check, if I could find that file maybe I could lower the minimum version?  I'm not willing to put High Sierra on my network yet, it doesn't play nice with profile management or Munki. I also really don't like the idea that I've purchased hardware which doesn't allow me to install the software I actually want. I know Apple is "Big Brother-ish", but this obnoxious. For what they charge for hardware, I should be able to do whatever I want to this machine.  My rant aside, does anyone have any insight on a method to get around this restriction?  EDIT:  In regards to the duplicate flag, I had read all of the referenced articles before posting, but asked this anyway because I wanted to know if it was possible to circumvent the protection. As I said, I find it very difficult to accept that I've purchased a piece of hardware which I won't let me use it the way I want to use it.


I have been wondering why a fluid in a rotating container has a parabola shape? Is it possible to prove this mathematically?


Surely You're Joking, Mr. Feynman! $\int_0^\infty\frac{\sin^2x}{x^2(1+x^2)}\,dx$

Prove the following \begin{equation}\int_0^\infty\frac{\sin^2x}{x^2(1+x^2)}\,dx=\frac{\pi}{4}+\frac{\pi}{4e^2}\end{equation}  I would love to see how Mathematics SE users prove the integral preferably with the Feynman way (other methods are welcome). Thank you. (>‿◠)✌  Original question:  And of course, for the sadist with a background in differential equations, I invite you to try your luck with the last integral of the group. \begin{equation}\int_0^\infty\frac{\sin^2x}{x^2(1+x^2)}\,dx\end{equation}  Source:


I would like to build my own local repository on my LAN, so that machines on the LAN can update and upgrade from it. I want to download the packages and store them on my local server so that I can update, upgrade, install, etc, from it without using the internet.


Showing Equivalence between a Proposition and the Axiom of Choice

I am trying to establish the equivalence between the following statement and the Axiom of Choice:  Suppose that $R$ is a relation between two non-empty sets $A$ and $B$. There is a function $F$ with the same domain as $R$ such that $F \subseteq R$.  I have established the direction from the Axiom of Choice to this statement. My proof goes as follows. For each set $x$, we may define the following set: \begin{equation*} A_{x} = \left\{y \in B: \langle x,y \rangle \in R\right\}. \end{equation*} Specifically, if $x \in \operatorname{dom}\left(R\right)$, then $A_{x} \neq \emptyset$. Further, we may define the following set: \begin{equation*} S = \left\{A_{x}: x \in \operatorname{dom}\left(R\right)\right\}. \end{equation*} It is obvious that $S$ is a set of non-empty sets and $\bigcup{S} \subseteq B$. According to the Axiom of Choice, there is a function $h: S \to \bigcup{S}$ such that \begin{equation*} \left(\forall T \in S\right)\left(h\left(T\right) \in T\right). \end{equation*} We may define a function $F: \operatorname{dom}\left(A\right) \to B$ such that \begin{equation*} F\left(x\right) = h\left(A_{x}\right),\ x \in \operatorname{dom}\left(R\right). \end{equation*} It is obvious that $F \subseteq R$. I am wondering how to establish the reverse direction. I understand that there are already several equivalent forms of the Axiom of Choice. For instance, the following statement is the axiom used in my proof above:  Suppose that $\mathscr{F}$ is a family of non-empty sets. There is a function $h: \mathscr{F} \to \bigcup{\mathscr{F}}$ such that for each $A \in \mathscr{F}$, $h\left(A\right) \in A$.  We also have the following versions:  Suppose that $\mathscr{F}$ is a family of disjoint non-empty sets. There is a function $h: \mathscr{F} \to \bigcup{\mathscr{F}}$ such that for each $A \in \mathscr{F}$, $h\left(A\right) \in A$.   Suppose that $M$ is a non-empty set. Then there is a function $h: \mathscr{P}\left(M\right)\setminus \left\{\emptyset\right\} \to M$ such that for all non-empty subsets $A$ of $M$, $h\left(A\right) \in A$.  Can anyone help with completing the proof?


Why doesn't Wolverine appear in his iconic costume in X-men?

I'm just wondering why Wolverine does not appear in his iconic costume when even in The Wolverine, there is apparently a deleted scene to show such a costume?    This deleted scene can be scene in the DVD/Home Release extras.


How do I bring back the little menu under the main window?

So I'm working in Blender and I've just learned how to use shape keys through this awesome tutorial:   Except now that really helpful menu section(highlighted in red in the screenshot) is now gone and I don't know how to bring it back. I'm getting better with Blender but I would still count myself as a beginner/learner, so any advice would be greatly appreciated :)


Linux Live USB's will not boot on MSI GT70-2OC

I recently got a new laptop for Christmas, I love it. There is one crucial error though. It runs Windows 8. I cannot stand Windows, let alone Windows 8. I want to keep Windows 8 for the simple fact that this is a gaming PC, and sadly Linux is in the shallow end of the dream pool in that department. I cannot get the Ubuntu live USB to boot. In fact I cant get any Linux USB's to boot. I have tried every suggestion I have seen, other than updating the UFCI BIOS. That scares me. I have tried going into legacy mode, changing the way the SSD works, turning off fast boot, turning off secure boot, and  I even turned off the MSI boot logo. Nothing worked. I can boot into the USB but when I select Try Ubuntu without installing, it goes to a black screen and that's it. Any help would be appreciated.  Specs: 16 GB of RAM 750 GB SSD Intel core i7 Nvidia GeForce GTX 770M  If you need any other info feel free to ask.


Most extra time games played in a World Cup

Croatia has played in the extra time of each of their first 3 knockout stage games in the 2018 World Cup. They played Denmark, Russia, and England in the round of 16, quarterfinals and the semifinals respectively.  What is the most number of games a team has played extra time in a single World Cup? Similarly what's the most number of consecutive extra time games played in a single World Cup?


Your connection is not secure Certbot / LetsEncrypt

I have enabled SSL for my https://example.com and that works fine, but if somone try's to enter https://www.example.com I get the message: Your connection is not secure.  Is there a way to redirect all WWW to non-http before checking the SSLcertificate? or does this need to be done on the domain dns settings?


Use of emplace function of std::variant in template

I am experimenting with finate state machines and std::variant<..> std::variant will hold all possible states The states will be defined in State classes. I'd like to have std::monostate as the first type of State variant to use it as a "do not change state" value. So the definition would be : first type is std::monostate, second type is initial state of the fsm. As the std::variant is initialized to it's first element, I wanted to use emplace<1> in the constructor. template <typename StateVariant> class fsm { public:     StateVariant state;     fsm()     {         state.emplace<1>();     }; };  struct Initial{}; struct Running{};  using State = std::variant<std::monostate,Initial,Running>;  fsm<State> myFSM;  But that gives compiletime error : ..\fsm_emplace.cpp: In constructor 'fsm<StateVariant>::fsm()': ..\fsm_emplace.cpp:15:20: error: expected primary-expression before ')' token    15 |   state.emplace<1>();};  However, when i use the same construct in non template code : State myState;  void setup() {     myState.emplace<1>(); }  Is there a restriction of usage for the emplace function ?


How to stop "failed to unmount /usr/" errors during shutdown in Debian?

I just installed Debian 10 from disk. Whenever I shutdown, I get a single message displayed on screen, "Failed to unmount /usr/". What can I do to correct this? Is this error likely causing damage to the drive or data in /usr?  I have separate partitions for /boot (ext2), /usr/ (ext4), /var/ (ext4), /usr/local/ (ext4), /tmp/ (ext2), and /home (ext4).


Does there exist a set of exactly five positive integers such that the sum of any three distinct elements is prime?

Does there exist $A \subseteq \mathbb N $ such that $|A|=5$ and sum of any $3$ distinct elements of $A$ is a prime number ?


Windows 10 switching between language (Shift+alt) popup

Since recently my PC using Windows 10 ver 2004 build 1904 Started showing this bar when I press Shift+Alt to switch between languages. (The picture is not from my PC its an example). I tried several steps to fix it and none worked for me I even sent a feedbag ticket to Microsoft. I jsut wonder does anybody else have the same problem (Well its a feature) and how did you remove it(if it ever bothered you). When i press Alt+Shift it doesnt show up but it didnt either back when I used Shift + alt


Can I rephrase the sentence "Can you explain this word to me?" into "Can you explain me this word."

Can you explain this word to me?   Can I rephrase it as     Can you explain me this word?


Initializing a 2-D python list as [[9]*3]*3 seems to create references to the same array. What's going on?

Updates on a 2-D array seem to work differently depending on how the array is initialized.  t = [[-9]*3]*3 t[0][1] = 5 #[[-9, 5, -9], [-9, 5, -9], [-9, 5, -9]]   This is unexpected since every row is updated (the second column has value 5).  Contrast this to the following:  t = [[-9, -9, -9], [-9, -9, -9], [-9, -9, -9]] t[0][1] = 5 #[[-9, 5, -9], [-9, -9, -9], [-9, -9, -9]]   This is as expected. What's going on behind the scenes?


I have Windows 10, Ubuntu 16.04 and Kali installed. The grub is of Ubuntu. I would like to remove Kali but I have no idea as to how to do it. Can someone help me ?


Why leverage measure the distance of the ith observation from the center of the x space?

I know the definition of leverage points in regression, that is $h_{ii}=x_{i}'(X'X)^{-1}x_{i}. $  In many places and text books, they always say that leverage is a standardized measure of the distance of the ith observation from the center of the x space. But I don't understand why.   I think that if you want to measure that distance, you need to use Mahalanobis distance, that is $(x_{i}-\mu)'\Sigma^{-1}(x_{i}-\mu)$. Clearly, it is not the same with $h_{ii}$. So I am confused why they say that.  Thanks in advance for you reply!  Thank you for your reminding that there is a similar question: Prove the relation between Mahalanobis distance and Leverage?   But in the answer, the author assumed that the mean of the regressors is 0, I don't understand this assumption. What if the mean isn't 0? In this case, the following proceeds can not go through(the matrix $X'X$ is not diagonal matrix and so it is not easy to get its inverse).   Because I don't have enough reputation to leave a comment to the author, so I ask a new question here. I know that if we have proofed the relationship between Mahalanobis distance and Leverage, then my question is solved. But maybe there is another way to answer my question. Thank you!


Reading  article in the New Yorker I notice this word 'reëxamined'. It's not the only one written like this, any other word with double vowels will be written similarly.  What is the point behind this use ?


Is there a "theirs" version of "git merge -s ours"?

When merging topic branch "B" into "A" using git merge, I get some conflicts. I know all the conflicts can be solved using the version in "B".  I am aware of git merge -s ours. But what I want is something like git merge -s theirs.   Why doesn't it exist? How can I achieve the same result after the conflicting merge with existing git commands? (git checkout every unmerged file from B)  UPDATE: The "solution" of just discarding anything from branch A (the merge commit point to B version of the tree) is not what I am looking for.


System.out.println(); prints false with == operator

Can you please explain me why the output is false  instead of abcd abc false  Code: public class StringDemo{     public static void main(String [] args){         String s1 = "abc";         String s2 = s1;         s1+="d";         System.out.println(s1+ " "+ s2 +" "+ s1==s2); //false     } }


What is aperture, and how does it affect my photographs?

How does aperture affect my photographs?  Why should I care about the aperture with which a photo was taken?


Can I color text by using an image, so that the color isn't flat?

I'm using tikz to attempt to make a book cover, and I have a "wallpaper" image that looks like leather (not that I've handled that many leather-bound books). I'm using the node command to place text over the top of it, but none of the colors I've experimented with look decent.  Can I use an image of gold-leaf as the fill/stroke for the text? Or for that matter, for the path lines as well?  I've tried googling for this, but I can't figure out a set of keywords non-generic enough to pull back useful results.


How to center the axis(yellow) on my object(blue)?


When opening the query store for the first time on any give day, it will take a VERY long time to output data.  I took a SQL script from  :  Top 10 most expensive queries based on average runtime  SELECT TOP 10   qt.query_sql_text,   CAST(query_plan AS XML) AS 'Execution Plan',   rs.avg_duration FROM sys.query_store_plan qp INNER JOIN sys.query_store_query q   ON qp.query_id = q.query_id INNER JOIN sys.query_store_query_text qt   ON q.query_text_id = qt.query_text_id INNER JOIN sys.query_store_runtime_stats rs   ON qp.plan_id = rs.plan_id ORDER BY rs.avg_duration DESC;   After leaving this query running for 11 minutes I canceled it as it wasn't returning anything. Why is that so? Opening the query store through the GUI will result in the same issue.  In this screenshot you can see how cpu-intensive this query is, why is that so ? Did I improperly configure my query store, is there anything more to do than simply enable the query store and query away ?


Can Dell P2421DC charge 16" MacBook Pro?

The Dell P2421DC  says it can deliver 65W via USB-C.  Can it charge the 16" MacBook Pro?


Identify this smooth-cocoon worm from Southern India

I couldn't identify which species these worms belong to. I believe they're insect larvae.  They measure approximately 5 to 10 mm in length, and are common in the southern states of India. They carry cocoons, open at both ends, which the worms can wriggle inside and alternate their direction of movement. These cocoons are perfectly smooth except for the openings.  Another  shows something similar, but the cocoon of that worm looks more woven, while this one doesn't.


I have problem with a function html+jquery

I have this function called by clicking a button:  $("#pulsanteNuovaCategoria").on('click', function(event) {    event.preventDefault();    var categoria = new FormData();   categoria.append("nome", $("#nomeNuovaCategoria").val());   categoria.append("descrizione", $("#descrizioneNuovaCategoria").val());    $.ajax({       url: '../php/model.php?az=nuovaCategoria',       data: categoria,       processData: false,       contentType: false,       type: 'POST',       dataType: 'json'     })     .done(function(data) {       $('.archi').append("

" + data.num + "

" + data.archivio_nome + "

" + data.archivio_descrizione + "

");       $("#nomeNuovaCategoria").val("");       $("#descrizioneNuovaCategoria").val("");       $("#modaleNuovaCat").modal('hide');     })     .fail(function() {       alert("Qualcosa è andato storto.");     }); });   This function create dynamically an entire snippet of html with an edit button completed with data-id, class and id. The important element is class='editaCat'.  Now in the same session, I want to click in this dynamic edit button and call a second function linked with class='editaCat' this:  $(".editaCat").on('click', function(event) {    event.preventDefault();   var idCat = this.getAttribute('data-id');    $.ajax({       url: '../php/model.php?az=editCategoria&id=' + idCat,       processData: false,       contentType: false,       type: 'POST',       dataType: 'json'     })     .done(function(data) {       $("#editaNomeCategoria").val(data.archivio_nome);       $("#editaDescrizioneCategoria").val(data.archivio_descrizione);       $("#pulsanteEditaCategoria").attr("data-id", data.archivio_id);     })     .fail(function() {       alert("Qualcosa è andato storto.");     }); });   but it doesn't work.  Help!


Why do we experience temperatures below 37 degrees Celsius as 'hot'?

We always prefer to be in 20-25° C, although our core temperature is about 37°? Why is our skin temperature lower than our core temperature?


What's the use of Littlefinger's latest shenanigans (Season 5 Episodes 6+7)?

(Spoiler alert for, well, Game of Thrones TV show up to Season 5 Episode 6, obviously.)  This question is about the events in the show, not the books (in which things happen very differently) - although answers based on book information not presented in the show, and which does not contradict what we know from the show, are acceptable :-)      So after the Vale affair, Petyr Baelish offers Sansa to the Boltons as a wife, despite saying he expects Stannis to beat them and take Winterfell.    That in itself does not make much sense, but his motivation seems to be revealed in this episode: He can make the Boltons look like traitors to Cersei. Truth be told, that's rather lame, since if Qyburn is doing any sort of work as Master of Whispers, he should have informed Cersei that it was Lord Baelish who offered Sansa, pulling the rug out from under his argument at the tete-a-tete with the Queen Mother.   But, let's put this contrivance aside and assume he had Sansa marry Ramsey Bolton for this purpose.     Well, what does this get him, exactly?  I mean,      Cersei does not give him troops, nor money, nor does she get Lannister allies to act in any way. He's been promised to get to be 'Warden of the North' if he wipes out Stannis. Is he really in a position to lead the Vale to war against Stannis in support of the Lannisters? Even with a royal decree, I don't see how that's happening. Maybe he can manipulate lords who owe him money or something; but even then - it's not just Stannis, it's Stannis and the Iron Bank. Seriously, I don't see that happening. Even if he had pulled this off - who said he would win? Petyr Baelish never led men into battle in his life, and now he's to carry out a foreign invasion against a seasoned and accomplished military commander? Who will likely enjoy some support from the surrounding population? Finally, Baelish has a fixation on Sansa, why would he put her head on a spear for Cersei, especially having invested so much effort in getting her out of King's Landing?   I must be missing something. How are all these Sansa-centered machinations of any utility to Lord Baelish?  Edit following Episode 7:      So now Baelish and Tyrell have sprung the trap on Cersei. This makes the request of sending armed men up north even more ridiculous, since even if he'd gotten her to accept that, she wouldn't get around to arranging it. Also, it's not even clear whether or not he's going to have that royal decree of his. This leads one to believe that everything he told Cersei was essentially babble to keep her distracted. That's fine, i.e. makes Baelish seem less of an idiot.     But then, the question remains: What's the use of sending Sansa over to marry Ramsey Bolton?   Edit following Season 5 Finale:      Looks like whatever it is Baelish was planning, it isn't quite working out. He should probably have kept her in the vale - unless he has some fiendishly-clever idea I can't even fathom.


My internal HDD has bad sectors and I can't access to 1 part of 3. It's really slow and it usually don't let me to copy data. I'm searching for softwares to fix this and save my files. What do you suggest? I don't wanna lose my files. edit: I can't open disk softwares ( like hddtune ) while hdd is inserted.


A cashier’s till has a large number of pennies, nickels, dimes, and quarters. In how many ways can 10 coins be chosen from the till?


Labeling points with polygon they overlay using QGIS?

I have a shapefile of a cut-up map of England. I have overlaid points (lat/long) from a CSV as a separate layer.   Is there a way to output what polygon each point is on. So, i'd want to be able to output that point A,B,C are on Polygon 1, D,E,F is polygon 2 etc.    I've counted how many points per polygon but I do not know how to do to swing it back round so it tells me what polygon each point overlays.


Can iterated arithmetical operators break closure over $\mathbb C$?

Multiplication is iterated addition; exponentiation is iterated multiplication, tetration is iterated exponentiation, call all of those as different grades of iterated arithmetical operators.     Is there a known $n$-iterated arithmetical operator such that $\mathbb C$ is not closed under it?


Replace string with contents of a file using sed

I have two different files:  File1  /home/user1/   /home/user2/bin   /home/user1/a/b/c   File2  <TEXT1> <TEXT2>   I want to replace the <TEXT1> of File2 with the contents of File1 using sed. I tried this command, but not getting proper output:  cat File2|sed "s/<TEXT1>/$(cat File1|sed 's/\//\\\//g'|sed 's/$/\\n/g'|tr -d "\n")/g"   You can use other tools also to solve this problem.


I have done some testing but I wanted to ask if anyone sees a problem with this ruby regular expression for email validation:  /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/i   Look good?


View physical location of a file/directory on a hard disk

Is there any Linux program which offers the same (or some of the) functionality of Sysinternals DiskView, especially being able to view to physical location of a file on a hard disk?  DiskView URL:


PHP / cURL on Windows install: "The specified module could not be found."

I'm running PHP 5.2.3 on Windows 2000 Server with IIS 5.  I'm trying to get cURL working, so in my php.ini file, I have this line:     extension_dir ="F:\PHP\ext"   And later, I have:     extension=php_curl.dll   The file F:\PHP\ext\php_curl.dll exists, but when I try to run any PHP script, I get this in the error log:     PHP Warning:  PHP Startup: Unable to load dynamic library 'F:\PHP\ext   \php_curl.dll' - The specified module could not be found.    in Unknown on line 0


Constants of motion vs. integrals of motion vs. first integrals

Since the equation of mechanics are of second order in time, we know that for $N$ degrees of freedom we have to specify $2N$ initial conditions. One of them is the initial time $t_0$ and the rest of them, $2N-1$ are initial positions and velocity. Any function of these initial condition is a constant of motion, by definition. Also, there should be exactly $2N-1$ algebraically independent constants of motion.  On the other hand, Noether's procedure gives us integrals of motion as a result of variational symmetries of the action. These integrals of motion are also conserved but they are not always $2N-1$ in number. In consequence, we classify the system by their integrability.  So, what is the difference between the  and ? Why do non- have less integrals of motion when they should always have $2N-1$ constants of motion?


i try to achieve a dotted landscape like in this example.  I tried to solve it by an array but i dint get the landscape displacement to work. an easy way would be to add a sphere to each point of a landscape mesh but i don't know how to do this. Sorry if this is easy to solve, but i am kinda new to blender.


Can't make nginx listen on nonstandard ports (3000, 35729)

This is on a fresh install of Ubuntu 14.04 running on a VPS.  For example the following will work:  server {     listen 8080 default_server;     root /var/www;      location / {         try_files $uri $uri/ =404;     } }  server {     listen 80 default_server;     root /var/www;      location / {         try_files $uri $uri/ =404;     } }   When I visit the page it will be my index.html.  But if I try to make nginx listen on another port (35729):  server {     listen 35729 default_server;     root /var/www;      location / {         try_files $uri $uri/ =404;     } }   or even one that's maybe slightly more used (3000 by nodejs servers for example)  All I get is an error saying the webpage is not available. .  Looking in netstat though says that nginx is listening for the port:  tcp        0      0 0.0.0.0:35729      0.0.0.0:*          LISTEN    15349/nginx -g daem   and iptables looks like this (which means no firewall right?)  Chain INPUT (policy ACCEPT) target     prot opt source               destination  Chain FORWARD (policy ACCEPT) target     prot opt source               destination  Chain OUTPUT (policy ACCEPT) target     prot opt source               destination   and sudo ufw status verbose yields  Status: inactive   What's going on?


Is it legal to download textbooks from academia.edu?

There is a website called academia.edu. It seems like they have papers on various topics - but my question is about their textbooks. It is possible to download certain college textbooks for free through their site.  is a link to a calculus textbook you can download through the site.    My question is: Is it legal to download textbooks from academia.edu (in the United States)?


Html  not formatting/rendering text correctly

Following code gets correctly formatted in HTML using Pre tag. The break tags get rendered correctly showing line breaks
  package a;
import a.b;
import d.c;
public class Test{
}
  Get the following output -   package a;import a.b;import d.c;public class Test{}           However if I load the same text using javascript code.innerText = currentQuestion.code;  The break tag do not get rendered correctly and are shown as it is - package a;
import a.b;
import d.c;
public class Test{
}  Can someone please help me here..thanks


Program won't run on Eclipse and it doesn't give me an error?

So my Eclipse works fine, it compiles everything I need. Now I just wrote code but it's not running it, it just doesn't do anything. I've tested Eclipse with other code and it works fine, so there is something wrong with my code, but I'm not sure what.  I am trying to complete Project Euler's 4th challenge:   A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 × 99.  Find the largest palindrome made from the product of two 3-digit numbers.  Here's my code:  package me.practice;  public class Main{    public static void main(String[] args) {     int palindrome = 0;      for(int i = 0; i < 900; i++)     {         int num = (100 + i) * 999;          String numString = Integer.toString(num);          String numString_reverse = new StringBuilder(numString).reverse().toString();          if(numString == numString_reverse)         {             palindrome = Integer.parseInt(numString);              System.out.println(palindrome);              break;         }     } } }   Edit: I've also tried to run it on Netbeans and it doesn't work, so Eclipse is fine.


How do I subscribe for a site's weekly email newsletter?

I have heard about the weekly newsletter. How do I subscribe?


How do I create a directory in all subdirectories?

Suppose I have a directory structure like this:   $ [~/practice] ls a/ b/ c/ d/   Now I want to create a directory tmp1 in all sub directories of practice and I do this:   $ [~/practice] mkdir */tmp1 mkdir: cannot create directory `*/tmp1': No such file or directory   Then I try the -p switch and I endup with a directory named * with a sub directory tmp1   $ [~/practice] mkdir -p */tmp1  $ [~/practice] ls */ a/ b/ c/ d/   I know the use of -p switch is to create multiple nonexistent directories. I just thought it might help.  How do I create tmp1 in all subdirectories at once?   If this can be done, how do I extend it to create \tmp1, \tmp2, \tmp3 in \a, \b and \c at once?  Edit: I missed mentioning that the directories don't have to be simple and in order, like a, b, c etc., and the directory to be created is not necessarily like tmp1, tmp2.    $ [~/practice] ls dog/ cat/ rat/   In them, I would like to have something like   $ [~/practice] ls * dog: red/ blue/  cat: red/ blue/  rat: red/ blue/


Why does bash say No such file or directory when the file is on the path

So I uninstalled cmake, and reinstalled it with an updated version, and the path is correct, and the file is there, but whenever I try to run cmake, bash echoes -bash: /usr/bin/cmake: No such file or directory  pi@raspberrypi /usr/local/bin $ dir cmake  cpack  ctest  indiecity  pi@raspberrypi /usr/local/bin $ export | grep PATH declare -x PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games"


What happens if you choose GLaDOS' way in Portal 2?

Spoiler warning!  During the first escape attempt in Portal 2 (when GLaDOS is still in charge) she opens a door for you which you can choose to go through instead of following Wheatley (the blue-eyed ball). What happens if you go there?


What exactly is the problem with using electronic codebooks as a block cipher mode

I was wondering why it is a problem with using ECB as a block cipher mode


How can I simply remove the fish-eye effect of my DJI Phantom vision 2 lens?

I'm searching a simple and cost-less way to remove the fisheye effect by:   adding a material (additional corrective lens) or find the right software (free if possible) to remove the fisheye effect on my pictures


Mobile browser doesn't show views even when badges granted by views are shown in notification bar

It's Thanksgiving, so I'm getting my Gaming SE fix through my mobile iPhone browser. I recently received a notable question badge for 'How do I defeat a wispmother in Skyrim?' and wanted to see just how many views it got. I didn't expect to see it initially, but once I sorted by views, I at least expected to see the number of views the question had.  Expected behavior: either views should be populated for questions when sorting by views in the mobile browser or there should be some intuitive way to see views on the mobile browser.


Binary string with even and odd number of 1s

How could it be shown that the number of binary string of length k with an even number of 1s is the same as those with an odd number of 1s.  Eg. for $k = 3$ :  Binary string length 3 with even amount of 1s : $000 ; 011 ; 110 ; 101$  Binary string length 3 with odd amount of 1s : $111 ; 100 ; 010 ;001$  Both of these set have the same cardinality. I'd like to see a generalization for any $k\in\mathbb{N}$.  If think we need to show there exist a bijection between the set of binary string of length $k$ with even number of 1s and and the one with odd number of 1s in order to prove they have the same cardinality, but I'm not sure how to define such a function.  Thanks


We're remodeling our bathroom and I would like to remove a wall that appears to be there for looks because of the style in the late 60s. I'm wondering if there is any possibility that this wall is a load bearing wall or if I'll have any issues when I remove it. It appears to be more of a decorative wall to me but I would like a second opinion. The wall runs perpendicular to the ceiling joists but there isn't anything bearing down on it when I go in the attic and the exterior wall which I know is load bearing is only about 5ft away. There are 3 or 4 ceiling joist that cross the wall and I plan to replace 1 (maybe more) of the ceiling joist because we found some termite damage when we pulled off the drywall. Any help would be greatly appreciated!   I have attached 2 pictures of the wall I am referring to and I can go into the attic to take more picture if that would help to see what's up there.       EDIT:   Here are pictures of the attic above the wall. In the first image the wall I'd like to remove is just on the other side of the duct work. Second image is for a reference on how far away the duct work is from the wall. Third image is of the top of the wall (looking down onto it from the attic) with the insulation moved out of the way.   [![Wall location in attic][1]][1] [1]:   [![Wall distance from vent][2]][2]  [2]:   [![Top of wall from attic][1]][1]  [1]:


Install restricted drivers in command line

I'm aware there's already been  regarding Nvidia drivers, but my case is a little different. My wireless adapter's driver is proprietary, and for a minimal install, I need a command to install it. A general command for any other restricted driver that I may come across in the future would also be extremely helpful.


If I had some line element such as minkowski line element:  $ ds^2 = -dt^2 + dx^2 + dy^2 + dz^2 $  And assuming this photon or beam of photons travels in the x direction, how would one find the components of the tangent vector?   Actual answer should be $k^\mu = B(1,1,0,0)$, but how is this obtained?


Proving Holder's inequality using Jensen's inequality

Let $p$ and $q$ be positive reals such that $\frac{1}{p}+\frac{1}{q} = 1$, so that $p,q$ in $(1,\infty)$.  For $\vec a$ and $\vec b \in \mathbb{R}^2$ prove that $|\vec a \cdot \vec b | \leq ||\vec a||_p|| \vec b||_q$.  A hint was posted for using Jensen's inequality to use $\phi(x) = ln(1 + e^x)$. But I don't know how I'd work that in.


What is the name of the vertical bar in $(x^2+1)\vert_{x = 4}$ or $\left.\left(\frac{x^3}{3}+x+c\right) \right\vert_0^4$?

I've always wanted to know what the name of the vertical bar in these examples was:  $f(x)=(x^2+1)\vert_{x = 4}$ (I know this means evaluate $x$ at $4$) $\int_0^4 (x^2+1) \,dx = \left.\left(\frac{x^3}{3}+x+c\right) \right\vert_0^4$ (and I know this means that you would then evaluate at $x=0$ and $x=4$, then subtract $F(4)-F(0)$ if finding the net signed area)  I know it seems trivial, but it's something I can't really seem to find when I go googling and the question came up in my calc class last night and no one seemed to know. Also, for bonus internets; What is the name of the horizontal bar in $\frac{x^3}{3}$? Is that called an obelus?


Hi, I am trying to install uget and I get this error message "This requires installing packages from unathenticated sources" and there are only two options. Ok and Repair, and even if i click both their is nothing happening. It keeps on popping up. I am using Ubuntu 14.04 64bit  Please help.  Thank you.


Is there any significance of the colors of Starfleet Uniform?

Starfleet has the three uniforms - blue, gold and red in TNG onwards.  I know that these each represent different areas, but is there a canon reason for why these colors were used for each area? e.g. why science is given blue?  Please note - I am not asking about the change of uniform, but instead am asking about the canon significance of these colour in the ST universe.


Get the error from Fragment with different activities when passing data using bundle

I am using Bundle to passing data from my MainActivity to Fragment but it prompts out with the JAVA.NULLPOINTER.EXCEPTION. Error is occur when IgetArguments()` in list_fragments2 in second activity  MainActivity  list_fragment2 fragment = new list_fragment2(); Bundle b = new Bundle(); b.putString("test","text"); fragment.setArguments(b); Toast.makeText(this, "" + b, Toast.LENGTH_SHORT).show();   list_fragment2  String name = getArguments().getString("test"); ntab2.setText(name);   Logcat  01-02 07:19:52.549 15797-15797/? E/AndroidRuntime: FATAL EXCEPTION: main                                                       java.lang.NullPointerException                   at net.simplifiedcoding.androidtablayout.Tab2.list_fragment2.onCreateView(list_fragment2.java:62)                   at android.support.v4.app.Fragment.performCreateView(Fragment.java:1962)                   at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1067)                   at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1248)                   at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:738)                   at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1613)                   at android.support.v4.app.Fragment.performStart(Fragment.java:1983)                   at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1102)                   at android.support.v4.app.FragmentManagerImpl.performPendingDeferredStart(FragmentManager.java:926)                   at android.support.v4.app.FragmentManagerImpl.startPendingDeferredFragments(FragmentManager.java:1272)                   at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1630)                   at android.support.v4.app.FragmentManagerImpl.executePendingTransactions(FragmentManager.java:570)                   at android.support.v4.app.FragmentPagerAdapter.finishUpdate(FragmentPagerAdapter.java:141)                   at android.support.v4.view.ViewPager.populate(ViewPager.java:1106)                   at android.support.v4.view.ViewPager.populate(ViewPager.java:952)                   at android.support.v4.view.ViewPager.onMeasure(ViewPager.java:1474)


The equation $x^2=a$ in a finite group $G$ of odd order.

The problem is showing that $x^2=a$ has a solution for each $a\in G$ if $G$ is a finite group of odd order. Heres what I got so far (my lecturer told me to do it this way): Since $G$ is of odd order, we can express $1_G$ as: $a^{2n-1}=1_G$. If we multiply both sides by $a$ we get $a(a^{2n-1})=a^{2n}=a$. Now this is where I am stuck, how do I proceed from here? Any hints are greatly appreciated!


I'm trying to learn some python and ran into some trouble with the random function combined with a for loop. The full code to run:  global_n = 3 import random class InputNeuron:      connections = list(range(global_n))     connection_state = list(range(global_n))      def __init__(self, n):         self.n = n  my_inputs = list(range(global_n))  for i in range(0,global_n):     my_inputs[i] = InputNeuron(global_n)  for i in range(0,3):     for j in range(0,3):         my_inputs[i].connections[j] = random.uniform(-1.0,1.0)         my_inputs[i].connection_state[j] = random.uniform(-1.0,1.0)  for i in range(0, global_n):     for j in range (0,global_n):         print("Neuron", i, "connection", j, "is", my_inputs[i].connections[j], "and", my_inputs[i].connection_state[j])   I realise this code has many flaws, what I however cannot seem to grasp is why my random function is not working correctly. Specifically, as can be seen in the output when you run this, each "neuron" has the same output for the respective "connections" 0, 1 and 2. As far as I can tell this part of my code:  for i in range(0,3):     for j in range(0,3):         my_inputs[i].connections[j] = random.uniform(-1.0,1.0)         my_inputs[i].connection_state[j] = random.uniform(-1.0,1.0)   Should assign random values to each of these values so that neuron 0, connection 0 and neuron 1, connection 0 should have different values.  I'm probably overlooking something obvious so apologies in advance, but after trying for literally hours now to fix this I'm very close to giving up on trying to figure out what is wrong.


[preface, i'll use '%' as the modulo or remainder operator, as it is in C and many other programming languages, where for example 10 % 7 == 3] i'm looking for an algorithm to solve for n in (A*n + B) % C == 0  where A, B, and C are all positive integers. i have additional constraints on my particular problem that i don't think are important for the solution.  (namely, A is less than C, A is a power of 3, C is a power of 2, and B is odd, all of which i believe imply that n must be odd.) (and yes, i'm toying with Collatz here) i can brute force this (try all possible n from 0 to C-1), but that will become time consuming as C increases.  i could also try to binary search for it, which would be a performance improvement, but i'm looking for a more efficient algorithm.


I am hoping you can help me. I Have a windows xp machine and instead of throwing it out, I would like to install Ubuntu Linux on to it.  However, I am having trouble trying to copy the os on to a disc and I was wondering if you knew where I can get a copy from?  I appreciate any assistance you can give on this.


Multiclassing Cleric LvL 4 with Warlock lvl 1

I am having a nice argument with my buddy about multiclassing. I am new to the game so there is a lot of things I don't know, he is quite versed though. Our argument is centered in the amount of LvL 1, LvL 2 and LvL 3 Spells I can have. As my character is LvL 4 Cleric and LvL 1 Warlock, I assume he is LvL 5 in total. So checking the Multiclass Spellcasting Table, it says he has access to:  4 LvL 1 spells, 3 LvL 2 Spells and 2 LvL 3 Spells.  Counting that Warlock Pact Magic allows the character to use the Warlock spell slots as Warlock Spells or Cleric Spells, he says that the LvL I have from the Warlock doesn't allows me to have the amount of spells I quoted above, because I am still a LvL 4 Cleric, so I can't use LvL 3 Spells, neither use a LvL 2 Spell as a LvL 3. So the amount of spells I have according to the multiclass table is the one of a LvL 4:  4 LvL 1 spells and 3 LvL 2 Spells  Our main problem is related to how we mix Warlock to the Multiclass table.


Why does an aluminum foil spark inside a microwave oven?

I did an experiment today. I put an aluminum foil inside the microwave oven thinking that nothing would happen. But contrary to my expectations it started sparking badly. I looked for answers on the internet but none of them were very satisfactory and explainatory at the same time!


Relation between radius of curvature and heat produced at focus when concave mirror is kept in sunlight

Hi I am newbie here and this is my first question so please do not mind if I don't use the correct language or anything.  I want to know the relation between size of a concave mirror ( measured by radius of curvature I think ) and amount of heat produced at its focus when concave mirror is kept in sunlight. If climatic conditions matter ( I think they do ) then assume them to be similar to coastal regions and area should lie in subtropics or tropics. Please provide the explanation for relation.  My question is different from "What temperature is achieved in focus point by 5000 flat 1x1cm mirrors onto a satellite dish? " as I want to take climatic conditions and latitude into account.   I can ignore climatic conditions if their effect is not more than +-10W on heat produced. You can consider the size to be about 1.5 times of r5800


Script won't autostart despite making a .desktop file, placing directory in rc.local etc

I am trying to autostart a music player when my Lubuntu boots but I can't seem to get it to work. I am fairly new to Linux systems and have searched the internet for hours but I am out of ideas. This is a .desktop file I made:  [Desktop Entry] Name=Script Exec=/home/t/script.sh Icon=home/t/script.sh Terminal=true Type=Application X-KeepTerminal=true StartupNotify=false   When I manually start it it works perfectly. I've added this file in:   /.config/autostart /etc/xdg/autostart /usr/share/applications   At: /.config/lxsession/Lubuntu I added the line  @/home/t/dtest.desktop   I also added the directory to rc.local


I am developing client side of web application. In this application, there are tons of tabs, divisions, and other html elements. I would like to separate those elements as classified file like tab1_elements.html, tab2_elements.html and want to include those to main page.  sample code

          ...     ...
  ... ...   I googled a bit and noticed that html5 import attribute is just what I am looking for. However, I believe that attribute still not available yet for most browsers.   And I know it will take time to brwosers adapt that attribute. (maybe not adapt at all in worst case). So I am considering including iframe to main page. From what I heard, iframe was almost deprecated by w3c for security reasons and other issues. I wonder what are cons of iframe element and why developers tend to avoid this tag.   Is using iframe a bad idea?  I already tried ajax way to load external html files but chrome browser does not allow ajax communication for local files (application should run ok in off line mode). Can you guys suggest any alternative solutions?  Thank you for reading my post.


Does Windows 8 RETAIL install extract OEM product key from BIOS?

I am in a situation where I cannot use Magical Jelly Bean Product Key Finder since the hard drive has failed on a particular system from HP.  Sadly HP will only sell restore discs and I don't have the luxury of waiting a few days for these to arrive.  I do have a retail disc from another system and have read that a retail copy of Windows 8 (not 8.1) will extract the OEM key from the BIOS in such cases.  Is this indeed the truth?


PHP OOP Learning Curve - MySQL Object Failure

I'm currently learning PHP and I'm new to OOP. I'm trying to create an object to handle MySQL queries and connections.  This is what I've created so far:  class MySQLDatabase {      private $connection;      function __construct() {         $this->open_connection();     }      public function open_connection() {         $this->connection = mysqli_connect(DB_SERVER, DB_USER, DB_PASS, DB_NAME);         if(mysqli_connect_errno()) {             die(                 "Database connection failed: " . mysqli_connect_error() .                  " (" . mysqli_connect_errno() . ")"             );         }      }      public function close_connection() {         if(isset($this->connection)) {             mysqli_close($this->connection);             unset($this->connection);         }     }      public function query($sql) {         $cleaned_sql = mysqli::real_escape_string($sql);         $result = mysqli_query($this->connection, $cleaned_sql);         $this->confirm_query($result);         return $result;     }      public function mysql_prep($string) {                    $escaped_string = mysqli_real_escape_string($this->connection, $string);         return $escaped_string;     }      private function confirm_query($result) {         if (!$result) {         die("Database query failed.");         }     } }   And on the public-facing side (doing a test to make sure things work as expected):  $sql = "INSERT INTO users (id, username, password, first_name, last_name) "; $sql .= "VALUES (1, 'jbloggs', 'secretpwd', 'Joe', 'Bloggs')"; $result = $database->query($sql);   Currently, I just get the output of: Database query failed.  The issue seems to be something to do with my mysql_prep function, as when I remove that all works fine.   Any advice is greatly welcomed.  Thanks in advance! Alex.


Is it possible to instantiate the class that is provided as generic type parameter in an abstract class?  Example:  public MyClass {     public MyClass(String test) {      } }   Is it possible to instantiate this class inside another abstract class?  public abstract class AbstractClass<T extends MyClass> {     public AbstractClass() {         T t = new T("test"); //Cannot instantiate the type T     } }


narayan@josh:~$ sudo apt-get install root-system-bin  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 to handle equality constraints in this problem?

Here is the problem setup  \begin{equation} \begin{array}{c} \text{min} \hspace{4mm}  \mathbf{b}^{T}_{}\mathbf{A}^{}_{}\mathbf{b}^{}_{} \\ s.t \hspace{5mm} \mathbf{b} \in \mathbb{R}^{N} \\ \hspace{9mm}b_0=1\\ \hspace{62mm}b_i=b_{i-2}b_{i-1} \hspace{5mm} \forall \hspace{5mm} 2<i\leq N-1 \end{array} \end{equation}  where $\mathbf{A}$ is a $N\times N$ positive semi-definite matrix  To handle $b_0=1$ constrain, I know I can introduce Lagrange multiplier in objective function  \begin{equation} \begin{array}{c} \text{min} \hspace{4mm}  \mathbf{b}^{T}_{}\mathbf{A}^{}_{}\mathbf{b}^{}_{} + \lambda(\mathbf{b}^{T}_{}\mathbf{u}^{}_{}-1) \end{array} \end{equation}  where $\mathbf{u}_{}^{}$ is a $N\times 1$ column vector and $u_0=1$ and $u_i=0 \forall 1<i\leq N-1$.  But I dont know how to handle second set of constraints?   EDIT: Example  Let $N=4$. Therefore I am looking for $\mathbf{b}=[b_0 \quad b_1 \quad b_2 \quad b_3]^T = [1 \quad b_1 \quad b_2 \quad b_1b_2]^T$. How do I include $b_3=b_1b_2$ constraint in objective function


Oke, so my mind is blown by Einsteins view on gravity, at least as far as I understand the basics and principles he based his views on.  One of the first things that struck me was that most of his equations were based on the fact the photons had no mass, something which is virtually impossible to verify experimentally and something I can not convince myself of.  Now he states that mass bends spacetime: in other words, objects can only move in straight paths, but because the "surface" of a path can be bent, the trajectory relative to the mass is bent. So as a reaction, I did the following thought experiment that would separate Newton from Einstein:  Image in space (completely empty) and two objects with mass M and m (whatever the values) placed from a distance R apart completely at rest. According to my interpretation of Einstein, nothing will happen because even if spacetime is bent they have no motion themselves. Our earth orbits the sun because it initially had a motion and is now travelling in an infinite straight line, which becomes an ellipse due to curvature. Newtons would of course state that in my thought experiment, the two masses would collide.  After I realized this, I started to question Einstein's view. Is my basic interpretation correct about Einstein, and how would you (expert/physics professor/lover) respond to this thought? I personally find it pretty confronting...  BTW I'm just a high school student, potentially going to Cambridge to study physical sciences...


What is the purpose of the cylindrical layered conical discs in power stations?

You can see them everywhere. On towers of overhead lines, in power stations, converter stations, transformer stations, etc... Sometimes they are rubber, sometimes metallic, sometimes glass, sometimes porcelain. What is the purpose of these conical layered discs? Why do these things have this shape?


How can I ask a question while not being online?

Just came across this  (soon to be deleted, don't be surprised to find it gone) It says there:  I then turned to the profile of the OP, there it says:  How is that possible? (and yes, I refreshed the pages)


How can I escape square brackets in a LIKE clause?

I am trying to filter items with a stored procedure using like. The column is a varchar(15). The items I am trying to filter have square brackets in the name.  For example:  WC[R]S123456.  If I do a LIKE 'WC[R]S123456' it will not return anything.  I found some information on using the ESCAPE keyword with LIKE but I do not understand how to use it to treat the square brackets as a regular string.


I'm trying to set up Kubuntu 11.10 so I can type Japanese. I've searched online but have had little luck. My installation is fresh so it'd be great if someone could walk me through it and tell me how to do it from the beginning.


How to track the age of a case spent in different status value?

I've to create a report on the case object. I've to display how much time a case has spent in a particular status. I've around 6 status values such as Initiated, Waiting for Approval, On Hold, Closed etc., I want to determine how much time a case has spent in each of the status values?   For ex: I have a case 0010. The case age is 10 days, it is in Waiting approval stage for 4 days. I want to track the number of days it has spent in the current status. I tried case life-cycle report but that's not what I'm actually I'm looking for.


How to generate a multi-domain (and/or wildcard) OpenSSL certificate?

I tried Googling and haven't been able to find anything reliable that shows me how to generate the CSR. I have multiple domains, that I'd like added so I can't use the usual OpenSSL wizard:  *.domain1.com *.domain2.com   How can I get this generated?


Highlighting double backslash using listings with texcsstyle

I've got a question (it's in the title) about listings that I do not believe have been answered anywhere (either that or my Google-fu isn't that sufficient). Before I knew of texcsstyle's star option, I tried to highlight double backslash (\\) by using the literate option (how monstrous):   literate=*{\\\\}{{\textcolor{red}{\textbackslash{}\textbackslash{}}}}{1}   With this I used to be able to highlight double backslash but since I didn't use texcsstyle I could not highlight the backslash that comes before all LaTeX commands. But when I finally DO use texcsstyle, the literate option suddenly no longer works for double backslash, even though all the other literate replacements (for &,[,],{,},...) still work. I guess texcsstyle is interfering with the literate option? How do I resolve this? Is it even possible to have both texcsstyle and double backslash highlighted?  Edit: added an example, sorry. Uncomment the line with texcsstyle and you will see the double backslash stop getting highlighted.  \documentclass{article} \usepackage[T1]{fontenc}   \usepackage[usenames,dvipsnames,svgnames,table]{xcolor} \usepackage{listings} \usepackage{charter} \definecolor{lightgrey}{rgb}{0.9,0.9,0.9} \definecolor{darkgreen}{rgb}{0,0.6,0} \definecolor{darkred}{rgb}{0.6,0,0} \definecolor{myblue}{RGB}{20,105,176} \definecolor{darkgreen}{rgb}{0,0.6,0} \lstdefinelanguage{mytex}[LaTeX]{TeX}{   moretexcs={includegraphics,multicolumn,multirow,newcolumntype,intertext,},   morekeywords=[2]{figure,tabular,tabulary,document,minipage,verbatim,table,     enumerate,tikzpicture,preview},     % texcsstyle=*\bfseries\color{darkred},   literate=             *{\{}{{\textcolor{myblue}{\{}}}{1}             {\}}{{\textcolor{myblue}{\}}}}{1}             {\&}{{\textcolor{red}{\&}}}{1}             {\\\\}{{\textcolor{red}{\textbackslash{}\textbackslash{}}}}{1}             {[}{{\textcolor{myblue}{[}}}{1}             {]}{{\textcolor{myblue}{]}}}{1}, } \lstset{language=mytex} \lstdefinestyle{mystyle1}{ basicstyle=\small\ttfamily, keywordstyle=\color{purple}\bfseries, keywordstyle=[2]{\color{magenta}}, commentstyle=\color{darkgreen},  stringstyle=\color{orange}, identifierstyle=\ttfamily, showstringspaces=true, breaklines=true, tabsize=4, columns=fullflexible, keepspaces=true, } \lstset{style=mystyle1} \begin{document}    \begin{lstlisting} \begin{alignat*}{4}    y & = -4   & + 3 & +4     & -7      \\    y & =      & + 3 &        & -7      \\    \intertext{therefore}    a & = b    & d   & = cccc & e & = d \\    a & = bbbb & d   & = c    & e & =   \\ \end{alignat*} \end{lstlisting}  \end{document}


How can I refer to the population of a town keeping the name of the town?

There are words like New Yorkers, Londoners, etc.: (1) they keep the name of the city/town; (2) they refer to the people living in it. How do I fulfill both conditions for a small town called Somesmalltown? Say,in a sentence like:     50% of Londoners went to a football match on Tuesday?   Phrases like “citizens of Somesmalltown” or “population of the Somesmalltown” seem to be out of place in this case, as I take it.  Does a phrase like Somesmalltown`s people,Somesmalltown people or similar sound right?


I've had a PayPal account associated with my main e-mail address for years, but I didn't create this account. For this reason I don't know the details like secret questions and stuff like that and I'm unable to reset my password and close my account because of that.  Communicating with PayPal's support has been unfruitful.  Is there a Stack Exchange site on which I could give a detailed description of what's happening and ask for help on how to close my account?


English word that means the use of out of place uncommon words

I am looking for a word or short phrase that best describes a scenario in which an author seems to have copiously placed uncommon or higher educated vocabulary in a lower reading level book. Meaning that the book seems to be for a fourth grade reading level and then every few paragraphs an English Doctorate level word appears, possibly to impress readers.


Dr Math and his family question. How to solve without trial and error?

Dr Math told his family to write 4 different integers from 1 to 9 on to the 4 ]


How to copy a file to a specific folder in a Python script?

I have the path of a file stored in a variable (say) filePath. I would like to copy that particular file to another specific folder within a Python script.   I tried   folderPath = (os.getcwd() + "/folder_name/") #to get the path of the folder shutil.copyfile(filePath, folderPath)   But I got an error  IOError: [Errno 21] Is a directory.  How can I solve this ?  My question might seem to be  a duplicate of . But actually, I want to copy a file to a folder/directory whereas most answers to that question mention copying one file to another file.


How does the ISS Shenzhou have Same Tech as Prime Ships?

In (TOS) "The Tholian Web" the USS Defiant (NCC-1764) got pulled into another dimension that we later find out (in Enterprise: “In a Mirror, Darkly”) is the Mirror Universe about 100 years in the past of TOS and is subsequently captured by the Terran Empire.   In (Discovery) "Despite Yourself" the USS Discovery (NCC-1031) is in the Mirror Universe and encounters the ISS Shenzhou (NCC-1227) with what appears to be just about exactly the same tech as the Prime Universe USS Shenzhou (NCC-1227) had.   So the Question is...  With about 100 years of time with a future ship from an alternate timeline how is it that the Empire did not develop significantly advanced technology and design far more advanced ships by reverse engineering the USS Defiant (NCC-1764) and going through its memory banks?  Examples of Alien Tech in Star Trek being reverse engineered in a short period are. (these may not be accurately remembered examples but the question still stands valid)  It only took roughly 30 years to develop the Mobile Emitter for the Doctor in (Voy) "Future's End, Part II" in 1996, something they hadn't even developed in own Voyagers Timeline. Not to mention the computer chip revolution that happened due to this.  In (Voy) "Endgame" Admiral Janeway Travels into the past and within days helps the Voyager develop and implement Technology that wasn't designed for their systems and significantly enhances Voyagers Defensive capabilities.   In (DS9) "Shattered Mirror" the Tarren Resistance Developed and built a Defiant using "acquired" specifications from DS9 in 2371, only needing Sisko's help at the end to fix the same structural issues that the Prime Sisko had when developing the ship.


Mac app icons dissapearing and reappearing randomly

Alright so most of the people have their desktop having some missing icons but i'm not really having this problem, the real problem is that all the apps in finder are missing icons and sometimes they reappear weirdly...    DolphinEMU's icon is the most inactive.  When i look up on finder... this happens...    Yes it's french, but almost all my apps have no icon and they reappear sometimes. they still run perfectly.


Unable to Boot Ubuntu after Windows 8.1 Installation.

I first installed Ubuntu 14.04 from live USB and after confirming that it s working properly i installed windows 8.1 from CD. Now i am unable to boot Ubuntu. Although Windows is working fine.


SSH login without password with kerberos

I try to login onto a server which only supports login with kerberos authentication. Here's what I try:  kinit user@FOO.ORG aklog -c foo.org ssh server   But then I'm asked again for a password.  Here's what I have in my ~/.ssh/config for the entry server (my /etc/ssh/ssh_config is empty):  Host server     HostName someserver.foo.org     User user     ForwardX11 yes     ForwardX11Trusted yes     GSSAPIAuthentication yes     GSSAPIDelegateCredentials yes   According to colleagues, this (or something similar) is working for them. I can log onto other machines with kerberos tokens just fine. I assume it has something to do with my /etc/krb5.conf, but I do not know what to look for. I tried copying the /etc/krb5.conf from the server to my working station, but without success.  Here's part of the output if I run ssh -vvv server:  debug1: Next authentication method: gssapi-with-mic debug1: Unspecified GSS failure.  Minor code may provide more information Server not found in Kerberos database  debug1: Unspecified GSS failure.  Minor code may provide more information Server not found in Kerberos database  debug1: Unspecified GSS failure.  Minor code may provide more information   debug2: we sent a gssapi-with-mic packet, wait for reply   How can I login with my local kerberos token? What am I doing wrong?


How many unique object be there in HashSet And which method is used to check uniqueness equals or hashCode

Consider the below code  import java.util.HashSet; import java.util.Random; import java.util.Set;   public class Test {  /**  * @param args  */ public static void main(String[] args) {     // TODO Auto-generated method stub      Person p1= new Person();     //Person p2= new Person();     p1.setName("same1");     //p2.setName("same2");     Person p2=p1;     Set<Person> set= new HashSet<Person>();     set.add(p1);     set.add(p2);     for(Person p: set){         System.out.println(set.size()+">>"+p.getName()+" hashcode "+p.hashCode());     }   }  }  class Person{ private String name;  public String getName() {     return name; }  public void setName(String name) {     this.name = name; }  @Override public boolean equals(Object obj){     return true;  }  @Override   public int hashCode() {     Random ran = new Random();     int x = ran.nextInt(6) + 5;     System.out.println("in hahcode method"+x);     return x;   } }   As set does not contain duplicate, Here I have return true from equals method and return different hashcode for the same object. HashSet treat them as unique object. So far so good, as HashSet internally use HashMap to store objects.   It appears from above code snippet that HashSet use hashCode to check uniqueness not equals method. If hashCode is different for two objects,they will be stored in HashSet whether they are equal or not? Please let me know if I am missing something.


Finding an explicit formula for the following exponential generating function

So I have the following formula for the coefficient of the recursion and I am trying to find an explicit formula for $a_n$ the nth coefficient:  $$ a_n = (n+1)a_{n-1} + 3^n $$  $$ a_0 = 1; \space\space\space n\geq1  $$   Here's what I have done so far (I may be incorrect in some intermediate steps, I am not sure):  expand the $(n+1)$ term so that we have $ a_n = na_{n-1} + a_{n-1}+ 3^n $, multiply all sides by $ \frac{x^n}{n!}$ and sum over $ n $ giving the following:   $$\sum_{n \geq1}{a_n\frac{x^n}{n!}} = \sum_{n \geq1}n a_{n-1}\frac{x^n}{n!} + \sum_{n \geq1} a_{n-1}\frac{x^n}{n!} + \sum_{n \geq1}3^n\frac{x^n}{n!} $$  Let's call the exponential generating function $\sum_{n \geq0}{a_n\frac{x^n}{n!}} = G(X)$ $$ \therefore G(x) = xG(x) + xe^x + 3^ne^x - 3^n +1 $$  and this simplifies to: $$ G(x) = \frac{x}{1-x}e^x + \frac{3^n}{1-x}e^x + \frac{3^n}{1-x} + \frac{1}{1-x}$$  I am quite stuck here, for the first term on the RHS I have: $\sum_{i = 0}^{n-1} \frac{n!}{i!}$ for the second term I have $3^n\sum_{i = 0}^{n-1} \frac{n!}{i!} $ for the third term I have $3^n  \sum_{n\geq0} x^n$ and for the final term I have $\sum_{n\geq0} x^n$ (so taking the coefficients of the x terms we get:  $$a_n = \sum_{i = 0}^{n-1} \frac{n!}{i!} + 3^n\sum_{i = 0}^{n-1} \frac{n!}{i!} + 3^n + 1$$  which gives the wrong answer... can anyone help me out see where I went wrong?  Thank you!  edit: I realize there is a post asking the same question which uses integration/differentiation; I am trying to do this without the use of calculus.


How to model and generate forecasts for time series with missing observations?

I am trying to model some historical variables which are discontinuous. I am working with monthly observations so I have 12 observations per year.   However, there are cases in which, for example, I have data for January-2000, February-2000, and then the data jumps to May-2000, and so on.  I am using R to perform the time series and forecasting analysis.   Is there a way to cope with this kind of irregular time series in R?


How does isotropy of free space imply $L(v^2)$ for a free particle?

From Mechanics; Landau and Lifshitz, it's stated on page 5:     Since space is isotropic, the Lagrangian must also be indpendent of the direction of $ \mathbf{v}$, and is therfore a function only of its magnitudie, i.e. of $ \mathbf{v} \cdot \mathbf{v}=v^2$:   $L = L(v^2)$   How is he able to exlude $L = L(| \mathbf{v}|)$?


Does a higher dimensional space have more points than a low dimensional space? And in some way are some infinities bigger than others?

How many points can exist in one dimension? ANS: Infinite! How many lines can exist in a two dimension? ANS: Infinite! Now my question is how many points can exist two dimensions or even higher dimensions? "Infinite points * Infinite lines" infinity? Or "just" infinity? Can we say two dimensions contain more points than one dimension?


Since there are so many classes and methods called from my class method, the debug log generated is very huge and getting truncated. How can i see the full debug log ? Is there a way through which i can set that log contains only those statements where i use System.debug().


htaccess: how to rewrite to clean urls and redirect old urls to the new clean ones?

With htaccess I'm trying to make my sites urls clean.  I use very basic urls like: www.mysite.com/pagename.php ("pagename" is variable).   I want www.mysite.com/pagename to display the content of /pagename.php So this is in my htaccess-file now:  Options +FollowSymlinks RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^([^\.]+)$ $1.php [NC,L]   But I also want my old urls (/pagename.php), when called, to be rewritten to www.mysite.com/pagename    How to do this? I can't figure it out (get loops all the time)...  Thanks in advance!


Low sample size as cause of both Type I and Type II errors

It is intuitive that, with a small sample size, extreme results are more probable. For instance, the probability of 4 out of 4 balls drawn from an urn of black&white balls to be all white is higher than with 7 out of 7, as the binomial distribution tells us.  Nonetheless, when using statistical inference to estimate a population parameter from a sample parameter, a low sample size seems to be criticised not because it makes a "fluke" more likely (Type I error) but because it makes detecting a real but small effect more unlikely (Type II error).   This seems contradictory. Are these in fact two sides of the same coin, e.g. both are cases of a low sample making the conclusion depend too much upon sampling error (the luck of the draw)?