- 현실적인 확률내에서 유니크한 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
[HttpPut] | |
public async Task<MyResult> Put(string id) | |
{ | |
// 일단 입력값(JSON)을 JObject로 읽기 | |
JObject jobject; | |
using (var sr = new StreamReader(Request.Body)) | |
{ | |
jobject = JObject.Load(new JsonTextReader(sr)); | |
} | |
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 SimpleInjector; | |
using System; | |
using System.Diagnostics; | |
using System.Linq; | |
namespace ConsoleApplication1 | |
{ | |
public class Foo { } | |
public class Bar { } | |
public class Zoo { } |
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
/// <summary> | |
/// EnumMemberAttribute에 관련된 확장 메서드 | |
/// </summary> | |
public static class EnumMemberAttributeExtensions | |
{ | |
/// <summary> | |
/// 주어진 enum 값에 선언된 EnumMemberAttribute의 Value를 반환합니다. | |
/// EnumMemberAttribute가 없을 경우 enum 값을 ToString()하여 반환합니다. | |
/// </summary> | |
/// <param name="enumeration">enum 값</param> |
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 class Document | |
{ | |
// actual property | |
[JsonIgnore] | |
public string Value { get; set; } | |
// performs serialization only. | |
[JsonProperty("PresentationValueName")] | |
private string ValueGetter { get { return Value; } } | |
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
/// <summary> | |
/// Represents the base object type for a table entity in the Table service. | |
/// </summary> | |
/// <remarks> | |
/// ReadEntity deserializes enum properties from string values which have same name. | |
/// Property name comparison is case-insensitive. | |
/// Also WriteEntity serializes enum properties as string values. | |
/// </remarks> | |
public abstract class StringEnumTableEntity : TableEntity | |
{ |
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
//--------------------------------------------------------- | |
// ...in the Startup.cs... | |
public void ConfigureServices(IServiceCollection services) | |
{ | |
// ... | |
services.AddAuthentication(); | |
services.AddAuthorization(options => | |
{ | |
var bearerPolicy = new AuthorizationPolicyBuilder() | |
.AddAuthenticationSchemes(JwtBearerDefaults.AuthenticationScheme) |
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.Linq.Expressions; | |
using Xunit; | |
/// <summary> | |
/// Base class | |
/// </summary> | |
public abstract class Food |
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 />'; |
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 | |
{ |
OlderNewer