Skip to main content

Posts

DataScience Sample Program to Match Record based on Date using Excel file

Step 1st:-  Create Excel file using following cell FirstName DOB Manish 4/12/2019 kapil 4/13/2019 kamal 4/15/2019 Jay 4/15/2019 ravi 1/30/2020 chk 2/1/2020 Step2nd:-  Write following code to match data from excel file:- import xlrd  import numpy as np from datetime import date today = date.today() loc = ("Book1.xlsx")  wb = xlrd.open_workbook(loc)  sheet = wb.sheet_by_index(0) current = today.strftime("%Y-%m-%d") print(np.datetime64(current)) #current = '2020-1-30' arr = np.array([int]*6) index=0 y, m, d, h, i, s = xlrd.xldate_as_tuple(sheet.cell_value(1, 1), wb.datemode) #print("{0}-{1}-{2}".format(y, m, d)) for i in range(1,sheet.nrows):     y, m, d, h, i, s = xlrd.xldate_as_tuple(sheet.cell_value(i, 1), wb.datemode)          arr[index]="{0}-{1}-{2}".format(y, '0'+str(m) if m<10 else m, '0'+str(d) if d...

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: ['....