Tuesday, November 13, 2007
Yet another loss for client-side Sun
Let's examine how much Android completely effs Sun. Android uses the Java language, but not the Java VM. So technically it's not Java. In the mad rush to profit from the impending mobile Internet platform, Sun has placed it's bets on JavaFX to strengthen Java ME and Java SE on mobile gadgets. Unfortunately for them, the problem wasn't the difficulty of the programming language, but the fragmentation and incompatibilities between VM's which has hurt mobile Java. Android is designed from the ground up to create compatibility first, and that's a major factor in the success that it will enjoy. And since it all runs on the Dalvik virtual machine instead of the official Java VM, Sun gets a solid zero dollars out of it.
Monday, November 12, 2007
Update:
After more reading I've changed my mind. It seems to me that the iPhone is still way "cooler" than any gPhone (it better be for how much it costs), but I can see how much value the top-to-bottom stack of software that Android offers can really help compatibility between different phones.
Saturday, November 10, 2007
A Tale of Default Behavior
Anyhoo, here is an in-depth analysis of the Excel floating point rendering bug.
Tuesday, November 6, 2007
Mainstream Consumer Linux?
Wednesday, October 31, 2007
Java Serialization Debugging
Monday, October 29, 2007
This is really only going to make any sense if you have done any programming, but if you have, it's hilarious.
Tuesday, October 16, 2007
Monday, October 15, 2007
Java SecureRandom weirdness
So anyways, for my own and perhaps others' benefit, I'm going to document my experience with debugging some Java weirdness because it was one of the more interesting problems I've had to deal with. So I'll dive in:
We have a server-side process that runs on a Linux server and processes a lot of oracle database data and converts it into an H2 database (details are unimportant). On one particular machine, this process would hang forever. There were no errors, no exceptions, nothing; it just hung. Last Friday I was tasked with figuring out why, and it being Friday I wasted a couple hours trying to debug what turned out to be a completely unrelated process (my brain was obviously fried). So fresh this morning I had another go at it. I had telnet access to the server, so I made use of jstack, a nifty little utility. Here's the important output:
- java.io.FileInputStream.readBytes(byte[], int, int) @bci=0 (Compiled frame; information may be imprecise)- java.io.FileInputStream.read(byte[], int, int) @bci=4, line=199 (Compiled frame)- java.io.BufferedInputStream.fill () @bci=175, line=218 (Interpreted frame)- java.io.BufferedInputStream.read1(byte[], int, int) @bci=44, line=258 (Interpreted frame)- java.io.BufferedInputStream.read(byte[], int, int) @bci=49, line=317 (Interpreted frame) - sun.security.provider.SeedGenerator$URLSeedGenerator.getSeedByte() @bci=12, line=453 (Interpreted frame)- sun.security.provider.SeedGenerator.getSeedBytes(byte[]) @bci=11, line=123 (Interpreted frame)- sun.security.provider.SeedGenerator.generateSeed (byte[]) @bci=4, line=118 (Interpreted frame)- sun.security.provider.SecureRandom.engineGenerateSeed(int) @bci=5, line=114 (Interpreted frame)- sun.security.provider.SecureRandom.engineNextBytes(byte[]) @bci=40, line=171 (Interpreted frame) - java.security.SecureRandom.nextBytes(byte[]) @bci=5, line=433 (Interpreted frame)- java.security.SecureRandom.next(int) @bci=17, line=455 (Interpreted frame)- java.util.Random.nextLong() @bci=3, line=284 (Interpreted frame)
The thread was stuck trying to read a file as a randomness source. After some digging, here's what I found. Basically class SecureRandom is reading a file that generates random bits so it can create a pseudo-random number. As the forum folks found, this file is specified in $JAVA_HOME/jre/lib/security/java.security under securerandom.source, and the default is /dev/random. Unfortunately reading /dev/random will block until the OS has entropy data (from typing on the keyboard or other somewhat random happenings in the computer). Here's some more detail.
So if you don't need really random randomness you can use /dev/urandom which will not block. That sounds easy enough, but when I checked this in java.security, it was already pointing at /dev/urandom. So what the heck was going on?
Apparently the H2 driver that we are using calls SecureRandom.getInstance("SHA1PRNG") to create the SecureRandom class. Inexplicably, this will end up using /dev/random no matter what the java.security file says. This bug report claims this is as designed. I'm sure there is a reason for this strangeness, but there is no explanation.
Here's a test program that shows the difference (pardon the lack of formatting):
import java.security.SecureRandom;
public class SeedTest {
public static void main(String args[]) {
try{
System.setProperty("java.security.debug","all");
System.out.println("I will try to instantiate SecureRandom now");
SecureRandom rand = SecureRandom.getInstance("SHA1PRNG");
//SecureRandom rand = new SecureRandom(); this makes all the difference
int dummy = rand.nextInt();
System.out.println (dummy);
System.out.println("FINISHED");
} catch (Exception e) {
e.printStackTrace();
}
}
Running this on the particular problematic machine hung with getInstance, but worked fine with new SecureRandom(). Yowza. After all this I'm not sure whose problem this is. Obviously the machine with /dev/random not working is at fault, but why is SecureRandom using /dev/random when I specifically tell it to use /dev/urandom? No idea.
Saturday, October 6, 2007
Thursday, October 4, 2007
I'm going back to 1995
I have entered into the world of 1995 with the Win32 api and visual c++ for no reason other than to waste my extremely valuable time. This has been the site of my realization-that-everyone-else-realized-about-fifteen-years-ago. It dawned on me that despite the quirks and the crap throughout Windows, programming in it takes a lot of the guesswork out of things. For instance, if I were to make an application for Linux, there are many differences among the different distributions (filesystem layout comes to mind first) that I would have to account for manually within my application. Another example: say I want to capture the video from a webcam in my application. With Windows there is one function I can call, check for error, and go from there. With Linux, I have to make sure that libraries to handle low-level access to the webcam are installed properly and I have to know where they are for many distributions. Most likely I want to just support one api so I have to make sure it is installed. If I am writing an application with a wide variety of customers, it is easy to see why Windows is the easy choice here (ignoring the fact that it is already installed on 99% of personal computers to begin with). I guess I've seen the value of the Microsoft "platform," despite its many faults (and steep monetary cost).
Saturday, September 29, 2007
Yes, the good old America tradition of not saving your own money, but the government's money (which is, in essence, every taxpayer's money minus 50% because of government waste). What a brilliant idea. Now I wonder, maybe people should perhaps, this will sound crazy I know, save their OWN money? Clinton's response: "She argued that wealthy people get to have all kinds of tax incentives to save, but most people can't afford to do that.'" Well, this is going to even more crazy, but I wonder if the reason people can't afford to save is that they are blowing all their money on things that can't afford? Now I'm just going to jump off the deep end, so bear with me, but what if people lived within their means, didn't buy twice as much house as they can afford, didn't buy the latest and greatest car, and shudder, saved some money for the future? Whoaaaaa, that's just crazy talk.
Friday, September 28, 2007
Thursday, September 27, 2007
As opposed to governments, which remain eternally stupid, and are guaranteed to make the same mistakes over, and over, and over, and over again. I'm not going to go into specifics because there are too many to mention. I'm sure you can think of a few.
In the meantime, one of my favorite quotes these days is from Benjamin Franklin:
"Those who would give up Essential Liberty to purchase a little Temporary Safety, deserve neither Liberty nor Safety."
Tuesday, September 25, 2007
Monday, September 17, 2007
Yes, that's right, that "Letterbox" feature is my amazing desk. And the "arms race" is happening in my aisle. Let the awe sink in.
Wednesday, September 12, 2007
Saturday, September 8, 2007
Tuesday, September 4, 2007
Sunday, September 2, 2007
How not to apologize
"How can you overreact when it's your children?” - Very easily, she demonstrated that overreaction pretty well.
"'I'm very sorry, but I'd do anything to protect my kids,' she said. 'If people want to put me down, that's their right.'" - For the idiot lady's future reference, "I'm sorry BUT..." is not an apology. News flash, most of the world isn't made up of reputable looking white people.
Google maps fun
Wednesday, August 29, 2007
Late night
It took me a long evening last week to get Visual Studio installed and a simple Hello World program compiled and running with debug symbols. Since Visual Studio Express Edition is free and missing all sorts of functionality, I had to download a freeware resource file editor and a hex editor for examining the file format of wav files . Every single step of getting anything working required me to do an Internet search; basically I had (have?) no clue what I'm doing. Setting up a win32 development environment is obviously a whole lot different than a C environment on Linux (which is nearly always set up by default upon installation) or a Java environment.
As for general Visual Studio observations, maybe it's because I have the free edition or maybe because I'm blind and can't find it, but I am really missing refactoring support like in a current Java IDE. That's my main complaint at the moment.
But to finally get to my massive accomplishment of the night: I was able to finally get a wav file playing. My main problem was exactly this, most like resulting from the fact that I completely forgot about fundamental concepts like the stack and variable scope. That took me a good 3-4 hours to figure out; I've been spoiled by Java's garbage collecting. Now to get something other than an empty frame with random message boxes in my program...
Or maybe I'll just go to bed.
Monday, August 27, 2007
Neat pictures
FYI, pictures can't do justice to the view at the top, but they give you a little idea of how mindblowingly awesome it is up there.
Sunday, August 19, 2007
Vacation
Last week was my first vacation since I entered the real world (dang it) last May, my first loooong overdue vacation. The majority of it was spent doing a whole lot of nothing, but the story does not end there.
We (Dad and I) took a little trip to a place called Mt. Massive, Colorado; and there the story begins. To summarize, here are some travel tips for those readers who think they want to go climb a big mountain:
1. Don't use a tent manufactured circa 1975. It is pretty much guaranteed to not be waterproof.
2. Don't try to pitch said tent in the pouring rain, especially when the rain will stop in thirty minutes.
3. Do take enough water so that you don't run out in the middle of your trip and nearly die from dehydration.
4. Definitely do it again next year.
If you haven't figured out the highlights of the trip, I'll summarize:
We used a tent manufactured circa 1975. We pitched it during the pouring rain that stopped about a half hour later. The tent leaked and Dad woke up in a big damp spot in the middle of the night. Ironically, after all this rain, we didn't take enough water for our 9 hour hike and ran out before we got done; allow me to remind everyone that this is pretty much the stupidest thing one can do while on a hiking trip. Always bring plenty of water! Amidst all this fun stuff, we did, in fact, make it to the top of Mt Massive (14,421 grueling feet high) and it was pretty much the coolest experience ever. And by "coolest" I mean "most painful." We will definitely be doing this all over again next year.
My goal for this trip was to endure enough pain and terror (I'm scared of heights) to make me want to go back to work on Monday. Alas, I haven't reached that point, but I got close.
Saturday, August 11, 2007
Fashion or function?
Wednesday, August 8, 2007
Palm in da house
You can get everything you need here; you have to register but all the downloads are free. They have a package you can download that includes the whole build toolchain, Eclipse IDE and plugins, and simulators/emulators, but since I hate Eclipse and I wanted to feel like a man, I set everything up manually with Cygwin. Yes, I do in fact derive my manhood from programming and debugging from a terminal; deal with it.
Hopefully I can actually get a useful program (or at least something more useful than a textbox displaying "Hello World" working in the next few days. We'll see what happens.
Thursday, August 2, 2007
Yowza
I'm fairly sure that there's a few problems slightly, just slightly, more significant than the package structure of Java, which took me, and I'm sure 99% of Java programmers about 3 seconds to understand. All would be fine and well if the post was about how the package structure doesn't make sense, but to say that it is the most significant problem in Java? Are you kidding me? Simply mind boggling.
This sort of thing probably convinced Eric to quit blogging.
Tuesday, July 31, 2007
Food and TV....mmmmmm....
Am I the only one who sees Hell's Kitchen as the white trash Top Chef? Seems like all they do is take run of the mill cooks and see how much yelling they can endure. Maybe that's Fox's intent because it is somehow entertaining to watch a British guy yell at people. Or then again, maybe I should do something useful with my life other than watching TV. Or maybe not.
Wednesday, July 25, 2007
Of fear of outsourcing and stupidity
I think I'm sweating sarcasm right now...
Tuesday, July 24, 2007
goodbye dual boot
Sunday, July 22, 2007
Friday, July 20, 2007
Saturday, July 7, 2007
Blind and stupid
Wednesday, July 4, 2007
Monday, July 2, 2007
Netbeans 6
Sunday, July 1, 2007
Fairness is foolish
For a wonderful example of how successful government supported media can be, check out PBS sometime; what an entertaining channel.
Thursday, June 28, 2007
Whatever happened to Xen? Oh, and the iPhone is dumb
Since everyone's talking about the iPhone, I'll jump on that train for the moment with my opinion: it's a huge ripoff. Tons of other phones have many more features and cost half or less than the iPhone but don't have all the hype so aren't as popular. The deal killer for me is the glacially slow Internet connection - I've heard many sites taking a minute or two to load. Why would you pay $2000 over 2 years for that? I guess if you want to be "hip" then go ahead; seems pretty foolish to me.
Tuesday, June 26, 2007
Linux in da house
The first thing I did was install the newest Ubuntu. Wooooooow. Installation was incredibly seamless and I am very happy with everything so far. I was living in the ancient days of Breezy Badger with no internet connection before (and Windows at work), so this is quite an adjustment for me. If you haven't used Linux on your PC before, I highly, HIGHLY, recommend Ubuntu, even if you don't know much about computers. I'll say it right now, and I'll say it again: Linux blows the pants off Windows any day of the week. The worst problem is that most businesses write their programs for Windows so there isn't nearly the selection of software in Linux. But for personal use, Linux can't be beat (I'd say OS X is comparable, maybe even better, but it's waaay overpriced so I'll still stick with Linux).
Friday, June 22, 2007
Of spreadsheets and thank you notes
In other news, I received a thank you note for a wedding I attended about one year ago. I do believe that is the longest time I have ever experienced between a gift and a thank you note. Way to go Justin H. You are the man. The best part was the contents of the note, which was highlighted with this:
"Thank you for the concrete dish you gave us for our wedding. It is neat and we use it a lot." Touching words for anyone to hear.
Tuesday, June 19, 2007
Java grid computing
Friday, June 15, 2007
More on open source...
Ok, I've done some deep reflecting on the merit of open source in general and here my incredibly insightful conclusions that you should be impressed with:
Obviously a software project does not magically become "better" because of an open source license. But what underlying cause is there for the success of projects that I mentioned previously?
I’ll posit that it is the collaboration of businesses that allows for the creation of the "best" software in a given market (it doesn’t guarantee it, just allows for it). For example, Linux is one of the best operating systems because it has ample support from programmers at IBM, Novell, Red Hat, Oracle, etc. Think about many of the popular open source projects: OSGi, Spring, Apache... there are all sorts of companies that make use of these projects, and many that actively contribute resources to them. Some big businesses have the people and money available to develop their own software that would accomplish the same goals as these projects, but why do that when using an open source project will cost less to develop and work just as well or better than a completely in-house solution?
Is this the only possible source of open source success? Of course not, but it seems to be a significant and common cause of success.
Wednesday, June 13, 2007
Clarification
That last post wasn't really about my opinion of open source and quality, or if it was I didn't intend it to be, so I wasn't really thinking about my specific words as I wrote them and I won't try to defend them. Instead I will revise/clarify/completely-change-what-I-said: Open source can lead to higher quality software than proprietary competitor software in certain circumstances. That pretty much takes all the bite (and click bait) out of what I said and leaves us with a pretty much completely ambiguous, meaningless over-generalization to argue about. Oh well.
This is inherently not something that can be proved or disproved so there is no point in making the attempt. The best way to talk about it is in terms of examples, and the best example is (you knew it was coming): Linux vs Windows.
Some other very "high quality" software is Spring, Apache, Tomcat, MySQL, JBoss, and Subversion. Direct comparisons are often pointless since software is so often chosen based on specific requirements, but I think that many would agree that these examples are "better" than many proprietary counterparts. Better than all of them? Who can say? What does "better" even mean in the first place? "Better" can mean "cheaper" or "faster" or any number of things, but probably the best meaning in the business context (since open source doesn't have much success in the consumer market) would be "cost effective." And once we move to cost effectiveness, quality can start to matter a whole lot more or a whole lot less depending on the specific case and what the word "quality" means.
There's a lot more that could be said about this, but I don't care to do so now, so you'll just have to live with that lingering desperate longing you have for my amazing opinions.
Ahhh, naivety
1) Curiosity. If I want to see how the code works, I can look at it.
2) Open source leads to higher quality software (in certain cases that I don't care to elaborate on at the moment, but Linux serves as a good example).
Sun is "going open source" because they want to make money, plain and simple; they are a company and they exist to make a profit. All this "we want to hold hands and work together" crap is BS; I have nothing against Sun, because capitalism works through competition and profit. However, anyone who thinks that Sun wants to work with the Linux community or any other open source community and have everyone contribute to a common cause out of the goodness of their hearts is completely naive. If I owned stock in Sun I would be wanting them to crush Linux into the ground unless there was money to be made by not doing so (I don't own any Sun stock, or any other stock for that matter).
Thursday, June 7, 2007
Wednesday, June 6, 2007
iTunes watermarks
Friday, June 1, 2007
blaaaaaaaa
Anyways, here's an interesting link since I don't feel like posting anything that requires much effort:
Some new ideas for the future of operating systems. Interesting, but I think it will be quite a while before any radical new designs such as this reach production on a significant scale.
Friday, May 25, 2007
Winner
In other news, for some reason IDEA, which I spend at least 3/4 of my day in, has a modal dialog for the Subversion diff dialog. That is incredibly annoying when I'm trying to look at two diffs, especially when it would take a one line fix to change it. Dah! So annoying!
Wednesday, May 23, 2007
Vietnam of Computer Science
More on that
One possible solution
Completely unrelated is this performance comparison of JBossCache and Terracotta.
I would comment on these articles, but at the moment time is lacking...
It would seem as if this blog is becoming more of a browser favorites storage engine than anything...oh well.
Tuesday, May 22, 2007
Monday, May 21, 2007
Friday, May 18, 2007
Random Friday Thoughts
I went to a presentation on JGroups today. The presentation was an hour long but had about five minutes of actual code, which on the one hand implies that JGroups is easy to use, but on the other side implies that the presentation was boring because the presenter didn't talk about the actual JGroups code very much (which I think was his intention but I was still disappointed).
I've been spending some spare time (always wish there was more of that, sigh...) looking at distributed computing/algorithms and trying to figure out a fun project to work on that would be more than just a toy program. I'm looking to write something that requires using technologies I haven't been exposed to much but are pretty popular such as Spring, JGroups, and Flex/Apollo. A few ideas have been distributed build system, CRM app, or some sort of distributed simulation system. The problem is my attention span is so short for spare time projects that I move on to new things before I can actually accomplish anything significant. Oh well, we'll see what happens this time.
On a completely unrelated note, this is pretty hilarious.
Monday, May 14, 2007
Friday, May 11, 2007
Since everyone else is talking about it...
The Java kernel sounds all fine and dandy, but it does not exist now and it won't be released until Java 7 (maybe, delays seem inevitable) and 3MB seems like a bit of a stretch for a first release if you look at Ethan Nicholas's blog (of course that's just speculation, I admit). On mobile devices I can concede that it will probably be pretty popular because of the popularity of JavaME.
The main problem is one of economics: JavaFX makes Sun either no money or makes it so indirectly that they can't significantly profit from its success. Apollo/Flex's success will directly and unambiguously profit Adobe because they charge for developer tools; same with Microsoft. It all comes down to incentives: whoever can become most profitable in a given market will make the best product. Client side Java does not profit Sun in a significant way, especially when compared to competitors. Now believe me, I am rooting for Java because I prefer all the open standards/open source/FREE stuff, but that is the only possible advantage for JavaFX at the moment. And even the cost argument for Java can be up for debate if you consider the opportunity cost of not using something like Flash or Silverlight. If I had the next week to decide what client platform I would use for a new webtop app (probably a good thing that I don't have such authority) I would look at Adobe or Microsoft much more seriously than Sun. In a year or two things could change, but I don't foresee any dramatic changes by Sun/the Java community that can't be matched or exceeded by the competition. If history is any guide (and it is so often) new features and innovation will come much faster from companies who can profit from their products.
I couldn't help but think about this some more from articles/blogs I keep seeing about JavaFX: Everyone keeps saying that it will deliver a "Flash-like experience", but Flash has been delivering that experience for years! If Java is just now catching up to where Flash was 3 years ago, who do you think will be ahead in another 3 years? Granted, you have to use ActionScript or whatever they use to program Flash, but if it's like JavaScript it can't be overwhelmingly difficult to learn pretty quickly. If one argues for the "unified development environment" that comes with Java, then I would have to point out that .NET, despite all its faults, is ONE environment that can be used to program pretty much everything that Microsoft has touched (which isn't everything, but a gigantic section of all sorts of markets)
I'm not arguing for .NET, but if I was running a business I would definitely have to consider it seriously unless it was clear that cross-platform considerations outweighed all other advantages - which is often not the case I think.
I would guess the "blasting" of JavaFX in the blogging community at large stems from the comparisons it keeps getting to Flash and Silverlight, which seems somewhat ridiculous from what I have seen.
Wednesday, May 9, 2007
The past comes back to bite me
Saturday, May 5, 2007
I'm a conduit
Doc, I tried reading your comment, but it was too deep for me to grasp in one reading, though I'm pretty sure I completely disagree with whatever you are saying. I'll have to read it again to see if I can figure out what the heck you're saying.
In other news, I've been dropped into the world of SOA of late. I must say that I always thought it was just another buzzword of the year for the architecture astronauts. I have been made aware that maybe it may actually be useful. In one of our current projects at work we are using OSGi for a pretty slick new program and I must say that after working for a year on a traditional Swing/J2EE backend program, SOA has blown my mind. OSGi has provided such a clean way to modularize our software, it's just amazing. Heck, this code may actually be somewhat, dare I say it, reusable, heaven forbid.
I've also been messing around a bit with Jini and JavaSpaces in my spare time (which has been somewhat lacking of late) after stumbling across an article on GigaSpaces, which, if their white papers aren't all marketing fluff, sounds like it is a pretty darn powerful replacement for J2EE in large cluster environments. I read somewhere that OSGi is basically SOA within the VM while Jini is SOA among distributed VM's. Pretty cool stuff. So I'll let all you who are dying to hear my experiences with this stuff know what I think over the next few days/weeks.
Friday, April 6, 2007
Tuesday, April 3, 2007
The default rt.jar doesn't have all debug symbols (it only has local variables or only fields or something), so you can either build your own with debug symbols (download source ) or I think you can download rt.jar with debug symbols somewhere on java.net (can't find it at the moment).
After I found all this out, I figured I might as well figure out my problems without debugging in the jdk...
Thursday, March 29, 2007
Tuesday, March 27, 2007
Monday, March 26, 2007
Practically in the front door already...
Annnnnnd, I'm reading this book: Java Concurrency in Practice, one of whose authors works at Google.
I'm pretty much dizzy from all this newfound power. I'm practically at Google already...
Saturday, March 24, 2007
"average" weather
More importantly, does this post mean anything? Fortunately, I don't care whether it does or not.
Friday, March 2, 2007
The Inaugural Post
Be seeing you,
No. 34
If you didn't catch the reference "The Prisoner", the greatest TV series of the modern era, you need to watch it. Nooooooow.