I'm just trying to get an object to come out of the floor (the floor is real footage and object is just motion tracked in)  Now the floor I want to be invisible so it doesn't show in the final render, but still hide the cube until it passes through.

I have a picture of a room including the floor and I want it to look like there is, for example, a cube going through the floor. Is there a way to do this, maybe by making it go through a plane that is transparent to the photograph but not to the cube?  If anyone knows how to do this, as I'm not very good at doing things from text, would you be able to explain with pictures or something? Is there is a tutorial for this sort of thing?


I'm trying to remember the name of an old animated movie. Description will be a bit vague but here goes:  It's a cross between Treasure Planet and Sword in the Stone. (it's not Star Chaser). It's a family animated movie about a blonde boy. He finds a sword with an invisible blade, the blade materializes when he uses it. He is on board a talking spaceship - the spaceship has a little rectangular head that pops out when he talks to the boy.   At one point the boy asks the ship to do something and strikes the console. I think he was searching for a treasure or something. The movie is not set in space exclusively, they travel around on a planet. I don't remember other characters.  I don't remember the period - 80's possibly very early 90's  Sorry, I know its vague but that's all I can remember and I'm desperately trying to find it.  Thanks in advance!

Though at the time I saw it I did not know it, this would be called "anime" today. It was in English, and I don't remember if the characters lips matched the audio track. I couldn't have been older than about 3rd grade, so that puts it around 1985ish I believe.  It was released theatrically in the United States, I do not know if it was a limited release. I saw it in Cincinnati, Ohio. No idea what movie theater chain.  The story was rather typical, young man who goes on the hero's journey. Definitely science fiction elements (flying vehicles, maybe spaceships). He comes across or is given a sword hilt without a blade. He learns to use it, and when he does it acts as if the blade is there. At the finale, he has lost the hilt entirely and, thinking that he has lost, almost gives up. But a (voice in his head, his mentor, can't remember what) something tells him to try despite this, and it's as if he has the sword even without the hilt. He then triumphs.  Can anyone identify this movie?


I have a box plot using tikz in LaTeX, as in the following:       \begin{tikzpicture}[scale=1]      \begin{axis}        [width=\linewidth, height=4cm,        ytick={1,2},        yticklabels={A, B},        xlabel=A, or B        ] coordinates {};        \addplot+[fill, draw=black,        boxplot]         table[row sep=\\,y index=0] {         data\\          2\\2\\0\\0\\0\\0\\0\\0\\0\\0\\1\\2\\0\\0\\0\\2\\         };        \addplot+[fill, draw=black,        boxplot]         table[row sep=\\,y index=0] {         data\\         1\\5\\15\\15\\3\\3\\2\\5\\4\\1\\14\\2\\4\\1\\0\\2\\          };      \end{axis} \end{tikzpicture}   Is there a way to draw the violin plot for the same data and how in LaTeX? Thank you for any suggestion!

I use pgfplots for most of my plots. Now I need to add a . Is this possible with pgfplots or any other package?


Is a free vector editing software similar to Illustrator?

I am considering a summer job in a camp, but part of the job description is to make signs, announcing events/trips etc.  This is well within my ability to do, but I'm not sure where to start. I am fairly good with computers, but currently lack the knowledge to do what I need to do.  I could use Microsoft Word/WordArt, but I think they're looking for something more professional. (Who can't use WordArt??)  Therefore, I ask:   What tools/programs are suitable for beginners and powerful/flexible enough to produce quality signs? Where can I find (preferably free!) courses in both graphic design in general and sign-making in particular (i.e., not web-design, CAD, or 3D imaging. I'm not up to those... yet) What books should I read? Any tips for the beginner?


I want to compare the means of X between BMI groups, but have unequal sample sizes between my groups.   group A (n=20, mean=16.2); group B (n=90, mean=12.8); group C (n=30, mean=10.8); group D (n=8,  mean=11.2)    Can I use a one way ANOVA test when the sample sizes are extremely unequal? I performed a one way ANOVA test. The results showed significant differences for A-B and A-C, but not A-D. However when I did paired t-test for A-D, the result was significant. Which part am I doing wrong, the one way ANOVA or the t-test? Is an ANOVA test valid in this case?

I have a question about a data analysis that I am running. I am analyzing the results of a survey in which (expectedly) there exists far fewer people in one group than in another. This survey is an Honours project about enhancement drug use, and I have ~40 users and ~590 non-users. Obviously there is a huge difference between the sizes of these groups! I am interested in differences in means on a particular study processes scale. I have the following questions:  Is it a problem to use an ANOVA in this case (where the groups are so different in sample size)? I know that the Levene's test is sensitive to differences in sample size (such that it is far more likely to be significant); and this is the case in my data, p < .05. Regardless, Welch and Brown-Forsythe tests still reveal a statistically significant differences in mean scores on this scale.  Given that the Welch and Brown-Forsythe tests still reveal significant differences between groups, would I be wrong in concluding that these do in fact exist (despite violating the initial Levene's assumption)?  Is there are more robust way to investigate this research question, taking into account the disparity in group sizes?


I know that bytes.decode gives a string and string.encode gives the bytes, but only if the correct encoding is used.  Suppose I have a bytes object encoded using gb18030 If I try to decode it using big5:  >>name = '深入 damon' >>b1 = name.encode('gb18030') >>> b1.decode('big5') UnicodeDecodeError: 'big5' codec can't decode byte 0xc8 in position 2: illegal multibyte sequence   Is there some way the encoding can be found from a bytes object? I couldn't find any useful api in this regard in python3docs.

I received some text that is encoded, but I don't know what charset was used. Is there a way to determine the encoding of a text file using Python?  deals with C#.


I want to upgrade Apache to 2.4.46 or later on RHEL 7.  One step in the  is to Enable the EPEL repository, like so... cd /etc/yum.repos.d && wget http://mirror.centos.org/centos/7/os/x86_64/repodata/repomd.xml`rpm -q --qf "%{VERSION}" $(rpm -q --whatprovides redhat-release)`.repo  The mirror is not available, so I get a 404, but I also tried using other mirrors and I still get a 404 error.  How do I enable the EPEL repo on RHEL 7?

We asked our admin to update SVN on our CentOS 6.5 server. He did so and the result was SVN 1.6.11. However the current version of SVN is 1.8.9.   I know the CentOS yum repository is not always up-to-date. But in that case I am confused: SVN 1.6.x is not officially supported anymore. This means it does not get any security fixes!  How can the official CentOS repository provide such an old (and dangerous) version? Is there something we (or our admin) understood the wrong way?


I switched over to Ubuntu about a month ago after Windows 7 was corrupted and wouldn't boot anymore. I recently decided to restore Windows 7 so I could play a game on it. Unfortunately I had no restore points so I had to completely reformat the whole thing. Now when I turn on my computer I no longer get the option to boot into Ubuntu or Windows 7, it just boots straight to Windows. When I check the C drive I still have the 20 gigs I set aside for Ubuntu partitioned off. I'm thinking that Windows 7 reformatted the entire hard drive rather than just it's own partition, but I'm asking here to confirm my fears and make sure it isn't a fixable problem. I'd really like to avoid having to reinstall Ubuntu if at all possible.

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


I just really want to know if there's a fast way to level as I really want a daedric sword.    Note that I don't have Dawngaurd but I do have Hearthfire and Dragonborn.

I'm level 16 which makes battling many Draugr Wrights hard. My defense is just way too low, and I don't have enough time or strong enough magic to take them out.   My one-handed skill is at 62 and my strongest weapon does 33+10 enchanted damage. Are there any ways to level up easily?


Im currently working on a register form, and I decided to add some required fields, like email, password etc..  The only validation i want to do on the required fields is simply not null, so i used the required attribute inside of an input element.  Is this safe? Or do i need to use additional PHP validation?

Which is better to do client side or server side validation?  In our situation we are using    jQuery and MVC.   JSON data to pass between our View and Controller.     A lot of the validation I do is validating data as users enter it. For example I use the the keypress event to prevent letters in a text box, set a max number of characters and that a number is with in a range.   I guess the better question would be, Are there any benefits to doing server side validation over client side?    Awesome answers everyone. The website that we have is password protected and for a small user base(<50). If they are not running JavaScript we will send ninjas. But if we were designing a site for everyone one I'd agree to do validation on both sides.


I have problem deleting a child of a class  Here is the base class:  class Base_Element{ string name; list<string> reactions; public: Base_Element(string name_){     name = name_; }  string get_name(){     return name; } list<string> get_reactions(){     return reactions; }     void add_reaction(string react){     bool tmp = true;     for(string reaction : reactions){         if(reaction.compare(react) == 0){             tmp = false;         }     }     if(tmp){         reactions.push_back(react);     }    }  virtual bool is_reactive_with(string react){     for(string rec : reactions)     {         if(rec.compare(react) == 0){             return true;         }     }     return false; }  void print_reactions(){     cout << "Name of element: " << name << endl;     cout << "Can react with: ";     for (string rec : reactions)     {         cout << rec << ", ";     }     cout << endl; }  ~Base_Element(){     cout << "Destructing" << name << endl; }  };   And here is the child:  class Air : virtual public Base_Element{  public: Air():Base_Element("Air"){             add_reaction("Air");add_reaction("Fire");add_reaction("Earth");add_reaction("Water"); }  ~Air(){} };  class Spirit : public Air { public:      Spirit():Base_Element("Spirit"),Air(){}       ~Spirit(){} };   And here is the main function:  int main(){      Base_Element *w = new Spirit();      delete w;      return 0; }   The error I get from the console is the following:  DestructingSpirit free(): invalid pointer Aborted (core dumped)   It appears it calls right the destructors and although there is nothing to destruct in the base class i get the error. Don't say that the child have no meaning because it's school project and i must make that child.

I have a solid understanding of most OOP theory but the one thing that confuses me a lot is virtual destructors. I thought that the destructor always gets called no matter what and for every object in the chain. When are you meant to make them virtual and why?


I'm a total newbie here. How do I open .cpp file from the github directory? what command should I use? I'm in the directory where the .cpp file is stored but I do not know how to open that in the terminal.

I'm looking for a text editor for programming in Python, preferably one which is easy to learn for beginners.


Recently I saw a phrase that sounds like that:      Hurts even with the vest, don't it?   So, the question is: Why there is "don't" instead of "doesn't"?   I've found a lot of usages like that, so it doesn't seem like a grammar mistake.

I'd like to know how the sentence "That don't impress me much" sounds to a native English speaker.  The phrase is the title of a song by Shania Twain, and to my eyes it contains a clear error. It is obviously intended, and I want to know what was the effect that the author wanted to obtain.  Other examples that come to mind:   “She's got a ticket to ride, but she don't care” — The Beatles “My love don't cost a thing” — Jennifer Lopez “It don't matter” — Akon “She don't care about me” — heard in the Lost series “It Don't Mean a Thing” — a jazz album title “The Sun Don't Lie” — another album title


I've been working on this one ArcMap document containing a shapefile of Hong Kong (HK) city. I've been adding lots of shapefiles to the city and creating mostly polygons(see below pic). I've made sure my data frame's coordinate system is the same as all the shapefiles in my document which is Hong_Kong_1980_Grid.   Then, I made a new arcmap document and imported an image which showed the vessel fairways of HK. I did not give the image a spatial reference as I can't figure out a way of doing it, but I'm not sure its necessary(?).Anyway, I digitized the fairways, again making sure they had the Hong_Kong_1980_Grid coordinate system. Then, I exported these shapefiles and made sure the coordinate system was the same as the data frame's. I then saved my document and opened back up the HK city ArcMap document. Then I imported the fairway shapefile into the document but found that they were not aligning although they have the same coordinate system. I can't seem to find a good answer online.

I put 4 different layers into my ArcMap document, but only one of them will show up on the map! I should be seeing the other 3 layers as well. When I do a Zoom to layer, I can see one layer, but I cannot figure out how to make the other 3 show up at once on top of each other.  Before I opened ArcMap, I used ArcCatalog where I right-clicked 3/4 of the shapefiles and  clicked Properties → Coordinate system → Import and then clicked on my Trees layer, which has the coordinate system I want the other 3 to have. But when I opened ArcMap the 4 layers did not overlap, nor could I move them above or below each other.


After Orochimaru reincarnated Namikaze Minato, Yondaime Hokage and the war ended. Does Yin Kurama still reside inside Minato even after he goes back to the heavens or did it return to Yang Kurama and now it is inside Naruto. Can you please clarify this?

Did Naruto get both halves of Kurama after fighting Sasuke, or did the other half of Kurama die when Minato was killed?


I using Ubuntu GNOME 16.04.4, and I cannot update to 18.04 from Software Updater.   I get the message      The software on this computer is up to date.

I'm following the , but on launching the upgrade tool I get this response:  Checking for a new ubuntu release No new release found   Am I doing something wrong? Is there a workaround?


For Example suppose I have the following in a text file myfile.txt  Schwifty1 Schwifty2 Schwifty3 Schwifty4 Schwifty5 Schwifty6 Schwifty7 Schwifty8 Schwifty9 Schwifty10 ... ect ect ect... Schwifty20 Schwifty21 ... ect ect ect... Schwifty30 Schwifty31   using sort on this file will return something like:  Schwifty1 Schwifty10 Schwifty11 ......... Schwifty2 Schwifty20 Schwifty21 ......... Schwifty30 Schwifty31 Schwifty32 ..........   I want it to actually be numerical based off the number attached to the end. Is there any way to accomplish this using the sort function?

I have files in the following format: x1 x2 ... x10 x11 ... x101 ...  I want to rename these files, so they all have the same name length: x001 x002 ... x010 ...  I can do this with files, that don't have the non-numeric prefix (just using sort -n followed by a while read x;), but sort doesn't recognize the numeric value, when it's not on the beginning of the file-name.


I am curious to know the case when should I use in & on.  Like    Please install the software in my system Please install the software on my system   Which is correct & why?

Consider the following sentence:     I am developing an application to be installed on Android.   And this:     This has been a major flaw in Android...   To be clear I am unsure of the usage of "in" vs. "on". When should I use "in" and when to use "on"?


I am using a random forest for a binary classification problem using sklearn. The sklearn implementation outputs both a predicted class, and a probability for each class. The sklearn implementation assigns to class B each event whenever the prob of belonging to class A and B are both 0.5. I believe it is not legitimate to override this decision by changing the threshold of 0.5, but I am not sure of this. I am using the ROC curve to make a better decision. I know that the curve represents the True Positive Rate as a function of the True Negative Rate, but how does one obtain the threshold that belongs to each point of the curve? I mean, each point is given by the x,y coordinates, but not a threshold itself. And, more importantly, is this threshold the threshold applied to the random forest predicted class probabilities for classes A and B, or what does it refer to?

I'm having trouble understanding the ROC curve.  Is there any advantage / improvement in area under the ROC curve if I build different models from each unique subset of the training set and use it to produce a probability? For example, if $y$ has values of $\{a, a, a, a, b, b, b, b\}$, and I build model $A$ by using $a$ from 1st-4th values of $y$ and 8th-9th values of $y$ and build model $B$ by using remained train data. Finally, generate probability. Any thoughts / comments will be much appreciated.   Here is r code for better explanation for my question:  Y    = factor(0,0,0,0,1,1,1,1) X    = matirx(rnorm(16,8,2)) ind  = c(1,4,8,9) ind2 = -ind  mod_A    = rpart(Y[ind]~X[ind,]) mod_B    = rpart(Y[-ind]~X[-ind,]) mod_full = rpart(Y~X)  pred = numeric(8) pred_combine[ind]  = predict(mod_A,type='prob') pred_combine[-ind] = predict(mod_B,type='prob') pred_full          = predict(mod_full, type='prob')   So my question is, area under ROC curve of pred_combine vs pred_full.


Cryptography is about writing something that is hard/impossible to read without the correct key, basically, it is about hiding.  Now, what do you call:   Writing in a way that is easy to understand, even without a cultural background/context information?   For example, I could Write "Apple" but for someone who does not speak English, "Apple" has no meaning instead, if we draw an apple, almost everyone will understand.  Sample sentences:        When teaching reading to children we need some book that is _____.   Contrary to cryptography, ________ is about showing information in the most understandable way.   Thanks to ________, we can teach rudimentary of maths even to someone that is not able to read/write.

How can I describe the difficulty of somebody who is trying to explain something to people who are not in his/her professional field, and is afraid of using professional terms that will be unclear to his/her listeners?   In my native language, I would say "it is hard to go out of the professional circle". How can I say it in English?  An example:       I have tried my best to explain this subject as clearly as possible, but it is hard to______   I do not think my question is a duplicate because I looked for a term expressing a difficulty of explaining. I didn't get a direct answer, so I deduced there is no such a term.


Is it possible to install Ubuntu 16.04 LTS without formatting the target partiton??  HDD Partitions: I currently have Manjaro Gnome installed on /dev/sda4 and the /dev/sda3 is set to swap. The /dev/sda2 partition is a NTFS partition with all my personal data. I have installed Manjaro in a single partition. My target parition is /dev/sda1 which has my movies and videos. My partitoning scheme is MBR

Can I install Ubuntu without formatting any partitions on my hard drive?  I am already running Windows 7 and I want to install Ubuntu as well without formatting any of the partitions I have already created.


There is misalignment in showing the "N - more comments" in Stack Exchange app.  A little hard to describe so I have added the screenshots.    Not a big deal but wanted to let you know.  Updates: Just now realized that this issue could be due to screen resolution (I'm using Samsung Galaxy s Duos s7562)

In the Android app, the "x more comments" phrase is cut off by the button next to it, "Add a comment":    It looks like the rest of the phrase is underneath the button and there is some space to the left of the phrase. Can we shift the "x more comments" phrase more to the left so it doesn't get cut off by the "Add a comment" button? At the very least, please allow the phrase to not be cut off by the "Add a comment" button somehow.


What will be the time dilation between a point on a line connecting the centre of mass of both stars? ( Gravitation time dillation at point p ) Assuming both stars have equal mass.

As explained on , when an object is experiencing strong gravitational forces, time passes slower for it. If, in theory, you had two objects exerting the same amount of gravitational pressure on an object in opposite directions, effectively cancelling each other out, would they cancel out the time dilation, or would they compound, making the time dilation more prevalant?


For the consistency check of a backup program, I want to define a function which counts all files in a directory including all files in subdirs, subsubdirs and so on.  The solution I am trying so far is as follows:  countfiles() {   local cdir=$1   local files=$(ls -la $cdir | grep -cv '^[dl]')    local dirstring=$(ls -la $cdir | grep '^d' | egrep -o ' \.?[^[:space:].][^[:space:]]+$')   local directories=(${dirstring//"\n"/})    echo ${directories[@]}     for dir in ${directories[@]}; do     echo -n "$dir "     echo -n 'filecount >> '     local dirfiles=$(countfiles "$cdir/$dir")     echo -n $dirfiles     echo ' <<'     #files=$(($files+$dirfiles))   done    echo $files  }   Which gives me the following output:  .config .i3 .scripts .config filecount >> gtk-3.0 termite gtk-3.0 filecount >> 2 << termite filecount >> 2 << 1 << .i3 filecount >> 5 << .scripts filecount >> 2 << 5   While the actualization of my $files counter is commented atm and I may need to unlocalize it, right now I set all variables as local to avoid any interference.  The directory tree is as follows:  /.scripts/backup_dotfiles.sh /.config/termite/config /.config/gtk-3.0/settings.ini /.i3/config /.i3/i3blocks.conf /.i3/lockicon.png /.i3/lockscreen.sh /.gtkrc-2.0 /.bashrc /.zshrc /.i3 /.Xresources   My questions:   Why does it always count the files +1 except for the master directory? Why does it count anything in the '.config' directory, as there are no files in there? How can I fix this?

How can I use word counter (wc) and piping to count how many files or directories are in the /usr/bin directory?


This first one uses asterisk by the other_pipes list: nlp = spacy.load("en") other_pipes = [pipe for pipe in nlp.pipe_names if pipe != "ner"] nlp.disable_pipes(other_pipes)  However this other one doesn't: nlp = spacy.load("en") other_pipes = [pipe for pipe in nlp.pipe_names if pipe != "ner"] nlp.disable_pipes(*other_pipes)  Even so they had similar outputs: First: [('tagger', <spacy.pipeline.pipes.Tagger at 0x2103ab55c88>),  ('parser', <spacy.pipeline.pipes.DependencyParser at 0x2103a84cc48>)]  Second: [('tagger', <spacy.pipeline.pipes.Tagger at 0x222faa86cc8>),  ('parser', <spacy.pipeline.pipes.DependencyParser at 0x222f97bcca8>)]

In the following method definitions, what does the * and ** do for param2?  def foo(param1, *param2): def bar(param1, **param2):


I have recently noticed that there is an additional driver called Unknown: Unknown here which was not there before:    I have already read , and understand why it is there, but my question is, should I activate it? Will this make a difference? Or should I just leave it as it is as it sounds rather useful?    OS Information:  Description:    Ubuntu 15.04 Release:    15.04

After upgrading to 15.04, I have one additional driver (it did not appear in 14.10). What is the purpose of this driver and should I enable it?


We have a finite group $G$ and a homomorphism $\rho: G \rightarrow \mathbb{GL}_n(\mathbb{R})$ where $n$ is a positive integer. I need to show that there's an $n\times n$ positive definite symmetric matrix that satisfies $\rho(g)^tA\rho(g)=A$ for all $g \in G$, where $t$ means the transpose.   So far, all I could do was write definitions...not sure where to start. So for all non-zero vectors $v$ with $n$ real entries, $v^tAv>0$, and I know $A=A^t$ Also, I know $A$ is positive-definite if and only if there exists an invertible $n\times n$ matrix $P$ such that $A=P^tP$. But I'm not really sure where to go with that. I was wondering maybe I can start with $\rho(g)^tA\rho(g)=A$ and then show that $A$ is positive-definite, but I don't really see that going anywhere.

Let $\phi: G \to GL(\mathbb{R}^n)$ be a homomorphism, $G$ finite. Prove that there is a positive-definite matrix $M$ such that $\phi(g)^tM \phi(g) =M$ $\forall g \in G $.   This looks really interesting. Any idea is appreciated.


I have a question about an error message "(author?) [5]" rendered into my PDF. I'd very much like to render just the number in brackets. My bib file created with BibDesk looks like this:  @book{Martin_2002, Author = {Martin, Robert Cecil}, Date-Added = {2016-04-03 19:49:12 +0000}, Date-Modified = {2016-04-03 19:49:46 +0000}, Publisher = {Prentice Hall Computer}, Title = {Agile Software Development. Principles, Patterns, and Practices}, Year = {2002}}   I'm citing using this configuration:  \usepackage{natbib} \bibliographystyle{ieeetr} \setcitestyle{numbers,open={[},close={]}} ... \citet{Martin_2002}   The log file has plenty of warnings regarding the author:  Package natbib Warning: Author undefined for citation`Martin_2002'    The bibliography renders just fine:  [19] R. C. Martin, Agile Software Development. Principles, Patterns, and Practices. Prentice Hall Computer, 2002.   I'm quite the tex noob. How can I fix this? Thanks!

I have taken a look through many other questions on this subject but cannot seem to fix my issue. Essentially while references display correctly I cannot get the author citation to appear in my text despite running pdflatex followed by bibtex followed by two more runs of pdflatex. Any help would be appreciated.  Sample tex file:  \documentclass{article} \usepackage{natbib}  \begin{document}  Blahblahblah \citet*{Test12}.  \bibliographystyle{plain} \bibliography{refs}  \end{document}   refs.bib:  @article{Test12, author = "John Smith", title = "Test Article", year = "2012", journal = "The Test Journal" }   Output:


I am confused about how to mark edits in the current Question or Answer. It seems to me that using EDIT: is a generally accepted standard, but I was not able to find anything "official" about it, as it is impossible to search for these terms.

I often see questions edited into this form:     Lorem ipsum dolor sit amet blah blah blah paragraph paragraph original question.            UPDATE: The Lorem disappeared and left this message: "new information".   I find this format unaesthetic (since Stack Exchange posts are supposed to be useful in the long term and update boundaries are artifacts of the creation rather than the content) and feel that new information should, whenever possible, be incorporated into the original text “as if it had always been that way” if practical, and pointing out an update should be done mostly in comments.  Is this an appropriate writing style, and if so under what circumstances? If not, should it be removed or discouraged?


I just accidentally copied nearly 500 pics and videos to my desktop.  Is there a way to delete all items by date from the desktop?

I am using a Mac. How can I use a command to delete all files in ~/Downloads whose dates added are greater than 1 year?


Just moved a site from a Windows server running IIS to a Linux server running Apache, there are some images titled, for example, image.php.jpg (they are images).   When accessing them, I get this error:  A file permissions error has occurred. Please check the permissions on the script and the directory it is in and try again.   From reading a little, I need to put something in the .htaccess file, of which there isn't one as it was a site on a Windows server.  Could someone please kindly indicate what I need to put in the .htaccess file to avoid the server processing 'anything' with .php in the filename as a .php page?  Thank you in advance.

I have an odd problem...I'm using a documentation generator which generates a lot of output like docs/foo.php.html. It's XHTML, and thus contains <?xml...> tags at the beginning of file. The problem is, Apache has somehow decided to run it through the PHP interpreter, even though ".php" appears in the middle of the filename, and not at the end. This, in turn, triggers a PHP error, because it sees "<?" as the command to start executing PHP code, and immediately gets confused by the "xml..." which follows it.  How do I configure Apache to ONLY execute .php files and not .php.html files? The string "php.html" does not appear explicitly anywhere in my Apache config files. There is a line "AddHandler php5-script .php", but I don't see how that would also include ".php.html" files.


I am having toruble with the installation of the l3backend package. I wanted to install the package because when trying to compile my file this error popped up:  ! LaTeX Error:  File `l3backend-pdfmode.def' not found. Type X to quit or <RETURN> to proceed,or enter new name.  (Default extension: def)Enter file name:! Emergency stop.<read > }  I downloaded the package and tried to install the l3backend.ins in my windows console by going into the right directory and then typing   latex l3backend.ins  Then my console said that the command latex was written wrong or not found.   Any suggestions on how to install that package so that I can finally compile my thesis again??

I updated my TeXlive distribution a couple times in the past week, and now I get this error when I include package expl3 (or any other package that includes it, such as fontspec). Before the updates it was working fine. Am I missing any package that should be installed? I tried searching for l3backend-pdfmode.def, but I found no results.  \documentclass{article} \usepackage{expl3} \begin{document} Hi \end{document}   λ lualatex a This is LuaTeX, Version 1.10.0 (TeX Live 2019)   restricted system commands enabled. (./a.tex LaTeX2e <2018-12-01>  luaotfload | main : initialization completed in 0.042 seconds (/opt/texlive/2019/texmf-dist/tex/latex/base/article.cls Document Class: article 2018/09/03 v1.4i Standard LaTeX document class (/opt/texlive/2019/texmf-dist/tex/latex/base/size10.clo)) (/opt/texlive/2019/texmf-dist/tex/latex/l3kernel/expl3.sty (/opt/texlive/2019/texmf-dist/tex/latex/l3kernel/expl3-code.tex)  ! LaTeX Error: File `l3backend-pdfmode.def' not found.  Type X to quit or <RETURN> to proceed, or enter new name. (Default extension: def)  Enter file name:  ! Emergency stop. <read *>   l.282   }   379 words of node memory still in use:    2 hlist, 1 rule, 1 dir, 3 kern, 1 glyph, 4 attribute, 48 glue_spec, 4 attrib ute_list, 1 write nodes    avail lists: 2:9,3:3,4:1,5:2,7:2,9:2 !  ==> Fatal error occurred, no output PDF file produced! Transcript written on a.log.


What i want to do is have a function which checks some conditions and assigns a value according to which condition is true. But the variable assignment in the function does not affect the value outside. (Scopes)  While the following code won't work, is there any way to not have to write the if-elif block again and again?   def calc():     if o==1:         z=x+y     elif o==2:         z=x-y  calc() print(z)

How can I create or use a global variable in a function?  If I create a global variable in one function, how can I use that global variable in another function? Do I need to store the global variable in a local variable of the function which needs its access?


I noticed time.mktime(.timetuple()) returned different time on mac and linux(ubuntu). Why this?  date = ['2016-07-01', '2016-07-05']  xdata = [datetime.datetime.strptime(str(s), "%Y-%m-%d") for s in date] xdata = [time.mktime(s.timetuple()) * 1000 for s in xdata] print xdata  # ----mac-- >> [1467356400000.0, 1467702000000.0]  #-----linux--- >> [1467345600000.0, 1467691200000.0]   How to return in UTC?

How do I convert a datetime string in local time to a string in UTC time?  I'm sure I've done this before, but can't find it and SO will hopefully help me (and others) do that in future.  Clarification:  For example, if I have 2008-09-17 14:02:00 in my local timezone (+10), I'd like to generate a string with the equivalent UTC time: 2008-09-17 04:02:00.  Also, from , note that in general this isn't possible as with DST and other issues there is no unique conversion from local time to UTC time.


When I try:  sudo apt-get install ffmpeg   I get:  Reading package lists... Done Building dependency tree        Reading state information... Done Package ffmpeg is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source  E: Package 'ffmpeg' has no installation candidate   And I don't know how to install ppa packages.

I tried to install ffmpeg in trusty/Ubuntu 14.04 and got the following message:  $sudo apt-get install ffmpeg  Reading package lists... Done Building dependency tree        Reading state information... Done Package ffmpeg is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source  E: Package 'ffmpeg' has no installation candidate   Why isn't the package available?


I have a Nikon d3400. I'm using a 70-300mm afp lense and my moon shots look like someone is aiming a flashlight at me. No craters so I thought I needed a filter. After reading some of what's here I see I don't. Obviously I'm a beginner and I've been shooting in auto. I've tried a couple of the settings and I'm getting the same result. Any help would be appreciated.

All my attempts to get a good shot of the full moon with my DSLR result in an overexposed circle on a black background.  I've tried using a tripod, remote shutter release, low ISO, and long exposure, but nothing has worked so far.  What combination of ISO and exposure time that will produce good results?   I particularly want to catch a full moon with the reddish effect when it is close to the horizon.


The code basically checks the given array is symmetrical or not. When i send parameter std::array i get this error :     ccCPLdU9.o:main.cpp:(.text+0x5da): undefined reference to bool isItSymmetrical<5u>(std::array<int, >5u> const&)'   AppData\Local\Temp\ccCPLdU9.o:main.cpp:(.text+0x60b): undefined reference to >bool isItSymmetrical<2u>(std::array const&)'   std::array implementation should be work with unknown size, i couldn't figure out why it turned out. the error  Other implementations works well by the way.  My question5.hpp file   #ifndef question5_hpp #define question5_hpp  #include <iostream> #include <array> #include <vector>  bool isItSymmetrical(int const arr[], int size); template<std::size_t SIZE> bool isItSymmetrical(const std::array<int, SIZE> &arr); bool isItSymmetrical(const std::vector<int> v);   #endif /* question5_hpp */   Related question5.cpp file  template<std::size_t SIZE> bool isItSymmetrical(const std::array<int, SIZE> &arr) {     for (int i = 0; i < (int)(arr.size()/2); i++)     {         if (arr[i] != arr[arr.size()-i-1])         {             return false;         }     }     return true; }   And main.cpp  std::array<int,5> ar1  {2, 4, 6, 8, 10}; std::array<int,5> ar2  {2,4,5,4,2}; std::array<int,2> ar3  {1,2}; std::cout << isItSymmetrical(ar1) << "\n"; std::cout << isItSymmetrical(ar2) << "\n"; std::cout << isItSymmetrical(ar3) << "\n";

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


Currently I'm using  that displays a bunch of nodes on a single page.  And I also have translated content in different languages.  The core functionality to switch a sites language currently creates a prefix in the URL, but is there one for switching the language via a GET variable like www.example.com/node/8?lang=german?

I've enabled the Locale and Content Translation module but am having trouble understanding how to do something that it seems should be working.  Basically I have a page, we'll say '/about' and it's in English.  I click translate, I have a few languages enabled, so I click to add translation for Japanese. It brings up the interface for making a new page. I change some stuff to Japanese, and set the URL alias to be /about ('about') like the english page.  I've setup my language options to use the "Session" detection method.  The result I'm wanting to achieve, but not getting is to have:  www.example.com/about -- to go to english (this works) www.example.com/about?language=ja -- to go to the Japanese translation, this does not work, it just loads up the English page.   It seems like this would be the normal functionality so I feel like I'm missing something here.


Would it be a good idea to have the capability to directly link to a specific answer?  Sometimes when answering questions, I would like to link to another questions's answer, but it isn't always the accepted answer.    A good example is .  The accepted answer has been up-voted, but there is another answer that goes into much more detail (and has a lot more up-votes).  It seems that the more up-voted answer has been more helpful to people visiting the question after the initial accepted answer.  So, when answering another question, it might be nice to reference just the more detailed answer.  In this context, it wouldn't be correct to name the new question as duplicate because the context of the question is different.

I saw a really hilarious (and correct) answer to a question and wanted to link directly to it because of the way answers "float" up and down based on votes. And for me to find the URL I had to go to the posters profile, page through all of their responses (thank God it wasn't Jon Skeet), and find the link. Is there an easier way? If not could we have a link to the question posted in the question header so we can copy it's destination?(The way that I have seen that liked best was just the number displayed linking to the correct URL so you could just click the URL and copy it.)


Here in China, pretty much everything by Google is blocked by the government. If you request anything from a Google domain, it will give the appearance of loading for a while and then give back a DNS error.  Stack Exchange uses a Google CDN to deliver some scripts, which means that users in China will see Waiting for ajax.googleapis.com... for a while and then the script will fail to load.  I usually press the stop button so I don't have to wait to see the page content, but without the script loaded the actions I can perform are limited; for example pressing upvote/downvote does nothing. I can sometimes post a question or answer, but it seems to redirect to a CAPTCHA more often when the script is not loaded, and   Can we use some CDN that isn't blocked in China, or at least have some sort of fallback to improve the experience for users in China?    EDIT: The answer on  is targetted at people intentionally blocking scripts because of being persnickety about privacy, not because of people not being able to access scripts because of forces beyond their control. The reasoning given there (i.e. being hard to support by choice) doesn't apply here. Furthermore, I am not asking about removing reliance on external scripts in general, I am suggesting that reliance on Google's scripts be resolved because of a significant issue with them in a country with a very large population.

I dislike running third-party scripts in my browser and have disabled these generally.   I can enable them on an exceptional basis, but it strikes me that Stack Exchange has an unusually heavy reliance on JavaScript code that's hosted externally, that is, on other sites.  In particular, much of Stack Exchange's functionality is dependent on scripts hosted at googleapis.com (although there are several other locations called out to).   Copied from , the following functionality is dependent on external sites:   Adding comments. Voting. Controls (image, code buttons, etc.) missing from message posting form and the preview does not appear. Automatic recognition that you are 'not a bot'. Notify daily of new answers option. ...   I find this annoying - I consider it to be a (mild) security/privacy problem.  But, also, it must cause problems with Stack Exchange's proper function. If such an external site is down: much of Stack Exchange's functionality will fail.  Can this be changed?


I checked if I had money in my bank account or not an hour ago.  Now if I say "I have checked today my bank account", is that a correct sentence.  Should it be "I have checked" or "I checked it today"

My question might seem to be stupid enough, it's basic grammar, I believe; however, I'm at my wits' end. Should we use Past perfect or Past Simple in the following sentence:     He promised/ had promised to turn up at 4, but appeared at 9?


I know that the converse of this is true. I was looking for some counterexamples proving this statement false.

Let I be an open interval that contains the point c and let f be a function that is defined on I except possibly at the point c. Suppose that lim |f(x)| as x->c exists. Give an example to show that lim f(x) as x->c may not exist.   Not really sure of an example for this?


I want to find a union of two dictionaries, that may contain the same keys, but different values. If key exists in both dictionaries, then I want to merge the values (if they differ) into list. If key exists in only one dictionary, then I want to create a List and add that item to it. So, for example: var dict1 = new Dictionary<int, string>(); var dict2 = new Dictionary<int, string>();  dict1.Add(1, "a"); dict2.Add(1, "b"); dict1.Add(2, "c");  var resultDict = Combine(dict1, dict2);  Result dictionary will be the type of Dictionary<int, List>, and will contain { 1: ["a", "b"], 2: ["c"]}. The simplest solution I can think of, is to traverse union of keys and add empty lists, then traverse both dictionaries and add all values to list for given keys. Is there any good, functional solution to combine these two Dictionaries?

What's the best way to merge 2 or more dictionaries (Dictionary<T1,T2>) in C#? (3.0 features like LINQ are fine).  I'm thinking of a method signature along the lines of:  public static Dictionary<TKey,TValue>                  Merge<TKey,TValue>(Dictionary<TKey,TValue>[] dictionaries);   or  public static Dictionary<TKey,TValue>                  Merge<TKey,TValue>(IEnumerable<Dictionary<TKey,TValue>> dictionaries);   EDIT: Got a cool solution from JaredPar and Jon Skeet, but I was thinking of something that handles duplicate keys. In case of collision, it doesn't matter which value is saved to the dict as long as it's consistent.


I am very new to ubuntu. I have been tring to load "Wine" and "Dolphin" on my system. Every thing I have tride and all the instruction I have followed have been useless. Is there a straight forward non-geek way for me to install these programs?

The title says it all. I'd like to know how I can install software - an example is the Chromium web browser.


I was reading the paper: "Estimating Probabilities of Default for Low Default Portfolios" by Katja Pluto and Dirk Tasche and they mention the following:  The tail distribution of a binomial distribution can be expressed in terms of an appropriate beta distribution function.  I have not so much knowledge of statistics, is it possible someone could explain to me why is this the case? Thank you very much!

I'm more of a programmer than a statistician, so I hope this question isn't too naive.  It happens in sampling program executions at random times. If I take N=10 random-time samples of the program's state, I could see function Foo being executed on, for example, I=3 of those samples. I'm interested in what that tells me about the actual fraction of time F that Foo is in execution.  I understand that I is binomially distributed with mean F*N. I also know that, given I and N, F follows a beta distribution. In fact I've verified by program the relationship between those two distributions, which is  cdfBeta(I, N-I+1, F) + cdfBinomial(N, F, I-1) = 1   The problem is I don't have an intuitive feel for the relationship. I can't "picture" why it works.  EDIT: All the answers were challenging, especially @whuber's, which I still need to grok, but bringing in order statistics was very helpful. Nevertheless I've realized I should have asked a more basic question: Given I and N, what is the distribution for F? Everyone has pointed out that it's Beta, which I knew. I finally figured out from Wikipedia () that it appears to be Beta(I+1, N-I+1). After exploring it with a program, it appears to be the right answer. So, I would like to know if I'm wrong. And, I'm still confused about the relationship between the two cdfs shown above, why they sum to 1, and if they even have anything to do with what I really wanted to know.


Please keep in mind this is the first time I've ever written a bash script, worked on Linux just the first time really that I'm trying to achieve something like this.  I've written a script that I now want to make available to other people, I will be posting it on Github and what not. I've read and followed  up until step 6. But I can't seem to figure out how to apply it for my own needs.  What I have is three scripts. One script makes use of the two others. They are right now just sitting in a directory. What I want to do is make it installable by making a .deb package of it.  When you install the package I want the scripts to be placed in a corresponding directory in /etc and I want to be able to create the man page and alias etc in the install process so everything will work after installing the program.  Could someone help me out on how to do this, or point me to a good tutorial that will help me to figure this out.

I have a single python script that I want to distribute as a deb package. It is a  which shows local date in Unity panel. I did follow  but I could not create a deb package because it fails.   Can someone give me a step-by-step instruction on what I should do? As far as I know this script depends on python-appindicator.   NOTE: I do not want any links to Debian/Ubuntu packaging instructions. I have seen most of them. I don't find them beginner friendly.


enter code here import java.util.ArrayList;  import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver;   public class ArrayLiist {      public static void main(String[] args) {         launchBrowser("CH");         WebDriver driver=null; driver.findElement(By.id("user_login")).sendKeys("admin");         driver.findElement(By.id("user_pss")).sendKeys("demo123");         driver.findElement(By.id("wp-submit")).click();        }        public  static void launchBrowser(String bn) {         if(bn=="CH")         {         System.setProperty("webdriver.chrome.driver","E:\\Selenium Downloaded\\chrome\\chromedriver.exe");          ChromeDriver driver = new ChromeDriver();         driver.get("http://demosite.center/wordpress/wp-admin/plugins.php");         }   } }   i think driver is not being identified ? i have institiated webdriver =null , still it is showing null pointer exception  Exception in thread "main" java.lang.NullPointerException     at ArrayLiist.main(ArrayLiist.java:13)

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


I have already researched this and all information is either for old versions of chrome or says that it's impossible.  Also, I don't want to attach any arguments to the end of chrome, like suggested   With the new tab page in chrome 29.0.1547.62, the first launch (as in, every time you launch a new chrome window when none are open) is always very laggy. It can take up to 1-2 minutes and sometimes crashes.  I use the omnibox if I want to search, I have no need for the google search bar (it's easier to use, you just press F6 and type your search) and I don't need the most visited pages.  What do I do in the newest chrome to change this?  I'm using windows 7 and the desktop version of windows 8 (two different computers)

I've just updated to the latest Google Chrome Dev build, and they've changed from the annoying-but-ok new tab page to an ugly and less usable page.  On the old one, nine thumbnails was not enough, and now they've restricted it to eight.  There's an empty "Tips and Suggestions" box which I wouldn't want even if it had stuff in; they've added Recent Downloads - on the rare occasions when I need that, I'll hit Ctrl-J to open the Downloads tab; and the site-specific search box on the right has now gone!  Is there a way to get the old new tab page back, or a plugin to provide a superior one?   Update: I launch Chrome by pressing Win+R and entering "chrome" - I have a shortcut on the Path with a Target of "C:\Documents and Settings\<user>\Local Settings\Application Data\Google\Chrome\Application\chrome.exe" --old-new-tab-page and whilst double-clicking this shortcut brings up the previous new tab page, using the keyboard method results in the old one.  How do I get it working via the Run box? (Without using a batch file, which slows things down too much.)  Update 2: GRRR! Now they've gone and stopped the --old-new-tab-page parameter from working at all! I hate this new version of the page that they're forcing upon us - can anyone provide a method to get rid of it and get the decent page back?


I got those strange shadow artifacts when rendering with Eevee. Does anyone knows what might cause it ?    Thanks

Recently I downloaded blender 2.8 for the new real-time render engine, but then I found out that the shadow in the eevee is really unexpected. Just like shown above, the quality of the shadow is bad and the movement of the shadow is also strange when I move the object. The lamp is a sunlight, and the sphere and the plane are just preset meshes. Could you tell me what adjustment do I need to create a normal shadow?


This interface provides one method, namely getContentTypeFor(String fileName). However, I have no idea how to use it. I implemented interface in Eclipse and ended with:  import java.net.FileNameMap;  public class Fnam implements FileNameMap {  public static void main(String[] args) {  }  @Override public String getContentTypeFor(String fileName) {     return null; } }   The method returns null. How should I change it to get the MIME type ?

How do you get a Media Type (MIME type) from a file using Java?  So far I've tried JMimeMagic & Mime-Util. The first gave me memory exceptions, the second doesn't close its streams properly. How would you probe the file to determine its actual type (not merely based on the extension)?


How to evaluate the following limit?  $$\lim_{x\to1}\dfrac{x^n+x^{n-1}+x^{n-2}+\cdots+x-n}{x-1}.$$  I could simplify but couldn't proceed further

I am able to evaluate the limit $$\lim_{x \to 1} \frac{x + x^2 + \dots + x^n - n}{x - 1} = \frac{n(n + 1)}{2}$$ for a given $n$ using l'Hôspital's (Bernoulli's) rule.  The problem is I don't quite like the solution, as it depends on such a heavy weaponry. A limit this simple, should easily be evaluable using some clever idea. Here is a list of what I tried:   Substitute $y = x - 1$. This leads nowhere, I think. Find the Taylor polynomial. Makes no sense, it is a polynomial. Divide by major term. Dividing by $x$ got me nowhere. Find the value $f(x)$ at $x = 1$ directly. I cannot as the function is not defined at $x = 1$. Simplify the expression. I do not see how I could. Using l'Hôspital's (Bernoulli's) rule. Works, but I do not quite like it.   If somebody sees a simple way, please do let me know.    Added later: The approach proposed by Sami Ben Romdhane is universal as asmeurer pointed out. Examples of another limits that can be easily solved this way:   $\lim_{x \to 0} \frac{\sqrt[m]{1 + ax} - \sqrt[n]{1 + bx}}{x}$ where $m, n \in \mathbb{N}$ and $a, b \in \mathbb{R}$ are given, or $\lim_{x \to 0} \frac{\arctan(1 + x) - \arctan(1 - x)}{x}$.   It sems that all limits in the form $\lim_{x \to a} \frac{f(x)}{x - a}$ where $a \in \mathbb{R}$, $f(a) = 0$ and for which $\exists f'(a)$, can be evaluated this way, which is as fast as finding $f'$ and calculating $f'(a)$.  This adds a very useful tool into my calculus toolbox: Some limits can be evaluated easily using derivatives if one looks for $f(a) = 0$, without the l'Hôspital's rule. I have not seen this in widespread use; I propose we call this Sami's rule :).


In Jürgen Neukirch's "Algebraic Number Theory", page 5.     An algebraic number field is a finite field extension $K$ of $\Bbb Q$. The elements of $K$ are called algebraic numbers.   Is $K$ here a subfield of $\Bbb C$?

I have seen that some authors are defing the number field as a subfield of $ \mathbb C$ which is a finite extension of the rational numbers $ \mathbb Q $, while some others without referering to complex numbers $ \mathbb C$ . I think we don't need $ K$ to be a subfield of $ \mathbb C$ in the definition. So, my question is the follwing:     Is it neceserily to define $K$ as a subfield of $ \mathbb C$ or not ?   And if no why ? Is it true that if we omit this in the definition, that then $K$ will turn out to be a subfield of $ \mathbb C$?   I came up with this question, when I saw that in order to define infinite primes in a number field then these are determined by the embeddings $ K \to \mathbb C $  Any idea would be really appreciated.  Thank you in advance.


EDIT:  I've been recieving quite a bit of criticism over this question so I have edited it to hopefully reach a compromise that everyone can agree upon.  While I disagree that imposing a downvote limit from one person to another would negatively impact the SE voting system, I understand that imposing such a limit is not an answer that will be agreed upon and thus is not the proper solution.     For this reason I propose an alternate solution that does not impose any limits whatsoever.  Instead of imposing limits, a simple notification system to let a user know when they are in danger of being flagged by the automated system for serial down/upvoting could be put in place.   Adding this alert would effectively discourage people who actually intend to "serial down/upvote."  I'm sure most people who are serial voters are unaware that a system is in place to stop it, and just notifying them that this system exists would be enough to discourage many of them.  To address another point made:  This would also be very helpful to those who run into a user who frequently asks bad questions.  As noted in a previous comment on Monica Cellio's response to this question, the automated system frequently fails when a user spams multiple bad questions and the downvotes are falsely detected as being "serial downvotes." ()  Alerting users that their votes may be reversed by the automated system if they do too many would relieve some of that problem. (Obviously it would not fix the problem, the system is inherently broken when dealing with situations like these, but a true solution to that issue should be left for another proposal).  The original question below is kept only for consistency and so all of the responses make sense.  All future votes on this question should reflect the edit and not the original post.    ORIGINAL QUESTION:  I've asked numerous questions on Stack Overflow.  Just recently I began to notice that almost every new question I ask always gets one downvote, regardless of the quality of the question.  Obviously I don't know who is downvoting my questions, or even if it is the same person each time; but it at least begs the question . . . Could there be someone out there purposely downvoting my questions because of a personal vendetta?  Not that this kind of rivalry happens frequently, but people have it out for each other in the comments section all the time so I wouldn't be surprised if some rivalries form.  I think it would be a good idea to limit how many times one user can downvote another user.  (Obviously the limit would be reasonable, for example you may be only allowed to downvote another user's questions and/or responses 10 times in one month.)  Even if such a limit were imposed and you find that you reach this limit; if the user you wish to downvote truly has bad questions all the time, they will get enough downvotes from other users anyways.  Chances are if a user reaches this limit they are probably trying to abuse the voting system anyways.  If a user frequently reaches this limit it would be a useful indication to look into them for potential serial downvoting.  To any naysayers to this question saying it would be a bad idea because it encourages users to ask bad questions... Think about it realistically.  Would you frequently reach this limit..? I highly doubt it.  And if you would frequently reach this limit, maybe you should stop for a minute and question your voting habits.

It looks like this guy  without even knowing it.  I don't get the impression that he was trying to harm anyone with this process.  What about a warning message that triggers after a person upvotes (or downvotes) the same person X times within Y time span (with X and Y being thresholds that are well below the limit that actually results in a vote fraud reversal)?  Say, twice within 15 minutes?  Maybe display a warning pop-up that says:     Whoa, Camel!  It looks like you're starting to perform serial voting on a particular user.  Did you know that    I have little doubt that this guy would have stopped had he been (gently) warned.  Perhaps others will stop, too.


I want to add a function after I create an input element. but it didn't work. this is my code.
      <input type="button" onclick="add();" value="Add Template"/>
     Photo: <input type="file" id="chooseFiles" name="photo[]"  class="inputFile">

         the existing input works. but after createElement, function add() doesn't work..

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


Why do people say "I am home" in the meaning of "I am at home"?   Here is the person who say "I am home" he is human being and not object as home. In addition, why people don't say "I am university" or "I am supermarket" etc?

Consider this question:  Where are they (things or people)?  Would the following answer be with (at), without it or either one?  I left them (at) home  I have done a quick Google search and found quotes for both cases, with and without:  This Widow's 4 Kids Were Taken After She Left Them Home Alone. Leaving Your Child Home Alone - KidsHealth Gerry said, "I left them at home." Gerry sat down and turned on the TV set just as Mark would have done.  I read about "home" being an adverb but also know "stay at home moms" for example. So you see I need definite answers.


What does awaiting reviewers reply mean?  And how long does it take

What steps does a manuscript typically go through from submission to publication (or rejection) in a typical journal? How are these steps referred to, in particular by editorial systems, and how long do they each typically take?  Note that this question is about the typical situation and hence not about:   Journals with an atypical workflow, e.g. those that allow for an instantaneous reviewer–author interaction. Exceptional steps or rare occurrences such as withdrawal or .   This is a canonical question on this topic as per . Due to its nature, it is rather broad and not exemplary for a regular question on this site. Please feel free to improve this question.


In that folder are stored the news files: they can be created by the system administrator to write some informations for the users, as suggested in  link.  I tried as a normal user to add a file in /var/lib/sysnews, but nor this command  echo "Hello world" > /var/lib/sysnews   neither this command  sudo echo "Hello world" > /var/lib/sysnews   worked (it gives permission denied error).  The folder is owned by root user and by the staff group. My normal user was already in the sudo group; I added the staff group for my user, but with no results.  I can add news only by creating a file in one of my folders and then typing  sudo mv myfile /var/lib/sysnews   but it is bothering.  Is there a simpler way to add some news file to that folder without being root?

When you attempt to modify a file without having write permissions on it, you get an error:  > touch /tmp/foo && sudo chown root /tmp/foo > echo test > /tmp/foo zsh: permission denied: /tmp/foo   Sudoing doesn't help, because it runs the command as root, but the shell handles redirecting stdout and opens the file as you anyway:  > sudo echo test > /tmp/foo zsh: permission denied: /tmp/foo   Is there an easy way to redirect stdout to a file you don't have permission to write to, besides opening a shell as root and manipulating the file that way?  > sudo su # echo test > /tmp/foo


I am creating a custom WPF user control that contains amongst other things a timer. As the timer runs one of the things that occurs is that a text file is updated. This means I can see that when the control is removed from the parent (when it is no longer needed) the timer is still running. This could present a problem as controls are added and removed frequently so potentially stacking up a lot of memory usage over time. It's no big hardship to stop and dispose of the timer as the control is unloaded. But it's got me thinking is every resources I am using within said control being retained in memory once the control has been removed from the parent? Should I be handling strings and database rows / tables I have used as well.  What is the correct way of remove a control and completely disposing of it?

I have created a custom WPF user control which is intended to be used by a third party. My control has a private member which is disposable, and I would like to ensure that its dispose method will always get called once the containing window/application is closed. However, UserControl is not disposable. I tried implementing the IDisposable interface and subscribing to the Unloaded event but neither get called when the host application closes. MSDN says that the Unloaded event may not be raised at all. And it might also be triggered more than once, that is when user changes theme. If at all possible, I don't want to rely on consumers of my control remembering to call a specific Dispose method.  public partial class MyWpfControl : UserControl  {      SomeDisposableObject x;       // where does this code go?      void Somewhere()       {          if (x != null)          {              x.Dispose();              x = null;          }       }  }  The only solution I have found so far is to subscribe to the Dispatcher's ShutdownStarted event. Is this a reasonable approach? this.Dispatcher.ShutdownStarted += Dispatcher_ShutdownStarted;


Some Arduino starter-kit projects show the resistor placed before the anode of a LED, coming from output, and others show it after the cathode, going to the ground. Is there any difference? Why?

Please be kind, I am an electronics nub.  This is in reference to getting an LED to emit photons.  From what I read (Getting Started in Electronics - Forrest Mims III and Make: Electronics) electrons flow from the more negative side to the more positive side.  In an example experiment (involving a primary dry cell, a SPDT switch, a resistor and an LED) it states that the resistor MUST be connected to the anode of the LED.  In my mind, if the electrons flow from negative to positive, wouldn't the electron flow run through the LED before the resistor; thereby making the resistor pointless?


My images show up at the end of the chapter (only happens in one chapter), even though I use strict float parameters [!htpb] or only [h!]. I would like them to show up in the text on the (almost) precise position where I've placed them. (and yes, I have used \usepackage{graphicx} and \usepackage{float}). Example of image input: \begin{figure}[!htb] \centering \includegraphics[width=0.5\textwidth]{figures/Part II/II-1_vitruvius.jpg} \caption{Vitruvius' principles} \label{fig:II.1_Vitruvius} \end{figure}  Weird thing is that no errors show up. Does anybody know how to fix it? Thanks in advance.

Is there any package or a method to force LaTeX to keep floating environments like table and figure closer to where they are declared?


I am trying to uninstall an app (Forticlient) with this command:  sudo apt-get --purge remove forticlient   When I run it I get the following error:  E: Could not get lock /var/lib/dpkg/lock-frontend - open (11 Resource temporarily unavailable) E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?   I tried killall on the Forticlient processes but the error still occurs.  Is there a way to see which process is locking the file?  Alternatively is it possible to force the uninstallation even if there is a lock?

I have just booted my clean Ubuntu 18.04 LTS VM and tried to install some application with sudo apt install.  But got error message:     E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable)       E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?   What process created the /var/lib/dpkg/lock-frontend file in Ubuntu? How to gently stop it and take manual control on APT?


\begin{table*}[t] \renewcommand{\arraystretch}{1} \caption{C at PCC} \label{Table1} \centering \begin{tabular}{c|c|c|c|c|c|c|c|c}  \hline \hline  Standards &\multicolumn{2}{c}{IEEE 2014}& \multicolumn{2}{|c}{IEEE 2018}& \multicolumn{2}{|c}{IEC 27} &\multicolumn{2}{|c}{EN61-2}\\ \cline{2-4}  \end{tabular} \end{table*}   While using this I got an error:   Extra alignment tab has been changed to \cr. <template> \endtemplate l.81 ...&\multicolumn{2}{|c}{EN61-2}\\ \cline{2-4} You have given more \span or & marks than there were in the preamble to the \halign or \valign now in progress. So I'll assume that you meant to type \cr instead.

\documentclass{cta-author}  \newtheorem{theorem}{Theorem}{} \newtheorem{corollary}{Corollary}{} \newtheorem{remark}{Remark}{} \usepackage{blindtext} \usepackage{enumitem} \usepackage{array} \usepackage{mathrsfs} \usepackage{amsfonts} \usepackage{bm} \usepackage{tabularx} \usepackage{multirow} \usepackage{amsmath} \usepackage{graphicx} \usepackage{float} \usepackage{makecell} \usepackage{adjustbox} \usepackage{textcmds} \usepackage{lineno} \usepackage{rotating}  \begin{document}   \begin{table*}[t] \renewcommand{\arraystretch}{1} \caption{C at PCC} \label{Table1} \centering \begin{tabular}{c|c|c|c|c|c|c|c|c}  \hline \hline  Standards &\multicolumn{2}{c}{IEEE 2014}& \multicolumn{2}{|c}{IEEE 2018}& \multicolumn{2}{|c}{IEC 27} &\multicolumn{2}{|c}{EN61-2}\\ \cline{2-4}  \end{tabular} \end{table*}    \end{document}   I use this code to generate table but is showing an error as given below. While I give \hline instead of \cline{-} it is working properly. But I need to use that \cline.


I had a look in the activity monitor and when I pulled more information about TabNine, I didn't quite understand the concept of "virtual memory". It says "390GB". How can it have a virtual memory of 390GB when I have a base variant mac with 8GB|256GB spec ?

Why does my MBP sometimes report VM Size: 300+ GB in Activity Monitor under System Memory tab, when my hard disk size is only 250 GB (total) and RAM is 4GB? I know it can't magically get that extra space, but what is it trying to tell me?


I have a bit of an issue. I have a dataset with around 6000 records stored in a MSSQL 2016 database, where I need to concatenate each column, sorted on row basis and grouped by an ID.  It is no problem to sort the data within the column itself, but the position of the concatenated values is the key in the system that needs the data. So, if I merge four rows with the same ID, each row value must be in the same position throughout the whole resultset row.  To make it even more messy, I must be able to apply some logic to determine which row should be in position one.  If I use the the sort functionality in GROUP_CONCAT_DS (I'm using a semicolon delimiter), it sorts on the column values, which make the index position of each merge inconsistent related to the rows that holds the data.  Example data:  id  col1  col2 -------------------- 1  foo    bar 1  lorem  ipsum 2  hi     cowboy   Expected output:  id, concat_col1, concat_col2 ---------------------------- 1  foo;lorem     bar;ipsum 2  hi            cowboy   Absolutely unacceptable output:  id  concat_col1  concat_col2 ---------------------------- 1   bar;foo      lorem;ipsum 2   hi           cowboy   In pseudo-SQL, this is a simplified example of what I want to achieve:  SELECT     [id]     ,dbo.GROUP_CONCAT_D([col1], ';') AS [concat_col1]     ,dbo.GROUP_CONCAT_D([col2], ';') AS [concat_col2]   FROM [hrm].[vEmploymentsPositions]   GROUP BY [id]   ORDER BY [id] asc, [col1] desc, [col2] asc   ... But for loical reason the sort doesn't work that way.  How can I approach this issue and make a robust solution that fit our needs?

I'm trying to migrate a MySQL-based app over to Microsoft SQL Server 2005 (not by choice, but that's life).  In the original app, we used almost entirely ANSI-SQL compliant statements, with one significant exception -- we used MySQL's group_concat function fairly frequently.  group_concat, by the way, does this: given a table of, say, employee names and projects...  SELECT empName, projID FROM project_members;   returns:  ANDY   |  A100 ANDY   |  B391 ANDY   |  X010 TOM    |  A100 TOM    |  A510   ... and here's what you get with group_concat:  SELECT      empName, group_concat(projID SEPARATOR ' / ')  FROM      project_members  GROUP BY      empName;   returns:  ANDY   |  A100 / B391 / X010 TOM    |  A100 / A510   So what I'd like to know is: Is it possible to write, say, a user-defined function in SQL Server which emulates the functionality of group_concat?   I have almost no experience using UDFs, stored procedures, or anything like that, just straight-up SQL, so please err on the side of too much explanation :)


In the above diagram, assume that the level is solid and massless:  In the left setup, both mass are fixed on the level.  As we know, it is not a stable mechanical balance. For any tilt, the level will tilt more. In the right setup, both mass are hanged from a fixed location from the level. It is also the normal and old-fashioned setup for mechanical analytic balance.  As we know, it is a stable mechanical balance.  If one end is heavier than the other, the level will tilt to an angle and restore the balance.  But I can arrive at the above conclusion using mechanical analysis, e.g.:  If the two ends are not balanced, at what angle the level will stop. For the above to happen, what is the range of the ability to restore balance at any tilted angle.  Thank you.

I'm talking about a Weighing Balance shown in the figure:    Press & Hold on onside of the horizontal beam and then release it. It makes some oscillations and comes back to equilibrium like shown in the figure.  Both the pans are of equal equal masses. When the horizontal beam is tilted by an angle using external force, the torque due to these pan weights are equal in magnitude & opposite in direction. Then why does it come back to it position? What's making it to come back?


I've been building a somewhat large rail system and have started adding 3-way and 4-way junctions with redstone buttons to select the next direction and propel the minecart along. But that requires stopping and clicking on a button at each junction.  I began to wonder if there was a way to detect if the player had a specific item in their inventory which would automatically choose the right rail configuration to get them to a destination corresponding to that item. I have a feeling the answer is no but I'd be curious whether this has been tried and if it can be made to work using some other creative solution?  I understand that this can potentially be accomplished using command blocks, however we are not looking to start adding them (yet).  So I'm looking for a creative vanilla Java (currently 1.14.4) solution which allows making a choice somehow at the hub rail station based on what the ultimate destination will be, and having the junctions be able to configure correctly (left/right) to get the player there.  This will obviously tend to make the redstone complex and may not scale well so I'm thinking probably not more than a 5-10 destinations initially.  I could make some of those hub stations where the player could manually move to another hub, make another choice, and continue on if needed.  I'm mainly looking for the validation of a concept that might work, not the actual build steps.

I'm building a CTF map of sorts, using command blocks in vanilla 1.8. I've discovered two commands for detecting if an item is in a players inventory:  /clear @a[team=Red] banner 4 0  /testfor @a[team=Red] {Inventory:[{id:"minecraft:banner"}]}  Those work fine, unless you want to perform a command ON the player carrying that item. For example: I want to cause the player who picks up a banner of the opposite team, to automatically equip that banner in their head slot with a command similar to this:  /replaceitem entity @a[???????] slot.armor.head banner 1 4  Can this be done? If not, is there a way to mark a specific player carrying an item using scoreboards?


I am studying Java generics so I am trying some experiments to test if I am understanding the matter. I got a doubt when I tried to figure out how can work a method that returns a generic value but doesn’t accept any parameter. Even if can sound totally useless, I’m trying to write something like this for better understand generics:  public static <T> T myMethod() {     int tmp;     tmp = (int)(Math.random()*3)+1;     if(tmp==1) {         return new String();     } else if (tmp==2) {         return new Boolean(true);     } else if (tmp==3) {         return new Integer(5);     }     else {         return new Object();     } }   I cannot compile this code because I get incompatible types errors: “String cannot be converted to T”, “Boolean cannot be converter to T” and so on. But if the returned type is a generic type, where is the issue? What is the part I didn’t understand?  Below, two methods: one compiles and the second not. Why, if in both cases compiler cannot know which values the generic parameter can get?  //This compiles public static <U> U test(U u) {    U I = u;    return I; }  // This not compile public static <K> K secondTest() {    K L;    return L; }   P.S.  doesn't reply to my answer because I'm asking for method without input parameter and a generic returned type.

Consider this example (typical in OOP books):    I have an Animal class, where each Animal can have many friends. And subclasses like Dog, Duck, Mouse etc which add specific behavior like bark(), quack() etc.  Here's the Animal class:  public class Animal {     private Map<String,Animal> friends = new HashMap<>();      public void addFriend(String name, Animal animal){         friends.put(name,animal);     }      public Animal callFriend(String name){         return friends.get(name);     } }   And here's some code snippet with lots of typecasting:  Mouse jerry = new Mouse(); jerry.addFriend("spike", new Dog()); jerry.addFriend("quacker", new Duck());  ((Dog) jerry.callFriend("spike")).bark(); ((Duck) jerry.callFriend("quacker")).quack();   Is there any way I can use generics for the return type to get rid of the typecasting, so that I can say      jerry.callFriend("spike").bark(); jerry.callFriend("quacker").quack();   Here's some initial code with return type conveyed to the method as a parameter that's never used.   public<T extends Animal> T callFriend(String name, T unusedTypeObj){     return (T)friends.get(name);         }   Is there a way to figure out the return type at runtime without the extra parameter using instanceof? Or at least by passing a class of the type instead of a dummy instance. I understand generics are for compile time type-checking, but is there a workaround for this?


Code sample one:  float i=1.1f; int j=static_cast<int>(i); cout << j<< endl;   Code sample Two:  float i=1.1f; int j=(int)i; cout << j<< endl;   what's the difference between these code samples about converting in c++?

I've been writing C and C++ code for almost twenty years, but there's one aspect of these languages that I've never really understood. I've obviously used regular casts i.e.  MyClass *m = (MyClass *)ptr;   all over the place, but there seem to be two other types of casts, and I don't know the difference. What's the difference between the following lines of code?  MyClass *m = (MyClass *)ptr; MyClass *m = static_cast<MyClass *>(ptr); MyClass *m = dynamic_cast<MyClass *>(ptr);


It is very well known that the higher the viscosity the higher the resistance offered.  But why do we slip more on oil as compared with water even if oil has higher viscosity than water?

How come mineral oil is a better lubricant than water, even though water has a lower viscosity?    When two surfaces slide over each other with a gap filled with a fluid, the different layers of the fluid are dragged at different speeds. The very top layer touching the top metal surface will have the same speed as the surface itself, while the bottommost layer is stationary. The speed in the layers between is distributed linearly and there exist friction forces between those layers that slow the movement. Those frictional forces should be reduces however, if a fluid with a lower viscosity is chosen.   How come this is not so?   Does it have to do with water's polarity, so that it sticks to surfaces in a different way than oil?


With dialog boxes, I find that you usually have two options:   "Cancel", "disagree", "No, go back" - an option to close the dialog box without performing an action. "Agree", "Yes, I'm sure" - an option that performs the intended action.   I've always thought you should present the action first "yes, I'm sure" followed by an option to cancel "No, go back". However, looking around there seems to be conflicting ways of presenting this.   One of the reasons I feel like the action should be first (left) as it is the first thing the user will read and therefore be the primary action you want them to achieve. Although considering mobile, the primary action wants to be as close to the thumb as possible so you would want to present it on the right [I realise this is favoring right-handed people].

Should OK button be on left of Cancel button or vice versa?   Are there any studies suggesting either of the solutions?


What is the difference between baby carriage and a stroller?  Is it the same thing?  hypothesis: there is a difference in the baby's position, baby carriage is for lying position while stroller is for sitting position  stroller is this:   while baby carriage is this:   Am I right? What is the difference?  Thank you.

It shouldn't be hard to agree that people around the world have babies, and people with babies like to take walks with their babies.  So we invented various wheeled devices to securely hold baby during the walk, allowing parent and baby to get fresh air, experience new sights and sounds, and for parent at least to get exercise.  What we can't seem to agree on is what to call the silly things, even among people who speak English.  In the title, I am wondering about the following possible substitutions:   name: stroller, pram (perambulator), buggy, carriage, cart, etc. optional prefix: baby-, jogging-, etc. location: US, UK, Australia, India, or any country/culture/region where English is the dominant language.     As in the images, some key differences seem to be:   Whether baby is seated, or lying down Whether baby faces the direction of walking, or backward toward parent   For purposes of this question, let's ignore that several newer higher-end models are modular/convertible between these options.  Some less important differences might be:   Number of (sets of) wheels, three or four Size and type of wheels, smaller hard-plastic casters versus larger bicycle-style  (Which I think may just be the difference in adding a "jogging-" prefix or not)   My prior reading has turned up only articles that focus on one specific term, or one specific location.  My hope is someone here can pool all this into one comprehensive discussion.  With that in mind, I would prefer not to get one answer of "American here, and we call them..." and another of "I'm an Aussie, and they are called..." but rather one answer by a well-traveled or well-researched user.  If this isn't possible, then maybe let's start a Community-Wiki answer and have each region edit in its versions of these terms.


If you have multiple supported versions of software documentation online like:  https://docs.python.org/2.7/ https://docs.python.org/2.6/ https://docs.python.org/2.5/   How can you nudge the search engines to prefer a specific version, such as your latest version, when people search for documentation without creating a latest suffix like the following, which could lock you into a documentation page layout to mitigate the risk of breaking links to latest:  https://docs.python.org/latest/

The use case is a document which has multiple versions which are all simultaneously available. For example, documentation on a product for each version of that software:   /v1/install-guide /v2/install-guide /v3/install-guide   These are not the same content in the sense that it would be incorrect to specify in the v1 and v2 pages that the canonical URL is v3. If I searched in Google for 'product install guide v2' I'd expect to be able to find v2. Each version of the document would be slightly different but they'd have a lot in common with each other.  So the question is: can I mark up these pages in some way to signal to Google and friends that the latest version (v3) is preferred, so a simple search for 'product install guide' is more likely to show the v3 page instead of the v1 or v2 page?


Is there a field $K \subseteq \mathbb{R}$ with $[\mathbb{R} : K] < \infty$?  My intuition tells me no: I would imagine that $K(\alpha)$ would be missing some $n$th root of $\alpha$ for all $x \in \mathbb{R} \setminus K$. But I'm not sure how to approach this: it's certainly not true of all finite field extensions (e.g. $\mathbb{R} \subseteq \mathbb{C}$), and there are irrationals $\beta$ s.t. $\beta$ has arbitrarily (but finitely) many roots in $\mathbb{Q}(\beta)$: e.g. $n$th powers of numbers satisfying $x^n - x - 1$.

Is there a proper subfield $K\subset \mathbb R$ such that $[\mathbb R:K]$ is finite? Here $[\mathbb R:K]$ means the dimension of $\mathbb R$ as a $K$-vector space.  What I have tried:   If we can find a finite subgroup $G\subset Gal (\mathbb C/\mathbb Q)$ such that $G$ contains the complex conjugation, it will be done by letting $K$ be the fixed field of $G$. But I don't know whether such a group exists. Maybe we can start with finding a suitable subgroup of $Gal(\bar{\mathbb Q}/\mathbb Q)$ and then lift it to $Gal(\mathbb C/\mathbb Q)$, where $\bar{\mathbb Q}$ denotes the algebraic closure of $\mathbb Q$. By isomorphism extension theorem, we can find many automorphisms of $\mathbb C$, none of them carries $\mathbb R$ to itself except for the identity. This is because $Gal(\mathbb R/\mathbb Q)$ is the trivial group. For example, now suppose $\{x_\alpha\}\subset \mathbb R$ is a transcendence basis over $\mathbb Q$. Let $\sigma$ be a permutation of $\{x_\alpha\}$, then by the isomorphism extension theorem, $\sigma$ extends to an automorphism of $\mathbb C$, which we still denote by $\sigma$. Then $L=\sigma(\mathbb R)$ is a copy of $\mathbb R$ and $\mathbb R$ is algebraic over $K=\mathbb R\cap L$. How large can $K$ be? Is it possible that $[\mathbb R:K]$ is finite?   Does anyone has some ideas?  Thanks!


I am trying to get the following program to run. However, a NullPointerException is showing up. I have debug my code every step of the way thus far. It seems that the null pointer exception comes about after I implement the numA.add() in main.   Main.java  public class Main {      public static void main(String[]args){          NumberSystem numA = new NumberSystem(new Number(20),new Number(10));         numA.add();         System.out.println(numA.getResult().toString());     } }   NumberSystem.java  public class NumberSystem {      private Number n1,n2,result;      public NumberSystem(){         n1 = new Number(0);         n2 = new Number(0);         result = new Number(0);     }      public NumberSystem(Number n1,Number n2){                n1 = new Number();         n2 = new Number();         result = new Number(0);     }         public NumberSystem(NumberSystem n){         n1 = new Number(n.n1);         n2 = new Number(n.n2);         result = new Number(n.result);     }      public Number getN1(){         return n1 = new Number(n1.getNum());     }      public Number getN2(){         return n2 = new Number(n2.getNum());     }      public Number getResult(){         return result = new Number(result.getNum());     }      public void setN1(int n1Value){         if (n1Value != 0) n1 = new Number(n1Value);     }      public void setN2(int n2Value){         if (n2Value != 0) n2 = new Number(n2Value);     }      public void add(){         result = new Number(n1.getNum() + n2.getNum());     }      public String toString(){         return "" + n1.getNum();     }  }   Number.java  public class Number {      private int num;      public Number() {num = 0;}     public Number(int numValue){         if (numValue != 0) num = numValue;     }      public Number(Number anotherNum){         num = anotherNum.getNum();     }      public int getNum(){         return num;     }      public void setNum(int numValue){         if (numValue != 0) num = numValue;     }         public String toString(){         return new String("" + num);     }  }

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


i'm searching the net to solve this problem but i still don't have any clue how it will be done, or IF it CAN be done. I'll be more specific.   I need to create a custom Windows Printer Driver (i think for windows 7 and above) which will execute a simple task. This driver doesn't interface with any device but have to execute a command (launch a .exe located in a specific file system path).  Is it possible to create such "fake" driver and let windows recognise like as installed printer (for example showing the device in the printer list while printing a document).  I'm familiar with c++ and my .exe is written in c# . I will explain and answer to any clarification the community need to help me solving this issue.

I'm looking to create a virtual printer that passes data to my .NET application. I want to then create an installer that installs both the printer and the .NET application.  It would we really nice to be able to write it all in C#, but I have a feeling that this will require a printer driver to be written is unmanaged code.  Does anyone know of a fairly clean tutorial or example of how to do this?


I began read about Java programming these days, and I find something strange in simple code  double sum= 0.012 + 0.012+ 0.012;         System.out.println("the value is" + sum);   the output is. 0.036000000000000004  but if I add 0.12 + 0.12 + 0.12 the result is 0.36 why?

Consider the following code:   0.1 + 0.2 == 0.3  ->  false   0.1 + 0.2         ->  0.30000000000000004   Why do these inaccuracies happen?


I can redirect stdout and stderr to a file like below  some_command.sh >> file.txt 2>&1   Can someone let me know how can I redirect stdout and stderr to a file and also to console?

In bash, calling foo would display any output from that command on the stdout.  Calling foo > output would redirect any output from that command to the file specified (in this case 'output').  Is there a way to redirect output to a file and have it display on stdout?


I need to build a function that takes word representation of a number as an input and transforms it into a digit. one => 1, threethousandsixtyhundreadtwo => 3602 etc. I have the upper limit for the number (999,999) and I have already done reverse function. I have also all the words that will be used. So far, I am stuck on, how to separate each part of the number, when there are no spaces or anything similar between different parts of the number.   Doing this in python. I didn't find any reasonable method to do it with find().

I need to convert one into 1, two into 2 and so on.  Is there a way to do this with a library or a class or anything?


I installed Ubuntu 12.04. I erased a GRUB file by mistake, now grub rescue doesn't let me do anything. I used Boot Repair, and now my PC is stuck at:  error: invalid arch independent ELF magic. grub rescue>   I used Boot Repair, but it looks like my laptop can't detect my USB drive, also I can't access the BIOS.

I am stuck with a rather irritating problem I ran into after installing 11.10 on my macbook pro 5,5.  I did a clean install efi booting into the setup using the desktop cd. Upon the first reboot I was presented with the "invalid arch independent ELF magic" and grubs rescue console.  I have read  but the solution is no solution for me since installing grub via live cd only means installing the mbr version and I can't seem to find any manual on how to install grub-efi while booted into the live cd.  So my question is: How can I either edit the grubx64.efi file in my EFI Partition, reinstall grub-efi with a live CD / DVD or use grub rescue commands to fix this issue?


I'm a newbie trying to learn some basic tikz usage. I'm getting along pretty well with the manual, but it seems I'm overlooking something as this question seems basic to me and still I can't find an answer to it.  Essentially I want to create one node out of two smaller ones. The object I want is a matchstick, which at the moment looks like this:  \usetikzlibrary{shapes} \definecolor{brun}{HTML}{974806} \definecolor{gul}{cmyk}{0,0.11,0.93,0}  \begin{tikzpicture} [scale=1, head/.style={draw, very thin, inner sep = 0, minimum height=0.35cm, minimum width=0.5cm, ellipse, ball color=brun, fill}, stick/.style={rectangle, draw, very thin, brown, anchor=north west, fill=gul!70, inner sep =0, minimum height=0.22cm, minimum width=2.6cm}]  \node [head, rotate=0] (ex) at (0,0) {}; \node [stick, rotate=0] (ex1) at (ex.30){}; \end{tikzpicture}   (I have to read up on how to include graphics in these questions, sorry)  The overall objective is to create matchstick patterns, so I'd like to have the match defined as a single object (node, I suppose) which then can easily be placed relative to each other and rotated. At the moment I have to rotate and scale each part (head and stick) individually, which obviously is less than ideal. Also, positioning is now tricky since the object stems from the head, so in order to place a match I have to figure out where the head should be, which can be quite cumbersome.  Any ideas on how to improve my code or general tips are much appreciated! Also, is there a place to go for tikz exercises? With example images to try and create yourself, and then with different solutions to compare your own to? Or other tips on how to best learn Tikz as I'm currently just playing around with it and the manual.

I want to draw various matchstick pictures like this:    or like this    or other figures from:   I want to use TikZ for this and have two questions about this:   How do I get the path decoration with the matchsticks? What's the (syntactically) easiest way to draw pictures like this or how would a TikZ expert do this (to be flexible enough to draw such kind of figures but to have an easy syntax)?


I have just started to learn about classes and objects in Python and I came to following problem  It doesnt seem to work with variable n in methods I defined in some cases:  for example:  def play(self):     if n < 4:         n += 1         self.mood = moods[n]     else:         self.mood = self.mood   this throws and error that n is not defined on line "if n < 4:" but if I erase this part "n += 1" error does not appear. But even after that it doesnt seem to update variable n if I use it in method:  def new_mood(self):     n = random.randint(0,2)     self.mood = moods[n]       Am I missing some fundamental knowledge here?  import random  moods = ['terrible',           'bad',           'neutral',           'good',           'great']  n = random.randint(0,2)  class animals:      def __init__(self, species, name, mood):         self.species = species         self.name = name         self.mood = mood      def default_mood(self):         self.mood = moods[2]      def new_mood(self):         n = random.randint(0,2)         self.mood = moods[n]          def play(self):         if n < 4:             n += 1             self.mood = moods[n]         else:             self.mood = self.mood   Max = animals('Dog', 'Max', moods[n]) Princess = animals('Cat', 'Princess', moods[n])   print(Max.name + ' mood is ' + Max.mood) print(Princess.name + ' mood is ' + Princess.mood)  Max.new_mood() Max.play()  Princess.play()   print(Max.name + ' mood is ' + Max.mood) print(Princess.name + ' mood is ' + Princess.mood)  print(Max.mood)  print(Max.name + ' mood is ' + Max.mood) print(Princess.name + ' mood is ' + Princess.mood)

How can I create or use a global variable in a function?  If I create a global variable in one function, how can I use that global variable in another function? Do I need to store the global variable in a local variable of the function which needs its access?


I never understand these 2 completely, can someone please put an end to this ?   I have 2 routes :   1- Route::get('/admin/dashboard', 'DashboardController@dashboard');  2- Route::post('/admin/dashboard', 'DashboardController@dashboard_post');    If I do this   {hostname}/admin/dashboard?test=123  My first route should trigger.   If I create a form, with 1 input and submit the form to /admin/dashboard  My second route should trigger.     What is different between these 2 POST ?   Are they behaving the same thing ?   How would one know to use one over the other ?

What's the difference when using GET or POST method? Which one is more secure? What are (dis)advantages of each of them?  ()


I have a crontask which runs at 1am every morning and dumps all databases.  0 1 * * * /var/backups/dumpit.sh 2>&1>> /var/backups/dumpit.log   The dumpit.sh source:  #!/bin/bash /usr/bin/mysqldump -u user -ppass --all-databases | gzip > /var/backups/mysql_`date +%u`.sql.gz   The script runs okay when executed manually but fails when run via the cron. Nothing is added to the dumpit.log file. Do I need to turn on logging in my .myc.nf file? Is there anything else I could try?

This is a  about using cron & crontab.   You have been directed here because the community is fairly sure that the answer to your question can be found below. If your question is not answered below then the answers will help you gather information that will help the community help you. This information should be edited into your original question.  The answer for 'Why is my crontab not working, and how can I troubleshoot it?' can be seen below.  This addresses the cron system with the crontab highlighted.


I'm planing to go on a trip where I plan to do some landscape photography. While I started out with 18-105mm lens, I noticed the quality can be poor around the edges in some cases and I know it's really not the best lens to do landscapes.  While I read  and , I'm still not sure which lenses to use as wide-angle.  So I'm looking for sharper quality as my current lens and wide. I've seen  review of 18-55mm VR which says the quality is good, but I'm not sure is this wide or isn't.  So which lenses should I be looking at for a beginner to mid range for my Nikon D5300 camera?

What is the point at which a lens is considered "ultra-wide angle" vs just wide angle?


We can a make a directory named $"dollars"&<>\dogs if we surround it with single quotes like the following   mkdir '$"dollars"&<>\dogs'   However, what if I want to include a single quote in the directory name?  If I want my directory name to be $"dollars"&<>/dogs'  Then How can I use the single quoting method  do this ?  I tried to do   mkdir '$"dollars"&<>/dogs'' But this didn't work for and also   mkdir ''$"dollars"&<>/dogs'' didn't work either.  I even tried to put a backslash before it, but there was no use !

I'm having trouble with escaping characters in bash. I'd like to escape single and double quotes while running a command under a different user. For the purposes of this question let's say I want to echo the following on the screen:  'single quote phrase' "double quote phrase"   How can I escape all the special chars, if I also need to switch to a different user:  sudo su USER -c "echo \"'single quote phrase' \"double quote phrase\"\""   Of course, this doesn't produce the right result.