0

Clean your SQL Server database!

Posted by Tim on December 23, 2009 in SQL Server

Here are some lines of code that can help clean your database from test data so you can start over with a fresh canvas. /* Disable constraints and triggers (if any) */ exec sp_MSforeachtable ‘ALTER TABLE ? NOCHECK CONSTRAINT ALL’ exec sp_MSforeachtable ‘ALTER TABLE ? DISABLE TRIGGER ALL’ /*Perform delete operation on all table for [...]

Tags: ,

 
0

Unable to cast object of type ‘ Issue

Posted by Tim on December 22, 2009 in .NET Framework, Visual Basic

I came across this error: System.InvalidCastException: Unable to cast object of type ‘<TakeIterator>d__3a`1[Class]‘ to type ‘System.Collections.Generic.List`1[Class]‘. This occured when trying to use the Take extension (list.Take(n)) from a generic list of objects.   The problem is when you use the Take extension, it returns a new sequence ( IEnumerable). I got around this issue by using: [...]

Tags: ,

 
0

www.checkoutchristchurch.co.nz live!

Posted by Tim on December 15, 2009 in News

www.checkoutchristchurch.co.nz is now live!  this site loads in my personal photos of christchurch from flickr and loads in my tweets + all tweets that have the keyword “christchurch”. It uses jquery for scrolling through the thumbnails using your mouse wheel and various jquery plugins for twitter and flickr. Check it out! List of JQuer plugins [...]

Tags:

 
0

JFactory::getDate() doesn’t automatically add offset

Posted by Tim on December 7, 2009 in Open Source, PHP

By default, calling JFactory::getDate() doesn’t automatically apply the timezone offset.   The default date/time is GMT. By using the following code, you can set the offset from the global joomla configuration file <?php $thisJApp = &JFactory::getApplication(); $thisJDate = JFactory::getDate(); $thisJDate ->setOffset($thisJApp ->getCfg(‘offset’)); echo $thisJDate->toFormat(“%A %d %b %Y”); ?> If you want to set the date from [...]

Tags: ,

Copyright © 2008-2010 Tim's CodeLab Blog All rights reserved.
Desk Mess Mirrored v1.7 theme from BuyNowShop.com.