'Programming'에 해당되는 글 1711건

  1. 2018.08.07 typescript - ts 2
  2. 2018.05.29 엔디안 급 멘붕..
  3. 2018.05.03 php 개발환경 10
  4. 2018.04.25 openGL Stereoscopic
  5. 2018.04.25 openGL cardboard lens distortion
  6. 2018.04.25 OpenCV 분산처리
  7. 2018.04.16 verilog UDP
  8. 2018.04.12 Verilog initial 1
  9. 2018.04.10 Verilog =, ==, ===
  10. 2018.04.04 pypy
Programming/node.js2018. 8. 7. 17:11

MS에서 유지하는 듯

2012년 릴리즈 하였고

일종의 typescript는 metadata로

typescript를 컴파일하여 javascript를 만들어 내는 방식으로 사용하는 것으로 보인다.

angular 2 자체가 typescript로 되어 있다는데

반대로 생각하면 ms 가 아니어도 angular가 구동하는데 문제없다..

이러한 조금은(?) 충격적인 결과가 나오는구나...


[링크 : https://en.wikipedia.org/wiki/TypeScript]

[링크 : http://han41858.tistory.com/14]

'Programming > node.js' 카테고리의 다른 글

node.js와 웹소켓  (0) 2018.09.03
node.js 와 v8  (0) 2018.08.29
node.js odroid  (0) 2018.08.29
node.js refresh  (0) 2018.08.17
html5 / css3 / jquey ajax / angularJS  (0) 2018.08.08
Posted by 구차니
Programming/C Win32 MFC2018. 5. 29. 11:39

갑자기 little endian인 x86 시스템에서

어떤식으로 Shift 연산자가 작동하는지 멘붕..


엔디안은 메모리에 저장하는 것이기에..

혹시 레지스터는 빅 엔디안으로 구현되는건가?

근데 수업 시간 기억으로는.. little endian이라 자릿수 늘어나도 처리가 부담없다고

그렇게 배운거 봐서는 adder도 모두 little endian인거 같긴한데..

블랙박스 부분이라 알수가 없네..


아무튼.. C 언어 레벨에서는 논리적으로는 big endian으로 처리하고

변환할 때 반대로 구현해줄줄 알았는데 그것도 아니고..(그냥 right는 SAR SHR로 구현)

도대체 어떻게 처리하는건지 알수가 없다.. ㅠㅠ


[링크 : https://code.i-harness.com/ko/q/5c375b]

[링크 : https://www.joinc.co.kr/w/Site/Network_Programing/Documents/endian]


[링크 : https://msdn.microsoft.com/ko-kr/library/336xbhcz.aspx?f=255&MSPPError=-2147217396]

[링크 : https://blogs.msdn.microsoft.com/.../hello-arm-exploring-undefined-unspecified-and-implementation-defined-behavior-in-c/]


[링크 : https://stackoverflow.com/questions/7184789/does-bit-shift-depend-on-endianness]

[링크 : https://stackoverflow.com/questions/1041554/bitwise-operators-and-endianness/1041573]


[링크 : https://www.ibm.com/developerworks/aix/library/au-endianc/index.html]


1235 page

Description

 Shifts the bits in the first operand (destination operand) to the left or right by the number of bits specified in the second operand (count operand). Bits shifted beyond the destination operand boundary are first shifted into the CF flag, then discarded. At the end of the shift operation, the CF flag contains the last bit shifted out of the destination operand. The destination operand can be a register or a memory location. The count operand can be an immediate value or the CL register. The count is masked to 5 bits (or 6 bits if in 64-bit mode and REX.W is used). The count range is limited to 0 to 31 (or 63 if 64-bit mode and REX.W is used). A special opcode encoding is provided for a count of 1. The shift arithmetic left (SAL) and shift logical left (SHL) instructions perform the same operation; they shift the bits in the destination operand to the left (toward more significant bit locations). For each shift count, the most significant bit of the destination operand is shifted into the CF flag, and the least significant bit is cleared (see Figure 7-7 in the Intel® 64 and IA-32 Architectures Software Developer’s Manual, Volume 1).

 The shift arithmetic right (SAR) and shift logical right (SHR) instructions shift the bits of the destination operand to the right (toward less significant bit locations). For each shift count, the least significant bit of the destination operand is shifted into the CF flag, and the most significant bit is either set or cleared depending on the instruction type. The SHR instruction clears the most significant bit (see Figure 7-8 in the Intel® 64 and IA-32 Architectures Software Developer’s Manual, Volume 1); the SAR instruction sets or clears the most significant bit to correspond to the sign (most significant bit) of the original value in the destination operand. In effect, the SAR instruction fills the empty bit position’s shifted value with the sign of the unshifted value (see Figure 7-9 in the Intel® 64 and IA-32 Architectures Software Developer’s Manual, Volume 1). 

[링크 : https://www.intel.com/.../64-ia-32-architectures-software-developer-instruction-set-reference-manual-325383.pdf]



case 4:

packet[4] = (val >> 24) & 0xFF;

0115687B  mov         ebx,ecx  

0115687D  sar         ebx,18h  

01156880  mov         byte ptr [edi+4],bl  

packet[5] = (val >> 16) & 0xFF;

01156883  mov         ebx,ecx  

01156885  sar         ebx,10h  

01156888  mov         byte ptr [edi+5],bl  

packet[6] = (val >> 8) & 0xFF;

0115688B  mov         ebx,ecx  

0115688D  sar         ebx,8  

01156890  mov         byte ptr [edi+6],bl  

packet[7] = (val) & 0xFF;

01156893  mov         byte ptr [edi+7],cl  

break;

01156896  jmp         $LN11+54h (11568A8h)  

break; 

흐음... 어렵다...

'Programming > C Win32 MFC' 카테고리의 다른 글

c언어용 JSON 라이브러리 목록  (0) 2018.10.23
uuid in c  (0) 2018.10.22
const char *과 char * const 차이  (0) 2018.01.31
소스 코드 포맷 적용하기  (0) 2018.01.08
win32 시리얼 통신 LPCTSTR / LPCSTR  (0) 2017.12.07
Posted by 구차니
Programming/php2018. 5. 3. 23:06

eclipse가 가장 좋다고 하는데

GUI가 있는거라면 sublime이던 atom이던 notepad++던 상관없지만

그게 아니라면 vim 외에는 딱히 방법이 없어 보이기도 한다

(자동 완성을 어떻게 써먹어 봐야 하려나?)


그게 아니라면 멀티플랫폼 지원하는

eclipse가 역시 정답인가..


[링크 : http://tocomo.tistory.com/4] 윈도우 eclipse + xampp

[링크 : http://plog7.tistory.com/entry/우분투PDT-Eclipse-PHP개발환경] 우분투  apache + eclipse 설정

'Programming > php' 카테고리의 다른 글

php exit()  (0) 2017.07.24
PHP session_start(): Cannot send session cookie 경고 해결방법  (0) 2017.07.23
php 명령줄 실행에 post / get 인자 넘기기  (0) 2017.07.23
캐시 제어  (0) 2017.07.23
php session_destroy  (0) 2017.06.10
Posted by 구차니
Programming/openGL2018. 4. 25. 09:56

어디였나.. 뷰포트로 두개 하면 된다고 하는데

예전에 내가 스테레오 비전 만든것도 뷰포트였나? 기억이 안나네..


GLvoid display(GLvoid)

{

  glDrawBuffer(GL_BACK);                                   //draw into both back buffers

  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);      //clear color and depth buffers


  glDrawBuffer(GL_BACK_LEFT);                              //draw into back left buffer

  glMatrixMode(GL_MODELVIEW);

  glLoadIdentity();                                        //reset modelview matrix

  gluLookAt(-IOD/2,                                        //set camera position  x=-IOD/2

            0.0,                                           //                     y=0.0

            0.0,                                           //                     z=0.0

            0.0,                                           //set camera "look at" x=0.0

            0.0,                                           //                     y=0.0

            screenZ,                                       //                     z=screenplane

            0.0,                                           //set camera up vector x=0.0

            1.0,                                           //                     y=1.0

            0.0);                                          //                     z=0.0

  

  glPushMatrix();

  {

    glTranslatef(0.0, 0.0, depthZ);                        //translate to screenplane

    drawscene();

  }

  glPopMatrix();


  glDrawBuffer(GL_BACK_RIGHT);                             //draw into back right buffer

  glMatrixMode(GL_MODELVIEW);

  glLoadIdentity();                                        //reset modelview matrix

  gluLookAt(IOD/2, 0.0, 0.0, 0.0, 0.0, screenZ,            //as for left buffer with camera position at:

            0.0, 1.0, 0.0);                                //                     (IOD/2, 0.0, 0.0)


  glPushMatrix();

  {

    glTranslatef(0.0, 0.0, depthZ);                        //translate to screenplane

    drawscene();

  }

  glPopMatrix();

  

  glutSwapBuffers();

[링크 : http://www.orthostereo.com/geometryopengl.html]


The default framebuffer contains up to 4 color buffers, named GL_FRONT_LEFT, GL_BACK_LEFT, GL_FRONT_RIGHT, and GL_BACK_RIGHT. The left and right buffers are used for stereoscopic rendering

[링크 : https://www.khronos.org/opengl/wiki/Default_Framebuffer]



glulookat 쓴거 보면 맞는 듯?

기본 컨셉은 비슷한데 위에 예제는 openGL에서 스테레오 스코픽 지원 기능을 쓰고 있는 거군

void display(void)

{

glClear(GL_COLOR_BUFFER_BIT);


glMatrixMode(GL_MODELVIEW); //GL_PROJECTION

glPushMatrix();

glViewport(0, 0, 250, 250); 

gluLookAt(0.10, 0.0, 0.2, 0.0, 0.0, -2.0, 0.0, 1.0, 0.0);

draw_sin();

glPopMatrix();


glPushMatrix();

glViewport(250, 0, 250, 250); 

gluLookAt(0.2, 0.0, 0.2, 0.0, 0.0, -2.0, 0.0, 1.0, 0.0);

draw_sin();

glPopMatrix();


glutSwapBuffers();

2011/10/08 - [Programming/openGL] - openGL의 미스테리...

'Programming > openGL' 카테고리의 다른 글

glfw - gl framework  (0) 2019.05.07
openGL 3.0 tutorial  (0) 2019.05.07
openGL cardboard lens distortion  (0) 2018.04.25
glxgears 소스  (0) 2016.09.07
opencv opengl  (0) 2016.02.26
Posted by 구차니
Programming/openGL2018. 4. 25. 09:52

구글 카드보드 같은거 써서 보려면

영상을 왜곡해야 하는데(왜곡이란 단어부터 생각이 안남... ㅠㅠ)



[링크 : https://stackoverflow.com/questions/44489686/camera-lens-distortion-in-opengl]

[링크 : http://smus.com/vr-lens-distortion/]

[링크 : https://www.opengl.org/discussion_boards/showthread.php/197596-Pincushion-Distortion-with-a-Camera]


+

[링크 : https://github.com/googlevr/gvr-android-sdk/.../videoplayer/VideoScene.java]

[링크 : https://github.com/googlevr/gvr-android-sdk/.../videoplayer/VideoSceneRenderer.java]

[링크 : http://www.freevr.org/downloads.html]

[링크 : https://arm-software.github.io/vr-sdk-for-android/IntroductionToStereoRendering.html] <<<

https://support.google.com/cardboard/manufacturers/answer/6324808?hl=en

'Programming > openGL' 카테고리의 다른 글

openGL 3.0 tutorial  (0) 2019.05.07
openGL Stereoscopic  (0) 2018.04.25
glxgears 소스  (0) 2016.09.07
opencv opengl  (0) 2016.02.26
opengl camera의 이해  (0) 2016.02.02
Posted by 구차니
Programming/openCV2018. 4. 25. 08:44

Odroid U3를 두개 묶어 놓다 보니 든 생각..

한대에서 영상 두개를 받고(USB로)

그 이미지중 하나(그러니까 사람으로 치면 오른눈-오른눈잡이)를 본인이 처리하고

다른쪽 영상 하나를 다른 시스템으로 넘겨서 처리하거나


아니면 각각 하나의 영상을 받아서

처리 결과만 다른쪽으로 넘겨주면 어떨까?


적고 보니 후자가 더 안정적일 수도 있겠네


[링크 : http://pachyderm.readthedocs.io/en/latest/getting_started/beginner_tutorial.html]

'Programming > openCV' 카테고리의 다른 글

opencv cannyedge  (0) 2019.01.16
opencv 원 추정  (0) 2019.01.16
openCV release mode와 debug mode 속도 차이  (0) 2018.03.19
openCV multicore support  (0) 2018.03.19
stitch / opencv / python  (0) 2016.07.18
Posted by 구차니
Programming/Verilog2018. 4. 16. 13:53

User Defined Primitive 의 약자인데

(UDP는.. TCP/IP 친구 아님 ㅋ 얜 User Datagram Protocol)


UDP는 primitive가 들어가듯

AND OR 같은 근원적인 게이트를 사용자가 지정하는 것이다.


그래서 문법이 미묘하게 다른데

module 대신 primitive로 선언하고


table - endtable에서 

input에 대한 output을 정의한다.


  1. primitive compare(out, in1, in2);
  2. output out;
  3. input in1,in2;
  4.  
  5. table
  6. // in1 in2 : out
  7. 0 0 : 1;
  8. 0 1 : 0;
  9. 1 0 : 0;
  10. 1 1 : 1;
  11. endtable
  12. endprimitive

[링크 : http://referencedesigner.com/tutorials/verilog/verilog_11.php]

[링크 : http://hizino.tistory.com/entry/Verilog-UDP-userdefined-primitve]


단, 10개 입력에 1개의 출력에 한해서만 사용이 가능하며

양방향 포트에 대해서는 선언이 불가능하다(그러니까 AND,OR 게이트 같은 단방향, 출력 1개인 녀석 정의)

UDP ports rules


  • An UDP can contain only one output and up to 10 inputs.
  • Output port should be the first port followed by one or more input ports.
  • All UDP ports are scalar, i.e. Vector ports are not allowed.
  • UDPs can not have bidirectional ports.
  • The output terminal of a sequential UDP requires an additional declaration as type reg.
  • It is illegal to declare a reg for the output terminal of a combinational UDP

[링크 : http://www.asic-world.com/verilog/udp1.html]

[링크 : http://verilog.renerta.com/source/vrg00055.htm]



근데 그러고 보니.. UDP와 module의 차이가 멀까?

LUT를 통해 구현하는 현대 FPGA의 특성을 100% 사용하기 위한 구문이라서

구현에 있어서 단일 LUT를 소모하냐 아니면 LE를 소모하냐의 차이가 있는 걸려나?

'Programming > Verilog' 카테고리의 다른 글

Verilog initial  (1) 2018.04.12
Verilog =, ==, ===  (0) 2018.04.10
Verilog HDL, paramter 와 module, 그리고 delay  (0) 2018.03.03
encrypted Verilog  (0) 2018.02.03
verilog module instantiate  (0) 2018.01.26
Posted by 구차니
Programming/Verilog2018. 4. 12. 18:47

개발환경에 따라 다르지만

무시하거나

reset 루틴으로 구현해주거나

(대부분은 시뮬레이션으로만 쓰이고, 무시하는 쪽으로 보임)


[링크 : http://wiki.vctec.co.kr/devboard/fpga/spartan-3a-fpga-gaebalbodeu--elbert/simulation]

[링크 : https://stackoverflow.com/questions/26704552/going-back-to-initial-statement-on-reset-in-verilog]

[링크 : http://referencedesigner.com/blog/verilog-initial-block-synthesis/2396/]

[링크 : http://www.edaboard.com/showthread.php?t=53205]

'Programming > Verilog' 카테고리의 다른 글

verilog UDP  (0) 2018.04.16
Verilog =, ==, ===  (0) 2018.04.10
Verilog HDL, paramter 와 module, 그리고 delay  (0) 2018.03.03
encrypted Verilog  (0) 2018.02.03
verilog module instantiate  (0) 2018.01.26
Posted by 구차니
Programming/Verilog2018. 4. 10. 20:58

'Programming > Verilog' 카테고리의 다른 글

verilog UDP  (0) 2018.04.16
Verilog initial  (1) 2018.04.12
Verilog HDL, paramter 와 module, 그리고 delay  (0) 2018.03.03
encrypted Verilog  (0) 2018.02.03
verilog module instantiate  (0) 2018.01.26
Posted by 구차니

예전에 적은게 있나 모르겠다만

그냥 생각나서 라즈베리에서 쳐보니까

기본으로 패키지 통합된 듯


pi@raspberrypi:~ $ python

Python 2.7.9 (default, Sep 17 2016, 20:26:04)

[GCC 4.9.2] on linux2

Type "help", "copyright", "credits" or "license" for more information.

>>> exit() 


pi@raspberrypi:~ $ pypy

Python 2.7.10 (4.0.1+dfsg-1+rpi1, Mar 07 2016, 10:36:18)

[PyPy 4.0.1 with GCC 4.9.2] on linux2

Type "help", "copyright", "credits" or "license" for more information.

>>>> exit() 


pi@raspberrypi:~ $ which python

/usr/bin/python

pi@raspberrypi:~ $ which pypy

/usr/bin/pypy

pi@raspberrypi:~ $ ll /usr/bin/pypy

lrwxrwxrwx 1 root root 22 Mar  8  2016 /usr/bin/pypy -> ../lib/pypy/bin/pypy-c

pi@raspberrypi:~ $ ll /usr/lib/pypy/bin

total 32604

drwxr-xr-x 2 root root     4096 Nov 26  2016 .

drwxr-xr-x 8 root root     4096 Nov 26  2016 ..

-rwxr-xr-x 1 root root 33374512 Mar  8  2016 pypy-c


'Programming > python(파이썬)' 카테고리의 다른 글

python + openGL  (0) 2019.04.30
python + openCV 공부 시작  (0) 2019.04.30
파이썬 print가 희한하네..  (0) 2017.04.02
파이썬 리스트(list)와 튜플(tuple)  (0) 2017.04.02
파이썬 type 확인하기  (0) 2017.04.02
Posted by 구차니