Posts

Event Delivery System

 Event delivery system is a project based on web book, which sends post request automatically to the required destination from the source along with particular slack and analytics, and with other API I am starting this project and eventually add complexity like scaling and planning to add eight types of production level problem solutions to this project, including system design Mission 1  Starting a spring application  Start a spring application with spring initialiser, then open output route and go to the '/' problem 1 You will notice 404 not found error that doesn't mean that your database contains data of that particular route. reasoning  It means that the spring boot doesn't even know how to handle that route so to handle that you need an handler and depending upon the type of request, you need to use, get mapping or post mapping so on Mission 2 Routing  It's like that you are teaching the spring boot to what to do when particular request comes like example:...

Java

  //candy problem import java . util . Arrays ; import java . util . Scanner ; public class Main {   public static void main ( String [] args ) {     System . out . println ( "Hello World" );     @ SuppressWarnings ( "resource" )     Scanner input = new Scanner ( System . in );         int n = input. nextInt ();     int [] arr = new int [n];     boolean [] ansarr = new boolean [n];     ansarr[ 0 ] = true ;       for ( int i = 0 ; i < n; i ++ ) {         arr[i] = input. nextInt ();         arr[i] = arr[i] + 3 ;       }           for ( int i = 1 ; i < ansarr. length ; i ++ ) {         if (arr[i] > arr[i - 1 ]) {           ansarr[i] = true ;         }         else {      ...

Node js

  const file = require ( 'fs' ); const result = file . writeFileSync ( "hello.txt" , "Hello my name is aditya" ); console . log ( result ); //hello.js console . log ( "hello" ); const math = require ( "./math" ); //console.log(math.add(3,5)); const value = math. add ( 3 , 5 ); console . log ( value ); //maths export function add ( a , b ){   return a + b ; } function sub ( a , b ){   return a - b ; } //we have to export functions to use them in other files because we run the server with only one file module . exports = { add , sub }; //server.js const http = require ( "http" ); const fs = require ( 'fs' ); const myserver = http . createServer (( req , res ) => { const log = ` ${ Date . now ()} : ${ req . url } :The request recieved \n ` ; fs . appendFile ( 'serverlog.txt' , log , ( req , res ) => { })   // console.log("request recieved");   switch ( req .url){   ...

objects in python

# Online Python compiler (interpreter) to run Python online. class Dog: # Class attribute species = "Canis familiaris" # Constructor method def __init__(self, name1, age): self.name= name1#jo pass karoge vo variable me jayega and variable ka name kuch bhi ho sakta hai bcz we access that with the help of variable name and due to self means it denotes objects same variable name is used for multiple objects bcz we refer variable by object likke self.name here self is object name it is referring to that object # Instance attribute self.age= age # Instance attribute # Instance method def bark(self): print(f"{self.name} barks!") # Instance method def get_info(self): return f"{self.name} is a {self.species} and is {self.age} years old." d1 = Dog("hi",20) info=d1.get_info() print(info)

React

import React from 'react' function changeuser() { let user ='Aditya'; console.log(user); function changename(){ user ="Aditya badiger"; console.log(user); } return ( The username is {user} change user ) } export default changeuser this code is not working because we store variables in a new way in react import React, { useState } from 'react' function App() { const [a, setA] = useState(1) return ( hello the number is {a} setA(a + 10)}>Incremenet setA(a-10)}>Decrement ) } export default App this code refers to creating variables

Apology

Apology Please Apologize me First click button 1 and then 2 You can only proceed when you click button 1 Apologize Your Favorite Junior Apology Message

Jarvis my first python project

import pyttsx3 import datetime import speech_recognition as sr engine = pyttsx3.init( 'sapi5' ) voices = engine.getProperty( 'voices' ) print (voices) engine.setProperty( 'voice' , voices[ 0 ].id) def speak (audio):     engine.say(audio)     engine.runAndWait() def wishMe ():       hour = int (datetime.datetime.now().hour)     if hour >= 0 and hour < 12 :         speak( "Good morning" )     elif hour > 12 and hour < 18 :         speak( "Good afternoon" )         speak( "I am jarvis how can i help you sir" )             else :         speak( "Good evening" )         speak( "I am jarvis how can I help you sir" )     def takeCommand ():     r = sr.Recognizer()     with sr.Microphone as source:         print ( "Listening..." ) if...