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 <gtk/gtk.h> | |
/* to compile in ubuntu: | |
* | |
* sudo apt install libgtk2.0-dev | |
* | |
* in bash: gcc `pkg-config --cflags --libs gtk+-2.0` learning_gtk.c -o learning_gtk | |
* in fish shell: gcc learning_gtk.c (pkg_config --cflags --libs gtk+-2.0 | perl -pe | |
* 's/\s+/\n/g) -o learning_gtk | |
*/ |
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.Diagnostics; | |
using System.Linq; | |
namespace csharpdynamiccompilationtest | |
{ | |
public class RegularClass | |
{ | |
public static int Get(int[] i) { return i.Sum() + Program.rng.Next(1, 5); } | |
} |
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 <windows.h> | |
#include <shellscalingapi.h> | |
int CALLBACK | |
WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) | |
{ | |
// https://docs.microsoft.com/en-us/windows/win32/api/shellscalingapi/nf-shellscalingapi-setprocessdpiawareness | |
SetProcessDpiAwareness(PROCESS_PER_MONITOR_DPI_AWARE); | |
MessageBoxA(0, "Message box text!", "Message Box information", MB_OK|MB_ICONINFORMATION); |
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
filetype plugin indent on | |
syntax on | |
set enc=utf-8 | |
set fenc=utf-8 | |
set termencoding=utf-8 | |
set nocompatible | |
set autoindent | |
set smartindent | |
set tabstop=4 | |
set shiftwidth=4 |
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
package main | |
import ( | |
"encoding/json" | |
"log" | |
"net/http" | |
"strconv" | |
"time" | |
"github.com/gorilla/mux" |
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 <random> | |
#include <cmath> | |
#include <Eigen/Core> | |
#include "pcg_random.hpp" | |
using namespace Eigen; | |
template<unsigned int Size> | |
struct neuron { |
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
/* | |
Sample output: | |
12/14/18 07:05:12 | |
Running neuroevolution.exe | |
Run on (8 X 3492 MHz CPU s) | |
CPU Caches: | |
L1 Data 32K (x4) | |
L1 Instruction 32K (x4) | |
L2 Unified 262K (x4) |
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 <chrono> | |
#include <SQLiteCpp/SQLiteCpp.h> | |
int main() { | |
auto start = std::chrono::high_resolution_clock::now(); | |
SQLite::Database db("example.db3", SQLite::OPEN_READWRITE | SQLite::OPEN_CREATE); | |
db.exec("create table if not exists test(id integer primary key autoincrement, name text, size integer)"); |
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 <chrono> | |
#include <pqxx/pqxx> | |
int main(int, char *argv[]) | |
{ | |
pqxx::connection c("dbname=arete user=postgres password=postgres"); | |
{ | |
pqxx::work txn(c); |
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
/* sample output (on an 8 core machine): | |
time elapsed (parallel): 732.39394ms | |
999: false | |
time elapsed (serial): 5.857433675s | |
999: false | |
5.857433675 seconds / 732.39394 ms = 7.99765448 ~= 8 | |
*/ |