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
/** | |
* Read all bytes from a file. | |
* | |
* Taken from http://codereview.stackexchange.com/questions/22901/reading-all-bytes-from-a-file | |
* | |
* Alternate form: static void ReadAllBytes(char const* filename, std::vector<char>& result) | |
*/ | |
#include <vector> | |
#include <fstream> |
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
<snippet> | |
<content><![CDATA[ | |
void ${1:ClassName}::${2:HandlerName}(wxCommandEvent& WXUNUSED(event)) | |
{ | |
${3:// Handler code} | |
} | |
]]></content> | |
<!-- Optional: Set a tabTrigger to define how to trigger the snippet --> | |
<tabTrigger>wxh</tabTrigger> | |
<!-- Optional: Set a scope to limit where the snippet will trigger --> |
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
/** | |
* TAKEN FROM: http://olecam.online.fr/wxNoLabelCheckBox/ | |
*/ | |
///////////////////////////////////////////////////////////////////////////// | |
// Name: wxNoLabelCheckBox.h | |
// Purpose: | |
// Author: Olivier Le Cam | |
// Modified by: Ben Draut, changed to inherit from wxPanel (Jul 2013) | |
// Created: 25/03/2008 19:01:21 |
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
/** | |
* TAKEN FROM: http://olecam.online.fr/wxNoLabelCheckBox/ | |
*/ | |
///////////////////////////////////////////////////////////////////////////// | |
// Name: wxNoLabelCheckBox.cpp | |
// Purpose: | |
// Author: Olivier Le Cam | |
// Modified by: Ben Draut, chaned to inherit from wxPanel (Jul 2013) | |
// Created: 25/03/2008 19:01:23 |
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
#!/bin/bash | |
# Quick script to install common dev tools. | |
# Ubuntu 13.04 | |
# 5/20/13 | |
# Quick Launcher (Ctrl+Space) | |
yes | sudo apt-get install synapse | |
# Git |
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
get_cmake_property(_variableNames VARIABLES) | |
foreach (_variableName ${_variableNames}) | |
message(STATUS "${_variableName}=${${_variableName}}") | |
endforeach() |
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 <sstream> | |
using namespace std; | |
int main() | |
{ | |
int* p1 = new int(10); | |
int* p2 = new int(20); |
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
<snippet> | |
<content><![CDATA[ | |
<script type="text/x-mathjax-config">MathJax.Hub.Config({tex2jax: {inlineMath: [['\$','\$']]}});</script> | |
<script type="text/javascript"src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script> | |
]]></content> | |
<!-- Optional: Set a tabTrigger to define how to trigger the snippet --> | |
<tabTrigger>amj</tabTrigger> | |
<!-- Optional: Set a scope to limit where the snippet will trigger --> | |
<scope>text.html.markdown</scope> | |
</snippet> |
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
#lang plai | |
(define nums '(0 1 2 3 4)) | |
(test (map add1 nums) '(1 2 3 4 5)) | |
(define (my-map f l) | |
(cond | |
[(empty? l) l] | |
[else (cons (f (first l)) |
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
(define curried-map-def '(rec (cm (fun (f) | |
(fun (l) | |
(bif (tempty? l) | |
l | |
(tcons (f (tfirst l)) | |
((cm f) (trest l))))))) | |
cm)) | |
(test/pred (infer-type (parse curried-map-def)) | |
(type=? (t-fun |
OlderNewer