In this assignment I am supposed to have three threads, these threads are supposed to count up from 0, printing the count each second and printing messages at seven and fifteen seconds.   I can't figure out my error, I think it is that my threads don't know what they are referring to but I'm not sure.  The error:   Exception in thread "Thread-0" Exception in thread "Thread-1" Exception in thread "Thread-2" java.lang.NullPointerException at TimePrinter.run(TimePrinter.java:7) at java.lang.Thread.run(Unknown Source)  java.lang.NullPointerException at MessagePrinter2.run(MessagePrinter2.java:8) at java.lang.Thread.run(Unknown Source)  java.lang.NullPointerException at MessagePrinter1.run(MessagePrinter1.java:8) at java.lang.Thread.run(Unknown Source)     public class Counter{      private int counter;     private Lock counterLock;      private Condition sevenCondition;     private Condition fifteenCondition;     public Counter() {         counter = 0;         counterLock = new ReentrantLock();         sevenCondition = counterLock.newCondition();          fifteenCondition = counterLock.newCondition();     }     public void incrementCounter(){         counterLock.lock();         try{              counter++;             if (counter%7 == 0)                  sevenCondition.signal();             //else sevenCondition.await();             if (counter%15 == 0)                  fifteenCondition.signal();             //else fifteenCondition.await();             System.out.print(" " + counter + " ");          } finally {counterLock.unlock();}     }      public void sevenSecondMessage()throws InterruptedException{         counterLock.lock();         try{             while (counter%7 != 0){                 sevenCondition.await();             System.out.println("Seven Second Message");             }         } finally {counterLock.unlock();}     }      public void fifteenSecondMessage() throws InterruptedException{         counterLock.lock();         try{             while (counter%15 != 0){                 fifteenCondition.await();             System.out.println("Fifteen Second Message");             }         } finally {counterLock.unlock();}     } }     public class TimePrinter implements Runnable{         private Counter counter;         public synchronized void run(){             try {                 counter.incrementCounter();                  Thread.sleep(1000);             } catch (InterruptedException e){}         }     }        public class MessagePrinter1 implements Runnable{     private Counter counter;     public synchronized void run(){         try {              counter.sevenSecondMessage();              }catch (InterruptedException e){}          }      }      public class MessagePrinter2 implements Runnable{         private Counter counter;         public synchronized void run(){             try {                  counter.fifteenSecondMessage();                  }catch (InterruptedException e){}              }          }      public class Main2 {      public static void main(String[] args){          Runnable timeprinter = new TimePrinter();         Runnable message1 = new MessagePrinter1();         Runnable message2 = new MessagePrinter2();          new Thread(timeprinter).start();         new Thread(message1).start();         new Thread(message2).start();     } }

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


What is the cylinder on this wire? Is it some kind of adapter or transformer? What purpose does it serve? Why couldn’t it be incorporated into the primary adapter that plugs into the wall at the other end?

What is the name of this component (circled in red) of a charger?    What are the uses of this component?


I am trying to have a user defined function that refers to a data set and groups costs by state. The function that I created pulls a list from a list of lists and runs it through the function. While the function works perfectly for the first state, the second time the function is run all of the variables return blank. The function is not adding the proper variables in which is leading to a divide by zero error in my code.  import csv Patient_File = open('Patient_Data.csv') reader = csv.reader(Patient_File)    State_Averages = [] States = [['Alabama','ALcost','AL'],['Alaska','akcost','AK']] def State_Data(State_list,State_Cost,Abbreviation):     State_list = []     State_Cost = []     for row in reader:         if Abbreviation in row[5]:             State_list.append(row)     for item in State_list:         State_Cost.append(item[9])     State_Cost = [elem.strip('$').replace(',','') for elem in State_Cost]     State_Cost=map(float,State_Cost)     #State_Average = sum(State_Cost)/len(State_Cost)     #State_Average = round(State_Average,2)     #State_Averages.append(State_Average)     print Abbreviation     print State_Cost     print State_list  State_Data(States[1][0],States[1][1],States[1][2]) State_Data(States[0][0],States[0][1],States[0][2]) #print State_Averages   The quoted out part of the code is what is causing the divide by zero error but the real core of the problem is the variables State_Cost and State_list are completely empty lists the second time the function is used.

When I'm moving through a file with a csv.reader, how do I return to the top of the file.   If I were doing it with a normal file I could just do something like "file.seek(0)".  Is there anything like that for the csv module?  Thanks ahead of time ;)


Recently I installed Android Studio (which worked perfectly on Windows), but it locks up when I switch to full screen mode and accepts no keyboard input, so each time I need to login using Ctrl+Alt+F1 and kill all processes by running kill -9 -1.  So, any idea why it's happening and how to get rid of it? Thanks in advance. :)

I'm an android developer and have laptop with 4GB RAM. When I compile my project the RAM is used at 100%.    If I add more RAM will it solve the problem?


I use a question filter to check for Clojure questions across the entire network.  I checked this morning, and it's intermittently showing "No questions found":      Sometimes I check and it's working, sometimes it shows nothing.

For example, the  filter sometimes returns an empty list of questions.   Sometimes it happens with newest, sometimes with no-answers tab. In a couple of minutes it returns to normal.


What is the importance of the difference between these two?  $$(\forall \varepsilon > 0)(\exists \delta > 0)(\forall x)([0 < \lvert x-a \rvert < \delta ] \Rightarrow [\lvert f(x)-L \rvert < \varepsilon ])$$ $$(\forall \varepsilon > 0)(\exists \delta > 0)(\forall x)([0 < \lvert x-a \rvert \leq \delta ] \Rightarrow [\lvert f(x)-L \rvert \leq \varepsilon ])$$  Thanks

Definition (As written in Michael Spivak's Calculus)     The function $f$ approaches a limit $l$ near $a$ means: for every $\epsilon >0$ there is some $\delta > 0$ such that, for all $x$, if $0<|x-a|<\delta$, then $|f(x)-l|<\epsilon$.   my question is: why can't it be: $$0<|x-a|\leq \delta,|f(x)-l|\leq \epsilon$$ After looking at limits of functions for a long time just to grasp it's meaning and using the definition quite a lot solving homework I realized I keep writing the same inequality without really understanding why.  The only explanation given in Spivak's book for this part of the definition goes over it without explaining the inequality. I tried looking for an explanation myself but wasn't really able to find anything wrong with it. Is it also possible to write the definition like that or is there a problem with that?   (first non-homework related question :p)


I was doing:  for (Object key : map.keySet())     if (something)         map.remove(key);   which threw a ConcurrentModificationException, so i changed it to:  for (Object key : new ArrayList<Object>(map.keySet()))     if (something)         map.remove(key);   this, and any other procedures that modify the map are in synchronized blocks.  is there a better solution?  if no one comes up with a better solution, first to say no gets the tick ;)

We all know you can't do the following because of ConcurrentModificationException:  for (Object i : l) {     if (condition(i)) {         l.remove(i);     } }   But this apparently works sometimes, but not always. Here's some specific code:  public static void main(String[] args) {     Collection<Integer> l = new ArrayList<>();      for (int i = 0; i < 10; ++i) {         l.add(4);         l.add(5);         l.add(6);     }      for (int i : l) {         if (i == 5) {             l.remove(i);         }     }      System.out.println(l); }   This, of course, results in:  Exception in thread "main" java.util.ConcurrentModificationException   Even though multiple threads aren't doing it. Anyway.  What's the best solution to this problem? How can I remove an item from the collection in a loop without throwing this exception?  I'm also using an arbitrary Collection here, not necessarily an ArrayList, so you can't rely on get.


I'm having a very hard time to fulfill the Orbit Kerbin contract.  I already saw a dozen videos of people explaining how to orbit and saw another billion texts. The problem is, when I'm in orbit, there is nothing that lets me click on the current orbit to adjust it, like "Add Maneuver". It keeps a gray line (not blue like I saw in the videos) and that's all.  Am I missing something?  Note, this question is NOT about how to enable "Add maneuver". It is about how to Orbit Kerbin. Add Maneuver is something I was told that facilitate the process.

Which  unlocks  in career mode in KSP?  The  hints that maneuver nodes are now unlocked with a facility upgrade:     Are there any perks for upgrading?      The building in question   will upgrade visually, both from the outside and the inside. More   gameplay mechanics will be also be unlocked as the player progresses   through the different building tiers. For example, allowing EVAs in   space or being able to use maneuver nodes in the map view.


I am annoyed by the thumbnails that are shown when opening a new tab in Google Chrome. I want to see a blank page. How to do that?

Does Google Chrome has anything similar to about:blank page in IE and Firefox? I did not find any suitable page mentioning this? PS: I tried about:blank but it looked like Chrome is trying to load something before showing blank page...


Use that $ \lim_\limits{n \to \infty}{\left(1 + \frac{1}{n}\right)^n} = e $ to show that $ \lim_\limits{n \to \infty}{\left(1 + \frac{1}{1!} + \frac{1}{2!} + \cdot\cdot\cdot + \frac{1}{n!}\right)} = e $  I can't figure this one out. Can I get some help in solving this?

I guess the proof of the identity $$ \sum_{n = 0}^{\infty} \frac{1}{n!} \equiv \lim_{x \to \infty} \left(1 + \frac{1}{x}\right)^x $$ explains the connection between such different calculations. How is it done?


I have been trying to meditate on PS4 but it won't work. Can some help me please. I tried to mediate in the middle of the map but it won't work.

Whenever I try to meditate on the Whitcher 3 it says "you cannot do this now". Any help? I'm not on a horse or anything I'm just in the city of Novigrad and I can't meditate.


I am trying to write a merge sort function, and this section of code takes the list of ordered pairs of the previous step and creates ordered groups of 4, to be passed on to the next step.     groups = [[]] * ceil(len(pairs)/2)     print(groups)     for n in range(len(groups)):         print(n)         while pairs[2*n] and pairs[2*n+1] != []:             if pairs[2*n][0] <= pairs[2*n+1][0]:                 groups[n].append(pairs[2*n].pop(0))                 print(groups)             else:                 groups[n].append(pairs[2*n+1].pop(0))                 print(groups)         groups[n] = groups[n] + pairs[2*n] + pairs[2*n+1]         print(groups)  So for example, it should take the input pairs = [[27, 38], [3, 43], [9, 82], [10]] and produce groups = [[3, 27, 38, 43], [9, 10, 82]] Instead it produces groups = [[3, 27, 38, 43], [3, 27, 38, 9, 10, 82]] For some reason it seems to be appending the first 3 elements into both sublists when n = 0, and then only appending the elements to the second sublist when n = 1 I don't understand why with the exact same command, the append function appears to be populating both sublists at the same time and behaving differently within the same loop. Any help would be appreciated

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


I am reading an article about   There is something about disabling automatically sending emails.        Disable Email By default cron jobs sends an email to the user account executing the cronjob. If this is not needed put the following   command At the end of the cron job line.  >/dev/null 2>&1       What is the detailed meaning for 2 > & and 1? Why putting this to the end of a crontab file would turn off the email-sending thing?

I'm reading an example bash shell script: #!/bin/bash  # This script makes a backup of my home directory.  cd /home  # This creates the archive tar cf /var/tmp/home_franky.tar franky > /dev/null 2>&1  # First remove the old bzip2 file.  Redirect errors because this generates some if the archive # does not exist.  Then create a new compressed file. rm /var/tmp/home_franky.tar.bz2 2> /dev/null bzip2 /var/tmp/home_franky.tar  # Copy the file to another host - we have ssh keys for making this work without intervention. scp /var/tmp/home_franky.tar.bz2 bordeaux:/opt/backup/franky > /dev/null 2>&1  # Create a timestamp in a logfile. date >> /home/franky/log/home_backup.log echo backup succeeded >> /home/franky/log/home_backup.log  I'm trying to understand the use of /dev/null 2>&1 here. At first, I thought this script uses /dev/null in order to gracefully ignore errors, without causing the script to crash (kind of like try catch exception handling in programming languages). Because I don't see how using tar to compress a directory into a tar file could possibly cause any type of errors.


A close friend of mine asked me if I could pick up money for him using my ID from money gram since he had already exceeded the receiving limit this month. The amount was 500 euros. I just wanted to know if it was safe to do this.

A friend of mine trades Bitcoin and often asks me to pick up money for her, i.e., someone sends money to me (on my name) and I just pick it up and give it to my friend. The amounts are usually around $500.   Is this legal? Can I get into trouble doing this?   I have no idea who the senders are. Thank you.


Should it be:     In nineteenth-century United States, many railroads were constructed.   Or     In the nineteenth-century United States, many railroads were constructed.   Certainly if America were used in place of United States, then there’d be no definite article. But if I insist on saying United States, should there be one?  This question is different from the other. In my opinion, the latter sentence is somehow awkward and there is the possibility that the first sentence is 'correct'. If you think it obvious that the first sentence is wrong and the second sentence is correct, then please, instead of closing this question, answer it and explain why it is so obvious. Or why the other linked question clearly explains my question here.

The Punjab is a rich state.   Is it correct to use the before Punjab?


I have just started studying elementary number theory and I really enjoyed reading Euclid’s Theorem on the infinitude of primes . When talking with a colleague that loves that area he told me that there are some other proofs of this result. Can you please post some other proofs or at least indicate where I can find them?

This is just a curiosity. I have come across multiple proofs of the fact that there are infinitely many primes, some of them were quite trivial, but some others were really, really fancy. I'll show you what proofs I have and I'd like to know more because I think it's cool to see that something can be proved in so many different ways.  Proof 1 : Euclid's. If there are finitely many primes then $p_1 p_2 ... p_n + 1$ is coprime to all of these guys. This is the basic idea in most proofs : generate a number coprime to all previous primes.  Proof 2 : Consider the sequence $a_n = 2^{2^n} + 1$. We have that  $$ 2^{2^n}-1 = (2^{2^1} - 1) \prod_{m=1}^{n-1} (2^{2^m}+1), $$  so that for $m < n$, $(2^{2^m} + 1, 2^{2^n} + 1) \, | \, (2^{2^n}-1, 2^{2^n} +1) = 1$. Since we have an infinite sequence of numbers coprime in pairs, at least one prime number must divide each one of them and they are all distinct primes, thus giving an infinity of them.  Proof 3 : (Note : I particularly like this one.) Define a topology on $\mathbb Z$ in the following way : a set $\mathscr N$ of integers is said to be open if for every $n \in \mathscr N$ there is an arithmetic progression $\mathscr A$ such that $n \in \mathscr A \subseteq \mathscr N$. This can easily be proven to define a topology on $\mathbb Z$. Note that under this topology arithmetic progressions are open and closed. Supposing there are finitely many primes, notice that this means that the set $$ \mathscr U \,\,\,\, \overset{def}{=} \,\,\, \bigcup_{p} \,\, p \mathbb Z $$ should be open and closed, but by the fundamental theorem of arithmetic, its complement in $\mathbb Z$ is the set $\{ -1, 1 \}$, which is not open, thus giving a contradiction.   Proof 4 : Let $a,b$ be coprime integers and $c > 0$. There exists $x$ such that $(a+bx, c) = 1$. To see this, choose $x$ such that $a+bx \not\equiv 0 \, \mathrm{mod}$ $p_i$ for all primes $p_i$ dividing $c$. If $a \equiv 0 \, \mathrm{mod}$ $p_i$, since $a$ and $b$ are coprime, $b$ has an inverse mod $p_i$, call it $\overline{b}$. Choosing $x \equiv \overline{b} \, \mathrm{mod}$ $p_i$, you are done. If $a \not\equiv 0 \, \mathrm{mod}$ $p_i$, then choosing $x \equiv 0 \, \mathrm{mod}$ $p_i$ works fine. Find $x$ using the Chinese Remainder Theorem.   Now assuming there are finitely many primes, let $c$ be the product of all of them. Our construction generates an integer coprime to $c$, giving a contradiction to the fundamental theorem of arithmetic.  Proof 5 : Dirichlet's theorem on arithmetic progressions (just so that you not bring it up as an example...)  Do you have any other nice proofs?


So, when I installed Ubuntu 20.04 LTS onto my PC firstly I removed Nautilus (Because I prefer to use Nemo) and after this action my system has a lot of broken files that can't be removed (I tried and it's said that I have more and more broken files) and the command sudo apt install -f doesn't work at all. How can I fix it? I cannot install even Steam now also my system is up to date! PS. aptitude doesn't work as well as apt. sudo apt install steam sudo password for lambleeg: Reading package lists... Done Building dependency tree        Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation:  The following packages have unmet dependencies:  steam:i386 : Depends: libgl1-mesa-dri:i386 (>= 17.3) but it is not going to be installed or                        libtxc-dxtn0:i386 but it is not installable               Depends: libgl1-mesa-dri:i386 but it is not going to be installed               Depends: libgl1-mesa-glx:i386 but it is not going to be installed               Depends: libudev1:i386 but  but it is not going to be installed E: Unable to correct problems, you have held broken packages.

After upgrading from 10.04 to 12.04 I am trying to install different packages.  For instance ia32-libs and skype (4.0).  When trying to install these, I am getting the 'Unable to correct problems, you have held broken packages' error message.   Output of commands:  sudo apt-get install -f Reading package lists... Done Building dependency tree        Reading state information... Done 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.   After running this:  sudo dpkg --configure -a foo@foo:~$ sudo apt-get install -f Reading package lists... Done Building dependency tree        Reading state information... Done 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.


I have a flight booked from San Francisco > Dublin > Manchester later this year. I have to be in Dublin for business the day after I get to Manchester so rather than flying on I'd prefer to just stay in Dublin.  Is it possible to ditch the second leg of my flight and stay in Dublin with Aer Lingus?

Say I want to book a flight from Fort Lauderdale to Chicago.  Say the airline also flies to St. Louis from Fort Launderdale but has a connecting flight through Chicago.  If I book that flights from FLL->ORD->STL and just get off in Chicago, what possible problems can I run into, assuming I didn't check any bags and only have carry on?  This scenario exist for Southwest, but I wanted this be more of a general question that would apply to all airlines.


It seems very inconvenient. To get the sword in the situation of pressing need and danger, you first have to decide to wear someone's hat. What are the chances? Was it the original design by Godric Gryffindor? Or can the Hat provide the sword, even if the person is just holding it?

Spoilers follow, and this is from the books (not the movies)...  In The Chamber of Secrets:      Harry retrieves Goderic Gryffindor's sword from the sorting hat during the confrontation with the basilisk. After this Dumbledore keeps hold of the sword in a glass case in his office.    Then in The Deathly Hallows:      Harry and Ron do a deal with Griphook to return Gryffindor's sword to the goblins after they have retrieved Hufflepuff's cup, planning to partially double cross him by holding on to it until all the horcruxes have been destroyed. However Griphook double crosses them first, and keeps hold of the sword.   Then, in the battle at the end of the book:      Voldemort puts the sorting hat on Neville Longbottom's head and sets him on fire. Instead of burning Neville pulls Gryffindor's sword out of the sorting hat and beheads Nagini, destroying Voldemort's last horcrux.   However, if the sword could always be pulled out of the hat by someone sufficiently heroic then why the need to:      Create a copy of the sword to fool Bellatrix Lestrange into thinking she had the real one in Gringott's vault? Why forge a copy and risk Snape placing it in the lake if it could always have been pulled from the sorting hat, regardless of where it was or how it was protected?   How was Gryffindor's sword pulled from the hat the second time? Surely it was beyond the reach of accio or any other charms once returned to its goblin creators?


My references contain two elements with the same author names and year in them. Using style=authoryear, they are listed as "Authors, 2009a" and "Authors, 2009b" in the text which is fine for me. However, In the reference section, the author field of the second entry seem to be replaced with an em-dash (—). I already tried to find a corresponding field that I can change with \DeclareFieldFormat, but had no luck. How can I change this so that both entries list the author names. Example output:  And this is how I want it to be (note how both entries for Alam, A. have full author information):  Example code: \documentclass{article}  \usepackage{filecontents} \usepackage{hyperref}  \begin{filecontents*}{mybib.bib} @article{alam2009a,   title = {High-Resolution Structure of the Open {{NaK}} Channel},   author = {Alam, Amer and Jiang, Youxing},   date = {2009-01-21},   journaltitle = {Nature Structural \& Molecular Biology},   volume = {16},   pages = {30--34},   doi = {10.1038/nsmb.1531},   keywords = {\#nosource},   number = {1} }  @article{alam2009b,   title = {Structural Analysis of Ion Selectivity in the {{NaK}} Channel},   author = {Alam, Amer and Jiang, Youxing},   date = {2009-01},   journaltitle = {Nature Structural \& Molecular Biology},   volume = {16},   pages = {35--41},   doi = {10.1038/nsmb.1537},   langid = {english},   number = {1} }  @article{altomare2001,   title = {Integrated {{Allosteric Model}} of {{Voltage Gating}} of {{Hcn Channels}}},   author = {Altomare, Claudia and Bucchi, Annalisa and Camatini, Eva and Baruscotti, Mirko and Viscomi, Carlo and Moroni, Anna and DiFrancesco, Dario},   date = {2001-06-01},   journaltitle = {The Journal of General Physiology},   shortjournal = {J Gen Physiol},   volume = {117},   pages = {519--532},   number = {6}, } \end{filecontents*}  \usepackage[     style=authoryear,     doi=false,     backref,     giveninits=true,     uniquelist=false, ]{biblatex} \addbibresource{mybib.bib}  % newline after author and year \DeclareDelimFormat[bib]{nametitledelim}{\newline\bibsentence}  \begin{document} This is a document that cites \cite{alam2009a} and \cite{alam2009b} and has a reference from \cite{altomare2001}. \printbibliography  \end{document}

I use biblatex with style=authoryear and when there are two references of the same author in the bibliography there is just a dash. How can I get the full name in the second entry too?


Isn't a subshell created when I run the bash command? For example, after executing bash, I cannot access the value of a non-exported variable. In this case, is the environment I switch to with the bash command not a subshell running under the current bash shell? :~$ value="testing" :~$ echo $value testing :~$ bash :~$ ps f   PID TTY      STAT   TIME COMMAND    82 tty1     S      0:00 -bash    97 tty1     S      0:00  \_ bash   124 tty1     R      0:00     \_ ps f :~$ :~$ echo $value :~$ exit exit :~$ export value :~$ bash :~$ echo $value testing :~$

There are this two names: a subshell and a child-shell.  Yes, a child process will be started by any of this:  sh -c 'echo "Hello"' ( echo "hello" ) echo "$(echo "hello") echo "hello" | cat   Are all equivalent and share the same name? Do all share the same properties?    POSIX :     A shell execution environment consists of ....   But the last paragraph of above link has this:     A subshell environment shall be created as a duplicate of the shell environment, except that signal traps that are not being ignored shall be set to the default action.    And specially:     Command substitution, commands that are grouped with parentheses, and asynchronous lists shall be executed in a subshell environment. Additionally, each command of a multi-command pipeline is in a subshell environment; ....   The sh -c 'echo "Hello"' is not included there, should that be called a subshell also?


I had several friends ask me to update their Ubuntu to a newer kernel without changing the version of Ubuntu. So for example, staying in 10.04 with the 3.3 Kernel version.  When having an older or present Ubuntu version, many users want to apply the newer stable/unstable kernel version to the Ubuntu version they are using thinking that it is similar to upgrading a program. So what I am looking for, are some simple answers to explain the dangers (that are pretty much bigger than the advantages) of forcing a newer kernel version in a Ubuntu release that was not meant for it.  What can I tell them or explain to them of why they should NOT update to a newer/older kernel when having an Ubuntu version that was not made for that kernel version.

Newer "mainline" versions of the kernel are available from the , e.g. 3.4 and 3.5, while Ubuntu 12.04 is on 3.2.   What are the mainline kernels? Are they better than my existing kernel? What are the pros and cons of upgrading to a mainline kernel? Will I easily be able to go back?


Boots very slowly, once booted, boot.log displays the following:   lvmetad is not active yet, using direct activation during sysinit   Volume group "ubuntu-vg" not found   Cannot process volume group ubuntu-vg   /run/lvm/lvmetad.socket: connect failed: No such file or directory   WARNING: Failed to connect to lvmetad. Falling back to internal scanning.   Reading all physical volumes.  This may take a while...   Found volume group "ubuntu-vg" using metadata type lvm2   /run/lvm/lvmetad.socket: connect failed: No such file or directory   WARNING: Failed to connect to lvmetad. Falling back to internal scanning.   2 logical volume(s) in volume group "ubuntu-vg" now active   How to solve this?  Additional info from /etc/fstab:  /dev/mapper/ubuntu--vg-root /               ext4    noatime,errors=remount-ro 0       1 # /boot was on /dev/sda1 during installation UUID=2728dcfe-e621-4e18-8266-fc4f0057148f /boot           ext2    defaults        0       2 /dev/mapper/ubuntu--vg-swap_1 none            swap    sw              0       0  tmpfs      /var/log        tmpfs      defaults,noatime        0    0 tmpfs      /tmp          tmpfs      defaults,noatime,mode=1777    0    0

I've followed this tutorial to install Ubuntu 15.10:    After restarting my computer I got to the grub menu and chose Ubuntu. Shortly after that I got this error:  /run/lvm/lvmetad.socket: connect failed: No such file or directory WARNING: Failed to connect to lvmetad. Falling back to internal scanning.   These messages keep adding up on a black screen every second. After a while,  I get access to the initramfs ash console.  what am I doing wrong?


Momentum conservation is a most fundamental theorem in physics. Can this law be disproven? In which situations is total momentum not conserved?

The law of the conservation of momentum has been established for hundred of years. Even in Quantum field theory every particle collision must be momentum-conserving if there is homogenity in space. Can this theorem still be violated?  If yes, what requirements must have a momentum-non-conserving theory? Is Heisenberg's uncertainity principle $\Delta x \Delta p \geq \frac{\hbar}{2}$ the possible answer? (when one considers physical Systems in which $\Delta x$ is very small)?


Package containerd in version 1.3.3 seems to be the most recent one for  architecture amd64: $ apt show containerd       Package: containerd Version: 1.3.3-0ubuntu1~18.04.4 Priority: optional ...  Unfortunately the sources are not available. $ apt-get source containerd       Reading package lists... Done E: Unable to find a source package for containerd   $ cat /etc/apt/sources.list deb http://archive.ubuntu.com/ubuntu/ bionic main restricted deb-src http://archive.ubuntu.com/ubuntu/ bionic main restricted deb http://archive.ubuntu.com/ubuntu/ bionic-updates main restricted deb-src http://archive.ubuntu.com/ubuntu/ bionic-updates main restricted  It seems like the . Which is 1.4.4. But this version is not available for amd64. Is there a way of getting the sources for the recent containerd version 1.3.3 via apt ?

How do I get to the Universe Repository in supported versions of Ubuntu?


I need to find what is the derived subgroup of the dihedral group, but i am getting the (probably the wrong) the wrong answer. See: I got two generic elements of the dihedral group. R means rotation and r means reflection $$<R^{i},r^{j}> = R^{-i}r^{-j}R^{i}r^{j} = R^{-i}r^{-j}r^{j}R^{-i}$$ so $$=R^{-i}R^{-i}$$ which in general do not commute. But what i have to do now? I am seeking another way to represent this, if there is.

Let  $G=D_{2n}=⟨x,y|x^2=y^n=e,  $ $yx=xy^{n-1}⟩$  I need to find $G'$ [ the commutator of G]  now I understand that $G'$ is the subgroup generated from $ U=xyx^{-1}y^{-1} , $ $ \ \forall x,y \in G$ So, $U=<y^2>$  whats the strategy  here ?


What does being drawn to someone mean in the case of a movie or book character? (the complete question is: to which character in the film were you the most drawn?)

I think 'drawn' means  'showing the wearing effects of overwork, care or suffering', but I can't understand what 'you are drawn to her' will be meaning right here.


The aim of the regression line is to find the line which error is minimum. This error can be calculated by suming all the squares of the difference between the value predicted by the line and the real one. However, some say the average point must belong to line, is this true? Because, if it were that way, that line may not minimize the error.

Problem: The following table below shows the marks scored by seven students on two different mathematics tests. $$\begin{array}{c|c|c|}  \text{Test 1 (x)} & 15 & 23 & 25 & 30 & 34 & 34 & 40 \\ \hline \text{Test 2 (y)} & 20 & 26 & 27 & 32 & 35 & 37 & 35 \\ \hline \end{array}$$ Let $L_{1}$ be the regression line of x on y. The equation of the line $L_{1}$ can be written in the form $x = ay + b$. (a)  Find the value of $a$ and the value of $b$. Let $L_{2}$ be the regression line of $y$ on $x$. The lines $L_{1}$ and $L_{2}$ pass through the same point with coordinates $(p,q)$. (b) Find the value of $p$ and the value of $q$. My solution: I inputted both sets of data into the calculator (TI-84) and got a line of best fit for both. $x$ on $y$: $y=1.2908291457286x-10.379396984925$ $y$ on $x$: $y=0.69993188010899x+10.187670299727$ These two lines intersect at $(34.81,34.55)$ The actual solution: The lines should meet at $(x̄, ȳ) = (28.7,30.3)$ Can anyone point me in the correct direction? I just don't see how these two lines could intersect at the mean x,y values when those values are obviously flipped in the two lines. Edit: This problem is from the IB Math AA HL curriculum, exam code SPEC/5/MATAA/SP2/ENG/TZ0/XX/M . This is a practice test provided by IB.


I looked it up in a book, which is usually more thorough in terms of explanations than a website.  Take this for ex.:  if (nickname == "Bob")   The condition will be true only if nickname is referring to the same String object.  Here is a sentence I found confusing, can anyone please explain to why this is the case:     For efficiency, Java makes only one string object for every string constant.    The book points out that the way of assembling the object "Bob" also affects whether the condition will be true of not, which confuses me the most.  For ex.:  String nickname = "Bob"; ... if (nickname == "Bob") //TRUE   But if "Bob" is created from .substring() method, condition will be FALSE.  String name = "Robert"; String nickname = name.substring(0,3); ... if (nickname == "Rob")//FALSE   Why is this so?  Edit: in the end of the book's explanation, I found a sentence which also confuses me a lot:     Because string objects are always constructed by the compiler, you never have an interest in whether two strings objects are shared.   Doesn't everything we write get constructed by the compiler?

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


I have the Logitech darkfeild mouse (the one that works on glass) and was wondering how I can remap one of my currently unused buttons (my zoom button) to function as a selected keyboard button (control or supper)? ....I am also using 13.04.... FYI.  Thanks

I struggled with this over the weekend, and need to remap my mouse buttons.


I want to apply to study computer science phd at us universities, and I am wondering if a professor that I have emailed for admission don't reply my mail. should i still apply for university? Thanks

Say a prospective PhD has a high reply rate (90-95%) to first contact emails with potential superviors. He/She has a well thought out e-mail, but a particular professor (here: USA) that is in the top preferences does not reply after two to three e-mails that were sent within a time frame of three months. I also followed the instructions on the professor personal website in the section "prospective PhD students". The student has already contacted some of the advisor students and has received positive feedback about the professor.  Should the student just give up and move on? Should the student keep trying?  Aside from the obvious "I have too many incoming e-mails to answer" or "I am out in the field", what could create a no response behavior from the professor?  I have seen the simplistic answer "move on, bad advisor, doesn't have time, etc". But this seems a contradiction in this case. The PhD students like the professor and say he/she is personable and no e-mail response after a few well written emails.


I am seeing some very strange results when using du on some of my folders. For example: #cd /storage/main_folder  #du -h --max-depth=2 subfolder1 | grep subfolder2   1.8G    subfolder1/subfolder2/subfolder31 5.3G    subfolder1/subfolder2/subfolder32 352M    subfolder1/subfolder2/subfolder33 76K     subfolder1/subfolder2/subfolder34 1.8G    subfolder1/subfolder2/subfolder35 4.0M    subfolder1/subfolder2/subfolder36 301M    subfolder1/subfolder2/subfolder37 9.4G    subfolder1/subfolder2  # du -h --max-depth=1 subfolder1/subfolder2  1.8G    subfolder1/subfolder2/subfolder31 5.3G    subfolder1/subfolder2/subfolder32 352M    subfolder1/subfolder2/subfolder33 96G     subfolder1/subfolder2/subfolder34 1.8G    subfolder1/subfolder2/subfolder35 4.0M    subfolder1/subfolder2/subfolder36 301M    subfolder1/subfolder2/subfolder37 106G    subfolder1/subfolder2  As far a I can tell, there are no links or special files in subfolder2. The disk is a local RAID volume, ext4, mounted with rw,noatime,nodiratime,stripe=64 . What could be causing this, and what can I do to fix the problem, and get the correct results? Thank you! [ Edit, because I received a link to  : I am aware of apparent size vs block size. But in this case, note that:  subfolder34 shows up as 76K in one output, and 96G in the other. Too big a difference to be explained by apparent size... I am using the exact same du command, the only difference is the working directory when running the command. So we can exclude differences due to the way different utilities compute sizes ]

I have a 3TB HDD.  In the properties screen of the HDD, it says that I have used 471.4GB, but when I select all the files in nautilus, it says that 321.0GB is selected.  If I only have 321.0GB of files in the HDD, why is it using 471.4GB?  The HDD's partitioning is using GUID and file system being used in EXT4.  When I select the HDD using Disk Utility app, I get a warning saying:  WARNING: The partition is misaligned by 3072 bytes. This may result in very poor performance.  Repartitioning is suggested.   Has that got anything to do with the missing 150.4GB?


This particular question is part of an assignment of an institute in which I don't study.  Question: Let $p(z)=z^{n}+c_{n-1} z^{n-1} + ... + c_{1}z+c_{0}$ and $R=[1+|c_0|^2+...+|c_{n-1}^2|]^{1/2}$. Prove that all the zeroes of $p$ are in $\{z:|z|<R\}.$  Attempt: I thought of using Rouche's theorem  by taking $f(z)=c_{n-1} z^{n-1}+c_{1}z+c_{0}$ and $g(z)=z^n$. So the zeroes of $f(z)$ lie in same contour  as $f(z)+g(z)$ but how to prove that all zeroes of $f(z)$ are in $\{z:|z|<R\}$ ? Using Cauchy Schwartz we get $|g(z)|\leq R \times [|z|^2+...+|z|^{2n-2}]^{1/2}$ so I don't think that is gonna help. Kindly help.

Im trying to solve a problem X.12.6 from Sarason's Complex Function Theory:  So I tried using Rouché's theorm, on the function $g(z)=z^n$, on the domain $\{z:z<\sqrt{1+|c_{n-1}|^2+...+|c_0|^2}\}$ and using the fact that in that open circle $g$ has $n$ roots ($0$ is zero of order $n$) and then get by the thorem that the polynomial $f$ has n roots in that circle. The problem is that I cant show that $|f(z)-g(z)|<|g(z)|$ on the boundary of the circle. Can you please give me a hint how to show that?


In the iOS app, I can't find the function that shows:      Recent achievements: privileges, badge and reputation earned   The site shows this information.  I think it's a useful function to monitor reputation changes; Am I not seeing it, or is a missing feature?

It'd be nice to see reputation updates in the app, as we get on both the desktop and mobile sites.  Mock-up of how this would look:        Other possible icon states:        While I understand reputation is shown in the feed, it's a bit unwieldy, and has no notification.   With this feature implemented, the feed could arguably lose both reputation and inbox items, and be left with the interesting questions that fill it up. This would make for a much more consistent UX across app and desktop.


I add text to a textarea with the code  document.getElementById("b").addEventListener("click",  function(e) {   e.preventDefault();   var text='test',txtarea;   // Problem   var t = document.getElementsByTagName('textarea');     for(var i =0 ;i<t.length;i++){     if(t[i]==document.activeElement) {txtarea=t[i]}     }   var scrollPos = txtarea.scrollTop;   var strPos = 0;   strPos = txtarea.selectionStart;   var front = (txtarea.value).substring(0, strPos);   var back = (txtarea.value).substring(strPos, txtarea.value.length);   txtarea.value = front + text + back;   strPos = strPos + text.length;     txtarea.selectionStart = strPos;     txtarea.selectionEnd = strPos;     txtarea.focus();   txtarea.scrollTop = scrollPos; } );     I want to find the focused textarea (one in which writing currently) in the page.  I created a loop to check which textarea is focused, but it does not work probably because when I click the focus shifts from the textarea to a element.

I would like to find out, in JavaScript, which element currently has focus. I've been looking through the DOM and haven't found what I need, yet. Is there a way to do this, and how?  The reason I was looking for this:  I'm trying to make keys like the arrows and enter navigate through a table of input elements. Tab works now, but enter, and arrows do not by default it seems. I've got the key handling part set up but now I need to figure out how to move the focus over in the event handling functions.


I read in a book that: let $f(K,R)$ is cryptographic transformation of $R$ using $K$, $K\{R\}$ means $R$ is encrypted using $K$ and $h\{R\}$ is the hash of $R$ and then the example follows.  I want to know what is difference between cryptographic transformation of $R$ and encryption of $R$ using the same key? Aren't they same thing?

What is the difference between encrypting something and hashing something?  in what situations would I want one or the other?


I have an iPad2, with a Pocket Edition on it, but with an old iOs, and I can't play normally on it, because its a really old iPad, the question is, can I pass my worlds to an iMac Minecraft edition ?

Can I get my Minecraft Bedrock Edition worlds onto my PC to play in regular Minecraft? If so how? I have used iExplorer to transfer files from my iPad but that was no help. Any suggestions?


Let $a$ and $b$ be the number of divisors of two positive integers , is it possible to explicitly express the number of divisors of their product only in terms of $a$ and $b$? If not , how can it be calculated efficiently without actually calculating the product?

Let $a$ and $b$ be two numbers,    Number of divisors of $a$ is $n_1$; Number of divisors of $b$ is $n_2$;    How to find the number of divisors $N$ of product $a \times b$ by using known number of divisors of factors $n_1$ and $n_2$?  If $a = 20$ and $b = 21$, then $n_1 = 6$ (number of divisors of $a$), $n_2 = 4$ (number of divisors of $b$. Then $a \times b = 420$ and $N = 32$ (number of divisors of $a \times b$).  Is there a formula to find $N$ in terms of $n_1$ and $n_2$?


If we have a group like $Z_m =   \{0,1,2,...,m-1 \}$ and define an addition and multiplication on this group as the remainder of ordinary addition and multiplication division by $m$ (modulo m), prove that the necessity and sufficiency condition for $Z_m$ to be a Field is that the $m$ be a prime number!  e.g.: $$m=5$$ $$2\oplus4=1$$ $$2\otimes4=3$$  for $$m=2$$ I guess it's like Boolean algebra!

I am looking for ways to prove that $\mathbb{Z}_m=\{0,1,2,\dots,m-1\}$ is a field under addition and multiplication $\bmod\ m$ iff $m$ is a prime.   I tried it this way: If $m$ is a prime $p$,it is obvious that most importantly, we need to prove that every non-zero element in $\mathbb{Z_p}$ has an inverse in $\mathbb{Z_p}$.We note that if $a,b\in \mathbb{Z_p}$, then $a\cdot b\in \mathbb{Z_p} \dots \boxed{*}$. Next, $a^p\equiv a \bmod p$ for prime $p$(the proof follows by induction on $a$).As  $\displaystyle 0\leq a\leq p-1$,$a\not =p$. Thus $$a^{p-1}\equiv 1 \bmod p$$ for prime $p$ which,together with $\boxed{*}$ guarantees the existence of an inverse in $\mathbb{Z_p}$.Proving the other properties is simple.  Conversely,if $\mathbb{Z_m}$ is a field,then every non-zero element of $\mathbb{Z_m}$ has an inverse.Note that inverse of an element is unique.For if $a\cdot b\equiv a\cdot c\equiv 1 \bmod m$,then $(a\cdot b)\cdot c\equiv c\equiv (a\cdot c)\cdot b\equiv b \bmod m$ i.e $m|(b-c)\implies b-c=0(0\leq a\leq m-1,a\in \mathbb{Z_m})$.So, inverses must be unique and every element is either an inverse of itself or has in inverse in the field.That allows us to conclude that $[(m-1)!]^2\equiv 1 \bmod m$ which can only mean that either  $(m-1)!\equiv 1 \bmod m$ or $(m-1)!\equiv -1 \bmod m$. If $m$ is not a prime, it has a prime factor, say $p$. $ 0\leq p\leq m-1\implies p|(m-1)!\implies p|1$or $-1$ which is absurd, a contradiction.Thus $m$ is prime.  I feel that this method is too involved and complicated. Can anyone please suggest some other method?(Some context: This is a problem from Finite Dimensional Vector Spaces by Paul Halmos. I am learning linear algebra for the first time.It seems some of the comments have been posted on the assumption that I know rings and fields; I don't. )


Is there any application that can do this?Ive tried pc decrapifier but it seems to be needing a user in order to uninstall the programs that are checked. This is in windows

Just been working on a new laptop today (Acer) and it was pre-installed with all sorts of crapware. Mostly games and "backup utilities" and McAfee. I had to manually uninstall about 30 apps via Vista's Programs and Features  So it got me wondering is there any way of mass uninstalling or queuing an app to be uninstalled? Through Vista/XP you need to wait for Install Shield or whatever to close before beginning to uninstall the next app. Took way more time than it should have.  Just another one of those Windows annoyances! Any help appreciated as I often need to do this when I come across a slow machine that's just been clogged with a bunch of useless apps


I am new to Stack Exchange and want to know how shall I increase the view of my question which is not getting answered and has gathered small no. of views. I have used bounties in stack overflow in past in order to increase the view count and successfully get the required answer but what if I'm new to some other website of Stack Exchange and do not have enough reputation to put bounties? I know that editing can help and have done it but still, the question remains less viewed. One of my question on  has gathered fewer views and I'm new to that site. I can't offer bounties on it, so Is there any way to tackle with this? EDIT: If the question has answers and none of them are helpful then at least there is a chance that people who answered may soon find the right/helpful or at least look into the depth of question. But, here I'm asking about a scenario where the question hasn't received any answers and fewer views.

I asked a question almost as soon as I got my account. I got a few decent answers, but none of them helped solve my problem. The question has long since become buried by newer questions, and there's still no accepted answer. Unfortunately, because there are quite a few answers with votes, to a casual observer it probably looks like the question was answered and I just neglected to mark an answer as accepted, and the system does not consider it "unanswered".  Or, I asked a question that was a bit more difficult to answer. After waiting for some time, I received no answers, little or no comments, and only a few views. The question does show up in the "unanswered" list, but no one has answered my question.  In either case, what's the protocol for me to try to get this question answered?  I see several options:   Post the question a second time, possibly linking to the original, to get attention for the original question. This is encouraged on sites like Reddit.  However, it's probably not appropriate here, since we're encouraged to check for duplicates and not submit a question that's already been asked by someone else, so this probably falls under that heading. Wait for some kind of wiki-like talk page to be implemented, then post a plea on the talk page for input and hope that activity on the talk page bumps up the question. Edit the question, but do nothing further on the Stack Exchange site. If I edit my post to say that I haven't accepted any of the current answers but am looking for more, then the question might get answered eventually by people browsing through old questions to find something they can answer. Post the question on other sites, but link to my original question on Stack Exchange. People will either answer here, or they'll answer on the other site and I can post the accepted answer here myself.  This might be considered spamming, so it might be better to do this without the link.      For more information, see the "" page in the .


I was trying to solve some problems in Complex Analysis, and was encountering some trouble in problems that tried to show some relations between $f(z)$ and $f(\bar{z})$. I was trying to see some examples online and I tend to encounter this description of the derivatives that I'm not able to see where it comes from. The mentioned description of the derivatives are: $\frac{du}{dz} = \frac{1}{2}\left(\frac{du}{dx} - i\frac{du}{dy}\right)$ and $\frac{du}{d\bar{z}} = \frac{1}{2}\left(\frac{du}{dx} + i\frac{du}{dy}\right)$

I came across this the other day: $$ \frac{\partial f}{\partial \bar{z}} = \frac12\left(\frac{\partial f}{\partial x}+i\frac{\partial f}{\partial y}\right) $$ I decided to attempt to work it out myself to better understand it. I know $2x = z + \bar{z}$, and $2iy = z - \bar{z}$, and using the total derivative we have $$ \frac{\partial f}{\partial \bar{z}} = \frac{\partial f}{\partial x}\frac{\partial x}{\partial \bar{z}} + \frac{\partial f}{\partial y}\frac{\partial y}{\partial \bar{z}} $$ and this is about where I got stuck. How exactly am I supposed to calculate $\frac{\partial x}{\partial \bar{z}}$? My confusion doesn't lie in the notation, but in the mechanics of the very thing I'm being asked to differentiate. Look at $x$: $$ x(\bar{z}) = \frac{\bar{z} + z}{2} = \frac{\bar{z}+\bar{\bar{z}}}{2} $$ if we label $Z = \bar{z}$, then $\frac{\partial x}{\partial \bar{z}} = \frac{\partial x}{\partial Z}$, and $x(Z) = \frac{Z+\bar{Z}}2$. However, as far as I can tell, $\frac{Z+\bar{Z}}{2}$ isn't even complex differentiable, because $\bar{Z}$ isn't complex differentiable with respect to $Z$. $x(Z)$ doesn't satisfy the CR equations: $$ x(X+iY) = X + i0 = u(X, Y) + iv(X, Y) \\ u_X = 1 \neq 0 = v_Y \\ v_X = 0 \neq -1 = -u_Y $$  so how could I possibly take the complex derivative of it? That doesn't make any sense.  What exactly am I missing here? Is the derivative $\frac{\partial x}{\partial \bar{z}}$ a different kind of derivative? Are we not supposed to do the complex derivative but instead something else?


i have been searching online and cant seem to find an appropriate fix for my error: Cross-thread operation not valid: Control 'Form1' accessed from a thread other than the thread it was created on.  I looked onto but cant figure out how i invoke my size change?  My code which works some times and the other throws the above code is:  'Handler to handle screen resizes! (Tablet being flipped etc...) Private Sub TouchRadio_Resize(sender As Object, e As EventArgs) Handles Me.Resize     Dim thread As New Thread(AddressOf resizescreen)     thread.Start() End Sub  Public Sub resizescreen()     System.Threading.Thread.Sleep(1)     For index As Integer = 1 To 50000         If Screen.PrimaryScreen.Bounds.Width = (Screen.PrimaryScreen.Bounds.Width + 17) Then             Exit For         End If         Dim screenWidth As Integer = Screen.PrimaryScreen.Bounds.Width         screenWidth = (screenWidth + 17)         Dim screenHeight As Integer = Screen.PrimaryScreen.Bounds.Height         Me.Size = New System.Drawing.Size(screenWidth, screenHeight) 'Here it errors at         GeckoWebBrowser1.Size = New System.Drawing.Size(screenWidth, screenHeight)         Me.Location = New Point(0, 0)     Next End Sub

I have a scenario. (Windows Forms, C#, .NET)   There is a main form which hosts some user control. The user control does some heavy data operation, such that if I directly call the UserControl_Load method the UI become nonresponsive for the duration for load method execution. To overcome this I load data on different thread (trying to change existing code as little as I can)   I used a background worker thread which will be loading the data and when done will notify the application that it has done its work.   Now came a real problem. All the UI (main form and its child usercontrols) was created on the primary main thread. In the LOAD method of the usercontrol I'm fetching data based on the values of some control (like textbox) on userControl.    The pseudocode would look like this:  CODE 1  UserContrl1_LoadDataMethod() {     if (textbox1.text == "MyName") // This gives exception     {         //Load data corresponding to "MyName".         //Populate a globale variable List<string> which will be binded to grid at some later stage.     } }   The Exception it gave was     Cross-thread operation not valid: Control accessed from a thread other than the thread it was created on.   To know more about this I did some googling and a suggestion came up like using the following code  CODE 2  UserContrl1_LoadDataMethod() {     if (InvokeRequired) // Line #1     {         this.Invoke(new MethodInvoker(UserContrl1_LoadDataMethod));         return;     }      if (textbox1.text == "MyName") // Now it wont give an exception     {     //Load data correspondin to "MyName"         //Populate a globale variable List<string> which will be binded to grid at some later stage     } }   BUT BUT BUT... it seems I'm back to square one. The Application again  become nonresponsive. It seems to be due to the execution of line #1 if condition. The loading task is again done by the parent thread and not the third that I spawned.  I don't know whether I perceived this right or wrong. I'm new to threading.  How do I resolve this and also what is the effect of execution of Line#1 if block?  The situation is this: I want to load data into a global variable based on the value of a control. I don't want to change the value of a control from the child thread. I'm not going to do it ever from a child thread.   So only accessing the value so that the corresponding data can be fetched from the database.


Hello I would like to display in my code a full number to 20 decimal without scientific notation. I think it's a memory problem in php. can you help me ? thanks function get($l, $c) {     $value = 0;      if (0 <= $c && $c <= $l && $l < 5000) {         $tab = [];          for ($i = 0; $i <= $l; $i++) {              for ($j = 0; $j <= $c; $j++) {                  if ($i == $j || $i - 1 <= 0 || $j <= 0) {                     $tab[$i][$j] = 1;                     $value = $tab[$i][$j];                 } elseif ($i != $j) {                     $tab[$i][$j] = ($tab[$i - 1][$j - 1]) + ($tab[$i - 1][$j]);                     $value = $tab[$i][$j];                 }             }         }     }     return $value; } echo get(67, 34); // found  :1.422652073762E+19 , excpected:14226520737620288370

To use  as you would require when using the  with large numbers (100,000+), it calls for some very large calculations.  When I multiply two large numbers (eg: 62574 and 62574) PHP seems to cast the result to a float. Getting the modulus value of that returns strange values.  $x = 62574 * 62574; var_dump($x);          // float(3915505476) ... correct var_dump($x % 104659); // int(-72945)  ... wtf.   Is there any way to make PHP perform these calculations properly? Alternatively, is there another method for finding modulus values that would work for large numbers?


If I have a map with a series of locations and I want to find a new point which is at the maximum distance away from all of these points but within the interior of the boundary made up of the outermost points. In layman's terms, how would i go about this? Apologise if there is lack of clarity, I haven't done much maths for a while! Thanks in advanced!

I have a set of x,y coordinates and wish to find a new coordinate pair which is as far away from any point in the initial set, while also being within the convex hull of the original points.   The current process I have to determine the new point is as follows:   Generate every possible midpoint between the original coordinate pairs. Compute the distance between the midpoints and every original point. Find the smallest distance calculated in Step 2 for each midpoint. Find the midpoint with the largest distance from Step 3.   If multiple points have the same maximum distance to the nearest original set of points, only one of those points is needed (for my purpose) and can be selected arbitrarily.  Is there a better method for finding these coordinates?


I want my program to keep asking the user to enter the numerator and if the input was a number it asks for the denominator it checks if it is 0 or not if 0 it shows error message and if not it completes division  but if the numerator was a string it sends an error message but if it is E or e it exits the program  but the problem is that it asks me to enter the numerator twice and it doesn't ask me to enter the denominator and it devises the first number I enter over the second even if I enter a string it asks me to enter the string twice  package Division; import java.util.Scanner; public class Division{      public static void main(String[] args) {     Object n,d;       Scanner input = new Scanner(System.in);           do{              System.out.println("Enter the numerator: ");             n = input.next();             System.out.println("");              if(input.hasNextDouble())             {                  System.out.println("Enter the denominator: ");                 d = input.nextDouble();                 if (d==0){                     System.out.println("You can't divide "+n+" by 0");                 }                 else{                     System.out.println(n+"/"+d+" is"+Double.valueOf((String) n)/Double.valueOf((double) d));                 }             }             else if(input.hasNextLine()) {                 if(n.equals("e")||n.equals("E")){                     System.out.println("Good Bye");                 }                 else{                     System.out.println("You entered bad data. Please try again.");                 }             }         }while(n.equals("e")==false||n!=n.equals("E")==false);    } }

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


c++.why can't you separate the definition of your templates class from their declaration and put them inside a .cpp file? is there a workaround to allow the separation. And could anybody give my a source where I could also get more information with examples. Thanks

Quote from :     The only portable way of using templates at the moment is to implement them in header files by using inline functions.   Why is this?  (Clarification: header files are not the only portable solution. But they are the most convenient portable solution.)


I've tried like they mentioned on GitHub. I am not able to set up the workspace for my work laptop. The error is says:     Your [mm_workspace] setting is not configured properly. Please ensure any locations specified in mm_workspace exist on the system, then try your operation again.   I created the folder on my desktop called MavensMate. I installed Package Control and I set up the "mm_workspace" to:   "/Users/oyl956/Desktop/workspaces/mavensmate"

I followed  .But I am getting below error on step 5 for OSX (workspace path like /Users/Andy Ray/Documents/mm_workspace)  Error trying to parse settings: Expected value in Packages/User/mavensmate.sublime-settings:1:1


Evaluate using complex numbers: $$\prod^{n}_{k=1}\cos\left(\frac{k\pi}{m}\right)$$ where $m=2n+1$.   $\bf{My\; Try::}$ Let $\displaystyle P = \prod^{n}_{k=1}\cos\left(\frac{k\pi}{m}\right).$ Now let $\displaystyle \cos \left(\frac{k\pi}{m}\right) = \frac{e^{\frac{ik}{m}}+e^{\frac{-ik}{m}}}{2}$ and Let $e^{\frac{i\pi}{m}} = \omega$  So we get $$P = \frac{1}{2^n}\left\{(\omega+\omega^{-1})(\omega^2+\omega^{-2})\cdots(\omega^n+\omega^{-n})\right\}$$  So $$P = \frac{(1+\omega^2)(1+\omega^4)\cdots(1+\omega^{2n})}{2^n\cdot \omega^{\frac{n(n+1)}{2}}}$$  Now How can i solve after that, Help required, Thanks

Evaluate $$ \prod_{r=1}^{7} \cos \left({\dfrac{r\pi}{15}}\right) $$  I tried trigonometric identities of product of cosines, i.e, $$\cos\text{A}\cdot\cos\text{B} = \dfrac{1}{2}[ \cos(A+B)+\cos(A-B)] $$ but I couldn't find the product. Any help will be appreciated. Thanks.


I am trying to remove all (including new lines) content with sed that comes after the following text in a file (/etc/sudoers):  #includedir /etc/sudoers.d

grep --before-context 5 shows 5 lines before the match.  I want to show everything before the match. Doing grep --before-context 99999999 would work but it is not very... professional.  How to show all the file up to the match?


If $f_n\to f$ in measure, is there a subsequence s.t. $f_{n_k}\to f$ a.e. ? The convergence in measure is a little be abstract to me, I don't really see what it means (even if I know the definition). So I have difficulties to answer this question.

How can I prove that if a sequence of functions $\{f_n\}$ that converges to $f$ in measure on a space of finite measure, then there exists a subsequence of $\{f_n\}$ that converges to $f$ almost everywhere?


In a memory of Dumbledore's, Tom Riddle asks Slughorn about Horcruxes. He says that he wants to split his soul into seven pieces. But Harry is the seventh and unintended one. So aren't there 8 Horcruxes in total, considering that Voldemort already split his soul into 7 pieces? Or have I made a mistake while counting?

Since the magical number is seven for Horcruxes, and Voldemort made Harry unintentionally then  there must be an eighth right...???   Diary Ring Cup Locket Diadem Nagini Harry (Does not count because Voldemort did not know that Harry was a Horcrux) ??????


#open file and rewrite (comma) to , with open('outputFile') as fo:     fo.write(line.replace("(comma)"," , "))   I'm trying to replace the text (comma) with a literal , within a file. When I run the above code, I get the following error: io.UnsupportedOperation: not writable   Any insight as to how to rewrite text within a file would be greatly appreciated.   I've used the below code, and it still won't replace (comma) with ,  #open file and rewrite (comma) to , with open('outputFile.txt', "a+") as fo:     fo.write(fo.replace('(comma)',',')) fo.close()

I want to loop over the contents of a text file and do a search and replace on some lines and write the result back to the file. I could first load the whole file in memory and then write it back, but that probably is not the best way to do it.  What is the best way to do this, within the following code?  f = open(file) for line in f:     if line.contains('foo'):         newline = line.replace('foo', 'bar')         # how to write this newline back to the file


What is the value for $\lim \limits _{x\to\infty} \frac{\sin x} x$?   I solved it by expanding $\sin x$ as  $$\sin x = x - \frac {x^3} {3!} \dotsc$$  So $\lim \limits _{x\to\infty} \frac {\sin x} x = 1 -\infty = - \infty$,  but the answer is $0$. Why? What I am doing wrong?

I've just started learning about limits. Why can we say $$ \lim_{x\rightarrow \infty} \frac{\sin x}{x} = 0 $$ even though $\lim_{x\rightarrow \infty} \sin x$ does not exist?   It seems like the fact that sin is bounded could cause this, but I'd like to see it algebraically.   $$ \lim_{x\rightarrow \infty} \frac{\sin x}{x} =  \frac{\lim_{x\rightarrow \infty} \sin x} {\lim_{x\rightarrow \infty} x}   = ? $$  L'Hopital's rule gives a fraction whose numerator doesn't converge. What is a simple way to proceed here?


I've tried using chmod to modify permissions but I keep getting back "chmod: Unable to change file mode on Notes.app: Operation not permitted"  Anyone have any ideas?   Excluding it from Alfred search would also be a solution! I don't want to allow myself to use Notes.

I want to delete the pre-installed apps, like Music, Books, Siri etc. from my iMac running Catalina. How do I do this?  (NOTE:  asks the same thing but was closed as a duplicate of . Annoyingly, the supposed duplicate doesn’t give an obvious answer to the question, and the original was locked can’t be answered, hence a new question. I can’t add an answer to  either)


I tired to increase the swap area by from  Keep saying no space left on the device. Then I used gparted to swapon and I get the previous swap.  I don't want to resize the swap, just fix the error and free the root. It was 35% used before I try to change the size of swap.  Now the root is full. and tab completion give the followng error.  bash: cannot create temp file for here-document: No space left on device         -bash: cannot create temp file for here-document: No space left on device   what is the solution?   df -h Filesystem      Size  Used Avail Use% Mounted on udev             32G     0   32G   0% /dev tmpfs           6.3G  2.1M  6.3G   1% /run /dev/sda1        55G   55G     0 100% / tmpfs            32G     0   32G   0% /dev/shm tmpfs           5.0M  4.0K  5.0M   1% /run/lock tmpfs            32G     0   32G   0% /sys/fs/cgroup /dev/loop0       43M   43M     0 100% /snap/gtk-common-themes/1313 /dev/loop1       90M   90M     0 100% /snap/core/7917 /dev/loop2      3.8M  3.8M     0 100% /snap/gnome-system-monitor/100 /dev/loop3       45M   45M     0 100% /snap/gtk-common-themes/1353 /dev/loop4      141M  141M     0 100% /snap/gnome-3-26-1604/97 /dev/loop5       15M   15M     0 100% /snap/gnome-characters/359 /dev/loop6       90M   90M     0 100% /snap/core/8039 /dev/sdb1       1.8T  118G  1.6T   7% /hdd1 /dev/sdc1       1.8T   57G  1.7T   4% /hdd2 /dev/loop7      1.0M  1.0M     0 100% /snap/gnome-logs/81 /dev/loop8       15M   15M     0 100% /snap/gnome-characters/317 /dev/loop10     141M  141M     0 100% /snap/gnome-3-26-1604/94 /dev/loop9       55M   55M     0 100% /snap/core18/1265 /dev/loop11     157M  157M     0 100% /snap/gnome-3-28-1804/91 /dev/sda3       803G  402G  360G  53% /home /dev/loop12     3.8M  3.8M     0 100% /snap/gnome-system-monitor/107 /dev/loop13      55M   55M     0 100% /snap/core18/1223 /dev/loop14     1.0M  1.0M     0 100% /snap/gnome-logs/73 /dev/loop15     4.3M  4.3M     0 100% /snap/gnome-calculator/536 /dev/loop16     4.3M  4.3M     0 100% /snap/gnome-calculator/544 /dev/loop17     150M  150M     0 100% /snap/gnome-3-28-1804/71 tmpfs           6.3G     0  6.3G   0% /run/user/1001

I'm using Ubuntu 11.04 and I want to free up some space in my root directory, which is overloaded. I especially want to change the path used for installing applications (they are getting installed directly to the root drive).  Another consideration is that I'm working on a MySQL database server. The server is installed in the root directory itself, so I don't want to  risk losing any data.  Please give me some tips to help sort out this problem.


I am calling a fragment class from my activity class through intent but it is throwing exception      boolean java.lang.String on a null object reference   Here is my code :      @Override     protected void onPostExecute(String result) {           if (result.equals("JobCancelled")) {              fragment = new MyOrdersFragment();              getSupportFragmentManager().beginTransaction()                      .replace(R.id.frame, fragment, fragment.getClass().getSimpleName()).addToBackStack(null).commit();           }              pdilog.dismiss();         super.onPostExecute(result);

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


I have been using chat quite a lot recently and when posting some code blocks I sometimes get them wrong and it has gone past the threshold  to edit it and I try to delete it but all I can do is flag it for a moderator.  This in my opinion is very counter productive and annoying for the moderators, I think the users should be able to delete their own messages in chat regardless of age.  I don't see any drawbacks of this implementation if it were to be implemented?  Thanks!

What is the reasoning behind not allowing one to delete his own chat message after 2 minutes? The timeout to edit messages is good enough, I think.  I don't see many cases where losing some old messages would be problematic (restricting the number old messages that can be deleted in a certain timeframe should be more than enough). (Credit goes to ).


Sorry if this is an incredibly stupid question, but I'm new to Linux on a whole & I'm trying hard to get into the flow with it. I recently installed LXDE which as you know is a DE, but I can't find any info on the net on how to activate it. Could anyone please help me?  Thanks in advance guys.

I want to install lubuntu on my current (pre-existing) Ubuntu Install because of it's light-weight footprint.   Can I preserve currently installed apps after installation?


The .py files are associated to SublimeText on my Windows 7. Thus, when hitting ENTER when the cursor/selection is on a .py file in the Explorer, SublimeText opens it. I want to keep this.  How to make that CTRL+ENTER (or another short shortcut like WIN+ENTER, but no contextual menu) can start the .py file with C:\Python27\python.exe <filename.py>?  Note: if not possible with Explorer, I'm open to use AutoHotKey.

I have Windows 10. If I have highlighted a file and press "Enter", the file will be opened using the default program that I have chosen to open it.  I would like to be able to choose an alternative program to open these files if I press a different set of hotkeys, e.g., "Ctrl-Enter" or something.  For example, with my current setup, .txt files open with Notepad by default (i.e., if I press "Enter"), .html files open with Google Chrome by default, and .png files open with Windows Photo Viewer by default. I would like to be able to open .txt files and .html files with Notepad++, and to open .png files with Paint, if I highlight them and press something like "Ctrl-Enter".  Of course, I can already right-click and scroll to whatever program I want to open the files with, but since I do this very frequently, I want a faster, hot-key based approach.  Does anyone know of a way to set this up, either by something built into Windows or by some hack or other?  Thanks for any help.


What are Ghostable and Unghostable Pages? Is there a listof pages which are Ghostable and Unghostable? How would I know whether a page is Ghostable or unghostable? If we just add a document to a Ghostable Page, will it be called as Unghostable?

We are trying to resolve some performance issues at a remote site.  One thing that we suspect could be causing the performance problem is page ghosting.  Is there some way to see if the pages that are being called are ghosted?


I have made a very simple, basic ball animation with Blender, and was just going to render it (in Cycles). I want to render each frame as an image, so I set it to PNG. But when I render it, after about 5 seconds, it renders a bunch of black images. The render result does not even appear in the UV image Editor. Here is what it looks like when I hit the Render Animation button-   I am trying to render it with 128 samples, 32 preview. Here are my Render settings-  Here is the project file:  I am using Blender 2.79. Can anyone help me and tell me why my animation is not rendering?

A scene I made is not rendering, at all. This grey screen stays the same and nothing changes.  Here are my settings:  [


Essentially after performing regression on three variables, $$ y = a_0 + a_1 \cdot x_1 + a_2 \cdot x_2 + a_3 \cdot x_3 $$ I want to find variance for $a_1+a_2$ to get CI. Logically, I think I can do $$\text{Var}(a_1+a_2)=\text{Var}(a_1)+\text{Var}(a_2)+\text{Cov}(a_1,a_2)$$ and calculate covariance of two normals because from the model results I'd know mean and variance of $a_1$ and $a_2$, and they are asymptotically normally distributed.  I'm stuck at how to get covariance of two normal RV. Any guidance? Is there a simple code to calculate this in python or R?

In logistic regression with an intercept term and with at least one dependent variable which is categorical, is there a closed form for the variance of the sum of the intercept and the coefficient of the categorical variable, or do you have to sample from a multivariate distribution with the means and variances of the intercept and the coefficient to get a reliable measure of the variance of this sum?  $P(y) = \frac{exp(y)}{1 + exp(y)}$  $y = \beta_{0} + \beta_{1}x + \epsilon$  where x is categorical.  Would the formula for the variance of a sum (of two random variables) be applicable here?  $Var(\beta_{0} + \beta_{1}) = Var(\beta_{0}) + Var(\beta_{1}) + 2Cov(\beta_{0}, \beta_{1})$  The reason I ask, is that in  I got the impression that no closed form existed for the variance in question, and the advice was to sample from a multivariate distribution with the means and variances of $\beta_{0}$ and $\beta_{1}$  set.seed(1) dependent.var <- sample(c(TRUE, FALSE), 100, replace = TRUE, prob = c(0.3, 0.7)) independent.var <- ifelse(dependent.var, sample(c("Red", "Blue"), replace = TRUE,   size = 10, prob = c(0.8, 0.2)), sample(c("Red", "Blue"), size = 10,   replace = TRUE, prob = c(0.4, 0.6))) table(dependent.var, independent.var) ##               independent.var ## dependent.var Blue Red ##         FALSE   42  26 ##         TRUE     7  25 my.fit <- glm(dependent.var ~ 1 + independent.var, family = binomial(logit)) coef(summary(my.fit))                     Estimate Std. Error   z value     Pr(>|z|) (Intercept)        -1.791759  0.4082482 -4.388897 0.0000113927 independent.varRed  1.752539  0.4951042  3.539737 0.0004005255 > vcov(my.fit)                    (Intercept) independent.varRed (Intercept)          0.1666666         -0.1666666 independent.varRed  -0.1666666          0.2451282   The logit of TRUE for a "Red" case is $ \beta_{0}+\beta_{1} \approx -0.039$. Is the variance for this estimate exactly  vcov(my.fit)[1,1] + vcov(my.fit)[2,2] + 2 * vcov(my.fit)[1,2] [1] 0.07846154 ?   Or is this only an approximation, and a more accurate measure is to be found by sampling, e.g.  library(MASS) var(rowSums(mvrnorm(n = 1E7, mu = coef(my.fit), Sigma = vcov(my.fit)))) [1] 0.07842985 ?   In this simple example, the sampling method does not seem to provide more accurate estimates of the variance (using 1E7 samples).   it is stated that "There is a correspondance between the covariance matrix of the fit parameters and Δχ2 confidence regions only for the case of Gaussian uncertainties on the input measurements.". Is that a reason against relying on the closed form above, or is there perhaps another reason for the advice to sample instead of deriving the variance analytically in cases like this?  EDIT: (In response to the answer given by StasK). The advice I originally got was to simulate from the full model, not from the vcov(), so here is the code to simulate from the full model:  library(arm) sim.i <- sim(my.fit, 100000) logit.for.TRUE.red <- sim.i@coef[,1] + sim.i@coef[,2] var(logit.for.TRUE.red) [1] 0.07781206


I understand that the alternating group is a group of all even permutations of a finite set. I'm not sure how to show that this can be generated by the set of 3-cycles though. The hint says to write it out as a composition of an even number of 2-cycles. Also in general I am a bit confused what is meant by generated does this just mean that any member of the alternating group can be written as some composition of 3-cycles.  Any help would be appreciated.

Prove that, for $n \geq 3$, the three-cycles generate the alternation group $A_n$   Proof:  We multiply on the left by 3-cycles to "reduce" an even permutation $p$ to the identity, using induction on the number of indices fixed by a permutation. How the indices are numbered is irrelevant. If $p$ contains a $k$-cycle with $k \geq 3$, we may assume that it has the form $p=(123\dots k)\dots$ Multiplying on the left by $(321)$ gives $$p'= (321)(123 \dots k)\dots=(1)(2)(3\dots k)\dots$$ More fixed indices.   What do you think ?


Is there a way, when doing screen recording (for online gameplay, for example), to disable all notifications in one step, so that it won't interfere with the screen recording?  Details: It can be done by turning off all notifications for 35 apps one by one, and when done with screen recording, turn them on one by one again -- but it will be 70 steps total this way.  I want to disable any notification at all, including the one that slide down showing "no preview" content -- I want to disable those as well -- everything.

I use my iPad a lot as I teach, showing the students slides, videos, etc.  Having a words with friends, draw something, or email notification, especially with personal content in the first line, show up is always distracting.  I see that I can change notification settings per-app, but don't see  a way to disable all notifications system wide. Disabling apps individually works, but requires a bit of effort and time, and isn't something that can be done mid-lesson.  Is there a way to disable all notifications from appearing while you are actively using the device (e.g. while having your device mirrored on a screen during a lesson, presentation, demonstration, etc.), then re-enable all previously allowed notifications without fiddling with each one individually?


Reading is possible, but WRITING? older version(ext2/3) is possible, but ext4? i don't have idea!

I want to use ext4 on my external HDD, but it must be cross-platform. (At least Linux, Win7 & WinXP).  Unfortunately, I haven't found any proper driver allowing Windows to WRITE to ext4. I've found , but it only reads ext4.     9. ext4 extent read-only, no  size truncating and expanding support   More:     Supported Ext3/4 features:         flexible inode size: > 128 bytes, up to block size   dir_index:    htree directory index   filetype:     extra file mode in dentry   large_file:   > 4G files supported   sparse_super: super block backup in group descriptor   uninit_bg:    fast fsck and group checksum   extent:       reading, writing with no extending.   journal:      only support replay for internal journal         Unsupported Ext3/4 features:         journal: log-based operations, external journal   extent: size truncating & expanding, file deletion   flex_bg: first metadata group   EA (extended attributes), ACL support      Also, I have found a patch for Ext4Fsd v0.50 ():     New: Matt Wu has made a new release 0.50 at   ext2fsd.com.  Support for ext4 extents and fix   for BSOD on Windows 7.   I don't think it will be safe. Also I've read some words about writing ext4 in Windows could cause data loss on the disk...  What is the External HDD used for? - First, it will store backups, then family movies, pictures. Some music, and etc. It will be connected to a Raspberry Pi, if I finally receive it. It won't really move, just when it is used to migrate computer's data to a new one. The largest files it will store are Clonezilla disk images (I don't know, if they will be large files or not).  Can someone provide a solution for this problem? Or is there NO important enough difference between ext4 and ext3, and I should use ext3? - (If yes, then can I use Ext2Fsd for that ext3 mount?)  Thank you!


I am quite new in Ubuntu. I wanted to install a .msi file (SkypeMeetingsApp.msi)and read that you can do this using Wine, so I've installed it. I have put the file on the Desktop, opened the terminal and have written  cd Desktop   Then :  msiexec /i SkypeMeetingsApp.msi   But it says:  0009:err:mscoree:LoadLibraryShim error reading registry key for installroot 0009:err:mscoree:LoadLibraryShim error reading registry key for installroot 0009:err:mscoree:LoadLibraryShim error reading registry key for installroot 0009:err:mscoree:LoadLibraryShim error reading registry key for installroot   What can I do? it says the same thing with this command :  wine start SkypeMeetingsApp.msi

I'm trying to use Skype on Ubuntu. I tried installing it in Wine. Installing it went fine, but when I try to login, it gives me error code 1814; resource name not found. What can I do to fix this?


I'm travelling to the US on business in a month or two. I'd like to bring some British chocolate as a gift for the people I'll be meeting.  As I understand it, pre-packaged, commercially-produced chocolate should be fine to bring in, provided I declare it on the CBP form.  My question is simply how much of a delay, if any, should I expect from doing this? Is it a simple case of showing the agent the food, or is it likely that I'd be sent for further inspection? I'm travelling with a colleague, so if it's likely I'd be held up for a while, I probably won't bring food at all.

It is being customary we bring a few authentic Russian chocolate bars/sweets to the US but we are always struggling whether we should check that "food" checkbox in the "Customs Declaration" form?  It is under the following entry in the form (yeah, together with insects, right):     I am (We are) bringing:      fruits, vegetables, plants, seeds, food, insects   I've been always checking it but that just gets us into more lines and triggers extra questions after getting to the baggage check.


For the following:  list=[[2, 3, 5], [7, 8, 9]]   Why does [list[0][0], list[1][0]] represent the first row ([2, 7]), but the command list[:][0] or list[0:2][0] returns the first column ([2, 3, 5])?  The way I see it list[:][0] should get all the possible values for the first parameter (that is 0 and 1) and 0 for the second, meaning it would return the first row. Instead what it does is return the first column and I can't understand why.

I need a good explanation (references are a plus) on Python's slice notation.   To me, this notation needs a bit of picking up.   It looks extremely powerful, but I haven't quite got my head around it.


Hi i got a preowned raleigh activator 2 with front suspension and rear tube dampening system but the front and back suspensions dont seem as bouncy as i thought is there a way to get them to do their job properly.i am 10stone in weight and height 5,10 if its to do with the weight.

I recently bought a Carreras centos limited edition mountain bike. I want to find out how to make my suspension bouncier and I want to experience a MUCH more comfortable ride. I have tried fiddling around with the knobs that say preload on them but it isn't making the ride any different. I am quite small and I don't know whether that is affecting the suspensions bounciness. Please help.


i have a problem with my code, this is error     java.lang.NullPointerException: Attempt to invoke virtual method   'void android.widget.ImageView.setImageResource(int)' on a null object   reference   there is no error in code, but when run there is a null exception error, I don't know where is null, this is error     at   com.mulazi.submission2.MovieListAdapter.onBindViewHolder(MovieListAdapter.java:57)            at com.mulazi.submission2.MovieListAdapter.onBindViewHolder(MovieListAdapter.java:20)   this is my code   package com.mulazi.submission2;  import android.content.Intent; import android.provider.ContactsContract; import android.support.annotation.NonNull; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.TextView;  import com.mulazi.submission2.R; import com.mulazi.submission2.DetailActivity; import com.mulazi.submission2.Movie;  import java.util.ArrayList; import java.util.List;  public class MovieListAdapter extends RecyclerView.Adapter<MovieListAdapter.MovieViewHolder>  {     private List<Movie> movieList;      public MovieListAdapter() {         movieList = new ArrayList<>();     }      private void add(Movie item) {         movieList.add(item);         notifyItemInserted(movieList.size() - 1);     }      public void addAll(List<Movie> movieList) {         for (Movie movie : movieList) {             add(movie);         }     }      @NonNull     @Override     public MovieViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {         View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_item_movie, parent, false);         return new MovieViewHolder(view);     }      @Override     public void onBindViewHolder(@NonNull final MovieViewHolder holder,final int position) {         final Movie movie = movieList.get(position);         holder.itemView.setOnClickListener(new View.OnClickListener() {             @Override             public void onClick(View view) {                 Intent intent = new Intent(holder.itemView.getContext(), DetailActivity.class);                 intent.putExtra("key", movie);                 holder.itemView.getContext().startActivity(intent);             }         });          holder.moviePhoto.setImageResource(movie.getPhoto());         holder.movieName.setText(movie.getName());         holder.movieDate.setText(movie.getDate());         holder.movieDesc.setText(movie.getDescription());         holder.movieDuration.setText(movie.getDuration());         holder.movieDirector.setText(movie.getDirector());         holder.movieGenre.setText(movie.getGenre());     }      @Override     public int getItemCount() {         return movieList.size();     }      static class MovieViewHolder extends RecyclerView.ViewHolder {         ImageView moviePhoto;         TextView movieName;         TextView movieDesc;         TextView movieDate;         TextView movieDuration;         TextView movieDirector;         TextView movieGenre;          MovieViewHolder(@NonNull View itemView) {             super(itemView);              moviePhoto = itemView.findViewById(R.id.img_photo);             movieName = itemView.findViewById(R.id.txt_name);             movieDesc = itemView.findViewById(R.id.txt_description);             movieDate = itemView.findViewById(R.id.txt_date);             movieDirector = itemView.findViewById(R.id.txt_director);             movieDuration = itemView.findViewById(R.id.txt_duration);             movieGenre = itemView.findViewById(R.id.txt_genre);         }     } }   I hope anyone helps me resolve this error,

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


I know the term kite from WoW, there it means letting the enemey move around and prevent it from dealing damage.  Yesterday, someone in LoL said: "omfg udyr kite freakin ezreal!"  I dont get this, I mean you cant kite a  range based damage dealer and anyway, its another online player not an NPC so Id like to know what kite means in LoL?

What does the term 'kiting' mean when used for games? I've seen the term thrown around here and there in reference to a few different games. Are there specific types of games that it applies to?


this question is simple, I was looking for a good derivation to  $$\int \vec g.d\vec A=-4\pi GM $$ but was unable to find a good enough one online. Hence may I know its derivation?

On a similar note: when using Gauss' Law, do you even begin with Coulomb's law, or does one take it as given that flux is the surface integral of the Electric field in the direction of the normal to the surface at a point?


I seem to be due a tag badge on  tag for a long time now, more than a few weeks I think, but I've yet to receive it. I'm the first one that made the cut there.    Yes, I did retagged many of the posts now in the tag, but not all of them were with my answers, and all of them were valid edits IMHO.  says it's OK and "improves the site" as long as "edit is accurate". Naturally it was easier for me to find such posts among my answers, but I did manage to find a few others and tagged them as well.  Is this a bug?

Formerly List of all badges with full descriptions.  What are badge name's requirements? Why didn't I get badge name ? Which badges can I earn multiple times?    Jump to:                    Note: Some badges are awarded based on score. The term score means the total number of upvotes minus the total number of downvotes.  Any badge with a *** next to it is one of 20 badges that count towards the  displayed on a moderator candidate in an election. The candidate score is a total of 40 points: the first 20 are awarded based on the user's rep divided by 1000 and rounded down; the second 20 represents the total number of unique badges earned of the 20 that count. Note that if the same badge is earned multiple times, it will only count once towards the candidate score.  Any badge with a "(retired)" next to it is no longer awarded, but is retained by users who previously earned them. See  for more info on what it means for a badge to be retired.       Visit the  of the  on any site to see a complete list of badges that you can filter by earned, unearned, or type.


I am new for java. As a first step, I made a simple calculator in NetBeans.   I wanted to make it an executable software and to run it just by double clicking it as on visual basic.   Please tell me if you know a method to do that.

If I have a Java source file (*.java) or a class file (*.class), how can I convert it to a .exe file?  I also need an installer for my program.


i have a Field of data type Phone. after querying from SOQL i am getting its value as (*) *-**** in apex. How can i extract text value from it excluding hypen and (). I am looking for generic Phone to text type conversion.

Im a newbie in Apex and im developing a page using Visualforce.  My string format is always like this "xx-xx-999999". In this format I need to get only the integer. For example the string is  "RO-W1-445567". I want to get only the integer 445567 in the string. Can someone willing to share a piece of apex code in my problem.  Your help is vey much appreciated.  Thanks in advance!  Ferdie Banu


I modeled the city scape. I pressed something and all I can see now is half of the model.

Ok so In blender, I'm making a city, but in the 3d view, it disappears when going to a certain distance:  I'm not using a camera or anything, this is user perspective Help?


I want to generate a random number in Java. It can be of integer, byte or float type, but all I really need it is to generate a random number. This is what I'm doing:   Generate a random number within a certain range (e.g. 5 through 20). Take the number and store it within a variable. Perform arithmetic on it.   Here's the code:  import java.util.HashMap;  public class Attack {     public static void main(String[] args) {         HashMap<String, Integer> attacks = new HashMap<String, Integer>();         attacks.put("Punch", 1);         attacks.put("Uppercut", 3);         attacks.put("Roundhouse Kick", 5);          int actionPoints = // Code for random number generation          System.out.println("A brigade integrant appeared!");         System.out.println("What do you do?");         System.out.println("1: Punch [1 AP], 2: Uppercut [3 AP], 3: Roundhouse Kick [5 AP]");         System.out.println("You have " + actionPoints + " Action Points.");         Scanner reader = new Scanner(System.in);         System.out.println("Enter a number: ");         int n = reader.nextInt();         reader.close();          if n == 1 {             System.out.println("The brigade integrant takes 2 HP of damage!");         }         else if n == 2 {             System.out.println("The brigade integrant takes 5 HP of damage!");         }         else if n == 3 {             System.out.println("The brigade integrant takes 8 HP of damage!");         }     } }

How do I generate a random int value in a specific range? I have tried the following, but those do not work: Attempt 1: randomNum = minimum + (int)(Math.random() * maximum);  Bug: randomNum can be bigger than maximum. Attempt 2: Random rn = new Random(); int n = maximum - minimum + 1; int i = rn.nextInt() % n; randomNum =  minimum + i;  Bug: randomNum can be smaller than minimum.


Environment:   Wifi network rtl8723be Ubuntu 14.04 x64 Kernel 3.16.0-50-generic   PROBLEM: wifi network disconnects after a while of being working properly.  $ sudo lshw -short /0/100/1c.1/0   wlan0        network        RTL8723BE PCIe Wireless Network Adapter   Any ideas?

I have installed Ubuntu 15.04 on my laptop with RTL8723BE Wi-fi card. But it is always disconnecting from network. I have tried echo "options rtl8723be fwlps=N ips=N" | sudo tee /etc/modprobe.d/rtl8723be.conf but that didn't helped. What can I do to prevent the wifi from disconnecting? If I upgrade to kernel 4.X, will it help?  ~$ lspci -knn | grep Net -A2  09:00.0 Network controller [0280]: Realtek Semiconductor Co., Ltd. RTL8723BE PCIe Wireless Network Adapter [10ec:b723]     Subsystem: Hewlett-Packard Company Device [103c:2231]     Kernel driver in use: rtl8723be   ~$ rfkill list 0: hci0: Bluetooth     Soft blocked: yes     Hard blocked: no 1: phy0: Wireless LAN     Soft blocked: no     Hard blocked: no   ~$ ifconfig && iwconfig && route -n && ping -c 1 google.com eth0      Link encap:Ethernet  HWaddr 38:63:bb:cd:4a:7e             UP BROADCAST MULTICAST  MTU:1500  Metric:1           RX packets:3 errors:0 dropped:0 overruns:0 frame:0           TX packets:53 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:1000            RX bytes:752 (752.0 B)  TX bytes:8445 (8.4 KB)  lo        Link encap:Local Loopback             inet addr:127.0.0.1  Mask:255.0.0.0           inet6 addr: ::1/128 Scope:Host           UP LOOPBACK RUNNING  MTU:65536  Metric:1           RX packets:3870 errors:0 dropped:0 overruns:0 frame:0           TX packets:3870 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:0            RX bytes:314613 (314.6 KB)  TX bytes:314613 (314.6 KB)  wlan0     Link encap:Ethernet  HWaddr c0:38:96:6d:c4:83             inet addr:192.168.1.205  Bcast:192.168.1.255  Mask:255.255.255.0           inet6 addr: fe80::c238:96ff:fe6d:c483/64 Scope:Link           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1           RX packets:15240 errors:0 dropped:0 overruns:0 frame:0           TX packets:14627 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:1000            RX bytes:14410285 (14.4 MB)  TX bytes:2192744 (2.1 MB)  eth0      no wireless extensions.  wlan0     IEEE 802.11bgn  ESSID:"DIR-615"             Mode:Managed  Frequency:2.437 GHz  Access Point: 00:90:4C:08:00:0D              Bit Rate=150 Mb/s   Tx-Power=20 dBm              Retry short limit:7   RTS thr=2347 B   Fragment thr:off           Power Management:off           Link Quality=70/70  Signal level=-22 dBm             Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0           Tx excessive retries:0  Invalid misc:186   Missed beacon:0  lo        no wireless extensions.  Kernel IP routing table Destination     Gateway         Genmask         Flags Metric Ref    Use Iface 0.0.0.0         192.168.1.1     0.0.0.0         UG    400    0        0 wlan0 169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 wlan0 192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 wlan0 PING google.com.Dlink (172.26.136.19) 56(84) bytes of data. 64 bytes from 19.136.26.172.in-addr.arpa (172.26.136.19): icmp_seq=1 ttl=249 time=102 ms  --- google.com.Dlink ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 102.547/102.547/102.547/0.000 ms


Horcruxes preserve the soul. Does their use affect the natural breakdown process of the human body's aging? Or is it completely spiritual, in the sense, regarding the soul?    Are there any references to Voldemort or any other horcrux user, canon or non-canon, using magic to keep their physical body from decomposing naturally? (Like, degenarative brain disease. Do horcruxes prevent that?)   This question is more along the lines of whether Voldy did any magic to maintain his body. The use of a horcrux is to store the soul. The only physical effect it seems to have had is that it twisted the features.

Voldemort has gained "immortality" via his horcruxes, but was his body immortal to age? Looking at all the questions about Voldemort and his horcruxes what was his plan to keep his body alive. We know his first Horcux was created at age 16, yet we see him age still so it seems like eventually his body would die of old age and his soul would be left in the half dead state he was in after his spell rebounded off Harry. What was his plan here, why would he not want something such as the elixir of life to keep his vitality?     While the Elixir of Life does indeed extend life, it must be drunk regularly, for all eternity, if the drinker is to maintain his immortality. Therefore, Voldemort would be entirely dependent on the Elixir, and if it ran out, or was contaminated, or if the Stone was stolen, he would die just like any other man. Thereafter, I am convinced, he intended to continue to rely on his Horcruxes: he would need nothing more, if only he could regain a human form. He was already immortal, you see ... or as close to immortal as any man can be.' (Albus Dumbledore)   Horcruxes seem to fail at something important, keeping you alive, they stop you from dying truly yes, but they don't keep you alive. Harry is shown over and over again to be able to beat better wizards because hes has faster reflexes both because of youth and his genetics, but presumably by 50 harry will not be as fast as his 16 year old self even considering their longer life expectancy. Why operate in a body of a 50 year old?