Skip to content

Instantly share code, notes, and snippets.

@Gumball12
Gumball12 / swap.c
Last active October 13, 2019 05:09
swap fucntion
#include <stdio.h>
/**
* swap function
* @param xp pointer x
* @param yp pointer y
* */
void swap(long *xp, long *yp) {
// define temporary values
long temp0 = *xp;
@Gumball12
Gumball12 / index.c
Last active October 12, 2019 09:02
compute RTT values
/**
* compute RTT values
* (DevRTT, EstimatedRTT, TimeoutInterval)
* @author shj <https://github.com/Gumball12>
* */
// import module
#include <stdio.h>
#include <stdlib.h> // for absolute value function 'abs'
@Gumball12
Gumball12 / tcp-client.js
Created October 4, 2019 16:40
tcp/udp socket program
/**
* tcp socket programming (client-side)
* @author shj
*/
// import module
const net = require('net');
// create TCP socket
const client = new net.Socket();
@Gumball12
Gumball12 / integer-addition.c
Last active October 3, 2019 15:15
side effects of type conversion, integer addition
// cs-assignment 2-4 "Byte Manipulation - Integer Addition"
// @author shj
// import modules
#include <stdio.h>
#include <limits.h> // for get limits the values of various variable types
/**
* integer addition with unsigned short int type
* @param a first operand
@Gumball12
Gumball12 / index.c
Last active September 28, 2019 09:55
Bit-level operation
// cs-assignment 2-2 "Byte Manipulation - Byte Level Operation"
// @author shj
// import modules
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#define STR_SIZE 10 // string size
#define TESTING_TIMES 30 // for unit-testing
@Gumball12
Gumball12 / README.md
Last active October 4, 2021 10:53
Byte converter implemented by C lang (random int, double, char, string => byte)

Byte Converter

random int, double, char, string => byte

flow chart

@Gumball12
Gumball12 / w1-1.cpp
Last active November 21, 2019 07:32
19-2h tutoring https://git.io/Je4r2
// https://rextester.com/KAY13591
// import modules
#include <iostream>
// define Character class
class Character {
private:
// declare fields
int x;
@Gumball12
Gumball12 / README.md
Last active September 24, 2019 07:52
ν•™μˆ μ •λ³΄κ²€μƒ‰ μ‹€μŠ΅
  • refλŠ” μ–Έμ œλ‚˜ κΌ­ λ‹¬μž => μ‹ λ’°μ„± 높아짐

    • κΌ­ ref 달 λ•Œ μ•„λ‹ˆλΌλ„ ꡉμž₯히 μœ μš©ν•œ 정보듀을 얻을 수 μžˆμ„λ“―
  • ref 검색방법

    • λ„μ„œκ΄€ ν™ˆνŽ˜μ΄μ§€ (μ—†μœΌλ©΄ 원문볡사신청)
      • λ„μ„œκ΄€μ˜ 톡합검색 (κ°œμ’‹μ€λ“―)
      • λ¬Όλ‘  ν•΄μ™Έ μžλ£Œλ„ κ°€λŠ₯
    • ν•™μˆ DB (RISS, NDSL, κ΅­νšŒλ„μ„œκ΄€)
      • λ„μ„œκ΄€ ν™ˆνŽ˜μ΄μ§€ ν†΅ν•΄μ„œ κ°€λ©΄ 됨. ν•™κ΅μ—μ„œ κ΅¬λ§€ν•œ 유료자료 λ³Ό 수 있기 λ•Œλ¬Έ
  • λ¬Όλ‘  κ΅¬λ§€μ•ˆν•œ μžλ£Œλ„ μžˆκΈ°μ—, 원문볡사신청

@Gumball12
Gumball12 / assignment-1.c
Last active September 22, 2019 13:03
CSAPP assignments
// import modules
#include <stdio.h>
#include <limits.h>
#include <stdlib.h>
// define Stack struct
struct Stack {
int* arr;
int top;
unsigned length;
@Gumball12
Gumball12 / README.md
Last active September 15, 2019 12:19
for traceroute assignment