Let's close the ultra-small library cycle with some awesome array-based templating. 323 bytes minified.
Just download the minified version here or include it into your code:
http://stackoverflow.com/questions/4073092/errno-9-using-the-multiprocessing-module-with-tornado-in-python | |
p = multiprocessing.Pool(4) | |
class QueryHandler(tornado.web.RequestHandler): | |
... | |
@tornado.web.asynchronous | |
def get(self): | |
... | |
p.apply_async(async_func, [sql_command, arg1, arg2, arg3, ], | |
callback_func) |
# Ruby 1.9.3 | |
ruby-1.9.3-p0 ~/projects/jruby $ ruby -v bench/bench_fiber_ring.rb 5 100 1000 | |
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin10.8.0] | |
bench/bench_fiber_ring.rb:23: warning: mismatched indentations at 'end' with 'def' at 21 | |
100 fibers / 1000 passes: 0.150000 0.000000 0.150000 ( 0.155022) | |
100 fibers / 1000 passes: 0.150000 0.000000 0.150000 ( 0.153985) | |
100 fibers / 1000 passes: 0.150000 0.000000 0.150000 ( 0.153822) | |
100 fibers / 1000 passes: 0.150000 0.000000 0.150000 ( 0.152370) | |
100 fibers / 1000 passes: 0.160000 0.000000 0.160000 ( 0.155857) |
/** | |
The MIT License | |
Copyright (c) 2010 Zohaib Sibt-e-Hassan | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is |
Let's close the ultra-small library cycle with some awesome array-based templating. 323 bytes minified.
Just download the minified version here or include it into your code:
curl -s 'http://realbusinessmen.tumblr.com/api/read?type=photo&num=50' | ruby -r'rexml/document' -e 'puts REXML::Document.new(STDIN).elements["tumblr/posts"].to_a.shuffle.pop.map(&:text)' |
#!/bin/bash | |
# file descriptor | |
# Change 400000 to increase or decrease number of file descriptor | |
echo "* soft nofile 400000" >> /etc/security/limits.conf | |
echo "* hard nofile 400000" >> /etc/security/limits.conf | |
# Changing kernal parameters (modify value if required) |
# coding=UTF-8 | |
from __future__ import division | |
import re | |
# This is a naive text summarization algorithm | |
# Created by Shlomi Babluki | |
# April, 2013 | |
class SummaryTool(object): |
package main | |
import ( | |
"crypto/aes" | |
"crypto/cipher" | |
"crypto/rand" | |
"encoding/base64" | |
"fmt" | |
"io" | |
) |
var parser = document.createElement('a'); | |
parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
parser.protocol; // => "http:" | |
parser.hostname; // => "example.com" | |
parser.port; // => "3000" | |
parser.pathname; // => "/pathname/" | |
parser.search; // => "?search=test" | |
parser.hash; // => "#hash" | |
parser.host; // => "example.com:3000" |
Hi. My name is Sadayuki "Sada" Furuhashi. I am the author of the MessagePack serialization format as well as its implementation in C/C++/Ruby.
Recently, MessagePack made it to the front page of Hacker News with this blog entry by Olaf, the creator of the Facebook game ZeroPilot. In the comment thread, there were several criticisms for the blog post as well as MessagePack itself, and I thought this was a good opportunity for me to address the questions and share my thoughts.
To the best of my understanding, roughly speaking, the criticisms fell into the following two categories.