Skip to content

Instantly share code, notes, and snippets.

View bhargavkulk's full-sized avatar
🚙

Bhargav Kulkarni bhargavkulk

🚙
View GitHub Profile
(FPCore (a b c) (/ (* c -2.0) (+ b (sqrt (+ (pow b 2.0) (* c (* a -4.0)))))))
+-commutative
[ 2, 2, 1 ]
ltr
=========================
(FPCore (a b c) (/ (* c -2.0) (+ b (sqrt (+ (* c (* a -4.0)) (pow b 2.0))))))
*-commutative
[ 1 ]
ltr
=========================
(FPCore (a b c)
(/ 1.0 (/ (/ a (- b (sqrt (fma a (* c -4.0) (pow b 2.0))))) -0.5)))
fma-define
[ 2, 1, 2, 2, 1 ]
ltr
--------------------
(FPCore (a b c)
(/ 1.0 (/ (/ a (- b (sqrt (+ (* a (* c -4.0)) (pow b 2.0))))) -0.5)))
associate-*r*
[ 2, 1, 2, 2, 1, 1 ]
import { strict as assert } from 'node:assert';
const frmla = '(FPCore (a b c):name "quadp (p42, positive)"' +
"(let ([d (sqrt (- (* b b) (* 4 (* a c))))])" +
"(/ (+ (- b) d) (* 2 a))))"
const sample = (await(await fetch('http://127.0.0.1:8000/api/sample', { method: 'POST', body: JSON.stringify({
formula: frmla, seed: 5 }) })).json())
const SAMPLE_SIZE = 8000
@bhargavkulk
bhargavkulk / pool.cpp
Created March 1, 2022 06:38
dsa pool question
#include <iostream>
#include <vector>
using namespace std;
using Matrix = vector<vector<int>>;
int i = 1;
void recur(Matrix &matrix, int cx, int cy, int size, int px, int py) {
pub mod editor;
pub mod events;
pub mod row;
use std::path::PathBuf;
use crossterm::Result;
use editor::Editor;
use log::LevelFilter;
use simple_logging;
main: test.y test.l
bison -d test.y
flex test.l
gcc -o $@ main.c test.tab.c lex.yy.c -lfl
@echo "Compiled main."
#include "test.tab.h"
int main()
{
yyparse();
return 0;
}
@bhargavkulk
bhargavkulk / bot.py
Created July 10, 2021 16:22
D.GG archiver bot o7
import tweepy
from datetime import date
from pprint import pprint
import re
import json
import os
user_id = "TheOmniLiberal"
@bhargavkulk
bhargavkulk / sen1answers.sql
Created February 25, 2021 15:14
Scenario 1 answers lab 4
-- 1
select ssid
from students
order by marks desc
limit 1 offset 1;
-- 2
select branch, count(branch)
from students
group by branch
[12:57:13] [main/INFO] [GradleStart]: Extra: []
[12:57:13] [main/INFO] [GradleStart]: Running with arguments: [--userProperties, {}, --assetsDir, C:/Users/Kishore/.gradle/caches/minecraft/assets, --assetIndex, 1.12, --accessToken{REDACTED}, --version, 1.12.2, --tweakClass, net.minecraftforge.fml.common.launcher.FMLTweaker, --tweakClass, net.minecraftforge.gradle.tweakers.CoremodTweaker]
[12:57:13] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker
[12:57:13] [main/INFO] [LaunchWrapper]: Using primary tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker
[12:57:13] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.CoremodTweaker
[12:57:13] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLTweaker
[12:57:13] [main/INFO] [FML]: Forge Mod Loader version 14.23.5.2768 for Minecraft 1.12.2 loading
[12:57:13] [main/INFO] [FML]: Java is Java HotSpot(TM) 64-Bit Server VM, ver