Skip to content

Instantly share code, notes, and snippets.

View Tarrasch's full-sized avatar
💭
I may be slow to respond.

Arash Rouhani Tarrasch

💭
I may be slow to respond.
View GitHub Profile
@Tarrasch
Tarrasch / gist:824155
Created February 12, 2011 21:40
Kategorisering av kurser jag läst på Chalmers
  • Språkvetenskap
    • OOP
    • concurrent programming
    • paradigms
    • IFP
    • AFP
    • Programspråk
  • Allmänbildning för dataingenjörer och software engineering
    • Datakommunikation
  • Allmänbildning
@Tarrasch
Tarrasch / gist:835936
Created February 20, 2011 12:26
Why does it say its final?
public abstract class Mixologist extends Person {
protected static Integer numServings = 0;
protected static synchronized void addServing()
{
numServings++;
}
...
@Tarrasch
Tarrasch / gist:840588
Created February 23, 2011 15:52
Compile-run jr programs
# comile-runna jr-program
function ja(){
clear
echo "Compiling $*"
jrc *.jr 2>&1 | grep -v "^Note: "
jr $* 2>&1 | grep -v "^Note: "
}
function ja_(){
@Tarrasch
Tarrasch / gist:862239
Created March 9, 2011 14:08
Helpful commands in concurrent programming
# Starta train
alias setc='setup_course tda381'
alias runt='cd ~/ConcLabbar/Lab1/Trainspotting/Trainspotting/build/classes/ && 2 "tsim bana" "java Lab1 30 20"'
function runt2() {
cd ~/ConcLabbar/Lab1/Trainspotting/Trainspotting/build/classes/ && 2 "tsim -s $1 bana" "java Lab1 10 5"
}
@Tarrasch
Tarrasch / gist:881778
Created March 22, 2011 18:39
`This Land` on harmonica
+4 -4 +5 -5 -5 -5 +4 -4 +5 +5
+3 +4 +5 -4 -4 -4 -4 +4 -4 +5 +5
+4 +4 -4 +5 -5 -5 -5 -5 +4 -4 +5 +5
-4 -4 -4 -3 +3 -3 -4 +4
textulated from http://www.harmonicaclub.com/tabs/tll/this_land_is_your_land.htm
@Tarrasch
Tarrasch / gist:918078
Created April 13, 2011 18:31
Flintstones on harmonica
source: http://www.harmonicaclub.com/tabs/The_Flintstones_Theme.htm
A harmonica 1st position
6b 4b
7b 6d 6b 4b
6b 5d 5b 5b 5d 6b 4b 4d 5b
@Tarrasch
Tarrasch / Mailman.hs
Created August 23, 2011 12:13
Module for checking users in mailman list group
module Mailman where
import System.Process (readProcessWithExitCode)
import System.Exit (ExitCode(..))
import Data.List
type MailingList = String
-- Before using this module:
-- Make sure you have `list_members` command available, and that you don't
@Tarrasch
Tarrasch / ListMonad.hs
Created August 31, 2011 06:50
Standard undeterministic list monad with quickcheck properties for the 3 monad laws
{-# LANGUAGE FlexibleInstances #-}
import Test.QuickCheck
newtype List a = List { unList :: [a] }
deriving (Show, Read, Eq, Ord)
data ListBind a = ListBind (a -> List a) String
instance Show (ListBind a) where
show (ListBind _ name) = name
@Tarrasch
Tarrasch / GoogleCalender.hs
Created August 31, 2011 07:35
Extracting feed of a Google Calender for upcoming events
module Test where
import Data.Time.RFC3339
import Data.Time.LocalTime
import Data.Time.Calendar (addDays)
import Network.URL
main = do
putStrLn $ exportURL paramUrl
startTime <- getZonedTime >>= return . showRFC3339
{-# LANGUAGE ViewPatterns #-}
module Test where
import qualified Codec.Binary.UTF8.String as UTF8
import Data.Time.RFC3339
import Data.Time.LocalTime
import Data.Time.Calendar (addDays)
import Network.URL
import Network.HTTP
import Text.HTML.TagSoup