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
require 'ruby2d' | |
require 'bomp' | |
class Box < Rectangle | |
attr_reader :x, :y, :width, :height | |
def initialize | |
super() | |
self.width = rand 50..150 | |
self.height = rand 50..150 |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<script src="https://cdn.jsdelivr.net/npm/brython@3/brython.min.js"></script> | |
<script src="https://cdn.jsdelivr.net/npm/brython@3/brython_stdlib.js"></script> | |
<script src="https://cdn.jsdelivr.net/npm/melonjs/dist/melonjs.js"></script> |
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
{ | |
"private": true, | |
"scripts": { | |
"build": "tstl", | |
"dev": "tstl --watch", | |
"love": "love dist" | |
}, | |
"devDependencies": { | |
"typescript-to-lua": "...", | |
"love-typescript-definitions": "...", |
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
CC = g++ | |
CFLAGS = -Wall -std=c++2a -m32 -march=i386 | |
LDFLAGS = -static -static-libstdc++ | |
CLIBS = | |
SRC = src | |
OBJ = obj | |
DEP = include |
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 <iostream> | |
#include <istream> | |
#include <regex> | |
#include <string> | |
#include <vector> | |
#include <map> | |
#include <algorithm> | |
const auto args = "register --name Diego Sealtiel Valderrama Garcia --age 21 -m --software-engineer AFF8310274"; | |
const std::vector<std::string> except_flags = {"--software-engineer", "-m"}; |
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
interface ObjectCallable { | |
call(...args: any[]): void | |
} | |
class ClosurePrintLine implements ObjectCallable { | |
private _it: number | |
private _step: number | |
constructor(step: number = 16) { | |
this._it = 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
#include <iostream> | |
#include <string> | |
#include <map> | |
#include <thread> | |
#include <functional> | |
#include <forward_list> | |
#include <cstdio> | |
typedef std::map<std::string, void*> MemoryState; // map is no optimized, need a forward_list |
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
#!/usr/bin/ruby | |
=begin | |
Perceptron simple with self-learning | |
Demonstration of an OR gate programmed in Ruby | |
with a simple perceptron | |
=end | |
inputs = [[-1, -1], [-1, 1], [1, -1], [1, 1]] |
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
template<typename T> | |
class Pipe { | |
T m_value; | |
public: | |
Pipe(const T &value) : m_value(value) { /**/ } | |
Pipe<T> operator |(const std::function<T(T)> &func) { | |
return func(m_value); | |
} |
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
template<typename R, typename ...Args> | |
class Functor { | |
protected: | |
virtual R call(Args ...args) = 0; | |
public: | |
R operator()(Args ...args) { | |
return call(args...); | |
} | |
}; |
OlderNewer