How to convert std::string to const char in C++

I tried to research this for a bit and I can't figure out the problem  Here's the code:  #include <iostream> #include <stdlib.h> #include <string> void choose(); void newuser(); void admuse();  using namespace std; string x; string z; string w;  void CreNeAcc(){   cout << "Enter User Name for your new account\n"; getline(cin, x);  cout << "Enter Password for your new account\n"; getline(cin, z);  cout << "Would you like the account to be admin?\n"; cout << "Yes = Y, No = N\n"; getline(cin, w); choose();  }  void choose(){  if(w == "Y"){ newuser(); admuse(); }else if(w == "N"){ newuser(); }else{ cout << "Invalide Command\n"; }  }    void newuser(){  const char* Letter_x = x.c_str(); char command [100] = "net user /add "; strcat(command, x); //This is where I get the error strcat(command, " "); strcat(commad, z); system(command); }  void admuse(){     system("new localgroup administrators " << x << " /add") }   also the error its giving me is:  cannot convert 'std::string {aka std::basic_string<char>}' to 'const char*' for argument '2' to 'char* strcat(char*, const char*)'|


Is Tom Mitchell's Machine Learning book incorrect in its definition of Confidence Interval?

In Tom Mitchell's 1997 Machine Learning, a confidence interval is defined on page 138 as     An N% confidence interval for some parameter p is an interval that is expected with probability N% to contain p.   However, from questions as , it seems as if this is precisely not the case.  Is Tom Mitchell mistaken?


In the new canon what do we actually know about Darth Plagueis?

I read and loved  but with all the recent changes to what is and isn't canon I'm losing track.  There's a common theory that Supreme Leader Snoke is Darth Plagueis, most are discounted because Plagueis is a Muun. But where does that information come from? What current canon information do we have about Plagueis that disproves this theory and what has been marked as Legends?


Minimum number of observations needed to perform PCA or FA

I read in  (page 3) comparing principal component analysis (PCA) to factor analysis (FA) that both methods need a number of observations about 5 times the number of variables. Why? and how would you reduce the number of variables if you have few observations only?


Limitations in running Ruby/Rails on windows

In the installation documentation to RoR it mentions that there are many limitations to running Ruby on Rails on Windows, and in some cases, whole libraries do not work.  How bad are these limitations, should I always default to Linux to code / run RoR, and is Iron Ruby expected to fix these limitations or are they core to the OS itself?  EDIT Thanks for the answer around installation and running on Linux, but I am really trying to understand the limitations in functionality as referenced in the installation documentation, and non-working libraries - I am trying to find a link to the comment, but it was referenced in an installation read me when I installed the msi package I think  EDIT Thanks for the references to IronRuby lately, it is certainly a project to watch, and as it, obviously, is a .NET language, it will be invaluable if it lives up to the promises. Eventually, however, in my case, I just bit the bullet and installed an Ubuntu server.   <bias> I should've done it years ago </bias>


Why is nigger so offensive that people refer to it as the N word? After all, a lot of Negroes came from Nigeria, and therefore nigger could just be considered an abbreviated form of referencing a person from Nigeria.


Prove that your answer is correct. $a|b$ if and only if $ac|bc$.

Now i know this much: If we take this in the forward direction that is if $a|b$ then $ac|bc$ then we can say that since $b = ak$ where $k$ is some integer, then $ac|ack$ which is true for all integer k. Now for the backward direction, we have $ac|bc$ and $bc = ack$ which becomes $b = ak$ and hence $a|ak$ which is again true for all integers. Is my proof correct?


Some questions posted here are copied to queforum.com

Why are some of my and other users' questions that are posted on Stack Overflow copied to ?  I just noticed this while searching on Google.


One Test Method Covering Multiple If-Else Conditions

Can I cover multiple conditions in just one apex test method?


How to understand divergence physical significance?


How many different topology exist on A, where is |A| = n

So the question is "How many different topologies exist on A union, where is |A| = n"?


Combinatorics: Number of possible 10-card hands from superdeck (10 times 52 cards)

I have the following problem from book "Introduction to Probability", p.32     A certain casino uses 10 standard decks of cards mixed together into one big deck, which   we will call a superdeck. Thus, the superdeck has 52 · 10 = 520 cards, with 10 copies   of each card. How many different 10-card hands can be dealt from the superdeck? The   order of the cards does not matter, nor does it matter which of the original 10 decks   the cards came from. Express your answer as a binomial coefficient.   Hint: Bose-Einstein.   My solution:  Because the number of cards of each type in the superdeck (10) is not less than the size of the hand (10), and thus not limiting, it's the same as sampling with replacement where the order does not matter,  so the number of possible 10-card hands would be $\binom{52+10-1}{10}$.  Is my thinking correct?


dyld monitors DYLD_ variables behind the scenes

If I invoke  DYLD_X=foo /bin/bash -c 'echo "<$DYLD_X>"'   the output is  <>   while  MY_VAR=bar /bin/bash -c 'echo "<$MY_VAR>"'   outputs  <bar>   Switching to Bash 5:  DYLD_X=foo /usr/local/bin/bash -c 'echo "<$DYLD_X>"'   the output is  dyld: warning, unknown environment variable: DYLD_X <foo>   I would think that dyld should only monitor variables that it knows about. Is there anything that can be done to control this behavior?  MacOS Mojave 10.14.4


Why does SO not show "questions with new activity"

Many other StackExchange sites will notify you when there are "questions with new activity". For instance, from :    Why does StackOverflow not have this feature?


"Show" that the direction cosines of a vector satisfies...

"Show" that the direction cosines of a vector satisfies  $$\cos^2 \alpha + \cos^2 \beta + \cos^2 \gamma = 1$$  I am stumped on these things:   "SHOW" that the direction cosines corresponds to a given vector to satisfy the relation above. ----> How do you "show" this? What does this mean? Does this mean to use the direction cosines of a vector?  I'm sure this is a proof but I don't know what the end result would look like or better, what I am expected to learn from this proof.    I am not looking for a mere answer but really an in-depth explanation of the problem.  Greatly appreciated. :)


Why rabies virus has nearly 100% fatality rate in human (see ; thanks to @iayork for the link) if not vaccinated early, even some people have survived Ebola, then why does rabies doe not get extinct as its most virulent form will kill host and virus also?


Installing C POSIX libraies in Ubuntu 14.04 LTS

I'm trying to install the following C POSIX headers in Ubuntu 14.04 but for some reason some of them won't install.   sys/ioctl.h unistd.h locale.h ncursesw/ncurses.h   Commands tried  sudo apt-get install sys/ioctl.h sudo apt-get install unistd.h sudo apt-get install locale.h sudo apt-get install ncursesw/ncruses.h   I've only managed to install locale.h but for some reason the rest return a regex error stating that sys/ioctl.h wasn't found. I'm fairly new to Linux/Ubuntu and are not sure what to do at this point. Any help is appreciated


I use to session but got the below error     Error use to session login


Short story from decades ago: The premise is a precursor to the movie "Avatar"

An extremely deadly/hostile atmosphere on a planet/moon/asteroid is being exploited (mined?) by biological avatars controlled from orbiting ships. The protagonist begins to lose the distinction between his avatar "self" and "reality".


How do I show the side bar (incl. available hard drives) when I open the file explorer Nautilus?

When I open the file explorer it only shows the home directory. It doesn't show any of my hard drives of computer.  How can I make the file explorer show available hard drives?


What is the difference between 'while' and 'whilst'? When to use them?


When I try to perform any command containing 'mysql' I get the following error message:

For example the command: ~$ mysql -v  yields:                                                                                ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)


We'll I have a 5 Kilometer egg and I've walked the distance 1 thing I can't hatch it i dont know what's wrong but someone please help I've tried tons but no it says 5/5Km


Is it possible to eliminate PMI (Personal/Private Mortgage Insurance) on a mortgage before reaching 20% down on principal?

I am a relatively new home owner, having purchased my first home in October 2009. Overall, I feel I got an excellent deal on the loan, which was 5% no-cost, no points, and 12% down. I had to take on PMI (mortgage insurance) since I was unable to put down a full 20%. This mortgage insurance is costing me a hefty $1752 per year, and I am wondering if there are any options for refinancing that would allow me to remove the PMI, despite not yet reaching that 80% loan-to-value ratio.


Books for Group theory in particle physics

I am taking particle physics course. I want to know how the group theory applied in particle physics. Could every one recommand some books for this topic? This is the conference that I am reading: Introduction to Elementary Particles. Griffiths


Git error: large files "detected", even though no large files exist

I am trying to push a repository onto Github, but I cannot as "large files are detected". The largest file is only 38 MB! There should be no problem.   However, the error states that the file datafiles/FILENAME.json is 2016.04 MB, and is still in this subdirectory. But I have deleted this! I have also used git commit, so those changes should be committed.   I go into the subdirectory (which has already been initialized with git init). I then try to use sudo git push origin master.   This is the error I get after $ sudo git push origin master:  Counting objects: 19, done.  Delta compression using up to 4 threads.  Compressing objects: 100% (18/18), done.  Writing objects: 100% (19/19), 1.69 GiB | 385.00 KiB/s, done.  Total 19 (delta 9), reused 0 (delta 0)  remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.  remote: error: Trace: b2274b496089a760fae877fdaf3d8b23  remote: error: See http://git.io/iEPt8g for more information.  remote: error: File datafiles/FILENAME.json is 2016.04 MB; this exceeds GitHub's file size limit of 100.00 MB   What is the problem?


I'm using ubuntu 15.10(unity), I want some scripts running when a session starts. I tried the following methods:   Put those scripts in the file ~/.xsession, but it didn't work (It worked when I executed those scripts manually in gnome-terminal).  Add those scripts to Startup Applications in unity, it didn't work, either. I guess it's because Startup Applications runs those scripts when OS starts, but the scripts that I want to run demands a session.   How to achieve this?


How many post edits can I do in a day? I think I have submitted less than 10 post edits today, but I am getting the following message:     Our edit queue is full, try again in a few minutes   What does this mean, and when can I start suggesting edits again? Have I done something wrong?


Elegant way to remove items from sequence in Python?

When I am writing code in Python, I often need to remove items from a list or other sequence type based on some criteria. I haven't found a solution that is elegant and efficient, as removing items from a list you are currently iterating through is bad.  For example, you can't do this:  for name in names:     if name[-5:] == 'Smith':         names.remove(name)   I usually end up doing something like this:  toremove = [] for name in names:     if name[-5:] == 'Smith':         toremove.append(name) for name in toremove:     names.remove(name) del toremove   This is innefficient, fairly ugly and possibly buggy (how does it handle multiple 'John Smith' entries?). Does anyone have a more elegant solution, or at least a more efficient one?   How about one that works with dictionaries?


Can a computationally unbounded adversary break any public-key encryption scheme?

Assume there is a public-key encryption scheme $(KeyGen, Enc, Dec)$ with perfect correctness (i.e., for all messages M and valid key-pairs (PK,SK), we have $Dec_{SK}(Enc_{PK}(M))=M$).  Will there always be a function $A$ such that for all messages M and valid public-keys PK, $A_{PK}(Enc_{PK}(M))=M$?  In other words, can a computationally unbounded adversary decrypt the message, having only the public key?


I've read one cook say,  "I add baking soda when I make bread using buttermilk. The buttermilk is acidic enough that it interferes with the environment that commercial yeast needs to reproduce well, resulting in a somewhat dense, poorly risen loaf.  I add1/2 teaspoon of Baking Soda per 8 ounces of buttermilk, and the result is is a beautifully risen, light bread with beautiful color and texture. The Baking Soda neutralizes the acid in the buttermilk, producing CO2, which adds to the bread's leavening."  Does adding them all together(or one and yeast) really work that way, or is it overkill!? I have seen other recipes use all three and they also had buttermilk in the recipe. So is it the buttermilk that changes it all, to have to use all three(or one and yeast)?


Proving the product of a numeric sequence and a sequence of random variables converges

Suppose that the sequence of random variables $\{X_{n}\}$ converges to   a random variable $X$ in distribution, and a numeric sequence $a_n$   converges to $1$. Prove that $a_nX_n$ converges to $X$ in   distribution.   I'm not quite sure how to approach this problem. I recently learned about Weak Convergence, but that seems to be no help here. For example, I am aware of Prokhorov's Theorem, but that seems to be useless here. So I am instead trying to use different inequalities, like Markov's, Chebyshev, etc. I'm studying for my exam and will greatly appreciate your help in solving the problem.  Thank you


Understanding destructors for this specific instance

In a medium size code I have a base class like this  class Base { public:  virtual ~Base() = 0; //This is the important point };   In a derivate class I have something like this  class Derivate : public Base { public:  ~Derivate(); };   An implementation of the virtual constructor is provided (it basically does some deallocation on the base class) the derivate class extends such behaviour to the derivate class. Since the base class is abstract I cannot instantiate anything.  I have a wrapper class like this  class Wrapper {  public:    ~Wrapper();  private:    Base *stuff; }   Now I could have several derivates classes of the base one, so basically the purpose would be to let the user have the freedom of chose what to put in stuff The destructor of Wrapper is implemented as  Wrapper::~Wrapper() {   stuff->~Base(); }   (My actual code follows such pattern). However when the destructor of wrapper is called an error is returned when I debug using gdb, where basically is stated that ~Base() Is a pure virtual method, which is true, however I thought that because is virtual anyway the actual constructor of the derivate class would have been called instead.  Is my understanding wrong? What Am I missing? Shall I decler the destructor of Base just as virtual and not pure virtual?  Note : Please keep in mind that the code I posted is a just some scratch.  Thank you.


How to number of occurrence of a word in a ArrayList?

I have written the following code and got the output.  import java.util.ArrayList;  public class DuplicatesinArrayList {      public static void main(String[] args) {          ArrayList <String> al = new ArrayList<>();         al.add("Soumen");         al.add("Rahul");         al.add("Soumen");         al.add("Ram");         al.add("Rahul");         al.add("Rahul");         al.add("Rahul");         al.add("Ram");         al.add("Ram");         al.add("Ram");         al.add("Ram");          for (int i = 0; i < al.size(); i++) {               int ctr = 0;             for (int j = 0; j < al.size(); j++) {                 if(al.get(i).equals(al.get(j)))                     ctr++;             }             System.out.println(al.get(i)+" present " + ctr + " times");          }     } }   The result is as follows:  Soumen present 2 times Rahul present 4 times Soumen present 2 times Ram present 5 times Rahul present 4 times Rahul present 4 times Rahul present 4 times Ram present 5 times Ram present 5 times Ram present 5 times Ram present 5 times   I want for each word there should be one result. Can anyone help?


What formula would allow incrementing a number each time a certain name appears in a column?

How do I add a list of names to a spreadsheet and each time a specific name appears add the number 10 to cell.  For example, I would put a name like Jones in A1 then Jones in A5. And in D5 it would have the number 20. If I then add Jones in B2 then D5 would say 30. Add 10 each time Jones appears.  What   formula  would I use?


count of distinct permutation of N elements when non of the given m pairs is a part of the permutation?

Suppose i am having a permutation of N items(from 1 to N) and M pairs,then what will be the no of different permutations under condition that any of M pairs should not come together? For ex - Suppose i have N = 5, So i have 1 2 3 4 5 Now for M = 2.and the 2 pairs are 1 2 and 4 5,the no of valid distinct permutations will be 48. Another example say we have N = 5 So we have 1 2 3 4 5 and M = 1 and the pair is 1 2 we will have 72 valid permutations. I am having problems when the pairs overlap, like 1 2 and 2 3.


I'm wondering if my thinking here is right. I want to find all subfields of $\mathbb{Q}$($\sqrt2,\sqrt3)$. I believe that $\mathbb{Q}$($\sqrt2,\sqrt3)$ is the smallest field containing $\mathbb{Q}$, $\sqrt3$, and $\sqrt2$.   So this leads me to believe all of the subfields are: $\mathbb{Q}$($\sqrt2,\sqrt3)$ (the field itself), $\mathbb{Q}$($\sqrt2)$,$\mathbb{Q}$($\sqrt3)$, and $\mathbb{Q}$. Is this right?


Why, historically, do we multiply matrices as we do?

Multiplication of matrices — taking the dot product of the $i$th row of the first matrix and the $j$th column of the second to yield the $ij$th entry of the product — is not a very intuitive operation: if you were to ask someone how to mutliply two matrices, he probably would not think of that method. Of course, it turns out to be very useful: matrix multiplication is precisely the operation that represents composition of transformations. But it's not intuitive. So my question is where it came from. Who thought of multiplying matrices in that way, and why? (Was it perhaps multiplication of a matrix and a vector first? If so, who thought of multiplying them in that way, and why?) My question is intact no matter whether matrix multiplication was done this way only after it was used as representation of composition of transformations, or whether, on the contrary, matrix multiplication came first. (Again, I'm not asking about the utility of multiplying matrices as we do: this is clear to me. I'm asking a question about history.)


I program I was using to out put some files apparently did not understand the short cut "~" (directory) very well and has done some trickery that has me confused.  Rather than put the files where I would expect them (/home/me) it has a made a folder in it's subdirectory called "~".  (someprogram/~)  drwxr-xr-x  3 me users 4096 Jan 30 09:34 ~  If I cd into it I get back to /home/me  Is this just a hardlink? I imagine if I try to delete it will will delete my home folder. How can I safely remove it and not delete everything?


Is there really a Bug in ls -l not observing the Environment Variable TIME_STYLE?

Look at this: I want to let ls- l always show the date formatted as long-iso. I was told to add a file /etc/profile.local with the line export TIME_STYLE=long-iso. I did so, as shown below under #1.   However, there is no environment variable TIME_STYLE as shown in #2.   #3 shows the version of the ls command (this all happens with Xubuntu 16.04 LTS).  As shown in the output of #4, ls does not format the date part as long-iso.  Ok, if it is just because the environment variable TIME_STYLE is missing (why?), then I set it in #5 and, as a proof that it exists, I echo it in #6.  Despite of that, ls -l in #7 does not honour that!  Of course, if I explicitly require the date format as long iso as shown in #8, the date is formatted that way. But I want to let ls -l always show the date as long-iso without having to tell it on every invocation and I also want to avoid to create an alias for ls -l which incorporates this parameter (which of course would be easy to do, but that's not sportsmanlike).  What's wrong here? Some basic misunderstanding? Or is it really a bug? I can't really believe it in ls -l!  a@v:~$ cat /etc/profile.local                 # 1 export TIME_STYLE=long-iso a@v:~$ echo "${TIME_STYLE}"                   # 2  a@v:~$ ls --version                           # 3 ls (GNU coreutils) 8.25 ... a@v:~$ ls -l /etc/profile.local               # 4 -rw-r--r-- 1 root root 27 Dez 30 19:18 /etc/profile.local a@v:~$ TIME_STYLE=long-iso                    # 5 a@v:~$ echo "${TIME_STYLE}"                   # 6 long-iso a@v:~$ ls -l /etc/profile.local               # 7 -rw-r--r-- 1 root root 27 Dez 30 19:18 /etc/profile.local a@v:~$ ls -l --time-style="${TIME_STYLE}" /etc/profile.local  # 8 -rw-r--r-- 1 root root 27 2018-12-30 19:18 /etc/profile.local a@v:~$   Edit: As dessert taught us: After using sudo nano to append a line export TIME_STYLE=long-iso to the existing file /etc/bash.bashrc I got:  a@v:~$ ls -l /etc/bash.bashrc -rw-r--r-- 1 root root 2374 2019-01-02 00:23 /etc/bash.bashrc a@v:~$  Thank you, dessert, for your help and especially for your explanations why ls -l did not work as intended.


I have this part of shell script :  #!/bin/bash shopt -s extglob currentDate=$(date +%F)  echo $currentDate command="grep $currentDate" gcs3='s3://gc-reporting-pud-production/splunk_printer_log_files' gcs3ls='aws s3 ls 's3://gc-reporting-pud-production/splunk_printer_log_files/SOUTH_ASIA/' --recursive ' ssyss3=s3://ssyssplunk  gcs3Current=$($gcs3ls|$command|sed 's/^.*\(splunk_printer.*\)/\1/g')  SAVEIFS=$IFS IFS=$(echo -en "\n\b") s3ls='aws s3 ls --human-readable --summarize 's3://ssyssplunk/' --recursive' echo "ls: " $s3ls egrepCommand="'$currentDate|Total'" echo "grep: " $egrepCommand totalSize=$($s3ls|egrep $currentDate\|Total|awk -F 'Total Size:' '{print $2}'|sed '/^$/d') echo "total size: "  $totalSize IFS=$SAVEIFS   and im getting this error :     2019-05-27 ls:  aws s3 ls --human-readable --summarize   s3://ssyssplunk/ --recursive grep:  '2019-05-27|Total'   ./copyFilesFromS13.sh: line 54: aws s3 ls --human-readable --summarize   s3://ssyssplunk/ --recursive: No such file or directory total size:   what am i doing wrong ?


Chi-squared vs Fisher's Exact Test w/ 5x6 contingency table & some cells <5?

I don't have the minimum required data of 5 in each cell for a chi-squared test, but my contingency table is greater than 2x2, so I can't use a Fisher's exact. Would it help to use a chi-squared test set to either exact or Monte Carlo to prevent it from making the assumption of normal distribution?  I'm looking at trauma patterns created by five different tools; six categories of trauma have been defined. I would like to see whether the patterns of trauma (by occurrence of each type) differ significantly from one another. N=67, but not all tools have all types of trauma.


What story has someone step on a butterfly in the past and change the future, and what is that effect called?

I remember a story or movie from my childhood where the protagonist goes back in time to retrieve some object, and while doing so he inadvertently steps on something small (like a fly or butterfly). When he returns to the present, he finds the future has changed quite a bit.  Does anybody know the story I'm talking about?  Also, does anybody know about the scientific law/paradox which governs this phenomenon?


Make multicols use whole column in latex

I am trying to make a multicolumn layout. However, the content which I have is small. So it doesn't fill the whole page. Multicol somehow splits the content so the amount of content in the two columns are even. I don't want that. I want the content to be in the first column as much as it can accumulate rather than breaking it even into two columns


I am working on this problem in which I have a dataset of $n$-dimensional examples that come from different and unknown distributions.  Given a new sample, I wish to find $k$ examples from the dataset that come from distribution(s) closest to the new sample.  Which measure (Kullback-Leibler vs Hellinger Distance) might be more suitable for this and why?


How to clean yourself after you've used this style of western toilet in India?

I saw this type of toilet (see image 2) in North India. The commode is same as most of the others. But I couldn't find the jet (see image 1) which is generally attached with the seat.   So I'm wondering how do you clean yourself once you're done (image 2)?


I have a regex for my email validation which is:  ^(?!.*\.{2})[a-zA-Z0-9_\.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-\.]+   I need to be able to prevent the user from entering the below email addresses :  .email@example.com  email.@example.com  email@example.com (Joe Smith)  email@-example.com  email@111.222.333.44444  How do I modify my existing regex so that it handles the above email addresses?


I want to try models to classify the MNIST dataset. now, the parameters I can play with are:  Network architecture: Number of convolutional layers, Number of kernels (filters) for each convolutional layer, Size of each kernel on each layer, Number of hidden layers (fully connected), Number of units for each hidden layer, Usage of layers (like BatchNormalization and Dropout.), Usage of max pooling (or maybe other pooling strategies). Training hyperparameters: Learning rate, Optimizer (SGD with momentum, adam, etc), Number of epochs.  What is the best known network where these are the parameters I can play with? Thanks!


How can I save a part of command lines into a new file using history command?

I am a beginner of bash. I know that type  history   can show all command lines and .bash_history save all of them. But if I want a part of command lines (e.g., current session) and save them into a new file, what should I do? I checked  history --help   and still, do not understand how to do so. Thanks for help in advance!


c - overwriting newline escape character with null terminator causes segfault

So I have a string with multiple newline escape sequences within it. I would like to cut the string to the first n lines, like the head program from coreutils. For example say I have the string "a\nb\nc\n", I would want the first line so I would want my output string to be "a". In other cases where I needed to cut a string I simply placed a null terminator in the position where I wanted the string to end. However when I run something like this:  void main() {     char *str = "a\nb\nc\n";     str[1] = '\0'; }   I get a segfault. I really don't understand why. What can I do to fix this?


Inequality involving the sup of a function and its first and second derivatives

Let $f:\mathbb{R} \to \mathbb{R}$ be a twice differentiable function. And let  $$\eqalign{   & M_0  = \sup \left|f(x)\right|  \cr                & M_1  = \sup \left|\frac{d}{dx} f(x) \right|  \cr                & M_2  = \sup \left|\frac{d^2}{dx^2} f(x) \right| \cr }$$ Prove that  $$M_1 ^2  \leqslant 4M_0 M_2$$ I can not think how I can relate these values in some inequality )=


Macbook Pro 2020 doesn't recognize second monitor while using usbc

I want my MacBook pro-2020 to be closed and have one screen as the main screen(desktop) and the other screen as an extended one. I have 2 new Dell UltraSharp U2419HC monitors, and an UltraSharp U2419H (non-usbc). I have connected one screen to my MacBook using type c to type c cable (from screen to MacBook) and another display port cable from one screen to another one. It looks like either my mac detects only one screen, or either I can't get an extended view over the 2 Dell screens. Currently, the 2 Dell screens display the same thing, my Desktop. When I open my MacBook screen, it detects it's own screen and the Dell screen that is attached with the USB c on extended mode but doesn't detect the second Dell monitor. When I get into the System Pref -> Displays I can only see the Dell monitor that is connected with USB c. I have also tried to connect the USB c to a Dell laptop and it did work, so I assume it's not a connectivity issue, and furthermore when I'm connecting the second Dell screen using HDMI cable type c to my MacBook (overall 2 Dell monitors connected directly to my MacBook) it works.


How do I account for newly added money when computing my rate of return?

I have a simple spreadsheet where I track the balance in my investment account.  What should I do to handle new deposits in the account?  For example:   End of Day 1: balance = $100   End of Day 2: $120 (daily gain 20%)   End of Day 3: $150 (daily gain 25%)   So after Day 3 I have made 50%. Let's say that in between Day 3 and Day 4, I deposit $100, so at the beginning of Day 4, the balance is $250.    If I compute the return as above, all of a sudden it drops to 25% ($250 balance, $200 in), which is clearly wrong.  And furthermore obviously the gain from Day 3 to Day 4 is not 66% ($250/$150), it's zero.  I'm pretty frequently depositing new money into my investment account, so what's the best way to account for this?  Is the rate of return some weighted average based on how long the money was in the account?


Why commercial wind generators usually have just 2-3 blades?  Having more blades would allow to increase power OR decrease diameter. Decreased diameter would also reduce stress due to different wind speed on different height...  But despite that commercial generators have few blades...


a and b commutes of order p q with p and q co-prime show that ab is order pq

Let $(G,*)$ be an abelian group with two elements a and b of order p,q co-prime. What is the order of a*b ?  At most pq as $(a*b)^{pq}=a^{pq}*b^{pq}=1_G$  I guess it is exactly pq but I do not see why ?


Why is a separate fiscal year needed different from that of a calendar year?

What is even a separate fiscal year different from that of a calendar year? A detailed answer to this is most welcome. I am asking this particularly in Indian context.


string with underscore in \subsection, like ABC_XYZ

I need in \subsection string with underscore, like ABC_XYZ.  \subsection{Text ABC_XYZ}  When I try to compile with pdflatex:  Missing $ inserted ...ine {1.2}Text ABC_XYZ}{4}{subsection.1.1.2} Extra }, or forgotten $ ...ine {1.2}Text ABC_XYZ}{4}{subsection.1.1.2}   I cannot write ABC\_XYZ. It is important for me to find this string ABC_XYZ automaticly. And I need this string in table of contents.  Option   \verb+ABC\_XYZ+    dont work.   Can you help me?


Is ubuntu touch available for phones with physical keypads?

I'm using NOKIA X2-01 and want to install Ubuntu. Can I? I guess it is the same for a Nokia 201 or even a blackberry - will it work?


My thesis title is "Powerbank with sound to eletrical energy converter" meaning I'll be using sound to charge the powerbank, and I decide to used dynamic microphone instead of condenser microphone since dynamic microphone dont need any external voltage in order to work unlike condenser microphone.  I tried to measure the voltage output of the Dynamic Microphone under oscilloscope, every time I make some noise the reading gives 10-30mVAC.   What amplifier should I use in order to amplify the induce voltage coming fron the dynamic microphone which is (10-30mV) into 5V enough to charge a battery?


Why Parallel ForEach worked but Creating multiple Task didn't?

static void Main(string[] args) {     var repo = new StudentRepository();      List<Student> students = new List<Student>();       var myLock = new object();     //version 1-----------------------------------------------     for (int i = 1; i <= 20; i++)     {         var stud = repo.GetStudentById(i);         students.Add(stud);      }      //version 2-----------------------------------------------     var ids = new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 };     Parallel.ForEach(ids, id =>     {         var stud = repo.GetStudentById(id);         lock (myLock)         {             students.Add(stud);         }     });      //version 3------------------------------------------------ -     List<Task> tasks = new List<Task>();     for (int i = 1; i <= 20; i++)     {         tasks.Add(Task.Factory.StartNew(() =>         {             var stud = repo.GetStudentById(i);             lock (myLock)             {                 students.Add(stud);             }         }));      }     Task.WaitAll(tasks.ToArray());       students.ForEach(s => Console.WriteLine(s.Id + "---" + s.Name));     Console.ReadLine(); }   Output With version 1   Output With version 2    Is there any difference between version 1 and version 2 (performance wise)? While version 2 gives proper results version 3 stores null in student list(i.e. students). What wrong I am doing here?


Sending attachments with mailx and uuencode

I am in the process of trying to run a script which usually sits on an AIX machine on its new host Linux node.  The code I am running looks like this:      (uuencode $path/info.dat info.csv; uuencode $RESULTS results.log) | mail -s "Info" $MAIL_RECIPIENTS   So normally what this does is take the .dat file and standard outs it in a csv format - and sends the mail with no body but just the info.csv and results.log attached.  What is actually happening is the encoded output that uuencode produces (if you were to just run it independently) is being sent in the message body and there are no attachments.  The email body looks like this:   begin 775 info.csv  M+3`U+C`S+C4S+C(Q-#`W."(L(D%55$]314Y$("`B+")!551/4T5.1"`@(BPB etc.. etc... end  begin 775 results.log M+3`U+C`S+C4S+C(Q-#`W."(L(D%55$]314Y$("`B+")!551/4T5.1"`@(BPB etc... etc... end   The version of uuencode on the new machine:   uuencode (GNU sharutils) 4.7 Copyright (C) 1994, 1995, 1996, 2002, 2005, 2007 Free Software Foundation, Inc. This is free software; see the source for copying conditions.  There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


Another website is mirroring and ranks above my site in search results

There is a site of ill-repute known as thedirty which has completely mirrored my site and now has links appearing on Google at the #1 spot using my content.  I checked my log files and noticed that this site has been crawling mine for sometime, and also has 10,000 links from their site to mine.  I have blocked user access which is referred from this site and reported them as web spam to Google already.  I also disavowed the domain.  How are they getting top links in Google (even overtaking mine) for such nefarious tactics?  What are the steps to completely eliminating an issue such as this?  UPDATE 8/28/2014:  I thought I would provide an update on this as I have more information now.  So thedirty pointed their subdomains to my ip which had the effect of making their subdomains look like my website.    For a couple of days this didn't matter much because using htaccess, I redirected all HOSTS not of my domain, back to my domain which basically meant I was getting their subdomains traffic links on Google.  After a couple of days thedirty changed their subdomains to point back to their website so that I no longer benefit from this.  So the whole point being they used my content to get top ranks on Google, and are now pointing those links back to their website to drive more traffic to theirs.  It is a dirty tactic by a dirty website.  My hope is that Google punishes such behavior.


I have a polygon shapefile with holes (representing Islands and Rivers) within it as seen below:    I need an automated way to fill the polygon in QGIS as seen below: That is remove all Islands and divisions within and outside the polygon.    I know I can creating a separate layer and manually digitize the area, but there are many of such polygons.  I tried the following, non worked:  1- Vector > Geometry Tools > Multipart to Singlepart  2- Vector > Geoprocessing Tools > Dissolve  3- Vector > Geoprocessing Tools > Eliminate Silver Polygons  Graphic/image explanation above: What I have is the first image, but what I want is the second image.  Edited: The answer here  over generalized the boundaries into straight line (polygon shape deformed) and it does it for separate Island. What I wanted is to eliminate the gaps (Islands) in between and keep the bigger polygon retaining the shape as close as possible.  The shapefile of the image above is


How to prefix any output in a bash script?

When a script runs, commands in it may output some text to stdout/stderr. Bash itself may also output some text.  But if a few scripts are running at the same time, it is hard to identify where does an error come from.  So is it possible to insert a prefix to all output of the script? Something like:  #!/bin/bash prefix 'PREFIX' &2 echo "wrong!" >&2   Then:  $ ./script.sh PREFIXwrong!


Prove all numbers in a sequence are perfect squares

Let sequence $49,4489,444889,...$ is formed when in between digits $4$ and $9$ is the number $48$. For any number larger than $444889$ continue to put $48$.  Example: $49,4489,444889,44448889,...$ Prove that all numbers in the sequence are perfect squares.  I think of finding generating function of the sequence and then the closed form of a sequence.  How to evaluate generation function (in $\sum\limits$ notation)?


How do you bypass the google account on an RCA RCT6873W42 Android 6.0 tablet?

I factory reset my tablet, but before I did the reset I went into settings and turned off backup and reset. So when I did the reset I pressed wipe data/factory reset then it said am I sure I want to do this it had two options yes or no and I pressed yes. So now it's saying enter the last account that was synced but I cant because I turned it off.   Can someone help me get bypassed the google account set up so i can just get on my tablet? I've tried everything nothing seems to be working. I even called tech support but they're closed.


I have tried this problem and I'm unsuccessful.  Let $T: M(n,n)\rightarrow M(n,n)$ be the mapping defined by $ T(A) = A^T$. Show that the only eigenvalues of $T$ are $\pm 1$.


I'm trying to locate where some files are stored and I can easily browse to them via ssh by going to "cd ~/foldername", however, I have no idea what directory "~/" actually is.  When I browse around folders via WinSCP (yes, I'm a Windows admin), I can't seem to locate this folder at all.   Note: I'm using Amazon Linux on EC2.


Get difference between 2 dates in JavaScript?

How do I get the difference between 2 dates in full days (I don't want any fractions of a day)  var date1 = new Date('7/11/2010'); var date2 = new Date('12/12/2010'); var diffDays = date2.getDate() - date1.getDate();  alert(diffDays)   I tried the above but this did not work.


Let us consider the following two probability distributions  P       Q 0.01    0.002 0.02    0.004 0.03    0.006 0.04    0.008 0.05    0.01 0.06    0.012 0.07    0.014 0.08    0.016 0.64    0.928   I have have calculated Kullback-Leibler divergence which is equal $0.492820258$, I want to know in general what does this number shows me? Generally, Kullback-Leibler divergence shows me how far is one probability distribution from another, right? It is similar to entropy terminology, but in terms of numbers, what does it mean? If I have a result of result of 0.49, can I say that approximately  one distribution is far from  another by 50%?


How do I create a script to restart a service every two hours?

I want to make a simple init.d file that makes it possible for me to reset a trial service that I'm using. I am currently using CodeSys and the startup script cuts me off after 2 hours, so I need to either reset the machine or manually restart the service.  Could someone help me to make a script that:  service stop codesys service start codesys   (every 7200 seconds in an infinite loop)  Thanks in advance!  EDIT: Here is the startup script that has been initially included, do you find anything related to a 2 hour timer? I really don't know much about this stuff.


Smoothing out hard edges on cycles material

I am working on creating a material, and have come to a small problem. At some point in my shader I achive this result:    This is basically binary information, either black or white. For my case I am now trying to blur the transition between the black and white areas to achive a softer looking effect in the final result's displacement map. I want to be able to control how large the blur is (thinking of it as the thickness of an outline around the white spots).  I have already researched a fair bit on my own the past few days, but none of the examples I found seemed to apply to my case.


Persist url parameter passed by a referrer website?

My website gets called from a referrer with a zip code in the url as a parameter like this:    But if I click another link on my site, the parameter is lost!  How can I keep this parameter permanently on the site or use it for the current session?


I am working on some presentation with beamer. However, I need a specific frame size (not the default values of aspect ratios). What I need is to crop the frame around its content and control the padding size. For example:  \documentclass{beamer}  \beamertemplatenavigationsymbolsempty  \begin{document} \begin{frame} \begin{tikzpicture}  \draw (0,0) circle(3cm);  \end{tikzpicture} \end{frame} \end{document}   And here is what I got:    What I am looking for is to get:


The daily reputation list doesn't match the daily bars in the graphical reputation summary

I recently noticed that the question/answer-level summary of reputation changes that you get when clicking the daily reputation bars doesn't match the correct day. Instead you get a list of the reputation changes during the previous day.  This screenshot makes this clear, and the list shown below belongs to the day to the left of the grey bar:    also, where the list is empty since it is showing reputation changes for Jun 6, and not the selected day:    I noticed this at BiologySE, but have the same problem on StackOverflow. I'm using Firefox 38.0.5 on windows 7, if this should make a difference.


How is an infinitesimal $dx$ different from $\Delta x\,$?

When I learned calc, I was always taught  $$\frac{df}{dx}= f'(x) = \lim_{h\rightarrow 0} \frac{f(x+h)-f(x)}{(x+h)-x}$$ But I have heard $dx$ is called an infinitesimal and I don't know what this means. In particular, I gather the validity of treating a ratio of differentials is a subtle issue and I'm not sure I get it.  Can someone explain the difference between $dx$ and $\Delta x$?   EDIT:   Here is a related thread:     I read that and this is what I don't understand:     There is a way of getting around the logical difficulties with infinitesimals; this is called nonstandard analysis. It's pretty difficult to explain how one sets it up, but you can think of it as creating two classes of real numbers: the ones you are familiar with, that satisfy things like the Archimedean Property, the Supremum Property, and so on, and then you add another, separate class of real numbers that includes infinitesimals and a bunch of other things.   Can someone explain what specifically are these two classes of real numbers and how they are different?


Why do objects rebound after hitting the ground?

When an object, say a shoe, falls from a height (under the influence of gravity), it rebounds after hitting the ground. For an object to move upwards, it requires a force to overcome its weight. When the shoe hits the ground some of its energy is lost and the ground pushes back with a force less than its weight, so why does it rebound, since the upward force is not large enough to overcome its weight?


Installing ubuntu 18.04 on Celeron machine

I have a acer aspire one 751 machince. which is runing on Intel Celeron 1.3GHz processor. it is old machine. I like to install Ubuntu 18.04 in this machince.   my machine details:   Processor: intel celeron M743 Graphics: Intel GMA  Memory: 2GB (planning to add another 2GB)  Motherboard: Intel GS45 Sound card: Intel 82801IB ICH9 HD Audio Controller Wifi: Intel WiFi Link 1000 BGN (b/g/n)  kindly let me know if i can install Ubuntu 18.04 LTS or not.   thanks in advance.   regards Sayeed


"What are Liam and Noel's jobs?" versus "What are Liam's and Noel's jobs?"

This question is about use of the group genitive versus joint possessives in a phrase and/or list.      Where two or more distinct persons, animals, etc., are in the genitive, the group genitive applies only when there is joint possession, responsibility, relationship, as in 'William and Mary's reign' and 'Jack, Tom, and Mary's uncle.' If two separate possessions or other relationships are concerned, each noun must clearly be shown in the genitive.   (Eric Partridge, You Have a Point There, Routledge, 1978)  In this case there is the example of a grammar question on a Jetstream (ESL) test.  There are two possible questions, A: "What are Liam's and Noel's jobs?"  versus B: "What are Liam and Noel's jobs?"   (Answer: They're singers.)  Jetstream claims that 'B' is the correct question, i.e. group genitive. Why would 'A' NOT be correct given that 'jobs' is plural and Liam and Noel each have their own respective jobs?  Is this because 'singers' here acts as a type of job and they both share the same type of job?   Or could Jetstream be wrong on this one?  Or is it an ambiguous case?    Absent the answer, one might not presume when asking the question that both Liam and Noel have the same type of job, so could it still be correct to use the joint possessive form?   The test simply had the following list without possessive forms and the student had to supply the apostrophes and s's where appropriate. The italicized answer in parenthesis was the only correction the system made and it specifically indicated that "What are Liam's and Noel's jobs?" was incorrect.       Is this your umbrella? –  No, it isn't. It's my friend's umbrella.       Are these your keys? –  No, they aren't. They're Peter's.       What are Liam's and Noel's jobs? (What are Liam and Noel's jobs?) –    They're singers.       Is your husband's name Sam? –  Yes, it is.       What are your daughters' names? –  Their names are Tracy and Lily.       Is this the teacher's computer? –  Yes, it is.       That's a nice phone! –  Yes. It's Colin's. It's the new Samsung.       When is your parents' anniversary? –  It's on November 17th.


Generate md5 checksum for all files in a directory

I would like to create a md5 checksum list for all files in a directory.  I want to cat filename | md5sum > ouptput.txt. I want to do this in 1 step for all files in my directory.   Any assistance would be great.


Is `$var = $var + 0` an acceptable way to prevent SQL injection in PHP?

A team I work with has a habit of escaping IDs and integers in SQL like this:   $var = $var + 0; $sql = "SELECT * FROM whatever WHERE id = $var";   Is this an acceptable way to prevent SQL injection in PHP, or is it vulnerable?


Cannot activate virtual environment with a shell script

I read similar questions and have tried their suggestions but I still cannot activate my virtual environment. The hierarchy of directories is:  myproject -- virtualenv -- startvenv.sh   startvenv.sh is:  #!/bin/bash source virtualenv/bin/activate   And, I am running startvenv.sh by:  ./startvenv.sh   No error, but nothing happens. Why? Ideally, I want to open a new terminal and activate my virtual environment there.


What is the difference in the accessibility of the following variables in Java?  public class Joe {     public int a;     protected int b;     private int b;     int c; }   I'm most interested in what the last one is doing.


A cv with or without passport photo while applying for postdoc

I am a Ph.D student from mathematics background and about to submit my thesis in a month or two. I am thinking to apply for postdoc position. Shall I send my normal cv or the one bearing my photo? Thanks for the help and suggestions.


Obviously the set of naturals is denoted $\mathbb{N}$, but is there a symbol for the set of odd naturals? Would $2\mathbb{N}+1$ (or $2\mathbb{N}-1$) be a standard notation?


What's the best way to develop old, exposed film?

A friend of mine just found 3 rolls of exposed 135 (i.e. 35mm) film. They are at least 10 years old. He'd like to know if it is even worth taking them to the local hour photo lab but also if he should give them any special instructions.


How to manually type in handles for anchor in Adobe Illustrator?

In Illustrator CS 5.1, I would like to manually type in the points for handles on an anchor point, as I need to be more exact than moving them with my mouse. How can I do this?


Error while inserting data into SQLiteDatabase in Android

I initial object db and called its method from my current class:          db = new DBHelper(context);         db.addCallerInfo(FragmentCaller.iName.getText().toString(),                 FragmentCaller.sex.getSelectedItemPosition(),                 FragmentCaller.iAddress.getText().toString(),                 FragmentCaller.iTel.getText().toString(),                 FragmentCaller.callerType.getSelectedItemPosition(),                 FragmentCaller.iSpecify.getText().toString());   In DBhelper class:  public void addCallerInfo(String name,int   sex ,String address,String  tel,int  callerType_id,String  specify) {         ContentValues values = new ContentValues();         values.put("name", name);         values.put("sex", sex);         values.put("address", address);         values.put("tel", tel);         values.put("specify", specify);         values.put("callerType_id", callerType_id);         db.insert(TableHelper.TABLE_callerInfo, null, values);     }   Then it has problem java.lang.NullPointerException:   Attempt to invoke virtual method long android.database.sqlite.SQLiteDatabase.insert(java.lang.String, java.lang.String, android.content.ContentValues) on a null object reference  Help please! Thanks.


Find the number of persons who will go to the party

John emailed 128 people to invite them to the restaurant's inauguration party. He asked these guests to send the email to 5 others in exchange for participation in a lottery where a free meal for two is won. Based on the assumptions made below, how many of those who received the email are expected to come to the party? Assumptions •half of the 128 people emailed the other 5. •1/4 of these sent the email to 5 others. •1/8 of these sent the email to 5 others •1/16 of these sent the email to 5 others. • No one received the email more than once. • 10% of those who received the email will go to the party. All help/ solutions appreciated!


Suppose a patent has been filed (or is in process of being filed) over the same research that is described in a paper.  Does filing a patent application require disclosure in the paper publication process?  If so, what would be the expected format of disclosure during the paper publication process, regarding the patent pending status?


I have the windows installation of python 2.7 that came with arcgis 10.2.  In my linux installation of python, I've become fond of other packages, and I'd like to incorporate them into the windows python.  I went through the steps to install pip, and I've got pip working in c:\python2.7\scripts.  But, each time I try to pip install anything (run from that Scripts directory), it fails (with various errors, mostly not finding certain files).    On the other hand, I've used package managers like Canopy or Anaconda, but I don't know how to get arcpy into one of those.    I surely don't quite have the hang of site-packages, dist-packages, paths and environments, particularly in Windows.    Has anyone done this successfully, and can you summarize your steps?


How can I know that I have g++ installed in my ubuntu?

I have recently installed ubuntu 14.04 . I tried to run a c++ code by a command like this:  g++ first.cpp -o first   Then it said:  The program 'g++' is currently not installed. You can install it by typing: sudo apt-get install g++   And then I did. After typing it and pressing enter it showed a message like this:  gedit is already the newest version. libgrail6 is already the newest version. xserver-xorg-core is already the newest version. libgdata13 is already the newest version ...   (and many more lines like this)  Then I tried to run the same command given above again. But the terminal said again that I don't have g++ installed. What am I missing here? How to run the C++ code now?


List of functions used in a Matlab script

Is it possible to obtain a list of the user-supplied functions (functions which are not Matlab toolbox functions) called by a  Matlab script?


In all discussions regarding the Lagrangian formulation it has always been said that $L = T - V $, only is a correct guess that when operated via through the Euler -Lagrange equation yields something similar to the newtons law of motion. But if we are to consider yourselves at the position of Lagrange himself, how are we to guess the correct form of the Lagrangian, using physical arguments only. Even considering that nature is always trying to minimizing something, How do we say it is the action that it must, not something else?


How can I create two different lists of figures under two different names?

I am writing a dissertation. The images I have are varying between charts and regular images. I want them to be listed under :   Table des figures and Tables des graphiques.  I can only make one using figure, how can I generate the second?


How can I get a specific value from a JSON string in JavaScript?

I have a JavaScript object named page.cat.lastResponseText.  This object has the following string value:  {     "orderBy":"",     "orderDesc":false,     "rows":[         {"catIndId":"3","indId":"1","catId":"2"},                  {"catIndId":"4","indId":"4","catId":"2"}     ],     "totalResults":2,     "totalPages":1,     "pageSize":2,     "currentPage":1 }   How I can convert this string into a JSON object? And how do I then get the values for object such as cat.rows or cat.totalResults?


Does iCloud Two-factor authentication send a code to the same device as a log in request?

My Apple-ID (e.g., on  ) is set up to require entry of a 6-digit code sent to my registered Apple products.  This code is being sent to the same device I'm currently requesting to log in. I feel this absolutely defeats the purpose of this 2-Factor Authentication: If a person knows my password, this person can receive the code on that device, and access my apple account without any problems.  Is this a bug or can I set up / change how this security step works?


Count where any 3 columns have values (not null)

I have a table by name ItemProperties with 15 columns. Columns names are like Feature1, Feature2, Color, Length, Width, Height etc... It has 10K+ rows. I need counts from this table where any 3 columns are filled (Not Null). Can we do this through a query?    In the example shown, the query should return count as 4 rows.


I've got an issue with setting an adapter to the ViewPager. Each time i get a NullObjectReference error. What's wrong with my code?  1) Layout:  <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical">  <android.support.v4.view.ViewPager     android:id="@+id/view_pager"     android:layout_width="match_parent"     android:layout_height="wrap_content">      <android.support.v4.view.PagerTabStrip         android:id="@+id/pager_header"         android:layout_width="match_parent"         android:layout_height="wrap_content"         android:layout_gravity="top"         android:paddingBottom="4dp"         android:paddingTop="4dp" />  </android.support.v4.view.ViewPager> </LinearLayout>   2) Java class:  public class FoodFragment extends Fragment {  Toolbar toolbar; ViewPager viewPager; TabsPagerAdapter pagerAdapter;   @Override public void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState); }  @Override public View onCreateView(LayoutInflater inflater, ViewGroup container,                          Bundle savedInstanceState) {      setRetainInstance(true);        ((AppCompatActivity)getActivity())     .getSupportActionBar().setDisplayShowTitleEnabled(true);     ((AppCompatActivity)getActivity())     .getSupportActionBar().setTitle(R.string.food);     toolbar = (Toolbar) getActivity().findViewById(R.id.toolbar);     toolbar.setBackgroundColor(Color.parseColor("#f6a632"));      pagerAdapter = new    TabsPagerAdapter(getActivity()    .getSupportFragmentManager());     viewPager = (ViewPager) getActivity().findViewById(R.id.view_pager);     viewPager.setAdapter(pagerAdapter);      return inflater.inflate(R.layout.fragment_food, container, false); } }   I always get this error when calling   viewPager.setAdapter(pagerAdapter); line.


I am trying to add jQuery to my page (it is not being added by default). The file is adding to the page but after drupal.js causing the error:  SCRIPT5009: 'jQuery' is undefined  drupal.js, line 5 character 1    The code that adds drupal.js to the page in common.inc  ... 'misc/drupal.js' => array(           'data' => 'misc/drupal.js',           'type' => 'file',           'scope' => 'header',           'group' => JS_LIBRARY,           'every_page' => TRUE,           'weight' => -1,           'preprocess' => TRUE,           'cache' => TRUE,           'defer' => FALSE,         ), ...   In my module hook_init I have:    drupal_add_js('misc/jquery.js', array(     'group' => JS_LIBRARY,     'weight' => -20,     'cache' => TRUE,   ));   I would think with a lower weight it would load before drupal.js?  The header of the page contains the following scripts:  <script type="text/javascript" src="http://mysite.com/misc/drupal.js?mqdxrf"></script> <script type="text/javascript" src="http://mysite.com/misc/jquery.js?mqdxrf"></script> <script type="text/javascript" src="http://mysite.com/misc/jquery.once.js?mqdxrf"></script> <script type="text/javascript" src="http://mysite.com/sites/default/files/languages/nl_c9aC92_wtuULa79-hTFcGPM53oqk1yKwciOa_Q3yO28.js?mqdxrf"></script> <script type="text/javascript" src="http://mysite.com/sites/all/modules/lang_dropdown/msdropdown/jquery.dd.js?mqdxrf"></script> <script type="text/javascript" src="http://mysite.com/sites/all/modules/lang_dropdown/lang_dropdown.js?mqdxrf"></script> <script type="text/javascript" src="http://mysite.com/sites/all/modules/devel/devel_krumo_path.js?mqdxrf"></script>


If logic is constructed from axioms, and axioms are depended on observation which in term could be subjective, does this means that logic could be limited to our observation, and not really absolute and fundamental?


How do I connect to a MySQL Database in Python?

How do I connect to a MySQL database using a python program?


Securing SSH server against bruteforcing

I have a little SVN server, old dell optiplex running debian. I don't have that high demands on my server, because its just a little SVN server... but do want it to be secure.  I just renewed my server to a newer and better optiplex, and started looking a bit into the old server. I took it down after experiencing problems. When I check the logs, its full of brute-force attempts and somehow someone has succeeded to enter my machine. This person created some extra volume called "knarkgosse" with two dirs "root" and "swap1" or something.  Don't really know why and what they do, but sure do want to prevent this from happening again. I find this a bit strange though because I change my password ever few months or so, and the passwords are always random letters and numbers put together... not easy to brute-force.  I know I can prevent root from logging in, and use sudoers... and change the SSH port, but what more can I do?  So I have a few questions:   How can I prevent logging in for 5 minutes after X amount of incorrect tries. Or slow tries down after each incorrect try? Is there some kind of central blacklist which a server can connect to? A blacklist that keeps track of IP addresses that are "unsafe" and should never be granted access? What more can I do to apply safety to my server?   Like I said earlier, I am running Debian 5 with Apache (www-data user problem?), svn, mysql, php, phpmyadmin, hudson. It is on a home network with port forwarding on 80, 443, 8080, 8180, 23 and 22.


Word/term for users who are not experts and scientists

In the field of computer science, what should users who are  not experts and scientists be called?  I've come up with ordinary users or regular users. Any formal alternative or widely-accepted term/word?


Does your institution has or have eye donation center? Or Has your institution eye donation centre?

which one is correct sentence?  Does your institution  has or have  eye donation cente? In this sentence, which one I should use either has or have?


Open neighborhood of the identity in general linear group with no proper subgroup.

I'm trying to prove that there exists an open neighborhood of the identity in the complex general linear group that contains no proper subgroup.  This is needed to show that a continuous representation of a profinite group has open kernel.  Any help is appreciated.


Find the limit of the sequence $\{\sqrt{n+1}-\sqrt{n}\}$.

As in the title, I need help finding the limit of this sequence. $$\{\sqrt{n+1}-\sqrt{n}\}$$  I tried to multiply by the conjugate, but that just got me to $\dfrac{1}{\sqrt{n+1}+\sqrt{n}}$, and I'm not sure what else I can do. L'Hospital's rule doesn't get them out of their parentheses.


how to show Debian distribution name used in ubuntu?  $ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description:    Ubuntu 18.04.3 LTS Release:    18.04 Codename:   bionic   no debian release name here


NullPointerException when trying to run class file

I'm trying to run my class file which has a main method in Netbeans, and I get this error.  Exception in thread "main" java.lang.NullPointerException     at javaapplication1.Magazine.main(Magazine.java:25)   What's the issue? For clarity, each Magazine has an some Supplements so I have tried to create an array of Supplements to store in one instance of a magazine.  I also don't fully understand the reason behind using a main method in a class. How would I make use of it in the main program?  Magazine.java:  // // //  Generated by StarUML(tm) Java Add-In // //  @ Project : Untitled //  @ File Name : Magazine.java //  @ Date : 21/04/2020 //  @ Author :  // // package javaapplication1;  public class Magazine {     private String magazinename;     private int WeeklyCost;     private Supplement[] supplement;         private Magazine magazineobj;           public static void main(String args[]){              Supplement[] supplements = new Supplement[3];             for(Supplement supplement: supplements){                  supplement.fillArray();              }              Magazine magazineobj = new Magazine("The Wheels Special", 35, supplements);             magazineobj.printMagazine();           };          public void SetMagazineName(String magazinename1){              magazinename = magazinename1;          };     public void SetWeeklyCost(int WeeklyCost1){              WeeklyCost = WeeklyCost1;          };     public String GetMagazineName(){              return magazinename;          };     public int GetWeeklyCost(){              return WeeklyCost;          };     public void SetMagazine(String magazinename1, int WeeklyCost1, Supplement[] supplements1){              magazinename = magazinename1;             WeeklyCost = WeeklyCost1;             supplement = supplements1;          };     public Magazine(String magazinename1, int WeeklyCost1, Supplement[] supplements1){              SetMagazine(magazinename1,WeeklyCost1,supplements1);          };          public Magazine(){};         public void printMagazine(){              System.out.println(magazineobj);          } }   Supplement.java:  // // //  Generated by StarUML(tm) Java Add-In // //  @ Project : Untitled //  @ File Name : Supplement.java //  @ Date : 21/04/2020 //  @ Author :  // //  package javaapplication1;   public class Supplement {     private String supplementname;     private int WeeklySupCost;          Supplement[] supplements = new Supplement[3];          public void fillArray(){               supplements[0] = new Supplement("Sports Illustrated Special", 4);             supplements[1] = new Supplement("Health and Nutrition", 2);             supplements[2] = new Supplement("Lifestyled", 5);             supplements[3] = new Supplement("Gamer's Update", 3);           };          public void SetSupplementName(String supplementname1){              supplementname = supplementname1;          };     public void WeeklySupCost(int WeeklySupCost1){              WeeklySupCost = WeeklySupCost1;          };     public String GetSupplementName(){              return supplementname;          }; public int GetWeeklyCost(){          return WeeklySupCost;      }; public void SetSupplement(String supplementname1, int WeeklySupCost1){          supplementname = supplementname1;      }; public Supplement(String supplementname1, int WeeklySupCost1){          SetSupplement(supplementname1, WeeklySupCost1);      };      public Supplement(){};   }


After rebooting different login UI appeared and after logged in Ubuntu desktop doesn't load correctly only wallpaper available

After restarting Ubuntu this tty-like login screen appeared and once logged in Ubuntu desktop is not working properly. Only wallpaper is visible (no launcher and pane).   I'm using Ubuntu 16.04.1 LTS.


How do you unlock the Bullet as a playable character?

I heard a while back that you could play as a BulletKin in Enter the Gungeon but I don't know how. Is it a cheat or hack? Or is there something you have to do?


Can I run gigabyte gforce gtx750ti 4GB with my 420W power supply?

I am looking to buy the gigabyte geforce gtx750ti 4GB graphics card. The power supply system requirement says that I need a 400W minimum and my power supply has 420W so I guess that I have enough or am I wrong? can someone help me please?


So after installing ubuntu 18.04, it asked me to update(don't know exactly what). Of course, I restarted the computer and began updating. However, as of now about 3 hours have already passed and I'm stuck with the ubuntu logo and the five orange - and white dots trading places.  Can I view how the update progresses or should I just restart?  Edit: Restarting apparently fixed the problem, don't know what or why happened as I made sure to check the box to have all updates installed at the start.


Why did Vice-Admiral Holdo keep the plan secret?

It's understandable to tell as few people as possible, especially as they were being tracked; there could be a mole, but besides Leia it seemed no one knew.   I know Finn was knocked out, but why not tell him the plan after he woke up? At least, Holdo would only know Finn as a hero of the Battle of Starkiller Base. If Poe was a overconfident hothead, Finn was the opposite- i.e., nervous, confused, and lacking the desire to be a hero, despite becoming one.  Also, Rose was an engineer- too low for the leaders to notice... but, she was also shown to be very loyal, by knocking out defectors, and dragging them to the brig. There's no way Rose would be a traitor.  How can the plan be carried out if no one is told what it is?


The FN keys are not working  Using answer in 166261 question I installed the asus-wmi-dkms_0.2_all.deb.gz package  Now, using xev I see that the keys emit keycodes (for backlight keys xev says for fn-f3 and fn-f4 keycode 237)  But no keyboard backlight, also volume keys have no effect  Description of my framework:  ===========================================================  Machine: Asus N56V laptop  ===========================================================  Software   Kubuntu 12.04 amd64  kernel (3.5.0.5-generic) and drivers from xorg-edgers fresh X crack ppa   ===========================================================  Hardware and problems   after installation do not boot - SOLVED using boot-repair every couple of hours the system freezes - SOLVED using 3.5 kernel keybord FN keys - NOT WORKING Keyboard backlight - NOT WORKING Nvidia GEFORCE GT - NOT USED glxgears says 60 fps Ethernet Atheros card - SOLVED install alx driver external subwoofer - SOLVED adding options snd-hda-intel model=asus-mode4   ==========================================================  Solutions  see the asnwers to the 162047 and 166261 questions  ==========================================================


Why i can not edit ubuntu files on windows 10 subsystem?

So I can install Ubuntu as a subsystem on Windows 10 and there is the location of all files. Everyone says "You can not edit files from windows gui".  I wonder exactly why?  Is it because windows use NTFS?  anything of these:?     Line breaks Windows uses CRLF (\r\n, 0D 0A) line endings while Unix   just uses LF (\n, 0A).      Character Encoding Most modern (i.e., since 2004 or so) Unix-like   systems make UTF-8 the default character encoding.      Windows, however, lacks native support for UTF-8. It internally works   in UTF-16, and assumes that char-based strings are in a legacy code   page. Fortunately, Notepad is capable of reading UTF-8 files;   unfortunately, "ANSI" encoding is still the default.      Problematic Special Characters U+001A SUBSTITUTE Windows (rarely) uses   Ctrl+Z as an end-of-file character. For example, if you type a file at   the command prompt, it will be truncated at the first 1A byte.      On Unix, Ctrl+Z is nothing special.      U+FEFF ZERO WITH NO-BREAK SPACE (Byte-Order Mark) On Windows, UTF-8   files often start with a "byte order mark" EF BB BF to distinguish   them from ANSI files.      On Linux, the BOM is discouraged because it breaks things like shebang   lines in shell scripts. Plus, it'd be pointless to have a UTF-8   signature when UTF-8 is the default encoding anyway.   source:   What are the options? Can I edit a file with some specific editor? Like Visual Studio Code?


Switch Stack Exchange site's interface to the beta theme

Is it possible to switch a certain Stack Exchange site's interface (as a personal preference) to the theme used by beta sites?  Some sites have flashy decorations or unreadable fonts (I prefer to disable antialiasing on fonts). It would be nice to have an option to see a site with the "beta" theme.  If there's a solution using custom styles, I would accept that as an answer.


Novel about a crew member of a spaceship having hibernation nightmares

I read a novel from the 1970s about a crew on a ship who are in hibernation.  The story mostly deals with one crew member.  He has very disturbing dreams during his sleep periods.  Such things as being a fish, and being eaten alive by a bigger fish.  He can feel, in the dream, all the pain of being chewed.  He has waking periods to think about the dreams, and having to face the inevitability of going back into hibernation.  I cannot remember the title or author, and that is what I am seeking.


QGIS gives different resolution basemap in Print Layout

I use tiled background map, from online source with 512-pix tiles and try to use it as background for printed map, using Print Layout and PDF export features. Problem: it seems that the choice of tile zoom levels depends automatically from the DPI setting.  Basemap layer is defined simply as "XYZ tiles" layer with following URL: http://1.basemaps.cartocdn.com/rastertiles/voyager/{z}/{x}/{y}@2x.png    In the preview it uses screen dpi (70 perhaps), and I see this map on both map window and Print Layout. Tiles are here from zoom 16. And the street names are big and readable, as I need.  Now for for print I need 600 (or more) DPI PDF-s. When I set this as Export resolution of Layout and create PDF, then suddenly exporter takes tiles from zoom 18, so exported PDF has different map, as below. Probably QGIS tries to match print resolution with tile raw resolution, but this is bad idea for such raster tiles, as you end up with very small texts. This rescaling probably makes sense for satellites, but not with maps with scale-dependent styles like texts. The pattern is that with 300 DPI there is +1 zoom, with 600 +2 zoom etc.    In screenshots here the difference is not maybe so visible as it is in real printouts, but it is quite terrible.  Question: is there a way to adjust this multi-resolution raster layer resolution matching magic in QGIS Print Layouts?  This WMS question seems similar, maybe core issue is same:   Btw, my quick remedy is now to use raster screenshot from Print Layout, but then I loose PDF vector with this, which would give much clearer vector texts and SVG vector icons on top of map.


How to compare updated entity with old entity and store only the updated values in the database

I'm working with Spring Boot + Rest + Jpa .So if a user edits any of the  employee entity (empId, salary, age, location, role, experience) columns mapped to the employee table, I should track the old and new changes and enter into a audit table, with the column changed.  public EmployeeEntity update(int empId, EmployeeEntity employeeEntity ) {      em = emf.createEntityManager();     EmployeeEntity beforeObj = em.find(EmployeeEntity .class,empId );      try {         em.getTransaction().begin();         em.merge(employeeEntity);         em.getTransaction().commit();     }     finally {         em.close();     }      return employeeEntity; }   So now I have entities with beforeObj (the employee entity with old values) and employeeEntity (the updated values), so for eg is only salary and location is being updated, I have to track those and update in a audit table . Need to do plain simple than using Envers or any other JPA tools ,since only minimal transaction can happen.   This is my entity class:  @Entity @Table(name = "TEMPLOYEE") public class EmployeeEntity implements Serializable {  private static final long serialVersionUID = 1L;  @Id @GeneratedValue(strategy = GenerationType.AUTO) @Column(name = "EMP_NO") private int EMP_NO;  @Column(name = "SALARY_VAL") private int SALARY_VA;  @Column(name = "ROLE_NAME") private String ROLE_NAME;  @Column(name = "EXPERIENCE") private int EXPERIENCE;  @Column(name = "LOCATION") private String LOCATION;  // Getters and Setters   Insights needed for the same.


Which types of particles are affected by the wave-particle duality?

If we take the double slit experiment as a way of demonstrating the wave-particle duality, which types of particles would show an interference pattern?  For example, I know that electrons show such a pattern. But do protons, too? What about atoms? Where is the boundary between "wavey particles" and "classical particles"?


Why is a continuous mapping from a compact metric space to another metric space is uniformly continuous? This theorem is from Rudin Real Analysis Page 202.


Is it true that one should not use NSLog() on production code?

I was told this a few times in this very site, but I wanted to make sure this is really the case.  I was expecting to be able to sprinkle NSLog function calls throughout my code, and that Xcode/gcc would automatically strip those calls out when building my Release/Distribution builds.  Should I avoid using this? If so, what alternatives are most common between experienced Objective-C programmers?


What does the dot mean at the end of `-rw-r--r--`? How do you set it with `chmod`?

Some of the files in my directories under Linux have a . at the end of the permissions listing.     What does the dot mean at the end of -rw-r--r--?  How do you set it with chmod?


I've not seen/read any female Orcs mentioned in the movies or in the books. In one of the movies, an Uruk-hai is momentarily shown emerging from a giant, grown-Orc sized flesh packet. So are they created with spells, or do they follow the Standard Reproductive Model.


lstlisting typesets incorrectly some special characters when used with fontspec

This document results in the ellipsis (triple dots) being typeset before the parenthesis. Why is this so? How can I avoid this behavior?  Note that I use the unicode Horizontal Ellipsis U+2026 character, not three dots.  \documentclass{minimal} \usepackage{fontspec} \usepackage{listings} \begin{document} \begin{lstlisting} (…) \end{lstlisting} \end{document}


How do you allow math-mode characters to be displayed in the PDF index?

I have a few greek characters and subscripts in some chapter titles.  When I use hyperref to create a PDF index, these math-mode characters are dropped from the titles in the index.  Is it possible to get any of these rendered properly in the document index?  Maybe this depends on the PDF viewer?  If it matters, I'm using evince.


Find the last two digits of $33^{100}$   By Euler's theorem, since $\gcd(33, 100)=1$, then $33^{\phi(100)}\equiv 1 \pmod{100}$. But $\phi(100)=\phi(5^2\times2^2)=40.$  So $33^{40}\equiv 1 \pmod{100}$ Then how to proceed?  With the suggestion of  @Lucian:  $33^2\equiv-11 \pmod{100}$ then $33^{100}\equiv(-11)^{50}\pmod{100}\equiv (10+1)^{50}\pmod{100}$  By using the binomial expansion, we have: $33^{100}\equiv (10^{50}+50\cdot 10^{49}+ \cdots + 50\cdot 10+1)\pmod{100}$ $\implies 33^{100}\equiv (50\cdot 10+1)\pmod{100}\equiv 01 \pmod{100}$


So I'd assume that dragons live for a long time — at the very least, around 500 years or so, and that's just me guessing off the top of my head. There is a very clear distinction in terms of attacks and stats, however, between "adult" dragons and "ancient" dragons.  When in its lifespan exactly does an adult dragon become classified as ancient? Is it when it's on the brink of death? Is it after a certain number of years? Is it once the dragon gains a certain amount of infamy, due to its terrible deeds or glorious renown? And does a dragon ever get so old that it's beyond ancient — as in, teeth falling out, dentures, bifocals, etc.?


If G be a cyclic group of prime order p, prove that every non identity element of G is a generator of the group.


How can I search for questions/answers of a deleted user (given their number)?

I'm on some (single) SX site, call it foo.stackexchange.com . There used to be a user named JoeUser, with number 1234. That user has left, deleting their account.  Their questions and answers don't disappear, but I do not seem to be able to search for them: https://foo.stackexchange.com/search?q=user%3A1234 doesn't work.  Can I effect this search somehow?


Prove $2^b-1$ does not divide $2^a + 1$ for $a,b>2$

I'm trying to prove $2^b-1$ does not divide $2^a + 1$ for $a,b>2$. Can someone give a hint in the right direction for this?


$[Solved]$ Find all units in the ring $M_2(\mathbb{Z})$

my problem here is:  Find all units in the ring $M_2(\mathbb{Z})$  I've done it before but now it's a matrix and I'm lost. First I think on the determinant because I saw some other wrote about it, but I'm not sure. Any help?   Thank you


Is there a native way provided by Unity to save an arbitrary desktop session, in order to restore it during next system start? By desktop session, I refer to all the applications currently running with their windows states regarding work spaces and such.  To make things clear, I do not want to just use any hibernate modes to switch off the computer. Nor do I want to add applications to the Autostart configuration, as this does not solve the issue of having your latest session restored.  While doing research, I found quite a few similiar questions, just like  . However, those threads are rather old or have no real solution provided. My concern is Ubuntu 14.04. default installation (thus, using Unity as a window manager). Your help is much appreciated.  Best regards Ron


I've been having this issue with Minecraft. Every time I try to launch it, the game sends me this error message:     Exception in thread "main" java.lang.UnsupportedClassVersionError: net/minecraft/client/main/Main : Unsupported major.minor version 52.0       at java.lang.ClassLoader.defineClass1(Native Method)       at java.lang.ClassLoader.defineClassCond(ClassLoader.java:637)       at java.lang.ClassLoader.defineClass(ClassLoader.java:621)       at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)       at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)       at java.net.URLClassLoader.access$000(URLClassLoader.java:58)       at java.net.URLClassLoader$1.run(URLClassLoader.java:197)       at java.security.AccessController.doPrivileged(Native Method)       at java.net.URLClassLoader.findClass(URLClassLoader.java:190)       at java.lang.ClassLoader.loadClass(ClassLoader.java:306)       at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)       at java.lang.ClassLoader.loadClass(ClassLoader.java:247)   I noticed the "unsupported" message in the first line and tried updating my system as well as installing the new Minecraft launcher. The new launcher just doesn't start up at all, so there's no way for me to start Minecraft.  If anyone needs to know, I am running Mac OS X 10.8.  Thanks a lot to anyone who can help me with this!


I accidentally ran sudo chown -R root:root /usr/ on my ubuntu machine (while playing around with sd-card of my Raspberry Pi. I actually wanted to type sudo chown -R root:root usr/ without slash.)  Now I get this error: sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set.  Is it possible to fix this?  EDIT: I had the wrong command in my post before. I forgot the root:root. Although all files in /usr are owned by root I get the error message.


when i type make   make[1]: Entering directory '/home/m7moudl3i/aircrack-ng-1.2-rc2/src' gcc -g -W -Wall -O3 -D_FILE_OFFSET_BITS=64 -D_REVISION=0  -DCONFIG_LIBNL30 -DCONFIG_LIBNL -I/usr/include/libnl3  -fstack-protector-strong -Wno-unused-but-set-variable -Wno-array-bounds -Iinclude   -c -o aircrack-ng.o aircrack-ng.c In file included from aircrack-ng.c:65:0: crypto.h:42:26: fatal error: openssl/hmac.h: No such file or directory  #include <openssl/hmac.h>                           ^ compilation terminated. <builtin>: recipe for target 'aircrack-ng.o' failed make[1]: *** [aircrack-ng.o] Error 1 make[1]: Leaving directory '/home/m7moudl3i/aircrack-ng-1.2-rc2/src' Makefile:25: recipe for target 'all' failed make: *** [all] Error 2


How to check if a program has exited in C#

I'm trying to create a small program which will display a message box if a certain program has been exited.


if a polynomial p(x) is divisible by 2 polynomials (x-a) and (x-b) is it necessary that p(x) will be divisible by (x-a)(x-b)?

I came across a question where we had to prove that a biquadratic polynomial $p(x)$ is divisible by a quadratic polynomial. In the solution, the quadratic polynomial was broken into 2 linear polynomials and by factor theorem it was shown that $p(x)$ is divisible by both the linear factors and hence it was concluded that $p(x)$ should be divisible by the quadratic polynomial.  I can't figure out why this is necessary? I tried to verify it for integers but it does not hold for integers, for example $12$ is divisible by $2$ and $12$ is divisible by $4$, but $12$ is not divisible by $4\times 2=8$. So why is it true for polynomials? Please guide me.


difference in defining functions : JavaScript

Do we have any difference between the two mentioned function declaration in JavaScript   //Declaration 1 var foo = function(){  // code goes here }   and   //Declaration 2 function foo(){  // same code here  }   When i tried to use foo's definition as a class to create other objects  var newObj = new foo();   The Declaration 2 worked but Declaration 1 did not allow me to create and object of this type


$f,g$ are entire function satisfies $|f|\le |g|$ what is the relation between them?  I did $h(z)={f\over g}$, Then $|h|\le 1$ so $h$ is bounded, entire(?) and so constant?  $h$ could possibly have poles at  which $g(z)=0$, :(  Thank you for help.


Weird php bug example! What is happening?

<?php  $var1 = 34;// Also for 444, 460 and others $var2 = 34;// Also for 444, 460 and others  $test = $var2/($var1/100);  var_dump($test); //float(100)   var_dump((int)$test); //int(99)  var_dump(number_format($test, 0, '','')); //"100"   This bug doesn't happen for every number, like 33, 35 etc.  What do you think?


Is it possible to skip the first line in a theorem environment?

I'm currently writing up some solutions, and I like to rewrite the problem before answering it.   I've set exercise to be a theorem environment, and the code I'm using is  \begin{exercise}  \begin{enumerate}  \item Show that $R$ is symmetric iff $R^{-1}\subseteq R$. \item Show that $R$ is transitive iff $R\circ R\subseteq R$. \end{enumerate} \begin{proof} \end{proof} \end{exercise}   However, when I build, the first item (a) appears immediately to the right of the Exercise heading, and the second item (b) appears below and indented:    I've tried using \newline and \linebreak, and even skipping a line before typing \begin{enumerate} after the \begin{exercise} command but those don't work. Is there a way to push (a) down below Exercise 3.32. so that it's lined up with (b)? Thank you.  As requested, my preamble is:  \documentclass[11pt]{article} \input{other/packages.tex} \input{other/theoremdef.tex}   where packages.tex is  \usepackage{amsthm} \usepackage{amsmath} \usepackage{amscd} \usepackage{url} \usepackage[top=1.3in, bottom=1.3in, left=1.3in, right=1.3in]{geometry}  % header and footer \pagestyle{headings}  \usepackage{amssymb} \usepackage{amsfonts} \usepackage{stackrel} \usepackage{mathrsfs} \usepackage{verbatim} \usepackage{enumerate} \usepackage{hyperref} \usepackage{xy} \input xy \xyoption{all}   And theoremdef.tex is:  \newtheorem{exercise}{\bf Exercise} \newcommand{\dom}{\text{dom}\ } \newcommand{\ran}{\text{ran}\ } \newcommand{\fld}{\text{fld}\ } \newcommand{\op}[2]{\langle #1,#2\rangle} \newcommand{\ot}[3]{\langle #1,#2,#3\rangle} \newcommand{\ms}[1]{\mathscr{#1}}


Set up an “alternative open with” hotkey in Windows 10

I have Windows 10. If I have highlighted a file and press "Enter", the file will be opened using the default program that I have chosen to open it.  I would like to be able to choose an alternative program to open these files if I press a different set of hotkeys, e.g., "Ctrl-Enter" or something.  For example, with my current setup, .txt files open with Notepad by default (i.e., if I press "Enter"), .html files open with Google Chrome by default, and .png files open with Windows Photo Viewer by default. I would like to be able to open .txt files and .html files with Notepad++, and to open .png files with Paint, if I highlight them and press something like "Ctrl-Enter".  Of course, I can already right-click and scroll to whatever program I want to open the files with, but since I do this very frequently, I want a faster, hot-key based approach.  Does anyone know of a way to set this up, either by something built into Windows or by some hack or other?  Thanks for any help.


Why when I change a drop shadow do all my drop shadows change?

It's always been a mystery for me while creating drop shadow effects that one layer changes the angle of its shadow automatically if I change the angle of the other.  For example: in Layer 1 I am setting the drop shadow angle as 0. In Layer 2 I want to set its angle to 90 degrees. As soon as I do this, the first layer changes its angle to 90 degrees.  Why is it dependent and how do I remove this link?


What computer hardware matters to a graphic designer?

I've had my MacBook Pro since 2007 and I'm starting to think about what the next system might look like. I'm not made of money, but if upgrading a component helps to make me a more efficient worker for 5+ years, that's worth something to me. Point being, I don't want to just max out every category; I want to be smart about it.  So, what bits of hardware matter the most to a designer? Is a dedicated graphics card overkill for a Creative Suite power user? If not, how fast should a GPU be to handle Photoshop and cutting-edge Web technologies? How much of a difference would four cores make over two when I run a script in Illustrator? Does the usage of design software mean that my system would need more RAM? Two small monitors or one big one?  I know storage space is a big deal, so straight solid state probably isn't viable...but having OS and Creative Suite on a smaller drive and throwing in a 1TB drive might work really well. That's the kind of thinking I'm trying to have.  Along the same lines, has anyone gone to the desktop to save some bucks and regretted it later? Can a desktop plus a tablet fill in well enough for a laptop?


The variable disappears at the end of the case

I have a problem because I do not know how to save the variable. The variable newname and the newpassword deafult are zero. But in case 1 they are changed to the given values, but after case 1 the variables return to the basic values 0. and i cant log in (in case 2) becasue login and password always are 0. How i can globally set this variable on case 1?      String newname = null;     String newpassword = null;       System.out.println("Hello!");     System.out.println();     System.out.println("     ****************************************");     System.out.println("     *                 MENU                 *");     System.out.println("     ****************************************");     System.out.println("     1. Create new account");     System.out.println("     2. Log in");     System.out.println("     3. Help");     System.out.println("     0. End");     Scanner opcje = new Scanner(System.in);     int choose = opcje.nextInt();      switch (choose) {          case 1:              System.out.println("You choose create new acount\n Enter the login");             Scanner nlogin = new Scanner(System.in);             newname = nlogin.nextLine();              System.out.println("Please enter the password ");             Scanner npassword = new Scanner(System.in);             newpassword = npassword.nextLine();             System.out.println("the account has been created\n");          case 2:              Scanner login = new Scanner(System.in);             System.out.println("Login:");             String pass1 = login.nextLine();             System.out.println("Password:");             Scanner password = new Scanner(System.in);             String pass2 = password.nextLine();             if (pass1 == newname & pass2 == newpassword){                 System.out.println("you are logged in");             }else{                 System.out.println("incorrect passoword or login");             }             break;          case 3:             System.out.println("Help is off");             break;          case 0:             System.out.println("ending");             break;          default:             System.out.println("Select the option by pressing 1,2,3 or 0");             break;     } }   }


Run Trigger As A Specific User (or Profile)?

Is this possible?  I'm not finding help, Google or otherwise, for this.  Situation:  A trigger runs and cycles through groups of Opportunities.  Some of these Opportunities are Closed Won, and most users of the system are not allowed to Edit Closed Wons (especially the Sales team).  But I need this trigger to be able to touch the Opps (it's fired when the User touches the Account and subsequently a group of Opps under that account gets touched).  It is a VALIDATION RULE blocking them.  Ultimately, I may investigate, if no other option, setting a HIDDEN FIELD on the Opp before updating, then clearing if after, and putting bypass code in the Validation rule.  This is a backup plan.  I'd like to know how to "Run As" a specific profile though.  Anyone have an example of this?  I have three profiles out of twelve that can touch Closed Wons...


I want to know if I should use may or  can for this sentence: **Can** I borrow your book **May** I borrow your book  I want to know which is more suitable in the context of politeness.


How are variables passed in php by default

I want to know how is value passed in php by default. Is it by reference or is it by value.  I did a search and found that some say it's value only and some say its reference by default. I understand its not a programming question but i need the answer for my recruitment interview.  Some say reference:        Some say Value:


Restrict the number of characters in UITextField

I've seen a lot of answers, but it seems that none of them has worked.  I have a programmatically created UIAlertView with two UITextFields. I want to restrict the number of characters :   12 characters in first field 1 character in second field   First field code:  alertDialog.addTextField { (nameField) in         nameField.placeholder = "Name"         nameField.borderStyle = .roundedRect         nameField.clearButtonMode = .whileEditing         }   And second  alertDialog.addTextField { (keyField) in         keyField.placeholder = "Key"         keyField.borderStyle = .roundedRect         keyField.clearButtonMode = .whileEditing      }   How can I correctly restrict the number (Let's pretend that there will be no paste in these field)


How to prove $1+\cos2\theta+\cos4\theta+\cos6\theta+\cos8\theta=\frac{(\cos4\theta)(\sin5\theta)}{\sin\theta} $?

I need help to prove that the following is true:   $$1+\cos2\theta+\cos4\theta+\cos6\theta+\cos8\theta=\frac{(\cos4\theta)(\sin5 \theta)}{\sin\theta}$$  I realize that I must evaluate the real part of this, but whatever I get I am not quite sure how to get to the required expression. I have multiplied the numerator and denominator of the result of the geometric sum by the conjugate of $ e^{2i\theta} $   and still have no luck. $$\sum_{i=0}^4 e^{2ni\theta}$$  (Apologies for poor formatting)


When working in tex files, I follow the rule     One sentence per line   because I think this gives the best diff sets using version control systems (usually mercurial or git) so that one can best see the changes of yourself and others to the file.  Anyway, many of my collaborators follow the rule     break lines after 80 characters   usually because their emacs or vi makes this best to read on screen (and because they are used to do so from the good old days).  I currently believe that, whichever editor people use, it should be possible to have lines displayed however people prefer without introducing newline characters in the source. In particular, one should not force collaborators to also stick to the personally preferred line length by using newline characters.  So my question is:     Are there good reasons for restricting lines to 80 characters when editing tex-files, and introducing newlines to not pass that limit?   This is clearly a soft question and I have not actually checked if this is appropriate to ask here. The reason I do so is that this problem occurs (for me) only when interacting with collaborators on tex files, so I consider it to be very specific to latex collaboration.


I want to lock objects from getting selected, but not change their visibility.  2.8 removed the lock button from the outliner. How do you lock objects in 2.8?


Show $\sin(\theta) + \sin(2\theta) + ... +\sin(n\theta) = \frac {\sin(n\theta/2)\sin((n+1)\theta/2)} {\sin(\theta/2)}$ using De Moivre's formula

Attempt at part b: $\sin(\theta)+\sin(2\theta)+... = \frac {(e^{i\theta}-e^{-i\theta})+(e^{2i\theta}-e^{-2i\theta})+...+(e^{ni\theta}-e^{-ni\theta})} {2i} \\ = \frac {(1+e^{i\theta}+(e^{i\theta})^2+...+(e^{i\theta})^n) - (1+e^{-i\theta}+(e^{-i\theta})^2+...+(e^{-i\theta})^n)} {2i} \\ = \frac {\frac{(e^{i\theta})^{n+1}-1} {e^{i\theta}-1} - \frac {(e^{-i\theta})^{n+1}-1} {e^{-i\theta}-1}} {2i} \\ = \frac {(e^{i\theta n} - e^{i\theta(n+1)} - e^{-i\theta} + 1) - (e^{-i\theta n} - e^{-i\theta(n+1)} - e^{i\theta} + 1)} {2i(e^{i\theta} - 1)(e^{-i\theta}-1)} \\  = \frac {\cos(n\theta)+i\sin(n\theta) - (\cos((n+1)\theta)+i\sin((n+1)\theta)) - (\cos(\theta) - i\sin(\theta)) -  (\cos(n\theta)-i\sin(n\theta) - (\cos((n+1)\theta)-i\sin((n+1)\theta)) - (\cos(\theta) + i\sin(\theta)))} {2i(1-(\cos(\theta) + i\sin(\theta)) - (\cos(\theta) - i\sin(\theta)) + 1)}  \\ = \frac {\sin(n\theta) - \sin((n+1)\theta) + \sin(\theta)} {2(1 - \cos(\theta))} $ \ What to do from here?