Monday July 06, 2009
I'm back from a nice but short vacation. We didn't have a detailed itinerary - we just took one day at a time and decided where to head next. We spent several days in the old Gold Rush country in the Sierra foothills - there were many things to see, such as museums, mines and caverns, and a preserved whole gold rush town with original buildings, a no-cars main road and all employees wearing authentic clothing. From there we visited the central coast and went to several of the original Missions, and ended up seeing the 4th of July fireworks from the beach in Santa Barbara. While I was gone I see that NetBeans 6.7, and Virtual Box 3.0 have both been released. Both should help me as I get back to work...
Tuesday May 12, 2009 As I was working yesterday my laptop felt kinda wobbly. I didn't think too much about it. But it started getting annoying. I lifted the laptop and looked under it to make sure my laptop wasn't accidentally sitting on top of a USB cable or something like that. Nope.
A little while later I was getting really annoyed - so I flipped the computer all the over to see what was up. And to my surprise my battery was completely warped. It looks like it had "exploded" sometime this weekend. Check out how warped it is:
A couple of years ago one of my Apple power supplies would make humming noices now and then, and one day I happened to be looking at it when it shot some sparks! Luckily I had a floor mat so any previous sparks hadn't ignited the carpet. I got that adapter replaced. But I'm definitely thankful neither incident caused fires!
(2009-05-12 17:07:04.0) Permalink Comments [2]
Monday April 27, 2009 I work from home, so I rely heavily on Instant Messaging and IRC to communicate with my co-workers, and for video conferencing I use Skype.
I sometimes make typing mistakes. And if the typo is particularly embarrassing, to the extent that I want to fix it to show that I know better, I usually write something like this:
12:00 I agre. 12:00 s/agre/agree/Anybody with
vi experience or even sed experience will recognize the second line as a search/replace command, so I'm really saying "I said agre but I meant agree". It's reflex at this point - I'll do it for the most minor accident.
I usually only use Skype for video conferencing, not instant messaging. But I just discovered, by accident, that Skype does something wonderful. Instead of showing my substitution command, it applies it to the previous line, instantly, on both sides of the conversation! Look at this:
Ugh, typo, reflexively type s/foo/bar
Voila:
Instead of adding my correction command to the log for the viewer to interpret, it just edited the previous command in place. If I can type this quickly enough, perhaps the reader won't notice!
Chatzilla, Adium, Others - Please please please do this too!
P.S. On the topic of terminal conventions.... I like using ^H's as a "just kidding" device:
12:00 Ok, I'll slap^H^H^H^H tell him about it.Anyone who's logged into terminals with wrong tty settings will recognize the ^H's as failed backspaces... And I don't want IM clients processing these :) (2009-04-27 13:34:28.0) Permalink Comments [3]
Tuesday December 23, 2008 In order to get code coverage to work seamlessly in the presence of the Rake build tool, I had to do some pretty ugly tricks - a lot of path manipulation that surely won't work on Windows. Rather than just getting bug reports, I'll need to debug through it to find the troublespots and fix them.
I don't have a Windows machine. I have a Solaris desktop box, and a Mac laptop. And since I don't have any short term plans to go in to the office (I work from home most of the time) I don't want to wait to look into this until my next chance to stop by a computer lab with Windows machines.
So, I decided to dust off the VirtualBox instance I installed and tested a while back. Back then, it worked fine - but was a bit painful to use. Actually, it was my fault. I never went and "finished" my installation. Turns out, after installing Windows on the virtual machine, there is some additional software shipped with VirtualBox that can be installed into Windows to make things work more smoothly.
For example, a special mouse driver makes the Mac mouse also work as the Windows mouse. There's support to share file systems. This is a huge benefit. I simply mapped my working source tree that I have already checked out, edited and built, as a new Windows drive! I didn't have to go and install Mercurial, Python, check out the whole NeBeans source tree, build it, etc. I could simply open up drive Z:, and run the NetBeans IDE from within Windows!
Wow. Installation was flawless. It's working beautifully. And it's free. And it's open source. Wow. Oh, and it runs on many other platforms as well.
As I wrote this blog entry I looked up the VirtualBox home page to I could link to it, and I discovered a news blurb:
New Dec 17, 2008
VirtualBox 2.1.0 released!
Sun today released VirtualBox 2.1.0, a major update with exciting new features: among them better 64-bit support, hardware virtualization on the Mac, 3D acceleration, easier networking on Windows and Linux plus full VMDK/VHD support including snapshots. See the ChangeLog for a detailed list of changes.
I just installed it and took it for a quick spin, and things are looking great.
P.S. One little tip: Installing the Guest Additions into Windows is easy - there's a menu item in the Device menu, "Install Guest Additions...". I tried it, and it popped up an installer inside Windows. But since I was in the middle of applying service packs to Windows, I dismissed it so I could deal with it after my service pack upgrade reboot. But when I tried it later, it didn't work! Uh oh, is this incompatible with service pack 3 I wonder? Nope, it's much simpler than that. What "Install Guest Additions..." does, is mount a new CD-ROM into Windows. I'm guessing Service Pack 3 turns off auto-run! Probably a security thing. So all I had to do was open the computer folder, and click on the CD-ROM there to run the installer.
Oh, one other tip: The default RAM allocated to the virtual machine is pretty small: 512Mb. In the Settings for the machine you can crank it up bigger - I set it to 2 Gb. That makes the machine run quite a bit faster under load since it's not continually swapping to disk for virtual memory.
Friday October 31, 2008 NetBeans, like OpenJDK and OpenSolaris, uses the Mercurial distributed version control system. I'm a big fan of of distributed version control. However, one thing that drives me nuts is this error message:
% hg merge abort: outstanding uncommitted changesThis isn't just going to be a rant - I've finally found a solution which is working extremely well for me. I've suggested it to some other developers who have also reported that it works well for them, so I thought I would share it with you.
The reason I run into this all the time is my preferred style of work:
@todo tasks for myself, or leave editorial comments in various source files. I might also work on a couple of larger tasks simultaneously. Yes, I know the preferred Mercurial idiom for this is to have multiple clones, one for each task - but that isn't my preferred way of doing it. Each NetBeans clone is huge and takes a while to both clone and build - and I would have to switch my IDE editing context between these large source trees all the time.
% hg push pushing to https://tor:***@hg.netbeans.org/main/ searching for changes abort: push creates new remote heads! (did you forget to merge? use push -f to force)This tells me that somebody has checked in something since my last pull. That happens a lot with a project like NetBeans where there are checkins every few minutes.
% hg pull && hg update pulling from http://hg.netbeans.org/main/ searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files (+1 heads) (run 'hg heads' to see heads, 'hg merge' to merge) abort: crosses branches (use 'hg merge' or 'hg update -C')
% hg merge abort: outstanding uncommitted changes!@#@%*#%$%&*$ ! Now, if I have dozens of changes, what do I do? When I first started using Mercurial, I would either try to finish my other changes and check them in and then try the merge again, or if I really wasn't ready to do that, I would copy the contents of my modified files to another location, hg revert the changes, and try again.
It's really very simple: Use two clones. Do all your work in clone "main", and all your merging and pushing from clone "sync".
Let's say the main repository is "master", and your two clones are "main" and "sync":
To get set up, either clone the master repository twice, or, you can clone your main locally, but be sure to update
the "parent" reference in your sync clone such that it points to the master instead of your working clone
(I do that by copying main/.hg/hgrc to sync/.hg/hgrc.)
Here's the new workflow:
sync clone, and pull your new changesets from your working clone:
% cd ../sync
% hg pull ../main && hg update
At this point, it's best to try a build/test as well, to make sure changeset is complete. If you're working
on many things in parallel, it's possible that your changeset is depending on a change in a file you haven't
checked in yet.
% hg fetch
(Or if don't have the fetch extension installed, do it manually - hg pull && hg merge && hg ci -m "Merge").
sync clone
and try again! Your modified files, and your new changesets, are still sitting completely unaffected in the main
clone. Just clone sync again and try more carefully :)
% hg push
main repository:
% hg pull ../sync && hg update
This will give you all the tip changes into your working clone, but without the risk of causing multiple heads that you
have to merge. You've already merged your local changesets over in the sync clone, and therefore there is no
conflict between your local changesets and the new changesets in the tip!
Work inFinally, I want to call attention to item #4. Doing it this way means that it's trivial to try again if something wrong happens during the merge. I've had a couple of merges where I've really mucked things up. Unfortunately, this was in my tree that contained the changesets that I cared about. In the end I had to go and manually copy out the files I wanted to check in and try again. With the above approach, if something goes wrong, just nuke the sync clone and try again.main, push and merge insync, and pull back intomain.
This is the reason I'm suggesting this approach to anyone using Mercurial, not just people who want to work with edited files.
Especially when you're new to distributed version control systems or Mercurial, it's great to be able to go back if you make
a mistake. Just make sure you know what you're doing before you submit that final hg push command to push everything
back to the master repository!
Wednesday November 21, 2007 No screenshot-of-the-week this time; I'm taking the week off since the kids are out of school for whole the week. I'm having a lot of fun!
Meanwhile, Cindy Church has been busy creating more demo videos on netbeans.tv: First, there's the classical weblog tutorial, and then there's showing how to write and run unit tests in the IDE (where I'm incidentally also using the Dark Pastels color theme I've discussed previously on this blog). We recently met and recorded more material, so there are more screencasts in the pipeline. P.S.: Both screencasts are also available in higher definition as downloadable Quicktime files - see the "QuickTime format of this screencast" hyperlinks near the bottom.
Ok, back to vacation!
(2007-11-21 16:14:44.0) Permalink
Friday April 20, 2007 It's been a busy month, and it's only going to get busier. Here are some public speaking events that are coming up - I hope you can make it to some of them:
P.S. Another demo tutorial for the NetBeans Ruby on Rails support was just published - it's here. Along with Roman's demo, these are now shipping as sample applications, so you can download the applications themselves and play with the bits.
Sunday July 23, 2006
It's unbelievably hot where I live! 111 degrees Fahrenheit in the shade - that's 44 degrees Celsius. My thermometer said 115 F, and I can believe that since I live in a part of town that is hotter than downtown where the official temperature is taken.
This of course is not conducive to working! Unfortunately, there is nothing good on TV - and I've seen all the movies in the movie theaters that according to critics are worth seeing. Not a large percentage might I add.
At least we get cool nights in California, so I can spend the morning hours web surfing a bit until it gets unbearable. Oliver Widder has posted a cartoon related to coding styles (a frequent topic on my blog). A number of people have expressed an interested in this, so it will probably be the topic of an upcoming Java Posse episode.
P.S. My favorite drink to consume in the heat is the Mojito. It's made with ice, mint, rum, lime, and sugar. Unlike the original recipe (google it), I actually blend all the ingredients in a blender such that you get pureed mint leaves in the drink. This gives it a stronger mint flavor - which is a good thing!
Tuesday July 11, 2006 The problem with password entry pads is this:
Gee, do you think my password has any 2's in it? How about 9's?
I've had my digital token card for nearly ten years now. Amazingly, I've never had to change the battery. Anyway, while having token cards is an important part of security, this Slashdot story shows that even these schemes are becoming targets for phishing scams.
(2006-07-11 10:59:32.0) Permalink Comments [1]
Monday June 26, 2006 Today is my 10 year anniversary at Sun Microsystems. When I joined June 26th 1996 I started working on Sun WorkShop, Sun's C, C++ and Fortran IDE. It's been IDEs ever since, most recently Creator and now, Semplice.
Here's to another exciting 10!
(2006-06-26 10:52:31.0) Permalink Comments [6]
Tuesday June 13, 2006 I actually have pretty good reasons for my low blogging rate recently, although they're personal so I won't get into it here. But on top of everything, I've been moving to a new place, and with six years worth of accumulated stuff packing and cleaning was quite an effort. Not to mention all the small annoying things I have to deal with, like no internet service for a week (my brother who is visiting is going crazy! Especially when the cable TV hookup is going to take another full week, during the all-important soccer world cup!). Just yesterday I found out that the garbage company is refusing to establish service for me because they claim the previous tenant has not paid his bill. I still don't understand how that's my problem. Garbage company, indeed!
Here are some quickies you might find interesting.
Tuesday April 18, 2006 You may be familiar with the Universal Law of Gravitation. And in schools and other auditorium settings, you may have observed the "Second Law Of Gravitation":
Students will gravitate towards the back of the class room. The seats in front fill up last.
Perhaps students are afraid to be picked out by the teacher to answer questions. Or perhaps they are afraid to be seen as eager to learn.
However, at some point in college I discovered that actually picking those undesirable seats up in front was a good idea. I've stuck by it ever since. In presentations at work I always beeline to the seats up in the front. Why? I discovered that lectures actually seemed more interesting that way. Perhaps there were fewer distractions between me and the instructor. Perhaps being up close let me see and hear everything clearly, and perhaps occasional eye contact with the instructor kept me from pulling out alternative reading material (e.g. computer books) if I got bored.
It turns out that if you sit in the center front, you will actually retain more of the material. Research shows that if people are placed randomly and then presented with information, people in the front, and people in the center, can recall a lot more of the presented information than listeners to the sides and back. And we're not talking 10% more. We're talking twice as much.
| Instructor | ||
| 57% | 61% | 57% |
| 37% | 54% | 37% |
| 41% | 51% | 41% |
| 31% | 48% | 31% |
This has been called the "Attention Zone" by some, and the "Action Zone" by others. (Information retention is just one aspect we can measure; verbal interaction is another.) This has been studied in depth because it has implications for class room design and student seating assignments.
Taking a seat in the front is a simple tip you can use to start enjoying lectures more. And you'll probably learn more. It's not exactly one of my coding tips, but potentially much more useful.
(2006-04-18 23:21:45.0) Permalink Comments [3]
Friday December 30, 2005
I've been on vacation this week - and I took last week off too. One of the things I did was to take my kids to a movie called
Polar Express.
We saw it last year - but this year it has been re-released in IMAX theaters in full 3D.
Lots of games claim to be in 3D - but what you're really seeing is a projection of 3D onto a 2D surface like your monitor. Cues like perspective and occlusion lets your brain figure out (through educated guessing) the spatial relationships. However, we can do better than that. If you look around, you can actually perceive depth around you. If you look with just one eye, the depth perception disappears (and you're back to the two dimensional view again where you guess things based on size, appearance, occlusion, etc.).
The trick to presenting a real 3D view, is to project two different images to the viewer - one for the left eye, and one for the right eye. Objects far away appear in the same place in the two pictures, but objects closer will appear in different places. A finger held right in front of your face obviously looks different from the left eye than from the right eye, even though the distant background stays roughly the same.
A number of things have been tried. One way is with color glasses - usually one red lens, and one blue lens (anaglyph stereo). The whole trick here is that the 3D image can be presented as a mixture of red and blue. Since these colors are complementary, the overlaid red and blue images blended together will be split apart again by the red and blue eyeglass lenses. (The red lens will see only the blue colored image, and vice versa). The problem with this approach is that you can only do "grayscale" images - the red and blue lenses obviously warp any attempts to do full color images. Here's an example of such an image. I created this with a raytracer I wrote ten years ago, back when I was really into graphics and real 3D in particular. It's a simple model of some screenshots from the product I was working on at the time (Sun's Workshop debugger) along with a 3D model of the signature green "Run" debugging arrow:
Another approach is to use 3D shutter glasses. Here you're using a special headset which very rapidly opens and closes the left and right eye lenses in succession. This is synchronized with a computer, which shows the left image followed by the right image. This allows full color 3D, since you're using time rather than color to do the image separation. I've never tried this technology so I don't know how well it works but I believe it's been used in games.
Another approach is the original, historical approach to viewing 3D images - "free" viewing. Here you simply show the two images, right next to each other. With a little training, it's easy to view this image and visually fuse the two together in your head (by changing your eye focus to be behind the screen) and suddenly see a 3D picture in the middle. Try it.
In the Polar Express IMAX version, however, they were using another technique which relies upon light polarization. The trick here is to use two movie projectors, projecting through perpendicular polarizing filters. Viewers then also view through glasses with perpendicular polarization lenses. The net result is that you get to view beautiful (full color, no time lapse) stereo images. I assume it was fairly easy for the creators of the Polar Express to create a 3D version - they already had the full 3D models; they "simply" had to render all the scenes over again - twice, one from each eye location. Hope they had good rendering hardware.
I had heard a lot about the polarization technique - but this was the first time I actually saw it. It looked fantastic - and of course the "screen resolution" in IMAX films is fabulous. But there is one remaining problem. I discovered that I tend to lean my head to one side or the other during a long (two hour) movie - and as soon as you do, you start seeing visual artifacts. Your head had better be completely aligned with the polarization axes! (And the images also were rendered assuming a horizontal pair of eyes).
All in all it was definitely the movie experience of the year - yes, there have been movies I enjoyed more, but the combination of cool technology and seeing a movie that the kids loved so much and really put them in the mood for Santa was ..... priceless.
(P.S. That's a good thing since the tickets were nearly twice what I'm used to - $15 for adults and $10 for kids!)
(2005-12-30 00:00:25.0) Permalink Comments [2]
Thursday September 22, 2005 The morning commute. The San Francisco bay area has lots of radio stations to help you through it - provided of course you enjoy listening to commercials or "flipping stations". And despite the large number of software people in the area, the morning show topics are invariably the safe staple of morning shows anywhere: celebrity trash, traffic, and endless banter. Oh, and if there's ever a good segment, you can be sure it's right when you're about to lose reception as you're heading into a tunnel or the train is going underground.
One of my coworkers today asked me what the deal was with "podcasting". It is not named podcasting because people walk around recording their diaries on their iPods. Podcasts are basically radio programs. iTunes and your iPods have special support for podcasts, and treat them quite differently from regular music files. In particular, in any given program, it remembers where you left off. Therefore, if you come back to play the same program later (having played other music other podcasts in the meantime), it continues right where you left off. Podcasts are organized separately from other music, and is listed chronologically automatically. And today I discovered that if you hit pause, and later resume, it will back up a couple of seconds in the soundfile such that you don't miss a single word.
So, podcasting is really the ability to broadcast radio programs to pods - playing devices. This has some advantages. For example, since they don't rely on the airwaves for distribution, they don't have the same restrictions that radioprograms do, where the range is so limited they have to focus on topics of broad population interest. Instead, you can have highly specialized podcasts with listeners spread throughout the world. I've found it a great way to replace my constant radio frustration. Reception is perfect since you're not relying on an antenna. The topics are interesting since I picked them myself. And in addition to the special interest topics, I can get good radio programs like NPR's Nova and Jim Lehrer's Newshour.
(2005-09-22 21:02:55.0) Permalink
Monday September 12, 2005 Check out these ads eventually rejected by "top business publications". clientjava.com claims it was Wall Street Journal - I have no inside information.
|
|
(There are more ads at the marketing site)
(2005-09-12 20:37:50.0) Permalink