Skip to content

Instantly share code, notes, and snippets.

View sriharshaj's full-sized avatar
🏠
Working from home

Harsha Jujjavarapu sriharshaj

🏠
Working from home
View GitHub Profile
{
"queryId": "20240911_144851_00236_b6249",
"session": {
"queryId": "20240911_144851_00236_b6249",
"querySpan": {
},
"transactionId": "21bb588c-3469-4053-b923-7ad5d187488c",
"clientTransactionSupport": true,
"user": "user_name",
package main
import (
"net/http"
"io"
)
const form = `<html><body><form action="#" method="post" name="bar">
<input type="text" name="in"/>
<input type="submit" value="Submit"/>
</form></html></body>`
package main
import (
"fmt"
"math"
)
type Square struct {
side float32
}
@sriharshaj
sriharshaj / composing-software.md
Created June 1, 2020 21:04 — forked from rosario/composing-software.md
Eric Elliott's Composing Software Series
@sriharshaj
sriharshaj / ssh_tunneling.md
Created May 12, 2020 19:00 — forked from ashrithr/ssh_tunneling.md
ssh tunneling and port forwarding

###Single hop tunelling:

ssh -f -N -L 9906:127.0.0.1:3306 [email protected]

where,

  • -f puts ssh in background
  • -N makes it not execute a remote command
@sriharshaj
sriharshaj / ResNet50.py
Last active June 26, 2019 20:49
Residual networks example
def ResNet50(input_shape = (64, 64, 3), classes = 6):
"""
Implementation of the popular ResNet50 the following architecture:
CONV2D -> BATCHNORM -> RELU -> MAXPOOL -> CONVBLOCK -> IDBLOCK*2 -> CONVBLOCK -> IDBLOCK*3
-> CONVBLOCK -> IDBLOCK*5 -> CONVBLOCK -> IDBLOCK*2 -> AVGPOOL -> TOPLAYER
"""
# Define the input as a tensor with shape input_shape
X_input = Input(input_shape)
@sriharshaj
sriharshaj / cnn.py
Last active June 26, 2019 17:11
Keras code snippets
def model(input_shape):
# Define the input placeholder as a tensor with shape input_shape. Think of this as your input image!
X_input = Input(input_shape)
# Zero-Padding: pads the border of X_input with zeroes
X = ZeroPadding2D((3, 3))(X_input)
# CONV -> BN -> RELU Block applied to X
X = Conv2D(32, (7, 7), strides = (1, 1), name = 'conv0')(X)
X = BatchNormalization(axis = 3, name = 'bn0')(X)
@sriharshaj
sriharshaj / struct_heap.cpp
Created February 23, 2019 22:44
Priority Queue for structs in c++
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
using namespace std;
struct Student{
int age;
bool operator<(const Student& s) const{
return age < s.age;
}
@sriharshaj
sriharshaj / cond_dependency.py
Last active June 20, 2019 20:44
Tensorflow snippets
v1 = tf.get_variable("v1", shape=(), initializer=tf.zeros_initializer())
v2 = tf.get_variable("v2", shape=(), initializer=tf.zeros_initializer())
switch = tf.placeholder(tf.bool)
cond = tf.cond(switch, lambda: tf.assign(v1, 1.0), lambda: tf.assign(v2, 2.0))
with tf.train.MonitoredSession() as session:
session.run(cond, feed_dict={switch: True})
print(session.run([v1, v2]))
function* getData(){
let data = yield api.call('url');
return data;
}
let gen = getData();
let promise = gen.next();
promise.then(data => {
gen.next(data);
});