Tuesday, 22 February 2005
ADO.NET 'reference'
OK, I admit it - I can never remember various different ADO objects/methods... sometimes I look up code I've written before, but these ADO.NET examples are a pretty good summary of the most common bits - and they're in context which is useful.
Monday, 24 January 2005
SQL Server - when STATIC is DYNAMIC
My head hurts... according to MSDN documentation on CURSORS:
“Forward-only: The rows are not retrieved from the database until they are fetched”
“Static: The complete result set of a static cursor is built in tempdb when the cursor is opened”
which seems mutually exclusive, but
“SQL Server considers both forward-only and scroll as options that can be applied to static, keyset-driven, and dynamic cursors.”
and finally
“When a database API cursor attribute or property is set to forward-only, SQL Server implements this as a forward-only dynamic cursor.”
so specifying STATIC FORWARD ONLY gets implemented as DYNAMIC FORWARD_ONLY (no tempdb)
and STATIC alone gets the tempdb copy you’re (presumably) after…
Forward-only Cursors
Static Cursors
“Forward-only: The rows are not retrieved from the database until they are fetched”
“Static: The complete result set of a static cursor is built in tempdb when the cursor is opened”
which seems mutually exclusive, but
“SQL Server considers both forward-only and scroll as options that can be applied to static, keyset-driven, and dynamic cursors.”
and finally
“When a database API cursor attribute or property is set to forward-only, SQL Server implements this as a forward-only dynamic cursor.”
so specifying STATIC FORWARD ONLY gets implemented as DYNAMIC FORWARD_ONLY (no tempdb)
and STATIC alone gets the tempdb copy you’re (presumably) after…
Forward-only Cursors
Static Cursors
Tuesday, 18 January 2005
John Howard, Blogger?
For those not in sunny Australia, John Howard is our very long-serving Prime Minister (yes, we're still a democracy, it just seems like he's PM for life...)
Anyway, this 'unofficial' John Howard Blog is bloody funny...
[Sorry, I'll blog something tech-related again soon...]
Anyway, this 'unofficial' John Howard Blog is bloody funny...
[Sorry, I'll blog something tech-related again soon...]
Tuesday, 11 January 2005
Scrolling tables, fixed headers
A common Html display problem in enterprise applications is presenting lots of tabular data. Users are 'used' to Excel tables where they can always see the column headers as they scroll down a list.
MSDN has a useful example of a scrolling table with fixed header using HTC. It's IE-specific (of course) but seems to be fairly easy to implement. This does pretty much all I need, for now.
However, ActiveWidgets Grid is an awesome Excel-like grid view with column and row headers, plus icon/tooltip support. It's "somewhat" cross browser too (IE, Mox, FF but not Opera, Safari) and if I was really wanting to impress someone this is the one I'd use. One downside is the population of the table via Javascript arrays, which I suspect makes it impossible to do rowspan/colspan tricks which I often need.
MSDN has a useful example of a scrolling table with fixed header using HTC. It's IE-specific (of course) but seems to be fairly easy to implement. This does pretty much all I need, for now.
However, ActiveWidgets Grid is an awesome Excel-like grid view with column and row headers, plus icon/tooltip support. It's "somewhat" cross browser too (IE, Mox, FF but not Opera, Safari) and if I was really wanting to impress someone this is the one I'd use. One downside is the population of the table via Javascript arrays, which I suspect makes it impossible to do rowspan/colspan tricks which I often need.
Monday, 10 January 2005
WYSIWYG Editors in DHTML
I can't count the number of projects where the user's have asked for a text-input area "just like Microsoft Word". Inevitably they also ask for some specific feature or function that means the last control I used is not quite right.
Here is a list (for future reference) of some of the open source alternatives: Open Source WYSIWYG Through-The-Web Editors.
Of course, there's always RichTextBox if you want to pay (and get support!).
p.s. blogging has slowed dramatically in this new job. Hopefully it'll be more regular in the new year!
Here is a list (for future reference) of some of the open source alternatives: Open Source WYSIWYG Through-The-Web Editors.
Of course, there's always RichTextBox if you want to pay (and get support!).
p.s. blogging has slowed dramatically in this new job. Hopefully it'll be more regular in the new year!
Thursday, 30 December 2004
Asia Earthquake/Tsunami Aid...
"The Australian public can help these aid agencies reach affected people by giving much needed cash donations to purchase and deliver urgently needed supplies. In kind donations of clothing, toys, blankets and food are NOT being collected as it is expensive to transport these goods overseas and they can be purchased more cost effectively either locally or regionally."
ACFID - Asia Earthquake
How to Help
Thank you
ACFID - Asia Earthquake
How to Help
Thank you
Monday, 22 November 2004
Australiana
This is a pretty cool site for travellers and Australians...
Know Your Australia
lots information including things you might not expect - such as language, food, humour and also The Man From Snowy River and other poems by Banjo Paterson.
OK, a bit off-topic...
Know Your Australia
lots information including things you might not expect - such as language, food, humour and also The Man From Snowy River and other poems by Banjo Paterson.
OK, a bit off-topic...
Tuesday, 26 October 2004
Page Inheritance In ASP.NET
Page Inheritance In ASP.NET is a favourite topic of mine, and although I've implemented a similar model to this in the past, I like how Jon's written it up.
Sunday, 24 October 2004
C# "using" Tricks
Interesting idea from whatever: Stupid "using" Tricks -- scroll down to WriteEndElement and the discussion on writing xmlWriter...
Xml Sucks...
Well, not really - but some people obviously think XML has some serious deficiencies.
Came across that link - a long read but interesting points-of-view - while searching for info on the iTunes (rocks!) Music Library XML file. I want to move info between two installs of iTunes (song ratings, # plays, etc) and thought hacking the XML file would be fairly easy. However, the XML file itself it weird and not what you'd expect from a semantically-rich XML syntax.
My first impression was that it was a pretty crappy XML implementation... so I jumped onto Google to see what others thought.
This article Playlist to XML had an interesting comment by Bob Ippolito:
Anyway, the same blog has some useful code for transforming the iTunes format : Cleaning up iTunes plist XML. It's not quite what I want... but will get to that another time.
Came across that link - a long read but interesting points-of-view - while searching for info on the iTunes (rocks!) Music Library XML file. I want to move info between two installs of iTunes (song ratings, # plays, etc) and thought hacking the XML file would be fairly easy. However, the XML file itself it weird and not what you'd expect from a semantically-rich XML syntax.
<plist version="1.0">
<dict>
<key>Major Version</key><integer>1</integer>
<key>Minor Version</key><integer>1</integer>
<key>Application Version</key><string>4.6</string>
<key>Music Folder</key><string>file://localhost/F:/My%20iTunes/</string>
<key>Library Persistent ID</key><string>037D341EA9748F0D</string>
<key>Tracks</key>
<dict>
<key>136</key>
<dict>
<key>Track ID</key><integer>136</integer>
<key>Name</key><string>Evolution (Intro)</string>
<key>Artist</key><string>Bliss n Esso</string>
<key>Album</key><string>Flowers In The Pavement</string>
<key>Genre</key><string>Hip-Hop</string>
etc...
My first impression was that it was a pretty crappy XML implementation... so I jumped onto Google to see what others thought.
This article Playlist to XML had an interesting comment by Bob Ippolito:
So maybe I was being too harsh on the format -- never jump to conclusions or make assumptions about technology! Try to anticipate the creator's goals rather than dumping on something because it doesn't fulfil yours. Here's Apple's doco fyi.
>>"The plist format is nasty, whoever designed it really didn't know anything about XML."
>That's just totally wrong. XML Property Lists are a very unambiguous and simple serialization format. They're designed to be extremely simple and fast to parse (no attributes, etc.) because they're ubiquitous in OS X.
Anyway, the same blog has some useful code for transforming the iTunes format : Cleaning up iTunes plist XML. It's not quite what I want... but will get to that another time.
Tuesday, 19 October 2004
On NHibernate...
Object-relational modelling is an interesting topic - but it just seems so different/foreign that it's hard to know where to start.
It's helpful to read positive comments like these article: NHibernate and NHibernate Part Two, but there are soe many other options, like NPersist and many others...
Paul Wilson has a lot to say on Examples of O/R Mapping vs Stored Procedures
Anyway, eventually we'll get around to implementing something... somewhere...
SOT: The REAL Reason Behind the ObjectSpaces Furor
It's helpful to read positive comments like these article: NHibernate and NHibernate Part Two, but there are soe many other options, like NPersist and many others...
Paul Wilson has a lot to say on Examples of O/R Mapping vs Stored Procedures
Anyway, eventually we'll get around to implementing something... somewhere...
SOT: The REAL Reason Behind the ObjectSpaces Furor
Open Lucene.NET
Wow - I didn't know that Lucene.net "disappeared" from SourceForge (wonder if selling it will work?)... to be recently replaced by Open Lucene.NET - The Open Source Search Engine.
Thanks Scott.
Thanks Scott.
Tuesday, 12 October 2004
VB.NET and C# syntatic diffs
Although I will always use C# by choice, I'm currently using the (better than nothing) tool ANTS.Load which uses VisualBasic for Applications 'automation'...
So, what's a C# programmer to do? Use this handy
VB.NET and C# Comparison
BUT what is VB for the C# @"literal string" ????
So, what's a C# programmer to do? Use this handy
VB.NET and C# Comparison
BUT what is VB for the C# @"literal string" ????
Sunday, 10 October 2004
"Unable to Start Debugging" with VisualStudio web project
I much prefer Asp.net without web projects but setting it up on a new PC resulted in the dreaded "Unable to Start Debugging" message when I hit F5.
This MSDN article PRB: "Unable to Start Debugging" is NOT the problem in many cases.
It could also be that the site/virtual directory you are attempting to debug is using a different version of the framework than your app (eg. 1.0, 1.1 or 2.0) and requires you to run ASPNET_REGIIS.exe
Or it might be IIS authentication settings...
BUT for me, today, the problem was that my site (using 'Local', not 'Web Project' settings) did not have a web.config file. Simply adding a web.config file fixed the problem (all the above settings already being correct). A 'Web Project' would automatically have a web.config file included, but creating and converting a 'Class Library' to a website did not... Oops!
This MSDN article PRB: "Unable to Start Debugging" is NOT the problem in many cases.
It could also be that the site/virtual directory you are attempting to debug is using a different version of the framework than your app (eg. 1.0, 1.1 or 2.0) and requires you to run ASPNET_REGIIS.exe
Or it might be IIS authentication settings...
BUT for me, today, the problem was that my site (using 'Local', not 'Web Project' settings) did not have a web.config file. Simply adding a web.config file fixed the problem (all the above settings already being correct). A 'Web Project' would automatically have a web.config file included, but creating and converting a 'Class Library' to a website did not... Oops!
Monday, 6 September 2004
'Architecture' articles
OK, so I got flamed a bit for sending around this article - .NET Architecture Center: : Secrets of Great Architects. Yes, you have to (try and) ignore the gung-ho Microsoft-speak about "being a *great* architect" but the fundamentals are all there.
Possibly this is a better article Realizing a Service-Oriented Architecture with .NET - it's shorter, easier to read and the pictures make more sense. The scope is a litter narrower, but still a useful read for anyone who thinks 'architecture' is only for buildings.
This info on Developing Identity-Aware ASP.NET Applications is useful and "also provides detailed prescriptive guidance for implementing intranet and extranet ASP.NET applications that are integrated with Active Directory."
Possibly this is a better article Realizing a Service-Oriented Architecture with .NET - it's shorter, easier to read and the pictures make more sense. The scope is a litter narrower, but still a useful read for anyone who thinks 'architecture' is only for buildings.
This info on Developing Identity-Aware ASP.NET Applications is useful and "also provides detailed prescriptive guidance for implementing intranet and extranet ASP.NET applications that are integrated with Active Directory."
Wednesday, 1 September 2004
Localization Resources with ASP.NET 2.0
Two CodeProject articles on Creating multilingual websites are great sources of information, and actually mirror the way I've also approached the problem with my own projects.
But something I hadn't read much about (yet) is Using Resources for Localization with ASP.NET 2.0 (Fredrik Normén's) which was linked from CodeProject. The approach in ASP.NET 2.0 still seems a bit clumsy to me - still no "built in" way to have site-wide localization management, nor a simple cross-over between localization of static elements (such as labels, text, html elements) and database-resident information (product names, news items, etc). You could argue that there are a multitude of possibilities and that Microsoft can't address all possible permutations -- but why not at least offer a basic solution, like they do for Authentication, Personalization, MasterPages, etc???
But something I hadn't read much about (yet) is Using Resources for Localization with ASP.NET 2.0 (Fredrik Normén's) which was linked from CodeProject. The approach in ASP.NET 2.0 still seems a bit clumsy to me - still no "built in" way to have site-wide localization management, nor a simple cross-over between localization of static elements (such as labels, text, html elements) and database-resident information (product names, news items, etc). You could argue that there are a multitude of possibilities and that Microsoft can't address all possible permutations -- but why not at least offer a basic solution, like they do for Authentication, Personalization, MasterPages, etc???
Monday, 16 August 2004
About the Provider Model...
I'm planning to use the Provider pattern to abstract implementation details in my search-engine project (Searcharoo), so I'm always interested to read about it. Another search project - Nata1 has implemented the pattern, although I haven't looked at what they've done.
Provider Model Misconceptions is a useful resource that discusses some of the concepts.
Oh, don't forget Part 2 of the MS pattern article.
Provider Model Misconceptions is a useful resource that discusses some of the concepts.
Oh, don't forget Part 2 of the MS pattern article.
Wednesday, 11 August 2004
IIS Cache-control: private
Interesting question today: IIS sets a default
This MSDN article on CustomControlCache in the metabase explains how to set
This sounds like it will work for .swf and other custom MIME types that you might want to set specific cache policies for, but it's very dodgy; appending a CRLF and 'fake' cache-control header to the content-type sent by IIS... surely this would 'break' if a
There's also this information Microsoft IIS 5.0: IIS Optimization and the Metabase but it's not that useful either...
cache-control: private header for ASP and ASPX requests which Microsoft justifies by saying that "dynamically generated pages aren't normally expected to be cached"... but where is this value _set_ in IIS and can it be easily turned off without asp/x code or ADSI script???
This MSDN article on CustomControlCache in the metabase explains how to set
CacheControlCustom = "no-cache" but I cannot find it 'pre-set' anywhere in the metabase as a default value.
This sounds like it will work for .swf and other custom MIME types that you might want to set specific cache policies for, but it's very dodgy; appending a CRLF and 'fake' cache-control header to the content-type sent by IIS... surely this would 'break' if a
cache-control: header was also sent another way (such as 'cachecontrolcustom' above) - would result in two possibly conflicting headers...
There's also this information Microsoft IIS 5.0: IIS Optimization and the Metabase but it's not that useful either...
Wednesday, 4 August 2004
Using XML in Localization
I will never understand why a company that owns translate.com calls itself "Enlaso"... but they have some interesting content on their website, including
Using XML in Localization.
The Rainbow tools might also be useful, offering simple encoding conversions, line-break conversion, RTF processing and other utilities... although I haven't tried them out myself (yet)
While we're talking about XML and L10n, Xliff is my favourite standard right now.
Using XML in Localization.
The Rainbow tools might also be useful, offering simple encoding conversions, line-break conversion, RTF processing and other utilities... although I haven't tried them out myself (yet)
While we're talking about XML and L10n, Xliff is my favourite standard right now.
Tuesday, 3 August 2004
c# Enums
Enums are a very useful way to improve code readability, speed-up coding (think intellisense autocomplete) and enforce business rules... but there are also niggly little issues like having to figure out the Enum.Parse method and how to AND/OR Enums together using the [Flags] attribute.
Thankfully, here's a very useful post of links to all sorts of Enum-related info
Enums + Attributes = Swiss Army Knife
And a very useful sample lives here Associating string values to items in code with code.
Decorating Enums with string attributes sounds like it could be used to solve two ongoing problems:
Thankfully, here's a very useful post of links to all sorts of Enum-related info
Enums + Attributes = Swiss Army Knife
And a very useful sample lives here Associating string values to items in code with code.
Decorating Enums with string attributes sounds like it could be used to solve two ongoing problems:
- localizing(translating) the meaning of an Enum for display to a user, maybe using some sort of 'translation key' attribute; and
- linking the Enum type to some underlying database lookup table to which it is related...
Subscribe to:
Posts (Atom)