I know this blog has been quiet for awhile, and for that I apologize. I’ve been spending time opening my brain here at Purdue University. It’s late, and I should be studying for my Italian quiz in the morning, but I have a gripe.

Mostly, I’m questioning my skills as a writer. I’ve always thought of myself as being somewhat accomplished, especially considering that I hail from the math and science side of the brain, for the most part. Tonight I have been up late reviewing other students’ papers for class. Since we’ve been doing this over the last week or so, I’ve seen a good paper or two. Nothing mind-blowing, not that I’d say my writing is. But tonight, I read two absolutely abysmal papers, and I’m wondering how I have a C in this course. Of course, I have no idea what these writers have, but their writing skills borderline on high school level. I am, for once, speechless.

Am I taking crazy pills?

It just occurred to me that Compiz and Cellwriter don’t play nicely together by default. If you’re having problems, open up ccsm (compiz-config-settings-manager) or install it if you don’t have it (it’s sudo apt-get install ccsm or yum install ccsm as I recall), then search for “glib” in the filter, and make sure that your window now looks like this:

Screenshot-CompizConfig Settings ManagerRestart Compiz, and your handwriting recognition should now be working just fine :)

EDIT: This only worked for me once. I’m now just reverting back to Metacity when I’m in tablet mode. Has anyone figured this out? (of my tens of readers :P )

Great title, I know.

If there’s something that needs to be done whenever you wake your computer from suspend, hibernate, or just before it suspends/hibernates, you can do it without too much difficulty if you know how to script.

The Madwifi driver for my Thinkpad’s wireless card doesn’t like to be suspended and I always had to reset it every time I awoke my computer. Annoying! So from several sources I have found that putting a script in /usr/lib/pm-utils/sleep.d/ would let me do this. However, they have to adhere to certain guidelines. First of all, you define what the script handles for each change (sleep/wake) in a single script. A bare Bash script that does this is as follows:


#!/bin/bash
case $1 in
    hibernate)
        ;;
    suspend)
        ;;
    thaw)
        ;;
    resume)
        ;;
    *)  echo "ERROR: called incorrectly."
        ;;
esac

This is pretty simple. Now just call whatever you need in the corresponding parts (thaw means wake from hibernation).
My wireless script (I didn’t bother with hibernation because I never use it) looks like this:


#!/bin/bash
case $1 in
    hibernate)
        ;;
    suspend)
	if [ -n "$(lsmod | grep ath_pci)" ]; then modprobe -r ath_pci; fi
        ;;
    thaw)
        ;;
    resume)
	if [ -z "$(lsmod | grep ath5k)" ]; then modprobe ath_pci; fi
        ;;
    *)  echo "ERROR: used incorrectly."
        ;;
esac

It checks to see if I’m using ath5k (which I do sometimes), and if I’m not loads/unloads ath_pci as necessary. Works like a charm.
Now there are two more steps. You have to save the file as ##something to tell pm-suspend when to call the script. The higher the number, the earlier the script will be called, so if your script depends on things being set up, it generally needs to be fairly low. I wanted mine to run before 55NetworkManager but after 75modules, so I named the file 57athpci.

Finally, set the file as executable by running chmod +x filename (so in my case chmod +x 57athpci). You’re all set.

I know this works in Fedora, and also ArchLinux (my tutorial is modified and personalized from their tutorial); any feedback on other distributions would be nice. (Especially Ubuntu).

Guys, I just want you to realize that people who write blogs aren’t writing well-read research or well-documented papers or any of that shit. Blog posts are by-and-large (especially here) rants. I often have my beliefs backed up by research I have done at some point but I don’t document, I don’t footnote, and for crying out loud I don’t cite my sources because the stuff I’m bitching and moaning about is accumulated knowledge from god-only-knows-how-long that for one reason or another has decided to burst forth onto this poor website like a whitehead on a teenager’s face.

All I’m hoping to do is to make you think. I don’t care if I change your opinion but I want you to reconsider something new every time you read one of my posts. If it pisses you off, good. At least you can put up a decent defense, I hope.

Hell, I proofread these damn rants like once. Twice, if it’s technical stuff and I don’t want to confuse some poor Ubuntu n00b.

If you want real honest stuff go read Michelle Malkin’s blog or Jeff Atwood’s. Hell, I don’t even have my name on this blog. Just understand the medium.

Don’t believe everything you read on the internet. For that matter, until you find a real paper with real sources, don’t believe anything you read on the internet. Especially blogs. Especially blogs pretending to be newspapers. For crying out loud.

Really.

Really.

Athiests like to say things like “religion is the opiate of the masses” without realizing that they are subscribing to their own. Just because your religion lacks a deity doesn’t make it any less of a religion. There are certainly flavors of neo-paganism that don’t specifically have a deity and are undeniably religions.

If there is a non-religion, it’s either agnosticism, which says “we can’t know” or apatheism, which says “I don’t care enough to try to find out.” It is not Athiesm.

Why not? What constitutes a religion? A creation theory? Well Athiesm has Evolution. Churches? Athiesm is professed in the Universities. Its priests are the scientists who deny God’s existence and ridicule those who believe in Him as small-minded. Its evangelicals are the legions of devotees who ridicule believers of every faith saying things like “God is Santa Claus for adults.” Its apocalypse is Global Warming.

Evolution and Global Warming are based on as much blind faith as science (much to their believer’s chagrin, should one ever point it out),

Its holy books are Nature, Scientific American, and National Geographic who deny God. No, God isn’t “scientific,” and I understand that saying “God made it.” isn’t a scientific hypothesis, however science should be interested in the “how” whatever deity or non-deity made science work. When I look at the earth I think “look at the beauty of God’s work,” but any of these three would say “look at the beauty of Mother Nature,” which is an active denial of the majority religion of the intended audience.

Athiests work so hard to remove God from every facet of life that it would be absurd to think of them as anything other than evangelicals for their religion. They aren’t any more intellectual or intelligent because they have rejected God, and I for one, am tired of being ridiculed as simple-minded or stupid for having faith.

I’ve written on this before, and will probably do it again. It is an ongoing battle with those who are condescending with no right to be.

I’ve heard that most people don’t have a problem with this, but I did. I have an AR5212 in my Thinkpad, and while ath5k works, it drops connections randomly, especially when the connection strength isn’t great to begin with.

This began to get very frustrating, so I slogged through a forum thread at FedoraForum.org. Despite being called lazy on multiple occasions (because someone is temperamental and I tend to overlook useful information if it’s not pointed out as being critical), I managed to get madwifi installed.

Madwifi must be recompiled every time the kernel updates. This is fine, as I tend to re-try ath5k each time the kernel updates as it seems to work better (better signal strength and comes back more reliably after I suspend the computer) besides the connection thing.

Anyhow, if you are having the same problem as me, this is the important stuff from the thread:

  1. Download THIS SNAPSHOT OF MADWIFI because the others do not compile in F11.
  2. As root,  yum -y install gcc gcc-c++ make kernel-devel
  3. Untar the snapshot, compile it with “make” and install it with “make install” as root.
  4. As root, do “rmmod ath5k && modprobe ath_pci” to enable madwifi. NetworkManager will disconnect and reconnect shortly.
  5. If you want to keep this, add “blacklist ath5k” to the end of  /etc/modprobe.d/blacklist.conf (again, as root)

Working on a project to potentially building a piece of art to put up in my room next year. The idea is this one: with the help of a friend who is better at hardware than myself, some ICs, my Arduino, and lots of patience and soldering, I want to build a 30 inch by 30 inch board with 100 discrete 3 inch by 3 inch “pixels” which are lit by a single RGB LED, that would look something like this, if the LEDs were set to display red, green, blue, repeating:

Each pixel diffuses the light from the LED so that it appears that the whole pixel is lit.

Each pixel diffuses the light from the LED so that it appears that the whole pixel is lit.

Since each LED can display any mix of red, green, and blue, any color is possible within each pixel, so designs can be displayed. It will maintain a USB connection to the computer (although extra power will probably be needed as the Arduino/USB won’t supply enough for 100 bright LEDs) so the computer can run more complex algorithms than the ICs could normally handle, and maybe even be able to display simple visualizations that follow music, fades and sweeps, and any color that I desire to set a certain mood to my room.

Other ideas include Conway’s Game of Life. The board could be mounted on a piece of foam board or plywood, with the elctronics hidden beneath, and the LEDs shining through either translucent acrylic or some sort of cloth, most likely.

Anyway.. mostly I have to keep it cost effective. Ordering LEDs from eBay, I can get 100 RGB LEDs for about $35, which beats DigiKey’s $150-ish for 100, but I still have to find integrated circuits and learn how to do it. Wish me luck :)

(Any suggestions are more than welcome)

Sometimes. And telling when it’s stupid is important to being a good coder, in my opinion.

Maybe I’m wrong. I don’t have a degree yet. But I know that when I write a Python script that I want to rotate the screen on my tablet, I’m not worrying about extensibility or modularity, I just want a small procedural script that does this, this, and this, and then finishes. The faster the better, both in writing the script and in the script’s execution.

So, in beginning work on JORSnix, I decided I’d get my tablet working perfectly first, as a system to model it on. Part of this made rewriting my tablet.rb script that rotated my tablet between landscape and portrait mode in Python. I spent about 20 minutes on it, not counting the time I spent learning that the os module was deprecated and thus learning how to use the subprocess module.

Anyway, the finished product is this:


#!/usr/bin/python
from subprocess import *
import re

p1 = Popen(["xrandr"],stdout=PIPE)
p2 = Popen(["grep", "current"], stdin=p1.stdout, stdout=PIPE)
output = p2.communicate()[0]

current = output[output.find("current "):output.find(", max")]
pattern = re.compile('[0-9]+')

resolution = pattern.findall(current)

if resolution[0] > resolution[1] : #landscape
        Popen("./xrotate"+" 3", shell=True)
        Popen("cellwriter &",shell=True)
        Popen("easystroke &",shell=True)
else : #portrait
        Popen("./xrotate"+" 0", shell=True)
        Popen("pkill cellwriter && pkill easystroke", shell=True)

As you can see, it's pretty simple and straightforward. It's no piece of art, but it does what it needs to do. No more, no less. And it will work on any single-monitored tablet, no matter the resolution, for swapping the screen from portrait to landscape and back.

If it needs to be turned into a couple functions so I can use it in a class, that would work. But that's not what the plan is, at least not yet. But I was told by a friend on IRC that it was unreadable, and wrong simply because my code isn't "modular and extensible" without first examining why it would need to be extended upon. He gave this as the "correct version:"


#!/usr/bin/python
from subprocess import Popen,PIPE
def bash(c):
	if c.startswith('cd '):
		chdir(''.join(list(c)[3:]))
	else:
		return Popen(c, shell=True, stdout=PIPE).stdout.read().strip()

class Display():
	def getCurrentResolution(self):
		res = bash("xrandr")
		res = res[res.find("current ")+8:res.find(", max")].replace(' ','')
		return (res[:res.find('x')],res[res.find('x')+1:])

	def rotate(self):
		res = getCurrentResolution()
		if res[0] > res[1]: # Landscape Mode
			self.xrotate(3);
			bash('cellwriter &')
			bash('easystroke &')
		else:               # Portrait Mode
			self.xrotate(0)
			bash('killall cellwriter')
			bash('killall easystroke')

	def xrotate(self, mode):
		# unknownmosquito can fill it in from here

class Wacom(Display):
	def getStylusMode(self):
		return bash('xsetwacom get stylus Mode')

display = Wacom()
display.rotate()

Besides going into the fact that the "better version" would no longer use regular expressions (and thus would be less resilient to oddly shaped displays), it aliases Popen to bash for "readability." Overall, being accused of using procedural programming for a systems script in a language like Python (which allows you to do this for a reason), and to have this given to me as a "correction," just rubs me the wrong way.

Especially when I'm told that it needs to be done like this to make it more "readable."
Object Oriented Programming is wonderful. Unless using it is just wasting time.

Note: If it becomes necessary to integrate this script into a larger part, obviously it will get OOP'd. But for now, it'll remain a script.

The thing that blows my mind is that Capitalism, as it existed in it’s as-pure-as-it’s-ever-been state from the late 1700s until the mid 1900s in the United States, as it has existed nowhere else and as it exists still to the fullest extent here, although we’ve come a long way from anything resembling capitalism since Teddy Roosevelt, is ridiculed as being a failure by some blogs that I stumble upon, saying:

Capitalism is rightly credited with having unleashed enormous forces of productivity and technology. But it has also reduced much of the world to ruin and squalor. After four centuries of triumph as the dominant mode of global development, capitalism has furnished for itself a world in which one out of two human beings lives on $2 per day or less, and more than one in three still lacks access to a toilet. Most children in the world never complete their education, and most will live out their lives without dependable medical care. As the world economic crisis deepens, already deplorable conditions in the Third World will only deteriorate further.

I would like to be the first to point out that what this country has done to become rich has not “reduced much of the world to ruin and squalor,” but has merely left the “ruin and squalor” that was the status quo during the time and made something for ourselves. Due to trade, we dragged Europe (kicking and screaming) and eventually Japan and to some extent China out of their squalor as well; the rest of the world has yet to catch up. We aren’t holding them down. In many cases, it is corrupt individuals in their governments that make situations in the Third World unhelpable to a large extent by any external force. In short: they have to get out of a lot of it themselves. Yes we can, and we do, help, through charity.

But my point is that 200 years ago, no one had access to a toilet. Formal education was for the super rich only, and only for men. When people were poor, they starved. Anywhere in the world. The difference? Now the countries that have embraced capitalism have wealth.

Rich guilt be damned. We have what we have through the sweat of our own brows, and at no cost to others who condemn our way of life. If you’re feeling guilty, give some money to the Red Cross or something.

There is not finite wealth. We are not richer because the Third World is poorer. We are just richer.

I’m starting a new project. What is JORSnix, you ask? It’s Linux for Tablet PCs. Windows has the monopoly on Tablet PCs, and that sucks, because besides that, Linux is wonderful for students. And so are tablets.

For those of you who don’t follow my blog, I own a Lenovo X61 Tablet. It’s my pride and joy, and I take it everywhere. It weighs under four pounds, has excellent battery life (or.. well.. used to..), and of course it’s also a tablet, so I can take notes in class on it.

So what is JORSnix going to be? It’s going to be based on Ubuntu, and loosely modelled around their release schedule. If they do something that screws up tablet support for a release, we’ll notify our users and skip it.

In short: we’re going to make it easy for you to use your tablet efficiently with Linux. That’s the goal, anyway.

We plan on packaging a lightweight system with Gnome (maybe one of the *box WMs later), Xournal, CellWriter, EasyStroke, and wacom-tools. We’ll make all of the buttons work and make your laptop usable in Tablet Mode without a keyboard.

But for now, we’re just going to support Lenovo X61 Tablets because that’s all we have, but hopefully it will work on other tablets with little tweaking. Both HP and Fujitsu use similar Wacom backends, so if I don’t do anything too Lenovo-specific, it’ll be OK. Anyway. This is the birth of something good. If you read this and you’re willing to test, especially if you have a different tablet than me, please, please contact me.