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
;; M-expression to S-expression macro converter | |
;; Author: Dmytro Sirenko | |
;; License: BEERWARE | |
;; | |
;; Examples of usage: | |
;; (@ 2+2) => 4 | |
;; (@ (98 + 11 + 17)/sqrt(9)) => 42.0 | |
(defvar bin-ops '(+ - * /) ) |
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
; this is just an exercise, I don't want to use it in any serious code :) | |
(defmacro макрос (&body x) | |
`(defmacro ,@x)) | |
(макрос переклад (англ укр) | |
`(макрос ,укр (&body параметри) `(,',англ ,@параметри))) | |
(макрос переклад-розкритого (англ укр) | |
(let ((розкрите укр)) |
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 PyQt4 import QtCore | |
from PyQt4 import QtGui | |
import sys | |
import math | |
import struct | |
import wave |
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
''' | |
Question 1 | |
Many Time Pad | |
Let us see what goes wrong when a stream cipher key is used more than once. Below are eleven | |
hex-encoded ciphertexts that are the result of encrypting eleven plaintexts with a stream | |
cipher, all with the same stream cipher key. Your goal is to decrypt the last ciphertext, | |
and submit the secret message within it as solution. | |
Hint: XOR the ciphertexts together, and consider what happens when a space is XORed with |
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
#!/bin/bash | |
export CHECKSUM_AT=148 | |
function joinlines { | |
while read line ; do | |
echo -n "$line" | |
done | |
} |
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 Happstack.Server | |
import System.Environment | |
import Control.Monad (when) | |
main = do | |
args <- getArgs | |
when (length args < 2) $ error "Usage: ./HelloHTTP " | |
simpleHTTP nullConf $ serveDirectory EnableBrowsing ["index.htm"] (head args) |
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 Data.Binary.Get as BG | |
import Data.Binary.Put as BP | |
import Data.ByteString (ByteString) | |
import qualified Data.ByteString as B | |
import qualified Data.ByteString.Internal as BI | |
import qualified Data.ByteString.Lazy as BL | |
import Data.Word | |
import Data.Int |
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 <string> | |
using std::cout; | |
using std::endl; | |
using std::string; | |
template <typename T> | |
class clever_ptr { | |
string log; |
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 SleepSort (sleepsort) where | |
import Control.Concurrent | |
import Control.Concurrent.STM | |
worker chan timefun val = do | |
threadDelay $ timefun val | |
atomically $ writeTChan chan val | |
sleepsort :: (a -> Int) -> [a] -> IO [a] |
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 <string> | |
#include <set> | |
#include <vector> | |
#include <iterator> | |
#include <algorithm> | |
int main() { | |
std::string s; | |
std::getline(std::cin, s); |
OlderNewer