I'd like to have shorter underscores with LuaTex and fontspec. And the vertical position of the underscores is too low compared to not using fontspec.  Do I have to use some other setup than fontspec. It is working quiet well except for the too long underscores.  Result without fontspec    1. MWE  \documentclass[]{article} \usepackage[]{fontspec}  \begin{document} cöde\_nameß  \texttt{cöde\_nameß}  \textit{cöde\_nameß}  \end{document}       I tried  but there is a still a difference between texttt and the others.  2. MWE  \documentclass[]{article} \usepackage[]{fontspec} \usepackage{relsize} \begin{document} \renewcommand{\_}{\textscale{.7}{\textunderscore}}  cöde\_nameß  \texttt{cöde\_nameß}  \textit{cöde\_nameß}  \end{document}       I also tried  but then the font of the underscore doesn't match the texttt.  3. MWE  \documentclass[]{article} \usepackage[]{fontspec} \makeatletter \let\_\relax \DeclareRobustCommand{\_}{%   \leavevmode\vbox{%     \hrule\@width.5em           \@height-.26ex           \@depth\dimexpr.26ex+.28pt\relax}} \makeatother \begin{document}  cöde\_nameß  \texttt{cöde\_nameß}  \textit{cöde\_nameß}  \end{document}

My collaborator added \usepackage[no-math]{fontspec} to a document we're working on. The result is that \_ underscores become v. long: cf. pictures below.   \documentclass{article} \usepackage[no-math]{fontspec} \pagestyle{empty}  \begin{document} \textrm{metric\_space} \end{document}   With fontspec:    Without fontspec:   The underscores are about twice as long with fontspec, and also much thinner. My question is, how do I get back to the original width? (Ideally I would like to preserve the thinness -- it looks much nicer than the original.)  In case someone asks, "why are you using \_?", the short answer is that I need to typeset identifiers involving an underscore. See  for an example in context. I'd be happy with using something other than \textrm, if it looks decent in the context of that example.


So what's this line means? int n = sizeof(arr) / sizeof(arr[0]) Why are we dividing arr with arr[0] and whats the use of n here? #include <iostream> using namespace std;   int search(int arr[], int n, int x) {     int i;     for (i = 0; i < n; i++)         if (arr[i] == x)             return i;     return -1; }   // Driver code int main(void) {     int arr[] = { 2, 3, 4, 10, 40 };     int x = 10;     int n = sizeof(arr) / sizeof(arr[0]);         // Function call     int result = search(arr, n, x);     (result == -1)         ? cout << "Element is not present in array"         : cout << "Element is present at index " << result;     return 0; }

How do I determine the size of my array in C?   That is, the number of elements the array can hold?


We have a public facing site  www.productsMainsite.com is our main web application   i need only pages and sites information for a site under a web application, for example:  www.productsMainsite.com/prodSite www.productsMainsite.com/prodSite/Prodcut1 - www.productsMainsite.com/prodSite/product1/pages/page1.aspx www.productsMainsite.com/prodSite/Prodcut2 -www.productsMainsite.com/prodSite/Prodcut2/pages.page1.aspx   How to get all sub sites in a site? How to get all pages in a sub site and a site ? using power shell or from Central administration site   and  in this public facing site some pages static and dynamic how i get this information from power shell?

How to get all the pages inside a site? I will pass the parameter of a site in a site collection example: http://www.category.com/en,using powershell code in sharepoint server 2013.  when i  try below command i can not get all sites under a site  Get-SPSite  https://xxxx/xx  -Limit All | Get-SPWeb -Limit All | Select -ExpandProperty AllWebs


This  asked a question recently. This is that . There were quite a few answers to it and the OP went ahead and upvoted it, thanking everybody for their time and effort. Soon after the OP asked  and once there were a few answer, the OP did the same thing. Upvoted each answer and thanks every body for their time and effort.  While its good to see a user happy with the responses and upvoting the effort of every answer post, I fear that continuously upvoting so many answers, in such a short time, might trigger a serial upvoting scenario in this case. Though the intentions of the user are good, with no evil intentions, will this fall under the bracket of serial-upvoting? And if it does, what do we do, in such a case? Do we ask the user to not upvote like this(but vote is the user's choice and they can use it as per their wish and certainly this user doesn't seem to be gaming the system either).  P.S: I just wanted to know if this will trigger the serial upvoting algorithm or not, because if it does, then I would like to warn the OP regarding this, since there was no bad/evil intention of the OP to involve in serial upvoting as such and help the OP not get banned for serial voting.

I just noticed that I lost a bunch of points from my reputation score, and I used the "reputation" tab on my user profile page to try and track down the cause.  During my investigation, I noticed there was an unusual event of type "reversal". In the normal place of a question title, it says "voting corrected".     What does this mean, and what caused it?  Did I do something wrong? Why did I lose all of that reputation? Is the system punishing me for leaving too many good answers?  Is there any way to earn it back?


I have just wrote a code(c#) for my sample exam in C# basics study.  Еven though I was able to write it correctly and receive all points, I am not quite satisfied with the way I have used to cast the char ASCII value to the desired int value. I am asking for a better way to express the following code:  using System;  namespace MultiplyTable {     class Program     {         static void Main(string[] args)         {             //Input:             string inputNumber = Console.ReadLine();              //Logic:              int firstNumber = 0;             int secondNumber = 0;             int thirdNumber = 0;              for (int i = 0; i < inputNumber.Length; i++)             {                 firstNumber = inputNumber[0] - 48;                 secondNumber = inputNumber[1] - 48;                 thirdNumber = inputNumber[2] - 48;             }              for (int p = 1; p <= thirdNumber; p++)             {                 for (int j = 1; j <= secondNumber; j++)                 {                     for (int k = 1; k <= firstNumber; k++)                     {                         Console.WriteLine($"{p} * {j} * {k} = {p * j * k};");                     }                 }             }         }     } }   The input is an integer three-digit number in the range [111… 999]. I have used string instead of int, to quicker read and store all char values. The issue here is that when I have the char let's say '3' I need to use the int value of '3' and not the ASCII Dec value of 51. As I had a limited time to write this code I succeeded to resolve it by subtracting 48 as you can see in the code provided. What is the correct/more advanced way to do this exercise ? Thank you in advance!

I have a char in c#:  char foo = '2';   Now I want to get the 2 into an int.  I find that Convert.ToInt32 returns the actual decimal value of the char and not the number 2.  The following will work:  int bar = Convert.ToInt32(new string(foo, 1));   int.parse only works on strings as well.    Is there no native function in C# to go from a char to int without making it a string?  I know this is trivial but it just seems odd that there's nothing native to directly make the conversion.


Something happened with my USB flash disk and I had to format it. Every time I tried to format it, I've got: "Windows is unable to format" message.  I found a program SDFormatter and tried it. I don't know what happened after the format but every time I plug my flash memory it won't show in my computer. I have got a new driver (USB Mass Storage) installed and opened disk management and I don't see the flash memory. :(  How can I get my USB Flash Disk to start working again?

I have a 32 GB USB stick. I was in Mac (VMWare) putting some stuff on. Then accidentally removed the drive. I put it back in, and wanted to format it. Using disk utility, I chose 1 partition, it automatically filled in 312 GB and I just clicked format or whatever. It didn't take long, then I could see the progress bar hanging at "Waiting for device to reconnect". Nothing happened for a while so I ejected it. Now comes the problem:  In Disk Utility (Mac): No sign of the USB drive.  In Paragon Partition Manager (Windows): No sign of the USB drive.  In Disk Manager (Windows): I can see that it's there. But it says: Disk 1 Removable (D:) No Media. When I right click it, I can only assign drive letters to it. No way to format.  In diskpart (Windows): diskpart list will show me the following: Disk 1, Status: No Media, Total Size: 0 B. When I eject the drive, the disk 1 will disappear. So I know that it's this drive. If I type clean, it will say that "There is no media in the device".  In HDD Low Level Format Tool 4.25 (Windows): Doesn't detect it at all.  In Device Manager (Windows): It is detected as USB Mass Storage Device.  In Gparted (Linux): Doesn't detect it.  In HP USB Disk Storage Format Tool 2.1.8 (Windows): It detects device as: "GENERIC USB Mass Storage 1.00 (0 MB) (D:)". When I press Start it gives me this error: "There is no media in the specified device"  In BIOS: Detected  In Spinrite (Live Boot): Doesn't detect it  Any help is appreciated.


I've got a question about iteration in python. At the moment I am trying to build a very simple neural net, using the following (parts of the) code:  class neural_net:     def __init__(self, n_neurons, n_input):         self.n_neurons = n_neurons         self.n_input = n_input         self.input = []         self.weights = []         self.output = []       def generate_input(self):         input = [0.0,0.0,1.0]         self.input = input       def generate_random_weights(self):         weights = [[0] * self.n_input ] * (self.n_neurons)         for i in range(self.n_neurons):             for ii in range(self.n_input):                 weights[i][ii] =  round(random.random(), 1)         self.weights = weights   In the function generate_random_weights, i=0 and i=1 are always updates at the same time. The result is always something like the following when a print it, using print'weights:', self.weights:  weights: [[0.2, 0,1, 0,8], [0,2, 0,1, 0,8]]   The first and the second list are always the same: does anyone know why this happens?

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


I'm trying to access MySQL and execute multiple large queries with a "here document" in a shell script.  Running the following command works perfectly fine:  /usr/bin/mysql -u username -ppassword -h localhost database   Running this command results in an Access Denied error:  /usr/bin/mysql -u username -ppassword -h localhost database << EOF --MySQL queries here EOF   This is the error I receive:  ERROR 1045 (28000) at line 3: Access denied for user 'username'@'localhost'  With the only difference in the two methods being the << EOF, why am I all of a sudden receiving an error?

I'm currently trying to run the following command from within a shell script.  /usr/bin/mysql -u username -ppassword -h localhost database   It works perfectly fine when executed manually, and not from within a script. When I try to execute a script that contains that command, I get the following error:  ERROR 1045 (28000) at line 3: Access denied for user 'username'@'localhost' (using password: YES)   I literally copied and pasted the working command into the script. Why the error? As a sidenote: the ultimate intent is to run the script with cron.  EDIT: Here is a stripped down version of my script that I'm trying to run. You can ignore most of it up until the point where it connects to MySQL around line 19.  #!/bin/sh #Run download script to download product data cd /home/dir/Scripts/Linux /bin/sh script1.sh  #Run import script to import product data to MySQL cd /home/dir/Mysql /bin/sh script2.sh  #Download inventory stats spreadsheet and rename it cd /home/dir /usr/bin/wget http://www.url.com/file1.txt mv file1.txt sheet1.csv  #Remove existing export spreadsheet rm /tmp/sheet2.csv  #Run MySQL queries in "here document" format /usr/bin/mysql -u username -ppassword -h localhost database << EOF  --Drop old inventory stats table truncate table table_name1;  --Load new inventory stats into table Load data local infile '/home/dir/sheet1.csv' into table table_name1 fields terminated by ',' optionally enclosed by '"' lines terminated by '\r\n';  --MySQL queries to combine product data and inventory stats here  --Export combined data in spreadsheet format group by p.value into outfile '/tmp/sheet2.csv' fields terminated by ',' optionally enclosed by '"' lines terminated by '\r\n'; EOF   EDIT 2: After some more testing, the issue is with the << EOF that is at the end of the command. This is there for the "here document". When removed, the command works fine. The problem is that I need << EOF there so that the MySQL queries will run.


I am running Ubuntu16.04  Upon executing  sudo wpa_passphrase DataRoom connect@data > /etc/wpa_supplicant.conf I get bash: /etc/wpa_supplicant.conf: Permission denied  Thanks for the help

When using sudo to allow edits to files, I regularly get 'permission denied'.  For example, my mouse is jittery and sluggish, so I want to disable polling:  sudo echo "options drm_kms_helper poll=N">/etc/modprobe.d/local.conf   I'm prompted for a password, and then get:  bash: /etc/modprobe.d/local.conf: Permission denied   So I tried to do a temporary change to disable polling by using:  sudo echo N> /sys/module/drm_kms_helper/parameters/poll   Yet again the system responded with:  bash: /sys/module/drm_kms_helper/parameters/poll: Permission denied   Any ideas?


This should work, but it looks like something is missing. I have a queue class, which is defined in  queue.h  template <typename T>  class Queue{  private:     Node<T> * head;     Node<T> * tail;     int size;     int capacity;   public:      Queue(int c): capacity(c) {}    bool enqueue(T val);     bool dequeue(T & val);     bool isQueueEmpty();     bool isQueueFull();   };   and in the queue.cpp file I have   #include "queue.h"   template <typename T>  bool Queue<T>::enqueue(T val){   if(isQueueFull())     return false;   //set the new node  Node<T> * temp = new Node<T>;   temp->val = val;   if(isQueueEmpty()){    head = tail = temp;     head->next = nullptr;     head->prev = nullptr;  }  else {    temp->next = head;     temp->prev = nullptr;     // link the head to it    head->prev = temp;     //set the new node as head     head = temp;   }  size++;   return true;   }   dequeue and other functions are similarly defined within this function. Now I want to use them in my main as follows:   #include "queue.h"  int main(){   Queue<int> myQ(5);    int val;    myQ.enqueue(3);    myQ.enqueue(4);  }   when I compile it with c++11 it gives the following compilation error:    undefined reference to `Queue<int>::enqueue(int)'   Any idea why?

Quote from :     The only portable way of using templates at the moment is to implement them in header files by using inline functions.   Why is this?  (Clarification: header files are not the only portable solution. But they are the most convenient portable solution.)


The  web browser is a 64-bit-only open source project based on Firefox.  I would like to see how is the performance compared to Firefox, apparently its better.  Being new to Linux, it's a challenge when it comes to packages that are not .deb. On the official site, Waterfox  as a .tar.bz2 file. How can I install Waterfox on Lubuntu 17.04 and also add an entry for it in my menu, under Internet, alongside Firefox?

I have downloaded tar.gz files. But I don't know how to install it. How do I install this kind of file?


I deleted and later re-created the Documents folder in my home directory. It no longer appears in the Files quicklist. You can see in the screen shot below that several bookmarks are present among the home directories, but Documents is not there anymore. I can add and remove bookmarks in Nautilus and they appear and disappear from the quicklist, which is the expected behaviour.  How do I restore the original functionality such that existing default user directories (Desktop, Documents, Music, etc...) are listed in the Files quicklist along with dynamically added Nautilus bookmarks?    I know I can create a custom quicklist for Files by manually creating and editing a .desktop file ~/.local/share/applications/nautilus, but this gives me a static quicklist (which may not pick up newly added Nautilus bookmarks?).  A note about the default user directories - once deleted, re-creating them is not the same as if the originals were left in place. The new folder icons are generic (easily fixed) and an edit has to be made to ~/.config/user-dirs.dirs to restore them to Nautilus' Places menu, but I cannot figure out how to get them back in the Files quicklist.

After an update I ended up with this:    How can I add the default Files quicklist options which are not bookmarks (Documents, Downloads, Music...)  The same happened to Nautilus when I opened it, but I added the options in ~.config/user-dirs.dirs but now the Launcher icon is missing this options.


I'm trying to install windows 8 64-bit on my notebook using a genuine windows DVD but right after I select language and click on "install" it says the key is invalid even if it didn't asked me to type any key. But the 32-bit version DVD is working fine (I needed to install it to be able to use the notebook but it's 64-bit processor so I want to install 64-bit version). I also tried get a iso copy from a friend to install from USB device but I got exactly same error. How do I fix it?

I have a HP with Windows 7 installed. I want to do a clean installation of Windows 8 from a bootable DVD.   I purchased my Windows 8 32-bit core from the Microsoft store and I received my product key. I then burned the .ISO file to a blank DVD using imgburn. When I restart and change my BIOS to boot from internal CD/DVD and then boot from my internal DVD, I start the installation process.  After I pass the screen where I select the language and location, and click Install it stays there for a minute and then it says:     The product key entered does not match any of the Windows image   I did my research and learned that I need to add a PID.txt file to my source file containing the Windows 8 .ISO but the thing is: I do not know how to add files to the .ISO. The guide I researched is for a bootable USB and I am using a DVD.


I've recently started a project that's going to entail using GarageBand. I'd heard it was free, and I searched it in Spotlight. Just to clarify, I am currently running El Capitan. Lo and behold, it did not appear in Spotlight, despite having a reference to the GarageBand app in the App Store. I clicked the App Store link, and it took me to the GarageBand app page where I observed, my confusion growing by the minute, that its price was actually $4.99. I googled it and arrived at an apple site saying that GarageBand is free to all users that have used 10.10. I bought my iMac with OS X Mountain Lion and since then have updated to El Capitan. While I haven't downloaded GarageBand ever I'm pretty sure, I should still have access, no? Every other iApp is there: iPhoto, iMovie, Keynote, Pages and Numbers, so why not GarageBand? I've still got the installation apps for Mavericks and Yosemite, and I had a friend recommend I partition my drive and install Mavericks and bring GarageBand over, but I've got no clue how to do that and I've had bad experiences with downgrading OS, so I'd definitely need guidance if that's the way to go.

Everything that I have read says that iWorks/ iMovie etc should be free for Mac users after 1 September 2013.   I already bought Pages but want Numbers and iMovie. My MacBook Pro with retina is early 2015 and I am being charged.    Why is this please?


I have been trying to put side by side figures and have tried many options but couldn't get the success. I want to put 3 images as following attached image WITH CAPTIONS. If someone can help me, that would be awesome [I did try and search A LOT... Like REALLY A LOT]. Thanks.

I would like to organize 3 figures as it's shown in the figure below:    Can anyone help?


I love how you take care of the dog.   I love that you take care of the dog.      Which is correct?  If they're both correct, do they mean the same thing? What's the difference between how and that in sentences like these?

From time to time I hear sentences like this:      You know how we have pizza on Thursdays, right?   Here, how doesn't mean exactly how those guys eat pizza, it is something like "that" in this context.   So what is the difference between using how, that or just skipping the conjunction?


I've been working with Blender for one week only, after working with Maya so everything is new for me.  I tried to put a modifier on my object and I saw that it is shown differently in the viewport and render.    can I somehow fix this?

Have Blender on about 4 machines rendering animations. Just spotted on one of the machines its rendering something different from the actual scene that I have setup.    Top window shows a different set of layers objects to whats actually being rendered in the rendering window below.  In my scene contents, layers objects 1-5 are not visible, but these are the ones that look like they are being rendered.  The only thing I can assume is that perhaps it might be because I did not save the document before clicking render, but I would not have expected that behaviour (you dont need to save your word document before printing it).  Can anyone confirm why this is happening?


Probit <- glm(lfprt ~ expr + educ + age, data = data, family = binomial(link = "probit"), control = list(maxit = 50))  Keep getting an error, don't understand why the error is there. The dependent variable lfprt goes from 0:1

We have comprehensive coverage on the topic of perfect separation in logistic regression. When it happens in R we usually see two warnings:     Warning messages:   1: glm.fit: algorithm did not converge   2: glm.fit: fitted probabilities numerically 0 or 1 occurred    Is it possible that the algorithm did converge and fitted probabilities numerically 0 or 1 occurred nonetheless?


Let A be an m × n matrix that is the sum of k matrices of rank 1.  Prove that rank(A) ≤ k.  I have learned this proof the other way around (given the fact that rank(A)=k, prove that A can be written as the sum of k matrices of rank 1). But I don't know how to tackle this question.   I know that the rank is the dimension of row(A), so that the matrices with rank 1 have a basis for their row space that consists of 1 vector. In addition, each row is in the row space of the matrix.  Can somebody help me further with this?

Let $k$ and $n$ be positive integers and let $F$ be a field. For matrices $A,B \in M_{k\times n} (F)$, show that the rank of $A+B$ is no more than the sum of the ranks of $A$ and $B$ I believe this question is addressed , but to be honest I don't quite understand the explanations given. Can someone possibly help with a more detailed explanation?


I would like to place a plus sign above my voltage source in circuitikz but I just can't figure out how to do it. Any ideas?   \documentclass{article} \usepackage[free-standing-units]{siunitx} \usepackage{circuitikz}  \begin{document}  \begin{circuitikz} draw (0,0)  to [vsourcesin]  (0,2) ;  \end{circuitikz}  \end{document}   This is the solution:  \documentclass{article} \usepackage{circuitikz}  \begin{document} \begin{circuitikz} \draw (0,0) to[vsourcesin,i=$i$] (0,4); \draw (-0.3,2.6) node{$+$};  \end{circuitikz} \end{document}

I'm attempting to draw a battery (using the battery1 component) that includes positive and negative signs at the appropriate ends. A  that was answered here (using version 2.4) shows exactly what I mean:    Only, of course, I want to be using a battery1 symbol instead. So, I have my code as follows:  \usepackage[americanvoltages,fulldiodes,siunitx]{circuitikz} \begin{document} \begin{circuitikz}     \draw (0,0) to [battery1=\SI{9}{V}] (3,0)                 to [pC,v=$v_C$] (6,0); \end{circuitikz} \end{document}   And I end up with this:    Notice the lack of +/- signs (I know how circuits work so I don't need to be actually shown these signs, but for the sake of copying my class notes diagrams I want these signs to be included in my latex diagram).  In either case, I think it may have something to do with the version of Circuitikz I'm using because I'm using the latest version (I believe, 0.3.0) but in the previous question linked above, they were using 2.4 and it worked out for them.  I would really like to find a way to add +/- without having to manually add it with Tikz or something, i.e. just have it naturally part of the component without having to add nodes or extra Tikz code etc. If that's not possible, then I'll have to settle for that as a last result.   Thank you for your help!  EDIT: I should also mention that I've tried using battery1, v=$9V$ instead of battery1=\SI{9}{V} and to no avail (the +/- signs still don't show up).


I've been reading up on geodesics and metric tensors. I'm really curious about space and time-like geodesics. Just trying to get a better understanding of how the metric relates to these quantities. What would be the first step in calculating the metric based on the complete set of time and space like geodesics plus knowledge of how they change with respect to one another? Can you define a space-like geodesic in terms of a time like geodesic?

I know that the geodesics for Euclidean Space are straight lines and likewise in the absence of forces like gravity, the geodesics are straight lines. But what if you took some curved lines and tried to work backwards to determine the geometry of the space consisting of the curved geodesics. How would one go about determining the shape of this space? Would this even be a possible or useful approach?


Say I want to buy a bond that matures in 10 years, and that pays out 5% of once a year, so it has 10 payouts remaining. Say the value is 100$. Say the bond is being sold for 140$ today. I would be paid a total of 150$ (10x 5% + the 100), and put in 140$. This means that over the course of 10 years I make 10$ on an investment of 140$, which equates an annual rate of 0.69%. This is clearly terrible. Yet most of the actual bonds I can buy at my broker lead to these kinds of figures. Why would anyone buy these products given the extremely bad returns?

I was talking with my parents and they told me they have been buying 30 year  at $100 every 2 months with an interest rate of 4%. Because it is an EE bond, it does not pay a monthly coupon. So if we look at a single bond they bought, they would get $4 per year. Does it pay to buy the bond if we assume inflation is 2.5%? (I have seen a lot of equations use 2% as a moderate inflation rate. I am using 2.5% because it seem more realistic/robust)  ($4/year * 30years) + $100 = $220 future value  (1 - 0.025) ^ 30 = 46.78% buying power in 30 years  So taking the $220 of the future dollars and multiplying it by our inflation rate gives   $220 * 0.4678 = $102.93 which is a 2.93% return over 30 years, which in turn is a 0.096% (calculation -1 + (1 + 0.0293) ^ 1/30) annual rate of return on their investment which is worse than what some banks offer.   Is there something I'm missing, something I calculated wrong (like the bond value when it matures), or did I make a bad assumption? It looks like it isn't worth buying a bond unless the coupon/rate is close to double digits.  edit: As far as I know, my parents aren't using the money that is being paid out from the bond. It is sitting in an account and they plan on withdrawing the full amount when the bond matures. So every $4 they get they technically aren't reinvesting anywhere. They have never invested in the stock market besides their 401k contributions.   This question more pertains to pure bond overall return (after 30 years) vs savings vs inflation. No reinvestment for compounding.


When sieging enemy territory, what strategy is optimal? Is it best to collect all your troops in one huge stack and siege provinces one by one? Or is it more efficient to split into stacks that are as small as possible while still being sufficient to siege at all?   If you have an army that is 10x the garrison, but you are not in a hurry, is it better to siege it normally or to storm?

Is it better to split my units to siege multiple counties at once, or does a stack wear down the defenders quicker?


In Windows we can add applications/batch scripts to open automatically on startup. Is there something similar in Ubuntu, or Linux in general?

How can I make an application automatically start when I have logged in?


When user logs in with remember me checked, I create a random token using md5 for the cookie.   md5(uniqid(rand(), true));   I append users IP address to their unique user_id and hash that using bcript. (I DO NOT ADD THIS TO THE COOKIE) I store the bcript hash and random token that uses md5 along with their user id into a table. The row will have an auto increment value. The cookie contains the md5 and the auto increment value appended to it.  When the user visits the website, I take the auto increment value of the cookie to look up the md5 hash. If there is a match I hash the users IP address along with the user_id (that was stored in the table) and see if it matches the hash value stored in the same row. If it does they are logged in and I create another md5 hash for their cookie.   I know md5 isn't secure on its own, but I wondered if the extra steps I take with the brcript and IP address makes it safe, or anyone can see some massive security holes in this.   edit: I'll just add that when using Bcript for the ip and user_id, I'm using the php function password_hash that also creates a salt.

I want my website to have a checkbox that users can click so that they will not have to log in each time they visit my website. I know I will need to store a cookie on their computer to implement this, but what should be contained in that cookie?    Also, are there common mistakes to watch out for to keep this cookie from presenting a security vulnerability, which could be avoided while still giving the 'remember me' functionality?


Is there a way to get Geo location from the IP address of the user?  If user agrees, I collect Geo Location using: navigator.geolocation.getCurrentPosition()  but if the user refuses, I want to get it from the IP address although it is not accurate.

I need to somehow retrieve the client's IP address using JavaScript; no server side code, not even SSI.  However, I'm not against using a free 3rd party script/service.


When defining a double type it gives this error but the error to the ethical one when clicking the button to save  I have already made several attempts to invoke in several different types and nothing  public void save(View view){          if ( validateFields() ){             moviment = new Moviment();             String date = fieldDate.getText().toString();             Double valueRecovery = Double.parseDouble(fieldValue.getText().toString());              moviment.setValue( valueRecovery );             moviment.setCategory( fieldCategory.getText().toString() );             moviment.setDescription( fieldDescription.getText().toString() );             moviment.setDate( date );             moviment.setType( "Expense" );              Double expensA = totalExpense + valueRecovery;             expenseAt( expensA  );              moviment.save( date );              finish();           }       }   The expected output is that it is saved in the firebase but causes this error

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


I would like to rename a series of files named this way  name (10).ext name (11).ext ...   to  name_10.ext name_11.ext ...   This one-liner works:  $ for i in name\ \(* ; do echo "$i" | sed -e 's! (\([0-9]\{2\}\))!_\1!' ; done name_10.ext name_11.ext ...   But this one doesn't:  $ for i in name\ \(* ; do mv "$i" "$(echo "$i" | sed -e 's! (\([0-9]\{2\}\))!_\1!')" ; done bash: !_\1!': event not found   Why? How to avoid this?    Using  $ bash --version GNU bash, versione 4.3.48(1)-release (x86_64-pc-linux-gnu)   on Ubuntu 18.04.    While in this  a simple case with ! is shown, here a ! just inside single quotes is considered and compared to a ! inside single quotes, inside double quotes. As pointed out in the comments, Bash behaves in a different way in these two cases. This is about Bash version 4.3.48(1); this problem seems instead to be no more present in 4.4.12(1) (it is however recommended to avoid this one-liner, because the Bash version may be unknown in some cases).  As suggested in the Kusalananda answer, if the sed delimiter ! is replaced with #,  $ for i in name\ \(* ; do mv "$i" "$(echo "$i" | sed -e 's# (\([0-9]\{2\}\))#_\1#')" ; done   this problem does not arise at all.

I'm trying to use the curl command to access a http url with a exclamation mark (!) in its path. e.g:  curl -v "http://example.org/!287s87asdjh2/somepath/someresource"   the console replies with bash: ... event not found.  What is going on here? and what would be the proper syntax to escape the exclamation mark?


Q: What word should we use, if we were to describe the PRESENCE left behind, by a person after he/she leaves a place? [I have faced this exact situation a couple of times in the past few days,believe me!] (or) Can sillage be used in this situation? i.e in an abstract sense?   provide the following definition:     (noun) The degree to which a perfume's fragrance lingers in the air when worn   ‘neither scent has a very strong sillage’   (mass noun) ‘a summer fragrance with good sillage’   The term  is generally used to describe the fragrance that continues to linger after a person has walked by, but can it also be used figuratively?  If you guys think 'sillage' can be used in an abstract sense, can you please provide a few examples?  Q: Is there a word that fits the description I described above?

I read the word sometime ago and can't remember it.  the smell of the perfume of someone after he/she walks by..


I'm using Ubuntu 20.04 and during the installation process I opted for manual partitioning, and I chose to keep root and home separate. So at the end, I obtained this configuration:  650 Mb EFI partition (sdb3) 20 Gb root partition @ /  (sdb4) 10 Gb swap partition (sdb5) about 650 Gb partition (remaining free space)  @ /home (sdb6)  Now I noticed that 20 Gb could be too little for root partition as this partition is already full for 80% of his dimension, so basically I may have been wrong to reserve only 20 Gb for it. I have to say that, at the moment, I haven't particular problems with this configuration but maybe I could face them in the future. Can I resize the root partition taking some space from home partition? As I see here  I must use Gparted from liveUSB since it is not possible to modify mounted partitions, but as I explained home and root partitions aren't close to each other (there is swap partition in between). Is this a problem? NB.: There isn't free space or unallocated space on sdb. Additional informations: This is a dual boot stystem (on two different drives, win 10 is on sda). I did not mention "sdb1" and "sdb2" because before installing Ubuntu on "sdb" I chose to create (from win 10) a shared ntfs partition for both OS, here called sdb2, while sdb1 is an automatic generated partition labeled "Microsoft reserved partition"

Previously, I have installed Windows 7 on my 320 GB laptop with three partitions 173, 84 and 63 GB each. The 63 GB partition was where the Windows was installed. The rest were for file containers.  Now I changed my OS to Ubuntu 12.04 LTS. I installed Ubuntu by replacing the entire Windows 7 on the 63 GB partition. The rest of the partitions remain as an NTFS Windows partition and I can still access them both (the 173 and 84 GB partitions).  Now I want to change the two partitions of Windows into an Ubuntu format partitions plus most importantly, I want to extend the 63 GB partition to more than a 100 GB because at the moment I am running out of disk space. Whenever I try to install any application, especially using wine, it always complains for a shortage of disk space.  How do I do the extending activity before I entirely format my laptop again and lose all the important files on my partitions?


I want to get the decimal ASCII value of a string in C#, for instance:  "abc123s" would be: 97 98 99 49 50 51 115  (979899495051115) 'f1c3s1"would be:102 49 99 51 115 49or1024999511549`  I tried Convert.ToInt32 or Int.Parse but they do not result in  the desired effect.  What method can I use for this?

I want to get the ASCII value of characters in a string in C#.  If my string has the value "9quali52ty3", I want an array with the ASCII values of each of the 11 characters.  How can I get ASCII values in C#?


How can I back up my whole system and be able to restore perfectly to where I was? I have installed some nice themes and customized quite a few things (graphically) and wouldn't want to repeat this process if I need to re-install. I guess my question is, do I have to only backup the home folder or do I have to do the whole system root folder. Many topics have advised not to backup the root folder but has let me confused. I have no problem installing Ubuntu from scratch again and importing my home folder, as long as it gives me everything back in terms of the UI and custom themes etc. I am not fussed about the actual data such as Documents, Videos etc. I have alternative methods for these via cloud based solutions. Also, I have some commands in fstab but not sure this is stored in the home directory as well? My idea was to use rsync and use sudo rsync -aAXv --delete --exclude=/dev/* --exclude=/proc/*    --exclude=/sys/* --exclude=/tmp/* --exclude=/run/* --exclude=/mnt/*    --exclude=/media/* --exclude="swapfile" --exclude="lost+found"    --exclude=".cache" --exclude="Downloads" --exclude=".VirtualBoxVMs"    --exclude=".ecryptfs"  Then set up a cron to schedule this. Can you help?

No, this is not a , nor is it a solicitation on  to backup or  and only a little bit about Where to backup and When to do it.  This is basically a strategy question: what, where and when all together. "How" is not really relevant: there are tons of back-up programs out there and they all do the same basic thing: make copies of data.  But the real question is: are these back-up programs making copies of the data important to you?  How should you install&run Ubuntu while safeguarding your data?  There is no "one size fits all" when it comes to computers, Ubuntu versions or a backup strategy, therefore I've split this up into 5 basic user types with each their own answer:       (or you're running in UEFI mode!)   And as the above does not fit everyone, one for the impatient:   !    So click one of the above links and go to your user type!  P.S. If you're running a server farm and you've read this question so far, I'm sorry: this is about a single PC, not a network, nor a server farm.


Are there any methods that one could utilize to make Random Forest more interpretable? Random Forest performs much better than CART but it is a lot less interpretable.

Random forests are considered to be black boxes, but recently I was thinking what knowledge can be obtained from a random forest?  The most obvious thing is the importance of the variables, in the simplest variant it can be done just by calculating the number of occurrences of a variable. The second thing I was thinking about are interactions. I think that if the number of trees is sufficiently large then the number of occurrences of pairs of variables can be tested (something like chi square independence).  The third thing are nonlinearities of variables. My first idea was just to look at a chart of a variable  Vs score, but I'm not sure yet whether it makes any sense.    Added 23.01.2012 Motivation    I want to use this knowledge to improve a logit model. I think (or at least I hope) that it is possible to find interactions and nonlinearities that were overlooked.


I just found  where people talk in  language (but using the English alphabets*). It is acceptable? I am asking because AFAIK anyone can read chat rooms (if (s)he does not have permission to chat). Also, they talk about some  as well as some .  * I am talking for this room only. Actual Gujarati Language has it's own ). So don't try to translate! :-)

Is there any restriction as to what languages are allowed in SE chat rooms? I have seen many people speak in German, Russian or French in the  chat room, but whenever I speak in Persian (to a friend who understands me), some people start nagging that I should only speak in English! In a recent case, one of my chat messages was removed by a moderator because somebody flagged it as non-English! Is there really any rule that restricts the spoken languages in chat rooms? If not, based on what rule was my message removed by a moderator?


I have a weird problem with \makeindex that I cannot resolve. Here is a minimal example:  \documentclass[12pt,letterpaper,twoside]{memoir} \newcommand{\defn}{\textit} \begin{document}  Autopoiesis, developed by Humberto  Maturana\footnote{H. R. Maturana and F. Varela (1973)  \textit{De M\'aquinas y Seres Vivos}\index{maqui@\textit{M\'aquinas y Seres Vivos, de}}, Editorial Universitaria, Santiago, Chile.\label{maq}}\footnote{H. R. Maturana and F. Varela (1980) \textit{Autopoiesis and Cognition: the Realisation of the Living}  \index{AutopoiesisAnd@\textit{Autopoiesis and Cognition}}  D. Reidel Publishing Company, Dordrecht.\label{cogn}}   \textit{Autopoiesis and Cognition: the Realisation of the Living}\footref{cogn}  \index{AutopoiesisAnd@\textit{Autopoiesis and Cognition}} are the original sources for Humberto Maturana and Francisco Varela's autopoiesis.  \printindex \end{document}   Both book titles appear twice in the index, even though I copied and pasted the \index entries. In the full example they are on different pages, but in the minimal example they are both on p. 1, but that doesn't stop them appearing twice. This does NOT happen with similar cases in the complete example.  The idx file looks like this:  \indexentry{maqui@\textit{M\'aquinas y Seres Vivos, de}}{1} \indexentry{AutopoiesisAnd@\textit{Autopoiesis and Cognition}}{1} \indexentry{maqui@\textit  {M\'aquinas y Seres Vivos, de}}{1} \indexentry{AutopoiesisAnd@\textit  {Autopoiesis and Cognition}}{1}   In the third and fourth there is whitespace after \textit{, but in the first and second there isn't.

Dear all I think I have a problem with the collation of makeidx.  following some suggestions found here I have got in the text something like this  \index[p]{Plutarco!demalignitate@\textit{De Malignitate Herodoti}!00855 @855A|qt}  \index[p]{Plutarco!demalignitate@\textit{De Malignitate Herodoti}!00868 @868f-869b|nn{\thefootnote}}   the first is an \index entry in the text, the second in a footnote. My problem is that even if I put the sort also on the second level of indexing it keeps keeping them separated.  I use this package information  \usepackage[splitindex]{imakeidx} \makeindex[name=n, title=Nomi di persone e luoghi]  \makeindex[name=p, title=Passi citati nel testo] \makeindex[name=t, title=Altri testi citati] \makeindex[name=pap, title=Papiri e manoscritti citati nel testo]  \newcommand{\nn}[2]{#2 \textit{n}#1} \newcommand{\qt}[1]{\textbf{#1}}   in the .idx file I get this  \indexentry{Plutarco!demalignitate@\textit{De Malignitate Herodoti}!00855 @855A|hyperindexformat{\qt}}{8}  \indexentry{Plutarco!demalignitate@\textit  {De Malignitate Herodoti}!00868 @868 b-c|hyperindexformat{\nn{33}}}{10}   can somebody advise me on what I am doing wrong here, please? I have tried to use \string after the first sort with no effect.    sure, sorry: this is the file I'm using  \documentclass[12pt,a4paper]{book} \usepackage[utf8x]{inputenx}  \usepackage{palatino}        \usepackage[LGR,T1]{fontenc} \usepackage[english,german,polutonikogreek,italian]{babel}  \usepackage[splitindex]{imakeidx} \makeindex[name=p, title=Passi citati nel testo,columns=1] \newcommand{\nn}[2]{#2 \textit{n}#1} \newcommand{\qt}[1]{\textbf{#1}} \usepackage[hidelinks]{hyperref} \begin{document}  (855A\index[p]{Plutarco!demalignitate@\textit{De Malignitate Herodoti}!00855 @855A|qt})% \footnote{DHM 868 B-C\index[p]{Plutarco!demalignitate@\textit{De Malignitate Herodoti}!00868 @868 b-c|nn{\thefootnote}}} \printindex[p] \end{document}


Having a problem dividing two double number types. I'm after exact values so rounding is not really desirable. I have a UI field where data is pulled represented by the 'value' variable, and dividing it by another value to get an exact percentage. The first line is what I intend to use the rest the debug output I was experimenting with. The correct answer is 0.109* and I can only seem to get the correct answer when assigning the values directly and not from variable assignment. data.used = (value.text.toString().toDouble() / data.value) var n1: Double = value.text.toString().toDouble() var d1: Double = data.value var n: Double = 120.0 var d: Double = 1100.0 Log.d("TEST", "n1($n1)/d1($d1) = ${n1/d1} ") Log.d("TEST", "n1($n1)/d1($d1) = ${n1.div(d1)} ") Log.d("TEST", "n($n)/d($d) = ${n/d} ") Log.d("TEST", "n1($n1)/d($d) = ${n1/d} ")  This is the logcat output:  D/TEST: n1(120.0)/d1(1110.0) = 0.10810810810810811   D/TEST: n1(120.0)/d1(1110.0) = 0.10810810810810811   D/TEST: n(120.0)/d(1100.0) = 0.10909090909090909   D/TEST: n1(120.0)/d(1100.0) = 0.10909090909090909  It appears the value coming from the a class is the culprit. I cannot use the data.value member through reassignment or otherwise. Any idea why this is happening?

Consider the following code:   0.1 + 0.2 == 0.3  ->  false   0.1 + 0.2         ->  0.30000000000000004   Why do these inaccuracies happen?


I found the strangest thing  sudo cd $pwd sudo: cd: command not found   I am able to cd as a normal user.It seems that PATH is not set properly for su.  How do I fix that?

I want to cd into /var/named but it gives me a permission denied error, and when I want to use sudo to do this I am not permitted. What is the technical reason for this, and is it possible to do this some other way?


My code:  var string = "I put putty on the computer. putty, PUT do I"  var uniques = {};  var result = (string.match(/\b\w*put\w*\b/ig) || []).filter(function(item) {    item = item.toLowerCase();    return uniques[item] ? false : (uniques[item] = true); });  document.write( result.join(", ") );   Here i want pass a variable inside the expression    here i have pass a value 'put' and get answer. But i have to use variable for this value.  I have tried   string.match(/\b\w*{+put+}\w*\b/ig  Can you share your answers

I would like to create a String.replaceAll() method in JavaScript and I'm thinking that using a regex would be most terse way to do it.  However, I can't figure out how to pass a variable in to a regex.  I can do this already which will replace all the instances of "B" with "A".  "ABABAB".replace(/B/g, "A");   But I want to do something like this:  String.prototype.replaceAll = function(replaceThis, withThis) {     this.replace(/replaceThis/g, withThis); };   But obviously this will only replace the text "replaceThis"...so how do I pass this variable in to my regex string?


What if my iPad didn't turn on after battery drain? I did all the steps but it still didn't work. Is it already damaged or can I recover it on an Apple Store?

My iPad mini retina is out of warranty,  I forgot to plug in my iPad after the critical battery warning and it went some minutes following the warning. I was not worried because same thing had happened a few times before and iPad was perfectly okay after charging it. However, this time I remember seeing a flash of blue screen immediately after it went black. Then, I plugged it in an waited for a while and tried starting it. Ever since, it fails to start hanging on the apple logo with white background screen.   I tried to connect to my Mac but nothing showed up in iTunes. I am worried now. Can I troubleshoot this or is it broken and needing repair?


Is $\tan^{-1}2$ an irrational number or a rational number? How to show that?   Or generally how to show $\tan^{-1}3, \tan^{-1}4, \tan^{-1}5...$ is irrational or rational?

Question : Show that $\arctan(n)$ is irrational for all $n \in \mathbb{N}$.  Hint:  My solution doesn't use continued fraction.     I am interested in other possible proofs for this question.


I am attempting to analyse pre-existing data (using SPSS). I have one group of participants, 4 quantitative, non-parametric outcome measures, and am looking to see if there is a change in outcomes post intervention. I also have qualitative outcomes, but am not worrying about them yet! I understand that t-tests (and the non-parametric equivalents) can be used for comparing several groups (i.e. if I had a control group as well), but don't know what to do with my single group of participants.

Imagine the following common design:   100 participants are randomly allocated to either a treatment or a control group the dependent variable is numeric and measured pre- and post- treatment   Three obvious options for analysing such data are:   Test the group by time interaction effect in mixed ANOVA Do an ANCOVA with condition as the IV and the pre- measure as the covariate and post measure as the DV Do a t-test with condition as the IV and pre-post change scores as the DV   Question:    What is the best way to analyse such data?  Are there reasons to prefer one approach over another?


I was wondering if anyone has done this before. I was planning on installing a second hard drive in my computer and was wondering if i could install Ubuntu seperate on that drive and not the Windows 7 drive. I would think that you should be able to unplug the Win7 hard drive and just have the separate one plugged in. I dont want to partition the Win7 drive because I will probably use up the rest of the space on it in no time at all. I was wondering if anyone has any help on this.

I have two hard drives. One is used for Windows and one is empty. I want to install Ubuntu on the empty hard drive. The Windows hard drive is disk0 in Windows and the empty hard drive is disk1. When I install Ubuntu and it asks where I want to install it, I choose "Something Else" but I am stuck there. What do I choose for "boot loader installation"?


Hold on, so Daniel found the seventh glyph, right? So, why did they do chevron 1-6 like they already tried before. I saw that they knew what they were doing, so why is the seventh chevron a mystery? Did they dial Abydos with all of the glyphs and succeeded or Daniel just told them the way to Abydos, using the Orion as an example.

From what I recall from the movie, Daniel only finds the seventh symbol... however when he explain they give way to show him the star gate and they put their sequence in the dialing computer. This proves the dialing computer was prepared to dial 7 chevrons.  It’s also stated they’ve also tested the 6 previous symbols in the order they appear on before, one has to assume only to fail when they insert the 7th, making them aware of the fact you can, at least dial 7th chevrons.  With 39 chevrons on the gate and 6 already locked in, that leaves 33 to try to get a lock. Those are not that many not to go and simply try one by one so... how come nobody brute forced the thing?


I was familiarizing myself with how PostgreSQL (9.6) role management works and ran into a case that seemed to go against my understanding of the documentation.  I have an RDS instance and a master user with the rds_superuser role.  I used this role to create a "group" role called 'readwritegroup'. This role has NOLOGIN and CREATEDB granted to it so that anyone who is added to the group may inherit those permissions but cannot actually be used to do things on.  Using my master user I created a database and a new schema inside of it.  I granted CREATE and USAGE on the schema to the 'readwritegroup" role.  I then created and added 2 separate users to the 'readwritegroup' with only INHERIT as their grants.    I then used the master user to run the following on the schema:  ALTER DEFAULT PRIVILEGES IN SCHEMA test GRANT ALL PRIVILEGES ON TABLES TO "readwritegroup";   Using these two users I successfully created 1 table for each user and then attempted to SELECT from each user's table using the other user. So they are the owner of their respective tables. They are unable to see each other's tables however. (permission denied)  In fact, even my master user is unable to GRANT any permissions on the tables that they own (though I can change the ownership to my master user).  Is there any way to circumvent the authority of object ownership?  I don't really understand why the ALTER DEFAULT PRIVILEGES bit does not correctly modify the behavior to allow other users in the group to SELECT (or whatever grants are used).

I want to migrate a fairly simple, internal, database driven application from SQLite3 to PostgreSQL 9.3 and tighten the permissions in the DB as I go.  The application currently consists of a command to update the data; and one to query it. Naturally, I'll also need to maintain the database in other ways (create new tables, views, triggers, etc).  While this application will be the only one hosted on the server at first, I'd prefer to bake in the assumption that it might be hosted on a server with other databases in the future, rather than having to scramble later if that becomes necessary in the future.  I would think that these would be a fairly common set of requirements, but I'm having trouble finding a simple tutorial explaining how to set up a new database in PostgreSQL, with this sort of user/privilege separation. The references go on at length about groups, users, roles, databases, schemas and domain; but I find them confusing.  Here's what I've tried so far (from within psql as 'postgres'):  CREATE DATABASE hostdb; REVOKE ALL ON DATABASE hostdb FROM public; \connect hostdb CREATE SCHEMA hostdb; CREATE USER hostdb_admin WITH PASSWORD 'youwish'; CREATE USER hostdb_mgr   WITH PASSWORD 'youwish2'; CREATE USER hostdb_usr WITH PASSWORD 'youwish3';  GRANT ALL PRIVILEGES ON DATABASE hostdb TO hostdb_admin; GRANT CONNECT ON DATABASE hostdb TO hostdb_mgr, hostdb_usr; ALTER DEFAULT PRIVILEGES IN SCHEMA hostdb GRANT SELECT, INSERT, UPDATE, DELETE ON TABLES TO hostdb_mgr; ALTER DEFAULT PRIVILEGES IN SCHEMA hostdb GRANT SELECT ON TABLES TO hostdb_usr;   But I'm not getting the intended semantics. I want to have it configured so only the hostdb_admin can create (and drop and alter) tables; the hostdb_mgr can read, insert, update and delete on all tables by default; and the hostdb_usr can only read all tables (and views).  When I tried this I found that I was able to create tables in hostdb as any of these users; but, for each user, I could only read or modify tables created by that user - unless I use an explicit GRANT.  I'm guessing that there's something missing between CREATE DATABASE and CREATE SCHEMA, something to apply the SCHEMA to the DATABASE?  (As things get more advanced I'll also have questions to apply similar restrictions on TRIGGERS, stored procedures, VIEWS and perhaps other objects).  Where can I find a decent guide, tutorial or video series on this?


I'm using the gmail web interface, and I've happened to read an online mailing list archive. I want to reply to a specific message of a user, and I already know its message-id.   To make my reply be in the correct thread, I found I need to to set the in-reply-to header to the message-id of that mail I want to reply to.   Is that possible with gmail? Is it possible with any email program that has a modern GUI?

I'm interested in doing this to add an "Approved:" header to a Mailman announcements-only list ().


Is there a way to know from the command line of a standard LINUX distro (or by installing some tool), whether hyperthreading is enabled in the BIOS of a given machine ?

How can I check if hyperthreading is enabled on a Linux machine, using a perl script to check for it?  I'm trying the following way:  dmidecode -t processor | grep HTT   Let me know if I'm on right track.


Updated the files and I still get the following errors.   1 Unresolved externals (lab12.exe line 1) unresolved external symbol "public char__thiscall Pair::geetFirst(void)" (?getFirst@?$Pair@D@@QAEDXZ) referenced in function_main (lab12.obj line 1)   Pair.h  #pragma once template <class T> class Pair {  private:     T theFirst;     T theSecond;  public:     /*Pair(const T& dataOne, const T& dataTwo);*/     Pair(T a, T b) {         theFirst = a;         theSecond = b;     }     T getFirst();     T getSecond();  };   Pair.cpp  #include "stdafx.h" #include "Pair.h"   template<class T> T Pair<T>::getFirst() {     return theFirst; }  template<class T> T Pair<T>::getSecond() {     return theSecond; }   Main.cpp  #include "stdafx.h" #include "Pair.h" #include <iostream> using namespace std;  int main() {     Pair <char> letters('a', 'd');      cout << letters.getFirst();       cout << endl;     system("Pause");      return 0; }

Quote from :     The only portable way of using templates at the moment is to implement them in header files by using inline functions.   Why is this?  (Clarification: header files are not the only portable solution. But they are the most convenient portable solution.)


I'm having trouble with proving the following:  Let $H \subset G$ be a subgroup with finite index $n = [G:H]$ Prove: $H$ is a normal subgroup of $G$ $\Rightarrow g^{n} \in H$ $\forall$ $g \in G$   So far, I've done this:  $H$ is a normal subgroup of $G$ $\Rightarrow ghg^{-1} \in H$ $(g \in G, h \in H)$ $\Rightarrow \exists$ $ h' \in H$ such that $ghg^{-1} = h'$  I think I have to use the index now, but I don't know how to complete this prove. Could you help me completing it? Thanks in advance!

I am having a lot of trouble understanding the solution to this problem.   $(gH)^n = g^nH \implies g^n \in H$  Why does $H^n$ just turn into the identity? I am very confused, any help is appreciated.


I have surprisingly never understood the purpose of doing this:  Map telephoneNumbers = new HashMap(); List<Object> list = new ArrayList<Object>();   instead of doing this:  HashMap telephoneNumbers = new HashMap(); ArrayList<Object> list = new ArrayList<Object>();   ?

I have seen this mentioned a few times and I am not clear on what it means. When and why would you do this?   I know what interfaces do, but the fact I am not clear on this makes me think I am missing out on using them correctly.   Is it just so if you were to do:  IInterface classRef = new ObjectWhatever()   You could use any class that implements IInterface? When would you need to do that? The only thing I can think of is if you have a method and you are unsure of what object will be passed except for it implementing IInterface. I cannot think how often you would need to do that.   Also, how could you write a method that takes in an object that implements an interface? Is that possible?


Is there a way to convert a symbol style set for ArcGIS for use in QGIS?    There are symbols used in Incident Command I would like to use in QGIS, but can only find a style set for use in ArcGIS.  The style set I have is saved as a .style file.

I have downloaded a dataset from a government organisation. it comes with a .style file.  I use QGIS 1.8 on windows 7.    Is there a way to use the .style file as a qml or sld? I have tried simply changing the extension but to no avail.


I have the following results  $ sudo apt-get install -f Reading package lists... Done Building dependency tree        Reading state information... Done The following packages will be REMOVED:   mysql-server-5.7 0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. 1 not fully installed or removed. After this operation, 48.3 MB disk space will be freed. Do you want to continue? [Y/n] Y (Reading database ... 230940 files and directories currently installed.) Removing mysql-server-5.7 (5.7.20-0ubuntu0.16.04.1) ... update-alternatives: error: /var/lib/dpkg/alternatives/my.cnf corrupt: invalid status dpkg: error processing package mysql-server-5.7 (--remove):  subprocess installed post-removal script returned error exit status 2 Errors were encountered while processing:  mysql-server-5.7 E: Sub-process /usr/bin/dpkg returned an error code (1)  $ sudo apt-get --purge remove mysql-server Reading package lists... Done Building dependency tree        Reading state information... Done Package 'mysql-server' is not installed, so not removed The following packages will be REMOVED:   mysql-server-5.7 0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. 1 not fully installed or removed. After this operation, 48.3 MB disk space will be freed. Do you want to continue? [Y/n] Y (Reading database ... 230940 files and directories currently installed.) Removing mysql-server-5.7 (5.7.20-0ubuntu0.16.04.1) ... update-alternatives: error: /var/lib/dpkg/alternatives/my.cnf corrupt: invalid status dpkg: error processing package mysql-server-5.7 (--remove):  subprocess installed post-removal script returned error exit status 2 Errors were encountered while processing:  mysql-server-5.7 E: Sub-process /usr/bin/dpkg returned an error code (1)  $ sudo apt-get --purge remove mysql-server-5.7 Reading package lists... Done Building dependency tree        Reading state information... Done The following packages will be REMOVED:   mysql-server-5.7 0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. 1 not fully installed or removed. After this operation, 48.3 MB disk space will be freed. Do you want to continue? [Y/n] Y (Reading database ... 230940 files and directories currently installed.) Removing mysql-server-5.7 (5.7.20-0ubuntu0.16.04.1) ... update-alternatives: error: /var/lib/dpkg/alternatives/my.cnf corrupt: invalid status dpkg: error processing package mysql-server-5.7 (--remove):  subprocess installed post-removal script returned error exit status 2 Errors were encountered while processing:  mysql-server-5.7 E: Sub-process /usr/bin/dpkg returned an error code (1)   How can I solve this?

I'm running in circles currently, trying to fix some mysql problem.  I couldn't use apt-get for a while now, because it always stuck at the line Setting up mysql-server-5.6 (5.6.27-0ubuntu0.15.04.1) ... and didn't let me do anything. So I tried to reinstall mysql, purging it. While I was able to remove mysql-server and mysql-client eventually, I'm still unable to purge mysql-common. Obviously, I managed to corrupt something, but how can I get my system back and running at this point?  ...:~# apt-get purge mysql-common Reading package lists... Done Building dependency tree        Reading state information... Done The following packages will be REMOVED:   mysql-common* 0 upgraded, 0 newly installed, 1 to remove and 5 not upgraded. After this operation, 0 B of additional disk space will be used. Do you want to continue? [Y/n] Y (Reading database ... 423600 files and directories currently installed.) Removing mysql-common (5.6.27-0ubuntu0.15.04.1) ... Purging configuration files for mysql-common (5.6.27-0ubuntu0.15.04.1) ... update-alternatives: error: /var/lib/dpkg/alternatives/my.cnf corrupt: invalid status dpkg: error processing package mysql-common (--purge):  subprocess installed post-removal script returned error exit status 2 Errors were encountered while processing:  mysql-common E: Sub-process /usr/bin/dpkg returned an error code (1)   -  ...# sudo dpkg -P --force-all mysql-common (Reading database ... 424733 files and directories currently installed.) Removing mysql-common (5.6.27-0ubuntu0.15.04.1) ... Purging configuration files for mysql-common (5.6.27-0ubuntu0.15.04.1) ... update-alternatives: error: no alternatives for my.cnf dpkg: error processing package mysql-common (--purge):  subprocess installed post-removal script returned error exit status 2 Errors were encountered while processing:  mysql-common   -  ...:~# lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description:    Ubuntu 15.04 Release:    15.04 Codename:   vivid   My goal is to just get it back and running again (mysql).


I have Below Query From Parent Id to child, but getting the below error. Please help me out with this one.  Query  Select id,        (Select id,Type__c,Document_Attached__c,Opportunity__c from Top_X_Designation__r),         Handoff_Attached__c  from Opportunity   Error I am getting     Document_Attached__c,Opportunity__c from Top_X_Designation__r),                                            ^   ERROR at Row:1:Column:71   Didn't understand relationship 'Top_X_Designation__r' in FROM part of query call. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.   Both the object Opportunity(Parent) Top_X_Designation__c(Child) having Lookup relationship.

I'm using a SOQL to query the lookup relationships.  Primary Object: Opportunity  Secondary Object: Purchase__c.  From purchase__c we have a lookup to opportunity.  Field Name: Opportunity__c  Child Relationship Name: Purchases2  SOQL query:  for (Opportunity opp : [select Id, Name, (select id from Purchases2__r where Count__c>0) from Opportunity where Id IN :oppIds])    whats wrong with my query? getting error below:     If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name.


I'm getting a NullPointerException when trying to add a new instance of a Block class to an ArrayList called blocks.  Here is the code snippet containing the line of error:  public class Level1State extends GameState {      private Player player;     private ArrayList<Block> blocks;      public Level1State(GameStateManager gsm) {         super(gsm);         this.blocks = new ArrayList<Block>();     }      @Override     public void init() {         player = new Player(30, 30);          blocks.add(new Block(500, 400));     }     ... }   And the Block class is very simple:  public class Block extends Rectangle {     private static final long serialVersionUID = 1L;      public static final int blockSize = 64;      public Block(int x, int y) {         setBounds(x,y,blockSize,blockSize);     }      public void tick() {      }      public void draw(Graphics g) {         g.setColor(Color.DARK_GRAY);         g.fillRect(x - (int) GameState.xOffset, y - (int) GameState.yOffset,                 width,                 height);     } }   Any help is appreciated.

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


Does someone know what I'm doing wrong? I'm struggling with this for a while now and I don't see what I do wrong!  $$1+1=$$ $$1+\sqrt{1}=$$ $$1+\sqrt{-1*-1}=$$ $$1+\sqrt{-1}*\sqrt{-1}=$$ $$1+i*i=$$ $$1-1=0$$

We know $$i^2=-1 $$then why does this happen? $$ i^2 = \sqrt{-1}\times\sqrt{-1} $$ $$ =\sqrt{-1\times-1} $$ $$ =\sqrt{1} $$ $$ = 1 $$  EDIT: I see this has been dealt with before but at least with  I'm not making the fundamental mistake of assuming an incorrect definition of $i^2$.


My credit card on file expired and I will not be replacing it.  I selected the "None" payment option as per this .  However, none of the apps (all free apps) will update anymore as it reports a billing problem.  I have:   Checked all devices on my account and confirmed they only have free apps Never used subscriptions of any sort   How can I get iOS to once again update my apps?    It'd be nice to identify whatever the billing issue is and get it corrected (as there shouldn't be any billing going on whatsoever).  The biggest thing is though, apps (even though they're free!) won't update.

I haven't been installing anything on my iPad Mini for the past few weeks. But previously, I just had to tap on "Install", enter my Apple ID password and go.  Now, for every new application, even those free ones, I have to confirm each time, that I'm 17 or over. And then App Store asks to enter my credit card information. If I disagree and hit "Cancel", installation process is interrupted and I can't install any application, even free one.  I don't trust Apple at all and I'm not willing to share my credit card information, especially that I'm installing only free applications.  I'm pretty sure that I haven't changed anything in the configuration of my iPad Mini for ages.   Am I missing some significant change to the App Store or this is some kind of bug or virus? Is there anything I can do in this situation? How can I install a free application from the App Store, without having to share my credit card information with Apple?


It is stated that any symmetric function can be expressed in terms of the elementary symmetric polynomials. I am trying to do that for the following generating function:  \begin{equation} \prod_{1 \leq i<j \leq k} (x_{i} + x_{j}). \end{equation}  I can't quite seem to find a way to do this in general. I can see some kind of pattern though, involving the monomial symmetric functions, which are  \begin{equation} m_{(1,2)} = x_1 x_2^2 + x_1^2 x_2, \end{equation} and similarly for any $k$. The subscripted values in $m$ can be any integer.   I've shown that this can be done for the cases $k=1,2$ in which cases we get  \begin{equation} \prod_{1 \leq i<j \leq 2} (x_{i} + x_{j}) = (x_1 + x_2) = \frac{m_{(1,2)}}{\sigma_2^{(2)}}, \end{equation} \begin{equation} \prod_{1 \leq i<j \leq 3} (x_{i} + x_{j}) = \frac{m_{(1,2,3)}}{\sigma_3^{(3)}} + 2 \sigma_3^{(3)}, \end{equation} and for $k=4$ I get something in the form of \begin{equation} \prod_{1 \leq i<j \leq 4} (x_{i} + x_{j}) = \frac{m_{(1,2,3,4)}}{\sigma_4^{(4)}} + ?, \end{equation} which I cannot work out, at least not easily, though I will do the tedious calculation. (Is there a way to employ the monomial symmetric functions in mathematica somehow?)  Main question, is there already a known decomposition to this generating function? If so, what is it? If not, how should I go about making one? Or at least being able to determine it for values up to $k=6$.

Exercise: Define a polynomial $\Sigma(X_1,\ldots,X_n)$ as \begin{align*} \Sigma(X_1,\ldots,X_n) = \prod_{i < j} (X_i+X_j) \end{align*} This is a symmetric polynomial, quite clearly. I want to express $\Sigma$ as a polynomial in the elementary symmetric functions, for $n=2,3,4$. Case $n=2$ is trivial: $\Sigma(X_1,X_2)= \sigma_1 = X_1+X_2$. Case $n=3$ is easy. I write $\Sigma$ as follows: \begin{align*} \Sigma(X_1,X_2,X_3) = (\sigma_1 - X_1)(\sigma_1 - X_2)(\sigma_1 - X_3), \end{align*} then apply  formally, obtaining \begin{align*} \Sigma(X_1,X_2,X_3) = \sigma_1^3 - \sigma_1 \sigma_1^2 + \sigma_2 \sigma_1 - \sigma_3 = \sigma_2 \sigma_1 - \sigma_3. \end{align*} The case $n=4$ seems harder to me, and I'm unable to work it out. I hope there is some trick to avoid unnecessary computations. My attempt is to write down $\Sigma$ completely: \begin{align*} \Sigma = (X_1+X_2)(X_3+X_4)(X_1+X_4)(X_2+X_3)(X_2+X_4)(X_1+X_3) \end{align*} and then multiply factors in groups of two, obtaining: \begin{align*} \Sigma = (\sigma_2 - X_1X_2-X_3X_4)(\sigma_2 - X_1X_4 - X_2X_3)(\sigma_2 - X_2X_4-X_1X_3), \end{align*} but it doesn't seem to help much. How can I solve the exercise?


If I have one shape of buffers, How to count the number of times, the different buffers (in the same layer) intersect each other.

For my thesis I'm modeling the identification of recreation areas.  Therefore, there has been a survey where people were asked to specify where they recreate. They had to indicate this place on a map and give a radius. Now I have to analyse which areas were most visited, and afterwards use the data to give a weighted rating with the travel distance.  So, I use QGIS to Buffer the data points by using the given radius. Now, I want to calculate for every point in the country how many times it was visited.  Any thoughts how to do this in QGIS?


Is there a way to "record" the display of a camera instead of rendering it on screen?  For example, if I want to stream a camera's frame block to an external application.

I'm making a PC Horror game in Unity, and I want to have a camera recording simulation in-game - so you can leave a creepy location anytime, and you will have a tape with what you recorded on camera while exploring. Technically, I need to attach a second camera (hand-cam) to the character's hand, and let the player look through the viewfinder by pushing a button. But in any position, the hand-cam must record everything that is in its focus at that point - floor, stairs, rubbish, etc, whether it's lowered at hand level or raised to match the player's viewpoint. When the game ends (player leaves or dies), I'd like to have an option to save recorded tapes to a video file (if this is not possible, then to some save file). How can I implement such a feature in my game? Are there some special Unity tricks, or add-ons and additional modules? Saving decorations and scenes with active triggers, or just grabbing video from screen? Below is a quick MSPaint concept of what I mean:


I've just unsuccessfully tried to use ogr2ogr to convert CSV into KML like so:  ogr2ogr -f "KML" output.kml input.csv   The csv has "latitude" and "longitude" columns.  The attributes are all loaded but if you inspect the KML's text, the Coordinate elements are not being added so its not working.  I feel like this will work if I can inform gdal to interpret certain columns ("latitude", "longitude") as coordinates.   How might I do this?

I am attempting to get a nice KML for simple review of POI/geocoding from a CSV. I a using ogr2ogr and a VRT. You can see the VRT file below, with two attempts to get this right.  Basically, the issue is using ogr2ogr -f KML ... with the VRT w/o renaming results in a lot of "SimpleData" tags in the KML.   I'd like to get some CSV fields as the KML Placemark "Name" and "Description", concatenated fields, actually. -dsco NameField=RegionName option in ogr2ogr, but I don't see a way to concatenate fields into name, e.g Street, City, State..  In the .vrt below, the SrcSQL field results in no records. It does open, but with layer info. The Field tag (when not commented out) does result all records with in the new alias, but the "name" is the only field that comes through, it drops all other fields.  Is there a way to concatenate fields using ?  Of course, perhaps ogr is not capable of concatenation ...  <OGRVRTDataSource>     <OGRVRTLayer name="roofing-poi2">         <SrcDataSource>roofing-poi2.csv</SrcDataSource>         <GeometryType>wkbPoint</GeometryType>         <LayerSRS>WGS84</LayerSRS>         <GeometryField encoding="PointFromColumns" x="Longitude" y="Latitude"/> <!--         <Field src="StreetAddress" name="name" /> -->         <SrcSQL>SELECT StreetAddress as name</SrcSQL>     </OGRVRTLayer> </OGRVRTDataSource>


To obtain the golden basic cards for a specific class I need to level the class, but what do I have to do to obtain golden versions of basic cards that are not class specific, since they cannot be crafted with dust?

As you level up a hero in Hearthstone you earn gold versions of that hero's basic cards. For example the Druid earns a gold copy of Healing Touch at levels 15 and 20.      What gold cards do heroes earn at which levels?


Even in writing this question, I have been deeply embarrassed : should I capitalize some words ?  Although not a believer myself, I wish to perturb nobody, whatever his / her faith could be : my position is "as long as they are happy with their creed, and don't try to convert anyone by force, should they have gained enough power for it, it's all the best for everyone, why should I bother ?".  The problem arises when I have to address several persons of different or unknown creeds : some have specific names, some others resent as a blasphemy to even mention a name. And I heard that there are 700 different Christian denominations in the USA alone, and how many rules apply, with all the non-Christian others ? And lately, that the word used by Muslims should not be used by any non-Muslim ...  In the USA, "in God we trust" is written even on more or less dirty banknotes ; in the UK, you utter the word only in church or for taking an oath. In French "Dieu sait où il est !" means "Nobody knows where he is is", it's absolutely innocent, an atheist could say that, just a way of speaking. Try to translate this word by word ! Some eyebrows would raise.  Have you a global, general solution ? Thank you.

Aside from proper noun usage, like "We're on a mission from God", when should "God" be capitalized? A few examples:   That's a god awful question. Oh my god! No god-damn way. He played the part of the cannibal god   It occurs to me that whenever used for decisive emphasis, by referencing deity, it is effectively functioning as a proper noun as well? For comparison:   That's a really awful question. Oh my stars! (no viable equivalent) He played the part of the cannibal chief   PLEASE, no rants or tangents. This is a grammar question.


I'm trying to get translation from web dictionary. Here is a piece of Json which I want to parse using JsonNode.  { "result" : "ok", "tuc" : [ { "phrase" : {   "text" : "powitanie",   "language" : "pl" }         and java code:   try {          JsonNode node = translationMapper.readTree(jsonContent);         String result = node.get("result").asText();         System.out.println("result: " + result);         JsonNode tuc = node.get("tuc").get(0);         JsonNode phrase = tuc.get("phrase").get(0);         String textPhrase = phrase.get("text").asText();         System.out.println("translation: " + textPhrase);      }      catch (IOException e) {         e.printStackTrace();     }   output:  result: ok  Exception in thread "main" java.lang.NullPointerException at Requests.main(Requests.java:63)  line 63 is:  String textPhrase = phrase.get("text").asText();

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


I set an object equal to the other that invokes the copy constructor. My problem is when I test if the two are equal to another my output says that they are not. One method is through an overloaded constructor and the other is from a copy constructor that both output the same thing.  public class HotDogClass {      private int standNumber; // ID number for hotdog stand     private  int soldToday; //dogs each stand sold     private static int totalSales;      public void setstandNumber (int newstandNumber ) { standNumber =      newstandNumber; }     public int getstandNumber ( ) { return standNumber; }     public int getsoldToday() { return soldToday; }     public void setsoldToday ( int st ) { soldToday = st;         if (soldToday <= 0)          System.out.println("no hotdogs sold");}     public static int gettotalSales ( ) { return totalSales; }       static  {         totalSales=0;         System.out.println("Static initializer block\n" );     }     public HotDogClass () {          this ( 0, 0);         System.out.println("Default constructor");     }      public HotDogClass (int sta, int st) {         standNumber = sta;         soldToday = st;         totalSales += soldToday;         System.out.println("overloaded contructor");     }     public HotDogClass (HotDogClass original) {         this.standNumber = original.standNumber;         this.soldToday = original.soldToday;         //totalSales += soldToday;         System.out.println("Copy contructor");     }     public void justSold ( ) {          soldToday++;         totalSales++;     }      public String toString ( ){          String x = "Stand number " + standNumber  + " sold " + soldToday + " hotdogs" ;         return x;     }       public void dispose ( ) {         System.out.println("HotDogStand - dispose method");     }        public void finalize ( ) {         System.out.println("HotDogStand - finalize method");     } }  public class HotDogStand {      public static void main(String[] args) {          HotDogClass stand1 = new HotDogClass(21, 10);         System.out.println (stand1 + " \n "  );         //stand1.justSold();         //stand1.justSold();         HotDogClass standCopy = new HotDogClass (stand1);         System.out.println( standCopy + "\n");         if (standCopy.equals(stand1))             System.out.println("Stand1 and Standcopy are equal\n");         else             System.out.println("Stand1 and standcopy are not equal\n");          HotDogClass stand2 = new HotDogClass(32, 7);         System.out.println (stand2 + " \n ");         stand2.justSold();         stand2.justSold();         stand2.justSold();          HotDogClass stand3 = new HotDogClass();         System.out.println(stand3 + " \n ");           HotDogClass stand4 = new HotDogClass();         stand4.setsoldToday(0);         stand4.setstandNumber(10);         System.out.println(stand4 + " - Testing my set and get methods\n");          System.out.println("The ending total of all hotdogs sold is "                  + HotDogClass.gettotalSales());      } }

I ran into an interesting (and very frustrating) issue with the equals() method today which caused what I thought to be a well tested class to crash and cause a bug that took me a very long time to track down.   Just for completeness, I wasn't using an IDE or debugger - just good old fashioned text editor and System.out's. Time was very limited and it was a school project.  Anyhow -   I was developing a basic shopping cart which could contain an ArrayList of Book objects. In order to implement the addBook(), removeBook(), and hasBook() methods of the Cart, I wanted to check if the Book already existed in the Cart. So off I go -  public boolean equals(Book b) {     ... // More code here - null checks     if (b.getID() == this.getID()) return true;     else return false; }   All works fine in testing. I create 6 objects and fill them with data. Do many adds, removes, has() operations on the Cart and everything works fine. I read that you can either have equals(TYPE var) or equals(Object o) { (CAST) var } but assumed that since it was working, it didn't matter too much.  Then I ran into a problem - I needed to create a Book object with only the ID in it from within the Book class. No other data would be entered into it. Basically the following:  public boolean hasBook(int i) {     Book b = new Book(i);     return hasBook(b); }  public boolean hasBook(Book b) {     // .. more code here     return this.books.contains(b); }   All of a sudden, the equals(Book b) method no longer works. This took a VERY long time to track down without a good debugger and assuming the Cart class was properly tested and correct. After swaapping the equals() method to the following:  public boolean equals(Object o) {     Book b = (Book) o;     ... // The rest goes here    }   Everything began to work again. Is there a reason the method decided not to take the Book parameter even though it clearly  was  a Book object? The only difference seemed to be it was instantiated from within the same class, and only filled with one data member. I'm very very confused. Please, shed some light?


I have a question about how the internet/web works (leaning towards the higher levels on the OSI model). I know Pro Webmasters is about a specific problem regarding the web, but how about theoretical?  Is it CS.SE? The tour says that questions about "computer architecture, networks" belong there.  Or Super User? The tour says:     Focus on questions about an actual problem you have faced. Include details about what you have tried and exactly what you are trying to do.

There seems to be more than a few computer science/programming Stack Exchange networks (is that the correct term?). Stack Overflow, being the first, has by far the most users, questions, and answers.  What is the reasoning for creating the others, and are there clear guidelines for which kinds of questions should be posted? I can see a large amount of potential overflow, many cases of people not getting a good answer to their question, because the person who has the answer isn't browsing that particular network at the moment.  I understand that they were probably created for organizational purposes, but wouldn't it almost make more sense to just have them as categories under Stack Overflow, keep them separated but still connected, instead of making people have to create multiple 'account's, one for each network?  I am sure there was a very good reason to break them up, but as someone that is new to SE, it can be somewhat intimidating to decide which one to post in to ensure you get a good answer. For example, if I am a computer science student, my first instinct might to be to post in the computer science network, until I see that it literally has 1% of the users as the Stack Overflow network, which still seems to be for programming/computer science related questions.  So my second instinct would then to be to post it into the Stack Overflow site on the basis that I have a significantly higher chance of my question being seen and getting a good answer. Then I notice that there is also a 'programmers' network, and I don't even begin to know where that fits in. I, and I am assuming most people, will probably just post on Stack Overflow to be safe.  My question is, other than the short little description blurb of each one, is there a clear cut set of guidelines which what each network is intended for, what kinds of questions should go to each one, and is anything being done to encourage people to post in these newer, smaller (more specialized?) networks as opposed to just posting in big daddy Stack Overflow?  Now again, this is for computer science/programming/"why isn't this code doing what I want?" related questions, I am not saying that if I had a question about Linux or WordPress or something I would have the same confusion.


"I go to school" Because 'to' is a preposition then is it correct to write "I go to watching the movie"?   If not, please explain why. Thank you.

Some verbs are followed by ing, e.g. I enjoy swimming. We can't say I enjoy to swim. Likewise, some verbs are followed by to, e.g. I decided to make a plan.   Which particular verbs are followed by ing and to? Can you please provide a list for that?  Moreover, which verbs can be followed by both without having the meaning changed?


During installation for the first time I was not ask for a root password is there a default password? Or is there some way to establish that password?

I would like to enable the root account on my Ubuntu installation.  I realize the security implications of this.


to  migrated from Stats.stackexchange.com to StackOverflow.   The answer was given on stats site, and migrated with the post. It is in locked and deleted state. What puzzles me, it is locked after receiving additional vote up (answer has +1 on stats and +2 on SO). And more, how it comes up being locked by ?   Surfing meta, it seems that I get what locked post is, and how and why some posts ends up being locked. But Community account seems to serve for automated maintenance tasks on stackexchange, so the quesition is, what triggered the mentioned answer locking?

It has happened on occasion, due to the high amount of 10K moderators on SO that questions are migrated to the wrong site, and needs to be reversed. Although currently it is possible to re-open the question on the original site and delete the one on the destination site, it still leave the migrated too banner behind.  It would be useful if diamond moderators could reverse a migration, removing it from the destination site completely and re-activating it on the original site and at the same time removing the banners.  Previously it has been discussed educating the users around when to move questions, however this doesn't stop the problem.  As per Shog9  I have to admit I do like Shog9's suggestion regarding the post being closed as not programming related rather then re-opened, however, reasons for closing it on other sites should also be kept in mind, as this also applies to stuff being sent back forth between the sites.


I'm currently writing a paper for my research however I'm wondering if the usage of the passive voice is correct. for example I wrote like        mistakes were corrected   were normalized   were identified      One whole sentence example in my paper:      After loading the dataset in Excel (selecting tab as   delimiter) delimiter mistakes were corrected.   However when I use a grammar checker it will say "passive voice" and suggest to correct this, however what choice should I make when writing a scientific paper?

As I'm not a native speaker and just finishing my dissertation in Computer Science, I wonder  what style I should be using. In German (my native tongue) most dissertations, school-books and scientific writing use third person or passive voice to sound 'objective'. I know that passive voice in English should be avoided. In most of my publications I use "we" (e.g. "we can improve the recognition rate by ...").  For the dissertation, as it is my work, should I prefer "I" over "we"? I don't like the idea too much, as it sounds pretentious to me. Currently, I want use first person singular for the contributions section and first person plural for the rest. I try to avoid passive as often as possible. Is this acceptable?


Here I am using a different class to implement graph using adjacency List.I included almost everything that is there, but still i am getting this error     public class Breadth_first_Traversal {   Graph g; void BFS(int s,int v){     boolean[] visited=new boolean[v];      LinkedList<Integer> q1=new LinkedList<Integer>();     q1.add(s);     visited[s]=true;     while(q1.size()!=0){         s=q1.poll();         System.out.print(s+" ");         Iterator<Integer> i=g.adj[s].listIterator();         while(i.hasNext()){             int n=i.next();             if(!visited[n]){                 q1.add(n);                 visited[n]=true;             }         }     } } public static void main(String args[]){     Breadth_first_Traversal bfs=new Breadth_first_Traversal();     Graph gr=new Graph(4);     gr.addEdge(0, 1);     gr.addEdge(0, 2);     gr.addEdge(1, 2);     gr.addEdge(2, 0);     gr.addEdge(2, 3);     gr.addEdge(3, 3);     bfs.BFS(2, 4); }   Output  2 Exception in thread "main" java.lang.NullPointerException at Graph_data_structure.Breadth_first_Traversal.BFS(Breadth_first_Traversal.java:21) at Graph_data_structure.Breadth_first_Traversal.main(Breadth_first_Traversal.java:40)Picked up _JAVA_OPTIONS: -Xmx512MJava Result: 1BUILD SUCCESSFUL (total time: 1 second)   Please help.


I use PHPMailer for send mail, I think everything is ok. But it goes to spam. Yahoo is ok, but gmail has problem.  I see SPF is soft fail.    My spf record is: v=spf1 +a +mx +ip4:149.255.38.122 +include:_spf.google.com ~all  And  say is true.  Thanks for help

This is a tricky one and I've always relied on techniques, such as permission-based emails (i.e. only sending to people you have permission to send to) and not using blatantly spamish terminology.  Of late, some of the emails I send out programmatically have started being shuffled into people's spam folder automatically and I'm wondering what I can do about it.  This is despite the fact that these particular emails are not ones that humans would mark as spam, specifically, they are emails that contain license keys that people have paid good money for, so I don't think they're going to consider them spam  I figure this is a big topic in which I am essentially an ignorant simpleton.


I need to calculate textarea height for the text that will be inserted into it. Textarea has fixed width. For example, for textarea with width 271 px and the following text (no linebreaks):   Some complementary text  Some complementary text  Some complementary text  Some complementary text  Some complementary text  Some complementary text  Some complementary text  Some complementary text   Textarea height will be 176px.     So the question is: how this 176px can be calculated?  Thank you.

There was , which I've tried. But there is one problem: the textarea doesn't shrink if you delete the content. I can't find any way to shrink it to the correct size - the clientHeight value comes back as the full size of the textarea, not its contents.  The code from that page is below:  function FitToContent(id, maxHeight) {    var text = id && id.style ? id : document.getElementById(id);    if ( !text )       return;     var adjustedHeight = text.clientHeight;    if ( !maxHeight || maxHeight > adjustedHeight )    {       adjustedHeight = Math.max(text.scrollHeight, adjustedHeight);       if ( maxHeight )          adjustedHeight = Math.min(maxHeight, adjustedHeight);       if ( adjustedHeight > text.clientHeight )          text.style.height = adjustedHeight + "px";    } }  window.onload = function() {     document.getElementById("ta").onkeyup = function() {       FitToContent( this, 500 )     }; }


We know that our universe was in low entropy state at the earlier time after the Big bang. But we also know that the temperature at that times was enormously high. But what the third law of thermodynamic says ? It says that if $T$ goes to zero, entropy of the system also goes to zero, which is not the case for the universe at the very beginning.

The Big Bang theory assumes that our universe started from a very/infinitely dense and extremely/infinitely hot state. But on the other side, it is often claimed that our universe must have been started in a state with very low or even zero entropy.   Now the third law of thermodynamic states that if the entropy of a system approaches a minimum, it's temperature approaches absolut zero.  So how can it be that the beginning universe had a high temperature and a low entropy at the same time? Wouldn't such a state be in contradiction to the third law of thermodynamics?


Can someone explain how the negative resistance feature of a tunnel diode is used in oscillators with the help of this circuit diagram:

How is the negative resistance feature of Tunnel Diodes used in oscillators with the help of this circuit diagram.


Is there any difference between asking     Is it a peach or a banana?   vs.      Is it a peach or banana?   The latter sounds to me like a yes/no question, while the prior does not. Is it just me?

I have a problem with the use of "the" after "and" where you would basically be connecting words. For example, which of the following is better:     The table and the chairs?   The table and chairs?   Or are both okay? What is the rule, and are there exceptions to it? Or is the rule just contextual and may vary between the sentences and meanings?


I have HP-2000-Notebook Pavilion series with windows on it. More my notebook doesn't support visualization technology.   I want to develop and iOS app in objective c. Is there any alternative that work for me? rather than buying apple notebook.

I would like to develop iPhone apps without using Mac OS X. Is it possible to do this on Windows OS?


I've developed a side menu in a custom wordpress theme which displays a list of pages in the relevant section. This is all working well and the relevant section automatically opens. The only thing I would like to add is the ability to click a section to open it and close it.  The menu is set out in the following way and I am unable to edit the classes/ID's of the elements as it is wordpress.

     Main Link

     I basically need to say that if the .sidenav li a is clicked then toggle the .side_open class on .sidenav li ul. If anyone has any idea on how this could be done, please let me know!  Thanks - Scott

How can I change the class of an HTML element in response to an onclick or any other events using JavaScript?


I'm not sure if philosophy is the right topic for this, but it's logic and language, so it kind of matches.   Me and my friend played a little game this morning where I said "don't do this and that" and he did exactly that.  Me: "Don't look around" He: looks around Me: "Don't talk gibberish" He: talks gibberish  And then I said this:  Me: "Don't do what I tell you not to do"  He said he was confused and we both laughed. But what would be the logical thing to do here? Or is there any simple logical answer to this at all?

Is there a term that means "A self referential statement which is true if (and because) it is true and false if (and because) it is false"? "This sentence is a lie" is a paradox in the sense of "paradox(noun) A self-contradictory statement, which can only be true if it is false, and vice versa." (Source: .) I'm looking for the opposite of that. I found the following on :  So we have reached the extraordinary result that the statement is always consistent, regardless of whether or not it is true!  Which notes that it is interesting, but doesn't give a name.


what is the meaning of untrusted data? is it all data that generate dynamically? or just data from user input?

Is there a catchall function somewhere that works well for sanitizing user input for SQL injection and XSS attacks, while still allowing certain types of HTML tags?


I have just installed Ubuntu 16.04. I tried installing terminator from https://apps.ubuntu.com/cat/applications/precise/terminator (The link is redirecting somewhere else now) but I am unable to install it. I am getting following message     This software comes from a 3rd party and may contain non-free components   How can I install terminator by command line?

Can anyone help me providing terminal command to download and install the software provided by Software center?  Actually I'm searching for command to download and install KDbg (Debugger) via terminal.