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(gtranslate). | |
-author("Gabriele <carretta63@gmail.com"). | |
-version("0.0.1"). | |
-define(API_URL, "http://ajax.googleapis.com/ajax/services/language/translate"). | |
-export([translate/3, lang_pair/2, request_url/2, check_result/1]). | |
-import(mochijson2). | |
lang_pair(Lo, Ld) -> |
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(gtranslate). | |
-author("Gabriele <carretta63@gmail.com"). | |
-version("0.0.1"). | |
-define(API_URL, "http://ajax.googleapis.com/ajax/services/language/translate"). | |
-export([translate/3, lang_pair/2, request_url/2, check_result/1]). | |
-import(mochijson2). | |
lang_pair(Lo, Ld) -> |
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 urllib2 | |
save_folder = '' | |
stream_url = '' | |
def parse_metaint(): | |
line = resp.readline() | |
while line: | |
line = resp.readline() | |
if 'icy-metaint' in line: |
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
Day job: | |
Favorite Python project: | |
Favorite Conference: | |
Python Experience Level: |
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
object Apple1 extends App { | |
val vowels = Array('a', 'e', 'i', 'o', 'u') | |
println("Type a phrase") | |
val phrase = Console.readLine().toLowerCase | |
val vowel = phrase.find(vowels.contains(_)).getOrElse() | |
val newP = phrase.map(x => if (vowels.contains(x)) vowel else x).mkString | |
println(newP) | |
} |
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
~/$ lein new ring-on-heroku | |
Created new project in: /home/jim/Development/ring-on-heroku | |
~/$ cd ring-on-heroku | |
~/ring-on-heroku$ echo 'web: lein run -m ring-on-heroku.core' > Procfile | |
~/ring-on-heroku$ cat > src/ring_on_heroku/core.clj | |
(ns ring-on-heroku.core | |
(:use ring.util.response | |
ring.adapter.jetty)) | |
(defn app [req] |
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
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ant sim ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
; Copyright (c) Rich Hickey. All rights reserved. | |
; The use and distribution terms for this software are covered by the | |
; Common Public License 1.0 (http://opensource.org/licenses/cpl.php) | |
; which can be found in the file CPL.TXT at the root of this distribution. | |
; By using this software in any fashion, you are agreeing to be bound by | |
; the terms of this license. | |
; You must not remove this notice, or any other, from this software. | |
;As shown in the presentation: http://blip.tv/clojure/clojure-concurrency-819147 |
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
(ns clj-pfetch.core | |
(:use [clojure.java.shell :only (sh)]) | |
(:require [clojure.xml :as xml])) | |
;;; Records | |
(defrecord Url [start href output freq args]) | |
;;; Agents |
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
(ns clj-pfetch.core | |
(:use [clojure.java.shell :only (sh)] | |
[clojure.java.io :only (as-url input-stream)] | |
[clojure.string :only (blank?)]) | |
(:require [clojure.xml :as xml])) | |
;;; Records | |
(defrecord Url [start href output freq args]) |
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 <stdio.h> | |
/* | |
f(0) = 0 | |
f(1) = 1 | |
f(2) = 2 | |
f(3) = f(2) + 2f(1) + 3f(0) | |
\ \ \ | |
f(4) = f(3) + 2f(2) + 3f(1) | |
\ \ \ |
OlderNewer