. .

gadgets

More XBox Rumors

June 14, 2010 6:45:32.276

Ahead of E3, lots of rumors are flying about what Microsoft will announce - there's been a story pulled from USA Today, alleging that Natal has been renamed Kinectic (does that mean that a release date for it is imminent?). This stuff sounds more based on reality:

But the other rumor circulating involves a diet-sized Xbox 360 (slim!) with a 250GB hard drive and integrated WiFi. Now that's something to get excited about. If it pans out, anyway.

Based on the pains I've been going through to get my XBox on the network in my exercise room, that sounds good :)

Technorati Tags: ,

posted by James Robertson

 Share Tweet This

tv

Winter is Coming

June 14, 2010 6:51:03.286

SciFi Wire has a (to short!) trailer from HBO for their upcoming adaptation of "A Game of Thrones". Now if only Martin would get book 5 out...

Technorati Tags: ,

posted by James Robertson

 Share Tweet This

smalltalkDaily

Smalltalk Daily 06/14/10: Inlining Methods

June 14, 2010 8:19:22.871

Today's Smalltalk Daily looks at how to inline a method within a class. Doing this will not remove the original method, as other classes may have code that references the original method. You can watch it on YouTube right now, or follow this link to the video.

You can follow the Smalltalk channel on YouTube for all the "Smalltalk Daily" videos. You can also check out the videos on Vimeo, where the quality is higher, or over on Facebook, if you are a member.

You can download the video directly here. If you like this kind of video, why not subscribe to "Smalltalk Daily"?

Technorati Tags: , , ,

posted by James Robertson

 Share Tweet This

smalltalk

Javascripted Anchors in Seaside

June 14, 2010 9:08:54.543

When I updated the Seaside tutorial, I ran into an interesting change from Seaside 2.8 - the way anchors work when you have an onClick Javacript action. If you don't include an #url: call with some string, you don't get an anchor. In Seaside 2.8, that wasn't the case - look at the code in WAAnchorTag in 2.8:


with: aBlock
	url isNil
		ifTrue: [
			((self attributes includesKey: 'href') or: [ self attributes includesKey: 'name' ])
				ifFalse: [ self attributes at: 'href' put: 'javascript:void(0)' ] ]
		ifFalse: [ self attributes at: 'href' put: url ].
	super with: aBlock


And now look at the 3.0 version:


with: aBlock
	url isNil
		ifFalse: [ self attributes at: 'href' put: url ].
	super with: aBlock

There was an explanation (I missed it; I don't track the Seaside mailing list that closely):

We removed that because it was causing unwanted side-effects in some cases. I suggest that you create your own #onClick: method that sets the 'href'.

However, for many applications (most, I daresay), it's simpler to just restore the 2.8 behavior. If you don't, you need to do something like this (note the usage of #url: below):


renderContentOn: html

	html paragraph: 
			[(html anchor)
				onClick: ((html jQuery: #count) load
							html: [:h | h render: (count := count - 1)]);
				url: '#'; 
				with: '--'.
			(html span)
				id: #count;
				with: count.
			(html anchor)
				onClick: ((html jQuery: #count) load
							html: [:h | h render: (count := count + 1)]);
				url: '#'; 
				with: '++']

Before you can get the anchor to render. You need to do the same using older Scriptaculous/Prototype code - because the change is in the way anchors render. When I do screencasts on JQuery in seaside, I won't be including this change; I don't want to force people down that path. However, I think it's useful to know. Hat tip to Boris Popov for pointing me in the right direction on this stuff.

Technorati Tags: , ,

posted by James Robertson

 Share Tweet This

smalltalk

Seaside Tutorial with JQuery

June 14, 2010 10:16:09.246

I've added a new segment to the Seaside Tutorial - using JQuery for the Ajax calls instead of Scriptaculous. Tomorrow's screencast will add a video covering the same topic.

Technorati Tags: , ,

posted by James Robertson

 Share Tweet This

webVelocity

Using WebVelocity on Amazon

June 14, 2010 13:29:26.000

Ian Prince has some notes on using the Amazon ec2 WebVelocity image (1.1 Beta) we made available over on the WebVelocity list. Worth reading if you intend to give it a try.

Technorati Tags: ,

posted by James Robertson

 Share Tweet This

culture

Third Place Race

June 14, 2010 17:07:41.386

Starbucks wants to be your third place:

At Wired’s Business Conference in New York City, Starbucks’ Howard Schultz announced that the coffee giant is now offering free Wifi to customers beginning July 1.

That's a cool idea - it'll certainly make me look for Starbucks shops when I travel.

Technorati Tags:

posted by James Robertson

 Share Tweet This

smalltalk

Etoys on the iPad

June 15, 2010 6:37:04.105

Bert Freudenberg has Etoys (in Squeak) ported to the iPad. Whether it ever makes it past the app store hurdles in front of it probably depends on what happens with Scratch. I embedded Bert's YouTube video below:

Technorati Tags: , ,

posted by James Robertson

 Share Tweet This

smalltalkDaily

Smalltalk Daily 06-15-10: Seaside Tutorial (13)

June 15, 2010 7:55:35.528

Today's Smalltalk Daily is part 13 of our updated Seaside tutorial, for VW 7.7/OS 8.2 and Seaside 3.0. The tutorial home page is here. Today we go back to lesson 8 of the Seaside tutorial, and change our Ajax usage from Scriptaculous to JQuery. If you're picking things up here, grab the work in progress to this point, and the download the domain model being used. You can watch it below, or go directly to YouTube here>.

You can follow the Smalltalk channel on YouTube for all the "Smalltalk Daily" videos. You can also check out the videos on Vimeo, where the quality is higher, or over on Facebook, if you are a member.

You can download the video directly here. If you like this kind of video, why not subscribe to "Smalltalk Daily"?

Technorati Tags: , , ,

posted by James Robertson

 Share Tweet This

copyright

Three Strikes, One Awesome

June 15, 2010 8:10:24.781

France enacted a "three strikes" law for digital copyright violations, so one of the ISPs there started offering a service (2 euros a month) to sit on user PCs (Windows only) and monitor for p2p activity. That's when the stupid started to pile up. The application periodically pings a server for updates - people looking into it found out that it's a Java servlet listening. However:

Nothing too out of the ordinary there except that all information is not only being transmitted in the clear but all information on that server is public (via http://195.146.235.67/status), meaning that every user had their IP addresses exposed to the public. But it doesn’t stop there.

It gets worse - hackers can apparently use the client apps to inject malware onto end user systems. This is what happens when you decide to solve a "problem" (p2p copyright violations) with complex "solutions".

That server doesn't seem to be accessible anymore, but go ahead and read the story - it's just too funny in a pathetic kind of way.

Technorati Tags: ,

posted by James Robertson

 Share Tweet This

blog

Wages of Technorati

June 15, 2010 8:34:02.191

Apparently, I need to toss this into a visible post: VNFTCYW39SMP

So that Technorati can tell that this is, in fact, my blog :)

posted by James Robertson

 Share Tweet This

humor

Self Defense for Software Developers

June 15, 2010 8:44:06.901

Now this is funny :)

posted by James Robertson

 Share Tweet This

gadgets

Temptations

June 15, 2010 14:14:17.637

I apparently qualify for an upgrade at cost - i.e., I'd only have to pay for the new iPhone. I've been on the Apple and AT&T sites multiple times today, pondering :)

Technorati Tags: ,

posted by James Robertson

 Share Tweet This

gadgets

iPhone as Mac Redux?

June 15, 2010 21:23:09.761

Some of the statistics make it look like the iPhone/Android battle may be shaping up to be a new version of the Mac/PC battle:

From May 2009 to May 2010, Quantcast finds, Apple's share of the mobile market slipped 8.1 percent. In that same time span, Android's market share jumped up by 12.2 percent. And remember: These numbers don't even take into account the HTC Droid Incredible or HTC EVO 4G, both of which have been selling like hotcakes, nor do they factor in piqued interest in older Android phones thanks to Google's new Android 2.2 upgrade.

There are significant differences though - Apple has the app store and a lot of good apps; the Android app situation is progressing, but it's not the same seamless experience - yet. I don't know that it's a sure bet that history will repeat, but if Apple doesn't pay attention - over the air updates, easing up on some of the sillier app store rules - they may paint themselves into a corner they can't escape from.

Technorati Tags: , , ,

posted by James Robertson

 Share Tweet This

development

When You Need to Scale

June 16, 2010 6:34:16.870

I'm a big fan of only adding scaling to a system when you need it - but there are times when you know that you are going to need it. Like, say, yesterday, with the Apple/At&T iPhone pre-ordering system:

They're just using some web interface, not the exact same customers are using online, but not much better. It's probably the same servers. Basically, they were getting one pre-order thru every 20 minutes. They said the problem was system wide. Here's how it worked: They just kept mashing on the 'submit' button and getting error after error. On the umpteenth try, it'd go through and then the next step, whatever that was, would get error after error. After a long time, it would finally go through. What's worse is that the first step of the process reups your 2 year contract, so you can't walk away if you get fed up. I had to stick around until it went through, or i'd have a new contract but no subsidized phone.

I ran into that myself - and the error message from the Apple site probably confused some people. The site told me that there was an error at the point where I entered my Apple ID. That made me wonder, so I pulled out my existing iPhone and asked it to update a bunch of apps - just to get prompted for my password. I hadn't entered anything wrong; it was just the servers having problems.

This isn't a new thing, either - you would think that Apple and A&T would be ready for this by now.

Update: Well, it seems that AT&T didn't bother to test the new system:

As the iPhone 4 preorder disaster worsens by the minute, the blame looks to fall squarely on AT&T's shoulders as we learn more about what went wrong. The most damaging of these may be an source close to the carrier which now claims the system which AT&T was not tested before the launch.

Awesome.

Technorati Tags: , ,

posted by James Robertson

 Share Tweet This

gadgets

More on the iPhone

June 16, 2010 7:02:43.703

Even with all the problems, I guess I'm glad that I pulled the trigger last night - 9 to 5 Mac is reporting that new pre-orders are backing delivery up into July.

Technorati Tags:

posted by James Robertson

 Share Tweet This

smalltalkDaily

Smalltalk Daily 06/16/10: Mini Aggregator

June 16, 2010 8:58:23.229

Today's Smalltalk Daily looks at how to create a "mini feed" from a set of RSS/Atom feeds. You can watch it on YouTube right now, or follow this link to the video.

You can follow the Smalltalk channel on YouTube for all the "Smalltalk Daily" videos. You can also check out the videos on Vimeo, where the quality is higher, or over on Facebook, if you are a member.

You can download the video directly here. If you like this kind of video, why not subscribe to "Smalltalk Daily"?

Technorati Tags: , , ,

posted by James Robertson

 Share Tweet This

science

We Don't Know What We Don't Know

June 16, 2010 15:16:08.437

This story out of New Scientist about the sun is one of the reasons I get skeptical about anything premised with "the scientific consensus is...". It appears that we don't know what we don't know, at least about the sun:

But for the past two years, the sunspots have mostly been missing. Their absence, the most prolonged for nearly a hundred years, has taken even seasoned sun watchers by surprise. "This is solar behaviour we haven't seen in living memory," says David Hathaway, a physicist at NASA's Marshall Space Flight Center in Huntsville, Alabama.

The thinking had been that after the (somewhat prolonged) solar minimum, sunspots (and solar storms, which could cause grief for power systems on earth) would be back with a vengeance. However, they aren't, and no one seems to understand why. This part is what should give people pause:

Even with the solar cycle finally under way again, the number of sunspots has so far been well below expectations. Something appears to have changed inside the sun, something the models did not predict. But what?

Models are useful, but they depend on data - the more data, the better the model tends to be. What if you only have partial data? Or worse, what if you aren't even sure what data you still need? In fields like this - solar weather - the models obviously need more data before they can be fully accurate. That's not anyone's fault; it's not as if we know how to send a probe into the sun and have it transmit data. It should give us pause about any scientific field that relies too heavily on models that are derived from partial data though...

Technorati Tags: ,

posted by James Robertson

 Share Tweet This

games

Civ 5

June 16, 2010 19:31:02.521

Civilization 5 looks cool - and the video I embedded below is drawing me back in....

Technorati Tags: ,

posted by James Robertson

 Share Tweet This

smalltalkDaily

Smalltalk Daily 06/17/10: JQuery in WebVelocity 1.1

June 17, 2010 8:14:22.413

Today's Smalltalk Daily looks at a simple JQuery based Ajax example in WebVelocity 1.1 (beta). You can watch it on YouTube right now, or follow this link to the video.

You can follow the Smalltalk channel on YouTube for all the "Smalltalk Daily" videos. You can also check out the videos on Vimeo, where the quality is higher, or over on Facebook, if you are a member.

You can download the video directly here. If you like this kind of video, why not subscribe to "Smalltalk Daily"?

Technorati Tags: , , , ,

posted by James Robertson

 Share Tweet This

webVelocity

WebVelocity 1.1 Beta Info

June 17, 2010 8:58:13.983

I have all the details on my Cincom blog

Technorati Tags: ,

posted by James Robertson

 Share Tweet This

science

Cell Phones, RF, and Health

June 17, 2010 13:50:28.403

It sounds to me like the mobile phone field is still moving to quickly to get definitive data - the studies on cell phones and brain tumors were all done in a largely (gone now) analog spectrum phone world:

Unfortunately, there were flaws and vagueness in the Interphone study, starting with the fact that it was based on cell phone use six years ago and out of date compared to today's 3G-class phones. This enabled the CTIA to cite it as evidence that cell phones were not a definitive factor in cases of brain cancer.

Then we had 2G digital for a bit (still do), and 3G, while mature, is still rolling out. 4G (LTE) is right around the corner. Nothing has been in the field long enough for a longitudinal study to yield useful numbers. Even if 3G and LTE settle down and stick for awhile, you'll still have to wait for years before there's enough data. As I was saying on a different topic yesterday, we just don't know what we don't know...

Technorati Tags: , ,

posted by James Robertson

 Share Tweet This

advertising

Living in 1990

June 17, 2010 20:51:24.039

I love this take on the effectiveness of newspaper ads, as compared to social media/web stuff:

I can choose to place an ad in the New York Times if my target is nationwide or in my town’s paper if it is locally relevant. I can direct (control) who sees my ad. The folks following me on Twitter are from all over the world. As far as I know, there isn’t a simple way to reach only the those in a particular market. Nor do I currently have a strong enough local base of followers. I would need to find someone else local with a bunch of followers and hope they’d re-tweet for me.

The targeting thing is only partly correct. Why? Well, what are the circulation numbers? What's the demographic uptake? At least in the US, the readership for printed news drops through the floor the lower the age bracket gets.

The better question is, would traditional ads do you much good anyway? I still think most advertising is a shared fiction, where the buyers and sellers agree to pretend that something useful is happening.

posted by James Robertson

 Share Tweet This

development

Maybe Email Addresses?

June 18, 2010 6:36:57.930

Patrick McKenzie explains why everything you think you know (as a software developer) about names (personal names, not variables) is wrong. While email addresses don't share all of those problems, it's not safe to assume that everyone who goes into your system will have one...

posted by James Robertson

 Share Tweet This

smalltalk

Cuis 2.4 Ships

June 18, 2010 6:52:06.620

Juan Vuletich just released Cuis 2.4:

Cuis 2.4 is available at www.jvuletich.org/Cuis/Index.html.

New in Cuis 2.4

  • Adaptive Morphic CPU usage. Saves a lot of CPU on servers running many images.
  • Compiler update with Eliot's fixes
  • Configurable underscore meaning (from Squeak)
  • Enable / disable Shout in Workspaces
  • Big speedup of BW PNG
  • Many minor fixes and cleanup

We interviewed Juan on Industry Misinterpretations about Cuis awhile back. He's also on last week's podcast in his role on the Squeak board, and will be on the upcoming (episode 193) episode as well (it was a 2 parter)

Technorati Tags: ,

posted by James Robertson

 Share Tweet This

smalltalkDaily

Smalltalk Daily 06/18/10: Immutable Literals

June 18, 2010 7:51:58.843

Today's Smalltalk Daily looks at immutable literals in Smalltalk - and how to deal with legacy code that does not know about immutability. You can watch it on YouTube right now, or follow this link to the video.

You can follow the Smalltalk channel on YouTube for all the "Smalltalk Daily" videos. You can also check out the videos on Vimeo, where the quality is higher, or over on Facebook, if you are a member.

You can download the video directly here. If you like this kind of video, why not subscribe to "Smalltalk Daily"?

Technorati Tags: , ,

posted by James Robertson

 Share Tweet This

smalltalk

Using My Own Stuff

June 18, 2010 9:46:55.212

I did a screencast on the mini-aggregator code recently - it allows you to specify a set of feeds (possibly with content filters), and push out an output set of links. I thought it might be nice to actually start using that - so over on the sidebar, you'll notice a new section titled "Related". Under that I have a set of the most recent (only 1 deep) posts from some of the Smalltalk blogs I read. It auto-updates via cron every fifteen minutes, so it should stay current.

Technorati Tags: ,

posted by James Robertson

 Share Tweet This

gadgets

Microsoft is not in the Mobile Game

June 18, 2010 11:33:30.000

This story explains why Microsoft isn't in the mobile game at all. Not long after touting Windows Phone 7 as the next big thing, they've announced Windows Mobile:

The company has previously announced the Windows Phone 7 OS for smartphones. Microsoft's focus on consumer mobile devices will continue through the Windows Phone brand, Kelley said. It's unclear if the Windows Embedded Handheld announcement means that Windows Phone 7 will not support enterprise capabilities originally promised for that OS, or if Windows Embedded Handheld and Windows Phone 7 will compete with each other for business users.

It's becoming clear to me, at least, that the rot at MS starts at the top. Ballmer is a sales guy with no grasp of what his company does, or of where the industry is headed. He needs to go - and whoever they replace him with should start by radically downsizing the company. If it's big enough to come out with this kind of confusion, it's too big.

Technorati Tags: ,

posted by James Robertson

 Share Tweet This

games

Video Game Suggestions

June 19, 2010 11:20:28.950

I finished a second run through of Mass Effect 2 last night; now I'm looking for a new plot driven game to get. Any suggestions? Alan Wake looks interesting, but I'd love to hear from anyone who's actually played it.

Technorati Tags: ,

posted by James Robertson

 Share Tweet This

copyright

Copyrights and Stupidity

June 19, 2010 12:53:33.853

It's getting to the point where I'm wondering whether copyright law has any value at all. Witness this idiotic proposal from Germany:

It looks as if publishers might really be lobbying for obtaining a new exclusive right conferring the power to monopolise speech e.g. by assigning a right to re-use a particular wording in the headline of a news article anywhere else without the permission of the rights holder.

I can see it now - the literary police swooping in and shutting down a blog for malicious reuse of a sentence. If sentences can be copyrighted, are there any limits at all? The only "positive" from this is that it reassures me that North America does not have a monopoly on stupidity with respect to copyright law....

Technorati Tags:

posted by James Robertson

 Share Tweet This

security

Cory Doctorow Gets Phished

June 19, 2010 13:54:02.187

This is useful advice about security:

Phishing isn’t (just) about finding a person who is technically naive. It’s about attacking the seemingly impregnable defenses of the technically sophisticated until you find a single, incredibly unlikely, short-lived crack in the wall.

To be honest, I'm surprised that Doctorow got tripped up by the "Is this you" Twitter/Facebook thing though - that's a pretty well known attack. On the other hand, we all click on stuff without thinking too deeply about it, and url shorteners are a very useful attack vector.

posted by James Robertson

 Share Tweet This

games

Alan Wake

June 20, 2010 10:50:47.878

My daughter got me Alan Wake for Father's Day - I started playing it late last night. It's an interesting game - a lot like an episodic TV series with a game component added on. The only complaint I have so far is the controller actions - what on earth were they thinking when they made the "B" button the action one? That's contrary to every other game I've played :)

I have to admit, it does a good job of setting the atmospherics though. It sort of freaked my daughter and I out when a light blew out in the room while we were playing :) If you don't get that - light (or its absence) plays a big role in the game. Your flashlight seems to be the best weapon (at least so far; I'm not very far in).

Technorati Tags: ,

posted by James Robertson

 Share Tweet This

PR

Does ATT Exist to Create Bad PR Examples?

June 20, 2010 10:56:45.668

Maybe that's not their reason for existing, but boy - it's what they do best:

The saga continues. A reader forwarded us this note he got from AT&T, simply stating that his iPhone 4 preorder had been cancelled, for no apparent reason. And he's not the only one.

Follow the link for an image showing the cancellation notice. There are a few hard foreign policy issues about which it's common to say (about one party or the other) that "they never miss an opportunity to miss an opportunity". Well, when it comes to having positive PR, that pretty much defines AT&T. IT's as if they see the possibility, and run. Fast.

Technorati Tags: ,

posted by James Robertson

 Share Tweet This

audio

Industry Misinterpretations 193: Squeak Oversight Board, June 2010, part 2

June 20, 2010 21:14:45.749

This week's podcast features Juan Vuletich and Jecel Assumpcao, two of the members of the Squeak Oversight Board. This is part 2 of two - if you want to hear part 1 first, download that here. This is our second talk with member sof the SOB; we plan to do regular updates with them over time.

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.

To listen immediately, use the player below:

If you like the music we use, please visit Josh Woodward's site. We use the song Effortless for our intro/outro music. I'm sure he'd appreciate your support!

If you have feedback, send it to smalltalkpodcasts@cincom.com - or visit us on Facebook or Ning - you can vote for the Podcast Alley, and subscribe on iTunes. If you enjoy the podcast, pass the word - we would love to have more people hear about Smalltalk!

posted by James Robertson

 Share Tweet This

web

This Can't Please Adobe

June 21, 2010 6:34:37.497

There are plenty of pragmatic reasons to avoid Flash right now - using a more neutral format gets you on the iPhone and iPad, while not leaving you off Android and PCs. However, it also looks like there might be more tangible benefits - witness Scribd:

Over the last few months, user engagement on Scribd has surged, according to CEO Trip Adler, thanks to its transition to HTML5, the introduction of the iPad, and Scribd’s Facebook integration. Of these three factors, Adler says the conversion from Flash to HTML5 was by far the greatest driver for his document sharing company. According to Scribd’s numbers, time on the site has tripled in the last three months

That kind of response gets noticed.

Technorati Tags: , , ,

posted by James Robertson

 Share Tweet This

smalltalk

Cog VM Out

June 21, 2010 6:41:01.907

Squeak, Pharo, and Cuis now have a JITted VM option - Cog has been released. The link goes to the ftp site; the only announcement I've seen is the readme file there.

Update: As a commenter pointed out, there was an announcement, in both the Squeak and Pharo email lists. Here's a link to one of them (they are the same text)

Technorati Tags: , , ,

posted by James Robertson

 Share Tweet This

smalltalkDaily

Smalltalk Daily 06/21/10: Using Pragmas for Menu Items in VW

June 21, 2010 8:11:28.037

Today's Smalltalk Daily looks at dynamically adding menu items in VisualWorks with pragmas. You can watch it on YouTube right now, or follow this link to the video.

You can follow the Smalltalk channel on YouTube for all the "Smalltalk Daily" videos. You can also check out the videos on Vimeo, where the quality is higher, or over on Facebook, if you are a member.

You can download the video directly here. If you like this kind of video, why not subscribe to "Smalltalk Daily"?

Technorati Tags: , , ,

posted by James Robertson

 Share Tweet This

tutorial

Creating a Simple Runtime

June 21, 2010 11:54:31.107

I received a question about creating a runtime image via my chatback widget this morning - I've done screencasts on that, but those use BottomFeeder as an example. While that's a real example, it's also fairly large, and somewhat complex. So - I thought a very simple example might be useful.

First, I created a new package, and then a new class (subclassed from Object) with no instance variables.


Smalltalk defineClass: #Sample
	superclass: #{Core.Object}
	indexedType: #none
	private: false
	instanceVariableNames: ''
	classInstanceVariableNames: ''
	imports: ''
	category: ''

I gave this class one method:


doMyThing
	Transcript show: 'This is from the Sample App'; cr.
	ObjectMemory quit.

So that the results are clear, I ran the application in headless mode - the Transcript write drops to a file called 'headless-transcript.log' (that's configurable, but never mind). Next, I need a way to have this application startup. I created a new class:


Smalltalk defineClass: #SampleUserApp
	superclass: #{Core.UserApplication}
	indexedType: #none
	private: false
	instanceVariableNames: ''
	classInstanceVariableNames: ''
	imports: ''
	category: ''

That's a class that exists to define a startup procedure. You create a new method called #main, and put your startup code there:


main
	Sample new doMyThing.

Next, I need a script that creates a new image, and puts it into "runtime" mode - the #main method will not fire unless the image is in that state. Here's the script:


"build a simple app"

"load all my needed parcels (Non-Windows)"
[#('SampleApp.pcl') do: [:each |
        Parcel loadParcelFrom: each]]
	on: MissingParcelSource
	do: [:ex | ex resume: true].

"turn change log off, so that we can ship patches reasonably"
'ChangeSet.BroadcastChanges' asQualifiedReference 
	ifDefinedDo: [:flag | 'ChangeSet.BroadcastChanges' asQualifiedReference value: false].

"Set herald string"
ObjectMemory setHeraldString: 'This is an Example Application in VisualWorks'.

"reset parcel path"
Parcel searchPathModel value removeAll.

"set up runtime state"
DeploymentOptionsSystem current startInRuntime: true.

"set up runtime state"
UI.WindowManager noWindowBlock: [:windowManager | ].
stream := WriteStream on: String new.
stream nextPutAll: 'changeRequest'; cr; cr; tab.
stream nextPutAll: '^true'.
VisualLauncher compile: stream contents.
VisualLauncher allInstances do: [:each | each closeAndUnschedule.  each release].

ObjectMemory garbageCollect.
Workbook allInstances do: [:each | each closeRequest].
(Delay forSeconds: 20) wait.
Parcel searchPathModel value: (List with: (PortableFilename named: '.')).
SourceFileManager default discardSources.

"Now save the image such that this file does not get looked for at startup"
[ObjectMemory permSaveAs: 'sample' thenQuit: false] fork.
[(Delay forSeconds: 45) wait.
RuntimeSystem isRuntime ifFalse: [ObjectMemory quit]] fork

I saved the code I created to a parcel, so that I could do a clean load. On my Mac, the command line looked like this (I have a symlink from visual to where the VM actually resides):

./visual visual.im -filein sampleDeploy.st

Where 'sampleDeploy.st' is the script above. Running that drops a single line to 'headless-transcript.log' and quits, just as you would expect. You can copy the script from above, and download the example parcel here.

Technorati Tags: , ,

posted by James Robertson

 Share Tweet This