Skip to content

Instantly share code, notes, and snippets.

View 02015678's full-sized avatar

02015678 02015678

View GitHub Profile
@02015678
02015678 / 2007030102.pas
Created January 23, 2015 13:15
02015678's Solution for NK1009 NKPC2 Lucy's Problem
Var
s1,s2,s3,s4:string;
n1,n2,n3:longint;
ch:char;
code,n,i,j:integer;
num:array[1..12] OF 0..9;
Begin
s1:='';s2:='';s3:='';s4:='';
fillchar(num,sizeof(num),0);
repeat
@02015678
02015678 / 2007030103.pas
Created January 23, 2015 13:20
NK1002 NKPC1 Lucy's Problem
Var
x:array[1..15]OF longint;
i,n:integer;
Function cal(x:longint):longint;
Begin
IF x>=50025002
THEN cal:=x-5
ELSE
Begin
repeat
@02015678
02015678 / VISA.H
Last active August 29, 2015 14:18
Include file for the VISA Library 4.0 specification
/*---------------------------------------------------------------------------*/
/* Distributed by the IVI Foundation */
/* */
/* Do not modify the contents of this file. */
/*---------------------------------------------------------------------------*/
/* */
/* Title : VISA.H */
/* Date : 06-18-2012 */
/* Purpose : Include file for the VISA Library 5.1 specification */
/* */
@02015678
02015678 / VISATYPE.H
Last active August 29, 2015 14:18
Fundamental VISA data types and macro definitions
/*---------------------------------------------------------------------------*/
/* Distributed by IVI Foundation Inc. */
/* */
/* Do not modify the contents of this file. */
/*---------------------------------------------------------------------------*/
/* */
/* Title : VISATYPE.H */
/* Date : 05-12-2009 */
/* Purpose : Fundamental VISA data types and macro definitions */
/* */
@02015678
02015678 / TRAIN_TRANSFER.pas
Created April 9, 2015 13:59
火车转轨/铁轨 (题目来源:UVA Problem Archive)
Const maxn=1000;
Var
x,y,i,j,n:1..maxn+1;{x:待出轨火车 y:待入轨火车}
d,a:array[1..maxn+1]OF 1..maxn;{a:原进站顺序 d:中间栈}
top:0..maxn+1;{栈顶指针}
Begin
readln(n);
For i:=1 to n do read(a[i]);
top:=0; x:=1; j:=1; y:=a[j];
For i:=1 to 2*n+1 do
@02015678
02015678 / LOOONG_ADD.pas
Created April 9, 2015 14:09
计算2个超级大数的和
var lena,lenb,len,i:integer;
s1,s2:string[101];
a,b,c:array[1..101]of integer;
ch:char;begin s1:='';
Repeat
read(ch);
IF ch<>' ' THEN s1:=s1+ch;
Until ch=' ';
readln(s2);
@02015678
02015678 / Resistor_Verilog-AMS.v
Created April 17, 2015 16:38
Resistor Model in Verilog-A, used in Cadence Virtuoso
`include "discipline.h"
module polyres_hdl (n2, n1, ctrl2, ctrl1);
//(wr, lr, rtemp, jc1a, jc1b, jc2a, jc2b, tc1, tc2, etch, tnom, rsh0, rmaxvcoef, rminvcoef)
electrical n2, n1, ctrl2, ctrl1;
parameter real lr=0.0;parameter real wr=0.0;
parameter real rtemp=($temperature - 273.15);
parameter real jc1a = 0;parameter real jc1b = 0;
parameter real jc2a = 0;parameter real jc2b= 0;
@02015678
02015678 / Check_ISBN.py
Created April 26, 2015 11:33
Check ISBN Validity (Just check if the last bit is not conflict with the algorithm)
# Copyright (C) 2011, Giovanni Di Milia
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@02015678
02015678 / cdsenv.lisp
Last active October 1, 2022 01:33
My customized .cdsenv file for Cadence Virtuoso IV6.1.6
;===============================================
; Created on Jan.10th, 2015
; <------------------Summary------------------>
; Default Simulator : spectre
; Default Folder : ./simulation
; Spectre Options : APS+ 64bit Multi-thread psfbin
; HSPICE Options : HPP 64bit Multi-thread tr0 Waveview
; Anyline starts with a semi-comma (;) is comment and will be omited by Cadence
;===============================================
; Do not show What's new popup window
@02015678
02015678 / SimpleAuthServer.py
Created April 28, 2016 08:16 — forked from fxsjy/SimpleAuthServer.py
SimpleAuthServer: A SimpleHTTPServer with authentication
import BaseHTTPServer
from SimpleHTTPServer import SimpleHTTPRequestHandler
import sys
import base64
key = ""
class AuthHandler(SimpleHTTPRequestHandler):
''' Main class to present webpages and authentication. '''
def do_HEAD(self):