Tuesday, November 13, 2012

Best Games of 2012

Yes, I play games.

Despite being not-so-young any more, I still play the odd game. I've always enjoyed playing games, and I've basically never stopped. One thing that perhaps has changed is that I feel I've become more discerning, more selective. I buy very few games in a year, although slightly more when they are $2 or so on the phone - but overall I'd be luck to spend $200 per year on games these days. On saying that, I've been playing quite a lot recently, even for me.

Some Contenders
 
So what has been absorbing my time? Well, there have been a few fads games that have come and gone fairly fast. Most of these are the cheap phone games, but I'd almost throw Diablo III into that basket. I didn't finish it, it just didn't seem worth my time, it was too much of a grind and I felt that the items I was finding were all fairly average. Overall, I was expecting a lot from this game, and unlike Skyrim before it, I was fairly disappointed. To put things into perspective, I played Diablo I and II quite extensively. I think I play Diablo II through about 5 times.

And the Runner up is...

This is a little unusual, it's not what you think.When I say that its Plants vs Zombies, you probably go "Yeah, well, that's a good game". And you'd be right, but the thing is that I've played most of it to death and I'm bored of 95% of the game. But one mini-game still has me completely hooked - "It's raining seeds". It takes about 10 minutes to play (with almost no variation in time) and can fill any of life's little waits very nicely. The thing I like about this game is that it's very random what you get - it's actually quite counter most of the rest of PvZ where you have to manage the resources to plant things. Instead you need to quickly form a defense and sometimes all you get are flowers and lillypads. You need to think reasonably fast, but there are times when you should wait with a drop until the very last second before placing it. There is one minor irritation - sometimes it registers a double tap on my phone and I inadvertently place something in the wrong spot. This can be very frustrating, as it's often something you really needed somewhere else. Anyway, I think I've played this mini game more than the rest of the game put together. It's an absolute cracker, and very satisfying when you beat the last wave.






but the WINNER is....

This is easy, we have a very clear winner. And I would not be surprised if it wins next year too, and maybe even the year after. When you fist see this game, you might go "I don't get it". It seems slightly plain in it's graphics compared to most blockbusting games, and pales next to Diablo III, which as I mentioned above I ditched some time ago. It's not really about the graphics, although I think they are ok. It's about the playstyle, the complete sandbox experience and the creativity and community it brings out in those that play it. Do you know what game I am talking about? I'll give you a hint...





Yes, it's Minecraft. Now before you roll your eyes and click away, please hear me out! Although, It's kind of hard to know where to start. Ok, well, let me tell you how you start. If you are playing "survival", which is in my opinion the best part, you start empty handed in a random location in a part of the minecraft world. It could be a tropical rainforest (and raining) or a desert, or wild mountains, or a swamp, or a nice field. Things look a bit chunky, as everything is made of blocks. And here is what the game is all about - you can collect various blocks, and build things with them. You may start with nothing in your inventory, but you can carry a surprisingly large amount once you get going. First of all if you hit (left click) the ground you end up with a dirt block. Then you can go somewhere else and place (right click) that same block. In this way you could build stairs, or a house, or... anything you want.

The "Craft" in minecraft is important, and shows another side to the game. You need to make some better tools for yourself, as you can't do certain things without them or at the very least it's easier. For example, you can get wood from punching a tree (it's a funny game in lot's of ways) but it's much quicker if you have an axe. To make an axe you need a crafting table. To make a crafting table you need wooden planks. To make those you need wood, which you get  from initially punching a tree.

There are nasties in this world too - things that want to kill you. So crafting a sword is a good idea, and later a bow. They mostly come out at night, and you start in the daytime, so you have a little while to prepare, but time goes quickly in your first game as you fumble about. It helps if a seasoned user is explaining things to you as you go, and this introduces the concept of community - as players often play together. You just need two computers, a network and you are set - it's really easy to join a LAN game.

Friends (and family) can play together in a virtual world with a common purpose. In this way, you might think this is something like Second Life. I have played that, and other virtual world style games, and they are not the same. Minecraft is not commercial in-game. If you are stuck on how to do something, you can ask, or chat in game (typing), or visit the online wiki which has all the items and recipes for things. But don't hit the wiki too early, you'll freak out at all the items there and it makes it look complicated. There is a lot of stuff you can do but that doesn't mean you have to do any of it. If you want, you can make a simple hut by a river and fish by day, or perhaps grow some wheat to make bread. Or keep some livestock - a few chickens, cows and pigs. That's because you do have to eat every now and then or you starve.

As the name suggest, minecraft is really also about mining. You can go caving too, there are plenty around, and crafting a torch is one of the first things you learn so that you have some light. In a slight quirk of the game, you have to place the torch somewhere for it to light up though - you can't just carry one around and see. Mines offer you precious ores - iron, gold, emerald and the most precious of all, diamond. You can only find diamond in very deep mines, and you need to be careful, because there is lava down there and monsters in the darkness. You can make better tools and armor with these ores, and other things.

You can find abandoned mineshafts, strongholds, vast caves, pyramids, temples, villages complete with odd villagers. Once you really get into the game, you can craft portals to two completely other worlds - the "Nether" which is like Hell and has never ending fires and lakes of lava (and new monsters), and the "End" which has Endermen and the final boss of the game, the Ender Dragon.

Yes. You can do all that. Or you can just build yourself a really nice house. Or perhaps make some pixel art out of wool of your pet. Or build up into the sky and make a castle in the clouds. There is even a form of basic electrical circuits you can make, so that you can construct automated doors or even larger complicated machines. The world of redstone is vast if you want to explore this side of things.

So what is minecraft all about? Once you learn the basics, it's about pretty much whatever you want it to be. With some restrictions (which are more motivational than anything else), you can do pretty much anything. And I think this is minecrafts biggest appeal. If you want a big adventure, knock yourself out. If you want to become a simple farmer, go for it. Feel like being a miner and going digging? Sure. One thing you will learn though is that activities are subtly linked, so that one thing you may want to do requires you to do something else first, and that requires other things, etc. If you want a glass window in your house, you will need sand to melt, a furnace to melt it in, and fuel to do the melting, for example - so you may go mining to find coal, or on a quick adventure to find sand in a desert or beach.

There are often two or more ways of doing the same thing - and most of it is logical. There are, however, a few illogical things in minecraft - for example, when you take a block of wood out of a tree trunk it doesn't fall over. It just hangs in space with a bit missing. Sand and gravel fall down, but most other blocks don't. What else? You can carry several thousand cubic meters of stone. Try doing that in real life! There are other examples but really it's a game, and it's part of the charm of the place and you just have to go with it. It seems perfectly normal very quickly.

So anyway, I strongly recommend this game. It's cheap and the developers are continuing to improve and expand it and it just keeps getting better and better.

Now two words of warning if you play this game for the first time. Firstly, watch out for "Creepers" which are the signature monster in the game. They are green things with sad faces that silently come up to you and then briefly "hisssss" then blow up, possible taking you and a part of your nice house with them.  Kill them with a bow, run like hell, hide somewhere, build a protective fence or wall, do whatever you need to do to stay the hell away from them.

Lastly, just be prepared for this game creeping up on you. It's such a wonderful game you will want to play it over pretty much any other, particularly if you get into it with your friends. I think it's a healthy game to play though as it encourages creativity and cooperation. Enjoy it, I know I have in 2012, it's my game of the year - easily.


Tuesday, July 10, 2012

Windows 8 - Good or Bad?


I have been using windows since, well, since it started really. Here is a brief history of Windows as I see it.

I've used Windows 3.11 for Workgroups, but I try and forget about that.

Windows 95 was a revelation, a real boost into a modern OS compared to DOS and at the time MacOS and OS/2 warp. Ah, those were the days. Actually, no they weren't. They all sucked - even at the time, for various reasons but mostly due to god-awful drivers and DLL issues. Just getting a printer or scanner to work might be days of your life gone.

Windows 98 fixed a lot of the problems with Windows 95, and for many people this was as good as an OS needed to be to actually make a computer useful. 

Windows ME was a joke. A bad joke. 

Windows 2000 was good though, but fairly business orientated due to it's windows NT heritage. Most home users stuck with 98. A lot of businesses ditched old NT domains for the new Active Directory in Windows 2000 and have been using an evolution of this since, as it scales well.
Windows XP was the next good, stable jump that a lot of people were hanging out for to upgrade from 98. Again, it made a lot of small improvements, and overall was a slick customer. It did well for both business and private sales. Many people still use Windows XP today, and see no reason to ditch this for something new - but probably will when the computer they are using finally dies.

Windows Vista took a long time to come out - too long - and was overbaked. They had ambitious plans for this OS actually, notably a reworked file system. This made sense on paper but in practice was too big a change to swallow. When Vista came out it looked ok, but was unstable and very resource hungry - and got a bad reputation with geeks from the start. It was telling that Microsoft sold XP licenses while Vista was on sale for a LONG time because, well, people actually preferred XP by quite a wide margin. Very few businesses took on Vista - most stuck with XP desktops.

Windows 7 came out on schedule and it was more the vision that Vista was going for. It was stable, modern, lowered system requirements and just seemed to work. The "Start" menu turned into a Windows ball, and applications got a bit more iconized in the taskbar, there is some transparency here and there, but more or less it was business as usual. People like Windows 7, in general, and so do I. Mostly because it works, I can find what I am looking for, it get's out of my face so I can get things done. It doesn't crash much either, truth be told. That's good.

So a recap of the good = 98, 2000, XP, 7

And the bad = 95 (well, it was ok), ME, Vista.

It's almost 50/50. This is all just my opinion mind you. You may love or hate one of the things in complete opposite to me. More power to you, I say - even if you are obviously wrong! Haha.
Anyway, and to the point of this post, I have been thinking about windows 8, and where this will fit into this somewhat patchy history of windows. In a nutshell, I think it's going to fall fairly heavily into the "bad" list, and I will explain why.

We have all been using personal computers for the better part of 15 years, or more, and gotten used to certain things. I work in businesses within the IT department, and I have supported literally hundreds of users with all manner of problems. Some people "get" computers, some don't, and I understand and accept this without judgement. 

Now here it the thing - Windows 8 throws out a lot (everything?) you have learnt over those years for a new user interface. I'm betting that for most people, who are naturally resistant to change, this will not go down well at all. Hell, I still hate the "Ribbon" interface in Office - and it's been there a while now. Why? Well, it was more or less change for changes sake, and it didn't improve anything really. Worse - screens have become very wide but not tall, so losing an inch of height is the wrong thing to do. I hate letterboxed documents. Ahem, I think I have gotten sidetracked a bit, but perhaps not much, as I think this does illustrate my point - which is that people don't like change and can sometimes be quite passionate about it.

There is another serious issue for Microsoft, and this is that there is more decent opposition these days. For a start, Apple is doing well and they are going to get a lot of migrating customers who are bewildered by the Metro interface. The premium on Apple hardware has come down somewhat, it uses more standard ports unlike days of old and has the cool factor. 

On the uber-geek side, and for the tinkerers and the penny pinchers is the all-free Linux. I have played with Ubuntu, for example, and once you get over the first few days it is pretty good. Firefox in ubuntu is EXACTLY the same experience as in windows. I will add that I dropped my Ubuntu dual boot when they changed UI a few versions ago though. Anyway, you can download the CD image and try it for free with no effect on your current hard drive - so why not try it (and open office - the free office replacement) and see if the free alternative is any good?

Time will tell how well Windows 8 will do. As it will ship with most new PC's, it will sell at least OK to start off. I think though that there will be a situation much like with Vista, where people DEMAND windows 7 licenses for the simple fact that they prefer it. Perhaps windows 9 (or whatever it will be called) will be the next good version to jump to, that would make sense from a historical perspective.

By the way, I get the concept that Windows 8 is an attempt to merge a phone OS, a table OS, a desktop OS. To get to this point, they have had to make a lot of compromises to deal with the massive variations in screen size and input devices/touch abilities. If windows 8 early reviews were all glowing positive about the change, then I would hold reservation - but the ones I have read have all had basic usability issues in just doing the simple things like opening a program,  changing some settings or organizing your files. This is not a good omen. They might pull a rabbit out of their hat before final release, but I'm not overly hopeful at this outcome.

Perhaps I'm just jaded because I am not remotely excited by Windows 8. I can think of 100 ways they could improve windows 7, and a lot of people would have been very happy about a new version like that instead.

Feel free to add your thoughts on this!

Thursday, September 15, 2011

Doodles from the 80's

And now for something completely different!

Back in the 80's, when I was a young lad, I did some drawings. My style is just to doodle along, and I did this on lined paper, unfortunately. This post represents just one page of the drawings that I have, and I have quite a few. Click on any of these images for a larger view.

To put the first drawing into perspective, the idea of morphing two images in an animated GIF had just become the rage at the time. God, I sound like grandpa Simpson. So I did a drawing which morphed from one into the other.


Note that my pen fell into the punched hole at the end and I just kept on drawing around it for the simple reason that it felt good.


Ok, so moving on now to what I think is a more interesting (but somewhat atypical of me) drawing. This is along the morph theme, but in one image. Can you see them both? I like the idea of someone shaking the tree of love angrily.


Ok, I admit, it's pretty hard. My wife couldn't see it either, so don't feel bad. You can't see "Harry Half Face" in this picture, can you? Think of a mean man where there is a pool of light on one side of his face only. Still not getting it? Try the stripped down version here, or if you really still need help and don't know what the hell I am talking about, try this one. And yes, that does feature possibly the worlds worst drawing of hands - but it's just to give you an idea of what I was thinking, mmmmk.

Lastly, I wanted to ask if you have ever felt like this drawing is trying to show? If not, well, you have missed out, 'cos I have!

Saturday, September 10, 2011

Knife Review : Kershaw Leek

I've slowed down my knife collecting a lot, so I have not had many new knives to consider. However, I did buy a Kershaw Leek off eBay a little while ago, and I feel the need (for some strange reason I don't fully understand!) to write about it. If you want to know the basic specs of the knife, best to go to the official web site for this knife here.

Here it is in the hand, in all it's glory.



The exact model I have is a 1660BR, which has a nice red and black smoke handle. In the hand it feels very nice, being a great all round shape. It's a "fine" knife, that is, it's somewhat delicate and thin in terms of the metals and construction. This is not a knife for chopping down saplings or whittling pine, it's much more at home opening letters and parcels, cutting string and cardboard. It fills my hand, just, with all four fingers getting around the handle with pretty much no extra handle left.

To perhaps illustrate the point here about it's "fineness", I think it is interesting to look at the liner lock (it's called a frame lock on the official web site, I don't know why) compared to the BEE L05, a knife I reviewed and really like a lot.


I think you can see the difference in the thickness of the liner easily here. I want to say that although it is quite thin, it doesn't feel flimsy. I think it's about as thin as you can get away with and still be safe. There is no up/down movement on my knife at all, it locks up quite tight, although there is a tiny bit of side to side.

There are several things about this knife that I really love. Let me rabbit on a bit now about the opening action. It may not be important to you, but to me it's an important issue as I tend to fiddle with knives where I like the opening action, then I tend to like them more. I still have all my fingers, which is somewhat surprising! Anyway, the Leek has a very different opening (and closing) action to the BEE L05. For a start, it has Kershaws "Speedsafe" mechanism, which in effect makes it an assisted opening knife. Please be aware that these mechanisms are not legal everywhere, so check out the situation in your area.

It can be deployed by the dual sided thumb studs, although this is NOT how you generally do it as they are small and cramped up against the scales so it's a bit of a contortion to get your thumb in the right place. Once open the studs nestle into small recesses in the handle, providing additional strength, which is good. They are not the worst thumb studs I have ever used, but they are also some way away from being the best. If that was all there was to open up the blade, I would not like the knife really. Fortunately, the thumb studs are mostly redundant, as this knife is also a flipper.

I don't usually like flippers, and own very few. The reason is that an unassisted flipper needs a flick of the wrist also to deploy, and I don't like that as it can make the knife fly across the room - open - if your hand is slippery or you are just being uncoordinated. It also take up more room, and is less certain to be accomplished. If it's loose enough to flip open easily, you then have issues with blade play. It's not an easy thing to get right. The reason the Leek does get it right is that the speedsafe does the work that a wrist flick would otherwise achieve.

The flipper on this knife is a small triangle of the blade protruding when it's closed, and it's a simple matter of pushing this in for the blade to spring open. And boy, does it do that in a hurry. It's very fast, in my opinion, and clicks locked with a very nice sound too. This is what I find mesmerising - pushing that flipper to the exact point where the tension on the speedsafe takes over and flips it out. Even doing it this way, it still opens with confidence. It's a brilliantly balanced tension, and a very tactile experience to play with.

So, the opening is fun, what about the closing? Well, there again it's a very different experience to the BEE L05, in that there is a tension when closing the blade. This is putting the stress back into the knife so that the speedsafe system can open it again next time. If all you have ever used is unassisted knives, when you first close the Leek it feels quite weird. Obviously it is harder, and a fraction riskier also. If you slip in some way and fluff it up, the knife is likely to spring back open again. This is something to be careful about then. The technique I use is to push the blade home using my thumb as well as forefinger.

If this is a candidate for your EDC knife, then there is a strong chance this is going to spend some time in your pocket. So what's that like? Well, to start off with, consider the safety. You do not want a sharp little knife like this opening up in your pants, particularly if you are a male! Just thinking about it makes me cross my legs. So let's have a look at another interesting feature of this knife - the blade lock.



Ignoring for a minute the pesky hair that managed to get into the mechanism when I took the shot (hey, this isn't a safe queen, it gets crap in it), you can see the lock at the end of the knife.The screw on the outside slides up and down to lock or release the blade. On the inside I believe it is made of plastic so that it should not dull the knife if you try and close it with the knife lock in the locked position (and it hits it). Actually, if you do do this (and I never have, but just tried it now to see what would happen) the tip of the blade is just out of the knife, which isn't good, as it might feel to you like it's both closed and your brain might think also locked. SO be aware of where that sliding lock is, ok! My knife has a good tension on the lock, but I can imagine it could be also an issue if this was either too tight or too loose - although I believe it can be adjusted with the torx screw.

One other thing to mention while this picture is in your mind is to observe the very fine nature of the blade tip. It's one of the thinnest and pointiest (is that a word?!) tips of any knife I own, and because of this it is very fragile. The tip is perfect for very fine cutting work on something soft like paper. However, let me tell you a little about mine. I was opening and closing the knife at my desk as I often do, because as I have already said it give me pleasure and also then I have muscle memory on how to do it without thinking and can deploy instinctively. Anyway, I was also multitasking and was looking at my computer and drinking a cup of tea. I opened the knife just a fraction close to my cup of tea and the tip hit the mug, just. That was enough to break off a tiny piece of the tip - no smaller than a pinhead - that was the very very tip. If you looked at it now you would still consider it to have a fine tip on it, but I know it was even sharper. So it doesn't take much to lose the factory tip, which is a negative with this knife.

Anyway, back to the pocket carry issue. When you put it in there, it is best to lock it first. Now, if you think about it, this makes it slower to deploy from your pocket as you then have to unlock again. It is possible to unlock it and then move the knife around to open it all as a one handed movement, but it's not exaclty quick or elegant. I do like the idea of having a lock, but like so many things in life, the solution to one problem creates more problems. At least you have the freedom of choice to use it or not, as you wish. Also, for people that care, it's a tip down right handed clip only. The clip itslef is sturdy and just right in terms of getting on and off your pants, so it's a good clip.

Overall I really, really like the Kershaw Leek. It's a terrific knife for light duties, and is easy to carry and deploy. It's light and mine came wicked sharp, and still is. The ergonomics are very good, and the features of the speedsafe and blade lock make it somewhat different to other knives. It is very satisfying to just spend some time opening and closing this knife, almost absentmindedly, while you are doing other things. I like the way it looks, and I like the way it feels. It's not a heavy duty knife, and the tip needs care in particular, but it will handle most everyday cutting tasks so it makes a decent EDC knife. It's also not very expensive, so I'd recommend it fairly unreservedly.

2011 - Economic Predictions

NOTE : OK, I know it's September, and the year is almost over, but I noticed this post in "Draft" status. I wanted to get back to it and add a few more items when I started it in January, but didn't. You will just have to trust me that I have not fiddled with any of the numbers, as I post it now without any editing. Pity I didn't post this back then, as my call on Gold and Silver so far is pretty spot on.

Well, hot on the heels of my 2010 wrap up, I thought I'd try my hand for the year ahead. Hopefully I'll do better with the accuracy than last years effort. My defence is that, of course, this is not easy stuff to get right and at least I'm giving it a go!

So, without much more to say in terms of introduction, let's get into it!

1. Gold and Silver will wobble, but will continue to do well. 
As I write, gold is close to all time highs at $1420, and silver is $30.90 in US dollar terms. By the end of 2011, I predict $1800+ gold and $40+ silver in US dollars. $2K gold is not unlikely. Keep in mind thought that nothing goes straight up, and there may be some big swings in there somewhere. I think gold might come back to $1250, and silver to $24, or even more dramatically to $18. If it does, whatever you do, buy some! Gold and Silver will keep setting new highs in the year, and silver in particular may break out in spectacular fashion. Think $50+. If it does, it may also crash back down a way too after a time.

2. Trouble with treasuries will come.
I predicted it for 2010 and missed because QE and more QE2 helped keep the circus going. However, I don't believe the world will watch this show for much longer. They really can't afford to raise rates more than a percent or so without bringing so much pain to the US economy that it would instantly implode. I don't think they will make it much past 6 months into 2011 before TSHTF, and it may even be more like 3. However, the Fed has shown an amazing capacity to hide the sausage with the market and the terms of QE2 were sufficiently vague that they can ramp it up or extend it as needed.

3. Geopolitics... will just hold in 2011.
I got this wrong in 2010, and I might get this wrong in 2011 too, but I am thinking that this game might just last another year. The country that's hogging a lot of news space is China, and they have a country with mind boggling numbers. Can they keep control? I think they will until 2012, when they won't. Other troublesome places? Spain.. as the country that's Too Big to Bail in the EU and will probably go supernova in 2011, but somehow it will be papered over, and the can kicked once more just a little further down the road. Again, it's 2012 when all these chickens will come home to roost. North Korea? Maybe, but I don't think so.

Saturday, August 27, 2011

Microsoft Access Database Autoupdate

or

"How can MS Access update the clients with the latest front-end database I put on the server automatically?"

Consider the situation where you have developed a Microsoft Access application, and have it installed with a user base in an office of more than a few people. If you have a new version, going to each machine to upgrade them all each time is a pain.

In the old days (pre-2000) you could have the data and front end databases both located on a file share on a server and all would be good. You could even develop the code while people were using it! All the users needed was a shortcut to the database and this never changed. Very convenient.

However, since 2000 "progress" was made, and the recommended solution was to have a copy of the front end database local to each user. If you didn't follow this friendly advice from Microsoft, the front end database would get corrupted very quickly, which as they say in the classics, was bad. The actual tables (data) are still located centrally and linked in, along with any SQL server tables etc. These didn't corrupt despite being shared, or at least, not as often. Anyway, this setup presented a problem for the developers - how to now roll out a new version of the application.

Like most problems, there are several possible solutions. The one I discuss here is one I created and used in production for a while, and it worked quite well for us. The only slight trick is having two version numbers - one in the local code, and one in a table. Here is the setup and a rough guide to the steps without the full code --

General Setup

  • Create a table called "tblVersion" with a field called "Version" of type text.
  • Have one record with the version number, such as "1.0.0" to start off, in this "Version" field.
  • In the main form of the application, create a constant in the code behind called constTHIS_VERSION, with the value set to "1.0.0" again also.
  • In the same main form, have an event somewhere (onOpen) that checks the version constant versus the version in the table. 
  • If they are different (and you could check more recent, but I like the idea of being able to rollback) then you make the upgrade button visible and warn the user with a dialogue box that a new version is ready to be upgraded to. You could bypass some of this and just make it fully automated, but I like giving the users the control on when to do the upgrade myself.
  • If the upgrade button is pressed, you call the OS to run a BAT file and exit the Access application immediately.
  • The BAT file pauses for a few seconds (to allow for the quit), then copies the front end database from the known server location to the local C: drive location.
  • When the copy is done, it calls MS Access with the database as a parameter to re-launch the database. Note that different versions of Access have different paths to the executable, and different OS's also (eg Win 7). There is a one-off edit of this BAT file per machine to make sure this is pointing to the right place. If you have a SOE (Standard Operating Environment) then this is a non-issue.

Upgrade Steps

So when you have a new version of your database, what do you need to do to roll that baby out?

  • Edit the main form in the new version and change the constant to a new version number (eg "1.0.1")
  • Copy the new version to the server location with the standard name, eg "myDB.mdb"
  • Edit the database table "tblVersion", and change the version number (eg "1.0.1")

Code


So there are two main bits of code to consider here. One is the checking of the version numbers and launching of the BAT file in Access, and the other is the BAT file contents. Both are pretty simple when it comes down to it.

Code in Access

First, the code behind the events. I bound the form to the version table, and had the field "txtVersionFromTable" in an invisible textbox.You could use a dlookup instead.

Const constTHIS_VERSION = "1.0.0"

Private Sub Form_Activate()    
    DoCmd.Maximize        
    ' Set the string on the form, so users can see what version they have.    
    txtVersion.Caption = "Version " & constTHIS_VERSION  
    'Check version    
    If [txtVersionFromTable] <> constTHIS_VERSION Then        
        MsgBox "Version " & [txtVersionFromTable] & " is ready for download. Please update ASAP (by pressing upgrade button)!" ' This doesn't cause an infinite activation loop.        
        cmdUpgrade.Visible = True 'Show upgrade button    
    Else        
        cmdUpgrade.Visible = False    
    End If
End Sub

Private Sub cmdUpgrade_Click()    
    ' They pressed the upgrade button.    
    ' This code upgrades the LOCAL copy of the database from the server.    
    Dim retval    
    retval = Shell("C:\LocalDBFolder\upgradeDB.bat", 1)     
    ' This will pause to allow us some time to exit    
    Application.Quit    ' Get out now!!!
End Sub


Code in Batch file

Now the BAT file contents. You can copy/paste this code directly into a notepad file and save it as the "c:\LocalDBFolder\upgradeDB.BAT" file. It assumes F: drive is shared, but you can change that to whatever or even use \\servername\sharename instead.

echo off
cls


echo Waiting for Access to close...
sleep 8


echo Copying new version from server...
xcopy "F:\ServerDBFolder\myDB.mdb" "c:\LocalDBFolder" /Y


echo Relaunching Database..
sleep 8

rem "path\file to Access exe" "path\file to mdb"
rem You may need to check this line for different OS / Office versions


"C:\Program Files (x86)\Microsoft Office\OFFICE12\MSACCESS.EXE" "c:\LocalDBFolder\myDB.mdb"

Done and Done.

That's it! Easy, right?

One nice thing about this technique is that you can handle different versions of Microsoft Access in your client base. If you stick your front-end to "2000 format", then it can be used by 2000, 2003, 2007 and 2010 clients. The only thing to watch for is that re-launch line in the BAT file will need to be right. Same with the OSes - XP, Vista or Win7 all work with this.

If this technique helped you, please leave a comment!

EDIT : Tuesday 30th August : SLEEP command

Ah, I forgot that the SLEEP command in the batch file may not be installed. However, it is a free download as part of the Microsoft Server 2003 resource kit. Don't be alarmed, it will work on pretty much anything - XP, Vista, Win7 etc. Download it here. Copy the SLEEP.EXE to the client somewhere in it's path, such as the C:\Windows\System32 (for XP). Open a DOS window and type in SLEEP 10 to make sure it's working. For more on the SLEEP command, try here.

Thursday, March 24, 2011

Geiger Counter Antics - Part 1

Well, I recently bought a Geiger Counter. If you want to look at the specs, click here. It counts Alpha, Beta and Gamma radiation.

I have decided to measure, over the course of several days and weeks, the counts per minute around me. I will do a count outside (in my driveway) with the device pointing to the sky, and also indoors. Obviously the readings are somewhat random, so I'll take 5 readings and average them. Outside has a CPM of about 20 at the moment.

I also decided to take readings of various household objects, just for fun. One thing I was somewhat concerned about was the granite benchtop of our new kitchen, as I had heard of people with highly radioactive slabs. Ours does produce a higher count than ambient, about double in fact, but I am not worried about that. It's about the same as a common housebrick, with a CPM of around 40.

The only source of radiactivity in the house, that I know of, is in a smoke alarm. I had a spare one, so I took it apart just enough to expose the metal housing of the radioactive unit. That is, I removed the plastic cover only. There is a sticker that says it has a tiny piece of Americium in it. A direct reading on this metal housing gave a CPM of over 100. Moving away a few centimeters and taking a reading it dropped off considerably back to background levels. Don't panic about your smoke alarm, it's not going to kill you unless you break it open and eat the contents, and even then I'm not sure it would be a lethal dose. Still, I don't recommend it.

I wonder if the issues in Japan, which are a long way away, will show in my readings. Time will tell, and I'll get back to you on that.