Posts

Showing posts from February, 2025

Robotics

Here’s a basic JavaScript code snippet demonstrating the three primary trigonometric functions (sin, cos, tan) along with some additional functions like asin, acos, and atan: <!DOCTYPE html> <html lang="en"> <head>   <meta charset="UTF-8">   <meta name="viewport" content="width=device-width, initial-scale=1.0">   <title>Trigonometric Functions</title> </head> <body>   <h1>Trigonometric Functions in JavaScript</h1>   <p>Check the console for the results.</p>   <script>     // Angle in degrees     let angleInDegrees = 30;     // Convert angle to radians     let angleInRadians = angleInDegrees * (Math.PI / 180);     // Trigonometric calculations     let sineValue = Math.sin(angleInRadians);     let cosineValue = Math.cos(angleInRadians);     let tangentValue = Math.tan(angleInRadians);    ...

Drone

const drone = document.getElementById("drone"); let x = 135; let y = 135; document.addEventListener("keydown", (event) => {   const step = 5; // Movement step size   switch (event.key) {     case "ArrowUp": // Move up       if (y - step >= 0) y -= step;       break;     case "ArrowDown": // Move down       if (y + step <= 270) y += step;       break;     case "ArrowLeft": // Move left       if (x - step >= 0) x -= step;       break;     case "ArrowRight": // Move right       if (x + step <= 270) x += step;       break;     default:       break;   }   // Update drone position   drone.style.top = `${y}px`;   drone.style.left = `${x}px`; });

Space engineering

#include <Servo.h> // Create servo objects Servo finServo1; Servo finServo2; Servo finServo3; // Pin configuration const int fin1Pin = 9; const int fin2Pin = 10; const int fin3Pin = 11; // Angle variables int angle1 = 90;  // Initial angle for stabilization int angle2 = 90; int angle3 = 90; // Function to adjust fins (simulate stabilization) void adjustFins(int angle1, int angle2, int angle3) {   finServo1.write(angle1);   finServo2.write(angle2);   finServo3.write(angle3); } void setup() {   // Attach servos to pins   finServo1.attach(fin1Pin);   finServo2.attach(fin2Pin);   finServo3.attach(fin3Pin);     // Initial position   adjustFins(angle1, angle2, angle3); } void loop() {   // Example: Adjusting fin angles based on arbitrary conditions   angle1 = random(80, 100);  // Simulate dynamic stabilization   angle2 = random(80, 100);   angle3 = random(80, 100);   ...

Self driving cars

Pak Army FanPage Muslim World League - رابطة العالم الإسلامي 𝐒𝐞𝐥𝐟 𝐝𝐫𝐢𝐯𝐢𝐧𝐠 𝐜𝐚𝐫𝐬 import cv2 import numpy as np def region_of_interest(img, vertices):     mask = np.zeros_like(img)     cv2.fillPoly(mask, vertices, 255)     masked_image = cv2.bitwise_and(img, mask)     return masked_image def draw_lines(img, lines):     for line in lines:         x1, y1, x2, y2 = line[0]         cv2.line(img, (x1, y1), (x2, y2), (255, 0, 0), 10) def process_frame(frame):     height, width = frame.shape[:2]     region_vertices = [(0, height), (width // 2, height // 2), (width, height)]     gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)     blur = cv2.GaussianBlur(gray, (5, 5), 0)     edges = cv2.Canny(blur, 50, 150)     cropped_edges = region...
Image
Open in app Sign up Sign in   class Car { constructor (x,y,width,height,controlType,maxSpeed= 3 ){ this .x=x; this .y=y; this .width=width; this .height=height; this .speed= 0 ; this .acceleration= 0.2 ; this .maxSpeed=maxSpeed; this .friction= 0.05 ; this .angle= 0 ; this .damaged= false ; this .useBrain=controlType== "AI" ; if (controlType!= "DUMMY" ){ this .sensor=new Sensor(); this .brain=new NeuralNetwork( [ this .sensor.rayCount, 4 ] ); } this .controls=new Controls(controlType); } update(roadBorders,traffic){ if (! this .damaged){ this .#move(); this .polygon= this .#createPolygon(); this .damaged= this .#assessDamage(roadBorders,traffic); } if ( this .sensor){ this .sensor.update( this .x, this .y, this .angle,roadBorders,traffic); ...

Full stack

Database: Update the MONGODB_URI in your .env file with the production database credentials. Verify and adjust the database name, host, and any additional connection options (e.g., replica sets, connection pool settings). Backend: Change the CORS origin from http://localhost:5173 to your deployed front-end URL. Adjust middleware or static file paths if your production directory structure differs. Update API route configurations if there are any changes in the endpoints or business logic. Modify error handling (e.g., reducing detailed error output) to suit a production environment. Change the server port (via process.env.PORT or hardcoded) if necessary for your deployment. Front End: Update the API base URL in your front-end configuration to point to your production backend. Replace any hardcoded local URLs (like http://localhost:5173 ) with the production URL. Ensure that any environment-specific settings (e.g., API endpoints, port numbers) are correctly set for the...

How to live a life

Mohtat ho k chalna

Backend js

Your backend setup is mostly correct, but there are a few improvements and potential fixes you can make: 1. db.js (Database Connection) Use mysql2 instead of mysql for better promise support. Add connection pooling to optimize performance. Handle connection errors more gracefully. Updated db.js : const mysql = require("mysql2"); const db = mysql.createPool({ host: "localhost", user: "root", password: "", database: "contact_form", connectionLimit: 10, // Allows multiple concurrent connections }); // Check database connection db.getConnection((err, connection) => { if (err) { console.error("Error connecting to MySQL:", err); } else { console.log("Connected to MySQL database"); connection.release(); // Release the connection back to the pool } }); module.exports = db; 2. server.js (Server File) Add error handling for unhandled routes. Use CORS options for better secu...

Version Conflict: Version Conflict: Version Conflict: Version Conflict: Software

Rocksim StackBlitz React Nodejs   CARLA DBMS Baidu Apollo You can build various types of applications using the concepts of fetching data, decoding, executing logic, and React hooks (useState, useEffect, useContext, useReducer, useRef). Here are some ideas for software you could develop

Version Conflict: Version Conflict: Version Conflict: Software

Rocksim StackBlitz React Nodejs   CARLA DBMS You can build various types of applications using the concepts of fetching data, decoding, executing logic, and React hooks (useState, useEffect, useContext, useReducer, useRef). Here are some ideas for software you could develop

Version Conflict: Version Conflict: Software

Rocksim StackBlitz React Nodejs   CARLA DBMS 

Version Conflict: Software

Rocksim StackBlitz React Nodejs 

Softwares

Rocksim StackBlitz eCommerce app

Rocket

Rocksim

Version Conflict: Formula for doing one language and one currency

https://byjus.com/sin-cos-formulas/ https://chatgpt.com/share/67933f3d-546c-800a-85fa-6cd75a3d4fb8 sin²θ + cos²θ = 1. tan 2 θ + 1 = sec 2 θ cot 2 θ + 1 = cosec 2 θ sin 2θ = 2 sin θ cos θ cos 2θ = cos²θ – sin²θ tan 2θ = 2 tan θ / (1 – tan²θ) Here are the names of the formulas from the images: Sine Law Cosine Law Product Identities Multiple Angle Formulas Product to Sum Formulas Periodic Identities Various sine and cosine transformations based on periodicity and symmetry. If you need any specific explanations or further breakdowns, let me know! cot 2θ = (cot²θ – 1) / 2 cot θ

What business should I start from AI?

Image

Robotics

Rocksim

Formula for doing one language and one currency

https://byjus.com/sin-cos-formulas/ https://chatgpt.com/share/67933f3d-546c-800a-85fa-6cd75a3d4fb8 sin²θ + cos²θ = 1. tan 2 θ + 1 = sec 2 θ cot 2 θ + 1 = cosec 2 θ sin 2θ = 2 sin θ cos θ cos 2θ = cos²θ – sin²θ tan 2θ = 2 tan θ / (1 – tan²θ) cot 2θ = (cot²θ – 1) / 2 cot θ

Sin Cos Formulas in Trigonometry with Examples

https://byjus.com/sin-cos-formulas/

Version Conflict: Version Conflict: Formulas that could be put everywhere

Math formula that could be put everywhere  https://byjus.com/sin-cos-formulas/ https://chatgpt.com/share/67933f3d-546c-800a-85fa-6cd75a3d4fb8 اَشْهَدُ اَنْ لَّآ اِلٰهَ اِلَّا اللهُ وَحْدَہٗ لَاشَرِيْكَ لَہٗ وَاَشْهَدُ اَنَّ مُحَمَّدًا عَبْدُهٗ وَرَسُولُہٗ Here is a comprehensive list of important trigonometric formulas involving sine and cosine, presented in a copy-friendly format: Sum and Difference Formulas Difference of Sines and Cosines Product-to-Sum Formulas Fundamental Trigonometric Identities Sine and Cosine of Complementary Angles Double Angle Formulas Sum and Difference Formulas for Sine and Cosine These formulas are essential for solving trigonometric equations, simplifying expressions, and working on problems involving periodic behavior in calculus and physics. Here is a comprehensive list of important trigonometric formulas involving sine and cosine, presented in a copy-friendly format: Sum and Difference Formulas Difference...

Version Conflict: Formulas that could be put everywhere

Math formula that could be put everywhere  https://byjus.com/sin-cos-formulas/ https://chatgpt.com/share/67933f3d-546c-800a-85fa-6cd75a3d4fb8 اَشْهَدُ اَنْ لَّآ اِلٰهَ اِلَّا اللهُ وَحْدَہٗ لَاشَرِيْكَ لَہٗ وَاَشْهَدُ اَنَّ مُحَمَّدًا عَبْدُهٗ وَرَسُولُہٗ sin²θ + cos²θ = 1. tan 2 θ + 1 = sec 2 θ cot 2 θ + 1 = cosec 2 θ sin 2θ = 2 sin θ cos θ cos 2θ = cos²θ – sin²θ tan 2θ = 2 tan θ / (1 – tan²θ) cot 2θ = (cot²θ – 1) / 2 cot θ The "sino + coso" formulas likely refer to trigonometric identities that involve combinations of the sine and cosine functions. There are a few important formulas and identities in trigonometry involving sine (sin) and cosine (cos). Here are the key ones: 1. Sum of Sine and Cosine This identity combines sine and cosine into one expression: \sin(x) + \cos(x) = \sqrt{2} \cdot \sin\left(x + \frac{\pi}{4}\right) \sin(x) + \cos(x) = \sqrt{2} \cdot \cos\left(x - \frac{\pi}{4}\right) These formulas show that a sum of sine and cosine can be rewritten as a single ...

Formulas that could be put everywhere

https://byjus.com/sin-cos-formulas/ https://chatgpt.com/share/67933f3d-546c-800a-85fa-6cd75a3d4fb8 اَشْهَدُ اَنْ لَّآ اِلٰهَ اِلَّا اللهُ وَحْدَہٗ لَاشَرِيْكَ لَہٗ وَاَشْهَدُ اَنَّ مُحَمَّدًا عَبْدُهٗ وَرَسُولُہٗ sin²θ + cos²θ = 1. tan 2 θ + 1 = sec 2 θ cot 2 θ + 1 = cosec 2 θ sin 2θ = 2 sin θ cos θ cos 2θ = cos²θ – sin²θ tan 2θ = 2 tan θ / (1 – tan²θ) cot 2θ = (cot²θ – 1) / 2 cot θ

White hair solution

https://www.facebook.com/share/r/1Bat9cvrA5/

Robotic Movements

import React, { useState } from "react"; const RobotControl = () => {   const [position, setPosition] = useState({ x: 0, y: 0 });   // Movement handlers   const moveUp = () => {     setPosition((prev) => ({ ...prev, y: prev.y - 1 }));   };   const moveDown = () => {     setPosition((prev) => ({ ...prev, y: prev.y + 1 }));   };   const moveLeft = () => {     setPosition((prev) => ({ ...prev, x: prev.x - 1 }));   };   const moveRight = () => {     setPosition((prev) => ({ ...prev, x: prev.x + 1 }));   };   return (     <div style={{ textAlign: "center", padding: "20px" }}>       <h1>Robot Control</h1>       <div         style={{           width: "200px",           height: "200px",           border: "2px solid black"...

Apollo simulator powered by air or vacuum

key:APOLLO_KEY=your-api-key-here const { ApolloServer } = require('apollo-server'); const server = new ApolloServer({   typeDefs,   resolvers,   introspection: true,   playground: true,   apollo: {     key: process.env.APOLLO_KEY,   }, }); server.listen().then(({ url }) => {   console.log(`Server ready at ${url}`); }); car run hoti ha hawase api mere pas ha car apollo se

Latest marketing

𝗺𝗮𝗿𝗸𝗲𝘁𝗶𝗻𝗴 1.Productivity Tools Task Management Apps: Tools for organizing tasks, projects, and schedules. Note-taking Applications: Simple yet effective apps for taking and organizing notes. Time Tracking Software: Useful for freelancers and businesses to track billable hours. 2. Utilities File Management Tools: Applications that assist with file organization, searching, and batch processing. System Optimization Software: Tools that help improve system performance, such as disk cleaners or memory optimizers. 3. Creative Software Graphic Design Tools: Applications for photo editing, vector graphics, or digital painting. Music Production Software: Simple DAWs (Digital Audio Workstations) or tools for specific tasks like MIDI editing. 4. Development Tools Code Editors or IDEs: Lightweight editors with unique features tailored for specific programming languages. Version Control Tools: Software that simplifies the use of version control systems for develo...

Carla

The basic idea is that  the CARLA simulator itself acts as a server and waits for a client to connect . A Python process connects to it as a client. The client sends commands to the server to control both the car and other parameters like weather, starting new episodes, etc

Api apollo

require('dotenv').config(); // Load environment variables const { ApolloServer, gql } = require('apollo-server'); // Sample type definitions and resolvers const typeDefs = gql`   type Recipe {     id: ID!     title: String!   }   type Query {     recipes: [Recipe!]!   } `; const resolvers = {   Query: {     recipes: () => [       { id: "1", title: "Spaghetti Bolognese" },       { id: "2", title: "Chicken Curry" },     ],   }, }; const server = new ApolloServer({   typeDefs,   resolvers,   introspection: true,   playground: true,   apollo: {     key: process.env.APOLLO_KEY,   }, }); server.listen().then(({ url }) => {   console.log(`Server ready at ${url}`); });

Robotics

import React, { useState } from "react"; const RobotControl = () => {   const [position, setPosition] = useState({ x: 0, y: 0 });   // Movement handlers   const moveUp = () => {     setPosition((prev) => ({ ...prev, y: prev.y - 1 }));   };   const moveDown = () => {     setPosition((prev) => ({ ...prev, y: prev.y + 1 }));   };   const moveLeft = () => {     setPosition((prev) => ({ ...prev, x: prev.x - 1 }));   };   const moveRight = () => {     setPosition((prev) => ({ ...prev, x: prev.x + 1 }));   };   return (     <div style={{ textAlign: "center", padding: "20px" }}>       <h1>Robot Control</h1>       <div         style={{           width: "200px",           height: "200px",           border: "2px solid black"...

Apolo, the self driving cars through internet

require('dotenv').config(); // Load environment variables const { ApolloServer, gql } = require('apollo-server'); // Sample type definitions and resolvers const typeDefs = gql`   type Recipe {     id: ID!     title: String!   }   type Query {     recipes: [Recipe!]!   } `; const resolvers = {   Query: {     recipes: () => [       { id: "1", title: "Spaghetti Bolognese" },       { id: "2", title: "Chicken Curry" },     ],   }, }; const server = new ApolloServer({   typeDefs,   resolvers,   introspection: true,   playground: true,   apollo: {     key: process.env.APOLLO_KEY,   }, }); server.listen().then(({ url }) => {   console.log(`Server ready at ${url}`); });

Version Conflict: Tauheed

Ae Allah hm tjh pr iman rkhtay ha or age b rkhain gay ab ye ni kehna k Kam milega ya ni kio k Alam e arwah se hm Allah se wada kr kr a rhay ha k hm tjh pr hi Aiman rakhtey ha or rkhain gay wada rha. Allah pr iman or ghalib pr iman: Allah jo quran me hmse kehta ha wo ankhe bnd kr k manana

Tauheed

Ae Allah hm tjh pr iman rkhtay ha or age b rkhain gay ab ye ni kehna k Kam milega ya ni kio k Alam e arwah se hm Allah se wada kr kr a rhay ha k hm tjh pr hi Aiman rakhtey ha or rkhain gay wada rha. 

Petroleum

 The process is long but some characteristics may resemble and others are common with petroleum @Infrastructure-of-Pakistan  1. Petroleum reactions 2. Catalytic Cracking 3.catalytic Reforming  3. Hydrocracking 4. Isomerization 5. Alkylation 6. Catalytic Cracking 7. Fischer-Tropsch Synthesis 8. Steam Methane Reforming 9. Coal Gasification 10. Methanol Synthesis 11. Methyl Tertiary Butyl Ether (MTBE) Production 12. Ethylene Glycol Production 13. Dimethyl Ether (DME) Synthesis 14. Propylene Glycol Production 15. Naphtha Reforming 16. Bioethanol Production 17. Carbonylation 18. Oxidative Coupling of Methane (OCM) 19. Styrene Production 20. Toluene Disproportionation 21. Benzene Hydrogenation 22. Butadiene Production 23. Ethylene Oxide Production 24. Cumene Process 25. Phenol Production 26. Catalytic Hydration 27. Ethylene Dichloride (EDC) Production 28. Vinyl Chloride Monomer (VCM) Production 29. Chlorination 30. Hydrodechlorination 31. Ethylbenzene Production 32. Chlorohydri...