January 12th, 2011
It’s been a while blah blah blah promise to post more blah blah blah.
I found this article named Programmers: Why We Do It by Tony Lukasavage and barely had time to read it today. Very good (and true, IMO) quick read about why we suffer through some of the worst parts of software development.
Tags: article, development, programmers
Posted in Uncategorized | 1 Comment »
November 15th, 2010
String command = "java -jar \"/path/to/some/jar/foo.jar\"";
Here is an interesting problem I ran into while doing some work: why is Runtime.getRuntime().exec(command) reporting that it couldn’t access a jar file I was directly trying to invoke in code on Linux but worked no problem on Windows? The generated command was identical on Windows and Linux and copying the command and running it in a terminal executed as it should. WHY DO YOU HATE ME JAVA AND LINUX?
Turns out that it was really only Java hating on me. After playing around with the command, I finally figured out that removing the quotes around the jar path fixed it:
String command = "java -jar /path/to/some/jar/foo.jar";
worked but
String command = "java -jar \"/path/to/some/jar/foo.jar\"";
didn’t.
So what is going on?
Read the rest of this entry »
Tags: java, linux, osx, runtime, windows
Posted in Uncategorized | No Comments »
November 11th, 2010
A good friend of mine pointed me in the direction of an application for my smartphone called Instagram. Pretty cool – take pictures, add filter to them, upload to instagram and they post to Facebook and Twitter. So as I was testing this app, I went to add my Facebook credentials so Instagram could post there. I was surprised when one of the privileges it was asking for is to access my data while I am not using the app:

Why
Needless to say, I did not allow it. And since I can’t post to Facebook with this app, it is useless to me. Why would they possibly need that? Be careful who you give a permission like that to, people!
UPDATE!!
@instagram got back to me on twitter with an answer to this. See it here:
http://twitter.com/instagram/status/2820557485637632
Tags: facebook, instagram, permissions, privacy
Posted in Uncategorized | 1 Comment »
November 5th, 2010
The subtitle to this probably should be “to make your search result experience that much better.”
I guess this was a pretty obvious next step for Google, or maybe an even more obvious first step, but I’m sure it comes as no surprise to most of you that Google does store which links you’ve clicked in search results if you are logged in. You know this by just viewing the right hand side of a search result you’ve clicked multiple times:

three times!
So you Justin Beiber fans (I am so current!) know how many times you’ve clicked through his website. I like to keep tabs on when a current production Mac is coming to an end of it’s life cycle.
Read the rest of this entry »
Tags: css, fake click, google, search results
Posted in Uncategorized | No Comments »
August 17th, 2010
I can’t take credit for that title. Dondi sent it to me in an email. Not sure if he got it from anywhere, though. If he did, I’m sorry to be using it, but it makes perfect sense in the context of this post.
Anyway, Jacob posed this question (explained through a class) in Java:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
| public class WTFInteger
{
public static void main(String args[])
{
Integer foo = 127;
Integer bar = 127;
System.out.println(foo + "," + bar); //127,127
System.out.println(foo <= bar); //true
System.out.println(foo >= bar); //true
System.out.println(foo == bar); //true
System.out.println(foo.intValue() == bar.intValue()); //true
System.out.println();
foo = 128;
bar = 128;
System.out.println(foo + "," + bar); //128,128
System.out.println(foo <= bar); //true
System.out.println(foo >= bar); //true
System.out.println(foo == bar); //false
System.out.println(foo.intValue() == bar.intValue()); //true
}
} |
A little test class and in the comments, the output from each evaluation. So what’s going on here? Auto unboxing seems to be going on for the comparison operations, but then why does the equality test pass in one instance but fail in another?
After some research, turns out that the object representation of primitives have a cache that acts kind like a String.intern(), meaning if you assign an Integer a value between a range (default for Integers [-128,127]), you end up getting the same object back, which is why the first (foo == bar) succeeds (value is 127) and why the second (foo == bar) fails (values are 128).
From the comments of the Integer class:
/**
* Cache to support the object identity semantics of autoboxing for values between
* -128 and 127 (inclusive) as required by JLS.
*
* The cache is initialized on first usage. During VM initialization the
* getAndRemoveCacheProperties method may be used to get and remove any system
* properites that configure the cache size. At this time, the size of the
* cache may be controlled by the vm option -XX:AutoBoxCacheMax=<size>.
*/
Tags: autoboxing, java, primitives
Posted in Uncategorized | 1 Comment »
May 21st, 2010
I am still heavy on my Python learning kick. One thing that’s always interested me is the Global Interpreter Lock and why Python doesn’t have “real” threading. I came across a talk given by David Beazley called “Mindblowing Python GIL” that was very informative. Pretty shocking really about how it works and very interesting. Obviously only watching this video would leave a bad taste in your mouth regarding Python and threading, so now I need to find another talk about why the GIL is good. There is a link in the comments to a slide show that talks about why it is good, but slides without the talk are almost useless for me.
Tags: gil, global interpreter lock, python, talk, threading, threads, video
Posted in Uncategorized | No Comments »
April 14th, 2010
An update to my previous post about setting up your own web server and using DNS to get your PS3 on the PSN with the old firmware: it seems as if Sony has “fixed” this little loophole that made our PS3s once again functional sometime yesterday (2010-04-14).
No word yet on re-enabling this feature without upgrading to the latest firmware.
Tags: dns, fail, firmware, firmware upgrade, hacks, playstation, playstation 3, psn, sony, upgrade
Posted in Uncategorized | No Comments »
April 7th, 2010
Sony, let me tell you something: this is one fight you cannot possibly win. You saw what happened with the PSP. People started releasing firmware hacks for it and after that, it was over. Removing a very useful feature, a feature that I’ve already paid for, is not a very wise move on your part. You’ve angered the same gods that brought down hellfire upon the PSP. Geohot has said not to upgrade because he is looking into a safe way of upgrading and not losing “Install Other OS.” Let’s hope that works out.
Read the rest of this entry »
Tags: dns, firmware, firmware upgrade, hacks, playstation, playstation 3, psn, sony, upgrade
Posted in Uncategorized | 2 Comments »
March 1st, 2010
Just a note: the Facebook Chat data in my post regarding configuration settings for Pidgin and Facebook Chat can be used in any chat client that can connect to XMPP. You just may have to play around with your settings to see what goes where.
Tags: facebook, facebook chat, setup, xmpp
Posted in Uncategorized | No Comments »
February 11th, 2010
Facebook, earlier this week, released their new XMPP Facebook Chat which now allows any XMPP-enabled chat client to connect to Facebook chat. For whatever reason I thought this was already how things were done, but I guess not. I just set this up with Pidgin and figured I’d share the information.
Read the rest of this entry »
Tags: facebook, facebook chat, setup, xmpp
Posted in Uncategorized | 3 Comments »