Non-partisan software developer

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"
BorderBrush="Black">
<Rectangle Fill="Blue" Height="50" Width="50"/>
</Border>

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"
BorderBrush="Black">
<Rectangle Fill="Blue" Height="50" Width="50" ClipToBounds="True"/>
</Border>


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,25...at 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" >
</Border>


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. Wow...so 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\" />
</layout>
<file value=\"Application.log\" />
<appendToFile value=\"true\" />
<maximumFileSize value=\"500KB\" />
<maxSizeRollBackups value=\"5\" />
<lockingModel type=\"log4net.Appender.FileAppender+MinimalLock\" />
</appender>

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.

http://www.zedgraph.org

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:

http://www.bindows.net/jobs/

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.

Thursday, June 01, 2006

Web 2.0 Office -- getting there

Reading more about Web Office Applications and how they are starting to become more viable. There are definately some cool applications that exist right now.

My favorite of the bunch right now has to be Zimbra...



their idea of pluggable "Zimlets" is very powerful. Arbitray bits of data become hot (clickable) and integrated with 3rd party services like VoIP, maps, shipping and shopping services... Some examples are Skype click-2-call support by clicking on phone numbers that become hot inside the AJAX client, Yahoo! Maps simply appear when you mouse over an address.

The reason I think Zimbra has something here is they are integrating with services that are best on the web (think google maps, online shopping, shipping tracking, wikipedia, etc...) these are all services that don't make much sense on the desktop because they require too much data / collaboration etc...

Then I found this quote on Ajaxian....

"What I really want from Ajax apps is for them to do stuff that it’s too hard to do with binary apps. I want them to be sensibly integrated with online resources; I want them to support realtime collaboration. I want them to do different stuff from Word/Excel/Powerpoint, not just do the same thing with a different engine under the hood.

We need to find our way with Ajax applications. Let’s not just port over to the web way, with a poorer version due to the limitations. Rather we need to embrace the differences and do as Paul says. Do things that suit the web better."

This got me to thinking about presentation software. It really works okay on the desktop but usually you want to show your presentations to people all over the place. So now we have a bunch of services that allow us to share our desktop and applications like GotoMeeting etc... This seems like a perfect Web 2.0 application (presentation for the web) but not much has been done with presentation software yet. I found a couple: http://www.meyerweb.com/eric/tools/s5/ and Gliffy.com which isn't really Powerpoint like but more like Visio. There has to be more presentation software that is web based. I'd really like to know what else is available.

Tuesday, May 16, 2006

Really useful people...

It's interesting... I've had chats about this exact topic with other people as I've started to work in Agile environments. The need for specialists is decreasing... the smaller the team the more efficient the project. An interesting article about Agile SDLC and how it changes people's roles: http://www.ddj.com/dept/database/187203749?pgno=1

Monday, March 27, 2006

Novell and the new desktop wars

It's interesting... Novell is rising from the ashes. They are showing some great leadership in the Linux world and creating one compelling desktop.

Miguel blogged about the new desktop release (SLED 10, I am glad they are getting rid of Novell Desktop Linux moniker, Suse is a much cooler)

http://tirania.org/blog/archive/2006/Mar-21.html

Take a look at the first presentation by Nat (Official Presentation), it's freaking cool. It's nice to see all the pieces they've worked so hard on the past couple to three years at Ximian and Novell come together.

Mono has REALLY started to pay dividends and they are building cool applications quickly for linux. (F-spot, Beagle, Banshee, etc...) Diva (video editing) has just started to release and it's looking good.

Xgl is the final part of the solution giving Linux a modern desktop. I am blown away by the coolness this brings to the linux desktop and makes me want to use Linux again. I am sick of waiting for Vista. :)

Sunday, March 26, 2006

KISS

I read a very interesting comment about complexity in software design... it was in response to the latest Vista slip, now shipping in 2007 (ugh...)

"Complexity in the design for complexity sake is the kiss of death. Complexity without a clear, or even muddy, picture of the problem you are actually trying to solve for the actual customer is the kiss of death. Not having customers involved at every step of the design and development process is just arrogance. Believing you know better than the customer is just stupid."

I can't agree with this more. Software should be designed to solve a customer's problem and nothing more... if you don't have a real use case for it then you don't need it. I've made the designing for flexibility mistake myself many times--and still do, it's a real talent to learn what to include and what not to include. I guess why TDD is so popular / successful, you write code in simple small steps to get working code ASAP.

Thursday, March 09, 2006

Writely is part of the google family...

Okay... back on this Web 2.0 companies don't run on Microsoft's platform thing. Well it ain't so.

I was interested when I heard that Writely got purchased by google... great for them. Good for google.

http://www.emilychang.com/go/ehub/interview/writely/

Writely is runing ASP.NET / C#. I find this very interesting because google is a linux shop. I wonder what they are going to do with this company, rewrite it all? Run it on mono?

I appears something is going to happen: http://googleblog.blogspot.com/2006/03/writely-so.html

And I quote "...until we've moved Writely to Google's software architecture." Sounds like a rewrite to me. But heck who would blame them if google has like 25,000 linux machines and no windows licenses :)

Saturday, February 25, 2006

Web 2.0 Startups

If you were going to startup a new web company providing software services in a browser what would that company look like? What is it's culture, what does it's first year look like (and it's second etc...)? What type of technology do you build with?

Meebo is an interesting company, they've become very popular and started a company in a way that I think is very smart... low overhead and created a special relationship with their user community. How much money did they get and how?

I was interested in what technology / platforms these new applications are being built on and I did a netcraft on all the top Web 2.0 companies and they ALL use Linux (saw one BSD) and almost all using Apache.

I really wondered about why they are all using Linux... Then I found this blog entry from a Microsoft guy (Robert Scoble)... cool someone did the research already! A very good read...
Why Web 2.0 companies aren't using Microsoft's platform.