반응형

전체 글 87

nodejs excel file to json

nodejs에서 excelfile을 읽어와서 json으로 만들어주는 간편한 library가 있다. convert-excel-to-json이다. 설치를 위해서는 아래와 같이 입력한다. npm install convert-excel-to-json 코드 : const excelData = excelToJson({ sourceFile: filepath, sheets: [{ name: 'sheet_name', header: { rows: 1 }, columnToKey: { A: 'key', B: 'name', C: 'road', D: 'staff', } }] }); dataModel.insertMany(excelData.sheet_name, (err, data) => { if (err) { console.log(..

flutter 2022.09.05

mongodb All your data is a backed up. you must pay 0.04 BTC

어제 몽고디비 서버를 열어놓고 잤다가 오늘 오후에 디비를 들어가보니 데이터는 전부 사라져있고, readme db가 새로 만들어져있었다... 그리고 이런 글이 있었다.. All your data is a backed up. You must pay 0.04 BTC to 1BbompGz4bzKF57PNDxfkH5tpxWz2gA6Y 48 hours for recover it. After 48 hours expiration we will leaked and exposed all your data. In case of refusal to pay, we will contact the General Data Protection Regulation, GDPR and notify them that you store use..

flutter 2022.09.02

deep graph library - pad_packed_tensor

dgl의 backend 부분에 pad_packed_tensor라는 함수가 있다. 아무래도 백엔드를 다루는 함수이다보니, 함수내부는 파이썬으로 코딩이 안되어있나보다. 사용 방법만 나와있다. 이 함수가 하는 역할은 "Pads a packed batch of variable length tensors with given value." 인데, 어떤 값으로 가변 길이의 텐서 배치를 패딩하는 것이다. 다시한번 자세히 설명해보겠다! dgl에서 graphconv를 예로들어보자. dgl에서 forward함수를 통해 graph가 들어오고, graphconv를 통과시키면 결과 차원은 (배치의 전체 노드갯수 x dimension)으로 나온다. 그런데 이렇게 되면 배치 안에 존재하는 compound 한개가 atom을 몇개 가지..

연구 2022.08.31

dgl GraphConv

dgl은 그래프 신경망을 쉽게 사용할 수 있도록 해주는 라이브러리이다. 그중에서도 GraphConv라는 함수를 알아보겠다. https://docs.dgl.ai/en/0.4.x/api/python/nn.pytorch.html?highlight=graphconv#graphconv NN Modules (PyTorch) — DGL 0.4.3post2 documentation The output feature of shape \((N, H, D_{out})\) where \(H\) is the number of heads, and \(D_{out}\) is size of output feature. docs.dgl.ai GraphConv는 아래의 ' semi-supervised classification with..

연구 2022.08.30

flutter에서 nodejs 서버로 이미지 업로드하기 - 서버부분

flutter에서 여러개의 이미지를 nodejs 서버로 업로드하기위해서는 multer를 사용해야한다! multer를 먼저 설정해줘야한다. destination을 이용해서 업로드할 이미지가 들어갈 폴더 이름을 바꿀 수 있다. filename을 이용해서 업로드할 파일 이름을 바꿀 수 있다. const upload = multer({ storage: multer.diskStorage({ destination: (req, file, cb) => { let keynum = req.params.keynum; let dir = 'uploads/' + keynum; if (!fs.existsSync(dir)) { fs.mkdirSync(dir) }; cb(null, dir); }, filename: (req, file..

flutter 2022.08.24

mongoose db flutter

서버가 nodejs이고, mongoose를 이용해서 데이터를 저장할 때, flutter에서 table 형태로 db를 보고싶다면 어떻게 해야할까? 서버에서 json형태로 db를 전송하고, flutter에서 json형태로 받은 db를 테이블로 보여주면 된다! json형태로 전송하는 부분 - node js 서버 : app.get('/api/uploaded_data', function (req, res) { try { attractionModel.find({ complete: 'O' }, function (err, data) { res.send({ 'data': data }); }) } catch (err) { res.status(500).send(err); } }); flutter 프론트엔드 : json을 t..

카테고리 없음 2022.08.23

provider model for loop - flutter provider 빌드 순서

provider의 model 부분에서 함수를 만들었다. 그리고 그 함수 내에서 for loop를 사용하였는데, 다른 변수들은 바로바로 업데이트가 되는데, for loop 안에 들어있는 변수는 업데이트가 한발짝 느리게 된다.... 구글링을 해봤는데도 관련된 정보가 안나온다,,,,,(내가 못찾는 걸수도..!!) 여기서 한발짝 느리게라는 뜻이 이상할 수 있는데,,,, 다른 변수들 업데이트 될 때(이 변수들은 파라미터로 받은 값을 클래스에 저장해주는 역할만 한다) 같이 업데이트가 안되고, 나중에 된다는 거다... 이것도 flutter의 빌드 순서와 관련이 있는 것 같아 찾아보았다. flutter에서 stateless 위젯은 상태(state) 를 가지고 있지 않다. 그래서 부모위젯에서 받은 값이 변경되면 위젯이 ..

flutter 2022.07.30
반응형