python weird error

So if you get errors when installing django and pysqlite that seem obscure, you can fix them by going to settings.py and changing “USE_I18N” to False.  Then they go away.  Either that or you could attempt to (somehow) recompile pysqlite with the correct Unicode extension, as apparently it is not being built with it.  Good luck!

RoR speed test

Seems that scgi is the fastest (that I can tell)…umm… [ran

100 immediate connections on webrick:
Slowest pages on average (worst 5):
Average times (sec)
connect write   read    close   hits    URL
2.9217  2.9217  51.6146 51.6146 500     http://localhost:3200/
Requests: 500 Time: 516.15 Req/Sec: 0.98

100 immediate connections on scgi single

Slowest pages on average (worst 5):
Average times (sec)
connect write   read    close   hits    URL
0.0005  0.0005  28.8796 28.8797 113     http://localhost:8100/
Requests: 113 Time: 40.29 Req/Sec: 8.24

Is this a joke?

Slowest pages on average (worst 5):
Average times (sec)
connect write   read    close   hits    URL
0.0002  0.0002  60.5475 60.5476 771     http://localhost:4000/
Requests: 771 Time: 598.49 Req/Sec: 1.52

Hmm. Why? I have no idea.
Using flood, scgi with one instance running, webrick on production mode.  Note mod_ruby I could not really even get to compile, and mongrel seemed slow, too.

Odd.

perl cygwin

To install cygwin perl you need to first install make, then cpan will work. You may need to also install gcc. I don’t know why these are not installed.  Anyway if you get the message after Make ” — NOT OK” that means that something is not installed.

how to create a text box in html

<code>

<SELECT NAME=”Morefruit” SIZE=”4″ MULTIPLE >
<OPTION SELECTED> Apples
<OPTION> Bananas
<OPTION> Oranges
<OPTION> Watermelon
<OPTION> Kiwi
<OPTION> Cantaloupe
<OPTION> Strawberries

<default select name=”Fruit”>
</SELECT>
</code>

Notice the “size =” meaning how much of a drop down you’ll have.

SSH tunnelling

ssh -L means “connections I make ‘into’ this port on my machine, will make their way through this tunnel and into the foreign port on the foreign machine (some other prog running there that [not ssh]).

Creating fixtures that link amongst themselves

Note well that when creating fixtures for RoR testing you CANNOT really link to straight names, within other files, like

(one entry)
CoolCast:
id: 3

and another

HasBoth:
id: 5
single_internet_file_id: FavoriteMP3Url # uh...this doesn't seem to work
user_blended_cast_id: CoolCast
file_location_and_name: "yoyo.mp3"

where those are names–the names don’t work (just become zeroes, somehow), so…just use (hard coded) numbers.

nil in fixtures

a note:
in test/fixtures, when you write

name:
id: 34
name: "Roger"
number: nil

this actually assigns number as 0! This means that if you test in your model code for “number.blank?” this will now return true, since it is actually zero. The use of nil is truly misleading here, and should be done away with, in my opinion. So you can instead just call
...
if !user and !filename
...
do whatever in your model “verify” methods, and nil will work. Don’t use blank, basically.

end
instead of
if user.blank? and filename.blank?
do whatever
end

Roger's meanderings, notes to himself, bug reports, and other things