blog
[ 07:45 AM on January 30, 2010 ]
[ 03:46 PM on January 29, 2010 ]
What is the final value of
i?
What is the final value ofint i = 3; i += 6;
b?
What is the final value ofboolean b = false; b |= true;
b?
boolean b = false; b != b;
[ 12:43 PM on January 29, 2010 ]
[ 06:33 PM on January 28, 2010 ]
A doctor is concerned with maintaining human health through the knowledge of science. Neither are scientists, but a doctor should be able to take in a patient's symptoms, history -- all of them -- use science and come up with a plan to lesson the less desirable symptoms. In my expreience, and I only speak of my experience, a surgery post-op is more aptly-named a cover your ass visit. Let's make sure I didn't fuck the patient up more then when he/her came into the E.R.
I don't see why a surgeon should be the one to evaluate the health of a patient after surgery. It baffles me. Surgeons are skilled technicians and engineers. They are technicians in that they perform complicated, dextrous manuevers that the average person just cannot. They are engineers because they use science to perform their task. But, why is a surgeon the most qualified person to evaluate the current health of a patient?
The problem I see is this: A surgeon's solution is surgery, not medicine or anyting else. Let's alter the patient's body to improve his/her health. So, if that is their only tool, what good are they after no surgical solution will help the patient? My experience is this: My five lower vertebrae were compacted and spinal canal collapsed, and after various surgeries they are now fused, and my spine will not collapse, which is a good thing. Many thanks to my surgeon. But, why should the guy who did these procedures determine my continuing care? I told him everything that was going on today: My leg is numb, my foot goes into intense pain every night, my other foot contracts eratically, I can't sleep because the shooting pain in my hip, I can barely get myself out of bed in the morning, and his response was that was "I was doing well".
If I smell shit in my back yard I'm calling the county inspector. I'm not calling the guy who put in the septic tank. I think doctors should drop their claim to scientific knowledge at their bachelors degrees and admit to being engineers. I'm one, it's not that bad.
[ 10:56 AM on January 28, 2010 ]
[ 12:49 PM on January 27, 2010 ]
[ 04:46 PM on January 25, 2010 ]
[ 02:04 PM on January 24, 2010 ]
[ 12:10 PM on January 16, 2010 ]
What kind of whale(s) has/have no dorsal fin?
[ 04:57 PM on January 14, 2010 ]

[ 10:09 AM on January 13, 2010 ]
[ 12:30 PM on January 06, 2010 ]
- On the first window only, open these urls
- or, from 9am to 5pm open these urls
- etc
[ 07:40 PM on January 04, 2010 ]
To measure the distance between two points you click on the first point.
Then, click the stop point (at his feet),
and you'll notice the distances in the bottom-right corner.
[ 07:53 PM on January 01, 2010 ]
[ 04:10 PM on January 01, 2010 ]
[ 12:42 PM on January 01, 2010 ]
[ 09:41 AM on January 01, 2010 ]
[ 09:05 AM on January 01, 2010 ]
[ 12:01 AM on January 01, 2010 ]
window.addEventListener('keydown',function(e) {
if (e.keyCode == 38 && e.altKey) window.scrollByPages(-1);
else if (e.keyCode == 40 && e.altKey) window.scrollByPages(+1);
},true);
Oh yeah, happy new year.
[ 09:26 PM on December 31, 2009 ]
I'm not sure if I explain the setup in the google project, but basically this allows you to post your status via mail or directly on the web to both twitter and facebook, so your are assured to not bother those who are on one and not the other. So, now when you go to the interface you'll see a box if which to check whether you want to post your location, like this:
[ 11:18 AM on December 30, 2009 ]
[ 08:53 PM on December 29, 2009 ]
http://urlu.ms/Sj0qFQXboizTEOEZGc3W38OqR9Ik8GJZtK3Game over.
0kBnPt1dJPNOblD8vXKUvdB8qF1gR4h30NFy84O6Fymng4ktABt6
XduIfYpk4fl29O1oDAhnMN6f2bWDxJZgw94mHf0ZSzCCqBeBUWx
[ 11:01 AM on December 28, 2009 ]
[ 04:28 PM on December 27, 2009 ]










[ 02:20 PM on December 27, 2009 ]
% directions -o 'New York,NY,10019' 'Los Angeles,CA,90001'
Distance: 2,784 mi
Duration: 1 day 19 hours
Distance Duration Directions
187 ft 1 min Head northwest on W 55th St toward 11th Ave
0.8 mi 4 mins Take the 1st left onto 11th Ave
299 ft 1 min Turn left at W 40 St
0.7 mi 1 min Take the ramp onto NY-495 W
--- Entering New Jersey ---
3.3 mi 3 mins Continue onto NJ-495 W
0.2 mi 1 min Take the exit toward I-95 S
6.2 mi 6 mins Keep left at the fork to continue toward
I-95 S and merge onto I-95 S
...
--- Entering California ---
72.6 mi 1 hour 7 mins Merge onto I-15 S
38.9 mi 36 mins Take the exit onto I-10 W toward Los Angeles
0.9 mi 1 min Take the I-10 W/I-5 S exit toward Santa
Monica/Santa Ana
2.8 mi 3 mins Follow signs for Santa Monica and merge onto
I-10 W/I-5 S
--- Continue to follow I-10 W ---
0.2 mi 1 min Take exit 15B toward Alameda St
220 ft 1 min Merge onto E 14th St
3.5 mi 9 mins Turn left at S Alameda St
0.6 mi 1 min Turn right at E Florence Ave
0.3 mi 1 min Turn left at Miramonte Blvd
394 ft 1 min Turn right at E 77th St
--- Destination will be on the left ---
[ 01:13 PM on December 26, 2009 ]
Question 3: Will this compile? If not, why? If so, why would I ask this question?
import java.awt.*;
import java.util.*;
enum TrafficLight {
GREEN(Color.green),
YELLOW(Color.yellow),
RED(Color.red);
private final static Map<Color,TrafficLight>
INSTANCES = new HashMap<Color,TrafficLight>();
private final Color c;
private TrafficLight(Color c) {
this.c = c;
INSTANCES.put(c,this);
}
public static TrafficLight getInstance(Color c) {
return INSTANCES.get(c);
}
}
Question 4: If you answered No to the first question, what should be done with the person who designed enums to make this so?
Answer 4: Drug out to the barn and shot.
[ 09:37 AM on December 26, 2009 ]
The ministry said the government would contribute about $138,000 after a furor over the lack of security at the camp...I think it's a little too cute using the word furor when writing about anything Nazi -- how bout just say 'fit'?
[ 04:18 PM on December 24, 2009 ]
[ 10:05 AM on December 23, 2009 ]
class StaticTest {
static class C {
static { System.out.println("inside"); }
}
public static void main(String[] args) {
System.out.println("before");
System.out.println(C.class.getName());
System.out.println("after");
}
}
[ 06:10 PM on December 22, 2009 ]
# # A fatal error has been detected by the Java Runtime Environment: # # Internal Error (classFileParser.cpp:3075), pid=8080, tid=7240 # Error: ShouldNotReachHere() # # JRE version: 6.0_17-b04 # Java VM: Java HotSpot(TM) Client VM (14.3 mixed mode windows-x86) # An error report file with more information is saved as: # C:\Users\...\hs_err_pid8080.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp #
[ 07:15 PM on December 20, 2009 ]
[ 04:10 PM on December 19, 2009 ]
[ 01:56 PM on December 19, 2009 ]
[ 11:40 PM on December 13, 2009 ]
[ 11:08 AM on December 02, 2009 ]
[ 10:24 PM on December 01, 2009 ]
And, I did hit "Accept", by the way. I'm neither an asshole nor really in a position to be batting away any type of connection, personal or business. OK, enough there.
[ 08:27 PM on December 01, 2009 ]
[ 07:53 PM on December 01, 2009 ]
The basic concepts are these:
-
I put all of these files in
~/bin, you can put them where you want. But, if you don't there could be a hiccup caused from relying that they are in~/bin. -
If I want to do some task, that task will probably be done
repeatedly, but don't want to invest tons of time into
actually writing the overhead that makes
maintainable/understandable scripts (e.g. argument parsing, help
printing, convenient methods abstracted out to base classes, etc)
I would first
invoke newapp with the name of the app(s) as argument(s)
and some other options, and it will create the file, make it
executable, and try to add it to SVN. Here are the full set of
options you'd see if you type pass the one of the two help
arguments,
-hor-help, or simply invoke it with no arguments.
% newapp
Produces starter code for commandline apps using the 'app' gem Usage: newapp <options> <arguments> where options include: -h | -help Print this message -v | -verbose Print debugging messages -d | -describe Print a desription of this program -e | -explainargs Print a desription of the argument types -b | -bindir Use ~/bin for you destintion directory. -n | -motions Just go through the motions -f | -force Force override of existing files -t | -text <s> New description of the app, 's' and where arguments are 'app names'After that a new file will be created for every name you pass as an argument. For example:
% newapp a_sample_app -t "A sample app for this blog post"
% cat a_sample_app
#!/usr/bin/env ruby # # A sample app for this blog post # require 'rubygems' require 'app' class ASampleApp < App def initialize super end def description "A sample app for this blog post" end def default_arguments [] end def argument_explanations [] end def get_options end def process_arg(arg) throw 'Implementation missing for method ' + q(self.class.name + '.process_arg') # OK 0 end end ASampleApp.new.main ARGV -
First, something about the arguments...all apps that are
subclasses of App support the following arguments:
-h | -help Print this message -v | -verbose Print debugging messages -d | -describe Print a desription of this program -e | -explainargs Print a desription of the argument types -b | -bindir Use /users/jeff/bin for you destintion directory. -n | -motions Just go through the motionsTo add more arguments implement the methodget_optionsto return a list ofOptions, for example:
def get_options [new_force_opt, new_text_opt, new_opt('-j','-jeff',"Print jeff's name"), new_long_opt('-s','-string',"Use the passed in",true)] endHere, the two methods that createOptions arenew_opt(short_opt,long_opt,description)andnew_long_opt(short_opt,long_opt,text,required), the other true are shortcuts for commonly-used options. -
Within your code, member variables are set by reflection, so for
the third options from above, you could refer to the jeff
option with
@opt_jor@opt_jeff. -
There is a special method for side-effecting code -- like file
creation or deletion -- called
block(msg)that takes as arguments a stringmsgand a thunk. If the user passes in-nor-motions, as inmake, this method simply prints out the message. These options control whether any actually 'happens'. In normal mode, the thunk is run andmsgis printed if the user has passed verbose options. I really like this one, probably the most, and here's an example of how you would use this to delete a file, f:
f = ... block 'Deleting file ' + f do File.delete f endThis way it's easier to write code that you can just see what it will do first, before doing things that could change your machine.
I kinda rambled there, but the idea is that the migration from little
scripts to real programs shouldn't be painful. In fact, it should be
fun, and these are fun to write (OK, I may have lost a lot of readers
there). So, you should never have to parse arguments, or write help
screens, or comment out nasty stuff that could screw things up. You
just really implement one method --
parse_arg -- and do
your stuff in there.
[ 05:06 PM on December 01, 2009 ]
- Check to see if you are playing music
- If you are:
- store your players state -- song info, time, etc -- remotely
- pause the player
- If you are NOT playing music:
- retrieve the last known player state remotely
- resume the player with this state
- For the iphone, if we don't have a shared key we will request one from a remote URL, giving our unique id.
- For the desktop, if we don't have a shared key we need to wait for an iphone to request one and then send it over the local network.
- It doesn't actually play and pause itunes
- and, it doesn't wait for a shared key, when it doesn't have one stored locally it requests one from get_id.php
- The ability to pause the player and play tracks
- The ability to get the state of the player
- A means to retrieve a shared key, if one was not stored locally
run(has_options)find_track(info)find_info(track_id)read_info(user)play_track(track_id)pause_playerfind_the_shared_key
- A Player
implements:
read_info(user)play_track(track_id)pause_player
- A Library
implements
find_track(info)find_info(track_id)
- A KeyFinder
implements
find_the_shared_key
run(has_options), because its implementation
would be the same for both classes, and then delegating to the
appropriate instance of Player, Library, or KeyFinder for the
remaining six methods. At the end, I did use composition entirely and
the two subclasses looked like this:
class DesktopComposedCommon < ComposedCommon
def initialize(config)
super(config,
AppleScriptPlayer.new,
ITunesBasedLibrary.new,
WaitsForKey.new(config))
end
end
class IPhoneComposedCommon < ComposedCommon
def initialize(config)
super(config,
ConsolePlayer.new,
ITunesBasedLibrary.new,
RetrievesKeyFromSever.new(config,self))
end
def unique_id
'asdkfjadflkjasdlfkjasdlfkjadsf02409234098234kjsdfksdf'
end
end
This was kind of a pain, but it was fun decomposing the whole system
and really maximizing both code and data reuse.
[ 11:52 PM on November 27, 2009 ]
[ 10:10 PM on November 27, 2009 ]
| 1. | First, get yourself a shelf. Then take all the stuff out of it. Perhaps, put it on a chair, guarded by someone, like so: |
|
|
| So, you have an empty shelf, some would say naked shelf: | |
|
|
| 2. | Next you wanna get some stuff around the house, like empty iphone boxes, or algorithms books, to support the shelves in the middle. |
|
|
| Then, put the book on the boxes. | |
|
|
| 3. | Finally, you've got a decently workable table with Scary Spud and R2potatoo at the upper right. And, yeah, maybe this is a little about potatoes. |
|
[ 10:15 AM on November 27, 2009 ]
It's not perfect, and doesn't respect word boundaries, but it does the job for now.
[ 01:05 PM on November 25, 2009 ]
% camelcase2underscores Usage camelcase2underscores <options> <inputs> where options include: -h | -help print this message -v | -verbose verbosely print what we're doing -l | -loud *very* verbosely print what we're doing -p | -print echo the input -r | -report print report at the end and inputs are files, URLs, or strings.If I find any other way to make code more Perlish, it'll go in here.
[ 11:30 AM on November 25, 2009 ]
[ 12:02 PM on November 24, 2009 ]
int oneMillion = 1_000_000;
Really?
[ 06:26 PM on November 23, 2009 ]
app-0.0.1.gemThe actual code is here:
app.rbWhat this does is provide some shortcuts and abstractions including argument-parsing, help printing, and other things that are found in almost all applications on the command line. To use this you install the gem, and then extend the class
App and implement some
methods: Every app much implement either
# Process one argument
process_arg(arg)
for those who process each argument individually, or
# Process all the arguments
real_main(argv)
for those who want all the arguments at once. Optional methods to implement are:
By default all subclasses or# Return the description found in the help printing
decription
# Return a list of options created
# with 'newOpt' or 'newLongOpt'
get_options
# Return true to make unkown arguments an error
unknown_options_are_error?
# Return a list of explanations for the arguments accepted
argument_explanations
# Return a list of default arguments to use when the
# user doesn't supply enough
default_arguments
App support the following options:
You can add other options by overriding the-h | -help Print this message -v | -verbose Print debugging messages -d | -describe Print a desription of the program: newapp -b | -bindir Use ~/bin for you destintion directory.
get_options method to return an array of options, such as:
def get_options
[ newLongOpt('-f','-force','Force deletion of files',false),
newOpt('-t','-text','Use text mode') ]
end
I've made an example subclass that I use to starting out new subclasses, here
newappTo use it pass the name of the new app to create, it creates a new code shell in that file.
More work to do on it, but I was growing tired of having hundreds of shell, and ruby, and whatever scripts that were unmanageable, and I couldn't tell what they were for two days after writing them. Maybe this will help make more maintainable scripts.
[ 06:00 AM on November 21, 2009 ]
I also updated my error pages...e.g:
jeffpalm.com/laksjdflkjasdflkajsdfljkDon't worry, there's nothing bad on the other end.
[ 05:57 PM on November 19, 2009 ]
Zoomed in a little. . .
Here are some other ones
| darthtater-11246x11248.png | 151MB |
| darthtater-5623x5624.png | 33.6MB |
| darthtater-2812x2812.png | 9.6MB |
| darthtater-1406x1406.png | 2.7MB |
| darthtater-703x703.png | 800kB |
| darthtater-450x450.png | 370kB |
Here is the code to make this along with instructions on how to make one.
imageart.tar.gzBasically here's how you do it.
- Run ImageArt.java on a image to create a text file containing all the colors of the pixels of an image. Each line is a comma-delimited string of the hex values of the colors.
-
Run imageart
-pon the resulting text file to spit out an array of colors, and copy this array into imageart.user.js. - Copy some PHP files to a server where we can send requests from javascript.
- Go to http://labs.ideeinc.com/multicolr/ and the GM script will repeatedly load the colors in your image, grab all the image urls, and send them to the files on your server.
- Run imageart on the text file to generate html containing images for all the colors.
- Install the Save page as image Firefox addon, so you can save the generated HTML as an image.
Mouse over
[ 01:00 AM on November 19, 2009 ]
[ 02:18 PM on November 18, 2009 ]
[ 12:21 AM on November 18, 2009 ]
When you click that open, you'll either see a new google map tab open
Or you'll see a message that the image can't be geocoded -- you'll probably prefer the former.
Some TODOS
- Move the menu near the image stuff
- Only show the menu when you're over an image
- Have options about showing a message when you can't find geo information
- Put away my laptop, pick up my guitar
[ 10:11 PM on November 17, 2009 ]
-
Whenever you visit facebook, the pager at the top of the photo page
-
Will magically appear at the bottom, too
[ 01:10 PM on November 17, 2009 ]
<?xml version="1.0" encoding="UTF-8"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
..
<Url type="text/html" method="GET"
template="http://google.com/search?hl=en&q={searchTerms}&.."/>
...
</OpenSearchDescription>
describing how to go from string to a URL. What I want is a format
for describing how go to from the contents of a URL to a list of
results, like this
<OpenSearchResultDescription>
<Conversion
template='<h3 class=r><a href="{link:[^"]+}"[^<]*class=l\
>{title:([^<]|<em>[^<]*</em>)+}<\
/a></h3>' />
</OpenSearchResultDescription>
Here, the template describes a conversion that captures a google
search and binds the matches to the members of a search result; each
match have the bindings link and title. To motivate this a little, look at part of the content of this URL and look at the highlighted links
in red and titles in blue:
<h3 class="r">
<a realurl="http://www.cat.com/"
href="http://www.cat.com/" class="l">
Caterpillar: Home
</a>
</h3>
...
<h3 class="r">
<a realurl="http://en.wikipedia.org/wiki/Cat"
href="http://en.wikipedia.org/wiki/Cat" class="l">
<em>Cat</em>- Wikipedia, the free encyclopedia
</a>
</h3>
So basically a template is a regular expression (have to use these,
because most HTML isn't proper and breaks parsers) with bindings. In
particular, it assumes that the given URL contains a list of search
results (plus ads and other crap), and describes how to repetitively
match part of the contents and bind portions to the parts of these
search results. These bindings are of the form
{name:regex}
In this example, we have two such bindings, one is
{link:[^"]+}, which says that for every search result match,
bind the name link to whats contained in the regular
expression -- here, anything that's not a double quote. This would
make is easier to keep web content on the command line.
So, search uses this declarative conversion
to produce results like this:
% search google cat
[1] Caterpillar: Home
http://www.cat.com/
[2] Cat - Wikipedia, the free encyclopedia
http://en.wikipedia.org/wiki/Cat
...
1-81 or 'q' to quit>
Anyway, the idea is to go
from a query string to a list of results, declaratively, using a
conversion form a string to a URL, then a conversion from the contents
of a URL to a list of search results. This was a horrid explanation, but I have to run.
[ 09:48 PM on November 16, 2009 ]
- save your current state, if your playing itunes or the media player, for the other device
- resume from where you last left off if you're not playing
[ 12:37 AM on November 16, 2009 ]
[ 07:54 PM on November 15, 2009 ]
-
Whenever you visit reddit, you'll see new inline comments link under the posts.
-
When you click this link, you'll briefly see a loading... message.
-
Then, shortly after you'll see the first comment appear the post, along with next and prev links now.
-
If you click next the next comment will appear.
- If you click prev a small child you don't know will die.
[ 05:56 PM on November 15, 2009 ]
Parsing
module, and here is an example:
require 'rubygems'
require 'parsing'
# Printing all the hosts
Parsing::logfiles { |e| puts e.host }
# Print all the 'Url' elements
Parsing::xml('//Url/') { |e| puts e }
# Print all the lines
Parsing::scan { |e| puts e }
# Capture all the numbers in the lines
Parsing::scan(/(\d+)/) { |res| puts res[0] }
The motivation is to strip away as much syntax as possible for tasks
that require reading files or remote URLs, and involve pattern
matching on that input.All these methods take as input files or URLs
(these are optional, if they aren't provided, the command line
arguments are used) and this input; then yield to a block of code --
that block would depend on the type of input you're reading. They,
also, all return the pieces of input that were not used. For example,
suppose you want to print all the user agents in some server log
files, then your program would be this
Parsing::logfiles { |e| puts e.agent }
You could then invoke this with arguments that were files and/or URLs.
This is simply a convenience because I tend to write similar things
over and over and over again. So,
-
Parsing::scan regex? files?: Parse the command line arguments, or files if given, and matches on regex, if given; if no regex is given we simply yield to the line. Example:Parsing::scan { |line| puts line } # Every line Parsing::scan(/(\d+)/) { |r| puts r[0] } # Every integer -
Parsing::xml xpath? files?: Parse the command line arguments, or files if given, and matches on xpath, if given; if no xpath expression is given we use//*to match all nodes. Example:Parsing::xml { |n| puts n} # Every node Parsing::xml('//Url/') { |e| puts e } # Url nodes -
Parsing::logfiles files?: Parse the command line arguments, or files if given, and yield to a block taking an object with the following attributes:- host
- logname
- date
- method
- url
- code
- size
- ref
- agent
Parsing::logfiles { |e| puts e.agent } # All user agents
[ 12:22 PM on November 15, 2009 ]
You can create one with paths_as_sentences and then upload it to many eyes.
[ 11:49 PM on November 14, 2009 ]
% search google mr potato head -v Finding plugin 'google' Searching searchplugins.net Opening http://www.searchplugins.net/pluginlist... Opening http://www.searchplugins.net/createos.as... Have plugin 'google' Opening http://www.google.com/search?hl=en&q=mr+... Writing alias to /Users/jeff/.profileSo, a couple things. A cache of the plugins is kept in
~/.searchdb so we don't have to look on the net
everytime for the plugin. To clear this cache pass -c
or -clean as paramters. To force a lookup instead of
using the cache pass -f or -force as
parameters. Secondly, if the plugin isn't in your path or alaised,
this adds the alias plugin for 'search plugin', so
instead of typing search plugin you can just
type plugin. To explain what a plugin does,
pass in -e or -explain, e.g.
% search imdb -e Search IMDB % search google -e Search Google 100 results new windowAnd I just realized I had written something similar in nature (exact in URL, so it's lost). But that just used the ones in Firefox, this one uses any plugins. I still feel like a complete douche bag; even on top of doing this in the first place. It's cool, I made something interesting for death cubes earlier in the day. In doing so, I realized that there are many, many benefits to using your friends' mom's name as project names -- especially unfuddle messages.
[ 12:05 PM on November 14, 2009 ]
When you click the show location link you will
[ 10:19 AM on November 14, 2009 ]
So, after you select a link on a page or want to use the location of that page, you can directly send the new, shortened link via:
- Opening a new urlu.ms page
- AOL instant messenger
- Yahoo! messenger
[ 09:29 PM on November 13, 2009 ]
Enter your twitter username and password, click Load and you can browser the links your twitter comrads post by clicking on their user icon or using the left and right buttons. I should probably make the top thingy scrollable, but not now. I'm using basic authentication right now, so if you mind having your password sent in plain text, don't use it. And, yes, this is a shitty screen shot.
[ 08:26 AM on November 13, 2009 ]
newgemTo use it pass the name of the gem to create and you'll see something like this:
% newgem testgem Creating gem testgem... Writing ChangeLog... Writing LICENSE... Writing Makefile... Writing README... Writing demo.rb... Writing testgem.gemspec.input... Writing lib/testgem.rb... Done.Then you can change to that directory and make it with
make. There are some options, they are
Usage: newgem [options] gem_name
where options include
-h || -help print this message
-v || -verbose be noisy
-l || -license <lic> use license 'lic'
-version <ver> use version 'ver'
-a || -author <auth> use author 'auth'
-e || -email <addr> use email 'addr'
-s || -summary <sum> use summary 'sum'
-homepage <url> use homepage 'url'
-d || -description <desc> use description 'desc'
and 'gem_name' is the name of the new gem.
You can also put these options in /Users/jeff/.newgem
[ 10:56 PM on November 12, 2009 ]
maybe, probably,
and unlikely -- as shown here:
require 'rubygems'
require 'maybe'
puts 'Maybe'
5.times do |x|
maybe { puts x }
end
puts 'Probably'
5.times do |x|
probably { puts x }
end
puts 'Unlikely'
5.times do |x|
unlikely { puts x }
end
producing this
Maybe 1 2 Probably 0 1 3 4 Unlikely 4To install, download maybe-0.0.1.gem and run
% sudo gem install maybe-0.0.1.gem
[ 11:10 AM on November 12, 2009 ]
http://jeffpalm.com/rainingAs it turns out, it is.
[ 10:43 AM on November 12, 2009 ]
% raining 10128 Yes % raining 70123 NoFor some reason I suddenly thought about something I saw on the almighty interwaabs the other day; an apology letter for being lazy. I don't feel like finding the link, but for some reason that came to mind just now?
[ 12:11 AM on November 12, 2009 ]
As you can see x leads the pack, but o and w are close behind.
[ 10:40 PM on November 10, 2009 ]
[ 08:00 PM on November 10, 2009 ]
[ 03:27 PM on November 10, 2009 ]
I guess you'd want to go the other way -- i.e. resume listening on your desktop what you were on your iphone, but I haven't run into that use case yet, so I didn't put it in. Maybe I will and then submit to the app store? And, no, this isn't the one that I submitted yesterday. That one involves passing balls around to friends by touching your phones together, and then tracking where the balls go online.
[ 01:07 PM on November 09, 2009 ]
[ 12:33 PM on November 09, 2009 ]
[ 05:09 PM on November 04, 2009 ]
and then select to Replace inline in the pop up menu, you'll see a new link, such as
A more useful screen shot would probably be one from thunderbird or gmail. It would probably be useful not to use mr potatohead for every example. Oh well.
[ 09:12 AM on November 04, 2009 ]
And apparently this stopped working almost immediately after posting this -- probably rate-limited?
[ 06:48 PM on November 03, 2009 ]
5, 10, 15, 20, 40, 50, 60 ... Why 60 and where's 30?
[ 05:55 PM on November 03, 2009 ]
Here's how you use this
[ 05:16 PM on November 03, 2009 ]
imslowerSo, if you take longer to walk, that can be reflected in the overall time, leaving the actual train times untouched. For example, when running this, if I thought that today I was walking at a 1/3 of a person without crutches, I'd enter a 3 into the box
then all your total times would now reflect this, turning
into
And, all your individual route times would also reflect this, turning
into
Here is the original, not bookmarkleted source
googledirectionsAnd yes, I realize the times themselves aren't changed, but, seriously, who uses those? Also, it probably doesn't work if your routes takes hours rather than mnutes. In that case, your walking time should fall out in the noise, and if it doesn't, you're walking too far to be worried about how your slow walking will affect your travel time.
[ 09:46 AM on November 03, 2009 ]
The middle purple is ask reddit, the violet is self.reddit., and as noted in a previous post, for some reason, right before 11pm every post was in this category -- which was odd. Then they seemed to decrease to 1 or 2, then back to normal. Nothing life changing.
[ 11:15 PM on November 02, 2009 ]
[ 01:21 PM on November 02, 2009 ]
The concept, conceived in part by birthday boy, is to share the content of a page, rather than just an address. So, when installed, this will allow to (currently) share images, links, and the address itself of a page.
[ 10:10 AM on November 02, 2009 ]
[ 12:13 PM on November 01, 2009 ]
There are two links at the top that will pan through your events
[ 11:40 AM on November 01, 2009 ]
[ 04:14 PM on October 31, 2009 ]
tweetedbrands.user.jsWhen it's running is periodically will update the counts. When it starts updating a count, that count will turn green , i.e. from this
to this
(Yes, I realize the second value is lower; that screen shot was taken after) and then variably start counting up to the new value. It somewhat evokes enough shits and giggles to be worthwhile -- just barely.
[ 10:05 AM on October 31, 2009 ]
r2potatoo@gmail.com's is,
and here
is a map of his (or her) calendar.
I was going to use the goog's data api, but for reason it wouldn't load. Really, it would seem to prevent the map from loading, and despite following the instructions...nothing. So, I cooked up my own little API, so it's not guaranteed to work. The main difference is that the calendar feed has recurring events and single events, so those need to be handled differently. So, don't use this in emergencies (be it fire, tornado, or otherwise).. Yeah, that's enough.
[ 05:05 PM on October 30, 2009 ]
http://urlu.msBut there are two things I think this one has that others don't:
- You can choose a category for the new link to that it, itself, carries a little information about the site to which it points.
- Instead of just shortenting links, you can choose a descriptive new link and the site will try to come up with one that matches the site of interest using content from that site.
[ 01:49 PM on October 29, 2009 ]
-
After performing a google search, for example for mr potatohead
-
When you visit pages contained in the search results, you'll see
a link in the top/left corner
-
When you click on this link you'll see a list containing all the
search results that included this page and you can click one of
the other ones to continue visiting the search results
[ 04:42 PM on October 28, 2009 ]
form s-
uitable for a letter from the Governor of
California. The rest is ma-
king this post contain enough
yummy letters t-
o make it
up to snuff.
(in reference to this)
[ 03:14 PM on October 28, 2009 ]
Yeah, not tons of info here. But, if anything is taken, it's that the latter part of the day is the time when scripts with higher numbers of these measures are posted/updated. So, without knowing the relation between traffic and time, one would conclude that you would want to post during the beginning of the day to stand out. That, and use curl to falsely up your install count.
[ 11:32 AM on October 28, 2009 ]
In other news, I lost one of my iphone cables, I have no clue where it is, what could have happened; completely confused. There was one in my front room, one in my bedroom, one in my kitchen. This isn't life-changing, but it's similar to walking into the bathroom only to notice the toilet's not there, sort of.
Also, yesterday I was watching way too many episodes of this show on hulu about wall street. I think the second (and final) season was filmed in 07 or 08, but it's worth wasting your evening and watching a bunch of them simply to hear how 'things suck' because of the looming subprime mortgage crisis. Ha.
[ 09:25 AM on October 28, 2009 ]
-
Whenever you visit a craigslist subject listing page, you'll see
an extra contact info link to the right
-
When you click this link you will see one of three choices, if
the poster has put the standard Reply to email, that
email will show up in a relatively-gross pinklike color
-
If the poster hasn't hidden their email address, but it could be
found on the posting, if will appear orange-link
-
Finally, if no email could be found, it will look brownish
[ 11:08 PM on October 27, 2009 ]
Here's the code and jar, though it's really one file -- Ping.java.
[ 03:00 PM on October 27, 2009 ]
gmailipClick on it when you're looking at a thread of gmail messages and an alert will show the IP of the first originating message. Here's the original javascript:
gmailip.js
[ 10:09 AM on October 27, 2009 ]
-
Whenever you visit twitter, instead of seeing an estimated time, like so
-
you'll see the actual time (converted to the local time zone1), like so
[ 08:51 AM on October 27, 2009 ]
require 'open-uri'
ARGV.each do |u|
puts open('http://bit.ly/?url=' + u).
read.match(/short_url">([^<]+)</)[1]
end
[ 01:41 AM on October 27, 2009 ]
[ 09:42 PM on October 26, 2009 ]
I learn about shop lifting on reddit
[ 11:33 AM on October 26, 2009 ]
[ 10:01 AM on October 26, 2009 ]
http://code.google.com/p/setallFor all those worrying about the hole in front of my house being dug the other day, I'm happy to say it's been sloppily covered up. There is now what appears to be a rectangular-shaped vat of tar instead. Yea!
[ 02:24 PM on October 25, 2009 ]
-
Whenever you visit a flickr photo page you'll see a new side panel for location...
-
If the original image does in fact have GPS information in it,
despite whether flickr chooses to export this information through
their API, you'll see a map appear...
Why have I used this photo twice in one day? Flickr 'claims' it doesn't have GPS information, but the original image, taken with a satan device, does; and I can make a good guess at where it was actually taken. For some reason all the geo information inserted with my camera is poo.
[ 10:36 AM on October 25, 2009 ]
imageoand click it when you're on an image for which you'd like the geo information.
[ 10:42 PM on October 24, 2009 ]
waves.tar.gzYou can run it with
make run
or you can download and run the jar
waves.jarIn any case you'll need a mac and AMS Tracker (put it in
/Applications). When running as you tilt your mac laptop, the waves will change, like so
[ 04:38 PM on October 24, 2009 ]
[ 09:20 AM on October 24, 2009 ]
remove commentsYou can imagine what it look like without a screen shot.
[ 02:01 PM on October 23, 2009 ]
Good to know.
[ 01:47 PM on October 23, 2009 ]
As yes....you'll now be able to sleep tonight with firm accurate knowledge of exactly who of your facebook buddies is currently logged in.
[ 08:36 AM on October 23, 2009 ]
puts /([\d\.]+)/.match(open('http://checkip.dyndns.org').read)[1]
Also, if you have nunclear weapons at your disposal -- even plain chemical weapons will do -- please drop one in front of my house to shut up the guy with the jack hammer. I know he's just doing his job, but I've got as much appreciation for him right now as I would a dentist giving me a root canal.
[ 11:51 AM on October 22, 2009 ]
[ 03:04 PM on October 21, 2009 ]

[ 11:02 AM on October 21, 2009 ]
then, if there are links satisfying this term, they will be colored gator colors, going from this
to this
and the window will scroll to the first one. Here is the original javascript
searchlinks.js
[ 09:35 PM on October 20, 2009 ]
% define dog 1. a domesticated canid, Canis familiaris, bred in many varieties. 2. any carnivore of the dogfamily Canidae, having prominent canine teeth and, in the wild state, a long and slender muzzle, a deep-chested muscular body, a bushy tail, and large, erect ears. Compare canid. 3. the male of such an animal. 4. any of various animals resembling a dog. 5. a despicable man or youth. 6. Informal. a fellow in general: a lucky dog. 7. dogs, Slang. feet. ...
[ 03:52 PM on October 20, 2009 ]
[ 11:11 AM on October 20, 2009 ]
[ 09:29 AM on October 20, 2009 ]
[ 03:21 PM on October 19, 2009 ]
as well as the little one to the right.
Thanks to the cum-guzzler (excuse the term, semen-slurper is more appropriate for mixed company) that stole my laptop and other stuff, the world has had to go without knowing precisely what I was listening to for a little while. Working on a way to make this generic; for those curious is a little ruby and applescript...and, working on a way to sit in hard chairs without wanting to chop off my butt.
[ 09:31 AM on October 19, 2009 ]
Once installed, here's how you use it
-
Whenever you visit a craigslist posting, you will see an
extra link at the top of the page that will save
this posting to your list of saved postings.
-
After you save a page, you'll be able to remove
with the same (but differently-named) link
-
After saving one or more postings, these postings will appear green in the subject listing pages.
-
Also, after saving one or more postings you can
visit
http://jeffpalm.com/mycraigslist/manage
to view and manage your saved postings.
[ 12:22 PM on October 18, 2009 ]
http://jeffpalm.com/warnings/lookup.phpHappy Sunday.
[ 11:48 AM on October 18, 2009 ]
[ 02:54 PM on October 17, 2009 ]
= 48°F
= 47°F
[ 01:59 PM on October 17, 2009 ]
while colder articles will be grayer.
Uh, and yeah, between writing and posting I noticed I screwed up -- the gray scores should be blacker -- I didn't feel like making new screen shots. I'd rather make some scrambled eggs. More than that, I'd rather eat some scrambled eggs.
[ 06:16 PM on October 16, 2009 ]
[ 10:31 AM on October 16, 2009 ]
entry access_log 12.23.34.45. Useful for seeing where certain customers came from if there are distinct entry points.
[ 09:46 AM on October 16, 2009 ]
[ 07:50 AM on October 16, 2009 ]
- On the go a lot
- Really fucking lazy
Once installed here's how you use it.
-
Whenever you visit weather.com, you will be forwarded to your local zipcode's conditions
-
instead of seeing the normal, generic homepage.
[ 11:58 AM on October 14, 2009 ]
I have two equally-good user icons:
But, the problem is that when I use ichat I see the icon on the right side, so, to effectively convey the image of him speaking the chat, I want to use the one facing left. But, when I use AIM on my phone or on other clients, it appears on the left, so I'd want the one facing the right. Please add a feature to ichat declaring two user icons -- left- and right- facing icons--to solve this pressing problem. I can't be the only one experiencing sleepless nights due to this problem.
[ 04:33 PM on October 13, 2009 ]
validate.jsThe idea is that to validate an
input's value, you can do one of two things.
-
Assign a certain class name value, e.g.
for validating email input. Currently I support that one and<input class="validates_email".../>- validates_zipcode
- validates_phone
-
Use the validates attribute to validate an arbitrary regular expression, e.g.
to validate that the input should be a number.<input validates="\d+".../>
There's a example here.<script type="text/javascript" src="http://jeffpalm.com/code/validate.js"> </script>
[ 03:15 PM on October 13, 2009 ]
[ 03:01 PM on October 13, 2009 ]
[ 12:24 PM on October 10, 2009 ]
use current locationAnd after clicking to get directions on google maps click it and your current location will be inserted into the first input field like so.
[ 12:30 PM on October 08, 2009 ]
and a web way so you can control your clipboard from any device, including your phone of feath, like so:
[ 12:05 PM on October 06, 2009 ]

- My phone didn't think I was in the east river, and
- All the inneficiencies of our horrible health care system could be harnessed into something good--like the way the subway captures the energy in putting on its brakes. We could have a big donut party.
[ 11:40 AM on October 04, 2009 ]
[ 12:56 PM on October 03, 2009 ]
[ 08:25 AM on October 02, 2009 ]

they are appropriate for ages 5 to 12. But, there's also a warning that it's not for children under 3. This clearly raises ( not begs) the question, what about those kids ages 3 or 4? They're left out of the fun of both playing and choking on the pieces. I think Lego needs to throw in a few pieces that are either large enough to play with, or small enough to choke a 3 or 4 year old.
[ 05:09 PM on October 01, 2009 ]
[ 11:01 AM on October 01, 2009 ]
color subredditsHere's what it should look like
[ 07:12 AM on September 27, 2009 ]
On another note pandora lastfm has bitten me is the ass a little because there is so much overlap between the two libraries...anyway, it was fun to write and that's the purpose,
[ 12:22 PM on September 24, 2009 ]
[ 10:31 AM on September 24, 2009 ]
To use it navigate to jeffpalm.com/findme/ and you'll see a screen like so:
Then your can either goto the location, mail it, or read about this page. The link you send or view (on an iphone) will bring up a screen like this:
From here, you can click the blue dot to find directions to this location.
[ 01:23 PM on September 23, 2009 ]
input elements that would express the valid inputs. Perhaps invoke a handler when invalid, like oninvalid For example, a 'numbers only' input could look like this:
<input validates='\d+'
oninvalid='alert("numbers only, bitch");'
/>
Some of the error message probably isn't necessary, but these attributes would be useful.
[ 01:28 PM on September 22, 2009 ]
[ 10:23 PM on September 21, 2009 ]
check allTo use drag these links to your toolbar and click on one when viewing a page to take the appropriate action.
check none
toggle all
Have I mentioned doing anything only on the iPhone is less than ideal? I would love to see an apple commercial that instead of showing how easy it is to add pepperoni to a pizza, the viewer's shown what a kick in the nuts it is to write any code. Granted the phone of darkness was never marketed as a development platform...
[ 08:24 AM on September 21, 2009 ]
If you are, here is an unofficial fix made with the help of, probably, its most loyal user and my stupid iPhone:
installThis will disable the search plugins, regardless of the settings.
[ 07:01 AM on September 19, 2009 ]
I have not been kidnapped.Coders at work is a good read.

I definitely identify with lots of these guys and what they have to say. I also definitely didn't come out of it with a picture of the perfect code monkey, but that's ok.
[ 07:16 AM on September 16, 2009 ]
class T {
public static void main(String[] args) {
final int HEIGHT = 5;
new java.awt.Canvas() {
{System.out.println(HEIGHT);}
}
}
}
Without the why, and in order of quality, some answers
- On a new snow leopard mac, 2, otherwise probably not 5.
- Probably not 5.
- 5.
- "spudtrooper"
[ 02:02 PM on September 15, 2009 ]
[ 06:58 AM on September 14, 2009 ]
- apple.laf.AquaInternalFrameTitlePane
- javax.swing.plaf.basic.BasicInternalFrameTitlePane
javap -c...Can they do that? Oh well, gotta get my laundry--not before I use the bathroom.
[ 07:26 AM on September 12, 2009 ]
- Once again I'm screwed by apples 1 to 1 policy with iPods and computers. I have a shuffle full of legitimate music (b&s and fugazi if you must know), but it's being held captive and can't be used in episode #2 of Urban Squirrel Hunter.
- I do like how the death phone's spell check rewards poor typists. That is, if you are misspelling a word,, it prompts you for the real word. So, why isn't there a tab like completion for words?!?!
[ 08:41 AM on September 11, 2009 ]
[ 11:05 AM on September 09, 2009 ]
[ 02:46 PM on September 08, 2009 ]
[ 06:07 AM on September 08, 2009 ]

[ 08:09 PM on September 06, 2009 ]
make is not BSD, poo. So I made my complete-enough version to look at apple's java implementation and some instances of possible poor design choices...here's what I found.
-
Method
createNativeWindowin classapple.awt.CWindowsthat has 31 parameters. -
There's a rather long method
named
makeInfoOnlyServantCacheLocalClientRequestDispatchetFactoryin a class with a name I don't feel like typing on my phone. -
There's a rather long field named
ER_ASNODEITERATOR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER, and it appears to be mispelled --REEFRAG? -
Finally, there's a class
com.sun.tools.corba.se.idl.Noopnthat implements 22 interfaces.
[ 06:09 PM on September 05, 2009 ]
userscripts.org **********************... vkontakte.ru ******** google.com ******** youtube.com ******* facebook.com ****** orkut.com ****** imageshack.us **** pennergame.de **** rapidshare.de ****Again the first ones are predictable, but the rest not so much. This I'd probably due to not being fine-grained enough, oh well.
Also, it's worth noting (and probably more impotant) that while typing this up my iPhone corrected the
<pre> tags with <pee>.
[ 09:47 AM on September 04, 2009 ]
show cssand here's what it looks like:
and, yeah, I was 'borrowing' some css...again what a joy it is to write any code-like things on the iPhone.
[ 09:08 PM on September 02, 2009 ]
And who the hell came up with the Easter Bunny, and since when did rabbits lay eggs? According to wikipedia the Germans began this legend, and began making bunnies to eat 200 years later. I think Santa Claus hailed from Germany, too, but I think in the case of the hare they were sipping something a bit stronger than egg nog. Either way, I hand it to the Germans to celebrate Jesus rising from the dead by sending your kids hunting for colored eggs layed by a large, anthropomorphic rabbit.
[ 12:27 PM on August 29, 2009 ]
[ 03:12 PM on August 27, 2009 ]
userscripts.org ********************
facebook.com *****************
youtube.com ******
google.com ******
erepublik.com ******
googleapis.com *****
imageshack.us *****
elbruto.es ****
douban.com ****
gnu.org ****
The first one is surprising and could be
wrong, the next few confirm predictions, and the rest fall out in noise really.
I guess I also wanted some pleasure hacking s & m, because I wrote the code all on my stupid iPhone.
[ 08:38 AM on August 25, 2009 ]

(There's a image here, Roscoe...he he)
[ 06:58 PM on August 22, 2009 ]
[ 02:25 PM on August 22, 2009 ]
I'm just trying to bring people closer together.
[ 07:52 AM on August 21, 2009 ]
[ 01:55 PM on August 06, 2009 ]













