Skip to content

Instantly share code, notes, and snippets.

View DanielDe's full-sized avatar

Daniel de Haas DanielDe

View GitHub Profile
generated Mar 05, 2023 09:19:54
system MacOS 13.2.1 Darwin 22.3.0 x86_64 mac
emacs 28.2 ~/.config/emacs/
doom 3.0.0-pre PROFILE=_@0 grafted, HEAD -> master, origin/master, origin/HEAD
8f6b045 2023-03-01 17:32:32 -0500 ~/.config/doom/
shell /usr/local/bin/fish
features ACL GMP GNUTLS JSON LIBXML2 MODULES NOTIFY KQUEUE PDUMPER THREADS
TOOLKIT_SCROLL_BARS XIM ZLIB
traits gui server-running envvar-file custom-file
custom safe-local-variable-values
require 'set'
def read_most_common_words
File.read('100_000-english.txt').split("\n")
end
def read_etymologies
File.read('etymwn-20130208/etymologies.tsv').split("\n").map do |line|
parts = line.downcase.split("\t")
[parts[0], parts[2]]
import Cocoa
import SwiftUI
import AppKit
@NSApplicationMain
class AppDelegate: NSObject, NSApplicationDelegate {
var window: NSWindow!
#include <iostream>
#include <vector>
using namespace std;
int vsum(const vector<int> & v, unsigned start_index);
int main() {
vector<int> v;
v.push_back(3);
// create 8 person objects on the heap
Person* a = new Person("A");
Person* b = new Person("B");
Person* c = new Person("C");
Person* d = new Person("D");
Person* e = new Person("E");
Person* f = new Person("F");
Person* g = new Person("G");
Person* h = new Person("H");
#include <iostream>
#include <vector>
using namespace std;
void print_vec(const vector<int> &);
int main() {
vector<int> test;
test.push_back(3);
@DanielDe
DanielDe / ex1.cpp
Created December 1, 2012 22:07
Week 9 Lab Exercise Solutions
#include <iostream>
#include <vector>
using namespace std;
void remove(vector<int>&, int);
void print(const vector<int>&);
int main() {
vector<int> v;
@DanielDe
DanielDe / ex1.cpp
Created November 21, 2012 05:07
Week 8 Lab Exercise Solutions
/*
This code is based on the first solution I posted for exercise 4 from Week 6. I placed a MODIFIED comment anywhere I changed the code.
*/
#include <iostream>
#include <vector>
using namespace std;
vector<string> extract_bold(string);
@DanielDe
DanielDe / Exercise 1 Solutions
Created November 17, 2012 05:48
Week 7 Lab Exercise Solutions
a. 10
b. 10
c. 10
d. 21
e. infinite loop
f. 11
g. 7
@DanielDe
DanielDe / ex4find.cpp
Created November 8, 2012 18:50
CS 10 SI Week 6 Lab Exercise Solutions
#include <iostream>
using namespace std;
string extract_bold(string);
int main() {
string test1 = "To <b>succeed</b> in <b>life</b> one must be <b>bold</b>!";
cout << extract_bold(test1) << endl;