ChaniBlog











{September 7, 2014}   Blip.tv screencasts moved

Blip.tv has decided to narrow its focus, and isn’t interested in hosting my screencasts any more. I’ve moved the two 4.6 screencasts to youtube: Activities in KDE Plasma Desktop 4.6 and Activities in action. If you’d like any of the older ones (Activity Sessions, Activities in KDE SC 4.5beta1, Plasma Activities in KDE SC 4.4) to go up on youtube too, just ask. :)

Advertisements


{November 20, 2013}   Accessibility surprises

So CascadiaJS was last week, and it was awesome. I did have one issue at the start, though, which surprised me enough to blog about.

First off, the issue was resolved quite well. I’m not writing this post to complain, but to educate. I might have been too shy to bring it up, but at the start of the conference they told us who to talk to if we had any problems, even ones that seem silly. :) I’m really glad of that.

So, the issue: for the first time, I had need of the accessible bathroom. But it was locked. When I first discovered this, the staff member with the keys happened to be nearby. After explaining why I needed it, he unlocked it, but insisted on locking it again afterwards so that nobody made it messy.

Two issues here: first, having to ask made me feel really bad. I look young and healthy, but I’m not. So I end up explaining my personal health situation to a stranger to beg permission to empty my bladder. It reminded me of being in grade school, having to put my hand up and ask instead of just quietly slipping out. I wasn’t looking forward to having to ask him again – even skipping the explanation, it still meant finding him, and interrupting whatever he was doing. And doing so again every time I needed to pee (which was about once an hour). And since I feel bad about imposing on him (and humiliated too), I felt pressured to keep my bathroom visits to the minimum too.

I now have a lot more understanding of how disabled people can seem like cranky assholes sometimes. If I stopped caring about the feelings of the guy with the keys, life would be much simpler.

And then I started worrying, what if I couldn’t find him when I did need the bathroom? Which brings us to issue two: the very next time I needed it, he wasn’t there. Some nice lady helped me down to the regular bathroom then – I’d delayed so long I couldn’t wait much longer. But after lunch, he was still gone. So that’s when I went to the awesome Angelina and got the problem fixed. Bathroom unlocked for the rest of the conference, apart from a few times when the damn door re-locked itself. :)

Oh, and nobody made a mess of the bathroom anyways. Yay for responsible adults!

What I learned from this is, accessibility isn’t necessarily intuitive. I could have just as easily been the one with the keys in this situation. He made a fairly reasonable assumption (that a guaranteed-clean bathroom was better than an unlocked bathroom) that just happened to be wrong. Now I’m wondering: what wrong assumptions about accessibility do we have in our code? (Assuming there is any accessibility in the first place :P ) Or in our other attempts to be helpful in general?

It can be hard to explain when something intended to be helpful is actually hurtful, or even to understand what happened. I just hope that if I end up on the other end, the person has the nerve to speak up and I have the patience to listen.



{October 6, 2013}   How to Not be a Rockstar

Lately I’ve been keeping up with twitter, and retweeting the best of what I see. And there’s a trend in that recently: articles encouraging humility. I like this, and I feel like saying a few words myself.

Most recently, @shanley wrote (or.. crowdsourced?) an article on how the “10x engineer” is a myth, and why it’s bad. Unfortunately it just sort of trails off at the end, and I’m left a bit confused, so I’ll try to sum it up: Long ago someone did a crappy study with way too few participants, made wild claims, and then it snowballed into this myth that encourages harmful behaviour like hero-worship, overworking, depression, etc.

Been there, done that, got the t-shirt (and health issues nobody my age ought to have). And yet, it’s such a tempting trap that I keep having to drag myself away from it again. I mean, who doesn’t want to be a rockstar? Who doesn’t want to be the bestest programmer in the world, and have everyone think they’re awesome? My brain is good at avoiding substance addictions, but has a blind spot when it comes to people’s praise and approval. Besides, there’s so much in this world that I want to do, it’s hard to stop and rest when I need to the most.

Another post I retweeted was Presentation Skills Considered Harmful. It’s a very well-written post on how to reduce stage fright and be a better presenter at the same time – not “better” in the rockstar sense, but in the sense of actually being more useful to your audience. Last time I submitted a talk proposal, I had this nagging “I’m doing it wrong” feeling, and I think this post explains a lot of it – I was focused on how I could get my proposal accepted, how to make it sell and make me look like the sort of presenter everyone wants at their conference – not on how the talk could be useful to the audience. I mean, that was in there somewhere too, but it wasn’t the priority. In truth, even while writing it I didn’t really believe it was a useful talk. I just missed talking, and have yet to gain enough experience with javascript to have anything useful to say about it. :( Still, what I liked most about the article was that it gives me clear guidelines to follow when, one day, I do have something to say again. :)

Now, I find myself wondering: why is this rockstar thing so tempting? Why do I feel compelled to judge programmers, and persecute myself if I don’t appear to be the best? Why are people so eager to put someone on a pedestal and start a cult of personality? A part of my mind says, this is obvious, humans have always been that way. But I’ve found that questioning those “obvious” things can lead to interesting discoveries.

I can’t speak for other people, but for me…. it usually boils down to fear. Silly, irrational fears, which are the hardest to defeat. I fear that if I’m not the best programmer, I must be the worst programmer and I’ll end up with no job (despite having never been unemployed except by choice). I fear that if I’m not giving talks about awesome stuff, nobody will be interested in talking to me (despite all the good conversation and friends I made at WWDC, where I doubt any programmer knew less about apple tech than me). I fear that any imperfection in me could be used against my whole gender, even though the communities I hang out in wouldn’t put up with such behaviour, and the best thing I can do for other female geeks is to be myself as loud as I dare. :)

The worst part is, when I try to break away from this, I’m often overwhelmed by the fear that I somehow need these silly fears. They lie to me, and tell me that without them I’m nothing, that I’ll just lie on the couch and do nothing all day, and never accomplish anything. Yet when I’ve succeeded at putting aside those fears for a while, the opposite is true: on average, I get more motivation and energy, and accomplish more, and feel better about myself in general. Sure, sometimes I need a day or two of doing fuck-all first because I’m burnt out, but if I rest without beating myself up about it, I can’t seem to help doing something productive soon afterwards. And it’s a lot more fun when I wholeheartedly want to do it. :)

So, if you feel like your ego is hurting you… try putting it aside for a week or two. Focus on how you can help other people in your community, or at work. Try doing what’s right, even if you’re scared of getting punished for it. :) And put your health first, because you can’t help yourself or others if you work yourself to death. :P

Oh, and there’s another trap to avoid here: competitive humility isn’t real humility. If you’re putting down people for following their ego, you’re doing it wrong. And if you get angry at yourself for having an ego, you’re doing it wrong. I still want to be the bestest programmer ever. I still want oodles of money. There’s nothing intrinsically wrong with having such desires. I’m just taking them out of the driver’s seat for a while. Desires have a lot in common with two-year-olds; giving them what they want isn’t the best way to handle them, but beating them up isn’t right either. :)

Now that I think about it, fear and anger can be like two-year-olds too. Resist them directly, and they throw a wild tantrum and try their best to make you feel miserable. But give them some space and understanding, and hear them out, and they just might agree to try another way (forgive me if the metaphor is stretched; I don’t have much experience with actual two-year-olds).

Anyways, that’s enough for tonight. Maybe another time I’ll have a go at the hero-worship issue (note to self: The Speaker-vs-Audience Dichotomy is relevant reading). For now, I’ll leave you with an article that convinced me accepting tips is suboptimal, and a quote that changed how I think:

“Confidence doesn’t come from knowing you’re right – it comes from being okay with failing.” — Design is a Job



I’ve been meaning to blog about this for ages, but I seem to have writers’ block. Time to break through it!

Going from desktop kde/qt programming to mobile and web development has been quite a change. Some of the lessons I’ve learned along the way, I wish I could have read about instead of walking into. So, I’m writing about them now to save the next person from that. :)

Let’s start with node.js. I love node.js, it’s a lot of fun to work with. A shame there’s always web browsers at the other end. ;P But, node is a place where you are guaranteed to run into one of javascript’s biggest annoyances:

Callback hell

Now, for KDE programmers, callbacks might not sound so bad. Signals and slots are technically callbacks, right? And they’re easy and fun to work with. But when you strip away all that nice abstraction, you get a lot of ugliness. Ugliness like this:

doAsyncThingOne(data, function(error, result) {
    if (error) {
        ohshit();
    } else {
        doAsyncThingTwo(data, function(error, result) {
        if (error) {
            ohshit();
        } else {
            doAsyncThingThree(data, function(error, result) {
                if (error) {
                    ohshit();

…and so on. (sorry about the ugliness of the code formatting, that’s what you get on a free wordpress account.)

And that’s assuming that all your async methods use the “data, callback” pattern. it’s a popular one, but there’s another popular pattern, “data, successCallback, errorCallback” – and sometimes “data, {success:callback, error:callback}”. And then there’s the question of what pattern they expect for those callbacks you’re passing in – is it “error, results”? “results, error”? Something Completely Different?

It can get to be quite a headache quite quickly when the libraries you’re working with don’t all use the same pattern, and you always have to remember which one expects which. and there’s no compiler to warn you, either – you just get things breaking horribly or, just as often, silently dropping bits on the floor.

Cleaning it up

Fortunately the majority of libraries I’ve worked with follow the pattern in my example – including async, a library purely for reducing the pain of callback hell. Async can get that awful example down to something more manageable:

async.waterfall([
    function thingOne(next) {
        doAsyncThingOne(data, next);
    },
    doAsyncThingTwo,
    function thingThree(dataFromTwo, next) {
        doAsyncThingThree(dataFromTwo, function (error, result) {
            if (result.isCool()) {
                next(null, result);
            } else {
                next("not cool!");
            }
        });
    },
], function finalize(error, dataFromThree) {
    if (error) {
        ohshit();
    } else {
        yay(dataFromThree);
    }
});

note that since thingTwo fit async's callback expectations perfectly, we didn't even have to wrap it. :)

However, this is still pretty inflexible – what if a particular result from thingOne means that you can skip things 2 and 3 but still need 5? I've heard that Promises are more flexible in this regard, and I plan to try them out sooner or later, but I'm not sure what to do about all the libraries that don't offer a promises api. We shall see.

The ‘dummies’ part

Now, I actually got way off topic there. There’s a different problem with callbacks that inspired this blog post. I felt really goddamn stupid when I noticed I’d done it, but then I realised… everyone else working on the project had also done it somewhere.

See… the thing about callbacks, is that when you take one, you're promising to call it once, and exactly once. Not twice, not zero (excepting that thou then proceed to one ;). What we had was some callbacks that might never be called, and some that were always called twice. Or more.

Oops.

So, yeah, don't do that. It’s bad.

And… that’s it, really. I keep feeling like I should have more to say about it (One shall be the number of the counting, and the number of the counting shall be one?) but it’s just a matter of checking your code. And hopefully keeping the methods simple enough that checking the callback call doesn’t require a state diagram. :)

If you want more information, just google “callback hell”. There are plenty of other blogs about it. :) (ooh, Elm sounds interesting…)



{December 14, 2012}   Qt Job available

A new year, and a new job for me again! :) I’m switching to something in my own timezone, so someone needs to take over my current job in january. If you’re a qt developer who’s not too far from Utrecht, it could be you. :)

I’ve been writing an IDE of sorts for a little web company called Eljakim. They have a framework for making their web apps, and my job is to make it easier for them to make those apps (eg. by taking away the writing-xml-by-hand part). the IDE is in Qt, but the framework is in php, so knowing a bit of php is a bonus.

It’s a really nice company, very relaxed and flexible about work hours. When I visited their office, I wished I could stay longer – but since almost all of them work in the office, the whole online communication thing was a bit new to them. So, this job would be better for someone who can either visit Utrecht regularly, or live there. (I was actually considering moving when I took the job, but, I can’t bear to leave Vancouver again.)

If this sounds interesting, contact me (or them) for more information. :)

As for my new job… I’ve officially sold out. ;) Some friends from SFU started a little iOS app company a few years ago, and I’m going to join them and learn about the world of objective C. it’s a shame about the proprietary-ness and such, but it seems like it’ll be a fun job with good people, and that counts for a lot. I made sure the contract didn’t forbid me from contributing to FOSS, but I think I’m just going to focus on being awesome at my job, and enjoying offline hobbies.



I’m using a lot of QTreeViews at work. So many damn QTreeViews. :P One of the problems I ran into was that QHeaderView::ResizeToContents and QHeaderView::Stretch are mutually exclusive. I had my own custom RichTextDelegate (not Andre’s RichTextDelegate, it wasn’t quite what I wanted) as the only column of a treeview, and I wanted a scrollbar when the contents didn’t fit, but I didn’t want the column to shrink smaller than the view because that looks goofy (especially with alternatingRowColors on mac).

You can’t just setStretchLastSection(), because that just changes the resizeMode from ResizeToContents to Stretch and you lose your scrollbar. QHeaderView’s resize modes are all mutually exclusive, which is a real shame (especially if you wanted them user-resizable, but thankfully I don’t).

I made an attempt to tackle this problem again on friday, not really expecting to make progress. It turned out sandsmark was trying to solve the same problem too – he was thinking of subclassing QHeaderView, and I was hoping I could just subclass QTreeView (which I was going to need to do for some moveCommand stuff anyways). Surprisingly, I could. :)

It turns out QHeaderView relies a lot on its view’s sizeHintForColumn(). So, after subclassing the view, I just reimplemented that function and had it never return a width smaller than the view’s width:


int CustomTreeView::sizeHintForColumn(int column) const
{
int viewSize = viewport()->width();
int colSize = QTreeView::sizeHintForColumn(column);
return qMax(viewSize, colSize);
}

(damnit wordpress, why doesn’t the <code> tag let me indent easily?)

of course it’ll get more complicated if you have more columns, but when it’s just a one-column tree, this is a really nice trick. :)

[edit: wow, this is my 300th post. hard to believe I’ve written that much in.. what, 6 years?]



At Eljakim (my new employer), work repositories are all svn (lowest common denominator), but several of us access them via git-svn. I’ve created a couple of new ones recently, but thanks to timezones, I never get an svn repo until I’ve already done a day’s work (in git). Getting those commits into svn without losing history is a simple thing when you know how – but when I googled, all I saw were strange and crazy hacks involving arcane commands I didn’t understand. So, here’s the easy way:

  • Check out the svn repo
  • git svn clone https://url.to/svn-repo

  • Make a folder for your work (assuming it’s not already there)
  • cd svn-repo
    mkdir chani
    touch chani/temp
    git add chani/temp
    git ci
    git svn dcommit

  • Check out just that folder
  • cd ..
    git svn clone https://url.to/svn-repo/chani merge-repo

  • Connect it to the git repo
  • cd merge-repo
    git remote add mygit /path/to/git-repo
    git fetch mygit
    git checkout -b mymerge mygit/master

  • Rebase your work on top of svn
  • git rebase master
    git checkout master
    git merge --ff-only mymerge

  • Clean up the temp file (is thre a way to just commit an empty dir in git?)
  • git rm temp
    git ci

  • And send it to the server!
  • git svn dcommit

  • Switch back to the primary repo (optional)
  • cd ..
    rm -rf merge-repo
    cd svn-repo
    git svn rebase

Of course, you don’t have to delete the merge repo, you could keep using it as your primary repo – but the way things are set up here I always end up wanting my checkout to be a level above that. :)

Edit: Also, make sure you move or delete the original git repo once the commits are safely in svn. I spent half the day continuing to work in the pure git repo after blogging this… >.< oh well, at least I just had to copy&paste off my blog to fix it. :P



{January 6, 2012}   Weddings and Work

I’m blogging from Utrecht today – for my first week of work. :) So far it’s pretty awesome; I wish I was here for more than just one week. [Edit: in case it’s not clear, I’m going back home at the end of the week, NOT immigrating to the netherlands. ] The guyspeople at the office are great, and I get to work on a cool project: making them an IDE (in qt, of course) for their web framework. :)

In an indirect way, I have KDE to thank for this job, actually. I met my boss at blauzahl and mek’s wedding. :) And the wedding was great, too. Lots of chaos, naturally, but somehow everything fell into place in the end. I still want the recipe for that pumpkin curry. ;) There are photos online, but I’m too lazy to link to them right now.

And now it seems like everyone’s getting married – friends, co-workers, even me. :) I’m engaged to pete now :) :) although we’ve not made any plans yet.

Lots has happened in the last few months. I’ve graduated too, of course. Over christmas I did a bit of work on ContextJournal, too; hopefully I’ll add some timetracking features to it soon (oh look, uncommitted code.. it seems I started already), but at the moment I’ve barely got time for anything but work. :) I have a language-related web project I ought to upload somewhere, too. maybe I’ll blog about that later – but not on planetkde, I suppose. If you want to hear more about what I’m up to, you’ll have to subscribe to my blog separately.



{September 28, 2011}   Will Hack For Food

Update: I’ve accepted a job now. :) I suppose I ought to blog about it…

So I’m graduating in December. Are you hiring for January?

I assume if you’re reading my blog, you know that I’ve got plenty of experience hacking on KDE things. I care about my code, I get things done, and I <3 standards. :) Most of my experience is with C++ and Qt of course, but I learn fast; having an interesting project is more important to me than which tools to use. I’ve been dabbling in node.js and jquery this year, actually. That said, it would still be awesome to find a job where I can contribute to KDE.

I’d strongly prefer to stay in Vancouver, but Europe could be an option too (I’ve already got an EU passport). So if you’ve got an opportunity for me, check out my resume and send me an email!



{September 3, 2011}   oh yeah… linuxcon…

Riight, so I was at LinuxCon, uhm, two weeks ago. :) Two conferences in a row was a bit much, so I’ve been trying to enjoy my vacation since then (mostly).

It was a great conference, though. :) At first I was feeling a bit out of place – the conference shirts didn’t come in ladies’ sizes (boooo!!) and it seemed to be lots of server stuff and kernel hackers, not desktop or UI stuff. But I met some friends, saw contour/plasma-active/whatever being demoed at the LFNW booth, made some new friends, and pretty soon it felt like a regular conference. :) I don’t feel like talking much about the talks (I’d have to look at my notes for that, and besides, Dafydd’s notes are far more detailed) but the intro to kernel hacking was great – I learned a lot from it, and felt a wave of nostalgia when the guy talked about compiling your own kernel. ;)

The party on wednesday was particularly awesome – lots of people dressed up for the 20’s theme, and there was much dancing. Thursday I managed to get to four different parties – three of which were officially part of the conference. :) I remember having some interesting conversations… but I never heard what happened to that little multicolour lamp in the end. :P

I didn’t get a WebOS touchpad, unfortunately – I was hearing about them selling out during the conference (and my sympathies to the HP guy who heard the announcement right *after* his big talk) – but I was in the right place at the right time friday afternoon, when they gave away some nicely framed linux posters. :) So now I need to actually get tools to mount stuff on walls, because “got linux?” is still hiding in a corner.

At first it seemed like all the job offers would be for kernel hackers too, but after checking the job-wall and talking to people I found several hiring – even some local companies. yay! :) So, I’ve been polishing up my resume the last two weeks too.

Now somehow my vacation time has slipped away – I’m not even sure where it went. Doh. We’ve only had the one month of proper summer here (which I missed a third of for the desktop summit), and already the leaves are starting to fall, and a little chill is in the air… and, school starts in a few days. My last semester. Wow.
Time flies…



et cetera