- 현실적인 확률내에서 유니크한 ID 생성
- 분산시스템에서의 유니크성 확보
- 심지어 클라이언트에서도 ID 생성가능
- 시간순서로 정렬(K-Order)이 되는지는 2차적인 목표
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 AutoMapper; | |
using System.Diagnostics; | |
namespace ConstructorMappingTest | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var configuration = new MapperConfiguration(cfg => |
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.Text.RegularExpressions; | |
namespace Alpaca | |
{ | |
/// <summary> | |
/// Represents an identity of a domain object that must be unique in certain system. | |
/// An empty Id should be treated as invalid. You must check if the id was empty. | |
/// It can be treated as a string when it used to outside the system. | |
/// </summary> |
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.Linq; | |
using Xunit; | |
namespace Something | |
{ | |
public class NullableTest | |
{ | |
public struct FooS | |
{ |
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 ConsoleApp6 | |
{ | |
public class LambdaVsLocalFunction | |
{ | |
private int member = 42; | |
private int PlainLambda() | |
{ |
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
// code from https://en.wikipedia.org/wiki/Hamming_weight | |
public static class BitCounter | |
{ | |
/// <summary> | |
/// Count the number of bits set to 1 in a given value | |
/// </summary> | |
public static int BitCount(this int value) | |
{ | |
return BitCount((UInt64)(value & UInt32.MaxValue)); | |
} |
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
/* | |
* This is an implementation of wcwidth() and wcswidth() (defined in | |
* IEEE Std 1002.1-2001) for Unicode. | |
* | |
* http://www.opengroup.org/onlinepubs/007904975/functions/wcwidth.html | |
* http://www.opengroup.org/onlinepubs/007904975/functions/wcswidth.html | |
* | |
* In fixed-width output devices, Latin characters all occupy a single | |
* "cell" position of equal width, whereas ideographic CJK characters | |
* occupy two such cells. Interoperability between terminal-line |
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 Microsoft.AspNetCore.Builder; | |
using Microsoft.AspNetCore.Hosting; | |
using Microsoft.Extensions.Configuration; | |
using Microsoft.Extensions.DependencyInjection; | |
using Microsoft.Extensions.Logging; | |
namespace WebApplication2 | |
{ | |
public class Startup | |
{ |
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 System.Threading; | |
using System.Threading.Tasks; | |
namespace Gist | |
{ | |
public static class TaskExtensions | |
{ |
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
<?php | |
function replaceInterXmlWhiteSpace($xml) { | |
return preg_replace('/>\s*<\//', '></', $xml); | |
} | |
// 이메일의 예제 | |
$replaced = replaceInterXmlWhiteSpace('</span></p><p><span style="font-size:13.3333px;"> </span></p><p><span style="font-size:13.3333px;">'); | |
echo htmlspecialchars($replaced); | |
echo '<br />'; |
NewerOlder