Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / 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 / program.pro
Last active October 13, 2019 13:12
Implement of an Expert System in SWI-Prolog lang
동물원(X) :-
척추(X).
포유류(X) :-
척추(X),
not(알깜(X)).
조류(X) :-
척추(X),
알깜(X),
@Gumball12
Gumball12 / client.html
Created November 7, 2019 14:41
server and client code for network term project
<!--
file upload client
@author shj
-->
<input type="file" />
<button>업로드</button>
<script>
// append event handler
@Gumball12
Gumball12 / handler.js
Created November 8, 2019 09:56
SERVERLESS_WITH_OAUTH HANDER_CODE
'use strict';
// import modules
const _ = require('lodash');
const aws = require('aws-sdk');
const randomEmoji = require('random-emoji');
// aws lambda
const lambda = new aws.Lambda({
region: 'ap-northeast-2',
@Gumball12
Gumball12 / index.js
Created November 17, 2019 03:08
net-with-docker assignment (server)
const express = require('express');
// Constants
const PORT = 8000;
// App
const app = express();
app.get('/', function (req, res) {
res.send('Master');
});
@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 / 1128.md
Last active November 28, 2019 07:24
19-2 튜터링 문제 목록

다음을 만족하는 클래스와 함수를 작성해주세요

flow

  • Shape 클래스

    • 상속을 위한 클래스
    • private 접근자를 갖는 name 필드가 존재
    • Shape 클래스를 상속받는 클래스는 getArea 메서드를 반드시 구현해야만 함
    • getArea 메서드는 도형의 넓이를 반환
  • Rect 클래스