how to determine an integer in a string list

i have a problem if i have a string list   for example :  token=[aaa,bbb,ccc,ddd,0,eee,40,ggg,5]  how can i do to check whether token[i] is an integer  i want to see if token[i] is integer   i will put it in to a new string list by i+1:number  ex if token[4]=0 i will put it into result[5]="5:0"    sorry for explain not clear  first if i have many data  ex 39, State-gov, 77516, Bachelors, 13, Never-married, Adm-clerical, Not-in-family, White, Male, 2174, 0, 40, United-States, <=50K 50, Self-emp-not-inc, 83311, Bachelors, 13, Married-civ-spouse, Exec-managerial, Husband, White, Male, 0, 0, 13, United-States, <=50K  second i need to convert those data into specific number  ex State-gov into 2:1  Self-emp-not-inc into 2:2  however i can convert string into number but i cannot convert number into number ex if token[4]=0 i will put it into result[5]="5:0"  for line in lines:     token=re.split(', ',line)    for i in range(0,13,1):     try:         value = int(token[i])      except ValueError:         pass       if (token[14] in '<=50K.'):         result.append('1')     if (token[14] in '>50K.'):         result[j].append('2')     if (value == true):         result.append('i+1:token[i]')     if (token[i] in '?'):         result.append('i+1:0')     if(token[i] in 'State-gov'):         result.append("2:1")     if(token[i] in 'Self-emp-not-inc'):         result.append('2:2')


Story about school bully and victim transported to a magical land

This is a shortish (maybe novella-sized) story about two kids in school who get sent to the principal's office for fighting. Instead of entering the office, they are transported to some sort of magical land. They get some magical equipment, like a bowl in which food appears when the bearer needs to eat. There is speculation by the kids that earth technology (specifically, television was mentioned) wouldn't work in that world, symmetric to how we don't have magical food bowls in our world. The kids have to work together to defeat some sort of enemy. I recall they have two halves of a disc (shaped maybe like a yin and a yang) that they have to fuse together and use as a discus sort of weapon. Upon doing working together to do so, I think they also fuse together into one person who grows huge and is able to fight the monster (which I can't remember any details of). When they get back to our world, they find no time has passed and they're still in front of the principal's office door, but they no longer hate each other.  I remember reading this in seventh grade (1993).


Clearsigned file isn't valid in ubuntu xenial

I got a problem, when I tried to apt-get update it gives me these error. I don't know why, but I got my network properly work in other way. Please help fix it. I tried many methods of fixing it according to what I've searched but it never worked.   root@isaac-desktop:~# dpkg --configure -a root@isaac-desktop:~# apt-get update Get:1 http://ph.archive.ubuntu.com/ubuntu xenial InRelease [392 B] Get:2 http://ph.archive.ubuntu.com/ubuntu xenial-updates InRelease [392 B] Get:3 http://ph.archive.ubuntu.com/ubuntu xenial-backports InRelease [392 B] Get:4 http://security.ubuntu.com/ubuntu xenial-security InRelease [392 B] Err:1 http://ph.archive.ubuntu.com/ubuntu xenial InRelease   Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?) Err:2 http://ph.archive.ubuntu.com/ubuntu xenial-updates InRelease   Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?) Err:3 http://ph.archive.ubuntu.com/ubuntu xenial-backports InRelease   Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?) Err:4 http://security.ubuntu.com/ubuntu xenial-security InRelease   Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?) Fetched 2,059 B in 1s (1,863 B/s) Reading package lists... Done E: Failed to fetch http://ph.archive.ubuntu.com/ubuntu/dists/xenial/InRelease  Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?) E: Failed to fetch http://ph.archive.ubuntu.com/ubuntu/dists/xenial-updates/InRelease  Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?) E: Failed to fetch http://ph.archive.ubuntu.com/ubuntu/dists/xenial-backports/InRelease  Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?) E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/InRelease  Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?) E: Some index files failed to download. They have been ignored, or old ones used instead.


Why is the hard drive no longer called dev/sda?

I have a brand new laptop with a brand new install of Ubuntu 18.10 and I am very pleased with both the machine and the OS.   One thing, however is bothering me: Under gparted my main hard drive (an SSD actually) is labelled  /dev/nvme0n1p1 (the EFI partition) and /dev/nvme0n1p2 (the Ubuntu partition) rather than /dev/sda1 and /dev/sda2 in all of the other releases of Ubuntu I have used before. Also a mounted SD card is shown in gparted as /dev/mmcblk0p1 rather that /dev/sdb.  Why the new, hard to remember, labels?


I have no idea what I'm doing but recently received some files that were sent in a STL format that I need to open. I was told to use Blender to see these files but I'm not sure how to import them.


Does the alarm work when my phone is turned off?

Will the alarm still go off if I turn off the phone before?  Example: when I have low battery, I have to go to sleep and wake up at X o'clock, and there is no charger around. Should I turn off the phone?   Note: If it makes any difference my phone is Galaxy S running froyo


Why Electric field is same at every distance from the sheet inspite of inverse square law?

Please give intuition without Gauss Law.


Do we actually get more sick (flu/cold) during winter?

The word flu derives from the Italian phrase "influenza de freddo" meaning "influence of the cold".  Indeed it is that time of the year when my colleagues seem to have the flu/cold more often than not. I remember during university, winter lectures would be riddled with people coughing and sneezing - the so called "freshers flu"  Questions   Is there statistical evidence for this claim? If so, what are the causes/factors involved?   asks why our noses get runnier during cold whether, is this related?


New shower head not oriented correctly when tight

I am replacing a shower head. While the old shower head screws into the piping correctly, the new one, when screwed in to be tight, ends up being upside down. If I loosen the head so it is the right way up, it leaks a bit at the joint. What do I need in order to make it tight when it’s half a rotation less than it wants to be?


On the importance of the i.i.d. assumption in statistical learning

In statistical learning, implicitly or explicitly, one always assumes that the training set $\mathcal{D} = \{ \bf {X}, \bf{y} \}$ is composed of $N$ input/response tuples $({\bf{X}}_i,y_i)$ that are independently drawn from the same joint distribution $\mathbb{P}({\bf{X}},y)$ with  $$ p({\bf{X}},y) = p( y \vert {\bf{X}}) p({\bf{X}}) $$  and $p( y \vert {\bf{X}})$ the relationship we are trying to capture through a particular learning algorithm. Mathematically, this i.i.d. assumption writes:  \begin{gather} ({\bf{X}}_i,y_i) \sim \mathbb{P}({\bf{X}},y), \forall i=1,...,N \\ ({\bf{X}}_i,y_i) \text{ independent of } ({\bf{X}}_j,y_j), \forall i \ne j \in \{1,...,N\} \end{gather}  I think we can all agree that this assumption is rarely satisfied in practice, see this related  and the wise comments of @Glen_b and @Luca.  My question is therefore:      Where exactly does the i.i.d. assumption becomes critical in practice?    [Context]   I'm asking this because I can think of many situations where such a stringent assumption is not needed to train a certain model (e.g. linear regression methods), or at least one can work around the i.i.d. assumption and obtain robust results. Actually the results will usually stay the same, it is rather the inferences that one can draw that will change (e.g. heteroskedasticity and autocorrelation consistent HAC estimators in linear regression: the idea is to re-use the good old OLS regression weights but to adapt the finite-sample behaviour of the OLS estimator to account for the violation of the Gauss-Markov assumptions).   My guess is therefore that the i.i.d. assumption is required not to be able to train a particular learning algorithm, but rather to guarantee that techniques such as cross-validation can indeed be used to infer a reliable measure of the model's capability of generalising well, which is the only thing we are interested in at the end of the day in statistical learning because it shows that we can indeed learn from the data. Intuitively, I can indeed understand that using cross-validation on dependent data could be optimistically biased (as illustrated/explained in ).   For me i.i.d. has thus nothing to do with training a particular model but everything to do with that model's generalisability. This seems to agree with a paper I found by Huan Xu et al, see "Robustness and Generalizability for Markovian Samples" .   Would you agree with that?  [Example]   If this can help the discussion, consider the problem of using the LASSO algorithm to perform a smart selection amongst $P$ features given $N$ training samples $({\bf{X}}_i,y_i)$ with $\forall i=1,...,N$ $$ {\bf{X}}_i=[X_{i1},...,X_{iP}] $$ We can further assume that:   The inputs ${\bf{X}}_i$ are dependent hence leading to a violation of the i.i.d. assumption (e.g. for each feature $j=1,..,P$ we observe a $N$ point time series, hence introducing temporal auto-correlation) The conditional responses $y_i \vert {\bf{X}}_i$ are independent. We have $P \gg N$.    In what way(s) does the violation of the i.i.d. assumption can pose problem in that case assuming we plan to determine the LASSO penalisation coefficient $\lambda$ using a cross-validation approach (on the full data set) + use a nested cross-validation to get a feel for the generalisation error of this learning strategy (we can leave the discussion concerning the inherent pros/cons of the LASSO aside, except if it is useful).


I run a popular tech website, and for weeks my site has been under DDOS attacks. The attacks happen at random times, and often about 10 times per day. Usually the attacks only last a few minutes, then it stops.  When my site is under attack, it become unreachable. The load of the server does not go up, services like MySQL, Nginx & FPM are not affected. It seems to be a SYN attack or something similar.  I run CentOS 5.6 (64bit), on a powerful machine. I have tried to harden SYSCTL a bit already, my settings can be found below. Also, I have setup iptables to block all ports except the ones I need. That script can also be found below.  I know this question has been asked many times before by people, but are there any further tips someone can give me to fight off these attacks? It is really becoming very annoying.  I am open for trying anything.  SYSCTL SETTINGS  net.ipv4.ip_forward                         = 0 net.ipv4.conf.default.rp_filter             = 1 net.ipv4.conf.default.accept_source_route   = 0 kernel.sysrq                                = 1 kernel.core_uses_pid                        = 1 net.ipv4.tcp_syncookies                     = 1 kernel.msgmnb                               = 65536 kernel.msgmax                               = 65536 kernel.shmmax                               = 68719476736 kernel.shmall                               = 4294967296 net.ipv4.conf.all.send_redirects            = 0 net.ipv4.conf.default.send_redirects        = 0 net.ipv4.tcp_max_syn_backlog                = 2048 net.ipv4.icmp_echo_ignore_broadcasts        = 1 net.ipv4.conf.all.accept_source_route       = 0 net.ipv4.conf.all.accept_redirects          = 0 net.ipv4.conf.all.secure_redirects          = 0 net.ipv4.conf.all.log_martians              = 1 net.ipv4.conf.default.accept_redirects      = 0 net.ipv4.conf.default.secure_redirects      = 0 net.ipv4.icmp_echo_ignore_broadcasts        = 1 net.ipv4.icmp_ignore_bogus_error_responses  = 1 net.ipv4.conf.default.rp_filter             = 1 net.ipv4.tcp_timestamps                     = 0 net.ipv4.conf.all.rp_filter                 = 1 net.ipv4.conf.default.rp_filter             = 1 net.ipv4.conf.eth0.rp_filter                = 1 net.ipv4.conf.lo.rp_filter                  = 1   IPTABLES SETTINGS  *filter :INPUT DROP :FORWARD DROP :OUTPUT ACCEPT -A INPUT -i lo -j ACCEPT -A INPUT -p tcp -m tcp ! --tcp-flags FIN,SYN,RST,ACK SYN -m state --state NEW -j DROP -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT -A INPUT -p tcp -m tcp --dport 21 -m state --state NEW -j ACCEPT -A INPUT -p tcp --dport 22 --syn -m limit --limit 1/m --limit-burst 3 -j ACCEPT -A INPUT -p tcp --dport 22 --syn -j DROP -A INPUT -p tcp -m tcp --dport 22 -m state --state NEW -j ACCEPT -A INPUT -p tcp -m tcp --dport 80 -m state --state NEW -j ACCEPT -A INPUT -p tcp -m tcp --dport 443 -m state --state NEW -j ACCEPT -A INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT -A INPUT -p icmp -m icmp --icmp-type 11 -j ACCEPT -A OUTPUT -o lo -j ACCEPT COMMIT   MRTG graph of the last 24h. Spikes are attacks, and that is when the server becomes unreachable.


What is the proper, legal way to make a derivative video game?

I want to make a game derived from an existing game. That game is owned by a live company.  How do I go about contacting the rights owners correctly and negotiating for the rights to the content?


How can I upgrade the OS of my Samsung Galaxy Exhibit from Android 4.1 to 4.4 or higher?

How can I upgrade the OS of my Samsung Galaxy Exhibit (SGH-T599N) from Android 4.1 to 4.4 or higher?  I am trying to install  on my smartphone so that I can live stream videos on YouTube, but it's giving me this error message: "This app is incompatible with your device."   According to the app's Google Play homepage, which was updated last week, the app requires Android 4.4 or higher. I only have 4.1. :( So, I assumed it must be because of that (please correct me if this assumption might be wrong.) Also, when I press Software Update on my device, I get: "This device is up to date." Could it mean that I may never be able to update it anymore because it's too old?


java executing maven project outside IDE

i might have completely missundestood how maven works, but i have the following issue. i created an application with maven in netbeans. it runs in netbeans fine, but when i make Clean and Build it just compiles my source files, and the maven dependendencies are not in the jar file, so cannot run in command window.  this is my pom file. it has build section, the dependencies are in the classpath of mainfest.mf  <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.ibh</groupId> <artifactId>SafePassword</artifactId> <version>1.0-SNAPSHOT</version> <packaging>jar</packaging>  <build>     <plugins>         <plugin>             <groupId>org.apache.maven.plugins</groupId>             <artifactId>maven-jar-plugin</artifactId>             <version>2.4</version>             <configuration>                 <archive>                     <manifest>                         <addClasspath>true</addClasspath>                         <mainClass>com.ibh.safepassword.TestMain</mainClass>                     </manifest>                 </archive>                 <descriptorRefs>                   <descriptorRef>jar-with-dependencies</descriptorRef>                 </descriptorRefs>             </configuration>         </plugin>     </plugins> </build>  <dependencies>     <dependency>         <groupId>org.hibernate</groupId>         <artifactId>hibernate-entitymanager</artifactId>         <version>4.3.1.Final</version>     </dependency>     <dependency>         <groupId>org.hibernate.javax.persistence</groupId>         <artifactId>hibernate-jpa-2.1-api</artifactId>         <version>1.0.0.Final</version>     </dependency>     <dependency>         <groupId>com.h2database</groupId>         <artifactId>h2</artifactId>         <version>1.4.192</version>         <type>jar</type>     </dependency>     <dependency>         <groupId>org.hibernate</groupId>         <artifactId>hibernate-validator</artifactId>         <version>4.2.0.Final</version>         <type>jar</type>     </dependency>     <dependency>         <groupId>org.hibernate</groupId>         <artifactId>hibernate-validator-annotation-processor</artifactId>         <version>4.2.0.Final</version>         <type>jar</type>     </dependency> </dependencies> <properties>     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>     <maven.compiler.source>1.8</maven.compiler.source>     <maven.compiler.target>1.8</maven.compiler.target> </properties>     i came from c# world, thought maven is similar than NuGet which is playing the game only in DEV phase, but at compile time everything is there ...  what is missing? how to execute the jar file to have the other dependencies in place and so the app can run?  thanks for your hints!  EDIT  i don't agree that this question is fully duplicated to the one you're referring to. as i can read these many solutions maven is quite complicated, there is no ONE solution for every issue


let $f\in \mathbb{D}^* \rightarrow \mathbb{C} \backslash [0,\infty)$ be a holomorphic function ($\mathbb{D}^*=\{z\mid |z|<1 \}\backslash\{0\}$). Prove that $0$ is a removable singularity.   My try: I've tried to separate the problem into two cases and proving by contradiction: First I want to show that $0$ cannot be a pole, and then I'll show it cannot be an essential singularity. In the first case, there exist a holomorphic $\phi\in Hol(\mathbb{D})$ such that $f(z)=\frac{\phi(z)}{z^m}$. We notice that $g=\frac{1}{f}$ is a holomorphic function on the disk (0 is a removable singularity), however, I cannot get a contradiction... In the second case, I assume I should use Casorati-Weierstrass theorem, but again I cannot get a contradiction.  Also, I know that I can define a Logarithm branch Log(f(z)), but I'm not sure if it is necessary.  Thanks in advance.


How to avoid seeing GRUB menu after replacing windows 10 with Ubuntu (Ubuntu is the only OS installed)

I replaced Windows 10 with Ubuntu 16.04 (now Ubuntu is the only OS installed), but every time I turn on my laptop, I still have to choose which OS to use in GRUB. It's not automatically loading Ubuntu, although when I choose Ubuntu it works fine. Is there any way I can make it automatically load Ubuntu? My laptop uses UEFI.


Adding and Deleting rows in table using jquery

I have a button, #add, which when clicked adds a row into a table. The last cell of the newly inserted row has a delete icon which if clicked I would like to remove the row.  I believe I'm 95% of the way there but for when clicking the delete icon nothing happens? Would this be due to the DOM needing a refresh?  $(document).ready(function(){     $('#add').click(function() {         $('tbody').append("
test		1
");         $('#table').editableTableWidget();     });     $('#delete').click(function(){         $(this).closest('tr').remove();         console.log('click');     }) });


How to do Visualforce page with the same look & feel as salesforce1?

Hi i have develloped VF pages1.i have accesing in Saleforce1 Mobile App.But the VF UI is different with Mobile UI. How to change VF to Saleforce1 Mobile App UI


java.lang.NumberFormatException: null when retriving querystring

i develop ecomerce site in that user can get category wise product when on home page all product display then click on image then query string pass and the detail displayed but when in same description want when data is filter by category then following error comes java.lang.NumberFormatException: null  Product Bean      public String singledispp(int pid)         {            ProductTbl p=ad.searchproduct(pid);             product_id=p.getProductId();             return "/client/single.xhtml?faces-redirect=true&product_id="+product_id;          }                public String dispbycat(int cid)         {             CategoryTbl ct=(CategoryTbl)ad.searchcat(cid);          category_id=ct.getCategoryId();          return "/client/products.xhtml?faces-redirect=true&categoryId="+category_id;         }             public Collection<ProductTbl> getproductbyid()         {        Map<String,String> params =FacesContext.getCurrentInstance().                        getExternalContext().getRequestParameterMap();             String parameterOne = params.get("product_id");             int foo = Integer.parseInt(parameterOne);              return ad.getAllProductByProductid(foo);         }          public Collection<ProductTbl>getbycat()         {             Map<String,String> params =FacesContext.getCurrentInstance().                        getExternalContext().getRequestParameterMap();              String parameterOne = params.get("categoryId");               int foo = Integer.valueOf(parameterOne);              dispbycat(foo);              return  ad.getbycategoryid(foo);         }


When I read the new Star Trek comics (for the Kelvin timeline) I wondered only one thing: How canon are they? (in regards to the film-series)


How can the special characters { and } be written literally to an external file in LaTeX, without being balanced?  Obviously the following does not work:   \immediate\write\my@outfile{{}  \immediate\write\my@outfile{}}


I can't find my world file in Minecraft Java for a snapshot, how do I find the world file?

I want to share my snapshot world with my friends, but I can't find the file itself. Where is it so I can send it to them?


My chosen language is English (UK).    It keeps turning down from time to time.


Importing AutoCAD 2017 file into QGIS/Google Earth

I have a map available in specific coordinates (2D) in AutoCAD 2017.   How do I import it into QGIS 3.8.3/Google Earth for data analysis?


Where can I ask a question about a basic cell phone?

I have a (Verizon) basic (aka "dumb") cell phone, and I have a question about SMS capabilities. Is there a Stack Exchange site for my question?


Is there a way of leveling/compressing the sound system-wide?

As a Laptop user, I'm sure that a lot of people, even the ones using Netbooks would have already gone through this problem. Especially when listening to podcasts, and using it as an example, the sound might have loud moments and quiet moments, one person speaking loud and the other speaking very quiet in the same episode. Thereby, I always wanted the sound to be compressed system-wide, and I just noted the other day, that in Windows, some Realtek drivers already offer this function.  We have already a pulseaudio plugin for equalization system-wide, and although it still has problems like not letting us change its values and listen the change in real time, or cracking the sound while changing pulse volume, I do love it and use it. Now I'm just missing something to keep the sound around 0db (or near the volume level you're using) as a leveler plugin for pulseaudio.  Any suggestion?


I am very confused about the spamming on Stack Overflow in general.  Why? do users spam   What? does it even do for them besides create a bit of attention  Also what are we doing about this?   Also I've noticed trolling on Stack Overflow were users ask questions that seem legitimate but aren't I'm really just confused about why all this goes on and are we stopping it or anything!


Pascal triangle every single line became the same - python

this is my first question on Stackflow. I want to create a pascal triangle with height of 'n'. Here is my code:  nb = input('input lines: ') nb = int(nb) array = [([1]+[0]*(nb-1))]*nb for i in range(1, nb):     for j in range(1 ,nb):         array[i][j] = array[i-1][j-1] + array[i-1][j]   I want to get:  [1, 0, 0, 0, 0] [1, 1, 0, 0, 0] [1, 2, 1, 0, 0] [1, 3, 3, 1, 0] [1, 4, 6, 4, 1]   But the result is like this:  input lines: 5 [1, 4, 10, 20, 35] [1, 4, 10, 20, 35] [1, 4, 10, 20, 35] [1, 4, 10, 20, 35] [1, 4, 10, 20, 35]   I don't understand why every single line changed to the same. Especially I started the recursion from the second element in the second line.  Could someone explain the issue with my code. Thanks a lot


Why do we put the punctuation within the quotations?

So, I have a weird question: In dialogue, why do we put the end punctuation within the quotations?  Example:     "I like burgers," he said.   This doesn't seem logical to me, and I have been guilty of writing this way for a while, but I was talking to someone about it and realized that it doesn't make much sense. I assume it is purely conventional and arose from typographical reasons. However, what would be a logical excuse for it, or would there even be one?   In other situations of quotes, I never put the punctuation on the inside, unless it is a part of that material specifically. For example: I like the move "The Dark Knight”.  Would it be acceptable to write the top sentence as:       "I like burgers", he said.   I deal a lot with technical writing, so logic is something my mind needs.


I have a problem with where I am getting a NullPointerException on line 59 of my code.   The program's purpose is to prompt the user for the file location (which has the digits of PI). The program should then accept any number of digits (say k digits) via the Scanner class. Then, the program must read k digits of PI from the file. Using the Scanner class, the program should then obtain a number for 0-9 from a user and print the first and last position in which it appears and also the number of times it appears. Only digits after the decimal point are to be considered. The program should be able to accept 100,000 digits of PI.  The sample output of the code is below:  Give the location of the file: C:\Users\Joe\Desktop\pi.txt  Number of digits of PI to parse: 10  Give any number between 0-9: 1  1 appears 2 times First position in which appears: 1 Last position in which appears: 3   Any help would be much appreciated.  Below is my code:  import java.io.BufferedReader; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; import java.util.Scanner; import java.util.ArrayList;   public class Problem2 {     @SuppressWarnings("null")     public static void main(String[] args) throws Exception {     FileInputStream inputstream = null;     BufferedReader reader = null;      @SuppressWarnings("resource")     Scanner input = new Scanner(System.in);      try {         System.out.println("Give the location of the file (example: C:\\Users\\Joe\\Desktop\\pi.txt):");         String fileloc = input.nextLine();          inputstream = new FileInputStream(fileloc);         reader = new BufferedReader(new InputStreamReader(inputstream));         String stringinput;          System.out.println("Number of digits of PI to parse: ");         int parsenum = input.nextInt() + 2;         String[] stringarray = new String[parsenum];          while((stringinput = reader.readLine()) != null) {             stringinput = stringinput.substring(2, parsenum);              for(int i = 0; i < stringinput.length(); i++) {                 stringarray = stringinput.split("");             }         }          System.out.println("Give any number between 0-9: ");         String searchnum = input.next();          int count = 0;          for(int i = 1; i < parsenum - 1; i++) {             if(searchnum == stringarray[i]) {                 count++;             }             else count++;         }          System.out.println(searchnum + " appears " + count + " time(s)");          for(int i = 1; i < parsenum - 1; i++) {             System.out.print(stringarray[i]);         }          System.out.println();         System.out.println("First position in which " + searchnum + " appears: " + stringinput.indexOf(searchnum));         System.out.println("Second position in which " + searchnum + " appears: " + stringinput.lastIndexOf(searchnum));      }      catch (FileNotFoundException exception) {         System.err.println("File not found, please try again");         main(null);     }     catch (Exception e) {         System.err.println("Invalid input entered");         e.printStackTrace();         System.exit(0);     }     finally {         reader.close();     }  } }


Why aren't animals diverse in phenotype?

I am not comparing a cat with leopard.  I am just saying that we humans are all one type of creature and we are diverse (I am not saying we are class of mammals and phylum of etc and kingdom etc, because my religion doesn't believe in it).  So consider the class of cats they are one type of species so why aren't they diverse in phenotype like us?   Why do other animals, plants, unicellular organisms not have diversity in their phenotype and how they can recognize each other, like a bird always brings food to his offspring and it can't make mistake by giving it to other offspring of its own species?   So can I say they aren't diverse because of in their meiosis division their chromosomes don't cross over and random assort (alignment)?


Can't install Ubuntu 16.04 as a dual boot alongside Windows 10

I have a Lenovo Yoga 730-10 with Windows pre-installed, and have been trying to install Ubuntu 16.04 as dual boot. I have followed the steps from other tutorials, but can't seem to get it to work. The steps I've followed are:   Use Rufus to configure an Ubuntu 16.04 image onto a USB to boot it up and install Ubuntu Disable Fast Start Disable Hibernation Disable safe boot from the BIOS menu screen Disable page file Shrunk down the C: drive by 20 GB (to put Ubuntu on)   Whenever I boot from the USB and start the Ubuntu installation process, there's a screen that should appear that asks if I want to boot alongside Windows 10, erase the drive and start anew, or something else. But this screen doesn't appear, and all I get is the following screen:    As I understand, this is the screen where you choose the memory you wish to allocate to the different Ubuntu partitions. Which would be fine (I could figure it out) if there were anything there! It shows me no memory spaces to even try to create a partition. I don't see the 20 GB unallocated space, let alone anything at all.  What I wish to be able to do is get the Install Ubuntu alongside Windows 10 option to appear to make it easier. But if it's easier, at least get the 20 GB unallocated space to appear and make my own partitions for Ubuntu.  Here are some details that are relevant:   BIOS mode = UEFI When using Rufus to put the image file on the USB, there are two options I've played around with: partition scheme = (MRB/GPT) and file system = (NTFS/FAT32). Using file system = NTFS, I couldn't even boot Ubuntu from the USB. If file system = FAT32, I could boot Ubuntu from the USB ran into the error above, for both choices for partition scheme. I've read somewhere that I need to make the unallocated space into a logical partition so that the Ubuntu install can find the free space (can't seem to find the post where I read this).   I've tried using a third-party software called EaseUs. But whenever I try to create a partition using the 20 gb of unallocated space, the option to change the partition type is grayed out, and I am forced to make a primary partition. I've tried this too, but it didn't work. I've also tried using Window's disk partition manager. From the unallocated space I right-click and choose "New simple volume" and follow the steps there. This also doesn't work.  In a move of desperation, I even reset Windows 10 to its factory settings (while keeping the files). My school's computer repair store said this might help, but it hasn't.


How to find all the articles citing particular two?

It is quite easy given a single article to find all the articles citing it.  However, having two or more articles, how do I find all the articles simultaneously citing these?


Again this is repetitive question but i have not received correct answer for this.  I am flying to Hanoi via Singapore . I have First name Middle Name in my passport but only has First Name in my ticket booking,would that be an issue? Some are saying yes and some are saying no


Note: this post is different to , which just cites part from somewhere else, without any further analysis and thinking. Furthermore, none of the answers to that post answers my question - the situations where "will (going to) be doing" is more appropriate.   I will be participating in IELTS test next Tuesday afternoon.  In an online class, the teacher says the following at the beginning of the lesson.  I will be using NotePod (pointed out by red rectangle) to write relevant points we talk about today.   I guess "will be using" is more appropriate than "will use" there, right?  A  explains  This "tense" is used for reporting a scheduled activity with special focus on its timing— as if one is standing in the future and experiencing the flow of the time. The focus is on the temporary, ongoing, or repetitive nature of the activity.   I understand the grammar rules of those verb tenses and the difference between this group  I am going to drive home tomorrow.   I am going to be driving home tomorrow.  The former is just convey my activity in the near future while the latter probably makes an implication that "don't disturb me as I am driving in that time" However, in the following situations, I don't see the difference between 2 verb tenses.  Welcome back to this class. Today's lesson is for the IELTS students who are going to be taking the IELTS test. it's for everybody to be honest with you. this lesson is useful for anybody who needs to do some writing.   who are going to take the IELTS test ...


SQL Server 2012 memory consumption outside the buffer pool

I've got an instance of SQL Server 2012 SP2 Enterprise Edition consuming ~20GB of memory higher than the max. memory limit. The instance is limited to 65GB but the physical memory in use from the below query shows 86GB  SELECT (physical_memory_in_use_kb/1024)/1024 AS [PhysicalMemInUseGB] FROM sys.dm_os_process_memory; GO   The server is physical with 2 NUMA nodes. Is there a way that can I find out what is consuming the memory outside of the buffer pool (I'm assuming that is what's happening)?  Here's the output of DBCC MEMORYSTATUS:-    And here'e the set memory limit:-    Thanks in advance.  UPDATE:- I've run the query that Aaron suggested  SELECT TOP (20) * FROM sys.dm_os_memory_clerks ORDER BY pages_kb DESC   Here's the output:-    The SUM of pages_kb comes to ~60GB  UPDATE 2:- Full output of DBCC MEMORYSTATUS is here:-   UPDATE 3:- Output of Shanky's scripts in excel file here:-   UPDATE 4:- Screenshot of the output of:-  SELECT (physical_memory_in_use_kb/1024)/1024 AS [PhysicalMemInUseGB] FROM sys.dm_os_process_memory; GO     So this seems to indicate that SQL Server is using more than the 65GB set.


Conditions for quasi-concavity of a convex combination of quasi-concave functions

Suppose I have a set of quasi-concave functions $f_1(x), f_2 (x), \dots, f_N(x)$. I form a convex combination,  $$g(x) = \sum_i c_i f_i(x)$$  where the $c_i \ge 0$, $\sum_i c_i = 1$. Given a fixed set of quasi-concave functions $f_i(x)$, the convex combination $g(x)$ will be quasi-concave only for specific values of the coefficients $c_i$ (for example, if $c_1 = 1$, $c_i = 0, i \ne 1$). In general, are there necessary/sufficient conditions that must be satisfied by the $c_i$ (for a fixed set of functions $f_i$), such that $g(x)$ is quasi-concave?  Example: Here is a non-trivial example. If $N = 2$ and the $f_i$ are Gaussian densities, there are non-trivial conditions. See For example, if $N = 2$ and the $f_i$ are Gaussian densities, some  conditions can be given. See .  Note: This is different from . I know that the convex combination is not quasi-concave in general. My question is if one can state a set of conditions on the $c_i$ such that the combination is quasi-concave. A trivial condition is that only one of the $c_i$ is non-zero. Is there something more?


How to delete files and folders that cannot be deleted?

I have a backup copy of a previous Windows' Documents and Settings folder which only contains my original user and within 2 more directories: Favorites and Local Settings.  When I try to delete Local Settings I get this error:    When I try to delete Favorites, I get this error:    I ran this in a cmd shell:     attrib *.* -r -a -s -h /s   ...but it did not help, nor did it return any errors/warnings.  I used Unlocker v1.8.5 and LockHunter repeatedly at multiple levels to see if any files are in use, but both always say: No Files Locked.  Update #1:  I was able to rename the directory, which now gives me this warning before (trying to) delete:    If I press Yes (or Yes to All) then I get this error:    Update #2:  I let chkdsk /f run which required a reboot since it's on my primary system partition. During Stage 2 scanning, I received about 40 of these:     Deleting an index entry from index $0 of file 25.   ...followed by:     Deleting index entry cookies in index $I30 of file 37576.   ...but I still get the first error dialog above when trying to delete.  I ran chkdsk again, this time: chkdsk /f /r. Produced no messages. Same result when deleting.  Update #3:  Digging deeper, the 99 is the name of one of many directories located deep in here:     C:\Documents and Settings.OLD\User\Local Settings\Application Data\Microsoft\Messenger\address@hotmail.com\SharingMetadata\user@hotmail.com\DFSR\Staging\CS{D4E4AE55-B5E2-F03B-5189-6C4DA6E41788}\   Inside each of those directories were files with names such as:     2300-{C93D01AC-0739-4FD9-88C7-13D2F21A208E}-v2300-{C93D01AC-0739-4FD9-88C7-13D2F21A208E}-v2300-Downloaded.frx   I noticed that, unlike all the directories, I couldn't rename any of these files. I also noticed that the file + dir names were extremely long:  Original directory = 194 characters Filenames = 100+ characters Together the length exceeds the 255-char limit which is bad and would explain the error message I posted in Update #1.  Partial Solution:  Rename all directories until the total path length is less than 100. Afterwards I was able to rename the .frx files, not to mention delete everything inside the Local Settings directory.  This is only a partial solution because these (empty) directories are still not deleteable,      C:\1\2\Favorites\Wien\What To Do..   C:\1\2\Favorites\Photography\FIRE   Same error as above:    Here is what Explorer properties shows for both folders:    Update #4 (another partial solution):  Using harrymc's answer combined with thoroughly reading through this amazing MS-KB article which contains nearly everyone's idea and then some, inconspicuously titled: .  I was able to delete the 2nd folder C:\1\2\Favorites\Photography\FIRE - the problem being that there was an invisible trailing space at the end. I got lucky when I did an auto-complete whilst playing around with the del "\\?\<path>" command which he suggested.  NOTE: A normal del did NOT work, nor did deleting from explorer.  Now all that is left is the first directory C:\1\2\Favorites\Wien\What To Do.. (yes I tried endlessly with multiple combinations of the above solution ;)


a penny for your thoughts!  I always learnt that adverbs can only come before (i.e. premodify) adjectives and verbs, e.g.  adj: I am extremely happy  v: I really enjoy football  But I was thinking... in the sentence    The people at this party are mostly/mainly men,    the adverb is placed beside a noun: but that breaks my previously understood rule. Does that mean that the rule is wrong? Or is this grammatically incorrect, and I should say 'mostly male'?


Software update is failing at Chrome:  Reading package lists... Done W: GPG error: http://dl.google.com stable Release: The following signatures were invalid: BADSIG A040830F7FAC5991 Google, Inc. Linux Package Signing Key <linux-packages-keymaster@google.com>   I've tried deleting and re-installing the Google key:  sudo apt-key del A040830F7FAC5991 wget https://dl-ssl.google.com/linux/linux_signing_key.pub apt-key add linux_signing_key.pub    Anyone else having issues?


beamer: best way to span long enumerations on different frames

I have a question about beamer and enumerations. Which is the best way in beamer to split a long enumeration in such a way that each main point has its own frame?  I already found  but I was wondering about the possibility for a cleaner solution. There's also , but I would like to keep control of frame breaks.


I'd like to get a more compact case, such as as a .  However, that case is for mini-ITX mobos while I'm currently using a , and I don't have the courage to reinstall Windows and all my apps.  So I was wondering if I could just plug my current Windows 7 system disk onto the new mobo and expect Windows to resume working after downloading new drivers?  Thank you.


similar matrices have same eigenvalue... stuck

So $Ax=\lambda x$ where $A$ is the matrix, $\lambda$ and $x$ its eigenvalue and eigenvector resptectively.  Now I have another matrix similar to $A$ i.e. $B=TAT^{-1}$  I'll let a vector $y$ which is an eigenvector of $B$, i.e. $By=\mu y$ where $\mu$ is its ($B$'s) eigenvalue.  I have to now prove that  $By=\mu x$.  Some maths leads me to  $By = TAT^{-1}y$ but here I'm stuck.  answers wants me to assume $y=Tx$ which will essentially solve it but why/how is $y=Tx$?


Is there any way to check for what the contents of a box are? I see that there's a way to check if it's void, and what type of box it is, but can you check what's in it?  I'm working on a reflowing scheme for double column paragraphed footnotes, and my approach is to reflow the box every time a footnote is added. This has the side effect of reflowing the hyphens at the end of a hyphenated line. So I'm looking for a way to check if the \lastbox on a line is a hyphen, and remove it if it is.  An MWE could be produced if deemed necessary, but the direct question shouldn't need one.


What's the canonical way to check for type in Python?

What is the best way to check whether a given object is of a given type? How about checking whether the object inherits from a given type?  Let's say I have an object o. How do I check whether it's a str?


"function foo(bar) { }" versus "foo = function(bar) { }"

function foo(bar) {     // ... }   and  foo = function(bar) {     // ... };   What is the benefit of one versus the other?  The main benefit I see in the latter is not running into errors with a function name already being defined.  However, there may be other benefits or drawbacks that aren't obvious.  What are they (if any)?


I see that Stack Overflow is very Linux specific. Doesn't Unix & Linux and Ask Ubuntu cover much of the same ground? I see that Unix & Linux and Server Fault also cater to many Linux server questions. Similarly, Ask Ubuntu and Super User seems to contain most like questions.


How to display javascript console on Chrome (or a different browser)?

I want to quickly try some Javascript code on Android phone.   I cannot find how to open console or something similar on either Chrome or default browser. about:debug doesn't do anything, and I don't want "remote debugging".   I can download another app if necessary (but I don't want to root my device).


I installed Sublime Text 3 in Fedora 20 which has got GNOME, as I couldn't get it being called from terminal I created a .bash_aliases file which a line like this:  alias sublime='sublime_text'   And so also added the sublime_text file location to the PATH by editing .bashrc file adding:  export PATH=$PATH:/usr/local/share/applications/sublime-text-3/   However, when I want to edit any file for which I might get sudo privilege first I want to do:  sudo sublime sudoLikelyFile   or  sudo sublime_text sudoLikelyFile   However I'm getting:  sudo: sublime: command not found   How can I work around for this?


I would like to insert the below mathematical symbol, it looks like a big Delta but different. Is there command to obtain a similar shape?


Evaluate $\lim_{y\to 0} \dfrac {(x+y)\sec (x+y) - x\sec x}{y}$.  My Attempt: $$=\lim_{y\to 0} \dfrac {(x+y) \sec (x+y) - x\sec x}{y}$$ $$=\lim_{y\to 0} \dfrac {x\sec (x+y) + y\sec (x+y) - x\sec x}{y}$$ $$=\lim_{y\to 0} \dfrac {x(\sec (x+y) - \sec x) + y\sec (x+y)}{y}$$


Date transformation for KNN to get distance

I have data set with date features like 01/01/2019 and I would like to use KNN. However, I cannot find a good transformation for dates that has a meaningful distance result for the last feature.  For example:  f1 | 1 | 2 | 3 | 4 | 01/01/2019  f2 | 10 | 3 | 12 | 1 | 14/01/2019  Does anyone have any recommendations?


Is there any way to set a MacBook Pro to not sleep when you close the lid?

The most common use case I have for this is when I'm playing music over AirTunes, but don't want an open laptop laying around.   Or when I'm syncing or downloading something.  This isn't the same as ; I'm looking for a way to make it stay active with the lid closed.


Analyzing reflected and transformed variables II

I've searched past posts and have not seen an answer to this specifically, perhaps because it is assumed to be known so it was not stated in previous related posts.  I have a very simple single variable model with a negatively skewed dependent variable Y.  The residuals from Y = b0 + b1X are non-normal, which, by my understanding will violate regression assumptions and impact my residuals and hence inferences but should not affect the properties of unbiassedness or consistency of my estimate 'b1'.  (correct me where I am wrong)  To make correct inferences it seems the practice is to reflect and log the dependent variable as such Y* = ln(1 + max(Y) -Y) and run the following regression:  Y* = b0 + b1X.  If I am correct so far then my primary question is do we interpret b from the model above the same as a traditional log lin model:  i.e. if ln(Y) = b0 + b1x   Then b1 is interpreted as the b1*100% change in Y due to a 1 unit change in x. or exp(b1) = the change in the 'geometric' mean of Y due to a 1 unit change in x.   If this is correct, does the same interpretation apply in the reflected and transformed case?   Thank you.


How can I make my program available as native image available via apt-get?

I have a github project which can be compiled to native image. How can I make it available for people to install it via apt-get? I am okay with uploading just the native image to a central repository as well because this project mostly won't have any updates.


How do I uniquely identify computers visiting my web site?

I need to figure out a way uniquely identify each computer which visits the web site I am creating. Does anybody have any advice on how to achieve this? Because i want the solution to work on all machines and all browsers (within reason) I am trying to create a solution using javascript. Cookies will not do. I need the ability to basically create a guid which is unique to a computer and repeatable, assuming no hardware changes have happened to the computer. Directions i am thinking of are getting the MAC of the network card and other information of this nature which will id the machine visiting the web site.


Proving convergence of series with comparison test.

Let $S_n = a_1 + \ldots + a_n$ where $a_n > 0$ for all $n$. I'm trying to prove that $\sum_{n=1}^\infty a_n$ converges if and only if $\sum_{n=1}^\infty \frac{a_n}{S_n}$ converges using a comparison test.  I succeeded for the if part: If $\sum_{n=1}^\infty a_n = \lim_{n \to \infty}S_n = S$ then $S> 0$ and $S_n > S/2$ for all $n > n_0$ and $a_n/S_n < (2/S)a_n$. By comparison test it holds that $\sum_{n=1}^\infty \frac{a_n}{S_n}$ converges.  For the only if part I am having problems. Assuming $\sum_{n=1}^\infty \frac{a_n}{S_n}$ converges I don't know that $a_n < a_n/S_n$ because there is no restriction that $S_n > 1$. The limit comparison test fails because I don't know that $a_n/(a_n/S_n) = S_n$ converges yet either. Any help is appreciated.


I wrote some code that sets a marker on a current location when clicked. Unfortunately, the entire application crashes when no current location is given and the button is clicked. The error states:  java.lang.NullPointerException: Attempt to invoke virtual method 'double java.lang.Double.doubleValue()' on a null object reference  Is there a way implement a try catch exemption within the button?  Here is the on click instruction for the button:      markerBtn.setOnClickListener(new View.OnClickListener() {         @Override         public void onClick(View view) {               LatLng myCurrentLocation = new LatLng(myCurrentLatitude, myCurrentLongitude);             marker = mMap.addMarker(new MarkerOptions().position(myLocation).title("New Marker"));             markerBtn.setTag("yo");          }     });


How to use multiple SE accounts with the new login system easily?

There are SE sites which I want to use without being identifiable my main account. Thus, I have a secondary SE account, too.  (To prevent temptations ;-), currently there is no SE site for which I would be registered with both of them.)  Earlier it was very simple: simply I was logged in into the different SE sites with my different accounts. If I wanted to log in, I could simply choose, which of my accounts I want to use.  What I could do: I could use some browser addon (or multiple browsers) which would enable me to use different session cookies.  But I am looking for a better solution: ideally, for one which doesn't trigger your possible warning scripts, but makes this even looking legal.


is it faster to create a SortedSet (of objects) and insert elements to it or create an ArrayList and sort it afterwards?

I have one million lines in a file. An object is created out of each line and added to a collection. The collection has to be sorted using the custom compareTo() method of class.  Currently I add objects to an ArrayList in the order of reading, then do Collections.sort().  Would it be faster to make a TreeSet?


Entry in North Cyprus on Valid Single Schengen visa

I am a Pakistani national having a valid single entry valid Schengen visa and currently in Istanbul and plan is to go to North Cyprus. Do I need to take visa for North Cyprus? If, yes, could you please guide me from where I can get the visa and if online any website is available?


Is there any way to measure performance on a FUSE-based mount that is mounted via long-running executable (no device is used, nor /etc/fstab entry added)?


Easy Full Install USB that Boots both BIOS and UEFI

I need a method of creating a Full install USB that boots both BIOS and UEFI. Full install USB's have advantages over Persistent USB's as shown here:  I want to be able to carry my customized Ubuntu 20.04 OS around with me and boot it off any x86-64 computer that meets Ubuntu minimum spec's. I have seen a few methods of creating a Full install USB, but they are either not simple or do not boot  BIOS and UEFI. The use of an image file seems like the best method.


Special Spanish Characters not displaying, Codeigniter MySQL

Spanish special characters are not displaying correctly, a word like: 'Árbol' is displayed like '�bol'.   1) Text in database is saved correctly. 'Árbol' looks perfect on database.   2) If I insert a new word, eg. 'Tétrico', it is saved correctly on database.   I've been experiencing this problem since I moved the project to another server, on localhost (Ubuntu server) works perfect.   I've tried everything reading similar questions:    View files are encoded in UTF-8 without BOM.  header('Content-type: text/html; charset=utf-8'); In my.cnf, I've added the lines:  init_connect='SET NAMES utf8'  character_set_server=utf8   It just doesn't work.   What else can I do?  I've replicated changes that I did on localhost (because project works perfect here, everything's displaying correctly) to new server, but nothing's changed.


Is there a word or fixed phrase / idiom for a vicious circle of obtuseness?

I recently told my father-in-law that I thought he was being obtuse, and he then acted as if he didn’t understand the concept of being obtuse. I feel like there’s a word for this. What would we call such a situation as this?


I am testing my website for SQL injection issues and come across a couple that i cannot understand.  In basics, I am building a user blogging system.   I am using the SQL inject me firefox plugin and here are some errors I received:  "Error string found: 'Integrity constraint violation'"  "Server Status Code: 302 Moved Temporarily" - I think that is just because i redirect a user on error for a certain form  Overall i had no fails and passed 42,000 tests. However some of my database items are being effected.  Lets say I am echoing out the 'posts' from the database:  I have all the data, and then a hidden form which is used to edit the data. If the user is logged in then a button is shown where they can click and this form is shown.  Even if the user is not logged in, the SQL inject can modify posts.  In my processing page for updating posts i check for POST, and i also run a check again the post's username in the database and also the session username of a logged in (blank if not logged in) user. Yet this still allows changes to be made.  How can this be? And is displaying a form a "display:none" good enough?


A tendency to use "a" in place of "an" in American English

I have noticed that a lot of native American speakers use the indefinite article "a" in front of words beginning with vowels, such as  interesting, old, apple  , etc. Is there any reasonable explanation?


I have a complex object I am trying to texture with a real locations textures. I have the faces I want selected in edit mode and I UV unwrap them by projecting from bounds and it looks fine, like only the faces I selected are being unwrapped, but when I go to apply a new material, the material selects ALL of the faces, the ones I want, and the ones I don't want. What's the best way to get by this?


How to enable virtualization on booting? (Ubuntu 13.10)

I want to use VirtualBox but it is giving me the error VT-x/AMD-V hardware acceleration is not available on your system. And in the virtual box settings, I am not able to open accelerator tab as it's frozen:    Please give me a step-by=step guide on how to fix this.


What is the difference having double quotes or not in bash

I have some bash scripts, one which has the following content:  #!/bin/bash source $(dirname ${BASH_SOURCE[0]})/script.sh   while the other one has the following content:  #!/bin/bash source "$(dirname ${BASH_SOURCE[0]})/script.sh"   How do these scripts behave differently and why? What is the difference?


How to remove title entry in the bibliography contents?

I use plain bibliography style for my book. When I compile it, by default, I get the details including the title in my reference. like this:     H. J. C. Berendsen, J. P. M. Postma, W. F. van Gunsteren, a. Dinola, and J. R. Haak. Molecular dynamics with coupling to an external bath. J. Chem. Phys., 81:3685-3690,1984.   This is too long and I have more than 100 such references which makes the document too long. How can I force it to remove the title from this reference? something like this:     H. J. C. Berendsen, J. P. M. Postma, W. F. van Gunsteren, a. Dinola, and J. R. Haak.  J. Chem. Phys., 81:3685-3690,1984.   Your answer will be greatly appreciated.  By the way, I still would like to use the plain bibliography style.


I have a myfile which contains lines like #!/usr/bin/env python3 print("Hello world") names = ('${(j:', ':)ZSH_VAR[@]}', )  I would like to pre-process this file with the environment variables in my loaded shell (zsh in my case, but a generic bash solution would also work nicely). How can I do the equivalent of $ declare -ga ZSH_VAR=( 1 2 3 ) $ preprocess < myfile  Such that the output is #!/usr/bin/env python3 print("Hello world") bar=('1', '2', '3', )


One keyboard two languages on Ubuntu 17.10

How can I have one keyboard input layout and multiples languages in Ubuntu 17.10? If I have English language I can't type "'e" and get an "é", as I can do in Portuguese and Spanish.  When I manage to do that on Settings -> Region & Language, I'm able to change languages, but it also changes the keyboard layout.  Is there any way to change language (Portuguese or Spanish for example) and set the keyboard input layout (US International for example)?


Trying to get a better understanding of the relation between a SU(N) Yang Mill theory and its number of "color" .  Most of the description I've found so far are either way to complex/specific. Yiannis answer on  is almost what I'm looking for, except I was hoping someone could provide addition sources and readings corresponding precisely to what he is describing.


I have a once-a-year project that I work on around this time every year, which consists of a set of HTML and CSS files (kind of like a saved copy of a website) that get distributed on professionally duplicated DVDs. I create the DVDs using Toast in OS X.   The trickiest part of these DVDs is that there are different files for the Mac "view" of the disk, and different for the Windows "view". This stems from the desire of my client to have a nicely displaying disk icon and Finder window (complete with custom background image) for when the disc is inserted into a Mac, and for Windows users to run autorun.inf (which just launches index.html in the default browser).   The HTML files on the Mac side needed to be hidden away (so they are called .html so that Finder doesn't display them), whereas on the Windows side my client isn't as picky since autorun.inf kicks in as soon as you insert the disc.   So I've been doing this process once a year for four years now and have the process pretty much sorted. I can reliably create these discs with the help of some special Finder-modifying tools (for the background images and disc icons on the Desktop) and having the same disc insert into two different OSes and to show two sets of files.  My client this year wants to distribute a USB key instead of a DVD. After some extensive Googling, I just can't seem to make this work. Googling for 'hybrid iso to usb' gives me a lot of information about how to make a bootable USB key for Linux installations, which doesn't really fit with what I'm trying to do.  The closest I have gotten to my CD-to-USB conversion is to save out my Toast project to a .toast file in OSX, rename this to .iso, convert that to .img and then use dd to write the .img file out straight to /dev/diskN (N being my USB drive). I have done this with a test .toast file that has only one file on the Mac side (a 768KB JPG) and a 219KB PDF on the Windows side.  However this seems to only write out the Mac portion of the Toast image file, and when I plug the USB drive into Windows, it doesn't see the Windows side at all -- the rest of the USB drive I am using (a 2GB flash drive) just stays unpartitioned.  I also tried just making two partitions (one FAT32, the other HFS+) and using the SetFile trick (from an ) but this doesn't work. It seems when I mount the drive on Windows, this hidden bit gets reset somehow.  Has anyone done anything like this before, and is it even possible?


Story about space explorers who communicate but then decide they must destroy each other

I'm looking for a sci-fi story or novel from many years ago where a deep space explorer encounters an alien explorer. The explorers learn to communicate; but on parting, each decides to destroy the other in order to protect his own world.


Is the complement of countably many disjoint closed disks path connected?

Let $\{D_n\}_{n=1}^\infty$ be a family of pairwise disjoint closed disks in $\mathbb{R}^2$.  Is the complement   $$ \mathbb{R}^2 -\bigcup_{n=1}^\infty D_n $$   always path connected?   Here “disk”  means a round, geometric disk.  (As shown below, the answer is no if we allow arbitrary topological disks.)  Note that the union $\bigcup_{n=1}^\infty D_n$ can be dense in the plane.  For example, it's possible to find a collection of disjoint closed disks of positive radius whose union contains $\mathbb{Q}\times\mathbb{Q}$.  It is easy to show that the complement of a countable set of points in the plane is always path connected. In particular, if $S \subset\mathbb{R}^2$ is countable, then there is always  path between any two points in $\mathbb{R}^2-S$ consisting of two line segments.  It is not true that the complement of a countable set of disjoint line segments  is path connected, as shown in the following figure.    By thickening the line segments slightly, one can find a countable collection of disjoint topological disks whose complement is not path connected.


Why are the planet's orbits in the form of an ellipse and what is the proof that earth moves in an elliptical path with the sun at its foci? Initially it was thought that earth moved in a circular orbit. Then,how was it discovered that it moves in an ellipse?


yeast substitutes and proper measurements

I was wondering if I could get some advice as I have intolerances to yeast and have heard of a few substitutions from: baking soda, baking powder, lemon juice, milk and yogurt. The question comes to how do I measure these into bread or baking to make whatever I am making rise? I have heard that in the middle east they rarely use yeast for bread baking and their bread still rises. I just don't know the proper measurements I would use, if a bread recipe calls for 1 or 2 packets of yeast and mixing them in water do you mix one tsp of baking soda and 1 tsp of lemon juice in together?   If you can give me any advice on this that would be greatly appreciated, thanks.


What is the distribution of the Euclidean distance between two normally distributed random variables?

Assume you are given two objects whose exact locations are unknown, but are distributed according to normal distributions with known parameters (e.g. $a \sim N(m, s)$ and $b \sim N(v, t))$. We can assume these are both bivariate normals, such that the positions are described by a distribution over $(x,y)$ coordinates (i.e. $m$ and $v$ are vectors containing the expected $(x,y)$ coordinates for $a$ and $b$ respectively). We will also assume the objects are independent.  Does anyone know if the distribution of the squared Euclidean distance between these two objects is a known parametric distribution? Or how to derive the PDF / CDF for this function analytically?


I have been working on a project and when I started using the camera I noticed its view did not go very far, any way of increasing this?  here is what I mean, you can see the view is curving around the Minecraft blocks and not showing the scene.


How to set unity as default after installing ubuntu-gnome-desktop in Ubuntu 16.04?

Recently I installed gnome-desktop in my Unity Ubuntu 16.04.Now I want to set my Unity desktop environment as default.   I installed Gnome by using these commands :  sudo apt-get install ubuntu-gnome-desktop   then chose gdm3 as default.  Now, I have searched on internet how to do so, one of them say this :  sudo /usr/lib/lightdm/lightdm-set-defaults -s ubuntu   But it throws error saying :     sudo: /usr/lib/lightdm/lightdm-set-defaults: command not found   I'm using ubuntu 16.04.


In empty space what happens to the lights energy that is lost to the doppler effect go to?

When light makes a long distance journey it's frequency shifts toward longer wavelengths. With $E = hc/\lambda$ being the amount of energy in any given photon (see photon energy); as it travels trough space it wavelength is lengthened which means it's loosing energy as it travels through empty space. As energy is conserved is it being converted to make more space or is there an interaction with vacuum energy that explains what happens to the energy of the photon?


Does $\sum_{n=1}^\infty a_n^2 \text{ converges },\ a_n \geq 0 \implies \sum_{n=1}^\infty \frac{a_n}{n} \text{ converges}$?

Let $\sum_{n=1}^\infty a_n^2$ a converging series with $a_n \geq 0$. Decide whether $\sum_{n=1}^\infty \frac{a_n}{n}$ is converging.      Note: you may consider the fact that $\sum_{n=1}^\infty \frac{1}{n^2}$ is converging.   I'm having problems with the above task. Given the hint in the note, I believe the latter series is indeed converging and am trying to prove it. Unfortunately, I fail to find a promising approach to do so.  Obviously, $\sum_{n=1}^\infty a_n^2 \neq \left(\sum_{n=1}^\infty a_n\right) \cdot \left(\sum_{n=1}^\infty a_n \right)$, which would be a rookie mistake. Similarly, $\sqrt{\sum_{n=1}^\infty a_n^2} \neq \sum_{n=1}^\infty a_n$. Therefore, the square seems difficult to get rid of. I thought of arguing using the Cauchy product, however, I'm not sure whether it could be applied "in reverse" to show that if the series based on $a_n^2$ is converging, then the one based on $a_n$ is, too.  What approach would you take to solve this problem?


I have the URL of an image which I know is an attachment. Now, I need to find out the attachment ID.  This is what I've got (thanks to ):  // retrieves the attachment ID from the file URL function pippin_get_image_id($image_url) {     global $wpdb;     $attachment = $wpdb->get_col($wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE guid='%s';", $image_url ));          return $attachment[0];  }   This works fine for an URL like this:    My problem is, the URL is the URL of a cropped picture, so it is   My next problem is right now, I can't simply explode the URL to remove 300x297, since I might have pictures, which are not cropped but might have a file name like 'picture2-dontexplodeme.png'  Basically, I need a fool proof solution haha. If there is anyone out there, who has an easy solution, I would be very happy :)


The setuid permission bit tells Linux to run a program with the effective user id of the owner instead of the executor:  > cat setuid-test.c  #include <stdio.h> #include <unistd.h>  int main(int argc, char** argv) {     printf("%d", geteuid());     return 0; }  > gcc -o setuid-test setuid-test.c > ./setuid-test  1000  > sudo chown nobody ./setuid-test; sudo chmod +s ./setuid-test > ./setuid-test  65534   However, this only applies to executables; shell scripts ignore the setuid bit:  > cat setuid-test2  #!/bin/bash id -u  > ./setuid-test2  1000  > sudo chown nobody ./setuid-test2; sudo chmod +s ./setuid-test2 > ./setuid-test2  1000     Wikipedia :     Due to the increased likelihood of security flaws, many operating systems ignore the setuid attribute when applied to executable shell scripts.   Assuming I'm willing to accept those risks, is there any way to tell Linux to treat the setuid bit the same on shell scripts as it does on executables?  If not, is there a common workaround for this problem? My current solution is to add a sudoers entry to allow ALL to run a given script as the user I want it run as, with NOPASSWD to avoid the password prompt. The main downsides to that is the need for a sudoers entry every time I want to do this, and the need for the caller to sudo some-script instead of just some-script


What is the square root of the NOT gate?

I have encountered different matrix of operator "the Square Root of NOT gate". For example, : $\sqrt {NOT}  = \frac{1}{2}\left( {\begin{array}{*{20}{c}} {1 + i}&{1 - i}\\ {1 - i}&{1 + i} \end{array}} \right)$ And  is given: $\sqrt {NOT}  = \frac{1}{{\sqrt 2 }}\left( {\begin{array}{*{20}{c}} 1&{ - i}\\ { - i}&1 \end{array}} \right)$ Applying them to the vector $\left| 0 \right\rangle  = \left( {\begin{array}{*{20}{c}} 1\\ 0 \end{array}} \right)$, we get different results: $\sqrt {NOT} \left| 0 \right\rangle  = \frac{1}{2}\left( {\begin{array}{*{20}{c}} {1 + i}&{1 - i}\\ {1 - i}&{1 + i} \end{array}} \right)\left( {\begin{array}{*{20}{c}} 1\\ 0 \end{array}} \right) = \frac{1}{2}\left( {\begin{array}{*{20}{c}} {1 + i}\\ {1 - i} \end{array}} \right)$ $\sqrt {NOT} \left| 0 \right\rangle  = \frac{1}{{\sqrt 2 }}\left( {\begin{array}{*{20}{c}} 1&{ - i}\\ { - i}&1 \end{array}} \right)\left( {\begin{array}{*{20}{c}} 1\\ 0 \end{array}} \right) = \frac{1}{{\sqrt 2 }}\left( {\begin{array}{*{20}{c}} 1\\ { - i} \end{array}} \right)$ Where is the correct matrix of the operator $\sqrt {NOT} $ specified?


Creating if-else condition with ArcGIS API for JavaScript combo boxes?

I have an ArcGIS JavaScript API Web App that uses multiple combo boxes.  I would like to create an if-else conditional statement between two fields in my feature layer.  If one field is chosen in combo box one is 1  then combo box three should automatically populate to 3.    Below is my validate function for my request type.    function changeonevent() {   (dijit.byId("cbRequestType").on('change'), changeonevent (MFValue) {     if (MFValue == 'Electronic Waste') {    dijit.byID("cbMFSubType"). set ('value', 'Copy Machine');     } else if MFValue == '...'{    dijit.by.ID('cbMFSubType').set('value', 'Printer');     }


Can't add PPA on Ubuntu 15.10 - user or team does not exist

Since I have installed Ubuntu 15.10 I can no longer add ppa to my repository list:  @:~>sudo apt-add-repository ppa:git-core/ppa Cannot add PPA: 'ppa:~git-core/ubuntu/ppa'. ERROR: '~git-core' user or team does not exist.   Does somebody know what changed in 15.10? Maybe it is an issue with a proxy-server. I am behind a proxy server, but everything else like wget or apt-get is working with my current configuration.


Pluralization issue on new question statistics underneath title, with views

It looks like the new question statistics underneath the question title introduced a pluralization issue with views:        To be clear here, this was not an issue with the old sidebar-based question statistics; that used to properly say "viewed 1 time".


How was trigonometry used to define this racing line

I was searching through the internet for an equation that defines the path followed by a racing line, when I came across the following formula on StackExchange . However, I could not understand what kind of maths is being used in the proof submitted by this user:  I created this account, but couldn't comment on the user's proof, so I decided to post it as a question. I would appreciate it if someone was able to explain to me just what kind of maths was used to solve the problem.  I understand that it involves trigonometry, but I can't seem to figure out exactly how he used it to solve this problem and how he applied trigonometry to solve it, as I don't think I have advanced that far in maths. I am not sure how I am supposed to apply trigonometry here because I honestly cannot understand how each he (or she) transitions from the first equation to the second and then to the third.


Is the axiom of regularity/foundation equivalent to $\forall x:x\notin x$?

In set theory, the  can be used to  $$ \tag{*}\label{*} \forall x:x\notin x. $$ Can the direction be reversed, i.e., can $(\ref{*})$ prove regularity in ZF$\setminus$R? By ZF$\setminus$R I mean the standard axioms of ZF, without the axiom of regularity. Stated differently, as in the title, is $(\ref{*})$ equivalent to the axiom of regularity in ZF$\setminus$R?


I'm trying to solve this. I'm unable to use the Euler-Fermat theorem and I don't know how to carry on. Any help?


Java. Tracing works fine and it has the same answer but not working in IF statement

I am making a basic guessing game for my first java test and i have same by an interesting problem. My if statement isn't doing what it is told but when i trace it, the outputs are the same. My Code is... ;   import java.util.Scanner;   public class Game {  public static void main(String[] arg) {     Scanner GetInput = new Scanner(System.in);     try {         String Word;         String Guess;         int attempts = 0;         boolean win = false;              System.out                     .println("Hello, and welcome to the guessing game! This game is very simple; one player will enter a word when");             System.out                     .println("asked, then the next player will need to guess the word Be warned player two, you only have three guesses");             System.out                     .println("Let's get started. Player ONE, please enter you're word: ");             Word = GetInput.next();             System.out                     .println("Okay the word has been entered, now player TWO must guess");              do {                 Guess = null;                 System.out.println("Guess the word: ");                 Guess = GetInput.next();                 System.out.println(Guess + "/" + Word);                 if (Word == Guess) {                     System.out.println("You won!");                     break;                 } else if (Guess != Word) {                     attempts ++;                 }                  if (win == false && attempts == 3) {                         System.out.println("You lose!");                         break;                 }             } while (attempts <= 3);     } finally {         GetInput.close();     } }   }


There's no set $X$ such that $P(X)\subset X$.

I want to show the above assertion, I guess I am not sure what's the definition of a set, I thought it's the basic building block.  Anyway, if the above titled assertion weren't true then for every $Y \subset X$ we will also have $Y \in X$, which should contradict $X$ being a set, but why is that?


Certificate error on meta.physics.stackexchange.com

Visiting  gives me a certificate error in Chrome. Here is the certificate that I receive when visiting that page:


There is defined     Z[i] = {a+bi|a,b $\in$ Z}  with standard operations of addition and multiplications complex number. Question is, if factor ring Z[i]/(1-i) is field. How could I prove it? Do you have any hint?


How do I find a common complementary color?

I have 3 colors, I need to find a 4th that is complementary of these three:  #d9bba3 #72737b #b0aca8   I have so far found #d7d6db but it is only my guess, not based on any tool, is there a way to find a common complementary color? Do they have one in common?


Wifi stops working randomly after a while on ubuntu 14.04LTS

I shifted from windows to ubuntu for first time on HP r-15 laptop and dual booted ubuntu 14.04 LTS with windows 8.1.But i am having problem with wifi.I can connect to wifi without any problem but after a while it randomly stops working but it is showing that i am connected.When i try to reconnect,it looks like it is trying to reconnect but never do.Only solution for this is to reboot the laptop  and everything starts working fine for some time. I read some same questions like that but that are none of my use. I am a beginner in linux. Thanks for help in advance.Edit - this was the output of the command suggested by Pilot6  0a:00.0 Network controller [0280]: Realtek Semiconductor Co., Ltd. RTL8723BE PCIe Wireless Network Adapter [10ec:b723]     Subsystem: Hewlett-Packard Company Device [103c:2231]     Kernel driver in use: rtl8723be


Almost every book on physics that I read have some weird and non-clear explanations regarding the potential energy. Ok, I do understand that if we integrate a force over some path, we'll get a difference in some origin-function values ($\int_{A}^{B} Fdx = U(B) - U(A)$). This function is the potential energy. Of course, whether we can define this term or not depends on the force.  Now, here's an example of explanation (to be more precise - lack of explanation) regarding the GPE from one of the books:     "...When a body moves from some point A to point B, gravity is doing work: $U_A-U_B=W_{A \to B}$. The magnitude can be calculated using an integral:   $W_{A \to B}=\int_{r_A}^{r_B} F(r) dr = \int_{r_A}^{r_B} \left(-\frac{GMm}{r^2} \right)dr=(-\frac{GMm}{r_A})-(-\frac{GMm}{r_B})=U_A-U_B$      ...      Thus,  when $r_A>r_B$, the magnitude is positive and therefore $U_A>U_B$. In other words: when the distance between the bodies is being increased - the gravitational potential energy of the system is also being increased.   Giving absolutely no explanation on why all of a sudden they put a minus sign into the integral.  From another book:     Work done by Coulomb's force: $W_{el}=\int_{r_1}^{r_2}\frac{q_1q_2dr}{4 \pi \epsilon_0 r^2}=\frac{q_1q_2}{4 \pi \epsilon_0 r_1}-\frac{q_1q_2}{4 \pi \epsilon_0 r_2}$      ... Calculating the work gravity is doing is no different from the calculation of the work done by an electric field, with two exceptions - instead of $q_1q_2/4 \pi \epsilon_0$ we should plug $G M m$, and we also should change the sign, because the gravitational force is always a force of attraction.   Now, this is not satisfying at all. So what if it is an attraction force? How this should influence our calculations, if the work is defined as $|F| |\Delta x| \cos \theta$, so the sign only depends on the angle between the path vector and the force vector? Why they put a minus sign? Is is just a convention or a must thing to do?  Some say the sign is important, others say the opposite. Some explain this as a consequence of that we bring the body from infinity to some point, while others say it is a consequence of an attractive nature of the gravitational force. All of that is really confusing me.  Also, in some of the questions like "what work is required to bring something from point $A$ to point $B$ in the field of gravitational/electric force", the books sometimes confuse $U_A-U_B$ and $U_B-U_A$ - as I understand it - the work that I must do is always $U_B-U_A$. However the work that the force that is being created by the field do is always $U_A-U_B$, am I correct?


Right now they default to desktop, and I followed instructions found . It works up until I shut down the computer; I was wondering if there was a permanent solution?


finding the size of an unknown array in C

We have been  given a large  array of unknown size with elements given , is there any function or something other through which we can find the size of that array in language C int a[]={4,6,4,26,3,2,5,7,3,7,3,2,5,4,6,3,7,232,6,32,6,3,7,3,6,2,5,7,3,6,3,6,36,3,67,23,6};


Nurses, therapists, and others in similar caring roles often use "we" when talking to patients.     How are we doing today?   I'm looking for the grammatical/technical name of this mode of speaking, and especially a reference on it that I can link to.  I believe I have heard it called either "clinical we" or "therapeutic we," but I can't find resources when Googling for those terms.


BibTeX: where to write Sir in author's name?

My bibtex style outputs      Newton, S. I. Opticks, or a treatise of the reflections, refractions,   inflections and colours of light [Text] / Sir Isaac Newton. [S. l.],   1730. 382 p. Google Books : XXu4AkRVBBoC.   for the following BibTeX entry  @BOOK{IsaacNewton, author = {Newton, Sir Isaac}, title = {Opticks, or a treatise of the reflections, refractions, inflections and colours of light}, publisher = {William Innys}, url = {http://books.google.com/books?id=XXu4AkRVBBoC}, year = {1730}, numpages = {382}, eprint = {XXu4AkRVBBoC}, eprinttype = {Google Books}, }   How should I change the field   author = {Newton, Sir Isaac},   obtain something reasonable rather than Newton, S. I.? Note that second occurrence of Newton's name (Sir Isaac Newton) is correct.  Incidentally, what would be the correct address: "Sir Isaac" or "Sir Newton"?


Proving that the set of $\nu$ measurable sets $M\subseteq P(X)$ is an algebra

I am not sure I am using the standard definitions so I will open by defining what I need:        Let $X$ be a set, $\nu:\, P(X)\to[0,\infty]$ will be called an external measure if $\nu(\emptyset)=0$ and for any   $\{A_{i}\}_{i=1}^{\infty}\subseteq P(x)$ (not neccaseraly disjoint) it   holds that   $\nu(\cup_{i=1}^{\infty}A_{i})\leq\sum_{i=1}^{\infty}\nu(A_{i})$   Let $\nu$ be an external measure on a set $X$ then we say that a set $A$ is $\nu$ measurable if for any $E\subseteq X$: $\nu(E)=\nu(E\cap A)+\nu(E\cap A^{c})$      The exercise asks to prove that the set of $\nu$ measurable sets $M\subseteq P(X)$ is an algebra.  I have proved $\emptyset,X\in M$ and that $A\in M\implies A^{c}\in M$ but I am having problems proving closer under union and intersection.  I assume that $A_{1},A_{2}$ are $\nu$ measurable so I get that for any $E$: $$\nu(E)=\nu(E\cap A_{1})+\nu(E\cap A_{1}^{c})$$  $$\nu(E)=\nu(E\cap A_{2})+\nu(E\cap A_{2}^{c})$$  And I need to prove that for any $E'$: $$\nu(E')=\nu(E'\cap A_{1}\cap A_{2})+\nu(E'\cap(A_{1}\cap A_{2})^{c})$$  which is the same as $$\nu(E')=\nu(E'\cap A_{1}\cap A_{2})+\nu((E'\cap A_{1}^{c})\cup(E'\cap A_{2}^{c}))$$  and a similar result to prove closer under union.  I guess that it all have to do with choosing the right $E$'s from knowing that $A_{i}$ are $\nu$ measurable, but I tried different options for an hour now and I don't see this going anywhere.  I need some help in showing closer under union and intersection


Prove $ax \equiv1 \textrm{ mod } 10^k \implies aN(x) \equiv1 \textrm{ mod } 10^{2k}$

For every $a \in Z$, consider the function $N:\mathbb{Z} \rightarrow \mathbb{Z}$: $$N(x)=x(2-ax)$$ Prove for every $k \in \mathbb{N}$ that $$ax \equiv1 \textrm{ mod } 10^k \implies aN(x) \equiv1 \textrm{ mod } 10^{2k}$$  Thoughts so far: We can make the following computation and find that $$aN(x)-1 = ax(2-ax)-1=-(ax-1)^2$$ which shows that $aN(x) \equiv1 \textrm{ mod } 10^k$, right? But where does $10^{2k}$ enter the picture?


I would like a tikz picture to move over to the left so it is touching the edge of the page.  Here is my code:  \begin{figure}     \resizebox{\paperwidth}{!}{         \begin{tikzpicture}             \fill[black!50!blue] (-10, 1) rectangle (10, 2);             \fill[black!50!blue] (-5, 0) rectangle (5, 3);         \end{tikzpicture}     } \end{figure}   This is what it looks like at the moment. How would I move it over?


"sudo must be owned by uid 0" when installing a package

I installed npm and tried to install a package:  npm install -g reaction-cli   I got an error like:  Error: EACCES: permission denied, access '/usr/lib/node_modules'   So, I tried to add permission with:  sudo chown -R $USER /usr/lib   But when I try to install other software, for example  sudo apt-get install git-core   I get:  sudo: error in /etc/sudo.conf, line 0 while loading plugin  "sudoers_policy" sudo: /usr/lib/sudo/sudoers.so must be owned by uid 0  sudo: fatal error, unable to load plugins   Is there any method to resolve my problem?  I also using sudo chown -R $USER /src/http to access source in Apache server to edit files. Then I don't get this error.


I lost my desktop. I see some files that I left on the desktop but I don't see any of the menus. How could I restore the menus? I am using Ubuntu 16.04.


Just from the fact the Dumbledore defeated it when Grindlewald was using it makes me wonder if it was really unbeatable. Unless of course he beat him non-magically. But that could just be hype.


In researching a possible answer to , I read .  The article talks about wiping the cache partition via Android System Recovery and performing a Factory Reset.  Question: Does an Android Factory Reset also clear the cache partition?  Or does it only clear the data partition?


Kubuntu 16.04 LTS: How to boot to text console?

I've just upgraded from 14.04 to 16.04. I'd edited /etc/default/grub to add the word text to GRUB_CMDLINE_LINUX_DEFAULT and un-commented GRUB_TERMINAL=console (not sure if this makes a difference). Then ran update-grub.  This caused the console to reboot to the command line in 14.04. But after upgrading it boots to the graphical terminal. I need a command line to reconfigure network settings before I can get an ssh session. This is a VMWare virtual machine and the console doesn't respond to the mouse.


Prove that the empty relation is Transitive, Symmetric but not Reflexive

Question:      Let $R$ be a relation on a set $A$. Prove that         if $A$ is non-empty, the empty relation is not reflexive on $A$.   the empty relation is symmetric and transitive for every set $A$.      My Solution:    For a relation to be reflexive: For all elements in A, they should be related to themselves. ($x$ $R$ $x$). Now in this case there are no elements in the Relation and as A is non-empty no element is related to itself hence the empty relation is not reflexive.  Now for a set to be symmetric and transitive: As these are conditional statements if the antecedent is false the statements would be true. And as the relation is empty in both cases the antecedent is false hence the empty relation is symmetric and transitive.   (I just want to know if my solutions are correct. - I've given brief solutions without using any notation here.)


How do we prove this ? $$\displaystyle\int_0^1\frac{\log(\log(\frac{1}{x}))}{1-x+x^2}dx=\frac{2\pi}{\sqrt{3}}\log(\frac{\sqrt[6]{32\pi^5}}{\Gamma(\frac{1}{6})})$$ My atempte: \begin{align*} \displaystyle\int_0^1\frac{\log(\log(\frac{1}{x}))}{1-x+x^2}dx&=\displaystyle\int_1^{\infty}\frac{\log(\log(t))}{1-t+t^2}dt&(\frac{1}{x}=t)\\ &=\displaystyle\int_0^{\infty}u\frac{e^u}{(e^u-1)^2+e^u}du&(\log(t)=u)\\ &=\displaystyle\int_0^{\infty}u\frac{1}{1+\left(\frac{e^u-1}{e^{\frac{u}{2}}}\right)^2}du\\ &=\displaystyle\sum_{n=0}^{\infty}(-1)^n\displaystyle\int_0^{\infty}u(e^{-nu})(e^u-1)^{2n}du\\ \end{align*} In the last integration, I had no idea to complete the proof Any help to prove this And thanks in advance


Is it possible to convert a film SLR to digital?

This may well be a question to which the answer is "can't be done," but I was wondering whether it was possible to convert a film SLR to a DSLR by putting a sensor in place of the film. I have a bunch of old bodies and lenses which I would love to be able to use, but I just don't want to mess around with film, so I was wondering whether it's possible to convert them to take digital images.


I wanted to switch to Xfce (I had KDE and GNOME installed), and I did this :    sudo apt-get install xubuntu-desktop sudo apt-get remove kubuntu-desktop sudo apt-get remove ubuntu-desktop sudo apt-get autoremove   but to my surprise, I could still pick gnome, kde plasma, etc during the log in.  So, how do I completely remove KDE and GNOME desktops?


Degrees of freedom in theoretical sample variance (for use in F-distribution)

My question is essentially simple: suppose we have a sequence of heads and tails with an apparent chance of getting heads $\hat{p} = 0.5$.      h h t h t t t h t t h ...   How do we tell if this sample was drawn from a binomial distribution with this $\hat{p}$ or if it comes from a combination of different distributions which produces the same average? (e.g. $p = 0.25$ or $p = 0.75$)  Here's what I was thinking of doing:   We chop the sequence into subsections of length $n$, for example $n=5$, and calculate $\hat{p}$ in every such window: {h h t h t}, {t t h t t}, {h ...}0.6, 0.2, ... We then calculate the standard deviation in these $\hat{p}$ values: $\sigma_{ex}=\sqrt{\frac{\sum_{i=1}^M{(\hat{p}_i - \hat{\mu})^2}}{M}}$, where $\hat{\mu}$ is the average $\hat{p}$ and $M$ is the total number of windows of size $n$ we can make.  We calculate the standard deviation in $\hat{p}$ based on a binomial distribution, $\sigma_{th}=\sqrt{\frac{\hat{p}(1-\hat{p})}{n}}$.   Now comes the problem: how to determine if these two values are the same? After a lot of research, I decided to try using an F-ratio test and plugging the result into an f-distribution.  F-ratio: $F = \frac{\sigma_{ex}^2}{\sigma_{th}^2}$ (only valid for normal-distributions :S)  And then an f-distribution to get to a p-value we can check against. However, for the f-distribution I need to know the degrees of freedom in the nominator and denominator. And therein lies my problem: what are the degrees of freedom for the variance calculated from theory? (In the experimental case I think it is M)  If you have this answer or any suggestions on how to solve this problem differently, I would love to hear about it!


Why are more powerful tools using higher voltage?

AFAIK each of the world leading cordless power tools manufacturers produces several "product lines" of cordless power tools with different voltages. For example, Bosch currently produces tools with Li-Ion batteries with 10,7V, 14,4V, 18V and 36V output and the higher the voltage the more powerful a tool is.  Now those tools are powered by batteries that are assembled from cells with lower voltage (something like 3,7 volts for Li-Ion cells I guess) and cells are connected in sequence until the target voltage is reached.  They could instead connect cells in parallel. They would have the same voltage, but higher current and that would again yield higher power.  Why do they choose higher voltage over same voltage and higher current to get higher power in electric tools?


How can I stop negative scale happening by default, and always select back-facing geometry without entering X-ray mode?

I've been a long-time Maya user, but with Blender's latest releases I'm trying really hard to jump ship. But, there are two features that I use all the time in my Maya workflow that I can't seem to replicate in Blender. Preventing negative scaling by default I use this all the time to align components. For example, if I have a couple of verts that I want to align, I'll set the pivot point (Or now, 3D cursor) to a spot that I want to align them to, and then scale them all along two axis. In Maya, they don't scale past the negative point by default, so it's really quick and easy with verts, faces, edged, all of it. In Blender, I can also scale them, but I then have to type 0 and select the two axis myself. This also works, but it's just not as fast, and it's just a pain to do every time. Is there a toggle or extension that could prevent negative values by default? Select back-facing geometry without entering X-ray mode Another thing I do all the time. I'll often drag to select verts or faces of a model, and in Maya, any components in my selection rectangle will be selected - Even ones that aren't visible to the current perspective. For example, if I'm modeling a door, and want to move the top of the frame down. I'd go into front-ortho mode, drag to select all the frame's top verts, and then move them down. But in Blender, I can't select the components behind other ones (blocked from my direct view) without being in X-ray mode, which makes it all a lot harder to see and manage. Having to toggle it constantly is frustrating and time consuming, and I was really hoping there's a way I can have it on by default. Sorry for the long-winded questions, but these are my only blockers from switching completely, and I'm pulling my hair out over here. Thanks in advance!


Can I have Firefox open all links in default browser?

I'm using a tool called  that creates special Firefox profiles for web apps (like Twitter or WhatsApp) to have them run in Firefox windows resembling Firefox' former site-specific browser feature. Now when I click links in those web apps running in special Firefox profiles, they open as a new tab in the web app window (where the tabs are invisible) - so I would like to have all links open in my default browser (or the default profile of Firefox for that matter) instead. There is an about:config option named browser.link.open_newwindow which supports the following values :  1: Open links, that would normally open in a new window, in the current tab/window. 2: Open links, that would normally open in a new window, in a new window. 3: Open links, that would normally open in a new window, in a new tab in the current window.  Ideally, there would be an option to open those links using the system's default (like using xdg-open on Linux), which would open the link using my default browser / Firefox' default profile. Is there some config item that I'm missing - or an add-on for Firefox that does just that (letting the system handle opening the link)? Does anyone have another idea? Edit:@harrymc linked me this question (thanks!):  (they asked for pretty much the same thing, so my question is a duplicate). The answer was to use an extension named  - and it's almost what I need! Now I can right-click any page or link to open it with another browser (or profile) - but it doesn't automatically open all links with that – Problem not fully solved.


I've taken the rear wheel off my bike but the rear gears are stuck and do not spin freely anticlockwise.  It had been out of use for about 4 days, kept in a dry garage. I took the wheel off because it was bent, then found this problem.  Any idea what's happened or if i can fix it?


Is there a *simple* example of how the axiom of choice can lead to a counterintuitive result?

This question is quite subjective, but here goes:  The axiom of choice notoriously leads to many extremely counterintuitive results, like the Hausdorff, Von Neumann, and (most famously) Banach-Tarski paradoxes. Unfortunately, the proof of these paradoxes is also notoriously complicated, and it's not at all obvious why an axiom as seemingly innocuous (and, in fact, obvious) as the axiom of choice has such strange consequences.  Do there exist any examples of a simple chain of reasoning that leads from the axiom of choice to a counterintuitive result? (Though not necessarily a result as spectacularly counterintuitive as the Banach-Tarski paradox.) One which is simple enough that someone without training in advanced mathematics could understand the general train of logic (with perhaps a few steps fudged over)? I've never see an example that lets me intuitively understand why naive intuition "goes wrong" exactly at the step where we use the axiom of choice.  (To be clear: I'm not looking for a simple counterintuitive result that follows from the axiom of choice - Banach-Tarksi would qualify for that. I'm instead looking for a counterintuitive result that follows from the axiom of choice with a (relatively) simple proof.)


Please help, I'm stuck in this problem:     Find the values of $a$ and $b$:   $$\frac{a(26.273)^b}{a(27.165)^b}=1.0065809$$


More Efficient Spatial join in Python without QGIS, ArcGIS, PostGIS, etc

I'm attempting to do a spatial join much like the example here: . However, that approach seems really inefficient / slow. Even running this with a modest 250 points takes almost 2 minutes and it fails entirely on shapefiles with > 1,000 points. Is there a better approach? I'd like to do this entirely in Python without using ArcGIS, QGIS, etc.  I'd also be interested to know if it's possible to SUM attributes (i.e. population) of all the points that fall within a polygon and join that quantity to the polygon shapefile.       Here is the code I'm trying to convert. I get an error on line 9:  poly['properties']['score'] += point['properties']['score']   which says:     TypeError: unsupported operand type(s) for +=: 'NoneType' and 'float'.    If I replace the "+=" with "=" it runs fine but that doesn't sum the fields. I've also tried making these as integers but that fails as well.  with fiona.open(poly_shp, 'r') as n:    with fiona.open(point_shp,'r') as s:     outSchema = {'geometry': 'Polygon','properties':{'region':'str','score':'float'}}     with fiona.open (out_shp, 'w', 'ESRI Shapefile', outSchema, crs) as output:         for point in s:             for poly in n:                 if shape(point['geometry']).within(shape(poly['geometry'])):                       poly['properties']['score']) += point['properties']['score'])                     output.write({                         'properties':{                             'region':poly['properties']['NAME'],                             'score':poly['properties']['score']},                         'geometry':poly['geometry']})


Normalizing the constant of the posterior

I am reading the lecture note from Cambridge University about Probabilistic Ranking and they claim that the normalized constant has a closed form in the below formula but I could not know how to prove. Would you please help me to handle this relation?  $\int_{-\infty}^{\infty}\int_{-\infty}^{\infty} \mathcal{N}(w_1; \mu_1, \sigma^2_1)\mathcal{N}(w_2; \mu_2, \sigma^2_2) \Phi(y(w_1 - w_2)) \, \mathrm{d}w_1 \mathrm{d}w_2 = \Phi ( \frac{y(\mu_1 - \mu_2)}{\sqrt{1+ \sigma^2_1 + \sigma^2_2}})$  In this case, $\Phi(t) = \int_{-\infty}^t \mathcal{N}(x; 0, 1)\, \mathrm{d}x$ and $\mathcal{N}$ represents the normal distribution. $y$ is the observation and its value is +1 or -1.  One hint that they give is   $\int_{-\infty}^{\infty} \delta(y - sign(t)) \mathcal{N}(t; \mu, \sigma^2) \,\mathrm{d}t = \Phi(\frac{y\mu}{\sigma}) $   $ \Phi(y(w_1 - w_2)) = \int_{-\infty}^{\infty} \delta(y-sign(t)) \mathcal{N}(t; w_1 - w_2,, 1) \, \mathrm{d}t$.   $\delta$ is Dirac delta function which is use as indicator in the case of continuous variables.  However, I get stuck and dont know how to prove this. Would you please help me to prove?  Thank you.  Nam  P/S: The link of the slide is  and this course is over already.


Programmatically create a user and assign a role

I'm programmatically creating a user with the following code.  $newUser = array(   'name' => $mail,    'pass' => 'password',  // note: do not md5 the password   'mail' => $mail,    'status' => 1,    'init' => $mail,   'roles' => array(5) ); $user = user_save(null, $newUser);   I have got a role with the role ID equal to 5; when I create the user, in the table "users_roles" there is only a row with the value 0 for the role ID, but if I print the user object with var_dump(), it looks like the roles are created.  What am I doing wrong?


What came first, the $\forall$ or the $\exists$?

I imagine that these symbols originated in one of the following ways:  "I will declare a symbol for "for all." I will just use the letter "A" flipped upside-down. Yes, let $\forall$ represent "for all."  Hmmm, now I need a similar notation for "there exists." Well, I will do the same thing with the letter "E". But wait! The letter "E" has horizontal symmetry, so this won't work! I must flip it backwards instead. $\exists$ it is!"  OR  "I will declare a symbol for "there exists." I will just use the letter "E" flipped backwards. Yes, let $\exists$ represent "there exists."  Hmmm, now I need a similar notation for "for all." Well, I will do the same thing with the letter "A". But wait! The letter "A" has vertical symmetry, so this won't work! I must flip it upside-down instead. $\forall$ it is!"  So which is it? Did we flip our A's or our E's first?