Skip to main content

Posts

Showing posts from January, 2020

How we create first program in Java

---How we create the first program in Java --- 1)  First, we check that Java is installed in machine or not      go into c:/program files/Java/JDK/bin                   c:/program files/Java/JRE/ 2)  If this folder does not present then download Java software and install it 3)  Check Java environment path, open command prompt then type javac if javac is not recognized as an internal or external command, operable program then java path is not set 4)  if path is not set then set path using following step    4.1)   Right click on this PC ---> Properties ----> Advance System Setting ----> Environment Variable ---> new --->  Variable Name:-    path Variable Value:-    C:\Program Files\Java\jdk1.8.0_121\bin Click Ok ---> Ok --> Ok restart command prompt open command prompt type javac if javac description will be shown then P...

ATM Program in Python

Create ATM Program with all operation when user will enter correct pin code then it will process proceed  to next screen with following menu option 1.   Press C for Credit 2.   Press D for Debit 3.   Press B for Check Balance  4:-  Press R for Repeat 5:-  Press E for exit If Pin code will be incorrect then three attempt should be provide to user's to enter right pin code otherwise exit from System. User can perform only three operation with one login session ,display complete log details after exit from System. pin='1111' flag=False amt=5000 count=0 for i in range(1,4):  pin = input("enter pin code")  if pin=='1111':      flag=True      break if flag:     while(True):         if count>3:             exit(0)         operation = input("""                 press c f...

While-else and for-else in Python

While-else and for-else in Python:- It will work when the condition of the loop and for loop will be false, suppose that we want to calculate result or we want to execute any other operation then we can use while--else and for--else. Syntax of While---else Loop:- init while condition:     statement     increment else:    statement Example:- i=2 while i<2:     print(i) else:     print('condition fail') Syntax of for--else:- for i in range(start,end):     Statement else:    Statement Example of for--else sum=0 for i in range(1,10):     print(i)     sum=sum+i else:     print('Total is '+str(sum))

Web Services Implementation in Angular Framework using Insert,Update,Delete,Select Operation

TypeScript Code for CRUD Operation:- import { Component, OnInit } from '@angular/core'; import { HttpClient,HttpHeaders } from '@angular/common/http'; const httpOptions = {   headers: new HttpHeaders({     'Content-Type':  'application/json'   }) }; @Component({   selector: 'app-registration',   templateUrl: './registration.component.html',   styleUrls: ['./registration.component.css'] }) export class RegistrationComponent implements OnInit {   tid   data:string='';   truckno:string='';   tdesc:string='';   public truckdata = [];   constructor(private http: HttpClient) { }   ngOnInit() {     truckdata= this.http.get("http://shivaconceptsolution.com/webservices/showtruck.php").subscribe((data) => {          this.truckdata = Array.from(Object.keys(data), k=>data[k]);         });;   }   Truck () {    let...

Java Unique Interview Question

  Java Unique Interview Question:- Q) WAP to print data without using System.out.printlln()?  import java.io.*; class Addition {    public static void main(String args[]) throws IOException    {      FileOutputStream fo= new FileOutputStream(FileDescriptor.out)      OutputStreamWriter o= new OutputStreamWriter(fo, "ASCII")      BufferedWriter out = new BufferedWriter(o, 512);      out.write("test string");      out.write('\n');      out.flush();    }  } Q)  WAP to calculate addition without using + operator? class Addition {    public static void main(String args[]) throws IOException    {      int a=100,b=20;      while(b>0)      {          a++;          b--;      }      Syste...

Web Service Implementation in Angular Framework for Add,Edit and Delete Record

1.1) First BackEnd Developer Create Web Services using PHP,.NET, JAVA , PYTHON, RUBY or CI.       BackEnd Developers will provide Web URL, Input Parameters and Output Parameter and Method (GET, POST) for example  http://shivaconceptsolution.com/webservices/tr.php Input Parameters:-  tno,tdet Post Method You can use postman or other web services checking tools for postman open chrome and write chrome://apps in url , download plugin, and check URL after successful login. 1.2 create component then create a path 1.3 write the following code to call web service under component typescript import { Component, OnInit } from '@angular/core'; import { HttpClient,HttpHeaders } from '@angular/common/http'; const httpOptions = {   headers: new HttpHeaders({     'Content-Type':  'application/json'   }) }; @Component({   selector: 'app-truck',   templateUrl: './truck.component.html',   styleUrls: ['....

Angular Interview Question

Angular Interview Question:-  1) How we can navigate from one component to another using a router link, button link? 2) what is forRoot and forChild() in Angular Framework? 3) What is Data Binding? How many ways it can be done? 4) what is observable, subscribe, and promise in Angular? 5) What is ngOnInit()? How to define it? 6)What is string interpolation in Angular? 7) What Is Dependency Injection (DI)? 8) What Is runGuardsAndResolvers function? 9). What is bazel in angular 8? 10) What is typeofchecks in Angular 8?                                   

TableLayout in Android

TableLayout in Android:- Using this we can create Table Layout in android application using TableRow. <TableLayout> <TableRow> </TableRow> <TableRow> </TableRow> <TableRow> </TableRow> </TableLayout> Design File:- <? xml version ="1.0" encoding ="utf-8" ?> < TableLayout xmlns: android ="http://schemas.android.com/apk/res/android" xmlns: app ="http://schemas.android.com/apk/res-auto" xmlns: tools ="http://schemas.android.com/tools" android :layout_width ="match_parent" android :layout_height ="match_parent" tools :context =".Main2Activity" > < TableRow > < Button android :layout_width ="wrap_content" android :layout_height ="wrap_content" android :text ="Click" > </ Button > < Button android :...

HttpService in Angular Framework

HttpService in Angular Framework:- It is used to handle HttpRequest from external resources and fetch, post, update and delete from external resources .we will create web API or web services to get data from a remote server, web services, and web API will be consumed by HttpService in Angular Framework. Web Services will be created by Server side script such as Java, PHP,.NET, PYTHON, Ruby, etc, and Consumed by Angular HTTP Service. in  Angular  (currently on  Angular -17) . subscribe () is a method on the Observable type. The Observable type is a utility that asynchronously or synchronously streams data to a variety of components or services that have  subscribed  to the observable. Step to implement Services:- 1)  go into app.module.ts file and register httpService provider import { provideHttpClient } from '@angular/common/http' ; providers : [     provideClientHydration (),     provideHttpClient ()   ] 2)  cre...

Create Three Page Application using JSP

1) Create style.css  to provide propeties to HTML Tag * {     margin:0px; } header {     height:100px;     background-color: gray; } section {    height:500px;     background-color: orange; } footer {      height:100px;     background-color: gray; } 2)  Create header.jsp and link css file <%@page contentType="text/html" pageEncoding="UTF-8"%> <!DOCTYPE html> <html>     <head>         <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">         <title>JSP Page</title>         <link href="style.css" rel="stylesheet" type="text/css" />     </head>     <body>         <header>             <nav>                 <u...

File Uploading Code using Node and Express Js

File Uploading Code using Node and Express Js Step1st:-   Create Front End  File using HTML or ,ANGULAR, Step2nd:- <html>    <head>       <title>File Uploading Form</title>    </head>    <body>       <h3>File Upload:</h3>       Select a file to upload: <br />             <form action = "http://localhost:3000/uploadfile" method = "POST"          enctype = "multipart/form-data">          <input type="file" name="myFile" size="50" />          <br />          <input type = "submit" value = "Upload File" />       </form>          </body> </html> Step 3rd:- const express = require('express') const bodyParser= requi...

JSP Introduction

JSP Introduction,What is JSP,JSP Defination:- JSP means Java server page, JSP provides static web content and dynamic web content both. using static web content we can design web pages and dynamic web content we can write java programs. but servlet only contains the dynamic web content. JSP page by default managed by Web Container internally.  It provides HTML view by default but Servlet has Class View By Default. In Standard Web programming we will use servlet for business code or program logic and JSP for design interface. ................................................................................................................................................................... Step to Add JSP in Netbeans IDE Tools: Create a new Java Web Project ----> Right click on Web Pages and Add JSP Page ,it will provide HTML5 View. Step to Add JSP in Eclipse IDE Tools: Create new Java Web Project ----> Right click on WebContent and Add JSP Page ,it wil...

How we take form input in servlet

How we take form input in servlet  :- We can write HTML Element under Servlet tag using double quote and single quote. public class SwapServlet extends HttpServlet {    public void doGet(HttpServletRequest request,HttpServletResponse response) throws IOException    {        response.setContentType("text/html");                     PrintWriter out = response.getWriter();        out.write("<form action='#' method='get'>");        out.write("<input type='text' name='txtnum1' placeholder='enter first number' /><br><br>");        out.write("<input type='text' name='txtnum2' placeholder='enter second number' /><br><br>");        out.write("<input type='submit' name='btnsubmit...