Sunday, June 11, 2017

Nodejs

Node Js


  • Node.js is a very powerful JavaScript-based framework
  • It is used to develop I/O intensive web applications like video streaming sites, single page applications, and other web applications.
  • Node.js is an open source, cross-platform runtime environment for developing server side and networking applications.
  • Node.js applications are written in JavaScript, and can be run within the Node.js runtime on OS X, Microsoft Windows, and Linux.


Concepts

⇉ console.log("Hello World!");
O/P Hello World!

  • The files you create with your editor are called source files and contain program source code. The source files for Node.js programs are typically named with the extension ".js".
  •  if you want dwd nodejs server visit this page
https://nodejs.org/download/

var http = require("http");

http.createServer(function (request, response) {

   // Send the HTTP header 
   // HTTP Status: 200 : OK
   // Content Type: text/plain
   response.writeHead(200, {'Content-Type': 'text/plain'});
   
   // Send the response body as "Hello World"
   response.end('Hello World\n');
}).listen(8081);

// Console will print the message
console.log('Server running at http://127.0.0.1:8081/');
Now execute the main.js to start the server as follows −
$ node main.js
Verify the Output. Server has started.
Server running at http://127.0.0.1:8081/
do you want more information visit http://www.tutorialspoint.com/nodejs/

Wednesday, June 7, 2017

28th class at 26.06.2017

Today is uki 28th class

Today discuss our in class exercise.
exercise1
1) use music
db
2) db.creteColletion("songdetails")
3) db.songdetails.insert(song_name:"thaniye thaniye", flim:"rhythm",music_derctor:"A.R.Rahuman", singer:"shankar mahadeven")
4) db.songdetails.find().pretty()
5) db.songdetails.find({music_director:"A.R.Rahman"},{song_name:1,_id:0})
6) db.songdetails.find({music_director:"A.R.Rahman",singar:"Unnikirishnan"},{song_name:1,_id:0})
7) db.songdetails.remove({songname:"roja poonthoddam"})
8) db.songdetails.insert(song_name:"Etho thechcha", flim:"Anjaan",music_derctor:"A.R.Rahuman", singer:"Aniruth")
9) db.songdetails.find({singar:"Harikaran", flim:"Minsara kannavu"},{song_name:1,_id:0})
10) db.songdetails.find({},{singar:1,_id:0})
 

Tuesday, June 6, 2017

26th class at 24.05.2017 and 27th class at 25.05.2017

Today is uki 26th class.
mongodb comments 
** db.<collection name>.remove({age:25})

{if will delete all the documents equal to age is 25 } 

** db. <collection name>.update({name:"raja"},{$set:{name:"ravi"}})

{update to raja name is changed to ravi} 


 RDBMS Where Clause Equivalents in MongoDB
To query the document on the basis of some condition, you can use following operations



The aggregate() Method

Syntax
Basic syntax of aggregate() method is as follows:
>db.COLLECTION_NAME.aggregate(AGGREGATE_OPERATION)



OR in MongoDB

Syntax
To query documents based on the OR condition, you need to use $or keyword. Following
is the basic syntax of OR −




AND in MongoDB

Syntax
In the find() method, if you pass multiple keys by separating them by ',' then MongoDB
treats it as AND condition. Following is the basic syntax of AND −

>db.mycol.find({key1:value1, key2:value2}).pretty()
thankyou



Friday, June 2, 2017

25th class at 23.05.2017

Today is uki 25th class.

Today we studied MongoDB. This is database language.  

some commands
** show dbs
{data bases show}
** use <database name>
{use database}
** db
{go to database}
**db.createCollection(name)
{creae new collection}
** db.<collection name>.insert({name:"dilai",age:22})
{insert data}
** db.<collecion name>.find()
{show detail}
**db.dropDatabase()
{delete database}
** show collection
{show the collections}
** db.<collection name>.drop()
{delete table}
** db.<collection name>.find({age:22},{name:1,_id:0})
{It will print the name of persons whose age is 22}
**db.<collection name>.find().pretty()
{print the details pretty formate}
I will be meet tommorw more than commands
bye......

23rd at class at 19.05.2017

Today is uki 23rd class.

Today is studied jQuery

 




 1st we install jquery file so visit http://jquery.com/download/ and download.
then we are colled my file 

<head>
<script src="jquery-3.2.1.min.js"></script>
</head>
 
 useing this way. 

Syntax
$(document).ready(function(){

   // jQuery methods go here...

});


some examples  
 * document hide
 $("#hide").click(function(){
    $("p").hide();
});


* document show
$("#show").click(function(){
    $("p").show();
});


 then we make simple website

bye......
 

Thursday, June 1, 2017

22nd class at 18.05.2017

Today is uki 22nd class
Today dived 4 group and give four titles and present about the topic. 
1) Data type
<p id="demo"></p>
<script>
var x=15
"valvo";
document.getElementById("demo").innerHTML = x;
</script>

2)Variables
<script>
var price1=5;
var price2=6;
var total=price1+price2

3)For loop
var i
for(x=0; x<10; i++)
{text="the number is "+x+"<br>";}
document.wite(text);

4)Array
var furits=["banana","Orange","Apple"];

5)Arry sort
var name=["shama","dilani","janu"];
name.sort();

var name=["shama","dilani","janu"];
name.reversing();

var number=[12, 36,85,2,89,25];
  number.sort(function(a,b){retrna-b)};

var number=[12, 36,85,2,89,25];
  number.sort(function(a,b){retrn b-a)};

4) Ramdom
var point=[40,45,98,56,85,65];
pont.sort(function(a,b){return 0.5-math.random()});

5)Function
function f.Name(){
}

6)Condition
if(1<18){
documet.wirte("hello")
}
else
{
document.write("haii")

thankyou next i meet jQuery bye......

21st class at 17/05.2017

Today is uki 21st class. 
Today is 1 month anniversary in uki.life. I got an award is best blogger writer. So I feel very happiness. Then I studies Javascript.  

While loop

Syntax
while (condition) {

code block to be executed

}

Eg: 1)

while (a < 5) {
    text += "number is " + a;
    a++;
}

output:

number 1

number2

number3

number4

Do/While Loop

Syntax

do {
    code block to be executed
}
while (condition); 

Eg: 2)

do {
    text += "number " + a;
    a++;
}
while (a< 5);  

output:

number 1

number2

number3

number4

more example coding

1) i=1;
a=1;
while(a<=10)
{
    i=i*3;
  document.write("The number is "+"   3"+"<sup>"+a+"</sup>"+"  =  "+i+"<br>" );
a++;
}
2)i=0;
var text=""
do{
  text+= "<br>The number is "+i;
  i++;
}
while(i<10);
  document.getElementById("demo").innerHTML=text;
Thankyou

meet tommorrow bye..........