<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>programming &#8211; Matthew Petroff</title>
	<atom:link href="https://mpetroff.net/tag/programming-2/feed/" rel="self" type="application/rss+xml" />
	<link>https://mpetroff.net</link>
	<description>mpetroff.net</description>
	<lastBuildDate>Fri, 10 Aug 2018 00:48:58 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
	<item>
		<title>Print Maps</title>
		<link>https://mpetroff.net/2015/02/print-maps/</link>
					<comments>https://mpetroff.net/2015/02/print-maps/#comments</comments>
		
		<dc:creator><![CDATA[Matthew Petroff]]></dc:creator>
		<pubDate>Mon, 09 Feb 2015 00:19:35 +0000</pubDate>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[map]]></category>
		<category><![CDATA[OpenStreetMap]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[WebGL]]></category>
		<guid isPermaLink="false">http://mpetroff.net/?p=1760</guid>

					<description><![CDATA[Web maps, e.g. Google Maps, normally don&#8217;t print well, as their resolution is much lower than normal print resolution, not to mention the various other unwanted text and elements that print along with the map. While the unwanted elements can &#8230; <a href="https://mpetroff.net/2015/02/print-maps/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p><span class="dropcap">W</span>eb maps, e.g. Google Maps, normally don&#8217;t print well, as their resolution is much lower than normal print resolution, not to mention the various other unwanted text and elements that print along with the map. While the unwanted elements can be cropped out, the only fix for the low resolution is to render a higher resolution image (or use vectors). Formerly, this required installing GIS software, which also requires a suitable data source. <a href="https://printmaps.mpetroff.net/">Print Maps</a> changes that by leveraging <a href="https://github.com/mapbox/mapbox-gl-js">Mapbox GL JS</a> and <a href="https://openstreetmap.org/">OpenStreetMap</a> data to render print resolution maps in the browser. After the user selects the map size, zoom, location, style, resolution, and output format, PNG or PDF, Mapbox GL JS is configured as if it was being used on a very high pixel density display and used to render the map output. To use Print Maps, visit <a href="https://printmaps.mpetroff.net">printmaps.mpetroff.net</a>.</p>
<p><a href="https://cdn0.mpetroff.net/wp-content/uploads/2015/02/print-maps.png" title="Print Maps" data-sbox="1760"><img decoding="async" class="aligncenter wp-image-1761 size-large" title="Print Maps" src="https://cdn0.mpetroff.net/wp-content/uploads/2015/02/print-maps-640x736.png" alt="Print Maps" width="640" height="736" srcset="https://cdn0.mpetroff.net/wp-content/uploads/2015/02/print-maps-640x736.png 640w, https://cdn0.mpetroff.net/wp-content/uploads/2015/02/print-maps-261x300.png 261w, https://cdn0.mpetroff.net/wp-content/uploads/2015/02/print-maps.png 800w" sizes="(max-width: 640px) 100vw, 640px" /></a>The site&#8217;s source code is available on <a href="https://github.com/mpetroff/print-maps">GitHub</a>. Also, <a href="https://speakerdeck.com/mpetroff/hophacks-spring-2015">slides</a> from my HopHacks presentation on the project.</p>
<p>Edit (2017-01-01): Changed printmaps.org to printmaps.mpetroff.net as I&#8217;m going to let the printmaps.org domain registration expire.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://mpetroff.net/2015/02/print-maps/feed/</wfw:commentRss>
			<slash:comments>7</slash:comments>
		
		
			</item>
		<item>
		<title>Pannellum 2.0</title>
		<link>https://mpetroff.net/2014/08/pannellum-2-0/</link>
					<comments>https://mpetroff.net/2014/08/pannellum-2-0/#comments</comments>
		
		<dc:creator><![CDATA[Matthew Petroff]]></dc:creator>
		<pubDate>Sat, 23 Aug 2014 02:17:42 +0000</pubDate>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[George Peabody Library]]></category>
		<category><![CDATA[pannellum]]></category>
		<category><![CDATA[panorama]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[WebGL]]></category>
		<guid isPermaLink="false">http://mpetroff.net/?p=1556</guid>

					<description><![CDATA[Two years in the making, I finally released Pannellum 2.0, which is a near complete rewrite. The renderer was replaced with raw WebGL, and multiresolution panorama support was added, along with a fallback CSS 3D renderer. Other additions include support &#8230; <a href="https://mpetroff.net/2014/08/pannellum-2-0/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p><span class="dropcap">T</span>wo years in the making, I finally released <a href="https://github.com/mpetroff/pannellum/releases">Pannellum 2.0</a>, which is a near complete rewrite. The renderer was replaced with raw WebGL, and multiresolution panorama support was added, along with a fallback CSS 3D renderer. Other additions include support for JSON configuration files, hotspots, tours, compass headings, CORS, partial panoramas, and cubic panoramas. I also put together a website for the viewer, registering <a href="//pannellum.org/">pannellum.org</a>. Unfortunately, there is still a dearth of documentation&#8212;something I need to work on. The below example demonstrates the multiresolution, hotspot, compass heading, and tour functionality using panoramas of the <a href="//en.wikipedia.org/wiki/George_Peabody_Library">George Peabody Library</a> and a <a href="http://pannellum.org/panoramas/tour.json">JSON configuration file</a>.</p>
<p><iframe title="pannellum panorama viewer" allowfullscreen style="border-style:none;width:100%;height:390px;" src="https://cdn.pannellum.org/2.2/pannellum.htm?config=https://pannellum.org/configs/multiresolution.json&#038;autoLoad=true"></iframe></p>
]]></content:encoded>
					
					<wfw:commentRss>https://mpetroff.net/2014/08/pannellum-2-0/feed/</wfw:commentRss>
			<slash:comments>12</slash:comments>
		
		
			</item>
		<item>
		<title>Kindle Weather Display</title>
		<link>https://mpetroff.net/2012/09/kindle-weather-display/</link>
					<comments>https://mpetroff.net/2012/09/kindle-weather-display/#comments</comments>
		
		<dc:creator><![CDATA[Matthew Petroff]]></dc:creator>
		<pubDate>Fri, 14 Sep 2012 20:10:11 +0000</pubDate>
				<category><![CDATA[Hacking]]></category>
		<category><![CDATA[e-paper]]></category>
		<category><![CDATA[Kindle]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[weather]]></category>
		<guid isPermaLink="false">http://www.mpetroff.net/?p=670</guid>

					<description><![CDATA[Ever since I first learned about electronic paper, I&#8217;ve thought it would be perfect to display some sort of regularly updated, but not real-time, data such as the current date, an agenda, or the weather forecast. Unfortunately, e-paper displays have &#8230; <a href="https://mpetroff.net/2012/09/kindle-weather-display/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p><span class="dropcap">E</span>ver since I first learned about electronic paper, I&#8217;ve thought it would be perfect to display some sort of regularly updated, but not real-time, data such as the current date, an agenda, or the weather forecast. Unfortunately, e-paper displays have always cost more than I was willing to spend on such a project. However, with the price of Amazon&#8217;s cheapest Kindle recently dropped to $69, I decided e-paper displays were finally cheap enough for me to pursue such a project: an e-paper based weather forecast display.</p>
<p style="text-align: center;"><a href="https://cdn0.mpetroff.net/wp-content/uploads/2012/09/kindle-weather-display.jpg" title="Kindle Displaying Weather Forecast" data-sbox="670"><img loading="lazy" decoding="async" class=" wp-image-674  aligncenter" title="Kindle Displaying Weather Forecast" src="https://cdn0.mpetroff.net/wp-content/uploads/2012/09/kindle-weather-display-640x427.jpg" alt="" width="640" height="427" srcset="https://cdn0.mpetroff.net/wp-content/uploads/2012/09/kindle-weather-display-640x427.jpg 640w, https://cdn0.mpetroff.net/wp-content/uploads/2012/09/kindle-weather-display-300x200.jpg 300w, https://cdn0.mpetroff.net/wp-content/uploads/2012/09/kindle-weather-display-1280x853.jpg 1280w, https://cdn0.mpetroff.net/wp-content/uploads/2012/09/kindle-weather-display.jpg 1500w" sizes="auto, (max-width: 640px) 100vw, 640px" /></a></p>
<p style="text-align: left;"><span id="more-670"></span></p>
<p>The system consists of two parts, one running on the wall-mounted Kindle and one running on a server. The server fetches and processes weather data to create an image, and the Kindle downloads and displays it. While the Kindle is capable of handling both parts, I already had a server, and utilizing it saved me the time and hassle of setting up a build environment for the Kindle.</p>
<p>The server side of the system uses shell and Python scripts to convert weather forecast data into an image for the Kindle. The scripts first download and parse forecast data from NOAA via the <a href="http://graphical.weather.gov/xml/">National Digital Forecast Database XML/SOAP Service</a>. After parsing the data, the data then needs to be converted into an image. This is accomplished by preprocessing a specially crafted SVG file to insert temperatures, forecast symbols, and days of the week. This SVG is then rendered as a PNG using <a href="http://developer.gnome.org/rsvg/stable/">rsvg-convert</a> and converted to a grayscale, no transparency color space as required by the Kindle using <a href="http://pmt.sourceforge.net/pngcrush/">pngcrush</a>. Finally, it is copied to a public location on the web server.</p>
<div id="attachment_677" style="width: 610px" class="wp-caption aligncenter"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-677" class="size-full wp-image-677 " title="Weather Icons" src="https://cdn0.mpetroff.net/wp-content/uploads/2012/09/icons.png" alt="" width="600" height="1000" srcset="https://cdn0.mpetroff.net/wp-content/uploads/2012/09/icons.png 600w, https://cdn0.mpetroff.net/wp-content/uploads/2012/09/icons-180x300.png 180w, https://cdn0.mpetroff.net/wp-content/uploads/2012/09/icons-576x960.png 576w" sizes="auto, (max-width: 600px) 100vw, 600px" /><p id="caption-attachment-677" class="wp-caption-text">Weather Icons Used for Forecasts</p></div>
<p>Before running anything on the Kindle, one must first jailbreak it and obtain shell access; this is left as an exercise for the reader. The Kindle portion of the system consists of a shell script that downloads the rendered image from the server, clears the screen twice to prevent ghosting, and then displays the image on the Kindle&#8217;s screen. On both the server and the Kindle, cron is used to execute the required scripts twice a day, with the server executing its scripts five minutes earlier than the Kindle to ensure a new image is ready. In addition, the Kindle requires an initialization script to disable the framework and power daemons to prevent the screen from being overwritten and to prevent the Kindle from going into sleep mode, which would disable the WiFi as well as cron, preventing any forecast updates. This initialization script was made easily accessible on power on of the Kindle using <a href="http://www.mobileread.com/forums/showthread.php?t=168270">kite</a>.</p>
<p>To create the icons, I started off with public domain icons from the <a href="http://thenounproject.com/">Noun Project</a>. Either using pieces of these icons or from scratch, I created icons for the weather conditions there were no icons available for and for those where there were no public domain versions. I am releasing the icons under the <a href="http://creativecommons.org/publicdomain/zero/1.0/">CC0 Public Domain Dedication</a> and the source code for the scripts under the <a href="http://opensource.org/licenses/mit-license.php">MIT License</a>.</p>
<p>Files:<br />
<a href="https://cdn0.mpetroff.net/wp-content/uploads/2012/09/weather-icons.zip">Weather Icons</a><br />
Source: <a href="https://cdn0.mpetroff.net/wp-content/uploads/2012/09/kindle-weather-display.tar.xz">Archive</a>, <a href="https://github.com/mpetroff/kindle-weather-display">GitHub</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://mpetroff.net/2012/09/kindle-weather-display/feed/</wfw:commentRss>
			<slash:comments>122</slash:comments>
		
		
			</item>
		<item>
		<title>Introducing “A Jackson Pollock-esque Art Generator”</title>
		<link>https://mpetroff.net/2011/06/introducing-a-jackson-pollock-esque-art-generator/</link>
					<comments>https://mpetroff.net/2011/06/introducing-a-jackson-pollock-esque-art-generator/#respond</comments>
		
		<dc:creator><![CDATA[Matthew Petroff]]></dc:creator>
		<pubDate>Thu, 16 Jun 2011 00:07:37 +0000</pubDate>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[art]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Jackson Pollock]]></category>
		<category><![CDATA[processing]]></category>
		<category><![CDATA[programming]]></category>
		<guid isPermaLink="false">http://www.mpetroff.net/?p=142</guid>

					<description><![CDATA[Originally written in the desktop version of Processing, with PDF export, and intended to be used to generate backgrounds, “A Jackson Pollock-esque Art Generator” has now been ported to Processing.js, running in any HTML5 canvas compatible browser. Simply click and &#8230; <a href="https://mpetroff.net/2011/06/introducing-a-jackson-pollock-esque-art-generator/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p><span class="dropcap">O</span>riginally written in the desktop version of <a title="Processing.org" href="http://www.processing.org/">Processing</a>, with PDF export, and intended to be used to generate backgrounds, “<a title="A Jackson Pollock-esque Art Generator" href="/files/processing/backgroundgenerator/">A Jackson Pollock-esque Art Generator</a>” has now been ported to <a title="Processing.js" href="http://processingjs.org/">Processing.js</a>, running in any HTML5 canvas compatible browser. Simply click and drag to <del>waste time</del> create beautiful artwork. You can even export an image of your masterpieces!</p>
<p>Available (with full source code) here:<br />
<a href="/files/processing/backgroundgenerator/" target="_blank">https://mpetroff.net/files/processing/backgroundgenerator/</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://mpetroff.net/2011/06/introducing-a-jackson-pollock-esque-art-generator/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Page Caching using Disk: Enhanced 
Content Delivery Network via Amazon Web Services: CloudFront: cdn0.mpetroff.net
Minified using Disk

Served from: mpetroff.net @ 2026-03-29 01:21:57 by W3 Total Cache
-->