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
#!/bin/sh | |
# Copyright, 2012 Axel Heider | |
# | |
# Based on scrpts from | |
# Sebastian P. | |
# Nicholas A. Schembri State College PA USA | |
# | |
# 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 |
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
#!/bin/sh | |
# Copyright 2008 Nicholas A. Schembri State College PA USA | |
# | |
# 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, | |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
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
/* | |
* This demo shows how preprocessor macros (formally called X macros) can be | |
* used to convert one list into both an enumeration and an array of strings. | |
* This is really useful for converting an enum value into a readable form. | |
* | |
* Dan Collins 2015 | |
*/ | |
#include <stdlib.h> | |
#include <stdio.h> |
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
105c105,106 | |
< subprocess.check_output(["pgrep", "spotify"]) | |
--- | |
> pgrep_out = subprocess.check_output(["pgrep", "spotify"]) | |
> self.pids = pgrep_out.decode('utf-8').split() | |
284c285 | |
< pids = pidof_out.decode("utf-8").strip().split(" ") | |
--- | |
> #pids = pidof_out.decode("utf-8").strip().split(" ") | |
294c295 |
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
/* Continue the loop till you find SPI Baud Rate Register Value */ | |
while (1) { | |
/* SPI Clock Calculation as per PIC32 Manual */ | |
SPI_Clk_Freq = pbFreq / (2 * (SPI_Brg + 1)); | |
if (SPI_Clk_Freq <= MAX_SPI_CLK_FREQ_FOR_P2P) | |
break; | |
SPI_Brg++; | |
} |
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
''' | |
Given a list of names, this program will sort them by the last letter of their first name. | |
It does this by reversing their first name, and sorting a dictionary like that. | |
Dan Collins 2012 | |
''' | |
import operator | |
names = ['Andrew Hornblow', 'Bobby', 'Bruce Lee', 'Dan Collins', 'Fabian Cook', 'Matthew', 'Ross Petersen'] # Names to sort |
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
Starting EEPROM read of 42 bytes. | |
Opening Addr value: 0 | |
Addr: 0 Byte: 3 | |
Addr: 1 Byte: 7 | |
Addr: 2 Byte: 4 | |
Addr: 3 Byte: 7 | |
Addr: 4 Byte: . | |
Addr: 50 Byte: 2 | |
Addr: 13619 Byte: 5 | |
Addr: 13620 Byte: 7 |
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
void ee_write(char * buf, unsigned int addr, unsigned int len) { | |
int i = 0; | |
ee_ackPoll(); // Wait for the EEPROM to be ready | |
sprintf(bf1, "Starting EEPROM write of %d bytes.\r\n", len); | |
debugr(bf1); | |
while(len > 0) { // Write all of the bytes to the EEPROM | |
IdleI2C1(); |
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
void ee_read(char * buf, unsigned int addr, unsigned int len) { | |
unsigned int i; | |
sprintf(bf1, "Starting EEPROM read of %u bytes.\r\n", len); | |
debugr(bf1); | |
IdleI2C1(); | |
StartI2C1(); | |
WriteI2C1(EE_ADDR | EE_W); | |
IdleI2C1(); |
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
Starting EEPROM read of 42 bytes. | |
Addr: 0 Byte: 3 | |
Addr: 1 Byte: 7 | |
Addr: 2 Byte: 4 | |
Addr: 3 Byte: 7 | |
Addr: 4 Byte: . | |
Addr: 32 Byte: 2 | |
Addr: 3533 Byte: 5 | |
Addr: 3534 Byte: 7 | |
Addr: 3535 Byte: 8 |