Skip to content

Instantly share code, notes, and snippets.

@russjohnson09
russjohnson09 / index.html
Created August 4, 2017 15:52
HTML Form Challenge created by codingchallenges - https://repl.it/GM10/3
<!--
create a form that submits:
first name
last name
email address
password
to http://posttestserver.com/post.php via post method.
const dgram = require('dgram');
const server = dgram.createSocket('udp4');
server.on('error', (err) => {
console.log(`server error:\n${err.stack}`);
server.close();
});
server.on('message', (msg, rinfo) => {
console.log(`server got: ${msg} from ${rinfo.address}:${rinfo.port}`);
ssh-keygen
cat ~/.ssh/id_rsa.pub
CREATE TABLE `issue_log` (
`id` INT NOT NULL AUTO_INCREMENT,
`app_id` INT NOT NULL,
`test_id` INT NOT NULL ,
`sr_no` INT NULL ,
`issue_name` VARCHAR(255) NOT NULL ,
primary key (id)
);
@russjohnson09
russjohnson09 / binary.cpp
Created February 27, 2013 18:30
Assign X and Y values to a binary tree.
int assignX(RedBlackNode *t, int i) {
t->x = (t->left == nullNode)?i:assignX(t->left,i);
return (t->right == nullNode)?(t->x)+1:assignX(t->right,t->x+1);
}
void assignY(RedBlackNode *t, int i) {
if (t != nullNode){
t->y = i;
assignY(t->right, i-1);
assignY(t->left, i-1);
@russjohnson09
russjohnson09 / gist:4022375
Created November 6, 2012 03:27
Generalized Rules of Inferance
def confirm(forms, rule):
wtup = rule[0]
maintup = rule[1]
if len(forms) != len(wtup):
return False
dict1 = {}
for index,form in enumerate(forms):
if maintup[index]:
public void addAtEnd(String s) {
if (top == null) {
top = new Node (s, null);
return;
}
Node temp = top;
while (temp.getNext() != null) {
temp = temp.getNext();
}
<!-- filters.svg -->
<svg width="1" height="1" version="1.1"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<filter id="gaussian_blur">
<feGaussianBlur in="SourceGraphic" stdDeviation="2" />
</filter>
<filter id="sepia">