Symmetri Developer Blog

November 23, 2007

.NET Assembly Hell

General - By Shourov Bhattacharya

There are times when .NET tries one’s patience as a developer. A very common problem on a development machine is that ASP.NET suddenly begins to throw "Configuration Errors" without warning, saying that particular assemblies cannot be loaded. The assemblies concerned are fine; what is actually happening is that ASP.NET’s local cache of the assemblies (in a location something like C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\aftrs\798cb90a) are being locked by another process.

Usually that other process is the Indexing Service on your Windows machine. The solution is to turn that service off, or make it exclude the ASP.NET cache folders. See http://support.microsoft.com/default.aspx?scid=kb;en-us;329065.

November 20, 2007

Sandy 3D Engine

General, Flash/Flex, Algorithms - By Shourov Bhattacharya

Sandy 3D Engine Logo

We’ve started our journey into the world of 3D rendering in Flash with the help of Sandy 3D Engine, an open-source AS3 library for rendering and manipulating objects in 3D. So far it looks great - simple and elegant with a clean object model. The demos look nice too, although it seems that so far there is more of an emphasis on creating realistic, static models in 3D space rather than anything more dynamic and functionally useful. We believe there is real scope in harnessing this technology for new applications - exploring functional spaces such as a maps in new, intuitive ways, creating different user interfaces for important tasks, revealing patterns in data through the use of intelligent modelling and visualisation techniques.  

Hopefully, there will be much more on this blog regarding these topics in the months to come. For now, we would note that Sandy 3D Engine is an excellent platform for what we seek to do. And that fact that it has been recently updated for AS3 (meaning it is true OO) makes it an attractive development option. Kudos to the authors for their work so far.

November 9, 2007

Weird VMWare problems

General - By Shourov Bhattacharya

I run VMWare on a Macbook (Tiger OS X)  and use it to run Windows XP Pro in a virtual machine. Lately I have been noticing that my Windows apps have started throwing "Out Of Disk Space" errors when saving files onto shared folders - even though both the allocated and physical space on the disk is more than ample. A little more investigation shows that this only happens after the MacBook has been put into sleep mode  - any Windows apps that were running during the sleep and the "restart" seem to go into this funk.

Weird stuff. I’m not the only one to notice this issue. The workaround is to close down the offending app and reopen the file.  

November 8, 2007

Timezones in PHP

General, PHP - By Simon Hutchison

These functions may help supporting timezones in PHP

/**
 * This function returns the server timezone offset in seconds
 * e.g. Sydney in DST returns +1100 / 100 * 60 * 60 = 39600
 */
function getServerTimeZoneOffset()
{
    return date("O") / 100 * 60 * 60; // Seconds from GMT
}
/**
 * This function returns the local timezone offset in seconds
 *   where getTimeZone($userid) returns a timezone see below.
 */
function getLocalTimeZoneOffset($userid)
{
    return getTimeZone($userid) / 100 * 60 * 60; // Seconds from user GMT
}
// Now converting a server timestamp to a local timestamp is very simple.
/**
 * Will take a timestamp and minus off Server GMT and add on user GMT seconds
 * thereby making a local timestamp from a server timestamp.
 */
function getLocalTimestampFromServerTimestamp($userid, $timestamp)
{
    return $timestamp - getServerTimeZoneOffset() + getLocalTimeZoneOffset( $userid );
}
//And getting the local time from a user entered date is a useful function.
//Combine the next two functions to achieve just that.
function getLocalTimestampFromDateTime($userid, $datetime)
{
    $timestamp = strtotime($datetime);
    return getLocalTimestampFromServerTimestamp($userid, $timestamp);
}
/**
 * If you have a localized timestamp and just want to get the date format use this.
 */
function getFormattedDate($userid, $timestamp)
{
    return date("Y-m-d H:i:s " . getTimeZone($userid), $timestamp);
}
/**
 * Returns a timezone in the format +0000
 *  e.g. Perth in DST returns +0900
 */
function getTimeZone($userid)
{
    return "+0900"; // Perth in DST
}

November 7, 2007

parentElement and parentNode

Ajax, Javascript - By Shourov Bhattacharya

I’ve been using parentElement to work my way up the DOM in Javascript, but it completely slipped my mind until recently that it doesn’t work in Firefox. The reason is that parentElement is one of those non-standard little add-ons that Microsoft so love to give us when releasing browser support. The better alternative is parentNode, which is part of the W3C standard.   

Get free blog up and running in minutes with Blogsome
Theme designed by Janis Joseph