Thursday, July 30, 2009

Proof copy on the way...

I should receive the Fundamentals' proof copy in about 2 weeks. If all goes well, the release date is August 15th or so.

Wednesday, July 29, 2009

Laptop's back in business

Good, now I have two new hard disks. I can't believe I put up with 4200rpm drives for so long. These are 7200rpm performance drives, and peak at about 100mb/sec. The machine sure comes back from hibernation faster now...

Saturday, July 25, 2009

Busted laptop hard drive

Yep, one of the laptop's disks is busted. What's almost comical is that e.g.: chkdsk says "sorry, unknown error, so I am not finishing". But SMART insists everything is fine: no seek errors, no relocated sectors, no ECC issues, nothing.

Fujitsu... for some reason, I never quite developed much trust for those drives. Now, I can't help distrusting them outright. I could understand broken mechanics and bad SMART values. But read rattles, unrecoverable errors, and SMART insists everything is fine? I wish Google had released the data for their assertion that SMART does not predict disk failures sorted by manufacturer. I do have direct evidence of Western Digital drives reporting lower than perfect scores, so I have a feeling some drives are smarter than others...

Done writing!

I don't quite realize that, basically, I just finished writing the first volume of Fundamentals of Smalltalk Programming Technique. The draft is 400 pages. The to do list has just small tasks... make a few more exercises for chapter 5, try to solve the last exercise (I do not know if it can be solved yet), get the text edited, design the book cover, and send it to Lulu for a proof copy. If all goes well, the book may go on sale in 2-3 weeks.

1 section to go...

The draft is at 396 pages. Just one section left. Any time now.

2 sections to go...

Ok, I just finished the first (and longest) of the 3 sections I had to write. The Fundamentals draft is 390 pages. Now I just have a not so short section (5.3.8) and a short section (5.3.9) to go. A mere 15 or so more pages left to take care of...

I should also point out that I found a few bugs and other cleanup opportunities in Assessments as a result of writing about it. I will publish the improvements after I finish the book. Overall, I think I managed to reduce the methods/class average. The code stats for Assessments (including all the self tests and the tools) are 1227 methods and 187 classes and class extensions, for an average of 6.56 methods / class.

Oddball fact of the day

There's a song by "The Pointer Sisters" called "Jump"...

Friday, July 24, 2009

A new VisualWorks website in Spanish!

Pablo Gancharov started a new website where he shares his Smalltalk experience (in VisualWorks, but VW is also a Smalltalk!). Go there and check it out!

Thursday, July 23, 2009

Just what I needed, grrr!

Sigh... imminent laptop hard drive failure. Gotta love it :(. At least I am not losing anything, and I have about 5 backup copies of everything.

3 sections to go...

I just finished the "half" section. Assessments just got a nice 25 page design document written. The Fundamentals draft is 374 pages. Just 3 sections to go...

Wednesday, July 22, 2009

What is Assessments?

Assessments is a Smalltalk test framework like SUnit. Unlike SUnit, however, it is designed to be flexible and extensible. So, for example, whereas there are many mutually incompatible SUnit logging facilities, in Assessments you can have multiple logging facilities working at the same time. The key criterion is that using Assessments should not force anybody to modify the framework.

Moreover, Assessments also runs tests from other test frameworks, such as SUnit, SUnit VM (including SUnit Benchmarks and SUnit Based Validation), and SUnitToo. The Assessments execution machinery is quite powerful, and literally takes over the other frameworks seamlessly and transparently. Basically, you load Assessments, it detects what frameworks are in the image, and acts accordingly.

Instead of the approach taken by the SUnitToo bridge, Assessments does not modify or create code to run SUnit tests. Moreover, users do not need to make any changes to their existing SUnit tests either. Therefore, using Assessments does not invalidate any existing SUnit tests. In fact, you can continue writing your favorite variety of SUnit tests because Assessments is backwards compatible with them. Even though SUnit tests may not be Assessments' native tests, you still get all the advantages of a better test execution engine.

The Fundamentals' chapter on polymorphism documents many of the techniques and constructs that enable Assessments' flexibility (polymorphism is king). I spoke briefly about Assessments at ESUG 2008. The slides are here, the video is here (and here). The SUnit Benchmarks and SUnit Based Validation extensions are described at length in the mentoring course book (you can also get the book at Amazon and Powell's). SUnit Based Validation and its multitude of applications are also discussed in this paper and this Smalltalk Solutions 2008 presentation (mirror here) by Leandro Caniglia.

You can get the latest version of Assessments from the public Store repository. The bundle name is Assessments. As soon as I am done with the Fundamentals book, I will add a few things I've wanted in Assessments for a while. See here for the to do list.

An update on the fundamentals book...

The draft is 362 pages long now, and it's growing quickly. I just have 3 and a half sections on Assessments to go, but I also think the end result will be over 400 pages in size. Then, making some more exercises, fixing a few other small details, and creating the book cover.

Friday, July 17, 2009

FTP server down

FYI, the FTP server will be down for about 2 weeks.

Sunday, July 12, 2009

More stuff for Fundamentals volume 2...

Sigh. It never ends. I think I will add a chapter on weak collections and ephemerons to the second volume of the Fundamentals book. As if having a chapter on optimization wasn't enough risk of having to write a third volume already...

Book progress

Now I have two editors working in parallel. They are doing a great job of keeping me busy, which is good. Just today, I rewrote about 25 pages so far. I managed to make some progress at the leading edge, too. The draft is 344 pages now. Moving along...

Saturday, July 11, 2009

Boolean expression simplification question

Would anybody be so kind to provide a direct proof of the following identity?

x · y + x · z + ~y · z = x · y + ~y · z

Thanks in advance.

PS: finally, I think I found a derivation using "integration factors" so to speak... but I am still interested in alternatives!

Wednesday, July 08, 2009

Real hacks worth mentioning

Check it out... using a VHS recorder as tape backup with no additional hardware. Up to 130mb/hour of tape! The last hack here is amazing...

Sunday, July 05, 2009

Swine flu...

You know, in some countries there's major paranoia about swine flu. Don't go out, buy tamiflu, buy masks, cancel schools and large events, impose mandatory vacations, etcetera. Is that reaction reasonable? Let's see...

  • This article states there have been 263 deaths due to swine flu in the world so far.
  • This other article states there are ~1 million infected people. Half of world infections are in the US, and therefore, there must be ~2 million infected people in the world.
What's the morbidity rate so far? 0.01315%. In other words, the odds of death by swine flu are 1 in ~7605. Well. How does that compare to other risks we take everyday?
  • Risk of death in a motor vehicle accident in the US during 1 year, 1 in ~6500 (source, 2005).
  • Risk of death due to intentional self-harm during 1 year, 1 in ~9100 (source, 2005).
  • Lifetime risk of death due to intentional self-harm, 1 in 121 (source).
  • Lifetime risk of death due to natural forces (heat, cold, storms, quakes, etc), 1 in ~3350 (source).
  • Lifetime risk of death due to electrocution, 1 in 5000 (source).
So, really, if you don't care about just one of the above, you cannot possibly worry about swine flu right now. Here are some far more serious illnesses with their yearly mortality rates.
Do you hear about those in the news? Should we shut down the piercing and tattoo industry to stop the spread of hepatitis C? And how about this?
  • Lifetime risk of maternal death in developed nations, 1 in 2800 (source).
You better cancel those plans to have children, because it's ~1.3 times more likely that you will die due to giving birth than due to swine flu.

Seriously. Do you worry about any of these things as much as you have panicked about swine flu? Most likely, no. Then, knock it off with the fear already! At least, do the responsible diligence of monitoring swine flu's mutations without seeing death around every corner.

Assessments 1.10

I didn't put out a notice for the new versions of Assessments. So... I fixed a small problem with resource failure notifications, an issue with one test that improperly scanned for the presence of optional code, and deleted a subclass of the evaluation context. I made the design decision that, in an evaluation context, the evaluation itself should be subject to a policy. I will create a couple evaluation policies later.

What about the to do list? I want to add a new checklist evaluator that sorts checklists / testcases by bundle and package. I also plan to add some (simple!!!) extensions to the RB. Finally, I want to redo how failures and errors leave the evaluation result window frozen while waiting on a semaphore. Hopefully I will feel inspired later this month. Nevertheless, the book still has priority over Assessments enhancements right now.

Hash Analysis Tool 3.26

I just published an update for the Hash Analysis Tool. I deleted some dead code. Also, I temporarily disabled the block count tests because they can fail for ad-hoc data sets.

Notes on including Windows screenshots in LaTeX documents

So, the Fundamentals book now has figures. I had to take a few screenshots, and I noticed a few things.

  • If you don't disable font smoothing, then the resulting PDF looks like garbage. The color screenshot is particularly nasty when magnified. Why do we put up with this on monitors? We already have CCD cameras that use stacked color pixels. Can't we make monitors with stacked color pixels too? Please?
  • VisualWorks' topic boxes are drawn in an almost invisible gray under the XP look. I fixed this at a customer site years ago, grr!!! Oh well, back to the Windows 2000 look. In any case, the Windows 2000 screenshots look nicer on the PDF because the layout is simpler and there are less bells and whistles to get distracted with.
  • Using LaTeX and MiKTeX, the behavior of \usepackage{graphicx} depends on the driver you use to compile the document. So, for example, if you want dvi output for fast editing because you are using yap, then you have to write \usepackage[dvips]{graphicx} and include encapsulated postscript files. But, if you want to create a PDF you can send to others, then you need to use the pdflatex driver instead of the dvips driver. Hence, you need to change to \usepackage[pdftex]{graphicx}, and include PNG instead. I wrote some macros that choose to append .eps or .png to filenames depending on the compilation environment so I only have to change things in one place. But why isn't this automatic yet? Is there a way to compile with either dvips or pdflatex and have everything work the same?
  • Of course, you don't include JPG with the graphicx package because of the visual artifacts. Moreover, you don't include PDF because using GhostScript to convert the .eps to .pdf results in a .pdf that thinks it's a whole page and that throws layout off (also, if you use PDF, you also have to be careful to tell GhostScript not to crunch the .eps you made from the .png because otherwise you get visual artifacts just like with JPG). Using .ps instead of .pdf results in more or less the same layout issues. Did I miss something here?
  • Including .png files works great, but including .eps failed at first. The error was cryptic... "TeX capacity exceeded, sorry [.1=200000]". Eventually I figured out that ".1" is shorthand for the "[m]aximum number of characters simultaneously present in current lines of open files and in control sequences between \csname and \endcsname". MiKTeX's configuration file parameter for that amount is conveniently called buf_size. Well, yeah... that makes sense now. The .eps files are about 1.7mb, which is more than 200k. Bumping buf_size by a factor of 100 took care of that problem.
  • Finally, why do dvips and pdflatex appear to work, but the result is a white box with the name of the file instead of the actual screenshot? Because the compilation environment for the LaTeX document is draft, and therefore graphicx decides no graphics should be included. However, I'd rather see what's going on to make sure things look good. Fortunately, you can use draft for the document and final for graphicx, like this: \usepackage[final]{graphicx}. It sounds so simple after you find what's going on...
Ok. Now, back to writing. 332 pages so far.

Saturday, July 04, 2009

Getting there

Finally, I can feel it. I am getting close to finishing the first volume of the Fundamentals book. The draft reached 330 pages today, and it's growing very quickly. I should point out that the book will include the first printed material about the Hash Analysis Tool and Assessments. In particular, the Fundamentals book will cover (some of) their sophisticated use of polymorphism. I think the book should be done at 400 pages or so.

Gotta go... I need to write some more now.

Update: 332 pages now, and with figures.