Monday, December 22, 2014

Just trying to get this to work...going through a FreeCAD Tutorial

http://www.freecadweb.org/wiki/index.php?title=Basic_Part_Design_Tutorial

Saturday, December 13, 2014

The status of things


 Concerning the mind controlled robot project I have been thinking, Beau is someone who you do not meet everyday. He literally did design for the Parallax Propeller chip (as far as I know). With respect to programming Arduino, I have some experience with the C language family. I have a book I've looked at several times, and I have even studied pointers, although I do have confidence issues. I do hope that I will be able to get around these. Mike Douglas was awesome and donated to the project. I'm not sure if other people will jump in just yet, but I have been considering devoting most of what little income I have to bring this to project to fuition. 

I have put a lot of time into EISPP, and it concerns me with respect to starting other projects. It has brought it's rewards though. I've met some interesting people. Some Sensoricans seem to like it, and it seems to fit well with what is going on at the Open App Ecosystem. Right now I am studying FreeCAD to illustrate merging it with sections 2 and 4 of ISO15926 to allow for labeling of objects with sematic interoperability with the rest of EISPP.

The filament extruder project has not gone anywhere, and the same can be said about building a website for web payments. But I have seen a lot of Mozilla recently, and I expect to see more of that. Bill Mills seems like an awesome character. Speaking of which, Software Carpentry, although no longer affiliated with Mozilla, has helped me get a little more warmed up about teaching. I remember earlier I had the opportunity, but I had bitter feelings.

Wednesday, October 8, 2014

RDF Graph Normalization

During the conference call at the web payments community group, I was curious what Dave Longley meant by normalization.

http://json-ld.org/spec/latest/rdf-graph-normalization/

Saturday, September 13, 2014

Explorations with Simple-Part Whole Relations


Following the link at http://www.w3.org/2001/sw/BestPractices/OEP/
SimplePartWhole/
simple-part-whole-relations-v1.3.html
we see that in section 3 we have a structure that represents 
faults in a car.
 
 
The structure is represented in the document in Turtle (*.ttl) as:

@prefix : <http: example.org="" stuff=""> .
@prefix rdf: <http: rdf-syntax-ns="" www.w3.org="">.
@prefix owl: <http: owl="" www.w3.org="">.

:Fault_in_car
  a  owl:Class ;
  owl:equivalentClass
    [ a  owl:Class ;
      owl:intersectionOf (:Fault [ a  owl:Restriction ;
         owl:onProperty :hasLocus ;
         owl:someValuesFrom
           [ a  owl:Class ;
             owl:unionOf (:Car [ a  owl:Restriction ;
               owl:onProperty :partOf ;
               owl:someValuesFrom :Car
            ])
         ]
       ])
    ] . 
Using the logic presented by tobyink in the IRC chat on #swig 
(http://chatlogs.planetrdf.com/swig/2014-09-06.html
we can parse the individual parts. We can look at the Turtle 
recommendation to understand the Turtle syntax  at  
http://www.w3.org/TR/turtle/
aand expand our understanding of the data structure using 
http://www.w3.org/TR/rdf-schema/ . We can convert .ttl to .owl 
using 
the comparisons given in the owl 2 primer
 http://www.w3.org/TR/2012/PER-owl2-primer-20121018/ .


An automated way that we can  convert the turtle (.ttl) file 
to owl (.owl) is by using the software
http://www.l3s.de/~minack/rdf2rdf/
We obtain: 

XML/RDF Node-Arc Graph in OWL (*.owl):

<rdf:rdf xmlns:owl="http://www.w3.org/2002/07/owl" xmlns:rdf=
"http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns=
"http://example.org/stuff/1.0/">

<rdf:description rdf:about="http://example.org/stuff/1.0/
Fault_in_car">
 <rdf:type rdf:resource="http://www.w3.org/2002/07/owlClass">
</rdf:type></rdf:description>

<rdf:description rdf:nodeid="node191bjrqejx1">
 <rdf:type rdf:resource="http://www.w3.org/2002/07/owlClass">
</rdf:type></rdf:description>

<rdf:description rdf:nodeid="node191bjrqejx2">
 <rdf:first rdf:resource="http://example.org/stuff/1.0/
Fault">
 <rdf:rest rdf:nodeid="node191bjrqejx3">
</rdf:rest></rdf:first></rdf:description>

<rdf:description rdf:nodeid="node191bjrqejx4">
 <rdf:type rdf:resource="http://www.w3.org/2002/07/
owlRestriction">
 <owlonproperty rdf:resource="http://example.org/stuff/1.0/
hasLocus" xmlns="http://www.w3.org/2002/07/">
</owlonproperty></rdf:type></rdf:description>

<rdf:description rdf:nodeid="node191bjrqejx5">
 <rdf:type rdf:resource="http://www.w3.org/2002/07/
owlClass">
</rdf:type></rdf:description>

<rdf:description rdf:nodeid="node191bjrqejx6">
 <rdf:first rdf:resource="http://example.org/stuff/1.0/
Car">
 <rdf:rest rdf:nodeid="node191bjrqejx7">
</rdf:rest></rdf:first></rdf:description>

<rdf:description rdf:nodeid="node191bjrqejx8">
 <rdf:type rdf:resource="http://www.w3.org/2002/07/
owlRestriction">
 <owlonproperty rdf:resource="http://example.org/stuff/
1.0/partOf" 
xmlns="http://www.w3.org/2002/07/">
 <owlsomevaluesfrom rdf:resource="http://example.org/stuff/
1.0/Car" 
xmlns="http://www.w3.org/2002/07/">
</owlsomevaluesfrom></owlonproperty></rdf:type>
</rdf:description>

<rdf:description rdf:nodeid="node191bjrqejx7">
 <rdf:first rdf:nodeid="node191bjrqejx8">
 <rdf:rest rdf:resource="http://www.w3.org/1999/02/
22-rdf-syntax-ns#nil">
</rdf:rest></rdf:first></rdf:description>

<rdf:description rdf:nodeid="node191bjrqejx5">
 <owlunionof rdf:nodeid="node191bjrqejx6" 
xmlns="http://www.w3.org/2002/07/">
</owlunionof></rdf:description>

<rdf:description rdf:nodeid="node191bjrqejx4">
 <owlsomevaluesfrom rdf:nodeid="node191bjrqejx5" 
xmlns="http://www.w3.org/2002/07/">
</owlsomevaluesfrom></rdf:description>

<rdf:description rdf:nodeid="node191bjrqejx3">
 <rdf:first rdf:nodeid="node191bjrqejx4">
 <rdf:rest rdf:resource="http://www.w3.org/1999/02/
22-rdf-syntax-ns#nil">
</rdf:rest></rdf:first></rdf:description>

<rdf:description rdf:nodeid="node191bjrqejx1">
 <owlintersectionof rdf:nodeid="node191bjrqejx2" 
xmlns="http://www.w3.org/2002/07/">
</owlintersectionof></rdf:description>

<rdf:description rdf:about="http://example.org/stuff/
1.0/Fault_in_car">
 <owlequivalentclass rdf:nodeid="node191bjrqejx1" 
xmlns="http://www.w3.org/2002/07/">
</owlequivalentclass></rdf:description>

</rdf:rdf> 

When we import this XML/RDF into the RDF validator we 
obtain for a node-arc graph the following 
diagram.  
 
 
 



 
 



 
 



 



 
 



 
 
 



 
 



 



 



 
 



 



 


 





 



 
 



 
 



 



 
 



 
 
 



 
 



 



 



 
 



 



 


 

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

Sunday, February 23, 2014

Source Code Browing Tools

I found someone struggling to understand a large code base, and I wanted to solve the problem. I've had the same issues too. Thank you Slashdot.

Source code browsing tools:
http://beta.slashdot.org/story/68967

Saturday, February 22, 2014

Hello World with Git

I was going through create a repo on GitHub, and these were a few link that I used:

https://help.github.com/articles/create-a-repo

Installing Git on Ubuntu 12:04:
https://www.digitalocean.com/community/articles/how-to-install-git-on-ubuntu-12-04

Error from Gnome keyring:
http://askubuntu.com/questions/243210/why-do-i-get-this-warning-from-gnome-keyring-in-xubuntu

Generating ssh keys for github:
https://help.github.com/articles/generating-ssh-keys

Errors with ssh keys:
https://help.github.com/articles/error-agent-admitted-failure-to-sign

Also some notes:

make sure you register the public key with github!

For some reason it helped to remove the git repository and start over.

KDE

I updated my OS to Ubuntu 12.04 LTS and my desktop to KDE. Unfortunately, Salome 6 does not work, and my desktop categories are a bit different. Otherwise it is good. I love KDE.

Conditionals in Node.js

// Okay, I will need this later.
if (5 < 4) {
   console.log("The math is weird here");
} else
   console.log("Math may be right here");

Reading from the User and Writing to a File in Node.js (part 3)

// Thanks for the encouragement Micah Alcorn! I wrote to a file using node.js.
// Now I am embedding the write in a function within readline. Due to variable
// scope, I have two outputs for the variable answer. One is 'the wrong answer'
// and the other is what I choose.

readline = require('readline');

var fs = require('fs');

var answer = 'the wrong answer';

var rl = readline.createInterface({

  input: process.stdin,

  output: process.stdout,

});

rl.question("What do you think of node.js?", function(answer) {

  // TODO: Log the answer in a database
  // Hmm ... I wonder what happens if I write to the file here...

write(answer);
//  fs.writeFile('read_write_node_embed.txt', answer, function(err) {
 
//    if (err) throw err;
  
//    console.log('It\'s saved!');

//});

// The end of the writing to the file

  console.log("Thank you for your valuable feedback:", answer);

  rl.close();

})

function write(answer) {
fs.writeFile('write_answer.txt', answer , function(err) {

  if (err) throw err;

  console.log('It\'s saved!');

});
}

fs.writeFile('wrong_answer.txt', answer, function(err) {

  if (err) throw err;

  console.log('It\'s saved!');

});

Reading from the User and Writing to a File in Node.js (part 2)

// I get different output when I embed! Thank you Micah!

readline = require('readline');

var fs = require('fs');

var answer = 'this answer';

var rl = readline.createInterface({

  input: process.stdin,

  output: process.stdout,

});

rl.question("What do you think of node.js?", function(answer) {

  // TODO: Log the answer in a database
  // Hmm ... I wonder what happens if I write to the file here...

  fs.writeFile('read_write_node_embed.txt', answer, function(err) {
 
    if (err) throw err;
  
    console.log('It\'s saved!');

});

// The end of the writing to the file

  console.log("Thank you for your valuable feedback:", answer);

  rl.close();

})

fs.writeFile('read_write_node_not-embed.txt', answer , function(err) {

  if (err) throw err;

  console.log('It\'s saved!');

});

Reading from the User and Writing to a File in Node.js (part 1)

Thanks for the encouragement Micah Alcorn! I wrote to a file using node.js.

var fs = require('fs');

fs.writeFile('message.txt', 'Hello Node', function (err) {
if (err) throw err;
console.log('It\'s saved!');
});

*source: http://nodejs.org/api/fs.html

I can also append data to the same file, through something like this:

var fs = require('fs');

fs.writeFile('message.txt', 'Hello Node', function(err) {
  if (err) throw err;
  console.log('It\'s saved!');
});

fs.appendFile('message.txt','data to append, function (err) {
  if (err) throw err;
  console.log('The "data to append" was appended to a file!');
});

If I want to instead take imput from the user and save it to a file all I have to do is:

var readline = require('readline');
var fs = require('fs');
var answer = 'this answer';

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

rl.question("What do you think of node.js?", function(answer) {
  // TODO: Log the answer in a database
  console.log("Thank you for your valuable feedback:", answer);

  rl.close();
})

fs.writeFile('message.txt', answer , function(err) {
  if (err) throw err;
  console.log('It\'s saved!');
});

*source: http://nodejs.org/api/readline.html

Except this does not work, maybe because answer in rl.question does not appear to be local in scope...because the output of fs.writeFile is 'this answer'.

Friday, February 21, 2014

Text input into the console in Node.js

I have been trying to find out how text input from the console works in node.js. Apparently there is something called read line that does the trick. Here is the link: http://nodejs.org/api/readline.html. It is described in the Node.js manual. There are also methods to prompt users for input, as described in the Nodejitsu documents: http://docs.nodejitsu.com/articles/command-line/how-to-prompt-for-command-line-input.