Raw disk access on Windows 8
How to access specific raw data on disk from java
I need a quick algorithm to select 5 random elements from a generic list. For example, I'd like to get 5 random elements from a List&lt;string&gt;. Am I Running as a Service I am currently writing a little bootstrap code for a service that can be run in the console. It essentially boils down to calling the OnStart() method instead of using the ServiceBase to start and stop the service (because it doesn't run the application if it isn't installed as a service and makes debugging a nightmare).  Right now I am using Debugger.IsAttached to determine if I should use ServiceBase.Run or [service].OnStart, but I know that isn't the best idea because some times end users want to run the service in a console (to see the output etc. realtime).  Any ideas on how I could determine if the Windows service controller started 'me', or if the user started 'me' in the console? Apparantly  is not the answer. I thought about using commandline args, but that seems 'dirty'.  I could always see about a try-catch statement around ServiceBase.Run, but that seems dirty. Edit: Try catch doesn't work.  I have a solution: putting it up here for all the other interested stackers:      public void Run()     {         if (Debugger.IsAttached || Environment.GetCommandLineArgs().Contains&lt;string&gt;("-console"))         {             RunAllServices();         }         else         {             try             {                 string temp = Console.Title;                 ServiceBase.Run((ServiceBase[])ComponentsToRun);             }             catch             {                 RunAllServices();             }         }     } // void Run      private void RunAllServices()     {         foreach (ConsoleService component in ComponentsToRun)         {             component.Start();         }         WaitForCTRLC();         foreach (ConsoleService component in ComponentsToRun)         {             component.Stop();         }     }   EDIT: There was another question on StackOverflow where the guy had problems with the Environment.CurrentDirectory being "C:\Windows\System32" looks like that may be the answer. I will test today. Error 1052 Field is Ambiguous using Inner Join Function Title does not appear when LaTeX code is compiled How do I prompt for Yes/No/Cancel input in a Linux shell script? I want to pause input in a shell script, and prompt the user for choices. The standard Yes, No, or Cancel type question. How do I accomplish this in a typical bash prompt? Local colormaps in global coordinate system I am trying to get a surface graph with two colormaps.  Instead of using the full Z range i want to give the first surface its own colormap  and the second surface should receive its own colormap too (it may be even the same)... however the current version takes the full range of Z-Data and calculates the colormap. Is there any way?  \begin{tikzpicture}     \begin{axis}[grid = major, colormap={bw}{gray(0cm)=(0); gray(1cm)=(1)}, view={-30}{15}]   \addplot3[surf]    table     {DATA1.dat};   \addplot3[surf]    table     {DATA2.dat};  \end{axis} \end{tikzpicture}   Right now it looks like that:   I want each of the surface to be scaled individually... just to see more clearly how the amplitude changes :)  Any ideas?  Thanks, Alex Would someone give a thorough explanation of 1.14 Minecraft's /data modify? Okay, so I've been searching all over the internet for an explanation of data modify ever since I heard Sethbling passively mention it in one of his videos. The only  thing I could find on it was the wiki and the update log for the 1.14 snapshot. So, I checked these, and they hardly explained it at all. I can get /data modify block 123 20 123... and that's as far as I get.  Minecraft wiki does not at all define clearly what  is (the thing meant to go after coords), nor does it specify what each operation does to what. Operations include (without explanation, and excluding set (which it does explain)): append, insert, merge, and prepend. Then, it has from|value as the next option, which aren't explained either. After this, it just has block/entity and coords/id. So, I know the format (mostly), but I haven't the slightest idea what any of it means. And nothing I've seen on the internet even mentions the command save for Minecraft wiki itself.  Please explain if you know what data modify is. Thanks! Possible Duplicate:          This is something I haven't quite figured out yet, but I have been using function(){}() just because my VIM syntax highlight screws up if I add the parenthesis, although I've seen (function(){})() around many times, maybe its an IE thing?  edit:  var singleton = function() {     // code }();  var singleton = (function() {     // code })(); Considering the three types of Devil Fruits that has been explained are 1. Paramecia Type - where the user can get super human abilities and change their body parts into weapons, etc. 2. Zoan type - where the use can turn into a particular animal and inherit its abilities 3. Logia Type - where the user's body inherits a particular element and the body becomes like air which cannot be touched or damaged by non Haki users.  So what exactly is the type of Gomu Gomu no Mi? It cannot be Zoan or Logia. It's very close to a Paramecia but still doesn't have a logical explanation to be of Paramecia type! So is it some special type of Devil Fruit? Formatting each part/section/subsection Are there some magic lines to be placed in the preamble that would, like in CSS,  specify how each generic section or subsection in the whole document should be formatted? I am trying to find a good rough guesstimate of how much of the maximum wattage usage of a graphics card is turned into hot air.  Say a graphics card is rated at using X watts at maximum usage. How much of that is released as heat into the air via the cooling setup, and how much is not (If not where does it go? To ground?)  Yes I know there are a lot of variables here, I am just looking for a guesstimate from someone who would understand better than me. I'm specifically using  (Radeon 6990 375 watts max) My intuition tells me it's a trade off between speed and security, but how did the standardisation process select these three seemingly arbitrary key lengths (namely, AES-128, AES-192, AES-256). Basic Electronics Book I need basic electronics books  (diodes,transistors,current.. etc) as I am just starting out with electronics and want to have something to read over the holiday.  Any suggestions of good beginners' books? Story ID: A pre-teen girl who is a genius crosses the country in a van Reconciling different definitions of left-exact functor How do comments work? Across the Stack Exchange network you may leave comments on a question or answer.  How do comments work? What are comments for, and when shouldn't I comment? Who can post comments? Who can edit comments? How can I format and link in comments? My comment doesn't contain some of the text I typed in it; why? My comment appears to be long enough, but I can't post it because it's too short; why? Who can delete comments? When should comments be deleted? Why can't I comment on specific posts even if I have enough reputation to comment? When can comments be undeleted? What are automatic comments? How can I link to comments? Anything else I should know about comments?  Also see the FAQ articles on  and . I want to apply a macro to all the cells of a column with the cell content as the input to the macro. Is this possible?  For example if the cell contents have the word TEST, the macro should take TEST as its argument. How do I detect unsigned integer multiply overflow? Suggested edits in top-bar put flags over the winterbash snowflake Suggested edits in the top bar put the flag count right over the winterbash snowflake. Looks pretty ugly if you ask me... I'm unable to uninstall MATLAB;  sandeep@sandeep-VPCEH28FN:~$ sudo rm /var/tmp/lm_TMW* [sudo] password for sandeep:  rm: cannot remove '/var/tmp/lm_TMW*': No such file or directory sandeep@sandeep-VPCEH28FN:~$ sudo apt-get purge matlab E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable) E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it? sandeep@sandeep-VPCEH28FN:~$ sudo apt-get purge matlab-support E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable) E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it? sandeep@sandeep-VPCEH28FN:~$