Sunday, 20 July 2014

Hmm. How many people would be interested in minecraft cheat sheets for Mekanism, ProjectRed, JABBA etc?

I've been a avid fan of Minecraft for some time.
I tend to always "build" in survival mode.
And since I'm just shy of 60 I tend to forget the recipes and have to sit there running back and forth between a tool station and chests as I use the '?' button to remember what I need to make stuff.
So in sheer frustration I created a series of A3 PDFs of various components I use regularly, printed them out and stuck them to my wall.
Then I could just glance sideways and know what I needed.

Because I may be over-stepping copyright boundaries and what not, I decided to contact the authors of the various mods to see if they would be amicable to having me make these available outside of their 'official' wikis.

No response.

Hmm. Ok. It's only been a coupla days... So I thought I'd ask my readers if they would be interested in giving feed back that I could use to bolster support.

So you're not left hanging as to what these sheets look like here are some partials I took:






So... Any bites? I'll gather results and pass them on to the authors of the ModPacks and see if I can get these out there...

Your call...

Ta muchly
Kimbo

Wednesday, 16 July 2014

Minecraft - Sieve Automation

You have a mouse.
It has a right boo-ton. Yes. That's how you pronounce it...
Not 'T-u-n', but 't-o-n'.
Booo-Ton.
(Watch YogsCast on YouTube for how you pronounce stuff. Like Bah-bee not Bay-Bee)
Anyway.
Rant over.

So to avoid RSI of one of your fingers...
Get your sieve.
Fill your inventory with Earth or Gravel or what the frick ever.
Carefully right click to start the process.
And then gently place a reasonably heavy object in the same spot your RSI addled finger was.
I use an iPad cover.
Then you can safely sit back and watch shattered ores, seeds or what-the-frick-ever fill your inventory.
While you sip (or gulp) at your favorite beverage.
(Mine's bourbon).
So PLEASE stop searching for some mechanistic approach and go back to basics.
You have a mouse.
It has a right boo-ton.
You have a heavy object.
You have a glass of your favorite beverage.
Thimk.
Thimk.
Do... There is no try. There is only Dig or No-Dig.

Wednesday, 21 May 2014

People wear hats in Peru! Because: Aliens!

Re-Watched Chariots of the Gods by Erich von Daniken for the first time in years.
(Ref: http://en.wikipedia.org/wiki/Chariots_of_the_Gods)
I first watched it in 1971 (I think) when he was touring the world showing it in school/church halls.

ROTFL.

Can't believe I ever took this seriously.

The process is something like this:

"People in Peru wear hats. Here are pictures of statues on Easter island. The hats are strikingly similar."

"Huge stone blocks! Pyramids! Thousands of tons!"

And so on.

It's never explicitly stated but the underlying message that should be added to every sentence is:

BECAUSE: ALIENS!

Sorry.
Nope.
The past is human and when this kind of bollocks is produced and distributed it demeans the achievements of our ancestors.

Here is a table:


+---------------------------+----------+
| Question:                 | Because: |
+--------------------------------------+
| Vimyana?                  | Aliens!  |
| Ark of the covenant?      | Aliens!  |
| Wall paintings of people? | Aliens!  |
| Ezekiel?                  | Aliens!  |
| Hats?                     | Aliens!  |
| Maths?                    | Aliens!  |
| Legs?                     | Aliens!  |
| Brains?                   | Aliens!  |
| iPhone?                   | Aliens!  |
| Democrats?                | Aliens!  |
| Republicans?              | Aliens!  |
| Sean Hannity?             | Aliens!  |
| Putin?                    | Aliens!  |
| Glenn Beck?               | Aliens!  |
| Obama?                    | Aliens!  |
| Taxes?                    | Aliens!  |
| Big Foot?                 | Aliens!  |
+---------------------------+----------+

Depressingly familiar, no?

And just for the heck of it, go to http://aeon.co/magazine/ and read some of the articles.
I was particularly entranced with:

http://aeon.co/magazine/world-views/beauty-is-truth-theres-a-false-equation/

And:

http://aeon.co/magazine/world-views/logic-of-buddhist-philosophy/

As it has a lot to do with:

http://www.gizmodo.com.au/2014/05/programming-sucks-why-a-job-in-coding-is-absolute-hell/

Because I'm a developer and *KNOW* the web consists of chicken wire and chewing gum.
We're all doomed.

Because: Aliens!


Friday, 25 April 2014

Was capitalism cancelled without me being informed? Ah rats. I'm a dummy...

Got up this morning at the usual time (around 6am), showered, dressed, grabbed a cup of coffee, took my medication all in my usual morning daze.

Then got in the car and went down the driveway.

As I prepared to turn onto the road I noticed that the apartment construction site just down the road was deserted.

"Odd," I thought, but drove on with my head filled with plans for the day.

As I drove onto the main road that led to where I work, I noticed a distinct lack of vehicles. Bugger all in fact.

"Odd," I thought, but drove on with my head filled with plans for the day.

I passed a shopping centre and noticed the car park was empty.

"Odd," I thought, but drove on with my head filled with plans for the day.

I got to work and drove into the public car park staff area.
No cars. None. Nil. Zip. Nada.

"Odd," I thought, but got out, locked the car and went to the elevators with my head filled with plans for the day.

Got to the ground floor and out into the mall.

Normally bustling with activity at 7am, but now deserted.

Wait. Was capitalism cancelled? Had some massive disaster occurred that I knew nothing about? Was it the second coming? Hoping not on all counts, I walked to the entrance.

Then I saw a sign saying that there were Anzac Day services across the road.
I live in Australia.
Anzac Day commemorates the landing of Australian forces at Gallipoli during world war 1.
It's a public holiday.

Doh! I'm a dummy.

So I turned around, went back to the car and drove home feeling foolish.
And annoyed because I had a shit-ton of work I wanted to do at work today.

Monday, 14 April 2014

Avalanche Sharks!

"Avalanche Sharks". Oh lord it is so bad. I need to wash my eyeballs with bleach. A pineapple enema would be better. Is this Ebola? Or am I just bleeding from my eyes in shock? Demon sharks in snow? Wait. What? And what's with that dog? They've tasted human flesh! Oh why, oh why do I watch these movies? Because they are soooooo bad. That music? Dum Dum Dum! That's actually Dumb Dumb Dumb! Teenagers. Spring break. Guns. Avalanches. Sharks. Ancient Indian Burial Ground Sharks. That haven't eaten for 25 years! What could possibly go wrong? "They love people meat" Apparently. And leap into spas full of spring break teenagers. And burst out of the ground to eat guys proclaiming love. What's next? Tree sharks! Swinging from tree to tree! Great sharks! In british columbia! With their girl by their side! And they'll sing! Sing! "I'm a lumber shark and I'm ok! I sleep all night and I eat teenagers all day!" I swear some of these lumber sharks are Canadian! I would swear i heard one lumber shark say"sorry" as it ate some one. Spoiler alert! Some random Japenese tourist straightens some bent sticks! And. And. Lumber sharks vanish! Next in this gripping shark fest: "They thought they were safe on the space station..." Monkey Space Bread Shark! From the people who brought you"Killer Croissants" and "Blood Soaked Baguettes"! Bread Sharks! High gluten terror! "This time... The bread slices you!" You know... Seriously... SciFi would probably make that movie. Er... I'd watch it... And while I'm on a ridiculous point, I've figured out why SciFi produces these appallingly bad movies. To stop an alien invasion. "Wait. What?" I hear you say. Well think about it. Our movie broadcasts are being picked up from civilisations out there. And to be sure their unaminous conclusion has to be: "Land there?! You're joking right? Have you seen the sharks? They're fucking everywhere. They fucking fly for GondFlangle's sake! No fucking way am I exposing my crew to that place.You can't conduct a proper anal probe if you aren't sure there aren't such things as ass-sharks! It'd be be Butts, Blood and Gore all over the medical bay"
What's next? Ben has some ideas... ArachnoShark! Swim into my web of terror! The eight finned freak of nature! Eight mouths! Eight Eyes! Eight stomachs! Eight fins! Eight... Eight... Oh... Whatever

Friday, 7 March 2014

I'm 57. I'm not old.

To anyone who hasn't had a Pythonesque upbringing...
Well...
You missed out.
Sorry.
Better hit the 'back' button because you're unlikely to get any references from here on in.

Now.
Where was I?
Oh yeah.
57.
I'm not fucking old!

Old is when you accrete cats.
One that pisses everywhere and is called Samson not because he's strong but because he has long hair.
And he's a she.
And one that refuses to be petted and shits in your shoes.
"Those" kind of cats.

And you have one of those ride on carts.
With "Go Faster" stripes.
And aerials.
And a stick so you can poke young people and say: "Get a job! Cut you hair! Marry a cousin!"
Maybe not the latter although Pat Robertson may disagree.

Wait.
What?
Where was I?

Oh!
Yeah.
Being old.
No.
No. Fucking. No. .COM.
Not old.com.
"Experienced"
experienced.com.

"Experienced" My Fucking Phhhbbbttt.

I just survived.

Survived the cold war. Fucking nutters.
Survived hippies. Fucking nutters.
Survived Ayn Rand. Fucking nutters.
Survived fucking tons of crap...
Well..
Get off my lawn!

Served.

Anyway.
Where was I?

Oh Yes.
Minecraft.

Getting a tad annoyed.
Seems like I spend time building spectacular... Wait.. Adequate.. Wait... Shit... Apartments...
For testificates.
They swan around.
They are ignoring the Tom Clark Memorial Mega Tower (Thanks Sips) I spent fucking ages building.
And they... Well... They're "young".
And they expect me.... Me... To provide them with a Mega Tower.
With shopping malls.
And the MC equavalent of FCUK.
Wait.
What?

I'm the geriatric.
They're folding their arms and acting like it's expected.
Screw them.

I'm the geriatric.
So screw minecraft.
I'm following Sips lead and trying "Banished"!

Oh.
Oh Crap.
Banished needs Windoze.
Oh crap.
Bugger.

Bloody young whipper snappers.
What the hell is a snapper anyway and why would it whip?

Wait.
What?
Is it someones birthday?

Tuesday, 11 February 2014

Frickin Chocobos - Tennis elbow generators

Ok. We have a Hexxit server.
So one day my other half suggests I breed chocobos.
"Why yes," I say, "That sounds like a good idea."

WTF was I thinking?

I managed to scrounge up a few yellow choco-bastards and corralled them as best I could.
Grew acres and acres of frickin Gysahl Greens.
Then off to the pens.
Right-Click, Right-Click, frickin-right, frickin-click.

I am so SICK to the back teeth of right clicking.
And the incessant "Wiperoo" sound they make.
Aaaaaaah. Frickin Aaaaaaaah!
I'm going nutso-bong!

So after many, many hours of right clicking I get a few Greens and Blues.
And after many, many hours of chasing the mad, flighty bird-bugger-it-i'll-kill-them-alls around I manage to get 3 whites ones.

And... Wait for it... They're all FUCKING female.

Now I want to share something.
Something dark.
Very dark.
And I *KNOW* dark.
I want to imagine you've been breeding these frickin noisy flighty birds for ages.
And you try once again to breed a white one.
And you get yet another frickin baby Blue or Green.
And you snap.
Snap.
Snap deeply and profoundly.
"Crack goes the mind boys, crack, crack, crack."
And you chase that frickin little choco-kid-bastard around with a steel sword until you get it.
And you retreat from the awful, hateful, awful, incessant "Wiperoo" sounds to the safety of your house.
Burdened down by frickin blocks of frickin feathers.
WHAT THE FRICKIN USE ARE THE FRICKIN FEATHERS?
I HAVE FRICKIN CHESTS FULL OF THE STUPID THINGS.

Anyway, calming down now.
Deep breaths.
Chests with 12 by 64 blocks of choco-drum-sticks.
Cooked.
Cooked child chocobo-drum-sticks.
Nom.
Nom Nom.
Nom-frickin-child-chocobo-drum-sticks.

Oh the choco-bird-ity of it all.

Then!
Then!
Then your spouse announces that he's been to the Nether and managed to coax three PURPLE chochobos back.
And crows over his achievement!
Oh.
And he has equipped them with saddles.
And...
And...
I just remember being up to my arm pits in chocobo-chicks with a steel sword.

I FRICKIN HATE chocobos.

And I have tennis elbow.
In the real world.
Frack it.

I'm off to dig a hole.

Update! My other half took some umbrage at the above. He suggested that his effort to bring back Purple ones from the nether was a Herculean task and he should be lauded. I did that female thing of staring at him in a 'pointed', 'dagger' like manner. He suggested that I open a Kentucky Fried Chocobo Stand. I demurred. Meh.

Ruby: Class loading/unloading example

Recently I had the unfortunate task of writing specs to test a singleton.
Why would that be a chore I hear you ask?
Because the singleton in question had several configuration options.
Most of which were file based.
So out of the ~60 specs, 50 of them were for error conditions.
(File missing, folder not readable, not JSON, JSON but with invalid stanzas etc)

The problem was that each test had to start with a clean slate.
The singleton class must be pristine and new each run.
How the hell do you do that?

Unload the class, then reload it.

I fiddled about quite a bit with this, so I've put together a simple project that illustrates how this is done.

The bottom line is that you have to send :remove_const and the class name to the module or whatever your class is defined in.

For example, say a class is defined in a file skavee_bloopsie.rb thus:

module Skavee
  class Bloopsie
  end
end

Then this is what you run to unload and reload it:

Skavee.send(:remove_const, :Bloopsie)

This works at any depth of modules:

module A
  module B
    module C
      class Z
        def ohai
          'ohai!'
        end
      end
    end
  end
end

A::B::C.send(:remove_const, :Z)

You can test this yourself by copying and pasting this into irb:

module A
  module B
    module C
      class Z
        def ohai
          'ohai!'
        end
      end
    end
  end
end

a = A::B::C::Z.new
 => #<A::B::C::Z:0x007fc78c9b1dc8>

puts a.ohai
 => "ohai!"

A::B::C.send(:remove_const, :Z)
 => A::B::C::Z

b = A::B::C::Z.new
 => NameError: uninitialized constant A::B::C::Z

And here's the Gotcha!

a.ohai
 => "ohai!"

Wha? Well it's obvious. The instance is still being referenced.

So be careful out there people.

An example gem is available via my repo at https://github.com/ZenGirl/ruby-class-unloading

Friday, 11 October 2013

RubyMine GitLab Integration

I setup the community version of GitLab so I can have locally controlled projects.
Since I use RubyMine as my IDE, the integration with both github and gitlab was a bit convoluted.

First I couldn't get ssh to work, so I used http (since it was on my home network) to get the push/pull working.
(There are links to pages explaining how to fix that at the end of this post)

One you have GitLab running, you can create a project.
After doing that, you get to see a page with boxes telling you how to connect using git from the command line.

One thing to note is that there are two commands to set your `user.name` and `user.email`.
The key is that they use `--global` which is problematic.

So. Let's say you have created a project called `test`. Do this:

cd [your projects folder]
mkdir test
cd test
git init
git config --local user.name "YOUR_NAME"
git config --local user.email "YOUR_GITLAB_ACCOUNT_EMAIL"
git remote add origin [HTTP_URL_PROVIDED_BY_GITLAB]
touch README.md
git add README.md
git commit -m 'Initial'
git push -u origin master

You can have 'port' and 'groups' so the url could look like this:

http://gitlab.local:8080/home_projects/testing.git

Ok. What about task management integration?

Fiddly, but doable.

First, you have to use the GitLab API.
And for that you need your private key AND know the project number.

When you issue a curl request you get back JSON:

curl http://gitlab.local:8080/api/v3/projects/3/issues?private_token=YOUR_API_TOKEN
[
    {
        "id": 4,
        "project_id": 3,
        "title": "Some task",
        "description": "Some description",
        "labels": ["Enhancement"],
        "milestone": null,
        "assignee": {
            "id": 4,
            "username": "bill",
            "email": "bill@bill.com.au",
            "name": "Bill Bloggs",
            "state": "active",
            "created_at": "2013-10-10T22:59:26Z"
        },
        "author": {
            "id": 4,
            "username": "bill",
            "email": "bill@bill.com.au",
            "name": "Bill Bloggs",
            "state": "active",
            "created_at": "2013-10-10T22:59:26Z"
        },
        "state": "opened",
        "updated_at": "2013-10-11T01:07:50Z",
        "created_at": "2013-10-11T01:07:19Z"
    }
    ,
    {
        "id": 3,
        "project_id": 3,
        "title": "Another task",
        "description": "Another description",
        "labels": ["Bug"],
        "milestone": null,
        "assignee": {
            "id": 5,
            "username": "bill",
            "email": "bill@bill.com.au",
            "name": "Bill Bloggs",
            "state": "active",
            "created_at": "2013-10-10T23:00:19Z"
        },
        "author": {
            "id": 4,
            "username": "bill",
            "email": "bill@bill.com.au",
            "name": "Bill Bloggs",
            "state": "active",
            "created_at": "2013-10-10T22:59:26Z"
        },
        "state": "opened",
        "updated_at": "2013-10-11T01:07:59Z",
        "created_at": "2013-10-11T01:06:54Z"
    }
]

So how to get RubyMine to use this?

1. Open preferences -> tasks
2. Change 'Changelist name format' to {project}-#{number} {summary}

Under Servers, add a 'generic' server

In the general tab:

1. Change the server URL to http://YOUR_SERVER/YOUR_REPO_WITHOUT_DOT_GIT
2. Insert your username and password
3. Click 'Use HTTP Authentication'

Go to the gitlab server and under your account settings, there is an input box with your private key.

Copy it.

In the additional tab:

1. Add the URL: http://YOUR_SERVER/api/v3/projects/PROJECT_NUMBER/issues?private_token=YOUR_PRIVATE_KEY
2. Check the 'JSON' option
3. In the Task pattern insert: "id":({id}.?+),.+?,"title":"({summary}.+?)"

Hit test.

You should see 'Connection is successful'.

From now on you should be able to use the tasks drop down.

FYI When creating tasks in gitlab, there is an irritating anti-feature for assigning labels.
You have to type them in.
The set I use is:

Enhancement
Bug
New Feature
Quick Fix
Duplicate
Invalid
Question
No Fix
Documentation
Presentation

I still need to figure out how to have GitLab return the project name ala TestProject-#{number} {summary} format.

Off-topic: Go read
https://wiki.archlinux.org/index.php/Gitlab#Backup_and_restore
and https://github.com/gitlabhq/gitlab-recipes
and http://api.gitlab.org/
and https://github.com/gitlabhq/gitlab-public-wiki/wiki/Trouble-Shooting-Guide
and https://groups.google.com/forum/#!forum/gitlabhq