exhale: see the path at the top of Finder

Unix 13 March 2012 | 0 Comments

defaults write com.apple.finder _FXShowPosixPathInTitle -bool YES

killall Finder

That’s what you type (make sure you follow that exactly. Unix is case-sensitive, remember?) into terminal to see the full directory path at the top of the finder window in OSX Lion.

Yea. You’re welcome.

Tagged in , , ,

MVC on IIS6

IIS 12 March 2012 | 0 Comments

Having trouble getting MVC working on IIS6? This article will get you through all those problems.

http://haacked.com/archive/2008/11/26/asp.net-mvc-on-iis-6-walkthrough.aspx

 

  1. Made folder in IIS an application in the Directory tab. (right click folder -> properties)
  2. On the same tab click the configuration button
  3. Check to see if there is an app extension mapping for .mvc
  4. If not, click add
  5. The executable path should be: C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll (the path might be slightly different on your server…you just have to find that dll and reference the path)
  6. Make sure to uncheck “Verify that file exists”
  7. There needs to be a wildcard inserted for the above dll
  8. If there isn’t, click insert. Use the same path we used in the mapping. Again, make sure to uncheck  “Verify that file exists” MVC app should route properly now.

Tagged in , ,

My X-Mas Book List

Continued Reading 22 November 2011 | 0 Comments

As Christmas is just over a month away, Craig Grannell quizzes the web industry’s finest about the essential books you should be giving to that special web designer or developer in your life.

http://www.netmagazine.com/features/top-25-books-web-designers-and-developers

compat probs

SQL 6 October 2011 | 0 Comments

I have an old database that I was having problems running a bit of code against. I was getting Incorrect syntax near '('. onthe following line of SQL:


FROM sys.dm_db_index_physical_stats (DB_ID(), NULL, NULL , NULL, 'LIMITED')

It worked on other databases on the same server. I was perplexed and after checking a dozen other settings I find my problem.

select compatibility_level from sys.databases where name=db_name()
--gets the compatability_level for a database

I see that the database returned the value 80. This told me that this database was in in SQL 2000 compatibility mode. In compatibility 80 you can’t use a function as a parameter for another function.

I changed the database compatibility mode to 90 and everything worked great. Here is how I did it!

sp_dbcmptlevel
Sets certain database behaviors to be compatible with the specified version of SQL Server.

Example:
----SQL Server 2005 database compatible level to SQL Server 2000
EXEC sp_dbcmptlevel AdventureWorks, 80;
GO
----SQL Server 2000 database compatible level to SQL Server 2005
EXEC sp_dbcmptlevel AdventureWorks, 90;
GO

Version of SQL Server database can be one of the following:

  • 60 = SQL Server 6.0
  • 65 = SQL Server 6.5
  • 70 = SQL Server 7.0
  • 80 = SQL Server 2000
  • 90 = SQL Server 2005

The sp_dbcmptlevel stored procedure affects behaviors only for the specified database, not for the entire server. sp_dbcmptlevel provides only partial backward compatibility with earlier versions of SQL Server. A database containing an indexed view cannot be changed to a compatibility level lower than 80.

The best practice to change the compatibility level of database is in following three steps.

  • Set the database to single user access mode by using
    ALTER DATABASE SET SINGLE_USER
  • Change the compatibility level of the database.
  • Put the database in multiuser access mode by using
    ALTER DATABASE SET MULTI_USER

 

Mary Had a Little LAMBda

C# 19 August 2011 | 0 Comments

A lambda expression is an anonymous function that can contain expressions and statements, and can be used to create delegates or expression tree types.
All lambda expressions use the lambda operator =>, which is read as “goes to”. The left side of the lambda operator specifies the input parameters (if any) and the right side holds the expression or statement block. The lambda expression x => x * x is read “x goes to x times x.”
http://msdn.microsoft.com/en-us/library/bb397687.aspx
Let’s sum up the jargon. Lambda expressions are basically just Functions/Methods.
Let’s look at some code that could choose all the odd numbers in an array:
int[] arrayNumbers = new[] { 103, 88, 13, 16, 166, 117, 999, 22, 4, 9, 1 };

foreach (int i in arrayNumbers.Where(x => (x % 2) > 0))
//% = modulo or mod. % 2 returns 0 if even 1 if odd.
Console.WriteLine(i);
//results 103 13 117 999 9 1

Simple and clear. The power is in its readability. There is no need to track down another method to see what happens to the variables value. It’s all right there.

Tagged in , , , , , ,

Save (Not Permitted)

SQL 17 August 2011 | 0 Comments

Prevent saving changes that require table re-creation

When using the SQL designer to modify table structures (changing column order, changing datatypes) that requires the table to be recreated, the management tools will not allow you to save the changes.
You will get an error stating, “You have either made changes to a table that can’t be re-created or enabled the option Prevent saving changes that require the table be re-created.”

I know a way around that error, that as of yet, has not caused me any problems from using it. I am not responsible for you dropping a table worht of important data that you were not smart enough to backup before trying this. Be smart…take precautions.

So here is the fix (you might need to click on the image to see it clearly and in full size):

 

Prevent saving changes that require table re-creation

In SQL Management Studio, go Tools -> Options and then just uncheck that checkbox shown with the red arrow in that picture.

Click Ok, and you should be good to go. You might want to recheck this property after you are done, so you don’t flub something up later.

This problem could easily be avoided by just writing the ALTER statement for the table with TSQL, but whose got time when deadlines loom?

Tagged in , , , ,

Writing code in the cloud

Uncategorized 15 June 2011 | 0 Comments

http://www.tutkiun.com/2010/04/best-online-code-editors-so-far.html

 

The idea of having your IDE in the cloud just blew my mind. No longer must we install gigs of software to write code in Visual Studio. Now you could write code in a variety of web based editors that still have clutch features like autocomplete and syntax highlightling. this is something I will be playing around with more! I could write code from any machine with a browser. No reason to lug around my development, desktop replacement, laptop!

 

whee!

MVC and WCF

Uncategorized 11 June 2011 | 0 Comments

It’s not clear on the interwebs, or maybe my google searching skills are diminished…but if you want to make calls to a WCF service from and MVC application, the way it seems best to do it is to ignore the “M” and make calls to your service from within the controller.

Tagged in , , ,

The hottest tech stuff going on right now!

Uncategorized 9 June 2011 | Comments Off on The hottest tech stuff going on right now!

Link: The hottest tech stuff going on right now!

Tagged in ,

Bugs

Uncategorized 1 May 2011 | Comments Off on Bugs

From Wikipedia, a list of unusual software bugs, including the Mandelbug and Heisenbug. My favorite is the Schrödinbug:

A schrödinbug is a bug that manifests only after someone reading source code or using the program in an unusual way notices that it never should have worked in the first place, at which point the program promptly stops working for everybody until fixed.