A collection of links to the excellent "Composing Software" series of medium stories by Eric Elliott.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"queryId": "20240911_144851_00236_b6249", | |
"session": { | |
"queryId": "20240911_144851_00236_b6249", | |
"querySpan": { | |
}, | |
"transactionId": "21bb588c-3469-4053-b923-7ad5d187488c", | |
"clientTransactionSupport": true, | |
"user": "user_name", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"math" | |
) | |
type Square struct { | |
side float32 | |
} |
###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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function* getData(){ | |
let data = yield api.call('url'); | |
return data; | |
} | |
let gen = getData(); | |
let promise = gen.next(); | |
promise.then(data => { | |
gen.next(data); | |
}); |
NewerOlder