Monday, December 17, 2007

The Advantages of Upgrading From Vista To XP

CodingSanity writes:
I have finally decided to take the plunge. Last night I upgraded my Vista desktop machine to Windows XP, and this afternoon I will be doing the same to my laptop.
He goes on to do detailed comparisons of the two operating systems in categories including Look & Feel, Performance, Device Support, Reliability, Gaming and Multimedia. In the end, it looks like MS may have a real winner with Windows XP. ;-)

Thursday, November 22, 2007

Weekend Fun: Plot the Mandlebrot Set by Hand


Another critically useful diversion from Wikihow...
How to Plot the Mandelbrot Set By Hand


http://www.wikihow.com/Plot-the-Mandelbrot-Set-By-Hand

Friday, November 16, 2007

How to convert a photo into an icon or favicon

Did you know that you can save icons from Photoshop with the free ICOFormat plugin from Telegraphics? I didn't. There's a nice little writeup on the Telling Machine: Convert photos into icons using Photoshop.

Thursday, November 15, 2007

Are you LinkedIn?

Everybody seems to be doing this, which is usually a bad, bad sign... but anyway:
View Paul Smith's profile on LinkedIn

New SourceForge Project Released

This just in: A new LGPL project that I'm maintaining has just been added to SourceForge.net. The project is called StormFactory, which stands for Simplified, Tiered, Object-Relational Modeler. We were going to call it Fast Enterprise Entity Tiers, but the acronym didn't invoke quite the right mental image. ;-)

Here's the executive summary: StormFactory is a stored procedure-oriented code generator which targets the C# language and Microsoft SQL Server. It's implemented as a Visual Studio 2005 Windows Forms solution that can simply be downloaded & run to start generating code (i.e. there are no schemas to create or templates to fill out). Given a suitable SELECT procedure, the tool generates an entity class (to expose the result columns as properties), a data-access class which both encapsulates a generic collection of the entity and acts as a provider/factory for itself. Finally, the tool generates a stored procedure to save entity instances and/or entity collections back to the database. Each data-access class is entity-specific, and can serialize/deserialize itself to/from XML. Advanced options let you create collection filters, make certain properties read-only, control serialization attributes, and more.

The project has its own site at StormFactory.net, and documentation is in-progress on the project wiki on SourceForge.

Anyway, I'd love to take credit for and/or ownership of all of this, and I could have if it weren't for those meddling open-source licenses. ;-) The project includes 100% open-source (GPL and/or LGPL) contributions from a variety of contributors, and it uses a few open-source libraries itself (FireballCodeEditor, and in v2.0 onwards, weifenluo 's DockPanel suite).

Check it out and let me know what you think!

Tuesday, October 30, 2007

Unescaping strings in the Immediate window (C#) when debugging

Ever get annoyed at the unfriendly strings the Visual Studio debugger prints when running a C# project in the IDE?

Here's a creative solution courtesy of Daniel Cazzulino's Blog:

At debugging-time, if you ask for any string variable value you get it escaped, which isn't very useful. You can't copy/paste to a text editor to save to a file and check how it looks like, for example. A trick I use all the time is issuing the following command in the Command Window - Inmediate:

System.Diagnostics.Debugger.Log(0, "", theTextVariable) You will get in the same window, the unescaped string, including any tabs, CRLF, etc.

Read the original at http://weblogs.asp.net/cazzu/archive/2004/02/10/70658.aspx

Data Compare in Visual Studio 2005 for Database Professionals

I recently discovered a little "gotcha" when using the Data Compare feature Visual Studio 2005 for Database Professionals*: it silently ignores data in any table that lacks a primary key.

Now I would never accuse you of creating tables without primary keys, ;-) but you just might inherit a database in such a condition. Seriously though, many developers (including me) often leave PKs off their join tables, since they're usually composed of nothing but foreign keys anyway. If that's you too and you plan on using the Database Professionals tools for Visual Studio, just remember you'll have to go back and add those primary keys. It's a good habit to get in anyway, since it forces you to be explicit about your unit of uniqueness for joins, e.g. you have to consider whether you need an identity column or can simply create a PK across one or more of the FK columns.



* If you do SQL development and aren't familiar with this great set of tools, check 'em out! This setup considerably eases three essential database tasks: (a) Getting your object definitions under source control, (b) comparing schemas and migrating changes between environments, and (c) comparing data between environments and applying the diff from one server to another.

Visual Studio 2005 Team Edition for Database Professionals Add-on for Visual Studio 2005 Team Suite Edition
http://www.microsoft.com/downloads/details.aspx?familyid=7DE00386-893D-4142-A778-992B69D482AD&displaylang=en

Microsoft® Visual Studio® 2005 Team Edition for Database Professionals Service Release 1
http://www.microsoft.com/downloads/details.aspx?familyid=9810808c-9248-41a5-bdc1-d8210a06ed87&displaylang=en

Microsoft® Visual Studio® 2005 Team Edition for Database Professionals Power Tools
http://www.microsoft.com/downloads/details.aspx?FamilyID=DA3F11AD-BD54-4EDA-B08C-4DF84DF0D641&displaylang=en

Friday, October 26, 2007

SVN Integration in Visual Studio with AnkhSVN

On the heels of the aforementioned fantastic tool SVNOneClickSetup, I discovered AnkhSVN, a Visual Studio add-in that integrates Subversion version control.

Get it here:
http://ankhsvn.tigris.org/

These two tools combine to make a version control solution that's incredibly easy to configure and use. I've never used Subversion before in my life, and within 20 minutes I remotely set up my home server, had 2 projects in my repository, and had 2 remote client PCs connected and able to check out & commit. Try doing that with a VSS 6.0 or 2005 server setup.



The problems I ran into were pretty minor; Tortoise doesn't like to copy folders recursively when dragged into a repository from Windows, and getting VS & Ankh to recognize version control bindings didn't work exactly like I thought it would. Before you jump in, here are a few tips to get you past the initial snags you might encounter:

  1. AnkhSVN's Visual Studio integration magically seems to work better if you install the latest version of TortoiseSVN first.
  2. When you install SVNOneClickSetup, do let it create the default project that it wants to. Name it something like "ProjectTemplate" and leave it exactly the way the installer creates it; it will created tags, branches and trunk subdirectories for you.
  3. When you want to create a new project, first use Tortoise to make the directory: hit Start -> Run -> [ svn://your.svn.server:3690/ ] (or whatever port you're running it on). In the TortoiseSVN browser, right-click your "DefaultProject" folder and select "Copy to." Enter svn://your.svn.server:3690/YourNewProjectName.
  4. Now open your solution in Visual Studio; right-click the solution node in Solution Explorer, and select Ankh -> Add solution to Subversion repository.
  5. Put the solution at svn://your.svn.server:3690/YourNewProjectName/trunk.
Now when you want to fetch a solution onto a new PC, use Visual Studio, selecting Tools -> AnkhSVN -> Checkout a repository directory. In SVN, "checkout" means something more more like "get latest" does in VSS or TFS. Now Ankh should spot the bindings when you open the solution. Use "lock" on a file to do what VSS & TFS mean by "checkout." However, editing doesn't require locking; locking will just block check-ins ("commits") by other users.

Enjoy!

Subversion (SVN) on Windows finally made easy

I've wanted to start running my own Subversion server for the longest time but never found the time to wade through the convoluted Windows installation procedures. Now I don't have to, thanks to SVN1ClickSetup:
http://svn1clicksetup.tigris.org/

It is really this easy:
1) Run the Svn1Click installer
2) Configure your router to forward port 3690 to the SVN PC.
3) Profit!

Wednesday, October 24, 2007

My Most Essential Free Software Applications

This is a list of the free Windows apps I take everywhere with me.


Text editors, notepad replacements with syntax highlighting, auto-indenting & more:

Notepad2: http://www.flos-freeware.ch/notepad2.html (SDI)

Notepad++: http://notepad-plus.sourceforge.net/uk/site.htm (tabbed MDI)



WinZip replacement – extracts every compression format, including tar, bz, zip, rar, lzh, iso, arj, cab, 7z and more, and compresses to most formats as well:

7-Zip: http://www.7-zip.org/



FTP Client – Does most ordinary FTP tasks, handles secure ftp (SFTP), and has a server available in addition to the client:

FileZilla: http://filezilla-project.org/



PDF Viewer – lightweight and fast, just what you need and nothing you don’t:

Sumatra PDF: http://blog.kowalczyk.info/software/sumatrapdf/



PDF Maker – virtual printer driver that lets you create PDF files via the print menu from within any program:

PDFCreator: http://sourceforge.net/projects/pdfcreator/



Sandboxing / Virtualization Layer – lets you run programs in a sandbox having its own registry and filesystem, so no persistent changes can be made to your PC. Note: I'm not thrilled about Altiris being acquired by Symantec, but so far SVS hasn't seemed to suffer from Symantecitis...

Sandboxie http://www.sandboxie.com/
Altiris SVS http://www.altiris.com/Products/SoftwareVirtualizationSolution.aspx



Hardware Emulator / Virtual Machine -- allows you to run a virtual machine "computer" as an application, like when you want to run Windows on top of Linux or vice versa, or any time you need a specific environment that's isolated from your main PC.
http://www.vmware.com/download/server/


ISO Manager
– create .iso file images of CDs or DVDs, make a CD or DVD from an .iso image, make an .iso image of a set of folders/files which can later be burned to a disk, all from the context-menus in Windows Explorer:

ISO Recorder http://isorecorder.alexfeinman.com/isorecorder.htm


Virtual CD-ROM/DVD-ROM Emulator – mount an .iso file on your hard drive or USB drive or network, and Windows will treat it like another CD/DVD drive:

Daemon Tools: http://www.daemon-tools.cc/dtcc/download.php


Full-featured CD/DVD Burner & image recorder:

CDBurnerXP: http://cdburnerxp.se


Video Player – lightweight player can play DVDs, .iso images of DVDs, streaming content, just about any video file you throw at it, and even has a built in http server you can use to stream video with:

VideoLan: http://www.videolan.org/vlc/


Audio Player – lightweight player that handles all the audio formats that WMP doesn’t, including open-source formats like .ogg and .flac. Very plain, small footprint, but can be customized to look how you want if you get the “ColumnsUI” plug-in. Also rips CDs, optionally using the LAME MP3 encoder.

Foobar2000: http://www.foobar2000.org/



Image Editor: Aims to become a complete replacement for PhotoShop; right now it’s not quite there, but still the best free image editing software I’ve seen:

PaintDotNET: http://www.getpaint.net/index.html



Video Converter – converts almost any audio or video format to any other; lets you crop videos, adjust colors and cut off portions of the beginning or end while transcoding:

MediaCoder: http://mediacoder.sourceforge.net/



Web Browser – no list of free software would be complete without Firefox, the lightweight, faster, more customizable and more-secure alternative to Internet Explorer:

Mozilla Firefox: http://www.mozilla.com/en-US/firefox/

As of this writing, the Opera Browser is at its 9.5 beta release, and it's quite nice; check out the unique "Speed Dial" homepage feature, and if you can never have enough screen real-estate for your browser, hit F11 to check out its corner-to-corner fullscreen mode:

Opera Browser: http://www.opera.com/products/desktop/next/



Office Suite – complete replacement for Microsoft Office as free, open-source software that runs on any platform (Windows, Linux, Mac, etc.):

OpenOffice http://www.openoffice.org/



Antivirus – even the free version of their antivirus is quite capable, and it uses far less system resources than Symantec, McAffee or TrendMicro.

AVG Free http://free.grisoft.com/



Peer-to-Peer client, Gnutella network (like LimeWire):

FrostWire is the free, open-source counterpart to LimeWire pro: http://www.frostwire.com
If you enjoy FrostWire, you can get new features a bit sooner by purchasing LimeWire Pro; they's good peeps over dar, they've done quite a bit of good work on this P2P client.


BitTorrent Clients:

Azureus: http://azureus.sourceforge.net (full featured)

uTorrent: http://www.utorrent.com (aka Micro-torrent, literally “µTorrent”)

BitTorrent: http://www.bittorrent.com (slim)



Privacy, Anonymity and Security-enhanced web browser – encrypts all your traffic (including the domains and IP addresses you request), and routes it through a network of onion-routers, so no middleman – including your ISP – can sniff or log your traffic:

XeroBank http://xerobank.com/xB_browser.html



Portable Applications – all the basics like Instant Messaging, Email, Office, Antivirus and Web Browsing, but everything’s been modified to run from a USB stick withoutneeding any installation:

PortableApps http://portableapps.com/



File Wiper – Securely erase sensitive data

Eraser http://www.heidi.ie/eraser/



Text, File and Email Encryption – cross-platform PGP-compatible tool to allow secure data exchange:

GPG: http://www.gnupg.org/

The FireGPG extension for Firefox lets you encrypt, decrypt and sign data in web pages, and as a bonus, integrates right into GMail. http://firegpg.tuxfamily.org/


Whole Drive Encryption – allows you to mount a file, a partition or a whole disk as a separate drive in Windows, and encrypts/decrypts data on-the-fly while the drive is mounted. Data is unreadable when not mounted with the correct password.

TrueCrypt http://www.truecrypt.org/

Google adds IMAP to GMail

Looks like Google finally added IMAP to GMail, along with a feature that maps GMail labels to IMAP folders.

The "lack of folders" was the biggest objection I got when moving clients into a hosted GMail / Google for Domains setup. This will be a welcome feature.

Check out the IMAP behavior chart to see how GMail handles synchronization details.

Friday, August 24, 2007

Cross-browser pure-CSS table-less layouts

[Note: this is a draft article with major revisions ahead for it, but I prefer to leave it visible for comments during this time.]

When it comes to web design, I see more questions and confusion about how to control block-element positioning, sizing, and alignment than about just about anything else, This can certainly be frustrating, especially when it comes to maintain identical formatting across browsers. Here is my attempt at offering a few tips that will hopefully make life just a little easier for people struggling with this.

The layout I'll use for this article features a fixed-height header, 3 columns that will always stretch to the window's height, a centered "menu bar" at the top of the middle column, and a fixed-height footer at the bottom of the page. The LH column has a fixed width of 200px, the content column (middle) is 800px, and the RH column is elastic and will occupy whatever space remains.
Here is the concept:






Appearance:


Nesting structure:



To see the example in action...

The XHTML
The Stylesheet

So presuming you want to ditch your old table layouts, here are the things that have simplified the process the most for me. First off, commit not to give up too soon on making one valid css work for everything. If you must resort to ugly IE or Firefox hacks, exhaust your other options first! You all know what I mean... text-align:-moz-center, malformed CSS that IE will see but Firefox won't, using server-side tricks to serve different stylesheets to different browsers, etc. Shame on you! Okay, just kidding... I've done it too and do it even in this example. The point of this, though, is that if hacks like this are your *first* resort, your stylesheet is going to become needlessly hard to manage. The point of this posting is to point out that it is possible to get a page to display properly with minimal nesting of divs, without using tables, and with less CSS-mangling than you might think to pacify non-compliant browsers. So, can you imagine an easier coding experience with me?

Here are what I consider a few of the most important guidelines for wrangling your layout into obedience:

  • Always use the XHTML Transitional or Strict doctype declaration; this alone remedies many IE irregularities, especially for IE6;
  • Don't forget to include the xmlns attribute on your html element;
  • Don't use text-align:center; to center block level elements; follow the two rules above then see what margin: 0 auto; does (yes, even in IE6!);
  • Vertical stretch not working? Add height=100% attributes to your html and body elements;
  • Keep your layout blocks as direct children of the body element. Giving in and nesting your divs too soon only makes it harder to sort things out and fix them down the road;
  • Be judicious in your use of padding... it expands the size of your block elements, complicating the math you need to do to fix overlap issues.
  • Instead of padding, use a margin on your inner containers (like p elements).
  • Set up .center, .left and .right classes for text alignment and then always explicitly align your p elements; do not leave this to chance.
  • Control block-level alignment via elements themselves, not their containers...
  •   Use margin-right:auto; to align a div to the left within its parent container.
  •   Use margin-left:auto; to align a div to the right within its parent container.
  •   Use margin:0 auto; to center align a div within its parent container.


Now for some explanation of the stylesheet I used here:

/*
Only two IE hacks are used in this stylesheet:
1) *height for IE6 vs min-height for Firefox;
2) clear for Firefox vs. *clear for IE6
3) Nesting is used minimally in the HTML, while preserving proper sequence of elements:
Body (gray)
Container for LH & CONTENT divs (blue)
LH div (transparent)
CONTENT div (green)
RH div (transparent)
Empty float-clearing div
FOOTER div (black)
*/
html {
position:absolute;
height:100%;
font-family:Calibri, Arial;
}
body {
/* the body element actuall provides the color for our RH flanking div */
background-color:silver;
margin:0px;
padding:0px;
border:none;
width:100%;
}
div {
border:dotted 1px orange;
}
h1, h2, h3, p {
/* adding a margin to the text elements avoids having to add padding to their containers */
margin:10px;
border:dotted 1px blue;
}
#head {
width:100%;
height:30px;
text-align:center;
background-color:black;
color:#EDEDED;
}
#contentandlh {
/* making the container a float allows it to resize to accommodate child floats */
float:left;
clear:left;
background-color:#aabbff;
}
#lh {
float:left;
margin:0px;
padding:0px;
*height:100%;
min-height:100%;
width:200px;
}
#content {
float:left;
/* float left keeps firefox from leaving a gap with blue showing below the content div, since floats expand to accommodate child floats */
width:800px;
*height:100%;
min-height:100%;
background-color:#eeffee;
}
#rh {
margin-left:0 auto;
text-align:right;
}
#foot {
width:100%;
height:25px;
text-align:center;
background-color:black;
color:#EDEDED;
}
.post {
width:450px;
background-color:white;
margin:0 auto;
}
.quote {
width:400px;
margin:0 auto;
text-align:center;
background-color:#DDFFDD;
color:#222222;
}
.menu {
margin:0 auto;
width:600px;
text-align:left;
background-color:#333333;
color:orange;
}
.clear
{
/* without this hack, IE6 will create a vertical gap after the clear */
clear: left;
*clear: right;
margin: 0;
height:0px;
width:0px; }

Copyleft 2007, Rare But Serious Side Effects and Paul C Smith

First Post

Thank you for reading my first post. It's not meant to be interesting, but hopefully future ones will.