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
# vim: set ft=zsh: | |
# Settings | |
MAX_LOOKUP_LEVEL=3 | |
# If a virtualenv is not found in current and parent directories in up to MAX_LOOKUP_LEVEL levels, | |
# then use $HOME's virtualenv as default. | |
ALWAYS_DEFAULT_TO_HOME_VIRTUALENV=1 | |
function chpwd() { | |
detect_virtualenv | |
detect_hsenv |
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
module Actor where | |
import System.IO | |
import Control.Concurrent.STM.TChan | |
import Control.Concurrent | |
import Control.Monad.STM | |
import Control.Monad | |
type Mailbox a = TChan a | |
data Behaviour a = Behaviour { |
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
module Actor where | |
import System.IO | |
import Control.Concurrent.STM.TChan | |
import Control.Concurrent | |
import Control.Monad.STM | |
import Control.Monad | |
type Mailbox a = TChan a | |
data Behaviour a = Behaviour { |
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
import Control.Concurrent.STM.TChan | |
import Control.Concurrent | |
import Control.Monad.STM | |
import Control.Monad | |
type Mailbox a = TChan a | |
data Behaviour a = Behaviour { | |
runBehaviour :: Actor a -> a -> IO (Maybe (Behaviour a)) | |
} | |
data Actor a = Actor { mbox :: Mailbox a, beh :: Behaviour a } |
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
#!/usr/bin/env python | |
# This script takes two parameters, the first is the filename needs to be matched, | |
# the second is the file contains glob patterns.One pattern per line. | |
import fnmatch | |
import sys | |
def check_match(f, fn): | |
with open(f) as fpattern: |
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
#!/bin/sh | |
SALT=`git config --get encrypt.salt` | |
PASS=`git config --get encrypt.pass` | |
PATTERN_FILE=`git config --get encrypt.patternFile` | |
NAME_MATCHED=0 | |
getSaltPass(){ | |
if [ -z "$SALT" -o -z "$PASS" ];then | |
SALT=`getpwd git_crypt_salt` |
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
#include <iostream> | |
#include <functional> | |
template <typename Lambda, typename Curried> | |
Curried Ycombinator(Lambda f) { | |
return std::bind(f, std::bind(&Ycombinator<Lambda, Curried>,f) , std::placeholders::_1); | |
} | |
int main() { | |
typedef std::function<int(int)> L; |
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
#include <iostream> | |
#include <thread> | |
#include <condition_variable> | |
#include <mutex> | |
#include <chrono> | |
#include <random> | |
using namespace std; | |
const int BUFSIZE = 10; |
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
Hi, | |
Sorry for being so late to give the final report. I've pushed all code | |
to my cloned repo on git.kde.org last week. | |
Here's the instructions to compile Spotify collection and the resolver. | |
1) To compile Amarok with Spotify collection: | |
$ git clone git://anongit.kde.org:clones/amarok/zhengliangfeng/amarok-spotify.git | |
$ cd amarok-spotify && git checkout gsoc-spotify | |
$ cd ../ && mkdir amarok-spotify-build |
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
/**************************************************************************************** | |
* Copyright (c) 2010 Andrew Coder <andrew.coder@gmail.com> * | |
* * | |
* This program is free software; you can redistribute it and/or modify it under * | |
* the terms of the GNU General Public License as published by the Free Software * | |
* Foundation; either version 2 of the License, or (at your option) any later * | |
* version. * | |
* * | |
* This program is distributed in the hope that it will be useful, but WITHOUT ANY * | |
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A * |