. .

st4u

ST 4U 209: Creating a new Logger with log4s

March 21, 2012 7:53:08.913

Today's Smalltalk 4 You delves deeper into log4s, looking at how to create a new logger in code (as opposed to in the ini file). 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:

log4s.

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 new logger in VA Smalltalk, programmatically. Recall that the way we set up the standard (root) logger to write to a file was via the ini file for the VA image:


[log4s]
debugEnabled=true
quietMode=false
globalLevel=All
dailyRollingFileAppender =(fileAppender, root, vaLog.log, false, Info, EsPatternLayout,
 'ڴe{ISO8601}: [%level] %message', true, topOfDay )


What we need to do today is create a brand new logger:


"create a new logger using the Transcript"
myLogger := EsLogManager createLogger: 'myLogger'.
level := EsLogManager getLevel: 'All'.
pattern := EsPatternLayout new: 'ڴe{ISO8601}: [%level] %message'.
transcriptAppender := EsTranscriptAppender level: level layout: pattern.
myLogger addAppender: transcriptAppender.

That creates a brand new logger using the name 'myLogger' - to use it, we now need to specify that specifically (without being specific, we get the root logger):


"use the root logger"
EsLogManager warn: 'This is a warning!'.

"use the new logger"
(EsLogManager getLogger: 'myLogger') warn: 'This is another warning!'.


The first warning goes to the file logger set up on root; the second one goes to the Transcript using the new logger.

We'll delve more into the settings and filtering options for log4s in a future screencast

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

posted by James Robertson

 Share Tweet This

smalltalk

The Pharo Vision

March 21, 2012 10:03:59.862

The Pharo project has moved forward on their vision -

We worked a lot with INRIA lawyers and tried a lot of different scenarios. We arrived to a setup that make sense now we would like to get your input. Please have a look at the following powerpoint presentation and feel free to comment!

You can grab the PDF version of the vision document here.

Technorati Tags:

posted by James Robertson

 Share Tweet This

stic12

New Smalltalk Projects

March 21, 2012 10:14:25.182

First talk of the day: Georg Heeg is talking about doing new projects in Smalltalk.

Some of this has to to with improving CRM systems (intelligent guidance as opposed to classic UI design) - Heeg has been helping with product development on that. The main message of the talk is that Heeg's company is involved in new project development using Smalltalk.

Technorati Tags: ,

posted by James Robertson

 Share Tweet This

stic12

Cloud Foundry

March 21, 2012 10:36:34.252

James Foster is expaining CloudFoundry - a service VMWare is building out for public and private cloud services. Part of this presentation is an audience participation demo using CloudFoundry - I'd talk about that more, but we had issues getting the necessary parts installed on my Mac :) It looks cool, but it looks like the setup requires more than the handful of minutes I was able to devote to it.

The next bit you can follow along on the video once that's released - or contact James Foster, who I'm sure will be more than happy to talk you through it.

There are some interesting issues with getting Smalltalk into this kind of service - it's a monolithic image, as opposed to a small runtime that you muck with via small text files. Additionally, that image needs to run continuously, as opposed to running on demand only. Interestingly, the solution here looks a lot like what I do to run this blog (with the caveat that what I do is way less formalized).

  • Push new code to service
  • launch Smalltalk, load code, save image
  • launch saved image
  • Start HTTP Server on specified port

The result of all this some baseline support for a Gemstone service in the cloud - which is pretty cool.

Technorati Tags: , ,

posted by James Robertson

 Share Tweet This

stic12

Cincom Smalltalk Update

March 21, 2012 12:12:17.714

Instantiations updated us on VA yesterday - today it's Arden's turn with Cincom Smalltalk.

New releases of VW and OS are coming by June of this year - 4 major releases over the last 2 years, plus minor ones. New stuff recently:

  • Unicode VM
  • Store revamped (Glorp underpinnings)
  • Atomic Loading from Store
  • Updated Delays (uses OS clock)
  • Improvements to the Mac VM
  • New Pre-req engine for Store
  • 64 bit support has improved vastly
  • Store browsers now (finally :) ) using the RB
  • Merge tools updated
  • Seaside support is up to date with each release

Coming soon:

  • External encryption (as documented by Martin)
  • Speed improvements in Store
  • Configuration Management
  • ipv6

ObjectStudio - Arden points out that the modeling and mapping tools are OS specific, but the outputs can be used in VW as well (the GLORP mappings). See this talk and this talk for more on that.

Tools for GLORP - use ObjectStudio, publish the results to Store, use in VW or OS. OS has better integration with the Runtime Pacakager tool as well. One of the main new things on the OS roadmap (other than continued DB modeling/mapping support) is 64 bit support.

New stuff in VW: COM updates, internationalization improvements, better look (icons). What's Notable?

  • Project Launcher
  • Polycephaly (supports multiple cores/cpus)
  • GC improvements (see Andres' talk)
  • Xtreams

The new work looks like it's moving the stuff listed above forward - but there's also some interesting UI work (Skins) that Travis will be talking about next. Once that's posted, scroll up :) Also on the radar - dllcc improvements, Windows 8 support (metro?), code completion, WebSockets, font improvements. Kind of the summary statement - a lot of the product changes are driven by customer feedback and needs.

Release Cycle: Annual major releases, maintenance releases (actually maintenance :) ) in between.

Technorati Tags: ,

posted by James Robertson

 Share Tweet This

stic12

Skins in the VW UI

March 21, 2012 12:59:46.954

Travis has mentioned the Skins (UI) work on his blog before - and today he's going to talk about it at STIC.

The VW widget set is an emulate done - the problem with moving it forward has to do with how fast UIs evolve in the host OS, and the limited manpower available to keep up with that. On the other hand, lots of legacy code relies on this stuff. Another issue - in the VW MVC model, the view and controller are really, really tightly coupled. The model tends to be more coupled than we'd like as well.

Over time, this got more complex with the addition of layout wrappers which again got more tightly coupled with the views than maybe they should have been. Then there are state wrappers (enablement) - and from there the wrapper party just grew like weed, and trackers just made things more complex. Then you add in all of the subclasses for views, controllers, and trackers....

Skinny goals:

  • Offload drawing to external resources
  • incremental on/off
  • grow in place replacement (not a big bang)
  • avoid a massive rewrite of platform interfaces
  • address some of the issues in the VW widget set
  • play the subclass card differently

Widgets will be simpler - manage own state, use models when they make sense. Layouts are being punted for now, the existing stuff is still in play, with some small mods. Controllers are out. State is being handled in a properties dictionary, and VisualPart already had that. Drawing - that's where things are offloaded to a strategy/policy pattern. The Skin api tend sto be a large, flat collection of methods, with a generic DNU handler for methods that follow the conventions.

The rest of the presentation is a demo - as with many of the other talks, you'll really need to wait for the video to see what happened here :) What he showed was a skinned Windows (XP in a Mac VM) and a skinned OS X Lion. Linux (GTK) is still being investigated, but using Cairo he got something pretty nice out (KDE Look) in a day.

This is in 7.9 builds, but not enabled. It can be turned on. There's still work to do on the more involved widgets, but it's taking shape. It is a a work in progress, but can be played with now.

Technorati Tags: , ,

posted by James Robertson

 Share Tweet This

stic12

Dave Buck on Fluid Positioning in VisualWorks

March 21, 2012 15:15:49.732

Dave Buck is presenting some interesting work he's been doing - fluid positioning. We've talked about this some on the podcast, but it's a topic well worth exploring in more depth. There's also a video Dave put out last summer. The basic idea: allow widgets in a VW window to be laid out relative to each other, and seamlessly reposition themselves (in the GUI builder) as you move things around.

The baseline goal - make it all easy to work with in the UI. In casting about for other work on this subject, Dave needed something that worked the way he needed it to work - Aukland was something he had to push off. He's now on his second iteration of the work, because his first stab "almost" worked. Almost just wasn't good enough :)

At this point, you'll have to wait for the video to see the first iteration - it's a demo.

Issues? Undo doesn't work right with groups. Heck, undoing a group loses properties s-is :)

in algorithm two, he's not dealing with groups or oriented composites. Instead, he's modeling the layout explicitly. His new take on this looks much cleaner, and doesn't force groups on the UI (which lets the developer add them for their own purposes later). In this demo, it's clear that there's still work to do - widgets sometimes get oddd sizes based on his layout calculations.

Still work to do on save/restore, dealing with existing specs, and the one layout issue. One big lesson: tests help, but they aren't enough here - some it relies on the "mark one eyeball" :)

posted by James Robertson

 Share Tweet This

stic12

Practical Git for Smalltalk

March 21, 2012 15:52:29.622

Last main talk of the conference - Dale Henrich's on using Git with Smalltalk. Caveats:

  • Git can be used well with Smalltalk
  • It's not practical to expect all dialects to switch wholesale off whatever they use now
  • It can be used to share code across dialects

What about the stock stuff, like ENVY, Store, and Monticello? High cost of porting the tools between dialects, and they tend to be tightly coupled with their "home" toolsets. The implementation as it exists now is called FileTree. The basic implementation is based on Monticello - but the disk structure does not rely on Monticello artifacts, and works in Pharo, Squeak (and thus GLASS).

The FileTree package structure is SCM neutral, so it could be used with any standard SCM toolset. What's a Package in this context? an object or algorithm that defines the contents of a Snapshot. A Snapshot is the state of a Package at a given point in time. In an image, a Snapshot is represented as a collection of class and method definitions. On disk, it's class and method chunks in a collection of .st files.

By saving packages this way, it leverages what Git can do from a "what changed over time" standpoint. Status? This comes from work that has been ongoing for a bit in the Pharo world, so it's actually being used "in the real world". Right now, it's suitable for anyone using Monticello. There's work to be done to accommodate this to all dialects (in terms of file format alone).

Dale says that Envy and Store were better options in the mid 90's, but Git/GitHub is better now. Right now, GST, Redline, and Amber are all using GitHub. Using Git is an upgrade from Monticello, but for Store/Envy it's more of a way to share code. It's an addition, not a replacement.

Technorati Tags: , ,

posted by James Robertson

 Share Tweet This

stic12

STIC 2012 Wraps

March 21, 2012 17:40:09.865

After a lot of short (5 minute) lightning talks, we've reached the end of STIC 2012. I'm told that the videos (which I've been referring to in this series of posts) will be posted soon - check the STIC website for details.

STIC 2013 has just been announced: June 2013 in Arizona. The dates aren't nailed down yet, but there it is! Want a discount on registration? Send Suzanne (you know her email address if you're a Smalltalker) an email with "STIC 2013" in the subject line. The call for research papers for next year is also out already - check stic.st for details.

Technorati Tags:

posted by James Robertson

 Share Tweet This

js4u

JS 4U 142: Timestamps in JQuery

March 22, 2012 8:47:27.006

Javascript 4 U

Today's Javascript 4 You looks at using Timestamps in JQuery for simple profiling of functions. 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:

profiling

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

posted by James Robertson

 Share Tweet This

smalltalk

Pharo and Oracle

March 22, 2012 21:27:38.824

I'll have to check this page out (I'm future posting this from a plane at the moment) - Pharo and Oracle help. The last time I tried to get those two to talk, I had issues :)

Technorati Tags: ,

posted by James Robertson

 Share Tweet This

stic12

Smalltalk Research

March 23, 2012 7:24:45.220

The call for papers for the next STIC came out on the ESUG mailing list, from Georg Heeg:

In June 2013 we will also have Smalltalk Directions 2013 organized by Smalltalk Academic Advisory Board STAAC. The formal call for papers will go out soon. But you can start planning to submit your research results today. The topics will probably be along the lines of this year’s call for papers. The papers will get reviewed and published and in the presentation you will get into contact with co-researchers and industrial Smalltalk users from all over the world.

Technorati Tags: ,

posted by James Robertson

 Share Tweet This

smalltalk

Pharo in the Spring

March 23, 2012 9:28:07.000

posted by James Robertson

 Share Tweet This

st4u

ST 4U 210: Filtering Logs by Level

March 23, 2012 9:33:19.442

Today's Smalltalk 4 You looks at filtering logging events in log4s using logging levels. 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:

Logging.

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 a closer look at logging levels in log4s. To quote the documentation in VA Smalltalk:

The concept of levels is central to log4s. A loggingEvent will be logged by an Appender if the level of the loggingEvent is greater than or equal to the level of the Appender. Both LoggingEvents and Appenders have levels. Log4s has seven predefined levels which are implemented as EsLevel class variables.

There are 7 levels to logging - in order from the lowest (everything gets logged) to the highest (nothing gets logged), they are: All, Debug, Info, Warn, Error, Fatal, Off. So if you set the level for an appender to "Error", and then send a "Warn" level message, it will not appear in that appender's stream. For example - recall that we've set up the root logger with a file appender:


[log4s]
debugEnabled=true
quietMode=false
globalLevel=All
dailyRollingFileAppender =(fileAppender, root, vaLog.log, false, Info, EsPatternLayout,
 'ڴe{ISO8601}: [%level] %message', true, topOfDay )


That will log everything to a file. Let's set up a new appender to the Transcript, but set it up at the "Error" level - meaning, it will ignore all logging events under that:


"Add a transcript appender programmatically, but set at a higher level"
level := EsLogManager getLevel: 'Error'.
pattern := EsPatternLayout new: 'ڴe{ISO8601}: [%level] %message'.
transcriptAppender := EsTranscriptAppender level: level layout:  pattern.
logger addAppender: transcriptAppender.

Now we have two appenders for the default logger - the file appender will get every logging event, while the Transcript will only see things at level "Error" and above. To demonstrate, let's send a warning event:


EsLogManager warn: 'This is a warning!'.


The File log has that, while the Transcript is blank:

Logging

Now let's send an error level event, and look again:


EsLogManager error: 'This is an Error!'.

Logging

Notice that this time, the event hit both logs - the file appender gets everything, while the Transcript appender got the higher level event only. Next time, we'll get into filtering and the print format.

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

posted by James Robertson

 Share Tweet This

games

A Modest Proposal for ME3

March 23, 2012 22:17:17.625

I've finished the game on the PC, and I'm playing through a second time on my XBox. In that second game, I've just gotten through the end of the Geth/Qurian confrontation. Here's my proposal:

The people who wrote that part of the game? They're awesome. The moron who wrote the end? He needs to be removed from the Mass Effect franchise, post haste. Having done that, have the people who wrote the second act give us an ending that makes sense. That doesn't mean a "happy" ending, btw - it would be entirely reasonable for the ending to be sad.

But it should make sense.

Technorati Tags: ,

posted by James Robertson

 Share Tweet This

games

Why the ME3 Ending Doesn't Work For Anyone

March 24, 2012 13:24:41.527

The more I think about the ending given to us by Hudson, the more I realize that it doesn't work for anyone - not fans, and - interestingly enough - not for BioWare, since they've said that they want to set future games in that universe (without Shepard). Why doesn't it work? Well:

The Mass Relays are gone. No matter which ending you picked, they all blew up. So consider: every species' fleet is now stranded around earth, with no way home. Mass starvation (and maybe renewed war, as the survivors start blaming humans for the problem). The only ones who survive that mess intact are the Geth, who can live through the long flight to somewhere else.

Now consider the ravaged homeworlds of the various species - mass destruction, and all trade outside their home systems cut off - for a long, long time. The lore has it that the relays have been around "forever" - rebuilding them will be the work of centuries (assuming that the knowledge to do so even exists). It looks like each one will have to be built in place before travel over long distances is possible, so... interstellar travel is basically gone.

So congratulations, Mr. Hudson - you made future storytelling in this universe nearly impossible. Not only did you tick off fans everywhere, but - once your management team realizes just how badly you've screwed the pooch, they won't be happy either. It takes rare talent to irritate all and sundry, but I think you've managed the trick.

This may explain why they've decided to revisit the ending - it's one thing to irritate long time fans; it's something else again to kill a franchise.

Technorati Tags: ,

posted by James Robertson

 Share Tweet This

podcast

IM 71: STIC 2012 Day 1

March 25, 2012 11:19:47.613

Welcome to episode 71 of Independent Misinterpretations - a Smalltalk and dynamic language oriented podcast with James Robertson and David Buck.

This podcast was recorded by Dave Buck and I at the beginning of day 2 of STIC 2012 - we spoke about the various talks we saw on day 1. I'll have a wrap up podcast on STIC 2012 with Bob Nemec next week - that was recorded at the end of day 3 .

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:
[im71.mp3 ( Size: 12960195 )]

posted by James Robertson

 Share Tweet This

podcastAAC

IM 71: STIC 2012 Day 1 (AAC)

March 25, 2012 11:20:20.533

Welcome to episode 71 of Independent Misinterpretations - a Smalltalk and dynamic language oriented podcast with James Robertson and David Buck.

This podcast was recorded by Dave Buck and I at the beginning of day 2 of STIC 2012 - we spoke about the various talks we saw on day 1. I'll have a wrap up podcast on STIC 2012 with Bob Nemec next week - that was recorded at the end of day 3 .

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:
[im71.m4a ( Size: 17915030 )]

posted by James Robertson

 Share Tweet This

PR

How to Create a Bad PR Event

March 26, 2012 7:52:34.237

Microsoft has the latest "how to look stupid in public" example. If you run a contest like that one, you simply have to be prepared to lose a few....

Update: Microsoft quickly figured out what a problem this was, and - to their credit - dealt with it.

Technorati Tags:

posted by James Robertson

 Share Tweet This

st4u

ST 4U 211: Inspectors and Workspaces in VW

March 26, 2012 9:59:36.193

Today's Smalltalk 4 You looks at the ability to use drag/drop between inspectors and workspaces 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:

Workspace

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

posted by James Robertson

 Share Tweet This

js4u

JS 4U 143: Formatting Dates

March 27, 2012 8:41:35.598

Javascript 4 U

Today's Javascript 4 You looks at formatting dates in Javascript. 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:

dates

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

posted by James Robertson

 Share Tweet This

st4u

ST 4U 212: Customizing log4s output

March 28, 2012 10:40:29.755

Today's Smalltalk 4 You looks at how you can customize the output of log4s data via the built in pattern specifiers - and the support code that you can implement to make use of it. 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:

Logging.

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 look at customizing your logging (in log4s) via the pattern strings used when setting up a logger. First off, you should look at the documentation, where you'll find this page, explaining the various options:

logging

What we'll do today is set up some object specific logging based on the API supported by our objects. We'll create two simple classes which respond to the same method - #addOne, adding one to a counter. One will implement #printOn: (customizing #printString), the other will implement #printLog4s. To get that all to show up, we'll use the %object specifier in the log setup:


level := EsLogManager getLevel: 'All'.
pattern := EsPatternLayout new: '%date{ISO8601}: [%level]  [%object] %message:'.
transcriptAppender := EsTranscriptAppender level: level layout:  pattern.
logger addAppender: transcriptAppender.

If your object implements #printLog4s, that will get used instead of #printString. Here's what the code for Adder1 and Adder2 (the two classes) looks like:


Adder1:

printOn: stream
	super printOn: stream.
	stream nextPutAll: ' <', count printString, '>'

Adder2:

printLog4s
	^'LOGGING:  <', count printString, '>'

Now we'll execute the following:


"with logging on, go ahead and watch two different results"
adder1 := Adder1 new.
adder2 := Adder2 new.

adder1 addOne.
adder2 addOne.


And this is what we see in the Transcript:


2012-03-28 09:59:22,031: [WARN]  [an Adder1 <1>] Added one:
2012-03-28 09:59:28,937: [WARN]  [LOGGING:  <1>] Added one:


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

posted by James Robertson

 Share Tweet This