Skip to content

Instantly share code, notes, and snippets.

@kanav99
kanav99 / dprkn7.jl
Created April 3, 2019 14:55
dprkn7
struct DPRKN7ConstantCache{T,T2} <: OrdinaryDiffEqConstantCache
c1::T2
c2::T2
c3::T2
c4::T2
c5::T2
c6::T2
c7::T2
c8::T2
a21::T
@kanav99
kanav99 / benchmark.md
Created May 14, 2019 14:14
A benchmark for PkgBenchmark

Benchmark Report for OrdinaryDiffEq

Job Properties

  • Time of benchmarks:
    • Target: 14 May 2019 - 19:43
    • Baseline: 14 May 2019 - 19:44
  • Package commits:
    • Target: 44564c
    • Baseline: 44564c
  • Julia commits:
@kanav99
kanav99 / stiff.jl
Created May 26, 2019 19:08
no recompile mwe
using OrdinaryDiffEq
# First time
function lorenz(du,u,p,t)
du[1] = 1e6*((1-u[2]*u[2])*u[1] - u[2])
du[2] = 1*u[1]
end
u0 = [0;2.]
tspan = (0.0,6.3)
using OrdinaryDiffEq
# First time
function lorenz(du,u,p,t)
du[1] = 1e6*((1-u[2]*u[2])*u[1] - u[2])
du[2] = 1*u[1]
end
u0 = [0;2.]
tspan = (0.0,6.3)
@kanav99
kanav99 / blog-diffeqbot.md
Last active June 18, 2019 17:24
DiffEqBot blog

Hello @DiffEqBot!

Hi! Today we all got a new member to the DiffEq family. Say Hi to our own DiffEqBot - A Bot which helps run benchmarks and compares with the current master of a given package. It also generates and stores the Reports generated in a repository. What's special about this is that it is completely stateless (no databases involved at all, just juggling between repositories!) and it has no exposed public URLs. Even though highly inspired by Nanosoldier, this has a completely unique workflow.

How do you make it work?

So what all you need to do is call @DiffEqBot runbenchmarks in a comment in a PR of a JuliaDiffEq repository and it will do all the work for you. It will benchmark your pull request against the current master and post the link of report when the job gets completed. Found a bug in PR and now you don't need to complete previous job? Just comment @DiffEqBot abort and it won't run now. You also need to mai

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

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:

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:

# # [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
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;