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
// To compile with gcc: (tested on Ubuntu 14.04 64bit): | |
// g++ sdl2_opengl.cpp -lSDL2main -lSDL2 -lGL | |
// To compile with msvc: (tested on Windows 7 64bit) | |
// cl sdl2_opengl.cpp /I C:\sdl2path\include /link C:\path\SDL2.lib C:\path\SDL2main.lib /SUBSYSTEM:CONSOLE /NODEFAULTLIB:libcmtd.lib opengl32.lib | |
#include <stdio.h> | |
#include <stdint.h> | |
#include <assert.h> | |
#include <SDL2/SDL.h> | |
#include <SDL2/SDL_opengl.h> |
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
\documentclass[11pt]{article} | |
\begin{document} | |
\section{Question} | |
a. thing \\ | |
b. thing \\ | |
c. thing \\ | |
d. thing | |
\section{Question} |
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
<resources> | |
<string-array name="sport_select"> | |
<item>"American Footbal"</item> | |
<item>"Archery"</item> | |
<item>"Badminton"</item> | |
<item>"Baseball"</item> | |
<item>"Basketball"</item> | |
<item>"Beach Volleyball"</item> | |
<item>"Bowling"</item> |
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
sudo apt-get install libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev libsdl2-gfx-dev libsdl2-net-dev |
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
// counts to the number provided with even numbers using a recursive recursive algo | |
// written by Matthew Early, but hey this is a pretty common practice problem | |
// default compile: | |
// compile in terminal with 'g++ recursive-even-counter.cpp' | |
// run with './a.out' in terminal | |
#include <iostream> | |
#include <cstdlib> | |
using namespace std; |
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
; extra all list elements in a list | |
(define (extract-list lst) | |
(cond ((null? lst) lst) | |
((list? (car lst)) (cons (car lst) (extract-lists (cdr lst)))) | |
(else (extract-list (cdr lst)) | |
) | |
) | |
; return number of even integers | |
(defin (count-even lst) |
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 <string> | |
#include <cctype> | |
bool findStringIC(const std::string & strHaystack, const std::string & strNeedle) { | |
auto it = std::search( | |
strHaystack.begin(), strHaystack.end(), | |
strNeedle.begin(), strNeedle.end(), | |
[](char ch1, char ch2) { return std::tolower(ch1) == std::tolower(ch2); } | |
); | |
return (it != strHaystack.end() ); |
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
#pragma once | |
#include <string> | |
#include <sstream> | |
#include <vector> | |
#include <iterator> | |
// split function for c++ -- from http://stackoverflow.com/questions/236129/split-a-string-in-c | |
template<typename Out> |
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
#pragma once | |
#include <string> | |
//because other langauges have these and the c++ does not | |
//Trims whitespace - from http://stackoverflow.com/questions/1798112/removing-leading-and-trailing-spaces-from-a-string | |
std::string trim(const std::string& str, | |
const std::string& whitespace = " \t") | |
{ | |
const auto strBegin = str.find_first_not_of(whitespace); |
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
(*find i within the lst*) | |
let rec member i lst = | |
match lst with | |
[] -> false | |
| hd::tl -> hd = i || member i tl;; | |
(*with if else instead*) |
NewerOlder