Skip to content

Instantly share code, notes, and snippets.

joshua@josh-320:~/Desktop/Stuff/github/repos/PyTe$ python upload.py -s http://codereview.joshashby.com --base_url [email protected]:JoshAshby/PyTe.git
The following files are not added to version control:
keyboard.pyc
upload.py
virtkeyboard.pyc
Are you sure to continue?(y/N) y
Upload server: http://codereview.joshashby.com (change with -s/--server)
New issue subject: test
Email (login for uploading to http://codereview.joshashby.com) [[email protected]]:
Password for [email protected]:
@JoshAshby
JoshAshby / Main.c
Created December 9, 2010 23:56
Fake main.c file for a school report, button processing code
//-------------------------------------------
/*
main.c
2010 - Josh Ashby
[email protected]
http://joshashby.com
http://github.com/JoshAshby
freenode/#linuxandsci - JoshAshby
*/
//-------------------------------------------
@JoshAshby
JoshAshby / Old PWM
Created December 10, 2010 05:28
Old, horrible and dirty pwm ramp code for BOB, simply a backup
void pwm_ramp1A(int value, int speed)
{
if (value == 0) {//safe gaurd to prevent i from over flowing
pwm1A(0);
}
else {
if (value > pwm_value_old1A){//determine if it should ramp up or down
TCCR1A |= (1<<COM1A1);
unsigned int i = pwm_value_old1A;
while (i<=value) {//ramp up
uint8_t ultrasound_filter(char pin) {
filt = (average>>1);
adc = ADCH;
for (j = 0; j <= 16; j++){
if (ADCH > average + 100)
{
adc = (ADCH>>1) + filt;
}
if (ADCH < average - 100){
Inside of the editor class I have the local variable CurrentfileName
and the function:
def getTitle(self):
return self.CurrentfileName
in the main code I have a function which parses each tabs elements for the one called editor, which is the editor object that belongs to that tab. After I have found editor I can simply call getTitle() and boom, the two are talking.
def printChildren(self, obj, indent):
children=obj.children()
if children==None:
Traceback (most recent call last):
File "./pyte.py", line 184, in save
self.Tabfile(self.mainTabWidget, "", 'saveFile')
File "./pyte.py", line 257, in Tabfile
self.Tabfile(child, indent + " ", action_type)
File "./pyte.py", line 225, in Tabfile
child.save()
File "/home/joshua/Desktop/Stuff/github/repos/PyTe/editor.py", line 126, in save
self.f.write(str(self.editor.text()))
UnicodeEncodeError: 'ascii' codec can't encode characters in position 608-610: ordinal not in range(128)
Server error!
The server encountered an internal error and was unable to complete your request.
Error message:
Global symbol "$name" requires explicit package name at database.pm line 46. Global symbol "$description" requires explicit package name at database.pm line 46. Global symbol "$barcode" requires explicit package name at database.pm line 46. Global symbol "$quantity" requires explicit package name at database.pm line 46. Global symbol "$flag" requires explicit package name at database.pm line 46. Global symbol "$average_days_left" requires explicit package name at database.pm line 46. Global symbol "$name" requires explicit package name at database.pm line 49. Global symbol "$description" requires explicit package name at database.pm line 49. Global symbol "$barcode" requires explicit package name at database.pm line 49. Global symbol "$quantity" requires explicit package name at database.pm line 49. Global symbol "$flag" requires explicit package name at database.pm line 49. Global symbol "$averag
@JoshAshby
JoshAshby / R-andom ;)
Created April 27, 2011 20:04
Random bit of R as part of a basic linear machine learning (ish) project for House-Inventory
library(ggplot2)
data = read.csv("/home/joshua/Downloads/test_data.csv", header = TRUE)
plot = ggplot(mydata, aes(x, y)) + geom_point() + ylab('Quantity') + xlab('Days')
m = length(data$x)
theta = matrix(c(0,0), nrow=1)
x = matrix(c(rep(1,m), data$x), ncol=2)
y = matrix(data$y, ncol=1)
theta = solve(t(x) %*% x) %*% (t(x) %*% y)
Have:
x,y
0,30
1,29
1,28
2,27
2,26
3,25
3,24
@JoshAshby
JoshAshby / gist:945563
Created April 28, 2011 00:37
Displays only the last period of a dataset with design \|\|\|\ (\ = descending slope. | = restock)
library(ggplot2)
mydata = read.csv("/home/joshua/Downloads/test_data.csv", header = TRUE)
m = length(mydata$x)
theta = matrix(c(0,0), nrow=1)
ux = matrix(c(rep(1,m), mydata$x), ncol=2)
uy= matrix(mydata$y, ncol=1)
for (i in 0:m) {
j = (m - i)