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
boolean hasUpdated = false; | |
boolean doneBuffering = false; | |
long bufferTimeout = 500; | |
// put this somewhere smart | |
new Thread(new Runnable() { | |
public void run() { | |
while(!doneBuffering) { | |
Thread.sleep(bufferTimeout); |
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
Process: TinyGrab [7577] | |
Path: /Applications/TinyGrab.app/Contents/MacOS/TinyGrab | |
Identifier: com.keyone.TinyGrab | |
Version: 2.04 (2.04) | |
Code Type: X86-64 (Native) | |
Parent Process: launchd [106] | |
Date/Time: 2011-07-20 11:08:35.537 -0400 | |
OS Version: Mac OS X 10.6.8 (10K540) | |
Report Version: 6 |
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
Process: TinyGrab [7625] | |
Path: /Applications/TinyGrab.app/Contents/MacOS/TinyGrab | |
Identifier: com.keyone.TinyGrab | |
Version: 2.04 (2.04) | |
Code Type: X86-64 (Native) | |
Parent Process: launchd [106] | |
Date/Time: 2011-07-20 11:16:44.242 -0400 | |
OS Version: Mac OS X 10.6.8 (10K540) | |
Report Version: 6 |
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
ruby-1.9.2-p290 :001 > array = [:peanut, :butter, :and, :jelly] | |
=> [:peanut, :butter, :and, :jelly] | |
ruby-1.9.2-p290 :002 > array[4] # makes sense -- 4 is out of range | |
=> nil | |
ruby-1.9.2-p290 :003 > array[5,0] # makes sense -- 5 is out of range | |
=> nil | |
ruby-1.9.2-p290 :004 > array[4,0] # doesn't make sense -- 4 is still out of range... | |
=> [] |
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
ActivityManager mgr = (ActivityManager)getSystemService(ACTIVITY_SERVICE); | |
List<ActivityManager.RunningTaskInfo> tasks = mgr.getRunningTasks(100); | |
int num = 0; | |
for(ActivityManager.RunningTaskInfo i : tasks) { | |
String ACT = "com.your.package/com.your.package.MainActivity"; | |
if(i.topActivity.flattenToString().equals(ACT)) | |
num = i.numActivities; | |
} |
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
#!/usr/bin/env python | |
# works with python2.6+ | |
import argparse | |
import json | |
import os | |
_COMMENT_FILE = os.path.expanduser('~/.comments') |
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
<?xml version="1.0" encoding="utf-8"?> | |
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:id="@+id/container" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
> | |
<fragment class="com.domain.MyFragment" | |
android:id="@+id/myfragment" | |
android:layout_width="match_parent" |
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
#include <stdio.h> | |
struct entry | |
{ | |
int value; | |
struct entry *next; | |
}; |
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
#include <stdio.h> | |
struct entry | |
{ | |
int value; | |
struct entry *next; | |
}; | |
void insertAfter(struct entry * newEntry, struct entry * targetEntry) { |
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 math | |
import json | |
################################################################################ | |
# POINT | |
################################################################################ | |
class Point: | |
def __init__(self, latitude, longitude): |
OlderNewer