전체 글
-
[node] How to double co-routine in promise & loopBackend/NodeJS 2019. 11. 26. 17:06
비동기 작업의 동기화, 코루틴 각 회원들의 프로필과 친구리스트를 회원별로 새로운 객체에 담고 싶을때 co-routine과 promise를 활용하여 DB 작업은 비동기로 처리하고 베이스 루틴은 동기적으로 처리하여 만들어진 객체를 반환한다. 이 작업은 코루틴 안에서 작업을 비동기적으로 하면서, 모든 작업이 완료되었을 때 반환한다. When all jobs are done, this funtion is return and the main tasks are processed asyncronously. const cofunc = bPromise.coroutine(function* () { try { ... const members = yield getMembers();// get DB // [{"id":"", "..
-
[data statistics] Data distributionPrograming/python 2019. 11. 26. 14:10
content: https://datascienceschool.net/view-notebook/69b85ec9afb7415d8da4c8cd5e46d22e/ Data Science School Data Science School is an open space! datascienceschool.net lib: Matplotlib Matplotlib: Python plotting — Matplotlib 3.1.1 documentation Matplotlib is a Python 2D plotting library which produces publication quality figures in a variety of hardcopy formats and interactive environments across..
-
[javascript] histogram modulesPrograming/javascript 2019. 11. 26. 14:01
1.Plotly https://github.com/plotly/plotly.js plotly/plotly.js Open-source JavaScript charting library behind Plotly and Dash - plotly/plotly.js github.com https://plot.ly/javascript/histograms/ Histograms How to make a D3.js-based histogram in JavaScript. Seven examples of colored, horizontal, and normal histogram bar charts. plot.ly 2.d3 https://github.com/d3/d3 d3/d3 Bring data to life with SV..
-
[typescript] histogram algorithmPrograming/javascript 2019. 11. 26. 13:54
LINK const histogram = (data: any, size: number = 1) => { const length = data.length; let min = data[0]; let max = data[1]; data.forEach((item: number) => { if (item max) max = item; }); const bins = Math.ceil((max - min + 1) / size); const histogram = new Array(bins); for (let i = 0; i < bins; i++) histogram[i] = 0; for (let i = 0; i < length; i++) histogram[M..
-
[node] Excel file exportPrograming/javascript 2019. 11. 21. 17:52
I need to get the excel data which is the result of db query. And I've got it successfully by using 'node-excel-export' module. [Source Code] main.js const exportExcel = require('./excel_export').exportExcel; ... function run() { ... const qData = getLogs();// QUERY exportExcel(qData); ... } run(); excel_export.js const excel = require('node-excel-export'); ... const exportExcel = (dataset) => {..
-
[python] Make Korail reservation Macro with telegram botPrograming/python 2019. 11. 12. 21:37
기차를 자주타서 예매를 하다 보면 I often take train, so I always reserve ticket on my phone. 원하는 여정이 매진일 때가 종종 있다. But the journey I want is usually sold out. 그럴때면 새로고침을 하면서 계속 예매 시도를 한다. When that happen, I'll refresh and keep trying to book. 이렇게 해서 실패한적은 없지만 시간과 노동이 소모되어 불편하다. This has never failed, but time and labor are inconvenient. 텔레그램 봇을 이용해서 기차표 예약을 하는 매크로를 만들 수 있다는 글을 보게 되었다. I found out that I can ..