Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

#include <stdint.h>
#include <assert.h>
#include <stdlib.h>
#include <string.h>
uint8_t gf256_add(uint8_t x, uint8_t y) {
return x ^ y;
}
uint8_t gf256_sub(uint8_t x, uint8_t y) {
from Crypto.Util.number import getPrime
from hashlib import sha256
import random
def gen_parameters():
p = getPrime(512)
q = getPrime(512)
N = p * q
a = -3
import os
import numpy
from qulacs import QuantumState, QuantumCircuit
from qulacs.gate import *
def challenge():
# Create a random gate
dx, dy, dz = [numpy.random.rand()*numpy.pi] * 3
def U(index):
return merge(merge(RX(index, dx), RY(index, dy)), RZ(index, dz))

Developing beautiful Solana dApps using Chakra UI

Overview of the Tutorial

In most tutorials, frontend is considered secondary. We write a dApp's smart contract and we are done. But for real world deployment, people need to learn how to produce production ready applications. In this tutorial, we will make an app that tries to use most features of a solana smart contract, and tries to interface it for the web. After this tutorial, the user will be able to write applications without having to write too much HTML/React code, but also understand each part of it. We will make use of best Chakra and React practices like custom hooks so that they also learn a thing about react as well.

Who is this tutorial for?

Should know basics of React and Smart Contract.

@kanav99
kanav99 / instructions.md
Created May 7, 2021 06:03
Xcode Cleanup - Remove All files not needed for macOS development

I use Xcode only for macOS development, not for iOS, TVOS or WatchOS development. They take up most of the space in Xcode. I will show which files to delete to save atleast 20 Gb of space (as of Xcode 12.5) Run all commands as sudo

cd /Applications/Xcode.app/Contents/Developer/Platforms 
rm -rf AppleTVOS.platform
rm -rf AppleTVSimulator.platform
rm -rf iPhoneOS.platform
rm -rf iPhoneSimulator.platform
bool hash_reduce(LatticeVector *v, vector<LatticeVector *> &L, stack<LatticeVector *> &S, int n) {
if (v -> zero) {
return true;
}
for (int i = 0; i < T; ++i) {
unsigned long long h = get_hash(v, i);
cache[i] = h;
vector<LatticeVector *> &list = hash_table[i][h];
int j = 0;
# # [Rising Thermal Bubble](@id EX-RTB-docs)
#
# In this example, we demonstrate the usage of the `ClimateMachine`
# [AtmosModel](@ref AtmosModel-docs) machinery to solve the fluid
# dynamics of a thermal perturbation in a neutrally stratified background state
# defined by its uniform potential temperature. We solve a flow in a
# [`FlatOrientation`](@ref LESConfig) (Box) configuration - this is
# representative of a large-eddy simulation. Several versions of the problem
# setup may be found in literature, but the general idea is to examine the
# vertical ascent of a thermal _bubble_ (we can interpret these as simple

Keybase proof

I hereby claim:

  • I am kanav99 on github.
  • I am kanavgupta (https://keybase.io/kanavgupta) on keybase.
  • I have a public key whose fingerprint is 295A F91F 9BD2 E848 EAB6 DF38 FFD5 2A4E 64CB FE35

To claim this, I am signing this object:

from pwn import *
# some helper functions
def deco(x):
return int.from_bytes(x, byteorder='little')
def extended_gcd(aa, bb):
lastremainder, remainder = abs(aa), abs(bb)
x, lastx, y, lasty = 0, 1, 1, 0
while remainder:

Final Blog

This blog marks end of a really wonderful experience with amazing people! Special shoutout to Chris Rackauckas, Yingbo Ma and David Widmann who immensely helped me in getting my work done and helping me throughout this whole summer. I would always be greatful to them for accepting me as a student.

Regarding my work, my project dealt with more of general fixes for many of the JuliaDiffEq repositories. My work was focussed the most on Callbacks, Non Linear solvers and other Derivative utilities. It involved a lot of moving code back and forth from one repository to another as we were making the common tools in all the repositories shifted to DiffEqBase. Also I made a small benchmarking service called DiffEqBot for the organization which also got featured on JuliaLang Blog! Below is the list of my contribution grouped by the type of work -

Derivative Utilities and Non linear solvers

We used to have seperate copies of the NLSolver methods in each of the repositories. All of them were basicall