Posts

Showing posts from 2014

compress and decompress folder

private   void  CompressFile( string  sDir,  string  sRelativePath,  GZipStream  zipStream)         {              //Compress file name              char [] chars  =  sRelativePath . ToCharArray();             zipStream . Write( BitConverter . GetBytes(chars . Length),  0 ,  sizeof ( int ));              foreach  ( char  c  in  chars)                 zipStream . Write( BitConverter . GetBytes(c),  0 ,  sizeof ( char ));              //Compress file content  ...

execute mySQL script by cmd

We can run the sql script by MySQL console in WAMP server. Please run it and use command:  1. use database 2. \. E:\acc_20131021.sql

Custom jquery validate

jQuery.validator.addMethod("checkForExistEmail", function (value, element, param) {     var ajaxFunc = $.ajax({         async: false,         data: { emailValidate: value },         type: 'POST',         url: '/url?c=checkEmailExist',         dataType: 'json'     });     if (ajaxFunc.responseText == 1)         return true;     else         return false; }, "This email exist. Please choose another email address"); jQuery.validator.addMethod("checkForEmail", function (value, element, param) {     var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;     return re.test(value); }, "Please enter a valid email address.");

Popup Jquery validate

<!DOCTYPE html> <html lang="en" xmlns="http://www.w3.org/1999/xhtml"> <head>     <meta charset="utf-8" />     <title></title>     <script src="resources/modules/firmabox/scripts/jquery-2.1.1.min.js"></script>     <script src="resources/modules/firmabox/scripts/jquery.validate.min.js"></script> </head> <body>     <form id="form1">         <div style="margin-bottom:20px;"><input name="Test1" id="Test1" type="text" class="required email" /></div>         <div style="margin-bottom:20px;"><input name="Test2" id="Test2" type="text" class="required" /></div>         <div style="margin-bottom:20px;"><input name="Test3" id="Test3" type="text" class="required...

Fix google map show scroll bar in IE

http://www.canbike.org/information-technology/2013/11/01/firefox-infowindow-scrollbar-fix-google-maps-api-v3.html .noscrollbar { line-height:1.35; overflow:hidden; white-space:nowrap; }

Javascript tree and more

http://dhtmlx.com/

Paypal parameter

https://developer.paypal.com/webapps/developer/docs/classic/paypal-payments-standard/integration-guide/Appx_websitestandard_htmlvariables/