Running a "Hello World!" ANSI C program on Android?
How do I build a native (command line) executable to run on Android?
Duplicate:    I want an pseudo random number generator that can generate numbers with no repeats in a random order. For example: random(10) might return 5, 9, 1, 4, 2, 8, 3, 7, 6, 10 Is there a better way to do it other than making the range of numbers and shuffling them about, or checking the generated list for repeats?  Edit: Also I want it to be efficient in generating big numbers without the entire range.  Edit: I see everyone suggesting shuffle algorithms. But if I want to generate large random number (1024 byte+) then that method would take alot more memory than if I just used a regular RNG and inserted into a Set until it was a specified length, right? Is there no better mathematical algorithm for this. I am interested in determining the ages of all 70+ my servers. I would like to create a growth graph showing when servers and databases were added to the environment either/both monthly or annually. I executed the following query using the SSMS multi-query feature with only partial success.  SELECT [name], create_date FROM sys.databases   It's partial success because the master and model databases return with a date of 'April 8, 2003' when I know that I created some of these servers during the past couple years.  I refresh databases from one server to another several times a week, which appears to be causing issues with the database create date.   Is there a simple method to determine the actual create date for both servers and databases? How to create local total counters? I would like to write page numbers like this '7/9' in all minted environments of my document. The first number ('7') is the current page and the second number ('9') is the maximum number of page breaks the source file has been split into.  I was planning to use the package totcount but I realized that it was only considering the last value of the counter at the end of the document and it couldn't manage counters locally to an environment.  Here is a totally stupid example, but it illustrate the problem:  \documentclass{report}  \usepackage{totcount} \newtotcounter{sectnum}  \let\oldsection\section \renewcommand{\section}{%   \setcounter{sectnum}{0}%   \regtotcounter{sectnum}%   \oldsection% }  \let\oldsubsection\subsection \renewcommand{\subsection}{%   \stepcounter{sectnum}%   \oldsubsection% }  \begin{document}  \section*{One}  \subsection*{SectionOne} \thesectnum / \total{sectnum}  \subsection*{SectionTwo} \thesectnum / \total{sectnum}  \subsection*{SectionThree} \thesectnum / \total{sectnum}  \subsection*{SectionFour} \thesectnum / \total{sectnum}   \section*{Two}  \subsection*{SectionOne} \thesectnum / \total{sectnum}  \subsection*{SectionTwo} \thesectnum / \total{sectnum}  \end{document}   Gives:    Where we would have liked to have: '1/4', '2/4', '3/4', '4/4' and '1/2', '2/2'.  So, is there a way to get this kind of feature ? Is any aspect of the supernatural testable? What level of proof is possible for the supernatural? How to sort columns independently? I'm a beginner at photography and own a Canon 20D with two lens; a 50mm prime and a 17mm-85mm zoom.  I've purchases all my filters at 67mm to fit my zoom lens and use a  to use them with my prime lens.  I'm looking at buying a . My question is, will the same principal work? Can I buy a 67mm wide angle lens and use it on my 52mm prime without any trouble.  One of the reasons for the purchase of a wide angle is my cropped sensor makes the 50mm prime rather close - I'm hoping the wide angle will make it easier to capture more.  Many thanks for any help in advance. Pete Stochastic processes book suggestions. I would like to find a book that introduces me gently to the subject of stochastic processes without sacrificing mathematical rigor. It would be great if the book has lots of examples and that the book is designed for undergraduates. Just like how there are rigorous undergraduate abstract algebra books (I am thinking of GAllian's contemporary modern algebra here).   I already studied measure theory, and prob. theory.  Thank you. How to restart X Window Server from command line? How can I restart X Window Server from the command line?  I'd really like to be able to restart my GUI without having to do a full system reboot. Related:    The helpcenter has . It still links to the  for further details. Besides that, the question ban message .  Now that we have the helpcenter, could the following changes be implemented?   Link to the help center instead of the meta post Remove the link to the meta post from the help center, and instead incorporate its contents into the helpcenter itself "No root filesystem is defined" while installing Ubuntu I have just got a new laptop, It is running Windows 7 Home Premium.  I have shrunk the windows partition to give me some empty space and now I want to install ubuntu.  From Windows my partitions look like:   So now in the ubuntu live cd If I hit install and go manual the partitioner looks like   So I thought I could just select the empty space and be away laughing, but when I hit it I get Let $a,b,c&gt; 0$ be three real numbers such that $a+b+c=1$. I want to prove that   $$\frac{a}{a^2+b^3+c^3}+\frac{b}{b^2+a^3+c^3}+\frac{c}{c^2+a^3+b^3}\le\frac{1}{5abc}.$$  My attempt: Using AM-GM on each denominator gives (here, LHS denotes the left-hand side) $$LHS\le\frac{1}{3a^{\frac12}bc}+\frac{1}{3b^{\frac12}ac}+\frac{1}{3c^{\frac12}ab}.$$  However, I think that my attempt doesn't work because the last expression can get larger than $\frac{1}{5abc}$. In fact, if we multiply with $3abc$ then the original inequality is: $$\sqrt a+\sqrt b+\sqrt c\le\frac35$$  However, as $a,b,c&lt;1$, $$\sqrt a +\sqrt b + \sqrt c&gt; a+b+c=1&gt;\frac35.$$ So my upper bound is always larger than the given one. If I leave fully-cooked food (particularly meat) out at warm temperature - say on the counter or in a crock pot that's been turned off -  how long will it stay safe to eat?  Does it make any difference if I re-cook the food afterward? Could a website force the browser to go into fullscreen mode? I was wondering why a laser beam diverges. If all the photons are in the same direction, I would imagine that it would stay that way over a long distance. I am aware that a perfectly collimated beam with no divergence cannot be created due to diffraction, but I am looking for an explanation based on  photons rather than wave physics. Can I get more than 1000 records from a DirectorySearcher? I just noticed that the return list for results is limited to 1000. I have more than 1000 groups in my domain (HUGE domain). How can I get more than 1000 records? Can I start at a later record? Can I cut it up into multiple searches?  Here is my query:  DirectoryEntry dirEnt = new DirectoryEntry("LDAP://dhuba1kwtn004"); string[] loadProps = new string[] { "cn", "samaccountname", "name", "distinguishedname" }; DirectorySearcher srch = new DirectorySearcher(dirEnt, "(objectClass=Group)", loadProps); var results = srch.FindAll();   I have tried to set srch.SizeLimit = 2000;, but that doesn't seem to work. Any ideas? Media keys not working for iTunes (pause/play, skip buttons) Selecting LiDAR return point type in LiDAR dataset with ArcPy? I am trying to create a Digital Earth Model (DEM) using ArcPy under ArcGIS Pro 2, but I am running into some problems.   I can generate a DEM within ArcGIS Pro by selecting only the ground points under LAS files in the LAS dataset properties, but when I try to run the same code within ArcPy, it generates a DEM using all the points.   Any ideas how you select the return point type in ArcPy?   Here is the code that I have used.  arcpy.conversion.LasDatasetToRaster(lasd, "Test_arcpy_dem", "ELEVATION", "BINNING AVERAGE LINEAR", "FLOAT", "CELLSIZE", 10, 1)   As I said, this generates two different outputs, depending if I am in ArcGIS Pro or not. Probability that a sequence repeats itself Given an infinite sequence $a_n$ of uniformly random integers $0$ to $9$, what is the probability there exist an integer $m$ such that the sequence $a_1$ to $a_m$ is equal to that from $a_{m+1}$ to $a_{2m}$?  What if we restrict to two symbols, or $k$ symbols? Why Faddeev-Popov ghost cannot exist in external line? How do I install the latest stable version of LibreOffice? LibreOffice is seeing some dramatic improvements each version and subversion that goes out.   I would like to have always the latest version of LibreOffice on my machine(s). I know of the PPA that exists but is it recommended to use it with 12.04 for daily use? What are the pro and cons of using the PPA? Will it break my system/Libreoffice installation?  Does libreoffice get eventually also upgraded in the Ubuntu repositories or does this upgrade happen only with new releases? Who manages the upgrades of libreoffice in Ubuntu and in the PPA?