Archives for : June2012

Taking Powershell with you

I’m a huge fan of the command line. There’s nothing you cannot do from the command line in Linux; in Windows, things were a lot harder. For too long Microsoft focused on GUI and neglected the command line. (This is still noticeable where the terminal window on windows is concerned, which is still decades behind Linux. I’ve used Console2 for ages, but I just discovered Scott Henselman’s blog and he suggested ConEmu and I’m giving that try now. Looks very good.)

Where Windows has finally caught up is PowerShell. It’s a command line shell, scripting language and all round bad-ass tool. Unlike Linux shells, it’s fully object orientated; whereas BASH and ZSH etc all need to pass strings around, PowerShell uses real objects. This post isn’t really about evangelising PowerShell but if you’re doing any kinds of technical work on Windows, then you should be using PowerShell.
I love customising the environment I work in to make it perfect for me. The annoying thing is that I work on many different computers and it’s a pain keeping all those settings working together. A while back I came across a trick to get VIM settings synced using Dropbox (or a similar cloud file store). I set out to do the same with Powershell.
There’s really three principle things I wanted to do:
  1. Ensure all my computers use the same profile
  2. Ensure all my computers have access to the same modules
  3. Allow computer specific settings to be set easily
I was surprised at how easy it actually was. It took some tweaking to get it perfect, but here his my solution.
PowerShell keeps everything it needs in c:users<login>DocumentsWindowsPowerShell so the first thing I did was copy everything out of there into a folder in Dropbox. I used Settingspowershell.
I now needed a way to connect my actual profile, with the one powershell loads by default. This has to be as simple as possible, since it’s what I’ll need to do on any new computer and I don’t want a dozen line check-list.
Turns out, powershell is happy with a simple dot-source of my profile in the new location. So (since I have different user names at home and work) I calculate the profile location in dropbox and source it. It worked.
I then tested this on another computer and discovered an interesting issue. Dropbox of course downloads files from the ‘net and Windows immediately flags them as being downloaded. PowerShell detects this and won’t run them unless signed. (They’re remote scripts and hence a security risk). I’m therefore lowering the security permissions to allow this. (A better solution might be to remove the download flag on all of them, but there’s a lot of files once modules are included, so this will do for now.)
My profile.ps1 now looks like this:

Next was getting my modules to load. I started by trying to look at way to manipulate the path or to automatically copy the modules to the Powershell folder. This was ridiculously convoluted and there had to be an easier way. It took some searching, but I eventually came across $env:PSModulePath. Yep, the search path for modules.

I therefore mapped a drive to my modules directory and updated the modules path:

My modules all now load without any problems. Note that powershell: is a mapped drive as well.PowerTab was causing some issues, but I fixed those by moving the settings file into the AppData folder; which can be set in the first run wizard. Best solution in any case as different computers will have different things installed, and might need different settings.

That’s all working. The final thing is custom settings per computer. This was actually the easiest, especially once I’d figured out everything for the other two of my requirements and I was able to simply write it:

This looks for a file called profile_<computer>.ps1 and dot-sources it. Simple.

You may wonder about some of my strange variable naming. I tend to like things neat, and I create a whole load of variables during my profile initialisation. I therefore have a naming convention for variables I don’t need once the scripts have finished running, as a side effect of dot-sourcing a script is that the variables don’t drop out of scope.

At the end of my profile therefore I have:

and all my script variables are gone and I’m left with a very neat Powershell session that works the way I want it to, on any computer.

Reflections on Diablo III

Diablo III has been out for a while and I’ve been playing it a fair bit. I thought I’d share my own views on the game, to add to the general level of noise on the internet about it.

There is very much complimentary to say about Diablo III.

The graphics are gorgeous. The generated levels and dungeons slot together seamlessly. You do start to recognise elements, but it never becomes jarring or obvious the way it has for games in the past. There’s no “tiles” as it where, and any that exist are very large and not distracting.

The cut-scenes are gorgeous, in true Blizzard style, and put many so-called “blockbuster movies” to shame.

The story is simple and a bit clichéd, but carries you through the game fairly well, it was hardly meant to be the primary focus of the game and what there is of it is enough to keep you mildly engaged while you’re playing, at least during the first or second play through.

Unfortunately this is where we start running into the problems. There are four difficulty levels and each one is supposed to be a much harder challenge than the previous. This is certainly true, but the difference seems very artificial. The enemies get more abilities, they get more health and they do more damage. So much so that there are far too many one-shot kills and often enough you can run into a group of the more challenging “elites” or “champions” and you’re dead before you even realise it.

The challenge to beating these enemies is very artificial. I’m playing a wizard. I should do masses of damage to compensate for the fact that I have little healthy and no real armour. In the first play through you can just use your primary and secondary spells and you’re fine. In the next you need to start using all your skills, and start running away quite a bit. In the next difficulty you are running all the time with barely enough time to cast a spell. Often enough if you do stop to cast a spell the mobs catch you and you die. Beating these enemies becomes a case of simply running away and dying.

There’s no real way to beat these enemies by changing your strategy or spell selection. The mobs get to trap you and pin you into place, but there’s no real spells that allow you to do that back to them. The enemies get abilities (and more of them for each difficulty level) and some combinations are just so impossible to defeat that no matter what strategy you employ you have no real chance. Take elites with “invulnerable” minions. That’s right you cannot damage those extra mobs, but they can damage you. You also as a wizard cannot cast your ranged spells at the main mob because the shielded ones are in the way. The entire fight becomes a case of just running around and trying to sneak a spell past the invulnerable enemies. Run in the wrong direction and more enemies appear, wait a fraction of a second too long after casting a spell and you die, or get trapped by running in the wrong direction and die.. or get trapped because the enemies also have the “waller” or “jailer” ability as well. One or two hits and you’re dead. There are other ability combinations equally frustrating. It should be a challenge, it should require you to learn and plot and improvise, but there’s nothing in the game that gives you those options.

The only real way to beat these fights is to have decent gear to bring your damage and armour/health up high enough to be able to take the odd hit while running around in circles. There’s no point changing your strategy, because there’s really only one strategy that works.

That’s the next problem. There’s no really good loot drops. Masses of loot drops but it’s all crap. You might get an upgrade item for one in a thousand drops. The loot is random, but it’s a bit too random; or maybe their algorithms are broken. For some reason my wizard gets a massive amount of quiver drops (which he can’t use). I’m level 58 and still wearing some rings I picked up around level 20-30 because in the 30 hours of game play since, I’ve not had a single ring drop that’s better than the two I already have.

Replaying earlier parts would be a lot more fun if you the loot that dropped could actually be an improvement, but for the most part you look at what drops and it’s stuff you might have liked 10 or even 20 levels earlier, but it’s nothing as good as what you have and certainly nothing as good as you need to beat the current hardest enemy you’re facing.

This leaves you with no real choice but to farm for gold and buy stuff from the auction house. Unfortunately there are gold sellers running rampant in the game and inflation in the auction house is out of control. An upgrade for one of my rings (just a simple magical ring with some better stats) is listed as millions of gold. According to my stats, I’ve collected 1 million gold in the 70 hours of play so far. How am I supposed to pay for items then? I’m not a student any more, I can’t play for 12 hours a day, every day.

The gameplay issues are bad enough… add to that that this game requires an always-on internet connection and the servers are collapsing under the load and there are whole evenings and weekends where you cannot even connect to play and I’m glad I got this game as part of a deal and didn’t pay for it directly.

The game is becoming more and more monotonous and, in truth, boring. Things that might keep you playing, like the thrill of getting good loot, or a great drop, isn’t there because drops are so far and few between that by the time you get one any thought or chance of excitement has long been replaced by frustration and exasperation and your only response is “about bloody time”.

Maybe Blizzard will fix it, maybe not. For a game that’s supposed to be “infinitely repayable” it’s very disappointing. There are better games out there, Torchlight, springs to mind; maybe not as polished graphically and musically, but certainly less frustrating to play.

In the scheme of things though I’ve got 70 hours of entertainment out of a game that retails for about €55, and I’ll still get more, as I play through the game with the other classes. Compare that to a cinema ticket of €11 for 2 hours of entertainment, or a football match for €60 (or a lot more) and it’s certainly good value. It just could have been so much more.

Encounters with Dutch Medicine

I’ve been in the Netherlands for a few months now and for various reasons I’ve had the need to interact with the medical entities here quite a bit.

Like everything new, it can be a bit confusing to start with and getting your head around what’s happening and what is expected can be a bit daunting.

It starts with getting health insurance. Health insurance in the Netherlands is compulsory, everyone in the country has to be insured. Insurers are not allowed to refuse you cover, nor are they allowed to require special conditions; questions someone from the UK might never have considered, but Americans are probably very used to. Most hospitals and medical establishments appear to be private, not-for-profit organisations. Wikipedia (as usual) as has more details for those interested.

A “basic” package includes essentially everything needed to keep one alive and functioning, this is covered in part by employer contributions from payroll and in part by your own contributions to insurance. Some things, like GP (Huisarts, lit. house doctor) visits are fully covered and you’ll never pay towards them. I’m sure there are others but I’ve not yet encountered them.

Prescriptions are covered by a form of co-pay scheme where you pay up to an annual amount that’s mandated by the government, this year it’s €218. That means you’ll pay the first €218 of your covered costs in a year and after that your insurance pays everything else. My insurer gives me a nice little summary bar chart of what’s left for me to pay.

You can decrease your monthly insurance costs by increasing your “eigen risico” (lit. own risk) but I was recommended not to by my employer.

In addition to the basic package the insurers will tend to then offer cover for additional services, mine for example (and I tried my best to get it removed) is cover for “alternative” medicine, like homoeopathy, but it’s in the standard package offered because people seem to like paying over the odds for water. More sensible things are mental health, dietary advice, elective surgeries, even health spas and similar things. Generally the difference between the different levels of cover is how much you have to pay before/after the insurance kicks in.

Dental is usually not covered, except it seems for children under eighteen. I know I need to visit the dentist twice a year, so I had dental insurance added. I’ve always paid a fair bit on the NHS when I went to the dentist, and the hygienist was never covered by the NHS, whereas it is covered by my insurance here. I’ve had an hygienist visit, a check-up and two fillings repaired and I’d say I’ve probably ended up paying a third or half more than I would have on the NHS (including my insurance cost). Looking at private dental costs charts in the UK I’d say prices are comparable, if possibly slightly cheaper in the Netherlands, although I’ve not done an in-depth analysis.

Once you have insurance things are actually fairly simple. I haven’t handed cash or debit-card over to anyone at all since I was here. Even in the UK you are expected to pay for prescription charges up front (unless exempted); not so in the Netherlands. Once they have my insurance details everything goes via the insurer, so I pay nothing at the counter, not at the doctor, pharmacy (for prescriptions) nor at the dentist; which makes a nice change from the UK where I had to hand over cash/card all the time, even for NHS stuff.

Finding a doctor was fairly simple as well. There’s a nice website where you just type in your postcode and all the doctors, dentists, etc. in your area listed with contact details and ratings (there don’t seem to be too many of those yet, so probably not that reliable).

I found my doctor by looking them up there, then going to their website and signing up as a new patient. As it happened my health took a turn for the worse shortly after and I then phoned them up. The answer machine had an option for English, which is nice, and I was able to make an urgent appointment for the next morning (none of this” phone before 0900h for a same day appointment” I had at my UK doctor). My first appointment actually lasted 45 minutes, much longer than usual, but I never felt rushed, which is also a nice change from my UK GP experiences. I consider both my UK and Dutch surgeries comparable as they are both GP collectives (can’t think of a better term right now) where you have multiple GPs working out of a single surgery and sharing the load. Unlike my UK surgery though, the Dutch one assigned me a doctor and will do everything they can to make sure I always get “my” doctor. In the UK this was merely a formality and they gave me whatever doctor they felt like for the appointment, unless I specifically asked for one by name.

The doctors all speak excellent English so I had no problems talking to them, the doctors’ assistants (I might be doing them a disservice, but they seem more like receptionists to me) are a different matter, none of them seem to speak English, so that can be a bit interesting at times as I try out my slowly improving Dutch on them.

Things were sorted out for me pretty quickly. Blood tests done the next day, results and medication to deal with what was found. Interestingly doctors here won’t sign you off work, not even recommend if you should go in or not; that’s up to you and your company’s doctor (who I have yet to speak to, not sure my company even has one).

Medication I got from the in-house pharmacy and again I had to hand over no money, it all goes direct to my insurer. If the medication isn’t covered, then it’s added to my “own risk” and/or I get a bill. The only time I was required to pay for medication was for something that’s commonly abused and the insurance just flatly refuses to pay for; an understandable attitude.

Unlike the UK, every prescription you get from your doctor is, seemingly, a repeat prescription. That is, once you’ve been given medication once by your doctor, you can keep going back to the pharmacist for more; at least that’s how my doctor explained it to me; I’ve yet try it out. This might explain why the insurer refused to pay even for a prescription medication.

Talking of medication, one thing that’s different is the level of restrictions on medication. Things I used to buy in the supermarket in the UK are prescription only over here. Cocodamol (paracetamol and codeine) for example. Even things like the cetrizine antihistamine is only available in packs of seven from the pharmacy, whereas I could buy it in packs of thirty from the pharmacy in the UK. Getting the prescriptions is not difficult, just need to ask the doctor. Dosages are also slightly different, my painkiller here in Netherlands is stronger now; 500mg/10mg (paracetamol/codeine) instead of 500mg/8mg that I used to get in the UK. One thing this means is that, once my “own risk” is used up, I won’t be paying for these medications any more for the remainder of the year; whereas the NHS would never have paid for these.

Keeping track of my insurance is easy as well. My insurer provides a nice website, which I log into using the government required “DigiD“, which is also used for things like my taxes (a federated security model, for those that are interested). Once in I can see everything that has gone through the insurer (see left, vergoed = reimbursed), how much is covered, what isn’t, what’s left of my “own risk” (see above) and an itemised breakdown, (see below).

Dentist, GP and pharmacy.

All in all, my experience with Dutch healthcare as been pretty favourable. As I’m required to pay for it now I’m actually pretty pleased with the way things are organised and presented to me, in many ways it’s actually more convenient than what I was used to under the NHS. In some ways I’m actually much happier here than I was in the UK, but I’m not sure if that’s a systemic difference, or because of the doctors’ offices I happened to have chosen in each country.