Friday, August 05, 2005

[De]Serialization withToByteArray and ToStructure

More snippets... I love snippets.

From eicar (sorry, don't know his/her actual name)
Home-grown [de]serialization: ToByteArray and ToStructure

[Listening to: Janis Joplin - Piece of my Heart]

Omiting the Xml Declaration and the XSD and XSI namespaces

Scott Hanselman of The Ultimate Tools List fame posts together a useful snippet of code to Serialize an object while omiting the Xml Declaration and the XSD and XSI namespaces -- The XmlFragmentWriter.

This snippet was cobbled together from Sairama, a platform engineer at Corillian and Daniel Cazzulino and, I'm sure, Scott too.

I've always kinda' disliked the extra "baggage" but was waaay too lazy to do anything about it.

[Listening to: Stone Temple Pilots - Where the River Goes]

Thursday, August 04, 2005

Simple harness to print exceptions in an app

A nice little example from Mike Stall on building a
simple harness to print exceptions in an app.

Don't know if this will be useful, but it's definitely something I want to remember. So here it is.

[Listening to: Elastica - Love Like Ours]

101 Samples for Visual Studio 2005

A bunch of samples on MSDN for both C# and VB.NET.

Can't remember who I got this from. My apologies.

[Listening to: Led Zeppelin - Rock and Roll]

Wednesday, July 27, 2005

ORACLE: Required permissions for v$mystat

Long time: no post. Busy. Working. Travelling. Excuses. Excuses.

Too many net resources point you to GRANT SELECT ANY DICTIONARY TO {user/role}' but I like a more granulated approach.

If you want to give just enough permissions for a user to v$mystat;

C:\> "sqlplus sys/passwd@tnsname as sysdba"

SQL> GRANT SELECT ON v_$mystat TO {user/role};


[Listening to: Marilyn Manson - Apple of Sodom]

Tuesday, July 05, 2005

Advanced .NET Debugging with PerfMon

Fellow Blogspotter Eran Sandler gives a nice overview on some PerfMon performance counters, what they mean and how to use them to detect some common issues such as leaks, fragmentation and lousy (my word not his) allocation patterns. It's nice having this all in one spot.

[Listening to: Ted Nugent - Free for all]

Wednesday, June 15, 2005

ORACLE: Enabling function-based indices (indexes?)

I was happily using function based indices to provide case insensitivity like so:

CREATE UNIQUE INDEX MyIndexName ON MyTable (
LOWER (SomeColumn) ASC
);

Worked like a charm. The uniques was case insensitive and the normal query like:
SELECT blah, foo, bar
FROM MyTable
WHERE LOWER(SomeColumn) = LOWER (:bindparam);

was happily using the index.

Until one day at (naturally) a client site, one of my fellow engineers found that the above query was performing a full table scan. And, despite what Tom Kite keeps saying, in this case, a full table scan is bad.

Only after some spelunking through Tom's Book Expert One-on-One Oracle did I find the magic. The database needs the following session/system variables in place to actually use the function-based indices:
QUERY_REWRITE_ENABLED=TRUE
QUERY_REWRITE_INTEGRITY=TRUSTED

I'll chock these up to the huge pile of stuff that "Oracle needs to have to work the way it should but is next to impossible to find unless you already know it."

Hopefully this saves someone else some time.

[Listening to: Tripping Daisy - Piranha]

Wednesday, June 08, 2005

Enabling the "Shut Down" option in Windows Server 2003

Once again I spent way too long trying to figure out how to allow my non-administrator user the ability to shutdown windows. Strangely enough Google was of little help. I guess the terms "shutdown", "enable", "user", "dialog" are too vague?

By default a normal user only has log off username in the list of options when you hit shutdown from the start menu. Just so I don't have to search for this again:

Run Administraive Tools/Local Security Settings
Navigate to:
Security Settings/
Local Policies/
User Rights Assignment/

Add the user/group in question to "Shut down the system".

Also, just in case others fall into the same trap, here's some food for the GoogleBots:
"shutdown windows" dialog "log off" enable
"shutdown windows" dialog "log off" allow
"shutdown windows" dialog "only log off"
"shutdown windows" dialog "shut down missing"
"shutdown windows" dialog missing
"shut down windows" dialog missing
"shutdown privilege" "windows 2003"
"shutdown privilege" "windows server 2003"
enable shutdown windows server 2003

Thursday, June 02, 2005

Assert.IsEqualGraph -- Comparing object graphs

Keith Brown over at PluralSight has a useful method to Assert the equality of 2 object graphs: Assert.IsEqualGraph.

I have a couple other quasi-useful Assertion type methods that I'll post here (if I ever get around to using the stupid computer again that is.)

[Listening to: Ozzy Osbourne - Over the Mountain]