Laptop returns, cpufreq actually works

My Dad’s really awesome sometimes. In a previous post, I talked about how my laptop’s screen cracked due to a friend’s drunken behavior. Well, my Dad did me a favor and swapped the old HD out of my broken laptop and put it into the new one I got. So now I’m running Linux as if nothing broke.

Here’s another crazy thing… I thought my laptop didn’t have cpu frequency scaling support, but I was actually wrong. It’s just that I didn’t have all the kernel modules I needed loaded. It turns out I can scale the CPU on this laptop from 400mhz up to its max of 1.7Ghz! This is awesome because power consumption goes way down, laptop stays cooler, etc.

Plus, someone wrote an excellent piece of software to do this scaling automatically depending on load and remaining battery power. Temperature readings still come in as 0 degrees celsius, but I decided temp readouts are unnecessary anyway. The BIOS does a good job managing the fan. Yay new laptop! Back to work on my paper.

The Divine Right of Capital

Finally got to read the introduction to this book that I’ve had on my shelf for months. (Check it out Amazon.com.) Makes a very strong case for shareholder-controlled corporations, as they are structured now, being much more aristocratic than democratic. Combine this with Chomsky’s view (whose gist is, though we may have a democratic government, we have a purely fascist structure in our businesses, with top-down control, employees are just “human resources,” etc.), and you start to see why letting corporations run the show isn’t such a great idea.

By the way, if you haven’t, please, please, please see: The Corporation.

Socialism is not the abolition of property

If you look up the definition of socialism, like I recently did, it seems to be the same definition given for communism. Socialism is sometimes called the “intermediary stage to communism,” representing the stage in which workers take control of the means of production.

I was talking to my Dad, and explained to him that this is what annoyed me about all the active socialist groups (ISO/SEP) across the country. They all want violent overthrow, and the complete destruction of capitalism. They even want the abolition of property, and this sort of utopian future. But I don’t buy that. I don’t want to eliminate capitalism… I would just prefer a “fair capitalism,” where the government (and thus, the people) still has the power to regulate industry. Where corporations aren’t given the final word on all their decisions, where the people’s interest enters into things.

Wikipedia gives a better definition of socialism, with a lot of the history of the term, but I really don’t care about the terms. I just wish there was some movement that I could easily support that is simply calling for corporate accountability and industry regulation that is sensible and benefits the people at large.

gob2: Building GObjects easily in C

I’ve been playing with a preprocessor called gob2, which I only recently discovered. I found it because I actually had the same exact idea as the author. I was reading the Gnome 2 Developer’s Guide, and realized that although GObjects are nice and handy when they are already coded (as in all the widgets in GTK), they are actually a pain in the ass to write from scratch. Tons of boilerplate code, tons of macros you need to code to keep yourself sane.

So, I thought, what if some code produced all this boilerplate code for me? Someone already had the idea. It’s called GOB (or gob2), the GObject builder. Check it out.

What’s so nice about it is that it tries to have the feel of Java or C#. So, check out this definition of a new GtkWidget which counts the number of clicks it receives. If you run gob2 gtk-button.gob, it will produce gtk-button.{c,h} with all the proper GObject boilerplate code you’ve come to expect coding by hand.

Much nicer than doing that from scratch.

What’s strange is that more GTK+ developers aren’t using this. On the gob2 mailing list, the author claims it is used in gnome-vfs, but doesn’t it seem like it should be used by a lot of developers? (Granted, it’s not as nice as using gtkmm/C++ I guess, but there are still people declaring objects in C out there).

Resignation is not the answer

I watched the election results stream in yesterday and this morning, and my first thought was the same as yours: this is America, like it or not. There is no hope. 1984 is approaching, we might as well resign ourselves to a fate as the mindless “proles.”

However, after seeing Ralph Nader’s energizing speech the night before the election, I came to some important realizations, and I have a different attitude about the years ahead, given this Bush victory. Read on…

There’s Kerry coming around the last bend!

Electoral-Vote.com is now predicting a Kerry victory, but by a “razor-thin” margin in many states.

Meanwhile, Robert Cringely claims it will be a comfortable victory for Kerry, given the unaccounted “P. Diddy Factor.”

Finally, Salon says that Bush has lost traction even with part of his base. David Talbot reports:

quote:

Another worrying sign for the Bush camp: Bush’s evangelical base is not as solid as it was in 2000. “Like other Americans, they are also concerned about health care, jobs and other issues. That’s probably why last week Bush said it was OK with him if the states allow civil unions. In other words, forget the evangelicals and concentrate on the soccer moms in the Midwest who are fairly tolerant of civil unions. Well, that’s politics for you.”

Flippety flop.


It’s gonna be a fun Tuesday!

On stupidity and drunken behavior

So, night before last I came home and hung out with some friends. We were a bit drunk, my roommate and Sak were fooling around and Sak slipped and fell on my bed. Problem was, my laptop was right underneath him, and so the LCD screen cracked. Bad, bad situation. Turns out repairing it would be more $$$ than the amount I paid for it in the first place, so I’m not really sure what to do on that front.

It’s a shame… I really was getting used to that laptop. I mean, I’ll probably just re-purchase the same one, but I dunno what’s gonna happen exactly.

In other news, I was playing with Glade 3 earlier today and decided that it really needs some work done on it. I would love to hack that project a bit if I had time. I mean, if someone can produce something like Gambas for Linux, then some sort of RAD tool for GTK is possible. I know the two aren’t really comparable (Glade uses libglade to dynamically load the GUI from XML files, Gambas is a “better VB”, i.e. a full environment), and that a lot of developers scoff at RAD tools for GTK, but I don’t think properly designed RAD tools are about “dumbing down UI design.” I think they are really about making UIs easier to design quickly, so that you can spend more time on the code that does stuff.

Also, I was checking out Mainsoft, with their product MainWin for J2EE. Interesting approach. They take Microsoft IL code and compile it to Java Bytecode. This means that for now, while Microsoft doesn’t support platforms other than Windows for .NET, you can actually convert take a .NET project and make it run in the JVM. I wonder if it works…

Linux innovations I recently discovered

I have to say, I wasn’t expecting to like the Linux laptop experience that much, but I was just playing with the synaptics driver written for XFree86/Xorg, and I can’t believe how much careful work has been put into it. The authors have a truly well-designed driver here. Let me give a quick resume:

  • Non-linear acceleration. This means that you can define a minspeed and a max speed for your mouse cursor, and also define an acceleration ratio for how quickly it goes between those two speeds. This allows you to have a slow moving cursor when you want to make fine movements (i.e. in the GIMP or when positioning an insert cursor), and still allows you to get across the screen by moving your finger quickly across the pad.
  • Fully working palm detection, so that when you are typing, you can still rest part of your hand on the trackpad and not move the cursor.
  • Support for all sorts of tapping. This is the one I love most. I can tap the pad for single click, double-tap for double-click, and double-tap and drag for selection and/or drag and drop. Additionally, one can tap with two fingers (middle and index, for example) for middle-click and tap the bottom-right-hand corner for right-click. Alternatively to the two-fingered middle-click, one can tap the top-right corner.
  • Support for vertical scroll on right side of trackpad. A great feature that allows you to slide your finger down the right side of your trackpad to achieve vertical scroll up or down.

Conclusion: you can do all your mousing from the pad, without even using the clicking buttons. It’s extremely intuitive, fast, and accurate. I’m impressed.

The other innovation I discovered was the taglist plugin for vim, which, when combined with exuberant-ctags, makes for quick source file browsing. Very handy for these OS class labs I’m working on, where the source files tend to be pretty big and involve lots of routines you didn’t code.

wifi detector bash script

I didn’t really like any of the wifi-related tools out there for switching networks, so I scratched an itch and coded my own. Read more if you’re interested in obtaining an easy-to-configure bash script that requires iwconfig, ifstate tools, zenity and dhcpcd, and can easily allow you to set an array of prioritized wireless networks which are scanned and joined if found. After you establish your connection, dhcpcd is called to negotiate your IP address. It works quite nicely, and allows me to move from network to network and only have to click a button to enable my wifi access. Check it out (code inside)…