Python is an interpreted, dynamically typed, object-oriented programming language. It is open-source, and was originally released in 1991 by Guido van Rossum.
Here's a sample Python method to get started with syntax:
require "stateful" | |
class Folder < ActiveRecord::Base | |
include Stateful | |
# ... | |
stateful do | |
state :active | |
state :inactive |
(ns roulette.core) | |
(defn spin [] | |
(int (rand 38))) | |
(def *bankroll* (atom 1000)) | |
(defn dobet | |
[bets] | |
(let [winner (spin)] |
EMACS = [ | |
1, | |
2, | |
3, | |
] | |
EVERYONE_ELSE = [ | |
1, | |
2, | |
3, |
#!/bin/sh | |
BRANCHES=`git branch` | |
if [ $? != 0 ]; then | |
exit | |
fi | |
GIT_SVN=0 | |
git branch -r | grep 'git-svn' > /dev/null | |
if [ $? = 0 ]; then | |
GIT_SVN=1 |
from redis import Redis | |
r = Redis() | |
r.publish("greeting", "Neil") |
Ruby is a dynamic, truly object-oriented language (everything is an object) that is also influenced in many ways from concepts found in functional programming. It open source, and was first released in 1995 by Yukihiro “matz” Matsumoto. The most current version is 1.9.1.
Here's a sample Ruby method to get started with syntax:
#!/bin/bash | |
sudo su - | |
# | |
# Audio: fix ubuntu 9.04 broken sound | |
# | |
apt-get install build-essential xmlto libncurses5-dev | |
export ALSA="1.0.20" |
;; pass in a vector, get a querystring | |
(defn build-querystring [params] | |
(let [qpairs (map #(str-join "=" (str %)) params)] | |
(apply str (interpose "&" qpairs)))) |
(defn blah1 [& params] (apply hash-map params)) | |
(defn blah2 [& params] (blah1 params)) | |
;; user> (blah1) | |
;; {} | |
;; user> (blah2) | |
;; No value supplied for key: null | |
;; [Thrown class java.lang.IllegalArgumentException] |