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 Url where | |
import Data.List | |
import Text.Parsec | |
import Text.Parsec.String | |
data Proto = HTTP | FTP | |
data URL = URL { |
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.Char (toLower) | |
rdToDec :: Char -> Int | |
rdToDec 'i' = 1 | |
rdToDec 'v' = 5 | |
rdToDec 'x' = 10 | |
rdToDec 'l' = 50 | |
rdToDec 'c' = 100 | |
rdToDec 'd' = 500 |
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 <stdio.h> | |
# include <stdlib.h> | |
# include <string.h> | |
# include <stdbool.h> | |
_Bool find(const char* haystack, const char* needle) | |
{ | |
size_t hlen = strlen(haystack); | |
size_t nlen = strlen(needle); | |
unsigned int found = 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
// Converts a number to a little-endian byte array | |
func lengthToBytes(l uint64) [8]byte { | |
var sizebuf [8]byte | |
var i int = 7 | |
for ; i >= 0; i-- { | |
// The commented implementation is 5 times slower but equivalent | |
/* | |
var divisor uint64 = 1 << (uint(i) * 8) | |
sizebuf[i] = uint8(l / divisor) |
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 <stdio.h> | |
# include <time.h> | |
# include <locale.h> | |
int main(void) | |
{ | |
time_t currtime = time(NULL); // time_t time(time_t *timep) | |
struct tm *local, *gmt; | |
local = localtime(&currtime); |
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
# ifndef _CHAN_HPP | |
# define _CHAN_HPP | |
# include <deque> | |
# include <mutex> | |
# include <condition_variable> | |
# include <utility> | |
template<typename T> | |
class Chan { |
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
*.aux | |
*.glo | |
*.idx | |
*.log | |
*.toc | |
*.ist | |
*.acn | |
*.acr | |
*.alg | |
*.bbl |
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 | |
# Usage: | |
# | |
# Go to the directory you want to contain the transcoded files and | |
# call this script: $ downcode.sh /path/to/ogg/files/to/be/transcoded | |
# The transcoded ogg files containing the old tags are placed in $PWD. | |
# --> Spaces are replaced by underscores (_) in both the file names of the | |
# ogg files being transcoded and the new ogg files! |
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
{-# LANGUAGE OverloadedStrings #-} | |
import System.IO | |
import System.IO.Error | |
import System.Locale | |
import System.Exit | |
import Control.Monad | |
import Control.Exception |
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
-- Dec2Bin | |
-- | |
data Digital = D1 | D0 | |
instance Show Digital where | |
show D1 = "1" | |
show D0 = "0" | |
instance Eq Digital where |
OlderNewer