import time stop_time = time.time() + 5 #5 seconds while time.time() < stop_time:     for i in range(1000000):         print(i)         for x in range(654165):             print(x)   How to stop this loop after 5 seconds?

Given the following code (that doesn't work):  while True:     #snip: print out current state     while True:         ok = get_input("Is this ok? (y/n)")         if ok.lower() == "y": break 2 #this doesn't work :(         if ok.lower() == "n": break     #do more processing with menus and stuff   Is there a way to make this work? Or do I have do one check to break out of the input loop, then another, more limited, check in the outside loop to break out all together if the user is satisfied?


I'm new to GIS.   I have a raster that specifies the geographical distribution of temperature. I would like to find the temperature that is closest to a particular set of coordinates. How do a find the raster value nearest to [x, y]?  I'm using ArcGIS Desktop.  I have numerous points specified by longitude and latitude in a table that was imported using Add X-Y Data... from an Excel spreadsheet. These points plot in the correct places on my map. Nevertheless, the points do not necessarily coincide with data in the raster, so when I do an Extract Values to Points I get some -9999 values. Instead, I'd like to know the value of the nearest point where there is data. The output format doesn't really matter, but a column appended to the original table would be ideal. As far as extensions go, I think I have them all, but I can't say for certain.

I have two layers in ArcGIS: One is a vector point and the other is a raster layer. I want to append the value of the raster data grid to the vector point. The problem is the vector point is away from any existing raster grids with value, so the command "Sample" return no value for those vector point.    So my question is: How can I find the nearest raster cell given a vector point and extract the value from the cell?   Actually there are two things I need to do:   Identify the outliner within a ranger (Usually 1-2 cells away from my existing raster) Assign a value from the nearest raster to them, if they are in a range     Edited: I have about 3000 vector points and my problem is this:   I need to append the raster value based on locations to the vector points. I used the tool "Sample" and it works well for most of the points.  However, there is a situation like this   The right point can get the value from the raster ("Sample" works) but the left point cannot due to the alignment issues.  Raster to polygon is not working because I get error message that I cannot turn them into vector because they are out of the domain. Also I have points like this  Those upper points should not get any values because they are too far away from the raster.  I thought of someways to work around:    Step 1. Do the "sample" first    Step 2. Select the null value after the "sample" operations  Step 3. construct buffer zones (within 1 decimal degree) based on the null points    Step 4. use zonal statistics??? or other tools to loop through all the raster cells in the buffer, find the nearest one, extract its value and put it in the vector point.    I am stucked at step 4. I don't know which tool in ArcSDK I can use to achieve this function.   Or else...Do you have better idea to deal with that?    I have 20 raster layers like this and I would like to make it automatically (using model builder and arcobject).


I'm new to Linux. I have been practicing a few commands. My question is about when I'm creating different files using a different umask. For example:  umask 222, as I understand it, is the same as 777 - 222 = 555, so when I create a new file (call it "newfile"), then newfile's permissions should be r-xr-x-r-x (or am I wrong?)  Whatever: "newfile" was created with r--r--r-- permissions.  My umask value in /etc/profile is:    if [ $UID -gt 199 ] && [ "`id -gn`" = "`id -un`" ]; then     umask 002 else     umask 022 fi   My uid is 1002.  Note: Just for the record, I've already read all the umask questions and documentation from man and I can't understand it yet.

When I use setfacl to manage on what permissions should the children files / directories have, for some reason the files have all the permissions except the execute ("x") one.  someuser@someuser-MS-7816:/opt/lampp/htdocs/project$ getfacl . # file: . # owner: someuser # group: webs # flags: -s- user::rwx group::rwx other::rwx default:user::rwx default:group::rwx default:other::rwx  someuser@someuser-MS-7816:/opt/lampp/htdocs/project$ touch file someuser@someuser-MS-7816:/opt/lampp/htdocs/project$ mkdir dir someuser@someuser-MS-7816:/opt/lampp/htdocs/project$ ls -l total 4 drwxrwsrwx+ 2 someuser webs 4096 paź 31 13:35 dir -rw-rw-rw-  1 someuser webs    0 paź 31 13:35 file   I thought it has something to do with umask but changing it in various ways never gives the expected result unless I'm missing something.  How can this be fixed?


I'm on Xubuntu 14.04. 64 bit. . I had kinda  on 13.10, it hunts me on 14.04 and upgrading doesn't seem to work.   When I click right click, if go over (even by mistake) to create new document, the computer freezes for a while    I think I know why, it tries to search for previously edited files    How to disable that feature forever? By the way I uninstalled the default editor, abiword I think. I disabled everything here, didn't solve it    I just want to disable the right click menu from searching to previously edited files. I don't want that feature.

For as long as I can remember, every time I install Ubuntu there is a folder in the home directory called "Templates." I've always just deleted it, but I'm curious: what's it supposed to be used for, and why is it in the default install?


I am looking for a good commutative algebra book. If you can recommend me something, that would be great. I've heard about Algebra by Serge Lang, Abstract Algebra by Dummit and Foote(?), and Commutative Algebra with a View Towards Algebraic Geometry by Eisenbud. These are my options, and I need an opinion on this. Thanks in advance!

My goal is to pick up some commutative algebra, ultimately in order to be able to understand algebraic geometry texts like Hartshorne's. Three popular texts are Atiyah-Macdonald, Matsumura (Commutative Ring Theory), and Eisenbud. There are also other books by Reid, Kemper, Sharp, etc. Can someone outline the differences between these texts, their relative strengths, and their intended audiences?   I am not listing my own background and strengths, on purpose, (a) so that the answers may be helpful to others, and (b) I might be wrong about myself, and I want to hear more general opinions than what might suite my narrow profile (e.g. If I said "I only like short books", then I might preclude useful answers about Eisenbud, etc.).


I want to submit a paper to a SIAM journal. Before submitting it I want to put the paper on arXiv. I've written the paper using SIAM's Latex template files. Is it ok to upload the current version of the paper to arXiv as it is or do I need to remove the templating or modify the paper in some way?

I recently sent a paper to a journal (which I put on arXiv beforehand) which has now been accepted with some corrections. I want to put the corrected version on arXiv. The corrected version is written using the style file supplied by the journal.  Should I remove this style file? Does it matter if I don't? Will the journal get mad?


Variable br must consist only of bool values. Which have been gotten by looping through the first array.  state ={     nonRelated: this.props.non_related.value,     1:true,     2:true,     3:false,     4:false,     5:true,    //  etc. }  let ar = [1,2,3,4,5,6,....20]; let br = ar.map(el => { return state.el })   Another example:   I need to filter the array, if the key in the iteratee (which is an object) in the state has the value "true".

Which is the right thing to do?  if (myObj['key'] == undefined)   or  if (myObj['key'] == null)   or  if (myObj['key'])


I'm thinking of developing a bot like system which will be able to answer questions posted by users, such as      How will be my future?      Will I find a girlfriend tomorrow?   These are general questions which my system users will post and based on the subject matter there will be a random answer from my back-end. Kind of a psychic service thing.  I know this is a very vast subject to expect a complete answer here, but it would be great if you guys can direct me in the right direction.  Thanks in advance!

I want to build a bot that asks someone a few simple questions and branches based on the answer.  I realize parsing meaning from the human responses will be challenging, but how do you setup the program to deal with the "state" of the conversation?  It will be a one-to-one conversation between a human and the bot.


I am trying to call the toh method from my main class(Driver). When I make the call it gives me a null pointer exception. How can I call the toh method in Hanoi from the driver class? When I combine the classes into one it works fine but I need them to be two separate classes. Also, I included the global variables I am using in both classes is that necessary? Any help is welcome. Thanks!  public class Hanoi {   public static int N;  public static int cycle = 0;  /* Creating Stack array  */  public static Stack<Integer>[] tower = new Stack[4];   public static void toh(int n)  {      for (int d = n; d > 0; d--)          tower[1].push(d);      display();      move(n, 1, 2, 3);           }  /* Recursive Function to move disks */  public static void move(int n, int a, int b, int c)  {      if (n > 0)      {          move(n-1, a, c, b);               int d = tower[a].pop();                                                       tower[c].push(d);          display();                             move(n-1, b, a, c);           }           }  /*  Function to display */  public static void display()  {       System.out.println("T"+cycle + "  Pillar 1  |  Pillar 2  |  Pillar 3");      System.out.println("-------------------------------------");      for(int i = N - 1; i >= 0; i--)      {           String d1 = " ", d2 = " ", d3 = " ";          try          {              d1 = String.valueOf(tower[1].get(i));          }          catch (Exception e){          }              try          {              d2 = String.valueOf(tower[2].get(i));          }          catch(Exception e){          }          try          {              d3 = String.valueOf(tower[3].get(i));          }          catch (Exception e){          }           System.out.println("  "+d1+"         |  "+d2+"         |    "+d3);      }      System.out.println("\n");      cycle++;  } }   Main class(driver):  public class Driver{  public static int N;  public static int cycle = 0;  /* Creating Stack array  */  public static Stack<Integer>[] tower = new Stack[4];   public static void main(String[] args)  {    int num = 0;      Scanner scan = new Scanner(System.in);      tower[1] = new Stack<>();      tower[2] = new Stack<>();      tower[3] = new Stack<>();      /* Accepting number of disks */                while(num <=0){          System.out.println("Enter number of disks(greater than 0):");          num = scan.nextInt();      }      N = num;      Hanoi.toh(num);   }  }

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?


Is there a way to do the default installation but have a larger swap partition? Thanks.

Is there a way to increase my existing "swapfile" without having to destroy and re-create it? I would like to up my swap space from 1GB to 2GB.  Currently it is set up as such:  $ sudo swapon -s Filename                Type        Size    Used    Priority /swapfile               file        1048572 736640  -1 $ ls -lh /swapfile -rw------- 1 root root 1.0G Nov  9  2016 /swapfile   I'm using Ubuntu 14.04.


I am doing project in which I want to perform read and write operation by using a capacitive touchscreen. What I know is I can trigger capacitive touch screen by:   By using electromagnet as I heard that some of stylus works by using magnet at its point so I think electromagnet should work. By using capacitor: If I connect a capacitor's one end to vcc and other to a conductor plate then I think it will mimic the property of human finger and trigger touchscreen.   I want to use these system so I not need to make any physical changes. If I want screen to trigger then I can just charge capacitor or electromagnet. I want to know that whether my theory is correct or not and if there is any suggestion for that then let me know.

I want to robotically touch an iPhone screen without any human intervention.   I've done some experiments but have not found a reliable solution. It seems even styluses that work through gloves still rely on the capacitive characteristics of the human body.    Carrot held by human works Carrot held in plastic clamp doesn't Pogo Stylus works held by human and held by human through clothes Stylus does not work held in plastic clamp.  Stylus works held in plastic clamp attached to human through clothes via jump lead. Stylus held in plastic clamp with jump lead dangling off seems to work most the time.   Is it possible to mimic the human element using capacitors and other components? What signal does the capacitive screen need to be triggered?  Thanks


I want to define a command which prints \newpage if the  on the current page is below a certain size, e.g. 200pt.  I tried to adapt the snippet to my needs. The problem is that the if condition always produces an error message and I have no idea why.  \documentclass{article}  \newdimen\spaceleft \spaceleft=\textheight \multiply\spaceleft by -1  \newcommand{\conditionfornewpage}{     \advance\spaceleft by \pagetotal     \multiply\spaceleft by -1     % the following if condition produces an error     \ifdim(\spaceleft < 200pt)         \newpage         \else     \fi }  \usepackage{blindtext}  \begin{document}      \blindtext[3]      \conditionfornewpage      \blindtext[2]  \end{document}   EDIT  Thanks to David's command I found a great solution for my problem. But I'll accept the answer which explains why I have an error in my code.

I have used LaTeX on and off for a number of years now for several large documents with evolving versions over long lifetimes. But every time it seems like, powerful and wonderful as LaTeX is, there arise cases where I want to tweak the pagination in ways that are impossible without using the \newpage or \clearpage sledgehammer.  The macro I think I want is something like  \ifnotremaining{<length>}{<cmd>}   that is, if less than  space remains on the page then perform . For example:  \ifnotremaining{5cm}{\newpage}   Note that <length> need not be perfect–if a little too big no problem, or a little small (perhaps because the "protected" text got bigger) then you just increase it a bit. FWIW, I am usually happy with \raggedbottom.  An alternative might be a \disablepagebreak and \enablepagebreak pair which could be used to forbid a page break in the given range of text. (This capability cannot be formulated as an environment because it cannot always nest wrt other environemnts.)  Is there something I have overlooked that can fill this need?


I am getting very frustrated / angry in working with my research teammates on a capstone course project in my Masters program. The project we are working is fairly complex and includes a good amount of data gathering, analysis, and interpretation. Its getting very close to the deadline, and I am very interested in making our project of superior quality.   This will be presented in front of two faculty professors. However, my team mates don't seem to have the same dedication as I do and seems apathetic to the end result. I am getting very frustrated as a poor research product reflects badly on myself. Direct talk does not seem to help.  For background, my teammates are all from an Asian background and are new to the United States. Perhaps the language complexity could be part of the explanation?   Thanks and I appreciate any feedback you people may provide!

Ok so first off a bit of background. I've been working professionally three years in a software engineer position after my BSc. in Mathematics and Physics. At some point I realized I missed doing true research so I enrolled in Masters in Financial Mathematics, which seemed to me the ideal trade off between maths, programming and well finance which is quite interesting.  So now, here I am, first year, with full time lectures. My first reaction was to be disappointed by the amount of team work, since in my BSc days all homeworks were individually graded. For some mathematics courses it's fine, since there's a single good answer. However, there are some instances where it's definitely more research-like, almost like a lab report actually.   What however is unnerving is that I'm stuck with teammates with whom I don't exactly share the same work ethic. For instance, I had to insist on writing formal proofs. Anyway, I just feel that if it wasn't for me we'd keep to the bare minimum. AFAIK this is quite different from the industry where, if a team screws up, then either someone is going to get fired or at least the team is going to be split by the management. Here, the prof just won't care and will assign a global grade and go on to the next team.   So I'm not sure what's the right path. On one side, I really want to make sure our team performs well, this is quite a big move I made here, but on the other side, I just don't want be bossy with them, yet here I am writing emails where I detail clearly what I'm awaiting from each of us. Also, well, I haven't talked openly with them about this issue, I'm not certain how I can bring it.


Since orbiting bodies are under constant acceleration, this means they are experiencing force.  Considering work = force X distance and work is energy, where does this energy come from?  I understand the force is supplied by gravity, but this work does not seem to 'use up' the gravity.  Thinking about this, I am assuming potential energy is being converted into kinetic energy...yet we don't seem to be consuming the potential energy, so I must be misunderstanding something.  If this could be illustrated with some math, or even a simple analogy, I would very much appreciate it.

I have a book that says the Moon's orbit is [in this context assumed to be] circular. The Earth does no work on the moon. The gravitational force is perpendicular to the motion. Why is there no work done if support force is perpendicular to the motion?


Stephen Hawking recently said that black holes do not exist. According to Wikipedia, black holes are predicted by General Relativity. So it would seem to follow that Stephen Hawking believes that General Relativity is wrong.  Am I missing something?

Recently, I read in the journal  that Stephen Hawking wrote a paper claiming that black holes do not exist.  How is this possible? Please explain it to me because I didn't understand what he said.  References:   Article in Nature News:  (Zeeya Merali, January 24, 2014). S. Hawking, Information Preservation and Weather Forecasting for Black Holes, .


I'm using a Nikon D5200. Until recently, the image in the viewfinder was  clear after focusing. I was able differentiate the blurry part and clear part. But for the past few days I've noticed that images that were focused and captured by the shutter were not clear in the viewfinder.  What could be possible reasons to see blurry images in the viewfinder, but be clear and focused captured photos?  I've cleaned the image sensor using the camera's built-in option. I've also cleaned my lens front element using dry cloth. Neither cleaning solved the problem.

The viewfinder on my camera has diopter correction, but is there a "correct" way to set it up? In the past I've just allowed the camera to auto-focus on a distant point, and then make sure that is as sharp as possible, but this seems to be prone to error, and reliant on the auto focus of the lens. Is there a better way?


I have tried to solve the problem. I have started by assigning m=(ab)/d, where d is the greatest common divisor of a and b. Then I set up c = aq. That is where I am stuck. I am really not sure what to do next.

Is $$d_1\mid n,d_2\mid n\iff [d_1,d_2]\mid n$$ true ? And if yes, how can I prove it ? I recall that $[d_1,d_2]$ is the least common multiple.  My tries  For the implication : Let $d_1\mid n$ and $d_2\mid n$. Then, $d_1d_2\mid n^2$. By the way, since $d_1,d_2\mid n$, we have that $(d_1,d_2)\mid n$ where $(d_1,d_2)=:\gcd(d_1,d_2)$  and thus $$[d_1,d_2](d_1,d_2)\mid n^2.$$  Question: How can I get $[d_1,d_2]\mid n$ from this?  For the converse, since $d_1,d_2\mid [d_1,d_2]\mid n$, the claim follow.


Let $f:\mathbb {R} \rightarrow \mathbb { R } $ be a continuous function such that  $f\circ f \circ f=\text{id}_\mathbb{R} $. Show that  $f=\text{id}_\mathbb{R}$.  Is there any hint to prove this?  Thanks for your help.

If $ f: \mathbb{R} \to \mathbb{R} $ is continuous, and $\forall x \in \mathbb{R} :\;(f \circ f \circ f)(x) = x  $, show that $ f(x) = x $.  The condition that $f$ is continuous on $\mathbb{R}$ is crucial for the proof. I can find functions such as $\displaystyle\frac{x-3}{x+1}$ that satisfies  $ (f \circ f \circ f)(x) = x $. I have tried to negate the conclusion to see if there's a contradiction, but got stuck.


This week the keys hjkl on my (Early 2011) Macbook Pro sort of all stopped working at the same time (and only those keys are affected).  I say "sort of" because they can all start working perfectly again for an extended period of time and then suddenly for no reason they all stop working.    And then in gets weirder.  If the keys are all dead I can repeatably press just one of the keys and (after varying length of time) it comes good.  At which point the remaining bad keys also start working again.  My initial thought was that it is time to replace the keyboard, but the action of the keys all coming good at the same time confuses me.  So is there an explanation to what is going on?  Or is it time to replace the keyboard?

This is an attempt to write a canonical QA for this issue, as per the Meta post:   I expect it to be periodically edited with the goal of becoming a comprehensive information resource.  I have a MacBook Pro that has a key(Shift, Return,   Command, P, etc.) that doesn’t respond when pressed or is stuck in the down position.    It's possible that my favorite beverage was spilled (or some other liquid damage).  It's also possible that I have no idea what happened.  It was working yesterday and suddenly today it's no longer working.  Is there any way to bypass or remap the key?  Can I  have the system ignore it completely?  (This question can also apply to external USB keyboards or the Bluetooth keyboards)


I have two user accounts, personal and work. I used to have two machines, a desktop and a laptop. Laptop had personal account, and I would use the work desktop with Screen Sharing to have both accounts accessible to me with a simple four finger swipe (with Screen Sharing in full-screen mode).  Now I have only one machine with both accounts on it. I can no longer use the above trick to have quick access to both user accounts, because Screen Sharing doesn't allow me to access localhost. I cannot use Fast User Switching, as it is not fast, but more importantly it logs me out of an important App I use each time I switch.  Is there some way to trick Screen Sharing into thinking I'm not trying to reach localhost and let me connect to my second user account? I do have access to an Ubuntu desktop on my network, if that helps any...  Thanks in advance for your help.

On my work Mac, which stays physically in my work office, I want to keep my work stuff separate from my personal stuff by using two different user accounts.  I normally stay logged in as the 'work' user.  But I want to have them visible at the same time, since I have a large screen.  I think I could get a nice setup if I could use the built in remote desktop client or a 3rd party VNC client to connect to the login screen of the existing machine, so that I can select a different user.  Or if I could connect as a specific user, even though the physical machine is already logged in as someone else.  I normally use my system with "remote management" mode enabled (not just remote desktop), and I often use a VNC client at home to access my Mac desktop at work.  Although this is not my daily routine.  In this mode the VNC client immediately connects to the existing desktop.  Is there a way I can force this connection to go to the login screen instead?  When I use a VNC client to connect to the existing screen, I can see it trying (you get the kind of infinite regress that you might expect), so the basic connection works.  I just want it to let me select another user.  Edit: I think part of the problem is that the system might be running a VNC server session in the background waiting for me to connect.  It connects to the active session.  It seems to happen either when I have "remote management" turned on or just "screen sharing".  Using an alternate user in an "open" command results in an error about not being able to control your own screen.  To be clear, both accounts are on my work computer.  From home I want to connect to my "work user" on my work computer.  From my desk at work, logged in as my "work user" I want to be able to connect to the "personal user" on my work computer.  I think my real problem is related to what happens on the server side of the connection.  I want the OS to fire up the login window even through there is a user logged in on the main screen/keyboard.   I know that is some circumstances a remote-login user can receive the login screen.  It might be necessary for me to give up the idea of sometimes connecting to the logged-in user and sometimes connecting with a fresh login.  If I can switch completely to the fresh-login mode that would be a start.  How does Mac OS decide whether to show the login-screen for a remote connection versus just connecting you to the running desktop?  I thought it was related to having "remote management" turned on vs "screen sharing".  But with just "screen sharing" turned on, I still get the connect-to-existing behavior.


I run dual boot Ubuntu and Windows on my machine. Last night Windows started installing some updates and it stated the machine would restart a few times during the updates.  Well, after the first restart it brought up this GRUB rescue screen, and it seems my machine can't find the Ubuntu partition. I start to think Windows may have destroyed it by updating.  In all other threats I've found so far it says to execute the 'ls' command to find all partitions and the 'set' command to see what GRUB has set up.  ls returns:  (hd0) (hd0,msdos5) (hd0,msdos2) (hd0,msdos1)   OK, set returns:  cmdpath=(hd0) prefix=(hd0,msdos7)/boot/grub root=hd0,msdos7   Now I understand this is wrong. The solution would be to ls every partition until the Ubuntu one is found. I tried this by doing ls (hd0,msdos#)/ where # is one of the numbers shown by ls. All of the commands return:     error: unknown filesystem.   I also tried adding boot/grub and combinations to the command, but nothing works.  Now, my next plan is to get a Ubuntu live USB using somebody else's computer, but I can't right now.  What is wrong here? Is my hard disk drive broken? Did the uncompleted update break it? Is there another solution?

I installed Windows 7, which ate Ubuntu's boot file. When starting up the computer, it now goes straight to Windows, without giving me the option of booting Ubuntu.   How can I get Ubuntu back?


I have a textbox that has validation on it, in the validation checks to see if its isNullOrEmpty. The validation works but what I am having difficulty is if the user never selects the textbox and clicks save, I want the validation to run again.  I was able to accomplish this in the XAML.cs file using:  Validation.MarkInvalid(cb.GetBindingExpression(dp), validationError);   Now with MVVM I'm confused how I am able to accomplish this from the viewmodel. Textbox in question:          <TextBox>             <TextBox.Text>                 <Binding Path="LastName">                     <Binding.ValidationRules>                         <validationRules:IsNullOrEmptyValidationRule/>                     </Binding.ValidationRules>                     <Binding.UpdateSourceTrigger>PropertyChanged</Binding.UpdateSourceTrigger>                     <Binding.Mode>TwoWay</Binding.Mode>                 </Binding>             </TextBox.Text>         </TextBox>   Any ideas?

I have a WPF dialog with a couple of textboxes on it. Textboxes are bound to my business object and have WPF validation rules attached.  The problem is that user can perfectly click 'OK' button and close the dialog, without actually entering the data into textboxes. Validation rules never fire, since user didn't even attempt entering the information into textboxes.  Is it possible to force validation checks and determine if some validation rules are broken?  I would be able to do it when user tries to close the dialog and prohibit him from doing it if any validation rules are broken.  Thank you.


Is it legal to allow free rent agreements as part of a real estate transaction in Monopoly?  Specifically I'd like to purchase a property and sell two additional properties but only if both parties in the transaction receive 'free rent' as long as we own the properties.

In the official rules of Monopoly, can you offer immunity to other players in deals? Also, what about tournament play, which has different rules again?  For example, it was a common house rule from my childhood that where two players were making a deal, but one of the players was more at risk of landing on the other player's property in the next move or two, the owner of those properties would offer immunity for the next time around the board (or maybe even the next two or three times around the board). So this is a popular house rule, but is it allowed in the official Monopoly rules and in tournament play?


Here is my code:  for i in patient:     patientFind.send_keys([i])  patientFind.send_keys(Keys.ARROW_DOWN) patientFind.send_keys(Keys.ENTER)   so there is this text box where I need to individually input the letters and a drop down menu appears as each letter is put in the text box.  Unfortunately after that for loop end there is a tiny bit of delay in the drop box selection so it ends up clicking the wrong thing.  Is there a way to make selenium wait a few seconds between key presses? How do I make it so that selenium would wait 1 or 2 seconds after it completes that for loop before it goes on to press the down arrow?  Of course I can use time.sleep(5), however is there any better way of doing it using webdriver?

I would like to know how to put a time delay in a Python script.


System details:   Processor: Intel® Pentium® Processor 2020M (2M Cache, 2.40 GHz) RAM 1.8GB OS type: 64-bit (Release 12.04 (precise) 64-bit) Kernel Linux 3.2.0-32-generic GNOME 3.4.1   I'm a php developer. Newly Introduced to Laravel framework. When I was using a windows system I've to install xampp and then start apache(though it takes much load and makes system slow) I was very happy when I switched to ubuntu 12.04 LTS because the web server runs as a daemon (like a smooth ride).  So when I decided to use Homestead and enter into the terminal 'vagrant up' Then Its like 'why have you done that with such a low configuration'.  So my question is what I have to do for better performance ?   Add 2GB more RAM (low budget option). buy new system with better configuration any other performance tweaks ?   Update: : 1st image -> 'vagrant up' 2nd image -> 'vagrant ssh' 3rd image -> 'vagrant halt'

What are your tips for improving overall system performance on ubuntu? Inspired by this  I realized that some default settings may be rather conservative on Ubuntu and that it's possible to tweak it with little or no risk if you wish to make it faster.  This is not meant to be application specific (e.g. make firefox load pages faster), but system wide.  Preferably 1 tip per answer, with enough detail for people to implement it.  A couple of mine would be:   Install  (via Software Center or sudo apt-get install preload); Change  value - "which controls the degree to which the kernel prefers to swap when it tries to free memory";   What are yours?  PS: Since this is not intended to have a unique answer but rather, several useful tips, I'm making this community wiki out-of-the-box.


consider the code :  localStorage.setItem(gridNameForUDF + ' - frozen columns', '2'); jq(document).ready(function() {      var VFPAGE = '  TestPage';     var currentLocation = window.location.href;     var newLocation = currentLocation.replace('gblite.','c.');     newLocation = newLocation.substring(0, newLocation.indexOf('Grid?')) + VFPAGE;     var gridInfo = getGridInfoByName('p');       var priceBookEntryIdMetaCol;     //console.log('VFPAGE '+VFPAGE);     for (var i=0; i<gridInfo.metaColumns.length; i++) {         var thisCol = gridInfo.metaColumns[i];          if (thisCol.fieldName == '****') {             **** = thisCol;              break;         }     }     var dataRows = jq('table#gbMainTable > tbody > tr.dr');     dataRows.find('td[name="' + ****.fieldId + '"]').each(function() {          var cell = jq(this);         var recordId = cell.closest('tr').attr('id');          console.log('====cell====',cell.find('td').find('span'));         cell.on('click', function(e) {              console.log('=======cell=====');             e.stopPropagation();               window.open(newLocation + '?oliId=' + recordId, '_blank');         });     }); });   At top I am setting some values in localstorage to set the first two columns of my grid freeze. And then registering an onclick event on a cell.  Now what happens is , the onlclick gets registered well, but after the js loads fully the class name if the cell gets changed to 'ui-selectee none' where as if I remove the frozen column code localStorage.setItem(gridNameForUDF + ' - frozen columns', '2'); then the class name is 'ui-selectee'.  Hence the cell on click does not work. Including frozen column creates a another div component.  Is there a solution for this? I cannot use getElementById, I cannot remove the frozen column code too.

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


So, I'm not a big expert in this subject but I know $1+2+3...=-\dfrac{1}{12}$ isn't to do with 'real' maths but it's all to do with the zeta function; however I was watching a maths video and the equation:  $$ \frac{x(x+1)}{2} $$  ... is actually a perfect equation for the series $1+2+3...$ etc. where $x$ represents $n$ in a series and $y$ is the sum of the series up to $n$. So, you can conclude that:  $$ \sum^{n}_{i=1}1+2+3...=\frac{x(x+1)}{2} $$  However, this is where it gets weird; as you have probably guessed, the roots of the equation is $x=0,-1$  but if I want to find the integral of the roots from $-1$ to $0$ which is under the $x$ axis, I get the following:  $$ \int_{-1}^{0} \frac{x(x+1)}{2}\:dx=-\frac{1}{12} $$  So, my question is why is this the case; what connection is there between the value of the integral under the $x$ axis that this graph has compared to the summation of the series?

$\displaystyle\sum_{n=1}^\infty \frac{1}{n^s}$ only converges to $\zeta(s)$ if $\text{Re}(s) > 1$.  Why should analytically continuing to $\zeta(-1)$ give the right answer?


$\lim_{n\rightarrow\infty}\frac{1+\frac{n}{1!}+\cdot+\frac{n^n}{n!}}{e^n}=\frac12$  Taking the first $n$ terms of the Taylor series of $e^n$ as the numerator, the limit is true or false? How to prove?

I'm supposed to calculate: $$\lim_{n\to\infty} e^{-n} \sum_{k=0}^{n} \frac{n^k}{k!}$$ By using WolframAlpha, I might guess that the limit is $\frac{1}{2}$, which is a pretty interesting and nice result. I wonder in which ways we may approach it.


I have a homework problem that asks us to find the basis $\mathbb{R}^2_{\rm discrete}$ with the lexicographic order topology. I actually have no idea, so any help is greatly appreciated. Thank you!

I have the following question:  Is $(\mathbb{R}^2, lexicographic) \cong (\mathbb{R}, discrete)\times (\mathbb{R}, usual)$?  Note: the symbol $\cong$ denotes a homeomorphism between topological spaces  What I think:  I think that in fact there is a homeomorphism between those spaces, because is possible to express the lexicographic order as union of vertical lines with open extremes, I mean this is a basis for the lexicographic order. If I consider the Identical function I have the homeomorphism. Am I right?


I got away some time and couldn't update my 19.04 Ubuntu in time. Now I'm stuck on 19.04 and can't find a way to update to any  working version. I fixed the apt update so it can still work (using older repos), but I can't go any further. I tried :  upgrading from this  this  too (can't get to 19.10 with dist-upgrade) and with the do-release-upgrade (see below)  Checking for a new Ubuntu release Your Ubuntu release is not supported anymore. For upgrade information, please visit: http://www.ubuntu.com/releaseendoflife  Get:1 Upgrade tool signature [1 554 B]                                          Get:2 Upgrade tool [1 342 kB]                                                   Fetched 1 344 kB in 0s (0 B/s)                                                  authenticate 'focal.tar.gz' against 'focal.tar.gz.gpg'  extracting 'focal.tar.gz'  Reading cache  Checking package manager  Can not upgrade   An upgrade from 'disco' to 'focal' is not supported with this tool.  I'm kinda stuck and out of ideas, and I can't really do a clean install, I don't really want to loose some of my things that are a bit hard to backup

Recently I have installed an older version of Ubuntu on my old machine. Whenever I try to install any software, I get an error saying it couldn't be found:  $ sudo apt-get install vlc Reading package lists... Done                Building dependency tree        Reading state information... Done     E: Couldn't find package vlc


I've read a lot of articles and existing questions on stackoverflow. I've litteraly tried over 10 different pieces of code. It just doesn't work.  I've got a website, and I would like the footer to stick on the bottom no matter what. I mean, litteraly stick on the bottom. I do not want it to move with the height of the window of the browser. I want it to stay below all existing divs.  At the moment the footer is at the bottom of the page. But it moves with the height of the window of my browser. So, if I minimize my browser, the footer will move upwards with the height of the browser. I do not want that.  I've tried a lot, but it doesn't work. This is my current code:  body{ background-image: url('../images/bg.png'); background-repeat: repeat; margin: 0px; padding: 0px; }  body, html{     height: 100%; }  #body{ width: 1024px; min-height: 100%; margin: 0 auto; }  #footer{ clear:both; min-height: 150px; width: 100%; background-image: url('../images/footerbg.png'); background-repeat: repeat; }   The body ID is the wrapper. The footer is outside the body wrapper

           Edit: The problem has to do with one of the divs inside the "body" div. It is being positioned using an absolute position. Is there any way to get the footer stickied properly using Ryan Fait's method, whilst using an absolute position?  Edit #2: I forgot to use "clear:both". Solved it

I have a simple 2-column layout with a footer that clears both the right and left div in my markup.  My problem is that I can't get the footer to stay at the bottom of the page in all browsers.  It works if the content pushes the footer down, but that's not always the case.


I have googled it, but I am not satisfied with those.  So my questions are:        Let $D$ be an open set in $\mathbb{R}$.         Let $f:D\rightarrow \mathbb{R}$ be a infinitely differentiable function.      Fix $x_0\in D$      Then, does $\sum_{n=0}^\infty \frac{f^n(x_0)}{n!}(x-x_0)^n$ converge on some neightborhood of $x_0$?   Secondly,        Let $D$ and $f$ be the domain and function illustrated as above.         Fix $x_0 \in D$      Assume, $\sum_{n=0}^\infty \frac{f^n(x_0)}{n!}(x-x_0)^n$ converge on $W\cap D$ where $W$ is some neightborhood $W$ of $x_0$.      Then, does this series coincide with $f$ on $W\cap D$?

Do you have some reference to a proof of the so-called Borel theorem, i.e. every power series is the Taylor series of some $C^{\infty}$ function?


I have tried to tame it but it still looks like an ocelot even though I can put it in breeding mode. I can't make it sit it does not follow me the only thing I can do is put it in breeding mode. How can I tame it

I'm having the same trouble with the Ocelot. It was walking towards me and I right clicked it lots of times with the raw fish in hand, but it still only goes into breeding mode and it won't tame them at all.


def merge_sort(a):     if len(a)<=1:         return a     left = merge_sort(a[:len(a)//2])     //print('this is left step {}'.format(left))     right = merge_sort(a[len(a)//2:])     //print('this is right step {}'.format(right))     return merge(left, right)   i understand algebraic recursive functions i understand how it works.   what i dont understand is how merge_sort(a[len(a)//2:]) is getting just one number from the passed in list called 'a' (i have a def create_random_array that passes in  random list of numbers ).  my thinking was that it would first split the list in half-witch I could see in my print function, then it would split it again , and again until there is only one that can then be compared.   how does merge_sort(a[len(a)//2:]) work   other part of the code that might be useful to understand my mess   def create_array(size = 5, max = 10):     from random import randint     return [randint(0,max) for _ in range(size)]    def merge(a,b):     c = []     a_idx = 0     b_idx = 0     print(a[a_idx])     print(b[b_idx])     while a_idx<len(a) and b_idx<len(b):         if a[a_idx]<b[b_idx]:             c.append(a[a_idx])             a_idx+=1         else:             c.append(b[b_idx])             b_idx+=1     if a_idx==len(a):         c.extend(b[b_idx:])     else:         c.extend(a[a_idx:])     return c

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.


Within a single query, all current time functions like sysutcdatetime() return a single point in time that is re-used throughout the query for each instance (e.g. of  sysutcdatetime()) no matter how complex (afaik).  However NewId() and Rand() do not follow this behavior and diverge from each other as well and it does not seem to be documented.  How to describe?  Are there other functions?  Union All Example:  select newid() as NewId, rand() as Rand, sysutcdatetime() as Utc union all select newid(), rand(), sysutcdatetime() union all select newid(), rand(), sysutcdatetime()     Select Field Example:  select top 1000000 newid() as NewId, Rand() as Rand, sysutcdatetime() as Utc   from sys.all_objects AS s1    cross join sys.all_objects AS s2     Update Example:  create table #t (     NewId uniqueidentifier,     Rand decimal(18,8) )  insert into #t select null, null  union all select null, null  union all select null, null  update #t    set NewId = newid(),        Rand = rand();  select * from #t

My actual work query was an inner join, but this simple example with cross join seems to nearly always reproduce the problem.  SELECT * FROM (     SELECT 1 UNION ALL     SELECT 2 ) AA ( A ) CROSS JOIN (     SELECT NEWID() TEST_ID ) BB ( B )   With my inner join I had many rows for which I added to each a GUID using the NEWID() function, and for about 9 out of 10 such rows the multiplication with the 2-row virtual table produced the expected results, just 2 copies of the same GUID, while 1 out of 10 would produce different results. This was unexpected to say the least and gave me a really hard time trying to find this bug in my test data generation script.  If you take a look at the following queries using as well non-deterministic getdate and sysdatetime functions, you won't see this, I don't anyway-I always see the same datetime value in both final result rows.  SELECT * FROM (     SELECT 1 UNION ALL     SELECT 2 ) AA ( A ) CROSS JOIN (     SELECT GETDATE() TEST_ID ) BB ( B )  SELECT * FROM (     SELECT 1 UNION ALL     SELECT 2 ) AA ( A ) CROSS JOIN (     SELECT SYSDATETIME() TEST_ID ) BB ( B )   I'm currently using SQL Server 2008 and my work around for now is to load my rows with GUIDs into a table variable before finishing out my random data generation script. Once I have them as values in a table as opposed to virtual table, the problem goes away.  I have a workaround, but I'm looking for the ways to workaround without actual tables or table variables.  While writing this I tried without success these possibilities: 1) placing the newid() into a nested virtual table:  SELECT * FROM (     SELECT 1 UNION ALL     SELECT 2 ) AA ( A ) CROSS JOIN (     SELECT TEST_ID     FROM (         SELECT NEWID() TEST_ID     ) TT ) BB ( B )   2) wrapping the newid() within a cast expression such as:  SELECT CAST(NEWID() AS VARCHAR(100)) TEST_ID   3) reversing the order of appearance of the virtual tables within the join expression  SELECT * FROM (     SELECT NEWID() TEST_ID ) BB ( B ) CROSS JOIN (     SELECT 1 UNION ALL     SELECT 2 ) AA ( A )   4) using uncorrelated cross apply  SELECT * FROM (     SELECT NEWID() TEST_ID ) BB ( B ) CROSS APPLY (     SELECT 1 UNION ALL     SELECT 2 ) AA ( A )   Just before finally posting this question, now I tried this with success it seems, a correlated cross apply:  SELECT * FROM (     SELECT NEWID() TEST_ID ) BB ( B ) CROSS APPLY (     SELECT A     FROM (         SELECT 1 UNION ALL         SELECT 2     ) TT ( A )     WHERE BB.B IS NOT NULL ) AA ( A )   Anyone have any other more elegant, simpler workaround? I really don't want to use cross apply or correlation for a simple row multiplication if I don't have to.


When I press the Super key, my search panel does not come up and my side apps list is not showing. What can I do? I am new to Ubuntu and Linux in general.

When I login, nothing happens.   I am presented with my desktop wallpaper.    No Dash, no Launcher, nothing.


I want to do a little javascript library that contains one method that return the content of this page via GET METHOD:   <script type="text/javascript"> function getFromPage(){     var result = ?????     return result;    }     var result =getFromPage()    //should print "result=key:value" alert("result="+result); </script>   I tried a lot of things including ajax, but I ended with a cross domain exception. How can I implement this method?

How do I send a cross-domain POST request via JavaScript?  Notes - it shouldn't refresh the page, and I need to grab and parse the response afterwards.


This question is already asked  but it does not quite answer my question.  When I review, I get some posts that are answers of very poor quality, or I get flags declined on questions with the message flags should not be used to indicate technical inaccuracies, or an altogether wrong answer.  So posts should be down voted. But if the post belongs to other domains you are active in, such as .net, but the post actually is in PHP, then your Reputation Point will detect I got it from .  My Question is: If a post is not good, then we should down vote. But if this post simply belongs to another category, a point should not be deducted. So why are Reputation Point deducted in this case?

It is incredibly rare that I downvote on this or any other community site. I would rather just ignore the item. However, occasionally some very bad advice is given that is worthy of a downvote. Why should this adversely affect the reputation of the person who downvotes?


I have a symbolic link for a directory,  e.g ln -s /tmp /xxx  Now when I type /xx and press tab key, bash would complete the line to /xxx   If I press it again it become /xxx/  Now, how can I ask bash to complete /xx to /xxx/ automatically (provided that there's only one match)

I'm on a Mac and the cp and mv commands are killing me due to them copying the contents of a directory if a trailing slash is present. It has bitten me more than once when I use tab completion to specify the directory I want to copy.  I have noticed zsh has a neat feature that removes the trailing slash if it's not needed after a space or enter key is pressed. Is there any way to have bash mimic this behavior?


Statement of the problem:  Let $E$ be a Normed Vector Space over the real numbers. Let $A, B$ be subsets of $E$ such that:  $A$ and $B$ are non-empty, $A \cap B = \emptyset $. Assume $A$ is closed and $B$ is compact. Define the set $C := A - B = \cup_{b \in B} (A - b)$. Here, $A - b = \{ a - b : a \in A \}$. i.e. a translation of the set $A$ in the direction of $-b$.  Prove that C is closed.  I am sure that $B$ being compact is key here, and suspect I should consider finite covers in some way, but I cannot figure out why $A - S$ should be closed for any potentially infinite set $S$... Could someone please offer me a hint? Thank you.

Let $(X,\|\;\|)$ be a normed vector space over $K$ and let $A,B\subseteq X$ be s.t. $A$ is compact and $B$ is closed. I want to prove that:  $$(\alpha A+\beta B)\;\text{ is closed }\;\forall \alpha,\beta\in K$$ So, given our function $\odot$ as in , my attempt goes like this: Let $\alpha,\beta\in K$. If $\alpha=\beta=0$, clearly $$\alpha A+\beta B=\{0\}\text{ is closed}$$ Now, since $\odot$ is continuous and $A$ is compact, we have that $\;\forall \alpha\neq0,\;\alpha A=\odot(\alpha,A)\;$ is compact and thus closed.  Then, let $\;y\in \beta B$ so,  $$ y=\beta b_y $$ for some $b_y\in B$. But, since $B$ is closed, there exists $\{b_n\}_{n\in\Bbb N}\subset B$ s.t. $b_n\xrightarrow[n\to\infty]{}b_y$ So let $y_n=\beta b_n\;\;\forall n\in\Bbb N$. Thus, $\{y_n\}_{n\in\Bbb N}\subset \beta B$ and $\|y_n-y\|=\|\beta b_n-\beta b_y\|=|\beta|\|b_n-b_y\|\xrightarrow[n\to\infty]{}0$ Thus, we get that  $$\forall y\in\beta B\;\exists\;\{y_n\}_{n\in\Bbb N}\subset \beta B \text{  s.t.  } y_n\xrightarrow[n\to\infty]{}y$$ so $\beta B$ is closed $\;\forall \beta\in K$. Now, $$ \text{Let }x\in (\alpha A+\beta B)\Rightarrow\;\exists\;a^*\in\alpha A\;\land\;b^*\in\beta B\text{  s.t.  } x=a^*+b^* $$ so, since $\alpha A$ and $\beta B$ are closed, $$ \exists\;\{a_n^*\}_{n\in\Bbb N}\subset\alpha A\text{  s.t.  }a_n^*\xrightarrow[n\to\infty]{}a^*\\ \exists\;\{b_n^*\}_{n\in\Bbb N}\subset\beta B\text{  s.t.  }b_n^*\xrightarrow[n\to\infty]{}b^* $$ so, taking $x_n=a_n^*+b_n^*\;\forall n\in\Bbb N$ is clear that $x_n\in (\alpha A+\beta B)\;\forall n\in\Bbb N$ and $$ \|x_n-x\|=\|a_n^*+b_n^*-a^*-b^*\|\le\|a_n^*-a^*\|+\|b_n^*-b^*\|\xrightarrow[n\to\infty]{}0 $$ so $x_n\xrightarrow[n\to\infty]{}x$ and, since this happens $\;\forall x\in (\alpha A+\beta B)$, thereby $(\alpha A+\beta B)$ is closed $\;\forall \alpha ,\beta\in K$  What do you think? Did I miss something?


I am working with wordpress where i have a sort listing by date. There is a custom field in my post called "value_event" which date format yyyy/mm/dd. Now i want to sort all posts by value_event. with this query_post command:  This is the code in template for custom post taxonomy-event-date.php     <?php    $args = array(   'post_status'       => 'publish',   'posts_per_page'    => 6,   'paged'             => $paged,   'meta_key'          => 'value_event',   'orderby'           => 'meta_value_num',   'order'             => 'ASC'   );   $query = new WP_Query( $args );   if ( $query->have_posts() ) {   while ( $query->have_posts() ) {   $query->the_post();?>   <?php the_title(); ?>   <?php                             }   }   wp_reset_query();  // Restore global post data stomped by the_post().   ?>    Functions          add_action('pre_get_posts','search_filter');         function search_filter($query){         if ( !is_admin() && $query->is_tax( 'event', 'date' ) ) {         $query->set('post_status', 'publish');         $query->set('meta_key', 'value_date');         $query->set('orderby', 'meta_value_num');         $query->set('order', 'ASC');     }     }

I have a custom field called "value_date" where add a date  e.g yyyy/mm/dd  The idea is sort the upcoming dates first in the loop, is possible?  I used a template for custom post taxonomy-event-date.php and this is code in the function, It doesn't work.  Functions.php  add_action('pre_get_posts','search_filter'); function search_filter($query){     if ( !is_admin() && $query-> is_tax( 'event', 'date' ) ) {         $today = date( 'Y-m-d' );         $query->set('post_status', 'publish');         $query->set('meta_value', $today);         $query->set('meta_key', 'value_date');         $query->set('orderby', 'meta_value_num');         $query->set('order', 'ASC');     } }


When "maximise" doesn't mean "maximise" None of the maximise commands provide maximisation to fill the whole screen. When you have Dock not autohidden, then they only go up to the boundary of the dock. When you have Dock hidden they go near the edge of the screen but a few pixels short meaning you can see other apps and the desktop behind them. User error? First I thought it was because I was using third party apps to maximise. I tested in Sizeup, Moom and BetterTouchTools. But it turns out the native maximisation is broken to begin with. Nothing will let a window automatically maximise to the full screen size, there will always be some pixels left over wherever the Dock is even if you have it hidden and at the smallest size setting. Non-solutions At first I thought  was a duplicate and would provide my answer, but alas it doesn't. It is, of course, possible to move the window behind the dock protected pixels then resize it from the opposite side. But this has to be done for every window manually each time. Is there any way to make it so that maximise fully maximises across the entire screen? I really hope there is! Bonus points if anyone can find software that will allow keyboard shortcuts to do a different action moving a window dependant on where it currently is. e.g. in Windows 7 and above you can hit Windows+Left over and over and the window will first maximise half left, then maximise half right on the display to the left of the current display, then to the left of that display and so on. Likewise, Windows+Down will first restore a window, then minimise. Update It's now been most of a year since I posted this question and despite extensive additional searching as well up updating to El Capitan, this OS X bug hasn't been fixed and I haven't been able to find any tool that offers a working solution. Any ideas at all?! Update 2 This has been marked as closed since a similar question has already got an answer - forgive, I can't see the link to this answer and have been unable to find it myself. Update 3 I've now been linked to the "answer" which says that it's not possible without disabling the Dock, Mission Control and the application switcher i.e. making crippling the core multitasking capabilities of the OS (and making it unusuable for me). I can say clearly that cutting off your nose to spite your face is not the sort of solution I was after. The "reason" given is not a) necessary as claimed by any reasoning I can come up with or b) relevant to required a border of clear pixels after maximising, c) true in any way as you can manually move windows behind the border and still have a fully-functioning Dock. I don't understand why this is being marked as answered based on the other question since that's not really an answer even at a stretch - all the "answerer" says is they don't know of any reasonable solution. Since it's possible manually, one would be inclined to believe it's technically possible. And there's no sound reason for "maximised" programs to behave in this way, again this is demontrabl

When maximizing a Mac window with the green button, it will not maximize to full size, but have a little left margin from the left side.    I guess there is no setting to change that, but that margin has to have a specific size defined. Is there any kind of terminal command I can run to decrease the left margin to 0?  I know there are apps which can position windows to any prefered position and size, but I is there a way to do it without one?  The strange thing is, that it does maximize to full size without a margin on the right screen when you've got a second display connected.


Given the sum $$ \sum_{k=0}^{m} {n \choose k} {m \choose k}, $$ where $ n > m$. Could it be somehow calculated into a shorter an nicer expression which doesn't contain the sum?  Thanks in advance!

How do I evaluate $\sum_{k=0}^{n} {n \choose k}{m \choose k}$ for a given $n$ and $m$.  I have tried to use binomial expansion and combine factorials, but I have gotten nowhere. I don't really know how to start this problem.  The answer is ${n+m \choose n}$. Any help is greatly appreciated.  EDIT: I'm looking for  a proof of this identity.


I what to ask you about recently viewed question in one panel at right side. Basically sometimes, after viewing a question, you may realize that you needs to review it again. So, in that case there would be some kind of panel there.  How about this?

Is there a way to view the list of questions I have recently viewed?  When just browsing the site, I will often look at new questions that I can't answer but am interesting in knowing what the answer is. If there isn't an good answer yet, I'll then browse on to other questions. The problem I run into is that sometimes it is hard to go back and find question after a few minutes or hours. I can also think of other use-cases where I would find this useful.  I know I can tag questions as favorites and locate them in my profile. At the risk of sounding  lazy, I find this to be too much work unless it is a question that I am really, really interested in.  It would be really handy if there was a way quickly see a list of last X (maybe 10) questions that I have viewed. For ease of access, it would be nice if this list was displayed in the side bar.   I don't see this functionality available, so I'm tagging this a feature request. If it already exists, I could use a nudge in the right direction on how to find it.


Prove that there exists a set $X \subset \mathcal{P}(\mathbb{N})$ so   that $|X| = \mathfrak{c}$ and for every $A,B\in X$, the set $A \cap B$   is finite.   Since this statement feels unintuitive, it's difficult to come up with ideas on how to prove it. Surely if the set X has continuum cardinality, some intersections of it's elements are bound to be infinite as well?  My thought then went to assembling $X$ so that all elements in $X$ contain the number 1 and no other common elements. However, that seems quite difficult, when we have to make a continuum cardinality of these sets where the only common element is 1.  So basically, I'm stuck and I'd like help.

Can a countable set contain uncountably many infinite subsets such that the intersection of any two such distinct subsets is finite?


I've seen other solutions but they look rather bold, and messy, and very big. I want something like this, so I can use the code as a template.

So this is a piecewise defined function I have that I need to talk about:     f(a,b) = \left\{      \begin{array}{lr}        \text{open} & : \text{RMSD}_\text{s-open}\ge6, \text{RMSD}_\text{closed}\ge6\\        \text{closed} & : \text{RMSD}_\text{closed}\le2 \\        \text{semiopen} & : \text{RMSD}_\text{s-open}\le2\\        \text{transition} & :f(a,b)\notin\{\text{open}, \text{closed}, \text{semiopen}\} \\       \end{array}    \right.   So what's the way to align up the colons (conditions) so that it looks all nice and pretty?   Also, if I want to describe transition to be the value of the function when none of the conditions of the previous 3 are satisfied, is the way I wrote it out with f(a,b) not belonging to the set {open,closed,semiopen} a good way of writing it? seems really unprofessional...


How are private functions and data of modules accessed after loading the module?  I know that the require function loads the module and returns the module.exports object which contains some public objects or functions, but how are the other 'private' parts of the code in the module accessed? where is it located in the memory?

How would you explain JavaScript closures to someone with a knowledge of the concepts they consist of (for example functions, variables and the like), but does not understand closures themselves?  I have seen  given on Wikipedia, but unfortunately it did not help.


The words break in fully justification of text in latex. I need document format "Report" and fully justified text. My latex code is   \documentclass[12 pt]{report}  \usepackage{times} \usepackage[english]{babel} \usepackage{geometry}  \geometry{ a4paper}  \usepackage{siunitx} % Required for alignment \usepackage{enumitem} \usepackage{ragged2e}  \begin{document}  \begin{flushleft}  \justifying  \chapter*{  Abstract}  Banana (\textit{Musa paradisiacal L}) is the fourth most important crop in the world after rice, wheat and maize. Banana cultivation in Nepal is more popular like other agricultural products and has annual production of about 5000 tons. There are large plantation in Kailali and Nawalparasi districts and other districts as well. The thick, fleshy and fibrous pseudo stems that are leftover after harvesting the bananas can be used to extract high quality fiber. Farmers usually throw away this whole stump because it is big and heavy and takes a long time to rot and the animals do not eat it. Research shows, about 10-13 stem of banana can provide 2 Kg of fibre worth of about Rs.500. Usually farmers are extracting banana fibres manually or the machine costs expensive when bought from other countries as such machines are not manufactured in Nepal. Our group have studied the feasibility of developing such machine with low cost which ultimately provides opportunity of local entrepreneurship to farmers and helps in proper utilization of agricultural management. Along with it, this encourages farmers to cultivate more banana and makes country self-dependent in fibre.  \newline \\ \textbf{Keywords : Banana fibre, 5000 tons , manual extraction, 10-13 stem produce 2Kg fibre ,  Extraction machine} \end{flushleft}  \end{document}     I don't want the encircled text to break.

Sometimes, assume our document contain many long words, TeX may generate some hyphenation at the end of line. But it really hinder our smooth reading. Although I know we can add the hyphenation rule at the preamble. It can't reduce hyphenation number but effect the hyphenation position. It is said that microtype package can give us more compact output. But it require expert level to tuning the parameter.


I am trying to style the first word of a paragraph, but it is not working. Can anyone help. I can style the first letter, but not the first word. I have reasons to not use  to do this.     .product-title {   width: 100vw;   text-align: right;   font-size: 4.5vw;   letter-spacing: -0.05em;   color: #ffffff;   "  } #first-letter-here p::first-letter {   font-family: arial;   font-weight: 900;   font-size: 3em; } #first-word-here p::first-word {   font-family: arial;   font-weight: 900;   font-size: 3em; }

     Milk and cookies.

     Milk and cookies.

This one has me kind of stumped. I want to make the first word of all the paragraphs in my #content div at 14pt instead of the default for the paragraphs (12pt). Is there a way to do this in straight CSS or am I left wrapping the first word in a span to accomplish this?


In the following question:     Have you been to Argentina yet?   Is it correct for me to use already instead of yet?  Context:     Julie: Hi Mum! I've just arrived in Santiago.   Mum: Santiago? Where's that?   Julie: It's the Capital of Chile   Mum: Have you been to Argentina yet? (Already?)   Julie: No, not Yet.

'Yet' and 'already' are often used with Present Perfect.  Which of them is preferred in sentences like this:     Is your father here yet (or already?)? Yes, he has just come.   'Yet' is used to say that it is expected that something has happened and used in negative sentences and in questions, so in the sentence above it seems that it is used correctly.  But is it possible to use already in this question? Would already sound naturally here?


I've seen this constuction into Scrapy framework sources:

I have been using Python more and more, and I keep seeing the variable __all__ set in different __init__.py files.  Can someone explain what this does?


iMac 21.5-inch, 2019 Shipped with Catalina Goal is to have two volumes. One with Catalina, the second with Mojave. I have already downloaded Mojave and plan to create a bootable drive using disk utility. Then follow steps to downgrade. Wondering if I can shorten the process...but I can't find a guide that combines downgrading and creating a second OS volume. Can I create a second volume, erase Catalina on new volume, and then install Mojave without losing data on original volume? Or do I need to downgrade, create second volume and then upgrade that to Catalina? Other tips and suggestions for this process are appreciated too.

I’ve tried a few times now but I get a message ‘you need to update to a later os’ when I try to boot up from the external.  It would seem that Catalina doesn’t like it. I still want Catalina installed but I need Mojave as an external boot drive.  Any ideas anyone?


As the title suggests. I do understand that the quotient rule is pretty much the product rule combined with the chain rule, but regardless is there a methodical way of computing such integrals?

When teaching the integration method of u-substitution, I like to emphasize its connection with the chain rule of integration. Likewise, the intimate connection between the product rule of derivatives and the method of integration by parts comes up in discussion.      Is there an analogous rule of integration for the quotient rule?     Of course, if you spot an integral of the form $\int \left (\frac{f(x)}{g(x)} \right )' = \int \frac{g(x) \cdot f(x)' - f(x) \cdot g(x)'}{\left [ g(x)\right ]^2 }$, then the antiderivative is obvious. But is there another form/manipulation/"trick"?


I am trying to get Web View current URL in dialog box.  I used following code, but its giving error  String webUrl1 = web.getUrl(); builder.setMessage(webUrl1);   here is full code.  i am trying to match url in if condition. but it doesn't giving any error nor working properly.      //setting up web view     setContentView(R.layout.main);     web = (WebView) findViewById(R.id.webView1);     setUpWebView();     web.loadUrl("http://www.example.com");      String webUrl1 = web.getUrl();      if (webUrl1=="http://www.example.com"){     //do something.     }

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?


Is it possible to change date only for a specific user (non-root) in Linux ?  If possible, How to do it ?   And it would be great if someone can point out the impact of doing so.  EDIT  Putting my question in other words .  I want to change the day and time from what it is now to another day and time in Linux without having root privileges.How can I achieve this ?

How can I execute a command making it believe that is on a different date than system one?  For instance, if I have this script:  #!/usr/bin/env bash     date +"%B %d, %Y"   It prints the actual date: march 13, 2014   But I would like it to print a different date, on the future or past, without changing the system date.  If I wasn't clear enough, I want a command line tool like .    I do not want to use a different script (it was just an example). I do not want to set a cronjob. I do not want to change my general system date. Only change the date that apply to the command to run.


$\lim_{x \to \infty}  x-x^2\ln(1+1/x)$ I tried to write it as a fraction and use L'Hospital Rule but it will still be a indetermination. The answer seems to be $1/2$. Can somebody help me, please?

I can't get this to $ = \frac{0}{0}$ form so I can use l'Hospital rule $$\lim_{x \to \infty} x - x^{2}\ln\left(1 + \frac{1}{x}\right)$$  tips?  [EDIT] $$\lim_{x \to 0} \frac{1}{x} - \frac{\ln(1 + x)}{x^{2}}$$ second term $$\lim_{x \to 0} \frac{\ln(1 + x)}{x^{2}} =  \lim_{x \to 0}  \frac{\frac{1}{1 + x}}{2x} = 2\lim_{x \to 0}  \frac{x}{x+1} = 0$$ first term $$ \lim_{x \to 0}  \frac{1}{x} = \infty$$  is this okey?


Lets say that my script name is test.sh. What i want to do is when I give the command  ./tool.sh -f <file>   where file is a file of events(ex events.dat) to do something with awk and when i give the command  ./tool.sh -f <file> -id   to do something else. How can I achieve that?

Say, I have a script that gets called with this line: ./myscript -vfd ./foo/bar/someFile -o /fizz/someOtherFile  or this one: ./myscript -v -f -d -o /fizz/someOtherFile ./foo/bar/someFile   What's the accepted way of parsing this such that in each case (or some combination of the two) $v, $f, and  $d will all be set to true and $outFile will be equal to /fizz/someOtherFile?


I'd like to know the reason for the punctuation of the noun "brush-off" and the verb "to brush off": they have related meanings, but "brush-off" is the result of "to brush off", essentially. But one cannot write "to brush-off" as that just looks weird, as it is used for the noun version.  So the question, is the hyphen often used like this in English to differentiate a derived noun from a verb?

When "air kiss" is treated as a verb, as in "they air kissed", should it be hyphenated to "air-kissed"?


I'm trying to upload a file via curl using a Windows batch file. format is curl -T "{filename}" ftp://{uploadlocation}/{filename} I'm looking to append the current time (hhssmm) to the target filename, curl -T "{filename}" ftp://{uploadlocation}/{filename}+time how would I go about doing this?

Update: Now that it's 2016 I'd use PowerShell for this unless there's a really compelling backwards-compatible reason for it, particularly because of the regional settings issue with using date. See @npocmaka's     What's a Windows command line statement(s) I can use to get the current datetime in a format that I can put into a filename?  I want to have a .bat file that zips up a directory into an archive with the current date and time as part of the name, for example, Code_2008-10-14_2257.zip. Is there any easy way I can do this, independent of the regional settings of the machine?  I don't really mind about the date format, ideally it'd be yyyy-mm-dd, but anything simple is fine.  So far I've got this, which on my machine gives me Tue_10_14_2008_230050_91:  rem Get the datetime in a format that can go in a filename. set _my_datetime=%date%_%time% set _my_datetime=%_my_datetime: =_% set _my_datetime=%_my_datetime::=% set _my_datetime=%_my_datetime:/=_% set _my_datetime=%_my_datetime:.=_%  rem Now use the timestamp by in a new ZIP file name. "d:\Program Files\7-Zip\7z.exe" a -r Code_%_my_datetime%.zip Code   I can live with this, but it seems a bit clunky. Ideally it'd be briefer and have the format mentioned earlier.  I'm using Windows Server 2003 and Windows XP Professional. I don't want to install additional utilities to achieve this (although I realise there are some that will do nice date formatting).


- does not mean anything.  Setting fsck_y_enable="YES" and background_fsck="NO" in /etc/rc.conf don't do anything.  My root file system is not clean and has a lot of errors (due to a power outage - unexpected shutdown, not because hard drive or hardware are bad).  fsck shows errors:  root@host2:/usr/home/alex # fsck ** /dev/mirror/gm0p2 (NO WRITE) ** Last Mounted on / ** Root file system ** Phase 1 - Check Blocks and Sizes ** Phase 2 - Check Pathnames ** Phase 3 - Check Connectivity ** Phase 4 - Check Reference Counts UNREF FILE I=8268305  OWNER=root MODE=140777 SIZE=0 MTIME=Jun  6 21:58 2014 CLEAR? no   [skipped 100+ lines]  I don't have physical or KVM access to the server. This is gmirrored drive  FreeBSD host2.domain.tld 9.2-RELEASE FreeBSD 9.2-RELEASE #0 r255898: Thu Sep 26 22:50:31 UTC 2013 root@bake.isc.freebsd.org:/usr/obj/usr/src/sys/GENERIC  amd64  # Device                Mountpoint      FStype  Options Dump    Pass# /dev/mirror/gm0p2       /               ufs     rw      1       1 /dev/mirror/gm0p3       none            swap    sw      0       0

How to set systemd for automatically force fsck disks after crash (hard poweroff)?  When I used sysvinit (in Arch Linux) as /sbin/init I used the hack: in the rc.local I create /forcefsck file; in the rc.local.shutdown I remove it. At boot-up rc.sysinit enable force fsck if /forcefsck exists.  How to do same in systemd? Maybe it has built-in facilities for automatic fsck after crush?


Let $A\in L(V), A = \begin{bmatrix}0&0&...& 0 & \alpha_{1}\\0&0&...& 0 & \alpha_{2}\\\vdots&\vdots&\ddots&\vdots&\vdots\\0&0&...& 0 & \alpha_{n-1}\end{bmatrix}$. Determine its characteristic and minimal polynomial.   I have concluded that $k_{A}(\lambda) = (n-1- \lambda)(-\lambda)^{n-1}$, but I am stuck on minimal polynomial. My strategy was to observe $(A - \lambda I),(A - \lambda I)^{2},...$ , until I get matrix $(A - \lambda I)^{k}$ such that $\dim(Im ((A - \lambda I)^{k})) = n-1$, but since all those matrices are diagonal, my understanding is that we will never achieve that.

I have come across a question about determining possible minimal polynomials for a rank one linear operator and I am wondering if I am using the correct proof method.  I think that the facts needed to solve this problem come from the section on Nilpotent operators from Hoffman and Kunze's "Linear Algebra".     Question: Let $V$ be a vector space of dimension $n$ over the field $F$ and consider a linear operator $T$ on $V$ such that $\mathrm{rank}(T) = 1$.  List all possible minimal polynomials for $T$.   Sketch of Proof:   If $T$ is nilpotent then the minimal polynomial of $T$ is $x^k$ for some $k\leq n$.  So suppose $T$ is not nilpotent, then we can argue that $T$ is diagonalizable based on the fact that $T$ must have one nonzero eigenvalue otherwise it would be nilpotent (I am leaving details of the proof of diagonalization but it is the observation that the characteristic space of the nonzero eigenvalue is the range of T and has dimension $1$).  Thus the minimal polynomial of $T$ is just a linear term $x-c$.    Did I make a mistake assuming that $T$ can have only one nonzero eigenvalue?  Thanks for your help


I'm using the following code in latex for inserting R output from the package verbatim. First I put the output in a text file then call it from the following code, \verbatiminput{2.txt}  The font size is a bit big. How can I change the font size to footnotesize for all the command \verbatiminput{}?

Is there a way to set an option of fontsize that would affect the command \verbatiminput ?  MWE:  \documentclass{article} \usepackage{verbatim}  % NOT WORKING %\makeatletter %\newcommand{\verbatimfont}[1]{\renewcommand{\verbatim@font}{\ttfamily#1}} %\makeatother  \begin{document}         \verbatiminput{test.txt} \end{document}


I have been asking a lot about optional back shifting. I understand that if what is said is still true at the time of reporting then back shifting of tense is optional. I just have one doubt. If what is said is no longer true, then colloquially and conversationally will it be acceptable to avoid back shifting of tense ?   P.S. -- I know while writing it would be wrong to not back shift the tense if what is said is no longer true.

In reported speech, tenses are generally backshifted. If what was said is still true at the time of reporting then back shifting is optional.  My question is, if someone doesn't backshift the tense knowing for a fact that the statement is no longer true, is that still acceptable?  For example, suppose John tells me today:      I am hungry.    Then two days later, I happen to tell my friend:        John said that he is hungry.   Even though I know that John is no longer hungry, I used the present simple tense (is). Is this usage correct?


Is it possible to upgrade iPhone 4 iOS to 9 or 10 using jail break approach?  Main purpose to install apps which require latest iOS. So is there any method even through security bypass?  Rather throwing the older phone any possibility by experimenting?

I have an iPhone 4 and I need to upgrade from 7.1.2 to iOS 8 or 9. I would like to ask how I can get iOS 8.


Let $g:[a,b] \rightarrow \mathbb{R}$ be continuous on the compact interval $[a,b]$. Also, assume that $g$ is differentiable on the open interval $(a,b)$. Assume that there exist a number $c \in \mathbb{R}$ so that $$g'(x) \rightarrow c$$ for $x\rightarrow a_+$. Show that $g$ is indeed differentiable in the point $a$ with $g'(a)=c$. I am having troubles with the generel cases of proving such a statement. I know that this is hinting for me to use the mean value theorem as it is continuous on the closed interval and differentiable on the open interval. But what is there to prove? Or rather how would I prove that it is differentiable? Do I have to use the direct definition of a derivative?

Let $f$ be a real-valued function continuous on $[a,b]$ and differentiable on $(a,b)$. Suppose that $\lim_{x\rightarrow a}f'(x)$ exists. Then, prove that $f$ is differentiable at $a$ and $f'(a)=\lim_{x\rightarrow a}f'(x)$.    It seems like an easy example, but a little bit tricky. I'm not sure which theorems should be used in here.    ==============================================================  Using @David Mitra's advice and @Pete L. Clark's notes I tried to solve this proof. I want to know my proof is correct or not.  By MVT, for $h>0$ and $c_h \in (a,a+h)$ $$\frac{f(a+h)-f(a)}{h}=f'(c_h)$$ and $\lim_{h \rightarrow 0^+}c_h=a$.    Then $$\lim_{h \rightarrow 0^+}\frac{f(a+h)-f(a)}{h}=\lim_{h \rightarrow 0^+}f'(c_h)=\lim_{h \rightarrow 0^+}f'(a)$$   But that's enough? I think I should show something more, but don't know what it is.


My computer is running Windows 10 Home 64-bit with 16GB RAM, however I am always running into an issue where my computer says I'm out of memory when I really shouldn't be.  Looking at Task Manager, it tells me that System and compressed memory is using the most, averaging at roughly 690MB. Going into the Performance tab, it says at least 14GB is in use, however if I were to add up everything in the Details tab, it wouldn't even get close to 14GB.     Above I have included screenshots of Task Manager's Performance tab, as well as RAMMap's main page. Is there anything I can do to drastically reduce the used memory? It's been causing funky things (like disconnecting monitors) to happen when I ignore the warnings. The only process running with high memory usage that I can see is Google Chrome.  I've looked through related questions and did my research but nothing I found really fits my case. Any help would be greatly appreciated.

I have 16GB of system RAM. On startup with no applications open except the task-manager Windows is using about 3gb of RAM. I looked in the processes tab, but nothing seems to be out of the ordinary. How can I find out why my Windows is using so much RAM.    all processes from all users      Reading from the poolmon it seems that my wireless broadcom driver is using about 0.4GB of of RAM. Even if I remove  it would still be using  2.6GB on start-up, which is still too much.      After reinstalling the wireless driver associated with the memory leak. I have a new screenshot and would like to confirm that it was indeed a memory leak.


I am trying to build linux from scratch. I ll install it into virtualbox. Later I want to extract ext2 filesystem in it. Is it possible?  EDIT: I want to extract root.ext2 filesystem in vdi, to mount it in Ubuntu desktop environment and chroot into it.  EDIT2: moderators marked my topic as duplicate but it's not duplicate of above mentioned topic at all.  I found complete answer of my question. I post the link as a reference to people who seek the same answer:

Is it possible to mount a VirtualBox drive image (.vdi) so the contents can be viewed in Nautilus etc.?  I have a windows 2000 .vdi which won't boot ("inaccessible boot device") after upgrading from VirtualBox 2.x to 3.1.6. I believe the IDE drive details have changed and that all I need to do is access the internal drive image and edit the Windows boot.ini to point to the new location.


NGINX server is under the BSD license. Does anyone know how to find information about the costs of BSD license, I mean, how much is paid to apply this license to NGINX, and how much does a user has to pay that goes to the license usage, when using NGINX (even if it's near zero cost)?

This is a  about Licensing.    Questions on licensing are off-topic on Server Fault.  If your question has been closed as a duplicate of this question, then this is because we want to help you understand why licence questions are off topic rather than just telling you "it just is". In all likelihood, this question will not address your question directly, it was not meant to.    I have a question regarding software licensing. Can the Server Fault community please help with the following:   How many licenses do I need? Is this licensing configuration valid? What CALs do I need to be properly licensed? Can I run this product in a virtual environment? Can I downgrade this product to an earlier version? Am I entitled to feature X with license Y?


How can I construct a controlled-Hadamard gate using single qubit gates and controlled phase-shift? I am stuck in this and any help would be appreciated.


Being a DB noob, I'm trying to generate SQLite statements to import records with "First_Reported" and "Last_Reported" datestamps, but can't seem to get the "First_Reported" working correctly.  I have a few years worth of scans I'm trying to import. There'll be plenty of duplicates, so I just want to update the "Last_Reported" column if the record already exists. If not, then create the record.  I've searched SO and have tried following some of the other solutions (), I just can't seem to get this right. I'm not sure if I'm going about this the wrong way, or just fat fingered something?  Any suggestions? For hundreds of thousands of rows, should I be using something else? I'm looking for efficiency and don't want something that "just works". I want to do it the "right" way.  I created the table as such;  CREATE TABLE Scan_Results (First_Reported text, Last_Reported text, Hostname text, IPAddress text, Network text, OSInformation text, DisplayPath text, TestName text, Message text, FindingObject text, FindingResult text, FindingExpr text, UNIQUE (Hostname, IPAddress, Network, OSInformation, DisplayPath, TestName, Message, FindingObject, FindingResult, FindingExpr));   And I'm trying to insert/update the rows with this;  WITH new (First_Reported, Last_Reported, Hostname, IPAddress, Network, OSInformation, DisplayPath, TestName, Message, FindingObject, FindingResult, FindingExpr) AS ( VALUES('2017-08-15', '2017-08-30', 'someHost', 'someIP', 'someNet', 'someOS', 'someDisplay', 'someTest', 'someMessage', 'someObject', 'someResult', 'someExpr') ) INSERT OR REPLACE INTO Scan_Results (First_Reported, Last_Reported, Hostname, IPAddress, Network, OSInformation, DisplayPath, TestName, Message, FindingObject, FindingResult, FindingExpr) SELECT old.First_Reported, new.Last_Reported, new.Hostname, new.IPAddress, new.Network, new.OSInformation, new.DisplayPath, new.TestName, new.Message, new.FindingObject, new.FindingResult, new.FindingExpr FROM new LEFT JOIN Scan_Results AS old ON new.Hostname = old.Hostname;

Is there some clever way to do this in SQLite that I have not thought of? Basically I want to update three out of four columns if the record exists, If it does not exists I want to INSERT the record with the default (NUL) value for the fourth column. The ID is a primary key so there will only ever be one record to UPSERT. (I am trying to avoid the overhead of SELECT in order to determine if I need to UPDATE or INSERT obviously) Suggestions?  I cannot confirm that Syntax on the SQLite site for TABLE CREATE. I have not built a demo to test it, but it doesn't seem to be supported. If it was, I have three columns so it would actually look like: CREATE TABLE table1(      id INTEGER PRIMARY KEY ON CONFLICT REPLACE,      Blob1 BLOB ON CONFLICT REPLACE,      Blob2 BLOB ON CONFLICT REPLACE,      Blob3 BLOB  );  but the first two blobs will not cause a conflict, only the ID would So I assume Blob1 and Blob2 would not be replaced (as desired)  UPDATEs in SQLite when binding data are a complete transaction, meaning Each sent row to be updated requires:  Prepare/Bind/Step/Finalize statements unlike the INSERT which allows the use of the reset function The life of a statement object goes something like this:  Create the object using sqlite3_prepare_v2() Bind values to host parameters using sqlite3_bind_ interfaces. Run the SQL by calling sqlite3_step() Reset the statement using sqlite3_reset() then go back to step 2 and repeat. Destroy the statement object using sqlite3_finalize().  UPDATE I am guessing is slow compared to INSERT, but how does it compare to SELECT using the Primary key? Perhaps I should use the select to read the 4th column (Blob3) and then use REPLACE to write a new record blending the original 4th Column with the new data for the first 3 columns?


So I'm trying to make a simple program, for the first JOptionPane Input its asking for the username, then I made an If statement that will print the word "admin" if the String that is attached to the username Input is "admin" However, It's not working and the else statement is executing every time. What am I doing wrong? import java.util.Scanner; import javax.swing.JOptionPane;  public class Shipping {      public static void main(String args[]) {         String user;         user = JOptionPane.showInputDialog ("Please enter your username ");         String pass;         pass = JOptionPane.showInputDialog ("Please enter your password ");         if (user == "admin")             System.out.println ("admin");         else             System.out.println("test");     } }

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 4 entries in my .bib file. The first time I use \cite in my article it generates [2] as the citation call-out. How can I make the first cite I use show [1] in the article?  My code is as follows:  \documentclass[a4paper, 10pt]{article} \usepackage{biblatex} \addbibresource{refbib.bib} ..... The equation is taken from \cite{A2005} and the graph from \cite{B2006}.   and in the numbering I get [1] for B2006 and [2] for A2005.

I'm facing a problem with biblatex citation order.  Using this configuration:  \documentclass {article} \usepackage[brazil]{babel} \usepackage[utf8]{inputenc} \hyphenation{es-ta-bi-li-da-de} \usepackage{setspace} \singlespacing \usepackage[natbib=true,style=numeric]{biblatex} \addbibresource{frameworks.bib}   Being frameworks.bib this:  @Article{JONHSON88, author = {Ralph Johnson, Brian Foote}, title = {Designin Reusable Classes}, journal = {Journal of Object-Oriented Programming SIGS}, year = {1988}, key = {Johnson:88}, volume = {1}, number = {5}, pages = {22-35}, month = jun }  @book{UML-F:00, author = {Fontoura M., Pree W., Rumpe B.}, editor = {Addison-Wesley}, title = {The UML Profile for Framework Architectures}, year = {2000}, }   The PDF is generated with a text like:  Something about something[4], and moo foo other children[1].   This citation [4] is the first in all text. How can I order this correctly to [1]...[2] ...?


Since 10.5 are so I have been using this command to flush the dock to the upper corner of the screen:  defaults write com.apple.dock pinning -string start ;  I can see that this is still present in the plist, but it no longer effects the dock. Anyone know if there is a way to restore pinning now?

In Mavericks and prior, one could use the following commands to pin the dock to either the top or bottom corner of the screen, if the dock was placed left/right, or to the left/right corners if the dock was placed at the bottom, by using the following commands:  defaults write com.apple.dock pinning -string start   or  defaults write com.apple.dock pinning -string end   This is followed by killall Dock to restart the Dock. Now, in Yosemite, it appears that this option has been removed. Is there no way to get back this functionality in Yosemite?  Update: This is still not possible in El Capitan. Very disappointed in Apple.


Can we connect a 12v adapter and a 12V battery in series to get a 24V output ?

Is it safe to connect a battery in series to wall via adapter?  I have an AC adapter which gives me 10 vDC from the wall (220 volts). I've measured the adapter and it outputs 10 vDC. I have a 3 volt battery. I would like to connect in series to get 13 vDC.   Is this possible? Is this safe? If not, what can go wrong?


I want to install Ubuntu on android via Ubuntu CLI. I have Mobile A910. I just want to know that if I install Ubuntu in android, and if it will not installed properly or not working properly then could I have any way to come back on android? after Ubuntu installation, could i have my android platform? or will it be ruined? after Ubuntu installation if I didn't find it useful or something else, could I have any way to reinstall my android version? will my android safe or not?

With the announcement of the Ubuntu Phone OS I'd like to know what phone (and tablet) models are supported at this time.  Note from foss & Oli: We are making this the master question for all future "Will this work on <insert random tablet/phone/device here>?!" questions


I am following this tutorial:  for changing the route from '/example' to '/example/helloworld'.  I tried following code in my example module. With '/example' it is working fine, but with '/example/helloworld' which is the new altered route it is showing page not found. Am I missing something in the following code? Thanks  In file: example.routing.yml  example.content:   path: '/example'   defaults:     _controller: '\Drupal\example\Controller\ExampleController::content'     _title: 'Hello World'   requirements:     _permission: 'access content'   In file: example.services.yml  services:   example.route_subscriber:     class: Drupal\example\Routing\RouteSubscriber   In file: RouteSubscriber.php       class RouteSubscriber extends RouteSubscriberBase {    public function alterRoutes(RouteCollection $collection){     //Change path '/example' to '/example/helloworld'.     if ($route = $collection->get('/example')){       $route->setPath('/example/helloworld');         }      }  }   File structure in module,

In other words, what is the Drupal 8 equivalent of ?  Drupal 8 still uses hook_menu(), but for what I can see, the information returned by the hook is different from what the hook returned in Drupal 7. For example, the definition given in user_menu() for user is the following.    $items['user'] = array(     'title' => 'User account',     'title callback' => 'user_menu_title',     'weight' => -10,     'route_name' => 'user_page',     'menu_name' => 'account',   );   The route_name property links to an entry in the  file.  user_page:   pattern: '/user'   defaults:     _content: '\Drupal\user\Controller\UserController::userPage'   requirements:     _access: 'TRUE'   This is different from what done with Symphony, and it confuses me about how a module can alter the route defined from another user.  The only function that is still invoking hook_menu_alter() is menu_router_build(), but that function still contains code that needs to be updated, since it is still using the now deprecated drupal_alter().    // Alter the menu as defined in modules, keys are like user/%user.   drupal_alter('menu', $callbacks);   foreach ($callbacks as $path => $router_item) {     // If the menu item is a default local task and incorrectly references a     // route, remove it.     // @todo This may be removed later depending on the outcome of     // http://drupal.org/node/1889790     if (isset($router_item['type']) && $router_item['type'] == MENU_DEFAULT_LOCAL_TASK) {       unset($callbacks[$path]['route_name']);     }     // If the menu item references a route, normalize the route information     // into the old structure. Note that routes are keyed by name, not path,     // so the path of the route takes precedence.     if (isset($router_item['route_name'])) {       $router_item['page callback'] = 'USES_ROUTE';       $router_item['access callback'] = TRUE;       $new_path = _menu_router_translate_route($router_item['route_name']);        unset($callbacks[$path]);       $callbacks[$new_path] = $router_item;     }   }


As it is described in standard textbooks I looked at, the Maxwell equations were first established for electromagnetic fields created by electric currents. Then it is stated that it was discovered experimentally (by Kohlrausch and Weber) that the electric constant in these equations equals the speed of light. From that it is concluded that the visible light is a special case of electromagnetic field.  Thus it satisfies the Maxwell equations.  Unless I miss something, it seems to me that the last conclusion is a too strong conclusion of the fact of coincidence of the speeds of propagation of light and of EM wave. Is there a more direct verification that the visible light satisfies the Maxwell equations?

Do we have any experimental evidence to confirm that light is an electromagnetic wave? Or is it confirmed simply by Maxwell's equations showing a similarity in speed?


This seems to be pretty simple, but I have been stucked here for a couple of hours.  I have a doubt when you have to compare two Strings in Java.  if I just do something like this:  String var1 = "hello"; String var2 = "hello";   and then compare these two words in another function, the result will clearly be true.  But the problem is when I have to compare two words that come from an input. Here is my code:  import java.util.Scanner;  public class Compare{  public static void main(String[] args){     Scanner Scanner = new Scanner (System.in);      System.out.println("Enter first word: ");     String var1 = Scanner.nextLine();      System.out.println("Enter second word: ");     String var2 = Scanner.nextLine();      if (same (var1, var2))         System.out.println("Yes");     else         System.out.println("No"); }  public static boolean same (String var1, String var2){     if (var1 == var2)         return true;             else         return false; }   }   I have tried several times (clearly entering the same word) and the result is always False.  I don't know why this happens. What am I missing?  This is my first time in Java. I will appreciate any kind of help. Thanks


I wrote a small software in Python, and I'd like to keep it secure. Of course I know it's the wrong language, but at the moment I cannot rewrite it. The small program will run under a linux box. Eventually I can turn to windows if it's easier to achieve my goal. I'd like to avoid users to unplug the disk and connect to another PC to download the file. In this case I think a crypted partition could be my case, with TPM, or maybe a secure usb key? If a user can have access to the pc, is there a way to let him not read the py files? Like encrypt them but still able to run it, as example with a usb secure key?  thank you   UPDATE/CLOSE I write an update even if the case is closed because it could be useful for someone, I'm using Python 2.7 with Pyglet framework, and with pyinstaller under linux it worked like a charm

I am developing a piece of software in Python that will be distributed to my employer's customers. My employer wants to limit the usage of the software with a time restricted license file. If we distribute the .py files or even .pyc files it will be easy to (decompile and) remove the code that checks the license file. Another aspect is that my employer does not want the code to be read by our customers, fearing that the code may be stolen or at least the "novel ideas". Is there a good way to handle this problem?


I am trying to code a Java program to calculate the number of pages for PDF files. But when I run this program I get an error which I am not sure why.   This is the error:   Exception in thread "main" java.lang.NullPointerException at pdfpagecount.Pdfpagecount.main(Pdfpagecount.java:12)   Here is the code that produces the error:  package pdfpagecount;  import java.io.File; import java.io.FileInputStream; import com.lowagie.text.pdf.PdfReader;  public class Pdfpagecount {  public static void main(String[] args) {     File gopi = new File("C:\\Users\\Gopinath Muruti\\Desktop\\test.pdf");     File listOfFile[] = gopi.listFiles();     for(int i = 0; i < listOfFile.length; i++) {         File tempFile = listOfFile[i];         String fileName = tempFile.getName();         System.out.println("File Name = " + fileName);         try {             if(fileName.toLowerCase().indexOf(".pdf") != -1) {                 PdfReader document = new PdfReader(new FileInputStream(new File("filename")));                 int noPages = document.getNumberOfPages();                 System.out.println("Number of Pages in the PDF document is = " + noPages);             }         }         catch(Exception e) {             System.out.println("Exception : " + e.getMessage());             e.printStackTrace();         }     } } }

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?