Skip to content

Instantly share code, notes, and snippets.

View esamattis's full-sized avatar

Esa-Matti Suuronen esamattis

View GitHub Profile
import java.io.OutputStream;
import java.io.PrintStream;
import java.util.Iterator;
import java.util.NoSuchElementException;
import fi.jyu.mit.ohj2.*;
/**
* Esimerkki linkitetystä listasta.
* @author Vesa Lappalainen
import java.io.OutputStream;
import java.io.PrintStream;
import java.util.Iterator;
import java.util.NoSuchElementException;
import fi.jyu.mit.ohj2.*;
/**
* Esimerkki linkitetystä listasta.
* @author Vesa Lappalainen
@esamattis
esamattis / hello.py
Created March 18, 2010 22:38
just testing
print "hello"
$ python2.6 -c 'import datetime; print datetime.datetime.now().strftime("%f")'
072062
$ python2.5 -c 'import datetime; print datetime.datetime.now().strftime("%f")'
%f
def works_fine(value=""):
def closure():
if not value:
return "somethig"
return value
return closure
def works_fine(value=""):
def closure():
if not value:
return "something"
return value
return closure
def foo(value):
def closure():
print value
# Works without this
value = "Override"
return value
def foo(value):
def closure():
value = "Override"
print value
return value
def expose_as(cmd_name="", *alternatives):
"""Decorator for exposing functions as subssh commands"""
def expose_function(f):
def check_args_wrapper(*function_args):
"""
Check that input f gets called with right amount of
arguments. Makes it raise InvalidArguments instead of TypeError when
it is supplied invalid amount of arguments.
We couldn’t find that file to show.