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
| LC_REQ_DYLD = 0x80000000 | |
| LC_SEGMENT = 0x01 | |
| LC_SYMTAB = 0x02 | |
| LC_SYMSEG = 0x03 | |
| LC_THREAD = 0x04 | |
| LC_UNIXTHREAD = 0x05 | |
| LC_LOADFVMLIB = 0x06 | |
| LC_IDFVMLIB = 0x07 | |
| LC_IDENT = 0x08 |
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 <mach-o/compact_unwind_encoding.h> | |
| #include <mach-o/fixup-chains.h> | |
| #include <mach-o/ldsyms.h> | |
| #include <mach-o/loader.h> | |
| #include <mach-o/nlist.h> | |
| #include <stdio.h> | |
| #include <string.h> | |
| #define ARRAYSIZE(a) (sizeof(a) / sizeof(a[0])) | |
| #define ALIGN(x, a) (((x) + (a) - 1) & ~((a) - 1)) |
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
| # fmt: off | |
| # https://gymnasium.farama.org/tutorials/training_agents/reinforce_invpend_gym_v26/ | |
| # https://gymnasium.farama.org/environments/mujoco/inverted_double_pendulum/ | |
| """ | |
| Training using REINFORCE for Mujoco | |
| =================================== | |
| .. image:: /_static/img/tutorials/reinforce_invpend_gym_v26_fig1.gif |
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
| const WIDTH = 600, HEIGHT = 600 | |
| const DIV = 64 | |
| const TWO_PI = 2 * Math.PI | |
| const MIN_TIME = 60 | |
| const MAX_TIME = 300 | |
| const TRANSITION_RATIO = 1.0 / 100 | |
| function randi(min, max) { | |
| return Math.floor(random(min, max + 1)) |
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
| // Ref. https://craftinginterpreters.com/ | |
| #include <assert.h> | |
| #include <inttypes.h> // PRIx64 | |
| #include <stdbool.h> | |
| #include <stdio.h> | |
| #include <stdlib.h> // malloc | |
| #include <stdint.h> | |
| #include <string.h> |
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 "getopt.h" | |
| #include <stdbool.h> | |
| #include <stddef.h> // NULL | |
| #include <stdio.h> | |
| #include <string.h> | |
| int optind, optopt; | |
| int opterr = 1; | |
| char *optarg; |
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
| // Original: https://www.kevinbeason.com/smallpt/ | |
| #include <math.h> | |
| #include <stdlib.h> | |
| #include <stdio.h> | |
| typedef struct { double x, y, z; } Vec; // position, also color (r,g,b) | |
| Vec vadd(Vec a, Vec b) { return (Vec){a.x+b.x, a.y+b.y, a.z+b.z}; } | |
| Vec vsub(Vec a, Vec b) { return (Vec){a.x-b.x, a.y-b.y, a.z-b.z}; } | |
| Vec vscale(Vec a, double b) { return (Vec){a.x*b, a.y*b, a.z*b}; } | |
| Vec vmult(Vec a, Vec b) { return (Vec){a.x*b.x, a.y*b.y, a.z*b.z}; } | |
| double vdot(Vec a, Vec b) { return a.x*b.x+a.y*b.y+a.z*b.z; } |
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
| // gist名指定用 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| 8....51.. | |
| ..1...8.. | |
| .4.2...9. | |
| ....3...2 | |
| 1234 6789 | |
| 6...1.... | |
| .8...9.5. | |
| ..2...4.. | |
| ..76....1 |
NewerOlder