Tribal Registration

elections, accessibility, politics, problems

Here's something to think about for a bit on this fine Sunday morning: In a tribal or nomadic nation, how do you register voters?

I'll post my thoughts later.

Calculating Word Frequency from the Command-line

system, elections, hacks, open source, politics, problems

Word frequency calculations can be very helpful... I was poking around trying to find a simple command-line tool that would calculate word frequency and came across a great solution (with lots of help from "GNU texutils: Putting the Tools Together" and this page which helps describe alias syntax).

So here's a beast of a command that can be used to calculate word frequencies from the command-line on a file, file.txt:

tr '[A-Z]' '[a-z]' < file.txt | tr -cd '[A-Za-z0-9_ \012]' | tr -s '[ ]' '\012' | sort | uniq -c | sort -nr

You can place it in your .cshrc or .tcshrc file (or whatever) as an alias:

alias wordfreq "tr '[A-Z]' '[a-z]' < \!^ | tr -cd '[A-Za-z0-9_ \012]' | tr -s '[ ]' '\012' | sort | uniq -c | sort -nr"

Note: The above is all one line. Note the addition of double quotes within the single quotes of the alias. Also note the !^ which tells the shell to insert the first argument after the alias right there in the command (the backslash (\) there is to make sure the shell doesn't do something funny with the exclamation mark). This essentially strips all punctuation, makes it one word per line and then uses the uniq and sort commands to do the dirty work.

So, for example, I can use this command on a (somewhat groomed) file that has the names of all the counties (and states where needed) in which machine-related problems were reported in the recent election:

%> wordfreq problem_counties.txt

188 philadelphia
130 orleans
94 palm_beach
81 franklin_oh
70 cook
69 broward
68 cuyahoga
62 miamidade
59 kings_ny
55 manhattan
52 wayne_mi
42 bernalillo
41 los_angeles
34 mahoning
31 lucas
31 allegheny
30 mercer_pn
30 maricopa
30 harris
26 orange
[...]

UPDATE [2004-11-28 10:23]: For some reason or another, the alias above refuses to redirect output to a file. That is, the command:

%> wordfreq file.txt > output.txt

doesn't work (the output still goes to the terminal window (stdout)). I have a feeling this is because one of the commands in there is native to the shell so output redirection doesn't work. However, if you pipe it to one more dummy command (like cat) it works:

%> wordfreq file.txt | cat > output.txt

This allows you to use it on the command line and pipe it to head or more and when you like what you see, you can pipe to cat and redirect to a file.

If anyone has any clue why it won't redirect normally (even if you put the | cat in the alias itself), I'd love to know more.

A Simple Method for Inserting a Bloglines Blogroll

system, blogging, feeds, hacks, open source

Have I mentioned that I like Bloglines, lately? One cool feature is that you can export the list of what you read as a blogroll. Bloglines offers a JavaScript and an HTML blogroll that you can embed in your blog.

Naturally, I choose to use the HTML version of their blogrolling service. I generally like to minimize the use of JavaScript; I like static mark-up where something more complicated is overkill. However, updating your HTML blogroll is a tad cubersome (go to bloglines, find the blogroll "tip", export your blogroll in HTML, open the main blog page on the server, paste in my (rather large) blogroll text into an emacs -nw terminal and save the file).

Simple geeky solution: To quote Wendy during the heavy computing on election day, "wget is your friend."

Log in to your blog's server in a terminal window. Create an alias in the .cshrc file in your root directory:

alias getblogroll 'wget -O blogroll.html "http://rpc.bloglines.com/blogroll?html=1\&id=userid"'

Geeky details: The above should be all on one line. The entire command is surrounded in single quotes ('). The URL that wget is after is surrounded in double quotes ("). The ampersand (&) must be escaped with a backslash (\) to get a slash-ampersand (\&).

Change userid in the above to your bloglines user ID. Then, source your .cshrc file (source .cshrc).

Now, the command, getblogroll will save your HTML Bloglines blogroll as the file, blogroll.html, in your root directory.

Now, all you have to do is log in to your server, run the getblogroll command, open your main blog page, insert blogroll.html and save the file.

UPDATE [2004-11-27 13:51:13]: As Matthew notes in the comments below, this can be automated entirely! (I didn't even know you had a blog, Matthew... instantly added to the blogroll!)

While I'm not going to use cron jobs, I've modified my getblogroll alias to save the blogroll.html file in the directory of my blog's index file. Now, as Matthew noted, I can replace all the opening of the index file, inserting and saving with a single PHP command:

<?php require( dirname(__FILE__).'/blogroll.html'); ?>

Now, I can just run my getblogroll command whenever I update my blogroll (like I just had to for Matthew's blog!).

Charlotte Observer: State plans elections training

elections, reform, problems

Link: http://www.charlotte.com/mld/charlotte/news/local/10259617.htm

Under Bartlett's plan, the state would pay for any precinct judge to take 12 to 15 90-minute classes in election procedures at any of 13 community colleges. Central Piedmont would be one site.

The classes would be voluntary for precinct judges and paid for with money from the Help America Vote Act.

This is all fine and dandy... but, the HAVA money will only be around for a bit. These kinds of things must be regularly budgeted items.

Mozilla Search Bar Plugins

hacks, open source, patents

Here's a quick list of the search bar plugins I've created for Mozilla/FireFox:

Note: there's all sorts of good ones over at the mycroft site. My favorites are the all music guide, DICT.org, Google News, IMDB and the urban dictionary.

Contact / Help. (cc) 2021 by Joseph Hall. blog software / hosting.
Design & icons by N.Design Studio. Skin by Tender Feelings / Evo Factory.
And a few words about the structure of the eye . Everyone " retina ". Especially often we hear it buy clomid online in the phrase " retinal detachment ." So what is the retina ? This - the front edge of the brain, the most distant from the brain part of the visual analyzer. The retina receives light first , processes and transforms light energy into irritation - a signal that encodes all the information about what the eye sees . The retina is very complex and in their structure and function . Its structure resembles the structure of the cerebral cortex. The shell of the retina is very thin - about 0.14 mm.