revjim.net

January, 2004:

Inklog: an IRC channel

Inklog now has an IRC channel to facilitate developer discussions. Join in on #inklog@irc.freenode.net.

BinaryCloud: a first look

I’ve been playing with BinaryCloud quite a bit over the past few days. Thanks to one of that project’s key developers, Jason, I’ve gotten pretty far. I can’t say I’m an expert in all things BinaryCloud. Not by any means. But, I’d like to offer my first impressions. Please keep in mind that my first impressions may not be accurate, as I have yet to fully understand how everything within BinaryCloud functions.

First of all, I’d like to state that I think this project is populated with some of the most advanced PHP developers I’ve met to date. The structure of the code, and the thought put into how it works is highly advanced. It’s refreshing to know that such developers exist in the PHP world. I’ve known that such developers must exist, or all of the new features in PHP5 wouldn’t have ever been asked for, let alone considered and implemented. However, before now, I had never met any of them.

BinaryCloud is a great framework. Completely object oriented, it takes a child/parent approach to page development. What this means, essentially, is that components, known as Nodes, can be integrated into a single page which promotes code reuse and simplicity in design. Imagine, for a second, your corporate website. The front page, despite what’s on it, almost always has some form of BreadCrumbs (the display widget that tells you where in the site you are) and also some form of Navigation (the display widget that tells you where you can go from here). In most cases, for every application that exists, these widgets are reimplemented because users desire to see them. With BinaryCloud, this type of thing becomes a breeze. First, you make your FrontPage object. It does… well… whatever you want the front page of the site to do. Then, in the definition of that node, you add two children, a BreadCrumbs object and a SideBarNavigation object, for instance. Through some hefty recursion, each of these children are built and rendered according to their own templates and made available to the template of the FrontPage. I think that it’s instantly obvious what kind of power and flexibility this affords the developer.

Couple that core functionality with an outstanding set of support libraries, a Storage abstraction and Authentication feature (both which I have yet to explore) and you find yourself with a very feature rich framework that forces separation of code and layout (and layout logic) and provides the developer with a straightforward method for simple code reuse and flexibility.

Despite all this, I think there are some things holding BinaryCloud back. The first of which is the method with which Nodes are defined. With BinaryCloud, in order to define a node, its children and propertys, you must create an NDF or Node Definition File(?). This NDF is straightforward and is in XML, which I think is a great choice. Unfortunately, BinaryCloud doesn’t actually read NDF. Instead, it relys on its build tool, Phing, to compile this NDF into native PHP code when the application is built (or "Phung" as it is known). Because of this reliance on Phing, when writing a BinaryCloud application, you have only three choices: 1) write the PHP code by hand, which can be cumbersome, 2) author an NDF and use Phing as your build tool, or 3) author an NDF and compile the NDF to PHP manually. This is a problem. First of all, if authoring the PHP code by hand were as straightforward as it sounds, there would be no need for the NDF to begin with. It’s not. And having to either use Phing or compile the NDF manually in order to deploy code is less than desirable. I like Phing. I think it’s a great package. But, just as in the "C" world, simply because my library is built using "make", that doesn’t mean I also have to use make to build my application that uses this library.

BinaryCloud also relys on Phing to handle internationalization. This practice seems a bit weird in use. What happens, as best as I can tell, is that, for each language you choose for your app to support, Phing does String Replacement (using some classes from BC) to create different versions of BC for each language that is desired. However, this doesn’t seem to be the way it should be. BinaryCloud should be capable of handling internationalization from within itself without the need for a different version of itself for each language.

With this being said, I think that BinaryCloud would benefit greatly with the following changes:

BinaryCloud requires NDF. Therefore BinaryCloud should read NDF.. The developers claim that they found that compiling the NDF at runtime was too expensive and required too much time. And I’m sure I would agree with them. However, there are other methods. Consider how Smarty handles compiling its template files. The first thing it does it look to see if it’s been compiled already. If not, it compiles the template and caches the compiled version. If it has, it checks the timestamp on the compiled version and compares it to the timestamp on the non-compiled version. If the non-compiled version is newer, it recompiles and recaches. Additionally, in order to save that "stat" call required to check the modification time on the non-compiled version, you can tell Smarty to run in a mode that only compiles a template if it hasn’t been compiled already, and it doesn’t check the modification time of the source file. It seems that if BinaryCloud adopted this concept for handling NDF, execution time would only really increase in the event that the source file had been modified.

BinaryCloud requires applications written in it to use its build tool. This defeats the live editing that PHP developers know and love. PHP has its strengths and weaknesses. Its weaknesses should be corrected. Its strengths should be praised and exploited at every opportunity. Being able to edit live code without the need to compile is one of these strong points. While I like Phing and what it is capable of, I should not be required to use it. Additionally, despite whether I use it or not, I should not lose my ability to edit code live and package later. BinaryCloud should have a Phing target called "library-only". By calling Phing with this target, BinaryCloud would be installed into a common location, properly configured, and ready for inclusion from any PHP page despite the build tool, if any, that was used to get it there.

BinaryCloud uses Phing to handle internationalization. This should be a feature of BinaryCloud that doesn’t require Phing to operate correctly. Phing is simply using String Replacement to handle this task. And, for the most part, it is only used for Exception messages. If the translation were handled dynamically in the Exception routines, this requirement would be removed and the system would become more flexible. Sure, this means the exception routine will take a bit longer to complete (as it will have to perform translation), but… this is an exception… not the rule. Therefore, if a few extra seconds are spent handling this whenever there happens to be an exception, that shouldn’t be a problem. However, this does mean that in one case, and in one case only, an Exception message might be displayed in a "default" language. In the event that an Exception is generated and a translation cannot be found for it, a "CannotFindTranslation" exception should be generated. If THAT exception cannot find a translation, and ONLY then, that message will have to appear in a default hardcoded language. However, this same thing would have occured with the Phing build process. The only difference would have been that it would be Phing generating the error and not a run-time exception from within the app.

I think that, with these modifications, BinaryCloud will be easier to understand by new developers, and more flexible in the long run. As always, I’d love to hear comments, corrections, or new suggestions. And of course, since I really don’t know much about BinaryCloud, if any of this information is inaccurate, please let me know.

Phing: a build tool for PHP

Phing is a build tool for PHP. Much like Ant for Java, it is a tool to allow a more precise, more automated method of taking a source tree and deploying into a position where it can be run. This is a problem that plagues PHP application developers constantly. Every application you download has different instructions, different ways of setting up the TarBall filesystem, and each of them requires a little bit of fussing with this or that in order to get it up and running. Phing aims to be the "make" of the PHP world. And it seems to be doing pretty well. It’s very flexible, and seems to be fairly straight forward. However, it does pose a problem.

PHP developers, myself included, are very used to being able to edit code live, should they choose to do so. They are also very used to just tarring up the document root and calling it a "package". Using "Phing" as your make tool requires a little more thought. First of all, instead of having a "config file" as your method of configuring an application, the build tool will handle most of the configuration by looking at a set of properties that you’ve established for your server. By using token substitution, an m4 style configuration approach occurs. Additionally, the application is internationalized by string substituion performed by the build tool.

All of this sounds good but I think it may be too much. Internationalization is great, but I really don’t want my build tool to handle trying to figure out which language I want certain portions of whatever to be represented in. Token and string substituion can easily happen at runtime. The only exception to this is that, at runtime, if the internationalization handling can’t represent a proper translation, and can’t translate that fact properly either, the resulting error will have to be represented in a default language. However, this isn’t much different than what the build tool would do because, if the build tool can’t make the substitution you’re requesting, it’s going to fail and announce that fact in a default language anyway.

One of the primary reasons Phing was developed was to assist in the deployment of applications written in the BinaryCloud framework. Though I wasn’t around when those choices were being made, it seems as though, what they were really looking for was a way to convert an XML description file into native PHP code in order to save the application from parsing XML on every call. This eventually led into creating Phing. I, however, think that a "build" process shouldn’t be utilized for this purpose. I believe that such a translation belongs within the application and should be handled within a compile phase of the application itself, and not in its build tool. "Make" exists because attempting to compile a large C package file by file, library by library would take forever. On the other hand, PHP does not need compilation. If the files that support a particular application need work performed on them before they can be used, this should be handled by the application.

I feel that the only part of "make" that PHP needs is "make install". And Phing is certainly capable of performing "make install". But, then again, so is "make". However, having a native make tool for PHP is a nice feature, and it affords portability that "make" does not. Therefore, all in all, I think Phing is a great project and that it fills a nice little hole in the PHP software line. I just wish the BinaryCloud didn’t rely on it so heavily.

If you’d like to play with Phing, you may find their website a bit disappointing if you’re not running PHP5. Unfortunately, the website only has PHP5 versions of the code available. But, by visiting the BinaryCloud site at Tigris and visiting the CVS repository, under "r3/phing" a PHP4 version of the code can be found.

Meeting a Mortgage Broker

Jess and I met with a mortgage broker last night and now I realize that I’m in over my head. He seemed like a nice guy. Unfortunately, he had a weird way of talking in circles around my questions. For instance, I told him that I didn’t know how much house I could afford and that I had guessed at $150,000. I told him that I’d like a rough estimate regarding what that would amount to in out-of-pocket expenses every month so that I could decide if that was a good price point for us. Instead of answering my question, he simply told me that, based on my salary, debt, and credit rating, I could afford a lot more home. Regardless of how I posed the question, I was met with the same answer. However, as we went further into our talk, he eventually showed me a piece of paper (a "Good Faith estimate", I believe it was called) that showed a $150,000 house at 6.25% interest for about $1,450/mo (which included home owners insurance, and property taxes).

He had us sign about 30 sheets of paper. It seemed a bit odd to me, because all of the pages that required a property address had "TBD" written in. I didn’t understand why he would have us sign paperwork that would eventually have to be reprinted and resigned.

The issue of down payment was also a bit odd. After he factored in closing costs, his 1% loan origination fee, private mortgage insurance, and a down payment we were looking at just under $11,000. However, he then went on for about 15 minutes about how, because we were probably getting an FHA loan, the seller would be required to pay the "non-allowables". I asked him what would happen if the seller were unwilling to pay these costs and he told me that, in that case, I wouldn’t be able to get an FHA loan. However, he also mentioned that, with this loan, the seller was allowed to pay $9,000. It was all a bit confusing to me. It seemed a lot like what car dealers do when you have a trade in. "Sure we’ll give you more for your trade-in, as long as you pay more for this new car". Essentially, he was saying that, in many cases, the seller can, instead of selling me a house for, say, $100,000 and paying nothing, they will agree to sell me the house for $101,000 and pay $1,000. It just seemed silly. Then he mentioned that an "educated" seller might not be willing to do this, but I couldn’t figure out why it really mattered and he couldn’t explain it to me in a way that I understood.

He said that, if we were planning on ending our current lease on September 31st of this year, that we should plan on closing on the house around August 31st. This meant that somewhere between July 15th and July 31st, we should sign a contract. I had a hard time figuring out what this "contract" was, but I did understand that it is NOT the offer that we put on the house. The "contract" comes after we put in an offer and it is accepted. Then we sign a "contract". Then they work on getting the loan, then we close. According to him, the process between signing a contract and actually getting a loan takes about 30 days. He said that it’ll take us a month or so to find the house we want, on average, and, therefore, we should start looking around June 1st. And, because of that, we need to sign the papers to get approved around May 15th. I’m not sure what the difference is between the stuff we sign on May 15th and the "contract", but, when we sign the stuff on May 15th, we have to bring W2s, and Tax returns, and paystubs, and a $99 loan commitment fee.

We signed all sorts of papers that all sorts of dollar amounts on them. Disclosure statements showing us other loans that were available. Disclosure statments about what the details of this particular loan are. Truth in Lending statements that show that our loan will be 6.25% fixed for 30 years and that the loan can (and will, in this case) be sold to other parties.

The biggest thing that I didn’t understand was why we had to sign so many papers now if he wasn’t even going to start the approval process until May 15th when we brought him all of the income proof and our $99. He said that the date sensitive paperwork is good for 90 days (not enough to last until May) and that some of the other stuff is good for longer and that, more than anything, he was making us familiar with the paperwork involved so that, when we were ready to go, he could simply mail us documents instead of requiring us to come in so he could explain them all. This seemed understandable, yet still a bit odd.

He did say that my credit looked pretty good. I wasn’t good enough to get what he called an "a-paper loan", but he felt that if I fixed one small bug in my credit, that it would put my score over 620, which, then, would be good enough for this "a-paper loan". Experian is what he pulled (and the only one I had a hard time pulling myself). Apparently, Sprint PCS thinks I owe them $170 from a million years ago. He said clearing that off my credit report will help a lot.

So, all in all, I’m optimistic. $1,450/mo is a good price point for us. We could even go a bit higher, which means that we can be a little more flexible in what we are looking for. I’m going to need the $11,000 worth of stuff explained to me again. And I’m going to need to understand this business with the "seller" paying part of the cost of the house. He also mentioned that, if I didn’t like the 1% loan origination fee, that could be done away with by simply increasing the interest rate. If the loan origination fee is what HE gets paid for brokering the mortgage, I’m not sure I understand how a higher interest rate will get him his money. Additionally, there were long lists of fees that were incorporated into the $11,000. Most of which he claimed were charged by others (title company, appraisal company, etc) and were not charged by him or the lender. But, I had to take his word on that.

So, at this point, we’ve signed a bunch of paper work, and spent 2 hours in a mortgage broker’s office just to find out three simple facts: 1) my credit is good, but not great. 2) We can get an interest rate of 6.25%. 3) A $150,000 house will cost us roughly $1,450/mo with $4,500 down and the seller paying about $1,200 (which doesn’t add up to $11,000… but… whatever).

Nikon D70: first look

As I told you before, Nikon is planning to release a Sub-$1000 digital SLR, the Nikon D70, to compete with cameras like the Canon Digital Rebel 300D. Dpreview has some more information as well as some images of what the camera might look like.

The gist of it seems to be this: unlike Canon, Nikon doesn’t seem to be purposely crippling the software in the camera in order to make it less appealing to professionals who don’t need something as rugged or as fast as those on Nikon’s professional line. This is a sigh of relief. While the crippling that Canon has done to the 300D isn’t that bad, it still is a bit upsetting to think of a manufacturer making a camera do less on purpose. And, of course, this camera will share the same "F" lens mount as the rest of the Nikon line just as they have since… forever. This means that any Nikon lens ever made will work with this camera. Well, almost. Just like with the Nikon D100, there are certain features that don’t work with certain lenses. And, of course, if the lens doesn’t support a feature (like AutoFocus, for instance) then the camera certianly can’t do it. But, as best as I can tell, any lens that would work on the D100 will work on the D70 in the same manner.

It uses a 6.24MP sensor. Most likely the same one in the Nikon D100. It has a 1.5x multiplier, just like the D100. Again, like the D100, it supports ISO 200 – 6400. 30" to 1/8000" shutter speed with Bulb setting. It takes Compact Flash memory and does not come with a card. It supports flash compensation, which the 300D does not. I haven’t seen any information on top FPS.

You should also read what Matt has to say about it.

Attention Inklog hackers!

I’ve compiled a TODO list of what Inklog needs before version 1 can be released. If you’re interested in helping code this monster, take a look at this list and let me know what you want to work on.

(I submitted this project to Freshmeat today, in order to enlist new developers. But, Freshmeat doesn’t seem to be publishing my announcement.)

Inklog Wiki

Inklog has its own Wiki now.

Inklog API docs

The Inklog API is documented. Well, it’s not fully documented, but, thanks to PHPdoc, you can at least browse the object structure and understand what goes where a little easier.

BinaryCloud

BinaryCloud looks like it might be an incredible framework for PHP. It’s been around for a few years and the mailing list seems to be pretty active. But I can’t find any REAL documentaion or a sample application ANYWHERE.

Oh well.

angry, frustrated, and alone

I’m sick with anger — self-directed anger. I am finding myself unable, or unwilling to accomplish tasks that I feel I would have once been able to. I can’t concentrate. I can’t focus. I can’t solve problems. Regardless of how hard I try, or how much thought I put into the problem, it seems that, within minutes, I find myself stuck again. At first, I’m inclined to believe that there is no solution to the problem. But, as time goes on and frustration passes, I find that there is a solution. I breathe deeply. I excuse myself. I start again. Only to find another problem that seems to be without solution.

This is frustrating and I don’t like it.