Skip to main content

Posts

Showing posts from 2015

Bean Array

A Bean array is defined to be an array where for every value n in the array, there is  also an element n-1 or n+1 in the array.   For example, {2, 10, 9, 3} is a Bean array because  2 = 3-1  10 = 9+1  3 = 2 + 1  9 = 10 -1   Other Bean arrays include {2, 2, 3, 3, 3}, {1, 1, 1, 2, 1, 1} and {0, -1, 1}.   The array {3, 4, 5, 7} is not a Bean array because of the value 7 which requires that the  array contains either the value 6 (7-1) or 8 (7+1) but neither of these values are in the  array. Write a function named isBean that returns 1 if its array argument is a Bean array.  Otherwise it returns a 0.  */ package dev; /**  *  * @author Tej Bist  */ public class BeanArray {     public static void main(String arg[]) {         System.out.println(new BeanArray().isBean(new int[]{3, 4, 5, 7}));     }     private int isBean(int[] nu) {         for (int i = 0; i < nu.length; i++) {             int count = 0;             for (int j = 0; j < nu.length; j++) {    

What is E-Commerce

What do you mean by e-commerce? ‘Electronic Commerce is sharing business information, maintaining business relationships and conducting business transactions by means of telecommunications networks’. There are several ways of looking at e-commerce: 1. From a communication perspective: It is the ability to deliver products, services, information or payments via networks like the internet 2. From an interface view: E-commerce means information and transaction exchange: business to business (B2B), business to consumer (B2C), consumer to consumer (C2C) and business to government (B2G). 3. From online perspective: Ecommerce is an electronic environment that allows sellers to buy and sell products, services and information on the internet. The products may be physical like cars or services like news or consulting. 4. As a structure: e-commerce deals with various media: text, data, web pages, Internet telephony and internet desktop video. 5. As a market: e-commerce is a worldwide netw

Simple Mail Transfer Protocol (SMTP)

                                           Simple MailTransfer Protocol (SMTP) SMTP is a simple ASCII protocol for transferring mail between hosts in the TCP/IP suite. After establishing the TCP connection to port 25 , the sending machine, operating as the client, waits for the receiving machine, operating as the server, to talk first. The server starts by sending a line of text giving its identity and telling whether it is prepared to receive mail. If it is not, the client releases the connection and tries again later. If the server is willing to accept email, the client announces whom the email is coming from and whom it is going to. If such a recipient exists at the destination, the server gives the client the go-ahead to send the message. Then the client sends the message and the server acknowledges it. No checksums are needed because TCP provides a reliable byte stream. If there is more email, that is now sent. When all the email has been exchanged in both directions, the con

Nepal Earthquake Safe Check

// Nepal Earthquake Safe Check  package javaapp; /** * * @author Tej Bist */ public class JavaApp { public void Safe(String positive) { if (positive.equals("Safe")) { System.out.println("You are Safe !!"); } else { System.out.println("You are UnSafe !!"); } } public static void main(String[] args) { new JavaApp().Safe("Safe"); } }
PL/SQL  ( Procedural Language/Structured Query Language ) is  Oracle Corporation 's  procedural   language  extension for  SQL  and the  Oracle relational database . PL/SQL is available in Oracle Database   TimesTen in-memory database  and  IBM DB2 . Oracle Corporation usually extends PL/SQL functionality with each successive release of the Oracle Database. PL/SQL includes procedural language elements such as  conditions  and  loops . It allows declaration of constants and  variables , procedures and functions, types and variables of those types, and triggers. It can handle  exceptions  (runtime errors).  Arrays  are supported involving the use of PL/SQL collections. Implementations from version 8 of Oracle Database onwards have included features associated with  object-orientation . One can create PL/SQL units such as procedures, functions, packages, types, and triggers, which are stored in the database for reuse by applications that use any of the Oracle Database programmati