Posts

Typescript configuration file

Even if your program contains error typescript converted ts file to java script. we don't want this behavior if there is any error in typescript don't want its JavaScript file  for that we need typescript configuration file tsc --init open config file and uncomment "noEmit": true,    or you can use below command tsc --noEmitOnError   test.ts

TypeScript-2 : First Example

 extension of type script  file is .ts example abc.ts xyz.ts pqr.ts test.ts let x = 10 log.console(x) command to run file :  tsc test.ts after execution created new file - test.js run :-                               node test.js file is not compile its trans file : one human level language to other human level language

TypeScript- 1: Installation

                                                       how to install typescript: to install typescript first install node in your computer and then below command. npm install -g typescript -g stand for global. Here have install typescript globally , it means I can access anywhere in my computer. Check typescript properly installed or not tsc --v                                                                    Steps to install node JS : type "node js " in google  click on first link you will redirected to https://nodejs.org/en download node js and install in your computer  check node properly installed or not by using "node -v"  command

AWS- Simple Notification Service: AWS SNS Service

                         Comming soon

Angular 14

You should know 3rd party dependency for angular.  Bootstrap Toaster Awesome-Fonts (Images ) Sweetalert2 1.    npmjs.com  You can go to website and search anything for library you get the result with npm command.  Example : bootstrap                 font-awesome for toaster or animation                     npm install ngx-toastr                npm install @angular/animations need to import BrowseAnimationModules from@platfomr/broser/animation in module.ts import { NgModule } from '@angular/core' ; import { BrowserModule } from '@angular/platform-browser' ; import { AppRoutingModule } from './app-routing.module' ; import { AppComponent } from './app.component' ; import { BrowserAnimationsModule } from '@angular/platform-browser/animations' import { ToastrModule } from 'ngx-toastr' ; @ NgModule ({   ...

Running two docker container on same Network# Spring boot microservices # Docker # Docker Images #Docker Container

#consumer class TestController{ @Getmapping("data") public String getData(){ RestTemplate  t=new RestTemplate(); t.getforObject( "http://consumer:8080/getdata",String.class); } } FROM openjdk:8 EXPOSE 8080 ADD target/producer.jar producer.jar ENTRYPOINT ["java","-jar", "producer.jar"] #producer class TestController { @Getmapping("getdata") public String getData(){ return "This reponse comming from producer" } } FROM openjdk:8 EXPOSE 7000 ADD target/consumer.jar consumer.jar ENTRYPOINT ["java","-jar", "consumer.jar"] first craete network :   docker   create --network driver=bridge mynetwork (need correction from book) docker build -f  Dockerfile -t consumer (any name its just a tag name) . docker run -p 81:8080 --name=producer --network=mynetwork producer docker build -f  Dockerfile -t producer (any name its just a tag name) . docker run -p 82:7000 --name=consumer --network=mynetwork cons...

What is staters ? How they Work ?

Spring boot provides the number of starters that allows us to add jars in classpath. Spring boot build in startes allowes us  develpoemrnt easier and rapid. Spring boot startes are the dependacy discriptor. In spring boot all the startes  follow same naming pattern spring-boot-starter-* Spring boot startes is combine a group of  common or related dependancies into single dependancy. Example :  Supoose if we want to create spring web application  with tomcat web server then we need to add following minimumn depednacies spring core jar, spring web,spring mvc, spring transaction jar  OK So Spring starter componenets combine  all the related jars into the single jar  file depenandcy to our build file  so insted of adding 4 jars we need to add only one jar in our project example spring -boot-startr-web By adding this spring boot automaticlly download all the related dependacies in our classpath

WebConfig Centralized Configuration In Microservices

 POM.xml  :     WebConfig Server :  -------------------------------------------------------------------------------------------------------------- <properties> <java.version>1.8</java.version> <spring-cloud.version>2020.0.3</spring-cloud.version> </properties> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-config-server</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools...

Auto Push Spring Boot App Image on Docker Hub Repository# 9561826040

 In this we will see how to create image and push on docker hub automatically.  I create simple Hello_World_Docker spring boot application and created one controller in it. package com.example.demo; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @RestController public class WelcomeController { @RequestMapping("/wish") public String Wish() { return "HELLO GVOIND MANTRI"; } } command :  package dockerfile:build command :  package dockerfile:push command :  clean install ========================================================================================================================================= Pom.xml plugin <plugin> <groupId>com.spotify</groupId> <artifactId>dockerfile-maven-plugin</artifactId> <version>1.4.13</version> <executions> <execution> <id>default</id> <goals> ...

Django Full Stack Developement - 2: Project Setting

After successful Django installation Create Project :     ⧫ django-admin startproject projectname Example : django-admin startproject FirstProject ⧫ Check created File  Example: ls ⧫  If you want to display  Tree Format structure tree -f ⧫ Start Server Example : python manage.py runserver ⧫ Default Server Started On 8080 Port Number , if you want to change port number (Not recommended) Example : python manage.py runserver 8888 ⧫ Django provide inbuilt Server and database ⧫ Create Application in Project Now         python manage.py startapp TestApp

AJAX JSP

<%@ page import="java.sql.*" %> <% String email = request.getParameter("email").toString(); System.out.println(email); String data =""; try{ Class.forName("com.mysql.jdbc.Driver"); Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/test1", "root", "root"); Statement st=con.createStatement(); ResultSet rs=st.executeQuery("select * from login where email='"+email+"'"); int count=0; while(rs.next()) { count++; } if(count>0) { data="<img src='favicon.png' width='20px' height='20px'>Email-ID already exists!"; } else { data="You can register now!!!!"; } out.println(data); System.out.println(data); } catch (Exception e) { System.out.println(e); } %> <html> <head> <script type="text/javascript"> function check(value){ xmlHttp=GetXmlHttpObject() var url="index.jsp"...

Django Full Stack Developement - 1: Atom Installtion

  Atom IDE Installation In Linux :  Atom is more Powerful IDE for Web Designing    -   sudo add-apt-repository ppa:webupd8team/atom -   sudo apt-get update -   sudo apt-get install atom

Mysql Primary Foreign for Beginners

Here I am goving to create two tables first will be parent and second will be child table. Table are Student and Marks In student table we make rollno as primary key which is act as a foreign in Marks table. ------------------------------------------------------------------------------------------------------------------- sql>> create table student (roll int primary key,name text) sql>> create table marks(sub1 int,sub2 int, sub3 int ,roll int, foreign key(roll) references student (roll)); ------------------------------------------------------------------------------------------------------------------- sql>show tables; student marks here we can created two table succesfully with paarent child relatoinship. --------------------------------------------------------------------------------------------------------------------- Insert data ----------------- If i try to insert data in child table (example Marks table) without adding data in Parent t...

Machine Learning Numpy

1. how to create array using numpy : import numpy as np #ad array a=np.array([10,20,30]) // int,float ,String  // array should be homoginous #2 d array 3*3 b=np.array([ [1,2,12], [12,12,12], [12,34,5] ]) #3*3*3 c=np.array([ [[1,2,3],[4,5,6],[7,8,9]], [[4,5,6],[8,6,7],[5,6,7]], [[8,8,8],[9,9,9],[9,98,8]] ]) print(a) print(b) print(c) #Arrange Function : a = np.arange(10,20) //start value and end value print(a) [10........................19] a=np.arnage(10,20,2)

Exception Handaling In Spring

-------------------------------------------------------------------------------------------------------------------------- -  When The User Request for the web page then user get webpage as a Response. - Example    @Controller public class CommonController {     @RequestMapping("/")     public String homePage() {         return "home";     } ------------------------------------------------------------------------------------------------------------------------------- - Due to some developer mistake or some other reason if while processing the request if  the method throws some exception say Null Pointer , Resourcefulness or Any Other what user get in that case is ". HTTP Status 500 -   Brief description of the error which occurred on server. and related stack trace information.  - Example   @Controller public class CommonController...

SpringBoot CRUD Operation

 import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; @SpringBootApplication public class SpringBootJpaApplication {       public static void main(String[] args) {         SpringApplication.run(SpringBootJpaApplication.class, args);     }        } ---------------------------------------------------------------------------------------------------------------------- import javax.persistence.Column; import javax.persistence.Entity;  import javax.persistence.Id;  import javax.persistence.Table; @Entity  @Table(name="new1") public class UserRecord {      @Id      private int id;     @Column     private String name;     @Colu...

@Component Scan Annotation Spring

 Auto Binding Object ================================== <?xml version='1.0' encoding='UTF-8' ?> <beans xmlns="http://www.springframework.org/schema/beans"     xmlns:context="http://www.springframework.org/schema/context"     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"     xmlns:mvc="http://www.springframework.org/schema/mvc"     xsi:schemaLocation="         http://www.springframework.org/schema/beans             http://www.springframework.org/schema/beans/spring-beans.xsd         http://www.springframework.org/schema/context         http://www.springframework.org/schema/context/spring-context.xsd ">     <context:component-scan base-package="com.hello"/>     <context:component-scan base-package="com.mod...

Liner Regression Solved Example for ML

Image
Formula : Y=aX+b So first we calculate a and b a=n* summation(xy)-summation(x)*summation(y) / n* summation(x*x)- summation(x*x) b=1/n * (summation(y)- a * summation(x))

Naive Bayes Algorithm For Machine Learning..working

Image
                        

Mysql Hosting Comming Soon

https://www.freemysqlhosting.net