Jason Clark's Blog

Software, Hardware, whatever...

March 2005 - Posts

CSS, Still not there?

When CSS1 first reared it's ugly head in 1996, it was probably one of the most controversial changes in Web UI history.   Over the years, we've all come to appreciate to some extent, the intended purpose of CSS. In most cases it does as intended and does it well.  But, even after 9 years we're still up to our ears in browser incompatibilities, and until CSS 2 is fully adopted everywhere an un-intuitive way of creating tables in CSS.  We all know how well floating divs works in CSS 1 *cough*.  How can it take 9 years to replace (whatever you want to call it) a simple tag based language (HTML)? 

Tables
All to often I've ran into the "Purist" movement, and been given the proverbial speech "Don't use <table>, you can do the exact same thing in CSS".  Sure, after wasting half a week on ironing out browser incompatibilities and general CSS awkwardness you can do anything.  But what these purists tend to forget is the age-old acronym K.I.S.S (keep it simple stupid).  At the end of the day, it's about getting the job done on time and as "standards based" as reasonably possible.  It isn't about following every recommendation or guideline to the letter, it's not realistic and is not a cost effective way of doing development.  Read this fellas page for some more rants on CSS & Tables.

The future of Web UI
Delivering web based applications over the web is here to stay, and is going to continue to grow as traditionalists realize the benefits.  The delivery method is the biggest hurdle, and hopefully over the years it will improve.  Writing web software for several browsers is a chore, and there is no rhyme or reason for the issues web developers are faced with today.  We need a solid, well-thought out, intuitive way to build applications that is written once and runs on any Browser (if that it is continued to named as such).  Macromedia Flex, Open Laszlo and a few others are moves in the right direction, although they still rely on a plug-in and have some client performance related issues that need to improve.  Hopefully in 5-10 years, the Web based application industry has the delivery model it needs.

ASP.NET 2.0 Themes/Skins

I've been doing a fair bit of work with ASP.NET 2.0 Themes the past day or two, and I have to say I'm impressed with it.   If you haven't heard about ASP.NET themes yet, they are a nifty new feature in ASP.NET 2 that allows you to quickly create a Skin/Theme structure for your web interface.    You can skin the controls that ship with ASP.NET and your own custom controls.  Skins can programmatic-ally be set on an application and global level, which is great for an application where the user selects their theme.   We took a set of themes we had done for an application and dropped them into our ASP.NET theme folders and within about 10 minutues had it hooked into the application, very cool.

For a good starter tutorial on it check out this one written by Bill Evjen.

IE7 Wants.

Recently Microsoft announced IE7, rightfully so as FireFox is certainly gained a loyal following.  On AnandTech 38% of all browsers are Gecko based, while 36% are IE.   I'm still an IE user, have been since IE4.  FireFox is a decent browser, I just prefer IE for some unknown reason.   I've been doing a fair bit of JavaScript work lately, and admittedly I've been using FireFox to do all of my debugging.   FireFox has a wonderful JavaScript console built in, that details the location of the error, including file name for multiple JS files.  It is far and away better than the JS errors IE gives you, "there was an error on line 4 (usually the wrong line number)".   FireFox also does not spawn alerts on JS errors within a page by default, you have to use the Console to view those (the way it should be IMHO). 

 IE Team, if you are listening please put this functionality in IE, while you're at it give us tabbed browsing :)

To Flex or not to Flex.

Recently at FuseTalk, we did some research on building our presentation tier for an upcoming project in Macromedia Flex.   If you’re not aware, Macromedia Flex is a presentation server that serves up Rich interfaces that are generated by server side XML and compiled then presented in the Flash Player.   Macromedia Flex makes a bold statement that the future of Web UI development is Rich & Ubiquitous.   Having built many an interface using CSS/JS, the day where the developer can forget about the cross-browser issues that plague us all, will be well received. 

 

One could say that Macromedia is taking a leap with Flex, is the world ready to develop interfaces in this way?   Well, the product is realistically targeted at enterprise developers, so no, it isn’t the answer to everyone’s dreams right now.  But, it does make a statement about their vision of the future of Web based applications.  

 

We spent about a month with Flex, making mock-ups of various screens that the application had.   The user interfaces you can build are impressive, they look very “Mac’ish”, but can be fully customized via CSS to look however you want.  We figured that Flex would save about 2-3 months work on building a similar interface using straight ASP.NET/CSS interface.  Most of the UI components that Flex provides can be done using ASP.NET minus drag and drop, and some of the behaviors like minimizing panels etc.   Those we would have to write JS libraries for, and would probably not work on every single browser out there (although they would function on the major browsers we’d support). 

 

So, the decision of whether to use Flex or not came down to a few things for us.  One was the IDE.  The strength of a language is tightly coupled with it’s IDE, if the IDE isn’t strong then the language suffers.  I’d say this was probably one of the biggest reasons we decided to stay with the “old school” way of doing things for now.   The IDE that is shipped with Macromedia Flex is called “Flex Builder”, it’s essentially a re-skinned Dreamweaver with some Flex specific widgets and a debugger.    The debugging is a bit on the weak side, sometimes it wouldn’t stop at breakpoints, it was slow and if you wrote your own controls the debugger wouldn’t see them.  Overall the IDE seemed like an afterthought, “heck we built a language, let’s patch up Dreamweaver and use that”.    An IDE architected and coupled with the language is a necessity, having been used to Visual Studio my expectations were high.

 

Besides the IDE issues, the $12K price tag per server and lack of native .NET support also played into our decision to stick with an ASP.NET interface for the time being.   Another factor was performance, particularly the Grid component.   If you moved the scroll bar on a grid up and down, you could watch your CPU usage spike at 30%+ depending on the machine.    Maybe Flash Player 8 will address some of these performance issues.

 

Overall, Flex is an excellent first attempt and shows a heck of a lot of promise. 

What Visual Studio 2005 build are you using?

We're using .NET 2 for an upcoming project, and I've been playing with December CTP.  It's fairly stable minus a few IDE hangs and crashes.  I'm curious what some of you are using, Beta 1? November CTP?  According to MSDN, November CTP is the most current build of Studio and the Framework.   I've noticed that in the December CTP, when you use the ASP.NET Web Configuration, that the Add Custom Provider option is not available.

Any feedback is welcome.

Producing a FullText search query that accounts for RANK and the freshness of content.

Recently at AnandTech, we decided to rewrite our search mechanisms to take date into account, while performing Full Text queries against Microsoft SQL Server's full text functionality.   By default, when you use CONTAINSTABLE, the search service will return a set of results with a RANK value associated with each row.  The RANK value is based on occurrence, proximity etc.  The problem comes when you order by the RANK value, and have time sensitive content.   What we've been toying with is combining RANK with the Date of the content.  The reason for this is to try and give the user results that are not only relevant but are also "fresh".   We went about this by writing a CASE statement into our query which essentially produces a weight value based on how old it is.  In the example query below, you can see how this works.   Based on how many weeks old the content is, we assign it a weight and that is combined with the RANK value that the search service returns.   Obviously we're still fairly RANK heavy, but date is taken into account.  You can adjust how RANK/Date heavy you want the results to be by changing how much you divide each RANK by at the end of each WHEN clause. 

Let me know if you've done something similar, or any thoughts on this technique.

SELECT DISTINCT TOP 21 d.idocumentid,d.vchdocumenttitle, d.dtinsertdate,
CASE
 WHEN datediff(wk, d.dtinsertdate, getdate()) between  0 and 4  THEN (allpages.rank/1.0)
 WHEN datediff(wk, d.dtinsertdate, getdate()) between  5 and 8  THEN (allpages.rank/1.2)
 WHEN datediff(wk, d.dtinsertdate, getdate()) between  9 and 12 THEN (allpages.rank/1.4)
 WHEN datediff(wk, d.dtinsertdate, getdate()) between 13 and 16 THEN (allpages.rank/1.6)
 WHEN datediff(wk, d.dtinsertdate, getdate()) between 17 and 20 THEN (allpages.rank/1.8)
 WHEN datediff(wk, d.dtinsertdate, getdate()) between 21 and 24 THEN (allpages.rank/2.0)
ELSE
 (allpages.rank/3.0)
END AS WeightedRank
FROM documents d WITH (NOLOCK)
JOIN documentpages p WITH (NOLOCK) on d.idocumentid = p.idocumentid
JOIN CONTAINSTABLE(documentpages,txpage,' "intel" AND "centrino"',2000) allpages
ON p.irowid = allpages.[Key]
GROUP BY d.idocumentid, d.vchdocumenttitle, d.dtinsertdate,allpages.rank
ORDER BY WeightedRank DESC, d.dtinsertdate DESC

 

 

More Posts