Skip to content

Instantly share code, notes, and snippets.

View isaiah-perumalla's full-sized avatar

isaiah isaiah-perumalla

View GitHub Profile
@isaiah-perumalla
isaiah-perumalla / onload-steps.md
Last active December 1, 2024 20:39
Solarflare-onload-installation-steps

check installation

lspci | grep Eth

check nic card is installed properly

dmesg

might need to find a suitable slot if you see the below

 This Solarflare Network Adapter requires the equivalent of 8 lanes at PCI Express 3 speed for full throughput, but is currently limited to 4 lanes at PCI Express 1 speed.  Consult your motherboard documentation to find a more suitable slot
@isaiah-perumalla
isaiah-perumalla / tla
Created April 28, 2024 21:10
tla_plus_concurrent_counter
VARIABLES counter, pc
(* define statement *)
AllDone == \A t \in Threads : pc[t] = "Done"
Correct == AllDone => counter = ThreadCount
VARIABLE localCounter
vars == << counter, pc, localCounter >>
--------------------------- MODULE concurrent_map ---------------------------
EXTENDS TLC, Integers, FiniteSets, Sequences
ReaderCount == 2
Readers == 1..ReaderCount

Keybase proof

I hereby claim:

  • I am isaiah-perumalla on github.
  • I am isaiah_p (https://keybase.io/isaiah_p) on keybase.
  • I have a public key ASB2WZfQUWqLR4Aci20nORmizByne74eM-xm_t-EX9diowo

To claim this, I am signing this object:

package com.company;
import java.util.ArrayList;
import java.util.Arrays;
public class Main {
public static final int INF = Integer.MAX_VALUE;
public static void main(String[] args) {
package practice;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Queue;
import practice.BinarySearchTree.Node;
public class BSTPrint {
@isaiah-perumalla
isaiah-perumalla / functions.py
Last active November 26, 2019 16:20
some python functions
def calc_avg(items):
if not items:
return 0
total = sum(items)
return float(total)/len(items)
def std_deviation(items):
if not items: return 0
mean = calc_avg(items)
@isaiah-perumalla
isaiah-perumalla / q-funcs.q
Last active November 6, 2019 20:10
some q functions
//function return all subset of a list
sset: {[xs] (enlist ()) {x, (y,) each x }/ xs}
//or using the map each right /:
sset: {[xs] (enlist ()) {x, y ,/: x }/ xs}
//q)sset (1; 2; 3;`a)
()
,1
,2
2 1

Keybase proof

I hereby claim:

  • I am isaiah-perumalla on github.
  • I am isaiahperumalla (https://keybase.io/isaiahperumalla) on keybase.
  • I have a public key whose fingerprint is E099 3317 C358 C9E7 6CD6 12C8 B55B AF0E 50E1 63B1

To claim this, I am signing this object:

def solution(N, A, B, C):
edges = [(C[i],A[i],B[i]) for i in xrange(len(A))]
edges.sort(key=lambda e: e[0])
maxLenAt = [0]*N
costAt = [0]*N
def updatePath(u,costu,lenu, v,costv, lenv, cost):
if costu < cost and lenu+1 > lenv:
maxLenAt[v] = lenu+1
costAt[v] = cost