int * global_ptr;
int * func(int * param_ptr)
{
int * local_ptr = 0;
{
int * sub_scope_ptr = 0;
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
typedef struct {} a; | |
typedef struct { a a1; a a2; } b; | |
int main(int argc, char * argv[]) | |
{ | |
a as[999999]; | |
printf("%d\n", sizeof(b) == sizeof(a)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
/* This stuff would be updated/added to unity. */ | |
typedef struct { | |
char * desc; | |
char * file; | |
int line; | |
} test_information_t; | |
#define TEST_INFO_NAME(x, y) test_info_ ## x ## _ ## y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function __svn_ps1 { | |
local d=$(svn info 2>&1 | grep -Po "/(branches|trunk).*$") | |
if [ -n "$d" ]; then | |
echo -en "[svn:$d]" | |
fi | |
} | |
function __git_ps1 { | |
local d=$(git st 2>&1| grep -Po "branch .*") | |
if [ -n "$d" ]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A file demonstrating how I use ActiveRecord to perform "All records where N | |
# is greatest N" queries. | |
# | |
# This script contains the schema, the models, and the example code. Normally | |
# these pieces would be broken out into separate files. | |
# | |
# The example demonstrates the use by producing a set of relationships between | |
# users, services, and "logins" of those users to the services. Then, we | |
# perform some queries that relate to the longest session time when stratified | |
# different ways. |
- I Hate Software
- My strugle with realizing that my best work is not what I make, but what I avoid making.
- Why is Embedded Software Stagnant?
- We're not good enough to stay here.
- C Programmers are the (Soon to be Replaced by Machines) Artisans of the 21st Century
- Programmers are Never Done Learning
- Ideas are Worthless (yes, even yours)
- Hardware Bring-up is Hell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Structures */ | |
/* NO! */ | |
typedef struct foo foo_t; | |
/* YES! */ | |
struct foo; | |
/* Unions */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
main: main.c shim.o | |
shim.o: foo.c foo_shim.c foo.h | |
# | |
# Compile Files | |
gcc foo.c -c -o foo.o | |
gcc foo_shim.c -c -o foo_shim.o | |
# | |
# Rename the symbol we care about: foo -> old_foo | |
objcopy --redefine-sym foo=old_foo foo.o _foo.o | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[3] pry(main)> module Foo | |
[3] pry(main)* def self.bar | |
[3] pry(main)* puts "I AM BAR" | |
[3] pry(main)* end | |
[3] pry(main)* end | |
=> nil | |
[4] pry(main)> Foo.method(:bar) | |
=> #<Method: Foo.bar> | |
[5] pry(main)> Foo.method(:bar).call | |
I AM BAR |
foo.h
#ifndef FOO_H
#define FOO_H
typedef int sometype_t;
void foo(sometype_t t);
#endif /* FOO_H */