Chang or Advert Wellfare

Earthworm writing letter to mankind,
All ready weeds are writing the scripture,
7 socials, politics without principles,
Form feeling perception
Experiment of Darius,
12345678 what are these
Animals as Descartes did
Animals as Hopi do
Sure glad I am not that chicken
Chicken polo
However, vengeful ghosts
Chang
Navaho as they promote or advert
The welfare of the agent
Hay mas differencia entre budismo y navaho ego medtholodigy
Both thought

-Paul Sobczak March 15, 2013

Google spreadsheet row to columns example

 

This:

ToThis:

Run a script to go from the first spreadsheet to the format of the second see link. The code is a hard to find as it’s embedded a few layers into the document.

See https://developers.google.com/apps-script/guides/sheets#writing for information on how to setup and run this apps script, as it’s bit convoluted.

Download the spreadsheet here.

//takes row data and adds converts to column data

// for every band separate write the names in a new spreadsheet in the following format
// first name , last name, band name
// based off of https://developers.google.com/apps-script/guides/sheets#writing

//Paul Sobczak
//themountainfold.com
//tcmaker.org
//May 2013

function RunMe() {
//name of new spreadsheet
var second_sheet_name = ‘second sheet’;

//get the active spreadsheet
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheets()[0];

// Get the range of cells that store data data.
var employeeDataRange = ss.getRangeByName(“EmployeeData”);

// For every row of employee data, generate an employee object.
var employeeObjects = getRowsData(sheet, employeeDataRange);
var j =0;
var a =0;
var m = 0;
var k = 0;
var index = 0;

//add keys to new spread sheet
var other = SpreadsheetApp.openById(SpreadsheetApp.getActiveSpreadsheet().getId());
other.getSheetByName(second_sheet_name).getRange(1, 1).setValue(‘First Name’);
other.getSheetByName(second_sheet_name).getRange(1, 2).setValue(‘Last Name’);
other.getSheetByName(second_sheet_name).getRange(1, 3).setValue(‘Band Name’);

// split the comma seperated names into a new array
var band = employeeObjects[a];
var seperatedNamesBand = band.names.split(‘,’);

//for every band seperate write the names in a new spreadshet in the following format
// first name , last name, band name

while(employeeObjects[m] != null)
{
var band = employeeObjects[m];
var seperatedNamesBand = band.names.split(‘, ‘);
k = 0;
while(seperatedNamesBand[k] != null)
{
var seperatedName = seperatedNamesBand[k].split(‘ ‘);
other.getSheetByName(second_sheet_name).getRange(2+k+index, 1).setValue(seperatedName[0]);
other.getSheetByName(second_sheet_name).getRange(2+k+index, 2).setValue(seperatedName[1]);
other.getSheetByName(second_sheet_name).getRange(2+k+index, 3).setValue(band.bandName);
//other.getSheetByName(second_sheet_name).getRange(2+k+index, 4).setValue(m);
//other.getSheetByName(second_sheet_name).getRange(2+k+index, 5).setValue(k);
//other.getSheetByName(second_sheet_name).getRange(2+k+index, 6).setValue(index);
k++;
}
index= index +k;
m++;
}

}

// getRowsData iterates row by row in the input range and returns an array of objects.
// Each object contains all the data for a given row, indexed by its normalized column name.
// Arguments:
//   – sheet: the sheet object that contains the data to be processed
//   – range: the exact range of cells where the data is stored
//   – columnHeadersRowIndex: specifies the row number where the column names are stored.
//       This argument is optional and it defaults to the row immediately above range;
// Returns an Array of objects.
function getRowsData(sheet, range, columnHeadersRowIndex) {
columnHeadersRowIndex = columnHeadersRowIndex || range.getRowIndex() – 1;
var numColumns = range.getLastColumn() – range.getColumn() + 1;
var headersRange = sheet.getRange(columnHeadersRowIndex, range.getColumn(), 1, numColumns);
var headers = headersRange.getValues()[0];
return getObjects(range.getValues(), normalizeHeaders(headers));
}

// For every row of data in data, generates an object that contains the data. Names of
// object fields are defined in keys.
// Arguments:
//   – data: JavaScript 2d array
//   – keys: Array of Strings that define the property names for the objects to create
function getObjects(data, keys) {
var objects = [];
for (var i = 0; i < data.length; ++i) {
var object = {};
var hasData = false;
for (var j = 0; j < data[i].length; ++j) {
var cellData = data[i][j];
if (isCellEmpty(cellData)) {
continue;
}
object[keys[j]] = cellData;
hasData = true;
}
if (hasData) {
objects.push(object);
}
}
return objects;
}

// Returns an Array of normalized Strings.
// Arguments:
//   – headers: Array of Strings to normalize
function normalizeHeaders(headers) {
var keys = [];
for (var i = 0; i < headers.length; ++i) {
var key = normalizeHeader(headers[i]);
if (key.length > 0) {
keys.push(key);
}
}
return keys;
}

// Normalizes a string, by removing all alphanumeric characters and using mixed case
// to separate words. The output will always start with a lower case letter.
// This function is designed to produce JavaScript object property names.
// Arguments:
//   – header: string to normalize
// Examples:
//   “First Name” -> “firstName”
//   “Market Cap (millions) -> “marketCapMillions
//   “1 number at the beginning is ignored” -> “numberAtTheBeginningIsIgnored”
function normalizeHeader(header) {
var key = “”;
var upperCase = false;
for (var i = 0; i < header.length; ++i) {
var letter = header[i];
if (letter == ” ” && key.length > 0) {
upperCase = true;
continue;
}
if (!isAlnum(letter)) {
continue;
}
if (key.length == 0 && isDigit(letter)) {
continue; // first character must be a letter
}
if (upperCase) {
upperCase = false;
key += letter.toUpperCase();
} else {
key += letter.toLowerCase();
}
}
return key;
}

// Returns true if the cell where cellData was read from is empty.
// Arguments:
//   – cellData: string
function isCellEmpty(cellData) {
return typeof(cellData) == “string” && cellData == “”;
}

// Returns true if the character char is alphabetical, false otherwise.
function isAlnum(char) {
return char >= ‘A’ && char <= ‘Z’ ||
char >= ‘a’ && char <= ‘z’ ||
isDigit(char);
}

// Returns true if the character char is a digit, false otherwise.
function isDigit(char) {
return char >= ’0′ && char <= ’9′;
}

Teaching Arduino, Soldering, and Source Code

I have been teaching classes on Arduino around the Minneapolis at Twin Cities Maker and at the Mill. There are two coming up in March and April 2012 at the Hack Factory, check the respective websites for more information.

I have also been teaching some soldering classes, more to come in the future, check Twin Cities Maker for upcoming events. Here is a picture of a student holding a genuine Wayne and Layne blinky POV from a class I taught with Adam.

I have been on a pro account on Flickr for 1 year now and have poster over 2,000 images. Most of are Twin Cities Maker. My profile is here.

Finally I updated some of the repositories that I have been working on source code wise, over at the Source Code Page, or on my bitbucket page.

PCB mistakes

I just sent out a pcb order with Laen over at Dorkbot PDX and they came in, very nice boards, and a great price.

But… Read More »

Arduino, Pduino, and Pure Data

A short video showing a proof of concept using sound to blink an LED. This program uses Pure Data, and an Arduino.

Arduino PD LED Adudio Thing from paul sobczak on Vimeo.

Blogged on Make: Blog

Source Code over on the source code page.

KiCad not loading Libriaries

I tried installing Kicad on Mac and it was not playing nicely, so I switched to Windows and had no problems. So I thought it was a mac thing but later I tried installing on Ubuntu and I got the same errors from the start. KiCad is not loading Libraries.
This was by far the most frustrating part about KiCad, I which that the dependent libraries were included in the build, that would only make sense. Anyways I was lucky enough to have the libraries from the Windows distro that I also installed, as they are a part of the exe.

I uploaded the component libriares into /share/kicad/template where KiCad is already, on my mac and it works.

I have since switched over to Ubuntu for development, and used a tuturial that Wayne and Layne made that also has a solution to download the libraries Wayne and Layne’s blog, and their solution. (outlined below)

bzr checkout lp:~kicad-lib-committers/kicad/library kicad-library.bzr
cd kicad-library.bzr/
mkdir build
cd build/
cmake ../
sudo make install

Depending on if you built KiCad or not and where you did so this should work. If you have problems search through Wayne and Layne’s post and build it the way that they are and it will work. Most likely there is a way to do something similar on the mac but I don’t know.

Arduino and Gmail

Teaching Arduino at the Hack Factory

Getting Arduino to communicate with Gmail, from the class that I taught at Twin Cities Maker

The basics were getting Arduino to talk to Gmail and then turn on a LED.

Step one: Load you Arduino with PhysicalPixel. It’s under examples, Communication.
Step two: Install Python and Pyserial
Step three download the ArduinoandGmail.py code

Step Four: Edit the Python Code. You will need to edit two things:

s = serial.Serial('/dev/tty.usbserial-A6008dvx', 9600)
Between the first tick marks enter your serial connection, you can find this by going to the Arduino IDE and then Tools, Serial Port, what is checked is what goes between the tick marks.

#inser username then password
rc, resp = M.login('USERNAME', 'PASSWORD')
print rc, resp

Enter you username and password.

Step Five: Run the python script and you should be good to go, the python will send letter ‘H’ when you have 1 or more unseen emails and ‘L’ when you have 0.

Step Six: hook up a LED and Resistor to Pin 13, or hook something else up that you want to turn on.

Step Seven: Get the LED to turn off, Join up with others talking about Inbox Zero or you can change the threshold to what ever level you want and ignore Inbox Zero.

the Python Code:

# Code my Mike Hord, Kelly, and Paul Sobczak
# Gmail and Arduino 3/19/11
# Twin Cites Maker

import serial
import time
import imaplib
import re
import string

# interval change for less often
INTERVAL = 1 # check every INTERVAL minutes

last_check = time.time() – INTERVAL*60 # subtract so that we check first time

#change between the ticks your serial link on arduino
s = serial.Serial(‘/dev/tty.usbserial-A6008dvx’, 9600)

time.sleep(1.5)
s.write(‘L’)
IMAP_SERVER=’imap.gmail.com’
IMAP_PORT=993
M = imaplib.IMAP4_SSL(IMAP_SERVER, IMAP_PORT)

#insert username then password
rc, resp = M.login(‘USERNAME’, ‘PASSWORD’)
print rc, resp

# main loop
while True:
if time.time() – last_check < INTERVAL*5:
continue
last_check = time.time()

status_string = M.status(‘INBOX’, ‘(UNSEEN)’)[1]
print status_string[0]
p = re.compile(‘\d+’)
unread_count = string.atoi(p.findall(status_string[0])[0],10)
print unread_count
if unread_count > 0:
s.write(‘H’)
else:
s.write(‘L’)

This code was written Mostly by Mike Hord who operates the Uptownmaker Blog, Kelly and myself.

Update: This is now hosted on a Google Project Page

Vidisynth


Vidisynth

Origami Phizz Dodecahedron


Built using Washi sheets.

http://en.wikipedia.org/wiki/Washi

Purchased in Kyoto, Japan.
en.wikipedia.org/wiki/Kyoto

Tom Hull’s fantastic Phizz unit

http://kahuna.merrimack.edu/~thull/phzig/phzig.html

Music by Amiina

http://en.wikipedia.org/wiki/Amiina

Filmed on a Cannon s95

http://en.wikipedia.org/wiki/Canon_PowerShot_S95

In a hotel room

http://en.wikipedia.org/wiki/Hotel

In St. Cloud, Minnesota

http://en.wikipedia.org/wiki/St._Cloud,_Minnesota

In February

http://en.wikipedia.org/wiki/February

Which is now in the Past

http://en.wikipedia.org/wiki/Past

or is it?

http://en.wikipedia.org/wiki/The_Unreality_of_Time

Origami Lazy Butterfly

My recent foray back into origami has produced this simple butterfly. As far as I can tell no body else has come up with the design but I could be wrong. The butterfly is a tribute to Mr. Devendra Banhart, with respect to his song, “Lazy Butterfly


2 US Dollars | 1000 Korean Won |1 Honduran Lempira

Original design by Paul Sobczak

Observations in Asia


South Korea
Soju and the studious/relaxed characters on the bottle
Common places are not heated, feels like Russia
Kim Chi everything (awesome)
kam-sa-ham-ni-da
Sleeping Ondol Style
Currents of stench in Daejeon
Pagodas
Temples atop hills
Beds that are no softer than the ground
Hotel Feel, a typical Love Motel
Escape Rope
Christmas dinner sannakji
Wood flavored tea
Car turn tables
Animal hats
Mirrors
Urinal toys
“Intangible Cnltural Haritage Training Center”
Sweet Potato Cream Sand
Caged golfing
Jjimjilbang
Classic Modern Minimal Oriental Natural Style..
Open Wifi at a Buddhist temple
Overhead gas pumps
Korean barbecue
Mokpo
Dvd bang
PC bang
Gaejangguk
Yoboseyo
Can I have a card(ah)?
My favorite phone booth yet
Delicious sliced rice cakes
Stacked rocks


Japan
Udon
Cuttlefishes legs and Kimchee (you feel like in Korea)
Headphones tons of headphones
Midget II; the car that was so popular in the 60′s
Elephants
Yom Yom
Big Chopsticks for men
Sushi go-round
Wrapped trees
Capsule Hotel
Electrified Spa
Vending machine restaurants
Vending machine fried chicken
Raw horse
Studio Ghibli
Pancake Soda
Red Bean Coughnut
Literate bums reading newspapers on the street
Heated seats
The toilets
Karaoke
Black Wonda
Sugoi!!

Guatemalan/Honduran Observations

2011 Winter Electronics Purchase


I just put in, what has been becoming an annual occurrence,  a winter electronics binge. This years order from Sparkfun:

1 – DSO Nano V2 – Pocket-Sized Digital Oscilloscope
1 – Getting Started with Arduino
1 – Break Away Headers – Straight
1  – Break Away Female Headers
1 – Breakout Board for AD5330 Parallel 8-Bit DAC
1 – Breakout Board for MCP4725 I2C DAC
1  – Solder – 1/4lb Spool (0.032″) Special Blend
1 – Soldering Station Variable Temperature 70W – Digital
1 – Third Hand
1 – Barrel Jack Adapter – USB to 5.5mm
1  – Tweezers – Heavy Duty

Two big items in there the DSO Nano and an actual solder station, that is going to be nice, no more laying the old Radio shack iron on the ground. I have been building some electronics I have another WSG in the works and a pretty big project with my friend Matt of Citizen Analog, more on that as it comes to light.

I found 2009′s order, looking back I should have ordered another 2 or 3 micro usb cords, I haven’t had the best of  luck with them keeping them around so far, but I seem to have at least 10 mini usb cords now.

2009′s order:

USB microB Cable – 2.5 Foot x1
Audio Cable 3.5mm to RCA – 6ft x3
Audio Splitter 3.5mm – 6in x3
Electrolytic Decoupling Capacitors – 100uF/25V x1
SPDT Mini Power Switch x1
Voltage Regulator – 5V x1
Electrolytic Decoupling Capacitors – 10uF/25V x1
Basic LED – Yellow x2
Resettable Fuse PTC x1
Resistor 330 Ohm 1/6th Watt PTH x2
Diode Rectifier – 1A 50V x1
Rotary Encoder x3
Arduino Main Board x1
Basic Breadboard x1
DC Barrel Power Jack/Connector x1
Hook-up Wire – Black x1
Hook-up Wire – Red x1
Jumper Wires Premium 6″ Mixed Pack of 100 x1
Precision Phillips Set x1
Wall Adapter Power Supply – 9VDC 650mA x1
Car Adapter USB Power Supply – 5VDC 650mA x1
Digital Multimeter – Auto-Ranging x1
Wire Strippers 30AWG x1
Brass Sponge x1

Top 10+ 2010

This image is © Wellcome Images, but has been altered into a Derivative Work by Paul Sobczak by cropping.

The Tallest Man on Earth – The Wild Hunt
Crooked Still – Some Strange Country
Shpongle – Ineffable Mysteries from Shpongleland (2009)
Samamadon – I See The Sign
K’naan – Troubadour
Mumford and Sons – Sigh No More
Stars – The Five Ghosts
Zee Avi – Zee Avi (2009)
Michael Franit & Spearhead – The Sound of Sunshine
Horse Feathers – Thistled Spring
The Books – The Way Out
Laura Veirs – July Flame
Langhorn Slim – Be Set Free (2009)
Neko Case – Middle Cyclone (2009)
Ben Harper – Welcome to The Cruel World (1994)
Bob Dylan – Bob Dylan (1962)
Dave Seaman – Global Underground 012: Bueno Aires (1999)

Edward Sharpe and The Magnetic Zeros – Up From Below (2009)

Con ts; a poem and an alternative manifistation.

Cold left Cold
Sharps and rocks
Jen
laughing
and all with others
subtractive music
a massive extinction
brean malleable
worst pollen that I have ever tastes.
best bridge that I have ever slept on.
reddest room that I have ever seen
Kitchen ware storage
Is that it then I that how
I that how
Is that how
Is that It
then
Is that how
Rocky
The earth is made of rock
take and make
ride
ants
slim Jim.

Scandinavian Toilets: The Book

Scandinavian Toilets is a collection of over 100 toilets as seen and used by myself while living and traveling in Scandinavia (Norway, Sweden, and Denmark). There are 12 editions in total, and each is hand bound using the coptic binding technique.

The front cover is made of a relief print based on two separate toilets, which splits the collection in half. Six with a urinal and Six with a standard toilet. Each book is comprised of about 4-5 hours of work.

A gallery of all of the toilets is available for viewing pleasure here.

More information about the relief printing process can be found here.

Bliptronme: Bliptronic + Arduino = Monome




My latest instrument or rather control surface is the Blipronome. It’s a combo of two technologies put together by Wil Lindsay at /* straytechnologies  */ namely, the arduino and the bliptronic. The whole idea of the monome is haptic feedback and it’s engine is buttons and leds. Making an array of switches is easy enough for sure, I am typing on one now but there is no feedback loop to the actual keys just to the screen, Monome is different you click a button and it toggles from off (clear) to on (red) (or anything really it’s all programmable).

Inside the Bliptronome is a grid of switches and leds, Mr. Lindsay has taken the liberty to take this I/O and send it to an arduino. The arduino is running custom software based on what the people have been doing over at Arduinome. This software registers each button press sends it to a Ftdi chip and also gets messages from the computer and inturn tuns on leds. The Ftdi converts serial data to usb.

Once at the computer the there is a conversion package called the ArduinoSerial that is responsible for turning the serial data on the usb into either Midi or OSC  (think midi 2.0). From there you can do anything you want, you can use the switches to control your blender or a garage door if you want, but most of the programs are dedicated to music, and most of those have been written in MaxMsp and of that most of the awesome ones have been written by Tehn and Stretta. Some of my favorites so far are 64Step, Mlr, a full list of applications can be found here on the monome site.

Why Bliptronome: According to Stretta’s post on the history of the Monome :

Sales of the first 256 and 128 were quite swift compared to the original 40h. The first run of 64s sold out in two minutes.

256
September 2007 (100 units)
August 2008 (100 units)
July 2009 (100 units)

128
December 2007 (100 units)
May 2008 (100 units)
January 2009 (100 units)

64
January 2008 (200 units)
October 2008 (200 units)
January 2009 (200 units) Only 200 units made!!!

There aren’t that many monomes out there and they are expensive a 64 is going for $600 dollar on ebay right now. Further the diy arduinome is around $150 + with no case, and the nomome (Novastation Launchpad) for all intents and purposes is the best option is $200.

The Bliptronome comes in as being the cheapest option at about $130, and it also comes with 4 potentiometers that can be useful to some.

Bliptronome improvements:

  • The potentiometers I got in the kit didn’t have holes to guide the wire through which made soldering a real pain, this is an easy change the pots to ones with those little holes.
  • The Ftdi is just loosely hanging out. I think putting it inside an altoid tin or similar would ease some minds and make the whole thing more durable.
  • The play button is not used
  • The original  functionality of Bliptronic is lost (this is not that big of a deal)

In the Flesh:

Collected Rocks


Collected Rocks: By Paul Sobczak

info

Top 10 2009

This image is © Wellcome Images, but has been altered into a Derivative Work by Paul Sobczak by cropping, removing and adding content


1. Iron And Wine – Around The Well
2. Tallest Man on Earth – Shallow Grave (2008)
3. Bela Fleck – Throw Down Your Heart
4. Decemberists – Hazards of Love
5. Varius Artists – Dark Was the Night
6. William Elliot Whitmore – Animals in the Dark
7. Amy Milan – Masters of the Burial
8. Antony and the Johnsons – The Crying Light
9. The Pines – Tremolo
10. Ben Frost – By The Throat

Iowa A Day: The Post Card Book

09272009570Iowa a Day has now been realized into a post card book. Only a short run is being made so if you haven’t expressed that you want one and you do, I suggest you do so quickly.

The post card book includes all of the photos from Iowa a Day plus one extra. Each of the discriptions for the photos are inculded on the flipside of the cards, which are indivudally detachable. The book also features a japanese stab binding. This post card book is ment to be used.

Three Moon Shoes in Scandinavia (Mix Tape Release)

three1My mix, Three Moon Shoes in Scandinavia, has been completed and is available if you are so interested. The mix includes songs that I have listened to and shared with people along the last 15 or so months, and it is quite good if you ask me.

The first version of this mix tape circa June 2008 is also available upon request, but for that one you need to mail your request, if you need my address just ask.

“Four Moon Shoes in Scandinavia” is scheduled to come out in December 2010.