Sunday, August 24, 2014

A dirty hack of a Evolus Pencil Template

A dirty hack of a Pencil Template: (1) Find something that works. Download glyphish icons. https://code.google.com/p/evoluspencil/downloads/detail?name=glyphish_icons.zip&can=2&q=label%3AStencil (2) Unzip glyphish icons from the bash shell with the command: unzip glyphish_icons.zip -d glyphish_icons (3) Delete every shape except for the one for tshirt.png. (4) Edit tshirt.png in the /glyphish_icons/Icons folder with Gimp. (5) run base64 on the edited tshirt.png file base64 --wrap=0 tshirt.png (6) Paste the output in place of the string in the Definition.xml file after "base64,". (7) zip the glyphish_icons folder with the command: zip glyphish_icons * Note: I discovered the solution for step 6 by looking at: http://pencil.evolus.vn/wiki/devguide/Tutorial/Drawing_image.html (8) You can use any image in place of the tshirt.png. Be sure to replace 24,17 with any width, height value (e.g. 100, 51).

Thursday, May 15, 2014

DIYBio in the Oklahoma City Metro?

After dropping by the front door of BioCurious in Sunnyvale, CA and missing out on the opportunity to see anyone I wondered if I could get involved in someway remotely. I e-mailed Eri Gentry and asked if there was some way to be involved while outside of the Bay Area. She said that they lacked the infrastructure, but I could get involved with events that had zoom.us. Fast forward a few days in the future. I had broken down, and remembered that Amanda Harlin with okc.js had challenged me to bring tech to Oklahoma. She said that those that complain are not those that do something about it. The memory ofthe citizen scientist biotech lab, BioCurious, and the challenge that Amanda threw down made me wonder if there could be a bio-hacker space in Oklahoma. Then came the thought that around here you have to build things, just like everything else that sprouted out of the prairie. See the list of current DIYBio places: http://diybio.org/local/.

Wednesday, May 14, 2014

Introducing bshambaugh.github.io

Sometimes problems fix themselves if you walk away for awhile and reboot your computer twice.

AHEM...

I followed this glossy website (https://pages.github.com/) and then the more nerdy OTHER github website (https://help.github.com/categories/20/articles). See specifically, https://help.github.com/articles/creating-project-pages-manually.

There were a number of problems with "git commit -a -m "First pages commit" but eventually they went away. Like after about an hour or more. Sorry, I should be polite. Now, no more 404s.

Sunday, May 4, 2014

Mountain View Day #1

Today was a crazy day. I met two people who were interning at Google. I ate 50 cent bananas, a 30 cent mandarin. I met a programmer who is a lisp programmer, and a met the founder of Counterparty. I also met a guy promoting solar energy, went to church, got lost near the Nasa Ames research center, walked along Steven's Creek trail, I admired the redwood trees?, saw Microsoft in Mountain View, found the Computer History Museum, found Google had offices on a street called Fairchild. I'm at Hacker Dojo right now. But I still wonder what is really important in life.

Friday, March 28, 2014

Would understanding streams help avoid errors with Readline?

When I try to run this: var readline = require('readline'); var rl = readline.createInterface({ input: process.sdtin, output: process.stdout, }); rl.question("What do you think of node.js?", function(answer) { // TODO: Log the answer in a database console.log(answer + ',Thank you for your valuable feedback.'); // These two lines together allow the program to terminate. Without // them, it would run forever. i.close(); process.stdin.destroy(); }); I get this: readline.js:833 if (stream._keypressDecoder) return; ^ TypeError: Cannot read property '_keypressDecoder' of undefined at Object.emitKeypressEvents (readline.js:833:13) at new Interface (readline.js:118:13) at Object.exports.createInterface (readline.js:39:10) at Object. (/home/shambaughlab/node_examples/seh1_readline.js:3:19) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Function.Module.runMain (module.js:497:10) at startup (node.js:119:16) I am unsure, but maybe I should look at streams. http://nodejs.org/api/stream.html

Sunday, March 16, 2014

WebPayments Use Cases

I've been spending the past few weeks with others such as Natasha Rooney, Marcos Caceres, and Manu Sporny working on some WebPayments Use Cases for the first W3C Webpayments workshop (1). They are illustrated here: https://www.w3.org/community/webpayments/wiki/WebPaymentsMobileUseCases , but also here: https://github.com/bshambaugh/payments-use-cases and here: https://github.com/w3c-webmob/payments-use-cases . I'm trying to get things narrowed down so that Marcos' suggestions can be included: http://lists.w3.org/Archives/Public/public-webpayments/2014Mar/0082.html

(1) http://www.w3.org/2013/10/payments/

Saturday, March 1, 2014

Control Flow in Node.js -- this is not working

When I run this code, I only see the first readline with, "Should I make a career change?". Perhaps this has something to do with program flow in the language.

Here is the code:

readline = require('readline');

var fs = require('fs');

var answer = 'the wrong answer';

var rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout,
});

rl.question("Should I change?", function(answer) {
write(answer + ', I should change.');
  rl.close();
});

 rl.question("Should I stay the same?", function(myanswer) {
 mywrite(myanswer + ', I should stay the same.');
  rl.close();
});

function write(answer) {
fs.writeFile('career_change.txt', answer , function(err) {
});
}

function mywrite(myanswer) {
fs.writeFile('career_change.txt', myanswer , function(err) {
});
}

Here is Mixu's chapter on control flow in Node.js:

http://book.mixu.net/node/ch7.html