in

Emerald Hand

Emerald Hand, Inc. community home page.

This Blog

  • Home
  • Contact
  • About
  • Directory of Computers/Tech Blogs

Syndication

News

I'm back to blogging

Worm in liquid maze

Design and development of information management tools.

June 2005 - Posts

  • Daily links

    I’ve been really busy lately. My mail keeps accumulating and I want to write more about Monorail and ASP.NET. Soon.

    General

    Tools

    • Saltstorm – Cool JavaScript compression utility. I’m sure there are many similar tools, but this is professionally done and well documented.
    • Ultimate Developer and Power User Tool List – A great list of tools that every developer and most of power users should be at least aware of.

    Web development

    • Efficient JavaScript code - Writing efficient JavaScript code can be a complex task. This article will help you to know the cost (in terms of memory, execution time, etc.) of various things in JavaScript. My only concern is that it’s written from Opera's perspective, which is not as widely used as IE or Mozilla and so the applicability of the article diminishes.
    • Data persistence in IE – Overview of how to use IE DHTML Behaviors (proprietary Microsoft extension for IE to ease control creation) to persist user data (such as view or control state).
    • Understanding and Solving Internet Explorer Leak Patterns – A great article from Microsoft on what can cause memory leaks in IE. An interesting read providing good insight into the problems I’m trying to solve with my UI project.
    • Six JavaScript features we do not need any longer – Discussion on six JavaScript features that author think should be avoided in JavaScript development (as well as thrown out in the future versions of JS). Mostly I agree, but I don’t think "href="javascript: …", onclick="javascript:" can be thrown out yet. Not until Microsoft fixes the problem with IE only supporting “:hover” CSS pseudo-class for the anchors (<a></a>). Using JavaScript here can prevent anchors from navigating away from the page ("href=”javascript:void(0)"). Using anchors is inappropriate in many cases (which doesn't stop most developers, including me, from doing it), but it can really simplify life sometimes.
    • W3C DOM vs. innerHTML – Another article on JavaScript performance. In this case, two ways to manipulate the page are compared and apparently, “innerHTML” wins in most of the cases. Still DOM is often more convenient. In most cases, the difference should not be noticeable, but it’s nice to know what to look at if JavaScript seems to take too long to execute. Don’t forget that it’s also possible to use various JavaScript profilers, such as Mozilla Venkman.
    • Object Hierarchy and Inheritance in JavaScript – In-depth JavaScript OO capabilities overview. Most certainly, you will learn something knew or recall something you’ve forgotten about what JavaScript is capable of.
    • Design for future: workarounds vs. hacks – All web developers who has to work with CSS sooner or later discover inconsistencies in how browsers handle CSS as well as run into CSS limitations. This article is a good starting point to understanding hacks and workarounds possible in CSS, how they can help and when they’re appropriate to use.
    Share this post: Email it! | bookmark it! | digg it! | reddit!
    Readability Stats: Word Count: 529; Sentence Count: 32; Grade Level: 8.6, more info...
    Posted Jun 30 2005, 11:20 PM by Ornus with no comments
    Filed under:
  • .NET website frameworks

    I’ve finished documentation for my UI project and there are only two or three small tasks remaining before it can be released. They are related to the publishing process. The most important one is a website for the project. I could use sourceforge.net or something similar, but I'm planning to work on commercial projects as well and I would like to have a single place to manage and publish all projects.

    Several technologies can be used today to create a website , from simple HTML to PHP, ASP, ASP.Net, JSP, etc. I decided to use .NET, which narrows it down to ASP.Net 1.1, ASP.Net 2.0 (still in beta) and Monorail.

    I’ve had some experience working with ASP.Net 1.1 in the past. It is a relatively new generation web development technology and it still has some problems. For example creating master pages (a common template for all pages) is not trivial. Another problem is communication between pages, but I recently found out about Page Methods that make it simple. ASP.Net 2.0 solves some of those problems (master pages mentioned above is one), but several fundamental flaws in the design of the framework that I wasn’t able to work around remain. ASP.Net makes it a complicated task to create simple, cohesive and loosely coupled classes in the web application because it’s so easy to put parts of the business logic into the presentation layer. There’s also a problem due to the fact HTML is a state-less environment. From what I’ve read online, I’m not the only one who is struggling.

    Not long ago, I found out about Monorail via this Code Project article. It’s based on Ruby on Rails and it attempts to solve often-encountered problems in web programming. Everything I’ve read about Ruby on Rails had only good things to say about it, but it doesn’t mean that Rails is the silver bullet of web development.

    So far Monorail looks interesting, but it’s still in beta (although looks stable). The main advantage of the framework is that it enforces programmer to separate code into Models, Views and Controllers (MVC pattern). It’s still possible to screw up and have bad design, but it’s not going to be as easy as in ASP.NET.

    Monorail can use either nVelocity (simple HTML templates engine) or ASP.Net for the views. So in theory it should be possible to reuse ASP.NET controls, but I haven’t tested it yet. Monorail developers recommend using nVelocity to keep the views simple, but I’m not sure it is always suitable. I also have concerns about necessaty to go through all the trouble of using a beta framework (ASP.Net 2.0 is in beta too, so I’m just as reluctant). Maybe the same concepts could be implemented in ASP.Net. I doubt it will be easy though. Also ASP.Net is a more widely supported framework. There are more developers writing it in Microsoft than Monorail, more tools and extensions come out for it, etc. Chances are if I need to do something in ASP.Net there’s a control for it somewhere in existence. In Monorail I might have to reinvent the wheel and write my own extensions.

    I’m leaning towards Monorail at this moment. I like that it promotes good design, but there are still some more experiments to do before I can completely justify using it over ASP.Net. Expect more posts on the subject.

    Share this post: Email it! | bookmark it! | digg it! | reddit!
    Readability Stats: Word Count: 610; Sentence Count: 54; Grade Level: 5.5, more info...
    Posted Jun 24 2005, 12:47 PM by Ornus with 1 comment(s)
    Filed under:
  • .NET developers association meeting

    Yesterday I went to a local .NET developers association meeting. It was on the upcoming VS 2005, .NET 2.0, SQL Server 2005 and Team Server. An interesting event, although too short to cover such wide topics in detail. Most of the time presenter just scratched the surface. Often he just told the viewers that a new feature exists but he doesn’t have enough time to go into it and moved on.

    There was a short demo of ASP.NET 2.0. New features are cool, but I still don’t think it’s simple enough. It’s just too easy to screw up and make the project too complex and hard to maintain.

    Another demo was on new VS 2005 development tools (I really liked automatic diagrams to see class relationships). New debugger is much better and makes code analyzes much easier. There's also a new edit and continue feature for C# developers. New Visual Studio looks like a much better platform for code writing and provides a lot of functionality that was either absent or offered by third parties as plug-ins for VS 2003.

    In the end, though, I haven’t learned a lot. It was fun to see it in action, but I’ve been following where .NET is going to and there were no real surprises. The most informative part of the presentation was at the very end when people started to discuss problems they have encountered when they tried to install and work with the new tools. Basically VS 2005 Beta 2 and .NET 2.0 can be installed side-by-side with the old versions, but SQL 2005 doesn’t like to sit on the same machine as SQL 2000. I’d recommend not installing new and old SQL servers as apparently Enterprise Manager gets really %#@) up. If you still decide to do it, I would strongly encourage you to look up more information online.

    Share this post: Email it! | bookmark it! | digg it! | reddit!
    Readability Stats: Word Count: 327; Sentence Count: 26; Grade Level: 4.8, more info...
    Posted Jun 22 2005, 02:08 PM by Ornus with no comments
    Filed under:
  • Child element reference in IE CSS

    I recently found out about this hack to enable ".parent > .child { /* CSS code */ }" (select only direct child, not descendants) support in IE, but unfortunately I’ve lost the link to the original article. Anyway IE doesn’t support ".parent > .child" at all. It simply ignores it. Workaround is simple, but it still involves more work than you would have to do in a more CSS compliant browser (like Mozilla):

    .parent .child { /* direct child data */ }
    .parent .child .child { /* original CSS modified in .parent .child above */ }

    Class references can be replaced with the tag:

    UL LI { /* CSS for direct LI children */ }
    UL LI LI {/* general CSS for LI elements */ }

    This solution is somewhat limited, as you have to know how to restore CSS properties modified for the child nodes, but it’s better than nothing.

    On the side note, I updated CS to 1.1 release. Everything appears to be running smoothly, but if you encounter any problem don’t hesitate to contact me. Update went OK (more or less) and the only complaint I have is that it cannot be automated. SQL scripts had to be run manually, even though the portal does support web installation.

    Also I'm almost finished with the first version of JSOLait UI library. I'm finalizing documentation and planning to release it shortly.

    Share this post: Email it! | bookmark it! | digg it! | reddit!
    Readability Stats: Word Count: 219; Sentence Count: 22; Grade Level: 4.8, more info...
  • Formula 1 in U.S.

    Apologies for not posting anything on the blog for a couple of days. I went to watch Formula 1 practice and qualification runs on Saturday (06/18/2005). After I got back, I had too many things that required my attention and I couldn’t find time to blog.

    The whole thing was a lot of fun. I got to see some of the best racing cars on the planet. It was very exciting to witness professionalism of the drivers when they took the same turns with equal precision from one lap to the next. The only downside was that the cars were too loud. Louder than I was expecting.

    Watching practice and qualification runs is fun of course, but not as fun as watching the real race. The drivers didn’t really try to fight with each other and concentrated on getting their cars tuned in for the track and getting the best time during qualifications run.

    Unfortunately, this year US Grand Prix race was practically a disaster. Seven out of ten teams refused to race due to the defective tires and only six cars raced. Apparently, Michelin tires that came with the latest shipment can deflate at a certain turn. It’s the fastest turn and I understand that with all the forces acting on the car taking it at the high speed the tires become unsafe. Michelin engineers offered a solution of modifying the track slightly so that the cars would have to slow down more on the turn, but FIA officials refused. As the result, Ferrari owned the track with their cars being the fastest in the race. This was the record lowest number of the cars in the race in the history of Formula 1. I hope that this event will not push away Formula 1 fans in the US and around the world, but I doubt there will be as many people following the race next year as there were this year.

    If anybody's interested let me know and I will publish pictures from the event. I might actually publish some later when I find enough time to sort through all of them and pick good ones.

    Share this post: Email it! | bookmark it! | digg it! | reddit!
    Readability Stats: Word Count: 363; Sentence Count: 20; Grade Level: 7.6, more info...
    Posted Jun 20 2005, 02:54 PM by Ornus with no comments
    Filed under:
  • Daily links

    Tools

    • PowerBand - A powerful IE add-in to explore and partially modify current webpage. Very cool and powerful tool. The only complaint I have is that working with CSS is somewhat limited. Computed (a.k.a runtime) CSS for an element can be copied into clipboard, but that’s it. I can’t even view it on the fly.

    Design

    • UI Hall of Shame - Love it or hate it but most developers eventually have to get into UI design. I for one have to do it quite often and I realize there’s a lot of space for improvement for me. One of the ways to learn something is by looking at what not to do and this website is all about bad examples of UI design.

    Web development

    • Pure CSS buttons and XML button via CSS - Often blogs feature button-like elements to allow readers to subscribe to the blog feed. Most of the time images are used, but there are a few techniques I found that can unleash the power of CSS to replace image with HTML tag. If you own a blog and are not afraid of modifying it’s look you might find the links interesting.
    • Whitespace in the DOM - White spaces are always a tricky subject when it comes to HTML (or XML) programming and understanding how they are processed is important for any serious developer. This article covers how Mozilla treats them and how to overcome some of the limitations imposed as the result. I’ve actually done something similar in my UI project to make code compatible with both IE and Mozilla.
    • W3C CSS2 Specifications - I wish I’ve known of this place earlier. It’s one of the best resources on CSS programming. It’s well written and easy to understand (unlike most of W3C writings). There are a lot of examples and discussion on how various special cases should be handled by the browser. The only problem is that none of the browsers fully support CSS specifications. You find that some things work differently in IE or Mozilla from what you might have expected after reading this manual. Still this book is a good starting point when you try to understand why something is behaving unexpectedly.

    Web development examples

    • CSS Desktop - a Windows-like desktop simulation written in JavaScript. Pretty nifty although still needs some work.
    • WebCmd - an example of command prompt written using JavaScript and AJAX. This approach could create powerful tools for remote administration through web interface, but I doubt there are many uses for it other than educational. (via http://www.ajaxian.com/archives/2005/06/ajaxian_command.html)
    Share this post: Email it! | bookmark it! | digg it! | reddit!
    Readability Stats: Word Count: 448; Sentence Count: 30; Grade Level: 7.3, more info...
    Posted Jun 17 2005, 12:33 PM by Ornus with no comments
    Filed under:
  • Simplifying exceptions

    I’ve been working with JavaScript lately and it does support exceptions. Many people for various reasons choose not to use them, but I do. If something isn’t right, I might decide to throw an exception. I guess this comes from my .NET background. What’s different in JavaScript from .NET is the absence of preprogrammed exceptions to deal with common problems. For example in .NET there’s ArgumentNullException to be thrown when one of the arguments is unexpectedly null. I created something similar in JavaScript to indicate that not initialized argument is invalid.

    The problem comes from the code that verifies if the argument is null or not.

    function NoNullArgumentsAllowed( arg1 )
    {
        if( arg1 == null )
        {
            throw new ArgumentNullException( "arg1", "arg1 cannot be null." );
        }
        // Do something useful
    }

    Repeating this code for every argument in every method where argument cannot be null gets boring fast and if something is boring I am reluctant to do it and try to find ways to make it either less boring or (preferably and) simpler. Refactoring to the rescue!

    function NoNullArgumentsAllowed( arg1 )
    {
        CheckIfNull( arg1, "arg1" );
        // Do something useful
    }

    function CheckIfNull( arg, argName )
    {
        if( arg == null )
        {
            throw new ArgumentNullException( argName, argName+" cannot be null." );
        }
    }

    Now whenever I need to check whether argument is null I can just call CheckIfNull. And then it occurred to me. The logic of comparing the argument to null is always going to be the same, so why not attach it to the exception? That’s right, let exception decide for itself if it should be thrown.

    ArgumentNullException.CheckArgument = function( arg, argName )
    {
        if( arg == null )
        {
            throw new ArgumentNullException( argName, argName+" cannot be null." );
        }
    }

    function NoNullArgumentsAllowed( arg1 )
    {
        ArgumentNullException.CheckArgument( arg1, "arg1" );
        // Do something useful
    }

    Now in most cases the logic of throwing the exception is specific to the place it is thrown from. Often though it can be simplified to single true/false answer. To decide if the exception should be thrown we can pass boolean value to the exception checker along with parameters to initialize the exception. Just like it’s done in TDD with assertTrue.

    ArgumentException.CheckArgument = function( condition, argName, message )
    {
        if( !condition ) // use condition != true to enforce condition to be of boolean true
       {
            throw new ArgumentException( argName, message );
        }
    } function NoInvalidArgumentsAllowed( arg1 )
    {
        ArgumentNullException.CheckArgument( arg1, "arg1" );
        ArgumentException.CheckArgument(
    arg1 == expectedValue, "arg1", "arg1 doesn't equal expectedValue" );
        // Do something useful
    }

    This isn’t a big change, but I think following this style of programming will make code cleaner and shorter. With elimination of tedious ifs and throws people should also be more inclined to check that everything is what it is expected to be. In not-interpreted environment (like in .NET) where it’s impossible to modify classes dynamically (well, in .NET 2.0 it’s possible, but I’m not going to go there. It’s not as simple as in JavaScript anyway.) and you don’t have access to the exception class source, requires a different approach. The simplest solution would be to just abstract working with exceptions into a separate class, like so:

    internal class Exceptions
    {
        internal void ArgumentNullException_CheckArgument( arg, argName ){ .. }
        internal void ArgumentException_CheckArgument(
             condition, argName, message, stackTrace ){ .. }
    }

    So what’d you think? Can this approach make working with exceptions easier for you? What do (would) you do to simplify exception handling?

    Share this post: Email it! | bookmark it! | digg it! | reddit!
    Readability Stats: Word Count: 650; Sentence Count: 46; Grade Level: 6.3, more info...
  • Tree columns

    Today I realized there is another problem with the tree control. Actually three. First - there are too many SPAN and DIV elements where I think using list (UL) would be more appropriate. Another is that it’s impossible to set width of each of the columns since each column cell is an inline element and width property of the inline elements is ignored. There is also a small problem with the tree floating and any text following it in the document showing right next to the tree and overlap with the absolutely positioned columns.

    First problem was easy enough to fix. All nodes are now LI elements tugged inside of a UL element. Small modifications to the CSS style sheet and everything works just as before.

    Second problem wasn’t as easy to fix. For the column cells to recognize width attribute they must be block, not inline, but block elements stack on top of each other. Unless they’re flowing, as I found out. And with the column being absolutely positioned the cells float only to the border of the column aligning the way I want them to be.

    The last problem required some additional elements. The whole tree is now wrapped inside of a DIV and is folowed by another DIV, inside of the first DIV, with "clear: both".

    There’s also a small problem in Mozilla. The tree block is expanding horizontally correctly when the tree is expanded to show all visible nodes, but is reluctant (sometimes fails) to collapse back to the minimal width when the tree collapses and nodes that caused the tree block to expand disappear. I managed to find some additional information here and here.

    This Mozilla behavior isn’t as bad as what I experienced with IE. When the browser window gets small enough width IE freezes. This was due to using “white-space: pre” for some of the elements. Ironically “white-space: pre” is what fixes width shrinking behavior in Mozilla. In the end, I managed to balance things out. IE doesn’t freeze anymore (although it does behave incorrectly, when the window width becomes minimal) and Mozilla from time to time works correctly and collapses the width.

    Share this post: Email it! | bookmark it! | digg it! | reddit!
    Readability Stats: Word Count: 368; Sentence Count: 23; Grade Level: 8.3, more info...
  • Explorer tree and flowing DIV column

    I've mentioned in the past that I’m working on a tree control that would also support any number of columns. I also talked about using DIV instead of TABLE to layout the tree and the problem of lining up the columns in a straight vertical line. Today I will write about the solution I found.

    Here’s a simplified example of the tree with all non-essential code removed:

    <div id="treeElement" class="tree"> <div id="node1" class="expanded"> <span class="body">Node 1</span> <span class="columns"> <span class="column">Node 1 column 1</span> </span> <div class="children"> <div id="node2" class="leaf"> <span class="body">Node 2</span> <span class="columns"> <span class="column">Node 2 column 1</span> </span> </div> </div> </div> </div>

    With the following style sheet applied:

    .tree
    {
     cursor: default;
     white-space: nowrap;
     float: left;
     position: relative;
    }
    .tree *
    {
     position: relative;
    }
    .tree .columns
    {
     position: absolute;
     top: 0;
     right: -200px;
    }
    .tree .children
    {
    margin-left: 20px;
    }

    Columns are wrapped inside SPAN element (of “columns” class and absolute position). This and negative right coordinate will cause the columns to show up to the right of the tree. There was a problem in Mozilla with column cells and their tree nodes moving down when the tree expands, but collumn cells are nore moving back up when the tree collapses. Making “position: relative” for all elements inside the tree fixed the problem. “top: 0” is required to fix layout problems in IE working in quirks mode and it’s probably a good idea to have both horizontal and vertical coordinates declared to confuse the browser less.

    There are more problems with the tree and CSS and I will probably write about them soon.

    Share this post: Email it! | bookmark it! | digg it! | reddit!
    Readability Stats: Word Count: 334; Sentence Count: 15; Grade Level: 7.8, more info...
  • Worm at another turn of liquid maze (changing blog URL in CS)

    After some consideration, I decided to move the blog to a new location. http://cs.emeraldhand.com/blogs/WormInLiquidMaze/ is a new place to look for me. I created a new blog at the old location that informs visitors of the new URL. Plus, in the past I’ve shifted to using FeedBurner to host the feed, so anybody reading me through it should not notice any changes.

    The main reason for the move is to get around behavior browsers are showing sometimes when they decided that underscore ( _ ) looks cutter and fuzzier encoded in a hexadecimal number. No, really, why else would they encode it?

    Like everything in life, it took longer to do what I wanted than I expected and in then I found a simple way to do it. I don’t want other CS users, who realize that default replacement of white spaces with underscore upon blog creation is not the best way to generate the link, waste their time so I’ll describe simple procedure to change the blog location.

    1. Ensure system account on which ASP.NET is running has modify permission on the cs/blogs directory. In case you’re wondering by default ASP.NET is running under ASPNET account in Windows XP and under Network Service in Windows 2003. If for some reason, you can’t give the required permission to ASP.NET and you have folders with the same name as your blog created in cs/blogs folder you should change the name of the folder manually to the new location where you want the blog to reside.
    2. Go to the blog administration and at the bottom of the screen where it says “Blog name” enter a new name to be used as a URL for the blog location.
    3. This is where it gets tricky. ASP.NET application must now be restarted. To do it the easiest way copy web.config file from remote host to your computer and back, effectively overwriting web.config with it’s copy. This should get ASP.NET to notice that the file was changed and it will restart the application.
    4. Update all external links under your control to point to a new location.
    5. Laugh at people who are trying to use the old link to find your blog.
      - OR –
      If you’re really nice, create a new blog at the old location to inform them of the change. Even people subscribed to the old feed should notice a post on the new blog informing them to update their link.

    If you have any comments, question or if you have some idea how to redirect browsers directly to the new blog location from the old without the hassle of a second blog let me know.

    Share this post: Email it! | bookmark it! | digg it! | reddit!
    Readability Stats: Word Count: 459; Sentence Count: 30; Grade Level: 6.8, more info...
    Posted Jun 11 2005, 02:51 PM by Ornus
    Filed under:
  • Explorer tree in DHTML with JavaScript and CSS

    The menu is done, at least for now, and I’m switching gears towards implementing tree control. I want to be able to show explorer-like tree with a caveat. One of the requirements for the tree is to have any number of columns to show additional information about each node. I’m not sure if there will be support for preceding columns in addition to the columns after the main tree. I guess that depends on how hard it will be to do.

    There are many tree controls available on the Internet, but practically none of them support columns. In addition, JavaScript use is often required to generate the tree after the page is loaded and in most cases there are two copies of the tree, visual in DHTML objects and behind the scene in JavaScript objects. I want to have the freedom of either generating the tree through JavaScript or generating HTML and just creating Tree object that will attach itself to the generated HTML and initialize with minimum overhead.

    In the past, I’ve created a tree that relies on TABLE tag to show the actual tree (based on http://www.codeproject.com/asp/asptreelistcontrol.asp). This technique works ok with one problem. It’s impossible to have nested rows or nested groups of rows. To expand or collapse a tree node I had to iterate through table rows and show or hide one row at a time. This proved to be a bottleneck as the tree grew larger and eventually I realized that to fix the problem I have to move to a different implementation.

    An alternative to the table is to use block elements, DIV for example, like it's done in this project. Initially everything looked good, until I got to the point of implementing columns. The problem is to align column cells vertically in a straight line while making sure the width of the tree is not fixed. It would also be nice if all of the columns would align at the rightmost edge of the tree. I practically gave up on having columns width fluid and in most cases it should not be a big problem anyway. I’ve been playing around with flow and absolute positioning, but haven’t found a universal solution yet. One of the problems is that columns aligned in a vertical line must not rely directly on the tree nodes. At the same time, it would be good to have each column cell defined inside of the node element to which it belongs, just as TD elements are defined inside TR elements in TABLE. I’ve considered having columns in a separate block, but connecting each column cell to the appropriate node might get complicated especially during collapse/expand, and the whole point of using DIV is to decrease complexity and speed up the code.

    I’ve figured two ways to separate the columns from the tree. One is to float the columns away, to the right for example, and another is to make their position absolute. Absolute positioning is really the preferred way of doing it. In IE if position is absolute but location isn’t specified, than the element occupies the spot it would occupy with static position. In other words in IE once I make position absolute I can set the left coordinate of the column to the width of the tree and with top of the column cell not specified it aligns itself with the row to which it belongs. Initially this is what happens in Mozilla also. However once a node is expanded the following nodes with their columns get pushed down. When the node is collapsed the following nodes return to the previous position, but not the column cells. I have an idea of setting position of the column to static and to absolute again in JavaScript when any node is collapsed, but I’m not sure if it will fix the problem. I will write more on any solution I find tomorrow, if I discover it.

    Share this post: Email it! | bookmark it! | digg it! | reddit!
    Readability Stats: Word Count: 677; Sentence Count: 35; Grade Level: 9.6, more info...
  • Daily links

    General

    Tools

    Web development

    Development tricks

    Share this post: Email it! | bookmark it! | digg it! | reddit!
    Readability Stats: Word Count: 470; Sentence Count: 63; Grade Level: 3.2, more info...
    Posted Jun 08 2005, 04:28 PM by Ornus
    Filed under:
  • Worm in liquid maze on FeedBurner

    After short consideration, I’ve decided to move the blog feed to FeedBurner. It's a service which can generate a mirror blog feed and gathers varios statistics on its use, as well as provides additional tools to work with the feed. The main reason is that if I ever decide to move the blog the feed will remain in the same place, although the links to the achieved posts will probably get broken. I’m not planning to do that, but it’s hard to predict what will happen in the future. Another good reason is that FeedBurner will gather statistics on the blog, such as how many people are reading it. This move should also help to eliminate different problems with the feed that are present in CS 1.0.

    I had to modify Blue Curve skin so that all links would point to the new feed. It was simple but I did have to brush the dust off my ASP.NET developer hat, as I haven’t used it in a while. The code is using current blog’s name to generate the feed link in the form of http://feeds.feedburner.com/BlogName with all spaces removed. I’ve also added reader counter, and it’s 0, what a surprise. Anyway, if you’re interested in checking out the skin here’s the link to archive - http://www.emeraldhand.com/cs/blogs/worm_in_liquid_maze/BlueCurveForFeedburner.zip

    Share this post: Email it! | bookmark it! | digg it! | reddit!
    Readability Stats: Word Count: 240; Sentence Count: 17; Grade Level: 6.0, more info...
    Posted Jun 07 2005, 11:43 AM by Ornus
    Filed under:
  • JavaScript and Mozilla in standard compliance mode

    I’ve been working a lot on my UI project, making sure it works correctly when browser is in standards compliance mode. With IE there are no troubles. I turn strict compliance on and everything works great. With Gecko, it is not so simple.

    When Gecko enters a standard compliance mode not only does it enforce correct CSS, but also corrects JavaScript. I missed the second part initially, since I never saw it being mentioned anywhere. Partially I made the mistake because I wasn’t completely familiar with the tools I’m using. Firefox has JavaScript console (Tools -> JavaScript Console) that reports any errors, warning, and general messages. If I were to look at it when I first encountered following problems or when I was writing the code I could’ve saved some time.

    There are two differences in the way JavaScript works that I have discovered. First in the standards compliance mode it’s illegal to reference DHTML elements by ID directly. So instead of doing someElement.tagName I have to do document.getElementById ( “someElement” ).tagName for the script to be valid. The second problem is related to accessing CSS from JavaScript. When a number is used as a value of any CSS property the unit must be included unless the number is zero.

    I’m actually glad that Mozilla enforces those rules, although I wish there would be an easier way to learn about how the browser’s behavior changes in modes. The best article on the subject I found is http://www.mozilla.org/docs/web-developer/quirks/quirklist.html (from http://www.communitymx.com/content/article.cfm?page=2&cid=E2F258C46D285FEE).

    Share this post: Email it! | bookmark it! | digg it! | reddit!
    Readability Stats: Word Count: 278; Sentence Count: 26; Grade Level: 5.9, more info...
  • Skinning CS blogs

    Default theme for CS blog is good and presents information OK, but it’s too boring. It’s very simple and while simplicity is often the best way to go, this default theme reminds me of MSDN online library too much. I’ve been developing for several years and had to look in the MSDN a lot, so not long ago I decided it’s time to change the look. I’ve quickly glanced at other skins that came with CS 1.0 and figured that there has to be something better out there. I also wanted to add more custom data to the blog web page, but quickly found out that all templates are generic and it’s impossible to custom modify skin for a certain blog. In contrast Blogger allows the user to select one of the predefined themes providing support to customize it at the same time. Of course, if a new skin is chosen for the blog all modifications get lost. Still it’s much better than what CS has to offer.

    Anyhow, I’ve figured that there has to be more information and more skins available for CS on the Internet. I started looking at http://docs.communityserver.org/, but while it did provide a little bit of information there were too many holes in the way skinning works in CS for me to write my own. Next, looking through the CS forum, I found http://cs.ferncrk.com/blogs/stuart/archive/2005/03/21/blogskintutorial0.aspx, which is a first article in a series on how to write a custom skin for the CS blog, and http://www.sagetechnology.com/Default.aspx?tabid=173, a website with a list of CS resources. There I stumbled across BlueCurve (http://blog.salamandersoftware.co.uk/archive/2005/03/06/432.aspx), a great skin by Derek Lakin. He originally created the skin for .Text and has recently adopted it for the usage with CS. Here’s his original  post with the skin for .Text - http://blog.salamandersoftware.co.uk/archive/2005/01/05/358.aspx.

    The skin is nice and is very cool looking. Derek did an amazing job with it. Still it has a couple of problems. It works OK in Mozilla, but in IE the layout of the banner gets broken and some of the buttons or blog description would appear outside of the banner. Another problem is that there is no visual separation between paragraphs in the posts.

    The first problem was due to the way IE handles floating elements, which is different from how Mozilla handles them. In a word I added {clear: both;} to each of the button groups in the banner to make them behave the same way they do in Mozilla. To fix the blog description I did the same thing to it, plus made the width of the description elemen the same width as the banner and centered the text inside.

    Fixing paragraphs was simple. The style defines * { padding: 0; margin: 0; }, so all I had to do was to add p { margin: 1em 0 1em; } to add some space between the paragraphs.

    I also wanted to add a little bit of my own touch to the skin and added several buttons to allow visitors to subscribe to the blog feed with a couple of popular services, like Yahoo or MSN. The modified theme can be downloaded from http://www.emeraldhand.com/cs/blogs/worm_in_liquid_maze/BlueCurve.zip. To install it simply unpack the file to the CS directory\Themes\Blogs. I might add more to the skin if I will think of something, like more subscription buttons. Feel free to contact me if you have any further questions.

    Share this post: Email it! | bookmark it! | digg it! | reddit!
    Readability Stats: Word Count: 626; Sentence Count: 52; Grade Level: 5.0, more info...
    Posted Jun 03 2005, 06:30 PM by Ornus with no comments
    Filed under:
More Posts Next page »
Copyright © 2006-2007 EmeraldHand, Inc. All rights reserved.
Powered by Community Server (Non-Commercial Edition), by Telligent Systems