This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Module dependencies. | |
*/ | |
var express = require('express') | |
, routes = require('./routes'); | |
var app = module.exports = express.createServer(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var crypto = require("crypto"); | |
function encrypt(text,key){ | |
/* 알고리즘과 암호화 key 값으로 셋팅된 클래스를 뱉는다 */ | |
var cipher = crypto.createCipher('aes-256-cbc',key); | |
/* 컨텐츠를 뱉고 */ | |
var encipheredContent = cipher.update(text,'utf8','hex'); | |
/* 최종 아웃풋을 hex 형태로 뱉게 한다*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// RDB - select birth , working , count(*) from users group by birth , working | |
// mongoDB map reduce | |
db.users.group({ | |
key:{birth:1,working:1}, | |
reduce:function(obj,prev){ | |
if(!obj.hasOwnProperty("key")){ | |
prev.birth = obj.birth; | |
prev.working = obj.working; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// RDB - select birth , working , count(*) from users group by birth , working | |
// mongoDB aggregation | |
db.users.aggregate([ | |
{ $project : { a : "$birth" | |
, b : "$working" | |
, _id : 0 }} | |
,{ $group : { _id : { a:"$a",b:"$b"} | |
, n: { $sum:1 } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var exec = require('child_process').exec; | |
var util = require('util'); | |
var inspect = require('util').inspect; | |
var Client = require('mariasql'); | |
require('date-utils'); | |
var tables = []; //["KD_BRCH","KD_CUST","KD_HLDY","KD_ODAT","KD_TMPR","tblloader","tbltemperature"]; | |
var date = new Date(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*테스트파일*/ | |
DROP TABLE IF EXISTS KD_ODAT_BRCH_TIME_01 | |
; | |
SELECT CONCAT( SYSDATE() ,':KD_ODAT_TIME.SQL> ','KD_ODAT_BRCH_TIME_01 생성중...' ) AS '' | |
; | |
CREATE TABLE KD_ODAT_BRCH_TIME_01 AS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
db.students.find({}).forEach(function(a){ | |
if(a.scores[2].score > a.scores[3].score){ | |
a.scores.splice(3,1); | |
}else{ | |
a.scores.splice(2,1); | |
} | |
db.students.save(a); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 지역별단위난방부하코드 */ | |
// type A | |
db.commonCode.save( | |
{ | |
_id : "billTypeCode" | |
,codes:[ | |
,{name:"주택용" , code:"house"} | |
,{name:"업무용" , code:"business"} | |
,{name:"공공용" , code:"public"} | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* mongo ds049858.mongolab.com:49858/kdhec -u kdhec -p dnflemf4921 < /Users/ppillip/Projects/KDHEC/KDHEC_WEB/web/estimate/init.mongodb.js */ | |
/* mongo localhost/kdhec < /Users/ppillip/Projects/KDHEC/KDHEC_WEB/web/estimate/init.mongodb.js */ | |
/*월별열손실율*/ | |
db.monthlyHeatLossRate.save( | |
{ | |
_id : "default" | |
,name : "월별열손실율" | |
,data : { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<head> | |
<meta http-equiv="content-type" content="text/html; charset=utf-8"/> | |
<meta http-equiv='cache-control' content='no-cache'> | |
<title>한국지역난방공사</title> | |
<link rel="stylesheet" href="/kdweb/lib/bootstrap/css/common.css" type="text/css"/> | |
<script src="/kdweb/lib/requestParameters.js"></script> | |
<script src="/kdweb/lib/jquery-1.10.2.min.js"></script> | |
<script src="/kdweb/lib/bootstrap/js/bootstrap.js"></script> | |
<script src="/kdweb/lib/Highcharts-3.0.4/js/highcharts.js"></script> |
OlderNewer