Wednesday, January 12, 2011

Thinking in a recursive mood

A colleague issued me a lunch-time challenge today: Write a program to detect palindromes. After a few minutes of thought, I wrote a small program that used a single function to detect palindromes. It is a very functional-programming design, looking like this:

func bool IsPalindrome(s)

return true if (s.length < 2)

return IsPalindrome(s.substring(1, s.length - 1) if s[0] == s[-1]

return false

end

No looping! All objects are immutable!

What surprised me is that I thought of this solution quickly, and without thinking specifically about functional programming. It came to me, rather than me sitting down and deliberately looking for a function-programming solution.

Sunday, January 9, 2011

Beehive for co-working

The Baltimore Beehive (http://beehivebaltimore.org/) is considering night-owl hours. This solves a number of problems. I plan on attending.

In other news, I attempted to set up NFS on //ophelia, a Dell GX280 running SuSE Linux 11.0. I'm almost there -- I have the NFS daemons installed and configured, and other systems can see it, but they cannot write to the directory.

Saturday, January 8, 2011

Because learning never stops

I'm planning to attend four conferences this year: three for software and one for science fiction.

The software conferences are: OSCON, Open Source Bridge, and the Central PA Open Source conference. The science fiction con is BaltiCon, and it is more of a writer's convention than science fiction convention.

I've looked at the costs, and I think that I can swing all of these. Of course, I plan to use my tricks for minimizing the cost of conferences. Those tricks are:

- Plan ahead
- Register early (and get reduced, early-bird rates)
- Use 'alumni' discounts, if available (O'Reilly conferences usually offer them)
- Book travel early (and get reduced fares)
- Use public transit (to avoid car rental and parking fees)

OSCON is in July, OSB is in June, CPOSC is in October, and BaltiCon is at the end of May.

Why attend conferences? Three reasons:

- Learn new things (or at least learn that there are new things)
- Get away from the daily routine
- Meet smart, interesting people

Learning never stops. We can always learn, always do something new.

Tuesday, January 4, 2011

.NET meeting

I attended the CMAP meeting tonight. The presentation was a group of speakers talking about tips for .NET development. The major topics were jQuery, an Extension loader for Visual Studio, and Silverlight. More interesting were the side conversations with people. One convo was about the format of XLS and XLSX files!

Monday, January 3, 2011

Fun with network shares

This past week-end I had quite the fun with network shares. I configured several Linux systems to auto-mount an NFS shared directory on another PC. I configured Ubuntu Linux, Kubuntu Linux, and Xubuntu Linux. On each system, I made a mistake, and had to check my work. What was nice was that I made different mistakes on the different systems. We learn from our mistakes, so I learned a lot!

And now all three systems are working with the shared directory.

Sunday, January 2, 2011

A little bit of fun

For fun, I wrote a little class in C# to handle arithmetic with significant figures. This is one of my goals for the new year. (I'm already getting one of them done! Wow, I am productive!)

I used Visual Studio Express for C#, which is simpler than the full Visual Studio package yet powerful enough to handle this task. The Express edition works almost identically to the Professional edition, so I was familiar with the environment.

The solution consists of a small class to handle the arithmetic and a small program to invoke the class. I don't have any test cases; I want to create some as I am uncomfortable working without them.

But the class does what it is supposed to do. The result of 1000 (1 sig-fig) plus 20 is 1000, not 1020 as one would expect. The answer should be 1000 since you must keep the number of significant figures at 1 and not expand it. Which means that 1000 plus 200 is also 1000, and 1000 + 200 + 200 + 200 + 200 + 200 is still 1000 although 200 + 200 + 200 + 200 + 200 + 1000 results in 2000, since the '200' amounts add up to 1000 and then the second 1000 yields 2000.

Leaving the oddities of sig-fig math, and coming back to programming, it was a fun project. Now perhaps I will port the solution to a few other languages.

Saturday, January 1, 2011

Looking forward

As a contractor, I must serve two masters: the client of today and the client of tomorrow. I recognize that there are no guarantees for the length of any contract, and I must be prepared for a new client. That preparation includes keeping abreast of current technologies. (It also includes connections and business relationships, but that is for another time.)

The turn of the year is a good reminder to look ahead and identify technologies and skills to learn. Here's my list for 2011:

- Functional programming languages
- Dynamic programming languages
- Virtualization
- Programming for Mac OSX
- Conferences
- Cloud computing
- Fun projects that aren't necessarily client-based

First, programming languages. I'm convinced that functional programming will be the new big thing, replacing object-oriented programming. I've already started by using Haskell on my home PC. I also have a few old projects with Ruby, and I want to re-start them.

Virtualization has been a challenge for me, mostly due to hardware. My PCs are not-quite-enough to support virtualized PCs. In addition, the three virtualization engines that I attempted in the past (that was, um, two years ago) were not quite willing to work for me. Two years and several Linux upgrades later, things may be different.

I've attended conferences in the past, and I expect to attend them this year. I miss the "Software Development" conferences run by Miller-Freeman; they covered different technologies and vendors without a specific agenda. In their place, I find the open source cons educational and informative. I'm looking at OSCON, Open Source Bridge, and the Central PA Open Source Conference for this year.

Cloud computing is the up-and-coming thing, and I would like to examine cloud-based processing. Perhaps with Google's App Engine, or maybe Salesforce.com.

For the fun projects, I'm looking at a software and hardware. For the software, I'm thinking of a class to perform arithmetic operations that respect significant figures. The math for "sig figs" is almost identical to "infinite precision" math, but the rounding is different. I may create something in C++ and then port it to Java, C#, Python, or Ruby. (Or perhaps several!)

The hardware project will be an HP scanner and some OCR software. I'd like to scan some pages from old programming texts and try out the programs.

All in all, this could be a very educational year.