Wednesday 4 November 2015

CHAT-APPLICATIONS (using socket.io, express and Nodejs )

(1)First of All install Nodejs  on your Windows system:

https://nodejs.org/en/download/

(2)After  That create a folder into your D: drive and name it "chat code" & now you need to  Open your command Prompt:

& perform following  command in command prompt

step 1:

D:\>cd chat code

step 2: to install socket.io

D:\chat code>npm   install  socket.io


step 3:to install  express


D:\chat code>npm   install   express

step 4: Prepare a file name it  as   "package.json " write given code below:

{
  "name": "socket-chat-example",
  "version": "0.0.1",
  "description": "my first socket.io app",
  "dependencies": {
    "express": "4.10.2",
    "socket.io": "1.2.0"
  }
}


& save it.






(3)Now write code for    "om.js"    file code which act as server program at server side keep this file  inside "chat code" folder :

var express = require('express')
  , app = express()
  , http = require('http')
  , server = http.createServer(app)
  , io = require('socket.io').listen(server);

server.listen(8080);

// routing
app.get('/', function (req, res) {
  res.sendfile(__dirname + '/om.html');
});

// usernames which are currently connected to the chat
var usernames = {};

io.sockets.on('connection', function (socket) {

  // when the client emits 'sendchat', this listens and executes
  socket.on('sendchat', function (data) {
    // we tell the client to execute 'updatechat' with 2 parameters
    io.sockets.emit('updatechat', socket.username, data);
  });

  // when the client emits 'adduser', this listens and executes
  socket.on('adduser', function(username){
    // we store the username in the socket session for this client
    socket.username = username;
    // add the client's username to the global list
    usernames[username] = username;
    // echo to client they've connected
    socket.emit('updatechat', 'SERVER', 'you have connected');
    // echo globally (all clients) that a person has connected
    socket.broadcast.emit('updatechat', 'SERVER', username + ' has connected');
    // update the list of users in chat, client-side
    io.sockets.emit('updateusers', usernames);
  });

  // when the user disconnects.. perform this
  socket.on('disconnect', function(){
    // remove the username from global usernames list
    delete usernames[socket.username];
    // update list of users in chat, client-side
    io.sockets.emit('updateusers', usernames);
    // echo globally that this client has left
    socket.broadcast.emit('updatechat', 'SERVER', socket.username + ' has disconnected');
  });
});

(4)Now write code for file "om.html" client side   "userinterface"  keep this file inside "chat code " folder :

<style>
.button { width: 9%; background: rgb(130, 224, 255); border: none; padding: 10px; }
</style>
<script src="/socket.io/socket.io.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
<script>

    //var socket = io.connect('http://Localhost:8080');

   //var socket = io.connect('http://vissicomp.evennode.com:8080');
   var socket=io.connect();
   //var socket = io.connect('http://192.168.1.4:8080');
 
  // on connection to server, ask for user's name with an anonymous callback

  socket.on('connect', function()
  {
    // call the server-side function 'adduser' and send one parameter (value of prompt)
    socket.emit('adduser', prompt("What's your name?"));

  });
  // listener, whenever the server emits 'updatechat', this updates the chat body
  socket.on('updatechat', function (username, data) {
    $('#conversation').append('<b>'+username + ':</b> ' + data + '<br>');
  });
  // listener, whenever the server emits 'updateusers', this updates the username list
  socket.on('updateusers', function(data) {
    $('#users').empty();
    $.each(data, function(key, value) {
      $('#users').append('<div>' + key + '</div>');
    });
  });
  // on load of page
  $(function(){
    // when the client clicks SEND
    $('#datasend').click( function() {
      var message = $('#data').val();
      $('#data').val('');
      // tell server to execute 'sendchat' and send along one parameter
      socket.emit('sendchat', message);
    });
    // when the client hits ENTER on their keyboard
    $('#data').keypress(function(e) {
      if(e.which == 13) {
        $(this).blur();
        $('#datasend').focus().click();
      }
    });
  });
</script>
<div style="float:left;width:100px;border-right:1px solid black;height:300px;padding:10px;overflow:scroll-y;">
  <b>USERS</b>
  <div id="users"></div>
</div>
<div style="float:left;width:300px;height:250px;overflow:scroll-y;padding:10px;">
  <div id="conversation"></div>
  <input id="data" style="width:200px;" />
  <input type="button" id="datasend" value="send" />
  </div>


(5)Now  run your  "om.js"  server file first:


D:\chat code>node  om.js

(6)Then  Run   client side file open any browser and type on address bar "Localhost:8080 :

"Localhost:8080"



Saturday 31 October 2015

how-to-insert-Google-map to your website?

(1)go to  url:

(2)Then type city name & area name whose map you want:

(3)then click on share  & then click on Embed  Map:

(4)copy the   <iframe src=”  ”>   </iframe>  tag code & paste inside <body></body> tag.

(5)sample code  :
<html>
<head>
<title>map</title>
</head>
<body>
<iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3762.1266625295916!2d72.78801131404806!3d19.45010504516274!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x3be7aa3228a34c4f%3A0x7126441adfc5fdd0!2sPadmavati+Nagar+Co-operative+Housing+Society!5e0!3m2!1sen!2sin!4v1446384964240" width="600" height="450" frameborder="0" style="border:0" allowfullscreen></iframe>
</body>
</html>

How-to-Publish-AndroidApps-on-GooglePlayStore?

step 1 : first go to url link & make login using your gamil id & password:

Url=https://play.google.com/apps/publish/


Step 2:
 make payment  using debit card or credit card $25..  & IT    TAKE   ONE    DAY.




step 3: then make & fill your  payment  details.

step 4: Then go to setting  & click on Account details & enter your account details:


Step 5:  Then click on   "All applications"  & click  on   Apk  :


Step 6: Then upload your  Signed Apk file  click on  "UPload New Apk to Production" file (note: google do not accept debugged apk file so plz check first whether it is signed or not).

Step 7:after uploading you have fill  details for following things:
Store Listing
Content Rating
Pricing & Distribution

Step 8: enter your  Store Listing Details after clicking on Store Listing...





Step  9: now enter details for Content Rating  click on Content Rating :


Step 10: Enter  click on Pricing & Distribution  click on Pricing & Distribution :



Step 11:
then click on  PUBLISH ..  THEN   IT   WILL TAKE   2HRS   TO   5HRS   TO  PUBLISH .

SEE YOUR ALERT ON LEFT HAND SIDE WHICH WILL SHOW YOU THE NOTIFICATIONS..

Friday 30 October 2015

ORACLE-PL-SQL COMPLETE GUIDANCE WITH EXAMPLE

INTRODUCTION TO PL/SQL :

       Procedural Language/Structured Query Language
       PL/SQL is Very Usefully Language and Tools of Oracle to Manipulate, Control, Validate, and Restricted the Unauthorized Access of Data from the Database.
       PL/SQL can improve the Performance of an Application and it is dealing with Error and return User Friendly Error Message.
Advantages PL/SQL   :
       Procedural Language Supported.
       Reduces Network Traffic .
       Error Handling .
       Declare Variable. 
       Intermediate Calculation.
       Portable Application. 

PL/SQL Block   :

PL/SQL Block consists of three sections:
       The Declaration section (optional).
       The Execution section (mandatory).
       The Exception (or Error) Handling section (optional).



 PL/SQL Block  :
DECLARE

     Variable declaration

BEGIN
     Program Execution

EXCEPTION

     Exception handling

END;


Basic  Example  :
DECLARE
message varchar2(20):= 'Hello, World!';
BEGIN
dbms_output.put_line(message);
END;



PL/SQL DATA TYPE:

       Number type
Example :
no    number:=10;
(The NUMBER datatype is used to store fixed-point or floating-point numbers)
       Character type
(CHAR data type is used to store fixed-length character data)
Example:
grade  CHAR(1);
.VARCHAR2
(The VARCHAR2 data type is used to store variable-length character data)
.Datetime  type
(The Datetime data types lets us store and manipulate dates, times, and intervals (periods of time). )
 .Boolean type:
(BOOLEAN data type is used to store the logical values TRUE, FALSE and NULL (which stand for a missing, unknown, or inapplicable value).)



IF-THEN :

Syntax:
IF condition THEN
{
...statements to execute when condition is TRUE...
}
END IF;
If-then example:
declare
no number:=&n;
begin
if no>0 then
dbms_output.put_line('is positive');
end if;
end;



IF-THEN-ELSE :

Syntax:
IF condition THEN
{
...statements to execute when condition is TRUE...
}
ELSE
 {
...statements to execute when condition is FALSE...
}
END IF;


Example:

declare
no number:=&n;
begin
if no>0 then
dbms_output.put_line('is positive');
else
dbms_output.put_line('is negative');
end if;
end


IF-THEN-ELSIF-ELSE :

Syntax:
IF   condition1    THEN
{
...statements to execute when condition1 is TRUE...
}
ELSIF   condition2   THEN
{
...statements to execute when condition2 is TRUE...
}
ELSE
 {
...statements to execute when both condition1 and condition2 are FALSE...
}
 END IF;


Example :

DECLARE
  grade CHAR(1);
BEGIN
  grade := 'B';
 
  IF grade = 'A' THEN
    DBMS_OUTPUT.PUT_LINE('Excellent');
  ELSIF grade = 'B' THEN
    DBMS_OUTPUT.PUT_LINE('Very Good');
  ELSIF grade = 'C' THEN
    DBMS_OUTPUT.PUT_LINE('Good');
  ELSIF grade = 'D' THEN
    DBMS_OUTPUT. PUT_LINE('Fair');
  ELSIF grade = 'F' THEN
    DBMS_OUTPUT.PUT_LINE('Poor');
  ELSE
    DBMS_OUTPUT.PUT_LINE('No such grade');
  END IF;
END








 CASE  in PL_SQL example  :

DECLARE
  grade CHAR(1);
BEGIN
  grade := 'B';
 
  CASE

    WHEN grade = 'A' THEN DBMS_OUTPUT.PUT_LINE('Excellent');
    WHEN grade = 'B' THEN DBMS_OUTPUT.PUT_LINE('Very Good');
    WHEN grade = 'C' THEN DBMS_OUTPUT.PUT_LINE('Good');
    WHEN grade = 'D' THEN DBMS_OUTPUT.PUT_LINE('Fair');
    WHEN grade = 'F' THEN DBMS_OUTPUT.PUT_LINE('Poor');

  END CASE;

EXCEPTION
  WHEN      CASE_NOT_FOUND      THEN
     DBMS_OUTPUT.PUT_LINE('No such grade');
END;




WHILE   Loop  :

Syntax:
WHILE  condition 
LOOP
{
...statements...
}
END LOOP;

Example:
declare
n number:=1;
begin
while n<10
loop
dbms_output.put_line(n);
n:=n+1;
end loop;
end;


For  loop  :

Syntax:
FOR  loop_counter IN [REVERSE] lowest_number..highest_number
LOOP
{
...statements
...}

END LOOP;

Example:

declare
i number;
begin
for i in 1..10
Loop
dbms_output.put_line(i);
end loop;
end;



Cursor    in   PL-SQL  :

(1)Simple   way   select     statement   in   pl-sql :

declare
eno       int;
ename   varchar(200);
begin
select  id,name into eno,ename  from mytest where id='1';
dbms_output.put_line(eno||ename);
end;

(2) SELECT   USING     %TYPE:
declare
eno       mytest.id%type;
ename   mytest.name%type;
begin
select  id,name  into  eno  ,  ename  from   mytest   where id='1';
dbms_output.put_line(eno||ename);
end;


 (3)cursor example  with %rowtype :
declare
en  mytest%rowtype;
cursor c1   is  select   *   from  mytest;
begin
open c1;
loop
fetch c1 into en;

dbms_output.put_line(en.id||en.name);

exit when c1%notfound;

end  loop;
close c1;

end;



 (4)cursor  with %type example:
declare
en        mytest.id%type;
ename    mytest.name%type;

cursor c1   is  select   id,name   from  mytest  where id=1;
begin
open c1;
loop
fetch c1 into en,ename;

dbms_output.put_line(en||ename);

exit when c1%notfound;

end  loop;
close  c1;

end;


 (5) parameterized      Cursor :
declare
myno number;
cursor c1(en number)  is  select   *   from mytest where id=myno;
res  c1%rowtype;
begin
myno:=&en;
open c1(myno);

loop
fetch c1  into res;

dbms_output.put_line(res.id||res.name);

exit  when    c1%notfound;

end  loop;
close  c1;

end;








Tuesday 15 September 2015

Google-Keyword-Planner for selecting keywords for your website?

Step 1:

https://adwords.google.co.in/KeywordPlanner
·          
·          

step 2:

make  sign in using  gmail  id & password.

Then go  to   TOOLS    MENU   &   UNDER  DROP  DOWN   keyword planner.


Step 3:

Click   “on   search for new keywords  using phrase, website ,or category  under section”   

FIND NEW KEYWORDS .


Step 4:
Enter one or more of the following:
(1)Your product or service
(2) Your landing page
(3) Your product category
(4)select your Targeting Locations for example india or all locations.



Step 5:

Then click on  “get idea”

Note for example you enter your service as “computer education” then you will get suggestion


Then  click on download button to download suggestion for keywords.

Wednesday 9 September 2015

Windows Phone 8 Platform Guide using Cordova cross-platform Technology

This guide shows how to set up your SDK development environment to deploy Cordova apps for Windows Phone devices. It focuses on Windows Phone 8, but provides additional details on how to support Windows Phone 7.
It shows how to use either Windows Phone-specific shell tools to generate and build apps, or the cross-platform Cordova CLI discussed in The Command-Line Interface. (See the Overview for a comparison of these development  WORKFLOWS.) This section also shows how to open Cordova apps so that you can modify them within Visual Studio. Regardless of which approach you take, you need to install the Windows Phone SDK, as described below.
See the following for details specific to the Windows Phone platform:
·         Windows Phone 8 Plugins
·         Upgrading Windows Phone 8
For the Windows Phone 8 platform, the Cordova WebView relies on Internet Explorer 10 as its rendering engine, so as a practical matter you can use IE10's powerful debugger to test any web content that doesn't invoke Cordova APIs. The Windows Phone Developer Blog provides helpful guidance on how to support IE10 along with comparable WebKit browsers.
You need the following:
·         A 64-bit version of Windows 8 Pro, either an installation disk or an ISO disk image file. An evaluation version is available on the Microsoft Developer Network. The Pro version is necessary to run the device emulator.
·         The Windows Phone SDK.
·         In order to deploy via the command-line with the Windows Phone 8.0 SDK, the latest Visual Studio 2012 Update must be installed.
To develop Cordova apps for Windows Phone devices, you may use a PC running Windows, but you may also develop on a Mac, either by running a virtual machine environment or by using Boot Camp to dual-boot a Windows partition. Consult these resources to set up the required Windows development environment on a Mac:
·         VMWare Fusion: To set up the Windows 8 virtual machine, follow the instructions provided by the Microsoft Developer Network, then see Configuring VMWare Fusion for information on preparing the virtual environment to run the emulator bundled with the SDK.
·         Parallels Desktop: To set up the Windows 8 virtual machine, follow the instructions provided by the Microsoft Developer Network, then see Configuring Parallels Desktop for information on preparing the virtual environment to run the emulator bundled with the SDK.
·         Boot Camp: To set up the Windows 8 partition, follow the installation instructions provided by the Microsoft Developer Network.
If you are developing on a PC, its processor must support virtualization (VT-x on Intel) and Second Level Address Translation (SLAT). Consult Intel's list of supporting processors. Virtualization is typically disabled by default, so you need to enable it in your BIOS settings. The PC should have at least 6.5GB of free hard disk space, and 4GB of RAM.
If you want to use Cordova's Windows Phone-centered shell tools in conjunction with the SDK, you have two basic options:
·         Access them locally from project code generated by the CLI. They are available in the platforms/wp8/cordovadirectory after you add the wp8 platform as described below.
·         Download them from a separate distribution at cordova.apache.org. The Cordova distribution contains separate archives for each platform. Be sure to expand the appropriate archive, cordova-wp8\wp8 in this case, within an empty directory. The relevant batch utilities are available in the top-level bin directory. (Consult the README file if necessary for more detailed directions.)
These shell tools allow you to create, build, and run Windows Phone apps. For information on the additional command-line interface that enables plugin features across all platforms, see Using Plugman to Manage Plugins. See Application Plugins for guidance on how to develop plugins, and Windows Phone 8 Plugins for details specific to the Windows Phone platform.
Install the SDK
Install the latest version of the Windows Phone SDK from the Downloads area of dev.windowsphone.com. You may also install more recent emulator update packages.
At this point, to create a new project you can choose between the cross-platform CLI tool described in The Command-Line Interface, or the set of Windows Phone-specific shell tools. From within a source-code directory, here's the CLI approach:
    > cordova create hello com.example.hello HelloWorld
    > cd hello
    > cordova platform add wp8
Here's the corresponding lower-level shell-tool approach:
    C:\path\to\cordova-wp8\bin\create.bat C:\path\to\new\hello com.example.hello HelloWorld
If you are using the CLI in development, the project directory's top-level www directory contains the source files. Run either of these within the project directory to rebuild the app:
    > cordova build
    > cordova build wp8   # do not rebuild other platforms
If you are using the Windows Phone-specific shell tools in development, there is a different approach. Once you generate the project, the default app's source is available in the projects\wp8\www subdirectory. Subsequent commands are available in thecordova subdirectory at the same level.
The build command cleans project files and rebuilds the app. The first example generates debugging information, and the second signs the apps for release:
    C:\path\to\project\cordova\build.bat --debug        
    C:\path\to\project\cordova\build.bat --release
The clean command helps flush out directories in preparation for the next build:
    C:\path\to\project\cordova\clean.bat
At this point you can use the cordova CLI utility to deploy the application to the emulator from the command line:
    > cordova emulate wp8
Otherwise use the alternate shell interface:
    C:\path\to\project\cordova\run
By default, the run script invokes the emulator flag, and accepts additional build flags, for which --debug provides the default:
    C:\path\to\project\cordova\run --emulator --debug
    C:\path\to\project\cordova\run --emulator --release
    C:\path\to\project\cordova\run --emulator --nobuild

Friday 28 August 2015

Signing a First Version Apk using Cordova using Command Line:



1. Update the AndroidManifest. Open /myApp/platforms/android/AndroidManifest.xml and update. VersionCode is what will display in the store; versionName is for your internal use and won’t be shown: android:versionCode=”10000″ android:versionName=”1.0.0″ (Note on format: “10000” = 1.00.00.)

Make sure the following is accurate (change com.developerName.myApp to your own information here and throughout this page):

package="com.developerName.myApp"
Make sure the following is 11 or higher (I choose 19.):

android:minSdkVersion="11"
Open /myApp/config.xml and make sure the widget id and version are the same as in AndroidManifest.xml.

2. The following steps create your private key and the keystore file in which to store it. In Terminal, make sure your starting position is within your app’s root folder of /myApp and run the following. (To start commands from your app root folder in Terminal, open the Terminal app, type cd and a space, drag the /myApp folder to Terminal, tap in Terminal to activate its window, then hit Enter.)

keytool -genkey -v -keystore myapp.keystore -alias myapp -keyalg RSA -keysize 2048 -validity 10000
You’ll be prompted to answer several questions. Use only legal characters like letters and numbers, not punctuation. For 2-letter country code, look up this list: http://www.worldatlas.com/aatlas/ctycodes.htm

3. You will then review the data presented. At that point, if any of the information is wrong, type the two letters to re-enter that information. For instance, type cn to change your first and last name. Otherwise, confirm the information by typing “yes.” Then just hit Enter if the password for the following Terminal information will be the same as the previous.

Your keystore file will be located at /myApp/myapp.keystore. This needs to be copied to a safe place ASAP. Your customers will not be able to update to the next version without this file.

4. Copy myapp.keystore to /platforms/android.

Now it’s time to sign the app with the key and create the release version.

5. Open /platforms/android/local.properties (or project.properties) in a text editor.

6. Add these two lines at the end and save, even though it says, “Do not modify this file — YOUR CHANGES WILL BE ERASED!”

key.store=myapp.keystore
key.alias=myapp


7. Still in your /myApp folder in Terminal, run:

cordova build android --release
You’ll be asked for your password twice and it won’t be obfuscated.

8. Your myApp.apk file is put in /myApp/platforms/android/ant-build/CordovaApp-release.apk. (If not there, it may be in /myApp/platforms/android/build/outputs/apk.) This is the file you rename and upload to Google Play.

Signing an Update Version Apk Without Eclipse

This section assumes you’ve already created your keytool and keystore file from your first version, and have the keystore file in a safe place. You won’t follow those steps again.

1.Open /myApp/config.xml and update. Increment the version number.

2. In Terminal, make sure your starting position is within your app’s root folder of /myApp and run the following. (To start commands from your app root folder in Terminal, open the Terminal app, type cd and a space, drag the /myApp folder to Terminal, tap in Terminal to activate its window, then hit Enter.)

3. From your app’s root folder in Terminal:

cordova build android --release


SEE BELOW EXAMPLE :

C:\vissicomp>keytool -genkey -v -keystore myapp.keystore -alias myapp -keyalg RS
A -keysize 2048 -validity 10000
Enter keystore password:  123456
What is your first and last name?
  [Unknown]:  om maurya
What is the name of your organizational unit?
  [Unknown]:  vissicomp
What is the name of your organization?
  [Unknown]:  vissicomp pvt ltd
What is the name of your City or Locality?
  [Unknown]:  andheri
What is the name of your State or Province?
  [Unknown]:  maharashtra
What is the two-letter country code for this unit?
  [Unknown]:  91
Is <CN=om maurya, OU=vissicomp, O=vissicomp pvt ltd, L=andheri, ST=maharashtra,
C=91> correct?
  [no]:  yes

Generating 2048 bit RSA key pair and self-signed certificate (MD5WithRSA)
        for: CN=om maurya, OU=vissicomp, O=vissicomp pvt ltd, L=andheri, ST=maha
rashtra, C=91
Enter key password for <myapp>
        (RETURN if same as keystore password):  123456
[Saving myapp.keystore]

C:\vissicomp>