Posts

HTML - Image Lightbox

Image
If you need to show the full size overlay image on the current page. "Lokesh Dhakar"'s coding is a good example. His code is on javascript and stylesheet. Please visit Lokesh's site to download & see the example. URL Reference: http://www.huddletogether.com/projects/lightbox2/ Example: if you click on thumbnail image. You'll get the full image like this.

MSSQL - Reset Identity Column Value in SQL Server

Command to reset identity column: DBCC CHECKIDENT(table_name,RESEED,0) 1 is the next value of your identity column. Example. Column "id" in table "customer" is an identity column. DBCC CHECKIDENT("customer",RESEED,0) -> next id is 1. or DBCC CHECKIDENT("customer",RESEED,10) -> next id is 11. If you need to check next ID you can use DBCC CHECKIDENT("customer",NORESEED) -> you'll get these result. "Checking identity information: current identity value '0', current column value '0'. DBCC execution completed. If DBCC printed error messages, contact your system administrator." Or you can use this SQL statement to get the current identity: Example. SELECT IDENT_CURRENT ('customer') AS Current_Identity

javascript - show/hide div section

< script language = "javascript" > function toggle ( ) { var ele = document. getElementById ( "toggleText" ) ; var text = document. getElementById ( "displayText" ) ; if ( ele. style . display == "block" ) { ele. style . display = "none" ; text. innerHTML = "show" ; } else { ele. style . display = "block" ; text. innerHTML = "hide" ; } } </ script >   <a id="displayText" href="javascript:toggle();">show</a> <== click Here <div id="toggleText" style="display: none"><h1>peek-a-boo</h1></div> web reference: www.randomsnippets.com

MSSQL - show data per page

- This statement will return record 1 to 20. SELECT * FROM ( SELECT row_number() OVER (ORDER BY id) AS rownum, * FROM example_table_a ) AS A WHERE A.rownum BETWEEN (1) AND (20) - If you want the next 20, your where criteria should be: WHERE A.rownum BETWEEN (21) AND (40) - Finally, SQL statement in your C# code will be: public String CreateSQL(Int32 pageNo, Int32 pageSize) {      StringBuilder _sbSQL = new StringBuilder();      Int32 _offset = 1+ ((pageNo-1) * pageSize);      _sbSQL.Append(" SELECT * FROM ");      _sbSQL.Append(" ( ");      _sbSQL.Append(" SELECT row_number() OVER (ORDER BY id) AS rownum, * ");      _sbSQL.Append(" FROM example_table_a ");      _sbSQL.Append(" ) AS A ");      _sbSQL.Append(" WHERE A.rownum BETWEEN (" + _offset +") AND (" + (_offse...

MSSQL - Integer Type

- bigint Integer (whole number) data from -2^63 (-9,223,372,036,854,775,808) through 2^63-1 (9,223,372,036,854,775,807). Storage size is 8 bytes. - int Integer (whole number) data from -2^31 (-2,147,483,648) through 2^31 - 1 (2,147,483,647). Storage size is 4 bytes. The SQL-92 synonym for int is integer. - smallint Integer data from -2^15 (-32,768) through 2^15 - 1 (32,767). Storage size is 2 bytes. - tinyint Integer data from 0 through 255. Storage size is 1 byte. Remarks The bigint data type is supported where integer values are supported. However, bigint is intended for special cases where the integer values may exceed the range supported by the int data type. The int data type remains the primary integer data type in SQL Server. bigint fits between smallmoney and int in the data type precedence chart. Functions will return bigint only if the parameter expression is a bigint data type. SQL Server will not automatically promote other integer data types (tinyint, smal...

PHP - Fatal error: Call to undefined function curl_init()

Fatal error : Call to undefined function curl_init() Solution of this problem is we need open "curl function" first. We can open this function in "php.ini" in "C:\windows\php.ini" step 1: open "c:\windows\php.ini" step 2: find ";extension=php_curl.dll" and change to "extension=php_curl.dll" step 3: go to "dir: \AppServ\php5" step 4: find     -libeay32.dll     -ssleay32.dll step 5: copy those files to "C:\windows\system32"; step 6 (last step): restart apache or restart appserv server. Website reference:  moshikub.com

PHP - MD5

string md5 ( string $str [, bool $raw_output = false ] ) output of md5 function will returns the hash as a 32-character hexadecimal number. But if you set $raw_output = true , output will return in binary format with a length of 16. Example #1: $str = 'tmvh:partner01:12345'; $output_md5 = md5($str); echo $output_md5; //output is "3d5e420dc4eaaef230409fad5662e825" Example #2 : $str = 'tmvh:partner01:12345'; $output_md5 = md5($str,true); //$output_md5 contain binary format //Convert $md5_output binary format to BASE64 $output_base64 = base64_encode($output_md5); echo $output_base64; //output is "PV5CDcTqrvIwQJ+tVmLoJQ=="