This file contains hidden or 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 logging | |
| import struct | |
| from dataclasses import dataclass | |
| from PIL import Image | |
| @dataclass | |
| class Header: | |
| p1: bytearray |
This file contains hidden or 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 "stdafx.h" | |
| #include <iostream> | |
| #include <omp.h> | |
| using namespace std; | |
| int main() | |
| { | |
| const int n = 10; | |
| int *mArray = new int[n * n]; |
This file contains hidden or 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
| # Eugene Auduchinok, 2015 | |
| # Solution for some Stepic task | |
| require 'prime' | |
| def count_primes | |
| count = 0 | |
| (0...512).each do |index| | |
| bits = to_bits index |
This file contains hidden or 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
| revert :: L a -> L a | |
| revert N = N | |
| revert (O a x b) = O (revert b) x (revert a) | |
| revert (E a b) = E (revert b) (revert a) | |
| instance (Show a) => Show (L a) where | |
| show N = "[]" | |
| show x = "[" ++ (init $ show' x) ++ "]" where | |
| show' N = "" | |
| show' (E a b) = show' a ++ show' b |
This file contains hidden or 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 Tsil a = Lin | Snoc (Tsil a) a | |
| deriving Show | |
| foldr' :: (a -> b -> b) -> b -> Tsil a -> b | |
| foldr' f a Lin = a | |
| foldr' f a (Snoc xs x) = foldr' f (f x a) xs | |
| foldl' :: (b -> a -> b) -> b -> Tsil a -> b |