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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <memory.h> | |
#include <syslog.h> | |
#include <sys/types.h> | |
#include <sys/stat.h> | |
#include <fcntl.h> | |
#include <sys/mman.h> | |
#include <errno.h> | |
#include <stdint.h> |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <memory.h> | |
#include <syslog.h> | |
#include <sys/types.h> | |
#include <sys/stat.h> | |
#include <fcntl.h> | |
#include <sys/mman.h> | |
#include <errno.h> | |
#include <stdint.h> |
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
# Install: | |
cd ~ | |
git clone https://github.com/emscripten-core/emsdk.git | |
cd emsdk | |
./emsdk install sdk-incoming-64bit | |
./emsdk activate sdk-incoming-64bit | |
source ./emsdk_env.sh | |
# Build: | |
cd emscripten/incoming |
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
::Install | |
git clone https://github.com/emscripten-core/emsdk.git | |
cd emsdk | |
emsdk install sdk-incoming-64bit | |
emsdk activate sdk-incoming-64bit | |
emsdk_env.bat | |
::Build | |
cd emscripten\incoming | |
em++ tests/hello_world.cpp -o hello_world.js |
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
module top( | |
input clk_27mhz, // The built-in 27 MHz oscillator clock. Using timing constraint: create_clock -name clk_27mhz -period 37.037 [get_ports {clk_27mhz}] | |
input external_clk, // And external clock signal at 12.5 - 32 MHz frequency. Using timing constraint: create_clock -name external_clk -period 31.25 [get_ports {external_clk}] | |
input which_clock_to_use, | |
output reg o_a, | |
output reg o_b, | |
output o_clk | |
); | |
always @(posedge clk_27mhz) begin |
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
using System; | |
using System.Runtime.InteropServices; | |
using UnityEngine; | |
public class code : MonoBehaviour | |
{ | |
void Start() | |
{ | |
Method1(); | |
Method2(); |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <assert.h> | |
char *read_file_to_string(const char *filename) | |
{ | |
FILE *handle = fopen(filename, "r"); | |
fseek(handle, 0, SEEK_END); | |
long size = ftell(handle); | |
fseek(handle, 0, SEEK_SET); |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <memory.h> | |
char *read_file_to_string(const char *filename) | |
{ | |
FILE *handle = fopen(filename, "r"); | |
fseek(handle, 0, SEEK_END); | |
long size = ftell(handle); | |
fseek(handle, 0, SEEK_SET); |
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
# Usage: python cube_folding.py input.txt | |
import math, sys | |
lines = open(sys.argv[1] if len(sys.argv) > 1 else 'input.txt', 'r').read().split('\n') | |
# Remove instructions line from input | |
lines = lines[:-1] | |
if len(lines[-1]) == 0: lines.pop() # Remove possible empty line between map and instructions | |
# Compute cube surface area |
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
// License: public domain. | |
#include <dos.h> | |
#include <conio.h> | |
void set_video_mode(int mode) | |
{ | |
union REGS regs; | |
regs.x.ax = mode; | |
int86(0x10, ®s, ®s); |
OlderNewer