How to use PHP to delete X number of lines from the beginning of a text file?

I'm writing a PHP script and the script outputs a simple text file log of the operations it performs.  How would I use PHP to delete the first several lines from this file when it reaches a certain file size?  Ideally, I would like it to keep the first two lines (date/time created and blank) and start deleting from line 3 and delete X amount of lines.  I already know about the filesize() function, so I'll be using that to check the file size.  Example log text:  *** LOG FILE CREATED ON 2008-10-18 AT 03:06:29 ***  2008-10-18 @ 03:06:29  CREATED: gallery/thumbs 2008-10-18 @ 03:08:03  RENAMED: gallery/IMG_9423.JPG to gallery/IMG_9423.jpg 2008-10-18 @ 03:08:03  RENAMED: gallery/IMG_9188.JPG to gallery/IMG_9188.jpg 2008-10-18 @ 03:08:03  RENAMED: gallery/IMG_9236.JPG to gallery/IMG_9236.jpg 2008-10-18 @ 03:08:03  RENAMED: gallery/IMG_9228.JPG to gallery/IMG_9228.jpg 2008-10-18 @ 03:08:03  RENAMED: gallery/IMG_3104.JPG to gallery/IMG_3104.jpg 2008-10-18 @ 03:08:03  RENAMED: gallery/First dance02.JPG to gallery/First dance02.jpg 2008-10-18 @ 03:08:03  RENAMED: gallery/BandG02.JPG to gallery/BandG02.jpg 2008-10-18 @ 03:08:03  RENAMED: gallery/official03.JPG to gallery/official03.jpg 2008-10-18 @ 03:08:03  RENAMED: gallery/Wedding32.JPG to gallery/Wedding32.jpg 2008-10-18 @ 03:08:03  RENAMED: gallery/Gettaway car16.JPG to gallery/Gettaway car16.jpg 2008-10-18 @ 03:08:04  CREATED: gallery/thumbs/Afterparty05.jpg 2008-10-18 @ 03:08:04  CREATED: gallery/thumbs/IMG_9254.jpg 2008-10-18 @ 03:08:04  CREATED: gallery/thumbs/IMG_9175.jpg 2008-10-18 @ 03:08:04  CREATED: gallery/thumbs/official05.jpg 2008-10-18 @ 03:08:04  CREATED: gallery/thumbs/First dance01.jpg 2008-10-18 @ 03:08:04  CREATED: gallery/thumbs/Wedding29.jpg 2008-10-18 @ 03:08:04  CREATED: gallery/thumbs/men walking.jpg


Can I set the default view to Page Width?

The default is to open up with up to four whole pages showing with tiny text.  Can I change the default view/zoom to be Page Width instead?


R daisy - Gower distance, different values with different number of observations

I have a mixed data set where I want to compute distances between observations with Gower in R (daisy function). When I compute distances between different number of observations, the distances seem to change, and I don't fully understand why that is. I assume it's some weights for the observations being used, but I can't find anything explaining this from the documentation  library(cluster) daisy(iris[1:3,], metric = "gower") #Distance between object 1&2 is 0.30 daisy(iris[1:4,], metric = "gower") #Now the distance between object 1&2 is 0.28  Does anyone know why this happens?  Thanks


NullPointerException in TreeSet when removeAll()

From the docs of :     Throws: NullPointerException - if this collection contains one or more    null elements and the specified collection does not support    null elements (optional), or if the specified collection is null.   But the code below does still throw a :  public class TestSet {      public static void main(String[] args) {          Set set1 = new TreeSet();          set1.add("A");          set1.add("B");          Set set2 = new HashSet();          set2.add(null);          set1.removeAll(set2);      }  }    Can someone help me understand this behavior?


What is the word or term used to describe a person who intentionally ignores a rule/regulation/order

There is a girl in my lab who, despite having been corrected numerous times in the past, continues to disregard the lab procedures regarding chain of command. She constantly goes over supervisors' heads, stepping far out of line and creating somewhat major problems.   She is a snobbish type with an aura of undeserved superiority and arrogance that borders on a personality disorder and, if I were better read, I would have a much grander metaphoric comparison for her inflated sense of self worth. She is unwilling, or simply unable, to admit her mistakes and has an excuse or response at the ready for any and every question/action/accusation that comes her way.  Anyway, she did it again this morning and I have been obsessed over finding a word that accurately describes this behavior of intentionally ignoring and disregarding her position and the rules set forth. I feel like it's on the tip of my tongue and that I know the word, but just can't remember.  Any ideas?


What's the "standard" way to express a zero/null morpheme in an interlinear gloss in LaTeX?

I'm interested in what the "norm" is for the field.  I tried both  $\oslash$ and $\emptyset$, but neither looks normal... or maybe I'm over thinking this.  Is there a standard in linguistics publications?  e.g.


Javascript switch statement nested inside If statement cannot access other variables and returns Unidentified

I am working on a Rock/Paper/Scissors game like as usual. Somehow my if and switch statements cannot read the values set by the other two functions and when I console.log result it returns undefined However when I manually set user and computer variables decideWinner function works as intended. I've been tinkering with it for a couple of hours and some help would be greatly appreciated. Thanks.   let user let computer let result //1 function userChoice() {   let user = prompt(`rock, paper, scissors`) }  //2 function computersTurn() {   let randomNumber = Math.floor((Math.random() * 3) + 1);   switch (randomNumber) {     case 1:       computer = `rock`;       break;     case 2:       computer = `scissors`;       break;     case 3:       computer = `paper`;       break;   } }  //3 function decideWinner() {   if (user == `rock`) {     switch (computer) {       case `rock`:         result = `tie`         break;       case 'scissors':         result = `player`         break;       case `paper`:         result = `computer`         break;     }   } else if (user == `paper`) {     switch (computer) {       case `rock`:         result = `player`         break;       case 'scissors':         result = `computer`         break;       case `paper`:         result = `tie`         break;     }   } else if (user == `scissors`) {     switch (computer) {       case `rock`:         result = `computer`         break;       case 'scissors':         result = `tie`         break;       case `paper`:         result = `player`         break;     }   } }  userChoice(); computersTurn(); decideWinner(); console.log(result);


How do I change my boot animation back to the default after install of Lubuntu-desktop?

I am not talking about the login screen.  has helped me fix that.  I am talking about the initial start up screen with incrementing anticipation dots during the boot. It says Lubuntu instead of Ubuntu. I'd like it to say Ubuntu if possible.  Where is this config file stored?  This is the screen I want to modify:


I'm having some trouble figuring out how to use more than one left outer join using LINQ to SQL.  I understand how to use one left outer join.  I'm using VB.NET.  Below is my SQL syntax.  T-SQL  SELECT     o.OrderNumber,     v.VendorName,     s.StatusName FROM     Orders o LEFT OUTER JOIN Vendors v ON     v.Id = o.VendorId LEFT OUTER JOIN Status s ON     s.Id = o.StatusId WHERE     o.OrderNumber >= 100000 AND     o.OrderNumber <= 200000


Decrypting Encrypted Micro SD Card without phone

Since the release of the new Android version, has anyone had any success with decrypting the contents of a Micro SD card without the use of the phone?  I want to encrypt my card incase I lose the phone. However, I also don't want to be in a situation where something could happen and I am left with no way to retrieve contents from the SD card.


getting Checkpoint VPN SSL Network Extender working in the command line

The official Checkpoint out command line tool from CheckPoint, for setting up a SSL Network Extender VPN is not longer working from the Linux command line. It is also no longer actively supported by CheckPoint.  However, there is a promising  project, that tries to replicate the Java applet for authentication, that talks with the snx command line utility, called snxconnect.   I was trying to put snxconnect text utility to work in Debian Buster, doing:  sudo pip install snxvpn   and  export PYTHONHTTPSVERIFY=0 snxconnect -H checkpoint.hostname -U USER    However, it was mostly dying either with an HTTP error of:   HTTP/1.1 301 Moved Permanently:   or:  Got HTTP response: HTTP/1.1 302 Found   or:  Unexpected response, try again.   What to do about it?  PS. The EndPoint Security VPN official client is working well both in a Mac High Sierra and Windows 10 Pro.


Pgfplots with gnuplot - list of coordinates, not file

I want to do a simple graph, where its points will be assigned by a list (NOT a file) of coordinates.  So, I know, that I can do something like this:  \addplot gnuplot [raw gnuplot, color=blue]{plot "test.dat" };   But I need to use it like this:  \addplot gnuplot [raw gnuplot, color=blue]{plot { (0,0)(1,5)(10,12) } };   It looks pretty easy, but I'm somehow not able to find a single mention of using Pgfplots with gnuplot like this.  So, is it even possible to use it like that? And if it is, then how?


Is there anything that can let me run 64bit binary executable files?

Is there anything in ubuntu 32 bit 14.04LTS something light, that will let me execute 64 bit binary executable files?  Architecture:          i686 CPU op-mode(s):        32-bit, 64-bit Byte Order:            Little Endian CPU(s):                4 On-line CPU(s) list:   0-3 Thread(s) per core:    2 Core(s) per socket:    2 Socket(s):             1 Vendor ID:             GenuineIntel CPU family:            6 Model:                 42 Stepping:              7 CPU MHz:               800.000 BogoMIPS:              4988.76 Virtualisation:        VT-x L1d cache:             32K L1i cache:             32K L2 cache:              256K L3 cache:              3072K


Tangents are drawn from the point $(\alpha,\beta)$ to the hyperbola $3x^2-2y^2=6$ and are inclined at angles $\theta$ and $\phi$ to the $x-$axis.If $\tan\theta.\tan\phi=2,$ prove that $\beta^2=2\alpha^2-7$    The equation of the pair of tangents from the point $(\alpha,\beta)$ to the hyperbola $3x^2-2y^2=6$ is given by $(3x\alpha-2y\beta-6)^2=(3x^2-2y^2-6)(3\alpha^2-2\beta^2-6)$ When i simplify this expression,i get $(18+6\beta^2)x^2+(6\alpha^2-12)y^2-12xy\alpha\beta+24y\beta-36x\alpha+18\alpha^2-12\beta^2=0$ This is an equation of pair of lines and the angle between pair of lines $ax^2+2hxy+by^2=0$ is given by the formula $\frac{2\sqrt{h^2-ab}}{a+b}$ So $\tan(\theta-\phi)=\frac{2\sqrt{36\alpha^2\beta^2-(18+6\beta^2)(6\alpha^2-12)}}{18+6\beta^2+6\alpha^2-12}$ $\frac{\tan\theta-\tan\phi}{1+\tan\theta\tan\phi}=\frac{2\sqrt{\alpha^2\beta^2-(3+\beta^2)(\alpha^2-2)}}{1+\beta^2+\alpha^2}$ $\frac{\tan\theta-\tan\phi}{3}=\frac{2\sqrt{\alpha^2\beta^2-(3+\beta^2)(\alpha^2-2)}}{1+\beta^2+\alpha^2}$ I am stuck here.I do not know,how to prove it further.


how to enable GPU option in user preferences

i was searching online tips to speed up the time of rendering, and i've found one screenshot which is like this   but in my case there is no option of GPU in the compute device section, have a look at my screenshot    am i missing any hardware ?


If $n$ elements generate a free module of rank $n$, are they necessarily linearly independent?

Let $A$ be a nonzero commutative ring with $1$, and $n$ a positive integer. If $b_1,\ldots,b_n\in A^n$ generate $A^n$ as an $A$-module, is it true that $b_1,\ldots,b_n$ are linearly independent over $A$ (hence a basis)? I suspect this is true (It is true if $n=1$), but I can't seem to prove it.  I guess an equivalent way of asking this question is: if a linear map $A^n\to A^n$ is surjective, is it necessarily injective?  Any help is welcome!


Why do meteors have different impact velocities?

What explains the difference in impact velocity of meteors if they all come from roughly the same distance from the Sun (Asteriod Belt) ? I know the velocity of the Earth itself factors in, but is there anything else?


What happens when a vampire cast Mirror Image?

According to the Monster Manual a variant Vampire spell caster can cast the Mirror Image spell. If vampires aren't reflected in mirrors and other reflective surfaces how would the vampire know how his or her mirror image should look?


How can I determine about a command, that which package provides it, using the command line?

Let's say, I have a command for which I want to know the source code. For example: unity-webapps-runner. I know which unity-webapps-runner tells me where to find, but how to find out with apt-cache that which package installed the binary, so I can run apt-get source <pkg-name>?


Does a Magic Staff count as a magic weapon?

Many creatures have resistance to weapons that aren't "magic weapons".  A Magic Staff can be used as a quarterstaff, but (usually) doesn't have a bonus to hit (a "plus").  Is it considered a Magic Weapon for the purpose of damage resistance?


Shrink windows partition and expand linux partition

So i have these partitions on my drive, i would like to shrink down sda1 to increase sda5. How could i do that?  If i reduce sda1 it does not give me options to increase sda5


I cannot prove that if $f(x)$ is convex on $[a,b]$ then  $f\Big(\frac{a+b}2\Big) \le \frac1{b-a}\int_a^b f(x)\,dx \le \frac{f(a)+f(b)}2 .$


How to use Pattern to check if a string matches any numerals in I, II, III, IV, V

If I have a string a = I,II,III,IV,V,VI,VII,VIII  How can I use pattern to check if my input string matches any of these roman numbers?  Or is there any easier way to do so?


How can I highlight certain words in minted with different colors?

I would like to highlight some specific words inside the minted environment when using beamer.   \documentclass[14pt]{beamer} \usepackage{minted}  \begin{document}  \begin{frame}[fragile]{} \begin{figure} \centering \begin{minted}[mathescape,            gobble=2,            linenos,            fontsize=\tiny,            framesep=2mm]{ocaml}   let process il =     let module IV = Instr_visitor in     let visit i t = instrument i t in     IV.map_instr IU.is_mem_write visit il     |> insert_instr_list BEFORE !il_update \end{minted} \end{figure} \end{frame}  \end{document}   For example, for the code below, I would like to highlight the visit at line four and three using red color. I know the solution in lstlisting, but still, I cannot find a solution towards minted environment, could anyone help me on that? Thank you.


How to get DEFER or ASYNC attribute to appear when I add a stylesheet with wp_enqueue_style from a plugin?

Almost all of my CSS and JS resources can be postponed with an ASYNC or DEFER tag added to the resource. This may improve performance of my page load times considerably. However, I don't know how to specify these attributes to be added to the HEAD when wp_enqueue_style() takes care of adding them. It doesn't seem like wp_enqueue_script() takes a parameter for extra attributes. Is there another way?


I got a file contains two lines:  aaaaa bbbbb   I used these lines to read each lines:      File f=new File("D:\\xxx.dat");     FileReader fr = new FileReader(f);     BufferedReader br = new BufferedReader(fr);     String str;     String tmpp="";     while ((str = br.readLine()) != null) {          if(str=="bbbbb")          {          System.out.print(str);          }     }   but I got nothing as a result.why?


Two piece of gold are contained in two same-looking black boxes respectively. It is known that one piece weights twice as the other, but do not know which is which.    Two persons, say A and B, randomly choose a box. One person, say A, opened his box, but he does not known whether it is lighter or weightier.   Question: Is A willing to exchange his box with B?  This might be a well-known problem, but I do not know the proper name to search it online.   Intuitive, it make no difference to exchange the boxes.  On the other hand, if we compute the expectation for A, it seems that A should change the box (the expectation is 1.25 of the current holding).  I would like to hear your answer to the question and preferably fuller story about this paradox.


How to resolve merge conflicts in Git repository?

I want to resolve merge conflicts in my Git repository. How to do that ?


Applied Combinatorics Question on arrangements

How many ways are there to distribute seven distinct apples and six distinct pears to three distinct people such that each person has at least one pear?  I'm having trouble with this problem because it is not the same as the first part that asks how many ways if the apples and pears are identical.   I have tried several different approaches that have proven to be unsuccessful and I could really use some help. Thanks in advance!


What are the similarities and non-similarities between a module and vector space?

I know that there is definitely module and vector space these two objects are similar. see the quotation below:      A module is abstractly very similar to a vector space, although in modules, coefficients are taken in rings that are much more general algebraic objects than the fields used in vector spaces. A module taking its coefficients in a ring is called a module over , or a R-module.   Question 1: I did not understand the meaning of line "general algebraic objects " in the above paragraph.  Question 2: What are other things that are similar or not similar  between module and vectors space in terms of geometry?


I'm not in Adventure Mode, but I must use the right tools to destroy blocks. It does it at some points while I am playing, and then it stays like that and don't know why. Does anyone know what i am on about?


Is it correct to say "The reason is because ..."?

In a statement like     The weeds have grown overnight. The reason is because it rained yesterday   Is "the reason is because" good grammar? Isn't it better to say     The weeds have grown overnight because it rained yesterday   The second form seems simpler and the words the reason is seem to add nothing to the sentence. Is there any technical reason to avoid the longer form?


What is the physical reason why liquids are less compressible than gases?

Why can't we compress liquids when we could compress gases. My basic idea is that the bonds in liquids are not elastic. So please explain this.


I'm trying to convert a string into a double but my double gets cut off at the 3rd decimal point.  My string looks like this: "-122.39381636393" After it gets converted it looks like this: -122.394  void setLongitude(string longitude){     this->longitude = (double)atof(longitude.c_str());      cout << "got longitude: " << longitude << endl;     cout << "setting longitude: " << this->longitude << endl; }   Output example:   got longitude: -122.39381636393 setting longitude: -122.394   I want it to maintain all the decimal points, any tips?


How can I debug frequent unrecoverable freezes?

My new XPS 13 (9360 with KabyLake processor) with Ubuntu 16.04 pre-installed frequently freezes completely without any apparent reason.  The freezes occur seemingly randomly. Sometimes the mouse pointer can still be moved for few seconds but eventually the system completely locks up. I am unable to switch to virtual terminals and not even SysRq codes seem to have any effect. All I can do is long press the power button for a hard power off after which the system boots normally.  User processes running are mostly several Chrome tabs and a terminal.  Things I have checked and tried include:   Verify latest BIOS is installed Run diagnostics included in DELL BIOS without any results Reinstall the system from the recovery image   Disable wifi and bluetooth   After doing so the freezes still occur.  Now I am at a loss. My question thus is:  What are ways to find the cause of the issue?


What is the potential difference across a disconnected diode?

I think potential difference across disconnected diode should be zero but how?   the last graph tells that there is a potential difference between the two ends of a diode. then how can be it zero?


I am studying Automata theory.I am little confuse in How to problem is in P or NP complete problems. I did not know understand whether P = NP ? can someone clear my confusion about these problems.


Modular Arithmetic - Find the Square Root

Okay so I am in college and in the notes it shows this example:  // Example: Compute the square root of 3 modulo 143  3 modulo 143 = 3 mod (11*13)  Then he jumps to this:   √3 (mod 11) = ± 5  √3 (mod 13) = ± 4  Using the Chinese Remainder Theorem, we can calculate the four square roots as 82, 126, 17 and 61.  //  The lecturer never makes anything clear even though it is our first encounter with module arithmetic. I don't know were the 4 or the 5 come from or the √3 . Can anyone explain to be how he got  √3 (mod 11) = ± 5  √3 (mod 13) = ± 4   And also how does he use this information in conjunction with the Chinese Remainder Theorem arrive at the square roots. I would really appreciate if anyone could help me out here


I am not talking about mirrors, just a plain window made of glass like material. Would it be possible to allow light pass only in one direction but not the other?


Here is a long list of packages that have been kept back:  The following packages have been kept back:   aptdaemon fcitx-frontend-qt5 gir1.2-packagekitglib-1.0 kde-style-breeze     kde-style-breeze-qt4 libfcitx-qt5-1 libkf5archive5 libkf5auth-data     libkf5auth5 libkf5codecs-data libkf5codecs5 libkf5config-data     libkf5configcore5 libkf5configgui5 libkf5configwidgets-data     libkf5configwidgets5 libkf5coreaddons-data libkf5coreaddons5     libkf5guiaddons5 libkf5i18n-data libkf5i18n5 libkf5iconthemes-data     libkf5iconthemes5 libkf5itemviews-data libkf5itemviews5 libkf5style5     libkf5widgetsaddons-data libkf5widgetsaddons5 libkf5windowsystem-data  libkf5windowsystem5 libqt4-dbus libqt4-dbus:i386 libqt4-declarative     libqt4-declarative:i386 libqt4-designer libqt4-network libqt4-network:i386   libqt4-opengl libqt4-opengl:i386 libqt4-qt3support libqt4-script   libqt4-script:i386 libqt4-sql libqt4-sql:i386 libqt4-sql-mysql:i386   libqt4-sql-sqlite libqt4-svg libqt4-xml libqt4-xml:i386 libqt4-xmlpatterns     libqt4-xmlpatterns:i386 libqt5core5a libqt5dbus5 libqt5gui5     libqt5multimedia5 libqt5network5 libqt5opengl5 libqt5positioning5     libqt5printsupport5 libqt5qml5 libqt5quick5 libqt5quicktest5 libqt5script5   libqt5sql5 libqt5sql5-mysql libqt5sql5-sqlite libqt5svg5 libqt5test5   libqt5webkit5 libqt5widgets5 libqt5x11extras5 libqt5xml5 libqtcore4   libqtcore4:i386 libqtdbus4 libqtdbus4:i386 libqtgui4 libqtgui4:i386   python-aptdaemon python-aptdaemon.gtk3widgets python3-aptdaemon     python3-aptdaemon.gtk3widgets qdbus qml-module-qt-labs-folderlistmodel qml-module-qt-labs-settings qml-module-qtgraphicaleffects     qml-module-qtquick-layouts qml-module-qtquick-window2 qml-module-qtquick2   qml-module-qttest qml-module-qtwebkit qmlscene qtchooser   qtdeclarative5-dev-tools 0 upgraded, 0 newly installed, 0  to remove and 94 not upgraded.   I've tried to run this shell script that I made to remove broken packages, but i could not remove any at all:  grep Broken /var/log/dist-upgrade/apt.log | cut -d\   -f2 | while read -r package ; do     echo "Processing $package"     sudo dpkg --remove --force-remove-reinstreq $package     sudo apt-get update done


Under what rule of usage does this semicolon in the example sentence fall?

I noticed the following sentence, taken from Mark Twain's "The Awful German Language:"     Fifthly, I would do away with those long compounded words; or require the speaker to deliver them in sections, with intermissions for refreshments.   What is the grammatical function of the semicolon here? I would have expected a comma to be appropriate here, as to me it coordinates a dependent clause, and that would be solely under the jurisdiction of a comma, as I understood.   I thought semicolons were for replacing conjunctions between independent clauses or avoiding confusion with commas when writing a list that requires commas for one of the points within.  Thank you!


I'm working on a server and when a player joins i want it to say their name. I'm pretty good with commands so you don't have to give me a full command. just in case here is command:    /tellraw @p[count=1,y=~1,x=~,z=~,rm=1,r=2] ["",{"text":"[","color":"dark_blue"},{"text":"~","color":"blue"},{"text":"] ","color":"dark_blue"},{"text":"Welcome ","color":"green"},{"text":"[PlayerNameHere]","color":"red"},{"text":", To [Undecided]!","color":"aqua"},{"text":"\n"},{"text":"[","color":"dark_blue"},{"text":"~","color":"blue"},{"text":"] ","color":"dark_blue"},{"text":"[PlayerNameHere] ","color":"red"},{"text":"You must be new! ","color":"aqua"},{"text":"*Click Here*","color":"aqua","clickEvent":{"action":"run_command","value":"/tellraw @a {\"text\":\"Signed In As: {PlayerNameHere} Password:[Random], Do not forget\"}"}},{"text":" To sign Up!","color":"aqua"}]


The use of the commutators in quantum mechanics: explanations

Considering that I've never studied quantum mechanics before I have need to understand the operator commutator. My start is: $[A,B]=AB-BA \tag{a}$  Now, why must be  $$\left[\frac{\partial }{\partial x},x\right]\stackrel{?}{=}1 \tag{1}$$ I have thought, from the rule (a),  This identity  $$\left[x,\frac{\partial }{\partial x}\right]=-1 \tag{2}$$ is easy because $[A,B]=-[B,A]$. I have not understood, also, (3) and (4)  $$\left[i\hslash\frac {\partial}{\partial x},x\right]=i\hslash \tag{3}$$  $$[p_x,x]=i\hslash  \tag{4}$$ where $p_x$ is the momentum on $x-$ axis.


c++ template using declaration from base class

Why does the following code not work (using VS2013)?  class Test1 { public:   template<typename T>   using my_type = T; };  template<typename T, typename V> class My : public T { public:   using t_type = T;   using my_type2 = t_type::my_type<V>; };  int main() {   const My<Test1, double>::my_type2 x = 5.5;    return 0; }   Test1::my_type would have a more complex type. My would be a policy based class where Test1 would be one of the policies. my_type2 should become a specific type based on the policy. And Test1 can't be a template directly taking the type of V. Thanks.


How do you synchronize enums in DB with your PHP code?

A db with several hundred tables will usually have more then few enums/sets defined in it. How do you synchronize you PHP code with the enum values, to avoid using string literals in your code (which we all know it just seems easier, but in the long run causes stupid bugs). The only good solution I can think of is using, during the build of the project, a process which will generate constants for all the enums in the DB, or, create and compile a PHP extension with those values. Any different, better solutions out there?


Find the dimensions of the rectangle of maximum perimeter of an ellipse

A rectangle is inscribed in the ellipse x^2/400 + y^2/225 = 1 with its sides parallel to the axes of the ellipse (Figure Q5). Find the dimensions of the rectangle of maximum perimeter which can be so inscribed.  How do i find the dimensions of the rectangle of maximum perimeter. I honestly have no clue where i should start, It would be really helpful if someone can provide a step-by-step for this solution. (The question and diagram is linked below)  Thanks in advance


I wanted to do the sigma enclosures in the below shown equation correctly. Actually this is also expectation symbol, right? I don't know it's name.


Server is sending spam every 5 minutes - can't find task/cron causing this

A linux server I manage is sending out hundreds of spam messages from a specific user account every 5 minutes.  I found, within the user's account (which runs Wordpress), a couple of PHP exploit scripts.  One of these was the Meyhem dropper.    However, I can't find any signs on the system that the droppers have compromised the system.   The files they reference don't exist, there are no running "host" processes, nothing in crontab, no unusual listening or connections on port 80, etc.  I went through all running processes and didn't see anything unusual (may have missed something).  However the only sign of a problem is that the system sends out a ton of messages every five minutes, using the same "from" username. (the username of the compromised user mentioned above).  I can monitor /var/log/maillog and every 5 minutes these messages drop into the queue.  I can't figure out how to tell which process is doing this.  I have stopped httpd, crond, atd, and disabled the customer's website so nothing would be hitting the malicious PHP files.  I also renamed the PHP files.  But still, every 5 minutes the log file shows another boatload of messages from this user being sent out.  Can anyone please point me in the right direction to find this exploit/malware/etc?  If there is a way to watch all newly spawned processes, I could see which one spawns at the time the spam goes out.  Any ideas?  Excerpt from maillog:  Jan 28 18:12:13 xyz postfix/qmgr[6829]: C4BF3206075: from=<username@xyz.[domain name here].net>, size=1199, nrcpt=1 (queue active) Jan 28 18:12:13 xyz postfix/qmgr[6829]: C0421227061: from=<username@xyz.[domain name here].net>, size=1222, nrcpt=1 (queue active) Jan 28 18:12:13 xyz postfix/qmgr[6829]: C05082060C7: from=<username@xyz.[domain name here].net>, size=1180, nrcpt=1 (queue active) Jan 28 18:12:13 xyz postfix/qmgr[6829]: BA6D922629A: from=<username@xyz.[domain name here].net>, size=1232, nrcpt=1 (queue active) Jan 28 18:12:13 xyz postfix/qmgr[6829]: BC58A226B0F: from=<username@xyz.[domain name here].net>, size=1224, nrcpt=1 (queue active) Jan 28 18:12:13 xyz postfix/qmgr[6829]: BB1C6227574: from=<username@xyz.[domain name here].net>, size=1216, nrcpt=1 (queue active) Jan 28 18:12:13 xyz postfix/qmgr[6829]: B896B226EB3: from=<username@xyz.[domain name here].net>, size=1194, nrcpt=1 (queue active) Jan 28 18:12:13 xyz postfix/qmgr[6829]: BC7532266B8: from=<username@xyz.[domain name here].net>, size=1186, nrcpt=1 (queue active)


What happened to the delete button on Outlook new email notification popups in Windows 8?

In Windows 7, the new email notification that appears near the Windows taskbar (near running tasks section) contains an "X" that allows you to immediately delete an email message from the notification.  In Windows 8, the notification still appears, but it no longer has the delete button.  Is there a registry setting, or an option from w/in Outlook that can enable deletions?


inverse match regex AND Space or end of string, AND space or start of string

I need to match a regex on Java when a string does NOT contains an email anywhere in the string: the beginning, middle or end.   For example:  string with no email [match]  myMail@mail.com string with email at the start [no match]  String with myMail@mail.com in the middle [no match]  String with email at the end myMail@mail.com [no match]  myMail@mail.com [no match]   The regex I have managed to come up with so far is an inverse version of a popular email regex:   "^(?![_A-Za-z0-9-\\+]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$).*$)";    works for me only when I have just an email;   myMail@mail.com [no match]   but I need it to give me no match for ALL the examples containing an email. Any ideas how it can be done? Thanks  edited:  Found the answer by looking at     The working line is:  "^((?![_A-Za-z0-9-\\+]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})).)*$)";   Thanks


Hypernym for "clients", "members" and "partners"

We're building a feature for a website and trying to think of a hypernym for clients, partners and members so that the feature remains generic enough for re-use later on other websites.


How to set default file permissions for all folders/files in a directory?

I want to set a folder such that anything created within it (directories, files) inherit default permissions and group.    Lets call the group "media".  And also, the folders/files created within the directory should have g+rw automatically.


Securely wiping a phone with a broken screen

I have a Samsung Galaxy S3 with a broken screen. The screen does not respond to any touch and does not display anything at all, it is black at all times. CyanogenMod 11 is installed on the device.  I need to securely wipe the device, but I've been having a very difficult time doing so, as CyanogenMod doesn't allow ADB to connect without user input, which in this case is impossible. I've done a factory reset on the phone, but didn't wipe the user data on the internal storage (not an external SD card, rather the "internal SD card" which is hosted on the main phone ROM).  How can I securely wipe the phone and delete all data left on the internal storage? I'd like to zero-out the filesystem, but still have a semi-working phone that will at least boot into Android for occasional tinkering over adb.


Is $π^3$ greater than $3^π$ or conversely?

Using the calculator, we know that  $$3^π > π^3$$  But, without any calculation, how to prove it?


how do I return all the possible outputs that remove each character once a time in a string using only build-ins?

For example, i = 'cat', how can I get this output: 'at', 'ct', 'ca'? I wrote a code like this, but totally wrong. Can anyone help? for x in i:     print(i.replace('x', ''))


is there a way to quickly turn one monitor off in a dualhead-setup with Windows 10?

I want to create something like a macro that turns off one of my monitors. I got a dualhead-setup and when i watch movies or play computer games, i want to turn one monitor off (standby) with something like a key-shortcut.    are there native possibilities integrated in Windows 10 to do something like this? or do i need additional software - and if so, which software would you recommend?  thanks for any help!  edit: the reason why I can't just turn off my monitor:


What to consider when repainting fork from black to white

My beautiful road bike was in an accident which bent the fork. It gets replaced with a black fork which doesn't match the rest of the bike (creme colored).  Now I want to attempt to repaint it. Is there a good way to approach this in order to match the color? I have sent the email to the vendor to ask for the color specifications. I hope there is some kind of industry standard when it comes to the color.  Other than that, is there anything else I should prepare? Do I need to remove the black paint first or can I just color over that?


The times that a suggested edit was suggested and the post was posted don't line up in the suggested edit view.        I've observed this behaviour on both MSO and SO, but can't see it in any other queues.  I'm using Chrome 27.0.1453.110 m on Windows 7 if it's relevant.


Let $T$ and $T'$ be topologies on set $X$ so that $ T \subset T'$. If $(X, T') $ is path connected, is then $(X, T) $ path connected?  I am not sure how to prove that it is true but cannot find a counterexample. Any hint helps!


I want to create a temporary file and pipe some text into it using a makefile. In bash, I can create a temp file and pipe text into it like so: temp_file=$(mktemp) echo "text goes into file" > ${temp_file} cat ${temp_file} rm ${temp_file}  Output when running it (as expected):     text goes into file  When using the same code in a makefile, I get the following output: makefile: test:     temp_file=$(mktemp)     echo "text goes into file" > ${temp_file}     cat ${temp_file}     rm ${temp_file}  $make test     echo "text goes into file" >  /bin/sh: -c: line 1: syntax error near     unexpected token `newline' /bin/sh: -c: line 1: `echo "text goes into     file" > ' make: *** [makefile:18: test] Error 2  Any idea what I'm doing wrong here or if I'm missing any special makefile syntax rules?


How to change StackExchange email address?

I've been searching all over for an answer to this and can find nothing 100% solid.  I have a StackExchange login that has an outdated email address but I can't find any way to change it. I figured, maybe I'd try adding a new login then removing the old one, but I can't just add a new login with an email address, I have to choose Google, or AOL, or some other third party provider and I don't want. I just want to change my email address! This is extremely frustrating. Any help would be great.


I can't achieve updates, I get the following message (see image).    $ df -h Filesystem       Size  Used Avail Use%   Mounted on udev             1,9G     0  1,9G   0%   /dev  tmpfs            384M   11M  373M   3%   /run  /dev/sda5         20G   18G  1,3G  94%   / tmpfs            1,9G  1,1M  1,9G   1%   /dev/shm  tmpfs            5,0M  4,0K  5,0M   1%   /run/lock  tmpfs            1,9G     0  1,9G   0%   /sys/fs/cgroup  /dev/sda6        133G   41G   86G  32%   /home  cgmfs            100K     0  100K   0%   /run/cgmanager/fs  tmpfs            384M   72K  384M   1%   /run/user/1001     i don't want to do a new partition. how can i move unuseful files? how can i add partition via terminal?  sudo dpkg --configure -a dpkg: error: unable to create new file '/var/lib/dpkg/status-new': No space left on device


PHP import CSV containing single quotation marks

I am trying to import a CSV file containing single quotation marks into the text. And each time, MySQL gives me an error. How could I avoid this type of error?   Here is one of the texts that causes problem:  Sam Capra, agent de la CIA basé à Londres, échappe à l'explosion de son bureau grâce à un appel de sa femme Lucy. Mais cette dernière, enceinte, disparaît et Sam est tenu responsable de l'attentat par la CIA.  and here is my SQL query:   $sqlInsert = "INSERT into products_details (`product_title`,`product_price`, `product_image`, `product_gallery`,`product_description`, `meta_value`, `stock`, `weight`, `active`)  values ('" . $column[2] . "','" . $column[21] . "','uploads/" . $column[0] . ".jpg','" . $column[1] . "','" . $column[22] . "','" . $json . "','" . (int)$column[15] . "','" . $column[20] . "','" . (int)$column[23] . "')";   Thank you in advance for your help!


Suppose that $(X,Y)$ has the probability density function given below:  $f(x,y)=\frac{1}{\sqrt{3}{\pi}} e^{-\frac{2}3(x^2-xy + y^2)}, (x,y)\in \mathbb{R}^2$  a) I want to find the density function of $X$.  b) I want to find the density function of $Y$.   Answer: I know $f_X(x)=\int_{-\infty}^{\infty}f(x,y)dy$.Similarly the PDF of $Y$ also can be given $f_Y(y)=\int_{-\infty}^{\infty}f(x,y)dx$. But how to proceed further?


A closed subset of an algebraic group which contains $e$ and is closed under taking products is a subgroup of $G$.   Denote this set as $X$. If the condition of $X$ being closed is dropped, this statement does not hold. The set of nonzero integers in $\mathbb{G}_m$ over $\mathbb{C}$ is a counterexample.  It suffice to prove that for any $x \in X$, $x^{-1}X = X$. As $X$ is closed under taking products, it is clear that $X \subseteq x^{-1}X$. In order to prove the inverse inclusion, the closedness of $X$ (under Zariski topology) must be used.   Let $\phi: G \rightarrow G, y \mapsto x^{-1}y$ is a homoemorphism of $G$ as an algebraic variety. So $x^{-1}X = \phi(X)$ is a closed subset of $G$ containing $X$. But Why are they equal?  Thanks very much.


TROPOMI NO2 and SO2 too small ... being approximated to zero

I am trying to download TROPOMI NO2 and SO2 data for my region as a timeseries from Google Earth Engine, however, the values are small (see attached images) and as such, when I download the CSV file, I find that all the values have been reduced to zero (0). How can I solve this in order to download the values as they are?  Here is my code:  var geometry = ee.Geometry.Polygon(   [[[27.671093749999986, 5.861609095403631],   [27.671093749999986, -12.999528581977067],   [44.19453124999998, -12.999528581977067],   [44.19453124999998, 5.861609095403631]]], null, false);  var data = ee.ImageCollection('COPERNICUS/S5P/OFFL/L3_NO2')   .select('NO2_column_number_density')   .filterDate('2019-01-01', '2019-01-30');  var tmseries = ui.Chart.image.series({   imageCollection: data,   region: geometry,   reducer: ee.Reducer.mean() }); print(tmseries);  print(tmseries.getDataTable());


Open Sets of $\mathbb{R}^1$ and axiom of choice

In the proof of 'Every open set in $\mathbb{R}^1$ is a countable union of disjoint open intervals', we need to pick one rational representative from each of the intervals hence establish the countability.  This seems to depend on the axiom of choice.  Thus I wonder does this property of $\mathbb{R}$ is equivalent to the axiom of choice, that is, is there any construction such that this property is not true once we abandon the axiom of choice?  Thanks!


change direction navmesh agent on collision encounter

I have one player and many enemies. The enemies are following my player through the navigation mesh. Sometimes enemies get stuck because there is another enemy in-front of them. You can say both are in line.   Is it possible that when one enemy collides with other enemy in-front of it to change direction so that it avoids colliding with one another?


We're debating inside our team on whether to use a question mark icon, or an "i" icon for prompting a tooltip that reveals more info.  Which do you say conveys the message better? Or, how do they differ in the message they convey?


"There is no connected camera" - Macbook Pro 13" 2017

Does anybody have any alternative solutions? Seems like my computer no longer detect my built-in camera. I can't detect it in any application.  So far I have tried:   terminal killAll commands -> doesn't do anything and I get a 'No matching processes were found' message Restart both SMC and PRAM camera in safe mode also does not work webcam on Secondary account does not work   I am at the end of my wits here.


Tables, graphs and images don't show up at the same position it was inserted in the TeX file. I tried to suppress floating by using:  \usepackage{float} ... \begin{figure}[H] {15cm} \caption{}% \label{} \fbox{\includegraphics[width=\hsize]{image.jpeg}} \end{figure}   also  \begin{figure}[!htbp] {15 cm} ...  \usepackage{placeins} \FloatBarrier \begin{figure}[H] {15cm} ...   but these commands keep insisting on moving figures, tables and graphs to unexpected locations. I'm using repUERJ template available   Does anyone know why it happens?


I am using Ubuntu 16.04. my Ubuntu software is not opening.I tried opening it through the terminal.When I type 'open Ubuntu software center', it shows 'Couldn't get a file descriptor referring to the console'. Please give me a solution.


Installed ubuntu now want to uninstall it

I installed ubuntu on my laptop, there was no option to install it alongside windows 8 so i took the something else option and went to te partitioning option, and took the /sda/devca5 and then 1 tb partitiion hard drive. now my windows are not running, i cannot even refresh my windows to earlier point. how can i uninstall ubuntu


ArcGIS Online/ArcGIS Pro: Turn off symbol by attributes for each attribute

When I am working in QGIS I have the option to catogorize the symbology by attribute and that I can turn off the symbols in the layerspanel on and off easily like in the image below.    However, when I use ArcGIS Pro or ArcGIS online I want to do this too. But in the contents pane there is no option for this. Is there an easy fix for this?


Does it require more energy to maintain higher temperature in the same environment?

Let's say you have a house with natural gas atmospheric heater water radiator system. Does it matter in terms of natural gas expenditure, if the house is kept at higher or lower temperature, assuming the outside temperature is always lower than inside?  Let's say you have the thermostat which regulates the heating system to keep more or less constant air temperature. You are leaving the house for a number of days. The common wisdom is to turn down the heating system to lower temperature so that it somehow saves energy.  However, unless you can completely turn the system off for the duration of your absence, does it matter, if the thermostat is kept at 15°C or at the 21°C you use when you are in?  Quite possibly I am wrong here, my instinct was that the house loses heat at a more or less constant rate, which is independent of the inside temperature of the house.   At the start of your absence, the inside of house is broadly at 21°C. If you turn the thermostat to 15°C upon leaving, there will be no gas spent during the time house cools down. Then the gas spent to maintain 15°C will be about the same amount as to maintain 21°C. Then when you return, you have to heat the house up and you expend the energy you saved during cooling, to heat the house back up.  Is it right or am I missing some basic physics here? Or perhaps it is dependant on actual temperature differences between inside and outside?


jquery interact with elements added to the DOM

I'm using a wordpress plugin to add classes to comments as 'editors' picks'.  On the page I have two buttons, one to show the comments and one to show the editors picks. All is working just fine.  Code:-   $(document).ready(function () {       $("#editors-picks").on("click", function(e){          $("ol.commentlist li").not(".featured").fadeOut(); // fade out any comments that aren't 'featured'      });      $("#comments").on("click", function(e){          $("ol.commentlist li").not(".featured").fadeIn(); // fade all comments back in      }); });   The problem is comments dynamically added to the DOM tree(via ajax). After a new comment is added the function doesn't work. I thought using .on would fix this, but it does not.


Is it possible to receive and post reply to questions via email

Is it possible to receive and post replies to questions via e-mail; in a similar fashion to Google Groups and Facebook wall comments?


Given a binary classification problem, is there any inherent difference (or advantage) to using a classifier (say a logistic regression) and a regression, where the classes are denoted by 0 and 1 (or any two numbers)? Further, say, after running the regression, one can learn to optimize the 'cutoff' point (maybe not 0.5 in this example, but it turns out better to cut at 0.45).


This is the current status of the beta app:    I received a notification of mine seconds ago, but cannot go to the app. After I read it on the web, the notification disappeared. I think this is a bug.   I send this bug on the official app on Apple Store.    App Version: 1.4.0 Device: iPad2,2 OS Version: Version 9.1 (Build 13B143)


What is the difference between different shells in Ubuntu:  $ cat /etc/shells /bin/sh /bin/dash /bin/bash /bin/rbash


Proof of the Gauss's law for gravity without divergence

The proof of the Gauss's law for gravity provided by Wikipedia takes use of the divergence theorem.    Is it possible to arrive at the integral form of the Gauss's law in a way which doesn't require the use of divergence?    I'd like to derive it from the Newton's law. The main idea is: Assume that two points masses $m_1,m_2$ act on each other with force $F=\frac{Gm_1m_2}{r^2}$. Do something. Arrive at the integral form of the Gauss's law.   So it doesn't have much in common with the "duplicates"  I had one semester of analysis, so don't know anything about the Delta Dirac function and family


What latex package would you recommend for drawing simple diagrams of the following sort?


Can a Circle be called a polygon with infinite number of sides?

Lets imagine i have made a square of sides 1 unit*1 unit and now i make a pentagon in it with all sides equal and now i keep adding sides with condition that length of all sides be same. So now lets say number of sides is close to infinity so would it become a circle at one point and how can we differentiate it from other inscribed polygon with MANY SIDES (NOT INFINITY)?


How to convert .bib generated by Mendeley for use with amsrefs

I'm using TeX live 2010.  I have a .bib file generated from Mendeley, and  I want to use that with amsrefs, but it's confusing and the amsrefs documentation is somewhat hard to follow: how do I massage the .bib file into something that amsrefs can stomach. (I'm using amsart as the document class).


PHP PDO : Multiple UPDATE in a single query

I'm trying to get the following to run via a single pdo statement UPDATE `coin_price` SET `coin_id` = 1 WHERE coin_id = 1; UPDATE `coin_price` SET `coin_id` = 178 WHERE coin_id = 178;  and I am getting the following exception  You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'UPDATE `coin_price` SET `coin_id` = 178 WHERE coin_id = 178'` at line 1  I am just running $statement = $this->system[$location]["connection"]->prepare($sql); $statement->execute();  and getting an exception.  I tried with binding and without. Is what I am doing not possible? Note : Both queries run fine via PDO by themselves


Why wasn't James Potter his own Secret Keeper? The whole thing came about because Potters chose the wrong Secret Keeper (who betrayed them) for the Fidelius Charm on their house. Why didn't James just make himself a Secret Keeper? We know that it’s possible from Deathly Hallows: (Bill and Arthur Weasley are their own Secret Keepers).  “I’ve been getting them all out of the Burrow,” Bill explained. “Moved them to Muriel’s. The Death Eaters know Ron’s with you now, they’re bound to target the family – don’t apologize,” he added at the sight of Harry’s expression. “It was always a matter of time, Dad’s been saying so for months. We’re the biggest blood traitor family there is.” “How are they protected?” asked Harry. “Fidelius Charm. Dad’s Secret-Keeper. And we’ve done it on this cottage too; I’m Secret-Keeper here."


How to find out if SimpleDateFormat is using seconds or minutes

I'm making a game with a timer and it tell's you how long you took to complete the game at the end, it's a basic game so some people may beat it in less than a minute so i want to know is there any way to detect if there if the minutes are equal to 00 so then i can set the text to say 00:12 seconds and if it's not equal to 00 then it will say 01:12 Minutes. This is the code that i am using to work out the times.   Date start = new Date(); SimpleDateFormat sdf = new SimpleDateFormat("mm:ss");   And the work out the final time is simply  Date now = new Date(); sdf.format(new Date(now.getTime() - start.getTime()))


i want to center these equations:  \documentclass{article} \usepackage{amsmath} \begin{document}         \begin{align} \label{eq:test}             \sum {i=1}ˆ{5} x i & = 15 \\             xˆ2 + 10 x + 200 & = 0 \\             A&=AAA\\             B&=BBB\\         \end{align} \end{document}   I want them these four equations to be treaten like a figure (so center them without losing the alignment).  I saw many thread but all seem to be different (e.g. most only want to center one equation)  Thank you for your kind help.  edit1: That's what i get if i use it inside my real document:


I have a problem creating an animated film as a university project. We work as a group. One of us created a landscape and the others animated a panda. I appended the landscape to the panda file and the others the panda into the landscape file. All my files have shadows on the ground from trees and the panda. The other files just have a shimmering shadow. I've been googling a lot but I can't find any solution. This happens only with Eevee, with Cycles all shadows are shown. I'll upload two files, one from me and one from a fellow student. Maybe someone can help me :)   Best wishes Nathalie


WMS returns but WFS does not return same SRS and BBOX values

I am using WMS and WFS services on GeoServer. My WMS query returns the image result for features:    But I am using same BBOX and SRS values for WFS service but does not return any value.


If the universe is infinite, then how can we tell it's expanding?

I understand that our universe is finite to a point that we can see it expand but if that's the case, how is it also frequently called 'infinite'. While there are similar questions out there I would like to hear your answers incase there is more that needs expanding on or a different answer in general.


Time Travel Book featuring dinosaurs, cave people, and children

I remember reading a time travel book when I was young, which means it would have been written no later than the '80s, but probably much before that.  It featured an adult and some kids back in time and them trying to get back to the present.  I recall that the time travel effect was a ring, as at one point the ring opened up and a "brontosaurus" hit it and burned it's leg sending chunks of it back through the ring.  I recall a section where they were with "cave people" who had just hunted and killed some animal, and they used their pocket knife to extract more meat from the carcass, and actually cooking the meat unlike their paleolithic 'friends'.  (I seem to recall that one of the paleolithic girls seemed to fancy the boy time traveler, much to his discomfort.)  I am pretty sure that at one point they were watching the time ring appear over water, knowing they could not reach it, and waiting for it to be reachable.  I think the close of the book was them freezing to death in the ice age, commenting on how in the future when their bodies are found how it would be hard to explain how they got there, and then finally being rescued before it was too late.  I hope that's enough to go on?  Any ideas?


Why are nvidia binary drivers called opensource in Software & Updates?

I was curious looking into various tabs of Software & Updates GUI, and found a strange thing: most of versions of nvidia binary drivers are called "opensource". Only legacy ones are called proprietary. See the screenshot below.    What does this mean? Have NVidia really released their drivers as open source?  This doesn't seem true, see this output:  $ dmesg|grep taints [    1.269797] nvidia: module license 'NVIDIA' taints kernel.


How to make programs VM-aware in Arch Linux?

I'm running Manjaro on my main system with a Manjaro VM in Virtualbox (will probably set up for Arch in the future). Most of my configs and setup scripts are shared between the native and VM systems. There are some things I want to run only on a native system, and others only in a VM. I'm looking for ways to make my scripts VM-aware for this. So far, the only method I've found is by using a bspwm function: mainmonitor="$(bspc query --monitors --names | grep -v LVDS | head -n 1)"  However, this wouldn't be universal enough and depends on bspwm. I'd like something that would work on any Arch Linux installation, regardless of the DE/WM. Even better if it'll  work on any virtualization software like Virtualbox or VMware. I know that there is VM-aware malware but I'm not sure what files they usually check for it. How can I make my scripts VM-aware in Arch Linux?


Why do first order languages have at most countably many symbols?

Every proof that I read seems to assume that $|L|\leq\aleph_0$. But then how do you model things like field over $\mathbb{R}$ without running out of variable symbols?  More importantly, how can I prove that $|L|\leq\aleph_0$?


I'm new with LaTeX and I'm trying to make a table with the elements centered vertically and horizontally. I've searched for this question, it seems like most people were trying to do things a little more complicated than this, resulting in complicated answers I couldn't understand. The table below is already centered horizontally, but the elements are aligned to the top of the cells instead of the center. How do I fix this?      \begin{tabular}{*{5}{|c}|}         \hline         $p$ & $q$ & $p \land q$ & $p \lor q$ & $p \to q$\\         \hline         T & T & T & T & T\\         \hline         T & F & F & T & F\\         \hline         F & T & F & T & T\\         \hline         F & F & F & F & T\\         \hline     \end{tabular}


Was it Harry's blood in Voldemort's body alone that allowed him to come back after dying in the forest, or the enchantment that it contained

In Deathly Hallows, Dumbledore says:     He took your blood and rebuilt his living body with it! Your blood in his veins, Harry, Lily’s protection inside both of you! He tethered you to life while he lives!   So was it the fact that Voldemort used Harry's blood in Goblet of Fire that tethered Harry, or something about Lily's enchantment made it so Harry could use this connection to come back?  For example, if Lily's enchantment no longer was active and disappeared, would the blood connection alone be enough to bring Harry back? Or is it something about her enchantment that allowed him to use the connection to go back into his body and live? Is it because Lily's enchantment exists on Earth that Harry can come back, and the blood is just the host for the enchantment? So is it the blood, or the charm that it carries?  Does Lily's enchantment have that capability? If it is because the blood, how is the enchantment relevant. Dumbledore makes it sound like the charm does have something to do with his ability to return.  Dumbledore made it confusing IMO by mentioning both, and not explaining how they correspond.


Instaling Ubuntu 13.04 alongside windows 8 OS

I have an Acer Aspire V7 ultrabook and I want to install ubuntu 12.04 or 13.04 in it alongside windows 8.I also have a Kingston USB pen drive in which 4GB space  is free.Please tell me how can I do it.


Why identify the Lagrangian as kinetic energy minus potential energy?

When deriving the Euler-Lagrange equations from the Principle of Stationary Action we start by insisting that the actual path of a particle minimizes the action $S$, defined as $$S=\int_{t_1}^{t_2}\mathcal{L}(q,\dot{q},t),\quad\text{where}\quad\dot{q}=\frac{dq}{dx}.$$ And then we show that a necessary condition for $S$ to be minimized is that $\mathcal{L}$ obeys the Euler-Lagrange equations, $$ \frac{d}{dt}\left(\frac{\partial\mathcal{L}}{\partial\dot{q}}\right)-\frac{\partial\mathcal{L}}{\partial q}=0. $$ My problem is that nowhere in the derivation do we make use of the fact that the Lagrangian is of the form $\mathcal{L}=T-U$, where $T$ is the kinetic energy, and $U$ is the potential energy. So my question is: Is there an explanation for this identification beyond the fact that this what makes the physics work? My best guess at the answer is that if we instead started out with the Principle of Virtual Work, we eventually get to $$ \frac{d}{dt}\left(\frac{\partial T}{\partial \dot{q}_j}\right)-\frac{\partial T}{\partial q_j}=Q_j. $$ Where $Q_j$ is the generalized force, defined as $$ Q_j\equiv \sum_i\vec{F}_i\cdot\frac{\partial\vec{r}_i}{q_j}, $$ and if we assume that the applied forces on the system are conservative, so that $$ \vec{F}_i=-\vec{\nabla}U(\vec{r}_1,\vec{r}_2,...,\vec{r}_N), $$ and this potential, $U$, doesn't depend on the generalized velocities, we get $$ \frac{d}{dt}\left[\frac{\partial}{\partial \dot{q}_j}(T-U)\right]-\frac{\partial}{\partial q_j}(T-U)=0. $$ Which is exactly the E-L equation, with $\mathcal{L}=T-U$, so we can claim that both principles should give us the same physics, and therefore the Lagrangian we arrived at from the Principle of Stationary Action should also be $\mathcal{L}=T-U$. Maybe it's just me, but this seems unsatisfactory. Have we simply defined the action so that we have a more compact formulation of the physics we already knew, or can it stand by itself?


installing ubuntu 14.04 LTS on ASUS UX303LN

i'm trying to install ubuntu on my laptop asus UX303LN in dual boot mode, but i got some problem. my configuration : GPU : GT840m, Hd 4400 CPU : i5 - 4210u HDD : 500GB SecureBoot : Disabled CSM : enabled ISO : Ubuntu 14.04 LTS with rufus (MBR mode, USb boot). Result : get a black screen when i try to install ubuntu or trying to test ubuntu without instal. if i switch using the key  CTRL + ALT + F1  i got two error :  unknown maxwell chipset. unknown chipset.  ive tried with the "nomodeset" command, but i still have the black screen. Any ideas to resolve the problem ? Thanks you.


Show that the collection of matrices which commute with every idempotent matrix are the scalar matrices

Show that the collection of $n\times n$ real matrices which commute with every idempotent matrix are the scalar matrices .   Let $\mathcal P$ denote set of all idempotent matrices .  Let $A=\{B:BP=PB\forall P\in \mathcal P\}$.    So I need to show that $A=\{cI:c\in \Bbb R\}$.    I am feeling totally confused on this. Will you kindly give some hints here?


Correct use of simple past and past perfect

I received a call which was for my colleague. he was not at his seat at that time hence I told caller I will inform him about his call once he returned to his seat.   How should I inform to my colleague?  Xyz had called you, Please call him  Or  Xyz called you, Please call him  I know there is one more way to say this  Xyz's call for you Please call him  According to me simple past is enough here because I want to refer only one past event.   Please help


How can I change the icon of Recent Folder that I drag to dock on Mac

I want to move the folder recent item to dock because it helps me a lot. But this is not the only one folder i use in dock, there is another one such as download folder. Because of the icon shown on these folders based on the first item in each folder, sometime it confuses me.   The question is, can I change the icon of those folders in dock so that I can differentiate them easily?


In a board, you have $13$ White round pieces, $15$ Black round pieces, and $17$ Red round pieces. In each round you can choose two different color pieces and change them with two other pieces of the remaining color. Doing this every round, it's possible to get all the pieces to be the same color ?   I think is not possible, and I think that it has to be with the case that the number of pieces is separated by $2$. That is, let $3x$ be the number of total pieces divided 3, that is $x=15$. The problem I see is that:  In this case $White=x-2,Black=x,Red=x+2$ $$(\underbrace{x-2}_\text{White},\underbrace{x}_\text{Black},\underbrace{x+2}_\text{Red})$$  In this configuration is not possible to get to $$(x,x,x)$$   From this I can get to all from $1 $ Color $$(3x,0,0)$$


I would like to develop iPhone apps without using Mac OS X. Is it possible to do this on Windows OS?


How can I add a parallax effect into my side-scrolling game? I read a lot about parallax scrolling so I know what the logic is and what parallax is but I can't create a dynamic parallax effect.  I have draw and update functions like this:  void UpdateBackground(Background &back) {     back.x += back.velX * back.dirX;     if(back.x + back.width <= 0)         back.x = 0; } void DrawBackground(Background &back) {     draw_bitmap(back.image, back.x, back.y, 0);      if(back.x + back.width < WIDTH)         draw_bitmap(back.image, back.x + back.width, back.y, 0); }   So this draws a parallax effect with two background objects but it draws it statically. I'm creating a 2D side-scrolling game and I'm translating my character and my camera position along x axis. So I have to translate my parallax effect with my camera but when I add to background position.x it doesn't work. How can I solve this?


Why is $\pi$ irreducible in $\mathbb{Z}[i]$?

I'm reading Dummit&Foot and got stuck at page 290. Let O be a quadratic integer ring and $\pi$ be prime in O. Then $(\pi)\cap \mathbb{Z} =pZ$ for some prime integer. Since $p\in (\pi)$ we have $p=\pi \pi'$. So $p^2=N(\pi)N(\pi')$. Assume that $N(\pi)=\pm p^2$. Then $N(\pi')=\pm 1$ so $\pi'$ is a unit and $p=\pi$ (up to assoicates) is irreducible in $\mathbb{Z}[i]$.  Why $\pi$ is irreducible?  If we consider the case where $p=\pi$, then $p$ is not always irreducible. For example, $p=2=(1+i)(1-i)$ and none of these factors are units, because their norms are $1^2+1^2=2$. So what am I missing?


While conversing with my friend I got confused between these two sentences:  It depends upon the context. It depends on context.  Which one is more apt in usage and why?


Prove $\{a(c):a(x) \in F[x]\}$ is an integral domain isomorphic to $F[x]$

This question originates from Pinter's Abstract Algebra, Chapter 27, Exercise G1.     Let $F$ be a field, and let $c$ be transcendental over $F$.   Prove {$a(c):a(x) \in F[x]$} is an integral domain isomorphic to $F[x]$.   [Edited]  In general, if $A$ is an integral domain, then $A[x]$ is an integral domain.    Let $S_c =$ {$a(c):a(x) \in F[x]$}.  $S_c$ is an integral domain iff $S_c$ is a commutative ring with unity that has no divisor of zero.   $S_c$ is obviously commutative and closed under addition and multiplication by the properties inherited from $F[x]$, which is an integral domain.  Note $F[x]$ is an integral domain for $F$ is a field. $a(x)=1\in F[x]\implies a(c)=1\in S_c$. Suppose $a_1(c)a_2(c) = 0$ for nonzero polynomials $a_1(x), a_2(x)\in F[x]$.  Let $b(x)=a_1(x)a_2(x)$. Then $b(c) = 0$, contradicting that $c$ is transcendental. Hence $a_1(c)a_2(c) = 0$ implies either $a_1(x)$ or $a_2(x)$ is zero; that is, $S_c$ has no divisor of zero.   This completes the proof that $S_c$ is an integral domain.  Let $\sigma_c: F[x]\rightarrow S_c$ such that $\sigma_c(a(x)) = a(c)$. Note $\sigma_c$ is a ring homomorphism from $F[x]$ onto $S_c$. Furthermore, $a(c)= b(c)\implies a(x)= b(x)$, for otherwise suppose $a(x)\ne b(x)$, then $a(x)-b(x)\ne 0\implies a(c)-b(c) \ne 0$, as $c$ is transcendental, contradicting $a(c)=b(c)$.  Hence $\sigma_c$ is bijective and therefore an isomorphism; that is, $S_c\cong F[x]$.


Copy Text Variable to Clipboard with Pure JavaScript

How can i copy a text from a JavaScript variable directly to clipboard (without use an html text area)?  I'm already tried this:  function fxCopyToClipboard() {      var varText = "TEXT FOR PASTE";      varText.select();     varText.execCommand("copy");  }  <button type="button" onclick="fxCopyToClipboard();">To Clipboard</button>


How to sort files in folder by date created?

Is there a way to sort files in a folder by the date of their creation?  I'm trying to figure out in which order my documents were created.


Upon entering any given minecraft server, after a minute or two I am forced out of the server, and I'm given the following error:  java.io.IOException: An existing connection was forcibly closed by the remote host.  What does this mean, and how can I prevent it from happening again?


This is a qualifying exam problem. Suppose $F$ is a distribution function of a Borel measure $\mu$ with $\mu (\Bbb R)=1$. Prove that $\int_{-\infty}^{\infty} (F(x+a)-F(x))dx=a$ for all $a>0$.


Are sufficiently large key sizes enough to deter quantum attacks for symmetric key ciphers?

Are sufficiently large key sizes enough to deter quantum attacks for symmetric key ciphers such as AES?


Why don't stationary electric charges possess a magnetic field?

Why don't stationary electric charges posses magnetic field, while moving charges do?


Given that The Six Kingdoms are a democracy (of sorts), is there any history in the GRRM world of any other democracies?


How can I display an integer that counted the time from my game in my endscreen?

I'm making a simple game to learn how to use Android Studio. The objective of the game is to do some simple tasks as fast as possible. In my main game screen, I have a thread that makes an int count up every second, so the player knows how much time has gone by. When the player has done all the simple tasks, the game goes to the end screen. Now I want to display the time in the endscreen, so the player knows how fast they finished. I get an error when I run the game. This is the code to run the thread every second: Timer d = new Timer(true); thread1 thread1 = new thread1(this, myCanvas); t.scheduleAtFixedRate(thread1, 0, 1000);   This is the tick function that the thread does every second: public void tick1(){     timer++; }  This is the getter for the timer: public int getTimer(){     return timer; }  When the game ends and it goes to the endscreen, I use the getTimer() to have a textview that should display the timer: err = (TextView)findViewById(R.id.textView); err.setText("Tijd: "+ timer+"");  This is the error message I get when I try to run it: 2021-03-06 11:18:38.153 21729-21729/com.example.test_game E/AndroidRuntime: FATAL EXCEPTION: main     Process: com.example.test_game, PID: 21729     java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.test_game/com.example.test_game.Eindscherm}: java.lang.NullPointerException: Attempt to invoke virtual method 'int com.example.test_game.MyCanvas.getTimer()' on a null object reference         at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3792)         at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3968)         at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)         at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)         at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)         at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2307)         at android.os.Handler.dispatchMessage(Handler.java:106)         at android.os.Looper.loop(Looper.java:246)         at android.app.ActivityThread.main(ActivityThread.java:8506)         at java.lang.reflect.Method.invoke(Native Method)         at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)      Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'int com.example.test_game.MyCanvas.getTimer()' on a null object reference         at com.example.test_game.Eindscherm.onCreate(Eindscherm.java:24)         at android.app.Activity.performCreate(Activity.java:8198)         at android.app.Activity.performCreate(Activity.java:8182)         at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1309)         at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3765)         at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3968)          at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)          at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)          at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)          at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2307)          at android.os.Handler.dispatchMessage(Handler.java:106)          at android.os.Looper.loop(Looper.java:246)          at android.app.ActivityThread.main(ActivityThread.java:8506)          at java.lang.reflect.Method.invoke(Native Method)          at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)


Let $f(x)$ be defined and continuous on the interval $[a,b]$ and differentiable on $(a,b)$. Prove that there is at least one number $c$ such that  $$\frac{af(a)-bf(b)}{a-b}=f(c)+cf'(c).$$


Why does "orange" rhyme with (almost) nothing in English?

Joel Spolsky asked what rhymes with orange. The official answer is, "Nothing," although a creative poet can get close by using half words, just the -nge part or resorting to place names and foreign words.  Does orange somehow violate the basic phonotactics of English? (And hence we wouldn't expect other English words to rhyme with it?)


When do you use Java's @Override annotation and why?

What are the best practices for using Java's @Override annotation and why?     It seems like it would be overkill to mark every single overridden method with the @Override annotation.   Are there certain programming situations that call for using the @Override and others that should never use the @Override?


How to compute this determinant, without the Sylvester determinant theorem,

The problem statement is:  Show that there exists numbers $a$ and $b$ such that   $$det (A + sxy^*)= a+bs$$  here $A$ is an $nxn$ matrix with real entries, and $x,y\in R^n$.  I've been using brute force and using multi-linearity of the determinant several times, and the computations are getting longer, but I see no pattern yet.    Any ideas are welcome.  Thanks,


Determine Linux Server's Architecture (32 or 64 bit)

I actually just have shared hosting at Dreamhost, and I'm going to use it to test deploying a MongoDB based application. There are 32-bit and 64-bit pre-built distros, but I don't know which I should install, until I can determine the server's architecture.  I suppose this can be done by detecting the OS version, but I have no idea how to do that. I can ssh in, though not as root of course, since it's a shared server. I just need to know what command or commands can tell me what architecture is being run on.


The rational numbers are exactly those numbers whose decimal representations either terminate (i.e. all digits are 0 from some point onwards) or repeat.  How can I prove this statement? Any help would be appreciated.Thank you!


Why can't I use 'the shadow' of something

I'm creating some application UI. Say when the user clicks a button, a shadow will be created for the given object in the page. And a message will appear saying: Do you want to keep the shadow? I'm not a native English speaker so when someone suggested me to change the wording to a shadow I feel so hard to accept. Is it correct that I need to change the wording like he said? And why can't I use the here? What I have in mind is that the refers to some particular thing - the created shadow.


After 2.44, the book calculates the commutators of $\phi$ and $\pi$ with the Hamiltonian. But in the first expression the Hamiltonian has a different form than in the second. The first one matches equation 2.8. $$H = \int {d^3x\left[\frac{1}{2}\pi^2 + \frac{1}{2}\ (\nabla\phi)^2 + \frac{1}{2}m^2\phi^2  \right]}$$ But in the second one, the Hamiltonian has this form inside the conmutator. $$\int {d^3x'\left[\frac{1}{2}\pi^2(x',t) + \frac{1}{2}\phi(x',t)(-\nabla^2 +m^2)\phi(x',t) \right]}$$ How can you exchange the gradient squared with a $\phi\nabla^2\phi$ term?


I have a question regarding the proper usage of the word "nor"

Is "...not legal advice, nor is it intended to be" the proper usage of "nor" in the prior partial statement?


How to change the background of the terminal through a command

I'd like to change the background color of the Ubuntu terminal emulator to say, red. However, I want to do it using the commandline, like the Windows equivalent color 0F, since I'm making a program that has changing the background color as a core function and I don't really want it to rely on any dependencies, unless it is really necessary.  Regarding the comment saying there's already an answer to this:  The answer on the question requires a package in order for it to work. I need a way for it to work without a package.


How to post HTML text on Stack Overflow?

If I'm trying to post a question/answer on Stack Overflow, with some code that contains HTML text syntax inside, how do I do it nice with highlights. For example, I would like to post this line:  QString html = QString("<meta Content=\"Text/html; CHARSET=Windows-1251\">%1").arg(text);  But output is shown as QString html = QString("%1").arg(text);.  I have read this post , but I didn't find the answer.


How do you finely dice an onion without crying?

But no one seems to say what should you do when you finely chop an onion. See, not cutting the onion core, using the Gordon Ramsay technique and generally pivoting away from the onion helped so far. But now I have upped my dicing skills. I can chop finer, but alas I am a victim of my own success where the smell of the fine onion is almost like the obscenity of grated onion (horrible).  Sharp knife, not cutting to the core, pivoting away etc all stop working when you are good enough to fine dice an onion. Short of goggles, what do you do?


Does sprinkling salt on top of brownies give the same result as putting it in the batter?

Standard recipes for brownies have a teaspoon of salt in them. Questions like  and  explain that it's only for taste. Can you just put some salt on top after they are baked?  For example, the linked answer might imply that yes you can just sprinkle salt on the baked brownie afterwards. But is that true? I also don't understand the . None of the flour should be raw after the brownie is baked!


where is the place downloaded program from apt-get

When we download a binary Debian program from repository by this command:  sudo apt-get install something   Where is this program store and all of executable files?


I would like to check whether a number is in a list and make a decision in the calculation of a macro. I found a neat solution to check the membership of a number,  and it works as long as I don't use it inside my decision macro.   However, I have not been able to use it in the macro \processNum in the code below.  \documentclass[tikz, border=0mm]{standalone} \usepackage{tikz,xfp}  \usepackage{xstring} \newcommand\IfStringInList[2]{\IfSubStr{,#2,}{,#1,}} % Adapted from https://tex.stackexchange.com/a/260909/23594  \newcommand{\singleBox}[4]{%     \fill(\fpeval{#1}mm,\fpeval{#2}mm) rectangle     (\fpeval{#1} mm + \fpeval{#3} mm,\fpeval{#2} mm - \fpeval{#4} mm); }  \newcommand{\processNum}[5] % {     \fpeval{         \IfStringInList{#1}{1,17,130,109}{1}{0} ? #3 + 39 + (#4 + #5)   + (#2-1) :          \IfStringInList{#1}{4,11,100,189}{1}{0} ? #3 + 39 + (#4 + #5)*2 + (#2-1) :          \IfStringInList{#1}{9,19,124,167}{1}{0} ? #3 + 39 + (#4 + #5)*3 + (#2-1) :          0 } }  \begin{document}     \IfStringInList{17}{1,17,130,109}{1}{0} % Works just fine. [for debugging purposes].     \IfStringInList{16}{1,17,130,109}{1}{0} % Works just fine. [for debugging purposes].      \begin{tikzpicture}         \draw[draw=black] (0mm,0mm) rectangle (300 mm, 400 mm);         \singleBox{100}{200}{24}{13} % This works just fine. [for debugging purposes]         \singleBox{\processNum{1}{1}{0}{2}{1.46}}{200}{24}{13} % Fails at this line.     \end{tikzpicture}  \end{document}   The error message is:  Undefined control sequence. ...convertNum{1}{1}{0}{2}{1.46}}{200}{24}{13}


Boundary conditions for calculus of variations in phase space and under canonical transformations

This might be a stupid question, but I just don't get it. In Hamiltonian mechanics when examining conditions for a $(\boldsymbol{q},\boldsymbol{p})\rightarrow(\boldsymbol{Q},\boldsymbol{P})$ transformation to be canonical one starts with $$ \dot{q}_ip^i-H(\boldsymbol{q},\boldsymbol{p},t)= \dot{Q}_iP^i-\bar{H}(\boldsymbol{Q},\boldsymbol{P},t)+\frac{d}{dt}W(\boldsymbol{q},\boldsymbol{Q},t)$$ where $\bar{H}$ is the transformed Hamiltonian, and $W$ is the generating function (now a function of $\boldsymbol{q}$ and $\boldsymbol{Q}$). This term shouldn't break Hamilton's principle, since $$ \delta\int_{t_1}^{t_2} dt\frac{d}{dt}W(\boldsymbol{q},\boldsymbol{Q},t)=\delta W(\boldsymbol{q},\boldsymbol{Q},t)|_{t_2}-\delta W(\boldsymbol{q},\boldsymbol{Q},t)|_{t_1}=0-0=0 .$$ But I don't see why the variation of $W$ should disappear at the endpoints (say at $t_1$). Expanding leads to: $$ \delta W(\boldsymbol{q},\boldsymbol{Q},t)|_{t_1}=\left(\frac{\partial W}{\partial q_i}\right)_{t_1}\underbrace{\delta q_i(t_1)}_{=0}+ \left(\frac{\partial W}{\partial Q_i}\right)_{t_1}\delta Q_i(t_1)=\left(\frac{\partial W}{\partial Q_i}\right)_{t_1}\delta Q_i(t_1).$$ $\boldsymbol{Q}$ is itself a function of $\boldsymbol{q}$ and $\boldsymbol{p}$, so $$ \delta Q_i(t_1)=\left(\frac{\partial Q_i}{\partial q_k}\right)_{t_1}\underbrace{\delta q_k(t_1)}_{=0}+\left(\frac{\partial Q_i}{\partial p_k}\right)_{t_1}\delta p_k(t_1)=\left(\frac{\partial Q_i}{\partial p_k}\right)_{t_1}\delta p_k(t_1). $$ It seems as if we also needed the variation of $\boldsymbol{p}$ to vanish at the endpoints, and I don't get this because (at least in cartesian coordinates) $\boldsymbol{p}=m\dot{\boldsymbol{q}}$ and the velocity can be different along the original and the varied orbitals even at the endpoints (they can point in totally different directions), so in general $\delta \dot{\boldsymbol{q}}(t_1)\neq 0$. What am I doing wrong? Can someone help me with this, please?


Getting error: "There is no line here to end" when trying to do a line break between two paragraphs

I try to add additional space between two paragraphs but I'm getting the error:"There is no line here to end". I want to have exact two line breaks between each paragraph.  \documentclass[10pt, a4paper]{report} \usepackage{graphicx} \usepackage{ngerman} \usepackage[utf8]{inputenc} \usepackage{textcomp} \usepackage[T1]{fontenc} \usepackage{titling} \usepackage{times} \usepackage{setspace}  \vspace*{-2.54cm} \begin{document} \begin{center} \fontsize{16}{0}\selectfont \textbf{some text} \end{center}  \newline \newline  \begin{center} \fontsize{12}{0}\selectfont some other text \end{center}  \end{document}


Shapiro-Wilk and Kolmogrov-Smirnoff contradict each other

I am testing for normality. I have 5 subjects. I am looking to see the distribution for my baseline data. The normality score that I got for SW and KS contradict each other. SW said m data is normally distributed while KS says otherwise. How can this happen? What does it mean? And what should I do? Do I choose and pick either one?


I want to clone a node type and add a few fields in it. I think the simplest will be to duplicate it and start working on it.  It seems there is no official way to clone a content type in Drupal 7. Features may allow it but there is no written procedure as to how it could be done.  I've even tried  module.  What'll be best way to clone any content type in Drupal 7?


Can't connect to the device with ADB when it's in recovery mode

I am having some problems with my Samsung Galaxy S2 and I want to start an fschk session on the device.  So, I installed Android SDK with platform-tools. I can access to the device when it's normally rebooted but I couldn't list and connect to the device when it's in recovery mode.  How can I connect via ADB when the device is in recovery mode?


Problem aligning overlapping corner points in Illustrator

I am drawing some overlapping paths in Illustrator. However, some anchor points of different paths do not align correctly, they create some rugged corners. I tried to manually adjust the points with the direct selection tool but it is difficult to handle the corners.  Can anyone help me to fix the corners in the red circles?


How can I read an IMAP account via Gmail?

Is it possible to read an IMAP email address via my Gmail account?   According to  they only seem to support reading of POP3, but I find that a bit weird?


Infinitely many primes not congruent to 1 mod n

Given an integer $n>2$, prove that there are infinitely many primes $p$ such that $p\not\equiv1\text{ mod }n$. I read about the question  when $n=5$, where they used that $n$ itself is a prime. However, how should I prove it for any natural $n$? I got the hint "consider the polynomial $nx-1$" and tried to prove by contradiction, buy I couldn't go any further. Thank you!


find index of values containing keyword in array python

I want to find the index of values that contain a keyword in an array.  For example:  A = ['a1','b1','a324'] keyword = 'a'   I want to get [0,2], which is the index of a1, a324  I tried this list(filter(lambda x:'a' in x, A)) But get ['a1','a324'] rather than the index.


Sorry for the vague title but I wasn't sure how to describe my wish/problem.   A while ago I made a sidebar with a few widgets that I can add.    It displays time, date, windows volume, how many % my phone is charged (once connected), some equalizer bars and song + artist currently playing on Spotify.    At the moment the bar is on the right hand side of my main monitor. What I want is to put it on the left side of my secondary monitor. (not quite relevant)  I would like this sidebar to act as if its the end of the screen. So if I would maximize an application it would end at the border of my sidebar.  I made a little image to illustrate the goal. Red is the sidebar and blue is a random application.    Does anyone know if and how this can be achieved? If anything else is unclear let me know :)  Thanks in advance.


How do I draw a vertical dotted line separating two columns?

multicol or memoir would be preferred. \columnseprule, I understand, is responsible for drawing a solid vertical line between columns. Is there a parsimonious way to achieve the following?  -----pretext--- ###### : ###### ###### : ###### ###### : ###### ###### : ###### ###### : ###### ###### : ###### -----posttext--


Suppose that $x_1,.\dots x_{10}\in[0,\frac{\pi}{2}]$ and that   $$ \sin^2x_1+\dots \sin^2x_{10}=1. $$   Prove that   $$ 3(\sin x_1+\dots \sin x_{10})\leq \cos x_1 +\dots +\cos x_{10}. $$


Given two lists (not necessarily sorted), what is the most efficient non-recursive algorithm to find the intersection of those lists?


I have a question regarding the usage of articles.  What is the difference between "a" and "the"?   Why do I need to use "a" in "that was a winter I"ll never forget."? Can I use "the" instead?  Also, why do I need to use "the" in "that was the winter we went to Norway"?  Thank you very much!!^^


Will Dynamically added alt tag and title tags to image or any tag counted in SEO crawling

In my page I need to add alt tags and Title tags from JavaScript after the DOM is loaded.   So I would like to check whether these dynamically added values will be considered during Google SEO audit.  If they are not counted, what is the solution to get dynamically appended alt tags considered.


Why would we write equals method in Java with Object as argument?

I'm doing a course in Java and very frequently when equals method is defined in new classes its argument is Object rather than the actual type of the class. Code example:  public class TestClass {     String label, value;     public TestClass(String label, String value) {         this.label = label;         this.value = value;     }      public boolean equals(Object o) {         TestClass t = (TestClass) o;         return this.value.equalsIgnoreCase(t.value);     } }   Why is this a good practice? Maybe if I want to use polymorphism later this would be helpful. Is it a good practice to use Object as argument even if I don't think currently that I'll need polymorphism but I should still account for it just in case?  Also what bothers me is that we never check whether the object will actually be of type TestClass. Why should we have an instanceof check?


How to prove $|\int \limits_a^b f(x) dx|\leq\int \limits_a^b |f(x)|dx$ for f continuous? This is a step in the solution of a problem from Mendelson's introduction to topology. This book assumes the reader has only a background in first-year calculus, not measure theory or advanced calculus.


I have a question for you guys. I want to compare the date of today and an other self made date. The date of today is called a and the name of the self made date is b. If ais later then b I want to do something, but how. And the date format should be year,month,day,hour,minute,second e.g: 2015,03,20,09,58,44


Why are there two files for each picture?

I'm new to the DSLR world and I can't seem to figure out why I have two copies of all of my pictures when I go to load them on my computer. Is there a way to turn this off so I don't have to go through and delete one copy of everything all the time.


I'm trying to set up an automated deploy script from a windows image. During testing, I'm running into an issue regarding the the part that tries to catch if something went wrong with certain commands.   Instead of stopping the script, the script keeps thinking that it's successful and just keeps going to the next command even though the previous command encountered an error.   I tried adding an else to the sections to see what went wrong and I noticed that the error level was at 0 after executing the command. Unless echo itself sets an error level. Here's the relevant section of the code.  Edit: I isolated the root cause to this code section. I also got rid of the imagex step to reduce complexity and variables.  @echo off setlocal  set /p i_understand="Begin failure test? (Y/N) "   if "%i_understand%"=="Y" (  rem Deliberately causing diskpart to fail by using a nonexistent file.  diskpart /s doesnotexist.txt  if %ERRORLEVEL% NEQ 0 (     echo Diskpart failed and caught.     endlocal     exit /b 1 )   echo Diskpart failed but not caught. Error level is %ERRORLEVEL%  ) else (  echo Variable i_understand is %i_understand%  echo Aborting. )   If I reduce the code to the one below, the error level is properly set:  @echo off setlocal rem Deliberately causing diskpart to fail by using a nonexistent file. diskpart /s doesnotexist.txt if %ERRORLEVEL% NEQ 0 (     echo Diskpart failed and caught.     endlocal     exit /b 1 )   The idea was to display warnings then get a final answer with a capital "Y" for "Yes, I know this script is dangerous and I know what I'm doing." before proceeding with any other input being interpreted as a denial for safety.   Of course, many things could go wrong during the process. Maybe the network drive connection gets cut off, something causes the target drive to be inaccessible or something yet unforseen causes one of the commands to fail. In this case, the script stops whatever it's doing and leaves a log of the console output up to this point.  Naturally, during my tests, I encountered a bunch of failures due to misconfigured variables but the script kept chugging along as though nothing happened.


Can a user who is not question owner "un-accept" an answer?

Possible Duplicate:    Is it possible to give users with sufficiently high scores the possibility to "un-accept" answers that were accepted by question owners? Here is a real-life scenario. A user asks . Another user supplies . The question owner accepts the answer, but then the reality changes and the answer isn't correct anymore. Another user leaves a comment to the originally accepted answer and also supplies an . However, question owner does not bother "un-accepting" the outdated answer and "accepting" the correct one. In that specific case the original question dealt with a missing feature of PyDev (python IDE), the originally accepted answer was "there is no such a feature", but then this feature was added to the program and relevant answer was added.


Why are tcpdump packets being dropped by interface?

I'm using Ubuntu 14.04 via Virtual Box on a Windows 7 host. The NIC is a USB to Ethernet adapter.  The  states what can cause "packets dropped by kernel" but it doesn't state what causes "packets dropped by interface".  Can anyone shed some light as to why the interface may be dropping packets? Or how I can find out the reason for it dropping the packets?


Obtain image width and height without loading image in .NET?

Like the Title, is this possible?   I only need the width and height, so loading the image into ram would be unnecessary.


I'd like to run a python script when people log in to the server. I thought editing /etc/motd would be the best approach, but since it's only readable file, that won't work.  I found pretty much identical post:   What would be the best solution here? I'd like to run a script that shows the overview of the server, so the users would see the status immediately.  This was suggested A useful practice is to put the command you want to be executed in a script named /etc/motd.sh and call this script from /etc/profile, usually at about the end of it.  but received this comment Putting output like a MOTD in your profile is likely to break sftp.  Any solution will do. Thanks in advance


Best way to list files in Java, sorted by Date Modified?

I want to get a list of files in a directory, but I want to sort it such that the oldest files are first.  My solution was to call File.listFiles and just resort the list based on File.lastModified, but I was wondering if there was a better way.  Edit: My current solution, as suggested, is to use an anonymous Comparator:  File[] files = directory.listFiles();  Arrays.sort(files, new Comparator<File>(){     public int compare(File f1, File f2)     {         return Long.valueOf(f1.lastModified()).compareTo(f2.lastModified());     } });


What do grey backgrounds signify on a user's account list?

I've recently noticed (within the last few weeks or so) that when I view certain users' network profiles and click on the 'Accounts' tab, some of their accounts are highlighted with a grey background:  There doesn't seem to be any pattern behind which accounts are highlighted in this manner, but I'm assuming there must be one. What do these grey backgrounds signify?


I'm sorry, I know others have asked similar questions to this but I read those answers and still couldn't figure this out.  I need to make  Whatever    StudentID   SchoolID    Types     qw          1           A           c     we          2           B           a     we          2           B           r     ty          3           C           f     ty          3           C           t     yu          4           D           k   into  Whatever    StudentID   SchoolID    Types     qw          1           A           c     we          2           B           ar    -- concat ty          3           C           ft    -- concat yu          4           D           k   Thanks for your help. I tried using xml paths but couldn't figure it out.


What is the name of the genre of games similar to Jetpack Joyride?

I'm trying to figure out what the genre of games is called in which the only (or primary) control is to hold a single down a button to move the vehicle/character up and when letting go of the button, you float or move down. You generally try to avoid obstacles by moving above or below them.   Examples of this genre would be , or Jetpack Joyride. There are no doubt many others that you may have run across over time as well. I just didn't know if there was a genre name for them. I've seen things like 'cave flyer' or 'dodging', didn't know if there was anything better or official to classify them.


Is it safe to dist-upgrade directly to "Buster" from "Jessie" (skip "Stretch")

I find myself in the situation that the LTS for a Debian-Jessie server that i manage ended in June and i need to upgrade. I would like to upgrade to Debian 10 "Buster" directly. Question is: can i safely skip the upgrade to Stretch and directly apply the source-lists for Buster? Or is it recommended to migrate to Stretch first? (Fresh install is not an option. And yes i know that Stretch is in LTS right now)


Shading for my hands geometry is different to rest of model

Also when i export my fbx and import is into unreal the hands are like semi see through and transparent.  Thanks In Advance!!!!


JAVA - remove elements from a String array list

I have an array list containing the following data;  [pagoda, hour, hour experience, pagoda, car, eatables, eatables water, walk, small, small garden, little, little hot, jungle, jungle beach, restaurant, ocean, local, room, morning, guy, pagoda small, small garden, hour experience, peaceful environment, view]   I want to check if an element in the arraylist contains value of another element, and if so remove the element which has the shorter length.  Eg:- look at hour, and hour experience in the arraylist above. I would need the method to remove hour element and keep only hour experience element.  This is what I wrote. But it doesn't work that well.  public void removeDuplicateKeywords(ArrayList<String> list){         System.out.println(list);          for(int i=0; i<list.size(); i++){             String keyword = list.get(i);             for(int j=i+1; j<list.size(); j++){                 if(keyword.equals(list.get(j))){                     list.remove(j);                 }                 if(list.get(j).trim().contains(keyword.trim()) && list.get(j).length() > keyword.length()){                      list.remove(i);                 }              }          }         System.out.println(list);     }   This will print  [pagoda, hour, hour experience, pagoda, car, eatables, eatables water, walk, small, small garden, little, little hot, jungle, jungle beach, restaurant, ocean, local, room, morning, guy, pagoda small, small garden, hour experience, peaceful environment, view]  [hour, hour experience, car, eatables water, walk, little, little hot, jungle beach, restaurant, ocean, local, room, morning, guy, pagoda small, small garden, peaceful environment, view]   Please help. Thanks in advance.


Proof a graph is bipartite if and only if it contains no odd cycles

How can we prove that a graph is bipartite if and only if all of its cycles have even order? Also, does this theorem have a common name? I found it in a maths Olympiad toolbox.


Package babel Error: You haven't loaded the language french yet

I just got LaTeX up and running and started following some basic instructions.  The first time I followed the beginning over here:   \documentclass{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{geometry} \geometry{a4paper} \usepackage[francais]{babel} \title{Premier document} \author{Un TeXnicien} \date{} \begin{document} \maketitle Voici un texte accentué en français! \end{document}   Now, afterwards I restarted the program and made a new TeX file. However, this time I can't run this:  \documentclass{article} \usepackage[english]{babel}  \begin{document} test \end{document}   Because I get the error in the title. What's up with this? I'm using TeXworks.


Intuitive reason why $ \frac1j > \int_{j}^{j+1} \frac1x dx $ for $j$ < $x$

In an Econometrics - Time Series textbook (Hamilton), I saw the claim, without proof: Consider the sequence $ \psi_j $, then, for $ x > j $, $ \frac1j > \frac1x $, and therefore: $$  \frac1j > \int_{j}^{j+1} \frac1x dx $$ for $x$ > $j$. When I plug in numbers for $j$, I see that this is indeed satisfied. But I'd like to know the intuition behind this or a proof.