Minimal image stripper

For those of you not on the VWNC list here is an interesting post from Terry Raymond. He now has 2.2 mb base image which I believe he is using to support Smalltalk scripting type of functionality. The image only supports file-ins and chunck format at that but he stated the he could probably add support for parcels. Apparently, said support may add another 1 mb. I assume that if on Windows we should still be able to use compression and Reshacker to deliver a relatively small exe which matters to some for example those downloading apps from the web or perhaps folks deploying on PocketPC devices etc. If this can be made to support parcels maybe its the start of an SRE (Smalltalk Runtime Environment).

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Hi

There is now a stripper for 7.3.1 in
http://www.cincomsmalltalk.com/CincomSmalltalkWiki/DOWNLOAD/CODE/stripper731.zip

Watch the word wrap.

Read the include readme and follow the instructions to create a
small(2.2mb)
7.3.1 image.

The stripped image does not support parcels.

Terry

===========================================================
Terry Raymond Smalltalk Professional Debug Package
Crafted Smalltalk
80 Lazywood Ln.
Tiverton, RI 02878
(401) 624-4517 traymond@craftedsmalltalk.com
<http://www.craftedsmalltalk.com>
===========================================================

A little black magic, making generic VW constructors

I have been playing with a little Smalltalk black magic to solve a philosophical problem. I believe that my acts should be consistent with my beliefs, not always possible not always what I want at the moment but …

So what is the problem?

I happen to be one of those Smalltalkers that creating setters and getters for every instance variable as a default policy just rubs me the wrong way. Now, please I don’t want to start the 20th billionth debate on this, but to me there is state that is just meant to be private really private and putting an accessor in front of one is like building a bathroom without a door. Not cool.

So then don’t create accessors for everything , you may say?

but how many times do we see instance creation methods i.e. constructors where we do this type of stuff:

MyClass>>>newFor: this and: that
inst := self new.
inst this: this; that: that.


^inst

In this case we need the instance side setters #this: and #that:

Alternatively we could do something like:

MyClass>>>newFor: this and: that
inst := self new.
inst newFor: this and: that.

^inst

Here, I don’t have to create the accessors and therefore leave my instVars private but I still have to create an instance side method to field the incoming args used in the construction of the instance. Annoying, but worse it still does provide a mechanism to mutate instance variables that are meant to be private albeit one can’t just mutate one.

Recently one night I was bored and just decided to come up with something no matter if it was ugly or bad, brainstorm something into creation.

I decided on the following requirements:

  • a generic constructor i.e. a message where I could pass an array of instance variable names / value pairs.
  • only allow for every respective class to be the sole constructor of its instances in this manner

The result would then look something like this:

MyClass>>>newFor: this and: that

” e.g.:

self construct: {‘this’->this. ‘that’->that.}

Now, what the heck is that {stuff …}.

That is, if I recall correctly, something that was borrowed from Squeak by Cincom’s Vassili Bykov and its called Brace Constructors. Don’t have time to get into it right now but it basically one can delimit objects with periods i.e. $. So for example one can do the following:

{1. 5+2. true. self calculateSomething}

Anyhow , back at the ranch.

I’m sure that this looks very strange to most Smalltalkers and I’ll admit that I’m not totally sold yet although it really is convenient. So far so good . I may end up liking it.

Note that the following will not work:

MyClass construct: {‘this’->this. ‘that’->that.}

An exception is raised stating that only “MyClass” can send #construct:.

In the next installment of this article I will cover how that is done and the pros and cons.


Pelrine’s presentation

Another great meeting. Got insights into some of the work that Joseph was involved in i.e. the enhancement of the Sunit framework. As we all know automated unit testing i.e. the Sunit framework which was then the model for Junits and others came out of the Smalltalk world. Personally, I learned a few things. For one, I had never taken the time to learn what TestResources do. In the past I used the TestCase subclass class to build resources that could then be made available for the TestCase instances. TestResources are more flexible and can be shared across different test cases. As has proven to be the case so far the informal discussions that arise at the bar are as interesting as the presentations. It also helps to have a local Smalltalk legend in our midsts to get those historical insights on the Xerox Parc days and the various Smalltalk personalities.

My Plight with Tight, part 2

Previous Article in Series

Today I decided to look into using a minimal desktop manager and only start my VisualWorks application. I therefore changed my $HOME/.vnc/xstartup to look like:

!/bin/sh

# Uncomment the following two lines for normal desktop:
#unset SESSION_MANAGER
#exec /etc/X11/xinit/xinitrc
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
setroot -solid grey
/home/visualworks/scripts/startVWVirgin7_3_1.sh &
xterm -geometry 80×24+10+10 -ls -title “$VNCDESKTOP Desktop” &

twm &

Unfortunately, I found that the window title bars and the desktop manager’s menus were not being setup.

After some struggle I discovered that for some reason starting the vnc desktop i.e.

$ > vncserver :3

after logging in as the user wishing to establish the vnc desktop would cause the problem. Instead if one logs in as root and then does an “su” to log into the user’s account in question, then running the above command will set things correctly. Mind you, one gets a warning about not being able to “lock root’s xauthority” file but it will eventually come back with a successfully established vnc desktop.

For some reason the xterm does not start however one can spawn a new one via the desktop manager’s menu.

Perhaps a more Linux / VNC savvy reader can explain the whys. Typically, if using for example a gnome desktop there are no issues at all with the user’s desktop owner actually issuing the desktop instantiation command. BTW, I also made sure that the twm startup files (usr/X11R6/lib/X11/twm/system.twmrc by default or just .twmrc if under the user’s home directory) specified window borders (ClientBorderWidth “10” ) and even included one under my home directory but again to no avail.

At least the above workaround gets me back on track to what is most important i.e. development using VisualWorks Smalltalk. Hope this helps any other Smalltalker contemplating getting on the same boat with TightVNC or VNC for that matter.

My plight with tight

Next Article in Series

Lately I have been struggling with configuring TightVNC both at work and at home. TightVNC is a spin on VNC (Virtual Network Computing). Think of remote desktops , terminal services etc. The scope included making things work with VisualWorks and making things work in both Linux and Windows. After some pain I found out that there are three ways of using TightVNC:

  1. Like terminal services
  2. Like a remote desktop ( remote control)
  3. Like this private X space you can setup for yourself

Like Terminal Services

If one setups VNC as a xinetd service then the result is that VNC will behave like Windows terminal services. By this I mean that every time one attempts to connect the user is prompted with the Linux desktop’s login screen. These sessions are not “shareable” i.e. their is only one active user which is the user that logged in. Info on how to setup VNC as a “xinetd” service can be found here. On Windows I did not find a way of using TightVNC in a terminal services type of way. Instead, when one connects to a Windows box using TightVNC one is actually on the current Windows desktop i.e. under “remote control” or remote desktop mode.

Like a Remote Desktop

The default when hooking up to a Linux TightVNC server is not to hook up to what is called “display 0” i.e. the current X console running on the box in question. Therefore this means that one cannot right off use TightVNC to support “customer service” scenarios. In our case that works out fine, our users are on Windows PCs and the servers are either on Windows or Linux. So for us TightVNC’s primary purpose will be to connect to TightVNC servers running under Linux. However, if one has to connect to the user’s console i.e. if running Linux then that is apparently possible.

Like this private X space you can setup for yourself

This is to me that most useful mode. Effectively, one setup a private X console/desktop where one can spawn applications. When one exits the TightVNC viewer said private desktop does not go away. Therefore when one reconnects one still has access to the spawned applications. Since said apps are running in an X desktop one then can deploy headful apps with all the necessary GUI based tools which can include partial to full development environments. I know of three companies deploying their Smalltalk apps in such fashion. I also deploy the NYC Smalltalk wiki under VNC. It works great. The capability to debug production issues is greatly enhanced using this strategy.

Security

Neither TightVNC nor VNC are inherently secured. However, one can use SSH tunneling to secure VNC. More information can be found on www.realvnc.com faq. I also saw a readme file on how to use Stunnel to do the same. Also one can use a minimal desktop such as TWM and only spawn the desired applications. TWM just provides the necessary window and user input support i.e. there are no admin tools available such as those found in a Gnome desktop for example. Additionally, the desktop exposed can be under a specific user with very specific rights etc. The TightVNC session does use password authentication and of course one can add authentication at the app level as well.

Other Issues

I thought I had issues with running VisualWorks 7.3.1 from a Linux based TightVNC server. Happy to report that is not the case. Well, I did have a problem with certain images going into a free fall upon startup i.e. they would not get past the splash screen and would just start gobbing up all memory. To be honest I don’t have all my facts worked out. My current theory, is that base virgin images extracted via the Gnome Archive manager somehow become corrupted in such a way that starting them in a VNC session throws them into a loop. Once I replaced the faulty image with the base virgin image that is provided with the VisualWorks installation things just worked fine. BTW, for those who live in Windows most of the time , be aware that there are a couple of extra steps to do in Linux to make an image usable. Read the install.pdf.

Conclusion

I am now quite happy. Connecting to the office in New Jersey from my home in Forest Hills, NYC works quite well. A tad slower but even browsing and working with the development tools feels like almost there. Now, I don’t know how it would work out if I had to connect to the Netherlands but for now VNC is doing everything that I expected it to do and more and it works very well with VisualWorks. I don’t know if TightVNC is really any better than RealVNC but don’t really care either way, at least for now.

Katrina’s sneeze

The picture to the right is of my brother’s backyard after Katrina paid South Florida a visit. Some in that area of Davie/Ft. Lauderdale went without power for almost two days. My brother still has not had his phone service restored. I was able to call my Dad though. Of course, compared to what Lousiana and Missisippi are going through Katrina was merely an inconvenience here. My family including myself lived through Andrew which I belived up to now was the biggest or at least most costly hurricaine to hit the U.S. Andrew was a category 5, Katrina made landfall at category 4 levels but a much bigger storm and therefore a much bigger mess. The nightmare is yet to begin. I was not able to move back into our home for about 10 months. The insurance relief is not quite enough and not very timely. There is a ton of red tape and life does not just wait for you. Whatever plans, goals one may have had may have to be put on hold for a while. Hurricaines are not huge killers at least not in the States but they can very definitely bump you and your plans off path and getting back on track can for many be very difficult.

These things are really getting out of hand, we are already up to the K’s and we have not yet passed Labor day.

Making your filenames work in Linux

So I am in the middle of porting the NYC Smalltalk servers to CentOS. One of the issues that I ran into is that in Windows I setup the “start in” directory for the images (VisualWorks images i.e not gifs, etc) that I launch to be the directory where the image resides. In Linux I did not know how to do this. As a matter of fact, some folks that I know did not know either and build their own mechanism for resolving filenames. However, I want simply for code that worked in Windows to work in Linux without change or without changing the respective file locations.

Basically I wanted for the following to be true:

Given that ‘blah.txt’ exits in the same directory as where the current image exits then the following should be true:

(ObjectMemory imageName asFilename directory) = ‘blah.txt’ asFilename directory.

Well, thanks to one of the member of the VisualWorks Non-Commercial List I was able to to as much. The answer is simple: “change to” the working directory in your shell script to be what you need. This exactly what we do with a Windows shortcut except that in Linux we use scripting. So for example my startup script looks like this:

VISUALWORKS=/apps/visualworks/vw7.3.1

export VISUALWORKS

cd /apps/visualworks/vw7.3.1/image/wiki

/apps/visualworks/vw7.3.1/bin/linux86/visual /apps/visualworks/vw7.3.1/image/wiki/visual.im

Hope this is useful, it sure saved me some headaches.

[Presentation] SUnits and Test Driven Development

Joseph Pelrine will be presenting at NYC Smalltalk on September 14th. Same place same time. A post in comp.lang.smalltalk and the NYC Smalltalk yahoo groups will follow. It will also be announced on our wiki shortly. Anyhow here’s the heads up, it should be an interesting presentation.

Abstract:

Rarely have 3 classes and a handful of methods changed the face of software development more. SUnit, first described in an article published in the October 1994 Smalltalk Report, was an instrumental part of eXtreme Programming and its offshoot, Test-Driven Development. It has also spawned a legion of clones for other languages.

The last few years have seen a number of powerful features added to SUnit, features whose use isn’t all that easy to understand. In this talk, Joseph Pelrine, current maintainer of the Camp Smalltalk Sunit project, will talk about the past and present history of SUnit, the reasons behind the new features, and will show a number of handy tips and tricks which can be used to turbocharge your testing.

Bio:

Joseph Pelrine is C*O of MetaProg, a company devoted to increasing the quality of software and its development process, and is one of Europe’s leading experts on eXtreme Programming as well as Europe’s first certified ScrumMaster Practitioner and Trainer. He has had a successful career as software developer, project manager and consultant, and has spoken about it at such diverse places as IBM, OOPSLA and the Chaos Computer Club. His work in organizational complexity has led him to currently focus his interest on the Cynefin sense-making framework and its application to Agile processes.

CentOS

Its late and I’m tired but I had decided a while back that I was going to port my servers to CentOS and tonite’s the night, everything is going to be all right. Well let’s hope. The cd is cranking but it seems sluggish in taking me through the graphical installation wizard. Ok, it is not happy about something. Maybe the graphical installation option was not the right decision.

Ok, I now opted for the “linux text” installation option and this is going through the options much quicker. This is also the option that I have used in the past with Red Hat. It has that ole Clipper / Paradox look to it. In the meanwhile I had made sure to move my wiki to my other Windows box and change the port forwarding tables on my router. However, I forgot that I had been supporting some of my blog posts images with an Apache server. That directory is now gone i.e. since I clobbered it with the CentOS installation.

I wonder how much of a dent CentOS is making into Red Hat’s Enterprise business. We use RHE at work and so for me it does make sense to use CentOS for my personal needs.

For those of you who don’t know CentOS is basically free Red Hat Enterprise. I don’t like the idea of not paying for things. Yes, I’m weird that way so If CentOS works out for me I’ll probably PayPal them about $50.00 per year. I recently purchased an inexpensive clone with an AMD Semprom board overclocking at I believe 3200, with 512 mb ram for less than $300.00. Its pretty amazing to me that one can very inexpensively setup a viable cluster. Reliability can be a matter of redundancy as opposed to dropping a lot of cash on HP blades.

Ok, the installation is finished. Gnome looks much better from what I recall last. I had switched to KDE sometime ago. What is cool about CentOS is that it has an update service such as RHE.

Now, I just have to get VNC to work from my Win XP notebook to the Linux boxes, install VW , Postgres, Gemstone and look into switching from SmallWiki to the WikiWorksForSSP framework. Not tonite. I keep nodding off , I’ll go to bed once I confirm that the packages updated without issue.

The Guy Upstairs and his DNAs

Mike has what seems to me to be a very cool job and yet it can get very morbid. I first met Mike the Spring before 911 when he and his wife moved in upstairs. Mike works for a DNA lab/consulting outfit and it was his firm that ran the mammoth job of trying to identify via DNA the remains of all the poor souls that lost their lives on that horrible day. Well, that took what seemed forever to me but the gory truth is that there were a lot of samples to identify. Then the Tsunami hit which dwarfed the death toll of 911 and yes Mike was sent to Thailand to help with that. A different problem though the DNA was really spread out and most of it at sea.

I bumped into Mike yesterday as I was taking off my shoes before going into the house after throwing the ball at the park with my Rhodesian Ridgeback. I said to him , “ I noticed you all took a little vacation last week.” “Oh no” he replied , “I was sent to London to work on the bombings” . “What is this with you following death” , he smiled “death follows me”.

And yet I would love to build an app to help with this. Ever since I read about Watson and Crick’s work I have been fascinated with anything related to DNA.

As far as Mike I wonder if he has nightmares or is he now just jaded?