A running example of the code from:
- http://marcio.io/2015/07/handling-1-million-requests-per-minute-with-golang
- http://nesv.github.io/golang/2014/02/25/worker-queues-in-go.html
Small refactorings made to original code:
"************************************************************************** | |
* Allowable characters: * | |
* - a-z * | |
* - A-Z * | |
* - 0-9 * | |
* - .+/\*~<>@%|&? * | |
* - blank, tab, cr, ff, lf * | |
* * | |
* Variables: * | |
* - variables must be declared before use * |
package main | |
import ( | |
"fmt" | |
"github.com/gorilla/mux" | |
"github.com/gorilla/securecookie" | |
"net/http" | |
) | |
// cookie handling |
def take_while(fn, coll): | |
"""Yield values from coll until fn is False""" | |
for e in coll: | |
if fn(e): | |
yield e | |
else: | |
return | |
def partition(n, coll, step=None): | |
return take_while(lambda e: len(e) == n, |
A running example of the code from:
Small refactorings made to original code:
If you are seeing Mongo soft rlimits warnings in your logs, or a WARNING: soft rlimits too low. Number of files is 256, should be at least 1000
when you login to mongo shell via mongo
from the commandline, or any mysterious/unexplained mongo connection errors... follow this how-to exactly and it will resolve the issue for you.
(Source of this how to found at basho/basho_docs#1402)
First file:
sudo vi /Library/LaunchDaemons/limit.maxfiles.plist
...containing:
from zipline.algorithm import TradingAlgorithm | |
from zipline.transforms import MovingAverage | |
from zipline.utils.factory import load_from_yahoo | |
from zipline.finance.slippage import FixedSlippage | |
from zipline.finance.commission import PerShare | |
from datetime import datetime | |
import matplotlib.pyplot as plt | |
class DualMovingAverage(TradingAlgorithm): |
This is my recommended path for learning Haskell.
http://www.seas.upenn.edu/~cis194/lectures.html Brent Yorgey's course is the best I've found so far and replaces both Yann Esposito's HF&H and the NICTA course. This course is particularly valuable as it will not only equip you to write Haskell but also help you understand parser combinators.
/** | |
* gc monitoring only on jdk7 or later | |
* | |
* @author lichengwu | |
* @version 1.0 | |
* @created 2013-09-14 10:44 PM | |
*/ | |
public class GCMonitoring { |
I like Learn You a Haskell as a reference and cheat-sheet but I found it a little slow for learning Haskell.
Here's my recommended order for just learning Haskell:
http://www.seas.upenn.edu/~cis194/lectures.html Brent Yorgey's course is the best I've found so far and replaces both Yann Esposito's HF&H and the NICTA course. This course is particularly valuable as it will not only equip you to write Haskell but also help you understand parser combinators.
Real World Haskell is available online. (Thanks bos!)
I recommend RWH as a reference (thick book). The chapters for parsing and monads are great for getting a sense for where monads are useful. Other people have said that they've liked it a lot. Perhaps a good follow-up for practical idioms after you've got the essentials of Haskell down?