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 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 |
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 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 |
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
print "hello" |
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
$ python2.6 -c 'import datetime; print datetime.datetime.now().strftime("%f")' | |
072062 | |
$ python2.5 -c 'import datetime; print datetime.datetime.now().strftime("%f")' | |
%f |
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
def works_fine(value=""): | |
def closure(): | |
if not value: | |
return "somethig" | |
return value | |
return closure | |
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
def works_fine(value=""): | |
def closure(): | |
if not value: | |
return "something" | |
return value | |
return closure | |
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
def foo(value): | |
def closure(): | |
print value | |
# Works without this | |
value = "Override" | |
return value |
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
def foo(value): | |
def closure(): | |
value = "Override" | |
print value | |
return value |
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
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. |
OlderNewer