Skip to content

Instantly share code, notes, and snippets.

View DingWeizhe's full-sized avatar

DingWeizhe DingWeizhe

  • 安永金融科技股份有限公司
  • Taiwan
View GitHub Profile
@DingWeizhe
DingWeizhe / gist:d087c6869a596fc01e04
Created June 20, 2015 16:40
eigenvalue / eigenvector
#include <iostream>
#include <vector>
#include <math.h>
#include <string>
#include <iomanip>
using namespace std;
void sub_into(vector< vector<double>> A, double r);
void gaussian_elimination(vector< vector<double>> *matrix, int m);
oldList = [{a:1},{b:2},{c:3}];
currentList = [{a:1},{b:2},{c:3},{d:4}];
oldJSON = oldList.map(JSON.stringify);
newList = currentList.filter(function(obj){
return oldJSON.indexOf(JSON.stringify(obj)) == -1;
});
@DingWeizhe
DingWeizhe / Edll.c
Last active November 28, 2015 06:15
/* Replace "dll.h" with the name of your header */
#include "dll.h"
#include <windows.h>
#include <tchar.h>
typedef long (__cdecl * CompressType)(unsigned char *, int *, unsigned char *, int);
typedef long (__cdecl * UncompressType)(unsigned char *, int *, unsigned char *, int);
CompressType Bcompress = NULL;
UncompressType Buncompress = NULL;
var express = require("express");
var session = require("express-session");
var app = express();
app.use(session({
secret: 'sfsrvwzsfsdf',
cookie: {
maxAge: 60000
}
}));
var TIME = 30;
var EXIT_MES = ["一樣", "人妖", "幹"];
var SEND_MES = "幹";
var stopWaitMessage;
var stopWaitExitMessage;
var css = document.createElement("style");
document.body.appendChild(css);
css.innerHTML = "\
var _res = [];
for (var i in res){
if (res[i].type == type){
_res.push(res[i]);
}
}
return _res;
=>
for (var i in res.record[0]){
this.box[i] = res.record[0][i];
}
=>
this.box = angular.extend(this.box, res.record[0]);
@DingWeizhe
DingWeizhe / 寶寶.js
Last active March 8, 2017 14:05
新增line的功能
var fs = require('fs'),
http = require('http'),
https = require('https'),
express = require('express'),
bodyParser = require('body-parser'),
request = require('request'),
crypto = require('crypto'),
FBToken = '',
port = 443,
options = {
GET /ssoIndex.do?apUrl=http://aps.ntut.edu.tw/course/tw/courseSID.jsp&apOu=aa_0010-&sso=true&datetime1=1462113196935 HTTP/1.1
Host: nportal.ntut.edu.tw
Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.86 Safari/537.36
Referer: http://nportal.ntut.edu.tw/myPortal.do?thetime=1462111534039_true
Accept-Encoding: gzip, deflate, sdch
function f(){}
// f 是一個 function
var o = {}
// o 是一個 object
function C(){
return this;
}
// C 是一個 Class