Skip to content

Instantly share code, notes, and snippets.

View IshanArya's full-sized avatar

Ishan 火 Arya IshanArya

View GitHub Profile
@IshanArya
IshanArya / jane.py
Created April 17, 2025 01:54
2025-4 JS
class Field:
name: str
length: int
class Schema:
def __init__(self, fields: list[Field]):
self.fields = fields[:]
@IshanArya
IshanArya / private_fork.md
Created September 29, 2024 19:46 — forked from 0xjac/private_fork.md
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare [email protected]:usi-systems/easytrace.git

@IshanArya
IshanArya / Multithreading.java
Created September 15, 2021 22:26
quick multithreading example in java
import java.util.concurrent.*;
import java.util.concurrent.locks.*;
class Main {
static int count = 0;
public static void main(String args[]) {
ExecutorService executor = Executors.newFixedThreadPool(5);
ReentrantLock lock = new ReentrantLock();
Runnable runnable = () -> {
String threadName = Thread.currentThread().getName();
package org.firstinspires.ftc.teamcode;
import com.acmerobotics.dashboard.FtcDashboard;
import com.acmerobotics.dashboard.config.Config;
import com.acmerobotics.dashboard.telemetry.MultipleTelemetry;
import com.acmerobotics.dashboard.telemetry.TelemetryPacket;
import com.arcrobotics.ftclib.hardware.motors.Motor;
import com.qualcomm.robotcore.eventloop.opmode.OpMode;
import com.qualcomm.robotcore.eventloop.opmode.TeleOp;
import com.qualcomm.robotcore.hardware.DcMotor;
package org.firstinspires.ftc.teamcode;
import com.acmerobotics.dashboard.FtcDashboard;
import com.acmerobotics.dashboard.config.Config;
import com.acmerobotics.dashboard.telemetry.MultipleTelemetry;
import com.acmerobotics.dashboard.telemetry.TelemetryPacket;
import com.arcrobotics.ftclib.hardware.motors.Motor;
import com.qualcomm.robotcore.eventloop.opmode.OpMode;
import com.qualcomm.robotcore.eventloop.opmode.TeleOp;
import com.qualcomm.robotcore.hardware.DcMotor;
@IshanArya
IshanArya / cpu-intensive.go
Last active June 1, 2020 22:49 — forked from sorenlouv/cpu-intensive.js
A CPU intensive operation. Use to test imitate blocking code, test WebWorkers etc.
import "math"
func intenseFunc(n int) int {
var result float64 = 0
v := float64(n)
for i := math.Pow(v, 7); i >= 0; i-- {
u := float64(i)
result += math.Atan(u) * math.Tan(u)
}
; This program uses the SLOW_SRAM device to write and read some
; values from the DE2 external SRAM chip. It reads a value from
; the switches, and stores THAT value at THAT address. Then, it
; runs an endless loop where it reads the switches and displays
; the value at that address on the left seven-segment displays.
; If DE2 is powered off, then on, then this program is run with
; the switches set for 0000, then it will display 0000, but if
; the switches are moved to other values, it will display the
; random data still at those locations.
; Resetting the DE2 and running again, without powering off,
@IshanArya
IshanArya / Neural Net 4 Bhardyz.py
Last active November 25, 2019 16:00
Ya. Yeet. Ya.
import copy
import sys
from datetime import datetime
from math import exp
from random import random, randint, choice
class Perceptron(object):
"""
Class to represent a single Perceptron in the net.
@IshanArya
IshanArya / Bell Timer.js
Created May 21, 2019 02:14
Timer that repeats every few seconds
let thirtyBell = () => {
//new Audio('https://instaud.io/_/3Hll.mp3').play();
setInterval(() => {
new Audio('https://instaud.io/_/3Hll.mp3').play();
}, 30000);
}
@IshanArya
IshanArya / tracer.js
Created April 30, 2019 17:51
Create a draggable line on a webpage.
let lineSvg = '<svg id="lineSvg" height="0" width="0" style="display: none; position: fixed; top: 0px; left: 0px;"><line x1="0" y1="0" x2="500" y2="500" style="stroke: rgb(255, 0, 0); stroke-width: 2;"></line></svg>'
document.body.innerHTML = document.body.innerHTML + lineSvg;
lineSvg = document.getElementById('lineSvg');
let line = document.querySelector('#lineSvg > line');
let mouseDownX;
let mouseDownY;
function turnOnTracerLine() {