<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by James Pollack on Medium]]></title>
        <description><![CDATA[Stories by James Pollack on Medium]]></description>
        <link>https://medium.com/@jamesbpollack?source=rss-2684ae4296d9------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*S0MDAgiZufnov6BcdB0l_Q.jpeg</url>
            <title>Stories by James Pollack on Medium</title>
            <link>https://medium.com/@jamesbpollack?source=rss-2684ae4296d9------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 15 Nov 2026 20:49:13 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jamesbpollack/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Curious Resources: Volume 3]]></title>
            <link>https://medium.com/curious-resources/curious-resources-volume-3-3ea21f1a026f?source=rss-2684ae4296d9------2</link>
            <guid isPermaLink="false">https://medium.com/p/3ea21f1a026f</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[research]]></category>
            <dc:creator><![CDATA[James Pollack]]></dc:creator>
            <pubDate>Thu, 22 Mar 2018 15:46:00 GMT</pubDate>
            <atom:updated>2018-04-02T11:18:08.215Z</atom:updated>
            <content:encoded><![CDATA[<h4>Speaker Diarization, Descriptive Scene Building, &amp; Automatic Interaction Systems</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*nNifyYdWh5yfIFlL." /><figcaption>“Long exposure shot of a man creating a circle of light, as the moon rises behind” by <a href="https://unsplash.com/@arstyy?utm_source=medium&amp;utm_medium=referral">Austin Neill</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Welcome back!</h3><p>Each edition we try to bring you a set of interesting finds in interactive technology. If you missed the <a href="https://medium.com/curious-resources/curious-resources-volume-2-f365abc08978">previous edition</a>, there’s another collection of great links waiting for you when you’re done here.</p><h4>This issue we’re covering:</h4><ul><li>Speaker Diarization</li><li>Descriptive Scene Creation</li><li>Automatic Interaction Systems</li></ul><h4><a href="https://github.com/imgntn">Follow me on Github</a> or get in touch with me <a href="https://www.linkedin.com/in/jamespollack/">on LinkedIn</a>!</h4><h3>Speaker Diarization</h3><p>Although we’ve recently seen vast improvements in speech recognition systems such as Amazon’s Alexa and Google’s Assistant, those improvements have for the most part come in systems that deal with a single speaker. They’re great at figuring out what’s being said — just not who’s saying it.</p><p>Speaker diarization is the process of segmenting out distinct speakers from a single audio stream. A quick way to think about it is: <em>who spoke when</em>.</p><p>Diarization is a necessary piece of any voice-based system that would create rich text transcripts from courtroom proceedings, meetings, podcasts, and panel discussions.</p><p>It’s important that such a system recognize new speakers it has never heard before, across a variety of languages and voices and independent of background noise. Transcripts can contain additional information such as speaker positions or neural network generated descriptions of visual elements.</p><p>I’m interested in using those transcripts in combination with the audio itself as the data source for generative content. A few examples:</p><ul><li>We can take data from a company like Bridgewater, who records employee conversations, and turn every conversation into a repeatable learning environment. We can put you in the scene, pause it before a decision, and ask: <em>What would you do?</em></li><li>We can take the entire history of Radio Drama and create virtual movie sets where we can shoot a million movies from any angle with any lens we want. Reimagine a favorite television show without having to recast it.</li><li>We can take audio of a podcast or panel discussion and feed it into an environment where the audio drives an avatar’s facial or skeletal animations. Sound comes from the position of the currently speaking character, since we can map speaker classifications to entities. You’ve got a ticket to an endless virtual concert hall — the room could be replicated infinitely or expanded to match available hardware capabilities.</li></ul><p>IBM is into speaker diarization. It is built into Watson now.</p><p><a href="https://www.ibm.com/blogs/bluemix/2017/05/whos-speaking-speaker-diarization-watson-speech-text-api/">Who&#39;s speaking? : Speaker Diarization with Watson Speech-to-Text API - IBM Cloud Blog</a></p><p>Amazon’s not quite there yet with their Transcribe service, but it’s coming soon.</p><p><a href="https://aws.amazon.com/transcribe/">Speech To Text - Amazon Transcribe - AWS</a></p><p>Microsoft is into speaker diarization as well.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FvcyB8xb1-ys%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DvcyB8xb1-ys&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FvcyB8xb1-ys%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/c03027df45a72dce4f75f3fcc30be869/href">https://medium.com/media/c03027df45a72dce4f75f3fcc30be869/href</a></iframe><p>Notice a trend? You’ll find Google represented in the “Speaker Diarization with LSTM” paper below.</p><iframe src="https://drive.google.com/viewerng/viewer?url=https%3A//arxiv.org/pdf/1710.10468.pdf&amp;embedded=true" width="600" height="780" frameborder="0" scrolling="no"><a href="https://medium.com/media/9bb4fb0d8df2fba4484e61c6589bba30/href">https://medium.com/media/9bb4fb0d8df2fba4484e61c6589bba30/href</a></iframe><p>Here are some cool Python libraries to get you started with your own experiments.</p><p>Pyannote has absorbed some other libraries, Tristounet. It’s being actively developed, but be wary: “The API is unfortunately not documented yet.” :/</p><p><a href="https://github.com/pyannote/pyannote-audio">GitHub - pyannote/pyannote-audio: Neural building blocks for speaker diarization: speech activity detection, speaker change detection, overlapped speech detection, speaker embedding</a></p><p>Around here, we LOVE a paper with code. Or is it code with a paper? Here’s some excellent work on diarization in broadcast television using deep learning. Thanks to the LIMSI team in France!</p><p><a href="https://github.com/yinruiqing/change_detection">yinruiqing/change_detection</a></p><iframe src="https://drive.google.com/viewerng/viewer?url=https%3A//pdfs.semanticscholar.org/edff/b62b32ffcc2b5cc846e26375cb300fac9ecc.pdf&amp;embedded=true" width="600" height="780" frameborder="0" scrolling="no"><a href="https://medium.com/media/0f92367b1c9986909b92bdab3cc24fc2/href">https://medium.com/media/0f92367b1c9986909b92bdab3cc24fc2/href</a></iframe><p>Regarding datasets: if you’re already paying for transcripts of calls or meetings from another service, you’ve got a great resource.</p><p>If you don’t, or if your dataset is small and needs augmentation, here are a few different speech corpuses: meeting recordings in English, Finnish Parliament proceedings, and French Radio and TV.</p><ul><li><a href="http://groups.inf.ed.ac.uk/ami/corpus/">AMI Corpus</a></li><li><a href="https://github.com/aalto-speech/finnish-parliament-scripts">aalto-speech/finnish-parliament-scripts</a></li><li><a href="http://islrn.org/resources/425-777-374-455-4/">ISLRN</a></li></ul><p>I-vectors were all the rage in diarization for a while. “ I-vectors convey the speaker characteristic among other information such as transmission channel, acoustic environment or phonetic content of the speech segment.”</p><p><a href="http://ieeexplore.ieee.org/document/5545402/">Front-End Factor Analysis for Speaker Verification - IEEE Journals &amp; Magazine</a></p><p>Then along came deep learning. Here’s are a newer paper that starts to move away from the idea of i-vectors.</p><iframe src="https://drive.google.com/viewerng/viewer?url=https%3A//arxiv.org/pdf/1710.10468.pdf&amp;embedded=true" width="600" height="780" frameborder="0" scrolling="no"><a href="https://medium.com/media/9bb4fb0d8df2fba4484e61c6589bba30/href">https://medium.com/media/9bb4fb0d8df2fba4484e61c6589bba30/href</a></iframe><h3>Descriptive Scene Building</h3><p>One unavoidable dilemma when building virtual worlds is the void.</p><p>You can build absolutely anything you want, but you’re faced with doing so in an endless expanse that goes on as far as you can see in either direction. It’s pretty intimidating to get started, to say nothing of the effort required to fill such a vast space with attractive content.</p><p>To generate an interesting object, you’ve got to be a specialist at creating sculpts by 3D modeling, lighting, and painting textures — all while using a manual Human Interface Device like a mouse, keyboard, 3D mouse or set of 6DOF controllers.</p><p>Or you have to become an expert at scouring the internet to find objects someone else has created that fit your budget — often by compromising on the initial concept. While this practice allows creators to avoid losing momentum and occasionally leads to delightful outcomes, the end result may not be the ideal form.</p><p>After all that, you still need to arrange all of these pieces of content in the space by using a combination of rotation and movement handles attached to individual objects, one object at a time.</p><p>And if you want the objects to be anything more than decoration, you have to begin to script interactions that specify any and all possible uses of an item beyond basic physics — e.g. a piece of paper that you can write on, crumple up and throw in a trash can, that will burn when its put in a toaster, etc. (More on that below in the section on Automatic Interaction Systems)</p><p>It should be easier.</p><p>If we can find the words for it, we can make it so.</p><p>Hence, descriptive scene building as a way forward.</p><p>We’ll be able to create and change the spaces that we inhabit online in real-time. And we’ll do so by describing with natural language what we want to see and where we want to be. Intelligent systems will get to know, riff off of and even preempt our desires as they adjust the world around us to suit our current mood and intent. The atoms that we build with in mixed reality can be the smart nano-dust that engineers dream of. As we describe our desires they will manifest around us.</p><p>And if we’re having trouble articulating our desires, the ambient intelligence will help us discover them .</p><p>Pragmatic ambiguity will be a feature — if there is a possibility space wherein a number of arrangements would match your specification, you may be asked to curate your preferred embodiment. Or the system might show an arrangement that oscillates over time. Imagine a room that’s never the same but always recognizable.</p><p>This 2006 paper seems to have kicked things off. Can you imagine trying to do this with the natural language processing tools available at the time? I bet they’d love another go.</p><iframe src="https://drive.google.com/viewerng/viewer?url=https%3A//www.cs.binghamton.edu/%7Elijun/Research/scenegeneration/supplemental_files/sp06_SEVERSKY.pdf&amp;embedded=true" width="600" height="780" frameborder="0" scrolling="no"><a href="https://medium.com/media/df8ee960f228516738718ba79203a275/href">https://medium.com/media/df8ee960f228516738718ba79203a275/href</a></iframe><p>Things advanced in 2009–2010, along with NLP.</p><iframe src="https://drive.google.com/viewerng/viewer?url=https%3A//www.ieee.org/documents/constraint_based.pdf&amp;embedded=true" width="600" height="780" frameborder="0" scrolling="no"><a href="https://medium.com/media/56f08d456389609aad5a05473698c394/href">https://medium.com/media/56f08d456389609aad5a05473698c394/href</a></iframe><p>And in the past few years we’ve started to approach systems that can handle situations like: “There is a room with a chair and a computer”. It gives me goosebumps to think about all the possibilities.</p><iframe src="https://drive.google.com/viewerng/viewer?url=https%3A//pdfs.semanticscholar.org/9405/df0490af3a797b8082d8bd36ad368785acfa.pdf%3F_ga%3D2.151768569.1169394909.1521667072-42842434.1521667072&amp;embedded=true" width="600" height="780" frameborder="0" scrolling="no"><a href="https://medium.com/media/5d87bcbd06faa98c0de33b4862b4930c/href">https://medium.com/media/5d87bcbd06faa98c0de33b4862b4930c/href</a></iframe><p>I highly recommend checking out Angel Chang’s body of work, since her research continues to push the boundaries of what’s possible in these areas.</p><p><a href="https://angelxuanchang.github.io/">Angel Xuan Chang | Angel Xuan Chang</a></p><p>One interesting problem in descriptive scene building is dealing with a phrase like “A window over there”. Over where? Understanding spatial intent is important, and Bayesian techniques can be used to filter out unlikely intents and aid decision-making.</p><iframe src="https://drive.google.com/viewerng/viewer?url=https%3A//pdfs.semanticscholar.org/d5c8/e1ff5546e7443f9e419f5ab79c882b4d22e3.pdf%3F_ga%3D2.219860185.1169394909.1521667072-42842434.1521667072&amp;embedded=true" width="600" height="780" frameborder="0" scrolling="no"><a href="https://medium.com/media/e28df0a958448a7937ee74b21624be86/href">https://medium.com/media/e28df0a958448a7937ee74b21624be86/href</a></iframe><p><a href="https://engineering.matterport.com/meet-matterports-newest-employee-thomas-bayes-b32e27260040">Meet Matterport’s newest employee: Thomas Bayes</a></p><h3>Automatic Interaction Systems</h3><p>As I mentioned above, even if you can generate a scene or environment you’ve still got to wire it up with code or animations to make it come alive.</p><p>How do we do that at scale, in a way that is interesting and feels authentic?</p><p>This first paper takes recordings from depth sensors of people performing common interactions like “watching TV” and then allows for procedural generation of similar activity.</p><p>A few people doing the same activity will quickly open up a wide range of possibilities — as each node is attached to the graph, a character can explore a larger action space between each node for activities to perform. That is, after observing us both the character would be able to “watch TV” mostly the way that I “watch TV”, but also sort of the way that you “watch TV.”</p><p>I’d love to take it a bit further and see what happens in with a generative adversarial network — what would it look like if the network running the character just barely continued to classify the movement that it creates as “watching tv” while also making the movement as much “write on a whiteboard”as possible? This works with images with different styles of painters, and often produces interesting results. Could it work with motion too? Will it dream up new gestures or spit out nonsense?</p><iframe src="https://drive.google.com/viewerng/viewer?url=https%3A//graphics.stanford.edu/projects/pigraphs/pigraphs.pdf&amp;embedded=true" width="600" height="780" frameborder="0" scrolling="no"><a href="https://medium.com/media/8487dc69d7cb40fff7d401d9f8e05d6c/href">https://medium.com/media/8487dc69d7cb40fff7d401d9f8e05d6c/href</a></iframe><p><a href="http://graphics.stanford.edu/projects/pigraphs/">PiGraphs: Learning Interaction Snapshots from Observations</a></p><p>You may need to watch the video to fully grok the next paper, but what’s happening here is that nobody actually animates the pirate’s feet — the character is able to move over and transition between a variety of terrain without specialized programming to account for each situation. Props to these folks for having a video, a paper, and code :)</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FUl0Gilv5wvY%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DUl0Gilv5wvY&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FUl0Gilv5wvY%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/466521c5465afbef10122f999e443dc6/href">https://medium.com/media/466521c5465afbef10122f999e443dc6/href</a></iframe><iframe src="https://drive.google.com/viewerng/viewer?url=http%3A//www.ipab.inf.ed.ac.uk/cgvu/phasefunction.pdf&amp;embedded=true" width="600" height="780" frameborder="0" scrolling="no"><a href="https://medium.com/media/12e0f482a6b195b2eaab3c20821785bd/href">https://medium.com/media/12e0f482a6b195b2eaab3c20821785bd/href</a></iframe><p><a href="https://github.com/sreyafrancis/PFNN">sreyafrancis/PFNN</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3ea21f1a026f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/curious-resources/curious-resources-volume-3-3ea21f1a026f">Curious Resources: Volume 3</a> was originally published in <a href="https://medium.com/curious-resources">Curious Resources</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Curious Resources: Volume 2]]></title>
            <link>https://medium.com/curious-resources/curious-resources-volume-2-f365abc08978?source=rss-2684ae4296d9------2</link>
            <guid isPermaLink="false">https://medium.com/p/f365abc08978</guid>
            <category><![CDATA[shopify]]></category>
            <category><![CDATA[gaming]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[ecommerce]]></category>
            <dc:creator><![CDATA[James Pollack]]></dc:creator>
            <pubDate>Thu, 22 Feb 2018 15:31:01 GMT</pubDate>
            <atom:updated>2018-02-23T23:30:57.352Z</atom:updated>
            <content:encoded><![CDATA[<h4>E-Commerce Inside of Games, Synthetic Biology and Simulations, &amp; Deep Learning for Weapon Detection</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1qI4hl5cPtI6Cm6r." /><figcaption>Photo by <a href="https://unsplash.com/@m3design?utm_source=medium&amp;utm_medium=referral">Marat Gilyadzinov</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Welcome back!</h3><p>Each edition we try to bring you a set of interesting finds in interactive technology. If you missed the <a href="https://medium.com/curious-resources/curious-resources-volume-1-927c58df717f">previous edition</a>, there’s another collection of great links waiting for you when you’re done here.</p><h4>This week we’re covering:</h4><ul><li>E-Commerce Inside of Games</li><li>Synthetic Biology and Simulation</li><li>Deep Learning for Weapon Detection</li></ul><h4><a href="https://github.com/imgntn">Follow me on Github</a> or get in touch with me <a href="https://www.linkedin.com/in/jamespollack/">on LinkedIn</a>!</h4><h3>E-Commerce Inside of Games: Buy the Story</h3><p>If you can sell your branded products to players at the correct time in the story, you’ll provide delight on demand and build a meaningful bridge between the physical and digital worlds. You’ll make people happy and make a ton of money! But the integrations should be more than trying to sell all of your swag at the end of every level. They need to mean something.</p><p>I’d love to do an integration that unlocks a T-shirt for purchase only after you’ve beaten a particularly difficult boss— if you saw someone else wearing the T-shirt in public, you’d know they were legit. Or in a cooking game, order a package of ingredients to match a meal you just made in the game kitchen!</p><p>Shopify has made it easy to connect with Unity using their new SDK.</p><ul><li><a href="https://github.com/Shopify/unity-buy-sdk">Shopify/unity-buy-sdk</a></li><li><a href="https://help.shopify.com/api/sdks/custom-storefront/unity-buy-sdk#use-cases-for-the-shopify-sdk-for-unity">Shopify SDK for Unity</a></li></ul><p>If there’s anything missing from the new unity-buy-sdk, you might be able to patch it with functionality from this more mature C# library.</p><p><a href="https://github.com/nozzlegear/ShopifySharp">nozzlegear/ShopifySharp</a></p><p>Or setup a lambda function on AWS and connect to Shopify in any language you want by invoking the lambda function inside of Unity with a network request.</p><ul><li><a href="https://github.com/awsdocs/aws-unity-developer-guide/blob/master/doc_source/what-is-unity-plugin.rst">awsdocs/aws-unity-developer-guide</a></li><li><a href="https://github.com/Shopify/shopify_python_api">Shopify/shopify_python_api</a></li><li><a href="https://github.com/getconversio/go-shopify">getconversio/go-shopify</a></li></ul><h3>Synthetic Biology &amp; Simulations: It’s Alive!</h3><p>The application of technology to the creation of life is today’s computing revoluion. It comes down to cost and time-to-iteration — and both are dropping precipitously. If there is no penalty to experimentation, great strides forward will occur with regularity. When it comes to synthetic biology, we’re almost there. In the meantime, simulations can help save time and money.</p><p>If you know Verilog from programming FPGAs or embedded systems — well, you’re already awesome — but did you know <em>how </em>awesome? You can make living circuits!</p><p><a href="https://github.com/CIDARLAB/cello">GitHub - CIDARLAB/cello: Genetic circuit design automation</a></p><p>Or for those with web development background, write standards-compliant creatures with JavaScript</p><ul><li><a href="https://github.com/SynBioDex/sboljs">SynBioDex/sboljs</a></li><li><a href="http://sbolstandard.org/">the Synthetic Biology Open Language (SBOL) | a language for genetic design</a></li></ul><p>Model some bacteria populations to learn what you can</p><p><a href="https://github.com/CellSimulationLabs/bsim">CellSimulationLabs/bsim</a></p><p>Or simulate a whole worm inside of your computer with OpenWorm</p><p><a href="https://github.com/openworm/OpenWorm">openworm/OpenWorm</a></p><p>This is the engine behind the body physics in OpenWorm</p><p><a href="https://github.com/openworm/sibernetic">openworm/sibernetic</a></p><p>Once you’ve reached the limits of simulation, order parts from an online database of plasmids and do it “for real”</p><p><a href="https://www.addgene.org/">Addgene: Homepage</a></p><h3>Deep Learning for Weapon Detection</h3><p>While technological change is no substitute for actual policy, computer vision systems can augment policy and provide more options to policymakers. Computerized threat or weapon detection is clearly in the public interest, but I couldn’t actually find very much code out there.</p><p>That’s probably why Homeland Security recently teamed up with data-science contest host Kaggle on a $1.5 million challenge for passenger screening at airports.</p><p><a href="https://www.kaggle.com/c/passenger-screening-algorithm-challenge">Passenger Screening Algorithm Challenge</a></p><p>Since there isn’t much code, I’ve found a few recent papers instead:</p><ul><li>An Automatic Hybrid Approach to Detect Concealed Weapons Using Deep Learning</li><li>Developing a Real-Time Gun Detection Classifier</li><li>Automatic Handgun Detection Alarm in Videos Using Deep Learning</li></ul><p>The first of these papers addresses detecting concealed weapons. Here, detection of weapons in high-security areas might be improved with deep learning through image fusion and hyperspectral imaging. Varied types of input data can be put together to form the tensors to train the network on, which should make the network more robust</p><p>However, this benefit may be limited to expensive installations or specialized equipment. The hope would be to find some kind of ubiquitous field or sensor (wifi?) where the presence of a concealed weapon might be detected in a broader scope. Weapons made with ceramics and 3D-printed materials will continue to make this task difficult, even for specialized imaging and algorithms.</p><p>The latter papers deal with detecting weapons in plain sight, a task that sounds easier than it actually is, considering the millions of hours of video uploaded to the internet or fed through security systems every day. A classifier can recognize weapons in security footage and social networks alike that might have been overlooked by human eyes. The appropriate civil liberties need to be exercised when deciding how to act upon this information, but these kinds of safeguards might constitute an early-warning system that we can build upon for a more peaceful future.</p><iframe src="https://drive.google.com/viewerng/viewer?url=http%3A//www.arpnjournals.org/jeas/research_papers/rp_2017/jeas_0817_6268.pdf&amp;embedded=true" width="600" height="780" frameborder="0" scrolling="no"><a href="https://medium.com/media/8343851d9339a97d11ca19d0c9fd9e84/href">https://medium.com/media/8343851d9339a97d11ca19d0c9fd9e84/href</a></iframe><iframe src="https://drive.google.com/viewerng/viewer?url=http%3A//cs231n.stanford.edu/reports/2017/pdfs/716.pdf&amp;embedded=true" width="600" height="780" frameborder="0" scrolling="no"><a href="https://medium.com/media/78b83c495705bb3b39893e0045bcb09f/href">https://medium.com/media/78b83c495705bb3b39893e0045bcb09f/href</a></iframe><iframe src="https://drive.google.com/viewerng/viewer?url=https%3A//arxiv.org/pdf/1702.05147.pdf&amp;embedded=true" width="600" height="780" frameborder="0" scrolling="no"><a href="https://medium.com/media/e1a1a00ea61e732354912bd4d4a9a154/href">https://medium.com/media/e1a1a00ea61e732354912bd4d4a9a154/href</a></iframe><p>Okay, so I did manage to find a few image fusion and hyperspectral imaging tools. The basic idea is to collect as much data from as many sensors as you can so that you can combine them into a single data-rich information vector.</p><ul><li><a href="https://github.com/rjw57/dtcwtfusion">rjw57/dtcwtfusion</a></li><li><a href="https://github.com/HPSCIL/cuSTARFM">HPSCIL/cuSTARFM</a></li><li><a href="https://github.com/hyperspy/hyperspy">hyperspy/hyperspy</a></li><li><a href="https://github.com/spectralpython/spectral">spectralpython/spectral</a></li></ul><p>A lot of these types of projects are trained on images of weapons from the Internet Movie Firearms Database. Which is a really cool resource that I’m sure provides some <em>interesting</em> training data. Real life, however, is often more subtle than a movie, so I’m not sure I’d trust these projects in the wild without some retraining. Hasta la vista!</p><p><a href="http://www.imfdb.org/wiki/Main_Page">Internet Movie Firearms Database - Guns in Movies, TV and Video Games</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f365abc08978" width="1" height="1" alt=""><hr><p><a href="https://medium.com/curious-resources/curious-resources-volume-2-f365abc08978">Curious Resources: Volume 2</a> was originally published in <a href="https://medium.com/curious-resources">Curious Resources</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Curious Resources: Volume 1]]></title>
            <link>https://medium.com/curious-resources/curious-resources-volume-1-927c58df717f?source=rss-2684ae4296d9------2</link>
            <guid isPermaLink="false">https://medium.com/p/927c58df717f</guid>
            <category><![CDATA[360-video]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[virtual-reality]]></category>
            <category><![CDATA[unity]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[James Pollack]]></dc:creator>
            <pubDate>Thu, 15 Feb 2018 17:01:01 GMT</pubDate>
            <atom:updated>2018-02-22T08:51:00.694Z</atom:updated>
            <content:encoded><![CDATA[<h4>Interesting finds in interactive technologies — covering the Web, Unity, Mixed Reality, Deep Learning, JavaScript, C#, 3D, Audio, Art &amp; more</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vPZ9j_qpDjaHmdLO." /><figcaption>“An optical instrument on board a boat on Fairmont Chateau Lake Louise” by <a href="https://unsplash.com/@shanehauser?utm_source=medium&amp;utm_medium=referral">Shane Hauser</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p><strong>This week we’re covering</strong>: <br>- Spatial Audio (Ambisonics) for 360/ VR / AR / XR<br>- GraphQL For Faster Front-End Iterations<br>- Live Streaming 360 Video to YouTube From Inside of Unity<br>- Assorted Deep Learning Finds: Poetry, Audio, Hi-Res Images, Unity Agents</p><p>Hi! I’m starting a series of posts that will collect some of the interesting repositories and articles that I’ve come across lately. I’ll also dig up references from my <a href="https://github.com/imgntn?tab=stars">ever growing toolbelt of Github stars</a>. I love research, exploring patterns, making connections, and creating new possibilities.</p><p>I own a company that specializes in experiences — <a href="http://www.linkedin.com/in/jamespollack">get in touch with me on LinkedIn</a>!</p><h3>Spatial Audio (Ambisonics) for 360 / VR / AR / XR</h3><p>I’ve been thinking of applying to <a href="https://vr.google.com/jump/start/">Google’s “Jump Start” program</a> to get my hands on their new YI HALO 360 camera rigs for a series of creative shoots involving magical creatures in abandoned places. One of the questions on the application asks about spatial audio aka ambisonics, which remains somewhat unexplored compared to reactive visual systems. I went back through some of my finds:</p><p>Google has a spatial audio SDK for ambisonics called Resonance<br><a href="https://developers.google.com/resonance-audio/">https://developers.google.com/resonance-audio/</a></p><p>The Unity package is on the Releases page here<br><a href="https://github.com/resonance-audio/resonance-audio-unity-sdk">https://github.com/resonance-audio/resonance-audio-unity-sdk</a></p><p>Web devs can use this library<br><a href="https://github.com/resonance-audio/resonance-audio-web-sdk">https://github.com/resonance-audio/resonance-audio-web-sdk</a></p><p>The engine behind the Web SDK<br><a href="https://github.com/GoogleChrome/omnitone">https://github.com/GoogleChrome/omnitone</a></p><p>For advanced users, you can edit in your favorite DAW as a VST<br><a href="https://github.com/resonance-audio/resonance-audio-daw-tools">https://github.com/resonance-audio/resonance-audio-daw-tools</a></p><p>Google’s encoding specs for audio and video<br><a href="https://github.com/google/spatial-media">https://github.com/google/spatial-media</a></p><p>Facebook has some slick software, but its source is nowhere to be found<br><a href="https://facebook360.fb.com/spatial-workstation/">https://facebook360.fb.com/spatial-workstation/</a></p><p>An Ableton-specific ambisonics solution<br><a href="https://github.com/EnvelopSound/EnvelopForLive">https://github.com/EnvelopSound/EnvelopForLive</a></p><h3>GraphQL For Faster Front-End Iterations</h3><p>Front-end developers building client applications can sometimes get blocked waiting for back-end API changes to keep up with design.</p><p>What if you could just go ahead change that API from the front end? What if you didn’t have to worry about whether a particular endpoint exists — if the data is there, you can construct one yourself. Even better if you could keep that app trim by only getting the data you want when you make a request, instead of a ton of bloat.</p><p>To that end, I’ve been considering whether to recommend a GraphQL API instead of a REST API to an e-commerce client. It’s important that they be able to move quickly. While doing my research, I came across some interesting resources:</p><p>Starting from this excellent article<br><a href="https://time2hack.com/2018/02/introduction-quick-guide-to-graphql-for-backend-frontend/">https://time2hack.com/2018/02/introduction-quick-guide-to-graphql-for-backend-frontend/</a></p><p>GraphQL query visualizer <br><a href="https://github.com/graphql/graphiql">https://github.com/graphql/graphiql</a></p><p>GraphQL server for Express <br><a href="https://github.com/apollographql/apollo-server">https://github.com/apollographql/apollo-server</a></p><p>Interesting how GraphQL is just an interface on top of whatever database you want to use. For example, you can use it with MongoDB <a href="https://www.compose.com/articles/using-graphql-with-mongodb/">https://www.compose.com/articles/using-graphql-with-mongodb/</a></p><p>Or PostgreSQL<br><a href="https://github.com/postgraphql/postgraphql">https://github.com/postgraphql/postgraphql</a></p><p>The spec itself, although I’d start with articles and tutorials instead<br><a href="https://github.com/facebook/graphql">https://github.com/facebook/graphql</a></p><p>Some front end tools for interacting with GraphQL <br><a href="https://github.com/apollographql/apollo-client">https://github.com/apollographql/apollo-client</a></p><p>Specifically for React<br><a href="https://github.com/apollographql/react-apollo">https://github.com/apollographql/react-apollo</a></p><p>A whole framework from Facebook that couples React with GraphQL<br><a href="https://github.com/facebook/relay">https://github.com/facebook/relay</a></p><p>Modifying control flow of queries and results<br><a href="https://github.com/apollographql/apollo-link">https://github.com/apollographql/apollo-link</a></p><p>Shorthand for writing queries<br><a href="https://github.com/apollographql/graphql-tag">https://github.com/apollographql/graphql-tag</a></p><h3>Live Streaming 360 Video to YouTube From Inside of Unity</h3><p>I’ve been trying to sort out a pipeline to live stream equirectangular video captured from a camera inside of a Unity scene to YouTube 360. I want viewers to be able to see inside of live game worlds as they’re happening. I’ve found a couple of useful leads:</p><p>Here’s one to output using FFMPEG (which could then stream to YouTube)<br>via the amazing Keijiro<br><a href="https://github.com/keijiro/FFmpegOut">https://github.com/keijiro/FFmpegOut</a></p><p>But at what speed? The new scriptable render pipeline in Unity 2018 might enable a faster solution<br><a href="https://github.com/keijiro/AsyncCaptureTest">https://github.com/keijiro/AsyncCaptureTest</a></p><p>I also evaluated a paid option<br><a href="https://github.com/SystemFriend/GPUVideoEncoder-Trial">https://github.com/SystemFriend/GPUVideoEncoder-Trial</a></p><p>The paid option makes use of this very interesting concurrency library<br><a href="https://assetstore.unity.com/packages/tools/spicy-pixel-concurrency-kit-3586">https://assetstore.unity.com/packages/tools/spicy-pixel-concurrency-kit-3586</a></p><h3>Assorted Deep Learning Finds</h3><p>Generate poetry from images using CNNS and RNNs<br><a href="https://github.com/rossgoodwin/neuralsnap">https://github.com/rossgoodwin/neuralsnap</a></p><p>Get audio into a Pytorch tensor — more audio Deep Learning projects, please!<br><a href="https://github.com/pytorch/audio">https://github.com/pytorch/audio</a></p><p>Speech at super-resolution could lead to clearer communications.<br><a href="https://github.com/jhetherly/EnglishSpeechUpsampler">https://github.com/jhetherly/EnglishSpeechUpsampler</a></p><p>Make music alongside a Google AI — a new generation of instruments and live performances may be collaborations with a computer<br><a href="https://github.com/tensorflow/magenta">https://github.com/tensorflow/magenta</a></p><p>Future Alert: with the right kind of sensors, deep learning should enable subvocal speech recognition — the ability to communicate without making sound, which would come in handy in smart gear for divers or firefighters<br><a href="https://github.com/Mohamed-Elbially/ThesisCodes">https://github.com/Mohamed-Elbially/ThesisCodes</a></p><p>Many state-of the art networks have been trained on extremely small images (300px by 300px) due to GPU memory size constraints— however, they have been very accurate despite this limitation. I’m excited about anything trained on high resolution images, since it will help us understand whether smaller training images are sufficient or only scratching the surface of what’s possible. More pixels!<br><a href="https://github.com/NVIDIA/pix2pixHD">https://github.com/NVIDIA/pix2pixHD</a></p><p>Unity is a great environment to train deep learning agents — especially multi-agent environments. <br><a href="https://github.com/Unity-Technologies/ml-agents">https://github.com/Unity-Technologies/ml-agents</a></p><p>Here’s a hide/escape example<br><a href="https://github.com/HappySlice/hide-escape">https://github.com/HappySlice/hide-escape</a></p><p>Here’s one with pirates!<br><a href="https://github.com/HugoCMU/pirateAI">https://github.com/HugoCMU/pirateAI</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=927c58df717f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/curious-resources/curious-resources-volume-1-927c58df717f">Curious Resources: Volume 1</a> was originally published in <a href="https://medium.com/curious-resources">Curious Resources</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Bow & Arrow is Virtual Reality’s “Hello, World”]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@jamesbpollack/the-bow-arrow-is-virtual-realitys-hello-world-b0556faa3ef8?source=rss-2684ae4296d9------2"><img src="https://cdn-images-1.medium.com/max/2600/1*fQijGUi0oV7JtJlfhZWveQ.png" width="3024"></a></p><p class="medium-feed-snippet">Here&#x2019;s how to build one in webVR using A-Frame</p><p class="medium-feed-link"><a href="https://medium.com/@jamesbpollack/the-bow-arrow-is-virtual-realitys-hello-world-b0556faa3ef8?source=rss-2684ae4296d9------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@jamesbpollack/the-bow-arrow-is-virtual-realitys-hello-world-b0556faa3ef8?source=rss-2684ae4296d9------2</link>
            <guid isPermaLink="false">https://medium.com/p/b0556faa3ef8</guid>
            <category><![CDATA[design]]></category>
            <category><![CDATA[ux]]></category>
            <category><![CDATA[gaming]]></category>
            <category><![CDATA[virtual-reality]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[James Pollack]]></dc:creator>
            <pubDate>Tue, 24 Jan 2017 17:26:27 GMT</pubDate>
            <atom:updated>2017-01-26T20:25:39.587Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Capture Facebook-Compatible 4K 360 Videos of 3D Scenes in Your Browser]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/hackernoon/capture-facebook-compatible-4k-360-videos-of-3d-scenes-in-your-browser-788226f2c75f?source=rss-2684ae4296d9------2"><img src="https://cdn-images-1.medium.com/max/2048/1*9ncxxUeLCpfpAtYQAT2yog.jpeg" width="2048"></a></p><p class="medium-feed-snippet">This article describes how to generate buzz-making 360 videos and photos in 4K that will play right on your Facebook timeline or YouTube&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/hackernoon/capture-facebook-compatible-4k-360-videos-of-3d-scenes-in-your-browser-788226f2c75f?source=rss-2684ae4296d9------2">Continue reading on HackerNoon.com »</a></p></div>]]></description>
            <link>https://medium.com/hackernoon/capture-facebook-compatible-4k-360-videos-of-3d-scenes-in-your-browser-788226f2c75f?source=rss-2684ae4296d9------2</link>
            <guid isPermaLink="false">https://medium.com/p/788226f2c75f</guid>
            <category><![CDATA[360-video]]></category>
            <category><![CDATA[social-media]]></category>
            <category><![CDATA[virtual-reality]]></category>
            <category><![CDATA[youtube]]></category>
            <category><![CDATA[facebook]]></category>
            <dc:creator><![CDATA[James Pollack]]></dc:creator>
            <pubDate>Fri, 16 Dec 2016 16:06:01 GMT</pubDate>
            <atom:updated>2019-04-30T05:03:23.393Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Pretty Muni: Data Visualization in JavaScript with D3.js]]></title>
            <link>https://medium.com/@jamesbpollack/pretty-muni-data-visualization-in-javascript-with-d3-js-71773427e83d?source=rss-2684ae4296d9------2</link>
            <guid isPermaLink="false">https://medium.com/p/71773427e83d</guid>
            <category><![CDATA[design]]></category>
            <category><![CDATA[san-francisco]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[ux]]></category>
            <category><![CDATA[data-visualization]]></category>
            <dc:creator><![CDATA[James Pollack]]></dc:creator>
            <pubDate>Mon, 12 Dec 2016 18:32:27 GMT</pubDate>
            <atom:updated>2017-02-09T21:52:02.495Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yuWY-pj9LM80ckRF0hKzNg.png" /><figcaption>5 Fulton, showing inbound and outbound routes</figcaption></figure><p>https://<a href="http://www.prettymuni.com/">www.prettymuni.com</a></p><p>A web app that uses D3.js and vanilla JavaScript to display and update vehicles from the San Francisco Muni system in real-time.</p><p>New colors each refresh!</p><h3>Showing public transit vehicles in real-time</h3><p><a href="http://d3js.org/">D3.js</a> is a great open-source data visualization library from <a href="https://bost.ocks.org/mike/">Mike Bostock</a>, formerly of the New York Times.</p><p>I won’t go too deeply into code in this article, you can check that out <a href="http://www.github.com/imgntn/prettymuni">at the Pretty Muni project GitHub</a>. What I will do here is provide a line of reasoning for many of the choices that I have made, both visually and in code. My goal is to show how these considerations influence and guide each other during the process.</p><p>Additionally, I try to remain conscious of the costs of deploying and accessing the application. Serve the most people at the lowest price! This extends to the personal cost of user time, where I try to make continuous incremental improvements.</p><p>I had fun building something interesting this week, but I’m sure there’s a lot I can improve on. Please send me your suggestions and pull requests!</p><p>Enjoy the read!</p><h3>Drawing the base maps — geoJSON layering, colors, time to first interaction, map sizes</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r-3dkR7jOS_fVZycIqX4dw.png" /><figcaption>Sunday afternoon — I love the 25 on the Bay Bridge!</figcaption></figure><p>With SVG, the order of the elements on the page is the order that the elements are added to the element. If I tried to fetch all of the maps in parallel, the draw order was haphazard depending which was retrieved first. It’s pretty straightforward to reorder the actual SVG DOM nodes containing the maps using built-in methods.</p><p>The map files are in <a href="http://geojson.org/">geoJSON</a> format,but I dipped quickly into the world of <a href="https://github.com/topojson/topojson">topoJSON</a>, which promises smaller file sizes and more features. However, my early experiments actually ended up with larger file sizes in this particular case so I decided not to pursue it further at this time.</p><p>In regards to vehicle colors, Muni does provide colors for each route, but in my personal experience the colors aren’t really used for finding a vehicle — it’s much more route-name based. However, I could be wrong about that and it is hard to dell without more data. If this were a functionally-oriented application (i.e. for the actual Muni organization) I might have gone with the API provided colors.</p><p>I assigned random colors to each of the layers, which ends up being sometimes ugly but often fascinating. It’s also a great way to get people to revisit and refresh the page. It ends up looking sort of like a <a href="https://en.wikipedia.org/wiki/Fauvism">Fauvist</a> version of <a href="http://store.steampowered.com/app/287980/">Mini Metro</a>.</p><p>At first, I explored libraries for <a href="https://github.com/c0bra/color-scheme-js">procedurally generating sets of related colors</a>. The best library I found only does up to 16 colors. I enjoyed the random results enough to hold off on locking the colors down until a later version. I might stick with the randomness but tune it a little bit with <a href="http://afriggeri.github.io/RYB/">an algorithm </a>to distribute colors as far as possible from the previous colors in the set across all 80+ Muni routes. There is a section later about choices regarding route paths and colors.</p><p>Of course, with such an interesting map, users are going to want to zoom and scale. I decided to use native SVG scaling and transformations to accomplish this, instead of re-projecting each data point at every zoom level. The result is a smoother, high resolution zoom. An upgrade to passive event listeners could help, especially on mobile.</p><p>The file size of the maps is a problem. Almost 9mb for the streets.json file alone. To my great surprise, the streets geoJSON file comes over the network at only 1.2mb. <a href="http://www.gzip.org/">Gzip</a> for the win! Still pretty big, but enough savings to make the app usable at 1.9mb total for all maps.</p><p>Later, I realized that waiting for the streets base map to load shouldn’t block the user from starting with the other base maps. I made some changes so that the streets file loads separately from the other base maps. Once it has arrived, I insert its DOM node into the SVG at the correct level. The result is a much reduced time to first interaction, a better user-experience and a big win in terms of how it felt to use the app.</p><h3>Getting the vehicle data — XML, JSON, Promises</h3><p><a href="http://www.nextbus.com/xmlFeedDocs/NextBusXMLFeed.pdf">http://www.nextbus.com/xmlFeedDocs/NextBusXMLFeed.pdf</a></p><p>One utility function I didn’t hesitate to use was an XML to JSON parser. I haven’t worked with XML enough in my career to know all of its foibles, and didn’t want to run into them one at a time writing my own parser. Therefore, I leaned on the crowd and on <a href="https://https//davidwalsh.name/convert-xml-json">one clever implementation in particular</a>. I did have to update it to supress some Chrome warnings, but it was only changing one or two lines. This allowed meto parse and process the Nextbus API responses in familiar JSON format.</p><p>It didn’t take long to start to see a tangle of callbacks beginning to develop in this part of the app. So in the name of readability, I dropped in an ES6-Promises polyfill and wrapped the Nexbus API requests. Now I can easily get and use the vehicles and route configurations in my other functions without getting too verbose.</p><h3>Drawing the vehicles —adding circles, headings, colors,text, teardrops &amp; transitions</h3><p>Vehicle groups consist of these elements: circle, text, heading drop, and heading dot. Routes contain many vehicle groups. When I update data for a route, the vehicle groups are transitioned to their updated locations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/267/1*IUkfUZf5O6Srajf7fxavoA.png" /><figcaption>Early attempts.</figcaption></figure><p>I first visualized the headings as dots within the outer ring of the vehicle circle. While this was aesthetically pleasing, it didn’t translate quickly or at great distances. It was too subtle.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/344/1*VLa_QybjMPNHfCACv8tidw.png" /><figcaption>A ‘heading drop’ with a like-colored dot.</figcaption></figure><p>I didn’t want to switch to using a triangle or another hard-edged primitive to represent the bus. The circles were nice and clean. My answer was to put a teardrop shape underneath the circle — the heading drop. I moved the heading dot out further and gave it the same color as the route, which helps distinguish between overlapped vehicles.</p><h3>Route Paths — Too much color?</h3><p>I was conflicted about whether to add route paths — everything looked really busy already with the streets, colors and vehicles. Maybe it would be too much. I had to see for myself, so I coded up a couple of methods do add route paths to the map when a user chooses a route in the selector.</p><p>At first glance, my suspicions seemed confirmed. There is a lot going on. But the more I used the app with paths and showed it to friends, the more I realized that they do communicate a lot about what is going on. Taking a little bit of opacity off of the streets map helped but destroyed the frame rate and made everything sluggish. Perhaps there is a compromise — I like the look of the route paths with the streets turned off. A monochrome palette for the entire set of base maps could calm things down too. I tried black, white, and grey streets, which all worked depending on the colors of the neighborhoods. Yet there is a certain delight in some of the weird combinations that the random selection uncovers. And refreshing is easy.</p><p>I’m torn. For now, color roulette, until I get more feedback :)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4M7vBZVdj3No8jaOTfmPFw.png" /><figcaption>Route paths are really great, as long as the colors work out.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/771/1*aPsh2QoG7rsawbnDqsSJXg.png" /><figcaption>Route paths without the individual streets base map look cleaner.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/669/1*NcRrJ_Ehq81b2cKPqWiYlQ.png" /><figcaption>All the route paths look great the with some opacity on the maps — however, performance is an issue.</figcaption></figure><h3>Creating the route selector — first, see what’s out there. But sometimes you’ve got to roll your own</h3><p>The native HTML5 &lt;select multiple&gt; element is a mess. On the desktop you need to press control or command and click to make your selections. The Rolodex-style spinner given to users on mobile by iOS Safari is better, but not by much. Either way, the styles involved can be difficult to write or completely out of your control.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Vs00LsTkdPT0QN9bNDRENQ.png" /><figcaption>This is brutal.</figcaption></figure><p>To sidestep these issues and avoid maintaining separate codepaths, I decided that this might be a good place to use a library. I’m a fan of <a href="https://material.google.com/">Material Design </a>and have successfully used the <a href="http://materializecss.com/">Materialize</a> library on previous projects. So I decided to give it a try here. While adding a dependency on jQuery just for this made me cringe, the stylistic advantage of a &lt;select multiple&gt; that renders as a dropdown with checkboxes was surely worth a few extra kilobytes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0yMOV5w41_6zYwfzDJ0eRg.png" /><figcaption>Materialize was looking good… until I tried mobile.</figcaption></figure><p>This looked better. Everything was hunky dory until I tried it on mobile. Then I ran into a nasty Materialize <a href="https://github.com/Dogfalo/materialize/issues/3501">bug</a> — multiple selects cannot be closed on mobile after they are opened. This is a non-starter. I toyed with the idea of using the browser-default on mobile and the Materialize version on desktop, but that would mean feature detection and maintaining different code paths. With all of that, for little gain, I decided it was time to scrap Materialize and the &lt;select multiple&gt; element altogether.</p><p>What I ended up creating is a much more flexible, faster route selector that requires less scrolling and looks the same everywhere. It also provided an opportunity to use the route colors to make a connection between what the users chooses and what the user sees. Larger screens have room for the full route names. The controls are fast, even on mobile.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xFe4O_qu4V1DHIOqbE44vQ.png" /><figcaption>Pick a route, any route</figcaption></figure><p>Bonus: I was able to remove jQuery and Materialize from my project.</p><h3>Interfaces — GUI glue, responsive CSS styles, loaders, saving, sharing</h3><p>I wrote some standard JavaScript code to handle creating the user interface elements and binding input events to them. This app is straightforward enough that using an MVC framework like Angular or React really seemed like overkill. Not to mention the likelihood of integration issues with the chosen framework and D3. The native DOM methods are actually pretty useful, if verbose, and you usually know what you’re going to get. I even made the close button sticky without too much fuss :)</p><p>Since the maps loaded are fairly large, here’s inevitably a bit of initial user wait time. I chose to use a simple, CSS-based loader that is hidden once the maps are drawn. I’d like to upgrade this stylistically to be in line with the rest of the app. Speaking of styles, I enjoyed writing the CSS for the app. A couple of simple media queries really helped alleviate the mobile vs. desktop differences I could surface in my somewhat limited testing.</p><p>Saving an SVG to an image is a bit of a kludge. I did some research and found a function that mostly works, although in the end it is missing some styles that are applied to the entire page and not at the SVG level. I’m going to work on that feature a little bit more before I deploy it.</p><p>For sharing, I defined Facebook and Twitter compatible metatags, as well as some Slack-style pull-through tags for really fancy sharers. I flirted with the idea of buttons, but didn’t want to disrupt the visual flow, and there are already a lot of built in ways to share links.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/911/1*fkNqoei3F3qSB7y7UYSzjw.png" /><figcaption>Share if you like it!</figcaption></figure><h3>Get real —Cross-browser compatibility, performance</h3><p>Cross-browser and cross-device testing is an essential but sometimes painful process. It quickly becomes race to apply a patch here, a shim there. What’s a dev to do?</p><p>Try to put your time developing for where users are likely to come from. This requires knowing your starting user base, as well as paying close attention to your analytics. Spend some time looking at <a href="http://gs.statcounter.com/">different reports</a> of <a href="http://www.w3schools.com/browsers/default.asp">browser statistics</a> and compare them to the reality at your organization.</p><p>If you have to guess, here are some general observations: Currently on desktop, Chrome is crushing it, with a large spread separating it from Firefox and Internet Explorer. The top 3 browsers on mobile at time of writing have a closer spread — Chrome, Safari, and the Alibaba’s <a href="https://en.wikipedia.org/wiki/UC_Browser">UC_Browser</a>.</p><p>These decisions come down to resources and reach. The more you have, the can do. Apportion wisely. As far as what I was able to test with Pretty Muni:</p><p>On desktop Chrome, things work the best.</p><p>On desktop Firefox, things work after a quick to update my XML parser to use .value instead of .nodeValue, but my heading drops are ending up rotated in strange places.</p><p>On desktop Microsoft Edge, zoom scrolling results in wild scaling of the base maps. Rendering bugs about and performance suffers. I can’t imagine that older Internet Explorer versions must be doing any better :/</p><p>Some mobile testing in Chrome led me to the look into the new <a href="https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md">Passive Event listener API</a>, which I tried to shim into the current version of D3.js, but ran into some errors that forced me to back off for the moment. The feature might be worth spending some time getting working correctly in order to avoid hiccups during the processing of initial geoJSON maps and achieve really great performance.</p><p>The largest performance increase would probably be reducing the number of SVG elements that are being drawn and observed. I’ve already filtered out vehicles that haven’t moved and headings that haven’t changed from their respective animations.</p><h3>Deployment— https, GitHub pages, mixed-content, proxying apis, node.js heroku, DNS w/ cloudflare</h3><p>My first approach was to serve the app completely from the client side using a service like GitHub pages or Amazon S3. But when I pushed to GitHub pages, I was greeted with a blank screen and a console full of mixed-content errors. How come?</p><p>You can’t use http:// assets on a site served over https://</p><p>Simple as that. Production ready code should be served securely. Therefore, the requests to the Nextbus service over http:// were conflicting with the browser’s internal safety barometer.</p><p>Nextbus isn’t likely to change their API before I need to deploy (although if they do add https:// the whole internet might do a cartwheel). Therefore, I’ve got to figure out a way to secure my request.</p><p>Fortunately, writing a proxy in node.js is a matter of just a couple of lines. The server takes requests to Nextbus and passes them along. To be fair, this proxy server is a bottleneck. It ads an additional server step to an app that is otherwise completely client-side. It also makes it look to Nextbus like there are an awful lot of requests coming from the IP address that belongs to the app. So far they don’t seem to be throttlers, but we’ll see. After pointing the Nextbus urls in my app at the proxy, the page proceeded to load as expected.</p><p>I tried deploying the app on my own static server on Heroku using Express, but worried about co-locating the proxy and the app — too much traffic and the whole thing would go down. Better to keep them separate. I don’t have an AWS account setup right now, otherwise I might have just put everything in an S3 bucket. Besides, why pay for all that bandwidth</p><p>I’m an avid GitHub user and eventually I came back around to GitHub pages. I had to name my distribution folder ‘docs’, but I was happy to deal with a little awkwardness in exchange for free hosting. (I’ll try to fix that at some point with a deploy task, likely written in gulp.). Now the app and the proxy server for requests are separate, and I’m not paying for hosting the client-side assets. Woohoo!</p><p>I used Google Domains to purchase the <a href="http://www.prettymuni.com/">www.prettymuni.com</a> domain name, but decided to try CloudFlare as my DNS provider because they offer more routing options and features. I set the A records at Cloudflare to point at GitHub’s Pages servers. The final step in securing the site was adding page rewrite rules at Cloudflare to turn all http:// requests into https:// requests.</p><p>Why does any of this matter? In addition to actually wanting the content to appear everywhere without mixed content warnings, security now weighs into the SEO rankings of many search engines.</p><p>Some quick delivery statistics vis-à-vis bandwidth:</p><ul><li>107kb JavaScript files</li><li>2kb CSS</li><li>11kb Fonts</li><li>1.9mb JSON to fetch all maps</li><li>route fetches are 1.1kb per route from NextBus</li><li>~83kb to get all routes at once</li></ul><h3>Conclusion</h3><p>A lot can be improved in terms of performance and I have plenty of ideas for additional features — generative sound, anyone? Really though, I’d be happy to just figure out those pesky heading drop rotations.</p><p>But that’s all for now!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=71773427e83d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>