start new:
tmux
start new with session name:
tmux new -s myname
class GlobalFormat(object): | |
def __init__(self): | |
self.id = 0x46464952 # RIFF | |
self.size = 0 | |
self.type = 0x45564157 # WAVE | |
def as_bin(self): | |
return struct.pack("III", self.id, self.size, self.type) | |
# (?=) Positive look ahead assertion foo(?=bar) matches foo when followed by bar. | |
"Best player ever is Leo Messi.".match(/Leo(?=\s?Messi)\s\w+/) | |
=> ["Leo Messi"] | |
# (?!) Negative look ahead assertion foo(?!bar) matches foo when not followed by bar. | |
> "Or maybe Javier Mascherano? Or Javier Zanetti?.".scan(/Javier(?!\s?Mascherano)\s\w+/) | |
=> ["Javier Zanetti"] | |
# (?<=) Positive look behind assertion (?<=foo)bar matches bar when preceded by foo. | |
"Some say it is Sergio Aguero, but Sergio Batista does not let him play much".scan(/\w+\s(?<=Sergio\s)\w+/) |
// This is the Android version of the Tweetie-like pull to refresh table: | |
// http://developer.appcelerator.com/blog/2010/05/how-to-create-a-tweetie-like-pull-to-refresh-table.html | |
var win = Ti.UI.currentWindow; | |
var alertDialog = Titanium.UI.createAlertDialog({ | |
title: 'System Message', | |
buttonNames: ['OK'] | |
}); | |
var scrollView = Ti.UI.createScrollView({ |
@SuppressWarnings("unused") | |
public static String wmConcat(String in, Boolean flag, | |
String[] register, Integer[] counter) { | |
if (flag) { | |
if (register[0] == null) { | |
return null; | |
} | |
return register[0]; | |
} | |
if (in == null) { |