. .

st4u

ST 4U 374: Using CSV in Pharo (2)

April 24, 2013 8:07:37.215

Today's Smalltalk 4 You continues looking at CSV file formats from Pharo 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:

csv

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:
[st4u374-iPhone.m4v ( Size: 803375 )]

posted by James Robertson

 Share Tweet This

st4u

ST 4U 373: Using CSV in Pharo

April 22, 2013 0:04:19.028

Today's Smalltalk 4 You looks at using CSV formatted files in Pharo. 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:

CSV

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:
[st4u373-iPhone.m4v ( Size: 1264237 )]

posted by James Robertson

 Share Tweet This

st4u

ST 4U 372: GF ST in VA Smalltalk

April 19, 2013 11:11:24.095

Today's Smalltalk 4 You looks at the GF/ST graphics framework - which you can use in VA Smalltalk, and in other dialects as well. 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:

GF ST.

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:


If you need a simple, cross dialect graphics framework, then you should probably have a look at GF/ST. In VA Smalltalk, simply load it from the "Load/Unload Features" UI. Once you've done that, you can have a look at class GFThreeDEditor for some example usage. Try this code:


GFThreeDEditor new open

You can play with the examples in there - here's the cube:

Cube

You'll want to see things in the browser to get an idea as to how they work. Take a look at the Application GFTesting, and its sub app GFTestingES. From there, you can start tracing the drawing code:

Code

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:
[st4u372-iPhone.m4v ( Size: 1122161 )]

posted by James Robertson

 Share Tweet This

st4u

ST 4U 371: Using JSON in Pharo (2)

April 17, 2013 9:23:52.925

Today's Smalltalk 4 You continues looking at the usage of JSON in Pharo. 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:

JSON in Pharo

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:
[st4u371-iPhone.m4v ( Size: 1034110 )]

posted by James Robertson

 Share Tweet This

st4u

ST 4U 370: Using JSON in Pharo

April 15, 2013 10:25:00.781

Today's Smalltalk 4 You looks at using JSON in Pharo 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:

JSON

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:
[st4u370-iPhone.m4v ( Size: 654538 )]

posted by James Robertson

 Share Tweet This

st4u

ST 4U 369: Extending a Class in VA

April 12, 2013 10:45:46.655

Today's Smalltalk 4 You looks at extending an existing class (i.e., adding new methods) in your own application in VA Smalltalk. Doing this allows you to version your changes without making changes to applications delivered by your vendor. 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:

Extensions.

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:


When you're extending a Smalltalk class, there are a few different approaches:

  • Subclass and modify in the subclass
  • Extend an existing class by adding new methods
  • Modify the existing class by changing the existing methods and/or class definition

In VA Smalltalk, doing the third requires you to change the owning (i.e., probably system) application. However, you can add new methods into your own applications easily, and that's what we'll look at today. First, create a new application. Then, in the class pane of the browser, pop up the context menu:

Extension

After you've created the extension, you can add new methods to the class in question. Here, we've added #cubed to Number:

Extension

The important thing to keep in mind is that you can version and release extensions like this without touching the applications delivered by Instantiations. If you can, it's safer to develop in this way. Sometimes overrides are necessary, but they do cause some headaches when it's time to upgrade to a new version from the vendor.

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:
[st4u369-iPhone.m4v ( Size: 1373472 )]

posted by James Robertson

 Share Tweet This

st4u

ST 4U 368: Using Athens

April 10, 2013 9:53:39.785

Today's Smalltalk 4 You looks at teh Athens vector graphics package for Pharo - more specifically, at the nice tutorial that comes with it. 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:

Logging

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:
[st4u368-iPhone.m4v ( Size: 1141202 )]

posted by James Robertson

 Share Tweet This

st4u

ST 4U 367: Command Line Handlers in Pharo

April 8, 2013 10:15:32.267

Today's Smalltalk 4 You looks at command line handling in Pharo - how to set up and work with your own. 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:

Command Line

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:
[st4u367-iPhone.m4v ( Size: 1264241 )]

posted by James Robertson

 Share Tweet This

st4u

ST 4U 366: Errors and Exceptions in VA Smalltalk

April 5, 2013 11:08:53.575

Today's Smalltalk 4 You looks at the difference between exception handling and error handling 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:

error handling.

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:


In most Smalltalk code, you look for exceptions when there's a chance that your code will fail - typically, when dealing with something like file handling. In VA Smalltalk, there are two patterns in use - exceptions, and errors. For some of the system libraries (networking code, for example), you mostly won't see exceptions on failure; you'll get an error object back instead. You need to know what to look for in order to deal with the situation properly. The common Smalltalk pattern might look like this:


"Catch exception"
input := self getValueFromUser.
[10/input]
  on: ZeroDivide
  do: [:ex | ex return: 1].


Here we have code that might get a divide by zero error, and we handle that when it happens. If you use some of the VA libraries, here's the alternative error pattern:


"look for error"
client := (SstHttpClient forTransportScheme: 'http') startUp.
response := client get: 'http://www.5678jnbf.com'.
response isSstError
  ifTrue: [Transcript show: 'Error'; cr].
client shutDown.

Here, we don't get an exception when trying to get a nonsense url (in practice, you would be getting a proper url, but looking out for server errors, socket errors, etc). Here we need to check the response object - is it an actual response, or an error object? This is more akin to the pattern you see in other languages, where you need to check the return value for error codes.

The important thing to keep in mind is that both exist in VA, and you simply need to know which one to look for with the library you are using

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:
[st4u366-iPhone.m4v ( Size: 1079481 )]

posted by James Robertson

 Share Tweet This

st4u

ST 4U 365: DateAndTime in Pharo

April 3, 2013 10:26:57.078

Today's Smalltalk 4 You looks at the DateAndTime class in Pharo. 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:

DateAndTime

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:
[st4u365-iPhone.m4v ( Size: 746713 )]

posted by James Robertson

 Share Tweet This

Previous Next (554 total)