Skip to content

Instantly share code, notes, and snippets.

View giulioungaretti's full-sized avatar
💭
😘

Giulio Ungaretti giulioungaretti

💭
😘
View GitHub Profile
@giulioungaretti
giulioungaretti / select
Last active August 29, 2015 14:20
what happens
func foo(done chan struct{}, c chan io.AFile){
select {
case <-done: # this works (i.e. done is open)
return
case c <- io.AFile{path, err}: # this works (i.e. c is open)
}
}

Keybase proof

I hereby claim:

  • I am giulioungaretti on github.
  • I am giulioungaretti (https://keybase.io/giulioungaretti) on keybase.
  • I have a public key whose fingerprint is 6E49 3782 CCE5 62C7 07D7 B4ED CB98 04D2 A221 5778

To claim this, I am signing this object:

SELECT map, count(points.counts)
FROM map LEFT JOIN points
ON st_contains(map.geom,points.geom)
['abruzzo', 'afgrænset', 'alata', 'alba', 'albaruta', 'alberone', 'albina', 'allodola', 'amapasso', 'amare', 'amaro', 'amarone', 'amaronevin', 'amaronevinens', 'amleto', 'amododa', 'amornero', 'anbefales', 'angiolina', 'anita', 'annaberta', 'annerberta', 'antiche', 'antico', 'anvendt', 'aov', 'ap', 'apanillo', 'apasio', 'apassimento', 'appasimento', 'appassimento', 'appassito', 'apéritif', 'araldica', 'arietta', 'arneis', 'artes', 'ascaro', 'asker', 'asti', 'atesio', 'aukan', 'avenida', 'avola', 'bacaro', 'bacca', 'baccolo', 'badia', 'baglio', 'baira', 'banfi', 'barbera', 'barbero', 'bardolino', 'barocco', 'barolo', 'barone', 'bastione', 'beauroy', 'beghino', 'bellamico', 'belliccia', 'bersano', 'betegnelsen', 'bianco', 'biferno', 'binazzo', 'bisano', 'blasone', 'blommer', 'blomsteragtig', 'bni', 'bolgheri', 'bordon', 'bosan', 'boscari', 'bosco', 'bossi', 'boyero', 'bricco', 'briccotondo', 'brindisi', 'brolio', 'brunda', 'brunelli', 'brunello', 'brusa', 'bærsmag', 'cabaletta', 'cacciatora', 'cadenas', 'cadent
class Resource(object):
def __init__(self, model):
self.model = model
self.model.load()
### modules/xxx.py
class model(object):
./configure --with-features=huge --enable-pythoninterp --with-python-config-dir=~/anaconda/bin/python-config
filter_group.get_group("69c58d56500e4fea9a04f0a0c5406a3c")
303 function calls (294 primitive calls) in 11.833 seconds
Ordered by: internal time
ncalls tottime percall cumtime percall filename:lineno(function)
1 11.725 11.725 11.728 11.728 {pandas.algos.groupby_indices}
4 0.092 0.023 0.092 0.023 {built-in method array}
1 0.010 0.010 0.102 0.102 index.py:1139(take)
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Jun 18 2015 10:36:44)
MacOS X (unix) version
Included patches: 1-712
Compiled by Homebrew
Huge version without GUI. Features included (+) or not (-):
+acl +farsi +mouse_netterm +syntax
+arabic +file_in_path +mouse_sgr +tag_binary
+autocmd +find_in_path -mouse_sysmouse +tag_old_static
-balloon_eval +float +mouse_urxvt -tag_any_white
-browse +folding +mouse_xterm -tcl

For ETS's SKLL project, we found out the hard way that Travis-CI's support for numpy and scipy is pretty abysmal. There are pre-installed versions of numpy for some versions of Python, but those are seriously out of date, and scipy is not there are at all. The two most popular approaches for working around this are to (1) build everything from scratch, or (2) use apt-get to install more recent (but still out of date) versions of numpy and scipy. Both of these approaches lead to longer build times, and with the second approach, you still don't have the most recent versions of anything. To circumvent these issues, we've switched to using Miniconda (Anaconda's lightweight cousin) to install everything.

A template for installing a simple Python package that relies on numpy and scipy using Miniconda is provided below. Since it's a common s

#! /bin/sh
#
# updateGOPATH.sh
# Copyright (C) 2015 giulio <giulioungaretti@me.com>
#
# Distributed under terms of the MIT license.
#
# this exports GB_PROJECT_DIR
GB_PROJECT_DIR=$(gb env)