As configured in my dotfiles.
start new:
tmux
start new with session name:
from hashlib import md5 | |
from sqlite3 import connect as sql_conn | |
from time import localtime, strftime | |
class IllegalException(Exception): | |
def __init__(self, *args): | |
super().__init__(*args) | |
public class SettingsAdapter extends WearableListView.Adapter { | |
private final Context context; | |
private final List<SettingsItems> items; | |
public SettingsAdapter(Context context, List<SettingsItems> items) { | |
this.context = context; | |
this.items = items; | |
} |
import android.content.Context; | |
import android.graphics.Rect; | |
import android.util.AttributeSet; | |
import android.util.Log; | |
import android.view.View; | |
import android.widget.AutoCompleteTextView; | |
public class InstantAutoComplete extends AutoCompleteTextView { | |
public InstantAutoComplete(Context context) { | |
super(context); |
object HexBytesUtil { | |
def hex2bytes(hex: String): Array[Byte] = { | |
hex.replaceAll("[^0-9A-Fa-f]", "").sliding(2, 2).toArray.map(Integer.parseInt(_, 16).toByte) | |
} | |
def bytes2hex(bytes: Array[Byte], sep: Option[String] = None): String = { | |
sep match { | |
case None => bytes.map("%02x".format(_)).mkString | |
case _ => bytes.map("%02x".format(_)).mkString(sep.get) |
import itertools as it | |
def sortandgroupby(data, **kwargs): | |
return dict(map(lambda(k,v):(k,list(v)),it.groupby(sorted(data,kwargs),kwargs))) | |
print sortandgroupby(range(30),lambda x:mod(x,3)) | |
As configured in my dotfiles.
start new:
tmux
start new with session name: