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
""" | |
FIND MOST COMMON ELEMENT IN LIST | |
- what is "most common" | |
- restrictions | |
- list properties | |
- tests? | |
""" | |
def solution(items): |
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 __future__ import print_function | |
from functools import wraps | |
class Fish(object): | |
def __new__(cls, *args, **kwargs): | |
o = super(Fish, cls).__new__(cls, *args, **kwargs) | |
o.foo_cache = {} | |
o.type = 'goldfish' |
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
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
<meta http-equiv="Content-Style-Type" content="text/css"> | |
<title></title> | |
<meta name="Generator" content="Cocoa HTML Writer"> | |
<meta name="CocoaVersion" content="1265.2"> | |
<style type="text/css"> | |
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 22.0px; font: 12.0px 'Lucida Grande'} |
- getlittlebird.com Influencer Discovery & Engagement
- wefollow.com Discover prominent people
- twitaholic.com Tracking Most Popular Users
- peerindex.com Audience Insight Marketing tool
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
library(Hmisc) # summarize | |
dx = summarize(mtcars$hp, llist(mtcars$cyl, mtcars$gear), sum) | |
dx = summarize(mtcars$hp, llist(mtcars$cyl, mtcars$gear), mean) | |
names(dx) = c("cyl", "gear", "hp") | |
dx.t = xtabs(hp ~ cyl + gear, dx) | |
barplot(dx.t, | |
beside=T, | |
col=rainbow(3), |
MacPorts Upgrade Procedure - more
- Save the list of installed ports:
port -qv installed > myports.txt
- Uninstall all installed ports:
sudo port -f uninstall installed
- Clean any partially-completed builds:
sudo port clean all
- Get fresh MacPorts-X.Y.Z
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
""" | |
Permutations by Lehmer codes (http://en.wikipedia.org/wiki/Lehmer_code) | |
Inspired by http://stackoverflow.com/a/3241894/212278 | |
Given input sequence | |
>>> seq = ["A", "B", "C", "D"] | |
>>> lehmer_code = [2, 1, 0, 0] | |
>>> int_from_code(lehmer_code) | |
6 | |
>>> list(lehmer.iter_perm(['A', 'B', 'C'])) |
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
# http://algorithmicallyrandom.blogspot.it/2009/09/tab-completion-in-python-shell-how-to.html | |
import rlcompleter | |
import readline | |
readline.parse_and_bind("tab: complete") |