This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Web development technologies change quickly in the recent decade. This visualisation displays the popularity change of 4 web frameworks. I scraped the data from Google Trends website. And here I choose the original colour of each web framework logo as the colours of time series. | |
When we look at this chart, we would easily find all web frameworks are becoming more popular than the past, except Ruby on Rails. Before 2005, Java was the mainstream way to build websites. When Web 2.0 SNS time came, people demanded an easy full-stack way to build the websites quickly. Ruby on Rails became popular due to its Convention over Configuration principle and the dynamic of Ruby programming language. Between 2007 and 2010, people find the shortcoming of Ruby on Rails is hard to maintain when the business and websites grow, and also the poor performance. After 2011, the market demanded more complicated frontend technology to provide more complex user experience, NodeJS came to solve this problem, and NodeJS also improved |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*-coding:utf-8-*- | |
from etl_utils import process_notifier | |
from collections import Counter, defaultdict | |
import ujson | |
null = None | |
def char_count(func): | |
result = defaultdict(int) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Dependencies: | |
pip install tabulate simplejson python-cjson ujson yajl msgpack-python | |
""" | |
from timeit import timeit | |
from tabulate import tabulate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*-coding:utf-8-*- | |
'''cjson, jsonlib, simplejson, and yajl also use C code | |
demjson did not use C code, but was too painfully slow to benchmark | |
(took about 20 seconds for these tests) | |
''' | |
import json | |
import sys | |
import time |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
Overwrite base class's methods. | |
""" | |
import unittest | |
class Base(object): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
`hg log --template 'date: {date|isodate}\n' | grep 'date: '`.split("\n").map {|i1| i1[6..15] }.inject({}) {|d1, i1| d1[i1] ||= 0; d1[i1] += 1; d1 }.sort {|a, b| a[0] <=> b[0] }.each {|i| puts i.inspect };0 | |
__END__ | |
["2014-09-24", 4] | |
["2014-09-25", 8] | |
["2014-09-26", 6] | |
["2014-09-28", 10] | |
["2014-09-29", 14] | |
["2014-09-30", 3] | |
["2014-10-08", 14] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Lazy reference between tasks, include recursive references. | |
# 1. `eval` version | |
def ref_tasks(*tasks): | |
def wrap(task1): | |
def _ref_task(self): | |
return eval(task1) | |
return _ref_task |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_.each(Array(10), -> Array(Math.pow(10, 8)).join("=").length) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from singleton import singleton | |
@singleton(True) | |
class hh(object): | |
cc = 0 | |
def __init__(self): | |
hh.cc += 1 | |
self.count = hh.cc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*gz | |
*.txt |
NewerOlder