Beginning Fedora Introduction on YouTube

270 days ago
tags:

Shashank Sharma, co-author of “Beginning Fedora: From Novice to Professional“, wrote this morning to point me to a YouTube video he’s put together to introduce prospective readers to the book. It’s a really fascinating use of YouTube as an interesting mechanism for product promotion, well worth viewing:

Watch the video



Programming with Configuration Files

308 days ago
tags: , , ,

Recently I was working on developing an application that required a configuration file to setup. I considered several options for the file, keep it in the native language (PHP), make it plain-text or use XML. I didn’t like any of the options because the configuration has to be approved by certain stakeholders of the data at various stages throughout the life of the application.

XML is too hard to read for management-types. Plain text wasn’t all that easy to handle from a code perspective. I could have used a native language configuration file that read more like plain text (mostly comments, few directives, etc), but still was not liking it.

Then I remembered that when I played with Ruby on Rails it used something called YAML, and thought I’d give that go. It didn’t take too long at all to get the hang of writing the syntax for YAML. I then needed to find a way to process it with PHP. I found a few.

I started with the top entry on a Google search for PHP YAML. I found spyc, which is a very simple YAML class for PHP. I also found Syck, which is apparently more widely used and ported to several languages (although Ruby looks to be the primary focus). But I decided to download spyc, which appeared to geared toward PHP, gave it a whirl and instantly had what I needed. I liked it so much, I packaged it up for Fedora. I should probably also mention that I looked at JSON, but found YAML to be more complete and easier to read for what I needed to do. JSON is cool though in that it is a subset of YAML for the most part and works nicely with Python.