Browsera: Simultaneously Test Your Web Design in Multiple Browsers

1 12 2009

Browsera is an online service that will show you how your web site is rendered by the different browser engines, as to expose compatibility issues. It will also analyze your design and show you the parts which are prone to errors.

 

Too bad I’m not into web design at the moment, this tool would have saved me some time back in the day.

No more trying to install a legacy IE6 version or messing around with virtual machines etc…

 

As read on Lifehacker.





VS 2005 App_Code bug

14 11 2008

Lost some time over the following bug in Visual Studio 2005, so hopefully this post will prevent someone else doing the same.

When you manually create an App_Code folder in a VS2005 project, and you add a class to it, it probably won’t show up in IntelliSense. Don’t worry, it’s not you, it’s MS.

Every class you add to that folder, will have its Build Action property set to ‘Content’. Change this to ‘Compile’ and problem solved.

I suppose MS will think of this as a feature, because of the fact you created the folder manually, and like the Global Resources folder, might contain mostly icons, images, etc… Then ‘Content’ would be right. But then if they recognize the ‘App_Code’ folder automatically (VS even sets the code-icon for it), they might as well put the default Build Action property to ‘Compile’, dang it.

I do not know if this also occurs with a brand new project, to which App_Code was added on the moment of creation.





How To See Last Modified Date of Objects in SQL Server 2005

28 08 2008

A handy tip for those of you not yet all too familiar with SQL Server 2005 and getting lost looking for an option to show them the last modified date of -for example- a stored procedure. There is none ! Just execute below T-SQL in the context of your database.

SELECT
[name],
create_date,
modify_date
FROM sys.procedures
WHERE
[type] = 'P'
AND is_ms_shipped = 0
AND [name] NOT LIKE 'sp[_]%diagram%'
ORDER BY
modify_date DESC

Obviously, you can do the same for tables, using sys.tables:

SELECT
[name],
create_date,
modify_date
FROM sys.tables
ORDER BY
modify_date DESC

With thanks to Binary Elves.





MS SQL Server: Error 14724 – MSX server

2 04 2007

I wanted to change several jobs on our MS SQL Server just now. I got the following error when I tried saving a job after deleting a step:

Error 14724 Cannot add, update, or delete a job (or its steps or
schedules) that originated from an MSX server.

After using my friend (Google that is), I found out that the reason for the error is that a job remembers the name of the server on which it was originally created on. If the name of the server changes after the job has been created, and you want to edit that job, it will not be possible to do so.
The only solution is to change the originating_server attribute of the job to the current servername.

You can do this by executing the following transact-sql command:

UPDATE msdb.dbo.sysjobs
SET originating_server = CONVERT(nvarchar, SERVERPROPERTY('servername'))
WHERE originating_server <> CONVERT(nvarchar, SERVERPROPERTY('servername'))

Do note that some solutions online will offer the following answer:
UPDATE msdb.dbo.sysjobs
SET originating_server = @@SERVERNAME
WHERE originating_server <> @@SERVERNAME

Which is not entirely correct, as @@SERVERNAME doesn’t automatically update itself, as explained here [ msdn.microsoft.com ]:

Although the @@SERVERNAME function and the SERVERNAME property of SERVERPROPERTY function may return strings with similar formats, the information can be different. The SERVERNAME property automatically reports changes in the network name of the computer.

In contrast, @@SERVERNAME does not report such changes. @@SERVERNAME reports changes made to the local server name using the sp_addserver or sp_dropserver stored procedure.

Make sure you first do a select * from msdb.dbo.sysjobs to make sure you don’t mess up your system ;)

Technorati Tags: , , , ,





Windows Vista

5 02 2007

Last weekend, I installed a (legal!) version of Windows Vista Business.
I had the beta 1 and 2 on my system, and the beta 2 especially convinced me. Didn’t even look at the RC1 or RTM version.

So I chose the Business edition. I first thought I would go for the Home Premium, but that doesn’t come with Remote Desktop or IIS; bummer. Luckily the price tag isn’t as high as the Ultimate edition.

Installation went smoothly. Only my D-Link PCI wireless adapter couldn’t be installed automagically, but the old XP drivers on the manufacturer CD did the trick (even though they pop up error boxes).

Finally, a modern version of Windows. If they would have been one year earlier, they would have had the positive reviews instead of Apple’s OS X. Now everyone’s yelling Vista doesn’t have any real improvements (sigh), just because we’re all used to fancy GUIs, desktop sidebars, indexed search and the like.

Anyway. I’m enjoying this OS, and without the much ‘hyped’ performance drops might I add.

Technorati Tags:





Inetinfo.exe Crashes On Certain Web Project

21 12 2006

Great. Just spent a nice two hours figuring out why inetinfo.exe (the IIS process) crashes when I open a certain web project.

I went Googling, and after a while I found a KB article describing the exact problem I had, even with the exact same event ID’s in the system event log. But I couldn’t find a download, and even if I did, it was Windows Server 2003 only. Had something to do with an exploit in the SMTP service. Anyway, that didn’t help me.

So I tried something totally not logical: opening a different web application in my IDE. And bingo: it opened just fine. So maybe the configuration of the ‘bad’ project was defunct? -No. And so it should be, I hadn’t tinkered with it for a long time, so why would it suddenly not work anymore. (As the rest of this story will show, I forgot to check one setting.)

Then, my penny dropped (“mijne frang viel” -Flemish expression): I recently added another web site in IIS, besides the default one. This had to be done for another, single, project that used .NET 2.0. And indeed, the configuration for the ‘bad’ project was wrong: it said to use .NET 2.0, where it was previously using 1.1.

I suppose switching between the two sites fires a bug in IIS, overwriting some configurations…? I don’t know, but I’m fairly sure the config for the ‘bad’ project has stayed the same ever since it was created…

Anyhoo, another experience richer I guess.

Technorati Tags: , , ,





Type Casting Performance in .NET

21 09 2006

[ as taken from MSDN © Microsoft Corporation. All rights reserved. ]

The DirectCast keyword introduces a type conversion operation. You use it the same way you use the CType keyword, as the following example shows:

Dim Q As Object = 2.37		' Requires Option Strict to be Off.
Dim I As Integer = CType(Q, Integer)	' Succeeds.
Dim J As Integer = DirectCast(Q, Integer)	' Fails.

Both keywords take an expression to be converted as the first argument, and the type to convert it to as the second argument. Both conversions fail if there is no conversion defined between the data type of the expression and the data type specified as the second argument.

The difference between the two keywords is that CType succeeds as long as there is a valid conversion defined between the expression and the type, whereas DirectCast requires the run-time type of an object variable to be the same as the specified type.

In the preceding example, the run-time type of Q is Double. CType succeeds because Double can be converted to Integer, but DirectCast fails because the run-time type of Q is not already Integer. DirectCast throws an InvalidCastException error if the argument types do not match.

If the specified type and the run-time type of the expression are the same, however, the run-time performance of DirectCast is better than that of CType.

TechnoratiTechnorati Tags: , , ,





When IIS and ASP.NET don’t get along

19 04 2006

I found an interesting article while looking for a solution to an error I got on a form. The form contains several server-side validator controls, and when I would load the form, an error pops up telling me it can’t find the WebUIValidation.js file.
I’m familiar with this error. I’ve seen colleagues get it, but never experienced it myself. But recently, I got a new laptop, installed all the necessary software, and I even worked on a project, without having that same error. Only today, when I switched to another project, the error pops up out of nowhere.

This page [ searchvb.techtarget.com ] clearly explains what and how, and provides info about the .NET utility aspnet_regiis.exe, and its different uses. A must-know.

TechnoratiTechnorati Tags: , , ,





JavaScript Check on Valid Date

13 04 2006

Whenever I have this combination of three DropDownLists to receive a date for input, I use this little script to validate whether the given date is an actual date or not. You know: preventing the user inputting 30 February or something like that.

I knicked it from some site or other, but I can’t remember where exactly, so if you recognize this script and believe I should give you credit, just let me know and I’ll fix things up.

function isDate(dateStr) {
var datePat = /^(\d{1,2})(\/|-)(\d{1,2})(\/|-)(\d{4})$/;
var matchArray = dateStr.match(datePat); // is the format ok?

if (matchArray == null) {
alert(“Please enter your birth date as dd/mm/yyyy. Your current selection reads: ” + dateStr);
return false;
}

day = matchArray[1]; // p@rse date into variables
month = matchArray[3];
year = matchArray[5];

if (month < 1 || month > 12) { // check month range
alert(“Month must be between 1 and 12.”);
return false;
}

if (day < 1 || day > 31) {
alert(“Day must be between 1 and 31.”);
return false;
}

if ((month==4 || month==6 || month==9 || month==11) && day==31) {
alert(“Month “+month+” doesn`t have 31 days!”);
return false;
}

if (month == 2) { // check for february 29th
var isleap = (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0));
if (day > 29 || (day==29 && !isleap)) {
alert(“February ” + year + ” doesn`t have ” + day + ” days!”);
return false;
}
}
return true; // date is valid
}

function checkForValidDate(){
var ddlVMonth = document.getElementById(“_ctl0_DropDownListMaanden”);
var ddlVDay = document.getElementById(“_ctl0_DropDownListDagen”);
var ddlVYear = document.getElementById(“_ctl0_DropDownListJaren”);

if (!isDate(ddlVDay.value + ‘/’ + ddlVMonth.value + ‘/’ + ddlVYear.value))
{ return(false); }

return(true);
}

TechnoratiTechnorati Tags: ,





Rounded Corners without Images or JavaScript

31 03 2006

This is the first solution I’ve seen to populate a web page with boxes with rounded corners, and not using images or javascript.
It uses only CSS rendering, so your server will have to deal with no extra traffic for the rounded corners at all. Very nifty. :)

Making anti-aliased rounded corners with CSS [ spiffycorners.com ]