Saturday 23 September 2017

Tips for Email writting


1) Always have a proper subject
                                      
                Give a clear and brief subject line that showcase about the letter/message
                Ex : Parents meeting in school

2) Use simple sentences
                 Don't make your letter so fishy that people find it difficult to read and understand what                        you  have written,like using long difficult words or complex sentences etc.

3) Address the letter in formal or informal way
                 Before you write the letter to whom you are representing it to is important.
                  a friend or principle etc

4) Be careful with the language
                 Use English language while writing do not mix up your mother tongue,
                  don't  use short forms (like sms) you ( u ) would (wd) etc

5) Give a positive response
                  Whatever you write in the letter let that focus on positive points.   

Tuesday 19 September 2017

c programs to add two numbers using cmd line arguments

-Write the code in the editors like vc edit in fedora

-Example add.c

-Save the file.

#include<stdio.h>
#include<stdlib.h>
int main(int argc, char * argv[]) {
       int i, sum = 0;

       if (argc != 3) {
              printf("You have forgot to specify two numbers.");
              exit(1);
       }
     printf("The sum is : ");
    sum= atoi(argv[1])+atoi(argv[2]);
     printf("%d", sum);
    return 0;

}


-execute the file like

C:bin> cc add.c

C:bin> ./a.out 10 20


output : 30
 

C program to add numbers and execute using cmd line arguments

-Write the code in the editors like vc edit in fedora
-Example add.c

#include<stdio.h>
void main(int argc , char * argv[])  
{
  int i,sum=0; if(argc!=3)  
{
printf("enter two numbers numbers.");  
exit(1);
  }
  printf("The sum is : ");
  for(i=1;i<argc;i++)
sum = sum + atoi(argv[i]);
printf("%d",sum);  
}

-Save the file.
-execute the file like
C:bin> cc add.c
C:bin> ./a.out 10 20

output : 30

 


Friday 8 September 2017

wireless transfer of data from arduino to server using esp8266 with example of DHT11

#include "SoftwareSerial.h"
String ssid ="yourSSID";
String password="yourPassword";
SoftwareSerial esp(6, 7);// RX, TX

String data;
String server = "yourServer"; 
String uri = "yourURI";

int DHpin = 8;
byte dat [5];
String temp ,hum;


void setup() {
pinMode (DHpin, OUTPUT);
esp.begin(9600);
Serial.begin(9600);
reset();
connectWifi();
}

//reset the esp8266 module
void reset() {
esp.println("AT+RST");
delay(1000);
if(esp.find("OK") ) Serial.println("Module Reset");
}

//connect to your wifi network
void connectWifi() {
String cmd = "AT+CWJAP=\"" +ssid+"\",\"" + password + "\"";
esp.println(cmd);
delay(4000);
if(esp.find("OK")) {
Serial.println("Connected!");
}
else {
connectWifi();
Serial.println("Cannot connect to wifi"); }
}

byte read_data () {
byte data;
for (int i = 0; i < 8; i ++) {
if (digitalRead (DHpin) == LOW) {
while (digitalRead (DHpin) == LOW); // wait for 50us
delayMicroseconds (30); // determine the duration of the high level to determine the data is '0 'or '1'
if (digitalRead (DHpin) == HIGH)
data |= (1 << (7-i)); // high front and low in the post
while (digitalRead (DHpin) == HIGH);
// data '1 ', wait for the next one receiver
}
} return data; }


void start_test () {
digitalWrite (DHpin, LOW); // bus down, send start signal
delay (30); // delay greater than 18ms, so DHT11 start signal can be detected
digitalWrite (DHpin, HIGH);
delayMicroseconds (40); // Wait for DHT11 response
pinMode (DHpin, INPUT);
while (digitalRead (DHpin) == HIGH);
delayMicroseconds (80);
// DHT11 response, pulled the bus 80us
if (digitalRead (DHpin) == LOW);
delayMicroseconds (80);
// DHT11 80us after the bus pulled to start sending data
for (int i = 0; i < 4; i ++)
// receive temperature and humidity data, the parity bit is not considered
dat[i] = read_data ();
pinMode (DHpin, OUTPUT);
digitalWrite (DHpin, HIGH);
// send data once after releasing the bus, wait for the host to open the next Start signal
}

void loop () {
start_test ();
// convert the bit data to string form
hum = String(dat[0]);
temp= String(dat[2]);
data = "temperature=" + temp + "&humidity=" + hum;// data sent must be under this form //name1=value1&name2=value2.
httppost();
delay(1000);
}

void httppost () {
esp.println("AT+CIPSTART=\"TCP\",\"" + server + "\",80");//start a TCP connection.
if( esp.find("OK")) {
Serial.println("TCP connection ready");
} delay(1000);
String postRequest =
"POST " + uri + " HTTP/1.0\r\n" +
"Host: " + server + "\r\n" +
"Accept: *" + "/" + "*\r\n" +
"Content-Length: " + data.length() + "\r\n" +
"\r\n" + data; String sendCmd = "AT+CIPSEND=";//determine the number of characters to be sent.
esp.print(sendCmd);
esp.println(postRequest.length() );
delay(500);
if(esp.find(">")) { Serial.println("Sending.."); esp.print(postRequest);
if( esp.find("SEND OK")) { Serial.println("Packet sent");
while (esp.available()) {
String tmpResp = esp.readString();
Serial.println(tmpResp);
}
// close the connection
esp.println("AT+CIPCLOSE");
}
}
}

Wednesday 26 July 2017

SQL 2

SQL AND & OR Operators :

student table :

student name      Contact     Address City Country
Ayush 89045             Old Ib road Bagalkot India
Akshay 7899               GM road Belgaum India
Pavitra 8649               Hosur Belgaum India
Pooja 9978               Busstand road Gadag India

 

 

AND operator :

SELECT * FROM student
WHERE Country='India'
AND City='Bagalkot'; 


OR operator :

 
SELECT * FROM student
WHERE City='Hubli'
OR City='Belgaum';

 

Combination of AND and OR operator :

 

SELECT * FROM student
WHERE Country='India'
AND (City='Bagalkot' OR City='Hubli');

 

Monday 6 March 2017

IoT

Raspberry Pi  :
                          It's a device of  size of  VISA card with some extension with GPIO pins along the boundary.Its acts as a server(Stand alone Pc's) or say Desktop pc,that can perform many activities like glowing the LED to Opening the doors automatically.

Raspberry works with "Raspbian OS"  which needs to be installed in the Storage device connected to Pendrive or memory card inserted in to the Pi.Your pi can excellently work with Python language.

Raspberry pi can be obtained from certain sites online,it has divisions of models :
-Raspberry Pi
-Raspberry Pi 2
-Raspberry Pi 3...
 with model B,B+ etc

                                                                    Fig 1.0 ( Pi 3 )


Details about raspberry pi :

> https://www.raspberrypi.org

Download Raspbian OS :

> https://www.raspberrypi.org/downloads/

 Quick start to Raspberry pi :
> https://www.raspberrypi.org/learning/software-guide/quickstart/











Wednesday 8 February 2017

Big Data


What is Big Data?
                               Big data means really a big data itself,it is big collection of data that cannot be processed using normal techniques or say computing techniques.It has several tools or frameworks with it to handle the data.

 
Big data include big amount of data, it may be :

> Structured (Relational data set)
>Semi-Structured (XML data)
>UN-Structured (doc,text,PDF etc)


Tools or Frameworks used :

Hadoop :It is the Apache open source framework that will provide a option to process the data and also store the data from the clusters of computer using some programming constructs (Java).
Hadoop Map Reduce is the software that allows to write the application which processes huge amount of data in parallel.

The two key components of Hadoop :

>Hive and
>Pig.

Pig and Hive are the two tools that made ease the complexity of writing the programming using the java language.Pig allows to use query for operation on the data such as filter join etc.Hive is also similar to  query language but have some restrictions called hive query language (HQL) commands understood by itself.
   

This is just a brief of what is big-data and what it does use and how it is used to manipulate the data with various tools. One can learn big-data and use tools from different sites available .