ChaniBlog











{September 28, 2009}   ucosp sprint, part 2

Well, saturday night was fun. :) We all went out to a chinese restaurant and had lots of yummy food. Then some of us went back to the hotel and played cards for a while. I learnt a new game, but I have no idea how to spell it. :)

Sunday was the last day – checked out of the hotel, did a little hacking, and we had a post-mortem meeting with all the students. I got lost in my laptop after that, plus my mind was not liking the lack of sleep, so I never got around to having lunch… oops. :) There was pizza at the airport, at least. Our group divided up again, into two groups – for the rest of the semester we’ll be working on different features for the robocup client, competing to see which improvements are more helpful, then merging them into trunk (oh god I wish we were using git now instead of svn).

four of us were on the same flight back to vancouver, so we got seats all in a row, which was nice. :) mostly we just wanted sleep, though. god it was nice to get home and sleep in… I didn’t go to any classes today, I need to recover. :)

Advertisements


{September 26, 2009}   ucosp sprint

it’s day two of the ucosp sprint. thursday night I arrived in toronto, tired and coughing… and found karaoke in the hotel bar. grrrr… I *finally* find karaoke, and it’s on a night when I can barely speak. but I met up with some of the other students, and we headed to another bar where the law students were having a party. :) much beer was consumed… and when I wandered back to the hotel with a couple of other students we found the karaoke still going. so we went in there and got to sing the last song. :) I feel sorry for the few people still there listening ;)

friday morning I somehow dragged myself out of bed on time, met the rest of the students, and we headed to the university. there I finally got to meet my team in person. yay! :) we’re doing the robocup 2d simulation… there are a few clients from hte summer that we have the code for, and we had to pick one of them to build on. so we spent time reading stuff and trying to get stuff running, and debated the pros and cons of java vs. python. eventually we decided to extend one of the python clients; it’s got most of the boring details done, but the players are still pretty stupid so there’s lots for us to do. the java project was already so good we weren’t quite sure how we could improve it (and had run out of time to look for things, really).

once we’d settled on a codebase we started poking at that code specifically, trying to get it running on all our computers, coming up with things to improve, fighting with strange network errors… I spent a good chunk of my afternoon replacing the pile of simple bash scripts that started teams with a single more intelligent bash script.

friday evening some student union had organized a party for us at a nearby pub :) free beer FTW. I left early to get caught up on sleep but somehow the interwebs distracted me instead. ;)

saturday morning.. urgh. well, it’s a code sprint, I don’t expect much sleep. the cough and cold are annoying, though. I wandered in late, which turned out to be not so great as my team had started their meeting. oops. :) we came out of that with a list of seven tasks we’re going to do over the semester (and get marked on). I spent most of the rest of the day working with iona on getting the debug output of the clients in a more useful format (one curses thingy per process doesn’t work so well when you start 6+ processes out of a script; we’ve got a PyQt ui started instead).

this afternoon we also had a talk from greg about grad school. I’m not hugely interested, but it was an informative talk. :) most of what I remember is his little speech at the end… undergrad is about learning to learn, grad school is about learning what questions to ask, but what university is really about is teaching us to take over the world. :)

now it’s dinnertime, and I should head out to the group dinner.



{September 5, 2009}   and that was tokamak 3

wow, the week just flew by. it’s saturday night now, and I’m in zurich, checking email n’stuff. early tomorrow morning I’ll head to the airport.

it’s been a really awesome week. lots of hacking and hiking and very little sleep. it was wonderful to see the plasma family again. I miss you guys already. but I feel like I want a vacation to recover :P

no vacations for me, though. school starts tuesday and I’ve already got reading assigned. I’m in this cool new course where we’re going to be working on projects with students from other universities… here’s the blog for the course. it should be a lot of fun. :) but… the downside is it might be very busy, too, so I’m not sure how much time I’ll have for KDE this semester. we’ll see. after everything that’s happened at tokamak I really want to make *some* time to keep hacking. :)



time for more javascript! yay.

First, a quick little thing: my last javascript post was slides from my LFNW presentation, which had an extra little thing about dataengines. I never did blog about that code, though.
It’s pretty simple. I wanted the time engine to give me an update once a day, so that I can reset the flag. For demonstration purposes, though, once a day isn’t so great, so I set it to reset every ten seconds instead.


plasmoid.dataUpdate = function(source,data)
{
progress.setIcon("flag-red");
progressValue = 0;
}
engine = dataEngine("time");
engine.connectSource("Local", plasmoid, 10*1000);

I define my dataUpdate function, which gets the source and data – but doesn’t actually use them. It just resets the flag back to red (maybe later I should set it to double-check the date, in case there’s a forced update). then I grab the time engine, and connect the local time to my plasmoid with an update of ten seconds.

now for something a bit harder: I want more than one task.

So, first attempt. I put the task creation into a function, and calling this function made things work just the same as before. So far so good. Next, I changed all references to the label, icon and progress counter into arrays. New tasks are appended to the end of each array, and the dataUpdate clears them all. the config UI only controls the name of the first task for now; a second one is hardcoded in there.

Then I realised that the slot for changing the flag could only work for one icon. huh. :/ maybe it would be possible to add the function to each icon? but it’d still not know its index in progressValues. what I really want here is for the label, icon and counter to be wrapped up in their own little class. and if that class was a widget with its own layout, then I could easily stack them vertically instead of having everything all in one row.

I haven’t a clue how to do classes in js though. inheriting graphicswidget, creating slots…
well, I read up on javascript prototypes, and found out about the extends keyword… but I bet we don’t have QGraphicsWidget in the js bindings. :P ok, for now I’ll skip the inheritance.

I spent a long time trying to understand how to do classes in javascript. It’s weird. It hurt my brain (probably didn’t help that I was half asleep the whole time). I did get it working eventually, though. and then discovered that connecting signals and slots in javascript didn’t work quite as I thought it did. if you want to connect to a function that’s in your class, you have to use either foo.mySignal.connect(this, this.mySlot) or foo.mySignal.connect(this, “mySlot”) – with these it refers to the function in the class (not a global function) with “this” properly set.

Here’s the code using classes – I ended up reorganizing the code a bit in the process. There’s the Task class constructor, which sets up all the variables (label, icon and progress counter) and layouting and connections. Then there’s the reset function, which is called on timeout, and the moreProgress function, called when the icon is clicked. After that I have some setup code that creates two Tasks, and the old dataengine and config stuff. Only the name of the first Task is configurable, still (and I’m being bad and setting it directly instead of putting a function in the class for that).

So now what? Well, the layouting is ugly. Let’s see if we can improve it a bit. Wow, I managed to crash plasmoidviewer. It doesn’t like me doing new LinearLayout(plasmoid) more than once – riight, because the plasmoid itself can only have one controlling layout. I want new LinearLayout(layout) to have layouts inside layouts. Fixed that, and now I have nested layouts. :)

Notice that the flags aren’t aligned with each other. that’s what happens when you put hboxes in a vbox instead of using a gridlayout. I could hide it by putting the icon on the left, but really I should do it properly…
uhm. looks like we don’t have gridlayout bindings ATM. we do seem to have qgraphicsitem bindings… but I don’t want *those* any more, because with a gridlayout there’d be no point.

Oh well – I think that’s enough for now. I’m going to go work on something else… or see when lunch is… :)



{September 2, 2009}   tokamak continued

so it’s wednesday now, and tokamak continues to be awesome. all of the gsoc students that came here, and all but one of plasma’s gsoc students overall, have merged their code into trunk. we have remote widgets, a new applet browser, and more… then there’s netbook stuff, and web stuff, and we’ve been talking about the future of virtual desktops and the ZUI, and playing with the Mystery Device (whisky + wine -> making plasma look like gnome), and… I’ve already forgotten a lot of things, I’m sure :)

personally, I’ve been working on a bunch of little things: getting folderview to play nice with my mouse plugins, trying to make activity removal work better, chasing obscure bugs that popped up in the middle of that, making little fixes here and there (plasmoidviewer can be run with just a containment now, no applet – I got sick of having a clock in the way of my testing)… yesterday I returned to my javascript plasmoid, and I’ve got half a blog post about that, but right now my mind keeps wandering off to Overview ideas, which we’ll be discussing again tomorrow.

Randa is a really beautiful place, too. even when it rains. :) on monday we went out for a walk and ended up building a dam (exercise! team building! oh my!). Then we watched it get washed away by water released from a *real* dam somewhere upstream. :) the weirdest thing I’ve seen so far, though, is a moth that’s been hanging around the flowers outside, behaving just like a tiny hummingbird. I thought it *was* a hummingbird, but it has antennae. Davide was trying to get photos of it, but I’m not sure whether any turned out well… darn thing never stopped moving. it was fearless, though, buzzing around our heads.

anyways, time for another walk. adventure awaits! and then more hacking when we return…



et cetera