Skip to content

Instantly share code, notes, and snippets.

View alecbz's full-sized avatar

Alec Benzer alecbz

View GitHub Profile
#include <unistd.h>
#include <stdio.h>
int main() {
int i;
pid_t pid = fork();
if (pid == 0) {
printf("I am the child. I'm going to print 'Hello, World!' 15 times\n");
for (i = 0; i < 15; ++i) {
printf("Hello, World!\n");
buckets = defaultdict(list)
for z, root in root_from.iteritems():
closest = next((k for k in buckets if abs(k - root) < 1e-3), None)
if closest:
buckets[closest].append(z)
else:
buckets[root].append(z)
roots = buckets.keys()
<pre class="prettyprint">
<code class="language=c++ hljs cs">
int x = <em>new</em> int(5);
</code>
</pre>
```c++
int x = new int(5);
```
@alecbz
alecbz / .md
Last active August 29, 2015 14:26
int x = new int(5);
int x = new int(5);
<some-long-tag-name>
information
</some-long-tag-name>
merge :: (Ord a) => [a] -> [a] -> [a]
merge [] y = y
merge x [] = x
merge xxs@(x:xs) yys@(y:ys)
| x < y = x : merge xs yys
| otherwise = y : merge xxs ys
merge :: (Ord a) => [a] -> [a] -> [a]
merge [] y = y
merge x [] = x
merge xxs@(x:xs) yys@(y:ys)
| x < y = x : merge xs yys
| otherwise = y : merge xxs ys
$ gem
<internal:lib/rubygems/custom_require>:29:in `require': no such file to load -- rubygems/gem_path_searcher (LoadError)
from <internal:lib/rubygems/custom_require>:29:in `require'
from /home/alec/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/rubygems.rb:1087:in `<top (required)>'
from <internal:lib/rubygems/custom_require>:29:in `require'
from <internal:lib/rubygems/custom_require>:29:in `require'
from /home/alec/.rvm/rubies/ruby-1.9.2-p0/bin/gem:13:in `<main>'
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <plot.h>
const double PI = 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117067982148086513282;
const double F = 2;
double arr[16];
redis.zrevrangebyscore(@id_info_key, a, b, {:limit => [0,1]})