본문 바로가기

Programming68

Numpy arrary 구조 이해하기 좋은 설명이 있어서 가져옴.. https://stackoverflow.com/questions/22053050/difference-between-numpy-array-shape-r-1-and-r 1. The meaning of shapes in NumPyYou write, "I know literally it's list of numbers and list of lists where all list contains only a number" but that's a bit of an unhelpful way to think about it.The best way to think about NumPy arrays is that they consist of two parts, a data buffer whic.. 2018. 9. 5.
[javascript, ajax] read and parse csv file on server 클라이언트에서 업로드 하는것이 아니라, server에 있는 파일을 업로드 하는게 트릭이 아니면 쉽지 않다. ajax라는 것을 사용. parse는 여러가지 라이브러리가 많은데. https://github.com/evanplaice/jquery-csv을 사용 전체 코드 12345678910111213141516171819202122232425262728293031323334 function read_with_ajax(url,fun,holder){//url,function,just a placeholder holder=new XMLHttpRequest; holder.open('GET',url); holder.onload=fun; holder.send() } function alertTxt(){ //alert(.. 2018. 4. 10.
[python] thread mangement 파이썬에서 여러개의 쓰레드를 만질때 Thread안에서 새로운 Thread를 돌리면 부모쓰레드의 특정 지점에서 자식쓰레드를 만들고, 자식쓰레드가 도는 동안 부모 쓰레드는 진행되지 않는다. 그래서 당연히 이렇게 하면 안된다. Thread는 똑같은 부모수준에서 만들어 놓고 순서는 locking방법을 이용해서 해야한다. https://docs.python.org/2/library/threading.html http://www.laurentluce.com/posts/python-threads-synchronization-locks-rlocks-semaphores-conditions-events-and-queues/comment-page-1/ 두번째 링크에 개념과 예제가 잘 설명 되어있다. 난 semaphore 사.. 2014. 6. 27.
check the file is used by another process or not [windows] #include #include "windows.h" #include #include #include using namespace std; class File_locker { HANDLE file_handle; static const int MAX_TRIES = 10; static const int SLEEP_INTERVAL = 500; public: File_locker(std::string filename) { // you can use GetLastError() to determine why the open failed, // but this is a demo, not production code for (int i = 0; i < MAX_TRIES; ++i) { file_handle = ::Cre.. 2014. 3. 13.