node.js 스터디에서 Buffer 클래스에 대해 발표할 때 사용한 코드입니다.
발표 내용은 YouTube 에 올렸습니다. (YouTube 동영상 링크)
var winston = require('winston'); // https://github.com/flatiron/winston | |
var logger = new (winston.Logger)({ | |
transports: [ | |
new (winston.transports.Console)(), | |
new (winston.transports.File)({ filename : 'winston.log', timestamp: true, /*maxsize: 2000, maxFiles: 5*/ }) | |
] | |
}); | |
process.on('uncaughtException', function (err) { |
static FileInfo[] ShuffleArray (FileInfo[] src) | |
{ | |
FileInfo[] result = new FileInfo[src.Length]; | |
Random ran = new Random (); | |
List<KeyValuePair<int, FileInfo>> list = new List<KeyValuePair<int, FileInfo>> (src.Length); | |
foreach (var fi in src) | |
{ | |
list.Add (new KeyValuePair<int, FileInfo> (ran.Next (), fi)); | |
} |
node.js 스터디에서 Buffer 클래스에 대해 발표할 때 사용한 코드입니다.
발표 내용은 YouTube 에 올렸습니다. (YouTube 동영상 링크)
public abstract class VthreeModule : NancyModule | |
{ | |
static ILog LOGGER; | |
static VthreeModule() | |
{ | |
LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | |
} |
<?php | |
try | |
{ | |
throw new Exception('an exception'); | |
} | |
catch (NotDefinedExceptionClass $eae) | |
{ | |
echo $eae->getMessage(); | |
} |
void InitLog(string log4netConfigXmlPath, string logFilePath) | |
{ | |
XmlDocument doc = new XmlDocument(); | |
doc.Load(log4netConfigXmlPath); | |
// log4net 설정 XML 에서 "FileLog" 라는 이름의 appender 를 찾아서 설정으로 받은 | |
// 로그 파일 경로를 변경해준다. log4net 설정 XML을 만들 때 주의. | |
XmlAttribute filePathAttr = (XmlAttribute)doc.SelectSingleNode("/log4net/appender[@name='FileLog']/file/@value"); | |
filePathAttr.Value = logFilePath; |
/// <summary> | |
/// Serializer Class. | |
/// </summary> | |
public class PhpSerializer | |
{ | |
//types: | |
// N = null | |
// s = string | |
// i = int |
string url1 = "http://localhost/contents/?registered_date_from=2016-12-26T15%3A00%3A00.000Z®istered_date_to=2016-12-27T15%3A00%3A00.000Z&keywords=%EA%B3%84%ED%9A%8D%EC%84%9C"; | |
string url2 = "http://localhost/contents/?registered_date_from=2016-12-26T15%3A00%3A00.000Z®istered_date_to=2016-12-27T15%3A00%3A00.000Z"; | |
var uri1 = new Uri(url1); | |
var uri2 = new Uri(url2); | |
Console.WriteLine(uri1.PathAndQuery); | |
Console.WriteLine(uri2.PathAndQuery); | |
/* 쿼리 스트링의 구성에 따라서(현상으로는 UTF-8 한글이 인코딩된 쿼리스트링이 |
I hereby claim:
To claim this, I am signing this object: