Difference between revisions of "Adafruit Order"

From ATXHackerspace

Jump to: navigation, search
 
(20 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<p>__NOTOC__
+
__NOTOC__
</p>
+
== Adafruit Wholesale Order  ==
<h2> Adafruit Wholesale Order  </h2>
 
<p>We get various discounts from Adafruit if we order $250 worth of stuff. It's the Adafruit wholesale discount! So, if you want to get in on an order, add your request to this page. When the total gets to be ~$250, the order goes in, and is delivered to the hackerspace.
 
</p><p>There have been various non-paying people on the last couple orders. SO, in order to put the order in this time, when the order is complete we'll be taking the payments <i><b>BEFORE</b></i> placing the order. Sorry, but the hackerspace just can't absorb $70-100 in unpaid items.
 
</p>
 
<h2> Jun Adafruit Order </h2>
 
<table border="2" align="center" id="orderTable">
 
  
<tr>
+
We get various discounts from Adafruit if we order $250 worth of stuff. It's the Adafruit wholesale discount! So, if you want to get in on an order, add your request to this page. When the total gets to be ~$250, the order goes in, and is delivered to the hackerspace.
<th scope="col"> ITEM#
+
 
</th>
+
There have been various non-paying people on the last couple orders. SO, in order to put the order in this time, when the order is complete we'll be taking the payments '''''BEFORE''''' placing the order. Sorry, but the hackerspace just can't absorb $70-100 in unpaid items.
<th scope="col"> DESCRIPTION
+
 
</th>
+
If there are any major items that are marked <font color='red'>OUT OF STOCK</font> the order will not be placed until either 1) the rest of the order totals more than $250 or 2) the major items come back into stock .. usually 5-7 days.
<th scope="col"> QTY
+
 
</th>
+
== September 2013 Adafruit Order is OPEN ==
<th scope="col"> COST
+
 
</th>
+
{| border="2" align="center" id="orderTable"
<th scope="col"> DISCOUNT_COST
+
|-
</th>
+
! scope="col" | ITEM#  
<th scope="col"> TOTAL
+
! scope="col" | DESCRIPTION  
</th>
+
! scope="col" | QTY  
<th scope="col"> MEMBER
+
! scope="col" | COST  
</th></tr>
+
! scope="col" | DISCOUNT_COST  
<tr>
+
! scope="col" | TOTAL  
<td> 170
+
! scope="col" | MEMBER
</td>
+
|-
<td> <a href="http://www.adafruit.com/products/170">Adafruit ARDX - v1.3 Experimentation Kit for Arduino (Uno R3) - v1.3</a>
+
|9999
</td>
+
|[http://www.adafruit.com/products/9999 Example Item]
<td> 1
+
|1
</td>
+
|$1.00
<td> $85.00
+
|$1.00
</td>
+
|$1.00
<td> &#160;$68.00
+
|Martin Bogomolni
</td>
+
|-
<td> $68.00
+
|SHIPPING
</td>
+
|UPS 2nd Day
<td> Shadow
+
|&nbsp;
</td></tr>
+
|$??.??
<tr>
+
|&nbsp;
<td> 454
+
|'''$??.??'''
</td>
+
|&nbsp;
<td> <a href="http://www.adafruit.com/products/454">Miniature 8x8 Red LED Matrix</a>
+
|}
</td>
+
 
<td> 50
+
<br>
</td>
 
<td> $3.56
 
</td>
 
<td> &#160;$2.40
 
</td>
 
<td> $120.00
 
</td>
 
<td> Christian Miller
 
</td></tr>
 
<tr>
 
<td> 259
 
</td>
 
<td> <a href="http://www.adafruit.com/products/259">USB LiIon/LiPoly charger - v1.2</a>
 
</td>
 
<td> 1
 
</td>
 
<td> $12.50
 
</td>
 
<td> &#160;OUT OF STOCK
 
</td>
 
<td> ~$12.50
 
</td>
 
<td> Jonathan Kelly
 
</td></tr>
 
<tr>
 
<td>459
 
</td>
 
<td><a href="https://www.adafruit.com/products/459">Bi-Color (Red/Green) 12-LED Bargraph - BL-AR12Z3010DUG-11</a>
 
</td>
 
<td>8
 
</td>
 
<td>$1.95
 
</td>
 
<td>&#160;$1.35
 
</td>
 
<td>$10.80
 
</td>
 
<td>Steven Noreyko
 
</td></tr>
 
<tr>
 
<td>861
 
</td>
 
<td><a href="https://www.adafruit.com/products/861">Miniature 8x8 Green LED Matrix - BL-M07C881UG-11</a>
 
</td>
 
<td>2
 
</td>
 
<td>$3.95
 
</td>
 
<td>&#160;$2.80
 
</td>
 
<td>$5.60
 
</td>
 
<td>Steven Noreyko
 
</td></tr>
 
<tr>
 
<td>881
 
</td>
 
<td><a href="http://www.adafruit.com/products/881">Adafruit 0.56" 4-Digit 7-Segment Display w/I2C Backpack - Blue</a>
 
</td>
 
<td>1
 
</td>
 
<td>$11.95
 
</td>
 
<td>&#160;$8.40
 
</td>
 
<td>$8.40
 
</td>
 
<td>Steven Noreyko
 
</td></tr>
 
<tr>
 
<td>284
 
</td>
 
<td><a href="https://www.adafruit.com/products/284">FTDI friend + extras v1.0</a>
 
</td>
 
<td>1
 
</td>
 
<td>$14.75
 
</td>
 
<td>&#160;$10.50
 
</td>
 
<td>$10.50
 
</td>
 
<td>Jessica Ross
 
</td></tr>
 
<tr>
 
<td>418
 
</td>
 
<td><a href="https://www.adafruit.com/products/418">Arduino Uno Ethernet</a>
 
</td>
 
<td>1
 
</td>
 
<td>$65.00
 
</td>
 
<td>&#160;$65.00
 
</td>
 
<td>$65.00
 
</td>
 
<td>Jessica Ross
 
</td></tr>
 
<tr>
 
<td>175
 
</td>
 
<td><a href="https://www.adafruit.com/products/175">Music &amp; sound add-on pack for Arduino - v1.1</a>
 
</td>
 
<td>1
 
</td>
 
<td>$35.00
 
</td>
 
<td>&#160;$35.00
 
</td>
 
<td>$35.00
 
</td>
 
<td>Jessica Ross
 
</td></tr>
 
<tr>
 
<td>14
 
</td>
 
<td><a href="https://www.adafruit.com/products/14">MintyBoost Kit - v3.0</a>
 
</td>
 
<td>1
 
</td>
 
<td>$19.50
 
</td>
 
<td>&#160;$13.65
 
</td>
 
<td>$13.65
 
</td>
 
<td>Andrew Harris
 
</td></tr>
 
<tr>
 
<td>16
 
</td>
 
<td><a href="https://www.adafruit.com/products/16">Altoids Gum sized tin</a>
 
</td>
 
<td>1
 
</td>
 
<td>$2
 
</td>
 
<td>&#160;$1.40
 
</td>
 
<td>$1.40
 
</td>
 
<td>Andrew Harris
 
</td></tr>
 
<tr>
 
<td>859
 
</td>
 
<td><a href="http://www.adafruit.com/products/859">Raspberry Pi Box laser-cut case</a>
 
</td>
 
<td>1
 
</td>
 
<td>$14.95
 
</td>
 
<td>&#160;
 
</td>
 
<td>$14.95
 
</td>
 
<td>Roland McIntosh
 
</td></tr></table>
 
<p><br />
 
<br />
 
</p>
 
 
<div style="display:none" class="explanation README">
 
<div style="display:none" class="explanation README">
<pre class="_fck_mw_lspace"> You don't have to mess with the progress bar, it's a PITA to do manually, and Roland will likely do it himself when he's bored.  But if you WANT to:
+
  You don't have to mess with the progress bar, it's a PITA to do manually, and Roland will likely do it himself when he's bored.  But if you WANT to:
Change the width of the inner div to some # of pixels out of 500.  Formulas:  newWidth = currentTotal / $250 * 500px;  percent = round(currentTotal / $250 * 100)
+
  Change the width of the inner div to some # of pixels out of 500.  Formulas:  newWidth = currentTotal / $250 * 500px;  percent = round(currentTotal / $250 * 100)
</pre>
 
 
</div>
 
</div>
<div style="width: 500px; text-align: center; border: 1px solid black;margin: 0 auto;background-image: -moz-linear-gradient(#ddd, #fff);background-image: -webkit-linear-gradient(#ddd, #fff);"><div class="CHANGE_WIDTH_HERE" style="width: 500px;background-color: green; color: white; font-weight: bold;background-image: -moz-linear-gradient(#5b5, #272);background-image: -webkit-linear-gradient(#5b5, #272);">100% of $250 goal</div></div>
 
<h2> Adding it up </h2>
 
<p>Mostly you can add it up your total in your head or with a calculator just as quickly as copy/pasting this, but you can also use some tools to help.
 
</p>
 
<h3> Copy/paste + awk </h3>
 
<p>Copy/paste the table from your web browser into a text file.  You should get tab delimited output (tested using Google Chrome pasting into vim).  Save the text file as "order.tsv" and run:
 
</p>
 
<pre class="_fck_mw_lspace"> awk -F"\t" '/YOURNAMEHERE/ {print $6}' order.tsv | tr -d '~$ '| awk '{sum+=$1}END{print sum}'
 
</pre>
 
<h3> screen scraping with lynx and grep </h3>
 
<p>This avoids the copy/paste, but requires that your name not appear on any other lines in this page.
 
</p>
 
<pre>
 
  lynx -width=500 -dump &quot;http://www.atxhackerspace.org/index.php?title=Adafruit_Order&quot; | egrep -o &quot;[0-9\.]*[0-9]*[ ]+YOURNAMEHERE&quot; | awk '{sum+=$1}END{print sum}'
 
</pre>
 
<p>Here's one for elinks, which uses a vertical pipe and variable whitespace when rendering table cells:
 
</p>
 
<pre>
 
  elinks --dump-width 500 -dump &quot;http://www.atxhackerspace.org/index.php?title=Adafruit_Order&quot; | egrep -o &quot;[0-9\.]*[0-9]*[ ]+\|[ ]*YOURNAMEHERE&quot; | awk '{sum+=$1}END{print sum}'
 
</pre>
 
<h3> Built-in browser javascript console sniffing via DOM </h3>
 
<p>You can open a javsacript console in Google Chrome or Firefox with Firebug installed by pressing the F12 key.  Then paste in:
 
</p>
 
<pre>
 
  var NAME_REGEXP=/YOURNAMEHERE/;var t = document.getElementById(&quot;orderTable&quot;);var sum=0;for( var i =0; i &lt; t.rows.length&#160;; ++i){var r = t.rows[i]; if( NAME_REGEXP.test(r.cells[6].textContent) ) { sum+= parseFloat( r.cells[5].textContent.replace(/[^\d\.]/g,'' ), 10); } };console.log( NAME_REGEXP.source + &quot; owes: $&quot; + sum );
 
</pre>
 
<p>Floating point rounding errors can happen due to IEEE 754 float representation in javscript.  You'd have to convert dollars to cents to fix.
 
</p><p><br />
 
</p>
 
<h2> Feb Adafruit Order <b>IS CLOSED</b></h2>
 
<table border="2" align="center" id="FEB_orderTable">
 
  
<tr>
+
<div style="width: 500px; text-align: center; border: 1px solid black;margin: 0 auto;background-image: -moz-linear-gradient(#ddd, #fff);background-image: -webkit-linear-gradient(#ddd, #fff);"><div class="CHANGE_WIDTH_HERE" style="width: 0px;background-color: green; color: white; font-weight: bold;background-image: -moz-linear-gradient(#5b5, #272);background-image: -webkit-linear-gradient(#5b5, #272);">0% of $250 goal</div></div>
<th scope="col"> ITEM#
+
 
</th>
+
== Adding it up ==
<th scope="col"> DESCRIPTION
+
Mostly you can add it up your total in your head or with a calculator just as quickly as copy/pasting this, but you can also use some tools to help.
</th>
+
=== Copy/paste + awk ===
<th scope="col"> QTY
+
Copy/paste the table from your web browser into a text file. You should get tab delimited output (tested using Google Chrome pasting into vim). Save the text file as "order.tsv" and run:
</th>
+
  awk -F"\t" '/YOURNAMEHERE/ {print $6}' order.tsv | tr -d '~$ '| awk '{sum+=$1}END{print sum}'
<th scope="col"> COST
+
 
</th>
+
=== screen scraping with lynx and grep ===
<th scope="col"> DISCOUNT_COST
+
This avoids the copy/paste, but requires that your name not appear on any other lines in this page.
</th>
+
<pre><nowiki>
<th scope="col"> TOTAL
+
  lynx -width=500 -dump "http://www.atxhackerspace.org/index.php?title=Adafruit_Order" | egrep -o "[0-9\.]*[0-9]*[ ]+YOURNAMEHERE" | awk '{sum+=$1}END{print sum}'
</th>
+
</nowiki></pre>
<th scope="col"> MEMBER
+
 
</th></tr>
+
Here's one for elinks, which uses a vertical pipe and variable whitespace when rendering table cells:
<tr>
+
 
<td> 165
+
<pre><nowiki>
</td>
+
  elinks --dump-width 500 -dump "http://www.atxhackerspace.org/index.php?title=Adafruit_Order" | egrep -o "[0-9\.]*[0-9]*[ ]+\|[ ]*YOURNAMEHERE" | awk '{sum+=$1}END{print sum}'
<td> <a href="http://www.adafruit.com/products/165">Temp Sensor</a>
+
</nowiki></pre>
</td>
+
 
<td> 6
+
=== Built-in browser javascript console sniffing via DOM ===
</td>
+
You can open a javsacript console in Google Chrome or Firefox with Firebug installed by pressing the F12 key. Then paste in:
<td> $2.00
+
 
</td>
+
<pre><nowiki>
<td> $1.60
+
  var NAME_REGEXP=/YOURNAMEHERE/;var t = document.getElementById("orderTable");var sum=0;for( var i =0; i < t.rows.length ; ++i){var r = t.rows[i]; if( NAME_REGEXP.test(r.cells[6].textContent) ) { sum+= parseFloat( r.cells[5].textContent.replace(/[^\d\.]/g,'' ), 10); } };console.log( NAME_REGEXP.source + " owes: $" + sum );
</td>
+
</nowiki></pre>
<td> $9.60
+
 
</td>
+
Floating point rounding errors can happen due to IEEE 754 float representation in javscript.  You'd have to convert dollars to cents to fix.
<td> Martin
 
</td></tr>
 
<tr>
 
<td> 98
 
</td>
 
<td> <a href="http://www.adafruit.com/products/98">GPS Logger Shield</a>
 
</td>
 
<td> 1
 
</td>
 
<td> $19.50
 
</td>
 
<td> $19.50
 
</td>
 
<td> $19.50
 
</td>
 
<td> Martin
 
</td></tr>
 
<tr>
 
<td> 377
 
</td>
 
<td> <a href="http://www.adafruit.com/products/377">Rotary Encoder + Extras -</a>
 
</td>
 
<td> 2
 
</td>
 
<td> $4.50
 
</td>
 
<td> &#160;?
 
</td>
 
<td> ~$9
 
</td>
 
<td> Roland M.
 
</td></tr>
 
<tr>
 
<td> 501
 
</td>
 
<td> <a href="http://www.adafruit.com/products/501">5V 1A (1000mA) USB port power supply</a>
 
</td>
 
<td> 2
 
</td>
 
<td> $4.95
 
</td>
 
<td> &#160;?
 
</td>
 
<td> ~$9.90
 
</td>
 
<td> Roland M.
 
</td></tr>
 
<tr>
 
<td> 268
 
</td>
 
<td> <a href="http://www.adafruit.com/products/268">Powerswitch Tail 2</a>
 
</td>
 
<td> 1
 
</td>
 
<td> $24.95
 
</td>
 
<td> &#160;?
 
</td>
 
<td> ~$24.95
 
</td>
 
<td> Roland M.
 
</td></tr>
 
<tr>
 
<td> 412
 
</td>
 
<td> <a href="http://www.adafruit.com/products/412">Small push-pull solenoid</a>
 
</td>
 
<td> 1
 
</td>
 
<td> $9.95
 
</td>
 
<td> &#160;?
 
</td>
 
<td> ~$9.95
 
</td>
 
<td> Roland M.
 
</td></tr>
 
<tr>
 
<td> 571
 
</td>
 
<td> <a href="http://www.adafruit.com/products/571">Adafruit Perma-Proto Half-sized Breadboard PCB - 3 Pack!</a>
 
</td>
 
<td> 1
 
</td>
 
<td> $9.95
 
</td>
 
<td> &#160;?
 
</td>
 
<td> ~$9.95
 
</td>
 
<td> Roland M.
 
</td></tr>
 
<tr>
 
<td> 678
 
</td>
 
<td> <a href="http://www.adafruit.com/products/678">RF Touch Wheel Controller for Analog RGB LED Strips</a>
 
</td>
 
<td> 1
 
</td>
 
<td> $39.95
 
</td>
 
<td> &#160;?
 
</td>
 
<td> ~$39.95
 
</td>
 
<td> Roland M.
 
</td></tr>
 
<tr>
 
<td> 677
 
</td>
 
<td> <a href="http://www.adafruit.com/products/677">Terminal block - 4 pin Euro-Style</a>
 
</td>
 
<td> 1
 
</td>
 
<td> $2.50
 
</td>
 
<td> &#160;?
 
</td>
 
<td> ~$2.50
 
</td>
 
<td> Roland M.
 
</td></tr>
 
<tr>
 
<td> 579
 
</td>
 
<td> <a href="http://www.adafruit.com/products/579">4-pin JST SM Receptacle Cable</a>
 
</td>
 
<td> 4
 
</td>
 
<td> $1.50
 
</td>
 
<td> &#160;?
 
</td>
 
<td> ~$6.00
 
</td>
 
<td> Roland M.
 
</td></tr>
 
<tr>
 
<td> 578
 
</td>
 
<td> <a href="http://www.adafruit.com/products/578">4-pin JST SM Plug Cable</a>
 
</td>
 
<td> 4
 
</td>
 
<td> $1.50
 
</td>
 
<td> &#160;?
 
</td>
 
<td> ~$6.00
 
</td>
 
<td> Roland M.
 
</td></tr>
 
<tr>
 
<td> 675
 
</td>
 
<td> <a href="http://www.adafruit.com/products/675">Sewable Electroluminscent (EL) Wire Welted Piping- Aqua 5 meters</a>
 
</td>
 
<td> 1
 
</td>
 
<td> $19.95
 
</td>
 
<td> &#160;?
 
</td>
 
<td> ~$19.95
 
</td>
 
<td> MElbert
 
</td></tr>
 
<tr>
 
<td> 345
 
</td>
 
<td> <a href="http://www.adafruit.com/products/345">Nunchucky</a>
 
</td>
 
<td> 1
 
</td>
 
<td> $3.00
 
</td>
 
<td> &#160;?
 
</td>
 
<td> ~$3.00
 
</td>
 
<td> MElbert
 
</td></tr>
 
<tr>
 
<td> 362
 
</td>
 
<td> <a href="http://www.adafruit.com/products/362">MiFare Classic (13.56MHz RFID/NFC) Sticker - 1KB </a>
 
</td>
 
<td> 4
 
</td>
 
<td> $2.50
 
</td>
 
<td> &#160;??
 
</td>
 
<td> ~$10.00
 
</td>
 
<td> pwheat
 
</td></tr>
 
<tr>
 
<td> 436
 
</td>
 
<td> <a href="http://www.adafruit.com/products/364">PN532 NFC/RFID controller breakout board - v1.3 </a>
 
</td>
 
<td> 1
 
</td>
 
<td> $50.00
 
</td>
 
<td> &#160;??
 
</td>
 
<td> ~$50.00
 
</td>
 
<td> pwheat
 
</td></tr>
 
<tr>
 
<td> 436
 
</td>
 
<td> <a href="https://www.adafruit.com/products/436">Sugru Multicolor pack</a>
 
</td>
 
<td> 1
 
</td>
 
<td> $17.95
 
</td>
 
<td> &#160;??
 
</td>
 
<td> ~$17.95
 
</td>
 
<td> pwheat
 
</td></tr>
 
<tr>
 
<td> 128
 
</td>
 
<td> <a href="http://www.adafruit.com/products/128">XBee Module - Series 01 - XB24-AWI-001</a>
 
</td>
 
<td> 4
 
</td>
 
<td> $23.00
 
</td>
 
<td> &#160;??
 
</td>
 
<td> ~$92.00
 
</td>
 
<td> Tuna
 
</td></tr>
 
<tr>
 
<td> 247
 
</td>
 
<td> <a href="http://www.adafruit.com/products/247">USB XBee Adapter</a>
 
</td>
 
<td> 1
 
</td>
 
<td> $20
 
</td>
 
<td> &#160;??
 
</td>
 
<td> ~$20
 
</td>
 
<td> Tuna
 
</td></tr>
 
<tr>
 
<td> 126
 
</td>
 
<td> <a href="http://www.adafruit.com/products/126">XBee Adapter kit - v1.1</a>
 
</td>
 
<td> 1
 
</td>
 
<td> $10
 
</td>
 
<td> &#160;??
 
</td>
 
<td> ~$10
 
</td>
 
<td> Tuna
 
</td></tr></table>
 
<div style="display:none"> ABOVE IS FEB table -- that order is CLOSED</div>
 

Latest revision as of 20:16, 28 August 2013

Adafruit Wholesale Order

We get various discounts from Adafruit if we order $250 worth of stuff. It's the Adafruit wholesale discount! So, if you want to get in on an order, add your request to this page. When the total gets to be ~$250, the order goes in, and is delivered to the hackerspace.

There have been various non-paying people on the last couple orders. SO, in order to put the order in this time, when the order is complete we'll be taking the payments BEFORE placing the order. Sorry, but the hackerspace just can't absorb $70-100 in unpaid items.

If there are any major items that are marked OUT OF STOCK the order will not be placed until either 1) the rest of the order totals more than $250 or 2) the major items come back into stock .. usually 5-7 days.

September 2013 Adafruit Order is OPEN

ITEM# DESCRIPTION QTY COST DISCOUNT_COST TOTAL MEMBER
9999 Example Item 1 $1.00 $1.00 $1.00 Martin Bogomolni
SHIPPING UPS 2nd Day   $??.??   $??.??  


0% of $250 goal

Adding it up

Mostly you can add it up your total in your head or with a calculator just as quickly as copy/pasting this, but you can also use some tools to help.

Copy/paste + awk

Copy/paste the table from your web browser into a text file. You should get tab delimited output (tested using Google Chrome pasting into vim). Save the text file as "order.tsv" and run:

 awk -F"\t" '/YOURNAMEHERE/ {print $6}' order.tsv | tr -d '~$ '| awk '{sum+=$1}END{print sum}'

screen scraping with lynx and grep

This avoids the copy/paste, but requires that your name not appear on any other lines in this page.

  lynx -width=500 -dump "http://www.atxhackerspace.org/index.php?title=Adafruit_Order" | egrep -o "[0-9\.]*[0-9]*[ ]+YOURNAMEHERE" | awk '{sum+=$1}END{print sum}'

Here's one for elinks, which uses a vertical pipe and variable whitespace when rendering table cells:

  elinks --dump-width 500 -dump "http://www.atxhackerspace.org/index.php?title=Adafruit_Order" | egrep -o "[0-9\.]*[0-9]*[ ]+\|[ ]*YOURNAMEHERE" | awk '{sum+=$1}END{print sum}'

Built-in browser javascript console sniffing via DOM

You can open a javsacript console in Google Chrome or Firefox with Firebug installed by pressing the F12 key. Then paste in:

  var NAME_REGEXP=/YOURNAMEHERE/;var t = document.getElementById("orderTable");var sum=0;for( var i =0; i < t.rows.length ; ++i){var r = t.rows[i]; if( NAME_REGEXP.test(r.cells[6].textContent) ) { sum+= parseFloat( r.cells[5].textContent.replace(/[^\d\.]/g,'' ), 10); } };console.log( NAME_REGEXP.source + " owes: $" + sum );

Floating point rounding errors can happen due to IEEE 754 float representation in javscript. You'd have to convert dollars to cents to fix.