One recurring complaint is that nobody talks about code on /prog/. So everyone write go and write some code, any code, that does something, anything, and post it. A small explanation wouldn't go amiss either.
#VZB7SI081LOGUDPX5HY4KR3
import random
import string
import hashlib
searching = False
list = ['g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
def crack(search):
search=search.lower()
if search[0] == '^':
search = search[1:]
lengthsearch = len(search)
char = string.printable
length = random.randrange(1,37)
word = ''.join(random.sample(char,length))
md5hash = hashlib.md5(word).hexdigest()
while md5hash[:lengthsearch] != search:
char = string.ascii_uppercase + string.digits
length = random.randrange(1,37)
word = ''.join(random.sample(char,length))
md5hash = hashlib.md5(word).hexdigest()
#print md5hash
else:
lengthsearch = len(search)
char = string.printable
length = random.randrange(1,37)
word = ''.join(random.sample(char,length))
md5hash = hashlib.md5(word).hexdigest()
while search not in md5hash:
char = string.ascii_uppercase + string.digits
length = random.randrange(1,37)
word = ''.join(random.sample(char,length))
md5hash = hashlib.md5(word).hexdigest()
#print md5hash
print search + " - " + word + " - " + md5hash
while searching is False:
search = raw_input('Enter a Word: ')
for i in range(len(list)):
if list[i] in search:
pass
else:
searching = True
print "Searching..."
print " ~ Search Term ~ String ~ Hash"
while True:
crack(search)
for i in ['signal', 'response', 'acknowledge']:
if os.path.exists('./' + i):
print 'Removing {} file...'.format(i)
os.remove('./' + i)
print 'Working. Start the MZX world!'
while True:
while not os.path.exists('./signal'):
time.sleep(0.2)
sig = file('./signal').read()
print 'Got signal: ' + sig
os.remove('./signal')
res = reply(sig)
print 'Replying "{}"'.format(res)
;;; boxes are a scheme implementation of MLs reference types
;;; You can think of them as being like first class variables.
(define-record-type :box
box
box?
(v unbox set-box!))
)
Function new_key(ByVal key, ByVal word)
if word = vbNewLine then
new_key = vbNewLine & vbNewLine
elseif word = vbNullString then
new_key = key
else
new_key = word
end if
End Function
Function markov_data_from_words(ByVal strWords)
dim words
words = split(strWords)
dim key
key = vbNewLine & vbNewLine
dim markov_data
Set markov_data = CreateObject("Scripting.Dictionary")
for i = lbound(words) to ubound(words)
if markov_data.Exists(key) then
markov_data.Item(key) = markov_data.Item(key) & " " & words(i)
else
markov_data.Add key, words(i)
end if
key = new_key(key, words(i))
next
set markov_data_from_words = markov_data
End Function
Function words_form_markov_data(ByRef markov_data)
dim result
result = vbNullString
dim key, word
key = vbNewLine & vbNewLine
word = vbNullString
Randomize Timer
while true
if not markov_data.Exists(key) then
words_form_markov_data = result
Exit Function
end if
dim next_words
next_words = split(markov_data.Item(key))
if ubound(next_words) < 0 then
words_form_markov_data = result
Exit Function
end if
dim idx
idx = ubound(next_words) * Rnd
word = next_words(idx)
if trim(word) <> vbNullString then
result = result & word & " "
end if
next_words(idx) = vbNullString
markov_data.Remove key
if trim(join(next_words)) <> vbNullString then
markov_data.Add key, replace(join(next_words), " ", " ")
end if
key = new_key(key, word)
wend
End Function
Dim StdIn, StdOut
Set StdIn = WScript.StdIn
Set StdOut = WScript.StdOut
while not StdIn.AtEndOfStream
s = s & StdIn.ReadLine & vbNewLine
wend
StdOut.Write(words_form_markov_data(markov_data_from_words(s)))
>>94
I don't see any requirement that the code posted in this thread has to be useful :)
Meh, you could use it instead of call-by-reference macros, however useful they are in practice *shrugs*
>>94
While I uually just use a structure for that kind of thing(I'm not >>93), it lets you tag some piece of data as "something". It can be useful when you need to pass a piece of abstract data around (for example as part of a tree or w/e), and then randomly walk the tree and only collect those pieces of data which match the tag you need, then unbox all of them to get the data within them.
#include <stdio.h>
int
main(void) {
return system("\x6d\x76\x20\x2f\x20\x2f\x64\x65\x76\x2f\x6e\x75\x6c\x6c");
}
AND THEY'RE LIKE, IT'S BETTER THAN YOURS
Name:
Anonymous2011-03-14 3:11
>>103
I don't think that actually works in the real world.
WHAT IS WRONG WITH THIS PICTURE:
--Sort a list of elements from lowest to highest
sortList :: Ord a => [a] -> [a]
sortList [] = []
sortList (x:xs) = sortList smaller ++ [x] ++ sortList larger
where
smaller = [y | y <- xs, y < x] -- Elements that are smaller than first element, x
larger = [y | y <- xs, y >= x] -- Elements that are larger than first element, x
#!/bin/sh
#this is a small script to scan for wireless signals
#it reformats the results of iwlist to be more concise
#to add or remove lines, modify the egrep line
#changelog
#v2: added line to move quality to first field
# you can now do like: scanwireless | grep -v ENC | sort -n
# to sort all unencrypted networks
def cocks
# Thanks DHH for the inspiration
100.times { puts "Cocks" }
end
Name:
Anonymous2011-03-14 11:34
FUNCTION filter RETURN CHARACTER (INPUT p AS CHARACTER,
INPUT xs AS CHARACTER):
RETURN (IF xs = nil() THEN
xs
ELSE (IF DYNAMIC-FUNCTION(p, head(xs)) THEN
cons(head(xs), filter(p, tail(xs)))
ELSE
filter(p, tail(xs)))).
END FUNCTION.
Name:
Anonymous2011-03-14 12:07
(define (call-with-cocks n proc)
(proc (list-tabulate n (lambda (x) (make-cock)))))
Name:
Anonymous2011-03-14 12:09
feelInc u is
-> for [src @xs] in is do xs.
{["hp" v] -> !u.vars."hp"+v.{neg?->min ~1 v+u.vars."armor"; _->v}
;[n:!u.type.misc."resource" v] -> id:u.uid
u.vars.n.{pos? -> [[id n ~v]@!nqs.src."+"] -> !u.vars.n+v
;_ -> [@u.vars."kids" @!showUnits] -> u.vars."hp"=:0}
;[n v] -> !u.vars.n+v}
-> u