December 2003 - Posts - Jon Galloway

December 2003 - Posts

ProFont - nice font for VS.NET

Old news from Joel on Software that I finally got around to playing with:
ProFont for Windows, for Mac, for Linux

It's a fixed width font that looks good at small font sizes, slashes zeros, etc.: 

ProFont vs. Monaco

Back in the days when I did Mac development (System 6) the biggest monitors available for the Mac were maybe 9", and the only way to see a reasonable amount of code on screen was to use a tiny font. Now that I have two 18" LCD panels, the only way to see a reasonable amount of code on screen is to use a tiny font. The world is awash in lovely TrueType fonts but none of them are monospaced, which is a nuisance for programming because things which should line up won't.

Fortunately, I have found ProFont, and all is well again. For best results use the FON version, not the TTF version.

[Joel on Software]

More info here: http://www.tobias-jung.de/seekingprofont/seeking.html

Well, I've been using it as my default font in notepad and Visual Studio for a week and I'm still happy with it. The TTF version seems to work best for me.

Posted by Jon Galloway | with no comments
Filed under:

MSDN ISV Deal - $375

Microsoft has a developer special on their Empower Program. 5 MSDN Universal subscriptions for only $375. You'll get copies of most of their software with it. [Techbargains.com]

Info / Enrollment

ISV Requirements on Microsoft website (shows old price - $750).

 

Posted by Jon Galloway | with no comments

Shared Source Spelunking

I've stumbled across Doxygen documentation on Rotor (a.k.a. SSCLI) on several searches for obscure .NET FCL methods, and it's really interesting. Sure it's different than the Windows .NET Framework redistributable, but I'd bet it's pretty close in most cases, and even if not it illustrates what's functionally going on since this is coded to the same spec. Looking at code that implements the .NET CLI classes tells me much more about them than documentation usually does.

I like the Doxygen format pretty well, too - cross-referenced via hyperlinks, class / namespace / file views, etc.

For starters, check these out:

Probably the best top level entry points are the main Shared Source CLI page or the Namespace index. Oh, and all these links are to http://dotnet.di.unipi.it

Posted by Jon Galloway | with no comments
Filed under:

'System.Uri.NonPathPart' is inaccessible due to its protection level

'System.Uri.NonPathPart' is inaccessible due to its protection level

Argh! Why? Parsing URL's is a pain, the System.Uri object's got some nice utility functions that show the right values in a watch window, and I can't use them. I hate duplicating this kind of parsing, since that includes duplicating the QA effort as well.

Reminds me of trying to call DirectX functions from VB that weren't exported or exposed via the COM interface back in the day. I can see the candy, but I cannot eat the candy.

Wish: System.Uri would be less protective of its utility properties.

Posted by Jon Galloway | with no comments
Filed under:

Using T-SQL to generate ASP.NET code

No rocket science here, but this query has saved me a lot of time. I've got it saved as a tql file in “Microsoft SQL Server\80\Tools\Templates\SQL Query Analyzer\” so I can hit 'Alt+F N' and pick it from the templates.

Scenerio: I've generated data objects with CodeSmith that have a property for each table column. I still need to build edit screens that map textboxes (for the single edit case) or datagrid columns to the objects.

Enter the INFORMATION_SCHEMA view, which returns a row for each column in a given database. I switch query analyzer to text output mode (Ctrl-T) , run the queries, copy the html into the ASPX (HTML view), switch to Design view (so the IDE sees the new controls and throws references to them in the ASPX.CS). Then I pop into the code behind and paste the appropriate “fields to properties“ and “properties to fields“ code and I'm off... to correct the compilation errors. I'm not mapping the datatypes here, and I'm generating edit fields for ID fields that shouldn't be edited. But, it's a good start on an edit page.

declare @table varchar(100)

declare @database varchar(100)

set @table = 'PortfolioPerformance'
set @database = 'ResearchReports'

--**SINGLE ITEM EDIT**
--Generate single item edit textboxes
select
'<TR>
<TD>' + column_name + '</TD>
<TD>
<asp:TextBox id="txt' + column_name + '" runat="server"></asp:TextBox></TD>
</TR>'
from information_schema.columns
where table_name = @table
and table_catalog = @database

--Fill Text fields from class
select
'txt' + column_name + '.Text = _' + @database + '.' + column_name + '.ToString();'
from information_schema.columns
where table_name = @table
and table_catalog = @database

--Set class properties from text boxes
select
'_' + @database + '.' + column_name + ' = decimal.Parse(txt' + column_name + '.Text);'
from information_schema.columns
where table_name = @table
and table_catalog = @database

--**DATAGRID EDIT**
--Generate datagrid template column
select
'<asp:TemplateColumn HeaderText="' + column_name + '">
<ItemTemplate>
<asp:Label runat="server"
Text=''''<%# DataBinder.Eval(Container, "DataItem.' + column_name + '") %>''''>
</asp:Label>
</ItemTemplate>
<FooterTemplate>
<nobr>
<asp:TextBox id="txt' + column_name + 'Add" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator
EnableClientScript="False"
Enabled="False"
id="rv' + column_name + 'Add"
runat="server"
ControlToValidate="txt' + column_name + 'Add"
ErrorMessage="' + column_name + ' is required.">
<nobr></nobr>
</asp:RequiredFieldValidator>
</nobr>
</FooterTemplate>
<EditItemTemplate>
<asp:TextBox id="txt' + column_name + '"
runat="server"
Text=''''<%# DataBinder.Eval(Container, "DataItem.' + column_name + '") %>''''>
</asp:TextBox>
<asp:RequiredFieldValidator id="rv' + column_name + '"
runat="server"
ControlToValidate="txt' + column_name + '"
ErrorMessage="' + column_name + ' is required.">
<nobr></nobr>
</asp:RequiredFieldValidator>
</EditItemTemplate>
</asp:TemplateColumn>'
from information_schema.columns
where table_name = @table
and table_catalog = @database

--Set class properties from datagrid
select
'_' + @table + '.' + column_name + ' = ((TextBox)e.Item.FindControl("txt' + column_name + '")).Text;'
from information_schema.columns
where table_name = @table
and table_catalog = @database
 

Could this be done start to finish with a CodeSmith template? Sure. Um... that's not what I did (this one goes to eleven).

Posted by Jon Galloway | 1 comment(s)
Filed under:

Sun's Project Looking Glass vs. MS TaskGallery

Sun's Project Looking Glass (video) is in the news - the story made the front page on google news, and it's on the front page of the sun site. The video's got quite a bit of eye-candy, but doesn't really seem to offer much in terms of usability. Flipping windows around and typing notes on the back might be nice, I guess. The rest looked great in a demo, but that's it.

A comment in the Seattle PI article indicated that MS Research talked about something like this 4 years ago - TaskGallery (video). It's an ugly site, and comparing the two videos shows the huge advances video cards have made in 4 1/2 years, but if you can look past that you can compare the actual usability aspects (i.e. what you'd want to use day after day vs. what you'd want to show off), the TaskGallery approach goes quite a bit further:

(you really have to watch the video to get the idea)

Both are interesting, but I think I'll save the 3-D for Gorilla at Large.

A funny sidenote - the Sun demo repeatedly points out that a 3-D desktop is the kind of thing that can happen when the software community as a whole approaches a problem as opposed to a single (unspoken “eeeevil”) company. Funny that MSFT was working on this 4 years ago... Good thing Sun's on an innovation rampage with the Java Desktop...

Posted by Jon Galloway | with no comments

IE Addins - FullSource and ieHttpHeaders

Saw a link to this handy tool today on the ieHttpHeaders page: FullSource is an IE addin which displays the HTML after client side javascript gets done with it. Simple install, adds right click “Full Source” option:

 

And if you haven't checked out ieHttpHeaders, it's pretty cool too. Really helpful for debugging redirect issues, forms auth flow, cookies, etc:

 

Posted by Jon Galloway | 3 comment(s)
Filed under:

RunAware (Citrix) demo of FrontPage

MS is advertising a demo of FrontPage on Slashdot banners (which seems brave, but I'd be more than a little surprised if it causes *nix zealots to dash off to store.microsoft.com). Anyhow, the demo is using RunAware, and it's a pretty cool way to run a demo - you actually get to use the app without downloading anything (well, except for a java client applet which hosts a remote MetaFrame session). They've also got Visio and Project 2002 up there.

I think it's a great way to try out software - you can use the whole, uncrippled application, and you don't have a big download or demo app to uninstall. I think they should throw VisualStudio up there as well.

Update:

Phil Weber let me know that VisualStudio (and Windows Server 2003, SQL Server 2000, Office 2003, the ASP.NET Starter Kits, etc.) is available via Terminal Services. You get to play around on a fully loaded server: http://msdn.microsoft.com/vstudio/tryit/

Posted by Jon Galloway | with no comments
More Posts