'Programming'에 해당되는 글 1762건

  1. 2018.12.14 js __proto__
  2. 2018.12.14 node-red 자동시작 관련
  3. 2018.12.11 node.js express static
  4. 2018.12.11 node.js sso
  5. 2018.12.10 w3c validator
  6. 2018.12.09 jquery draggable
  7. 2018.12.08 node.js rpi gpio
  8. 2018.12.07 미세먼지 크롤러 (다음, 네이버)
  9. 2018.12.07 canvas dataURL to Formdata(file)
  10. 2018.12.07 node.js url encoding(?) 혹은 이스케이프

자바 스크립트는 프로토타입 언어라고 한다..(아니 인터프리터 언어 아니었어 -ㅁ-?)

아무튼.. naver api 보다가 이상한게 나와서 분석하다 막히는 중.. 끄응...


[링크 : https://medium.com/@bluesh55/javascript-prototype-이해하기-f8e67c286b67]

[링크 : https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/proto]

[링크 : https://msdn.microsoft.com/ko-kr/library/dn342818(v=vs.94).aspx]


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

localstorage sessionStorage  (0) 2018.12.18
ajax success 콜백 사용하기  (0) 2018.12.15
canvas dataURL to Formdata(file)  (0) 2018.12.07
js 부모창 변수 접근하기  (0) 2018.12.04
크로스 브라우징 관련..  (0) 2018.11.30
Posted by 구차니
Programming/node.js2018. 12. 14. 10:34

라즈베리에 node-red 가지고 릴레이 달고 장난질 쳐볼까나...


[링크 : https://nodered.org/docs/getting-started/running]

[링크 : https://nodered.org/docs/platforms/windows]

[링크 : https://nodered.org/docs/hardware/raspberrypi]

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

npm npx yarn bower  (0) 2019.01.28
node-red rpi 접속  (0) 2018.12.20
node.js express static  (0) 2018.12.11
node.js sso  (0) 2018.12.11
node.js rpi gpio  (0) 2018.12.08
Posted by 구차니
Programming/node.js2018. 12. 11. 20:43

express.static을 통해서 정적 호스팅(?)을 제공해주면

기본적으로는 없는 경로나 상위 디렉토리에 대해서 요청시 에러를 발생시킨다.

[링크 : https://expressjs.com/ko/starter/static-files.html]



일반적인(?) 웹 서버 처럼 리스트 페이지를 제공하기 위해서는 별도의 모듈이 필요하다.

(다르게 보면 보안정책상 대개 리스트 페이지를 막는데 node.js로는 막을 필요가 없다 인가?)

[링크 : https://github.com/expressjs/serve-index]

[링크 : https://github.com/expressjs/serve-static]

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

node-red rpi 접속  (0) 2018.12.20
node-red 자동시작 관련  (0) 2018.12.14
node.js sso  (0) 2018.12.11
node.js rpi gpio  (0) 2018.12.08
node.js url encoding(?) 혹은 이스케이프  (0) 2018.12.07
Posted by 구차니
Programming/node.js2018. 12. 11. 09:34
Programming/web 관련2018. 12. 10. 08:22

요구사항 중에 있어서 보는 중..

tag가 잘 닫혔나 보는건가?


[링크 : https://validator.w3.org/]

'Programming > web 관련' 카테고리의 다른 글

ajax bearer token header  (0) 2019.02.07
webGL vs SVG  (0) 2019.01.07
미세먼지 크롤러 (다음, 네이버)  (0) 2018.12.07
edge browser mobile  (0) 2018.11.30
chrome 보안 무시  (0) 2018.11.13
Posted by 구차니
Programming/jquery2018. 12. 9. 20:45

div를 띄우고 그걸 마우스로 이리저리 움직이는걸 찾아보니

jquery에서 draggable 이라고 제공하는 듯?

(그러고 보면.. 네이버 지도에서 본거 같기도 하고..)


[링크 : https://stackoverflow.com/questions/8569095/draggable-div-without-jquery-ui]

[링크 : https://jqueryui.com/draggable/]

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

ajax async와 jquery  (0) 2019.01.04
jquery ajaxsetup()  (0) 2018.12.14
jquery select 인덱스 얻기  (0) 2018.12.05
jquery 셀렉터 - 특정 문장으로 시작하는 id 찾기  (0) 2018.11.07
jquery prepend  (0) 2018.11.06
Posted by 구차니
Programming/node.js2018. 12. 8. 22:17

크롤러 만들어서 대충 쓰게 라즈베리에 node.js로 해볼까?


[링크 : https://www.w3schools.com/nodejs/nodejs_raspberrypi_gpio_intro.asp]

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

[링크 : https://www.npmjs.com/package/rpi-gpio]


+ 2020.05.09


onoff가 무난하려나?


[링크 : https://webnautes.tistory.com/836]

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

node.js express static  (0) 2018.12.11
node.js sso  (0) 2018.12.11
node.js url encoding(?) 혹은 이스케이프  (0) 2018.12.07
node.js compressed http  (0) 2018.12.06
waveform-data.js  (0) 2018.11.30
Posted by 구차니
Programming/web 관련2018. 12. 7. 19:06

네이버랑 다음 지도에서 일단, 데이터 위치 특정하기


txt_num

[링크 : http://search.daum.net/search?nil_suggest=btn&w=tot&DA=SBC&q=미세먼지+종로구]


main_figure

[링크 : https://search.naver.com/search.naver?sm=top_hty&fbm=0&ie=utf8&query=미세먼지+종로구]

'Programming > web 관련' 카테고리의 다른 글

webGL vs SVG  (0) 2019.01.07
w3c validator  (0) 2018.12.10
edge browser mobile  (0) 2018.11.30
chrome 보안 무시  (0) 2018.11.13
REST API HTTP 에러코드  (0) 2018.11.06
Posted by 구차니

근 두달만에 겨우 해결했네..

키워드를 잘 못 잡았던 걸까 싶긴한데

아무튼.. FileList() 객체로 생성되고 그랬던 거라.. 

File() 객체를 생성하는걸 생각 못한게 2달 날린(?) 원인.. ㅠㅠ



+

new File() 에는 Array가 첫번째 인자인걸 주의!!!!

(망할!!!!!)


var blobdata = document
.getElementById("target_obj_cnv")
.toDataURL("image/png");
blobdata = dataURLtoBlob(blobdata);
var imgFile2 = new File([blobToFile(blobdata, "target.png")], "target.png");
var data = new FormData();

data.append("image", imgFile2);

[링크 : https://stackoverflow.com/questions/27251953/how-to-create-file-object-from-blob[

[링크 : https://developer.mozilla.org/en-US/docs/Web/API/File/File]



+

걍 포기해야 하나? ㅠㅠ

[링크 : https://stackoverflow.com/questions/38449440/javascript-create-file-list-object-from-list-of-files]

[링크 : https://developer.mozilla.org/en-US/docs/Web/API/FileList]


+

으으.. 영 안되네.. ㅠㅠ


function blobToFile(theBlob, fileName) {
var date = new Date();
theBlob.lastModifiedDate = date;
theBlob.lastModified = date.getTime();
theBlob.name = fileName;
return theBlob;
}

function dataURLtoBlob(dataurl) {
var arr = dataurl.split(","),
mime = arr[0].match(/:(.*?);/)[1],
bstr = atob(arr[1]),
n = bstr.length,
u8arr = new Uint8Array(n);
while (n--) {
u8arr[n] = bstr.charCodeAt(n);
}
return new Blob([u8arr], { type: mime });

} 

var blobdata = document
.getElementById("cnv")
.toDataURL("image/png");
blobdata = dataURLtoBlob(blobdata);
var imgFile2 = blobToFile(blobdata, "target.png");


[링크 : https://stackoverflow.com/questions/6850276/how-to-convert-dataurl-to-file-object-in-javascript]


+

Vanilla JavaScript


function blobToFile(theBlob, fileName){

    //A Blob() is almost a File() - it's just missing the two properties below which we will add

    theBlob.lastModifiedDate = new Date();

    theBlob.name = fileName;

    return theBlob;

[링크 : https://stackoverflow.com/questions/27159179/how-to-convert-blob-to-file-in-javascript/29390393]



---

[링크 : https://code.i-harness.com/ko-kr/q/4c46fc]


[링크 : https://teamtreehouse.com/community/how-to-create-a-file-from-a-dataurl-javascript]


var dataurl = canvas.toDataURL('image/jpeg',0.8);

var blob = dataURLtoBlob(dataurl);

var fd = new FormData();

fd.append("myFile", blob, "thumb.jpg"); 

[링크 : https://stackoverflow.com/questions/4998908/convert-data-uri-to-file-then-append-to-formdata]

[링크 : https://stackoverflow.com/questions/15675063/how-to-create-an-image-file-on-server-from-dataurl]

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

ajax success 콜백 사용하기  (0) 2018.12.15
js __proto__  (0) 2018.12.14
js 부모창 변수 접근하기  (0) 2018.12.04
크로스 브라우징 관련..  (0) 2018.11.30
wavesurfer.js HTML5 AUDIO 미지원시  (0) 2018.11.30
Posted by 구차니
Programming/node.js2018. 12. 7. 15:39

공백이 %20 으로 치환되는건 escape로도 되는거 같으니. 굳이 다른거 찾을 이유는 없는 듯..



$ node

> var qs = require('querystring');

undefined

> qs.unescape("http://localhost/api/sd?23 23 23")

'http://localhost/api/sd?23 23 23'

> qs.escape("http://localhost/api/sd?23 23 23")

'http%3A%2F%2Flocalhost%2Fapi%2Fsd%3F23%2023%2023'

> qs.escape("2002-02-22 22:22:22")

'2002-02-22%2022%3A22%3A22'


[링크 : http://blog.jeonghwan.net/2016/06/29/querystring-body-in-express.html]



+


javascript(client side) 에서 하는 법

var url = 'folder/index.html?param=#23dd&noob=yes'; //or specify one


var encodedUrl = encodeURIComponent(url);

console.log(encodedUrl);



var url = 'folder%2Findex.html%3Fparam%3D%2323dd%26noob%3Dyes'; //or specify one


var decodedUrl = decodeURIComponent(url);

console.log(decodedUrl); 


[링크 : https://www.sitepoint.com/jquery-decode-url-string]

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

node.js sso  (0) 2018.12.11
node.js rpi gpio  (0) 2018.12.08
node.js compressed http  (0) 2018.12.06
waveform-data.js  (0) 2018.11.30
node.js 혹은 sqlite?  (0) 2018.11.26
Posted by 구차니