How can I prove this:     Let $A$ be a local regular ring with maximal ideal $\mathfrak m$ and $x \in \mathfrak m-\mathfrak m^2$. Then $A/(x)$ is a regular ring. Prove also that if $x\in\mathfrak m^2$, $x\ne 0$, the result does not hold anymore.   I don't know how to begin! Thanks to everyone who helps!  But if $d=\infty$?


Replace occurrences of character in filenames

How can I replace all the occurrences of the + character in all the filenames in the current working directory with the space character?  I know that there's the linux command rename but I'm not sure how I'd use it to do this.  Example:  Early+Christians -> Early Christians


How can I set custom key bindings and key macros on Mac OS X?

I recently upgraded to Snow Leopard, from Leopard and I was using an awesome app called  that let you remap your keys, set scripts/macros and even had repeat functionality.   However, this app doesn't seem to be in active development anymore, and 10.6 broke the ability to bind certain modifier keys (Shift) with other keys.   I totally miss things like Shift+Insert for paste (Linux/Windows), setting Ctrl+Shift+Esc for Activity Monitor, and Ctrl+Alt+Del for the login window.   So, how can I achieve this instead?


Comma-separated column into new column as integer


Why is $f(4)$ the area under $f'(x)$ specifically from $0$ to $4$ and not for ex from $1$ to $4$ or $2$ to $4$?

I've seen the geometric argument for why any differentiable function $f(x)$ gives the rate of change of the area under its own curve to $x$ for a specific input $x$, and it makes sense to me.  It also makes sense that if $f(x)$ gives you $\frac{dA}{dx}$, then $F(x)$, its antiderivative, should give you the actual area under the curve of $f(x)$.  What I don't understand however, is why does $F(x)$ give you the area from $\textbf{0}$ specifically to $x$ given a single input $x$? In other words, where does that $0$ come from?  Because $f(x)$ gives you $\frac{dA}{dx}$ at $x$ regardless of how much area comes "before" (for smaller values of $x$).   How do we decide that $F(x)$ starts computing the area under the curve of $f(x)$ from $0$ and not some other starting point? Obviously it's very convenient but it seems pretty arbitrary to me.


Due to a mishap with my main profile I am wondering if anyone could assist me in making my secondary profile the administrator.   Something went wrong with my primary profile and I can no longer see anything but my desktop/shortcuts. I cannot get the command terminal to pop up or anything. Considering this last piece of information, I am interested in giving my secondary profile the administrator position so that I can use sudo commands. Otherwise, I cannot properly download programs.   Is there anyone who has knowledge on how to do this or has any other suggestions I can attempt? Thank you in advance!  Aaron


How can an electrically neutral planetary core be geodynamo?

The standard theory for the earth's magnetic field is that the planet's core is a geodynamo.  I know moving electric charges can induce a magnetic field, but I also know that opposite charges produce opposite fields, and unless I missed something, normal matter has no net charge on the macro level.  In Maxwell's equations, $\mathrm{\textbf{J}}=0$ means $\mathrm{\textbf{B}}=0$, correct?  So if the Earth's core is electrically neutral, how is geodynamism possible?


How to create this curved shadow in Photoshop?

How to create the shadow effect like the URL/image below? Specifically, the rounded/curved shadow at the bottom:


Search Google for domains rather than pages

I want to search for job sites in Alberta, Canada. One way to proceed is to do the usual Google search for them and then somehow loop through the results for the domains that seem to correspond to job sites.  Many of them will come from the principal job sites such as monster.com or indeed.ca. Fewer will come from lesser known sites that would still be of interest to job seekers. What I want to be able to do is to collect domains and subdomains.   For instance, and thinking procedurally, once I have encountered and noted monster.com I want to ignore subsequence occurrences of it. I want to continue to look for distinct, new domains and subdomains. Any thoughts?  I haven't found a way of doing this with any collection of Google operators. Is there a way? If that's not possible, what would be a good way of doing it?


How do you find all implementations of an interface?

Suppose you have an interface defined in C#.  What is the easiest method to find all classes that provide an implementation of the interface?  The brute force method would be to use "Find References" in Visual Studio and manually look through the results to separate out the usages from the implementations, but for an interface in a large codebase that is heavily referenced with relatively few implementations, this can be time consuming and error prone.  In Java, running javadoc on the codebase (using the -private option to include private classes) would generate a documentation page for the interface (e.g. ) that includes all implementing classes for the interface as well as any subinterfaces (though it doesn't include implementing classes of the subinterfaces, these are relatively easy to determine by drilling down into the listed subinterfaces).  It's this functionality that I'm looking for but with C# and Visual Studio.


I deleted my Linux (Ubuntu) partition from Windows and I forgot to repair the MBR. I don't have my windows boot CD with me nor a CD drive. Is there any small utility that can be easily downloaded (I know about hiren CD but it's about 500 MB and I don't need that whole stuff) and which can be used from an USB drive? If yes, please explain the steps to perform. Thank you   UPDATED: Small Linux live CDs are OK since I can boot them from an USB drive using


How can I declare a struct array with the size 2^18

This is my struct  struct Entry {     int a;     int b; };  int main() {      struct Entry data[260000]; //ok     struct Entry data[262144]; //crash      return 0; }   I want to declare an array of Entry with the size is 2^18 (262144 elements) But I'm not able to do so. It seems like I go beyond the max. Is there another way to do this?


Back to the Future : DeLorean Iced after Time Travel

In the first part, there is a scene when Doc shows Marty the demonstration of time travel. Afterwards,when Einstein returned, the DeLorean is covered in ice.  What is the reason for this? If that happened due to time travel, why was it not shown after other time travels?


In which order should I start watching Star Trek?

I don't know anything about Star Trek except for the fact that it's about spaceships.  In  the person only wanted to watch the TV series. I want to watch every movie and TV series there is about Star Trek but I don't know where to start. I found this page on  which is about a time line. Do I need to watch it in this order? Are the movies and TV series related?


The bellow example show that the compact Hausdorff $\beta X$ does not have  non-trivial subsequence:  Assume $R=(\mathcal{U}_n)_n$ is a sequence of distinct ultrafilters on some set $X$. Since every Hausdorff space has an infinite discrete subspace, there is a subsequence $R=(\mathcal{V}_n)_n$ of $R=(\mathcal{U}_n)_n$ such that $\{\mathcal{V}_n|n \in \mathbb{N} \}$ is a discrete subspace of $\beta X$. In particular, there is a sequence $(A_n)_n$ of sets with $A_n \in \mathcal{V}_m$ if and only if $m =n$. If we let $B_n=A_n - (A_0 \cup...\cup A_{n−1})$, then the sequence $(B_n)_n$ is pairwise disjoint and $B_n \in \mathcal{V}_m$  iff $m=n$. If we let $B =\cup_n B_{2n}$, then $B \in \mathcal{V}_m$ if and only if $m$ is even. In other words, if $B =\{ \mathcal{V} \in βX|B \in \mathcal{V}\}$, then $B$ is a clopen set with $\mathcal{V}_m \in B$ iff $m$ is even. Therefore, we conclude that the sequence $(\mathcal{V}_m)_m$ cannot converge to any point, so the sequence $(\mathcal{U}_n)_n$ cannot converge to any point either.     I would like to know that:      (1) :What does it mean "sequence of distinct ultrafilters on some set $X$"?I mean, is it possible to define different ultrafilters on some set $X$?      (2) Why "$B_n \in \mathcal{V}_m$  iff $m=n$"? And " $B =\cup_n B_{2n}$, then $B \in \mathcal{V}_m$ if and only if $m$ is even "?      (3)$B$ is a clopen set with $\mathcal{V}_m \in B$ iff $m$ is even


Can you Plane Shift to the plane that you're on?

What happens if you cast  and then attempt to shift to the plane that you're on?  I can think of a few reasons this might happen in-game:   For some reason, the PCs don't know what plane they're on, so they try to plane shift to their current plane. PCs who don't have teleport memorized find themselves in over their heads, and want to use plane shift to escape from their current location (but don't actually want to go to another plane).   I can think of a few possible results:   The spell functions as normal.  The targets immediately move elsewhere on the same plane, arriving 5 to 500 miles from their intended destination. The spell fails without explanation, so PCs in situation #1 still don't find out what plane they're on. The spell fails, but it is somehow obvious why.  PCs in situation #1 find out that they're already on the plane they were trying to go to.   Are there any possibilities I'm missing?  Has this issue been addressed explicitly in any edition of D&D or Pathfinder?  What actually happens in Pathfinder?


Should I use is or are in this sentence?     100 apples are/is considered as a large number of apples.


How to prove that if $a\equiv b \pmod{kn}$ then $a^k\equiv b^k \pmod{k^2n}$

What I have done is this:  $a\equiv b \pmod{2n}$,  $a=b+c\times2n$, for some $c$,  $a^2=b^2+2b\times c\times2n+c^2\times2^2n^2$,  $a^2-b^2=(b\times c+c^2n)\times4n$, then  $a^2\equiv b^2\pmod{2^2n}$.  I think that this is right: what I DON’T understand is how to generalize this to:  $a\equiv b\pmod{kn}\Rightarrow a^k\equiv b^k \pmod{k^2n}$.  Please give me a hint.


I'm seeing the red alert on sites where there's nothing to review:    That's from Community Building, where I'm pretty sure the queues are empty.  I also just saw it on Worldbuilding meta, where I'm a moderator and also see nothing special (like pending VLQ/NAA flags).  And it's sticking around after I close the dialogue.  Visiting one of the review queues from the drop-down didn't dismiss it either.


I am writing a paper using the elsarticle document class. However, the article contains a long table which is sent to the next page, in the middle of the page although I have specified the position as 'here'. Is there any way to make the table split if one page is not long enough for the table? Thank you very much for your very kind help.


Prove that $\operatorname{Hom}_{\Bbb{Z}}(\Bbb{Q},\Bbb{Z}) = 0$ and show that $\Bbb{Q}$ is not a projective $\Bbb{Z}$-module.

1) Prove that $\operatorname{Hom}_{\Bbb{Z}}(\Bbb{Q},\Bbb{Z}) = 0$.       2) Show that $\Bbb{Q}$ is not a projective $\Bbb{Z}$-module.    1) We know that $\Bbb{Q}$ is an injective $\Bbb{Z}$-module.  This implies that every short exact sequence $$0 \rightarrow \Bbb{Q} \xrightarrow{f} A \xrightarrow{g} B \rightarrow 0$$ is split exact.   In particular,   $$0 \rightarrow \Bbb{Q} \xrightarrow{f}  \Bbb{Z} \xrightarrow{g} A \rightarrow 0$$  is split exact.   But this implies that we have a homomorphism $k: \Bbb{Z} \rightarrow \Bbb{Q}$  such that $kf = 1_{\Bbb{Q}}$.  So we need to look at what possible homomorphisms we could have from $\Bbb{Z}$ to $\Bbb{Q}$. Since $\Bbb{Z}$ is cyclic, the homomorphism $k$ is determined by where it sends $1$. Suppose that we send $1$ to $q \in \Bbb{Q}$ such that $q \not= 1$ and $q \not= 0$. Let $m \in \Bbb{Z}$. Then  $$k(m) = mk(1) = mq$$   But then   $$qmq = k(1)k(m) \not= k(m) = mq$$   So either $1 \in \Bbb{Z}$ must be sent to $1 \in \Bbb{Q}$ or $k$ can be the trivial homomorphism.  But if $1_{\Bbb{Z}}$ is sent to $1_{\Bbb{Q}}$, then $k$ must be the inclusion map. However in order to for $kf = 1_{\Bbb{Q}}$ to hold, $f$ must also sent $z$ to $z$ for all $z \in \Bbb{Q}$. But if that's the case, then for any $a/b \in \Bbb{Q}$ where $b \not= 0, 1$, we have (for $n \in \Bbb{Z}$) $$f(a/b) = n = f(n)$$  and this contradicts the fact that $f$ must be injective (since the sequence is exact).      So the only possible $\Bbb{Z}$-module map from $\Bbb{Z}$ to $\Bbb{Q}$ is $0$.   Do you think my answer is correct?   2) I was wondering if anybody could give a hint on this one, because I couldn't really get started.  Thanks in advance.


Number of views for Booster and Publicist

Is it possible to know how many views form unique IP addresses a shared question has received to track Announcer, Booster, Publicist badges?


Do plant cells recycle carbon dioxide from their respiration during photosynthesis?

It seems one of my colleague's biology textbook claims that plant cells, with presence of light, feed back 100% of carbon dioxide molecules from their respiration into photosynthesis. Can you say that carbon dioxide molecules, gas or dissolved, get transferred from the mitochondria to the chloroplast?


java.lang.NullPointerException .in files.length i think

please help me.i write this code :  public class MainActivity extends AppCompatActivity {      @Override     protected void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         setContentView(R.layout.activity_main);         File dir=Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS);         File[] files=dir.listFiles();         Toast.makeText(this,files.length+"",Toast.LENGTH_LONG).show();      } }   and it has this error :  Caused by: java.lang.NullPointerException     at ir.itpro.videosample.MainActivity.onCreate(MainActivity.java:20)   i put 3 files in directory downloads .  how to fix it now??


Is there a way to go directly to chat through commens?

I have noticed that when you are exchanging comments with someone under an answer, and reach a certain number of comments, you are opted to start a chat instead. Is it possible to initiate this right away? If not, could you make it possible?  My example of when this could be nice to have is this: I wrote a general answer to a question about Hibernate, and after some time someone asked a quite specific question in a comment underneath my answer. I would like to help out, but still it would be nice not to clutter my general answer with very specific comments. In this case I would have liked to just initiate a chat with the person asking right away, and then avoid a long comment conversation that really is quite irrelevant to the actual answer.


Is the set of all irrational numbers in [0; 1] a Borel set? If yes, what is its Lebesgue measure? I have been trying to answer this for a long time now. I know that the set of rational numbers is infinitely countable but I am having trouble with the proof of this question. I am not necessarily looking for an answer just confirmation that I am doing the correct thing.  I have already tried the following: The set of rationals is countable between 0 and 1 and is therefore a Borel Set. Since it is countable its lebesgue measure is 0


How do i create a partition, so all users can read wrie execute files without any permissions?

I have a 160 GB hard drive and i need to create a separate partition so all users can access the files (mostly music, movies, pictures), without requiring any authentication from the administrator or other users.  BTW i'm new to Ubuntu


GHDL in Ubuntu 18.040 LTS GTKWAVE VLSI FPGA VHDL

Looking Terminal commands to install GHDL and GTK WAVE in Ubuntu 18.04 LTS  Operating System  Error shown below -  shivam@shivam-Inspiron-N5010:~$ sudo apt-get install ghdl gtkwave Reading package lists... Done Building dependency tree        Reading state information... Done Package ghdl is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source   Kindly help me out.


How do I know which File Systems my linux supports?

I am working with linux 3.19.0+ and I want to know if my linux kernel supports f2fs (Flash-Friendly File System). How do I know that?


What is the meaning of 'IN' in new YouTube logo previously it used to be 'TM'?

Go to youtube website see its logo in top left corner. 'IN' is shown as superscript to logo. I tried searching on Google and Wikipedia but couldn't find any information.


How to add a Google Map to search results?

How can I get a business map location displayed along with the Google search results page?


pdo insert into with variable as table (mysql)

I try to make and INSERT INTO with a variable for table but i can't make it work.  here is my code :      $tb = "mytable" ; $req = $bdd->prepare('INSERT INTO :tb (users, info)                 VALUES(:users, :info)')             or exit(print_r($req->errorInfo())); $req->execute(array(             'tb' => $tb,                 'users' => $name,             'info' => $website,             ));   I get this message : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''mytable' (users, info' at line 1 )   I really don't know what i should change...  thanks a lot


Are there methods to make an Iron Door open through right clicking while holding a specific item?

I want to know if one can open an iron door via right clicking, perhaps with a specific item in one's hand?  Edit: Since 1.8, there is a "lock" command. Does this command work with buttons? Or is it only for chests?


I have an Intel dual core PC with 4GB of RAM and Graphics card. For on of my student Assignment I need to install Latest possible MAC OS on my system as a secondary OS.  Like on boot it asks me that which OS i want to boot with Win 8.1 or Mac Os..  I searched on the internet and found two conflicting opinion some people said there are few MAC OS Version which can be directly installed on Intel PCs some says there aren't?   I am here to get rid of the confusion that is an official latest possible MAC OS version for Intel based PCs? If not what are my options if I want to run MAC OS on my PC.   Please not that Virtualization options won’t work for me, it has to be working as full OS not an os inside another.


Site is suddenly not apearing for main Keyword on google no errors can be found

My site: www.lovespells24.com ist suddenly not showing up on google for its main keyword " love spells". It has been consistently on page 5 and 6 and today can't be found, I checked multiple times all pages, nothing.  Webmaster tools show no errors, the site is white hat no spam links that I would know about. Can someone please help? Why is it not showing up anymore?  It is not even found on the last pages, its simply gone. It is indexed, when I type in the url it shows my site.  Any help would be apreciated.


Finder sidebar flashing text and high CPU load since El Capitan

After update to OS X 10.11 I started having these bugs:   Finder sidebar text flashing  Very high CPU load:      I have Macbook Pro Retina 13" Mid 2014  I reset NVRAM.  I deleted com.apple.finder.plist, it didn't help.  Also I did this: , no longer flashes.


The other day I've learned that you cannot use "to" in the sentence "I am going (to) home". At the same time, you should use "to" with other place names. For example, I am going to work.    Could someone, please, explain the rule why we cannot use "to" with the word home? Are there any other words that we should use without "to"?


How can I access the RGB values of a UIColor?

I have an iOS drawing app with buttons that let a user choose colors to draw with. Since my brush uses RGB values but my color constants are UIColors, I need to convert. I tried  private var currentButton: UIButton? {     willSet{         currentButton?.layer.borderWidth = 0     }     didSet{         currentButton?.layer.borderWidth = 2         let index = (currentButton?.tag)! - 1         drawView.brush.blue = colors[index].ciColor.blue //Here is where I get the error         drawView.brush.green = colors[index].ciColor.green         drawView.brush.red = colors[index].ciColor.red     } }   Which I found in another StackOverflow question. However, when I try to get an RGB value in line 8 I get this error:  Terminating app due to uncaught exception  'NSInvalidArgumentException', reason: '*** -CIColor not defined for the UIColor UIExtendedSRGBColorSpace 1 1 1 1; need to first convert colorspace.'   It clearly says that I need to convert color space. But CIColor.colorSpace is get-only. What am I doing wrong?


Prove: For any real number $a$, $b$ : $|a - b| \ge |a| -|b|$

I think this question has to do with field axioms so was wondering if you can claim that  $$|a - b| - |a| - |b| \ge 0$$ and go from there.


Download SQL Server Profiler for SQL Server Management Studio

How can I profile a SQL Server 2008 database to see code that's being executed on a particular database?  I remember using the SQL Server profiler, but I don't see it in SQL Server Management Studio after downloading SQL Server 2008 R2 Express.  Where can I download that tool and install it?  Do I need the full version of SQL Server 2008 in order to see this option?


IPA, Accents, and dictionaries, British and American Phonetics

As a non native english speaker, I'm trying to work on my accent. I've taken a lot of bad habits so I'm trying to go back to the fundamentals meaning learning phonetics. But they seem very imprecise to me. For example the word hand.    Here the UK seems to pronounce the æ like it's really a single sound and the USA pronounce it more like two sounds: starting like hen then joing the ~ha sound. With such a big emphasis on the hen sound that if the word were pronounced quicker I think I would have heard it as hen with a d.  Now if I trust what I hear , the USA seems to be right.  But this pronunciation seems to be very, very inconsistent. The word cat (same phonetics):    Here we have the same kind of pronunciation variation but "reversed". The USA cat is closer to the UK's than the USA hand but we can still hear a little hen sound at the beginning.  Now, worse : trap    Here the UK and the USA are strongly agreeing on disagreeing with the IPA pronunciation of æ pronunciation I linked before.  So, why two clearly different pronunciations have the same phonetics symbols ?  Why the same phonetic symbol can be pronounced so differently from a word to another within the same "accent" ?  Are phonetics simply unreliable and should only be used to know roughly how a word should be pronounced ?  Would the most effective method to be sure I pronounce a word correctly be to search on internet for video or audio samples of people pronoucing them in context ?


Can I (and do I ever want to) set the maximum heap size in .net?

Coming from a java background, one of the things I am used to is telling the JVM what the maximum heap size should be.  If the running program tries to swallow more than is allowed, and the garbage collector cannot free any more resources, then OutOfMemoryError is thrown and it all goes bang.  So setting the maximum heap size is important in Java.  Does this apply in .net?  Can you set the heap size limits?  Does the CLR just keep growing its heap until it reaches the machine's physical limits?  Or is it not an issue in .net for some subtle reason that my Java blinkers stop me from seeing?


If $f(0) = 0$ and $|f'(x)|\leq |f(x)|$ for all $x\in\mathbb{R}$ then $f\equiv 0$

Let $f:\mathbb{R}\rightarrow\mathbb{R}$ be a continuous and differentiable function in all $\mathbb{R}$. If $f(0)=0$ and $|f'(x)|\leq |f(x)|$ for all  $x\in\mathbb{R}$, then $f\equiv 0$.  I've been trying to prove this using the Mean Value Theorem, but I can't get to the result. Can someone help?


This might seem stupid, but what actually the meta site does? The chat site is for general discussions that might be off-topic. But what is meta site used for?   So that next time when I ask a question, it's for sure that I am asking a questions that's related to the site.  Edit: I wasn't able to edit this, so here it goes. The answer I got was "The meta is a subdomain for a website which is entirely dedicated to the site itself!".


What kind of ship was flying away from Rey in her flashback?

The ship flying away from Rey in her flashback of being left on Jakku looks like one of the ships in the group that takes her away when she is captured.  If so, and it is a First Order ship that dropped her off, this is an interesting Easter egg.


Unable to login to account in ubuntu 18.04 vmware workstation 15, after update

I installed the latest updates from the software update center today (I update when ubuntu displays a notification), restarted the machine and now it's unable to boot properly. The best screen I can get is displayed below. If I resize the screen then it goes to black. If I restart the machine then it displays just purple.    Note that the screen is unresponsive, I can't click anything on it.  Other than SMBus Host Controller not enabled! I don't see any other warnings. Note that I don't know if this warning existed before the update.  I'm running ubuntu 18.04 in vwmare workstation 15 player (latest update). Any ideas on how to begin debugging this?    Update: Trying to boot Ubuntu, with Linux 4.15.0-50-generic instead of Ubuntu, with Linux 4.15.0-51-generic didn't help.  Update: Blacklisting i2c-piix4 according to  answer didn't remove the warning or fix the issue.  Update: Blacklisting i2c-piix4 according to  answer removed the warning but didn't fix the issue.  Update: The answer from Uzair helped me log into the account (run dpkg and update grub from recovery mode).  Answer:  answer helped me fully to resolve the issue. I don't understand the fix. If anyone does, put it as the answer and I'll mark it as such.  Regarding duplicity: The answer from another question did solve my issue but I don't think my question is a duplicate of that one. I began with a fresh install of 18.04 a few months ago, did several updates without an issue and only today experienced issues which are different than those described in the other question. I think we experienced different bugs with wayland and we both solved it by disabling it which is a destructive solution applicable to many questions.


I own a trek 7000 hybrid and was wondering if there are aftermarket parts i.e. inner tubes and tires that will work for it. the wheels, tubes and tires are all bontrager if this helps any suggestions?


How do I increase the terminal border size in xfce?

The terminal (and other applications) borders seem to be only 1 pixel wide which makes them almost impossible to click. I am aware that alt+right click has the same function, but I need the borders able to be clicked. I found this solution:    but unfortunately it did not work for me (i'm using Greybird as a theme, I tried the same fix with Bluebird and it also didn't work). I am using Xubuntu 12.04 xfce by the way. Any help would be appreciated!


Why did Sauron keep Mount Doom alive after forging of the One Ring?

Sauron knew that the One Ring could be destroyed only in Mount Doom, where it was forged. From Sauron's perspective, no one would think about destroying the One Ring. But if someone did, then Mount Doom would be the only place to do so.  Why did he keep Mount Doom active? Wasn't the risk too high?


Find min natural number $n$ so that $2^{2002}$ divides $2001^{n}-1$

Can someone explain me how this type of examples are being solved? I know that I can watch this example like this $2001^{n}\equiv 1\ ({\rm mod}\ 2^{2002})$ but I don't know what to do when the divisor is such a large number like $2^{2002}$  $2^{2002}|2001^{n}-1$


Render one or another column only if data is present?

I'm a relative newbie working on SP2013 w/o SPD. I have a lookup column for NAMEPD and a text column for NAME NOT FOUND on the same list. NAMEPD is a simple dropdown choice, NAME NOT FOUND is there for the user to input a name in case one is not in the NAMEPD. Is there a calculated column method for displaying the data from either of these columns if data is present?  I have creating a calculated column named NAME1 with the formula =[NAMEPD]&" "&[NAME NOT FOUND] but get the following error:      "One or more column references are not allowed, because the columns   are defined as a data type that is not supported in formulas."   Any help is greatly appreciated.


Why is this var still defined when the cb runs asynchronously?

This happens to be from a Chrome extension, but I believe this is a pertinent general JS question. I have a working func like so to access local storage:  function loadItem(sName, callback){     var get = {};     get[sName] = {}; //blank obj by default.     chrome.storage.local.get(get, function(data) {         data[sName] && callback(data[sName]);     }); };   When I invoke loadItem's callback in an asynchronously-called "outer" callback, I make use of loadItem's arg sName. Why is that defined in there? Shouldn't the asynchronous callback not recognise that var because loadItem has finished running and sName was not provided as one of the callback's own args?


Is there a single word that describes both Witches and Wizards?

In the Harry Potter world, there's the term "muggle" for people with no magical abilities, "muggle-born" for those with magical abilities who's parents are muggles and "squib" for those with no magical abilities who's parents are magical.  But is there any collective term for all magical people (as opposed to wizards for males and witches for females)?  I don't recall seeing any word that refers to all men and women and children with magical abilities, and it's the only group left without noun or collective noun to describe them.


This is a RHEL server, I'm running a MySQL server on it, the database and log files (however, logging is disabled) are located on the /srv directory where plenty of space is available.  Recently I had a crashed table, so I tried fixing it but on the next day I found that MySQL can't respond to many of queries with an error indicating that there is no disk space:  ERROR 1030 (HY000): Got error 28 from storage engine   So I ran the following command to see what's taking space  [root@tms /]# df -h Filesystem            Size  Used Avail Use% Mounted on /dev/mapper/server-slash                       9.9G  9.5G     0 100% / tmpfs                 7.8G     0  7.8G   0% /dev/shm /dev/sda1             485M   58M  402M  13% /boot /dev/mapper/server-var                       739G  252G  450G  36% /srv   Surprisingly it's the / directory. But more surprisingly is that the directories under / do not indicate used space more than 2 GB, while df shows total space 9.9 GB for /.  [root@tms /]# du -sh /* 7.5M    /bin 48M     /boot 200K    /dev 24M     /etc 4.0K    /home 223M    /lib 21M     /lib64 16K     /lost+found 4.0K    /media 4.0K    /mnt 183M    /opt ...deleted some file-not-found errors for files under /proc 0       /proc 144K    /root 14M     /sbin 4.0K    /selinux 252G    /srv 0       /sys 44K     /tmp 917M    /usr 259M    /var   So why does df show wrong values ? And how can I findout what's actually taking space ?


QGIS: How to store the GPS coordinates in the attribute table?

I got vector points on a map. I already have the elevation information in the table for each vector point and the point-id. Now I want to get the GPS coordinates for each point stored in this attribute table. How can I do that?  Overall my aim is to get to know the gradient on this line which I divided into those points.


Today I flagged  as "low-quality", since it mainly consist in a link to a blog post and a pretty neutral opinion.   The link itself is not really useful too - though interesting, it doesn't deal with the question topic (which is, by the way, pretty opinion-based, and attracted a lot of link-only answers), but nonetheless I decided to avoid the "Not an answer" flag and go for the closest to what I feel.  The flag now is marked as disputed (I know what that means), but is it really? Moreover, two high-rep users already commented on it (with somewhat contrasting opinions, but both think the answer isn't enough), so that should enforce my flag, or at least give it some acknowledgment.  I know, "Just walk way and go on", but I'd like to have a better understanding of it.


What is the difference between: C Shell variants and Bourne Shell variants?  I must install a scientific software, during the installation I must write   ./configure >& config.out & ## C Shell variants  ./configure > config.out 2>&1 & ## Bourne Shell variants   just to have idea about this.


Remove words from a list which have recurring characters in Python3

When I run this code:  li=["It","is","funny","how","I","fiddled","with","this"] for i in range(0,len(li)):     word=li[i]     for j in range(0,len(word)-1):         if word[j] == word[j+1]:             li.pop(i)             break print(li)   My desired output is:  ['It','is','how','I','with','this']   However, I get the following error message:  Traceback (most recent call last): File "fiddle.py", line 3, in <module> word=li[i] IndexError: list index out of range   Please point out the mistake in my code.


show checkbox before every contact using wrapper class

I'm trying to fetch the contact record and showing on page using  its showing error      Unknown property EditContact_controller.wrapperClass.conList   Which thing is unknown.  here is my controller  public class EditContact_controller{     public List<wrapperClass> wrapClassList{get;set;}     public List<contact> conList;     public wrapperClass wc{get;set;}      public EditContact_controller(){         wrapClassList = new List<wrapperClass>();         conList = new List<Contact>();         conList = [SELECT Id, FirstName, LastName FROM Contact LIMIT 10];         For(Contact co : conList){             wc = new wrapperClass();             wc.flag = false;             wc.conWrap = co;             wrapClassList.add(wc);         }     }     public class wrapperClass{         public boolean flag{get;set;}         public Contact conWrap{get;set;}       }     }   Here is my VFPage  <apex:page controller="EditContact_controller" tabStyle="Contact"> <apex:form id="frm">     <apex:pageBlock title="Contact Records">          <apex:repeat value="{!wrapClassList}" var="contactTable" id="cont_Table">             <table>                 <tr>                     <th> Action </th>                 </tr>                  <tr>                     <th> First Name </th>                 </tr>                  <tr>                      <th> Last Name </th>                 </tr>                   <tr>                     <td> <apex:inputCheckbox value="{!contactTable.flag}"/> </td>                 </tr>                  <tr>                     <td> <apex:outputField value="{!contactTable.conList.FirstName}"/> </td>                 </tr>                  <tr>                     <td> <apex:outputField value="{!contactTable.conList.LastName}"/> </td>                 </tr>               </table>                    </apex:repeat>      </apex:pageBlock>  </apex:form>


Python cant open a file path written on a text document if it isn't on the last line

Help So, I'm still a starter on python and I decided to make a simple program that, when you tell it the ingredients you have in your home, it tells you some recipes to make. I decided to make it based on a text file, which means I will have a text file with the ingredients sorted out on it, and if the ingredients the person typed in match the ones on the file, it will read the line under them, which will contain a path for another text file which will have the full recipe for the person to read. The code works IF there is no line under the line with the path to the file. Which is weird, because when I changed it to print, not open the file path, it printed it out correctly, but when I try to make python open it, it displays this error message: Traceback (most recent call last):  File "C:/Users/nailu/PycharmProjects/Recipe find yes/find rcipe.py", line 66, in <module>  g = open(file.readline())  OSError: [Errno 22] Invalid argument: 'C://Users//nailu//Desktop//Projeto receita//Receitas//receita bolo de maca.txt\n'  please help, it keeps saying theres a \n in there when there isnt! Here is the code in case you guys need some context word=input("Digite aqui:")   count = 1 count2 = 1    s=" " while (s):     s = file.readline()     L = s.split()     if palavro in L:         print("I found a recipe for you!")         time.sleep(1)         see=input("Would you like to see it?  y/n")         if see=="y":             g = "a"             g = open(file.readline())             h=" "             while (h):                 h = g.readline()                 print(h)                 count2= (count2+ 1)                 time.sleep(1)         else:             print("Ok, going over to the next recipe...")         time.sleep(0.5


How can we make the code formatting button more discoverable?

Today, after being on StackOverflow for five years, I have discovered the { } button, after reading some blog post. My life was changed.  Well, not exactly, but it did make it a lot easier to indent code in questions asked by SO beginners. Before today, I would copy/paste the code in a local editor, indent, then paste back. That, even though I was visually aware of the button since I clicked the "image" icon to its right many times to paste or insert images.  And I'm .  Proposal  One way to alleviate the problem is to make said code button less easy to overlook. How can we make it more easily discoverable?   Move it towards the left (except for right-to-left sites) in the toolbar, based on its frequency of use. I'd guess that it's the most useful tool, perhaps after the link tool. B and I I think are rarely used, because it's comparatively much easier to just type * or _ before and after the text.   This move could be applied only on code-related SE sites. If the { } button were placed before B, it would be hard to miss, while B and I would be also highly visible (and familiar from the toolbars in many other editors). A slight, subtle, one-time emphasis on the code button (just like the one we have when landing on an anchor, a fading out light orange border - ), for first-time users, perhaps when unindented code is detected (we already have an ). After the button is clicked for the first time, the user's profile would store a flag indicating that the emphasis should not be repeated.   Notes   The argument that there's a shortcut key for the code button misses the point - a user who doesn't see the button on the toolbar won't mouse over it to learn the shortcut key from the tooltip. They're also less likely to venture in the help and learn about that shortcut key. History - A previous related proposal has implemented an , but only for users under 50 rep, which some moderators  is too low of a limit - "I think the reputation limit it too low. I've seen poorly formatted code from people with much higher reputation. –  ChrisF♦ Jul 13 '11 at 12:35"


I am making an adventure map and I need to make villagers who do not take damage and trade items with the CanDestroy and CanPlaceOn tags. How can I do that? All of my command generators don't allow data tags.


Comment or Log in code posted in question

I frequently edit question so it look nice and readable.  I found that some asker post question with some extra comment and log which is not useful in understanding question or not related to question.  Like system comment, Auto generated comment, Log to print variable, or log like "called" "abc1", "abc2".  So should I remove this comment and log while making edit to this kind of question?


Answering the same question across the site

These three questions are essentially the same:        I found a good solution for it, blogged, and answered all three of these questions with the same post. Two of those were deleted, so I'm assuming it's bad form to answer multiple questions with the same answer.  What is the proper way to help people who've asked the same question in a different place?  Also, why was the answer with one upvote deleted, leaving one with no upvotes?


Find the area of the shaded region in the figure below:    I am completely stuck on how to start off this question. Please help on some guidance on how to start it off.


I found the Req of the whole circuit at first, then tried re-assembling the circuit and still I couldn't get the right answer.  Any idea on how I should proceed in this exercise?    I'm not looking for any answers, just a walkthrough.  Step 1:         – Schematic created using   Step 2:          Step 3:


Can Gauss Law for any arbitary closed surface be derived from Coulomb's Law?

As far as I know, Gauss' Law is useful for calculating the electric field where Coulomb's Law doesn't work. For example, it is used for calculating the field produced by a thin sheet of charge and also used for infinitely long thin line of charges.  But in both of these cases, the field can also be obtained using Coulomb's inverse square law. This method just needs some extra integration in contrast with Gauss' Law.  So my question is that is this true in general? Can we calculate the field produced by any arbitary charge distribution using Coulomb's Law?   Also in the both cases mentioned above, one can use Coulomb's Law for field and then use this to get to Gauss' Law. So is it possible to derive Gauss' Law for any arbitrary closed serface using Coulomb's Law?


How to get value of appended element in JS or jQuery?

I have some inputs with type of "button", I retrieved these buttons data in a array from the database like this items = array[11].split("--"); items.forEach(function(item) {     $("#items").append("<input type='button' value='" + item + "' class='itemButton'></input>"); });  now I have created a function the stores the value of each button in an input with type "hidden" this is the input <input type="hidden" id="itemsHidden">  and this is the function $(".itemButton").click(function (e) {      e.preventDefault();     $("#itemsHidden").val($(this).val()); });  now this buttons weren't exist before they been appended from the database so when I run the function it does not find the buttons I appended to run the function on, and when I try to get the value of the clicked button it returns nothing, now is there any way to only run the function above after the buttons are fully appended so when the function can run on these buttons?


Why this inequality holds for any finite ring?

Let $A$ be a finite ring and $N$ the non-units of $A$. If $\vert N \vert \geq 2$, why $\vert N \vert \geq \sqrt{\vert A\vert }$ ?  I think that I must look for something to get a quotient that let's me the inequality, but I don't know which ideal must be the one I need. Can anyone help me?  EDIT: The ring is commutative with unit.


So I am making a game and have a class Players each player has a name and score.  I am trying to get user input for the names of each Player object  by calling a function and using for loops and setting the players name from user input from the user.  I have tried a few things while researching still I have a problem.  I saw some people say that Array.toString(arr) is how you print an array of objects.  I am now getting an error   .\Player.java:13: error: incompatible types: unexpected return value                 return "Player: " + name + "      Score"  + score;   import java.util.*; class diceGame{     // calling main method     public static void main (String[] args){         createPlayersArray();       }      //Get the details oto launch game such as the number of players     //and collects their names to store in a array     public static void createPlayersArray () {         Scanner kb = new Scanner(System.in);           System.out.println("Please enter the number of players: ");         int numOfPlayers = kb.nextInt();         //Player array to hold all the players         Player [] playerArray = new Player[numOfPlayers];           //Array to set the players names         for (int i = 0; i < numOfPlayers; i ++ ) {              System.out.println("Please enter your name: ");             String currentPlayerName = kb.next();             playerArray[i] = new Player(currentPlayerName, 0);           }           System.out.println("This should be the list of players");          for (int i = 0; i < playerArray.length; i ++ ) {                  System.out.println(Array.toString(playerArray));          }      }; }  /////////////////////// Player Class//////////////////////////  class Player{     public String name;     public int score;        public Player (String n, int s){         name = n;         score = s;     }      public void nameAndScore (){         return "Player: " + name + "      Score"  + score;     }       //Geters and Setter name      public String getName(){         return name;     };      public void setName(){         return name;     } };   It not so much a error but I am getting the memory address displayed:  Player@880ec60 Player@3f3afe78 Player@7f63425a Player@36d64342   I would like the console to print:  Tom   score: 0 Jerry score: 0


Im an Indian citizen. Do I need a transit visa in Thailand while going to Angkor Wat from Kolkata (India), and can I stay in Thailand for two days on this transit visa?


Why am I unable to sign back into Pokemon Go

I accidentally signed out of my account and when I type in my details for Google it will take me to a page where there are Pokemon staring at me and it says, our servers are humbled etc. Why am I unable to sign back into the application?


Is it possible to sort the post based on a custom field?

I have a custom field called "value_date" where add a date  e.g yyyy/mm/dd  The idea is sort the upcoming dates first in the loop, is possible?  I used a template for custom post taxonomy-event-date.php and this is code in the function, It doesn't work.  Functions.php  add_action('pre_get_posts','search_filter'); function search_filter($query){     if ( !is_admin() && $query-> is_tax( 'event', 'date' ) ) {         $today = date( 'Y-m-d' );         $query->set('post_status', 'publish');         $query->set('meta_value', $today);         $query->set('meta_key', 'value_date');         $query->set('orderby', 'meta_value_num');         $query->set('order', 'ASC');     } }


How can I improve Ubuntu overall system performance?

What are your tips for improving overall system performance on ubuntu? Inspired by this  I realized that some default settings may be rather conservative on Ubuntu and that it's possible to tweak it with little or no risk if you wish to make it faster.  This is not meant to be application specific (e.g. make firefox load pages faster), but system wide.  Preferably 1 tip per answer, with enough detail for people to implement it.  A couple of mine would be:   Install  (via Software Center or sudo apt-get install preload); Change  value - "which controls the degree to which the kernel prefers to swap when it tries to free memory";   What are yours?  PS: Since this is not intended to have a unique answer but rather, several useful tips, I'm making this community wiki out-of-the-box.


I have set up a new Ubuntu 20.04 VM in Virtual Box. When using apt-get update or apt-get upgrade I always end up getting hash sum mismatches for some of the packages. I tried all of the solutions suggested for similar questions such as apt-get clean rm -rf /var/lib/apt/lists/*  I also tried to compute the hashes for the respective files myself. However, I always received the correct hashsum that apt says it would expect. (What I did is compute hashsums via sha256sum for the files stored in /var/cache/apt/archives/partial. Apt seems to store the corrupted files here, all with a file name extension .FAILED) I don't understand why I receive the correct hash sum manually while apt seems to compute a wrong one. I hope someone can suggest a solution for this problem. Thank you for your help.


I am trying to write a script that needs to be run by cron. But because the script depends on some hardware components (can take variable time to execute or even hang), I need to make sure it's not already running to prevent it from piling in memory.  Script name is fan_control.sh, cron is a parameter. Here's what I've come up with so far:  ps aux | grep -w "fan_control.sh cron" | grep -v grep | wc -l   This line returns number of instances running, if it's > 1 then I have to exit. It works exactly as intended. However, to use it, I need to capture output to a variable. I tried both `...` and $(...) methods and was surprised to find out that it would return +1 compared to actual number if instances running. Not understanding what was happening, I just decided to live with it and use > 2 for comparison. Looked like it worked.  However, when I tried running the script via cron, I found out it was returning +2 compared to what I was expecting. If I remove wc -l from the command line, I can actually see extra instances listed (with different PIDs).  UPDATE:  So i've tried what was suggested, here is the script:  #!/bin/bash  if [ "$1" == "cron" ]; then  COUNT_RUNNING=$(pgrep -fc "fan_control.sh cron") if [[ $COUNT_RUNNING > 1 ]]; then date "+%Y-%m-%d %H:%M:%S" echo "Too many instances running ($COUNT_RUNNING), exit." exit; fi fi  [main script contents]   This seems to work fine if called from command line. I've tried calling it simultaneously from two shell windows and I can actually see the message "Too many instances running (2), exit." Now, I add a cron job:  * * * * * /usr/local/user90/fan_control.sh cron > /home/user/cronlog.txt   And cronlog.txt contents is:  2018-03-18 22:20:01 Too many instances running (2), exit. 2018-03-18 22:21:01 Too many instances running (2), exit. 2018-03-18 22:22:01 Too many instances running (2), exit.   So, I've gotten rid of extra process spawned when capturing command output to variable, however, CRON still spawns an extra process. I'm just curious why it's happening?


If $f:[a,b]\to \mathbb R$ is continuous then so is $\max_{t\in [a,x]}f(t)$?

A problem that I have been thinking: For what kind of functions $f:[a,b]\to \mathbb R$ is  $x\mapsto\sup_{t\in [a,x]}f(t)$ continuous? This is not true for bounded functions, take for example $f(x)=0$ in $[0,1]$ and $f(x)=1$ in $(1,2]$. It is however trivially true for continuous monotone functions. Assuming mere continuity for $f$ I can show right continuity of $\max_{t\in[a,x]}f(t)$:   For $\epsilon$ and some $\delta>0$,  $$x\in [x_0-\delta,x_0+\delta]\implies f(x_0)-\epsilon<f(x)<f(x_0)+\epsilon$$ If $x\in [x_0,x_0+\delta]$ then $$\max_{t\in [a,x]}f(t)=\max\left\{\max_{t\in [a,x_0]}f(t),\max_{t\in [x_0,x]}f(t)\right\}$$ If $max_{t\in [a,x_0]}f(t)\ge \max_{t\in [x_0,x]}f(t)$ then $$\left|\max_{t\in [a,x]}f(t)-\max_{t\in [a,x_0]}f(t)\right|=0< \epsilon$$ Otherwise, $$\left|\max_{t\in [a,x]}f(t)-\max_{t\in [a,x_0]}f(t)\right|\le \max_{t\in [x_0,x]}f(t)-\max_{t\in [a,x_0]}f(t)<f(x_0)+\epsilon-\max_{t\in [a,x_0]}f(t)\le \epsilon$$ which proves right continuity. When I tried to prove left continuity I was stuck on showing $$\max_{t\in [x,x_0]}f(t)-\max_{t\in [a,x]}f(t)<\epsilon$$ Can this be circumvented?


I have learned in my HS physics 2 class that everything with mass has a wavelength given by the deBroglie wavelength. My question is : Does this mean that any object can show diffraction, such as in the Davisson-Germer experiment showing the diffraction of electrons? Does this also mean that objects may display different properties of a wave too? (Refraction/reflection)


What are workarounds when we need multiple inheritance in C#?

All similar questions I've looked though here, mentions multiple interface inheritance. However, I am not sure how MII could be a workaround to the problem.  Lets say, I have two library class (My_Class_1 and My_Class_2) of different methods. Then I want to create a new class, that can use both of these classes' methods natively, like:  public class My_Application : My_Class_1, My_Class_2 {       public My_Application(){          method_from_Class1();          smth_property_declared_in_My_Class_2 = "hello";      }  }   However, that is not possible with C#. What are flexible workarounds, to extend/enrich class with other classes? In PHP, that is unbelievably simple, just in the top of the class we can:  use example_trait_1; use example_trait_2;   I would rather not use interfaces; in my view, they have no relation to solving this problem.  p.s. I don't want to create initialize objects for those classes. I want them to be native part of the application class.


For those saying this is a duplicate it is not.   The linked question is asking about whole unpeeled ginger.  This question is asking about ginger which has already been cut and it’s longevity.  If already cut ginger will not go beyond 2 days then the answer shoulr state that suggesting that unpeeled ginger is the only real way to go. I have been eating small pieces of ginger and leaving it outside and I notice asa I cut it later that day and certainly by the next day it has lost its mouthwatering zingy flavour and become chewy. I’m wanting to preserve cut ginger.  For a start I guess I guess I could buy smaller pieces to begin with so as not to waste a bigger piece. Would buying a bigger piece and cutting affected areas off help I.e does the dehydration travel slowly from the exposed part? If I were to zip tie a cut part and put it in the fridge how long would it last? Would wrapping the cut area in foil paper help(foil doesn’t let air through) then I could slice that part of with next use. What else can I do to preserve cut fresh ginger and how long can I expect it to last? Thanks


Computing an infinite product $\prod_{n=1}^{\infty} e(\frac{n}{n + 1})^n * \sqrt\frac{n}{n + 1}$

The answer to the question is $\frac{\sqrt{2\pi}}e$, although I do not know how to come to this solution. This is a problem from a math contest from the year 2016.


as a student of final yr i want to make a tablet of simple specification but i m not getting how to install any OS in it, I read about Ubuntu OS for tab, can i really install and Ubuntu on tab and if yes HOW??? please answer..


Remove certain characters from a string with JavaScript

I wrote a function in JavaScript, that replaces accents in a string to certain characters.      function textToURL(str) {     str = str.replace(/á/gi,'a');        str = str.replace(/é/gi,'e');        str = str.replace(/í/gi,'i');        str = str.replace(/ó/gi,'o');        str = str.replace(/ö/gi,'o');        str = str.replace(/ő/gi,'o');        str = str.replace(/ú/gi,'u');        str = str.replace(/ü/gi,'u');        str = str.replace(/ű/gi,'u');        str = str.replace(/ /gi,'-');        return str; }   I'm sure there's a more clean and more simple way to write this code with arrays, or Regex, but how?  Thanks in advance.


Writing a function name in a normal paragraph in my dissertation

I want to mention the name of an specific function (or method) that I used in a experiment in a normal paragraph in my dissertation. What is the best way to do it? Considering that the official dissertation format that my teachers gave me doesn't mention how to do it.  For example:       "... with the Java programming language we can use System.nanoTime ..."


I answered this question and automatically I was downvoted, an the answer was deleted, I think this is not correct  The question:


I just wrote code for this, and I got it a little bit ugly. Can you help me to fix this. And how to change those nands for not, like it is on nand 3,4,5? Please help!  PS. What I mean by these nands for not or whatever this is


Correlation between log normal variables and a normal variable

I have a variable $z$ given by:  $z=\sum_{i=1}^n z_i$  where $z_i$ are random variables with $z_i \sim N\left(0,1\right)$. Then it will be $z \sim N(0,n)$ and the correlation between a variable $z_i$ and $z$ is $\frac{1}{\sqrt{n}}$.  Given now $y = e^{\alpha+\beta z}$, what is the correlation between one of the variables $z_i$ and $y$?  Addendum  Is my result correct?  $\frac{\beta e^{\frac{\beta^2}{2}}}{\sqrt{\left(e^{n\beta^2}-1 \right )e^{n\beta^2}}}$


Can two accounts on the same PS4 play on PSN if only one has PlayStation Plus?

My brother is the only one who has a PS Plus membership. Can I play online too (on my own PSN account but on the same console) even if I don't have a membership myself?


When I've start my system, Ubuntu 14.04, my login screen got stuck, with mouse cursor in middle of the screen. However, sometimes system allow me to enter my credential but the results are same and nothing appeared. After reading , , I've tried to enter in terminal after pressing Ctrl + Alt + F2, but nothing happened and the same screen is appearing. I've attached the screen image below.   I'm using Lenovo Thinkpad E520.        I need your help for this problem. Thank you.


Is there a tool for drawing Feynman diagrams that can be used to post these diagrams on physics stack exchange?


I've been trying to make a basic calculator, but the thing is every time I use if else, it either says I have to remove it due to syntax error or the green underline thing shows up and it says dead code. Could someone help me?   import java.util.Scanner;  public class additionCalculator {  public static void main(String[] args) {     int addresult;     int subtractresult;     int divideresult;     int multiplyresult;      String addition = null;     String subtraction = null;     String division = null;     String multiplication = null;      Scanner reader = new Scanner(System.in);     System.out.println("Do you want to do subtraction, division, multiplication, or addition?");     String i = reader.next();      if(i == addition)   {         Scanner additioncalc = new Scanner (System.in);         System.out.println("Enter a number");         int add1 = reader.nextInt();          Scanner additioncalc2 = new Scanner (System.in);         System.out.println("Enter another number");         int add2 = reader.nextInt();          addresult = add1 + add2;          System.out.println("The sum is " +addresult);        }   else if (i == multiplication) {         Scanner multiplicationcalc = new Scanner (System.in);         System.out.println("Enter a number");         int multiply1 = reader.nextInt();          Scanner multiplcationcalc2 = new Scanner (System.in);         System.out.println("Enter another number");         int multiply2 = reader.nextInt();          multiplyresult = multiply1 * multiply2;          System.out.println("The product is " +multiplyresult);      } else if (i == division) {         Scanner divisioncalc = new Scanner (System.in);         System.out.println("Enter a number");         int div1 = reader.nextInt();          Scanner divisioncalc2 = new Scanner (System.in);         System.out.println("Enter another number");         int div2 = reader.nextInt();          divideresult = div1 * div2;         System.out.println("The product is " +divideresult);       } else if (i == subtraction) {         Scanner subtractioncalc = new Scanner (System.in);         System.out.println("Enter a number");         int subtract1 = reader.nextInt();          Scanner subtractioncalc2 = new Scanner (System.in);         System.out.println("Enter another number");         int subtract2 = reader.nextInt();          subtractresult = subtract1 - subtract2;         System.out.println("The difference is " +subtractresult);     } }   // Addition calculator // Scanner reader = new Scanner(System.in); // System.out.println("Please enter a number.");         // int i = reader.nextInt(); // Scanner reader2 = new Scanner(System.in); // System.out.println("Please enter another number."); // int j = reader2.nextInt();  // sum = i + j; // System.out.println("The sum of the two numbers is " +sum);   }


Typeset mathematical symbols also in sans serif font?

For creating the graphics for my thesis (function graphs, flow charts, line art sketches) I've chosen to use the sans serif font by  \renewcommand\familydefault{\sfdefault}    However when I use mathematical symbols like $p_{s}$, they are still typeset in roman font and that looks weird:    So I wonder:   how could I force mathematical expressions also be typeset in \sfdefault if I do, are there any negative sideeffects to expect (with greek signs or other special symbols?) OR should I typeset all "mathematical" graphs (axis labels etc.) in roman font, and only make the other graphics like flow charts and sketches with sans serif font?


Cannot add new Server Role SQL Server 2014

It seems that I have the same problem as Yasser in this post     but I am running SQL Server 2014.   Basically when I right click on Server Roles I only get a menu with three options, "Start Power Shell, Reports, Refresh".   The command CREATE SERVER ROLE works. I am logged in as "sa". Any advice would be really helpful.  Thank you.


How do I read the history of my reputation?

When I visit the reputation tab of my profile, I see a lot of stuff. I can make out some of it, but not all.   What do all the event types mean? Why do some events show an odd reputation gain or not show any reputation change at all? Why are some events sometimes highlighted in yellow? My reputation suddenly dropped, but I don't see anything. What happened? Why do some events disappear from my reputation history?


Let $X_1, X_2, Y$ be topological spaces and let $X_1 \times X_2$ be the topological space obtained by furnishing the Cartesian product set with the product topology. Let $f: X_1 \times X_2 \to Y$ be a given map.   Then f is continuous iff for each $U \in Open(Y)$ and for each $(x_1, x_2) \in X_1 \times X_2$ such that $f(x_1, x_2) \in U$, there exists $(U_1, U_2) \in [Open(X_1) \times Open(X_2)]$ such that $(x_1, x_2) \in U_1 \times U_2$ and $f(U_1 \times U_2) \subseteq U$.   Now, for fixed $x_1$, define a map $f_2^{x_1}:X_2\to Y$ by $x_2 \mapsto f(x_1,x_2)$.  For fixed $x_2$, define a map $f_1^{x_2}:X_1\to Y$ by $x_1 \mapsto f(x_1, x_2)$.  Is there a way to formulate the continuity of $f$ in terms of continuity of $f_1^{x_2}$ for all $x_2$ and continuity of $f_2^{x_1}$ for all $x_1$? If not, what additional assumptions are required? I could prove that if these functions are uniformly continuous (that is, in $x_1$ and $x_2$ respectively) then $f$ is continuous.


Good source of d and d or similar game, minituare figurines?

So I am playing a new group of players and they are hoping for more of a visual aid.   Does anyone know any good places to pick up cheap figures?


Two coins are flipped, if at least one them lands heads up, what is the probability that both do?  I've tried solving this problem countless different ways but I can never get it right. I know that "at least one" means "one or all" so I use P(AorB) then the result I divide it over the total number of ways the event can occur.


Believeing I was in another directory I accidentally ran the following command on the root:  sudo chown -R j:root /   My username is j  Unfortunately because of this I am unable to run any sudo commands and undo my mistake, as the server can no longer access the sudo file. I am also unable to login via SSH as the file that controls that is also inaccessible!  I have physical access to the device - Is there a way to undo my mistake?


My question is actually fairly simple: is there any way i could run windows programs (for example PC games) on my iMac? (i am currently running OSX Snow Leopard). I know about things like VirtualBox and Parallels to run windows itself, but is there a Mac application that will allow me to run .exe programs and the like?


Does php mysqli or pdo wrapper class help to prevent sql injection?

If we are using php mysqli or PDO wrapper class, do they prevent SQL injection risks ?  E.g.      or     Always Use prepared statements and parameterized queries is advised by all experts.  wrapper class is useful for less coding in quick time and also help to reduce repeated coding.   Then how can we use wrapper class along with prepared statements and parameterized queries simultaneously ?  I am confused by this?  e.g.   example from -   Use prepared statements and parameterized queries  $stmt = $dbConnection->prepare('SELECT * FROM employees WHERE name = ?'); $stmt->bind_param('s', $name);  $stmt->execute();  $result = $stmt->get_result(); while ($row = $result->fetch_assoc()) { // do something with $row }   And with wrapper class, e.g. we use it as  $name = $database->filter($_POST['name']); $query = $database->get_results("select* from employee where name='$name'"); foreach ($query as $row){ // do something with $row }   Then where to use wrapper and where to use prepared statements ?   how to use both simultaneously ?   How to achieve sql injection prevention while using wrapper class ?


I would like to set the right Alt key as a Page up key.  Currently I have the following set which gets half of what I want done.  key <MENU> { [ Next ] };   I have tried xmodmap and it doesn't work for reassigning the right alt key.  Thank you!


ModuleNotFoundError: No module named 'apt_pkg' error

I run below command on ubuntu 16.4 :  sudo add-apt-repository ppa:noobslab/apps  of below question:    and get below error:  Traceback (most recent call last):   File "/usr/bin/add-apt-repository", line 11, in <module>     from softwareproperties.SoftwareProperties import SoftwareProperties, shortcut_handler   File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 27, in <module>     import apt_pkg ModuleNotFoundError: No module named 'apt_pkg' Error in sys.excepthook: Traceback (most recent call last):   File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook     from apport.fileutils import likely_packaged, get_recent_crashes   File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>     from apport.report import Report   File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in <module>     import apport.fileutils   File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in <module>     from apport.packaging_impl import impl as packaging   File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 23, in <module>     import apt   File "/usr/lib/python3/dist-packages/apt/__init__.py", line 23, in <module>     import apt_pkg ModuleNotFoundError: No module named 'apt_pkg'  Original exception was: Traceback (most recent call last):   File "/usr/bin/add-apt-repository", line 11, in <module>     from softwareproperties.SoftwareProperties import SoftwareProperties, shortcut_handler   File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 27, in <module>     import apt_pkg ModuleNotFoundError: No module named 'apt_pkg'   Thanks for help


What does __ (two underscores) stand for in Hpux C program

I see the following code in HPUX C program:     extern int fcntl __((int, int, ...));    _LF_EXTERN int creat __((const char *, mode_t));   These lines are compiled using aCC.  Could somebody let me know the meaning of 2 underscores after fcntl and creat in the above code?


How do I fix a slow wi-fi router speed when I have a fast internet connection?

My internet speed as measured on speedtest.net is 10 Mbps from my desktop computer, which is connected via ethernet to the router. When I measure my speed from my laptop (Surface Pro) when on the WiFi network using the same router, however, the measured speed is 3 Mbps. In addition, when I'm transferring files over the wireless network, Windows 8 File Explorer reports the transfer rate to be 3 Mbps as well. When I test the network using my phone (Samsung Focus WP7), I get a speed of 7 Mbps.  Device Manager reports that the drivers for the card on the Surface Pro (Marvell AVASTAR 350N) are up-to-date. How can I get my Surface Pro speed to match the speed of my internet connection?  Here are my Wireless Router settings:    Here are my Security settings on the router:


Without truth tables, how can I deduce that P → Q ≡ ¬P ∨ Q?

From: Philip Johnson-Laird , Stuart Professor of Psychology Emeritus at Princeton.    (Author isn't  a logician.)    . p. 108.   I changed the author's choice of first names, to ones that start with P and Q to fit the title.   I symbolized the disjunctions in square brackets. Please don't use truth tables.   ¬P ∨ Q  never appears in these quoted sentences. So how can I conclude ¬P ∨ Q from them?      An exclusive   disjunction, such as:           Either Pia helped or Quinn helped, but not both          is equivalent to the proposition:               Pia  helped or the Quinn helped, and not both Pia helped and the  Quinn      helped.         Hence, exclusive disjunction also has a logical meaning.   In an analogous way we can define a logical meaning of “if”. The sentence:           If Pia  didn’t help then  Quinn  did. [If ¬P, then Q.]         means:           Pia  helped or  Quinn  did, or both. [P ∨ Q]         In its logical meaning, the conditional is compatible with three possibilities: Pia  didn’t help and Quinn did [¬P ∧ Q] , Pia  helped and Quinn didn’t [P ∧ ¬Q], Pia helped and Quinn helped [P ∧ Q]. The only possibility that the conditional   rules out is that neither the Pia nor Quinn helped [¬P ∧ ¬Q]. The three possibilities   that the conditional allows are the same as those for the inclusive disjunction.   p. 478 (footnote for Ch. 21) introduces the psychology:        Ormerod and his colleagues show that participants can infer conditionals from   disjunctions, and disjunctions from conditionals (see Ormerod et al., 1993, and   Richardson and Ormerod, 1997). For example, given the conditional:              If Phil’s next grant application isn’t going to be funded then he’ll be     disappointed         we can infer the disjunction:           Phil’s next grant application is going to be funded or he’ll be disappointed         But, the results corroborate a prediction from the model theory: it is easier to   make the converse inference from a disjunction to a conditional. They also bear out   Ormerod’s claim—now embodied in the model theory—that we prefer to work with   as parsimonious models as possible. In unpublished studies, Sonja Geiger has found   that participants who carry out this paraphrasing task before they estimate the probability of a conditional tend to take more possibilities into account in their estimates


I am visiting the US in August 2014 for a week, returning home to the UK & will then be visiting for another 2 weeks in October 2014.  My question is, can I use the same ESTA or would I need to reapply for the second visit? I think the ESTA lasts 90 days but I am unsure if you can leave & re-enter?


Could I get some recommendations on an IPS solutions that incorporates some form of DDOS protection / what do you currently implement on your network?  Thanks


Fantasy Book I read in middle school (2009) about brother and sister using magic in space

The piece that I remember from this book or maybe even a series is that it's about a brother and sister - who were in their teens I feel - with either magical abilities or find a book with magical information in it.    I remember the girl always having like a zipper floating next to her in space that she could store things in. They traveled all around together.    In one book or chapter I remember they were both whales in the ocean and had to get used to the fact of going up for air, it discussed the phosphorescent fish down there etc.  I have been after this for a decade and just keep striking out. I would love to re read the series. I feel like I read this around/before the Artemis Foul books.


Why did the distance I have to travel with my buddy Pokemon Lapras DROP from 3 km to 1.25 km?

The distance I had to travel with my buddy Pokemon Lapras was originally 3 kilometers after traveling about a total of 40 kilometers with it it dropped to 1.25 kilometers needed to find a candy has anyone else experienced this?


"They all are fine" vs. "they are all fine"

The situation is that someone asks me how my family are; I then want to answer that they all are fine.   I want to know whether the sentences "They all are fine." and "They are all fine." have the same meaning.  Is there any difference? To me as a non-native English speaker, "They all are fine." seems better — it should mean that each of my family members is fine whereas "They are all fine." should mean that each of my family members is completely fine. Please correct my understanding if there is anything wrong.


The foot of the height in an orthocentric tetrahedron is the orthocenter of a face.

Consider a tetrahedron with a right-angle corner (like the corner of a cube) at $D$. Prove that the foot of the height from $D$ to the face ABC is the orthocenter of $ABC$.  Is this well-known?


Windows 10 hangs on logo sometimes with no spinning dots

Sometimes my PC will not boot it just hangs on the Windows 10 logo and no dots show below the logo. Also my HDD light is always solid when this is happening(I have a SSD by the way). To fix this I have to reboot my computer several times via the reset switch then eventually it will boot. It doesn't always hang on the logo just randomly as I can tell. Anyone know why this would happen?


How do you clear a stringstream variable?

I've tried several things already,  std::stringstream m; m.empty(); m.clear();   both of which don't work.


Remove linked List elements with a given value

I am trying to delete all those elements with a specific value. Here's my code. This code is not working. Can someone help me? TIA. Example Given: 1 --> 2 --> 6 --> 3 --> 4 --> 5 --> 6, val = 6 Return: 1 --> 2 --> 3 --> 4 --> 5  public class ListNode {   int val;   ListNode next;   ListNode(int x) { val = x; } }  public class Solution { public ListNode removeElements(ListNode head, int val) {     if(head == null){         return null;     }     ListNode curr = head;     ListNode prev = null;     while(curr != null){          if(curr.val == val){             prev.next = curr.next;          }         else{             prev = curr;           }           curr = curr.next;     }     return head; } }


How to update already installed software via command line?

I'm looking for a command line to update my already installed software.I want to update all of them.


How to deal with Class imbalance problem for classification algorithms?

Lets say for fraud detection which has two labels for each transaction.   Fraud  Non fraud    In real world scenario we usually get more number of examples of Non fraud data points and very low number of fraud data points. Lets assume the ratio of Non fraud: fraud is 80:20. So my question is even if I build any classifier my model will predict the majority label but I know that data itself is not well distributed. So for such scenarios what should be the approach.


Do not show the "If you found this helpful, please upvote" message to experienced users

Experienced users should not be shown the top-of-screen pop-down message reminding them to upvote a question if they find it helpful.  This is particularly annoying when that reminder comes right after closing out the login pop-down message after arriving at a random stackexchange site from Google.  This network should not slow down and annoy experienced users with excessive messages. This message, in particular, is only useful to new users.


Adding Rasters with multiple Field Values using Map Algebra in ArcGIS for Desktop?

Embarrassed that I haven't looked at this for some time (can't quite get the syntax down). (ArcGIS 10.2, Win7x64).  Within Map Algebra (Raster Calculator) Trying to add the cell values of 3 rasters, each raster has multiple fields. Trying to add: SumRaster = (Raster1, Field X)+ (Raster2, FieldY)+ (Raster3, FieldZ).  Can get to run (using primary VALUE field from each), want to specify FIELD value to SUM.   Alternately would be OK to export each Raster, setting my desired VALUE from this specified Field (and don't remember how to do this in 10.2).  Any help with Syntax would be great.


Can a professor take a full-time 12 months industry job (get fully paid) while on one-year sabbatical?

Assuming the home university only pays 1/2 of 9-months salary in the period of one-year sabbatical.  Can it be legally allowed? or does it violate any rules in general? What would be the worst consequence if doing so?    Thanks.


What can I do to have table or figure in bold

\documentclass[a4paper,12pt]{report} \usepackage[american]{babel} \usepackage{amsfonts,amssymb,amsmath,amsthm} \usepackage[table]{xcolor} \usepackage{pifont} \usepackage{marvosym} \usepackage{fancybox,fancyhdr} \usepackage{graphicx} \usepackage{eso-pic} \usepackage{yfonts} \usepackage{pdfsync} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[dvips]{epsfig} \usepackage{caption,subcaption} \usepackage{algorithmicx} \usepackage[ruled]{algorithm} \usepackage{algpseudocode}  \usepackage[backend=biber,style=apa]{biblatex}  \usepackage{booktabs, collcell, makecell, tabularx, threeparttable}     \newcommand{\tclr}[1]{\textcolor{black!70!black}{#1}}     \newcolumntype{L}{>{\collectcell\tclr\raggedright}X<{\endcollectcell}}     \renewcommand\TPTtagStyle{\bfseries} % optional \usepackage{siunitx} \usepackage{xparse} \NewExpandableDocumentCommand\mcc{O{1}m}     {\multicolumn{#1}{c}{#2}} \newcommand\tot{\mathrm{tot}} begin{document} \begin{table}%[!htp]     \small     \sisetup{table-format=6.2e-1,per-mode=symbol}     \setlength\tabcolsep{3pt} \caption{The QPSO update equations for different potential energy types}\label{3wavfun} \centering \begin{threeparttable} \begin{tabularx}{\textwidth}{@{} L l *{3}{>{$}l<{$}S} @{}} \toprule  {\bf Delta potential}  & {\bf QPSO update equation}\\  \midrule  Delta potential well & $x_i(t+1)=p(t)\pm\frac{\ln(1/u)}{2q\ln\sqrt{2}}\parallel x_i(t)-p(t)\parallel$\\  \midrule  Harmonic oscillator & $x_i(t+1)=p(t)\pm\frac{\sqrt{\ln1/u}}{0.47694q}\parallel x_i(t)-p(t)\parallel$\\  \midrule  Square well & $x_i(t+1)=p(t)+\frac{0.6574}{\xi q}\cos^{-1}(\pm\sqrt u)\parallel x_i(t)-p(t)\parallel$\\ \bottomrule \end{tabularx} \end{threeparttable} \end{table}  \end{document}


i can't use snap "Unable to contact snap store"

i have problem with this message when i want use snap I TRIED: sudo snap install snap-store but i recive this message: Unable to contact snap store


Why Faddeev-Popov ghost cannot exist in external line?

I was studying the path integral quantization of non-abelian gauge field. After the path integral quantization, the action becomes  $$\mathcal{L}=-\frac{1}{4}F^a_{\mu\nu}F^{a\mu\nu}-\frac{1}{2\zeta}(\partial_{\mu}A^{\mu a})^2 +\partial^\mu\bar c^a(D_{\mu}c)^a$$  Feynman rules for antighost-ghost-gauge boson vertex (e.g. $SU(2)$ gauge boson) is $-g \epsilon_{abc}p_\mu$. I can't understand why there is no process with ghost in external line.(For example, two gauge bosons annihilate and become ghost and antighost. I can certainly calculate the amplitude for this diagram according to Feynman rules. )   Certainly I know ghost is unphysical so should not exist in external line. But I want to know whether no external ghost line can result from the theory itself (like the amplitude of this process can be canceled by some other process?) or is just an axiom that we put on this theory?


How are 3D still shots or "time stop" effects created?

I am always amazed by 3D still shots in which the action freezes and a character is able to walk around and the people are frozen like statues. How do they do that?  Some of the famous movies featuring 3D still shots:   The Matrix (1999) Clockstoppers (2002) circus scene in Big Fish (2003) Cashback (2006) The bar scene in The Other Guys (2010) Quicksilver scene in X-Men Apocalypse (2016)   The movie "Clockstoppers" completely revolved around this time stop effect.


How do Galois fields of sizes other than powers of primes behave?

I understand how Galois fields of prime powers (e.g. $GF(2^8)$, $GF(17)$, $GF(257)$) behave. What I could never figure out is how they behave with sizes other than simple powers of primes. For example, $GF(15)$, $GF(100)$, or $GF(2^43^5)$.    Is it even possible?    Searching for this yielded no results.


Guilty of accusing someone of doing something you do

I want to know what it is called when some one accuses someone else of something the accuser also does. Example: If someone says that it's not ok to eat chicken but does so them self, what is that called?


Why is $\lim \limits_{h \to 0} \frac{e^{h} - 1}{h} = 1$?

Can anybody show me how $\lim \limits_{h \to 0} \dfrac{e^{h} - 1}{h} = 1$?


(1) Does he not know? (2) Doesn't he know?  I don't usually see and hear questions formed in the first style. I was even surprised to know that it is grammatically correct. And actually it is the most "proper" way to form an interrogative sentence.  shows that the first style was much more popular before than now. What are your suggestions on choosing between these styles? And I will probably add the third one.  (3) He does not know?  EDIT: The answers have explained how to form a question, but have not actually provided an account on the usage of the first two forms. Especially I'm interested in the first form: does it sound formal, is it used in speech or only in writing, et cetera.


Byte[] May expose internal representation of the returning reference - findbug

I'm working in an old project with some old code and findbug is giving the following error with a byte[].      FindBugs: May expose internal representation by incorporating   reference to mutable object This code stores a reference to an   externally mutable object into the internal representation of the   object.  If instances are accessed by untrusted code, and u nchecked   changes to the mutable object would compromise security or other   important properties, you will need to do something different. Storing   a copy of the object is better approach in many situations.   I'm wondering if someone could help me to understand the proper way to handle this error?  private byte[] fileContent;  public FileUpload(String fileName, String fileExtension, long fileSize, byte[] fileContent, boolean attachedToPo, boolean programOwner) {         this.fileName = fileName;         this.fileExtension = fileExtension;         this.fileSize = fileSize;         this.fileContent = fileContent;         this.attachedToPo = attachedToPo;         this.programOwner = programOwner;     }  public byte[] getFileContent() {     return fileContent; }  public void setFileContent(byte[] fileContent) {     this.fileContent = fileContent; }   EDIT I understand why the bug exist and I know how to deal with this when it comes to dates etc. I'm just a little confused with how to deal with it when it comes to byte[].


Selectively disabling UAC for specific programs on Windows 7

I have some programs running on start-up like . UAC prompts every time the Windows starts. How can I set a program to make sure that no intervening prompt would appear during start-up?


if $2$ hyperbola are conjugates of each other then value of $c$

If the hyperbola $x^2+3xy+2y^2+2x+3y+2=0$ and $x^2+3xy+2y^2+2x+3y+c=0$ are conjugate of each other . Then $c$ equals  solution i try   Asymptotes of 1 st hyperbola is $x^2+3xy+2y^2+2x+3y+k=0$  and it represent $2$ pair of lines so its discriminant is zero .so i am getting $k=1$ How to solve it from that point


Let $R$ be a commutative ring with identity 1, such that $R$ contains exactly three ideals:$\{0\},J,R$. Prove that $R$ is not an integral domain.  I was thinking start with supposing that R is an integral domain, then for $ab=0, a=0,b \ne0$ for $b \in R-J$, it can found a contradiction of proving $Rb$ is also  an ideal. But I cannot go on anymore, may be I was thinking wrong and hope some body can help me with it. Thanks


Short story about corrupt congressman and mental process-heightening drug

So I read this short story a few years back in an anthology I found in a university library. The anthology was titled "Best American Sci-fi" or "Greatest Works of Science Fiction" or something along those lines. I think the story was from the 70s but I have no idea who the author was or what the title is.  It was pretty short. The main character is a man who has a large assistant/bodyguard with him. The man gets out of a van, unloads a wheelchair, and then talks about how he's nervous about the situation. He talks for a bit about he modified the chair in order to protect himself. I don't remember it being in first person but you could hear the main character's thoughts.  The main character then injects himself with a blue liquid. He slumps in the chair and loses most of his motor functions but his senses and processing skills become extremely powerful. The main character and his bodyguard then go around this normal suburban neighborhood, which has been explained as under the control of this corrupt congressman.  The story doesn't really explain what the congressman does other than use a new field of science to manipulate his constituents. I don't remember what it's called, but the main character is also using it. The field is what developed the drug he's using and it's also how he deters people from attacking him--it has to do with a lot of psychology.  The main character continues driving around this neighborhood, analyzing people, until they start to get suspicious. A crowd gathers around him and threatens to hurt him, so he releases a scent-bomb that messes with the psyche of all of the people around him. I think the bodyguard gets knifed or killed.  The story ends with him loading back into the van, thinking about the corrupt congressman and how he almost died. The drug wears off and he's a normal human again.


Extracting and Creating separate txt files for each line of the source file

I have the source file like below:  This is the details of the data data1 | 10 20 30 40 50 60 data2 | 70 80 90 15 25 35   I'm extracting each line using getline function and storing it into textfile  std::ifstream readfile;  readfile.open("source.txt");  char fileName[10] = "data "; // includes null character char fileExt[5] = ".txt"; // includes null character  while(getline(readfile,line)){       int x = 1;       fileName[4] = '0'+x; // converts ineteger to character       strcat(fileName,fileExt);        std::ofstream outputFile( fileName );      outputFile << line <<std::endl;       x++;  }   The problem in this code is, it is limited to 10 lines,i.e,  data1.txt, data2.txt ........ upto data9.txt is created and then junk values are created in name of the text file.  I know that the expression fileName[4] = '0'+x; has limitations upto 10 values, as i'm trying to convert integer to a single character.  Is there any way, that i can convert say 123 integer value (if there are 123 lines in source file) to "123" character string value, so that 123 text files are created for each line. (data1.txt, data2.txt...data123.txt)  I know in C, we can use something like  int x = 123;  char c[20]; sprintf(c, "%d", n); printf("Character value is %s", c);   The output is character string  Character value is 123   But, i need equivalent that of in c++.  Please let me know; Thanks,


jQuery post method and directory confusion

Generally, when I want to change a page, I'll use a href to do so, or I'll use the header function.  For my current project, I need to use jquery to receive and modify the information that the client has entered, and I need to then use the post method to have php be able to access said information.  Upon receiving the information, I want a separate php file in an includes folder to do something with it, and then redirect the user away from the original page.  When working on the project, the page does not change, so I am wondering if the information is even reaches the includes folder.  Below you will find a miniature example of code that replicates the issue described above.  After the save button is pressed, I want the jquery to create $_POST['message'], check if it is set, send it to the changePage.inc.php page, check again if it is set, then redirect the user to the secondPage.php page which should display "Hello World".  File named index.php  <?php     session_start(); ?>  <!DOCTYPE html> <html> <script src="https://code.jquery.com/jquery-3.2.1.min.js"     integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4="     crossorigin="anonymous"> </script> <script>     $(document).ready(function(){         $('#saveForm').submit(function(event){             event.preventDefault();             var message = "";              var changeText = function(){                 message = "You wrote: " + $('#text').val();             };              var send = function(){                 if(message !== ""){                     $.post("includes/changePage.inc.php", {message: message});                     $.post("index.php", {message: message});                 }             };              changeText();             send();         });     }); </script> <?php     if(isset($_POST['message'])){         header("Location: includes.changePage.inc.php");     } ?> <body> <textArea id="text"></textArea> <form id="saveForm" action="includes/saveEssay.inc.php" method="POST">   <button type="submit" id="saveButton">Save!</button>     </form> </body> </html>   File named changeDirectory.inc.php (within a folder named includes)  <?php  session_start();  if(isset($_POST['message'])){     header("Location: ../secondPage.php"); }  exit();   File named secondPage.php  echo 'Hello World';   The first comment actually does not solve my problem!  I need to change the page from the php file within the includes folder, so I do not want to use jquery to redirect!  jquery is necessary here to format the text and have it be accessible as a post variable, and, once it is accessible as a post variable, I want the changePage file to be run.  I cannot stress this enough! The redirect must be done within the changePage.inc.php file


The terminal excerpt is pretty much self-explanatory.  I'm logged in as root (for illustration purposes only!), I want to change ownership of a file on a mounted NTFS partition, and it doesn't work.  I admit it is late, but I'm pretty sure this should have. Any idea what's going on here? root@raspberrypi:/mnt/red/backups# ls -l total 2613 -rwxrwxrwx 1 root root 1359921 Nov 20 01:38 db_2020_11_20.zip root@raspberrypi:/mnt/red/backups# chown -v chris:chris db_2020_11_20.zip changed ownership of 'db_2020_11_20.zip' from root:root to chris:chris root@raspberrypi:/mnt/red/backups# ls -l total 2613 -rwxrwxrwx 1 root root 1359921 Nov 20 01:38 db_2020_11_20.zip root@raspberrypi:/mnt/red/backups#  Added: Note that /mnt/red is an NTFS partition.


Question is pretty straight forward-- how do I make an edit that is actually helpful? How do I know when a post should be edited?


We often omit "that" in direct object noun clauses. For example:     I hope you have a good weekend.   or     I hope the meeting goes well.   It may sound a bit stilted to include "that" in those sentences, particularly the first.   However, today I was writing an email and wanted to combine those ideas into one sentence. My clarity instinct led me to write:     I hope you have a good weekend and that the meeting goes well.   In this case, omitting "that" before "the meeting goes well" makes that second object sound clumsy. But including two "that"s sounds equally clumsy.   Is it acceptable to omit the first and not the second? Does it sound clumsy to omit both?


How to create an accurate Tissot Indicatrix?

A  is useful method for communicating at a glance the kinds of distortion a given projection is prone to (in the figure below, each of the red circles occupies the same area).  that popular methods for generating TI's have their own problems, to the point of being sometimes woefully inaccurate.   What is the problem with the popular methods, and what is most correct way of generating a TI that is accessible to your average GIS dude(ette)?


The python if statement can be used in the following way  a = [] if a:     # do something   i.e., the conditional can be an object (in this case a list). In this case, as far as I understand it, the conditional is evaluated by bool([]) which evaluates to False. On the other hand, bool([1]) evaluates to True and hence something is done.  I personally like this behaviour - it seems clear, but colleagues have pointed out it is unclear.  Is this recommended? What are the potential gotcha's? Is it pythonic or should something more explicit be done?


How to lawfully leave United States without a United States passport for United States citizen

The law requiring US citizens to "bear" a US passport when leaving and entering the US is the Immigration and Naturalization Act section 215, found at 8 USC § 1185, Travel control of citizens and aliens, subsection (b). I need to take my baby back to my home country soon since my job in United States is ending in the July and I managed to get my baby a foreign passport. However I cannot get a United States passport for her since they stopped issuing United States passport and will delay for months. What is the best way to leave the USA without violating this law? Is it possible to get approval or should I get a lawyer for help on this? What type of lawyer should I have? Any experience with this? Thanks for the comments: For departure, we get many comments about no one enforcing the law, but still it is a law... We are worried that the penalty will change in future and affect my daughter in future, which could be several decades. For return, I will definitely apply in overseas Embassy in future. But another issue is will my daughter lose her citizenships if she leave USA with a foreign passport? Update in May 2021. No one really ask about the US passport for my daughter during the travel. The passport was sent to my friend and then mailed to me in last September.


Why are additive limit preserving functors left exact?

I understand that the kernel is a limit and thus preserved by the functor, but why is exactness preserved in the middle? i.e How does the exactness of $0\to A\to B\to C\to 0$ imply the exactness of $0\to F(A)\to F(B)\to F(C)$ at $F(B)$, where $F$ is limit preserving?


How to run shell script from MacBook Touch Bar

I have a simple shell script command like this which can be run via automator or workflow:  cd /Users/myuser/Documents/Code-Files/scripts/;  /usr/local/bin/node code_upload.js   I'd like to add this as a Quick Action to the MacBook's Touch Bar, how can I achieve this?  Thanks!


What camera settings should be used to capture sky shots without over exposing the clouds?

I have spent some time photographing landscapes with blue sky and white clouds, but the clouds always come out overexposed.  I have tried different settings and still have the same result. What should I do to get correct exposure?


Proving invariance of $ds^2$ from the invariance of the speed of light

I've started today the book of Landau and Lifshitz Vol.2: The Classical Theory of Fields $\S 2$. They start from the invariance of the speed of light, express it as the fact that $$c^2(\Delta t)^2-(\Delta x)^2-(\Delta y)^2-(\Delta z)^2=0$$ is preserved when we change inertial frame, so they consider $$ds^2=c^2dt^2-dx^2-dy^2-dz^2,$$ and say     We have observed that if $ds=0$ in one frame then $ds'=0$ in another frame. But $ds$ and $ds'$ are infinitesimal of the same order. So it follows that $ds^2$ and $ds'^2$ have to be proportional that is $ds^2=ads'^2$...    and he goes on to prove that $a=1$.  How to translate this argument in a rigorous one? I'm really interested in this, both to understand this deduction and also to be able in future to make similar ones.


Seeking introductory texts about coordinate system projections?

Even after some time working in this GIS field, I still don't have a solid understanding of spatial references, how they are projected, and most importantly, if you still need to worry about the fact that coordinates are geographic once they have been projected. In which cases should one pay attention when handling coordinates in a projected coordinate system?  For example, assume I am working in a projected coordinate system. I have a polygon whose vertices are now specified with X / Y coordinates. Let's say I want to manually calculate the polygon's area — could I now take any normal algorithm (for Cartesian/Euclidean coordinate spaces) for computing the polygon's area, or do I still have to account for the fact that these are geographic coordinates? What would I have to do to get an accurate result for my area computation?  It's questions such as the above example that I still don't understand. Any cues to introductory texts explaining such details are welcome.  (I was already considering looking at the PROJ.4 catrographic projection library and how it is used to deduce from that how to deal with projected coordinates, but that would've probably been too early.)


How do I determine if I'm allowed to use an asset from the web in my game?

I need to incorporate other people's work into my game project. I must admit (with a little embarassment) that I am almost completely ignorant about copyright. I only have a vague idea of what it is, what it protects, or what it means when I see Ⓡ or © or ™. Since English is not my native language, reading all those Wikipedia pages full of legal jargon only gave me an headache.  I'm looking for images (sprites, backgrounds, UI elements mostly) and sound. I intend to publish the game (Google Play and Flash/HTML5 game websites, maybe the iPhone App Store). I don't plan to "sell" it directly, but I do intend to insert ads and/or in-app purchases.  I will most likely need to edit the content before including it in my game. Probably just scaling/rotating, but the greater degree of freedom I have, the better.  So, what should I look for, to be sure I have the rights to use the media I find the way I need to (like "royalty free" or "copyright free")? In which cases do I have to ask for "permission" to use that media, and how? Like, send the owner of the site an e-mail?


Is there a photoshop plugin or any other piece of software that can do super resolution?

I want to combine multiple photographs of the same landscape to increase the resolution of the final image. More details on the method here:   What software can I use to achieve this?


Proving every element has a finite order

I have that $G$ is a group and that the inctersection of all subgroups of $G$ different from the identity is also a subgroup different from the identity. Prove that every element of $G$ has a finite order.


Are there any disadvantages to putting all script tags at the end of the body tag?

Of course, there's the issue of loading times. That's why putting javascript at the end of the HTML has always been recommended.  However, are there cases where this shouldn't be done? Are there any disadvantages to this method?