Skip to content

Instantly share code, notes, and snippets.

View atlas-comstock's full-sized avatar
🎯
Focusing

atlas-booker atlas-comstock

🎯
Focusing
View GitHub Profile

Three-way handshake misunderstanding and error analogy (RFC interpretation)

The TCP three-way handshake is almost a common problem for recent graduate interviews. However, there are still many mistakes on the Internet to know why [TCP is a three-way handshake, not two or four times? The popular answer on (https://www.zhihu.com/question/24853633) is an example. The first analogy of 3.6K approval is wrong:

Three-way handshake:
"Hey, can you hear it?"
"I can hear it, can you hear me?"
"I can hear you, today balabala..."
#include <iostream>
#include <vector>
using namespace std;
struct meet
{
int left, right, value;
};
// opt[i] = v[i] + opt[prev[i]]
// opt[i] = opt[i-1]
@atlas-comstock
atlas-comstock / RecoverEpmd.txt
Created April 16, 2018 08:39 — forked from hamidreza-s/RecoverEpmd.txt
How to recover the connection between a distributed Erlang node and EPMD.
## node 1
$ erl
1> erl_epmd:start().
2> erl_node:register_node(ejabberd, 23456).
## Emergency 'epmd' Recovery
## node 2
$ erl -sname repair
1> net_adm:ping(ejabberd@hostname).
@atlas-comstock
atlas-comstock / The Technical Interview Cheat Sheet.md
Created April 20, 2017 02:30 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
@atlas-comstock
atlas-comstock / exercise.tour.go
Created August 5, 2016 06:07 — forked from zyxar/exercise.tour.go
tour.golang exercise solutions
/* Exercise: Loops and Functions #43 */
package main
import (
"fmt"
"math"
)
func Sqrt(x float64) float64 {
z := float64(2.)
"set to auto read when a file is changed from the outside
set autoread
" Ignore compiled files
set wildignore=*.o,*~,*.pyc
"Always show current position
set ruler
#include <iostream>
#include <complex>
using namespace std;
int main()
{
cout<<'a'<<endl;
cout<<"string: str"<<endl;
cout<<"*********************"<<endl;
complex<float> a(3.14f, 4.12f);
cout<<"a(3.14f, 4.12f) is "<<a<<endl;