Skip to content

Instantly share code, notes, and snippets.

View XadillaX's full-sized avatar
🦧
A mess.

Khaidi Chu XadillaX

🦧
A mess.
View GitHub Profile
@XadillaX
XadillaX / prob with callback.js
Last active December 19, 2015 18:18
The last several lines. It said that s, msg and base header was undefined.
/**
* Created with JetBrains WebStorm.
* User: xadillax
* Date: 7/14/13
* Time: 9:44 PM
* NBUT Online Judge Impl.
*/
var base = require("../base");
var util = require("util");
//
// 1002.c
// HDU
//
// Created by XadillaX on 13-9-15.
// Copyright (c) 2013年 XadillaX. All rights reserved.
//
#include <iostream>
#include <cstdio>
#include <algorithm>
@XadillaX
XadillaX / PAT1071.cpp
Created November 3, 2013 15:15
Speech Patterns 4 FBR
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cstring>
#include <map>
#include <string>
using namespace std;
char str[1048576 + 10];
map<string, int> times;
@XadillaX
XadillaX / PAT1072.cpp
Created November 3, 2013 18:02
Gas Station 4 FBR
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
using namespace std;
#define MAXINT 2147483647
//
// main.cpp
// lordofminecraft
//
// Created by XadillaX on 14-4-28.
// Copyright (c) 2014å¹´ XadillaX. All rights reserved.
//
#include <cstdio>
#include <cstdlib>
#include <time.h>
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/time.h>
#include <errno.h>
#include <string.h>
#include "popen_plus/popen_plus.h"
(println ((fn
[n]
(take n (fn fib
([] (concat [1 1] (fib 1 1)))
([x1 x2]
(let [x3 (+ x1 x2)]
(lazy-seq
(cons x3 (fib x2 x3)))))))) 3))
@XadillaX
XadillaX / word_count.clj
Created July 18, 2014 09:45
Storm starter for clojure.
;; Licensed to the Apache Software Foundation (ASF) under one
;; or more contributor license agreements. See the NOTICE file
;; distributed with this work for additional information
;; regarding copyright ownership. The ASF licenses this file
;; to you under the Apache License, Version 2.0 (the
;; "License"); you may not use this file except in compliance
;; with the License. You may obtain a copy of the License at
;;
;; http://www.apache.org/licenses/LICENSE-2.0
;;
@XadillaX
XadillaX / mysql-daemon.js
Created October 15, 2014 15:23
MySQL Daemon in ACM.NBUT.EDU.CN
var exec = require("child_process").exec;
function check() {
exec("pgrep mysql", function(err, stdout, stderr) {
if(err) {
if(err.message.indexOf("Command failed") !== -1) {
console.log("Restarting mysqld...");
return exec("service mysqld start", function(err, stdout, stderr) {
if(err) console.log(err);
if(stdout) console.log(stdout);
@XadillaX
XadillaX / 1111.js
Created November 10, 2014 09:53
1111
//javascript; chrome only
゚ω゚ノ= /`m´)ノ ~┻━┻ //*´∇`*/ ['_']; o=(゚ー゚) =_=3; c=(゚Θ゚) =(゚ー゚)-(゚ー゚); (゚Д゚) =(゚Θ゚)= (o^_^o)/ (o^_^o);(゚Д゚)={゚Θ゚: '_' ,゚ω゚ノ : ((゚ω゚ノ==3) +'_') [゚Θ゚] ,゚ー゚ノ :(゚ω゚ノ+ '_')[o^_^o -(゚Θ゚)] ,゚Д゚ノ:((゚ー゚==3) +'_')[゚ー゚] }; (゚Д゚) [゚Θ゚] =((゚ω゚ノ==3) +'_') [c^_^o];(゚Д゚) ['c'] = ((゚Д゚)+'_') [ (゚ー゚)+(゚ー゚)-(゚Θ゚) ];(゚Д゚) ['o'] = ((゚Д゚)+'_') [゚Θ゚];(゚o゚)=(゚Д゚) ['c']+(゚Д゚) ['o']+(゚ω゚ノ +'_')[゚Θ゚]+ ((゚ω゚ノ==3) +'_') [゚ー゚] + ((゚Д゚) +'_') [(゚ー゚)+(゚ー゚)]+ ((゚ー゚==3) +'_') [゚Θ゚]+((゚ー゚==3) +'_') [(゚ー゚) - (゚Θ゚)]+(゚Д゚) ['c']+((゚Д゚)+'_') [(゚ー゚)+(゚ー゚)]+ (゚Д゚) ['o']+((゚ー゚==3) +'_') [゚Θ゚];(゚Д゚) ['_'] =(o^_^o) [゚o゚] [゚o゚];(゚ε゚)=((゚ー゚==3) +'_') [゚Θ゚]+ (゚Д゚) .゚Д゚ノ+((゚Д゚)+'_') [(゚ー゚) + (゚ー゚)]+((゚ー゚==3) +'_') [o^_^o -゚Θ゚]+((゚ー゚==3) +'_') [゚Θ゚]+ (゚ω゚ノ +'_') [゚Θ゚]; (゚ー゚)+=(゚Θ゚); (゚Д゚)[゚ε゚]='\\'; (゚Д゚).゚Θ゚ノ=(゚Д゚+ ゚ー゚)[o^_^o -(゚Θ゚)];(o゚ー゚o)=(゚ω゚ノ +'_')[c^_^o];(゚Д゚) [゚o゚]='\"';(゚Д゚) ['_'] ( (゚Д゚) ['_'] (゚ε゚+(゚Д゚)[゚o゚]+ (゚Д゚)[゚ε゚]+(゚Θ゚)+ (゚ー゚)+ (o^_^o)+ (゚Д゚)[゚ε゚]+(゚Θ゚)+ ((゚ー゚) + (゚Θ゚))+ ((゚ー゚) + (o^_^o))+ (゚Д゚)[゚ε゚]+(゚Θ゚)+ ((゚ー゚