Usually a Friday night looks something like this

but sometimes it will look like this

with me living it up…

As you involve more and more brewskis, you may find the need to drain the

increases dramaticly
Usually a Friday night looks something like this

but sometimes it will look like this

with me living it up…

As you involve more and more brewskis, you may find the need to drain the

increases dramaticly
I’ve been doing OOD and OOP for what I consider to be a pretty long time. I learned C++ back in around ‘92, which makes this 16 years later.
I haven’t written C++ every day for a number of years, but I did do it professionally for a 3-4 years and though I came late to the generic programming party I think I can say I’m pretty proficient.
Heck I even read the parts of the book about design principles.
So what? I know… I always have to ramble on… otherwise I would just post the graph, which would be even more pointless, so hold on a sec.
I picked up Java in, say, 1995 and I’ve been doing that professionally for the last few years. Code reviews, looked at a lot of Java code and so I felt like I knew good object oriented design.
Then I read this article where the dude, Stroustrup, basicly said: “hey! not every data structure is an class! some of them are just data structures! don’t make every collection of data a class”
And I thought “Holy cwap! I have been doing OOD like a nut!” I realized I had been brainwashed!
In Java everything is a class, but that doesn’t mean it has to be a class!
WTF does that mean?
Lemme provide an example. In the article, dude, talks about an “address” example which is fine, but not very computable and I likes the 3d graphics, so I decided to do a quantitative test to measure how much it would cost to have a struct-style class in Java and perform operations on it rather than have the operations be part of the class.
Since I am scatter brained, I also wanted to try some other stuff as well and see what the cost of various types of implementation would be.
Here is the stuff I wrote to test:
| Impl. | Claim to Fame |
|---|---|
| PointDirect | write out normalize “method” inline |
| Point | direct access to member variables |
| Pointy | uses get and set exclusively |
| Pt + Pt_struct | uses point data structure |
For each implementation, I ran 100 million dot products and (2x) normalize invocations.
The code from the code that uses the struct looks like this
long max = 100000000;
Pt_struct a = new Pt_struct( 1, 2, 3 );
Pt_struct b = new Pt_struct( 4, 5, 6 );
start = System.nanoTime();
for ( i = 0 ; i < max ; i++ ) {
Pt.normalize( a );
Pt.normalize( b );
Pt.dot( a, b );
}
stop = System.nanoTime();
all the code is pretty similar… check out the links…
Here are my results:
| Impl. | Time in ns | Graph |
|---|---|---|
| PointDirect | 7276762448 | |
| Point | 7260967079 | |
| Pointy | 7124373741 | |
| Pt + Pt_struct | 4461348165 | |
Did you see that? Basicly none of the composition of function, getters/setters v/s direct access to member variable really made a rat’s fart worth of difference…
But the “struct class” based implementation is 38% faster than the average run time of the other implementations!
Can this be right? It seems insane! But it appears to be the case.
If it’s true, I have a lot of refactoring to do on ghia!
—-
(1-4461348165/((7276762448+7260967079+7124373741)/3))*100
Here is some stuff if you are interested. If you are not interested, it is still some stuff:
I bought a Belkin F5D7132 for $40 bucks on newegg. I was going to buy another Netgear WGPS606, but they are suddenly $80 which is insane.
I use the gear to hookup crusty PC types to my spiffy wifi.
Of course the WGPS606 also does the print server thing and has 4 ports. The Belkin has 1 port and seems to be really cheaply constructed.
I know I don’t really care about cheap construction either as long as it gets the job done… but 1 port? Really? Come on…
OK, according to the manual that should really be “2661/237″ seconds, but for me it’s easier just to convert it to digital… If you are slack you could just hold it for 10 seconds. Or you could tuffen up a bit… Your call. You know your own life better than I do.
It has a little web interface. It’s ip is 192.168.2.254
Sometimes it acts kind of like a dumbass and you may have to reset it again.
This may cause some teeth gnashing so throw something across the room, beat
the dog other inappropriate thing you do to vent rage.
Eventually you will see something like:

Click on “Basic” on the left hand side and it will ask you for the password.
It tells you to hit submit if you haven’t set it, so click “submit” like
the champion of clicking “submit” you are. Really go nuts with it!
It will show you a screen with a bunch of stuff to ignore.
Click on the “System Settings” link on the bottom left-hand side.

Use your mad skills to figure out where to put your password…
HINT: “Type in new Password” and “Confirm new Password” worked for me.
Click “Apply Changes”
Logout and login again to make sure it is all kosher.
OK! Time to click on “Basic”! Sweet!

Click on “Site Survey” and screw on the antenna. It may have picked up your
network without it, but if not, click “refresh”

Click the “Select Network” for you network and you will be rewarded with a
scary looking:

Then fear the wrath of:

Somehow I missed the chance to set the PSK, whatever… once it rebooted,
I connect to it again clicked on “Security” and set it.

Click “Apply Changes”
Finally, I click the “Network Manager” on my laptop and tell it to use
“Wired Network” and it does it:
ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:16:41:16:83:A2
inet addr:192.168.69.100 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:6847 errors:0 dropped:0 overruns:0 frame:0
TX packets:7073 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:6048751 (5.7 MB) TX bytes:742450 (725.0 KB)
Interrupt:16
ta-freakin-da!
This page brought to you by the editor “vim” and the search and replaces:
:%s,^#\(.*\),
BTW… Irritated by the pointless war in Iraq? Miffed by outrageous gas prices?! Don’t blame me! I voted for porkchops!

A while back I wrote about haxe and papervision which basicly said “golly!”
The fact that it works is great, but there were a few things that were a little mysterious to me and some of the code organization of the demo wasn’t quite in my style, so I refactored it a bit. Some of the olde “take it apart, put it back together” gag.
One of the things that mystified me was this:
class Haxe extends MovieClip {}
class Baidu extends MovieClip {}
class Google extends MovieClip {}
class Yahoo extends MovieClip {}
There was also some XML like so:
<?xml version="1.0" encoding="iso-8859-1" ?>
<movie version="9" width="600" height="500" framerate="60">
<background color="#000000"/>
<frame>
<library>
<clip id="Baidu" import="baidu.png"/>
<clip id="Google" import="google.png"/>
<clip id="Yahoo" import="yahoo.png"/>
<clip id="Haxe" import="haxe.png"/>
</library>
</frame>
</movie>
And a broken link.
How did this magic work? It was obviously a way to declaritively create MovieClips that you can reference in Haxe! Neat!
Well… after poking around some of the googoo I came to the new haxe documentation for this functionality.
I renamed 4 random png’s to match the xml and saved the xml to fu.xml. Then I ubuntu’d it up:
% sudo apt-get install swfmill % cp -i lib.swf original.lib.swf % swfmill xml2swf fu.xml doesn't seem to be a swfml file no SWF loaded to save
Bummer… so I cried out “Googoo! Help me!” and low and behold! The way was made clear:
* % swfmill simple fu.xml lib.swf * % haxe jiggy.hxml
Neat! Worx a treat!
It is much easier to develop a complex solution to a problem than to develop a simple one.
Unfortunately, complex solutions are also brittle and more expensive to develop, maintain and extend.
Sometimes, the path of least resistance in development involves skipping initial prototyping and exploratory programming work and heading directly to the planning stage. Often this is motivated by external pressure to pick a completion date immediately.
A skeleton system is a response to this challenge.
An application is constructed which demonstrates the minimal functionality end-to-end. Development then becomes the process of putting meat on the bones.
When expanding the functionality of this system, each component’s functionality is expanded to the level needed by the application. Components grow with the application.
Since components are always in use, their level of complexity is held in check by the needs of the application.
Because components are only developed to meet the needs of the application, resources can be used more effectively.
Once software is in production, it can be almost impossible to replace.
One reason for this is the obvious risk of deploying new software as opposed to the less obvious risk of leaving a fragile system in place.
The software industry has produced a number of horror stories about full blown project re-implementations. Building up test coverage and refactoring an existing solution is a very practical alternative.
The legacy system provides a well documented feature set for the refactored implementation.
The goal should be to produce a drop-in replacement which has the test coverage to back it up.
An effort of this sort has a high probability of success and is a sort of alchemy to convert a complex implementation into a simple one.