9/30/2014
Login
 Thoughts on Web Development
AJAX Monday, October 31, 2005 12:17 PM
I've been looking a little closer at AJAX over the last week or so. AJAX stands for Asynchronous JavaScript and XML. It makes for a much better user experience - that is a way to update parts of a web page without reloading and re-rendering the entire page. There's a lot of different technologies which AJAX touches - HTML, XML, XMLHTTP, DOM, DHTML, and XHTML. With AJAX it's possible to cobble together a better UI but it's fraught with peril - very difficult to establish browser capatibility and difficult to debug. It's funny that we seem to be revisiting all the issues that GUI's faced 20 years ago. But I guess in other ways, it really solves the distribution problem.
Uncategorized
0 Comment(s) Add comment
 
Disabling autocomplete in webforms Wednesday, October 26, 2005 12:45 PM
Some of the time it's a good idea to disable autocomplete for certain fields on a form or for the form itself. For example, you might want to disbable this feature for forms filled in on a public terminal.

To disable AutoComplete for a particular input tag, add autocomplete="off" to the field tag:
<input type="password" name="password" autocomplete="off" />

or
<asp:textbox id="tb1" runat="server" AutoComplete="off"></asp:textbox>


You can add the same attribute to the <form> tag to disable AutoComplete for all fields in a form.

To learn more about Internet Explorer AutoComplete, see Using AutoComplete in HTML Forms on MSDN.
Uncategorized
0 Comment(s) Add comment
 
Is there a free lunch Tuesday, October 25, 2005 2:26 PM
I always like to say, "There's no free lunch." Well, maybe I'll ammend that to, "There's no free ring-tones." I'm amazed at the quantity and quality of free things you can get on the internet, especially in the areas of music and software. Free as opposed to pirated/stolen? In any event David Carr has written a good article on the value of information on the Internet.
Uncategorized
0 Comment(s) Add comment
 
Jakob Nielsen on Weblog Usability Tuesday, October 25, 2005 1:58 PM
I've read a book or two by Jakob Nielsen and have generally enjoyed them. So when I ran across a pointer to an article he had on blog usability I printed it off and read through it. In the article he lists the top 10 design mistakes for blogs (of which I manage a couple) - non-descript posting titles and no author photograph. But on other items I don't do so bad - don't have a domain owned by a blog service (I wrote all this code myself) and have more than a calendar to do navigation, What I thought was a bit funny for Nielsen's website is how quaint it looks - no graphics or color schemes. The other items he misses is the use of multimedia (podcasts and video-casts). It seems like Nielsen has stayed true to the first incarnation of the web.
Uncategorized
0 Comment(s) Add comment
 
Updating components Monday, October 24, 2005 1:31 PM
I spent the better part of the morning wrestling with Norton's automatic update. grrrr...

There was a Business Week article on why virus's don't target Apple's OSX which suggests that the reason they don't is because OSX has "inherent security advantages" because it doesn't have to be backward compatible with a huge installed base of applications. This might also be the reason why Apple PC's account for 2% of the market. Then again, the author goes on to site "Windows sclerosis" which, after this morning's waste of time, I might just agree with him.
Uncategorized
0 Comment(s) Add comment
 
Google and Microsoft Friday, October 21, 2005 1:29 PM
I have a softness in my heart and maybe a soft spot in my head for Microsoft. Being an alum of msft, I am grateful for all the opportunities my tenure there provided me. And while they're still doing some great things (like .NET in general and ASP.NET, in particular), I wonder if they really get it. For example, a while ago they decided to update their Windows update technology to include Office. I thought, "Great. Now I can get all those updates for Office when I get my update for Windows." It seemed to make sense to me. However, in practice it seems for some reason that the Office updates frequently require me to place the original CD's in the CD drive. I keep some of my original CD's at home and some in the office. I forget to bring them back and forth, so I'm left with two Office updates which I can't install because I don't have the original Office CD with me. I know I can bring it in, but it just makes me wonder if Microsoft gets it. Once someone has purchased their product, don't make it a hassle to upgrade it to fix a bug. Grrrrr.

At the same time, I noticed that Google announced record earnings based upon their increasing ad revenue. Why can't Microsoft create a compelling search technology which is coupled with an online advertising system. Google's ad campaigns are very easy to use and incredibly flexible.

I noticed the other day that the inventor of wikis is leaving Microsoft. For those of you who've never checked out Wikipedia, take a second and do so. There's a ton of great information on the site. Wiki's are like open source for information. I wonder if Ward Cunningham's departure is another sign of a possible brain-drain which is happening in Redmond. Over the long run, that may be as debilitating to Microsoft as any specific change in market forces.

Uncategorized
0 Comment(s) Add comment
 
Book reviews Thursday, October 20, 2005 2:44 PM
I finished reading Write Faster, Write Better by David Fryxell last night. Fryxell is the former editor-in-chief of Writer's Digest. He does a great job walking the reader through every step of the writing process. His writing process seems to resonate with me more than others I've read about. It's heavily based upon routine and outlines. You can find out more about this and other books that I've read over the last year or so on LimberTech's book page.
Uncategorized
0 Comment(s) Add comment
 
HTML Reformatting in VS.NET 2003 Wednesday, October 19, 2005 10:34 PM
One of the more vexing problems with Visual Studio .NET 2003 is its handling of html source code formatting. The VS.NET developers felt that they might know better than you how your html should be formatted. I couldn't believe when I first started tweaking html code in VS.NET that when I would switch between designer view and html view, the code would be changed entirely. If you're a C or C++ or C# coder, imagine if you will that you've just written a bunch of lines of code and compiled and ran your code. When you step back into the editor, all the formatting and white space has changed. It would be infuriating. Unfortunately, there isn't anything you can do about VS.NET 2003. Fortunately, they've changed that for VS.NET 2005 - you can turn off the automatic formatting. For formatting rules (what rules there are) in VS.NET 2003 check out this blog posting.
Uncategorized
0 Comment(s) Add comment
 
In-line SQL Statements Tuesday, October 18, 2005 12:44 PM
I've been spending a bit of time up on the Microsoft Newsgroups and I'm a little surprised at how many developers use in-line SQL statements in their code. Don't they realize that it leaves them open to SQL Injection Attacks and other nasty problems? Also, it's my understanding that stored procedure execution plans can be optimized and stored in SQL Server to help improve performance. Why don't more people use stored procedures? Scratching my head.
Uncategorized
0 Comment(s) Add comment
 
New sessionid Monday, October 17, 2005 3:14 PM
Recently I ran across a question from someone about forcing the creation of a new session ID. A kludgy way to do this would be to change a line in the web.config file regarding session state:


<!-- SESSION STATE SETTINGS
By default ASP .NET uses cookies to identify which requests belong to a particular session. If cookies are not available, a session can be tracked by adding a session identifier to the URL. To disable cookies, set sessionState cookieless="true".
-->
<sessionState ... cookieless="false" ... />


When ASP.NET doesn't use cookies to track the session state, they pass the sessionid in the URL. If you really want to force a new sessionid to be created, you could change the setting in web.config and then link to an absolute (not relative) url on your website. That would force asp.net to issue a new sessionid because it wasn't in the url (nor in the in-memory cookie). Tricky and kludgy but would do it. But I wouldn't recommend it as I don't like munging the url.
Uncategorized
0 Comment(s) Add comment
 
Expiring pages in browser cache Thursday, October 13, 2005 10:44 AM
For a while now, I've run into the situation where you want to some portion of a website password protected. Not only do you want the site password protected but you also want to make sure that a user cannot go back to a page once they've logged out of their account. For example, you have a website for classroom work and you have a section which only tutor's can access. It would be nice to have a tutor sit down at a workstation in a computer lab, access the tutor-only section of the website, then log-out, and prevent a random student from coming over to the workstation and access the tutor-only page by hitting the back button in the browser. Putting in meta tags in the pages html sorta/kinda works in that if the user quits the browser session then the page won't be displayed again. But it doesn't seem to solve the problem with the back key.

=-=-=-=-=-=-=-

meta http-equiv="pragma" content="no-cache"
meta http-equiv="cache-control" content="no-store"

=-=-=-=-=-=-=-

After a bit of research, I came across the following which seems to work pretty well:

=-=-=-=-=-=-=-=-=-

private void Page_Load(object sender, System.EventArgs e)
{
  ExpirePageCache();
}

private void ExpirePageCache()
{
 Response.Cache.SetCacheability(HttpCacheability.NoCache);
 Response.Cache.SetExpires(DateTime.Now-new TimeSpan(1,0,0));
 Response.Cache.SetLastModified(DateTime.Now);
 Response.Cache.SetAllowResponseInBrowserHistory(false);
}

=-=-=-=-=-=-=-
Uncategorized
0 Comment(s) Add comment
 
Images in a Server Table Wednesday, October 12, 2005 12:29 PM
Recently I was asked how to put images into a server side table control. Here's a snippet of code to show how:

=-=-=-=-=-=-

// Generate rows and cells.
int numrows = 3;
int numcells = 2;
for (int j=0; j<numrows; j++)
{
TableRow r = new TableRow();
for (int i=0; i<numcells; i++)
 {
 TableCell c = new TableCell();
 System.Web.UI.WebControls.Image image = new System.Web.UI.WebControls.Image();
 image.ImageUrl = "images/picture.jpg";
 c.Controls.Add(image);
 r.Cells.Add(c);
 }
Table1.Rows.Add(r);
}

=-=-=-=-=-=-

The important thing to remember is that the table is made up of tablerows which are in term made up of TableCells. Just add the image control to the cell and away you go. Another example of how nice this programming environment is.
Uncategorized
0 Comment(s) Add comment
 
Media analysis of competition Monday, October 10, 2005 1:10 PM
There was an article on the AP newswire over the weekend entitled "At 30, Microsoft Grapples With Growing Up". It was about the challenges msft as it matures. It mentions the partnership between Sun and Google as well as some of the organizational challenges faced by my old company. It also mentioned other competition upon the horizon such as Goffice. Being curious to see what the next big thing is, I thought I'd go to their website. I was surprised to see what appears to be a website wrapped around the idea of a textbox which would automate the entry and storage of html text. The notion seems trivial and hardly a threat to msft's office platform. While there was what appeared to be a presentation application, there is no notion of inter-op between applications, there didn't appear to be a spreadsheet application (excel), database (access), The web still has a ways to go before that type of functionality is available - maybe AJAX (boy, I love wikipedia - now there's an application which might take over for encarta :-).
Uncategorized
0 Comment(s) Add comment
 
Enumerations in DropDownList Boxes Friday, October 07, 2005 12:22 PM
You have to love modern languages like Java and C#. They make it so easy and elegant to do things which would take many lines of code using older programming models. The notion of databindings is one of the things which are particularly elegant. For example, suppose I wanted to populate a DropDownList box with all the names of the known system colors. An easy way to do it would be something like:

=-=-=-=-=-

  ddlColors.DataSource = enum.GetNames(typeof(System.Drawing.KnownColor));
  ddlColors.DataBind();

=-=-=-=-=-

First you specify the data source for the dropdownlist and then you bind it. What could be simpler?
Uncategorized
0 Comment(s) Add comment
 
Talking to the Serial Port from ASP.NET Thursday, October 06, 2005 11:16 AM
Recently, I was talking with a developer who wanted to run a cash register POS (Point of Service) application from an web (ASP.NET) application. Basically, he wanted to be able to read and write to the serial port.

In order to accomplish what he wanted to do, he needed some code on the POS computer (an ActiveX control, for example)
to fiddle with the serial ports. There are quite a few available (I believe Microsoft distributed just such a control with VB6). He then could embed the control in the on the rendered html page with the object tag and invoke commands on it with JavaScript. He could not access devices on the client side just using a web (asp.net) application.

The reason why I thought it was interesting to blog about this is that it shows a fundamental difference between web (asp.net) applications and Windows (.NET) applications. For web applications, you can do very little on the client unless you use javascript to talk to some client side object.

Sidenote: My understanding is that the api to read and write to the serial port has been encapsulated in version 2 of the .NET framework.
Uncategorized
1 Comment(s) Add comment
From brian  10/7/2005 12:41:31 PM
I have to be more careful about using brackets (or I really need to look at a more robust blog entry system or I have to use a new style in my style sheet). I spent the last 30 minutes trying to figure out what was wrong with the blog page. It turns out I was using brackets in one of my entries and that was wreaking havoc on my formatting.
 
Google and Sun Get Together Wednesday, October 05, 2005 11:37 AM
Yesterday, there was news of a partnership between Google and Sun. I thought the news was interesting on a couple of differenct levels. If you look on Google's website you will find a very brief press release which almost downplays the partnership. Certainly there are those in the press who share that belief. Sun, on the othe hand, headlines their site with the partnership and has a much more detailed/grandiose press release and a webcast. Headers from the press release include "Trailblazing Technologies" and "Only the Beginning".

When I interviewed for a technical marketing position at Microsoft, I was asked why I thought Windows had become so successful. I answered that first and foremost, was the number and variety of applications which ran under Windows. Secondly, was the brutal competition in the distribution chain. That is, Windows greatly benefited from the PC distribution channel. Basically, Microsoft greatly benefited from having all the clone manufacturers pushing Windows through the distribution channel.

With yesterday's news, I wonder if Google isn't angling for a similar benefit. That is by pairing with Sun, Google possibly has more software to distribute though it's distribution of the toolbar and java vm. From the two companies' press releases, they want you to believe that Google in benefiting from the java distribution mechanism. I wonder if Google won't end up buying Java and OpenOffice and actually use their toolbar as a way to capture office software market share from Microsoft. While I don't think it would be wise of Google to buy all of Sun, they maybe forced to in order to get Java and OpenOffice.
Uncategorized
0 Comment(s) Add comment
 
Microsoft Evolve Campaign Tuesday, October 04, 2005 10:53 AM
I was on a sailing trip this weekend and the subject of Microsoft came up. I like talking about Microsoft and what a great company it was to work for. I also like to talk about the PC market and debate the image which Microsoft has out in the general public and the media. Mostly, I feel msft does a pretty good job. Mostly.

The subject of the Evolve advertisement campaign came up for discussion on the trip. The campaign is an example where msft is completely off target. I understand the motivation for the campaign - it is to encourage owners of previous versions of Office to upgrade to the latest version. However, msft does itself no favors when it portrays it's installed user base as dinosaurs. There's nothing like insulting your customer's previous judgement in buying your product, to drive them to seek out alternatives. When Windows Vista comes out will and they want people to upgrade earlier versions of Windows, will they protray those buyers as clowns? Or village idiots? I don't get the dinosaur.

Another subject I disagree with msft on is their execution on their certification program. But that's a subject for another day.
Uncategorized
0 Comment(s) Add comment
 
Http Handlers Monday, October 03, 2005 1:39 PM
Creating custom http handlers in ASP.NET is relatively easy. First add a section to the web.config file:

<system.web>
  <httpHandlers>
   <add verb="*" path="*.jpg" type="RequestHandlers.ImageHandler, RequestHandlers"/>
 </httpHandlers>
...

Then create a dll where you will do the work with the IHttpHandler interface:

using System;
using System.Web;

public class Handler : IHttpHandler
{
public void ProcessRequest(HttpContext context)
{
 ... do your work here
}

public bool IsReusable
{
get { return true;}
}
}

It's an easy way to do things like vanity url's (which become much easier in ASP.NET 2.0) or add watermark's to images for your site (more on both of those later).


Uncategorized
0 Comment(s) Add comment
 
© LimberTech 2014