Vinod Kurup

Hospitalist/programmer in search of the meaning of life

Jul 24, 2006 - 1 minute read - Comments - investing stocks

Bizjournal inaccuracy

Blair Corp, a company in my portfolio, announced second quarter earnings today. They were disappointing, but not as disappointing as reported by bizjournals.

“Blair Corp. swings to loss” is the title of the article. While dramatic, it’s completely wrong.

Blair Corp., a catalog clothing retailer and direct marketer, reported a loss in the second quarter as sales fell nearly 5 percent.

False. They reported a profit of $233,000 in the second quarter.

Blair said its second-quarter results were negatively impacted by the sale of its credit portfolio and last August’s stock buyback of 4.4 million shares.

Not true. The buyback doesn’t affect the operating results. If anything, they made the reported results look better than they really are. The stock buyback reduced the amount of outstanding shares by about one-half, so the reported earnings-per-share (EPS) results are about twice what they would have been without the buyback.

None of this is to deny the fact that Blair’s results were terrible and that the stock price has been even worse. I’m a little appeased by the fact that web sales increased by about 18% versus last quarter. Perhaps a few smart minds will start pursing the web angle as the wave of the future!

Jun 12, 2006 - 1 minute read - Comments - medicine magazine running

Doc on Board

Stop what you’re doing and go buy the July 2006 issue of Runner’s World. Flip to page 49 and read the fine article by Scott Douglas on things a runner should discuss with their physician.

Yep, the “Vinod Kurup” quoted is yours truly! I’m really grateful to Scott for using me as a source and thus making my dream of being in Runner’s World come true. :)

Here’s the online version of the article, but go check out the magazine because it’s, you know, much cooler.

Also check out Scott’s site for more interesting articles about running.

Comments from old site

Dr. Kurup

You are freaking amazing!

Unregistered Visitor 2006-07-09 17:05:45

May 16, 2006 - 3 minute read - Comments - programming tcl testing openacs

Automated Testing Rules

Automated testing is a good thing. For my running log application, I have a proc that creates a new log for a user, called rl::runner::new. If you happen to call it for a user who already has a log, it returns the already created log. When I created the proc way back when, I also created an automated test to make sure that creation worked and that redundant calls returned the orignal log.

Over time, I added some code to make sure that users are given proper permissions on their log. Anytime you make a change, you should run your tests, but of course, I didn’t :-) Well, today I did and my test now failed.

Here is the relevant (edited) code:

set runner_id [db_nextval acs_object_id_seq] 
set ret_val [db_exec_plsql new_runner {}]
permission::grant -party_id $user_id -object_id $runner_id -privilege admin
permission::grant -party_id $user_id -object_id $runner_id -privilege write

The error was happening in permission::grant. It was complaining that $runner_id wasn’t a valid acs_object. What’s going on? It looks like it should work. The problem is that I should be granting the permission on ret_val, not on runner_id. (Probably a bad choice of variable names). The first time a log is created, db_exec_plsql returns a value which happens to be the same as runner_id. The second time it’s called, it returns a value which is different and permission::grant fails.

I would never have caught this error until I tried to call rl::runner::new the second time on the same user. Which would make it one of those very difficult to track bugs. Automated testing saved me a lot of annoying debugging.

That said, I wish OpenACS’s testing facilities were better. I worked on a couple other bugs today and I’m trying really hard to write tests to expose bugs before fixing them, but it’s really a strain. Especially when you need to do a combination of black box and white box testing. I’d like to make testing easier in OpenACS, but I’m not sure if I have the brainpower :-)

Comments from old site

Improving Testing

Vinod,

There is definitely room for improvement. You can specify test dependency, I think, so you can create a test package environment, then run several tests using that setup. I haven't tried that yet, but it should help.

Anothing thing to keep in mind is that testing can expose places in your code that might need to be decoupled. That is one of the advantages of testing, by thinking of how to run the code is isolation in the test, you can discover a better design :)

Dave Bauer 2006-05-17 07:27:51

May 14, 2006 - 2 minute read - Comments - tcl programming

New Features coming in Tcl 8.5

I was looking at the Tcl 8.4 man page for ‘split’ and saw this example code:

## Split into fields on colons
set fields [split $rec ":"]
## Assign fields to variables and print some out...
lassign $fields userName password uid grp longName homeDir shell

It shows how to split a string using ‘:’ as the delimiter. The interesting part is the ‘lassign’ statement. I’d never seen that before. I’ve always done something annoying like this:

set fields [split $rec ":"]
set userName [lindex $fields 0]
set password [lindex $fields 1]
set uid [lindex $fields 2]
set grp [lindex $fields 3]
set longName [lindex $fields 4]
set homeDir [lindex $fields 5]
set shell [lindex $fields 6]

How could I have overlooked ‘lassign’ all these years? After berating my idiocy for a few minutes, I tried ‘lassign’ out and Tcl replied ‘invalid command name’ . Turns out I’m not as stupid as I thought. :-) ‘lassign’ is new in Tcl 8.5 (but seems to have snuck in the backdoor of the 8.4 docs). I decided to see what else was coming in 8.5.

  • Dictionaries. These are associative arrays which reportedly are better than Tcl arrays, but I’m not sure why.
  • ** as an exponentiation operator
  • Instead of doing: if {[lsearch -exact $list $item] != -1}, the new ‘in’ operator lets you do if {$item in $list}. There’s also a ‘ni’ operator for ‘not in’.
  • Plenty of other stuff, none of which really caught my eye.

Tcl 8.5 is still alpha, so I’m sticking with 8.4 (and my annoying code) for the moment.

Comments from old site

What about this

Or just do

foreach {userName password uid grp longName homeDir shell} [lrange fields 0 6] {break}
# We do an lrange here, otherwise values would be set wrong
# in case someone accidentally supplies a list with too many elements,
# because then the foreach loop would run more than once

I just learned the lrange trick yesterday :)

I got caught by the over-optimistic 8.4 docs as well. lassign remove the risk where you need to use the lrange call.

Dave Bauer 2006-05-14 19:56:49

Much better

The lrange trick is cleaner than my code. Thanks Dave!

Vinod Kurup 2006-05-15 20:42:37

Look also at OpenACS API

The 'util_unlist' API is the exact equivalent of 'lassign'.

Anonymous 2006-07-05 02:30:37

Thanks

Thanks - I didn't know about util_unlist. There are so many cool little-known functions in the OpenACS API

Vinod Kurup 2006-07-05 14:42:46

May 11, 2006 - 2 minute read - Comments - investing quarterly

Investment Update - May 2006

I sold 3 stocks (OUTL, MRINA.PK and KBALB) and bought 5 (RSC, JAX, EEI, KEYN and STS).

Sold stocks Purchased Total Return Reason for sell
Outlook Group ([OUTL](http://finance.yahoo.com/q?s=OUTL)) Feb 2005 67.65% OUTL is being acquired and taken private at $13.50 per share in a transaction scheduled to close sometime this summer. I decided to sell now at $13.20 rather than wait a few months for an extra 30 cents. The risk is that another acquirer might offer a higher price before the current deal closes. My gut says that won't happen.
McRae Industries ([MRINA.PK](http://finance.yahoo.com/q?s=MRINA.PK)) Nov 2005 -12.79% MRINA.PK purposefully delisted because they felt the costs of being a listed company were too expensive. Filing and reporting requirements have increased due to Sarbanes-Oxley legislation and this is taking a toll on a lot of small companies. I've made the decision not to hold delisted companies for a variety of reasons. They're less liquid, so it's harder to get in and out of them. They're subject to fewer reporting requirements, so it's harder to see how they are doing. Most importantly, my standard online sources of financial info don't have much data about delisted companies (Yahoo, Reuters).
Kimball International ([KBALB](http://finance.yahoo.com/q?s=KBALB)) Nov 2005 43.53% KBALB exceeded my market cap cutoff.

Here’s how the rest of my portfolio is doing as of April 30th, 2006.

Current Holdings Purchased Total Return (so far)
Deswell Industries ([DSWL](http://finance.yahoo.com/q?s=DSWL)) Sep 2004 -23.25%
Patrick Industries ([PATK](http://finance.yahoo.com/q?s=PATK)) Feb 2005 21.25%
All American Semiconductor ([SEMI](http://finance.yahoo.com/q?s=SEMI)) Feb 2005 -3.23%
Cobra Electronics ([COBR](http://finance.yahoo.com/q?s=COBR)) Feb 2005 54.08%
StarTek Inc.([SRT](http://finance.yahoo.com/q?s=SRT)) Aug 2005 65.70%
Blair Corp. ([BL](http://finance.yahoo.com/q?s=BL)) Aug 2005 -1.81%
Communication Systems Inc. ([JCS](http://finance.yahoo.com/q?s=JCS)) Aug 2005 15.13%
Champion Industries ([CHMP](http://finance.yahoo.com/q?s=CHMP)) Nov 2005 45.94%

May 4, 2006 - 1 minute read - Comments - new-york-city bronx food pizza restaurant-review

Louie and Ernie's

Louie and Ernie's Pizza Louie and Ernie's Pizza

We treated ourselves to our favorite New York Pizza today - Louie and Ernie’s. In my mind, it’s the perfect pizza. The thin crust is crispy on the bottom, and chewy on the top. There’s plenty of cheese and the sauce has some flavor. The only problem with this place is that it’s nowhere near public transportation and they don’t deliver. It’s probably a good thing though, or we’d be eating this ALL the time.

Apr 26, 2006 - 1 minute read - Comments - openacs

OpenACS in Linux Journal

Linux Journal featured an article about a web application written in OpenACS. It’s called Fungoes and it tabulates and formats baseball statistics. If I had access to this app when I was a kid, I would’ve been in heaven. I remember spending hours and hours memorizing stats from the back of baseball cards. I’ve forgotten most of what I memorized, but I can still rattle off HR stats for most of the 1982 Brewers. This site really takes me back.

Fungoes is still in it’s early stages, but Mat apparently has big plans for it. It should be fun to watch.

Apr 21, 2006 - 2 minute read - Comments - running programming tcl openacs software

Hit The Wall (a running log)

I built a web application to keep track of my running a couple years ago. I really began using it in earnest during my training for the New York Marathon last year. I’ve been meaning to make it available for others to use for a long time, but it always seemed like there was a little more work I needed to do on it. While working on it the other day, I noticed the original timestamp on one of the source files: September 21, 2003 Yikes! That’s 2 and a half years ago. Enough is enough — it’s time to let this baby free…

Hit The Wall is officially version 0.2 and available for free use by anyone who wants to keep track of their running. Feel free to look through my real log (read-only) or demorunner’s fake log (read-write) to try it out.

Comments from old site

Hit The Wall

Cool little tool Vinod, but after reading the reference on the Wall and how to avoid it I have some alternative names:

  • Don't Hit The Wall - A Running Log
  • Avoiding The Wall - A Runner's Log
  • Going Through Walls - Running Log
  • Etc.
Carl Blesius 2006-04-22 21:41:32

Thanks Carl

Good point. I just thought 'Hit The Wall' sounded catchy. And it works in the same vein as FSF's text pager being named 'less' (rather than 'more'). Get it? :-)

Most importantly, it's better than the previous name I had in mind, which was 'Running Log".

Vinod Kurup 2006-04-23 20:46:04

Apr 16, 2006 - 1 minute read - Comments - startup paul-graham friends ideas

How long will it take Gerry to find this post?

So, I just talked with one of my best friends and learned that he still doesn’t read my blog. Devastating! We had an interesting conversation about how the value of ‘The Great Idea’ can be overrated and I wanted to point him to this great essay about the same topic by Paul Graham. Let’s see how long it takes him to find it.

I enjoy most of Paul Graham’s writings. He writes about startups and software, aimed at the high school/college age geek. His writings would have been invaluable when I was in high school. Of course, he was probably in high school at the time. :-)

Comments from old site

MAAANNN

Why do you have to dis me electronically???

Gerald Cherayil 2006-04-21 12:10:10

Dog

Dis you? I was praising you - It means so much to me that you read my blog, I had to call you out!

Building readership... one guilt-trip at a time

Vinod Kurup 2006-04-21 12:37:51

Guilt trip

Well the guilt trip worked!! I will try and log in early and often!!

Gerald Cherayil 2006-04-24 12:16:39

Apr 10, 2006 - 1 minute read - Comments - family hawaii vacation

Big Island Hawai'i

We’re back from a week in paradise and have the photos to prove it. Thanks to Peary and Michelle for the warm hospitality in Honolulu. We thoroughly enjoyed every moment. The weather was perfect which was especially nice since it had rained for the 40 days prior to our arrival. Kalua pig is even better than it sounds.

Mala at Akaka Falls Mala at Akaka Falls

Oh yeah, and the conference was great too :-)