ChaniBlog











{April 28, 2013}   Linuxfest Northwest 2013

So I’m at Linuxfest Northwest this weekend. It’s been great so far, despite a soggy start.  Sitting in the border line in the rain for an hour proved that our motorcycle gear isn’t quite as waterproof as we thought.  :-P

Anyways, we still arrived in time for the lightning talks, and those were really good. I learnt a new xor trick, and there’s something to do with circuits and html5 that I didn’t quite understand but hope to learn more about.

Here’s a random photo from one lightning talk I liked:

image

The swag here has been cool too; I have a nice USB key / bottle opener from openshift, and I think I got signed up for some free web app thing I need to check out. I got new light-up bsd horns too (but I have my own EL wire version at home I ought to fix up).

The conference party was good, although dinner made us a bit late. Totally worth it, though – I never thought pork chops could be that delicious.  :-) I just wish I’d spent some time looking at exhibits or trying the various board games instead of getting sucked into cards against humanity for so long  ;-)

Now it’s Sunday, and there are lots of talks I’d like to be in at the same time. I saw the delegation one before lunch, which was quite good, but mostly reminded me that I knew all this stuff because KDE was doing it right (or trying hard at it) with the code of conduct and having junior-jobs and such.

Next up is a Javascript talk, which I’m hoping will be good and not just a list of words to google.

PS: the save button in the WordPress app actually means “publish”. Oops :-)



{April 8, 2013}   Blogging Block

So… I was planning on blogging about my new job. That was 3 months ago. How the fuck did april sneak up so fast?

Every time I think about blogging, my mind blanks out or I overthink it, so I’m just going to start writing now and hopefully it won’t be too incoherent. :)

It’s been an interesting three months. I’ve been sick twice (or maybe three times), sprained my ribs, and I’m sure plenty of other things happened that I’ve completely forgotten about. Work has been good. I was expecting it to be nice to be around humans again, but wasn’t expecting just how much better it was. I was actually sad to go home the first few fridays. :) My co-workers are generally awesome people, and the company is small enough that there’s no real hierarchy, just smart geeks making awesome software… :)

The initial enthusiasm has worn off, of course, but I still get the occasional reminder of how lucky I am. Like when our boss was interviewed by a Vancouver Sun reporter, who was amazed that we never worked more than 40 hours a week and our boss didn’t call us at home. Yeah, the tech sector in vancouver has a bit of a bad reputation.

A funny thing, though: I spent the first month or so of my iOS job working on android. :) We did that little Map of the Internet thing you may have heard about. That was fun. I learnt to loathe eclipse, though, and was surprised at the android bugs I had to fight with – some in obscure classes, some not so obscure. Oh, and there are 2500 different bloody devices out there, so no matter how many you test on, there’s always another one out there with weird bugs. :P I did love the android documentation, though. They did a really good job of explaining how to do things the Android Way.

Since then I’ve been working on internal code, which is all objective C. I’ve mostly got the hang of the language (thank god everything uses ARC now) but I still don’t quite grok Cocoa. And of course it’s irritating that when I’m confused by something I can’t just go RTFS and find out what the hell the developers were doing. XCode is far less irritating than Eclipse (with the possible exception of interface builder), but it’s also far less helpful; objC is just C enough for you to shoot yourself in the foot, and just dynamic enough for you to have no idea which foot you’ve shot. :)

I think it’s time for bed now. maybe I’ll post another random blog post another day… if I remember… :)



{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?]



{November 25, 2012}   On deep frying

I tried out deep frying for the first time on friday. It was… a learning experience.

I wanted to make sweet & sour tofu for a potluck. I didn’t have equipment appropriate for deep frying (all my slotted spoons were plastic, for one), but the birthday boy said he could borrow a deep fryer, so I got oil and all the other ingredients and went over to the party to cook it. It turned out that the deep fryer was some sort of fancy gadget that would spin the food to get oil off after cooking… luckily the internet had instructions for using it. Once I got the hang of all the buttons and dials, I tried deep frying my tofu. It.. .didn’t go quite perfectly. I did get food out of it, though.

Lesson 1: batter and those deep-frying mesh baskets do not mix. The batter will go through the mesh and fuse on the other side, even if you lower the basket first and drop the food into the oil. This was not fun to clean up, I nearly burned myself many times cutting the tofu off, and ended up with some really messy-looking food.

Lesson 2: tofu actually fries pretty well with just seasoning salt. For the second batch, I’d given up on batter and just tossed the tofu in alone, with a sprinkling of whatever seasoning they had available. they came out nice and golden brown, and not stuck to each other or the basket (much). :)

There must be a way to properly deep fry things with batter, but none of the recipes I read mentioned it. Now that I know what to google for… it suggests lowering things slowly with tongs (way too slow for ~20 pieces of tofu), shaking the basket (that basket… may or may not have been shakable. probably not.) and checking the oil temperature (I had only the machine’s green light to go on; but I’ll buy a candy thermometer someday). Well, it gives me things to try for next time, I guess.

Oh, and my favourite item at the potluck? rum & eggnog jello shots. :D



{November 25, 2012}   Delicious Butternut Squash Soup

It’s been ages since I had squash soup, and I missed it a lot. The only thing stopping me from making it was the lack of proper tools. My old blender is great for smoothies, but not for much else, and the idea of transferring soup to it a few cups at a time and trying to get them somewhat decently blended was not appealing.
Then last week, I was reminded of the existence of Immersion Blenders. A perfect solution for me – small enough to fit in my tiny little kitchen, and I don’t even have to take the soup out of the pot. :) They were even on sale, so I went out last weekend and bought myself an early christmas present. :) (I went for the Smart Stick with attachments – it doesn’t come in pretty colours, but it does more than just blend, and the price is still decent.)

Blender in hand, I looked up some more squash soup recipes to get an idea of what works. I ended up merging this coconut squash soup with this curry squash soup and Pete’s “add in lots of roasted veggies” recipe. The result was amazing, if I do say so myself. ;)

I bought enough squash for a double recipe, but I ended up using less coconut (partly because it was really sweet already, partly because my biggest pot was almost full). I used less water, too, just so it would fit. :) I like thick soups anyways. The only sad part was that I couldn’t get fresh rosemary that day, but the dried stuff seemed to work well enough. All in all, the cooking took about four hours! It was worth it, though. :)

So, the ingredients I think I ended up using:

  • 2 medium butternut squash (probably ~4.5lbs)
  • a few pinches of rosemary
  • one bulb of garlic, plus a few leftover pieces
  • 2 small yams
  • 2 yellow/orange peppers
  • about a quarter of a red onion
  • assorted herbs (rosemary, basil, etc)
  • salt
  • oil
  • one large sweet white onion
  • 4 generous tsp of curry powder
  • about 2x2x1″ of ginger
  • one cube of veggie stock
  • 3 cups water
  • 2 apples
  • half a cup of coconut milk

 

The first thing, of course, was to preheat the oven to.. er.. it was either 350 or 375. (forgive me if a few things are forgotten; I was too tired to care about blogging by the time the soup was done). I found my two biggest baking pans and lined the bigger one with tinfoil, went after the squash. Cutting a squash in half lengthwise can be.. tricky. I had to start at the bottom, get the blade into the neck as much as I could, then flip it around and work the knife in from the top (after cutting hte stalk off of course). Eventually they do pop open, though, and then you just scoop out the seeds, and put in a pinch of rosemary. I was able to fit three halves face-down into the first pan (plus some garlic bulbs – one for the soup, the others for later), covered it with tinfoil, and the other half got wrapped up in its own piece of tinfoil in the second pan.

I put all the squash in the oven right away, then started on the other veggies. Yams, peppers, the red onion and some leftover garlic bits all got chopped up and tossed in a bowl with oil, salt, and whatever seasoning I grabbed. I know basil was in there, and probably more of the rosemary; I might have added a bit of spike too. They all went into the second pan. I had planned on them cooking quickly, but, the squash was on the bottom getting most of the heat, and since they had to share a pan with one piece of squash they were all squished together a bit much. Next time, I’ll let the squash have the oven all to itself, and do the other veggies on broil, alone (which would have only taken like 15 minutes anyways). That extra squash half in the top pan was a bit underdone, too; either I need a bigger oven, or to swap the two pans around halfway through.

Anyways, an hour after putting the squash in, the bottom pan of squash was perfect. it was so well done it was just mush, and I had trouble not breaking the shell apart too much as I scooped out the flesh. :) there was syrupy squash juice in the bottom of the pan, too, which I happily licked off the tinfoil once I had all the squash out. :)

I’ve gotten ahead of myself a little, though. After putting the veggies in the oven, there was still half an hour left on the oven timer. I cleaned up a bit and practiced with the immersion blender before starting the soup. It turns out immersion blenders aren’t hard once you know that the blade part has to be completely in the water before you turn it on, and turned off again before you try to lift it out. :)

Anyways, once I was confident I wasn’t going to splatter soup on the walls, I got out my biggest soup pot and chopped up the onion. in it went, with a bit of oil, on medium heat. Every once in a while I checked on the veggies and mixed them around, but they were in no danger of burning whatsoever. Then I grated ginger as long as I could stand (I love ginger but grating is kind of a hassle – oh, and I used the fine grater, not the cheese one). Once the onions were soft, I added curry powder, and a minute later, the ginger. Then in went two cups of water and the veggie stock (which had actually been sitting in the water for a while, but I don’t think that matttered, it needs hot water to dissolve). With that stirred up a bit, I had the base for my soup – and just in time, because the squash was done.

I scooped the squash directly into the pot, and then (a long then – it was a lot of squash to scoop) the veggies went in too, and the contents of one bulb of garlic (you just pop a clove offand pull or squeeze out the contents, if it’s fully cooked it’s no problem). I chopped up the apples and put them in too, and another cup of water. All the scooping had been tiring, and I figured it would be good to let the soup cook and soften up those apples, so I sat down at the computer for half an hour and tried not to check on the soup too often.

When I returned, it was blending time! :) The immersion blender worked really well, and so fast. It’s really cool to see the soup slowly change from a jumble of veggie lumps to a smooth orange.. well.. soup. :) I’d been worrying that I’d overdone the curry powder, too, but after blending it had just the right balance of squash and curry. :) After letting it simmer a bit longer while I washed up,  I added half a can of coconut milk, and lots of salt (which thankfully brought down the sweetness a bit). And then, finally, it was done! :)

I made my bowl of soup look pretty with a drizzle of coconut milk and a pinch of nutmeg, but pete wasn’t willing to wait for that ;) I’ll take that as a compliment.

Damn, now I wish I had soup. it only lasted, like, 3 days. I need a bigger soup pot!



{November 5, 2012}   my own sweet and sour sauce

Every time Pete brings home chinese food, I’m reminded how delicious sweet & sour sauce is… and how much I hate the “chicken” it’s on. In true chinese fashion, the meat gets the good sauce and the tofu gets.. well, it can barely be called a sauce at all. I think there might be some msg on it? :P
So, I finally got around to making my own damn sauce. :) I looked at a few recipes online, merged them, and made substitutions where I had to. It didn’t turn out exactly how I wanted it (mainly because I couldn’t get pineapple chunks) but I’m recording it anyways so I can tweak it next time.

 

The instructions (or my interpretation of them) are fairly simple: throw most of the ingredients in a pot, bring it to a boil, then add a mix of 2:1 water and cornstarch (mixing it beforehand gets the lumps out more easily).

I used:

  • one cup of water
  • 1/3 cup apple cider vinegar
  • 1/4 cup mixed go chu jang and tomato paste (because I didn’t have ketchup)
  • between 1/3 and 1/2 cup brown sugar (it was too lumpy to measure well, because it wasn’t stored properly)
  • 1/2 tsp soy sauce
  • around 1tbsp finely grated ginger (I just stopped when I was tired of grating)
  • 1/2 can (~9oz) shredded pineapple (it’s just not as good as the chunks, though…)

and for the cornstarch mix:

  • 2 tbsp corn starch
  • 4 tbsp water.

 
I think I’m happy with the level of sweetness, even with all that pineapple juice.. :) once it was on my tofu it looked like proper sweet&sour sauce, too – but in the pot it looks reddish-brown thanks to the ketchup-replacement and brown sugar.

 
I guess I should have taken a picture. oops. too late! :)



I wish I’d thought to take before/after pictures of the floor I helped clean on saturday night. what a mess – and there’s always someone who has to bring a feather boa and leave feathers everywhere. :P

Actually, this time there was everything from leaves and branches to an inflatable carrot. o.0 What a party… :)

It was the Work Less Party’s Spring Carnival. There were three floors, over 600 people, and no shortage of alcohol. :) I arrived at 7:30 to organize the body art competition, knowing only that I had to ensure people got on stage in the right order. The next 2-3 hours were spent running around madly – taking down names, finding out what I *actually* needed to do, collecting music, answering questions… :) it was great fun, but very chaotic. One of the artists hadn’t been told that they needed to have their music ready on a cd, so I ran out to her friend in the lineup and saved his spot so he could grab music from his car. Nearly half the artists showed up at the last minute, just to make everything even more chaotic. :P Delays were expected. Judging had to be done (somehow I ended up being one of the judges as well as organizer). Eventually we got everyone lined up backstage – and then some musicians showed up with their instruments, and we had to get them past the models without the paint getting smeared. And so on, and on…

I was quite relieved when the last one came offstage and I could finally go get a drink. :) But then of course there was the scoring to do. And the winners to be announced. That was the one part of the night that didn’t go so well – who was doing the announcement when kept getting changed, and finally at 1am I put my foot down and made the announcement (having already lost the 2nd place winner, and barely persuading 3rd place to stick around). Oh well.. something to improve on next time. :) From what I heard, this was still the most organized body art competition they’d had by far.

I really liked organizing that – it was fun, and lots of people seemed happy I was doing it (although a few seemed to think I’d organized the whole party, lol). I do wish I’d been able to watch all the performances, though – not only was the body art fucking amazing, but the performances I saw were really good too. When some photos turn up, I’ll link to them. :)

Sadly that party had to end at 2am (stupid vancouver liquor laws) but cleanup went on until 5am – there was alcohol and feathers and garbage *everywhere*. the floor was so dark, and covered in sticky footprints, it was hard to believe it was white again by the end. And then most of the volunteers stuck around for breakfast – so it was just after 7am when I got home finally. And all that after a birthday party saturday afternoon, actually. It’s wednesday now and I’m still not fully recovered ;) but it was really fun. The same feeling of chaos and energy that I get from going to conferences, actually. :)



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 15, 2012}   parallel text – now with audio!

I’m back to language learning again – Dutch now, of course, so that I can understand my co-workers next time I visit. :) This means lots of reading and listening to dutch, not taking boring grammar courses. :) At this stage, I need the english readily available, and the best way to get that is parallel texts (dutch on the left, english on the right, nicely lined up). There aren’t many parallel texts available to buy, and they’re usually sorta boring books, so one of pete’s polyglot friends created a script that will take any two digital books (wherever you happened to get them) and turn them into a big html file, nicely aligned by sentence.

It’s a great tool – however, it’s missing a third aspect: audio. Normally I’d get my listening practice from dubbed tv (I’ve watched all 7 seasons of voyager, and most of DS9, in german) but the dutch don’t care much for dubbing, so it’s hard to get materials. :( What we do have is dutch audiobooks to match some of the parallel texts I’m reading – good quality unabridged audio, too. The problem was, you needed to play the audio in another window, making it a PITA to pause or skip around, or go on to the next file, or find your position again after shutting it all down.

So, I integrated the audio into the parallel text itself. Thanks to the html5 audio tag, I have a little control widget floating at the top of the window; you can scroll the text or pause the audio without moving the mouse anywhere. It’s in the early stages right now, so there’s no synchronization between the text and audio, and it doesn’t remember your position (although session-restore does restore the text position). I have some ideas for that, though.. :) The most annoying issue, really, is that firefox doesn’t support mp3 and half the other browsers don’t support ogg; it seems the only one supporting both is konqueror. So, I’m running it in konq :)

If you’d like to try out the script, it’s fairly simple. I have it hardcoded to expect mp3 files at the moment, but I’ll add an option for that as soon as anyone wants it. All you need is my audio.js file, jquery, and these three lines in your html head:

<script src='jquery.js'></script>
<script src='audio.js'></script>
<script>initAudio("path/to/mp3s/", N);</script>

where files are named 01.mp3, 02.mp3, etc (or 1.mp3, 2.mp3…) and N is the minimum number of digits in a file (yeah, all my files had leading zeros and I didn’t get around to removing them).

Patches and code review are very welcome – this is only the third (or second, depending on how you count) thing I’ve written with jquery. :)



et cetera
Follow

Get every new post delivered to your Inbox.