Skip to content

Instantly share code, notes, and snippets.

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...
=> []
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
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
@mattbriancon
mattbriancon / DetectBufferTimeout.java
Created April 12, 2011 19:05
Spin up a thread to check whether MediaPlayer is buffering smoothly
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);