I could not/ can not ask for more when i've been with my best buddy for such a long time.
When should I use can? When should I use could? What is right under what context?
Windows 8.1 missing font files after restart Some days ago I rebooted my windows 8.1 system. After the reboot all my system texts were very cryptic - showing only some strange symbols. After some investigation I discovered that my c:\windows\fonts folder was nearly empty. So I copied the font files from another windows 8.1 installation to the nearly empty folder. As soon as I had copied the files the system texts were readable again.  But after another reboot the problem occured again - the systems font folder was empty again. Does anyone know why windows deletes my font files during a restart? How can I use text-processing tools to insert a new line after every N lines?  Example for N=2:  INPUT:   sadf asdf yxcv cxv eqrt asdf   OUTPUT:   sadf asdf  yxcv cxv  eqrt asdf Horn and spindle tori What's the best way to store class variables in PHP? I currently have my PHP class variables set up like this:  class someThing {      private $cat;     private $dog;     private $mouse;     private $hamster;     private $zebra;     private $lion;      //getters, setters and other methods }   But I've also seen people using a single array to store all the variables:  class someThing {      private $data = array();      //getters, setters and other methods }   Which do you use, and why? What are the advantages and disadvantages of each? Possible to click on an object in the viewport and the object list hierarchy automatically goes to that object also? Replace a long string with the sed command: Argument list too long error I'm trying to execute this command  sed -i -e "s/BASE_64/$BASE_64/" FILE_NAME   where $BASE_64 is a base 64 representation of a file content.  sed gives me an error since the string is too long.     Argument list too long   How is it possible to avoid this error? How do I find out which process is locking a file using .NET? Converting a pointer into an integer I am trying to adapt an existing code to a 64 bit machine. The main problem is that in one function, the previous coder uses a void* argument that is converted into suitable type in the function itself. A short example:  void function(MESSAGE_ID id, void* param) {     if(id == FOO) {         int real_param = (int)param;         // ...     } }   Of course, on a 64 bit machine, I get the error:  error: cast from 'void*' to 'int' loses precision   I would like to correct this so that it still works on a 32 bit machine and as cleanly as possible. Any idea ? I've looked at the resumes of the type of candidates that get into computer science PhD programs at the top few universities (e.g. Stanford, MIT etc.) and a lot of them seem to have multiple publications (2-4) done during their undergraduate years. Is this representative of the entire pool? Or is this just a self-selected group that puts their resumes online.  I currently have one first-author workshop paper (5 pages), and I wonder how this might affect my chances at entry into these top universities. I might want to answer my own question because:  I arrived at a solution before there were any other correct answers or I like mine better, can I still answer my own question?  I have a folder with lists of code snippets for things I always forget or get wrong, such as regular expressions for processing XML, common WinForms control idioms, etc. Is it considered poor etiquette for Stack Overflow to ask a question I already know the answer to, and then self answer, just so it gets recorded on the website?   Related:          For more information, see &quot;&quot; in the . How to get file creation & modification date/times in Python? I have a script that needs to do some stuff based on file creation &amp; modification dates but has to run on Linux &amp; Windows.  What's the best cross-platform way to get file creation &amp; modification date/times in Python? Newton's third law does not apply to the kinetic energy formula? Here is a classic problem:     A 60kg boy and a 40kg girl are sitting in front of each other on skateboards on a frictionless horizontal surface. The boy pushes the girl and the girl gains a velocity of 0.3m/s during the 0.5s the boys hand was in contact with her. What is the boy's resulting velocity?   Considering Newton's Third Law, the best way is to find the total force applied and rearrange the formula to find the boy's speed.  Newton's Law Method:  $F = m*a$  $a=\frac{0.3m/s}{0.5s}$  $F = 40kg * 0.6m/s^2$  $F = 24N$  Therefore the boy's speed will be:   $\frac{24N}{60kg} = a$  $a = 0.4m/s^2$  $v = 0.4m/s^2 * 0.5s$  $v = 0.2m/s$  Kinetic Energy Method:  $E_{k}=\frac{1}{2}*m*v^2$ the girl's kinetic energy  $E_{k}=\frac{1}{2}*40kg*(0.3m/s)^2$  $E_{k}=1.8J$  Since every action has an equal and opposite reaction the boy should have the same amount of kinetic energy.  $E_{k}=\frac{1}{2}*60kg*(0.2m/s)^2$  $E_{k}=1.2J$  As you can see, using Newton's Third Law, the kinetic energy was not the same. So what's going on here? I thought that in this case they should both have the same amount of kinetic energy due to Newton's Law. I must be missing something since there is more energy going in one direction than the other after meeting. My book used the first method as the answer and, well, it feels wrong. says the following:     Saving an OS can be achieved by running sudo grub-set-default if   DEFAULT=saved is set in /etc/default/grub. It may also be saved if   GRUB_SAVEDEFAULT=true is also set in /etc/default/grub. In this case,   the default OS remains until a new OS is manually selected    from the   GRUB 2 menu or the grub-set-default command is executed.   I put the lines DEFAULT=saved AND GRUB_SAVEDEFAULT=true in /etc/default/grub, and ran sudo grub-set-default.  Here is the output:  $ sudo grub-set-default entry not specified. Usage: grub-set-default [OPTION] entry Set the default boot entry for GRUB.    -h, --help              print this message and exit   -v, --version           print the version information and exit   --boot-directory=DIR    expect GRUB images under the directory DIR/grub                           instead of the /boot/grub directory  ENTRY is a number or a menu item title.  Report bugs to &lt;bug-grub@gnu.org&gt;.   Am I not following the documentation correctly?  What's the correct way to do this? I have put his on wolfram and obtained answer as follows:  $\sum_{n=1}^{\infty}\frac{n}{2^n} = 2$  And the series is convergent too because $\lim_{n\to\infty} \frac {n}{2^n} = 0$  However I am wondering if there is a convenient way to solve this; I don't think you can represent it by a geometric progression either. So how do we have to do it on paper? If $A=AB-BA$, is $A$ nilpotent? Let matrix $A_{n\times n}$, be such that there exists a matrix $B$ for which $$AB-BA=A$$  Prove or disprove that there exists $m\in \mathbb N^{+}$such  $$A^m=0,$$  I know $$tr(A)=tr(AB)-tr(BA)=0$$ then I can't.Thank you I have some thoughts on this. First, I want to say I am no expert on cryptography, I just know some stuff, and I took a cryptography class in University. I am very interested in this topic.  I understand that many security experts out there might get angry just by the discussion of these things, but I hope you can spare me :)  My Questions:  Would it be possible to break an RSA key, in for example 1 week of time, if the cracker have already spent X number of years building an index of primes by performing every permutation of existing prime keys up to 2^2048 ?  I understand this would take an immense amount of time to do, but it would only be done once.  Given the public key, you would be able to look up what the two primes are, and hence retrieve the private key instantly.  When I consider who might break such a code, I am primarily thinking about NSA and other Governments that might have spent years in research and have the resources and interest in doing so.  Breaking an 256 AES would then be easier, as AES keys are often generated using the RSA private key.  Would it be possible to build such an index ? How long would that take in permutations, and perhaps with the fastest computer in the world ?  I hope we can have a nice chat about this. We are just discussion theory here. I hope you can offer me some insight on this topic.  Thanks! If $\gcd (a,b) = 1$, what can be said about $\gcd (a+b,a-b)$? Upon system restart, dconf editor doesn't save changes I can use the dconf-editor to change my touchpad settings to natural scrolling, but upon system restart the settings get reverted. (But not on sleep or hibernate.) When I open the editor, the option is still orange indicating it has been changed. when I uncheck and recheck the natural scroll option, it is re-enabled. Is there a fix, or am I changing the wrong option? The path is org > gnome > settings-daemon > peripherals > touchpad > natural-scroll.  Currently running 13.10 Dual edge detector I am designing a hobby project that will run on a battery so I am trying to reduce power consumption. The SoC I am using has the ability to go into a deep sleep mode where it consumes very little power, and then can be interrupted by a falling edge on a pin.  I want to generate a high-low-high pulse when the state of a reed switch changes in either direction. I have been reading a lot and it seems that a one-shot monostable circuit can be built from a couple of transistors and an RC circuit to generate an output pulse when an edge is detected. I understand how that works. However, I can't figure out the best way to also pulse on the opposite edge.  One thought, was to just combine two one-shots that are configured to trigger on rising and falling edges respectively, and use the transistors at the output to pull the common pull-up low (kind of like a NOR gate).  Since I am a hobbyist, I am mostly using passive components. What is the "real" way of doing this in a low-power configuration using logic devices?  Edit: I figure I should mention something about the timing requirements. Normally the reed switch will be either open or closed for many seconds at minimum before changing states.  Edit: Here is an example of the circuit I was using for detecting only the falling edge:    And here is the ~20ms pulse it was producing for ~200ms button press simulating the reed switch (Channel 1 is Vbe for T1 and Channel 2 is measured at RST): How to capture Control+D signal?