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 <SFML/Graphics.hpp> | |
#include <SFML/System.hpp> | |
#include <iostream> | |
#include <vector> | |
#include <stdint.h> | |
#include <cstring> | |
#include <string> | |
#include <fstream> | |
typedef struct mapformat { |
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
PKGS = \ | |
--pkg gee-1.0 \ | |
--pkg gsl \ | |
--pkg sdl \ | |
--pkg sdl-mixer \ | |
--pkg sdl-image \ | |
--pkg gl \ | |
--pkg glu | |
LIBS = \ | |
-X -LC:\Windows\System32 \ |
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 <iostream> | |
int main (int argc, char *argv[]) { | |
int x = 42; | |
int y = 99; | |
auto lambda = [x, &y]() mutable { | |
x++; | |
// Because x is not referenced, it will never effect the global x | |
// however it will be effected inside this same lambda, so running it | |
// multiple times will result x incremenint, but not the global x |
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
with Ada.Wide_Text_IO; | |
procedure Main is | |
subtype Tile_Width is Wide_String (1 .. 3); | |
Dot : constant Tile_Width := ". "; | |
Map : constant array (1 .. 5, 1 .. 5) of Tile_Width := | |
(("╔", "═", "═", "═", "╗"), | |
("║", Dot, Dot, Dot, "║"), | |
("║", Dot, Dot, Dot, "║"), | |
("║", Dot, Dot, Dot, "║"), |
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
all: | |
gnatmake -O3 -gnatv -gnaty main.adb | |
time ./main |
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
all: | |
gcc gd-bench.c -lgd -o gd-bench | |
gcc `MagickWand-config --cflags --cppflags` magick-bench.c -o magick-bench `MagickWand-config --ldflags --libs` | |
time ./gd-bench | |
time ./magick-bench | |
#GD is faster 29% faster |
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
all: | |
/usr/local/lib/fpc/2.4.4/ppc386 -g fprun.pas; |
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 'toDouble' will take a string and force it to a Double. On failure the | |
it will just return 0.00 | |
-} | |
toDouble :: String -> Double | |
toDouble x = do | |
-- try to convert a String to a decimal number, if not fall back to a string, | |
-- this will prevent haskell from erroring out | |
case reads x :: [(Double, String)] of | |
-- if there is a match for any decimal number and an empty string |
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
import Text.Printf | |
isInt x = x == fromInteger (round x) | |
{-| | |
The 'toDouble' will take a string and force it to a Double. On failure, it | |
will return 0.00 | |
-} | |
toDouble :: String -> Double | |
toDouble x = do |
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
CREATE TABLE `movies`.`movies_movie` ( | |
`id` INT NOT NULL AUTO_INCREMENT, | |
`title` VARCHAR(255) NOT NULL, | |
`year` SMALLINT NOT NULL, | |
PRIMARY KEY (`id`) | |
) | |
ENGINE = InnoDB | |
CHARACTER SET utf8 COLLATE utf8_general_ci; |