Bleadof’s world of tinkering

June 15, 2006

I’m fat but not for long!

Filed under: Just something — Bleadof @ 22:06

Today I challenge my irc-friend Antti ‘BCOW’. He has decided to lose 10kg of his weight. I’m going to challenge him not in weight but in time. I’ve decided that I will loose 5kg in two months. So now it’s final!

How I’m going to do it, well I’m going to start going out more and cycle as much I feel good doing. I’m not going to pay too much attention to my diet, only that I don’t go over the top with it. So I’m also trying to get fit. I have a bit of belly and I’m going to get rid off it.

I started today by cycling around Tuomiojärvi with Hannu ‘quercus’. and we decided that tomorrow, if the weather is good, we’ll cycle to Vaajakoski. Wish me luck \o/

June 13, 2006

#tolkien meet in Jyväskylä 29.-30.7.

Filed under: Just something — Bleadof @ 19:06

Info

  • Time: 29.-30.7.
  • Place: Jyväskylä@zayah
  • Host: zayah

So, if you’re up to it, just post a comment !

June 12, 2006

PHP4 OOP and references

Filed under: PHP,Programming,Tinkering — Bleadof @ 13:06

So today I decided check PHP4 OOP quirks. So now I know for sure how my code is going to behave. I wasn’t really sure how the PHP4 behaves with references so I did a test.

class ReferenceTest {

  var $reference;

  function ReferenceTest() {
    $this->reference = new Reference();
  }

  function getReference() {
    return $this->reference;
  }

  function &getReferenceReference() {
    return $this->reference;
  }
}

class Reference {

  var $var;

  function Reference() {
    $this->var = "";
  }

  function setVar($var) {
    $this->var = $var;
  }

  function getVar() {
    return $this->var;
  }

  function &getVarReference() {
    return $this->var;
  }

}

$rt =  new ReferenceTest();
$ref = $rt->getReference();
$ref->setVar("bar");
$ref2 =& $rt->getReferenceReference();
$ref2->setVar("baz");
$ref3 =& $rt->getReferenceReference();
$varRef =& $ref3->getVarReference();
$varRef = "baf";
$ref3->setVar("foo");

print "ref:".$ref->getVar()."<br/>";
print "ref2:".$ref2->getVar()."<br/>";
print "ref3:".$ref3->getVar()."<br/>";

Do you know what is the output? Here’s the anwser.

June 9, 2006

Last.fm love \o/

Filed under: Jyväskylä University Library,Tinkering,Work — Bleadof @ 09:06

I presume that I’m not the only one who has noticed the lovely features of the Last.fm player… It’s so cool that you’re able to listen your favorite music still at work and not actually being forced to bring the music with you or start streaming from home.

At the moment I’m subscribed because they’ve been messing around with my charts. This means I’ve more radios available than as a normal user. I’ve been mostly listening my personal radio but sometimes it’s nice to hear something new and I listen my neighbour radio. Fun \o/

Now some work… Started to poke around some on the old system. It’s totally crappy. There’s a lot of things which could easily go to The Daily WTF, but I can’t be bothered to submit them. I think I’m suggesting that we throw the old system to trash and do a proper one with OO PHP. Would be nice to actually just use Python but I guess it’s not possible.

We’ll see what happens…

June 5, 2006

Ah, the joy of non documented software…

Filed under: Jyväskylä University Library,Work — Bleadof @ 14:06

Blah, the system which was done last year is, of course, poorly documented… We got a paper document describing the database, guess if it actually corresponds the actual database structure ;) . NO, of course NOT!

This is one of those systems which have done in a really odd style. The style basically varies throughout the whole system. It’s quite hard to get a grip of it. We’ll see what else comes up when I read the whole code through…

As I’ve written before, it’s not just me who is working on this system. There’s also a guy called Tero who is also an intern. It seems that we’ve more or less divided the job so that I’m doing the user interface design and the stuff which is related to it and he’s concentrating more on the code part. This is kind of nice in a way because I’m a bit of fed up with PHP anyway ;)

Laters…

June 2, 2006

Working in Jyväskylä University Library

Filed under: Jyväskylä University Library,Work — Bleadof @ 09:06

Yei! I started working in the Jyväskylä University Library yesterday. Woke up like 7 am and went to work at eight. Scary stuff waking up so early. I guess you get used to it.

Some of the people are asking what I’m doing, well I and my collegue Toni are working on a PHP/MySQL based system which is in Finnish called “Kuittilaina”. The free translation in English would be something like: “Receipt loan”. Basically the development of the system has started last summer and we are continuing the development. I have not yet a good grasp of what is needed to do with it but I’ll probably post the stuff I come across here.

I’ve been looking at the code now and parts of it look ok but another part is just horrible which is quite usual when you’re mixing the layout and the logic together… So basically we’re going to rewriting of the code so we can use Smarty actually make it easy to change layout to what ever someone might want ;)

We see how it goes. Laters \o/

May 21, 2006

Kova kivi, halleluja!

Filed under: Just something — Bleadof @ 15:05

Hard rock, hallelujah! Bloody hell, Lordi really did it, they won the freaking Eurovision Song contest. This a really remarkable thing for Finnish rock music!

Screw ice hockey! Lordi, well done! \,,/

April 27, 2006

PHP4 and error handling…

Filed under: PHP,Programming,Tinkering — Bleadof @ 00:04

I’m working on a project at the moment. Doing stuff for company called Boogie Beat Oy. I’m doing a whole rewrite for their system-of-a-thingie… I decided to start using proper OOP-style. Pretty interesting thing to do with a language which I’ve used only for procedural programming. So I stumbled upon some of the problems which PHP4 has with objects and error handling.

set_error_handler(“yourErrorHandlerFunction”)

I’m used to do objects with Java andJava’s way of handling errors which is quite nice and flexible.

In PHP4 the built in way of raising errors is:

trigger_error("Error message", E_USER_ERROR)

This is not the actual problem but the:


function my_errror_handler($errno, $errstr, $errfile, $errline, $errcontext) {
switch($errno) {
case E_USER_ERROR:
...
}
}
$old_error_handler = set_error_handler("my_error_handler");

Which would be just brilliant if you could say…


$old_error_handler = set_error_handler("$object->errorHandler");

…and when you can’t. You’re basically bound to do like this:


require('Object.class.php');
$object = new Object();
function __errorHandler($errno, $errstr, $errfile, $errline, $errcontext) {
global $object;
$object->errorHandler($errno, $errstr, $errfile, $errline, $errcontext);
}
$oldErrorHandler = set_error_handler("__errorHandler");

Which is kind of sucky way of doing things… Basically what I’ve done is that my errorHandler will store all of the errors in an Array and I can just ask for the errors when I need to get them and it’ll return an Array of the errors. So I can easily foreach the errors in a Smarty template and not have to worry about the errors been print out anywhere or anytime they are triggered.

Took me some time to figure out a way to point to the function of this errorHandler class I wrote. This implementation is a hack but it works! It makes it easy to localize the errors if wanted because you can modify the errorHandling as you wish…

Here’s few documents where you can find more information about the error handling in PHP4

Oh well, that’s about it… Probably more about this later…

February 13, 2006

Home sweet home

Filed under: General whining — Bleadof @ 10:02

Yes, finally I’m back in Finland and moved and done all that stuff you need to do when you’re coming from abroad. We’ve been already housewarmed and the whole moving thing is more or less done besides some paintings which are not yet on the wall. Oh and yes, I forgot the bedroom curtains, they’re not yet exactly on the right place. We are both really excited about the flat. It’s really nice and comfy. Loads of room so we are forced to actually decorate a bit so that it doesn’t look that spooky.

What else? Well, I got few projects to work on. Both fixing and implementing new things on already existing systems. It’s not that bad and it should be nice pocket money/stuff so that student life doesn’t feel so miserable. We were thinking of getting a modded XBox because playing with a PC is such a hassle. It would be a nice media system as well ie. playing movies and such.

Studies

Well, they’ve started. Few modules(=kursseja) have already started. Mainly concentrating on one of my secondary subjects, economics. Basic bullshit and management is roughly what the modules are about. Not really interested on those but hey they are compulsory ;) There are some modules though which I’m keenly waiting to start, like System Architectures (Ohjelmistoarkkitehtuurit) and Software protocols (Sovellusprotokollat). Don’t really know if my translations are good but you get somekind of image what I’m studying.

Dumppi

Our student organisation, Dumppi, needs me urgently but I’m not sure if I can give them all the attention they would need :) Loads of bugs on our software and new feature I’d need to implement. We’ll see, there’s no price or catch so it’s not my priority number one. I’ll do it but when I have some time.

Console tournament is yet to come. I’m organising the practical side of it because I’ve done that two times already. We’ll see how it’s going to develop…

That’s it folks for this time…

…more to come in the future

December 12, 2005

Hmh, quite a while since I’ve been blogging…

Filed under: Exchange,London — Bleadof @ 16:12

Oh well, I just haven’t felt like blogging… I don’t know why, probably just feeling too lazy ;) But here we go again…

Hampsted Heath

I went there with Philip and Thulani. Took about 200 pictures (not quite but close). It was lot of fun just walking around this huge park, spotting shots and getting some fresh air while doing it. Photographing is fun! After a while it started to get pretty chilly and I was freezing. We decided to get some coffee and head back to Tufnell Park. So we popped in Starbucks and took bus back to halls.

Johanna was here about a week ago

Yup. My girlfriend Johanna came to visit me for the weekend about a week ago. That was fun. I miss her a lot. She’s not going to be in France for the whole academic year but she is also going to leave after first semester. So we are trying to get a flat together from Jyväskylä and to be more precise from Kortepohja. On the weekend when she was here we went out shopping on both days. Didn’t get much shopping done but we had fun and that’s the first priority anyway ;) On monday I escorted her to Liverpool Street station where she took train to Stansted. It’s hard to say goodbye although we are going to see in less than two weeks. Now it’s less than week.

Christmas time

I’ve done my christmas shopping already. All the gifts have been planned and got. I feel proud of myself. This is the first time ever I’ve done proper Christmas shopping :)

I’m leaving UK on a Friday, 16. of December. I’ll stay in Helsinki for the night in Olli’s and Tanja’s apartment and wait for Johanna who is coming the next day. Then her parents are going to pick us up and we’ll be on their place for few days.

On Monday 19. of December we’ll visit Jyväskylä and see our friends after a long time. That’s going to be a blast :) I’ll be leaving to Kolari on 20. of December by train. The trip is going to be about 13 hours ;) Thank something I can sleep during the time in sleeping car.

When I arrive to Kolari I have a hairdresser appointment which is nice because it has been quite a while since my hair has been “trimmed”. ;) I don’t look bad but it’s getting there. :)

During the holiday I probably have to finish two other courseworks which aren’t that bad but I have to take the time to finish them and doing work during holiday sucks in general… Other one is the eCommerce where I need to add a shopping cart to my website and something else which is also trivial… The other coursework is doing a Flash design for the HCI module. We have to do a high fidelity prototype of the Smart Wardrobe application… I don’t know Flash or Action Script at all but I will probably catch it pretty quickly (hopefully anyway).

New Year

We’ve got a cottage in Äkäslompolo, near Äkäshotelli, and we are going to spend the New Years time there with our friends. Me, Johanna, my sister, my sisters boyfriend, my sisters boyfriends sister, my sisters boyfriends sisters boyfriend, Johanna’s friend Sanna, my friend Hannu, Hannu’s girlfriend Hanna, my cousin Matias, my friend Anssi and my friend Matti are coming at the moment. Probably there will be also my friends Kimmo and Mika but they’re not sure yet. I’m going to arrange reindeer driving, snow scooter trip and maybe we’ll also go for some hiking… New Years eve we’ll probably just spend time in the cottage, eating, talking, going to sauna and maybe firing few rockets. That’s going to fun. :) I’m waiting for it.

Now

I should’ve already gone to shower and started doing my coursework but I felt that I have to blog so I did. It’s only few days until I will leave to Finland but I still have loads of work to do. Better get as much as I can done here not on the holiday. :) Although I want to have some fun here as well before I leave. We’ll see how I can manage to do that. But now it’s work time… Bye bye for a while…

« Newer PostsOlder Posts »

Powered by WordPress