Posts

Building a Full-Stack Student Management System with React.js and NestJS

  🚀 My Journey Creating a Student Management System 🌟 I'm excited to share my recent project — a Student Management System ! This project gave me hands-on experience in building a full-stack application, enhancing both my frontend and backend development skills. 💡 Project Overview The Student Management System is designed to help educational institutions efficiently manage student data, including enrollment, attendance, and performance. The goal was to create a user-friendly platform for both students and administrators. 🔨 Tech Stack Used ✅ Frontend: JavaScript, HTML, CSS, React.js ✅ Backend: TypeScript, NestJS, Node.js ✅ Database: MongoDB (with _id for unique identifiers) 🌟 Key Features ✔️ Student Registration – Easy registration with unique ID management ✔️ Attendance Tracking – Real-time updates on student attendance ✔️ Performance Reports – Generate and view student performance reports ✔️ Admin Panel – Secure access for administrators to manage student...

Today I have solved the problem in javascript

 Consider the following scenario: there are N mice and N holes placed at integer points along a line. Given this, find a method that maps mice to holes such that the largest number of steps any mouse takes is minimized.Each move consists of moving one mouse one unit to the left or right, and only one mouse can fit inside each hole.For example, suppose the mice are positioned at [1, 4, 9, 15], and the holes are located at [10, -5, 0, 16]. In this case, the best pairing would require us to send the mouse at 1 to the hole at -5, so our function should return 6. const mice = [1, 4, 9, 15]; const holes = [10, -5, 0, 16]; function minSteps(mice, holes) {    mice.sort((a, b) => a - b);     holes.sort((a, b) => a - b); let maxSteps = 0;     for (let i = 0; i < mice.length; i++) {         let steps = Math.abs(mice[i] - holes[i]);         if (steps > maxSteps) {             maxStep...

Today I have solved the problem in javascript

 The United States uses the imperial system of weights and measures, which means that there are many different, seemingly arbitrary units to measure distance. There are 12 inches in a foot, 3 feet in a yard, 22 yards in a chain, and so on. Create a data structure that can efficiently convert a certain quantity of one unit to the correct amount of any other unit. You should also allow for additional units to be added to the system. function convert(quantity, fromUnit, toUnit) {   if (!conversions[fromUnit] || !conversions[toUnit]) {     return "Invalid units";   }   return quantity * conversions[fromUnit][toUnit]; } const conversions = {   inch: {     foot: 1 / 12,     yard: 1 / 36,     mile: 1 / 63360,        },   foot: {     inch: 12,     yard: 1 / 3,     mile: 1 / 5280,        },   yard: {     inch: 36,     foot: 3,  ...

Today I have solved the problem in javascript

In chess, the Elo rating system is used to calculate player strengths based on game results. A simplified description of the Elo system is as follows. Every player begins at the same score. For each subsequent game, the loser transfers some points to the winner, where the amount of points transferred depends on how unlikely the win is. For example, a 1200-ranked player should gain much more points for beating a 2000-ranked player than for beating a 1300-ranked player.Implement this system. var playerA = 1200; var playerB = 2000; var result = 1;  var kFactor = 32;  var newRatings = updateRating(playerA, playerB, result, kFactor); function expectedScore(ratingA, ratingB) {     return 1 / (1 + Math.pow(10, (ratingB - ratingA) / 400)); } function updateRating(ratingA, ratingB, result, kFactor) {     var expectedScoreA = expectedScore(ratingA, ratingB);     var expectedScoreB = expectedScore(ratingB, ratingA);     var newRatingA = ratingA + k...

Today I have solved the problem in javascript

 In chess, the Elo rating system is used to calculate player strengths based on game results. A simplified description of the Elo system is as follows. Every player begins at the same score. For each subsequent game, the loser transfers some points to the winner, where the amount of points transferred depends on how unlikely the win is. For example, a 1200-ranked player should gain much more points for beating a 2000-ranked player than for beating a 1300-ranked player. Implement this system. const initialRating = 1000; const players = {     "Alice": initialRating,     "Bob": initialRating,     "Charlie": initialRating }; const winner = "Alice"; const loser = "Bob"; const { winnerNewRating, loserNewRating } = updateRatings(players[winner], players[loser]); players[winner] = winnerNewRating; players[loser] = loserNewRating; function expectedScore(playerRating, opponentRating) {     return 1 / (1 + Math.pow(10, (opponentRating - playerRati...

Today I have solved the problem in javascript

 A Boolean formula can be said to be satisfiable if there is a way to assign truth values to each variable such that the entire formula evaluates to true. For example, suppose we have the following formula, where the symbol ¬ is used to denote negation:(¬c OR b) AND (b OR c) AND (¬b OR c) AND (¬c OR ¬a)One way to satisfy this formula would be to let a = False, b = True, and c = True. This type of formula, with AND statements joining tuples containing exactly one OR, is known as 2-CNF.Given a 2-CNF formula, find a way to assign truth values to satisfy it, or return False if this is impossible. const formula = [     ['¬c', 'b'],     ['b', 'c'],     ['¬b', 'c'],     ['¬c', '¬a'] ]; function satisfy2CNF(formula) {     const assignament = {};          for (const [a, b] of formula) {         if ((a in assignment && assignment[a] !== b) || (b in assignment && assignment[b] !== a)...

Today I have learned basics in python

  B asics in python What is Python basics? Python Basics is for people who want to learn Python programming—whether you are a complete beginner to programming, or a developer with experience in another language. What Are Python Raw Strings? What's the Zen of Python? Begin your Python journey with these beginner-friendly tutorials. Learn fundamental Python concepts to kickstart your career. What should I learn in Python? Fundamentals Syntax – introduce you to the basic Python programming syntax. Variables – explain to you what variables are and how to create concise and meaningful variables. Strings – learn about string data and some basic string operations. Numbers – introduce to you the commonly-used number types including integers and floating-point numbers. a= 45 b= 60 c= 70 d= "My age {1}.{1} is {0} " print(d.format(a,b,c)) Output: my age 60.60 is 45 try:   print("hiii") except:   print("error") else:   print("good morning") Output: hiii ...