This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using Microsoft.VisualStudio.TestTools.UnitTesting; | |
namespace IocPractice | |
{ | |
[TestClass] | |
public class IocPractice | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// KeyChain.h | |
// AppGroupProducer | |
// | |
// Created by VIEWPOINT on 2016. 12. 20.. | |
// Copyright © 2016년 VIEWPOINT. All rights reserved. | |
// | |
#ifndef KeyChain_h | |
#define KeyChain_h |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace variance | |
{ | |
public class Variance | |
{ | |
private int _count = 1; | |
private double _mean = 0.0; | |
private double _variance = 0.0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Net; | |
using System.Threading; | |
using Haste.Data; | |
using Haste.Messages; | |
namespace Haste.EchoClient | |
{ | |
class EchoClient | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace DotNetty.Buffers.Tests | |
{ | |
using System.Threading.Tasks; | |
using Common; | |
using Xunit; | |
public class PooledByteBufferAllocatorTests | |
{ | |
[Fact] | |
public void TestRelease() |