2005-04-11
long time
My brother was at home, maybe 200 meters away, but he seems to have noticed the commotion. Instead of going out the front gate, he climbed the back fence, ran over, and took the boys off me. He didn't go and fight them himself (he probably knew that I'd been snotty :), but it was cool that he took them off me so I could get up.
Then we went home. No fuss, just a regular day.
boost regex!
That's not to denigrate the quality of the library, it works, very well. I use PCRE implicitly in PHP and it's a great help and is incredibly easy to use there. But C is now just too low level for me and while I can work there, I don't like it much. If I can, I work in PHP (perl is far too ugly for me, although that could change if i were to work in it instead of just reading it). I'll be working in java soon, but I tend to have a bias against it for small projects. I'm sure it's great for large projects, but even there, the libraries and frameworks seem over-engineered. But that's probably just a function of the fact that they're large enough that I can't get my brain around them in a week.
For anything lower level that I can't do in java or php, i like C++. And that's where I use the boost regex libraries. I've written utility functions that hide some of the details of the boost implementation (just pass string pattern, string data, vector
it's very nice to be able to say:
vector
if ( re_search(pat, line, matches) )
{
for (int ctr=0; ctr < matches.size(); ctr++)
do_something_with_match(matches[ctr]);
}
2005-04-07
php, popen, stream_set_blocking(...,false)
Well, popen doesn't work with stream_set_blocking(..., false), so I can't do things that way. Unfortunately, I've spent a week or two setting up the framework for all this (so it would be easy and convenient) but now I find it can't be done.
Oh well, time to give up on trying to do that in PHP then, and just buckle down to doing it in C++ (the original version is in C++, but frankly, I just don't want to maintain that code anymore, no choice now though).
2005-03-20
The American Empire and the End of Freedom
source. The guardian is consistently anti-american.
On the other hand, there is no doubt that much of the article is true.
As a practical matter, the US government, and, in fact, most (but not
all) of the americans on the ground care far too little about the rights
and welfare of the people they walk over. They are too focused on their
own needs. As far as that goes, so is everyone else, focused on their
own needs.
But the U.S. does itself a disservice by hewing closely to the theory
that the rights enshrined in their constitution apply only to their
own citizens, and apparently, only to those who are convenient and
are actually on their own soil.
http://www.guardian.co.uk/afghanistan/story/0,1284,1440836,00.html
For myself, well, i watch, mildly amused, while U.S. policy, and many
of their "heroes" (they're not heroes, they're kids put into warzones,
defending themselves, and all too often brutalizing the population
because they don't understand the local culture and because their
american pride [and those attack helicopters, bradleys, tanks, humvees
and overall military superiority] make them accept without questioning
the importance of their own survival as opposed to the trivial needs
and rights of the populace) descend into the natural depravity of
absolute power and empire.
Probably, many americans would vote against their own government
instantly if they understood what their government is doing to
non-americans, and to the american ideal. But most of those americans
are too comfortable and are unwilling to risk the difficulties that
would come of trying, vigorously, of changing their government's
policy. For those few, I wish them luck. For the rest, well, I wish
them luck too. It's going to be a difficult century, or longer. The
descent into depravity from power is long and fun for a bit, and then
it gets worse.
2005-03-14
So you want to be a consultant?
I'm learning again. Some of those lessons I haven't internalized yet. It'll take a while, a lot of things do. I'll get there yet :).
2005-03-10
Rsync and compressed files
- i took a directory of source code and test data, around 9MB.
- copied it to a remote box
- tar cvzf on both sides to one file and also tar cvf to another file.
- on the source box, edit one source file, insert only one line.
- tar cvzf and tar cvf on the source box. the source box should have sources, tar and .tgz which vary in only one line in only one internal file.
- rsync of the source gives a speedup of 450 (14K sent, 94 received), rsync of the tar file gives a speedup of 85000+ (78 bytes received, 20 bytes sent), rsync of the .tgz gives a speedup of 1.48, (2.4MB sent, 12K or so received).
so rsync of a tar file is best (because only one file needs to be analyzed to see where the differences are). rsync of a compressed file (at any rate of .tgz, but probably of any compressor) is bad. not sure why, but i wouldn't be surprised if the compressed representation of a lot of data depends on what has come before, and there may be other effects like that which
confound the difference finder since too much is found to be different.
2005-03-09
Sagada Mountain Tea
I've been googling for the tea and I can't find anything that says it's for sale in manila. There's got to be somewhere that has it. I just can't find it. Maybe it's time to ask the mailing lists. That might save a trip to sagada. It would be good to go, but I need to save money for the wedding in May.
Saisaki music
Sol and I met francis, my brother. He's in from the U.S. and is nuts about japanese food. Sol asked me what francis looks like and I couldn't answer. I'm just no good with faces. When francis arrived however, it struck me. he looks like Ming Tsai! :).
Anyway, the food is always wonderful there. I always love the salmon sashimi. Sol ordered the uni for us, my first time, and it was incredibly good.
but the music sucks. I mean, country muzak is really, really bad. Whose damn fault is that?
2005-03-03
corporate peer to peer
is almost always a mistake. at any rate, it is anywhere where bandwidth is expensive.
I was just talking to someone at a company I do some consulting with. I was working remotely, and the link was ridiculously slow. Ping times were at around 1 second, and sometimes 1.5 seconds. I could still work (i've got some techniques involving rsync, for very bandwidth starved links, and i just type ahead), but I could work better if the bandwidth weren't so slow.
So I talked about the serious need in corporations to take steps to block p2p, and then, since it's impossible to block it completely, probably, to do as much as it can to monitor p2p and then to have a policy about p2p use (probably that it should not be allowed at all, and that it would be blocked and monitored, and violation would affect performance reviews).
That may sound draconian, but it's necessary.
- bandwidth costs money. even if it were cheap, if peer to peer didn't soak bandwidth the company wouldn't need that much bandwidth and could contract for less, thus paying less every month. That's money that goes straight to the bottom line.
- the company i'm using for my example runs its own publicly accessible mail and web servers and therefore their bandwidth is all fixed IP. That's a bit of a bug on the part of IT management, they could go with 80% dynamic IP bandwidth and then 20% fixed IP for mail and web. They would save quite a bit of money right there since fixed IP bandwidth carries a very high premium in the philippines. they would save more money just by buying dynamic bandwidth for staff time-wasting surfing and buying less fixed IP bandwidth for those services that require the bandwidth.
- in a litigious world, it's for the company's good that peer to peer is blocked and violations monitored and punished. The same company has received a warning letter from a RIAA/MPAA related agency, apparently someone had left their bittorrent client on and had been downloading and serving enough files that they attracted someone's notice.
Naturally, this sort of thinking won't sit well with employees. But frankly, I don't think it matters. The staff aren't being monitored for wasteful surfing (of which, perhaps half of all surfing at the office is wasteful and not work related or only very peripherally work related), so their surfing for entertainment is a free benefit of employment. It's only fair that those online activities which might be damaging to the company be disabled so that other online activities of neutral or only mildly negative value may be allowed.
2005-02-27
but then I discovered rowing, the only sport you can win sitting on your ass going backwards
2005-02-08
2005-01-27
Battad
This trip, we took the overnight bus to banaue, had breakfast there, took an overpriced (PHP 300) tricycle to the jump off point at Battad (long ago, we took a jeepney to I forget where, maybe Bangaan, got off at the junction and walked up the mountain). They've been building a road so the hike is much nearer if you jump off from the end of the road, and much nicer if you start walking from the junction. Here's a view

of the walk from somewhere around the end of the road down to the ridge that has the hostels where tourists can stay (click on the image for a larger version).
From the end of the road, it's still something like 45 minutes or more to battad itself. It's mostly downhill (and you can shave some time off that by taking the much steeper route, we didn't though since it was drizzling and slippery when we got there).
When you get to the ridge with the hostels, there are a whole range of choices. Most of them are about the same. There are slight differences in hostel "personality", but they're generally all good. This trip, we stayed at Simon's. We were going to stay somewhere else, but there were other guests there. Simon's is a bit out of the way (only a really little bit, it's just beyond Rita's I think it was, and beyond Simon's there aren't any more hostels). The rooms are basic. There are no 3 star hotel amenities here (although the bathrooms are very good, much better than they were during our last trip). There's not even any electricity in Battad (maybe in a few years there will be, there isn't now though, although I think one of the other hostels had solar power or similar, not sure what they used it for though). The room was very comfortable though. Everything at Simon's was great. I'm sure at the other hostels it's much the same.

I artistically disarranged the pillows there :). It's neater than that.
Here are views of Battad from Simon's. Click on the images to view larger versions.
![]() a view of the village of battad from Simon's dining area | Battad from our bedroom window![]() |
The food in Battad is nutritious and good, but there's not that much choice. For the
sake of adventure, we had the pinikpikan chicken. It's interesting to think about, but I'm not having that again. It's not just because of what they do to the chicken, but also the fact that the soup is bathed in the smoke of the chicken's feathers. That gives the whole thing a strange bitter taste that I don't much enjoy. Last time I went to Banaue, Battad and Sagada, I had a lot of omelette. You can still get omelette wherever you go, that's probably the safest food choice for most people. You can work off the cholesterol walking up and down the mountains.
Simon's has reasonable pizza and pita (well, actually, they use the same flat bread for both).
We thoroughly enjoyed our stay. To be honest, the walk down wasn't that much fun. And the problem with staying in Battad is that one should leave early in the morning


We had contracted with our tricycle driver to pick us up at 9. We were a bit late, he waited for us and told us that he had some other passengers but he arranged for us to take a jeepney back to Battad instead.
2005-01-25
normal distribution
Fortunately, I was able to grab a copy of Numerical Recipes in C and found some code on p. 217. The code produces a normal distribution in the range -1.0 to 1.0 with a standard deviation of 1.
My program was PHP, so i translated it from C (K&R!, boy that's old :)
The PHP source is here
Unfortunately, I'm not a mathematician and I'll need to find ways to adapt that code or find some other code where I can adjust kurtosis, standard deviation, etc.
I'd look in Knuth's Seminumerical algorithms, but it might not be there. And anyway, my copy is in Mindanao. I won't be able to refer to that until I go in May.
2005-01-20
Email from idiots is spam
Every once in a while I see vacation messages posted to mailing lists. Every single one of those I mark as spam in gmail. Partly I do that because people who don't know enough to set selective filters on their vacation messages are too dumb to listen to.
The gmail filter will learn from vacation messages which words score high as spam and perhaps future vacation messages will be marked spam and I'll see less of them. Also, the authors may start to score higher as spammers. That's a good thing too, for me. I'll see less of their mail since their mail will automatically go to the spam mailbox, and when I go in there to confirm which emails are spam, I get a chance to despam those emails which are important.
I don't think I've seen gmail do that yet though (filter mainly on the sender's email address), I've seen Bob Reyes' spams about his hosting service end up in the spam mailbox, but that's just because the email was spam, not because the emails were from him.
2005-01-11
2005-01-09
Lucky
On the 31st though, we were supposed to go back to Cagayan de Oro on an earlier boat, but we took the last boat instead (and lucky to have made it :) because Diggi had some guests who wanted to do the rapelling tour and it was a great opportunity for Sol to go on the same tour. I've done the tour several times, it's neat,
The tour is composed of a hike up to a point above the main falls, walking along the stream to the first wall, and rapelling down the first wall.
The second (or third,stage, I forget exactly) is a slide. The water wasn't very strong this time, even though it had rained the previous two days or so, but the slide was cool anyway. Everyone else did the slide, except me. I preferred walking down the wall :).
There's another wall, and some walking down the stream and finally we got to the top of the main waterfall. That's too high to rapell down, at any rate, it is for non-professionals. So we just enjoyed the view (there was a slight drizzle, making for a beautiful cool day) and Sol looked over the edge.
After walking down walls and sliding down canyons, of course, we had to do everything in reverse :). So we walked up the walls and back down the mountain.
At the end of the tour, everyone is exhausted, exhilarated, glowing.
2005-01-07
I went diving with them on dive #1 (Tangub bay) and dives #2 (Old Volcano) and #3 (Tangub bay again).
I missed dive #2 since I was sick that day (something I ate didn't agree with me).
All the dives were great. I don't think I've dived Camiguin this late in the year before (I lost my dive log around when I had my latest and most serious motorcycle accident, I need to find that, it's got to be around somewhere), and the diving is surprisingly good.
Of course, these are qualifying dives, so it's not like I was sightseeing. I was keeping an eye on sol and her classmate all the while, and dive #1 was only to 12 meters. Dive #1 was pretty good, even though only at a maximum of 12 meters. Tangub bay is great even at shallow depths. And while they were doing some buoyancy control exercises I was looking at four nudibranchs, all less than a centimeter long, but walking along the sea floor as if they owned it.
Dive #3, Old Volcano, is always great. There are pillars and canyons from the last volcano eruption, and the sea life is very rich (I saw my first turtle there, during one of *my* qualifying dives in May 2003). I saw a lionfish immediately, and there were large triggerfish, a tuna (in the depths, diggi and dodong saw it, but sol and i didn't), several different kinds of sweetlips, batfish, and lots of other fish which make camiguin diving incredibly beautiful. It's commonplace at all camiguin divesites (incredibly electric blue fish, brilliantly electric violet/purple fish, clownfish, nudibranchs, everything else) but it never palls.
Sol was a bit tense since I mentioned a current. But she calmed down (diggi is a really great instructor, divemaster, and knowing that i'd be around, that diggi was guiding, and that we've got trained boatmen who keep a watch out for us helps a beginning diver's confidence a lot) and we had a great dive.
Dive #4, Tangub bay again, was more interesting than the first dive since we went deeper (18m) and further out. There were still exercises (additional buoyancy exercise, swimming without mask, etc), but they didn't take too long. There was a flutefish much like this one. I thought it changed color to match the color of something it moved close to when we approached it. But sol didn't see that, so maybe I was imagining things. We need to get an underwater case for the digicam :).
There were also incredible nudibranchs, and all the standard fish, lots of triggerfish and it might have been that this was where we saw the batfish and not Old Volcano :).
Incredibly fun dives all around. The last dive at Tangub bay was pretty cold, but it was worth it.
Hay, I hope we can dive in May :).
2005-01-02
TSA experiences and impressions
That said though, I also have to say that, during my most recent trip to the U.S. (2002), I didn't really have anything to complain about. Things may be different now. Certainly I'd be severely bent out of joint if my name (or something similar to my name) were on a watchlist and I couldn't find a way to explain to the TSA that that was just someone else with my name. On the other hand, I doubt if there *is* anyone else out there with my name, so, unlike Senator Kennedy, I'm probably not going to have to ring up my (non-existent) high level friends to get my name off the list.
In any case, I didn't have any TSA problems at all when I was travelling. To be sure, I was flagged for the extra search just before boarding the plane at every single flight I was on. But I figured that was because of my age, gender, and country of origin. I thought it was kind of a stupidity to choose me, but they also choose little old ladies and 3 year old children, and I didn't mind much since I never missed any flights.
There's a lot of online and news ranting about rude TSA personnel, but I never encountered any of that. If anything, I was extremely impressed with the politeness of one older gentleman at Dulles airport. And everywhere else I found service pretty good. Of course, I don't feel the need to talk about bombs and chemicals and security stupidities in TSA lines. No doubt that helps. I'm sure that there are TSA stupidities that are due to rule inflexibility. But that's a general failing in the US, and it's not necessarily the TSA personnel's fault. Personal rudeness by TSA personnel is their own personal fault, but as I say, I've just never seen any of that.
Of course, the situation has changed a bit since I was last there. If (or when) I go to the US in a year or two, I won't be surprised to notice a few occasions of TSA rudeness, but I don't really expect to. I figure they're pretty rare. They just get blown up in the press (as they should be, so that individual abusive TSA personnel can get the sack, or at least reprimands).
2004-12-21
Reading Multiple GMail accounts using the computer user
It worked out that way (couldn't read bopolissimus.lists@gmail.com as tiger) since when I'd surf to www.gmail.com, the browser would notice that it already had a cookie for there and would identify itself with that cookie.
I just noticed that it *is* possible to open two different gmail accounts as the same (linux logged in) user. Firefox has a -P parameter (for profile). The solution is:
1. start firefox with the -P parameter. This allows you to create,edit,delete profiles.
2. create two profiles (or one profile for the other account, use the default profile
for the first account).
3. when starting firefox, specify which profile to use with -P
This isn't as big a deal as it might seem, since the normal thing to do would
be to create a launcher (shortcut) on the desktop. For the main account,
set the program to run as "firefox -P default", and for the other account,
set it to "firefox -P [whatever_the_other_profile_is]".
Netscape has always had that feature, as does mozilla, I think. I just never
used profiles before. Now it comes in handy though.
2004-12-18
Misc Articles
something worth passing on, but I rarely do. No time, lazy,
not online. http://www.jerrypournelle.com is a good source
for good articles and discussion.
Here's one. Not my country, don't care that much. One of
the things that I didn't like about life in the US though.
A Nation of Wimps
Focus on the first derivative