Why do cost functions use the square error?

I'm just getting started with some machine learning, and until now I have been dealing with linear regression over one variable.  I have learnt that there is a hypothesis, which is:  $h_\theta(x)=\theta_0+\theta_1x$  To find out good values for the parameters $\theta_0$ and $\theta_1$ we want to minimize the difference between the calculated result and the actual result of our test data. So we subtract  $h_\theta(x^{(i)})-y^{(i)}$  for all $i$ from $1$ to $m$. Hence we calculate the sum over this difference and then calculate the average by multiplying the sum by $\frac{1}{m}$. So far, so good. This would result in:  $\frac{1}{m}\sum_{i=1}^mh_\theta(x^{(i)})-y^{(i)}$  But this is not what has been suggested. Instead the course suggests to take the square value of the difference, and to multiply by $\frac{1}{2m}$. So the formula is:  $\frac{1}{2m}\sum_{i=1}^m(h_\theta(x^{(i)})-y^{(i)})^2$  Why is that? Why do we use the square function here, and why do we multiply by $\frac{1}{2m}$ instead of $\frac{1}{m}$?


If $z_n \to z$ then $(1+z_n/n)^n \to e^z$

We are dealing with $z \in \mathbb{C}$. I know that $$ \left(1+ \frac{z}{n} \right)^n \to e^{z} $$ as $n \to \infty$. So intuitively if $z_n \to z$ then we should have $$ \left(1+ \frac{z_n}{n} \right)^n \to e^{z}. $$ If $z_n \in \mathbb{R}$ I would be happy writing $$ \exp \left(n \log\left(1+ \frac{z_n}{n} \right) \right) = \exp \left(z_n \frac{\log\left(1+ \frac{z_n}{n} \right)-\log(1+0)}{\frac{z_n}{n}-0} \right) \to \exp(z \cdot 1) $$ where here we are using the definition of derivative. But if $z \in \mathbb{C}$ the logarithm is multivalued and I'm not sure that the same calculation is allowed. Is there a different way to show this for complex $z$?


Can I have multiple primary keys in a single table?


How to delete whole text from the beginning of a line with a certain string

I use sed -n '/string/,$p' file >> otherfile to copy text from a line with certain string to another file.  Now I want the copied text to be deleted in the original file. I tried different methods with sed and awk but nothing worked.  How to use sed to delete the text of a file from the beginning line with a certain string in it?  texta  texta1  textb    <- string, delete rest of the text from here  textb1  textc  textc1   or would it be easier to cut instead of copying with sed and what would be the command instead?


How can I type special characters instead of a keystroke on Ubuntu or Debian

I know there are solutions such as using the keypad to encode ASCII code or using special keys to map accent.  But I am looking for a solution like in   I understand the complexity of having both a keyboard mapping and a UI that shows the selections you can do since Linux core and desktop environments are separated, plus it might not work in non-graphical environments.  But is there a way to configure this mapping (or does it exist already) in a way that we could press for example e, holding it while pressing 1 and have an è. does this can conflict with things like the terminal or os keybinding?  if it does not exist, where could I find the resources to develop it? for once, I agree with an OSX principle: keystroke is not very useful and could result in alternate inputs instead.  EDIT: I am looking if the OSX mapping already exists before doing my own, and if it doesn't and I want to do it, is there a way to do it without a compose key?


Why does \label create an undesired white space after \phantomsubcaption?

Usually \label does not create any white spaces. However, It creates an white space when \label is used after \phantomsubcaption from subcaption package.   Why? How can I get rid of this white space?   Here is a MWE:  \documentclass{article} \usepackage{subcaption}  \begin{document}  \section{a} a\label{sec:a}b% no white space between `a' and `b'  \begin{figure}   \centering   {a\phantomsubcaption\label{fig:a}}%   {b\phantomsubcaption\label{fig:b}}   \caption{With label}% undesired white space between `a' and `b' \end{figure}  \begin{figure}   \centering   {a\phantomsubcaption}%   {b\phantomsubcaption}   \caption{Without label}% no white space between `a' and `b' \end{figure}  \end{document}


probability of last person finding seat occupied

Suppose there are $n+k$ seats in a movie theatre and $n$ people are assigned to them, one person per seat. The first person forgets their seat, so they randomly choose a seat. Then for each subsequent person, if their seat is occupied, they randomly seat an unoccupied seat; otherwise they sit in the right spot. Find the probability that the last person finds their seat already occupied.  After trying out a few examples using tree diagrams (e.g. $(n,k) = (3, 2), (2,2), (2,3),$ etc.), it seems that the required probability is $\frac{1}{2+k},$ which is independent of $n$ and reminds me of the airplane seat problem (the one with 100 people choosing 100 seats); the main difference being that there are unassigned seats. I think I should find some invariant probabilities. I know the first person has a $\frac{1}{n+k}$ probability of choosing the right seat, and that once the last seat is chosen, no more probabilities need to be computed. It may be possible that the complement of this probability, the probability that the last person finds their seat unoccupied may be easier. In the case of the complement, the last seat must not be selected by anyone.


Anti-derivative of continuous function $\frac{1}{2+\sin x}$

I use tangent half-angle substitution to calculate this indefinite integral: $$ \int \frac{1}{2+\sin x}\,dx = \frac{2}{\sqrt{3}}\tan^{-1}\frac{2\tan \frac{x}{2}+1}{\sqrt{3}}+\text{constant}. $$  Wolfram Alpha also give the same answer. However, $\frac{2}{\sqrt{3}}\tan^{-1}\frac{2\tan \frac{x}{2}+1}{\sqrt{3}}$ is discontinuous on $(n+1)\pi$ where $n$ is any integer. Why is an anti-derivative of a continuous function discontinuous?


failed to open stream: Permission denied for php move upload file

i am trying to create an upload functionality in the website using php, but i am getting the permission denied error, i changed the user permissions of the folder still the same error .is there any alternative to move_uploaded_file in php?  here is my code :                <?php  if(isset($_FILES['image'])){     $errors= array();     $file_name = $_FILES['image']['name'];     $file_size =$_FILES['image']['size'];     $file_tmp =$_FILES['image']['tmp_name'];     $file_type=$_FILES['image']['type'];    // $file_ext=strtolower(end(explode('.',$_FILES['image']['name'])));      $expensions= array("jpeg","jpg","png");      if(in_array($file_ext,$expensions)=== false){         $errors[]="extension not allowed, please choose a JPEG or PNG file.";          }      if($file_size > 2097152){         $errors[]='File size must be excately 2 MB';     } $uploadfile="new/uploads";     if(empty($errors)==true){         move_uploaded_file($file_tmp,$uploadfile.$file_name);         echo "Success";     }else{         print_r($errors);     } } ?>  html code :  <form action="upload1.php" method="POST" enctype="multipart/form-data">         <input type="file" name="image" />         <input type="submit"/>     </form>   you have any toughts,pls help me out


Here's a text:  'I'm going out now. Is it cold out?' 'Yes, I should wear a coat.' It means 'If I were you, I would wear a coat'. So my question is can I just say 'Yes, I would wear a coat'?


Access script arguments from within script

I have a script that I can run like this: bash myscript.sh -ram 4096M -jar something.jar -dir /home/something I would like to be able to access the variable ram, jar, and dir from within the script. How do I do this?


I have a .js file stored on the Site Assets library. Today I updated it (uploaded file of the same Name and replaced the old one).  But the new code seemed not to work. After lot's of debugging and Troubleshooting, I discovered that it was not the code the problem.  I opened the Developer Tools (F12), selected the console tab and from the drop-down menu I selected my .js file which is linked to a library on the page. There I discovered the old code, before updating the file, which I found very weird.   Anyone encountered this before or have any idea why is that?  (I checked already the edit web part Options and the JSLink address is correct and also made sure the correct .js file is on the Site Assets library)


What is the best way to do GUIs in Clojure?

What is the best way to do GUIs in ?  Is there an example of some functional  or  wrapper? Or some integration with  declarative GUI description which could be easily wrapped to  using some macrology?  Any tutorials?


Simple algebra, but causing arguments in a home school co-op discussion. $6^2/2(3)+4$

Trying to get some human opinion on this problem.  Very simple equation, but it is eliciting quite the controversy.  I have executed it in Ruby, Java, C#, Javascript, Python, Perl and Excel with the same result, however this is being refuted as to the change of the divisor sign.  Keep in mind, these are not tech-saavy folk.  The equation: $$6^2 \div 2(3) + 4 = x $$  Two answers so far are "58" and "10"  Please help :)


More specifically, I'm supposed to compute $\displaystyle\sum_{k=1}^{n} \frac 1 {k(k + 1)} $ by using the equality $\frac 1 {k(k + 1)} = \frac 1 k - \frac 1 {k + 1}$ and the problem before which just says that, $\displaystyle\sum_{j=1}^{n} a_j - a_{j - 1} = a_n - a_0$.  I can add up the sum for any $n$ but I'm not sure what they mean by "compute".   Thanks!


Showing $\prod_{n < \omega} n = 2^{\aleph_0}$

I have to show that $\prod_{n < \omega} n = 2^{\aleph_0}$. I'm having trouble getting started. I know that $2^{\aleph_0}$ is the set of binary sequences, or the space of functions from $\mathbb{N}$ to $\{0, 1\}$, but I'm having trouble parsing $\prod_{n < \omega} n$. My best guess is that it's the infinite Cartesian product $$0 \times 1 \times 2 \times 3 \times \dots$$ but because $0$ is $\emptyset$, then so is this product. Alternatively, $$\prod_{n < \omega} n = \{f : \omega \rightarrow \bigcup n | (\forall n) f(n) \in n\}$$ Thus has the same problem, though, that this would be an empty space of functions because none of them can map $0$ anywhere.


is there any uncertainty on the free particle with a definite momentum $\vec p$?

The probability amplitude for a free particle with momentum $\ p$ and energy $E$ is the complex wave function: $$\psi_{(\vec x , t)}=e^{i(\vec k\cdot \vec x -\omega t)}$$  is there any uncertainty on the free particle with a definite momentum $\vec p$!?


How to read a csv file and use the values as x and y points in blender?

How can i use the value in column 'lon' and 'lat' as the position of my uv_sphere? For example,read the values from line 4, (116.4559081, 39.9139083), and make these 2 numbers as my uv_sphere x and y position in blender? and gives different colors for different mode, for example i have 4 modes in the csv , i want to make the uv sphere that represents the bus mode to be red, and subway to be green , rail to be blue and tram to be yellow., and use the row ['from'] and ['to'] to connect the nodes with a cylinder with x scale 0.5 , y scale 0.5 and the z scale with the value in ['length'] value.


ATINER - is this a legimate conference? pros and cons?

Background: A close acquaintance of mine is a tenured faculty member at a minor US college, having worked there for several decades. They are very well respected for their contributions to the college, students, and community, but they really haven't played a research role. This individual isn't the best when it comes to navigating the perils of the Internet, which brings us to the scenario and question...  Scenario: For both fiscal and, I suppose, for personal reasons, they want to submit a paper to the  conference. I think that submitting a few papers may change their title and pay grade, which would help them before moving towards retirement within the next decade, as their family has some financial issues.  Question: Is this a legitimate conference, and what risks of participating? It appears on librarian  of potentially predatory conferences. However, from my inspection, it seems to be established, but perhaps low quality. I cross-referenced a couple of their past speakers and the talks do indeed appear on actual people's CV's.  So, to reiterate, my acquaintance is not a researcher, per se, nor desires to be known as one. With that in mind, what are the pros and cons of submitting a paper and giving a talk? I mainly want to protect my friend from harm.


If you see the  and total user rep, then the first thing that pops up is:    Obviously, the person only has 27K total rep.


After Insalling Ubuntu 16.04 Grub couldn't boot

I'm a computer Engineering student. I decided to try Ubuntu. During the installation, I checked the button that Removes All Disk and Install Ubuntu. After due time, I got the message saying that installation is done and I should restart. When I restarted, there was a black screen with a message:  Checking Media Presence.....   No Media Present....   I'm writing this on Live USB.


Why isn't the cd command working in my shell script?

I'm trying to run my first script, just a simple cd reroute. Unfortunately, I can't seem to get it to work. the script is basically #!bin/bash echo "moving you to Desktop" cd /mnt/c/Users/duanj/Desktop echo "finished moving"  and both the echo statements end up printing. But no redirect. Also, when I type the cd command in verbatim into my terminal it works.


Diskmounting problems after using windows

On mine laptop is use dualboot Windows 8.1 and Ubuntu 14.04 LTS Sometimes i must use Windows cos Ubuntu does not support some of mine software (10% not), but when i boot over to Ubuntu i cant mount mine harddisk(s) anymore and Ubuntu gives a warning that Windows block access to the harddisk(s). Sometimes when i use Disk cleanup from windows the problem is temperary solved. Does anybody know which file(s) from Windows blocking Ubuntu to access mine Harddisks ?


How many spells does my Bard 6/Wizard 1 know?

This is my first time multiclassing a character.  I wanted to multiclass my bard with something, and I wanted to make sure I have the rules for multiclassing correct - because with my understanding, there's no way what I'm about to say could make sense.   Important Stats: Charisma: 19 (+4), Intelligence: 19 (+4)  My 6th-level College of Lore Bard knows 9 spells. My feature Additional Magical Secrets gives me 2 more spells. If I read the multiclassing rules correctly, then by multiclassing into wizard, my character can then prepare 5 more spells out of his 6 from his spellbook.  So in total: 9 Known + 2 + 5 Wizard = 16 Spells he knows at once. Is this right? For a level 7 character, that seems like a lot.   (Side note: I understand the number of spell slots I can use.)


Difference between statistical PRNG and cryptographic PRNG?

What's the difference between a statistical pseudorandom number generator (PRNG) and a cryptographic-strength PRNG?  I've seen a lot of PRNGs that are proposed for statistical uses -- e.g., statistical simulation, games, that sort of thing.  These statistical PRNGs include schemes like linear congruential generators, linear feedback shift registers (LFSR), Mersenne twister, and .  I've also seen many proposals for cryptographic-strength PRNGs: PRNGs designed for cryptographic uses.  These include constructions such as AES-CTR DRBG, HMAC_DRBG, ANSI X9.17, and .  What's the difference between these two kinds of PRNGs?  Is there any difference?  Can I take a PRNG that was designed for statistical use, and use it for cryptographic purposes?  Would that be safe?  If I find some statistical PRNG that looks nifty but wasn't designed specifically for cryptographic use, would it be reasonable to use it for cryptographic uses?  What if I start with a statistical PRNG and then tweak it a little bit -- would it be OK then?  This is intended as a general reference question that we can point others to, when they ask about specific instances of this sort situation.


What is the remainder of $18!$ divided by $437$?    I'm getting a little confused in the solution. It uses Wilson's theorem    Wilson's Theorem: If $p$ is prime then $(p-1)!\equiv-1(\text{mod } p)$    So it first factors $437$ into primes. So $437 = 19 \cdot 23$. Then from Wilson's theorem notes that $18!\equiv-1(\text{mod } 19)$ so we're part way there, but also says $22\equiv22!(\text{mod }23)$ by Wilson's theorem (really don't know how they got this from $22!\equiv-1(\text{mod }23)$.  Also I'm confused how solving this leads to finding the remainder for $18!$ divided by $437$? I understand getting $18!$ from $19$ but not the $23$ part.


How can I change my login email address for Stack Overflow?   I tried editing from my account, but that didn't work if I used that email during login.


What does 'snapping away' mean here?     Alan, through his website artbusiness.com, attends almost every art   opening that goes down in San Francisco. Like 10 in one night, he's   zipping across town to cover everything that's opening. From the   greatest shows to the shittest, he's there snapping away. He's not   human. We have no idea he does it. How does he stomach it all? We   asked.


Simplify the expression $\binom{n}{0}+\binom{n+1}{1}+\binom{n+2}{2}+\cdots +\binom{n+k}{k}$  My attempt: Using the formula $\binom{n+1}{k}=\binom{n}{k}+\binom{n}{k-1}$  $\binom{n}{0}+\binom{n+1}{1}+\binom{n+2}{2}+\cdots \binom{n+k-1}{k-1}+\binom{n+k}{k}$  =$\binom{n}{0}+\binom{n+1}{1}+\binom{n+2}{2}+\cdots +\binom{n+k-1}{k-1}+(\binom{n+k-1}{k}+\binom{n+k-1}{k-1})$  =$\binom{n}{0}+\binom{n+1}{1}+\binom{n+2}{2}+\cdots +2\binom{n+k-1}{k-1}+\binom{n+k-1}{k}$  I can again use the same formula for the term $2\binom{n+k-1}{k-1}$, and in the next to step to the term $3\binom{n+k-2}{k-2}$.   But I don't think this way the expression will get simplified.   Any help is appreciated.


I’m stuck with the following problem:  Prove that $\log_{2} 3 \in \mathbb{R} - \mathbb{Q}  $ .  Thanks in advance!


Let $f:[0,1] \to [1,2]$, continuous on $[0,1]$ with $1<f(1)<2$. Show that $$\int_0^1\left (f^2(x)-2f(x)\right )\, dx>-1.$$ We have that $$(f(x)-1)^2\geq 0\implies \int_0^1 (f(x)-1)^2\, dx\geq 0 \Rightarrow \int_0^1\left (f^2(x)-2f(x)\right )\, dx\geq -1.$$ Till here we have $\geq$ instead of $>$. How can we show that the equality doesn't occur? Does the same holds also if $f$ is Riemann integrable?


How do I compute $\sum_{k=1}^{\infty} k \cdot p^k$

I have no idea how to compute this infinite sum. It seems to pass the convergence test. It even seems to be equal to $\frac{p}{(1-p)^2}$, but I cannot prove it. Any insightful piece of advice will be appreciated.


General - Are ratings prohibiting the actual reason for this site's existance

Good day all  So I have been a member of the stackexchange site for sometime, about 2-3 years, having made a few contributions, asked a few questions and so forth, however I have noticed over the course of questions (and answers) is that each person, mostly moderators, are more focused on downvoting a question they do not deem fit for the site.   Now naturally, I can't ask a question about Newtons' laws of physics on serverfault, the same way I can't ask a C# question on Mathematica.  Here's the rub, take myself as an example, I am a university student 2nd/3rd year Bachelors in Computer Science, now I am still learning, about Mathematics, about coding methods, algorithms, etc. and say on the side I am trying to get to know Linux beter to migrate to.   Based on this, I might ask, how do I add a desktop icon in Linux Ubuntu Gnome or a similar question, but while asking the question, I find myself at a lack of the correct words, thus I am not able to make myself as clear  as I would like.  Another example would be a problem who's answer is obvious to a mod/user but not to my will be downvoted.  I and many others (this is logical) would not ask a question if I do not know the answer to it, if I ask a stupid question, why downvote, I do not know the answer, so answer me. Else I will ask the question 3 times more, till I get an answer. That is what the site is for, right? Not downvotes, if I wanted negative feedback, I will post something depressing of facebook.  This here is a case, where I am not sure if I am making myself clear, but focus more on actual helping, instead of downvoting, since a 20k rating won't in any way help me with my question being answered!  UPDATE I like to compare life situation's to my time a primary school, since all of us have been there and all of us were equals there  All of you, even you new commers to this quesiton have asked a stupid question or something you didn't get but everyone else did.   Did you teacher/educator say, "Derp, go read you text book again",etc. or did he/she come and actually help you to find the answer to 5*7?   The purpose, for anyone and everyone is to help each other, hence the master-student parable, who are you going to be, a teacher that decides because this kid didn't get it the first time now he will be left behind or will you go and help this kid, and maybe, just maybe you could be of help to someone.  In the mean time, I'll go to yahoo answers from now on,  Thanks Stackoverflow, may you repository of real-world solutions lead man into a new age of thinking, hopefully where someone might show some kind of humanity to another!


Where to find the official paper for the STL-Library?

For my bachelor thesis, I have to refer to some functionality in the STL-Library. Since cplusplus.com, or cppreference.com isn't the best way to reference to the functionalities, I am looking for the official paper for the STL-Library (somehting like the ISO C++-standard drafts respectively papers).


How to speed up LaTeX compilation with several TikZ pictures?

The slowest part is a dozen of diagrams in TikZ.


Time Series of Wound Healing percentages / proportions

I am looking at wound healing over time and have hit a wall with analysis. My data consist of injury cases which are tracked over time. Injury healing is measured as percentage wound area/perimeter change since initial sighting. Each case varies in the number of days since initial sighting and the total number of sightings, with some only seen twice and some seen 5 times.   DV = Area Change  IV = Days, Severity, Location, Type  Random effect = Shark ID, Injury  I want to look at changes over time and be able to statistically explore whether wounds are decreasing in size over time and what factors can influence this. Key points:  My response is a percentage that is dependent on previous records. How can I combat this?   Here is an example of data:  Injury  Shark ID   Name      Date     Days    Severity  Location  Type        Cause      Area Change     Perimeter Change   1       WS198      Naococco  24.6.15     0    Major     Flank     Laceration  Boat                 0                    0 1       WS198      Naococco  8.7.15     14    Major     Flank     Laceration  Boat        74.6858632           63.6698483   1       WS198      Naococco  10.7.15    16    Major     Flank     Laceration  Boat        81.4165492           77.0354486   1       WS198      Naococco  1.8.15     38    Major     Flank     Laceration  Boat        81.9152998            89.704627   1       WS198      Naococco  4.8.15     41    Major     Flank     Laceration  Boat        86.2165258           89.1497158   1       WS198      Naococco  18.8.15    55    Major     Flank     Laceration  Boat        86.1513557           90.3776043   1       WS198      Naococco  19.9.15    87    Major     Flank     Laceration  Boat        97.9639636           93.7961375  1       WS198      Naococco  24.9.15    92    Major     Flank     Laceration  Boat        96.8353572            91.813769      1       WS198      Naococco  3.11.15   132    Major     Flank     Laceration  Boat        99.7190944           98.0207677  1       WS198      Naococco  10.11.15  139    Major     Flank     Laceration  Boat        99.8686985           98.8372268   1       WS198      Naococco  30.11.15  159    Major     Flank     Laceration  Boat               100                  100  2       WS198      Naococco  27.3.16     0    Major     Flank     Laceration  Boat                 0                    0   2       WS198      Naococco  29.3.16     2    Major     Flank     Laceration  Boat         28.902414           17.0816156    2       WS198      Naococco  4.4.16      8    Major     Flank     Laceration  Boat        47.1829361           45.5672997   2       WS198      Naococco  30.5.16    64    Major     Flank     Laceration  Boat        97.4773761           91.7192607  2       WS198      Naococco  13.9.16   170    Major     Flank     Laceration  Boat               100                  100  3       WS198      Naococco  5.10.17     0    Major     Flank     Laceration  Boat                 0                    0  3       WS198      Naococco  26.10.17   21    Major     Flank     Laceration  Boat        65.2492641           67.0574269   3       WS198      Naococco  30.10.17   25    Major     Flank     Laceration  Boat        68.9993994           66.1401071  3       WS198      Naococco  10.12.17   66    Major     Flank     Laceration  Boat               100                  100     Please tell me if this does not make sense or if more information is required to clarify my question.   I know I cannot use a standard lmer model, as follows, because of my response:   healing.lmer <- lmer(Area Change ~ Days + Severity * Type * Location +                 (1 | Shark ID) + (1 |Injury), data = healing)   How can I change my response or my model to fit?


I would like to set the i-th bit to zero no matter what the i-th bit is.    unsigned char pt = 0b01100001;   pt[0] = 0; // its not how we do this...    Setting it to one, we can use a mask pt | (1 << i) but i'm not sure how to create a mask for setting 0, if thats possible.


Is there any way to use command line commands in ruby code ?  Like : Some third party .ipa installer command inside ruby code(reinstall the app between scenarios using a 3rd party installer like ideviceinstaller).


Photoshop plugin to export visual hints on spacing, margins, width & height

Is it possible to produce such design hints (on elements padding, spacing, width, height) automatically in photoshop? Is there any plugin that can potentially do this?


mac hard-drive keeps getting drained until the next reboot

ever since I upgraded my Mac to El Capitan ( now I'm with Catalina ) - my hard drive is acting strange. After a reboot I start with having almost 14GB of free space, and somehow a long the way it's getting lowered as the time goes by .... you can literally see it with watch du -h over time ... Now I have 391Mi free space, and after a reboot it goes by to 13/14GB ... and then it goes again. The behavior sometimes feels like that applications I open - take memory/disk, and when i close them - i'm not getting the memory back ... Activity monitor - doesn't do much for me ... I'm not sure why this is happening, and I wanted to request suggestions / tools - on how to start debugging it .... Edit I know this post was considered "already answered" but this is no a matter of "where my disk space go?" to clean it up. It's something else, example: 08:55:13 $ df -h Filesystem      Size   Used  Avail Capacity iused      ifree %iused  Mounted on /dev/disk1s5   234Gi   10Gi  2.2Gi    82%  484313 2448641047    0%   /  11:47:30 $ df -h Filesystem      Size   Used  Avail Capacity iused      ifree %iused  Mounted on /dev/disk1s5   234Gi   10Gi  1.1Gi    91%  484313 2448641047    0%   /  12:57:27 $ df -h Filesystem      Size   Used  Avail Capacity iused      ifree %iused  Mounted on /dev/disk1s5   234Gi   10Gi  115Mi    99%  484313 2448641047    0%   /  12:57:28 $ df -h Filesystem      Size   Used  Avail Capacity iused      ifree %iused  Mounted on /dev/disk1s5   234Gi   10Gi   84Mi   100%  484313 2448641047    0%   /                               ^^^                              CRAZY  Where, in 3 hours 1G go ?! .... the Mac was idle ... I wasn't near it .. After working (using Outlook/iTerm etc .. ) - after 1 hour - 100MB !? something crazy is going on ..


Xubuntu: Wireless connection using Broadcom BCM4318 fails

I've just installed Xubuntu for the first time and am trying to set up a wireless connection, configuring the connection in Terminal, as I can't see the network icon in the desktop.    I want to configure a wlan0 connection but unsure how to do this.   When I run a ifconfig, I get this:   06:05.0 Network controller [0280]: Broadcom Limited BCM4318 [AirForce One 54g] 802.11g Wireless LAN Controller [14e4:4318] (rev 02) Subsystem: AMBIT Microsystem Corp. TravelMate 2410 [1468:0312] Kernel driver in use: b43-pci-bridge Kernel modules: ssb   lan@alan-TravelMate-2420:~$ lspci -knn | grep Net -A3; rfkill list 06:05.0 Network controller [0280]: Broadcom Limited BCM4318 [AirForce One 54g] 802.11g Wireless LAN Controller [14e4:4318] (rev 02)     Subsystem: AMBIT Microsystem Corp. TravelMate 2410 [1468:0312]     Kernel modules: ssb, wl 06:07.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL-8100/8101L/8139 PCI Fast Ethernet Adapter [10ec:8139] (rev 10) 0: acer-wireless: Wireless LAN     Soft blocked: no     Hard blocked: no   I managed to sort the wlan0 out but now i get the error ""Set Encode" (8B2A)". After research online, I dont think you can connect to a WPA/WPA2 network by using the iwconfig.   alan@alan-TravelMate-2420:~$ iwconfig lo        no wireless extensions.  wlan0     IEEE 802.11  ESSID:"VM1579855"             Mode:Managed  Access Point: Not-Associated   Tx-Power=20 dBm              Retry short limit:7   RTS thr:off   Fragment thr:off           Power Management:off            enp6s7    no wireless extensions.  alan@alan-TravelMate-2420:~$ sudo iwconfig wlan0 key s:password [sudo] password for alan:  Error for wireless request "Set Encode" (8B2A) :     SET failed on device wlan0 ; Invalid argument.   Thanks all in advance :)


I am using ubuntu-9.04.I want to install the new version of Ubuntu.  So I download the new version and insert it in the USB by using startup disk creator but when I go to boot it from usb it shows :  'SYSLINUX 3.63...........Unknown keyword in configuration file boot: _ '   What should I do ?


Why are there directories called Local, LocalLow, and Roaming under \Users\\AppData?

I have a workstation running Windows Server 2008 that's logged into an  domain, and I have a dual boot with Ubuntu Linux. When running Linux, I'd like to be able to use the same Thunderbird profile I use under Windows, so I pointed Thunderbird to use a profile I found under:  \Users\(myname)\AppData\Local\Thunderbird\Profiles   It turns out it was not the correct profile -- it had the right configuration, but the Inbox was an old version. I eventually found out the correct path was:  \Users\(myname)\AppData\Roaming\Thunderbird\Profiles   What's the rationale behind those different places to store application data?


I am curious about how Python interpreter handles function. The code below will generate an error at the line print(x). def foo():     print(x)     x = 1  x = 0 foo()  I would assume that if we expand the code, it will be something like below x = 0 print(x) x = 1  I understand the variable scope in Python. But my real question is, at the line print(x), shouldn't the Python interpreter have no knowledge about the later variable declaration and simply reference the x in the global scope?


IP Canonicalization, do I need to fix it?

I use ryte to analyze my webpage and it gives the following advice:  If the IP (173.###.###.###) of this domain gets called, it should redirect to the real homepage of this domain. Not redirecting requests on the IP can cause duplicate content issues.  Currently my server hosted multiple domains, but it has only one IP address. The main domain(most important domain) is www.example.com  So to improve SEO, should I let the access of the IP address, like below:  https://173.###.###.###   to be redirect to my main domain ?  Thanks


How to Increase the number of columns in application overview(using some extension) and change it's animation

Please refer attached image for clarity.  1)How can I increase the number of columns in the show application? I want to Increase it to 7 or 8. I l This works but is there some extension to available to do this?   2) Also, I don't really like the animation with which the icons load up after I click on show applications button is there any way to change it and make it cleaner probably the animation used in windows 8 for start button.


Where should I start building the community for a new Stack Exchange site?

Changes  to how Area 51 works in the future. Robert describes how the goal is to bring an existing and active community to Area 51 and start building their new Stack Exchange site, not to start the community building process at Area 51. I left a comment there, but I think the matter is worth more elaboration.  If I can't start building the community at Area 51, where and how could I create a community that I could bring there? There typically is no pre-existing community. And even if there was, it's hard to start building a Q&A community if we first have to get somehow magically organized before we can come to Area 51 and even propose having a Q&A site. If nothing else, it would be useful to have some hints or suggestions to start building a community — and know whether the SE network wants to be a part of that early stage.  For example, I am a Finn and I would much like to see a site for . I am not interested in starting just any online community concerning the Finnish language, but a Q&A site at SE. It's hard to find followers if I can't show them something they can act on.  As I understand from the announcement, this aspect of community building is outside the scope of Area 51. Therefore I brought this up here on the general meta. My point is not to rant but to make clear what I do not understand about the new site building process; I genuinely don't know how the system is supposed to work at the very beginning.


Suppose my site - example.com had a subdomain - subdomain.example.com which I have deleted.   How do I redirect the not found error in PHP or the mod_rewrite (.htaccess)?


How to use interface between two activities

I am passing my data from one activity to another activity via intent using a bundle.now this bundle is received by another activity here i am gonna display the values i passed.now when the a button is clicked it is suppose to fire a interface which has a function .There it is showing a null point error.  MainActivity.class  public class MainActivity extends AppCompatActivity implements WILO.Communicator {  int Tap=0,loss=9;  @Override protected void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);     setContentView(R.layout.activity_main);     CountDowntimer(); }  public void CountDowntimer() {     new CountDownTimer(3000, 1000) {         @Override         public void onTick(long millisUntilFinished)         {           Tap+=1;             loss-=2;         }          @Override         public void onFinish()         {             Bundle arg=new Bundle();             arg.putInt("Tap",Tap);             arg.putInt("Loss",loss);             Intent i=new Intent(getBaseContext(),WILO.class);             i.putExtras(arg);             startActivity(i);         }     }.start();  }  @Override public void Restart() {  CountDowntimer(); } }   WILO.class  public class WILO extends Activity {  Communicator communicator;  @Override protected void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);     setContentView(R.layout.activity_wilo);      Bundle arg=getIntent().getExtras();      Button Restart;     TextView Tap,Loss;     Restart= (Button) findViewById(R.id.Restart);     Tap= (TextView) findViewById(R.id.Tap);     Loss= (TextView) findViewById(R.id.Loss);      Loss.setText(String.valueOf(arg.getInt("Loss")));     Tap.setText(String.valueOf(arg.getInt("Tap")));      Restart.setOnClickListener(new View.OnClickListener() {         @Override         public void onClick(View v) {             communicator.Restart();             finish();         }     }); } interface Communicator {     public void Restart(); } }   Error     FATAL EXCEPTION: main                                                                                Process: com.matrix.storm.question, PID: 27805                                                                              java.lang.NullPointerException                                                                                at com.matrix.storm.question.WILO$1.onClick(WILO.java:34)                                                                                at android.view.View.performClick(View.java:4452)                                                                                at android.view.View$PerformClick.run(View.java:18451)                                                                                at android.os.Handler.handleCallback(Handler.java:733)                                                                                at android.os.Handler.dispatchMessage(Handler.java:95)                                                                                at android.os.Looper.loop(Looper.java:136)                                                                                at android.app.ActivityThread.main(ActivityThread.java:5421)                                                                                at java.lang.reflect.Method.invokeNative(Native Method)                                                                                at java.lang.reflect.Method.invoke(Method.java:515)                                                                                at   com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:979)                                                                                at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:795)                                                                                at dalvik.system.NativeStart.main(Native Method)


I'm doing a codefights linkedlist question and I just can't seem to understand why my code is throwing a NullPointerException.   The way I wrote it was that once you hit a position like the third index, it would make the insert's next be the current node's next and then making the new current's next be the insert so that we can insert the node in. I did counter+1 to avoid Null issues but it looks like I failed :/  /*   Insert Node at a given position in a linked list    head can be NULL    First element in the linked list is at position 0   Node is defined as    class Node {     int data;      Node next;   } */   Node InsertNth(Node head, int data, int position) {    // This is a "method-only" submission.      // You only need to complete this method.      Node curr = head;     Node insert = new Node();     insert.data = data;     insert.next = null;      if (curr == null)         return insert;      if (position == 0) {         insert.next = curr;         return insert;     }      int counter = 0;     while (curr != null) {         if (counter+1 == position) {         insert.next = curr.next;         curr.next = insert;               }     curr = curr.next;     counter++;     }     return curr;  }


Calculate the following limit: $\lim_{n\to \infty} a_n = \frac{1}{n^5}(1^4 +2^4+....+n^4)$

Calculate the following sequence: $\lim_{n\to \infty} a_n = \frac{1}{n^5}(1^4 +2^4+....+n^4)$.  I know how to solve this using Riemann sums of the function $x^4$.  I was wondering if there's another way using other methods. Any help would be appreciated.


I want to insert in my script a value (string) that I would read from a text file.  For example, instead of:  echo "Enter your name" read name   I want to read a string from another text file so the interpreter should read the string from the file and not the user input.


Effective Java : Making a class as private nested class (Item 22)

If a package-private top-level class (or interface) is used by only one class, consider making the top-level class a private nested class of the sole class that uses it (Item 22) Effective Java 2nd edition  Referring to the above item from effective Java. I understand that it will promote class inaccessible for other purposes. But I have two doubts on this,  Doing this, we will be moving a class which does a different purpose into other class. For example, an UI class which needs an event listener which is used only by that class, has to be moved into that UI class as per the above recommendation. Then the UI class will be less cohesive by principle as it serves UI rendering and event listening.  Referring to the same example above, if we move the classes used only once as an inner class, then we are closed for extension and open for modification, say we want to change a different listener or inject dynamic listeners then we may not be achieving without modifying the UI class. Hence how feasible is the above approach to do?


How to best handle the storage of historical data?

I'm trying to determine how I should store historical transactional data.  Should I store it in a single table where the record just gets reinserted with a new timestamp each time?  Should I break out the historical data into a separate 'history' table and only keep current data in the 'active' table.  If so, how do I best do that?  With a trigger that automatically copies the data to the history table?  Or with logic in my application?  Update per Welbog's comment:  There will be large amounts of historical data (hundreds of thousands of rows - eventually potentially millions)   Primarily searches and reporting operations will be run on the historical data.  Performance is a concern.  The searches shouldn't have to run all night to produce results.


How do I move Steam games from one computer to another without downloading them again?

So recently I got a new PC, mainly for gaming. I gave my old PC to my brother. Now what I am having trouble with is getting my old steam games on to my new computer, without having to download them. On any other occasion I would have just downloaded them but I live in a very rural area so my internet is pure shit. That being said I also won't be able to share the files over the Internet. So those aren't valid options. All the flash drives in my house are way too small for transporting any games. So there's my question, how do I get these games to my new computer without sucking up all my family's bandwidth and this months Internet?


a dangling participle   The sentence below is from IT by Stephen King.     Here, ganged around a bus stop with a sign reading KENMORE SQUARE CITY   CENTER, he sees waitresses, nurses, city employees, their faces naked   and puffed with sleep.   It seems to have a grammatical error known as a dangling modifier. Since the doer(s) of ‘ganged around’ should be ‘waitresses, nurses, city employees.’ they are supposed to be the subject of the passage, but they aren’t but he is.   Am I right?  One more thing, as this sentence is not so great in grammatical sense, I did revise it as follows. (Just take out the part of ‘ganged around’ and put it behind its subject in meaning, that is waitresses, nurses, city employees.)  Here, he sees waitresses, nurses, city employees, ganged around a bus stop with a sign reading KENMORE SQUARE CITY CENTER, their faces naked and puffed with sleep.  Last but not least, how can someone's face can be naked?  Surely their face can be puffed with sleep but how can it be naked?


What is the difference between the two sentences? 'crying kid' and 'kid crying'

I comforted a crying kid. I comforted a kid crying.   Is there any difference of the two sentences above in meaning?


I am a software engineer but try to keep up with maths as I really enjoyed the subject at school. I just saw a great TED talk:   The talk states that the current largest known prime is $2^{57885161}-1$  This got me thinking - how does one actually prove whether a number this large is prime or not?  Is it just done by brute force via a computer algorithm or are there any well known mathematical techniques for doing so?  I would be really grateful for any pointers as I am eager to learn about these techniques (if they exist).


Being the buff of lore that I am, I come across a lot of Sci-Fi and Magic based stories.  But, my question is simple.  Because of how spells and charms are used in the Harry Potter world, would it not be more appropriate to call Wizards Warlocks?  I mainly ask because to the items used and the health for spells reference in almost every book.  To Clarify: A warlock has always been someone who uses both mana and life to preforms spells, trade offs, or anything resulting in use of Mana, life or both. While a wizard mainly uses a mana pool.  While some do have the knowledge to tap ones life or not merely depends where you are.


Importing 1000s of svg symbols into QGIS 2.18

Does anyone know a way to import 1000s of svg symbols into QGIS without having to painstakingly click on every single XML file to import?  I created SVG files (with xml) of all of the CAMUTCD sign symbols for CA, but it is so painful in QGIS to bring them all in and associate them automatically to the "class" classification in a categorized style process.   I would like to automate the process so it points to the svg directory in QGIS and in style have it automatically find the catagorized "class" value which is identical to the name of the SVG symbol.


I have 3 partitions: one for Windows 7 (ntfs), one for Ubuntu (ext4) and one just for data (ntfs so both operating systems can see them).  My problem is that I had stored some files on the data partition using Ubuntu and when I booted Windows 7 all that data was gone! After that I couldn't find the files even when using Ubuntu.  My files were simply GONE :(  Is there something I can do in Ubuntu or is it just windows problem?


I specifically want to know why the past tense of the word 'have' is used in this phrase. In modern casual English(at least in the US), everyone says ' I should better get going' or they completely omit the word 'had' and say (and even write) 'I better get going'. I've read all posts on the internet regarding this phrase and not one single person questioned the word 'had' in this construction.   Cambridge says this but refrains from explaining the origin of the word 'had' in this phrase:     We use had better to refer to the present or the future, to talk about actions we think people should do or which are desirable in a specific situation. The verb form is always had, not have. We normally shorten it to ’d better in informal situations. It is followed by the infinitive without to:   Could someone please shed light on this?


Tried installing it from command line (sudo apt-get install gwget)  and I get this:  Reading package lists... Done Building dependency tree        Reading state information... Done Package gwget is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source  E: Package 'gwget' has no installation candidate   what does it mean?  I'm using Ubuntu 13.10


How to shutdown the computer when a USB is attached?

I want to perform one security mechanism, but I don't know whether it is possible.  I want to Shutdown/Turn Off PC/System when any USB device attach to it.


How to load a single symbol for my LaTeX document

I simply want to use the \multimapboth symbol, which belongs to the \txfonts package; however I don't want to install this package, as it changes some formatting on my document... How can I do this? Thank you in advance.  EDIT: I'm looking for something like the answer to  question, just don't know how can I find more details about my symbol...


Phrase for "forced to do a lot of mental work"

Today I read a beautiful metaphor for being forced to perform more brain activity than needed if there would have been a proper and clear explanation:     The essay lacked a proper structure: "The reader had to perform mental gymnastics to understand it."   I think it's a beautiful phrase but I would like to have a larger arsenal of similar phrases with a similar meaning.  Do you know any?


How can I create a brace spanning multiple lines on the right side of an itemized list?

I have an itemized list:  \begin{itemize}     \item Lorem     \item Ipsum     \item Sit     \item Dolor     \item Amet \end{itemize}   I want to create an accolade on the right side of 'Lorem' and 'Ipsum', and add a bit of text at the point of the accolade. The level of this text should be between the first and the second line. How can I get this done?


There are no stupid questions - or are there?

I just saw a  from a user asking about a C# stack trace.  It was a valid programming question for someone with little experience, yet it was marked down twice.  I've always believed that there are no stupid questions. Am I wrong?


A friend of mine (an I.T. guy) gave me this tricky probability problem, that I couldn't solve.  $n$ persons go to a cinema that has $n$ seats, and everyone of them has an assigned position written on the ticket.  The first person $p_1$ commits an error and chooses the wrong seat.  Then $p_2,\ldots,p_n$ arrive (in order) and they choose their seat according to the following rule:  "If the assigned seat is free, go there. Otherwise, choose a random seat among the free ones."  What is the probability for the last person $p_n$ to sit in his assigned seat?


How to read exponential expressions, e.g., "2^16"?

How do you say the mathematical function in English:     x^y (or xy)   For example, how do you say      2^16  (or 216)   I know ^ means 'power' or 'exponentiate', but that is the name of the operation, not how you pronounce its use.  If y = 2, it is 'x squared', y=3 then 'x cubed'. What if y is some other arbitrary number?


Title is the question, I tried taking trace both side and got trace of $A$ is zero, now to conclude $A$ is singular, suppose $A$ is non singular, then multiplying both side by Inverse of $A$ we get $B$ is similar to $B+I$, which is impossible as similar matrices have same eigen values where as eigen values of $B+I$ is one unit more than the eigen values of $B$.   Is my solution make sense? Thanks for helping, I am using Android phone so not able to write mathematical symbols as it takes too much time to write.


I remember short sci-fi story about man, who was selected to be a colonist on some planet. He hadn't any superhuman abilities, excluding one - he was extremaly unlucky. Because of some colonization paradigm, sending people like him had a purpose - it allowed to see if a "normal" man can survive on a colonized planet.   It was story from short story collection of some American writer from 70s - 80s.


In Hirsch's Differential Topology, he defines a smooth manifold $M$ to be reversable if it is orientable and admits an orientation-reversing diffeomorphism. I feel confused since I believe that any orientable manifold should admit one such diffeomorphisms. Are there any counter-examples for this?


Convergence of $\sum _{n=1}^{\infty }\:\arctan\left(\frac{1}{n^2+n+1}\right)$

How do I check convergence for this? $$\sum _{n=1}^{\infty }\:\arctan\left(\frac{1}{n^2+n+1}\right)$$  I don't think I should be using the series integral test, since we haven't studied it at the lecture.  I tried using other tests but I can't seem to figure out this one. Anyone have any hints/ideas?


Do we know if the clones in Star Wars are made infertile?

The clone army is created from Jango Fett and so the entire army contains his genetic material.   Is it stated anywhere if these troopers were made infertile? I can see issues if they decided to form relationships and have children, especially if on the same planet and you then had a number of individuals all with the same genetic parent/grandparent.


Get the function name from it's body in Ruby

Say I have a function:  def foo() puts getFunctionIAMIn() end   I want the output to be:"foo" And if I have this code:  def foo1() puts getFunctionIAMIn() end   I want the output to be:"foo1"


How to prove this is a sufficient statistic

Let $X_1,..., X_n$ be independent random variables with densities $$f_{X_i}(x|\theta)=e^{i\theta -x}$$ when $x \geq i\theta$. It's zero when $x > i\theta$. Prove that $T=\min_i (X_i /i)$ is a sufficient statistic for $\theta$. This question is from statistical inference, 2nd ed, by g. casella and r. l. berger CHAPTER 6 QUESTION 2.


why map() function always returns something even if condition statement does not match?_ java script

take a look at this example:   let my_array = [1,2,4,5,6,7,8]    test = my_array.map(element=>{     if(element!==1){         return element     } })   console.log(test)    why map() function always return something if the statement does not match? I know map function iterate over the indexes of array. but why returns null? we said return only if the statement is true. how we can avoid null in return of map()? update: I needed combination of map() and filter(): let my_array = [1, 2, 4, 5, 6, 7, 8] test = my_array   .filter(element => element !== 1)   .map(element => element * 2);  console.log(test)


I want to write a "conditional one" in Latex but I don't know the precise name. It is a one with a double vertical dash that is equal to 1 if a condition is satisfied and 0 otherwise (a kind of Kronecker delta).  Could someone tell what is the name of this symbol and how to write it in Latex ?


increment a "public static int" member of a class every time i create a new object?

I have a header file Customer.h and a source file Customer.cpp.  The Header file is as follow:  #ifndef CUSTOMER_H #define CUSTOMER_H #include "GeoPosition.h"  class Customer{     private:         std::string name;         std::string address;         int pin;         GeoPosition position;      public:         static int anzahl;         Customer();         Customer(std::string name, std::string address, float lat, float lon);         void getPosition();         void setPosition();         std::string getName();         void getPin();         void print(); };  #endif   The source file is as follow:  #include <iostream> #include "Customer.h"  Customer::Customer(){}  Customer::Customer(std::string name, std::string address, float lat, float lon){     this->name = name;     this->address = address;     this->position = GeoPosition(lon, lat); }   std::string Customer::getName(){     return this->name; }  void Customer::getPosition(){} void Customer::setPosition(){} void Customer::getPin(){} void Customer::print(){}  int main(){     return 0; }   My question is that every time I create a new object, I want to increment the member variable Customer::anzahl.  I know that it is not possible to initialize a static member in the constructor like this:     Customer::Customer(std::string name, std::string address, float lat, float lon){         this->name = name;         this->address = address;         this->position = GeoPosition(lon, lat);         anzahl++;     }   Is there a workaround or what can I do to increment anzahl every time I create a new object of Customer?  I get always the following error:  Undefined symbols for architecture x86_64:   "Customer::anzahl", referenced from:       Customer::Customer(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, float, float) in Customer-141888.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)   I can't initialize or reinitialize an static member in the constructor of the source file. What should I do instead?


Is there an easy way in .NET to get "st", "nd", "rd" and "th" endings for numbers?

I am wondering if there is a method or format string I'm missing in .NET to convert the following:     1 to 1st    2 to 2nd    3 to 3rd    4 to 4th   11 to 11th  101 to 101st  111 to 111th    has a bad example of the basic principle involved in writing your own function, but I am more curious if there is an inbuilt capacity I'm missing.  Solution  Scott Hanselman's answer is the accepted one because it answers the question directly.  For a solution however, see .


How to find out which software is opened by which command?

I am new to Ubuntu. I want to use the terminal to open different softwares. Instead of asking everytime which softwares is opened by which command I want to know what is the process to find out which command opens which software.


3rd iterate of a continuous function equals identity function

If $ f: \mathbb{R} \to \mathbb{R} $ is continuous, and $\forall x \in \mathbb{R} :\;(f \circ f \circ f)(x) = x  $, show that $ f(x) = x $.  The condition that $f$ is continuous on $\mathbb{R}$ is crucial for the proof. I can find functions such as $\displaystyle\frac{x-3}{x+1}$ that satisfies  $ (f \circ f \circ f)(x) = x $. I have tried to negate the conclusion to see if there's a contradiction, but got stuck.


How to remove a file with name starting with "-r" using cli

I have been creating odd-named files every once in a while, e.g.  $ls -rthl $-rw-r--r--  1 shamil hep  290 Aug 13 11:58 -rf   And interestingly it is impossible to remove this file with  rm -f -rf   I know I need to escape the special symbols like "-", so the issue is clear. And I used to know the solution, but have since forgotten.  How do I properly delete it?  I have tried things like this  rm -f \-rf   but to no avail.


How to have a process automatically restart

I have a simple home automation program written in Python that reads events from USB and sends commands to a server. It runs on a headless Ubuntu server. Basically, the program does a while true loop. Now if this program should be interrupted for whatever reason, I want it to automatically restart. A few moments or even minutes of down time would not be a problem. What is the easiest way to do this? I could write a cron job to check whether the program is still there, but is there another way to do this that I might not know about?


More often than not, I get more than one really good answer to a particular question that I have posted.  There is no way one can appreciate that more than by up-voting both answers, because we are only allowed to accept one answer, and I have already accepted another answer.     A way to accept more than one answer would be useful.


Inverse function for a non-decreasing CDF

For a CDF that is not strictly increasing, i.e. its inverse is not defined, define the quantile function   $$F^{-1} (u) =\inf \{x: F(x) \geq u \},\quad 0<u<1. $$  Where U has a uniform $(0,1)$ distribution. Prove that the random variable $F^{-1} (u)$ has cdf $F(x)$.  In case of a strictly increasing CDF the proof is quite easy because the inverse is defined. Define $X=F^{-1} (u)$  $$ P\left[X<x \right]=  P \left [F^{-1} (U) \leq x \right]= P \left[U \leq F(x) \right] =F(x)  $$  But how do I accomondate the nondecreasing CDF whose inverse is given by the quantile function? I am a begginer so any help is welcome. Thank you.


How to make items copied into a folder respect its permissions?

I shared a folder of pictures on my OSX 10.6 MacBook with my wife, who accesses it from her 10.5 MacBook.  I created an account for her and gave her read/write permissions on the folder (via the Get Info).  However, when Image Capture dumps new images into the folder, they aren't readable or writeable by her.  I have to click 'Apply To Enclosed Items' for her to get access to them.  I want any file created or copied into that folder to be automatically readable and writeable by her.  Is there a way to set this up?  Thanks!


Given this class  class Foo {     // Want to find _bar with reflection     [SomeAttribute]     private string _bar;      public string BigBar     {         get { return this._bar; }     } }   I want to find the private item _bar that I will mark with a attribute.  Is that possible?    I have done this with properties where I have looked for an attribute, but never a private member field.  What are the binding flags that I need to set to get the private fields?


how to remove GRUB after removing the linux?

I had removed my linux from my system but had not removed GRUB.Everytime i power on my laptop i have to type exit to load up windows.I am unable to find a proper fix for this i have windows 10 Home.How can i remove GRUB and boot directly to my windows?


Use of the preposition "by" along with "which"

There is a difference in the difficulty by which the two different objects can be lifted up.   Is "by" correct here? Does "difficulty by which" sound natural? is there maybe a better alternative?  Thanks a lot in advance!


I am not able to download any app from the App Store on my iPhone 5 which is running iOS 7.1.1.  I have been getting the following error since last week when attempting to download an app.


I'm having trouble to prove the following question:  Supose $\{A_n\}_{n\in\mathbb{N}}$ is a family of sets such that $A_1\subset A_2\subset A_3\subset\ldots$ (it's possible to have $A_n=A_{n+1}$). I need to prove that $$\lim_{n\to\infty}A_n = A_1\cup\bigcup_{n=2}^\infty(A_{n}\backslash A_{n-1}).$$  I'm not sure if this is useful, but I proved that $A_{n}\backslash A_{n-1}$ and $A_{n'}\backslash A_{n'-1}$ are disjoint if $n\neq n'$.  Thank you.


If i have my second display pluged in everything freezes after a couple of seconds after login.  I'm running version 16.04. The grahpics card is a gtx960m and i have driver version 361.42. It only happens if i have a second display pluged in and after rebooting 3 or more time it sometimes doesnt freeze. I dont know what to do.  thanks in advance.


Stop PDFs from displaying inside Google Chrome

When I click on a PDF link in Chrome, it opens automatically inside the browser window. How can I get it to download instead and open with an external viewer?  Update: I implemented djhowell's solution but Chrome still seems to be handling PDF files differently from regular files. When I click a PDF link it opens in Adobe Reader, but normally files download to a folder first.  I also find it weird that this is controlled by Reader and not Chrome. Are there not any file-type controls in Chrome anywhere?


How can I add metadata to NTFS files/folders?

I want to tag different file types (i.e. .pdf, .epub, .iso, .bin, folders,..) using the same descriptive fields. For example i would like a metadata field "type" which would be "eBook" on pdf- and epub-files, "CD-Image" on iso- and bin-files.  I read about Alternate Data Streams (ADS) to make this possible. Does anyone know a good program for Windows 7 to tag different files and search for them? It is important for me, that the metadata is NOT stored in a separate database. I move the files a lot and need to stay flexible (ADSs 'stick' to the files).  Any ideas?


20th century fantasy story with protagonist at the court of a child empress

This is definitely not The Neverending Story!  This story was probably read sometime in the last millennium (possibly in the 1980s) in a science fiction or fantasy magazine that probably had large pages like most fanzines.  It could have have been a fanzine but I think it was a professional magazine.  The young protagonist in the story whose name I forget spent months or years at the court of the fictional child Empress Y'golnac, or however her named was spelled, (reigning over a fictional empire whose name I forget) long enough that she may have become the teen Empress Y'golnac or even the adult Empress Y'golnac.  And I don't remember if the protagonist ever met the empress.  The story may have been part of a series since I remember that at the end the protagonist departed the court and it was said that his education was complete.  I remember thinking that his education to become a wandering rouge, swashbuckler, thief, assassin, adventurer, or mercenary seemed rather complete, but his education to become a wandering philosopher, tradesman, scholar, missionary, wizard, or any sort of a good and useful person, seemed woefully incomplete.


Does a CD-R store information about the computer which created it?

I'm most interested about this in Windows computers. When you burn a CD or DVD, does the disc contain metadata or some other information about the computer which burned it (i.e., computer name, owner, date created, etc.)?


I was wondering if you can share your opinions regarding these two theories about Star Wars: The Force Awakens. One is that Rey is actually the daughter of Luke Skywalker, and the second idea is that she is just an incarnation of the Midi-Chlorian, just like Anakin.


I've just done an upgrade of my lubuntu. I see for example that I have in the system old linux kernels. How can I clean and tidy my OS?


Enlarging an ellipses along normal direction

Given an ellipses, enlarge it along normal direction a fixed length say 1cm. Do we get another ellipses? If so, how to prove ?


Moving a file based on specific filename to specific folder (based on filename)

I am a newbie to this and was wondering how to go about building this shell script:  I have files in directory1 with filenames A1-001.xyz  A29-002.xyz  A82-003.xyz and I wanted to move these based on the 2nd part of the filename e.g. 001  002  003 into directory2 with folder name 001 002 003.  Here is what I have done so far:  for file in /path/to/directory1/** ; do echo "$file" | awk -F '[-]' '{print $2}' | cut -f 1 -d '.' ; done >> dummy.txt   input="dummy.txt" while IFS= read -r file; do echo "$file" | mv "$file" /path/to/directory2/$file ; done    My thinking was putting the output filenames from 1st part into a dummy.txt then reading the filenames and moving it. The 2nd part of the script doesn't seem to be working so are there any suggestions on how to do this?


What software is used to generate the reputation graphs on Stack Exchange?

I'm particularly interested in the zooming functionality which is done very well. Were these graphs generated using off the shelf software or were they coded from scratch?


How to find, from which include file a C preprocessor definition was taken?

How can I find the include file, from which a certain preprocessor definition was found by GCC?  In a successfully compiling C file, I have a strange macro which I do not understand. For a start, I want to see the file where it comes from. The include hierarchy is very deep; is there an easy way to find the source of the macro?  A  has been asked, but the answers tell how to find the definition itself, not its source file.


What are the potential hazards of my passport or visa number being made public?

Should a passport number or visa number be in the class of personally identifying information, along with things like a social security number, credit card number, and so on? If someone nefarious did get my passport number or visa number, what could they do with it, without having the actual passport?  I know you can use an SSN and a bit of social engineering to get pretty much any other identity document, and a credit card number can potentially get you into a lot of online accounts at the very least, but passport numbers aren't so widely linked to other information and I'm curious about what could be done with them.  Of course I'm not actually about to go sharing my passport number around in public - better safe than sorry, after all.


Ideals in polynomial rings generated by linear polynomials

Let $K$ be any field. Is it true that:   If $f_1,\dots, f_k \in K[x_1,\dots,x_n]$ are polynomials of degree $1$, then $I=(f_1,\dots, f_k)$ is all $K[x_1,\dots,x_n]$, or, if it is a proper ideal, then is it prime? In particular, is it true that $K[x_1,\dots,x_n]/I$ is isomorphic to a polynomial ring (in the case that $I$ is proper and hence prime by the statement above)?   If they are true, how can i prove these statements in an elementary but rigorous way?  P.S.: Birth of my question: I found on my book that "affine varieties given by linear equations are irreducibile", so I translated (I don't know if I have made it right) this geometric statement into the analogous algebraic version.


This is my code, for example:  <?php      $arr = array(           array("url" => "http://google.com", "priority" => 2),           array("url" => "http://facebook.com", "priority" => 2),           array("url" => "http://youtube.com", "priority" => 2),           array("url" => "http://stackoverflow.com", "priority" => 1),           array("url" => "http://kickass.to", "priority" => 1),           array("url" => "http://twitter.com", "priority" => 1),           array("url" => "http://example.com", "priority" => 1),      ); ?>   I want the system to randomly display one of the url's on each refresh. I want it to display the higher priority more times than the lower. I need it for banner system, and the ones with higher priority paying more, so they should be seen more.  How to do it?


makebst generated bibtex file - Error: You can't pop an empty literal stack for entry

When I compile the following latex code:  \documentclass[british]{article} \usepackage[T1]{fontenc} \usepackage[latin9]{inputenc} \usepackage{babel} \begin{document} \cite{Lyklema_Fundamentals_1995_} \bibliographystyle{jjap_bml} \bibliography{tmp} \end{document}   With the following .bib file  @book{Lyklema_Fundamentals_1995_,   address = {Cambridge, Massachusetts},   title = {the title},   abstract = {},   publisher = {a publisher},   author = {Lyklema, J.},   month = oct,    year = {1995}}   And using  generated using makebst (), I get the following error:  You can't pop an empty literal stack for entry Lyklema_Fundamentals_1995_ while executing---line 1171 of file jjap_bml.bst (There was 1 error message)   But I cannot understand what the problem is. I can 'view the output anyway' and find the reference is formatted incorrectly as:  "J. Lyklema, the title, (a publisher, Cambridge, Massachusetts1995)."  i.e. there is no comma between the 'location' and 'date' field.   I'd be very grateful for any help.   EDIT: This issue has been resolved by simply editing one line of .bst; please see the first comment by Troy.


Factorial sum estimate $\sum_{n=m+1}^\infty \frac{1}{n!} \le \frac{1}{m\cdot m!}$

Prove that:  $$\displaystyle \sum_{n=m+1}^\infty \dfrac{1}{n!} \le \dfrac{1}{m\cdot m!}$$  I have tried induction on $m$ but it does not work very well. Any suggestion?


Does Canonical provide paid support for individuals?

Does Canonical provide paid support for individuals or is it only for multiple desktop/severer businesses? If not for individuals, is paid support available anywhere?   Thank you.


How to calculate the number of unique 4-combinations for 4 different ranges?

Say I have 4 ranges: 1..10, 1..20, 1..30, 1..40.  How do I calculate the number of unique (i.e. same numbers occur same number of times) 4-combinations for the 4 ranges? Something like this, but more efficient:  cnt = 0 for i in range(1, 10):     for j in range(i, 20):         for k in range(j, 30):             for l in range(k, 40):                 cnt += 1 print(cnt)   Also I need to calculate the number of such combinations having 2 pairs of identical numbers, e.g. (1, 1, 1, 1), (1, 1, 2, 2), etc.


Bash : syntax error near unexpected token ' done '

I wrote this script   #!/bin/bash  if [ $# -ne 2 ] ;   then  echo "\n      Usage : sh $0 BSSID interface   \n"  exit 0; fi while true;   do  reaver -b $1 -i $2 -vv -N -g 10 -S -a  sleep 3603;  done   but i got this messages :  bash T.sh T.sh :line 2: $'\r':command not found T.sh :line 10: $'\r':command not found T.sh :line 27: syntax error near unexpected token 'done' T.sh: line 27: 'done'


Why is Daenerys willing to let Iron Islanders secede but not the Northmen?

Spoilers for Season 7 and Season 6 beyond this point. Please do not scroll if you haven't watched them yet. As the whole question is spoilersome, I won't be using spoiler tags.  Daenerys was predisposed to accept Ironborn independence in S06E09:  Daenerys: You've brought us 100 ships from the Iron Fleet with men to sail them. In return, I expect you want me to support your claim to the throne of the Iron Islands? [...] Theon: He [Euron] murdered our father and would have murdered us. He'll murder you as soon as you have what he wants. The Seven Kingdoms. All of them. Dany: And you don't want the Seven Kingdoms? Yara: Your ancestors defeated ours and took the Iron Islands. We ask you to give them back. Dany: And that's all? Yara: We'd like you to help us murder an uncle or two who don't think a woman's fit to rule. Dany: Reasonable. Tyrion: What if everyone starts demanding their independence? Dany: She's not demanding, she's asking. The others are free to ask as well.  So at that point, she appeared to be willing to accept secession of individual Kingdoms from Iron Throne. To be fair she did ask the Greyjoys this:  You will support my claim as queen of the Seven Kingdoms and respect the integrity of the Seven Kingdoms. No more reaving, roving, raiding, or raping.  Which is kind of vague and open to interpretations (Something which good diplomats always keep an eye out for while conducting negotiations). If some clause or condition is open to interpretations, that often leads to break down in negotiations e.g. IRL in Prelude to Crimean war, a treaty proposed by Great Powers to reduce threat of war between Ottoman Empire and Russian Empire was rejected by Ottomans as some clauses were vague and open to varying interpretations. So If Yara is supposed to accept her as Queen of the Seven Kingdoms and respect the integrity of , she can't bloody well secede, can she? And while Daenerys said others were free to ask as well, she never said that she will allow them. In S07E02 We see:  Tyrion: I can't speak to prophecies or visions in the flames, but I like Jon Snow and I trusted him. And I am an excellent judge of character. If he does rule the North, he would make a valuable ally. The Lannisters executed his father and conspired to murder his brother. Jon Snow has even more reason to hate Cersei than you do. Daenerys: Very well. Send a raven north. Tell Jon Snow that his queen invites him to come to Dragonstone and bend the knee.  Here she is not even willing to view him as an ally, she wants him to bend the knee and be her subject, contrary to her earlier position re the Ironborn. In S0703 She said:  Tyrion: Pledge your sword to her cause. Jon: And why would I do that? I mean no offense, Your Grace, but I don't know you. As far as I can tell, your claim to the throne rests entirely on your father's name, and my own father fought to overthrow the Mad King. The lords of the North placed their trust in me to lead them, and I will continue to do so as well as I can. Daenerys: That's fair. It's also fair to point out that I'm the rightful Queen of the Seven Kingdoms. By declaring yourself king of the northernmost kingdom, you are in open rebellion.  Isles and Rivers (Later both were separated into Iron Islands and Riverlands) was one of the 7 Kingdoms Aegon the Conqueror took. So what about the westernmost Kingdom? What gives? Why be prepared to let the Iron-Islands secede but pressure the Northmen to accept her as Queen? If Torrhen Stark swore a vow to be subject to Aegon the Conqueror and his heirs and successors, so did Vickon Greyjoy. Was she just fooling the Greyjoys with vaguely worded promises?


unable to convert parameter to apex type got arraylist

Is there a way to pass a sObject with RemoteAction from JavaScript to Apex?  I want to create a bunch of sObjects. What is the right way to pass their information from JS to Apex with RemoteAction?  What I tried is populating a JS object. And then pass its value to the apex controller. Here's how I populate the js object:  stockObject.Location__c = $j('.select-store-div option:selected').val(); stockObject.Product__c = productsArray[key]['Name']; stockObject.LocationRetailPrice__c = productsArray[key]['newPrice'];   However it says it's unable to convert the types(expecting sObject, got arraylist). Is there a way to pass a sObject as a whole to the controller rather than a list of strings?


In The Force Awakens, we see Rey pouring some flour-like polystarch rations into water so that the flour amazingly transforms into something that looks like bread. What are these rations? Is there any documentation of the fictional chemistry and biology that makes the starch rations behave as they do?


Since I study 3 years i ask myself very often where does this equation come from? $$e^{i\theta} = \cos(\theta)+i \sin(\theta)$$ Is it found by series expansion?


Transparent background in a multiband raster using GeoServer

I have a raster with a black collar (background). I want to set those black pixels to transparent. The problem is that the values of the pixels have three bands (Red, Green and Blue) and I don't know how to define a rule in the .SLD to set those pixels which value is (0, 0, 0) to transparent.    Any idea on how to do this?   My question has been associated with another question. The answer to the other question resolves the problem for a single-band raster but in my case I have a multi-band raster, so the answer I need is different.


How is the values in this array which is passed as a argument to the method, change on the run of the method

I'm newbie to java. I have a global array defined as private int dataRightTemp[]=new int [4]; and in the middle of the code, this array is being passed to a method as a argument(below I have attached the code). Within this new method the values of the prior  global array which is dataRightTemp is being changed from a calculation which uses the passed array in theparameters of the method. When the calculation is finished, and new values are set to the dataRightTemp,  how is the values of thearray in parameters of the method be changed, Can anyone help me to figure this out. Thanks in advance.      public class Demo{         private int key[]={1,0,1,0};     private int dataBlock[]={1,1,1,0,1,0,1,1};     private int dataLeft[]=new int [4]; // for left part the plain text      private int dataRight[]=new int [4];    //for right part of the plain text     private int dataLeftTemp[];     private int dataRightTemp[]=new int [4];        public void roundingStart(){           for(int i=0;i<4;i++){             //           AND function             dataRightTemp[i]=key[i] & dataRight[i];             //              XOR function             dataRightTemp[i]=dataRightTemp[i]^dataLeft[i];          }          dataLeft=dataRight.clone();         //      printResults();          printFirst();         roundingRest(dataLeft,dataRightTemp);       }       public void roundingRest(int leftArray[],int rightArray[]){          System.out.println("Before");         for(int x: rightArray){             System.out.print(x);         }          System.out.println();           for(int i=0;i<4;i++){             //          AND function             dataRightTemp[i]=key[i] & rightArray[i];             //          XOR Function             dataRightTemp[i]=dataRightTemp[i]^leftArray[i];          }         System.out.println("right after");          for(int x: rightArray){             System.out.print(x);         }         System.out.println();         System.out.println();   }     public void main(String args[]){      roundingStart();   }   }   Following are the received outputs:  Before 0100  After 1011


Quick transfer from Concourse B to Concourse A for connecting flight

I and my wife (both aged above 60) will be flying from Dallas to Kolkata through Dubai airport. EK 222 will probably arrive at Concourse B and the connecting flight EK 572 will leave from Concourse A--both in Terminal 3. But I have only 1 hour to board the connecting flight.   Please give me step by step directions to reach the departing gate very quickly.   By the way, may I use e-boarding pass facility to quicken the process ?  Thanks in advance.


Allocating Non-Standard Memory Quantities to Virtual Machines

When setting up virtual machines on the various host systems I've used, be they Hyper-V, VMware or KVM, I have always allocated RAM in amounts that match physical memory configurations - e.g. to add 1GB of RAM I would add 1024MB, for 6GB of RAM I would add 6 x 1024 = 6144MB.  I realised that I've never thought about why I do this, it was just The Way Things Were Done at a previous workplace that I never questioned.  So, my question is, aside from the fact that it means virtualised operating systems can neatly round the allocated RAM to the nearest GB, are there any disadvantages to allocating RAM in quantities that are not powers of two, or multiples thereof? e.g. would there be any downside to adding 500MB of RAM, 750MB of RAM, or 1001MB of RAM?  Alternately, are there any advantages that would make this the recommended way of doing things?  I've left the question open-ended as far as host OS as I'd be interested to see if there are different considerations for the different hosts.


I'm looking for a good word to express the concept of "the right thing being done" but avoiding the connotations of the two most obvious words:   Justice - has too much of a connotation of being legalistic or enforced by the police. Morality - has too much of a connotation of "traditional values" and puritanism.   Is there a better word?


Test class for pagereference in a method

I am unable to get code coverage for my pagreference, my code is   code:   public class selectedcase { public list<recordtype> record {get; set;} public id ids;         public selectedcase(){  record =[select id, name from recordtype where sobjecttype='case']; }  public pagereference submit(){ ids = system.currentpagereference().getparameters().get('rid'); if(ids == null){ apexpages.message newmsg = new apexpages.message(apexpages.severity.error,'Please select atleast one recordtype'); apexpages.addmessage(newmsg); return null; } else{   pagereference newpage = new pagereference('/500/e?retURL=%2F500%2Fo&RecordType='+ids+'&ent=Case'); newpage.setredirect(true); return newpage; }   And test class is   @istest  public class selectedcasetest {     public static testmethod void testselect(){     selectedcase selnew = new selectedcase();       recordtype rec = new recordtype();         rec.Name ='testname';         rec.SobjectType='case';          pagereference pager = page.recordtypes;         test.setCurrentPage(pager);         system.currentpagereference().getparameters().put('Recordtypeid', rec.Id);         system.assertEquals(rec.Id, rec.Id, 'Please select atleast one recordtype');         selnew.submit();         }     }   Please help.  Thank you in advance.


sudo issue during echo something to a root file

I have a problem, during write something into a root file:  $ ll /sys/bus/usb/devices/3-2/power/wakeup -rw-r--r-- 1 root root 4096 Feb 16 17:28 /sys/bus/usb/devices/3-2/power/wakeup $ sudo echo disabled > /sys/bus/usb/devices/3-2/power/wakeup bash: /sys/bus/usb/devices/3-2/power/wakeup: Permission denied   even it did not ask me for password.    How can I solve this? Why I can't use sudo directly?


What lens should I use for a candid potrait photos

I'm going to start my career in photography. I have a canon 70D plus prime lens which is 18 to 135mm. For portrait shot I'm not getting more blured background. So can you suggest me which lens is suitable for the candid and potrait shots 35mm, 40mm, or 50mm canon lens


Time usage in "It's time we got back there"

Why do we use the past in the sentence "It's time we got back there." ?  I would have used the present and I would have said "It's time we get back there".


Why is Matrix Multiplication Not Defined Like This?

I'm sure everyone already thought about this at least one time. Why matrix multiplication is not defined the way showed below?  $$\left( \begin{array}{ccc} a_{11} & a_{12} & \ldots \\ a_{21} & a_{22} & \ldots \\ \vdots & \vdots & \ddots \end{array} \right) \cdot \left( \begin{array}{ccc} b_{11} & b_{12} & \ldots \\ b_{21} & b_{22} & \ldots \\ \vdots & \vdots & \ddots \end{array} \right) = \left( \begin{array}{ccc} a_{11}\cdot b_{11} & a_{12}\cdot b_{12} & \ldots \\ a_{21}\cdot b_{21} & a_{22}\cdot b_{22} & \ldots \\ \vdots & \vdots & \ddots \end{array} \right) $$  I know this definition has it's limitations. The product only works with same order matrix and any matrix with some zero entry won't be invertible. But this definition is associative, commutative, has identity element, the distributive works, is simpler and more intuitive.  I have no problem about the classic definition, but this definition also has good properties, why it is never used?


what should I do to make my RSA signatures secure? If "plaintext RSA" is not secure, is there some sort of "RSA on steroids" I am not aware of? Could anybody tell me what is it?  I read a Wikipedia article "Digital signature". In the  chapter we can see:     ...Soon afterwards, Ronald Rivest, Adi Shamir, and Len Adleman   invented the RSA algorithm, which could be used to produce primitive   digital signatures (although only as a proof-of-concept – "plain"   RSA signatures are not secure   I searched for "rsa signature is not secure" but didn't find anything legible. Does anybody know why are RSA signatures are not secure and how can I make it secure by not doing "plain" signatures? Are there any tricks? The thing is that recently I implemented RSA in my code for my project and was so excited to see that I can sign and verify things with RSA...


Is this a correct translation from english into symbolic logic?

"You can fool some of the people all of the time, and you can fool all of the people some of the time, but you can’t fool all of the people all of the time." (Abraham Lincoln) Let  $P$ be "fooling some of the people all of the time", $Q$ be "fooling all people some of the time", $R$ be "fooling all of the people all of the time".  $(P \lor Q) \rightarrow \neg R$ Is this a correct translation in propositional logic?


Flag button not working on BlackBerry 10

Using the  built-in browser, I can't hit the flag button on Stack Exchange sites. The edit button next to it works perfectly, but the word 'flag' is behaving as though it's not a link of any sort at all. Nothing of any sort happens when I click on it, not even the highlighting that the browser uses to help you make sure you've hit the right link, which suggests that it's the link, not the resulting popup.


I have the intension of buying a Drill, At shops, I see the corded and cordless Types, Although the cordless drill is more handy and portable, I always have a little doubt about that it's effectiveness and efficiency might not be as the corded type.....Is it true and also is choosing a cheaper manufacturer going because they are cheaper going to affect the quality of the Drill?


How to calculate the probability of rolling 6 at least 5 times in a row, out of 50 tries?

If I roll the dice 50 times, how do I calculate the chance that I will roll 6 at least 5 times in a row? Why this problem is hard  With 5 tries this would be easy: take $(1/6)$ to fifth power. With 6 tries this is manageable; take the probability of rolling 6 the first five times, add the probability of rolling 6 the last five times, then subtract the overlap (all six results are 6). Given two overlapping sets of 5 rolls, the probability that one is all 6's is not independent from the probability that the other is all 6's. In principle this could be continued, but inclusion-exclusion gets out of hand. There has to be a better way; what is it?


Best book for first order predicate logic

I am having problem understanding first order predicate logic, rules of inferences, proof by natural deduction. From which I should read them for better understanding. Also if there any websites or lectures that are useful in this. Thanks


Applying Zorn's Lemma to natural numbers

Zorn's Lemma states that if every chain $C$ in a partially ordered set $X$ has an upper bound then there is at least one maximal element in $X$.  Let $n\in \mathbb{N}$, $C_n \subset \mathbb{N}$ be the set containing the natural numbers $\{1,\dots,n\}$. Then if $k\le n$, $C_k\subset C_n$, so $C_n$ is a chain. Also, $C_n$ has an upper bound, such as $n+1$. But what is the maximal element of $\mathbb{N}$?  There's something I don't get in Zorn's Lemma statement.


Ubuntu 16.04 64bit. apt-get update hangs here..  $ sudo apt-get update  Hit:1 http://us.archive.ubuntu.com/ubuntu xenial InRelease                                                 Get:2 http://security.ubuntu.com/ubuntu xenial-security InRelease [94.5 kB]                                Get:3 http://us.archive.ubuntu.com/ubuntu xenial-updates InRelease [94.5 kB]        Get:4 http://us.archive.ubuntu.com/ubuntu xenial-backports InRelease [92.2 kB] Fetched 281 kB in 2s (126 kB/s)      Don't know what it's doing, but top reports a new process:    PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND                                                                                2476 root      20   0  134232  37976   9708 R  99.7  0.1   3:36.12 appstreamcli                                                                                The graphical updater doesn't make it to the end either. How can I fix this?


Regex testing a phone number: only digits or no more than a single space, hyphen or period

I am attempting to test a "phone number input", so I am testing against the presence of at least one non-digit or two or more spaces, hyphens or periods. The issue is, it returns a hit on any single space, hyphen or period. I'm obviously getting it wrong. Here's the code pl0x help:  var re = /[^0-9]{1,}|[-.\s]{2,}/   Using javascript.


How to fix task manager memory column if it shows lies

I have a problem in showing memory in task manager with memory and paging columns. Why it shows so small size usage? And maybe anyone knows how to fix it?  Here is a screenshot(working set, memory, page pool) sorted by most consuming:


Return the first n records per group Oracle SQL

My problem  I want to return the top n rows per group ordered by a date in Oracle 10g  My table  EMPLOYEE|START_DATE|DEPARTMENT Amy     |01-02-1901|Sales Edwina  |01-02-1902|Mergers Tawnee  |01-02-1904|Legal Trudy   |01-02-1998|Sales Tanner  |01-02-1967|Sales Kelly   |01-02-1954|Mergers Jenny   |01-02-1991|Sales Jacinta |01-02-1924|Legal Suzanne |01-02-1976|Legal Jacqui  |01-02-1989|Legal Jill    |01-02-1989|Mergers Kate    |01-02-1998|Mergers Jane    |01-02-1900|Sales Louise  |01-02-1912|Mergers Kim     |01-02-1976|Sales Cara    |01-02-1955|Sales Kirsten |01-02-1933|Legal Sarah   |01-02-1998|Legal   Desired outcome  EMPLOYEE|START_DATE|DEPARTMENT Jane    |01-02-1900|Sales Amy     |01-02-1901|Sales Tawnee  |01-02-1904|Legal Jacinta |01-02-1924|Legal Sarah   |01-02-1998|Legal Edwina  |01-02-1902|Mergers Louise  |01-02-1912|Mergers   What I've tried  (select * from  employees where  DEPARTMENT = 'Sales' and rownum <3;) UNION (select * from  employees where  DEPARTMENT = 'Legal' and rownum <3;) UNION (select * from  employees where  DEPARTMENT = 'Mergers' and rownum <3;)   REALLY ugly query  I'm thinking if there was a way you could you an   OVER (PARTITION BY DEPARTMENT)   but from what I read, this needs to be preceded by an analytic function (count, sum whatever). Is there a more elegant, inexpensive solution?


Are there plans to get the @ name completion working on the mobile website?

I use Stack Exchange site through my phone (iPhone) way more frequently than I do through the desktop website. When I do that, I really wish that typing the @ symbol would offer the same auto-completion of names that it triggers on the desktop site.  Is anyone working on getting that feature working? If not, I'd like to ask that you prioritize it.


Ingestion of cellulose digesting prokaryotes?

If humans digest cellulose digesting prokaryotes,  can  we start digesting cellulose like cows?


Cannot replicate a 95% CI using: Beta ±1.96*SE

I am having a lot of difficulty figuring out why I cannot calculate a 95% CI by hand with one set of data; but I can using the same process with a different set of data.  Drawing on OLS results; I am doing the following calculation:  beta ± 1.96 * standard error   Here are two sets of data in Python if you wanted to execute it yourself.  rng = np.random.RandomState(42) x = 10 * rng.rand(50) x2 = 10 * rng.rand(50) y = 2 * x - 1 + rng.randn(50)  X_1 = np.column_stack((np.repeat(1, len(x)), x, x2)) y_1 = np.vstack(y)  model = sm.OLS(y_1, X_1) res = model.fit() print(res.summary())  model result for x1: coef: 1.86, std err: 0.043, lower ci: 1.78, upper ci: 1.954   Calculate 95% CI by hand to replicate the result above:  lower: 1.86 - 1.96*0.043 = 1.77 ; correct upper: 1.86 + 1.96*0.043 = 1.94 ; correct   Now, do the same thing with different data.  y = np.array([10, 7, 2, 8, 10, 6, 2, 10, 8, 5]) x1 = np.array([2, 1, 2, 0, 1, 3, 11, 0, 5, 0]) x2 = np.array([5, 1, 0, 2, 0, 0, 0, 0, 12, 2])  y = np.vstack(y) X = np.column_stack((np.repeat(1, len(x1)), x1, x2))  model = sm.OLS(y, X) res = model.fit() print(res.summary())  model result for x1: coef: -0.52, std err: 0.265, lower ci: -1.15, upper ci: 0.10   Calculate 95% CI by hand to replicate the result above:  lower: -0.52 - 1.96*0.265 # -1.03 - not correct upper: -0.52 + 1.96*0.265 # 0 - not correct


Is it better to use "i" or "?" for tooltip/help content on mobile

Right now the interaction is that when you click the small "i" icon next to a questions, additional text displays for clarification. (Shown in the example "Carrying anything that makes it heavier?")  My questions are: - Is it better to use "i" or "?" for this icon?   Is it ok to have the help content appear inline like this or is it better to have it in a tooltip box? I like it this way because it doesn't cover the existing content and it doesn't have to be closed out to continue. In material design how would you do this type of tooltip? The only documentation I can find  and it's not quite the same scenario.


Best way to show an "unactivated" part of an app?

I've got a dashboard that shows both active and unactivated parts of an app (users opt in to a service). Is there any standard for the best way to show an element/section is unactivated? Any way to encourage activation?    I'm sure there are numerous examples out there of apps that have "can't use this till you pay" section, but I can't seem to find anything that would illuminate a standard practice here.  Thanks!  edit: I'm picking this up from someone else's design. Here's my starting point:


Cannot get awk to work properly inside make

I want to parse a file and bracket each line with #ifndef and #endif.  For example, starting with:  #define X 1 #define Y 2 #define Z 3   I want to generate:  #ifndef X #define X 1 #endif #ifndef Y #define Y 2 #endif #ifndef Z #define Z 3 #end if   This awk script works in console, but it doesn't work inside make:  awk '{printf "#ifndef %s\n%s %s %s\n#endif\n", $2, $1, $2, $3}' globals.tmp > globals.h   When run inside of make, it outputs as follows:  awk: cmd. line:1: {printf "#ifndef %s\n%s %s %s\n#endif\n", , , , } awk: cmd. line:1:                                           ^ syntax error awk: cmd. line:1: {printf "#ifndef %s\n%s %s %s\n#endif\n", , , , } awk: cmd. line:1:                                             ^ syntax error awk: cmd. line:1: {printf "#ifndef %s\n%s %s %s\n#endif\n", , , , } awk: cmd. line:1:                                               ^ syntax error awk: cmd. line:1: {printf "#ifndef %s\n%s %s %s\n#endif\n", , , , } awk: cmd. line:1:                                                 ^ syntax error awk: cmd. line:1: {printf "#ifndef %s\n%s %s %s\n#endif\n", , , , } awk: cmd. line:1:                                                  ^ unexpected newline or end of string   So it's obviously not pulling in the fields. I tried playing around with $1, $2, and $3: adding single, double and triple backslashes, changing the quotes, etc., nothing works. I know awk and make can be quirky, wondering if there is some "gotcha" I'm not getting?


System Disk space less than what the Disk viewer shows?

I installed Ubuntu by shrinking my Windows partition in gParted to get 140GB of free space, then chose the "something else" option in the installer, gave my Ubuntu partition 128GB, and the remaining 12GB to swap. The installer showed my Ubuntu partition as having 127.7GB and my swap as 12.3GB for some odd reason, but I just went ahead with it.  The install went well, but the disk space in System Details shows 125.6GB, and the Disk viewer shows 128GB for Ubuntu and 12GB for swap. Is that missing 2.4GB simply what was taken by the OS files?  Also, is it possible to verify that my swap space is set to 12GB and not 12.3GB?


Is anybody able to show the clock in beamer?

I wonder whether there is anyone who is able to show the clock in a beamer presentation. I have not come across any working example. Following the tdclock documentation, I compiled the MWE below. It shows only blank boxes where the date and time are supposed to appear, see pdf attached. I would appreciate any advice.  \documentclass[xcolor=dvipsnames]{beamer} \usepackage{beamerthemeshadow}  \usepackage[font=Helv,timeinterval=60]{tdclock} \setbeamertemplate{headline}{\initclock\large{\tdyear-\tdmonth-\tdday \quad\tdhours:\tdminutes}}  \usepackage{xcolor}  \title[]{Main Title} \author[]{Zilore Mumba} \institute[]{Unza}  \usepackage[font=Helv,timeinterval=60]{tdclock} \setbeamertemplate{headline}{\initclock\large{\tdyear-\tdmonth-\tdday\quad\tdhours:\tdminutes}}  \usepackage{xkeyval} \usepackage{hyperref}  \begin{document}  \initclock  \title{Beamer Presentation} \author{Zilore Mumba}  \begin{frame} \titlepage \end{frame}  \begin{frame}\frametitle{first slide} content \end{frame}  \end{document}