<?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 Bradley Dettmer on Medium]]></title>
        <description><![CDATA[Stories by Bradley Dettmer on Medium]]></description>
        <link>https://medium.com/@bdettmer?source=rss-29ccd06fb92c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Ua5bZRfYDEKUEKkuYaFmkw.jpeg</url>
            <title>Stories by Bradley Dettmer on Medium</title>
            <link>https://medium.com/@bdettmer?source=rss-29ccd06fb92c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 00:59:21 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@bdettmer/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[A Month in Japan: A Last Minute, Back Roads, Non-Binary Perspective]]></title>
            <link>https://medium.com/@bdettmer/a-month-in-japan-a-last-minute-back-roads-non-binary-perspective-11b1b3cbf760?source=rss-29ccd06fb92c------2</link>
            <guid isPermaLink="false">https://medium.com/p/11b1b3cbf760</guid>
            <category><![CDATA[shimanami-kaido]]></category>
            <category><![CDATA[japan]]></category>
            <category><![CDATA[tokyo]]></category>
            <category><![CDATA[japanese]]></category>
            <category><![CDATA[kumano-kodo]]></category>
            <dc:creator><![CDATA[Bradley Dettmer]]></dc:creator>
            <pubDate>Mon, 15 Sep 2025 01:48:19 GMT</pubDate>
            <atom:updated>2025-12-10T06:48:40.879Z</atom:updated>
            <content:encoded><![CDATA[<h3>A Month in Japan: A Last Minute, Back Roads, Non-Binary Adventure</h3><p>In early August, I had a ton of commitments lined up including cat sitting, pair programming sessions, movie nights, dates, hang outs, travel to upstate Vermont and the Catskills, helping a friend recover from surgery and welcoming a new roommate to my NYC apartment. Then, I got a job offer for a role that started in just over a month. That evening, I managed to move around all of my commitments so I could spend a month in Japan. Thirty-six hours later I was on a flight to Japan.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pC3rFe7kryf7oRUcNAvHMA.jpeg" /><figcaption>A picture of me at Yunomine natural hot spring on the Nakahechi route of the Kumano Kodo trail, a UNESCO World Heritage Site and my inspiration for the trip</figcaption></figure><p>The purpose of this blog post is to share what I did while I was in Japan and how I managed my trip, in hopes of inspiring travelers. This post also shares ideas and tools for exploring Japan. I wrote this blog post to answer the question, “what did you do in Japan”, and to have memories to look back on fondly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*giOriDqxTYHelqhm1p_wAA.jpeg" /><figcaption>Street art in Nara</figcaption></figure><p>Unfortunately, some parts of my time in Japan were challenging, so please consider this your blanket content warning and stop reading now if you are faint of heart.</p><h3>Travel Style</h3><p>My style of travel for the trip was improvised. Mostly, I booked lodging (using Agoda, Booking and Klook) and figured out where I was going to stay each night 0–3 days in advance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6GMDdYEU-FF1xibEhPSfAg.jpeg" /><figcaption>A bullet train in Nagoya</figcaption></figure><p>The stays on the Kumano Kodo trail, Shimanami bike route, my return flight, the homestay and the Japanese language immersion were booked 1–4 weeks in advance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oaTj-t6IU0sGa6Q73S9bMg.png" /><figcaption>Ryokan in Kinosaki</figcaption></figure><p>Because my travel dates were open, I was able to find relatively good deals on lodging and transportation. Sometimes it meant I stayed at a different place every night for 7 nights in a row.</p><h3>Tokyo — start and end</h3><p>When I first arrived I felt overwhelmed by the sheer amount of people and seeming lack of personal space, I puked at the turnstile when I got off the Sky Liner train in Tokyo. The attendant stared at me as a small amount of clear vomit fell onto my sweatshirt. Luckily, the first hotel I stayed at had a washer and dryer in unit. The bathroom itself was the dryer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w2umksIekloKqjRogQwbDw.png" /><figcaption>Bathroom dryer on left with hot air vent above clothes rack and my sweatshirt drying</figcaption></figure><p>Tokyo was the start and end point of my trip because it had the easiest airports to fly in and out of. These were some of my favorite spots in Tokyo:</p><ul><li><strong>Akihabara Shosen Book Tower</strong> — Ten floors of books including some queer manga and a whole floor about trains</li><li><strong>Takeshita Street</strong> — Interesting fashion and sweets</li><li><strong>Shibuya Scramble Crossing</strong> — Considered the world’s busiest intersection</li><li><strong>Meiji Jingu + Inner Garden</strong> — A shrine surrounded by a forest, and a tranquil garden</li><li><strong>Nihonbashi Kaisen-don Tsujihan</strong> — Seafood restaurant</li><li><strong>Udon Shin</strong> — Noodle restaurant</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hOg9JvUSBmqfg0DTbsa_GA.png" /><figcaption><a href="https://www.meijijingu.or.jp/en/whattosee/garden/">Meiji Jingu Garden</a></figcaption></figure><h3>Yoga across Japan</h3><p>I joined a yoga studio in Japan and attended classes in many of the cities I visited. I later found out by looking at reviews that other westerners who attempted to join were denied entry to the classes. I think I just got lucky and was persistent. The first yoga studio I attempted to visit turned me away, but the second one gave me a membership after some discussion. Once I had my membership card, I was able to attend classes all over the country.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8sYDmRMRm5Y8u4Aq37WM4w.png" /><figcaption>Yoga studio in Hiroshima with line forming on the left side</figcaption></figure><p>Yoga was interesting because I was the only westerner in class, could sometimes touch the ceiling, and didn’t understand everything that was being said.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*USDml5pZnmzwAMFUd4wWFQ.jpeg" /><figcaption>Kamo river in Kyoto</figcaption></figure><p>At first I understood about 5% of what was being said, but after I took a Japanese immersion class I could understand or recognize 20% of what was being said in later yoga classes. I later learned the yoga instructors commonly pushed fat phobia and supplements during class, so I am happy I did not understand that part.</p><h3>Onsen Adventures</h3><p>As a non-binary person whose gender is interpreted differently depending on the viewer, at each onsen I followed the instructions of the staff and went to the side they told me to go to. Using the onsen I was told to use, I felt safe on both the men’s and women’s sides.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Whtg6_Xr3f2Bi6_svXjiUg.png" /><figcaption>Private onsen at Mikuniya Ryokan</figcaption></figure><p>The men’s side of onsens seemed more relaxed like everyone was in their own world. The women’s side of onsens felt more social and there was more focus on group bathing and hair drying. I noticed on the men’s side, men would sit near me, while on the women’s side they tended to move away once I sat down.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FgbJiCiKIKyA%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DgbJiCiKIKyA&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FgbJiCiKIKyA%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/8bca1ba41249373480197eb8853b1e36/href">https://medium.com/media/8bca1ba41249373480197eb8853b1e36/href</a></iframe><p>I went to about 30 different onsens during my month in Japan, including private ones. My favorite onsens were:</p><ul><li><strong>SpaWorld Osaka</strong> — Because there were so many baths to choose from and some even had giant tea bags with herbs in the water</li><li><strong>Goshono-Yu in Kinosaki</strong> — Because it was open air with a view of a waterfall</li><li><strong>Shimanami Dome onsen</strong> — Because of the ocean view</li></ul><h3>Suikawari and Cooking in Osaka</h3><p>In Osaka I stayed at Cocoroom, where everyone can participate in cooking a family style lunch and dinner.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IyltMTwiqLz9TsqWrac0ww.png" /><figcaption>Roof of Kamagasaki University Of The Arts Cafe Garden Guest House Aka Cocoroom</figcaption></figure><p>Making dinner and eating it together was my favorite. I also went to SpaWorld and attended a Suikawari (Japan’s traditional watermelon splitting) at a summer festival in Haginochaya Kamagasaki Triangle Park.</p><h3>Breakfast with the deer in Nara</h3><p>Nara is a town where deer roam freely throughout town and in the nearby forest.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_bI8lB7dpFMkw6nCfr3kcg.png" /><figcaption>Deer near Kasuga-taisha Shrine</figcaption></figure><p>In Nara, I grabbed dinner with a guy from Germany who showed me pictures of a 6 month hike he had just completed from the North to the South of New Zealand, “Te Araroa — The Long Pathway”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k0mprSUAh0_dxbx_wDhLnA.jpeg" /><figcaption>Plant life in Kasugayama Primeval Forest</figcaption></figure><p>I felt inspired, and woke up at 5am the next morning to hike in the Kasugayama Primeval Forest.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8fT0asGnrmWlwaDsxJ-2Kg.jpeg" /><figcaption>Statues in Kasugayama Primeval Forest</figcaption></figure><p>The following morning, I was pleasantly surprised when I went outside my hostel to eat my breakfast and some deer were having their breakfast across the street.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F0dOyEasWMe0%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D0dOyEasWMe0&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F0dOyEasWMe0%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/2f9d7db8073c6876d48f4a10eebbc88f/href">https://medium.com/media/2f9d7db8073c6876d48f4a10eebbc88f/href</a></iframe><p>The town of Nara is known for their deer and has everything from deer stuffies to deer ice cream and deer cookies.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*usdDGSOsZ4WkJBlReTKd3A.png" /><figcaption>Deer stuffed animals for sale in Nara</figcaption></figure><p>I liked Nara, but it felt a lot like a tourist town for me, and I was craving more remote nature.</p><h3>Hiking the Kumano Kodo</h3><p>Nestled in the middle of a national park, the Kumano Kodo was my inspiration for visiting Japan. I had learned about the trail while <a href="https://medium.com/@bdettmer/solo-hiking-hadrians-wall-in-6-days-an-ultralight-minimalist-perspective-b95cc62eba5d">hiking Hadrian’s Wall the previous summer</a> and knew I wanted to hike it as well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VuBkZFeqHyBbYb0OmKVA4A.png" /><figcaption>Trail marker on the Nakaherchi route of the Kumano Kodo</figcaption></figure><p>I hiked a portion of the Nakahechi Route, the core trail of the Kumano Kodo pilgrimage network. The Nakahechi route is a beautiful hiking trail in the Yoshino-Kumano National Park with a history of over 1000 years.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FVYF1V4ssoEE%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DVYF1V4ssoEE&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FVYF1V4ssoEE%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/651854b62ee66d0391f20a99ee753f69/href">https://medium.com/media/651854b62ee66d0391f20a99ee753f69/href</a></iframe><p>The trail I went on was magical and strenuous, there was even a portion that had a rainbow above a creek. On the trail, I passed through rural villages, forest areas and religious temples.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qp2TfoySjMbqVnI-iGBxNg.jpeg" /><figcaption>Enjoying the Nakahechi trail</figcaption></figure><p>I hiked 14 miles with 3000 feet elevation gain. I was so happy to be on the trail because I had been looking forward to it for over a year. The trail goes by the Yunomine Onsen, which is a natural hot spring where you can boil eggs using geothermal heating.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F0d6ASGcPCBc%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D0d6ASGcPCBc&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F0d6ASGcPCBc%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/0957eb4615583bccb488bbac6cc9a7fc/href">https://medium.com/media/0957eb4615583bccb488bbac6cc9a7fc/href</a></iframe><p>It was near sundown when I finally got to my hostel. I only stayed one night at my hostel because I discovered about 6 bugs around my bed that were biting me. It was close to 3am when I discovered them so I left the room, and went to a private onsen waiting for the sun to come up. Then, I put all of my clothes in the dryer for 75 minutes on high heat to kill potential bugs and their eggs, and got rid of my backpack in case the bugs had gotten on it. The hostel staff gave me access to the dryer, a full cash refund as well as plastic bags to put all of my belongings in. Luckily, I travel light.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*asTjxU5EJYkpS_N-e_HywQ.png" /><figcaption>All of my belongings in plastic bags at Yunomine onsen bus stop</figcaption></figure><p>Since I had gotten rid of my backpack, all of my belongings were in 3 plastic bags, and I traveled with them for 8 hours in search of a new backpack. After arriving to an outdoor goods store that was closed (contrary to Google maps) I found another store that had backpacks that were too small for me (I am tall). After the bags had started ripping, I finally arrived to a third store and purchased a new backpack.</p><h3>Kyoto — comfortable home base</h3><p>When I got to Kyoto my bug bites had started to swell; my body was having an allergic reaction to them. They were painful, with blisters and some with puss, and it was hard to move without feeling the pain.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2ZN2i0aaSyPtXVZWR9ML-A.jpeg" /><figcaption>Front door of Sakabe International Clinic in Kyoto</figcaption></figure><p>I went to see a doctor at the Sakabe International Clinic in Kyoto, and he gave me 4 different medicines including a super potent steroid (difluprednate) that is banned for bug bite relief in the United States because it is too strong and can cause birth defects.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EuoDHFoNjbGjWQd7OByIDg.png" /><figcaption>Kiyomizu-dera</figcaption></figure><p>Swarming with tourists, Kyoto became my comfortable home base because it had the conveniences of a city (including English speaking doctors) and lower prices on lodging and meals.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jQwH6fCr5Dzoriji4ffdWg.png" /><figcaption>Bamboo forest</figcaption></figure><p>After about a day of mostly resting, the swelling had gone down enough to leave the hotel. I decided to visit the bamboo forrest because I really love nature.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*00tk6MGd58LHfdbcGJpvdQ.jpeg" /><figcaption>Mukojima-Hyakkaen Gardens 向島百花園</figcaption></figure><p>I also visited Kiyomizu-dera and Shimokawaracho while I was in Kyoto. Kyoto was beautifully breathtaking, but it did not give me the back roads feel I was craving.</p><h3>Kinosaki + Genbudo Basalt Caves</h3><p>Someone I met at the Cocoroom hostel back in Osaka said Kinosaki was her favorite place in all of Japan so I had booked two nights there. Kinosaki is a cute onsen town where all public onsens are tattoo friendly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IikYWqUF2KS_w18O4cjhQw.jpeg" /><figcaption>View from the center of town</figcaption></figure><p>It has a tourist feel to it and the ryokan staff help visitors put on yukatas and wooden sandals. So in the evenings you can hear the tourists walking on the cobblestone with the wooden sandals.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m93kv7MmGdBFAkhSaA8Usg.jpeg" /><figcaption>View from the top of a moutain in Kinosaki</figcaption></figure><p>I rented a bike, and rode to nearby Genbudo caves formed 1.6 million years ago. The columns with honeycomb patterns were formed by volcanic activity.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FT9c4Kmf7u_GZQN27jmHXA.jpeg" /><figcaption>Genbudo Park</figcaption></figure><p>Kinosaki has seven different public onsens, so in the evenings I put on the yukata the ryokan gave me and went onsen hopping.</p><h3>Cycling the Shimanami Kaido</h3><p>A couple of my friends had biked the Shimanami Kaido and told me it was incredible, so I decided to bike it too. After staying a night in Onomichi, I began a 70 km bike ride across 6 islands to Imabari. I accidentally biked all the way around the first island when I started, so for me it was probably about a 80 km ride.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z5Ro3K18w4URG5QE8kZybw.png" /><figcaption>Shimanami bike trail</figcaption></figure><p>I used Shimanami Bike Rental, which allowed me to pick up the bike in Onomichi and drop it off in Imabari. I stayed for a night on Omishima Island.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3K5VU0Y4BG78stvVbpr8Ig.png" /><figcaption>View from Omishima Island</figcaption></figure><p>The staff where I was staying was generous with their time. They helped me find a way to get from Imabari to Rabbit Island in about 2 hours even though Google Maps provided a different route and said it would take over a day.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nzq3-GRkdz29pHSqe846pg.jpeg" /><figcaption>Shimanami bike route</figcaption></figure><p>I used a local bus that was not on Google Maps and learned some Kanji in order to recognize the right bus to take. Then, I took the ferry directly from Omishima to Ōkunoshima.</p><h3>Rabbit Island (Ōkunoshima)</h3><p>Ōkunoshima island is an island full of bunnies. There are no predators, so they are very friendly. Bunnies outnumber the humans.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6wZx7Q70D1it46CIBUYDUg.png" /><figcaption>Bunnies on Ōkunoshima Island</figcaption></figure><p>I stayed there for a night, and walked around the island in the morning. It’s 4.3 km in circumference and bunnies sporadically ran up to me the whole way.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FKQC9L5Y-S4c%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fshorts%2FKQC9L5Y-S4c&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FKQC9L5Y-S4c%2Fhq2.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/28e990bddf06c47a11a499f45979e678/href">https://medium.com/media/28e990bddf06c47a11a499f45979e678/href</a></iframe><p>Before I left, I visited the Poison Gas Museum, which was sad because I learned the workers became devastatingly injured by the gasses they were working with during World War II.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6GhqFWAcY_S1FA7pYIm4rA.jpeg" /><figcaption>Bunny in front of poison gas factory from World War II</figcaption></figure><p>Feeling like my heart was heavy from hearing about the gas workers on Rabbit island, I was ready to leave. Next, I went to Hiroshima.</p><h3>Hiroshima — Symbol of Peace</h3><p>I visited the Atomic Bomb Dome, the Hiroshima Peace Memorial Museum, and the Hachidori-sha Social Book Cafe.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sXBZ9fCUFkWRGEHuYUDTgw.png" /><figcaption>Student Memorial Tower</figcaption></figure><p>I attended a talk by the daughter of an a-bomb survivor who described what happened to her mom and had a strong message for nuclear disarmament and peace.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0stjSTPdJevj08ZUlz52Yg.png" /><figcaption>Child’s tricycle that survived the bomb (the kid did not)</figcaption></figure><p>Hiroshima felt like a new city. To me, it felt like the history had been blown away by the bomb, which is one way to look it at it, but what really stood out to me was how dedicated to peace the locals I met were.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2OdE10JFEnCPWgClil1gEQ.png" /><figcaption>Vigil for Palestine in front of the Atomic Bomb Dome, the only surviving building from the bombing. This man agreed to let me take his picture and told me he has been coming out to support Palestine every Friday and Saturday for the last year.</figcaption></figure><p>Hiroshima and Honolulu are sister cities with cultural exchange because of their shared history. There was a Hawaiian dance event at a farmer’s market. Hiroshima is a symbol of peace.</p><h3>Homestay</h3><p>The homestay and the language classes were my top two favorite parts of Japan. I felt lucky that a nice family welcomed me into their home.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ioq59zDJB2BTFqypiG3kUA.png" /><figcaption>Shopping for Winter Melon</figcaption></figure><p>My favorite was when they corrected my Japanese pronunciation.</p><p>I got to stay with a generous family that included me in everything, from boxing to karaoke, cooking and dessert making. We even went second hand shopping and visited the world’s (now second) longest suspension bridge together.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FdmDXp8g_4GM%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fshorts%2FdmDXp8g_4GM&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FdmDXp8g_4GM%2Fhq2.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/190e815a5694d48ed5753e82fa45729f/href">https://medium.com/media/190e815a5694d48ed5753e82fa45729f/href</a></iframe><p>I learned how to make Oyakodon, which is a comfort meal that translates to “parent and child” rice bowl. They also taught me some Kanji so I would know the right bus to take to get to school. I really appreciate how much they helped me with my language skills and how patient they were with me with everything.</p><h3>Language Classes</h3><p>Before arriving in Japan I had studied Japanese part time for 3 months at Hills Learning in NYC, so I was familiar with some basic phrases, concepts and some of the Hiragana alphabet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1F1Yepn-bRhDLVGsu940uA.png" /><figcaption>Akashi train station, near where I studied for a week</figcaption></figure><p>Upon arrival to Japan I searched for immersive Japanese classes and reached out to about 7 different schools. I would highly recommend booking language classes at least a month in advance because I had a hard time finding a school that would accept me with such short notice.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7QO-wuYqZjGCk58YCIT3XQ.png" /><figcaption>Registering for classes at local life Japan</figcaption></figure><p>Luckily, I was accepted at Local Life Japan for a week of intensive Japanese. I used the Wise app to pay for the classes weeks in advance and I used the Line app to communicate with the school.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FizmsgRPMjPc%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fshorts%2FizmsgRPMjPc&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FizmsgRPMjPc%2Fhq2.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/f173264c8440513d3d5e4cc9fb90c432/href">https://medium.com/media/f173264c8440513d3d5e4cc9fb90c432/href</a></iframe><p>Local Life Japan is in a lesser known city called Akashi with almost no tourists, and less than 10 minutes from the Akashi park and castle.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qLSISMwCskuaCj4J3dqscw.jpeg" /><figcaption>Akashi castle</figcaption></figure><p>The teachers at Local Life Japan are incredibly amazing and talented. Japan has a high bar for teachers, so I felt lucky for every moment I got to spend with them. They were skilled at their craft and also very thoughtful. Lessons were interactive and engaging and I loved every minute of the instruction.</p><h3>Hiking in Kobe + Dog bite</h3><p>One day after school I went hiking in Kobe.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wd5d3mBQaq_Gt3R0ohztLA.jpeg" /><figcaption>Behind Kobe station</figcaption></figure><p>I also got bit by a dog. I got prompt medical care in Japan, and also went to urgent care when I got back to Brooklyn to have them look at the bite. The urgent care doctor in Brooklyn was quite alarmist and did not do any research on Japan. He said I needed to go straight to the ER to get immunoglobulin shots as quickly as possible to prevent potentially dying from rabies. He said it would be very painful, but that I would later thank him for saving my life. When I got to the ER, I sat there for hours, waiting to see a doctor, and worrying I might have rabies. I did not sleep that night.</p><p>When I finally got to see the ER doctor the next morning, they did some research and told me there was zero chance I had rabies, in part because Japan has been rabies free for decades. My friend who is a vet and another friend who is a doctor agreed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*grub-horH1BqkPIFCiFx7w.jpeg" /><figcaption>Nunobiki waterfall</figcaption></figure><p>I learned that health care in Japan is in many ways better than the United States, and it’s more affordable. I also learned that people in Japan live way longer than people in the United States, probably because they worry less.</p><h3>Phrases</h3><p>Some favorite phrases in Japanese include:</p><ul><li><strong>matane (またね)</strong> — meaning “see you soon”</li><li><strong>tadaima (ただいま)</strong> — meaning “I’m home!” or “I’m back!”</li><li><strong>chotto (ちょっと)</strong> — meaning “a little” or “a bit,” or “wait a sec”</li><li><strong>oishii (おいしい/美味しい)</strong> — primarily means “delicious” or “tasty”</li><li><strong>sugoi (すごい)</strong> — meaning “amazing,” “wonderful,” or “awesome”</li></ul><h3>Apps</h3><p>These were some of the apps I used while in Japan:</p><ul><li><strong>Wise</strong> — for paying school and homestay</li><li><strong>Line</strong> — for communicating with school and homestay</li><li><strong>Booking / Agoda / Klook</strong> — for booking lodging</li><li><strong>TripAdvisor / Klook / Claude / DuckDuckGo</strong> — for finding fun things to do</li><li><strong>Go Taxi</strong> — taxi rides</li><li><strong>Claude / ChatGPT / Gemini</strong> — AI assistants</li><li><strong>Google Translate</strong> — for reading signs and communicating</li><li><strong>Viber</strong> — to make calls to landlines back to the US</li><li><strong>Google Maps</strong> — navigation</li><li><strong>Messenger, Signal, WhatsApp</strong> — to message friends back home and to get travel ideas</li><li><strong>Calculator app</strong> — for price conversions</li><li><strong>MARU</strong> — to learn Hiragana and Katakana, and to help recognize signs and read</li></ul><p>Instead of using the Suica app, I added a Suica card to my Apple wallet for transit, vending machine and convenience store purchases.</p><p>Google flights helped me find a return flight, but I found cheaper flights by searching connecting flights instead of relying on it to find the optimal full path.</p><h3>Medical</h3><p>International health care clinics with English speaking doctors are available. For example, Tokyo Station International is open 7 days a week from 9am to 9pm. Intake forms also include non-binary options.</p><h3>Next Trip</h3><p>Some places I never got to visit include the hot springs in Beppu, the Godzilla Head and Omoide Yokocho in Tokyo.</p><p>The Ghibli Museum (which can be nearly impossible to get a ticket to) and TeamLab Borderless are of interest.</p><p>I also want to do another immersive language class, preferably with Local Life Japan. Next time I go I might purchase a JR pass before I go.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=11b1b3cbf760" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My Winter at the Recurse Center — Return Statement]]></title>
            <link>https://medium.com/@bdettmer/my-winter-at-the-recurse-center-return-statement-adf705e71a03?source=rss-29ccd06fb92c------2</link>
            <guid isPermaLink="false">https://medium.com/p/adf705e71a03</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[led-display-board]]></category>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[learning]]></category>
            <category><![CDATA[recurse-center]]></category>
            <dc:creator><![CDATA[Bradley Dettmer]]></dc:creator>
            <pubDate>Fri, 04 Apr 2025 01:32:04 GMT</pubDate>
            <atom:updated>2025-08-20T10:30:12.674Z</atom:updated>
            <content:encoded><![CDATA[<h3>My Winter at the Recurse Center — Return Statement</h3><h3>TL;DR</h3><p>This winter, I spent three months at the <a href="https://www.recurse.com/">Recurse Center</a> (RC), where I gave 6 technical presentations, led 2 events, showcased apps in 2 demo days, built 6+ games, contributed code to 26+ repositories, coded in 11+ different programming languages, and held 100+ pairing sessions.</p><p>The projects I’m most proud of are <a href="https://github.com/redSlug/tiles">Tiles</a>, <a href="https://github.com/redSlug/yoga-with-friends?tab=readme-ov-file">Yoga with Friends</a> and <a href="https://github.com/redSlug/hot_takes">Hot Takes</a>.</p><h3>The Long Version</h3><p>Recursers often write a <a href="https://www.google.com/search?q=recurse+center+return+statement">return statement</a> to encapsulate their experience, and this is mine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*J-76R5QOL9LQ9KcR" /><figcaption>The first Saturday of my batch it snowed in Brooklyn and I drew some hearts in the snow</figcaption></figure><p>I joined RC for three months with the goals of rediscovering my love for programming, strengthening my frontend skills, and asking better questions. I also wanted to pair with others and help them accomplish their goals.</p><h3>Presentations</h3><p>During my time at RC, I developed a ton of fun things and made some friends along the way. I delivered technical presentations on apps I created including Tiles, Japanese Learning Resource, Hot Takes, Yoga with Friends, and Lite-Brite.</p><h3>Building and Sharing Projects</h3><h3>Tiles: A Multiplayer Azul-Inspired Game</h3><p>Last winter, a friend introduced me to Azul, a meditative board game. I built the Tiles app based on Azul because I find the game soothing, and I wanted to enhance my frontend capabilities.</p><p>I implemented Tiles using <a href="https://peerjs.com/">PeerJS</a> / <a href="https://webrtc.org/">WebRTC</a> after <a href="https://github.com/cranberrymuffin">someone in the kitchen at RC</a> mentioned it could allow peers to play with each other from anywhere in the world without a backend server. I later learned the PeerJS library has a default backend server that enables initial connections over web sockets, facilitating shared data over WebRTC. I also learned that some local networks do not allow peer to peer connections and that a <a href="https://webrtc.org/getting-started/turn-server">TURN</a> server could be used as a fallback.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/744/0*U3apD7EQ4JFfAXIi" /></figure><p>The result is a <a href="https://redslug.github.io/tiles/">“serverless” app that you can play with anyone locally, remotely, and also against a bot</a>.</p><h3>Hot Takes: A Collaborative Game Project</h3><p>After I completed my MVP of the tiles game, <a href="https://github.com/jbacheldor">Jess Bacheldor</a> shared the idea of developing a Hot Takes game together. She described how <a href="https://www.youtube.com/@SubwayTakes">Kareem Rahma was asking people to share their hot takes on the subway</a> and how we could make a game that was similar. The concept seemed exciting, and Jess had beautiful designs for it. We decided that through collaboration she could strengthen her backend skills while I enhanced my frontend skills. We both were eager to try NextJS and explore Supabase and Vercel after seeing <a href="https://gracekwak.me/">Grace’s</a> impressive app demo using this stack.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*w7TX-_vqaPMmkscy" /></figure><p>After we built and deployed it, the Hot Takes game was a big hit. We demoed it in front of a crowd of about 50 people, and ~40 participated by sharing their hot takes.</p><h3>Yoga with Friends: Solving a Real-World Problem</h3><p>Midway through my batch at RC, I became so engrossed in programming that I started skipping my yoga classes, incurring late cancellation fees and even a no show fee. I was too busy to add the classes I registered for to my personal calendar. I desired my yoga classes to appear automatically on my calendar and on an LED display twelve hours before class, so I <a href="https://github.com/redSlug/yoga-with-friends">wrote code to accomplish this</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*KFjlOvlIoA4_4zcl" /><figcaption>An LED display indicating the time of my next yoga class</figcaption></figure><p>The initial version I developed searched through all my emails and added events directly to my calendar. Realizing this wasn’t secure or scalable (as it required individuals to grant read access to email and write access to calendars), I sought a better approach.</p><p>I ran into <a href="https://hachyderm.io/@colin_rafferty">Colin</a> in the kitchen who happened to engineer the <a href="https://citibikenyc.com/">software that runs on CitiBike</a> (but that’s another story), and together, over lunch we came up with the idea to have yoga related emails forwarded to a separate email address and published to a calendar in a bucket, eliminating the need for account sharing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*eQjqCoWfkGHje3AK" /><figcaption>Application diagram of Yoga with Friends</figcaption></figure><p>The solution was an <a href="https://redslug.github.io/yoga-with-friends/">app that I use with my friends in order to attend more yoga classes together</a>.</p><h3>Lite-Brite: Nostalgic Fun</h3><p>When no yoga classes were scheduled to appear on the LED display — since they only show up 12 hours in advance — I came up with the idea to create a <a href="https://github.com/redSlug/lite-brite">Lite-Brite-inspired app</a>, drawing from my childhood memories. We were on the train in route to watch <a href="https://jamiebrew.com/">Jamie Brew</a> give a <a href="https://www.recurse.com/events/localhost-march-2025-robot-karaoke">LocalHost talk about karaoke</a> when I pitched the idea to Mikhail. <a href="https://github.com/katestud">Kate</a> paired with me on the initial UI using React and <a href="https://github.com/mikkqu">Mikhail Kalashnikov</a> helped with the Raspberry Pi.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*E29aqptqUiye_f42" /></figure><p>With some help from AI, I finished it in time for demos and the audience participated by creating their own art and rendering it to the <a href="https://www.adafruit.com/product/420">LED display</a>.</p><h3>Leading Events</h3><p>To give back to the RC community I organized two events:</p><ol><li><strong>Dev Tools Show &amp; Tell</strong>: Inspired by an exceptional workshop I attended at RC seven years ago, this event let people share their favorite developer tools</li><li><strong>Valentine’s Cookie Decorating</strong>: A creative break where people could decorate cookies and unwind</li></ol><p>Eight people attended the Dev Tools Show &amp; Tell event and demoed tools including <a href="https://unix.stackexchange.com/questions/73498/how-to-cycle-through-reverse-i-search-in-bash">reverse-i-search</a>, <a href="https://github.com/ggreer/the_silver_searcher">the-silver-searcher</a>, <a href="https://textsniper.app/">text-sniper</a>, <a href="https://magnet.crowdcafe.com/">magnet</a>, <a href="https://fishshell.com/">fish shell</a>, <a href="https://ohmyz.sh/">oh my zsh</a>, and the <a href="https://missing.csail.mit.edu/2020/shell-tools/">missing semester</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/998/0*4vTIj5WXj-A4tpdR" /></figure><p>On Valentine’s Day, recursers decorated cookies throughout the day, and by the evening they were all eaten.</p><h3>Demo Days &amp; Mini Projects</h3><p>RC hosts Demopalooza twice per batch, where participants showcase their projects. People shared numerous impressive projects, like a game built without a game engine that had a bunch of shattered triangles coming together to form blocks to jump onto, a new programming language with a learning tutorial, a bop it game, robot arms, slow art, and a synth that rendered onto a CRT.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zg6nO5fgmz5ANnDc" /></figure><p>I shared Tiles and <a href="https://beat-the-bot.vercel.app/">Beat the Bot!</a>: A Tiles AI opponent and leaderboard, which motivated people to keep playing until they won.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lz0h9Kx9rRW31ZZn" /><figcaption>Leaderboard with the scores of the players who beat the bot</figcaption></figure><p>I built some small games pairing with others, each time boxed to three hours:</p><ul><li><a href="https://redslug.github.io/perlin_pachinko/">Water Sketch</a> (a falling fish game inspired by <a href="https://www.tylerxhobbs.com/words/flow-fields">Tyler Hobbs’ Flow Fields</a>)</li><li><a href="https://github.com/redSlug/madlibs-game">Mad Libs</a></li><li><a href="https://github.com/redslug/mastermind">Mastermind</a></li></ul><p>Other fun moments included pairing on <a href="https://codepen.io/redslug/pens/public">p5</a> with <a href="https://www.fractalkitty.com/">Sophia</a>, reading <a href="https://github.com/proteusvacuum/feetech-servo-rs/pull/1">robot arm temperature sensors</a>, creating a <a href="https://python-intro.readthedocs.io/en/latest/koans.html">koan</a> for a new programming language, and <a href="https://github.com/dmoerner/etracker/pull/1">etracker stats rendering</a>.</p><h3>Exploring AI &amp; Expanding My Tech Stack</h3><p>I became proficient in using AI and had conversations with almost everyone in my batch about it including people whose day jobs have included building and optimizing LLMs and also people who have never intentionally used it.</p><p>I have a lot of opinions about AI, but I will save them for another day. I paired with a friend to <a href="https://github.com/redSlug/flame-blunder-hot-steps">build a pico 8 game in about 20 minutes</a> using AI. The game runs and it’s possible to complete it, but it’s hilariously low quality.</p><p>Throughout my time at RC I coded in languages including Clojure, Python, Rust, Shell, Swift, Lua, Tomo, Ocaml, JavaScript, AppleScript and TypeScript. I also:</p><ul><li><a href="https://www.tinkercad.com/things/8KHh1wXYdHa-16x32-rgb-led-matrix-panel-case">Designed my first 3D-printed object</a></li><li><a href="https://github.com/redSlug/wetplant/blob/main/wetplant.png">Created my first Fritzing diagram</a></li><li><a href="https://github.com/redSlug/dynamic-display/commit/e1abc759235346a1d8311354b618087966f9046e">Added affirmations to the Dynamic Display</a></li><li>Participated in <a href="https://overthewire.org/wargames/">OverTheWire wargames</a> expanding my bash and Linux knowledge</li><li>Explored <a href="https://github.com/redSlug/wasm-db">wasm-db</a> and <a href="https://github.com/redSlug/fast-server">fast-api</a></li><li>Did some Swift tutorials</li><li>Deployed some <a href="https://github.com/recursecenter/cluster-config/pull/94">k8s onto the RC heap cluster</a></li></ul><h3>Failures</h3><p>I built a <a href="https://github.com/redSlug/japanese-learning-helper">Japanese Learning Helper</a> that transformed lesson notes into a flashcard app using LLMs — but ironically, I dropped out of my Japanese class to focus on it, only to abandon the project later, making it a double failure. I also set out to create a smart plant-watering app that used <a href="https://github.com/redSlug/wetplant">moisture levels to determine when to water</a>, but halfway through, I lost interest and let that idea wither away too.</p><h3>Future Ideas</h3><p>I feel fortunate to have spent three months in such a creative environment surrounded by kind and intellectually curious people. I have several plans for future projects:</p><ul><li>Create the <a href="https://boardgamegeek.com/boardgame/92415/skull">game skull</a> as a mobile app</li><li>Make plant breathing music with electrodes</li><li>Develop a <a href="https://mboffin.itch.io/gamedev-with-pico-8-issue1">pico-8 game from scratch using this tutorial</a></li></ul><h3>Thank You</h3><p>Thank you to the <a href="https://www.recurse.com/">RecurseCenter</a> for including me in the batch.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=adf705e71a03" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Solo hiking Hadrian’s wall in 6 days — an ultralight, minimalist, perspective]]></title>
            <link>https://medium.com/@bdettmer/solo-hiking-hadrians-wall-in-6-days-an-ultralight-minimalist-perspective-b95cc62eba5d?source=rss-29ccd06fb92c------2</link>
            <guid isPermaLink="false">https://medium.com/p/b95cc62eba5d</guid>
            <category><![CDATA[hadrians-wall]]></category>
            <category><![CDATA[solo-hiking]]></category>
            <category><![CDATA[ultralight-hiking]]></category>
            <dc:creator><![CDATA[Bradley Dettmer]]></dc:creator>
            <pubDate>Thu, 01 Aug 2024 01:27:57 GMT</pubDate>
            <atom:updated>2024-08-06T11:40:14.455Z</atom:updated>
            <content:encoded><![CDATA[<h3>Solo hiking Hadrian’s wall in 6 days — an ultralight, minimalist, perspective</h3><p>I wrote this both to share about my hike along Hadrian’s wall, a UNESCO World Heritage Site, and to make it easier for others to go on a similar trip. This write up is public to the entire world, so purposely impersonal. I hope you get some value from it.</p><h3>Preparation</h3><h4>Lodging</h4><p>You can camp, stay in hostels, or stay in bed and breakfasts along the trail. I booked my accommodations along the trail months in advance.</p><p>I highly recommend booking in advance as accommodations and camp sites fill up. You can find information about where to stay by researching online or looking in the book, <a href="https://www.goodreads.com/book/show/5649995-hadrian-s-wall-path">Hadrian’s Wall Path by Henry Stedman</a>.</p><p>You can book a tour or arrange accommodations yourself. Many of the accommodations along the way only accept cash or bank transfer. In order to avoid cash withdrawal fees I recommend arranging bank transfers ahead of time.</p><h4>Logistics</h4><p>I flew in and out of Edinburgh, which was a 1–2 hour train ride from both Carlisle and Newcastle. Trains run roughly every 1 hour or 30 minutes respectively during the daytime. I used the <a href="https://www.lner.co.uk/tickets-savings/your-ticket/lner-app/">LNER app</a> to book. I had no issues with tickets selling out. I saved money by booking the night before as opposed to on the train.</p><p>You can take the <a href="https://www.stagecoachbus.com/">Stagecoach</a> bus between Carlisle Bus Station and Bowness-on-Solway. The bus ride is a little over an hour.</p><p>You can also pay to have your luggage transported between accommodations.</p><h4>Physical</h4><p>It’s wise to get in hiking shape if you plan to walk 84+ miles in 6 days. For me it turned out to be 92 miles. You’ll enjoy it more, and have a better chance of completing it without injury if you put some thought into being physically prepared.</p><p>I began preparing months in advance. Some exercises / stretches that helped included:</p><ul><li><strong>whenever possible: </strong>took stairs up instead of the elevator</li><li><strong>daily</strong>: gastroc and soleus stretches (1–2 minutes each leg), 3 sets of forearm planks (up to 40 seconds each set)</li><li><strong>every other day</strong>: single leg bridges (3 sets of 10 each side)</li><li><strong>2–3 times a week</strong>: both hour long yoga and hour long running sessions (was already doing these for years)</li><li><strong>weekly</strong>: hour long endurance strength workouts including lunges (forward, side and reverse), planks, squats</li></ul><p>I continued doing the daily exercises and stretches during the hike.</p><h4>My Packing List</h4><p>My bag was less than nine pounds excluding snacks and water.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*C6wbUM6NfX9LXpKk" /><figcaption>Items carried on trip</figcaption></figure><p><strong>Gear</strong></p><ul><li>Osprey Stratos 24L Pack, sun glasses, hiking poles</li><li>tooth brush, tooth paste, floss</li><li>body glide (applied daily to feet to prevent blisters)</li><li>energy bars and snacks, hand sanitizer, 2 water bottles, sunscreen</li><li>plastic bags to keep things dry, passport, credit card, ATM card</li></ul><p><strong>Electronics</strong></p><ul><li>Garmin watch and charging cord</li><li>phone for navigation, SIM card for UK, earbuds</li><li>USB cord for phone — I did not bring a battery pack. Instead I stopped along the trail for charging at pubs, tea houses and museums</li><li>US USB Wall Charger and UK USB Wall Charger</li></ul><p><strong>Clothes</strong></p><ul><li>waterproof running jacket, polyester tank top, 94% polyester long sleeve shirt</li><li>94% nylon pants, shorts</li><li>wide brim hat, 2 pairs of synthetic socks</li><li>2 neck gaiters (one thick and black to double as sleep mask)</li><li>crocs, well loved running shoes, undergarments (not pictured)</li></ul><p>It was fairly easy to wash and dry clothes by hand. I used shampoo to wash clothes and let them dry on the heated towel rail overnight. Every accommodation I encountered in the UK had a heated towel rail, they seem to be <a href="https://www.reddit.com/r/AskUK/comments/xuodac/warming_towel_racks_do_you_use_them/">common in the UK</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/972/0*xfEv2RQdi6t4HWF7" /><figcaption>Heated towel rail included in the accommodations</figcaption></figure><p>I went in the summertime, so I did not need a warm jacket. My shoes were not waterproof and got soaking wet one day, but mostly dried by the next day.</p><h4>Books</h4><p>Prior to leaving I downloaded some books to listen to. Here are some you might find relevant:</p><ul><li>Wild by Cheryl Strayed: This is a really good book, I recommend it for anyone going on a multi-day solo hike</li><li>Hadrian’s Wall by Adrian Goldsworth: Provides some history about the wall, and it’s good to read before you get to Vindolanda / Housesteads or while you are there</li><li>African and Caribbean People in Britain by Hakim Adi: Gives some history about Hadrian and the wall</li><li>None of the Above: Reflections on Life Beyond the Binary by Travis Alabanza: I saw Travis speak in Brooklyn, they are from the UK</li><li>Spare Hardcover by Prince Harry The Duke of Sussex</li></ul><p>I also encountered this physical book along the trail, which may have been useful to buy in advance:</p><ul><li><a href="https://www.goodreads.com/book/show/5649995-hadrian-s-wall-path">Hadrian’s Wall Path by Henry Stedman</a></li></ul><h4>Maps</h4><p>I used AllTrails to navigate. I downloaded sections of the trail piecemeal and also the whole trail in advance. I have an AllTrails subscription otherwise I might have used a different app.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*EfkhvNdYu7k54xSW" /><figcaption>Screenshot of AllTrails app with map successfully downloaded</figcaption></figure><p>Upon downloading the app often said “download failed”, but it just meant the OCM, OSM etc. downloads failed. The AllTrails download was sufficient.</p><p>I also used Google Maps to find specific accommodations along the trail.</p><h3>Arriving</h3><p>Upon arriving I went to a cell phone store near Waverley station and bought a UK USB power adaptor and a UK SIM card. I also exchanged some cash and bought some sunblock from a pharmacy.</p><h4>Wi-Fi / Connectivity</h4><p>All of the places I stayed at had Wi-Fi and the SIM card worked everywhere. With the data SIM card I wasn’t able to make phone calls, but I could use WhatsApp, and call landlines using Skype.</p><h4>Cell Phone Battery</h4><p>Since I was using my phone to navigate, take pictures and listen to audio books I had to be strategic about prolonging the battery power in order to have enough to last each day. I put my phone on airplane and low power mode, and made sure it was fully charged before I started hiking each morning. It was still possible to use the AllTrails app w/ GPS on airplane mode.</p><p>I was thoughtful about charging during the day. Since charging is <a href="https://witricity.com/media/blog/the-80-rule">not linear</a> and I wanted to maximize time hiking and minimize time waiting for charging I timed my charging each day for after I was already half way through the hike, and I only charged it to about 60% or 70%. I charged at museums, tea houses and pubs, usually while I was eating or exploring.</p><h3>Itinerary</h3><p>I assembled a map of the path that included topology and landmarks I didn’t want to miss. It helped me plan each day accordingly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lX9KY6mlAtiNtbhd" /><figcaption>Topological map of the path with landmarks</figcaption></figure><h4>Day 0 — Rest in Newcastle</h4><p>There are plenty of places to stay in Newcastle. You can take public transportation or an Uber to the start of Hadrian’s wall.</p><h4>Day 1–16.4 miles — Wallsend — Heddon-on-the-Wall</h4><p>This was a nice walk, mostly along the River Tyne.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zcKb2hyWLshC-r3m" /><figcaption>River Tyne</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*z3rW7o9ERtWySO85" /><figcaption>There’s a large section of the wall visible in Heddon-on-the-Wall</figcaption></figure><p>There was also a basketball court in Heddon-on-the-Wall and I played pickup with some rugby / football players.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*cIEswcmn7XhwveOt" /><figcaption>Basketball court in Heddon-on-the-Wall</figcaption></figure><h4>Day 2–17.2 miles — Heddon-on-the-Wall to Chollerford</h4><p>There were very cute and friendly sheep and cows on this part of the path. There was also a part where I had to take my shoes off to step through a puddle.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3pG_9SaMigEQDNcF" /><figcaption>Lamb eating flowers from my hand</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*XITbk3mVt1zrAHSr" /><figcaption>Stiles along the trail helped keep livestock in their designated areas</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*EV-ybecmatlhM3ww" /><figcaption>Chollerford Bridge</figcaption></figure><h4>Day 3–15.6 miles — Chollerford to Steel Rig / Once Brewed</h4><p>This part of the trail had the most stunning archeology. I recommend seeing the Temple of Mithras, Housteads and Vindolanda.</p><p>According to legend, <a href="https://www.english-heritage.org.uk/visit/places/temple-of-mithras-carrawburgh-hadrians-wall/">Mithras captured and killed a sacred bull in a cave, which Mithraic temples were intended to evoke</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*cIKqjBjXXCwjIoig" /><figcaption>Temple of Mithras during light rainfall</figcaption></figure><p>Housesteads is said to be the best-preserved fort along the wall.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*f9tb0m2M83bHE-jI" /><figcaption>A section of Housesteads Roman fort used for food storage</figcaption></figure><p>Two people told me how great Vindolanda was so I was determined to get there. So determined that I took a shortcut. By going straight from Housesteads to Vindolanda it probably saved a mile or two of hiking. I used Google maps in combination with AllTrails to get to Vindolanda. You can see my path below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9mo0dyORwBv4IXOx" /><figcaption>Path from Housesteads to Vindolanda then Once Brewed</figcaption></figure><p>Vindolanda is a Roman village <a href="https://www.youtube.com/watch?v=KLqXy9tQDVM">currently being excavated</a>. It’s well worth visiting.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*dDkVcbzpVwnimbJC" /><figcaption>Backside of a bath house in Vindolanda</figcaption></figure><h4>Day 4–10.6 miles — Steel Rig / Once Brewed to Gilsland</h4><p>This part of the trail has some of the most breathtaking landscapes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0STn-OfY5hzlbZ79" /><figcaption>Steel Rig</figcaption></figure><p>A <a href="https://en.wikipedia.org/wiki/Milecastle">milecastle</a> is a small fort. Several milecastles appear along the wall.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Bvogfy2BJcur0LMa" /><figcaption>Near Mile Castle 41</figcaption></figure><h4>Day 5–20 miles — Gilsland to Carlisle</h4><p>This was a very long day with lots of flat miles, so I needed some grit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*uJqvMdSeaOU6om8W" /><figcaption>A large container of grit</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dOaJ1XRLw2D8Qt2dLAOYEg.jpeg" /><figcaption>Cow feeding in Rickerby Park near River Eden</figcaption></figure><h4>Day 6–11.7 miles — Carlisle to Drumburgh</h4><p>Many people choose to end their trip at Bowness-on-Solway, and either stay the night or wait up to three hours for the next bus back to Carlisle.</p><p>I decided to change it up. Since there is no visible wall left on the coast, I “ended” my trip in the village of Drumburgh in the <a href="https://www.solwaycoastaonb.org.uk/2019/places-to-explore/nature-reserves/drumburgh/">Solway Coast Area of Natural Beauty</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*G6YNCOYmwxaHQhGx" /><figcaption>Solway Coast Area of Natural Beauty w/ sheep in the foreground</figcaption></figure><p>Since the bus from the coast leaves every 2–3 hours, I decided to take a bus out in the morning from the bus terminal and hike back to Carlisle. By doing the last leg in reverse it meant not having to wait for the bus or try to time the hike to match the bus schedule.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*bEIW3OIzgQ82yGsr" /><figcaption>Carlisle Castle</figcaption></figure><p>My hike ended at Carlisle Castle. Hadrian’s wall souvenirs were available at the Castle.</p><h3>What I would have done differently</h3><ul><li>Would have taken out less cash and found a way to make bank transfers to the lodges that did not accept credit cards. The only cash needed was to pay for lodging and tips.</li><li>Would have packed less energy bars, perhaps only 4 or 5 total. I am not a picky eater and there was plenty of food along the wall.</li><li>Would have been more careful near the cows. I didn’t realize some cows can behave aggressively towards humans, especially when calves are present.</li></ul><p>The most positive takeaway from my trip was the sheep, cows, dogs and humans I encountered along the way. My favorite day was the rainy day. Even though my shoes got wet, it added to the ambiance when visiting the temple of Mitras and Housesteads Fort. I’m considering the Kumano Kodo trail in Japan next.</p><h3>Similar Hikes</h3><ul><li><a href="https://www.indietraveller.co/annapurna-trek-without-guide/">Annapurna Base Camp Trek</a></li><li><a href="https://worldlyadventurer.com/torres-del-paine-w-hike-without-tour/">Torres del Paine W trek</a></li><li><a href="https://thedetoureffect.com/blog/project-multi-trek-recap/">Solo Trekking Five Trails Across Europe</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b95cc62eba5d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The dangers of using ‘is’ in Python]]></title>
            <link>https://medium.com/peloton-engineering/the-dangers-of-using-is-in-python-f42941124027?source=rss-29ccd06fb92c------2</link>
            <guid isPermaLink="false">https://medium.com/p/f42941124027</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[debugging]]></category>
            <category><![CDATA[bug-fixes]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Bradley Dettmer]]></dc:creator>
            <pubDate>Sat, 02 Feb 2019 03:16:10 GMT</pubDate>
            <atom:updated>2019-02-13T19:13:54.892Z</atom:updated>
            <content:encoded><![CDATA[<p>This blog post covers a strange integer bug that I encountered, and it corresponds to a <a href="https://2018.pycon.ca/talks/talk-PC-55513/">talk I gave</a> at <a href="https://2018.pycon.ca/talks/talk-PC-55513/">PyCon Canada</a>. You can <a href="https://docs.google.com/presentation/d/1mDeGnYlkYEvIuAfEGTyTk-vUaYvALkdqfnuGIRqz0Hs/edit#slide=id.p">view the slides</a> if that’s your preferred medium. In this post you’ll learn how the bug was discovered, understand why it’s a bug and why the bug only occurs with larger integers. Hopefully you’ll gain an appreciation of how bugs can be your best teachers and be able to prevent more bugs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3MOo7W9jq03bYgSf" /><figcaption>Screenshot of reservation system with a picture of a woman riding a stationary bike on the left, with the caption ‘Ready to Ride Toronto?’, and a list of appointments on the right.</figcaption></figure><p>I was building a reservation system so people could <a href="https://booking.onepeloton.com/#/choose-location">demo a Peloton bike</a> when I encountered a bug. Everything was working fine, and no code changes had been made to the system in days when I got a slack message one evening.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*RsdxSRGrrv2RjMZ1" /><figcaption>Slack message from Paul with the text “I booked two (appointments) at 7am on 9/25. The appointments still return an empty array.”</figcaption></figure><p>Paul had booked two appointments, but they were not showing up in the admin portion of our system. I was puzzled that a bug could appear with no code changes. The code below is the loop that groups all appointments by <strong>time_slot</strong> and returns the appointments as a list to be used in the API.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5d2879516c08ec7243e82d80c1a9d273/href">https://medium.com/media/5d2879516c08ec7243e82d80c1a9d273/href</a></iframe><p>There are two types of comparisons I’ll cover. The <strong>is</strong> keyword compares by reference. A reference is like a post-it note, an address, or a pointer to an object. The <strong>is</strong> comparison is what bit me in this bug. The <strong>==</strong> operator compares by value. To know me is to know that I love dogs, I’ll use dog dollars to show you how <strong>is</strong> and <strong>==</strong> comparisons differ.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*IwehR8IVELyVZmcT" /><figcaption>A diagram of Paul and Brad both pointing to the same puppy dollar, with a value of $1</figcaption></figure><p>Paul and I both have a puppy dollar bill. When we compare our money, we have the same reference and the same value so if we compare both by <strong>is</strong> and by <strong>==</strong> our money is the same.</p><p>Here is another example where we have different dollars, but they happen to be the same value.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*q9z06gzKTHExiKHj" /><figcaption>A diagram of Paul and Brad pointing to different dog dollars, both with a value of $1</figcaption></figure><p>In this case when we compare our money, we have a different reference but our money still has the same value. So if we compare by <strong>is</strong>, our money is different but if we compare by <strong>==</strong> our money is the same.</p><p>To understand why the bug bit me only after after more data was added, let’s step back to look at the Python Interpreter and how memory is managed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*WV9S28cK7SuKv4-G" /><figcaption>Python Interpreter with Call Stack, and Private Heap with PyObjects. The frames on the call stack are pointing to PyObjects on the heap</figcaption></figure><p>Python is a stack based virtual machine that stores all objects on a private heap. Heap is just another way of saying chunk of memory or giant array of data. Now I’ll go into further detail about the PyObjects that live on the heap.</p><p>Every value assigned to a variable in Python exists as an object on the heap. It takes time to allocate these objects because our memory manager needs to do work. When an integer is assigned to a variable in Python, a corresponding PyObject needs to exist on the heap.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/756/0*ZCGHBoGF_SQTjDj2" /><figcaption>Private Heap containing a small_ints array with values -5 to 256</figcaption></figure><p>A PyLong object is a type of PyObject in Python that has a numeric integer value. PyLongObjects between -5 and 256 are pre-allocated on the heap in CPython, and can be accessed in C with the <strong>small_ints</strong> array. <strong>small_ints</strong> is an optimization so the memory manager has to do less work for small integers.</p><p>Let’s do an example of compare by reference, the type of comparison that caused my bug. Again, this type of comparison is done using the <strong>is</strong> keyword. First, will initialize our variable <strong>v</strong>, with the value of -5. Then we initialize another variable <strong>w</strong> with a value of -5, then we compare using <strong>v</strong> and <strong>w</strong> using <strong>is</strong>, and the result is <strong>True</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*WbRI8LiU21TNpK68" /><figcaption>Initialize variable v with value -5 and w with -5. Both v and w are pointing to the small_ints array on the heap, so “v is w” evaluates to “True”.</figcaption></figure><p>Let’s look at some of the CPython source code to understand why our comparison of small numbers using <strong>is</strong> equated to <strong>True</strong>. The following code gets an instance of a small integer.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/63f2d2cf7a6de09dfc0074bb42f76f1e/href">https://medium.com/media/63f2d2cf7a6de09dfc0074bb42f76f1e/href</a></iframe><p>If our number is small, like a puppy, it’s returned from the <strong>small_ints</strong> array. We don’t have to allocate a new PyObject on the heap, it’s already there. It’s nice to know that when we initialize <strong>w</strong>, can still use our <strong>small_ints</strong> array and we don’t have to initialize another PyObject. Next, we’ll compare <strong>v</strong> and <strong>w</strong>.</p><p>The following CPython source code compares two pointers to PyObjects. In other words, it compares two addresses or post-it notes. A pointer is a variable whose value is the address of another variable. We know the comparison method, <strong>PyObject_RichCompareBool </strong>is comparing pointers or addresses because the parameters <strong>v</strong> and <strong>w</strong> have asterisks in front of them.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/106f4ea053d12e12f7f8eba2f40c4c66/href">https://medium.com/media/106f4ea053d12e12f7f8eba2f40c4c66/href</a></iframe><p>On a side note, CPython compares objects by reference using <strong>==</strong> to compare the addresses. In other words, compare by reference source code uses compare by value. If <strong>v</strong> and <strong>w</strong> are the same address, the comparison returns true. So if <strong>v</strong> and <strong>w </strong>are small integers with the same value, because they are in the <strong>small_ints</strong> array, they have the same address and <strong>PyObject_RichCompareBool </strong>will return true<strong>. </strong>At a higher level, comparing objects using <strong>is</strong> can be likened to comparing the location of the objects in the heap.</p><p>Now let’s look at a comparison of values not in the small_ints array. Since 257 is not in the range of our <strong>small_ints</strong> array, when we initialize our variables, we create two new PyObjects with the same value, and when we compare the reference to the objects our expression evaluates to <strong>False</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*c-MzR-cwUJ6Vc4kO" /><figcaption>Initialize variable, x with value 257, y with 257, neither x or y are in the small_ints array, so “x is y” evaluates to False</figcaption></figure><p>Back to our bug. We are filtering out appointments for new time slots because our <strong>if </strong>clause equates to <strong>False</strong> with larger numbers. By checking <strong>if appointment.time_slot_id is time_slot.id </strong>before appending an appointment we filter everything out.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*E0YMt2n6UPBgI3A7" /></figure><p>Above is an object representation of the buggy code, the PyLongObject on the left represents <strong>time_slot.id</strong> and the PyLongObject on the right represents <strong>appointment.time_slot_id</strong>. You can see both of these are different objects. Instead of comparing values, the code was comparing PyLongObjects, and returning <strong>False</strong> because they were different objects. The code was comparing two different PyLongObjects that happened to have the same value.</p><p>If we were to change our comparison to<strong> </strong>checking <strong>if time_slot.id is appointment.time_slot.id </strong>by simply changing the last underscore to a dot, we would have been comparing the same PyLongObject.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*N91SKxqX3fOqR1Ch" /></figure><p>Since we updated the underscore to a dot, <strong>appointment</strong>.<strong>time_slot</strong> and <strong>time_slot</strong> reference the same <strong>time_slot</strong> object on the heap. This means all of their fields, including <strong>id</strong> are the same. In doggie dollar terms, <strong>appointment</strong>.<strong>time_slot</strong> and <strong>time_slot </strong>have the same doggie dollar.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*K0advfP8S1BNUWPJ" /></figure><p>This one character fix might work, but it could also break if there are multiple instances of the same <strong>time_slot</strong> object.</p><p>An even better fix would be to use double equals. This whole bug could have been avoided if we had used <strong>==</strong> to compare instead of <strong>is</strong>. Compare by value looks at the contents of the objects. In doggie dollar terms, compare using <strong>==</strong> looks at the value of the dollar instead of the dollar itself.</p><p>The biggest takeaway here is to only use <strong>is</strong> for comparison when you wish to compare objects.</p><p>Also, understanding why a fix works can lead to a better understanding of the language you are using. Everything is an object in Python, so be careful when using <strong>is</strong> to compare.</p><p>Thank you! <a href="https://www.recurse.com/">The Recurse Center</a>, <a href="https://www.onepeloton.com/">Peloton</a>, <a href="https://www.writespeakcode.com/">write/speak/code</a>, <a href="https://github.com/jreut">Jordan Ryan Reuter</a>, <a href="https://github.com/cfinucane">Cameron Finucane</a>, <a href="https://www.linkedin.com/in/john-gerace/">John Gerace</a>, <a href="https://www.linkedin.com/in/paulbouzakis/">Paul Bouzakis</a>, <a href="https://www.linkedin.com/in/tae-kim-140590124/">Tae Kim</a>, Martin, Tavish, Brian, Kyle, Scott, Rose, Tom, <a href="https://twitter.com/freakboy3742">Russell Keith-Magee</a>, <a href="https://2018.pycon.ca/">PyCon Canada</a> conference organizers and volunteers, <a href="https://twitter.com/elthenerd">Elaine Wong</a>, <a href="http://akaptur.com/blog/2017/11/12/love-your-bugs/">Allison Kaptur</a>, <a href="https://www.linkedin.com/in/duncan-regan-3262a780/">Duncan</a>, Rowan, <a href="https://github.com/charlietran">Charlie Tran</a>, <a href="https://www.linkedin.com/in/kevin-zetterstrom-10b114a4/">Kevin Zetterstrom</a>, <a href="https://blog.benjojo.co.uk/">Ben Cox</a>, <a href="https://ernest.ly/">Ernest W. Durbin</a>, and you the reader!</p><p>These resources were helpful in writing this and you may find them interesting: <a href="https://kate.io/blog/2017/08/22/weird-python-integers/">Kate’s post on Weird Python Integers</a>, <a href="https://akaptur.com/blog/2017/11/12/love-your-bugs/">Alison’s Love Your Bugs post</a>, or <a href="https://spyhce.com/blog/cpython-data-structures">AndreiC’s post on CPython data structures</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f42941124027" width="1" height="1" alt=""><hr><p><a href="https://medium.com/peloton-engineering/the-dangers-of-using-is-in-python-f42941124027">The dangers of using ‘is’ in Python</a> was originally published in <a href="https://medium.com/peloton-engineering">Peloton-Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[7 solutions to EJSONPARSE or Unexpected token `npm install` error]]></title>
            <link>https://medium.com/@bdettmer/7-solutions-to-ejsonparse-or-unexpected-token-npm-install-error-3ecec586a2df?source=rss-29ccd06fb92c------2</link>
            <guid isPermaLink="false">https://medium.com/p/3ecec586a2df</guid>
            <category><![CDATA[node]]></category>
            <category><![CDATA[cache]]></category>
            <category><![CDATA[json]]></category>
            <dc:creator><![CDATA[Bradley Dettmer]]></dc:creator>
            <pubDate>Fri, 03 Aug 2018 13:16:43 GMT</pubDate>
            <atom:updated>2018-08-03T13:16:43.599Z</atom:updated>
            <content:encoded><![CDATA[<p>You clone a repo, or maybe you are creating your project with a new `package.json` file. When you try to `npm install`, `npm install package_name — save-dev, or `npm i npm`, the JSON doesn’t parse.</p><h3>ReactAtStackOverflow on Twitter</h3><p>repeated EJSONPARSE error https://t.co/qD3zc8FtWz</p><pre>npm ERR! code EJSONPARSE<br>npm ERR! JSON.parse Failed to parse json<br>npm ERR! JSON.parse Unexpected token…</pre><p>This error could occur because of any number of reasons. You think something is probably wrong with your `package.json` file, but you’re not exactly sure what it is. Maybe you try `yarn install` because Yarn is a package manager similar to npm that’s known to be faster and have more enhancements. But that probably doesn’t help if the issue is with your JSON. Here are some possible solutions or ways to diagnose the issue:</p><p>1.) npm cache clean -force: <a href="https://stackoverflow.com/questions/31454607/npm-failed-to-parse-json#comment50876342_31454607">Cleaning your cache</a> will resolve potential conflicts with previously installed packages.</p><p>2.) Debug log: This might point you to the exact location where the error is occurring so you can fix it. You can find the location of the debug log in the console output. For example,</p><pre>npm ERR! A complete log of this run can be found in:</pre><pre>npm ERR! /Users/bd/.npm/_logs/2018–07–31T20_09_06_054Z-debug.log</pre><p>3.) JSON validator: Use a tool like <a href="https://jsonlint.com/">JSONLint</a> to check and make sure your package.json file is valid. A JSON validator or a linter should give you more insight as to why your file is not parsing.</p><p>4.) Check commas: <a href="https://stackoverflow.com/questions/47741707/nodejs-error-ejsonparse-error?rq=1">In some cases, adding a comma between key value pairs may help</a>. In my case, deleting a trailing comma resolved the error.</p><pre>“scripts”: {</pre><pre>- “start”: “webpack-dev-server”,</pre><pre>+ “start”: “webpack-dev-server”</pre><pre>},</pre><p>5.) Minify: A <a href="https://codebeautify.org/jsonminifier">minifier</a> could remove extra white space or improper formatting and <a href="https://github.com/expressjs/express/issues/2930">resolve the issue</a>.</p><p>6.) Number of packages: <a href="https://www.reddit.com/r/node/comments/8fgdw3/help_npm_err_coded_ejsonparse/">Make sure you just have one package</a> in your package.json. It’s better to <a href="https://stackoverflow.com/questions/14246977/multiple-package-json-files-in-one-package">split your project into multiple directories</a> if you want to use multiple packages. Every component requires its own package.json<a href="https://github.com/coreui/coreui-free-react-admin-template/issues/3">to avoid versioning issues</a> or to <a href="https://github.com/kriasoft/react-firebase-starter/issues/43">make require-statement resolution works</a>.</p><p>7.) rm package-lock.json: <a href="https://github.com/react-navigation/react-navigation/issues/3103">Removing the lock file</a> and running npm install again could help resolve versioning issues.</p><p>Hopefully one of these solutions helped you. Please add your ideas or any other solutions you may have in the comments!</p><p>Thank you <a href="https://twitter.com/techgirl1908">Angie Jones</a> for teaching me the <a href="https://www.wikihow.com/Write-a-Listicle">listicle blogging style</a>, <a href="https://twitter.com/jessleenyc">Jess Lee</a> for reviewing this blog post and providing awesome feedback, <a href="https://twitter.com/WriteSpeakCode">Write Speak Code</a> for inspiring me to write it, and <a href="https://www.recurse.com/">Recurse Center</a> for being a wonderful programming community!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3ecec586a2df" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Dumping SNES Zelda ROM]]></title>
            <link>https://medium.com/@bdettmer/dumping-snes-zelda-rom-45b91b92e1c9?source=rss-29ccd06fb92c------2</link>
            <guid isPermaLink="false">https://medium.com/p/45b91b92e1c9</guid>
            <category><![CDATA[gaming]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[nintendo]]></category>
            <category><![CDATA[arduino]]></category>
            <dc:creator><![CDATA[Bradley Dettmer]]></dc:creator>
            <pubDate>Fri, 27 Jul 2018 19:22:43 GMT</pubDate>
            <atom:updated>2018-07-27T19:22:43.492Z</atom:updated>
            <content:encoded><![CDATA[<p>A couple years ago, I was sitting at a cafe inside of Google NYC with a few friends. We were talking about things we missed from the 90’s, and I expressed how much I enjoyed 16-bit gaming when I was a kid. A friend of mine happened to have two <a href="https://en.wikipedia.org/wiki/Super_Nintendo_Entertainment_System">SNES</a>s that he was not using in his garage, and said I could have one of them. A few days later I found an SNES with a Zelda game cartridge sitting on my desk.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*OcA-XhTOcd4WocsP" /></figure><p>I didn’t have a monitor, so when I got home, I tried attaching it to my roommate’s projector. The game console turned on, but did not display anything. I later found out this was likely caused by the game cartridge not being read correctly because of dust, or dirty contacts. I tried blowing on the cartridge, but that didn’t help, so it sat in my living room in Queens for about a year, and when I moved to Brooklyn it came with me and found a spot in my kitchen hidden away above the cupboard collecting even more dust.</p><p>One day, at the<a href="https://www.recurse.com/"> Recurse Center</a>, my friend<a href="https://twitter.com/f2xeb"> Phoebe</a> gave a presentation on hardware hacking. She mentioned <a href="https://www.exploitee.rs/">resources for hardware vulnerabilities</a> and a <a href="https://www.shodan.io/">search engine for security</a>. She also mentioned <a href="https://www.bigmessowires.com/2013/11/19/what-is-the-bus-pirate/">Bus Pirate</a>, and how it could be used to snoop serial communication on a circuit board. I wanted to get some interesting data off of something using it.</p><p>After becoming interested in dumping data from devices, the SNES found a possible new use. My friend <a href="https://github.com/cfinucane">Cameron</a> found the<a href="https://console5.com/wiki/File:Snes_schematic_color.png"> schematics</a> for it and mentioned it seemed to have a lot of <a href="https://en.wikipedia.org/wiki/Parallel_Bus_Interface">parallel busses</a>. <a href="https://en.wikipedia.org/wiki/Parallel_communication">Parallel interfaces</a> convey multiple bits simultaneously and each bit has a single wire devoted to it. <a href="https://en.wikipedia.org/wiki/Serial_communication">Serial interfaces</a> convey a single bit at a time; the bits are conveyed as a series of pulses. Because the SNES uses parallel communication, it might not be the best candidate for Bus Pirate explorations.</p><p>Nonetheless, I wanted to learn more about the innards of the SNES, so I brought it to the Recurse Center and began to take it apart. A <a href="https://en.wikipedia.org/wiki/List_of_screw_drives#Bristol">special screwdriver</a> was needed to open up the game cartridge, and the console itself. I found a <a href="https://www.youtube.com/watch?v=SOqU3s4iS7A">video online about how you could create a makeshift screwdriver</a> by melting the tip of a plastic pen and then molding it to be the shape of the screwdriver by pressing it again the screw, but decided it would be easier to buy the screwdriver.</p><p>Again, after plugging in the SNES and turning it on, the black screen appeared. Another friend, <a href="https://github.com/AveryEMcG">Avery</a>, decided to wipe off the cartridge reader with a towel. When we plugged in the power, and connected the SNES to a projector, this time it worked. A few days later, the screw driver came in the mail and I was good to continue breaking down the SNES. There was a spring holding the cartridge release button. I removed the game cartridge reader and the sound card. The cartridge reader was not soldered in, nor was it screwed in. So I took it out, and put it back in.</p><p>We began sniffing the parallel bus using Saleae logic analyzer while the game was running. We did this by hooking the probe clips directly to the Zelda ROM chip leads.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*IpilRDCzbR0NtMrV" /></figure><p>After reading up on <a href="https://en.wikipedia.org/wiki/ROM_cartridge">ROM cartridges</a> and <a href="https://en.wikipedia.org/wiki/Super_Nintendo_Entertainment_System_Game_Pak">SNES</a>, we learned it was not necessary to have the cartridge attached to the console in order to dump the ROM. By studying the <a href="https://www.caitsith2.com/snes/flashcart/cart-chip-pinouts.html#rom">SNES cartridge ROM pinout</a>, we learned we could power the ROM and communicate with it as though we were the SNES. If parallel communication was sent to the ROM by using the address and output enable pins, the ROM would output data via the data pins. So we hooked up an Arduino to the ROM, and wrote <a href="https://github.com/redSlug/ROM-Dump/blob/master/sketch_jun07a/sketch_jun07a.ino">some C code</a> that iterates through all possible memory locations by address, requesting the data. Then we hooked the Saleae logic analyzer to the 8 digital output pins and collected the ROM dump. We effectively used the output enable pin as a clock, so we didn’t need a separate clock signal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ppFkFWMCjBKi5l_l" /></figure><p><em>White spikes represent high signal, a binary 1 value. The purple channel is the clock, used to determine when samples are considered valid.</em></p><p>There were some caveats, of course it was not *that* simple.</p><p>First, 21 pins are needed to request all addresses (20 address pins and 1 output enable pin), but the <a href="https://playground.arduino.cc/Learning/Pins">Arduino only has 20 pins that can be used as digital output</a>. Cameron found an <a href="http://www.onsemi.com/pub/Collateral/MC14015B-D.PDF">MC14015B</a> chip sitting around, which is a serial to parallel converter, so it enabled us to <a href="https://github.com/redSlug/ROM-Dump/blob/master/sketch_jun07a/sketch_jun07a.ino#L117">use two pins on the Arduino</a> to talk to 8 pins on the Zelda chip. We did this by <a href="https://github.com/redSlug/ROM-Dump/blob/master/sketch_jun07a/sketch_jun07a.ino#L27-L40">writing to the data pin 8 times</a>, and using a clock pin to shift the data. Because <a href="http://www.onsemi.com/pub/Collateral/MC14015B-D.PDF">MC14015B</a> has two 4 bit shift registers and we wanted to use 8 registers, we used a jumper to make it act as an 8 bit register.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*392z38_CllQFIHpP" /></figure><p>Second, we didn’t have enough <a href="https://usd.saleae.com/collections/accessories/products/test-clips-92">test clips</a> to hook to each of the ROM pins. We needed to attach to all 32 ROM pins, and we only had 8 or so clips, so Cameron kindly soldered a bunch of wires onto the chip via the backside of the Zelda game cartridge PCB.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*EHQ6uo8CbdfRBs8_" /></figure><p>Third, the Saleae logic analyzer could only take in data from 8 pins at a time, but in order to take the samples at the correct time, we needed 9 pins; we needed 8 digital output pins and 1 clock pin to tell the analyzer when to consider samples valid. So we took two readings, changing the pin we were scoping, and then stitched them together with a <a href="https://github.com/redSlug/ROM-Dump/blob/master/knit_k2g_together_rom.py">Python script</a>. The LED on the breadboard helped with debugging; <a href="https://github.com/redSlug/ROM-Dump/blob/master/sketch_jun07a/sketch_jun07a.ino#L44-L51">we added some longer blinks</a> so we would know when the data was done being collected.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FnvfrcXWDpCA%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DnvfrcXWDpCA&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FnvfrcXWDpCA%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/1aebe2bc33bc0efdf6ae806f7f73f430/href">https://medium.com/media/1aebe2bc33bc0efdf6ae806f7f73f430/href</a></iframe><p>After we dumped the cartridge as two `.txt` files, <a href="https://github.com/redSlug/ROM-Dump/blob/master/knit_k2g_together_rom.py#L15-L17">stitched them together, and saved the combined file as a binary</a>, we ran strings on it and found the title of the game, in capital letters!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5o9lxB9hI8U9iYkC" /></figure><p>This is not the first time an SNES game cartridge has been dumped. In fact, it’s possible to find almost any SNES game binary online. These binaries are used to play the game on emulators. To verify we were dumping the correct data, I downloaded one of the binaries. Comparing our ROM dump to the downloaded ROM dump, we found some noise; roughly 3 percent of values did not agree. You can see an example of this by looking at image output. You’ll notice the image generated from our rom dump has an extra pixel.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/684/0*6SMnpebSjIXcdq_Z" /></figure><p>To try to troubleshoot what might be causing that pixel, it’s important to understand Saleae logic analyzer settings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*m8IpX4YVLYZg_Ljv" /></figure><p><em>Left: </em><a href="https://github.com/redSlug/ROM-Dump/blob/master/sketch_jun07a/sketch_jun07a.ino#L83-L117"><em>Our recipe for where to connect the red wires to</em></a><em>. Right top: </em><a href="http://downloads.saleae.com/Saleae+Users+Guide.pdf"><em>Saleae logic analyzer settings</em></a><em>. Right bottom: Logic Analyzer Sample Rates. MS/s is 1 mega (million) sample per second.</em></p><p>One theory about why our dump was noisy was that we weren’t sampling often enough. We used<a href="https://en.wikipedia.org/wiki/Nyquist%E2%80%93Shannon_sampling_theorem"> Nyquist’s law</a> to determine the noise was likely not related to our sample rate. Following Nyquist, a sufficient sample-rate is anything larger than 2B samples per second. At 1MS/s we should reliably capture signals up to 500kHz, which is a safe margin over our max bus speed of ~1/(10us) = 100kHz, where 10us is <a href="https://github.com/redSlug/ROM-Dump/blob/master/sketch_jun07a/sketch_jun07a.ino#L5">delay_time</a>.</p><p>Another theory of why our initial ROM dump was noisy, is we were collecting data too close to the falling edge of the output enable (/OE) signal. So we thought changing the Arduino code to send an additional clock pin a pulse a microsecond after the data goes low could help eliminate noise. We did not test this theory. “Data is valid on clock falling edge” means that Saleae outputs a sample every time a clock bit (or in our case output enable) goes from high to low. We changed the analyzer setting to sample data on rising edge instead of falling edge and the noise disappeared.</p><p>To extract the sprites from the binary data, we needed to understand how <a href="https://emu-docs.org/Super%20NES/General/snesdoc.html#GraphicsFormat">sprites are stored in SNES game cartridge ROM</a>. While portable pixel map files are stored with RGB values together for each pixel, SNES sprites are interlaced, and the colors are stored using palettes. So we set the header of the `.pbm` file to render only one color, black or white, and then set the width to 8 pixels, the width of an SNES tile. Cameron <a href="https://github.com/redSlug/ROM-Dump/blob/master/README.md#bash-commands-used">wrote a line of bash</a>, to save the data as separate image files, because it would not open as one file.</p><p>After that, we could make out some of the sprites used in the game!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/654/0*MyvGBfzMtZazHKZX" /></figure><p>We also managed to spot the opening logo sprite used in the first seconds of the game starting, in pieces, and pasted it together.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/724/0*4TtuyVqhf90HaIh9" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*19kmdM_KhucEi3Hx" /></figure><p>Thank you <a href="https://github.com/cfinucane">Cameron</a> for pairing with me on this, and for being my hacker buddy. Your Python, Bash and Linux skills are super impressive, and I’m grateful to have learned so much from you in this endeavor!</p><p>Thank you <a href="https://github.com/AveryEMcG">Avery</a> for being a super awesome person, for sharing your hardware expertise and your game console wisdom!</p><p>Thank you <a href="https://twitter.com/benjojo12">Ben</a>, <a href="https://github.com/SlySteven">Steven</a> and Cameron for reviewing this blog post and providing valuable feedback!</p><p>Thank you <a href="https://twitter.com/f2xeb">Phoebe</a> for your wonderful talk that inspired this exploration!</p><p>Thank you <a href="https://www.recurse.com/">Recurse Center</a> for providing the space and tools to make this happen!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=45b91b92e1c9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Displaying Weather on a 32x16 LED Matrix]]></title>
            <link>https://medium.com/@bdettmer/displaying-weather-on-a-32x16-led-matrix-ce9281dc67a9?source=rss-29ccd06fb92c------2</link>
            <guid isPermaLink="false">https://medium.com/p/ce9281dc67a9</guid>
            <category><![CDATA[hub75]]></category>
            <category><![CDATA[weather]]></category>
            <category><![CDATA[led-lighting]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[raspberry-pi]]></category>
            <dc:creator><![CDATA[Bradley Dettmer]]></dc:creator>
            <pubDate>Mon, 23 Apr 2018 14:36:23 GMT</pubDate>
            <atom:updated>2018-04-27T13:21:16.889Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2n00AtWModwCLSXN5PLOaw.jpeg" /><figcaption>Sunny weather forecasted onto LED matrix panel</figcaption></figure><h3>Using a Raspberry Pi, HUB75 Connector, 32x16 LED matrix, Dark Sky API, Pillow and some sample code</h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F-x45NSAeNtY%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D-x45NSAeNtY&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F-x45NSAeNtY%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/fe8d6acfb77a93ff8ff3fb2c47312dab/href">https://medium.com/media/fe8d6acfb77a93ff8ff3fb2c47312dab/href</a></iframe><p>In California, you can usually be sure it’s not going to rain for the rest of the day if the sky looks clear. Additionally, since it rains so rarely, if it’s going to rain, people are usually talking about it at least a day in advance. Also, California has a strong car culture, you can usually just hop in your car, so the chance of getting caught outdoors with the wrong attire in bad weather is pretty rare. I never checked the weather until I moved to New York.</p><p>In New York, you can be caught off guard by rain, snow, or really cold, windy weather. I’ve been caught a few times in the bad weather, to the point where I’ve started checking the weather forecast before leaving the house.</p><p>A friend told me about Dark Sky and told me it was the best weather app. I’ve been using Dark Sky but am annoyed by having to use my phone to get the weather forecast. Having an LED matrix display the weather would be more convenient to look at.</p><p>I’ve played around with Raspberry Pis in the past and <a href="https://www.adafruit.com/product/420">Adafruit’s LED Matrix panel</a> seemed like a good medium to view the weather on before going outside.</p><p>The Raspberry Pi is a small computer <a href="https://www.adafruit.com/product/3400">available for as little as $10</a>. Adafruit’s LED matrix uses a HUB75 display driver. The HUB75 has 16 pins, 6 for specifying the color of an LED, 4 — A, B,C and D — for selecting line address, 3 ground, 1 OE / output enabled, 1 clock pin and 1 strobe pin. I used the HUB75 to interface between the Raspberry Pi and the LED matrix panel.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/970/0*cHhr7rm-usoGaC32." /><figcaption>32x16 LED matrix panel with HUB75 connector interface</figcaption></figure><p>First, I needed the weather. Instead of attaching temperature and humidity sensors to my Raspberry Pi, I decided to get the forecast from the Dark Sky API because I was already using their app, and the forecasts seemed accurate enough.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3f9dc16954a406e1097fc8ba004b064f/href">https://medium.com/media/3f9dc16954a406e1097fc8ba004b064f/href</a></iframe><p>As a programmer who commits code publicly, I try to avoid adding literal API keys to my source code. A straightforward way of passing API keys to source code is by creating a bash script that assigns your key to an environment variable, and sourcing it at setup or runtime. I set the API_KEY as an environment variable, and sourced it in my startup script.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1924cb010096979f0da057b016286e37/href">https://medium.com/media/1924cb010096979f0da057b016286e37/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ab800bbff17afadbb45f950565f9c697/href">https://medium.com/media/ab800bbff17afadbb45f950565f9c697/href</a></iframe><p>What good is an LED matrix panel without the ability to turn the LEDs on? I wired up my Raspberry Pi, and connected it to the HUB75 using Henner Zeller’s <a href="https://github.com/hzeller/rpi-rgb-led-matrix/blob/master/wiring.md">wiring instructions</a>.</p><p>The HUB75 expects 5V communication, but the Raspberry Pi only outputs 3.5V through its GPIO pins. At first, I didn’t believe this, and wired the Raspberry Pi pins directly to the HUB75. But the signal strength wasn’t strong enough, so I picked up 4 <a href="https://www.digikey.com/product-detail/en/sparkfun-electronics/BOB-12009/1568-1209-ND/5673795?WT.srch=1&amp;gclid=Cj0KCQjwn-bWBRDGARIsAPS1svsTvrpaRMCqBJEKIWftF4UTyzTlWlvi3NcbpckNW5pMKSz6kbNiK78aAkndEALw_wcB">level converters</a> and soldered them to the <a href="https://www.sparkfun.com/products/116">breakaway headers</a> that connected to my breadboard. Each level converter boosted the voltage from 3.5V to 5V for 4 pins, so 4 converters allowed me to boost the signal for up to 16 pins. Alternatively, the <a href="http://www.electrodragon.com/product/rgb-matrix-panel-drive-board-raspberry-pi/">MPC1073</a> and a CR1220 battery would have done the trick.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HlJ3awmGApcnhLseXs-qNg.jpeg" /><figcaption>mess of wires</figcaption></figure><p>When debugging code, you can look at log files and console output, but how do you debug hardware? One way is by using a multimeter. A friend at the <a href="https://www.recurse.com/">Recurse Center</a> let me borrow <a href="https://www.saleae.com/">Saleae’s</a> logic analyzer to verify the connections and voltages. After connecting some pins to the analyzer and ground, I verified that 5V was being sent to the HUB75 on all GPIO pins.</p><p>There are many ways one could envision projecting the weather onto a grid of LEDs. One approach is to map pixels to LEDs, turn LEDs on corresponding to pixels. Kindly, <a href="https://medium.com/@azilnik">Ari Zilnik</a> created some images, which I shrunk to a height of 16 pixels, corresponding to the height of the LED matrix panel, and converted to <a href="https://en.wikipedia.org/wiki/Netpbm_format">Portable Pixmap format</a>. While PPM is an uncompressed and inefficient format, it allows you to easily map every entry to a LED on the grid.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/450/1*TgfZj0y7k8-_P_KqT-y7vA.png" /><figcaption>Magnified weather icons created by Ari</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MiRHMWRwDc-J0YkqapWa_A.jpeg" /><figcaption>Ari’s cloud image scrolling on the LED Matrix panel</figcaption></figure><p>I found some <a href="https://github.com/hzeller/rpi-rgb-led-matrix">sample code online</a>, and wrote a bash script that executes the code so the weather images could be ingested and rendered on the LED matrix panel. I wrote the script to re-execute every time the image changed, <a href="https://en.wikipedia.org/wiki/Reactive_programming">a form of reactive programming</a>.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/61f0f58719039dc68ec593d943094792/href">https://medium.com/media/61f0f58719039dc68ec593d943094792/href</a></iframe><p>It’s really nice to be able to plug in the Raspberry Pi, connect it to the LED matrix panel, and have it display the weather without having to interact with it.</p><p>To make the code run on boot and to prevent polling the API too often, I created a <a href="https://www.raspberrypi.org/documentation/linux/usage/cron.md">crontab</a> to manage the code on the Raspberry Pi.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2de6e64d6d27c3535b7e18940dcfbabb/href">https://medium.com/media/2de6e64d6d27c3535b7e18940dcfbabb/href</a></iframe><p>Useful weather information can come in the form of images and text. To display text, I considered creating a PPM file for every character, and pasting them together to form words, but then I decided that would be too tedious. Instead I found <a href="https://pillow.readthedocs.io/en/5.1.x/">Pillow library</a> that lets you draw text onto an image, and found a font that shrinks well to draw text on the 32x16 matrix panel.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cMkyseDsQrToPxVDlQkEHg.png" /><figcaption>weather banner</figcaption></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f44ba518441ba6b1de2d35ade9283a3f/href">https://medium.com/media/f44ba518441ba6b1de2d35ade9283a3f/href</a></iframe><p><a href="https://github.com/redSlug/weather-reporter">Currently</a>, more detailed weather information is sent to the LED matrix, but it could easily be expanded in the future to display any other bit of information!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ce9281dc67a9" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>