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/python | |
import math | |
def is_prime(x): | |
if x < 0: | |
x = -x | |
if x < 2: | |
return False | |
# check the case: x=2,3 | |
if x % 2 == 0: |
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
ans = 0 | |
arr = """37107287533902102798797998220837590246510135740250 | |
46376937677490009712648124896970078050417018260538 | |
74324986199524741059474233309513058123726617309629 | |
91942213363574161572522430563301811072406154908250 | |
23067588207539346171171980310421047513778063246676 | |
89261670696623633820136378418383684178734361726757 | |
28112879812849979408065481931592621691275889832738 | |
44274228917432520321923589422876796487670272189318 | |
47451445736001306439091167216856844588711603153276 |
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/python | |
triangle = [] | |
a = """75 | |
95 64 | |
17 47 82 | |
18 35 87 10 | |
20 04 82 47 65 | |
19 01 23 75 03 34 |
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/python | |
from math import factorial | |
def digit_sum(num,sum=0): | |
if num > 0: | |
num,sum = int(num / 10), sum + (num % 10) | |
return digit_sum(num,sum) | |
else: | |
return sum |
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/python3 | |
from math import sqrt | |
def d(n): | |
sum = 1 | |
sq = int(sqrt(n)) | |
for s in range(2, sq + 1): | |
if n % s == 0: | |
sum += s + int(n/s) |
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
-- ガードを使わないことにしてみる。 | |
-- map, filter,fold も使わない. | |
-- いくつかの関数の実装 | |
-- null, sum, product, elem | |
null' :: [a] -> Bool | |
null' [] = True | |
null' _ = False | |
-- sum と product 書くのめんどくさいので。 |
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
# pxelinux.cfg/default file | |
default debian/7.4/amd64/boot-screens/vesamenu.c32 | |
prompt 1 | |
timeout 300 | |
menu title - Boop Options Menu - | |
label Debian-7.4 | |
menu label ^0 Debian 7.4 | |
#include debian/7.4/amd64/boot-screens/menu.cfg | |
kernel debian/7.4/amd64/linux |
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
# D-I config version 2.0 | |
default debian/7.4/amd64/boot-screens/vesamenu.c32 | |
prompt 1 | |
timeout 300 | |
menu title - Boop Menu - | |
label Debian-7.4 | |
menu label ^0 Debian 7.4 | |
#include debian/7.4/amd64/boot-screens/menu.cfg | |
kernel debian/7.4/amd64/linux |
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
import fcntl, struct, socket | |
def getHwAddr(ifname): | |
'Return MAC address of given NIC' | |
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) | |
try: | |
info = fcntl.ioctl(s.fileno(), 0x8927, | |
struct.pack('256s', bytes(ifname[:15], 'ascii'))) | |
return ''.join(['%02x:' % char for char in info[18:24]])[:-1] | |
except OSError: |
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
bootstate=0 | |
title=Loading ESXi installer | |
prefix=/esxi50/ | |
kernel=tboot.b00 | |
#kernelopt=runweasel | |
modules=b.b00 --- useropts.gz --- k.b00 --- a.b00 --- ata-pata.v00 --- ata-pata.v01 --- ata-pata.v02 --- ata-pata.v03 --- ata-pata.v04 --- ata-pata.v05 --- ata-pata.v06 --- ata-pata.v07 --- block-cc.v00 --- ehci-ehc.v00 --- s.v00 --- weaselin.i00 --- ima-qla4.v00 --- ipmi-ipm.v00 --- ipmi-ipm.v01 --- ipmi-ipm.v02 --- misc-cni.v00 --- misc-dri.v00 --- net-be2n.v00 --- net-bnx2.v00 --- net-bnx2.v01 --- net-cnic.v00 --- net-e100.v00 --- net-e100.v01 --- net-enic.v00 --- net-forc.v00 --- net-igb.v00 --- net-ixgb.v00 --- net-nx-n.v00 --- net-r816.v00 --- net-r816.v01 --- net-s2io.v00 --- net-sky2.v00 --- net-tg3.v00 --- ohci-usb.v00 --- sata-ahc.v00 --- sata-ata.v00 --- sata-sat.v00 --- sata-sat.v01 --- sata-sat.v02 --- sata-sat.v03 --- scsi-aac.v00 --- scsi-adp.v00 --- scsi-aic.v00 --- scsi-bnx.v00 --- scsi-fni.v00 --- scsi-hps.v00 --- scsi-ips.v00 --- scsi-lpf.v00 --- scsi-meg.v00 --- scsi-meg.v01 --- scsi-meg.v02 --- |
OlderNewer