. .

st4u

ST 4U 253: Recover Changes in a Different Pharo Image

July 2, 2012 10:22:44.610

Today's Smalltalk 4 You looks at change recovery in Pharo under the worst circumstances - what if your working image won't start?. 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:

Code Recovery

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:

Technorati Tags: , ,

Enclosures:
[st4u253-iPhone.m4v ( Size: 2222750 )]

posted by James Robertson

 Share Tweet This

st4u

ST 4U 252: Basic Socket Communications in VA

June 29, 2012 11:54:55.145

Today's Smalltalk 4 You looks at simple socket communications, using VA Smalltalk and VisualWorks Smalltalk to set up an example. 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:

TCP.

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 look at using sockets for basic communication in VA Smalltalk. In order to get something real, we'll set up a socket server in VisualWorks, and have VA Smalltalk interact with that. To get started, load the TCP support into VA:

TCP

That loads in the basic support we need. We'll be running two bits of code - the first bit below is in VW, the second, in VA:


"In VisualWorks"
SocketAccessor exampleIPServer.


"get port number from VW Transcript, then run this"
socket := AbtSocketStream openAsClientToHost: 'localhost' port: 49174.
socket nextPutAll: 'hello'.
socket cr.
socket flush.
ans := socket upToEnd.
Transcript show: 'From VW: ', ans; cr.
socket close.


Over in VisualWorks, that sets up a simple server that waits for a string terminated by a CR. We dutifully send that from VA, and then get back a similar string from VW. On both ends, we print the results to the Transcript:

VW Receives

VA Sends/Receives

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.

Technorati Tags: , ,

Enclosures:
[st4u252-iPhone.m4v ( Size: 4566368 )]

posted by James Robertson

 Share Tweet This

st4u

ST 4U 251: Mapping XML to Objects in VA

June 27, 2012 9:10:24.224

Today's Smalltalk 4 You looks at using a mapping specification (in XML) so that the XML parser in VA will return Smalltalk objects rather than an XML document object. 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:

Mapping XML.

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 look at setting up a mapping of XML to Smalltalk objects via a mapping file. We'll still be using the same orders example we've been looking at; this time, we have the additional mapping file:

Mapping

To run this example, use:


AbtXmlBasicSamples mappedExample


and that code looks like this:


	| mappingDOM mappingSpec result |

	self isDataInFile ifFalse: [self setupData].
	self isMapInFile ifFalse: [self setupMap].
 
	" Create a mapping spec from the order map "
	mappingDOM := AbtXmlDOMParser newNonValidatingParser
		parseURI: 'order.map'.   "The image must contain Smalltalk classes conforming to the map."
	mappingSpec := AbtXmlMappingSpec fromMappingDOM: mappingDOM.
 	
	" Parse the data "
	result := AbtXmlMappingParser newValidatingParser
		mappingSpec: mappingSpec; 
		parseURI: 'order.xml'.
	^result abtXmlMappedObject.

What that does is read the mapping data first, to construct a specification - that will be used when parsing the XML in order to get objects instead of a basic DOM object. The results should look like this:

Orders

If you take a look at the mapping XML file, you'll see that it's pretty easy to understand - setting one up yourself would not be a problem.

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.

Technorati Tags: , , ,

Enclosures:
[st4u251-iPhone.m4v ( Size: 4067590 )]

posted by James Robertson

 Share Tweet This

st4u

ST 4U 250: Debug Information in Pharo

June 25, 2012 10:37:20.478

Today's Smalltalk 4 You looks at a few debug/information tips for Pharo, culled from Mariano's site. 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:

tips

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:

Technorati Tags: , ,

Enclosures:
[st4u250-iPhone.m4v ( Size: 5043922 )]

posted by James Robertson

 Share Tweet This

st4u

ST 4U 249: DOMs and DTDs in VA Smalltalk

June 22, 2012 13:36:20.036

Today's Smalltalk 4 You looks at the standard development process using VA Smalltalk and ENVY. 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:

XML and DTD.

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 look at using a DTD in conjunction with an XML document - to get started, you'll want to load the XML Support and XML Examples. Once you've done that, you can have a look at class AbtXmlBasicExample class, and method #saxExample. You'll also see that there are other examples - you should probably have a look at all of them. Try executing the example code

Example

To run this example, use:


AbtXmlBasicSamples maplessExample


That will drop the XML file that's used first, and then execute the XML handling. The results come back this way:

DTD Handling

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.

Technorati Tags: , , ,

Enclosures:
[st4u249-iPhone.m4v ( Size: 3652052 )]

posted by James Robertson

 Share Tweet This

st4u

ST 4U 248: Using a SAX Handler in VA Smalltalk

June 20, 2012 8:07:22.653

Today's Smalltalk 4 You looks at the standard development process using VA Smalltalk and ENVY. 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:

SAX.

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 look at a SAX content handler example - to get started, you'll want to load the XML Support and XML Examples. Once you've done that, you can have a look at class AbtXmlBasicExample class, and method #saxExample. You'll also see that there are other examples - you should probably have a look at all of them. Try executing the example code

Example


AbtXmlBasicSamples saxExample


That will drop the XML file that's used first, which you can see below. It then hooks up the component parts (as explained in the last screencast) to parse the file and get a set of objects back:

XML

Results

To see how that all works, take a look at class JrcOrderContentHandler. This class handles the different XML nodes in the file, and creates the appropriate types of objects as they are encountered. If you look at the customized methods (overrides of the placeholders in the superclass), you can see that it's all done via:

  • Creating the proper instance of an object based on the node
  • Managing the current "filling" of instance variables via a stack
  • Catching the end of the current node to close the current object out and pop it off the stack

Content Handler

You'l also need a class for each kind of object (unless you plan on creating a simple Collection/Dictionary setup, which would be easy enough to do in your handler). Here's one of those classes:

Order

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.

Technorati Tags: , , ,

Enclosures:
[st4u248-iPhone.m4v ( Size: 5422879 )]

posted by James Robertson

 Share Tweet This

st4u

ST 4U 247: SAX Parser Overview in VA SMalltalk

June 18, 2012 8:13:58.217

Today's Smalltalk 4 You looks at the standard development process using VA Smalltalk and ENVY. 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:

SAX.

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 start looking at SAX driver support in the VA Smalltalk XML codebase. What you'll want to take a look at (after loading the basic XML Support) is the class AbtXmlSaxDefaultHandler. When you create your own sax handler, you'll be subclassing this class:

SAX

Take a look at the methods in the category Abt-ContentHandler category - these are the ones you'll be specializing. We'll take a look at a specific example in the next screencast.

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.

Technorati Tags: , , ,

Enclosures:
[st4u247-iPhone.m4v ( Size: 2777104 )]

posted by James Robertson

 Share Tweet This

st4u

ST 4U 246: Parsing XML in VA Smalltalk

June 15, 2012 10:48:41.990

Today's Smalltalk 4 You starts looking into the XML support in VA Smalltalk. 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:

XML.

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 start looking at the XML support in VA Smalltalk - what to load, and how to get started with it. In the Features list, you'll want to load two things:

  • XML Support
  • XML Examples

As a starting point, let's look at the base XML parser - we're going to read in a large XML file (something produced by BottomFeeder).

XML

To get an XML Document, you just need to execute the following (note that we aren't using validation; if you have a schema, you can provide that and turn validation on):


parser := AbtXMLDOMParser newNonValidatingParser.
parser parseURI: 'v:\feeds.xml'.

The argument can be either a file path or URI. You should see something like this if you inspect that:

DOM

That's about it for today - we'll start doing some more involved work with XML over the next few screencasts.

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.

Technorati Tags: , ,

Enclosures:
[st4u246-iPhone.m4v ( Size: 3005626 )]

posted by James Robertson

 Share Tweet This

st4u

ST 4U 245: Pharo Settings in Code

June 13, 2012 11:45:00.074

Today's Smalltalk 4 You looks at the settings code in Pharo - specifically, how do you figure out what the code behind a setting is if you need that?. 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:

Settings

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:

Technorati Tags: , ,

Enclosures:
[st4u245-iPhone.m4v ( Size: 1866175 )]

posted by James Robertson

 Share Tweet This

st4u

ST 4U 244: Finder Examples in Pharo

June 11, 2012 11:09:39.647

Today's Smalltalk 4 You looks at an interesting feature of the Finder in Pharo - if you know what a method does, but can't come up with the name, you still have some options. 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:

Finder Search

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:

Technorati Tags: , ,

Enclosures:
[st4u244-iPhone.m4v ( Size: 3012490 )]

posted by James Robertson

 Share Tweet This

Previous Next (554 total)