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
int SearchAndIncrement(int x, list** head) { | |
int contapos = 0; | |
list* i; | |
// Let's find the element with the matching key | |
for (i = *head; i != NULL; i = i->next, contapos++) | |
if (i->key == x) | |
break; | |
// If we did not find the node, return -1 to denote failure. |
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
[2:25pm][wlynch@watermelon /tmp] cat foo.c | |
#include <assert.h> | |
#include <stdlib.h> | |
#include <stdio.h> | |
typedef struct _list { | |
int key; | |
int freq; | |
struct _list *next; | |
struct _list *prev; |
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
struct JumpTableEntry { | |
int & usage; | |
}; | |
int main() { | |
int x; | |
JumpTableEntry e = {x}; | |
} |
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
class Collider { | |
}; | |
class SpecificCollider : public Collider { | |
}; | |
struct ColliderDetails { | |
std::unique_ptr<Collider> collider; | |
ColliderDetails(ColliderDetails&& o) noexcept |
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
; Function Attrs: nounwind ssp uwtable | |
define i32 @main() #0 { | |
%1 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([3 x i8]* @.str, i64 0, i64 0), double 3.500000e+00) #3 | |
ret i32 0 | |
} |
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 <map> | |
int main() { | |
std::map<int, int> m; | |
m[0] = m.size(); | |
// m[0] can legally be either 0 or 1. | |
} |
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 <map> | |
#include <boost/filesystem.hpp> | |
int main() { | |
std::map<float, std::vector<boost::filesystem::path>> labeledImages; | |
labeledImages[3] = { boost::filesystem::path("/"), }; | |
labeledImages[7] = { boost::filesystem::path("/"), boost::filesystem::path("/tmp"), }; | |
for (auto& labeledPathsPair : labeledImages) { |
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
# Makefile! | |
SOURCES := $(sort $(wildcard src/*.cpp src/*.cu src/*.cc src/*.c)) | |
OBJECTS := $(sort $(patsubst src/%, obj/%.o, $(SOURCES))) | |
DEPENDS := $(sort $(patsubst src/%, obj/%.d, $(SOURCES))) | |
CFLAGS += | |
CUFLAGS += | |
CPPFLAGS += | |
LDFLAGS += |
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 <boost/spirit/home/qi.hpp> | |
#include <boost/spirit/home/lex.hpp> | |
#include <boost/spirit/home/lex/lexer/lexertl/lexer.hpp> | |
struct dtype { | |
dtype() {} | |
dtype(std::string const & value) {} | |
}; |
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
[11:59pm][wlynch@fallston ~/test] ipython | |
Python 2.4.3 (#1, Sep 21 2011, 19:55:41) | |
Type "copyright", "credits" or "license" for more information. | |
IPython 0.8.4 -- An enhanced Interactive Python. | |
? -> Introduction and overview of IPython's features. | |
%quickref -> Quick reference. | |
help -> Python's own help system. | |
object? -> Details about 'object'. ?object also works, ?? prints more. |
OlderNewer