Re: Defining Open Source

Jeff Atwood has a post about the definition of open source with respect his contributions to the .NET open source ecosystem.

I’m really glad that he brought this up because it has been on my mind for a while and based on his comments I can see there is MUCH confusion. I’m not going to address the confusion between “Open Source” as defined by OSI (The Eric Raymond definitions) and “Free Software” as defined by GNU (The Richard Stallman definitions). The commenters should read up as there is much writing on the differences here.

The confusion that I realized only as recently as January at CodeMash is that there are a number of closed source project out there that release their closed source under an open source license. Before you call this nonsensical please consider their development model. The source repository is closed. There are no public developer email lists. There is no public discussion of direction and upcoming features and who is implementing new features or even who is fixing big bugs before the next release. The Project is closed. However, every 6 months or every so often the source code is released and when it is it is under an open source license.

I’ll refrain from poking holes at this and calling this an abomination of the spirit of open source. The two aforementioned big names of Free Software and Open Source have plenty of writing on why this might be bad. The reality is that these projects exist and they are what they are. The project which opened my eyes to this model is DotNetNuke. This is a closed project which releases its code under an Open Source license.

Contrast this project with any open source project such as Mono or CastleProject and look at the surrounding communities. The core developer community exists. You know who they are. You can read public email lists. You can even chat via IRC with the folks who write the software. You can file bugs and submit patches. You can, you can, you can. DotNetNuke on the other hand does have a thriving community but it is all around writing plugins. Yes, you could download the source to the latest DotNetNuke release and you could change it all you want, but if you implement awesome new feature X, there is no where to submit it. If you fix annoying bug Y, you have to email it to a black hole and hope that the patch you made against last release will merge with their current private trunk.

In my opinion it is important to make the distinction between Open Source Projects and Open Source Software. All Open Source Projects by definition are Open Source Software, but Open Source Software might be a closed project. If the trunk is closed, how open is the software really? I’d say it is not open.

Jeff made the distinction in his post and has said he will be giving to Open Source Projects and not giving to closed projects that release their source under an Open Source license. I think this is great. Jeff recognized the distinction and is voting with his contributions.

On a lighter note, I couldn’t resist the Simpsons Movie character generator. The blowfish shirt seemed the geekiest to me.

simpsons avatar

Powerpuff Tech Talk Blogs

As a former LOVER of the powerpuff girls (I still have two VHS from cartoon network of original airs from season one) I was intrigued by this post. If Bronwen, Elaine and Lorraine are like the powerpuff girls, then sign me up! I’m a rowdy-rough boy!

Which PPG are you?

Python davclient+PIL => my gallery uploader

Vista Vista Vista. Oh how you hate me.

It turns out the XP “Publish and Print” wizard – or whatever it was called – integrated great with Gallery just by adding a simple registry key and enabling the right Gallery add-ins. Vista doesn’t have this. Vista has instead a lame f-spot rip-off (ok, it is probably an iPhoto rip-off) called Windows Photo Gallery. It isn’t bad. It isn’t great. The XP publish wizard allowed me to resize images before sending them to an internet printer or Gallery. WPG doesn’t allow this. It turns out I can use the same Gallery reg and change just the registry path and it will work with WPG. But Gallery has a file size limit of two megabytes. I shoot my Canon S3 IS on its “SL” image setting so the file size is usually three or four megabytes.

Print and Publish and WPG doesn’t work for my case in Vista, so I’ll try WebDAV. I should just be able to “add a new network place” like in XP and type in the Gallery URL and then just drag and drop files (once they are resized of course). This is also a no go. It turns out that Microsoft is WAY smarter than me. Vista has disabled the ability to use WebDAV over HTTP. It can ONLY be used over HTTPS. Never mind that I don’t care about my plain text password in this case. It doesn’t matter. Vista is smarter than me.

Unwilling to manually resize and upload even a handful of files, I decided to script my solution. With only six hours until the MichiPug meeting I thought it would be fitting to use Python as my tool of choice. The bonus to using Python is that the solution will also run in Linux and since all of my Photos are stored on a Linux server running Samba, I’ll be able to publish photos remotely via ssh from my server if I want to (and if I happen to know the filename I want to publish).

It turns out resizing images easy trivial in Python thanks to PIL(Python Image Library).

import Image
width=1600
height=1200
imageFile="path/to/IMG_0100.JPG" im1 = Image.open(imageFile)
im5 = im1.resize((width, height), Image.ANTIALIAS)

tempdir = tempfile.gettempdir()
filename = os.path.basename(imageFile)
tempfilelocation = os.path.join(tempdir,filename)
im5.save(tempfilelocation)

So resizing the image was easy. Getting a filename from argv[1] was easy. I wasted a few hours barking up the wrong tree with davclient. Ultimately it was my own fault for not opening the file with ‘rb’. On Windows that ‘b’ matters! I’m used to python development on Linux where it is a meaningless.

At the end of the day I have a cmd script in my Send To folder that calls this python script

#!/usr/bin/python

import Image
from sys import argv
import tempfile
import os
import davclient

#site must include trailing slash
site = 'http://www.wrenfam.com/gallery/w/SomeGallery/'
username='myusername'
password='mypassword'
width=1600
height=1200

def imageTempResize(imageFile,width,height):
        im1 = Image.open(imageFile)

        im5 = im1.resize((width, height), Image.ANTIALIAS) # best down-sizing fi
lter
        tempdir = tempfile.gettempdir()
        filename = os.path.basename(imageFile)
        tempfilelocation = os.path.join(tempdir,filename)
        im5.save(tempfilelocation)

        return tempfilelocation

def davUpload(tempName, site, username, password):
        client = davclient.DAVClient(site)
        client.set_basic_auth(username,password)
        fname = os.path.basename(tempName)
        file = open(tempName,'rb')
        statinfo = os.stat(tempName)
        fsize=statinfo[6]
        url = site+fname
        contents = file.read(fsize)
        if len(contents)!= fsize:
                return

        client.headers['Content-Type'] ='application/octet-stream'
        client.headers['Content-Length'] = len(contents)
        client.put(url,contents)
        status = client.response.status
        if status==204 or status==201:
                print "file %s uploaded successfully" % fname
        else:
                print "something went bad when sending :( "
                print "client.put(%s,f=%s)" % (url, file)
                print status
                print client.response.getheaders()
                print client.response.body

for i in range(1,len(argv)):
        tempName = imageTempResize(argv[i], width, height)
        davUpload(tempName, site, username, password)

Now I can upload images just by clicking. Of course two big todos are to copy exif data. PIL has no support for writing exif data. pexif is in the cheese shop. It will get done. The second big todo is to support choosing to which to upload.

crying Lily

Open Source and .NET Software

Phil Haack has a great post on .NET and Open source software. It mirrors a lot of my own feelings. Thanks for expressing my feelings for me Phil!

One thing that I don’t agree with is my personally preferred platform. WISC (Windows, IIS, Sql Server, C#) is nice and all, but I really like it when my C# runs on Mono and that means Linux is an option and Apache is an option. I use NHibernate and Castle’s ActiveRecord and I avoid writing real SQL. That means I’m not tied to SQL Server. I can run the same code on SQL Server, SQLite, MySQL, PostgreSQL, Oracle, DB2, and probably some others thanks to HQL and NHibernate Drivers and Dialects. So I guess my platform of choice is [Windows|Linux] [IIS|Apache] [SQL Server|PostgreSQL] [C#] or just [WL][IA][SP][C], WLIASPC.  Pronounced “Will I asp see”. I guess.

Get Rich Slowly & Dave Ramsey on this American Life

So I was reading my blog roll, which is basically all that I do all day long because it is 2221 rss feeds. (I love you bloglines.) At the very bottom of my list is a nice blog that I subscribed to recently called “Get Rich Slowly“.  There was a great post where the author references an old This American Life episode with Dave Ramsey, so I just had to look this up!
I usually like This American Life although sometimes the topic will bore me, or it will have some political overtones with which that I disagree.
This episode the introduction lasts about 2min 30sec if you want to skip the congressman stuff. Dave Ramsey stuff starts around four minutes and the first call question is pure Dave. Susan Drury points out that Dave’s callers are often not calling about money. Its a great listen. I highly recommend.

High DPI makes for high bugs

I’m in the middle of shifting jobs. I said so long to the wonderful Lenovo Thinkpad with only a 1024×768 display and I bought myself a nice Dell Latitude D820 with a 1920×1200 (WUXGA) display. I know my productivity is tied somewhat to number of pixels at my disposal. If I run out of room on my display for developer tools, I’m far less efficient than I could be. There were features I love that I didn’t use on the 1024×768 display.

When I first started up the laptop I thought “Oh NO! These are not my eyes from when I was 16 years old!” I was afraid I had made a terrible mistake. I was slouching trying to read the display. I stepped through the new computer configuration and I immediately set the DPI from the default 96 DPI to the “Larger scale” setting of 120 DPI. This helped. Later that day or the next I did something I almost never do. I was using The Gimp to manipulate some image and I was using its inches support. I decided that it may be good if the inches scales actually were sized correctly. I figured having the correct DPI setting in your OS can only be good. Print Preview should be most accurate that way. I talked to some people who know displays far better than I do (#Linux from arstechica).

It turns out that my display has a 148 DPI (15.4″ diagonal – 1920×1600 – do some math). Windows confirmed when I pulled out a ruler and adjusted the numbers using the “Custom scale” setting. I was happy that this custom scale UI existed and I was even more happy that it visually confirmed what the calculations said. Once I set to 148DPI things were great. Fonts were huge.

By that I mean that fonts were the size they were supposed to be, but I have great vision. I can read Consolas at 6pt and I regularly run it at 7pt. Some things were just too big. Title bars and menus seemed like they were wasting screen real estate. As pointed out the day of the Safari release, Safari doesn’t use ClearType in Windows. Apple does their own font rendering (I’m guessing) in Safari for Windows. As a results my DPI settings had no effect on the display of fonts in Safari. So for a couple of weeks I ran with Safari being too small, and many things in windows being too big.

I’ve since reset my putty to default to 7pt Consolas instead of 8pt and today I shrunk the font from 9pt to 8pt for pretty much everything I could find in the Advanced Appearance dialog (it is still there in Vista).

Advanced Appearance

This is my most usable configuration yet. I love it.

I am disappointed with certain things which do not work with this high DPI setting. Windows Media Player for example seems to break some UI design guidelines. Ya know, the ones that basically say “use relative positioning so your application will work with various font sizes, DPI, and display resolutions, oh and this also means it will be easier to internationalize because that text that is four short words in English takes up 100 pixels, but it takes eleven long words in Finish, but only two Kanji in Japanese.

Leo Laporte - The Tech Guy 347 - Windows Media Player

See how the fonts are overlapping in the right top pane. Shame on you Microsoft.

Windows Media Player really surprised me by its little quirk. I was less surprised with the bug in Windows Live Writer. During setup for a new blog, it asks a couple of questions in a wizard.

Windows Live Writer

I couldn’t click the third option, yet it was the one I wanted. Luckily I could use the keyboard, tab, tab, tab, enter.

Windows Live Writer (2)

What you cannot even see on this screenshot is that there are two textboxes for username and password. I had done this wizard once before. When the next step said invalid username and password, I guessed that I had forgotten it on the last step. Again keyboard to the rescue, tab foo, tab bar, enter.

The really interesting thing here is that I’ve NEVER had these kinds of issues with either GNOME or KDE in Linux. I’m not a holy war kind of guy. I like both Windows and Linux. I use both Windows and Linux, but it seems to me that the Linux guys figured out the best practices for this type of layout a long time ago and they tend to use them. It is no coincidence that when you open Visual Studio you still get a grid on which to put controls in a fixed position. Yet if you open GLADE or QtDesigner the default is a Container that is NOT the fixed layout container.

Webforms attempt to abstract away something simpler

I’ve heard many people talk about how Webforms have problems, that the problems stem from being a leaky abstraction. I tend to agree, but I could never communicate the problem as succinctly as Jeff Perrin just did.

Now the first problem with Webforms is not that it’s an abstraction, or even that it’s a leaky one (they all are). The problem is that what Webforms attempts to abstract away is actually simpler than the abstraction!

The more I think on this the more it blows my mind! When you look at Html over Http and even CSS and JS, the whole system is REALLY SIMPLE! Maybe too simple, yes, but that is for what various helpers like Yahoo’s UI library are. Of course, I found this link while reading Ayende. 🙂

Do you accept the terms of the licensing agreement

Do you accept the terms of the licensing agreement?

NO!

1.    INSTALLATION AND USE RIGHTS.  You may install and use any number of copies of the software on your devices running validly licensed copies of Internet Explorer.

WHAT???

So if I run the example in Firefox, my default browser, then I am breaking the license agreement. This is unacceptable. I clicked no, so I will not be looking at the WPF FlowDocument sample which I downloaded. (FlowDocumentSamp.exe)

Explaining Fuzzy Logic

I love this post on Explaining Heuristics over at Elegant Code.

I have run into the same issues to the extreme at my place of employment. Someone hears the words “Unit Tests” and immediately all tests are “Unit Tests”. It is as if no research is done into anything whatsoever. Mind you, this is a programmer!

One that I just couldn’t let go a while back was “Fuzzy Logic”. I took a “Soft Computing” course in college. As a project we did a fuzzy hand recognition system. It was rather interesting. We used Matlab’s Fuzzy Toolkit, so we really didn’t have to implement the fuzzy algorithms ourselves. We used line detection on peoples hands and gathered a dozen peoples hands (not a good enough pool for a real world application, but good enough for this college course. Gathering images was fun and easy – we used a digital camera. We just took pictures of people’s hands on the tables in the room in which the class met.

Recently, a coworker started calling some stuff we have “fuzzy logic”. I immediately objected and continued objecting anytime I had the energy to argue. This was not fuzzy, this code was 100% deterministic. Given a set of inputs it would ALWAYS 100% give the exact same output. It was just that the control flow for the program was a bit complex, and so describing it to our business users it wasn’t always 100% clear from where a result value came. I still continue to object to calling this “fuzzy logic”. No matter how complex a deterministic system gets, it is still deterministic. Heck, it wasn’t even that complex. There were about 5 possibilities. For some reason, explaining to certain business users “it could be one of these 5 cases” was not satisfactory (and I won’t argue that – there shouldn’t have been 5 cases – but that isn’t the point). The point is that it was not and is not fuzzy logic.

I just wanted to share in Daddy Starr’s frustration with imprecise language. I couldn’t agree more that “Incorrect or even imprecise language just drives me crazy.”

Thanks Daddy Starr!

Alt Double Click was new to me

Unlike Kate Gregory, the only shortcut that was new to me was Alt-DoubleClick. It isn’t a keyboard shortcut, so it is far less valuable to me.

I use Alt-Space all the time. I highly recommend it. I hope that Kate masters it usage.

My most recent “windows” keyboard shortcut which I have mastered is use of Ctrl-Alt-Break to restore and full screen an MSTSC(RDP) session. I can Alt-tab in a remote desktop session, and then Ctrl-Alt-Break and Alt-tab my desktop and then Alt-tab back to my remote desktop and then Ctrl-Alt-Break to full screen the remote desktop and continue Alt-tab in the remote session. It took my a while to master working this way, but being able to move between these things quickly without touching a mouse is absolutely brilliant!

Now if only Hit-a-Hint worked just a little better.