Thursday 26 February 2015

அண்ணாமலை - ஒரு பெண் புறா கண்ணீரில் தள்ளாட

படம் : அண்ணாமலை
இசை : தேவா 
பாடியவர் :  K.J. ஜேசுதாஸ் 
பாடல் வரி : வைரமுத்து
 









ஒரு பெண் புறா கண்ணீரில் தள்ளாட 
என் உள்ளம் திண்டாட என்ன வாழ்கையோ? 
சுமை தாங்கியே சுமை ஆனதே 
எந்தன் நிம்மதி போனதே மனம் வாடுதே 
ஒரு பெண் புறா
கட்டன் தரையில் ஒரு துண்டை விரிதேன் 
கண்ணில் தூக்கம் சொக்குமே அது அந்த காலமே 
மெத்தை விரித்தும் சுத்த பன்னீர் தெளித்தும் 
கண்ணில் தூக்கம் இல்லயே அது இந்த காலமே 

என் தேவனே தூக்கம் கொடு 
மீண்டும் அந்த வாழ்க்கை கொடு 
பாலைவனம் கடந்து வந்தேன் பாதங்கலை அறவிடு 
ஒரு பெண் புறா கண்ணீரில் தள்ளாட 
என் உள்ளம் திண்டாட என்ன வாழ்கையோ? 
சுமை தாங்கியே சுமை ஆனதே 
எந்தன் நிம்மதி போனதே மனம் வாடுதே 
ஒரு பெண் புறா

கோழி மிதித்து ஒரு குஞ்சு சாகுமா 
அன்று பாடம் படித்தேன் அது பழைய பழமொழி 
குஞ்சு மிதித்து ஒரு கோழி வெந்ததே 
இதை நெஞ்சில் நிறுத்து இது  புதிய பழமொழி 
ஆண் பிள்ளையோ சாகும் வரை 
பெண் பிள்ளையோ போகும் வரை 
விழி இரண்டும் காயும் வரை 
அழுதுவிட்டேன் ஆனவரை

ஒரு பெண் புறா கண்ணீரில் தள்ளாட 
என் உள்ளம் திண்டாட என்ன வாழ்கையோ? 
சுமை தாங்கியே சுமை ஆனதே 
எந்தன் நிம்மதி போனதே மனம் வாடுதே 
ஒரு பெண் புறா

Wednesday 18 February 2015

Javascript


Load java script dynamically

function loadjscssfile(filename, filetype){
    if (filetype=="js"){ //if filename is a external JavaScript file
        var fileref=document.createElement('script')
        fileref.setAttribute("type","text/javascript")
        fileref.setAttribute("src", filename)
    }
    else if (filetype=="css"){ //if filename is an external CSS file
        var fileref=document.createElement("link")
        fileref.setAttribute("rel", "stylesheet")
        fileref.setAttribute("type", "text/css")
        fileref.setAttribute("href", filename)
    }
    if (typeof fileref!="undefined")
        document.getElementsByTagName("head")[0].appendChild(fileref)
}
loadjscssfile("other domain js/css", "js/css")

Http Cookie

Types of Http Cookie


  • Session Cookie - browser close expired. not any expire time
  • Persistent Cookie - Max-Age one year 
  • Secure Cookie - https only access. encrypt while send client to server
  • Http only cookie - only access via http not using javascript or 
  • Third party cookie - thrid party site cookie store. browser doesn't allow third part cookie util enable browser setting
  • Super cookie - .com super domain cookie. default disable in browser
  • Zombie cookie - delete also recreate the cookie from storage




Sunday 15 February 2015

ReactJs

1. ReactJS - Server side Rendering Using Java(jdk1.7)

<%
String output="var value=[]";
ScriptEngineManager sem = new ScriptEngineManager();
ScriptEngine se = sem.getEngineByName("rhino");
// React depends on the "global" variable and console variable
se.eval("var global = this");
se.eval("var console = {}");
se.eval("console.warn = function(){};");
// eval react.js
se.eval(new FileReader("/react-0.12.2.js")); // React Location
se.eval(output); // variable for component props
se.eval(new FileReader("/Component.js")); // React Component location (Component should be converted js file not jsx file)
String render ="React.renderToString(React.createFactory(Component)({props: value}))";
%>

<%=se.eval(render)%> // execute the component get html as a string




Custom Annotation in java


1. source - discard compile time.
2. compile time - annotation exist in class file but not in vm
3. run time - annotation exist in run time vm knows these types of annotation(Hibernate,Spring use these annotation for understanding the class at run time). below example is run time annotation


package test;

import java.lang.annotation.Annotation;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

@Retention(RetentionPolicy.RUNTIME)
@interface Test1{
public String name() default "vimal";
}
@Test1(name="vimalesan")
public class CustomAnnotationPro {
public static void main(String arg[]) {
Class<CustomAnnotationPro> c=CustomAnnotationPro.class;
if(c.isAnnotationPresent(Test1.class)){
Annotation annotation=c.getAnnotation(Test1.class);
Test1 t=(Test1)annotation;
if(t.name().equals("vimal")){
System.out.println("No Change");
}
else{
System.out.print("New value "+t.name());
}
}

}
}


Mysql


1. Truncate table with foreign key constrain

     ERROR 1701 (42000): Cannot truncate a table referenced in a foreign key constraint 

       Disable foreign key constrain and truncate then enable foreign key constrain

           1. SET FOREIGN_KEY_CHECKS = 0;
           2. TRUNCATE TABLE TABLE_NAME;
           3. SET FOREIGN_KEY_CHECKS = 1;

2. Stop query execution while typo error in command prompt

     mysql>selct  -typo error
                 *
                 from
                 table_name
                \c
    clear the query execution

Tuesday 3 February 2015

NPM - Node Package Manager

NPM
 
npm is a package manager for JavaScript, and is default for Node.js

npm install package -g
fixing installation issue
  1. changing the directory as owner
      whoami – get user name
      sudo chown user_name directory
      npm config get prefix
      sudo chown -R user_name all directory
      (*** /usr/local/lib,/usr/local/bin,/usr/local/share)
     2. changing directory prefix
  1. mkdir /users/user_name/npm-global
    npm config set prefix /users/user_name/npm-global
    npm install -g newpackage
    trying to access newpackage cmd in terminal won't not working for that
Install npm package locally – not executable
Install npm package globally – executable

package.json name,version – required

dependencies install- npm install package - -save save the dependencies in package.json
update local package – npm update
list out packages using - npm ls
check outdated packages – npm outdated
uninstall package – npm uninstall package
uninstall package and remove from package.json dependencies – npm uninstall package –save
remove unwanted package download for project (dependencies not exist in package.json)-
npm prune

installing npm package globally – npm install package -g
note :error while installing use sudo npm install package -g
update also
npm install -g jshint
check outdated
npm outdated -g –depth=0

uninstall package
npm uninstall -g package
export.function

npm publish

semantic version
npm version patch

npm version minor
npm version major

minor version release update - npm install packag@1.x – minor version