The other day when I was trying to run a .NET website on my computer, the .NET compiler was unable to deal with a pesky temporarily file in the \windows\microsoft.net\framework\v2.0.50727\Temporary ASP.NET Files\root\ directory tree.
Strangely my website was throwing a generic ASP.NET website error page on my browser window, indicating that the .NET compiler was unable to deal with a pesky CRC error contained in the ASP.NET temporary files directory tree.
Oh, the woes of the poor .NET compiler.
So I thought I'd lend a helping hand and try to delete that pesky temporary file myself. Was I surprised then when Windows popped up this helpful little dialog window, asking me nicely enough if I wanted to format my hard drive. Check this out:
I was a little worried to say the least! But needless to say it was just a few faulty segments on my hard drive...CHKDSK swooped in and rescued things.
Now if this had happened on my mom's computer, just what the heck would she have selected as her response? What if your mom, or an average/below average computer user thought that answering yes to the dialog of death above was relatively harmless? After all, Windows is asking me, what harm can Windows possibly cause to me? Windows is a kind, gentle, helpful operating system after all...
What would Mac OS X do in a situation like this?!?!?!
;)
January 29, 2008
What if this dialog window popped up on my mom's computer?
January 25, 2008
But you said one second!
November 22, 2007
Running "Procedural queries" in SQL Server
At first glance, what result set would you expect SQL Server to return for a query such as:
declare @customerid nchar(5)
select top 1 @customerid = customerid
from northwind.dbo.customers
select *
from northwind.dbo.customers
where customerid = @customerid
If you haven't used this type of approach for querying data before, you might be surprised that it only returns one result set. It only returns the complete customer record for the customer whose customerid field equals @customerid. It does not also return "just the customerid". The reason it doesn't also return customerid as a separate query result is because the result is assigned to a variable. When you assign queries to variables, those query results are not returned back to you.
The code above is in fact more than a simple SQL query. It is an anonymous procedural block. Anonymous blocks sometimes also look like this:
begin
declare @customerid nchar(5)
select top 1 @customerid = customerid
from northwind.dbo.customers
select *
from northwind.dbo.customers
where customerid = @customerid
end
Where the only differences are the surrounding begin and end statements. Both anonymous procedural blocks are functionally equivalent. When you execute a query block against SQL Server, it's smart enough to determine if your query block is just a simple query, or a T-SQL block of code, and the act accordingly.
You can of course run anonymous procedural blocks from any SQL client - SQL Query Analyzer, Enterprise Manager, ADO.NET, etc.
The ADO.NET barebones example of running an anonymous procedural block looks like this:
SqlConnection conn = new SqlConnection(connection);
SqlDataAdapter adapter = new SqlDataAdapter();
adapter.SelectCommand = new SqlCommand(
@"begin
declare @customerid nchar(5)
select top 1 @customerid = customerid
from northwind.dbo.customers
select *
from northwind.dbo.customers
where customerid = @customerid
end
", conn);
adapter.Fill(dataset);
Essentially the same ADO.NET syntax is used that you would use for executing any SQL query or stored procedure.
Anonymous procedural block type queries are very useful in 2 particular cases:
- complex queries that cannot be easily executed in one set based operation, particularly certain complex reports
- queries that will gain significant orders of performance improvement by executing them in multiple steps, such as saving temporary calculated values that are used by all rows of large queries, etc.
If I have shed some light on a new way to query, don't simply start using it all the time - only use it when it makes sense over and above pure set based operations!
November 3, 2007
The Annoying Stealth Pop Up Ad
Is there a pop up blocker out there that blocks those stupid annoying pop ups on websites that only open a pop up window when you click into the body of the web page?
Sheesh, it's so irritating! Many sites (I don't want to promote them here but I'm sure you can easily find them a dime a dozen) look nice and non-annoying and give you a warm and fuzzy feeling when you visit them, but then as soon as you click into the body of the web page you get an annoying pop up. GRRRRRR!!!
I'm so used to clicking into the body of web pages because I like to use my keyboard to scroll within the content of pages, and I usually have to "click in" to the web page first to set focus for the scrolling.
Anyhow, I'd love to hear from you if you know of a pop up blocker that kills that type of pop up as well.
November 1, 2007
Are You Just a Developer And Not a Consultant?
I started out my career as a programmer about 10 years ago. I had the mindset of a programmer going into my first job – go to work, do lots of problem solving, develop cool stuff, learn cool new technologies. I was very much in my own little bubble, interested mostly in tech stuff.
Today, I still do quite a bit of programming, but I also have a lot of other types of responsibilities that I absolutely love – especially on the people and organizational side of things. I always enjoy challenging technology projects, but eventually over time the technical aspects of those challenges have become less fulfilling for me. It’s not that I’m not motivated to produce high quality products - let’s face it, once you’re a passionate software developer you never lose that passion regardless of your role - but rather that I became more fascinated and enthralled with aspects of software development that are always hovering around a software developer - particularly the organizational and people aspects.
If you’re a developer of any type and haven’t studied consulting to any extent, it will be very much worth your time to slot in training to become a better consultant. Good consultants are the types of developers that get paid the big bucks – they can wear lots of different hats, function competently in different organizational environments, provide leadership and mentoring where needed, and provide value in situations that they have little or no experience in. Consultants strive in challenging people and organizational cultures. Good consultants are the ones that grow into higher level roles as well such as managers, directors, architects, and CIOs.
A great consulting book that I picked up years ago is called Flawless Consulting, by Peter Block, http://www.amazon.com/Flawless-Consulting-Guide-Getting-Expertise/dp/0787948039. Peter has tons of great content in his book. It’s not a developer oriented book, but you’ll get a lot of value out of it anyway. Add it to your bookshelf – I guarantee you that you will find practical tips in that book that you can start applying to your own job today.
Hopefully consulting will pique your interest in the people side of your jobs more! Be sure to give this side of your career some love - it will reward you handsomely in the future - particularly when it comes to your own personal confidence, happiness and people skills!
