Skip to content

Instantly share code, notes, and snippets.

View sanket143's full-sized avatar
🏁
GOSH! Missed the finish again

Sanket sanket143

🏁
GOSH! Missed the finish again
View GitHub Profile
@sanket143
sanket143 / magnitude of complex number.js
Last active October 18, 2021 11:54
To get magnitude of complex number(r) using javascript .
// complex number is usually in the form z = a + ib ;
//and here we are going to return the magnitude of this complex number by using Javascript ;
// As we know that, magnitude of complex number (r)= (a^2 + b^2)^1/2
var complex = [a,b];
var r = 0;
function valueR(complex) {
var rvalue = r + Math.pow(complex[0],2) + Math.pow(complex[1],2);
rvalue = Math.sqrt(rvalue);
@sanket143
sanket143 / Percentage.js
Created May 28, 2017 11:26
To calculate percentage
var marks = [];
var total = 0 ;
function Calculate(marks) {
for(i=0; i < marks.length ; i++) {
total = total + marks[i];
var percentage = total/marks.length ;
} return percentage;
}
Calculate([97,93,94]) ; // here comes your marks
// no matter the number of subjects, its Auto
@sanket143
sanket143 / Matrix(#2).js
Created May 29, 2017 05:42
To calculate determinant of 2*2 matrix
var matrix = [];
function Solve(matrix) {
var Det = matrix[0][0]*matrix[1][1] - matrix[0][1]*matrix[1][0];
return Det;
}
Solve([[1,2],
[3,4]]); // Here goes your matrix and you'll got you determinant;
@sanket143
sanket143 / Matrix(#3).js
Created May 29, 2017 06:51
To get determinant of 3*3 matrix
var matrix=[];
function Solve(matrix) {
var Det = matrix[0][0]*(matrix[1][1]*matrix[2][2] - matrix[1][2]*matrix[2][1])-matrix[0][1]*(matrix[1][0]*matrix[1][1]-matrix[1][2]*matrix[2][0])+matrix[0][2]*(matrix[1][0]*matrix[2][1]-matrix[1][1]*matrix[2][0]);
return Det;
}
Solve([[1,2,2],[3,4,5],[4,5,6]]);//Here goes your three cross three matrix;
@sanket143
sanket143 / Factorial.js
Last active June 23, 2017 06:27
To calculate factorial
function factorialize(num) {
product=1;
var fast =[];
if(num>0){
var ghr= num;
for(i=1;i<=ghr;i++){
fast.push(i);
}
for(i=0;i<fast.length;i++){
product=product*fast[i];
@sanket143
sanket143 / Cricket.js
Created June 14, 2017 18:36
You could play cricket by refreshing the code and copying whatever the result show
function Cricket() {
var Maths = Math.random() * 10 ;
Maths = Math.floor(Maths);
if (Maths ==1 ) {
return "One run";
}
else if (Maths == 2) {
return "Two runs";
}
Verifying my Blockstack ID is secured with the address 17rLuBeKNJwfiGunEfKiTiFRZrCvgG5hYY https://explorer.blockstack.org/address/17rLuBeKNJwfiGunEfKiTiFRZrCvgG5hYY
#include <stdio.h>
// Get Minimum Function
int min(int a, int b){
if(a < b){
return a;
}
return b;
}
From ad18b73407a174883ffe6be11db210226cc5a074 Mon Sep 17 00:00:00 2001
From: Sanket Chaudhari <chaudharisanket2000@gmail.com>
Date: Mon, 22 Oct 2018 04:29:51 +0530
Subject: [PATCH] Made Stepper, Stepper Size Dynamic
---
.../flutter/lib/src/material/stepper.dart | 20 +++++++++----------
1 file changed, 9 insertions(+), 11 deletions(-)
diff --git a/packages/flutter/lib/src/material/stepper.dart b/packages/flutter/lib/src/material/stepper.dart
// Replace _buildVertical() function of
// flutter/packages/flutter/lib/src/material/stepper.dart
Widget _buildVertical() {
return ListView.builder(
shrinkWrap: true,
itemCount: widget.steps.length,
itemBuilder: (BuildContext context, int i){