ST 4U 196: Raising Exceptions in VisualWorks
Today's Smalltalk 4 You looks at using exceptions (raising them) in VisualWorks 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:
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: smalltalk, visualworks, exceptions
Enclosures:
[st4u196-iPhone.m4v ( Size: 3916412 )]
JS 4U 133: Data Linking
![]() |
Today's Javascript 4 You looks at data linking in JQuery. 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:
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: javascript, jquery, tutorial
Enclosures:
[js4u133-iPhone.m4v ( Size: 3083073 )]
ST 4U 197: A Simple HTTP Server in VA Smalltalk
Today's Smalltalk 4 You looks at implementing a very simple HTTP server in VA Smalltalk. If you do this yourself, you would actually want to create some objects, not just use the code snippet below. 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:
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 setting up a simple HTTP server in VA Smalltalk. Bear in mind that for any "real" task you would want to create some classes of your own; this example will be enough to get you started. The code you'll want to use is below:
| server handler result | handler := DirectedMessage receiver: [:request :response| |htmlStream htmlResponse| htmlStream := WriteStream on: (Locale current preferredStringClass new: 128). htmlStream nextPutAll: ''. request header sstHttpStringOn: htmlStream. htmlStream nextPutAll: ''. htmlResponse := htmlStream contents. response header: (SstHttpResponseHeader new status: SstHttpConstants::HttpOk; version: request header version; contentLength: htmlResponse size; yourself); contents: htmlResponse; yourself] selector: #value:value:. (result := (server := SstBasicServer new) addHandlerUrl: 'http://localhost:9988') isSstError ifTrue: [result raise]. server requestHandler: handler. (result := server startUp) isSstError ifTrue: [result raise]. server inspect "-- When finished, send #shutDown"
This code does a couple of things. First, it uses DirectedMessage to set up a response handler - something to deal with each inbound request. In our case, it's a simple block that spits out some basic header type information as the body of the response. This is the part where you would want to customize; it's pretty easy to see how you could generalize this example for some ad hoc application status reporting
After that, we set up the actual server as an instance of SstBasicServer. Again, for an actual application, you'll want to create your own class for the server. In our case, we specify the port, some basic error handling (note the use of #isSstError), and start the server. As with HTTP client usage, we use #startUp - and eventually, when we want to shut it down, #shutDown.
Execute the code above - you should see something like this:
Now, open up a browser on your server (assuming you are running it now), and you should see something like this:
Finally, using the workspace attached to the inspector, send #shutDown to the server - you should see something like this:
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: smalltalk, va smalltalk, http
Enclosures:
[st4u197-iPhone.m4v ( Size: 5909667 )]
JS 4U 134: Unlinking Data
![]() |
Today's Javascript 4 You looks at the flip side of linked data (something we looked at last time) - unlinking. JQuery. 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:
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: javascript, jquery, tutorial
Enclosures:
[js4u134-iPhone.m4v ( Size: 2516293 )]
Pharo and Arduino
Now you can work with the hot hobbyist tools in Pharo.
ST 4U 198: Raising Exceptions in VA Smalltalk
Today's Smalltalk 4 You looks at raising exceptions 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:
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 raising exceptions (either your own or existing ones already defined) in VA Smalltalk. We'll use a somewhat artificial example to demonstrate:
var1 := 10. var2 := '2'. (var1 isString or: [var2 isString]) ifTrue: [MessageNotUnderstood signal: 'Cannot Add Strings'] ifFalse: [var1 + var2].
This code raises the MessageNotUnderstood exception when it sees that we are trying to add a string to a number. The larger point is that this is how you raise an exception in VA (or most other Smalltalks) - see class Exception for the full range of API options.
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: smalltalk, va smalltalk, exceptions
Enclosures:
[st4u198-iPhone.m4v ( Size: 3535827 )]
The Fading Blackberry
In response to a user who asked about a possible Netflix app for the BlackBerry Playbook tablet, Netflix's Twitter support account replied that the company has no current plans to support BlackBerry devices, including the Playbook.
Most people don't want two phones/tablets (one for work, one for personal use) - they want one. Given that, this kind of thing makes the path in front of RIM pretty darn hard to thread....
Pharo and Seaside Get Faster
Phillippe Marschall posted some interesting numbers on Seaside optimation work:
After some optimizations in both Seaside and AJP I managed to break 8000 requests / sec with a single Pharo 1.3 image. Thanks to SystemProfiler I knew where to look. This is with a single request handler that just returns a two byte response. It doesn't involve any rendering, sessions, continuations or whatsoever but it kicks on the full Seaside request handling machinery with a request context and everything.
It would be interesting to see how many requests a more "normal" set of pages could handle, but this sounds pretty cool.
IM 67: Have Objects Failed Us?
Welcome to episode 67 of Independent Misinterpretations - a Smalltalk and dynamic language oriented podcast with James Robertson and David Buck.
This week Dave and I talked to Dave Thomas (of OTI fame) on the broad topic of whether "objects have failed us". That came up based on a thread floating between the Squeak and VWNC mailing lists recently. After the chat, Dave sent us a PDF presentation he's given on this topic.
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!
Enclosures:
[im67.mp3 ( Size: 12096411 )]
IM 67: Have Objects Failed Us? (AAC)
Welcome to episode 67 of Independent Misinterpretations - a Smalltalk and dynamic language oriented podcast with James Robertson and David Buck.
This week Dave and I talked to Dave Thomas (of OTI fame) on the broad topic of whether "objects have failed us". That came up based on a thread floating between the Squeak and VWNC mailing lists recently. After the chat, Dave sent us a PDF presentation he's given on this topic.
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!
Enclosures:
[im67.m4a ( Size: 16610418 )]
ST 4U 199: HTTP in Pharo
Today's Smalltalk 4 You looks at using HTTP 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:
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:
Enclosures:
[st4u199-iPhone.m4v ( Size: 2976117 )]
The Bleeding Edge: Nautilus in Pharo
Mariano has a nice step by step discussion of how and why to give the Nautilus browser a try in the leading edge Pharo environments