Warning: Declaration of GTranslate::widget($args) should be compatible with WP_Widget::widget($args, $instance) in /var/www/ninjatool.dk/blog/wp-content/plugins/gtranslate/gtranslate.php on line 0

Warning: Cannot modify header information - headers already sent by (output started at /var/www/ninjatool.dk/blog/wp-content/plugins/gtranslate/gtranslate.php:0) in /var/www/ninjatool.dk/blog/wp-includes/feed-rss2.php on line 8
NinjaTool inc. http://blog.ninjatool.dk The strange droppings of a game programming professional. Thu, 21 Apr 2016 17:24:51 +0000 en-US hourly 1 https://wordpress.org/?v=4.7.5 BS Bingo app http://blog.ninjatool.dk/2014/10/bs-bingo-app/ http://blog.ninjatool.dk/2014/10/bs-bingo-app/#comments Wed, 29 Oct 2014 10:36:42 +0000 http://blog.ninjatool.dk/?p=252 Continue reading »]]> bsbingoapp_sketch.JPG

Got this idea for an app, and since I never seem to get around to implementing any of my ideas outside work, I guess I’ll just post it here for anyone to grab and run with it.

Assuming you know the concept of Bullshit Bingo; The ideal scenario could be a meeting or information / status briefing or something like that, where CEOs, marketing or external sales people wanna impress a group of people with fancy words.

A few like minded individuals can register in a group to play BS Bingo during the presentation. Get your smart phones and tablets out. Time to play. The idea is that everybody in the group gets their randomly generated playing board with a set of buzzwords. When the presenter spits a buzzword that’s on your list, you tab to mark it. When 2-3 people (might depend on the amount of people playing) tabs the same word, it is broadcast to the other players to let them know a buzzword has been tabbed by other players and to help them if they missed it on Thor own board.
The winners is also broadcast along with ranking and possibly a comment :)

Happy corporate meetings ahead? I should think so :)

http://blog.ninjatool.dk/2014/10/bs-bingo-app/feed/ 137
Happy tunes from ’73 http://blog.ninjatool.dk/2014/05/happy-tunes-from-73/ http://blog.ninjatool.dk/2014/05/happy-tunes-from-73/#comments Thu, 01 May 2014 11:27:34 +0000 http://blog.ninjatool.dk/?p=235 Continue reading »]]> So I found this old EP in my collection, and since I can’t find it digitally available anywhere on the internet, I suppose the task of bringing this piece of gold to the world is mine.

Apparently, the Pipe Pipers have not done much besides this one EP, but it is available around the web if you after hearing it here simply NEED to add it to your own collection – it IS great for bringing the portable phonograph to the park ;)

So, as always; Enjoy – and if you know of some copyright infringements that I’m breaking by providing this content, please let me know. I haven’t been able to spot any, so… Here goes :)

Flip Flap EP cover

http://blog.ninjatool.dk/2014/05/happy-tunes-from-73/feed/ 156
JS: Optional parameter default true http://blog.ninjatool.dk/2013/12/js-optional-parameter-default-true/ http://blog.ninjatool.dk/2013/12/js-optional-parameter-default-true/#comments Mon, 23 Dec 2013 11:44:10 +0000 http://blog.ninjatool.dk/?p=227 Continue reading »]]> Just a short note: If you want to have an optional boolean parameter and have the default value to be false, you can use the property of a boolean to be false if it’s either undefined, null, 0 or false, so just evaluating opt_booleanParameter would evaluate to false it the parameter is omitted (I use that all the time). But if you really need the parameter to be type boolean, just slap a couple of !’s in front and it will evaluate to the boolean value false if omitted. E.g.

example = function(opt_booleanParameter) {
   var booleanParameter = !!opt_booleanParameter;

   if (booleanParameter) {
      // This point is ONLY hit if the optional parameter is provided and true.

But if you want the default value to be true, I had a tendency to make the logic far longer than it needed to be. I usually use Google Closure, but with or without goog.isDef(), the assignment can be equally simple:

example = function(opt_booleanParameter) {
   var booleanParameter = opt_booleanParameter || opt_booleanParameter === 'undefined';

   if (booleanParameter) {
      // This point is now hit if optional parameter true or is omitted.

(as indicated; the opt_bp === 'undefined' can be replaced with !goog.isDef(opt_bp) if you use the closure libraries. It does the exact same thing.)


EDIT: Thanks to my buddy, Ole at Rocha.dk, I added the ‘s to the ‘undefined’ comparison for increased cross browser compatibility.

http://blog.ninjatool.dk/2013/12/js-optional-parameter-default-true/feed/ 160
Subversion trust issues on OSX http://blog.ninjatool.dk/2013/11/subversion-trust-issues-on-osx/ http://blog.ninjatool.dk/2013/11/subversion-trust-issues-on-osx/#comments Fri, 08 Nov 2013 15:05:20 +0000 http://blog.ninjatool.dk/?p=223 Continue reading »]]> [Ok, I read the headline, now just show me the solution]

The problem

As many other mac users, and developers using subversion on macs somewhere in their pipeline, I ran into this recently introduced issue (apparently introduced by Apple) where server certificates can no longer be trusted permanently. The problem is quite easy to fix, and people with a broarder understanding of subversion and “what’s under the hood”, will no doubt just have fixed this problem and moved on… However, I am not one of those people, and have therefor not been able to use my home computer for work, since that’s the mac cheep of the family. As indicated in the solution section, there’s a chance that this problem is only related to secure connections, which will also kinda explain why the outcry for a solution has not been heard from the vast majority of mac based developers. Guess the subset of developers that do use secure connections but does not know what’s under the hood of subversion is pretty limited…

Many wrong ways around it

I really didn’t care about having to manually confirm that the certificate was trustworthy every time I made a subversion operation that connected to the server. So I could have added the –trust-server-cert and –non-interactive options to “just make it do what it was supposed to do”. However, our build scripts rely heavily on automated svn routines, which are all handled through precompiled java programs, and these routines would fail when a cert was not permanently trusted. And since I couldn’t get to the svn call within these programs, I could have tries some ugly hacks with aliases setting the svn call to always include these options, but then my system would be far too vulnerable if someone got access to it. AND it’d be ugly… and wrong.  So any ways, while I was snooping around in those parts of the forrest my boss has a tendency to look in direction of “the more correct way of doing things” and sent me a link that pretty much just cleared the whole thing up.

The simple solution

As usual, once the actual problem is identified, there is a clean and simple solution. And as posted in this thread, the problem is that the authorization / authentication folder  storing (in my case for the secure servers) svn.ssl.servers folder does not belong to the user experiencing the problem. Apparently this part of the subversion structure is new and initially created by the system, and therefor not owned by the user. For this reason the user has no permission to write to this folder or it’s content and therefor the flag to permanently trust some certificate is never stored.

So the simple solution is simply to change your read/write permissions (e.g. by changing the owner) of the folder recursively or simply delete it and let a new one (belonging to you) be created the next time you access the server. No matter which solution you choose; the next time you’re asked about the level of trust to show this particular server, your choice to permanently trust the certificate will be stored and the system will respect your authoritah.

svn.ssl.server is located in ~/.subversion/auth on *nix systems and in  C:\Users\"USERNAME"\AppData\Roaming\Subversion\auth on Windows.

Step 1a)
On a *nix system you have the option to change the owner of the folder recursively by running
chown -R $USER ~/.subversion/auth to take ownership
or just
chmod -R u+w ~/.subversion/auth to make it writable for you

Step 1b)
On both *nix and Windows systems you can delete the folder altogether and have a new one created when it’s needed.

so for *nix:

rm -r ~/.subversion/auth/svn.ssl.server

and on Windows – You know what to do… But if you REALLY wanna use the terminal:

del C:\Users\<username>\AppData\Roaming\Subversion\auth\svn.ssl.server

Step 2)

After step 1) the folder is now either non-existing or at least writable, so now you just need to set the “permanently trus it”-flag for the server in question, so go ahead and run

svn list <url to server>

and when prompted to trust it, type p for permanently. And violá. You’re all done!

Post scriptum

As mentioned above; I’ve only had this problem with secure servers. It makes sense that this has been mindlessly put in place to further secure these connections, but I’m still leaning towards a classic brain fart. Any ways, I will assume this same procedure will solve the problem as well if any other connection type is causing a similar blockade, so feel free to try this for the other files in <SVNpath>/auth and put your experiences and any insight on a public Apple based solution or the reasons for this fluke if you know it in the comments below.


http://blog.ninjatool.dk/2013/11/subversion-trust-issues-on-osx/feed/ 160
Natural scrolling on Ubuntu http://blog.ninjatool.dk/2012/12/natural-scrolling-on-ubuntu/ http://blog.ninjatool.dk/2012/12/natural-scrolling-on-ubuntu/#comments Wed, 19 Dec 2012 11:13:30 +0000 http://blog.ninjatool.dk/?p=213 Continue reading »]]> If you want the natural scrolling feature of newer OSX-versions on Ubuntu, there’s absolutely no reason to install additional apps to take care of that… Simply create a config-file to reverse the scrolling direction and update xmodmap using that file;

Create a new file called .Xmodmap in your Home directory, paste this simple line and save it.

pointer = 1 2 3 5 4 6 7 8 9 10 11 12

To make make the mod effective right away, run

xmodmap ~/.Xmodmap

…and violà – you have natural scrolling :)
The next time you log in, it will ask you if you want to load the config file, click yes and “don’t ask again” and never pay attention to this again. Hopefully they will add this to future builds of Ubuntu, to make it an option in the standard drivers – if not default.

http://blog.ninjatool.dk/2012/12/natural-scrolling-on-ubuntu/feed/ 139
Fixing rendering for the Retina display http://blog.ninjatool.dk/2012/08/fixing-rendering-for-the-retina-display/ http://blog.ninjatool.dk/2012/08/fixing-rendering-for-the-retina-display/#comments Mon, 13 Aug 2012 07:16:42 +0000 http://blog.ninjatool.dk/?p=195 Continue reading »]]> I recently bought the MacBook Pro with retina display. This seemed like a good idea at the moment, but I soon realised that the Apple approach to releasing new hardware without announcing it in advance have a downside in that nobody can prepare their applications to support the new “standards”. In the case of placing a retina display on a laptop, unprepared applications are rendered in their native resolution and rescaled to match the revolutionary high resolution of the display… Wait, what? Yes, RESCALED! And yes, it does look like shit. Being an otherwise biased linux user, I thought there might be a hack to fix this rather than just waiting for all my favourite applications to be re-released with retina support, I searched the web and violá; at this Eclipse forum, Brandon Hudgeons provided this lump of gold:

Here's the workaround:

Do "Show package contents" on the Eclipse.app. 
Edit Contents/Info.plist.  Just above

Place this:


Then, log out or make a copy of the app
so that OSX will notice the change.
Now, the info window will not show
"Open in Low Resolution" as checked.
Launch Eclipse and enjoy your new
retina awesomeness.

If you’re editing .plist files in XCode there is of course a pretty grid of properties in which the key can be added, but whether you use XCode-like editor or just edit the raw XML, this fix works! AND apparently works for virtually all apps under OSX.

http://blog.ninjatool.dk/2012/08/fixing-rendering-for-the-retina-display/feed/ 151
All Kindle books on Amazon are free http://blog.ninjatool.dk/2012/04/all-kindle-books-on-amazon-are-free/ http://blog.ninjatool.dk/2012/04/all-kindle-books-on-amazon-are-free/#comments Wed, 18 Apr 2012 11:23:02 +0000 http://blog.ninjatool.dk/?p=191 Continue reading »]]> If you’re a fast reader, it appears that you can read books from Amazon on your Kindle for free…? According to the refund policy described on the Amazon website, any purchase can be returned for a full refund within seven days. In order for people to not just buy the book again and reading the next part, the book becomes inaccessible to the customer. But if you’re able to read the entire book in a week – it sounds like it’s free for the taking…? Please let me know if there’s a catch. If not; I’d say this is a noticeable expansion to the 7-day loans at the local library.

http://blog.ninjatool.dk/2012/04/all-kindle-books-on-amazon-are-free/feed/ 137
iLoTR http://blog.ninjatool.dk/2012/02/ilotr/ http://blog.ninjatool.dk/2012/02/ilotr/#comments Tue, 21 Feb 2012 13:01:48 +0000 http://blog.ninjatool.dk/?p=187 hehe… Set your iPhone language to English, set this wallpaper on the lock screen and enjoy your LoTR geekness :) Obviously more fun if you actually have need an access code to unlock your phone…
iPhone lock screen wallpaper

One does not simply slide to unlock

http://blog.ninjatool.dk/2012/02/ilotr/feed/ 153
Dimnur Borgir and the lost cassettes http://blog.ninjatool.dk/2011/09/dimnur-borgir-and-the-lost-cassettes/ http://blog.ninjatool.dk/2011/09/dimnur-borgir-and-the-lost-cassettes/#comments Wed, 28 Sep 2011 08:16:39 +0000 http://blog.ninjatool.dk/?p=182 Continue reading »]]> I recently stumbled upon a butt load of old cassette tapes in the attic, among which I found an equally old recording of a radio show called Metal GO! This show ran once a week on the Danish Radio channel P3. Obviously the provided clip will only entertain Danish (or in the broadest; Scandinavian) listeners, but I still felt like including this piece of subtle rage in English :)

DimnurBorgir” presentation

In the above audio clip the  host (Bjarke Ahlstrand) announces this new amazing band in the black metal genre as “Dimnur Borgir” which did not lead to much rage at the time, as virtually nobody knew the band yet. Of course Dimmu Borgir have grown to be a legendary international name in the genre, and till now, all has been forgotten about this first presentation of the band in Danish media. Enjoy the snippet ;)

Oh, yeah – and by the way. The track that was played in the radio that day was “Over Bleknede Blaner Til Dommedag” from the 1997 album, For All Tid.

http://blog.ninjatool.dk/2011/09/dimnur-borgir-and-the-lost-cassettes/feed/ 124
Fantastisk børnemusik http://blog.ninjatool.dk/2011/09/fantastisk-bornemusik/ http://blog.ninjatool.dk/2011/09/fantastisk-bornemusik/#respond Fri, 09 Sep 2011 11:29:03 +0000 http://blog.ninjatool.dk/?p=170 Continue reading »]]> Én af de mest fantastiske børneplader jeg har stødt på, har jeg desværre ikke kunnet finde siden jeg lånte den ud / afleverede den tilbage til nogen… Der er en Finn Th. Bachman-plade fra sen-70’erne / start-80’erne, der hedder Robin Hood, og som indeholder en masse fede klassikere udsat for rigtig musik og dårligt engelsk. Heldigvis er alle sange på dansk, men lige netop titelsangen lider en anelse under en udtale der sender Ròbin til Sjervut :) Ellers er den spækket med klassikere som Flyv lille påfugl og Der sad to katte, men også en del egne kompositioner som dufter langt væk af julehygge, børnehave i de tidlige 80’ere og danske børne-traditioner.

Jeg har på syndig vis vedlagt en mp3-samling af hele pladen, som den er kommet til at lyde efter først at være overspillet til minidisk og derefter via analoge linjer optaget på min arbejdscomputer. Hvis nogen skulle ligge inde med en original og mene at jeg forbryder mig mod eksisterende copyright ved at lægge den til offentligt haps, hører jeg meget gerne fra jer, da jeg ellers vil fortsætte min antagelse om at jeg selv har fundet på pladens eksistens. Den er nemlig intet mindre end umulig at få fat i :(

Finn Th. Bachman – Robin Hood

  1. Robin Hood
  2. Flyv lille påfugl
  3. Glade og sure
  4. Der brænder en ild
  5. Riz raz filliongongong
  6. Der sad to katte på et bord
  7. Bondens gård
  8. Jonas har en lille kat
  9. I en skov en hytte lå
  10. Årstiderne
  11. Vil du
  12. Lenas kat
  13. En pige gik i enge
  14. Anna Diana

Nyd pladen og spil den for jeres MGP-ramte børn, så de har en idé om hvordan rigtig musik lyder.


Uh! Og PS: Lige et betragteligt nyere, men stadig ret fantastisk bud på en bogstavsang. Nu leveret af Trolle og TormodVolaker har en fed lyd <- sangen kan downloades fra BandBase





http://blog.ninjatool.dk/2011/09/fantastisk-bornemusik/feed/ 0

Fatal error: Uncaught Error: Call to undefined function fetch_rss() in /var/www/ninjatool.dk/blog/wp-content/plugins/wp-cron/wp-cron-dashboard.php:18 Stack trace: #0 /var/www/ninjatool.dk/blog/wp-includes/class-wp-hook.php(298): wp_cron_dashboard('') #1 /var/www/ninjatool.dk/blog/wp-includes/class-wp-hook.php(323): WP_Hook->apply_filters('', Array) #2 /var/www/ninjatool.dk/blog/wp-includes/plugin.php(453): WP_Hook->do_action(Array) #3 /var/www/ninjatool.dk/blog/wp-content/plugins/wp-cron/wp-cron.php(62): do_action('wp_cron_hourly') #4 /var/www/ninjatool.dk/blog/wp-includes/class-wp-hook.php(298): wp_cron_hourly_exec('') #5 /var/www/ninjatool.dk/blog/wp-includes/class-wp-hook.php(323): WP_Hook->apply_filters(NULL, Array) #6 /var/www/ninjatool.dk/blog/wp-includes/plugin.php(453): WP_Hook->do_action(Array) #7 /var/www/ninjatool.dk/blog/wp-includes/load.php(677): do_action('shutdown') #8 [internal function]: shutdown_action_hook() #9 {main} thrown in /var/www/ninjatool.dk/blog/wp-content/plugins/wp-cron/wp-cron-dashboard.php on line 18