I tried to match .* with C# regular expression, and it turns out it matches any string two times: first the full string, than a second time an empty string. I expected .* to match everything in a single match. I'm completely puzzled why that should be and how to prevent this.  Long story: I need to replace parts of filenames, with the possibility to replace unconditionally by a certain replacement string. Using an empty string as pattern will match and put the replacement after every character of the string, like it is described in . Therefor I substitute the empty string by .* before replacement. But this turns out to execute the replacement double.  To demonstrate what is going on I used:  string input= "sometext"; string pattern= ".*";  MatchCollection matches = Regex.Matches(input, pattern);  foreach (Match match in matches) {     Console.WriteLine("[{0}]", match.Groups[0].Value); }   which yields:  [sometext] []    Why does it match a second time the empty string when it already matched the whole string? What regex or flags do I have to use to get only a single match/replacement?

It seems the .NET Regex.Replace method automatically replaces all matching occurrences.  I could provide a MatchEvaluator delegate that returns the matched string after the first replacement, rendering no change, but that sounds very inefficient to me.  What is the most efficient way to stop after the first replacement?


when i write down this command on my terminal for configuring squidguard squidGuard -d  this error shows up  squidGuard: error while loading shared libraries: libdb-4.6.so: cannot open shared object file: No such file or directory

Well, I installed Squid3 the other day and then installed Quintolabs, but I discovered this program squidguard that looks much easier to work with and configure and it looks like it would serve as a more adequate web filter for my needs.   I installed squidguard seemingly without a problem and I am following .  I am at the part when I just finished installing the blacklist and now I am trying to do a test run of squidguard with output to stderr using the command squidGuard -d (I am a total newbie with linux and am not that familiar with any commands or the file system or anything being used to Windows for so long).  This is what shows in the terminal which includes the error:  administrator@LinuxWebFilter:~$ squidGuard -d squidGuard: error while loading shared libraries: libdb-4.8.so: cannot open shared object file: No such file or directory   I have no idea what to do or how to fix this.  Can someone please help with this?


I just logged-in to my Gmail and I saw following message:     You’re out of storage space and will soon be unable to send or receive   emails until you free up space or purchase additional storage.   After quick reviewing of my Drive storage, a large portion went to Gmail and Google Photos. I started using Gmail back in 2004 and needless to say I have millions of emails and it's not easy to clean it up.  What's the most efficient way to do clean up my Gmail? (It's not like I can sort by size and see which emails are taking most of space.)  * UPDATE *  after using certain label, such as this:     label:freebsd-questions -label:starred   I hit Delete and a minute later I saw this:     Oops… the system encountered a problem (#793) - Retrying in 1s…   and when I opened another tab to Gmail I saw this:   Gmail by Google   Temporary Error (500)     We’re sorry, but your Gmail account is temporarily unavailable. We apologize for the inconvenience and suggest trying again in a few minutes. You can view the Apps Status Dashboard for the current status of the service.  If the issue persists, please visit the Gmail Help Center »  Try Again Sign Out   Hide Detailed Technical Info Numeric Code: 167   Any advise?

I've used up 30% of my storage already.  With the rate I am going, this might reach the limit soon. I want to free up some of the useless or duplicate stuff (mostly attachments) that I have on my Gmail account.  Searching using has:attachment arranges according to the date, but what I really need for this is a sort according to the mail size, so that I can know which ones are eating up all the space.  Is there a way to do this that I can use?


I am trying to find out why people embed a script into the HTML of a webpage by using the advantages and disadvantages of doing so.

I would like to know when I should include external scripts or write them inline with the html code, in terms of performance and ease of maintenance.  What is the general practice for this?  Real-world-scenario - I have several html pages that need client-side form validation. For this I use a jQuery plugin that I include on all these pages. But the question is, do I:   write the bits of code that configure this script inline? include all bits in one file that's share among all these html pages? include each bit in a separate external file, one for each html page?   Thanks.


(For the purposes of this post, disregard the beta and meta sites on the SE Network.) We know what reputation is, right? When you reach a certain milestone of rep, you gain a privilege. What's strange for me is that the same privilege on different sites have varied/different milestones. My most notable site,  and  has different milestones for the "create tags" privilege, where Math SE needs 1k and SoftwareRecs SE needs 300. So why does each site have milestones different to others?

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.


In the attribute table I can use this expression  left(   "CODE" ,1)='E' or left( "CODE" ,1)='W'   to select features successfully, but when I try to use the same expression in the Properties, General, Query Builder window, to display a subset of features on the map it gives an error:      SQL Expression Parsing Error: syntax error, unexpected LEFT   Is there an alternative syntax I can use in the Properties dialog to achieve the same?

Using QGIS 2.16.2, I can successfully select records from a shapefile attribute table using the following expression:  left("start_time", 10) = '2015-08-01'   Please note that start_time is a string field.  However, when I copy and paste the same expression into the shapefile's Layer Properties>General>feature filter>Query Builder I get the following error:    I would expect that the same expression would work everywhere in QGIS.  What am I doing wrong?


Throw two baryons into a black hole ( +2), receive  out.  (baryon number 0).     seems to disallow such a thing.  Am I missing something here?

The  says that a black hole can be characterized by a small number of parameters that are visible from distance - mass, angular momentum and electric charge.  For me it is puzzling why local quantities are not included, i.e. quantum numbers different from electrical charge. Lack of such parameters means breaking of the conservations laws (for a black hole made of baryons, Hawking radiation then is 50% baryonic and 50% anti-baryonic).  The question is:   If lack of baryonic number as a black hole parameter is a well established relation?   OR   It is (or may be) only an artifact of lack of unification between QFT and GR?


How can I get Excel to increment ranges arguments by more than one row when I fill down a formula?  For example, if I want Excel to keep averaging the next five numbers in a column, how do I set the average function to keep it in a pattern throughout, without changing it from an increment of one from the first and last number of the previous formula?  Excel keeps giving me this when I fill down:  =Average(A1:A5) =Average(A2:A6) =Average(A3:A7)   I want Excel to do this instead:  =Average(A1:A5) =Average(A6:A10) =Average(A11:A15)   How can I do this by filling down?

For example, I want the first entry in Column B (B1) to show A5, then B2 shows A10, then B3 shows A15.  How would I go about doing this?


Today in physics we were looking at how the energy of a photon is the product of Planck's constant and the frequency of the photon, therefore the lower the frequency, the lower the energy of the photon.   The Cosmic Microwave Background, which I understand is a literal stretching of space over time, therefore increasing the wavelength of the radiation emitted  during the big bang, being electromagnetic waves (photons), which will of course decrease the frequency.   So, if over time an individual photon's frequency has decreased, so has its energy... Where has the excess energy gone?

If a photon (wave package) redshifts (stretches) travelling in our expanding universe, is its energy reduced?  If so, where does that energy go?


Soon I will be starting with my side project to try and get out of corporate development and into game development. And I am sure I will have a lot of questions - I already have, but I first need to try and figure it out on my own.  I can see that some of the questions I have will overlap between sites. Most will be relating to game development, but will also have non game related implementations.  As I am sure someone will ask me for the types of questions or a question example, here is one:     One of the things I need to figure out is how to store each player's map, and map exploration. I am reading up on a couple of options and one option I am looking at with regards to map exploration storage is a quadtree, more specifically about how I will store the quadtree data on disc/db.   Now I have not done much reading on this topic yet, so it is not a real question, but an example of how the questions can overlap between Game Development and Stack Overflow.  Should I ask those questions that overlap game development an non game development in Stack Overflow rather than Game Development, and have it moved to Game Development if it is deemed too specific? Or should I post it all in Game Development since my questions arise from and will be implemented in Game Development?   Side question: what is the impact of having a couple/too many of your posts moved to another site?    I have tried to find similar questions here on meta, but topics like  ended up a discussion on the validity of the questions rather than guidelines as to where to post questions. So I am still uncertain about the rule of thumb regarding this.

It is possible to migrate a question from one Stack Exchange site to another by closing, but if I have a question that I think is on-topic for multiple Stack Exchange sites, is it OK to post it on both (multipost)?   For example, I have a question that's earned me the tumbleweed badge on SO and I'm not sure what the best thing to do with it is. It's about a web server so it might be answerable on Server Fault but it's really more of a programming thing, hence the posting the question on Stack Overflow.    Is there any way to make the question visible on multiple sites (crosspost) and then accept the answer wherever it came from?


When trying to convert a String or NSString to float or double I get inaccurate answers in debugger. Why is this ?  let x = "2.3" let y = Double(x) let z = Float(x)  let xx : NSString = "2.3" let yy = xx.floatValue let zz = xx.doubleValue   I have run this on XCode 7.3 and XCode 8 gm seed

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


This is something that crops up on the BBC a lot and irks me. For example, from  today:     One woman is critically ill and three others have been injured after   they were stabbed near a supermarket car park in west London.   To me, you are ill (or sick) if you have, for example, contracted a disease and using it in the sense of someone being injured is wrong.   Google gives the definition of ill as "suffering from an illness or disease or feeling unwell." and I'm sure that a car crash or stabbing would certainly make you feel unwell, but I still don't think it's right. Is it?

I've just heard on BBC Radio 4:     A man is seriously ill after having been hit by a police car.   Is this a correct use of ill (assuming that he hasn't contracted an infection)? I'd not have used ill of an injury, however serious.


My data is consisted of the scores of high school students in algebra. N=23, the mean is 7.96 and the standard deviation is 4.017. I don't know what does the value of standard deviation tells about my data. Is my data dispersed or not?

What is a standard deviation, how is it calculated and what is its use in statistics?


I bought a used Honda Accord in 2010  for $17k+ tax and fees.  It has 59,102 miles  and is paid off.  Kelly Blue Book says that it's worth $6-7k.  A new car such as a 2015 Accord will cost about $16k + fees @3.09% or about $17k.  My credit is excellent and getting the lowest interest rate will be no problem.  My car started to burn oil in January.  I had the oil changed  and the oil light came on briefly for 10-15 seconds when going uphill and then went out.  The dealer said I should bring it back at 1k, 2k, and 3k miles to review oil consumption.  If I have to fix it,  I will have to  replace the piston rings and related parts/labor for $3,500.  I could fix some optional cosmetic damage in the forms of scraps.   At what point does it not make sense to fix it? At what dollar amount for a trade-in should I jump at? At what point should I just drive it into the ground?   The goal here is  to spend the least amount of money all by having the best trade-in value.

My car has apparently has a blown head gasket...  The options at this point are basically:   put $5k into an 8 year old car with 120k mi that is otherwise in good shape (with a 2 year warranty on the new engine), or spend $15k on a newer (used) car -- which will essentially be an unknown quantity in terms of what kinds of problems it may have.   How do you decide which is the better course? (In my case, I've got a trustworthy mechanic to do the work.)  Edit: In the end, we decided to replace it. Sold the car to the mechanic, who tried to revive it, failed to do so, and is now stripping it for parts....  Thanks to all for the helpful advice.


I'm a graduate student who are studying AI. I have constructed one model for voice classification but, overfitting occurred. I tried a lot to overcome this phenomenon. (i.e. weight standardization, gradient centralization and data augmentation) These methods worked, but they were limited. When the training error is steadily decreasing and the test error is saturated, should I fundamentally consider changing the model structure or should I use more regularizers? (I think model size is quite big(ReXNet, not resnet), data shape is 1 * 244 * 244, amount of data is about 100000) thank you!

I'm training a neural network and the training loss decreases, but the validation loss doesn't, or it decreases much less than what I would expect, based on references or experiments with very similar architectures and data. How can I fix this?    As for question        to which this question is inspired, the question is intentionally left general so that other questions about how to reduce the generalization error of a neural network down to a level which has been proved to be attainable, can be closed as duplicates of this one.  See also dedicated thread on Meta:


This looks very much like something which is a duplicate, but I couldn't find the "desired duplicate". Sorry if this has been asked before.     Let $F$ be a field of $q$ elements and $F\setminus \{0\} = \{a_1,\ldots,a_{q-1}\}$. Show that $\prod a_i = -1$.   If $F$ has characteristic $2$ then this is trivial. So let's assume it has characteristic $p>2$. I tried to use the fact that $F\setminus \{0\}$ is a cyclic group with no avail.   Any hint?

Suppose $F=\{0,a_1,\dots,a_{q-1}\}$ is a finite field with $q=p^n$ elements. I'm curious, why is the product of all elements of $F^\ast$ equal to $-1$? I know that $F^\ast$ is cyclic, say generated by $a$. Then the product in question can be written as  $$ a_1\cdots a_{q-1}=1\cdot a\cdot a^2\cdots a^{q-2}=a^{(q-2)(q-1)/2}. $$ However, I'm having trouble jumping from that product to $-1$. What is the key observation to make here? Thanks!


I’m trying to plot a the first few functions in a sequence of functions. For now my code looks like that:  \begin{center} \begin{tikzpicture}     \begin{axis}[axis lines = left,                     xlabel = $x$,                      ylabel = $y$,                     xmin = 0,                     xmax=10,                     ymin=-0.1,                     ymax = 0.4,                     legend pos = outer north east];             \addplot[domain=0:10, samples=100, color=gray, dashed]{sqrt(2)/2*exp(-pi/4)};             \addlegendentry{$\sup_{x\in I}\card{f_n}$}             \foreach \n in {1,2,...,7}{ \addplot [domain=0:10, samples=500, color=red]{sin(deg(\n*x))*exp(-\n*x)}; }     \end{axis} \end{tikzpicture} \end{center} \end{document}   But as you can see in the code each plot is red. Is there a way so that each function is plotted with a different color while still plotting them with a loop ? In the same vein can I add a legend entry for each function the loop like f_1(x), f_2(x), ..., f_7(x) ? Changing the color for each plot is discussed here  but I couldn’t get what they did working, I don’t actually understand everything (ie what does \edef or \noexpand or \temp do) and I’m not looking necessarily at having a gradient of colors, I’m ok with random colors as long as they’re different. I havent used pgfplots for a while I’m not quite sure how to go about any of this. Any help is appreciated.

Since I have multiple plots with error bars, I would like to shift the error bars slightly to make the overall plot more readable. However, when I try to do this using the variable of a \foreach as the amount to shift, I get an "undefined control sequence" error.  \documentclass{article}  \usepackage{tikz} \usepackage{pgfplots}  \begin{document}  \begin{tikzpicture} \begin{axis} \foreach \x/\y in {a/-1cm, b/0cm, c/1cm} {     \addplot+ [         %every error bar/.append style={xshift=\y},         %every node/.style={xshift=\y},         error bars/y dir=both,         error bars/y explicit,     ] coordinates {         (0, 0) +- (0, 1)         (1, 0) +- (0, 1)         (2, 0) +- (0, 1)     }; } \end{axis} \end{tikzpicture}  \end{document}   (The document does not compile when I uncomment either one of the two comments.)  What's wrong here?  EDIT: Added another variable to the \foreach. In my actual use-case it would contain the filename to plot data from or the label to use for the curve.


I was in need to urgently solve this integral. I already know the result in the closed form, does anybody know how to solve it?  \begin{equation}  \int_{\mathbb{R}}e^{-\frac{x^{2}}{2}}\left(\cos\left(\pi nx\right)\right)dx=\sqrt{2\pi}e^{-\frac{n^{2}\pi^{2}}{2}}, \end{equation} If anybody already knows it is welcome, otherwise I guess I will have to look tomorrow with more calm

How to integrate   $$\int\limits_0^\infty e^{-a x^2}\cos(b x) dx$$  where $a>0$  The real problem is this integral  $$\lim\limits_{\alpha\rightarrow 2}\int\limits_0^\infty e^{-a x^\alpha}\cos(b x) dx$$  I tried integration by parts and then the change of variable $z=x^2$ but it does not work.


Alright, I read this trilogy almost a decade ago. And I'm pretty sure it wasn't new then. So could be from 90's or early 2000's  Basically, it was a trilogy that followed multiple people's stories. It heavily featured VR and Full Body VR Suits. There was an evil corporation whose HQ was a giant black tower in a lake (I think) and in the end the group of people who's stories all intertwined infiltrated it. Or something.  Few key things I remember, there was a young kid who lived near a weird old man. Kids parent's always told him to stay away, he didn't. And the old man ate soap. There was a brother and a sister story arc, sister was older and looking after the brother. And one of the books definitely had a gold cover.  I tried finding these books 5 years ago, and failed. Finally found them 2 years ago, and forgot their names AGAIN. Hopefully this time around I won't!

There is this story I read years ago about a world where the wealthy created VR worlds for themselves to live in. These virtual worlds were extremely realistic and the 'masters' of those worlds could essentially live like gods in those worlds. 'Of course' at one point they figure out how to 'upload' their consciousnesses into these virtual worlds leaving behind their physical bodies. Each has his own world and is the only human being in it and some of them do not decide to live a god-like existence whilst others do.   Now the protagonist isn't wealthy and he has this entire story of his own I forgot about entirely (shame on me), but I have been lately 'quoting' concepts from the book, so I would like to properly attribute them (plus I fear I am attributing some things to this story which weren't from this one, so I would love to check).


I would like to render my model as image, but when I click on render image, blender only shows me a blank window, I just tested Eevee and Cycles, but there is unfortunately no difference. When I click now on render, Blender gives me only black images.  Would be awesome, if someone could help me!

A scene I made is not rendering, at all. This grey screen stays the same and nothing changes.  Here are my settings:  [


I inserted a two-pin header (P1) into this circuit using EasyEDA.  Does the square outline mean that is the positive pin, or is there another meaning?

I have a PCB with documentation. In the documentation, there is referred to specific pins of several jumpers and connectors. On the PCB however, there isn't a label or so for which pin has what number. I need to figure out which pin has which number, so that I know the function of each physical pin.  I noticed all connectors have all pins with a rounded tin pad, whilst one pin (either the first or the last when counting from right to left) has a square tin pad:     Is it some kind of convention which number this pin has? After that, how to count the other pins?


I have decided to use KOMA for my new project. I'm writing in Spanish so I have to indent every first paragraph line, but I also want to include a paragraph separation of 1/2 line.  If I set KOMAoption to parksip=false I get the indentation but not the space between paragraphs. If I set parskip=half, the otherway around.  The only option I found is setting parskip=half and after begin{document} include \setlength{\parindent}{1em}. But then, I don't know if someother spacing settings in KOMA will be changed.  Is there any option I haven't found in KOMA that makes it possible to do it in a more elegant way.  Any comment is more than welcome.

I am using the documentclass scrbook. To mark paragraphs I need both vertical spacing and indentation.  I know that KOMA-Script supports the option parskip or halfparskip, however, this disables the indentation. In order to get it back I declared \setlength{\parindent}{1.5em} in the preamble.  Since I am using both vertical spacing and indentation, I would like to have even smaller spacing than halfparskip. Is it possible to get an even smaller parskip than half in KOMA-Script?


i forgot password  to use sudo and password for logging as root from login prompt  I forgot My root Password Please help me To recover my root password.i am not able update my system not able install new software.

I'm working on a Ubuntu system, and my client has completely forgotten his administrative password. He doesn't even remember entering one; however it is there.  I've tried the suggestions on the website, and I have been unsuccessful in deleting the password so that I can download applets required for running some files. Is there a solution?


Is there any way I can intuitively demonstrate or remember the formula listed at  for the Pascal triangle?  I'm talking of  $$ {n\choose k}= {n\choose k-1}\times \frac{n+1-k}{k} $$  I tried with a piece of paper and it definitely works.. but I don't know why. There is no proof or demonstration.. so: why does it work?

I've found in Wikipedia the formula for calculating an individual row in Pascal's Triangle: $$v_c = v_{c-1}\left(\frac{r-c}{c}\right).$$ where $r = \mathrm{row}+1$, $c$ is the column starting from $0$ on left and $v_0 = 1$.  Now, I've tried to do by hand and it works,  but I don't understand how to find this magic formula when I don't have access to Wikipedia...:)


I bought a salami pizza and a Hawaii pizza (ham & pineapple) the night before yesterday, but forgot to put them in the freezer.  This is the latter, soggy part removed:   Normally they should cook for 16 minutes, but they are completely thawed. Will cooking them at 190 degrees Celsius for 11 minutes make them safe to eat?    , with 66% in favor of cooking, but i'd like some expert advice.

If I left food out of the refrigerator for some period of time, is it still safe? If I left it out too long, can I salvage it by cooking it more?


Does the infinite sum $\sum _{n=2}^{\infty } \frac{(-1)^n}{\sqrt{n}+(-1)^n}$ converge ? Can anyone help ?

Discuss the convergence of the sum:   $$\sum _{k=2} ^\infty \frac{(-1)^k}{\sqrt{k}+(-1)^k}.$$  My answer so far: It does not converge absolutely since   $$\left | \frac{(-1)^k}{\sqrt{k}+(-1)^k} \right | \geq \frac {1} {\sqrt{k} + 1},$$  the sum of whose terms diverges. Intuitively, I think it should converge conditionally because $ \sum \frac{(-1)^k}{\sqrt{k}}$ does, and the $(-1)^k$ in the denominator should not make a big difference. However, I am having trouble demonstrating its conditional convergence.  Evidently, the problem is that $\frac{1}{\sqrt{k}+(-1)^k}$ is not monotone. Let's call this sequence $a_n$. If we can show that   $$\sum_{k=2}^\infty |a_k - a_{k-1}| < \infty,$$   then we're done by Dirichlet's test. But this seems to be $O(1/k)$.   Any ideas?


I have been using   $autoComplete = file_get_contents("stackoverflow.com");   When using PHP, but I now need a Javascript equivalent. Is there one..  I need to read a txt file that is accessed via URL..  I obviously have been googling, but nothing seems to work.  Any help would be great..

I need to do an  request in JavaScript. What's the best way to do that?  I need to do this in a Mac OS X dashcode widget.


I've stuck with basics of JavaScript array. here is my code let arr = ['students', 'exams', [{'sub1':80, 'sub2':60},{'grade_sub1':'A', 'grade_sub2':'B'}]]; let new_arr = [];  new_arr = new_arr.concat(arr); console.log(new_arr); //output : ['students', 'exams', [{'sub1':80, 'sub2':60},{'grade_sub1':'A', 'grade_sub2':'B'}]]  new_arr[2].pop(); let sub_arr = []; sub_arr = sub_arr.concat(arr);  console.log(sub_arr); //output: ['students', 'exams',[{'sub1':80, 'sub2':60}]]   Expected output for sub_arr is ['students', 'exams', [{'sub1':80, 'sub2':60},{'grade_sub1':'A', 'grade_sub2':'B'}]]  I've tried using slice() also. it didn't work. plz help me with this issue.

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


I just got the .  I have a motor and a battery hooked up to the ESC. On the three pin connector, I attached the brown ground wire to a ground pin, and yellow signal wire to a PWM-capable IO pin. I'm trying to figure out how to send motor signals to the ESC, with no luck. I know that I need to send PWM output through the yellow signal wire, but I don't know the frequency or high time of the PWM signal. Also, I've read that certain ESC's have an arming procedure, and I'm not sure how that works.  How do I control my ESC from a generic output pin hooked up to a microcontroller?

I'm new to RC related modules. Today I got my 's Skywalker 20A brushless esc. Manual is .    I also have a brushless outrunner motor (HL3512)    I don't have any device to program the esc's (even the seller hasn't mentioned about such requirement).   The  talks about programming by listening to the beep patterns. But for that it seems that the esc should be connected to a flight controller (it talks about throttle positions etc...). But I don't have any flight controller.  Can some one tell me how to use the esc with what I have? (I have 2200mAh LiPo and  too)


What is the reasoning for the 2 vote requirement to approve a suggested edit?  If a 2000+ rep user has the ability to edit on their own, then why do they need to vote to approve a suggested edit?  I propose removing the 2 vote requirement for 2000+ rep users as those users have the ability to edit on their own without a vote.

It's not consistent to leave an edit pending for approval (thus not making available for everyone else and locking its state) after a user who has those privileges have given his endorsement.   You could say why don't I improve the edit, but that makes no sense for something that is correct and it would not follow the "keep it simple" policy.  Update:  This is the current time line:   Someone who doesn't know about formatting makes a question. It's not legible A user without edit privileges amends the formatting. The correction is not visible, still not legible. I see the question and the pending revision and then cast my approval. It doesn't take effect yet, still not legible. Even for me if I didn't take care of copying the question source because it disappears from my own revision page!   I might agree that one's approval is indicative of both revision's quality and editor's competence. But we should retain that the main objective is to ask and answer questions. So, I propose this model:   Someone who doesn't know about formatting makes a question. It's not legible A user without edit privileges amends the formatting. The correction is not visible, still not legible. A user with edit privileges cast his approval. Revision takes effect. Although it keeps the pending approval (the Edit (1) button). If a second user with edit privileges cast a rejection, it also takes effect as a rollback.


I want to restrict the file size and file type on the profile picture. I want to allow only .jpg and .png pictures, and i also want to only allow a maximum file size of for example 1 megabyte. Under you see my code for uploading a file with no restrictions. I am using base64. I need to check file type and file size before the picture is uploaded but I really don't know how and where. If you need to see more of my code please let me know. Thank you very much.      [HttpPost]     [AllowAnonymous]     [ValidateAntiForgeryToken]     public async Task<IActionResult> ChangePic(IndexViewModel model)     {         if (ModelState.IsValid)         {             var user = await _userManager.FindByIdAsync(User.GetUserId());              var breader = new BinaryReader(model.ProfilePic.OpenReadStream());              var byteImage = breader.ReadBytes((int)breader.BaseStream.Length);              user.ProfilePic = byteImage;              var result = await _userManager.UpdateAsync(user);             if (result.Succeeded)             {                 // For more information on how to enable account confirmation and password reset please visit http://go.microsoft.com/fwlink/?LinkID=532713                 // Send an email with this link                 //var code = await _userManager.GenerateEmailConfirmationTokenAsync(user);                 //var callbackUrl = Url.Action("ConfirmEmail", "Account", new { userId = user.Id, code = code }, protocol: HttpContext.Request.Scheme);                 //await _emailSender.SendEmailAsync(model.Email, "Confirm your account",                 //    "Please confirm your account by clicking this link: link");                 await _signInManager.SignInAsync(user, isPersistent: false);                 _logger.LogInformation(3, "Profile info updated");                 return RedirectToAction(nameof(ManageController.Index), "Manage");             }             AddErrors(result);          }          // If we got this far, something failed, redisplay form         return View(model);     }

I am using <input type="file" id="fileUpload" runat="server"> to upload a file in an ASP.NET application. I would like to limit the file type of the upload (example: limit to .xls or .xlsx file extensions).   Both JavaScript or server-side validation are OK (as long as the server side validation would take place before the files are being uploaded - there could be some very large files uploaded, so any validation needs to take place before the actual files are uploaded).


We were taught that $[a,a]=\{a\}$ and $(a,a)=\emptyset $, For $a \in \Bbb R$.  So I wonder what will be the result in the case $(a,a]$?  Let $A=(a,a]$.  Then $a \in A$ and $a \notin A$.  This is absurd. So I guess $A$ is undefined.

Claim. Let $a$ and $b$ be real numbers. If $a\geq b$  then $(a,b), [a,b)$ and $(a,b]$ are empty set.   My is question is that why?


I can't get Minecraft 1.6.4. I downloaded the new launcher on minecraft.net, but it's still 1.6.2.  When I click on "edit profile," there's no 1.6.4 displayed.

I tried connecting to a server this morning but it said "outdated client". I understand that that means I have to get Minecraft 1.6.4 but I have no clue how to do it. I tried getting it on Minecraft.net but I couldn't find it. Please tell me how to download it and use it.


I have a Samsung Galaxy J3 prime.it was factory reset and now won't let me log in to the internet. I don't have the Google account email address

I won a Samsung Galaxy S6 Edge, signed into it with my Google account, played around with it, wiped it, and sold it.  Now the person can't get past setup because it's saying he must login with an account previously synced to the phone.   Is there anything I can do from my side to remove this lock?


As a Barbarian who is mainly playing WW build, I don't know which I should prioritize on:  weapon damage, IAS or % Damage?  This is the item I got:

So I got this new weapon:    However, it lacks a socket, so I need to replace a primary attribute with a socket. My question is which primary property should I replace? It comes down to increased attack speed or an additional percentage of damage. On a more general note, on a weapon, sould I go for attack speed or %damage ?


Last month I applied for B2 - Tourism Visa(planning to visit my sister for this Christmas) from India. In the DS160 and also in the interview, I gave the purpose as tourism. Only four questions asked:   Purpose and time of visit How long I will be there My company name My annual salary   And that's it. My visa got approved. I got my passport with visa stamped yesterday.  To my surprise, it has B1/B2 stamped and not just B2. Before I applied for B2, there was a proposal for me, from my company, to visit our head quarters for some hands on training. Since the plan was not confirmed, I went ahead with B2.  Could I use this to go for tourism as well as business? Like visit my sister for 2 weeks, go to my office headquarters and get the one week long training and come back to India?  Questions are:   Is my employment details added to my visa? If yes, will those details be absent as I applied for travel? Will I be denied entry if I state my purpose as pleasure and business but given my purpose as pleasure at the time of applying for visa? the difference is very short time indeed(max of 3 months by the time of applying visa to the time to travel)   I checked the site and  and  seems to be closer to this question. Former is the reverse of my query and the latter is closed as a duplicate of former without any answers.   question seems to be the answer for whether B1/B2 is valid for Business trip. My question differs in this that I will be mixing both my business and pleasure in single trip but stated my purpose as travel only by the time of application. The main factor here is time. In the other question linked, the time interval is lot more and one cannot question the intention of the traveler while using same visa for business purposes. However, in my case, it would seem like my intention of travel changed to business within a month and it could be easily questionable while I enter the country.

I have been given B1/B2 Visa, but first time when I had applied, it  was for vacation & holiday. Now I need to go to US for business meetings. Is this Visa good enough or do I have to apply for a B1 Visa again?  Note: I originally applied for vacation purposes, but in my visa it is stamped "R b1/b2"


I have a unique project where I'm needing host several terabytes of short ~15mb mp4 video files, of which each video will only be viewed once.  Is a CDN recommended here? Or would a basic storage solution like AWS S3, or DigitalOcean's Block Storage solution work well for me needs?  Thank you

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?


So I usually read, that the falling speed of an object towards the earth is independant of the mass of the object. Is this actually true? Shouldn`t the earth fall towards the object as well, therefore invalidating the first statement?  I realize that this would not be measureable for objects we can test this on ourselves, unless one uses the moon or similar for calculations.

The common understanding is that, setting air resistance aside, all objects dropped to Earth fall at the same rate. This is often demonstrated through the thought experiment of cutting a large object in half. The halves clearly can't then fall more slowly just by being sliced in two.  However, I believe the answer is that when two objects fall together, attached or not, they do "fall" faster than an object of less mass alone does. This is because not only does the Earth accelerate the objects toward itself but the objects also accelerate the Earth toward themselves. Considering the formula: $$ F_{\text{g}} = \frac{G m_1 m_2}{d^2} $$  Given $F = ma$ thus $a = F/m$, we note that the mass of the small object doesn't seem to matter as when calculating acceleration the force is divided by the $m$ term, its mass. However, this overlooks that the force is actually applied to both objects, not just to the smaller one. The acceleration on the second, larger object is found by dividing $F$, in turn, by the larger object's mass. The two objects' acceleration vectors are exactly opposite, so closing acceleration is the sum of the two:  $$ a_{\text{closing}} = \frac{F}{m_1} + \frac{F}{m_2} $$  Since the Earth is extremely massive compared to everyday objects, the acceleration imparted on the object by the Earth will radically dominate the equation. As the Earth is $\sim 5.972 \times {10}^{24} \, \mathrm{kg} ,$ a falling object of $5.972 \, \mathrm{kg}$ (just over 13 pounds) would accelerate the Earth about $\frac{1}{{10}^{24}}$ as much, which is one part in a trillion trillion.  Of course in everyday situations, we can for all practical purposes treat objects as falling at the same rate because of this negligible difference—which our instruments probably couldn't even detect. But I'm hoping not for a discussion of practicality or what's measurable or observable, but what we think is actually happening.  Am I right or wrong?  What really clinched this for me was considering dropping a small Moon-massed object close to the Earth and a small Earth-massed object close to the Moon. This made me realize that falling isn't one object moving toward some fixed frame of reference, but that the Earth is just another object, and thus "falling" consists of multiple objects mutually attracting in space.


I'm making a small example to display JSON (key and value). When I copy the JSON to another variable, I've tried to delete key Age and re-displayed the first JSON. Key Age in the first JSONhas been deleted, too.    $('button').click(function () {   var json = {};   json['Name'] = 'Hermione';   json['Age'] = 19;      for (i in json) {     $('body').append($('<p>').text(i + ': ' + json[i]))   }       var copy = json;   delete copy['Age'];      for (i in json) {     $('body').append($('<p>').text(i + ': ' + json[i]))   } }) <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <button>Click me</button>     So, my question is: Copying an object to another object means nothing in JavaScript, right?  I think that because when I copied it, it's still operating on the main version (json), not on the copy version (copy).

I have an object x. I'd like to copy it as object y, such that changes to y do not modify x. I realized that copying objects derived from built-in JavaScript objects will result in extra, unwanted properties. This isn't a problem, since I'm copying one of my own literal-constructed objects.  How do I correctly clone a JavaScript object?


Yesterday I wrote a Thread addressing how my game loop ran (in java) and how it works.  My game loop works completely, and I know why, but now I just wan't to know how to calculate FPS (Frames Per Second) and print it out every second.  I got a response yesterday about this, but he/she explained it in words and I couldn't understand it.  If anyone could help me (with a code example? :D) that would be great.  Here is my game loop:          while (running) {          start = System.nanoTime();          update();         draw();         drawToScreen();          elapsed = System.nanoTime() - start;          wait = targetTime - elapsed / 1000000;         if (wait < 0) {             wait = 5;         }          try {             Thread.sleep(wait);         } catch (Exception e) {             Game.logger.log("ERROR! Printing Stacktrace...");              e.printStackTrace();         }      }   ALSO:  In my JFrame when ever I call setName(string) it never works/updates on the Frame - Link me to a thread?

What's a good algorithm for calculating frames per second in a game? I want to show it as a number in the corner of the screen. If I just look at how long it took to render the last frame the number changes too fast.  Bonus points if your answer updates each frame and doesn't converge differently when the frame rate is increasing vs decreasing.


Currently, users with an account get informed of upvotes to their answers via a small green rectangle reporting the number of such upvotes in the topbar. Clicking on it displays a pop-up window with links to the upvoted answers. The only way I know of to clear the upvote indicator is to click on it.  This makes for an interface which forces certain moves on the user.  Could there be a configuration in the user profile to allow the user to completely suppress this indicator of reputation points upvotes?  Also the pop-up window would serve rather to indicate which questions (among those to which the user contributed either by asking or by answering or possibly commenting) received new activity: activity such as an edit of the question, or a new answer, or an edit to an old answer, or perhaps even new comments to the question or the answers.  The reported information would become completely independent of the upvotes.  The user would go click there only as way to keep track of changes to what he/she contributed to.  The only testimony to reputation points changes would be in the total reputation points the user sees underneath his/her account name. Next time I will ask a way to suppress that too ;-)    As per request in comments:   The benefit to the user was already clearly expressed above: stop being forced to be informed of upvotes. The benefit to the site would be to create a more adult and saner relationship with its contributors.   Also moved from comments:  The upvote indicator could display the green rectangle only on hover event.

Is there any setting/userscript/extension available to disable/remove all reputation, badges and badge notifications from the stackoverflow interface?  It just clutters the interface for me and I don't see the point in having them.  Activity on sites like stackoverflow as someone that answers questions should be purely altruistic anyway ;)  In addition to the greasemonkey script mentioned in the answers I'm also using this userscript in Opera  if(/(stackoverflow|superuser|serverfault)\.com$/.test(location.hostname)){     opera.addEventListener('BeforeScript', function(e){         var o = document.getElementById('notify-container')         if(o){             o.style.display = 'none';             removeEventListener.call(opera, 'BeforeScript', arguments.callee, false);         }     }, false); }


Hi,so I  just can't get my head through the solution for 4th problem.I successfully proved associative law and when I wrote an equation for finding identity element I did get the same thing,but then I don't understand how they get $e(1 - x^2) = 0$. I always get $x + e = x^2e + x$.  I'd appreciate if someone could explain. I understand that logically speaking, it should be $0$.

I am trying to prove that $(G, *)$ is an abelian group with $G=(-1,1)$ and $a*b=$$\frac{x+y}{1+xy}$.  Thus far I have found that the identity element $e=0$. From here, I set $a*b=0$ and found $a^{-1}$ to be $-a$.   My work for trying to prove closure and that the set is abelian is:  Let $a,b \in G$, where $a=e$ and $b=a^{-1}$. Does  $a*b=b*a$?  Evaluating, I see that $a^{-1}=a^{-1}$ which then proves that G is closed and G is an abelian group.  Did I go about this proof correctly and efficiently?


I am quite puzzled about the theory that electrons or light often behave as particles and sometimes as waves. So, I wanted to know more about this phenomena and what happens when and why.

I often hear about the wave-particle duality, and how particles exhibit properties of both particles and waves. However, I wonder, is this actually a duality? At the most fundamental level, we 'know' that everything is made up out of particles, whether those are photons, electrons, or maybe even strings. That light for example, also shows wave-like properties, why does that even matter? Don't we know that everything is made up of particles? In other words, wasn't Young wrong and Newton right, instead of them both being right?


I am Trying to make an Intro Sequence with Plane Meshes to Light my Text. Is there a possibility to restrict the rendering of these lighting planes, and yet still use them as a Light Source?

In my scene it is required to position the lights close to the main object like this:    How I can make the light source invisible to the camera?


All I can really remember is that an alien species has three member "individuals" and that three humans go to their home world posing as figures from the aliens' mythology.  As humans are a complete entity in and of themselves, this race is only considered complete when all three biological pieces are present together and acting in concert. A single biological entity acting on its own is considered aberrant.

I suppose I read this story in a book in the nineties but I have no memory of actually reading it or the cover, I just remember a lot of the plot.  Scientists find out they are being contacted by the inhabitants of some other universe. I believe this happens by one element being exchanged with another (I remember wolfram was involved because I had never heard that word before) and messages somehow added. This leads to earth building some sort of machine together with the other universe (it is the description of this machine that I really would like to read again) that somehow generates energy on both sides. Only later do the people on earth realize, that it also slowly changes some of natures constants, threatening, I believe, the sun. The book also had detailed descriptions of everyday life in both universes. I remember some sport played in the lower gravity of the moon and the aliens having three distinctive sexes.


In Chapter 2-3,Vol I of the Feynman lectures, Feynman talks about a rule in quantum mechanics that says that one cannot know both where something is and how fast it is moving. That the uncertainty of the momentum and the uncertainty of the position are complementary,and the product of the two is bounded by a small constant. And that the law can be written as such: ΔxΔp≥ℏ/2  He then goes on to state: "This rule is the explanation of a very mysterious paradox: if the atoms are made out of plus and minus charges, why don’t the minus charges simply sit on top of the plus charges (they attract each other) and get so close as to completely cancel them out? Why are atoms so big? Why is the nucleus at the center with the electrons around it? It was first thought that this was because the nucleus was so big; but no, the nucleus is very small. An atom has a diameter of about 10^−8 cm. The nucleus has a diameter of about 10^−13 cm. If we had an atom and wished to see the nucleus, we would have to magnify it until the whole atom was the size of a large room, and then the nucleus would be a bare speck which you could just about make out with the eye, but very nearly all the weight of the atom is in that infinitesimal nucleus. What keeps the electrons from simply falling in? This principle: If they were in the nucleus, we would know their position precisely, and the uncertainty principle would then require that they have a very large (but uncertain) momentum, i.e., a very large kinetic energy. With this energy they would break away from the nucleus. They make a compromise: they leave themselves a little room for this uncertainty and then jiggle with a certain amount of minimum motion in accordance with this rule."  -Why is it that the momentum has to be very large? -Isn’t is the uncertainty of the momentum that has to be large not the momentum itself?  Since he stated earlier that in the rule,it is the uncertainty of the momentum,not the momentum itself that is complementary with the uncertainty of the position,and the product..by a small constant. -Is it because a larger momentum would mean a more uncertain momentum. If it is,why is that so?  -On the last line of making a compromise,whereby they leave themselves a little room for uncertainty —“they” refer to the electrons? —So,the way that the electrons leave a little room for uncertainty (increase the uncertainty of their position) is to surround at a distance around the atom’s nucleus,instead of being in the nucleus?  —At the same time,the jiggling with a certain amount of minimum motion is to increase the uncertainty of their speed?

A nucleus consists of protons and neutrons. Both are extremely heavy compared to electrons. Then how come they are contained within an extremely tiny space? And why does the atom consist of 99.999% empty space?  I do not understand the mathematics regarding this one bit. Please give me an explanation of this phenomenon in words as far as possible :)


I would like to share my point of view about allowing up-voting for very new users. I'm basically talking about the reputation points needed to up-vote any question/answer.  It is currently set to 15 and I'm wondering if changing it to 5 or 1 wouldn't be better for the community. I may be wrong, but I'd like to explain why I -and other developpers I worked with for years- think this way.  When I was a beginner in SO, I spent several months to get a 100 points, maybe half a year. It takes time, depending on your programming skills level and your ability to express yourself in the SO way, whether to ask or answer questions. While some people just answer once and get like 20 up-vote on their answer and get to 100+ reputation quite fast and earn a lot of privileges, sometimes just because of one good answer. Others may spend months to get to 50 or even 30 points and earn enough privilege to help the community back. It is not always fair.  My point is that while some people answer to the right question at the right time, others may spend months, even years to get enough reputation to be able to up-vote other questions or answers. (Yes, it happens)  I have talked with a few developpers about it and some of them told me that they were using SO to read questions/answers for more than a year without being able to up-vote anyone. Why? Because they never got up-voted enough, even asking some questions because most of the time they didn't need to ask, since SO cover so much areas, they usually found their question already answered and just read the answer but they couldn't up-vote anyone even if they wanted to, even if that answer helped them to solve a big problem and saved several hours of their time.  They were stuck at reading questions/answers without being able to up-vote right answers (and that was quite frustrating apparently). When someone helps you, you want to reward him, on SO we usually up-vote the answer to do so. But it is not possible if you haven't earned 15 reputation points.  So, since I don't see really any good reason to require 15 points I'm wondering if decreasing the reputation points required to up-vote an answer or a question wouldn't be better.  I thought about 1 and 5 points.    I don't think 1 is a good solution because it would be too easy for bots to make a mess. I think 5 is a good compromise, mostly because with that reputation you can create new topics, so why not being able to up-vote people answering to you as well? Furthermore, an up-vote from a user with 15 reputation isn't really more accurate than a user with only 5 reputation. So why not allow them to up-vote Q&A that have been helpful to them?   I don't think that change would decrease the quality of the community, I believe that even people with a few reputation points can help us to up-vote good Q&A (and by so get rid of bad answers by up-voting the right ones).  The only cons I see with this change is that more users would be able to up-vote, including bots and people who don't yet understand how the community works. But since the difference between 5 and 15 is quite small (and can be easily done if you really want to), I don't think it would affect badly SO.

I have been reading Stack Exchange for years - mostly not logged in, and have never posted (this is my first). I'm simply not very talkative, and very good at googling.  Recently a few occasions have come up when I've wanted to comment on a question.  I wanted either to ask for, or provide, clarification which did not warrant a new answer.  How do I gain enough reputation to comment without:   asking questions which have already been answered or that I can figure out on my own, or posting my comment like as an answer (i.e. being  rude)?


The arrayList politicCard of the class Player contains values from the enum Color, to test it i added three different values but it returns an error, isn't player.getPoliticCards().get(0) supposed to return the color value in position 0 that i added before?  public enum Color {     BLUE, BLACK, JOKER } public class Player {     private int id;     private ArrayList<Color> politicCards;     public Player(int id){         this.setId(id);     }     public ArrayList<Color> getPoliticCards() {         return politicCards;     }     public void setPoliticCards(ArrayList<Color> politicCards) {         this.politicCards = politicCards;     }     } public class PlayerTest {     @Test     public void PoliticCardsTest(){         Player player = new Player(1);         player.getPoliticCards().add(Color.BLACK);         player.getPoliticCards().add(Color.BLUE);         player.getPoliticCards().add(Color.JOKER);         assertEquals(Color.BLACK,player.getPoliticCards().get(0));     }  }

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


I see that label in most SharePoint JavaScript libraries. I am curious - what's that used for?  Example:  EnsureScriptFunc("clienttemplates.js", "RenderUserFieldWorker", function () {     ULS2Vv:; // <-- THIS IS THE LABEL IN QUESTION     var renderCtx = new ContextInfo();     renderCtx.Templates = {}; ... }

I am trying to understand more the structure of javascript functions in SharePoint. Why does every function begin with som value than colon and semicolon like ULSrE8:; in spgridview.debug.js:  function ULSrE8(){   var o=new Object;   o.ULSTeamName="Microsoft SharePoint Foundation";   o.ULSFileName="spgridview.debug.js";   return o; } var SPGridView_CallbackContext=null; function SPGridView_FilterPreMenuOpen(gridViewClientId,                                       templateClientId,                                       menuClientId,                                       dataFieldName, e) {ULSrE8:;     var gridView=document.getElementById(gridViewClientId); ...   What does {ULSrE8:; do?


How would I go about making a push button to act as a toggle switch. A switch would just stay in the active state until "un-switched". I need my button to toggle something.  Example:  Button down (active)   -> output active Button up (not active) -> output active Button down (active)   -> output not active Button up (not active) -> output not active   It should'nt matter how long the button is pressed for, it should only be able to deactivate once the button has been released once.  Currently I'm using a PROM to check for all these states but I feel like there should be an easier way, perhaps with a T-flip-flop, but if you hold the button for more than one clock pulse it messes up.

What are the simplest, cheapest, smallest ways to make a momentary switch produce a 2-state toggling output (latching momentary switch)?  In other words, the output is continuously low, and when you momentarily press the button/tact switch, the output changes to continuously high, and then when you press it again, it switches back to low.


Is there a quick way (without having to create new layers) to make the island circled in the bottom left a part of central america (dark blue) rather than a -part of Central France (yellow)?

I have a polygon which is actually composed of many polygons but it results as unique geometry in the shapefile. It's easier to explain with a picture. The yellow parts are in my shapefile a single polygon. I want to make each part be a different polygon with different attributes.    I tried with "Multiparts to single part" but the result is another layer with only those polygons. I need instead a unique layer.


I'm trying to run a virtual machine in VMware Workstation Pro 15 and I get an error message saying that I need to first disable Defender Device/Credential Guard.  I didn't know this was enabled so I did a bit of reading up on it and everything I've come across mentions that this is enabled along with HyperV.  However, I don't use or have HyperV installed and most of the instructions I've come across talk about disabling HyperV to get around this error.  If HyperV is not installed what would be the correct process for disabling Defender Device/Credential Guard and also wondering why would this be enabled in the first place if HyperV was never installed before.

I get the following error from VMware Player. A solution would be to run the commands mentioned in the thread below. Is there some other way to do this however? I do not wan't to mess around to much since I wan't to be able to restore all settings to their previous values later.


I am running SyncThing to keep a hard-drive at home in sync with one at my office.  Is there a way to mount both drives at the same mount point?  I'd like to detect when a drive is plugged in, and mount it at a single known mount point instead of /Volumes/[Disk Name].  This is so apps like Logic Studio, which reference media files (probably by path), can find the same media files at the same directory path, no matter which location I am at.  Currently, they lose the file when I switch locations and I have to go manually 'find' the new path for the app.  Thanks for any insights you could provide.

Using Mac OS X 10.4  I made a script a while ago for my linux box in order to take archived data off of 300 floppies that automated the process. I would make an image of the floppy and copy the files directly off of the floppy. I managed to install xcode on the machine (in order to install ddrescue)  The thing is on a linux box I mounted each floppy to /media/floppy and unmounted it to ddrescue it and copied it directly to a usb drive.  I'm trying to port my script to the mac, and it seems that it's default behavior is to automatically mount each zip floppy to the /Volumes folder, which is fine, except it uses the volume's name as it's mount point folder name. So if a floppy's volume name is, "Jimmy Bo Bobs" it will mount to /media/Jimmy /Bo /Bobs.   So my question is I need to get the volume name either consistent to one name, or adaptable to the volume's name.   So my initial question is can I some how mount a drive to a specific folder, Like I would normally do in linux?   #Linux  mount /dev/sd1 /media/floppy  #Mac  diskutil mount /dev/disk1s1 /media/floppy #Doesn't work   If it's not possible, is there an easy way to extract the volume's name so that I can then link the script like this.    Volumename=Jimmy Bo Bobs  do stuff to /Volume/$Volumename   I'm guessing if it's not possible I'll have to grep the mount command to the /dev/ pointer and then somehow parse that string which is what I want to avoid since it would require even more research.


I have a USB numpad that I want to use to control a specific application running as a daemon in the background. The daemon is written in Python and I'm currently reading input using python-evdev which works quite well.  However, everything I type on the keyboard is still also processed normally, meaning that keypresses are also inserted into any application dealing with keyboard input (including the login prompt that is shown when the computer boots up). This is somewhat annoying.  Is there a way to disable the "normal" processing of keyboard events, and only allow manual reading of the key states? Hopefully one that does not depend on running X.  Everything I've found so far seems to be dealing with disabling the keyboard completely or using X.  One idea I have is to create a keymap which maps all the keys to dead keys, which prevents any output, but still allows me to read the actual keycodes. However, it seems that there should be an easier solution to this problem.

I have usb barcode scanner that emulates keyboard. When it is connected, X gets the control and handles it as an usual keyboard and sends keyboard events to the current focused window.  This is not what I want to do. I have a program that read barcodes from ascii input stream and process them. This program runs at background and has no user interface at all.  How to configure Linux to not use this usb keyboard in X, but map it as a ascii stream device. This way, I will be able to redirect it as an input device for my program and to provide reading the barcodes, regardless of the input focus changes. And the barcodes should not be passed to the currently focused window at all.  In addition, it is better to not run the barcode handling program as a root, so the keyboard device should have read permissions for everyone.


Every once in a while (I can't pin down exactly when, but it seems to be correlated with when the computer is idle for a while), the System process on my Windows 8.1 x64 machine  suddenly starts using 100% of Core 1 of my CPU (8-core, so 12.5% of total CPU time). To fix it, I usually just reboot (the laptop fan noise is annoying) -- although I recently noticed it seems to automatically calm down after 5-10 mins of activity.  I've tried to find the culprit using Process Hacker, and it seems to be the function MmTrimAllSystemPagableMemory as shown in the image below.  I don't remember if this happened on Windows 8.0, but this has never happened to me before, when I've had Windows 7 or earlier. So I'm confused what has changed, because this is a pretty old function.  What might be causing this? Is there some way for me to prevent it?    For what it's worth, it seems this is related somehow to a Task (ResolutionHost?) and relevant APIs include MmScrubMemory and CMemoryDiagnosticHandler:

I have noticed that from some time my system is freezing and its probably caused by the high CPU usage which is caused by the system process.  All applications I'm running is the Skype, TeamSpeak and Chrome so it definitely shouldnt eat that amount of CPU.  You can see the problem itself and running processes in the screenshot below:    Sometimes CPU usage is reaching 90%, but the average usage is like 40-65%.  My PC parameters:   Windows 8 (customer preview) Intel Core i3 - 2350M 8 GB RAM   I'd appreciate any help attempt! Regards.  --UPDATE--  As the user below posted a great answer, I have noticed that the process that is eating the most CPU in the system is called Arthurx.sys, simple google tells that it's a TPLink driver (an wifi adapter, I have bought like 2 weeks ago!) drivers has been installed from the Windows MSDN, but also tried to install the drivers from the attached CD, but it doesn't help. From the system start, it is using like 5% of the CPU only, but after 2-4 hours of working it is growing up and reaching 40-60% of the CPU usage.  Device name: TPLink WN722N


I have two versions of Python installed: 2.7 and 3.4. I installed Django 1.8 as recommended in the Django tutorial. However, it got installed in Python 2.7 instead of Python 3.4 so when I type import django in Python 3.4 I get the error message    ImportError: No module named 'django'   If I type import django in Python 2.7 I get no errors.  Can anybody explain how I get Django 1.8 to be in the Python 3.4 path?

I installed Django with this command:   sudo apt-get install python-django   And it installed version 1.5.4-1ubuntu1. The Django docs say that as of version 1.5, Django supports Python 3. Yet when I run the python 3 interpreter and try importing Django, it says there's no such module. I tried looking for a python3 version of Django, but no such package exists. How can I get django working on python3? I'd prefer to use ubuntu packages instead of installing things manually.


Suggestion Required: I want to purchase a set of Latex books (Regarding Typesetting, Beamer, Tables, Graphics) for my library. your expert opinion regarding this matter is required.   Note: I already have LaTeX Beginner's Guide by Stefan Kottwitz.

Which book (free or otherwise) was the most useful to you when you started learning LaTeX?  I am frequently asked this question by friends who want to learn LaTeX, and I recommend the book which got me started, , but I feel that there might be better options around.  Also see .


We have been alerted to a page verify configuration error for the following databases (eIQSystem, eIQLegislation, eIQMeta and 000Company) on server SERVER01.  This monitor checks the Page Verify setting for the database mentioned above.   The Page Verify Setting discovers damaged database pages caused by disk I/O path errors.   Disk I/O path errors can be the cause of database corruption problems and are generally caused by power failures or disk hardware failures that occur at the time the page is being written to disk.   The databases option has been set to TORN_PAGE_DETECTION. Microsoft recommends that the setting must change to checksum as part of best practice. .  there is this discussion between  but there is no objective conclusion.  there is a good article regarding    Can we change the setting to checksum? is it safe? (would it affect any application)?

I've run sp_blitz (version 45) on our test database server. It complains about     Database [MDS] has TORN_PAGE_DETECTION for page verification.  SQL Server may have a harder time recognizing and recovering from storage corruption.  Consider using CHECKSUM instead.   But this is a database from Microsoft.  Is it wise to change the Page Verification to CheckSum?  Or should we wait for Microsoft to release a new version of MDS?


I know this question might have been asked before But I still cannot really find the answer, and the answer in my case should be simple.   So what have I done is in my ECS server I created a new user and gave it sudo privilege by assigning it to the sudo group. Then I change some of the sshd_config parameter:   change port from 22 to another PermitRootLogin from "yes" to "no" PasswordAuthentication from "yes" to "no"   And then I generate SSH key by ssh-keygen -t rsa and copy it to the authorized_keys by ssh-copy-id user@ipAddress  and then I restart the server, ssh login to the server and get the Permission denied (publickey) error.  In the server /home/user/.ssh folder lies authorized_keys, id_rsa.pub and id_rsa three files. But in my local machine .ssh folder there is no key file.   So where is the problem?

I am trying to connect to a Linode (running Ubuntu 12.04 LTS) from my local machine (also running Ubuntu 12.04 LTS)  I have created a private and public key on my local machine and copied my public key to my Linode's authorized_keys file.  However, whenever I try to ssh to my Linode I get the error message Permission denied (publickey).    It's not a problem with how ssh is set up on my Linode because I can ssh to it from my Windows machine using key authentication.    In my .ssh directory on my local Ubuntu machine, I have my id_rsa and id_rsa.pub files.  Do I need to create an authorized_keys file on my local machine?    EDIT:  This is what I get when I run ssh -vvv -i id_rsa [youruser]@[yourLinode]:  debug3: authmethod_lookup publickey debug3: remaining preferred: keyboard-interactive,password debug3: authmethod_is_enabled publickey debug1: Next authentication method: publickey debug1: Offering RSA public key: id_rsa debug3: send_pubkey_test debug2: we sent a publickey packet, wait for reply debug1: Authentications that can continue: publickey debug2: we did not send a packet, disable method debug1: No more authentication methods to try. Permission denied (publickey).


I've restored an old hard disk using photorec. So I've a lot of file of different kinds under about 400 folders. I'd like to, for example, move all jpg file into /restore_by_type/jpg I'm on windows 10 pro x64bit, insider preview

I want to copy all images of any file extension like .jpg, .png, .gif, etc. from all folders and subfolders in my PC hard drive (which has two partitions) to a single folder.  The total number of images I have is 250,000.


Help! After I downloaded Ubuntu 12.04 and 13.04 Desktop version, I find that I can't install it, as it doesn't work! It says that its not a valid win32 application and I know it's not.  But why is it that, if I use my very old first version of Ubuntu Linux desktop that was delivered to me from Ubuntu - it can still install normally even though it has no updates.  How come this version that I download from your link on the Ubuntu website, is not working? The folder  size is 0kb.  I really wanted to have the 12.04 version of Ubuntu Desktop... I really want to install Ubuntu inside my Win Xp OS.  I love Ubuntu!!!

Ubuntu 12.04 won't come with the Windows Installer (Wubi) pre-added. But is there any way to install 12.04 using Wubi?


please look on this:  $ sudo apt-get install ppa-purge Reading package lists... Done Building dependency tree        Reading state information... Done The following packages were automatically installed and are no longer required:   linux-headers-4.4.0-31 linux-headers-4.4.0-31-generic linux-image-4.4.0-31-generic linux-image-extra-4.4.0-31-generic Use 'sudo apt autoremove' to remove them. Suggested packages:   aptitude The following NEW packages will be installed:   ppa-purge 0 upgraded, 1 newly installed, 0 to remove and 21 not upgraded. 2 not fully installed or removed. Need to get 6 312 B of archives. After this operation, 24,6 kB of additional disk space will be used. Get:1 http://cz.archive.ubuntu.com/ubuntu xenial/universe amd64 ppa-purge all 0.2.8+bzr63 [6 312 B] Fetched 6 312 B in 0s (39,1 kB/s)       Selecting previously unselected package ppa-purge. (Reading database ... 265550 files and directories currently installed.) Preparing to unpack .../ppa-purge_0.2.8+bzr63_all.deb ... Unpacking ppa-purge (0.2.8+bzr63) ... Processing triggers for man-db (2.7.5-1) ... Setting up runit (2.1.2-3ubuntu1) ... start: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused dpkg: error processing package runit (--configure):  subprocess installed post-installation script returned error exit status 1 dpkg: dependency problems prevent configuration of git-daemon-run:  git-daemon-run depends on runit; however:   Package runit is not configured yet.  dpkg: error processing package git-daemon-run (--configure):  dependency problems - leaving unconfigured Setting up ppa-purge (0.2.8+bzr63) ... No apport report written because the error message indicates its a followup error from a previous failure.                                                                                Errors were encountered while processing:  runit  git-daemon-run E: Sub-process /usr/bin/dpkg returned an error code (1)   I was try this two process reinstall but without effects after OS restart.

I am using 15.04.   So I'm working with git and I installed the standard version. I set up the ssh keys and was able to clone one of my repositories to the correct folder. Everything was working great and then I decided it was a good idea to install more packages. I ran sudo apt-get install git-all. I'm looking at error codes now having to deal with upstart.  start: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused No apport report written because the error message indicates its a followup error from a previous failure. dpkg: error processing package runit (--configure):  subprocess installed post-installation script returned error exit status 1 dpkg: dependency problems prevent configuration of git-daemon-run:  git-daemon-run depends on runit; however:   Package runit is not configured yet.  dpkg: error processing package git-daemon-run (--configure):  dependency problems - leaving unconfigured Errors were encountered while processing:  runit  git-daemon-run E: Sub-process /usr/bin/dpkg returned an error code (1)   This is what happens when I even update/upgrade my system. At this point all I'm looking to do is be able to install software and update my current software. Is there any way I can potentially reverse this issue or at least correct it?   Edit: Thankfully this issue was solved only a day or two after it happened. The accepted answer worked perfectly and took care of my issue


In a medium size code I have a base class like this  class Base { public:  virtual ~Base() = 0; //This is the important point };   In a derivate class I have something like this  class Derivate : public Base { public:  ~Derivate(); };   An implementation of the virtual constructor is provided (it basically does some deallocation on the base class) the derivate class extends such behaviour to the derivate class. Since the base class is abstract I cannot instantiate anything.  I have a wrapper class like this  class Wrapper {  public:    ~Wrapper();  private:    Base *stuff; }   Now I could have several derivates classes of the base one, so basically the purpose would be to let the user have the freedom of chose what to put in stuff The destructor of Wrapper is implemented as  Wrapper::~Wrapper() {   stuff->~Base(); }   (My actual code follows such pattern). However when the destructor of wrapper is called an error is returned when I debug using gdb, where basically is stated that ~Base() Is a pure virtual method, which is true, however I thought that because is virtual anyway the actual constructor of the derivate class would have been called instead.  Is my understanding wrong? What Am I missing? Shall I decler the destructor of Base just as virtual and not pure virtual?  Note : Please keep in mind that the code I posted is a just some scratch.  Thank you.

Is it wrong to write:  class A { public:     virtual ~A() = 0; };   for an abstract base class?  At least that compiles in MSVC... Will it crash at run time?


System utilities such as ls don't need to have the full path typed before executing them. However, to execute Netbeans, I have to type /home/chris/netbeans-7.0.1/bin/netbeans. How can I make it so that I only have to type netbeans?

I'd like to know if there is a way to run  program/shell script without typing full path:  /opt/idea/bin/idea.sh


Is it possible to prove that I know a value v in a finite set, such that the hash of the value v is K.  Where v is private and K is public

Given a Pedersen Commitment:  $P = aG + vH$  Where $G$ and $H$ are points in some group. $a$ is a blinding value/mask and $v$ is the value I wish to commit to.  Is there a way to prove I know $v$ without revealing it?


How do I recover deleted rows from a table while having Recovery SIMPLE Model? Database is in Microsoft SQL Server 2014. I have managed to find them in fn_dblog table before data is overwritten with a new one. Can I do anything with it?  SELECT * FROM fn_dblog(NULL, NULL) WHERE Operation = 'LOP_DELETE_ROWS'   I also find out the specific time at which rows were deleted.  USE Databasename GO SELECT [Current LSN],  Operation, [Transaction ID], [Begin Time], [Transaction Name], [Transaction SID] FROM fn_dblog(NULL, NULL) WHERE [Transaction ID] = ‘000:000001f3' AND [Operation] = 'LOP_BEGIN_XACT'   I've read SIMPLE Recovery doesn’t support transaction log backup. But is there really no way to restore that data?

I mistakenly deleted around 2,000,000 records from a remote SQL Server 2008 table.  The server is not granting me access to the backup files on the server side.   Is there any way to get back these records?


I want to build Python 2.7.8 on my Ubuntu 12.04 machine, which has Python 2.7.3 as default distribution. I would like to "install" Python 2.7.8 but isolate it completely from Python 2.7.3 - meaning, I don't want to interfere at all with the distribution's default Python, including modules installed via apt-get or PIP.   I would like to do this from source, and I would like not to use virtualenv - I'd rather learn to do it the "hard" way before using more sophisticated tools.  A second related part to this question is, after I have installed Python 2.7.8, how can I have two different PIPs, the default installing Python modules to Python 2.7.3, and the alternative installing modules to Python 2.7.8?  Thanks.

I'm totally new to Ubuntu/Linux, using Ubuntu Server at the moment. Just trying to  figure out something basic.   How can you tell where you are installing a program. For example I just installed Sphinx search engine by placing the tarball that I downloaded from their site to my:  /home/sphinx   directory. I created the sphinx directory to place that tarball in. Then I ran these commands:  tar xvzf sphinx-0.9.8.1.tar.gz cd sphinx-0.9.8.1/ ./configure --with-mysql-includes=/usr/include/mysql --with-mysql-libs=/usr/lib/mysql   and then these:  make sudo make install   Now I have a lot of files sitting in the directory where I ran these commands. Is this my Spynx installation or did it install somewhere else?  In windows if you run an installer (.exe file) anywhere the program will still install in your C:\Program Files directory. Does something similar apply to linux where all programs are installed in a central place, or can you install programs anywhere on the system.  Questions   I would prefer to keep all my installed programs in one place so what is the right place for this in terms of best practice. In other words what is the Linux equivalent of C:\Program Files? And how does one always install at this location, is it just a matter of placing the tarball and running the install commands from this location? What about if I use sudo apt-get to install a package. How can I point to this location to tell apt-get to always install there?


My currently bountified question,  is nearing its end of extra publicity and I don't think it will have a favourable answer any time soon.   By the looks of how the question went, the problem needs more research and related updates from time to time until I, or some other person, gets it right.   It will be better not marking any answer right now and making the question visible to others when updates happen.   Can anything be done about this by the moderators?

It's possible to offer and award bounties of reputation on questions.   What is a bounty? How can I find questions that have a bounty attached? How do I start a bounty? When can I start a bounty? Why is the system requiring me to choose a bounty amount that's higher than the minimum? Can I use Markdown formatting in the bounty remarks? Can I edit the remark? How long is the bounty period? How do I award a bounty? Can I award a bounty to my own answer? Can I award a bounty to an old answer? If I offer a bounty on someone else's question, can I award the bounty to their answer? After awarding the bounty, can I remove it or move it to another answer at a later time? What happens if there's no answer after the bounty period? What happens if I feel my question is still unanswered? What is automatic awarding? Are bounty awards exempt from the 200 points/day reputation limit? How does Community Wiki mode affect bounties? How does user deletion or post dissociation affect bounties? Can I award a bounty to an answer from a deleted user or one where the author was dissociated? Can I offer a second bounty after the first one has expired? Can I raise my bounty? What happens if a bounty question is closed or deleted? Why can't I vote to close or migrate a bounty question? What happens if I delete my account while I have an active bounty? Do I keep an awarded bounty when I delete my answer? What happens if a question where I awarded a bounty later gets deleted or migrated? Can I cancel my bounty? Can I affect / divide / share part of my bounty to two (or more) users? How many outstanding bounties can a single user have?      See also:  in the Help Center


I made a sharefolder on vmbox.    I typed   sudo mount -t vboxsf /home/paatubo/Desktop/vmshare/   But it showed the following message as response:  mount: can't find /home/paatubo/Desktop/vmshare in /etc/fstab   How can I fix it?

I have Ubuntu installed in Virtualbox. I want to mount my VirtualBox shared folder in Ubuntu automatically when I log in Ubuntu. I put the following line in my ~./bashrc and ~/.bash_profile:  sudo mount -t vboxsf windows_share /media/windows_share   where windows_share is the name I created with Virtualbox. But everytime I start my Ubuntu, it asks me for passwd since it needs sudo. Is there anyway to automatically mount Windows share without entering password every time I log in?


Question For a possibly convoluted reason (see below), I want to do something like the following: def import_np():     import numpy     return numpy.array([0])  def test_np():     return numpy.array([1])  Now if I try calling these two methods, the first works but the second doesn't: it says numpy is not defined. How can I fix this? Background I would like to import an in-house module of which we have many versions (edit: to clarify, we branch for every release). Ideally, I'd like to parametrise the import statement, but I can't do that, so I thought I could have a function that looks like this: def import_version(path_to_version):     sys.path.append(path_to_version)     import the_module  However, I can't use the_module outside of this method, which has led to my question above.

How can I load a Python module given its full path? Note that the file can be anywhere in the filesystem, as it is a configuration option.


Pardon me for my stubborn classical/semiclassical brain. But I bet I am not the only one finding such description confusing.  If EM force is caused by the exchange of photons, does that mean only when there are photons exchanged shall there be a force? To my knowledge, once charged particles are placed, the electromagnetic force is always there, uninterruptedly. According to such logic, there has to be a stream of infinite photons to build EM force, and there has to be no interval between one "exchange event" to another. A free light source from an EM field? The scenario is really hard to imagine.  For nuclei the scenario becomes even odder. The strong interaction between protons is caused by the exchange of massive pions. It sounds like the protons toss a stream of balls to one another to build an attractive force - and the balls should come from nothing.  Please correct me if I am wrong: the excitations of photons and pions all come from nothing. So there should be EM force and strong force everywhere, no matter what type of particles out there. Say, even electrical neutral, dipole-free particles can build EM force in-between. And I find no reason such exchanges of particles cannot happen in vacuum.   Hope there will be some decent firmware to refresh my classical brain with newer field language codes.

Since Newton's law of gravitation can be gotten out of Einstein's field equatons as an approximation, I was wondering whether the same applies for the electromagnetic force being the exchange of photons. Is there an equation governing the force from the exchange of photons? Are there any links which would show how the Coulomb force comes out of the equations for photon exchange? I know that my question is somewhat similar to the one posted here , but it doesn't really have an answer to my question specifically.


Let $f$ and $g$ be holomorphic on $\mathbb{C}$ and $|f|\le C|g|$.  Show that there exists $\lambda\in\mathbb{C}$ such that $f=\lambda g$.  I know I should use Liouville theorem but I don't know how. Any input?

Suppose $f$ and $g$ are entire functions with $|f(z)|\leq|g(z)|$ for all $z$.  How can we show that $f=cg$ for some complex constant $c$?  Thanks for any help :)


$$\sum_{k=1}^n {(k^3)} = \left(\sum_{k=1}^n {k}\right)^2 $$   How could I approach this problem to make a combinatorial proof?

I recently proved that  $$\sum_{k=1}^n k^3 = \left(\sum_{k=1}^n k \right)^2$$  using mathematical induction.  I'm interested if there's an intuitive explanation, or even a combinatorial interpretation of this property. I would also like to see any other proofs.


I was wondering whether a person will be electrocuted if he is in large pool or a sea which is connected through a source of electricity . As sea water is saline it will conduct electricity so will it be dangerous !?

In , the second episode of the Hunger Games trilogy, one of the characters (Beetee) proposes a plan to kill some of the remaining tributes. He proposes wrapping a special wire that he has designed to withstand the vast energy of lightning around a tall tree and running it down to a salt water lake. Then when lightening strikes the tree (which it does predictably every twelve hours) anyone in the lake will be killed. (N.B. This is not Beetee's real plan, but it is the one he wants his allies to believe.)  I don't think his plan would work at all. Assuming that his wire can carry the enormous current delivered by a lightening strike (this is fiction after all) surely the current would short to ground through the salt water rather than taking a path through anyone standing or swimming in the water. The analogy I have in mind is that of birds standing untroubled on live electricity wires. They are unharmed because they do not provide a path to earth. But another analogy might be dropping a mains electric heater into a bath when you are in it. I think that kills you (though I'm not sure why.)


Hello Stack Exchange community,  I'm relatively confused on what to do in this scenario. I am running an experiment that retrieves data of interest and stores it as an array. Experimental conditions are slightly different, and for my specific application, it is important to measure heterogeneity of my data. I was asked to use a distance metric for my 2D histograms generated post data analysis.  However, there are a wide array of options available after doing a literature search. There is the "Earth Mover's Distance", the Jensen-Shannon metric (the square root of the Jesen-Shannon divergence value), Bhattacharyya distance, Minkowski distance, etc.  I understand that these distances are defined differently, quantitatively speaking, and thus have difference implications, but for my example, what seems to be an efficient metric at quantifying differences in histograms (i.e, getting to the end goal of assessing heterogeneity)?  Thank you

Given two histograms, how do we assess whether they are similar or not?  Is it sufficient to simply look at the two histograms? The simple one to one mapping has the problem that if a histogram is slightly different and slightly shifted then we'll not get the desired result.  Any suggestions?


There is a function       $f(x):= \begin{cases} e^{-1/x^2}, & \text{if $x \neq 0$} \\ 0, & \text{if $x=0$} \end{cases} $.     That function's $n$-th derivative is $0$ : $f^{(n)}(0) = 0$. How to derive that?

Given the function   $$ f(x) = \left\{\begin{array}{cc} e^{- \frac{1}{x^2}} & x \neq 0 \\ 0 & x = 0 \end{array}\right. $$  show that $\forall_{n\in \Bbb N} f^{(n)}(0) = 0$.  So I have to show that nth derivative is always equal to zero $0$. Now I guess that it is about finding some dependencies between the previous and next differential but I have yet to notice one. Could you be so kind to help me with that?  Thanks in advance!


So i am trying to apply regex to a string in javascript. I just can't get the right pattern.  I Basically have a multiline string that contains a name with an optional amount at the end. Something like this Warrior II x2. I want one capture group for the name and one for the amount without x. So this should capture {Warrior II,2}  I tried this: ^(.+)(?:x(\d+))?$. the problem is this; the .+ will always match everything, including the amount. to the second capture group will always be empty. And since the name can contain anything even numbers and non ascii stuff I can't really replace .+ with something like \D+  So the question is how do I force regex to always capture the second group if it exists and not include that part in the first group. I even tried the lazy modifier with the .+ but that did no work either.  I hope i described my problem understandably.  I tested most of my regex with regex101.com

I have this gigantic ugly string: J0000000: Transaction A0001401 started on 8/22/2008 9:49:29 AM J0000010: Project name: E:\foo.pf J0000011: Job name: MBiek Direct Mail Test J0000020: Document 1 - Completed successfully  I'm trying to extract pieces from it using regex. In this case, I want to grab everything after Project Name up to the part where it says J0000011: (the 11 is going to be a different number every time). Here's the regex I've been playing with: Project name:\s+(.*)\s+J[0-9]{7}:  The problem is that it doesn't stop until it hits the J0000020: at the end. How do I make the regex stop at the first occurrence of J[0-9]{7}?


Is it possible to not show the user the disk size and available space on their mapped fileshares? I would like to not display "132GB free of 145GB" if possible.  Server 2012 Windows 7

I would like to know if there is a way, preferably through Group Policy, that one can hide the total size listing and the free space listing on network drives.  We have an active directory environment that we map network drives to a MS Windows File Server.  We are afraid that users will become either unnecessarily concerned about the free space that is displayed or they will think that it is a free for all chewing up whatever space they want.  I do know about the use of quotas and how that will change the visual display, but we are not able to implement quotas within our organization due to various reasons.


I was wondering if there was an analytic description of the distribution of the largest $m$ of $n$ samples of a Gaussian distribution, where $n \geq m$.  (As an example, I generated 100 samples from $\mathcal{N}(\mu = 0, \sigma = 1)$. The average of the top 100 samples came to $0.0404$, the average of the top 50 samples came to $0.832$, the average of the top 10 samples came to $1.842$, and the top 1 sample was 2.88.)  Intuitively, as $n$ increases and $m$ stays constant, or $m$ decreases and $n$ stays constant, the expected value increases. It's like taking the top $m$ applicants.  Is there a name or analytic description of such a distribution?  (I haven't been able to figure out how to do this, and I spent a lot of time searching. This seems like a simple / common problem and I'm surprised I haven't found anything on it.)  EDIT: After the comments below, I as able to find a good answer here:

Are there well known formulas for the order statistics of certain random distributions? Particularly the first and last order statistics of a normal  random variable, but a more general answer would also be appreciated.  Edit: To clarify, I am looking for approximating formulas that can be more-or-less explicitly evaluated, not the exact integral expression.  For example, I have seen the following two approximations for the first order statistic (ie the minimum) of a normal rv:  $e_{1:n} \geq \mu - \frac{n-1}{\sqrt{2n-1}}\sigma$  and  $e_{1:n} \approx \mu + \Phi^{-1} \left( \frac{1}{n+1} \right)\sigma$  The first of these, for $n=200$, gives approximately $e_{1:200} \geq \mu - 10\sigma$ which seems like a wildly loose bound.  The second gives $e_{1:200} \approx \mu - 2.58\sigma$ whereas a quick Monte Carlo  gives $e_{1:200} \approx \mu - 2.75\sigma$, so it's not a bad approximation but not great either, and more importantly I don't have any intuition about where it comes from.  Any help?


I am looking at a problem in the Goldstein Classical Mechanics Textbook where we are given that a one dimensional systems lagrangian is $$L=m^2\dot{x}^4/12+m\dot{x}^2V(x)-V_2(x)$$ and asked to determine the equations of motion. From this, I got the  Euler-Lagrange equation to be $$m^2\dot{x}^2+2mV(x)\ddot{x}+mV^\prime(x)\dot{x}^2+V_2^\prime(x)=0$$ Does anyone have any advice on where to go from here? Is there some sort of simpliflication or integrating factor that will bring all these together and allow for the equations of motions to be found?

I saw this Lagrangian in notes I have printed:  $$ L\left(x,\frac{dx}{dt}\right) = \frac{m^2}{12}\left(\frac{dx}{dt}\right)^4 + m\left(\frac{dx}{dt}\right)^2\times V(x) -V^2(x). $$ (It appears in the exercises in the first chapter of Goldstein.)  What is it? Is it even physical? It seems like it doesn't have the right units of energy.


I have configured numerous .gitignore files to filter out many different unwanted files from a set of about 6,000 untracked files. I want to do git add . when I've got my filtered list looking the way I want it.  But, then I want to disable the .gitignore filters temporarily to see what got left behind, and make sure there was nothing important accidentally filtered.  I know that git-clean includes an option to ignore .gitignore files. Is there a similar option for git-status?  I could go through and delete all the .gitignore files, do the check, then restore them, but it seems there should be an easier way?

I am getting my feet wet with Git and have the following issue:  My project source tree:  / | +--src/ +----refs/ +----... | +--vendor/ +----...   I have code (currently MEF) in my vendor branch that I will compile there and then move the references into /src/refs which is where the project picks them up from.  My issue is that I have my .gitignore set to ignore *.dll and *.pdb.  I can do a git add -f bar.dll to force the addition of the ignored file which is ok, the problem is I can not figure out to list what files exist that are ignored.  I want to list the ignored files to make sure that I don't forget to add them.  I have read the man page on git ls-files and can not make it work. It seems to me that git ls-files --exclude-standard -i should do what I want.  What am I missing?