Tuesday, May 17, 2011

Best. Comic. Ever.

Easter Special

bloodbine

These crazy swiss are trying to create an intrarticular turbine, to generate electricity from the heart -- and then feed back into the heart, to make it beat (via a pace maker).

It's almost like the perpetual motion folk never learn.

Saturday, May 7, 2011

CAPTCHA of death

Is it just me, or is a 25-letter CAPTCHA image ... excessive?

Monday, May 2, 2011

GNOME Shell review

I have been using GNOME shell for the last couple of weeks with a pre-release of Fedora 15. It's strikingly elegant and most of the time a pleasure to use.

For the purpose of constructive critism, I will outlie my biggest gripes.

Network Manager

The only positive thing I can say about it, is the menu looks nice. If you have to actually use it, for (you know, for switching connections) -- it's a not only a massive step down from the old applet, but actively retarded. For instance the "Options..." button that allows you to edit a connection only works when the connection is active. So if the details are wrong, and you have no connection. You can't change it?! Wtf. The first time I entered in some details wrong, and then couldn't fix it because it couldn't connect?!

The saving grace is you that you can access the old configuration via launching "nm-connection-editor". In my personal case, I have PPPoE at home and plain old DHCP/ethernet at work. So everytime I go home or to work I find my self having to go and delete the old connection and create a new one with "Connect Automatically". Uggggh. Annoying. But I can live with it -- as long as it's just because of lack of time / resources, as opposed to actually thinking this is good.


Lack of shutdown

There's no shutdown option in the menu. Seriously? Yes, I'm aware everyone bitches about it. Yes, I know there's an extension to fix it. Holding down alt does add it. It's just the whole philosophy of this decision annoys me. Especially because my computer doesn't actually come out of suspense (it does with the opensource nvidia drivers, but not with the proprietary one -- so I won't complain too much).

No window list

God knows I've tried very hard to adapt to the the new gnome shell, but I really, really like my window list (ala gnome panel) and find myself way more productive with it. I fully understand that this isn't the default. But having a window-list as an option would be really really great. Maybe for GNOME 3.2? :)

BTW I found a really neat trick. Run "gnome-panel --replace" from within GNOME shell and it's actually really awesome and works fantastic, and makes GNOME shell rock. The only problem I have, is I want to the panel on both monitors, with a window list each. Anyone know how I can get this? :)

Edit: It turns out you can "Alt+Right Click" on the fallback gnome-panel to get the old options. And "Alt+Drag" to move. Ridiculously undiscoverable. The old right click and "lock" vs "unlock" was way better.

Anyway, mandatory screenshot of the awesomeness:


Activity Bar (correct name?)

This is my biggest idealogical and implementation complaint, and something I haven't been able to resolve. Not only does it make the bottom right of my monitor unusable (and hard to click application buttons in the bottom right, when it pops up) it defeats the entire purpose of having application status! I hate it so much. Here's an idea: put the application status-icons with the other applicatiosn in the top (with the "system" status icons) and have something to hide icons like KDE or Windows. The current setup is just really just bad. Also, when it's empty -- why does it have to popup anyway. Ugggh. I hate you activity bar!!

Run

I find going to the "overview" mode a bit too jarring when I want to start a new application. So I tend to use the "Alt+F2" run menu and launch an application. It'd be really nice if this more like GNOME Do (or just reusing some of the stuff from the overview mode).

Snap-left / Snap-rights


The drag-a-window-to-edge to get it to snap to half the monitor is really nice! The one thing I'd like though, if there was a keyboard hotkey for this. :)

GNOME panel

The single biggest mistake of the GNOME 3 release IMHO has been hiding gnome panel. It's actually still really great, and a perfect solution for everyone not totally bought on gnome-shell. The one thing in need of fixing is the whole "Alt+Right Click" for menu. That's just *really* stupid, and people can be happy with their old gnome-panel design with a new and improved UI.

Also properly supported gnome-panel integration with gnome-shell has serious potential :)

Overall

Overall it's a bit rough, but fantastic work. My greatest respect and admiration for all your hard work. Kepp it up. I'm thoroughly looking forward to GNOME 3.2.




Sunday, May 1, 2011

Pet hate #843 : C++'s assignment construction

A well known c++ feature is using the assignment operator for construction. Let's work with this minimal class:

struct Integer {
    Integer(int v) : value(v) {
        std::cout << "in constructor" << std::endl;
    }

    void operator=(int v) {
        value = v;
        std::cout << "in assignment operator" << std::endl;
    }

    int value;
};

You are able to construct it using the assignment operator
Integer i = 44;

which calls the constructor, as desired. However, here I present the case for not using this "feature" and instead preferring the explicit constructor call:
Integer i(44);

Consistency

Constructor syntax must be used when there's two or more arguements e.g.
Complex c(23, 43);


The assignment construction is a feature that can only be used when there's exactly one arguement. With there already being a special case for default constructors (constructors with no arguments) let's not make it more confusing. For brevity the default constructor special case:
Singleton s;
cannot be substituted for
Singleton s();
as the latter is interpretted as forward declaring a function 's' that returns a 'Singleton'.


Clarity

Assignment and construction are two different operations, with different functions/code-paths. So be obvious as to what you're doing. e.g.


int main(int argc, char ** argv)
{
    start:
    Integer f = 34;
    if (argc-- >= 0)
        goto start;
    return 0;
}
Now while I'm sure you all can figure out if subsequent calls use the constructor or assignment operator -- but it's not obvious! Be obvious. [Note: this still point still applies when using loops and stuff. I'm just using goto's to throw a curve ball, like most code not written by you will do.]


Compatability

If the constructor is ever changed to be marked "explicit" (to prevent accidental conversion or what not) then you're code using assignment construction breaks. Which is a pain for everyone, the person who's code loses source compatibility and the person who has to jump through hurdles cause he wants to make a trivial change.


Legacy

<unsubstantiated>The only reason this feature even exists is to provide C compatability. e.g. int x = 82; makes perfect sense, as in c there is no constructors! Just reserving space and assignment to it. i.e. in C
type var;
var = value;

is identical to:
type var = value;
but this does not hold in c++
</unsubstantiated>




TODO: When i get the time, include some info about using assignment construction wrt constants



Samsung Galaxy S2

Engadget has just posted their review of the Samsung Galaxy S2, giving it a very high score of 9/10. Very, very tempted to get one of these.

Cue the spam

Let's give this a try. I'm going to use this blog as a rich-man's twitter. I'll try keep this blog active, publishing everything from original c++ pieces to to offensive comics and also "re-blog" interesting stuff. Make sure to subscribe to the RSS feed!