libidn2's punycode testing is broken in the head (the ASCII-only case fails.) I created a new LOCAL branch to try and determine when it last worked but I need to checkout idn2.h from the head, and puny_encode.c, puny_decode.c, punycode.h, and tests/test-punycode.c each (potentially) from DIFFERENT commits! How do I do this and get all of then in my newly created testing branch? I normally use Mercurial so I'm having to do a web search for every git command I need and it's getting frustrating!

I have made some changes to a file which has been committed a few times as part of a group of files, but now want to reset/revert the changes on it back to a previous version.   I have done a git log along with a git diff to find the revision I need, but just have no idea how to get the file back to its former state in the past.


My native language is German but I’ve been  watching a lot of TV in English. During a conversation about the English language, a question about the term gay came up. Is calling a homosexual person gay offensive?   Meaning, using "gay" - not in a general contents (as asked in other questions) but to describe the sexual orientation when using it in a sentence like:   Talking about someone: He/she is "gay" [...] Talking to someone: I didn't know that you're "gay" [...]

My college-age son and his friends use the terms "retarded" and "gay" pretty much interchangeably to mean substandard, bad, lame (in the sense of ineffectual or weak) or just plain wrong. I've suggested that he might want to be careful about where he uses such language, but he clearly isn't worried about being offensive with those terms. Now add this to the equation: Last night we watched a recorded version of Comedy Central's "A Tribute to Sam Kinison." Comedy Central censors a lot of words, including names of body parts (although, curiously, they let "dick" remain unbleeped), terms for sex acts, and so on. And we could clearly see that the word "retarded" had been bleeped (it's a very easy word to lip-read). Note that Comedy Central does not censor the word "nigger" on the Dave Chapelle show, although this is a word Jon Stewart goes to great lengths to avoid saying on his own show (also, of course, on Comedy Central). So I wonder: is the word "retarded" really that offensive? How about "gay" in the context described above? UPDATE From an Associated Press story ( reported in the Boston Globe today (Sept. 21, 2011):  WASHINGTON - Young people immersed in the online world see racist and sexist slurs and other name-calling that probably would appall their parents and teachers. And most consider it no big deal, a poll says. ... When the question is asked broadly, half of young people surveyed say using discriminatory words is wrong. But 54 percent think it’s OK to use them within their own circle of friends, because “I know we don’t mean it.’’ And they don’t worry much about whether the things they tap into their cellphones and laptops could reach a wider audience and get them into trouble. ... Demeaning something with “that’s so gay’’ is so common that two-thirds of young people see it used, and the majority aren’t offended at all, despite a public-service ad campaign that tried to stamp out the anti-gay slang. A similar effort by the Special Olympics and others to persuade kids not to use “retard’’ hasn’t hit home with half of those surveyed, who don’t find the word even moderately bothersome. Twenty-seven percent are seriously offended, however. Some teens just text the way they talk. Calling each other “gay’’ and “retarded’’ is routine in high school, says Robert Leader, 17, a senior in Voorhees, N.J. So teens text it, too.


Hi the app stopped showing rep increases and now is just showing badges. Yesterday it showed both rep and badges earned.     App Version: 1.4.0 Device: iPhone7,1 OS Version: Version 9.1 (Build 13B143)

So... I know that a couple of months ago I complained about the ... and that's getting fixed...  But now they're not showing up at all. All I'm seeing under "Achievements" in the iOS app is badges awarded.     Now, to compare, here's my achievements pane on FF:    I did check... I haven't installed a new version of the iOS app... though I do know that some updates can be pushed without a new version.  The same thing is occurring on my iPad and iPhone.


I have created the following regular expression for validating my email  - (BOOL)isValidEmail {     BOOL stricterFilter = YES;     NSString *stricterFilterString = @"[A-Z0-9a-z\\._%+-]+@([A-Za-z0-9-]+\\.)+[A-Za-z]{2,4}";     NSString *laxString = @".+@([A-Za-z0-9]+\\.)+[A-Za-z]{2}[A-Za-z]*";     NSString *emailRegex = stricterFilter ? stricterFilterString : laxString;     NSPredicate *emailTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", emailRegex];     return [emailTest evaluateWithObject:self]; }   But it fails when i enter following:  b. !@#$%^ bfv@mn.cn   Is there any issue with my regular expression?

Over the years I have slowly developed a  that validates MOST email addresses correctly, assuming they don't use an IP address as the server part.  I use it in several PHP programs, and it works most of the time.  However, from time to time I get contacted by someone that is having trouble with a site that uses it, and I end up having to make some adjustment (most recently I realized that I wasn't allowing 4-character TLDs).  What is the best regular expression you have or have seen for validating emails?  I've seen several solutions that use functions that use several shorter expressions, but I'd rather have one long complex expression in a simple function instead of several short expression in a more complex function.


Let $E=\{f(x) \in L^{2}\mathbb(R)| f'(x)\in L^{2}\mathbb(R)\}$ show that differential operator is not bounded in $E$. I'm thinking in a counterexample but I can't find one. Can you find some function? The standar norm is \begin{eqnarray*} \| f\|=\sqrt{\int_{-\infty}^{\infty}|f(x)|^{2}dx} \end{eqnarray*}

If we define $D$ as the set of functions $f \in L^2 (\mathbb{R})$ such that $f' \in L^2 (\mathbb{R})$ too, then it can be shown (I think) that the linear operator $\frac{d}{dt}: D \rightarrow L^2 (\mathbb{R})$ is not bounded with respect to the norm on $L^2 (\mathbb{R})$, which is $||f|| = \sqrt{\int_{-\infty}^{\infty}|f(t)|^2 dt}$.   But I'm having trouble proving this. What I'd like to do is find a sequence $(f_n)$ in $D$ with $||f_n||=1$ $\forall n \in \mathbb{N}$ but with $||f_n '||$ increasing and becoming arbitrarily large with $n$.   I understand that if we were working with the space of continuous functions on $\mathbb{R}$ instead of $L^2 (\mathbb{R})$, with the nice supremum norm, we could just use $f_n (t) = \sin(nt)$, but that won't work here. I tried the sequence $f_n(t) = \sqrt{\frac{\sin(nt)}{t}}$ because that's got a handy $L^2$-norm of $\sqrt{\pi}$ for all $n\in\mathbb{N}$, but its derivative isn't in $L^2 (\mathbb{R})$ so I feel stuck.   I think I'm approaching the problem correctly, but the norm in question here isn't easy to work with -- is there a simple sequence I could use?


Feynman (Volume 1, 38-4) seems to explain the normal force of a floor acting on a table as quantum mechanical, arising from the Pauli Exclusion Principle and also, the Heisenberg Uncertainty Principle.  (see quote below).  This seems somewhat at odds with an explanation that I have heard many times, which is that the electrostatic repulsion of the opposite-facing electron shells generates the required force.  Presumably if Feynman considered electrostatics to contribute to this, he would have said so.  I am also surprised because I have heard of neutron star formation through electron degeneracy pressure, and had the impression that this pressure only appears manifest under extreme conditions. The wikipedia page on electron degeneracy pressure mentions that it plays a role in the bulk modulus compressibility of metals, and the description may imply that the strength of the contribution is undersood.  Is there any way to decompose the normal force contributions of the floor supporting a chair into contributions from electrostatics, uncertainty principle, and exclusion principle?  If so, what provides the primary contribution?  Feynman Quote, Volume 1 Chapter 38, Section 4 "So we now understand why we do not fall through the floor. As we walk, our shoes with their masses of atoms push against the floor with its mass of atoms. In order to squash the atoms closer together, the electrons would be confined to a smaller space and, by the uncertainty principle, their momenta would have to be higher on the average, and that means high energy; the resistance to atomic compression is a quantum-mechanical effect and not a classical effect. Classically, we would expect that if we were to draw all the electrons and protons closer together, the energy would be reduced still further, and the best arrangement of positive and negative charges in classical physics is all on top of each other. This was well known in classical physics and was a puzzle because of the existence of the atom. Of course, the early scientists invented some ways out of the trouble—but never mind, we have the right way out, now! (Maybe.) Incidentally, although we have no reason to understand it at the moment, in a situation where there are many electrons it turns out that they try to keep away from each other. If one electron is occupying a certain space, then another does not occupy the same space. More precisely, there are two spin cases, so that two can sit on top of each other, one spinning one way and one the other way. But after that we cannot put any more there. We have to put others in another place, and that is the real reason that matter has strength. If we could put all the electrons in the same place it would condense even more than it does. It is the fact that the electrons cannot all get on top of each other that makes tables and everything else solid. Obviously, in order to understand the properties of matter, we will have to use quantum mechanics and not be satisfied with classical mechanics."

There is this famous example about the order difference between gravitational force and EM force. All the gravitational force of Earth is just countered by the electromagnetic force between the electrons on the surface of my feet and the ground.  But also wave-function of electrons(fermions) do not overlap each other due to Pauli exclusion principle.  So which one is the true reason of me not flopping inside the earth forever? Is it only one of them(my guess is Pauli exclusion) or is it both?


In Rudin's book, the following proof is published:  Let $A$ be the set of all positive rationals $p : p^2 < 2$. Let $B$ be the set of all positive rationals $p : p^2 > 2$. $A$ contains no largest number and $B$ contains no smallest. Let q be a rational. More explicitly, $$\forall p \in A, \exists q \in A : p < q$$ and $$\forall p \in B, \exists q \in B : q < p$$ This needs proof.  Now he introduces a couple of equations which are not clear where they are derived from. As follows,  To do this, we associate with each rational $p > 0$ the number $$q = p - {\frac{p^2-2}{p+2}} = {\frac{2p+2}{p+2}}$$ then $$q^2 - 2 = {\frac {2(p^2-2)}{(p+2)^2}}$$  He then goes on to prove how $p \in A \rightarrow q \in A$; similarly for the set B. My question is: How did he arrive at those equations - particularly, the first one (since the second is clear)?

First, my apologies if this has already been asked/answered.  I wasn't able to find this question via search.  My question comes from Rudin's "Principles of Mathematical Analysis," or "Baby Rudin," Ch 1, Example 1.1 on p. 2.  In the second version of the proof, showing that sets A and B do not have greatest or lowest elements respectively, he presents a seemingly arbitrary assignment of a number $q$ that satisfies equations (3) and (4), plus other conditions needed to show that $q$ is the right number for the proof.  As an exercise, I tried to derive his choice of $q$ so that I may learn more about the problem.  If we write equations (3) as $q = p - (p^2 - 2)x$, we can write (4) as   $$ q^2 - 2 = (p^2 - 2)[1 - 2px + (p^2 - 2)x^2]. $$  Here, we need a rational $x > 0$, chosen such that the expression in $[...]$ is positive.  Using the quadratic formula and the sign of $(p^2 - 2)$, it can be shown that we need   $$ x \in \left(0, \frac{1}{p + \sqrt{2}}\right) \mbox{ for } p \in A, $$  or, for $p \in B$, $x < 1/\left(p + \sqrt{2}\right)$ or $x > 1/\left(p - \sqrt{2}\right)$.  Notice that there are MANY solutions to these equations! The easiest to see, perhaps, is letting $x = 1/(p + n)$ for $n \geq 2$.  Notice that Rudin chooses $n = 2$ for his answer, but it checks out easily for other $n$.  The Question:  Why does Rudin choose $x = 1/(p + 2)$ specifically?  Is it just to make the expressions work out clearly algebraically?  Why doesn't he comment on his particular choice or the nature of the set of solutions that will work for the proof?  Is there a simpler derivation for the number $q$ that I am missing?


I would like to know, why on Stack Exchange sites we don't currently get reputation for helpful flags?  It could perhaps be awarded with the same amount of rep that an edit is worth (+2 per helpful flag, perhaps up to 1000 rep total like edits).

By helping the site by flagging successfully (and therefore gaining higher flag weight), you typically inform that you are able to understand the system and be helpful.  Similarly, when you are helpful by editing posts (not necessarily even understanding anything, just making it better), you gain 2 points for each edit. Good flagging may require even more understanding; while editing just fixing spelling and/or formatting gives reputation points. You don't have to understand whether question (or answer) is on-topic, or even meaningful.  So, why there isn't for example 2 points for each flag that was acted on, in the same way flag weight increase is determined?


I bought couple ATMEGA328P-PU as a replacement for my Arduino Uno. The problem is that I don't have any cables to program to 328 directly and I'm trying to avoid using Arduino and it's bootloader. I want to write code in C, but I don't know where to start..  I'm trying to figure out two things:        How to build my own USB cable to write bootloader & code to the ATMEGA328P-PU?   What software do I use to get started with the bootloader (Linux)?      Any help would be much appreciated, thanks!

My Arduino Uno has a ATMEGA328P-PU microcontroller, and bunch of other stuff on the board. I'd like to program the chip without the Arduino software, and only the minimum of other components.  I want to eventually create things without the cost of Arduino, and I want to learn about the other parts on the board and add them back as as needed.  I'm comfortable with C and gcc, so I can probably figure out the software part. But what, if anything, besides these two products below, do I need to have in the breadboard with the microcontroller?


I think that f(x,y) is continuous at (0,0) and has partial order derivatives but is also differentiable at (0,0) because curve is smooth,ie-  answer is option D ? Am i correct ?

let $f(x,y)= e^{-\frac{1}{x^2+y^2}}$ when $(x,y)\neq (0,0)$ and $f(0,0)=0$.  Then   (1) $f$ is not continuous at $(0,0)$.  (2) $f$ is continuous but the first order partial derivative does not exists   (3) $f$ is continuous at $(0,0)$ , first order partial derivative exists but not differentiable   (4) differentiable .  I think only (2) is correct .  Reasoning :  set $r=x \cos \theta ,y=r \sin \theta $. Then as $(x,y)\to (0,0$) we have $r\to 0$ . so $ \lim_{r\to 0} f=\lim _{r\to} e^{-\frac{1}{r^2}}=0 . $ but  $\lim\frac{f(h,0)-f(0,0)=}{h}=\lim_{h\to 0}\frac{e^{-\frac{1}{h^2}}}{h}=\lim_{h\to 0}\frac{1}{he^{\frac{1}{h^2}}}$ does not exists as it becomes unbounded .   So the first order prtial derivatives does not exists .Hence it is not differentiable .  is my solution correct ?


The two tensor definitions I'm (newly) familiar with, by transformation rules, and as a map from a tensor product space to the reals, don't tell me what a tensor does, and to the best of my knowledge they don't make it apparent. So, I'm looking for an operational definition, and suggesting the following one -  This question was marked as a duplicate and here I try to explain why I don't think it is.  See paragraph 1. Moreover -  this definition is different because it defines tensors of rank 2 and above as a means of defining maps from tensor to tensor, and defines the operation of one tensor mapping another as an extension of the angle bracket operator for covectors and vectors (which I denote by >cv, v< as typing them correctly causes them not to print).  So, this definition tells you explicitly what a tensor does and how it does it.  I think it is much easier to understand if you're starting with no knowledge of tensors.  Scalars are rank 0 tensors.  For tensors of higher rank we start with a n-dimensional vector space V with basis e1, e2,... en and dual covector space V* with basis e1*, e2*,... en*. Vectors and covectors are rank 1 tensors.  A tensor of rank r>1 is a means of defining a linear map from tensors of rank m to tensors of rank n, where m and n are generally < r, but not necessarily, that is, the definition doesn't require it.  A tensor of rank r>1 is a linear combination of dyadic basis tensors of rank r, where a dyadic basis tensor product of rank 1 basis tensors a1 x a2 x a3 x....x ar where each ai is either a basis vector ej of V or a basis covector ej* of V*.  The result of applying one dyadic basis tensor a1 x a2 x a3 x....x ar to another b1 x b2 x b3 x....x bs is computed by evaluating >ar,b1< and if that is not 0, evaluating >ar-1,b2<, and if that is not 0 continuing till one of the dyadic basis tensors (normally b1 x b2 x b3 x....x bs.) is used up, if no 0 was produced the dyadic basis tensor that remains is the result, it's either a 1 or a dyadic basis tensor. Note when evaluating >ar-(k-1),bk< one must be a vector and one a covector, else it's an error.  Note: I'm using non-standard brackets >cv,v< to indicate applying a covector to a vector, the normal angle brackets don't print correctly.  The a dyadic basis tensor eats the b dyadic basis tensor till one of the nibbles is a 0 and the result is 0, or till one is used up and the result is 1 or the part of the a dyadic basis tensor that didn't get a bite (or the b dyadic basis tensor that didn't get bitten).  A tensor A maps tensor B by applying each term (coefficient times dyadic basis tensor) in A to each term in B and multiplying their coefficients when the result is not 0, and summing the resulting terms to get the result of A applied to B.  I think this is how tensors work, and I think this definition does explicitly spell it out and make it clear. But I'd like to have it verified or corrected if necessary.

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


On Stack Overflow the current  thresholds are considerably higher than a newly created site such as  which tells me that popularity dictates privilege thresholds.  So what happens if I attained privileges and then the threshold is increased?        If this answer already exists elsewhere then please let me know.

Formerly Reputation requirements compared. What are the reputation requirements for privileges on the various sites in the network? Also, how do reputation requirements for various privileges compare on different Stack Exchange sites? Specifically, the following types of sites:  Designed sites e.g. Stack Overflow, Ask Ubuntu, Gaming, etc. Public beta and non-designed sites Private beta sites  ...as well as any site-specific differences.


I have a Latitude E7250.  I want to add a second SSD.  Has anyone attempted or had any success with this? There is an m.2 connector that is labeled WWAN HCA.  Any help would be greatly appreciated.

I will get a new laptop Dell Latitude E5550, I do not know exact sub-model spec yet.   From the spec sheet:     Two M.2 Expansion slots: 1 WWAN/HCA and 1 WLAN/BT/WiGig   Can I be sure that it will have M.2 slot to buy SSD M.2 disk in advance? What disk will fit in (width)? Can I use ?  I found this  but still I cannot figure out the params of M.2 slot. They say there is no M.2 slot, does it mean that the M.2 slots in Latitude E5550 cannot be used for SSD disks?


Worf is one of my favorite Star Trek characters. A defining moment in his character arc is at the end of Star Trek: Deep Space Nine when the Federation appoints him ambassador to the Klingon Empire. However, in his appearance in Star Trek: Nemesis, he is not an ambassador, and is back serving aboard the Enterprise-E. In-universe, what is the reason behind this? Is he no longer an ambassador?

Worf was seen still wearing the red colours on Star Trek Nemesis. Was he still a strategic operations officer, or did he become tactical officer again despite wearing red colours?


i have been stuck on this question for my lab for linux class

I have this problem as part of a school assignment:  NOTE: In case it's hard to read in the image above, here's the directory tree: $ tree . `-- sample_dir1     `-- sample_dir         |-- admin         |-- cambridge         |   |-- cafeteria         |   |-- library         |   `-- security         |       |-- annex         |       |-- building         |       `-- parking         |-- faculty         |-- history.exe         |-- markham         |   |-- annex         |   |-- building1         |   `-- parking         |-- oxford         |   |-- outline.doc         |   |-- programming         |   |   `-- report.pdf         |   `-- security         `-- stenton             |-- gen_ed             `-- lib_arts                 |-- english.txt                 `-- match.doc  15 directories, 11 files  I tried doing the command: $ cp ../cambridge/security/parking ./parking2  ...but it isn't working. The question in the image above states that the current directory is stenton, and that we need to make a copy of the file named parking (from the security directory), and to name the new file parking2, and place it in the current directory, stenton, using relative pathnames. What am I doing wrong? My cp command seems to be correct.


I'm rendering a few scenes with command line and it works fine with most of them. But there is one scene where I get the following error: "cannot render, no camera". I can manually render it because there is indeed a camera in the scene.  I erased everything that could cause trouble ending up with only a cube and a camera. And all properties match with the working scenes but it's still not working with this file.

I just started blender and one of the main things you have to do is to render to make an animation, but I can't seem to do that. Whenever I click Render and then render image or render animation, at the top of the screen it says 'No camera found in Scene "Scene". I don't know why this is happening.


I'm looking to produce something like this:  blah blah ____ blah blah  But with a solid line.  Thanks in advance.

I want to make a cloze test using LaTeX. My Idea was to use the \phantom command to produce the space:  Some text \underline{\phantom{some text to complete}} some more text.   Now the problem is that \phantom seems to handle "some text to complete" as one word and does not break lines.   \documentclass{minimal}  \begin{document}  Some text \underline{\phantom{some  text to complete some  text to complete some  text to complete some  text to complete some  text to complete some    text to complete some  text to complete}} some more text.  \end{document}


How to safely convert unsigned integral value (e.g. uint32_t, uint64_t) to a pointer of particular type? For instance I have: using my_uint32_t = unsigned int; using my_uint64_t = unsigned long long;  struct Sample {     my_uint32_t address;     my_uint64_t address_64; };  Sample sample; /* Just for reference here */  struct TargetStruct {    /* Some member variables goes here */    ... };  The goal is to access the object of TargetStruct type existing at Sample.address or Sample.address64 respectively. I tried to use: TargetStruct * target = reinterpret_cast<TargetStruct *>( sample );  It works but is that safe? I know the rules say reinterpret_cast shall be avoided as unsafe but is there any other way to make it safely? I cannot go over my "inputs" - the Sample struct and it's content - it is simply given but I have to use the data stored in there in such usafe way... I am using C++20 so I am about to avoid C-style casts...

I am trying to adapt an existing code to a 64 bit machine. The main problem is that in one function, the previous coder uses a void* argument that is converted into suitable type in the function itself. A short example:  void function(MESSAGE_ID id, void* param) {     if(id == FOO) {         int real_param = (int)param;         // ...     } }   Of course, on a 64 bit machine, I get the error:  error: cast from 'void*' to 'int' loses precision   I would like to correct this so that it still works on a 32 bit machine and as cleanly as possible. Any idea ?


I google around to find out how many cores in intel xeon e5420 cpu, but not got the actual answer.  I have intel xeon e5420 cpu, I would like to run multiple virtual machines with 2 cores on each, how many Virtual machine I can have? Please.  Thank you in advance.

This is a  about  Related:      I have a question regarding capacity planning. Can the Server Fault community please help with the following:   What kind of server do I need to handle some number of users? How many users can a server with some specifications handle? Will some server configuration be fast enough for my use case? I'm building a social networking site: what kind of hardware do I need? How much bandwidth do I need for some project? How much bandwidth will some number of users use in some application?


I am using IEEEtran for LaTeX. That means text is in two columns. I want to post a full figure page. I use:   \usepackage{pdfpages}  \begin{figure} \includepdf{fluxograma.pdf} \caption{SEAL flowchart.} \label{fig_sim} \end{figure}   But the figure shows up on top of the rest of my text  \newpage   does not work either. Any ideas?

If I just try to set the figure's size to 0.9\textwidth my figure will just end up on the right column, sized to be two-columns wide.  Has anyone done this before?


I am reading a book about database systems and in the chapter covering database design using ER, the author aims to explain when to use aggregation versus ternary relationship. In short, each Project entity is sponsored by one or more Department entities and each Department can sponsor zero, one or more Projects. Each Sponsorship relationship has a Monitors relationship, which connects Employees with Sponsorship.     Now, we want to express an additional constraint that each Sponsorship relationship is monitored by at most one Employee.The author states that this cannot be done with ternary relationship. I can't wrap my head around why. To express this in diagrams, I would just point an arrow from Sponsors2 to Emplyees in ternary relation. Does this not satisfy the additional constraint?

I am reading a book about database systems and in the chapter covering database design using ER, the author aims to explain when to use aggregation versus ternary relationship. In short, each Project entity is sponsored by one or more Department entities and each Department can sponsor zero, one or more Projects. Each Sponsorship relationship has a Monitors relationship, which connects Employees with Sponsorship.  This can be expressed in 2 ER diagrams:     Now, we want to express an additional constraint that each Sponsorship relationship is monitored by at most one Employee.The author states that this cannot be done with ternary relationship. I can't wrap my head around why. To express this in diagrams, I would just point an arrow from Sponsors2 to Emplyees in ternary relation. Does this not satisfy the additional constraint?


If $\frac{1}{p}+\frac{1}{q}=\frac{1}{r}$ prove that $$\|fg\|_{L^r}\leq \|f\|_{L^p}\|g\|_{L^q}.$$ I tried to use Holder, but I can't prove it... any idea ?

On , one can see that   $$\|fg\|_r\leq \|f\|_p\|g\|_q,$$ when $$\frac{1}{r} = \frac{1}{p} + \frac{1}{q}, \ p,q\in(0,\infty].$$  I have two questions,   Is the statement true? If so, is it stated in some references? I need it for my thesis.


I have Long value 1282680754000 where if I check this value in  it gives me Tuesday, August 24, 2010 8:12:34 PM   But if I use new DateTime(1282680754000).toDate() I get Wed Aug 25 01:42:34 IST 2010 (It is adding +5.30 hour)  How to get Tuesday, August 24, 2010 8:12:34 PM  for 1282680754000 in java

I have a string containing the , and I need to convert it to a Java Date object.  String date = "1081157732"; DateFormat df = new SimpleDateFormat(""); // This line try {   Date expiry = df.parse(date);  } catch (ParseException ex) {   ex.getStackTrace(); }   The marked line is where I'm having trouble. I can't work out what the argument to SimpleDateFormat() should be, or even if I should be using SimpleDateFormat().


something happened to my Minecraft . I changed language and when I returned back to English everything came up smaller. I cannot get back to my old normal settings. Please help.

I have been playing Minecraft, and I went into the settings to see what could be changed. I was in display and I saw the GUI scale was set to "Auto", which was fairly large. I cycled through the scales until I got back to auto, but the GUI scale was stuck at normal size and wouldn't allow me to make it large again. I know this isn't such a big problem, but I really like big font and this is a constant bother to me.


Both on 2.79b and 2.80 beta, I am unable to see the top menu line.  It is being blocked by the windows title bar.  I'm running on a laptop with a built in Intel 620 graphics.  I assume that is the problem.  Is there any workaround?  Thanks.

I have a problem with Blenders UI. The "Info" bar on top disappeared and the mouse pointer is misaligned. I reinstalled Blender 2 times, deleted every leftover files  but it still does the same thing. This is in v2.78c. The weird thing is that on the bottom everything works fine. Here are some images:


I really cannot seem to get my head around the definition of cardinal exponentiation with regards to finite sets:  $|X|^{|Y|}=|X^Y|$  How would one even begin to prove this? Isn't $X^Y$ the set of all functions with the domain $Y$ and the codomain $X$?

I'm having trouble understanding the definition of cardinal exponentiation.  Let's start with the definitions / claims I've been given:  For any finite sets $A,B$, such that if $|A|=a$ and $|B|=b\neq 0$ then the number of functions from $A$ to $B$ is $b^a$. ( I'm guessing this is only used when both sets are finite ).  For any sets $A,B$, $B^A$ is the set of functions from $A$ to $B$.  For every set $A$, $|P(A)|=|\left \{ 0,1 \right \}^A|$  Now for the definition and why I don't understand it:  Let $a,b$ be cardinal numbers.  Let $A,B$ be sets such that $|A|=a, |B|=b$.  Then $|B^A|=b^a$.  How analagous to normal exponentiation is this and where does in differ when we introduce cardinals like $\aleph_0$ or $C$?  Is $2^2=4$ and is $\frak c^2=c\cdot c=c\times c$?


I saw somewhere a new TV series. Here's what I remember:  Sometime in the future, when the Earth could no longer support life (or something similar), a group of people goes to the past of the Earth.  They found themselves in pre-historic times. They try to build a colony etc.  Does anyone know something about this series?

The movie was released in the last 15 years, probably between 2008-2018. "Pre-movie" (like what happens before the main part of the movie begins):  The movie was in the future. The people have to wear gas masks to go outside because the air is so polluted. airpollution smog 2 child policy they had 3 kids the guy goes to prison There is some sort of transportation portal that brings some important people 85mio years in the past on another timeline The guy runs to the portal and gets there with his entire family  "Main movie" (most of the movie):  The guy is on this new planet and I think he gets imprisoned. The people built a camp with walls because there are dinosaurs that can easily kill people. Then a few other things happen I don't clearly remember. I think there is also some sort of love story. Then the dinosaurs attack the camp and they have to defend it.


I've just been wondering, what is the time that passes between one moment to another.  Lets take an example that we have a single light source, so small that it emits only a single, constant beam of light in only one direction. This beam hits a plane at a 90° angle. We are observing the dot that forms on this plane (like a laser dot). Now the light source starts moving in a single line with a set speed. Lets say to the left.  We are now observing the dot which moves. Since the light from the light source is pointing in only one direction and it is created at the light source at every moment, when does the light change from position 0, to position 0 + 1Left?  As far as I see it even if this goes down to infinite there must still be a moment there somewhere where the dot was at 0 and then suddenly at 0 + 1Left.  Does this make any sense?

Is the spacetime continuous or discrete? Or better, is the 4-dimensional spacetime of general-relativity discrete or continuous? What if we consider additional dimensions like string theory hypothesizes? Are those compact additional dimensions discrete or continuous?   Are there experimental evidences of continuity/discreteness?  When particles move inside space do they occupy spacetime by little chunks? What would imply if spacetime is discrete on continuous theories?  I've found little information on the web and books.  Probably my question is ill-posed and I apologize for this.


So I am trying to get my head around the concept of a dual basis. I think I have an okay idea of it, but my problem lays at finding a dual basis given a basis $B$. So I have given that $B = ((2,1),(3,1))$, which is a basis for $V=\mathbb{R}^2$. Then, apparently, $B^*=(-1x_1+3x_2,x_1-2x_2)$ is an ordered dual basis for $B$.  I know that given a vector $\textbf{x} \in V$  we can get the function $\phi_k(\textbf{x})=([\textbf{x}]_B)_k$ (evaluating it's coordinates in the basis B and taking the coefficient that corresponds to the k-th position). If we then take $B^*=(\phi_1,\phi_2)$, we have an ordered dual basis to $B$.  However, I don't understand how we can compute $\phi_1$ in such an instance, like is done in the example I've given. Could anybody help me out?  Thanks,  K. Kamal

Let $\beta= \{ (2,1),(3,1) \} $ be an ordered basis for $\Bbb R^2$. Suppose that the dual basis of $\beta$ is given by $\beta^*= \{f_1,f_2 \} $ To explicitly determine a formula for $f_1$ we need to consider the equations $$1=f_1(2,1)=f_1(2e_1+e_2)=2f_1(e_1)+f_1(e_2)$$ $$0=f_1(3,1)=f_1(3e_1+e_2)=3f_1(e_1)+f_1(e_2)$$ Solving this equations, we obtain $f_1(e_1)=-1$ and $f_1(e_2)=3$, that is $f_1(x,y)=-x+3y$.   My question is why do we need to solve the above equations for 1 and 0 respectively?


I have saved a style as qml file. I try to set the style for a raster layer in python directly. For this, I use function "loadNamedStyle". After the call, the color themes are updated in my model but the description text under the raster layer is still not updated. My question, how can I refresh the information?

When I change symbology for a given QgsVectorLayer (QGIS 2.14.16 LTR) by  r=iface.activeLayer().rendererV2() r.symbol().symbolLayers()[0].setColor(0,0,255,255)   as shown here:    and refreshing the map content by  iface.mapCanvas().refreshAllLayers()   I get the expected result, but the Layer Tree does not update as shown here:    What am I missing, and how can I update the Layer tree from PyQGIS programmatically?


Which is the best stack site to ask this question:  Which is the good yet economical (or free) OCR SDK tool to convert Arabic text from scanned card images?

Where in Stack Overflow can I ask, which software is best suitable for specific purpose? For example, a good software which is free for fashion related. The application should be able to show a preview how a person looks in different hair styles and eyeglass frames etc.


Many years ago I saw a movie that featured a very cool vehicle which was referred to as "wasteland winnebago," I think. It vehicle didn't look like a winnebago at all. It looked more like a high-speed train or military airplane, with a flat pointy nose and a grey fuselage-shaped body, maybe 7-10 meters long. Its body had two   and its big rubber wheels were arranged in triangles .   The movie could easily have been made in the 70s or early 80s. (I wonder if it might have been an episode of a series; I have no recollection of its length.) I think it plays out after a nuclear war; at least, the world seems completely deserted save for a few outposts, and the world is full of threats like elephant-sized scorpions.  I saw in a R/C hobby magazine once that somebody had built a scale replica of the vehicle. That might have been in the very late 80s, probably .  I'd love to know what that movie was!

I don't know why this is driving me so crazy. I only saw the ending, and the most memorable thing about it was how bad the special effects were. I think I'm wondering whether the plot makes any more sense if you watch the whole movie.  Anyway, there was this military-survivalist-type guy, a woman, and a teenage boy. The survivalist guy has this vehicle that looks like a cross between a camper van and a bullet; it's designed to withstand the imminent global flood that apparently only these three are expecting and no one else is aware of.  There was some weird name for the vehicle, but I forget what it was, "The __ _ _ __" I think it had four syllables, possibly ending in "er". They got into it on dry land, and the flood waters rose around them, apparently miles deep.  External shots of the vehicle showed it tumbling end over end, but internal shots just showed some mild jostling and the three of them just standing there looking bored. Maybe it had artificial gravity?  Anyway, the miles-deep flood waters recede (the impression I got was that in-world, the flood lasted maybe fifteen minutes, if that.) They find themselves on dry land, I think on some sort of college campus, with all the buildings intact.  They pick up some music on the radio, and then the (young-female-sounding) DJ comes on, gives her location, and then says she's pausing the broadcast to allow for incoming signals from other survivors. It's all very matter-of-fact, like civilization-destroying flash-floods happen all the time. She apparently safely rode out the flood in the college's radio studio.  Military-guy tries to take charge of the situation, and responds to the radio-signal, but teenage-boy is very excited to hear the woman's voice and jumps on a bike and heads off to meet her as soon as she gives her location. Roll credits.  I don't think survivalist-guy and teenage-boy got along very well, but I didn't see enough of their interaction to say for sure.  I saw (the ending of it) on television in either the late eighties or the early nineties. I don't recall there being anything that indicated for sure whether it was a newish movie or an older one, so I'm not sure when it was made.


I have a function basically to convert an excel file to text file. The structure is like following. What I am concerned is the Finally part? Is it a best practise to kill the excel?   Excel.Application excel=new Excel.Application(); Excel.Workbook wb=excel.Workbooks.Open(…);  Try  {    …    Foreach(Excel.Worksheet sheet in wb.Sheets)    {       …       Marshal.RealseComObject(sheet);    }    … }  Catch() { }  Finally {    wb.Close(false, missing, missing);    while (Marshal.ReleaseComObject(wb)!=0)    {    }    wb=null;    excel.Quit();    while (Marshal.ReleaseComObject(excel)!=0)    {    }    excel=null;    GC.Collect();    GC.WaitForPendingFinalizers(); }   Update:  I have following version of Finally  Finally{ wb.close(false, missing, missing); excel.application.quit(); excel.quit();  Marshal.ReleaseComObject(wb); Marshal.ReleaseComObject(excel); GC.Collect(); GC.WaitForPendingFinalizers(); }   Which one is better (make more sense)? I have checked all the links here, but there is no finally answer, everybody's answer is sightly difference. I am not sure which one is the best?

I'm using the Excel interop in C# (ApplicationClass) and have placed the following code in my finally clause:  while (System.Runtime.InteropServices.Marshal.ReleaseComObject(excelSheet) != 0) { } excelSheet = null; GC.Collect(); GC.WaitForPendingFinalizers();   Although this kind of works, the Excel.exe process is still in the background even after I close Excel. It is only released once my application is manually closed.  What am I doing wrong, or is there an alternative to ensure interop objects are properly disposed of?


(sorry if I get some of the terminology wrong, English is not my native language)  In Dutch we have the convention to place a comma between two verbs if they are not part of the same verb phrase. I was wondering if the same convention is used in English.  Here is an example:     How well the species adapted, remained unknown   This rule is not specifically mentioned on the websites that I checked, but I am also unsure if in Dutch this is the actual rule, or just some sort of mnemonic aid.

In the sentence     What’s funny is Cat’s dry humour.   Wouldn’t it be better to put a comma after “funny”:     What’s funny, is Cat’s dry humour.   This question entails a (at the time of writing) heated discussion in the .


For an arbitrary $x_{0}$ in $\left(\, 0,\pi\,\right)$ we define $x_{n + 1}=\sin\left(\, x_{n}\,\right)$.  Using the limit of the sequence as $n$ tends to infinity we're supposed to find the limit of $\,\sqrt{\,n\,}\,\sin\left(\,x_{n}\,\right)$  .   I literally don't know where to start, any ideas ?.

Consider the sequence defined as  $x_1 = 1$  $x_{n+1} = \sin x_n$  I think I was able to show that the sequence $\sqrt{n} x_{n}$ converges to $\sqrt{3}$ by a tedious elementary method which I wasn't too happy about.  (I think I did this by showing that $\sqrt{\frac{3}{n+1}} < x_{n} < \sqrt{\frac{3}{n}}$, don't remember exactly)  This looks like it should be a standard problem.   Does anyone know a simple (and preferably elementary) proof for the fact that the sequence $\sqrt{n}x_{n}$ converges to $\sqrt{3}$?


I'm working with a structural equation model to study influenza infection risk. As age is a known risk factor to explain infection, I therefore adjusted my infection outcome on the subjects age class. After regressing my outcome on several latent variables, the age class is not significant anymore. My question is : should a non-significant adjustment variable be kept in a (structural) regression model or removed ?

I have several covariates in my calculation for a model, and not all of them are statistically significant.  Should I remove those that are not?  This question discusses the phenomenon, but does not answer my question:   There is nothing in the answer to that question that suggests that non-significant covariates be taken out, though, so right now I am inclined to believe that they should stay in.  Before even reading that answer, I was thinking the same since a covariate can still explain some of the variance (and thus help the model) without necessarily explaining an amount beyond some threshold (the significance threshold, which I see as not applicable to covariates).  There is another question somewhere on CV for which the answer seems to imply that covariates should be kept in regardless of significance, but it is not clear on that.  (I want to link to that question, but I was not able to track it down again just now.)  So...   Should covariates that do not show as statistically significant be kept in the calculation for the model?  (I have edited this question to clarify that covariates are never in the model output by the calculation anyway.)  To add complication, what if the covariates are statistically significant for some subsets of the data (subsets which have to be processed separately).  I would default to keeping such a covariate, otherwise either different models would have to be used or you would have a statistically significant covariate missing in one of the cases.  If you also have an answer for this split case, though, please mention it.


I found this very amusing comic on the internet the other day:   The last frame seems to claim that the harmonic series converges if you throw out all the terms with a $9$ in the denominator. Is this true? Where could I find a proof? Is it only true for terms with a $9$ or is it true for any number? If it's only true for $9$, why is that?

I know that the harmonic series $1 + \frac12 + \frac13 + \frac14 + \cdots$ diverges. I also know that the sum of the inverse of prime numbers $\frac12 + \frac13 + \frac15 + \frac17 + \frac1{11} + \cdots$ diverges too, even if really slowly since it's $O(\log \log n)$.  But I think I read that if we consider the numbers whose decimal representation does not have a certain digit (say, 7) and sum the inverse of these numbers, the sum is finite (usually between 19 and 20, it depends from the missing digit). Does anybody know the result, and some way to prove that the sum is finite?


I was learning Set Theory for fun and I came across something called the axiom of Choice,   What is the axiom of choice?

Would someone please explain:   What does the Axiom of Choice mean, intuitively? What does the Axiom of Determinancy mean, intuitively, and how does it contradict the Axiom of Choice?   as simple words as possible?  From what I've gathered from the Wikipedia page, my understanding is that the Axiom of Choice pretty much lets you make a completely random decision, i.e. equal probability for everything. I don't, however, understand what they're talking about regarding the sets of sets (is it more than what I just described?), and I further don't understand the Axiom of Determinancy.  Info on those would be appreciated. :)


Generally, the mass of a body is defined as the amount of matter contained in it. But we also know from relativity that "mass of a body increases as it approaches the speed of light". Going by the old school definition mentioned above, this really doesn't make sense. Like, how can the amount of matter increase?  So what I have come up with, is that mass can be defined as net force/acceleration for a given velocity with respect to an inertial frame. Can you please tell me if it is correct, and can you please help me improve this definition(assuming it's correct in the first place)

Some people say that mass increases with speed, some people say that the mass of an object is independent of its speed.  I understand how some (though not many) things in physics are a matter of interpretation based on one's definitions. But I can't get my head around how both can be 'true' is any sense of the word.  Either mass increases or it doesn't, right?  Can't we just measure it, and find out which 'interpretation' is right? e.g.: (in some sophisticated way) heat up some particles in a box and measure their weight?  ------------------------------  UPDATE  Right, so I've got two identical containers, each with identical amounts of water, each on identical weighing scales, and each in the same g field. If one container has hotter water, will the reading on its scale be larger than the other? If the answer is yes, and g is constant, does this mean that the m in w=mg has got bigger?


Show that, in all bases $n$ greater than $3$, the number written as $1331$ is a perfect cube.  I was given this question to do and sadly I have no idea where to even begin. Any help will be appreciated:)

Prove that the number $14641$ is the fourth power of an integer in any base greater than $6$?  I understand how to work it out, because I think you do   $$14641\ (\text{base }a > 6) = a^4+4a^3+6a^2+4a+1= (a+1)^4$$  But I can't understand why they had to specify that the base is greater than 6? Is that because if it's 4, then 4 will be cancelled out in the equation and if it's 6, it will be too?   Please advise.  Sorry for asking such a trivial question.


It would be very convenient and useful to be able to be alerted by a notification sound when a question or answer has been replied to or commented on in one of the open tabs in my browser!   Does such a feature exist? If so, how do I enable it?!

I was thinking whether it is possible to have some animation on Stack Overflow.  For instance, if a message comes then there should be a beep sound so that users can be alerted. I know that presently notifications are shown in red on the global inbox to mark its presence, but, if user is on some other tab or browser, then it is quite possible that he/she may not reply for quite a bit of time.   I thought by this way the comments can easily seek some attention quickly!


I want to copy an object via python from one scene to another.  Scene with the object:   Scene where i want to copy it to:

I'm searching a way to append a group in Python.  It should behave exactly like the Append function (ShiftF1) works, all objects should be local and editable. The idea is to append a character (with rig etc.) via Python and not Link it (to be able to modify it without making everything local one by one).  Thanks


I read a few of the questions suggested to be similar, but I didn't see what I am looking for. Please feel free to point me in the right direction if I just missed it... (there are quite a few).        I am in my mid 30s and never went to college. My understanding is largely from various YouTube sources.    There is one thing I don't understand about entanglement and I can't find any videos that explain it.         If I spin a coin on a table, shoot it with a gun dead center and the coin breaks perfectly into two smaller coins... and the split pushes the coins into spinning in opposite directions of each other... and this was all on a big magic friction-less table that allowed them to spin away from each other until they were a mile away from each other... I could look at one and see that it was spinning clockwise and instantly know that the other coin is spinning counter clockwise without those coins having to communicate faster than light.             I know I'm just some pleb stuck thinking from an intuitive state of mind... but I'm open to expanding that... I just don't understand why entanglement isn't just two objects being in sync because they were created in sync or were synced up at some point. Can anyone explain why this isn't the case?

Bearing in mind I am a layman - with no background in physics - please could someone explain what the "big deal" is with quantum entanglement?  I used to think I understood it - that 2 particles, say a light-year apart spatially, could affect each other physically, instantly.  Here I would understand the "big deal".  On further reading I've come to understand (maybe incorrectly) that the spatially separated particles may not affect each other, but in knowing one's properties you can infer the other's.  If that it the case, I don't see what the big deal is... 2 things have some properties set in correlation to each other at the point of entanglement, they are separated, measured, and found to have these properties...?  What am I missing? Is it that the particles properties are in an "un-set" state, and only when measured do they get set?  (i.e. the wave-function collapses).  If this is true - why do we think this instead of the more intuitive thought that the properties were set at an earlier time?


When deploying any application, it could be needed, that user has computer updated to latest OS version of Windows. Windows XP/Win7/Win8.  in this example, one important update is available on a Windows 8 system. .  in this example, 15 important updates are available on Windows 7 system. . How to get information if any important Windows update is available on this computer? I found a way how to get a specific KB patch:  But I don't have a list of each OS system and each KB and just want to know if any update is available. If no internet connection is available, don't care about it. I also found  but could not imagine how that should solve my situation. How to find out if more than zero important (not optional) updates are available?

If a Windows server (2k3/2k8) is set to "download but not install" updates, is there a way to check from the command line.. perhaps a log file or something I can check with powershell, to see if there are any updates actually waiting to be installed? I'm trying to prevent having to manually log on to each server to check, even though they want the "trigger" pulled manually. We have an automation system in place I can use (CA Autosys) - just not sure what to have it look for.


public class VendorAdapter extends RecyclerView.Adapter<VendorAdapter.MyViewHolder> {  private List<Vendor> vendorList;   public class MyViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {     public TextView name, rating, address;     RelativeLayout rl;     Context con;      public MyViewHolder(View view) {         super(view);         name = (TextView) view.findViewById(R.id.tv1);         address = (TextView) view.findViewById(R.id.tv2);         rating = (TextView) view.findViewById(R.id.txtstar);         rl=(RelativeLayout)view.findViewById(R.id.parentLayout);         itemView.setClickable(true);         itemView.setOnClickListener(this);     }      @Override     public void onClick(View v) {         Intent intent = new Intent (v.getContext(), StartActivity.class);          con.startActivity(intent);      } }   public VendorAdapter(List<Vendor> vendorList,Context con) {     this.vendorList = vendorList;  }  @Override public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {     View itemView = LayoutInflater.from(parent.getContext())             .inflate(R.layout.list_layout, parent, false);      return new MyViewHolder(itemView); }  @Override public void onBindViewHolder(MyViewHolder holder, int position) {     Vendor movie = vendorList.get(position);     /*holder.name.setText(movie.getTitle());     holder.address.setText(movie.getGenre());     holder.rating.setText(movie.getYear());*/ }  @Override public int getItemCount() {     return vendorList.size(); }   }  Unable to startActivity from Recycler View Adapter  I want to open same activity on every item click of recycler view,but the way i am doing it,i am getting NULL POINTER on this line-con.startActivity(intent); Please help me with this. ##

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?


my partner and i share a computer (windows 7) and have just one user profile, so we don't have to log in and out all the time, can we both install dropbox and have two different dropbox folders for two different dropbox accounts on the same user profile?

Can Dropbox be used with multiple accounts on one computer?


Recall that an ideal $I$ of a commutative ring with identity $R$ is called regular if it contains a regular element. An element of $R\setminus Z(R)$ is said to be regular, where $Z(R)$ denotes the set of zero divisors of $R$. Also, an ideal $I$ is faithful if $(0):I=(0)$.     There is a well-known fact that: In a Noetherian ring, every faithful ideal is regular. But I can't prove it.

Lately I've been thinking to annihilator of modules and I've conjectured  a proposition I can't prove, so I'll expose my claim.     Let $A$ be a noetherian reduced (commutative) ring and let $M$ be a faithful finitely generated module on $A$. Is it true that there exists an element $m \in M$ such that $\operatorname{Ann}(m)=0$?


I've flagged a post about 2 days ago and on my flag summary it now has an orange "active" mark.     Any insights on what this is?

My flagging summary page displays "active" for a particular flag that seems to be not actioned yet. What does that mean?


I'm trying to code a spellchecker using a hashtable of dictionary words. I'm currently trying to compare  words from a text document to a value in the hash table to see if it's spelled correctly, but no matter what I do, the containsValue() method always returns false even when I know it's not.   public class SpellChecker {      private Hashtable<Integer, Wrapper> words;     private ArrayList<Wrapper> parsedFile;      SpellChecker() {         words = new Hashtable<Integer, Wrapper>();         parsedFile = new ArrayList<Wrapper>();     }      public void createDict(String inputFile) throws IOException {         FileReader input = new FileReader(inputFile);         BufferedReader bufRead = new BufferedReader(input);         String myLine = null;         int i = 0;         while ((myLine = bufRead.readLine()) != null)         {                Wrapper my_line = new Wrapper(myLine);             words.put(i,my_line);             i++;         }         bufRead.close();     }      public ArrayList<Wrapper> readFile(String inputFile) throws IOException {         FileReader input = new FileReader(inputFile);         BufferedReader bufRead = new BufferedReader(input);         String myLine = null;         Wrapper[] array_file;          while ((myLine = bufRead.readLine()) != null)         {                String[] arrayFile = myLine.split(" ");             for (int i = 0; i < arrayFile.length; i++) {                 array_file = new Wrapper[arrayFile.length];                 arrayFile[i] = arrayFile[i].toLowerCase();                  Wrapper my_line = new Wrapper(arrayFile[i]);                 array_file[i] = my_line;                 parsedFile.add(array_file[i]);             }         }          bufRead.close();         return parsedFile;     }      public ArrayList<Wrapper> getParsedFile(){         return parsedFile;     }      public ArrayList<String> checkMisspellings() {         ArrayList<String> misspelled = new ArrayList<String>();          for (int i = 0; i<parsedFile.size(); i++) {             if (!words.containsValue(parsedFile.get(i))) {                 misspelled.add(parsedFile.get(i).backToString());             }         }         return misspelled;     } }   I looked at some answers online that said it might be because containsValue() compares addresses, so I made a wrapper class for the String values but it still isn't working.  public class Wrapper {      public String x;      public Wrapper(String x){         this.x=x;     }      public String backToString() {         return x;     }      public boolean equals(Object o) {    if(o == null) return false;    if(!(o instanceof Wrapper)) return false;    final Wrapper p = (Wrapper) o;    if(p.x.equals(this.x)) return true;    return false; }      @Override     public int hashCode() {       int hash = 3;       hash = 53 * hash + x.length();       return hash;     } }   the misspelled arrayList is supposed to only contain words that aren't found in the hashtable, but it always just returns all the original words. What am I doing wrong?? Here's some sample input/output:  input: hellos my name Ann corral mlks please spell correct  output: [��hellos, my, name, ann, corral, mlks, please, spell, correct, ]   the text file I'm using for the dictionary looks something like this:  corralled corralling corrals correct correctable corrected correcter correctest correcting

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


I have seen a couple guides that spoke about uninstalling ubuntu and have tried following the guides provided in AskUbuntu.  I have installed Ubuntu 14.04.1 LTS from an usb drive and have chosen to install it on same drive/partition.  I then have tried to remove ubuntu first under the windows uninstall programs screen. The ubuntu logo was on there, however when I clicked on it to install it errored out and states that this program is not available. After that the icon disappeared.  After that I did a search on the C drive for ubuntu items and folders and saw the wubi uninstalled. I ran that program, and if finished successfully. However, when I restarted my laptop the ubuntu start-up menu still appeared and asked if I wanted to run either ubuntu or windows partition like earlier.  Is it possible to completely remove Ubuntu from Windows 7 using an ubuntu usb stick (same process that I used to install Ubuntu side by side with Windows 7) and if I can would that affect windows 7.  Also I have seen OS-Uninstaller mentioned in some of the other guides. Would that be risky if you are trying to remove Ubuntu OS while also logged into Ubuntu OS?  Thank you for your help.

A few months I decided to install Ubuntu 12.04 on my PC alongside with my Windows 7 partition. In order to do that and avoid any mistake, I followed the steps of  tutorial.  Everything was going well until I decided to update to the 12.10 release. I don't know what happened, but after I updated my Ubuntu, it stopped working, it didn't even launched, when I turned on my PC and choose to run "Ubuntu 12.04" on the Grub Screen, a weird messaged appeared.  Well, so I decided to install the Ubuntu 12.10 and forget about the 12.04 partition, no problem.  I erased the partitions used for the Ubuntu 12.04 with EaseUS partition Manager.   However, when I start my PC, there is still the option of "Ubuntu 12.04" to chose, is that bad?  And what about now, can I use the  of Ubuntu to install the Ubuntu 12.10 ? What should I do to have Ubuntu 12.10 and Windows 7 in dual boot again?


I am building a scorecard where I will have overall score depicted inside a circle in the middle of a screen while the details would be in the next row.  I am using bootstrap 3 and here is my code below  <!doctype html>              <meta charset="utf-8">     <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">           <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">      <title>Utora Scorecard</title>

             57

                   Here is how it looks in the browser    Now I want this circle to be in middle of the screen but unable to do it.  I tried using text-center, center-block, margin-left etc on the div but nothing worked. How can I center the circle such that even though the browser size changes, it remains in the center?

How can I horizontally center a
 within another
 using CSS?

Foo foo


What I want to write is an application that would be able to access my USB port.  To control when to charge my phone and when not to. And perhaps with time I would like to extend the application to control light bulbs, fans and the television in my room.   I want to learn how to work this out rather than just copy some line of codes and paste. I wish for a quick and very simplified tutorial on this, I would be highly grateful (small language please, You all know am still learning :-)).   The exact job I want to achieve is just to make the port send out power when needed. That is it should be switched off and on using codes if possible.

I would like to power cycle an USB device through software on Windows.  I am doing development on a small USB power microcontroller. This chip will revert to native behavior on a power cycle and allow a code download.  Since my code will crash the device when things go wrong -- making it ignore all USB commands -- I have to physically unplug the device from the system.    I want to do development remotely, and not have to be physically present.     So far I have tried using "devcon" to disable portions of the USB stack. While this takes the hubs into D3 (should be powered off!), there is still power being supplied to the device.    Are there any preexisting solutions or SetupAPI tricks that might help?


My program is getting compiled and executed without any errors and halfway through my program the error is being shown. I checked the code and it seemed to have a problem with the following part of the code:  student s[]=new student[10]; report(student s1[]) {     this.s=s1; } String highmath() {     int temp=s[0].math;     String name=s[0].sname;     for(int i=0;i<s.length;i++)     {         if(s[i].math>temp)         {             temp=s[i].math;             name=s[i].sname;         }     }     return name; }   Error exception in thread main java.lang.NullPointerException at report.highmath(stdapp.java.40)


Let $E$ be a measurable subset of $R$ of positive lebesgue measure. Define the set $K$ by $K = {s + t: s \in E, t \in E}$  Prove that $K$ has nonempty interior.  I tried to prove it by contradiction. By measurability we can assume that $E$ is contained in an open set and with difference of measure at most $ε$. But I only can find countably many points not in this open set and can't conclude a contradiction.

This is a question from Stromberg related to Steinhaus' Theorem:     If $A$ is a set of positive Lebesgue measure, show that $A + A$ contains an interval.   I can't quite see how to modify the Steinhaus proof though.


Recently my student visa for Canada was refused and I lost the refusal letter. I paid 25% of the fee to the college. Now they are asking for refusal letter to initiate the refund process. Please help me with this situation. It’s a huge amount. If I don’t get it back it will be a big problem for me. Please help to get the letter.

I have applied for a Canadian Temporary Resident Visa (TRV); a previous paper application was refused in 2016. I have lost the copy of my refusal letter and want to submit it when I apply for my new visa. How how can I get the a copy of the 2016 refusal letter from Embassy?


I have something strange and can't figure it out by myself. I have 2 maps in my saves that I can't open. I have played on them, but one time they where gone so I searched for them in the Minecraft folder, and found them. There was nothing strange with them, so I don't really get it. Does anybody have an idea about what's wrong?  EDIT: Mrlemon is right, I found them in the map but can't open them in Minecraft itself. I compared the 2 maps with one that I can open in Minecraft (and see) but don't see a difference in between those. Here are some screenshots of it.  My world:   World that I can't see:

I was playing on my main world when my laptop ran out of power.  I found a charger and woke it up, but Minecraft had crashed.  Now, it doesn't appear in the world selection screen!  I have verified that it still exists in the Minecraft folder, and the directory contents look to be in order.  Does Minecraft save an internal flag somewhere when it crashes hard?  If so, how do I reset it?


What would be a good standard for helpful flags? If 95%+ of your flags are deemed helpful is that good? or should it be higher?

Is there any way to know how useful are the flags of a user? I read that flagging - weights used to exist (were visible) before, which would indicate this. However, what indicator is there now?  Is percentage of accepted flags a good measure of useful flagging, so to say? If yes, then what percentage would indicate that a user is flagging correctly or in a useful way?  I am asking about interpreting the numbers in terms of how useful you are. Is a 80% good or a 90% good? Or does the percentage even matter?     contains some explanation regarding the issue.


A while back I asked this question:    Essentially, I want to highlight my name in the publications portion of my CV. I got a good answer from my previous question which included this line:  \ExecuteBibliographyOptions{maxnames=99,firstinits}   which converts all the author names to first initials plus a last name.   There was one caveat that is now coming to bite me:     If your name is consistently formatted in the bib file...   My name is not consistently formatted in the bib file. Sometimes it is Jeremy Lloyd Conlin other times it is J. L. Conlin and still J. Conlin.  I want to bold all of my names while keeping the original name, i.e., I don't want the author names reduced to first initials and last names. Is this possible?

I am writing my CV in LaTeX. I am using biblatex and want my name (and only my name) to be bold for every reference. Is there a magic way to do this?  A similar question  was asked, but that answer used BibTeX. While I use the BibTeX backend, I use biblatex.  Any suggestions?


when in the terminal it is showing the full path of the working directory which can take up most if not all of the screen width. How do I change it so that it only shows the name of the current directory?

Currently it is:   michael@Castle2012-Ubuntu-laptop01:~/Dropnot/webs/rails_v3/linker/spec/controllers$   Outside of renaming my machine and directory structure...  How could I make it be something more like:  michael:controllers$


I want to integrate one logo in picture which is uploaded from user before to send it to the server. I want to edit picture not just to show the pictures one over other. Is there any way to do it? Thanks.

Is it possible to dynamically create and modify images on a per pixel level in JavaScript (on client side)? Or has this to be done with server based languaged, such as PHP?   My use case is as follows:   The user opens webpage and loads locally stored image A preview of the image is displayed The user can modify the image with a set of sliders (pixel level operations) In the end he can download the image to his local HDD   When searching in the web I just found posts about using IE's filtering method, but didn't find anything about image editing functions in JavaScript.


\usepackage{algorithm} \usepackage{algorithmic} \begin{document} \begin{algorithm}[H] \caption{My algo} \begin{algorithmic}[1] \STATE instruction 1 \STATE instruction 2   ......................Many instructions \end{algorithmic}  \end{algorithm} \end{document}   My algorithm occupies an entire page, is that it is possible to divide it on two pages? Thank you so much.

I am writing a few rather large pseudocode functions using algorithm and algorithmic, i.e. my code looks something like:  \begin{algorithm}                      \caption{Coolest Algorithm ever}           \label{findme}                           \begin{algorithmic} [1]                   % enter the algorithmic environment \REQUIRE    Here are a few variables \\             variable 2 \\             variable 3  \ENSURE     this is the output \\             output 2  \STATE $some cool code here$ \STATE $some cool code here$ \STATE $some cool code here$ \STATE $some cool code here$ \end{algorithmic} \end{algorithm}   Unfortunately this code does not fit on one page and I am definitely not able to split it into some subfunctions or so (I already did that as far as possible).  So now I need to split up the algorithm into two pages, but I have no idea how.  The easiest way I can imagine is just to start a new algorithm on the new page, but this time letting the line counter start at line 35 or so instead of 1. But how can I do that?  Please not that there is already a similar question here on this site, but it deals with the package algorithmicx.


I'm making a loop to see how many calories will be burned every 5 minutes (starting at 10 minutes) and ending at 30 minutes.     x = 30     cals = 0     mins = 0      while x > 0:              x -= 5     mins += 5     cals += 4.2     strcals = str(format(cals, '1'))     if mins > 5:         print(f"After {mins} minutes, you have burned {strcals} calories")  When I run this program, it works just fine. My loops work for finding the amount of calories burned per minute and it ends at 30. However, once I reach 15 minutes something weird happens in the output After 10 minutes, you have burned 8.4 calories After 15 minutes, you have burned 12.600000000000001 calories After 20 minutes, you have burned 16.8 calories  Can someone explain why I get this output from my program at 15 minutes? What can I do to fix it?

I want a to be rounded to 13.95.  >>> a 13.949999999999999 >>> round(a, 2) 13.949999999999999   The  function does not work the way I expected.


I'm making a page with latin accents like á, ã, ç, and others. This site pulls data from a SQL database. I'm using this on the <head>: <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"/> With this header the HTML accented characters are fine, but the SQL data is being displayed as Ã§Ã£instead of ão, and if I change the charset from ISO-8859-1 to UTF-8, all the HTML accented characters are displayed by a � (question mark) and the SQL data shows accents just fine. Is there any way to fix it besides escaping either all the HTML characters or the SQL ones?  PS: I've already tried mysql_set_charset('utf8'); and SET NAMES utf8, neither worked to me.

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.


Basically, no sound is coming out the television. I'm running out of idea of why?  Viewing the PulseAudio control panel, it's putting sound out the HDMI    Alsamixer is not mute    The Television is not mute. I booted into Windows and the audio out the HDMI works fine.     Debugging Info:  Basics   Xubuntu 13.10 Linux desktop 3.11.0-15-generic #25-Ubuntu SMP ATI 4870   lshw -c video     description: VGA compatible controller    product: RV770 [Radeon HD 4870]    vendor: Advanced Micro Devices, Inc. [AMD/ATI]    physical id: 0    bus info: pci@0000:01:00.0    version: 00    width: 64 bits    clock: 33MHz    capabilities: vga_controller bus_master cap_list rom    configuration: driver=radeon latency=0    resources: irq:44 memory:d0000000-dfffffff memory:feae0000-feaeffff ioport:c000(size=256) memory:feac0000-feadffff   aplay -l     **** List of PLAYBACK Hardware Devices ****    card 0: SB [HDA ATI SB], device 0: ALC887-VD Analog [ALC887-VD Analog]      Subdevices: 0/1      Subdevice #0: subdevice #0    card 0: SB [HDA ATI SB], device 1: ALC887-VD Digital [ALC887-VD Digital]      Subdevices: 1/1      Subdevice #0: subdevice #0    card 1: HDMI [HDA ATI HDMI], device 3: HDMI 0 [HDMI 0]      Subdevices: 0/1      Subdevice #0: subdevice #0   sudo speaker-test -c 2 -r 48000 -D hw:1,3     speaker-test 1.0.27.1     Playback device is hw:1,3    Stream parameters are 48000Hz, S16_LE, 2 channels    Using 16 octaves of pink noise    Playback open error: -16,Device or resource busy

My PC has a build-in VT1828S chip. The connection between PC and monitor (which has built-in speakers) is through an HDMI cable.  Audio preferences shows 2 devices for audio output: analog stereo and RS880 Audio Device [Radeon HD 4200] digital stereo (HDMI).  When I plug a headphone in the rear jack and I choose the former device, everything works. When I choose the latter device, instead, no sound is heard, and video playback is too fast. It is as if video frames want to synchronise with the audio timing, but the audio timing information is wrong.  HDMI audio worked perfectly with Ubuntu 11.04, but stopped after 11.10 upgrade.


In recent times, in movies and television shows when someone is stabbed or shot or injured in any other way the blood coming out of their body seems very real in terms of its the color, viscosity, and the speed at which comes out of the body.   What all techniques, mechanisms/equipments, and materials/chemicals are used for this purpose?  Has there been a time where real blood is used to give it a real-life look/effect? (Sounds creepy I know)

I always wondered what kind of blood is used in movies. I thought it could be from animals or color or least possibly human blood which I am sure will not be legal. I ask because in a lot of movies actors spit blood from their mouths. If it is blood, then how do they do it?


Not a particularly complex question but I'm looking for a efficient/clean way to generate all possible permutations of tuples.  For example, given a size value (ex. 3) for an n x n grid.   (1,1) (2,1) (3,1) (1,2) (2,2) (3,2) (1,3) (2,3) (3,3)   I'd like to generate comparisons between rows and columns.  So for rows, comparisons would go as (1,1) vs (2,1), (1,1) vs (3,1), (2,1) vs (3,1) ... (1,2) vs (2,2), (2,2) vs (3,2) ... etc  And for columns, comparisons would go as (1,1) vs (1,2), (1,1) vs (1,3), (1,2) vs (1,3), .. (2,1) vs (2,2), (2,1) vs (2,3), (2,2) vs (2,3) ... etc  Does anyone know of an easy way to generate each pair of tuples? I'd like to pass the two tuples from the comparison into a separate function (tuple1, tuple2). Got an idea but it uses multiple for loops and seems inefficient. Assistance would be appreciated.

How do you generate all the permutations of a list in Python, independently of the type of elements in that list?  For example:  permutations([]) []  permutations([1]) [1]  permutations([1, 2]) [1, 2] [2, 1]  permutations([1, 2, 3]) [1, 2, 3] [1, 3, 2] [2, 1, 3] [2, 3, 1] [3, 1, 2] [3, 2, 1]


I am using Contacts OSX and iOS app's and they both synced into iCloud and I have opened them to check if the contacts are the same on my phone and Mac and they are.  However when I receive an iMessage or Text message in Messages OSX it doesn't recognise the number even though that number is saved in Contacts.

Since updating to Mavericks the Messages app doesn't display the contact names for people I've been communicating with iMessage, it shows their phone number instead. My messages thankfully still stay synced between my iPhone and Messages on Mavericks.


I am new to coding, so I am simply trying to create a function that allows the user to create a two-dimensional array by specifying the number of rows and columns and the content of the array elements. The function is supposed to return the array through an array of pointers, and later in main(), I call the function and display the contents of the array with a for loop. When I run the application, the function appears to run correctly but the contents of the array is not displayed. The process returns "-1073741819 (0xC0000005)". What does this error mean and how do I solve it? Moreover, are there any cleaner and more effective ways to return an array from a function? Also, I think the issue is in the for loop in main() because I commented it out and the process then returned 0.  void CreateArray(int **ptr2ptr) { cin >> rows; cin >> columns;  int TheArray[rows][columns];       //fill array for (int i = 0; i < rows; i++)  {         cout << "Enter values for row  " << i +1 << ":" << endl;      for (int k =0; k < columns; k++)     {         int x;         cin >> x;         TheArray[i][k]= x;     }  }     int *array4ptrs[rows*columns];     array4ptrs[rows * columns] = new int[rows*columns];      // fill array of pointers     for (int c=0; c< (rows * columns); c++) {        array4ptrs[c] = TheArray[c];     }  ptr2ptr = array4ptrs; }  int main() {      int **MyPtr2Ptr; CreateArray(MyPtr2Ptr);   for (int z = 0; z <sizeof (MyPtr2Ptr); z++) {         cout << *MyPtr2Ptr[z] << endl; }       for (int z = 0; z < sizeof (MyPtr2Ptr);z++) {     delete MyPtr2Ptr[z]; }  }

I know that the compiler will sometimes initialize memory with certain patterns such as 0xCD and 0xDD.  What I want to know is when and why this happens.  When  Is this specific to the compiler used?  Do malloc/new and free/delete work in the same way with regard to this?  Is it platform specific?  Will it occur on other operating systems, such as Linux or VxWorks?  Why  My understanding is this only occurs in Win32 debug configuration, and it is used to detect memory overruns and to help the compiler catch exceptions.  Can you give any practical examples as to how this initialization is useful?  I remember reading something (maybe in Code Complete 2) saying that it is good to initialize memory to a known pattern when allocating it, and certain patterns will trigger interrupts in Win32 which will result in exceptions showing in the debugger.  How portable is this?


According to the accepted answer to , downvoting answers to an obvious off-topic question is appropriate, with the purpose of not encouraging people in asking them.  Does this apply to obvious duplicate questions as well?  I came across this question:    Now, if you know a bit about the specific topic, you will also know that the status bar behavior change in iOS 7 generated a LOT of questions in the last couple of months.  The search query "[ios7] status bar" currently generates 585 results, all being pretty much about the same issue.  I feel like answering this kind of questions is not adding any value. Also I'm afraid the OP won't receive the message that they should put research effort before posting a question and in this specific case it's really trivial to find tons of useful information.  That being said, I also left a comment about this, liking to the search query above and marked the question as a duplicate. Nonetheless a few minutes later answers started to appear.  Is is appropriate to "punish" this answers by downvoting them, or should I just move on and hope that the question is closed soon?

It annoys me when people post answers to obviously off-topic questions like , especially after those questions have already received several close votes. Migrations seem to happen rather infrequently these days, so there's probably no reputation to gain for questions that are likely to be closed. And although sure, the answer may help the OP, it also encourages bad behavior (posting off-topic questions.)  Is it appropriate to downvote these answers?   Personally, I think I could make a case for both sides.


I'm developing a web map for my town. I made my own vector layers and, to avoid the too much "white", I decided to use as base layer OSM. The problem is that when I use the array of resolutions to set the zoom (in the other ways I'm not able to set the zoom) I get the cross-origin error. Here is the code of the osm layer I made:  var osm = new OpenLayers.Layer.OSM(              'OSM',              null,              { zoomOffset: 4, resolutions: [4.777314267158508, 2.388657133579254, 1.194328566789627, 0.5971642833948135], tileOptions: { crossOriginKeyword: null }}              );          map.addLayer(osm);   With this, by setting the origin keyword on "null", I don't get the cross-origin problem, but it doesn't load the tiles (error 404). If I remove the resolutions array, the tiles are loaded correctly, but then the zoom is not controlled and user is free to zoom to the whole planet. I'm using Openlayers 2.13.1 with IIS Express and Geoserver 2.5.2. Of course, I'm already using a proxy. Any suggestions on where this problem comes from and how to fix it?

Is it possible to enable  (CORS) in OpenLayers?  If so, how?  I have a web map in OpenLayers, and I'm using an HTML canvas to render it as a PNG image.  My script works great, but due to the browser's , I can only convert my canvas to an image if all the map tiles I've drawn to it come from the same host (e.g. sub.domain.com).  To boost my map's loading speed, I pull tiles from an array of subdomains: a.domain.com, b.domain.com, etc.  This greatly improves performance, working around the browser's limit of four simultaneous connections per host, but prevents me from ever converting my canvas to an image, as the tiles come from multiple hosts.  I'm trying to use  to work around this problem.  I've set the appropriate Access-Control-Allow-Origin response header for the tileset I serve with PHP, but this doesn't have an effect.  I suspect this is due to not having the Origin header in the request (as shown in the example on the Wiki page).  It would seem that some OpenLayers configuration is required.  But what?  Has anyone else done this successfully?


What if new users were given an initial rating of say, 300? instead of just 1? Then, based on their good/bad contributions we could assess their "true" reputation. The benefit is that if there is an average new user(non spammer) it would take them a lot of energy and time to get to their "true" reputation i.e get the privileges they deserve, and many privileges (like commenting, voting, editing) are locked for new users as well; so a provisional reputation might solve this problem. A question mark like in 300? would tell that the reputation is provisional, so that others know that the user is new. The question mark would go away after user gets more than 10 up/down votes on their posts.     I got this idea while I was playing chess on , which initially gave me a provisional rating of 1500?. I thought wouldn't this be a good idea for Stack Exchange?  More about provisional rating on Lichess .

Starters on Stack Overflow tend to lose interest as soon as their first question starts getting downvotes. Their first question also sometimes gets closed because it was either not framed properly or it missed some very common things.  There should be way to cope with this for instance give some starter bonuses to new users.


The R-method: If $R = \sqrt{a^2 + b^2}$ $a \sinθ + b \cosθ$ $= R \sin(θ + α)$, where $\tan α = \frac ba$ $=R \cos(θ − α)$, where $\tan α = \frac ab$ Its proof provided  makes some assumptions that do not seem intuitive. Is there any alternative way to prove this?

I don't understand this. These identities are given in the online notes for MIT's 18.01 calculus class. It's related to taking the sum of two trig functions and transforming them into a single trig function. I can use the formulas to do this, but I am having trouble finding anything on the internet to use a proof for my understanding.  Thanks for any responses!  EDITED (added after the first answer):  Sorry, the identity goes like this:  $A\sin{k(x-c)}=a\sin{kx}+b\cos{kx}$ ,  with the relationships  $a=A\cos{kc}$ , $b=-A\sin{kc}$ , $A=\sqrt{a^2+b^2}$ , and $\tan{kc}=-b/a$


I'm looking for the title of a Sci-Fi story (probably pre-1990) where a group is sent off into deep space and I believe unbeknownst to them it's a one-way journey.  In the course of the journey they all become very intelligent, they make psychoactive drugs from the plants on board, I recall that they discovered it's a one-way journey to test the affects of space travel, and they redesign/refit their engines and return to Earth.  Lame recall, sorry, that's all I got. Any help appreciated.

The story in question featured, as the vague title suggests, a "space mission" that is really a cover for forcing a bunch of really smart people to be in close proximity to each other for long enough that they can truly evolve their collective intelligence. I recall them developing new maths and, e..g, "farseeing" and eventually figuring out that while there was no planet at the end of their journey as they were told, they were able to construct one for themselves.


I am trying to install Windows 7 on an old system, which had Ubuntu 12.10 on it. I accessed the drive with a cradle and deleted the partitions off of it, then formatted it to NTFS (For Windows). Popped it back in the system and tried to boot from CD to install Windows 7 and I get:  error: unknown filesystem grub rescue >    How did GRUB even survive the formatting and how can I get rid of it for good so I can do a fresh install of Win 7?

I have absolutely no experience with Linux, and I desperately need to get my computer back up and running again with Windows.  How do I remove Ubuntu and reinstall Windows?    Editor's note: many of the answers are about removing Ubuntu from dual-boot but keeping Windows (which is a bit complicated), while other answers are about removing Ubuntu from single-boot (which is easy: basically just format the disk while installing Windows). The question as written is ambiguous between dual-boot or single-boot.


In C# I would do this if I wanted the word 'Many' to display if the count was 10 or more:  int count = 10; var result = count < 10 ? count : "Many";   How do you do this in python?

If Python does not have a ternary conditional operator, is it possible to simulate one using other language constructs?


i trying do some revise for my test. i have trouble convert rotation matrix to quaternion form example given this matrix from quaternion <1,2,3,-5>, generate from  [ -0.7435898,  0.5641026, -0.3589744 ] [  0.0512821, -0.4871795, -0.8717949 ] [ -0.6666667, -0.6666667,  0.3333333 ] what the step to get back the quaternion form?

We use unit length Quaternion to represent rotations. Following is a general rotation matrix obtained ${\begin{bmatrix}m_{00} & m_{01}&m_{02} \\ m_{10} & m_{11}&m_{12}\\  m_{20} & m_{21}&m_{22}\end{bmatrix}}_{3\times 3}\tag 1 $.   How do I accurately calculate quaternion $q = q_1i+q_2j+q_3k+q_4$for this matrix?Means   how can we write $q_i$s interms of given $m_{ij}$  accurately?


Given the sides of a triangle a, b, c, prove that $$a^2b(a-b)+ b^2c(b-c)+ c^2a(c-a)\geq 0$$   I can't seem to figure out how to simplify it. I assumed that $a$ is greatest out of the three, but I can't seem to make any headway.

For any triangle with sides $a$, $b$, $c$, prove the inequality $$a^2b(a-b)+b^2c(b-c)+c^2a(c-a)\ge 0 .$$   This is IMO 1983 problem 6.  I tried substituting $a=x+y$, $b=y+z$, $c=z+x$ but well it doesn't help in any sense except wasting 3 pages that lead to nothing (please don't mind the joke). Using $a=2R\sin A$, $b=2R\sin B$, $c=2R\sin C$ also didn't lead to anything for me. Could you give me a hint for finding the proper substitution?


Running in some trouble using a variable with a number..   This works;  sourceid_2="blah" echo $sourceid_2   But this doesnt work;  sourceid_2="blah" i=2 echo $sourceid_$i   Any ideas how to fix this? I tried without the underscore.. but that didn't help.   My end goal is to do something with the variable in a for i in {2..7} loop.. like this;  for i in {2..7} do echo $sourceid_$i done

I'll appreciate your help with the following issue:  I'm trying to set an array which contains a variable as part of the array name, example: Arr_$COUNTER (where $COUNTER is changed based on a loop count)  Every possible way I have tried came up with an error, such as "bad substitution" or "syntax error near unexpected token"  Here is the entire flow:   There is one file which contain multiple lines. each line has 6 values separated by space  10 20 30 40 50 60   100 200 300 400 500 600  The script, is meant to read each line from the file, and declare it as an array (with the line number which is the variable. as a test, each value should be printed and eventually another function will be executed on each value.  #!/bin/bash COUNTER=1 LINES=`wc -l VALUES_FILE.txt | awk '{print $1}'` echo "Total number of lines "$LINES echo while [ $COUNTER -le $LINES ] do echo "Counter value is $COUNTER" field=`awk "NR == $COUNTER" VALUES_FILE.txt` echo "Field = $field" declare -a "arr$COUNTER=($field)" echo "arr$COUNTER[0] = ${arr$COUNTER[0]}" echo "arr$COUNTER[1] = ${arr$COUNTER[1]}" echo "arr$COUNTER[2] = ${arr$COUNTER[2]}" echo "arr$COUNTER[3] = ${arr$COUNTER[3]}" echo "arr$COUNTER[4] = ${arr$COUNTER[4]}" echo "arr$COUNTER[5] = ${arr$COUNTER[5]}" let COUNTER=COUNTER+1 echo done echo "The End" echo    Here is the result:   Total number of lines 2  Counter value is 1 Field = 10 20 30 40 50 60 ./sort.sh: line 12: arr$COUNTER[0] = ${arr$COUNTER[0]}: bad substitution The End    What should be changed / fixed in order to have it working properly?  thank !


Is this possible to use $.getScript in firefox extension.When i am calling it from html it is working but from Js file not able to execute

I want to use jQuery inside a firefox extension, I imported the library in the xul file like this:  <script type="application/x-javascript" src="chrome://myExtension/content/jquery.js"> </script>   but the $() function is not recognized in the xul file neither do the jQuery().  I googled about the problem and found some solutions but no one did work with me:    I've also tried to pass the 'content.document' object(which refrences the 'document' object) as the context parameter to the jQuery function like this:  $('img',content.document);   but still not working, does any one came across this problem before?


This project at work has this code in some method:  Dim pDataTable As DataTable Dim pDS As DataSet  pDS = someClass.GetSomeDataSet()  If (pDS.Tables.Count > 0) Then     pDataTable = pDS.Tables("SomeTableName")     foo(pDataTable) EndIf   If (pDataTable IsNot Nothing) Then     pDataTable.Dispose() EndIf  pDataTable = Nothing   Just curious, but why does If (pDataTable IsNot Nothing) Then cause this warning:     Variable 'pDataTable' is used before it has been assigned a value. A null reference exception could result at runtime.   I completely understand what it's telling me. If I simply call pDataTable.Dispose() and it was never instantiated in the first if block then my application is going to blow up. But why does it generate a warning for simply comparing a value to null?  If I wanted to get rid of this warning, should I just change the declaration of pDataTable to also create a new instance of DataTable?

I have the following code in Visual Studio 2005.      Dim OutFile As System.IO.StreamWriter     Try         OutFile = New System.IO.StreamWriter(Filename)        // Do stuff with OutFile     Catch Ex As Exception        // Handle Exception     Finally        If OutFile IsNot Nothing Then OutFile.Close()     End Try   But VS2005 brings up the warning for the line "If OutFile IsNot.." that      Variable 'OutFile' is used before it has been assigned a value. A null reference exception could result at runtime.   Is there some way of removing this warning by subtly altering the code or is there just a better way of doing what I'm trying to do?  Thanks  Rob


I have some ugly code that looks something like this:      switch (f.TypeName)     {         case "TypeOne":             ThreadPool.QueueUserWorkItem(new WaitCallback(MyMethod<TypeOne>), args);             break;         case "TypeTwo":             ThreadPool.QueueUserWorkItem(new WaitCallback(MyMethod<TypeTwo>), args);             break;          ...          case "TypeTwenty":             ThreadPool.QueueUserWorkItem(new WaitCallback(MyMethod<TypeTwenty>), args);             break;     }   I would really like to get rid of the switch statement and do something along these lines:      var myTypeDescriptor = Type.GetType(f.TypeName); //<== clearly not this, but similar     ThreadPool.QueueUserWorkItem(new WaitCallback(MyMethod<myTypeDescriptor>), args);   where MyMethod looks like this:      protected void MyMethod<T>(object args)     {         ...     }   I've poked around some and have found a number of examples where the generic is a generic class, but no examples where it is a generic method.  And definitely not any examples where it is being passed to a delegate.  While this appears, at first glance, to be a duplicate of , I am not simply trying to call the method.  It is being passed to the WaitCallback delegate.  Perhaps this is a two part question:  1) how do I retrieve the generic method via reflection and 2) having obtained a handle to the method, how do I pass it as an argument to the WaitCallback delegate?  Anyone have any ideas?  Is this even possible?

What's the best way to call a generic method when the type parameter isn't known at compile time, but instead is obtained dynamically at runtime?  Consider the following sample code - inside the Example() method, what's the most concise way to invoke GenericMethod<T>() using the Type stored in the myType variable?  public class Sample {     public void Example(string typeName)     {         Type myType = FindType(typeName);          // What goes here to call GenericMethod<T>()?         GenericMethod<myType>(); // This doesn't work          // What changes to call StaticMethod<T>()?         Sample.StaticMethod<myType>(); // This also doesn't work     }      public void GenericMethod<T>()     {         // ...     }      public static void StaticMethod<T>()     {         //...     } }


How do I prove that If $d\mid a, d\mid b$, and $d\mid c$, then $d\mid \gcd(a,b,c)$ without using gcd(a,b,c)=gcd(gcd(a,b),c)?  I understand that the Common Divisor Divides GCD is only defined for two variables.

Prove $\gcd(a,b,c)=\gcd(\gcd(a,b),c)$ for $0\ne a,b,c\in \Bbb{Z}$. I tried solving it with sets but I sense there are some details I am missing. I would truly appreciate your reference.


This is a rather morbid question; sorry for that. A friend recently passed away. Prior to passing, he had submitted some of his work to a journal. Journal editor has reached out to see if I could help with some non-controversial copy editing and providing a source file (only PDF had been submitted). We're going to confirm with the family that they're OK with this. If we proceed, is there anything I can do short of entirely recreating the tex file by hand?

I know that hardly any information is passed to the PDF when a .tex file is compiled.  But is there a tool that can convert a PDF document back to (La)TeX?


Can you help me with regex?  I have line   "Sites www.google.com и www.ridd.rdd..com good."   After parse I'v get this type of line:   "Sites http://www.google.com и www.ridd.rdd..com good."   Problem with checking consecutive points. To sites with an error (with two points in a row) "http//:" should not be appended.  My regex:   Matcher matchr = Pattern.compile("w{3}(\\.\\w+)+[a-z]{2,6}").matcher(text);          while (matchr.find()) {             text = text.replace(matchr.group(0), "http://" + matchr.group(0));         }          System.out.println(text);

Given the URL (single line):   How can I extract the following parts using regular expressions:   The Subdomain (test) The Domain (example.com) The path without the file (/dir/subdir/) The file (file.html) The path with the file (/dir/subdir/file.html) The URL without the path () (add any other that you think would be useful)   The regex should work correctly even if I enter the following URL:    http://example.example.com/example/example/example.html


I am a programmer but I am new in QGIS. I have a database of some hundreds of points with lat, long information. It is an excel spreadsheet.   How can I create a layer of points of each lat, long from those data?

I have an Excel file containing data collected over many years as latitude and longitude coordinates for archaeological sites. How can I import it into QGIS as a new layer?