I just installed Texlive 2014, and ran into this problem: . The solution is apparently to remove LGRx from \usepackage[LGRx,T1]{fontenc}; but I'd rather use something like this:   \ifnum \texliveVersion<2013   \usepackage[LGRx,T1]{fontenc} \else   \usepackage[T1]{fontenc}   \usepackage[greek,english]{babel} \fi   Anything like this out there, which would not require me to run -shell-escape everytime - just in case I need to compile the same document on the machine that has earlier TexLive?    EDIT: this is what I meant - this should be the code in  , but with a conditional switch for Texlive2014; unfortunately it crashes with ! Undefined control sequence.  l.50 ...\bbl@monogreek \bbl@monogreek=\l@monogreek:  \documentclass[a4paper]{article}  % https://tex.stackexchange.com/a/16794/2595  \begingroup\makeatletter\endlinechar=\m@ne\everyeof{\noexpand} \edef\x{\endgroup\def\noexpand\TeXLiveVersion{\@@input|"pdflatex -version | awk '/TeX Live/{print substr($5, 0, length($5)-1);}'" }}\x  \typeout{TexLive version is: \TeXLiveVersion}  % https://tex.stackexchange.com/a/191705/2595  \ifnum\TeXLiveVersion<2014 %   \typeout{TexLive version is smaller than 2014, using LGRx} %   \usepackage[LGRx,T1]{fontenc} % \else %   \typeout{TexLive version is >= 2014, NOT using LGRx} %   \usepackage[T1]{fontenc} % \fi %  % \usepackage{xgreek} \usepackage[utf8x]{inputenx} \usepackage[english,greek]{babel}  \begin{document}  The starting verse of the Iliad is \begin{quotation}\greektext Μῆνιν ἄειδε, θεά, Πηληιάδεω Ἀχιλῆος \end{quotation} and it's really great.  \end{document}

I would like to be able to automatically determine which release of TeXLive that I am running. I sometimes encounter a problem where it is useful to test that the file compiled correctly in an older release first, before trying to debug the problem. Currently, I have updated my code to use the new features of the  as per .  Along with the datatool update, I updated all the other packages and am now encountering  a problem that at least seemed to have worked properly for over a year now. But it is not simple to switch back to running the older TeXLive2011 as it does not have the new packages. And of course updating the packages of the 2011 would kind of defeat the purpose of here. :-) The MWE below runs fine with the latest updated TeXLive2012 (Version 2.13 of datatool or later). But, in order for this to run with an older release, one needs to manually edit the \def\TeXLiveVersion version to something other than 2012. References:     Notes:  For the MWE to be useful, an older release is required as there is no issue here with the current TeXLive2012. Or, if you have not updated your packages lately and have v2.12 (or older) version of datatool package (in which case this won't run unless you manually edit the \TeXLiveVersion to:   \def\TeXLiveVersion{2011}%   Here is an older question where I had a problem with TeXLive2011 (but the file compiled fine with TeXLive2010):  . At that time I had manually changed the preamble, but again that is a case where an automated solution would have been useful.  In case it is not obvious, the actual output of the MWE here is not important. It is a cooked up example to show a case where I need to know which version of TeXLive I am using, and a way to test that the proposed solution of determining the version actually worked.   Code: \def\TeXLiveVersion{2012}% <--- Don't want to have to manually specify this  \documentclass{article} \usepackage{datatool} \usepackage{pgffor} \usepackage{xstring} \usepackage{letltxmacro}  %\usepackage{filecontents}% Commented to prevent overwriting MyData.csv \begin{filecontents*}{MyData.csv}     Directory, Color     ../dirB,    red     ../dirC,    yellow \end{filecontents*}  \LetLtxMacro\MyDTLcleardb{\DTLcleardb}% Default to 2012 and future \IfEq{\TeXLiveVersion}{2012}{% }{%     \newif\ifDTLnewdbonload%     \LetLtxMacro\MyDTLcleardb{\DTLdeletedb}% }%  \begin{document}  \DTLnewdb{MyDB} \DTLnewdbonloadfalse% don't let \DTLloaddb create a new database   \foreach \x in {1,...,5}{% Read DB numerous times     \typeout{count=\x}%     \MyDTLcleardb{MyDB}% clear database     \DTLloadrawdb[keys={Directory,Color}]{MyDB}{MyData.csv}% }%  \par\noindent\DTLdisplaydb{MyDB}% Some output to have a PDF \end{document}


What does this code mean? I know that we are declaring var points as an array and we're using a loop but im not too experienced to fully understand. can someone elaborate?    var points = [];     for (var i = 0; i < x; i++) {       points.push( random() );     }     return points;   };

How do I append an object (such as a string or number) to an array in JavaScript?


I have been trying to understand how this interpretation works. For this I have used the article "Interpreting the Parameters of Loglinear Models" from Alba, but  I am really stuck.   I his article he derives the logit equations for a polytomous dependent variable (Intermarriage). So fa so good. The coefficients obtained are as follows:     but then Alba calculated the Odds ratios for Intermarriage (different versus same ancestry), by ancestry, cohort, generation and gender. I cannot figure out how he obtained the highlighted values. Anyone can explain/derive the values highlighted in red please?    I am sure there must be some easy explanation, but I wasn't able to figure it our.

I've been having a hard time trying to understand the use of logistic regression in a paper. The paper available  uses logistic regression to predict probability of complications during cataract surgery.   What is confusing me is that the paper presents a model that assigns odds ratio of 1 to baseline described as follows:     A patient whose risk profile was in the reference group for all risk indicators (ie adjusted OR=1.00 for all in Table 1) may be regarded as having a ‘baseline risk profile’, and the logistic regression model indicates a ‘baseline predicted probability’ for PCR or VL or both=0.736%.   So the probability of 0.00736 is presented with odds ratio of 1. Based on the transformation from probabilities to odds ratios: $o=\frac{p}{1-p}$, this can't be equal to 1:  $0.00741=\frac{0.00736}{1-0.00736}$.  It gets even more confusing. The composite odds ratios that represents multiple covariates having values different than the baseline is used to calculate predicted risk.      ...the composite OR from Table 1 would be 1.28 X 1.58 X 2.99 X 2.46 X   1.45 X 1.60 = 34.5, and from the graph in Figure 1, we see that this OR corresponds with a predicted probability of PCR or VL or both of around 20%   The only way to arrive at the values the paper is giving as examples is to multiply the baseline probability with composite odds like this: $0.2025=\frac{(34.50\ \times\ 0.00736)}{1\ +\ (34.50\ \times\ 0.00736)}$.  So what is going on here? What is the logic for assigning odds ratio 1 to a baseline probability that is not 0.5? The update formula I've came up with above comes up with the right probabilities for examples in the paper but this is not the direct multiplication of odds ratio I'd expect. What is it then?


I have several java non-maven projects (with one main project) and several maven projects (with one main project). Now I need to use the maven-projects functionalities in the non-maven projects.  I have to say, I know very little about maven. And I'm working in NetBeans IDE.  There are several options I've come up with:   Make non-maven projects maven projects and add dependencies. I cannot do that because others use the non-maven projects their way and I cannot just make changes like this. Make maven projects non-maven projects and add them as Libraries I cannot do that because there would be a lot of libraries to add. The dependencies might be large. To non-maven projects add jars as libraries of the maven projects. This is same as the (2) option. I tried it and added all the maven project jars as libraries to my non-maven main project, but at a run-time there was a lot of NoClassDefFoundError exceptions because of missing jars (3rd party jars that the maven projects depends on). ?   Any ideas?  Thank you in advance.    Solved  I used the pom adjustments from chresse. The whole pom is here:   I used the maven command from the question Tunaki marked this was duplicate of () mvn clean compile assembly:single  Thank you all.

I want to package my project in a single executable JAR for distribution.  How can I make a Maven project package all dependency JARs into my output JAR?


I am trying to make a working script with LOGIN and REGISTER, and i can't read user information after he logged in.  I am using cookies to make sure he is "online" and he is, everything is working good.  The problem is that i can't read his information, don't know why.  $sql = "SELECT mod FROM korisnici where user = "'.$_COOKIES['username'].'"";   And if i put cookies['username'] instead of admin(real username), still doesnt work.  I am trying to get only MOD.

If user input is inserted without modification into an SQL query, then the application becomes vulnerable to , like in the following example:  $unsafe_variable = $_POST['user_input'];   mysql_query("INSERT INTO `table` (`column`) VALUES ('$unsafe_variable')");   That's because the user can input something like value'); DROP TABLE table;--, and the query becomes:  INSERT INTO `table` (`column`) VALUES('value'); DROP TABLE table;--')   What can be done to prevent this from happening?


I have point data about wind turbines across a country with information about the power output. Second shapefile I have is the country state borders (polygon). I now want to color the state polygons according to the total power of the turbines in the polygon.   How can I do that with QGIS?

I have two layers. Layer 1 contains points (x,y) and layer 2 contains one polygon. All points in layer 1 are positioned within the polygon of layer 2. The points in layer 1 contain an attribute with information on the topography/elevation at the specific point. Can I color the polygon in layer 2 based on attributes from the points in layer 1 in order to create an elevation map?


I tried to have the same counter for the AMS and algorithm2e algorithm-environment with   \usepackage{aliascnt} \makeatletter \let\c@algocf\relax \makeatother \newaliascnt{algocf}{thm}   as described here .  Here is my MWE code. It is created with Lyx, as this is what I use for my thesis.  %% LyX 2.1.4 created this file.  For more info, see http://www.lyx.org/. %% Do not edit unless you really know what you are doing. \documentclass[english]{article} \usepackage[T1]{fontenc} \usepackage[latin9]{inputenc} \usepackage{amsmath} \usepackage{amsthm}  \makeatletter %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands. \theoremstyle{plain} \newtheorem{thm}{\protect\theoremname}   \theoremstyle{plain}   \newtheorem{lyxalgorithm}[thm]{\protect\algorithmname}  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands. % algorithms \usepackage[linesnumbered,algoruled,boxed,lined,english]{algorithm2e} \usepackage{aliascnt} \makeatletter \let\c@algocf\relax % drop existing counter \makeatother \newaliascnt{algocf}{thm} \makeatother  \usepackage{babel}   \providecommand{\algorithmname}{Algorithm} \providecommand{\theoremname}{Theorem}  \begin{document}  \begin{lyxalgorithm} \label{alg1} Do stuff. \end{lyxalgorithm} \begin{algorithm}[H]  \label{alg2} Do other stuff. \caption{$\leftarrow$ Prints the correct number 2} \end{algorithm} \begin{lyxalgorithm} \label{alg:alg3} Just be! \end{lyxalgorithm}  Here is a reference to Algorithm \ref{alg1}, Algorithm \ref{alg2} and Algorithm \ref{alg:alg3}.     \end{document}   How do I make \ref{alg2} print the correct number 2 instead of 1?

\documentclass{article} \usepackage{algorithm}  \begin{document} \setcounter{section}{54} \section{A section with no label} \begin{algorithm} \label{myalg} \caption{An algorithm with the label `myalg'.} \end{algorithm} Reference to myalg: \ref{myalg}. \end{document}   With this code, the reference givens 55 (the section number); if I move the label after the caption command, I get the correct reference (1).  Why should this be the case? I find it confusing: when thinking about an algorithm as an environment, you expect to be able to label it right after you began it. At the very least I would expect some kind of error or "??" to appear, rather than the previous environment or reference-able entity being used.


We just started a group. The DM pitched the campaign as easier than his last campaign. We were in a forest, and he sent eight giants at us, at once! We barely made it out alive. He then said there was a village just five minutes from there, so we started travelling up that way. When we reached it, he described it as partly destroyed. While exploring the village, he sends twelve more giants at us! My team and I have asked him to stop sending so many giants.  One of my friends quit playing because of the large number of giants he sent. We had a party of five player characters, including me, all level 2, except a wizard at level 3. Two of my other friends said he shouldn’t DM anymore. One of my other friends said he could continue to DM but should have another player help guide him, so we let him try one more time, and he sent giants. Why does he keep doing this, and how do I get him to stop?

We have been playing a game for a while now, and while the game itself is quite enjoyable, the only problem is that the DM seems to be aiming to kill us. Sort of.  For example, there have been three situations where a player has been caught in a fight that there was no way they could manage:   One PC (a Rogue with incredibly low AC and HP) was targeted by an enemy forcing everyone to leave the room, and locking them out, then grappling the PC and slowly draining the life from him (dealing HP and CON damage). Another PC was forcibly injected with Bugbear blood (being an elf, started to turn)*, and the time between being infected and finding a cure effectively turned him into one. It got to the point where the player was still in control of the character, but he was attempting to kill the rest of the party. We did finally manage to restrain him and force the cure on him. A third PC, while having decided to go ahead of the party, was attacked by a mimic. This player had worse AC and HP than the Rogue, and was quickly downed. In the same situation, my character nearly fell to his death (though I believe that was due to a misunderstanding, rather than the intent of the DM himself).   We all agreed (while not directly to the DM) that the third situation was incredibly harsh. There was no way the player could deal with that situation on his own, and it would have been better if he had removed the monster completely, or moved it to a situation where more players could have been involved.  The DM is not inexperienced (he has been DMing for almost 30 years), so we believe that this is his aim. 90% of the time, even if we get good rolls, we all end up a lot more worse for wear, and the other 10%, one or more of us is incapacitated, and needs to be revived. It's starting to have an effect on the group.  How can we talk to the DM, and what might we suggest in hopes of changing his attitude toward “killing” player characters?    *Turns out this is plot device devised by our DM alone, I don't think there's anything in the rules about this.


Okay, first things first, I'm very basic when it comes to the field of physics, but I'm very good at coding, and I was wondering if I could simulate an atom.  I know that in order to make such a simulation, I have to understand the mechanics of the four fundamental forces.  Gravity:  $$\ F=\frac{Gm_1m_2}{r^2}$$  Electromagnetism: $$\ F=\frac{k_eq_1q_2}{r^2}$$  But I don't know what the rules are for Strong and Weak Forces.  I'm very aware of the possibility that we don't yet know such formulas, as made clear by several sources, but I also once remember going on a website and seeing someone with a slideshow showing each of the formulas for fundamental forces, some involving summations and undefined variables, but I can't find this website anymore.  If anybody knows the formulas for Strong and or Weak interactions or has verified that these laws aren't yet solved for, please leave answers below.

The equation describing the force due to gravity is $$F = G \frac{m_1 m_2}{r^2}.$$ Similarly the force due to the electrostatic force is $$F = k \frac{q_1 q_2}{r^2}.$$    Is there a similar equation that describes the force due to the strong nuclear force?  What are the equivalent of masses/charges if there is?  Is it still inverse square or something more complicated?


When running yum update, the below error message occurs     Loaded plugins: product-id, rhnplugin, security   redhat-rhn-satellite-5.5-server-x86_64-6                                                                                | 1.6 kB     00:00   : [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 403"   Trying other mirror.   : [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 403"   Trying other mirror.   : [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 403"   Trying other mirror.   Error: failed to retrieve repodata/e847e0e8ad4903bd2acbbeea4eb487dbd3af3061a40b5a7f074f9e60709d49b7-updateinfo.xml.gz from redhat-rhn-satellite-5.5-server-x86_64-6   error was [Errno 14] PYCURL ERROR 7 - "couldn't connect to host"   Yum fails with error     Error: failed to retrieve repodata/c964d1bced53b5fb02369d8429e2d2cd5a8699c6bab094b473f9e830afaa75a7-primary.xml.gz from rhel-x86_64-server-6   error was [Errno 14] PYCURL ERROR 7 - "couldn't connect to host"

I'm new to RHEL. Trying to install software this morning and running into road blocks. Is it required to have a subscription to download packages via yum on RHEL?  I'm coming across different sources on the net, some make it sound like yes, you need a subscription, others making it sound like no, a subscription is only required for support.  In either case I'm stuck unable to install software ATM, because the machines I'm on don't have the subscription registered. Is there a way to install RHEL software without registering a subscription? If so, how?


i am trying to save years into sql database which I got from subtracting two dates. DOB and Current date. But I get error   Input string was not in a correct format When converting a string to DateTime, parse the string to take the date before putting each variable into the DateTime object   I have tried converting the date to string  * Convert.ToString(txtAge);  Client    function CalculateAge() {                 var dob1 = document.getElementById("<%=txtDOB.ClientID%>");                 var age1 = document.getElementById("<%=txtAge.ClientID%>");                 var dateAry = dob1.value.split("/");                 var birthDay = parseInt(dateAry[0]);                 var birthMonth = parseInt(dateAry[1]);                 var birthYear = parseInt(dateAry[2]);                 var birthDate = new Date(birthYear, birthMonth, birthDay);                 var currentDate = new Date();                  age = currentDate - birthDate;                   mtg = new String(age / 86400000)                   point = mtg.indexOf(".")                           days = mtg.substring(0, point)                      years = days / 365;                  mtg = new String(years);                 point = mtg.indexOf(".");                      years = mtg.substring(0, point);                  age1.value = years.toString();            }

Given a DateTime representing a person's birthday, how do I calculate their age in years?


I am starting on a animation and every time I click something it waits and  says at the top of the window "Blender (Not Responding)".  I know what it means but is there a way to stop it from doing this? Its very annoying having to wait 7 seconds to select a bone. I don't know what to do I have tried turning of grid and outline selected and it still is slow.  Also, I am on a gaming laptop with a I7 and a gtx 960 so there should be no problems like with old computers.

Update  This has been confirmed resolved in a later version 376.33 and possibly the update prior.     Okay, I recently did a computer update. I used to run Blender 2.77 on a Dell desktop (5 GB RAM, 2.7 GHZ, Windows 8, build in graphics card). Since that computer wasn't fast enough for my preference, I saved up and got a new gaming laptop - the Asus ROG GL552 (Windows 10, 16 GB DDR4 RAM, Nvidia GeForce GTX 960M with 4 GB DDR5 RAM, 2.6-3.5 Ghz, and quad-core intel processor). That laptop has been known to have outdated drivers, so when I got it, I updated it to up to date Windows 10 drivers.  As soon as I started Blender, I immediately noticed its speed. Even doing simple things, like clicking buttons, or rotating the view with the middle mouse button, took too long to register in the program. I tried changing some User Preference System settings, but that didn't really help much. And the hardware seems to be fine - the render is lightning fast (renders the startup scene in under .1 second; it's just laggy when loading the uv screen), so I don't know why it's like this, or what to do. Also, I ran Blender 2.77 on this computer, and it was also slow (although it was fine on my previous computer).  It could be an issue with drivers perhaps (or maybe OpenGL?), but I ran Unreal Engine 4, and had none of the same issues - the speed was pretty decent on that; so I'm not sure why Blender would be so slow. Any help is appreciated - thanks guys!


I have the following script:  $ ls -al setprog.sh  -rwsrwxr-x 1 root root 52 Αυγ   2 10:23 setprog.sh   $ cat setprog.sh  #!/bin/bash  while [ True ] do     echo $(whoami) done   When running it  $ ./setprog.sh  pkaramol pkaramol pkaramol   Why the process owner indicated by ps (real user) and and the user by whom the program is executed (effective user?) match? Shouldn't the one of them be root given that the script is owned by him?  $ ps aux | grep -i setpr pkaramol 10294 18.0  0.0  12888  3268 pts/0    S+   10:45   0:00 /bin/bash ./setprog.sh pkaramol 16746  0.0  0.0  14432  1104 pts/1    S+   10:45   0:00 grep --color=auto -i setpr

The setuid permission bit tells Linux to run a program with the effective user id of the owner instead of the executor:  > cat setuid-test.c  #include <stdio.h> #include <unistd.h>  int main(int argc, char** argv) {     printf("%d", geteuid());     return 0; }  > gcc -o setuid-test setuid-test.c > ./setuid-test  1000  > sudo chown nobody ./setuid-test; sudo chmod +s ./setuid-test > ./setuid-test  65534   However, this only applies to executables; shell scripts ignore the setuid bit:  > cat setuid-test2  #!/bin/bash id -u  > ./setuid-test2  1000  > sudo chown nobody ./setuid-test2; sudo chmod +s ./setuid-test2 > ./setuid-test2  1000     Wikipedia :     Due to the increased likelihood of security flaws, many operating systems ignore the setuid attribute when applied to executable shell scripts.   Assuming I'm willing to accept those risks, is there any way to tell Linux to treat the setuid bit the same on shell scripts as it does on executables?  If not, is there a common workaround for this problem? My current solution is to add a sudoers entry to allow ALL to run a given script as the user I want it run as, with NOPASSWD to avoid the password prompt. The main downsides to that is the need for a sudoers entry every time I want to do this, and the need for the caller to sudo some-script instead of just some-script


I am trying but still unsuccessfully solving the following question:  For every positive integer $n$, show that any prime divisor of $12n^2 + 1$ is of the form $6k + 1$, where $k$ is an integer.  I would like, if possible, to get a solution that does not refer to Legendre symbol or quadratic reciprocity. That is: I would like to get, if possible, a more elementary solution.  I ask for help.

Let $n$ be an integer, prove that every prime factor of $12x^2+1$ has the form $6m+1$, where $m$ is an integer.  I've gone as far as knowing that all primes $p>3$ are either $6m+1$ or $6m-1$, how do I use this, not sure whether to even use that.  I know about the Legendre symbol and quadratic reciprocity


A section on a website has a list of links to PDF files (containing end user content).  When a user clicks on one of these links should it open in a new tab on the browser? Or should it open in the current tab/window?    I notice that when you click on external links on Twitter or Facebook they open in a new tab, but I am unsure about best practices for internal links to PDF documents.

When designing web sites should document files such as PDF, DOC, XLS, should the documents open in a new window/tab or in the current tab?


Given I have in a bash script  ev=USER   How can I get the environment variable value for $USER using ev?  Tried naively doing:  echo ${"$"$ev}   which results in bad substitution.  I'd expect to get back whatever the value of $USER is.

I have the following lines in my .cfg bash script file  DDF_SOURCE="siebel_DATA_DATE_FORMAT" DATA_DATE_FORMAT=${!DDF_SOURCE}   how is ${!DDF_SOURCE} evaluated? It would be !siebel_DATA_DATE_FORMAT, which doesn't make sense to me.


Problem  Let X be an infinite set and τ a topology on X with the property that the only infinite subset of X which is open is X itself. Is (X,τ) necessarily an indiscrete space?  So I have to prove that set contains only two elements namely X and $\emptyset$ . It can be shown that sets like X-{x} are not in topology.   How to proceed?

Let $X$ be an infinite set with $\mathcal T$ a topology on $X$. If $X$ is the only infinite subset of $X$ that is open, is $(X,\mathcal T)$ necessarily an indiscrete space?   My intuitive thinking leads me to think that the answer is NO. We know that, if it is the indiscrete space, then $\mathcal T = \{ \emptyset, X \}$. Notice, however, that we are only given tat $X$ is the only INFINITE subset of $\mathcal T$, we have no information regarding the other possible finite open sets of $X$, that is, there may exist a finite subset $A \subset X$ with $A \in \mathcal T$. This is surely not the indiscrete space, yet it still satisfies the criteria given in the question.  Is there a better exact example that I can provide that might help show my point in a more rigorous mathematical way?


I am trying to remove all the nvidia packages from my system using regex. But it gives me an error: E: Unable to locate package nvidia-*  Here's the command I am running: sudo apt purge nvidia-*  I don't know if I am doing something wrong or this simply isn't supported anymore. Would appreciate some help, thanks!

When I run this command :  apt install libkf5*   I get the following error :  Unable to locate package libkf5*    I'm sure that the packages whose names start with libkf5 exist (tab-completion says so) . So the problem is not about the absence of those packages.(Note the asterisk at the end of that error message , the wildcard's not working at all) I use apt v.1.9. Thanks in advance.


Find integer $n$ for which $n$ divide $2^n +1$.

Here is a problem which i have not been able to do for quite sometime.   For $n \geq 2$, show that $n \nmid 2^{n}-1$.   I have thought of proving this in two ways: One by using induction which didn't actually work. Next by Fermat's little theorem we have $2^{p-1} \equiv 1 \ (\text{mod} \ p)$, which actually says that for $p \mid 2^{p}-2$. But i couldn't proceed more than this. Any ideas by which i can actually solve the problem?


I have a problem with a too long line in the theorem environment. The following example shows the problem, I need a line break in the heading, but there is none. Any suggestions? \documentclass[a4paper,10pt,twocolumn]{article}  \usepackage{theorem} {\theoremheaderfont{\upshape\bfseries}  \theorembodyfont{\normalfont\slshape}  \newtheorem{definition}{Definition}}  \begin{document}  \begin{definition}[Long heading that should have a line break] A definition is a statement of the meaning of a term (a word, phrase, or other set of symbols). Definitions can be classified into two large categories, intensional definitions (which try to give the essence of a term) and extensional definitions (which list every single object that a term describes). A term may have many different senses and multiple meanings, and thus require multiple definitions. \end{definition}  \end{document}   Thanks for your help!

I have a theorem title, which is longer then the page width. How do I get the title in two lines?  \begin{theorem}[this title is to long for one line] the theorem \end{theorem}


the data looks as following:  id group date 1  a     2013-01-01 1  b     2014-01-01 2  a     2012-01-01 2  b     2013-01-01   My database is mysql, for each id, I need to select the line with max(date), I wrote the SQL as following:  select id,group, max(date) from table1 group by id;   But it does not work well.

In Sqlite 3 I'm trying to figure out how to select rows based on a minimum value.  I think that I'm limited by not knowing enough of the related terminology to effectively search google.  The table looks like:  num         text        num2       ----------  ----------  ---------- 0           a           1          0           a           2          1           a           3          1           b           4            I want to get the rows where num2 is 1, 2, and 4.  I want to do the selection based on the minimum value of num for each unique value of the text column.  So, for text = 'a', the minimum value of numis 0, so I want rows 1 and 2.  For text = 'b', the minimum value of num is 1, so I want row 4.  Using various combination of group by, I'm able to get either rows 1 and 2 or rows 1 and 4.  I feel like I'm missing a SQL component that would do what I want, but I haven't been able to figure out what it could be.  What is the proper way to do this type of query?  Possible Solution  I've found a way to do this.  I'm not reputable enough to answer my own question, so I'm doing the update here.  I'm not sure if it is always correct or what the efficiency is like.  Any comments are welcome.  I used a compound select statement, where one query finds the minimum value of num for each unique value of text:  sqlite> select num, text from t group by text having num = min( num ); num         text       ----------  ---------- 0           a          1           b            Then I joined this with the full table to get all rows matching these two columns.  sqlite> with u as       ( select num, text from t group by text having num = min( num ) )         select t.* from t join u on t.num = u.num and t.text = u.text; num         text        num2       ----------  ----------  ---------- 0           a           1          0           a           2          1           b           4


If a Chinese kid is raised by white American parents, he will most probably grow up to behave more like the white parents than Chinese. This is even more so for an alien raised by humans. At least whites and Chinese are humans.  How can Worf be so much more Klingon than human?   I may have missed out some episodes that explain this unusual phenomenon. In the episodes I watched, Worf behaved more like a Klingon than human.

Worf was rescued from the wreckage of the Khitomer colony by a Starfleet petty officer and raised amongst humans in a time when Klingon\Federation relations were somewhat shaky. How did Worf end up behaving with a Klingon cultural identity? How did the Klingon concepts of honor and behavior get so firmly enmeshed into his personality?


I have a dell inspiron 17r which has an Intel hd graphics 4400 video card and I get this strange green tint whenever I do a normal boot of Ubuntu 14.04. However, if I connect to hdmi on my tv, the screen color is normal for the tv. Also, if I boot in recovery mode the screen color is normal. Can anybody tell me what's going on? I've update my grub and I still have the same issue. Or is there a way I can edit a script that allows me to start in failsafe graphics mode every time (I'm assuming this is how recovery mode starts)?  HELP!!!!! I CAN NOT USE WINDOWS ANYMORE. I AM AT MY WITS

I have a Dell Inspiron 17R 5737 with an Intel Haswell Core i5 4200U, and an AMD Radeon HD8870 graphics card (switchable).  When installing Ubuntu (after checking disk for errors) and choosing "Try without installing", there's a green tint on the whole screen (where it's supposed to be pink/purple). I thought it might just be an issue that wouldn't show up after installing it onto the hard drive, and so I went on with the installation without any problems. My computer rebooted and I booted Ubuntu for some tweaking.   But the green tint was still there. I tried plugging in my LG HDTV via HDMI and on that screen there was no tint, but it was still there on my laptop.  What I'm wondering is why this happens and if there's any way to fix it, because I would really like to be able to use Ubuntu.


This is not a duplicate of  Because the question here includes that after I tried that, I still get gmail notifications.  I receive some email that I don't want to receive notifications for. Usually the kind of email that is sent to an email list.    I added some filters for various emails I receive like this e.g.     So they get the label regularblkmail  I don't want my phone to be notifying me whenever I receive an email like that.  And if that means that those emails don't even go into any primary inbox, and they go into some other category that I never see unless I click that category, or "all mail" then fine. But I don't want to get notifications.  If I go to the gmail app, and I push the 3 bars, and I go to 'settings', then pick my email address, that the email is going to, then choose Manage Labels.  Some labels say "not synced", some say "last 30 days".   The label "regularblkmail" says "last 30 days". (it used to say 'not synced' but I managed to get it to say synced to 'last 30 days'). When synced, which it is, it enables some options like "Label notifications". I unticked the box. But I still get notifications when the email comes.  I notice that one of the example emails has had 2 labels applied to it. "inbox", and  "regular blkmail".  I don't know if the fact that it has the 'inbox' label, is the reason for it notifying me? (if so i'm not sure how to make the filter not give that inbox label to that email).  How can I prevent notifications for certain emails I filter for?

Is there any way to stop the Gmail app from popping up a notification if you get an email from a specific sender?  My specific case is that I get a lot of emails from a careers site that I'm not usually interested in reading immediately so don't need to be notified about them. There's a  on the site but this is asking for the opposite.


If I go to Rovaniemi in October to visit the Santa Claus Village, is this a time when it is common to see the Aurora Borealis and maybe some snow?

I'm wondering what time of year is best, and what locations might be best, for catching the aurora.  I'm currently thinking of February up at Sweden's ice hotel, but since the whole point of the trip is so that my wife can see the Aurora, I want to pick a location that affords the best chances to see one.  Edit: Just adding a link so you can see realtime aurora activity in the northern hemisphere    I know this is anecdotal, but I ended up going to Iceland in late february during the new moon and saw the aurora 3 out of 6 nights I was there.  There was activity every single night but the biggest problem was weather.  It was cloudy almost every single night.


Related to the question , could anyone be able to explain to me what the notation $ \otimes $? Some examples were given in the question : $dx\otimes dx+dy\otimes dy = \frac12(dz\otimes d\bar z + d\bar z\otimes dz) = |dz|^2$ or $dw \otimes d\bar{w}$.  Clarification : I think my question is different of , because I would like some details on a specific example.

I came across the symbol $\otimes$ as below and I would like to know what this symbol $\otimes$ means:     $\text{.... the projection operator P is given by: }$   $$P = I_nd - \nabla G^T(\nabla G \nabla G^T)^{-1} \nabla G= I_{nd} - I_d \otimes uu^T,$$ where $I_x$ denotes the identity matrix of size $x\times x$ and $\mathbf{u}$ is the unit vector , $\mathbf{u} = (1,1,1,\dots,1)/\sqrt{n})$ in $\mathbb{R}^n$


My xy data (which is in lat/long) wont show up with my other layers which are also shown in lat/long. They appear in two different places.. any advice?

I have vector two sets of vector layers that won't show up together. One set shows up together and the other set together etc but they are of the same area.  The layers I was given did not have a defined spatial reference which I manually projected as the same as the data frame I specified so all layers now have same CRS...yet not showing up together. I have noticed they appear to have different extents... What should I do?


I have an external program that generates directories with strings that are negative integers. I am trying to use basic shell commands including cd and ls with this directory, for example:  cd -78059735  Understandably, this fails because this looks like command line options starting with -7.      -bash: cd: -7: invalid option   Similarly, these variations also fail:  cd "-78059735" cd "\-78059735" cd '-78059735' cd '\-78059735' cd \-78059735   How do I interact with this troublesome directory through the shell?

How do you remove a file whose filename begins with a dash (hyphen or minus) -?  I'm ssh'd into a remote OSX server and I have this file in my directory:  tohru:~ $ ls -l total 8 -rw-r--r--    1 me  staff  1352 Aug 18 14:33 --help ...   How in the world can I delete --help from a CLI?  This issue is something that I come across in different forms on occasion, these files are easy to create, but hard to get rid of.  I have tried using backslash  rm \-\-help   I have tried quotes  rm "--help"   How do I prevent the minus (dash or hyphen) character to be interpreted as an option?


Everyone of us had noticed air bubbles once in his life. They are Sphere in shape. But I want to know why the are sphere in shape, instead of any other shape.

I was studying surface tension recently. Rain drops or bubbles of any kind which form are always of a spherical shape.   This is because the liquid tries to minimize the surface area as the molecules on the surface have higher potential energy. The shape which most efficiently manages to do this is a sphere. This is the part I didn't understand; how exactly do we reach the conclusion that a sphere would be the most efficient shape? Why couldn't it be any other shape?


I am asked to calculate the area of a regular octagon given the side-length of 10 km.    I saw some examples saying that I should start by splitting the octagon into eight isosceles triangles, and that the length of the base would be 10 km, since we're given that the sides of the octagon are all 10km.  What I don't know is what to do next.

What is the area and circumference of a polygon with n equal sides? (triangle, square, pentagon all the way to a circle)  It doesn't matter if it's based on the radius (let's call it r) or the length n.  EDIT: I ment regular polygon.


I stumbled across the following integral:- $$I_{n}=\int\frac{\cos nx}{5-4\cos x}dx$$ where $n$ is a positive integer.  I have no idea how to proceed....I tried integration by parts and even writing  $\cos(x)=\frac{e^{ix}+e^{-ix}}{2}$  I couldn't make much headway..... Any ideas on how to proceed would be appreciated.     EDIT:  This question is different from @amWhy has marked..I want to evaluate indefinite integral ..Not the definite one.

How can I solve the following integral? $$\int_0^\pi{\frac{\cos{nx}}{5 + 4\cos{x}}}dx, n \in \mathbb{N}$$


I have little confusion with  $_SESSION   and  WP_Session   over their performance,which one is best to use. thanks.

I have a form with some checkboxes and inputboxes selectboxes and it shows what the user wants via an ajax call. The problem is that when the user click on the item and the detail page is shown and then decide to go back to the previous page he needs to click and select his previous choice again.  I would like to make WP to store all the options in the session when the button to the detail page is clicked and save actual info in the session and then when he visits the page again the  values will be chcecked in sessions and set if any are found.  Could that be done in WP?  If yes, how?  Let's oversimplify that and say that we have something like this in our form:  <input class="car_color" type="checkbox" name="car_color" value="1" /> <input class="car_color" type="checkbox" name="car_color" value="2" /> <input class="car_color" type="checkbox" name="car_color" value="8" /> <input class="car_color" type="checkbox" name="car_color" value="4" /> <input class="car_color" type="checkbox" name="car_color" value="6" />   I don't use submit button in my form, it's handled via AJAX on input change.  And in my results get via ajax I have a link to the detail page:  <a class="detail-info-link" href="<?php echo $url ?>">   Any idea how can I store my values in Session and call them when revisiting/reloading/back button in the browser?  I need to be able to read the session stored stuff and use it via ?Javascript? and trigger my search fuction via ajax which is already working well.  I just need to store (probably before going to $link in href of by detail button and read and send session variables (if they exist).


This is what I am trying to prove: $$\lim_{n \rightarrow \infty} \frac1{\sqrt[n] n}=1 $$  How do I go about this?

I've spent the better part of this day trying to show from first principles that this sequence tends to 1. Could anyone give me an idea of how I can approach this problem?  $$ \lim_{n \to +\infty} n^{\frac{1}{n}} $$


How do you get the "Diamonds to you!" achievement if you're in single player?

How can one get the "Diamonds to you!" achievement in singleplayer? The achievement list cannot be completed without it. Perhaps it can be possible by passing a diamond to a zombie?


if($_GET['s']<>''){      $explode = explode(' ',$_GET['s']);     $num = count($explode);      for($i=0;$i<$num;$i++){         $busca .= " `nome` LIKE :busca$i ";//OR `district` LIKE :busca$i OR `city` LIKE :busca$i OR `area` LIKE :busca$i ";          if($i<>$num-1){ $busca .= ' AND '; }      }     $buscar = DB::getConn()->prepare("SELECT * FROM users WHERE $busca");     for($i=0;$i<$num;$i++){         $buscar->bindValue(":busca$i",'%'.$explode[$i].'%',PDO::PARAM_STR);     }     echo "$busca";       echo "$explode[0]";     $buscar->execute();   }   The echos work alright but the its not binding the values on $buscar it returns:  nome LIKE :busca0  It does not put the value from $explode[0] on $busca0 and the echo for explode is working properly...

Is there a way to get the raw SQL string executed when calling PDOStatement::execute() on a prepared statement? For debugging purposes this would be extremely useful.


I have 3 scripts:  Script A:  echo "Hey you!"   Script B:  source ./A.sh   Script C:  source ./libs/B.sh   So scripts A and B in folder "libs" and script C use script B from this directory.  Script C throw Error:     ./libs/B.sh: line 1: ./A.sh: No such file or directory   How to correct use script "including" in this case?  I understand why this error occurs, but I do not understand how to fix it. Also! I do not want to include with full path as / home /.../libs/A.sh etc. I want to create move-free scripts without permanent editing.

How do I get the path of the directory in which a  script is located, inside that script? I want to use a Bash script as a launcher for another application. I want to change the working directory to the one where the Bash script is located, so I can operate on the files in that directory, like so: $ ./application


If $f:A \rightarrow B$ is a bijection and $S \subseteq A$, prove that $f(A \backslash S) = B \backslash f(S)$

Are there some good overviews of basic facts about images and inverse images of sets under functions?


Please suggest some books or some courses I can take online. Given that I know nothing about typography or design.

Hum,  I would like to buy myself a book about typography. I have a lot of interest in this field, and already have some knowledge learnt from reading  now and then, among other online sources. I would like to consolidate my knowledge with a book about typography, possibly a mix of theoretical considerations and examples (I quite like the balance achieved, for example, in the Tufte books).


I have this command I want to run once every day with my QNAP NAS (linux):   wget 'http://url.link' -O catalog/output.file   In terminal it works fine and the file is downloading but when adding it to crontab it doesn´t download.   I have tried this line in crontab:   08 20 * * * wget 'http://url.link' -O catalog/output.file   Can someone help me why this isn´t downloading at 20.08?

I have a notify.sh script that looks like:  notify-send "hi welcome"   My crontab notification for 2 PM:  0 14 * * * home/hacks/notify.sh   However, this doesn't work. What is the problem?


I am trying to make a custom microsip project. But, it gives me the error of  LNK1104, cannot open file opus.lib  I don't have the lib, nor I can find it online. I have downloaded from , but can't make the build out of it. How am I suppose to? there are just some .exe files and html files.

I've created a new C++ project in Visual Studio 2008.  No code has been written yet;  Only project settings have been changed.  When I compile the project, I receive the following fatal error:     fatal error LNK1104: cannot open file 'C:\Program.obj'


The "cite" option on a question is an option only shown on , , , and .  To quote @FranckDernoncourt, the "cite" option is:  To make it easier for people writing research publications or other types of documents to cite Stack Exchange questions or answers. The cite option generates a reference that is easy to cite in TeX, which is often used by researchers (and pretty much always in maths/physics/computer science).  I believe the rationale is only showing cite on SE websites that are more likely to be cited in research publications.  And how do we predict the sites most likely to be cited?  Couldn't we make this available for all the sites on Stack Exchange?

The  and  Stack Exchange sites have a great feature that allows a user to quickly . This is accomplished by clicking share and then clicking cite:    For ease of copying and pasting the cite feature even provides the  and  LaTeX formats (something which probably wouldn't be needed on other sites).  Currently I am working on a paper which has heavily referenced the  site. As such having the ability to quickly cite each question / answer would be incredibly helpful. While I agree the ability to easily cite is more applicable to certain SE sites, this seems like a frictionless feature with a lot of benefit.  Is there a reason this feature isn't available across the entire Stack Exchange network? Is this something that each Stack Exchange site needs to decide within its community (i.e. I need to move this discussion to meta.ux.se)? Can the ability to cite question and answers please be added to all other Stack Exchange sites?


I have used following code to print the classpath from inside of jar (build with intelliJ):      URL[] urls = ((URLClassLoader) ClassLoader.getSystemClassLoader()).getURLs();     for (URL url : urls) {         System.out.println(url);     }   However this throws NullPointerException. What am I doing wrong?

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


I'm studying agreement of tenses in indirect speech,  and it says we should change tense in accordance with the tense of the main clause's verb, as in     Argentina and France will both reach the final. --> In 2002, Pele said Argentina and France would both reach the final      He asked, "Are you single?"   --> He asked me if I was single.      I asked, "Did you buy the book?" --> I asked him if he had bought the book.   But then, one example sentence in the book is written,     Mike seemed frustrated because of that(the fact that some stakeholders care only about make more profit, not the environment). He wondered if sustainable development is even possible in this condition.   I think the verb here, "is", should be "was" as I was taught in the book,  since the verb of the main clause is written in past tense, "wondered". (and thus the verb in indirect clause should follow the tense of the main clause.)  Is there anything I'm missing on?

Grammar rules say that when converting a sentence from direct speech to indirect, the reported speech is converted to past tense if the first part of the sentence (reporting verb) is in the past tense.  Direct speech: John said, “I will give you a pen”. Indirect Speech: John said that he would give me a pen. S1: I wanted to let you know that he has sent you an email S2: I wanted to let you know that he had sent you an email  I have seen people write S1 even though it doesn't follow the grammar rule regarding change of tense in the reported speech. Which of these ones correct and incorrect? Why correct and why wrong?


When I try and move some vertices, scale, extrude, rotate, all those things, it automatically makes it a whole number rather than decimals.  Sorry this is so hard to explain. Say for example a point I want to move is at 0 on x. When I try and move this, x will change to 1 rather than say 0.1. Then it will change to 2. So basically the intervals in which I move and extrude objects is different now.  Once again I'm really sorry for my poor explanation. I'm looking around in differnet settings but I don't even really know what I'm looking for. I'll try and provide a video if you do not understand what I'm saying.  Thank you!

My cursor is moving by every selection by large increments!  Normally when I use Blender, I am able to select and move objects to any coordinate. Now, all of the sudden, when I select an object or mesh the selection moves by an inch or so in each direction.  How do I reset it to normal?


In a web application I wonder what's best practice to design an element (text link, button) pointing to an action where users don't have access to (e.g. create new user). Esepcially when this element is not the primary element of the page, but just like one link of many links.  I see the following possibilities:   Hide the corresponding element (link to create) - in thise case users could wonder where the action to create a new element can be found Disable the corresponding element (link to create) - in this case the user could wonder why the element is disabled so an explanation would be needed Show an error message Show an error page - in this case the user would have to jump back

Possible Duplicate:          On a create/edit form, where the options available to the end user will depend on their previous input, in order to give the user some guides on how to fill the data, we shall:   Disable the controls and enable them only when the pre-requisites are meet. Hide them instead Do nothing Other options   Example: when asking who is the legal representative of someone, the form will contain a combobox with the following options: the own person, their parents or someone else. Only in the case the user chooses someone else, he was to fill a textbox telling who.  Which option will provide the best user experience?


has posted a question which has been closed as off-topic. However, they earned 6 reputation from it (thanks to someone who upvoted it). Despite this, they have 1 reputation being shown in their profile (and no they haven't been suspended).  I figured this out after I saw their reputation graph.  How is this possible? Note: Since now the question has been deleted, everything is back to normal. Also, I am not saying that the user should have had those reputation; I just want to understand the system.

If a post is deleted as spam or offensive, the user incurs a 100-rep penalty.  But SE made the conscious decision to not call that out on the reputation tab; if you go to the page of a user who's hit this penalty, you won't see those "-100" events in the history.  The big rep number on the profile will be correct (which is important for knowing about privileges), so you'd only notice the difference if you went through the history and added everything up -- probably not something that happens often. So these rep penalties would be invisible to most viewers, but for one thing:  (You'll need to get your own test case to verify this behavior; I'm not going to call out specific users.) How is the current rep both 404 and a smidge over 500 at the same time?  There's only one way I know for that to happen (and I know it happened here). You might think that, theoretically, answers that the user downvoted could account for the difference, because those too are not shown in rep history. But the -1 rep for downvoting answers is reflected in the graph, even if an audit of the rep history would come up with a different number. Additionally, reputation changes from normal deleted posts don't cause a discrepancy between the graph's reputation and actual reputation either. If we don't want to call out these events in the rep history, should we also do something about this graph to avoid broadcasting what happened in the summary?


today I came across a vector symbol in electrostatics denoting the position vector of a test charge with respect to a source charge. The symbol is attached. I searched for the same on the internet but could not find it. Can you please help me with that?

The near-ubiquitous undergraduate reference on electrodynamics, "Introduction to Electrodynamics" by David Griffiths make extensive use of a script-r symbol, defined to be \vector{\scriptr} \equiv \vector{r} - \vector{r}^{\prime} and looks like:    Although the question of how to produce such a symbol in LaTeX is quite a common one I am yet to find a satisfactory solution.  The closest I've found is from the physymb package and uses the Calligra fonts:    Sadly, there is not a bold variant of this character and it is far more cursive than I would like.  I am hence wondering if there are any better facsimiles.


I'm trying to bind two parameters received with AJAX into a prepared statement, using both of them as terms for a comparison. When I try to use both of them the query goes wrong, while if I remove the one obtained by a select it works. Is the select a possible reason of the failure? Because in the page in which I perform the query, the string arrives correctly, with its correct value.  $.ajax({         url:"ricerca.php",         type: "GET",         data: { azione:"ricerca",                 tcr1:$("#testoPrimoCampo").val(),                 cr1:$("#primoCampoRicerca").val(),                 tcr2:$("#testoSecondoCampo").val(),                 cr2:$("#secondoCampoRicerca").val(),                 ordinamento: ord},         success:function(result){             alert(result);                 $("#risRicerca").html(result);           },               error: function(richiesta,stato,errori){                  $("#divElenco").html("Chiamata fallita:"+stato+" "+errori);           }       });   <form action="ricerca.php" method="GET"> <fieldset> <legend>Ricerca calciatori</legend>     <select id="primoCampoRicerca" name="primoCampoRicerca">       <option value="codicecalciatore">Codice</option>       <option value="cognomenome">Cognome e nome</option>       <option value="squadra">Squadra</option>       <option value="ruolo">Tipo</option>       <option value="valore">Valore</option>     </select>    </fieldset> </form>

   ricerca.php  <?php /*** mysql hostname ***/ $hostname = 'localhost'; /*** mysql username ***/ $username = 'root'; /*** mysql password ***/ $password = ''; /*** database name ***/ $database_name = 'esempio'; try {     $dbh = new PDO("mysql:host=$hostname;dbname=$database_name", $username, $password);     } catch(PDOException $e)     {     echo $e->getMessage();     }  if (isset($_GET['azione'])) {     if (!empty($_GET['tcr1']) && $_GET['tcr1']!='') {         try {              echo($_GET["cr1"]);             $sql = $dbh->prepare("SELECT * FROM calciatori WHERE ? = ?");              $sql->bindParam(1, $_GET['cr1']);             $sql->bindParam(2, $_GET['tcr1']);             $sql->execute();                echo '

 Codice	 Cognome e Nome	     Squadra	 Ruolo / Tipo	 Valore
';             $i = 0;              $res = $sql->fetchAll();              foreach ($res as $row){                 $i=$i+1;                 echo '
';                 echo '' . $row['codicecalciatore'] . '	';                 echo '' . $row['cognomenome'] . '	';                 echo '' . $row['squadra'] . '	';                 echo '' . $row['ruolo'] . '	';                 echo '' . $row['valore'] . '	';                 echo '
';             }              echo '
';       echo("$i");             /*** close the database connection             $dbh = null;***/         }         catch(PDOException $e)             {             echo $e->getMessage();             }     } else {     echo("Campi vuoti");         $_SESSION['istruzione'] = '';     } } else {   echo("Azione non settata");     $_SESSION['istruzione'] = ''; } ?>   Sorry if varialbes' names are in italian, I hope it won't be a problem, thank's.

Why can't I pass the table name to a prepared PDO statement?  $stmt = $dbh->prepare('SELECT * FROM :table WHERE 1'); if ($stmt->execute(array(':table' => 'users'))) {     var_dump($stmt->fetchAll()); }   Is there another safe way to insert a table name into a SQL query? With safe, I mean that I don't want to do  $sql = "SELECT * FROM $table WHERE 1"


I wan't to show that $\mathbb{Z}[1/3]$ is not finitely generated as a $\mathbb{Z}$-module. So I suppose toward a contradiction that it is finitely generated, i.e. $\mathbb{Z}[1/3]=(x_1,...,x_d)$ where $x_1=p_1(1/3),...,x_d=p_d(1/3)$ i.e. they are polynomial expressions (with integral coefficients) in $1/3$, but then what element can't I express with linear combination of these elements, or where would there be a contradiction?

$\mathbb Z[1/2]$ is not finitely generated ?   Maybe I misunderstood, what finitely generated means.  it says, we need finitely many elements and I think $1$ and $1/2$ suffices as generators.  But , at the end of Proposition $5.1.4$, from the fact that $\mathbb Z[1/2]$ is not finitely generated it is concluded that $1/2$ is not integral.


Over at the  community, when I type 1040 into the search box in the upper right corner and hit Enter, it immediately returns the , even though there are .  But when I type 193 into the search box, it returns a  instead of the .  Why the different behavior?

I was very frustrated with 401s the other day and did a search on SO for 401.  I got ().  Not a list of questions about 401.  This appears to work for any number entered into the search.


DEFINITION 1:  A set $S$ is finite  if there is a bijection from the set $[n]=\left\{ 1, ..., n \right\} \text{for some } n\in N$   to $S$.  A set is infinite if its not finite.   I have proved that   if $f:[n]\to N$ is an injection, then $\exists g:[n]\to rng(f)$ an Order Preserving map.  How can I use this to show $N$ is infinite?  This is not same as  since I have not used order preserving map anywhere over there.

DEFINITION 1:  A set $S$ is finite  if there is a bijection from the set $[n]=\left\{ 1, ..., n \right\} \text{for some } n\in N$   to $S$.  A set is infinite if its not finite.   Claim : $\nexists g:[n]\to A$ an injection, where $A\subsetneq [n]\;\forall  n\in N$  Proof of claim : Let $P(n) $ be the statement  $\nexists g:[n]\to A$ an injection, where $A\subsetneq [n]\;\forall  n\in N$  $P(1)$ true as $\nexists g:[1]\to A $ a function, where $A\subsetneq[1] (=\phi)$  Assume $P(n)$ to be true.  Consider for $P(n+1)$ : Let $A\subsetneq [n+1]$  if $\exists g:[n+1]\to A$ an injection then  Case $1.$ $n+1\in rng(g)$  Case $1.1$ if $g(n+1)=n+1$, then $g_{[n]}$, the restriction of $g$ on $[n]$ is injection from $[n]$ to $A\setminus\{n+1\}\subsetneq [n]$, which is a contradiction to induction hypothesis.  Case $1.2$ if $g(n+1)\neq n+1$, suppose $g(i)=n+1$ and $g(n+1)=j$ then we can always interchange the value of $g$ at $i$ and $n+1$ to go back to case $1.1$ and conclude contradiction.  Case $2.$ $n+1 \notin rng(g)$ then the injection $g_{[n]}:[n]\to A\setminus\{g(n+1)\}\subsetneq [n]$ again leads to contradiction.  Back to main proof:  Since every finite set of cardinality $m$ is in bijective correspondence to $[m]$, we conclude by our above claim that there can not exist an injection from a finite set to its proper subset.  Now, on contrary, suppose $N$ is finite  $\Rightarrow \exists f:N\to[n]$ for some $n\in N$  But $[n]\subsetneq N$ leading to contradiction. Hence, $N$ can't be finite. So $N$ is infinite.  Is this proof correct?


Consider the concrete example where we flip a coin, with probabilities $\tau$ and $1- \tau$ for heads and tails respectively, and then let $X$ be the random outcome of a normal distribution whose parameters depend of whether we got heads or tails. If $f(x \mid \mu_j, \sigma_j)$ denotes the density of a normal distribution with parameters $\mu_j, \sigma_j$, this could be expressed with the model $$ \boldsymbol{\mathrm P}[ X \in A |Z = j] = \int_A f(x \mid \mu_j, \sigma_j) dx \quad j= 1,2. $$  What is the likelihood function, depending on $(\tau, \mu_1, \sigma_1, \mu_2 \sigma_2)$, of $X$?  From the definition of the conditional probability of $\{X \in A \}$ given $Z=j$, we have that \begin{align*} &\boldsymbol{\mathrm P}[\{X \in A\}] = \boldsymbol{\mathrm P}[\{X \in A\}\cap \{ J = 1\}] + \boldsymbol{\mathrm P}[\{X \in A\}\cap \{ J = 2\}] \\ &= \int_{\{1 \}} \boldsymbol{\mathrm P}[\{X \in A \} \mid J = j] \boldsymbol{\mathrm P}_Z(dj) + \int_{\{2 \}} \boldsymbol{\mathrm P}[\{X \in A \} \mid J = j] \boldsymbol{\mathrm P}_Z(dj) \\ &= \boldsymbol{\mathrm P}[Z=1]\boldsymbol{\mathrm P}[\{X \in A \} \mid J = 1] + \boldsymbol{\mathrm P}[Z=2]\boldsymbol{\mathrm P}[\{X \in A \} \mid J = 2] \\ &=\int_A \left ( \tau f(x \mid \mu_1, \sigma_1) + (1- \tau)f(x \mid \mu_2, \sigma_2)  \right ) dx \end{align*} Thus it looks like $\tau f(x \mid \mu_1, \sigma_1) + (1- \tau)f(x \mid \mu_2, \sigma_2) $ is a density for $X$. And I would like to claim that $$ L\left((\tau, \mu_1, \sigma_1, \mu_2, \sigma_2) \mid x \right) = \tau f(x \mid \mu_1, \sigma_1) + (1- \tau)f(x \mid \mu_2, \sigma_2) . $$  Is this correct?  Most grateful for any help provided!

So I want to fit a mixture model  $$f(y) = \pi_1 f_1 (y) + \pi_2 f_2 (y)$$  where $\pi_k = P(S = k)$ and $S_i$ is a latent unobserved variable.  I assume that, conditional on $S=k$, we have the model  $$y_i = \mu_k + \beta_k x_i + \epsilon_i$$  where $\epsilon_i \sim N_p (0, \Sigma_k)$.  My goal is to estimate parameters $\mu_k, \beta_k, \Sigma_k, \pi_k$ for each $k$.    Firstly, As I understand it, under this model we have likelihood function  $$L(\theta |y) = \prod_i \left( \pi_1 \phi_{1,p} \left(y_i-\mu_1 -\beta_1 x_i\right) + (1-\pi_1) \phi_{2,p} \left(y_i-\mu_2 -\beta_2 x_i\right)     \right)$$  where $\phi_{k,p} \sim N_p(0, \Sigma_k)$.    Secondly, in order to obtain point estimates of the parameters in a Bayesian framework, I need to obtain a posterior sample from the posterior distribution  $$p(\mu, \beta, \Sigma, \pi | y)$$  But as this is difficult, an alternative would be to use Gibbs sampling with posteriors  $$p(\mu |  \beta, \Sigma, \pi , y)$$  $$p(\beta |  \mu, \Sigma, \pi , y)$$  $$p(\Sigma |  \mu, \beta, \pi , y)$$  $$p(\pi |  \mu, \Sigma, \beta , y)$$  What I don't understand, is how to get from the given model equation and likelihood function to those posteriors. Once I have those posteriors, I am confident I can impliment Gibbs sampling.  Since my likelihood is not multivariate normal, it is a mixture of multivariate normals, I am unsure how to proceed, as there are no conjugates listed on the Wikipedia page for mixture distributions. Any help/advice is much appreciated!


Background  I'm running Debian stretch/stable; I installed openvpn from the repo abd downloaded the configuration file us1041.conf (as an example) from my VPN provider into /etc/openvpn/us1041.conf. I want openvpn to run at boot, so following the VPN provider's instructions, I created /etc/openvpn/auth.txt with my credentials, add auth-user-pass auth.txt to the configuration file, and added AUTOSTART="us1041" to /etc/default/openvpn.  If I manually add the nameservers to /etc/resolv.conf:  nameserver 78.46.223.24 nameserver 162.242.211.137   the VPN works. Great! However, once I reboot, /etc/resolv.conf is overwritten with the nameservers from my ISP, and no connections resolve.  Also, I'm not using network manager or any GUI app to configure the network. I didn't install a graphical interface and network configuration worked "out of the box." This is /etc/network/interfaces:  source /etc/network/interfaces.d/* auto lo iface lo inet loopback allow-hotplug enp0s31f6 iface enp0s31f6 inet dhcp   Question  I think I need to use the , but I'm not sure how to configure that with the configuration files that came from my VPN provider.  How can I get the VPN's nameservers to persist across reboots?

I want to use certain DNS servers regardless of whatever I get through DHCP. I'm trying to configure dhclient to ignore those, but I can't seem to get it to work.  Per advice from  I added supersede domain-name-servers 8.8.8.8, 8.8.4.4; stanza to my /etc/dhcp/dhclient.conf file. I also tried  and removed domain-name-servers and domain-search values from request directive. Both of those, applied separately as well as together, seem to have no effect. After running sudo dhclient -r and then sudo dhclient, I still find following entries in /etc/resolvconf/run/interfaces/enp2s0.dhclient:  domain lan nameserver 192.168.1.1   which prompt resolvconf to put nameserver 192.168.1.1 in my /etc/resolv.conf file.  I double-checked if I don't miss any semicolons or similar syntax elements. How can I get my configuration to work? I don't want to remove resolvconf, since it manages changes in my nameservers when I use corporate VPN and it does it well. It looks like dhclient is the offending party here.  Here's my current /etc/dhcp/dhclient.conf with default comments removed for the sake of clarity:  option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;  send host-name = gethostname(); request subnet-mask, broadcast-address, time-offset, routers,         domain-name, host-name,         dhcp6.name-servers, dhcp6.domain-search, dhcp6.fqdn, dhcp6.sntp-servers,         netbios-name-servers, netbios-scope, interface-mtu,         rfc3442-classless-static-routes, ntp-servers;  #supersede domain-name-servers 8.8.8.8, 8.8.4.4;   Update: per request in comment, here's output of ps ax | grep dhcp:  23528 pts/2    S+     0:00 grep dhcp


What are the dimensions of the largest cylinder (in terms of volume) that can fit inside a sphere?   I know that this problem involves taking the derivative of the V(r) equation and finding the maximum value, but i am having trouble finding the equation. Can anybody help form the equation?

The first question that comes into my mind here is whether any cylinder that touches(at 4 pts) the circumference of the sphere and does not go out of it, has equal volume?   Second, how do i mathematically limit the volume of the cylinder to be less than that of a sphere? Squeeze theorem?   Please help, thanks!


I have dual booted my laptop with windows 7 and ubuntu 13.04. Now i want to remove my ubuntu partition. Is there any way to remove ubuntu partition without casing any harm to my  windows 7? I have tried to delete the ubuntu partition from my windows 7 but its not working. please suggest me the proper way to do it.

I have absolutely no experience with Linux, and I desperately need to get my computer back up and running again with Windows.  How do I remove Ubuntu and reinstall Windows?    Editor's note: many of the answers are about removing Ubuntu from dual-boot but keeping Windows (which is a bit complicated), while other answers are about removing Ubuntu from single-boot (which is easy: basically just format the disk while installing Windows). The question as written is ambiguous between dual-boot or single-boot.


I was reading an article and came across to the following sentence. Rock fulgurites, found almost exclusively on the peaks of mountains, appear as a thin crust on the surface of rocks. What I couldn’t understand was why the words 'surface' and 'crust' are singular. As it says the peaks of mountains, I thought these two words should be plural. Can someone explain why they are singular?

The usage of singular and plural has always been confusing for me.   I often see sentences like these         People are using cell phones.   People are using a cell phone.      Does the first sentence mean everyone has a phone and they are all using their own?  Does the second sentence mean they are sharing one cell phone?   If I see a group of people holding a cell phone in their hand(s), <- even this is confusing for me, should I use the first sentence then?   Another example: you see two men, and both of them are carrying a bag. Which sentence should I say/use?        They are carrying backpacks          They are carrying a backpack      Could you please make it clear for me?


Just starting out, wondering exactly what the darker shading means:   Is it simply shadowing based on the current dimensions?  Is it also an indicator that front and side rigging are somehow not correspondent with each other?   Thanks a bunch.

While rendering a mesh with smooth shading on, I get a dark region/shadow on certain faces. The effect is more evident when smooth shading is applied to a mesh containing ngons, with the ngons turning black when rendered.   The blackening effect is visible in the viewport too.  How can I solve this problem?


I has a discussion  over whether if you @ping someone from the main site in chat if they would ever get a notification. I was under the impression that they would not. Is this true?

Is there some way to contact another user by using their name in chat, so that they get notified?  It seems that when discussion starts in a comment thread, it is easiest, instead of migrating the entire set of comments, just to start talking about the topic in chat. But to get someone to go there, one continues in the comment thread to say 'hey, let's go to chat'.  Using @ThePersonsNameYouWantToChatWith in chat doesn't seem to give them a notification; how can one notify them that you are said something in chat to them?


When a ball is thrown upwards, we initially apply a force $F=ma$ vertically upwards and it raises to a height $h$. A force $F=mg$ acts vertically downward (i. e $F=-mg$)  due to gravity and it causes it to stop moving higher once. If at that point, we consider the energy stored in ball, then it is $mgh$. As energy = work, and work=force*displacement, then why is work not equal to $mah$, or $-mgh$ as force $mg$ is never applied at any time. Maybe I am misunderstanding concept of work, and I too read that work and force should not be confused, but what's the logic here?

The work done against gravity is $mgh$, well at least that's what my textbook says. I have a question: I can apply a force say 50N, so total work done = $mgh + mah$. Where $ma$ = Force. But the truth is irrespective of the force applied, the work done against gravity is always $mgh$. Why?  For example, when I move an object with a force, the work done is more, so work depends on the Force. But in case of gravity it always depends upon the weight


So, for a first time try with a USB boot drive, i used the recommended Ubuntu 12.04.3 version. After using the pen drive Linux USB installer to install Ubuntu onto it, I restarted my PC and changed the boot priorities in the BIOS so that it boots from the USB first, however after many attempts my PC just boots straight into win 8. The board I have is the ASUS M4A79XTD Evo (AM3). Any help will be much appreciated, thanks

I want to burn Ubuntu Minimal CD ISO to an old, 1 GB USB thumbdrive. Regular ISO doesn't fit. I already tried Startup Disk Creator and Unetbootin but both failed. I tried installing GRUB and pointing it to boot like this:  insmod part_msdos linux /linux initrd /initrd.gz   but it doesn't work. I also tried dd but I ended up with not bootable drive.  Rufus worked on Windows with the same thumbdrive but I no longer use Windows.  What else can I do?


My coauthors and I have just had a paper accepted by a journal.  The journal in question is published by a nonprofit professional society and offers two options in their copyright agreement.   We transfer copyright to the publisher, as is traditional.  The journal has exclusive publication rights but we retain the rights to post the paper on our web pages or arXiv (post peer-review), distribute to colleagues, etc.  We also have the right to release our paper to the public domain after 28 years. We retain the copyright for ourselves, but grant exclusive publication rights to the publisher.  We still have the rights to post and distribute the paper privately as before.   I am trying to determine the pros and cons of each option.  From a practical standpoint there doesn't seem to be much difference: in each case, both we authors and the journal have the rights to do the things that we respectively care about.  In principle, it would seem better for us to retain the copyright rather than transfer it, just on the grounds that it is better to keep as many rights as possible.  I could only think of one possible drawback: suppose that a number of years from now, some person X wants to republish our paper, or use it in some other way that requires the permission of the copyright holder.  If we transfer it, X can work it out directly with the journal, who should remain easy to contact.  If we don't, X has to track down all three of us authors (or our heirs) to get permission, and then we have to decide what to do about it.  I'm not asking for legal advice, and I know you're not a lawyer, etc, etc.  But I would be interested to hear about any experiences with this, or other issues I haven't thought of.  The publisher is the American Mathematical Society and their copyright agreement form can be found at

ACM now offers authors of published papers a choice of two copyright licenses: the "traditional"  or the .  How should I choose between these two licenses?  What are the advantages and disadvantages to the authors of each license?  I care a lot about maximizing the ability of others to read the paper (e.g., maximizing my ability to make my paper available on my web page, institutional repository, etc.); are there any relevant differences between the two licenses that affects this consideration?  Are there any other important differences between the licenses that authors might care about?


It is an assignment question, thus I am simply looking for a hint to unblock myself.     Let $S$ be a collection of all ordered pairs of subsets of $\{1, ..., n\}$, not necessarily disjoint. That is,   $$ S = \{(A,B) : A \subseteq \{1, ..., n\}, b \subseteq \{1, ..., n\} $$   Show by computing the size of $S$ in the different ways that   $$ 4^n = \sum_{k=0}^{n}{3^k{{n}\choose{k}}} $$   So far the left side is obvious that it is simply picking a $A$ then picking a $B$ in $\{1,...,n\}$. $$ |S| = 2^n \times 2^n = 4^n $$ The right side however is what has me stuck. Looking at the $3^k$, I can tell that it's the number of ways to pick $(A,B)$ disjoint subsets of $\{1,...,k\}$, $n\choose{k}$ is the number of ways to pick a third set. I've wrote ways to combine the third set into $(A,B)$ but I can't seem to find something intuitive that works for all $A, B$

Using the following equation:  $$\sum_{k=0}^n {n \choose k}3^k=4^n$$  I need to prove that both sides of the equation solve the same combinatorial problem.  It's easy to see that the right side of the equation is counting number of ways to divide $n$ different balls into $4$ buckets.  Is it correct to say that the left side of the equation solve the same problem the following way (?):  Since $\sum\limits_{k=0}^n {n \choose k} 3^k= \sum\limits_{k=0}^n {n \choose n-k}3^k$,  we can change the equation to:   $$\sum_{k=0}^n {n \choose n-k}3^k=4^n$$  And from the new equation, it is easier to see that each binomial coefficient chooses number of balls to put in the first bucket, and $3^k$ divides the rest $k$ balls between the rest 3 buckets without limitation.


This is  an easy Html.    <!DOCTYPE html> <html lang="en"> <head>     <meta charset="UTF-8">     <title>Title</title> </head> <body> <form method="POST" action="https://sm.ms/api/upload" enctype="multipart/form-data">     <input name="smfile" type="file">     <input type="submit" name="upload"> </form> </body> </html>     When i post an image to the server(third party) ,  the server(third party) returned the json  and changed my web..    {   code: "success",     data: {       width: 440,       height: 440,       filename: "timg.jpg",       storename: "5a7b1807506b2.jpg",       size: 11941,       path: "/2018/02/07/5a7b1807506b2.jpg",       hash: "m8FqIYBGWL1HDrT",       timestamp: 1518016519,       ip: "111.29.138.47",       url: "https://i.loli.net/2018/02/07/5a7b1807506b2.jpg",       delete: "https://sm.ms/delete/m8FqIYBGWL1HDrT"     } }     my question is how to POST this json to my background and how to don't change my  web ..

I would like to upload a file asynchronously with jQuery.     $(document).ready(function () {     $("#uploadbutton").click(function () {         var filename = $("#file").val();          $.ajax({             type: "POST",             url: "addFile.do",             enctype: 'multipart/form-data',             data: {                 file: filename             },             success: function () {                 alert("Data Uploaded: ");             }         });     }); });  File <input type="file" id="file" name="file" size="10"/> <input id="uploadbutton" type="button" value="Upload"/>     Instead of the file being uploaded, I am only getting the filename. What can I do to fix this problem?


I haven't talked to my wife for three years.   I haven't talked to my wife in three years.      Are in and for interchangeable in these sentences?

I recently got a message that says      Haven't heard anything from you in a while.   I always thought that the right way to say this would be to use for insdead of in. Are both versions correct? Would there be a difference in meaning?


I have to make difference between two dates.  One date is today date and the other date in a date into a db Unfortunately the date into db is a varchar and not a date format (in this way 31/12/2016/) So is it possible to conver varchar to date?. After that how can i make the difference between the two dates?  thanks

I have two dates of the form:  Start Date: 2007-03-24  End Date: 2009-06-26   Now I need to find the difference between these two in the following form:  2 years, 3 months and 2 days   How can I do this in PHP?


$a_n$ is a sequence with $\lim\limits_{n \rightarrow \infty}{\frac{a_{n+1}}{a_n}}=L$, $a_n>0$.   So the task is to show that $c_n:=(a_n)^\frac{1}{n}$ converges and $\lim\limits_{n \rightarrow \infty}{c_n}=L$.  I've been working on this for hours now and don't have any useful result. Please help :)

In Elias Stein and Rami Shakarchi's Complex Analysis textbook, we have the following exercise:     Show that if $\{a_n\}_{n=0}^\infty$ is a sequence of complex numbers such that $$\lim_{n\to\infty}\frac{|a_{n+1}|}{|a_n|}=L,$$ then $$\lim_{n\to\infty}|a_n|^{1/n}=L.$$    I've been trying to prove this with no luck. The only thing I've thought of doing is $$\lim_{n\to\infty}\left(\frac{|a_{n+1}|^n}{|a_n|^n}\right)^{1/n},$$but this hasn't lead me anywhere except dead ends. Will someone provide a hint for me about how to proceed? Thanks!  Minor update: I don't know if it's helpful yet, but I know we can write the limit as $$\lim_{n\to\infty}\left(\frac{|a_{n+1}a_n\cdots a_0|}{|a_n\cdots a_0|}\cdot\frac{1}{|a_n|}\right).$$This reminds me a lot of the geometric mean, which even has the exponents I'm trying to get...


I did a full factory restore to my alienware mx17 when windows was reinstalled from factory disk it took up around 170 GB of my 225 GB SSD drive any answers on whey this would be?

My Vista 64 installation has drive C, a 150 GB hard drive.  I also has a 1.5 TB drive D.  My C drive has 12.3 GB free.  I don't know what's using up all the space.  There's almost 83 GB unaccounted for!!!  As per  question and  question, I downloaded  and .  WinDirStat, once I found the right options, tells me there's 82.9 GB of .  SpaceMonger, which has a particularly nice display of the data, tells me there's 82.3 GB "Unscanned", with 2 unscannable folders.  Where do I turn now?  Both tools roughly agree there's a large amount of data on my drive, but neither seem to be able to tell me what.  I've tried the standard approach; disk cleanup, remove hibernation file, set the virtual memory to the D drive instead of the C drive.


Do not ask me to read the similar questions because I already did and my question is different  There is an idea about saving the current machine stat in a virtual machine (virtualizing a physical machine) and save it in an external storage then install 64 Bit system and install the virtual machine to reinstall all the programs , services , registry keys and the files . So with this way I will be able to upgrade from 32 Bit to 64 Bit without reinstalling my programs , so does anyone of you have any idea about that If it is then share it with me here please ?(I'm using windows 10)

As the title says, is there a way of running a x64 bit program on a 32 bit system ? If not, is there an emulator or is there a way of upgrading from 32 bit to 64 bit for free?  NOTE: I am using Windows 10.


I can't understand why \tau = x_\text{average} work ok in display mode math but gives an error when inline.  This error shows up only with tex4ht, not pdflatex.  MWE  \documentclass[12pt]{article} \usepackage{amsmath} \begin{document} $\tau = x_\text{average}$ \end{document}   Now typing  htlatex foo.tex   gives  (/usr/local/texlive/2014/texmf-dist/tex/generic/tex4ht/html4.4ht) (/usr/local/texlive/2014/texmf-dist/tex/generic/tex4ht/html4-math.4ht)) (./foo.aux) ! Argument of \n:text@: has an extra }. <inserted text>                  \par  l.6 $\tau = x_\text{                     average}$ ?    But this compiles ok  \documentclass[12pt]{article} \usepackage{amsmath} \begin{document} \[     \tau = x_\text{average}  \] \end{document}   I am using tex4ht with tex live 2014 on linux   *File List*  article.cls    2014/09/29 v1.4h Standard LaTeX document class   size12.clo    2014/09/29 v1.4h Standard LaTeX file (size option)  amsmath.sty    2013/01/14 v2.14 AMS math features  amstext.sty    2000/06/29 v2.01   amsgen.sty    1999/11/30 v2.0   amsbsy.sty    1999/11/29 v1.2d   amsopn.sty    1999/12/14 v2.01 operator names

When I compilethis MWE:   \documentclass[a4paper,12pt]{article} \begin{document} Test $x_\mathit{in}$ \end{document}   ...it works perfectly with latex and pdflatex. If I try to use htlatex on it, it chokes:   ! Argument of \new:mfont has an extra }. <inserted text>                  \par  l.7 Test $x_\mathit{                     in}$   What am I doing wrong?   (BTW: if someone can point me to a comprehensive document about htlatex, please do... my google-fu is quite low today).   EDIT I discovered that if I write:   ...$x_{\mathit{in}}$    (with the extra set of braces) it works. But I am still wondering why...  This is standard (distribution-provided) full LaTeX installation in Ubuntu 14.04.


I use GWTP and have two Presenters. Lets call it   FirstPresenter SecondPresenter   The website starts with First. When I click a link on First I navigate to Second. Now there are two forms of navigation on the Second Presenter.   The user can click a link which navigates back to First The user can click the browser back button.   How can I determine if the browser back button has been clicked?

What is the best way to detect if a user leaves a web page?  The onunload JavaScript event doesn't work every time (the HTTP request takes longer than the time required to terminate the browser).  Creating one will probably be blocked by current browsers.


While browsing questions earlier today, I noticed the newsletter signup form that sometimes appears in the answer list of a question has a subtle input box that is misaligned relative to the more visible "email address" box beneath it that acts as a label. A freehand circle for reference:    Firefox 28.0 on Windows 7 Professional, 64 bit.

I visited a question  and happened to get the newsletter registration prompt, which appears to have a styling issue in the email field:    The quick fix would be for the two fields to just have the same width (149px vs 200px), but it probably also makes sense at this point to just do away with the pseudo placeholders and just use the placeholder attribute universally, with a polyfill for legacy browsers.


I have a file which contains a list of directories/files that I want to ignore when searching using find. It looks like this:  .git .vim config .vimrc .bashrc   This list is not exhaustive and can have any number of items. How can I ignore these files/directories when using find.  I've been trying to do find . -type f ! -path ..., but haven't been able to pass dynamic list as argument.

I need to build a list of files present in a directory but also pass in a file containing a list of directories to exclude.  I've seen the below suggestion but I've had no luck with it when it comes to the type flag:  find $dir_name $(printf "! -name %s " $(cat $exclude_file))   Is there a way I can do it or will I need to create the entire list and then work through it removing ones that partially match ones in the exclude directory.


My Chief Security Officer (CSO) want to log the activity of the privileged account (root). I know I can configure sudo to log user input (key strokes) and console/terminal output (stdout/stderr), as explained in . But the content is always logged to a file locally. That file can easily be wiped by the root user !   I have enable logging in /etc/sudoers:  Defaults>root log_input, log_output Defaults iolog_dir=/var/log/sudo-io   or equivalent  root      ALL = (ALL) LOG_INPUT: LOG_OUTPUT:      ALL   How to protect/secure the file from deletion ?

If I:   [user@notebook ~] sudo echo 123456uu 123456uu [user@notebook ~]    Then I can see that in the logs:  [root@notebook /var/log] grep 123456uu * auth.log:Jan  9 17:01:51 notebook sudo: user : TTY=pts/3 ; PWD=/home/user ; USER=root ; COMMAND=/bin/echo 123456uu [root@notebook /var/log]    but if I:   [user@notebook ~] sudo su - [root@notebook ~] echo 1234567zz 1234567zz [root@notebook ~]    I cannot see it in the logs:   [root@notebook /var/log] grep 1234567zz * [root@notebook /var/log] echo $? 1 [root@notebook /var/log]    My question: How can I turn the logging on for the commands within the "sudo su -"?  OS is an Ubuntu 12.04 but the question is in general.   UPDATE#1:   [user@notebook ~] sudo su - [sudo] password for user:  [root@notebook ~] echo zizizi zizizi [root@notebook ~] cd /var/log [root@notebook /var/log] grep -iIR 'zizizi' * [root@notebook /var/log] grep 'COMMAND=/bin/su -' * auth.log:Jan 10 15:42:42 notebook sudo: user : TTY=pts/1 ; PWD=/home/user ; USER=root ; COMMAND=/bin/su - [root@notebook /var/log]


I can draw what I need on SketchUp (Maker free version of 2017). It can export on STL, which is fine  for 3D printer, but now I need to feed my object into a website that only accepts .max files. I have not found any way to convert STL to .max. The closest I got is with openctm-tools on linux which can make a .3ds. Blender seems to not have export functionality to .max, so I thought you guys may have a solution on how to convert to .max stargin from a STL or other common format. Any suggestions?

I've tried to import but I don't see the (.max) file as an option when importing. Is there another way to import the 3DMax model into Blender for rigging and animation?


I have a perl file named ips.pl at C:\Perl\test\ips.pl which contains 6 perl hashes. Each hash contains 1 key and 2 values. The file contains below data.  {  '192.168.111.1' => [             '192.168.111.2',             '192.168.111.3',  ],   '192.168.111.4'  =>  [                     '192.168.111.5',                     '192.168.111.6',  ],   '192.168.111.7' => [                      '192.168.111.8',                      '192.168.111.9',  ], }   How Can I convert this perl file to python readable? I need result in 3 separate Python Dict. The required result should be like  dict1 = {'192.168.111.1': '192.168.111.2'} dict2 = {'192.168.111.1': '192.168.111.3'} dict3 = {'192.168.111.4': '192.168.111.5'} dict4 = {'192.168.111.4': '192.168.111.6'} dict5 = {'192.168.111.7': '192.168.111.8'} dict6 = {'192.168.111.7': '192.168.111.9'}   As am new to both perl and python, please suggest me any module which will be a easy solution for me. In case we dont have any such module then please suggest me the steps. Thanks in advance  I tried with below code,  import re class PerlLikeDict( dict ): pattern_type= type(re.compile("")) def getitem(self, key):     F = open("resources.pl", "r+")     print "value of F object is", F     print "type of object is ", type(F)     rd=str(F.read())     print "value of string variable rd is", rd     #print "value of 1st is", rd[1]     #print dict_rd == dict(rd)     if key in self:         return super( PerlLikeDict, self ).__getitem__( key )     for k in self:         if type(k) == self.pattern_type:             if k.match(key):                 return self[k]     raise KeyError( "key %r not found" % ( key, ) )  F = open("resources.pl", "r+") rd=str(F.read()) print "able to read the file", rd x=PerlLikeDict(rd) print x   This is giving error  Traceback (most recent call last): File "C:\Users\sanjaya.sahoo\workspace\my python  learning\src\workon_local_perlfile.py", line 23, in <module> x=PerlLikeDict(rd) ValueError: dictionary update sequence element #0 has length 1; 2 is required

I've often seen people use Perl data structures in lieu of configuration files; i.e. a lone file containing only:  %config = (     'color' => 'red',     'numbers' => [5, 8],     qr/^spam/ => 'eggs' );   What's the best way to convert the contents of these files into Python-equivalent data structures, using pure Python? For the time being we can assume that there are no real expressions to evaluate, only structured data.


I am looking for a book on Newtonian mechanics which is very careful to explain why, where and how you need to use calculus to develop physics. Or even, a book which introduce basic notion and propositions of calculus in terms of the latter being necessary to develop Newtonian mechanics.   My interest is partly pedagogical partly philosophical, and I would like to read something with all the subtle points well explained, and as self contained as possble.   Indeed, maybe I am looking to an essays on how to write such kind of book.

What are some good books for learning the concepts of Kinematics, Newton laws, 2D Motion of Object etc.?


Dog.setName("Kutta"); // this is how you call a setter method String Naam = Dog.getName(); System.println(Naam);  //Kutta Naam = "Kutte ki Ma"; System.println(Dog.getName()); // Is this *Kutte ki Ma* or is it *Kutta*?   And Why? If Java passes references by value, shouldn't Naam point to Dog.getName()? If that is the case, shouldn't the Name variable of Dog object (which may be private to the class used here) be directly modified if Naam is modified? Isn't that a flaw?

I always thought Java uses pass-by-reference. However, I've seen a couple of blog posts (for example, ) that claim that it isn't (the blog post says that Java uses pass-by-value). I don't think I understand the distinction they're making. What is the explanation?


The human has a terminal disease and the alien is incarcerated. The alien has a long lifespan and he wants to travel the universe. Hence, he exchanges "souls" with the human (without the human's consent). The alien couldn't handle paper with his bare hands because he was maybe hot or radioactive. So he sent metal sheets to the human, to write on with acid. I think it is a short story from a collection, written before 90s or early 90s.

While reading  question, I recalled that I had read a similar story in my English textbook. The details were a bit different from this question though. An alien (who I think is a convict) convinces a human to exchange consciousnesses with it because it wants to be free. The human appears to be reluctant but at the end, it is revealed that       the human is suffering from some disease and will die soon and is happy to have gone through with the exchange.   I read it ~10 years ago at school and some of the details are probably wrong.


One of my players is playing a Sorcerer who knows the  spell (XGtE, p. 164):     When a creature moves into the spell’s area for the first time on a turn or starts its turn there, that creature must succeed on a Constitution saving throw or take 4d10 radiant damage, and it suffers one level of exhaustion and emits a dim, greenish light in a 5-foot radius. This light makes it impossible for the creature to benefit from being invisible. The light and any levels of exhaustion caused by this spell go away when the spell ends.   (This spell has a 10-minute duration and is a concentration spell.)  He has also chosen the Careful Spell  option:     When you cast a spell that forces other creatures to make a saving throw, you can protect some of those creatures from the spell’s full force. To do so, you spend 1 sorcery point and choose a number of those creatures up to your Charisma modifier (minimum of one creature). A chosen creature automatically succeeds on its saving throw against the spell.   Sickening radiance forces creatures in the area to make a saving throw each round that it starts their turn in the area of effect.  If the Sorcerer wants their teammates to succeed on the saving throw against sickening radiance each round, do they have to spend a sorcery point each round? Or do the player characters get to pass the check automatically after the initial sorcery point is spent, since it was cast as a Careful Spell?

With the metamagic "Careful Spell" does the caster protect his friend from a Web spell for its full duration or just for the first save? If the friend stays in the area or re-enters the area does he continue to automatically save against the restraining effect?


I have few text files with size more than 30MB.  How can i read such giant text files from PHP?

fopen is failing when I try to read in a very moderately sized file in PHP.  A 6 meg file makes it choke, though smaller files around 100k are just fine.  i've read that it is sometimes necessary to recompile PHP with the -D_FILE_OFFSET_BITS=64 flag in order to read files over 20 gigs or something ridiculous, but shouldn't I have no problems with a 6 meg file?  Eventually we'll want to read in files that are around 100 megs, and it would be nice be able to open them and then read through them line by line with fgets as I'm able to do with smaller files.  What are your tricks/solutions for reading and doing operations on very large files in PHP?  Update:  Here's an example of a simple codeblock that fails on my 6 meg file - PHP doesn't seem to throw an error, it just returns false.  Maybe I'm doing something extremely dumb?  $rawfile = "mediumfile.csv";  if($file = fopen($rawfile, "r")){     fclose($file); } else {   echo "fail!"; }   Another update:  Thanks all for your help, it did turn out to be something incredibly dumb - a permissions issue.  My small file inexplicably had read permissions when the larger file didn't.  Doh!