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
def fabinacci(n): | |
x,y = 0,1 | |
for index in range(n): | |
x,y = x+y, x | |
return x | |
def cache(fun): | |
_cache = {} | |
def _inner(n): | |
if n in _cache: |
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
#include <thread> | |
#include <iostream> | |
#include <memory> | |
#include <vector> | |
#include <algorithm> | |
#include <functional> | |
#include <numeric> | |
using namespace std; | |
template<typename Iterator, typename T> |
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
A warning occurred (42 apples) | |
An error occurred |
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
#include <iostream> | |
#include <fstream> | |
#include <stdint.h> | |
#include <vector> | |
#include <algorithm> | |
#include <string> | |
#include <map> | |
using namespace std; | |
#pragma pack(push) |
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
#! /usr/bin/env python2.7 | |
#encoding:utf-8 | |
#@description:一个python守护进程的例子 | |
#@tags:python,daemon | |
import sys | |
import os | |
import time | |
import atexit | |
from signal import SIGTERM |
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(tcp_server). | |
-compile(export_all). | |
start(Port) -> | |
Pid = spawn_link(fun()-> | |
{ok, ListenSocket} = gen_tcp:listen(Port, [binary, {active, false}]), | |
spawn(fun() -> acceptor(ListenSocket) end), | |
timer:sleep(infinity) |
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 express = require('express'); | |
var app = express(); | |
var Waterline = require('waterline'); | |
var sailsMongoAdapter = require('sails-mongo'); | |
var orm = new Waterline(); | |
var bodyParser = require('body-parser'); | |
var bcrypt = require('bcrypt'); | |
app.use(bodyParser.urlencoded({ extended: false })); | |
app.use(bodyParser.json()) |
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
#!/vobs/ims/common/tools_root/cdfrt/dist/unitprep/TDP-Python-CXS1040058-R2A01/contained/DT_Python/bin/python | |
import os | |
from subprocess import Popen, PIPE | |
import traceback | |
import threading | |
import time | |
import sys | |
AIT_DIR = r"/vobs/ims/sbg/src/delivery/sgcPSR/SiteConfigurationPackage/AIT" |
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 path = require('path'); | |
var fs = require('fs'); | |
var tarball = require('tarball-extract'); | |
var rimraf = require("rimraf"); | |
var srcDir = "C:\\Users\\elqstux\\Desktop" | |
var dstDir = "C:\\Users\\elqstux\\Desktop\\SBG Code\\src"; | |
var files = ["SOM_CRA1190221.tar.gz", "SYF_CRA1190070.tar.gz", "auto.tar.gz", "SGC_CRA1190962.tar.gz"]; |
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
from Tkinter import * | |
import time, string | |
import Pmw | |
class EntryValidation: | |
def __init__(self, master): | |
now = time.localtime(time.time()) | |
self._date = Pmw.EntryField(master, labelpos='w', label_text='Date (mm/dd/yy):', value = "%d%d%d" % (now[1], now[2], now[0]), | |
validate={'validator':'date', 'format':'mdy', 'separator':'/'}) |
NewerOlder