feedback
Jun 29 2005

ASP.NET & AJAX

by John Dyer

Slashdot is reporing on Microsoft's promise to release a new ASP.NET AJAX framework that will add existing functionality to the Callback features already present. Scott Guthrie also talks about it.

So far here are ASP.NET frameworks I've found:

And some non-ASP.NET specific frameworks:

Some other cool call back releted stuff here:

Jun 22 2005

Hanselman's updated "Ultimate Developer Tools List"

by John Dyer

Simply awesome: Ultimate Developer Tools List

The one thing I'd add is Candy Lab's AppRocket. I use it to launch almost everything and I uninstalled all desktop search tools in favor of this little gem.

Jun 21 2005

JavaScript Color Picker (PhotoShop-like)

by John Dyer

A few months ago, I built an application for DTS that catalogs pictures, media, ppt, etc. into a huge web database. I wanted to incorporate the ability to search by color (ala iStockPhoto), so I wrote some code to analyze the most frequent color ranges in an image and store that in a index so that the colors could be search like any other many-to-many database relationships.

In order to feel like the web app was a real app, I wanted wanted to have a sweet color picker for the search page. I looked around the web for a good solution, but I couldn't find anything that was really powerful. One day, while getting my house inspected, I came up with the idea to use transparent PNG images to build a color picker just like the one in Adobe PhotoShop. I was able to "trick" JavaScript into producing separate modes for Hue (including a websafe mode), Saturation, and Brightness . Here's the end result:

Hue mode:

ColorPicker - Hue Mode

Saturation mode:

ColorPicker - Saturation Mode

Brightness mode:

ColorPicker - Brightness Mode

Websafe mode:

ColorPicker - Hue Mode

I've finally gotten around to wrapping it up for others to look at and I'll be posting it to my code lab once I get it all setup.

Jun 21 2005

Switching to Dvorak (or trying to learn)

by John Dyer

I've been noticing a few friends (some in the programming world, some not) start to suffer from carpal tunnel syndrome. Some have started to move over to the DVORAK layout and I'm starting to teach myself the layout. Hopefully, by the end of the summer, I'll be speeding along on just the home row. There's a great advocacy website that just came out DVZine.org.

DVORAK layout

I do most of my work on a laptop, but I'm also considering getting one of these babies, though $79 is a lot for a keyboard. It's a keyboard with no markings (which apparently makes you type faster when the dependancy on looking at keys is removed) and teh keys under strong fingers (thumbs, index fingers) are weighted differntly that the keys under weak fingers (pinkies).

Das Keyboard

If anyone is also trying to make the switch, I'd love to hear about it.

Jun 17 2005

Firefox + WMP + frames = poopie

by John Dyer

I'm working on a project that uses Windows Media Player and Firefox is not playing along. We are creating a video player skin that has two IFRAMEs. WMP issue script commands at set times which load content in the IFRAMEs. This works pefectly in IE and Firefox in WMP 6, but in WMP 10, Firefox doesn't load the content into the frames. It just launches new windows everywhere.

Apparently it's a Gecko bug that no one wants to fix. I've asked about it in MS's WMP usenet group, but no one could produce any workaround code. There's a bunch of legacy/non-standard stuff that kind of works in NS 7.1 (here and here), but it's useless in Firefox.

If anyone knows how to fix this, I'd love to hear about it.

Jun 15 2005

IP Address to Country/State (for CommunityServer) using www.hostip.info

by John Dyer

I am about to begin overhauling a pretty big site (DTS) and I've been collecting user resolution data to determine if we can do a 1024x768 layout. While browsing for IP-to-country databases, I stumbled upon http://www.hostip.info/, a site which keeps up-to-date data of IP addresses and their country codes and state information. They offer a free download of the database (about 25 MB, 500 MB unzipped!) as well as a simple GET page where you can retrieve the info programmatically.  I wrote a quick ASP.NET sample script to pull the data:

string ipUrl = "http://www.hostip.info/api/get.html?ip=" + Request.UserHostAddress;

WebClient webClient = new WebClient();
Byte[] ipInfoBytes = webClient.DownloadData(ipUrl);
UTF8Encoding encoding = new UTF8Encoding();
string ipInfo = encoding.GetString(ipInfoBytes);

Response.Write(ipInfo);

Long term, it'd probably be better to download the data and use your own local copy, but their response time was pretty zippy and it works for now.

Then I thought it would be cool to hook it up to CommunityServer's new CSModule event model and pull user's locations when a new account is created so that the Location property is automatically filled in. This could also be done every time a user logged in (the UserValidated event) which would make things very interesting!

Here's a link to the CSModule code:

If you want to use it out of the box, download the second file, compile it, and copy RefreshDevelopment.CommunityServer.Modules.UserIpLocation.dll into your /bin/ folder. Then add the following line to your CommunityServer.config file between the tag.

Jun 10 2005

CommunityServer Skin Comparer

by John Dyer

While upgrading a CS 1.0 site to CS 1.1, I wanted a quick way to compare skins. I wrote a little aspx script that loads all the *.ascx files in one directory and compares them to the files in another directory. It checks all the controls on the skin and makes sure there is a corresponding control with the same ID and type as in the first directory. Here's what it looks like:

CS Control Comparer

If Telligent adds skins or adds/changes controls on those skins between versions, this will help you find the changes quickly.

Hope that helps someone out there!

Update: Now also compares controls with no ID.

Jun 8 2005

CyScape Rules (at pitching their product and ignoring browserCaps)

by John Dyer

In ASP.NET's machine.config there is a section called browserCaps which tells .NET what browser a client is using and what it supports. When ASP.NET first came out it was notoriouly MSIE-centric, but with the advent of newer browsers, the browserCaps should have been handle the changes with minor updates.

Microsoft gave the task of keeping machine.config up-to-date to CyScape.com. The page http://www.cyscape.com/browsercaps/ has not been updated (to my knowledge) in the 5 years since ASP.NET first appeared on the scene! Thankfully Rob Eberhardt has up-to-date browserCaps info.

The funny thing is that if you go to his main site, you get this message "Sorry, slingfive.com requires Internet Explorer 5.5 or newer running on Windows.
Please come back when you can!". Too funny!!

Jun 7 2005

Safari 1.3 and 2.0 support coming soon

by John Dyer

FreeTextBox (like all other JavaScript HTML editors) supports browsers that have the 'contentEditable' attribute enabled and the 'document.execCommand' method. IE 5.0 for Windows was the first to enable this, then Mozilla started supporting it with their 2003/06/24 build. Now, Safari 1.3 for Mac OSX 10.3.9 and Safar 2.0 for Mac OSX 10.4 (Tiger) has enabled some support for (original post, example editor)

I am working to enable Safari 1.3 and 2.0 support for the next version of FreeTextBox. It's a fun challenge and will hopefully broaden ASP.NET and FreeTextBox's usefulness.

Update: Just FYI, Safari support (if I can get it working) will probably be pretty spotty. Right now, it appears Safari looses focus on selected text when a button is pressed!

Jun 3 2005

CommunityServer date format hacking

by John Dyer

I love the CS skinning model, but sometimes it's difficult to get at the formatting of certain controls. The nifty date format I have here on this blog required a bit of a "hack" to work since the date formatting is hard coded into the CS source code. I could've modified the source to do this, but I wanted to use the skinning model. In the file \cs1.0_src\Blogs\Controls\EntryView.cs line 67, you find this code:

EntryDesc.Text = string.Format("posted on {0}",DataSource.BloggerTime.ToString("f"));

I wanted to modify the formatting from the default "f" to something else. Thankfully ASP.NET's event model and slick date parsing makes this super easy. I just modified \cs1.0\web\Themes\Blogs\MyGreatSkin\Skins\Skin-EntryView.ascx to include on OnPreRender event (quick note: Page_XXX methods don't need the method signature):

<script runat="server">
void Page_PreRender() {
string dateString = EntryDesc.Text.Replace("posted on ","");
DateTime realDate = DateTime.Parse(dateString);
EntryDesc.Text =
string.Format(
"<span class=\"postdate-dow\">{0}</span>"
"<span class=\"postdate-day\">{1}</span>" +
"<span class=\"postdate-monthyear\">{2}</span>",
realDate.ToString("ddd"),
realDate.ToString("dd"),
realDate.ToString("MMM yy")
);
}
</script>

That's it!

Jun 3 2005

JavaScript Debugging

by John Dyer

Mozilla's JS debugger is a god-send for JavaScript development, but everything still needs to work in IE and debugging in that environment can be rough. When I started doing JavaScript, I would use alert('current var=' + myVar); all over the place to figure out what was happening in the code. Later, I started embedding a TEXTAREA in and writing text to that box. But I wanted a way to debug without messing up the exiting page and still work with IE. The solution I've come up with is to launch a new window and dynamically create a TEXTAREA in that window that I could write to (just like Mozilla's debugger)

Usage

JavaScript Debugger example

Results

JavaScript Debugger example

Download JS Debugger

Jun 2 2005

ZoomMenu (GoogleX knockoff)

by John Dyer
A few months ago someone at google created something called GoogleX (the original was taken down: mirror 1, mirror 2, story). It was a google search page with a menu of google services (web, images, news, etc.) that functioned much like the Dock Menu in OS X (or ObjectDock, QTBar for Windows). The google version didn't behave exactly like the OS X menu in that only one item was zoomed at a time (see mirrors). So I decided to see if I could code a menu that functioned a little more like the...(read more)
Web Statistics