Skip to main content

Posts

Showing posts from June, 2006

Newspaper Design Algorithm

As I was mentioning in an earlier blog entry , the part of the FeedJournal project which I have been feeling most insecure about is how to design the algorithm for laying out the articles in the newspaper. This is a critical step for a number of reasons: it has to look like a newspaper, it has to read like a newspaper, and it has to be pretty (the output PDF is essentially a part of the FeedJournal GUI). Anyway, I am happy to report that significant progress have been in this area. I developed an algorithm which dynamically creates a newspaper with customizable: number of paragraphs margins paper size font spacing between rows and various article elements I have also implemented support for a headline font size which is a function of the article's importance/size . Together with the mas

SQL Server Strangeness

So I got up at 4:30 today in order to get some serious work done on FeedJournal before going to work or the baby wakes up. Well that was my plan at least. The first part went fine; I got out of bed, went for a short run and showered. By then the baby was awake though so I had to do some multitasking with one arm holding the baby, while the other hacking away at the keyboard. But that's actually much nicer than it sounds. Seriously. Pretty soon I run into problems with my SQL database that has been working flawlessly until now. Whenever I tried to connect to it I was thrown an SqlException: "Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed." At first I thought it was due to an incorrect connection string but everything seemed fine and the database was in the right location.

NP-Complete

I have been sick with the flu for the last week and still don't feel so great. For this reason the programming hasn't really proceeded as I expected. However, I have been doing a lot of thinking in my head about the database and class designs. As soon as I feel better I will work on laying out the PDF newspaper dynamically, which I realize will be a tough nut to crack. Basically the problem is related to the classic computer science problem of bin packing, which is NP-complete. NP-complete is a computer science term, standing for "non-determinis tic polynomial time". It basically means that there is no simple solution to the problem. My approach will be to take some shortcuts and make compromises so that the layout will be acceptable from a design viewpoint, while not digging myself into a hole with a too complex layout algorithm In the meantime, while w

.NET multithreading

FeedJournal , like any RSS aggregator, needs to be efficient when it is updating the list of subscribed feeds. It is obvious that a sequential polling of feeds (check each feed and proceed to the next after finishing with the previous) will be sub-optimal in terms of performance and user experience. The internet requests will need to occur in parallel for optimal performance. However, if your feed subscription list contains more than a trivial amount of feeds, you don't want to congest your Internet line with all of these request at the same time. IE7's RSS infrastructure calls this throttling, and it limits the number of concurrent web requests to 4. I don't see a reason to differ from this approach and implemented the same system. One of the great things about .NET 2.0 is the easy-to-use infrastructure for multithreading and thread synchronization . By just

FontDialog and Font Paths

One of FeedJournal's system requirements is to be able to customize the fonts in the PDF newspaper. Honesty I thought that this would be a piece of cake. But, I run into some problems... In the PDF file you can specify Type 1 and Type 2 fonts. Type 1 are common fonts, such as Courier, Helvetica and Times Roman. Adding these fonts are very straightforward since the PDF format supports them natively. However the difficulties begin when the user should be able to select any font. The Type 2 fonts have to be specified using an absolute path to the font (which can be either TrueType or OpenType). No problem right? Yeah, that's what I said yesterday too. I tried to simply add a FontDialog to my settings form. From the control I wanted to get the selected font's absolute path. No dice... No matter how hard I looked for the suitable property in the .NET's Font c

Project Management with ToDoList

Reading my fellow finalist Douglas Steen's entry about bug tracking tools, I am totally agreeing with him that it would be great to have a lightweight bug-tracking tool built into Express. Sure enough, we have the Task List pane where tasks can be sorted and having a priority but that's not really accomplishing anything substantial. Douglas chose a web-based bug tracking system and he mentioned another web-based system. Hunting the Internet will lead you to yet other web-based systems. Why does 99% of bug-tracking systems have to be run in the browser? I hate the browser: it is less responsive than a native Windows application as well as usually lacking a menu and having quirky keyboard support. Just because a system is multiuser doesn't mean that the browser is the only interface. The large advantage I see of using the browser is that no client softwa

The Feed Format Jungle

I have started the implementation of my project in C# Express Edition, and one of the first things I have stumbled upon is the frustration of having to deal with many different XML feed standards. There are RSS and Atom, each of them with several different sub-versions. But that's not all. We also have a slew of Internet cowboy hackers who don't have any desire at all to follow these standards. In short, RSS/Atom land is a jungle. Time to take out the machete! When researching the options of a suitable machete for the feed jungle, the following 3 caught my attention: Atom.NET + RSS.NET IP*Works Microsoft's RSS library , included in IE7 Rolling my own component based on .NET's XML support Atom.NET + RSS.NET These are two separate open-source libraries, implemented in C# .NET, which enables user

Ode to Visual Studio Express Edition

Using the Visual Studio Express editions to build a software product is a delight. I have been using Visual Studio for years, and can testify to the great quality of Microsoft's development tools. When asked about my favorite application all categories, I always answer VS. With the latest Express editions, Microsoft have outdone themselves again. Beside making the IDE available for free, there are many important new features in this package. My hands-down favorite feature must be the built-in refactoring support. I have been a huge fan of Martin Fowler's landbreaking book "Refactoring" , since its publication in 1999. Since I have been mainly developing in C/C++ during my development career, I have not had the privilege of using any refactoring tool professionally. (refactoring is dependent on reflection support, which is difficult to achieve, if not impossible,

Domain Names

OK, time to return to the blogosphere after my honeyweek with the baby. I have set up a web site at feedjournal.com where all things related to my project will be collected and presented. In the meantime I have put up some basic information together with the project goals. I bought the domain from GoDaddy.com , and it was a very straightforward process. feedjournal.com was actually not my first choice of product/domain name. I was initially having my eyes set on a different name but the .com name was taken. Or rather not taken, but parked, like almost all decent .com domains today. It's pretty frustrating to see that one after the other of all your candidate names are taken, and when you try the more esoteric names you find them taken as well. And then you try the really absurd names, and sure enough, none is available. Not that these domain names are in use, many