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
| <?php | |
| function forth_calc($input) { | |
| $stack = array(); | |
| foreach (explode(' ', $input) as $chunk) { | |
| if ($chunk === '+') { | |
| $stack[] = array_pop($stack) + array_pop($stack); | |
| } elseif ($chunk === '-') { | |
| $stack[] = array_pop($stack) - array_pop($stack); |
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
| from __future__ import print_function | |
| import time | |
| input = '10 20 100 + - 20 * DUP 10 20 + *'; | |
| t = time.time() | |
| for x in xrange(0, 100000): | |
| stack = [] | |
| for chunk in input.split(' '): |
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
| <?php | |
| $input = '10 20 100 + - 20 * DUP 10 20 + *'; | |
| $t = microtime(1); | |
| for ($i = 0; $i < 100000; $i++) { | |
| $stack = array(); | |
| foreach (explode(' ', $input) as $chunk) { | |
| switch ($chunk) { |
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
| [ | |
| { "keys": ["super+g"], "command": "find_under", "context": | |
| [ | |
| { "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true } | |
| ] | |
| }, | |
| { "keys": ["super+c"], "command": "noop", "context": | |
| [ | |
| { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true } | |
| ] |
NewerOlder