I'm trying to create an interpolation of xyz data in QGIS. The data has successfully interpolated, but there is some strange striping or banding on the final result that I cannot seem to get rid of. See the images   The first (black and white) was created by saving the data points as a shapefile, then interpolating. Parameters in TIN interpolation were cubic method, with x and y set to 5 meters. I let col and row define themselves- how would that affect the result?  The second was with the xyz data loaded as a deliminated text layer. Interpolated the same as above.  The methods with the basic interpolation package do not change the result. Banding appeared with both linear and cubic options. I also looked at contours which exhibit the same problem (see the third image). Data itself is fine.   The banding might have a geographic cause- it is occuring over an area deeper than the surroundings. However, I do not expect it to create this level of an issue.

This is a lake of approximately 13 ha with 81 sampled depth points in about 10 transect lines:    Previously in ARCgis with a 50 ha lake and about a 100 depth sampling points, I got decent output with the TopotoRaster tool. However, no such exact equivalent seems to exist with QGIS or open source software.  In QGIS, I got the interpolated raster below, using the TIN method in the Raster Interpolation plugin. However, this seemed to be a lucky outcome, when I tried to repeat, I got different results (unsatisfactory) in spite of not really varying any parameter.    These are more urban (constructed) tanks than lakes, therefore, they are fairly regular in their bed profile, hence the low point sampling density. Some articles seemed to suggest Inverse Distance Weighting (IDW) as the most suitable technique, yet I seemed to get the worst results with that (possibly owing to low point density).  Are there any heuristics which can be employed here considering the size of the lake, its regular profile and the point sampling density to arrive at which interpolation method is apt? (between Kriging, IDW, Bilinear, Cubic convolution, TIN or spline)  Or is it always a bit of trial and error?


When I type \alpha my list get crazy...What I am doing wrong?  \documentclass[a4paper,12pt]{article} \pagestyle{empty} \usepackage{color} \usepackage{ifxetex} \ifxetex\usepackage{fontspec}\setmainfont[Ligatures=TeX]{CMU Serif}   \def\Hello{Welcome! \fontspec{WenQuanYi Micro Hei} 你好!} \else\usepackage[utf8]{inputenc}\usepackage[T2A]{fontenc}   \def\Hello{Welcome!} \fi  \begin{document}  \begin{enumerate} \item{bla bla bla (\alpha , Q) bla bla blabla bla bla}; \item bla bla bla (\alfa, Q); \item bla bla blabla bla blabla bla blabla bla bla \end{enumerate} \end{document}   Thanks.

I am giving a LaTeX course and have the idea to let the students find and solve problems within a few documents. Basically they shall learn how to create minimal examples and read error messages.  However, currently I have no document with 'typical' errors around.  If someone has such examples from him- or herself or within this forum I would like to have the code or link. It does not matter if its short or long. It should just be enough to let the students play with it for some minutes.


Let $f$ be a function defined on $[a,b]$ so that $f$ is continuous on $[a,b]$, differential on $(a,b)$, $f(a)=0$ and there exist a real number $A$ so that $$|f'(x)| \leq A |f(x)|$$ for all $x \in [a,b]$  Prove that $f(x)=0$ for all $x \in [a,b]$

Suppose for real numbers $a<b$ one has a function with continuous derivative $f:[a,b] \to \mathbb{R}$ such that $f(a) = 0$ and there exists a real number $C$ with $$|f'(x)| \leq C|f(x)|$$ for all $x \in [a,b]$. Show that $f(x) = 0$ for all $x \in [a,b]$.  Well, since $f(a) = 0$, we have that $|f'(a)| \leq C|0|$, so $|f'(a)| = 0$. Since $f$ has a continuous derivative, we also know that $f$ is continuous. Since $f$ is continuous on a compact interval, $f$ obtains a maximum, say at $\xi \in [a,b]$. So, $|f'(x)| \leq C|f(\xi)|$. Since the derivative is bounded, we obtain that $f$ is Lipschitz, so $f$ is also uniformly continuous. Suppose to the contrary that $f(\xi) > 0$? The above is pretty much everything I could figure out about $f$, so I'm not sure what to try next. This one is also from an old qual and possibly uses methods from beyond our course. I think maybe I should try to show that $|f'(x)| = 0$ for all $x$, but I don't know how.


My code is supposed to search a record within the database which contains id typed into IDname JTextField. Suddenly I've got this error:  java.lang.NullPointerException java.lang.ClassNotFoundException: com.mysql.jdbc.Driver java.lang.ClassNotFoundException: com.mysql.jdbc.Driver java.lang.NullPointerException     at com.implementer.escuel.Implementing$1.actionPerformed(Implementing.java:55)     at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)     at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)   What should I do? String id is defined so why get(id) shows NPE? Are the two errors connected? I also do not quite understand why I've got that ClassNotFoundException also. Here is the code:      JTextField IDname;     JButton submit;       public static Connection getConnection() throws Exception{         try{         String driver = "com.mysql.jdbc.Driver";         String url = "someurl";         String username = "";some name         String password = "some password";         Class.forName(driver);          Connection conn = DriverManager.getConnection(url,username,password);         System.out.println("Connected");         return conn;         } catch(Exception e){System.out.println(e);}           return null;         }   public Implementing() {          IDname = new JTextField("");         submit = new JButton("go");         add(IDname);         add(submit);         submit.addActionListener(new ActionListener() {  public void actionPerformed(ActionEvent e) {         if(e.getSource() == submit) {         try {          String id = IDname.getText().toString();         getConnection();         ////////NEXT LINE IS THE NPE////////         for(String string:get(id)){             System.out.println(string);         } //       get(id);         } catch (Exception e1) {         // TODO Auto-generated catch block         e1.printStackTrace();         }          }         }           });         setLayout(new GridLayout());         }  public  ArrayList<String> get(String idname) throws Exception{         try{         Connection con = getConnection();         // You should replace "YourTableName" With table in databace that you work with it         PreparedStatement statement = con.prepareStatement("SELECT * FROM YourTableName WHERE ppname = '" +idname+"'");         //If type of your id in database is Int write this code :         //    int id= Integer.parseInt(idName);          //PreparedStatement statement = con.prepareStatement("SELECT * FROM YourTableName WHERE id = " + idName);          ResultSet result = statement.executeQuery(); }

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


I'm trying to make something and I want a /tellraw to activate and when the player clicks on it multiple things happen. What I mean is when they click on the text like 5 /setblock commands activate. I can't figure out how do do this. I have tried just putting multiple clickEvents in but it does not work. Is this even possible?  I'm playing Minecraft 1.7.10.

I want players to be able to click text to run an OP command even if that player is not an OP. For example something like:  Console: Do you want to enable Fly? [If you do, Please click here]  *Player1 clicks that text*  Console: /fly Player1   Is something like this possible?


Suppose that I have a rectangular piece of card or paper and it's lying flat on a table. Then, 2 of the opposite sides of the paper are pushed together slightly, completely smoothly and with the sides remaining perfectly parallel.  Q: Give a mathematical description (parametric, perhaps, for a given point on the paper) of the curve that the paper makes as the sides are pushed together by some fraction $n$ of the distance between the two sides?  There are many obvious questions about this: does the curve depend on the material (i.e. I said paper, because that's how I noticed it, but what about a similar thickness of steel etc.)?   What about when one takes a brochure and forms a triangular-prism with 3 of the pages and then imagine pushing the 3 long edges of the prism closer to the center of the triangle smoothly - what curves would the sides make? What about with a 4-sided or $n$-sided prism of paper?  [I'm preferably looking for an answer to the first question, but if you have the capability to do so, why not explore?]

I have a paper which lies on a flat surface. The paper is fixed on one side and the opposite side can slide in the direction of the opposing side. As side end slides toward the other, a "bump" forms. I want to know what the solution is to the shape of this bump. There must be some standard solution for this case.  EDIT: Luboš Motl did provide a really nice answer for the case when the paper is assumed to lie flat against the surface at the ends (also with the assumption that the bump is small). I also found this  on a similar topic.


Hostelworld is currently the dominating system to book hostels in the world. There used to be hostelbookers but it was bought and now both sites resemble the same.  Not to say that the website isn't good but I often used both to search different offers and double check information like hostel ratings and prices or to do some type of search that one or the other allowed since they had different functionality at search level.  Since they now are the same and look the same, is there actually an alternative?

Always when I'm going to travel to someplace, I book my hostel with precedence. Actually I look only for two Booking sites:      Is there a cheaper site than these two, which has the same service with same quality, with the same number or larger?


Consider the following example:  \documentclass{standalone} \usepackage{unicode-math} \setmathfont{TeX Gyre Termes Math} \begin{document} \(f\Bigl(\Bigr)\) \end{document}   If you compile it with xelatex, you get    But if you compile it with lualatex, you get a narrower    Definitely, the results differ, so at least one of the engines or unicode-math is wrong about the spacing between f and the left parenthesis.  Subjectively, the  output of xelatex is more pleasant than that of lualatex, so, I presume, lualatex (or the code inside unicode-math run by lualatex only) is the culprit. But, I'm unaware of the "official" specification of how it should be, so, all bets are off.     How large is the distance between f and ( supposed to be for the most pleasant reading? Who is the culprit? (I.e., who deviates from the way it is supposed to be?) Is there any way to repair the culprit or at least to achieve independency of the engine used for compilation more or less automatically?   Weakly related:  . However, there, Ulrike said in her answer that "you are at the end of the math and luatex doesn't insert the italic correction at the boundary between math and text."  Here, on the contrary, we are still inside math. If you insert \Uchar"200B or 🦆 right after f, you get more space for both engines, and the discrepancy remains. Moreover, it's far from automatic even if the discrepancy would have gone away.  EDIT: Concerning     This question already has an answer here:   Change bounding box of math glyphs in LuaTeX   It doesn't. The answer from there doesn't fit here. Feel free to test it.  Crosspost:

I'm trying to use the Garamond-Math font in LuaTeX (despite the documentation saying I should use it with XeTeX only :-). It's working more or less OK with LuaTeX, except for some unfortunate glyph combinations, mostly at the end of inline math, such as “where $T$ is the period”.  I used \fbox to draw the bounding box of the glyph and noticed that the bounding boxes are different in LuaTeX:        and in XeTeX:        In XeTeX the glyph fits almost entirely in the bounding box, but in LuaTeX it overshoots far too much.  I'm not a font guy, so I have no idea why this happens. I thought the bounding box was a property of the font, so in my imagination the result should be the same. Thus the first question is: what actually happens that the bounding boxes are different?  The second question, in the title, is: can I change the bounding box of specific glyphs (using LuaTeX) so that the output looks more like XeTeX's?  I tried manually adding some spacing after the glyphs, but this looks hideous and will go down the drain if I happen to change the font or engine, so I'd really like not to do that. I also tried using the italic correction \/ but it seems to have no effect in math.  Here's the code to produce the pictures above:  \documentclass{standalone} \usepackage{unicode-math} \setmathfont{Garamond-Math.otf} \begin{document} \fboxrule=1sp \fboxsep=0pt In Lua\TeX{} this \fbox{$T$} looks horrible, but the \fbox{$X$} looks OK. \Huge\fbox{$T$}\quad. \end{document}   I'm using TL 2018:  This is LuaTeX, Version 1.07.0 (TeX Live 2018)  (format=lualatex 2019.3.29)  13 APR 2019 12:43  restricted system commands enabled. **test.tex (./test.tex LaTeX2e <2018-12-01> Lua module: luaotfload-main 2019-02-14 2.96 luaotfload entry point


Am I required to clear the use of class, race, or sub-race found in sources outside of the PHB with my DM?

I'm new to D&D and am making my first character for a home game.  What should I discuss with my DM prior to my first game? And what do I need their permission for? Classes, races and sub-races I intend to choose? There is a lot of info in multiple sources; any word on what I have to to discuss with the DM?


On Ubuntu 12.04, I ran ulimit -n, it is showing 1024.  I want to increase my open file limit from 1024 to 65535, so I tried the following command:  sudo ulimit -n 65535   but I get the following error:  sudo: ulimit: command not found   How do I increase the file limit from 1024 to 65535?

I'm trying to increase the maximum number of open files for the current user  > ulimit -n 1024   I attempt to increase and fail as follows  > ulimit -n 4096 bash: ulimit: open files: cannot modify limit: Operation not permitted   So I do the natural thing and try to run with temp permission, but fail  > sudo ulimit -n 4096 sudo: ulimit: command not found   Questions   How to increase ulimit? Why is this happening?   Using Fedora 14


Find all real solutions of:  $1$ + $x$ + $\dfrac{x^2}{2!}$ + $\dfrac{x^3}{3!}$ +...+ $\dfrac{x^{2n}}{(2n)!}$ = $0$   This is math club question I haven't made much headway on.

Is it true that  $$P_n(x):=1+ \sum_{m=1}^n\dfrac{x^m}{m!}$$ has no real root for even $n$ and exactly one real root for odd $n$? I can only prove that the polynomial cannot have any multiple roots. Am stuck , Please Help.


I have a polygon and I want to calculate its mean NDVI values from 2000-2003 (and few more periods) but only for March so the final result should be image which contains the mean NDVI values only for march between 2000-2003.  How can I do that?  This is the code I have written until now:  var dataset = ee.ImageCollection('MODIS/006/MOD13A1')                   .filter(ee.Filter.date('2000-03-01', '2000-03-31'))                   .select('NDVI')                   .mean()                   .clip(geometry)                   ; //var ndvi = dataset.select('NDVI') var ndviParams = {min: -2000, max: 10000, palette: [     'FFFFFF', 'CE7E45', 'DF923D', 'F1B555', 'FCD163', '99B718', '74A901',     '66A000', '529400', '3E8601', '207401', '056201', '004C00', '023B01',     '012E01', '011D01', '011301'   ]};   Map.centerObject(geometry, 7) Map.addLayer(dataset,ndviParams,'NDVI2')

Can you suggest an approach to select January Landsat 5 data between 2000 to 2010 and calculate its mean? In other words, the mean of the all January images from 2000 to 2010.


$q = $db->query("SELECT *          FROM people p         INNER JOIN job j                    ON p.job_id = j.id         WHERE p.id = '$id'         ORDER BY j.id ASC");     $maps = array();     while($row = mysqli_fetch_array($q)) {         $product = array(             'id' => $row['id'],             'job_id' => $row['j.id']         )     }   table people  id  table job  id  In the above code I am doing an inner join between two tables. Both tables have an a column called id is there a way to differentiate between the two in my while loop?  I have tried the above but $row['j.id'] doesn't work and if I do $row['id'] then it writes both id and job_id with the same value.

I have two tables in my database:  NEWS table with columns:   id - the news id  user - the user id of the author)   USERS table with columns:   id - the user id   I want to execute this SQL:   SELECT * FROM news JOIN users ON news.user = user.id    When I get the results in PHP I would like to get associative array and get column names by $row['column-name']. How do I get the news ID and the user ID, having the same column name?


As you all know, its normal to access any webpages source codes, people say:"so what? they can't get your PHP codes, they can't get your SQL codes".  Can't they get my JavaScript codes? yes they can, and I've worked hard on those codes, I spent nights and nights so I can build my site, why should anyone be able to get the codes?  What if one day, you see a website, very similar to yours, what can you do?  What if stupid people, studied those codes and found a bug, WHY?  When webpage source codes are available to public, where is the privacy of your hard work?   Can't we hide them?  Can't we encrypt them?  Can't we disable them?  Can't we do anything?

I want to make a JavaScript application that's not open source, and thus I wish to learn how to can obfuscate my JS code? Is this possible?


While solving a problem I came to an answer $\frac{1}{\sqrt{3}+1}$.  But this was not the answer.   The answer was $\frac{\sqrt{3}-1}{2}$ which comes on rationalisation of my answer.  Then I divided both results and get the same decimal value.  Then why do we need rationalisation if it doesn't change decimal value?

In grade school we learn to rationalize denominators of fractions when possible. We are taught that $\frac{\sqrt{2}}{2}$ is simpler than $\frac{1}{\sqrt{2}}$.  says that "there is a bias against roots in the denominator of a fraction". But such fractions are well-defined and I'm failing to see anything wrong with $\frac{1}{\sqrt{2}}$ - in fact, IMO it is simpler than $\frac{\sqrt{2}}{2}$ because 1 is simpler than 2 (or similarly, because the former can trivially be rewritten without a fraction).  So why does this bias against roots in the denominator exist and what is its justification? The only reason I can think of is that the bias is a relic of a time before the reals were understood well enough for mathematicians to be comfortable dividing by irrationals, but I have been unable to find a source to corroborate or contradict this guess.


Currently, I'm using DroidCam to expose my cell phone as a webcam to Linux, and recording a stream with VLC. This works, but when mastering a video (and not streaming live), I don't need a webcam. I just need a raw video file. Is there anyway with ADB to trigger recording a live stream and just saving it under /data?

How do you capture video from the camera on command-line of a rooted Android mobile device?


Suppose there are 2 APs, AP1 and AP2 where the first terms are a1 and a2 respectively and the common difference is d1 and d2. How do you find a mathematical formula to define the AP of the common terms, i.e. their first term and the common difference, without doing random guessing let's suppose the first term is A.P’s 3,7,11,... and the second 2,9,16,... I know the common difference of the AP of common terms is d=LCM(d1,d2) = LCM(4,7)=28 but what about the first term. Since the common term must have the value and are defined by their own respective APs equation a1+(n1-1)d1= a2+(n2-1)d2 and so 3+(n1-1)4= 2+(n2-1)7 4n1-4=7n2 4(n1-1)=7n2 Now what? One thing I did was find the first n1 value divisible by 7(cause it's on the other side, LHS) and the first n2 value divisible by 4 (cause it's on the other side, the RHS). And it seems to work for me, but what if I couldn't take 4 out of the bracket like this time. Is there are better way? I think I need to go to Fundamental theorem of Arithmetics because I vaguely remember doing something like this

How do I get the solution given by CRT to match another solution, e.g. the least positive? For example say I have X = 1234. I choose mi as 5, 7, 11, 13. This satisfies the simple requirements of . More precisely given in my example k = n = 4, and the product of any k - 1 is smaller then X how come simply computing the remainder of each won't give equations that solve to X = 1234. In the case of the example, x = 4 mod 5 x = 2 mod 7 x = 2 mod 11 x = 12 mod 13  Which resolves to  (won't CRT produce the smallest?) Any hints?  Below is the solution linked to on "Math Celebrity" (cached to avoid link rot).


So I have this program in which I need to compare values in 0.0X range and if I scan for example 50.21 with this little thing  scanf("%f",bill);   the value stored in var. bill is actually 50.2099990845... which messes up calculations later in program. Is there any way to turn this number into 50.210000? Thanks for your time.

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


Why does Newton's law of gravitiation look the way it does? Why is the Gravitiational Consntant this specific value? Why do Maxwell's Equations look the way they do? Why is it that abstract quantities we make up such as mass, charge, displacement, time etc... could be put into useful formula that accurately predict phenomena in the physical world?  I am aware that physical laws are merely abstractions, but the mathematical correspondance between many physical quantities we define is deduced almost purely emperically i.e. is not abstractly defined by us as human observers. Let me emphasise that this is not necessarily the case with all laws, for example Newton's Second Law "F=ma," where we define the force to be the product of mass and acceleration, there is nothing about the law that is "emperically deduced." It is purely a definition. However, the Second Law of Thermodynamics, Faraday's Law and Special Relativity are just a few examples of where we deduce "mathematically meaningful correspondance," purely due to emperical observation.   Why is that so? Why does our universe seem to exhibit mathematically significant correspondance? Please keep in mind that I am referring to emperically deduced laws of physics, not quantities we define.

Since I want to understand the world, I learn physics from textbooks. But I feel there is a gap between the textbook and the world. I do not know     why the equations in the textbook can control the whole world? How can I bridge the gap? In research, how can one distinguish whether what we do is meaningful in reality or not?   Any help or suggestions or comments will be appreciated.


Probably the first step towards applying for a PhD program is to find a professor who has enough interest/resource(s)/willing for the supervision. I know some of the  (including attaching CV and research interests plus recommendation letters) for a letter to professors but is there any specific information that should be included in the letter to make it more efficient?  In other word, how to write an email to persuade the professor to accept my application?

from reading previous posts it seems customary to directly contact a potential supervisor. Nevertheless, the school I'm applying seems to have a central admission comittee. Still, the professor in question encourages PhD candidates to contact him. Do i have less of a chance if i do not write him prior to the application and does he potentially expect some content other than explained . Also, isnt it rude to directly address a professor with their first name at first contact?


I’m trying to render jewelry in rose gold. Just wondering if anyone knows a way or a color hex to achieve a look similar to the below image. Thank you for your time!

Help! How to make such material procedurally in cycles


This is my code I want to do it in landscape but I failed.  \documentclass[a4paper,12pt]{report} \usepackage{pdflscape} \usepackage{rotating}  \begin{document} \begin{landscape}     \begin{table}         \centering         \footnotesize         \begin{tabular}{|c|c|c|c|c|c|c|c|c|}             \hline             \textbf{Characteristics}&\textbf{6LoWPAN}&\textbf{ZigBee}&\textbf{RFID}&\textbf{NFC}& \textbf{Cellular}& \textbf{Z-Wave}&\textbf{BLE} & \textbf{SigFox } \\              \hline              Standard&IEEE 802.15.4& IEEE 802.15.4&RFID&ISO/IEC 1443 A and B, JIS X-6319-4&3GPP and GSMA, GSM/GPRS/EDGE(2G), UMTS/HSPA(3G), LTE(4G)&Z-Wave&IEEE 802.15.4 &SigFox\\                           \hline                  Network&WPAN&WPAN&Proximity&P2P Network&WNAN&WPAN&WPAN&LPWAN\\              \hline              Range&Short Range 10-100m&Short Range 10-100m&Short Range upto 200m&Short Range 0-10cm 0-1m 10cm-1m&Several km&30m(indoors), 100m(outdoors)&Short Range ~15-30m&Long Range 10km(Urban) 50km(Rural)\\              \hline              Data Rate&250kbps&250kbps&4Mbps&106/212/404kbps&NA&40kbps&1Mbps&100bps(UL), 600bps(DL)\\              \hline              Features&Commonly Used Internet Access&Mesh Network&Low Cost&Security&Longer Range&Simple Prorocol&Low Power Version Available&Long battery life (upto 20 years), low cost\\              \hline              Applications&Monitor and control via internet &Monitor, control home industry&Tracking,Inventory,Access&Payment,Access&M2M&Home monitoring and control &Wireless headsets, audio applications&Street Lighting Energy meters\\              \hline         \end{tabular}          \caption{Comparison Of IoT Communication Protocols \cite{al2017internet}}         \label{block1}      \end{table} \end{landscape}  \end{document}

I have a table that I want to insert on a page, but at least one (perhaps both) of the following conditions are met:   The table is too wide to fit within the text block or page. That is, I'm exceeding some horizontal restriction. The table is too tall to fit within the text block or page. That is, I'm exceeding some vertical restriction.   What are my options to make this table fit? If it doesn't fit, regardless of my attempts, what other options exist?


I wanna test the method DrawCard() from the class ModelPlayer that takes the first not-null Color value from the arrayList PoliticCards of the class PoliticCard and puts it in the arrayList politicCards of the class Player; and i get two NullPointerExceptions.  public enum Color {     BLACK, PURPLE } public class PoliticCard {     private static ArrayList<Color> politicCards;     public PoliticCard(){         setPoliticCards(new ArrayList<Color>());         int i=0;         while (i<13){//adds 13 Color values set to BLACK             politicCards.add(Color.BLACK);             i++;         }         while (i<26){//adds 13 Color values set to PURPLE             politicCards.add(Color.PURPLE);             i++;         }         }         Collections.shuffle(politicCards);      }     public static ArrayList<Color> getPoliticCards() {         return politicCards;     }     public static void setPoliticCards(ArrayList<Color> politicCards) {         PoliticCard.politicCards = politicCards;     }   } public class Player {     private int id;//id of the player, goes from 1 to 10     private ArrayList<Color> politicCards;     public Player(int id){         this.setId(id);     }     public int getId() {         return id;     }     public void setId(int id) {         this.id = id;     }     public ArrayList<Color> getPoliticCards() {         return politicCards;     }     public void setPoliticCards(ArrayList<Color> politicCards) {         this.politicCards = politicCards;     } public class ModelPlayer {      public void DrawPoliticCard(Player player){         int i=0;         if(PoliticCard.getPoliticCards().get(i)!=null){                 player.getPoliticCards().add(PoliticCard.getPoliticCards().get(i));//This // is the line where i get the first NullPointerException             PoliticCard.getPoliticCards().remove(i);         }else{             i++;             player.getPoliticCards().add(PoliticCard.getPoliticCards().get(i));             PoliticCard.getPoliticCards().remove(i);         }          }    } public class ModelPlayerTest {      @Test     public void testDrawCard() {         Player player = new Player(1);         ModelPlayer modelPlayer = new ModelPlayer();         player.setPoliticCards(null);         new PoliticCard();         modelPlayer.DrawPoliticCard(player);//This is the second line where i get NullPointerException         assertNotNull(player.getPoliticCards().get(0));     }  }

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


For $n ≥ 2$,  $$\sum_{k=1}^{n-1} k \cdot k!= n!-1 $$  On the left-hand side, we could be choosing ordered subteams from $n-1$ people (let's say for some reason one of these people cannot be qualified). the range of k would be the size of subteams and $k!$ would be ordering them. $k$ could also be ${k \choose 1}$, which means we could be choosing a team leader for each ordered subteam. On the right-hand side, we order all $n$ people and then take out one of these cases but what I can't figure out is how to equate these two sides. Could you give any hints that could help me progress here?  Note: I apologize that this was a duplicate. Thanks for everyone who helped!

Prove: $\displaystyle\sum_{k=1}^n k k!=(n+1)!-1$ (preferably combinatorially)   It's pretty easy to think of a story for the RHS: arrange $n+1$ people in a row and remove the the option of everyone arranged to height from shortest to highest, but it doesn't hold up for the LHS.   Alternatively, trying to visualize the LHS, I noticed that it's like a right angle tetrahedra:  1  2!+2!  3!+3!+3!  ...  But it doesn't help to see a connection to the RHS.  Note: no integrals or gamma function nor use of other identities without proving them nor generating functions.


Whenever I have a fixed place to work, I like to use my MacBook Pro as shown:     Connected to an external display in mirror mode, not extended screen mode. Connected to external keyboard (Wireless Bluetooth, by Apple) and mouse (ThinkPad, Wired). Lid closed with the keyboard placed above it.   I have had this habit for a while and I haven't any doubt about it until recently when I observed something  happening to the MacBook's screen.  Is this a good or bad practise for the MacBook's lifespan?

I am using an external monitor and the only way (that doesn't involve jumping through hoops) to turn off the MacBook Pro monitor is to close the lid.  Does closing the lid causes any problems? I have read the following on :     You can still run a single external monitor if you close the lid of   your laptop, but that restricts airflow and exposes your display to a   lot of heat. Not good.


How can i make glitch photos like this picture?    Is there any special software or programming language to make photos like this?

My English is pretty basic, please don't mind. Wondering how to make the liquify wave and distort color effect in Photoshop? I'd tried using distort>shear/wave/zigzag, but still can't make it similar like the photo below.


I have come back from a family vacation looking forward to put my hands on this problem: I was shooting with my Nikon D600 camera and a dreadful message showed up (card err). I changed to a different card and had no problem with it for the rest of the trip.  The problematic card is a Kingston 32GB which contains some hundreds of RAW (.NEF) files. I have tried different programs so far without success: Lazesoft, ZAR, PhotoRec, testdisk. Windows sees the drive (e:) but doesn't allow to explore it. Testdisk shows a partition error message. Photorec, after 5 hours hasn't found anything.  This is really desperate, I can't imagine missing those photos. Ideas?

I accidentally formatted my memory card before realizing I hadn't copied the photos and video from it. Since I realized right away, I had not used the card and there is no chance for overwriting having occurred.   I have tried various free recovery software including recuva, photorec, icare-recovery, and a few others. None of them find any files on the card, though the software says it should be able to recovery data from formatted cards.   Is my data lost forever, or am I doing something wrong?


How can I compute the following limit, and is there a general method to resolve problems of this type?  $$\lim_{x\to\infty}x\left[\left(1+\frac{1}{x}\right)^x-e\right]$$

I am stuck on how to calculate the following limit: $$\lim_{x\to\infty}x\left(\left(1 + \frac{1}{x}\right)^x - e\right).$$  Definitely, it has to be through l'Hôpital's rule. We know that $\lim_{x\to\infty} (1+(1/x))^x = e$. So, I wrote the above expression as $$\lim_{x\to\infty}\frac{\left(1 + \frac{1}{x}\right)^x - e}{1/x}.$$Both numerator and denominator tend to zero as x tends to infinity. I applied l'Hôpital's rule twice, but I got the limit equal to infinity which is clearly wrong. In the book, it says that the limit should be $-e/2$.  Any help please? Also, in case someone managed to solve it, please tell me which numerator and denominator did you apply your l'Hôpital's rule to in both cases? Thanks a lot  Also, guys can you tell me how to write equations in this forum? Thanks.


Since several days ago (something automatically upgraded), I get no sound out of my Lenovo Thinkpad laptop with Ubuntu 18.04. I tried several things other similar threads suggested:     pacmd list-cards   returns 0 cards     lspci -nnk | grep -A2 Audio   returns nothing, and      pulseaudio -k && sudo alsa force-reload    and rebooting does nothing.  How do I get my sound back?  Also -- this seems like a fairly huge defect -- does anyone know what happened in apt-get upgrade to have caused this?

The soundcard I want to use is detected and works (it only recently switched to dummy output and didn't allow me to go back). HDMI is no longer listed under Audio and Video - KDE Control Module; everything under audio module is set to dummy output and its the only 'soundcard' on the list now. I can view my previous sound cards in alsamixer, but changing the settings from there does nothing. How can I get my real soundcards to work again? I have already tried the following answers without success:  EDIT: name@name-desktop:~$ lspci -vvv | grep -A8 Audio 00:01.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Kaveri HDMI/DP Audio Controller         Subsystem: ASRock Incorporation Kaveri HDMI/DP Audio Controller         Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+         Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-         Latency: 0, Cache Line Size: 64 bytes         Interrupt: pin B routed to IRQ 43         Region 0: Memory at ff764000 (64-bit, non-prefetchable) [size=16K]         Capabilities: <access denied>         Kernel driver in use: snd_hda_intel         Kernel modules: snd_hda_intel -- 00:14.2 Audio device: Advanced Micro Devices, Inc. [AMD] FCH Azalia Controller (rev 01)         Subsystem: ASRock Incorporation FCH Azalia Controller         Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-         Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=slow >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-         Latency: 32, Cache Line Size: 64 bytes         Interrupt: pin A routed to IRQ 16         Region 0: Memory at ff760000 (64-bit, non-prefetchable) [size=16K]         Capabilities: <access denied>         Kernel driver in use: snd_hda_intel  Could this image possibly help?:  There is another soundcard but I'm unsure of what its for because it never outputs sound, but it does have a lot of settings: that sound card is labelled as "HD-Audio Generic".   So I went into Software & Updates under the Additional drivers tab and I see this:  It was on Do not use the device so I changed it and applied the settings but unfortunately the soundcard isn't back even after reboot.


What is the point of having both .bash_profile and .bashrc, with the former typically sourcing the latter, which in turn sources /etc/bashrc upon login? What would be the downside of putting all that is in .bashrc in .bash_profile (or vice versa) and source only that one login script?

What is the difference between ~/.profile and ~/.bash_profile?


I've this very simple component  <aura:component implements="force:lightningQuickActionWithoutHeader, force:hasRecordId" controller="LC09_AccountButtonUpdatePermission_CTRL" access="global">  <aura:attribute name="recordId" type="String"/>   <lightning:overlayLibrary aura:id="overlayLib"/>  <aura:handler name="init" value="{!this}" action="{!c.updatePermission}"/>     it works and it is activated by an action defined as follows:    my problem is that i don't expect to see anything, I just want to call an apex method and show a toast message; the results I'm getting are those:    why the white modal? I just need to run some apex. Any suggestions?

I am attempting to replace JS buttons with quick actions. These button simply call a web service method and alert the result and need no user interaction.  With quick action a modal always seems to appear and this is not desirable.   I am calling the Webservice method in the doInit function and  firing a toast event with the results and have no need for the modal popup.  Seems an oversight maybe? But is there a way to accomplish this without the modal to closely mimic the JS button functionality?  Ideally we could show the spinner without the modal   Right now I am simply calling   $A.get("e.force:closeQuickAction").fire();   at the end of the doInit but it is not the most ideal in way of a UI to do this IMHO as it flashes the modal on the screen briefly.


I'm trying to include a movie in a beamer presentation. I've tried many things, and it seems I finally got it to work by something like this:  \documentclass[xcolor=dvipsnames]{beamer} \usepackage{media9}  \begin{document}  \begin{frame}  \begin{center} \includemedia[   activate=pageopen,   width=300pt,   height=170pt,   keepaspectratio=true,   addresource=./movies/Tacoma.mov,   flashvars={% src=./movies/Tacoma.mov &scaleMode=stretch} ]{}{StrobeMediaPlayback.swf} \end{center}  \end{frame}  \end{document}   where Tacoma.mov is a movie of the collapse of the Tacoma bridge due to wind loading (). The problem I see is that I have the movie, and when I create the presentation, LaTeX is embedding the movie in the pdf file, but this is not what I want to do because I don't want to duplicate the amount of memory. Is there a way to have the same behavior, but without embedding the actual movie in the pdf file?  I've seen that the beamer documentation proposes the use of the multimedia package, but I haven't been able to make it work without setting the externalviewer option. It gives me this error:  Macintosh HD:Users:aaragon:Desktop:hybrida LaTeX template:LaTeX:movies:Tacoma.mp4 cannot be found. Would you like to choose a replacement file?   My question is not restricted to the media9 package.

I have video tutorials that I want to show in my presentation with beamer class. I don't want the video files get embedded to the PDF because they will make the PDF size very very huge.  If you know how the videos can be played on the HTML with a reference rather than embedding the video file to the HTML file, I want something like this to be applied to my PDF presentation. I just want to reference the video URL from my PDF presentation.   Shortly speaking, can we use media9 to show a video on a PDF but the video is not embedded to the PDF?  Uploading those videos to a web server might be difficult for me because internet connection is very slow and sometimes not available in the presentation room. :-)


I'm currently working my way through the book "Linear Algebra Done Right" by Sheldon Axler. In the book, he defines a norm the following way.  Let $V$ be an inner product space and let $\langle u, v\rangle$ denote the inner product of $u$ and $v$. Then, the Norm of any vector $v \in V$ is defined as $||v|| = \sqrt{\langle v, v\rangle}$.  However, I was digging through Wikipedia and I discovered the concept of a "Normed Vector Space", i.e. a vector space on which a norm is defined. Inner product spaces seemingly constitute a subset of normed vector spaces. My question is this - how is it possible to have a normed vector space that is not an inner product space if it seems like the definition of a norm depends on the presence of an inner product?

Let $V$ be a vector space over  $\mathbb{C}$. If $V$ is an inner product space, then $V$  is normed (where the norm is defined as $\|x\|=\sqrt{(x,x)}\,\,$). Now if $V$ is normed, does it follow that $V$ is an inner product space ? I suspect no. I would like to see an example.  Thank you.    After reading my question again, I think it needs some clarification:  Suppose that $V$ is normed with norm $||\,||$. Can $V$ be given an inner product space structure such that $(x,x)=||x||^2$ ?


I have the following piece of code, it works and gives the correct output:  def msg_before(msg=None):     def actual_decorator(func):         def wrapper(*args, **kwargs):             print(msg if msg is not None else "was none")  # original             result = func(*args, **kwargs)             return result         return wrapper     return actual_decorator   @msg_before("this comes before") def test_func():     print("test")   if __name__ == "__main__":     test_func()      output:  this comes before test       But when I change the wrapper function like this:  def msg_before(msg=None):     def actual_decorator(func):         def wrapper(*args, **kwargs):             msg = msg if msg is not None else "was none"  # changed             print(msg)                                    # changed             result = func(*args, **kwargs)             return result         return wrapper     return actual_decorator   I get the following error:   Traceback (most recent call last):   File "C:/Users/ruohola/Desktop/test.py", line 33, in <module>     test_func()   File "C:/Users/ruohola/Desktop/test.py", line 19, in wrapper     msg = msg if msg is not None else "was none"  # changed UnboundLocalError: local variable 'msg' referenced before assignment       To me both of the codes seem identical, and I just don't understand where the error comes from and why it doesn't occur in the first code?

The following code works as expected in both Python 2.5 and 3.0:  a, b, c = (1, 2, 3)  print(a, b, c)  def test():     print(a)     print(b)     print(c)    # (A)     #c+=1       # (B) test()   However, when I uncomment line (B), I get an UnboundLocalError: 'c' not assigned at line (A). The values of a and b are printed correctly. This has me completely baffled for two reasons:   Why is there a runtime error thrown at line (A) because of a later statement on line (B)? Why are variables a and b printed as expected, while c raises an error?   The only explanation I can come up with is that a local variable c is created by the assignment c+=1, which takes precedent over the "global" variable c even before the local variable is created. Of course, it doesn't make sense for a variable to "steal" scope before it exists.  Could someone please explain this behavior?


Saying that I want to execute ls -l on each file in the directory /usr.  Here is how I did:  cd /usr find . -type f | ls -l   But it doesn't work as expected. The commands above will list all of directories in the /usr:  drwxr-xr-x  11 root root  4096 Mar  6 03:48 ./ drwxr-xr-x  23 root root  4096 Mar  6 02:32 ../ drwxr-xr-x   2 root root 36864 Mar  6 04:37 bin/ drwxr-xr-x   2 root root  4096 Apr 13  2016 games/ drwxr-xr-x  51 root root  4096 Mar  6 05:00 include/ drwxr-xr-x  73 root root  4096 Mar  6 04:34 lib/ drwxr-xr-x   3 root root  4096 Mar  6 03:48 libexec/ drwxr-xr-x  10 root root  4096 Mar  6 02:30 local/ drwxr-xr-x   2 root root  4096 Mar  6 04:34 sbin/ drwxr-xr-x 147 root root  4096 Mar  6 04:34 share/ drwxr-xr-x   6 root root  4096 Mar  6 04:00 src/   Why does the command give me such an output? How to list each file using ls -l in the /usr?

How would one run a specific command for each file that was found by using the find command? For the purpose of the question lets say that I would simply like to delete each file found by find.


The question is motivated by my  to the question: . In that answer, a lemma was used but I don't remember where I saw it. I'd like to recover a proof.  Question: How should I prove the following lemma?     Lemma. If $\lim_{n\to\infty}a_n=a$ and $a_n>0$ for all $n$, then we have    $$ \lim_{n\to\infty}\sqrt[n]{a_1a_2\cdots a_n}=a. \tag{*} $$     Attempt. I found that it suffices to show that $$ \lim_{n\to\infty}\frac{a_1+\cdots+a_n}{n}=a $$ which turns out to be not easy for me. I tried directly manipulating by definition but failed. How should I go on?

Prove that if $\lim_{n \to \infty}z_{n}=A$ then:  $$\lim_{n \to \infty}\frac{z_{1}+z_{2}+\cdots + z_{n}}{n}=A$$ I was thinking spliting it in: $$(z_{1}+z_{2}+\cdots+z_{N-1})+(z_{N}+z_{N+1}+\cdots+z_{n})$$ where $N$ is value of $n$ for which $|A-z_{n}|<\epsilon$ then taking the limit of this sum devided by $n$ , and noting that the second sum is as close as you wish to $nA$ while the first is as close as you wish to $0$. Not sure if this helps....


Recently I asked this question and got a very nice answer:    However, now I would like to use a different material for each face. Could anybody help me on how to do this? Written in python script would be best.  Thanks, Mojmir.

How do you add more than one material to a mesh?   I have tried adding two materials to the object, and then assigning one of the materials to a vertex-group, but I could not find a place to assign it.  I am making a striped bouncy ball that I want to deform, so adding a different material by separating the mesh into different objects would not be ideal.


I have a simple function called return_funcs here: >>> def return_funcs(): ...     functions = [] ...     for i in range(4): ...             functions.append(lambda: i) ...     return functions  And when I use return_funcs this is what I get: >>> for func in return_funcs(): ...     func() ... 3 3 3  I was expecting something like: 1 2 3  Why do I get this unexpected output, and how can I fix it?

I want to create a list of lambda objects from a list of constants in Python; for instance:  listOfNumbers = [1,2,3,4,5] square = lambda x: x * x listOfLambdas = [lambda: square(i) for i in listOfNumbers]   This will create a list of lambda objects, however, when I run them:  for f in listOfLambdas:     print f(),   I would expect that it would print  1 4 9 16 25   Instead, it prints:  25 25 25 25 25   It seems as though the lambdas have all been given the wrong parameter. Have I done something wrong, and is there a way to fix it? I'm in Python 2.4 I think.  EDIT: a bit more of trying things and such came up with this:  listOfLambdas = [] for num in listOfNumbers:     action = lambda: square(num)     listOfLambdas.append(action)     print action()   Prints the expected squares from 1 to 25, but then using the earlier print statement:  for f in listOfLambdas:     print f(),   still gives me all 25s. How did the existing lambda objects change between those two print calls?  Related question:


When should I say, for instance, "Mary and me," and when should I say "Me and Mary?"  Example:  Which option should I use in the following sentence?     After drinking our tea and saying goodbye to Hank, [...] made out way back   to the hotel.

I've always been taught to put myself last when referring to myself in the same sentence as others but the usage of "me and..." seems to be everywhere these days. The misuse of the word "me" instead of "I" aside, is there some new rule I haven't heard of? Shouldn't we put ourselves last regardless of the "me"/"I" usage?  Examples of "correct" usage:      My friends and I went for some ice   cream. Did you see my friends and me   at the ice cream stand?   Examples of "incorrect" usage:     Me and my friends went for some ice   cream. Did you see me and my friends   at the ice cream stand?   Note: I was also taught that the only person who could put themselves first was the queen.


. (I seem to recall seeing an instance where it captured something that wasn't a definition, too.) And the definitions it does capture can be in any language, but it doesn't mention what language they're in.  Here's the relevant part of the layout of an  entry:  The language name appears in an HTML H2 element (in ==...== code in the wiki markup, on a line by itself). The page is divided by such elements (i.e., all Latin-language definitions appear under the ==Latin== code). There are no other == headers on the page, though there are some H2s (generated by the software, so they don't appear in the wiki markup). The definitions are lines that start with \#+[^*:] (in regex), i.e. any number of #s followed by anything but a * or :. That's in the wiki markup; in HTML it translates to: an LI element in an OL, but not any UL or DL contained within that LI.  ?action=raw on a Wiktionary URL will give you the wiki markup instead of the HTML.

I found this weird word, "burke", and decided to check it out. It turned out it was an alternative spelling of "berk". This is what define: berk in chat expanded to:    So, according to that, "berk" as a noun can mean "a fool, prat, twit", or "berk", or "berk", or "berk". Wow, who would have thought "berk" might mean berk. Three times, just to be sure.  That got me really curious so I checked the wiktionary page directly. It shows three meanings for "berk": the same as meaning #1 that was oneboxed, plus two others that are not at all simply stated as "berk".  Further down from there we can find the other three "berks". Number three, for instance, is easy to trace since "indefinite plural berkë" seems quite greppable. And it turns out that it's Albanian.


I am arriving in the UK one day before canary islands are on the safe travel list on Sunday 4pm. Do I have to self-quarantine for the full 14 days or just until Sunday 4pm?

From 8th June there's been a  period for people entering the UK. From 10th July, travellers from  via a travel-corridor. If more countries are added to the list of exemptions then the date for each country will be later than the 10th July. If a traveller entered the UK from a country that is not on the exempt list and that country is added to the exempt list prior to the end of the 14 day self-isolation period does the self-isolation period end early? For example, if an individual entered the UK from France on the 5th July, should they remain in isolation for 14 days or does the isolation end on the 10th when France is added to the list of exempt countries?


How do I draw a tree-like figure similar to the one below please?


I'm looking for a portable storage fast solution.  If we look at some 128 GB SSD drives, you can see prices ranging (for internal drives) from 50 AUD to about 100 AUD. Couldn't find any external ones. So assuming I'll take an internal one I'll need some kind of adapter to make it work with USB.  And then, there are some 128 GB USB flash drives, that range from 40 to 60 AUD (at least in the local retailer I'm looking at).  What are the advantages of a 100$ SSD over any USB flash drives? Is it only speed? A fast USB 3 flash drive is fast enough for my requirements. Is there anything else?

I was just reading a question on backups with flash drives, but I was not quite sure why SSDs would be better than flash drives for backups.  To me, solid-state drives look like larger versions of flash drives. But surely there must be something that makes the former much more reliable than the latter.  What's the difference between an SSD and just a regular flash drive? For example, do they both use NAND?


I am going through different modules and I found this &drupal_static function but exactly dont know why is getting used can any one please explain what is the purpose ?

I understand Drupal static cache is used to store static values in the memory for the length of the request to faster access them. However throughout Drupal and contributed modules I tend to see two different versions:  Example from :  function drupal_is_front_page() {   // Use the advanced drupal_static() pattern, since this is called very often.   static $drupal_static_fast;   if (!isset($drupal_static_fast)) {     $drupal_static_fast['is_front_page'] = &drupal_static(__FUNCTION__);   }   $is_front_page = &$drupal_static_fast['is_front_page'];    if (!isset($is_front_page)) {     // As drupal_path_initialize updates $_GET['q'] with the 'site_frontpage' path,     // we can check it against the 'site_frontpage' variable.     $is_front_page = ($_GET['q'] == variable_get('site_frontpage', 'node'));   }    return $is_front_page; }   They way I read (and used) it from some tutorial I once found:  $static_cache = &drupal_static(__FUNCTION__); if (!isset($static_cache[$key])) {   // Obtain value   $static_cache[$key] = $obtained_value; }  return $static_cache[$key];   So I skipped the static declaration of the local variable, and to be honest I don't see why I should be adding it, it is in the first line of :  function &drupal_static($name, $default_value = NULL, $reset = FALSE) {   static $data = array(), $default = array();   // First check if dealing with a previously defined static variable.   if (isset($data[$name]) || array_key_exists($name, $data)) {     // Non-NULL $name and both $data[$name] and $default[$name] statics exist.     if ($reset) {       // Reset pre-existing static variable to its default value.       $data[$name] = $default[$name];     }     return $data[$name];   }   ... }   Is is even faster if I declare another static variable in my module to hold a function that manages a static variable? (The name drupal_static_fast implies this.) Is this some old Drupal 6 convention where there was no drupal_static and it had to be declared locally? Or am I missing something else?


To put it simply, I don't want to just switch black to alpha. I want to make it so that the more black a pixel is, the more alpha it has. I've got this nebula I made following a tutorial:  The image shown doesn't do it justice; there's a lot of very minor flushes of color around the nebula that I need to keep. As you can see, it's also black.    I want to make it so that the more black an image has, the more alpha it has. How would I do this in Photoshop (CS6)?

Basically, I would like to make it so that the lighter a pixel is (the more white it has) the more transparent it becomes. Black pixels would be opaque, white pixels would be transparent.  I currently use the slider in blending options on the first tab to get rid of the white and make it transparent but find it works slightly better if I use the magic wand tool with delete.  I figure that there is some blending option out there but there are so many and I'm not sure which to use to achieve my goal.  (Using Photoshop CS6)


I have some MATLAB code in my tex file, which I am highlighting with the listings package. However, there are some functions, such as "vision.CascadeObjectDetector", "imcomplement", "bwboundaries", "imcrop" that the listings package is not highlighting as functions. Is there any way I can add these functions manually?  Thank you

I'm using listings and I want to extend a language with additional keywords for highlightning. I know there is an option morekeywords available, but that only works for a particular lstset declaration and I don't want to have to copy-paste all keywords into all listings. I've tried declaring the keywords as part of a command but that doesn't work (probably because the command is not expanded and I don't know how to fix that).  So is there any way of declaring a new language by copying an existing one and just adding more keywords?


I`d like to learn how I can select text like with   +^{Left}    until a specific character ("-" in this case) has been found.  Thank you for your help.

I would like to have a script in AutoHotkey that allows me to do the following:   When I hit Control + Space: It would initiate "text selection mode"  (i.e. if I move the cursor with the arrow keys, or moving the mouse it will highlight text) When I hit Control + Space again: It would terminate "text selection mode" (e.g. if I move the cursor with the arrow keys or moving the mouse it will not highlight text)   However I would like to avoid using the following strategies, for the reasons explained below:  Strategy 1:  The following script does not let me move the cursor with the keyboard after I initiate text selection. Apparently the computer believes that I am constantly clicking on the mouse location, so it does  not let me move the cursor with the keyboard.  *^Space:: text_selection_is_on := !text_selection_is_on if text_selection_is_on    Send, {Click down} else    Send, {Click up} return   Strategy 2:  The following script relies on simulating the action of pressing the shift key down to initiate text selection. However, I would like to avoid relying on the shift key since some of the programs that I plan on using this script with require the shift key to be up (i.e. not pressed) when I move the cursor to select text.  *^Space:: text_selection_is_on := !text_selection_is_on if text_selection_is_on    Send, {Shift down} else    Send, {Shift up} return   Is it possible to do this with AutoHotkey? If so, how?  Thanks!


I want to prove that $$\frac{c^n}{n!}$$ tends to zero when $n$, a positive integer, is quite large. I do not think I can use L'Hospital's rule here as $n$ is discrete. Should we assume $n$ to be continuous to sove this problem. Furthermore, I do not find approximating $n!$ with gamma function of much help.

Why is     $$\lim_{n \to \infty} \frac{2^n}{n!}=0\text{ ?}$$   Can we generalize it to any exponent $x \in \Bbb R$? This is to say, is     $$\lim_{n \to \infty} \frac{x^n}{n!}=0\text{ ?}$$     This is being repurposed in an effort to cut down on duplicates, see here: Coping with  duplicate questions.  and here: .


in Rigid regression, we generally set a positive Lambda for regularization to get a less Residual. Why cant we have a negative Lambda in a regularization if we can benefit from it?

I am here to ask something that I think it is interesting, first I just read about the shrinkage using the Ridge or Lasso regression by using the lambda as the penalty to introduce a little bias that reduces a large amount of variance. From here why lambda is doing is it flatter the slope that makes me think what if it does the opposite thing. It increases the slope by change the lambda < 0, I know we don't do that in shrinkage so my question is can it be beneficial for lambda < 0 in some expansion instead of shrinkage?. Are there any case it can be applied?


The task is to transform $\sum_{k=0}^n \frac{1}{k+1} \binom{n}{k}$ into a compact and not recursive formula.  I've done a bunch of similar (as I thought at first) series. I'll describe my method. I name $\sum_{k=0}^n f(k)=a_{n}$, and then describe $a_{n}=a_{n-1}+f(n)$. Then I solve recursive formula by, for example, generating functions. It works for a series like $\sum_{k=0}^n k^2(k+2)$, so a series which doesn't contain $n$ inside.  About the main question, I tried to transform it with some formulas I know, like $\frac{n-k}{k+1}\binom{n}{k}=\binom{n}{k+1}$ or $\binom{n}{k}=\binom{n-1}{k-1}+\binom{n-1}{k}$, but none of them worked. With the last one I was able to transform it to like $a_{n}=a_{n+1}+\sum_{0}^{n-1}\frac{1}{k+2}\binom{n-1}{k}$, but it doesn't do anything, because there is $\frac{1}{k+2}$ and not $\frac{1}{k+1}$.  I would appreciate any hints!  Also, I thought about using the series $\sum_{k\geq0} \binom{n}{k}x^{k}=(1+x)^{n}$, because it looks like $\sum_{k=0}^n \binom{n}{k} \frac{1}{k+1}=\sum_{k\geq 0}\binom{n}{k} \frac{1}{k+1}$, and it looks pretty familiar.

I need to express $$1 + \frac {1}{2} \binom{n}{1} + \frac {1}{3} \binom{n}{2} + \dotsb  + \frac{1}{n + 1}\binom{n}{n}$$ in a simplified form.  So I used the identity $$(1+x)^n=1 + \binom{n}{1}x + \binom{n}{2}x^2 + \dotsb   + \binom{n}{n}x^n$$ Now on integrating both sides and putting $x=1$.  I am getting $$\frac{2^{n+1}}{n+1}$$ is equal to the given expression.But the answer in my book is  $$\frac{2^{n+1}-1}{n+1}.$$ Where does that -1 term in the numerator come from?


It is well known that the function $f(x)=1/x$ is not defined for $x=0$. However, simply multiplying $f$ by the function $g(x)=x$ gives a constant, very well defined, function, even at $x=0$. How can it be that multiplying by $g(0)=0$ something which doesnt exists ($f(0)$) can actually yield a result ?  Moreover, if I multiply the whole $f(x)$ by $0$ it obviously gives me $0$ at $x=0$ where i had $1$ in the previous case. This seems to indicate that either :   there is something more to the function $f$ at $0$ than not being defined there is something wrong with the way I think about the product of two functions.

My question is whether $x/x$ is always equal to $1$. I am mostly intersted in real numbers and particularly wonder whether $x/x$ is defined at $x=0$.  On one hand the division should simplify to $1$, on the other hand you should not be allowed to divide by zero.   I have been trying to find whether the simplification 'goes first' or whether the division causes trouble first, but it has proven impossible for me to find usefull search terms.     Note that this question arose after reading  and its first comment.


I need to create a program of which one of the options should be a project deadline. I have a class called NewProject then in the ProjectOptions file there is an option to make changes to the due date. Here is where the problem lies. I need to take a project number (projNum) input, then search for it in the array list then allow the user to change the due date. How do I go about doing this? The class is programmed as follows: package poisedProjects;  public class NewProject {      //Atributes          String projNum;     String projName;     String projType;     String projAddress;     String erfNum;     String projCost;     String projPaid;     String projDeadLine;          // Methods     public NewProject(String projNum, String projName, String projType, String projAddress, String erfNum, String projCost, String projPaid, String projDeadLine) {       this.projNum = projNum;       this.projName = projName;       this.projType = projType;       this.projAddress = projAddress;       this.erfNum = erfNum;       this.projCost = projCost;       this.projPaid = projPaid;       this.projDeadLine = projDeadLine;     }          //Methods(toString)     public String toString() {         String output = "Project Number: " + projNum;         output += "\nProject Name: " + projName;         output += "\nProject Type: " + projType;         output += "\nProject Address: " + projAddress;         output += "\nERF Number: " + erfNum;         output += "\nProject Total Cost: " + projCost;         output += "\nProject Cost Paid: " + projPaid;         output += "\nProject Deadline: " + projDeadLine;         return output;     }          public boolean contains(String search) {          return this.projNum.equals(search) || this.projName.equals(search) || this.projType.equals(search) || this.projAddress.equals(search) || this.erfNum.equals(search) || this.projCost.equals(search) || this.projPaid.equals(search) || this.projDeadLine.equals(search);     }  }  The ProjectOptions file contains the following: ... import java.util.ArrayList; import java.util.Scanner;  public class ProjectOptions {     public static void main(String[] args){                  final Scanner scan = new Scanner(System.in);         ArrayList<NewProject> newProjects = new ArrayList<NewProject>(); ...          else if(answer == 2) {                            System.out.println("Enter the Project Number: \n");             String projNum = scan.toString();                          boolean projfound = false;                          while(projfound == false) {                                  boolean currentProj = newProjects.contains(projNum);                 String currentProj2 = String.valueOf(currentProj);                                  if(currentProj2 == projNum) {                                          System.out.println("Enter new Due Date: \n");                     String projDeadLine = scan.toString();                                          System.out.println("The new Due Date is: \t" + projDeadLine );                                          }                 }             }  Thank you in advance for the help, I really appreciate it.

I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug.  Is == bad? When should it and should it not be used? What's the difference?


Can we say "I come not" or use "not" after verbs  like that sentence in English ?

Here's a passage (more or less taken randomly) from the  of the Bible from 1901:      (ASV)   14 But even if ye should suffer for righteousness' sake, blessed are ye: and fear not their fear, neither be troubled;   The bolded words are the grammatical form I'm asking about.  It's extremely common in the older translations of the Bible, which make them difficult to read.  These days, I think most people would say "do not fear their fear" of "don't be afraid of their fear" instead.  In fact, a  reads:      (NASB)   14 But even if you should suffer for the sake of righteousness, you are blessed. And do not fear their intimidation, and do not be troubled,   (There's a footnote on"intimidation" saying "Lit fear", so my first update matches exactly.)  Reading up on  I haven't been able to discover a name for this word ordering or any history about the change.  Can y'all give me some pointers?    I'm not sure if this part of the question is on-topic, but when I find this form would I be safe in mechanically changing it from:     verb not   to      do not verb   Are there instances that will break the meaning by doing this?


Is $\mathbb Q$ finitely generated as a $\mathbb Z$-module?   If I were to take a guess, I would say no but only because I am not sure how to generate all of $\mathbb Q$ from a finite set. But is this possible?

Can anyone please help me out on how to use the fundamental theorem of finitely generated abelian groups to prove that $({\mathbb{Q}},+)$ is not finitely generated?


I don't own many GOOG shares, but those that I do own have increased in value. It seems, though, that growth has flattened and the value is only fluctuating within a fairly stable range.  Why should I hold onto it if I'm not going to get any dividends from it?

Before recently, Apple Inc. did not give dividend to shareholders.  This makes me curious why people buy Apple Inc. stocks; while it might be due to the expectation of selling stocks at a higher price, this can only be possible if other people are thinking the same, thereby increasing demand. But the stocks themselves do not pay interests - so Apple's amazing revenue/profit records would not matter....


This is the problem: sometimes I connected to internet via VPN (this VPN server could be in countries like USA, UK and etc) sometimes I connected to internet without VPN. When I connected  to internet via VPN the fastest mirrror link that I  can use it is from that country servers. But when I connected to internet without VPN, the fastest mirror links are belong to my country (because there is  no VPN)  This solution can solve this problem if: when I connected to Internet and I want to install an app,an script a little time before installation of each package find  the fastest mirror link.  At this time no matter that I connected with VPN or without it  How I can solve this problem  in action?

I want to update my sources.list file with the fastest server from the command line in a fresh Ubuntu Server install. I know this is trivially easy with the GUI, but there doesn't seem to be a simple way to do it from from the command line?


We have a large classified ads website with a good sitemap and robots.txt. We have good content google crawls us 4 times per second but.... we dont get indexed by Google and our new advertisement post appears in SERP after 2 or 3 days what should we do to get index in hours?

This is a general, community wiki  question and answer pair intended to address any questions   concerning the reasons a site or specific site contents do not appear   in search engine results.      If your question was closed as a duplicate of this question and you   feel that the information provided here does not provide a sufficient   answer, please open a discussion on .   My site (or specific pages on my site) is not appearing in search engine results.  Why isn't my content indexed and what can I do about it?


I tried to show that  $F(x) = x^{\frac{1}{2}} +x^{\frac{1}{3}}-1$ this function is monotonic but that doesn't seem to work. Also I am not allowed to use graphs. Is there some algebraic approach to solve this?

Show that there is at least one real value of $x$ for which      $$x^{1/3} + x^{1/2} = 1$$   I did draw the graphs of $x^{1/3}$ and $1-x^{1/2}$ and showed that they met at a point, but I don't think it's a good algebraic proof.  How should I proceed after substituting $x$ for $z^{1/6}$ and getting a polynomial in terms of $z$


I use XeLaTeX and normally do not use the fontenc package.  But now I want to use a specific symbol which according to the  needs T4 encoding which is provided by the fc package.  Compiling the code below ended in       ERROR: LaTeX Error: Command \m unavailable in encoding TU.  --- TeX said ---  See the LaTeX manual or LaTeX Companion for explanation. Type  H <return>  for immediate help.  ...                                                l.16 Given a data matrix $D$ (database $\m                                           {D}$)   This is what I have tried:  \documentclass[12pt,a4paper]{article} \usepackage{fontspec} \usepackage[T4,T1]{fontenc} \usepackage{fclfont} \usepackage{t4phonet} \usepackage{amssymb} \usepackage{fontspec} % Gebruik met xelatex \setmainfont[Ligatures=TeX]{Linux Libertine O}  \begin{document}             % End of preamble and beginning of text.  Given a data matrix $D$ (database $\m{D}$)   \end{document}    How do I get this to work?

How can I insert a  into a LaTeX formula?  Ɗ


I went from Ubuntu version 8 something to 13.04 and the system is slow to the point of unuseable.  Is there something I can do with 13.04 to make it work or should I install an earlier version?  If so what version? Thank you, Hap

I'm thinking about installing Ubuntu Desktop, but I don't know what flavor is the best for my system. What are the minimum and recommended hardware requirements? What kind of CPU? How much memory? Should I have Hardware Acceleration? What flavor should I use?  This is an attempt of a canonical answer. My answers have the "official  requirements", the recommended are a mix of official sources and opinion based (along with the answer it's told the source). You can comment or edit if you feel that the information is obsolete or incomplete. It is a good rule of thumb that any system capable of running Windows Vista, 7, 8, x86 (Intel) OS X will almost always be a lot faster with any Ubuntu flavor even if they are lower-spec than described below.


I am using the following code to convert the string into a float.,  number = "2.05" float_val = float(number) print(float_val)   When I run this code with Python 3.5.2, the output is as shown below   I am running the same code on a different machine with Python 3.5.1, the output is as follows   My expected output is as in Python 3.5.2. What should be done?  Thanks in advance

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


If you see a terrible formulated question which is hard to understand(for example bad english grammar or whatever) or a duplicate but you do know the answer to the question, should you still answer the bad question? Or just leave it be?

Should I post an answer to an off-topic question after flagging it?   I seem to find off-topic questions that I can give a good, useful and correct answer to. (The specific question tonight is , but it's happened several times this month now). Other users have clearly deemed the question worth a response; I think I can provide a better response based on the original question and the provided comments, but I also don't think the question fits well on StackOverflow.   By answering, I feel like I would validate the question's existence on SO. On the other hand, other users clearly deem the question appropriate enough to warrant answers.   What's the consensus for this situation?


So I've been a longtime lurker of various StackExchanges (specifically Overflow) and the value it has given me cannot be described in words, however, I find myself wanting to upvote solutions or questions that I think are really good. Problem is, I have zero (ok well 1) reputation.  I've looked at the ways to gain reputation and it's really limited to users who may not want to ask questions or answer but still want to contribute to the community by placing a vote to signify they believe that this comment or answer has validity.   Rather than try to pollute Stack with questions that may already been answered or similar questions exist just to get to 15 reputation, what is the alternative for users like me? How can I still contribute to Stack without posting or answering questions?

I like the community and appreciate the great service it's been to me over the past few months.  Sometimes I want to show my support for a great answer or comment, but I can't because I'm a new user and have only 1 reputation. It seems like the only way to gain the requisite 15 reputation (for voting) is to ask questions?  Until now I didn't have any questions that weren't already answered by the community. Is this the only way? Won't this one day lead to no new users not being able to participate?


While working with PHP I used output buffer as a way to "combine" multiple method outputs and ex. write buffet to a file.  Example:  ob_start(); print $foo->bar(); print $anotherFoo->anotherBar(); $output= ob_get_contents(); ob_end_clean(); file_put_contents("output.html",$output);   Is there an equivalent in C#?

I want to output two different views (one as a string that will be sent as an email), and the other the page displayed to a user.  Is this possible in ASP.NET MVC beta?  I've tried multiple examples:  1.      If I use this example, I receive the "Cannot redirect after HTTP   headers have been sent.".   2.      If I use this, I seem to be unable to do a redirectToAction, as it   tries to render a view that may not exist. If I do return the view, it   is completely messed up and doesn't look right at all.   Does anyone have any ideas/solutions to these issues i have, or have any suggestions for better ones?  Many thanks!  Below is an example. What I'm trying to do is create the GetViewForEmail method:  public ActionResult OrderResult(string ref) {     //Get the order     Order order = OrderService.GetOrder(ref);      //The email helper would do the meat and veg by getting the view as a string     //Pass the control name (OrderResultEmail) and the model (order)     string emailView = GetViewForEmail("OrderResultEmail", order);      //Email the order out     EmailHelper(order, emailView);     return View("OrderResult", order); }   Accepted answer from Tim Scott (changed and formatted a little by me):  public virtual string RenderViewToString(     ControllerContext controllerContext,     string viewPath,     string masterPath,     ViewDataDictionary viewData,     TempDataDictionary tempData) {     Stream filter = null;     ViewPage viewPage = new ViewPage();      //Right, create our view     viewPage.ViewContext = new ViewContext(controllerContext, new WebFormView(viewPath, masterPath), viewData, tempData);      //Get the response context, flush it and get the response filter.     var response = viewPage.ViewContext.HttpContext.Response;     response.Flush();     var oldFilter = response.Filter;      try     {         //Put a new filter into the response         filter = new MemoryStream();         response.Filter = filter;          //Now render the view into the memorystream and flush the response         viewPage.ViewContext.View.Render(viewPage.ViewContext, viewPage.ViewContext.HttpContext.Response.Output);         response.Flush();          //Now read the rendered view.         filter.Position = 0;         var reader = new StreamReader(filter, response.ContentEncoding);         return reader.ReadToEnd();     }     finally     {         //Clean up.         if (filter != null)         {             filter.Dispose();         }          //Now replace the response filter         response.Filter = oldFilter;     } }   Example usage  Assuming a call from the controller to get the order confirmation email, passing the Site.Master location.  string myString = RenderViewToString(this.ControllerContext, "~/Views/Order/OrderResultEmail.aspx", "~/Views/Shared/Site.Master", this.ViewData, this.TempData);


I inherited a lot of plots loaded into a LaTeX file. These plots are saved in .eps files with a lot of white margin on the top and bottom of the plot.  I would prefer not to have to manually go into all these figures and crop out all the white space.   Is it possible to remove (partially) the top and bottom margins of the image files using LaTeX?

I'm inserting an image with a simple:  \includegraphics[height=5cm]{filename.png}   This results in an image that maintains the aspect ratio, and so gives me something like 6cm width. I only really want the left side of the image though, and would like to crop it to 50% width. Is it possible to do this?  If possible, I'd like to do this in a portable way (i.e. something that other authors of this document won't have to install packages for, and something that works with a reasonably old version of pdflatex - our computers at work are in sore need of an upgrade).


So, apparently the wiktionary oneboxing feature had a little makeover and now it doesn't just onebox into some ugly dump straight from the page.    Except when it does. As you can see, "they" expanded into the garbage format, while the rest was ok.

I found this weird word, "burke", and decided to check it out. It turned out it was an alternative spelling of "berk". This is what define: berk in chat expanded to:    So, according to that, "berk" as a noun can mean "a fool, prat, twit", or "berk", or "berk", or "berk". Wow, who would have thought "berk" might mean berk. Three times, just to be sure.  That got me really curious so I checked the wiktionary page directly. It shows three meanings for "berk": the same as meaning #1 that was oneboxed, plus two others that are not at all simply stated as "berk".  Further down from there we can find the other three "berks". Number three, for instance, is easy to trace since "indefinite plural berkë" seems quite greppable. And it turns out that it's Albanian.


I'm having quite the time getting my keyboard backlights to work on my ROG Zephyrus laptop. Some of the F# keys do not respond their dedicated function when holding the Fn key. Specifically the key combinations for adjusting keyboard backlight for my model FN+F3 to dim and FN+F4 to brighten.  Specifically, I have followed the many suggestions that were recommended from this  with no luck. I have edited the grub file as below and after updating grub I've done a reboot.  sudo vim /etc/default/grub GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_osi=" sudo update-grub reboot   I've also tried:  GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_osi= acpi_backlight=intel sudo update-grub reboot   I've also defined several different options all at once. I've tried a few different combinations as well.  I'm not for sure which one of these it was but caused my computer to lock up on a reboot with two lines indicating a namespace error.  Another setting basically removed all functionality from the keyboard and I had to re image in order to retain basic keyboard functionality back.Some of these additional options that I'm referring to are in the link above but I'm including them below for completeness.  GRUB_CMDLINE_LINUX="acpi_osi=Linux" GRUB_CMDLINE_LINUX="acpi_backlight=vendor" GRUB_CMDLINE_LINUX="acpi_osi=linux acpi_backlight=vendor" GRUB_CMDLINE_LINUX="acpi_osi_Linux"   I've installed this "brightness-controller" that was suggested on another site but that doesn't resolve anything.   I'm running the 375.82 Nvidia graphics drivers without any issues.  The person in the link above that was asking the question listed some specs from their system using a certain command lshw -C display.  So I'm going to do the same if it will provide any useful information. For specs related to my computer you can refer to this     *-display                   description: VGA compatible controller    product: NVIDIA Corporation    vendor: NVIDIA Corporation    physical id: 0    bus info: pci@0000:01:00.0    version: a1    width: 64 bits    clock: 33MHz    capabilities: pm msi pciexpress vga_controller bus_master cap_list rom    configuration: driver=nouveau latency=0    resources: irq:127 memory:db000000-dbffffff memory:b0000000-bfffffff memory:c0000000-c1ffffff ioport:e000(size=128) memory:c0000-dffff   Quick update 08/16/17  I emailed the driver support team from Asus and they informed me that they are using the Atk drivers to control the keyboard brightness.  So I did some searching around and came across an article  that mentions to run the following command.  echo 3 > /sys/class/leds/asus\:\:kbd_backlight/brightness;exit   However, when I run the command I'm denied permission. So I added sudo like so and it still failed...   So my first question is why I can't execute this command and if I'm doing something wrong what the correct command would be.  From here I looked at what the contents of that location were:    I then tried a few different commands hoping for a different outcome but the command I tried still failed even with sudo:    What am I doing wrong here? Can someone give me some commands to try out on this directory to see if I can change the brightness.

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


My girlfriend and I are travelling to the Philippines in November of this year 2013. We fly with Air Canada to Narita Tokyo from there we fly with ANA airlines to Manilla. We have a 2:20 minute layover. I have a Canadian passport and she has a passport from the Philippines. When we return, we fly with Jetstar from Manilla to Tokyo where we have a 4:50 minute layover then fly with Air Canada to Toronto. My question is " Do we need transit visa's for Narita? And if we have to leave the terminal to catch our connecting flight in another terminal do we need a visa in that case.

I will be transferring between two international flights at Tokyo Narita airport. I'm scheduled to depart the same day I arrive. I am planning to stay within the airport during the layover. Does anyone know if I will require a transit visa at Narita?


Many users decide to ask questions on SE sites when they are done spending time googling for the answer. That would explain why it's no rare to see question demonstrating  or even . Wouldn't it be great, specially on those cases, if we could know when someone is working on our questions? It's worth mentioning that some answers does take time to be written.  We can see how many people have seen our questions and the number of answers it's gotten, but we lack a mechanism saying: "2 users are elaborating answers to this question".  Another side effect of that would be users prioritizing questions that have no one working on them avoiding duplicate answers.  I hope I made myself clear.

When a question is open, it would be nice to see that there are X people (or preferrably a list of the X people) who are in the process of writing an answer.  For simple questions, usually once I'm about to hit the "post your answer question" I get the "there are 3 new answers, click here to load them" nag.


The XBox360 is offline. I was very far in the missions. How do I save game in Grand Theft Auto 5?

I'm looking for how can I save my progress in GTA V. I've looked in menu (from pressing "start") then "GAME". I only see    Replay Mission Replay Strangers and Freaks Load Game New Game   I activated the autosave but sometimes I want to save at a precise moment.


Case in point:  The accepted answer is not the best answer anymore, yet visitors to this page asking for this question are likely not to know any better and to copy&paste the first answer.  Consequently, I can:   upvote other answers, hoping they'll catch up. comment to ask to change the accepted answer. edit the accepted answer to point out it is outdated. edit the accepted answer to summarize all options (e.g. treat it as a community wiki).   Is there any guidance on that?  I did not find any similar meta question, only related ones where the original asker thinks about changing which answer is accepted, like:   Edit: some more search gives me:      which might be a duplicate, and which seems to suggest to just boldly edit the answer (using best judgement). EDIT: So i just did that, feel free to flag this questio nas duplicate and review my edit to the given accepted answer  In comparison, Wikipedia follows the  philosophy to allow fixing bad information as early as possible.

What should you do if a question has already been asked and answered, but both the question and the answer are now out of date? (in this case due to updates to jQuery).  Is it okay to make a new question if you need an up to date answer?  If you know an up to date answer is it okay to make a new question and answer it? Or should you answer the out of date question?  If you answer the out of date question, won't your answer just be buried and unnoticed because of the already upvoted/selected answers?  EDIT:  The problem is, sometimes a question and its answers will be so hopelessly full of out of date stuff, that it seems crazy to try and put up to date answers on the page. The page is pretty much worthless once the information is out of date, so would it not be better to start a new page?


I've found this  and clicked to flag it. When I was choosing which flag to apply, I've realized that the flag option "very low quality" was missing.    Since it is a question with a negative score, why can't I see this flag option?  (which type of flag this question should receive is not related with my question)     Additional notes:   The question does not have answers. The question is open, so it is not a race condition when the question is closed just after you click on it, like happened in this meta question:  This related meta question did not help me too:

Currently the Flag feature, on answers, offers five choices. Three of them request moderator attention:   Not an answer Very low quality "Other"   In the spirit of reducing the burden on moderators, and distributing that work a little bit more evenly around the community, I'm proposing a couple of small tweaks to the way answers are flagged.   Eliminate  as an option. Very low quality posts that are, nevertheless, genuine answers do not need moderator attention - they should just be downvoted. (Further justification for this is  and ) Replace  with four specific options:   Should have been a comment - this is not an answer, it is a comment on the question or on another answer. Flagger would then be required to choose which post it should have been a comment on. Should have been an edit - this is not an answer, it is additional information about the question from the original asker. Only appears if the answer is from the same user as the question. Me-too! non-answer - this answer consists of nothing more than "Me too!" or "Did anyone find the answer?" Conversational and irrelevant - this is not an answer, just a random conversation or rant, or meaningless typing that should be deleted    This makes life much easier on the moderators, because now the moderator is not expected to clean up after the bad answer, they merely have to peek at what happened and click "Agree" or "Disagree". If they agree:   Should have been a comment converts the answer to a comment Should have been an edit converts the answer to an edit and it is appended to the question Me-too! non-answer deletes the answer and leaves a form-message for the poster explaining that we don't like "Me too", but they should upvote the question if they think it's important or valuable Conversational and irrelevant - deletes the answer and leaves a form-message for the poster explaining that we are a Q&A site, etc. etc.   In fact, if enough people with high enough flag weight or reputation (FORMULA TBD) apply the same flag, the moderation happens automatically, without moderator involvement.  To prevent the moderation queue from filling up with problems that might cure themselves, these flags don't even go in the moderator queue until some period of time (TBD) has passed.  Thoughts?


How do permanent magnets work on the atomic level? Is there current inside this type magnet?  How do electromagnets work on the atomic level? Is there a current inside this type magnet?

I'm having trouble understanding how a  (not the  that is generated as a result but the material itself) work. The particles are aligned in a specific direction to give rise to force but I don't see how this alignment gives rise to "attraction" or force.


I'm setting my SPECIAL stats and I don't know how irreparable this damage will be... How will I be able to modify my SPECIAL stats after leaving the vault, if at all?  Theoretically, could I get each stat to 10 over the course of the game?

Building a character in Fallout 4 gives you 28 points in total to assign to your SPECIAL attributes during the initial character build - compared to 40 points in Fallout 3/ Fallout New Vegas.  In Fallout New Vegas you could increase your SPECIAL attributes over the course of the game via temporary buffs but you could also permanently increase your attributes using perks and implants. Using all available perks and implants there was a maximum of 61 SPECIAL points available (reference:  )  I realise it's day one and we've all got a long way to go but hopefully someone else can answer this question before I can:  How many permanent SPECIAL points are available in Fallout 4?


I have an idea that seems for me interesting and exotic. It is not about a traveling with speed of light or observing a frozen light.   Rather it is about the nature of light/photons and discrete structure of space-time. No material object can move exactly with speed of lights (there is no much energy for it), it is impossible to observe an frozen light. But the space-time cells can be activated in a way that seems that light are moving with the known speed of it.  My question about cells of space-time and they are not material until activated. Can a photon not move in space in classical terms of understanding? Can it happen so that instead of moving along a straight line, the movement is obtained this way: after certain intervals of time certain points (the points of space-time not classics material points) in space-time structure  are activated/deactivated. What I mean is that the light isn't moving in a way that the other macro objects are moving. I mean that light movement is some kind of wave of space-time points. Photon doesn't move continuously in space-time, rather it's a wave of space-time points and also according to this idea it becomes clear why the photon does not have a rest mass.  As an explanatory example I can give this analogy. Imagine that there is a display and a few pixels on it. At first the first pixel is turns on then it is turns off then the second one is turns on and after some time period it turns off and so consistently all the pixels. And for the outside observer is seems that the light is moving on (on the display). My idea is that on the space-time the light moves like in example above.

I read with interest about Einstein's Theory of Relativity and his proposition about the speed of light being the universal speed limit.    So, if I were to travel in a spacecraft at (practically) the speed of light, would I freeze and stop moving?  Would the universe around me freeze and stop moving?  Who would the time stop for?


I'm writing some mathematical formulas and I wonder if I can autoformat them. Here is an example:  \( {n(1+\frac {1} n)n(1+\frac {2} n)...n(1+\frac {10} n) \over n(1-\frac {1} n)n(1-\frac {2} n)...n(1-\frac {10} n)} =  \frac{n^{10}}{n^{10}} = 1 \)   Do you know what this thing means? I have no idea also, I have to compile it, to see the content. What I want is to recognize it from source code for fast editing. Any chance that I can have this kind of feature for offline editor? I'm using TeXworks right now.

I was looking for this a while back for JavaScript, but I was wondering a general purpose one exists for all, or most languages.  For example for LaTeX I would put the following in a text box  $f_i^k+10=x$   and it spits out the better formatted version  %%% %% Insert comment describing function here %%% $ f_{i}^{k} + 10 = x $   I can't be the only person on the planet that does not wish to go through a massive .tex file and fix these tedious problems.


I have been going through clean code book which states that the class should not expose the internal state of its data and only should be exposing the behavior. In case of a very simpl and dumb java bean exposing the internal state which getter's and setters, is it not worth just removing them and make the private members public? Or just treat the class as a data structure?

I'm currently working on a simple game in Java with several different modes. I've extended a main Game class to put the main logic within the other classes. Despite this, the main game class is still pretty hefty.  After taking a quick look at my code the majority of it was Getters and Setters (60%) compared to the rest that is truly needed for the logic of the game.  A couple of Google searches have claimed that Getters and Setters are evil, whilst others have claimed that they are necessary for good OO practice and great programs.  So what should I do? Which should it be? Should I be changing my Getters and Setters for my private variables, or should I stick with them?


I have a SRD-12VDC-SL-C relay with this configuration:  And I want to trigger it with PIR Motion Sensor Detector Module HC-SR501  The problem with direct connection to PIR is that the trigger output of PIR is +3.3V however the relay needs low or (zero) voltage in order to switch. I do not see how the relay in the link above can be put into High-level trigger.

I have a SRD-12VDC-SL-C relay with this configuration:  And I want to trigger it with PIR Motion Sensor Detector Module HC-SR501  The problem with direct connection to PIR is, when I connect PIR with 12v DC the Relay remains always ON, i.e. trigger from PIR does not switch it off. And when I connect it via 5V supply the Relay remains always OFF. The trigger output of PIR is 3.3V how can I rectify this problem? by adding some resistor/FETs, or something else. Edit: The voltage at Relay-In(Green) is 10.5V and the relay is OFF it need to go below 9V in order to switch the Relay ON. When I connect it to PIR trigger it goes down to 2.7V (Thus Switching ON the relay, below 9V). And when the PIR trigger of 3.3V comes it goes up to 7.2V but because it is still below 9V) Relay does not switch.


I have been assigned a Ubuntu 12.04 system.I have administrator privilages but when i try to execute command such as ifconfig,sudo etc the command does not executes.I have executed ifconfig command and i have got the following results      Command 'ifconfig' is available in '/sbin/ifconfig'   The command could not be located because '/sbin' is not included in the PATH environment variable.   This is most likely caused by the lack of administrative privileges associated with your user account.   ifconfig: command not found   but when i run the command as /sbin/ifconfig it executes but the problem is i have to use the entire path rather than just simply typing ifconfig.   Please suggest me what is the problem.And is there any solution for the above problem. Do help I am new to Ubuntu and i want to work with it any suggestion will be helpful

My question is related to another open . My  echo $PATH gives me an output which is like   /home/sahil/.rvm/gems/ruby-1.9.3-p125/bin:/home/sahil/.rvm/gems/ruby-1.9.3-p125@global/bin:/home/sahil/.rvm/rubies/ruby-1.9.3-p125/bin:/home/sahil/.rvm/bin:/usr/local/bin:/usr/bin:/bin:/usr/games:/home/sahil/.rvm/bin{}:/home/android-sdks/{}:/home/android-sdks/platform-tools/{}:/home/android-sdks/tools/{}:/home/sahil/android-sdks/tools{}:/home/sahil/android-sdks/tools:/home/sahil/android-sdks/platform-tools/   But running   ifconfig    gives me an output like  Command 'ifconfig' is available in '/sbin/ifconfig' The command could not be located because '/sbin' is not included in the PATH environment variable. This is most likely caused by the lack of administrative privileges associated with your user account. ifconfig: command not found   after running command like given in other question  export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"   it runs ifconfig but blocks other commands of ruby rails or rvm.  Seeking help how to resolve this. Also why this happens?