Cheap(ish) Priest Deck for Tavern Brawl 2015-07-22

The Hearthstone Tavern Brawl for this week (i.e. starting on the 22nd July) is “Heart of the Sunwell” – you start at 10 mana, and construct a Brawl-specific deck. Lots of people over on the Hearthstone SubReddit are saying those players with the most legendaries will win, or variations of “Alexstraza > Ragnaros > win.”

I don’t have a particularly wide choice of Legendary cards, or a huge number of good high-cost minion cards, so I had to come up with an alternative. My plan was to use a Priest deck with a few counters and a couple of neat tricks. The deck I used is below:

Silence x 2
Inner Fire x 2
Mind Vision x 2
Divine Spirit x 2
Resurrect x 2
Shadow Word: Pain x 2
Shadow Word: Death x 2
Thoughtsteal x 2
Faceless Manipulator x 2
Lord of the Arena
Core Hound
Ravenholdt Assassin
Force-Tank MAX
Mind Control x 2
Shadow Madness

This deck does include some legendaries, but they’re not essential, and are really just there to enhance the effectiveness of the other cards. Kel’Thuzad is probably the one I’d want most out of all the legend cards, given his ability to resurrect dead cards – allowing you to clear the board (almost) with abandon.

The basic strategy is to always have at least one Taunt and one “attack” card out there. Use your Shadow Word cards to clear anything nasty you can’t clear more efficiently, and use Mind Control, Mind Vision, Thoughtsteal, and Faceless Manipulator to “steal” your opponent’s best tricks and put them under pressure.

I won several games in a row with this deck, usually by turn 5/6, and often by turn 3. Key minion cards proved to be Force-Tank MAX, Sunwalker, and Faceless Manipulator. The only game I lost was to another Priest running Deathwing, which cleared the board when I had no decent follow-up in hand, and 18 health left.

What decks have you had success with this week?


How To Get The Samsung-Exclusive Hearthstone Rewards Without a Galaxy S6

There’s currently a cross-promotion happening between Blizzard and Samsung: if you own a Galaxy S6, and play Hearthstone on it, you can claim 3 free packs and a rather nice exclusive card-back.

Of course, The Internet loves to figure out how to get free/exclusive stuff without paying for it, so naturally, some bright spark figured out how to hack the Genymotion Android emulator (running on a PC) to trick Hearthstone into thinking it was running on an S6 – so simply login to your Battle.net account to claim your cards. The original post is linked above, but I’ve cleaned up the instructions below (as they were changed a few times to fix some errors), including some direct links to downloads and a throwaway Genymotion account, as Genymotion’s  account creation process was down at the time of writing.

  1. Download Genymotion to your PC, and install it.
  2. Start up Genymotion, and click the “Add” button
  3. When prompted to login, use one of the accounts on this BugMeNot page
  4. Create a “Samsung Galaxy S5 – 4.4.4 …” device using the defaults
  5. Start the virtual device
  6. Open the Settings app. Click Security, then tick “Unknown Sources,” while clicking OK to any warning prompts
  7. Press Ctrl + Home to return to the home screen
  8. Open the Android browser app from the dock. Search for the Amazon App Store, and download it from Amazon’s site (I can’t help much here, it took me some clicking around to get the download)
  9. Drag down the notification area at the top of the screen. When the Amazon app  has downloaded, click to install it, while clicking OK to any prompts.
  10. Open the Amazon app. Sign in with your account, then search for and install Hearthstone
  11. Return to the home screen.
  12. Open the File Manager app. Click the icon in the top-left, then the cog in the bottom-left.
  13. Click on General Settings, scroll down, and change the mode to “Root.” Click OK to any prompts.
  14. Click the icon at the top-left to return to the file menu. Click on “/” (Home), then click the system folder. Click and hold on the file at the very bottom of the list (build.prop). When prompted, Click “Open,” then select the Editor option.
  15. Where you see `ro.product.brand=generic`, change it to say `ro.product.brand=samsung`. Add a new line which reads `ro.product.model=SM-G920F`. Save the file
  16. Close down Genymotion entirely.
  17. Reopen Genymotion, and open up your virtual device again. Open up Hearthstone. If you can’t see it, open up the Amazon app, and it will offer to install it, giving you the option to open it once finished.
  18. When prompted, sign in to Hearthstone with your usual account. Take care to ensure the correct region is selected. I’m on EU, but the app defaulted to North America
  19. Once logged in, the menu will load and present you with your “Galaxy Gifts”! Enjoy!

The CASE of the Conditional Records

I’m working on a change request for a web service tied to an application we support at work, and I ran into one requirement (out of many) which I didn’t immediately know how to resolve. Maybe it was just the way it was worded in the spec, but it had me scratching my head for a good few hours before I got to the heart of the matter.

This post is mostly a reminder to myself to take a step back, and work through a problem in a notebook or similar; go back and forward a few times, from different angles until the puzzle is clear and you can find a way to approach it. Once I worked through it, and figured out exactly what was being asked for, the problem itself turned out to be significantly easier than I had first imagined.

The Problem

I have two linked tables of journey information: 1 for the journey record, one for each leg of that journey. For each leg, there could be up to 2 records, the planned leg (P), and the actual leg (A). When we return the results of the query, we want a row combining the flight information and the leg information, for every leg. The kicker was we never want to return a P leg record, when an A leg record existed. But we don’t know if an A leg record exists before we run the query.

[Side note – I am massively simplifying the data structure, and some of the problem for clarity and confidentiality]

 ---------------------------    ------------------------------------ 
| journey_id | journey_date |  | journey_id | leg_number | leg_type |
 ---------------------------    ------------------------------------ 
|     1      |  01/07/2015  |  |     1      |      1     |    P     |
 ---------------------------    ------------------------------------ 
|     2      |  01/07/2015  |  |     1      |      1     |    A     |
 ---------------------------    ------------------------------------ 
|     3      |  01/07/2015  |  |     1      |      2     |    P     |
 ---------------------------    ------------------------------------ 

So from the above data we want to return the following:

| journey_id | journey_date |  leg_number  |  leg_type  |
|     1      |  01/07/2015  |       1      |     A      |
|     1      |  01/07/2015  |       2      |     P      |

And not this, which a straightforward JOIN would produce.

| journey_id | journey_date |  leg_number  |  leg_type  |
|     1      |  01/07/2015  |       1      |     P      |
|     1      |  01/07/2015  |       1      |     A      |
|     1      |  01/07/2015  |       2      |     P      |

Obviously we need a WHERE clause in there, but like I said, we don’t know what records exist for each leg, so most common clauses aren’t going to give desirable results.

Effectively we are conditionally returning a record only if a certain other, nearly identical record in the same table does not exist – otherwise we want to return that record instead.

Additional Restraints

  1. Everything has to come from running a single SQL query against a table/set of tables. We can’t utilise Oracle packages or procedures. The query is embedded in the application and called as a prepared statement (to feed in the “real” filtering criteria later). We can use functions, but should be mindful of the performance implications
  2. We can’t do any “post-processing” of the data in the web service application code. Well, we could, but it’d be costly and clunky to do in the current framework.
  3. Everything should (obviously) be as performant as possible.


First Attempt

An infrequently used, but powerful, part of SQL is the CASE construct:

	WHEN foo THEN bar
	ELSE baz

By utilising a CASE statement and some subqueries, I could check if a row was in the actual legs of a journey, or whether it was a planned leg and there was no matching actual leg:

SELECT  j.journey_id, j.journey_date,
		jl.leg_number, jl.leg_type
FROM    journies j, journey_legs jl
	WHEN (jl.journey_id, jl.leg_number) IN
	     (SELECT journey_id, leg_number
	         FROM flight_legs
	        WHERE journey_id = fl.journey_id
	          AND leg_number = fl.leg_number
	          AND leg_type = 'A') THEN
	WHEN ((fl.journey_id, fl.leg_number) NOT IN
	     (SELECT journey_id, leg_number
	         FROM flight_legs
	        WHERE journey_id = fl.journey_id
	          AND leg_number = fl.leg_number
	          AND leg_type = 'A') AND fl.leg_type = 'P') THEN
END) = 1;

Execution time: 1.8 seconds

Second Attempt

A nice start, the above query returns what we want, but it’s a bit bloated. Do we need the first subquery at all? No, it turns out:

SELECT  j.journey_id, j.journey_date,
		jl.leg_number, jl.leg_type
FROM    journies j, journey_legs jl
	WHEN (jl.leg_type = 'A') THEN
	WHEN ((fl.journey_id, fl.leg_number) NOT IN
	     (SELECT journey_id, leg_number
	         FROM flight_legs
	        WHERE journey_id = fl.journey_id
	          AND leg_number = fl.leg_number
	          AND leg_type = 'A') AND fl.leg_type = 'P') THEN
END) = 1;

Execution time: 1 second

Final Attempt

Awesome, we are getting the data we want, the query is running at an acceptable pace for the number of records we have… but it’s kinda clunky looking. We want to try simplify it if possible so it’s easier for anyone who comes after us to maintain. Is it possible to rewrite this to take out the CASE, and make it more readable? Of course:

SELECT  j.journey_id, j.journey_date,
		jl.leg_number, jl.leg_type
FROM    journies j, journey_legs jl
WHERE (jl.leg_type = 'A' OR
       (jl.leg_type = 'P' AND
        (jl.flight_number, jl.leg_order) NOT IN
       	(SELECT journey_id, leg_order
             FROM journey_legs
            WHERE journey_id = jl.journey_id
              AND leg_order = jl.leg_order
              AND leg_type = 'A')));

Execution time: 0.85 seconds

That’s a bit better for anyone who maybe isn’t familiar with CASE to understand, and has a bit of hierarchy to it so you can mostly see at a glance what it’s doing. I don’t think we can get rid of the subquery, but sometimes these things are unavoidable.


Starcraft 2: Legacy of the Void pre-order goes live – My Life for Aiur!


Never, ever pre-order games. That’s the general rule, especially given such recent debacles as the PC version of Arkham Knight.

But as with every rule, there are exceptions. The final entry in the Starcraft 2 series is – for me – one of them. Within 20 minutes of learning the pre-order for the digital editions was live, I had the deluxe edition ordered.

Starcraft is one of those rare gaming series I hold dear; I played the original on my very first PC, fell in love with the story, then had to wait over a decade until Starcraft 2 came along. When the first part, Wings of Liberty, arrived 12 years after Starcraft 1, I fell in love all over again, and all fears about how splitting up the game into 3 would work out. The 3 year wait for Heart of the Swarm was agonising — I loved the story being told so much I just wanted more!

Now we’re nearing the end, at last. The final chapter in the Starcraft saga will arrive sometime between now and March, and I can’t wait.

What are My Thoughts on Age of Sigmar?

I have none, because we haven’t seen enough full information – in context – to make any informed opinions.

And neither have you. I get it, change is scary. But stop whining on the internet about AoS before you have all the information. Please? It’ll make the transition much more pleasant for you, me, and everyone else.

I’m flabbergasted by how quickly it all went from “ok, this looks like it could be fun and interesting,” to “ZOMG! The sky is falling! F-you GW! This is the most ridiculous and crappy game EEEEHHHVVAR!

And it hasn’t even been officially revealed yet. Careful; your knee is jerking so hard you might do yourself an injury.

I do have one final, parting thought to leave you with:

If you want a balanced, tournament-friendly (and 1st-party supported!) Fantasy massed-battle game that plays like a “Warhammer 9th” – basically what everyone complaining the loudest seems to be lamenting Age of Sigmar is not – then I humbly suggest you go check out Kings of War. 2nd Edition is right around the corner, with the beta rules available for free download. A number of Warhammer Fantasy armies port over to KoW with little-to-no modification or need to buy new models. It’s fast, deceptively simple, fun, well written, and actively supported. If you’re up in arms about AoS, it wouldn’t hurt to check it out.

So I’m Building a New PC

I mentioned a few weeks back I was considering my choices for how to upgrade my aging computer equipment, and of the choices, building my own custom PC would be the most rewarding path to take. I swithered a bit on whether I really wanted to do this, but in the end I gave in to the temptation to build something entirely my own.

Great, I know what I want to do, now how do I get there? It’s been several years since I built a PC1, and I haven’t been keeping up with the trends, or what’s the latest and greatest in terms of performance, price, or anything really.

I had a few ideas of what I wanted – it needed to be small, as space in the office is at a premium. It needed to be as powerful as I could afford, so it would last a decent amount of time until it needed major upgrades, while being flexible enough to tackle many different types of task – development, gaming, photo (and potentially basic video/audio) editing, for example. In a perfect world, I wanted it to be as quiet as possible and look good.

The last few weeks have been spent doing research, going back and forward over potential configurations using PC Part Picker before settling on an outline of what I wanted. I took it over to /r/BuildAPC for a sense check, and was told my best bet was to change the graphics card for something more powerful than I had picked out. I rejigged a few things to make that possible, and ended up with the spec below:

Type Item
CPU Intel Core i5-4690K 3.5GHz Quad-Core Processor
CPU Cooler Cooler Master Nepton 120XL 76.0 CFM Liquid CPU Cooler
Motherboard Asus MAXIMUS VII IMPACT Mini ITX LGA1150 Motherboard
Memory Corsair Vengeance Pro 8GB (2 x 4GB) DDR3-1866 Memory
Storage Samsung 850 EVO-Series 250GB 2.5″ Solid State Drive
Video Card Gigabyte GeForce GTX 960 2GB Video Card
Case Silverstone FT03B-MINI (Black) Mini ITX Tower Case
Power Supply Silverstone 500W 80+ Gold Certified Fully-Modular SFX Power Supply

The graphics card might still be swapped for another, similarly specced one, but otherwise this is what I’ll be building in a little over a week’s time, when I have some time off. I’ll be talking more about the build, closer to the time, as I have a few things planned which will make it a bit more interesting than just a straight PC build

  1. It was in 2008. I checked my order history. 

Strange iPhone Reboots

Over the last couple of weeks, my iPhone 5S has been rebooting itself during the night. Once (last Saturday) it got stuck in a reboot loop on the Apple logo screen. Strangely, it seemed to be emitting some kind of tone every time it restarted… maybe that was my woken-at-3am brain imagining things, but I’m sure it also made a noise in the early hours of this morning when it rebooted.

The most annoying thing about this, is that it’s only happening at night, while I’m asleep. I know it’s happening because my lock screen tells me so, and I can’t use TouchID to unlock the phone. That, and the fact the display flashing up the stark white loading screen sometimes wakes me up. Throughout the day, everything appears fine. It’s really quite bizarre.

I’d reset the phone to factory settings, but there are a couple of security-related apps installed which would be a massive PITA to have to de-authorise and set up again.

Has anyone else experienced this?

Mistakes Were Made (Google Account Follow-up)

Earlier on I was trying to find a way to “downgrade” a Google Apps account to a personal account. Well, I found a way. Kinda. Ok, not really – I slipped up and deleted my Google account.

I was a bit naive about what removing a Google Apps subscription entailed. In the absence of any clear documentation, I assumed hoped it would remove the baggage of Google Apps, leaving me with a normal Google personal account (especially as the account predated Apps). It didn’t actually remove Google Apps… but it did remove my access to pretty much every useful Google service. I was locked out of Drive/Docs, Browser Sync… everything I use on a regular basis.

It turns out, that if you want to delete Google Apps, cancelling your subscription is only a partial measure. Whereas in most services “cancel subscription” means “I’m done, so remove all my stuff and let me go” if you want to cancel Apps then you have to cancel, and then do the non-obvious step of explicitly deleting your domain from the service.

At this point, my choice was: buy a new subscription to Apps, putting me back to square one – only paying for it, or completely delete everything to do with the Apps account. So deletion it was.

Eventually I tracked down where in the mess that is the Apps admin area I could find the delete domain button, held my breath, and clicked.

Milliseconds later I was dumped out of Google Apps, and everything was gone. Everything.  Even the stuff you’d forgot about, like your Google+ profile, oAuth logins to other sites or logins on other devices, and accounts you forgot were merged, i.e. my YouTube account and subscriptions. My iPhone complained, WordPress complained, Feedly complained, Chrome complained, and so did many, many more! Years of settings, data, and integrations, gone in a button click.

Immediately I had a wave of regret, but also a slight sense of a weight being lifted. I no longer had to worry about the schizophrenic nature of my old account. If I wanted to try a new Google service, I didn’t have to wait for it to be Apps-enabled. Yes, a whole bunch of data was gone, but in a way, that was good. I would be starting over from scratch, without all the cruft that had accumulated over the many years.

So I guess it’s not that bad, really. Just a little inconvenient in the short-term. I’ve created a new account, relinked any complaining devices, and generally started rebuilding.

But please, Google, make the whole Apps/Account integration more user-friendly!