. .

st4u

ST 4U 218: Creating a Non-Visual Part in VA Smalltalk

April 11, 2012 12:22:44.398

Today's Smalltalk 4 You looks at creating a new part (non-visual) using the VA Smalltalk parts editing tools. In the next screencast, we'll use the part created here in a UI. 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:

Parts.

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 create a non-visual part in VA Smalltalk. IN our next tutorial, we'll integrate this part into a visual one. To get started, open the organizer - which opens automatically in a new VA image:

Organizer

Enter an application name, let the rest default, and hit ok. When the Composition editor opens, you can close that - we won't need it yet. Instead, from the defining window, create a new part. Give it a name, and set it to be non-visual:

Part

In the View menu, switch to the public interface editor. We need to add some attributes (instance variables), actions, and events. For the latter ones we'll be using the script editor to add Smalltalk code.

Script Editor

Add length and repeat. For repeat, set the object type to Boolean. Then change the tab (top of the tool) to events - we need to add an event, timerFired:

Events

Next, change the tab to actions, and set up stop and start as actions (they will start and stop the timer):

Actions

Now that we've done all of that, pull down the "File" menu, and select "Generate Default Scripts". You should see the following:

Generate

Generation Options

Hit Ok, and then we can open a browser up and see what we have:

Browser

While you're in the browser, add an instance variable - "timer". That will be the actual timer object. Once we have that, we need to go back to the editor, and change back to the script view. We'll now add some methods for #start, #stop, and #timerFired (the latter being the event that happens when our timer goes off):

Script Editor

The code you'll add is below. For each method, select "New Method Template" from the method menu, and then add the code. You can also just add these in the stock browser; either way, they end up in the same place:

Script Editor


start
	"Perform the start action."

	timer := CwAppContext default
					addTimeout: self length
					receiver: self
					selector: #eventTimerFired:
					clientData: nil.

stop
	"Perform the stop action."
	
	timer notNil ifTrue: [CwAppContext default
	removeTimeout: timer ].

eventTimerFired: anObject
	"Notify other parts that the timer has expired."

	self signalEvent: #timerFired.
	timer := nil.
	self repeat ifTrue: [self start].

That just about wraps it up - version this off in ENVY so we can continue with it later - you've just created a reusable, non-visual part in VA Smalltalk.

Save

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

posted by James Robertson

 Share Tweet This

copyright

Destroy the Internet to Save the Internet

April 11, 2012 8:34:54.148

The MPAA is back to their tried and true approach - if we just destroyed the internet, everything would be fine. Here they are arguing that embedding copyrighted content should be as big a violation as hosting it. There's a problem with both theories, but first, here they are:

"Although there is nothing inherently insidious about embedded links, this technique is very commonly used to operate infringing internet video sites," the organization writes. "Pirate sites can offer extensive libraries of popular copyrighted content without any hosting costs to store content, bandwidth costs to deliver the content, and of course licensing costs to legitimately acquire the content." The MPAA also notes that embedding can enable sites to monetize infringing content by surrounding it with ads.

Let's walk that back to something far more inocuous that would get caught up in that mess. I do a screencast every day. Let's say that when I do one later today, I forget to turn the music off on my other Mac, which is playing songs through my stereo. In the background of the video, you can vaguely hear the music. Now let's say that other people like my demonstration enough that they embed my video on their site.

The MPAA would call my inadvertant use of the music a violation - that's crazy enough. They now want to drag into their net anyone who linked to it, or embedded it. If that view ends up winning it's the end of sharing - how would you ever feel safe linking to anything if the MPAA could come after you over it? And before you say that you could still link if you were careful, consider domains changing - the perfectly nice site you link to today could end up being a content farm tomorrow. They couldn't get SOPA through the legislature, but it looks to me like they want to route the same effect through the courts. Given the level of technical expertise in that arena, we should be very afraid.

posted by James Robertson

 Share Tweet This

blog

Downtime

April 10, 2012 16:37:28.417

Sometime in the next 24 hours, this site is going to go down briefly - my hosting provider is doing a hardware migration, and my VPS is one of the ones being moved. I've backed everything up in case of raw disaster, but I don't really expect any problems - just a slight hiccup while they do the actual move.

Update: It's been done, so things are back to normal.

posted by James Robertson

 Share Tweet This

js4u

JS 4U 147: Event Data

April 10, 2012 10:16:00.706

Javascript 4 U

Today's Javascript 4 You looks at passing data to an event handler 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:

event data

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

posted by James Robertson

 Share Tweet This

games

Can We Get Better Reporters?

April 9, 2012 9:41:29.390

This is so not the issue with the ending of Mass Effect 3:

The company is now devoting all of its efforts to producing an "extended cut" DLC for the summer, but fans expecting a fourth ending where they can watch Commander Shepard on a sun-lounger, margarita in hand had better start complaining now -- the new content will only offer more depth and an extended epilogue to those tragic scenes you've already witnessed.

The issue is far simpler: the endings - based on established canon - render all of Shepard's choices moot, as the destruction of the relays destroys all extant galactic civilizations. Period. as I've said before, BioWare will retcon that - it's all a matter of when. They either do it now, and have some chance of not looking like complete idiots - or they do it later, when it finally dawns on Casey Hudson that future storytelling in the ME setting has been destroyed.

Technorati Tags: ,

posted by James Robertson

 Share Tweet This

st4u

ST 4U 217: Searchlight

April 9, 2012 9:28:28.730

Today's Smalltalk 4 You looks at the Searchlight tools in VisualWorks (also available in 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:

Searching

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

posted by James Robertson

 Share Tweet This

podcasting

No Podcast Tomorrow

April 7, 2012 16:58:07.608

It's Easter, so we'll take a one week break. Enjoy!

posted by James Robertson

 Share Tweet This

smalltalk

Gemstone and Shared Memory

April 6, 2012 20:33:16.806

James Foster explains how to get going with Gemstone and shared memory:

One of the most common problem people have installing and starting GemStone/S is getting shared memory configured properly. This post will discuss shared memory in general and GemStone’s use of shared memory in particular.

Technorati Tags: ,

posted by James Robertson

 Share Tweet This

st4u

ST 4U 216: Screenshots Within VA Smalltalk

April 6, 2012 11:02:31.221

Today's Smalltalk 4 You looks at taking screencaps within the VA Smalltalk environment. 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:

screencap.

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 a simple feature of VA Smalltalk that is easily overlooked: the ability to take screen captures (full or partial) from within VA. That includes the ability to focus on individual windows and widgets. To get started, go to the Options menu in the launcher:

<

screencap

Select the Screen option. If you select a region or window, you'll get a (configurable) delay during which you can bring the desired window to the front. If you decided to capture the entire screen, you should see something like this (using paste into Paint):

screen cap

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

posted by James Robertson

 Share Tweet This

games

Mass Effect 3 Needs Some Retcon

April 6, 2012 10:29:30.255

I see that BioWare has announced some "additional cinematics" to give better endgame closure. That's simply not enough; the ending broke things so badly (and made so little sense) that it really, really needs to be redone.

I just watched the ending again as my daughter finished it; the destruction of the relays is utterly unambiguous. The Normandy fleeing (with people you had in the final battle) makes no sense at all. The only way any of that works is if some variant of the indoctrination theory is what happened. Anything else, and BioWare has shutdown the possibility of further gaming in that setting. Why? Well:

  • The destruction of the relays took out every advanced civilization in the galaxy, including humanity. Those soldiers you saw celebrating on earth? They did that for about two seconds, before earth got vaporized. Sorry Hudson, your existing lore states that a destroyed relay takes out the system - hell, the Batarian's anger over that fact is part of ME3.
  • What few civilized remnants remain on outer colonies are now cut off from galactic trade - no relays, no communication - no home systems to even go back to.
  • Even if the knowledge to rebuild the relays exists, getting them back in place will be the work of centuries, if not milleniums. Never mind that it'll probably be the work of the next cycle's set of races, as this cycle's races were wiped out by the relay destructions.

It's not about having a "happy" ending; it's about having one that makes sense. The one we saw? Outside of Indoctrination, it simply doesn't work. Either BioWare retcons it now, or they do it later when they decide to release a new game in the same setting. They have to do it regardless. Here's what they have to say:

Although some have expressed concern that Bioware could compromise the integrity of its writers' original intentions, co-founder Ray Muzyka claims: “We think we have struck a good balance in delivering the answers players are looking for while maintaining the team’s artistic vision for the end of this story arc in the Mass Effect universe.”

So at this point, the intransigence on the part of EA and Hudson is all about not wanting to look like "they caved to the fans". Guys - you have to retcon the ending eventually, or there's no setting for any future games. Full stop, period. That means you can salvage some small measure of fan (read: future customer) support by doing it now, or you can look as stupid as the Highlander writers did when they did Highlander 2, which was ignored by the subsequent movies and TV show.

Technorati Tags: ,

posted by James Robertson

 Share Tweet This

js4u

JS 4U 146: Detecting an Element Within an Element in JQuery

April 5, 2012 11:03:38.314

Javascript 4 U

Today's Javascript 4 You looks at the has() 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:

has()

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

posted by James Robertson

 Share Tweet This

st4u

ST 4U 215: Toothpick in VA Smalltalk

April 4, 2012 10:01:16.500

Today's Smalltalk 4 You looks at Toothpick for logging in VA Smalltalk. It's a lot like log4s, which we covered in other screencasts. The difference? Tootpick works across all the major Smalltalk dialects. 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:

Tootpick.

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 another look at logging in VA Smalltalk, but we'll use Tootpick - the cross platform logging solution for Smalltalk systems. First, download the ENVY package from Metaprog.

Once you have that, import the .dat file into your repository (see this screencast for an example of doing that). Then load SUnit support - it's an unlisted pre-req for the configuration map:

SUnit

Once you have SUnit it, load the Toothpick config map:

Toothpick

Now we can proceed to use the same code that works in other Smalltalks. First, set up the logger (we'll use a Transcript logger here), and start the logging system:


"create a logger"
logger1 := TranscriptLogger new
			name: 'My first Logger'.

"where do logging events go"
logger1 format: SimpleLoggingFormatter defaultFormat.

"logging policy"
logger1 policy: (LoggingPolicy category: #debug level: #debug).

"register the logger"
(LoggingMultiplexer current)
	addLogger: logger1.

"Start the loggers"
(LoggingMultiplexer current) startAllLoggers.

That sets up the logger. Now we'll use it:


LoggingEvent 
	category: #debug 
	level: #warn 
	message: 'using obsolete protocol'.


A quick look at the Transcript shows that it works as we intended:

Toothpick

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

posted by James Robertson

 Share Tweet This