Linq ToDictionary anonymous versus concrete types

I am trying to use Linq to convert a list to Dictionary. I have been able to get proper results with anonymous types as keys, but not with concrete types. Please see code snipped below:          // Works. Produces 329 entries in dictionary, as expected.          var groupByMonth =             from e in list             group e by new { e.chk.Month, e.chk.Year } into g             select new { month = g.Key, rates = g.ToList() };         var monnthlyRates = groupByMonth.ToList();         var monnthlyRatesDict = groupByMonth.ToDictionary(t => t.month, t => t.rates);          // IS NOT WORKING. Produces 30K entries in dictionary; same num as in the list.         // i.e. the grouping does not happen         var groupByMonth2 =             from e in list             group e by new MonthYear { Month = e.chk.Month, Year = e.chk.Year } into g             select new MonthYearRates { MonthYear = g.Key, Rates = g.ToList()};         var monnthlyRatesDict2 = groupByMonth2.ToDictionary(t => t.MonthYear, t => t.Rates);          // Works. Dictionary has 329 entries         var groupByMonth3 =             from e in list             group e by new DateTime(e.chk.Year, e.chk.Month, 1) into g             select new MonthYearRates2 { MonthYear = g.Key, Rates = g.ToList() };         var monnthlyRatesDict3 = groupByMonth3.ToDictionary(t => t.MonthYear, t => t.Rates);   I tried to fix the problem by implementing IComparer and/or IComparable in the concrete type; to no avail  class MonthYear : IComparer // class MonthYear : IComparable, IComparer {     public MonthYear()     {     }     public MonthYear(int month, int year)     {         Month = month;         Year = year;     }     int IComparer.Compare(Object x, Object y)     {         MonthYear xo = (MonthYear)x;         MonthYear yo = (MonthYear)y;          if (yo.Year > xo.Year)             return 1;         else if (yo.Year < xo.Year)             return -1;         else         {             if (yo.Month > xo.Month)                 return 1;             else if (yo.Month < xo.Month)                 return -1;             else                 return 0;         }     }      //int IComparable.CompareTo(object obj)     //{     //    MonthYear o = (MonthYear)obj;      //    if (Year > o.Year)     //        return 1;     //    else if (Year < o.Year)     //        return -1;     //    else     //    {     //        if (Month > o.Month)     //            return 1;     //        else if (Month < o.Month)     //            return -1;     //        else     //            return 0;     //    }     //}     public int Month;     public int Year; }   I understand that Lookup might be a better fit that dictionary; I will lookup Lookup once I am done with anyonymous types.


Are the roots of this polynomial in the unit circle?

Consider  $$ P(X) = X^{n+1} - aX^{n} +aX -1 $$ with $a \in [-1;1]$.     Show that the moduli of the roots of $P$ are $1$.   What I tried is   I've noticed if $z$ is a root then $\frac{1}{z}$ is a root as well.  I've checked:   $X-a+aX-1 = (1+a)(X-1)$ $X^{2} - aX -1 +aX = (X-1)(X+1)$ $X^{3} - aX^{2} +aX-1$ is more subtle.   I don't how far this question could lead us but I know compelex analysis and basic algebra.


Question states: Consider two events A and B in a sample space S. • Assume that Pr(A) = 1/2 and Pr(B|A') = 3/5. Determine Pr(A∪B).  Not quite sure how to answers this question. Here's how I started:  So Pr(A) = 1/2 so Pr(A') = 1/2.   Then Pr(B|A) = 3/5.  Pr(A∩B) = Pr(A) * Pr(B|A) = 1/2 * 3/5 = 0.3  Pr(A∩B) = 0.3  But how do I get (A∪B)?  Pr(A∪B) = Pr(A) + Pr(B) - Pr(A∩B)  but I don't know the Pr(B)? What am I missing here? Thanks for any insight.


I am one of those people who likes seeing what badges and accomplishments users (especially new users) have done.  I am also one of those people who uses the iOS app for SE because it is easier.  However, unfortunately I can't combine these two things! So I think we should!  In short, please can we allow users to see other users' badges while on the app?


Dropping a 1000 lb anvil on a foe with telekinesis

One of my players wants to drop a 1000 lb anvil on top of an enemy, using the telekinesis spell.  How should I adjudicate?


I am the administrator on my PC. There is another local account on this PC. I just want to know, if I wish that the other will not be able to view D and E drive, then what should I do? How can I prevent the other user from using the D drive?  I have tried the "stop sharing"  from the computer management, but the other user still can open the D drive.  I am on Windows 10 Pro OS.


Child relationship expressions __r in SOSL

Is that possible to have a child relationship expressions __r in SOSL   List<List<SObject>> searchList = [FIND :searchText+'*' IN All Fields      RETURNING Account (id,name,industry),      Contact(id,name,email,firstname,lastname),     Opportunity(id,name,stagename,closedate),lead(id,name,email,phone)];


How many surjective functions are there.

How many surjective functions exist from the set $A= \{1,2,3,4,5,6\}$ (Domain) to the set $B=\{w,x,y,z\}$ (Image).  I have no idea on how you do this. Any hints would be helpful.  I know that I can begin with $4^6$ functions and exclude the non surjective ones, but I don't know how you do this.


What algorithm can I use to forecast the time series?

Now the above is my graph. The x axis coordinates corresponded to the minutes. An week contains 10080 minutes. So that is the length of the entire X axis. The graph shows the up time (time during which a particular PC is switched on) of a PC. If y=1 then the PC is on else off. Now if I take the data for multiple weeks then there will be some sort of seasonality. My question is what technique will be suitable for this problem? I have tried ARIMA but I think the lag order should be about 10000. It is not working with such a high lag.


Closed set mapped to itself in a compact Hausdorff space

Let $X$ be a compact Hausdorff space and let $f:X\to X$ be continuous. Prove that there exists a non-empty closed set $C$ such that $f(C) = C$.    Proving by contradiction seems hard to me, since if $f(C)\neq C$ for all closed sets $C$, then we can have either $f(C)\subset C$, $f(C)\cap C\neq\varnothing$ or $f(C)\cap C = \varnothing$. The only thing I might have thought about is to set $C = f(X)$. Since $X$ is compact, $f(X)$ is compact and since $X$ is Hausdorff, $f(X)$ is closed. Then we have that $f(C)\subseteq C$ by definition. I was not able to prove that $C\subseteq f(C)$, namely that $f(X) \subseteq f(f(X))$. It is not obvious for me that in general it is even true, so maybe the choice $C = f(X)$ does not help.


Arraylist returning null after trying to add items

Fixed: Changed to .equals instead of using ==. Then I changed it to subjects.isEmpty() and it worked as well. For the record my question wasn't how do I compare strings. That just happened to be the problem I had with my code. Thanks to everyone for their replies!  I have an ArrayList that I am loading from sharedprefs as a string and converting it back to an ArrayList. When I load it I check to see if it's empty. If it's empty I populate it with 34 objects. Then I try to use the ArrayList but I'm getting a null object reference.  I declare my variable outside of onCreate  private ArrayList<Integer> subjects = new ArrayList<>();   When I run this code I get the error  private void setupSubjects(){      SharedPreferences sharedPrefs = this.getActivity().getSharedPreferences(viewPressed, Context.MODE_PRIVATE);     Gson gson = new Gson();     String jsonString = new String();     jsonString = sharedPrefs.getString("Subjects", jsonString);     Type type = new TypeToken<ArrayList<Integer>>() {}.getType();     subjects = gson.fromJson(jsonString, type);      if(jsonString == ""){         for(int i = 0; 33 < i; i++){             subjects.add(0);         }     }      if(subjects.get(0) == 1){         questionsString = getResources().getStringArray(R.array.question);         answersString = getResources().getStringArray(R.array.answer);         questionsLoaded = new ArrayList<>(Arrays.asList(questionsString));         answersLoaded = new ArrayList<>(Arrays.asList(answersString));         randomizeSubjects();     }  }   I am getting a java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object java.util.ArrayList.get(int)' on a null object reference on this line  if(subjects.get(0) == 1){


QGIS Atlas generation for multiple map extents?

I'm trying to create 5 maps in composer showing the same layer features but different extents of a map (attached an image to give everyone an example). I've opted to use atlas to save me manually creating 5 maps... but I have hit a barrier.   I think where I am going wrong is that I am trying to create an atlas based off a point layer (which is my coverage layer) so it is creating individual maps (about 60 +) for the points displayed.   However... I would like atlas to generate 5 maps for the different geographical extents that cover those points?   I right in thinking that I'll have to go and create a polygon shapefile that creates say a bounding box around 5 different areas to contain the points of interest? & then select this as my coverage layer when generating an atlas?  Does anyone know a way to achieve what I am trying to do? Any views or general help would be great.


Java code to connect to database won't set up connection

public class Actor {         String URL = "jdbc:mysql://localhost:3306/test/phone";         String USERNAME = "root";         String PASSWORD = "";          Connection connection = null;         PreparedStatement selectActors = null;         ResultSet resultSet = null;          public Actor(){              try {                 connection = DriverManager.getConnection(URL, USERNAME, PASSWORD);                  selectActors = connection.prepareStatement( "SELECT * FROM phone");             } catch (SQLException e) {                 e.printStackTrace();             }          }         public ResultSet getActors() {             try {                 resultSet = selectActors.executeQuery();                 return resultSet;             } catch (SQLException e) {                 e.printStackTrace();             }             return resultSet;         }     }   I'm trying to write Java code to connect to a database and display all the records in a table, but it won't work. The error I'm getting is a null pointer exception on getActors(). I've tried checking why the null pointer exception occurs but I just cannot get it. Everything else works just fine


Today my iptables nat on the host system stopped working and I have no clue what happend! (That's very bad, I know)  All commands are executed as root user.  If I run $ iptables -t nat -L I get the following error message:  $ iptables -t nat -L iptables v1.4.7: can't initialize iptables table `nat': Table does not exist (do you need to insmod?) Perhaps iptables or your kernel needs to be upgraded.   There are no further updates available. I also restarted the server with several older kernels, but I always get the same error message.  My server is running on CentOS with the official OpenVZ kernel in the latest version.  $ uname -r 2.6.32-042stab088.4   Also tested kernel version: 2.6.32-042stab85.20 and 2.6.32-042stab084.26  First kernel in grub.conf:  title OpenVZ (2.6.32-042stab088.4) root (hd0,1) kernel /vmlinuz-2.6.32-042stab088.4 ro root=/dev/md2 rd_NO_LUKS rd_NO_DM nomodeset crashkernel=auto SYSFONT=latarcyrheb-sun16 LANG=en_US.UTF-8 KEYTABLE=de initrd /initramfs-2.6.32-042stab088.4.img   The following updates were installed:  $ rpm -qa --last vzctl-4.7.2-1.x86_64                          Mon 05 May 2014 03:25:16 AM CEST vzctl-core-4.7.2-1.x86_64                     Mon 05 May 2014 03:25:14 AM CEST util-linux-ng-2.17.2-12.14.el6_5.x86_64       Wed 30 Apr 2014 11:37:19 PM CEST libuuid-2.17.2-12.14.el6_5.x86_64             Wed 30 Apr 2014 11:37:18 PM CEST libblkid-2.17.2-12.14.el6_5.x86_64            Wed 30 Apr 2014 11:37:18 PM CEST vzkernel-2.6.32-042stab088.4.x86_64           Mon 26 Apr 2014 09:01:00 AM CEST nss-softokn-freebl-3.14.3-10.el6_5.x86_64     Sat 26 Apr 2014 09:01:00 AM CEST nss-softokn-3.14.3-10.el6_5.x86_64            Sat 26 Apr 2014 09:01:00 AM CEST bridge-utils-1.2-10.el6.x86_64                Tue 15 Apr 2014 02:22:41 PM CEST openssl-1.0.1e-16.el6_5.7.x86_64              Wed 09 Apr 2014 10:14:03 AM CEST ...   lsmod gives me the following:  $ lsmod | grep ip iptable_nat             6302  0 nf_nat                 23213  2 iptable_nat,vzrst nf_conntrack_ipv4       9946  3 iptable_nat,nf_nat nf_defrag_ipv4          1531  1 nf_conntrack_ipv4 nf_conntrack           80281  5 iptable_nat,vzrst,nf_nat,nf_conntrack_ipv4,vzcpt ip6t_REJECT             4711  0 ip6table_mangle         3669  0 ip6table_filter         3033  0 ip6_tables             18988  2 ip6table_mangle,ip6table_filter iptable_mangle          3493  0 iptable_filter          2937  0 xt_multiport            2716  0 ipt_REJECT              2399  0 ip_tables              18119  3 iptable_nat,iptable_mangle,iptable_filter ipv6                  322519  35 vzrst,ip6t_REJECT,ip6table_mangle   Running modprobe gives the following error:  $ modprobe /lib/modules/2.6.32-042stab088.4/kernel/net/ipv4/netfilter/iptable_nat.ko FATAL: Module /lib/modules/2.6.32_042stab088.4/kernel/net/ipv4/netfilter/iptable_nat.ko not found.   But the file does exist:  $ ll /lib/modules/2.6.32-042stab088.4/kernel/net/ipv4/netfilter/iptable_nat.ko -rwxr--r-- 1 root root 16K Apr  3 16:20 /lib/modules/2.6.32-042stab088.4/kernel/net/ipv4/netfilter/iptable_nat.ko*   Any ideas?


Problem book in Quantum mechanics with emphasis on physical(ly relevant) problems

I am a second year undergraduate and studying quantum mechanics from sakurai's 'Modern Quantum Mechanics'. Is it a good idea to solve problems from sakurai, which are mostly mathematical in nature? I need a textbook that has physically relevant problems, maybe going even into condensed matter, or field theory in its exercises. This would probably help me to appreciate and understand qm better. Sorry if this question is too localised but I just had to post it.


Selenium Faker class - Error Can not make static reference to non static field Cucumber

I am using Faker class to create random values in Selenium Webdriver automation. Below is the class for your reference.  public class NewUserFormAction {      Faker faker = new Faker();     public  String name = faker.name().firstName();     public  String Surname = faker.name().lastName();      public static void Execute(WebDriver driver,List<HashMap<String,String>> map) throws Exception{          WebDriverWait wait = new WebDriverWait(driver,10);         wait.until(ExpectedConditions.elementToBeClickable(NewUserFormPage.gender));         NewUserFormPage.gender.click();         NewUserFormPage.customer_firstname.sendKeys(name);         NewUserFormPage.customer_lastname.sendKeys(Surname);      } }   when I am executing this code I am getting exception at compilation at below steps with error can not make static method reference to non static data member.  NewUserFormPage.customer_firstname.sendKeys(name); NewUserFormPage.customer_lastname.sendKeys(Surname);   Here I understand the faker instance is create on public class which is non static and it is being called in Execute method which is static. Can you please help me how to solve this issue ?


Problem : No section/subsection label appears in the titles

Here is my problem : in the titles of my sections and subsections, labels don't appear, leaving titles with only text (no numbers as "1.1.", etc.). A important remark is that this problem does not occur when building my document on  another computer (at work)... I have no other problems with my document, and every other labeling (cross references for instance) works perfectly fine.  I use the texlive package. Here is a MWE, showing all the packages I use for my document, and the corresponding output :  \documentclass[a4paper,11pt,oneside,fleqn,openany]{book}  % ======== % PACKAGES % ======== \usepackage{amsfonts} \usepackage{amsmath} \usepackage{array} \usepackage{arydshln} \usepackage[english]{babel} \usepackage{calc}     \usepackage{color}    \usepackage{empheq}   \usepackage{fancyhdr} \usepackage[T1]{fontenc} \usepackage[top = 2 cm, bottom = 2 cm, inner = 2 cm, outer = 2 cm]{geometry} \usepackage{graphicx} \usepackage[utf8]{inputenc} \usepackage{makeidx}   \usepackage[charter]{mathdesign} \usepackage{microtype} \usepackage{multirow} \usepackage[final]{pdfpages} \usepackage{relsize} \usepackage{textcomp} \usepackage{titlesec} \usepackage{titletoc} \usepackage{tocbibind}  \usepackage{varioref}  \usepackage{hyperref}  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{document}  \chapter{First chapter example}  \section{First section example} \subsection{First subsection example} \subsection{Second subsection example}  \section{Second section example}  \end{document}   ]  Any ideas ?


While purchasing in Walmart, after sliding my card the card machine was saying "Waiting on cashier".   What does "waiting on" mean in this case and how it differs from "waiting for"? Would that be wrong to say "waiting for cashier" ?


A friend asked me what are the solutions to this equation. I know for sure it has 2 solutions (thanks to Desmos) - (0.159, 0.159) and (3.146, 3.146).   I have no idea even where to start solving this problem.  My knowledge in mathematics is sadly high school tier so please keep it as simple as possible.  Thanks in advance!


I was thinking about creating a wizard character. Reviewing the spellcasting rules, I saw this:  Most spells that require attack rolls involve ranged attacks. Remember that you have disadvantage on a ranged attack roll if you are within 5 feet of a hostile creature that can see you and that isn't incapacitated (see chapter 9).  There are a lot of occasions that might arise that would make this a problem, or at least a bit of a hindrance. So as a D&D player normally would when they wanted to break a rule without actually cheating, I went to a list of feats and found Crossbow Expert:  Thanks to extensive practice with the crossbow, you gain the following benefits: You ignore the loading quality of crossbows with which you are proficient. Being within 5 feet of a hostile creature doesn't impose disadvantage on your ranged attack rolls. When you use the Attack action and attack with a one handed weapon, you can use a bonus action to attack with a hand crossbow you are holding.  I may be (am) overthinking things, but does this apply to magic attacks, such as cantrips like Eldritch Blast or Fire Bolt? The literal meaning of the feat says that I can, but it could also imply by the title and also the effects of the feat that this only applies to crossbows, or any other ranged weapon, excluding magic. The strongest evidence that it might not affect ability with ranged magic attacks is:  Thanks to extensive practice with the crossbow  With a crossbow, not with magic.


Why does my grid not want to center vertically?

I have a problem with my grid. It doesn't want to center vertically even when using the properties "align-items: center" and "align-self: center"    .citations {     background: #1070b4;     margin-top: 88px;     height: 600px; } .citations-grid {     width: 100%;     max-width: 1290px;     height: auto;     display: grid;     margin: 0 auto;     grid-template-columns: repeat(auto-fill, 625px);     justify-content: center;     align-self: center; }

“La musique commence là où s'arrête le pouvoir des mots.”
 - Richard Wagner

“La musique est la langue des émotions.”
 - Emmanuel Kant

 “La vie sans musique est tout simplement une erreur, une fatigue, un exil.”
 - Friedrich Nietzsche


Is it possible to disable the 'Block Placed' message when using tellraw /setblock?

I want to make a tellraw shop but to activate command blocks I want to use /setblock command when clicked on a text. Is it possible to disable "Block placed" text showing up?


Is it possible to COMPLETELY delete a Book from my purchased books?

Yesterday, I saw that my brother has downloaded an "hentai" on my Mac (shame on me, I didn't lock it !) I deleted it, but it stays on my purchased books, and I don't want it !  Is it possible to totally remove a book from my account's purchased history?


What's the point of CountDownLatch in java?

CountDownLatch in java is a high-level synchronization utility which is used to prevent a particular thread to start processing until all threads are ready.  But, Semaphore can totally do the same thing. So, what's the merit of CountDownLatch?  One more question: If CountDownLatch do have some merits, Why It was designed to used only once? I think it's easy to add a set method to reset the count.


How do I display an image after pressing an UI button in unity3d?

I am working on a game in unity3d in which I want to display the details about the players when a button is being pressed. Suppose there are 12 players so for that I will have to make 12 UI buttons as well and I have done that too but the problem is that how to display image after clicking the buttons? If anyone knows please sort out my problem, any help would be more appreciated. Thanks in advance


High CPU usage by "System" and "System interrupts" (caused by ACPI.sys)

I have a laptop, which was running Windows 8.1 x64 without any problems. Now with Windows 10 x64 installed, Task Manager constantly shows unusual CPU usage by "System" and "System interrupts". To solve this, I already tried the following, without success:   Disabling and uninstalling all non-essential drivers. Installing newer drivers than the ones that were automagically installed (if available). Disabling/enabling fast boot option. Disabling all of the non-essential services. Sysprep. Resetting BIOS to defaults and various combinations of settings. Flashing BIOS to the latest available version. Clean install from the same media that I use for other PCs. Installing all of the updates offered in Windows Update to this day. Windows Performance Recorder / Analyzer.   I'm not very familiar with Windows Performance Analyzer, so I'm hoping someone here can point me in the right direction - what exactly should I look for, to figure out which device/driver is the culprit. Or, if there's any other approach to figuring out this problem?  For the brave souls, here's my  and a screenshot of the problem:


How to render a pixelated, occluded wireframe with freestyle?

I'd like to combine these features:    The pixelated look of a wire material with anti-aliasing disabled. Proper occlusion of hidden lines.   A wireframe material produces the first feature, freestyle produces the second. Can a line set be created that produces neither double pixels nor gaps? Line thickness alone does not seem to be the answer.  There is the trick with two materials and z-offset, but I have trouble getting a really clean solution at the outline of the object. So a freestyle solution would be best.    The main problem is that freestyle (to the right) produces double pixels:


I am trying to make a Hangman game in Java, I use 3 Strings to process the game. randWord is the word randomly selected word from a designated word list array (WORD_LIST), randWordExt is the randWord in extended format (e.g. penguin -> p e n g u i n), and guessWord is the String that gets updated while the player guesses.      static String[] WORD_LIST =     {         //list of words implemented here     };     static String randWord;     static String randWordExt = "";     static String guessWord = "";     static int LIVES = 10;   This is my main method where the problem is, the while loops is not exiting when the word is completely solved. Hence the final message is never displayed. It loops through perfectly, guessing works, but when the word is solved it doesn't exit the loop or display the final message.      public static void main(String[] args) {      boolean running = true;     Scanner input = new Scanner(System.in);          generateWord();         System.out.println("You have " + LIVES + " lives to guess the word! \n" + guessWord);         while(running){              guessLetter(input.next().charAt(0));             if(guessWord == randWordExt){                  running = false;              } else {                  System.out.println(guessWord);                 System.out.println("Lives left: " + LIVES);              }          }         input.close();          System.out.println("The word was " + randWord + ", you guessed it in " + " moves!");      }   The generateWord method:  public static void generateWord(){      randWord = WORD_LIST[(int)(Math.random() * 87)];      for(int i = 0; i < randWord.length(); i++){          guessWord = guessWord + "_ ";      }      for(int i = 0; i < randWord.length(); i++){          randWordExt = randWordExt + randWord.charAt(i) + " ";      }  }   And finally the guessLetter method:  public static void guessLetter(char letter){      boolean changed = false;      for(int i = 0; i < randWordExt.length(); i++){          if(!(guessWord.charAt(i) == letter)){              if(randWordExt.charAt(i) == letter){                  guessWord = guessWord.substring(0, i) + letter + guessWord.substring(i + 1);                 changed = true;              } else if (randWordExt.charAt(i) != letter && i == randWordExt.length() - 1 && changed == false){                  LIVES -= 1;                 System.out.println("\'" + letter + "\'" + " is not in the word!");              }          } else {              System.out.println("\'" + letter + "\'" + "has already been guessed!");          }      }  }


"Error while downloading . There is insufficient space on the device"

When I am downloading the application from the Play Store, I am getting this message.    "Error while downloading <application_name>. There is insufficient space on the device"   I am using Sony Xperia C and I have sufficient space in the internal memory and in the memory card. This message is cracking my brain as it is shown for the application under 2 mb and I have almost half GB free. I am not able to update the applications too.   Please help me to solve this issue. I am using android 4.2.2.


If $\sum_n \sqrt{a_n a_{n+1}}$ converges, then $\sum_n a_n$ might not converge.

This is the other direction of  that reads  Let $a_n>0$ (!) for each $n\in\mathbb{N}$. Then $\sum_{n=1}^\infty a_n<\infty$ implies $\sum_{n=1}^\infty \sqrt{a_n a_{n+1}}<\infty$.  I need to prove that "the converse of the last statement is false". I don't want the answer, but to ask if I can use the following argument to prove the statement. To start, I'm confused with the statement "the converse of the last statement is false". Is it enough if I prove, if $\sum_n \sqrt{a_n a_{n+1}}$ diverges, then $\sum_n a_n$ must diverge? If this is true, then the proof is easy since I can choose $a_n=1/n$ and prove that $\sum_n a_n$ converges.


Why doesn’t deleting from a Javascript array change its length?

I have an array:  data.Dealer.car[0] data.Dealer.car[1] data.Dealer.car[2]   If I do this:  alert(data.Dealer.car.length); delete data.Dealer.car[1]; alert(data.Dealer.car.length);   It gives me the same count each time. Does the removed element still exist?


UNABLE_TO_LOCK_ROW, unable to obtain exclusive access to this record. Case not saving:

I'm getting this error when trying to save a Case: Failed to invoke future method 'static void cloneCaseWithCaseProds(String, String, Set<Id>)' on class 'CTRL_Support_ProcessV2' for job id 'xxxxxxxxx'  caused by: System.DmlException: Insert failed. First exception on row 0; first error: UNABLE_TO_LOCK_ROW, unable to obtain exclusive access to this record: []  Class.DAL_BaseObject.UpdateDatabase: line 117, column 1 Class.DAL_BaseObject.InsertDBObjects: line 45, column 1 Class.DAL_BaseObject.InsertDBObject: line 40, column 1 Class.CTRL_Support_ProcessV2.cloneCaseWithCaseProds: line 252, column 1  Any information on how to debug or fix this?


Remove duplicate fields in a given column

I'd like to remove from a given column ($2 in the example) the duplicate fields (comma separated).  Input file:   A    1,2,3,4    B    4,5,6,3 C    2,15   Expected output:  A    1,2,3,4 B    5,6 C    15


Let $f(x)$ be a continuous function in  $[1,3]$  defined for all $x$ belonging to $ R $. If $f(x)$ take rational values for all $x$ belonging to R and $f(2)=198$ then $f(2^2)$


Does anyone know how pre-clearance facilities at airports like Abu Dhabi are affected during US government shut downs? Still worth booking to go through those facilities in the next few days?


How can I AUTOMATICALLY forward Facebook messages to my email?

I am told that I can AUTOMATICALLY (not manually) forward my Facebook messages to my email account but I can't find how to do that in the Facebook settings.  1) Can Facebook messages be automatically forwarded? 2) How do I do that?  (YES someone asked this very same question but the answers were to the question  "How can I manually forward messages." so I'm asking again.)


I want to make my book with size 17cmX24cm but I don't know how to set it into my tex?


Setting post meta data to random value during post status transition / on publish

Upon publishing an unpublished draft, I'd like the custom meta value "post views count" to be set to a random variable between 829 and 1013.  I am using the code below, which doesn't always work. It works when I create a test draft and publish it immediately, but not when I save a post for a few days or assign it to another writer it doesn't work.     NOTE: I don't want to create a new custom field. I just want to update the existing field, which is called post_views_count.   function wpse_custom_field_on_publish( $new, $old, $post ) {   if ( $new == 'publish' && $old != 'publish' && !get_post_meta( $post->ID, 'post_views_count', true ) ) {     update_post_meta( $post->ID, 'post_views_count', rand(829, 1013), true );   } } add_action( 'transition_post_status', 'wpse_custom_field_on_publish', 10, 3 );


Error importing shapefile into postgreSQL using shp2psql?

I've tried this a few different ways and keep getting the same error. I have a shapefile currently in WGS84 UTM Zone 15 which is SRID 32615.  I used the ArcMap multipart to singlepart tool to create a singlepart polygon. I followed the instructions found at  to install postgresql and postgis.  I open pgAdmin III and select the postgis_21_sample table. Plugins > PostGIS Shapefile and DBF Loader 21.  I check connection details and it connects fine.  I add my .shp file. I set Schema to public and Table to postgis_21_sample. I leave geo column alone and set SRID to 3265.  When I click import I get  ============================== Importing with configuration: postgis_21_sample, public, geom, C:\GIS\forest_buffer\postgres_single.shp, mode=c, dump=1, simple=0, geography=0, index=1, shape=1, srid=3265 Shapefile type: Polygon PostGIS type: MULTIPOLYGON[2] Failed SQL begins: "SET CLIENT_ENCODING TO UTF8; SET STANDARD_CONFORMING_STRINGS TO ON; BEGIN; CREATE TABLE "public"."postgis_21_sample" (gid serial, "shape_leng" numeric, "shape_area" numeric, "orig_fid" int4); ALTER TABLE "public"."postgis_21_sample" ADD PRIMARY KEY (gid);" Failed in pgui_exec(): ERROR:  function addgeometrycolumn(unknown, unknown, unknown, unknown, unknown, integer) does not exist LINE 9: SELECT AddGeometryColumn('public','postgis_21_sample','geom'...                ^ HINT:  No function matches the given name and argument types. You might need to add explicit type casts.  Shapefile import failed.   I've also tried projecting this shapefile to WGS84 with SRID 4326 and receive the same error.  There are >100,000 features and I need to buffer, dissolve, negative buffer, and finally buffer back to the original size to fill gaps.  ArcMap and QGIS fail to do it after days of waiting.


How Can One Prove $\cos(\pi/7) + \cos(3 \pi/7) + \cos(5 \pi/7) = 1/2$

Reference:   We tried various different trigonometric identities. Still no luck.   Geometric interpretation would be also welcome.  EDIT: Very good answers, I'm clearly impressed. I followed all the answers and they work! I can only accept one answer, the others got my upvote.


Why is .keys() after a dict object while "sorted" is before? dictionary.keys() sorted(dictionary)

I have noticed that in some cases "what you want to do" to an object is written before the object while other times the object is written first.  here is an example   dictionary = {}  dictionary["ole"] = 28 dictionary["maria"] = 26 dictionary["kim"] = 6 dictionary["lucy"] = 1  print(dictionary.keys()) # object first (dictionary)  print(sorted(dictionary)) # object after (sorted()) is first   How do I know when the object should be before "what I want to do with it" or after?


Suppose $\Omega$ is a region,$f\in H(\Omega)$, and $f\not\equiv 0$.If for every positive integer n,there is $f_n \in H(\Omega)$,$(f_n)^n=f$,prove that there is $g\in H(\Omega),f=e^g$.  My conjecture :  $$g=lim  (nf_n - n)$$  But I don't know how to deal with it.  I will appreciate your help.


Windows 10 runs slow and freezes. Almost always 100% disk usage

My computer freezes often when booting and while it's working it functions very slowly. Cpu usage is almost always very low (3-30%), memory usage is very consistent (60-80%), but disk usage is almost always 100%.   My main drive is a ST100DM003 HDD. I've run chkdsk and it found no problems. I've run CrystalDiskInfo and it says everything is fine. I've run SeaTools and every test seemed to pass (except for one while I was defragging, but I think that was a fluke because I ran it again after the defragging finished and there were no problems). I also ran CrystalDiskMark, and the results are below.    CrystalDiskMark 5.2.2 x64 (UWP) (C) 2007-2017 hiyohiyo   MB/s = 1,000,000 bytes/s [SATA/600 = 600,000,000 bytes/s] KB = 1000 bytes, KiB = 1024 bytes  Sequential Read (Q= 32,T= 1) :    30.303 MB/s  Sequential Write (Q= 32,T= 1) :    16.670 MB/s  Random Read 4KiB (Q= 32,T= 1) :     0.606 MB/s [   147.9 IOPS]  Random Write 4KiB (Q= 32,T= 1) :     0.375 MB/s [    91.6 IOPS]  Sequential Read (T= 1) :    32.929 MB/s  Sequential Write (T= 1) :    20.340 MB/s  Random Read 4KiB (Q= 1,T= 1) :     0.321 MB/s [    78.4 IOPS]  Random Write 4KiB (Q= 1,T= 1) :     0.444 MB/s [   108.4 IOPS]  Test : 1024 MiB [C: 35.1% (325.3/926.1 GiB)] (x5)  [Interval=5 sec] Date : 2017/08/12 18:48:37 OS : Windows 10  [10.0 Build 15063] (x64)


On Blender I like to model helicopters, guns, cars, tanks. The modelling isn't the problem. The problem is getting reference images of the small details, Most of the things I need I can just search on google and find a picture of it. The problem comes when for example I was modelling a AH-6 Little bird and finding what the avionics and general interior is a nightmare, any suggestions of efficient ways of getting reference images?  Thanks for any help :D


Skip a particular package for update and proceed for all others

I am trying to update a production server after some months maybe. While updating the apt cache I get the following message.  sudo apt update Hit:1 http://tw.archive.ubuntu.com/ubuntu xenial InRelease Hit:2 http://tw.archive.ubuntu.com/ubuntu xenial-updates InRelease Hit:3 http://tw.archive.ubuntu.com/ubuntu xenial-backports InRelease Get:4 http://security.ubuntu.com/ubuntu xenial-security InRelease [102 kB]                                                           Ign:5 http://download.owncloud.org/download/repositories/stable/Ubuntu_16.04  InRelease Hit:6 http://download.owncloud.org/download/repositories/stable/Ubuntu_16.04  Release Get:7 http://download.owncloud.org/download/repositories/stable/Ubuntu_16.04  Release.gpg [481 B] Ign:7 http://download.owncloud.org/download/repositories/stable/Ubuntu_16.04  Release.gpg Reading package lists... Done  N: Ignoring file '50unattended-upgrades.ucf-old' in directory '/etc/apt/apt.conf.d/' as it has an invalid filename extension W: GPG error: http://download.owncloud.org/download/repositories/stable/Ubuntu_16.04  Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 47AE7F72479BC94B E: The repository 'http://download.owncloud.org/download/repositories/stable/Ubuntu_16.04  Release' is not signed. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details.   I see that one of the package from ownloud could not be verified. I want to skip updating this package for now and move to update others.  Question:   Should I just move forward with sudo apt upgrade for upgrading all others ?  How to resolve the issue with a package whose public key cannot be verified for following cases :   (i) I trust the package and want to upgrade ?   (ii) I do not want to upgrade this package ever ?   (I will deal with this in the     future though) .


Should questions have question marks at the end of the subject?

I sometimes   removing question marks from the end of the questions. Should question subjects have question mark at the end?


Since the last few releases have nerfed both water elevators and boat elevators, what is left standing as the fastest upward movement method? Ladders? Stairs? Are nerfed boat elevators still the fastest?


I'm trying to move out all of my php legacy code to PDO Statments. All seems it works great, but I commonly use mysql_data_seek function in cases like this, and I'm trying to find a way for PDO, but I honestly don't find anything related with this. This is what I actually do (without PDO)  $query = mysql_query("SELECT * sometable"); $array = mysql_fetch_assoc($query);  $name = $array['name']  // $name is returned well, but now I want to loop it, so I use mysql_data_seek to reset the query. I want just one row, not more.  mysql_data_seek($query, 0);  // now i can loop  while($arr = mysql_fetch_assoc($array)){     echo "name: " . $arr[$arr]; }   So now I'm trying to do something like this:  $query = $conn->query("SELECT * sometable"); $array = $query->fetch();  $name = $array['name'];  // It outputs just one row, that's what I really want to, so I want to loop it now.  foreach($query->fetchAll() as $loop){     echo $loop['name'] }  // This time I don't get anything...   Any suggestions? THANKS!


Prove that the equation $18x+42y=22$ has no integer solution?

Can you help me to prove? Should I prove it  by contradiction and suppose that $x$, y are solutions ?


if  $$z_n\to 0$$, then $$\frac{1}{n}(z_1+\cdots + z_n)\to 0$$  I'm sorry for asking this one, I've seen it in may places before but I cannot think of a way to solve it, and I don't know how to search it here. Also, I've seen the solution before for real numbers.


Adding more logins on meta sites redirects to 404 pages

I've seen this behavior on multiple meta sites, for example:        As soon as you choose to add a new login (To be honest I only tried Google, Facebook and the OpenId box), you get redirected to a 404 page at [meta site url]/users/authenticate. .  In my opinion, since when trying to login (i.e. first time login) on a meta site it redirects to the login page of its main, the "Add more logins" page on meta should also redirect to its main "add more logins" page. I think this would just make it more consistent.


How to view CPU Load on Windows Server 2008

It's a simple question, really, I'd like to check the CPU Load of my Windows Server 2008 machine. This value gets reported to Zabbix, but I have no clue where Zabbix gets the value from.  All I can find on my server is CPU Usage, Processor time, etc, but no load. In Zabbix the value is always between 0 and 4 and I know what it means (number of processess in "Running" or "Runnable" state), but no clue where to check the value on the server itself.


What is the use of the focal plane mark on a camera body?

My camera body has a small marking on one side, indicating the position of the image sensor. (The manual even makes a point of explaining that this mark exists, and what it means.)  What possible reason would I have for knowing this? Why would I care exactly where the sensor is? It's buried deep within the body anyway, so...?


I have a String like that : Sun Jul 21 02:51:39 +0000 2013  i want to convert it to a date with PHP, it's possible ??


After mounting drive (NTFS) via fstab cannot change permissions to newly created directories

I have Ubuntu server edition installed on server machine which is a part of Windows AD. To this server I connected external matrix via miniSas card. There is an NTFS partition which is visible as sde1.  I want to automount it so I used fstab to do this. Here is a line from fstab:  LABEL=lun01 /media/storage/lun01 ntfs defaults,umask=002,uid=1000,gid=10002 0 0   after mount it looks like this (ll -a):  drwxrwxr-x 1 user domain administrators 4096 Apr 13 12:04 lun01/   Everything looks fine here but on this partition I want to create a directory and change its permissions, for example:  cd /dev/sde1 mkdir office chown 'user:office' office   After I do this nothing changes. Also when I try to change permissions with only chmod 770 nothing happens. There is no error info but after ll -a I see that nothing was changed  drwxrwxr-x 1 user domain administrators 4096 Apr 13 12:04 lun01/   Is there a way to achieve what I want? Automount of partition with possibility to change permissions for directories and files stored on it.  Thanks for any reply!


How do I type the infinity symbol in MacTex?

\item Obtain the one-to-one function $f_1$ and $f_2$ by cutting the graph of $f$ at        a certain point ($x_1$, $y_1$) so that domain of ($f_1$)=($-∞$ , $x_1$] and        domain ($f_2$)=[$x_1$,$+∞$)


How do I protect my world in Terraria from corruption and hallow

I want to prepare for hardmode and I am wonder what I can do to protect my world from the spread of corruption and hallow. I've heard that you have to dig around your house and kind of build a barrier but both the corruption and hallow are on one side of my world, so does that mean I just build a wall?


how to create shortcut for an application?

I just successfully opened Godot Engine. It was a .64 file that I learned to run in Terminal with chmod.  Is there a way to add a Shortcut for the Application on my Desktop?.


I have 2 partitions (2.6gb, and 150gb) on one of my (3gb) drives. It had 3, but I removed one that wasn't used.  Disk Utility should allow me to expand the 'lower' (150gb) partition into the free space - but not the 'top (2.6gb) partition.  Is there a way, using terminal or an app, that I can expand that 'top' (2.6gb) partition into the free space?


Flag history not populating in beta site

I had raised a spam flag the other day on  on a question, which was marked as helpful. My user profile page correctly shows one helpful flag (as it was my first flag).  However, when I navigated to my , I was greeted with a blank flag summary, as shown below:    I'm trying to think of situations why this may be the case; is the display of flagging history driven off of normal flags (i.e., not spam/offensive)?  Both of these related questions ( and ) don't appear to be duplicates, since they deal with comments; this spam flag had been thrown on a question.


How did Sauron maintain control of humans far from Mordor?

While as far as I know no clear details are given, in the Lord of the Rings Sauron seems to command huge numbers of humans as well as the Orcs - definitely the Haradrim and the Variags of Khand fight for him.  But how? Do those people know they are working for Sauron, and if so, why do they do it?   I suppose he could offer the local leaders power, but what could he actually offer them, and how would he keep control when they tried to run things for themselves? In the 2nd Age he presumably handled things through the kings wearing the Nine Rings, but at this point they're Nazgul (creepy even when they don't actually have the supernatural fear "turned on") and thus not very good at ruling humans.  Sauron doesn't seem to travel around personally and demonstrate his supernatural powers.  The Orcs don't have any supernatural abilities to demonstrate 'divine sanction', are obviously unpleasant, and are individually weaker than humans.   So Sauron doesn't really seem to have an ability to 'show the flag' far from Mordor.  Does he just send the Nazgul to scare leaders into doing what he wants? But there are only 9 of them and until well into LOTR they have no special transportation - 9 guys really shouldn't be able to keep control of millions of square miles of land with pre-modern communications and transportation (and Sauron has only one Palantir, so he can't use them as magical cell phones).


How to check the directory is empty or not in a single command?

I want a unix command to check the directory is empty or not(need to exclude . and ..) ?  thanks in advance.


How do I make protocol foo hostname-aware?

This is a  about hostname-awareness and proxying.   I know that some protocols are hostname-aware; that is, when I connect to the HTTP server at www.example.com it knows I want www.example.com's HTTP service, not www.example.net's, even though they are on the same IP address.  How can I do this for protocol foo?  (Temporary note: this question appears pursuant to .)


Prove that $f(z) $ is an odd function when $z \in \mathbb{R}$

Given an entire function which is real on the real axis and imaginary on the imaginary axis, prove that it is an odd function i,e $f(-z)= -f(z)$ My attempt :  Here two cases will be possible $1.$ when $z= x$ $2.$ when $z = ix $ I have no any issue when $z=ix$  and solution is alreaday given  but i have some issue when $z=x$ $$f(x) = \overline{ f(\bar x) }$$ $$\sum_{n=0}^{\infty}a_nz^n=\sum_{n=0}^{\infty}\bar a_nz^n \implies a_n=\bar a_n$$ \begin{align} f(x)=\sum_{n=0}^{\infty}a_nx^n&=\sum_{n=0}^{\infty}a_{2n}x^{2n}+\sum_{n=1}^{\infty}a_{2n+1}x^{2n+1} \end{align} Here  $f(x)$  is both  even and odd so here  we are getting  contradiction that  $f(z)$  is odd that mean $f(x)$ is not even function


Difference between font face, typeface, font in the context of typography?

I am confused by the way these terms are used in the context of typography for web applications? Is there an accepted use of these terms and what is the difference when it comes to specifying the look and feel of the content on a webpage?


What are the values of the mass $m$ such that $mx''+25x = 12 \cos(36\pi t)$ will exhibit resonance?

$mx''+25x = 12 cos(36πt)$ my take on this: ${\omega_0} = \sqrt{k \over m} = \sqrt{25 \over m}$ $x_h = c_1cos({\omega_0}t) + c_2sin({\omega_0}t)$ $x_h = c_1cos(\sqrt{25 \over m} t) + c_2sin(\sqrt{25 \over m}t)$ $x_p = {{12 \over {m({\omega_0^2 - \omega^2})}}cos(36\pi t)} = {{12 \over {25-1296m^2}}cos(36\pi t)}$ but I am stuck here. am I on the wrong road?


Systemd timer every minute between 09:15 - 17:15

i need a service to start every minute between 09:15 - 17:15.  Whats the best way to achieve this?  I could make 3 timers, one to start (1) the timer (2) which runs the service every minute and one to stop it (3). but then it wouldn't be robust for reboots in between.


Probabilistic Proof of Kraft-Mcmillan Inequality

Let $\mathcal{C}$ be a finite binary code such that for any two sequences $\{a_n\},\{b_n\}\in \mathcal{C}$ if $a_j\not=b_j$ for some $j$ then the concatenation binary sequence $a_1a_2\cdots a_n\not=b_1b_2\cdots b_n$, the Kraft-Mcmillan Inequality says that $$\sum_{i}\frac{N_i}{2^{i}}\le 1,$$where $N_i$ is the number of codes in $\mathcal{C}$ with length of $i$.  If we assume the code is prefix free, we will have an elegant probabilistic proof at  (consider the infinite binary sequence generated by i.i.d. binomial random variable with probability $1/2$, define $E_x$ be the event that the sequence has prefix $x\in \mathcal{C}$, then $\sum_i\frac{N_i}{2^i}\le \sum_i P[E_x]=  P[\cup_i E_x]=1$). But for the general case one will not necessarily have the events $E_i$s disjoint, I'm curious if similar argument exists for the general case. (The problem is an excercise in the probabilistic method of alon, I guess some probabilistic argument should exist)  (My attempt is that consider the product topology $T=\prod_i\mathcal C$ whose open sets generated by $E_x$s where $x$ is the concatenation codes of $\mathcal{C}$, we define a natural product measure $\mu$ over $T$ by $\mu(E_x)=2^{-|x|}$. Clearly $\mu(T)\le 1$ (as $T$ is a sub-topology of $\prod_i\{0,1\}$), I want to show $\mu(E_x\cap E_y)=0$ for $x\not=y\in \mathcal{C}$, if not we can find $E_z$ such that $E_z\subset E_x\cap E_y$ by compactness, if we can show $z$ can be write as concatenation code start with both $x,y$ we will done, but I get stuck at here.)


Finding limit using inequalities: $\liminf \frac{a_{n+1}}{a_n} \le \liminf (a_n)^ {1/n}\le\limsup (a_n)^ {1/n}\le \limsup \frac{a_{n+1}}{a_n}$

The purpose of this exercise is to prove that $\lim \frac{n}{(n!)^{1/n}}=e$ when $n$ goes to infinity.   In order to find the limit, the following inequality is used when $n$ goes to infinity with ${a_n}$ a sequence of positive terms:   $$ \liminf \frac{a_{n+1}}{a_n} \le \liminf (a_n)^ {1/n}\le\limsup (a_n)^ {1/n}\le \limsup \frac{a_{n+1}}{a_n}$$  What is the proof of this inequality?


Where do I ask for tech-support for my Blu-Ray player?

I have a technical support question about my Blu-Ray player:  Freeze-frame problem in Netflix on my Blu-Ray player For the past couple years or so, I've had a problem with my Sony BDP-S570 Internet-enabled Blu-Ray player.  When I stream a TV show or movie on Netflix, every minute or two the frame freezes for a few seconds.  This isn't a problem with how my Blu-Ray player plays videos in general; there's no freeze-frame issue when I watch Hulu or Blu-Ray discs.  Only Netflix gives this problem. So can anyone tell me what the problem is, and how to fix it?  My question is, what Stack Exchange site, if any, can I post this question in?  The only relevant site I can think of is Super User, but I think the question would be deemed off-topic as an Internet-enabled Blu-Ray player probably doesn't qualify as a computer.


About two months ago, I tried to contact the Stack Overflow team using the email address provided on the Contact Us page.  I have not heard back. Is there an alternate contact address?


is my function correct about SQL injection

for some reasons i can't use PDO so i have created a simple function to clean input data, please view and suggest modification to prevent from SQL and XSS. here is function.  function cleanStr($cStr) {     $cStr = trim($cStr);     $cStr = htmlspecialchars($cStr);     $cStr = addslashes($cStr);     return $cStr; }


Proving without Zorn's Lemma: additive group of the reals is isomorphic to the additive group of the complex numbers

Let $(\mathbb{R},+)$ be the additive group of the reals and $(\mathbb{C},+)$ be the additive group of the complex numbers. Prove that those groups are isomorphic.   I think I got a solution using the fact that the real numbers have a Hamel Basis $B$, then proving that $B\times {0}\cup 0\times B$ is a Hamel basis for the complex numbers and noting that these sets have the same cardinality. However this result relies on Zorn's lemma and is thus not very elementary. Is there a simpler way to get it?


Vote buttons revert to incorrect state when tapping on "Add comment"

When I tap an upvote or downvote button the button turns orange. If I tap on the "Add comment" button on the same post, the vote button reverts to the gray unvoted state.  If I tap again (on the vote button) in 10 minutes, it tells me that I already voted. If I tap again after 10 minutes, it tells me that I already voted more than 10 minutes ago and it's now locked in.  Refreshing the question shows the buttons in the correct state (orange when voted).  This seems to happen after the tabbed model was changes to a single-page model.  * App version 1.0.50 1.0.51 * Samsung Galaxy SIII LTE * Android 4.3    Also:     Same goes when undoing the vote by tapping it again (after the question has been refreshed, of course). Will prompt "You haven't cast a vote to undo" -    I reproduced this as well. Basically, you up vote or down vote, then refresh, then undo your vote, then tap on "Add comment" (the vote button reverts to orange), then try to undo the vote again. You will then get the error mentioned.


Feeders, not help vampires, are the problem

It's all too easy to blame Help Vampires for problems in Stack Overflow.  But it's not them, it's us. The people who feed them.  If the question is an exact duplicate, let them know it's an exact duplicate.  If the question is a trivial question about something from the standard library, don't forget to link to the standard library documentation while answering the question.  If someone asks "Why doesn't this code work?", and the debugging is trivial, don't just do the trivial debugging for them. Show them how they can debug it themselves (for example, tell them about warning flags).  Unfortunately, reputation goes to those who feed the help vampires, not those who help cure them. These feeders don't just get reputation from the vampire. They also get reputation from the rest of the community. (For example, 11 upvotes on an )  I'm not meaning to be ill-intentioned towards the help vampires. Some of them haven't been taught properly how to program or how to problem-solve, and I suspect some of them are so stressed out they aren't thinking straight. Asking a question is more effort than googling, so it's not a case of laziness. But so long as the feeders deliberately don't teach the vampires how to fish as opposed to merely giving them a fish, they're going to continue to be worse off.


I know ? checks for null when placed before a . member access and ?: for conditional statements. Although, I think ?? checks for null as well but I'm not very sure I can't find useful information about ?? on   PS. Actually I didn't look well at the MSDN reference very well. I've just seen its definition now. I though of closing this post before but I won't for the sake of anyone who wouldn't think of referring to ?? as double question marksin their question


Python regex should match a dot but it does not

I have the following Python 3 code:  import re pattern=re.compile(r'\.') print(pattern.match('abc.de'))   The output is:  None   What am I doing wrong? Why the regex does not match the dot?


Why does pressure decreases in the direction of acceleration?

I've read that if a container carrying a liquid is accelerating in horizontal direction then the pressure at same level is not same. It decreases as we move in tge direction of acceleration. Why does the pressure decrease?


var myString = "x",     myObject = {         x: 10     }, value = eval("myObject." + myString); alert(value) alert(myObject[myString]);     I have been reading about eval() function over the internet, but could not really grasp on what it actually does apart from "It Evaluates an expression".  Should we use eval() function only for numeric values?.


Is there a general expression for the volume of an truncated elliptical cone, that is a cone in which both the base surface and top are elliptical and not circles? Both of the ellipses are parallel surfaces if that helps. I have managed to find a general expression for a normal truncated cone at $[\frac π 3(r_1^2+r_1r_2+r_2^2)h]$. Would it be possible to approximate by using the average volume of 2 normal truncated cones calculated by using the 2 sets of radii in the ellipses?


the sound-volume indicator disappeard Ubuntu 13.10

I had a problem with sound after I connected a HDMI-cable. I followed the steps here:   the sound worked perfect, but the sound-volume indicator disappeared


I am seeing unexpected and unwelcome behavior with double arithmetic in Java

Ok, JavaSE 1.8 running an application in Eclipse Version: Oxygen.3a Release (4.7.3a) Build id: 20180405-1200. Simple arithmetic:   Double dblBalance; ( showing as 2072.41 in debug, but also running the app in the IDE)  Double dblAmountofAllocation; ( showing as 1900.0 at runtime )  dblBalance = dblBalance - dblAmountofAllocation; ( dblBalance shows 172.40999995 at runtime) ( my workaround - shouldn't be necessary) dblBalance = Math.round(dblBalance * 100.0) / 100.0;   I have also tested this in a test case compiled and run from the command line. So it is reproducible. Is it the Java runtime engine?   very puzzled - I would like to know if this can be replicated by others. Most combinations of Double values don't have this problem - do I need to stick with the native data types?


I'm drafting a lease which requires tenants to pay rent for the first three months when they sign the lease. Which one of the following is correct? Thanks.  three month rent three month's rent three months' rent


I am a user of Ubuntu with not much experience and I have been using sudo.  What does sudo !! do and how?


Why not have one login to all stack subdomains?

Hello guys,  Whenever i visit a new stack subdomain website, i have to re-register with my google open id. Why not have one login for all sites, that way it wouldn't have to keep re-asking me for my info for a new stack overflow website. Just a suggestion.  Thanks for all the help on all stack subdomains everybody.


I am a complete beginner to Blender and to modeling, and am taking a tutorial for Absolute Beginners to create my first house.  No problems creating the point for the roof, but when I select the edges to try and extrude out the roof and create an overhang, the part I have extruded turns a scratchy grey color.  Later on when I try to add texture or color to the roof, the extended edges turn the same color as the face of the house, not the rest of the roof.  If anyone is able to translate my poor description and help, it would be much appreciated!  Thanks!!


How do I create Ubuntu Live CD with .config and .mozilla inside the ISO?

My question was how to insert in an existing live ISO those two folders and not "How to customize the "the whole" Ubuntu live CD?" Having to install all the tools so that you can do it, and so forth. Is this the only option from scratch? No other way without installation of additional software to insert some line of code in some other ISO config file, telling it from where should be copied into the /home/ folder?      Or just simple to execute some shell file while ISO is still loading to copy straight into the home folder, those necessary folders.       How can this be done? Without the suggested link? I do not wish to install anything, so that later I have to purge again.        I need an Ubuntu Live CD version with my own configuration files on it.   Even an Ubuntu standard distro version is OK. Must not be mine personal.   When I boot with a live CD and copy that inside the /home/, relogin it works fine, but I've to do this every time and that just drives me crazy. And sometimes I forget to bring with me those config files.  So I'm trying to insert .config and .mozilla inside Ubuntu/Lubuntu Live CD  (that is the config that I already have configured myself from OpenBox, panels, Mozilla plugins etc. and so on).  I've looked everywhere and just can't find the solution. I tried on my own, but no luck. In worse case scenario, it will not boot. I just don't know what to touch and what to do.     I am not interested to assign any additional space for it on Live USB (from zero to xyz GB), as you can do that with Pen Drive Linux aka Universal USB Installer and others.     Why? Well from my experience:   Well because it makes it too slow immediately. USB flash even if USB 3.0 is too slow for me. It drives me nuts like win10. And because I need it as a CD/DVD version too. I want to inject everything into a RAM (my 16 GB DDR4 works fine with it).


In windows I can change screen orientation by "Ctrl + Alt + Arrow" as Arrow can be up, left, down or right.  What is the shortcut on Ubuntu? thanks!


I am using an finished template at my school for writing my thesis in LaTeX. I am using TeXShop. My problem is that I can't get the symbol list to appear. It is no problem to get my abbreviations to appear. In the abbreviations I am using e.g.   \newacronym{ARMA}{ARMA}{auto regressive moving average}   For my symbol list I am using e.g   \newglossaryentry{symb:N}{sort={3}, name={$\mathbb N$}, first={first $\mathbb N$}, text={additional $\mathbb N$}, description={Set of natural numbers}, type=symbolslist}   In my main file I am typing:  \printglossary[type=\acronymtype,style=long ,title=Abbreviations, toctitle=Abbreviations] \printglossary[type=symbolslist,style=long ,title=Symbols]   Settings:  \usepackage{makeidx} \usepackage[nonumberlist,toc,acronym]{glossaries} \newglossary[slg]{symbolslist}{syi}{syg}{Symbols} \makeglossaries \include{Abbr} % all abbreviations \include{Symbols} % all symbols   I am compiling it with: latex – pdflatexmk – latex


In how many ways can you select one of the two but not both?

For this question:  A committee of three boys and three girls is to be selected from a class of 14 boys and 17 girls. In how many ways can the committe be selected if:  a.) Ana has to be on the committee.  Ana is a girl so: $$(^{14}C_3)(^{16}C_2)=43680$$  b.) the girls must include either Roberta or Priya, but not both.  I basically needed help in this question (Question B)  Attempts I made so far:  1.) $$(^{14}C_3)*2(^{16}C_2)-(^{15}C_1)=87345$$ 2.) $$(^{14}C_3)*2[(^{16}C_2)-(^{15}C_1)]=76440$$  I need help in what I've been doing wrong in these workings for question B


What does it mean when it is said that "General Relativity and Quantum Mechanics are incompatible"?

In many of the pop-science-y documentaries on theoretical physics I often hear the statement: "General Relativity and Quantum Mechanics are incompatible"  Some googling tells me that "General Relativity cannot be quantized" - my understanding of this statement is superficial.  What exactly does this mean?  I have taken quite a few courses on Quantum Mechanics, and am very comfortable with the subject. I have also taken a course in General Relativity, so I understand its formalism decently well.  Can someone explain this to me? If someone could provide me with some papers/links/literature on the subject I would also be very grateful.


How do I verify that a string only contains letters, numbers, underscores and dashes?

I know how to do this if I iterate through all of the characters in the string but I am looking for a more elegant method.


How can I report a product fault to Microsoft?

I have a Logitech Headset that uses MS Supplied drivers, in this case Generic USBAudio Driver. The sound is really choppy in a 64bit version of Win 7. 32Bit works perfectly fine.   How is it possible for me to notify MS, and get the problem fixed?


I am trying to implement online examination system.  There are two types of question, either fill in the blanks, or multiple choice questions (MCQs).  Right now, I modeled tables as:  questions (     qid INT AUTO_INCREMENT PRIMARY KEY,      question TEXT,     answer VARCHAR(20),     mcq TINYINT(1) );  options (     qid INT,     options VARCHAR(20) );   Options will be stored as:  {     (1,option1),     (1,option2),     (1,option3),     (1,option4) }   MCQ is a 1-bit flag to flag whether it is MCQ or not, if yes, then it fetches options from options table.   For different courses in any institute, should I maintain  different table for different courses, or add course field in question table itself? Is it okay to store answer in questions table, or should I maintain a separate answers table ?  answers (     qid INT,     course VARCHAR(10),     answer );


I need to set date and time in my server in order to make them synced always. I cannot use ntp inside my channel due to proxy issues. I've found  workaround. It works fine when I run it in command line interface. However when I add that command into a crontab job it work unexpectedly ie. set's time 00:00:00 whenever it is run.  This is my command in crontab:   */1 * * * * date -s "$(curl -sD - google.com | grep '^Date:' | tr -d '\r,' | awk '{print $2, $4, $3, $6, $7, $5}')"   I also tried to run as a shell script like:  */1 * * * * /usr/local/sbin/test.sh   No luck! So how can I solve this problem? What is wrong with my crontab job?


The primitive of a discontinuous function?

I'm thinking about the primitive of an arbitrary function. As we all know, every continuous function has a primitive according to the Newton-Leibniz formula, $\int_{x_0}^{x} f(x) dx$ is the primitive of function $f(x)$. However, if $f(x)$ is discontinuous, say has a point of discontinuity of the first kind, the the integral has both left and right derivative, but they don't coincide. So the question is whether we are able to find a primitive for those kind of functions. Or more generally, what kind of function has a primitive?


How do I make a live USB on Ubuntu 18.04.2 LTS (Bionic Beaver)?

I have tried everything, and it just trous put errors. How can I fix it?


I am a beginner for the regular expressions pattern matching in python. please help me to solve this problem.   I want to extract some texts from the given string. Please check the below example.     String :   "keyword//match1/match2/more_text_with_/_more_and_more_/_texts"      I need to extract "match1" and "match2"   I wrote the following python code to do that...  import re astr = 'keyword//match1/match2/more_text_with_/_more_and_more_/_texts' match = re.search('keyword//(.*)/(.*)/.*', astr)  print("match1 : ", match.group(1)) print("match2 : ", match.group(2))   The result is...  match1 :  match1/match2/more_text_with_                                                                      match2 :  _more_and_more_    I read about "How Regex Engine Works" from here   And I can understand why this result comes. But I have no idea to write a regular expression to get my required matching texts.  Please help me with this.   Thank you very much,


Let $F(n)$ be $n$-th Fibonacci-number. Then the following holds: $$F(n)^2+F(n+1)^2=F(2n+1).$$ I have proved, but I want a brief proof. Do you know anything about it?


How can I find WPF controls by name or type?

I need to search a WPF control hierarchy for controls that match a given name or type. How can I do this?


At the end of District 9, it transpires that      all the alien mothership needs is some of that black juice, and then it starts working again.   Given that all the alien technology came from the mothership in the first place, why didn't they just do that right at the start? Why did they even stop at Earth?


I've been writing some Wordpress plugins, and I've been having some problem with Wordpress putting magic quotes on POST and GET data.  Specifically, the "wp_magic_quotes" function in \wp-includes\load.php, which is called (presumably on every response) in wp-settings.php.  This function adds magic quotes to the data even if I turn off magic quotes in PHP settings.  /**  * Add magic quotes to $_GET, $_POST, $_COOKIE, and $_SERVER.  *  * Also forces $_REQUEST to be $_GET + $_POST. If $_SERVER, $_COOKIE,  * or $_ENV are needed, use those superglobals directly.  *  * @access private  * @since 3.0.0  */ function wp_magic_quotes() {     // If already slashed, strip.     if ( get_magic_quotes_gpc() ) {         $_GET    = stripslashes_deep( $_GET    );         $_POST   = stripslashes_deep( $_POST   );         $_COOKIE = stripslashes_deep( $_COOKIE );     }      // Escape with wpdb.     $_GET    = add_magic_quotes( $_GET    );     $_POST   = add_magic_quotes( $_POST   );     $_COOKIE = add_magic_quotes( $_COOKIE );     $_SERVER = add_magic_quotes( $_SERVER );      // Force REQUEST to be GET + POST.     $_REQUEST = array_merge( $_GET, $_POST ); }   Is it safe for me to just comment out the wp_magic_quotes() call in wp-settings.php?  That is, will it negatively affect the normal Wordpress code and/or open up some exploitation vector?  If so, is there some other way to do it besides modifying WP code (so I don't have to deal with this every time there's an update)?


What is the difference between connecting database using PDO or mysqli_connect, etc?   What are the pros and cons of each approach? Which one is the preferred approach?  Here are my examples:  First the PDO approach.  <?php  $username = 'root'; $password = ''; $connection = new PDO( 'mysql:host=localhost;dbname=pacificsky', $username, $password );  ?>   and here is the mysqli_connect.   $db = mysqli_connect('localhost','root','','pacificsky');


How to put footer on bottom on page permanently

How do I write inside my footer and keep it at the bottom of the page?    .underbar { bottom:0; width:100%; height:60px; background:#000000; } <footer class="underbar">  </footer>


How did the term "dongle" come into use?

Why was the word "dongle" chosen to represent this kind of hardware device?  I can imagine that it was related to the word "dangle"... since dongles tend to dangle - but that's just my hunch and not truly historic.    The Oxford English Dictionary (OED) lists the etymology of 'dongle' as "arbitrary"... so no help there.    The OED cites two sources of note:   1981   New Scientist 1 Oct. 24/3:   Many programs written for the Pet computer make use of a device known as a dongle. The dongle is an extra piece of memory that is plugged into the computer, without which the program refuses to run. 1982   MicroComputer Printout Jan. 19/2:   The word ‘dongle’ has been appearing in many articles with reference to security systems for computer software [refers to alleged coinage in 1980].


Sorting references with special characters alphabetically

I have a problem within the reference list. Namely I have some references where the authors first surname letter is Š (\v{S}) and when listing them in the references they appear amid those authors whose surname starts with V instead after those whose surname starts with S and those whose starts with T (it should list R, S, Š, T... and not R, S, T, U, V with Š in between)  Here is my minimal working example:   \documentclass{article}  \usepackage{filecontents}  \begin{filecontents}{AA.bib}  @article{simovic13, Author = {\v{S}imovi\'{c}, H. and Deskar-\v{S}krbi\'{c}, M.}, Journal = {Zbornik radova Ekonomskog fakulteta u Rijeci}, Number = {1}, Pages = {55--78}, Title = {Dynamic effects of fiscal policy and fiscal multipliers in {Croatia}}, Volume = {31}, Year = {2013}}  @misc{tenhofen07, Author = {Tenhofen, J. and Wolff, G. B.}, Note = {Deutsche Bundesbank Discussion Paper Series 1: Economic Studies No. 14. Frankfurt am Main: Deutsche Bundesbank}, Title = {Does anticipation of government spending matter? Evidence from an expectation augmented {VAR}}, Year = {2007}}  @misc{spilimbergo09, Author = {Spilimbergo, A. and Symansky, S. and Schindler, M.}, Note = {IMF Staff Position Note No. 11. Washington: International Monetary Fund}, Title = {Fiscal multipliers}, Year = {2009}}  @misc{ver11, Author = {Verhelst, S.}, Note = {Egmont Paper, No. 47, Brussels: Egmont Institute}, Title = {The Reform of European Economic Governance: Towards a Sustainable Monetary Union?}, Year = {2011}}  @article{vuckovic10, Author = {Vu\v{c}kovi\'{c}, V.}, Journal = {Privredna kretanja i ekonomska politika}, Number = {125}, Pages = {61--88}, Title = {Political Business Cycles: Do They Exist in {Croatia?}}, Volume = {20}, Year = {2010}}  \end{filecontents}   \begin{document} \nocite{*}   \bibliographystyle{plain} % works % \bibliographystyle{alpha} % works ... % \bibliographystyle{apalike} % works \bibliography{AA} \end{document}   I am thankful for any help!!!  Ana


Why is there not a choice to request questions to be moved to another stackexchange group?

Regularly I see questions, that do not belong in the correct stack exchange group.  For e.g. duplicates, you can close a question and add a duplicate of the link.  However, sometimes a question belongs to a different stack exchange group, and there is no way except to flag the question and ask it to be moved.  Wouldn't it be more efficient to move it? It could even be voted upon by users.  (example: )


I am using Ubuntu with VMware.  I am unable to login using my password. I have tried multiple times but could not login.  Now, I have created another virtual machine. But,I need to access the data from the machine,which I am not able to login.  What can I do now?


I want to write an algorithm in a table for my paper. I tried to write it, but I want to write ''While'' instead of ''for'' in this algorithm. How can I do it? And I want to put the table everywhere in the text.  \begin{algorithm}     \caption{ OMP Algorithm     }     \label{alg1}     \begin{latin}         \begin{algorithmic}[1]             \REQUIRE Decomposition of signal $x$             \STATE\textbf{Input:}  signal $x \in \mathcal{R}^{m}$, Dictionary $\mathcal{G} \in \mathcal{R}^{m \times n}$,$\hat{x}=\emptyset$              \STATE  \textbf{Output:}  Decomposed signal $\hat{x}_{est}$ after $k$ iteration, Residual $R^{(k)}$       \STATE \textbf{Initialization} $R^{(0)}=x$             \STATE \textbf{for i=1:k do}             \STATE $l=\displaystyle{arg\max_{l=1,\dots ,l} |\langle g_l,R^{(i)} \rangle|}$ \qquad finding the atom in dictionary $\mathcal{G}$ with maximum correlation with residual.             \STATE $R^{(i+1)}=R{(i)}-a_l g_l^{(i)}$             \STATE $\hat{x}=\hat{x}+\langle R^{(i)},g_{l}^{(i)} \rangle g_{l}^{(i)}$       \STATE \textbf{end}         \end{algorithmic}     \end{latin} \end{algorithm}


How to set two different HDRI, one for environment lighting, and another for background, in 2.8 using Eevee?

I figured out how to use a normal image as the background while using an HDRI for environmental lighting. But I can't figure out how to use a different HDRI as the background.  Please note I already read this answer:  but this appears to be different for Eevee in 2.8.  Thanks!


Can a left coset be strictly contained in a right coset?

Let $G$ be a group, and let $H$ be a subgroup of $G$. Let $x,y\in G$ be such that $xH\subseteq Hy$. Can we conclude that $xH=Hy$? this certainly holds if $H$ is finite because both sets will have the same finite cardinality. But what about the case $|H|=\infty$? I am especially interested in the case $x=y$.  EDIT: As Thomas Andrews pointed out in the comments, it is suffices to consider the case $x=y$, because the hypothesis $xH\subseteq Hy$ implies $x\in Hy$, hence $Hy=Hx$. And so, the question becomes:     Can a subgroup (of a group, of course) strictly contain some of its conjugates?


pgAdmin 4: How to establish a connection through an SSH tunnel/interface in Windows

I installed the latest pgAdmin 4 (v2.1) but I found out that (), for the moment, the only way to establish a connection through an SSH tunneling is using another outside process, an  says:  I setup a tunnel as follows: ssh -f dpage(at)hostname(dot)enterprisedb(dot)com -L 5999: hostname.enterprisedb.com:5432 -N  (...) I was running on Mac, but the same procedure should work on Linux. On Windows, there's a tunnelling app in Putty iirc, but I don't know how to use it offhand.  I have found a simple . The connection is established but it seems, when I try to connect through pgAdmin it fails or is refused (using 127.0.0.1:3306 or 127.0.0.1:5432 as the tunnel's destination). Why?


How can I remove a pre-installed application on macOS Sierra

I need to remove one of the pre-installed applications (Safari in my case) from a macOS Sierra system. Yet simply deleting the app, installing 3rd party "cleaning" software or any attempts to delete it via the terminal remain unsuccessful. I found out that since Mac OS 10.11 apple features so called 'System Integrity Protection', that basically forbidds its users to modify or uninstall 'system relevant applications'.  So how can I remove a pre-installed application on such a system?  PS: I already know that this may be a bad idea in regard of future upgrades. Nevertheless let's just assume I'm willing to take the risk and am just looking for ways to get this done.


I have two sections(An HR section and an Approver section) in Infopath. I have a list of HR Users and Approver Users. How can I display only the appropriate section to the appropriate users?


Where is the Linux Subsystem's filesystem located in Windows 10?

It's pretty clear that Windows' 10 "host" filesystem is mounted at /mnt/c/ from "Linux" perspective of view. But is it possible to get an access to "Linux" filesystem from Windows? If so, where it is?


Extract entire string following specific characters & trouble with str_extract()

I'm trying to extract every character following a specific string. I can get this to work on regular expression testers such as Pythex (if there's a good regex expression tester for R, let me know). I'm trying to get every character after "100" in the following string: \nDec\n\n\n\n\n\n\n8238\n\n\n\n \n                                    \n\n1st \n\n\n100\n\n\n\n\n\n\n\n10.40\n (1.5) \n\n\n\n1st\n\n\nLJ\n\n\n\n\n\n\n\n7.47m\n (1.4) \n \n\n24' 6.25\"\n\n\n\n\n3rd\n\n\nSP\n\n\n\n\n\n\n\n14.41m\n \n \n\n47' 3.5\"\n\n\n\n\n2nd\n\n\nHJ\n\n\n\n\n\n\n\n1.85m\n \n \n\n6' 0.75\"\n\n\n\n\n9th\n\n\n400\n\n\n\n\n\n\n\n46.78\n \n\n\n\n1st\n\n\n110H\n\n\n\n\n\n\n\n13.98\n (1.9) \n\n\n\n1st\n\n\nDT\n\n\n\n\n\n\n\n39.91m\n \n \n\n130' 11\"\n\n\n\n\n8th\n\n\nPV\n\n\n\n\n\n\n\n4.70m\n \n \n\n15' 5\"\n\n\n\n\n4th\n\n\nJT\n\n\n\n\n\n\n\n55.71m\n \n \n\n182' 9\"\n\n\n\n\n5th\n\n\n1500\n\n\n\n\n\n\n\n4:23.57\n \n\n\n\n1st\n\n  On sites such as Pythex, I'm able to capture everything that comes after 100 (). However, when I try using stringr's str_extract, I only receive "" as an output dec_res <- "\nDec\n\n\n\n\n\n\n8238\n\n\n\n \n                                    \n\n1st \n\n\n100\n\n\n\n\n\n\n\n10.40\n (1.5) \n\n\n\n1st\n\n\nLJ\n\n\n\n\n\n\n\n7.47m\n (1.4) \n \n\n24' 6.25\"\n\n\n\n\n3rd\n\n\nSP\n\n\n\n\n\n\n\n14.41m\n \n \n\n47' 3.5\"\n\n\n\n\n2nd\n\n\nHJ\n\n\n\n\n\n\n\n1.85m\n \n \n\n6' 0.75\"\n\n\n\n\n9th\n\n\n400\n\n\n\n\n\n\n\n46.78\n \n\n\n\n1st\n\n\n110H\n\n\n\n\n\n\n\n13.98\n (1.9) \n\n\n\n1st\n\n\nDT\n\n\n\n\n\n\n\n39.91m\n \n \n\n130' 11\"\n\n\n\n\n8th\n\n\nPV\n\n\n\n\n\n\n\n4.70m\n \n \n\n15' 5\"\n\n\n\n\n4th\n\n\nJT\n\n\n\n\n\n\n\n55.71m\n \n \n\n182' 9\"\n\n\n\n\n5th\n\n\n1500\n\n\n\n\n\n\n\n4:23.57\n \n\n\n\n1st\n\n"  > str_extract(dec_res, "(?<=100).*") [1] ""  Is my issue that I don't know R-specific regex syntax? Or, is this a particular behavior of str_extract?


Relativity: easy spaceship scenario. easy questions

Your spaceship is traveling at 1/2*c and you approach Bob's spaceship going -1/2*c in the opposite direction. Relative to you, Bob is going the speed of light, and of course he has a giant ticking clock for all to see. From your perspective, Bob's clock looks like it is completely stopped.   1) Can you even see the clock as you approach it? It's coming at you at the same speed light propagates toward you.  2) Do all of Bob's light rays hit you at the same time when Bob passes you so that you would see a long blur/beam of where Bob has been traveling? Could it be more like a big flash because all the photons arrive at the same time, built up like a sound waves before a jet breaks the sound barrier?  3) From Bob's perspective, the light from his clock hit you long ago. Or another way to think about this: say Bob turned on a laser beam pointed at you 10 years before passing you. Bob thinks the laser finally reached you 5 years before you both pass each other. But you still don't see the light until you pass him?! It's tough to wrap my head around this. Idea?  4) Can you see Bob after he passes you? From your perspective, light would have to catch up to him in order to rebound back to you. Perhaps light coming from the side would allow you to see his moving away from you. From Bob's perspective, after you pass him his light will never reach you again because you are traveling away as fast as his light.  5) One step further: if Bob was flying at -2/3*c, is Bob's clock ticking backwards from your perspective? Would you see him pass you before you see him approaching you a mile away?


Aligning letters "Wrong" appears more "Right"

I'm currently working on a logo for a client. Here is the work in progress.   It seems obvious to me that the S should align with the line above. I feel that the best way of aligning it however is to align the bottom part of the S rather than the top curve, even thought the top curve does protrude more. See the following example   Also at the other end of the logo, the A I feel can do something similar, minimising the white space triangle at the end of the logo    The end result I think is more pleasing in its alignment   I feel that this is correct, but my client is questioning it. This alignment is a habit I have picked up during my career, so I haven't been formally taught this, in fact I can't remember where I picked this up.   Tell me, have I picked up a bad habit here? Is my client correct? If this is correct does this type of alignment have a name? Or is there an article somewhere I can refer my client to?


Does it matter what order I do the missions in Saint's Row 2?

I randomly decided to do all the Ronin missions first in SR2. However, a character dies in Bleeding Out, which means they won't be in the rest of the game (I assume). Would they have appeared in cutscenes or plots for other missions if I had done those missions before Bleeding Out?  To be specific:      Not Gat, who is addressed in  but Aisha.


Should you post a probably correct answer as an answer or a comment?

Many people often post possibly correct answers as comments, because they're not sure if it's correct and don't want to receive downvotes. However, these comments often are correct and this causes problems, as a comment cannot be marked as an answer.  As an answer, it could be deleted if it's not helpful, but then it would just waste time and could be marked correct by the person asking the question because they don't fully understand the topic (the entire reason why they're asking the question).  Would it be better to post a possibly correct answer as an answer or as a comment? ...or not post anything at all?


New to python, changing a value in a list of lists?

I'm new to python and am trying to modify a single value in a list of lists.  I come from java experience.  I am writing code for a chess application to familiarize myself with python.  board is a list of lists that contains all the pieces that exist on the board.    def updateMoves(self):     for i in range(self.getY()+1,col,1):         if board[self.getX()][i] != None:             self.canMove[self.getX()][i]=False             break;         else:             self.canMove[self.getX()][i]=True  def printMoves(self):     s=""     for i in range(row):         for k in range(col):             if self.canMove[i][k]==True:                 s=s+"T,"             else:                 s=s+"x,"         print(s)         s=""   GetY and X return a value stored on the piece of it's current position on the board(in this case the piece is in 2,2).  The values in my list are started out as all false this code results in the canMove list(local to the class) looking like this: (x is false)  x,x,x,T,T,T,T,T, x,x,x,T,T,T,T,T, x,x,x,T,T,T,T,T, x,x,x,T,T,T,T,T, x,x,x,T,T,T,T,T, x,x,x,T,T,T,T,T, x,x,x,T,T,T,T,T, x,x,x,T,T,T,T,T,   I decided to put breakpoints in, and on each loop of the array it changes the entire column to True.  Any idea why this might be? I'm assuming its a syntax issue, but can't find anything in my google searches.


Can I transfer a profile onto a different PS3 account?

My dad set up a PS3 profile for me a while ago on his PS3 with an account he made since I didn't have my own e-mail address at the time.    Now I have my own PS3 and e-mail address and would like to transfer my old profile onto my own PS3.  Since it's under one of my fathers accounts I'm not sure if I am able to get it.    Are multiple profiles on PS3's in separate accounts from each other or are they all under the same account on a PS3?  If they are all under the same account is there a way to transfer a profile onto a different account?


This is from Rudin's Principles of Mathematical Analysis, Example 2.21.  Let us consider the following subset of $R^2$:  (c) A nonempty finite set.  The book says it is closed and bounded but not open nor perfect.  My problem is with it being closed, I don't understand why. I know there is already a similar post for this here, but I don't quite get it.  I know that a closed set contains all its limit points. I imagined a set $S$ of discrete points on the plane. For each point, if we construct a radius, we find that the $N_r(p)$ for each p in the set will not contain any points of S. So I don't think any of them are limit points.  But then if I take a look at its complement, it is clear that the complement $S^c$ is open which means that the set is closed. So I am confused. Also, I think I remember something about the definition of a closed set being vacuously true but I'm not sure how to relate it here (I lost my notes for this).  So my questions would be:  1) Why is the set closed (without using the complement of $S$, possibly using logic to think it through)?  2) Is my reasoning using the complement of $S$ correct?  Thank you.


What is the VTable Layout and VTable Pointer Location in C++ Objects in GCC 3.x and 4.x?

I am looking for details of the VTable structure, order and contents, and the location of the vtable pointers within objects.   Ideally, this will cover single inheritance, multiple inheritance, and virtual inheritance.  References to external documentation would also be appreciated  Documentation of GCC 4.0x class layout is  and the Itanium, and more broadly GNU, ABI layout documents are .


Limit involving floor function: $\lim\limits_{x\to 0} x \left\lfloor\frac1x \right\rfloor$

I'm studying calculus right now but I'm stuck at solving a limit involving floor function.  The problem is to find $$\lim_{x\to 0}x \left\lfloor\frac{1}{x} \right\rfloor$$ where $\lfloor\cdot\rfloor$ denotes the floor function.  My first thought was to let $x=1/t$ so when ${x\to 0+}$ then ${t\to \infty}$ so it seems $\lim_{t\to \infty}[t]/t$ doesn't exist. But I can't go any further and don't know whether my thought is correct. It seems $t=N+\delta$ doesn't help because t goes to infinity. Can it be proved by the epsilon-delta method or something else? Thank you for your help.


Is there any way to recover an old iOS save file?

I played Final Fantasy Tactics on my old iphone and got 20+ hours into it. I then went to android and am now back to iphone (please, let's not start a flame war!) and I was wondering if there is any way to recover my old save files?  Is this stuff stored in iCloud? If so, how can I check to see if my save files are there?


I have recently moved into a new home and discovered that my dryer plug does not fit into the outlet. I have a three pronged plug and need a four prong plug. how do i wire the new cord into my dryer?


What do the numbers in parentheses near the commands mean?

In some manuals online I see numbers in parentheses following the commands, like  (sshd(8), ssh_config(5), etc.). What does this mean, and why is it important to indicate/show the number?


Class template value without template arguments error

I have some code: template<typename Container = std::vector> // there is error class SomeClass {     struct SomeDataStructure {         int a;         float b;     };      Container<SomeDataStructure> container; // and there };  I want to pass template class type in template arguments of other template class. In this example, I want to pass std::vector to SomeClass and define Container(std::vector) of private structure SomeDataStructure. But I'm getting errors(MSVC compiler) C2059 and C2238. How can I solve it? Thanks in advance!


Including PNG image produces error with latex+dvips+ps2pdf

I'm compiling the following file hello.tex, which contains a picture:  \documentclass[12pt]{article} \usepackage{graphicx} \begin{document} \includegraphics[width=5cm, natwidth=1079, natheight=377]{x.png}  \end{document}   This produces the correct output with xelatex hello.tex. However, for various reasons I need to use latex+dvips+ps2pdf:  latex hello.tex dvips hello.dvi ps2pdf hello.ps   However, the last step produces an error:  C:\Users\Bai\Desktop>ps2pdf hello.ps Error: /syntaxerror in (binary token, type=137) Operand stack:  Execution stack:    %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1967   1   3   %oparray_pop   1966   1   3   %oparray_pop   1950   1   3   %oparray_pop   1836   1   3   %oparray_pop   --nostringval--   %errorexec_pop   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval-- Dictionary stack:    --dict:1197/1684(ro)(G)--   --dict:0/20(G)--   --dict:79/200(L)--   --dict:102/300(L)--   --dict:43/200(L)-- Current allocation mode is local Last OS error: No such file or directory Current file position is 22237 MiKTeX GPL Ghostscript 9.19: Unrecoverable error, exit code 1   Any idea what could be causing this?


How do I group records to have one record per date with a column that has various alphabets?

Sample table:  date    |  name  | record   7/27/16 | john   | H   7/27/16 | john   | P   7/28/16 | john   | P   7/28/16 | john   | L     Results:  date    |  name  | record   7/27/16 | john   | H,P   7/27/16 | john   | H,L     Query:  SELECT      date, name, record  FROM     TABLE  GROUP BY      date, name, record(not sure how to do this part)


Using same parameter for multiple functions

Is this code valid?  var myfunc1 = function( parameter ) {     parameter = smthg || 0;     //code here }  var myfunc2 = function( parameter ) {     parameter = smthg || 0;     //code here }   In jQuery, developers use single word parameter like e,t,n many times in their library, so I guess it is safe to use the same parameter again and again?


Sines and cosines of angles in arithmetic progression

Prove that if $\phi$ is not equal to $2k\pi$ for any integer $k$, then  $$\sum_{t=0}^{n} \sin{(\theta + t \phi)}=\frac{\sin({\frac{(n+1)\phi}2})\sin{(\theta+\frac{n \phi}2)}}{\sin{(\frac{\phi}2)}}$$  Find a similar formula for  $$\sum_{t=0}^{n}\cos{(\theta+t\phi)}$$  where the functions sin and cos appear on the right-hand side.  Find, for all $\theta$, the values of   $$\sum_{t=0}^{n}\cos^{2}{(2t\theta)}$$ and $$\sum_{t=0}^{n}\sin^{2}{(2t\theta)}$$


Hide admin tool bar from back end dashboard

How do we hide the admin toolbar from the back end dashboard?  We can hide the toolbar when viewing the website with the below code but we want to also hide it from back end?  add_filter('show_admin_bar', '__return_false');   Thank you


selecting specfic option from a drop down menu using js

HTML code :   <select id = "menu"> <option value="2017">2017</option> <option value="2016">2016</option> <option value="2015">2015</option> </select>   What I have tried :   document.getElementById("menu").selectedIndex = 2015;


I have a folder structure, like this:   forum   .htaccess [some more files]  forum_english   .htaccess [some more files]    forum/.htaccess looks like this:  RewriteEngine on  RewriteCond %{HTTP_HOST} \.(com|net)$ [NC] # just rewrite if the query comes from an english languaged domain RewriteRule ^(.*)$ ../forum_english/$1  #some more RewriteRules from another forum. I don't know, if I am allowed to show them. They should work well, side by side.   forum_english/.htaccess is the default .  Sadly this causes an infinite loop. To prevent this, I have to insert a [L]-Flag which skips the forum_english/.htaccess-file (but the rules in this file should be executed, too!). I also tried the [N=2]-Flag instead ... but still infinite loop.  I use Apache 2.2.17 and have no access to error_logs or the files in /etc/apache2/sites-enabled/.  Any ideas what I did wrong?


Getting error while installing log4db2 utility

DB21034E  The command was processed as an SQL statement because it was   not a valid Command Line Processor command.  During SQL processing it   returned: SQL0601N  The name of the object to be created is identical   to the existing name "LOG_CONF_BP" of type "BUFFERPOOL".    SQLSTATE=42710   How to remove pre-existed "LOG_CONF_BP" of type "BUFFERPOOL" in db2 database? Is there any other way to define logging for my stored procedures?


I have created a small program to understand Java Volatile keyword:  public class MultiThreadedCounter implements Runnable {      private volatile int counter = 0;      public void run() {          increment();         decrement();      }      private void decrement() {         counter = counter - 5;         System.out.println("dec = " + counter);     }      private void increment() {         counter = counter + 5;         System.out.println("inc = " + counter);     }      public static void main(String[] args) throws InterruptedException {         MultiThreadedCounter m = new MultiThreadedCounter();         Thread[] t = new Thread[100];         int count = 0;         while (true) {             if (count >= 100) {                 break;             }             Thread t1 = new Thread(m);             t[count] = t1;             count++;         }          for (int i = 0; i < t.length; i++) {             t[i].start();         }     }  }   Now in this program, I am seeing different set of results when I run the program multiple times.  Then I tried removing the volatile keyword for counter variable and observed similar results. i.e I am seeing different results when I run the program many times.  How Volatile helps in this program? When we need to use this keyword, I have gone through some material ans SO posts but I am not getting clear picture of the usage of this keyword.


Down arrow button for choosing the desired site

When searching for the desired SE site, the down arrow key (down) should work in order to choose the site one is looking for and hit enter to visit it, instead of using the mouse point to choose it. Would be pretty convenient.


Single Image Transition from Right to Left using FFMPEG and stop at end

I am having a single Image which I want to slide (Transition) from right to Left and stop at the end point and convert that into Video using FFMPEG. Although there are many posts regarding transitions but I couldn't find transition for single image to Video.  I had used the solution from :  ffmpeg -i C:\Sagar\Projects\Demos\Canvas\Canvas\BoxImage\1\output.png -i C:\Sagar\Projects\Demos\Canvas\Canvas\BoxImage\1\output.png -filter_complex "[0:v][1:v]overlay=x='if(lte(-w+(t)*100,w/2),-w+(t)*100,w/2)':y=0[out]" -map '[out]' -y C:\Sagar\Projects\Demos\Canvas\Canvas\BoxImage\1\outputout.mp4  but gives an error "Invalid stream specifier [out]":    I have also tried  ffmpeg -f lavfi -i "color=black:d=15:s=1920x1080[background];movie='C:\Sagar\Projects\Demos\Canvas\Canvas\BoxImage\2\output.png' [overlay];[background][overlay]overlay='W-n:(H-h)/2'" C:\Sagar\Projects\Demos\Canvas\Canvas\BoxImage\2\outputoutput.mp4   But it still gives me error as below


How to edit known_hosts when several hosts share the same IP and DNS name?

I regularly ssh into a computer which is a dual-boot OS X / Linux computer. The two OS instance do not share the same host key, so they can be seen as two host sharing the same IP and DNS. Let's say the IP is 192.168.0.9, and the names are hostname and hostname.domainname  As far as I understood, the solution to be able to connect to the two host is to add them both to the ~/.ssh/know_hosts file. However, it is easier said than done, because the file is hashed, and has probably several entries per host (192.168.0.9, hostname, hostname.domainname). As a consequence, I have the following warning  Warning: the ECDSA host key for 'hostname' differs from the key for the IP address '192.168.0.9'   Is there an easy way to edit the known_hosts file, while keeping the hashes. For example, how can I find the lines corresponding to a given hostame? How can I generate the hashes for some known hosts?  The ideal solution would allow me to connect to seamlessly to this computer with ssh, no matter whether I call it 192.168.0.9, hostname or hostname.domainname, nor if it uses its Linux hostkey or its OSX hostkey. However, I still want to receive a warning if there is a real man-in-the middle attack, i.e. if another key than these two is used.


nullPointerException while using DataInputStream and DataOutputStream to send and int

I'm practicing on a simple Client / Server connection. The client is supposed to send an Int to the server, and the server is supposed to print this int. However, the server encounters a NullPointerException and doesn't print the int sent by the client. Here is my server: package primitives;  import java.io.DataInputStream; import java.io.IOException; import java.net.ServerSocket; import java.net.Socket;  import bytes.Server;  public class DataServer { private ServerSocket serverSocket; private static DataInputStream in;  public DataServer(int port) throws IOException {     serverSocket = new ServerSocket(port);     System.out.println("Server ready at: " + serverSocket);     Socket clientSocket = serverSocket.accept();      System.out.println("New client connection: " + clientSocket);     in = new DataInputStream(clientSocket.getInputStream()); }  public void close() throws IOException {     serverSocket.close(); }  public static void main(String[] args) throws IOException {     Server server = new Server(9000);     int a = DataServer.in.readInt(); // NullPointerException Here     System.out.println(a);     server.close();      System.out.println("closed"); }  }  And my client: package primitives;  import java.io.IOException; import java.net.Socket; import java.io.DataOutputStream;  public class DataClient {      private Socket socket; private DataOutputStream out;  public DataClient(String host, int port) throws IOException {     socket = new Socket(host, port);     System.out.println("Socket ready: " + socket);     out = new DataOutputStream(socket.getOutputStream()); }  public void close() throws IOException {     socket.close(); }  public static void main(String[] args) throws IOException {     DataClient client = new DataClient("127.0.0.1", 9000); // use port configured in the server code     client.out.writeInt(154);     client.out.flush();     client.close(); }  }  Thank you for your help. I've been trying to search for solutions but couldn't find any, therefore I am sorry if there is a solution that is easily available or if this question has already been asked.


What do you do with the items that are made on Imperial levels in Tiny Death Star?

You 'collect' them when done and have an inventory of them.  Can they be sold?