Getting a "random" number from 0 - 1 depending on a number and a count
Seedable JavaScript random number generator
Does anyone know if there is an API to get the current monitor state (on or off) in Windows (XP/Vista/2000/2003)?  All of my searches seem to indicate there is no real way of doing this.    tries to use  which according to Microsoft's docs does not work for display devices.   In Vista I can listen to  but I do not seem to get events when the monitor is turned off manually.   In XP I can hook into WM_SYSCOMMAND SC_MONITORPOWER, looking for status 2. This only works for situations where the system triggers the power off.   The WMI Win32_DesktopMonitor class does not seem to help out as well.   Edit: Here is  on comp.os.ms-windows.programmer.win32 indicating there is no reliable way of doing this.   Anyone else have any other ideas? Creating and configuring .bash_profile I was setting path for anaconda. an answer to a question  has the following solution. I searched for .bash_profile, but I can't seem to find it. How do I setup this file and get it to run on startup? First off, this is a question about a desktop application using Windows Forms, not an  question.  I need to interact with controls on other forms. I am trying to access the controls by using, for example, the following...  otherForm.Controls["nameOfControl"].Visible = false;   It doesn't work the way I would expect. I end up with an exception thrown from Main. However, if I make the controls public instead of private, I can then access them directly, as so...  otherForm.nameOfControl.Visible = false;   But is that the best way to do it? Is making the controls public on the other form considered "best practice"? Is there a "better" way to access controls on another form?  Further Explanation:  This is actually a sort of follow-up to another question I asked, . The answer I got was great and solved many, many organizational problems I was having in terms of keeping the UI straight and easy to work with both in run-time and design-time. However, it did bring up this one niggling issue of easily controlling other aspects of the interface.  Basically, I have a root form that instantiates a lot of other forms that sit in a panel on the root form. So, for instance, a radio button on one of those sub-forms might need to alter the state of a status strip icon on the main, root form. In that case, I need the sub-form to talk to the control in the status strip of the parent (root) form. (I hope that makes sense, not in a "who's on first" kind of way.) Ubuntu 17.10 Upgrade Broke VMWare Workstation 12.5 Hi after upgrading to Ubuntu 17.10, vmware is now not starting.    I get the message:    /usr/lib/vmware/bin/vmware-modconfig: Relink `/lib/x86_64-linux-gnu/libbsd.so.0' with `/lib/x86_64-linux-gnu/librt.so.1' for IFUNC symbol `clock_gettime'   I am aware that there are patches available and I am attempting to apply these and recompile. I have run from the solution at :    cd ~   #Copy the vmmon source tar ball to your temporary location cp /usr/lib/vmware/modules/source/vmmon.tar .    #Extract the tar ball tar xf vmmon.tar    #Download the modified file that mkubecek posted and overwrite the one from the tar ball for VMware Workstation 12.5: wget -O ./vmmon-only/linux/hostif.c https://raw.githubusercontent.com/mkubecek/vmware-host-modules/b50848c985f1a6c0a341187346d77f0119d0a835/vmmon-only/linux/hostif.c     #Wrap up the newly modified files into a tar ball replacing the original one sudo tar cf /usr/lib/vmware/modules/source/vmmon.tar vmmon-only    #Rebuild the VMware kernel modules sudo vmware-modconfig --console --install-all   Failed to get gcc information.  gcc --version gcc (Ubuntu 7.2.0-8ubuntu3) 7.2.0 ...   Unforunately, vmware-modconfig is failing because of a dependency it seems on a particular gcc version. Am I on the right track? Any help with this issue would be much appreciated.  EDIT Thank you Steve, the below has gotten vmware going again. I've included minor correction. Tested and confirmed I could run a virtual machine.   sudo su    # do all below as root cd /usr/lib/vmware/modules/source tar xvf vmmon.tar  tar xvf vmnet.tar wget -O ./vmmon-only/linux/hostif.c https://raw.githubusercontent.com/mkubecek/vmware-host-modules/b50848c985f1a6c0a341187346d77f0119d0a835/vmmon-only/linux/hostif.c vim vmnet-only/bridge.c cd vmmon-only/ make cd ../vmnet-only/ make cd .. mkdir /lib/modules/4.13.0-16-generic/misc cp *.o /lib/modules/4.13.0-16-generic/misc insmod /lib/modules/4.13.0-16-generic/misc/vmmon.o insmod /lib/modules/4.13.0-16-generic/misc/vmnet.o rm /usr/lib/vmware/lib/libz.so.1/libz.so.1 ln -s /lib/x86_64-linux-gnu/libz.so.1 /usr/lib/vmware/lib/libz.so.1/libz.so.1 vmware-networks --start exit  # run vmware as normal user /usr/lib/vmware/bin/vmware Radius of Convergence when using Series[] Infinite distinct factorizations into irreducibles for an element Consider the factorization into irreducibles of $6$ in $\mathbb{Z}[\sqrt{-5}]$. We have $6=2 \times 3$ and  $6=(1+\sqrt{-5}) \times (1-\sqrt{-5})$, i.e. $2$ distinct factorizations. And,  $$6^2=3 \times 3\times2\times2$$ $$=(1+\sqrt{-5}) \times (1-\sqrt{-5}) \times (1+\sqrt{-5}) \times (1-\sqrt{-5})$$ $$=(1+\sqrt{-5}) \times (1-\sqrt{-5})\times3\times2.$$ More generally, $6^n$ will have $n+1$ distinct factorizations into irreducibles in $\mathbb{Z}[\sqrt{-5}]$ by a simple combinatorial argument. But, can we construct a ring in which there exists an element that has an infinite number of distinct factorizations into irreducibles? To make life harder, can we construct an extension of $\mathbb{Z}$ in which this happens? I have been thinking about this for a while and have managed to find no foothold.. Any help is appreciated. How am I supposed to use nvidia-prime? I have an acer laptop with these GPUs: - GPU0: Intel HD Graphics 4000 (M) (obviously integrated) - GPU1: NVIDIA GeForce GT 710M  I uninstalled all nvidia-drivers because I was experiencing a lot of bugs and I read here and there that they are not supposed to work with Optimus without either bumblebee or nvidia-prime.  As far as I understand, nvidia-prime would allow me to have the NVidia GPU always on. And to choose between that or always off (i.e. always use Intel)  So now I installed nvidia-prime with  sudo apt-get install nvidia-prime   What am I supposed to do now?  I thought nvidia-prime provided a graphical interface which would allow me to choose which graphic card to use, and even to install the needed nvidia drivers.  By typing "nvidia" in the dash, nothing shows up. From a terminal, the only command available starting with "nvidia" is "nvidia-detect" which just prints "none".  So, I installed nvidia-prime, how do I use it? Convert a Pair of Integers to a Integer, Optimally? How come I can't give more than 500 rep? Why can't I give more than 500 reputation as a bounty at a time? The system won't let me choose an option more than 500.  Also, how were some users able to do so? On  the OP has given a single bounty worth 550 rep, but at the moment I have 844 rep and I can't give any more than 500 rep on a bounty.  Can you please tell us if this is a bug or not? Suppose I have a program named any_program.exe and my operating system drive is C:. The location of the program is D:\Any_Folder\any_program.exe  How do I start/execute that program via command prompt in Windows 8?  I have tried the command line START any_program.exe, but it shows me an error that      Windows cannot find 'any_program.exe'. Make sure you typed the name correctly, and then try again.   By the way, it worked perfectly in Windows 7. And, if I type START notepad.exe or START firefox.exe (Firefox is not installed in C: drive), it works in Windows 8. Is it now considered acceptable to follow a proper noun ... or any noun ... with a pronoun? E.g.      The President he issued a new executive order. Reverse (parse the output) of Arrays.toString(int[]) I wonder which of the two is correct:        I have a red and a blue car.   I have a red and a blue cars.      or        Everyone has a left and a right arms.   Everyone has a left and a right arm.      My (non-native) inclination would be for option 1, as it sounds better.  On the other hand, in the following examples, the plural sounds better to me.    Everyone has left and right arms. I have old and new cars. (when I only have only one old car and one new car) The left and the right arms are...   But are they correct? I want to do:  int a = 255;  cout &lt;&lt; a;   and have it show FF in the output, how would I do this? My web application generates a lot of reports in formats like excel sheet, Csv(comma-separated values), fixed width columns, pdf format, html reports etc based on the parameters I select. There is a lot of data in the reports.  Are there any essential criteria for testing report generation that I may not have considered.  I know to test these things:   Data is correct Filters are used Output format is correct   What else is there? How to prove: if $a,b \in \mathbb N$, then $a^{1/b}$ is an integer or an irrational number? It is well known that $\sqrt{2}$ is irrational, and by modifying the proof (replacing 'even' with 'divisible by $3$'), one can prove that $\sqrt{3}$ is irrational, as well.  On the other hand, clearly $\sqrt{n^2} = n$ for any positive integer $n$.  It seems that any positive integer has a square root that is either an integer or irrational number.        How do we prove that if $a \in  \mathbb N$, then $\sqrt a$ is an integer or an irrational number?      I also notice that I can modify the proof that $\sqrt{2}$ is irrational to prove that $\sqrt[3]{2}, \sqrt[4]{2}, \cdots$ are all irrational.  This suggests we can extend the previous result to other radicals.        Can we extend 1? That is, can we show that for any $a, b \in \mathbb{N}$, $a^{1/b}$ is either an integer or irrational? Is it possible to transfer Minecraft PE worlds to Minecraft PC? Has 'Ubuntu Software' been renamed to 'Snap Store'? I updated Ubuntu last night (sudo apt get update &amp;&amp; sudo apt get upgrade) and to  my surprise this morning I didn't find the 'Ubuntu Software' app and there's a new entry called 'Snap Store' which when opened looks just like the old 'Ubuntu Software' app. So has 'Ubunu Software' been renamed to 'Snap Store'? And if yes, why? “...than I am” vs. “...than me” I read an English grammar article in which the author talked about the correct use of pronouns.  He writes:     If the extended sentence is “She’s more likely to ask him than I am,” in which the comparison is between the subject and the writer, I is correct. However, if the intent is to convey that the man referred to as him is more likely to be asked something by the subject than the writer is, the correct pronoun form is me, but that distinction should be clarified with a revision like “She’s more likely to ask him than ask me.”   Before reading this piece, I thought that the two sentences had the same meaning. While the second example is quite clear for me (“She’s more likely to ask him than ask me”), I don't think that I have correctly understood the first one. Could anyone explain it to me, please? Referring to correctly-styled algpseudocode procedure name in document Given an algorithm written in algpseudocode:  \documentclass{article} \usepackage{algorithm} \usepackage{algpseudocode} \begin{document} \begin{algorithm}   \caption{Part 1}   \begin{algorithmic}[1]     \Procedure {FooProc}{$G$}       \State ...     \EndProcedure   \end{algorithmic} \end{algorithm} \end{document}   How can I now refer to FooProc in my document (outside of the algorithm environment) such that it has the same typeset as in inside the algorithm environment?