Set up Wi-Fi:
sudo apt-get install bcmwl-kernel-source
sudo modprobe wl
in the file /etc/modules
, add the line
wl
in order to start up the wireless service upon reboot.
#include <memory> | |
#include <cstdio> | |
static void foo(std::unique_ptr<int> p) | |
{ | |
printf("%d\n", *p); | |
} | |
int main() | |
{ |
let SDL = dynld("sdl2"); | |
var timers = {}; | |
let timerWithEvent = fn (dt, callback) { | |
let tmr = SDL::StartTimer(dt); | |
timers[tmr] = callback; | |
}; | |
Set up Wi-Fi:
sudo apt-get install bcmwl-kernel-source
sudo modprobe wl
in the file /etc/modules
, add the line
wl
in order to start up the wireless service upon reboot.
let SDL = dynld("sdl2"); | |
let w = SDL::OpenWindow("Pong", 640, 480); | |
var paddle = { | |
"x": 0, | |
"y": 0, | |
"w": 100, | |
"h": 40 | |
}; |
Index: SDL2_gfxPrimitives.c | |
=================================================================== | |
--- SDL2_gfxPrimitives.c (revision 29) | |
+++ SDL2_gfxPrimitives.c (working copy) | |
@@ -3788,3 +3788,288 @@ | |
/* Draw polygon */ | |
return filledPolygonRGBA(renderer, px, py, 4, r, g, b, a); | |
} | |
+ | |
+/////// Gradient Drawing ////// |
#include <vector> | |
#include <array> | |
#include <unordered_map> | |
#include <string> | |
#include <iostream> | |
#include <fstream> | |
#include <algorithm> | |
#include <utility> | |
#include <memory> | |
#include <functional> |
// | |
// SpnMap: Sparkling's hash table, in C++ | |
// Created by Arpad Goretity on 13/01/2015 | |
// | |
#include <vector> | |
#include <utility> | |
#include <cstdint> | |
#include <climits> | |
#include <cassert> |
;; C-c C-e | |
(defun sparkling-eval-replace-expr (start end) | |
"Evaluate the contents of the selected region (or the region between START and END) as an expression and replace it with the result." | |
(interactive "r") | |
(call-process "spn" nil t nil "-e" (delete-and-extract-region start end)) | |
) | |
;; C-c C-r | |
(defun sparkling-eval-replace-stmt (start end) | |
"Evaluate the contents of the selected region (or the region between START and END) as statements and replace it with the result." |
This is a diff for Sparkling @ commit 665e00d51dae99493958fb2e25fe5d56ffb66a15 | |
Fixes some crashes in the parser caused by infinite recursion upon encountering certain types of malformed Sparkling source. | |
Bugs found using `zzuf`, a fuzzing tool. | |
This is a patch and not a proper commit because I'm rewriting the parser in the meantime, and I don't want to deal with conflicts. They will be undone anyway – this patch is just a temporary (but nonehteless important) bugfix. |
// This is how H2CO3 writes a JavaScript to better JavaScript compiler | |
function compile(source) { | |
return ""; // no JavaScript is definitely better than some JavaScript | |
} | |
// Usage example | |
var exampleSource = "window.alert('foo');"; | |
eval(compile(exampleSource)); // extra advantage: no more annoying alert windows! |