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
s="12345.123421" | |
if '.' not in s | |
s+=".00" | |
a, b = s.split('.') | |
cnt=0 | |
tmp="" | |
for x in reversed(a) | |
tmp+=x |
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
function _driver_sms2ru() { | |
# Проверяем секретный ключ | |
$key_md5 = md5(trim($this->config['billing_secret_key']) . $_GET['id']); | |
/* if($_GET['key'] != $key_md5) { | |
exit('hacking attempt'); // скрипт был вызван с неправильным параметром безопасности. | |
} | |
*/ | |
# Получаем данне СМС | |
$this->sms_data = array( | |
'billing_sms_id' => $_GET['smsid'], |
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
<? | |
function _driver_sms2ru() { | |
# Проверяем секретный ключ | |
$key_md5 = md5(trim($this->config['billing_secret_key']) . $_GET['id']); | |
/* if($_GET['key'] != $key_md5) { | |
exit('hacking attempt'); // скрипт был вызван с неправильным параметром безопасности. | |
} | |
*/ | |
# Получаем данне СМС | |
$this->sms_data = array( |
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
<? | |
function _driver_sms2ru() { | |
# Проверяем секретный ключ | |
$key_md5 = md5(trim($this->config['billing_secret_key']) . $_GET['id']); | |
/* if($_GET['key'] != $key_md5) { | |
exit('hacking attempt'); // скрипт был вызван с неправильным параметром безопасности. | |
} | |
*/ | |
# Получаем данне СМС | |
$this->sms_data = array( |
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 System.IO | |
import System.IO.Error | |
import Control.Monad | |
import Network.HTTP | |
import qualified Data.Map as Map | |
type FreqDB = Map.Map String Integer | |
updateFreq freq word = Map.insertWith' (+) word 1 freq |
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
data Bool' = False' | True' deriving (Eq, Show, Ord) | |
not :: Bool' -> Bool' | |
not False' = True' | |
not True' = False' | |
(\/) :: Bool'->Bool'->Bool' |
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
data Logic a where | |
B :: Bool -> Logic Bool | |
And :: Logic Bool -> Logic Bool -> Logic Bool | |
Or :: Logic Bool -> Logic Bool -> Logic Bool | |
Imp :: Logic Bool -> Logic Bool -> Logic Bool | |
Not :: Logic Bool -> Logic Bool | |
imp :: Bool->Bool->Bool | |
imp False _ = True | |
imp True True = True |
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
data Logic a where | |
I :: Int -> Logic Int | |
B :: Bool -> Logic Bool | |
lEqual :: Logic a -> Logic b -> Bool | |
lEqual (I x) (I y) = x == y | |
lEqual (B x) (B y) = x == y | |
lEqual _ _ = False | |
instance Eq (Logic a) where |
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.List (group) | |
rle:: String -> [(Char, Int)] | |
rle [] = error "Empty List" | |
rle [x] = [(x, 1)] | |
rle st@(x:xs) = (head start, cnt) : rle ending where | |
start = takeWhile (==x) st | |
cnt = length start | |
ending = drop cnt st |
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.List | |
infinityString st = st ++ infinityString st | |
split :: String->Char->[String] | |
split [] ch = [] | |
split st ch = start : split ending ch where | |
(start, e) = break (==ch) st | |
ending = drop 1 e |
OlderNewer