Monday, September 23, 2013

Online Border Designs for CSS and ANDROID and get code

Left Border Width

Right Border Width

Top Border Width

Bottom Border Width

Same Border Width

TopLeft Border Radious

TopRight Border Radious

BottomLeft Border Radious

BottomRight Border Radious

Same Border Radious

Background Color

#

Border Color

#

CSS Code

   

Android shape.xml

   

Friday, September 20, 2013

Best mapping technique using Operator Precedence

If there is a  condition you want to map one to many or many to one  scenario in you program.
Program can be a
database table,
selection box in you web page,
posting data to server

For example:
There is a condition student and course you want to map and store or send some where.

The way engineers do 





The way of doing using Operator Precedence 









According to the table in old way: 
Tiru - Joined Course (Java,C,C++)
John- Joined Course (Java)
Kotini- Joined Course (Java,C++,Android,Python)

How it Operator Precedence works
Assign some unique bit as Course Bit Id.
What ever student -course mapping value store in Student Table's Student Course Column 

Tiru - Joined Course (Java,C,C++)
i.e 
Tiru-Do operator or for Tiru's courses  (1|10|100=111)

John- Joined Course (Java)
i.e 
John-Do operator or for John's courses  (1=1)

Kotini- Joined Course (Java,C++,Android,Python)
i.e 
Kotini-Do operator or for Kotini's courses  (1|100|1000|10000=11101)

How to check actual student course in  from [Student Course Column]

If you retrieved Kotini's courses i.e 11101
then check using operator  and
11101&1=1 (11101&Java=Java)
11101&10=0 (11101&C=0 means Kotini not joined in C)
11101&100=100 (11101&C++=C++)
11101&1000=1000 (11101&Android=Android)
11101&10000=10000 (11101&Python=Python)

How to check remove a student course in  from [Student Course Column]
Kotini's courses  (11101=Java,C++,Android,Python) and if you want to remove C++ i.e 100 course 
then check using operator  '-'
11101-100=11001=Java,Android,Python


What is the advantage of this technique 
 As we know bit wise operation is the fastest operation.And less memory usage.
In this example we decreased a table. 

Where this technique currently using.
1>In Microsoft Office Excel,Word,Power Point
2>In Some html Multi Selection





Wednesday, September 11, 2013

Different Type console output in [Node.Js]

console.log([data], [...])
console.info([data], [...])
console.error([data], [...])
console.warn([data], [...])
console.dir(obj)
console.time(label)
console.timeEnd(label)
console.trace(label)
console.assert(expression, [message])

Usage of console.log([data], [...]),console.info([data], [...]),console.error([data], [...]),console.warn([data], [...])

 Print the output in a newline .
This function can take multiple arguments like a printf() in C or System.out.println() in Java



Example Consloe.js:
 var data=[{"name":"Kotini","LastName":"Tirumula"},{"name":"Kotini","LastName":"Srinu"}];  
 console.dir(data);  

Out Put:

 D:\nodejs>node Console.js
 This is console log output
 This is output of,console log

Usage of console.dir(obj):

Example ConsloeDir.js:

 var data=[{"name":"Kotini","LastName":"Tirumula"},{"name":"Kotini","LastName":"Srinu"}];
console.dir(data);

Out Put:

D:\nodejs>node ConsoleDir.js
[ { name: 'Kotini', LastName: 'Tirumula' },
  { name: 'Kotini', LastName: 'Srinu' } ]
D:\nodejs>

Usage of console.time(label) and console.timeEnd(label)
console.time(label):
 Mark or start record a time.
console.timeEnd(label):
 Finish timer, record output. 

Example ConsloeTime.js:




 console.time('10-elements');  
  for (var i = 0; i< 10; i++)   
 {   
   console.log("Itr "+i);   
 }   
 console.timeEnd('10-elements');  

Out Put:
D:\nodejs>node ConsloeTime.js 
Itr 0 
Itr 1 
Itr 2 
Itr 3 
Itr 4 
Itr 5 
Itr 6 
Itr 7 
Itr 8 
Itr 9 
10-elements: 2ms 
D:\nodejs>

Usage of console.trace(label)
  Print a stack trace as a stderr at the current position.And break the execution.
Its kind of throwing exception. 

Example ConsloeTrace.js:


 console.log('1st Line');  
 console.log('2nd Line');  
 console.trace('trace Here');  
 console.log('4th st Line');  

Out Put:

D:\nodejs>node ConsloeTrace.js
1st Line
2nd Line
D:\nodejs\ConsloeTrace.js:3
console.tace('trace Here');        ^

TypeError: Object # has no method 'tace'

    at Object. (D:\nodejs\ConsloeTrace.js:3:9)

    at Module._compile (module.js:456:26)

    at Object.Module._extensions..js (module.js:474:10)

    at Module.load (module.js:356:32)

    at Function.Module._load (module.js:312:12)

    at Function.Module.runMain (module.js:497:10)

    at startup (node.js:119:16)

    at node.js:901:3



D:\nodejs>

How to write Hello World in [Node.js]

Hello world is a most important program for a developer.

Node.js Installation and check its working or notSystem Environment Variable

I will briefly tell you how to write "Hello In Node.Js" in 2 steps.

Step 1:
 Create a text file with extection js.
 like HelloWorld.js and I saved in D:\nodejs\HelloWorld.js





Step 2:
 Open Command prompt or terminal  ,got to the saved folder and type "node HelloWorld.js"
D:\nodejs\>HelloWorld.js

Out Put:

D:\nodejs>node HelloWorld.js
Hello World
D:\nodejs>





Node.js Installation and check its working or not

About Node.js:
Theoretically :  
  Node.js is a platform built on Chrome's JavaScript run time for easily building fast, scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices.

As per my Experience:
Node.js is a platform built on Chrome's JavaScript runtime ,which we can use server side.Till now developer uses Javascript as client side .But Node.js will help to write server side programming using Javascript.

Download And Install Node.Js from below link:
http://nodejs.org/download/
Once you install how to check Node.js is working or not
Open Command prompt or Terminal and type "node" and check for ">" console.
Once its showing then cancel the Command prompt or  terminal .

e.g:


After installation if Node.js is not working then:

Set Environment Variable: Click Here To Check set Environment Variable
Variable Name: NODEJS_HOME
Variable Value: C:\Program Files\nodejs or [Path Of the Nodejs installation directory]

Edit Environment Variable [Path]: Append below line
                                               ;%NODEJS_HOME%\;



Tuesday, September 10, 2013

System Environment Variable

System Environment Variable Change in window:


  1. Win Key+R
  2. type "sysdm.cpl" and Enter
  3. Go to Advance Tab
  4. Then Click Environment Variable
  5. In System Variable:

Click "New"
Variable Name:
Variable Value: