Author Archives: alwold

A2DP in Leopard

One of the features I was looking forward to in Leopard is support for Stereo Bluetooth headphones. I am happy to report that it works, and the UI is much better than ones I’ve used in Windows (obviously, right?). Unfortunately, I seem to pick up a lot of interference. When I first tried them at home, I didn’t notice it, so there might just be a lot of interference in my office on campus. I can see like 5 wireless networks, so it makes sense. I wonder if I’d have the same problem with a PC. Maybe I should build a tinfoil box to sit in.

Two more gripes about mysql

First, this:
mysql> grant all on confluence_2_6_0 to dmitsuper@’%’ identified by ‘xxx’;
[alwold@bug ~]$ gunzip -c confluence_2_3_0.dump.gz | mysql -u dmitsuper -p confluence_2_6_0
Enter password: 
ERROR 1044 (42000): Access denied for user ‘dmitsuper’@’%’ to database ‘confluence_2_6_0’
Second, when I go to fix it (change confluence_2_6_0 to confluence_2_6_0.*), I can use the history in the mysql client to recall the grant line containing the password (so the password is stored in a file somewhere).

Headless Fedora tips

Being a computer nerd makes you write ridiculous things like “headless fedora”.  If you look up those words in the dictionary, you would think I was talking about hats for people with no head.  Anyway, it seems like a lot of system admin tasks on Fedora, if you look them up on google, refer to the graphical utilities included with it.  Many times it is advantageous to forgo the use of the graphical stuff (like in a headless setup).  Here are a few tips for how to do some things without the gui tools:

Configure the network
The gui tool system-config-network will recognize the lack of an X display, and present you with a nice curses (no, not like evil curses, another dumb computer word) based interface.
Change firewall rules
Run the command system-config-securitylevel.  The curses version of this program is a little confusing, but you have to go to the Customize button to change firewall rules.  Reloading them remotely is trickier, and I haven’t found a great way.
Change startup services
There is a command which has come with Redhat for a long time called ntsysv.  Just run that and check the boxes for the ones you want.  You can also use the chkconfig command to do it in a more laborious process.
Update: you can reload the firewall rules without disrupting your ssh session by running /etc/init.d/iptables restart…awesome

iPhone Tech Talk

This week, I had the opportunity to go to a talk at the University of Washington about developing apps for the iPhone. At the moment, development is restricted to web apps, but there is an SDK that is supposed to come out in February which should open up more development avenues. For now, we are restricted to web apps, so the talk was about that. As a side note, it is possible to develop apps natively, but it is completely unsupported by Apple.

The day after the talk, Apple released most of the presentation materials on their iPhone dev site, so you can check it out there as well. You have to sign up for an online ADC account, but that is free (although their “security questions” policy is highly obnoxious).

So, on to the meat of the presentations… The talk was basically broken down into three sections. First was a discussion of the capabilities of the iPhone web browser. Next they discussed data (mostly video) capabilities on the iPhone. Finally, they concluded with a session on designing good looking apps for the iPhone.

The web browser built into the iPhone is based on Safari 3, which is currently in beta on Windows/Mac, but it will be fully released along with Leopard tomorrow. Safari is based on WebKit, which has an open source version. Three levels of web support were defined: Compatibility, Optimization and iPhone apps. Basically, the first step to making your web site work with the iPhone is making sure the regular version works with Safari 3 and the limits of the iPhone. Optimization involves making your site work better with the I/O methods of the iPhone, and iPhone apps use specific Javascript/CSS features of the iPhone.

The first part, compatibility, basically gives tips on how to keep your CSS and Javascript compatible with standards, rather than just making sure they work with the mainstream browsers. They mentioned things like using Javascript object detection instead of user agent strings. Generally, if your site works with Safari 3, you will probably be in good shape.

The second part is optimization. There are various tricks you can use to make sure your web site looks good on the iPhone. For example, the iPhone pretends to be a 980×1091 display and then shrinks the web page, so you can test that on the desktop. There are also some custom CSS things that set whether or not your web site should be zoomable, or what CSS file to use based on the characteristics of the browser (like screen size). The CSS media queries are a standard CSS thing, so they will work in other browsers as well.

Finally, if you are going to try to make a web site specifically for the iPhone, they have some additional recommendations. You should make use of AJAX, so the app is responsive and interactive, and try to emulate the layouts and styles they use in native iPhone apps. One of the more interesting things they mentioned was the use of the Canvas object, which is built into most web browsers (excluding IE), and allows drawing custom things on the fly on the screen.

In the data presentation, the basic flow of data to and from the iPhone was described, most of which is pretty obvious. Things like calendar data flowing to the phone via iTunes were described. They also went into some depth about optimizing video for the iPhone. There are some encoding settings built into Quicktime for the iPhone in Wifi and EDGE modes. You can encode your video for the various data rates, and create a “Quicktime reference movie” which links to the various copies of the video. The iPhone will choose the proper video when it is directed to a reference movie on the web.

The design presentation went over some concepts of how to design your app to match up with the iPhone’s native apps. Most of it was pretty basic stuff. They did iterate one important point, which is to keep in mind the goal of facilitating what your user wants to achieve. Getting wrapped up in the details can lead to feature creep and make the flow of the application confusing. I thought this was a good design concept in general which applies to all applications.

All in all, the talk was an interesting overview of the dev environment available today, and gave some background into some of the “vibe” of the iPhone. There were a couple cool things to pick up on, but a lot of noise as well. While the current environment does provide the tools to achieve quite a bit, I look forward to what might come in the February release of the new iPhone SDK.

Blackberry dev gripes

I’ve been working on a project to port a GPS enabled MIDP app to the Blackberry 8800. This is the first Blackberry work I’ve done since the Nextel blackberry 7520 and 7100i’s. Things have changed a bit, but not that much. The dev environment works pretty well, but I do have a couple gripes. I think some of my issues have to do with not using the “JDE” they provide. RIM should really come to grips with the reality that people write apps for many MIDP devices, and it would rarely be practical to use a Blackberry specific IDE. Anyway, here’s my list at the moment:

  • The 8800 randomly reboots sometimes when you use javaloader to install an app. I’ve heard that something similar happens on the 8820, but it prompts you before rebooting. This really slows down the turnaround on the compile-install-test cycle.
  • The 4.2.1 JDE comes with a JDWP debugger, which apparently lets you do on-device debugging. I’ve gotten it to attach to a device via Eclipse, but it doesn’t stop on my breakpoints. It does output the System.out.println()s to the console though.
  • Over the air provisioning is clunky on Blackberry. You have to provide a JAD (which you don’t for cable loading, so why is it needed here?), and you have to split the COD file into a bunch of little ones (which I guess explains the need for a JAD).

I think I have a few others, but I can’t remember them now. I’ll have to add them later…

Java is better than .NET

Back at Trimble, I wanted to write some unit tests for our DAO stuff, so I came up with this crazy scheme to run a test SQL server on the local machine. I had all this custom code set up to prep the database for the test, then run the tests.

In Java, I am using a HypersonicSQL (is it even called that anymore?) in-memory database to do testing. It’s really fast since it doesn’t write to disk, and every time you run the tests, you have a fresh database. You just inject the HSQL config into the HibernateUtil class and run the tests.

Pizza

A couple of weeks ago I was at Nello’s and I was just thinking about how good their pizza is and how it seems impossible to reproduce good pizza at home. Then I thought it would be cool to go on a mission and make a bunch of pizzas and try to improve them until I arrived at something that could compete with pizza from a restaurant. I started with a little research on the Internet and came across this page, which inspired me because the pizza looked awesome. I told my brother Mike about the idea and he was in. We started by just eliminating some of the common mistakes of homemade pizza. We set the oven as high as it could go (550 degrees) and made sure the pizza stone was hot before putting the pizza on it. I suggested we do the margherita style using fresh mozzarella and plain tomatoes. We used canned whole skinned tomatoes, then ran them through the Cuisinart. You can read more about the first few on Mike’s site.

Anyway, today was the first attempt at my house. My kitchen isn’t as well equipped as my mom’s, so it was a bit more work. We had to make the dough without the Cuisinart, but otherwise it wasn’t too bad. Today we did the Nello’s clone, using whole slices of tomato with mozzarella on top. This time we used gangster style mozzarella from Safeway, but it was pretty good. Anyway, here’s the pizza before cooking:


…and here it is done:

This time we gave the dough some time to rise before making the pizza, and I think it helped. You can see it’s pretty puffy. The pizza was pretty good, although it was a little lacking in flavor, especially when you hit a piece with no cheese. I am itching to try the oven cleaning mode trick suggested on the site I mentioned.

Push email for Treo 650

It has been out for a while now, but I just got around to installing the push email update for the Treo 650. I had to upgrade Versamail, so it cost about $12 total to get it working. Once it was installed, it was really easy to connect it to my Exchange account and the push email works, as well as calendar synchronization. Pretty cool. It has crashed the Treo once so far, but it crashes a lot, so I wasn’t too surprised. Also, if your exchange server is heavily firewalled, like my previous employer, you may not have much luck, I imagine.

Anyway, get it here.

I noticed they also have Blackberry connect for the Treo 650, which probably achieves generally the same thing, but I bet you have to do more work on the server side, plus something on the carrier. This required nothing on the server and works with a regular data plan.

Performance vs. Maintenance

I’ve been writing software as a job for a few years now, and I think there is one common theme that seems to recur. There is never enough time to get everything done. The proper solution to this problem is one or a combination of three basic ideas: bring in more resources, come to a compromise, or increase productivity. The first two alternatives are not very appealing because businesses generally want to offer a good product and not spend a lot of money building it. Increasing productivity, therefore, seems to always be a good goal to keep in mind.

When writing software, one of the things we are all taught to do is pay attention to performance. We analyze algorithms, figure out their big-O complexity in terms of computing and memory usage and pick the best one. I always hated that part of school with a passion. Perhaps that makes me biased. I agree, however, that you need to keep performance in mind.

For me, performance has always been just that. Something on my mind, but not usually directly applied. I prefer to pay attention to elegance and the architecture that supports the code. I think, in general, if you pay attention to the architecture and keep things simple, the performance works itself out. You do have to think about performance, but don’t let it compromise the elegance of your code. Once the application is deployed and/or load tested (depending on the flexibility of redeployment), you can fix any performance problems, and sacrifice elegance if it comes down to it.

Security

So, it is tax season and I have been taking care of some housekeeping items with my personal finances. If you have messed around with banks and online and even telephone access, you probably noticed that there are some seriously draconian security measures in place these days. In most cases it seems like there is some combination of impossible requirements for the password combined with a requirement that you change it frequently and don’t use a password you have used before.

The end result of all this is that it is impossible to come up with passwords that you can actually remember. With that in mind, you have two choices. You can write down your password (which pretty much destroys the purported security being enforced) or you can call up their support line and have them reset your password each time you need to access whatever obscure service it is they are providing. In other words, the situation is a mess.

Various technical solutions exist for this problem, and sometimes they are used. For example, the place I work uses SecurID for VPN access sometimes. The problem is, they generally cost a lot of money and aren’t standardized. Anyway, I think there’s a lot of opportunity in this field, but I think it would make sense to approach it in an innovative way. Instead of trying to capitalize on it immediately, I think it makes sense to build something everyone can use, maybe making it free, standardized or open source. Once a standard takes hold, then there will be opportunity to provide enhancement for profit.