Skip to content

Instantly share code, notes, and snippets.

View hide1202's full-sized avatar
❤️
Develop

Taegyeong Kim hide1202

❤️
Develop
View GitHub Profile
@hide1202
hide1202 / IocPractice.cs
Last active August 7, 2017 01:53
Simple IoC(Inversion of Control) implementation test
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace IocPractice
{
[TestClass]
public class IocPractice
{
@hide1202
hide1202 / GetWindowsVersion.cpp
Created July 11, 2017 08:42
윈도우 버전 가져오기 (Get Windows OS Version)
#include <stdio.h>
#include <tchar.h>
#include <Windows.h>
#pragma comment(lib, "version")
static void print_version()
{
DWORD buffer_size = GetFileVersionInfoSize(_T("kernel32.dll"), NULL);
if (buffer_size == 0)
@hide1202
hide1202 / Server.java
Last active August 24, 2023 12:43
Simple Echo Websocket using Java NIO
package org.viewpoint;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.nio.ByteBuffer;
import java.nio.channels.SelectionKey;
import java.nio.channels.Selector;
import java.nio.channels.ServerSocketChannel;
import java.nio.channels.SocketChannel;
import java.security.MessageDigest;
@hide1202
hide1202 / MultiTable.fs
Last active August 17, 2017 01:12
MultiTable, Scala vs F#
let padding (n : int) : string = if ((n / 10) = 0) then " " else " "
let tableRow row =
[1..9]
|> List.map (fun x -> row * x)
|> List.map (fun x -> padding x + string x)
let rowString n = (tableRow n) |> List.fold (+) " "
[<EntryPoint>]
@hide1202
hide1202 / KeyChain.h
Last active December 20, 2016 09:41
iOS 키체인을 위한 헬퍼 클래스 입니다.
//
// KeyChain.h
// AppGroupProducer
//
// Created by VIEWPOINT on 2016. 12. 20..
// Copyright © 2016년 VIEWPOINT. All rights reserved.
//
#ifndef KeyChain_h
#define KeyChain_h
@hide1202
hide1202 / Variance.cs
Last active June 25, 2016 07:52
Welford's method(variance and standard deviation)
using System;
namespace variance
{
public class Variance
{
private int _count = 1;
private double _mean = 0.0;
private double _variance = 0.0;
@hide1202
hide1202 / DnsQuery.cs
Last active June 17, 2016 00:14
Domain Query in C#
public static IPEndPoint QueryDns(string domain, short port)
{
var domainAddresses = Dns.GetHostEntry(domain).AddressList;
foreach (var addr in domainAddresses)
{
if (addr.AddressFamily == AddressFamily.InterNetwork)
{
return new IPEndPoint(addr, port);
}
@hide1202
hide1202 / EchoClient.cs
Created April 27, 2016 07:17
Haste.EchoClient
using System;
using System.Net;
using System.Threading;
using Haste.Data;
using Haste.Messages;
namespace Haste.EchoClient
{
class EchoClient
{
@hide1202
hide1202 / AFNetworkingMultiPart.m
Created February 17, 2016 05:25
AFNetworking.m
NSMutableURLRequest *request = [[AFHTTPRequestSerializer serializer] multipartFormRequestWithMethod:@"POST" URLString:@"http://example.com/upload" parameters:nil constructingBodyWithBlock:^(id<AFMultipartFormData> formData) {
[formData appendPartWithFileURL:[NSURL fileURLWithPath:@"file://path/to/image.jpg"] name:@"file" fileName:@"filename.jpg" mimeType:@"image/jpeg" error:nil];
} error:nil];
AFURLSessionManager *manager = [[AFURLSessionManager alloc] initWithSessionConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration]];
NSURLSessionUploadTask *uploadTask;
uploadTask = [manager
uploadTaskWithStreamedRequest:request
progress:^(NSProgress * _Nonnull uploadProgress) {
namespace DotNetty.Buffers.Tests
{
using System.Threading.Tasks;
using Common;
using Xunit;
public class PooledByteBufferAllocatorTests
{
[Fact]
public void TestRelease()