Wednesday, November 18, 2009
As more and more code goes client-side, it's important to make sure that proper SE principles are still applied.

I'm still using Notepad2 but have to seriously start looking at more advanced(!) IDEs.

At the moment though, I'm happy to make do with stand-alone tools for tasks such as documentation or minimization etc.

For documentation, I've used jsdoc toolkit which you can find here - http://code.google.com/p/jsdoc-toolkit/

To confuse things, the documentation for this documentation-generator is found at the project's previous incarnation - http://jsdoc.sourceforge.net/

The FAQ on how to run it etc is here - http://code.google.com/p/jsdoc-toolkit/wiki/FAQ

Run it using the following command -

java -jar jsrun.jar app\run.js -a -t=templates\jsdoc mycode.js


Wednesday, November 18, 2009 6:45:52 PM (GMT Standard Time, UTC+00:00) | Comments [0] | Javascript#
Tuesday, November 17, 2009
If you ever get the above error, you can restore from the query command line, via use of the REPLACE command.

This is illustrated here - http://blog.sqlauthority.com/2007/09/27/sql-server-fix-error-3154-the-backup-set-holds-a-backup-of-a-database-other-than-the-existing-database/

I've copied this fix for my own reference:

Fix/WorkAround/Solution:

1) Use WITH REPLACE while using the RESTORE command. 

2) Delete the older database which is conflicting and restore again using RESTORE command.

I understand my solution is little different than BOL but I use it to fix my database issue successfully.

3) Sample Example :
RESTORE DATABASE AdventureWorks
FROM DISK = 'C:\BackupAdventureworks.bak'
WITH REPLACE


Also, to REPLACE AND MOVE, use the following:

RESTORE DATABASE mydb
FROM DISK = 'C:\Temp\data\mybak.bak'
WITH REPLACE,
MOVE 'original_dat' to 'C:\work\data\data2.mdf',
MOVE 'original_log' to 'C:\work\data\data2.ldf'

Tuesday, November 17, 2009 12:04:07 PM (GMT Standard Time, UTC+00:00) | Comments [0] | Database#
Tuesday, November 03, 2009
Interesting article on why Fireworks is better than Photoshop for squeezing more bandwidth out of your site:

http://blogs.popart.com/2009/02/why-aren-t-you-using-fireworks-to-compress-images/

Tuesday, November 03, 2009 9:17:28 PM (GMT Standard Time, UTC+00:00) | Comments [0] | Web Design#
This example uses PredicateBuilder by Albahari & Albahari - http://www.albahari.com/nutshell/predicatebuilder.aspx

If you need to return rows based on values of child items for the row, then the following example might come in useful:

            predicate = predicate.And(p => 
                p.OrderBasketItems.Where(obi => obi.CustomerId > 0).Count() > 0);
This will generate a sub-query such as:

SELECT [t0].[ColumnX], [t0].[ColumnA]
FROM [dbo].[Order] AS [t0]
WHERE ([t0].[OrderStatusID] = 4) AND (((
    SELECT COUNT(*)
    FROM [dbo].[OrderItems] AS [t1]
    WHERE ([t1].[CustomerId] > 0) AND ([t1].[OrderId] = [t0].[OrderID])
    )) > 0) 

Tuesday, November 03, 2009 3:49:48 PM (GMT Standard Time, UTC+00:00) | Comments [0] | LINQ#
Search
Archive
Links
Categories
Admin Login
Sign In
Blogroll