I need help restarting/shutting down from the root command line, any commands I could use? I don't like hard resetting
How do I reboot a Ubuntu Server from the command line? sudo reboot now never seems to work for me. Because its a server, I don't have a window manager installed, so I can't do it from a GUI (which always seems to work).    I've had the problem for years on different versions of the operating system. It happens in virtual machines and on real metal. The same problem exists with sudo shutdown now, too.  I've lived with it in the past. The difference now is I don't want to just hit the power button because I might lose data.
How to select a value from a list with non-uniform probabilities? KKT points and nonlinear optimality (theory) I have some questions about Karush Kuhn Tucker conditions. I am not clear about the theory. There are plenty of theorems and I am confused with it. Let us say we have the following problem: We have a general problem, not a convex problem. $$\min f(x)\\g_{j}(x)\le 0,\forall j\in J\\h_{k}(x)=0,\forall k \in K. $$ I will solve it.....Lagrange function, verifying primal feasibility, dual feasibility and complementary slackness and I will get some KKT points. Now what is the conclusion?  If I get no KKT point, can I say that the problem has no solution or what is the conclusion? If I get only one KKT point, is it a local minimum or even a global minimum? If I get more KKT points, what is the conclusion? In which case I will verify SOSC condition? If I get more KKT points or even for one point is it necessary? And the conclusion is what? The KKT points which satisfies the SOSC condition are strick local minimum and the poins which does not satisfy it are not the solution of the problem?  I am so sorry for so many questions, but any help would be very appreciated. Thank you very much in advance. Why is Android File Transfer necessary? Apparently newer versions of Android require the use of Android File Transfer. I have an older machine that doesn't require this, and just mounts as a USB mass storage device. I can't see a technical reason why Android File Transfer is now required when it used not to be.  What changed in order to make this necessary? Why is it necessary? Algorithm to return all combinations of k elements from n How to tell how many CPUs (cores) you have on Windows 7 Properties of $x_k=\frac{a_{k+1}-a_{k}}{a_{k+1}}$ where $\{a_n\}$ is unbounded, strictly increasing sequence of positive reals How do I configure swappiness? I need a step-by-step, simple and easy way to configure swappiness. I have two directories that should contain the same files and have the same directory structure.  I think that something is missing in one of these directories.  Using the bash shell, is there a way to compare my directories and see if one of them is missing files that are present in the other? If I click to open achievements from a question when I click the X to close the achievements view I end up on the answers tab of the question, I assume because the X is over the tab and it's tapping through.    It appears if I hit the X it's ok, but if I tap anywhere else in the top row (where the X is) then I can switch to the question or answer tab. How would one write object-oriented code in C? What are some ways to write object-oriented code in C? Especially with regard to polymorphism.    See also this Stack Overflow question . How can we make First letter Capital while using trigonometric functions. eg: \cos (60^\circ) gives simple cos (all in small). What is needed is 'Cos' (with initial capital). For italics in mactex i used \it but it didn't italicized 'cos' only the number '60'. So how to do that? Are both try to save the file and try saving the file grammatically correct? If so, is there any difference in meaning? So you are camping (please excuse the MMO jargon, sometimes I just can't help myself) your own particular corner of Stack Overflow, hoping for a couple of upvotes before bed.  It's freezing cold and you can't quite drag yourself across the room to grab the little blow heater, because that would mean leaving the almost adequate warmth of your laptop.  A completely objective question pops up, to which you absolutely know the answer.  Riding the surge of adrenaline, you spend the next twenty minutes typing like a madman. Desperate to beat the other lunatics that loiter in your tag of choice.  You beat them to the punch and enter a superlative answer, code samples, examples and maybe some ironic humour. You are flushed with your own awesomeness.  You go to bed. Satisfied you have garnered a couple of points of virtual self validation. You look forward to the flush of pleasure in the morning when you see your account bumped ever closer (yet never close enough) to that shining example of Skeetness.    Yet, the next morning, no such flush occurs.  Your answer sits in prime position for some questioner love and none eventuates.  You might get a couple of upvotes from some sympathetic SO compatriot, but the ultimate (I'll try to avoid any unsavory metaphors here)  satisfaction of accepted answer is denied you.    So my question. How you react to this kind of situation?   Catch yourself monitoring the questioner's account waiting for them to log on and then breaking nearby inanimate objects when your answer continues to be ignored. Panic that the questioner might delete their account, leaving your beloved question to evaporate in a puff of uninterest.  Wondering if it was something you said and answering some other of the questioner's queries in the hope of redeeming yourself in their fickle eyes.   I have seen a few examples of this type of frustration on Twitter and wondered how the hardcore Stack Overflow community dealt with this type of rejection. How do I get a consistent byte representation of strings in C# without manually specifying an encoding? How do I convert a string to a byte[] in .NET (C#) without manually specifying a specific encoding?  I'm going to encrypt the string. I can encrypt it without converting, but I'd still like to know why encoding comes to play here.  Also, why should encoding even be taken into consideration? Can't I simply get what bytes the string has been stored in? Why is there a dependency on character encodings? How do I get current date/time on the Windows command line in a suitable format for usage in a file/folder name? REST Service API executor.executeAsync Call Ends in Failure Function in Sharepoint Hosted App Any Answers Will Help me to Forward and Gain Knowledge in SharePoint Development  While i am Trying to get the list Items Using Rest API Calls in SharePoint Hosted App Using Below Function  function loadingSamples()  {     var JobListName = "RRR Jobs #";     var executor;     // Initialize the RequestExecutor with the app web URL.     executor = new SP.RequestExecutor("/");      //Fetching the choice values from the Job Status Field, to show in the Dropdown field     executor.executeAsync     ({         url: "/_api/web/lists/getbytitle('" + encodeURIComponent(JobListName) + "')/fields/getbytitle('Job Status')?$select=Choices",         method: "GET",         headers: { "Accept": "application/json; odata=verbose" },         success: successHandlerStatus,         error: errorHandler     }); } function successHandlerStatus(data)  {     alert("sucesss") }  function errorHandler(data, errorCode, errorMessage)  {     alert("errorMessage") }   It's always going to error function named errorHandler With  Error Code as -1002 and Error Message as Bad Request and Inside Data -> Body , the Error message is  {     "error":{            "code":"-1,Microsoft.SharePoint.Client.InvalidClientQueryException",         "message":{             "lang":"en-US",             "value":"The expression \"web/lists/getbytitle('DWR Jobs \" is not valid."         }     } }   Note :    This is working code in Sharepoint Hosted App that previously hosted in another Windows server. Now i hosted this App in New windows server,it's successfully hosted but it gives above mentioned Error in Rest Service Call. A friend sent a long a file (a .rar) he wanted me to check out for him before he installed it.  I downloaded it and unrared it with no problems, but it was full of .exe's instead of the intended contents (fonts) so I advised him to delete it immediately and not use.  I then proceeded to do the same, but the folder simply will not delete. Oddly the files went fine, and I never ran anything, but this is what I'm seeing:   Could not find this item  This is no longer located in C:\Users\This_User\Desktop. verify the item's location and try again.   I've tried the following things with no help:   Using "Unlocker" to Unlock and delete Using move on reboot and rebooting Using PendMoves (from sysinternals) and rebooting Elevating a cmd line, doing a dir /x to get the short name of the folder, and then del 'shortna~1' Moving the folder to a new folder and then trying to delete the parent folder   I'm on Windows 7 RTM, very fresh install. Any thoughts?  Update: Just to confirm, I've run Hijack this and half a dozen other malware detectors, and everything came back clean (no extra processes, no other obvious badness). Rebooting in safe mode didn't help either. Xubuntu live usb persistence - how to? I'm using Xubuntu 13.04 from live usb.  I know that in order to be able to keep files/settings/etc after restart, USB live disk should be created with some storage reserved. However since I got this USB from a friend who created installation, I don't know if he reserved any space, and so my questions are:   How can I find out amount of space reserved (if any)? If no space is reserved, can I manually chose USB/HDD location to store my settings in order to be able to boot into them the next time I log on?   I'm currently running a very long session and it would help me if I could somehow be able to store my settings (firefox, apt-gets, xrandr screen conf. ... ) to not have to do it again after I reboot.  Thanks,  IR How do I get the coordinates of a mouse click on a canvas element? There is a requirement in our project where they want to evaluate if it is possible to downgrade SQL Server from Enterprise to Standard edition and if a server can be decommissioned.  How can I identify which servers are suitable for downgrade?