Skip to content

Instantly share code, notes, and snippets.

#include <iostream>
#include <vector>
int main() {
std::vector <std::string *> pointers(10);
pointers[0] = new std::string("Hello");
pointers[5] = new std::string("I'm index 5");
for(int i=0;i<pointers.size();i++) {
if(pointers[i] != 0) {
std::cout << *pointers[i] << "\n";
#include <iostream>
int main() {
std::string * pointers[10];
memset(&pointers,0,sizeof pointers);
pointers[0] = new std::string("Hello");
pointers[5] = new std::string("I'm index 5");
for(int i=0;i<10;i++) {
if(pointers[i] != 0) {
std::cout << *pointers[i] << "\n";
<html>
<head>
<title>Webmaster Exam 2012</title>
<link href='http://fonts.googleapis.com/css?family=Sevillana' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="http://www.redbrick.dcu.ie/~vadimck/webmasterexam2012LAWL/includes/style.css" />
<script src="http://www.redbrick.dcu.ie/~vadimck/webmasterexam2012LAWL/includes/jquery-1.7.1.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
$.post('http://www.redbrick.dcu.ie/~vadimck/webmasterexam2012LAWL/exam.php', { valid: "bundy" }, function(data) {
#include <iostream>
class Test {
private:
std::string* message;
public:
Test();
void setMessage(std::string* message);
void putMessage();
@imduffy15
imduffy15 / Test.cpp
Created March 29, 2013 23:23
Compile with: g++ main.cpp Test.cpp
#include "Test.h"
Test::Test() {}
void Test::setMessage(std::string* message) {
this->message = message;
}
void Test::putMessage() {
std::cout << *this->message;
}
@imduffy15
imduffy15 / main.cpp
Created March 29, 2013 23:26
Example of new
#include <string>
#include "Test.h"
int main() {
Test item = Test();
item.setMessage(new std::string("Hello World"));
item.putMessage();
return 0;
}
[alias]
# View the SHA, description, and history graph of the latest 20 commits
l = log --pretty=oneline -n 20 --graph
# View the current working tree status using the short format
s = status -s
# Show the diff between the latest commit and the current state
d = !"git diff-index --quiet HEAD -- || clear; git diff --patch-with-stat"
# `git di $number` shows the diff between the state `$number` revisions ago and the current state
di = !"d() { git diff --patch-with-stat HEAD~$1; }; git diff-index --quiet HEAD -- || clear; d"
# Pull in remote changes for the current repository and all its submodules
.data
N: .word 20
a0: .word 23 ; a[0]
.word 12 ; a[1]
.word 19 ; a[2]
.word 9 ; .
.word 98 ; .
.word 4 ; .
.word 7
.data
N: .word 20
a0: .word 23
.word 12
.word 19
.word 9
.word 98
.word 4
.word 7
.data
N: .word 1000
CONTROL: .word 0x10000
DATA: .word 0x10008
max: .word 65536 ; size of primes space
primes: .space 65536 ; space for MAX/8 8-byte primes
.text
ld r20,CONTROL(r0)