. .

travel

When it Rains, it Pours, Travel Edition

November 30, 2011 10:38:04.993

When it rains travel annoyances, it pours. After a nice evening with my sister's family, I headed back to the hotel - and my key didbn't work. This isn't unusual; the electronic keys aren't all that reliable. I went downstairs, and the night clerk told me I had only reserved one night. Hmm - my hotwire reservation (and pre-payment) begged to differ. It got sorted out quickly enough, but after the endless saga of Monday's flight, I really didn't need more of that :)

posted by James Robertson

 Share Tweet This

st4u

ST 4U 164: Deleting from a Database with Glorp

November 30, 2011 1:36:13.127

Today's Smalltalk 4 You looks at deleting from a database using Glorp - or more properly, one of the things you need to do in order to have that work. If you want to see how to get Glorp set up on VA Smalltalk, go here. 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:

First Glorp Use.

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 to delete data from a database using Glorp - or more properly, what you have to do in order to have that work. The code we are using is simple:


"deleting"
myEmp := session readOneOf: Emp where: [:each | each firstName = 'Wilma2'].
session delete: myEmp.

Executing that looks like it should work, but it does not. Why? Well, we need to go back to our descriptor, and how we defined the database mapping:


tableForEMP: aTable 
	aTable createFieldNamed: 'first_name' type: (platform varChar: 50).
	aTable createFieldNamed: 'last_name' type: (platform varChar: 50).


We haven't defined a primary key. We can either define something simple (a one up number, perhaps), or tell Glorp to treat one of the columns as a primary key. Without that, Glorp can't locate the unique column that maps to the object. We'll do that in our next 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:
[st4u164-iPhone.m4v ( Size: 2245832 )]

posted by James Robertson

 Share Tweet This

skyrimAAC

Thu'umcast 6: My House, in the Middle of Tamriel... (AAC)

November 30, 2011 1:20:18.037

Thu'umcast

Welcome to episode 6 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

Today we are looking forward to patch 1.2, although there's no evidence that it deals with the Jagged Crown/Season Unending Glitch. After complaining about the patch schedule a bit, we went on to buyg houses, squaring off against giants, and how we've decided that destruction magic may actually be the weakest path to power in the game.

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.

You can subscribe in iTunes (or any podcatcher) using this feed, or this one for the AAC edition. We'll add the iTunes specific links as soon as they are available. In the meantime, join the Facebook Group and follow us on Twitter. If you play on Steam, join the Steam Group. Like the music? Pay Sbeast a visit, we thank him for letting us use it!

Links to all episodes and other information can be found on the Thu'umcast page

.

If you want to download the podcast directly, we've provided it in three formats:

Got feedback? Tweet us!. Enjoy the podcast, and we'll see you in Skyrim!

Technorati Tags: , ,

Enclosures:
[thuum6.m4a ( Size: 13676754 )]

posted by James Robertson

 Share Tweet This

skyrim

Thu'umcast 6: My House, in the Middle of Tamriel...

November 30, 2011 1:19:09.797

Thu'umcast

Welcome to episode 6 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

Today we are looking forward to patch 1.2, although there's no evidence that it deals with the Jagged Crown/Season Unending Glitch. After complaining about the patch schedule a bit, we went on to buyg houses, squaring off against giants, and how we've decided that destruction magic may actually be the weakest path to power in the game.

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.

You can subscribe in iTunes (or any podcatcher) using this feed, or this one for the AAC edition. We'll add the iTunes specific links as soon as they are available. In the meantime, join the Facebook Group and follow us on Twitter. If you play on Steam, join the Steam Group. Like the music? Pay Sbeast a visit, we thank him for letting us use it!

Links to all episodes and other information can be found on the Thu'umcast page

.

If you want to download the podcast directly, we've provided it in three formats:

Got feedback? Tweet us!. Enjoy the podcast, and we'll see you in Skyrim!

Technorati Tags: , ,

Enclosures:
[thuum6.mp3 ( Size: 9973242 )]

posted by James Robertson

 Share Tweet This

travel

One of Those Trips

November 29, 2011 8:38:40.281

It's going to be a tiring week, thanks to yesterday's travel awesome. It was a great flight - they boarded us, and just as the last people were sittingd own, they told us the plane was broken. Off we went, into a 3 hour delay. We left BWI just after 11 (which got us into Dallas after 1 AM). I finally got to the hotel after 2, and - gosh knows why - woke up a few minutes ago.

Is it too early for wine?

posted by James Robertson

 Share Tweet This

js4u

JS 4U 110: Detect the Version of JQuery in Use

November 29, 2011 3:48:28.713

Javascript 4 U

Today's Javascript 4 You looks detecting the version of JQuery that's in use. 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:

version

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

posted by James Robertson

 Share Tweet This

st4u

ST 4U 163: Constructing Queries with Glorp

November 28, 2011 12:38:05.893

Today's Smalltalk 4 You starts executing a few queries against the Emp table we created and mapped here. 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:

Glorp Queries.

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 execute some queries against Oracle using the descriptor we set up - see this video for details on that. First off, we inserted some data so that there would be something to query for:


"create a few more"
listOfEmps := OrderedCollection new.
1 to: 10 do: [:index | | newEmp |
	newEmp := Emp new.
	newEmp firstName: 'Wilma', index printString.
	newEmp lastName: 'Flintstone', index printString.
	listOfEmps add: newEmp
]

"insert them"
session beginUnitOfWork.
listOfEmps do: [:each | session registerAsNew: each].
session commitUnitOfWork.

Now we can execute a few queries. It's worth taking a look at class GlorpSession to get an idea as to the API that's being used here. First, the simplest query - you can #read: any class that's been described in a descriptor:


"query"
emps := session read: Emp.
emps := session readManyOf: Emp.


Those two queries do the same thing - you should see this if you inspect the results:

Glorp Query

You can also include a where clause, but bear in mind the restrictions - in general, you are limited to code that:

  • accesses instance variables
  • compares instance variables using #=, #<, #>, #<>, #isNIL, #notNIL
  • Uses expressions in class ObjectExpression

Note that we use isNIL and notNIL rather than isNil and notNil; Glorp knows how to parse those and create valid SQL (which is what the where block becomes). Here are a few examples:


"where clauses"
session readOneOf: Emp where: [:each | each firstName = 'Fred'].
session readManyOf: Emp where: [:each | each firstName = 'Fred'].
session readManyOf: Emp where: [:each | each firstName = 'Barney'].
session readManyOf: Emp where: [:each | each firstName notNIL].
session readManyOf: Emp where: [:each | each firstName like: 'Wilma%'].

Note the use of #like:, which generates a SQL like statement. Use % rather than * for wildcarding, just as you would with SQL. For that last query, you should see the following results:

where clause

That wraps it up for now - we'll look at removing data 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:
[st4u163-iPhone.m4v ( Size: 7493149 )]

posted by James Robertson

 Share Tweet This

smalltalk

Fuel For Squeak

November 28, 2011 9:17:06.827

Fuel is now available for Squeak.

Technorati Tags: ,

posted by James Robertson

 Share Tweet This

holiday

Podcast Break for Thanksgiving

November 26, 2011 11:23:15.251

No podcast this weekend - too busy with the holiday and birthdays (the entire family has them this month, 2 right around Thanksgiving). We'll be back next week though, so stay tuned :)

posted by James Robertson

 Share Tweet This

holiday

Holiday Break

November 24, 2011 9:57:28.044

It's Thanksgiving, so no screencast today or tomorrow - check the archives for now, and new casts will return next week!

posted by James Robertson

 Share Tweet This

skyrimAAC

Thu'umcast 5: Who Needs a Main Quest? (AAC)

November 24, 2011 3:17:24.015

Thu'umcast

Welcome to episode 5 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

Today we were joined by Madjinn, who has logged an impressive number of hours in the game (averaging 10 per day since it was released :) ). We talked about some of the more glaring quest glitches (including the nasty one for Jagged Crown/Season Unending). We also talked about monster leveling, followers, and how we've been playing our characters.

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.

You can subscribe in iTunes (or any podcatcher) using this feed, or this one for the AAC edition. We'll add the iTunes specific links as soon as they are available. In the meantime, join the Facebook Group and follow us on Twitter. If you play on Steam, join the Steam Group. Like the music? Pay Sbeast a visit, we thank him for letting us use it!

Links to all episodes and other information can be found on the Thu'umcast page

.

If you want to download the podcast directly, we've provided it in three formats:

Got feedback? Tweet us!. Enjoy the podcast, and we'll see you in Skyrim!

Technorati Tags: ,

Enclosures:
[thuum5.m4a ( Size: 26689257 )]

posted by James Robertson

 Share Tweet This

skyrim

Thu'umcast 5: Who Needs a Main Quest?

November 24, 2011 3:16:34.565

Thu'umcast

Welcome to episode 5 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

Today we were joined by Madjinn, who has logged an impressive number of hours in the game (averaging 10 per day since it was released :) ). We talked about some of the more glaring quest glitches (including the nasty one for Jagged Crown/Season Unending). We also talked about monster leveling, followers, and how we've been playing our characters.

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.

You can subscribe in iTunes (or any podcatcher) using this feed, or this one for the AAC edition. We'll add the iTunes specific links as soon as they are available. In the meantime, join the Facebook Group and follow us on Twitter. If you play on Steam, join the Steam Group. Like the music? Pay Sbeast a visit, we thank him for letting us use it!

Links to all episodes and other information can be found on the Thu'umcast page

.

If you want to download the podcast directly, we've provided it in three formats:

Got feedback? Tweet us!. Enjoy the podcast, and we'll see you in Skyrim!

Technorati Tags: ,

Enclosures:
[thuum5.mp3 ( Size: 19513208 )]

posted by James Robertson

 Share Tweet This

st4u

ST 4U 162: Using a Glorp Descriptor

November 23, 2011 9:54:25.655

Today's Smalltalk 4 You starts making use of of the Glorp code we wrote here. 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:

Glorp Use.

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 start using our basic Glorp setup to insert and query data from Oracle. To start out, we need to login and get a session (this uses code we created in the last screencast).


login := Login new
database: OracleODBCPlatform new;
username: username;
password: password;
connectString: 'orcl11g';
yourself.

"login and logout"
accessor := DatabaseAccessor forLogin: login.
accessor login.

"create a session"
session := GlorpSession new.
session system: (EmpSystem forPlatform: login database).
session accessor: accessor.

Now we can create an instance and have it inserted into the database. In the code below, ou would normally use #register: - I used #registerAsNew: to ensure that Glorp would treat my object as a new one bound of the database:


"Now insert one"
emp := Emp new.
emp firstName: 'Fred'.
emp lastName: 'Flintstone'.

"insert"
session beginUnitOfWork.
session registerAsNew: emp.
session commitUnitOfWork.


Note the beginning and ending of the transaction. Now, let's use a query to get the data back:


"login"
accessor := DatabaseAccessor forLogin: login.
accessor login.

"query"
emps := session readManyOf: Emp.

It's worth looking at class GlorpSession for the full API range of what you can do; we'll be exploring some of that in future screencasts. Below are two images - a screencap of the inspector on the queried data, and a sqlplus wind showing the same thing:

data"

sqlplus

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

posted by James Robertson

 Share Tweet This