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
diff --git a/build.sh b/build.sh | |
index 112e404..2974fdc 100755 | |
--- a/build.sh | |
+++ b/build.sh | |
@@ -31,7 +31,7 @@ else | |
USE_LIBS="-lpcap $LIBS" | |
fi | |
-OBJFILES="api.c process.c fp_tcp.c fp_mtu.c fp_http.c readfp.c" | |
+OBJFILES="api.c process.c fp_tcp.c fp_mtu.c fp_http.c fp_ssl.c readfp.c" |
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 python | |
# -*- coding: utf-8 -*- | |
from ps3b import subStringMatchExact | |
from ps3c import subStringMatchOneSub | |
def subStringMatchExactlyOneSub(target, key): | |
t1 = subStringMatchExact(target, key) | |
t2 = subStringMatchOneSub(target, key) |
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 python | |
# -*- coding: utf-8 -*- | |
from ps3b import subStringMatchExact | |
def constrainedMatchPair(firstMatch, SecondMatch, lenth): | |
ans = () | |
for i in firstMatch: | |
for j in SecondMatch: |
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 python | |
# -*- coding: utf-8 -*- | |
def subStringMatchExact(target, key): | |
idx = 0 | |
res = () | |
while True: | |
new_idx = target.find(key, idx) | |
if new_idx < 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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
def countSubStringMatch(target, key): | |
count = 0 | |
idx = 0 | |
while True: | |
new_idx = target.find(key, idx) | |
if new_idx < 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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
def diophantine(n): | |
a = b = c = 0 | |
for a in range(20): | |
for b in range(20): | |
for c in range(20): | |
if 6 * a + 9 * b + 20 * c == n: |
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
''' | |
Problem 1 b | |
Write a program that computes the sum of the logarithms of all the primes from 2 to some | |
number n, and print out the sum of the logs of the primes, the number n, and the ratio of these | |
two quantities. Test this for different values of n. | |
You should be able to make only some small changes to your solution to Problem 1 to solve this | |
problem as well. | |
''' |
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
''' | |
Problem 1 a | |
Write a program that computes and prints the 1000th prime number. | |
''' | |
from math import sqrt | |
def is_prime(num): | |
i = 2 | |
while i <= sqrt(num): |