If you've found your post-XPSP2 net performance to have degraded...

Have a look here.

I strongly recommend getting Avast, Ad-Aware SE Personal, and SpywareBlaster to ensure that your "4226" events are actually caused by a legit programme. This tip is particularly useful to BitTorrent users who find that their client is a bit too greedy with the bandwidth.

.NET posts

From now on, all .NET related posts can be found on my new devlicio.us blog, which can be found here.

Head over and read the main feed - there are some great articles up already.

Filtering RSS feeds

The other day I had the idea that being able to filter high-volume RSS feeds would be very useful. I started developing a solution, but tonight I realised I hadn't checked if anyone else had the same idea. Googled and, yes, many others had. Most of them provided simple keyword filters (inclusive) which is, frankly, crap when you put that function in context. Take, for example, MSDN Blogs which generates at least 100 posts per day (less on the weekend). This is the conglomerated feed of all MS tech blogs. To apply a keyword filter to this is useless, since the whole reason I read it is to keep up to date with the Microsoft world. Filtering by such a precise method will cause many interesting topics to go unseen. Same with something like slashdot. In other words, keyword filtering won't cut it with blog browsing.

Filters like date range, author, and tag work well these types of feeds because they are broad. And that's why I chose Feed Rinse because they provide the above, a nice interface, and tiered membership so if you're really serious about feed filtering you can pay for the privilege. Shame I didn't think of it first but at least I now have decent filtered feeds available and I barely had to lift a finger!

.NET 2.0 get properties vs method calls

When an object is required to provide some simple true/false information about itself one may use a method or a property to return a boolean value.

The question is which is preferable to use? Or does it even matter. I'm sure there are solid design reasons for going either way.

e.g. bool-returning method - IsBlah() - Vs a [possibly readonly] property - IsBlah.

Each will provide its return value depending on the internal state of the object. The syntax will differ, as well as the accessibility (properties can have mutators). What else is different?

One major difference is that in C# a property with both get and set accessors can be inadvertently assigned to via a small typo:

if (obj.State = serverState)...
when you mean,
if (obj.State == serverState)

Obviously this can be avoided by only providing a get accessor, however this can't always be done because some properties need mutators too. Another fix would be to enforce a coding style where the comparison value always appears on the LHS of the comparison - not stable though, as it depends on the developer.

Bill Wagner at SRT Solutions suggests that there are no hard-and-fast rules, but that some simple guidelines may be followed in order to make the decision. This checklist can be found here. Some good points he makes in favour of properties is that they can be serialised, which is definitely becoming more and more important as web services gain popularity. In the context of .NET this also affects objects sent over a Remoting boundary.

Personaly, I prefer to use properties whenever possible as they fit well with the concept that they are exposing an attribute of the object. I definitely agree with Bill in that they should be simple, settable in any order, and should not call outside the object to determine their value. I think it is wise to use private methods to calculate properties based on external data, and then cache that result for when it is required via the property. This can be done when the object is created.

As always, it depends on the particular requirements for the object. If the attribute in question can be safely calculated from internal state at any time in the object's lifetime, then a property is the way to go. If the attribute can only be calculated after the constructor has finished, or if the attribute depends on external data, a calculation method and caching solution, or a re-design/refactoring would be preferable.

References

Properties vs. Methods @ SRT Solutions

What can a software developer expect?

It seems like the really valuable skills to work on right now are related to the new-wave design stuff - like Martin Fowler, refactoring, agile, domain-drive development, and so on. There is a difference between a computer nerd, or hacker, and a software developer - namely that the former enjoys the art of conquering the computer, language, sdk, toolkit, etc; while the latter treats these things as a means to delivering software that is useful to people [usually in business].

Thus, I am currently of the mind that while you have to specialise in a language to get a job, the way to ensure that one's career trajectory continues in a positive direction is to get very good at analysis and design. That is, translating real world entities and processes into clean, precise, scalable, and maintainable models. Most people have a preferred language, but as long as the language one must work with allows things like inheritance, encapsulation, and events, it is really only an afterthought. Ok, well also the language has to perform, be affordable (meaning its platform has to be), and be maintainable by future staff.

It seems futile and really a hacker's exercise to try to know every little nuance of a language. Personally I'll always have this fascination with obscure detail to some degree, but work-wise one has to preserve and increase one's value so it pays to look at what are the essential skills. I don't even think UML is that important. I honestly believe the key to making software engineering as effective as older forms, is improved and streamlined process. I think the communicative and documentative aspects become less important when the development process itself engenders constant progress.

I'm really just getting started but I predict these keywords are the ones to care about: agile, reusable, pragmatic, refactor, pattern, service

Books to pave the way on this journey:

The Pragmatic Programmer

Patterns of Enterprise Application Architecture

Analysis Patterns

Lean Software Development

http://www.martinfowler.com/articles/newMethodology.html

...and that's just to start with!

C# static readonly vs constant variables

I wondered about the differences between these the other day and here's what I found.

I am comparing constants to static readonly class fields because they are used in the same way.

At a high level, constants are obviously dealt with at compile-time, while static readonly fields are set at the time they are evaluated at run-time. The fact that constant values are subsituted by the compiler means that any library/assembly which references the constant value will need to be recompiled if the constant value changes. Libraries referencing a static readonly field will reference the field and not the value, thus they will pick up any change in the field without the need for recompilation. So constants 0 - static readonly 1 in the area of maintainability.

Static readonly fields are able to hold reference types whereas constants will only support value types plus the special .NET ones string and null.

Finally, readonly fields can be set wherever and however the developer chooses meaning they can be lazy-loaded, and they can contain calculated values. A use for this that I found was when I was developing a system which could potentially use multiple databases. I needed the maximum permissible date from Oracle and Sql Server. Based on application configuration I was able to calculate this at runtime and still store the value in a static readonly field in the static Constants class along with regular constant values.

So, it appears that constants should be used when it is very unlikely that the value will ever change, or if no external apps/libs will be using the constant. Static readonly fields should be used when run-time calculation is required, or if it external consumers are a factor.

References

Static readonly versus constants

how to patch uxtheme.dll on windows xp (to use unsigned themes)

Having the ability to use custom (non-Microsoft) XP/2003 themes is highly recommended. It makes life a lot more fun. It's not hard to do but I thought I'd explain it again since it wasn't trivial.

1. Download the correct version of uxtheme.dll. This site has pretty much all of them.
2. Unzip and store the patched file in somewhere like c:\temp. Note it will be the same size as your existing file.
3. You might want to force a system restore point if you're really paranoid.
4. You won't be able to copy the patched file over this one since Windows doesn't all this.
5. You will need this program: Replacer. Download the STABLE version.
6. Replacer will do the hard work with making windows let go of the uxtheme.dll file and allowing you to copy over it. Just in case, make a backup yourself - rename c:\windows\system32\uxtheme.dll to uxtheme.dll.old.
7. Unzip Replacer to somwehre like c:\temp\replacer
8. Before running it, I found that you have to remove all the sources that Windows can use to overwrite the patched file. Do a search (Start Menu -> Search) for *uxtheme* while making sure that hidden and system files are visible in explorer, and are selected in Advanced Options in Search.
9. There will be matching files in c:\windows\system32\dllcache, and probably in c:\i386. Just rename these (not copy) to uxtheme.dll.old.
8. Now run Replacer (replacer.cmd)
9. Drag the existing file c:\windows\system32\uxtheme.dll into the command window. Hit enter.
10. Drag the new file from c:\temp into the command window.
11. Hit enter. And then type Y.
12. Check that the file date and size of c:\windows\system32\uxtheme.dll matches that of the one from c:\temp.
13. Reboot.
14. Grab a theme from customize.org. Download it and unzip to c:\windows\resources\themes, making sure to select 'extract subfolders'.
15. Right click on the Windows desktop.
16. Click on Appearance. Under windows and buttons you should see your new theme listed!

[Books of the Month] CLR via C#, Headfirst Design Patterns

CLR via C#
by Jeffrey Richter

This is the one i'm reading at the moment. So far it's great! Richter's style is conversational while still precise. The passion he has for software development is clearly evident in his writing. I find that each topic is explained in the way that someone might do if they were helping you out at work. They start simple, and then progress to the advanced features. The examples are decent and "real-world" which is nice, since it can often be hard to see how object graphs made up of cars can apply to your actual code.

Head First Design Patterns
by Elisabeth Freeman et al

This is an excellent book! It reminds me of fun educational books I read before the age of 10. And why should a software development text be boring!? To contradict my statement above, they use example class hierarchies made up of things like ducks, with interfaces like flyable and quackable. However, the depth of the examples surpass the silliness and the examples present poignant issues to do with implementing object design concepts properly.

More to come..

Followup to Visual Studio debugger issues on a UNC share

a.k.a. 'I want to develop .NET projects on a remote drive!'

Will not be too detailed - doing this from memory.

1. Ensure the site's .webinfo or .csproj file contains the path to the HTTP path to the UNC share.
e.g. You have it on \\192.168.1.2\w$\dev\projects, where the webroot is pointing to \dev
The path in the above files should be http://192.168.1.2/projects/

2. Open up your .NET security configuration tool (in control panel). This should work for 1.1. and 2.0.

3. Go to Runtime Security Policy; Code Trust.

4. Under Local Intranet, add a new code group.

5. Call it dev server or whatever.

6. Select URL, and enter file://192.168.1.2/w$/dev/projects/*

7. Select Full Trust.

8. Save, and be sure to RESTART visual studio.

9. Success will be evident if VS doesn't complain about the project existing in a non-trusted area.

Leave me a comment if you need any more info/help.

SQL Server 2000: Column values as arguments to table-valued functions

Short answer - impossible. Apparently the issue has been fixed in 2005.

So basically in sql 2000, you can't do this:

SELECT email
FROM [tb_Email]
WHERE
@job_type IN (SELECT * FROM [dbo].[CsvToIntTable](job_type))

where tb_Email.job_type is a field containing data like '1,2,3,4'
and CsvToIntTable returns this data separated into rows.

The server will return an error like so:
'job_type' is not a recognized OPTIMIZER LOCK HINTS option.

Bugger!

Visual Studio 7 Debugger Problems

a.k.a. Error while trying to run project: Unable to start debugging on the web server

If you've found this page, it's likely that you're feeling very frustrated right now. So first of all take a deep breath. Now try this:

In your ASP.NET project directory, check your .webinfo file. If your project URL consists of an IP address (e.g. 192.168.1.1/....) this will not work. You must use a NetBios name (e.g. Server1 or DevBox.au.global.ad). Microsoft say you can add the IP address of the server to the Trusted Sites collection in your Internet Options but I could not get this to work.

If this does not work, then the next things to check are:

1. Does your project's website in IIS have the DEBUG verb mapped with .aspx files? The Security Lockdown tool can disable this.
2. Do you know the user making the debug request on the server? Enable IIS logging, try debugging again, and check the logs for the user making the web request. You will also need to check that your website has Integrated Windows authentication enabled.
3. Is the user making the request a member of Debugger Users, VS Developers, and IIS_WPG groups? It doesn't hurt to add the user to the Administrators group too, except this presents a security hole - so proceed with caution and thought if you do this.
4. Have you tried disabling all firewalls and virus scanners on your dev machine and your dev server?
5. Are the VS.NET Remote Components installed properly? On the server uninstall VS.NET and reinstall the Remote Components only.

If you still have a problem, here is a collection of links that should cover pretty much everything you need to solve this problem. Thanks to all these page maintainers. Big thanks!

Best of luck!

Tags

windows (10) microsoft (9) .net (6) google chrome (5) windows 7 (5) asp.net (4) google (4) google browser (4) development (3) javascript (3) mssql (3) rss (3) sql server (3) wordpress (3) automation (2) blogging (2) css (2) database (2) firefox (2) get all wordpress images (2) gmail (2) google docs (2) intel (2) internet explorer (2) linux (2) linux commands (2) microsoft word (2) mysql (2) netsh (2) network issue (2) proxy (2) seo tips (2) shell (2) sun (2) tfs (2) videos (2) wget (2) windows networking (2) windows vista (2) winhttp (2) .net 3.5 (1) .net 4.5 (1) .net async ctp3 (1) .net framework 4.0 (1) 404 (1) JungleDisk (1) access (1) active directory (1) addons (1) adobe acrobat (1) adobe dlm (1) adobe reader (1) adp (1) adsense (1) adtoll (1) adwords (1) amazon (1) antivirus (1) asp.net 4.0 (1) authentication (1) back links (1) backlinks (1) bacula (1) bash (1) batch files (1) blogger (1) box (1) browser exploits (1) category rss (1) cell phone (1) cell phone comparison (1) charting (1) cheap cell phones (1) cheap laptop upgrades (1) checkout (1) chrome (1) chrome.manifest (1) cloud (1) cloud hosting (1) cloud vps (1) code (1) color chart (1) colour chart (1) conditional formatting (1) config (1) configuration (1) context menu (1) copy (1) corrupt (1) credentials (1) cross-reference (1) database scripts (1) dba scripts (1) debian (1) decrypt (1) delete file windows vista (1) delete files (1) dell (1) dell laptop (1) dell studio (1) dell studio 1537 (1) dhcp (1) directory size (1) div (1) dns (1) document properties (1) dotnet (1) download (1) dreamhost (1) dreamhost coupon (1) dreamhost promo (1) dreamhost promo code (1) drive letter (1) drivers (1) duplicate content (1) editpad pro (1) encrypt (1) encryption (1) error (1) error code (1) excel (1) exception (1) external hard drive (1) facebook (1) faviconize (1) feeds (1) firefox 3 rc1 (1) firefox 3.1 (1) firefox addons (1) firefox tabs (1) firewall (1) firewall script (1) fix (1) fix .net framework (1) foreign keys (1) gmail 2.0 (1) gmail error (1) google chrome 2.0 (1) google chrome dev (1) google chrome exploit (1) google reader (1) google reader tags (1) gtdinbox (1) hard drive (1) hex color (1) hex colour (1) htaccess (1) html (1) html 5 (1) iis6 (1) installation (1) ipod touch (1) ipod touch 2g (1) ipod touch freeze (1) ipod touch magnet case (1) ipod touch magnet case problem (1) ipod touch problem (1) iterator pattern (1) itunes (1) java (1) joomla (1) jquery (1) laptop (1) laptop upgrade (1) laptops (1) latex (1) leeching (1) like button (1) link checker (1) linkbacks (1) linq (1) linqdatasource (1) lost password (1) making money online (1) map drive (1) mega cheap phones (1) microsoft excel (1) microsoft signature (1) microsoft store (1) microsoft web deploy (1) microsoft windows (1) microsoft word 2007 (1) minimize firefox tabs (1) mozy (1) ms word (1) msdeploy (1) msdtc (1) nant (1) netstumbler (1) network path not found (1) network path was not found (1) network problem (1) networking (1) new movies (1) nintendo (1) nirsoft (1) nocheckbrowser (1) number (1) odf (1) odt (1) online backups (1) open source browser (1) openoffice (1) oracle (1) oracle client (1) photoshop (1) phpmyadmin (1) podcast (1) powershell (1) pr checker (1) productivity (1) proxy server (1) proxycfg (1) putty (1) recover (1) registry (1) reinstall windows 7 (1) remote desktop (1) remove (1) repair (1) reset joomla admin password (1) rewrite (1) rsa (1) sandy bridge laptop (1) seagate momentus xt (1) seo tools (1) sequence (1) server monitoring (1) sftp (1) social networks (1) softlayer (1) soulseek (1) spreadsheet (1) spreadsheet formula (1) sql (1) sql scripts (1) sql server management studio (1) sqlclient (1) ssh (1) ssis (1) ssl (1) ssms (1) subst (1) tabmixplus (1) telstra (1) text editor (1) trust (1) unlock cell phone (1) unlock mobile phone (1) upgrade laptop hard drive (1) user management (1) vb.net (1) video download (1) virtual server (1) visual studio (1) vodafone (1) vodafone australia (1) vps (1) vps.net (1) wd external drive (1) web deploy (1) web dev (1) web development (1) web hosting (1) web security (1) webdev (1) webmail (1) webmaster tips (1) western digital (1) wifi networks (1) wii (1) win7 (1) windows 7 backup (1) windows 7 gadgets (1) windows 8 (1) windows 8 antivirus (1) windows error (1) windows live (1) windows live essentials (1) windows live toolbar (1) windows tips (1) windows web development (1) windows xp (1) winxp (1) wireless networks (1) word tips (1) wordpress 2.7 (1) wordpress plugin (1) wp super cache (1) yield (1) youtube download (1) youtube playlist download (1)