Which one would be correct?   I wish it weren't raining today. I wish it wasn't raining today. I wish it were raining today. I wish it was raining today.


I have a simple question.     over centuries / for centuries   what is the difference?  Thank you.


Why do Random forest and XGBoost gives different importance weight on the same set of features?

I am using both random forest and xgboost to examine the feature importance. but i noticed that they give different weights for features as shown in both figures below, for example HFmean-Wav had the most important in RF while it has been given less weight in XGBoost and i can understand why?


How to determine wether a graph (directed or undirected) contains a cycle in O(|V|) time.

In an old practice exam of my University they ask the following: "Give an algorithm that takes as input a graph $G = (V, E)$, stored in an adjacency list, and that returns True is there exists at least one cycle in $G$ and False otherwise. Your algorithm should run in $O(|V|)$ time." I asked my professor and he replied that it should work for both directed and undirected graphs. Now, what I have tried is the following: By running depth-first-search and make it return when the first cycle is found, it indeed can determine wether $G$ has a cycle yes or no. Moreover, in all my examples it did so in $O(|V|)$ time since it never had to do more than |V| operations. The hard part however, is to show that it always will only take $O(|V|)$ time. My question: how can I show that this algorithm will always run in $O(|V|)$ time? Also, if my approach is wrong I would very much appreciate a push in the right direction. I have found the answer to this question and would like to submit an answer, how do I do that? Thanks


How to create an object using bytes read from a binary file in C++?

Let there be a C++ struct S of which an instance is created and written to a binary file. Then said file is read back into the program and an instance should be created from it. How is this second part achieved? Here is the definition of S: struct S {     int value;     string txt; };  Now to create a binary file with the data for one such struct, the following function is used: int writeStructAsBinary() {     ofstream ofs;      S s;     s.txt = "Hello World";     s.value = 10;      ofs.open("output.dat", ios::out | ios::binary);     if (!ofs.good()) { cerr << "Error opening file." << endl; return 1; }     ofs.write((char*)&s, sizeof(S));     ofs.close();     return 0; }  I'm a bit unsure if the (char*)&s is correct but that's what I got. Now how can I read the data from the output.dat file back into the program? In principle it should just be "read sizeof(S) bytes", but how do I create a Struct from the bytes? Here's my attempt? int readAndPrintBinary() {     ifstream ifs;     ifs.open("output.dat", ios::in | ios::binary);     if (!ifs) { cerr << "Could not open file." << endl; return 1; }               ifs.seekg(0, ios::beg);     char* binaryInstance = new char[sizeof(S)];     ifs.read(binaryInstance, sizeof(S));     ifs.close();          delete binaryInstance;     return 0; }  I'd like to now confirm s.txt and s.value. How can I do that? The main program is this: #include <iostream> #include <string> #include <sstream> #include <string> #include <fstream>  using namespace std;  int main() {     writeStructAsBinary();     readAndPrintBinary(); }   Using reinterpret_cast to recreate the object: int readAndPrintBinary() {     ifstream ifs;     ifs.open("output.dat", ios::in | ios::binary);     if (!ifs) { cerr << "Could not open file." << endl; return 1; }          ifs.seekg(0, ios::beg);     char* binaryInstance = new char[sizeof(S)];     ifs.read(binaryInstance, sizeof(S));     S* s = reinterpret_cast<S*>(binaryInstance);     ifs.close();          cout << "s->txt = " << s->txt << endl;     cout << "s->value = " << s->value << endl;      delete[] binaryInstance;     return 0; }


Does grep -r always search through files in the same order?

When doing the grep recursive command to search a string within files:  grep -r "height:" *.txt aaa.txt:height: 15 bbb.txt:height: 12 ccc.txt:height: 17   Can we safely assume that grep will always list files in the same order (i.e. alphanumeric) each time?


I've installed Ubuntu, but the microphone volume level is very low (using Skype, for example).  It looks like the problem is only on the Settings page, because if I open "Pulse Audio Meter", it looks like it's working fine.   Could you check my attached screenshot?


Is the size of a struct and the size of the equivalent class guaranteed to be equal?


If I use a Mauritius passport to go from U.K. to Paris and then Paris to U.K. will I have problems getting back?

I am born in the U.K. if I bring my birth certificate is that good evidence that I’m from the uk. Either by Eurostar or flight


Hi I recently posted a this question earlier and got some excellent answers but to take it a little further I liked k170's answer however it contained a Lambert W Function in the answer and I was wondering if I could get a more simple answer. Wolfram Alpha gave an approximate answer x=0.143668 I don't know how it got this answer but if anyone does it would be greatly appreciated.  Other Post Link:


How to disable the default apache server

I recently installed lampp and apache is unable to start because there is another web server already running. How do I disable whatever default server might be running in Ubuntu 12.04?


Is it possible to remove mouse pointer bounds (i.e. wrap the screen)?

I wonder it is possible to remove mouse pointer bounds. I mean when I move mouse pointer to right side of screen, I want it appear on left side. Also same thing for top/bottom bounds. To be clarify, you may think it like snake game without screen walls.


What is the most efficent way to search a string for special characters and replace them?

Im trying to search all the special characters in a string and escape them. The Input String must be failsafe so I need to escape the characters.  The example String looks for example like this : "Foo Bar "Gone Wild "-
Ted Talk
 " To secure that the String still looks the same it needs to be something like this afterwards "Foo Bar \"Gone Wild \" \- \
Ted Talk \<\/br\>"  I came up with this solution:    final String[] metaCharacters = {"\\", "^", "$", "{", "}", "[", "]", "(", ")", ".", "*", "+", "?", "|", "<", ">", "-", "&", "#"};     String outputString = "";     for (int characterIndex = 0; characterIndex < metaCharacters.length; characterIndex++) {         if (inputString.contains(metaCharacters[characterIndex])) {             outputString = inputString.replace(metaCharacters[characterIndex], "\\" + metaCharacters[characterIndex]);         }     }   But I'm not very happy with that. Its written in Java.


Prove $\lim_{a \to \infty} \frac{\sin a}{a} = 0$.  Attempt:  $|\frac{\sin a}{a} - 0| \leq |\frac{1}{a}|$ so $\frac{1}{a} < \epsilon \implies a > \frac{1}{\epsilon} $ So $\forall \epsilon > 0 \exists N=\frac{1}{\epsilon} : \forall a> N \implies |\frac{\sin a}{a} - 0| \leq |\frac{1}{a}| = \frac{1}{a} < \epsilon $ which means $\lim_{a \to \infty} \frac{\sin a}{a} = 0$  Is my proof correct?


Is it OK that I solder inside my bedroom?

I'm a hobbyist solderer using tin lead solder to occasionally repair broken electronics. As I don't solder all day every day, I use my normal writing desk in my bedroom, which stands next to my bed, for soldering, cleaning it afterwards with soap and water to remove flux residue, etc. As solder pops and splashes, there may be some little solder leftovers lying around in the room.  Is this safe?


Is quotient group $(\mathbb{Z}\times\mathbb{Z})/(\langle (4,6)\rangle)$ cyclic? I'm not sure but I tried to prove that this is equivalent to $\mathbb{Z}$. It does not work and I'm really stuck now.


i am trying to make a globe but my simple deform modifier is not working


Determining name for family relationship that involves a step daughter?

My grandma had 3 kids. Her daughter Sally is my Aunt. She has a step daughter. Her step daughter has a daughter. My Aunt Sally is her Grandmother. What does that make us?


Create an item in sharepoint calender when infopath form is submitted in sharepoint 2010 through workflow

I have a scenario where i have vacation request which is a infopath form when submitted workflow kicksoff and the date item should be updated in calender and if it is deleted the item should be deleted from calender .what approach can i follow to do this.


Is Heisenberg uncertainty principle really a good justification for the impossibility of$\ 0$ K?

Heisenberg’s uncertainty principle is very commonly used to justify why we can’t get to$\ 0$ Kelvin by saying it is impossible to make particles stand still because they will either have an undetermined position or an undetermined momentum.  However, in solid state physics, it is common refering to a system where all the particles are in the lowest possible energy levels (in the ground state) as being at$\ 0$ Kelvin.  If we have a system composed of a set of harmonic oscilators, all of them in the ground state, than the “system at ground state” picture would tell us the system is at$\ 0$ Kelvin. On the other hand, if we considered the “uncertainty implies no$\ 0$ K" picture, the zero point motion of the oscilators would be used to argue that the system is not at$\ 0$ Kelvin.  How would this tension be solved? In this situation, how would we undoubtedly state whether the set of harmonic oscilators in the ground state is at$\ 0$ K or not?


How to push sqlite databse to android app by usb cable?

I'm generating a sqlite database on my desktop system, this database (file with .db extention) should be pushed to my Android app by USB cable. Is it possible? If yes, how?


After doing a "sudo su -" on an Ubuntu 12.04 notebook I did a "crontab -e", added this:   * * * * * env DISPLAY=:0.0 /usr/bin/gnome-calculator   and waited for minutes. Nothing Happened. I don't have any external monitors and if I run this command "env DISPLAY=:0.0 /usr/bin/gnome-calculator" in the terminal, it just works. But not from cron. Why?   The syslog only contains this:   May 24 14:37:01 localhost cron[1227]: (root) RELOAD (crontabs/root) May 24 14:37:01 localhost CRON[16432]: (root) CMD (env DISPLAY=:0.0 /usr/bin/gnome-calculator )   And I already tried an "xhost +localhost".   [root@NOTEBOOK /var/log] xhost access control enabled, only authorized clients can connect INET:localhost.localdomain SI:localuser:USERNAME [root@NOTEBOOK /var/log]    So the solution for another question like this on askubunut didn't worked.


Calculate the product $A^{10}v$ where $A$ is a $2 \times 2$ matrix and $v$ is a vector $[4 \; 4]^T$

Following on from the title, can someone suggest how to proceed with this one.  $$A=\begin{bmatrix}1&1\\4&1\end{bmatrix}$$  and  $$v = [4 \; 4]^T?$$


On mobile site; provide error message for comments that are too long

When attempting to add a comment on the mobile version of stack overflow that is too long to be allowed simply nothing happens. This is in contrast to the main version of the site where the text below indicates "too long by 16 characters".  I have myself tried to add a (slightly too long) comment and had the "add comment" button appear to be broken; I then tried reloading the page and then closing the entire browser and reloading before I eventually realised that my comment was too long.  My feature request is therefore that a pop up dialogue (similar to the mobile comment deletion confirmation dialogue) appears where a comment is invalid due to excessive length.    In case its supposed to do this already and this is a bug not a feature request; I’m using the default browser on Android 4.1.2 (Jelly bean) on a Samsung galaxy s3.


My only account is not in the sudo group

I installed Ubuntu 11.10 with a username fooname. And then I did something like  sudo usermod -G vboxsf fooname   Then, guess what: no one is a sudoer. How can fooname be back as a sudoer?  In addition, what should I have executed to ADD fooname to the group vboxsf?


Do creatures with summoning sickness deal damage while blocking?

I know creatures with summoning sickness can not attack unless they have haste. My brother is using this to his defense as if you use a 3/3 creature with summoning sickness to block an attack from a 2/2 creature then the 2/2 creature would not die because you are only blocking and not attacking back.


Is the vector cross product only defined for 3D?

Wikipedia introduces the vector product for two vectors $\vec a$ and  $\vec b$ as $$ \vec a \times\vec b=(\| \vec a\| \|\vec b\|\sin\Theta)\vec n $$ It then mentions that $\vec n$ is the vector normal to the plane made by $\vec a$ and  $\vec b$, implying that $\vec a$ and  $\vec b$ are 3D vectors. Wikipedia mentions something about a 7D cross product, but I'm not going to pretend I understand that.  My idea, which remains unconfirmed with any source, is that a cross product can be thought of a vector which is orthogonal to all vectors which you are crossing.  If, and that's a big IF, this is right over all dimensions, we know that for a set of $n-1$ $n$-dimensional vectors, there exists a vector which is orthogonal to all of them.  The magnitude would have something to do with the area/volume/hypervolume/etc. made by the vectors we are crossing.  Am I right to guess that this multidimensional aspect of cross vectors exists or is that last part utter rubbish?


Why degree of freedom in statistics is so useful?

Every statistic (a function of data, e.g., $\bar{X}$) has its own degree of freedom (DF). My question is: why often times, you want to estimate some parameter $\theta$ and you come up with some estimator $\hat{\theta}$, which has the form of sum of squares, like $\sum_{i=1}^{n}(x_i-\bar{x})^2$, then you divide it by its correct DF, then you obtained a "good" estimator of $\theta$? I know mathematically, one can prove that how "good" this estimator (after divided by its DF) is. But my question is exactly, why it is so amazing that the DF seems to make the "just right adjustment" to obtain a "good" estimator? For example, the statistic $\sum_{i=1}^{n}(x_i-\bar{x})^2$, then you divide it by $n-1$, you obtain an unbiased estimator for the population variance, but this statistic $\frac{1}{n-1}\sum_{i=1}^{n}(x_i-\bar{x})^2$ also have DF $n-1$, why not you further divide it by $n-1$? I know mathematically it is a silly question, but I just couldn't understand DF in a natural way.  Another example is, when we compute the confidence interval (CI) of sample mean, we use the formula $\bar{X}\pm t_{\alpha/2}(n-1)\frac{s}{\sqrt{n}}$, where $s=\frac{1}{n-1}\sum_{i=1}^{n}(x_i-\bar{x})^2$. Note that in this expression, the DF $n-1$ appears in 2 places, once is in the MSE, $s$, and another is in the $t$ distribution. We see that if DF gets smaller, then MSE will increase so the CI will be wider, then the CI is less precise. In addition, when DF gets smaller, the $t$ distribution becomes heavy tail, which also widens the CI. So it seems that DF is very important in determining the precision of an estimator.   I can only see the points of DF at this level due to my shallow understanding. But I strongly believe there should be a more natural way to view this concept.


How to download all the vidoes in a youtube playlist in linux?

Can I use youtube-dl for that?  I've downloaded youtube videos with the help of youtube-dl but one by one. I mean to say is there any command by which I can download all the vidoes in a particular playlist?


Is a degree in game development really more beneficial than one from computer science?

I need help in deciding what major to choose (I will graduate high school in a year). I have little to no experience in programming, but I'll use my spare time to learn it.  I narrowed down my options to 3 majors, Comp Science, Game dev and cyber security.  I've always enjoyed games and have been curious of how I could make one, but I'm quite worried about the job potential in the  country I'm living in, where the large game companies are not here yet.  If I take majors like cyber security or comp science, will I still be able to work in game development?


How to get actual values of colour theme colours in beamer?

How would I go about finding the actual colour (like the RGB/HSV/etc) of a particular element in a given beamer colour theme (e.g., block title bg in orchid)?  I would like to use these colours in creating graphics with external programs. For example, I made a map in ArcGIS, and since it's quite a simple map, there's no reason not to choose colours which are consistent with the beamer theme I'm using.  From  and , I know that you can directly call the colours within a LaTeX document, but I'm asking about getting colour values for use outside of LaTeX.  EDIT Both answers below are great, thanks so much. I wasn't sure how to pick the accepted answer, so I just chose the one which seemed to accomplish the goal in fewer lines of code.


Ffmpeg : add logo and scrolling text in live ffpmeg feed

We are using ffmpeg in nginx-rtmp server. And wanted to add logo and scrolling text on live streams. Example video -   These scrolls are applied with OBS studio. We want move this process to server side where we can send a plain feed to server and ffmpeg can apply text scrolling and logo on fly. Can we do this with ffmpeg or any other server side tool OBS studio cli mybe, if yes how?


Windows 10 Explorer path max. characters (Other solutions on superuser don't work)

I have a problem. I recently updated to Windows 10. A few days ago I recognized, that if I open a path that has more than 256 chracters it crashes.  I searched a lot in the internet for solutions and I tried a few.  I tried to fix this with gpedit.msc where I can activate the longer win32 paths. Even after a restart, it didn't worked.  I also tried it with regedit. But it didn't work either.  My Windows Version:  Windows 10 Pro (1607) 64bit  Does somebody have any idea?  Thanks in advance.


If for two suitable matrices $B$ and $C$, $AA^TB=AA^TC$ can we conclude that $A^TB=A^TC$?

Let $A$ be a $m\times n$ real matrix. If for two suitable matrices $B$ and $C$, $$AA^TB=AA^TC$$ can we conclude that $A^TB=A^TC$?  I know $AA^T$ is a symmetric matrix. Every real symmetric matrix is diagonalizable. But I am not sure how to use this information. Thanks for reading and helping me out with hints.


How i put multiple values in procedure while in? vb.net

I have code in vb.net with @values like this:  Dim con As New SqlConnection                             Dim cmd As New SqlCommand                              con = FunctionConnection()                             cmd.Connection = con                              cmd.CommandText = "GetVerification"                             cmd.CommandType = CommandType.StoredProcedure                             cmd.Parameters.AddWithValue("@Value", "1,2,3,4")                              Dim Header_DataReader As SqlDataReader = Nothing                              con.Open()                             Header_DataReader = cmd.ExecuteReader   And my procedure like that:  ALTER PROCEDURE GetVerification (@Value varchar(255)) as BEGIN  SELECT        id, ControlPlanID, ParagraphID, ParagraphOrder, Specification, SpecificationParagraph, Dimension, Description, Samples, Frequency, ActivityResource,                           ActivityName, Observation, RequrementNom, RequrementPlus, RequrementMinus, Units FROM            CP_Sequence WHERE        (ParagraphOrder IN (@Value)) End   How put multilple values in my procedure, i want to put in @values 1,2,3,4 for 4 different rows for database  if i put in Sql code like this work but not for my procedure:  SELECT        id, ControlPlanID, ParagraphID, ParagraphOrder, Specification, SpecificationParagraph, Dimension, Description, Samples, Frequency, ActivityResource,                           ActivityName, Observation, RequrementNom, RequrementPlus, RequrementMinus, Units FROM            CP_Sequence WHERE        (ParagraphOrder IN (1, 2, 3, 4))   Thanks a lot


Which is grammatically correct?        "Request you to register me for the course"   "Request you to register myself for the course"


This query is not posting to the database

This is all the code. the error is this.         query failYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''Title','',now(),'macbook-retina-wallpapers-hd.jpg','Content','Tag','4','Status'' at line 1   <?php  if(isset($_POST['create_post'])){       $post_title = $_POST['title'];      $post_author = $_POST['authror'];      $post_category_id= $_POST['post_category_id'];      $post_status = $_POST['post_status'];      $post_image = $_FILES['image']['name'];      $post_image_temp = $_FILES['image']['tmp_name'];      $post_tags= $_POST['post_tags'];      $post_content = $_POST['post_content'];      $post_date = date('d-m-y');      $post_comment_count = 4;       move_uploaded_file($post_image_temp, "../images/$post_image");        $query = "INSERT INTO posts(post_category_id, post_title, post_author, post_date, post_image, post_content, post_tags, post_comment_count, post_status)";       $query .= "VALUES({$post_category_id},'{$post_title}','{$post_author}',now(),'{$post_image}','{$post_content}','{$post_tags}','{$post_comment_count}','{$post_status}') ";        $create_post_query = mysqli_query($connection, $query);       if(!$create_post_query){          die ("query fail" . mysqli_error($connection));        }     }  ?>     <form action = "" method="post" enctype="multipart/form-data">
          Title         <input type="text" class="form-control" name="title">

          Category         <input type="text" class="form-control" name="category">

          Author         <input type="text" class="form-control" name="author">

          Status         <input type="text" class="form-control" name="post_status">

          Image         <input type="file" name="image">

          Tags         <input type="text" class="form-control" name="post_tags">

          Content         <textarea type="text" class="form-control" name="post_content" id="" cols="30" rows="10"></textarea>

         <input class="btn btn-primary" type="submit" name="create_post" value="publish post">
    </form>   So I am running a query when you enter the fields inn the form and submit post to database. For some reason it is not working. If you have any suggestions it would be great.  if(isset($_POST['create_post'])){       $post_title = $_POST['title'];      $post_author = $_POST['authror'];      $post_category_id= $_POST['post_category_id'];      $post_status = $_POST['post_status'];      $post_image = $_FILES['image']['name'];      $post_image_temp = $_FILES['image']['tmp_name'];      $post_tags= $_POST['post_tags'];      $post_content = $_POST['post_content'];      $post_date = date('d-m-y');      $post_comment_count = 4;       move_uploaded_file($post_image_temp, "../images/$post_image");        $query = "INSERT INTO posts(post_category_id, post_title, post_author, post_date, post_image, post_content, post_tags, post_comment_count, post_status)";       $query .= "VALUES({$post_category_id},'{$post_title}','{$post_author}',now(),'{$post_image}','{$post_content}','{$post_tags}','{$post_comment_count}','{$post_status}') ";        $create_post_query = mysqli_query($connection, $query); }


sudo apt-get update stuck at 100% [Waiting for headers]?

Here is the sample   Hit http://security.ubuntu.com raring-security/main Translation-en              Hit http://security.ubuntu.com raring-security/multiverse Translation-en        Hit http://security.ubuntu.com raring-security/restricted Translation-en        Hit http://security.ubuntu.com raring-security/universe Translation-en          Ign http://security.ubuntu.com raring-security/main Translation-en_US           Ign http://security.ubuntu.com raring-security/multiverse Translation-en_US Ign http://security.ubuntu.com raring-security/restricted Translation-en_US Ign http://security.ubuntu.com raring-security/universe Translation-en_US Ign http://pk.archive.ubuntu.com raring Release.gpg Ign http://pk.archive.ubuntu.com raring-updates Release.gpg Ign http://pk.archive.ubuntu.com raring-backports Release.gpg Ign http://pk.archive.ubuntu.com raring Release Ign http://pk.archive.ubuntu.com raring-updates Release Ign http://pk.archive.ubuntu.com raring-backports Release 100% [Waiting for headers]    Or if I stop this and try to install any software it gives the other error (I tried vlc and this time)   Package dependencies cannot be resolved This error could be caused by required additional software packages which are missing or not installable. Furthermore there could be a conflict between software packages which are not allowed to be installed at the same time. Details The following packages have unmet dependencies: vlc-plugin-notify: Depends: vlc-nox (= 2.0.8-0ubuntu0.13.04.1) but 2.0.8-0ubuntu0.13.04.1 is to be installed                    Depends: libc6 (>= 2.8) but 2.17-0ubuntu5 is to be installed                    Depends: libgdk-pixbuf2.0-0 (>= 2.22.0) but 2.28.0-0ubuntu1 is to be installed                    Depends: libglib2.0-0 (>= 2.12.0) but 2.36.0-1ubuntu2 is to be installed                    Depends: libgtk2.0-0 (>= 2.8.0) but 2.24.17-0ubuntu2 is to be installed vlc-plugin-pulse: Depends: vlc-nox (= 2.0.8-0ubuntu0.13.04.1) but 2.0.8-0ubuntu0.13.04.1 is to be installed                   Depends: libc6 (>= 2.8) but 2.17-0ubuntu5 is to be installed                   Depends: libpulse0 (>= 1:1.0) but 1:3.0-0ubuntu6 is to be installed   Please Help !


Adding custom programs to favourites of Ubuntu Dock

I want to add a custom program to the favourites of Ubuntu dock, but there is no option for that.     Translating the text in this image (same as above) only says:   All windows Quit   It also doesn't appear in "Show Applications":   Is there a way for adding the program to both Favourites and Applications menus?


Connecting power supply outputs in parallel

I would like to know if it is safe to connect in parallel the outputs of a power supply like , and in case it is feasable, how to proceed.


Difference between May, Could, Can or Might?

My teacher's sent an assignment and asked the difference among these modals. However, the more I do research,the more the sites say there's no difference. And previously I'd seen that may expresses higher possibly than might, so that's why I'm confused. And I'd also never seen could and can being used for possibly.  Could you help me?


Killing all entities except players and armor stands

Is there a way to kill every entity except players and armor stands? I've tried with  /kill @e[type=!Player,!ArmorStand]   and  /kill @e[type=!Player;!ArmorStand]   But it doesn't work. How can I do that?


Simple explanation to the induction from the slowly changing $\vec B$ of a solenoid in the region of $0$ magnetic field

I would like to get some elementary intuition into the problem a solenoid fed with a time-dependent current, and the resulting current that such the solenoid field would induce in a loop completely outside the solenoid.  The classic situation is to imagine a perfect solenoid of $n_1$ turns per meter, having radius $a$ and fed by a current $I(t)=I_0e^{-t/\tau}$.  One places $N_2$ coils (all having radius $R>a$) around the solenoid as illustrated by this picture from Haliday&Resnick 10th Edition.      Using the usual Ampère's law argument shows the $\vec B$ field of the solenoid would be completely contained inside the solenoid, and homogenous across the cross section of the solenoid.    If there is a slowly varying current in the solenoid, will there be an induced current?  Presumably the answer is yes (at least according the HR solution manual): if we take the $\vec B$ field of the solenoid to be changing with time as a result of the current changing in time, but $\vec B$ still homogenous across its cross-section and $0$ outside, there is a change in the flux of this field through the surface bounded by the coils, and even though there is no magnetic field outside the solenoid where the coils are located.  The resulting change in flux induces an EMF independent of $R$, the radius of the coils, or for that matter the shape of the coil, provided it completely contains the solenoid.   If you are suspicious about the use of Ampère's law for slowly varying currents, the same solenoid field is obtained explicitly by Das Gupta in  "Magnetic field due to a solenoid." American Journal of Physics 52 (1984): 258-258, starting from Biot-Savart, which certainly holds for quasi-static currents.     But how can one intuitively grasp that no field outside the solenoid induces a current in a stack of coils located   completely outside this solenoid, in the region where $\vec B=0$?   A "classic" explanation might that the field might be $0$ but the vector potential is $\ne 0$, yet it seems this is invoking a lot of heavy machinery for a 1st year physics problem.  Moreover, Aharonov-Bohm-like explanations are really quantum in their nature and show that in quantum mechanics the potentials are the essential quantities.  Nota: a possible path of solution would be to invoke hidden momentum, along the argument .  Is there a simpler explanation?


VNC Viewer Password is saved but occuring error too many security failure

I always use VNC Viewer for 3 years and it never disappoint me until now. I always remote my Work PC at office from home with VNC Viewer for 3 years, its password is always saved at my laptop so I just double click from the software and its always connect without problem. but lately its always get error Too many security failure and its been a week already. I even stop using VNC Viewer for three days to check if it will resolve by itself, but no. it still there. and the one using the connection is only my laptop and handphone only and no one else except me know the address or password for my connection, and both getting the same result. why is this happen, anyone have come to this problem ? any solution for this?


Option for choosing the Stack Exchange sites to show on "realtime questions"

I'm thinking that adding options to choose from what sites the  would fetch would be useful (with the available choosing of meta sub-sites).


v2.81.16 cycles; render shows nothing, finishes in .01 ms

Thanks in advance - I have a physics scene using cycles that I've been working with and I can't render it anymore but I can watch it in the timeline.  I was able to render it and create a nice animation but since then I've made a few camera angle changes, (zoom in as the cube is destructing), but when I try to render any frame I just get a checkered background. Below are two frames from the Timeline and the render output.  I've verified that my camera is the only camera and as you can see in my screenshots that camera is looking at my scene and it is the active camera object.  I have not modified the Clip Start/End.  I've tried both Cycles CPU and GPU (as well as Eevee - same result).  I've deleted my physics bake and rebaked.  I might delete and recreate the camera, but I would like to identify any mistake I might have before blaming Blender.  What am I missing?  Screenshots of frame 76 and 246 with Camera/Scene settings and shot of blank render


Problems with header and footer in documentclass book

I tried to use a header and footer layout I found here on this website. But I have some problems with changing the code to what I want. I want the pagenumbering to be like page x of y in the footer. It would be nice with this layout (just with page x of y instead of just page x):  \cfoot{\parbox{\textwidth}{\hrulefill\kern-0.6ex\raisebox{-0.5ex}{$\Bigl[$\makebox[2em][c]{\thepage}$\Bigr]$}\kern-0.5ex\hrulefill}}   But the pagenumbering is in the header and there aren't a space between the letters and the numbers as you can see in my minimal work example:  \documentclass[12pt,a4paper]{book}%generelt \usepackage{fancyhdr} \pagestyle{fancy} \fancyhf{} % clear all headers and footers \renewcommand{\headrulewidth}{0pt} % remove rule between header and text \fancyhead[LE, RO]{\thepage of \pageref{LastPage}} % put page number in left header on even pages,                             % right header on odd pages \fancyhead[RE]{\nouppercase{\leftmark}} % remove uppercase on chapter title \renewcommand{\chaptermark}[1]{\markboth{#1}{}} % remove "Chapter N." prefi \usepackage{lastpage}   Another problem is that I would like to have a chapter numbering in the header. The design is really nice, but I would like to have the chapter number too, just like "CHAnumber| name of the chapter".  Is it possible to make this two changes? And how? Thank you very much for help!


How is Necromancy accomplished in the Harry Potter universe?  I thought that people cannot be raised from the dead in Harry Potter.  Were bodies just use as puppets that can only do simple tasks, for instance when Dumbledore and Harry were getting the locket, the  were there to guard the locket.  Also, besides Inferi were there any Zombies in Harry Potter?


If $x>y>0$ why is $\sqrt{x} > \sqrt {y}$?   I know this to be true, but I don't understand why because can't the square root of $x$ be negative and the square root of $y$ be positive thus disproving it?


Why does increasing voltage result in a decrease in current and not rather a decrease in power?

I recently read that in order to conduct electricity over vast distances via power lines they had to step up voltage which results in a decrease in current through the medium. This is reflected in the formula $P=IV$. What I can’t seem to grasp is why this results in current ($I$) dropping and not rather power ($P$) increasing? I’m assuming they have to somehow keep the power constant, preventing it from increasing in some way, but how is this achieved? Please excuse the silly question as I am still very new to the subject, but I just assumed from the formula above that increase in $V$ would naturally result in an increase in $P$? Is there something I am missing? :|


Lagrange multipliers ( inequality between arithmetic and geometric mean)

Let $a_1$, … ,$a_k$ be positive numbers. Use Lagrange multipliers to prove that: $(a_1 \cdot \dots \cdot a_k)^{\frac 1k} \leq \frac{(a_1+ \dots +a_k)}{k}$. I don't have any idea how to start here I only know how to do this proof with induction but not with lagrange multipliers


I have some questions about how parameters of a function and function call works

I've been working with functions in C++ and I dont realy know what really is going on behind them( how the wheels spin :) ). What exactly i wanna know is:  how the parameters of a function get the values? ex:  #include<iostream>  int function(int x) {     x += 10;     return x; }   int main() {     int y;     std::cin >> y;     std::cout<< function(y); }  In reality the function parameter x will get the value y like this:  x=y  ?  Based on the first question, will pass by referenece be done like this &x=y? y will be converted from int to int& ???  #include<iostream>  void function(int& x) {     x += 10;  }   int main() {     int y;     std::cin >> y;     function(y);     cout<<y; }   When we call a function how much memory will be allocated for it?how much will it consume? based on what?  I need to know everything that happens when a function is called , and how the function really work Sorry for my bad english , I'm Romanian. Thank you!


What are the risks if you install an app that's not from the App Store?

On my iPhone (iOS 8.2), I installed an app that wasn't coming from the App Store. I chose to trust it because a serious news website had spoke about it, but now I'm a little bit worried of what this app might have done.  Are the apps like this one still prevented from accessing my personal content? Could they install anything without my authorization? Now that I've deleted it, is it okay or is there still a risk anyway?


\begin{tikzpicture}[scale=0.5]         \draw [<->,thin] (-5,0) - - (5,0) node [right] {$x$};         \draw [<->,thin] (0,-3) - - (0,3) node [above] {$y$};         \draw[color=blue]   plot (\x,{sin(\x r)})   node[right] {$f(x) = \sin x$};        \draw[color=red]   **plot (\x,{sin(\x r)})**   node[right] {$f(x) = \sin (x+2)$};               \end{tikzpicture}    how can I draw the sin2x!!!!I already draw the sinx!! please help!!!


I come from Norway, and here the formatting of maths are a little bit different than in the U.S. and the UK. If you want to factorize 25, you know that it is 5 times 5. How would you write this with LaTeX? In Norway we would write 5⋅5, and as far as I've seen, with LaTeX, you would write: $5\times 5$ ( 5 x 5 )  Is there a difference, or is one of them wrong? Which one actually means times?


Partition of a conjugacy class to conjugacy classes of a normal subgroup

Let $G$ be a group, $H$ be a normal subgroup of $G$, and $O$ a conjugacy class of $G$ contained in $H$.   Consider $O = \cup_{i = 1}^{n}O_i$ the partition of O into conjugacy classes of $H$. Show that the size of each $O_i$ is the same Prove that the number $n$ of conjugacy classes which $O$ breaks up to in $H$ divides $[G : H]$   I considered the action of $H$ on $O$ by conjugation and the stabilizer of elements of $O$, but it wasn't clear to me what to do next.    I have a partial solution to the first problem inspired by .  Consider 1 conjugacy class/orbit in $H$: wlog $O_1$ with representative $h_1$. Consider another conjugacy class/orbit $O_2$ with representative $h_2$, and note that $h_2 = g^{-1}hg$ for some $g$ in $G$.  $$O_2 = \{ hg^{-1}h_1gh^{-1} | h \in H \}$$  Now replace $h$ with $g^{-1}hg$ as $H$ is normal in $G$ and we are ranging over all of $H$.  $$O_2 = \{ (g^{-1}hg)g^{-1}h_1g(g^{-1}h^{-1}g) | h \in H \}$$ $$= \{ g^{-1}hh_1h^{-1}g | h \in H \}$$ $$=g^{-1}O_1g$$  So conjugation by $g$ sends $O_1$ to $O_2$. It's not clear to me that $=g^{-1}O_1g$ doesn't get smaller than $O_1$ though (although I think I can work it out with time).


Transferring from CDG airport to hotel in Paris, France preferably by train

How can I get from CDG airport to Hotel du Cadran, 10 Rue du Champ de Mars, 75007 Paris, France, with minimum number of transfers?  I do have luggage to carry.  I prefer to travel by train, if possible.


How to reset phpMyAdmin password? 12.04 LTS

I am using LAMP in Ubuntu 12.04. How to reset the phpMyAdmin password?  hypertext@hypertext-desktop:~$ sudo mysqld --skip-grant-tables & [2] 7196 hypertext@hypertext-desktop:~$ sudo: /var/lib/sudo writable by non-owner (040777), should be mode 0700                                                         UPDATE user SET Password=admin WHERE User='root'; bash: syntax error near unexpected token `('  [2]+  Stopped                 sudo mysqld --skip-grant-tables hypertext@hypertext-desktop:~$ sudo mysqld --skip-grant-tables & [3] 7252 hypertext@hypertext-desktop:~$ sudo: /var/lib/sudo writable by non-owner (040777), should be mode 0700 mysql -u root mysql ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)  [3]+  Stopped                 sudo mysqld --skip-grant-tables hypertext@hypertext-desktop:~$ sudo mysqld --skip-grant-tables & [4] 7259 hypertext@hypertext-desktop:~$ sudo: /var/lib/sudo writable by non-owner (040777), should be mode 0700 UPDATE user SET Password='admin' WHERE User='root';FLUSH PRIVILEGES; exit; UPDATE: command not found  [4]+  Stopped                 sudo mysqld --skip-grant-tables  [4]+  Stopped                 sudo mysqld --skip-grant-tables FLUSH: command not found exit There are stopped jobs. hypertext@hypertext-desktop:~$ sudo pkill mysqld sudo: /var/lib/sudo writable by non-owner (040777), should be mode 0700 [sudo] password for hypertext:  hypertext@hypertext-desktop:~$ sudo service mysql start sudo: /var/lib/sudo writable by non-owner (040777), should be mode 0700 [sudo] password for hypertext:  mysql: unrecognized service hypertext@hypertext-desktop:~$ ^C hypertext@hypertext-desktop:~$


The modified Bessel differential equation is  as  $$r^2 \frac{\partial^2 f(r)}{\partial r^2} + r\frac{\partial f(r)}{\partial r} - (r^2 + n^2)f(r) = 0$$  with solutions  $$f(r) = AI_n(r) + BK_n(r)$$  But if I had  $$r^2 \frac{\partial^2 f(r)}{\partial r^2} + r\frac{\partial f(r)}{\partial r} - (\alpha^2 r^2 + n^2)f(r) = 0$$  What form should have the solutions and how to prove it? It seems not to be a simple substitution $r' = \alpha r$, because $\alpha$ appears just one time in the second equation and not in all the $r$ terms (as I would expect instead).


Where to ask for advice about how to store data for an application

I am looking to build a video chatroom app where users can create / join private chat rooms, and I would appreciate some advice on how to go about storing the chat data. Whenever a new user joins the room, they should receive a history of all the previous chat messages, as well as the list of current users in the room.  On average, I expect chat rooms to be destroyed (ie. everyone has left the room) within a few hours of their creation. Thus, most of the data that needs to be stored is very temporary. On the other hand, messages in the chat will probably be somewhat frequent, and the data will be updated often.  Where should I go to ask for recommendations on how to store this data? It doesn't sound like this fits on Stack Overflow. Software Engineering or Databases seem like better options, though I don't necessarily want to restrict my options to databases only (maybe there are solutions that don't require a database, for example storing the data on the client side).


How can I wrap a method so that I can kill its execution if it exceeds a specified timeout?

I have a method that I would like to call.  However, I'm looking for a clean, simple way to kill it or force it to return if it is taking too long to execute.  I'm using Java.  to illustrate:  logger.info("sequentially executing all batches..."); for (TestExecutor executor : builder.getExecutors()) { logger.info("executing batch..."); executor.execute(); }   I figure the TestExecutor class should implement Callable and continue in that direction.  But all i want to be able to do is stop executor.execute() if it's taking too long.  Suggestions...?  EDIT  Many of the suggestions received assume that the method being executed that takes a long time contains some kind of loop and that a variable could periodically be checked. However, this is not the case.  So something that won't necessarily be clean and that will just stop the execution whereever it is is acceptable.


How do I get the mouse coordinates relative to my whole scene with Monogame?

I am making a topdown isometric real time game using Monogame.   I know how to get the mouse position for my camera view. How do I get the mouse coordinates relative to the entire scene?    My game's rendering looks isometric, but it's actually simply 2D and the illusion of isometric projection is done with a simple script that converts the cartesian coordinates for the mouse position to isometric ones, which I pass into a simple grid pathfinding algorithm that makes paths from them. This worked well for me when I used Game Maker.


Why does toString() not print this array of ints?

In working on an Euler problem as a new Java programmer, I have encountered something peculiar related to printing an array.  I do not understand why this is happening - the individual values appear to be correct, when printed individually, but the toString() is clearly creating a string which is not what I expect.  I would have expected either a compile error, or the array to be put into a concatenated list. Neither of these happened.  Note: I am not interested in "how to print an array?" but rather understanding why the toString() does NOT print the array. There are plenty of resources online available to find how to do so.  public class example {      public static void main(String[] args) {          /* Setup a string/int array converion*/         int i=0;         String nums = "123456";         char[] splitNums = nums.toCharArray();         int[] ints = new int[nums.length()];          for (char c : splitNums) {             ints[i++] = Character.digit(c,10);         }          //Print using the string/char[]         System.out.println(nums);         System.out.println(splitNums);          //Values are clearly there         for (int j : ints){             System.out.println(j);         }          //What is toString() doing?          System.out.println(ints.toString());      }  }   Output:  123456 123456 1 2 3 4 5 6 [I@4b71bbc9


I have problem in getting the min of column name TRANS the required output should be TOWN_HALL and 2

SELECT      BRANCH_ADD,     COUNT(TRANS_AMOUNT) AS TRANS  FROM      (SELECT           A.BRANCH_ADD, C.TRANS_AMOUNT      FROM           BRANCHES A, ACCTS B, TRANSACTION C      WHERE           a.branch_code = b.branch_code          AND b.acct_no = c.acct_no      ORDER BY           BRANCH_ADD) GROUP BY      BRANCH_ADD;   Output of the above query :    as text :  BRANCH_ADD    TRANS ------------  ------ TOWN_HALL     2 CHAMRAJPET    4 CITY_MARKET   4


Is there a less colloquial word (noun or adjective) to describe an "attention whore"?

It could be a noun or an adjective, and either could describe a person or an action. For example:  "Did you hear Eric's wedding toast? He wouldn't shut up!"  "I know, he was being a complete _______"


Hibernate, Generics, Type safety: Unchecked cast from List to List

private static Session session; ... public <T> List<T> getObject(String query) {     List<T> list = (List<T>)session.createQuery(query).list();     return list; }   I don't want to use "@SuppressWarnings("unchecked")" How to modify that method, to receive universal method which can receive any List<> ?


Prove or disprove: if $\int_1^\infty f(x)\,dx$ converges, then $\lim\limits_{x\to\infty}f(x) =0$.

I received the following question:        If $\int_1^\infty f(x)\,dx$ converges, then $\lim\limits_{x\to\infty}f(x) =0$.        I know that it is false, but i can't come up with a counter example, Thanks in advance


Why doesn't the Stack Overflow team fix the Firesheep style cookie theft?

sniffs the network looking for session id's and makes it very easy for an attacker to hijack this authenticated session. It should be noted that Firesheep is nothing new ; it just makes this attack very easy. Many websites like Facebook (EDIT: Actually Facebook has patched this vulnerability) and Stack Overflow violate . A user can protect themselves by using a plugin like , but stackoverflow.com doesn't even have a valid certificate. Thus it is trivial to   and users have no way of protecting themselves.  Does the Stack Overflow team not understand the threat of OWASP A9? Do they not care enough to spend the $20 on a certificate to give users the option to protect themselves? Google has not experienced a significant increase in resource consumption by switching to HTTPS. At least give people the option to secure themselves.      Gmail switched to using HTTPS for everything by default. Previously it had been introduced as an option, but now all of our users use HTTPS to secure their email between their browsers and Google, all the time. In order to do this we had to deploy no additional machines and no special hardware. On our production frontend machines, SSL/TLS accounts for less than 1% of the CPU load, less than 10 KB of memory per connection and less than 2% of network overhead.    Source:


Stuck trying to remove a space between something in my print()

Sorry in advance for what I'm sure will be a very simple question to answer, I'm very new to python. I have a project that I'm working on that takes inputs about the size of a room and cost of materials/installation and outputs costs and amount of materials needed. I've got everything working but I can't make my dollar sign in my ouputs appear next to the outputs themselves, they always appear a space away. ($ 400.00). I know that I can add a plus sign somewhere to smush the two together but I keep getting errors when I try. I'm not exactly sure what I'm doing wrong but I would appreciate any input. I'll paste the code that works without error below. I put spaces inbetween the lines so it can be seen more clearly. wth_room = (int(input('Enter the width of room in feet:')))  lth_room = (int(input('Enter the length of room in feet:')))  mat_cost = (float(input('Enter material cost of tile per square foot:')))  labor = (float(input('Enter labor installation cost of tile per square foot:')))  tot_tile = (float(wth_room * lth_room))  tot_mat = (float(tot_tile * mat_cost))  tot_lab = (float(labor * tot_tile))  project = (float(mat_cost + labor) * tot_tile)  print('Square feet of tile needed:', tot_tile, 'sqaure feet')  print('Material cost of the project: $', tot_mat)  print('Labor cost of the project: $', tot_lab)  print('Total cost of the project: $', project)


Show that the square of any prime number is the Factof of some integer

This is a very interesting word problem that I came across in an old textbook of mine. So I know its got something to do with prime numbers, but other than that, the textbook gave no hints really and I'm really not sure about how to approach it. So anyway, here the problem goes:  The $\text{Factof}$ (Integer on number of factors) of an integer is the integer divided by the number of factors it has. For example, $18$ has $6$ factors so $\text{Factof}(18) = \frac{18}{6} = 3$, and $27$ has $4$ factors so $\text{Factof}(27) = \frac{27}{4} = 6.75$. Show that the square of any prime number is the $\text{Factof}$ of some integer.  Edit: I have reworded the question so that it is more specific and can be answered coherently in the context of the rules.


My daughter didn't have a phone that allowed the Pokemon go App so we downloaded it on to my S6. She now has a phone that allows the app. Could you please tell me how I transfer her game from my S6 to her Samsung Galaxy Grand Prime? She doesn't want to be forced to start over. I am technology challenged so I the information as simple as possible. Also is it possible to change the email to hers?


HTML CODE:  <!DOCTYPE html>   <meta charset="UTF-8" /> <title>Practice</title>  <link rel="stylesheet" href="my.css" />
Practice Page

click on ^ to show am alert().

Put your mouse here to make every paragraph red &lt;p&gt; get the class highlighted
   I have imported a jquery file already with another  which isn't included here, and my current javascript code is as follows:  head = function() {   alert("I'm a heading"); }  redtext=function(){     $('hoverable').attr("#hoverable","#highlighted");  } setup = function() {   jQuery('h1').click(head);   jQuery('p').mouseover(red);      } jQuery(document).ready(setup)   With my css code being:  .highlighted {   color: red; }   I'm trying to make it so when ever i highlight over the hoverable id, all the paragraphs turn red, so the new id would be highlighted for all the paragraphs,  I tried changing the id, but i can't seem to get it to work


Is there a way I can make this code that counts the number of duplicate values in an array work for strings?

using System; using System.Collections.Generic;  class MainClass {   public static void Main(string[] args) {                   int[] array = { 10, 5, 10, 2, 2, 3, 4, 5, 5, 6, 7, 8, 9, 11, 12, 12 };     var dict = new Dictionary<int, int>();      foreach(var value in array)     {         if (dict.ContainsKey(value))             dict[value]++;         else             dict[value] = 1;     }      foreach(var pair in dict)         Console.WriteLine("Value {0} occurred {1} times.", pair.Key, pair.Value);     Console.ReadKey(); }   }   Is there a way I can make this code that counts the number of duplicate values in an array work for strings, I need it to output something like:  Donald - 2 James - 1  The numbers being the amount of times it has been repeated in the string


How do I get HTML5 h.264 Video working on Firefox?

According the the , h.264 video should now be working in Linux.  It does also say the appropriate gstreamer plug-ins need to be installed.  Does anyone know what these are?    I used this  and the  to verify that h.264 support works in Google Chrome on my Ubuntu 12.04 64-bit, but does not work on Firefox 26.


Explanation of the classic jerk and pull string system

It is known that when we jerk the bottom string quickly, it will break; and if we pull slowly the top string will break, while the force applied is the same.   My confusion is: according to Newton's first law, an object will remain at rest or at a constant velocity when the net force acting on it is zero. However, in the mass-string system, the mass remained at rest despite the fact that the downward force exerted on the mass, in turn, on the top string exceeds the maximum tension that the string can withstand (as it caused the second string to break). So does this imply that not all the force applied on the bottom string are exerted on the mass (as the tension in the top string is lower than the bottom one)? If so, where did the force go? And why is that when the force is exerted over a longer period of time this disparity between the force applied and the force experienced by the top string seems to vanish?   Essentially, why is the tension in the top string smaller than the bottom one when jerked quickly?  I did some research online and came across answers similar to this one:  "By pulling the string slowly, we are putting a strain in the string below and above the weight. Due to the mass of the weight, the strain above the weight is much larger than below. The string snaps wherever the strain is the highest. When a sharp jerk is exerted on the string, the inertia of the weight keeps the strain below the weight. Although there is some strain above the weight, compared to the strain below the weight the strain in the latter is still higher, and the string snaps below the weight."   I understand that it has something to do with inertia, but how exactly does inertia "keeps the strain below the weight"? Please explain with details.  This is my first post, thanks for any help I can get!


I'm trying to figure out how to customise some of my folders' sidebar icons that are using custom ICNS icons via "Get Info". They're basic "Documents", "Downloads", etc. folders that I've replaced with my own on a secondary drive.  Currently running El Capitan 10.11.6.  An option that doesn't require an external app would be ideal. Can Dropbox's method be replicated? Thanks!


Notify users of a question they closed being edited or nominated for reopening

This is brought up by a chat discussion on .  The idea being, when you Vote to Close a question (and it subsequently get's closed), you get a notification when the first Vote to Reopen is cast.  This comes up because many users (on all sites) tend to downvote a question when they VTC it, and sometimes those downvotes stick (especially on high-traffic sites like SO). It would be nice if those who VTC'd (and possibly those who downvoted) get a notification informing them that the question is now in the Reopen Queue (or, perhaps just as well, on the first edit made to it by the OP).  Obviously it would be annoying if you got a notification on each edit, or each VTR, but it could fairly simple (I assume) be done so that you only get a notification on the first of either that happens.  This could have the effect of making the user feel more welcome again, as the user immediately gets more exposure when the question is opened again, and they start getting either the DV's reduced, or those DV's turned into UV's.


ICS invites are added to calendar, but no acceptance sent

I am working with iCloud, iPhone and Macbook Pro on Yosemite.   I receive ICS calendar invites via mail from a user using Outlook. When I click on the ICS file in the mail, it opens and I can add it to my calendar without a problem. It also syncs nicely on all my devices.  However, the sender of the invite does not get a confirmation, in the meeting properties I'm shown as "did not reply". When I open the invite in my calendar, I have no option to accept or send a notification.   In short: ICS invites are added to my calendar but the organizer does not receive a notification.   How can I send an accept notification?


Limited options for migrating questions to other sites

Often when it seems that a question is more appropriate to be asked on another site, the flagged options presented are insufficient for the proper site. For example, I found a  on the Data Science site that I thought would be more appropriate on the Computational Science site. However, when I tried to flag it to move it, the only site I could suggest was the Data Science Meta site.   Why are there limited options for migrating questions? I've noticed it on Stack Overflow as well. Is it a reputation privilege? Is it just certain sites? It seems this question has been discussed  but the problem still exists or at least the migration instructions are still unclear.


Distribution of $-\log X$ if $X$ is uniform.

For $X$ and $Y$ random variables; $X$ follows the uniform distribution.  (1): if $Y=-\log X$  (2): then it can be shown that $-\log X$ is distributed as $\exp(1)$ {i.e. exponential with mean 1}.  Why is this so? Intuitively statement (2) make sense to me. But i'd like a mathematical proof.  -Probably wrong working:  (1) seems to imply $\exp(-Y) = X$ (which is like saying $X$ is exponentially distributed, which is a contradiction, since its actually uniform!); or is it incorrect for me to do this since $X$ and $Y$ are random variables?  Ultimately how do I prove (2)?  Thanks


Slice syntax for python 2.7, reverse a part of a list

How do I use the slice syntax of python to get a list from 0 to i in reversed order?   For example, if the list is [1, 2, 3, 4] and i == 2, the result should be [3 ,2 ,1].


Can someone explain geometric multiplicity?

I'm reading my textbook and I'm really confused about geometric multiplicity. I've read the definition and they have given an example but I'm still lost. I've tried looking it up on other websites. This helped me make sense of algebraic multiplicity but I don't understand geometric multiplicity at all. I was wondering if someone could explain this as simply as possible.


How can I learn the basics of Home Improvement projects?

I am a new homeowner and know literally almost nothing about home improvement. I would like to learn basic concepts by doing things one at a time...but I can't just jump in and do most things. Are there any good resources (websites/books) that provide project ideas or tutorials that are organized from extremely basic to very advanced? I could use this to start with things extremely basic and learn skills and get ideas as I go.


When do we use rms value or mean value in calculations? What are their physical significance, if any?


Difference in the results of String comparison in Java?

How does Java implement the below string comparisons  public class MyClass {     public static void main(String args[]) {         String a = "Chaipau";         String b = "pau";          System.out.println(a == "Chai"+"pau"); //true         System.out.println(a == "Chai"+b); //false     } }   This is different from  , as the answer does not contain the why a new object is created in the second case , when it could have pointed to the same object reference as it is done in the first case.


Appropriate time to wait before asking about rep not being fully restored after a suspension

Main Question  If a user has been suspended from Stack Exchange as a whole and their rep has only been partially restored, and seemingly (from their end at least...) only on certain sites and not others, is this a normal thing and if not, what would be the appropriate waiting time before asking a question about it?  Supplementary   Is the decision regarding restored reputation made by individual Stack Exchange communities, or perhaps by the Stack Exchange community as a whole?  Are there particular levels of access enjoyed only by certain users or user-groups, or particular lines of appeal and escalation, particularly as in some circles Stack Exchange reputation may affect job prospects.


How to fix sudo after "chmod -R 777 /usr/bin"?

I entered chmod -R 777 /usr/bin and now sudo is not working.  It says sudo must be setuid root.  Some advice online said to run chown root:root /usr/bin/sudo chmod 4755 /usr/bin/sudo.  On entering chown root:root /usr/bin/sudo it shows an opened in readonly mode error.


I'm planning to buy a new SSD for my laptop and playing ahead. Is there a way to move my current installation of Ubuntu (on regular HD) to the SSD without reinstalling from scratch?


List of all active modules used in a site

Is there a way of having a list of all the used (active) modules on a site ?  I am in the process of documenting a site and would like to list all the active modules, I know I can take them from admin/modules but there must be another way.


What is the physical meaning of a Supercharge?

What is actually being conserved? I've calculated it for the Wess-Zumino model but I still have no idea what is actually being conserved due to Noether's Theorem.  There is already a similar question,  But the answers don't actually say if there is anything physically conserved.   I have heard that the number of fermions is kept equal to the number of bosons, but is this not a fact that susy requires? I feel like it doesn't actually come from the charge itself.  In Qmechanic's answer it is said that "the experimental consequences of a conserved supercharge are extracted by other indirect means." What are these means?


What U-lock has a reasonable weight to safety ratio?

For my new city bike I'm thinking of getting a U-lock. Price of the bike is around $900, so I probably don't way to spend more than 10% of its price on the lock.  So far, Kryptonite locks look pretty good, altough that may be due to hype. Their "yellow series" locks seem pretty safe, but I doubt I would lug around a 2 kilo beast for long. The mini series lock looks nice too (and cheaper!) with its 1 kilo of weight. But is it secure enough? Are there are (perhaps less hyped, but good) brands that I should consider?  Note that I won't be parking my bike on the street for too long. I just want to be able to pop into a store without being on a paranoid lookout for my bike every second of my grocery shopping. Is going for the more expensive lock overkill in such scenario?


Our company's new logo looks similar to another logo. Will this be a problem in the future?

We are into Fintech space. We are doing a rebrand and the logo we have finalised unfortunately looks similar to the one on left in the below image. Now we are in a dilemma that if we should go ahead with this or not. Can anyone tell us if we can trademark this? Is it going to be a problem? Can the other company file a lawsuit against us? Also, did you see any other logo similar to us?     After your feedback, we have updated it like this. What do you think?


Example of two Random variables which are independent but from different distributions

I was reading about meaning of iid(independent but with identical distribution). Can there exist some 2 random variables which are independent but from different distributions? Any example?


How to implement "select all" check box in HTML?

I have an HTML page with multiple checkboxes.  I need one more checkbox by the name "select all". When I select this checkbox all checkboxes in the HTML page must be selected. How can I do this?


I need to convert TeX format files to Word format, I knew that lot of questions are already raised for this and lot of answers also there in web, but please provide your valuable suggestions for my task:  Based on the replies and many browse, I've decided to look into the following three converters:   GrindEq Chikri TeX4ht   But please suggest which is the best among these, note that for my conversion equations, cross links (both numbered and name&year style in references), Table alignments are the must.   Please give your valuable suggestion on my request...


can my 15-year-old brother leave the UK to go back to his home country without being accompanied by the stated accompanied person in his UK visa?

My younger brother, who is 15, is going to visit me in the UK with my dad as the adult accompanying him. But my dad is only going for two weeks and my brother will go back 2 weeks after him. They are coming from Indonesia.  My question is, will they let him board the plane to go back to Indonesia? Since there will be no immigration exiting the UK, I presume that there won't be any problem?   I will be sending him off to the airport until he gets on the plane.


Can't find the option to clip or union with only selected features in QGIS (2.18.11)

I just downloaded the new version of QGIS (2.18.11) and I can't find the option to clip or union with only selected features    Typically, there was a selection where you could choose only the selected layers.


Strange ArgumentOutOfRangeException in for-loop

I just encountered a strange problem in a simple for loop. I get an ArgumentOutOfRangeException when I try to access input_list[i]. input_list is a list of some objects and has two members. But i equals 2 when the exception is thrown.  var count = input_list.Count; var taskList = new Thread[count]; for (int i = 0; i < count; i++) {     taskList[i] = new Thread(() => SomeFunction(input_list[i]);     taskList[i].Start(); }   In the second version, I only introduced a local variable k that is used as an index for the input_list:  var count = input_list.Count; var taskList = new Thread[count]; for (int i = 0; i < count; i++) {     int k = i;     taskList[i] = new Thread(() => SomeFunction(input_list[k]);     taskList[i].Start(); }   This second version doesn't throw an exception.  So, how can i be 2 in this example? And why doesn't k become 2 in the same way?  I'm using version 4.6 of the .NET Framework and Visual Studio 2015.


Is it possible to set up an auto-reply to an incoming text or iMessage, either on my iPhone (or the connected Message app on my Mac)?  Ideally I'd like to customize this depending upon the sender.


How to make the editing time for my own comments longer?

that's awful. The time left to edit my own comments is absolutely not enough. Why should it be, that 8 minutes after I have written something, I cannot edit my own text? It happened already several times that something turns me away (the colleague asking an urgent question, a phone call etc.) and then I have a text which is incorrect as it is, and I have no power to change it. This should be changed! Each of us must be an owner of his own words.


non-linear ordinary differential equation (Jacobi's?)

I am working on some firm optimization problem and got to the following differential equation.   $\frac{dy}{dx} = \frac{(y-x)(1-y)}{(c-x)(1-2y+x)}$ with $x,y \in [0, 1]$ and c is a constant with $0<c\leq1$.  I know the obvious solution $y=1$ but I was wondering if there is any other solutions. Also I am looking for a generic solution that depends on any $c$ within the specified interval.  Thanks.


Group of order $105$ with a normal Sylow $3$-subgroup is cyclic

Let $G$ be a group of order $105 = 3 \times 5 \times 7$ with a normal Sylow $3$-subgroup, prove that $G$ is cyclic.  My attempt  I've been able to show that $G = NP$, where $N$ is the normal Sylow $3$-subgroup (which is of course cyclic) and $P$ is a cyclic group of order $35$. What's left to be shown is that $NP$ is cyclic. And I'm stuck.  Any help would be greatly appreciated. Thanks in advance!


Winter is coming. I found that when commuting—or just riding—in cold conditions (say -10 Celsius), the skin on my face becomes too dry, red, and itchy.  What can I do to prevent this?  I've tried using buff as a mask, but had no luck: due to the air I breathe out, this mask freezes quickly and makes things even worse. I'm not asking about masks only; maybe there are some gels to apply on the skin?


How to install Ubuntu from a Ubuntu installation?

I have installed Ubuntu onto a laptop. I know that I can boot into a liveUSB of Ubuntu and install Ubuntu onto my external hard drive but I was wondering if there is a way to install Ubuntu onto the from within the full installation of Ubuntu. A program like the one that is installed on the liveUSB. This is due to the track pad on the laptop being broken I have to use a USB mouse receiver to control the mouse. The laptop I'm using only has two USB's so I can't have the mouse plugged in, have the liveUSB and plug in the external harddrive at the same time. Hope there is a solution to this.


How to define a bold font style for \emph text

Recently, I wanted to set all my \emphasized text to bold, because I think the default Italic of \emph is not distinctly emphasized.  But I haven't found a solution for it. Please give me some idea. Thanks.  I read a comment on '', it says:     I rarely use physical font commands in my body text. I use them to define styles in the preamble and use the styles in the document afterwards, ensuring consistency and allowing changes to be easily made.   But I didn't find how to define our own styles, after searching in .  I have tried:   \let\emph\textbf \renewcommand{\emph}[1]{\textbf{#1}}   But failed to set bold to \emph text.  I finally figured out a solution that using Bold font for ItalicFont:  % compile by `xelatex file.tex` \documentclass{book} % CJK \usepackage{xltxtra, xeCJK} \setCJKmainfont[BoldFont=Adobe Heiti Std,ItalicFont=Adobe Heiti Std]{Adobe Song Std} % Latin \usepackage{fontspec} \setmainfont{Gentium Book Basic}[ItalicFont=Gentium Book Basic Bold] \begin{document} I want to bold \emph{emphasized} text.  % bold CJK emphasized text 我想用粗体显示 \emph{强调的} 文字 \end{document}   However, I don't think it's a wise solution.  So, any idea? Thanks again.


How can I automatically add workspaces, only if I need them?

Assume I am using 4 workspaces and I incidentally need more, is there an automated process or, if impossible, an easy way to incidentally add more workspaces (instead of installing Ubuntu tweak etc. etc.).


Cannot RDP to Windows 7 with Remmina on 12.04

Since I upgraded to 12.04, I am unable to RDP to a Windows 7 server. All I can see is a pop-up that says "Uable to connect to RDP server ". I am able to RDP using Vinagre, so that rules out any issues with my router or the Windows server. As far as I can tell, there are no logs from Remmina and the Debug window shows a blank. Any one got any ideas? Thanks.


a diophantine equation from Stewart and Tall

This is from Stewart and Tall from the chapter on Kummer's Theorem. Show that there are no non trivial  (non-zero) solutions to $x^3 + y^3=3z^3$


Black artifacts in some rendered images of a text

I'm a complete newbie and was wondering if I had set up something wrong.  I used the 20th Century fox blend and successfully rendered 600 jpg images. Looking good, except that about 30% images have a corrupt T in "Century".  I've spent several hours going through about 200 frames trying to smooth the error out with Gimp. Just wondering what cause the fault and if there is any way to correct it a bit quicker..


I need to display a bunch of images on a web page using AJAX. All of them have different dimensions, so I want to adjust their size before displaying them. Is there any way to do this in JavaScript?  Using PHP's getimagesize() for each image causes an unnecessary performance hit since there will be many images.


There is a viral video spread showing a helix stick moving against water. For more detail there is a stick look like a spring. When water slowly pour on it. The spring like stick climbing on the falling water stream. It appears as the stick move agains lows of physics.  See the video on this link:       I assume this is a science toy which move against water flow using water energy. Can any one tell me the name of this tool or theory?


Did Voldemort plan to take over the entire world?

Did Voldemort ever plan to extend his rule to the other wizarding societies outside of Great Britain and then eventually topple the International Statue of Secrecy and take over the Muggle world as well?


Clone Object without reference javascript

I have a big object with much data. And i want to clone this in other variable. When i set some param of the instance B has the same result in the original object:  var obj = {a: 25, b: 50, c: 75}; var A = obj; var B = obj;  A.a = 30; B.a = 40;  alert(obj.a + " " + A.a + " " + B.a); // 40 40 40   My output should be 25 30 40. Any ideas?  EDIT  Thanks Everyone. I change the code of dystroy and this is my result:  Object.prototype.clone = Array.prototype.clone = function() {     if (Object.prototype.toString.call(this) === '[object Array]')     {         var clone = [];         for (var i=0; i<this.length; i++)             clone[i] = this[i].clone();          return clone;     }      else if (typeof(this)=="object")     {         var clone = {};         for (var prop in this)             if (this.hasOwnProperty(prop))                 clone[prop] = this[prop].clone();          return clone;     }     else         return this; }  var obj = {a: 25, b: 50, c: 75}; var A = obj.clone(); var B = obj.clone(); A.a = 30; B.a = 40; alert(obj.a + " " + A.a + " " + B.a);  var arr = [25, 50, 75]; var C = arr.clone(); var D = arr.clone(); C[0] = 30; D[0] = 40; alert(arr[0] + " " + C[0] + " " + D[0]);


Which episodes of Fairy Tail season 2 are anime-exclusive?

Aside from the Eclipse Celestial Spirits arc, what other episodes of Fairy Tail season 2 are anime-exclusive?


Question about DES-CBC : how to know IV if I have key, input buffer (plaintext),  output buffer (encrypted) and decrypted result where first 8 bytes are incorrect but all other bytes are correct ?"


What is this syntax in java ` Sets.SetView`?

Here is some code that I was trying to understand   public static <E> Sets.SetView<E> difference(final Set<E> set1, final Set<?> set2) {     Preconditions.checkNotNull(set1, "set1");     Preconditions.checkNotNull(set2, "set2");     final Predicate<Object> notInSet2 = Predicates.not(Predicates.in(set2));     return new Sets.SetView<E>() {         public Iterator<E> iterator() {             return Iterators.filter(set1.iterator(), notInSet2);         }          public int size() {             return Iterators.size(this.iterator());         }          public boolean isEmpty() {             return set2.containsAll(set1);         }          public boolean contains(Object element) {             return set1.contains(element) && !set2.contains(element);         }     }; }   I am confuse on what the function is returning, when I use it, it would seems like the function is returning Sets.SetView<E>  For example          Set<Integer> a = new HashSet<>();         Set<Integer> b = new HashSet<>();         a.add(1);         Sets.difference(a, b); // is of type Sets.SetView<Long>   What is the extra <E> prepend in front?  And why does the actual return value contains method definition?      return new Sets.SetView<E>() {         public Iterator<E> iterator() {             return Iterators.filter(set1.iterator(), notInSet2);         }          public int size() {             return Iterators.size(this.iterator());         }          public boolean isEmpty() {             return set2.containsAll(set1);         }          public boolean contains(Object element) {             return set1.contains(element) && !set2.contains(element);         }     };


What is the use of the *~ files; are they some kind of default backup in Ubuntu/Linux?

I've noticed this *~ file gets created (hidden) whenever I edit a file; usually text document, scripts. Is it some kind of backup?!? as it seems so... However, I don't have a backup service configured for such...   So, are those files backup files? ...like for contents or attributes? If yes, how can use to restore/recover what the file has to offer?


How does an OS detect an access to random memory address of a compiled program?

I've read a couple things about memory management/virtual memory and I need a little more details on one important point.  If I compile a program and it does an access to a hard-coded address without any allocation calls, when I run it the process gets an error signal, terminated by signal SIGSEGV (Address boundary error).  Example program:  #include <stdio.h>  void main() {     int * x = 0x1312;     printf("%d\n", *x); }   Compiled with mere:  $ gcc accessing-random-address.c -o random-address-access   Here I don't get what exactly happens when a program is turned into a process. The compiled program is all-machine-code, isn't it? The address access should look like mv (0x1312) regN. If this code runs -- how could the OS detect that the code accesses a memory outside of its' memory range?  So, my question is -- what mechanism is used in Linux/Unixes to catch such rogue memory accesses and send the signal to the process? At what moment is it done?  In fact, the same question applies to the way how a program is converted to a process. If the program has been compiled for some architecture -- it should use the physical addresses and registers of the processor. But the process uses the virtual memory, with page-tables etc. So, is there some intermediate executable Linux-specific format, which gcc compiles to? And this format is somehow converted to real machine code when the program is loaded into memory as a process? And then in the real machine code the memory access is not just mv A B but some procedure with kernel's page tables, page numbers and offsets?  PS  Probably this question would be clarified with more reading. But I would like to have this knowledge upfront -- so that "the main picture" is complete before getting other details.


How I can tell a process image name (to run from terminal using sudo) showing on the Ubuntu UI?


Find series representation of a function $ y=\frac{1}{1+x+x^{2}+x^{3}} $

Let $y = \frac{1}{1+x+x^{2}+x^{3}}$.  And I want to find the series representation of this function. I've noticed that I can rewrite this like $\frac{1}{1+x+x^{2}+x^{3}}=\frac{1}{1+x}*\frac{1}{1+x^{2}}$ or I can rewite this like a sum of two fractions $\frac{1}{1+x+x^{2}+x^{3}}=\frac{1}{2(1+x)}+\frac{1}{2(1+x^{2})}$.  I know the series representations of these functions $(1+x)^{n}$ and $\frac{1}{1-x}$, and I guess I should use one of them. But the result looks weird. Can you help me, please, may be I can't see some easy way to solve it.


I've been trying to get this simple FM transmitter to work over the past few days and I could use some help in a few areas.      First iteration was on a breadboard with all parts included.  The exception being I didn't have a 0.1uH coil handy but I had another coil rated at 0.7uH (using my LCR meter).  I also didn't have a C4 value of 4.7pF but I had a 10pF value.  I figured I could just tune it later.  I hooked a scope up to it and got no oscillation.  I tried connecting the probe to the gate and the collector separately and together.  Still no oscillation.  Second iteration.  I removed the audio component of the circuit.  Essentially everything to the left of C2.  I had gotten that working no problem anyway so I figured I would concentrate on the oscillator.  This time I tried different values for the inductor ranging from 20uH to 1mH and different fixed values for the variable cap (10pf, 20pf, 30pf).  These were all ceramic caps. No love.  Third iteration. I tested the transistor to make sure that wasn't the issue.  Seems fine.  PN2222A variety. (Also tried 2N3904 and BC547). I then modeled this up on a piece of perf board.  I even found a SMD inductor of 0.1uH so now I thought I would be good.  Tested all the pieces on the meter before installation. Still nothing. I'm not seeing anything on the spectrum analyzer either.  Questions:   Do you think my benchtop power supply is causing a problem?  All the various versions of this type of FM transmitter circuit on YouTube and the Internet all seem to use a battery.  Any chance the 60Hz main power is messing with things?  I've put .1uF and higher caps on the power rails. I have a 200Mhz SIGLENT SDS1202X-E scope.  I've built and tested other oscillators up to a few MHz before with no issues.  Any thoughts on that being the issue?  I would expect to see something on the scope right? Any chance the probe is dampening the oscillations?     I know there are a lot better FM transmitter circuits out there I was just experimenting with this (and others like it) and couldn't get any to work.


Old sci-fi short story about bombs sent back through time and space by aliens to destroy earth

The story I remember and am trying to find: Humans had expanded out into the galaxy. Another race of aliens saw humans making their way towards their sector of space and feared us. That race was not a warring society and didn't have war ships or war strategies in their culture, only a lot of science. So they developed a bomb that could travel through time and space back to Earth millions of years before humans evolved and destroy the planet, therefore eliminating the threat. The bombs, for whatever reason, had to contain a living creature to make course adjustments and time adjustments and to detonate the bomb at the right time. So the aliens genetically engineered a small creature with one arm, one eye, and no legs and placed it into the bomb to do the work. Then they sent dozens of these bombs back through time and space. The story also tells of the journey the bombs took and what happened when they reached our solar system. The story was part of a sci-fi collection anthology. One of the other stories in the book was called Juggernaut by A. E. van Vogt about an indestructible metal ingot that was put on earth which eventually ended all wars as the metal passed on its properties to any other metal in touched. I recently found this story in a book called A Treasury of Science Fiction, but still no luck finding the alien bombs story.


Rendering a pdf in a different location, from a standalone tex-file that combines several chapters

I've seen a lot of these questions, but in my search I haven't managed to find an answer to my problem. I am building a directory system for simple use, where I have divided the first folder into "Parts" and "Results". In the Parts directory, I have folders called "Tex", "Img" and "Combo".   Tex contains four different tex files, chapters. Img contains all images from every chapter. I want all images in one location because some of them appear more than once. If I need to replace one of the images I want it to do so everywhere where it appears. Combo contains the tex file which combines the four chapters into one big book, of sorts. I use the package standalone to rid the chapters from their preamble and to make it a main file. I then use \include with a relative path to the different chapter-files that I want to include.  Going back to the root folder of this directory-system, the other folder is called "Results". This is where I want all of the rendered content (html and pdf). The reason why I am building the system this way is because I am not the end user of the files, which means it should be simple to navigate and understand.  The problem I have appears when I want to use pdflatex to compile the main file. A lot of what I understand is called "nesting" is happening here. I'm rendering the results in the "Results"-folder, which fetches information from the texin the "Combo"-folders which in turn retrieves files from the "Tex"-folder. All of these chapters then wants images from the "Img"-folder.   I get these errors in the terminal when trying the pdflatex command while working in the "Results"-directory:  ! LaTeX Error: File `../tex/Chapter1.tex' not found.  Type X to quit or <RETURN> to proceed, or enter new name. (Default extension: tex)  Enter file name:    If I enter the absolute path to the Chapter1-file  Enter file name: /Users/Rikardny/Documents/temp/Assets/tex/Chapter1.tex    I instead get the error  ! Package pdftex.def Error: File `login.jpg' not found.  See the pdftex.def package documentation for explanation. Type  H <return>  for immediate help.  ...                                                l.48 ...degraphics[width=0.8\textwidth]{login.jpg}  ?    I understand this is a problem because of the relative paths to other files in each of the documents. Whilst in the "Results"-directory, the relative paths point to a different place than in the "Combo"-directory. However I would like to use relative paths because the folders are going to move to different machines later. Is there a way to maintain the directory-system but not change all the relative paths to absolute paths?


Difference between main(void) and main() in C

Can anyone tell me the difference between int main() and int main(void)? Why do both of them work and what is the default argument to int main()?


Keeping the time stamp when syncing with Ubuntu One?

I would like to keep the original time stamp of a file when synchronizing with Ubuntu One.  Now Ubuntu One is messing with my time stamps, and I no longer know when I last worked on the file.  Ubuntu One also seem to mess up time stamps on the original source host.  This really is a show stopper, and we are just about to implement Ubuntu One across the many users in the organization.


Hibernate One-To-Many Unidirectional on an existing DB

Hello Stack Overflow Experts, i have need of your expertice:  I am trying to use Hibernate on an Existing DB. Currently im trying to load a User object and a list of UserData objects that go along.  in the DB the (simplified) layout is  |    User      |      |          UserData               | ----------------      ----------------------------------- uid | username |      | uid | parentuid | field | value |    So each User object matches all the UserData objects where UserData.parentuid = User.uid.  My User class mapping file      <class name="com.agetor.commons.security.User" table="ac_users">     <id name="uid" column="uid" type="long" >         <!--<generator class="native"/>-->     </id>     <property name="username" column="username" />         <list name="fieldData" cascade="all">         <key column="parentuid" not-null="true" />         <index column="parentuid" />         <one-to-many class="com.agetor.commons.fields.FieldData"/>     </list>  </class>    Mu  UserData mapping file      <class name="com.agetor.commons.fields.FieldData" table="ac_userdef_data">     <id name="uid" column="uid" type="long" >     <!--<generator class="native"/> -->     </id>     <!--<property name="parentuid" column="parentuid" />   -->     <property name="fieldname" column="fieldname" />     <property name="value" column="value" /> </class>   So far i have tried many different configurations and all of them have had various degrees of failue. The code pasted here, does not work.    The parentuid property is commented out, because Hibernate gives a "Repeated column in mapping" error otherwise. Currently there is still a "Repeated column in mapping" on the uid field, i use for <list-index /> I do not understand where i specify that UserData.parentuid is the foreign key and that  the list should use User.uid as key.   I hope someone is able to help.    When you define both a One-To-Many and a Many-To-One, does this not make it Bi-Directional? The current working model, is Unidirectional and UserData does not have a reference to User. Your suggestion fails, because Hibernate could not find a get or set method for User on UserData.  Is it implied that, this code uses User.uid as a key and matches this against the UserData.parentuid column? Or is this fact specified somewhere else?    <list name="fieldData" inverse="true">     <key column="parentuid" not-null="true" />     <one-to-many class="com.agetor.commons.fields.FieldData"/>   </list>   I am still learning Hibernate and working my way through documentation and examples i can find.


I know this might be a very basic question but i'm pretty confused by this:  Map<Id,Account> accountWithOpportunities =      new Map<Id,Account>([SELECT Id,(SELECT Id FROM Opportunities) FROM Account]);   I have no clue on to where the Opportunities are relevant at all in this map and how they are stored or can be accessed?   Can anyone clear this out for me?


While chatting I want to post a picture, but there is no upload button. I am chatting in , but there is no upload button near my send button so how should I post the picture now


Remember window locations when docked and undocked

I find this beyond frustrating.  I have two extra screens on my laptop at work. I take my laptop and go home, with no extra screens connected. I come back, dock the laptop, and the windows need to be rearranged again.  Is there a way to get windows (or a utility) to keep track of the overall screen configuration (#, size, resolution), and remember where windows were placed, so when the screen configuration matches again, it puts applications BACK where they were?


How to differentiate between data types "String, int, float.. etc

I want to differentiate between the data types "string"&"int", if the input is "int" it will be appended, if not it will ask for correction **no_inputs = 5 l =[] while no_inputs >0:     user_input = int(input("Please enter a number : "))     if isinstance(user_input, int):                 l.append(user_input)         no_inputs -= 1     elif isinstance(user_input, str):         print("Please enter a number only ") print(l)**


Find the almost sure limit of $X_n/n$, where each random variable $X_n$ has a Poisson distribution with parameter $n$

$X_{n}$ independent and $X_n \sim \mathcal{P}(n) $  meaning that $X_{n}$ has Poisson distributions with parameter $n$. What is the $\lim\limits_{n\to \infty} \frac{X_{n}}{n}$ almost surely ?    I think we can write $X(n) \sim X(1)+X(1)+\cdots+X(1)$ where the sum is taken on independent identical distribution then use the law of large number. But I am not sure that is it correct or not. Can anyone give me some hints? Thank you in advance!


Should I upgrade to the "mainline" kernels?

Newer "mainline" versions of the kernel are available from the , e.g. 3.4 and 3.5, while Ubuntu 12.04 is on 3.2.   What are the mainline kernels? Are they better than my existing kernel? What are the pros and cons of upgrading to a mainline kernel? Will I easily be able to go back?


I know the difference between return and exit() (), but I don't know where and when to choose one instead of the other. For example from  answer I understand that return is a better choise, but from  I understand the opposite.  An example: in this code (from  question) is it preferable to use exit() or return?  int read_file (char *filename, int **vet) {     FILE *fin;      if ( !(fin = fopen(filename, "r")) )     {         perror(filename);         return -1;     }      * vet = malloc (10 * sizeof(int));     if ( *vet == NULL )     {         perror("Memory allocation error.\n");         return -2;        }      /* ... */      return fclose(fin); }  int main () {     char filename[100];     int *vet;      if ( read_file(filename, &vet) )         /* ??? exit(1) OR return -1 ??? */      return 0; }   And generally?


nested node class operator overload < c++

I'm trying to overload the < operator for my nested Node class inside my LinkedList class. I have it setup like this:   LinkedList<T>::Node& LinkedList<T>::Node::operator<(const LinkedList<T>::Node& rhs){     return rhs;  }   But I just get the error 1>c:\users\kevin\workspace\linkedlist\linkedlist.h(185): warning C4183: '<': missing return type; assumed to be a member function returning 'int'  I try to return 1 but that doesn't work either.


Where exactly does CMB come from. I've seen it in documentaries as a huge sphere with Earth in the middle. But if all this radiation was ejected from the start of the universe some time after the big bang; why can we see it? Surely the radiation should be travelling away from us? Just like every galaxy is?


Find if $|x|^\alpha \sin(\frac{1}{x})$ is continuous and differentiable.

I have the following function: $$ f(x) =  \begin{cases}   |x|^\alpha \sin(\frac{1}{x}),  & x \neq 0,\\       0,  & x = 0.    \end{cases} $$ I need to find all values of $\alpha$ such that function: (a) is continuous at $x_{0}$ = $0$; (b) has a derivative at point $x_{0}$ = $0$; (c) has a continuous derivative at $x_{0}$ = $0$. I suppose that there is no such $\alpha$, because at $x_{0} = 0$ function is discontinuous, therefore whatever $\alpha$ we take, it will remain discontinuous. I would appreciate some theoretical explanation or any other hint.


Reputation not getting added after awarded Copy Editor badge

Yesterday, I was awarded the golden badge Copy Editor in Stack Overflow. After it, I edited some more posts but even they were accepted by the user, I didn't get any reputations. Today for one of my question, I accepted an answer for which it was shown 2 reputation is awarded. But my reputation still remains the same.   Why this is happening? Is my account blocked from anything?


To prove Cayley-Hamilton theorem, why can't we substitute $A$ for $\lambda$ in $p(\lambda) = \det(\lambda I - A)$?

Cayley Hamilton Theorem states that if $A$ is an $n \times n$ matrix over the field $F$ then $p(A) = 0$.  We note that $p(\lambda) = \det(\lambda I - A)$. Hence, why can't we just substitute $\lambda$ with $A$ and directly prove Cayley-Hamilton Theorem by saying that $p(A) = p(\lambda) = \det(\lambda I - A) = \det(AI - A) = 0$?


I've got this tree-like key (think object OIDs--it's very similar) to store and index in a table, for which queries want to select subtrees thereof. The most straightforward way to do this on a btree is to use the tree path as the single key and descend the key with a starts-with operation to find the row blocks. So the obvious representation is VARBINARY(n)*. I cannot think of a way to express starts with in a way that SQL Server can figure out to use the index thereof. The next-most obvious is to pack the data into some VARCHAR with a binary collation and use a like operation; however I've discovered that like @n + '%' will never use an index, but only like 'literal%. Adding the WITH INDEX hint still scans the index in its entirety because SQL server just doesn't understand. I really don't want to think about how to escape arguments in SQL so I can build an EXEC. That's just madness and a security disaster waiting to happen. Expressing this in ordinary recursive tables and querying with recursive SQL is out of the question. The recursive query will power-sink the database server. I actually have the data in a long string of long variables right now and can select my serialization form. As I said, the natural form is VARBINARY and it really would look like 0x000000100004A010000000D0000A000. The most common query is of the form "give me everything starting with 0x000000100004A01" or in natural model, the first n values from the string of long values. I could write them in the form a.b.c.d.e.f... but the individual numbers are long and come from clicking on things on the GUI. Roughly speaking I'm looking at a plausible form of CREATE TABLE Record (    RecordId BIGINT NOT NULL IDENTITY(1,1),    RecordedDate DATETIME NOT NULL,    RecordClass CHAR(1) NOT NULL,    UserId INT NOT NULL,    ObjectId VARBINARY(384) NOT NULL,    RecordValue NVARCHAR(100) NULL,    OwnerId BIGINT NULL, -- Joins to another table    SubOwnerId BIGINT NULL, -- and yet another table    PRIMARY KEY (RecordId) ) CREATE INDEX name ON Record(RecordedDate); CREATE INDEX name ON Record(OwnerId); CREATE INDEX name ON Record(SubOwnerId); CREATE INDEX name ON Record(ObjectId);  What is the best way to do a starts-with index? *I've computed the largest possible n and it's less than 400


Codeblocks have horizontal scrolling.  So, how can I print from StackOverflow to show all code?  Is there a way to turn horizontal scrolling off?  It's no good for mobility impaired users, anyway, so I'd prefer not to have it on my system.


Basic fact used in proofs in Eisenbud's commutative algebra book.

Page 31.     Corollary 1.5.  Let $k$ be a field, and let $S = k[x_1, \dots, x_r]$ be a polynomial graded by degree. Let $R$ be a $k$-subalgebra of $S$.  If $R$ is a summand of $S$, in the sense that there is a map of $R$-modules $\varphi: S \to R$ that preserves degrees and takes each element of $R$ to itself, then $R$ is a finitely generated $k$-algebra.      Proof. Let $\hat{m} \subset R$ be the ideal generated by the homogeneous elements of $R$ of strictly positive degree.  Since $S$ is Noetherian, the ideal $\hat{m}S$ has a finite set of generators, which may be chosen to be homogeneous elements $f_1, \dots, f_s$ of $\hat{m}$.  We shall show that these elements generate $R$ as a $k$-algebra.   Why is the bolded part true?


What is meaning of the phrase "The laws of physics are the same in all inertial frames of reference."?

One of the postulates special relativity is that "The laws of physics are the same in all inertial frames of reference." What is meaning of this statement? If it is talking about physical laws  I do not understand why  because the laws of physics do not depend of the observer, for example , Maxwell equation is Maxwell equation  in  a accelerated frame or in a inertial frame. If it talk about observation let us take the example of an source emitting light of frequency $\nu$ .Due to the doppler effect a static observer in relation to the source and one moving with velocity $v$ in relation to the source will see different frequencies and so different observation. So what is the meaning of this statement?


Keeping track of constraints for graph coloring?

I am working on a graph coloring problem. Right now I'm stuck on a step that should be very simple. I've created a dictionary that includes all possible colors for each node (different colors are represented by the integers 0, 1, 2 ,3). See below. (Apologies in advance if the formatting of the question doesn't come out correctly. This is my first time asking a question here).         node_count = 4         colors = [0,1,2,3]          sol_dict = {node:colors for node in range(0,node_count)}          print(sol_dict)   Output:         {0: [0, 1, 2, 3], 1: [0, 1, 2, 3], 2: [0, 1, 2, 3], 3: [0, 1, 2, 3]}   All I want to do is remove elements from some of these lists when I apply a constraint. For instance, if my algorithm discovers that node 1 in the dictionary cannot take the color value 0, I want to remove 0 from the list associated with the dictionary key 1. To do this I write:         sol_dict[1].remove(0)          print(sol_dict)   Output:         {0: [1, 2, 3], 1: [1, 2, 3], 2: [1, 2, 3], 3: [1, 2, 3]}   As you can see, this removes 0 from all items in the dictionary. I am at a loss to why this is happening. Let me know what you think. I've been stuck on this a while.