October 8, 2013 asvignesh 6Comment
All the modern browser or mobile apps support a placeholder for the text input field. once you click on it the focus move to the beginning of the text and the placeholder remain until you start typing. To achieve this using Flex , Actionscript <mx:Script><![CDATA[ private var sampleText_text:String = “Enter Name”;   protected function sampleText_initializeHandler(event:FlexEvent):void   {   //For Place Holder for sampleText   sampleText.addEventListener(FocusEvent.FOCUS_IN , focusin);   sampleText.addEventListener(FocusEvent.FOCUS_OUT,focusout);     }   //fire when click to edit   public function focusin( event:Event ) : void   {   if(sampleText.text == sampleText_text)   {   sampleText.text = “”;   }   }   //fire when you clicked out   public function focusout(event:Event):void   {   if(sampleText.text == “”)…
July 21, 2013 asvignesh
Using Base64 encoded images in website Encode the image to base64 in php <?php $image = file_get_contents(“https://www.facebook.com/images/fb_icon_325x325.png”); $base64 = base64_encode($image); echo $base64; // This will echo the encoded base64 image ?> Load images in website using php: <?php $image = file_get_contents(“https://www.facebook.com/images/fb_icon_325x325.png”); $base64 = base64_encode($image); echo $base64; // This will echo the encoded base64 image ?> <img src= “data:image/png;base64,<?php echo $base64; ?>” > Using css background: background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAUUAAAFFEAYAAAAr5CMeAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAG2YAABzjgAA+3UAAITUAAB6swAA/2cAADBbAAAQhVDPV6EAABJcSURBVHja7N1/dNX1fcfxd0KI4TdECFiCAioERKER/EWk0lpEB5Ra6wSROeuPqBymlnlcZzsPc5Yq/uJQpa6lHkXKOudRjvO0mbNWA6KzqKttkSq1/AgQUtQkhJCEZH/ce5slhForP5Lcx+OfzzEnDfEVT336vbnfb8bEolmzlz0ch9mIEYlz6tTEOXFi4hyZ/PjxxyfOXr0TZ1ZWAACkpYaGxFlVmTg3b06c72xMnKVrEmdJSfLjGw7Xd3KIg6xrduKcMydx3nh94jx9vB86AMCflWfJPuuX2/IcOy5xXnppy89fvz5xLv1u4lyxInHW133a7yTz0PwNzZiRODf8JnEu/4FABA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5Kh+PIaYwAA0Kx0TTIU/6vEGAAANCspSYbihuRLz7943SgAAOns9WQPvrOh1X0UH3rYOAAA6ay5B1uF4uMrEufvNhkJACCdbEr234oVBwnF+rrEedPNxgIASCc339yyBw/6CL/VqxPnypVGAwDozFK9l+q/Zh/zrOfi6xPnL//XiAAAnUmq76677mCf8TGhmHq030V/lTh//75RAQA6slTPpfquuvovDMWUrclH/E08N3G+/baRAQA6klS/pXpu68c+wjnzk/0B25Jf8JyJifOJFUYHAGjPUr129tkte+7jZf5lf2DqJek5VyTOmV9OnO+/74cBAHA0pW5z86Uvtey1g7/EfIhDsbVnnk6cI0Ymzqu+ljg96QUA4PB6Y33L/ioYlTgPfBfzJ5V1aL/R1H13fri85VlQkDinTEmcRcmXrkcmPz4kP3H26p38trL80AGA9NTQkDhTr+Bu3pw4N25MnKVrEmdJSeJMPYr50Pu/AQBZWmLMHTSOWQAAAABJRU5ErkJggg==); Advantage of using base64: The advantage lies in not having to open another connection and make a HTTP request to the server for the image. advantage for large numbers of very tiny individual…
July 15, 2013 asvignesh
Adjust your rotate and font size values as per your requirement <style type=”text/css”> #asvignesh-watermark { color: #d0d0d0; width: 100%; font-size: 198pt; -webkit-transform: rotate(-47deg); -moz-transform: rotate(-47deg); height: 100%; margin: 0; z-index: -1; left:-100px; top:-200px; position: absolute; } </style> <div id=”asvignesh-watermark”> <p>Vignesh A Sathiyanantham</p> </div>    
June 18, 2013 asvignesh
There are lots of way to check whether the var is array or not but the easiest way is using instanceof Array Example 1 : var myName=[“Vignesh”,”A”,”Sathiyanantham”]; if (myName instanceof Array) { alert(myName is Array!’); } else { alert(‘myName Not an array’); } This will return you myName is Array! Example 2: var myName=”Vignesh A Sathiyanantham”; if (myName instanceof Array) { alert(myName is Array!’); } else { alert(‘myName Not an array’); } This will return you myName Not an Array! You can write a function to make it reusable function ismyvararray(myVar) {  return (myVar instanceof Array); } This will return…
May 19, 2013 asvignesh 10Comment
Openfire is a real time collaboration server licensed under the Open Source Apache License. It uses the only widely adopted open protocol for instant messaging, XMPP (also called Jabber). Setup Openfire in your windows ( chat server ) First setup web server and Database server Install WAMP or XAMPP ( Apache , MySQL , Php ) A web-based, “wizard” driven setup and configuration tool is built into Openfire. Simply launch Openfire and use a web browser to connect to the admin console. The default port for the web-based admin console is 9090. If you are on the same machine as…
May 5, 2013 asvignesh 1Comment
Recently, Google added an exciting feature to Google Drive “web hosting!” It allows you to host a website build on html , css , js in google drive build a website. And did I mention that it’s free? Yep, it’s just one of the little perks that comes with a Google account. You can see the live demo of my sample web page hosted in google drive https://googledrive.com/host/0BwA2EsYXn4Xea0huYzNrLWlwbkk/index.html In this post i explain you to host a website in google drive Requirements A google account Text editor / WYSIWYG editor for editing html / css / js Step One: Prepare…
May 1, 2013 asvignesh 1Comment
Taking backup dump and importing the dump into database can be done very easily using php. In Last posts i explained how to take the backup of Mysql using php http://asvignesh.in/take-mysql-backup-using-php-passthru-function , http://asvignesh.in/take-mysql-backup-using-php Here is the function to import the sql dump into database function import_dump($folder_name = null , $file_name) { $folder_name = ‘dumps’; $path = ‘assets/backup_db/’; // Codeigniter application /assets $file_restore = $this->load->file($path . $folder_name . ‘/’ . $file_name, true); $file_array = explode(‘;’, $file_restore); foreach ($file_array as $query) { $this->db->query(“SET FOREIGN_KEY_CHECKS = 0”); $this->db->query($query); $this->db->query(“SET FOREIGN_KEY_CHECKS = 1”); } }
May 1, 2013 asvignesh 2Comment
In the last post i explained about taking the MySQL backup using php code , This post explains to take the backup of your MySQL database using the passthru function ( passthru documentation ) The passthru() function is similar to the exec() function in that it executes a command. This function should be used in place of exec() or system() when the output from the Unix command is binary data which needs to be passed directly back to the browser <?php $datestamp = date(“Y-m-d”); // Present date to append in the filename for the identification /* CONFIGURE THE FOLLOWING SEVEN…
May 1, 2013 asvignesh
One of the most important task of developer or administrators is to take backup periodically, Most of the hosting provider and cloud providers charge more for taking backup periodically , SaaS application developers or CMS developers can let the user to take the backup of the data using the interface. Here is the easy way to take the backup dump of the MySQL take_dump(‘DB_HOST’,’UNAME’,’PASS’,’DB’); /* backup the db OR just a table */ function take_dump($host,$user,$pass,$name,$tables = ‘*’) { $link = mysql_connect($host,$user,$pass); mysql_select_db($name,$link); //get all of the tables if($tables == ‘*’) { $tables = array(); $result = mysql_query(‘SHOW TABLES’); while($row = mysql_fetch_row($result))…
April 28, 2013 asvignesh 1Comment
Here is the simple way to host your media files ( images , videos , audios) in Amazon S3 ( Simple Storage Service Amazon’s Simple Storage Service provides a simple web server to access any file that is stored in their storage cloud. This means, you can access files stored at S3, directly via a web browser, if you have set the permissions as “read” for all users. You can teach your clients to use S3 to host media files, which do not need scripting on the web server side and not require a lot of bandwidth to serve, e.g….