Skip to content

Instantly share code, notes, and snippets.

@robwhess
robwhess / prog1.c
Last active October 16, 2024 21:43
CS 261 Week 3 Recitation Exercise
#include <stdlib.h>
int multiply_by_2(int* p) {
*p = *p * 2;
return *p;
}
int main() {
int n = 10, x = 16, y = 32, z = 64;
int* p1 = &x;
@robwhess
robwhess / dijkstra.md
Created November 24, 2021 21:27
Corrected Dijkstra's algorithm pseudocode for CS 261 assignment 4

Here's complete corrected pseudocode for Dijkstra's algorithm:

for every node N:
  cost[N] = infinity
  prev[N] = undefined

Q = new priority queue
insert N_start into Q with priority 0

while Q is not empty:
@robwhess
robwhess / activity_settings.xml
Created February 24, 2022 19:49
Fixed starter code for CS 492 assignment 4
<?xml version="1.0" encoding="utf-8"?>
<androidx.fragment.app.FragmentContainerView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/settings_fragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:name="com.example.android.roomyweather.ui.SettingsFragment"
tools:context=".ui.SettingsActivity" />
@robwhess
robwhess / Makefile
Created April 19, 2023 18:02
Fixed Makefile for CS 480 assignment 1
all: scan
scan: scanner.c
gcc scanner.c -o scan
scanner.c: scanner.l
flex -o scanner.c scanner.l
clean:
rm -f scan scanner.c
@robwhess
robwhess / commands.js
Created May 19, 2023 23:29
Cypress default E2E configuration.
// ***********************************************
// This example commands.js shows you how to
// create various custom commands and overwrite
// existing commands.
//
// For more comprehensive examples of custom
// commands please read more here:
// https://on.cypress.io/custom-commands
// ***********************************************
//