I have some doubts and confusion. Please clarify by explaining the science behind it. Thank you. I have no knowledge in electicity. Regardless what i put as voltage and current is just example, just want understanding on it. Hypothetically, a charger output 5V 2A, device input 5V 0.5A will it work? I read that if input is lower than output will work because device draws what it demand from charger and current is low so preventing cable and charger heating up which may lead to fire.  Everything should be fine because communication exists between charger and device due to the circuitry component thing of device and charger (please clarify). Device has a charging controller component in it and so do charger. Device can be phone, tablet, laptop, electric fly swatter, etc. whereas charger can be power bank and power brick or corded wall wart.  However, someone pointed despite working fine its damaging charger due to heat building up at charger and will die at point (please clarify) and  some say by charger will supply its stated current in this case 2A than the needed 0.5A it will cause battery to swollen (please clarify). Does this has to do with the circuitry thing?   On the other hand, if a charger has output 5V 2A, device input 5V 3A will it work? I read that if input is higher than output will not work because device draws what it demand from charger and current is high so it causes the charger to heat up and oversupply which may lead to fire in cable and charger and blown fuse in charger.  Everything should be fine because communication exists between charger and device due to the circuitry component thing of device and charger (please clarify) mentioned above because  I read charger will only supply up until its stated current output so no blown fuse and device just chargers slower? (please clarify)  What if the voltage and current output is different from required v and I input? Will it work? I read it should because regardless voltage higher or lower it wouldn't work cuz too high device swollen and heat up while too low device wont charger or work. (please clarify)  How about current how does current gets affected in this situation when voltage and current is different? I just know (no knowledge about it, just informed about the words) is depending on device and charger intelligence and the communication circuitry thing,are there more? Please clarify help understand things. Thank you.   I hope you understand what I'm talking about.

Power supplies are available in a wide range of voltage and current ratings.  If I have a device that has specific voltage and current ratings, how do those relate to the power ratings I need to specify?  What if I don't know the device's specs, but am replacing a previous power supply with particular ratings?  Is it OK to go lower voltage, or should it always be higher?  What about current?  I don't want a 10 A supply to damage my 1 A device.


How can I recursively find all audio and video files in a directory and move them elsewhere in a single operation?

I created a folder on my home directory call junk, and let's say I want to move all .cpp and .h files to it. How would I do it? My first thought is to start with find ~ -name *.cpp -print, but I don't know how to put in multiple patterns into the find argument, and I'm fairly lost after that.


I am looking at how to create a realistic looking gold material (for instance for ingots). So I am looking at a "pure gold" material. When I google I find this #FFD700 hex value for the . This is a very saturated color of red and green (and NO blue). When I use that color for a simple glossy shader then I get this image. Somehow this color does not feel right ...    I also found a  at blend swap.     The shader is much more complex and a mix of colours is used (mixing forecolor and middle color and then mixing again with a back color).   Can someone explain this? Why this mixing of colors? And why is the Gold color code (#FFD700) not being used in this shader setup? Most people use a color with some blue in it.  How to construct a realistic gold shader? And what color to be used?

Brand new to blender, and I'm trying to make a metallic object that is reflective.  There are lots of tutorials on youtube, however none of them are compatible with blender 2.71 with the cycles render.   Here are the tutorials I have tried:        All of these tutorials have a 'transparency' and a 'mirror' option in the outliner menu that I just don't seem to have.   How can I make this object reflective? Am I missing plugins or some other menu?


I am trying to make a simple test class to get the code coverage. This is the class of the documentation in Salesforce which must be tested. Has anyone a sample for me :) ?  Best regards. Constantin  global class CreateIndividualFromContact implements Database.Batchable<sObject> { global Database.Querylocator start(Database.BatchableContext BC) {    //Query to fetch contacts that don't have Individual created. You may modify the query to add custom fields      //Please add  "IsPersonAccount = false" condition to below query to exclude person accounts    return Database.getQueryLocator('Select FirstName, LastName, Salutation from Contact where IndividualId = NULL'); }  global void execute(Database.BatchableContext BC, List<Contact> contactList) {      Map<Id, Individual> individualRecordsToCreate = new Map<Id, Individual>();     for(Contact con : contactList) {         individualRecordsToCreate.put(con.Id, new Individual(FirstName = con.FirstName, LastName = con.LastName, Salutation=con.Salutation));     }     insert individualRecordsToCreate.values();     for(Contact con : contactList) {         con.IndividualId = individualRecordsToCreate.get(con.Id).Id;     }     update contactList; }  global void finish(Database.BatchableContext BC) {}   This is what I am trying to create. It may be totally wrong..   @isTest public class test class{ static testmethod void test_method1() {  List<Contact> acts = new List<Contacts>(); for (integer i=0;i<200;i++) {  Contact a= new Contact (FirstName=Test contact+i, LastName= Testq, salutation= Sehr geehrter Herr) acts.add(a); }  Test.StartTest(); insert acts;  Test.StopTest(); // List<contact> inserted_acts [select FirstName, LastName, salutation where ID IN :acts]; for (Contact i_a : inserted_acts) {  System.assertEquals()  }  }

This is a canonical question and answer developed by the community to help address common questions. If you've been directed here, or your question has been closed as a duplicate, please look through the resources here and use them to shape more specific questions. To browse all canonical questions and answers, including more unit test resources, navigate to the  tag.  This canonical question is intended to address several classes of common questions by providing a quick summary and links to comprehensive resources:   How do I start writing my first unit test?  How do I unit test this code?  I need help writing this unit test.   Salesforce Stack Exchange looks for detailed, specific questions that the community can help you with, and can't write tests on your behalf. We feel that working with the resources below can help you get started, and we encourage you to make an attempt to write your test and return to SFSE with your specific questions when you encounter challenges you can't resolve.


how can I achieve below things in javascript  var parent = {   a: 5,   b: 6 }  var child = parent; console.log(child.b); // 6  //now if I change the value of b parent.b = 7  console.log(parent.b); //7 console.log(child.b); //7   //but I want to preserve the previous value of the object property it should not change now.it should show 6 instead of 7 in case of console.log(child.b)

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.


So just a little while ago i was flipping out because i was 2 rep away from my 10k rep goal    but then all of a sudden it was then 10,008 rep because someone upvoted me. however i didn't get any notification about this +10  [    now as you can see in the screenshots above, over the past 2 days i got 2 upvotes to a question i posted, however the notifications only shows 1 +10 notification. and they system knows i got the upvote because i knew that i now have access to mod tools.  I am on a Windows 10 Laptop using Chrome 78.0.3904.97 (Official Build) (64-bit)

My reputation on Stack Overflow suddenly raised from 35k to 45k! And it seems that on other sites as well! It must have been in the past hour!  What happened? I don't see any record in the reputation history or jump in the chart, everything is just smooth! And it seems it happened on other sites as well!  I'm not complaining, just curious! :-)  EDIT: The discussion was "it was in the banner, you should have read it", and when I replied that I am closing banners without reading, and important announcements like that should be in the notification box, I got comments like "Oh yeah not reading banners is bad".  Now look at this and tell me: is anyone still surprised that I got used to closing banners without reading?? ;-)


I have create an application in 32 bit it works fine but when i change its architecture from 32 bit to 64 bit from visual studio its shown an error like Bad image format exception.  Application referenced dll `like         DataAccess 32 bit dll.    ApplicationData 32 bit dll.   System dll,   System.core dll,   Microsoft.Office.Interop.Excel      Getting Error `like :-      An unhandled exception of type 'System.BadImageFormatException'   occurred in mscorlib.dll      Additional information: Could not load file or assembly 'DataAccess,   Version=4.0.0.13, Culture=neutral, PublicKeyToken=null' or one of its   dependencies. An attempt was made to load a program with an incorrect   format.

I have an application that we're trying to migrate to 64bit from 32bit.  It's .NET, compiled using the x64 flags.  However, we have a large number of DLLs written in FORTRAN 90 compiled for 32bit.  The functions in the FORTRAN DLLs are fairly simple:  you put data in, you pull data out; no state of any sort.  We also don't spend a lot of time there, a total of maybe 3%, but the calculation logic it performs is invaluable.  Can I somehow call the 32bit DLLs from 64bit code?  MSDN suggests that I can't, period.  I've done some simple hacking and verified this.  Everything throws an invalid entry point exception.  The only possible solution i've found so far is to create COM+ wrappers for all of the 32bit DLL functions and invoke COM from the 64bit process.  This seems like quite a headache.  We can also run the process in WoW emulation, but then the memory ceiling wouldn't be increased, capping at around 1.6gb.  Is there any other way to call the 32bit DLLs from a 64bit CLR process?


The problem is finding an irreducible polynomial in $\mathbb{Z}[x]$ such that it is reducible modulo 2,3 and 5. I can't find anything, any help is appreciated. (Is there some general strategy for doing this?)

How to show that $x^4+1$ is irreducible in $\mathbb Z[x]$ but it is reducible modulo every prime $p$?   For example I know that $x^4+1=(x+1)^4\bmod 2$. Also $\bmod 3$ we have that $0,1,2$ are not solutions of $x^4+1=0$ then if it is reducible the factors are of degree $2$. This gives that $x^4+1=(x^2+ax+b)(x^2+cx+d)$ and solving this system of equations $\bmod 3$  gives that $x^4+1=(x^2+x+2) (x^2+2x+2) \pmod 3$. But is there a simpler method to factor $x^4+1$ modulo a prime $p$?


I will be taking over as DM of our group in a few weeks.  Our party right now has a large number of magic items, and while I don't have a problem balancing that, I would rather replace lesser ones with greater ones.  The plot device I have chosen to do this, as part of the Hoard of the Dragon Queen adventure, is to have a dragon wyrmling attack the group as part of a medium challenge encounter.  When the wyrmling is killed, an ancient dragon appears to demand reparations from the group in the form of relinquishing one of each of their magic items.  What I want NOT to happen is for the group to decide they can kill the ancient dragon - because they can't.  The ancient dragon I plan to use is the Silver, and mainly because it can paralyze with its breath attack.  The party being a band of murderous heathens makes this problematic — I honestly believe they would attack almost any foe and ask questions later. How do I ensure that the party doesn't go kamikaze on the ancient dragon?  If it makes a difference, the group is composed of six 7th-level characters. Only one of them is a melee attacker.

There are some play-styles of D&D in which the spectre of player-character death is considered a feature of the game rather than a bug. For my own reasons (which aren't the point of the question), I see them as a feature especially in exploration-focused games (e.g., sandboxes, old-school dungeon-crawling) where there are lots of ways for players to arm themselves with enough information to make informed decisions about the dangers they're willing to tackle.  Even with players that play strategically, seeking that intel and using it to pick their battles strategically, it is still on the DM's shoulders to provide good clues and tell-tales during play. How well the DM does this will significantly impact the players' ability to make informed decisions on where to go, how to prepare, what to fight, and what to avoid. If the players don't catch the clues, it should be because they weren't paying attention or didn't put 2 and 2 together, not because the DM's descriptions suck.  What techniques can the DM use to effectively telegraph to the players the existence and/or nature of the dangers they face?  These assumptions are inherent in the question:   The players are already playing strategically, and don't need to be "trained" in this play-style. Senseless, random PC death is a real possibility, not just threat to set the tone of the game or generate fearfulness in the players. Characters almost always die when players put them in dangerous situations they're not prepared to deal with. Characters might live when players are observant, know what dangers to expect, are well-prepared, and don't take on dangers that are beyond their ability—and even then, the dice have to go in their favour. Knowledge is the edge they need to bend the odds in their favour. The players don't necessarily have access to stat blocks or other, out-of-game information on in-game dangers. Players are relying on the DM's descriptions to understand the world, including its dangers and rewards.   (This isn't an invitation to argue whether an exploration, frequent-PC-death play-style is good or not. That's just background to the question.)   Related:


I am not sure how to edit, update profile pic, bio on Android app itself. While clicking on more info of summary text area is not expanding.

It would be nice to update the profile page from within the app.  Perhaps not many people update their profiles more frequently, but when required to do so, I would prefer to do it from the app instead of the mobile browser.


A long while back I read a fairly short story about a boy who happened across a bunker that was stocked with supplies for longterm survival, MREs and such I believe.   The major plot device was that in the sink (I think) there was a gateway or portal to a black hole. He comes to this conclusion after holding a stopwatch outside of the doorway of the bunker and notices that it is spinning extremely slowly. He comes to the conclusion that he will stay in the bunker for a calculated amount of time such that he is an adult in the outside world when he leaves.  However, at a certain point he notices a creature getting ever-closer in the sink or portal. At the end of the story when he leaves the creature or machine completely destroys the portal and bunker with it. I'm not sure of the conclusions he makes on this, perhaps that the creature was built to destroy the warp in space-time by some other species on the other end of it.  Does this sound familiar to anyone? I've wondered about what the title of this story is for years lol  Thanks!

There was this pocket book, back when I was a teenager (20 years ago), with these two twins discovering a room (it was something like a tool shed) where time flowed slower (1 hour inside was equal to 1 minute outside if i remember correctly).   Inside the shed there was a sink and a strange snake-ish metallic monster was slowly coming out from it.  One of the twins, the one with the "less marked" personality, decides to spend one year (during a whole night) inside the room in order to get out older than his twin.  I don't remember what happens with the monster, I think they destroyed the whole shed in the very end.


I need add drops water to my plastic bottle.  I use for my bottle Glossy material and for my drops glass material.    I look for this aspect:

I want to know if it's possible to simulate perspiration on a surface in cycles such as in the following images:      If so what techniques should be used?


I am given the values for mean, co-variance, initial_weights for a mixture of Gaussian Models. Now how can I generate samples given those: In brief, I need a function like   X = GMMSamples(W, mu, sigma, d)   where W: weight vector, mu - mean vector, sigma - covariance vector, d - dimensions of samples How can I implement it in python ? I found scipy library that has GaussianMixture library. It basically takes input as sample values and calculate itself mean, co-variance. But for my case it is almost reverse. I am given mean, co-variance, and parameters mentioned above and I need to generate sample data values.  Thank you.

How can I sample from a mixture distribution, and in particular a mixture of Normal distributions in R? For example, if I wanted to sample from:   $$ 0.3\!\times\mathcal{N}(0,1)\; + \;0.5\!\times\mathcal{N}(10,1)\; + \;0.2\!\times\mathcal{N}(3,.1) $$  how could I do that?


I've been having this network adapter problem on my HP laptop earlier also, but the general fix() suggested by many users used to solve my issue most of the time. Once I've downloaded the rtlwifi_new, the following codes used to work on 19.04 as a fix.  cd rtlwifi_new make sudo make install sudo modprobe -r rtl8723be sudo modprobe rtl8723be echo "options rtl8723be fwlps=0" | sudo tee /etc/modprobe.d/rtl8723be.conf   The above codes had to be rerun every time a new kernal update was pushed. But after updating to 19.10 yesterday, the fix is no longer working even though the code is not throwing any errors. Now I have to literally sit right next to my modem to get online. I'm not sure if I've provided enough information required to solve this issue. Do let me know if more info is necessary. Kindly help as I couldn't solve this on my own.  EDIT: All solutions I've encountered were for version 19.04 and before. Those fixes worked perfectly. But they don't seem to work on 19.10. Hence raising a new question for 19.10.

I have a HP 14-AN001NA laptop. It came with Windows 10 installed on which the Wi-Fi worked fine anywhere in the house.   However I removed Windows 10 and installed Ubuntu 16.04 instead and since I have had terrible Wi-Fi anywhere aside from about three foot away from the router. I don't know if it's relevant but my Wi-Fi is not called wlan0 but wlo1 for some reason (I didn't change it).  When running lspci -knn | grep Net -A3     I get the following output:  05:00.0 Network controller [0280]: Realtek Semiconductor Co., Ltd. RTL8723BE PCIe Wireless Network Adapter [10ec:b723] DeviceName:   Subsystem: Hewlett-Packard Company RTL8723BE PCIe Wireless Network Adapter [103c:81c1] Kernel driver in use: rtl8723be Kernel modules: wl, rtl8723be


Assume that a continuous function $f:]1, 2[ \rightarrow \mathbb{R}$ satisfies the conditions      $$x\to1⁺ = -\infty \text{ and } x\to2^- = -\infty$$      Show that there exists and $c \in ]1, 2[$, for which every $x \in ]1, 2[$ holds $f(x) \leq f(c)$   This is essentially a special case of the Weierstrass theorem (Extreme Value Theorem) where they don't give us the actual function. How do we find the closed interval so that we can show the existense of $f(c)$?

Suppose that f is continuous on $(a,b)$ and $\lim_{x\to a^+}  f(x) = \lim_{x\to b^-} f(x) = \infty$. Prove that $f$ has a minimum on all of $(a,b)$.  I was thinking of applying the extreme value theorem, but I realized that it applies only to closed intervals. So I was thinking of defining a closed interval that is in $(a,b)$, and using the definition of one sided limits to go about the problem, but I don't know how to proceed. Help please?


When you start the machine and press shift to bring up grub menu, and you press e to make changes in the menu that starts off with setparams 'Ubuntu, with Linux 3.16.0-30genric', how do you prevent people from making changes to that menu like adding ro recovery nomodeset

Is there a way I can password protect grub menu entry- e.g. if I dual boot with Windows 7 can I set it so that a password is needed to boot into Win 7?   Secondly I would also like to protect grub menu entries being changed if possible.  thanks


How many squares of size a×a can be packed into a circle of radius R?  like this examples :

I need determine the maximum number of squares  of the given size that can be packed into a circle of the given radius. Squares can  be rotated. I'm not sure how complex this problem is and i can find little about it on the other sites.


Okay so recently I have heard of what is known as Benford's law, and this is the first time I absolutely cannot think of my own inutuion about how this is true. Just trying to think about it makes my head hurt. How is this law possible? How does this make sense? Why does it occur? How is this something mathematically true?  Yes I have tried google and wikipedia, but nothing really is explaining to me how this is actually true. ( Mostly I just find the result and its applications , etc)  So can anyone help to illuminate me on this?  Here is the statement (as wikipedia says it):n many naturally occurring collections of numbers the small digits occur disproportionately often as leading significant digits.  Thanks all

Both  (if you take a list of values, the distribution of the most significant digit is rougly proportional to the logarithm of the digit) and  (given a corpus of natural language utterances, the frequency of any word is roughly inversely proportional to its rank in the frequency table) are not theorems in a mathematical sense, but they work quite good in the real life.   Does anyone have an idea why this happens?  (see also )


I want to create a noun phrase that means the number of X that would be phrased like X number.  Should X be singular or plural? e.g., student number or students number?  In either case, I would like to know why and what is the name of this "rule"?

Having been bamboozled by various questions and answers on this site, I'd like to know what are the parts of speech (POS) and grammatical functions of the words and phrases in the following sentence:        Bob made a book collector happy the other day.      Here I am particular interested in the status of the following items:   book happy the other day   But I also need the parts of speech and functions of all the individual words in the sentence. By functions I mean subject, complement and the like. I would also like to know the evidence for the assignments to specific functions and parts of speech.   The reason for asking this question is because the status of the three items listed above may be thought contentious by some people. For example, it might be argued by some that book is an adjective, whilst others will say it is a noun. Similarly, the other day some will argue is an adverb. Whether adverb here should be regarded as a function or part of speech in such analyses seems unclear.


I know that $\frac{1}{\infty}$ is undefined. But my question is - can we say that $\frac{1}{\infty}\neq0$ ?  I've got some idea how to explain that: Let's say we have a random-number generator that generates numbers in interval $(0, \infty)$. What is the probability that it generates 5? $\frac{1}{\infty}$. So it cannot equals zero because if it was zero, it wouldn't generate any number (every number has the same probability - $\frac{1}{\infty}$).  Am I right? Or is that wrong idea?  Thanks

After reading this paragraph:     A simpler version of this distinction might be more palatable: flip a   coin infinitely many times. The probability that you flip heads every   time is zero, but it isn't impossible (at least, it isn't more   impossible than flipping a coin infinitely many times to begin with!).   From here:    I thought to myself, why is the probability of flipping heads every time zero? If we have a perfect coin and we flip it twice we get the probability to equal this:  $$\frac 12 \times \frac 12 = \frac 14$$  or for four flips we get this:  $$\frac 12 \times \frac 12 \times \frac 12 \times \frac 12 = \frac 1{16}$$  So as we approach an infinite amount of coin flips, the probability gets smaller and smaller, but it shouldn't ever reach zero, so the probability shouldn't be zero, it should be $1/+\infty$. Does this mean that $1/+\infty$ equals zero or have I misunderstood the question?


I'm trying to make an ad hoc connection in command prompt but it keeps telling me I need administrator privileges even thou I'm logged in as the administrator. Any possible solutions?

When I access the Run dialog in Windows 8 and type cmd, it opens a command prompt but it doesn't have administrative privileges.  Looking for cmd at the default start screen does show a command prompt shortcut but it is not admin either.  Is there a way of opening an admin command prompt or it is not possible anymore?


Say I am ssh-ing into server A to copy some files onto server B (I need to ssh because I don't exactly know where the file is located):  ssh A@ip_A  scp some_file B@ip_B:/path/on/B(input the password for the B server)   Now my question is: Does the password for B get stored/saved somewhere in the filesystem of server A?

It's known that when you're connecting to a wrong server via ssh and send your password  to it, your password comes in a plain text and a server saves it by default. Probably. I wonder, where I can retrieve it? I don't see it in /var/log/auth.log, although I do see all the attempts to authenticate.


I'm using Redmi 5 Plus with global Oreo 8.1 ROM, rooted with Magisk. And I can't move my apps to external sdcard.  I tried with native method of Android. But the Redmi 5 Plus or MIUI doesn't seem to have the option to move the apps. So, I used Apps2SD app to do the work. It has the option to move with just native method. But it failed with new installs into ASEC containers no longer supported. I also tried other apps but the same error.

I'm trying to move with Lucky Patcher (also with app2sd and Samsung stock app) some apps from internal to external storage, but everytime with every apps movable I got this message:  java.lang.IllegalArgumentException: New installs into ASEC containers no longer supported   I have a Samsung Galaxy S7 with Android 8.0 and root.  Do you now why this happens? Maybe, Android 8.0 doesn't allow anymore this?


I've been a Blender user for a few years at this point, and I finally just switched over to 2.82 after having used the version in my system's package repo for a while.  Now, I can't find gosh darn anything and I'm starting to get frustrated. I can find the Materials window, and I can add a material.  But I've been looking for ten minutes now and I cannot for the life of me find where to add a texture.  Can someone please tell me where to find that setting, preferably with screenshots? Update 3-6-20:  Here is a screenshot of my window.  The first response shows a tab or button that just isn't there on my interface. (Like I said, I've been using blender for years.  I've already looked in all the places where it would actually make sense for it to be)

I am creating a model of a glass and I would like to put a drawing on it (a png picture).  I know how to do it using Blender Render, but not with Cycles Render. Help :)


I created a keystore for my Android app.  Now I need to convert the myapp.keystore file to the pem file format.  Does anyone know how to do that? (The previous developer is unable to find the key and we need to submit a new key to google play console.  the google tech support gave us instructions but they require using the Android Studio app.)

I am trying to convert from a Java keystore file into a PEM file using keytool and openssl applicactions. But I could not find a good way to do the conversion. Any ideas?   Instead of converting the keystore directly into PEM I tried to create a PKCS12 file first and then convert into relevant PEM file and Keystore. But I could not establish a connection using them. (Note that I just need a PEM file and a Keystore file to implement a secured connection. There is no restriction like "Start from a java keystore file". :) So starting from other formats is acceptable with my case)  But a direct conversion method from jks to pem is preferable.


Logcat Output:     java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String firebase.firebasepractice.User.getUsername()' on a null object reference. ...     User:     MainActivity:  public class MainActivity extends AppCompatActivity {    private EditText name,password;   Button btn;   TextView tv;  @Override protected void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);     setContentView(R.layout.activity_main);      name = (EditText) findViewById(R.id.userName);     password= (EditText) findViewById(R.id.password);     btn= (Button) findViewById(R.id.submit);     tv= (TextView) findViewById(R.id.tv);      btn.setOnClickListener(new View.OnClickListener() {         @Override         public void onClick(View v) {             DatabaseReference myRef=FirebaseDatabase.getInstance().getReference("Users");                  String userId=myRef.push().getKey();              myRef.child(userId).addValueEventListener(new ValueEventListener() {                 @Override                 public void onDataChange(DataSnapshot dataSnapshot) {                     User user=dataSnapshot.getValue(User.class);                     tv.setText("Name is "+user.getUsername()+"    Email is "+user.getEmail());                 }                  @Override                 public void onCancelled(DatabaseError databaseError) {                  }             });         }     }); } }

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 want to differentiate $ \int_{a(t)}^{b(t)} f(x,t) dx$ this integral with respect to $t$ $i.e$,   \begin{align} \frac{d}{dt} \int_{a(t)}^{b(t)} f(x,t) dx \end{align}  I only know for the case of constant $a,b$. For this case how can i differentiatie?

That is:  $$\left(\int_{a(x)}^{b(x)}\!f(x,t)\,dt\right)'$$  I don't know how to differentiate a integral if functions of $x$ are at its limits.  Can you guys show me how to do this?


I had a question regarding a proof for my analysis class  $$\lim\limits_{n \to \infty}\sqrt[n]{n^2 + 1}$$  I've tried a handful of things, but in all cases, I have either reached a point that has no logical connection to the result, or I don't know how to prove a step.  I'm not asking for the answer, but advice on how I should proceed with this problem would be helpful.

I have to prove that $$\lim_{n\to\infty} \left(1+n^2\right)^{\frac1n}$$ converges and give its limit. What I did was the following: $$\lim_{n\to\infty} \left(1+n^2\right)^\frac{1}{n} = \lim_{n\to\infty}(n^2)^{\frac1n}\lim_{n\to\infty}\left(\frac1{n^2} + 1\right)^\frac1n= \lim_{n\to\infty}(n^2)^{\frac1n}$$ Now that is where I am stuck - how to I continue with $\lim_{n\rightarrow\infty}(n^2)^{\frac{1}{n}}$? I really don't have any ideas left... Thank you very much! FunkyPeanut


Are there any known MD5 hashes that can´t occure, no matter what (finite) input is taken?   Thanks

Are there any hash outputs not produced by the MD5 hash function? I need to use it as a placeholder for an empty hash while comparing two hashes.


import java.awt.*; import java.awt.event.*; import javax.swing.*; public class Test implements ActionListener{     static JFrame frm = new JFrame("Calculator");     static JPanel jp1 = new JPanel(new FlowLayout());     static JPanel jp2 = new JPanel(new GridLayout(3, 3));     static JButton []btn = new JButton[9];     static JTextField txtOut = new JTextField(15);      static Container cp = frm.getContentPane();      public static void main(String args[]){         cp.setLayout(new BorderLayout(0, 10));          jp1.add(txtOut);         cp.add(jp1, BorderLayout.NORTH);          for (int i = 0; i < 9; ++i){             btn[i].setText("" + (i + 1));             btn[i].addActionListener((ActionListener)frm);             jp2.add(btn[i]);         }         cp.add(jp2, BorderLayout.CENTER);          frm.setSize(200, 200);         frm.setVisible(true);          frm.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);     }     public void actionPerformed(ActionEvent e){         JButton tmp_btn = (JButton) e.getSource();         // check which button         for (int i = 0; i < 9; ++i){             if (tmp_btn == btn[i]){                 txtOut.setText("" + (i + 1));                 break;             }         }     } }   Hello, I am studying in Java Swing course.  I tried to make a calculator,   but when I handle Event Listener, I face a problem!  It's java.lang.NullPointerException.  I guess the problem is in main method's for loop's three statements,  because I tried to comment them respectively,   and the IDE compiler talk me "NullPointerException" is in there...  But I still don't know what's wrong in this code.  So, I want to ask, ho to fix it, thanks!!  (Sorry I'm poor at English :(...


What are the reasons X-ray vacuum tubes could not be replaced by solid state alternatives? I'm thinking if it is possible to make a compact solid-state X-ray or higher energy photons generator just like how vacuum tube amplifiers, computers, etc. are going to be replaced by solid-state amplifiers, computers, etc. but not 100% replaced as we can still find vacuum tube amplifiers everywhere but vacuum tube computers are already very rare. But if I have to form the reason why vacuum tubes are still used to generate high energy radiations instead of solid-state devices with my own reasoning (although I have very limited background in physics), high speed electrons are only possible if there is some kind of chamber inside. So, common sense tells us that there is a need to include a chamber inside that thing so electrons can move freely instead of flowing through solids that will pose many difficulties.

HERMES III (High Energy Radiaton Megavolt Electron Source) at the Sandia at Sandia National Laboratories is the world's most powerful gamma ray generator. HERMES-III produces a highly energetic beam that tests the capability of electronics to survive a burst of radiation that approximates the output of a nuclear weapon. It used a field emission diode, instead of a transistor. I wonder why most accelerators used vacuum diodes instead of transistors. Transistors are much smaller. What are the reasons?


I am in a situation where inhouse database needs to be sync. (one way) from web service data of external server.   I can write couple of lines through windows service. However, I am just wondering about using WF. As per my understanding with WF, it is about workflow, with activities (if conditions) connecting with external interface, providing common layers such as exceptions, mail etc...   From architecture and future technology point of view, what would you suggestion on going WF or Windows Service way?  Please Note: Its required to execute this process every night.

Some things are easier to implement just by hand (code), but some are easier through WF. It looks like WF can be used to create (almost) any kind of algorithm. So (theoretically) I can do all my logic in WF, but it's probably a bad idea to do it for all projects.  In what situations is it a good idea to use WF and when will it make things harder then they have to be? What are pros and cons/cost of WF vs. coding by hand?


I realise there are other answers out there, specifically this  but my question is slightly different in that most of the missing keys are from ubuntu-dot-com, Does this suggest the key store may be corrupt?  Error from sudo apt-get update:   W: GPG error: http://archive.canonical.com trusty Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 40976EAF437D05B5 NO_PUBKEY 3B4FE6ACC0B21F32   With similar errors for;   W: GPG error: http://archive.canonical.com trusty Release:  W: GPG error: http://extras.ubuntu.com trusty Release:   W: GPG error: http://security.ubuntucom trusty-security InRelease:  W: GPG error: http://gb.archive.ubuntu.com trusty-updates InRelease:  W: GPG error: http://gb.archive.ubuntu.com trusty-backports InRelease:  W: GPG error: http://gb.archive.ubuntu.com trusty Release:   Is there a quick way to reload these keys or does each one need to be done individually?

It didn't fixed the error. So, how do I fix my GUI update?  For every software I have to install it from command line because I got same error when install software from Ubuntu Software Center.


If I know generating funcions for sequences  $$A: a_0, a_1, a_2, a_3, a_4, \dots$$ and $$B: b_0, b_1, b_2, b_3, b_4, \dots$$ and I want to find a new generating function for  $$C: a_0b_0, a_1b_1, a_2b_2, a_3b_3, a_4b_4,\dots$$ How would I go about doing this? I would like an explanation, thanks!

Given that I have two formal power series: $$ A(x) = \sum_{k \ge 0} a_k x^k $$ $$ B(x) = \sum_{k \ge 0} b_k x^k $$  The Cauchy Product gives a series $$ C(x) = \sum_{k \ge 0} c_k x^k $$ $$ c_k  = \sum_{n=0}^k a_n b_{k-n} $$  Which comes from taking the product of the two series $C(x)=A(x)B(x)$. What then, in terms of $A(x)$ and $B(x)$, is this series? $$Y(x) = \sum_{k \ge 0} a_k b_k x^k $$


Today, I stumbled upon a  to flag a spam post. I noticed that the 'new answer editor' which usually appears at the bottom of the page was replaced by an 'Answer this question' button:    Upon clicking it, a popup appears starting with     This question has more than 2 answers already.   So that's the reason it appears, but I was wondering what the full set of conditions is.  indicates Workplace has a custom threshold set to 'more than 2 answers'; it mentions  which upon testing seems to have a 'more than 5 answers' threshold. For most sites, it seems to be 'more than 30 answers'. Are there more exceptions? What about Meta sites?  Also, is there any reputation level/privilege above which you don't get this popup anymore?

On Software Engineering I've been adding a message along these lines to old(ish) questions that have enough answers to be CW if they start getting new answers.     Please read all of the existing answers before posting yours. The question is relatively old and has a reasonable number of answers already. There is a good chance that your answer has already been posted.   I know most people don't read dialogs and just click "OK" to get through them, but if we can stop a few people adding to such questions then it's got to be good right?  The age of the question and the number of existing answers required that trigger this message can be configurable.


I need some advice on comma placement. I don't really know if I should set off the phrases that come after ", and". I need that sounds too general and vague, but it will become more clear with the examples below     Example 1. I began installing a new system, or ROM, on my phone every weekend and, in the process, broke the poor phone infinite amount of times.    Should the phrase in the process be set off by commas?     Example 2.  In total, my victim phone got broken 26 times, and, every single time, I found a way to revive it   should the phrase every single time be set off by commas?     Example 3. English opened the doors of an entirely new world—one brimming with knowledge and values not confined to the limits of my country—for me to explore, and, as I began to explore, my childhood fervor for playing games paved way for a much implacable thirst for learning.    should as I began to explore be set off by commas?  I researched and know that if there is a clause coming after and it should be set off from both sides with commas (correct me if I am wrong). But I don't know what to do in the instances above. Please, if you can, tell me the correct versions of the punctuation in the examples above and (do I put a comma here) if there is a recommended reading material or grammar rule on that, please do not hesitate to share it with me.  Thanks beforehand!!!

This is a bit of a strange question because I know that there should never ever be a comma after 'and.' But what if there's a parenthetical statement/clause-thing right after it? Let me demonstrate.      She spread her arms, tilted her head back, and, closing her eyes, let the sun warm her face.    Should it be:      She spread her arms, tilted her head back, and closing her eyes, let the sun warm her face.    I feel like the ,and, looks really bulky, but I also feel it's necessary to separate the statement between the commas. Help?


my question is related on  that I have posed on math.stackexchange but is not exactly the same (even I would appreciate receive an answer for the other as well). Since I haven't received answers, I've been told that here could be a better place to ask about statistics.  Let imagine we have a vector $\vec{a} = (1,0,0)$ and that we have a vector $\vec{\lambda}$ uniformly distributed in the unit ball (sphere of radius $1$).  We can then write  $$\vec{\lambda} = (r_1.\cos \phi.\sin \theta,r_1.\sin \phi.\sin \theta,r_1.\cos \theta)$$ and $$\vec{a}.\vec{\lambda} = r_1.\cos \phi.\sin \theta$$  But I'm not comfortable with something. If we say that $\vec{\lambda}$ has a uniform distribution in the unit ball, can we say that  $$r_1 ~\sqcup_{[0,1]} \\ \phi ~\sqcup_{[0,2\pi]} \\ \theta ~\sqcup_{[0,\pi]}$$  with $\sqcup_{S}$ meaning that the distribution is uniform on the set $S$ ?  If it's the case, I could test the uniformity of $|\vec{a}.\vec{\lambda}|$ by testing this  $$\int_{r_1}^{r_2} \int_{\phi_1}^{\phi_2} \int_{\theta_1}^{\theta_2}  |r.\cos \phi.\sin \theta| \,r^2\sin \theta\;dr\,d\phi\,d\theta = \frac{\int_{r_1}^{r_2} \int_{\phi_1}^{\phi_2} \int_{\theta_1}^{\theta_2} \,r^2\sin \theta\;dr\,d\phi\,d\theta}{\frac{4}{3}\pi}$$  right ?  Is it a good way to do it ? How could I do more easily this test ?

I have posted a , this is related but I think it is better to start another thread. This time, I am wondering how to generate uniformly distributed points inside the 3-d unit sphere and how to check the distribution visually and statistically too? I don't see the strategies posted there directly transferable to this situation.


On which of the Stack Exchange site should I ask a question regarding copyrights? Example question:  Do I have the permission to include the content of a document in my website? The copyright in question is from the SWEBOK and the licence says:  This document may be copied, in whole or in part, in any form or by any means, as is, or with alterations, provided that (1) alterations are clearly marked as alterations and (2) this copyright notice is included unmodified in any copy.  SWEBOK book copyright:

I want to make a summary of a book and use it to earn money. However, I don't know whether it's legal or not.  Which Stack Exchange site can I ask this question on?


Got on today to add a citation to a document that I last edited on Friday (2 days ago).  Now I am getting this message when I run "Bibliography" (from within TeXstudio) "No such file or directory at'' yada yada yada -- the file name is way too long to reproduce here.  What initially happened was that the new citation I included in an old file was not being written, rather the "Cite Key" label that I typed into the parencite command appeared. When I deleted all of the LaTeX files except the .tex file (fresh start and all of that!) ALL of my citations now became simply the BibTeX Cite Key labels.   I then went to an older file (one that was working fine last Wednesday), deleted all LaTeX files except the .tex one, and ran everything "as I usually would". The result is that ALL of the citations in that file now appear as their BibTex Cite Key labels.  Note that I did NOTHING to this "old" (last Wednesday's) .tex file. I just deleted its LaTeX friends and then redid everything that I have done 1001 times since installing TeXstudio.  My configuration is Mac 10.10.1; TeXstudio 2.8.8. I updated all files (after this started to happen) using TeX Live Utility today. All of this did nothing.  NOW --- and maybe this is the clue -- I did run the latest Mac updates of Safari; OS X Update to 10.10.1 and Command Line Tools (OS X 10.10) version 6.1 earlier today.  Any hints? Anything else I should include from my Installation info?  *** Okay -- I am being told that my question is redundant. Actually the answer is redundant, not the question. The two questions differ but the diagnosis is the same. However, my extensive search (prior to posting my question) did not reveal the older answer. I suggest the question be left so that someone who diagnoses their problem the way I diagnosed mine will be lead to the answer.

I'm trying to use biblatex and when I compile my document I get an error like the following:  Windows  data source C:\Users\<username>\AppData\Local\Temp\par-5061756c\ cache-890efc00b3ca6b775c7d44a325c1349fb2a3a3bd\inc\lib/Biber/LaTeX/recode_data.xml not found in .   Mac  data source /var/folders/v2/rld0ls7d2935gkvqv5hfr1x00000gn/T/par-616c616e/ cache-cdd483146f82a9655ce063f848d5139480fbf872/inc/lib/Biber/LaTeX/recode_data.xml not found in .   Linux  data source /tmp/par-6963617269756d/cache-f37ab610b7d79b2720a8ee3732849c6821705520 /inc/lib/Biber/LaTeX/recode_data.xml not found in .


You are potentially able to prove $d(x,z) \leq d(x,y) + d(y,z)$ in $\textbf{R}^2$ using the relation that $d(x + y, 0) \leq d(x, 0) + d(y, 0)$ where: $0 = 0$-vector $d(x, y) = \sqrt{(x_1 - y_1)^2 + (x_2 - y_2)^2}$ - the distance formula I was able to find and use $(x_1z_2 - x_2z_1) \geq 0$ To form $d(x,z) \leq d(x, 0) + d(z, 0)$ then by symmetry \begin{align*} \begin{cases} d(x,y) \leq d(x, 0) + d(y, 0)\\\\ d(y,z) \leq d(y, 0) + d(z, 0) \end{cases} \end{align*} You get $d(x, y) + d(y, z) \leq d(x, 0) + d(y, 0) + d(y, 0) + d(z,0)$ and $d(x, z) \leq d(x, 0) + d(z, 0)$. Any hints from here?

How can I show that the Euclidean distance satisfies the triangle inequality?   Where the Euclidean distance is given by: $$d(p,q) = \sqrt{(p_1-q_1)^2 + \cdots + (p_n-q_n)^2}$$  Triangle Inequality: $\forall x,y,z\Bigl( d(x,z) \leq d(x,y) + d(y,z)\Bigr)$.


My reputation on Stack Overflow is reduced without any down-vote or any negative reputation points shown at . Two days ago my reputation was 951, I gained 4 points, but the total now is 943. Last night it was 951, in the morning it was 947, increased to 949 by afternoon and is now 943.      Update: I have checked Show deleted posts.   There isn't any downvote or anything in profile, but posts in which I participated (answered, edited or flagged) are deleted.  Is there a reputation point sloss of -2 when any post you answered or participated is removed?  This has only happened for past day.      Is this a bug?

My reputation rating on SO took this hit an hour ago, and it is due to what appears to be the simultaneous deletion of multiple questions.  I am uncertain why it happened, am concerned, and would appreciate an explanation.  Going to  shows that it was removed due to moderation.  Was a script run deliberately, or were we hit with a question deletion attack; what happened?  -12     today -2  1 hour ago  removed     How to send a 2d Vector over UDP in c++ -2  1 hour ago  removed     How do I use the Eclipse debugger to debug a Java application? -2  1 hour ago  removed     PHP string error; inconsistency with local and server -2  1 hour ago  removed     Unable to start the MySQL service after a server migration -2  1 hour ago  removed     How to use Java to print a text file on a ticket printer? -2  1 hour ago  removed     How can all of the ZBrush Obj files be imported to make a complete model?


Prove that for any real numbers $a_1, a_2,\ldots, a_n > 0$ $(n \in \mathbb{N}, n \geq 2)$ satisfying $a_1 a_2 \cdots a_n = 1$ we have $ a_1 + a_2 + a_3 + \cdots + a_n \geq n$.

The arithmetic - geometric mean inequality states that $$\frac{x_1+ \ldots + x_n}{n} \geq \sqrt[n]{x_1 \cdots x_n}$$ I'm looking for some original proofs of this inequality. I can find the usual proofs on the internet but I was wondering if someone knew a proof that is unexpected in some way. e.g. can you link the theorem to some famous theorem, can you find a non-trivial geometric proof (I can find some of those), proofs that use theory that doesn't link to this inequality at first sight (e.g. differential equations …)?  Induction, backward induction, use of Jensen inequality, swapping terms, use of Lagrange multiplier, proof using thermodynamics (yeah, I know, it's rather some physical argument that this theorem might be true, not really a proof), convexity, … are some of the proofs I know.


I've got this , about using Farther vs. Further:     The words farther and further both refer to a greater distance. However, farther is typically used when the distance is physical, and further is used when the distance is abstract or metaphorical. Further may be used to mean 'more' or 'to a greater degree.'   In following the explanation, there is a quiz, which gives back the right word to use (farther OR further). Please see below.  A. The further I have to drive, the more my back bothers me.  B. How much farther to Mimi's house?  I want to ask, if the other option work as well, in both sentences.

The OALD, for the meaning of further says:     (comparative of far) (especially BrE) at or to a greater distance SYN farther   Is further really used as synonym of farther? As far as I recall, there is a slightly different meaning between those words. I don't recall  that exactly, but I think I was taught that further is used figuratively, such as in "I cannot go any further into this discussion."


Recently I've seen in domestic match there was one bowler (spinner) who used his both hands while delivering the ball?  I've doubt can it be possible in International Cricket.  Does ICC has any rule about this?

In the current era of cricket, we see batsmen using switch hits to play a ball. That is, while playing a ball they change their batting side (left to right handed and vice versa) just before the ball comes to them.  My question is, can a bowler bowl a switch ball? Meaning, can a left hand bowler bowl right handed to a batsman? If it is not permitted, then is it not unfair to the bowlers that batsmen can change their batting style but not the bowlers? Or are there are any rules against a switch hit?


Grammarly recommends removing the second comma but for me it seems that this is needed. What would be the correct comma use in such a sentence?  Two variables, fracture type and management method, were examined in separate models since certain fractures are treated with specific operation methods.

Sorry, I do not know the language terminology. Is this a case of nonessential appositive?  Which of the following sentence has a correct comma use? Comma before "should"  Importantly, two frail subgroups of stroke population, long-term residential care and cognitive impairment patients, should not be excluded from the rehabilitation.  No comma before "should"  Importantly, two frail subgroups of stroke population, long-term residential care and cognitive impairment patients should not be excluded from the rehabilitation.


I'll start by saying, I am asking this question after having read most of the similar threads out there and tried what they suggest but with no luck.  So, I have this laptop .  I had Windows 7 installed but I erased them and I only have Ubuntu now.  When I restart my laptop and right after the Asus starting screen I get a black screen with a flashing underscore.   Editing grub file - Does not work. Shift key pressed or spammed - Does not work. Whole keyboard spammed - Works some times.   So what are your opinions? Any suggestions? Cause it's annoying to spam the whole keyboard every time, plus it's not a guaranteed solution.  Edit: Common fixes that worked for others like reinstall grub, run boot-repair, keys pressed during startup do not work in my case. I'm not an expert but I think it either is my graphics card (I don't know why but I've seen it being mentioned in other threads) or it's like the system is not booting from the right partition. Partitions are as follow:/boot(flaged for boot), / "root", swap and /home.  Edit: Here is the report from the last repair-boot just in case....

I installed Windows 7, which ate Ubuntu's boot file. When starting up the computer, it now goes straight to Windows, without giving me the option of booting Ubuntu.   How can I get Ubuntu back?


Is it possible to recover data from a damaged external drive? My external drive was not recognized by my computers and after a computer engineer examined it, I was told the drive is damaged.   He claimed to have been able to view some of the files on the drive, but that they are damaged. How do I recover my files from this drive?

I have a Western Digital 2TB External Hard Drive. I basically use it to keep all my movies and videos. Its file system is NTFS, and currently I'm using 1.4TB. One night I turn it on and copied a 4GB file and there was no problem. Then I tried to copy another 6GB file and Ubuntu throw the following error: "Input/output error". I tried to create a new folder with no luck. I still could read the disk an play a file, so I thought restarting the computer would solve the problem, but it didn't. The next time, Ubuntu didn't mount the disk.   After that I tried in another PC with Window 7. It throwed a message telling me: first, that the disk needs to be formatted, and second, a "Local Disk #: Is not accessible. Data error (cyclic redundancy check)". Here is when I started to worry. I tried to fix the disk with CHKDSK (chkdsk \r). After about 5 hours, it crashed with the following error: "An unspecified error occurred".  My guess to all this is that the disk is dying. :'(  Lastly I did one more thing. I installed GSmartControl on Ubuntu to see the SMART info and the attributes tab appears in red with the following line highlited:  ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE ... 197 Current_Pending_Sector  0x0032   197   197   000    Old_age   Always       -       977 ...   Just to check, I left the disk on for about 2 minutes and then refreshed the page, and the Current_Pending_Sector RAW_VALUE increased from 977 to 979. My guess is that sectors on the disk are dying. Am I right?  If every time I turn on the disk more sectors are going to die, I need to copy the data fast. I don't know if there is a solution on Windows, and I'm worried about the time that it could take to do it with the slowness of Windows. Basically my question is: How can I recover the data? (Or at least some of it). Is there any program on Ubuntu that can help me with this (If I'm still on time)?. My main concern is the size of the disk (2TB), so I think I would need at least another 2TB disk to copy to.  Any help would be appreciated.


I'm using 'und/oder' (German for 'and/or') in one of my texts (I know it's not nice :)). Latex separates it 'und/o-der' which is not nice. Using \mbox fixes that problem.  Trying to find a general solution like  \hyphenation{und/oder}   does not work though: 'Improper \hyphenation will be flushed. \hyphenation{und/'.  What would be the correct way to archive this?    Related to , but somewhat different.

How can I tell LaTeX to automatically split up the german word  Kontrast/Rausch-Verhältnis    into   Kontrast/Rausch-|Ver|hält|nis   LaTeX complains that "/" is not a letter.


There is something classical about this story. A big game hunter signs on to a hunt that takes him through time to the Jurassic. The rules here are a little confused. So there is a bit of willing suspension of disbelief. The hunter is warned to under no circumstances leave a well demarcated trail as he hunts for a dinosaur. Lest he disturb the slightest thing in that time frame. The implication being that the ramifications of the tiniest perturbations magnified over millions of years can seriously change the future. Somehow the effect of the killing of a dinosaur in my memory is either ignored or explained away inadequately. Predictably the hunter steps or slips off trail crushing an insect. When he returns to his present every thing is just a little off and he cannot regain the perspective of being home.

I heard of this in high school, but never learned its title or author- supposedly the aforementioned worm butterfly would have played a part in evolution that caused the extinction of the dinosaurs (instead of that meteor most people blame now). This story might even have been parodied on a certain Simpsons Halloween Special (the one where Homer accidentally makes a time machine trying to fix the toaster).


I sent a technical paper for peer review at Manuscript Central and after 5 days the status is Awaiting EE Processing. What does this mean?

What steps does a manuscript typically go through from submission to publication (or rejection) in a typical journal? How are these steps referred to, in particular by editorial systems, and how long do they each typically take?  Note that this question is about the typical situation and hence not about:   Journals with an atypical workflow, e.g. those that allow for an instantaneous reviewer–author interaction. Exceptional steps or rare occurrences such as withdrawal or .   This is a canonical question on this topic as per . Due to its nature, it is rather broad and not exemplary for a regular question on this site. Please feel free to improve this question.


My two original controllers no longer connected to my ps4 so I set out and bought a brand new controller, in which then that controller will not connect to the console either. It will only flash for a few seconds then return to orange, I have searched numerous forums for answers and none have worked, I have also callled PlayStation but they said only my two older controllers could be damaged but doesn’t explain the new controller problem, please help.

I was playing my PS4 two days ago and then packed it up with two controllers that were both connected to this PS4.   I got to where I was going, set everything up and now the controllers won't connect. They show pulsing orange when they plug in, but when I hit the PS Button to connect, it blinks white 1-2 times and goes back to orange.   I have tried resetting them both.  Can anyone help?


I tried to do this one time before, but it completely failed. I wiped all of it's partitions, and reclaimed the partitions within Windows, however, that messed up GRUB and I couldn't get back the the Windows Boot Manager. Then, I had to remove Windows and completely wipe my HDD, and reinstall Windows. I've redone a dual boot, but I'm looking to remove. Can someone please help me fix this problem so that it doesn't happen again?

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


I've an object as below:   default = {     name: "",     details: {         age: "",         place: ""         country: ""     },     contact: {         email: null,         phone: null     } }   Now, I've another object as:   data = {     name: "Abc",     details: {         age: "27,     },     contact: {         email: "abc@xyz.com"     } }   Want to achieve:   result = {     name: "Abc",     details: {         age: 27,         place: ""         country: ""     },     contact: {         email: "abc@xyz.com",         phone: null     } }   Now, I want to get the values from data and put it in default. Currently I'm checking if the key exists, then assign value, else keep default. But it's a long process. Is there a JS helper function or something that I can use for this?   Object.assign(default, data) is only copying the property values and not going deep.

I need to be able to merge two (very simple) JavaScript objects at runtime.  For example I'd like to:  var obj1 = { food: 'pizza', car: 'ford' } var obj2 = { animal: 'dog' }  obj1.merge(obj2);  //obj1 now has three properties: food, car, and animal   Does anyone have a script for this or know of a built in way to do this?  I do not need recursion, and I do not need to merge functions, just methods on flat objects.


i have a bunch of files from log1 to log164,  how can i create a file like below ordering... please help me...   log1.gz log10.gz log100.gz log101.gz log102.gz log103.gz log104.gz log105.gz log106.gz ...etc

I have a bunch of files from log1 to log164.  I'm trying to LIST the directory (sorted) in a UNIX terminal but the sort functions are only providing the format like this:  home:logs Home$ ls -1 | sort log1.gz log10.gz log100.gz log101.gz log102.gz log103.gz log104.gz log105.gz log106.gz ...etc   What I want is  home:logs Home$ ls -1 | sort log1.gz log2.gz log3.gz log4.gz log5.gz log6.gz log7.gz ...{more here} log99.gz log100.gz log101.gz log102.gz ...etc   Any suggestions in what I could use to do this?


i am using a date range filter which will list news for this week(Sunday to Saturday of current week). Am getting the results correctly. Now am want to show the news for next week if there is no news for current week

I have a client who has an Upcoming Events view. However, when there are no upcoming events, he wants to show another view (Past Three Events) which shows the past 3 events. Basically he doesn't like it when the page doesn't show any events so he wants to show something.  I thought of attaching another block of the Past Three Events to the bottom of the main view (Upcoming Events) and then using jQuery to hide it if the main view (Upcoming Events) is populated.  But I was hoping that someone knows a more elegant solution where perhaps either I can conditionally run a view (perhaps using EFQ which I know nothing about) or somehow adjust views to combine 2 queries in one.


So, it's in the title pretty much.   The code creates a temp folder Data with loads of intermediate output in it.   I forgot to put that folder in .gitignore, then hit pushed to master and went to sleep. Now the repos is too big by about 1GB. How can I remove these files?

I accidentally committed an unwanted file (filename.orig while resolving a merge) to my repository several commits ago, without me noticing it until now. I want to completely delete the file from the repository history.   Is it possible to rewrite the change history such that filename.orig was never added to the repository in the first place?


Let's suppose that $a_n$ satisfy $|a_{n+1}-a_n|<2^{-n}$ for all $n$ . How can I prove that $a_n$ is a cauchy sequence?

Suppose the terms of the sequence of real numbers $\{a_n\}$ satisfy $|a_{n+1} - a_n| \le 2^{-n}$ for all $n$. Prove that $\{a_n\}$ is Cauchy.   My Work  So by the definition of a Cauchy sequence, for all $\varepsilon > 0$ $\exists N$ so that for $n,m \ge N$ we have $|a_m - a_n| \le \varepsilon$. However, questions like  make me understand that the $2^{-n}$ condition is necessary for this to be a true statement.   So I am wondering how to appeal to the Cauchy definition for this proof. Do I prove that every convergent sequence is therefore Cauchy, and then try to prove convergence?


Yesterday a post a question about how to Update using PDO, and some users told me that the folowing code line is very unsafe, because everybody can modifie my database. Well I undestrand why is not safe but what should I do with my variables berofe use it in mysql?   Example of unsafe use:  $bdd->prepare("UPDATE `articulos` SET `visto` = `visto` + 1 WHERE `ID` =$_GET['variable'] ");   I gues that if a use $_POST it still not secure.  And if I do this is unsafe too:   $getVar=$_GET['variable'];  $bdd->prepare("UPDATE `articulos` SET `visto` = `visto` + 1 WHERE `ID` =$getVar ")   So what is the safe way to insert variables in SQL queries?  Thak you.

If user input is inserted without modification into an SQL query, then the application becomes vulnerable to , like in the following example:  $unsafe_variable = $_POST['user_input'];   mysql_query("INSERT INTO `table` (`column`) VALUES ('$unsafe_variable')");   That's because the user can input something like value'); DROP TABLE table;--, and the query becomes:  INSERT INTO `table` (`column`) VALUES('value'); DROP TABLE table;--')   What can be done to prevent this from happening?


Is there anything in android mobile which has block all porn sites with high security features and any paid software or anything please tell me..

Is it possible to block all porn, chat sites, and adult content web pages on a Samsung Galaxy Ace 2? And is it possible to hide the fact that they are being blocked?


When i compile a file, with .tex file other ones are produced.  I know that log files contains warnings and errors (and more things i do not know), also that .bibl files are related with some bibliography, but have them any common usage or something to be aware of? A short explanation of them will be ok, i am only starting with it.

In addition to the .tex and .dvi or .pdf files, TeX/LaTeX/ConTeXt produces and uses lots of other files. What do they do? Which ones are used to create the document and which ones are automatically created by the compiler. What files can I safely delete?


I'm new to photographing. But I'd like to know what 10x zoom means in meters. I know that it means the picture is enlarged 10 times, but what does it mean in meters?  I mean does it mean like the picture I see from 10 meters away, is like 1 meter away when I use 10x zoom? Or does it mean 10 feet away is like 1 feet away with 10x zoom?

Zoom lenses and cameras with superzooms are often sold with a times ("×") zoom number — like a 12x zoom or 30x zoom. The question  explains how this relates to focal length numbers, like 70-200mm or 18-55mm. But how does ×-zoom relate to magnification, when used for macro or just to make something far away look bigger?  How can two 70-200mm lenses have different magnification?


We give groups their axioms of closure, associativity, inverse, and identity, so we can "do algebra" or equivalently, study symmetries in a very general sense. What new can we do by adding the requirement that a category contain arrows from an object to itself? Surely this removes some level of generality, which I think the idea of creating categories was seeking after?   I know there are many examples of categories, and that this is used to show the importance of them. But I'm sure there's a reason we use categories in each case, and that there must be at least a vague thread that goes through all of them. I'm not so interested in specific applications, if possible but if so that's fine.   QUESTION: by giving category objects unique identity arrows what useful (but AS GENERAL AS POSSIBLE) property is gained? Since I'm not familiar with this part of math I'd appreciate something that's intuive and in layman's terms. :) Thanks.

One common definition of a category features objects, arrows, an associative composition law for arrows, and an identity map requirement: for every object there must be an self-pointing arrow that behaves as left-side and right-side identity for composition.  I have no problem seeing how one could use a formalism of objects and arrows between them to structure our thoughts on a wide variety of areas.  Also, it's easy to see why one would want to have a basic building operation (i.e. the composition law) in such a formalism.  With a little more thought I can also see why one would stipulate that this composition law be associative: making composition associative has the effect of replacing the "pair of arrows" with the "sequence of arrows" as the formalism's basic building operation, and I can see that this change may make the formalism more flexible.  I can't come up with any rationale at all for requiring that there be an identity arrow for every object.  What is lost by dropping this requirement?  Note that dropping this requirement does not preclude the existence of identity arrows, and therefore, it does not preclude defining concepts (e.g. inverses, isomorphisms) that depend on the concept of an identity arrow.  In fact, AFAICT, if one were to drop the identity arrow requirement, one could still define functors, natural transformations, cones, etc. (except that the definitions, of course, would not have the usual stipulations for the identity).  EDIT: To sharpen the question a bit, and maybe make it less of a "philosophical issue", I note that several times I've come across remarks from Saunders Mac Lane to the effect that their aim (his and Eilenberg's) in coming up with category theory was to arrive at the concept of natural transformation.  In fact, in , Mac Lane writes (p. 18):     "category" has been defined in order to define "functor" and "functor" has been defined in order to define "natural transformation".   As I noted earlier, the definitions of functor and natural transformation don't seem to rely much on the identity law requirement for categories.  So I could make my question a bit more concrete: how does requiring that every object in a category have an identity contribute to what Eilenberg and Mac Lane were aiming for?


In what verbal tense is "were"? Could it be considered conditional? Or a preterite in subjunctive mood?   The best way I can explain it to you is by saying that, for a second or two, I felt as though, instead of going to the centre of a continent, I were about to set off for the center of the earth.

If I was... If I were...   When is it correct to use "If I was" vs. "If I were" in standard English?


I am planning on going out to Pakistan soon and I am wondering if I should bring my Xbox 360 for a friend that stays there,  Would the Pakistani games work on my Xbox 360?

I'm going on a vacation from Europe to the US and was planning of bringing along some Xbox360 or PS3 games, but now I'm curious if they will be compatible with my European Xbox.  In that past there would be a clear difference between NTSC and PAL games, but is this still the case with the current gen of consoles?


If we consider the torque about point A, there is none, so there is no rotation about point A. If we consider torque about point B, there is a net torque which means that there is rotation about point B. But if there is rotation about point B, doesn't this imply that there must also be rotation about every single other point?     Are there specific locations where I can take torque about, or have I simply made a mistake in logic?

I've heard it from two teachers and saw a task with a solution based on this assumption:     If the net torque is zero when measured from one frame of reference, it is equal to zero   in all other frames of reference   This actually seems clear, especially if you put it to simple words like:     If a body doesn't rotate from one point of view, it won't start rotating if you look at it    from another point of view   Still, I wanted to test it and made such an image:   I calculated the net torque measured from point A (I'll skip the designations such as $m_1, r_1, m_2$ etc. and get to the value):  $$1m\cdot1N + 5m\cdot1N - 4m\cdot1.5N = 0$$  Now, let's calculate the net torque from B:  $$-2m\cdot1N + 2m\cdot1N - 1m\cdot1.5N = -1.5Nm$$  From this it seems, that the body doesn't rotate around an axis in A, but does around the axis in B.


This question has the same background as my . I am struggling with countable/uncountable nouns. I am reviewing a document, containing the following sentences:  Cross-verification of softwares for ... Sensitivities of A and B to the variation of C have been investigated.  My gut-feeling tells me neither software nor sensitivity should be used in plural here. But while software is simply uncountable, sensitivity is not. So I am struggling to find an explanation for this feeling. Typically I'd say, that if we are talking about two different kinds of sensitivity (though I'd struggle to think of an example), then sensitivities is possible. But when it's just how sensitive A and B are to the variation of C, it's so to say one sensitivity type and therefore cannot be used in plural. Am I right? Is there a way to determine it next time (they love using plural like this over here in my company) without asking on SE? Note: I know how to help my colleague avoid "softwares" and also the motivation (uncountable noun). The question is about "sensitivities", and I keep the "softwares" sentence in to provide the context: People over here like using plurals a lot, and I often feel they are overdoing it. The problem for me is that I am afraid I can overdo it the other way round. I don't want to ask the document author to rephrase "sensitivities" unless it is really wrong.

Is it correct to use softwares, as in the following sentence?  There are various video conversion softwares in the market.


I am trying to place two LilyPond musical examples side-by-side in a LaTeX document, with captions. How can I achieve that?   This is the code I am using:  \usepackage{float}   ... \begin{document}   ...     \begin{minipage}         \begin{example}          \centering   \begin{lilypond}[staffsize=12]  Musical Example 1 comes here  \end{lilypond}       \caption{Caption 1}        \label{ex1}   \end{minipage}   \begin{minipage}         \begin{example}          \centering   \begin{lilypond}[staffsize=12]  Musical Example 2 comes here  \end{lilypond}       \caption{Caption 2}        \label{ex2}   \end{minipage} \end{document}     By the way, TeXShop with the LilyPond-Book implementation is a life saver!

I need help here: I am trying to place two Lilypond musical examples side-by-side. How can I achieve that? Any help is appreciated.   This is the code I am using:  \usepackage{float}   ... \begin{document}   ...     \begin{minipage}         \begin{example}          \centering   \begin{lilypond}[staffsize=12]  Musical Example 1 comes here  \end{lilypond}       \caption{Caption 1}        \label{ex1}   \end{minipage}   \begin{minipage}         \begin{example}          \centering   \begin{lilypond}[staffsize=12]  Musical Example 2 comes here  \end{lilypond}       \caption{Caption 2}        \label{ex2}   \end{minipage} \end{document}     By the way, TexShop with the Lilypond-Book implementation is a life saver!


I want to load a jquery script in Angular 4. In the html I have a table which display some data :

         #	         Hotel name	         Price for night	         Address	         Action

             {{hotel.id}}	             {{hotel.name}}	             {{hotel.pricePerNight}}	             {{hotel.address.city}}{{hotel.address.country}}

   And I want to use a jquery script to allow me to change some data when I click in some td.  And this my component.ts :   @Component({   selector: 'hotel',   templateUrl: './hotel.component.html' }) export class HotelComponent implements OnInit {    data: any;    constructor(){     this.getData((data) => {       this.data = data;     });    }   ngOnInit() { }   ngAfterViewInit() {     $('td').on('click', function() {       console.log("alooo");       var $this = $(this);       var $input = $('<input>', {           value: $this.text(),           type: 'text',           blur: function() {              $this.text(this.value);           },           keyup: function(e) {              if (e.which === 13) $input.blur();           }       }).appendTo( $this.empty() ).focus();     });   }   public getData(data) {     const req = new XMLHttpRequest();     req.open('GET', 'assets/data/listOfHotels.json');     req.onload = () => {       data(JSON.parse(req.response));     };     req.send();   } }   The data displayed perfectly but when I click in any column I get nothing.  (I made a simple code  with  and  ... a static table, it works but in the dynamic version it doesn't work) Any help !

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


I downloaded the current iso file of Ubuntu MATE from . I did a completely fresh install of Ubuntu MATE 16.04 (specifically 16.04.5).   the same is true for Ubuntu MATE 18.04 (specifically 18.04.1) and   I created a default user while installing with its GUI called test (full name Test). The system thus created a UPG called test. after installation had finished, I restarted the system. Now on the completely fresh system I open System > Control Center > Users and Groups > Manage Groups. I look for the test group and press Properties, and here it is... user test is not member of group test!     it looks like /etc/group suggests the same: (2nd last line)  test@test ~ $ less /etc/group | grep test adm:x:4:syslog,test cdrom:x:24:test sudo:x:27:test dip:x:30:test plugdev:x:46:test lpadmin:x:113:test test:x:1000: sambashare:x:129:test   but according to  the primary group of a user is only listed in /etc/passwd and not additional in /etc/group to avoid redundancy.  id <username> seems to suggest a little bit different:  test@test ~ $ id test uid=1000(test) gid=1000(test) groups=1000(test),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),113(lpadmin),129(sambashare)   the best way to proof is groups <username>:  test@test ~ $ groups test test : test adm cdrom sudo dip plugdev lpadmin sambashare     So is this a bug by the GUIs? - Somehow i doubt it, because of how long time it is there and also present in two well known DEs...

I just added a new, underprivileged "desktop user," and I was surprised to discover that it can see the files in my home folder.  What is the rational for setting up such lax permissions?


This is my login interface but I am using Ubuntu 18.04.2 LTS version.     I want to switch to the default login page.

The login screen appears in a much older style:    Output of cat /etc/X11/default-display-manager:  /usr/bin/xdm   How can I change it back to normal?


In python regular expression, raw string behavior is different.    import re m = re.match(r"\n","C:\some\nDay\n") print(m) a= re.match("\n", "C:\some\nDay\n") print(a)   In the first expression, it should consider \n as normal text and return the match position. but in both expression None is the output.

What is the difference between the search() and match() functions in the ?  I've read the  (), but I never seem to remember it.  I keep having to look it up and re-learn it.  I'm hoping that someone will answer it clearly with examples so that (perhaps) it will stick in my head.  Or at least I'll have a better place to return with my question and it will take less time to re-learn it.


The database is under Full Recovery Method, the DBCC SQLPERF (LOGSPACE) shows 3 % used. Even after I take Log back ups frequently it is not releasing space. There is no active transaction and log_reuse_wait_desc reports as nothing.   How do i prevent the log from growing since the log back up is not truncating the log files

This one seems to be a common question in most forums and all over the web, it is asked here in many formats that typically sound like this:  In SQL Server -  What are some reasons the transaction log grows so large? Why is my log file so big? What are some ways to prevent this problem from occurring? What do I do when I get myself on track with the underlying cause and want to put my transaction log file to a healthy size?


I am running ubuntu 14.04 on my Notebook with Nvidia optimus. Default intel drivers, nvidia 340.24  + bumblebee. (Those problems are indipendent from nvidia, they persist with either nouveau and various nvidia drivers and either with bumblebee and nvidia prime) When I connect my CRT to the notebook through VGA port, the CRT tells the notebook the max refresh rate for every resolution is 85 hertz. This is not real. With 1024x768 i can go 90 hz and with 800x600 I can go 110 hz. This also happened on windows, but the solution was simple: i just set the custom resolution in intel panel. Then if i open, for example, quake live, i can set the refresh rate to 90. But there is a difference between the windows driver and Xrandr. In windows, the 90 hz custom res is considered as an extension of the standard 1024x768. In fact, if I choose 1024x768 than, in the refresh slider, I get 60,75,85 and 90 hz. In Xrandr the custom resolution you add with --addmode is considered an entirely different res. So if the standard 1024 can only go 85 hz, and i add 90 hz, all the inferior refresh rates for 1024 are called "1024x768" and you can just make:  xrandr --output VGA1 --mode 1024x768 -r 85   but if you do    xrandr --output VGA1 --mode 1024x768 -r 90   It doesn't work. You have to make:    xrandr --output VGA1 --mode 1024x768_90.00   where 1024x768_90.00 is the name of the resolution you added. This leads to problems. For example, various games try to pick the highest refresh possible. So if it's 110, they still pick 85. And even if you force it through the game it still is 85. Isn't there a way to just add a refresh rate to an already existing mode? Also, Xrandr is having some strange behaviours.  For instance: I do   xrandr --output VGA1 --mode "1024x768_90.00"   And the refresh is set to 90 hz. But, if I open TeamSpeak, Warsow or Ubuntu SDK (and probably other apps i don't know about) the resolution is set back to 85 and LOCKED. This means that while those apps are running I can't have a custom rate. When I close them, i can again. This also happen when you start steam, but steam doesn't lock the framerate. Also, if I happen to use any xrandr command after having set new resolution, it returns 85 hz. To pick 90 hz again, I have to re-use the command for custom res THREE times. Exatly three times. AT the first twos both monitors turn black for a second and then back to 85 hz. The third time, only the crt turns black and goes 90 hz. This also happens with 800x600_110.00, but not three times. (I haven't counted but i'm sure it isn't three)  All this happens both in lightdm and gdm.  Has someone got any clues?  Also, isn't there any proprietary intel driver?  EDIT: I did some research, I would also like a way to disable EDID since all I've found didn't work.

How do I change the monitor's refresh rate in Oneiric?   There is no option to do it in the Displays dialog now. By default it's 60Hz, but I need 75Hz on my monitor.  In previous releases there used to be such an option in the Displays dialog.  Edit - Half baked solution  The best I could do so far was:  xrandr -s 1280x1024 -r 75   This is perfect, but my problem is that it isn't permanent. It defaults back to 60 Hz after logging out and back in.  Perhaps this should go into some script and added to startup? I just don't know how to do that.


I want to run a bash command at startup (~/.config/autostart/myCommand.desktop) that requires sudo, but rather than it prompting me every time, I would like to include the password in the command, something like:  sudo --some-flag [PASSWORD] [command]  I have seen answers suggesting to change sudoers, etc. but I am wondering if something more like what I said is possible.

I need to run something as sudo without a password, so I used visudo and added this to my sudoers file:  MYUSERNAME ALL = NOPASSWD: /path/to/my/program   Then I tried it out:  $ sudo /path/to/my/program [sudo] password for MYUSERNAME:    Why does it ask for a password? How can I run/use commands as root with a non-root user, without asking for a password?


In  paper the authors state the following regarding a null hypothesis significance test:  If P-value < critical value, reject null hypothesis and accept the alternative hypothesis (difference detected). If P-value > critical value, accept null hypothesis (no difference is detected)  Have the authors made a mistake by saying 'accept the null'? I initially thought so but then I noticed in the abstract they state:  P value is condemned by one school of thought who claims that focusing more on P value undermines the generalizability and reproducibility of research.  So they are clearly aware of the issues with p-values. So why do they then say 'accept the null' instead of 'fail to reject the null'? Maybe its just a convention to say 'accept the null' even if one is aware that what we are really doing is failing to reject the null?

Traditional statistical tests, like the two sample t-test, focus on trying to eliminate the hypothesis that there is no difference between a function of two independent samples. Then, we choose a confidence level and say that if the difference of means is beyond the 95% level, we can reject the null hypothesis. If not, we "can't reject the null hypothesis". This seems to imply that we can't accept it either. Does it mean we're not sure if the null hypothesis is true?   Now, I want to design a test where my hypothesis is that a function of two samples is the same (which is the opposite of traditional statistics tests where the hypothesis is that the two samples are different). So, my null hypothesis becomes that the two samples are different. How should I design such a test? Will it be as simple as saying that if the p-value is lesser than 5% we can accept the hypothesis that there is no significant difference?


I'm currently riding a mountain bike from Wal-Mart, takes me about an hour. When I get my tax return, I plan buying a more appropriate bike for the commute. I'd like to stay around $300-400, and this would be the second bike I would buy, so I'd appreciate any suggestions and advice.

In the (distant) past I commuted 6 km (more than half an hour) each way, on a cheap bike with big knobbly tyres.  Soon I'll have a new commute: 18 km each way, daily. That's much further than I've done in the past, and I don't want it to take 2 hours each way; but  suggests that it's feasible:      Most people who reside 10 to 20 kilometres away will also find it quite easy to cycle to work, although the distance in the high end of this range will become a little more demanding.   If I can do it in 80 minutes or even less each way, that would be ideal. I'm 49 years old, 6 foot tall, and weigh 170lb, and I want to commute by bike because otherwise I'd be getting no exercise in my week at all.  I've never bought or ridden anything but a cheap bike.  What equipment should I buy then, to commute 11 miles each way through a city (Toronto) on  flat, paved roads, shared with cars:   Wheels? Tyres? Clipless pedals and shoes? Gears? Handlebars (e.g. flat or dropped)? Frame (size, shape, material)? Mud-guard/fender?


I don't know why this is happening. Heres the code:  import com.lewislovesgames.chopthattree.minecraftservermanager.Main;  public class main {   public static void main(String[] args) {      if (args.length == 0) {            if  (args[0] == "--nogui") { // Debugger says this is the line it errors on           System.err.println("NOGUI not made yet");       } else {        System.err.println("[Minecraft Server Manager]: Argument does not exist.");       }      }      System.out.println("[Main]: Running Main Window");      Main main = new Main();      main.setVisible(true);       }  }   The code did work until I put in the args snippet. It looks like the array is never 0 so it passes on to the next line. I'm using Eclipse for the debugger and running of the program.

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


Question is in title. I can't make it work:  >>> data = [{}] * 2 >>> data[1].update({3:4}) >>> data [{3: 4}, {3: 4}]   key-value pair adds to all elements of array. I expected to receive that:  [{}, {3: 4}]

I needed to create a list of lists in Python, so I typed the following: my_list = [[1] * 4] * 3  The list looked like this: [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]]    Then I changed one of the innermost values: my_list[0][0] = 5  Now my list looks like this: [[5, 1, 1, 1], [5, 1, 1, 1], [5, 1, 1, 1]]    which is not what I wanted or expected. Can someone please explain what's going on, and how to get around it?


I have some different configurations and I need to get the combination of them all to run a python script  versions = ['lg', 'sm'] start_time = ['0', '1'] end_time = ['2']   What I want is snakemake to do this for me:  python my_script.py -v lg -s 0 -e 2 > lg_0_2.out python my_script.py -v lg -s 1 -e 2 > lg_1_2.out python my_script.py -v sm -s 0 -e 2 > sm_0_2.out python my_script.py -v sm -s 1 -e 2 > sm_1_2.out   but I can't seem to figure out how to do this in snakemake. Any ideas?

How can I get the Cartesian product (every possible combination of values) from a group of lists?  Input:   somelists = [    [1, 2, 3],    ['a', 'b'],    [4, 5] ]   Desired output:  [(1, 'a', 4), (1, 'a', 5), (1, 'b', 4), (1, 'b', 5), (2, 'a', 4), (2, 'a', 5) ...]


I know that momentum and energy are always conserved in collisions, but if we have a perfectly inelastic collision in which an object sticks to another object $m_1 v_1 + m_2 v_2 = (m_1+m_2)v_{12}$, the kinetic energy is not conserved. I know that kinetic energy converts into thermal or sound energy, but I don't see how this would account for the whole of the lost kinetic energy.  Does the kinetic energy transform into some sort of potential energy between the bonding of the two objects? For example, if the two objects stick together with a small magnet (assuming the initial attraction between the objects is negligible) does the kinetic energy transfer to some sort of magnetic potential?

In inelastic collisions, kinetic energy changes, so the velocities of the objects also change.  So how is momentum conserved in inelastic collisions?


I brought in an SVG logo and have had almost no problems so far. However, I've gotten to a bit in the logo which has 3 letters. The one in the middle does not fully show up in rendered view. I can go into edit mode and I see the full letter, but I'm stuck as to how to convert it to mesh and make it render correctly. I've included some screenshots. Despite how wonky this letter looks, I can't change the shape at all. It has to be exact like the logo I'm working from.

It should be noted that this question poses a similar issue to some other questions on SE, but (the ones that I saw) were caused by massively large scaling factors, which (as far as I can tell) isn't the source of this issue.   I'm trying to import  into blender so that I can extrude it afterwards. All I can manage to get is this result:    I'm very new to blender, so I don't know what the issue could be. All I did to get this was create a new scene, import the svg, and zoom/move the view to make it visible.  As well, I have uploaded (and publicly shared, of course) the  for those who are interested.


I wrote an application in WPF and binded the width of an rectangle to the with of a grid columnDefinition. I filled it red to test if it works. It works in the designer but when I start the application I cant´t see anything red. That´s my main window: <Grid>         <Grid.ColumnDefinitions>             <ColumnDefinition x:Name="col1" Width="200"/>             <ColumnDefinition Width="5"/>             <ColumnDefinition x:Name="col2"/>         </Grid.ColumnDefinitions>         <Grid.RowDefinitions>             <RowDefinition x:Name="row1"/>         </Grid.RowDefinitions>          <GridSplitter Grid.Column="1" SizeChanged="CanvasChangeSize" HorizontalAlignment="Stretch" Width="5"/>         <Rectangle Fill="Red" HorizontalAlignment="Left" Height="50" StrokeThickness="0" VerticalAlignment="Top" Width="{Binding ElementName=col1, Path=ActualWidth}"/>      </Grid>  Can anyone help me?

I'm attempting to bind a DependancyProperty in one of my usercontrols to the Width property of a Column in a Grid.   I have code similar to this:  <Grid x:Name="MyGridName">     <Grid.ColumnDefinitions>         <ColumnDefinition x:Name="TitleSection" Width="100" />         <ColumnDefinition Width="*" />     </Grid.ColumnDefinitions>      <Grid.RowDefinitions>...</Grid.RowDefinitions>      <GridSplitter x:Name="MyGridSplitter" Grid.Row="0" Grid.Column="0" ... /> </Grid>   In a separate Usercontrol I have the followingDependancyProperty defined.  public static readonly DependencyProperty TitleWidthProperty = DependencyProperty.Register("TitleWidth", typeof(int), typeof(MyUserControl));  public int TitleWidth {     get { return (int)base.GetValue(TitleWidthProperty); }     set { base.SetValue(TitleWidthProperty, value); } }   I am creating instances of the Usercontrol in code, hence I have a binding statement similar to this :  MyUserControl Cntrl = new MyUserControl(/* Construction Params */); BindingOperations.SetBinding(Cntrl , MyUserControl.AnotherProperty, new Binding { ElementName = "objZoomSlider", Path = new PropertyPath("Value"), Mode = BindingMode.OneWay }); BindingOperations.SetBinding(Cntrl , MyUserControl.TitleWidthProperty, new Binding { ElementName = "TitleSection", Path = new PropertyPath("ActualWidth"), Mode = BindingMode.OneWay }); /* Other operations on Cntrl */   The first binding defined works fantastically, although that is binding to an actual UIElement (in this case a Slider), but the Binding to "TitleSection" (which is the ColumnDefinition defined in the Grid) fails. Putting a breakpoint in the code and doing a watch on "TitleSection" returns the expected object.   I am beginning to suspect that a x:Name'd ColumnDefinition can't be bound to. Can anyone suggest how I might be able to bind to the changing width of the first column in my grid?  EDIT #1 - To answer comments  The databinding 'fails' in the sense that with a breakpoint set on the setter for the TitleWidth property, and using the GridSplitter control to resize the first column, the breakpoint is never hit. Additionally, code I would expect to be fired when the DependancyProperty TitleWidth changes does not get executed.  The usercontrol is being created and added to a Stackpanel within the Grid in the Window_Loaded function. I would expect that the Grid has been rendered by the time the Usercontrols are being constructed. Certainly the x:Name'd Element TitleSection is watchable and has a value of 100 when they are being constructed / before the binding is happening.  EDIT #2 - Possibly something to do with this?  I've been having a sniff round the MSDN pages for the Grid ColumnDefinition documentation and have come across  but I can't get my head around how I can use this in a binding expression. I cannot use the associated GridLengthConverter as a converter in the binding code as it does not derive from IValueConverter.   I am leaning towards somehow binding to the ActualWidth property of one of the cells in the Grid object. It doesn't seem as clean as binding to the column definition, but at the moment I cannot get that to work.


I'm reading right now a paper related to the state of Hybrid Electric Vehicle (HEV) and Battery Electric Vehicle (BEV) and I saw:     BEVs produce no pollutants such as particulates, (...)   What is the difference between this form and the use of: BEVs don't produce pollutants such as particulates, (...)  As far as I know, It's very common to use the first form in papers or textbooks. Why? Is it about formality, rule of scientific papers or something related to grammar figures?  Thank you for your answers.

What is the difference in style and meaning between the following two:        She seems not to know.   She doesn't seem to know.      Is there a name to this type of construction?


I have two administrator and one guest user accounts on my computer. I have set password to one of my administrator accounts and forgot.   Can I get back access to that account trough the second administrator account, or how can I recover my password?

I lost my password to a VM running 11.04, but have ssh access via public key authentication.  Is there any way I can reset the password without a reboot? (This is to avoid downtime of services it's running.)


If one doesn't visit university/college and doesn't even take any courses in theoretical physics and learns PhD-level physics from other resources without stepping foot in college or university; Would it then become possible for him to do research?   Most people I've seen emphasize that "you need a real theoretical physicist as a teacher in order to become a theoretical physicist, and that will only happen if you go to college or university" but the Internet exists for a reason.   Most theoretical physicists that I have questioned about this, just have a feeling of "I crossed the river, met a lot of people, cut many trees and spent a lot of time living in the woods coarsely to get a single apple. But he didn't do all of that and instead laid comfortably in a bed and received a single apple without doing anything." In other words, it invokes jealousy or something similar.   In my opinion, learning what a doctoral candidate in theoretical physics knows isn't impossible but can be done with some patience and hard work, without going to college. But is it even possible to formulate a thesis or do research in the field and submit it to journals?

Assume you have already completed your undergrad and have been working for a number of years. Does one need to be part of a university or a learning institution to publish papers?