Info
- Time: 29.-30.7.
- Place: Jyväskylä@zayah
- Host: zayah
So, if you’re up to it, just post a comment !
So, if you’re up to it, just post a comment !
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.
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…
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…
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/
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! \,,/
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.
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…
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.
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.
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…
…more to come in the future
Oh well, I just haven’t felt like blogging… I don’t know why, probably just feeling too lazy
But here we go again…
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.
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.
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).
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.
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…
The reason I haven’t been writing for a while now is because my girlfriend Johanna was visiting me last week and this week I’ve been struggling with courseworks. That’s why I have almost two weeks of happenings to tell you! Oh the joy and the happiness
Yes! Dear something, I’ve handed out my first courseworks and celebrated that already also! \o/ Basically this means I’ve handed out my eCommerce coursework which can be found in here.
That’s a sad site which is “selling” geeky watches. That’s not all of the coursework, I had to hand in a report describing problems and the process of doing the artifact. Not so interesting to write a report on that. As you probably can see if you visit the site it’s done with using XHTML 1.1, CSS 2.0 and ASP. The layout is quite lame, I could have done better but I just couldn’t be bothered. All but one of the images are nicked from Thinkgeek which was basically my source of inspiration for the site.
I also had a groupwork coursework for Human Computer Interaction module. The coursework was about developing a Digital Home Help which would ease peoples everyday task.
I came up with the idea of a Smart Wardrobe which would basically be a automated stylist for young women. You could be able to consult it with touch screen attached to the wardrobe door. The wardrobe would know what is inside it because all of the clothes would have RFID tags on them and the wardrobe would have a RFID reader. It would give the clothing suggestions based on the clothing inside it, based on the users previous preferences and based on the fashion info programmed into it.
And yes, I’ve heard Clueless had same sort of thing. And yes, I’ve seen the movie but I didn’t remember that. Anyhow the lecturer of the course liked the idea. \o/
I did this coursework with two other guys, Abdul and Jide. No idea where they are originally from and it doesn’t really matter.
The guys didn’t put as much effort as I did for this coursework but then again, such is life. We had to write a report about the process and the methods we used to get to this design. We even interviewed and observed people (or at least I did) for the user needs analysis. The report we wrote had about 2500 words and that’s 500 more than we needed. \o/
This kind of project is ok. I think now I really understand what do they mean with User Centered Design.
Both of the courseworks are still going to continue. So more struggling ahead.
Went to the Mean Fiddler on friday to celebrate the finished courseworks. The night was OK, although I enjoyed more when were drinking in Drews room. Thanks for the beer Drew!
I miss her even more after she visited me. I almost got used to her being here already and then she just went back to Grenoble. Boo!
The whole week she was here I didn’t do much but hanged with her and showed her the city. We went for all of the usual tourist places but it was fun.
The weather could have been a bit better since it was raining almost the whole week she was here. We didn’t mind it that much because as she said it: “It’s not a true English experience of London if it’s not raining.”. Indeed!
Before Johanna came I got to know this bloke called Phil and he was kind enough to give us a tour of places I didn’t know. He’s been living in London for about 6 years now, so he has been around here and there. Cheers for Phil
We went also to see Tate Modern and spent there few hours of wondering the queer and odd things some artists have created. I found it somewhat disturbing but still quite interesting.
That was actually the same day when London had a huge fireworks near the Waterloo bridge so we stayed to see them too. I took bunch of pictures of the fireworks but didn’t really think that they were that good. I might put them online at some point anyhow.
The last day Johanna was here we went to do some shopping in Camden Town, the Oxford Circus and Tottenham Court Road. She actually didn’t buy much, only some souvenirs for her flat mates and two t-shirts from the Babel Line guy. In the evening we went to Garfunkel’s near Oxford Circus and we both had Garfunkel’s Mixed Grill which is: “a full plate of steak, chicken, bacon, sausage, tomato, spicy onion rings, mushrooms and your choice of French fries or a baked potato and barbecue sauce on the side”. It was just brilliant although we got a bit bad table with no privacy what so ever. Then again it’s easy to get privacy by just talking in Finnish.
We enjoyed the food and the later on we came back to the Tufnell Park and went to local Sainsbury’s to buy some snacks and sweets. It was a really nice evening all together. Last night together for another month or so…
Johanna left on monday morning and I escorted her to the Liverpool Street station so she could take the train to the Stansted airport. That wasn’t any fun…
As I said before I’ve been mostly doing the courseworks but last wednesday we went to Hyde Park with Phil to take some pictures and get some fresh air.
That was fun just wondering around the park and we captured some nice shots. I’m so envious for Phil because he has a Nikon digital SLR and some nice equipment… My Canon DI 50 was feeling a bit like a handgun beside of a bazooka.
So I tried to compensate my lack of equipment with imagination
. I’ll put the pictures online a bit later…
Uhm, what else… Yes, I forgot to tell you that I got a new towel! Yei! I also bought a crate of Carlsberg export for £7.99. It’s 12×0.44l cans. That’s about 5.28 litres of beer
. Had some on tuesday and some yesterday. Cool stuff, as Phil would say.
Now I’m off to make something to eat…
Powered by WordPress