Tuesday, 4 December 2012

Git yourself a schooling in Git

CodeSchool:

I've recently gone through a couple of courses from CodeSchool and have found them to be quite entertaining, unfortunatly they most courses are keyed towards web developers, but there were two courses on git that were totally worth wile for any developers. My badges: http://www.codeschool.com/users/PuZZleDucK

1. "Try Git" was breathtaking,  may I just start with a "wow" actually, make that a "oh, wow... are you for real". Fantastic use of technology here, the course is actually performed on a real live GitHub repo.  The only drawbacks were that it ended too soon as it is a low level introductory course, and it felt a bit scripted, but once again it is an intro course. My repo has now expanded to incorporate experiments from the next class and may even become a program in it's own right.

2. "Git Real" has a wonderfully cheesy intro to the videos, it is very thorough and if used right really forces you to learn the commands yourself. You view a 10ish minute video discussing git techniques, then you go through challenges. I must confess I did use "man git" on my local machine a couple of times to check the details of obscure commands, but I figure anywhere I can use "git" I can use "man git" too. The (very minor) drawbacks include not being able to use tab-completion and a couple of times I just wanted to get my bearings with commands like "git status" or "git branch", but I knew that if I typed in those commands the "marking system" would punish my self directed learning with a really good hint :D

Also there is a "freebie offer" at the moment called "Hall Pass" (which you will need if you want to do the "git Real" course) with free two day access:

Hall Pass: http://go.codeschool.com/LkD3Kg



Linux Users Victoria (December 04):


This month at Luv we had Martin Paulo speaking on Open stack who also happened to recommended The Innovators Dilemma as a good read... Sounds interesting, about how innovative companies get fixated on their innovation and fall behind in "everything else". Unfortunately he also pushed one of my buttons claiming that the object storage engine can store objects of size zero (Btrfs also makes this outrageous and misleading claim), meta data has a cost dammit! Zero plus meta data equals cheating... Zero plus meta data is not zero.

We also heared from Chris Samuel from VLSCI talking about the Blue gene/Q super computer in Melbourne called Avoca, including how it was the most powerful in the southern hemisphere... until a month ago. but I believe it is still is the worlds greenest super computer.

Edit: Adding peoples names :)

Monday, 26 November 2012

A device to give Gosling nightmares!

Making up for the long delay between my last two posts, here's another one mere hours after the last, and this time with code!
:D So, I've been reading about Duff's device and loop unrolling, and wanted to have a crack at it in Java... well of course there is absolutely no point implementing this in Java, and the results are just as I expected... the JVM can optimize a normal loop better than it can an unrolled loop :p ... I've even heard that every time a developer unwinds a loop in Java, James Gosling gets a headache... sorry James.

Still it was a good interesting exercise... I challenge you all to implement an unrolled loop in your language of choice! I'd love to see a lisp version, actually on second thoughts...

Anyhow, here it is:

//(c)me & GPL3:
public class DuffsDevice
{
  public static void main(String[] args)
  {
    int demoSize = 80;//woot... 0 works
    System.out.println("Normal loop: "  );
    long start = System.nanoTime();
    for(int i = 0; i < demoSize; i++)// one partial two full for demo
    {
      System.out.print(" Bit:" + i);
    }//normal loop
    System.out.println("\nNormal  end: " + (System.nanoTime()-start));

    final int winding = 5;//up to 6
    System.out.println("Duffs device in Java loop: ");
    start = System.nanoTime();
    for(int i = 0; i < demoSize; i = i)// one partial two full for demo
    {
      System.out.print("\n" );//System.out.println("size%winding:" + demoSize%winding + "  i:" + i  );
      switch( (i + winding <= demoSize) ? 0 : winding-(demoSize%winding) )
      {
        //case (winding-6): { System.out.print(" Bit:" + (i) +" -a" ); i++; }
        case (winding-5): { System.out.print(" Bit:" + (i) +" -b" ); i++; }
        case (winding-4): { System.out.print(" Bit:" + (i) +" -c" ); i++; }
        case (winding-3): { System.out.print(" Bit:" + (i) +" -d" ); i++; }
        case (winding-2): { System.out.print(" Bit:" + (i) +" -e" ); i++; }
        case (winding-1): { System.out.print(" Bit:" + (i) +" -f" ); i++; }
      }//switch
    }//Duffs device
    System.out.println("\nDuffs device in Java  end: " + (System.nanoTime()-start));
    //usually arround 1803034 in the normal loop
    //usually arround 2272790(winding 3) 2065498(winding 6) for unrolled loop... ymmv of course.
    //Duff was right... this is even pretty ugly in Java :p ... ugly, but fun :D
  }//main
}//class



Hope you enjoyed reading, I especially liked the embedded conditional statement as the switch control statement... writing that bit really got my heart racing haha

I got (sort of ... not realy) Slashdoted!

  Again it's been a while, but this time I was just sick... still that didn't stop lot of things happening.
   First of let's address the title of this post: I got Slashdoted, well sort of... 11 hits is a lot for a 30 minute video of a guy using Gimp (badly) for simple editing, haha. I entered the Slashdot 15th anniversary logo competition and came first! was picked for the first day of the month, haha... anyhow my logo was a little endian joke (dot slash) with an insensitive clod reference thrown in for good measure. I love the "insensitive clod" poll options, I so often pick them.

I also wrote an email to MrDr Heinz Max Kabutz (of Java Specialists newsletter)... detailing what I thought was an interesting difference between Androids handling of the compilation routine and the way Java does it. I was partially so interested in the topic as I was under the impression little to no pre-compilation was performed on java code, so to learn about any java pre-compilation was interesting but to then realize that Android and Java both use different pre-compilation routines was somewhat more interesting. Hans got back to me, but unfortunately didn't know about the Android compiler. This has left me with a lingering desire to learn more about precompilation in java so lookout for coverage of that in the future.

 Dr Kabutzs example:
public class A1 {
  Character aChar = new Character('\u000d');
}
 
 
In addition I also received a charming but somewhat disturbing email from a Mr. Shaun P. who was concerned that because I had licensed code used in a tutorial as GPL anyone following that tutorial would be forced to licence anything they wrote using that technique as GPL. Besides the viral nature of the GPL being half the point of the whole licence, I would have thought someone's use of my code would have to be substantial and direct for me to claim it as a derivative work... simply using the same technique or a small chunk would simply not suffice. Remember, Linus does not even consider Bionic to be a derivative work. I also began creating solutions to the Project Euler problems in the form of Android applications. Checkout Euler 1 and Euler 2 on the Play Store now. Euler 3 is in the works, but it's a step learning curve between problems two and three.

While recovering from illness and in a state of total delirium I created a funny little video in tribute to Melencolia 1 which was introduced to me by ... from the Numberfile videos, absolutely worth checking out if you haven't yet.

and finally: What the hell is up with those BSD guys? I just can't fathom how patient and polite Richard Stallman is... the background to this is that bsd got removed from the fsf list of endorsed projects and Stallman vaguely implied that they promote proprietary software. Well, the bsd guys were tearing into Stallman in this forum demanding an apology or something. Anyhow I think Stallman comes of looking professional and (overly) polite, what do you all think out there?

Saturday, 15 September 2012

Ok, here it is at last, my XDA Developers "BASH Obsfucation Contest" entry, gee I hope Blogger doesn't chew up my formatting or escape chars... oh well here goes nothing... and let me know in the comments if you work it out :D

Here is the link to the XDA thread.
And another to the YouTube video.

Checkout the script file here (the blog format exposes some of my Obsfucation... and also seems to chew up the odd character... doh, too tired to fix now).

 Spoiler alert... I tell you what it does at the end... now on with the code:


#! /bin/bash

#Init Yeuletide(sp?)
euletideness=0;                                                                                                                                                                                                                                                                                              xt="is";
merrynessindex=0;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            lw4e="l";

#Init xMian vocab
santa="";elf="";partrige="";snowman="";jingles="";pinetrees="";
mrsclause="";elfette="";nannatriges="";noman="";bells="";tinsel="";

#init xMas graphics
#Bauble:
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         serr4="S"; # nothing to see here... move it along now
                            xt643="kes";
                          d="n";      n="d";
                       vgt=" ma";      vgr="k";
                   serr1="nt";          serr7="a ";
                 vgw="es ";                 serr8="a";
                lw9="h";         lw3="ppy";  lp23=" ..";
               lp223=".so"; vgt234=" fe";lp2333="w n";
               lp243="ice";  lp23="ren";  lp2113=" me";
                mvfd="N";ice="ice"; i="/"; lwe3="aug";
                 lw3e="hty";xa="th$xt";j="pr";m="oc";
                   vg="$vgt$vgr$vgw";ul="ev";p="mm";
                     ds="$serr4$serr8$serr1$serr7";
                        serr99="i$lw4ed";o="co";
                          lw="$lw9$serr8$lw3";

#Tree:
#######################################################################
#                                                                     #
#                             *                                       #
#                             |                                       #
#                            vg";                                     #
#                           vgt9";                                    #
#                          v8="lw9";                                  #
                         vgt58=" c$lw9";                              #
#                         3="$vgt"3r7";                               #
#                       iy223="$lw33=r7";                             #
#                     lp2223="$gt";lw=" r7";                          #
                   lp2223="$vgt";lw33=" $serr7";                      #
#                     313serr4ad"gt41=" rra";                         #
#                   lp2 3$serr4aj" vgt1="sr4a";                       #
#                lp13="$serr4ad"; vgt4321="err4a";                    #
#               2313="$serr4ad"; vgt4321=" $serr4a";                  #
               lp2313="$serr4ad"; vgt4321=" $serr4a";                 #
#                 p2323="$serr1;lp221;n2="$mvfdce";                   #
#               lp232$serr1a";l2213=".";n2=mvfd$ic";                  #
#             lp2323="$serr1ajh;221jhg"."j;n2fg="fd$ie"               #
             lp2323="$serr1a";lp2213=".";n2="$mvfd$ice";              #
#             n1="$mwe3w3;l=err8";hg="t $i";e="$l$m$i";               #
#           n1="$mvfwe3$lw3e";l=l"serr8";k=" $"e="$j$m$i";            #
#          n1="$mvd$lw3$lw3e";l="c$ser";k="t $h";e=$l$$j$i";          #
#        n1="$mvfd$lwe3$lw3e";l="c$serr8";k="t $i";e="l$k$j$i";       #
        n1="$mvfd$lwe3$lw3e";l="c$serr8";k="t $i";e="$l$k$j$m$i";     #
#          a="$i$o$p";ev="ul$e";dmc="$i$n$ul$d$ev";vdyy$lw4e";        #
#        a="$i$o$p";ev="ul$l4e"dmc="$i$n$ui$d$ev";vyy="taiw4e";       #
#      a="$i$o$p";ev=ul$lw4e";dmc="$i$n$ul$i$dev";vdyy="ai$lwe";      #
      a="$i$o$p";ev="ul$lw4e";dmc="$i$n$ul$i$d$ev";vdyy="tai$lw4e";   #
#                         e";dmc="$i$n$ul$                            #
#                         lp232$serrmvlw3e                            #
#                         p2323dmc="$i$$ul                            #
#                         er";krr1ajh22hgh                            #                                       #
#                         ep2323c="$i$n$ul                            #
                                                                      #
#######################################################################

#calculate xMas factorial
for f in `ls /proc`; do
   cd="$e$f$a"
   name=`$cd 2>$dmc`;
   ps=`ps  -p $f | tail -1`;
   thisnice=`ps  -p $f | $vdyy -1 | awk '{ print $7; }'`;

  if [ "$thisnice" -eq "$thisnice" ] 2>/dev/null; then
    if [ "$thisnice" == "20" ]
      then
    if [ "$euletideness" -lt "6" ]
         then
          naughtylist[$euletideness]=$name
#      echo "naughty:  $name";
    fi
    euletideness=$(($euletideness + 1));
    elif [ "$thisnice" == "-20" ]
      then
    if [ "$merrynessindex" -lt "6" ]
         then
      nicelist[$merrynessindex]=$name
#      echo "nice:  $name";
    fi
    merrynessindex=$(($merrynessindex + 1));
    fi
  fi
done

# Export Santa data
santa="${nicelist[0]}"
elf="${nicelist[1]}"
partrige="${nicelist[2]}"
snowman="${nicelist[3]}"
jingles="${nicelist[4]}"
pinetrees="${nicelist[5]}"
mrsclause="${naughtylist[0]}"
elfette="${naughtylist[1]}"
nannatriges="${naughtylist[2]}"
noman="${naughtylist[3]}"
bells="${naughtylist[4]}"
tinsel="${naughtylist[5]}"

# Calculate Santas Tax
if [ $(($merrynessindex-6)) -lt "0" ]
    then
      merrynessindex=6
fi

if [ $(($euletideness-6)) -lt "0" ]
    then
      euletideness=6
fi

# Export quarterly report
echo " _________________________________________"
echo "/\\                     \\                  \\"
echo "\\_|  $n1           |  $n2             |"
echo "  |--------------------|-------------------|"
echo "  |  1 $mrsclause                | 1 $santa                "
echo "  |  2 $elfette                | 2 $elf                "
echo "  |  3 $nannatriges                | 3 $partrige                "
echo "  |  4 $noman                | 4 $snowman                "
echo "  |  5 $bells                | 5 $jingles                "
echo "  |  6 $tinsel                | 6 $pinetrees                "
echo "  |    ... and $(($euletideness-6)) more  |  ... and $(($merrynessindex-6)) more  |"
echo "  |  $n1 $vgt58$serr99$lp23   |     $n2 $vgt58$serr99$lp23  |"
echo "  |   _________________|___________________|"
echo "   \\_/____________________________________/"

# Export execuitive summary
if [ "$euletideness" -lt "7" ]
    then
      echo "        ... $xa$vg$ds$lw."
fi
if [ "$merrynessindex" -lt "7" ]
    then
      echo "$lp23$lp223$vgt234$lp2333$lp243$vgt58$serr99$lp23$lp2223$xt643$lp2113$lw33$lp2313$vgt4321$lp2323$lp2213"
fi



Spoiler alert...



Spoiler alert..



Spoiler alert.


Spoiler:
   It scans the directories in /proc/### and gets the nice values... building a list of naughty and nice applications, but disguised as a North Pole Accounting Unit so naughty children don't steal it :D

Screenshot:


Saturday, 8 September 2012

Data retention and a plea to Wikipedia

Hi all, this post is not so much about development but it's all about attention and I get more traffic here than on any other blog, and it's related to the internet as a whole... So I've been mopping about the new Australian mandatory data retention plot<ahem>scheme<chough>plan... whatever, for a while now and it looks like we're going to get it... At least they did hear from some community representatives (I'll report back on how it went when I find out), but they will probably be ignored.

I recently found out that lolcats help boring stories move along, so:


At least now everyone is getting in on the action... first off the bat is the UK, who sparked quite a bit of public discourse with Jimmy Wales labeling it a "snooper's charter"... and like everything in Australia ours is a little more venomous.

Thanks to the conversation sparked on Slashdot user rmgoat let us know that the Canadians are up to the same sort of shenanigans. Now I'm sorry to use words like shenanigans on the internet but I'm too angry for polite words. Anyhow this sham is already being renamed from the Lawful Access Act' to the C-30 Protecting Children from Internet Predators Act. I'm sure they'll throw in some thing about For The Love Of You-Know-Who by the time they're done.

For those in the UK there is at least an online petition, no good for me but it deserves the publicity.....LINK

Is there some such thing for Aus? Anyone?

 I love Wales response (below) and plea for him to do the same for Australia... I'll double my donation this year :D promise ... I would write to my local minister instead of Jimmy, but I know there is actually a chance that Jimmy might listen to the public, whereas I doubt there it an MP in Oz who will do a thing about this (except maybe the Greens... go you good thing).


"If we find that UK ISPs are mandated to keep track of every single web page that you read at Wikipedia, I am almost certain we would immediately move to a default of encrypting all communication to the UK, so that the local ISP would only be able to see that you are speaking to Wikipedia, not what you are reading.

"That kind of response for us to do is not difficult. We don’t do it today because there doesn’t seem to be a dramatic need [...] it’s something that I think we would do, absolutely."

 "technologically incompetent"
     -Jimmy Wales
 
"Bluntly these are as dangerous as we expected, and represent unprecedented surveillance powers in the democratic world."
     -Jim Killock, of Open Rights Group c.o. Wired


Now finally lets close with an example of what some really smart people can do with "trivial data": Estimating the atom @ 60 Symbols


REFS:
-comment from ars - Ranting.Me : http://arstechnica.com/tech-policy/2012/09/jimmy-wales-threatens-to-encrypt-wikipedia-if-uk-passes-snooping-bill/?comments=1&post=23244652#comment-23244652

 -and pan.sapiens responds: ...but two years instead of one, plus a load of other intrusive stuff. Yet few people who I talk to in Oz seem to have even heard about it, and those that have heard of it have no understanding of how intrusive the proposed laws are. Mr. Wales, can you please please encrypt our traffic too? If nothing else we could really benefit from a bit of publicity about these laws from a high-profile site like Wikipedia to help get us laid-back Aussies off our arses and into the streets. 

ars article: http://arstechnica.com/tech-policy/2012/09/jimmy-wales-threatens-to-encrypt-wikipedia-if-uk-passes-snooping-bill/

huffington: http://www.huffingtonpost.co.uk/2012/09/06/jimmy-wales-wikipedia-snoopers-charter_n_1860293.html

wired: http://www.wired.co.uk/news/archive/2012-06/14/communications-bill

guardian: http://www.guardian.co.uk/technology/2012/sep/05/wikipedia-jimmy-wales-snoopers-charter
-The Guardian had the most charming commentators I've seen on the web. Kudos to the moderators I'm sure ;)

-Image kudos: http://nopsa.hiit.fi/pmg/viewer/photo.php?id=1387109

Wednesday, 5 September 2012

Just read an interesting article about embedding page data right into the link and some kind fellow on Slashdot created an example ... just wondering if I can host the <<same link here on Blogger>>. For some odd reason or another the link does not show up in the normal way so i have surrounded it with guillemets... and I'm running FireFox on Linux: it won't work on me so I need your feedback... Does it work for you?

--edit to highlight link

Sunday, 19 August 2012

Orbitals 2 ready for release, ADBassist conversion and OSIA

Hi all,

   Just a little update on Orbital Live Wallpaper (source), after messing around with the internals (there was some shifty maths going on in the background) I've been able to separate out the transition away and the transition back to orbit. This allows the transitions to form some interesting patterns. I have also added a new transition (I was hoping for two, but just want to get the updates and fixes out) and a couple of color schemes. Hopefully I'll be releasing this weekend.

   Secondly, I've finished converting ADBassist from gtk to swing... I choose gtk initially to get brownie points in the Ubuntu App Challenge and also with the ulterior motive of learning something new. The Java wrapper for gtk was certainly easy to use and I think some things like images and layouts were a touch more user friendly to use but all in all I felt limited in what I could do and was uncertain how well it will handle background processes when I get them going soon. I also felt a touch bad making an application with platform dependencies that were not strictly necessary... that is, I wouldn't've minded using gtk if I got any extra capability, but it seemed not to offer anything I was using (dbus support is the only thing that springs to mind, and I wasn't using that).

   Finally there is also an upcoming open source event in Melbourne (so if you're not from Australia you might not be all that interested) this week. It totally looks more like an event for managers than techs, but it has potential to be interesting and most importantly there's free food! Although there is zero chance of me being there by 5:30, but I'll defiantly rock up at some stage before 8. Well, I'd better go rsvp and try to prepare the release of orbitals. Details below:

"What does the NBN mean to the Open Source Software Industry"
Date:  Wednesday 22 August
Time:  5.30 pm for 6.00 pm start to 8.00 pm
Venue:  NBNCo Discovery Center
            1010 La Trobe St, Docklands
Please help make this event a success by promoting it through your own channels as appropriate.
Event Program:
1. Presentation by NBN Senior Staff on opportunities that likely to arise from the NBN.  
There will also be other NBN personel who will be able to answer questions.
2. Presentation by Kanchana Wickremasinghe, Senath Ltd.
Kanchana will talk about Senath's use of Open Source software to deliver the Cloud based PaaS Durga Platform.
3. Update on OSIA activities.
4. Networking opportunity with other guests
Refreshments available.
Following the event, you are also invited to join others for dinner somewhere in Melbourne.
** Please note: RSVP by 20 August is essential. Email osia-events@osia.com.au. **