VirusTotal API PHP class

So I’m about to do a project with VirusTotal integration, therefore I went to the VirusTotal site to get API access. I create a user and after some HTTP 500’s from VirusTotal I get my API key. Great, I thought. I saw there was some guy who had already made an PHP class for the API so I was excited, less work for me.

I click the link to the download and… 404’ed! DAMMIT! I start powering up my Google-foo and finally on some chinese site I get the class (which wasn’t a class). Unfortunately the exsisting thingy wasn’t that, goood. No offence to the guy who made it. I think the code is a bit old and that is properly the reason for the lack of classes.

Therefore I decided to do a new class which you can get here: https://github.com/eXeDK/VirusTotal-API-PHP-class.

Please tweet me about any bugs etc. @eXeDK

Freshplum job application puzzel thingy

This was a puzzel made by the guys at Freshplum who is hiring at the moment. Hold your horse, you need to have a Ph.D. For all of us mortals with no Ph.D. (yet, hopefully) there are no more to do than solving the puzzel they made in order for people to send in their applications.

In the bottom of the hiring page https://freshplum.com/jobs/ there is the text:

Send to: x@freshplum.com where x = the number that appears most frequently below.

And below that there’s a lot of random numbers flashing by. The code generating them is here:

   1: var x;

   2: function go(){

   3:     x = Math.floor(Math.random() * 11) + Math.floor(Math.random() * 11);

   4:     $("#number").html('<p>'+ x +'</p>');

   5:     setTimeout('go()', 100);

   6: }

   7: $(document).ready(function(){

   8:     go();

   9: })

As you see in line 3, two random numbers between 0 and 10 are added together and put into #number. So the resulting number is between 0 and 20. Calculating the most common one can be done like this:

   1: $xArray = $yArray = array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10);

   2: $resultArray = array();

   3: foreach($xArray as $x) {

   4:     foreach($yArray as $y) {

   5:         $result = $x + $y;

   6:         $resultArray[$result] = $resultArray[$result] + 1;

   7:     }

   8: }

   9: foreach ($resultArray as $key => $val) {

  10:     if ($val == max($resultArray))

  11:         echo $key;

  12: }

The result of the script you can see here: http://codepad.org/YA5fX8aC

The most common number is 10, quite obvious really but there you have it.

Having fun with chaos

So right now I’m writing a rather huge project in school about “mathematical chaos theory in conjunction with traditional statistics in relation with a chemical experiment”. It’s REALLY exciting and fun (in a very geeky way). When working with numeric chaotic datasets it’s really handy to show the dataset in a graphical way. I of course choose to use the Google Chart API and created a simple sample application based on the “Valentine's Grouse”. The application can be altered by editing the GET parameter called “k”.

The application

The application with the “k” parameter set to “2.9”

The application is programmed in PHP and the source code can be seen here.

New working portfolio at a new domain

I just created a working portfolio for well – work. In order to make a bit more easy to find I brought the domain thomasstigjacobsen.dk to hold the portfolio. So please visit it and see what I’ve done.

Note to the non-speaking visitors: the portfolio is in Danish right now but I’ll create some links to easily view the portfolio in other languages with some help from Google Translate :)

That’s all for now, see ya folks.

Why do we fall?

… so we can learn how to pick ourselves up.

These were the words from the butler of the notorious young Batman when he fell into empty well and he saw his biggest fear, which would also become his enemies biggest fear. Ironic and yet very powerful.

I’m no Batman and I’m not writing this on the bottom on an empty well as a “SAVE ME”-note. I were just disappointed in myself and therefore I’m now picking myself up, yet again. This was a fall like no other and right now it hurts more than anything else I’ve ever experienced yet I’ve had a bruised body and love life in the past.

I know how I can pick myself up again and in a quick manner because I know what and who I truly love. Therefore I do not need to sit with my head hanging low, I can rise and yet again live strong until I again fall and then – pick myself up yet again, stronger and strong for each and every time.

So, why do we fall? So we can learn how to pick ourselves up.

How to ruin the rythm of night/day inside the body

The last few days I’ve been in a city called Horsens to work. As a programmer and a night hawk my mate Martin and I have been working the late hours.

This has resulted in sleeping until 13 every day. So, is that healty or not? Properly not at all. But eventhough why is it programmers and youngsters tend to be that active in the late hours? We have been a lot more effecient working in the late hours than working in the day hours.

Maybe it’s because there is no external things to distract you, or is it just some foolish excuse to be up late and sleep long into the next day?

Kunsten at falde ind i musikken

Jeg har kaldt dette blogindlæg for “Kunsten at falde ind i musikken” af den grund, at når jeg hører musik, om det så er jazz, pop, rock eller klassisk så kan jeg ikke undgå at “falde ind i musikken”.

Det er et “state-of-mind” som kan ændre ens humør og livsanskuelse på de få minutter som et nummer varer. Det er derfor fantastisk at kunne tage musik i ørene, lade sig falde ned i det store hav af følelse, toner, finesser og beats og derefter være “frisk”. Frisk på den måde at dine tanker er renset og du er atter opfyldt til randen med livsglæde. Det er et kick som ikke kan sammenlignes med noget som helst.

Derfor er det mit håb at flere vil lade sig falde ind i musikken, få renset deres sind og få det overskud som betyder at de kan give et smil eller en hjælpende hånd som giver menneskene i deres nærvær en god dag.

Så næste gang du skal høre noget musik så vælg noget dejligt musik uden vrede og skrig. Vælg noget som musik som gør dig glad eller får dig på tanker som betyder noget specielt for dig. Luk derefter ørene op og i på en og samme tid. Luk musikkens fortryllende toner ind og luk omverdenens larm ude af dit sind. Når musikken så er lukket ind og er det eneste som fylder dit sind kan du endelig nyde et nummer som f.eks. “Dreaming With A Broken Heart” af John Mayer. Lad ikke noget forstyrre dig og giv dig god til at nyde musikken.

Jeg kan garantere dig en bedre dag, jeg stopper nu denne post for nu vil jeg tillade mig at “falde ind i musikken”…

Et hurra for de offentlige toge nord for Limfjorden.

Her sidder jeg så, strandet på Aalborg Banegård uden nogen form for udsigt til at komme videre. Turen startede fantastisk med en stille kupé og en vinduesplads uden sidepassager, med masser af plads at boltre sig på. Jeg kom til Århus til tiden, vi vendte og drejede og lystigt gik turen mod den mørkeste del af det ganske land; Nordjylland.

Ved ankomsten i Aalborg var jeg midt i arbejde og musik og bemærkede kun svagt at mange af mine medpassagerer steg ud af toget og samles i grupper udenfor. Da jeg stoppede musikken lød den grufulde besked i højtalersystemet: “Toget kører ikke videre, busser kan findes…”.

Panikken greb mig i et splitsekund af forvirrelse og jeg pakkede hurtigt mine ting og steg ligeså ud af toget. Jeg fulgte strømmen af mennesker mod P-pladsen foran Banegården. Det hjalp bare ikke meget for da de to mini-busser som DSB havde fremskaffet var blevet fyldt for mange splitsekunder siden.

Mange splitsekunder og megen forvirring senere finder jeg mig selv i dette tog, som venter på at få grønt lys til at komme videre…

Opdateringen følger, måske……

Yesterday I saw a true gentleman

It had been a lousy morning, minus 4,4 degrees celsius and my train had broken down meaning that I had waited about 45 minutes in the cold Danish spring.

I finally got with the train and got to a city called Hjørring where I go to school. I catched a bus to school and sat down listening to some music. Then the bus stops to get on new passengers, a older woman steps in and is looking for a place to sit. No avalible seat is to be found in the bus, suddenly – out of nowhere (no conversation nor eyecontact) a man raises up and directing the older woman to his old seat.

At this time I can’t help smiling seeing that gentlemens are not a extinct specie.

So today I got up with this crazy and kind of fun theory of where the rest of the gentlemens are. Furthermore I’ve writtin’ down some questions for you to answer.

I think that this true gentleman I saw has escaped a hidden dimension in where all the gentlemen are being hold captured by some evil dude. The great question in this matter is, HOW DID HE ESCAPE?

When thinking of this there are pippeling more fancy questions up. Like: Will he go back and try to rescue the rest of the gentlemen and will he get help from someone? Like a gentleman-god.

Please answer my questions, I’m dieing to hear some wacky answers.

The Pirate Bay trial

Yeah I’ve been following the trial as the rest of the internet-crowd  these days. I’ll not start to write any summary or stuff like that but I’ll post some links with some serious and some unserious stuff.

Unserious stuff:

http://soundcloud.com/obd/obd-nu-ar-jag-en-cider-feat-hakan-roswall  - A song created by some dude, really fun. If you understand it.

http://spectrial.virvelvind.net/ – The place I got the song from above, here is some really fun stuff as well. More song, a Roswall-nonsense generator etc.

http://en.wikipedia.org/wiki/King_kong_defense – The wiki talks for it self.

Serious stuff:

The English translated version of all the news, twitters etc. from the case: http://74.125.19.132/translate_c?hl=da&langpair=sv%7Cen&u=http://live.piratpartiet.se/&usg=ALkJrhiLOLGPFWYRkZspxZZMrSFEJHQ1YQ

The place where you can listen to the trial LIVE: http://www.sr.se/webbradio/webbradio.asp?type=live&Id=SR-Extra01&BroadcastDate=&IsBlock

 

Except this I’ve used my 5 minute break on this wallpaper today. It comes in 2 sizes: 1600x1200 and 1900x1200 this should suit anyone.

1600x1200

1900x1200

The original PSD file for the 1600x1200 version

The TPB font

Please create more fun and fantastic wallpapers and such and post a comment or a ping to this post.

Go back to top