Earth sends a few (4?) couples on a short near-light speed round trip to see how they are affected, not telling them some important facts.  They evolve very rapidly, first dropping all social mores, then increasing in intelligence/power well beyond Earth people, arriving home angry(?). Was included in a collection with a short by John Varley (Persistence of Vision).

The story in question featured, as the vague title suggests, a "space mission" that is really a cover for forcing a bunch of really smart people to be in close proximity to each other for long enough that they can truly evolve their collective intelligence. I recall them developing new maths and, e..g, "farseeing" and eventually figuring out that while there was no planet at the end of their journey as they were told, they were able to construct one for themselves.


I am in the Hostel and we are provided with Wi-Fi connectivity.The problem is that the IP address that is assigned to my machine works only for 5-6 hours. I want to refresh the IP address so that i can get access to net for 24 hours.  I have tried the commands like  ipconfig/release   and then  ipconfig/renew   but my IP address remains the same. I even to switch the router on and off and even forget the network on my pc but nothing seems to change my IP address. How can i force my IP address to refresh and renew??

I'm troubleshooting a certain issue with my DHCP configuration, and need my Windows machine to ask for a "fresh" IP address, so I can see which address DHCP server gives by default.   When I do ipconfig /release followed by ipconfig /renew, Windows "proposes" its old IP address to the DHCP server (just checked with Wireshark, initial "DHCP Discover" message has Option-50 (requested IP address) with Windows machine's old IP).  Tried disabling/enabling network adapter. Same behavior.  Question: How can I force Windows to just ask for a new IP address, without proposing its old IP address.


At least I need a reference to some book.

How to show equinumerosity of  the powerset of $A$ and the set of functions from $A$ to $\{0,1\}$ without cardinal arithmetic?  Not homework, practice exercise.


Let's say I cast  on .   Before this resolves, my opponent casts  on the Llanowar Elves.  Giant Growth resolves, making the Llanowar Elves a 4/4. When the Strangling Soot resolves, is it able to destroy the Llanowar elves, or does it do nothing because Llanowar elves no longer has a toughness of 3 or less?

When you have a card like  which reads "Exile Target Creature with power 3 or less", as I understand it, it becomes untargetable if the opponent's creature power increases thanks to a pump spell like .  But what if the Disregard is already on the stack and targeting; and they respond with Brute Strength? I'm pretty sure (and my opponent with Brute Strength was certain) that it won't exile the creature, but I don't know which rule states this, and there's no gatherer ruling on the spell.


I am validating international phone number which may have + or 0 leading with country code and space and phone number after space for this tried reglar expression with '\s' but it is failing.Why it is failing? For eg. +65 3333311  Tried with below regular expression  ^([0|\+[0-9]{1,6}[\s]?)?([0-9]{8,10})$

I'm trying to put together a comprehensive regex to validate phone numbers. Ideally it would handle international formats, but it must handle US formats, including the following:   1-234-567-8901 1-234-567-8901 x1234 1-234-567-8901 ext1234 1 (234) 567-8901 1.234.567.8901 1/234/567/8901 12345678901   I'll answer with my current attempt, but I'm hoping somebody has something better and/or more elegant.


Here is the question I wanted to answer letter(c) of it: Let $R$ be a ring (with 1), and let $H$ be the cyclic subgroup of $(R,+)$ generated by $1.$ The characteristic of $R$ is $n$ if $H\cong \mathbb{Z}_{n},$ and is $0$ if $H \cong \mathbb{Z}.$\ (a) Show that, if $a \in R$ has additive order $m,$ then $m$ divides the characteristic of $R.$\ (b) Prove or disprove: If the characteristic of $R$ is $0,$ then $(R,+)$ is torsion free.\ (c) Is there a ring $R$ such that $(R,+) \cong S^{1}$ ? Here is a solution to letter $(c)$: The answer is No. And here is the justification: $S^{1}$ is defined as $\{ z \in \mathbb{C}^{*}\ :\ |z|=1 \}$ and if $a,b \in S^1,$ then $|a| = |b| = 1$ but $|a + b| \leq |a| + |b| = 2$ and so $a + b$ is not necessarily in $S^1.$\\  On the other hand, $(R, +)$ form an additive group and so it is closed under addition.  Hence, $$(R,+) \ncong S^1.$$   Here is a hint to the correct solution: Assume $na = 0$ and $nb = 1$ for $a,b \in R, n \in \mathbb{Z}^{+}.$ Then $$a = a. (nb) = (na). b = 0 .b = 0 $$ Also, I found a solution here  My questions are: 1- In the link I mentioned, the author is using the idea that $S^1$ is divisible, I do not know why that is correct, could anyone explain that for me please? 2-Also, I do not understand the general idea of the solution, could anyone explain it for me please? 3- My understanding is that we are using the idea that $R$ is a ring with unit so it has multiplicative and additive identity, but why $a$ can not be zero in the hint?

Define $S^1 = \{ z \in \mathbb{C^*} \: : \: |z| = 1 \}$. My question is, does there exist some ring $R$ such that $(R, + )$ is isomorphic to $S^1$? My intuition says no but how would I go about showing that.


I ran composer global require drush/drush:dev-master. I'm not sure how to  resolvirthis issue as it seems that the package isn't found anymore. Do I have to update somehow?  Your requirements could not be resolved to an installable set of packages.    Problem 1     - Installation request for drush/drush dev-master -> satisfiable by drush/drush[dev-master].     - drush/drush dev-master requires codegyre/robo ~1.0.0-beta1 -> satisfiable by codegyre/robo[1.0.0-beta1] but these conflict with your requirements or minimum-stability.  Installation failed, deleting ./composer.json.

I'm transitioning a Drupal 6 site to Drupal 8.1 so following the official instructions, I set up a new install in its own directory. Since this is only one site, I followed the instructions to put my database credentials in sites/default/default.settings.php after the declaration of the $databases array.  Running drush --status returns the following.  Drush version          :  8.1-dev                                           Drush temp directory   :  /tmp                                              Drush configuration    :                                                    Drush alias files      :                                                    Drupal root            :  /media/psf/Home/apps/newp                         Drupal Settings File   :  MISSING   Since this Drupal is 8.1-dev that must mean I need to upgrade it. Since this is a global install using Composer, I run composer global update.     Your requirements could not be resolved to an installable set of   packages drush/drush dev-master requires codegyre/robo ~1.0.0-beta1   Checking the drush-ops page on github doesn't show any anomalies like this nor my Google search.   What am I overlooking?


Qn: If the product of two integers is  $2^7 \cdot 3^8 \cdot 5^2 \cdot 7^{11}$ and their greatest common divisor is $2^3 \cdot 3^4 \cdot 5$, what is their least common multiple?  I have issue with this question please help me solve it.  I tried assuming that lcm is $x$ =. Then,        Gcd $\cdot x = 2^3  \cdot 3^4 \cdot 5x$. And, product factors /Gcd $x$

I'm looking for an understandable proof of this theorem, and also a complex one involving beautiful math techniques such as analytic number theory, or something else. I hope you can help me on that. Thank you very much


I have been working out for a case-insensitive search for hours and I still can`t find a solution...  I have data stored in MongoDB and formatted like this :  {   id: 12345,   name: "foo",   area: ["US","California"],   ... }   And I wanna use query to find results, as a list, that area partially matches the area string. For example, if I want to find people who are in us, with lower case. My method looks like this:  public async Task<IEnumerable<Restaurant>> GetByArea(string area) {      var result = await _context.Users           .Find(user => user.Area.Contains(area))           .ToListAsync();       try      {           return result;      }      catch (Exception e)      {           return null;      } }   How should I modify my code to conform case-insensitive search? The IEqualityComparer's methods won't be translated to MongoDB query.

Is there a way to make the following return true?  string title = "ASTRINGTOTEST"; title.Contains("string");   There doesn't seem to be an overload that allows me to set the case sensitivity.. Currently I UPPERCASE them both, but that's just silly (by which I am referring to the  issues that come with up- and down casing).  UPDATE This question is ancient and since then I have realized I asked for a simple answer for a really vast and difficult topic if you care to investigate it fully. For most cases, in mono-lingual, English code bases  answer will suffice. I'm suspecting because most people coming here fall in this category this is the most popular answer.  answer however brings up the inherent problem that we can't compare text case insensitive until we know both texts are the same culture and we know  what that culture is. This is maybe a less popular answer, but I think it is more correct and that's why I marked it as such.


How do you clean tupperware that is always so stained after pasta sauce has been in it

I like using microwaveable plastic containers to bring my lunch in as they are my lighter than the Pyrex/glass versions. However, reheating my food up creates unsightly stains.


I understand that showing function completeness is to use the symbols to generate the same truth values as if the other symbol would allow.  Out of the symbols {∧,∨,→,↔}, how would you generate the negation symbol '¬'

In my textbook I am introduced to two ways to prove that a set of connectives is functionally incomplete. The first one is to prove that it has a property that not all truth functions do.  I am stuck at finding one such property for $\{\lnot\}$ (and I can't believe I am so dumb to be stuck...). I have two ideas: first one is to prove that $\lnot$ always returns a $F$ for any true argument (thus rendering a truth function that returns $T$ from a true arugment impossible).      Prove that if $\phi$ is built up using the variable $P$ with $\lnot$, and $v$ is the truth assignment s.t. $v(p)=T$, then $v(\phi)=F$.      Induction on the number $n$ of connectives in $\phi$.      Base case $n=0$: $\phi=P$ - there isn't any $\lnot$ to talk about, so it is vacuously true.      Assume that it holds true for $\le n$, prove that it holds true for $n+1$.      $\phi=\lnot \psi$: Number of connectives within $\psi=n$, thus it holds true for $\psi$. Therefore $v(p)=T\to v(\psi)=F$.   As you can see, if $v(\psi)=F$, then $v(\phi)=v(\lnot \psi)=T$, which is not what we want. This seems to be an instance of double negation; it can flip whatever truth value to the opposite, so it seems futile to try and show that there is a truth function $\{\lnot\}$ cannot show, because with double negation you can always show a $T/F$.  The second idea to show that a negation can only show a truth function with one argument, but not one with more than one. But this seems only to be a syntactical problem: yes, you can't show a formula of $>1$ variables with only negation, but you can still draw a truth table for it nonetheless.  So my first question is,      1) what went wrong with my proof, and how to prove $\{\lnot\}$ is functionally incomplete by showing a property that only this set has?     The second way is to show how many truth functions of $n$ arguments can be represented; if this number is $<2^{2^n}$, then it is not complete; vice versa.  The book showed how to use this approach to prove that $\{\land\}$ is incomplete. The number for this set is $2^n -1$. My question is,      2) how do we know the number for $\{\lnot,\land,\lor\}=2^{2^n}$?    It must be so since it is complete, but I just don't know how to prove it.   (The book equivalated formulas $\phi$ built up using variables in the set $\{p_1, p_2, . . . , p_n\}$ to a normal form where no parenthesis remains and only variables are left, and explained that the number of non-empty subsets of this set of variables used to build the normal form $=2^n -1$. e.g. $\phi=(p_3\land p_1)\land (p_2\land(p_1\land p_4))$, normal form=$p_1\land p_2 \land p_3 \land p_4$)  Really appreciate any help offered!


I need to prove that:  If $p$ is prime greater than or equal to five, then $pB_{p-1}$ belongs to the p-integers and more over:  $$pB_{p-1} \equiv -1 \pmod p$$ Hint:Put $N=p$ in the Faulhaber´s formula: $S_{j}(N-1)=  \displaystyle\sum_{k=o}^j \frac{1}{(j-k+1)}{j \choose k}N^{j-k+1}B_{k}$ and reduce everything mod p and use the Fermat´s little theorem.  But I do not know how to reduce this:  $S_{j}(p-1)=  \displaystyle\sum_{k=o}^j \frac{1}{(j-k+1)}{j \choose k}p^{j-k+1}B_{k}$ to mod p, and I have problems trying to prove that $pB_{p-1}$ belongs to the p-integers, Can you help to prove the theorem please, Thank you.

I need to prove that:  If $p$ is prime greater than or equal to five, then $pB_{p-1}$ belongs to the p-integers and more over:  $$pB_{p-1} \equiv -1 \pmod p$$ Hint:Put $N=p$ in the Faulhaber´s formula: $S_{j}(N-1)=  \displaystyle\sum_{k=o}^j \frac{1}{(j-k+1)}{j \choose k}N^{j-k+1}B_{k}$ and reduce everything mod p and use the Fermat´s little theorem.  But I do not know how to reduce this:  $S_{j}(p-1)=  \displaystyle\sum_{k=o}^j \frac{1}{(j-k+1)}{j \choose k}p^{j-k+1}B_{k}$ to mod p,and I have problems trying to prove that $pB_{p-1}$ belongs to the p-integers, Can you help to prove the theorem please, Thank you.


I'm using Ubuntu 13.04 with Unity. Whenever I log in into my computer, the screen becomes black, then purple (that dark ubuntu-color) and that switches a few times. Between that the screen shortly shows a nvidia-logo. Then it switches back to the login-screen.  What is wrong with my PC? What can i do? I hope you could help me...  PS: Sorry for my bad english, I'm no native speaker.

My Ubuntu is stuck in a login loop when trying to enter my desktop. When I login, the screen gets black and soon after that the login screen comes back.   I've read that the problem might be caused by an error depending on the graphics, here's my graphics card: ATI Radeon 7670M


Let $N_1$ and $N_2$ be normal subgroups of G so that $N_1$ and $N_2$ are isomorphic. Is it true that then also $G/N_1$ is isomorphic to $G/N_2$?

I know it is possible for a group $G$ to have normal subgroups $H, K$, such that $H\cong K$ but $G/H\not\cong G/K$, but I couldn't think of any examples with $G$ finite. What is an illustrative example?


I recently had a discussion with someone about d100, specifically the two ways of reading the slightly specialized pair of d10s typically used for the purpose. As context for anyone unaware, a normal d10 shows the numbers 0-9 but the 0 is treated as 10. The second d10 in the pair has an additional 0 on each face, showing 00-90 in increments of 10. In theory there are many ways to use these two dice to generate a number from 1-100, but only two that are generally considered reasonable:  The two-digit die tells you the 10s place of the result, the one-digit die tells you the 1s place of the result. 100 is the number in the desired range which has a 0 in both 1s and 10s places, so dice showing "00" and "0" is 100. The normal d10 is rolled as a normal d10, and the other die is rolled as-written giving a number from 0-90; the two dice are then added together. "00" and "0" are then equal to 0 + 10 = 10. This method of rolling is particularly intuitive when the normal d10 is actually marked 1-10, but particularly unintuitive if you were to lack a special 10s die and were trying to roll on two dice both marked 1-10.  Based on  and similar questions, it seems that treating 00+0 as 100 is the more traditional option, with some tables in older editions explicitly marking 00 rather than 100 on their tables, but I only knew that for sure because I had experience with prior editions. I expect D&D 5e has specific guidance on what the "dX" dice notation means, which would probably indicate how d100 should be rolled, but where is it?

I own 2 d10 dice with differently numbered sides (0 through 9, and 00 through 90), although the same applies for two identical 'regular' d10 dice.  How do I read the percentage value if I use both dice?  It's pretty straight-forward if I roll between 11 and 89, but outside this range it becomes slightly confusing:  50, 6 → 56%  8, 9 → 89% 00, 0 → 0% or 10% or 100%? 90, 0 → 90% or 100%? 10, 0 → 10% or 20%?   Note: if I roll with identical d10, I roll sequential, not simultaneous to avoid discussion if the 8 or 9 is the first digit.  I have a hunch that 0% isn't really a thing in most systems that use d100, so that eliminates 00, 0 → 0%.  So is it then true that on the first d10, the 00 counts as zero, but on the second d10, the 0 counts as ten?


I remember reading a story (I think it was a single book, though it may have been a series) when I was younger that took place after a nuclear holocaust (it probably wasn't described as such, but that's the distinct impression I get looking back on it).  Humanity had retreated into a walled "safe zone" several generations ago to protect themselves, and everybody knew that it was still deadly outside at the time the book was set.  Early in the book, our protagonist met a girl named either Aubrey or Audrey, who turned out to have bionic eyes.  At some point, he found an arcade game simulating a fighter jet, which he instinctively knew how to fly.  It turns out that this was because     of a mystical connection to his hitherto-unknown twin brother, who had received extensive training (in preparation for war?).   It also turns out that the game was actually a recruitment tool (à la The Last Starfighter).  The last detail I remember was when he and Au(b/d)rey went outside the safe zone (I think in a real plane?) and found     that it was perfectly hospitable outside; the entire war was a ruse perpetrated by the extraordinarily rich to force everyone else into hiding, so they could all have huge estates without running out of land.   I know these are all fairly obscure details, but I'm hoping that that's offset by their specificity, and that they're enough for someone who has read the story to recognize it.

Sci-fi book in the future about a city that had 2 levels.    The top level was for the rich people. A game center with a space flight game is added. The main character (male) plays with friends and wins a competition. He ends up in huge competition and does well. He finds his sister (twin I believe) and joins the military as the competition was just a recruitment game. He flies into "destroyed land" and finds out that rich barons are living on private islands.  The destroyed lands were caused by some plague.  I read this book in 2010.


Cantrips generally get more powerful as you progress in your spellcasting class.  The Spell Sniper feat allows casting a cantrip.  If you pick a Spell Sniper cantrip from another class will the damage increase? E.g.   A level 6 Fighter takes the Spell Sniper feat and chooses Produce Flame. Would the damage be 1d8 or 2d8?

Cantrips seem to be the only type of spell that cares only about your class level. However, in the multiclassing section they are not mentioned, does this mean that cantrips use your character level, instead of your class level?  Does this mean a Warlock 2 / Fighter 15 can cast an Eldritch Blast with 4 beams just like a level 17 Warlock?


I was curious about finding users that have higher reputation on SE sites other than stackoverflow. I'm kind of fuzzy on what I want to do, but my hypothesis is that ... people who are involved in SE but not very involved in SO are rare. So anyway, I went to  and immediately realized that I need to limit my query to a single site. Question(s): a) Is it possible to query multiple sites in some way that I've overlooked? b) If not, is this feature planned? c) If not, then out of interest, what is missing for it to be implemented? thanks!

I think it would be useful if we could join across databases in the data-explorer.  For example, I'd like to query up a list of questions that I had a hand in migrating away from SO, and see what percentage of them were subsequently closed or re-migrated.  I realise I could download the various data dumps and do this on my own machine, but it would be nice if it were allowed on the online version.  Is this possible/practical?


I would like a section devoted entirely to beginners. I don't understand why the users in Java, Python and C++ are so hostile to beginners, when you don't see the same attitude on Math.Stackexchange.

Because the perl section is looking like that right now. I believe that Stack Overflow is going out of it's charter in becoming a newbie FAQ when as far as the original reasoning it was meant to be something along the lines of an expert site.   is a good example of what I mean in Perl. It probably could be closed because it's a duplicate, or some other reason.   I would also like to indicate that I don't hold back answering newbie questions. It's just when I think of an obscure "stack overflow" error that's beating you some 3 am close to deadline, that's not "Howcum Perl print ..." and follows with something that causes a vast majority of Perl programmers to say oops, because they know exactly what's going on.   So the proposal is   A new site. "Move to Newbieville" A new "section" A new status somewhat similar to Closed ("Newbied") but still can be updated all the same as an open question.   I'm not against giving some newbies an assist, but I feel a FAQ for rank newbieism is not something that SO started out to be, based on the original concept of a Expert Site.   Including comment to Gnoupi:   I said nothing about making newbies unwelcome. Like I said. I answer them--heck, I think I've even answer homework questions. I've answered on the vague impressions that I can glean from posts that have 4 close votes. It can even lead to avoiding downvoting or yelling at newbies by more established curmudgeons if there is a special action you can do to gently inform newbies that this is a real newbie question.  However, you have to know that to some people newbies are already unwelcome. There is a site ethic, but the individual is also going to decide how much they welcome newbies. And people do post RTFM answers already.   Anyway, I'm one vote away from a peer pressure badge it seems. (Nope, nailed it.)    EDIT  For somebody jumping to the conclusion that I'm hostile to newbies:  just earlier


In the given figure,3 squares are fitted together. Some lines are drawn. What is the value of $\alpha +\beta +\gamma$?  I just can derive alpha as 45 degree as it is an angle formed by diagonal of square. How to find the other two?  I have seen similar questions that were solved using trigonometry. I just want the process how to solve it by using only elementary geometry.  Also I saw another problem that answered its complements but I can't understand it

I have found the sum it's $180$ but using right triangle and sine theorem.


I submitted a manuscript to Crelle's journal about a month ago but never received a confirmation email from the editor whom I emailed the manuscript. I sent him/her another email asking about the status of paper and never heard back. I was wondering if that is a common and that is how it works with them.

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


I saw that definition in a protobuf generated java file:  java.util.List<? extends xxx.yyy.zzz.proto.BasicMessage.DestInfoOrBuilder> foo();   But what dose <? and extends mean?  I can understand List<SomeClass> I can't understand List<? extends SomeClass>..

I have a couple of questions about generic wildcards in Java:   What is the difference between List<? extends T> and List<? super T>? What is a bounded wildcard and what is an unbounded wildcard?


Using the mouse, I can drag an icon placed in the notification tray and move it outside.   Can I do that but from an automated script (so maybe using the Windows Registry), for an arbitrary program icon?

I'm setting up a Windows 7 machine that will sit out in the open and be shared by a lot of people.  I have added a shortcut to the all users start menu to run a program that sits in the system tray.  I want the tray icon for this program to always be visible by default, no matter who logs in. A user can turn it off on their profile if they really want to, but I need it to at least start out set as always visible.  How can I do this?  I would rather not show all the icons, in part for the same reason they are hidden in the first place: I don't want the clutter.  Also, as this is a public computer there is another program called DeepFreeze running that also has a system tray icon, and I don't want that icon to show all the time.


I just installed Ubuntu 13.10 in legacy mode (secure boot disabled) next to a Windows 8.1 partition. Ubuntu works perfectly (in UEFI and in legacy modes) but I can't load Windows anymore - there is no Windows entry in the Grub boot choices.  When the secure boot is enabled, I can't load Ubuntu anymore ('No bootable devices').  I've tried to repair the system with Boot Repair, but nothing changed.  Any help appreciated !  Thanks  (My machine is a Dell XPS13)

I'm absolutely new to Linux. I would like to know how to install Ubuntu alongside the pre-installed Windows 8+ OS.  Should I do it with Wubi, or through the Live USB/DVD?  What steps do I need to take to correctly install Ubuntu?


I gave a try to pantheon desktop, and ever since after uninstalling it, whenever I resume from a suspend, I get this:    Since  is a link to elementary OS, and pantheon is from this OS, I believe it is caused by some leftover element of pantheon.  How can I get rid of it ?    Update $ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description:    Ubuntu 14.10 Release:    14.10 Codename:   utopic

This browser window showing    appears after I installed then uninstalled the Pantheon environment:  Originally this occurred after (and possibly before) ppa-purging the PPA only when not connected to the internet - a window without a title that the window manager would ignore would appear, then dissapear. The grep process in the background was me searching the root of the system for clues to the problem -  I found that some settings in gconf had been left which were causing a additional issue with the elementary theme set as default, which I then apt-get auotremoved)   After apt-get autoremoving the elementary packages it opens properly in a web browser  It seems to appear randomly (in a random web browser - I have Firefox, Chromium and Chrome installed - this started happening before installing Chrome), and after unlocking the screen, connecting to the internet etc. I think the URL it is pointing to is  which then redirects to    I installed it as shown , and then removed the PPAs using ppa-purge, and then used apt-get autoremove on any remaining bits.  I know this a third-party PPA, but I don't think these issues should occur after removing it. It also causes issues with the Unity desktop as shown . This feels uncomfortably like the things you get with adware/freeware/malware on windows..  Using Ubuntu 14.04 64bit    EDIT: By looking at htop I have found that the process is started as root the run as the active user (gamer) using su:           I have not a clue what point this has apart to encourage the rapid removal of everything relevant to elementaryOS...


I know that we can use "\tableofcontents" to list all the contents of the article. However, if there are so many subsection for example, how then can I get the contents as follows:   complex nummbers....................................................................................................................3 1.1 complex numbers (3) 1.2 complex plane (5) 1.3 the modules and arguments (7) 1.4 the powers and squares (13) 1.5 conjugates (16)   Here subsection 1.1 in on the page 3, etc.

I'm new to latex, I'm thankful if someone can give me an example script to customize TOC that looks like  Chapter 1.XXXXXX                                                            (1-15)  1.1 Introduction 1.2 xxxxxxxx 1.3 xxxxxxxxxx 1.4 xxxxxxx ...............  Chapter 2.xxxxxxx  2.1 xxxxx ......                                                           (16-30)  because the (default) TOC appears to be very large for my book, since it arranges the section name row-by-row.


i'm currently working on a small script where i need to udate a file on multple servers, i have a long ip list of my servers and currently im using ncftpput to add the files to the servers one at a time.  i can't figure out how to start ncftpput with the next ipadress in my list so that i can have multiple updates running at the same time.  my list is just ip adresses: 192.168.0.1 192.168.0.2 192.168.0.3 ...... until 192.168.0.150   what i need is the first ncftpput to access the first ip the second number two ip and so on for the amount of threads i need / system can handle  lets say 10 at a time and when the first thread finishes it just takes the next ip NOT taken by any of the other threads.  i hope i made myself clear on my problem and that someone can help me figure this out.  so far i'm doing it this way: (runnig one at a time)  while read ip; do  ncftpput -c -A -u "$USER" -p "$PASSWD" "$ip" "/usr/local/program/program.conf" < "~/addthisinfo" 2>/dev/null      if [ $? -eq 0 ]              then                      echo -e "Here goes my succes test" >>/tmp/text_added              else              echo ""      fi  done <"$pathtoiplist""/iplist"   in advance thanks.  -------edit-------------  i have full access to the server so i'm not restricted in and way conserning software to use.  Michael

Lets say I have a loop in Bash:  for foo in `some-command` do    do-something $foo done   do-something is cpu bound and I have a nice shiny 4 core processor. I'd like to be able to run up to 4 do-something's at once.  The naive approach seems to be:  for foo in `some-command` do    do-something $foo & done   This will run all do-somethings at once, but there are a couple downsides, mainly that do-something may also have some significant I/O which performing all at once might slow down a bit. The other problem is that this code block returns immediately, so no way to do other work when all the do-somethings are finished.  How would you write this loop so there are always X do-somethings running at once?


Excluding the interpretation of time being the forth dimension, what mathematical evidence is there that suggests it exists?  When talking about string theory they say how there is 12 dimensions and I am assuming they didn't pull that figure out of no where.

Some theories have more than 4 dimensions of spacetime. But we only observe 4 spacetime dimensions in the real world, cf. e.g.  Phys.SE post.   Why are the theories (e.g. string theory) that require more dimensions taken seriously by scientists?  Is there any proof that these extra dimensions exist? Is there a simple layman's explanation for the need [or strong hint] for extra dimensions?


I have finished my scene but the colors for my objects are not changing. they are still the default color greyish. I finished creating the scene before making color changes, is there a certain order I should follow to change colors?

This image is what's supposed to look like in Edit Mode/Object Mode(although I still can make these screenshots even after the update by pressing F12 which is rendering) but the following is what my donut looks like now in Blender.  It shows no shadows and colors. The only thing I did is updating blender to 2.81 from 2.80. And I don't know what but something seems off with blender. Sometimes I can't click any objects so I just pressed tab and then now it's all clickable. Seems like I was in edit mode, but to me, it looked exactly like object mode. I don't know what is wrong with it. How do I make my colors show up again?


I don't know if the title of this question is accurate or not. My vacabulary of grammar is very limited. May you could understand me by the following example:   She told me that the earth is moving around the sun.  She told me that the earth was moving around the sun.    Which one is correct? Should the tense in that clause always agree with the tense in main clause?

In this sentence, should the is be a was?     On April 13, 2009, Lugo admitted he is the father of a child conceived with Viviana Carrillo.


Currently, I'm trying to understand the  on Wikipedia. I was stuck when I saw the notation:     $$ A \equiv B \mod (n, f(x))$$   Wikipedia explains like this:     The notation $A \equiv B \mod (n, f(x))$ means that $A - B = H(x) \cdot n + K(x) \cdot f(x)$ where H, K are polynomials.   I don't understand much about this notation and its properties. Can some explain this to me? I'm trying to implementing this algorithm, but this notation is way too complicated for me to do that.  I also want to know how to calculate $A \mod (n, f(x))$

Where does a layman go to get a basic understanding of AKS primality testing. I am not talking about the optimal choice of $r$ (which I am told is the hardcore number-theoretic part of the algorithm). I mean basic things, like what does $\bmod(n, x^r-1)$ mean (how can something be mod two things?) And what does binomial expansion have to do with anything?  I can't find anything in Wikipedia that is appropriate for my level.


I'm with a issue, the element $("#el") doesn't exist when I running my JS. The element has on different HTML but is on the same page.  I'm already try   $("#el").ready(addClickEv());  $(document).ready(addClickEv);  $.when($("#el").length > 0).then(addClickEv());  function addClickEv() {     $("#el").on("click", function() {         console.log("click");     }); }   But any of this works. How can I do this?

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


In a cmd window, if I type chrome, I get the below message because chrome is not in my PATH.  'chrome' is not recognized as an internal or external command, operable program or batch file.   But if in the Run window (win + R), I type chrome, chrome will run.  Why is this happening?  How does Run find the application?

When I enter "firefox" in the windows run dialog (i.e. the dialog that appears when you hit windows+R), firefox will launch.  However, "firefox.exe" is not in my %path% because when I type "firefox" in cmd.exe, I get     'firefox' is not recognized as an   internal or external command, operable   program or batch file.   So apparently an executable doesn't need to be found in the windows %path% in order to be discoverable by the run dialog. How does this work?


I have a 16gb flash drive that I used as a live USB. While it was live,  it had a total capacity of 2mb after formatting it,  it still says 2mb.  I viewed the disk in disk management and it showed 14gb of unallocated Space.  How can I recover the space.    Ps. There is no option to extend volume

After writing the FreeNAS IMG to a 16 GB USB flash drive, I can now only use 938 MB. I used the Win32 Disk Imager tool to write the IMG to the device. Then later, when I inserted the the USB drive into my Windows 7 computer it said that it had to be formatted, because it couldn't read it. I believe this is normal. So I formatted it inside Windows using the format option when prompted. So in Windows Explorer now, 938 MB is reported as capacity of this device.    Also, when i check the properties dialog box I can see the same numbers.    And when I check with diskmgmt.msc I can see there are several volumes I don't recognize and unallocated space of 12.79 GB.    Now, I have another 2 GB USB flash drive with the same problem. It too was used for FreeNAS, and it too has a reported capacity of only 938 MB. I thought it was broken there for a while, until I saw the same problem with this 16 GB model.  I tried using diskpart on the 2 GB model, and I saw that there were several partitions there (list partitions) just like on this one. So I used the clean option to try to wipe it, but that wiped off everything so it's totally useless now. I'm not sure how to rebuild it.  Is this a standard routine, like part of the whole "user experience", that whenever you make a bootable USB falsh drive with FreeNAS, it messes up your device? I am new to FreeNAS, so i wouldn't know. But it sure looks like it. Maybe it is in fact the format operation in Windows that messes things up... I don't know. It's not very nice.  How do I restore the capacity back to 16 GB-ish (14.9 GiB)?


I am typesetting some explanations that work in steps, so that a bulleted or numbered list is appropriate. But the explanations may extend on several paragraphs and I would like to keep the indentation at the same level. Is this possible? Example.  This is the first item.  Item one continues and I want this paragraph aligned on the previous.  This is the second item.   Update: The solution is by inserting a space before the paragraph.  This is the first item. Item one continues and I made this paragraph aligned on the previous.  This is the second item.

List item   can be 1 line long only, right?


x=0.008+0.005 if x==0.0130     disp('hurray'); end   The above equality doesn't satisfy for these specific set of numbers 0.008 and 0.005, though it works for 0.009 and 0.004.

I am writing a program where I need to delete duplicate points stored in a matrix. The problem is that when it comes to check whether those points are in the matrix, MATLAB can't recognize them in the matrix although they exist.  In the following code, intersections function gets the intersection points:  [points(:,1), points(:,2)] = intersections(...     obj.modifiedVGVertices(1,:), obj.modifiedVGVertices(2,:), ...     [vertex1(1) vertex2(1)], [vertex1(2) vertex2(2)]);   The result:  >> points points =    12.0000   15.0000    33.0000   24.0000    33.0000   24.0000  >> vertex1 vertex1 =     12     15  >> vertex2     vertex2 =     33     24   Two points (vertex1 and vertex2) should be eliminated from the result. It should be done by the below commands:  points = points((points(:,1) ~= vertex1(1)) | (points(:,2) ~= vertex1(2)), :); points = points((points(:,1) ~= vertex2(1)) | (points(:,2) ~= vertex2(2)), :);   After doing that, we have this unexpected outcome:  >> points points =    33.0000   24.0000   The outcome should be an empty matrix. As you can see, the first (or second?) pair of [33.0000 24.0000] has been eliminated, but not the second one.  Then I checked these two expressions:  >> points(1) ~= vertex2(1) ans =      0 >> points(2) ~= vertex2(2) ans =      1   % <-- It means 24.0000 is not equal to 24.0000?   What is the problem?    More surprisingly, I made a new script that has only these commands:  points = [12.0000   15.0000           33.0000   24.0000           33.0000   24.0000];  vertex1 = [12 ;  15]; vertex2 = [33 ;  24];  points = points((points(:,1) ~= vertex1(1)) | (points(:,2) ~= vertex1(2)), :); points = points((points(:,1) ~= vertex2(1)) | (points(:,2) ~= vertex2(2)), :);   The result as expected:  >> points points =      Empty matrix: 0-by-2


Given a standard 52 card deck, what is the expected number of cards needed to draw until we have two cards with the same number?   It's not hard to do for a fixed value (say fix Kings, then deck order can be _K__K__K__K__, all other cards have 1/5 probability of being in each space, so we expect 48*2/5 + 2 = 21.2 cards to be drawn before we find 2 Kings). Is the solution similar when the value is not fixed?

Suppose we have a standard 52-card deck (4 sets of cards from number 1 to 13). We pick the cards without putting them back. We stop when two cards of the same value are drawn (not necesarily to be consective draws). What is the mathematical expectation of the number of cards we need to pick?


I am currently studying probability and am having difficulty understanding this question: Prove that $$\binom{2n}{n} = \sum_{k=0}^n\binom{n}{k}^2$$ from Jim Pitman's Probability (Appendix I, question vi). So far I have tried writing the right hand side in different ways: expressing it in its factorial form and have tried to implement the identity $$\binom{n}{k} = \binom{n-1}{k-1}+\binom{n-1}{k}$$ but have not gained any new ground. If any one has an algebraic proof, or even a simple combinatorics proof that is intuitive and used with an example that would be preferable. Thanks!

I was hoping to find a more "mathematical" proof, instead of proving logically $\displaystyle \sum_{k = 0}^n {n \choose k}^2= {2n \choose n}$.  I already know the logical Proof:  $${n \choose k}^2 = {n \choose k}{ n \choose n-k}$$  Hence summation can be expressed as:  $$\binom{n}{0}\binom{n}{n} + \binom{n}{1}\binom{n}{n-1} + \cdots + \binom{n}{n}\binom{n}{0}$$  One can think of it as choosing $n$ people from a group of $2n$  (imagine dividing a group of $2n$ into $2$ groups of $n$ people each. I can get $k$ people from group $1$ and another $n-k$ people from group $2$. We do this from $k = 0$ to $n$.


An unresolved problem occurred while initializing the package information. It says I have a bug against the update manager package with this error message:  E:Malformed line 58 in source list/etc/apt/sources.list (distribution parse)

I have unistalled and reinstalled the Ubuntu Software Center as per info I found in a similar thread and I got the same response about line 91 or something like that.  I just tried to upload a screen shot but since I'm new it won't allow me to.  I also can not figure out how to cut and paste anything so I have to hand type what the error screen says, both when I attempt to open the software center and nothing happens, when I try to enter commands into the terminal to uninstall, reinstall, whatever I get the same following:  COULD NOT INTITIALIZE THE PACKAGE INFORMATION An unresolvable problem occured while initializing the package information Please report t:his bug against the 'update-manager' package and include the following error message: 'E: Malformed line 91 in source list/etc/apt/sources.list (dist parse)  E: The list of sources could not be read.,  E: The package list of status file could not be parsed or opened.   How do I report bugs?  What can be done about this.  I have searched and everything everyone says to do leads me back to the same line error message.  So, I don't know how to get to line 91 in the source list; to tell you what it says. Sorry, I'm really new to this. That is what I need is to find out how to get there and fix what it says. I would really like to NOT have to re partition my hard drive and start from scratch, so I'm really looking forward to getting this problem solved. I need to be able to install new software.


I know this may be a very simple question, But it really made me confused several days. I try to store derived class in a standard std:vector which stores base class type.  If I make the base(father) class to be pure virtual class. I cannot store derived class in the vector.  If I implement the base(father) class's getName() method. I can build successfully. But when iteratoring the vector. it lose the polymorphism...  #include "stdafx.h" #include <string> #include <iostream> #include <vector> using namespace std;  class father{ public:     //virtual string getName() = 0; //If uncomment here. push_back(c1) will induce build error.     virtual string getName(){ return "father";} };  class child1 : public father{ public:     virtual string getName(){         return "child1";     } };  class child2 : public father{ public:     virtual string getName(){         return "child2";     } };  class child3 : public father{ public:     virtual string getName(){         return "child3";     } };  int _tmain(int argc, _TCHAR* argv[]) {     child1 c1;     child2 c2;     child3 c3;      cout<< "c1  " << sizeof(c1) << endl;     cout<< "c2  " << sizeof(c2) << endl;     cout<< "c3  " << sizeof(c3) << endl;      vector<father> v;     v.push_back(c1); //build error if Father is pure virtual class     v.push_back(c2); //build error     v.push_back(c3); //build error      for(std::vector<father>::iterator it = v.begin(); it != v.end(); ++it)     {         cout << "I'm " << it->getName() << endl; //lose polymorphism     }     return 0; }   summary two questions: 1. why define base(father) class as pure virtual class. I cannot store derived class in vector ? 2. why when I get class from the vector again. it lose polymorphism ?  Thanks in advance for any help. Really appreciate that!

Someone mentioned it in the IRC as the slicing problem.


I have a subtitle file consisting of utf-8 with Chinese characters. In fact, it's tiny so  is the file.  So far I've managed to read the file using   with open(path) as f:     text = f.read().decode('utf-8-sig').encode('utf-8')     print text[:100]   All I get is the usual mis-encoding mess:  1 00:00:20,160 --> 00:00:22,660 æ´¾æ‹‰è’™ç”µå½±å…¬å¸  2 00:00:32,160 --> 00:00:36,660 åŽçº³å…„å¼Ÿç   I've set chcp 65001 in cmd.exe and then ran the py script. What am I doing wrong?

We have a project in Team Foundation Server (TFS) that has a non-English character (š) in it. When trying to script a few build-related things we've stumbled upon a problem - we can't pass the š letter to the command-line tools. The command prompt or what not else messes it up, and the tf.exe utility can't find the specified project.  I've tried different formats for the .bat file (ANSI, UTF-8 with and without ) as well as scripting it in JavaScript (which is Unicode inherently) - but no luck. How do I execute a program and pass it a Unicode command line?


I have the following HashMap:  Map<String,List<Objects>> abc = new HashMap<String,List<Objects>>()    How can I iterate through the objects, to access the properties of the object?

If I have an object implementing the Map interface in Java and I wish to iterate over every pair contained within it,  what is the most efficient way of going through the map?  Will the ordering of elements depend on the specific map implementation that I have for the interface?


Say you got an array of 4 numbers. What is the best way to go through all the possible combinations? A start of the combinations would be:  1,2,3,4  1,2,4,3  1,3,2,4  1,3,4,2  1,4,2,3  2,1,3,4  etc.

How do you generate all the permutations of a list in Python, independently of the type of elements in that list?  For example:  permutations([]) []  permutations([1]) [1]  permutations([1, 2]) [1, 2] [2, 1]  permutations([1, 2, 3]) [1, 2, 3] [1, 3, 2] [2, 1, 3] [2, 3, 1] [3, 1, 2] [3, 2, 1]


Beacuse of Bibtex issues with UTF8 characters, I switched to using BibLaTex in conjunction with Biber. I installed the  package to get traditional citation styles.  However, even by using the package, alpha stlye differes slightly from the original one.  This is my premable:  \usepackage[backend=biber,style=trad-alpha]{biblatex} \bibliography{tex/Bibliography}   And that is how I include it in my document:   \printbibliography   The problem is how entries with many authors (like this one)  @InProceedings{lamere2003cmu,   Title                    = {The CMU SPHINX-4 speech recognition system},   Author                   = {Lamere, Paul and Kwok, Philip and Gouvea, Evandro and Raj, Bhiksha and Singh, Rita and Walker, William and Warmuth, Manfred and Wolf, Peter},   Booktitle                = {IEEE Intl. Conf. on Acoustics, Speech and Signal Processing (ICASSP 2003), Hong Kong},   Year                     = {2003},   Organization             = {Citeseer},   Pages                    = {2--5},   Volume                   = {1} }   are rendered in the Bibliography.  Original:    Biber:    (Diffrence in fots doesn't matter; it is connected to different zoom levels)  How to change trad-alha stye so that it uses the[XYZ+00] notation?

With the following example, I tried to get a label only made of from the first author using maxcitenames. But unfortunately it seems not to work. Do I miss something?  \RequirePackage{filecontents} \begin{filecontents*}{\jobname.bib} @book{smith1, author={John Smith and Mike Someone}, title={The book with a very very very very very long title}, year={2005}, location={New York}, publisher={Publisher}, } \end{filecontents*} \documentclass[12pt]{article} \usepackage[style=alphabetic,%             backend=biber,             maxbibnames=99,             maxcitenames=1,             backref=true             ]{biblatex}     \addbibresource{\jobname}     \renewcommand*{\labelalphaothers}{}     \renewcommand*{\intitlepunct}{}     \DefineBibliographyStrings{german}{in={}}     \DefineBibliographyStrings{english}{in={}}     \DeclareNameAlias{sortname}{last-first}     \DeclareNameAlias{default}{last-first}  \begin{document} \cite{smith1} \printbibliography \end{document}


Can I connect my Bluetooth earbuds to my Xbox One? I just want to hear the game and use the mic. I'll use an adapter if I have to.

I have Bluetooth Auvio headphones, which I bought on radioshack and I would like to know if there is any way to connect them to my Xbox One, so I can hear sound and use the mic.


Just to be on the same page, I'm not looking to sort a String array into its reverse alphabetical order, I'm looking forward to doing this for a Char Array.  Here's my attempted code:  import java.util.Arrays; public class ReverseSortDemo {     public static void main(String[] args){         char[] unorderedLetters;          unorderedLetters = new char[]{'b', 'm', 'z', 'a', 'u'};         reverseSort(unorderedLetters);          for (int i = 0 ; i < unorderedLetters.length; i++ )             System.out.println(unorderedLetters[i]);     }      //method that sorts a char array into its reverse alphabetical order     public static void reverseSort(char[] values){          Arrays.sort(values);         for (int i = values.length - 1; i >= 0; i--) {             values[values.length-1-i]=values[i];         }     }  }   The output I'm getting is this:  z u m u z   BUT, my desired output as you guys know is this:  z u m b a   So, how do I deal with this? Is there a way, and if possible, an easier way to do this (e.g. builtin method) which I'm not aware of, so that I can start getting lazy with my code?

I've got a large array of primitive types (double). How do I sort the elements in descending order?  Unfortunately the Java API doesn't support sorting of primitive types with a Comparator.  The first approach that probably comes to mind is to convert it to a list of objects (boxing):  double[] array = new double[1048576];     Arrays.stream(array).boxed().sorted(Collections.reverseOrder())…   However, boxing each primitive in the array is too slow and causes a lot of GC pressure!  Another approach would be to sort and then reverse:  double[] array = new double[1048576]; ... Arrays.sort(array); // reverse the array for (int i = 0; i < array.length / 2; i++) {      // swap the elements      double temp = array[i];      array[i] = array[array.length - (i + 1)];      array[array.length - (i + 1)] = temp; }   This approach is also slow - particularly if the array is already sorted quite well.  What's a better alternative?


When one tries to vote on a comment on a historically locked question, one gets the alert pop up of:        However, it is possible to flag comments.  For the SE types who can dig beyond the ability of mortals, see the date of the flags on .  Please change the wording of the alert to match the current functionality. One could instead change the functionality to match the alert, though in doing so it does become more difficult for regular users to work to curate the content (yes, all that about historical lock being preserved as is forever and whatnot... but one shouldn't need to go to meta to ask mods to clean up comments suggesting the mutilation of corpses).

When trying to upvote a comment made on a locked post (ordinary lock, not historical lock which remove the vote arrows and flag altoghether) we are greeted with such error message:        Or in words:     This comment is not eligible for voting or flagging   Being the curious type, I went straight away and tried to flag, fully expecting the same message... just to see the flag dialog open up just fine:        I was able to flag as well.  Can the error message please be changed to just "This comment is not eligible for voting"? Or of course, if it's not the intended behavior really disable the option to flag?  The original post on which I experimented is now deleted, but  you can play with.


I have a website that has an input form that submits to a php page and adds a players username to a database and counts the views of that player's name to a top 10 list.   My friend tried out inputting other stuff such as html code and javascript. it get's displayed on my top 10  list.  do you have any suggestions how I can make my form more secure? I have been searching for ages and haven't found anything yet.  all help would be highly appreciated :)  <form method="get" action="player.php">

           <input name="user" type="text" class="form-control" placeholder="Steve" aria-describedby="sizing-addon2">                       <input type="submit" class="btn btn-success" value="View Skin">
 </form>

At the moment, I apply a 'throw everything at the wall and see what sticks' method of stopping the aforementioned issues. Below is the function I have cobbled together:  function madSafety($string) {  $string = mysql_real_escape_string($string); $string = stripslashes($string); $string = strip_tags($string); return $string;  }   However, I am convinced that there is a better way to do this. I am using FILTER_ SANITIZE_STRING and this doesn't appear to to totally secure.   I guess I am asking, which methods do you guys employ and how successful are they? Thanks


I stumbled upon this C code in a college test and when I tested it on Dev-C++ 5.11 compiler, it printed random characters. I can't understand how or why this code works. Can someone enlighten me?    int main() {         char a[10] = "%s" ;         printf( a ) ;     }

I've just encountered a weird problem, I'm trying to printf an integer variable, but I forgot to specify the variable name, i.e.  printf("%d");   instead of  printf("%d", integerName);   Surprisingly the program compiles, there is output and it is not random. In fact, it happens to be the very integer I wanted to print in the first place, which happens to be m-1.  The errorneous printf statement will consistently output m-1 for as long as the program keeps running... In other words, it's behaving exactly as if the statement reads  printf("%d", m-1);   Anybody knows the reason behind this behaviour? I'm using g++ without any command line options.  #include <iostream> #define maxN 100 #define ON 1 #define OFF 0  using namespace std;  void clearArray(int* array, int n); int fillArray(int* array, int m, int n);  int main() {     int n = -1, i, m;     int array[maxN];     int found;      scanf("%d", &n);      while(n!=0)     {         found=0;         m = 1;         while(found!=1)         {             if(m != 2 && m != 3 && m != 4 && m != 6 && m != 12)             {                 clearArray(array, n);                 if(fillArray(array, m, n) == 0)                 {                     found = 1;                 }             }             m++;         }          printf("%d\n");          scanf("%d", &n);     }      return 0; }  void clearArray(int* array, int n) {     for(int i = 1; i <= n; i++)         array[i] = ON; }  int fillArray(int* array, int m, int n) {     int i = 1, j, offCounter = 0, incrementCounter;      while(offCounter != n)     {         if(*(array+i)==ON)          {             *(array+i) = OFF;             offCounter++;                }         else          {             j = 0;             while((*array+i+j)==OFF)             {                 j++;             }             *(array+i+j) = OFF;             offCounter++;                    }         if(*(array+13) == OFF && offCounter != n) return 1;         if(offCounter ==n) break;          incrementCounter = 0;                while(incrementCounter != m)         {             i++;             if(i > n) i = 1;             if(*(array+i) == ON) incrementCounter++;          }            }      return 0; }


I am not good at mathematics and have been learning ML from Udacity. In its tutorial video, the tutor mentioned derivatives at time 4:24  and gradient across the whole video e.g. at time 3:03  So this makes me thinking derivatives and gradient are interchangeable. Am I correct? If not, what are the differences between Gradient and Derivative in laymen's language?(yes, I did searched the differences, but they are too mathematic. My hopeless not-math-capable brain cannot understand it but my curiosity keeps driving me to get it understood.... >_<) and when to use gradient and when to use derivative?

I am not good at mathematics and have been learning ML from Udacity. In its tutorial video, the tutor says(I concluded it in a short way): using Gradient to get the steepest slope to go upwards, so in order get minimized loss we go the opposite. Here is the video starting from time 3:00:  my question is : it is not necessary the exactly opposite direction of the gradient(steepest ascent) that the steepest descent goes. As it's 3D, if the gradients goes 0 degree, it doesn't necessary mean the 180 degree points you the steepest descent. So I assume his statement is wrong? Could someone correct me(using plain language even a laymen can understand, thanks) if I got wrong somewhere? Thanks update After reading John's answer, my understanding is: At the particular point P we can draw a tangent line A. Let's assume that the 0 degree of A points to the fastest direction for ascending, but the actual fastest direction for descending is 150 degree at point P. Since the tangent line can ONLY have 2 directions which are 0 and 180, so we can only take 180 degree of the line A as our next direction for descending. Is my understanding correct?


edit: $f[X]=\{f(x):x\in X\}$  $f[X]\backslash f[X']\subset f[X\backslash X']$  Simple: Proof by definition. What I would like to provide is a counter-example and intuition to the reverse of this question. Please correct me if I am wrong. If it is correct, I hope this could serve as a reference to the textbook which I can't find its solution in the internet.  $f[X\backslash X']\subsetneq f[X]\backslash F[X']$  Counter-example: constant mapping   $X\cap X'=\emptyset,A=X\cup X',B:\{y\}$ $f:A\rightarrow B\;s.t.f(x)=y\;\forall x\in A$ $f[X\backslash X']=f[X]=\{y\}=f[X']$ $f[X]\backslash f[X']=\{y\}\backslash \{y\}=\emptyset$ $\{y\}\subsetneq\;\emptyset$   Intuition:   $A\subset\emptyset\equiv\;False$ $f[X]=f[X']\rightarrow f[X]\backslash f[X']=\emptyset$ $X\cap X'=\emptyset\rightarrow X\backslash X'=X\;and\;X\neq\emptyset\;and\;X\neq\emptyset$ $f[X]\subsetneq\emptyset$   So it all depends on which is which--either you find constant mapping or manipulation on statement calculus mechanical.

Let $f: A\longrightarrow B$ be a function.   1)Prove that for any two sets, $C,D\subseteq A$ , we have $f(C) \setminus f(D)\subseteq f(C\setminus D)$.  2)Give an example of a function $f$, and sets $C$,$D$, for which $f(C) \setminus f(D) \neq f(C\setminus D)$  First time exposed to sets.. how would I go about proving this? What assumptions should I make?


New Ubuntu 17.10.1 install. Network is up and running on DHCP, trying to change it to static and point to local DNS server. ran sudo nano /etc/network/interfaces and it only shows the loopback interface.  I added the following, saved, reboot the server, it still using DHCP.    auto eno1 iface eno1 inet static address 192.168.0.100 netmask 255.255.255.0 network 192.168.0.0 gateway 192.168.0.1 dns-nameservers 192.168.0.10   What am I missing?

I've just installed ubuntu server 17.10. During installation, it suggested me to connect to the network through wifi, and so i did. After installation was finished and system was rebooted, computer connected to the wifi automatically (which means, it saved the connection creds somewhere). But in /etc/network/interfaces i found nothing. I need my computer connect to wifi network with static ip, so I've put configuration into the /etc/network/interfaces:  # /etc/network/interfaces -- configuration file for ifup(8), ifdown(8) # Generated by debian-installer.  # The loopback interface auto lo iface lo inet loopback   iface wlp2s0b1 inet static         wpa-driver wext         address 192.168.0.12         netmask 255.255.255.0         gateway 192.168.0.1         wpa-ssid *****         wpa-psk **********         dns-nameservers 8.8.8.8 192.168.0.1 auto wlp2s0b1   When system starts, it doesn't connect using my configuration. It does only after  sudo ifdown wlp2s0b1 && sudo ifup -v wlp2s0b1  and after this command, system getting a SECOND IP! Server is still available by the ip it gets from DHCP, and in the same time, it is available by the static ip!


After seeing the results obtained with LuxRender , I was curious to try and reproduce beautiful caustics in Cycles such as these:    I created a scene and added some lights, following the advice given  to create the materials, and also trying out other materials.  I find it hard to find much documentation on caustics within Cycles; some people advise to use Sun Lamps, some other recommend emitter planes. Sometimes large emitter planes seem to work, sometimes people recommend smaller emitter planes. Besides from this confusion, in my various tests, the light that goes through the objects and hits the ground plane is usually very diffuse, of an evenly brightness, and doesn't have many sharp areas.  Here's an example of what I get the closest I get being the shape on the left):    Moreover, in the example given above, caustics appear on two sides of the object, probably due to the light bouncing inside the object and being projected out on both sides.  How should I set up materials and lights for sharp and realistic caustics, in Cycles?  File:

Working in Cycles.  Say I have a "disco ball" with a glossy shader. I'm pointing a spot light to it, and I'm trying to have the reflections of that light illuminate the diffuse material on the walls with the patterns from the ball.    I get this:    but I'd like to get something like:    For the illustration I placed a point light inside the ball an removed faces. But what I'd like to do is move the light around the ball so that the light reflected from it changes like it would do in real life.   Is that possible at this point?  EDIT:  Just for the record here's the image rendered in LuxRender (yet another program to learn...)


In JAVA using Struts 1.3 ,Im uploading a single file from File browser from Form,End user will access my application URL and browse file from his local machine,and on my application server Database is here.Values get inserted into my DB while uploading single File.  But I dont know how to upload complete Folder from Local machine.  I think this is done by something called AbsolutePath.  Kindly help me soon. Thanks in advance to all.

I need an easy way to allow users to upload multiple files at once (ie I need to allow a user to upload a folder).  I do not wish to put the burden of zipping on the user.    I would prefer to avoid Flash or variants if possible.  I'm looking for a straight javascript / HTML solution if it is possible.  Please note, this rules out the answers at: .


What are some tricks for avoiding bash history being logged in a fascist logging environment that does not involve modifying .bashrc or deleting content from within the history file?

More than once I've accidentally run a number of commands and polluted my bash history. How do I close my terminal without saving my bash history? I'm using Fedora.


I want to test an (upstream) custom kernel on Fedora.  The plan so far is:   use a recent fedora config as starting point, e.g. /boot/config-3.6.6-1.fc17.x86_64 lookup build dependencies lookup right make commands execute some make commands cp resulting vmlinuz/System.map to /boot adjust grub   But what about the initramfs...img file ? How do I generate it?  What else is important?

I'd like to try using a kernel other than the one provided by my distro -- either from somewhere else, or as customized by me. Is this difficult or dangerous?    Where do I start?


I know you could do this with the scoreboard in 1.8 and with teams in 1.13+, but when I use the regular methods mobs are still hostile towards me. Any alternatives? Plugins work too.

How can I add certain mobs to a team and make them passive to me if they would normally attack me? I know how to do it in 1.8, but how can I do it now in 1.16.4?


I have a EF-S 18-55mm 1:3.5-5.6 III, and want to know what is the worst-case scenario if you move the focus ring in AF mode?

I have a couple lenses that don't have an internal focusing system, and whenever I want to put them back in my bag, I turn the focus ring to make the lens shorter.  I noticed that when the lens is set to auto focus, the focus ring is harder to move than when it is on manual focus. Can I damage the focusing system by turning the focus ring when the lens is set to auto focus?  I would think that if the lens is off the camera it wouldn't cause any damage. Am I right?


I want to create only colorbar in Latex. Earlier I have used to Gnuplot to plot heatmaps along with colorbox(yeah, They are called colorbox in Gnuplot).  The user defined colorbox in Gnuplot plot is given as follows  set colorbox set palette defined ( 0 '#000090',\                       1 '#000fff',\                       2 '#0090ff',\                       3 '#0fffee',\                       4 '#ffee00',\                       5 '#ff7000',\                       6 '#ee0000',\                       7 '#7f0000') set cbrange [25:900] show colorbox   How do I generate an equivalent colorbar in Latex?  The colorbox from Gnuplot looks like this

I am trying to create something similar to this in Tikz:    I have been looking at using the \shadedraw macro, but have not found a way to create the color spectrum.  It seems possible if I stack multiple gradient-shaded rectangles on top of each other, but I would rather not use such a lengthy and ugly solution.  Is there a way to recreate this PH-scale image in Tikz, ideally using few rectangles?  (Note: the number labels are not necessary, as they will be replaced with horizontal lines anyway.)


Let $X$ and $Y$ be topological spaces and $f:X\to Y$. The graph of $f$ is the subset $G=\{(x,f(x))\}\subseteq X\times Y$. Show that if $f$ is continuous, then $X$ is homeomorphic to the graph of $f$.  My attempt: Let $h:X\to G$ by $h(x)=(x,f(x))$. The fact that $h$ is a bijection is clear. Now since $g:X\to X$ by $g(x)=x$ is continuous and $f:X\to Y$ is continuous by hypothesis, the universal mapping property of products says that $h$ must be continuous. I'm having trouble showing $h^{-1}$ is continuous though... $g^{-1}:X\to X$ is continuous by the same argument as for $g$, but how would I show that $f^{-1}$ is continuous?

Let $f: X \to Y$ be a function. The graph of $f$ is defined to be the set $G = \{(x, f(x)) : x \in X\}$. Prove that if $f$ is continuous then $G$ is homeomorphic to $X$.     an anyone suggest  me the process of solving this problem, thanks.


A paper I'm reading says that the algebraic closure of $\mathbb{Q}_p$ is not complete, by using for example the Baire theorem. Wikipedia says the Baire theorem says that a complete metric space is a Baire space (meaning a countable intersection of dense open sets remains dense). I don't see how this can be used to show the claim that $\overline{\mathbb{Q}_p}$ is not complete. Any other argument is also welcome.

Let $K$ be a finite extension of $\mathbf{Q}_p$, i.e., a $p$-adic field. (Is this standard terminology?)  Why is (or why isn't) an algebraic closure $\overline{K}$ complete?  Maybe this holds more generally:  Let $K$ be a complete Hausdorff discrete valuation field. Then, why is $\overline{K}$ complete?  I think I can show that finite extensions of complete discrete valuation fields are complete.


For $a,b,n,m\in \Bbb N$, if $a$ and $b$ are coprime, than for $m^n=a\cdot b$ $\exists a',b'\in \Bbb N: a=a'^n \land b=b'^n$  I thought it would suffices to show that $m=a'\cdot b'$, but I'm not sure that's why I also thought of : As $a,b$ are coprime than we can write $$\begin{align}a&=p_1^{u_1}\cdots p_i^{u_i}\\b&=q_1^{v_1}\cdots q_j^{v_j}\end{align}$$ where $p_g\neq q_g \forall g$ so$$\quad m^n=a\cdot b=p_1^{u_1}\cdots p_i^{u_i}\cdot q_1^{v_1}\cdots q_j^{v_j}$$ As the $u_i,v_i$ doesn't necessary need to be distinct, we can rewrite to $$m^n=(p_1q_1)^{n_1}\cdots(p_iq_j)^{n_{ij}}$$ we define $m:=\prod p_hq_h$ and $n:=\prod n_{ij}$ Not sure how to continue or either it's correct or not :(

Show that if $n$, $a$, $b$, and $c$ are positive integers with $\gcd(a, b) = 1$ and $ab = c^n$, then there are positive integers $d$, and $e$ such that $a = d^n$ and $b = e^n$.   I know that (by Bezout) $\gcd\left(a,b\right) = 1$ implies $ax + by = 1$ for some integers $x$ and $y$, and also that $\gcd\left(a^n,b^n\right) = 1$, but this does not help me.


I have a tmux session already running. I have created it just with  tmux   now I can leave the session and re-enter with  tmux a -t 0   how can I share this session with other users? Usually one has to create the session with -S option, but I haven't. Is there a way to share my session?

I've decided to try tmux: have been reading the docs and googling around, trying to find a way to have two users sharing a session, each with a different cursor.  However, giving 777 permissions to the socket, or creating a group, chgrping the socket and adding both users to it, seems to let that same socket be used to share a session with only one cursor: both users can write, but always in the same cursor position.  Right now both users are in the same home server over ssh, and the idea is to be able to have:   A terminal in a, let's say, left pane, where I can type commands Another terminal in a right pane, where I can see another user typing commands  in his own terminal The same thing for the other user   What I'm doing at the moment is using two sessions (not shared) and a script -f and tail -f combination that kinda works for reading each other's key strokes, but I reckon there is probably some way of doing this using tmux sharing capabilities.  Is there a way to get this idea working with write support in each other's terminal?  What is the better way to do this?


I have a form that contains 1 select option and 5 text fields.  My first function is when I select a specific option, those 5 text fields will auto-populate data from the database. This function is specific to the ID of the selected option.  And I have another function that when I click the "Add another" button, it will clone the form and will generate a new ID for each text fields.  The problem is, when I click the add another and the second form is there, the 5 text fields doesn't auto-populate because the auto-populate function is specific only to the original ID.  How do I solve this? How do I apply the auto-populate function to the newly generated form? Please help.  Given the form:  <form method='post' name="form1">     <select id='select'>         <option value='1'>1</option>         <option value='2'>2</option>     </select>      First Name: <input type='text' id='fname'>     Last Name: <input type='text' id='lname'>     Contact Number: <input type='text' id='cnumber'>     Address: <input type='text' id='address'>     E-mail Address: <input type='text' id='email'>      <button type='button' id='addanother'>Add Another</button> </form>   Thank you!

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


This is a plot of my data    These are the values:     xvalues  yvalues 1   1.091186 2   2.653722 3   3.309146 4   5.206479 5   5.115582 6   8.537005 7   10.013147 8   9.802291 9   10.667769 10  5.809750 11  9.624475 12  11.806013 13  13.587066 14  14.146781 15  13.707472 16  12.891355 17  19.435301 18  16.122108 19  17.768536 20  23.813027 21  21.819081 22  23.556074 23  21.170983 24  27.621148 25  22.932580 26  20.704689 27  25.530339 28  26.227371 29  26.051016 30  31.047145   I now do a PCA and a biplot of it:    According to Jeromy Anglim in:        The left and bottom axes are showing the loadings; the top and right axes are showing principal component scores.      The left and bottom axes are showing [normalized] principal component scores; the top and right axes are showing the loadings.   I want to be sure I really get this.   Let's start with the loadings: these can be visualized in R by writing:   results <- prcomp(your_data) results$rotation             PC1        PC2 xvalues   0.7235616  -0.6902599 yvalues   0.6902599   0.7235616  summary(results)  Importance of components:                        PC1     PC2 Standard deviation     12.0747 1.56606 Proportion of Variance  0.9835 0.01654 Cumulative Proportion   0.9835 1.00000   Now lets look at the red arrow of xvalues. Its tip is around 0.25 in the x-axis of the loadings. But according to the loadings I have just writen, it should be around 0.72. What am I missing?   Finally, lets look at the point 1. According to the axes, that is telling me the principal component score. Is it that the coordinate in the new frame of reference? It doesn't make sense to me because I think that the new origin of the axes is around the point (15,15) in the Plot 3. If I look at that (and I guess that I am completely wrong here), the point one should have a coordinate around -20 or so, and not 40. Where is my mistake?  Update  I tried plotting this:  plot(pca_results$x)     Here it can be seen that the first point has the coordinate that I thought it had to have. But, still, what are the units in the biplot then??

When you construct a biplot for a PCA analysis, you have principal component PC1 scores on the x-axis and PC2 scores on the y-axis. But what are the other two axes to the right and the top of the screen?


The "Add an Answer" button is not visible in this  in the android app. The question can be answered from the website from Nexus 10 in which I am running the SE app.   I am running Android 5.0.1 an SE Android App v 1.0.54. I am linking a screen shot. I think this is a bug. Maybe because there are already 11 long answers?

This question is protected. To answer it, I must have at least 10 reputation.        Ignoring the association bonus of 100, I should .  Yet, the Android app does not show the blue "Add an Answer" button at the bottom. The app also does not show the protection status.  If I view the question in the desktop or mobile browser (and I'm signed in), I can add an answer there.


I am trying to take a string and print out all of the special characters found in the string. I currently am trying to learn regex, would they be useful here?

I don't really understand regular expressions.  Can you explain them to me in an easy-to-follow manner?  If there are any online tools or books, could you also link to them?


I don't understand how to get from the infinite sum $\sum_\limits{n=1}^{\infty}\frac{1}{n^2}$ to the solution $\frac{\pi ^2}{6} $.   Is it possible to calculate this by hand or do I just have to type it into a calculator and accept it as it is?

As I have heard people did not trust Euler when he first discovered the formula (solution of the ) $$\zeta(2)=\sum_{k=1}^\infty \frac{1}{k^2}=\frac{\pi^2}{6}.$$ However, Euler was Euler and he gave other proofs.   I believe many of you know some nice proofs of this, can you please share it with us?


Show every finite group of even order contains an element of order 2.  I have tried using Lagrange's theorem, but I am unsure if this is the right path.

I am working on the following problem from group theory:     If $G$ is a group of order $2n$, show that the number of elements of $G$ of order $2$ is odd.   That is, for some integer $k$, there are $2k+1$ elements $a$ such that $a \in G,\;\; a*a = e$, where $e$ is the identity element of $G$.


Let $A$ be a $5\times5$ matrix with real entries such that the sum of the entries in each row of $A$ is $1$. Then the sum of all entries in $A^3$ is   (a) $3$   (b) $15$  (c) $5$  (d) $125$  $1$ is an eigenvalue of $A$, that's all I know. How could we go to the sum of all entries of $A^3$ ?

Let $A\neq I$ be a $5\times5$ matrix with real entries such that the sum of the entries in each row of $A$ is $1$. Then the sum of all the entries in $A^3$ is  1)$\space 3$ $\qquad $2)$\space 15$ $\qquad$ 3)$\space 5$ $\qquad$ 4)$\space 125$  Solution:  The answer is $5$ if $A = I$, but for $A \neq I$,  I found that vectors $\begin{pmatrix} 1\\ 1\\ 1\\ 1\\ 1\\ \end{pmatrix}$ and  $\begin{pmatrix} -1\\ -1\\ -1\\ -1\\ -1\\ \end{pmatrix}$  are eigen vectors for the matrix $A$ corresponding to eigen value $1$. From here, I dont know how to proceed, please help me solve the question..and if there are mistakes in my argument, please tell me..


Semi-transparent materials are looking fine under viewport render, but are invisible under normal render.  Here are my material nodes:    Here is a difference between viewport render and normal render:

I have a model of a building with a sidewalk around it.  Both show up when I switch to rendering mode in both Blender Render and Cycles Render mode.  But:  when I hit F12 for a final proper render, the building shows up -- but the sidewalk doesn't.    I've checked the normals and I thought the normals seemed pointed in the right direction.  I've set the Clipping on the Camera to a high number.  I removed all the materials from the sidewalk and added a new material-- the problem persists.  I've exported the blend as an FBX file and the Sidewalk shows up fine in Unity.  Just in final renders, it doesn't show up.    Here is a blend file: .  I tried to destroy everything unrelated to the issue and label things in a clear way.    Thanks.


Which one of these sentences is considered to be more correct?   1) You cannot imagine how good an experience that has been.  or  2) You cannot imagine how good of an experience that has been.

Quite a few phrases in English are constructed like so:     How [adjective] a [noun]...?   This is the question form of the construction, which is often answered with the negative:     Not that [adjective] a [noun].   or the positive:     Quite [adjective] a [noun].   However, from time to time I'll hear the word 'of' inserted before the 'a', e.g.:     Not that [adjective] of a [noun].   This usually sounds wrong to me, with the exception of the case where the adjective 'much' is used.  So, this sounds fine to my ear:     Not that much of a problem.   whereas this doesn't:     Not that loud of a noise.   Why is it that 'much' should be used with 'of', and other adjectives not?  Is it because 'much' is seen as measuring a quantity (of something), whereas other adjectives that may be used in this construction are seen as measuring the quality of a whole thing?


Can anyone give me an intuition of why the magnetic vector potential $A$ is sometimes interpreted  as the electromagnetic momentum ?  I don't know analytical mechanics, just classical electromagnetism

In electromagnetism, we can re-write the electric field in terms of the electric scalar potential, and the magnetic vector potential.  That is:  $E = -\nabla\phi - \frac{\partial A}{\partial t}$, where $A$ is such that $B = \nabla \times A$.  I have an intuitive understanding of $\phi$ as the electric potential, as I am familiar with the formula $F = -\nabla V$, where $V$ is the potential energy.  Therefore since $E = F/q$, it is easy to see how $\phi$ can be interpreted as the electric potential, in the electrostatic case.  I also know that $F = \frac{dp}{dt}$, where $p$ is momentum, and thus this leads me to believe that $A$ should be somehow connected to momentum, maybe like a "potential momentum".  Is there such an intuitive way to understand what $A$ is physically?


I have a hp envy m6 notebook. running windows 8.1 genuine on my machine, i want to know how to install Ubuntu 14.04 on my machine as a dual boot? please give me a proper guide. and also tell me can i run adobe photoshop cc and lightroom 5.4 on ubuntu ?

I'm absolutely new to Linux. I would like to know how to install Ubuntu alongside the pre-installed Windows 8+ OS.  Should I do it with Wubi, or through the Live USB/DVD?  What steps do I need to take to correctly install Ubuntu?


What effect does a light ray cause on an electron to make it excited. How a electron absorb energy?

This might be a stupid question, but nonetheless, it has been bothering me.  If you take a photon, make it go through some atoms in a solid, liquid or whatever, then you have the chance of this photon being absorbed by an electron, and thereby exciting the electron. This requires the photon to have enough energy to actually excite the electron to another energy level.  My question is then: How does the photon know if it has enough energy or not? Do they interact very quickly to determine if it's okay or not, or is it just something it "knows?"


Not sure how to formally prove this (specifically regarding the choice of $\epsilon$ in the formal limit definition)... Any suggestions?

How can I prove $\lim_{n \to \infty} \frac{n^2}{2^n}=0$  I tried to use $\mid \frac{n^2}{2^n} - 0 \mid <\epsilon $ However, because of $n^2$ I cannot use it. Also, I tried to use ratio test and I got $\lim_{n->\infty}\frac{(n+1)^2}{2}\frac{1}{n^2}$, but after that one, I dont know how to get limit < 0  I have no idea to solve this problem.   I can also use a squeez lemma, but dont know how to apply to this question.


org.hibernate.dialect.MySQLDialect                 true                 create                 jdbc:mysql://localhost:3306/redberry                 com.mysql.jdbc.Driver                            and                                                            org.hibernate.dialect.MySQLDialect                 true                 update                 jdbc:mysql://localhost:3306/redberry                 com.mysql.jdbc.Driver

I really want to know more about the update, export and the values that could be given to hibernate.hbm2ddl.auto I need to know when to use the update and when not? And what is the alternative?  These are changes that could happen over DB:   new tables new columns in old tables columns deleted data type of a column changed a type of a column changed its attributes tables dropped values of a column changed    In each case what is the best solution?


So it has been widely accepted that raw fish or "Sushi-graded" fish must be frozen below $-37C$ for a certain period before they can be defrosted and eaten raw. I have heard that even fresh fish must go through the freezing process to ensure bacteria are killed  I am just wondering can't we do this with just regular frozen fish in the supermarket provided it doesn't have other preservatives?   I mean in ancient times, the Japanese people didn't have commercial freezers and thermoeters to make all these measurements, so what did they do to ensure that their fish is "sushi-graded"? Something tells me the answer is simply just eating it fresh and raw.   Any sushi-chefs or someone who prepares a lot of sashimi can help?

Is it safe to consume raw fish purchased at the fish counter of a typical suburban grocery store? If not, do you have any tips for finding sushi grade fish. Also, are there requirements for safe sushi/sashimi beyond the use of safe fish?


I'm talking about the suggestions you (usually) get after you hold a key down for a few seconds. See image:    For some reason they suddenly stopped working for me. I honestly don't recall changing some preference directly related to this.  I would to re-enable it again but I cannot find a way to do it. Does someone know how to accomplish this?

How do I disable the display of popup which appears when holding down a key? It slows my typing speed and makes me do so many mistakes in my writing and programming. I need it at time when I wish to enter an alphabet twice.


public class LabWork { private String yourStatus; private int yourIncome; private double tax;  public int calculateTax () {     if (yourStatus = "Married" && yourIncome <= 2000) {         tax = yourIncome/10;     }     else if (yourStatus = "Married" && yourIncome > 2000) {     tax = 3*yourIncome/20;     }      else if (yourStatus = "Single" && yourIncome <=2000) {     tax = 17*yourIncome/100;     }     else     tax = 22*yourIncome/100;     }  public double getTax () {     return tax; }   }  this is my first code and I have a tester class to use this like:  import java.util.Scanner;   public class UseLab3Work {  public static void main(String[] args) {     Scanner keyboard = new Scanner(System.in);     System.out.println("What is your status? ");     String yourStatus = keyboard.next();     System.out.println("What is your incomew? ");     int yourIncome = keyboard.nextInt();  }   }  However, in the first program, I'm getting an error like "String cannot be converted to boolean" at line 7,10 and 14. Then how should I use if with String? For example I have input in tester and when I write there Married, the program should calculate tax related to my String input.

I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug.  Is == bad? When should it and should it not be used? What's the difference?


I am currently planning on self studying Non-linear dynamics, with an intention of developing a decent idea about it and see how its applied. I don't want to be too rigorous in my dealing with the subject right now.  I have just completed my first year as an MSc Physics student, so what are the books that would be good, at this level.

What textbook would you recommend for a bachelor in theoretical physics to study ? I don't want to focus too much on chaos, just having a broad view of every interesting characteristic is enough. Physical meaning behinds equations should be explained.  Some related resources:   , but obviously those are math-y.  While there are some overlaps, the evolution of a simple oscillator can evoke interesting dynamics characteristics. , but I'm not sure if studying only fluid dynamics is too narrow for me.


This is my code example and all seems to be working with inputting data, however when trying to export the input data to an output the code is returning the error:      "Exception in thread "main" java.lang.NullPointerException       at JavaProject.main(JavaProject.java:50)"   I have included a gyazo snapshot of how it looks and the error:    import java.util.Scanner; import java.io.FileWriter; import java.io.IOException; import java.util.Arrays;  public class JavaProject {      private static char[] input;      @SuppressWarnings("null")     public static void main(String[] args) {          int hrs, mins;         int[] gameCount;         int[] MinutesPlayed = null;         String GamerName, GamerReport;          //Main data storage arrays         String[] GameNames = new String[100];         int[] HighScores = new int[100];           Scanner Scan = new Scanner(System.in);          //formatting for output and input         System.out.println("////// Game Score Report Generator \\\\\\\\\\\\");         System.out.println("     ");          //user enters name and then moves to next line         System.out.println("Enter Your Name");         GamerName = Scan.nextLine();          //user is given an example of input format          System.out.println("Input Gamer Information " + "Using Format --> Game : Achievement Score : Minutes Played");         System.out.println("    ");           System.out.println("Game : Achievement Score : Minutes Played");         GamerReport = Scan.nextLine();           String[] splitUpReport; // an array of string         splitUpReport = GamerReport.split(":"); // split the text up on the colon          int i = 1;          //copy data from split text into main data storage arrays          GameNames[i] = splitUpReport[0];         HighScores[i] = Integer.parseInt(splitUpReport[1].trim() );         MinutesPlayed[i] = Integer.parseInt(splitUpReport[2].trim());          //output to file           try         {             FileWriter writer = new FileWriter("output.txt");             writer.write(GamerReport);             writer.close();         } catch (IOException e)         {             System.err.println("File does not exist!");         }

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


String S[] = new String[3]; String[] S = new String[3];   Both ways are proper in Java. Does it mean that for every type Type[] x is the same as Type x[]?

I have recently been thinking about the difference between the two ways of defining an array:   int[] array int array[]   Is there a difference?


My python code is just try to print all the permutation of a given list (num in my code). Here is my code  #!/usr/bin/python3              def permutation(list_num, checked_length, length):             if checked_length == length - 1:                 print(list_num)             else:                 for i in range(checked_length, length):                     list_num[i], list_num[checked_length] = list_num[checked_length], list_num[i]                     permutation(list_num, checked_length + 1, length)                     list_num[i], list_num[checked_length] = list_num[checked_length], list_num[i]           num = [1, 2, 3]         permutation(num, 0, len(num))   It gives out the result as i want to  [1, 2, 3] [1, 3, 2] [2, 1, 3] [2, 3, 1] [3, 2, 1] [3, 1, 2]   but when i try to change just a little. I want the output of that code to store in Answer_list. I got this unexpected result:  [[1, 2, 3], [1, 2, 3], [1, 2, 3], [1, 2, 3], [1, 2, 3], [1, 2, 3]]   Here is my code that got the result:          #!/usr/bin/python3     Answer_list = []     def permutation(list_num, checked_length, length):             if checked_length == length - 1:                 Answer_list.append(list_num) # change here             else:                 for i in range(checked_length, length):                     list_num[i], list_num[checked_length] = list_num[checked_length], list_num[i]                     permutation(list_num, checked_length + 1, length)                     list_num[i], list_num[checked_length] = list_num[checked_length], list_num[i]   num = [1, 2, 3] permutation(num, 0, len(num)) print(Answer_list)

I needed to create a list of lists in Python, so I typed the following: my_list = [[1] * 4] * 3  The list looked like this: [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]]    Then I changed one of the innermost values: my_list[0][0] = 5  Now my list looks like this: [[5, 1, 1, 1], [5, 1, 1, 1], [5, 1, 1, 1]]    which is not what I wanted or expected. Can someone please explain what's going on, and how to get around it?


I post this question because of a condition of human behavior. I don't know the name for it but, it is the phenomenom that we as humans assume that a person with a given label is incapable of erring. Therefore, our brains tell us there is no need to shop around.  I do apologize to all the moderators who feel slighted by this question. Please try to see it my way.  If a user with a low reputation posts an excellent answer, and a moderator posts an answer to the same question, the poster and other readers will naturally lean towards the moderator's point of view.    Here is a great example: The actual answer only received 390 up votes, while Jon Skeet's somewhat tongue-in-cheek answer received 793 upvotes, not including all the comment upvotes. (Ultimately, Jon points out his answer is flippant, and it was not selected.)  One comment even suggests...     @Jon Skeet, press space bar for 10 times and than put a "." I bet you will still get upvotes, This is hilarious! – krio yesterday   The other issue comes from the mentality. I know I have thought this before: "Oh [They] already answered it, I'm sure it's right… Why should I bother providing my answer?"  I think moderators should avoid answering questions. If they find a question that they want to answer, instead of answering maybe provide comments that the poster or readers will encourage more activity and possibly result in an answer.

It's not that I feel bitter when somebody else's answer is upvoted above my own, but it's when a user with a high rep answers a question and their answer seems to attract an immediate barrage of upvotes.  Now I'm not saying that these votes are always unwarranted, but by simply observing this behavior, I think the system seems flawed.    The concept of reputation (or at least one of the concepts) is to give users a sense of trust in the reputed user's answers.  But this should be trust, not blind faith.  I know that this problem doesn't exist for every question asked on SO, but it's definitely present.  I'm sure this is a contentious question, as it might seem overly critical, but does anybody else agree with me and, if so, does anybody have any thoughts on how this problem could be alleviated? It's a great shame when a new or less active user's answer is stifled by the reputation-rich user's answer.


I update the texlive update to date, and find the ball type outlines of beamer disappeared when using xelatex to compile, but lualatex work(the un-updated xelatex also work). But lualatex is so slow, I'd like to use xelatex than it. Here are the compile results of the beamer conference talk example. The first is xelatex and the other is the original pdf from texlive.

Beamer item balls go missing while compiling in XeLateX since yesterday's TeXlive update, however, the same code works with pdfLaTeX. Any solution, please. Here is my MWE: \documentclass{beamer}  \setbeamertemplate{itemize item}[ball] \setbeamertemplate{enumerate item}[ball]  \begin{document}  \begin{frame} \frametitle{A tested title} text \begin{enumerate}     \item this is an item \end{enumerate} text3 \begin{itemize}     \item this is an item \end{itemize} \end{frame} \end{document}


I have a number of files I need copied to different networked locations.  However, it is a regular occurrence that the sub-directories need to be created.  I considered building an app to do this, but I'd rather not "re-invent the wheel" if I don't need to.  An example would be as follows:  Copying:   C:\ProjectFolder\Project\WCB\2010\CA\ON\EmployeeReport.aspx.cs   To:  \\Server1\Downloads\Patches\Web\Project\   would end up copying the file to:  \\Server1\Downloads\Patches\Web\Project\WCB\2010\CA\ON\EmployeeReport.aspx.cs   (because "Project" is common in both paths, that's the starting point where we'd need to create the new path.)  Any suggestions?  -- Post Update: Sorry, it seems this is a duplicate of   The answer, although there isn't an automated way of doing this (maybe I'll write that utility after all) is using XCOPY:  XCOPY C:\ProjectFolder\Project\WCB\2010\CA\ON\EmployeeReport.aspx.cs \\Server1\Downloads\Patches\Web\Project\WCB\2010\CA\ON\EmployeeReport.aspx.cs

How can I copy a file using DOS commands into a directory structure that may not yet exist? I need to be able to force the creation of the directory path to the target file location if that location doesn't already exist.  For example, there is already a file.txt in this location:  C:\file.txt   And I want to copy it to  C:\example\new\path\to\copy\of\file\file.txt   but at this time  C:\example\   and all the subdirectories may or may not yet exist.  Basically, I am looking for a "copy and create the target path if necessary" command. What would you recommend is the best way to achieve this?


I have a residency of Ukraine and two valid passports. One is an old non-biometric, and the new one biometric. In a few months I have a flight from Ukraine to Germany and from Germany to Morocco with Ryanair. Both flights booked using my new passport data. I am allowed to enter Germany (and other Schengen countries) without visa using my new biometric passport (and so I will). However I need a visa for Morocco and let's assume I have it in my other passport. I assume there will be no problems with the border authorities, but what about Ryanair visa check before my Germany - Morocco flight? Is it ok to have a plane ticket booked using one passport and having my visa in another?  UPD:  My question is rather will there be any problems on Ryanair visa check with two passports (one with the visa in it and another used for ticket booking), than just about travelling with two passports.

I am a citizen of two different countries, and have two passports.  How should I use my passports when traveling?


In previous versions of blender you could have the background image be always lined up with the camera, so it was possible to align the 3D view to match with the perspective of a reference image.     in 2.8    Is there a setting I don't know to do this? I really would love to avoid using constraints on the empty.

Cannot find Background Images feature to add in a photo in Blender 2.8  Where is it?