View MintyUSBoost.c
/*
* File: MintyUSBoost.c
* Author: Nathan Campos <nathanpc@dreamintech.net>
*
* Created on February 14, 2016, 2:45 PM
*/
// 12F683
// +---------+
// -|Vdd Vss|-
View linear_vreg_res.R
#' linear_vreg_res.R
#' Calculates the resistor values to be used in a op-amp based linear voltage
#' regulator according to a specific selection of voltage references.
#'
#' @author Nathan Campos <nathanpc@dreamintech.net>
# Generates a E12 series of resistors.
e12_resistors <- function (steps = c(1000, 10000, 100000)) {
base = c(1.0, 1.2, 1.5, 1.8, 2.2, 2.7, 3.3, 3.9, 4.7, 5.6, 6.8, 8.2)
e12 = c()
View plot_thd.py
#!/bin/env python
### plot_thd.py
### Plot the THD of a circuit over a range of frequencies using ngspice.
###
### Author: Nathan Campos <nathanpc@dreamintech.net>
import os
import sys
import subprocess
View .screenrc
# Autodetach session on hangup instead of terminating screen completely
autodetach on
# Set the colors to 256 and enable bold.
term screen-256color
attrcolor b ".I"
# 30.000-line scrollback buffer.
defscrollback 30000
View irc_client.cpp
void *IRC_Client::handle_recv(void) {
// recv some data.
int numbytes;
char buffer[MAXDATASIZE];
while (true) {
numbytes = recv(socket_descriptor, buffer, MAXDATASIZE - 1, 0);
buffer[numbytes] = '\0';
if (numbytes == 0) {
View BBTimer.java
Timer timer = new Timer();
timer.scheduleAtFixedRate(new TimerTask() {
public void run() {
UiApplication.getUiApplication().invokeLater(new Runnable() {
public void run() {
// Do something when the timer ticks
}
});
}
View main.js
bb.init({
onscreenready: function (element, id) {
if (id == "main") {
var item = element.createElement('div');
item.setAttribute('data-bb-type','item');
item.setAttribute('data-bb-title','my title');
item.innerHTML = 'my description';
item.setAttribute('data-bb-img','foo.png');
element.getElementById('mylist').appendItem(item);
View main.js
bb.init({
onscreenready: function (element, id) {
if (id == "main") {
var item = document.createElement('div');
item.setAttribute('data-bb-type','item');
item.setAttribute('data-bb-title','my title');
item.innerHTML = 'my description';
item.setAttribute('data-bb-img','foo.png');
document.getElementById('mylist').appendItem(item);
View main.js
bb.init({
onscreenready: function (element, id) {
if (id == "main") {
// code to be executed before the "main" screen is loaded.
} else if (id == "add") {
// code to be executed before the "add" screen is loaded.
}
},
ondomready: function (element, id) {
if (id == "main") {