Wednesday, 13 July 2016

android sqllite good docs

http://www.vogella.com/tutorials/AndroidSQLite/article.html


Thursday, 28 April 2016

Women safety and security android app

Download link:
https://play.google.com/store/apps/details?id=comm.Kishlay.screamDetector&hl=en

"Chilla" is a personal safety & security app that can be triggered by just a shrill scream . It totally removes the hassles of unlocking the phone or opening the app. It has been found that in cases where someone follows a girl / women or eve-teases her , she generally doesn't calls out to parents or police and if they attack her , the app is of no use to her then. In that situation scream is a natural reaction and tapping that is the best possible way to bring her help.
The apps can be triggered by:
1. Scream
2.Pressing power Button 5 times
After Trigger, it does the following
1.Sends SMS with location
2.Sends Email with Audio Recording
3.Automatically places a call
If a scream is detected the app automatically unlocks the phone and places a call to the guardian.
The power button feature works even if the app is not on.
It virtually acts as your personal guardian angel when you are in distress and goes a long way in ensuring your personal safety so that With an elegant yet simple interface it is extremely simple to use.
Not just the safety of women, the safety mode can be additionally customized to cater to the safety
of men too. Besides, the app can be used in case of emergencies too, for example during a heart
attack, the victim’s location and recording can be immediately sent without unlocking the phone.
The best part is, Scream Alert is absolutely free, and it is made for the sole motive of helping women
lead freer and safer lives. A revolution in field of personal security, Scream Alert is your ultimate
safety app, install it today and put your safety in your own hands. Don’t just take our word for it, try
it.


Friday, 17 July 2015

/* package whatever; // don't place package name! */

similar implimentation to java System.out.println()

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
public static void main (String[] args) throws java.lang.Exception
{
// your code goes here
A a=new A();
A.p.out();
}
}
class P
{
int out()
{
System.out.println("here what prints");
return 0;
}

}
class A
{

 static Prin print=new Prin();

}

Wednesday, 1 July 2015

telerik basic page work

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- Include jQuery Mobile stylesheets -->
    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css">
    <link rel="stylesheet" href="css/index.css" />
    <!-- Include the jQuery library -->
    <script src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
    <!-- Include the jQuery Mobile library -->
    <script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>

    <script>

        function check() {
            var a = document.getElementById("text1").value;
            var b = document.getElementById("password1").value;
            if (a == "raj" && b == "password" || a == "RAJ" && b == "password" || a == "Raj" && b == "password") {
                window.location.href = "#pagetwo";
                document.getElementById("show").innerHTML = a;
            }
            else {
                alert("wrong username/password");
            }
        }
    </script>

</head>
<body>

    <!--page one-->
    <div data-role="page" id="pageone">
        <div data-role="header">
            <h1> Welcome To HomePAGE </h1>
        </div>
        <p><center><h1>login form</h1></center></p>

        <div data-role="main" class="ui-content">

            <table>
                <tr>
                    <td>username</td>
                    <td><input type="text" id="text1" /></td>
                </tr>
                <tr>
                    <td>password</td>
                    <td><input type="password" id="password1" /></td>
                </tr>
            </table>
            <center><input type="button" value="login" onclick="check()" /></center>

        </div>




        <div data-role="footer" data-position="fixed">
            <h1> FOOTER</h1>

        </div>
    </div>


    <!--page two-->
    <div data-role="page" id="pagetwo">
        <div data-role="header">
            <h1> hello world </h1>

        </div>


        <div data-role="main" class="ui-content">
            <p>Welcome</p>
            <a href="#pageone">go back</a>
            <div id="show">
            </div>
        </div>

        <div data-role="footer" data-position="fixed">
            <h1> FOOTER</h1>

        </div>
    </div>










</body>
</html>

Friday, 26 June 2015

javascript

date object

var today = new date(); // return todays date

to make out own obj

we can we

var day= new Date(2011,0,1);// year month and day , month as an exception starts as 0

var daytime= new Date(2011,0,1,0,0,0);//also adds hours , mins and secs with previous

Get methods of date obj

day.getMonth();
day.getYear();
day.getTime();

Set methods

day.setMonth(5);

comparison

var date1= new Date(2001,1,1);
var date2= new Date(2001,1,1);

if(date1==date2)//false

if(date1.getTime()==date2.getTime())

CREATING NEW OBJECT

var player= new object();

now its data members will be declared as

player.name="fred";
player.age=13;
player.rank=1;

A variable inside a object is called its properties, same as data member

shorthand to create an object

var player= {name: "Fred",age:13,rank:1};







Thursday, 25 June 2015

git bash


git config --global user.name "<name>"

git config --global user.email "<email>"

git init <project>
to make the folder working area for git , ie to make it project folder

git log
see changes made through commit

git status
see the staged area , new files that have come up and the files that have changed

git add .
add all the files of folder to the staged area

git add "filename"
add the particular file to the stage area

git commit -m "any comment to indicate the changes that reflect in this commit"

git diff
show the exact changes that have taken place in files (as their lines of code)
but shows only of unstaged files

git diff --cached
after we add a file to the stage area and we want to see the differences then we need to use --cached otherwise the changes wont show

shortcuts
if the log becomes to big , to come out of it we need to press ctrl+z+z or ctrl+c(checked)

git log --oneline
show all commits with just the associated message

git commit -a -m "message"
it will quickly do commit , and also add the files to the staging area (replacement as one line code)

git status -s
show modifications in shorthand

ssh-keygen -t rsa -C "email address"
generates rsa key for computer

ssh -T git@github.com
checks whether the computer is able to communicate with the gitserver or not after using rsa encryption


git  remote add  origin "git repository ssh "
will add the remote repository from where we will push or pull the data


git push origin master
will push everything on remote repository

git branch
ti know  all braches

git brach branchname
to make a new branch

git checkout branchname
to go to that branch

git clone "ssh url"
to clone a project to local

git remote add variablename "ssh " or
git push varialbe name branch name
git push something in a branch

TO merge
git merge master
this will merge the code of master with our branch





Thursday, 26 March 2015

my php codes

what do we do to display the common file name that php file shares

<?php
//echo 'hello';
echo $_SERVER['SCRIPT_NAME'];// WILL TAKE THE SCRIPT NAME AND DISPLAY IT
//echo $var;
?>

vid lec - 61

first file 1.php
<?php

include 'inc.php';

if(isset($_POST['submit'])){
echo 'process 1';

}

?>

file 2.php

<?php

include 'inc.php';

if(isset($_POST['submit'])){
echo 'process 2';

}

?>

inc.php

<?php

$script_name= $_SERVER['SCRIPT_NAME'];// WILL TAKE THE SCRIPT NAME AND DISPLAY IT
echo $script_name;
?>

<form action="<?php echo $script_name; ?>"  method="POST">
<input type="submit" name="submit" value="Submit">
</form>
//

will display the name of page we are in inspite of the fact that the running code of that part was included but that became independent bcz of the use of server[script_name];



to see your ip address

<?php

$ip_address= $_SERVER['REMOTE_ADDR'];
echo $ip_address;

// this isnt always a good way to get users ip address, esp when they are on a shared network
// or someone may be using proxy
?>

so what we can do is that we cant check wherether he using a proxy, or is in a shared network
there are ready made functions discussed in video lec

to print an array we use print_r();

to check whether the form has been left empty in the type POST  or get,
we use function (!empty(nameofvariable))

isset()-> just checks whether the submit button has been clicked or not

when we start a session , we create a file on the server side , and that file after its created should be accessible to every page.

SIMPLE CODE FOR SETTING UP SESSION
<?php
session_start();
$_SESSION['name']="alex";
//echo $_SESSION['name'];
?>

CODE TO VIEW SESSION

<?php

session_start();
echo $_SESSION['name'];

?>

a better way to log in , and to check whether user has his session or not and ask him to log in

<?php

session_start();
if(isset($_SESSION['name'])){
echo $_SESSION['name'];
}
else
{
echo 'plz log in.. ';
}
?>

TO END SESSION

<?php
// unset a session

session_start();  // though we are unsetting a session we do need to start the session

unset($_SESSION['name']);
?>

COOKIES

setcookie('username','value',time);// time in seconds

the time here is in terms of timestamp so we save the time stamp
$time= time(); // this time() returns timestamp
and in the parameter we write $time+5 , that sets the cookie for 5 secs

now if one wants to log out , can again set the cookie with time-> $time -5

sql database connection

now, when we connect to database , if there is an improper connection it might show an error,
 to avoid that display of error we write thr statement like

<?php
$mysql_host = 'localhost';
$mysql_user='alex';
$mysql_pass='';

mysql_connect($mysql_host, $mysql_user, $mysql_pass );

// instead of writing the above statement  (which can display the error mesg)we can write

mysql_connect($mysql_host, $mysql_user, $mysql_pass ) or die('could not connect');

>?

we can write the above code in a file and include wherever needed

after connecting to the dbms we need to specify the dbms we need to connect to

my_sql_dbms(nameofDbms);

for any query we need to write it as a string and save that in a variable and then pass that in the function
mysql_query();