Programming

Programming/C#

Dllimport Path Rule

Before the system searches for a DLL, it checks the following: If a DLL with the same module name is already loaded in memory, the system uses the loaded DLL, no matter which directory it is in. The system does not search for the DLL. If the DLL is on the list of known DLLs for the version of Windows on which the application is running, the system uses its copy of the known DLL (and the known DL..

Programming

SLA 프린팅을 위한 모델 단층 자르는 코드

해당 페이지에 SLA 3D프린팅을 할 때 필요한 모델에 대한 단층 자르는 알고리즘 설명이 되어 있음 https://ravehgonen.wordpress.com/2013/02/19/stereolithography-3d-printing-algorithms-and-thoughts/ 아래는 해당 코드 The Full Source Code (C++): #include #include #include #include #include “glm/glm/glm.hpp” #include “glm/glm/gtc/matrix_transform.hpp” #include “glm/glm/gtc/type_ptr.hpp” #define DEG_TO_RAD(x) (x*0.0174532925199f) using namespace std..

Programming/Java

Java 한글 인코딩

Naver 한글인코딩에 대한 이해 한글 인코딩의 역사와 유니코드 : http://d2.naver.com/helloworld/19187 유니코드와 Java를 이용한 한글 처리 : http://d2.naver.com/helloworld/76650 JAVA - 한글 인코딩 변환 체크 한방에 끝내기 public static void FindEncoding(String s) { try { String word = s; System.out.println("utf-8(1) : " + new String(word.getBytes("utf-8"), "euc-kr")); System.out.println("utf-8(2) : " + new String(word.getBytes("utf-8"), "ksc5601")); Sy..

Programming/Java

Thread-safe Queue

멀티 스레드 환경에서 Queue는 생산 및 소비의 구조에 필수적인 자료구조이다. 여기서 우리는 BlockingQueue라는 interface를 구현한 객체를 가져다 쓸 수 있다. Block 이라는 것은 먼저 무엇일까? '막는다'는 뜻이다. 그럼 무엇을 막는 다는 것인가? 그것은 바로! Queue가 꽉찼을때의 삽입 시도 / Queue가 비어있을때의 추출 시도 를 막는 다는 것이다. 이 자동으로 '막는' 기능이 있어 BlockingQueue 의 구현체는 모두 Thread-safe 하다. 그럼 이제부터 본격적인 BlockingQueue에 대한 포스팅을 시작한다. 1. ArrayBlockingQueue - 고정배열에 일반적인 Queue를 구현한 클래스, 생성 후 크기변경 불가 - 꽉찼을때 추가 block, 비었..

Programming/C++

C++ 문자열변환

http://devluna.blogspot.kr/2016/01/mfc-c-cstring-stdstring-lpctstr.html?m=1

Programming/C#

Action, Func, Predicate, Task

Action, Func, Predicate 참조 http://www.csharpstudy.com/Tip/Tip-Func.aspx Action, Func, Task 참조 http://devsw.tistory.com/170 7ways to start a Task in .Net http://dotnetcodr.com/2014/01/01/5-ways-to-start-a-task-in-net-c/

Programming

C# Interop 정리

이미 작성되어 있는 C++ 의 코드를 C# 에서 사용하기 위해서는 DLL 라이브러리를 만들고, 이를 C# 에서 import를 해서 사용할 수 있다. 기본적으로 이미 라이브러리로 만들어져 배포되어 있던 것을 사용하려고 할 때에는 별 생각 없이 그에 맞춰서 하려고 했지만, 내가 처음부터 dll 로 라이브러리를 만들고 이를 사용하려고 할때, 워낙 방법이 다양하다 보니.. 정확한 방법은 모르겠지만, 우선 나만의 format을 만들면 좋을 듯 하다. 하려고 할 때마다 늘 헷갈리고, 새로운 문제에 걸려서 힘들어해서.. 이를 정리하고자 한다. 우선 Interop에 대한 기본 방법에 대해서 먼저 익혀 두자. 참고 : http://ccambo.blogspot.kr/2013/01/c-interop-c-c-api.html ..

Programming

프로젝트 실행시 PATH 환경 설정하기.

프로젝트 실행시 PATH 환경 설정하기. Search MSDN for "How to: Set Environment Variables for Projects". (It's Project>Properties>Configuration Properties>Debugging "Environment" and "Merge Environment" properties for those who are in a rush.) The syntax is NAME=VALUE and macros can be used (for example, $(OutDir)). For example, to prepend C:\Windows\Temp to the PATH:PATH=C:\WINDOWS\Temp;%PATH% Similarly, to ap..

Programming/Java

Difference Between newSingleThreadExecutor and newFixedThreadPool

Difference Between newSingleThreadExecutor and newFixedThreadPool(1) Similirity newSingleThreadExecutor returns ExecutorService with single thread worker and newFixedThreadPool(1) also returns ExecutorService with single thread worker. In both case if thread terminates, new thread will be created. Difference ExecutorService returned by newSingleThreadExecutor can never increase its thread pool s..

Programming/Java

List 객체의 final 한정자가 갖는 의미

Java의 final List 객체의 의미는?? final 은 본래 객체의 접근을 변경을 방지하는 한정자로 사용된다. 하지만, List 객체에 있어서는 최초 객체를 생성한 후에 필요에 따라 add, remove 등의 객체 element 변경이 가능하다.. 그럼, List 객체에 있어서 final이 갖는 의미는 무엇인가?? 한번 객체화 시킨 변수에 대해서 다른 참조자를 갖도록 할 수 없다. 즉, reference type의 객체로 한번 지정한 참조에 대한 변경을 허용하지 않는 것이다! 그럼 내부의 element에 대한 변경을 하지 않는 객체를 얻기 위해서는 어떻게 할 수 있을까? 아래 예제의 Nameserver2 를 보면, 기존의 Nameserver 객체를 Collection.unmodifiableList..

RichardBang
'Programming' 카테고리의 글 목록 (8 Page)