Tuesday, June 22, 2010
A case for code reviews
We're not talking about poring over the entire code base once a month (that's just cruel); no, you check the code your teammate or colleague wrote or modified before it even goes into the main branch of the source control repository, just like how open-source projects do it.
Use Review Board: it's free and works with the modern source control systems. If you have one of the source control systems that isn't supported, have one of your teammates come to your desk to give your changes a once-over until you figure out a software solution that allows you to send them the changes so they can review it on their own time while you start working on something else.
Seriously. Stop the bad software madness in its tracks TODAY.
Wednesday, September 03, 2008
The world in Verdana
It's technically not such a bad chicken-and-egg situation, with the massive and thorough testing Google [claims to] have performed. Plus, the browser is more than a fine replacement for users of Internet Explorer or plain, out-of-the-box Firefox, thus making all us geeks appear crazy when non-techies ask us why we're not using Google Chrome, when we use everything else Google throws at us.
Anyway, I didn't set out to write yet another review, but to post solutions to problems I encountered:
Installing Chrome as a non-administrator
I hit issue 119 ( Install Fails on W2K8 with low-rights user ) when I tried to install on my computer as a non-administrator and got the following:

Thankfully, the work-around by stephen.oakman in comment 6 worked and I found the elusive chrome_installer.exe in a folder matching the pattern C:\Documents and Settings\[user]\Local Settings\Application Data\Google\Update\Download\[guid]\chrome_installer.exe and was able to install it successfully.
Setting the minimum font size
I also had the same accessibility lament about minimum font sizes and font family overrides. For example, here is the Getting Started page in Firefox 2, with Verdana @ 14pt bliss:

...and this is what Chrome gave me with the same page:

OK, yes, the Firefox version looks weird with the title text not lining up with the logo, etc. but all the content is perfectly legible, which is more important to me. Well, more legible than the fonts picked by the web developer.
Thankfully, I have solved the first half the problem with a few quick searches in the source code and now my C:\Documents and Settings\[user]\Local Settings\Application Data\Google\Chrome\User Data\Default\Preferences file contains this little gem:
"webkit": {
"webprefs": {
"cursive_font_family": "Verdana",
"default_fixed_font_size": 14,
"default_font_size": 14,
"fantasy_font_family": "Verdana",
"fixed_font_family": "Courier New",
"minimum_font_size": 14,
"minimum_logical_font_size": 14,
"sansserif_font_family": "Verdana",
"serif_font_family": "Verdana"
}
}
...which gives me a slight improvement in readability in Chrome:

You can find out what the names of the [other] supported hidden preferences are by peeking into chrome/common/pref_names.cc and cross-referencing with WebContents::GetWebkitPrefs() in chrome/browser/web_contents.cc. In particular, you'll find (as of this writing) that the other half of my problem is already identified in a comment:
// User CSS is currently disabled because it crashes chrome. See
// webkit/glue/webpreferences.h for more details.
...with the more details being:
// TODO(tc): User style sheets will not work in chrome because it tries to
// load the style sheet using a request without a frame.
bool user_style_sheet_enabled;
GURL user_style_sheet_location;
D'oh. Maybe this will inspire someone else to fix that part of the code or otherwise provide the elusive "let me choose my own damn fonts" setting that I rely on for keeping my sight and posture in good shape.
Tuesday, June 10, 2008
Announcing the web-screen-saver project
It turns out I do! I have been learning about aviation weather and the best way to stay fresh is to practice every day, so I took a really old Toshiba laptop (Pentium MMX @ 166 MHz, 16 MB RAM and a 2.1 GB HD), got it running again (which involved
Next up was figuring out how to get various semi-frequently-updated images to show up on the screen on a cycle. Various options popped up, such as:
- a
cron
job that would triggerwget
on a few URLs with one of:
- a companion program that would convert the HTML pages to images and rescale pure images appropriately and a corresponding client (any of many file-system-based screen-savers)
- a static page that would cycle the pre-downloaded pages or images using a bit of JavaScript
- a number of static pages that serve up one pre-downloaded page or image for a little bit of time before redirecting to the next
- a static page that would cycle the live pages or images using a bit of JavaScript
- a number of static pages that serve up one live page or image for a little bit of time before redirecting to the next
Some of the above options don't make that much sense until you consider that aviation weather is the kind of information that's sensitive to updates (or the lack thereof) and so it is of the utmost importance to always have the latest version of, say, a TAF or a GFA cloud & weather map. With some web browsers reportedly overzealously caching pages or images coupled with sometimes unreliable internet connections, I was trying to explore the space of options so that I could potentially detect the worse case and do something about it.
I ended up deciding to see whether the current browsers that I use/care about indeed [still] suffered from that problem, since it would eliminate an entire class of problems/solutions. Turns out that improper browser caching no longer appears to be a problem, although this could also be due to proper
A few evenings of light programming (i.e. tweaking a few lines of code here and there during a few boring moments of TV watching) and I've got what I think is "version 1.0"-worthy. It's running right now on the trusty laptop in Internet Explorer 6[1] in full-screen mode (hide the status bar, hit F11, then right-click on the toolbars to select auto-hide), although with this much RAM it just swaps and thrashes like hell for a minute or two on every reload. I also need to reboot it every so often because the USB wireless adapter's driver is as stable as the U.S. economy. *cough*
Download
Download version 1.0: awesome-web-screen-saver-1.0.html.
View source of version 1.0: index.html
Live demo (latest version): Aviation Weather Electronic Summary Of Major Events
How to use
Once everything loads, all but the first page/image will be "hidden" (it's really a
Roadmap for future versions
- JavaScript code to live in its own file
- META-based refresh to be adjusted based on the number of "pages"
- better handling of unavailable content (i.e. keep retrying - with suitable back-off - iframes or images that returned anything other than HTTP 200)
- use Google App Engine for the following features:
- configurable content profiles (i.e. pick your own frequently-changing content)
- content caching (i.e. Google's servers can withstand more hits and will probably replicate content to various globally-distributed data centers for higher availability)
- content download scheduling (i.e. while you have both of the previous two features, you might as well configure content with an expected lifetime or scheduled release, so that it is only pulled once, per publishing, from its source)
- stats collection
- general geekiness
Notes
[1] This will probably cost me a few geek points, but the laptop is still running the Windows 98 copy it came with - I couldn't get any GNU/Linux distro to boot/install and I have better things to do with my time!
Wednesday, October 11, 2006
Comparison of Open-Source Licenses
Note This is a copy of an essay I wrote for an assignment in the Open-Source Software Engineering course I'm taking. The deadline was yesterday, so it's safe to post today. :) I wrote this essay using Confluence, so the HTML is a little weird when I try to copy/paste it here. The assignment was: Compare and contrast (1500-2000 words) the open source licenses MIT, BSD, GPL, LGPL, Creative Commons to the Eclipse Public License. Make sure to include a table (rows heading is feature, column heading is license) that summaries your discussion. Submit the answer to this question as an HTML document. |
Feature to License matrix
# | Feature name \ License | MIT | BSD | GPL | LGPL | Creative Commons | EPL |
---|---|---|---|---|---|---|---|
1 | Number of paragraphs | 4 | 6 | 56 | 69 | Average of 31 | 20 |
2 | Distribute modified/derived work? | Yes | Yes | Yes | Yes | Depends on "nd" option | Yes |
3 | Must release source? | Yes | Yes | ||||
4 | Must identify all modifications? | Yes | Yes | ||||
5 | Is attribution required? | Preserve copyright notice | Preserve copyright notice | Preserve copyright notice | Preserve copyright notice | Yes | Preserve copyright notice |
6 | Is endorsement or promotion permitted? | Not without permission | Yes | ||||
7 | Is commercial use or distribution authorized? | Yes | Yes | Depends on "nc" option | Yes | ||
8 | Allows re-licensing? | Only by special permission | Only to GPL, or by special permission | Depends on "sa" option | Yes | ||
9 | Requires patents be licensed to recipients? | Yes | Yes | Yes |
Introduction
The open source licenses involved in this study have been analyzed and – although similar in the spirit of "no charge but no warranty" copyright licensing – were found to be primarily different in what they are specific or explicit about. It is speculated that this is representative of the values and interests of the license authors and therefore the level of detail surrounding a topic is assumed to reflect the degree to which the interests and values affected by said topic are important to the authors and the amount of effort willing to be exerted in order to ensure said interests and value are protected.
Examples of such interests and values are "equality", "merit", "freedom", "public good", "continuous improvement", "standardization" and "accountability". This analysis will examine these values, how they can be traced back to license features and finally how individual licenses emphasize these values by the use of the features and the requirements or conditions they attach to said features.
Features
The matrix, and correspondingly this analysis, only examines the major differences observed between the licenses. Similarities are outside the scope of this study. It should be noted, also, that the matrix only contains entries for feature-license pairs when such a feature was explicitly mentioned in the license. As identified in the introduction, the licenses aren't always specific on all features and a lawyer may be able to interpret the licenses according to the local laws to make a definitive determination for each feature. That said, even a "Yes" is slightly misleading as there are often conditions or requirements attached to the permissions before they can be implemented.
1. Number of paragraphs
Although one of the more questionable choice of features, it is actually pretty representative of the level of detail of the licenses. The count was done quickly, by hand.
2. Distribute modified/derived work?
Since all licenses permit royalty-free redistribution, the distinction here is whether the work can be distributed with modifications or as part of a derived work. This feature is present because the Creative Commons licenses can restrict this activity with the "nd" (No Derivatives) option.
3. Must release source?
This feature is more accurately the requirement of making available, upon request, the source code of any binary re-distribution, independent of whether the work was modified or not. It may be sufficient to make an offer for the source code or to pass on the same offer to recipients. The GPL and LGPL are explicit about this.
4. Must identify all modifications?
Also known as "delta notification", this is a requirement that modifications be traceable back to contributors, usually in the case of derivative works. Again, strong features of GPL and LGPL.
5. Is attribution required?
Another feature that appears to stem out of nit-pick, the Creative Commons licenses stand out in that they require more than simply preserving the copyright notice but to make efforts to link back to the original work. This could be considered a special case of delta notification.
6. Is endorsement or promotion permitted?
A special case of attribution, in the case of derived works the BSD license makes a point of requiring "specific prior written permission" before using the names of the original project's organization or contributors for promotional or endorsement purposes. The Creative Commons licenses give this permission by default, but section 4.a reserves the right to the Licensor to request credit be removed.
7. Is commercial use or distribution authorized?
This feature is about the license granting permission to use or distribute the work (or portions thereof) in a trade for something of value between two entities [3]. The MIT and BSD licenses are not specific about this and the Creative Commons licenses offer this permission as the "nc" (Non-Commercial) option.
8. Allows re-licensing?
It may be desirable, during the construction of a derived work, to license said derived work under different terms. The GPL and LGPL offer this possibility as an exception, the EPL offers it under certain conditions and the Creative Commons licenses grant it if the "sa" (Share Alike) option is not used.
9. Requires patents be licensed to recipients?
Where patents are concerned, the GPL and LGPL, through sections 7 and 11, respectively, state clearly that any patents owned by contributors be licensed royalty-free to all recipients, direct or indirect. The EPL, on the other hand, only requires that patents on contributions be licensed royalty-free when combined with "the Program", although the EPL joins the MIT and Creative Commons licenses in reminding the recipient that there is no guarantee the work does not infringe on patents owned by third parties. The EPL goes furthest by stating it is the responsibility of the recipients to acquire any third-party patent licenses that may be required for the use or distribution of the work.
Interests and Values
These values were derived from the perceived intents of the license features identified earlier and form the basis of the respective philosophy behind each license.
1. Equality
Equality is a social state of affairs in which certain different people have the same status in a certain respect.[1]
This form of inclusiveness aims to fairly make available the work to all possible recipients and ensuring this possibility through various conditions, such as ensuring the re-distributed work is licensed "as a whole at no charge" [2]. While this is generally the primary principle behind open-source licensing, half of the Creative Commons licenses stand out here because the "nc" option – identified in feature #7 – prohibits the use of the work in a commercial fashion and thus can be interpreted as introducing inequality. It could also, on the other hand, be argued that such a restriction may be an attempt to restore equality among non-commercial entities relative to their commercial counterparts.
Another factor potentially affecting equality is the Creative Commons licenses' "sa" option – identified in feature #8 – that seeks to ensure recipients have as much freedom with the derived work as with the original, much the same way sections 2b and 6 of the GPL and sections 2c and 10 of the LGPL try to ensure the propagation of the rights and freedom of the original work to all recipients at all levels of distribution.
Lastly, feature #9 ensures that no person or groups of person be excluded from using the work by having the GPL and LGPL require that all patents be licensed royalty free to everybody.
2. Merit
This value can be understood to mean the desire for recognition or acknowledgement, such that a reputation can be earned and preserved. We can especially see the expression of this value through feature #5 but also through feature #6 where the authors of the BSD license imagined the possibility of mis-use or of sub-optimal derivative works that could potentially – albeit unintentionally – reflect badly upon the original authors. We can also see a similar attitude with section 4a of the Creative Commons licenses where endorsement is considered granted in the form of the attribution requirement, but for which the Licensor has veto rights over.
It can also be argued that feature #4 helps support the notion of individual merit and reputation by the GPL and LGPL requiring that all modifications be identified, even though all licenses disclaim any warranties to protect the same individuals from damage claims.
3. Freedom
Although all open-source licenses generally try to increase the freedoms of the recipients, the most fervent in its attempts to do so is the GPL, especially through feature #8. This value is highly regarded as it can help avoid vendor lock-in where critical or popular fixes and improvements could otherwise be withheld, delayed or prevented by the original authors. There are obvious similarities to value #1 (Equality).
Feature #3 tries to make sure recipients (direct or indirect) are as able or free to make changes to the work as the original authors, provided some conditions are satisfied. Again, this is the stated spirit of the GPL and LGPL, although the latter trades a few freedoms – hence the "Lesser" in the name – to support value #6 (Standardization). Some Creative Commons licenses are definitely at odds with this value as the "nd" option could be seen as taking away freedom, relatively speaking.
4. Public good
It is seen as an effort to help the development of the greater community and encourage cooperation to emphasize elements of feature #3. Similar to value #1, this value distinguishes itself from Equality by not only providing equal access to the work, but to improvements to the work, such that said improvements are done cooperatively and as a community so as to best reflect the needs of the many. That is not to say that the act of not making available the source code hinders public good per se – although some may argue otherwise – but that the public good is best served when the source code is also made available.
Feature #7 can play a role here, in that allowing commercial use and redistribution may also help accelerate the development of a popular work, as the LGPL. One could also argue the applicability of features #4, #5 and #6 in that they could help identify fraudulent or sub-optimal versions of a popular work.
5. Continuous improvement
The permission to re-distribute modified/derived works (feature #2), coupled with the guaranteed freedom to make modifications (feature #3) help support this special case of value #4 (Public Good) where the software is able to be evolved and improved. This is where works licensed under the GPL have the best chance for continuous improvements and No Derivative Creative Commons-licensed content the least chance.
It could also be argued that the ability to make improvements in secret could mean there is less overhead involved and the improvements themselves progress faster, but such modifications may not be for the greater Public good. In those cases the MIT, BSD and EPL licenses offer that opportunity and similar, more "open" projects may be created to emulate the more secretive counterparts.
6. Standardization
It may be that it is important a work become popular or widely-used. In such cases, the "lesser" conditions attached to feature #3 by the LGPL (or by other licenses) may allow works such as function libraries to flourish by being used by more recipients than otherwise would be possible if said recipients had to also release their source code, even if it only used the original work. [5]
7. Accountability
Feature #5 helps identify the authors and contributors to works and feature #4 enables an order of magnitude better traceability to help establish exactly who did what, generally to help track down problems and/or defects with the work That information could also, in theory, be used to assign blame, although all licenses try to avoid this situation by providing no warranty of any kind and attempting to shield authors and contributors from damage claims.
The GPL, LGPL and EPL, however, have an exception that permits, through feature #7, the exchange of a warranty for a fee, under the condition that the warranty protection can not affect other contributors.
Lastly, although some patents are licensed for use as per feature #9, not all possible patents necessarily are. The EPL and MIT licenses are the only two that specifically point out the fact that third-party patents may need to be licensed, mostly because there is no warranty of non-infringement. The GPL and LGPL, on the other hand, are specific about obtaining royalty-free patent licensing from all involved parties before distributing the work.
Conclusion
As was demonstrated in this study, the licenses vary wildly in what they are specific or explicit about, which helps to emphasize the differences in values and interests shared by the authors of said licenses. It is thus difficult to fully compare the chosen set of open source licenses because they do not generally disagree on many points, but rather delve into different facets of those points at different intensities.
It is thus recommended that the choice of an open-source license for a new work be made according to the compatibility of the author(s)' values with those implied from the licenses. An abstraction at this level is thought to deliver the best suitability and match.
References
1. Social equality, Wikipedia. http://en.wikipedia.org/wiki/Equality_(law)
2. The GNU General Public License, Free Software Foundation, Inc. http://www.opensource.org/licenses/gpl-license.php
3. Commerce, Wikipedia. http://en.wikipedia.org/wiki/Commercialization
4. The Open Source Definition, Open Source Initiative. http://www.opensource.org/docs/definition.php
5. GNU Lesser General Public License, Free Software Foundation, Inc. http://www.opensource.org/licenses/lgpl-license.php
6. Licensing HOWTO, Raymond, Eric S. & Catherine O. http://www.catb.org/%7Eesr/Licensing%2DHOWTO.html
7. The Power of Personal Values, Posner, Roy. http://gurusoftware.com/Gurunet/Personal/Topics/Values.htm
8. Commerce, Wikipedia. http://en.wikipedia.org/wiki/Commercialization
Thursday, September 28, 2006
Gopher the Demo Player
The presentation slides can be downloaded here (PDF, 693 902 bytes).