. .

st4u

ST 4U 141: Unit Testing in VW

October 5, 2011 8:19:50.536

Today's Smalltalk 4 You looks at SUnit (SUnitToo, actually) testing in VisualWorks. 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:

SUnit in VW

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

posted by James Robertson

 Share Tweet This

smalltalk

Don't serve WAFileLibrary subclasses from Seaside

October 5, 2011 9:19:10.000

James Foster explains how to make the static parts of your Seaside app actually static:

Most of us recognize that static files do not need to be served from Seaside, but it is a step that can be easily overlooked. I was recently helping someone analyze performance for a Seaside application and we found that serving the initial page made 20 Seaside requests, all but one of them for something in /files (i.e., a subclass of WAFileLibrary). In this case it was Scriptaculous, but it could be anything.

Read the whole thing for details.

Technorati Tags:

posted by James Robertson

 Share Tweet This

news

RIP, Steve Jobs

October 5, 2011 22:37:32.866

Sad news tonight - Steve Jobs has died. I guess it's not a huge shock, given that he stepped down from Apple a bit over a month ago. It seemed pretty clear that running Apple was what he wanted to do more than anything else, and he only left when the universe intervened.

There's a huge hole in Silicon Valley with his departure, and, in my opinion, in the world in general. I'd go so far as to say that Steve Jobs brought more joy to more people than just about anyone. He'll be missed.

Technorati Tags: ,

posted by James Robertson

 Share Tweet This

js4u

JS 4U 97: Indexing into JQuery Selector Results

October 6, 2011 7:51:21.155

Javascript 4 U

Today's Javascript 4 You looks at how you can work with collections of JQuery selector results. 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:

Selector Results

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

posted by James Robertson

 Share Tweet This

smalltalk

Instantiations News

October 6, 2011 9:47:34.000

Spotted this on the ESUG mailing list, from Mike Taylor (Instantiations CEO):

Instantiations is very pleased to announce that Smalltalk veteran John O'Keefe has been promoted to Chief Technical Officer of the company. In reality this is a role that John has been successfully filling for a number of years and we decided it was about time to officially recognize his contributions!

Congratulations to John!

posted by James Robertson

 Share Tweet This

smalltalk

ESUG Videos at YouTube

October 6, 2011 13:46:24.000

The videos from 2008 on up are appearing on ESUG's YouTube channel.

Technorati Tags:

posted by James Robertson

 Share Tweet This

st4u

ST 4U 142: Using SQL in VA Smalltalk

October 7, 2011 12:00:33.950

Today's Smalltalk 4 You looks at using VA Smalltalk to interact with a relational database. Today, we add a new table from Smalltalk - to see how to connect, please go back to this tutorial. 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:

Adding a Table.

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 creating a table in VA Smalltalk - to see how to connect, please go back to this tutorial, as we are building on it here.

Once you have a connection to your database set up (with a user who has permissions to make changes), set up your SQL to create a table:

"connects with the alias"
connection := conSpec connectUsingAlias: 'winlocalSpec'.


"define sql"
sqlDef := '(NAME varchar(30) NOT NULL,',
' STREET varchar(20) null,',
' CITY varchar(20) null,',
' STATE varchar(2) null,',
' ZIPCODE int null,',
' PHONE varchar(13) null)'.

This sets up the SQL to create a simple table. Now we need to tell the connection to send it to the database:


"create a table"
table := connection createTableNamed: 'PEOPLE' definition: sqlDef.

At this point, you aren't quite done. Since this is a database change rather than just a query, we need to commit the change:


"commit it"
connection commitUnitOfWork

Finally, after working with your database, make sure you close the connection:


"disconnect"
connection disconnect.

We'll look at querying and binding query results in a future tutorial.

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

posted by James Robertson

 Share Tweet This

news

Ignoring the Thumper Rule

October 8, 2011 11:12:41.070

Wow, it turns out that Stallman is a bigger ass than I thought he was - and I've never thought all that highly of him to begin with. He needs to go watch this video - it's only 11 seconds long, but I expect that he'll need to repeat a few thousand times for it to sink in.

Technorati Tags: ,

posted by James Robertson

 Share Tweet This

smalltalk

Monticello for Amber

October 8, 2011 20:31:04.245

Dale Henreichs talks about the Kaliningrad project, which brings Monticello to Amber.

Technorati Tags: ,

posted by James Robertson

 Share Tweet This

podcast

IM 49: Upgrading a Large VW Application, Part 2

October 9, 2011 20:24:50.555

Welcome to episode 49 of Independent Misinterpretations - a Smalltalk and dynamic language oriented podcast with James Robertson, Michael Lucas-Smith, and David Buck.

This week James and David wrap up their conversation about upgrading a large Smalltalk application - specifically, a VisualWorks 7.6 application being upgraded to VisualWorks 7.8. While the conversation hones in on a number of things specific to that upgrade path, the issues are similar to those any Smalltalk developer will face in an upgrade.

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!

Technorati Tags: , ,

Enclosures:
[im49.mp3 ( Size: 8970408 )]

posted by James Robertson

 Share Tweet This

podcastAAC

IM 49: Upgrading a Large VW Application, Part 2 (AAC)

October 9, 2011 20:25:32.355

Welcome to episode 49 of Independent Misinterpretations - a Smalltalk and dynamic language oriented podcast with James Robertson, Michael Lucas-Smith, and David Buck.

This week James and David wrap up their conversation about upgrading a large Smalltalk application - specifically, a VisualWorks 7.6 application being upgraded to VisualWorks 7.8. While the conversation hones in on a number of things specific to that upgrade path, the issues are similar to those any Smalltalk developer will face in an upgrade.

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!

Technorati Tags: , ,

Enclosures:
[im49.m4a ( Size: 12335602 )]

posted by James Robertson

 Share Tweet This

development

The Tyranny of C Style Syntax

October 10, 2011 8:20:27.946

Dart has been previewed today, and it's, not suprisingly, yet another C-Style programming language. I'll have a look at the language, but I really wish we could get away from curly braces :)

Technorati Tags:

posted by James Robertson

 Share Tweet This

st4u

ST 4U 143: insert and Query in VA Smalltalk

October 10, 2011 10:46:13.927

Today's Smalltalk 4 You looks at inserting data into tables, and querying data from tables, 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:

Insert and Query.

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 inserting and querying data from a database in VA Smalltalk - to see how to connect, please go back to this tutorial, as we are building on it here.

Once you have a connection to your database set up (with a user who has permissions to make changes), you can insert data pretty easily. Get a reference to the table (as we did for creating it), and then create a new row object:


table := (connection openTableNamed: 'PEOPLE').
newRow := table emptyRow.

Now that you have a row, add data (as you would using a dictionary), and then tell the table to add the row. Don't forget to commit the changes:


newRow 
	at: #name put: 'James Robertson';
	at: #street put: 'River Run';
	at: #city put: 'Columbia';
	at: #state put: 'MD';
	at: #zipcode put: 12345;
	at: #phone put: '123-456-7890'.
table addRow: newRow.


"commit it"
connection commitUnitOfWork

Next, we'll query the database for the data we just inserted. Set up a query spec. For simple "select *" type queries, there's a convenience method:


"query"
resultCollection := OrderedCollection new.
querySpec := AbtQuerySpec forEntireTable: table.
result := connection resultTableFromQuerySpec: querySpec.
result do: [:eachRow | resultCollection add: (eachRow)].
^resultCollection first asDictionary

There are a number of things going on there. First, we create a query spec. Then we take the results and gather them into a collection. The results are a collection of AbtRow objects - which is where the #asDictionary API comes from:

AbtRow

You should take a bit of time to browse that class and look at the APIs. What if you want to use arbitrary SQL, and not an implied "Select *"? Use something like this:


resultCollection := OrderedCollection new.
querySpec := (AbtQuerySpec new)
	statement: 'SELECT * FROM PEOPLE'.
result := connection resultTableFromQuerySpec: querySpec.
result do: [:eachRow | resultCollection add: (eachRow)].
^resultCollection first asDictionary.

That pretty much wraps it up for today - we'll look at some more examples next time.

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

posted by James Robertson

 Share Tweet This

smalltalk

GC Improvements For VisualWorks

October 10, 2011 16:56:31.000

posted by James Robertson

 Share Tweet This

js4u

JS 4U 98: The val() Function in JQuery

October 11, 2011 10:44:09.732

Javascript 4 U

Today's Javascript 4 You. Today we look at the val() function 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:

val()

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

posted by James Robertson

 Share Tweet This

development

A More Detailed Look at Dart

October 12, 2011 0:06:50.005

Alan Knight took some time with the new language, and has some fairly detailed thoughts on it.

Technorati Tags:

posted by James Robertson

 Share Tweet This

st4u

ST 4U 144: Updating Rows in a Database using VA Smalltalk

October 12, 2011 9:54:58.155

Today's Smalltalk 4 You looks at updating rows in a database using 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:

Update.

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 updating data in a database using VA Smalltalk - to see how to connect, please go back to this tutorial, as we are building on it here.

Once you have a connection to your database set up (with a user who has permissions to make changes), you can update data pretty easily. First, set up a querySpec for the data you plan to change.

First, let's execute a query to see what we have now:


resultCollection := OrderedCollection new.
querySpec := AbtQuerySpec forEntireTable: table.
result := connection resultTableFromQuerySpec: querySpec.
result do: [:eachRow | resultCollection add: (eachRow)].
^resultCollection first asDictionary

That gives us this, if we inspect the results:

Existing Data

Now let's create a query to grab the data, and change it:


querySpec := (AbtQuerySpec new)
	statement: 'SELECT * from PEOPLE where PEOPLE.ZIPCODE = 12345';
	hostVarsShape: (nil).

Now we'll do the following steps:

  • Get the data from the database
  • Update the data in Smalltalk
  • Copy the data back to the database


oldRow := (connection resultTableFromQuerySpec: querySpec) first.
newRow := (oldRow deepCopy) 
	at: 'zipcode' put: 23456;
	yourself.
table := (connection openTableNamed: 'PEOPLE')
	atRow: oldRow putRow: newRow;
	yourself.


"commit it"
connection commitUnitOfWork

Now we'll do the query again, to ensure that we have done the update:

Updated Data

That pretty much wraps it up for today - we'll look at some more examples next time.

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

posted by James Robertson

 Share Tweet This