In the new building...

Non-partisan software developer

Friday, January 02, 2009

Amazon Cleverness

Amazon does a cute trick to give the user a visual-cue that their logo in the upper left links to the homepage for

As you mouse over they decorate the logo with the word "homepage" which tells the user---hey click here for the homepage.

As any web savvy user knows sites typically do link their logo to their homepage--but this is a nice touch for those less experienced users.

Tuesday, April 10, 2007

FCKeditor running on the desktop

I've always loved FCKeditor and I used it ever since the pre 1.0 days. We had a requirement at work where we needed to allow users to edit HTML and our solution was for them to type the markup by hand.

So I had a crazy idea to try to use FCKeditor on the desktop. The general idea was to host the FCKeditor html files inside the WebBrowser control. So one night I hacked together a
prototype and it worked! Eventually another developer at work took my hack and built a working component using it as a reference. It worked well for him and I was surprised it turned out so nice.

A while back I saw a post on Channel9 where someone was asking about using FCKeditor in a desktop scenario and they got some replies like: "you can't do that...FCKeditor is written in html and javascript, it's for the web."

I posted about my experience with it and I'll get emails asking how to do it; so I decided to do a quick demo. Eventually I think I'd like to see an open source version that is robust and exposes much more functionality. My demo only allows for saving and retrieving html documents.

The demo application running WinFckEditor. The magic is in the ability to call JavaScript methods from C# using InvokeScript like this:

I've posted a sample project:

Wednesday, December 06, 2006

WPF CornerRadius

In WPF there is the Border type which simply puts a border around any UIElement. I find myself using this alot to create cool rounded corners. The blue rounded rectangle to the right is what we'd like to see...

Well it doesn't work so well if the thing inside your Border element doesn't have rounded corners, it's edges simply bleed over the rounded corner.

And this is what you get (I lowered the opacity so you could see how it bleeds over):

<Border CornerRadius="15" Height="50" Width="50" BorderThickness="1"
<Rectangle Fill="Blue" Height="50" Width="50"/>

Okay you've seen the "ClipToBounds" property which MSDN says: "Gets or sets a value indicating whether to clip the content of this element (or content coming from the child elements of this element) to fit into the size of the containing element."

Sounds like that will work great!

<Border CornerRadius="15" Height="50" Width="50" BorderThickness="1"
<Rectangle Fill="Blue" Height="50" Width="50" ClipToBounds="True"/>

Unfortunately it does nothing :) I am not sure why ClipToBounds even exists because if I restrict the Border element to 25,25 the rectangle cannot be larger than 25, least
from what xaml I've been able to crank out.

So the trick to get this to work is not to use an element inside rather a brush on the background, if you have a visual you could create a VisualBrush. Pretty simple:

<Border CornerRadius="15" Height="50" Width="50" BorderThickness="1"
BorderBrush="Black" Background="Blue" >

The other solution isn't as nice but setting the clip property on the containing element works as well.

Friday, August 18, 2006

The New Desktop Wars... (part 2)

I blogged earlier about Novell and the new desktop wars. I've been playing with Mac OS X and love it. Leopard is coming out and it looks like it's taking user interface concepts further with Time Machine, which makes backup intuitive to a user. If I need an old version of a file I just enter the time machine and locate it by flipping through snapshots of my application (iPhoto) or my folder. simple but it works.

Miguel blogged about people that think wobbly windows are just eye candy...they would be wrong. Sure it looks great but it's more about "feeling great." It's about user experience. Somehow I just feel better when my windows have some physical properties to them, it makes the computing experience feel more real-life.

I've used Ubuntu and SLED with XGL enabled and I do miss my wobbly windows and virtual desktops that spins on a cube. Hopefully Apple starts building in things like this into their OS.

And well Windows XP just isn't enjoyable at all but it's so old....I'm sure Vista will be better.

Honestly of the three next gen desktops I think an XGL enabled Linux distro is in front in this area.

Saturday, August 12, 2006

Displaying a Log4Net log file on an ASP.NET website

I wrote a simple web page to display the log file in a textarea from a data synchronization application that logged all it's juicy details to a Rolling log file.

I fired up the page to see my creation and it worked... until the sync service was fired up and started writing to the log file. After that the blasted page just threw a IO exception at me--another process has an exclusive lock on the file and I can't READ it! Turns out it's the default locking mode for FileAppenders but you can configure whatever you are comfortable with.

<appender name=\"RollingFile\" type=\"log4net.Appender.RollingFileAppender\">
<layout type=\"log4net.Layout.PatternLayout\">
<conversionPattern value=\"%d [%t] %-5p %c{1} - %m%n\" />
<file value=\"Application.log\" />
<appendToFile value=\"true\" />
<maximumFileSize value=\"500KB\" />
<maxSizeRollBackups value=\"5\" />
<lockingModel type=\"log4net.Appender.FileAppender+MinimalLock\" />

The element configures the Appender to use a MinimalLock which only will acquire a lock while it's writing. It appears that it also uses FileShare.Read which will not lock others from just reading it.

It's amazing that this information was so hard to come by, or maybe I was just having a bad google day. At anyrate I thought I'd be a good netcitizen and blog about it so hopeful some poor sap can find this and speed up the troubleshooting--even if that poor sap is me :P

Open Source Graphing Library!

Yea! I learned from Joe Audette on the Mono list about Zed Graph.

I have been looking for a long time for a good C# graphing library that was open source so it could be used on leaner budget projects and just because I don't believe much in paying for SDK and APIs--I have had too many problems with proprietary SDKs and developer APIs that just don't work and their vendors don't support them (e.g. fix or listen to customers) once they have your money. For some reason community based efforts are much better at this. And if they don't listen you can fix it yourself! Sorry, I'll get off my soap box now.

ZedGraph can be used in Web / and Client applications. This looks promising.

Thursday, June 15, 2006

Making the pitch

Phil blogged on pitching your ideas to Venture Capitalists here:

Phil801 - Geek Blog » More on Pitching

Tuesday, June 06, 2006

Brillant way to attract good talent

Finding really good developers is tough... this is one interesting way to catch a driven smart person:

Your application is to build an small application! Wow... now that would really show what you can do. Most interviews / application processes include: talking, talking, and well more talking. Sometimes you'll be asked to write some code on the board. A lot of the time it's some obscure syntax question that doesn't really prove a whole lot other than you REALLY know C++ or Java or C#.

The other thing this type of job application does is get people that REALLY want to work there to apply. It probably won't work for every company, but for companies like Bindows that have a name for themselves, they can get away with this. I would be interested if anyone has done this before to blog about it or a hiring manager's experience with this kind of application process.