Skip to content

Instantly share code, notes, and snippets.

View benwaffle's full-sized avatar
🍝
best spaghetti in town

Ben Iofel benwaffle

🍝
best spaghetti in town
View GitHub Profile
warmup: car
backtrack: d a(?! o).*re
articles and vowels: ou|j|wi
dates: ^..[^nr]
binary: ,010.*1$
contains: ta|[ae]t
binary expansion: ^1|\(1\)(?!\+0)
prime: ^(?!(xx+)\1+$)
capitals: me|[xJRf]|er
cats and dogs: [FBNV]|er|ya|io
From 1ddb5e4010bd9e03a686eedf7abf3208faddcbaa Mon Sep 17 00:00:00 2001
From: Ben Iofel <iofelben@gmail.com>
Date: Sun, 7 Jan 2018 01:41:42 -0500
Subject: [PATCH] Make gdb plugin print type names
---
gobject/gobject_gdb.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gobject/gobject_gdb.py b/gobject/gobject_gdb.py
From ad079956bc6694792eb3211c2f9bfae60f6e12bd Mon Sep 17 00:00:00 2001
From: Ben Iofel <iofelben@gmail.com>
Date: Sat, 25 Nov 2017 02:10:50 -0500
Subject: [PATCH] Default value of enum should be the first one
This fixes g_param_spec_enum errors when using enums that don't have a 0 value
---
codegen/valaccodeattribute.vala | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
From 8575997fb76d0e08c2d1efb5602098a6120cb6c6 Mon Sep 17 00:00:00 2001
From: Ben Iofel <iofelben@gmail.com>
Date: Tue, 10 Oct 2017 02:10:54 +0200
Subject: [PATCH] init data structures inline
---
Assignment2/ApparatusType.java | 5 +----
Assignment2/Client.java | 3 +--
Assignment2/Gym.java | 8 +++-----
3 files changed, 5 insertions(+), 11 deletions(-)
diff --git a/Assignment2/Gym.java b/Assignment2/Gym.java
index bca7892..252688b 100755
--- a/Assignment2/Gym.java
+++ b/Assignment2/Gym.java
@@ -16,7 +16,7 @@ public class Gym implements Runnable {
private static final int GYM_SIZE = 30;
private static final int GYM_REGISTERED_CLIENTS = 10000;
- private Map<WeightPlateSize, Integer> noOfWeightPlates;
+ private Map<WeightPlateSize, Integer> noOfWeightPlates = new HashMap<>();
diff --git a/Assignment2/Exercise.java b/Assignment2/Exercise.java
index e962ea0..b4bd4fb 100755
--- a/Assignment2/Exercise.java
+++ b/Assignment2/Exercise.java
@@ -78,16 +78,7 @@ public class Exercise {
for(WeightPlateSize wps : WeightPlateSize.values()) {
for(int i = 0 ; i < weights.get(wps); i++) {
try {
- switch (wps) {
- case SMALL_3KG:
diff --git a/Assignment2/ApparatusType.java b/Assignment2/ApparatusType.java
index b7f56c2..8527bd7 100755
--- a/Assignment2/ApparatusType.java
+++ b/Assignment2/ApparatusType.java
@@ -16,13 +16,7 @@ public enum ApparatusType {
private static final int INIT_APPARATUS_NUM = 5;
- public static Map<ApparatusType, Semaphore> apparatusPermissions = new HashMap<ApparatusType, Semaphore>();
-
CFLAGS += -pthread -std=c99 -Wall -Wextra -g
assign1: main.c consumer.c producer.c product.c dlqueue.c scheduler.c
$(CC) $(CFLAGS) -o $@ $^
From 9a3c14bcd78eec343c8133ae26f0ef9ab373a65b Mon Sep 17 00:00:00 2001
From: Ben Iofel <iofelben@gmail.com>
Date: Tue, 22 Nov 2016 16:26:39 -0500
Subject: [PATCH] vapigen: fix logic
---
vala/valagirparser.vala | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/vala/valagirparser.vala b/vala/valagirparser.vala
#include "my.h"
int main(int argc, char const *argv[]){
/*Variable Declarations for Testing*/
char str[] = {'H','E','L','L','O','\0'};
char* arr = (char*)malloc(sizeof(char) * 20);
char** vecTest = (char**)malloc(sizeof(char*) * 6);
char** badVec = (char**)malloc(sizeof(char*) * 4);
char* temp;