got net?

Kevin Hazzard's Brain Spigot

About the author

Welcome to Kevin Hazzard's blog.
E-mail me Send mail

Recent posts

Recent comments

Authors

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2010

Flickr Photo Viewer in Small Basic

My sons, 10 and 15 years old, and I were sitting around this evening playing with Microsoft Small Basic. I've been trying to get my kids interested in writing software for years. But they didn't take to it. Small Basic made their eyes light up though. It has a Turtle graphics class like Logo had back in the 80s. You can make the turtle object move and turn to draw on the screen. It animates the whole thing. For capturing the imagination of children and getting them interested in writing algorithms, Logo was brilliant back in the 1980s and it's still brilliant today. Small Basic also has a Flickr class that you can use to download images by keywords. My sons and I wrote this little Small Basic program for taking keyword input from the user and then starting a Flickr slide show. They were so proud of themselves. Too much fun!

TextWindow.WriteLine("Welcome to My Flickr Picture Viewer")
TextWindow.ForegroundColor = "Cyan"
TextWindow.Write("What kind of pictures do you want to see? ")
TextWindow.ForegroundColor = "Yellow"
keywords = TextWindow.Read()
TextWindow.Hide()

GraphicsWindow.Title = "My Flickr Picture Viewer"
GraphicsWindow.Left = 0
GraphicsWindow.Top = 0
GraphicsWindow.Width = Desktop.Width - 20
GraphicsWindow.Height = Desktop.Height - 100
GraphicsWindow.FontSize = 18
GraphicsWindow.Show()
GraphicsWindow.MouseDown = OnMouseDown
GraphicsWindow.DrawText(10, 10, "You are about to see Flickr pictures with the keyword(s) '" + keywords + "'.")
GraphicsWindow.DrawText(10, 50, "Click in this window to begin. Click when you want to see a new picture.")

Sub OnMouseDown
  GraphicsWindow.Clear()
  GraphicsWindow.DrawText(10, 10, "Downloading...")
  img = Flickr.GetRandomPicture(keywords)
  GraphicsWindow.DrawResizedImage(img,0,0,GraphicsWindow.Width,GraphicsWindow.Height)
EndSub


Categories: Fun
Posted by kevin on Thursday, December 18, 2008 11:44 PM
Permalink | Comments (6) | Post RSSRSS comment feed

Microsoft Small Basic Is Fun

I've been so busy writing for my book recently that I've not been blogging as I should. Oh, well. But I stumbled on a great little programming language called Microsoft Small Basic today that I thought I should share with you. It comes from the Microsoft DevLabs. You can learn more about Small Basic here. Essentially, Small Basic is a BASIC-like development tool aimed at beginners. It has primitives for reading and writing to a text-based console window and it can do graphics manipulation, too. It's really fun. I can't wait to turn my kids onto it. They'll be cranking out fun Small Basic programs and e-mailing them to me soon, I hope. I've wanted to find a way to get my younger children interested in what I do for a living but I just couldn't find anything that was simple and fun with enough power to do impressive stuff. I think Small Basic might be exactly what I was looking for. It requires the .NET Framework 3.5 and installs in about one minute. Be sure to download the Introducing Small Basic Guide, too. Lots of great examples in there. And the Intellisense feature in this environment is very cool. My kids are going to be spoiled! Here are a couple of screen shots. Enjoy.

Update: if you use low-privilege login accounts for your kids on a shared PC, be sure to put the MSI installer package in a shared location before running it as an administrator. When your kids log in with their reduced privileges and try to run Small Basic, they will need access to the installer package from that shared location. Don't delete it.

The Small Basic Development Environment

Running the Program


Categories: Fun
Posted by kevin on Thursday, December 18, 2008 5:33 PM
Permalink | Comments (1) | Post RSSRSS comment feed

Turning on Comment Moderation

Sorry to do this folks but I am having to turn on comment moderation on this blog. I have been getting some really inappropriate comments from the bots recently. I would put a CAPTCHA control in place and I may still do that. But I don't have time to get that set up right now. Instead, I will be approving new comments to my blog posts before they become visible to the public. Sorry for having to do this. I already respond to most comments so this should not have a big impact on most of you.

Categories: Rant
Posted by kevin on Monday, December 08, 2008 11:39 AM
Permalink | Comments (0) | Post RSSRSS comment feed

Adopting the New Is Easy, Shedding the Old Not So Much

Towel dispender overloadingDo you work for a company that has a technology plan that looks like this? I ran into this scene a while back and felt compelled to snap a picture of it. For those who can't see the image, it depicts a wall with three different towel dispensers mounted on it. Actually one of the devices is an air-powered hand dryer. But it's in the same genre. We can imagine that over time, the size or form-factor of the towels that could be purchased changed which prompted the addition of a new dispenser. Then someone decided to add an air-powered hand dryer. But the older systems were never removed. They just kept adding on as their circumstances changed. I've actually seen walls with four or five differently-sized towel dispensers in place, most of them defunct.

When I snapped this picture, James Avery, Justin Etheredge and I were on the way to CodeStock in Knoxville, Tennessee. Like all good geeks, we had been talking about the virtues of good software architecture along the way, which is to say that we were really just complaining about the problems of bad software architecture. And when I saw this image, I couldn't help but think about how it represented the way in which many of our application architectures grow over time.

When a software system is new, it may be clean and well designed. More importantly, there are usually stewards who care about the way in which change takes place. But, over time, the original stewards leave to do other things. And the new caretakers either don't understand the spirit of the original design or they don't have a mandate to grow the system organically. In this state of affairs, when new requirements are encountered, the natural response is to create new sub-systems, not to evolve or depricate the old ones.

So, there it is. The natural state of application architecture is ugly. A few years back, everyone was talking about business agility. The television and magazine adverts all focused on how truly agile businesses could absorb new technology more quickly than their less agile competitors. Quite the contrary, I think that an agile business focuses on shedding the old stuff in balance and concert with its attempt to adopt new technology. Justin did a nice piece on Emergent Complexity that addresses this concept from a coding perspective. Check it out.


Posted by kevin on Thursday, December 04, 2008 1:49 PM
Permalink | Comments (4) | Post RSSRSS comment feed