Skip to content

Instantly share code, notes, and snippets.

View skyler's full-sized avatar

Skyler Slade skyler

  • Constant Contact
  • Gainesville, FL
View GitHub Profile
public class T {
public static void main(String[] args)
{
T t = new T();
try {
t.testMe();
//throw t.exception;
} catch (IOException ioe) {
System.out.println("caught IO!");
} catch (NumberFormatException nfe) {
public class T {
public static void main(String[] args)
{
T t = new T();
try {
throw t.exception;
} catch (IOException ioe) {
System.out.println("caught IO!");
} catch (NumberFormatException nfe) {
System.out.println("caught NumberFormatException!");
localhost:80 172.16.204.183 - - [27/Jun/2011:14:57:54 -0400] "GET /cheek.mp3 HTTP/1.1" 200 1395984 "-" "QuickTime;NvMM HTTP Client v0.1 (Linux;Android 2.2.1)"
localhost:80 172.16.204.183 - - [27/Jun/2011:14:57:55 -0400] "GET /cheek.mp3 HTTP/1.1" 206 420 "-" "QuickTime;NvMM HTTP Client v0.1 (Linux;Android 2.2.1)"
localhost:80 172.16.204.183 - - [27/Jun/2011:14:57:55 -0400] "GET /cheek.mp3 HTTP/1.1" 206 72822 "-" "QuickTime;NvMM HTTP Client v0.1 (Linux;Android 2.2.1)"
localhost:80 172.16.204.183 - - [27/Jun/2011:14:57:55 -0400] "GET /cheek.mp3 HTTP/1.1" 206 2341 "-" "QuickTime;NvMM HTTP Client v0.1 (Linux;Android 2.2.1)"
localhost:80 172.16.204.183 - - [27/Jun/2011:14:57:55 -0400] "GET /cheek.mp3 HTTP/1.1" 206 1992290 "-" "QuickTime;NvMM HTTP Client v0.1 (Linux;Android 2.2.1)"
Signs that you shouldn't be a programmer
The following may not have any remedies if you still suffer from them after taking a programming course in school, so you will stand a better chance of advancing your career by choosing another profession.
1. Inability to determine the order of program execution
Symptoms
a = 5
b = 10
@skyler
skyler / gist:1314154
Created October 25, 2011 20:26
launching the GS app with an intent & extra
package com.grooveshark.extratest;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
public class ExtraTestActivity extends Activity {
I/RequestReader(12700): "GET /music.mp3 HTTP/1.0 -
I/RequestReader(12700): "GET /music.mp3 HTTP/1.0 bytes=2988415-5007808
I/RequestReader(12700): "GET /music.mp3 HTTP/1.0 bytes=1483115-5007808
I/RequestReader(12700): "GET /music.mp3 HTTP/1.0 bytes=1072586-5007808
I/RequestReader(12700): "GET /music.mp3 HTTP/1.0 bytes=877074-5007808
I/RequestReader(12700): "GET /music.mp3 HTTP/1.0 bytes=720706-5007808
I/RequestReader(12700): "GET /music.mp3 HTTP/1.0 bytes=642486-5007808
I/RequestReader(12700): "GET /music.mp3 HTTP/1.0 bytes=3183903-5007808
I/RequestReader(12700): "GET /music.mp3 HTTP/1.0 bytes=2577885-5007808
I/RequestReader(12700): "GET /music.mp3 HTTP/1.0 bytes=1424465-5007808
var map = function() {
for (var i in this.v) {
var yes = (this.v[i].v > 0) ? 1 : 0;
var no = (this.v[i].v < 0) ? 1 : 0;
var key = {themeID: this.v[i].t}
var value = { yes: yes, no: no };
emit(key, value);
}
}
@skyler
skyler / login.html
Created December 20, 2011 17:55 — forked from anonymous/login.html
<h1>Sign in</h1>
<form action="/login" method="post">
<div class="field">
<label for="email_addr">email_addr</label>
<input id="email_addr" name="email_addr" size="30" type="text" />
</div>
<div class="field">
<label for="password">password</label>
<input id="password" name="password" size="30" type="password" />
@skyler
skyler / login.php
Created December 20, 2011 17:55 — forked from anonymous/login.php
$s = new Savant3();
$f = $s->form('login');
$f->depends('email_addr', 'password');
$f->addValidation('email_addr', new Form_Validation('email', 'Please enter a valid email address'));
$f->addValidation('pass_confirm', new Form_Validation('confirm', 'Please confirm your password', array('against' => $f->password)));
if ($f->isSubmit() && $f->validate()) {
// handle login
}
@skyler
skyler / login.php
Created December 20, 2011 17:55 — forked from anonymous/login.php
<h1>Sign in</h1>
<?= $this->form('login')->toSelf('post'); ?>
<div class="field">
<?= $this->form()->label('email_addr'); ?>
<?= $this->form()->textField('email_addr'); ?>
</div>
<div class="field">
<?= $this->form()->label('password'); ?>
<?= $this->form()->passwordField('password'); ?>