ChaniBlog











Imagine, if you will, a world where it is considered barbaric to bump into anyone in public. And you’re blind. Oh, and everyone is required to wear sunglasses all the time, so people can’t tell whether anyone is blind, and some people don’t believe blindness exists at all.

It is possible for you to learn alternate methods of sensing your surroundings, but it’s hard. No matter how hard you try, occasionally you’re going to bump into people anyways – maybe you were tired and distracted, maybe someone moved too quickly for you to sense, maybe some jerk tripped you on purpose.

Now, some people respond to this by loudly proclaiming “blind person coming through, watch out, watch out, not my fault if you get in the way,” and then blithely walk where they wish, bumping into lots of people and stepping on their toes. That’s not very nice, and anyways, many people suspect that they’re not blind at all, just jerks who wanted an excuse to hurt people.

Other people are so terrified of bumping into anyone that they curl up into a ball muttering “I’m sorry, I’m sorry, please don’t bump into me.” That’s no way to live, but they can’t think of any alternative besides option 1 above.

Eventually, groups of blind people find each other, and set up spaces where there are clear non-visual clues about where to walk, and nobody really minds if you bump into them now and then so long as you don’t seriously injure them. Some people are more careful than others, and there’s debate about how much care ought to be expected and whether it’s okay to punish someone who’s utterly careless, but mostly people get along and the ones that were curled up in corners start to come out of their shells (bumping into a lot of people in the process, but they’ll get better at that in time).

At the same time, however, there’s another group of people… well, sort of, because they have funny voices, and they haven’t quite been considered people in the past, and for a long time it was fine to walk into them, or even beat them up, and nobody cared. But they’ve been fighting that long and hard, and they’ve finally got the anti-bumping laws to apply to them too, even if a large minority still ignores those laws and acts like they’re crazy for being upset when someone bumps into them, or denies it ever happened. They’ve built their own funny-voice-only spaces, but regular people keep trying to break into them, so they have to work hard to defend them while also working hard to defend themselves whenever they’re not there.

Some of the funny-voice people are blind too, and fuck is that ever confusing. Should I expect other people to stop bumping into me now, even though I bump into them still because I’m blind? What if the person is blind? Should they have been more careful, or was this just one of those unavoidable times? And oh god, what if I bump into a funny-voice person, they’ll be so mad at me for not treating them like a person but really I just didn’t notice them, but maybe I should have been more careful, maybe I should just stay far far away from them so that I never accidentally bump into them… Maybe I should retreat to the safer blind-friendly spaces (even though less people will consider me a person there).

But now it turns out those blind-friendly spaces are sitting on top of a gold mine, and regular people keep coming in to mine for gold. And the funny-voice people don’t want to be left out of the gold-mining like they always were when they weren’t considered people, so more of them are coming in too. But the regular people don’t want to share their gold, so they keep bumping into them trying to hurt them, and the blind people are bumping into them too – either because they’re blind, or because they want to hog the gold too, or both – and some blind people are regressing to their pre-friendly-space behaviour, and the funny-voice people are getting injured and really pissed off about everyone bumping into them all the time and some sound ready to just fucking punch everyone…

And here I am, blind with a funny voice, wishing everyone could get along somehow, and wondering if I can ever get any gold myself without bumping into all these goddamned people (or getting injured myself). Some days, curling up into a ball seems like a much easier option all around, but I worry that if I do that, people will say “see, funny-voicers aren’t really people” or “see, blind people can stop bumping into anyone”…

So yeah, I have aspergers, and I’m going to say some stupid shit sometimes and cross boundaries unintentionally. And yeah, I’m female, and I deserve to have my boundaries respected. I’m doing the best I can to minimize the former, and be assertive about the latter without traumatizing other aspies. And once in a while I’ll be a jerk when I know better and could stop myself, but I’m doing my best to minimize that too.

But I still wish everyone could just get along…



{January 25, 2015}   grub 2 and multiple hard drives

I recently set my home computer up to dual-boot, and it took far longer than it should have, so I thought I’d blog about one of the issues.

I’ve got two hard drives; windows is undisturbed on hda, and linux I installed on hdb. After jumping through some bizarre hoops to get the bios booting off hdb (wtf asus bios, why do you hate multiple hard drives), I discovered grub couldn’t boot windows. I could boot windows from hda just fine, so I knew the problem was with grub…

First problem: 90% of the information out there is still for grub 1, not grub 2. they’re almost completely different beasts, with different config locations (/boot/grub/menu.1st vs /etc/grub.d/), different config languages, and even different bloody partition numbering systems! Oh, and of the 10% that is for grub 2, 90% of that is for ubuntu, which has a few convenience scripts other distros lack.

I’ll condense what I learnt about that here:

  1. Most of the stuff in /etc/grub.d/ is fancy autodetection scripts that you don’t want to touch.
  2. What you do want to touch is /etc/grub.d/40_custom. leave the tail line intact, and treat the part below as your old menu.1st, but with the new config language (api reference and examples).
  3. Ubuntu’s update-grub is just grub2-mkconfig -o /boot/grub2/grub.cfg

Once I had my head wrapped around grub 2 enough to get a test menuentry up, the next question was, what is actually wrong with the autodetected windows entry? The error windows threw had no shortage of google results, but a lot were from mangled windows bootloaders, or 32 vs 64-bit issues. Most of the rest talked about mbr vs gpt, or legacy bios vs uefi, or secure boot; I was almost convinced one of these was the issue, despite them all being in the context of windows 8 (I’ve got windows 7), but I kept testing other things while I thought about it, and happily stumbled on the solution:

It turns out that while installing opensuse, I had let grub swap the order of the hard drives, and it was passing on this swap to windows, confusing the heck out of it. I converted some grub 1 advice to grub 2 syntax (hint: map is now drivemap) and windows happily booted up from grub. :)

I’m worried by what I learnt about UEFI and Secure Boot, though. Between bricking bugs and vendor lock-in, it sounds like things could get ugly next time I want a new computer. :(



{October 5, 2014}   Pocket hacking

I saw an article about pockets today (or rather the lack thereof on womens’ clothing), and it prompted me to finally start the blog about pockets and pocket-like things that I’ve been putting off way too long. So long, in fact, that I’m not really sure where to start. This is going to be a long one – but don’t worry, there are plenty of images. :)

One of my hobbies the last couple of years has been working on pocket alternatives (utility belts, purse mods, etc). But I feel like the story starts much further back…

Pockets to Purses to Utility Belts

In grade school, I had pockets. And I loved pockets. I always carried at least a pencil and notepad, probably as far back as grade 2 (I remember writing poems in it at recess). By highschool, I was into cargo pants, and filled my pockets with all kinds of useful things.

In university, my style changed, and I didn’t want to wear cargo pants any more. But that meant less pockets – and the problem has been getting steadily worse ever since. These days, even jeans have undersized or fake pockets. Skirts and dresses almost never have any at all.

At first, I tried offloading some of the pocket stuff to my backpack. That had problems, though – especially for my wallet and phone. The backpack was harder for me to reach, and easier for thieves. One good development came from that, though – I started thinking about backpack organization (but I’ll leave that for another post).

I resisted buying a purse for a long time – I’m not quite sure why. Probably because I still felt uncomfortable with anything so stereotypically feminine. They looked incredibly impractical, too. But one day I saw one that was perfect for me – small enough to not hurt my shoulder, adjustable so I could stop it from swinging around while cycling, and comfortably androgynous without being ugly. It even had a detachable strap, so I could easily untangle it from jackets and backpacks.

That purse lasted several years, and was repaired quite a bit, until the zipper was truly unsalvageable. :) my essentials were in there, easily reached and secure, and everything else went in my backpack.

[side note: it turns out that purse is still available on the interwebs – but they only ship to the states. FFFFFUUUUUUUUUU]

Since then, I’ve never found a purse quite as good. Purses have some inherent disadvantages that annoy me, anyways. I have to remember to take my purse off before adding or removing a sweater or jacket. It swings around wildly at inconvenient times. It’s never as waterproof as it ought to be in such a rainy city (see also: hats). It can only hold a tiny weight without being a strain on my shoulder. And there’s always that little fear that I’ll accidentally leave it somewhere.

So, a few years ago, I started looking into utility belts. I’ve seen some really pretty ones in stores, but it’s infuriatingly hard to find one that even fits me, let alone suits my needs. They seem mostly built for much larger girls.

I do own a couple, though. The first one was a slim leather-and-brass thing I found in a discount bin at a stall at a festival. At the time, my phone just barely fit in one of the main pouches. It was useful for a while, but just couldn’t quite hold enough; I’m not sure my current phone would fit at all. The second utility belt was bigger, but a little too big; it was just a little awkward reaching the bottom of the pockets, and there wasn’t a good safe place for a phone to not get scratched. It was also kind of ugly.

With those, I discovered that utility belts had their own set of disadvantages, too. Pouches that were small and snug still had an amazing ability to interfere with seating, despite my small frame, and get caught on chair arms and such. Pouches that were bigger tended to flap around awkwardly, and interfered even more. If my pants actually had pockets, they were harder to reach (but at this point that hardly matters). Utility belts never have any waterproofing, so they have to hide under my jacket, making awkward lumps. Even if they did have waterproofing, taking the belt off to put my jacket on would probably be even more annoying than doing the same with a purse.

Still, I wanted to try my hand at solving these problems – or at least making a utility belt with appropriately sized pockets. Somewhere in my planning, I had the idea to start small and modular, with pouches that could attach to any belt (or combine to form giga-purse), so that I could experiment more easily. The first one: a simple phone holder.

Modular pockets: Iteration 1

I was very unsure about that phone holder, so I decided to make a rough prototype out of foam. On the one hand, I was right: even before finishing it I had plenty of ideas for improvements. On the other hand, it was a bit too fragile, and broke often enough to interfere with testing. Still, I patched it up and used it for a while, and learned a lot.

At about the same time, I was looking for a way to put my wallet on my belt. I had a nicely sized wallet that even looked nice; the challenge was making it attach so that I could easily detach it to fish out coins or keys, without making it easy to steal. I ended up using magnetic purse-clasps to attach it easily, with a chain to prevent theft and forgetfulness.

Between the phone case and the wallet, I discovered some pretty tricky issues. If the belt they were on wasn’t in belt loops, they would slide along the belt, and the belt itself would slide too. If they were on belt loops, getting them on and off meant taking the whole belt out and then rethreading it. And reaching them under my jacket was very inconvenient, especially with my long jacket. The wallet got knocked off fairly easily, and while the chain kept it safe, it was still annoying.

In the end, I went back to purses while I planned the next iteration, and found myself too busy for sewing soon after. I did make a purse organizer at one point (the wallet didn’t fit in any purse), but the fabric was weaker than expected and soon gave out, and the pouches were just deep enough to be awkward anyways.

It wasn’t until this summer, when I saw a woman wearing an awesome leg-holster-thingy, that I was inspired to try again.

Iteration 2

First off was a new phone holder, this time out of fabric, and including a pouch for things like lip balm and earplugs (yep, still got the fucking noise sensitivity). I stuck velcro on the back of it, then threw together a quick armband with elastic, velcro and a safety pin to test. It worked surprisingly well and became a handy little thing to use around the house, or at parties safe enough to leave my wallet unattended. The velcro keeps it from shifting too much when I’m pulling the phone out, and also is easy to detach (a bit too easy, though; I can’t wear it outside until I have some clip to hold it securely).

Oh, and I also added a Velcro patch to my Halloween purse, since it didn’t have a
separate space for my phone:

Molle Experiments

After discussing the pocket problem with some friends, one of them introduced me to the molle system. tl;dr: it’s how the military attaches modular pouches to vests, backpacks, etc. This seemed great – one of the problems I was trying to solve had already been researched; they just hadn’t made it look pretty.

Of course, it turned out to be not quite so simple. I tried making a simple molle strap with a velcro patch, so that I could attach the phone case to a belt. The first attempt undid itself at the slightest pull. :P It turns out that the way molle straps usually loop around a bit wasn’t just redundancy; you need at least one fold to keep it from popping open. Luckily I was able to get that minimal one fold by just moving half of the snap, and then I had a usable fastener.

image

That wasn’t the only problem, though. I was back to the old issue of loops over belts: they slide around the belt, and the pressure tends to make the belt bunch up. I’m hoping to solve that on the next iteration, by making a belt that’s two layers thick, sewn together to make small molle loops. I’ve also got a crazy idea involving those kitchen bag clips… probably won’t work. :)

Anyways, at the moment I’m working on a pouch to hold laundry things. It’ll be good practice and a test of the molle thing. Once that’s done, I’ll make a belt to hold it and my phone case with less slipping. If that works out, the next project could be something for outside the house. :)

Winter is Coming

It turns out there are seasonal issues with these things too, though. The phone-on-armband doesn’t work so well when the temperature is in that awkward range where my sweater is on and off every few minutes. It’s harder to get it on over a sweater, too. The utility belt is more useful in summer, when I can avoid the jacket issues I already mentioned. I kinda wonder if I should add molle loops to the jackets themselves, to make up for their sad little tiny pockets… But then I have to worry about weight distribution and whether it’ll make the jacket swing around…

Anyways, that’s a peek into what I’ve been working on when I’m not programming! :) I’ll try and remember to post again when I’ve done more experiments. Maybe next time I’ll try to summarize the problems and solutions I’ve found, too, since this post was more of a narrative. I still feel like I have more questions than answers right now.



{September 28, 2014}   Tech culture

I’m seeing a lot of comments on twitter lately about tech culture. People saying that it’s bro culture not nerd culture; comics implying nerds have become the bullies they used to suffer; a myriad of complaints about silicon valley assholes. I’ve had conflicting feelings about these comments, and I think I’ve just figured out why.

My first impression was to feel offended, and think not-all-nerds thoughts. I think of myself as a nerd/geek/whatever, and I can never quite remember the common definitions of the words or what the difference is supposed to be.
My second impression was to think of the geeky circles I hang out in, and how those people generally don’t fit these comments either. There are a few jerks in most groups, and how well they’re dealt with varies, but the general atmosphere is welcoming and inclusive.

What I had forgotten was that these were all groups I had chosen to be part of. There’s a selection bias there – if they hadn’t been welcoming groups, I wouldn’t have bothered to stick around. When I think about tech circles I didn’t get to choose, I see a very different picture. :(

At all the schools I attended, there was shitty tech culture. I couldn’t just quit school, so I turned to foss and the KDE community to escape it. At bcit, the classes were organized such that I was stuck with the same group of people full-time for a year. They turned out to be the sort of people that would put goatse wallpaper on the Linux users’ computers, then tell us it was our fault for not password-protecting the bootloader. Ugh. I’m just glad I wasn’t the only Linux user… But there was plenty of sexism too, and general macho bullshit.

At SFU, there were more Linux users, but that didn’t help much: instead I got picked on for using KDE instead of gnome/ratpoison/etc. Somehow I was always at the bottom of the totem pole. After a while I discovered there were lots of social circles there, and made friends with people who wouldn’t ridicule my choice of technology, but I couldn’t hang out in the CS common room without some of the jerks being there, and it actually seemed to get worse over the years. My last year before graduating, I don’t think I visited the common room more than twice.

Anyways, it occurred to me: maybe the people talking about tech culture are still stuck in shitty circles like that. Maybe silicon valley is dominated by that bullshit (I wouldn’t know, I’ve only visited briefly). Maybe the tech culture I know isn’t the tech culture they know.

Really, it shouldn’t be a surprise that there’s more than one culture in tech. How many projects, meta-projects, languages, corporations, foundations etc. are there? How many thousands and thousands of developers are there? Of course we don’t have the same experiences. Different programming communities are almost like different countries.

The sad thing is, though, I’m beginning to suspect that the nice-tech-culture I’ve surrounded myself with is a lot less common than the shitty tech-bro-culture I’m hearing about. It’d be neat to see some statistical information about culture over different meta-projects and geographical areas, though. Not that I have any idea how one would gather such information.



{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. :)



{August 29, 2014}   On boundaries

So… Julie Pagano blogged about boundaries and consent. You should read it.

…go on, I’ll still be here when you get back. :)

Anyways, it’s a good post, but I felt like the first point (Entitlement) could be elaborated on. It’s something I misunderstood at a fundamental level for a long time. I honestly thought the rule was “you can have boundaries, if you have a good reason for them.” Somehow I grew up thinking it was ok for other people to demand a reason for my “no” (in any situation other than sex) and judge whether it was a valid reason. And, of course, that I could expect justification from other people.

I like making people happy. I hate upsetting people. So I was totally happy to give people what they wanted… after I understood why they wanted it. After all, being confused really sucks. I hate feeling confused, I hate uncertainty. I hate wondering whether I did something wrong or if the other person was just having a bad day or whatever. And being an aspie, I’m confused a lot. :)

I think I did have a bit of a sense that I wasn’t handling things quite right. But having no idea what the Right Way was, I didn’t know what else to do. Lots of people have conflicting opinions on social norms, and some of them have their own agenda colouring their advice too, so I don’t know who to trust. So, I just keep listening, until someday something clicks and another bit of social behaviour makes sense, and feels right. (It helps that I’m following some prominent feminists on twitter lately. They’ve had to think about and experience this shit a lot, so their opinions tend to be quite sensible.)

I’m not even sure when I figured this one out. It was probably a gradual thing. But I do remember how good it felt to realize that I didn’t have to justify my boundaries. That I was allowed to just say no, or ask someone to stop doing something, or block someone, and I didn’t have to figure out a bullet-proof justification first. That was a huge weight off my shoulders, and suddenly I felt more confident and.. I dunno… adult.

It still feels bad when someone has boundaries where I’d prefer they didn’t, but, instead of trying to understand what’s going on on their side, I have a sort of deeper understanding: I understand that they’re allowed to do that, and that it’s important to their sanity and freedom as an adult to have that right. And that’s more important than my discomfort, even if the discomfort does suck. Accepting the discomfort makes it much less likely to turn into a panic attack, too ;)

I’m kinda scared to hit the publish button now. This is such a murky confusing subject, and I might still have said something incredibly stupid. I might still be wrong about a lot of this stuff. Or someone might try to tell me I’m wrong when I’m right. Either way they might be mean about it. The internet is a scary place. But, I hope this post has given some people food for thought. This stuff is worth thinking about, over and over again, until we do get it right.



{May 29, 2014}   Spoons.

I was going to title this “burnout sucks” or something, but then a friend sent me to spoon theory. Go on, read it, I’ll still be here. :)

See, I’ve had a migraine/tension headache since february. It’s the end of may, now. Yes, that’s not normal. Yes, I’ve seen doctors, lots of them. Yes, they’ve tried whatever you’re about to suggest. (Except hypnotherapy and trigger point therapy, those are next week).

At first, I thought it was just another persistent headache. it was mid-march, iirc, when I finally stopped trying to work despite the pain. Stress was definitely a trigger – we had an awesome android contract, with more android to come, and I was the “lead” android developer (the other developers being more interested in iOS). I wanted to impress everyone and was pushing myself too far. Some internal matters were stressing me out too, but that’s none of your business. :)

The first 6 weeks or so were pretty awful. Pain, lots of pain. Not severe pain, just enough to distract me, to discourage me from thinking or doing anything, to make me thoroughly miserable. And I desperately wanted to do.. well, things in general. The idea of lying in bed and being unproductive was extremely discomforting. Does that make me a workaholic? It’s not like I was capable of much work, but it was very hard to accept that I needed to rest. every time I thought I was taking it easy, another layer unraveled and I learned that I was still being too hard on myself.

Then my neck went fucking crazy and I was stuck in bed for two days (except for some excruciatingly painful walks to the bathroom). You have no idea how much neck muscle is involved in just holding your head up on your shoulders. That neck pain’s been an issue ever since, although not bad enough to prevent me from standing up at all (thank god).

Since then… well, the pain (head and neck) died down, slowly. It flares up again, if I push too hard (like, two shopping trips in one day, or more than an hour talking to someone) or if it just fucking feels like it (aaaaargh!!). But the headache came with a side effect. Noise sensitivity. On a good day, I have to hide in the bedroom when Pete does the dishes. On a bad day, I can’t stand to have him in the house at all. :(

So that’s two (three?) problems that modern science doesn’t understand and can’t solve. There’s more, too, but nevermind that. Problem #4 is that I am burnt the fuck out. I’m not sure if I didn’t notice it or just refused to believe it… but I’ve had a lot of time to think lately, and eventually I had to acknowledge that I was more enthusiastic about cleaning the bathroom than writing code, even for my own personal app that would be really awesome to have working. :( All this lying about, attempting to rest, has helped a bit, though; I can at least see that I’m burnt out, now, and after resting enough I have the occasional burst of true enthusiasm (which I can’t actually act on, or I’d trigger the headaches again…)

The days have gone by fairly fast, and given the situation, I’m doing fairly well. I still have days where I’m so frustrated I just want to curl up and cry. I have days where I wish the migraine was a physical thing so I could beat the fucking shit out of it. I have days where I’m terrified I might never be well enough to work again. I miss parties so much, so very very much. But I also have days where I feel content to just enjoy the sunshine, or read, or days when I’m well enough to play video games. I seem to have switched back to the introverted personality I had as a kid, which makes it much easier to spend all day lost in a book. I’ve started to draw again, and on my worst days (when even reading hurts), I’ve rediscovered the joy of daydreaming.

To be honest, it’s very confusing and surreal. Here I am, supposedly grown up, and illness has forced me back into the habits of childhood. It took a long time to stop feeling guilty whenever I felt a flash of enjoyment. I still have days where I somehow forget that I’m not well, and feel confused and hurt when I’m not able to handle a full day of chores or errands. Some days I wish I could just be normal; others I’m actually scared of getting better, scared that I won’t be able to cope with “normal” life even when the physical pain is gone (I’m still burnt out, after all, and that’s not the only issue to deal with). Most days, though, I manage to forget about “normal” life, avoid thinking about fun things I can’t do, and enjoy the little things that I can do. :)

Hopefully one day I’ll be better, and I can hack again and make awesome things. Until then, well, I’ll just do what I can, and try to remember to take care of myself.

edit: I forgot to mention, I’m really grateful for the medical system and EI here in Canada. It’s not perfect, but EI is paying my (non-medical) bills for now, and none of the doctors have been skeptical of my mostly-invisible pain. It means a lot to know that the country I pay taxes to is willing to take care of me in return. :) And Steamclock has been very understanding, and is still taking care of my health insurance, too. :)

P.S. If you’re looking for canadian health insurance, don’t pick Sun Life, they’re very restrictive about what they cover. :P



I’ve been doing a lot of Android dev lately. Which of course means even more swearing than usual (yep, that is possible). It’s actually been fun, in a bizarre why-am-I-enjoying-this-torture kind of way, but there’s been a steady stream of WTFs along the way, and a surprising number of them involve EditText.

god damn fucking edittext. It’s just a little widget to get some text from the user. how hard could that be, right? :P

I had problems right off the bat with my personal app I started over the holidays. That one was simple – I used the standard fragments+viewpager template, threw an edittext on my layout, and tried to get me some text. Nope. By default, EditText is multiline, so you have an enter key that inserts a newline instead of a submit button. I was okay with multiline in the sense that it should grow and wrap text if I type a lot, but I didn’t want actual newlines, I wanted a ‘done’ button. I could have added a separate button to my UI, but that’s no fun :P so I fought with getting that button to show on the keyboard. Turns out, you need not only android:imeOptions="actionDone" (or submit or next or whatever), but also a sensible value for android:inputType (which took ages of trial and error to figure out – autocorrect vs autocomplete was not clearly explained at all) which in my case was android:inputType="text|textCapSentences|textAutoCorrect" (I c&p that as the default for all my edittexts now).

Then there are the weird issues with focus when you leave fragments or click another edittext. mostly they just cause warnings, but on kitkat some of those warnings turn into crashes.

Oh, and another weird thing – clicking ‘done’ or ‘submit’ or whatever does not automagically dismiss the keyboard. nor does leaving the fragment (and the keyboard does not like it when it’s still open and its edittext has vanished). The code to manually hide it is so ugly that I was sure it must be a dangerous hack, and was reluctant to use it, but it appears to be the only way.

    static public void hideKeyboard(View focusView) {
        InputMethodManager imm = (InputMethodManager) focusView.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
        imm.hideSoftInputFromWindow(focusView.getWindowToken(), 0);
    }
    @Override
    public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
        //Log.e(TAG, String.format("onEditorAction %d", actionId));
        if (actionId == EditorInfo.IME_ACTION_DONE) {
            setAndSaveText(v.getText().toString());
            Helpers.hideKeyboard(v);
            return true;
        }
        return false;
    }
//I have to manually call this whenever I do a fragment transaction.
    private void onFragmentChange() {
        View focus = getCurrentFocus();
        if (focus != null) {
            //Log.e(TAG, "focus: " + focus.toString());
            //keyboard should go away when leaving a fragment. how is this not standard?!
            Helpers.hideKeyboard(focus);

            //fix focusout bug on api 15
            //notes: dispatchWindowFocusChanged does nothing.
            //clearFocus works on api 15, but also calls onfocusin,
            // and gives worrying error messages on kitkat (nexus 5).
            if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) {
                focus.clearFocus();
            }
        }
    }

Okay, that’s it for the problems encountered with a simple, common view. But then I started a more interesting project, where I needed to dynamically set up layouts at runtime. Yep, some of those layouts had edittexts in them, and that gets interesting. In a throw-your-computer-out-the-window kind of way. :P

The natural approach to a dynamic UI would be a ListView, right? It would just make sense, right? Wrong :P ListView and EditText do not get along. Period. Nothing’s stopping you from trying to put an EditText in a ListView, but if you do, spooky shit will start happening. Your keyboard will go crazy. Text will fail to appear, or focus will jump to the wrong place, or the cursor will show up in the wrong part of the screen… and on kitkat, it’ll just outright crash sometimes. After much googling and some rather depressing stackoverflow comments, I decided it was easier to just use a LinearLayout in a ScrollView. (luckily I won’t have enough rows for performance to matter.)

Everything seemed rosy again for a while, but here and there I was having issues with the text blanking out, or getting the text of a different EditText. Then I added a subscreen, and on returning to the screen with edittexts, poof, loads of text was disappearing. Oh, and radiobuttons were resetting too. Eventually I tracked it down to a really insidious side-effect of android’s helpful automatic view save/restore code. It was assuming that every view in the fragment has a completely unique ID, and since I’d instantiated multiple rows off the same layout, this was not the case.

I knew ListView had to have been preventing this somehow, so I dug in (thank god most of android is still open-source) and found what it had done: blocking dispatchSaveInstanceState and dispatchRestoreInstanceState. I made my own subclass of LinearLayout that did the same blocking, and all my widgets were happy again. :)

public class FormContainer extends LinearLayout {
    public FormContainer(Context context) {
        super(context);
    }
    public FormContainer(Context context, AttributeSet attrs) {
        super(context, attrs);
    }
    public FormContainer(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
    }

    //prevent save/restore of our children
    @Override
    protected void dispatchSaveInstanceState(SparseArray<Parcelable> container) {
        super.dispatchFreezeSelfOnly(container);
    }
    @Override
    protected void dispatchRestoreInstanceState(SparseArray<Parcelable> container) {
        super.dispatchThawSelfOnly(container);
    }
}

Well, there are still some warnings when I jump directly from one edittext to another. But I think this is as good as it gets :P



{January 9, 2014}   Why am I not blogging?

Goddamnit, I haven’t blogged in forever. I at least started a post on robotsconf, but never finished it. I’m damn well going to blog about *something* today, so, let’s talk about possible explanations for my not blogging.

This is going to be a rambling stream-of-consciousness post with no editing except to combat autocorrect. Because one of the things that makes it hard to blog is worrying about whether I could have phrased it better. The internet can be pretty mean, and if one little sentence is badly phrased then someone’s going to jump on it. :/

Which brings me to another issue: my blog is adrift on the internet at large, instead of being part of a community. When it was a part of planetkde, and I was contributing steadily, I always knew what I wanted to talk about and who was going to read it. Even when I didn’t have some cool feature to blog about, I knew my audience. I had a feel for how many off topic posts I should write to let people know about my hobbies without boring them too much.

Now, my hobbies are in chaos – I can’t seem to settle on one thing for more than a couple of sessions – my work isn’t something I can blog about much (and NIR would most people care) and I have no fucking clue who’s reading this.

I know that I’ve picked up some followers of my food posts (sorry, no time for that lately, Pete’s doing most of the cooking), I know some tiny subset of kde people still follow my blog, and I know some people read it via twitter now that I’m auto-tweeting my posts and actually using twitter. (Actually that last one scares me a bit, you never know who’s going to end up seeing it there…)

Twitter might be part of the problem too… The free time I do have is easily sucked up by reddit and twitter. And I don’t feel like twitter is a choice, because I’d miss out on stuff in various tech circles if I didn’t check it at least every couple of days. It keeps me feeling connected in these not-quite-communities around js, Vancouver tech, etc.

But, yeah, time is an issue. I started this post on the bus, and now I’m writing during lunch while the rest of the company chats. After work and dinner, I generally don’t want to do anything hard, and blogging is hard. It takes a good 2-4 hour block for me to do a good post, iirc, and if I’m interrupted I tend to lose interest. I have that time on the weekend but I have a million other hobbies and chores and social events competing for my attention then (and if it’s work-related I can take some work time but there aren’t many of those). Plus it’s hard to convince myself the post is worth writing if I don’t know who’s reading it.

Another thing that bugs me is this WordPress app.  For the most part it’s a good app, but it has a fatal flaw: it is way too easy to publish by accident. That makes me reluctant to use it the more complex my topic is. And with the small screen it’s hard to review a post – I don’t seem to have a preview at all here – so I always want to finish editing on a desktop and publish from there.

Oh well. This time I’m just going to hit send and damn the consequences :p



I’ve noticed a pattern at conferences and meetups lately. Some guy comes up to me, and the first words out of his mouth are something like “it’s so nice to see girls in programming” or “so how can we get more women in tech?” or something. It seems quite well-intentioned – I imagine he thinks it’s an easy way to break the ice, or wants to communicate that he’s not sexist, or at worst is trying to score brownie points – but it’s making me uncomfortable. It took me a while to figure out what I was feeling – the last couple of times I just sorta awkwardly ran away – so now that I’ve figured it out, I’m blogging it.

I do not like being reminded of my gender at tech events. Especially with the recent drama I’ve been seeing on twitter. I’d much rather forget that I’m different, and talk to you about how awesome node is, or bitch about android and ios, or hear about some cool project you’re working on. Please, just use the same damn ice-breakers you’d use if I was a guy.

Besides, I do not get magical feminist superpowers from my ovaries: I’m just as lost as most guys when it comes to all the women-in-tech issues (except t-shirts. I can go on about that one for ages). That’s part of the reason I don’t want to be asked about it, I suppose; thinking about it makes me feel lost and helpless and confused. And remembering that I’m a girl makes me feel a bit more self-conscious and awkward.

I might wander into conversations about it from time to time – more likely after several drinks – but please, don’t make it the first thing you say to me.



et cetera
Follow

Get every new post delivered to your Inbox.

Join 380 other followers