2014년 4월 22일 화요일

MMF 테스트

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Threading.Tasks;
using System.IO.MemoryMappedFiles;
using System.Diagnostics;

namespace MMFs {
    class Program {
        static void Main(string[] args) {
            int SIZE = 1000000;

            //Random rnd = new Random();
            //double[] rndv = new double[SIZE];
            //for(int i = 0; i < rndv.Length; i++) {
            //    rndv[i] = rnd.NextDouble() * 10000;
            //}
            //using(BinaryWriter swr = new BinaryWriter(new FileStream(@"c:\randomdata.data", FileMode.Create, FileAccess.Write))) {
            //    for(int i = 0; i < rndv.Length; i++) {
            //        swr.Write(rndv[i]);
            //    }
            //}

            double[] dbldata = new double[SIZE];
            MemoryMappedFile mmf = MemoryMappedFile.CreateFromFile(@"c:\randomdata.data");
            MemoryMappedViewAccessor access = mmf.CreateViewAccessor();
            int sizedbl = sizeof(double);
            int pos = 0;
            for(int i = 0; i < SIZE; i++) {
                double bucket = 0;
                access.Read<double>(pos, out bucket);
                pos += sizedbl;
                dbldata[i] = bucket;
            }

            Stopwatch sw = Stopwatch.StartNew();
            pos = 0;
            for(int i = 0; i < SIZE; i++) {
                double bucket = 0;
                access.Read<double>(pos, out bucket);
                pos += sizedbl;
                dbldata[i] = bucket;
            }
            sw.Stop();
            Console.WriteLine(sw.ElapsedMilliseconds + ", " + (1000 * 60) / sw.ElapsedMilliseconds);
            Console.ReadLine();
        }
    }
}

2014년 4월 21일 월요일

JSonSerialzer : ServiceStack.Text

기존 Serializer에 비해 속도도 빠르고, 훨씬 Flexible 한 듯... https://github.com/ServiceStack/ServiceStack.Text

2014년 4월 9일 수요일

노트북 Booting Error 고치기

SSD에서 멀쩡하게 부팅되는 노트북이 HDD만 붙이면 OS없다고 부팅 안되는 문제가 발생... 다시 HDD빼면 정상적으로 부팅되고... 결국 이리저리 찾다가 bcdedit를 이용해서 기존 bcd 파일 새로 생성 후 다시 복구하는방법을 찾아서 복구했다. 덕분에 bcdedit 사용법을 잘 익혔네. http://rajandmk.blogspot.kr/2012/09/how-to-create-clean-bcd-file-to-fix.html

Financial Site

금융IT관련 깊이 있는 정보들이 들어 있는 듯... http://www.quantcode.com/modules/mylinks/