Skip to content

Instantly share code, notes, and snippets.

@honux77
honux77 / Emp.cpp
Created September 9, 2012 01:11
cpp simple test
#ifndef __EMP_H_
#define __EMP_H_
/**
This class is for testing copy constructor of cpp
**/
class Emp
{
private:
@honux77
honux77 / hello.c
Created December 5, 2012 07:08
hello.c under apache license :)
#include <stdio.h>
/*
Copyright [2012] [Hoyoung Jung]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
#include <stdio.h>
#include <limits.h>
int main()
{
char c = 'a';
int i = -10;
long l = 500L;
unsigned long long ll= 20L;
printf("size of char is %d", sizeof(c));
@honux77
honux77 / heo-se.cpp
Last active December 12, 2015 02:18
linux style circular double linked list implementation. If you fully understand this code, you may pass CS 101 - basic computer programming. In fact it's c language code, but tested using VS2012.
/* heo-se.cpp : win32 console application
This program prints only one line.
Yes, that's all.
Main concept is from include/linux/list.c in linux kernel 2.6.xx.
Author: Hoyoung Jung, NHN NEXT
Date: 2012.02.01
license: anyone can freely use and modify this code.
*/
#include "stdafx.h"
@honux77
honux77 / baseball.cs
Created February 20, 2013 01:59
C# baseball game
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Security.Cryptography;
namespace NEXTCSharp
{
class BaseballGame
@honux77
honux77 / baseball.py
Created February 21, 2013 16:24
경민의 야구 게임 리팩토링(?) 해 봤습니다.
import random
#input data and avoid redundent data
def input_from_user(question):
isRedundent=False
while True:
if isRedundent:
print "Numbers must be different."
isRedundent=False
raw = raw_input(question)
#include <stdio.h>
/**pointer.c
Should build by release mode.
*/
{
int num1;
int *ptr_l1;
int **ptr_l2;
printf("=================declared, but not initialize=================\n");
@honux77
honux77 / callbyref.c
Last active December 15, 2015 12:18
call by ref test 프로그램 값에 의한 호출과, 참조에 의한 호출을 여러번 반복하고 걸리는 시간을 비교해 보는 프로그램
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <time.h>
struct bigdata
{
int dataid;
@honux77
honux77 / gist:6696409
Last active December 23, 2015 21:29
very simple Sokoban (Push Push) implementation.
/***********************************
Very simple sokoban implementation
by Hobytes
1993. 8
(2013.10: some bug fix)
************************************/
#include <conio.h>
#include <iostream>
#define KEY_ESC 27
public class Solution {
public int numTrees(int n) {
int c = 1;
for (int i = 2; i <= n; i++)
c = 2 * (2 * i - 1) * c / (i + 1);
return c;
}
}