June 28, 2009

Web Service for Document Conversion – an Odyssey

Filed under: .Net,PHP,Programming,T3city — pj @ 2:02 pm

A couple of years ago, I needed a way to convert Microsoft Word documents to Pdf from a C# program. The application I was working on processed hundreds of documents and was run by the system scheduler every day at around 3am, so manual conversion was not an option. I wasn’t in control of the source documents, so I had to accept the documents the way they were given to me. I needed to do additional processing on the documents, so I wanted to convert them into a universal format. I already had a good library for reading Pdf files. After researching my options, I settled on using OpenOffice to do the conversion. OpenOffice has a pretty good Word filter, the ability to create Pdfs and an automation interface accessible to all .Net languages, including C#, so it was a good fit. I know there are commercial solutions and ways to automate Microsoft Office, but the OpenOffice solution was free and fairly easy to use.

Recently, I upgraded my development system from OpenOffice 2.x to OpenOffice 3.1. I can’t remember now the main reason I upgraded, but I was looking forward to being able to add the ability to convert docx to pdf (Office Open XML support was added in OpenOffice 3.x). I figured the upgrade might require some minor changes to my document conversion code, but it turned out not to be so simple.

March 26, 2009


Filed under: .Net,C++,PHP,Programming — pj @ 11:06 pm

What is an Integrated Development Environment (IDE)? For sure “IDE” means different things to different programmers. Some probably think an integrated GUI form editor or WYSIWYG HTML editor is critical. Others may think that the most important parts of an IDE are the text editor and code browser. Others still judge IDEs by their code “refactoring” tools.

For me, the IDE goes back to the days of Borland’s Turbo Pascal and Turbo C. They didn’t have GUIs much less GUI form editors, HTML wasn’t yet invented and I don’t remember the text editor being anything special. What turned them into IDEs was the super efficient work flow… A typical “Hello World” program was mostly a matter of typing in some code and pressing the Run key. If you wanted to debug, you would set your breakpoints right in the editor, then press the Debug key to start your program under the integrated debugger. (more…)

August 23, 2007

Web Page Layouts: Flow (fluid/liquid) vs. Fixed

Filed under: .Net,PHP — pj @ 7:23 am

For web site designs, I like a simple, clean look. I also favor a flow (also called fluid or liquid) page layout with no big margins wasting space around the edges. These things make sense to me on a technical basis and I like the aesthetics and usability of these kinds of sites. However, they don’t always lead to the most pleasing look for some tastes.

Here is an article I found interesting: http://politics.slashdot.org/article.pl?sid=07/02/25/1935215

Notice how the high brow, traditional designers favor fixed width layouts with lots of wasted space in the margins. Every single one of these sites is fixed width. Most have top and bottom margins – a waste of valuable screen real estate, IMO

August 18, 2007

Simple Tracing and Logging for Asp.Net and .Net Command Line Applications

Filed under: .Net,C++,PHP,Programming — pj @ 12:51 am

From time to time, I need some quick and dirty logging in my .Net applications.  I don’t always have time or energy to worry about the ideal logging API. The MSDN documentation and all the examples I found for the built-in .Net logging facilities were confusing and, it turns out, overkill.

Logging in Asp.Net

Logging in Asp.Net is confusing because Microsoft uses the word “trace” in two different contexts: (more…)

Logging for Services, GUI and Command Line Applications

Filed under: .Net,C++,PHP,Programming — pj @ 12:50 am

This is the first is a series of articles about logging. In this first article, I will describe what I believe is a simple, yet useful logging API. In later articles, I’ll give some hands on practical advise. As I continue the series, I’ll add links to the new articles here:

Wow, some programmers go crazy about logging.  Do a Google search for “.net logging” and you’ll see what I mean. Some of these libraries are huge.  While some applications may really need all the complexity these libraries offer, I have seen it severely abused on more than one occasion. Crank up a copy of Blackberry Enterprise Server (BES) and let it run for a week or two. You’ll find your Windows Event Viewer overflowing with all types of mysterious, confusing and generally useless messages.  In addition to the constant Event Viewer spew, if you let BES run unattended, you’ll eventually find that your BES hard drive is literally overflowing with many different log files all with obscure names and even more obscure contents.  Exchange Server has a similar problem where some logging is done in Event Viewer, other logging is done to text files. And none of the Exchange Server logging options ever seems to enable the simple email flow messages you need for common day to day administration tasks that I take for granted on our Linux email servers.

Is all this really necessary? (more…)

March 13, 2007

Switching from PayflowPro to PayPal Website Payments Pro

Filed under: .Net,PHP,Programming,T3city — pj @ 10:32 pm

Way back in 1996 I created an e-commerce web site for a small software company I owned. The system allowed customers to purchase and download software our web site. To make the system appealing and easy to use for buyers, we processed credit cards automatically. Back then, there were no Internet credit card processing gateways, but I was able to purchase some rather expensive software that allowed my computer to emulate a credit card terminal. The software used the computer’s modem to call a modem bank at the credit card processor and complete the transaction. There was a way to automate the software via text files and command lines and that’s what I did. It was slow, but it worked.

Eventually, my credit card processor teamed up with one of the first companies to offer an Internet credit card processing gateway, Cybercash. I hopped on board as one of the first customers. (more…)

February 16, 2007

readme.txt vs. readme.html

Filed under: .Net,PHP,Programming — pj @ 6:53 pm

I’m mulling over the idea of publishing some of the development tools I’ve created. For right now, I’m just looking for a simple way to allow “friends and family” to see my notes and source code for a few key projects. I don’t think many people on my list will have the time and energy to download and compile stuff (unless it’s something they happen to need right away). I personally like to kick the tires of interesting projects around a bit first by browsing the source code.  So, what I have in mind is a web interface to a Subversion source code control repository. The idea of browsing my project folders via the web brings up the idea of using readme.html files. I’ve considered this idea more than once in the past. (more…)

February 15, 2007

“Green Address Bar” SSL Certificates

Filed under: .Net,Networking,PHP,T3city — pj @ 8:02 pm

I’ve written other places about SSL certificates. Once upon a time, you bought your SSL certificates from either Verisign or Thawte. Back then, all (both) SSL Certificate Authorities (CAs) did some real validation on the entity (business or person) that was applying for the SSL cert. To validate the entity, they did things like review corporate records to make sure addresses matched, looked up phone numbers in public directories and matched drivers licenses to domain registrations.

I can understand why they wanted a bit of money for the work that was required for validation that first year, but overall, SSL certificates have long been overpriced for the value they provide. After that first validation, the next year’s renewal costs the CA practically nothing, but they used to give no renewal discounts at all and, even now, renewal discounts don’t exist and multi-year discounts are not as substantial as they could (should?) be. (more…)

February 9, 2007

Linux vs. Windows for Web Hosting

Filed under: .Net,PHP,T3city — pj @ 3:19 am

A lot of people think I’m an Linux/open source bigot. That’s not true at all. I do love Linux and open source. As a programmer, I dig the ability to “use the source, Luke”. Not only is looking at source code interesting on its own (at least for some of us), but every now and then it really helps with debugging and troubleshooting. Linux Servers are simply better than Windows Servers for a lot of the hosting I do, so I learned how to host on Linux. Back in the days of Windows NT, there was no comparison – our Linux web servers ran heavily loaded for years at a time while Windows NT systems with more than one web site needed regular reboots – really, I’m not making it up. (more…)

November 28, 2006

PHP guestbook for abbeyroadontheriver.com

Filed under: PHP,Programming,T3city — pj @ 12:20 am

When T3city took over the hosting for abbeyroadontheriver.com, they had a guestbook on their web site. Their old host used what appeared to be a custom guestbook written in Cold Fusion. We don’t support Cold Fusion and I figured I could find something better in PHP, anyway. I found and installed the Purple Yin Guestbook. The PYG script worked well for some time. At some point, though, their guestbook (and guestbooks all over the Internet) got hit by bots (autonomous programs) created by spammers to post in guestbooks. Because the posts were automated, there were many of them. Eventually, abbeyroadontheriver.com’s owner, Gary, called and we discussed the spam problem. I decided to upgrade to the latest version of PYG. This new version supported captcha images. Gary asked to only use one random digit for the captcha image. This stopped the spam right away. Unfortunately, there were a lot of spam entries to clean up, but Gary worked on this as time allowed.

A couple of weeks ago, Gary started having more problems with his guestbook. It was slow and, more importantly, it wasn’t taking new posts. After some digging around, I found out that it was slow because PYG stored all the entries in a simple text file. THis is OK (and maybe ideal) for a guestbook with a few posts. Gary’s guestbook is active and covers several years. Also, there were still a fair number of spam posts that were not visible (Gary’s guestbook is moderated), but still in the text file. Altogether, Gary has over 3000 posts in his guestbook. (more…)

Powered by Teztech