Archive

Monthly Archives: February 2010

I use SWFObject2 to embed flash content into the pages.
There are 2 methods: static and dynamic.
At line of SEO, it needs to have some alternative content (fallback content) for SE bots and browsers without flash player.

There is bad effect if we try to use any fallback content with dynamic embedding method.
Alternative content is visible during short time our flash loading.

So, we need to use static method and put fallback content with install flash player button into the object tag.

E.g.,

<!–<![endif]–>
</object>

<script type=”text/javascript” src=”http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js”></script&gt;
<script type=”text/javascript”><!–
jQuery(function() {
swfobject.registerObject(“gamelibrary”, “9”);
});
//–></script>

From other hand dynamic method don’t need IE click flash activation.
So, it would be better to embed menu, interaction or flash game by dynamic method.

http://www.adobe.com/devnet/flashplayer/articles/alternative_content.html

Advertisements

There are 4 methods to truncate time part of the datetime value:

  • cast(convert(varchar, d, 101) as datetime)
    Avg. execution time: 1470
  • cast((str( year( d ) ) + ‘/’ + str( month( d ) ) + ‘/’ + str( day( d ) ) ) as datetime )
    Avg. execution time: 6373
  • cast(floor( cast( d as float ) ) as datetime )
    Avg. execution time: 554
  • dateadd(day, datediff(day, 0, d), 0)
    Avg. execution time: 525

As we can see last one is the most efficient way.
Because it doesn’t use string operations but numeric ones.

PHP function exit(int $status) uses numeric $status return code
but function exit(string $status) just outputs argument string.

The same is true for Python:

import sys
sys.exit(0)

and

imports sys
sys.exit(“aa! errors!”)

In Perl there is only exit(int_code) variant available. However, we use die(‘last words’) or even better Carp::confess() with stack back trace.

In Ruby we can call
exit(
fixnum=-1)
or Process.exit!(fixnum=-1) to exit immidiately
or abort("Message goes here")

There are 2 cache parameters in jQuery UI tabs control:

  1. In the JQuery Tabs options params, you can set the cache to true and the ajax won’t run everytime you click on the tab. The content will be saved in some cache on client side after first ajax loading.

    jQuery(‘#tab-container’).tabs({
    cache: true
    });

  2. There is also AJAX cache parameter. It adds quirk suffix to avoid GET request caching by IE.
    As you know, IE caches GET requests and FF doesn’t.

    jQuery(‘#tab-container’).tabs({
       ajaxOptions: {
         cache: false
       }
    });

ASP.NET 4 allows developers to customize Client Id which gets generated by ASP.NET.
ClientIDMode = “AutoID”

  • AutoID Using this mode will generate the IDs as it has in earlier versions of ASP.NET.
  • Static Static mode outputs the same ID in HTML as specified in ASP.NET source.
  • Predictable Predictable mode concatenates the ID of parent control with the bound value supplied by assigning ClientIDRowSuffix property.
    ClientIDMode=”Predictable” ClientIDRowSuffix=”Name”
  • Inherit Inherit is the default mode for all controls. Assigning this mode a control will use the same setting as its parent control.

But anyway, it would be better to use ASP.MVC instead of ASP.Forms to hold under contorl not just ID’s but whole page.