Wednesday, September 26, 2007

PNG-24 in IE for osCommerce

This is quick fix to display PNG-24 properly on Internet Explorer.

Just modify html_output.php.



$msie='/msie\s(5\.[5-9]|[6]\.[0-9]*).*(win)/i';

if( !isset($_SERVER['HTTP_USER_AGENT']) ||

!preg_match($msie,$_SERVER['HTTP_USER_AGENT']) ||

preg_match('/opera/i',$_SERVER['HTTP_USER_AGENT']))

{

$image = '<img src="' . tep_output_string($src) . '" border="0" alt="' .
tep_output_string($alt) . '"';

}

else

{

if(strtoupper(substr($src, -3, 3)) == "PNG")

{

$image = '<img src="images/spacer.png" style=" width:'.$width.'px; height:'.$height.'px;
filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\''. $src.'\',
sizingMethod=scale);" border="0" alt="' . tep_output_string($alt) . '"';

}

else

{

$image = '<img src="' . tep_output_string($src) . '" border="0"
alt="' .strtoupper(substr($src, -3, 3)). tep_output_string($alt) . '"';

}

}

Labels: , ,


Monday, September 17, 2007

JAVA: How to stop the logger from displaying the error messages in the console window

Use setUseParentHandlers(false);

if (LOG)
{
try
{
// Send logger output to our FileHandler.
fh = new FileHandler("logs/" + port + ".xml", 100000, 5, true);
logger.setUseParentHandlers(false); // HERE!!!!!
logger.addHandler(fh);
// Request that every detail gets logged.
logger.setLevel(Level.ALL);
}
catch (IOException e)
{
System.err.println ("Unable to create log file");
}
}

Labels: , , ,


Saturday, September 08, 2007

Very Important Event in AS3: Event.ADDED_TO_STAGE

Event.ADDED_TO_STAGE is SO important it's ridiculous I took me so long to find it.
If you're creating a swf that will be loaded by an external loader, you need this event to be trigger before even thinking about accessing any of the stage properties.
With this event you can access the stage from the loaded movieclip.

If you don't check this event, stage will only return null.


Loader:

var request:URLRequest = new URLRequest("yourConstructor.swf");
loader = new Loader();

loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loadProgress);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadComplete);

function loadProgress(event:ProgressEvent):void {
var percentLoaded:Number = event.bytesLoaded/event.bytesTotal;
percentLoaded = Math.round(percentLoaded * 100);
trace("Loading: "+percentLoaded+"%");
}
function loadComplete(event:Event):void {
trace("Complete");
addChild(loader); // when this is done this will fire the Event.ADDED_TO_STAGE event
}


Loaded content class:


public function yourConstructor(){
this.addEventListener(Event.ADDED_TO_STAGE, init);
}

public function init(event:Event):void{
trace(stage.quality)
}

Labels: , ,


Friday, September 07, 2007

Robot Dolphins to treat Retard Humans



Animatronic dolphins are used to replace the costy and controversial real mammals supposed to have this unexplainable connection with sociopaths, new age honkies and ex-meths addicts. The substitute is a complex machine that looks, feels, sounds, and moves like a real dolphin.
Animal Makers, a company based in California, is stepping into this juicy business and will produce 10.000 units before Quarter 2008.
Dr. David Nathanson will be their first client. He claims to have already cured thousand of kids. By helping them to develop a new and better way to reinforce their rehabilitation into the real world.
Also future models, more cost effective, could help people at their home, in their swimming pool. Instead of requiring people to travel to the dolphins they could just buy it at the closest Wal-Mart.

Labels: , , ,


This page is powered by Blogger. Isn't yours?