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 FlexibleContexts, FlexibleInstances, UndecidableInstances, TypeFamilies, PolyKinds, GADTs, MultiParamTypeClasses, FunctionalDependencies, RankNTypes, DataKinds #-} | |
import Data.Kind | |
import Prelude hiding (id, (.), Functor(..), Monad(..), Monoid(..)) | |
-- 'Category k' is a category whose objects are 'Ob k a => a' and whose | |
-- morphisms (of kind *) are '(Ob k a, Ob k b) => k a b' | |
class Category (k :: o -> o -> *) where | |
type Ob (k :: o -> o -> *) (a :: o) :: Constraint | |
id :: Ob k a => k a a | |
(.) :: (Ob k a, Ob k b, Ob k c) => k b c -> k a b -> k a c |
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
<?php | |
$instructions = ['0', '1', '+', '-', '*', '/', '>', '<', '=', '|', '&', '@', '!', '#', '(', ')', '%', '_']; | |
$instructionsLength = count($instructions) - 1; | |
while (true) { | |
$program = ''; | |
for ($i = 0, $c = rand(0, 10); $i < $c; $i++) { | |
$program .= $instructions[rand(0, $instructionsLength)]; | |
} | |
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
nitrix@pluto ~/projects/ni/boot [develop]$ php vm.php test | |
Instruction SBNZ [$0=9, $1=0, $2=8, $3=-1] | |
Enter a character: f | |
Performing `$8 = $0 - $9`, the values are `-11 = 102 - 113` | |
Instruction SBNZ [$4=1, $5=1, $6=8, $7=0] | |
Performing `$8 = $1 - $1`, the values are `0 = 0 - 0` | |
Result is zero, branching to 0 | |
Instruction SBNZ [$0=9, $1=0, $2=8, $3=-1] | |
Enter a character: g | |
Performing `$8 = $0 - $9`, the values are `-10 = 103 - 113` |
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
.global main | |
.global printf | |
.text | |
main: | |
mov %rsp, base | |
jmp next | |
core: | |
next: | |
mov ip, %rax | |
add $8, ip |
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.Array | |
import Data.Maybe | |
import Data.Bits | |
type Hash = Integer | |
type HashMap k v = Array Hash [(k,v)] | |
hmCreate :: (Eq k, Show k) => HashMap k v -> k -> v -> HashMap k v | |
hmCreate hm k v = hm // [(hmHash hm k, after)] | |
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
##programming | |
SrPx | As a side question, if a company has an income, and it wants to compute the most it can of a problem in 10 years, is it better to buy computers as you income comes, or wait 9 years, buy faster computers and to do much more on the last year? Hmm. Not sure why I'm asking this here, that is a math question. |
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
<?php | |
/******************* CONFIG *******************/ | |
$config_nn_layout = [2, 3, 2, 1]; | |
$config_nn_step = 7; | |
/******************** MAIN ********************/ | |
$neurons = nn_init_neurons($config_nn_layout); | |
$weights = nn_init_weights($config_nn_layout); | |
while (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
<?php | |
$data ='O:8:"stdClass":3:{s:3:"aaa";a:5:{i:0;i:1;i:1;i:2;i:2;s:39:"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";i:3;i:4;i:4;i:5;}s:3:"aaa";i:1;s:3:"ccc";R:5;}'; | |
$x = unserialize($data); | |
var_dump($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
P2 | |
# feep.pgm | |
24 7 | |
15 | |
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | |
0 3 3 3 3 0 0 7 7 7 7 0 0 11 11 11 11 0 0 15 15 15 15 0 | |
0 3 0 0 0 0 0 7 0 0 0 0 0 11 0 0 0 0 0 15 0 0 15 0 | |
0 3 3 3 0 0 0 7 7 7 0 0 0 11 11 11 0 0 0 15 15 15 15 0 | |
0 3 0 0 0 0 0 7 0 0 0 0 0 11 0 0 0 0 0 15 0 0 0 0 | |
0 3 0 0 0 0 0 7 7 7 7 0 0 11 11 11 11 0 0 15 0 0 0 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
P2 | |
# CREATOR: GIMP PNM Filter Version 1.1 | |
360 490 | |
255 | |
255 | |
255 | |
255 | |
255 | |
255 | |
255 |