www.jlion.com

Thursday, January 24, 2008

Today I found a very cool open source project on SourceForge. iTextSharp is a DotNet 1.1 port of iText, which is a Java library for PDF creation. I found that it updates to VS2005 just fine and is very easy to use, at least for simple tasks (I'll let you know about more complex ones later on :)

Double kudos to those responsible for putting this great library together.

For example, creating a PDF document with iTextSharp is this easy:
Imports iTextSharp.text
Imports iTextSharp.text.pdf
Imports System.IO

Partial Class docs_PrintSurvey
Inherits System.Web.UI.Page

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim oDocument As New Document

Dim sFileName As String = "c:\inetpub\myapp\temp\test.pdf"
PdfWriter.GetInstance(oDocument, New FileStream(sFileName, IO.FileMode.Create))

oDocument.Open()
oDocument.Add(New Paragraph("Hello World!"))
oDocument.Close()

Response.Redirect("http://mypc:1770/myapp/temp/test.pdf")
End Sub
End Class

Monday, January 21, 2008


A few months ago, I bought an ATI Radeon 2600 Pro HD from New Egg.

The card worked as promised when delivered. It did not include a second HMI adapter, but I think most cards don't.

After three months though the cooling fan on the card suddenly became quite noisy. I took the heat sink off the card, and squirted a little wd-40 into the fan to see if I could get it to quiet down. With WD40 (or perhaps just unseating and reseating the heat-sink) the fan did seem quieter and after about an hour of continuous operation would settle into a low hum that was tolerable.

The fan noise was still annoying, especially in the first hour of operation, so I decided to see if I could find a replacement fan. What I found is that there is a thriving market for after-market video card heat sinks.

It seems that my 2600HD is at the current low end of accelerated video cards. While there are many different types and brands of heat sinks, few of them support the 2600. After much searching, I found the Artic Cooling Accelero S1 Rev. 2. This seemed like a good option for me as it did not include a fan and so should be very quiet. I ordered one from New Egg, but when I received it I realized that they had sent me the Rev 1 by mistake and that that what I had would not fit my 2600.



I returned the Accelero and instead purchased a Zalman VF900 - CU. While the VF900 - CU is not listed as a supported card for the Radeon 2600, Zalman's support forum does indicate that it will work, and the layout of the mounting bracket seemed to match up with the mounting holes on the ATI card.

The heat sink arrived a few days later. It looks great--very shiny and copper. I wish I had one of those windowed cases to show it off. It's pretty easy to install, and comes with eight additional stick on heat sinks for the video ram chips as well as a speed control to attach to the outside of the case.



It is quite large, though and does take up the slot adjacent to the video card.



I'd say that it probably took me about 30 minutes to get the heat sink installed, all inclusive. With the new heat sink and running at its lowest (~quietest) setting, the ATI control panel indicates that the video card is running around 5C cooler than it did with the stock heat sink. If I turn the fan up all the way, the CPU temperature seems to cool down as well.

While the VF900 is cool, it's also somewhat expensive. My lesson learned from this is that the next video card I buy will probably be an NVidia.

Tuesday, January 15, 2008

<rant>

1. News Flash: Large corporations are inhuman. Example: My wife purchased a few items on her infrequently used debit card totaling probably $150. Five days later she calls up Bank of America's customer service number. "How much money do I have available in my account?" she asks them, having forgotten about the prior purchases. They tell her she has around $200, so she uses the card to purchase a $175 item.

Now of course technically she should write all of her debit card purchases down in a ledger which she would balance after each purchase but she (and I too) thought that if she exceeded the amount of money available in her account while using a debit card, the debit card would fail to authorize due to insufficient funds. Not so.

Merchants submit their credit card charges in nightly batches, which are then posted by the bank during the next business day. If the merchant's bank is different than the consumer's bank, then additional time may pass while the two banks exchange info. This is what happened to my wife.

So a day or two after she made her final $175 purchase, the four prior purchases were posted. In quick succession she was charged four individual insufficient fund charges of $35 each for a total of $140 in bank charges.

Why do I think this is inhuman? Because the bank has the information. I can look at the internet page for my own debit card and see charges minutes after they are approved. They appear with a "pending" indicator to let me know that the charge is not yet final. I'll bet if I tried to go over my approved balance with my credit card that the charge would be declined.

I believe the bank is allowing those charges to go forward for the express purpose of collecting the insufficient fund fees, and while this may make good business sense for the bank it is antisocial behavior. It's also usurious because the stated purpose of the fees is to compensate the bank for incurred inconvenience--an inconvenience for which they are being very well compensated at $35/transaction.

In a world where I and my wife's business mattered to the bank they would not engage in such behavior--they would want to maintain a good relationship with us and with our friends and neighbors. But in today's world, we're all statistics. Goliath entities like Bank of America or Citibank would rather spend millions on re sculpting their corporate logos then on maintaining and improving relations with their existing customers.

The problem with unrestricted capitalism is that large corporations like Bank of America and Citibank are psychopathic and, without the helpful prodding of antitrust and other regulations, would soon merger their way into a single global monopoly.

Perhaps we can find some way to join a credit union.

2. Somebody's been sending around one of those viral emails claiming that Obama is a Muslim. He's not, but the idea that him being a Muslim would be a problem is offensive to me. To the person responsible for the email I say "get a life". There's a saying that goes something like this: Not all Republicans are xenophobes but all xenophobes are Republicans.

3. The TATA car company in India has announced a $2500 car. To me, the big news here is not that it costs $2500 but that it has a maximum speed of 50 mph. There are mothers who drive through our residential neighborhood at 50mph in their 175hp minivans, and some jerk went flying by me the other day in a 158hp Toyota Camry on the narrow two lane mountain road that I drive to work. So in my opinion less horsepower would be a very positive development for American cars. Too many Americans take out their pent up frustrations and anxieties via the gas pedal. A side benefit of less horsepower would be better gas mileage, which in turn would mean that Bush wouldn't have to work so hard to keep tensions in the Hormuz Strait at a peak.

</rant>


In other news, seven or eight years ago I had the pleasure of working with a very bright guy named Richard Wynn. Richard's final project for his MBA was a business venture for a company that would develop and place internet enabled grocery carts in grocery stores. He wasn't able to get funding for his idea, and he moved on. However, I was not surprised to see in today's SlashDot that Microsoft has seized on a very similar idea and will place media-enabled shopping cards in Safeway starting next year. It would be very cool if Richard were somehow involved in this project.




Thursday, January 10, 2008

I've been doing some work with windows mobile devices recently and I'm seeing what appears to be a big problem when programming for these devices in a manufacturing environment.

Where I'm working, these devices are used to scan material as it is moved from place to place within the factory, and they live a hard life subject to drops on hard concrete from high heights, scrunching between pallets, pulverizing beneath the wheels of forklifts, etc. This is to be expected and is not itself the issue.

Rather, because these devices have an indeterminate lifespan they sometimes have to be replaced. And when they are replaced, it is sometimes difficult to find an exact replacement. However, those scanners that are not destroyed in the line of duty frequently live to a ripe old age because ruggedized bar-code scanners with windows operating systems are expensive and it's difficult to justify obsoleting old equipment if the only issue is that the software is out of date.

So in our factory, we have windows mobile devices running a variety of operating systems ranging from Pocket PC 2002 to the latest version of Windows Mobile.

The challenge is to write applications such that they run on all of these plethora of operating systems versions, and it is indeed a challenge. It's made even more so by the fact that industrial windows-mobile scanning devices have extensions to support their integrated bar code scanners that do not exist in the Visual Studio windows mobile emulation environment.

The short of this is that I have three scanners on my desk now and am a bit frustrated that the environment that I'm working in (with all these different versions) prevents me from designing a more user friendly UI for my scanning application.

My present approach is to create the scanning applications as web pages. This is working for the moment as all of the versions of scanner that we have include some version of internet explorer. Of course, the versions of internet explorer included with the different flavors of windows mobile have varying levels of support for javascript. This, of course, just keeps things interesting. Wouldn't want my job to be boring now, would I?

A new New Year's resolution: I think I'm going to see if I can't think of some sort of ROI for obsoleting those old Pocket PC 2002 scanners.

Tuesday, January 08, 2008

Today I found this very interesting article on the life and work of St. Thomas Aquinas, including an overview of his works. In the article was a reference to the arabian philsophoer Averroes who was an arch-enemy of St. Thomas primarily because of Averroes' argument that philosophy occupies a higher stage of human development than theology. I'm thinking that St. Thomas' Summa theologica might make for some interesting reading.

Slashdot today asks the question: Should border agents be able to search laptops that are being brought into the country as they do luggage, and links to this article in the New York Times and this article in the International Herald Tribune.

I think the problem here is an economic one. As the authors of the articles remind us, business travelers often have information on their laptops that they do not wish widely disseminated but which is not criminal in nature. Making laptops subject to random search is likely to add an additional deterrent to companies interested in doing business with the United States, especially if there is a delay involved with the searches. Imagine an executive that flies from Milan to New York for a meeting, then has to wait two or three days for customs to examine his laptop. Will he be happy? Will the next meeting be in New York?

Too many people take the prosperity of the United States for granted. Sanctions, border security, excessive immigration controls all represent a burden on the back of our nation's business community. I think of Ayn Rand's "Atlas Shrugged". Will the Huckabees of the world succeed in bringing the country's engine to a stop?

Monday, January 07, 2008

I've just put together a little utility that uses the Microsoft Volume Shadow Copy service to copy PST files. This may seem a little esoteric but I'm feeling good. This has been something I've wanted to figure out now for a while and it turned out not actually to be anywhere nearly as much work as I had feared. I have posted the utility is posted on CodeProject.

I continue to read G.K. Chesterton's book about St. Thomas Aquinas. I'm finding the quality of the recording to be a little substandard--the volume seems to fade in and out so that it's sometimes hard to understand what the reader is saying. Also, Chesterton's liberal use of pun can be distracting, even sometimes annoying.

Wednesday, January 02, 2008

This just in from the "hand of God" department:

A drunk man driving his 1995 Jeep Cherokee on I-495 in Wilmington, DE hit a guardrail. He was thrown from his vehicle into oncoming traffic in the opposite lane. As he attempted to rise to his knees, a tractor trailer barreled down upon him. He was not injured, however. The tractor trailer passed over the prone man leaving him uninjured.

Police later cited him for drunken driving.

If I was him, I'd take this as a sign from above never to touch another drop.

---------------------------------------------------------------------------------

Due to circumstances beyond my control (the malfunctioning of the volume switch on my Creative Labs Zen V) I have not been able to complete my St. Thomas Aquinas book. Over the holidays, driven both by desperation and an unwillingness to buy another MP3 player, I did attempt to get my Zen to work by cracking open its tamper-proof case and unjamming the micro-switch that controls the "down" volume with an x-acto knife. For the moment, this seems to be working and I am again working my way through G. K. Chesterton's "The Dumb Ox".

I don't know why it didn't occur to me before, but this morning I decided to wikipedia St. Aquinias and found somewhat to my surprise that "Aquinas was declared patron of all Catholic educational establishments". I had no idea that St. Aquinas was so preeminent.

Wikipedia also mentions that "Many modern ethicists both within and outside the Catholic Church (notably Philippa Foot and Alasdair MacIntyre) have recently commented on the possible use of Aquinas's virtue ethics as a way of avoiding utilitarianism or Kantian deontology." I am looking forward very much to learning more about how this is so.

---------------------------------------------------------------------------------

This just in from the "why didn't I think to do this before?" department. In VS2005/ASP.NET, code-behind classes inherit the System.Web.UI.Page class. I have a small hoard of frequently used functions, constants, etc. that I have been pasting into pages on an as-needed basis. Code such as "Protected Const Q As String = Chr(34)" or the following function to side-step null values in data tables:
Private Function NullToString(ByVal oValue As Object) As String
If oValue Is System.DBNull.Value Then
Return ""
Else
Return oValue.ToString
End If
End Function
Well, it's quite easy to put this code in a reusable class which inherits System.Web.UI.Page then have the code behind pages this reuse class instead of System.Web.UI.Page. This is stone-cold simple and will save me a lot of time.

Tuesday, January 01, 2008

Happy new year!

A year is a long time to plan in advance, so here are my resolutions for the first quarter of the new year:

1) Get more exercise.
2) Find a way to get my kids up to Vermont more frequently.
3) Finish the next version of the survey tool, and get it integrated with speech server.
4) Get the user management tool working on SQL Express.

-------------------------------------------------------------------------------

More bad international news today, reinforcing my view that the world is going to hell in a handbasket.

Yes, I'm getting older. Didn't Churchill once say: "Show me a young Conservative and I'll show you someone with no heart. Show me an old Liberal and I'll show you someone with no brains." ?

In today's news, ethnic conflict in Kenya related to the upcoming elections and in Sudan the murder of an American State Department worker assigned to assist in relief efforts. I had begun to feel hope that a sort of Sudanese renaissance was under way, fueled by the triple threat of western support/relief for the Dafur conflict, Chinese demand for Sudanese oil, and the end of the Sudanese civil conflict. If Kenya falls though, then there goes the neighborhood. And then if there's evidence that the murder of the American aid worker was Al Queda related...?

-------------------------------------------------------------------------------

There's a magazine that arrives periodically in my mailbox called "Redmond - The independent voice of the Microsoft IT Community". The January issue had some very interesting tidbits related to open source development. It seems that Google employs many leading open source programmers.

To be fair, the article also mentions that Yahoo employs open source programmers as well, as it's no secret that IBM and Novell have both liberally supported open source technologies.

Google and Yahoo both extensively use open source technologies such as SAMBA and MYSQL.

This clears up one of my biggest questions about open source, which is: How can programmers afford to work on this stuff? Answer--in many cases open source does not represent not altruism by programmer, it's altruism by corporation.

So, since by definition corporations are pschopathic , why would Google, Yahoo, IBM, et. al, engage in altruistic behavior? If Google bases their search-engine infrastructure on hundreds of thousands of pcs running linux and mysql and matrixed together via samba, and is investing millions of dollars in tweaking these applications, then why share the tweaked software with potential competitors?

One answer: Microsoft. IBM does open source/linux because it's competing with Microsoft and there is a significant appeal for potential IBM customers in not being locked into a relationship with a specific vendor. Google a) doesn't want to pay for O/S licenses and SQL CALs for each of its hundreds of thousands of PCs, and b) likes being able to throw a significant land-mine (in the form of open source office) in the path of their most significant competitor. (Which, by the way, in Live Search has what is probably the most potent alternative to Google's search engine).

In the long term, what does this mean? Well, ladies and gentlemen, I think it means that most open source as practiced today is an anti-competitive technique akin to what would happen if Mobil opened a gas station across the street from Billy-Bob's fuel stop and service station and started giving away free gas. How long would that gas be free? Until Billy-Bob goes out of business, because Mobil is operating at a loss. So how long will these great open source projects be supported? Until Microsoft goes out of business. Fortunately, that doesn't appear to imminent threat and so we can all keep using great open source software for free for the foreseeable future.