Today's Smalltalk 4 You takes a high level, starting out view of ObjectStudio 8. 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.
Today's Smalltalk 4 You looks at random number generation 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 random number generation in VA Smalltalk. The class you'll want to look at is EsRandom. The common way to get a random number in Smalltalk is like this:
That yields a floating point value with a lot of digits to the right of the decimal place. In many Smalltalks, you end up multiplying that by a number (to put it in the range you want), rounding, and adding one. In VA, there's a nice convenience method, #nextInt: - you give it a value, and you get back a random number between 1 and that value:
Display the results to make sure you get back what you expect - in this case, it should be a value between one and one hundred.
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.
Today's Smalltalk 4 You goes through a simple example - reading and writing a file in binary mode 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 go through a small example - how to write, and read, a simple binary file. To start, let's write a couple of numbers to a file:
Even though we are using the abstract class FileStream, VA picks up the correct concrete subclass when we use the #write: method. Next, we'll want to read the file in binary mode (again, using #isBytes:)
stream := FileStream read: 'testBin.bin'.
stream isBytes: true.
first := stream next.
second := stream next.
stream close.
^Array with: first with: second.
Inspect the results to ensure that you got back what you expect - 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.
Today's Smalltalk 4 You looks at a common problem in Smalltalk development - finding all instances of an object. You can send #allInstances in a workspace and inspect the results, but there's a simpler way in VisualWorks - a menu pick in the browser. 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.
Today's Smalltalk 4 You looks at reading binary formatted files 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 how you open files in binary mode in VA Smalltalk. To get started, look at the code below:
"specify that we are reading characters"
stream := CfsReadFileStream open: 'abt.ini'.
stream isCharacters: true.
text := stream contents.
stream close.
^text.
"specify binary"
stream := CfsReadFileStream open: 'snow1.jpg'.
stream isBytes: true.
bytes := stream contents.
stream close.
^bytes.
You would not typically use #isCharacters: - that's the default. Use #isBytes: to read the raw bytes into a byte array.
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.
Today's Smalltalk 4 You looks at file i/o in VA Smalltalk - starting with the basics. 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 file handling in VA Smalltalk. The simplest way to get started is with FileStream - which doesn't look like it exists. That's because it's an alias for CfsFileStream:
Working with files in VA Smalltalk is fairly straightforward. You send messages to the abstract superclass (CfsFileStream), and, depending on the API, you get back the concrete subclass. You then work with that using standard stream protocol:
"Open a file read only"
stream := FileStream open: 'abt.ini' oflag: ORDONLY.
text := stream upToEnd.
stream close.
^text
"open a file, simpler API
stream := FileStream read: 'abt.ini'.
text := stream upToEnd.
stream close.
^text
"open for writing"
stream := FileStream write: 'test.txt'.
stream nextPutAll: 'This is a test'; cr.
stream close.
Go ahead and try those out (possibly changing the names depending on what files exist in for working directory).
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.
Today's Smalltalk 4 You looks at what you can do when your changes file gets to be absurdly large in VisualWorks (or ObjectStudio). 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.
Today's Smalltalk 4 You looks at some of the more interesting methods in the collection hierarchy. 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 some of the more useful methods in the Collection class hierarchy, and use some examples to illustrate. We're using VA Smalltal, so fire that up and look at class collection:
Select the ANSI-API category, and have a look at the methods - you can count on the ones here being implemented (and implemented this way) across all the major Smalltalks. Some of the methods here are "new" - in the sense that the various vendors have only added them to their distributions in the last few years. Today we'll take a look at some of these methods:
The results of executing each line of code is after each line (using Display from the workspace menu). If you don't follow why, go ahead and experiment with the examples, and debug through them.
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.
Today's Smalltalk 4 You looks at getting started with the VAST Goodies site (and tools). 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 the VAST Goodies site - it's both an example of a VA Smalltalk application (using Seaside), and a useful site for getting (and contributing) community provided Smalltalk code. In order to make use of it, you first need to load the support code into VA. Fortunately, that's easy - it's right in the features tool:
Simply move it over to the right and load - note that all of the pre-reqs get picked up for you:
That gets the tools in - we covered how to make use of them here
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.
Today's Smalltalk 4 You looks at the keyboard shortcuts available in the Nautilus browsre 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:
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.