This file contains hidden or 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
#!/usr/bin/env python | |
# This script creates a daemon thread named 'watchdog_timer' that runs the watchdog_timer() function. | |
# The main thread sleeps in an infinite loop until you press control-C. | |
# Since the watchdog_timer thread is a daemon, exiting the main thread will exit the entire process. | |
import threading | |
import time | |
def watchdog_timer(): |
This file contains hidden or 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
<html><body><h1>It works!</h1> | |
<p>This is the default web page for this server.</p> | |
<p>The web server software is running but no content has been added, yet.</p> | |
</body></html> |
This file contains hidden or 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 <stdint.h> | |
#include <stdio.h> | |
int main(int argc, char *argv[]) { | |
printf("sizeof(char): %lu\n", sizeof(char)); | |
printf("sizeof(unsinged char): %lu\n", sizeof(unsigned char)); | |
printf("sizeof(signed char): %lu\n", sizeof(signed char)); | |
printf("sizeof(int8_t): %lu\n", sizeof(int8_t)); | |
printf("sizeof(uint8_t): %lu\n", sizeof(uint8_t)); | |
printf("sizeof(short): %lu\n", sizeof(short)); |
This file contains hidden or 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 <stdlib.h> | |
#include <signal.h> | |
/* | |
* Gracefully exits when Ctrl+C is pressed. | |
*/ | |
void sigint_handler(int signum) { | |
exit(0); | |
} |
This file contains hidden or 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> // PERROR(3) | |
#include <stdlib.h> // EXIT(3) | |
#include <sys/socket.h> // BIND(2) | |
int retval = bind( | |
/* int sockfd */ | |
/* const struct sockaddr *addr */ | |
/* socklen_t addrlen */ | |
); | |
if (retval == -1) { |
This file contains hidden or 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
#!/usr/bin/env python | |
# http://docs.python.org/dev/library/argparse.html | |
import argparse | |
if __name__=='__init__': | |
parser = argparse.ArgumentParser(description='') | |
args = parser.parse_args() | |
print(args) |
This file contains hidden or 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
<xs:simpleType name="UPC-E-Barcode"> | |
<xs:annotation> | |
<xs:documentation> | |
Reference: http://www.barcodeisland.com/upce.phtml | |
The UPC-E barcode has 7 digits. | |
</xs:documentation> | |
</xs:annotation> | |
<xs:restriction base="xs:token"> | |
<xs:pattern value="[0-9]{7}"/> | |
</xs:restriction> |
This file contains hidden or 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
CFLAGS=-std=gnu99 -O3 | |
LDFLAGS=-lrt -lgmp | |
.PHONY: all | |
all: ebert | |
ebert: ebert.c time.o profile.o | |
time.o: time.c time.h |
This file contains hidden or 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
This turned out not to be as useful as just using the raw FIFO interface directly and letting each PicoBlaze do its own I/O logic. |
This file contains hidden or 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
#!/usr/bin/env python | |
# | |
# Measure the bit error rate if a serial port in loopback. | |
# | |
import serial | |
import sys | |
import traceback |