Skip to content

Instantly share code, notes, and snippets.

View whoo24's full-sized avatar

Wooyeong Choe whoo24

  • Oslo, Norway
View GitHub Profile
@whoo24
whoo24 / recursive_linked_list.cpp
Created April 8, 2013 02:44
재귀를 이용해 링크드 리스트 출력하기 print linked list using recursive
#include <list>
#include <algorithm>
using namespace std;
void printlist(list<int>::iterator iter, list<int>::iterator& end)
{
if( iter == end)
return;
@whoo24
whoo24 / rotate_array.cpp
Created April 8, 2013 02:46
배열 회전시키기 rotate array to right
#include <iostream>
void right_rotate(int arr[], int s, int t)
{
int i, last;
last = arr[t];
for(i = t; i > s; i--)
{
arr[i] = arr[i - 1];
@whoo24
whoo24 / print2bin.cpp
Last active December 15, 2015 22:29
2진수 출력하기 print binary
#include <iostream>
using namespace std;
void print2bin(int d)
{
for(int i = 0; i < 32; ++i)
cout << ((d >> (31 - i )) & 1);
cout << endl;
}
@whoo24
whoo24 / VC10.sublime-build.json
Last active December 15, 2015 22:29
VC10 C++ Sublime Build Script
{
"cmd":
[
"echo", "================================================================","&",
"echo", "building", "&",
"echo", "================================================================", "&",
"C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\vcvarsall.bat", "&",
"cl.exe", "${file}", "/EHsc"
],
"encoding": "cp949",
@whoo24
whoo24 / Editor\CanvasWindow.cs
Last active April 5, 2016 12:37
UnityEditor.EditorWindow 클래스 확장 Extending UnityEditor.EditorWindow class
using UnityEngine;
using UnityEditor;
using System;
public class CanvasWindow : EditorWindow {
[MenuItem("Canvas/Show")]
public static void ShowWindow()
{
CanvasWindow window = (CanvasWindow)EditorWindow.GetWindow(typeof(CanvasWindow));
@whoo24
whoo24 / float2byte
Last active December 15, 2015 22:39
C# float to byte
float value = 100.001f;
byte[] FloatToByte = System.BitConverter.GetBytes(value);
float ByteToFloat = BitConverter.ToSingle(FloatToByte, 0);
@whoo24
whoo24 / tuple.lua
Last active December 16, 2015 19:49
Lua tuple by table and tail-call.
function tuple(arg) -- arg is table.
local n_arg = #arg
if n_arg == 0 then
return nil;
end
if n_arg == 1 then
return arg[1];
end
@whoo24
whoo24 / classTemplate.lua
Created April 30, 2013 09:23
Implement of class in Lua
classTemplate = {
new = function(self, func, o)
o = o or {}
setmetatable(o, self)
self.__index = self
return o;
end
}
@whoo24
whoo24 / AccessJsonRawData.cs
Last active April 25, 2018 10:18
LitJson simple samples
string json_text = @"
{
""album"" : {
""name"" : ""The Dark Side of the Moon"",
""artist"" : ""Pink Floyd"",
""year"" : 1973,
""tracks"" : [
""Speak To Me"",
""Breathe"",
""On The Run""
@whoo24
whoo24 / func2table.cpp
Created May 6, 2013 09:26
테이블에 함수를 포인터에 넣어놓고 문자열을 이용해 호출하는 코드
#include <map>
#include <string>
#include <functional>
#include <iostream>
using namespace std;
template <class T>
class Delegator
{
public: