I want to create a variable unrelated to an existing object but has the same value to the object initially. That means, if I change the new object, it will not affect the old value.  I've tried to use Object.assign({},oldObj), but it doesn't work if I push a value to the array item in the object. Here is my code:    let oldObj = {X:10, Y:[]}; let newObj = Object.assign({},oldObj); newObj.Y.push(3.29231994); console.log(oldObj);     Any help will be much appreciated!

What is the most efficient way to clone a JavaScript object? I've seen obj = eval(uneval(o)); being used, but . I've done things like obj = JSON.parse(JSON.stringify(o)); but question the efficiency.  I've also seen recursive copying functions with various flaws.  I'm surprised no canonical solution exists.


Can someone please help me fix this command?     /setblock -10 15 -42 command_block 0 replace {Command:"/testfor @p[r=7] {Inventory:[{id:"minecraft:magma_cream"}]}"}

I need help with a specific command that I am using in a new game that I am creating inside of Minecraft. The command is:  /give @p sign 1 0 {BlockEntityTag:{Text1:"{"text":" [MF2]","color":"gold","clickEvent": {"action":"run_command","value":"tellraw @a [""{"text":"[MF2]  ","color":"gold"},{"selector":"@p","color":"dark_aqua"},{"text":" is now an admin of the server!","color":"white"}]"}}",Text3:"{"text":"Click to join Admin","color":"dark_aqua","clickEvent": {"action":"run_command","value":"scoreboard teams join admin @p"}}"},display: {Name:"Custom Sign"}}   If I take out the /tellraw command then the command works fine, but I need the command in there to announce to the game that a new admin has joined.  With the tellraw command, the error message is the following:  Data tag parsing failed: Unexpected token 't' at: text":" [MF2]","color":"gold","clickEvent":{"action":"run_command","value":"tellraw @a [""{"text":"[MF2] ","color":"gold"}, {"selector":"@p","color":"dark_aqua"},{"text":" is now an admin  of the server!","color":"white"}]"}}",Text3:"{"text":"Click to join Admin","color":"dark_aqua","clickEvent": {"action":"run_command","value":"scoreboard teams join admin @p"}}"   If anyone knows how to fix this, please let me know.


I'm having some trouble using a php variable with an SQL LIKE command. The code below acts as it should. However, if I change $model = "Cruze Limited"; I don't get any returns from the database. I'm expecting at the very least the same result I'm getting when $model = "Cruze"; which returns all vehicles that's model contains "Cruze".  I have a feeling I'm just missing some small syntax error but I can't place my finger on it. I apologize in advance if that's the case.  <?php  $make = "Chevrolet"; $model = "Cruze";  $trim = "LT";  $year = '2017';  $query = "SELECT *           FROM my_table           WHERE year = '$year'           AND make = '$make'           AND model LIKE '$model%'";  $statement = $db->prepare($query); $statement->execute();       <?php while($vehicles = $statement->fetch()): ?>
<?= $vehicles['year'] ?>

<?= $vehicles['stock'] ?>

<?= $vehicles['kms'] ?>

$<?= $vehicles['price'] ?>

<?= $vehicles['make'] ?>

<?= $vehicles['model'] ?>
       <a href="<?=$vehicles['photos']?>">Photo   <?php endwhile ?>      ?>

Here's my attempt at it:  $query = $database->prepare('SELECT * FROM table WHERE column LIKE "?%"');  $query->execute(array('value'));  while ($results = $query->fetch())  {     echo $results['column']; }


I would like to use my ISP for download only, and my cellphones 4G connection for upload only. This is because my ISP's upload speed is poor, but download is OK, and my 4G upload is great and free (I only pay for downloads).  So one PC, two connections: ISP for download, and 4G for upload. With doing this I would be paying the same as today, but increase my upload from 0.1 Mbit/s to about 60 Mbit/s.

We have a broadband line coming into our building which delivers around 8-10Mbps, which is okay but not great. Fiber is available in our area (30-100Mbps) but it's not available where we are just yet.   Is there some way we could connect two lines (which we would take from two different providers so we would have redundancy if one failed) and merge them into one signal which we could distribute?  Is there some sort of setup that can do this?  Of course we have the option of a leased line but for 12Mbps symmetrical upload/download we'd be looking at around £500 per month compared to £15 per month for normal or fiber broadband.  I made a small pseudo flow chat of the setup below:


Let $f(x)$ be a real valued function of real variable, define for all $x \geq 0$. $f$ is said to be concave if for any nonnegative real numbers a,b with $a+b=1$ we have $$f(ax+by)\geq af(x)+bf(y)$$ Suppose that $f(x)$ is concave, that $f(0)=0$, that $f(x)>0$ for $x>0$, and that $f$ is monotone in the weak sense ($x\leq y \Rightarrow f(x) \leq f(y)$). Let $M$ be a metric space with metric $d$. Prove that $f(d)$ is also a metric of $M$. I'd like some hints on how to prove the triangular inequality for $f(d)$, I've tried to apply $f$ in the triangular inequality for $d$ getting $f(d(a,b))\leq f(d(a,c)+d(b,c)$, but I don't know how to proceed.

Given a function $f: [0, \infty) \rightarrow [0, \infty)$ that's concave with $f(0) = 0$ and $f(x) > 0, \forall x \in [0, \infty)$, so $f(tx + (1-t)y) \geq tf(x) + (1-t)f(y)$, how do I show that if $d(x, y)$ is a metric on the metric space $M$, then $f(d(x, y))$ is also a metric for $M$?  I know that since $d$ is a metric, $d(x, y) \leq d(x, z) + d(z, y)$ by the triangle inequality. Is it enough to use the triangle inequality like this:  \begin{align*} d(x, y) &\leq d(x, z) + d(z, y) \\ \Rightarrow f(d(x, y)) & \leq f(d(x, z) + d(z, y)) \\ &\leq f(d(x, z)) + f(d(z, y)) \end{align*}  because concave functions are subadditive (which I can prove). Is that enough? The implication in the second step assumes that the function is increasing, or at least not decreasing (I'm not sure how to prove that), but is that really all I have to do?   discusses how this relates to subadditivity, but also makes the assumption of the function being increasing. From the given information, I don't think I have that assumption.


What is the difference between the following commands?   git add .  git add -A git add -u   I tried to execute them, and they create the same results.

The command git add [--all|-A] appears to be identical to git add .. Is this correct? If not, how do they differ?


I have had the same network-wide profile avatar for many years; it's a custom image which I installed nework-wide soon after I registered for Stack Overflow back in 2011. I still see that image e.g. on  and  but not, for instance, on this site, or e.g. on   (The example originally linked to my Unix & Linux profile instead of Super User but I experimentally changed my profile back to the gravatar one there.)  I routinely update my profile presentation text every few months, and did so again a few days ago. Comments below seem to indicate that others who recently edited their profile are experiencing the same problem.  My preferred avatar is a Gravatar which is connected to my email address, which has always been the same (MD5 091f411d57db5be8298e057a32e5ad72). The replacement seems to be a generic identicon with a different MD5. I don't recall seeing this identicon as an option in my profile before:    You'll notice that the gravatar is still visible as an option, but I can find no way to replace it on all sites in one go. I switched back to the gravatar one on Unix & Linux and noticed that the help next to the "Save" button says     Your profile will be updated on all public communities.   but alas, that did not in fact happen. Do I really have to go over 170+ member sites and manually select my gravatar on each?

I was interested if I can use a different flavor of gravatar instead of identicon.  When you click on the change picture text on your profile picture it has the Identicon and Upload options. I clicked Identicon (which already had the green tickmark) and my avatar changed (which obviusly sould not have happened as I have not changed any options).  For a reference you can see my old avatar here:    And my new one on Stackoverflow:     I have no recollection of changing my email address at any point during the lifetime of my account. (It was registered using Google-authentication). I have no Gravatar account registered.   Edit: My profile email (md5-ed) address would give the old avatar:


Currently, I have the following two lists: list1 = ['DB00619', 'DB01048', 'DB14093', 'DB00173', 'DB00734', 'DB00218', 'DB05196', 'DB09095', 'DB01053', 'DB00274'] list2 = [['Imatinib', 'Imatinibum'], ['Abacavir', 'ABC '], [], ['6-Aminopurine', 'Adenin', 'Vitamin B4'], ['Risperidona', 'Rispéridone', 'Risperidone', 'Risperidonum'], ['Moxifloxacin', 'Moxifloxacino'], [], ['Diflucortolona', 'Diflucortolone', 'Diflucortolonum'], ['Bencilpenicilina', 'Bensylpenicillin', 'Benzyl benicillin', 'Benzylpenicillin', 'Benzylpénicilline', 'Benzylpenicillinic acid', 'Benzylpenicillinum', 'Penicillin G'], ['Cefmetazole', 'Cefmetazolo', 'Cefmetazolum']]  My question is how can I combine these two lists and create a library, like the following? e.g. mylib = {'DB00619': ['Imatinib', 'Imatinibum'], etc.....}

Imagine that you have the following list. keys = ['name', 'age', 'food'] values = ['Monty', 42, 'spam']  What is the simplest way to produce the following dictionary? a_dict = {'name': 'Monty', 'age': 42, 'food': 'spam'}


I lost all data on my iMac recently, including some 1500 photos.  These photos were synced to the iPad from iPhoto on my iMac.   How can I transfer them back to my iMac since they are not in the camera roll on my iPad?

My iPhone was linked to my main computer and it has all my photos stored on it, but not in the camera roll. Since my husband blew the main computer up, my precious photos appear to be in limbo. It does not appear that I can import them anywhere. I could email all them one by one but that seems a little low tech. iTunes tells me that if I upgrade iOS I will lose my photos that are not in the camera roll. Also, the same would seem to be true if I deauthorize my main (now usless) PC. Any help would be greatly appreciated.


Let $\mathcal{M}$ be the monoid $M$ viewed as a category (single object, arrows are elements of $M$) and similarly for $\mathcal{N}$ and N.  Let $F : M \to N$, and $G : M \to N$ be two monoid homomorphisms which are also functors from $\mathcal{M} \to \mathcal{N}$.  Then a natural transformation from $F \implies G$ is an element $\psi_N \in N$ such that $\psi_N \cdot F(a) = G(a) \cdot \psi_N, \ \forall a \in M$ where $\cdot$ is the monoid law of $N$.  Then what monoid-theoretic concept does this natural transformation correspond to?  I've never seen it before.

So imagine you have a group $G$ and we consider the set of group homomorphisms from $\mathbb{Z}$ to  $G$ specified by  $\forall g$ $\in G$ $\exists$   $\phi(1)=g$. Each of these homomorphisms is in 1-1 relation with the elements of $G$.  Consider groups for a moment in the context of category theory, viewing the groups as one object categories and thereof group homomorphism as functors. What would a natural isomorphism mean in group theory terms for G?  My thoughts are that the natural transformations equate to maps between homomorphisms and since the homomorphisms are in 1-1 relation with the elements of G, then a natural transformation is a map between group elements, i.e another element of the group. I'm not entirely convinced by this.   Anyway continuing my reasoning a natural isomorphism is a map between the homomorphisms that has an inverse, the thing is in relation to the elements of G this is every element? Furthermore I'm looking to find an equivalence class defined by this natural isomorphism, is this just a collection of the elements that are each others inverses?  Thanks in advance for any assistance.


I'm reading the book "C++ Gui programming with Qt4" and I noticed in the code of the book that sometimes inside the header files the preprocessor command include is used:  #include  <QDialogButtonBox>   and sometimes the declaration of a class:  class QList;   Is there any rule when to use class and when to use #include?

I am looking for the definition of when I am allowed to do forward declaration of a class in another class's header file:  Am I allowed to do it for a base class, for a class held as a member, for a class passed to member function by reference, etc. ?


Today I saw this "try and avoid" phrase in a sentence .  "Try and avoid repeating the problems with the images dataset". What does "try and avoid" in this sentence mean? Is it the same with "try to avoid ? "

In written and standard semi-formal (and above) spoken English, one would use "try to":  Try to be a better person. Try to get the fishhook out of my thumb, please. Try to find a pharmacy when you need one.  But in spoken English, we (Americans, at least) usually substitute "try and" for all those cases. "Try to" makes sense because the "to" begins the construction of an infinitive: "try to be", "try to do", "try to act" and so on. "Try and" on the other hand doesn't seem to make any sense. I'm curious how the "try and" crept in, and when. It's really tough to Google small words like these, so I'm not finding anything on the Web. Is it a contraction of something like "Try hard, and ..."? Note: I've seen  and it is somewhat related but doesn't tell me what I want to know. Edit Observe how, even on this site,  construction. Turning it on its head Note that you can't make a negative construction with "try and":  It's raining. Try not to get wet. It's raining. Try not and get wet. [?]  Even adding do doesn't help. The following means something different from "try not to get wet."  It's raining. Don't try and get wet.  Even use of to instead of and there means something else:  It's raining. Don't try to get wet.  "Try not to get wet" means try to stay dry. "Don't try to get wet" means avoid actively seeking out a soaking, and implies that a soaking might in fact be what you are looking for. MORE I just happened to notice a video from an editor for Merriam-Webster on this very topic, so I include the link here: .


Is the magnitude of the coefficients enough to determine the importance of variables?

I've built a logistic regression classifier that is very accurate on my data.  Now I want to understand better why it is working so well.  Specifically, I'd like to rank which features are making the biggest contribution (which features are most important) and, ideally, quantify how much each feature is contributing to the accuracy of the overall model (or something in this vein).  How do I do this?  My first thought was to rank them based on their coefficient, but I suspect this can't be right.  If I have two features that are equally useful, but the spread of the first is ten times as large as the second, then I'd expect the first to receive a lower coefficient than the second.  Is there a more reasonable way to evaluate feature importance?  Note that I'm not trying to understand how much a small change in the feature affects the probability of the outcome.  Rather, I'm trying to understand how valuable each feature is, in terms of making the classifier accurate.  Also, my goal is not so much to perform feature selection or construct a model with fewer features, but to try to provide some "explainability" for the learned model, so the classifier isn't just an opaque black-box.


I have built a massive house with several rooms for npcs. The house is has red ice walls and snow floor and roof as well as gray brick walls all placed myself. I have torches in every room and when I check valid housing it simply says this housing is missing a table and a chair. I've tried serial different tables wrenches and chairs and every time I check it now it says this in not valid housing. Any idea why? Is my game glitched or something?

I read on the wiki that people will move in under the following conditions:   You do something to please them An empty house is available with a light source, table, and chair (also with walls).   I have a house which is about 7x8, then a roof space above that; about half the area. I could put furniture up there too, but will anyone move in?


If you just drop a standard lead bullet, it falls in like 1 second. If you shoot it from a gun, why does it take so long to fall down? Doesn't gravity pull on it the same speed?

I read recently that if you hold a bullet in one hand and a pistol in the other, both hands at the same height, and subsequently fired the pistol at the same time as dropping the bullet, both bullets would hit the ground at the same time (assuming the fired bullet encounters no obstacles).  Is this true, and if so can you explain the reasoning behind it with as few equations as possible? I assume it is essentially that gravity is unaffected by momentum, but it just sounds counter-intuitive.


When I declare something like   int *i = new int;   what is the value it is initialized to (by the compiler). If I want to make sure it is zero would I have to use   int *i = new int(0);   will new initialize everything to zero?  on the same topic what will be initialized by the compiler what will have to be user (when it comes to pointers).

If 'Test' is an ordinary class, is there any difference between:  Test* test = new Test;   and  Test* test = new Test();


So, my question, and I haven't found a succinct, well laid out answer anywhere (if you have, please share), but how many attacks does an unchained monk with natural attacks get, and is it worth flurrying?  The scenario is a level 3 Tiefling Unchained Monk with Maw or Claw Alternate Racial Trait, choosing the 2 claw attacks, and the feats Feral Combat Training and Weapon Focus (Claws).  By my understanding, a full attack would allow 1 unarmed attack at +3 (assuming 10 str) and 2 claw attacks at -1 (+3bab, +1 weapon focus, -5 secondary), or:  UA+3, Claw -1, Claw -1  Also by my understanding, a Flurry of Blows would be 1 attack (unarmed or claw), and then the Flurry of Blows attack which also could be an unarmed or claw attack, but at full bab, so it would look like this:  UA+3, FOB UA+3 or Claw+4, FOB UA+3 or even Claw+4, FOB Claw+4  So, you end up with 1 less attack, but at higher chance to hit.  Is this accurate?  Or am I missing something?  And to make sure I'm not missing anything at higher levels, what would level 6, 11, and 16 look like?  Ultimately, again, is Flurrying worth it if you have natural attacks?

I know the question of whether adding your natural attacks after you finish a Flurry of Blows (As secondary nat attacks at −5) has been asked many times () and it has been generally agreed that it doesn't work. But now want to know if you are allowed to perform the process backwards. Natural attacks first, then the extra hits from FoB.  Example:  Level 3 Catfolk (With 2 claws, no Monk weapons) Unchained Monk with Feral Combat Training (Claws).   Flurry of blows without any natural weapons is 2 attacks at full BAB because they normally get 1 attack as full round action. This character can also get 2 claws as a full round action, would he be able to use flurry of blows to add a third hit in this scenario?  The claws would be primary Natural attacks, followed by the "extra" hits from flurry. The text says Flurry gives me some sort of max number of attacks, but that number is never mentioned. Is it my normal full attack +1? With natural weapons, full attacks can have varying number of hits.


I'm new to latex but using it to format my CV. I have several sections like the one below, where I expect the two headings "Instruction" and "Lectures and Workshops" to look identical. \section{\sc Teaching} \underline{Instruction}\vspace{1.5mm}\smallskip \\ Teaching assistant, ... \smallskip \smallskip \\ \underline{Lectures and Workshops}\vspace{1.5mm}\smallskip \\ Using data science ... \smallskip \smallskip \\  However, as you can see in this picture, the first underlined line looks much more cramped than the second, which has more spacing between the text and the underline. Does anyone know what might be causing this and how to fix it?


]  Every time, when I use biblatex, it says "you should run the Biber". But there is no Biber here.

Running the minimal example  \documentclass{article} \usepackage{filecontents} \begin{filecontents*}{\jobname.bib} @ARTICLE{example,   author  = {Other, Anthony Norman},   title   = {Some things I did},   year    = {2014},   journal = {J.~Irrep. Res.},   volume  = {1},   number  = {1},   pages   = {1-10} } \end{filecontents*} \usepackage[backend=biber]{biblatex} \addbibresource{\jobname.bib} \begin{document} Hello\cite{example}. \printbibliography \end{document}   I get the warning There were undefined references.  I have read  and know that I need to run:   LaTeX Biber LaTeX   However, my editor is only set up to run BibTeX. How do I go about setting up my editor/IDE to be able to run Biber, and how do I run the LaTeX/Biber/LaTeX cycle?  Answers (sorted alphabetically by editor name)                    Answer guidelines   Each answer should be for one editor. If the editor is cross-platform, if possible give a single answer with notes covering the minor platform variations. Please edit the question to include new answers in the 'link list' Each answer should be 'stand alone', i.e. don't say 'It's almost the same as editor Y but ...' for the editor part Instructions for 'build tools' such as arara or latexmk are welcome but should explain how to set up the editor in question as not all editors allow simple addition of arbitrary tools


I've recently gained the close voting privilege. I was looking over my flag history for questions I'd flagged which both didn't get closed and didn't get fixed, and I've found a few. The flags were both marked as helpful and unhelpful.  But when I go to those questions I can't vote to close them as it says "You have already flagged this question for closure". Does this mean I will never be able to vote to close on these questions again? If so why?  If this is the case it seems quite problematic to me because it means a mod can unilaterally take away my voting rights on those questions with no explanation. I have no problem with mods insta-closing or reopening, as those actions can be reverted later on. I also have no expectation that my intuitions as to what is too broad or opinion-based line up with the community's consensus either - that's what makes the voting system good because it does take agreement to close these questions when each person can only get 20% there. But if I'm prevented from voting because I flagged in the past then I can't put my 20% opinion out there (even if sometimes it's going to be the only vote) - it will forever be 0%.

Back in April, I flagged a post as "not a real question".  The post was subsequently closed and reopened, then closed again and finally just reopened a 2nd time a short time ago.  I still firmly believe the post is not acceptable for SO, so I went to use my recently acquired close vote privilege and was greeted with the following messsage:    I specifically clicked close and not flag (and figuring I just clicked in error, I tried again and got the same message).  I do understand that, in the new closing system, flagging for closure is treated very much like a close vote (since it throws it to the close vote queue) except no vote is actually recorded.  My issue is why should by flag be counted as a close vote when I never actually voted to close.


In Python the code could be something like the following:  # 17 spaces have been allotted, this would pad 7 blank spaces to the left # of the string because the string itself is 10 characters long and   print 'Work Phone'.ljust(17)

Is there some easy way to pad Strings in Java?  Seems like something that should be in some StringUtil-like API, but I can't find anything that does this.


I have a table showing which roles recursively grant access to which resources within a database. For example:  The Default_Role grants access to the App_Role, the App_Role grants access to the Security_Role, and the Security_Role grants access to three tables (customers, sales, users). So a member of the Default_Role is granted all of these, but Default_Role is not granted access to the Sys_Role, and is not granted access to the System or Admin tables. CREATE TABLE SQLTest(      DBName     NVARCHAR(100) NULL     ,Privilege    NVARCHAR(100) NULL     ,PrivilegeType NVARCHAR(100) NULL     ,PrivilegeDetail NVARCHAR(100) NULL     ,TableName NVARCHAR(100) NULL )  INSERT INTO SQLTest VALUES  ('TSDB','Default_Role','Role','App_Role',NULL), ('TSDB','App_Role','Role','Security_Role',NULL), ('TSDB','Sys_Role','Role','Security_Role',NULL), ('TSDB','Security_Role','Table','Customers','Customers'), ('TSDB','Security_Role','Table','Sales','Sales'), ('TSDB','Security_Role','Table','Users','Users'), ('TSDB','Sys_Role','Table','System','System'), ('TSDB','Sys_Role','Table','Admin','Admin')  What is the best way to flatten this out so you can see all the access (roles and tables) granted to the Default_Role, without showing additional access not granted to the Default_Role? Like this:  Tried putting together this example, but doesn't work.

I have a table with a hierarchy ( with a recursive parentID column), for one record, I know how to get the last parent record, with the following code :  declare @Id integer  ;WITH CTE AS (     SELECT  a.[Id],             a.[ParentId]     FROM    [Area] a WITH (NOLOCK)     where a.[Id] = @Id       UNION ALL      SELECT  a.[Id],             a.[ParentId]     FROM [Area] a WITH (NOLOCK)     INNER JOIN CTE cte ON cte.[ParentId] = a.[Id] )  SELECT top 1 a.[Id] FROM CTE a WHERE a.ParentId is null   It works as long as I'm working with one id, here @Id.  But I can't find a way to do the same but for a list of Ids, without using cursors, as CTE seems to be OK only when y'oure working on one record.  Could someone point me at the right direction ?  Many thanks


Find the general solution $u(x,y)$ to $$x u_x + y u_y = 0$$   Attempted solution - The characteristic equation satisfy the ODE $dy/dx = y/x$. To solve the ODE, we separate variables: $dy/y = dx/x$; hence $\ln(y) = \ln(x)- C$, so that $$y = x \exp(-C)$$  I am a bit confused in finding the general solution for $u(x,y)$. I just want to know if I am on the right track or not. I haven't taken a formal ODE course but I have self-studied but not in a while. Any suggestions would be greatly appreciated.

Solve the equation $xU_x+yU_y=0$.   From Partial Differential Equations: An Introduction, 2nd Ed. (Strauss, pg. 10). There are no boundary conditions.  Solution: The PDE can be written $(x,y)\cdot\nabla U(x,y)=0$, implying that the vector $(x,y)$ is tangent to the PDE's characteristic equation. Then I can write $dy/dx=y/x$, and to solve this ODE,  $$\frac{dy}{dx}=\frac yx \\ \ln y=\ln x+c_1 \\ y=cx \\ y/x=c$$  Hence, the PDE is dependent on $c$ and I can write $U(x,y)=f(y/x)$ for some function $f$, solving the problem.  Question: Is this solution correct? The hint for the question (supplied by the professor) said I should use a substitution of variables, but this seems reasonably valid.


I am given a String name say String s in below code. This String contains a phrase i.e. one or more words separated by single spaces. This program computes and return the acronym of this phrase.  import java.math.*; import java.util.*; import static java.util.Arrays.*; import static java.lang.Math.*; public class Initials {   public String getInitials(String s) {      String r = "";     for(String t:s.split("\\s+")){       r += t.charAt(0);     }     return r;   }     void p(Object... o) {           System.out.println(deepToString(o));       }   }   Example: "john fitzgerald kennedy"  Returns: "jfk"

What regex pattern would need I to pass to  java.lang.String.split()  to split a String into an Array of substrings using all whitespace characters (' ', '\t', '\n', etc.) as delimiters?


How can I split a string on 2's, eg "string" would be split into groups of "st", "ri","ng". I check the doc, groupby from itertools seems to be what i need. However, is there a way to do it simply by not using itertools? thanks

I have a Python script which takes as input a list of integers, which I need to work with four integers at a time.  Unfortunately, I don't have control of the input, or I'd have it passed in as a list of four-element tuples.  Currently, I'm iterating over it this way: for i in range(0, len(ints), 4):     # dummy op for example code     foo += ints[i] * ints[i + 1] + ints[i + 2] * ints[i + 3]  It looks a lot like "C-think", though, which makes me suspect there's a more pythonic way of dealing with this situation.  The list is discarded after iterating, so it needn't be preserved.  Perhaps something like this would be better? while ints:     foo += ints[0] * ints[1] + ints[2] * ints[3]     ints[0:4] = []  Still doesn't quite "feel" right, though.  :-/ Related question:


Many of us will be familiar with , in which someone spins counterclockwise to slow down the rotation of the earth and make the night longer.  The mass of an individual human is not all that much compared to the earth, so the gesture is poetic but futile. On the other hand, the mass of forty 3,300 pound cars driving counterclockwise is quite a lot more considerable.  How much does an individual NASCAR race affect the rotation of the earth? How much time does an individual NASCAR race remove from (or add to) the length of a day on our planet?  Let's assume we're operating on the 's not-quite-oval outer track , with 200 laps of a 2.5 mile track made by forty cars weighing exactly 3,300 pounds each. The race lasts approximately three hours.

We walk or ride on our vehicles to our destinations daily. Does our movement have any effect on the rotation of the earth according to Newton's law? What will be the effect if we move all the peoples along with their vehicles at their maximum velocity in one line in one direction along the equator? How much effect will it make?


This is a little bit hard to explain, but situation when you really get into something. For example, you are watching a movie, and it feels so realistic and good that you "get into" it. Not just a movie, but basically any real life situation

Sometimes, when I watch a (real good) movie, I feel like the movie "sucks me into the screen". I feel that I am really inside the movie, really watching real persons acting in real situations. I do not really see what happens around me anymore, I get some kind of tunnel view and see only the screen. It's like being in John Malkovich's Head, just not seing the borders that are around me from that weird cave.  I wanted to know if there is a word for this kind of experience.  Also, I'd like to know if there is a word for "re-gaining" reality. After a few seconds or minutes in this weird state, I feel like my field of vision is growing larger and larger (just as if I was about to leave Malkovich) and then I'm "back in reality".   It's a hard to describe experience for me, not only because my mothertongue is not english but german, but also because, afaik, german lacks words for this, too. But when I have the english words, I believe, I may find the german ones as well.


I have made the box and the lid. I want to close the box with the lid. I have selected the edge and with the 3d cursor as pivot point im rotating. with the x axis i rotate i hit x twice also but its not working. Why its moving from the position. Any suggestion or help plz.

How do I create a hinged door that opens and closes in Blender? If I knew how to do this, then it would help me also create moving control surfaces on model aircraft, such as the rudder and horizontal stabilizers.


I am a British citizen eligible for the Visa Waiver Program. At Christmas, I will be flying from London Heathrow to Bogota, Colombia with a connection through the US in Dallas. As I understand it, I do not need a visa for my connection flight in Dallas.  On the return flight from Bogota to London Heathrow, I also have a connecting flight in Miami. The time period will be within 90 days of my previous transit.  Can I use the VWP to re-enter the USA for my connection, or will I need to apply for a visa?

I'm travelling on the ESTA visa waiver, I'm now in the States but would like to go to Costa Rica for a bit (say three weeks) then come back to the States. All will be within my 90 day limit.  Is that allowed?  (I have my onward ticket home.)


Folks, hope you could point me, what I missing out. I am new to programming and now solving problems for Project Euler. One of the tasks is to calculate the sum of even numbers of Fibonacci sequence. I wrote code which passed 4 of 5 test. Here it is:  //N is input (N<=4*10^16), let's find n by Binet's formula   double a = log10(sqrt (5) * N); double b = log10((1 + sqrt (5)) / 2); int n = (int) (a / b);   //Using same formula, we find every Fibonacci number till n for (int i = 1; i <= n; i++){   a = (1 + sqrt(5)) / 2;   long fiboNum = Math.round (Math.pow(a,i) / sqrt(5));   And here is my problem: when I run a test with big numbers, there is some rounding happening around F(71). By my code, F(71) is 308 061 521 170 130, according to WolphramAlpha calculations 308 061 521 170 129.  Because of this, final sum is wrong.  Also, while testing I printed out all numbers and recognize, that even numbers repeat every 3. But even if I simplify it to the small loop of sum every third number, still problem exist.  If I do not use Math.round, I am getting the wrong sequence...

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


I have written the code. to check the variable value if it GL then SQLGL should XDOAPPL, if AP then SQLAP should assign XDOAPPL variable. but it is giving me the error.  APPL=$1 x=AP y=GL echo "Value of x = $x and y = $y." a=SQLAP b=SQLGL  if [["$APPL" = "AP"]}; then XDOAPPL=${a} echo "AP XDOAPPL =$XDOAPPL" elif [["$APPL" = "GL"]]; then XDOAPPL=${b} echo "GL XDOAPPL =$XDOAPPL" else echo "Nothing to go" fi

I am using the below script to move two days back when script runs at starting two days of the year and also check first and second days of every month and move two days back. if [$month="01"] && [$day="01"]; then         date="$last_month/$yes_day/$last_year"         fulldate="$last_month/$yes_day/$last_year" else         if [$month="01"] && [$day="02"]; then                 date="$last_month/$yes_day/$last_year"                 fulldate="$last_month/$yes_day/$last_year"         else                 if [ $day = "01" ]; then                         date="$last_month/$yes_day/$year"                         fulldate="$year$last_month$yes_day"                 else                         if [ $day = "02" ]; then                                 date="$last_month/$yes_day/$year"                                 fulldate="$year$last_month$yes_day"                         else                                 date="$month/$yes_day/$year"                                 fulldate="$year$month$yes_day"                         fi                 fi         fi fi  But my bad am getting the below error message Etime_script.sh: line 19: [06=01]: command not found Etime_script.sh: line 24: [06=01]: command not found


Playing a DnD and our barbarian rushed into a room and stopped just through the doorway. Was surrounded by enemies. Dm said no allies behind barbarian would be able to get a attack because barbarian was blocking any attacks. The door size was just under a 5ft sq. Is this accurate? The map was tresendar manor area 10 north door .here is a picture of what I mean the orange is enemy blue is friendly

According to "Moving Around Other Creatures" (PH p. 191 / SRD p. 92):     You can move through a nonhostile creature’s space. [...] another creature’s space is difficult terrain for you.    Whether a creature is a friend or an enemy, you can’t willingly end your move in its space.   So it's possible for Alice to , the only penalty being that the ally's space counts as difficult terrain to enter.  If an enemy adjacent to the ally's space has readied a grapple against Alice and is successful, then Alice (unwillingly) ends her move in her ally's space.  Do allied characters in the same space suffer any negative effect?  Now the rest of Alice's allies do the same thing.   Is there a limit to the number of characters that can be stacked on a space?   What if Alice's ally was the one with the readied grapple?  Can you stack an ally on your space by readying a grapple to prevent them from leaving?


How to find $$\displaystyle \int_0^{\pi/2} \frac{1}{1+(\tan x)^e}dx $$Substitution seems not to work.

The problem: Find the value of $\displaystyle\int_0^{\pi/2} \frac{dx}{1+(\tan(x))^{\sqrt{2}}}$   I tried a few different substitutions and the closest I got to an okay looking integral is $$\int_0^\infty \frac{t^2 \, dt}{t^{1/\sqrt{2}}(1+\sqrt{t})},$$ which still looks scary. How do I approach this integral?


Text from selected line is not visible in dark theme mode.   However, text is visible in the normal standard-themed mode. I think it's Ubuntu's user interface error.

I am unable to see what I type in the Gedit editor using dark theme.  This is due to the default setting of highlighting the current line.


Badge notification from other sites (here, meta.SE) should use their resp. badge icons (here, the default), not the ones from the site I'm currently on.  Failing that (because, do we really want to load all the icons?), use the default icons in notifications.

The badges we earn are displayed over the achievements dialog (top of screen, leaderboards logo), but if we view them over another Stack Exchange site's page, we get shown THAT Stack Exchange site's logo of that badge.    For example, in the picture, I won a badge on Arqade, but when I open the dialog in Movies.SE, I see Movies.SE's (silver) badge, not Arqade's (silver) badge.  How it should look like:    It is nothing big or critical, just a small bug.


I'm a little confused, for the twentieth time, on what tensors are. I thought they were a generalization of matrices-but then they have special transformation rules. I'm looking for a concise definition of what a tensor is. In Griffiths, he says that an $n$ rank tensor transforms with $n$ components of a rotation matrix, why is this? I'll attach what I'm referencing.

I have a pretty good knowledge of physics, but couldn't deeply understand what a  is and why it is so fundamental.


Is there any simple way to find a polynomial with integer coefficients so that ($x=\sqrt{2} +\sqrt{3}$) is one of its roots? I know one way is to get rid of all the square roots in the equation to be left with rational numbers, but is there any other simple way?

I had an example in the book given as follows:        Find the minimal polynomial of $\sqrt{2}+\sqrt{3}$ over $\mathbb Q$ .       Solution:  $~~~~~$$(\sqrt{2}+\sqrt{3})^2=5+2 \sqrt6$      $(\sqrt{2}+\sqrt{3})^4=49+20 \sqrt6$       Then $(\sqrt{2}+\sqrt{3})^4-10(\sqrt{2}+\sqrt{3})^2+1=0.$       Thus $a=\sqrt{2}+\sqrt{3}$ satisfies $f(x)=x^4-10x^2+1$ over $\mathbb Q$.       Let $p(x)$ be the minimal polynomial of $\sqrt{2}+\sqrt{3}$ over $\mathbb Q$.Then $(\sqrt{2}-\sqrt{3}),(-\sqrt{2}+\sqrt{3}),(-\sqrt{2}-\sqrt{3})$ are also roots of $p(x).$   So degree of $p(x)$ is atleast $4$.      But $f(a)=0 $ and $f(x) \in \mathbb Q[x] \implies p(x)$ divides $f(x)$ .      So $f(x)$ is minimal polynomial of $\sqrt{2}+\sqrt{3}.$   But I can't get the step  how are $(\sqrt{2}-\sqrt{3}),(-\sqrt{2}+\sqrt{3}),(-\sqrt{2}-\sqrt{3})$ also roots of $p(x).$   Kindly help with this.


We have a matrix $A$ of order $m$ by $n$ and a matrix $B$ of order $n$ by $m$ where entries are from real numbers. We are given that $AB =I$ and we need to check whether $BA =I$ or not. If we have square matrices then it is true but here are rectangular matrices. I know that it doesn't hold true for rectangular matrices and I am trying hard to find some counter example but unable to find such matrix. I want to learn about how to construct  matrices as counter examples in linear algebra as in this case. Thanks

Are there matrices such that $AB=I$ and $BA \neq I$ ?   $A$ and $B$ are square matrices


I have a list of strings that include some regular expressions-like strings that define ALL possible matches to form new strings. Example:  Source  Id[0-1][2-3]_Pos[1-3] foo01_bar[A-C]   Is there any way in Python I can loop trough all possibilities and create new strings from it? So, the example above shall deliver:  Target  Id02_Pos1 Id02_Pos2 Id02_Pos3 Id03_Pos1 Id03_Pos2 Id03_Pos3 Id12_Pos1 Id12_Pos2 Id12_Pos3 Id13_Pos1 Id13_Pos2 Id13_Pos3 foo01_barA foo01_barB foo01_barC   Any hints are welcomed.  Update:  A working example of the answer can be found here:

I want to reverse a regular expression. I.e. given a regular expression, I want to produce any string that will match that regex.  I know how to do this from a theoretical computer science background using a finite state machine, but I just want to know if someone has already written a library to do this. :)  I'm using Python, so I'd like a Python library.  To reiterate, I only want one string that will match the regex. Things like "." or ".*" would make an infinite amount of strings match the regex, but I don't care about all options.  I'm willing for this library to only work on a certain subset of regex.


I have a form that needs to accept special font characters and write them to the database table. I believe the encoding is set correctly at the page/form level but when the field is written to the database the characters get changed to some other encoding. Other SO answers seem to indicate setting encoding to UTF-8 is the answer, which i've done.  Now, if I copy paste the characters below, direct to the database table, it holds them just fine as shown. Its only when I write it to the table from the form or when i retrieve it for display in web page.  Example characters:   ⓄⒼקร  The web page is set as: <meta charset="utf-8">  The form tag includes attribute: accept-charset="UTF-8"  Php just before the INSERT has: $_POST['tag']=utf8_encode($_POST['tag']);  I have not had to write/encode those types of font/special characters before, so what am i doing wrong here?

I'm setting up a new server and want to support UTF-8 fully in my web application. I have tried this in the past on existing servers and always seem to end up having to fall back to ISO-8859-1.  Where exactly do I need to set the encoding/charsets? I'm aware that I need to configure Apache, MySQL, and PHP to do this — is there some standard checklist I can follow, or perhaps troubleshoot where the mismatches occur?  This is for a new Linux server, running MySQL 5, PHP, 5 and Apache 2.


I want to escape all the special characters in string. Have used the below code.   public static void main(String[] args) { // TODO Auto-generated method               String search = "Helo world!@#$%^&*()";               String regEx = "([^a-zA-Z0-9])";               Pattern escape = Pattern.compile(regEx);               String escapeChar = "\\\\$1";               String value = escape.matcher(search).replaceAll(escapeChar);               System.out.println(value);        }   And i'm getting the below output which is not something have wanted.  output: Helo world\!\@\#\$\%\^\&\*\(\)\  Can someone please help me to correct here.

Does Java have a built-in way to escape arbitrary text so that it can be included in a regular expression? For example, if my users enter "$5", I'd like to match that exactly rather than a "5" after the end of input.


I understand that as your velocity approaches the speed of light, the amount of energy required approaches infinity.   So, hypothetically, you are in a space craft travelling just 3mph below the speed of the light. If you attempted to run the direction the craft is travelling, would you not be able to move? Or is there some special relativistic effect that comes in to play?

Let's say I fire a bus through space at (almost) the speed of light in vacuum. If I'm inside the bus (sitting on the back seat) and I run up the aisle of the bus toward the front, does that mean I'm traveling faster than the speed of light? (Relative to Earth that I just took off from.)


My setting under LyX "Document" command:  language encoding--unicode utf-8;  output--default  A minimal example:   type "coefficient" and generate PDF, then search it in PDF  result: not showing up  I tried "tariff" and other words containing "ff", still get  the same problem.  Update on 9th Nov 2016   I can confirm that the LyX solution offered to the question to which I have duplicated solves my problem. So just paste the following into the preamble:    \usepackage{cmap}   \usepackage[T2A]{fontenc}

One frequent aspect of pdflatex output that could be improved is to what extent one can select text output from the generated pdf-file and copy-and-paste it. This is essentially an issue of having the right output encoding. There are at least two important aspects to this:   In the ideal case, Unicode would be the output encoding. Ligature glyphs (such as ﬁ) are ideally de-ligated in the output (here: "fi").   It seems that output encodings are specified through the fontenc package. What is the range of possible output encodings, and most importantly: Is there a way to specify a Unicode output encoding and one that deals with ligatures in the intended way?  (Note: It is important to distinguish output from input encodings. How to use different input encodings in LaTeX has been documented widely. My understanding is that this is best handled by the inputenx package, as it supersedes the inputenc package.)    Quick guide to the solutions: The information in the answers and answer threads is a bit distributed, so here the short summary: one approach is to use \input glyphtounicode together with \pdfgentounicode=1; the other approach is to use cmap/mmap.  Addendum: Sometimes one will need to load the package accsupp and enclose one's macro definition in \BeginAccSupp{method=hex,unicode,ActualText=<codepoint>}[...]\EndAccSupp{} to generate a specific code point. See the caveat about non-BMP code points  and the fix (starting from accsupp version v0.4, 2012/11/18) , which provides the new unichar package option.


It is well known that QM and GR are deemed incompatible due to a discrepancy in some calculations which I have read can differ by large magnitudes. What are these calculations to which people are referring i.e. what equations/results?

It is well known that quantum mechanics and (general) relativity do not fit well. I am wondering whether it is possible to make a list of contradictions or problems between them?  E.g. relativity theory uses a space-time continuum, while quantum theory uses discrete states.  I am not merely looking for a solution or rebuttal of such opposites, more for a survey of the field out of interest.


I'm trying to resize a rectangular cubiod, currently 5 meters on it's longest sides and 2 meters on it's shortest sides (as shown in the diagram) I'd like a method that allows me to just set a new length of one edge that proportionally sets the length of the rest of the edges in the cuboid.    So for example: I'd like to be able to type in a new length for one of it's 5 meter edges and make it 2.5 meters. After I do so I need the rest of the edges all to shrink by a half.  The result of this example will make the 4 of the edges 2.5 meters long and the remaining 8 edges 1 meter long.

I modeled a man and would like to scale him down to be exactly 6' tall (Z dimension), however I cannot find a way to do that. I know I can go to front ortho view and and use the normal scale S  key to scale it, however that requires some pretty specific fine tuning in order to get it to the right dimensions.  I'd like to be able to essentially type "6" into the Z dimension (don't worry I have it setup in imperial) and have it scale the X and Y dimensions proportionally.


I'm having trouble finding the length of an pointer array. Let's say I have:  char array[40] = "hello"; // size 40 int length =  sizeof array / sizeof array[0]; // no problem returns 40   //How do I get the length of the array with only a pointer to the first element in that array?   char* pchar = array;   //if  std::strlen(pchar); // this returns the length of 5... i want length 40   //if  int count = 0; while(true) {   if(*(pchar + count) == '\0') // returns 5...     break;    count++; }   How do I get it to return length 40 just from a pointer to the first element in the array? I found that I can do this.  int count = 0;     while(true)     {       if(*(pchar + count) == '\0' && *(pchar + count + 1) != '\0')               break;         count++;     }   This returns 39, this is good but I feel like this can be buggy in some situations.

First off, here is some code:  int main()  {     int days[] = {1,2,3,4,5};     int *ptr = days;     printf("%u\n", sizeof(days));     printf("%u\n", sizeof(ptr));      return 0; }   Is there a way to find out the size of the array that ptr is pointing to (instead of just giving its size, which is four bytes on a 32-bit system)?


Prove that, given any polynomial $p(x)$, the value of   $\lim_{x \rightarrow \infty}\dfrac{p(x)}{e^x}$ is independent of polynomial $p(x)$.  The given limit is in $\frac{\infty}{\infty}$ form. If L'Hopitals rule is applied, $\frac{p(x)}{e^x}$ becomes $\infty \cdot 0$. [$\infty$ for $p'(x)$, and $0$ for $\frac{1}{e^\infty}$.  But what is value of $\infty \cdot 0$? I'm sure I must be making a mistake somewhere.  Please help me to solve this problem.  Thank you.

In other words, how to prove:  For all real constants $a$ and $b$ such that $a > 1$, $$\lim_{n\to\infty}\frac{n^b}{a^n} = 0$$  I know the definition of limit but I feel that it's not enough to prove this theorem.


In Landau-Lifschitz, following expansion is given,  We have, $$L(v'^2)~=~L(v^2+2\textbf{v}\cdot\epsilon+\epsilon ^2)$$ expanding this in powers of $\epsilon$ and neglecting powers of higher order, $$L(v'^2)~\approx~L(v^2)+\frac{\partial L}{\partial (v^2)}2\textbf{v}\cdot\epsilon$$  $L$ is Lagrangian. and $\textbf{v}'=\textbf{v}+\epsilon$. I am unable to follow what expansion this exactly is. It does not look like Taylor expansion.

I was reading a bit of Landau and Lifshitz's Mechanics the other day and ran into the following part, where the authors are about to derive the kinetic energy of a free particle. They use the fact that the Lagrangian of this particle must be the same (or at most, differ by the total time derivative of a function of co-ordinates and time) in different inertial frames.     We have $L'=L(v'^2)=L(v^2+2\mathbf{v}\cdot\boldsymbol{\epsilon}+\boldsymbol{\epsilon}^2)$. Expanding this expression in powers of $\boldsymbol{\epsilon}$ and neglecting terms above the first order, we obtain    $$L(v'^2)=L(v^2)+\frac{\partial L(v^2)}{\partial (v^2)}2\mathbf{v}\cdot\boldsymbol{\epsilon}.$$   I think I'm ok with all the physics in this section. What I don't get is just the part I quoted above (so maybe this post is better suited for the math site, but since this is book is so physics-y I thought I'd post it here). My math is pretty rusty, so I'm not really sure- how do the authors expand the function to arrive at the above expression? It reminds me a bit of a Taylor expansion, but not very much. What's the process used to arrive at it?


I am trying to invoke a javascript function from some HTML code inserted by some other javascript code (see below).  $(".leave-a-note").click(function() {             var id = $(this).closest('li').attr('id');             $('#' + id).children('.write-comment-space').html("Save Cancel");});   When I try to call a function from the ".save-comment" url nothing happens.  $(".save-comment").click(function() {             console.log("test");         });   However, if I leave the ".save-comment" URL directly in my HTML the function works. What am I doing wrong?

I have a bit of code where I am looping through all the select boxes on a page and binding a .hover event to them to do a bit of twiddling with their width on mouse on/off.  This happens on page ready and works just fine.  The problem I have is that any select boxes I add via Ajax or DOM after the initial loop won't have the event bound.  I have found this plugin (), but before I add another 5k to my pages with a plugin, I want to see if anyone knows a way to do this, either with jQuery directly or by another option.


Find: $$ \lim _{n→∞}S_n= \log\cos\bigg( \frac x 2\bigg)+\log\cos\bigg(\frac x 4\bigg) +\dots+ \log\cos\bigg( \frac x {2^n}\bigg)$$ Writing as : $$S_n=\log\Bigl(\cos\frac x 2\cdot\cos\frac x 4\dotsm\cos\frac x {2^n}\Bigr)$$ makes it more complicated. There must be an easier way.

Show that: $$(1)\sum_{n=1}^\infty\ln\left(\cos \frac{x}{2^n}\right)=\ln\frac{\sin x}x$$ $$(2). \sum_{n=1}^\infty\frac1{2^n}\tan \frac{x}{2^n}=\frac1x-\cot x$$ Thank you in advance. NOTE: The origial problem (1) I stated is $\sum_{n=1}^\infty\lim_{x\to \infty}\left(\cos \frac{x}{2^n}\right)=\ln\frac{\sin x}x$, which is a mistake as noted by the comments below.


I have several accounts on StackExchange, but I would like keep my programming and IT accounts separated from the others.  Is there a way to create two personas ?

This feature request is inspired by the question on Programmers.SE on .   Stack Overflow is a site aimed at professional programmers, and it is used by some employers and some employees to examine or showcase the candidates abilities. I don't see any problem with that, but there is one aspect I'm a bit concerned about. Certain SE sites are far more private than the professional sites like SO. Anyone that participates in Christianity, Judaism, Islam or Biblical Hermeneutics is likely giving out a significant amount of information about their personal belief or world view to anyone who can connect the user name to the actual person. Another example would be controversial topics on Skeptics or Politics; not everyone would like to give their employer access to that kind of information.  The fundamental problem is that the SE platform does not allow for any separation inside one account. Of course one could create separate accounts for private and professional topics, but that requires a significant amount of clairvoyance and a rather annoying user experience juggling separate browsers to log into different accounts at once. An additional problem is that SE has automatic user merge features that can be triggered by logging into two accounts in the same session. I'm not sure how they work exactly, but I suspect that having your two accounts accidentally merged is a real danger if you are not careful.  There should be a mechanism to hide the connection between SE accounts, without having to use separate OpenIDs. For example, if I would like to use my SO account in job applications, I should be able to separate it from all my other accounts. The separation would only be for the publicly accessible part, moderators could still be allowed to see the connection between accounts. And behind the scenes it would just work as it is now, just without any links between the accounts.   The aspects that would need to be changed that I can think of are   the accounts tab in the user profile, that shouldn't show any connections for separated profiles copying the user profile to other sites should not work for separated profiles the network profile should not show the connections between separated profiles Area 51 should also not show the profile connections   This separation would not have to be bulletproof, but it should prevent users googling a specific person to make connections the user does not want to make public.


In unbiased data, RMSE and standard deviation is same?    Let $x_{i}$ be your true value for the $i^{th}$ data point and $\hat{x}_{i}$ the estimated value. If we assume that the differences between the estimated and true values have    mean zero (i.e. the $\hat{x}_{i}$ are distributed around $x_{i}$) (Unbiasd) follow a Normal distribution and all have the same standard deviation $\sigma$   in short:  $$\hat{x}_{i}-x_{i} \sim \mathcal{N}\left(0,\sigma^{2}\right),$$  Then, RMSE between $x_{i}$ and $\hat{x}_{i}$ is  $$ \text{RMSE}^2 =  \frac{1}{n}\sum_{i=1}^{n}(x_i-\hat{x}_i)^2\,, $$  Standard deviation of $x_{i}$ - $\hat{x}_{i}$ is  $$ \text{SD}^2 =  \frac{1}{n}\sum_{i=1}^{n}((x_i-\hat{x}_i)-mean)^2 = \frac{1}{n}\sum_{i=1}^{n}(x_i-\hat{x}_i)^2\ $$  So i think RMSE and SD is same in unbiased data. However, i can not be sure and find any reference.

RMSE (Root mean square error) and SD (Standard deviation) have similar formulas.   says     The only difference is that you divide by  $n$ and not  $n−1$ since   you are not subtracting the sample mean here. The RMSE would then   correspond to  $\sigma$ . Therefore, the population RMSE is  $\sigma$   and you want a CI for that.   So I want to know whether RMSE and SD are the same. Also, I want reference about it.


Find the limit $$\lim _{n \to \infty}(n!)^{{\frac{1}{n^2}}}$$  I have tried it using Stirling's approximation and then using L'Hospital's Rule and get answer $1$  Is there any other easy method to find this limit ?  Any hint. Thanks in advance.

Currently learning how to use the squeeze theorem to determine a limit.  The exercise I'm working on is finding the limit of:   $\lim \ (n!)^{\frac{1}{n^2}}$  So far what I have is:   $\lim \ (n!)^{\frac{1}{n^2}} = \lim \ e^{\frac{1}{n^2}ln(n!)}$  So I know that $1 = e^0 \leq \lim \ e^{\frac{1}{n^2}\ln(n!)}$   But I need help determining what should be on the other side of the equality.   I'm trying to look at $\frac{\ln(n!)}{n^2}$ but I'm having trouble determining its limit as it approaches infinity.  Does $n^2$ increase faster than $\ln(n!)$? Could someone show me why which one increases faster?  If so the inequality would just be:  $1 = e^0 \leq \lim \ e^{\frac{1}{n^2}\ln(n!)} \leq e^0 = 1$   So our limit would just be $1$, right?  Thanks in advance.


I want to find limit of the sequence $x_{n+1}=x_n(2-ax_n)$ but I don't have the start point. Is it possible to find it's limit when $n\to \infty$?

Let $a>0$ and $x_0\in I=\left (\frac{1}{2a}, \frac{3}{2a}\right )$. Show that the sequence $(x_n)$, $n\geq 0$, $$x_{n+1}=x_n(2-ax_n), \quad n \geq 0$$ converges. Which is the limit? Hint: Consider $\phi (x)=x(2-ax)$ and show that $\phi (I)\subset \left [\frac{3}{4a}, \frac{1}{a}\right ]$.   So that I understand  that correctly, with the hint we want to show that $\phi(x)$ is bounded and monotonic, which means that the sequence converges? We have the following: \begin{align*}\frac{1}{2a}<x< \frac{3}{2a} &\Rightarrow a\cdot \frac{1}{2a}<ax<a\cdot  \frac{3}{2a}\Rightarrow \frac{1}{2}<ax< \frac{3}{2} \Rightarrow -\frac{3}{2}<-ax< -\frac{1}{2}\\ & \Rightarrow 2-\frac{3}{2}<2-ax< 2-\frac{1}{2}\Rightarrow \frac{1}{2}<2-ax< \frac{3}{2} \\ & \Rightarrow x\cdot \frac{1}{2}<x(2-ax)< x\cdot \frac{3}{2}\\ & \Rightarrow \frac{1}{2a}\cdot \frac{1}{2}<x\cdot \frac{1}{2}<x(2-ax)< x\cdot \frac{3}{2}< \frac{3}{2a}\cdot \frac{3}{2}\\ & \Rightarrow \frac{1}{4a}<x(2-ax)< \frac{9}{4a}\end{align*} That is not the interval that we want to get. Do wehave to do that maybe using derivatives?


I am trying to join a shp and dbf file using the PyQGIS API. The code I'll use is below:  from PyQt4.QtCore import * vector1 = QgsVectorLayer("path to dbf file", "test1", "ogr") id1 = vector1.id() print id1 vector2 = QgsVectorLayer("path to shapefile", "test2", "ogr") id2 = vector2.id() print id2 QgsMapLayerRegistry.instance().addMapLayer(vector1) QgsMapLayerRegistry.instance().addMapLayer(vector2) info = QgsVectorJoinInfo() info.joinFieldIndex = QgsMapLayerRegistry.instance().mapLayer(id1).fieldNameIndex("Id1Column0") # Returns 0 as expected info.joinFieldName = QString(u"Id1Column0") info.joinLayerId = QgsMapLayerRegistry.instance().mapLayer(id1).id() info.targetFieldIndex = QgsMapLayerRegistry.instance().mapLayer(id2).fieldNameIndex("Id2Column0")  # Returns 0 as expected info.targetFieldName = QString(u"Id2Column0") info.memoryCache = True print info.joinFieldIndex #All the following show the correct values print info.joinFieldName print info.joinLayerId print info.targetFieldIndex print info.targetFieldName print info.memoryCache QgsMapLayerRegistry.instance().mapLayer(id2).addJoin(info)   Querying for the respective field names using QgsVectorLayer.attributeDisplayName(0) yields the respective column names as expected.  Yet when I look in the GUI properties, while the join layer is set correctly, the join field is something different and the target field is empty.  Could anyone shed some light on what goes wrong?

The following is currently unsuccessful at fulfilling a table field join to a point shapefile in Qgis. All instances of the join object will print the proper values, and no error is flagged when processing - but the target layer does not exhibit any effect.  Something missing?      Heads = QgsVectorLayer(headCSV, 'Heads', 'ogr')     QgsMapLayerRegistry.instance().addMapLayer(Heads)     self.iface.legendInterface().setLayerVisible(Heads,False)     grid = ftools_utils.getMapLayerByName(unicode('Grid'))     joinObject = QgsVectorJoinInfo()     joinObject.targetFieldName = str('ID')     joinObject.joinLayerID = Heads.id()     joinObject.joinFieldName = str('cellID')     grid.addJoin(joinObject)     grid.reload()   UPDATE:  The following returns 'None'.  I expect this is actually supposed to return the field names to be joined?  (e.g. - a clue to the mistake)      print joinObject.joinFieldNamesSubset()   FURTHER UPDATE:  Added the following, and now the previous update command returns the accurate fields to be joined - yet the destination layer does not show 'joined' fields...      joinObject.setJoinFieldNamesSubset(['someFieldName'])


I want to register and enqueue RequireJS before jQuery so that jQuery finds out RequireJS and register itself as the AMD module. How to achieve this?

I'm fixing a wordpress plugin that uses a 1.0.0 version of jquery. The jquery version automatically included in wordpress is 1.11.0. In a test site, the plugin is dependent on the 1.0.0 jquery and doesn't work on the latest version.  However, it works on a test site because the plugin is loaded BEFORE the wp-includes/js/jquery/jquery.js and it uses it's own jquery library version before the script is overwritten by the latest jquery version. It doesn't produce any errors in the console.  But in the production site, it loads all the plugins after the wp-includes/js/jquery/jquery.js So, how do I force the plugin to load, before wordpress loads the wp-includes/js/jquery/jquery.js file?  This is the code in the plugin:  add_action('init', 'myplugin_init');  function myplugin_init() { wp_enqueue_script('jquery.min', plugins_url(MYPLUGIN_FOLDER . '/js/jquery.min.js'), array(), '1.0.0', false); wp_enqueue_script('highcharts', plugins_url(MYPLUGIN_FOLDER . '/js/highcharts.js'), array(), '1.0.0', false); wp_enqueue_script('exporting', plugins_url(MYPLUGIN_FOLDER . '/js/exporting.js'), array(), '1.0.0', false); }   I already tried, for testing purposes, to force the enqueue of plugin scripts right before wp_head(); but it still loads the plugin files AFTER the wp-includes/js/jquery/jquery.js.   <?php     wp_enqueue_script('jquery.min', plugins_url(MYPLUGIN_FOLDER . '/js/jquery.min.js'), array(), '1.0.0', false);     wp_enqueue_script('highcharts', plugins_url(MYPLUGIN_FOLDER . '/js/highcharts.js'), array(), '1.0.0', false);     wp_enqueue_script('exporting', plugins_url(MYPLUGIN_FOLDER . '/js/exporting.js'), array(), '1.0.0', false);  wp_head();     ?>   Any help is much appreciated. Thanks.


Is there a way to typeset this in LYX without using ERT?  If not, how do I code it in Lyx?

I have a matrix enclosed in brackets [ ] (or (), or {}, or |'s, or ||'s):   - a b c d - | e f g h | | i j k l | - m n o p -   which I want to label like so:             R          |---|   -- - a b c d -  A|  | e f g h |   -- | i j k l |      - m n o p -     Where the dashes by the labels are meant to be giant {'s as in this picture:  How can I do this?    Although two answers have been provided that work to an extent, I've added a bounty because I'd like to see if anyone has, or can come up with, a neat, robust solution.


I am going to make the case that $6÷2(1+2) = 1$. Many people often quote the PEMDAS rule and get the answer $9$ but look at this way: $$ 6 \div 2(1+2)= \frac{6}{2(1+2)}$$ Algebraically, we can treat the division operator(obelus or solidus) as a fraction. Everything to the left of the operator is in the numerator and everything to the right is in the denominator. So then you apply the usual PEMDAS rule to simplify the denominator: $$\frac{6}{2(1+2)}=\frac{6}{2(3)}=\frac{6}{2\ast 3}=\frac{6}{6}=1$$ A lot of engineering types just work left to right and end up with $9$ because they don't appreciate how division lacks 2 properties of multiplication: commutativity and distributivity. But if there is a good mathematical reason why I'm wrong, I'd like to hear it!

There is a huge debate on the internet on the value of $48\div2(9+3)$. I believe the answer $2$ as I believe it is part of the bracket operation in BEDMAS.  yields the same answer. I also believe that if $48\div2\times(9+3)$ was asked it would be $288$ which Mathway agrees with as well. However,  says it is $288$ either way. A friend of mine (who is better at math) told me that there is no such thing as 'implicit multiplication', only shorthand so that is in fact done after the division (going left to right, not necessarily because division occurs before multiplication. But he didn't explicitly give a reason) What is the answer and why?


Given $a, b \in \mathbb{R}$, prove that   $$\frac{|a + b|}{1 + |a + b|} \le \frac{|a|}{1 + |a|} + \frac{|b|}{1+|b|}$$  When does equality hold?  The only useful thing I could get (using the triangle inequality) is:  $$\begin{align}1 + \left|\left(a + \frac{ab}{2}\right) + \left(b - \frac{ab}{2}\right)\right| &\le 1 + \left|a + \frac{ab}{2}\right| + \left|b - \frac{ab}{2}\right|\\ &\le 1 + |a| + |b| + |ab|\\ &=(1 + |a|)(1 + |b|)\end{align}$$  But it seems to be inapplicable! Any ideas?

Prove that for every $a, b\in R\setminus\{0\}$ is correct this inequality:  $$\frac{|a+b|}{1+|a+b|}<\frac{|a|}{1+|a|}+\frac{|b|}{1+|b|}.$$


Is the second sentence correct English? What is the grammatical role and meaning of "who knows how many jobs"?     ...Traditional cars happen to be human sized to transport humans but tiny autos can work in wear houses [sic] and gigantic autos can work in pit mines. Moving stuff around is who knows how many jobs but the transportation industry employs about three million people.

The phrase "who knows what" and other variations of it refer to unknown things, for a lack of a better descriptor. When writing a story in the past tense, would this phrase change?  His pocket contained a key ring, spare coins, folded-up slips of paper, and who knows what else. Compared to: His pocket contained a key ring, spare coins, folded-up slips of paper, who knew what else.  Is using the present tense considered inconsistent? Is one preferable to the other?


Nowadays I'm working on optimization of code and I see a lot of code in which we create a new variable and then initialize as seen in the first loop in an example code below:  BigInteger limit = new BigInteger("10000"); long l = System.currentTimeMillis(); for (BigInteger i = BigInteger.ONE; i.compareTo(limit) < 0; i = i.add(BigInteger.ONE)) {     BigDecimal temp = new BigDecimal(0); } long l1 = System.currentTimeMillis();  //After modification BigDecimal temp1; for (BigInteger i = BigInteger.ONE; i.compareTo(limit) < 0; i = i.add(BigInteger.ONE)) {     temp1 = new BigDecimal(0); } long l2 = System.currentTimeMillis(); System.out.println("1st loop time: "+(l1-l)/1000.0); System.out.println("2nd loop time: "+(l2-l1)/1000.0);   And then in second, I put some modification as shown. My question is both looks familiar, only variable scope is different but the first loop takes much time.   Is this happening just due to an allocation of memory? Or it's a good approach to declare a variable outside for loop but why?

How do you write (and run) a correct micro-benchmark in Java?  I'm looking for some code samples and comments illustrating various things to think about.  Example: Should the benchmark measure time/iteration or iterations/time, and why?  Related:


I am trying to fix an error that says "Object reference not set to an instance of an object". The purpose of this script is to spawn a prefab that follows the mouse when you click a UI button. The script works fine despite showing the error(yellow triangle), but when I add a line referencing another scripts array(marked >>>) in the HandleNewObjectHotkey function) the game refuses to run(red stop sign). For context, this script shown is attached to an empty game object. The button retrieves the script from this game object, and specifically uses the HandleNewObjectHotkey Function. I would like to know how I can fix the placeable Object Prefab from producing an error, or a suggestion to bypass it. Things I've tried: making placeableObject prefab public, removing serialize field, attaching the prefab to the script itself in assets, change everything from private to public. [SerializeField] private GameObject placeableObjectPrefab;           // shows error here in visual studio, suggesting to make read-only (doesn't fix the problem)   private GameObject currentPlaceableObject; private float mouseWheelRotation; public int objectsSpawned;  // -------------- Money stuff  private float money; private MoneyDisplay moneyDisplay; private ObjectCostDisplay objectcostDisplay;  private void Awake() {     moneyDisplay = GameObject.FindObjectOfType<MoneyDisplay>();     objectcostDisplay = GameObject.FindObjectOfType<ObjectCostDisplay>();  }  private void Update() {      if (currentPlaceableObject != null)     {         MoveCurrentPlaceableObjectToMouse();         RotateFromMouseWheel();         ReleaseIfClicked();     } }  private void ReleaseIfClicked() {     if (Input.GetMouseButtonDown(0))     {         currentPlaceableObject = null;     } }  private void RotateFromMouseWheel() {     mouseWheelRotation += Input.mouseScrollDelta.y;     currentPlaceableObject.transform.Rotate(Vector3.up, mouseWheelRotation * 10f); }  private void MoveCurrentPlaceableObjectToMouse() {     Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);      RaycastHit hitInfo;     if (Physics.Raycast(ray, out hitInfo))     {         currentPlaceableObject.transform.position = hitInfo.point;         currentPlaceableObject.transform.rotation = Quaternion.FromToRotation(Vector3.up, hitInfo.normal);     } }  public void HandleNewObjectHotkey()                                             //error says issue is in this function.  {     money = objectcostDisplay.CostsList[0];   // >>>   adding this is what causes unity to refuse to run the game due to error mentioned. Deleting this lets game run, error still present.       if (objectsSpawned <= 3 && money <= moneyDisplay.currentMoney)                   {         if (currentPlaceableObject == null )         {             currentPlaceableObject = Instantiate(placeableObjectPrefab);                     objectsSpawned++;             moneyDisplay.UpdateMoney(money);          }     }      if(objectsSpawned == 3 && money <= moneyDisplay.currentMoney)     {         Debug.Log("You have reached the limit for this item!");      }      if(objectsSpawned <= 3 && money > moneyDisplay.currentMoney)     {         Debug.Log("You don't have enough money for this!");      } }  }

Since many users are facing the NullReferenceException: Object reference not set to an instance of an object error in Unity, I thought that it would be a good idea to gather from multiple source some explanation and ways to fix this error.  Symptoms I am getting the error below appearing in my console, what does it mean and how do I fix it?  NullReferenceException: Object reference not set to an instance of an object


I have a script that uses wget and saves the output to a file with a name of an incrementing variable.  Counter.sh:  number=1 for i in $(cat file) do wget $i -S -O $number.html 2>&1 ((number++))  sleep 1    echo 'done'  done   I can run the script from the command line and it operates perfectly. However when I execute it from within another script:  Script 2:  ./counter.sh   I receive the following output:  scripts/counter.sh: 5: scripts/counter.sh: number++: not found done scripts/counter.sh: 5: scripts/counter.sh: number++: not found done scripts/counter.sh: 5: scripts/counter.sh: number++: not found done scripts/counter.sh: 5: scripts/counter.sh: number++: not found done   For some reason the counter ++ is not working when executed from within another script. How can I fix this?

Suppose the default shell for my account is zsh but I opened the terminal and fired up bash and executed a script named prac002.sh, which shell interpreter would be used to execute the script, zsh or bash? Consider the following example:  papagolf@Sierra ~/My Files/My Programs/Learning/Shell % sudo cat /etc/passwd | grep papagolf [sudo] password for papagolf:  papagolf:x:1000:1001:Rex,,,:/home/papagolf:/usr/bin/zsh # papagolf's default shell is zsh  papagolf@Sierra ~/My Files/My Programs/Learning/Shell % bash # I fired up bash. (See that '%' prompt in zsh changes to '$' prompt, indicating bash.)  papagolf@Sierra:~/My Files/My Programs/Learning/Shell$ ./prac002.sh  Enter username : Rex Rex # Which interpreter did it just use?   **EDIT : ** Here's the content of the script  papagolf@Sierra ~/My Files/My Programs/Learning/Shell % cat ./prac002.sh  read -p "Enter username : " uname echo $uname


I have an <img> that I want to have alternate between 4 pictures using javascript. How can I go about doing this in a way that will still allow me to click on other parts of the page while the images are changing. Do I need a thread of some sort?

Is there some way to do multi-threading in JavaScript?


I'm reading from the "Modern Physics" textbook by Randy Harris.  I'm Chapter 8 on Spin and Atomic Physics, and the book has just introduced how to solve for the wave function of 2 particles in a box. The two particles are identical, and can have different quantum numbers. They do not interact.  From there they go on to explain why we use symmetric and antisymmetric wave functions, because we can't be able to tell which particle is which from the probability density equation, which we ARE able to without using the symmetrical requirement if the two particles have different quantum numbers.  My question is, why can't we distinguish between two particles with different quantum numbers? Doesn't that mean they have different energies, and as such have different wave forms and so appear in different places? The problem used in the book is that the two particles are in a box. But because of their different quantum numbers, one of the two particles can't be found in the middle of the box, while the other can. This should never be the case apparently, so they introduce the symmetrical requirement.  As stated above, I'm confused as to why we're not supposed to be able to tell two particles with different quantum numbers apart.  Thanks for your time.

I've been going through Shankar's Principles of Quantum Mechanics. In the section of the system of identical particles, he uses an example of billiards to illustrate the difference between identical particles in classical vs. quantum mechanics. He argues that in classical mechanics, we can track the history of a particle (a billiard ball) to distinguish it from another particle with no intrinsic differences. In quantum mechanics, however, he argues since continual observation is not possible, we can't use the same method to distinguish identical particles. A potential counter-example I thought was: suppose we have two non-interacting particles in the same square well. And at the end of some measurement, we find that one particle 1 is in a stationary state $\psi_1$, and particle 2 in $\psi_2$. We measure the system again after some time $t$, then we know whichever particle that's in $\psi_1$ must be particle 1 from the previous measurement. And the same goes for particle 2. Thus we can distinguish the two "identical" particles. What conceptual mistakes am I making here?


This is my working  $p^2-q^2=(p+q)(p-q)$   As both the integers on right hand side are even .It is divisible by 4.  Primes are of form either $3k+1$ or $3k+2$ .we get 3 possible cases for for $p$ and $ q$ After substituting them we notice that it is also divisible by 3. It is divisible by both 4 and 3. Therefore it is also divisible by 12.But how to show that it is divisible by 24

Suppose that $5\leq q\leq p$ are both prime. Prove that $24|(p^2-q^2)$.   This is what I got so far. I figured that since $p,q$ are bigger than $5$, there are only odd primes for this conjecture. Then I can rename $p=2m+1,q=2n+1,m,n∈Z$.  We want to show $(p^2-q^2 )=24k,k∈Z$. By substituting $2m+1$ for $p$ and $2n+1$ for $q$, we get  $((2m+1)^2-(2n+1)^2)$. If we expand it, we get $4(m^2+n^2+m-n)$ Q. I think I can make $4(m^2+n^2+m-n)$ look like $24k$. How should I approach ?  And my prof. commented that "I would take this proof in small steps.  Rather than trying initially to prove that $24 | p^2-q^2$, look at the progress you already have.  You proved $4 | p^2-q^2$.  Can you prove 8 is a factor?  What about 3?  Then see if you can put together what you have to get 24 as a factor."  I am stuck here. Any helps?


Suppose I have a filename ./file and I want to remove the leading ./ (if it starts with ./). What would be the best python way to do this? My take at this is:  if filename.startswith("./"):   # remove leading ./   filename = filename[2:]   Isn't there a more elegant way?  PS: it should remove the leading part only if it matches exactly, think of the following filenames:  ./filename .configfile ../file ./.configfile

I have some simple python code that searches files for a string e.g. path=c:\path, where the c:\path part may vary. The current code is:  def find_path(i_file):     lines = open(i_file).readlines()     for line in lines:         if line.startswith("Path="):             return # what to do here in order to get line content after "Path=" ?   What is a simple way to get the text after Path=?


Let $a$ and $b$ be positive integers with GCD $d > 0$. Show that in $\mathbb{Q}[x]$, the ideal generated by $x^a - 1$ and $x^b - 1$ equals the ideal generated by $x^d - 1$.   Here is what I have so far: since $\mathbb{Q}$ is a field, $\mathbb{Q}[x]$ is a Euclidean domain. So $\mathbb{Q}[x]$ is also a PID and $(x^a - 1,x^b - 1) = (\alpha)$ for some $\alpha$. Furthermore we can write $\alpha = p(x)(x^a - 1) + q(x)(x^b - 1)$ for some $p(x), q(x) \in \mathbb{Q}[x]$. Using the norm $N(\alpha) = \text{deg }\alpha$, we have $N(\alpha) = ma + nb$ where $m = \text{deg }p(x)$ and $n = \text{deg }q(x)$. This seems to imply $\text{deg }\alpha = d$, but I am not sure what else to do here.


I'm working with an ARM processor Cortex-m4, STM32L476RG Board.  I have read about the padding might be the reason to a bigger size of the struct, than what actually inside the struct.  But, I would really like to get the exact size of 68 bytes to the struct instead of 72.  Anyone have an idea on how to get the right sizee?  Consider the following struct:  struct data {   double Latitude;            // 00-07   double Longtitude;          // 08-15   float HorizontalAcc;        // 16-19   float Altitude;             // 20-23   float AltitudeAcc;          // 24-27   float SpeedInMS;            // 28-31   float SpeedAcc;             // 32-35   float Heading;              // 36-39   float HeadingAcc;           // 40-43   int Data;                   // 44-47   unsigned long PacketNumber; // 48-51   int64_t y;                  // 52-59   int64_t x;                  // 60-67 }; // size 8 + 8 + 7*4 + 4 + 4 + 8 + 8 = 68   The thing is that I need to write these data bytewise into a binary file, and the padding ( after PacketNumber ) ruining it.. Is there anyway, to not use the padding or maybe to skip the padded bytes when writing to a file?

Why does the sizeof operator return a size larger for a structure than the total sizes of the structure's members?


TLDR version: Too many people can vote to close. People are overzealous when it comes to  voting to close. Questions that get closed will very likely remain so because they attract little attention. This needs to be fixed.    As of last month, there are  who can cast close votes, and the number will grow. Unfortunately, the chances of questions getting wrongfully (or not) closed will increase proportionally, since there is currently no way to counteract close votes besides voting to reopen after a question has been closed.  I think this goes against the community-driven model that SO follows. It's no longer the "Community" that can close the question; but a tiny minority of it - 5 (five) users, is all it takes. We now have the "tyranny of the minority." It is also impossible for someone to rescind their close vote even if they feel the question should no longer be closed. In the current setup, there is no way to go but down.   I know this has been suggested before, and has been ignored for unknown reasons, but it's starting to bother me. We should be able to either:   . Example: User posts a vague question. Close votes are cast. User adds sufficient detail to the question, but I can no longer rescind my vote and there are 4 close votes already. One more person comes along and votes to close. Question is closed. User gets demotivated. If it's a new user, might never come back. : I disagree with the close votes being cast. I cast a vote not to close and this decreases the close vote count by some amount.   Or do both. The system as it is is broken IMHO. It was a year ago two years ago, it's even more so today, with more users having this ability. It's apparent that a good deal of stackers support these two suggestions. But for some reason Jeff doesn't like them. Perhaps you could explain the rationale on why they shouldn't be implemented?

Update: Found in the "Highest voted questions" list on the 10k tools "stats" tab today:    (question is +37 and best answer is +27)  (question is +23 and best answer is +15)   both with obvious duplicates of long standing. I've voted to  close, but I doubt it will ever happen, not am I entirely sure it would be fair at this point.  But I think is points out very clearly that we're not getting enough policing.    Original:  On any given day, I can open the 10k tools on Stack Overflow, go to the close tab, and burn through all my close votes in an hour or so (hey, I take some time to compare proposed duplicates and search out better ones myself, and try to write politely encouraging comments to users I guess may be to be new or sensitive).   And it doesn't make a dent in the supply of bad questions that need to go.  I put to you a set of linked questions:   Do we need to get more questions closed? If so, what can we do to encourage more closing? What do we need to do to maintain quality control while we do it? Are the cultural norms we bring to closing sufficiently professional? What can we do to create fewer hurt feeling even while we maintain discipline and focus on the site?   Some related questions:   Are we closing the right questions right now? Are we closing too many good questions, and if so are they getting consistently re-opened?     Many related resources:      and several other like it   and


I have a quick question. I had 401K from 2 different past employers - Employer A and Employer B. I opened 2 Rollover IRA accounts - one in Brokerage A and another one in Brokerage B in early 2020. I did rollover my old 401k from employer A to Brokerage A and  from employer B to Brokerage B. I read somewhere that I cannot do more than 1 rollover in a year. Is there something I need to worry about even if the rollover is from 2 different employers to 2 different brokerage firms?

My friend wants to consolidate his various retirement account accumulated over the past 20-30 years to make it easier to manage/track his retirement savings. He doesn't recall immediately all the accounts he currently has (one of the reasons to rollover), but we've determined he has at least the following types of accounts: 401(a), 401(k), 403(b), 457(b), and "something from the city". He's trying to track down all the relevant paperwork for all of the accounts, but we'd like to know what kind of limits he might have to watch out for.   Are there any restrictions on the types of the accounts that can be rolled over? Is there a limit to the number of accounts that can be rolled into a single IRA (whether all at once or over the lifetime of the IRA)? Is there a limit to the number of times accounts can be rolled over (can/should he do 1 or 2 at a time as he gets the paperwork in order, or wait until he has everything sorted out)? Is this a yearly limit or lifetime? Is there a dollar limit on the amount that can be rolled over? Is there a limit to the age of accounts that can be rolled over?   As far as we know, all of the accounts are pre-tax/non-Roth accounts, and that Roth vs. traditional accounts should be rolled over to separate (Roth vs. traditional) IRAs.


Take any question, for example this one:    Right below the question it has  9 Answers;  Note the ; sign ↑. Is it supposed to be that way?

On all the SE sites that I checked, the text that normally says something like “1 Answer” now says “1 Answer;” (with a semicolon seemingly in superscript):    The HTML for that part of the page looks like this (the semicolon is on the fourth line from bottom):

                                 1 Answer

                      active                               oldest                               votes
 ;


Is it possible to recover data after a hard drive has been reformatted and windows reinstalled on the drive? As a friend has forgot to back up some important word documents.

What steps can I take to try to recover lost or inaccessible data from any storage device?  Answers:   This applies to any computer storage device, e.g. internal/external hard drives, USB sticks, flash memory. The most important thing is to STOP using it, any type of I/O can ruin your chances of a recovery.     We have separate questions covering common problems with USB flash drives in greater detail:


If I own two s and play a , both Flameshadow Conjurings would go on the stack. Once I choose to pay 1 red mana, do I get two copies or one? Since the rules text says "if you do" it seems like both cards would see I did and I'd get two copies.

Say I have a Zombie token, , and  on the battlefield. Can I sacrifice the Zombie token to activate both the Altar's and Seer's abilities?  Similarly, if I have one card in hand, and  and  on the battlefield can I discard the one card to both of their abilities?  If I have a  with 3 charge counters can I activate both of its abilities by tapping it to add a counter, and tapping it to remove 3 counters and destroy a permanent without untapping it in between?


This is code in IDLE2 in python, and error.  I need to include each "data" element as key and value "otro", in an orderly manner. Well "data" and "otro" it's list with 38 string's, as for "dik" it's an dictionary.  >>> for i in range(len(otro)+1):     dik[dato[i]] = otro[i]    Traceback (most recent call last):   File "<pyshell#206>", line 2, in <module>     dik[dato[i]] = otro[i] IndexError: list index out of range >>>    this problem is range(0, 38)  output -> (0, 1,2,3 ... 37) and it is all messy

Imagine that you have the following list. keys = ['name', 'age', 'food'] values = ['Monty', 42, 'spam']  What is the simplest way to produce the following dictionary? a_dict = {'name': 'Monty', 'age': 42, 'food': 'spam'}


I have a lan connection with average download speed of about 5-6 MBps. But ubuntu software centre doesn't download at that speed. I even checked my speed by downloading from other sources but they were giving a download speed in Mbps. Is there a way I can boost up speed because downloading packages as big in Giga Bytes can become cumbersome at speed of 70-100 Kbps.

Several times over the past couple years, I've heard of people using apt-fast for updating and installing packages, but I'm not really sure what it does.  I think I've traced its origin to , and it seems to be a script that speeds up apt-get operations.  What exactly does the script do? Are there any potential downsides to using it? If not, why isn't everyone using it?


I am creating and application in Java using Netbeans. I have 1 jFrame on which there is few jmenus and a jdesktoppane and jinternalframes. Now my problem is I am not able to set jInternalFrame at the centre of jDesktopPane. I gor some help from  which is mentioned like this  Dimension desktopSize = desktopPane.getSize(); Dimension jInternalFrameSize = jInternalFrame.getSize(); jInternalFrame.setLocation((desktopSize.width - jInternalFrameSize.width)/2,     (desktopSize.height- jInternalFrameSize.height)/2);   I changed this according to my use like this -  Dimension desktopSize = this.getDesktopPane().getSize(); // Line No. 29 Dimension jInternalFrameSize = this.getSize(); this.setLocation((desktopSize.width - jInternalFrameSize.width)/2,     (desktopSize.height- jInternalFrameSize.height)/2);   But my code is throwing NullPointerException -     Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException     at newUserReg.(newUserReg.java:29)    at   smsMDI.mnuNewUserActionPerformed(smsMDI.java:278)     at   smsMDI.access$000(smsMDI.java:16)     at   smsMDI$2.actionPerformed(smsMDI.java:97)  at   javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)     at   javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)     at   javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)     at   javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)     at javax.swing.AbstractButton.doClick(AbstractButton.java:376)  at   javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:833)     at   javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:877)     at java.awt.Component.processMouseEvent(Component.java:6504)    at   javax.swing.JComponent.processMouseEvent(JComponent.java:3321)    at   java.awt.Component.processEvent(Component.java:6269)  at   java.awt.Container.processEvent(Container.java:2229)  at   java.awt.Component.dispatchEventImpl(Component.java:4860)     at   java.awt.Container.dispatchEventImpl(Container.java:2287)     at   java.awt.Component.dispatchEvent(Component.java:4686)     at   java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)     at   java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)     at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)     at java.awt.Container.dispatchEventImpl(Container.java:2273)    at   java.awt.Window.dispatchEventImpl(Window.java:2713)   at   java.awt.Component.dispatchEvent(Component.java:4686)     at   java.awt.EventQueue.dispatchEventImpl(EventQueue.java:707)    at   java.awt.EventQueue.access$000(EventQueue.java:101)   at   java.awt.EventQueue$3.run(EventQueue.java:666)    at   java.awt.EventQueue$3.run(EventQueue.java:664)    at   java.security.AccessController.doPrivileged(Native Method)    at   java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)     at   java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)     at java.awt.EventQueue$4.run(EventQueue.java:680)   at   java.awt.EventQueue$4.run(EventQueue.java:678)    at   java.security.AccessController.doPrivileged(Native Method)    at   java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)     at java.awt.EventQueue.dispatchEvent(EventQueue.java:677)   at   java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:211)     at   java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)     at   java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)     at   java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)     at   java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)     at java.awt.EventDispatchThread.run(EventDispatchThread.java:90)   If any one can explain or show me the right way to do this, that will be a great help for me.

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?


What is the physics behind these rays of light visible in the photographs of objects that emit light? What justifies their shape and amount of rays?  Very well known effect in a sense, but I did not find any deep explanation...

In many images of light emitting objects we see such rays. Why do they appear ? What is the math behind their number and direction?


I applied for an ESTA and was approved, however the Question have you been arrested of an offence that caused serious damage to a person or building etc - I answered no as It was a fight I got into 18 years ago and I didn't think giving someone a split lip and black eyes was serious damage. To be on the safe side I decided to apply for a visa and lay out all the details and be truthful. I was then denied the visa. My question is does a visa denial cancel an ESTA? I looked at my ESTA status this morning and it still says approved, so can I travel on this? Time is of the essence as I was booked to leave in 8 days.

I was denied an O-1 Visa (Artist Visa) to the USA twice in the past year and a half. I applied for the O-1 Visa with my Israeli Passport. In addition, I have an European passport and a valid ESTA. I want to travel to the USA for a period of 2 weeks.   My question is: Is there a chance I can get denied by entering the USA? based on the fact that I was denied a visa recently?


Which one is grammatically correct sentence?   According to the Bible it is meek and humble who shall inherit the earth. According to the Bible it is the meek and humble who shall inherit the earth.

I was reading a paragraph about lions and I came up with a question about the definite article (the).  Let me tell you first what I know about it.     1->We use the before a singular noun (when we are sure about the noun.    And the listener and the speaker both know about it).      2->We use the before a plural noun (again when we are sure about the noun,   and we are not talking generally).   So, my question is why does the writer use the here as we are not talking about any specific lion or lions. We are talking generally.  The Paragraph:     Living in the grasslands, scrub, and open woodlands of sub-Saharan   Africa, the lion is the second largest cat in the world. It is dwarfed   slightly by the tiger, which is closely related and has a very similar   body type.    Can we re-write the paragraph something like this:     Living in grasslands, scrub, and open woodlands of sub-Saharan Africa,   lions are the second largest cat in the world. They are dwarfed   slightly by tigers, they are closely related and has a very similar   body type.


I  have got the below HTML as a response .

Honey with Carmel  10 ML

Honey with Carmel  10 ML

   I need to find out if any section has got class as "tpActive" ??  I wrote the below , but don't know how to check further ??  $('#'+v_item_id+'.activateUiHTML').find(".Topping-details").find("section")   could anybody please help me .  Updated Question    if($('#'+v_item_id+'.activateUiHTML').find("Toppingdetails").find("section").hasClass("tpActive")) {    alert('has'); }else {    alert('No'); }

I'm working with jQuery and looking to see if there is an easy way to determine if the element has a specific CSS class associated with it.  I have the id of the element, and the CSS class that I'm looking for.  I just need to be able to, in an if statement, do a comparison based on the existence of that class on the element.


for(int i = 0 ; i < n ; i++) {          a[i] = scan.nextInt();     }     for(int i = 0 ; i < n ; i++) {         for(j = n ; j >= 0 ; j--)             a[j] = a[j] + a[i];     }   I cant seem to properly find the time complexity of the code or convert to big O. I know the first loops is 1 + (n+1) + 1 and i think the 2nd/3rd ones are N*(1 - (N-1) * 1)

What is the Big-O time complexity of the following nested loops: for (int i = 0; i < N; i++) {     for (int j = i + 1; j < N; j++) {         System.out.println("i = " + i + " j = " + j);     } }  Would it be O(N^2) still?


Is there a similar way as in ArcPy   import arcpy  desc=arcpy.Describe('rasterName') print desc.noDataValue   to access the no data value using GDAL?

I seem to use ESRI's Arcpy site package for virtually all of my python geoprocessing.  To ESRI's credit, these are an incredible suite of tools that can help accomplish a great deal.  However, I would also like to create geoprocessing scripts outside of the ESRI Arcpy domain.  For example, if I want to clip a raster to a polygon, I would start with the following script from :   # Import system modules import arcpy from arcpy import env from arcpy.sa import *  # Set environment settings env.workspace = "C:/sapyexamples/data"  # Set local variables inRaster = "elevation" inMaskData = "mask.shp"  # Check out the ArcGIS Spatial Analyst extension license arcpy.CheckOutExtension("Spatial")  # Execute ExtractByMask outExtractByMask = ExtractByMask(inRaster, inMaskData)  # Save the output  outExtractByMask.save("C:/sapyexamples/output/extractmask")     I'm not sure how I would accomplish the same task programmatically without Arcpy.  My questions for the serious programmers out there:  What collection of python tools do you use to accomplish tasks that ESRI users would accomplish with the Arcpy site package?  Where do I begin?


I have the following code and variables, and I want to find what the variables a, a1, a2, b, b1, and b2 refer to after the code has been executed.  def do_something(a, b):     a.insert(0, "z")     b = ["z"] + b  a = ["a", "b", "c"] a1 = a a2 = a[:] b = ["a", "b", "c"] b1 = b b2 = b[:]  do_something(a, b)   My attempted solution is as follows:  a = ["z", "a", "b", "c"] a1 = ["a", "b", "c"] a2 = ["a", "b", "c"] b = ["z" "a", "b", "c"] b1 = ["a", "b", "c"] b2 = ["a", "b", "c"]   But the actual solution is:  a = ["z", "a", "b", "c"] a1 = ["z", "a", "b", "c"] a2 = ["a", "b", "c"] b = ["a", "b", "c"] b1 = ["a", "b", "c"] b2 = ["a", "b", "c"]   Can anyone walk me through my mistake?

I'm trying to understand Python's approach to variable scope. In this example, why is f() able to alter the value of x, as perceived within main(), but not the value of n?  def f(n, x):     n = 2     x.append(4)     print('In f():', n, x)  def main():     n = 1     x = [0,1,2,3]     print('Before:', n, x)     f(n, x)     print('After: ', n, x)  main()   Output:  Before: 1 [0, 1, 2, 3] In f(): 2 [0, 1, 2, 3, 4] After:  1 [0, 1, 2, 3, 4]