snipt

Ctrl+h for KB shortcuts

PHP

Long Random Number Generator

1
2
3
4
5
6
7
<?php

for($i=1; $i < 1000; $i++){
        echo rand(1, 2147483647);
}

?>
https://snipt.net/embed/713ccd72e4a0d9aed1724756d6696ad9/
https://snipt.net/raw/713ccd72e4a0d9aed1724756d6696ad9/
713ccd72e4a0d9aed1724756d6696ad9
php
PHP
8
2016-09-26T03:16:48
True
False
False
Aug 26, 2012 at 06:41 AM
/api/public/snipt/46309/
long-random-number-genorator
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a> <a href="#L-6">6</a> <a href="#L-7">7</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="cp">&lt;?php</span> </span><span id="L-2"><a name="L-2"></a> </span><span id="L-3"><a name="L-3"></a><span class="k">for</span><span class="p">(</span><span class="nv">$i</span><span class="o">=</span><span class="mi">1</span><span class="p">;</span> <span class="nv">$i</span> <span class="o">&lt;</span> <span class="mi">1000</span><span class="p">;</span> <span class="nv">$i</span><span class="o">++</span><span class="p">){</span> </span><span id="L-4"><a name="L-4"></a> <span class="k">echo</span> <span class="nb">rand</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2147483647</span><span class="p">);</span> </span><span id="L-5"><a name="L-5"></a><span class="p">}</span> </span><span id="L-6"><a name="L-6"></a> </span><span id="L-7"><a name="L-7"></a><span class="cp">?&gt;</span><span class="x"></span> </span></pre></div> </td></tr></table>
generator, number, random

Ruby

foundation generator

rails g foundation:install
https://snipt.net/embed/60fc96068ebfe0ef56e0cb43ba360c30/
https://snipt.net/raw/60fc96068ebfe0ef56e0cb43ba360c30/
60fc96068ebfe0ef56e0cb43ba360c30
rb
Ruby
1
2016-09-22T18:02:59
True
False
False
/api/public/snipt/31087/
foundation-generator
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="n">rails</span> <span class="n">g</span> <span class="ss">foundation</span><span class="p">:</span><span class="n">install</span> </span></pre></div> </td></tr></table>
generator, zurb-foundation

Python

Short generator example.

g = (x**2 for x in range(10))
print g.next()
https://snipt.net/embed/009b8073d5dca4ad358b31d9346b8768/
https://snipt.net/raw/009b8073d5dca4ad358b31d9346b8768/
009b8073d5dca4ad358b31d9346b8768
python
Python
3
2016-09-24T07:22:27
True
False
False
/api/public/snipt/20976/
short-generator-example
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="n">g</span> <span class="o">=</span> <span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span> <span class="k">for</span> <span class="n">x</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">10</span><span class="p">))</span> </span><span id="L-2"><a name="L-2"></a><span class="k">print</span> <span class="n">g</span><span class="o">.</span><span class="n">next</span><span class="p">()</span> </span></pre></div> </td></tr></table>
generator, python
Copyrighted, illegal, or inappropriate content? Email support@snipt.net.