Skip to main content

Posts

Showing posts with the label programming

How to embed google form in your website ?

 How to embed Google form in your website ? Google Forms is a survey administration software included as part of the free, web-based Google Docs Editors suite offered by Google. The service also includes Google Docs, Google Sheets, Google Slides, Google Drawings, Google Sites, and Google Keep. Google Forms is only available as a web application. With Google Forms,  you can create and analyze surveys right in your mobile or web browser —no special software required. You get instant results as they come in. And, you can summarize survey results at a glance with charts and graphs. The benefit of using google form on your website - If your website is a static website and you don't want any server cost for your website you can use google form it will save your money and it is easy to implement as well. How to embed Google form in your website step by step- Go to Forms and open your form. Click Send. Next to Send via, click Embed  . Click the HTML and click Copy. Paste the HTML into your

What are promises in JavaScript ?

 What are promises in JavaScript ? Promises  are used to handle asynchronous operations in JavaScript. They are easy to manage when dealing with multiple asynchronous operations where callbacks can create callback hell leading to unmanageable code.  A  Promise  is a proxy for a value not necessarily known when the promise is created. It allows you to associate handlers with an asynchronous action's eventual success value or failure reason. This lets asynchronous methods return values like synchronous methods: instead of immediately returning the final value, the asynchronous method returns a  promise  to supply the value at some point in the future. A  Promise  is in one of these states: pending : initial state, neither fulfilled nor rejected. fulfilled : meaning that the operation was completed successfully. rejected : meaning that the operation failed.  Why do we need Promises? JavaScript is a single-threaded language  because while running code on a single thread, it can be real

How to create rotating Image animation in css ? How to create 360 degree rotating Image animation in css ?

 How to create rotating Image animation in CSS ? How to create 360-degree rotating Image animation in CSS ? What are CSS Animations? An animation lets an element gradually change from one style to another. You can change as many CSS properties you want, as many times as you want. To use CSS animation, you must first specify some keyframes for the animation. Keyframes hold what styles the element will have at certain times. Solution- We will add the CSS command to the element we wish to rotate in this example. You can adjust the  2s  to slow or speed up the rotation duration and rotate to 360 degrees in animation.

Logback can't write in console ? logback.xml solution.

Problem :  I am using Logback in my spring boot application.  The problem is logback do not print my logger messages in 'eclipse' console ? Solution ;- just reread the logback config doku. Actually, those two should inherit both appenders from root. So, what you can try is to not specify any appender-ref on those and see what happens. If no output is written to the file then, neither - then there is something pretty strange. I'd expect that behavior if the additivity flag was set to false. But the default is appender accumulation <logger name= "package.web" level= "INFO" > <appender-ref ref= "FILE" /> </logger> You need to add the console appender. <appender name= "STDOUT" class= "ch.qos.logback.core.ConsoleAppender" > <!-- By default , encoders are assigned the type ch.qos.logback.classic.encoder.PatternLayoutEncoder --> <encoder> <pattern>

AN INTRODUCTION TO OPERATING SYSTEMS ? What is operating system ?

 AN INTRODUCTION TO OPERATING SYSTEMS  ? What is operating system ? There are two type of software Application software and System software  Application software performs specific task for the user. System software operates and controls the computer system and provides a platform to run application software. what is an operating system - An operating system is a piece of software that manages all the resources of a computer system,both hardware and software, and provides an environment in which the user can execute his/her programs in a convenient and efficient manner by hiding underlying the complexity of the hardware and acting as a resource manager. Why OS Needed in computers?  1. What if there is no OS?  a. Bulky  and  complex  app.  (Hardware  interaction  code  must be  in  app’s code base)  b. Resource exploitation by 1 App.  c. No memory protection.  2. What is an OS made up of?  a. Collection of system software.  The function of Operating system -  - Access to the computer har

How do I get today's date in JavaScript?

  How do I get today's date in JavaScript?- There are various methods that retrieve the date in JavaScript. The data values can get like years, months, days, hours, minutes, seconds, milliseconds from a Date Object.  What are different method provided by Date class in JavaScript-> Method Description getFullYear() Get the  year  as a four digit number (yyyy) getMonth() Get the  month  as a number (0-11) getDate() Get the  day  as a number (1-31) getHours() Get the  hour  (0-23) getMinutes() Get the  minute  (0-59) getSeconds() Get the  second  (0-59) getMilliseconds() Get the  millisecond  (0-999) getTime() Get the time (milliseconds since January 1, 1970) getDay() Get the weekday as a number (0-6) Date.now() Get the time. ECMAScript 5.

Implement stack Using array || how to implement stack c++

 Implement stack Using array || how to implement stack  In this blog, we will be implementing stack using array. What is stack?  A stack is a conceptual structure consisting of a set of homogeneous elements and is based on the principle of last in first out (LIFO). It is a commonly used abstract data type with two major operations, namely push and pop. Push and pop are carried out on the topmost element, which is the item most recently added to the stack. The push operation adds an element to the stack while the pop operation removes an element from the top position. The stack concept is used in programming and memory organization in computers. Operation in Stack -> Push:  Adds an item in the stack. If the stack is full, then it is said to be an Overflow condition. Pop:  Removes an item from the stack. The items are popped in the reversed order in which they are pushed. If the stack is empty, then it is said to be an Underflow condition. Peek or Top:  Returns the top element of the

bubble sort algorithm in c++ || Bubble sort explained || sinking sort

 Bubble sort- Bubble sort, sometimes referred to as sinking sort, is a simple sorting algorithm that repeatedly steps through the list, compares adjacent elements, and swaps them if they are in the wrong order. The pass of the list is repeated until the list is sorted. Why bubble sort is called “bubble” sort? The “bubble” sort is called so  because the list elements with greater value than their surrounding elements “bubble” towards the end of the list . For example, after first pass, the largest element is bubbled towards the right most position. Worst complexity :  n^2 Average complexity :  n^2 Best complexity :  n Space complexity :  1 at the end of i th pass, we have the i th largest element placed at its correct place. look the example below. Example:   First Pass:   (  5   1  4 2 8 ) –> (  1   5  4 2 8 ) ( 1  5   4  2 8 ) –>  ( 1  4   5  2 8 ) ( 1 4  5   2  8 ) –>  ( 1 4  2   5  8 ) ( 1 4 2  5   8  ) –> ( 1 4 2  5   8  ) 1st largest placed at the correct place. Second

What is an algorithm in computer science ?

 What is an algorithm in computer science ?- You may have heard the term  algorithm  recently, whether it was online or perhaps in some conversation about technology. It's a word that gets thrown around a lot, but what does it mean exactly? suppose your mom gave you a task to prepare a cup of tea for her. How do you prepare a cup of tea for her ? definitely, to prepare a cup of tea you are gonna follow the following steps 1- Boil water. 2- Warm up teapot 3-  Put the tea into a teapot and add hot water. 4- Cover teapot and steep tea 5- Strain tea solids and pour hot tea into tea cups. Basically preparing tea was a problem and you follow some step-by-step procedures to solve this problem.  similarly, in computer science,  An algorithm is simply a  set of steps used to complete a specific task . They're the building blocks for programming, and they allow things like computers, smartphones, and websites to function and make decisions. An algorithm is a specific procedure for solvin

How to find all prime number till N? most efficient solution Sieve of Eratosthenes in c++

 How to find all prime number till N? most efficient solution Sieve of Eratosthenes- There are multiple ways to find prime numbers till N. but the sieve of Eratosthenes is the most efficient solution to find prime numbers till n. This efficient solution often used in competitive programming contests. algorithm step by step - step -1 Create a bool vector of size n  and initialize it by false value. step -2  create an empty vector to store prime numbers. step 3-  loop through the visited vector from 2 to n. step 4- if the current value is pointing to unvisited we will push this value to our answer vector and mark visited it's all multiple till n. check below image how it works.                Code for  most efficient solution Sieve of Eratosthenes in c++  

Find Minimum in Rotated Sorted Array II

  Find Minimum in Rotated Sorted Array II- Suppose an array of length  n  sorted in ascending order is  rotated  between  1  and  n  times. For example, the array  nums = [0,1,4,4,5,6,7]  might become: [4,5,6,7,0,1,4]  if it was rotated  4  times. [0,1,4,4,5,6,7]  if it was rotated  7  times. Notice that  rotating  an array  [a[0], a[1], a[2], ..., a[n-1]]  1 time results in the array  [a[n-1], a[0], a[1], a[2], ..., a[n-2]] . Given the sorted rotated array  nums  that may contain  duplicates , return  the minimum element of this array . You must decrease the overall operation steps as much as possible.   Example 1: Input: nums = [1,3,5] Output: 1 Example 2: Input: nums = [2,2,2,0,1] Output: 0   Constraints: n == nums.length 1 <= n <= 5000 -5000 <= nums[i] <= 5000 nums  is sorted and rotated between  1  and  n  times.   Follow up:  This problem is similar to  Find Minimum in Rotated Sorted Array , but  nums  may contain  duplicates . Would this affect the runtime comple