This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>SpectralWorkbench</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta name="description" content="An open source spectral library | |
and DIY spectrometry community developing environmental testing | |
techniques."> | |
<meta name="author" content="Public Lab contributors"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
decode = function(msg) { | |
msg = msg.split(' '); | |
out = ""; | |
key = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; | |
for (i in msg) { | |
if (msg[i] != "-") { | |
out += key[parseInt(msg[i])-1] | |
} else { | |
out += " "; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2.1.2 :002 > n = DrupalNode.find 10591 | |
DrupalNode Load (0.2ms) SELECT `node`.* FROM `node` WHERE `node`.`nid` = 10591 LIMIT 1 | |
=> #<DrupalNode nid: 10591, vid: 22273, type: "page", language: "", title: "ottawa", uid: 421299, status: 1, created: 1403188948, changed: 1427399207, comment: 0, promote: 0, moderate: 0, sticky: 0, tnid: 0, translate: 0, cached_likes: 1, drupal_comments_count: 0, drupal_node_revisions_count: 2, path: "/wiki/ottawa"> | |
2.1.2 :003 > n.revisions | |
node_revisions Columns (0.8ms) SHOW FIELDS FROM `node_revisions` | |
DrupalNodeRevision Load (0.1ms) SELECT `node_revisions`.* FROM `node_revisions` WHERE `node_revisions`.`nid` = 10591 ORDER BY timestamp | |
=> [#<DrupalNodeRevision nid: 10591, vid: 22273, uid: 1, title: "Ottawa", body: "##Overview\r\nThe pollution of water bodies (e.g. riv...", teaser: "", log: "", timestamp: 1427399207, format: 1>, #<DrupalNodeRevision nid: 10591, vid: 19027, uid: 421299, title: "ottawa", body: "##Overview\r\nThe pollution of water bodies (e.g. riv...", teas |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SQL (180.9ms) SELECT DISTINCT `node`.nid FROM `node` LEFT OUTER JOIN `node_revisions` ON `node_revisions`.`nid` = `node`.`nid` LEFT OUTER JOIN `node_counter` ON `node_counter`.`nid` = `node`.`nid` WHERE (status = 1) ORDER BY node_revisions.timestamp DESC LIMIT 30 | |
SQL (3.6ms) SELECT `node`.`nid` AS t0_r0, `node`.`vid` AS t0_r1, `node`.`type` AS t0_r2, `node`.`language` AS t0_r3, `node`.`title` AS t0_r4, `node`.`uid` AS t0_r5, `node`.`status` AS t0_r6, `node`.`created` AS t0_r7, `node`.`changed` AS t0_r8, `node`.`comment` AS t0_r9, `node`.`promote` AS t0_r10, `node`.`moderate` AS t0_r11, `node`.`sticky` AS t0_r12, `node`.`tnid` AS t0_r13, `node`.`translate` AS t0_r14, `node`.`cached_likes` AS t0_r15, `node`.`drupal_comments_count` AS t0_r16, `node`.`drupal_node_revisions_count` AS t0_r17, `node`.`path` AS t0_r18, `node_revisions`.`vid` AS t1_r0, `node_revisions`.`nid` AS t1_r1, `node_revisions`.`uid` AS t1_r2, `node_revisions`.`title` AS t1_r3, `node_revisions`.`body` AS t1_r4, `node_revisions`.`teaser` A |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# | |
# Adapted from https://learn.adafruit.com/pi-thermal-printer/ | |
# Run from inside Python-Thermal-Printer folder from https://github.com/adafruit/Python-Thermal-Printer | |
# | |
# Copyright (c) 2015 Jeffrey Warren | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
# | |
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Started GET "/contributors?page=156" for 68.180.228.243 at 2015-05-05 02:17:35 +0000 | |
Processing by UsersController#contributors as */* | |
Parameters: {"page"=>"156"} | |
Rendered users/contributors.html.erb within layouts/application (263367.7ms) | |
Rendered users/contributors.html.erb within layouts/application (294367.3ms) | |
Rendered users/contributors.html.erb within layouts/application (356336.0ms) | |
Rendered sessions/_login.html.erb (0.2ms) | |
Rendered users/contributors.html.erb within layouts/application (232340.5ms) | |
Rendered layouts/_header.html.erb (0.1ms) | |
Rendered spectrums/_search.html.erb (0.0ms) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Started GET "/contributors/top" for 127.0.0.1 at 2015-05-05 18:02:01 -0400 | |
Processing by UsersController#top_contributors as HTML | |
(0.2ms) SELECT COUNT(*) FROM "users" | |
User Load (1.4ms) SELECT users.*, count(users.id) as spectrums_count FROM "users" INNER JOIN "spectrums" ON "spectrums"."user_id" = "users"."id" GROUP BY spectrums.user_id ORDER BY spectrums_count DESC LIMIT 30 OFFSET 0 | |
(0.5ms) SELECT COUNT(*) FROM "spectrums" WHERE "spectrums"."user_id" = 1 | |
Spectrum Load (0.6ms) SELECT "spectrums".* FROM "spectrums" WHERE "spectrums"."user_id" = 1 ORDER BY id DESC LIMIT 1 | |
CACHE (0.0ms) SELECT COUNT(*) FROM "spectrums" WHERE "spectrums"."user_id" = 1 | |
Comment Load (0.5ms) SELECT "comments".* FROM "comments" WHERE "comments"."author" = 'warren' | |
CACHE (0.0ms) SELECT COUNT(*) FROM "spectrums" WHERE "spectrums"."user_id" = 1 | |
CACHE (0.0ms) SELECT "spectrums".* FROM "spectrums" WHERE "spectrums"."user_id" = 1 ORDER BY id DESC LIMIT 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Started GET "/contributors" for 127.0.0.1 at 2015-05-05 18:06:52 -0400 | |
Processing by UsersController#contributors as HTML | |
(0.1ms) SELECT COUNT(*) FROM "users" | |
User Load (0.3ms) SELECT "users".* FROM "users" ORDER BY id DESC LIMIT 30 OFFSET 0 | |
(0.5ms) SELECT COUNT(*) FROM "spectrums" WHERE "spectrums"."user_id" = 11 | |
CACHE (0.0ms) SELECT COUNT(*) FROM "spectrums" WHERE "spectrums"."user_id" = 11 | |
Comment Load (0.2ms) SELECT "comments".* FROM "comments" WHERE "comments"."author" = 'bobbies' | |
CACHE (0.0ms) SELECT COUNT(*) FROM "spectrums" WHERE "spectrums"."user_id" = 11 | |
(0.5ms) SELECT COUNT(*) FROM "spectrums" WHERE "spectrums"."user_id" = 10 | |
CACHE (0.0ms) SELECT COUNT(*) FROM "spectrums" WHERE "spectrums"."user_id" = 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Started GET "/contributors?page=175" for 209.6.52.72 at 2015-05-06 17:12:26 +0000 | |
Processing by UsersController#contributors as HTML | |
Parameters: {"page"=>"175"} | |
User Load (0.1ms) SELECT `users`.* FROM `users` WHERE `users`.`id` = 1 LIMIT 1 | |
(0.1ms) SELECT COUNT(*) FROM `users` | |
User Load (5.7ms) SELECT `users`.* FROM `users` ORDER BY id DESC LIMIT 30 OFFSET 5220 | |
CACHE (0.0ms) SELECT COUNT(*) FROM `users` | |
(20.7ms) SELECT COUNT(*) FROM `spectrums` WHERE `spectrums`.`user_id` = 39 | |
Spectrum Load (17204.2ms) SELECT `spectrums`.* FROM `spectrums` WHERE `spectrums`.`user_id` = 39 ORDER BY id DESC LIMIT 1 | |
EXPLAIN (54.4ms) EXPLAIN SELECT `spectrums`.* FROM `spectrums` WHERE `spectrums`.`user_id` = 39 ORDER BY id DESC LIMIT 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Old: | |
SQL (115.9ms) SELECT DISTINCT `node`.nid FROM `node` LEFT OUTER JOIN `node_revisions` ON `node_revisions`.`nid` = `node`.`nid` LEFT OUTER JOIN `node_counter` ON `node_counter`.`nid` = `node`.`nid` WHERE (status = 1 AND node.nid != 259 AND (type = 'page' OR type = 'tool' OR type = 'place')) ORDER BY node_revisions.timestamp DESC LIMIT 30 OFFSET 0 | |
SQL (14.2ms) SELECT `node`.`nid` AS t0_r0, `node`.`vid` AS t0_r1, `node`.`type` AS t0_r2, `node`.`language` AS t0_r3, `node`.`title` AS t0_r4, `node`.`uid` AS t0_r5, `node`.`status` AS t0_r6, `node`.`created` AS t0_r7, `node`.`changed` AS t0_r8, `node`.`comment` AS t0_r9, `node`.`promote` AS t0_r10, `node`.`moderate` AS t0_r11, `node`.`sticky` AS t0_r12, `node`.`tnid` AS t0_r13, `node`.`translate` AS t0_r14, `node`.`cached_likes` AS t0_r15, `node`.`drupal_comments_count` AS t0_r16, `node`.`drupal_node_revisions_count` AS t0_r17, `node`.`path` AS t0_r18, `node_revisions`.`vid` AS t1_r0, `node_revisions`.`nid` AS t1_r1, `node_revisions`.`uid` AS t1_r2, `node_ |