'Programming'에 해당되는 글 1789건

  1. 2018.11.26 d3 온도/습도 그래프
  2. 2018.11.26 node.js sqlite3
  3. 2018.11.26 javascript 변수 정확도
  4. 2018.11.25 node.js xml <-> json
  5. 2018.11.23 node.js mysql blob
  6. 2018.11.21 js object array sort by key
  7. 2018.11.21 d3 multi line graph
  8. 2018.11.21 wavesurfer.js 그리고 HE-AACv2
  9. 2018.11.21 requireJS
  10. 2018.11.21 sqlite for node.js
Programming/d32018. 11. 26. 13:13

서로 다른 계열의 데이터를 출력하는 방법을 찾는 중..


[링크 : https://github.com/LonnyGomes/attic-temperature-graph]



+

2018.12.21


[링크 : http://blog.fraggod.net/2016/08/05/d3-chart-for-common-temperaturerh-time-series-data.html[

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

d3 double line graph  (0) 2018.12.21
d3 axis  (0) 2018.11.27
d3 multi line graph  (0) 2018.11.21
d3.time.format  (0) 2018.11.21
d3 pie 칸색 바꾸기  (0) 2018.11.15
Posted by 구차니
Programming/node.js2018. 11. 26. 10:14

win10에 sqlite3 모듈을 써서 먼가 하려는데 안되서 찾아보니.. 걍 깔면됨 ㅋ


$ npm install


> sqlite3@4.0.4 install D:\work2\hjelec_tf\node\node_modules\sqlite3

> node-pre-gyp install --fallback-to-build


'node-pre-gyp'은(는) 내부 또는 외부 명령, 실행할 수 있는 프로그램, 또는

배치 파일이 아닙니다.

npm ERR! code ELIFECYCLE

npm ERR! errno 1

npm ERR! sqlite3@4.0.4 install: `node-pre-gyp install --fallback-to-build`

npm ERR! Exit status 1

npm ERR!

npm ERR! Failed at the sqlite3@4.0.4 install script.

npm ERR! This is probably not a problem with npm. There is likely additional logging output above. 



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

[링크 : https://github.com/mapbox/node-pre-gyp]



+

sqlite-sync는 sqlite3 와는 API 구조가 많이 다르네..

[링크 : https://www.npmjs.com/package/sqlite-sync]

[링크 : https://github.com/JayrAlencar/sqlite-sync.js/wiki]

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

waveform-data.js  (0) 2018.11.30
node.js 혹은 sqlite?  (0) 2018.11.26
node.js xml <-> json  (0) 2018.11.25
node.js mysql blob  (0) 2018.11.23
sqlite for node.js  (0) 2018.11.21
Posted by 구차니

어쩌면 당연한건데.. 먼가 생소하게만 느껴지는 녀석



The maximum number of decimals is 17, but floating point arithmetic is not always 100% accurate:

Example

var x = 0.2 + 0.1;         // x will be 0.30000000000000004 

[링크 : https://www.w3schools.com/js/js_numbers.asp]

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

HTML border style 지정  (0) 2018.11.30
브라우저 닫기, 창 이동시 이벤트  (0) 2018.11.30
js object array sort by key  (0) 2018.11.21
wavesurfer.js 그리고 HE-AACv2  (0) 2018.11.21
requireJS  (0) 2018.11.21
Posted by 구차니
Programming/node.js2018. 11. 25. 18:56

에어 코리아 API 한번 발급받아 볼까 하는데

기술문서를 보니 XML과 JSON으로 된다고 해서 검색..

[링크 : https://www.data.go.kr/dataset/15000581/openapi.do]



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

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

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

node.js 혹은 sqlite?  (0) 2018.11.26
node.js sqlite3  (0) 2018.11.26
node.js mysql blob  (0) 2018.11.23
sqlite for node.js  (0) 2018.11.21
node.js swagger  (0) 2018.11.12
Posted by 구차니
Programming/node.js2018. 11. 23. 10:52

mysql.escape()

[링크 : https://stackoverflow.com/.../er-parse-error-on-node-mysql-when-inserting-multiple-values]


timestamp는 CURRENT_TIMESTAMP 로 설정시 자동으로 입력됨

[링크 : https://blog.naver.com/star_breeze/220534943357]



이것저것 해보는데.. new Buffer().toString()이 유효했다!

$ node

> var tt = [39,91,92,39,105,110,112,117,116,35,115,101,108,95,48,95,49,92,39,44,92,39,105,110,112,117,116,35,115,101,108,95,48,95,51,92,39,44,92,39,105,110,112,117,116,35,115,101,108,95,48,95,53,92,39,93,39]

undefined

> var buffer = new Buffer(tt)

undefined

> buffer

<Buffer 27 5b 5c 27 69 6e 70 75 74 23 73 65 6c 5f 30 5f 31 5c 27 2c 5c 27 69 6e 70 75 74 23 73 65 6c 5f 30 5f 33 5c 27 2c 5c 27 69 6e 70 75 74 23 73 65 6c 5f ... >

> buffer.toString('base64')

'J1tcJ2lucHV0I3NlbF8wXzFcJyxcJ2lucHV0I3NlbF8wXzNcJyxcJ2lucHV0I3NlbF8wXzVcJ10n'

> var buffer = new Buffer(tt, 'binary')

undefined

> buffer.toString('base64')

'J1tcJ2lucHV0I3NlbF8wXzFcJyxcJ2lucHV0I3NlbF8wXzNcJyxcJ2lucHV0I3NlbF8wXzVcJ10n'

> tt.toString('utf-8')

'39,91,92,39,105,110,112,117,116,35,115,101,108,95,48,95,49,92,39,44,92,39,105,110,112,117,116,35,115,101,108,95,48,95,51,92,39,44,92,39,105,110,112,117,116,35,115,101,108,95,48,95,53,92,39,93,39'

> buffer.toString('utf-8')

'\'[\\\'input#sel_0_1\\\',\\\'input#sel_0_3\\\',\\\'input#sel_0_5\\\']\'' 

> new Buffer(tt).toString(

... 'utf-8')

'\'[\\\'input#sel_0_1\\\',\\\'input#sel_0_3\\\',\\\'input#sel_0_5\\\']\''

> new Buffer(tt).toString()

'\'[\\\'input#sel_0_1\\\',\\\'input#sel_0_3\\\',\\\'input#sel_0_5\\\']\''


[링크 : https://stackoverflow.com/questions/9042327/node-js-reading-blob-from-mysql]

[링크 : https://gist.github.com/akirattii/86e2eda8e110976cce144c991e9cada8]


그나저나 escape의 향연 어쩔꺼야...



+

mysql에 BLOB 타입으로 JSON을 저장하면 

node.js에서는 아래와 같이 Buffer에다가 값을 넣고 toString() 으로 문자열로 바꾸어준 다음

mysql.escape()를 통해 \" 식으로 된걸 원래대로 돌려주어야 한다.


server-side(node.js)

mysql.escape(new Buffer(row.element).toString("utf-8")); 


그리고 받는 쪽에서는 JSON이 아닌 일반 plain-text니까

JSON.parse를 통해서 JSON으로 변환해 주어야 한다.(eval은 빼도 되는지 확인 필요)


client-side(chrome, web browser)

JSON.parse(eval(data.json));


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

node.js sqlite3  (0) 2018.11.26
node.js xml <-> json  (0) 2018.11.25
sqlite for node.js  (0) 2018.11.21
node.js swagger  (0) 2018.11.12
node.js axios delete에 body 쓰기  (0) 2018.11.12
Posted by 구차니



[링크 : https://stackoverflow.com/questions/5467129/sort-javascript-object-by-key/31102605]


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

브라우저 닫기, 창 이동시 이벤트  (0) 2018.11.30
javascript 변수 정확도  (0) 2018.11.26
wavesurfer.js 그리고 HE-AACv2  (0) 2018.11.21
requireJS  (0) 2018.11.21
[Violation] 'setInterval' handler took  (0) 2018.11.18
Posted by 구차니
Programming/d32018. 11. 21. 19:06


[링크 : https://beta.observablehq.com/@mbostock/d3-multi-line-chart]


d3.v4

d3.line 

[링크 : https://bl.ocks.org/d3noob/4db972df5d7efc7d611255d1cc6f3c4f]

[링크 : https://codepen.io/zakariachowdhury/pen/JEmjwq]



d3 3.5.3

[링크 : https://bl.ocks.org/larsenmtl/e3b8b7c2ca4787f77d78f58d41c3da91]


+ 2018.11.22

[링크 : http://bl.ocks.org/hunzy/11110940] grid

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

d3 axis  (0) 2018.11.27
d3 온도/습도 그래프  (0) 2018.11.26
d3.time.format  (0) 2018.11.21
d3 pie 칸색 바꾸기  (0) 2018.11.15
d3 update 두번째 검색내용..  (0) 2018.11.15
Posted by 구차니

크롬에서는 HE-AACv2를 지원하지 않는건가? edge는 되는데 머야...

Uncaught (in promise) DOMException: Unable to decode audio data


[링크 : https://bugs.chromium.org/p/chromium/issues/detail?id=409402]

[링크 : https://bugs.chromium.org/p/chromium/issues/detail?id=534301]

[링크 : https://github.com/katspaugh/wavesurfer.js/issues/703]

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

javascript 변수 정확도  (0) 2018.11.26
js object array sort by key  (0) 2018.11.21
requireJS  (0) 2018.11.21
[Violation] 'setInterval' handler took  (0) 2018.11.18
JSON.stringify() 주의사항(?)  (0) 2018.11.17
Posted by 구차니

node.js 예제를 보다 보면

분명히(?) client side인데 require가 있어서 보는 중..

require.js로 JS들을 조건부 load 할 수 있다고 하는데...

[링크 : https://requirejs.org/docs/commonjs.html]


AMD는 Asynchronous Module Definition (비동기 모듈 정의) 규칙이다.

[링크 : https://blog.pigno.se/post/157992405313]



// EITHER - accessing modules with <script> tags

var WaveSurfer = window.WaveSurfer;

var TimelinePlugin = window.WaveSurfer.timeline;

var MinimapPlugin = window.WaveSurfer.minimap;


// OR - importing as es6 module

import WaveSurfer from 'wavesurfer.js';

import TimelinePlugin from 'wavesurfer.js/dist/plugin/wavesurfer.timeline.min.js';

import MinimapPlugin from 'wavesurfer.js/dist/plugin/wavesurfer.minimap.min.js';


// OR - importing as require.js/commonjs modules

var WaveSurfer = require('wavesurfer.js');

var TimelinePlugin = require('wavesurfer.js/dist/plugin/wavesurfer.timeline.min.js');

var MinimapPlugin = require('wavesurfer.js/dist/plugin/wavesurfer.minimap.min.js');


// ... initialising waveform with plugins

var wavesurfer = WaveSurfer.create({

    container: '#waveform',

    waveColor: 'violet',

    plugins: [

        TimelinePlugin.create({

            container: '#wave-timeline'

        }),

        MinimapPlugin.create()

    ]

}); 


[링크 : https://wavesurfer-js.org/doc/]

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

js object array sort by key  (0) 2018.11.21
wavesurfer.js 그리고 HE-AACv2  (0) 2018.11.21
[Violation] 'setInterval' handler took  (0) 2018.11.18
JSON.stringify() 주의사항(?)  (0) 2018.11.17
canvas to input type=file formdata  (0) 2018.11.15
Posted by 구차니
Programming/node.js2018. 11. 21. 15:56

sqlite3 패키지를 설치한다.


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

[링크 : https://github.com/mapbox/node-sqlite3]

[링크 : http://www.sqlitetutorial.net/sqlite-nodejs/]

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

node.js xml <-> json  (0) 2018.11.25
node.js mysql blob  (0) 2018.11.23
node.js swagger  (0) 2018.11.12
node.js axios delete에 body 쓰기  (0) 2018.11.12
mysql jwt plain object payload  (0) 2018.11.09
Posted by 구차니