Null pointer exception in writing excel using java poi

I'm trying to write a java class that computes the age of the person by getting his/her birth year on excel file. I was successful in computing it and displaying the age on console using System.out.print(age);, however, I'm getting java.lang.NullPointerException on cell.setCellValue(age); Here's a snippet of my code:  int year = Calendar.getInstance().get(Calendar.YEAR); int age; for(int i = 0; i < birthdate.size(); i++){     String bday = birthdate.get(i).toString();     String y = bday.substring(7, 11);     age = year - Integer.parseInt(y);     cell = sheet.getRow(i+1).getCell(5);     cell.setCellValue(age);     System.out.print(cell + " \t "); }


Let $x_1, x_2, \ldots ,x_n$ be positive real numbers, and let $$ S = x_1 + x_2 + \cdots + x_n.$$  Prove that  $$ (1+x_1)(1+x_2)\ldots(1+x_n)  \le 1 + S + \frac{S^2}{2!} + \cdots + \frac{S^n}{n!}$$  Here's my attempt:  Case 1 : Let $x_1 = x_2= x$ (When all terms are equal)  $LHS = (1+x)(1+x) = 1+2x+x^2$  $RHS = 1+\frac{x+x}{1!}+\frac{(x+x)^2}{2!}=1+2x+\color{blue}{2}x^2$  Hence when all terms are equal, $LHS<RHS$.  Case 2 : $x_1\ne x_2$  $LHS=(1+x_1)(1+x_2)=1+{x_1}{x_2}+(x_1+x_2)$ $RHS=1+ (x_1+x_2)+\frac{(x_1+x_2)^2}{2!} =1+{x_1}{x_2}+(x_1+x_2)+\color{blue}{\left(\frac{x_1^2+x_2^2}{2}\right)}$  Hence when even one term is not equal, $LHS\lt RHS$.  From the two cases, it's clear that under no circumstance $LHS \gt RHS$. And hence the (partial) proof.  Is there any way I can improve my proof? If you look again I've considered only two terms and my intuition tells me that it would apply to the entire range but how do I state it mathematically? Or can you think of a better or more rigorous proof than this?  Thanks again!


Why do I have to import java.awt.* AND java.awt.event.* (for example)

In an exercise program I'm working on right now, it calls for a handful of imports, like so:  import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.event.HyperlinkEvent; import javax.swing.event.HyperlinkListener; import java.net.URL;   ELI5: My question (I'm slightly past the newbie beginner tutorials, and getting into intermediate? now.) is just as the title suggests. Am I actually required to import java.awt.event.* if I've already covered it with java.awt.*?  If not, why is this the seeming convention?


Is there a Stack Exchange for reading/books?

Is there a Stack Exchange site for book-specific questions (e.g., how does Harry Potter open the snitch in the 7th book)? Is/Should there be a community for this?


Are there any lists of default CSS stylesheets for different browsers? (browser stylesheets in tabular form)  I want to know the default font of text areas across all browsers for future reference.


Line breaks between entries in Biblatex bibliography

In my preamble, I set-up the bib as such:      \usepackage[style=authoryear,sorting=none, backend=biber,natbib]{biblatex} \addbibresource{references.bib}   Where references.bib is formatted as such:      @inproceedings{inpreceed,   title={},   author={},   journal={},   year={} }  @book{b,   title={},   author={},   url={},   year={},   publisher={},   location={} }   And then printing my bibliography using the command:  \printbibliography   However, my bibliography lacks line breaks between entries, as shown below:   How can I make my bibliography more cleanly spaced?


I would like to create two stacks in a vectorial form witch are filed with random numbers from -10 to 10 Then a third stack would be created where the sum of elements in each position would be put in the third stack, so if the first element of the first stack would be 2 and the first element of the second stack would be 3, then the third stack would get 5 in the first position. This is how far i've gotten right now. import java.util.*; class Main {   public static void main(String[] args) {      System.out.println("Valters Janis Sakarnis 191rdb359");      Vector pirmais = new Vector();     Vector otrais = new Vector();      Random rand = new Random();     int num;      for(int i=1; i<=10; i++) {       num = rand.nextInt(10);       pirmais.add(num);            }    } }


Python 3 print() function with Farsi/Arabic characters

I simplified my code for better understanding. here is the problem :  case 1:  # -*- coding: utf-8 -*-  text = "چرا کار نمیکنی؟" # also using u"...." results the same print(text)   output:  UnicodeEncodeError: 'charmap' codec can't encode characters in position 0-2: character maps to <undefined>   case 2:  text = "چرا کار نمیکنی؟".encode("utf-8")  print(text)   there is no output.   3:  import sys  text = "چرا کار نمیکنی؟".encode("utf-8") sys.stdout.buffer.write(text)   output:  چرا کار نمیکنی؟     I know that case 3 works somehow , but I want to use other functions like print() , write(str()) , ....  I also read the documentation of python 3 regarding to Unicode .  and also read dozens of Q&A in stackoverflow.  and  is a long article explaining the problem and answer for python 2.X  the simple question is:  how to print non-ASCII characters like Farsi or Arabic using python print() function?  update 1 : as it is suggested from many guys that the problem is concerned with the terminal I tested the case :  case 4 :  text = "چرا کار نمیکنی؟" .encode("utf-8")# also using u"...." results the same print(text)   terminal :  python persian_encoding.py > test.txt   test.txt :  b'\xda\x86\xd8\xb1\xd8\xa7 \xda\xa9\xd8\xa7\xd8\xb1 \xd9\x86\xd9\x85\xdb\x8c\xda\xa9\xd9\x86\xdb\x8c\xd8\x9f'   very important update:  after a while playing around with this issue, finally I found another workaround to make cmd.exe do the job (without needing third party softwares like ConEmu or ...):  a little explanation first:  our main problem does not concern Python. it's a problem with the Command Prompt character set in Windows(for complete explanation check out Arman's Answer) so ... if you change the character set of Windows Command Prompt to UTF-8 instead of default ascii , then the Command Prompt will be able to interact with UTF-8 characters(like Farsi or Arabic) this solution does not guarantee good representation of characters(as they will be printed out like little squares), but it's a good solution if you want to have file I/O in python with UTF-8 characters.  Steps:  before starting python from command line , type:  chcp 65001   now run your python code as always.  python testcode.py   result in case 1:   ?????? ??? ??????   it runs without errors.  screenshot:    for more information about how to set 65001 as the default character set check  out.


So I am making a text based game and when I run the game and choose my class (Knight, Mage or Archer), it gives me 100, 100, 100.  What's wrong?  Code  import java.util.Scanner;  public class AdventureText {   public static void main(String[] main) {      String namePlr;     String classPlr;     int healthPlr;     int magickaPlr;     int staminaPlr;     int maxHealthPlr;     int maxMagickaPlr;     int maxStaminaPlr;      instructions();      Scanner in = new Scanner(System.in);     //Reader      console("What is your name?");     namePlr = in.nextLine();      console("What class are you? Knight, Mage or Archer?");     classPlr = in.nextLine();      if (classPlr == "Knight") {            healthPlr = 200;       magickaPlr = 100;       staminaPlr = 150;       maxHealthPlr = 200;       maxMagickaPlr = 100;       maxStaminaPlr = 150;       console("Your stats are");       console("Max Health: " + maxHealthPlr);       console("Max Magicka: " + maxMagickaPlr);       console("Max Stamina: " + maxStaminaPlr);              } else if (classPlr == "Mage") {                healthPlr = 100;       magickaPlr = 200;       staminaPlr = 150;       maxHealthPlr = 100;       maxMagickaPlr = 200;       maxStaminaPlr = 150;       console("Your stats are");       console("Max Health: " + maxHealthPlr);       console("Max Magicka: " + maxMagickaPlr);       console("Max Stamina: " + maxStaminaPlr);           } else if (classPlr == "Archer") {                 healthPlr = 150;       magickaPlr = 100;       staminaPlr = 200;       maxHealthPlr = 150;       maxMagickaPlr = 100;       maxStaminaPlr = 200;           console("Your stats are");       console("Max Health: " + maxHealthPlr);       console("Max Magicka: " + maxMagickaPlr);       console("Max Stamina: " + maxStaminaPlr);     } else {       console("Oh, you are nobody. So...");       console("Brawler suits you");       healthPlr = 100;       magickaPlr = 100;       staminaPlr = 100;       maxHealthPlr = 100;       maxMagickaPlr = 100;       maxStaminaPlr = 100;             console("Your stats are");       console("Max Health: " + maxHealthPlr);       console("Max Magicka: " + maxMagickaPlr);       console("Max Stamina: " + maxStaminaPlr);     }    }   public static void console(String write) {      System.out.println(write);    }   public static void instructions() {      console("Hello and welcome to Adventure Text.");     console("WARNING: This game is caps sensitive. Always start input line with a capital letter!!!");    }  }


I'm new to blender and have this issue: I'm using the "Industry Compatible" keymap. In "Edit Mode" the keys 1, 2 and 3 swap between vertex, edge and face select - Great!  Now i want to customize it, so i'm adding a new preset "My keymap". As far as i understand this now is based on the "Industry Compatible" keympap and everything works accordingly. But if i close and start blender again, the 1, 2 and 3-key aren't working anymore. I need to go back to the preferences, set the "Industry Compatible" keymap and then set back to "My keymap". Then the 1, 2 and 3-key work again as expected.  This is reproduceable on the last Blender 2.8 version on several different machines. Am i doing something wrong? Is this a bug?


Breaking out of nested loops in javascript: throw vs return

when breaking out of Nested loops in javascript would it be better (as in faster, less problematic, or more popular) to break using a try-catch-throw like a lot of people do in python, or have a self-executing function that returns out of the loops?


Can time be quantised? Would it be the smallest distance between two photons moving in the same direction or the shortest wavelength?


How to fit image height to the parent div's height

I want that the image height fits to the parent div's height, but the image is overflowing. How can I resolve this?   .image-parent{     max-height: 50%; } img{     height: 100%; }


I have an android phone(1) on 2.3.3 and a tablet(2) on preorder that will be on 3. (And a bad gadget habit.)  Can I, when the tablet arrives, uninstall paid apps on the phone and install them on the tablet? It feels like I should be able to since I've paid for a copy of the app linked to that Google account it shouldn't matter which linked device it's on. (Why? Some stuff I've paid for will look better/be more useful on the tablet.)  I've looked online, but most people are asking about moving paid apps from broken phones (ie when they can't uninstall from the first device) or trying to run the same paid app on multiple devices which is piracy/cheap.   (1) nexus one (2) xoom


How is this solved?! is it Essential or Non-Essential?

while I've been prepping for the SAT using The Ultimate Guide to SAT Grammar Workbook by Erica L. Meltzer I encountered this question:  Sentence:  Before a vaccine was finally discovered by an American scientist Jonas Salk in 1955, more than 80% of polio patient received help from the foundation  Question:   NO CHANGE Scientist Jonas Salk, Scientist, Jonas Salk   4. Scientist, Jonas Salk, (right answer)  Comment: why isn't the right answer is B since we don't know who the scientist was so it's essential info, also we have before


What soldering kit for tiny electronics?

This is a my first foray into building electronics.  I am building a project that uses chip/SMD LEDs and resistors. What type of soldering kit should I be using for those devices?


A comment has been changed. I'm interested in viewing a past version of the comment.  Is there a way to view the history of edited comments?


Why is an algebra over a ring called an algebra?

After having read  post on MathOverflow about the etymology of various terms that are used in abstract algebra like groups, rings and fields, I was wondering how and why did the term algebra come to denote specifically algebra over a field or a commutative ring? Why pick the same name as the discipline to denote a very specific algebraic structure?  This question might not be very useful mathematically, but I'd nevertheless like to know the origin of this nomenclature.


Aggregate query on multiple values of same field

I am using SQL-Server 2012, I have a table of credit card transactions as follows:  CardScheme  RespCode ========================= Visa        Declined MasterCard  Approved MasterCard  Approved MasterCard  Declined Visa        Declined MasterCard  Approved MasterCard  Declined Visa        Approved Visa        Approved MasterCard  Approved   I need to write a query to get the following results  CardScheme  Declined  Approved ============================== Visa        2         2  MasterCard  2         4   Please help


Find the equation of the circle passing through two points (4,4) and (-2.-2) with radius 4

I am trying to solve this question but i cannot seem to find the center (h,k). I know i have to use the equation of circle form '(x-h)^2+(x-k)^2=r^2' and after that form to solution of the 2 point given and simultaneous equations them. I got the answer for that which is h+k=2 and that is where i got stuck. Please anyone help me with this. i also post my working as well.


How do you redirect to a page using the POST verb?

When you call RedirectToAction within a controller, it automatically redirects using an HTTP GET.  How do I explicitly tell it to use an HTTP POST?  I have an action that accepts both GET and POST requests, and I want to be able to RedirectToAction using  POST and send it some values.  Like this:  this.RedirectToAction(     "actionname",     new RouteValueDictionary(new { someValue = 2, anotherValue = "text" }) );   I want the someValue and anotherValue values to be sent using an HTTP POST instead of a GET. Does anyone know how to do this?


Find the the point which is the intersection of two segments

I have two segments A and B (each defined by two points) which intersect. The point X is the intersection of A and B. How can I find the coordonates of X ?


I am trying to find latex ornaments similar to these.    I checked out  and , but could not find anything that looked close enough. Is there something similar that I overlooked? I want something to separate sections, so suggestions are also welcome.


Squeeze/sandwich theorem for $\lim\limits_{n\rightarrow\infty}\frac{n!}{n^n}$

Is it possible to find the following using the squeeze/sandwich theorem? Think of the   $$\lim_{n\rightarrow\infty}\frac{n!}{n^n}$$


Proving that $\sum \limits_{d^2|n}\ \mu (d)=\mu^2(n)$, where $\mu$ is the Möbius function.

Let $\mu$ be the . Then prove that $\sum \limits_{d^2|n}\ \mu (d)=\mu^2(n)$, and more generally $$ \sum \limits_{d^k|n}\ \mu (d) = \begin{cases} 0 &\text{if } m^k \mid n \\ 1 &\text{otherwise.} \end{cases}$$


Is $f : A \to P(A), a \mapsto \{a\}$ injective or surjective?

Given an arbitrary set $A$, let $f:A \to P(A)$ be the function defined for all $a \in A$ by "$f(a) = \{a\}$".  How would you prove that $f$ is injective or surjective?


How does Java's System.exit() work with try/catch/finally blocks?

I'm aware of headaches that involve returning in try/catch/finally blocks - cases where the return in the finally is always the return for the method, even if a return in a try or catch block should be the one executed.  However, does the same apply to System.exit()? For example, if I have a try block:  try {     //Code     System.exit(0) } catch (Exception ex) {     //Log the exception } finally {     System.exit(1) }   If there are no exceptions, which System.exit() will be called? If the exit was a return statement, then the line System.exit(1) would always (?) be called. However, I'm not sure if exit behaves differently than return.  The code is in an extreme case that is very difficult, if not impossible, to reproduce, so I can't write a unit test. I'm going to try to run an experiment later today, if I get a few free minutes, but I'm curious anyway, and perhaps someone on SO knows the answer and can provide it before or in case I can't run an experiment.


How to add code logout after x minutes of inactive in php

I had this code but I do not Knew how I can add logout after x minutes of inactive in php  login page:  <html> <head> <title>login</title> </head> <body> <form action="page1.php" method="get" > ID:<input type="text" name="id"  /> Password:<input  type="password" name="pass" /> <input type="submit" value="login" /> </form> </body> </html>   get page:                                                    <html> <head> <title> get</title> <body> <?php session_start(); $get_id= $_GET['id']; $get_pass = $_GET['pass']; $_SESSION['user_id']=$get_id; $_SESSION['user_pass']=$get_pass; echo "welcome"; ?> </body> </html>   now I want this code logout after inactive 10 minutes


Does the device that supports USB 3.0 work via computer that supports USB 2.0

I am planning to buy external hard drive that supports USB 3.0. Will it work with my old notebook that has USB 2.0?


I customized my bash with this in my bashrc  export PS1="\e[0;36m\h\e[m \e[0;33m\w/\e[m \e[0;31m\n\$ →\e[m  "   So I get something like this (with colors) :   Ahuri ~/Public/  $ →     But I am having problems with long commands. When I write a very long command that is longer than a line it starts overwriting my first line  Example :   Ahuri ~/Public/  $ → ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^   If I continue to add "^" I get:  Ahuri ~/Public/  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^   my "$ →" is overwritten, and then the whole line gets overwritten.


Read references from a .bib file in IEEEtran

I am new to Latex. I am trying to put the references as well as cite them. I am doing the following:  1. Created a refer.bib file with following content  @String{j = {Journal}} @String{jof = {Journal of}} @String{procof = {Proceedings of}}  @misc{erec04,   author = {European Renewable Energy Council},   title = {{Renewable Energy Scenario to 2040}},   howpublished = "\url{http://www.erec.org/fileadmin/erec_docs/Documents/Publications/2040Exec_Sum.pdf}",   year = {2004},   note = "[Online; accessed 07-Mar-2013]" }   2. Then i used the following lines in my main.tex  \usepackage{cite} \bibliography{refer}   3. Then i tried to cite as following:  During smooth pursuit\cite{erec04}   But in the pdf version i just saw the following  During smooth pursuit[?]   Please suggest me how to do it properly?


The understanding of logic of "construct" method in original STL implementation in C++

While going through the  original STL(Standard Template Library) source code, I encountered the following from the memory allocator function file:   template <class T1, class T2> inline void construct(T1* p, const T2& value) {     new (p) T1(value); }   I am not able to understand it completely and have the following question/doubts:   It appears to me that it has something to do with copy constructor of type T1? Why the above function is template on two type T1 & T2?. It should have been T1* for first and *T1 for second(value). why new has been used in the above logic?. I looked the uses of it and found the following in file     void push_back(const T& x) {   if (finish != end_of_storage) {       construct(finish, x);         ....         ....     }    So based on above, finish has already acquired the memory and been passed into it. The other parameter is x which is value of same type T. These are the few concepts which I am able to think/understand.  It appears to me very general yet important function which has been used throughout STL logic. Could somebody can explain it the above concept?


How to create a repo out of only folders?

Only folders exists in the parent and the subfolders. I've deleted all files using:  find my-path-here -type f -delete   example setup:  parent-path (this is parent folder for the repo)   -> subfolder1   -> subfolder2   -> subfolder14   -> subfolder67   I tried adding and commiting this setup but git is not adding the subfolders. I've searched the net but didn't see anything useful other than using "git add --all"  Here's my terminal output:  parent-path on  master  ➜  rm -rf .git  /home/myuser/parent-path  ➜  git init   Initialized empty Git repository in /home/myuser/parent-path/.git/  parent-path on  master  ➜  git add .                                                                    parent-path on  master  ➜  git add --all  parent-path on  master  ➜  git add "subfolder1"  parent-path on  master  ➜  git commit -av -m "initial commit"                                          On branch master  Initial commit  nothing to commit  parent-path on  master  ➜  git status                         On branch master  No commits yet  nothing to commit (create/copy files and use "git add" to track)  parent-path on  master  ➜  ls -la .gitignore     Specified path '.gitignore' doesn't exist.  parent-path on  master  ➜


I need to print individual fields from the $content variable in node.tpl.php file in separate div tags. How do I do that and how do I find out what the field's names are?


Expression "Something" ? "Something" : "Something else" shorter?

Quick question. Can I write it in shorter way?  Actually, I would like to have the same variable from I can take value of:  {this.state.members[activeMemberId] ? this.state.members[activeMemberId].id : null}  e.g  {this.state.members[activeMemberId] ? (<-the same).id  : null}


Can a shell script set environment variables of the calling shell?

I'm trying to write a shell script that, when run, will set some environment variables that will stay set in the caller's shell.  setenv FOO foo   in csh/tcsh, or  export FOO=foo   in sh/bash only set it during the script's execution.  I already know that   source myscript   will run the commands of the script rather than launching a new shell, and that can result in setting the "caller's" environment.  But here's the rub:  I want this script to be callable from either bash or csh.  In other words, I want users of either shell to be able to run my script and have their shell's environment changed.  So 'source' won't work for me, since a user running csh can't source a bash script, and a user running bash can't source a csh script.  Is there any reasonable solution that doesn't involve having to write and maintain TWO versions on the script?


Tony's Private life in Spider-Man: Homecoming

I really don't know how to do this in terms of spoilers, but here goes...  After watching the end of Homecoming, it appears that       Tony and Pepper are very much back together.   Is there any in-universe explanation for this change from the way the universe seemed to be in Civil War?


When using Minted i get a red box around greek characters   Can this behaviour be disabled or is there a specific line that needs to be changed in the python lexer?  A minimal working example  \documentclass[12pt,a4paper]{article}  \usepackage{fontspec} \setmainfont{XITS} \setmonofont{Consolas}  \usepackage{minted} \setminted[python]{     linenos=true,     breaklines=true,     encoding=utf8,     fontsize=\footnotesize,     frame=lines } \begin{document} \section{Some code in this section} \begin{minted}{python} def add(α, β):     return α + β \end{minted} \end{document}     edit: I am using xelatex


Should I leave a tip in a fully automated restaurant in the USA?

When I go to a fully automated restaurant in the USA (, ), am I supposed to tip?


Do we require a transit visa for a connecting flight in Sweden?

I'm an Indian citizen and I'm travelling from London to India through a connecting flight in Stockholm, Sweden. Do I need to have a Transit Sweden visa to catch my connecting flight?


How to recover lost permission metadata in /etc?

By mistake was executed command:  sudo chmod -R 777 /etc/   Is there any way to return permissions in the correct state ?


So I was writing an essay and want to know which sentence is correct- I'll grab a lunch with Prof. Unknown and discuss his research on wearable computational fabrics. Or I'll grab lunch with Prof. Unknown and discuss his research on wearable computational fabrics.


Are BLE modules capable of working with a CR2032 battery?

I keep reading that the Bluetooth Low Energy modules are capable of working with a CR2032 battery for years, but their consumption is around 20mA and the max discharge of a CR2032 is around 3mA (200uA standard). How could this be possible?  I'm pretty sure it has something to do with the pulse discharge current, but the datasheets usually don't have a lot of information about that. In this case how can I determine the relation between the discharge current and the duration of the pulse?


I just can't solve this problem in spite of doing a whole book on logs and inequalities     Where $[\dotsc]$ denotes the greatest integer function, what is the value of the natural number $n$ satisfying the equation   $$   [\log_21]+[\log_22]+[\log_23]+\dotsb+[\log_2n] = 1538  $$   A. 255 B. 256 C. 254 D. 313  The answer is A.  Please give an easy solution as I am a high school student. And I do fully understand the meaning of the question but I can't solve it.  Since stack exchange forces me to provide an attempt here it goes- I wrote the equation as $log_2n!=1538$  after this I feel n! should be $2^{1538}  $  and now i am confused...   I hope you got your attempt for the people who put the question on hold.  nice you pointed out chris.. yeah the question is same but the person who posted it has accepted the answer to it not me!....the answer maybe sufficient to understand for him.. but it may not be for me...  PS-whats the point of giving a fake attempt and not speaking the truth?!!


I have recently upgraded my Ubuntu to 16.04.I was using 12.04. I am facing some issues with 16.04. Is it possible to downgrade to my old Ubuntu 12.04 without fresh installation.


if $x$ and $y$ commute with $[x y]$, then $[x y]$ is nilpotent

Let $V$ be a complex-vector space and $x,y\in gl(V)$ such that $[x y]=xy-yx$ commutes with $x$ and $y$. Let $[x y]$. Prove that   (1)$tr(z^{m})=0$ , for every $m\geq 1$.  (2)Deduce that z is a nilpotent map.   I couldn't do the first one. For the second one if we can prove that the possible eigen values of $z$ is only $0$, we are done. From the first one , we have if $\lambda_{1},... \lambda_{n}$ are eigen values of $z$, then $\sum_{i=1}^{n} \lambda_{i}^{k} =0$, for every $k$. From there how can we comclude that $\lambda_{1}=\lambda_{2}=...= \lambda_{n}=0$.  Thanks in advance for any help.


Evalutaion $\int _{-\infty }^{\infty }\frac{\sin\left(wz\right)}{w}\:dw$

Let $$f(z)=\int _{-\infty }^{\infty }\frac{\sin\left(wz\right)}{w}\:dw$$  $$f'(z)=\int _{-\infty }^{\infty }\sin\left(wz\right)\:dw=\lim _{x\to \infty }\left(\frac{\cos\left(wz\right)}{z}\right)-\lim _{x\to -\infty }\left(\frac{\cos\left(wz\right)}{z}\right)= \cos\left(\infty \right)-\cos\left(-\infty \right)=\cos\left(\infty \right)-\cos\left(\infty \right)=0$$  $f(z)= 0 + C$;      $f(0)=\int _{-\infty }^{\infty }\frac{\sin\left(w0\right)}{w}\:dw \Leftrightarrow 0 = 0 + C \Leftrightarrow C=0 $  I should have obtained $\pi $, since $\frac{\sin\left(w\right)}{w}$ is an even function and $\int _{0\:}^{\infty \:}\frac{\sin\left(w\right)}{w}\:dw$ = $\frac{\pi }{2}$


Array of function pointers as a member of a C struct

I have built the following C example trying to simulate simplistic generic driver code which can be used in small ARM micro-controllers:  #include <stdio.h> #include <string.h>  typedef unsigned char uint8_t; typedef void (*generic_func_t)(uint8_t);  typedef struct {         generic_func_t init;         generic_func_t open;         generic_func_t read;         generic_func_t write;         generic_func_t close;         generic_func_t exit; } driver_t;  void USB_init(uint8_t x) {         /* here body of this f-n */         printf("USB_open 0x%x\n", x); }  void USB_open(uint8_t x) {         /* here body of this f-n */         printf("USB_open 0x%x\n", x); }  void USB_read(uint8_t x) {         /* here body of this f-n */         printf("USB_read 0x%x\n", x); }  void USB_write(uint8_t x) {         /* here body of this f-n */         printf("USB_write 0x%x\n", x); }  void USB_close(uint8_t x) {         /* here body of this f-n */         printf("USB_close 0x%x\n", x); }  void USB_exit(uint8_t x) {         /* here body of this f-n */         printf("USB_close 0x%x\n", x); }  typedef struct driver_t USB_driver;  #if 1         USB_driver.init = &USB_init;         USB_driver.open = &USB_open;         USB_driver.read  = &USB_read;         USB_driver.write = &USB_write;         USB_driver.close = &USB_close;         USB_driver.exit  = &USB_exit; #endif  #if 1 void main(void) {} #endif #if 0 void main(void) {         USB_driver.init(0x01);         USB_driver.open(0x02);         USB_driver.read(0x03);         USB_driver.write(0x04);         USB_driver.close(0x05);         USB_driver.exit(0x06); } #endif   The following error appears:  [user@localhost fn-ptr]$ emacs fn-ptr.c  (emacs:4983): Gtk-WARNING **: Allocating size to Emacs 0xdb4270 without calling gtk_widget_get_preferred_width/height(). How does the code know the size to allocate? [user@localhost fn-ptr]$ gcc fn-ptr.c fn-ptr.c:78:11: error: expected identifier or ‘(’ before ‘.’ token  USB_driver.init = &USB_init;            ^ fn-ptr.c:79:11: error: expected identifier or ‘(’ before ‘.’ token  USB_driver.open = &USB_open;            ^ fn-ptr.c:80:11: error: expected identifier or ‘(’ before ‘.’ token  USB_driver.read  = &USB_read;            ^ fn-ptr.c:81:11: error: expected identifier or ‘(’ before ‘.’ token  USB_driver.write = &USB_write;            ^ fn-ptr.c:82:11: error: expected identifier or ‘(’ before ‘.’ token  USB_driver.close = &USB_close;            ^ fn-ptr.c:83:11: error: expected identifier or ‘(’ before ‘.’ token  USB_driver.exit  = &USB_exit;            ^ [user@localhost fn-ptr]$    The question here is: what should I do to make this code to work, since the following single function pointer example, upon which this code is built, works perfectly:  typedef unsigned char uint8_t; typedef void (*generic_func_t)(uint8_t);  generic_func_t init;  void USB_init(uint8_t x) {         /* here body of this f-n */         printf("USB_open 0x%x\n", x); }  init = &USB_init;


I've already asked this question on Superuser (given it's Outlook related), but now I'm trying to see if anyone else on Android Enthusiasts can help me. The details are as below.  I've paired up my Samsung phone with an Outlook Exchange inbox (probably Outlook 2010), and now I've got the outstanding SMS syncing feature. Only, of course, it sucks, since my inbox get's flooded with SMS's that I already have on my phone.  After looking around the internet for quite a while for a option that would allow me to disable that kind of syncing, the only guide I got was designed for Windows Phone 6.x.  I want desperately to disable it. Anyone has any clue as to how?


The three unforgivable curses are the Cruciatus Curse, the Imperius Curse, and the Killing Curse ("Avada Kedavra").  The Cruciatus Curse inflicts terrible pain and has no use other than torture, making it understandably horrific.  The Imperius Curse overrides a person's free will and controls them directly. Again, understandably horrific.  The Killing Curse... kills the target instantly and painlessly. It's unblock-able, meaning it can't be deflected by a shield onto an innocent bystander, and it's implicitly single-target-only, with no explosion or similar splash effect which could cause collateral damage.   On the other hand, all of the following are apparently perfectly forgivable:   The Blasting Curse, with huge potential for collateral damage, and which could cause severe injury leading to a prolonged and painful death. The Expulsion Curse, similar to the above. Whatever was used to blast Benjy Fenwick to pieces, possibly one of the above. Nonspecific Dementor-associated death after imprisonment in Azkaban (eg. Morfin Gaunt) (Not just condoned, but practically enabled by the authorities) Fiendfire Sectumsempra (inflicts horrible wounds which, if untreated, could easily lead to slow death by exsanguination) Whichever curse afflicted Dumbledore after wearing Marvolo Gaunt's ring (I don't think it was ever named).   There are also countless other ways to potentially kill someone with magic (Body-binding curse-assisted drowning, for example). In light of all of these "forgivable curses", why is a safe, instant, painless kill so horrifying as to be "unforgivable"?


What I understood from the definition of current sources is that it is a source which supplies a constant current across a load no matter how the other parameters (like resistances for example) in the circuit are changed. Am I right?  If I'm right, what is an example of a current source used in a practical circuit?   Wikipedia gave the example of a  as a constant current source. (I didn't read the article, because there was a note that the section appeared to contradict itself. I didn't want to get confused.)  I can think of voltage sources - for example a battery which has a constant potential difference across its ends irrespective of the changes in the circuit it is connected to, but I cannot think of a current source. Any example I can think of involves change in the current when the resistances are changed.


Computer doesn't boot up, shows PXE error and/or "operating system not found", "no bootable device", "insert boot media", or other similar error

My computer no longer boots Windows or the installed operating system. Instead, I may get this error:  PXE-E61: Media test failure, check cable -or- Check cable connection!  PXE-M0F: Exiting PXE ROM.   and/or one of the following messages or similar:  Operating System not found  No boot device available- No bootable devices--strike F1 to retry boot, F2 for setup utility  No bootable device -- insert boot disk and press any key  No Boot Device Found. Press any key to reboot the machine  Default Boot Device Missing or Boot Failed  Reboot and Select proper Boot device or Insert Boot Media in selected Boot device   What does this mean and what can I do?     This question comes up often and the answers are usually the same. This post is meant to provide a definitive, canonical answer for this problem. Feel free to edit the answer to add additional details.


Proof of the identity $\sin(x+y) =\sin(x)\cos(y) + \cos(x)\sin(y)$ for all $x$ and $y$

I don't know if I'm asking for too much, but the proofs I've seen of the statement  $$\sin(x+y) =\sin(x)\cos(y) + \cos(x)\sin(y)$$  consist of drawing a couple of triangles, one on top of each other and then figuring out some angles and lengths until they arrive at the identity.  And I agree with the proof, is just that, even by flipping the triangle around, it only proves the identity for the case $x+y<\pi/2$, or if it does prove it for all values of $x$ and $y$, I wouldn't understand why.  As to construing a proof by using Euler's identity or the derivatives of sin and cos, I would ask the writer to first prove his/her already accepted formulas without using the addition identity.  So that is my humble question. How could one prove that for all the values of $x$ and $y$, the identity $\sin(x+y) = \sin(x)\cos(y) + \cos(x)\sin(y)$ holds.  Any thoughts/ideas would be really appreciated.


Find the sum of $\sum_{r=1}^n\frac{1}{r(r+1)(r+2)}$

This question is posing a few issues for me, so I've started by breaking the fraction down into partial fractions as usual but when i started to write out each of the terms they don't seem to cancel in any order or pattern that i can spot. any help would be appreciated.  $$\sum_{r=1}^n\frac{1}{r(r+1)(r+2)} = \sum_{r=1}^n\left(\frac{1}{2r}-\frac{1}{r+1}+\frac{1}{2(r+2)}\right)$$


Does salt size affect password hash security?

I use PBKDF2-SHA512 with an iteration count of 128,000 to hash my passwords. I use a CSPRNG to generate a salt per password. However, I am unsure about the ideal size of the salt. I have read a lot of things about the salt size, but I have been unable to find a definitive answer. All of them agree that there is a minimum salt size, but I have found nothing about a maximum salt size.  So, here's my question: is there a point where the salt size doesn't matter anymore in terms of security and where it might even decrease it? If there is no maximum salt size, does it mean that the size we choose is actually a sweet spot among performance/space for salt storage/protection against precomputed tables?


What's a word for a person who loves old or ancient things?

I am looking for a word to contrast with . Just as a neophile loves novelty for the sake of it, I want to describe a person who loves old or ancient things (may include the abstract, e.g. tradition or bygone mannerisms).  A neophobe is ruled out, since that is merely a rejection of newness. Antiquarian comes to mind, but that seems to be specifically for human history (its objects and trivia). The word I'm after could refer to someone who loves fossils or ancient rocks (of which there are many. . .).  So, what word describes a person who loves an object or concept on account of its age? Perhaps archaeophile or paleophile?


Should I send my client the original file of a job?

I have recently accepted a free-lance job to typeset a book in LaTeX for a publisher. I'm not a professional graphic designer, but I have been working with this tool for a long time now. Now I even realize I charged a fraction of the market price for such a job (why should I earn less than someone who just uses a different tool?), but that's not really the main issue.  The client has asked me over and over for changes, not only design but also copy-editing work, some of which I declined to do.  Now the job is practically done (all that is left is to include the ISBN number), and after serious delays to receive my pay, they still want me to send not only the .pdf (whose final version I had already sent) but also the source file.  I'm afraid they'll either mess up with my job (which took me quite some time to accomplish in detail) or take my design/programming and send to someone else who'll do the easy job of "adding stuff" (or even make it a template for future books).  Should I really send them this source file? If yes, should I charge more for this?


Why was Yoda unable to defeat Sidious in their final confrontation in RotS?

Throughout this  it appears that Yoda is the more skilled and focused in his confrontation with Sidious even though Sidious landed the first blow with his force lightning. This is also coupled with the fact that Sidious was injured greatly in his earlier fight with Mace Windu who he lost to even though his skills are below Yoda's However, the implication at the end of this scene is that both force users are well matched with each other and can be seen as equals in skill So what ultimately allowed Sidious to draw in the fight? Thanks


Is it possible to run code when the object in WeakReference is garbage collected?

I would like to do something like this:  class MyWeakReference<T> extends WeakReference<T> {    void onClear() { .. run my code .. } }   But since GC doesn't call clear(), but sets the referent to null directly, it seems like there is no way to invoke such code.


Could the world of ASOIAF be on the inside of a sphere?

There's not a ton of evidence to support this, but the intro to the show seems to imply the world exists inside a sphere rather than on the outside of it:    This seems like the sort of hint GRRM would drop; additionally, this could be the source of the strange season cycles that the world experiences. It's at least plausible that the inhabitants of this world would never notice due to atmospheric effects. Also, I don't recall any references in the books to a ship appearing on the horizon (which would be a nail in the coffin for my theory).  Of course, perhaps the animators for the intro simply did not want to render a sky...  EDIT: forgot to include:   In  GRRM is quoted as saying the world is "round", which neither confirms nor denies my suspicions.


Change root password without holding shift on grub

When I hold the left shift key on grub menu, nothing appears and it still boots to Ubuntu like it normally does (Ubuntu is the only machine installed). How can I change the password for root elseway? I have access to the terminal but when I write sudo, it says that I am not a sudoer and incident will be reported. I was a suoder and used to be able sudo until today which I messed up with system. Apparently the solution is changing the root password.  When I am trying to start the GUI it tells "Failed to start the session" however I used CTL+ALT+F1 and have access to terminal.  Note that I am not a sudoer and cannot change grub settings.


Arranging five letters of the word MISSISSIPPI

I am looking for some help with the following two questions, I have included my explanation for part a but I am not sure if it is correct or how to do part b, thanks!  Question a) how many ways are there to arrange the letters in MISSISSIPPI?  Explanation 1)  The word MISSISSIPPI has $11$ letters, not all of them distinct.   There are $\dbinom{11}{4}$ ways to choose the slots where the four S's will go. For each of these ways, there are $\dbinom{7}{4}$ ways to decide where the four I's will go. There are $\dbinom{3}{2}$ ways to decide where the P's will go. That leaves $1$ gaps, and $1$ singleton letters, which can be arranged in $1!$ ways, for a total of  $$\binom{11}{4}\binom{7}{4}\binom{3}{2}1!.$$  Explanation 2)   In general if you have n objects with ${r_1}$ objects of one kind, ${r_2}$ objects of another,...,and ${r_k}$ objects of the kth kind, they can be arranged in   $$\frac{n!}{(r_1)!(r_2)!...(r_k)!}$$  Therefore,  $$\frac{11!}{4!4!2!}$$  Question b) How many arrangements are possible using $5$ letters from MISSISSIPPI?


If $A$ is invertible and $A$,$A^{-1}$ contains only integers, why is $\det(A^{4}) = 1$?

If $A$ is invertible and $A$,$A^{-1}$ contains only integers, why does $\det(A^{4}) = 1$?I can't find a reasonable explanation for that... I tried everything. Can someone give me a direction?


anyone of you know how to get effect like in these code   public function create(SomeInterface $obj)  {      $class = get_class($obj);      return new class extends $class {         //some magic here      }  }   Obvious that code will not work in PHP. $obj can be an instance of many different classes.  I want to get an instance of class extending the $obj. (It will give me an ability to overload some basic methods)


Error for checkbox android.widget.CheckBox.setVisibility(int)' on a null object reference

checkBox=(CheckBox) findViewById(checkbox);    checkBox.setVisibility(View.GONE);      db = new Db(Listdata.this,"register2",null,2);     list2 = db.listdata();     Log.d("list", String.valueOf(list2));     listAdapter adapter = new listAdapter(Listdata.this,list2);     listView.setAdapter(adapter);     a= list2.size();     Log.d("teb", String.valueOf(a));      listView.setLongClickable(true);     listView.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {         public boolean onItemLongClick(AdapterView<?> arg0, View arg1, int pos, long id) {             for(int i = 0; i!=a; i++) {                 checkBox = (CheckBox) listView.getChildAt(i).findViewById(R.id.checkbox);                 checkBox.setVisibility(View.VISIBLE);             }             return true;         }     });   FATAL EXCEPTION: main                                                                                Process: com.example.developer.register, PID: 21571  java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View android.view.View.findViewById(int)' on a null object reference                                                                                at com.example.developer.register.Listdata$1.onItemLongClick(Listdata.java:52)                                                                                at android.widget.AbsListView.performLongPress(AbsListView.java:3112)                                                                                at android.widget.AbsListView$CheckForLongPress.run(AbsListView.java:3061)                                                                                at android.os.Handler.handleCallback(Handler.java:739)                                                                                at android.os.Handler.dispatchMessage(Handler.java:95)                                                                                at android.os.Looper.loop(Looper.java:135)                                                                                at android.app.ActivityThread.main(ActivityThread.java:5221)                                                                                at java.lang.reflect.Method.invoke(Native Method)                                                                                at java.lang.reflect.Method.invoke(Method.java:372)                                                                                at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)                                                                                at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)


How did Einstein come the conclusion that nothing can travel faster than the light in vacuum?


When do we use "elder" "older" and "eldest"?

I'd appreciate it if someone explained everything regarding those three adjectives. They confuse me.


When you use tracert www.example.com in the command prompt, what exactly does the returned information tell you, and how does it go about getting that information. Up until now I have only used traceroute to get the I.P. address of a website without really thinking about the bigger purpose of traceroute.


Which is grammatically correct: "There is tea and juice" or "There are tea and juice"?

The bread and butter was tasty     Bread and butter are sold in this shop.      I  have been taught when things are considered separately, we should use 'are' but when they are used collectively, we should use 'is'.  But in the following example, which one is correct?     A. There is tea and juice   B. There are tea and juice


There is no continuous injective function $f:\mathbb{R}^n\longrightarrow\mathbb{R}^m$

I have the following question, more general that   Let $U\subset\mathbb{R}^n$ be a domain. If $f:U\longrightarrow\mathbb{R}^m$  ($m< n$) is a continuous function, how to prove that $f$ is not injective.  Any hint would be appreciated.


Who else knew that Lord Voldemort was Tom Marvolo Riddle?

We know that some people were aware of the fact that Lord Voldemort was Tom Marvolo Riddle prior to his return in Goblet of Fire; at the very least his close soon-to-be-Death-Eater "friends" and Albus Dumbledore:  “Very few people know that Lord Voldemort was once called Tom Riddle. I taught him myself, fifty years ago, at Hogwarts..." ... underwent so many dangerous, magical transformations, that when he resurfaced as Lord Voldemort, he was barely recognizable. Hardly anyone connected Lord Voldemort with the clever, handsome boy who was once Head Boy here.” (Professor Dumbledore to Weasleys, Chamber of Secrets, CHAPTER EIGHTEEN, Dobby’s Reward)  and  “Voldemort,” said Riddle softly, “is my past, present, and future, Harry Potter…” He pulled Harry’s wand from his pocket and began to trace it through the air, writing three shimmering words: TOM MARVOLO RIDDLE Then he waved the wand once, and the letters of his name rearranged themselves: I AM LORD VOLDEMORT “You see?” he whispered. “It was a name I was already using at Hogwarts, to my most intimate friends only, of course. ...  (Tom's Diary manifestation in the Chamber of Secrets).  QUESTION: Who - based on canon (books/interviews/pottermore) - knew about the fact that Lord Voldemort was Tom Marvolo Riddle prior to Ginny being taken to the Chamber of Secrets? Obviously, Albus Dumbledore and Tom himself. Who else?


Looking for a sci-fi film from the 80's involving cattle mutilation

I'm trying to identify a movie I watched back in the early-to-mid 80's on cable, most likely HBO or Showtime. In the movie, aliens visit a small town. The visit is witnessed by two children - a local boy and a girl whose parents had stopped in the town while on a road-trip.  Years later, the now-grown girl returns to the town and she's a reporter (I think) investigating a weird rash of cattle mutilations in the area. The now-grown boy is the town sheriff or deputy, and is also investigating the mutilations. It turns out that      a local man is behind the mutilations. He was abducted or changed when the aliens visited 25 years ago, and now works for the aliens by cutting up the cattle using a glowing rod of some kind. The rod resembles a lightsaber blade but you can hold it.   Unfortunately, I don't remember the actors involved, but these three main characters were all Caucasian. The main two leads were around 30, with the local man being older. The town was in the Southwest, I believe, with lots of scrub-brush and semi-desert areas around the town.


Assigning custom extensions to a language's syntax highlighting in Notepad++

In the current version of Notepad++ opening .sql files results in Notepad applying SQL syntax highlighting to it. I'd like Notepad++ to do the same for other extensions as well, is there some setting where I can define this?


How many requests can a PHP web server handle per second?

Given the following:   I have an AWS EC2 t3.small instance. The instance uses the most recent Ubuntu LTS as its operating system. The instance has 2GB RAM and 2 CPU cores available. I have installed modern versions of Nginx, PHP, and PHP-FPM. All other services (MySQL, Redis, Supervisor, SMTP, and Cron) are installed on other instances. I have deployed a RESTful API codebase to that instance. The codebase uses a modern version of Symfony, Laravel, or CakePHP. The instance takes around 100ms to respond to a single request.   I have calculated that this instance can serve 20 requests per second. My logic is as follows:   Each request takes around 100ms to respond. Each core can respond to 10 requests per second. The instance has two cores.   Does this sound correct?


Exporting as fbx is not including meterials if it is includes Color Ramp

When I export as fbx. Meterials are not applying when I have used Color ramp. On the contrary, if I used normal meterials, they are applying completly fine. It wasn't an issue in 2.90 but with 2.91 I have been having this issue. I tried in 2.90 again but nothing has changed.


How to install wireless access point EDUP EP-2906?

I 'm trying to install wireless access point device EP-2906, on my Desktop PC running Windows 7. Here is the  .  Page 7 says how I can set up it's IP address, but I can't find Wireless Network Connection icon. Is this because of my Desktop PC and in this case how can I set up a static private IP address for this device?


I am confused with the grammar here. Which is grammatically correct?       At which time will you call me?     At what time will you call me?    And why?


Prove that $\frac{\sin x}{x}=(\cos\frac{x}{2}) (\cos\frac{x}{4}) (\cos \frac{x}{8})...$

How do I prove this identity:  $$\frac{\sin x}{x}=\left(\cos\frac{x}{2}\right) \left(\cos\frac{x}{4}\right) \left(\cos \frac{x}{8}\right)...$$  My idea is to let  $$y=\frac{\sin x}{x}$$ and $$xy=\sin x$$  Then use the double angle identity $\sin 2x=2\sin x \cos x$ and its half angle counterparts repeatedly.  I see some kind of pattern, but I can't seem to make out the pattern and complete the proof.


Let $a$ $∈$ $\mathbb{C}$ and $r > 0$ be a real number. We denote $U = \mathbb{D}(a, r)/ \{a\}$. Let $f ∈ O(U)$ an holomorphic function such that $\mathfrak{R}$f(z) ≥ $0$ for all $z \in U$.  1) Show that $a$ is not an essential singularity of $f$.  2) Show that $f$ can be extend in an holomorphic function on all the disc $\mathbb{D}(a,r)$.  Since we had no class about this subject, I'm not quite sure about how to start this problem. Any ideas?  For what I understand, for 1) I have to show that the point $a$ is either a pole or a removable singularity is this correct?  Thanks for your suggestions.


How do I make a table row on a web page look draggable?

I have a table on a web page where I need to let the user reorder the rows. I was thinking of letting the user drag the rows to reorder them. But how would I let the user know that he could do that? Should I make an empty cell as the first column with dots or vertical lines like gmail has for each email in the inbox? Where can I get an image like that? Do I use a "grabbing hand" icon for the cursor or a "move" cursor? Do I show the cursor while hovering over the table or just the "grab area"? Do I let the user grab any part of the row to drag?


Delete all files in the folder except one extension(say .idf) using batch file

My current code to delete all files in a folder older then 2 days is :  forfiles /p "C:\Test" /s /m *.* /c "cmd /c Del /F /Q @path" /d 2   There is one .idf file among all other files. I want to delete all files except the one .idf file. What do I change to get the current code to ignore the file? If it is not possible, any new command will be helpful.


'you will be receiving an invoice' - why the continuous?

Could you let me know why future continuous is used in this sentence:     You will be receiving an invoice from Thomas in a few days.   Is it because it relates to a routine, or is it because of the duration (in a few days), or is it because the man who wrote the email is a different person (neither Thomas nor the man who will receive the email) and his willingness cannot influence Thomas' action meaning maybe Thomas can forget….


The momentum representation of $x$ and $ [x,p]$

To deduce the momentum representation of $[x,p]$, we can see one paradom  $$<p|[x,p]|p>=iℏ$$  $$<p|[x,p]|p>=<p|xp|p>−<p|px|p>=p<p|x|p>−p<p|x|p>=0$$  Why? If we deduce the momentum representation of $x$, we obtain $<p|x|p>=i\hbar \frac{\partial \delta (p'-p)}{\partial p'}|_{p'=p}$. This value is not definite. So, why two uncertain values can obtained a certain value $i\hbar$? In addition, the $x$ should be replace by $i\hbar \frac{\partial }{\partial p}$. Then the eigenvalue p can't extract. However, if we consider $i\hbar \frac{\partial }{\partial p}$ to act on the bra, not the ket, then the eigenvalue p can be extracted. Is anything wrong here?


What is the most common solution to getting TeX on the go.  I am looking for a way to fit everything onto a thumbdrive. (up to 8Gb?)  It needs to be able to have a text editor and a typesetting system. I tried installing my student-license WinEdt onto a thumbdrive and use , but this is not compiling things properly.  I assume that the typeset system is one of the best available, so assuming that I get the system setup correctly, what other text editors would you recommend?  P.S. some systems I work on do no have acrobat. (ie. pdf not supported)


how to install AMD Catalyst or AMD Graphic Drivers and other drivers in Ubuntu 13.04

I recently purchased an HP laptop (Intel-AMD Hybrid). I successfully installed Ubuntu 13.04 on it.  But my battery is draining quite quickly. It hardly works for 30-50 minutes. I guess it might be due to the graphics driver.  Could anyone please suggest how to install below, recommended settings to increase battery life and performance of my laptop: 1. AMD Driver / AMD Catalyst for AMD HD Raedon 5400 2. Synaptics Touch pad driver 3. IDT High Definition Audio Driver


Whats the point of i++ when ++i "can" be faster in c++?

I've been reading quite a few posts/questions about the micro-optimization of ++i and i++ in C++. And from what I've learnt is that ++i "can", not always, but can be faster than i++.  So this makes me ask this question, whats the point of i++ then? I thought that ++i is that you increment the value first then return it. Where as i++ you return the value then increment it. But I have made a very simple test on this:  for(int i = 0; i < 10; ++i) {     std::cout << i << std::endl; }   is the same as:  for(int i = 0; i < 10; i++) {     std::cout << i << std::endl; }   Both prints out the same results. So my real question is that is there a situation where you MUST use i++ rather than ++i? If there is, please explain. Thanks


Check hash (MD4, MD5, SHA-1, and CRC) on Ubuntu 12.04 and 12.10

I have a lot of iso-files downloaded from internet. I want to check the hash from my Ubuntu 12.04 and 12.10. Is there any application on Ubuntu to check the MD4, MD5, SHA-1, and CRC hash?  I need the CRC hash-checker to check my Windows 8 iso files.


ISSUE: Dual Boot Windows 10 and Linux Ubuntu on Separate SSD

This question is in regards to an existing thread: . I am facing an issue with regards to Part-IV / Figure 8 from the thread above. After assigning letter G to the volume, I tried executing cd /d g:. However, I get an error "Access is denied". I am unsure how to fix it, and proceed with rest of the steps mentioned in the thread above. Appreciate any help/advice.


I have:  \documentclass[12pt]{book}  \begin{document} \tableofcontents  \chapter{chapter name} \section{section name} \subsection{subsection name} \end{document}   I get   I want to add the word 'Chapter' before the number 1 where it is written chapter name. I want also to add a point line in front of the chapter name like in the section line.  I try to use this:  \documentclass[12pt]{book}  \usepackage[utf8]{inputenc} \usepackage{newtxtext} \usepackage[english]{babel} \usepackage{titletoc}  \addto\captionsenglish{\renewcommand*\contentsname{Contents}}  \titlecontents{chapter}[5.3em] {\vspace{0.3cm}} {\contentslabel[\textbf{\chaptername~\thecontentslabel}]{5.3em}} {\hspace*{-5.3em}} {\titlerule{1pc}{.}\contentspage}[\smallskip]  \titlecontents{section}[5.3em] {\smallskip} {\thecontentslabel\enspace} {\hspace*{-5.3em}} {\hfill\contentspage}  \titlecontents{subsection}[6.92em] {\smallskip} {\thecontentslabel\enspace} {\hspace*{-6.92em}} {\hfill\contentspage}      \begin{document}      \tableofcontents     \newpage      \chapter*{Preface}     \addcontentsline{toc}{chapter}{Preface}     \chapter{Looking-Glass House} \section{A First section} \section{Another section} \subsection{A subsection}     \end{document}   But I have this:   I have problem with the dotted line and I want that tha chapter nae be bold !


Ubuntu login loop mv .Xauthority not working

When I enter my username and password I am looped back to the login screen again. I went to the shell screen and mv .Xauthority . Xauthority.bak is not working as it is saying /bin:/usr/bin is not included in the path environment variable.


Algebra isomorphism between a localization of a ring $A$ and a quotient ring of $A[X]$

Let $A$ be a commutative ring with $1$ and let $S=\{f^n|n\in\mathbb{N}_0\}$ for some $f\in A$ be a subset of $A$. Show that the localization $A_f:=S^{-1}A$ of $A$ in $S$ is isomorphic (as an $A$-algebra) to the quotient ring $A[X]/\langle fX-1\rangle$.  Clearly, $S$ is closed under multiplication and $1=f^0\in S$, so $S^{-1}A$ is well-defined. I have tried to establish an isomorphism by constructing an algebra homomorphism $g:A[X]\to S^{-1}A$ with kernel $\langle fX-1 \rangle$. The existence of such a homomorphism would imply the needed isomorphism because of the homomorphism theorem. I have tried using $$g:A[X]\to S^{-1}A,\ \ \ a_nX^n+\dots+a_1X+a_0 \mapsto \frac{a_n}{f^n}+\dots+\frac{a_1}{f^1}+\frac{a_0}{f^0}.$$ It is easy to show that $g$ is a homomorphism of algebras and that it is surjective ($\frac{a}{f^n}=g(aX^n)$ for all $a\in A, n\in\mathbb{N}_0$). It is also clear that $\langle fX-1\rangle\subset ker(g)$ since $$g(fX-1)=\frac{f}{f^1}+\frac{-1}{1}=\frac{f-f}{f}=\frac{0}{1}.$$ Now it only remains to show that $ker(g)\subset\langle fX-1\rangle$, but here I have some difficulties. From my understanding, if the statement that I try to show is true, then $ker(g)\subset\langle fX-1\rangle$ must also be true, so it should be possible to show this somehow. So far I have done the following:  Let $h=a_nX^n+\dots+a_1X+a_0\in ker(g)$, then we have \begin{align*} \frac{0}{1} & = \frac{a_n}{f^n}+\dots+\frac{a_1}{f^1}+\frac{a_0}{f^0}\\ & = \frac{a_nf^{n-1}\cdots f^0+a_{n-1}f^{n}f^{n-2}\cdots f^0+\dots+a_0f^n\cdots f^1}{f^n\cdots f^0}\\ & = \frac{a_n+a_{n-1}f+\dots+a_0f^n}{f^n}. \end{align*} Hence, by the definition of the equivalence classes (the elements of $S^{-1}A$) there exists some $m\in\mathbb{N}_0$ such that $$0 = a_nf^m+a_{n-1}f^{m+1}+\dots+a_0f^{n+m} = f^m(a_n+a_{n-1}f+\dots+a_0f^n).$$ All steps are equivalence transformations, so $h\in ker(g)$ means nothing else but that there exists some $m\in\mathbb{N}_0$ such that the last equation holds.  Now I don't know how to proceed. How can we show that this implies that $h\in\langle fX-1\rangle$?  Also, is there some more elegant (and maybe less constructional) proof for this problem?


Are there any Keyboard Shortcuts to Shutdown? (e.g. in Windows Alt+F4+Alt+F4 Right Arrow Enter)


Weight Paint subtract doesn't work as I expect

Hii Guys can anyone help with this? i am having some trouble with automatic weights. when i substract the weight under the right leg.its just not getting a smooth substract. it just shrink itself when i substract the weights. please can anyone solve my problem?


I'm looking for the answer to this question. But I could not find the "satisfactory" answer.  This is obvious,     $$\lim_{n\to \infty} \left(1+\frac 1n \right)=1+0=1$$   and     $$\lim_{n\to \infty} \left(1+ \frac 1n \right)^n=e≈2.718281...$$   And also we can write,     $$\lim_{n\to \infty} \left(1+ \frac 1n \right)^n=\left(1+0 \right)^{\infty}=1^{\infty}≠1$$   The point, which that I can not understand is:     $$\lim_{n\to \infty} 1^{\infty}=1^{\infty}=1$$   But, this is also true:     $$\lim_{n\to \infty} \left (1+\frac 1n \right) =\lim_{n\to\infty}1=1$$      Why $\lim_{n\to \infty} \left(1+ \frac 1n \right)^n=e$ doesn't imply $\lim_{n\to \infty} \left(1+\frac 1n \right)≠1?$


When spacetime is being curved, Does that mean it is moving?

When the action of curvature of spacetime happen, does that mean that spacetime is moving? But if it is, How can space be curved in space? That means that space needs space to be curved, which I can't understand.


Why does a string read from a txt file using java scanner not equal an identical string?

Below is my code, goal is to read instructions from a txt file to make java robot preform them. When changing any part of the if statement to != the robot portion works, therefore I have to think that the strings are in some way not equal.  public void interpretGoo() throws AWTException, FileNotFoundException,  InterruptedException{     Scanner scanner = new Scanner( new File("instruct.txt") );     String in;     String instruct = "";     while(scanner.hasNextLine()== true){         in = scanner.nextLine();         instruct+= in;     }     scanner.close();      String[] instructSet= instruct.split("-");     System.out.println("String: " + instruct);      String[] command= new String[10];     for(int i= 0; i< instructSet.length;i++){         command= instructSet[i].split(" ");         System.out.println("Set: " + instructSet[i]);         System.out.println("Word: " + command[0]);         if(command[0].trim()== "key"){             keyboardHandler(command[1].charAt(1));             Thread.sleep(150);         }else if(command[0].trim()== "clickL"){             accuMouse(Integer.parseInt(command[1]),Integer.parseInt(command[2]), 1, false);         }else if(command[0].trim()== "clickR"){             accuMouse(Integer.parseInt(command[1]),Integer.parseInt(command[2]), 0, true);         }else{             System.out.println("FAIL");             continue;         }     } }   OUTPUT:  String: clickL 728 1062-clickL 540 382-key h-key e-key l-key l-key o- Set: clickL 728 1062 Word: clickL FAIL Set: clickL 540 382 Word: clickL FAIL Set: key h Word: key FAIL Set: key e Word: key FAIL Set: key l Word: key FAIL Set: key l Word: key FAIL Set: key o Word: key FAIL   According to the output the strings are identical but fail the checks, any help would be appreciated!


What are the requirements for a rotation matrix?

Generally speaking, what are the necessary and sufficient properties of a matrix to make it a rotation matrix?  Is det(A) = 1 enough?


Cardinality of Solutions to an Inequality

Show that the number of solutions in nonneg. int. of the ineq. $$x_1+x_2+\cdots +x_n\leq M,$$ where $M$ is a nonneg. int., is $C(M+n,n)$.


When you cast invisibility on your turn, and walk away from 2 enemies, do they get an attack of opportunity?

When a PC is in melee with a creature, casts the basic invisibility spell, and leaves melee, does an NPC get an attack of opportunity?


How to combine two grep statements and display their results together?

Suppose I do     grep "MyVariable = False" FormA.frm     ... result1     grep "MyVariable = True"  FormA.frm     ... result2   How to write the grep command so that I can say something like     grep "MyVariable = False" OR "MyVariable = True" FormA.frm


When I try to install I don't get the option to install alongside with windows but I only have the option of creating partition! What should I do to install alongside with windows? Please help me !


Google authenticator blank after backup restore

My iPhone 7 had issues and I had done encrypted backups using iTunes. Apple gave me new iPhone as replacement. When I restored from iTunes backup, my Google Authenticator is blank.   I have lot of sites configured and I am not sure what to do now. Any help? I did download the backup codes from Google and it gave 10 codes. How do I used the codes for other sites like coinbase, Amazon, etc.?


How to combine 5V-powered ATmega16A and MAX44009?

I'm programming my ATmega16A through LPT port using uisp -dprog=bsd. Although ATmega16A supports \$V_{CC}=2.7\,\mathrm V\,..\,5.5\,\mathrm V\$, to make logical levels compatible with LPT port, I have to supply 5V to the ATmega.  All works fine, but now I need to connect MAX44009 lux meter (working via I²C) to the controller. MAX44009 supports \$V_{CC}=1.7\,\mathrm V\,..\,3.6\,\mathrm V\$, which appears too low to safely input 5V to it.  For transmitting data I could use e.g. a voltage divider to supply a fraction of 5V to MAX44009, and pull-up the SDA and SCL lines to this power source. Since SDA & SCL are open drain, this would work fine as far as we're only driving MAX44009's input. But when we want to read data back, we have a problem: 3.6V doesn't seem to be good enough to be seen as high level input for 5V-powered ATmega.  So, how can I actually safely connect ATmega16A to MAX44009, without losing the ability to program ATmega via LPT port? Some web pages like  simply suggest powering MAX44009 with 5V without explaining why. Others like  say that working voltage is 3 ~ 5 V, which also looks strange.


Is it really legal to submit a work to a venue although we already uploaded it as a reprint somewhere like Arxiv or researchgate?

I am wondering if it  is legal to submit a work as fresh manuscript to a journal although we have already uploaded it somewhere else as a preprint? Most of the journals/publishers require that the work at hand should not be submitted anywhere else. So I am wondering how the people who firstly put stuff  as a preprint on the researchgate and ArXiv deal with this issue!


Suppose $a \in \mathbb{R} ,a>1$ Is there an idea to compute the limit below ? $$\lim_{n \to \infty}\left( \frac{1^a+2^a+3^a+...+n^a}{n^a}-\frac{n}{a+1} \right)$$ I tried it for $a=1,2,3$ but I get stuck in general form . Can someone help me ? Thanks in advance.


What to do when a user edits an answer and makes mine look like it was copied?

I once answered a question two minutes after another user answered it. The answer the user posted was quite different from mine, but soon after my answer was posted the user edited his answer by adding the information I added in my answer.   Now, what do I do because since the edit is less than 5 minutes old it will not show that the user edited it and it will make my answer look like it was copied?


Apart from specific mathematical uses, "linear" (from Latin linea "line") means "in the form of/having to do with a straight line". A linear equation is obviously called that because its graph is a straight line.  But why is a linear map, which is a different thing, called "linear"? What is it about a linear map that is "having to do with a straight line"?    Please note: I know that "linear function", and the word "linear" in general, can mean these two different things:   A function, such as $f(x)=ax+b$, that has a straight-line graph on the Cartesian plane, also called a "linear equation" A function obeying the constraints $f(\mathbf{a}+\mathbf{b})=f(\mathbf{a})+f(\mathbf{b})$ and $f(k\mathbf{a})=kf(\mathbf{a})$, also called a "linear map"   I am not asking for a definition of either of these things. Nor am I asking whether or not they're the same. I know they aren't.  I am trying to be clear about this because there seems to be confusion. There is a very similarly-worded question title already, "" That's marked as a duplicate of another question, "". And my question was closed as a duplicate too, but I'm positive that it's not. You see, both of those are actually about confusion between those two things, and the answers are "they're different, don't get them confused, they just use an ambiguous name".  My question is, why is the name "linear" applied to the second concept at all? What is "linear" about it? Why wasn't it called a "proportional", or "fandangled", or "dinglehopper" map instead? I want to know why it is that "linear" is an applicable term for this thing we call a "linear map".    Reasons that don't seem to suffice, but please correct me if I'm wrong on any of these:   Because its graph is a straight line. (Not good enough, because it's specifically a straight line through the origin, not a general straight line. Straight lines in general are affine maps, AKA linear equations in the other sense.) Because it preserves straight lines. (Unless I'm mistaken, so does an affine map.) Because it bears the property that we call "linearity". (Circular reasoning. Which came first, linearity or the linear map? Whichever it is, I want to know why that was called "linear".)


We have just interviewed an applicant who the committee believes is best qualified for the position.      We have just interviewed an applicant whom the committee believes is best qualified for the position.   Which is grammatically correct and what is difference between them?  When and how to use who and whom in this type of sentences? Please explain to me.


I have some javascript / jquery to clone a table with some input files and a button. After cloning the button doesn't seem to work anymore when it has the same class.   The situation: When you click the add product, a row will be copied under the last row, so that a user can add an other product to the option. Here's an example:    There's an other button beneath those products: Create option. This button clones the first table (Option) and past it under the button. But after it has been copied, the button 'Add Product' doesnt seem to work anymore   I don't have any errors, so I don't know what I am doing wrong.   This is the code that I'm using to clone the tables:  <script type="text/javascript"> $(document).ready(function () {     $('.addproduct').click(function (e) {         // Clone a product and add it to the option.         e.preventDefault();         var item = document.getElementById('hiddenTemplate').cloneNode(true);         $('#hiddenTemplate').before(item);         $(item).removeAttr('id');      });     $('.addOption').click(function (e){         // Create a new option         e.preventDefault();         var item = document.getElementById('hiddenOption').cloneNode(true);         $('.newOption').append(item);         $(item).removeAttr('id');         $(item).addClass('tableOptions');     }); });     Could some1 explain to me what I'm doing and what might be an solution? My code isn't prefect atm i think and I'm open for learning!  Happy Coding!


Can you cite articles if you only read the abstract?

Well the question is pretty much self contained :  Can you cite articles if you only read the abstract ?  In a more general case :  1) Do reviewers actually read (or read) articles you cite ?  2) If the abstract is well structured, and you flied through the article content, everything seems reliable, and you do not need to have a thorough understanding of the methods for example, is it ok to cite it ?  EDIT : following O.R Mapper insightful comment  3) What if you cannot access the paper in no way ?


Translations in two dimensions - Group theory

I have just started learning Lie Groups and Algebra. Considering a flat 2-d plane if we want to translate a point from $(x,y)$ to $(x+a,y+b)$ then can we write it as :  $$   \left( \begin{array}{ccc} x+a  \\ y+a  \end{array} \right) =   \left( \begin{array}{ccc} x  \\ y  \end{array} \right) +    \left( \begin{array}{ccc} a  \\ b  \end{array} \right)$$  Now the set of all translations  $ T =   \left( \begin{array}{ccc} a  \\ b  \end{array} \right) $ form a two parameter lie group (I presume) with addition of column as the composition rule.  If that is so, how do I go about finding the generators of this transformation. I know the generators of translation are linear momenta in the corresponding directions. But I am not able to see this here.  PS:  In my course I have been taught that the generators are found by calculating the Taylor expansion of the group element about the Identity of the group. For instance, $\operatorname{SO}(2)$ group  $$ M =   \left( \begin{array}{cc} \cos \:\phi & -\sin \:\phi \\ \sin \:\phi &  \cos \:\phi \end{array} \right) $$ I obtain the generator by taking  $$ \frac{\partial M}{\partial \phi}\Bigg|_{\phi=0} =   \left( \begin{array}{cc} 0  & -1 \\ 1 &  0 \end{array} \right) $$  Now if I exponentiate this, I can obtain back the group element. My question how do I do this for Translation group.   EDIT :This edit is to summarise and get a view of the answers obtained.  Firstly, the vector representation of the translation group (for 2D) would in general have the form :  $$ \begin{pmatrix} 1 & 0 & a_x\\ 0 & 1 & a_y \\ 0 & 0 & 1 \end{pmatrix}\ $$ with generators (elements of Lie algebra)  $$  T_x =\begin{pmatrix} 0 & 0 & i\\ 0 & 0 & 0 \\ 0 & 0 & 0 \end{pmatrix}\ , \;\;  T_y = \begin{pmatrix} 0 & 0 & 0\\ 0 & 0 & i \\ 0 & 0 & 0 \end{pmatrix}\  $$  Secondly, the scalar-field representation of the same is given by the differential operators $$ exp^{ i(a_x\frac{\partial}{\partial x}+ a_y\frac{\partial}{\partial y} )} $$ with generators  $$ T_x^s = i\frac{\partial}{\partial x},\;\;T_y^s = i\frac{\partial}{\partial y} $$  The Lie algebra is two-dimensional and abelian : $ [T_x,T_y] = 0$


Whitespace before landscape in twocolumn pages (\afterpage does not work)

How can I eliminate whitespace before a landscape page? \afterpage does not work for me. Please find below an example. My code is like that : Text   \afterpage{ \begin{landscape}   Text1 \end{landscape}  a } \Section {head text2 } Another text


Prove that, if $\left\{a_n\right\}_{n=1}^{\infty}$ converges to A, then $\left\{|a_n|\right\}_{n=1}^{\infty}$ converges to |A|. Is the converse true?


Being a completely newcomer in linux world, I'm trying to make some development using ubuntu features. I wanted to add some alias to .bashrc but couldn't find it. There is an answer on this qustion, but its not a duplicate, because while working on an older versions of windows on my 1803 system it's doesn't work.


Find all natural numbers $n$ such that ${(n+1)}^{1/2}-{(n-1)}^{1/2}$ is rational

Find all natural numbers n such that ${(n+1)}^{1/2}-{(n-1)}^{1/2}$ is a rational number I think there wouldn't be any natural number as the square of a rational number is rational, which is not possible in this case. Am I correct please help me


What does [] mean after function in python syntax

What mean in python when i'm after function set [::-1] or [:64] for example? Here is code example  var = binascii.unhexlify(data)[:64]


(USAJMO)Find the integer solutions:$ab^5+3=x^3,a^5b+3=y^3$

Find the integer solutions: $$a·b^5+3=x^3,a^5·b+3=y^3$$ This is the first problem of today's USAJMO (has finished),I only find a trival result that $x\equiv y \pmod6$ and $abxy≠0 \pmod 3$.  Thanks in advance!


Proving $\mathbb R^2 \setminus \mathbb Q^2$ is connected

I am trying to prove that the set $\mathbb R^2 \setminus \mathbb Q^2$ is connected.   I don't know if the following is true: could it be that it is also path connected? If that is the case, maybe it's easier to prove path-connectedness and from here one would conclude connectedness. So, I pick two points $x, y \in \mathbb R^2 \setminus \mathbb Q^2$. I think I must separate in cases, so, for example, if $x=(x_1,x_2)$ and $y=(y_1,y_2)$ are such that $x_1$ is irrational and $y_1$ is irrational, how could I join these two points by union of line segments? I am clueless on how to go on.


ls returns output in several columns, whereas ls|cat returns byte-identical output with ls -1 for directories I've tried. Still I see ls -1 piped in answers, like ls -1|wc -l. Is there ever a reason to prefer ls -1? Why does ...|cat change the output of ls?


Is ArrayList.forEach() a mutative operation?

I have a HashMap groups which maps to ArrayList objects for its values. I wanted to re-assign the values given they meet a particular condition (i.e. in this case, they are present in another list) and came across the forEach method. Here's how I implemented it. I could not find any documentation as to whether it is able to transform my data hence my question.  Here's the code:  groups.get(request.getGroup()).forEach(           member -> {                int updatedMemberIndex = request.getGroupMembers().indexOf(member);                if (updatedMemberIndex != -1)                      member = request.getGroupMembers().get(updatedMemberIndex);           } );   And here are the method signatures for the relevant methods in request object:  List<GroupMember> getGroupMembers() Group getGroup()


I am trying to write an app that will trigger an pkg to open so the user can install this. I have the code and it is working well except for the following.  When I try to open the pkg file using open /tmp/mypackage.pkg in most cases it will open the Finder to the users home folder not the package.  I have checked and the package is present within the specified directory and the application is creating the correct command.  The command i am using to do this is in python:  subprocess.Popen(['open', '/tmp/mypackage.pkg']) application.close()


Show that if $\gcd(b,c)=1$ then $\gcd(a,bc) = \gcd(a,b)\cdot \gcd(a,c)$

everyone  I'm stuck on this proof. I know that $\gcd(a,bc)=\gcd(a,b)\cdot \gcd(a,c)$ but I don't know how I use $\gcd(b,c)=1$ to get that $\gcd(a,bc)=\gcd(a,b)\cdot \gcd(a,c)$


Highlight an equation within an align environment

I would like to define a command that puts a red box around an equation with yellow highlighting.  I have the basics working pretty well. What I am unable to figure out is:   How to keep the alignment of the equations on the equal sign. Be able to have the alignment character within the call to highlight box.  That is, I would really prefer to be able to say something like:  \highlightbox{g &= f}   instead of what I resorted to doing below.  Here is what I have so far:  \documentclass[11pt]{article} \usepackage{color} \usepackage{amsmath} \usepackage{amssymb} \usepackage{amsfonts}  \newcommand{\highlightbox}[1]{%     \setlength{\fboxrule}{6pt}\fcolorbox{red}{yellow}{#1}\quad% }  \begin{document} \begin{align*}    \highlightbox{a} &\highlightbox{= b} \\                  c  &              = d \\                  e  &              = f  \\    \highlightbox{g} &\highlightbox{= f} \\ \end{align*} \end{document}


How the /etc/passwd file is accessed by passwd command

My question is we are the normal user. We can't access the file which we didn't have the permission. We are executing the passwd command then how that command is able to access that file. We are executing the passwd command as a  normal user. Can anyone explain to me?.


Can Integration By Parts be used for a problem with more than two functions?

Can Integration by Parts be used to solve a problem that is more than $\int f(x)g'(x) dx$? - Like can it be used to solve something of the form: $\int f(x)g(x)h(x)i'(x)\ dx$ or $\int f(x)g(x)h(x)i(x)j'(x)\ dx$ etc? If yes, how would it be done?  seems to be addressing the same problem, but I do not understand the answer. Is there a way to answer this question in simple terms?


Problem exporting blender files to stl for 3d printing

When I export a 484K blender file to stl for 3D printing (xyz da vinci junior) it becomes 84 bytes (empty).The files that work are reduced in size by a factor of 50  from 484K to 9.84K whereas this file reduces by a factor of 50 times 100. Any ideas on how to fix it ? Thanks,with your help I've solved it.


Unable to Authorize an org in VS code getting below response in terminal

PS D:\LWCSession\LWC> sfdx force:auth:web:login { Error: spawn cmd ENOENT     at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)     at onErrorNT (internal/child_process.js:415:16)     at process._tickCallback (internal/process/next_tick.js:63:19)   errno: 'ENOENT',   code: 'ENOENT',   syscall: 'spawn cmd',   path: 'cmd',   spawnargs:    [ '/c',      'start',      '""',      '/b',      'https://login.salesforce.com/services/oauth2/authorize?response_type=code^&client_id=PlatformCLI^&redirect_uri=http%3A%2F%2Flocalhost%3A1717%2FOauthRedirect^&state=aee1a7bf19e7^&prompt=login^&scope=refresh_token%20api%20web^&code_challenge=AFdNI-DWiP7RrZdfNgWFWxe3pnXuqpAFkU4CcjXiMDA' ] } { Error: spawn cmd ENOENT     at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)     at onErrorNT (internal/child_process.js:415:16)     at process._tickCallback (internal/process/next_tick.js:63:19)   errno: 'ENOENT',   code: 'ENOENT',   syscall: 'spawn cmd',   path: 'cmd',   spawnargs:    [ '/c',      'start',      '""',      '/b',      'https://login.salesforce.com/services/oauth2/authorize?response_type=code^&client_id=PlatformCLI^&redirect_uri=http%3A%2F%2Flocalhost%3A1717%2FOauthRedirect^&state=aee1a7bf19e7^&prompt=login^&scope=refresh_token%20api%20web^&code_challenge=AFdNI-DWiP7RrZdfNgWFWxe3pnXuqpAFkU4CcjXiMDA' ] } { Error: spawn cmd ENOENT     at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)     at onErrorNT (internal/child_process.js:415:16)     at process._tickCallback (internal/process/next_tick.js:63:19)   errno: 'ENOENT',   code: 'ENOENT',   syscall: 'spawn cmd',   path: 'cmd',   spawnargs:    [ '/c',      'start',      '""',      '/b',      'https://login.salesforce.com/services/oauth2/authorize?response_type=code^&client_id=PlatformCLI^&redirect_uri=http%3A%2F%2Flocalhost%3A1717%2FOauthRedirect^&state=aee1a7bf19e7^&prompt=login^&scope=refresh_token%20api%20web^&code_challenge=AFdNI-DWiP7RrZdfNgWFWxe3pnXuqpAFkU4CcjXiMDA' ] } { Error: spawn cmd ENOENT     at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)     at onErrorNT (internal/child_process.js:415:16)     at process._tickCallback (internal/process/next_tick.js:63:19)   errno: 'ENOENT',   code: 'ENOENT',   syscall: 'spawn cmd',   path: 'cmd',   spawnargs:    [ '/c',      'start',      '""',      '/b',      'https://login.salesforce.com/services/oauth2/authorize?response_type=code^&client_id=PlatformCLI^&redirect_uri=http%3A%2F%2Flocalhost%3A1717%2FOauthRedirect^&state=aee1a7bf19e7^&prompt=login^&scope=refresh_token%20api%20web^&code_challenge=AFdNI-DWiP7RrZdfNgWFWxe3pnXuqpAFkU4CcjXiMDA' ] }


How can I filter out noise from irrelevant stack exchange sites in my feed on the mobile app?

I am not interested in Harry Potter or role playing games, but my feed seems to be full of those things. Is there a way to turn them off, or just pick the sites that I'm interested in?


Enchanting random items in Bedrock Edition

and I've been wanting a way to enchant unenchantable items in Bedrock without some client. Using the accepted answer from the linked question, I went to try this command and modify it because they are different: /give @p stick 1 0 {ench:[{id:16,lvl:5},{id:33,lvl:1}]}  However, I want a Knockback V stick instead. After some failures, I have a special draft: /give @s stick 1 0 {}  I'm not sure what the keywords are in the components section, so I will need help in that one. How can I get a Knockback V stick using commands?


hi I have pip installed on my python but I need to install some packages that require pip3, I couldnt change pip to pip3.  an ideas? Kay


But having lived in England for the past 3 years I’ve come to realize that this may be one of the reasons people call me ‘crazy’  what does ''having lived'' mean in the sentence?  because I have lived , after I have lived or etc?


Automatic coloring of numbers according to size

Scientific talks have their own culture, reporting the results, typically for me, in a table of the following form  1.7333    1.6472    1.5418    1.4682    1.5740 1.1525    1.2878    1.2652    1.3511    1.5102 1.2181    1.1500    1.2220    1.2425    1.5699 0.9786    1.1051    1.1472    1.3096    1.6757 0.9569    0.9190    1.0433    1.2924    1.4867   There is clearly a(n almost perfectly) monotonic pattern for rows and columns. Now for the naked eye, this is not the most quick way of capturing informing.  I would like numbers that bigger in absolute value, to appear differently (either green vs red or light vs dark) than smaller numbers, such that the pattern becomes clear instantly.  Is there a way of programming this in LaTeX?


Is there any way to get Math.random to return an integer?

I'm working on a Bubblesort that's supposed to take a random array of numbers and return them but I keep getting a 'possible loss of precision' error when compiling that tells me Math.random is returning a double and I need an integer. How can I covert this?   public class Bubblesort {    public static void main(String[] args) {      //create an int array we want to sort using bubble sort algorithm     int intArray[] = new int [Math.random()*100];   Here's my code just in case.  Edit: There was more code involved that I didn't think I would need to include. I tried casting but System.out.println isn't working now.  Rest of the code:   public static void main(String[] args) {      //create an int array we want to sort using bubble sort algorithm     int intArray[] = new int [(int)Math.random()*100];      //int intArray[] = new int [100];      //print array before sorting using bubble sort algorithm     System.out.println("Array Before Bubble Sort");     for(int i=0; i < intArray.length; i++){       System.out.print(intArray[i] + " ");     }      //sort an array using bubble sort algorithm     bubbleSort(intArray);      System.out.println("");      //print array after sorting using bubble sort algorithm     System.out.println("Array After Bubble Sort");     for(int i=0; i < intArray.length; i++){       System.out.print(intArray[i] + " ");     }


How to give a math operator as a parameter in C#?

I'm starting out with coding and trying to make a very basic calculator. I want to run it in a cmd by calling it up with two numbers. So, in the correct directory, I would type "BasicCal 2 + 5" to run it.   This is the code in C#   using System;  public class BasicCal {     public static void Main(string [] args)     {            Console.Write(args[0] + args[1] + args[2]);         Console.ReadKey();     } }   Cmd then just prints "2+5" so I guess C# doesn't see an operator as an argument.   So I just need to know how to make C# recognize an operator when it's given as a parameter. Thanks in advance.


Is there a reason to add options to not use advanced technologies in a game engine?

I have been developing a game engine, and have been discovering and reading up on game technologies such as anisotropic filtering, ambient occlusion, anti-aliasing, etc.  Usually in games, you can toggle these settings on and off. However, if these settings only add nothing but positives, is there a reason to add toggle values for these in a game engine for the developer?  I understand that performance is a major factor, but is there any other reason why these settings are always available to change?


If $x>0$, $\,x^{1/n}$ tends to $1$ as $n\to\infty$

I am looking for a proof possibly using the sandwich theorem and/or Bernoulli's inequality for proving the following statement:  If $x>0$ then $x^{1/n}$ tends to $1$.


X-Y coordinates unknown coordinate system?

I received a .dbf file with coordinates in a numerical format I have not been able to identify (for example (X,Y): 6151578.03, 2090875.69). These coordinates represent bus stop locations in the Orange County area (California) and I need to transform them into Lat-Long format (once I figure out what the original format is).  I am using ArcMap 10.2.2.


This is the Code I am looking at   In this project, there is a file named quitenet.py  In this file, there it is.  def chunks(l, n):     for i in xrange(0, len(l), n):         yield l[i:i+n]   I have no idea how I can understand the meaning l[i:i+n] .


Let $\displaystyle f$ be differentiable, $\displaystyle f(x)=0$ for $|x| \geq 10 $ and $g(x)=\sum_{k \in \mathbb Z}f(x+k).$

I came across the following problem that says:        Let $\displaystyle f \colon \mathbb R \rightarrow \mathbb R$ be differentiable function and $\displaystyle f(x)=0$ for $|x| \geq 10.$ Let  $g(x)=\sum_{k \in \mathbb Z}f(x+k).$ Then   which of the following is true?   $1.g$ is differentiable and $g'$ has infinitely many zeros   $2.g$ is continuous and $g'$ has no zeros   $3.g$ is differentiable and $g'$ has no zeros   $4.g$ is differentiable and $g'$ has only finitely many zeros.     I am not sure about how to progress with it.Can someone point me in the right direction? Thanks in advance for your time.


My "Enter the secret code" method is printing out the wrong output

I currently have a game where the user needs to type in the secret code correctly to play the game. However, each time I type in "game" as the user code, it prints out Goodbye!, rather than play the game. Can someone explain why?     public static void secretCode() {       System.out.println("Enter your secret code to play: ");       Scanner passwordInput = new Scanner(System.in);       String userCode = passwordInput.nextLine();       String gameCode = "game";      if (userCode == gameCode) {         System.out.println("Let's begin! Each game costs $50 to play.");         playGame();         System.out.println("Thanks for playing. Goodbye!");     }     if (userCode != gameCode) {         System.out.println("Goodbye!");     }  }


What is the need of complex functions in wave analysis?

It is commonly known that waves can be express in terms of sine or cosine function. But when I study further, I seen that for analyising the waves, it is common to use complex functions in the form $$y=y_{_0}e^{i(kx-\omega{t})}$$ where $y_{_0}$ is the amplitude, $k$ is the wave number, $\omega$ is the angular velocity and $x$ & $t$ are position an time respectively. Ofcourse, I know that the function $e^{ix}$ can be written in the form $\cos{x}+i\sin{x}$ and so it is a periodic function with period $2\pi$ but my question is for what purpose we define it in terms of complex numbers? It seem to be more convenient to use real functions for real variables such as amplitude, electric and magnetic field of an electro magnetic wave, and also in quantum mechanics. What actually this interpretation means or what is the advantage of such functions?


Does your cat have/has any distinguishing marks?   Here, if the subject is 'cat' then the verb 'has' is ok. But it seems that 'marks' is the subject here.What could be the right answer.


Bootstrapping with bootstrap sample greater than original sample

My original sample has 350 observations drawn randomly from a population of 60,000 people.   My independent variable is Default, with 35 observations with value of 1, and the rest with value of 0.  I split my sample to Train (60%) and Test (40%), then use multi-variate logistic regression to predict Default on Train, and validate on Test.  Because of small sample size, I want to validate confidence interval of a performance statistics (ROC) using bootstrap in two ways:  (1) Create 10,000 samples with the same size of the original sample, split them into train and test, and fit the model on train, and calculate ROC on test for each of the samples. Finally, plot the distribution of ROC.  However, when doing this, my ROC values are very disperse with high variance.  (2) Create 10,000 samples, but each sample has 3000 observations (randomly drawn from the original 350 observations), then repeat the process. In this case, my ROC and GINI values become very concentrated. This is what I prefer.  My question is:  In theory, what is the difference between the two methods?   Since (2) will most likely produce a better result, why (1) is much more popular?


Im having trouble with the second part of this question,  Let $H$ be a normal subgroup of $G$ with $|G:H| = n$,  i) Prove $g^n \in H$ $\forall g \in G$ (which i have done)  ii) Give an example to show that this all false when $H$ is not normal in $G$.(which I am having trouble with showing)  Any suggestions?


Where does the extra $U(1)$ symmetry come from in spontaneous symmetry breaking?

Suppose we're looking at an $SU(N)$ symmetry in the adjoint representation. The kinetic part of the Lagrangian yields a term   $$ \Delta \mathcal{L} = -g^2 Tr\left[[T^a, \Phi][T^b, \Phi]\right]A^a_{\mu}A^{b\mu} $$  When $\Phi$ acquires a VEV (call it $\Phi_0$) the broken generators are those whose associated gauge bosons acquire mass, via the above term of the Lagrangian. This amounts to saying that the unbroken generators are those whose commutator with the VEV vanishes:  $$ [T^a, \Phi_0] = 0 $$  Let's say generically the VEV has the form  $$ \Phi_0 = diag(a, a, ..., a, b, b, ... b) $$  where there are $n_a$ of $a$, $n_b$ of b, and $Tr[\Phi_0] = 0$. My understanding is that there are effectively three cases for generators that will commute with the VEV:  1) $$ T^a =  \begin {bmatrix} A & 0 \\ 0 & 0 \\ \end {bmatrix} $$  where A is an $n_a \times n_a$ block  2) $$ T^a =  \begin {bmatrix} 0 & 0 \\ 0 & B \\ \end {bmatrix} $$  where B is an $n_b \times n_b$ block  3) $T^a$ is a diagonal matrix.  I understand why generators from case 1) would produce generators of SU($n_a$), and why generators from case 2) would produce generators of SU($n_b$). What I can't figure out is why diagonal generators (often proportional to the VEV) are generators of U(1). My understanding was that the only generator of U(1) was the identity. Why is it that any traceless diagonal matrix can produce U(1)?


What does it mean there is multiple sources in a SELECT's "FROM" clause?

I have a table with a jsonb column, and I wanted to select from this table with the contents of that column extracted into columns:  CREATE TEMPORARY TABLE stuff (     name text,     contents jsonb );  INSERT INTO stuff (name, contents)     VALUES ('hello', '{"x": "hello", "y": "postgres", "z": "rdbms"}'::jsonb);  INSERT INTO stuff (name, contents)     VALUES ('hello', '{"x": "hello2", "y": "postgres2", "z": "rdbms2"}'::jsonb);  CREATE OR REPLACE FUNCTION pg_temp.extract_stuff (s jsonb, out x text, out y text, out z text)     RETURNS record AS $$ BEGIN     x = s ->> 'x';     y = s ->> 'y';     z = s ->> 'z'; END; $$ LANGUAGE plpgsql;   I was screwing around and somehow landed on this statement, which works perfectly and looks very intuitive:  SELECT     name,     foobar.x,     foobar.y,     foobar.z FROM     stuff,     pg_temp.extract_stuff (contents) foobar;   name  |   x    |     y     |   z     -------+--------+-----------+--------  hello | hello  | postgres  | rdbms  hello | hello2 | postgres2 | rdbms2   However, I'm not sure I understand how this works. Is it shorthand for an implicit inner join of some sort? What is the limitation of this type of syntax (can there be multiple physical tables, etc)?


What we've gelost — why doesn't English use the prefix "ge-"?

The Germanic languages that I'm familiar with all use a prefix similar to ge- on past participles:  German: Ich habe mir den Fuß gebrochen. Dutch: Ik heb mijn voet gebroken.  But English doesn't do this at all:  English: I've broken my foot.  Where did this prefix come from? Did English ever have the ge- past participle prefix? If so, why was it lost?


Microsoft Excel - Transform text type of cell to a numeric cell

I want to tranform multiples text cells (with numbers in it), to numeric type of cells. To finally manipulate the numbers


What happens to my rep if an answer is migrated to a stack where I'm not a member?

I answer  -- which, I'll admit, already has a couple close votes, but which seems to be to be a pretty simple and on-topic ask.  An hour or so later, I get a notification that my answer has been migrated.  Presuming I get upvotes on the answer, what happens to the rep?  I'm not a member there, so I presumably have (and will continue to have) zero reputation -- but the (presumed) upvotes will generate rep.  Does it just go into limbo?  If I were to later join that stack (unlikely, but not impossible, at least in this case) would I get that rep?  Or would I need to join there before the votes to collect?