. .

st4u

ST 4U 332: Bags and Sets

January 16, 2013 8:20:20.783

Today's Smalltalk 4 You looks at two collection classes, Bag and Set. If you have trouble viewing it here in the browser, you can also navigate directly to YouTube. To watch now, click on the image below:

Collections.

If you have trouble viewing that directly, you can click here to download the video directly. If you need the video in a Windows Media format, then download that here.

You can also watch it on YouTube:


Two of the Collection classes that you might need to know more about are Set and bag. The best way to look at that is via a small example:


| collection c1 |
collection := #(1 1 2 3 4 5 6 6 6 7 8 0 9 9).
c1 := collection asBag.
c1 inspect

Inspecting that gives you this:

Bag

What a Bag does is tell you the count for each unique element in the collection. That can be useful if you don't care about the order, but are interested in the occurrences - like this:


c1 occurrencesOf: 9.

That should give you 2.

Now let's try a Set:


| collection c1 |
collection := #(1 1 2 3 4 5 6 6 6 7 8 0 9 9).
c1 := collection asSet.
c1 inspect

Inspect that, and you'll see:

Set

Sets give you just the unique elements - useful if you want to filter out duplicates.

Need more help? There's a screencast for other topics like this which you may want to watch. Questions? Try the "Chat with James" Google gadget over in the sidebar.

Tags: ,

Enclosures:
[st4u332-iPhone.m4v ( Size: 2738489 )]

posted by James Robertson

 Share Tweet This

smalltalk

Randy Coulman's New Digs

January 16, 2013 22:30:37.178

You can follow Randy's thoughts on Smalltalk, Ruby, and whatever else he's getting into over here.

posted by James Robertson

 Share Tweet This

js4u

JS 4U 237: Partial Image Overlays

January 16, 2013 23:40:32.858

Javascript 4 U

Today's Javascript 4 You looks at embedding an image overlay into a streetmap. If you have trouble viewing it here in the browser, you can also navigate directly to YouTube.

Join the Facebook Group to discuss the tutorials. You can view the archives here.

To watch now, click on the image below:

map

If you have trouble viewing that directly, you can click here to download the video directly. If you need the video in a Windows Media format, then download that here.

You can also watch it on YouTube:

Tags: ,

Enclosures:
[js4u237-iPhone.m4v ( Size: 1867312 )]

posted by James Robertson

 Share Tweet This

general

A Bad Day Averted

January 18, 2013 1:18:07.074

I got home tonight, set up the work laptop and... it failed to boot. Quite often when this kind of thing happens, it's the hard drive (in which case, I would have been off to the local NG shop to get the machine dealt with tomorrow).

Fortunately, you can always look up the diagnostic steps for these things. I found an HP forum with a hard power reset step, and that solved my problem. Which is far better than having to call Texas to make an appointment to visit the IT guys in Linthicum :)

posted by James Robertson

 Share Tweet This

st4u

ST 4U 333: Binary Object Storage in VA Smalltalk

January 18, 2013 11:51:32.923

Today's Smalltalk 4 You looks at the Swapper framework in VA, which can be used to save and restore arbitrary objects to disk in a binary format. If you have trouble viewing it here in the browser, you can also navigate directly to YouTube. To watch now, click on the image below:

Swapper.

If you have trouble viewing that directly, you can click here to download the video directly. If you need the video in a Windows Media format, then download that here.

You can also watch it on YouTube:


Today we'll take a look at how you can easily store objects in a binary format in external files. VA provides the Swapper framework for this, and it's pretty easy to use. Our example uses a simple point, but you can use theSwapper to store arbitrary objects to a file:


"Binary Storage using the Swapper"
 targetObject:= 2@7. 
(stream := CfsWriteFileStream open: 'testfile.swp') isCfsError
	ifTrue: [self error: stream printString]. 
	
"Set to binary mode"
stream isBytes: true.  
dumper := ObjectDumper new.  
dumper unload: targetObject intoStream: stream. 
stream close. 
dumper hasErrorOccurred
	ifTrue: [self error: dumper currentErrorString].

Note the you don't really check for exceptions; that's all done inside the framework. Rather, you check for errors after your code executes. Once you've got the objects on disk, you'll eventually want them back in Smalltalk:


"load the object from the binary file"
 (stream := CfsReadFileStream open: 'testfile.swp') 
	isCfsError   ifTrue: [self error: stream printString]. 
	
"set binary"
stream isBytes: true.  
loader := ObjectLoader new. 
targetObject := loader loadFromStream: stream. 
stream close. 
loader hasErrorOccurred   
	ifTrue: [self error: loader currentErrorString]. 
targetObject inspect.

Execute that, and you should see your Point object:

Point

Need more help? There's a screencast for other topics like this which you may want to watch. Questions? Try the "Chat with James" Google gadget over in the sidebar.

Tags: , ,

Enclosures:
[st4u333-iPhone.m4v ( Size: 3535051 )]

posted by James Robertson

 Share Tweet This

podcast

IM 111: Project Management Blues

January 20, 2013 12:27:30.811

Welcome to episode 111 of Independent Misinterpretations - a Smalltalk and dynamic language oriented podcast with James Robertson and David Buck.

This week Dave and I talked about project management issues - some endemic to the software industry, some particular to Smalltalk projects.

You can subscribe to the podcast in iTunes (or any other podcatching software) using this feed directly or in iTunes with this one.

To listen now, you can either download the mp3 edition, or the AAC edition. The AAC edition comes with chapter markers. You can subscribe to either edition of the podcast directly in iTunes; just search for Smalltalk and look in the Podcast results. You can subscribe to the mp3 edition directly using this feed, or the AAC edition using this feed using any podcatching software. You can also download the podcast in ogg format.

If you like the music we use, please visit Josh Woodward's site. We use the song Troublemaker for our intro/outro music. I'm sure he'd appreciate your support!

If you have feedback, send it to jarober@gmail.com - or visit us on Facebook - you can subscribe in iTunes using this iTunes enabled feed.. If you enjoy the podcast, pass the word - we would love to have more people hear about Smalltalk!

Tags: ,

Enclosures:
[im111.mp3 ( Size: 14400342 )]

posted by James Robertson

 Share Tweet This

podcastAAC

IM 111: Project Management Blues (AAC)

January 20, 2013 12:28:04.948

Welcome to episode 111 of Independent Misinterpretations - a Smalltalk and dynamic language oriented podcast with James Robertson and David Buck.

This week Dave and I talked about project management issues - some endemic to the software industry, some particular to Smalltalk projects.

You can subscribe to the podcast in iTunes (or any other podcatching software) using this feed directly or in iTunes with this one.

To listen now, you can either download the mp3 edition, or the AAC edition. The AAC edition comes with chapter markers. You can subscribe to either edition of the podcast directly in iTunes; just search for Smalltalk and look in the Podcast results. You can subscribe to the mp3 edition directly using this feed, or the AAC edition using this feed using any podcatching software. You can also download the podcast in ogg format.

If you like the music we use, please visit Josh Woodward's site. We use the song Troublemaker for our intro/outro music. I'm sure he'd appreciate your support!

If you have feedback, send it to jarober@gmail.com - or visit us on Facebook - you can subscribe in iTunes using this iTunes enabled feed.. If you enjoy the podcast, pass the word - we would love to have more people hear about Smalltalk!

Tags: ,

Enclosures:
[im111.m4a ( Size: 19900982 )]

posted by James Robertson

 Share Tweet This

st4u

ST 4U 334: Using VisualWorks.ini

January 21, 2013 12:27:02.359

Today's Smalltalk 4 You looks at using VisualWorks.ini to make it easier to launch any version of VisualWorks via the same image file association (Windows). If you have trouble viewing it here in the browser, you can also navigate directly to YouTube. To watch now, click on the image below:

VisualWorks.ini

If you have trouble viewing that directly, you can click here to download the video directly. If you need the video in a Windows Media format, then download that here.

You can also watch it on YouTube:

Tags: ,

Enclosures:
[st4u334-iPhone.m4v ( Size: 4471462 )]

posted by James Robertson

 Share Tweet This

js4u

JS 4U 238: Tilting a Map

January 22, 2013 9:55:18.872

Javascript 4 U

Today's Javascript 4 You looks at tilting a map using the Javascript API. If you have trouble viewing it here in the browser, you can also navigate directly to YouTube.

Join the Facebook Group to discuss the tutorials. You can view the archives here.

To watch now, click on the image below:

tilting

If you have trouble viewing that directly, you can click here to download the video directly. If you need the video in a Windows Media format, then download that here.

You can also watch it on YouTube:

Tags: ,

Enclosures:
[js4u238-iPhone.m4v ( Size: 994557 )]

posted by James Robertson

 Share Tweet This

games

The Elder Scrolls Online Beta

January 23, 2013 8:43:14.715

Looks like Bethesda is opening up the beta for the Elder Scrolls Online.

Tags:

posted by James Robertson

 Share Tweet This

st4u

ST 4U 335: One Shot Breakpoints

January 23, 2013 9:07:31.587

Today's Smalltalk 4 You looks at one shot breakpoints in VisualWorks - invaluable when debugging through parts of the system that are triggered by UI updates or multiple threads. If you have trouble viewing it here in the browser, you can also navigate directly to YouTube. To watch now, click on the image below:

one shot breaks

If you have trouble viewing that directly, you can click here to download the video directly. If you need the video in a Windows Media format, then download that here.

You can also watch it on YouTube:

Tags: , ,

Enclosures:
[st4u335-iPhone.m4v ( Size: 1121638 )]

posted by James Robertson

 Share Tweet This