How many tupels $(a_1, \dots, a_n) \in \{0, \dots, c\}^n$ are there such that $\sum_i a_i = k$?

I'm currently stuck on the following problem: Given $c,n,k\in \mathbb{N}_0$, what is the amount of tupels $(a_1, \dots, a_n) \in \{0, \dots, c\}^n$ such that $\sum_{i=1}^{n} a_i = k$? More precisely, what is $$ z(n,c,k) := \left|\left\{(a_1, \dots, a_n) \in \{0, \dots, c\}^n \mid \sum_{i=1}^{n} a_i = k\right\}\right| $$  Now, the case $c\leq 1$ is easy: $$ z(n,0,k) = \begin{cases} 1 & \text{ if $n=0$ or k=0}\\ 0 & \text{ else}\end{cases} $$ and $$ z(n,1,k) = \binom{n}{k} $$ Also, if $c\geq k$ there is a rather easy solution: $$ \begin{eqnarray} &z(n,c,k)   &\\ & = & \left|\left\{(a_1, \dots, a_n) \in \{0, \dots, c\}^n \mid \sum_{i=1}^{n} a_i = k\right\}\right|\\ & = & \left|\left\{(a_1, \dots, a_n) \in \mathbb{N}_0^n \mid \sum_{i=1}^{n} a_i = k\right\}\right|\\ & = & \binom{n+k-1}{k} \end{eqnarray} $$ since for every $(a_1, \dots, a_n) \in \mathbb{N}_0^n$ with $\sum_{i=1}^{n} a_i = k$ we must also have $a_i \leq k \leq c$ for all $i$.  But I'm having difficulties finding a nice formula for the remainig case $1<c<k$. Here are some ideas:   By the above, we know that $$\binom{n}{k} \leq z(n,c,k) \leq \binom{n+k-1}{k}$$ We also know that $$ z(n,c,k) = \sum_{a=0}^c z(n-1,c,k-a) $$ by partitioning the set by possible values of $a_1$.


I want to run a script every time when I shutdown my computer. I know this is maybe a duplicate and I really read a lot of similar threads but either the answer isn't working anymore or I don't see how the answer is working.  I already figured out that apple wants me to use launchd. Most of the other solutions don't work anymore anyway.  So I found  but as far as I see launchd does everything when the system starts. I will copy the code below  <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Label</key><string>boot.shutdown.script.name</string>  <key>ProgramArguments</key> <array>   <string>SCRIPT_PATH/boot-shutdown.sh</string> </array>  <key>RunAtLoad</key> <true/>  <key>StandardOutPath</key> <string>LOG_PATH/boot-shutdown.log</string>  <key>StandardErrorPath</key> <string>LOG_PATH/boot-shutdown.err</string>  </dict> </plist>   and the script  #!/bin/bash function shutdown() {    # INSERT HERE THE COMMAND YOU WANT EXECUTE AT SHUTDOWN OR SERVICE UNLOAD    exit 0 }  function startup() {    # INSERT HERE THE COMMAND YOU WANT EXECUTE AT STARTUP OR SERVICE LOAD    tail -f /dev/null &   wait $! }  trap shutdown SIGTERM trap shutdown SIGKILL  startup;   Unfortunately there is no tutorial for launchd which include very basic explanation. So for example the arguments of the key brackets are more than just strings they trigger something but I can't find a list of which words trigger which action.  I would like to understand the basic idea of launchd. Especially which are the commands for running a script when the systems starts and when the systems shuts down.


content from pwd and which failed with sed to be replaced

I have a file which has the following content:  BWA='/software/bwa/bwa-0.7.12/bwa' SAMTOOLS='/software/samtools/samtools-1.3.1/samtools'   The above tools are on my computer:   which bwa => /work/waterhouse_team/miniconda2/envs/arima/bin/bwa and pwd/hic-fq => /scratch/waterhouse_team/benth/dbg2olc-40x/hic-fq   Next, I used those two sed commands:  sed -i.bak 's|/software/bwa/bwa-0.7.12/bwa|$(which bwa)|g' mapping_arima.sh sed -i.bak 's|/software/samtools/samtools-1.3.1/samtools|$(which samtools)|g' mapping_arima.sh   Unfortunately, as output I received:   BWA='$(which bwa)' IN_DIR='$(`pwd`)/hic-fq'   How do I have to change the sed commands to get:   BWA='/work/waterhouse_team/miniconda2/envs/arima/bin/bwa' and  IN_DIR=/scratch/waterhouse_team/benth/dbg2olc-40x/hic-fq   Thank you in advance


What is the C# Using block and why should I use it?

What is the purpose of the Using block in C#? How is it different from a local variable?


I was reading about primality test and at the  page it said that we just have to test the divisors of $n$ from $2$ to $\sqrt n$, but look at this number:  $$7551935939 = 35099 \cdot 215161$$  Since $\sqrt {7551935939} \approx 86901,875$ so basically I would only have to check the divisors from $2$ to $90000$, but one of the divisors ($215161$) is greater than $90000$.  Also, do you guys have some ideas to improme my primality test?


I've had this issue a couple of months ago too but then I could fix it by turning off an option at my WiFi settings.  Now the problem is back but it my previous solution doesn't work.  I own a Samsung Galaxy S5 and I've had it for about a year now. It runs on Android 4.4.2. At some point the battery started to die really fast, and I don't have a clue what the reason could be. When I check the battery usage, it says "Android-System" uses about 30-40% of my battery, but I don't have a clue where this service comes from or how to kill it.  Has anybody got a solution for this?


Why do the modular multiplicative inverse of an integer $a$ always exists when it is coprime with the modulus?

In other words how can we say that for coprime numbers $a$ and $m$, the Diophantine equation $ax-my=1$ is always solvable?   I would like to have some intuitive understanding too in addition to proof. Eg- if $a$ is one of the factors of $m$ then we are sure that the solution doesn't exists because for some $x=t$, $at$ becomes equal to $m$. So, it always lie in the residual class in which 0 is contained and hence can never belong to the one in which 1 is contained.


I'm stuck at the Steel Mill in Joker's Funland trying to beat the Joker, inmates and Titans.  I can't figure out how to beat the Titans.  I'm playing the Xbox 360. How do I beat them?


Can I publish parts of the Ph.D thesis as a paper in a journal?

I recently finished my PhD thesis which will be published as a book soon. Now I'm wondering if it's possible or allowed to submit parts to a journal?  Normally the process would be the other way round I think: Submitting papers and "gluing" them together for the thesis. I've read the guidelines of some journals which state "that the work described has not been published before" or that "Papers must present scientific results that are essentially new".


Doing a PhD in data science / machine learning after a PhD in civil engineering

I am about to finish my Ph.D. in civil engineering, I would finish it by the age of 28. I don't like my field that much and was pushed to pursue it from the beginning (at that time, was very confused and did not know what I want / I need and that is a huge problem in my personality, so my father pushed me to pursue it even though I did not like it at all !). (one could ask why did you pursue a PhD in a field you don't like; the answer is pretty simple; it was the only way to get out of a third-world country :D) seeing the big-fat salaries of data scientists/machine learning engineers around the world makes me jealous sometimes and makes me super unsatisfied with the work/research and the field I am pursuing. I am really considering getting some undergraduate courses once I finish my current Ph.D. and start applying for CS masters. I will try to apply for double grants also, don't know if my current Ph.D. could help get those grants which will make me financially comfortable pursuing research in other fields again. Also, I want to pursue a Ph.D. in machine learning cause I see the salaries are fatter for those dudes; I don't like academia and I don't like research and I really do hate teaching but I am used to doing a lot of things I don't like. What are your perspectives?


How to grep-inverse-match and exclude "before" and "after" lines

Consider a text file with the following entries:  aaa bbb ccc ddd eee fff ggg hhh iii   Given a pattern (e.g. fff), I would like to grep the file above to get in the output:  all_lines except (pattern_matching_lines  U (B lines_before) U (A lines_after))   For example, if B = 2 and A = 1, the output with pattern = fff should be:  aaa bbb ccc hhh iii   How can I do this with grep or other command line tools?    Note, when I try:  grep -v 'fff'  -A1 -B2 file.txt   I don't get what I want. I instead get:  aaa bbb ccc ddd eee fff -- -- fff ggg hhh iii


I am getting java.lang.NullPointerException when trying to checking if input is integer

I am getting java.lang.NullPointerException and don't know exactly what is causing it. I know it has something to do with my getInput method, but I don't which line or lines is causing the error. Any help would be appreciated.   public class Input {  private Scanner scan;  //Checks input is an integer and bigger than 1 public int getInput() {     String input = scan.next();     int number = 0;     boolean isNumber = true;      while(isNumber) {         try {             number = Integer.parseInt(input);             if(number >= 1) {                 isNumber = false;             }         } catch (NumberFormatException e) {             isNumber = true;             System.out.println("Error: please enter a whole number that is bigger than 1");             input = scan.next();         }     }      return number;  }   }  public class Main  { public static void main (String[] args) {      Input userInput = new Input();     System.out.println("\t" +"Collatz Conjecture");     System.out.println("Please enter a value: ");     int n;     n = userInput.getInput();      System.out.println("Your number is " + n);    } }


A set $X$ together with a binary relation $\leq$ such that for all $x,y,z\in X$,  $O1$. $x\leq x$  $O2$. $x\leq y$ and $y\leq x$ then $x=y$  $O3$. $x\leq y$ and $y\leq z$ then $x\leq z$  is called an ordered or sometimes a partially ordered.  An ordered $(X,\leq)$ is called a total order if for all $x,y\in X$, either $x\leq y$ or $y\leq x$.  Question: Show that total orders are maximal orders  My question: is there a typo in the question?  What is a maximal order? How can I prove the question, can you help? Thanks...


As title, how do you find the reminder of $2^{62}$ with 85?  Since (85,2) = 1, from FLT I know that $2^{84} \equiv 1 \mod(85)$, but after this I don't know how to proceed because 62 < 85 and I don't know how to use this theorem.


Searching for unanswered questions with two or more tags returns answered questions

I want to search for unanswered questions having two or more tags.   When searched with /unanswered/tagged/java+and+json, I get list of questions that already have answers.


How to know if an object has an attribute in Python

Is there a way in Python to determine if an object has some attribute?  For example:  >>> a = SomeClass() >>> a.someProperty = value >>> a.property Traceback (most recent call last):   File "<stdin>", line 1, in <module> AttributeError: SomeClass instance has no attribute 'property'   How can you tell if a has the attribute property before using it?


Creating a generic object based on a Type variable

I need to create a generic object based on a type that is stored in a database. How can I acheive this? The code below (which won't compile) explains what I mean:  string typeString = GetTypeFromDatabase(key); Type objectType = Type.GetType(typeString);  //This won't work, but you get the idea! MyObject<objectType> myobject = new MyObject<objectType>();   Is it possible to do this kind of thing?  Thanks


What is the appropriate command when one is thirsty?

If when I am hungry I can command someone to "feed me", what is the equivalent command when I am thirsty? For years I have joked with friends that it must be "quench me", however, I doubt that this is right.


Do ubuntu 16 will work on my laptop which has  4gb ram 64 bit processr 2 gb intel and nvidia graphics   I think that it won t' work on 4gb ram


Java NullPointerException in .containsKey

I'm very new to Java. Trying to access a field in the HashMap observationMap, and am told there is a NullPointerException when I check if the HashMap contains the key. In particular, in the getEventSpeed() method.  .containsKey() should return NULL, so not clear how this line causes issue for the if statement?   Thank you for your help  public class IsDrivingObservation {    private Map<String,String> observationMap;    public String getEventSpeed() {     if (observationMap.containsKey("eventSpeed")) {       return observationMap.get("eventSpeed");     }     return "foo";   }    public void setEventSpeed(String speed) {     observationMap.put("eventSpeed", speed);   }  }


Batch script Issue passing path as paramter with spaces

go.bat  @echo off  set url=D:\Download\Path with space inside  echo "%url%"  pause   output:  C:\Users\Admin\Desktop>go "D:\Download\Path with space inside" Premere un tasto per continuare . . .   if i pass the parameter like this:  C:\Users\Admin\Desktop>go D:\Download\Path with spaces inside  @echo off  set url=%~1  echo "%url%"  pause   the output is wrong: the path is incorrect  C:\Users\Admin\Desktop>go D:\Download\Path with space inside "D:\Download\Path"   any help please :D


Deriving statistics from original card games

I have drafted a game that uses a  with 52 cards, 4 suites (diamonds, clubs, hearts, spades), and no jokers.  I'm interested in profiling game play along a few axes:   How many turns are there in a typical game with different play strategies? If I change the winning condition from, say, getting all four queens to getting all four jacks, how much longer or shorter is play. This would make an actual difference in my game, but I'd like to quantify that difference. How frequently will players have matching ranks for the cards they play if I force them to play a random card from their deck versus selecting which card to play?   Besides those, I could think of other ways to tweak the game, and I want to know what effect that has without manually playing the game several times in real life.  It would be possible to get this information by using some ad-hoc scripting on my computer to calculate values for the specific cases I mention above. However, adding more measurements, could require changing or improving my model of the game which takes more work. What would be better is a suite of computer programs that would allow me to change rules and gather new statistics without, in general, needing to add additional instrumentation to the game engine. Does such a suite of programs already exist?  I have seen  which is similar to my own, but the poster requests statistics for a much more specific condition. I am looking for a general tool. I am hoping that the situation has changed since the original negative answer.


Order a list by a property name(string value)?

I have a list of objects. How can I order this list using property name?  string orderbyField = "Code"; List<object> l = FillList(); l = l.OrderBy(o => orderbyField);   Can I have an extension for this problem?


Proving an $m\times n$ matrix has left and right inverse

Let $A$ be and $m\times n$ matrix and $B$ be an $n\times m$ so that $AB=I_m$ and $BA=I_n$.  Need to show that $m=n$.  Now I thought I could just show that $AB=BA$.  The way I approached this problem is the following:  $$AABB=ABAB \Longrightarrow (BA)ABB=(BA)BAB$$ $$I_nABB=I_mBAB \Longrightarrow I_nAB(BA)=I_nBA(BA)$$ $$I_nABI_n=I_nBAI_n\Longrightarrow I_nABI_n=BA.$$  I have noticed several problems with this though specifically $AABB$ because $$AABB=A(AB)B=AI_mB$$ since $A$ is $m\times n$ and $I_m$ $m\times m$ they can not be multiplied similarly for $B$ $n\times m$. Also for $I_n$ times $A$ and $B$ times $I_n$.  I have also tried $BBAA=BABA$ and run into a similar problem.  Any help would be appreciated.


should AC ground (earth) and DC ground be connected?

I have a power supply (AC --> DC) powering an microcontroller and DC electric motors. I also have the same AC powering a speed controller, which feeds to an AC motor.   Should I be connecting the ground from the DC power supply, to the earth ground on the AC?  Thank you!


Use of possessive apostrophe in a list and order of words

I would like to know what Lucy, Mary and a third person  think - taking into account they might have different opinions. Would the following sentence be correct?  I would like to know Lucy's, Mary's and your thoughts on this issue.


Change wording of default thumbnail metabox

I want to change the wording in the Default thumbnail metabox to 'Set default thumbnail' instead of 'Set featured image'. How can I do this?


App Store asks for old Apple ID when installing updates

I got a MacBook that a colleague of mine had used previously. It runs OS X 10.10.2. I created a new administrator account for myself and turned off the "admin" flag on the old account.  I also entered my iCloud / Apple ID account, so that it syncs my calendars and contacts correctly, and even in the App Store, I am signed in with my correct account.  But when I try to install pending software updates (that is, OS X system updates!), the window that pops up has the the e-mail address of my colleague filled in and greyed out—and I can't change it.     Note that I'm signed in with a different (correct) account in the App Store. When I go to Featured and click Account on the right, it has my correct e-mail address filled in:    How do I make the App Store "forget" the old Apple ID?  I  where it just says "it's not possible", and that apps are glued to the original account the Mac was set up with, but that doesn't make a lot of sense, especially in a company where laptops may be handed over from one person to another.


Ubuntu not booting with a missing /sbin/init

Linux/Ubuntu noob here and my installation just choked with the /sbin/init error.  This is similar to this previous issue:   And this  describes the apparent solution.  I have a dual boot eepc 1001px, my partitions are a little different, fdisk -l gives me:  /dev/sda1 * ID=7 HPFS/NFFS /dev/sda2   ID=lb Hidden w95 FAT32 /dev/sda3   ID=5 Extended /dev/sda4   ID=ef EFI (FAT-12/16/32) /dev/sda5   ID=83 Linux   I'm using a bootable usb key with the netbook 10.10 version installed so I can get into Ubuntu that way for diagnostics.  I tried the sudo fsck /dev/sda5 as mentioned in the second link to attempt a repair however I get the following error:  fsck.ext4: Device or resource busy while trying to open /dev/sda5 Filesystem mounted or opened exclusively by another program?   And I've no idea what to do next :(


Ratio of random variables MGF? Please help.

If we know the moment generating functions (MGFs) of the random variables $X$ and $Y$ to be $M_X(s)$ and $M_Y(s)$, respectively. The MGF of the sum $X+Y$ will $M_X(s)\cdot M_Y(s)$. So what is the MGF of the ratio distribution $\frac XY$?


Blades of grass didn't turn out what I wanted

I was following a video on how to make your very own blades of grass and put it as a group then in the particles system.  I wanted this to be  that. I fallowed the steps but got this  I didnt miss anything. The only thing I did different was put it in a bigger plane that was subdivided! I dont get it!


Need to convert 1000 images in 5 seconds-- what are our options?

we're looking for a server architecture that will allow for converting 1000 large images in 5 seconds. As a test, we ran some benchmarks using a 16 core server, using GNU Parallel to run 1,000 image conversions.  ls -1 *.pdf | parallel --eta convert {} {.}.png   Each image takes around 1.0 seconds to convert, and with 16 cores running at 100% (monitored via htop), we were able to render all 1000 images in about 60 seconds.  We'd like to, someday (as budget allows), get this down to 5 seconds. We obviously need more servers working in a distributed environment-- we just don't know where to start.  What sort of server architecture, applications, tools, services, technologies, etc. would you suggest we look into?


My wife has been trying to can some foods using the canning techniques that she's familiar with from Romania, but with the American-style canning jars and lids that we get here. This involves packing the jar with the canned goods, filling the jar with boiled brine to near the top, and then manually closing the lid. The jars are not immersed in boiling water with their lids on, as is recommended by most American canning guides.   Is this technique safe? Why do American canning guides insist on boiling the jar after it's closed? Several of our jars, after cooling, have the lids popped out and slightly convex rather than concave. Is this a problem? What causes this?


Why "" not "two-elements Boolean algebra"? The number of elements (two) is plural, but the word "element" is singular. This looks like a discrepancy for me.


How do we get a expression for speed of light $\frac{1}{\sqrt{\mu\epsilon}}$ using Maxwell's equation?

I am a $12^{th}$ class student in India. I am quite new to these interesting concepts. And, I think I've learnt about electrostatics, magnetism, Maxwell's equations very thoroughly. But, my books doesn't convey satisfactory information about how $c$ is calculated. It just simply that: using Maxwell's equations, $c=\frac{1}{\sqrt{\mu\epsilon}}$.  Also, I've been reading many questions asked about light and photons on this site, stating even the electric wave and magnetic wave are out of phase (which sometimes seems obvious to me), but I lack systemetic resources to learn about them.  I just need some help like how the velocity was calculated or even some resources.  Probably, this part is more opinion based but can someone please also suggest some good resources to learn these things (free). I heavily rely on sites Khanacademy  [Clarification after two answers used the differential form of  Maxwell’s equations:]  The main problem is the equations taught to me are different which I find elsewhere:    thnx to @Elio Fabri


Assume two natural numbers $m,n$ are coprime such that $a^m b^m=b^m a^m$ and $a^n b^n=b^n a^n$. Then $G$ is an abelian group

Assume two natural numbers $m,n$ are coprime (this means $(m,n)=1$) such that for each $a ,b \in G$ we have $a^m b^m = b^m a^m$ and $a^n b^n = b^n a^n$. Then $G$ is an abelian group.


My MacBook Pro MacOS High Sierra 10.13.5 Beta (17F66a) shuts down very time I close my lap top


Add the word "Algorithm" before each entry in the List of Algorithms

I'm trying to add the word "Algorithm" before each entry in the List of Algorithms (because of unavoidable thesis guidelines).   I saw similar questions but the solutions listed there don't work for me. I'm not sure about reopening those questions, hence posting it separately. Apologize if that's not the right etiquette.     (I'm using "algorithm" package instead of "algorithm2e")   (not sure if solutions listed there require other packages as listed solutions don't work for me)  Current output:  List of Algorithms 1 Optimization . . . . . . . . 3   Desired output:  List of Algorithms Algorithm 1 Optimization . . . . . . . . 3   Here's a simplified code sample that illustrates the issue. Your help is much appreciated. Please let me know how to get desired behavior for this sample.  \documentclass[letter,10pt]{book}                                                                                \usepackage[utf8x]{inputenc}  \usepackage[breaklinks]{hyperref} \usepackage{algorithm} \usepackage{algorithmic}  \title{Sample book} \begin{document} \listofalgorithms  \chapter{Sample} % Outline \begin{algorithm}[!hbt]     \centering     \caption{Optimization}\label{alg:pso}     \begin{algorithmic}[1]         \STATE \textit{GenerateInitialPopulation}(pop)         \FOR {particle $ \leftarrow $ 1 \textit{to} numParticles}           \STATE \textit{Evaluate}(particle)         \ENDFOR     \end{algorithmic} \end{algorithm}  \end{document}


Which metric to use to evaluate highly imbalance classification model performance

I have to do classification model to predict the possibilities of person getting cancer based on certain attributes. The data is highly imbalanced. As per client requirement I have to report model performance based on any one of these 4 metrics AUC_Weighted normalized root mean square log loss Accuracy  Can you suggest me which one should I use?


I am preparing for Mathematics Olympiad , can any one suggest me some books to prepare for olympiad ? The topics that usually come up involve:    congruence modulo $n$,  inequalities , number system, elementary number theory, etc.   Please help me!  Thanks  Kushashwa


How is the Net Run Rate calculated in ICC World Twenty 20 events?

I have some doubts regarding net run rate in the ongoing ICC world twenty 20 2014 event.It takes a while to read so please don't hesitate and give me a solution regarding this.    My doubt is that in match 12 of world twenty 20 2014(In Group Stage Last Match on march 21 2014) () Wesley Barresi of Netherlands hit a six when the team score was 187 while chasing Ireland score of 189, That take Netherlands score to 193.  If that is the case in match 17 between India and West Indies in match of super10 group (in ICC world twenty 20 2014 on march 23 2014) () while Suresh Raina (India) hit a four when the team score was 129 while chasing West Indies score of 129,That takes India Only To 130. why Only One run is added to the score in this match(match 17 on march 23 2014) while 6 runs are added to the score in match 12 on march 21 2014.  I don't understand the strategy behind this.Because if India's Score is taken as 133 then India's net run rate as of now(24 march 2014) will be 0.442(Runs Scored For 264 in 38.1 overs ) But Now it is only 0.383(Runs Scored For 261 in 38.1 overs ).As the net run rate plays an important role in the tournaments like this i am not very happy with this.  As being an Indian Fan now a days I look a lot in to net run rate as it has eliminated India in many tournaments including last ICC world twenty 20 2012.  Is There Any One who can clarify my doubts regarding the net run rate as i want to be sure of what was happening?


What does the TRUNCATE do differently to drop?   I believe it deletes all the data in the table but keeps the table name in the database, where as DROP deletes all data and the table. Is this correct ?


Looking for candidate functions for a "flat top" bell-shaped curve

I am looking for some candidate functions to model some data that is somewhat bell shaped, but more flat at the top - something like this:    I was previously using two sigmoid functions, flipping one, and joining them in the middle, but this presents some mechanistic problems so I'd rather use just one function. A simple parabola doesn't work, neither does a normal curve - it needs to be somewhat flat on top.  I think dose-response curves tend to work well but I have had trouble finding the equations for ones that are symmetric about a central axis (go up then down).  I'm going to take a few candidate functions and find which is the best fit to my data using AICc in R.


Is it grammatical to say "My favorite food is apples"? If not, is there a similar language structure that begins with the words "My favorite food" that I could use to explain this? Perhaps it would be grammatical to say "My favorite foods are apples".   I do not want to use the word 'apple' in  the singular form, if possible. I want to use the word 'apples' in plural.   Thank you for reading.


Why appears .log.fls etc when using TeX in the Atom editor?

So when i press control+option+b, there will appear so many weird files. And my question is that what are the functions of these files? Should i delete these files?


If $G$ is a finite group and has at most one subgroup of an arbitrary order (of course, dividing order of $G$) could we deduce that $G$ is cyclic ?


Place $8$ pairwise non-attacking white rooks and black rooks on a $8\times8$ chess board. If one can swap rows and columns, is it possible for the black rooks to take the initial position of the white rooks and vice versa?  My attempt:  Let the rows be $a_1,a_2,...,a_8$ and columns $b_1,b_2,...,b_8$. If there are white rooks at ($a_i$,$b_j$) and ($a_j$,$b_a$) as well as black rooks at ($a_i$,$b_i$) and ($a_j$,$b_j$), then we can reduce it to a $2\times2$ and a $6\times6$.   I don't know what to do next. Any help appreciated.


So currently I have three functions on my beamer presentation which look like this:  Now somehow it looks kinda different as when I write on a normal document:  As you can see, the letters are written differenty and I don't know why. Here's the minimal Code of the beamer part (The first image): \documentclass[utf8]{beamer}  % ============= % Packages  % ============= \usepackage[ngerman]{babel} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc}                % west european chars \usepackage{amsmath, amsthm, amssymb}   % math symbols  \begin{document}  \begin{frame}     \frametitle{Test}     \begin{columns}         \column{0.33\textwidth}                 \begin{center}                     \begin{align*}                         f(x) = \frac{1}{x}                     \end{align*}                 \end{center}         \column{0.33\textwidth}                 \begin{center}                     \begin{align*}                         g(x) = \frac{2x + 1}{x + 3} +                         \frac{4x^{2} + 3x + 1}{(2x + 1)^{2}}                     \end{align*}                 \end{center}         \column{0.33\textwidth}                 \begin{center}                     \begin{align*}                         h(x) = \frac{2^{x} - 3^{x}}{2^{x} + 3^{x}}                     \end{align*}                 \end{center}     \end{columns} \end{frame} \end{document}  And if you need it, that's the code of the second image: \documentclass[a4paper, 12pt]{scrartcl}  % ============= % Packages  % ============= \usepackage[ngerman]{babel} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc}                % west european chars \usepackage{amsmath, amsthm, amssymb}   % math symbols  \begin{document} \begin{align*}     f(x) &= \frac{1}{x} \\     g(x) &= \frac{2x + 1}{x + 2} + \frac{4x^{2} + 3x + 1}{\left(2x +             1\right)^{2}} \\             h(x) &= \frac{2^{x} - 3^{x}}{2^{x} + 3^{x}} \end{align*} \end{document}  How can I get the font in my beamer presentation as from the normal document?


It was hinted in a  that PHP can not reverse Unicode strings.      As for Unicode, it works in PHP   because most apps process it as   binary. Yes, PHP is 8-bit clean. Try   the equivalent of this in PHP: perl   -Mutf8 -e 'print scalar reverse("ほげほげ")' You will get garbage,   not "げほげほ". – jrockway   And unfortunately it is correct that PHPs unicode support atm is at best "lacking". This will .   PHPs  does provide the basic functionality you need to deal with unicode, but it is inconsistent and does lack a lot of functions. One of these is a function to reverse a string.  I of course wanted to reverse this text for no other reason then to figure out if it was possible. And I made a function to accomplish this enormous complex task of reversing this Unicode text, so you can relax a bit longer until PHP6.  Test code:  $enc = 'UTF-8'; $text = "ほげほげ"; $defaultEnc = mb_internal_encoding();  echo "Showing results with encoding $defaultEnc.\n\n";  $revNormal = strrev($text); $revInt = mb_strrev($text); $revEnc = mb_strrev($text, $enc);  echo "Original text is: $text .\n"; echo "Normal strrev output: " . $revNormal . ".\n"; echo "mb_strrev without encoding output: $revInt.\n"; echo "mb_strrev with encoding $enc output: $revEnc.\n";  if (mb_internal_encoding($enc)) {     echo "\nSetting internal encoding to $enc from $defaultEnc.\n\n";      $revNormal = strrev($text);     $revInt = mb_strrev($text);     $revEnc = mb_strrev($text, $enc);      echo "Original text is: $text .\n";     echo "Normal strrev output: " . $revNormal . ".\n";     echo "mb_strrev without encoding output: $revInt.\n";     echo "mb_strrev with encoding $enc output: $revEnc.\n";  } else {     echo "\nCould not set internal encoding to $enc!\n"; }


Yes, I know there's a script for that. But I think it's useful enough to be inserted into the live chat for everyone.  The following keyboard shortcuts are incredibly useful:   CTRLUp and CTRLDown - For replying to messages (each Ctrl+Arrow should change the :[message ID] in the chat input. CTRLSpace - For retrying a failed message, or ESC to cancel it. There should also be a keyboard shortcut to edit a failed message as per the newest functionality (Maybe the Down key?)   Using a chat with only the keyboard is very useful, it will be especially appreciated on chats with a more technical nature.


How to read bash config when working with SSH remote sessions

I have a Node.js app which I want to deploy on my VM machine. Before starting the app, I want to set few commands which should be read before the app is started.  I placed those commands inside .bashrc just similar to what I have done on my local environment.  Sample Command in .bashrc  export TOY_DIR=~/work/git/toyPlayer export TOY_PLAYER_ENV=dev   Now, when I am running my app with node app.js. It is throwing me an error that environment not found. However this thing works perfectly on my localbox.  After some google search, I tried this command  tmux node app.js   It started node server fine but now I am not able to exit from tmux shell. I used CTRL+C to exit but it stopped the node server.  PS: I know I can do remote login to it and work. But I am trying to learn doing things with command line.   What is the best practice to achieve this ?  PPS: I do not want to detect if the shell is controlled from SSH. I want to export some variables before starting my Node app. These variables are environment variables which are read by a config.js present inside my app.  Here is an example, How am I using the environment variables.  var env = process.env['TOY_PLAYER_ENV']   My question is How to set these variables on my remote machine ?


Closed MacBook Pro keeps turning external display on/off

I hooked up my old 2012 retina MacBook Pro to an external 4k monitor via HDMI. It works fine while the lid is open, but as soon as I close it, various issues occur.   Monitor won't work or receive signal if I unplug MacBook from the charger (monitor has its own power supply). Every now and then, monitor will shut/disconnect for a short while and come back online. I checked HDMI connection and everything seems to be fine (new monitor, new cable). What I did notice is that this flickering sometimes happens alongside charger light going off, which I think is related to point #1 above.   Does this sound like a bust charger that is going on and off for short periods of time, or something more serious with my MacBook?  Mac is set to never go to sleep be it on charge or battery, so I don't think this is an issue either.  This also seems to be unrelated to the option Slightly dim the display while on battery power. Just unchecked it, restarted and I am still getting the same issue.


Let $A$ be an infinite set , and a set $B$. $\mid{B}\mid=\aleph_0 , A\cap{B}=\emptyset$. Prove $\mid{A} \cup B \mid\,=\,\mid{A} \mid$ .  What I thought to do is to take a set $C\subseteq A\, ,\, \mid{C} \mid=\aleph_0$ and define an invertible function $f : A\cup B \rightarrow A$ that sends every element in $A$ and not in $C$ to themselves , and sends the elements in $B\cup{C}$ somewhere (I can't think where). Maybe I should use the Axiom of Choice? $\,$Thanks.


Interesting twist to the classic Twin Astronaut paradox: the astronaut twin moves against Earth's orbit and waits hovering in space

The scenario is simple.  The astronaut twin takes off, and travels at 67,000 mph (0.0001c) relative to the Earth, in a direction directly "backwards" along the earth's orbital path.  She then hovers in place, using rocket thrusters to prevent her from falling towards the sun. Her velocity with respect to the sun and the "fixed" stars is zero. 1 year later, the Earth comes around and she rejoins her brother by powering her thrusters to acheive the same velocity as the Earth. The astronaut twin says that she will be older than her brother on Earth, because the Earth moved from her at 0.0001c.  She says her brother's clock will lose 0.16 seconds based on 1 year * $\sqrt{1-.0001^2}$.  The brother says no, you will be younger by that 0.16 seconds because he was still and his sister was moving at 0.0001c.    (Aside:  the impact of the lower gravity being so far from Earth works out to just 0.02 seconds, which both twins agree is extra aging for the sister.  The 0.16 seconds they disagree on has only to do with velocity.) The sister argues further that she was the still one.  Ask the sun and the stars.  The brother responds "But you are the one who accelerated!  That makes you the one with the slow clock." We start to agree with the brother, but then the sister floors us:  Well, let's say that we started both hovering in space side by side, still with respect to the sun and stars.  Then you lasso'd the Earth as it went by, and traveled around the sun on it.  By your reasoning, your clock would now be 0.16 seconds slow compared to mine because you accelerated.  But it would then be 0.32 seconds slow compared to the Earth's! How could your clock be running at a different speed than one that is in your same reference frame? Hah! The poor brother is forced to admit, that does present a problem to his theory that who accelerates is important. Can you help the brother out?  (Hint:  I think not.)


What are the ways to allow comments on user profile pages in Drupal 7? There is a profile content module, which unfortunately is not available for Drupal 7.


A doubt from Milnor's "Topology from a Differentiable Viewpoint".

This is a doubt from Milnor's "Topology from a Differentiable Viewpoint".     For a smooth $f:M\to N$, with $M$ compact, and a regular value $y\in N$, we define $n(f^{-1}(y))$ to be the number of points in $f^{-1}(y)$. It is easy to see that $n(f^{-1}(y))$ is finite. It can also be seen that $n(f^{-1}(y))$ is locally constant; i.e. there is a neighbourhood of $y$ such that for every point $y'$ in that neighbourhood, $n(f^{-1}(y'))=n(f^{-1}(y))$.   The proof for the statement in bold is the following:     Let $x_1,x_2,\dots,x_n$ be the points of $f^{-1}(y)$, and choose disjoint neighbourhoods $U_1,U_2,\dots,U_n$ of these points, which are mapped diffeomorphically into neighbourhoods $V_1,V_2,\dots,V_n$ of $y$. The required neighbourhood is $(V_1\cap V_2\cap\dots V_n)-f(M-U_1-U_2-\dots U_n)$.   I don't understand how $(V_1\cap V_2\cap\dots V_n)-f(M-U_1-U_2-\dots U_n)$ is open. I know that $(V_1\cap V_2\cap\dots V_n)$ is open. However, how can one prove that $f(M-U_1-U_2-\dots U_n)$ is closed? I can see this working if $f$ is surjective, but not otherwise.


Evolution of the (phenotypic) facial features of the indigenous people of (west/central) Africa

I am not even remotely an expert in this field; I just got curious, so help me.   First of all, let us remove all human sentimental attributes from this question (such as connotations of  or emotional reactions thereof) and ask it from a purely scientific point of view. The typical facial feature of a West/Central African person (the so-called ) exhibits a wide nose, a lack of nasal bridge projection (similar to many Asian noses) and a prognathous skull shape that resembles more closely to our ancestor Homo Heidelbergensis than many other indigenous phenotypes from other parts of the world do.  I agree that this claim sounds anecdotal, and is certainly not true of all Africans (for example, Ethiopians), but one cannot dismiss it simply on grounds of ethical policing. I cannot help but notice that many of my African friends remind me of our shared ancestry (with no disrespect meant whatsoever), as is clear from the photographs below, one of a supposed Homo Heidelbergensis and one of a random African Homo Sapiens of today.     My question is the following. What is the reason behind this seeming resemblance? Is this appearance an illusion and possibly a construct of a prejudiced mind, or does this have a valid scientific answer? For example, are most Africans closer to our ancestors than the rest of humanity is? How does evolution answer this question?  Thank you for your help.


Why am I getting a nullPointerException in Java?

The exception doesn't come up until I click on the startGame button.  I get the error saying Exception in thread "JavaFX Application Thread" java.lang.NullPointerException at helloworld.HelloWorld$3.handle(HelloWorld.java:123) I have no idea what that error means.  The error happens on the line players.add(new Player(0, "Amrit"));What am I doing wrong?  public String gameStatus = "Pending"; public ArrayList<Player> players;      startGame.addEventHandler(MouseEvent.MOUSE_CLICKED,          new EventHandler<MouseEvent>() {             @Override public void handle(MouseEvent e) {                  gameStatus = "Started";                 players.add(new Player(0, "Amrit"));                 players.add(new Player(1, "Tyler"));                 players.add(new Player(2, "Scott"));                 players.add(new Player(3, "Ryker"));                  while(gameStatus == "Started"){                      //Select first two settlements with one road extending from each                     for(int s = 0; s < 1; s++){                          for(int p = 0; p < players.size(); p++){                              Alert alert = new Alert(Alert.AlertType.CONFIRMATION);                             alert.setTitle(players.get(p).name);                             alert.setContentText(players.get(p).name + ", please select your first settlement and place a road next to it.");                          }                     }                      gameStatus = "Ended";                 }              }     });  }   Here is Player.java:  package helloworld;  import java.awt.Point; import java.util.ArrayList;  public class Player {      public int ID;     public String name;     public ArrayList<String> hand = new ArrayList<String>();     public int points;     public Point[] citiesBuilt;     public Point[] settlementsBuilt;     public int citiesAvail;     public int settlementsAvail;     public Point[] roadsBuilt;     public int roadsAvail;      Player(int id, String playerName){          ID = id;         name = playerName;      } }


Why do we use pseud-random numbers when we have access to truly random numbers easily?

Is there any reason except being able to reproduce the same sequence of numbers, for using pseudo-random number generators while there is easy access to truly random numbers such as the number of milliseconds of the clock, the fluctuation in electricity, and etc...? I heard that producing truly random sequence of numbers often takes more time and requires extra hardware, but the things I mentioned above shouldn't be like that. So what are the other reasons that pseudo random numbers are so popular?


grep a file, but show several surrounding lines?

I would like to grep for a string, but also show the preceding five lines and the following five lines as well as the matched line. How would I be able to do this?


I need a multimedia (specially video) player for Ubuntu 16.04 LTS (somewhat like pot-player/km player )


Upload image and insert markdown code (with url) to textarea

How can I upload an image without page refresh; just using input type="file" to server. I'm using PHP to upload the file. I also need to insert markdown code with a URL to the image, like this: ![Image.](/url/to/image.png) to end of a textarea.   How can I do this? Maybe using JS?  Thanks in advance


Error: invalid environment block. Press any key to continue...   The error message appears immediately after the boot screen on purple background. Ubuntu 12.04.1 LTS.


Is there any way to justify or derive the form of the Lorentz force from relativity theory?

Lorentz force is in this form: $$\vec{F}=q[\vec{E}+\vec{u}\times\vec{B}]$$ As we know, it is Lorentz-invariant. Is there any way to justify or derive its form from relativity theory?


Any surjective map between from [0,1] to R

I've been trying to figure out a surjective map from [0,1] to R but been unable to find one. I know that any such map cannot be continuous.


I just want to ask whether I can recover data from a windows partition after installing ubuntu over it? Thanks in advance.


Is it possible to update lubuntu 16.10 to 17.10

So im having an issue trying to upgrade my lubuntu version from 16.10 (yakkety) to 17.10 (artful).  I tried  do-release-upgrade  but this is what i get.  An upgrade from 'yakkety' to 'artful' is not supported with this tool.  Am i out of luck in ability to upgrade it?


Why can't I boot off another drive or change BIOS options after hibernating?

I  that many people running Windows are able to hibernate their computer, temporarily boot some other operating system, then shutdown that other OS and resume Windows right where they left off.  How do I make sure that the next computer I get has this ability?  Is there some way I can get my laptop to do that, or is my laptop simply incapable of doing that?  If this laptop is incapable of doing that, is there a name for "the kind of PC that has the ability to let me hibernate Windows, and boot some other OS, and then later resume Windows where I left off" to distinguish them from  "the kind of PC that won't let me do that" (such as my current laptop) ?  details  On some computers (such as my HP Pavilion dm1 laptop), after I tell Windows to hibernate and I wait for all the lights to go dark, after I press the power button, the computer boots up directly into windows without ever giving me the option to select some other boot disk or to change bios options.  I thought "hibernate" turned the computer completely off. I thought turning on a computer always gave the "press ESC for BIOS options" (or some similar message) every time it was turned on after being completely off. But that doesn't seem to be the case with some computers, such as my laptop.  (I can tell "hibernate" is different from "sleep". When I tell Windows to "sleep", the light on the power button blinks, and then when I press any key on the keyboard, it quickly wakes up directly into windows. When I tell Windows to "hibernate", all the lights go dark, and none of the keyboard buttons do anything except for the power button.)  Out of all the options "sleep", "hybrid sleep", "hibernate", and "shutdown", only when I tell Windows to "shutdown" do I later get the "press ESC for BIOS options" message the next time it starts up -- only then can I choose to boot this laptop off the flash drive with my other OS. All the other options boot directly into windows, completely bypassing the "press ESC for BIOS options" message.


Is frequently toggling airplane mode on/off harmful to iPad hardware?

I want to try to save my iPad batteries, so I turn on the airplane mode when I don't use the iPad during the day and at night. I could toggle airplane mode on/off for more than 12 times in a day.  Do you think it's worth it to put iPad into airplane mode when I don't use it during the day? and is frequently toggling ipad airplane mode on/off harmful to iPad hardware (shorten hardware life)?


I recently tried moving the location of windows's Index files from my C (SSD) drive to another regular drive with more space...  I went to the Advanced Options under Indexing Options and put the 'new' path there...  Everything seem to run well for a day or 2. But now search has stopped working. Even typing the name of a program into the start menu brings up nothing.  I checked the indexing options and now it shows me this :     The advanced options show me this :    I checked the services.msc and it shows that windows search is stopped. If I start the service , nothing happens.  I can't put a new location into the advanced indexing options as the 'select new' button is disabled, as are the 2 text fields...  The rebuild button does nothing either.  Running the troubleshooter tells me that the indexing service is turned off and should be turned on.   I tried checking the registry... under the directory HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Search I see that 'data directory' is set to C:\ProgramData\Microsoft\Search\Data\ (the default), as is 'defaultDataDirectory'.  So, any suggestions how I can restore windows indexing, preferably with the indexing files not on my C drive.  thanks!


I am a c++ beginner and I have a (probably simple) question. So far i have defined several variables:  double Start = 0; double End = 1; int Steps = 100;    I want to change these values to a value that I have stated in a text file "paramaters.txt":  x_start = 0 x_end = 10 num_steps = 100   So my c++ needs to read the file and change the double End from 1 to 10. Reading the file can be done with this function:  std::ifstream file("parameters.txt")   I want to define a variable of type std::string, called label. Then i want to read the ’label’ from the file. Using a group of ’if (label == ”value”)’ statements to determine if I'm dealing with the start, end of the number of steps. Within the if-statement, the value of 10 would stand for the end for example.   I hope that someone can help me.  Regards,


I can't install Photoshop CS6 or any version. Any time I run it with Wine , when I need to upen it it gives me a : "Photoshop needs to run on a windows 7 machine" .. something like that. PLEASE HELP. I am a designer. I changed to Ubuntu for beautifulness, if I would've know I maybe shouldn't change to it. Please help. I have a macbook, if this help (I installed Ubuntu over my MacOS)


For formal articles, should a displayed equation be followed by a punctuation to conform to the language grammar ?  For example:  The most well-known physics formula is      \[E=mc^2.\] %should I put a period here?  And if you expand      \[(x+y)^2,\] % should I put a comma here?   you will ...


I have a mac without a disc drive on it, I also have some CDA files on my computer that need to be interpreted into an audio format that is more compatible with modern music programs so that I'm actually able to use them     iTunes is an amazing program to do this with, but it's not letting me import the files into it.  I've tried:   Double-clicking on the files Right-clicking on the files and choosing iTunes to open them with Dragging and dropping the files into iTunes (Even though I was pretty sure that wouldn't work because of the way drag and drop works) Importing the CDA files into Audacity   Also, I'm having some trouble finding another converter online, and since I love the simple design of iTunes, I would much rather prefer to convert the files on there.


How to take FileZilla credentials from the software's interface?

Hi I use FileZilla to transfer files to the server via FTP.  I connected to FileZilla from my computer months ago. I entered the server address, port & administration password on to the startup window of the software & checked the "Always connect to this server" option ON. So, every time I start FileZilla, It connects to my server automatically & I never had to remember my credentials.  I know it's in the software itself..somewhere...like in a cache memory or something. I need to get those details. How can I take those credentials from the FileZilla client installed in my desktop pc.? Is it even possible?


When to use infinitive  and when to use present participle of a same word?  I like to play cricket. To play cricket is fun. I love playing cricket.


How to calculate a private key from public key on elliptic curve?

Provided, that you have to multiply a well known G by the private key to obtain the public key, why not keep adding G to itself until you reach the public key. The private key should be the number of times you've added the G to itself. Is it correct? And if so - why isn't it feasible?


Lets say I have a string...  mystr = "abcdefghij"   I want to split it so that it becomes a list in groups of two like so...  mylist = ['ab', 'cd', 'ef', 'gh', 'ij']   I know there is a list() method that will separate every character and a split() method that will split on a designated character, but I can't figure out how to split it into groups where there is no whitespace or special character to split on.   Am I just missing something within those two methods, or is there a different way to do this?


I know that with the case $$\int_0^{\infty}xe^{-ax}dx$$ You just substitute $u=ax$ and use the gamma function after so that it evaluates to $\frac{1}{a^2}$. However this clearly involves switching the bounds. So in this case, if $a$ were a positive imaginary number we would have our upper bound be $u=i\infty$. So I suppose my question is to show why $$\int_0^{\infty}xe^{-ax}dx$$ Obeys the equality to $\frac{1}{a^2}$ for complex $a$. $EDIT$ I know how to do Integration by parts and u substitution, that’s not the problem. The problem is what complex analysis backs up the fact that the integral obeys the identity $$\int_0^{\infty}xe^{-ax}dx = \frac{1}{a^2}$$ For some complex $a$.


Wouldn't Snape's Dark Mark have given Voldemort's return away?

In this question - , it is answered, (and accepted by everyone who commented ), that the intention of going over so elaborate a procedure to make Harry hold a portkey is to keep Voldemort's return to power a secret. But isn't there a simple way (maybe many more) that would give away his return ? Like the dark mark on Snape's arm? Wouldn't Snape tell Dumbledore right away when he sensed the summon to the graveyard? Mind you, Voldemort at that time thought Snape had "left him forever", so he didn't count on him keeping it a secret from Dumbledore. So, anybody got anything for this?


Should textbox labels be above or to the side of the textbox?

At a former employer, the interface guidelines strongly insisted that the labels for form elements are always above the element citing that    It's more natural to follow It's easier to translate since the sizing won't need to change.   However, I often see this violated by placing the label to the left (or to the right for right-to-left languages).   Which is the better general approach?


I have a long list of sections and subsections like so  \chapter{Thin Lenses} \section*{Aim} \section*{A. Types of Lenses} \subsection*{Prediction} \subsection*{Observation} \subsection*{Explanation} \section*{B. Image Formation} \subsection*{B1. The lens and the image and the object position} \subsection*{B2. Partial lens} \subsection*{B3. Eyeballing the image} \section*{C. Focal Length of a Converging Lens} \subsubsection*{Question 1} \subsection*{C1. Estimating the focal length: Eyeballing the image} \subsubsection*{Prediction} \subsubsection*{Observation} \subsubsection*{Explanation} \subsubsection*{Focal length estimation 1} \subsection*{C2. Estimating the focal length: Parallel rays} \subsubsection*{Prediction} \subsubsection*{Observation} \subsubsection*{Explanation} \subsubsection*{Focal length estimation 2} \subsubsection*{Question 2}   etc. which just run off the bottom of the first page and disappear. Why is this? It doesn't happen if I include some text in the sections.


I just downloaded the Text Fx addon because I wanted to make a digital speedometer in an animation. I downloaded the addon as instructed and selected install inside Blender preferences. It had a caution symbol and told me that I needed to update 20 Blender 2.8x. So I updated to the newest version and it still said I needed an update. So I uninstalled it and tried installing it from a new source. This time I was not given an error but nothing new was in my add objects tab to add the text and there should have been an extra tab for text editing. So it hadn't actually installed? I am incredibly confused.


how to number each line of a file on python

My task is to be able to generate a unique number for every input a user gives my program and save this number along with their input in a file I called customer_references. I want the file to present something like this :  Case number: 1 Issue: My issue is....  Case number: 2 Issue: My phone is...   Case number: 3 Issue: ...... (etc.)  And also need to be able to print the case number for the user to know on python. I tried using randint but this wasn't efficient enough as the case number has a chance of being repeated for a different user  This is my unfinished code :  def issue_details():      #prints aplogy message for not being able to find a solution     print("Sorry we were unable to provide a suitable solution")      #Takes further information on details of issue from the user     issue = input("Please explain your issue in as much detail so we can direct you to a technician: ")       #opens the file I created to store the customers details to append the issue into it.     customer_file = open("Customer_references.txt","a")      #inputs the issue into the text file     customer_file.write(issue)      #Here I need to generate the case number and add it to my file beside the users issue     #The case number must always be unique      print("Thank you for your cooperation. Contact us on 0844558888 and give the technician your reference number so we can try help you\n", "Your reference is: ",#case_number )     customer_file.close()


My .emacs.el file is not loading, how can I get it to load?

I've used emacs for years, and on a Windows system.  I downloaded emacs from  and unzipped it locally.  I copied my .emacs file into %USERPROFILE%\.emacs and started emacs.  My .emacs file was not loading.  I added   (debug)   As the first line of the .emacs.el file and the emacs debugger did not start so I know the file was not loaded.  I searched for other questions like this but didn't find this question asked.


Good books to learn Combinatorial Game Theory?

I am currently doing my IB Diploma and we are supposed to make an extended essay on a subject of our choice- and i chose math. my research question is- "how to derive a perfect strategy to always win at the game of Nim?" - it has already been done- i know- but they aren't expecting anything groundbeaking from us- we're 17 year olds. anyway i don't have much knowledge in CGT and i need to know which books could be suitable for my essay. obviously it should include the study of zero sum, two player determnistic games,etc. thanks for the help


Transit via uk with Italian Schengen visa

I am Eritrean traveling from Sudan to Italy. I have got a Schengen  visa to Italy, my question is, can I transit through UK without any other additional visa, mean with that Italian schengen visa only.


linux sorting of lists using the last parts using sort command

how do I sort lists like the one below using sort or any related commands?  12.ale.panal.sel.blr.teta.hf.ew.rr.lwq.ors.2018 34.ev.we.ars.lmn.2017 5.lam.bere.meto.belagn.hede.we.e.2020 54.arad.met.kal.sil.tek.br.yz.2005   I want to sort them according to the last word which is the year chronologically?  N.B basically something like sort -t. -k-1 although -1 is not allowed. Any command just to address the last part?


My private gmail account didnt recognize my password, answered all account recovery questions and it says it cannot recognize my account but i still have access to my email on my phone? I use this account for my business and need access. What can I do to get my account recovered?


My brother and I are trying to join each other's games in Minecraft Pocket Edition, but we can't.  We have got the same Internet, and can you please help me?


I have text lines like this  blahblah"word1"blahblah"word2"blahblah"word3"   I only want the text between the quotes and without the quotes.  I could do an awk and us the " as a separator.  And then get every second match.  However, is there any way I can just use awk (or another command) to return words between sets of quotes?  so I'd get back word1, word2, word3?  Thanks,


In Python 3, how do I print multiple expressions on the same line?

I am a beginner.  How do I print multiple expressions in Python 3 on the same line.  Here is some simple code I wrote for a class exercise in my beginner class:  temp = int (input ("What is the outside temperature? ")) if temp < 70:   print ("Wear a jacket ") else:   print ("No jacket is necessary ") print ("when you go outside.")   If I input 50 degrees, the output says:  "Wear a jacket when you go outside."   whereas I want it to read:  "Wear a jacket when you go outside."


Get current page URL hash variable to button in Javascript

I have this javascript code:  <script> var burl = location.search; </script>   It fetches variables after ? from my page url  which is = hash=37393 and it creates a button with this javascript code:   <script>       document.write('<input type="button" name="hash" value="' + burl + '" id="buttonjs" style="font-weight: normal; font-family:Verdana,sans-serif; font-sizes:15px;line-height:1.5; padding: 10px; margin: 10px; text-align: center; background: green; border: 1px solid #c0c0c0; color: white; font-weight: bold; border: 3px; width: 100%; box-shadow: 3px 3px 3px black; border-radius: 16px;"/>');       </script>   Is there any way i can make the code fetch only the hash variable from page url which is 37393 ?


Why is a "Span" generated in my HTML from .NET?

I'm currently looking through some of my "dynamically generated" HTML and noticed this:
<...  My C# looks like this: <asp:Label ID="newsLabel" runat="server" />  Is there any way to change the SPAN to a DIV? I'm getting some ugly XHTML Validation errors.


Creating Select Then Zoom Tool using ArcPy?

I have been trying to create a tool to make a simple select then zoom to selected but I've been running into some issues. I've been using the code from this original posting (). It seems like his solution was never solved.  Here is the code that I have:  import arcpy  mxd = arcpy.mapping.MapDocument("CURRENT") df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0] lyr = arcpy.mapping.ListLayers(mxd, "PARCELS", df)[0] arcpy.env.overwriteOutput = True arcpy.env.workspace = "C:/ArcMap/COGO_Template"  wrk = arcpy.env.workspace arcpy.AddMessage("Workspace added") FClass = arcpy.GetParameterAsText(0) Field = arcpy.GetParameterAsText(1) Feature = arcpy.GetParameterAsText(2)  FClassLayer = arcpy.MakeFeatureLayer_management(FClass, "FclassLayer")  where_clause = """{} = '{}'""".format(arcpy.AddFieldDelimiters(FClass, Field),                                       Feature)  # I have added extra pair of single quotes for selecting strings arcpy.AddMessage(where_clause) arcpy.SelectLayerByAttribute_management(FClassLayer, "NEW_SELECTION", where_clause) arcpy.CopyFeatures_management(FClass, "C:/ArcMap/COGO.gdb/SelectionSites") df.zoomToSelectedFeatures() arcpy.RefreshActiveView() arcpy.AddMessage("All done!")   My parameters are as follows:  InputFeatureClass = Data Type: Feature Class, Required, Input, No Multivalue, Default: Database Connections\Connection to gis.sde\PARCELS  InputField = Data Type: Field, Required, Input, No Multivalue, Obtained from Input Feature Class  InputValue = DataType: String, Required, No Multivalue  The tool runs fine and shows no errors but unfortunately no parcel is selected and it doesn't zoom. Something to note as well is it takes about 2 minutes to run.  When I manually select by attribute in the attribute table (select, select by attribute, put in the parcel number, click ok), then run the tool, it zooms to the layer


how to install flex and bison: error can not locate file

i tried to install flex and bison but i got this error : can not locate the file & also i use software center to do this but authenticate error occur.  i don't know which resource i should choose. when i run this command in terminal:  sudo apt-get update   this is the result:  Failed to fetch http://archive.canonical.com/dists/lucid/Release.gpg  Unable to connect to 127.0.0.1:8080:   My environment:  $ cat /etc/environment PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games" http_proxy="http://127.0.0.1:8080/" https_proxy="https://127.0.0.1:8080/" ftp_proxy="ftp://127.0.0.1:8080/" socks_proxy="socks://127.0.0.1:8080/"  $ /etc/apt/apt.conf Acquire::http::proxy "http://127.0.0.1:8080/"; Acquire::https::proxy "https://127.0.0.1:8080/"; Acquire::ftp::proxy "ftp://127.0.0.1:8080/"; Acquire::socks::proxy "socks://127.0.0.1:8080/";


Why no static methods in Interfaces, but static fields and inner classes OK? [pre-Java8]

There have been a few questions asked here about why you can't define static methods within interfaces, but none of them address a basic inconsistency: why can you define static fields and static inner types within an interface, but not static methods?  Static inner types perhaps aren't a fair comparison, since that's just syntactic sugar that generates a new class, but why fields but not methods?  An argument against static methods within interfaces is that it breaks the virtual table resolution strategy used by the JVM, but shouldn't that apply equally to static fields, i.e. the compiler can just inline it?  Consistency is what I desire, and Java should have either supported no statics of any form within an interface, or it should be consistent and allow them.


Closings and deletions can happen too quickly

I'm relatively new to Stack Overflow and already have experience with getting both a question and an answer deleted.  I understand why  was closed, but the closing happened too fast. The first time I looked at my question after posting it, it was already closed; I didn't get the chance to respond.  The deletion of  was done by mistake. The deleter wrote that I should have deleted the answer by myself to avoid bothering the moderators. That was offensive, IMO.  I suggest implementing a time period, e.g. one day, during which questions cannot be closed. That way, authors would have the chance to explain the causes of their answers.


Are there any good tools besides SeleniumRC that can fetch webpages including content post-painted by JavaScript?

One major shortcoming of curl is that more and more wepages are having their main piece of content painted by a JavaScript AJAX response that occurs after the initial HTTP response. curl never picks up on this post-painted content.   So to fetch these types of webpages from the command line, I've been reduced to writing scripts in Ruby that drive the SeleniumRC to fire up a Firefox instance and then return the source HTML after these AJAX calls have completed.  It would be much better to have a leaner command line solution for this type of problem.  Does anyone know of any?


Why does the compiler choose bool over string for implicit typecast of L""?

Having recently introduced an overload of a method the application started to fail. Finally tracking it down, the new method is being called where I did not expect it to be.  We had  setValue( const std::wstring& name, const std::wstring& value );  std::wstring avalue( func() ); setValue( L"string", avalue ); std::wstring bvalue( func2() ? L"true", L"false" ); setValue( L"bool", bvalue ); setValue( L"empty", L"" );   It was changed so that when a bool value is stored we use the same strings (internal data storage of strings)  setValue( const std::wstring& name, const std::wstring& value ); setValue( const std::wstring& name, const bool& value );  std::wstring avalue( func() ); setValue( L"string", avalue ); setValue( L"bool", func2() ); setValue( L"empty", L"" ); << --- this FAILS!?!   The problem with L"" is that it is implicitly casting and previously it was happy to be a std::wstring, but not it prefers to be a bool. The MSVC compiler does not complain, or raise warning, so I'm worried that even if I "fix" the setValue( L"empty", L"" ); to be  setValue( L"empty", std::wstring() );   somebody else may come later and simply use setValue( L"empty", L"" ); and have to track down this issue again.  We thought to use explicit on the method but it is not a valid keyword for this usage. Is there some way to get the compiler to complain about this, or otherwise prevent the issue?  Otherwise I'm thinking to change the name of the method which takes a bool to ensure it can't make an incorrect guess.


Showing that these two definitions of $\gcd(a,b)$ are equivalent

So far I have encountered with two definitions of the GCD of $a$ and $b$. The first definition is:  $\gcd(a,b)$ is an integer that has the following properties:  $d>0$  $d\mid a$ and $d\mid b$  any common divisor $u$ of $a$ and $b$ also divides $d$    The second definition I saw is:  The greatest common divisor of two integers $a$ and $b$ (not both zero) is the largest integer which divides both of them.  Can someone please show me the equivalence of these two definitions without using any theorems. thanks!


Sendng in Outlook 2013 fails with permission error

I recently started getting the following error message when I tried to send an email from a group distribution list:      You can't send a message on behalf of this user unless you have permission to do so. Please make sure you're sending on behalf of the correct sender, or request the necessary permission. If the problem continues, please contact your helpdesk.   I have been able to use the group email in the From: section for over three months with no issues. As far as I am aware, no changes have been made to our profiles or accounts.   How can I fix this?


How to redirect every request from user to local host

My question is how to trap traffic going to 202.20.20.20 (The website IP/any dynamic input of website) and redirect to 192.168.1.10


Why do similar matrices represent the same linear transformation?

I don’t understand the theorem:     $A$ and $B$ are similar if and only if they represent the same linear transformation.   I know one direction "If $A$ and $B$ represent the same linear transformation then they are similar", but why is the other direction also true?  (I did only basic linear algebra so could you please give an easy proof if possible! Or any intuitions for this theorem! Thank you!)


Can an oscillating ordinary stone produce an electromagnetic wave?

If an electron taken alone by oscillating produce an electromagnetic wave. Can a collection of atoms, i.e., in my case a stone produce an electromagnetic wave/ electromagnetic radiation if we oscillate it?   Any stone is composed of atoms. Any atoms is composed of electrons , protons and neutrons, so according to classical theory that any accelerating charge produces an electromagnetic wave then a stone can also produce one as it is oscillating the electric field produced by itself? Wouldn't it? Please help  How it is different from the existing question:  The previous question defines itself as electrically neutral. Here, I don't fully understand the idea behind the term electrically neutral. I agree in fact that the AMOUNT of positive charge is equal to the negative charge. But I don't understand how it stops from oscillating the electric field that itself produced.  The point is if this is true we should have this effect when Faraday experimented with a stone instead of a bar magnet or if I'm missing something in my understanding, please help.


For $ n \ge 1$ , $F_1=F_2=1$  for $n \ge 3$ ,$F_n=F_{n-1}+F_{n-2}$  prove that  $\gcd(F_{n+1},F_n)=1$  I'm trying to prove by induction  we prove that when $n=1$, the equation holds,  $\gcd(F_{1},F_1)=1$ next when $n=k$, suppose  $\gcd(F_{k+1},F_k)=1$ is true, we prove $P(k+1)$ is true using induction hypothesis.  We're trying to prove that $\gcd(F_{k+1+1},F_{k+1})=1$.  We know that $F_{k+2}=F_{k+1}+F_{k}$, does this mean   $\gcd(F_{k+1+1},F_{k+1})=F_k$?  or  $F_{k+2} =1. F_{k+1} +F_k$? or $F_{k+2} \equiv  1 \bmod F_{k+1}$?  then  $$\gcd(F_{k+1+1},F_{k+1})=\gcd(F_{k+1}+F_k,F_{k+1}) =\gcd(F_{k+1},F_{k+2}  \bmod F_{k+1})=\gcd(F_{k+1}+F_{k})=1$$  I'm not too sure about when $F_{k+2}=F_{k+1}+F_{k}$, is this have same meaning as  $\gcd(F_{k+1+1},F_{k+1})=F_k$? or  $F_{k+2} =1. F_{k+1} +F_k$.   Is there an alternative proof?


An equivalent condition for Normal spaces

Let $X$ be a normal space. By definition it is a $T_1$ space and any pair of disjoint closed sets can be separated by open sets in the sense that they have disjoint neighborhoods. What I want to prove is  $X$ is normal iff each nbd of a closed set contains the closure of some nbd of the set  To prove the first implication I took a closed set $A$ and nbd $U$ of $A$. Since $U'$ is closed and disjoint from $A$ there exist nbd $H_A$ of $A$ and nbd $H_{U'}$ of $U'$ such that they are disjoint. I feel that closure of $H_A$ is subset of $U$ but not able to prove it. For converse part, let $A$ and $B$ be closed disjoint sets in $X$. Then for any nbd $U_A$ and $U_B$ of $A$ and $B$ respectively there exist nbd $V_A$ and $V_B$ of $A$ and $B$ such that $$ A \subseteq V_A \subseteq \bar{V_A} \subseteq U_A $$ and $$ B \subseteq V_B \subseteq \bar{V_B} \subseteq U_B $$ If $U_A$ and $U_A$ are disjoint then we are done. If not how can I proceed further? Please suggest any alternative approach also if possible.


Hey,  trying to finish an assignment but having some trouble with it. I will show all my work. The topic is on wave/particle dualty, uncertainty principle (second year modern physics course).  So the question is:     Calculate the de Broglie wavelength of a 5.7 MeV α particle emitted from an atomic nucleus whose diameter is approximately $1.6 \times 10^{-14} m$.   So I know the de broglie wavelength is $\lambda = h / p$. But we dont know p in this case, however we do know the energy. So to relate energy and momentum I use the following formula:   $$ E^2 = p^2c^2+m^2c^4$$   using $m = 6.644 \times 10^{-27}$ and using $ E = 9.13\times 10^{-13}$ gives me a complex solution. (Check WolframAlpha)  Now I've tried leaving the energy in terms of eV and MeV and they give me real solutions however the answer is not correct.  The answer is 6.02 fentometers.  Anyone have any advice?


Revert back to Mavericks from Yosemite Public Beta

I have downloaded the Mavericks OS X Installation and found out it did not work. It gave me this message:     This copy of the "Install OS X" application is too old to be opened on this version of OS X.   I wanted to downloaded the public beta thinking it would be nice since I heard there was no problems. I ran into lots of performance problems on the way. I would like to go back to Mavericks.


How to read “E = (mc)²” so as not to mistake for “E = mc²”

According to one of the questions  on EL&U, “E = mc²” is read as     E equals M C squared.   How do we read “E = (mc)²” so that it is not mistaken for “E = mc²”?


Stop and disable windows service from command line

I've tried the top comment here  but when I restart the computer the service is back up and running again.  If I manually go into services.msc and change the Startup type to "Disabled", change the Service Status to "Stop" and then Click "Apply" and then "OK", after rebooting the computer it is still disabled.  This is the commands I am issuing  sc stop "igfxCUIService1.0.0.0" sc config "igfxCUIService1.0.0.0" start= disabled   And the following is the logging  SERVICE_NAME: igfxCUIService1.0.0.0      TYPE               : 10  WIN32_OWN_PROCESS       STATE              : 3  STOP_PENDING                              (STOPPABLE, NOT_PAUSABLE, IGNORES_SHUTDOWN)     WIN32_EXIT_CODE    : 0  (0x0)     SERVICE_EXIT_CODE  : 0  (0x0)     CHECKPOINT         : 0x0     WAIT_HINT          : 0x0 [SC] ChangeServiceConfig SUCCESS


What are SSD and HDD wear out / failure rates?

When it comes to how long SSD's and HDD's will last half of the people say it usually stays healthy for 3-5 years before they die, while the other half say "Even if you write 20 GB every day you can use it for a hundred years"  Who am I supposed to believe? They're completely opposites, it's almost as if one or the other is speaking fairy tales.  I recently bought a 2TB modern SSD and am worried if it'll fail three years from now, as I bought it based on price. I download 35GB a month on average (unless for some reason web browsing use should be included).


How do I format a number to a dollar amount in PHP


How do I access a field value for an entity (e.g. node) object?

node_load((int) $nid) loads a fully-populated node entity. $node->title->value gets the title, but how do I access field values in Drupal 8?


MATLAB error: Undefined function or method X for input arguments of type 'double'

I'm a new user of Matlab, can you please help: I have the following code in an .M file:  function f = divrat(w, C) S=sqrt(diag(diag(C))); s=diag(S); f=sqrt(w'*C*w)/(w'*s);   I have stored this file (divrat.M) in the normal Matlab path, and therefore I'm assuming that Matlab will read the function when it's starting and that this function therefore should be available to use.  However, when I type  >> divrat(w, C)   I get the following error     ??? Undefined function or method 'divrat' for input arguments of type 'double'.     What is the error message telling me to do, I can't see any error in the code or the function call?


How to find solutions of linear Diophantine ax + by = c?

I want to find a set of integer solutions of Diophantine equation: $ax + by = c$, and apparently $\gcd(a,b)|c$. Then by what formula can I use to find $x$ and $y$ ?   I tried to play around with it: $x = (c - by)/a$, hence $a|(c - by)$.     $a$, $c$ and $b$ are known. So to obtain integer solution for $a$, then $c - by = ak$, and I lost from here, because $y = (c - ak)/b$. I kept repeating this routine and could not find a way to get rid of it? Any hint?  Thanks, Chan


I have upgraded to Ubuntu 13.04 and I cannot use Unity. I have tried the proprietary driver, both from the official sources and from AMD's website. I have also tried using the open source x.org driver, and under no configuration does Unity start. Xubuntu and Lubuntu configurations start correctly on the same setup. This problem only existed in 12.10 after a kernel upgrade and was fixed by reinstalling the drivers. Reinstalling no longer fixes the problem.  I have also tried purging compiz and then reinstalling unity, and that did not solve the problem.  When I run   unity   I see no errors, but it stops at:  compiz (core) - Info: Starting plugin: session   No more output appears in the terminal. I am currently using the proprietary driver that you install through the update manager (which I accessed with Xubuntu).  So my question is; where can I begin to diagnose the source of this problem, or does anybody have a solution?


How to capture the words in the double quote to one line as out.txt  more input.txt  "OQ -63/ECC/UK/JDA/adRedprairie" "OQ -63/ECC/UK/JDA/adRedprairie.ear" "OQ- 63/ECC/UK/JDA/adRedprairie.xml" "OQ/CZ/Ecomphos/216_06/OM-S03" "OQ/CZ/Ecomphos/216_06/OM-S03.ear"     "OQ/CZ/Ecomphos/216_06/OM-S03.xml"  more out.txt  OQ -63/ECC/UK/JDA/adRedprairie OQ -63/ECC/UK/JDA/adRedprairie.ear Q-63/ECC/UK/JDA/adRedprairie.xml OQ/CZ/Ecomphos/216_06/OM-S03 OQ/CZ/Ecomphos/216_06/OM-S03.ear OQ/CZ/Ecomphos/216_06/OM-S03.xml


Nvidia GTX 1660 - which driver do I have to install

I have just ordered a GTX 1660 OC edition 6GB GDDR5 and I have Ubuntu 18.04 x64 with Cinnamon UI.  I would like to know which driver do you advise to install for that GPU?  E.g. do you think I should use mesa (e.g. )? I heard a lot of improvements was made for GTX 1660 from mesa 19.3.  I would like to avoid any tearing/lagging issue I have read online about NVIDIA + Ubuntu + Cinnamon.  Thanks


Can a relation be transitive when it is symmetric but not reflexive?

Pretty much what the title asks. But here's some context:  Suppose $X$ is finite and $R$ is a relation on $X$ that is not reflexive but it is symmetric. Also, suppose we can rule out $xRy$ and $yRz$ both occurring $\forall x,y,z\in X$ s.t. $x\neq y$ and $y\neq z$ and $x\neq z$. So we can rule out that $xRy$ and $yRz$ when $x,y,z$ are distinct. At this point, it seems that $R$ might be vacuously transitive. However, since $R$ is symmetric, $xRy$ and $yRx$ are both fine. But since $R$ is not reflexive, we cannot have $xRx$, which seems to be a violation of transitivity if $xRy$ and $yRx$. Is this a "legitimate" counter-example?


I was trying to make a check disk for my Drive C but it gave me a message that the disk will be checked in the next restart and this what really happened.  Where can I find the results or log of this check in my Windows 10?


How to solve TLS handshake failed error?

I was trying to install sublime text on my ubuntu 18.04. The method I tried to install Sublime Text is to follow this link  but it throws below error when I issue the apt update   Err:8 https://download.sublimetext.com apt/stable/ Release                        Could not handshake: An unexpected TLS packet was received. [IP: 136.17.0.7 83]   I don't think this related with proxy setup correct me if I'm wrong. I just checked with upgrade my git to latest. I added ppa and issued apt update and it installed latest version. So now my question is why this not work with Sublime Text?  Note: I'm using this machine behind corporate proxy and I will provide more information if you need anything. I searched online and end up nothing.


How can I close a terminal without killing its children (without running `screen` first)?

sometimes I run an app in the gnome-terminal, but then I suddenly have to restart gnome or something. I guess the answer to the question is also useful then I want to disconnect from SSH where something is happenning.  Gnome's terminal tree looks like this:  gnome-terminal     bash         some-boring-process   Can I 'detach' bash from gnome-terminal (or detach some-boring-process from bash and redirect its output somewhere)? If I just kill gnome-terminal, bash will be killed to will all its subprocesses


Asymptotic Equivalence of Another Recurrence:

So I have the following recurrence relation:  $$f(n) = f(n-1) + f(\lceil n/2\rceil)+ 1$$  I already know that:  If:  $$g(n) = g(n-1) + 1$$  $$g(n) = O(n)$$  If:  $$g(n) = g(\lceil n/2\rceil) + 1$$  $$g(n) = O(\log(n))$$  If:  $$g(n) = g(n-1) + g(\lceil n/2\rceil)$$  $$g(n) = O(nlog(n))$)  Thus can I definitely conclude that:  $$f(n) = O(n \log(n) * n * \log(n)) = O(n^2 \log(n)^2)$$


Are there any DSLRs which can charge the battery via USB?

My beloved Nikon D40 has an issue where the battery drains ridiculously fast. New OEM batteries and changers don't help, so I think I need to replace the body. Since almost all non-DSLR cameras out there can recharge the battery inside the camera via USB, I'm hoping to find a DSLR that can do the same. Still impossible?


Stop WhatsApp from being used on lost phone

I lost my Android phone, but my WhatsApp is still on. How I can stop someone who is using it?  I don't have the SIM with me. The people who found it is using my WhatsApp account. When they went online, I tried to talk but they did no reply.


Is it possible for a third party app to access macOS's clipboard content? I am asking in relation to copy & paste sensitive data such as passwords and sensitive file content.


Router cannot see the Ubuntu server VirtualBox on Windows 8

I have a Windows 8 os on my computer with a VirtualBox Ubuntu server 14.   Windows has access to the Internet and is visible on the router as an attached device 10.0.0.x. The Ubuntu server has access to the Internet but is not visible on the router, and when calling ifconfig I see: 10.0.2.15   Every time I restart the vm, it gets a different IP, and I would like it to be const.  Where do I start?  ===========================================================  So they have mark this as duplicate and I cannot answer with a solution, but here goes...  The main issue was the VirtualBox adding a default Network adapter of type NAT  I'm not sure what it the purpose of it, but once I've set the type to BridgeAdapter my VM got a proper DHCP from the router, and now I can config my router to set a static IP of the VM network card MAC address!  Only weird thing I had to figure out, is that my router does not show the VM MAC address on the attached devices list, instead it shows the REAL network card MAC address.   So don't get confused and use the MAC defined in the Network adapter in your VM settings!  Let me know if this helps you too.


so, if I am correct and there is not any real orientation in space such as, up,down, left, and right. And people agree that the universe is inflating or getting bigger. so if there is no orientation in space how can we be certain that the universe isn't expanding,... but moving through its own individual space and we are just along for the ride.


Is there a way to permanently disable notification popups in 20.04?

So the Ubuntu 20.04's notification settings changed its toggle label from "Notification Popups" to "Do Not Disturb". And in the previous versions I could permanently disable these popups with that toggle. But after upgrading to 20.04 from 19.10, I have to manually set it to Do Not Disturb on every boot. Is there a way to keep it disabled?


List a deleted tag synonym creator's ID number instead of "anon"

Over at the  page, I saw the synonym "tag-merge --> retag-request":  which was created by a deleted user - if their account wasn't deleted, it would have provided a hyperlink to their profile.  But instead of showing their user ID under the "Creator" list, which is normally shown in place of their username for a deleted account, it just shows "anon".  Why is this? My request:  Can we show the user's ID number in place of "anon" under the "Creator" list, as is done everywhere else for a deleted account?


As far as I know, the relativistic momentum of a particle is given by the equation: $$p=\frac{m_0v}{\sqrt{1-\frac{v^2}{c^2}}}$$ where $m_0$ is the mass of the particle and $v$ is the velocity of the particle.  But why does the number $\sqrt{1-\frac{v^2}{c^2}}$  appear? How can I derive it from the special theory of relativity?  I have not enrolled in University yet, and I couldn't find the proof for the equation above anywhere online.   But if I found the proof for the equation of time dilation $t=\frac{t_0}{\sqrt{1-\frac{v^2}{c^2}}}$ (which I did), can I prove the relativistic momentum equation above?  (Sorry for my English. If the question has been asked anywhere else, or if this question is inappropriate, please let me know. Any answers or comments will be appreciated)


Significant ANOVA interaction but non-significant pairwise comparisons

I ran a two-way ANOVA and got a significant interaction. I ran a Tukey.HSD() post-hoc test in R and no pairwise comparisons were significant. Is this an error on my part? My adviser insists that this is not possible. If it is possible, why does this happen?


Possibilities for a group $G$ that acts faithfully on a set of objects with two orbits?

A group $G$ acts faithfully on a set $X$ of 5 objects. The action has   two orbits: one of size 2, and one of size 3. What are the   possibilities for the group $G$?   I think I should apply the orbit-stabilizer theorem. I believe a main hint is the fact that this group has precisely two orbits but I'm not sure how to use that information. What's a good way to go about listing the possibilities for this group $G$?


How to make table caption left-aligned.  I tried \usepackage[singlelinecheck=off]{caption} but it did not work out. In other words it gives an error:   \DeclareFloatFont                       {tiny}{\tiny}% "scriptsize" is defined by floatrow, "t...       \documentclass[a4paper]{article}     \usepackage{graphicx}     \usepackage[cmex10]{amsmath}     \usepackage{mathtools}     \usepackage[usenames]{color}     \usepackage[table]{xcolor}     \usepackage[left=2cm, right=2cm]{geometry}     \usepackage{authblk}      \usepackage{floatrow}     \usepackage[labelsep=space]{caption}      \DeclareFloatFont{tiny}{\tiny}     \floatsetup[table]{font=footnotesize,capposition=top}      \linespread{1.6}     \renewenvironment{abstract}{%     \noindent\bfseries\abstractname:\normalfont}{}      \newcommand{\affilmark}[1]{\rlap{\textsuperscript{\itshape#1}}}      \begin{document}      \centerline{\LARGE Title}     \vspace*{3ex}     \begin{flushleft}\large     A.B \affilmark{a},\quad     A.D\affilmark{b}\\[2ex]     \normalsize\itshape     \textsuperscript{a}\,University of nowhere,\     \upshape Corresponding author's email: \texttt{A.D@ieee.org}     \end{flushleft}     \date{}      \begin{abstract}     abstract goes here     \end{abstract}       \section{Introduction}     some text goes here.      \begin{figure}[!t]     \includegraphics[width=0.4\textwidth, height=0.2\textwidth]     \ffigbox[\FBwidth]     \caption{Conventional  (a) ABCD. (b) EFGH.}     \label{ABCDEFGH}     \end{figure}      \begin{table}[!t]      \caption{performance of .}     \label{tableII}     \centering     \definecolor{latexbl}{RGB}{28,220,240}     \rowcolors{12}{black}{latexbl}      \begin{tabular}  {|m{0.8cm}|m{0.6cm}|m{1.35cm}|m{1.1cm}|m{1.5cm}|m{1.1cm}|m{1.4cm}|m{0.7cm}|m{1.75cm}|m{1.2cm}|m{0.5cm}|}     \hline     \center Ref. & A &  B& C & D& E& F &G &H&I &J\\     \hline     \end{tabular}     \begin{flushleft}     some explanation     \end{flushleft}     \end{table}     \end{document}   EDIT BY LOCKSTEP (moved from separate "answer"):  Here's a compilable example that doesn't show the problematic behaviour mentioned by you. Please use it as start-up aid to post a compilable example which does show the behaviour.  \documentclass{article}  \usepackage{floatrow} \usepackage[singlelinecheck=off]{caption}  \begin{document}   \begin{table} (Table content) \caption{A table} \end{table}  \end{document}


$f:\mathbb R \to \mathbb R$ is a differentiable function such that $f'(x)\le r<1 $ , does $f$ necessarily have a fixed point ?

Let $f:\mathbb R \to \mathbb R$ be a differentiable function . If $\exists r \in \mathbb R $ such that $|f'(x)|\le r<1 , \forall x \in \mathbb R$ then using Lagrange's theorem one can show $f$ is a Lipscitz contraction and then use Banach contraction principle to conclude $f$ has a unique fixed-point. My question is what happens if $f'(x)\le r<1 , \forall x \in \mathbb R$ ? Then does $f$ even have a fixed point ?


For $1 \leq m \leq n$ there is an element of order $q^m-1$ in $GL_n(\mathbb F_q).$

Let $GL_n(\mathbb F_q)$ be the General linear group over a finite field $\mathbb F_q$, where $q$ is any prime power. Then how can I show that for $1 \leq m \leq n$ there is an element of order $q^m-1$ in $GL_n(\mathbb F_q).$  I know that the maximal possible order of an element in $GL_n(\mathbb F_q)$ is $q^n-1,$ which follows from the fact that order of an invertible matrix in $GL_n(\mathbb F_q)$ is same as the order of the minimal polynomial, and order of an irreducible polynomial $f(X) \in \mathbb F_q[X]$ with $f(0) \neq 0$ and $\text {deg}(f)=m$ is same as the order of any (hence all) root of $f$ in $\mathbb F_{q^m}^{\times}.$   In this problem since $\mathbb F_{q^m}$ is not necessarily a subfield of $\mathbb F_{q^n}$ for $1 \leq m \leq n,$ I cannot prove it. I need some help. Thanks.


As is commonly known, English is quite notorious for having a writing system that is far removed from the actual way it is most commonly pronounced. I understand that there are important historical reasons dating back to the Norman invasions, and the influence of French in medieval English courts and elites.  My question is historical. Was there ever a movement or attempt at reforming the spelling system in order to bring it closer to phonetics?


I'm a first year undergrad maths student and I've come across this particular sequence, which I can't find a limit for.  $$\underbrace{\sqrt{10\sqrt{10\sqrt{10\sqrt{10\cdots}}}}}_{n \text{ times}}$$  I know this may be embarrassingly easy, but I can't think of a way to start. Can you share any hints?


Script to merge Video and subs then delete the existing files (non recursive)

I've been using mkvmerge to merge a video file and subtitles, I'm using the following command  mkvmerge -o output.mkv video.mp4 subtitles.srt   Which is working fine but as you can probably guess this is really slow operation   I've to open terminal in every one of those directories where movies are stored. Then I've to copy and paste the names of the files in the command Then I've to rename the output file Then delete the original files which I used   This is a lengthy process.     Ideal situation that I want.   I'll go into the folder which contains a movie file and a subtitle file with the same name. I select a movie file and and a subtitles file, right click and run a nautilus script on them. They get merged Original file gets deleted. Rename the merged file with the name of the orignal file with mkv extension      This doesn't need to be recursive, I don't want my HDD creating and deleting 100's of files at ones. Movie files and Subtitle files generally have the same name but some times have "_en" post fixed to subtitle files. If you have another approach of doing it I'm on board with that too.


Why does the moon appear bigger close to the horizon, rising or setting?

Possible Duplicate:          I made a little research about this and found this article  that states the explanation of the moon being bigger at the horizon  is still debated.   I found this which looks pretty 'big'  but however this kind of repetitive shots  show no decrease in the aparent moon radius.  What I am trying to understand is if it is a real illusion, if the atmosphere makes the image bigger or what other explanation could be possible and of course plausible.


Difference between sentences starting with "don't you...'' and "do(did) you..."

"Look, some buses are coming this way, don't you see them?" "Look, some buses are coming this way, did you see them?" What is the difference between them? Context: I was doing some translation from English to Chinese. As I compared my translated version with that in the answer key, they turned out to be quite different. At first, I thought the sentence “Look, some buses are coming this way, don't you see them?” meant something to the effect that "I saw the buses coming, so I thought you did, too". More, similar structures: "It's getting dark, don't you think it's going to rain?" (do you think...?) "Can't you see that our city is growing more prosperous?" (Can you see...?) Any answer would be appreciated...


Dangerous mix Fragments-Views in order to win a NPE

I am receiving a NPE in my main classe although I have referenced all the values.  My code starts with:  public class MainActivity extends AppCompatActivity     implements NavigationView.OnNavigationItemSelectedListener, AbsListView.OnScrollListener {   ExpandableListAdapter listAdapter; ExpandableListView expListView; List<String> listDataHeader; HashMap<String, List<String>> listDataChild;  ListView listview;   final ArrayList<String> finalbuilder = new ArrayList<String>();   String[] Supermarkets = {"a", "b", "c", "d", "e"};   @Override protected void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);     setContentView(R.layout.activity_main);     Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);     setSupportActionBar(toolbar);      RelativeLayout layout = (RelativeLayout) findViewById(R.id.secondlayout);     RelativeLayout layout2 = (RelativeLayout) findViewById(R.id.thirdlayout);      expListView = (ExpandableListView) findViewById(R.id.lvExp);     listAdapter = new ExpandableListAdapter(this, listDataHeader, listDataChild);  listview = (ListView) findViewById(R.id.listView);      ArrayAdapter<String> adapterlistview = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, android.R.id.text1, Supermarkets);     listview.setAdapter(adapterlistview);   and, by reading the stack trace, I see it all goes down to   expListView = (ExpandableListView) findViewById(R.id.lvExp);   RelativeLayout layout = (RelativeLayout) findViewById(R.id.secondlayout);   RelativeLayout layout2 = (RelativeLayout) findViewById(R.id.thirdlayout);   listAdapter = new ExpandableListAdapter(this, listDataHeader, listDataChild);   Now, all these Views are contained in a different layout which is "first_fragment" or "second_fragment" rather than the "activity_main" declared in the OnCreate method. This is because I created a Navigation Drawer and the ExpandableListView is contained in the first Fragment, both ListView and secondlayout lie in the second fragment and thirdlayout is placed in the third Fragment's layout. Moreover, I set no null in the codes.  So my guess is that I cannot initialise something that is placed in a different layout from the one initiated with the OnCreate method. Hence I am wondering: does the use of Fragments pose any threats when working from the MainActivity on Views embedded in further layouts?  If so:  Should I simply add @Nullable to the OnCreate?  Should I Implement the FirstFragment while defining the class at the beginning?  Should I add "new" when declaring the ExpandableListView and the other Views at the beginning?


Is it possible to overcome poor undergrad performance with a masters at a much lower ranked institution?

I have browsed extensively on academia.se and generally understand from similar questions (e.g. Doing bad in undergraduate but good in a masters program and How does the admissions process work for Ph.D. programs in the US, particularly for weak or borderline students?) that Ph.D. admissions committees care most about an applicant's most recent performance.  Is this still true even if the poor undergraduate grades were at a highly ranked university, and the good masters grades were at a much less competitive program?  I am interested in applying to top statistics PhD programs, but I have very poor undergraduate grades (2.8 GPA, 3.3 major GPA in math/stats) from a top 15 department. My grades in the masters program are good (>3.9 GPA), but at a state university that is not so highly ranked.  If the grades from the less competitive masters aren't enough to overcome the poor undergraduate grades, is the quality of my masters thesis likely to help me secure admissions to a top PhD program? What about a strong but not top 10-15? There are faculty doing high quality research here that may be able to supervise my thesis.  Edit:  This is not a duplicate of the linked question, while that question has great answers it does not specifically address my situation, namely I am working on a master's thesis and have a particular pattern of grades. Also difference between quality of undergrad and current institution.


Probability that the student can solve 5 of 7 problems on the exam

A student prepares for an exam by studying a list of 12 problems. She can solve 9 of them. For the exam, the instructor selects 7 problems at random from the 12 on the list given to the students. What is the probability that the student can solve 5 of the 7 problems on the exam?  I am really confused by this problem. My first initial thought was to do:  (5 chose 7)(7 chose 0)/ (12 chose 7)  I am not 100% sure about this though.


How come the AI makes like 3000 gold per turn on warlord?

I have 3 times as much in total score, but my GNP is much lower than that of two other civs. How is it possible to make that much money without having the largest population? I am in the renaissance era btw and one of the civs is aiming for a diplomatic victory. This is just ridiculous...