Programming/jquery2019. 6. 4. 14:00

 

$(document).bind("contextmenu", function(event) { 
    event.preventDefault();
    $("<div class='custom-menu'>Custom menu</div>")
        .appendTo("body")
        .css({top: event.pageY + "px", left: event.pageX + "px"});
}).bind("click", function(event) {
    $("div.custom-menu").hide();
});

[링크 : http://jsfiddle.net/andrewwhitaker/fELma/]

  [링크 : https://programmingsummaries.tistory.com/149]

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

jquery ajax delete가 없다?  (0) 2022.09.16
jquery-cookie 라이브러리  (0) 2022.09.05
jquery ajax json flask  (0) 2019.01.07
jquery this 버튼 checked  (0) 2019.01.07
ajax / promise / jquery  (0) 2019.01.04
Posted by 구차니

 

The cose (Compound Spring Embedder) layout uses a physics simulation to lay out graphs. It works well with noncompound graphs and it has additional logic to support compound graphs well.

[링크 : http://js.cytoscape.org/]

 

[링크https://visjs.org/network_examples.html]

[링크http://jsnetworkx.org/]

[링크https://graphalchemist.github.io/Alchemy/#/examples]

[링크https://zoomcharts.com/.../network-graph-nodes-with-custom-thumbnails.html]

'Programming > javascript & HTML' 카테고리의 다른 글

web 렌더러 벤치마크  (0) 2022.12.22
웹에서 f5 갱신 막기  (0) 2019.06.04
HTTP 302 redirect  (0) 2019.04.26
closure  (0) 2019.04.24
iife (Immediately Invoked Function Expression)  (0) 2019.04.23
Posted by 구차니
Programming/node.js2019. 6. 3. 15:39

node.js + chromium으로

웹 앱을 데스크탑 앱으로 변경해주는 녀석으로 보이는 데..

 

어디서 걸핏 보이기에는 atom 에디터 개발하려고 쓴거라고 된거 같기도 하고.. 정체가 머냐?

Built on Electron
Initially developed for GitHub's Atom editor, Electron has since been adopted by companies all over the world.

 

[링크 : https://electronjs.org/]

 

+

[링크 : https://electronjs.org/docs/tutorial/native-file-drag-drop]

[링크 : https://ourcodeworld.com/.../how-to-execute-an-exe-file-system-application-using-electron-framework]

[링크 : https://www.npmjs.com/package/electron-window-manager]

 

 

+

2019.06.04

vscode 도 이걸로 만들어졌다니.. ㄷㄷ

[링크 : https://electronjs.org/apps/visual-studio-code]

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

node.js 용량 제한(?)  (0) 2019.06.18
electron ipc  (0) 2019.06.07
npm-run-all 병렬 빌드 (실패)  (0) 2019.05.29
pdf 내용 추출  (0) 2019.05.27
node.js express 301 redirect  (0) 2019.05.15
Posted by 구차니
Programming/openGL2019. 6. 1. 21:27

답답해서 뜯어보는중 ㅋㅋ

왜 이런 생각을 안했었지?

 

 

근데 본다고 이해할수 있는건 또 별개의 문제네 ㅋㅋㅋ

#define __glPi 3.14159265358979323846

 

void GLAPIENTRY

gluPerspective(GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar)

{

GLdouble m[4][4];

double sine, cotangent, deltaZ;

double radians = fovy / 2 * __glPi / 180;

 

deltaZ = zFar - zNear;

sine = sin(radians);

if ((deltaZ == 0) || (sine == 0) || (aspect == 0)) {

    return;

}

cotangent = COS(radians) / sine;

 

__gluMakeIdentityd(&m[0][0]);

m[0][0] = cotangent / aspect;

m[1][1] = cotangent;

m[2][2] = -(zFar + zNear) / deltaZ;

m[2][3] = -1;

m[3][2] = -2 * zNear * zFar / deltaZ;

m[3][3] = 0;

glMultMatrixd(&m[0][0]);

}

 

void GLAPIENTRY

gluLookAt(GLdouble eyex, GLdouble eyey, GLdouble eyez, GLdouble centerx,

     GLdouble centery, GLdouble centerz, GLdouble upx, GLdouble upy,

     GLdouble upz)

{

float forward[3], side[3], up[3];

GLfloat m[4][4];

 

forward[0] = centerx - eyex;

forward[1] = centery - eyey;

forward[2] = centerz - eyez;

 

up[0] = upx;

up[1] = upy;

up[2] = upz;

 

normalize(forward);

 

/* Side = forward x up */

cross(forward, up, side);

normalize(side);

 

/* Recompute up as: up = side x forward */

cross(side, forward, up);

 

__gluMakeIdentityf(&m[0][0]);

m[0][0] = side[0];

m[1][0] = side[1];

m[2][0] = side[2];

 

m[0][1] = up[0];

m[1][1] = up[1];

m[2][1] = up[2];

 

m[0][2] = -forward[0];

m[1][2] = -forward[1];

m[2][2] = -forward[2];

 

glMultMatrixf(&m[0][0]);

glTranslated(-eyex, -eyey, -eyez);

}

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

glEnable(), glPushAttrib()  (0) 2020.04.04
openGL superbible 3rd ed. 읽기 시작  (0) 2020.04.03
gl glx glu glut 소스코드  (0) 2019.05.31
glulookat / gluperspective / glfrustrum / glortho  (0) 2019.05.30
gl model view projection mat  (0) 2019.05.29
Posted by 구차니
Programming/openGL2019. 5. 31. 19:02

일단은 소스도 분석을 좀 해봐야지 이해가 잘되려나?

 

[링크 : https://www.mesa3d.org/download.html]

[링크 : https://mesa.freedesktop.org/archive/] gl glx

[링크 : http://ftp://ftp.freedesktop.org/pub/mesa/glu/] glu

[링크 : http://ftp://ftp.freedesktop.org/pub/mesa/glut/] glut

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

openGL superbible 3rd ed. 읽기 시작  (0) 2020.04.03
gluPerspective / gluLookat 소스코드  (0) 2019.06.01
glulookat / gluperspective / glfrustrum / glortho  (0) 2019.05.30
gl model view projection mat  (0) 2019.05.29
gluPerspective()  (0) 2019.05.28
Posted by 구차니
Programming/openGL2019. 5. 30. 19:04

다른 유틸리티를 같은 레벨로 봤군...

gluLookAt과 gluPerspective는 카메라를 조작하는 방법인데

glu로 시작하듯 gl Utility 계열이고

gl로 시작하는 glFrustum 과 glOrtho는

프로젝션 뷰를 perspective와 orthogonal로 설정하도록 한다.

 

Name
gluLookAt — define a viewing transformation

C Specification
void gluLookAt( GLdouble eyeX,
  GLdouble eyeY,
  GLdouble eyeZ,
  GLdouble centerX,
  GLdouble centerY,
  GLdouble centerZ,
  GLdouble upX,
  GLdouble upY,
  GLdouble upZ);

[링크 : https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/gluLookAt.xml]

 

Name
gluPerspective — set up a perspective projection matrix

C Specification
void gluPerspective( GLdouble fovy,
  GLdouble aspect,
  GLdouble zNear,
  GLdouble zFar);

[링크 : https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/gluPerspective.xml]

 

Name
glFrustum — multiply the current matrix by a perspective matrix

C Specification
void glFrustum( GLdouble left,
  GLdouble right,
  GLdouble bottom,
  GLdouble top,
  GLdouble nearVal,
  GLdouble farVal);

[링크 : h]ttps://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/glFrustum.xml]

 

Name
glOrtho — multiply the current matrix with an orthographic matrix

C Specification
void glOrtho( GLdouble left,
  GLdouble right,
  GLdouble bottom,
  GLdouble top,
  GLdouble nearVal,
  GLdouble farVal);

[링크 : https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/glOrtho.xml]

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

gluPerspective / gluLookat 소스코드  (0) 2019.06.01
gl glx glu glut 소스코드  (0) 2019.05.31
gl model view projection mat  (0) 2019.05.29
gluPerspective()  (0) 2019.05.28
glfw3 in ubuntu 19.04  (0) 2019.05.10
Posted by 구차니
Programming/node.js2019. 5. 29. 17:56

별다른 설정없이 해서 그런가

아니면 SSHD의 효과로 캐싱이 되서 그런가 속도 단축되지 않네..

 

$ time npm run build

real    0m54.356s
user    1m14.008s
sys     0m1.938s

 

$ time npm-run-all build

real    0m20.614s
user    0m26.791s
sys     0m0.973s

 

$ time npm run build

real    0m20.614s 
user    0m26.791s 
sys     0m0.973s 

 

[링크 : https://www.npmjs.com/package/npm-run-all]

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

electron ipc  (0) 2019.06.07
electron.js  (0) 2019.06.03
pdf 내용 추출  (0) 2019.05.27
node.js express 301 redirect  (0) 2019.05.15
node.js 항목 확인  (0) 2019.04.23
Posted by 구차니
Programming/openGL2019. 5. 29. 08:06

오랫만에 다시 보니 기억이 하나도 안나네.. 큭...

행렬부터 다시 공부해야하나?

 

[링크  : http://www.opengl-tutorial.org/kr/beginners-tutorials/tutorial-3-matrices/]

[링크  : https://solarianprogrammer.com/2013/05/22/opengl-101-matrices-projection-view-model/]

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

gl glx glu glut 소스코드  (0) 2019.05.31
glulookat / gluperspective / glfrustrum / glortho  (0) 2019.05.30
gluPerspective()  (0) 2019.05.28
glfw3 in ubuntu 19.04  (0) 2019.05.10
openGL vao(Vertex Array Object)  (0) 2019.05.07
Posted by 구차니
Programming/openGL2019. 5. 28. 19:04

오랫만에 다시 공부하게 되네 후..

일단 위의 함수는 z값에 대한 Near와 Far 값이 존재하는데

둘다 양수여야 하고 0 이상의 값을 가져야 한다.

(그걸 모르고 예전엔 0을 넣고 왜 안되는 거야! 하고 있었으니..)

zNear

Specifies the distance from the viewer to the near clipping plane (always positive).

zFar

Specifies the distance from the viewer to the far clipping plane (always positive).

Notes

Depth buffer precision is affected by the values specified for zNear and zFar. The greater the ratio of zFar to zNear is, the less effective the depth buffer will be at distinguishing between surfaces that are near each other. If

r = zFar zNear

roughly log 2  r bits of depth buffer precision are lost. Because r approaches infinity as zNear approaches 0, zNear must never be set to 0.

[링크 : https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/gluPerspective.xml]

 

실제코드인진 모르겠지만

znear가 0 이면, ymax xmax가 다 0이 되네

// Matrix will receive the calculated perspective matrix.
// You would have to upload to your shader
// or use glLoadMatrixf if you aren't using shaders.
void glhPerspectivef2(float *matrix, float fovyInDegrees, float aspectRatio,
                      float znear, float zfar)
{
    float ymax, xmax;
    float temp, temp2, temp3, temp4;
    ymax = znear * tanf(fovyInDegrees * M_PI / 360.0);
    // ymin = -ymax;
    // xmin = -ymax * aspectRatio;
    xmax = ymax * aspectRatio;
    glhFrustumf2(matrix, -xmax, xmax, -ymax, ymax, znear, zfar);
}

 

DIV/0의 향연이니.. 아마 입력 단계에서 zNear / nFar가 0이면 계산을 하지 않도록 할지도?

void glhFrustumf2(float *matrix, float left, float right, float bottom, float top,
                  float znear, float zfar)
{
    float temp, temp2, temp3, temp4;
    temp = 2.0 * znear;
    temp2 = right - left;
    temp3 = top - bottom;
    temp4 = zfar - znear;
    matrix[0] = temp / temp2;
    matrix[1] = 0.0;
    matrix[2] = 0.0;
    matrix[3] = 0.0;
    matrix[4] = 0.0;
    matrix[5] = temp / temp3;
    matrix[6] = 0.0;
    matrix[7] = 0.0;
    matrix[8] = (right + left) / temp2;
    matrix[9] = (top + bottom) / temp3;
    matrix[10] = (-zfar - znear) / temp4;
    matrix[11] = -1.0;
    matrix[12] = 0.0;
    matrix[13] = 0.0;
    matrix[14] = (-temp * zfar) / temp4;
    matrix[15] = 0.0;
}

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

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

glulookat / gluperspective / glfrustrum / glortho  (0) 2019.05.30
gl model view projection mat  (0) 2019.05.29
glfw3 in ubuntu 19.04  (0) 2019.05.10
openGL vao(Vertex Array Object)  (0) 2019.05.07
glfw - gl framework  (0) 2019.05.07
Posted by 구차니
Programming/node.js2019. 5. 27. 12:28

pdf 읽어오고 변환하는건 python이나 node.js 그리고 java 등에 모두 존재는 하는 듯

그래도 라이센스가 문제인데..

 

[링크 : https://pdfbox.apache.org/]

[링크 : https://www.tutorialkart.com/pdfbox/extract-text-line-by-line-from-pdf/]

 

[링크 : https://itextpdf.com/en]

[링크 : https://stackoverflow.com/questions/4028240/extract-columns-of-text-from-a-pdf-file-using-itext]

 

[링크 : https://www.npmjs.com/package/pdfreader]

[링크 : https://www.npmjs.com/package/pdf-lib]

 

[링크 : http://www.unixuser.org/~euske/python/pdfminer/]

PDFMiner 모듈은 Python 2 버젼에서만 사용 가능

[링크 : https://dgkim5360.tistory.com/entry/python-pdfminer-convert-pdf-to-html-txt]

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

electron.js  (0) 2019.06.03
npm-run-all 병렬 빌드 (실패)  (0) 2019.05.29
node.js express 301 redirect  (0) 2019.05.15
node.js 항목 확인  (0) 2019.04.23
proxy error: Error: write after end  (0) 2019.04.23
Posted by 구차니