Personal.X-Istence.com

Bert JW Regeer (畢傑龍)

Weekends, how they disappear

The last two weekends I have not been at home. Last weekend I went with my room mate about two hours north of Vegas. We went to help his mother with her computer which she uses for her work. She does spy photography of test cars and prototypes. Really interesting work which takes her all over secret locations throughout the entire world.

Luckily my room mate drove the entire way since it too was a long drive, 8 hours to be exact. We stopped in vegas and I rembered how much the city sucks. It is entirely fake, it is all set up.

Small town in Nevada was a different experience, no big stores, two gas stations and two or thee bars for a total of 1002 inhabitants. No entertainment what so ever, it was extremely refreshing, and I really liked the feeling of really not being able to have any worries.

The drive back we took a longer road, more curvy and a lot more fun, with absolutely beautiful scenery. I don't know what it is about the desert, but the different colours are really amazing.

I come home, work 20 hours in three days, because it so happens Friday the office I work at is closed because the 4th of July is on a Saturday this year, and I missed Monday as a day for work. Thursday night I crawl behind the wheel of a uHaul truck with a car trailer attached to it.

There has been some interesting times this entire trip, I have some new experience of how exhausting it actually is to drive a uHaul truck all the way from Phoenix to Sunnyvale in California. We left at about 2300 on Thursday and arrived at around 1900 Friday. We stopped a few times along the way, to get some nap time in. I had been up for longer than 24 hours at that point and I could not keepy eyes open and on the road.

Everything got here safely, which was the main concern, considering the truck was towing my friends brand new car. She would have killed me if anything had happened to her car, so it is probably for the best. Nothing in the truck broke either, which means I completed my mission successfully.

California drivers are really fucking insane. I have never sworn at drivers that much as on this trip over here. No respect for other drivers in any way shape or form. Nuff' said.

I sometime wish that the roads in the united states was more like they are in Europe. There the drivers know that slow traffic stays in the right, and you move to the left to pass, yes this also works on highways with 6 lanes. It would be safer and make it a lot less mentally demanding to keep track of everyone that comes barreling at you at high speed, or cuts you off.

The drivers all over the united states need to be educated on what proper driving is, how to drive safely and not cause accidents by following some simple basic rules.

I'm currently on the train from San Francisco to Sunnyvale, we had a great dinner at a really awesome Chinese restaurant, and then we watched the end of the 4th of July fireworks. The drive back is still looming, but hopefully everything goes according to plan!

Edit:

The drive back went well, it took a lot longer than I had hoped or expected, and I really wish it was shorter. Back in Phoenix safe and sound though!

MAX232 level shifter

While I have been playing with hardware for a while, I still am not entirely sure of myself when I am reading data sheets. I needed a way to level shift standard serial (RS-232) to TTL/CMOS levels. Not to long ago I had ordered a few MAX232's from Ti with the idea that I would be using them to build myself a simple cable so that I could connect my USB to serial cable to my Fonera.

Well, today I finally got my act together and got all the parts I needed, threw them on a quick breadboard and powered it on. No magic smoke, all is well so far, but I don't really want to plug my Fon into it just yet. Those are rather expensive to replace if I made a mistake, although at this point it was rather unlikely. I figured I'd use a Parallax SX28 I had lying around. SX 28 chips are dirt cheap, so even if I did make a mistake and accidently fried one it would not be that big of a deal. So I gave the SX28 the following code:

' =========================================================================
'
'   File......
'   Purpose...
'   Author.... Bert JW Regeer
'              Copyright (c) 2008 Bert JW Regeer
'              Some Rights Reserved
'              -- see http://creativecommons.org/licenses/by/3.0/
'   E-mail.... bertjw@regeer.org
'   Started... 2009-06-08
'   Updated...
'
' =========================================================================

' -------------------------------------------------------------------------
' Program Description
' -------------------------------------------------------------------------

' Simple program that reads in a byte and outputs it again over serial.
' Kind of like the echo service on Unix computers!

' -------------------------------------------------------------------------
' Conditional Compilation Symbols
' -------------------------------------------------------------------------

' -------------------------------------------------------------------------
' Device Settings
' -------------------------------------------------------------------------

DEVICE          SX28, OSC4MHZ, TURBO, STACKX, OPTIONX, BOR42
FREQ            4_000_000
ID              "MAX232"

' -------------------------------------------------------------------------
' I/O Pins
' -------------------------------------------------------------------------

Sout    PIN RC.1 OUTPUT
Sin PIN RC.0 INPUT

' -------------------------------------------------------------------------
' Constants
' -------------------------------------------------------------------------

Baud    CON "N9600"

' -------------------------------------------------------------------------
' Variables
' -------------------------------------------------------------------------

tmpB1   VAR Byte

' =========================================================================
' INTERRUPT
' =========================================================================

' RETURNINT

' =========================================================================
  PROGRAM Start
' =========================================================================

' -------------------------------------------------------------------------
' Subroutine / Function Declarations
' -------------------------------------------------------------------------

' -------------------------------------------------------------------------
' Program Code
' -------------------------------------------------------------------------

Start:
    tmpB1 = "a"

Main:
    SERIN Sin, Baud, tmpB1
    SEROUT Sout, Baud, tmpB1
    GOTO Main</pre>

(Template thanks to Jon Williams from EFX-Tek.)

As the code suggests, this is a simple echo, it turns the device into the echo service that used to be commonly found on Unix servers, which basically echoed what you had sent them right back at you, with one twist, this one just echo's each byte whereas with the service you generally had to send a newline.

Realterm with echo shown

As you can see it is working correctly, the first H got gobbled up somewhere along the line, this could either be because I am using the internal clock source for the SX28, which is known to be rather unstable at times, or because I am running this all from a virtualised Windows XP and the timing on the USB to Serial device is not correct.

I have hereby proved that my MAX232 wiring is all correct and functions as expected, and all without any magic smoke.

Sun Microsystems: It Was Short and Fast

There is an announcement that was made today that makes many people feel sad, Oracle has agreed to buy Sun for chunk change. While I have never been a huge fan of Sun, mostly because of the Java programming language and a long lasting hatred for it, lately I have become increasingly aware of Sun and its products. Mostly related to OpenSolaris the free and open version of the Solaris 10 operating system. Other products have included the VirtualBox that Sun recently acquired and off course MySQL is still a big part of my life through the websites I manage.

Sun has slowly been declining, they used to be a monolith, a large giant that could stand up against IBM, Microsoft and various other companies. The issue has always been that they did not have a good PR system, they went on word of mouth and by selling to their clientele, they never made it clear what they wanted to do and where they wanted to go. Many people have no idea what Sun is doing, what projects they are working on, what they currently own. They have no idea about the innovations in the various products Sun makes, Solaris contains many improvements and ideas that are not available in other operating systems yet. Sun was a company made by programmers for programmers. The clients and the service contracts were secondary.

Selling Sun to Oracle is a cop-out. There is no way around it, Sun could have made radical changes, they could have changed what they offered and used the various projects they owned to create a new streamlined experience that would have given them an edge over the competition. Sun owned a lot of code to do various things and never made it a complete solution, never made it easy to use and even with the tools they had given you had to use 3rd party scripts to set up a basic structure. Most notably setting up a complete solution to do single authentication, much like Microsoft's Active Directory.

The biggest question is what is going to happen to the various products that Sun owns that are open source? Oracle is one of the biggest closed source companies in the world, they don't even allow benchmark tests to be completed against other database systems. What will happen to MySQL, OpenSolaris, GlassFish, VirtualBox, and xVM? Will Oracle close Java again? Will they make it harder for the community to work on OpenSolaris? These questions are what are causing the biggest question marks and there are no good answers. The real answer is we have to wait and see. OpenSolaris is an awesome open source operating system and I will be extremely sad if Oracle takes it down or makes it harder to participate.

I am extremely sad to see Sun Microsystems be sold, they have been around for a long time, what will happen to the brand? All the good people working at Sun, all the projects they own?

(Full disclosure: I currently own Sun Microsystems shares)

StackOverflow

When I was 12 I started to learn how to program, I had just together with my dad, bought my first C++ book. I don't remember the name of the book, it might have been the C++ for Dummies book, either way it came with a CD and on that CD was the DJGPP. That day I spent some time learning the new environment the book had given me, I tried writing simple programs. Just a few days after I had bought the book I wrote a very simple C++ calculator. Nothing fancy, only 32 bit integers and what you wanted to do had to be entered in a very specific way, but I felt empowered. I had learned something, I was able to do this and master the machine.

From there my grand dad introduced me to BASIC, he had written software in BASIC before and figured that would be somewhere else to start and play with, my uncle helped me set up an environment and taught me the basics of BASIC.

10 PRINT HELLO
15 PRINT WORLD
20 GOTO 10

That was the first program I ran, and I remember it mainly because I was wondering why it was scrolling by on the screen so fast. I learned backwards if you will, I started with C++ and then learned BASIC, but I really did not get started until I was in High School, 9th grade I took a programming class taught in QBASIC. While the class was fun, and exciting I wanted to always push the envelope. For one of the programs we were required to draw a house using the QBASIC built in line drawing commands. What I ended up doing was reading the co-ordinates from a file, and drawing the required shapes in the correct places. During this class the teacher knew I was flying through the assignments and he let me play around with compilers and various other programming languages. C++ was once again the programming language of choice, this time I wrote a network based chat client so that I could communicate with my friend on the other side of the room without physically having to get up and talk to him. The teacher had separated us because of too much talking and this was my solution.

From there I also started experimenting with PHP as a web programming language, I wrote various pieces of software and scripts that never took off to accomplish various things, but mostly just to see if I was able to do it, if I could accomplish the goal I had in mind. This code I still have somewhere, on a CD with various other pieces of old code, recently I took the time to go through some of my old code and I have seen how much I have grown, how much I have learned in the various years that I have been programming now. It also reminded me how much time I spent just looking for resources and information, how long it took to get answers to various different questions.

10 years later the Internet has grown, answers are now as easy as using Google with the right keywords, however even then it can take too long to find the answer to something you know someone else has come across before. This is where StackOverflow comes in, all those years that I have been learning to program I wish a site like StackOverflow had existed, it would have allowed me to easily search for answers to questions as well as ask my own, arguably stupid, questions. It is a website by programmers for programmers and is entirely based around the idea that knowledge should be shared. If you start asking Google questions about C# you will most likely find something from StackOverflow on the list of pages it gives you.

StackOverflow has taken over my life, every day I check StackOverflow for new interesting questions, check the answers and if possible I answer the question myself. Finally there is a place where programmers are able to go with all different experience backgrounds and help each other accomplish one single goal, building better software.

Updating Drupal and Cleaning Out Old Posts

I spent some time updating Drupal to the latest version that is currently available. The last install had been running on the same old version for a long time, and it was about time. Surprisingly the following update method worked very well:

Download Drupal 5.16, use the update.php script to update the blog to the 5.16 version. No errors were presented in any way shape or form which really surprised me, hats off to the Drupal developers for building a system that is stable and works correctly. After which I had some trouble, off course the old theme was now missing so logging into my Drupal was going to be an issue without an actual theme to display any of the menu's. After using some SQL-fu I regained access. Changed the theme back to the default, and things were good to go.

Next up, I grabbed Drupal 6.10. Ran its update script and everything once again went smoothly. Way smoother than any other upgrade for any of the other PHP scripts that I have had the pleasure of upgrading, then again it has been a long time since I last upgraded something as complex as Drupal. phpBB was an absolute mess to upgrade at one point in its life, have not touched it for a while so it may have improved.

Besides the newer version, there are also some modules I have now enabled. You will see that the URL's to the posts no longer contain the node/[number] format and instead are /[yyyy]/[mm]/[dd]/[post title], this should make Google and other search engines more happy than they were before, and it will make linking to a post on my website much easier. All of the old URL's still exist but will be a 301 redirect so that Google and the likes will update their search index's with the new links.

Stale content on this website, or content that was not relevant anymore has also been removed. Mostly related to things that were happening in my personal life at the time (some of the content is still up), also removing content that if it were read now, it would do more harm than good. Other content that I have removed were posts that were time/date limited and do not apply anymore to the current situation as it stands and had no real historical value.

With all of these changes in mind, I would like to apologise for those of you with feed readers that don't correctly check the date on when posts were created, you will have had all of these changes show up as yet another item in the news feed. The feed reader I personally use had no such issues since the date on the various articles had not changed, just the URL.