Skip to content

Instantly share code, notes, and snippets.

@alberthdev
alberthdev / enee150.c
Created March 8, 2016 21:43
Mick's ENEE150 Stuff
/*
* ASCII Table: http://www.asciitable.com/
*
*/
#include <stdio.h>
int main() {
int x = 5;
int *y = &x;
@alberthdev
alberthdev / cipher.py
Last active January 20, 2016 21:28
Fun project solution from Brent!
#!/usr/bin/env python
# Secret Message Project from Brent Smith
# Solution by Albert Huang
# This is 100% public domain, use it for whatever you want.
#
# Python 3 stubs
try:
input = raw_input
except NameError:
@alberthdev
alberthdev / sample_game.py
Last active August 29, 2015 14:20
Learn Python - Sample Game Code
# Learn Python - Sample Game Code
# --------------------------------
# Analyze the game code below. Once you are ready, you can begin answering questions.
# You may (and are encouraged to) refer to the code below when answering questions.
#
# Questions:
# 1) Label the code. What is what? What does what? Be as specific as possible!
# 2) Assume that we run the following line: raise GameException("BogusError", "This is bogus.")
# Assuming that we do not catch it, what will the error look like?
# 3) Explain what clearScreenBuffer() does in the GameScreen class. What is happening? Be specific.
@alberthdev
alberthdev / reinstall_deb_dbus.sh
Created April 5, 2015 20:31
Script to reinstall Debian packages that have D-Bus configuration files
#!/bin/bash
# Debian System Reinstaller - D-Bus config file package reinstaller
# Copyright (C) 2015 Albert Huang
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@alberthdev
alberthdev / reinstall_deb.sh
Created April 5, 2015 20:29
Script to reinstall all Debian packages on the system
#!/bin/bash
# Debian System Reinstaller
# Copyright (C) 2015 Albert Huang
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@alberthdev
alberthdev / testsigns_uint.c
Created March 24, 2015 01:35
C uint8_t and uint32_t signedness check
// NOTE: This file should NOT compile
// If it does, that means uint8_t and uint32_t are already defined without an include file...
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
// Test if char and int are signed or unsigned
int main() {
// Char test
@alberthdev
alberthdev / charint_signcheck.c
Last active August 29, 2015 14:17
C Signedness Check
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
// Test if char and int are signed or unsigned
int main() {
// Char test
printf("Is char signed? ");
if ((char)-1 < 0)
printf("YES, char is signed\n");
@alberthdev
alberthdev / pyradmon_barebones_test.py
Last active August 29, 2015 14:05
PyRadmon Barebones Code
import pyradmon.enumerate as en
from pyradmon.data import get_data, rel_channels
from pyradmon.plot import plot
plot_dict = { "plot1" : { "output" : "helloplot_ch%CHANNEL%.png", "settings": { "dpi": 50, "target_size": [595, 700] }, }, }
plot_dict["plot1"]["title"] = "Testing - AMSUA_N15 channel %CHANNEL%"
plot_dict["plot1"]["plots"] = [ { "subplot1" : { "axes": { "x" : { "label": None }, "y" : { "label": None }, }, }, } ]
plot_dict["plot1"]["plots"][0]["subplot1"]["data"] = { "colors" : [ "blue", "red" ], "labels": [ "AVG", "SDV" ], "x": "timestamp", "y": [ "ges|bc_const|mean", "ges|bc_const|stddev" ] }
plot_dict["plot1"]["plots"][0]["subplot1"]["legend"] = { "line" : True }
plot_dict["plot1"]["plots"][0]["subplot1"]["title"] = "My Subplot Title"
Git Howto
===========
1. For Windows, download and install: http://git-scm.com/download/win
If you're on Linux, you don't need help.
If you're on Mac, you need a LOT of help! ;) (If not, http://git-scm.com/download/mac)
2. git clone https://github.com/alberthrocks/bitcamp2014.git
3. cd bitcamp2014
--------
4. Add files, make changes, etc.
5. See changes: git status
@alberthdev
alberthdev / PySample.py
Last active August 29, 2015 13:58
Python Sample
# Python Quick Start v1.2.2 (UPDATED: 4/4/14 8:30 PM EDT)
# Copyright (c) 2014 Albert Huang ([email protected] / alberthuang.me)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#