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
| """ | |
| The most atomic way to train and run inference for a GPT in pure, dependency-free Python. | |
| This file is the complete algorithm. | |
| Everything else is just efficiency. | |
| @karpathy | |
| """ | |
| import os # os.path.exists | |
| import math # math.log, math.exp |
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
| // evm.ts | |
| // —— Helpers ——————————————————————————————————————————————— | |
| type U256 = bigint; | |
| // bytes → bigint via hex string | |
| function fromBytes(bytes: Uint8Array): U256 { | |
| const hex = [...bytes].map(b => b.toString(16).padStart(2, '0')).join(''); | |
| return BigInt('0x' + hex); |
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
| var getPosition = function (options) { | |
| return new Promise(function (resolve, reject) { | |
| navigator.geolocation.getCurrentPosition(resolve, reject, options); | |
| }); | |
| } | |
| getPosition() | |
| .then((position) => { | |
| console.log(position); | |
| }) |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta name="viewport" content="initial-scale=1.0, user-scalable=no"> | |
| <meta charset="UTF-8"> | |
| <title>Drawing Tools</title> | |
| <script type="text/javascript" | |
| src="http://maps.google.com/maps/api/js?sensor=false&libraries=drawing"></script> | |
| <style type="text/css"> | |
| #map, html, body { |