Thursday, August 2, 2012

A Simple Explanation

(this is a post in progress and I might still edit it)

I will now take a small break on programming and design, and write about an unrelated subject. You do remember I warned in the beginning of this blog that I might do so, right?

Anyway, the inspiration for the words below came from Bilal Akhtar, specifically from his rant about Indian call center jokes and my subsequent response. For the record, I don't have any illusion that such words are particularly novel or clever. They just represent a realization that I needed to get off my chest and share because I'm surprised at how long it took me to have it.

Let me start with a little anecdote.

Some months ago, I attended the wedding of a high-school friend. The reception had no reserved tables save for the bride and groom, so me and a couple of friends sat randomly and inevitably ended up facing some people we never met before. A little smalltalk ensured, but before any basic question like "what do you do" or "where are you from" arose, one of such people pointed the finger at me laughing and said "Hey! I know you! You are the guy who just bought a plane, right?"

I was a little confused at first, but then realized: it was a reference to the fact that Hong Kong actor Jackie Chan had recently bought a jet. Since the jet was made by Brazilian manufacturer Embraer, those were prominent news around here. The guy was pretending to confuse me with Jackie Chan because I'm also of Asian heritage.

Yeah, I know. Fucking hilarious. Of course some details didn't really add up, such as:
  • I have long hair while Jackie Chan has short hair;
  • I sport a goatee while Jackie Chan does not;
  • Jackie Chan is 30 years older than me;
  • My stature and build are completely different;
but that didn't matter because we both look Asian and therefore look the same, right?

Upon hearing that, my friends and I left the table without saying much and went for some fresh air outside. The other group took the hint and, by the time we returned, they had already squeezed themselves into another table to avoid awkwardness. The rest of the night went smoothly, but that shitty moment inevitably became the most prominent memory of the entire wedding.

When discussing the incident, the friend who was there with me didn't want to raise the race card. He believed the guy was just an idiot rather than a racist idiot. I disagreed, but at the same time a lot of things were going through my head. Were we being over-sensitive? Had I better ways of handling the situation? Was my mood being influenced by other bad things that were happening in my life back then? However, even if I couldn't properly define or judge what I was feeling, I could say for sure I wasn't feeling it for the first time.

And it took me until yesterday to realize that last part was very important.

When discussing about a controversial joke, both sides often get lost in defining and judging what is offensive and what is not. This is usually a long and exhausting discussion, because it is inherently subjective and boils down to saying "my line is more accurately drawn than yours" while having no idea of what "accurate" means. On one hand, not many people on the politically correct side would go to the extreme of forbidding the usage of "insane" as a slang because it's potentially offensive to the mentally ill. On the other hand, many of the politically incorrect people tend to respect, for example, the Godwin limit. Why? You can argue all you want around it, but it's pretty much impossible to run away from subjectiveness.

However, I came to realize that the vast majority of both sides probably agrees that not many, if any, jokes stay funny when told multiple times. And therein lies a simple, easily understandable source of nuisance. When faced with a stereotype joke, a person actually hears two things: a misconception that might or might not be an offense, depending on which subjective definition you want to use, and a trivial variation of a gag heard many times before. The first tends to be a source of controversy, but how many people would disagree that the second is annoying?

This might sound trivial, but for me it's a very valuable realization because it sounds like an easy way to explain why you didn't like the stereotype joke without going through a tiresome discussion about the definition of offensiveness that will get you nowhere. Don't get me wrong: I want to make the world a better place and I would prefer if people avoided such jokes to begin with, but sometimes I just want people to shut the fuck up and starting a discussion tends to be a terrible way of accomplishing that.

So there you have it. A simple explanation. It's not a complete explanation and a discussion on whether a joke is not funny even on the first time is worth having, but this is an explanation anyone can easily understand: I don't want you to stop making stereotype jokes because of an arguable, subjective notion of offensiveness. I want you to stop doing them because they were less funny the second time, not funny the third time, and annoying the hundredth. I want you to stop because nothing ends up well when done excessively. And, most of all, I want you to stop because I want to attend weddings and have fond memories of them instead of shitty ones.

Saturday, February 11, 2012

Design: rethinking the style preferences

Back in the Acessibility: Contrast, colors, and fonts post, I explained how the color/style preferences changed depending on "contrast mode" being on or off:



Following a suggestion by Matthew Paul Thomas, I now merged the two versions into a single one, using a GtkComboBox.


This new version allows both modes to share all possible options. It also reduces interface complexity by eliminating the need for checkboxes in non-contrast mode.

I'm still wondering whether I will make a list of suggested colors available. I have no idea what they would be. :)

Tuesday, January 24, 2012

Coding: Aligning Widgets with GtkCheckButton Labels

As I mentioned in the previous post, I think I found a way to accurately align widgets with GtkCheckButton labels, though I have no idea if it's the easier way.


Basically, these are the GtkCheckButton style properties that define the left distance:


So all you need to do is set the margin-left of child widgets to:

focus-line-width + focus-padding + indicator-size + 3 * indicator-spacing

If you want to adapt immediately when the GTK theme changes, then you also need to connect to the style-updated signal appropriately. Here is a custom widget that gets the job done.

from gi.repository import GObject, Gtk

class CheckGroup(Gtk.VBox):
    def _on_checkbutton_style_updated(self, widget):
        value = GObject.Value()
        value.init(GObject.TYPE_INT)

        widget.style_get_property('focus-line-width', value)
        margin = value.get_int()

        widget.style_get_property('focus-padding', value)
        margin += value.get_int()

        widget.style_get_property('indicator-size', value)
        margin += value.get_int()

        widget.style_get_property('indicator-spacing', value)
        margin += 3 * value.get_int()

        self.group.set_margin_left(margin)

    def __init__(self, checkbutton):
        checkbutton.connect('style-updated', self._on_checkbutton_style_updated)

        self.group = Gtk.VBox(homogeneous=False, spacing=6)
        self.group.show()

        super(CheckGroup, self).__init__(homogeneous=False, spacing=6)
        self.pack_start(checkbutton, False, False, 0)
        self.pack_start(self.group, False, False, 0)
        self.show()

Monday, January 23, 2012

Design: To Label or Not To Label?

So, after Lars pointed me to the right direction, I think I managed to perfectly align widgets with checkbox labels. The next blog post will give the full details, but before that I have a small design question... Is it just me or the group labels are now visually redundant?

Compare


with


What do you think? Should I eliminate the labels or keep them for consistency with other windows?

By the way, I am aware that the entire authentication group should technically be inside the general group, but I couldn't figure out how to do this without making the layout look very unbalanced. Specially now that I'm aligning the widgets with the checkbox labels. Suggestions are welcome.

Friday, January 20, 2012

Design: Dialogs and error messages (2)

Following feedback from our favorite crazily-smiling designer and that great orange psychopath artist (I'm assuming the avatar is a self-portrait), here's the current state of the proxy dialog.



The italics were a personal touch.

Thursday, January 19, 2012

Design: Dialogs and error messages

Following up a comment by Matthew Paul Thomas on the Design: Dialogs, long operations, and error messages post, I'm experimenting with ways to show the error message in dialogs directly, without the need of hover or keyboard focus.

The hard part is inserting an error message inside the dialog layout in a way that's not aesthetically horrible. In particular, catering to the alignment issues of both short and long messages is complicated.

For now, I'm thinking about placing the message on the top.



This looks intrusive, as it moves the entire content downwards, but keep in mind that the dialog becomes insensitive during a long operation that can fail. So the user will not be trying to click anything in the moment the error appears.

What do you think? Suggestions?

Sunday, January 8, 2012

Heads Up: Drag 'n' Drop bug with PyGObject 3.0.0 (Ubuntu 11.10)

The GTK handling of drag 'n' drop looks a little bit convoluted at first, but can be quite handy once you get the hang of it. Unfortunately, there is a bug in PyGObject versions below 3.0.3 that makes things a little bit harder than they should.

Long story short, when using PyGObject in Ubuntu 11.10 Oneiric Ocelot, you can't pass detailed parameters to widget.drag_dest_set and expect GTK to take care of everything. You need to handle the drag-motion, drag-leave, and drag-drop signals yourself.