Today's Smalltalk 4 You continues looking at the basic Smalltalk class libraries in VA Smalltalk - today it's the Delay and Duration classes. 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 look at class Delay and Duration. You'll need these classes anytime you want to set up a timer of some kind in VA Smalltalk (such as in a process that wakes up periodically to do some task). To get started, we want to look at the two classes:
You can use Delay without using Duration; Duration makes it easy to specify a time interval (by second, millisecond, day, or even longer time periods). That makes it easy to specify an interval, and then set up a Delay to wait for that interval. You do that via the #wait message:
"use a duration"
duration := Duration seconds: 10.
ms := duration asMilliseconds.
Transcript show: 'Now: ', DateAndTime now asMilliseconds printString; cr.
(Delay forMilliseconds: ms) wait.
Transcript show: 'End: ', DateAndTime now asMilliseconds printString; cr.
What we did above is specify a duration, and then use that duration as the interval for the Delay. If you look in your Transcript afterwards, you'll see the following:
You can simply specify a number of seconds or milliseconds in Delay, without using a Duration; Duration just makes it easy to set up a time interval:
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.
Welcome to episode 17 of "Thu'umcast" - a podcast where Michael Lucas-Smith, Scott Dirk, Austin Haley, Makahlua and I document our trials and tribulations in Elder Scrolls V: Skyrim
James, Scott and Austin talk about two of the larger side quest lines: No Stone Unturned (the Berenziah stones quest), and the Daedric quests (which lead the Oblivion Walker achievement)
If you liked our work on That Podcast, you'll probably like this. We intend to stay with the same idea - a gameplay podcast. If you don't want spoilers, don't listen - we are going to be talking about how we play the game, and what we ran across as we played.
Welcome to episode 17 of "Thu'umcast" - a podcast where Michael Lucas-Smith, Scott Dirk, Austin Haley, Makahlua and I document our trials and tribulations in Elder Scrolls V: Skyrim
James, Scott and Austin talk about two of the larger side quest lines: No Stone Unturned (the Berenziah stones quest), and the Daedric quests (which lead the Oblivion Walker achievement)
If you liked our work on That Podcast, you'll probably like this. We intend to stay with the same idea - a gameplay podcast. If you don't want spoilers, don't listen - we are going to be talking about how we play the game, and what we ran across as we played.
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.
SOPA (and the Senate version, Protect IP) aren't just a little bad; they make the DMCA look like reasonable legislation. What they set up is a system of prior restraint that would make publishing on the net nearly impossible for anyone but the wealthy and well connected. In what way, you ask?
In an attempt to stop "pirate" sites, the proposed law targets any site that has links to "illegal" content. Over the last few years, I've linked to many, many sites. Commenters have linked to many others. Over time, some of those domains change hands. Sometimes, a domain that was owned by an individual talking about Smalltalk gets bought up by a content farm. Bam - every post and comment that linked there would be a reason to not only shut down my site, but charge me with a felony. Under that kind of regime, who in their right mind would risk linking to anything? In one fell swoop, SOPA attempts to rewind the clock to the push only model of content coming from approved sources.
It gets worse though - using "circumvention" software would also be illegal. The way the law is written, editing your hosts file to route around the damage would be an illegal act.
As part of all this, I'm not going to be posting a screencast (or anything else) today - this post will stay at the top of my site. Back to business tomorrow, but for now - don't just sit there. Help stop this pile of stupid.
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.
I'll be speaking at the STIC conference this year (in Biloxi, Mississippi). My topic? Build tools, of course :) I've been developing a set of tools where I work now (both manual and automated), and I'll talk about how they work, what they do, and why such a thing is usefule.
Today's Smalltalk 4 You takes a look at Blocks 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 look at block closures in VA Smalltalk. To get started, you should browse class Block, and take a look at the hierarchy. Typically, when you create a block, it will be an instance of the first subclass:
Blocks represent a deferred bit of code - a loose method, if you will. They encapsulate pre-compiled behavior that can be passed around and executed later, by using #value (or one of the variants that take arguments). Below is the code we'll be using to explore blocks:
To create a block, simply encapsulate the desired code in square braces. As you can see above, using the [:arg1 :arg2 26 | ] notation, you can specify arguments to the block. To execute, you use:
#value - No arguments
#value: (up to three arguments with #value:value:value)
#valueWithArguments: (passing an array)
You can also specify an action block to execute when the block returns, and this block can (but does not have to) take one argument - the return result from the first block. Blocks, like methods, return the result of the last expression executed.
To see that last part in action, try executing the last statement above - you should see something like the following in the Transcript:
Just try executing each line in the code above, inspecting or displaying the results - make sure you understand how each one of them works, then try a few examples of your own.
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.
Welcome to episode 18 of "Thu'umcast" - a podcast where Michael Lucas-Smith, Scott Dirk, Austin Haley, Makahlua and I document our trials and tribulations in Elder Scrolls V: Skyrim
We talk to Joep Janson, one of the guys behind Bearded Gaming - check them out for live streamed gaming sessions across the video game spectrum. We talk about Joen's 48 hour marathon, Skyrim strategy, and the SkyUI mod. Check out the Bearded Gaming Site to see Joep's work!
If you liked our work on That Podcast, you'll probably like this. We intend to stay with the same idea - a gameplay podcast. If you don't want spoilers, don't listen - we are going to be talking about how we play the game, and what we ran across as we played.
Welcome to episode 18 of "Thu'umcast" - a podcast where Michael Lucas-Smith, Scott Dirk, Austin Haley, Makahlua and I document our trials and tribulations in Elder Scrolls V: Skyrim
We talk to Joep Janson, one of the guys behind Bearded Gaming - check them out for live streamed gaming sessions across the video game spectrum. We talk about Joen's 48 hour marathon, Skyrim strategy, and the SkyUI mod. Check out the Bearded Gaming Site to see Joep's work!
If you liked our work on That Podcast, you'll probably like this. We intend to stay with the same idea - a gameplay podcast. If you don't want spoilers, don't listen - we are going to be talking about how we play the game, and what we ran across as we played.
Welcome to episode 62 of Independent Misinterpretations - a Smalltalk and dynamic language oriented podcast with James Robertson and David Buck.
This week I have another session from ESUG 2011: a web panel including Dale Henreichs, Thomas Holzer, Esteban Lorenzano, Janko Mivsek, and Nicholas Petton.
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!
Welcome to episode 62 of Independent Misinterpretations - a Smalltalk and dynamic language oriented podcast with James Robertson and David Buck.
This week I have another session from ESUG 2011: a web panel including Dale Henreichs, Thomas Holzer, Esteban Lorenzano, Janko Mivsek, and Nicholas Petton.
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!
Today's Smalltalk 4 You looks at processes (and the process model) in Smalltalk, using VA Smalltalk as our 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:
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 processes in VA Smalltalk. That will involve looking at two classes: Process and ProcessScheduler. Class Process is displayed below:
Creating a process is pretty simple - you use a Block, which we looked at in a recent tutorial. You can see the code we used to play with processes below:
To create a process, simply encapsulate the desired code in in a block. Then, rather than executing it with #value (et. al.), fork off the process, as you can see above. In VA Smalltalk, there are 8 priority levels (ranging from 1 to 8 as numeric values) - but you should use the named levels, which you'll find in class ProcessorScheduler:
The reason you should avoid the named levels can be seen in what's happened in other Smalltalk implementations. VisualWorks originally had 8 priorities, ranging from 1 to 8. At some point, the engineering team at Cincom changed that to 100 levels, and remapped the named levels within the new range. Instantiations could do the same with VA; it's best to avoid future problems by using the API.
To see a process execute, try highlighting the code blocks above - you should end up with something like this in the Transcript:
Another thing to keep in mind - the Smalltalk process model uses green (lightweight) threads. That means that each Smalltalk process exists only within the context of the heavyweight VM process; a Smalltalk process is neither an OS level process nor an OS level thread. Additionally, the model is one of cooperative multi-tasking - processes at the same priority level will not yield to other processes of the same priority.
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.