Skip to content

Instantly share code, notes, and snippets.

View uyu423's full-sized avatar

Yongwoo Yu (Yowu) uyu423

View GitHub Profile
/*
* Simplic Linked List Structure
* by Yowu ([email protected] || http://luckyyowu.tistory.com)
* Date : 2016. 04. 15
* Development Env.
* Ubuntu 15.10 (x64, Linux Kernel 4.2.0)
* GNU Compiler Collection 5.2.1
* Vi IMproved 7.4, File Encoding UTF-8
*/
#include <stdio.h>
#include <stdio.h>
int main(void) {
printf("Hello World\n");
}
/* node-qsb npm Module Example (Select Query Default) */
var qsb = require('node-qsb');
var qs = new qsb().select('tableName')
.where('idx', '>', '10')
.build();
qs.printString();
//Standard Output : SELECT * FROM `tableName` WHERE `idx` > '10';
console.log(qs.returnString());
//node-qsb를 사용하지 않고 데이터베이스 쿼리문 하드 코딩
var originQs = "insert into users(email, passwd, uName, stdNum, major, phone, emailNotify, tIdx) "
+ "values ('"+req.email+"', '"+req.sha2passwd +"', '"
+ req.uName+"', '"+req.stdNum+"', '"+req.major+"', '"+req.phone+"', '"
+ req.emailNotify+"', 5);";
//node-qsb를 사용한 데이터베이스 쿼리문 관리
var qsb = require('node-qsb');
var mysql = require('../config/mysql.js')
var params = {
cols : ['email', 'passwd', 'uName', 'stdNum', 'major', 'phone', 'emailNotify', 'tIdx'],
vals : [req.email, req.sha2passwd, req.uName, req.stdNum, req.major, req.phone, req.emailNotify, '5'],
}
var usingQsbQs = new qsb()
.insert("users")
var qsb = require("node-qsb")
var qs = new qsb().select('myTable', 'MT')
.join('yourTable', 'YT')
.join('ourTable', 'OT')
.where('MT.idx', '=', 'YT.mIdx')
.where('YT.idx', '=', 'OT.yIdx')
.where('MT.idx', '<=', 10)
.whereOr('YT.idx', '<', 100)
.limit(0, 100)
<head>
<title>JSON Basic</title>
<meta charset="utf-8"/>
</head>
<body>
<script>
/* Array and Object Definition */
var arr = [ "Yongwoo", 25, "Catholic Univ, of Korea", "Computer Science" ];
var obj = { "NAME" : "Yongwoo", "AGE" : 25, "UNIVERSITY" : "Catholic Univ, of Korea", "MAJOR" : "Computer Science" };
<head>
<title>JSON Basic</title>
<meta charset="utf-8"/>
</head>
<body>
<script>
/* JSON Definition */
var json = '{ "NAME" : "Yongwoo", "AGE" : 25, "UNIVERSITY" : "Catholic Univ, of Korea", "MAJOR" : "Computer Science" }';
/* JSON Parse and Check */
<head>
<title>JSON Basic</title>
<meta charset="utf-8"/>
</head>
<body>
<script>
/* Array and Object Definition */
var arr = [ "Yongwoo", 25, "Catholic Univ, of Korea", "Computer Science" ];
var obj = { "NAME" : "Yongwoo", "AGE" : 25, "UNIVERSITY" : "Catholic Univ, of Korea", "MAJOR" : "Computer Science" };
var express = require('express');
var app = express();
var expressVaildator('express-vaildator');
app.use(expressVaildator());