๐Ÿ—ป James Van Dyne

โœˆ๏ธTrips ๐Ÿ—บ๏ธMaps โœ๏ธ๏ธBlog ๐Ÿ”—๏ธ๏ธLinks ๐ŸƒRuns ๐Ÿ‘‰Now
  • ๐ŸกHome
  • โœˆ๏ธTrips
  • ๐Ÿ—บ๏ธMaps
  • โœ๏ธBlog
  • ๐Ÿ”—๏ธLinks
  • ๐ŸƒRuns
  • ๐Ÿ‘‰Now
  • โœ๏ธArticles
  • ๐Ÿ“ค๏ธReplies
  • ๐Ÿ’ฌStatus
  • ๐Ÿ”–๏ธ๏ธBookmarks
  • ๐Ÿ—บCheckins
  • ๐Ÿ“…The Week
  • ๐Ÿ–ฅTech
  • ๐ŸŒฒSustainability
  • ๐ŸƒRunning
  • ๐Ÿง Thoughts
  • ๐Ÿ‡ฏ๐Ÿ‡ตJapan
  • ๐Ÿ’กTIL
  • โ›ฐTanzawa
  • ๐ŸกHome
  • โœ๏ธArticles
  • ๐Ÿ“ค๏ธReplies
  • ๐Ÿ’ฌStatus
  • ๐Ÿ”–๏ธ๏ธBookmarks
  • ๐Ÿ—บCheckins
  • ๐Ÿ“…The Week
  • ๐Ÿ–ฅTech
  • ๐ŸŒฒSustainability
  • ๐ŸƒRunning
  • ๐Ÿง Thoughts
  • ๐Ÿ‡ฏ๐Ÿ‡ตJapan
  • ๐Ÿ’กTIL
  • โ›ฐTanzawa
  • TIL: English and GEOS Reference Points Opposite of Each Other

    Jul 02, 2021
    by James
    This post is less a TIL and more of a I knew that and I don't want to forget it again and stems from a bugfix in Tanzawa.

    In English when we refer to a geo-coordinate we usually say it in latitude, longitude order. The reason why we say coordinates in this order is we could measure latitude accurately (via astronomical measurements) before longitude. Frontend mapping libraries like leaflet.js keep this familiar ordering. i.e. plotting points on a map takes a latitude/longitude array and events have a latlng property for referencing points.

    GEOS, the open source geometry library used in most GIS (include GeoDjango) applications doesn't think of points in those terms, but as a graph of x,y coordinates.ย  As such if you when you're working with data across these boundaries it's important to not mix up your ordering.

    When instantiating a Point it's tempting to just pass in floats directly. But if you do that it's easy to mix up the ordering , so I've started make sure I always use the keyword argument name to reduce mistakes.

    from django.contrib.gis.geos import Point
    
    # Keep our familiar lat/lon ordering without messing up the data point.
    point = Point(y=35.31593281000502, x=139.4700015160363)
    ๐Ÿ”—permalink 1 interaction
  • The Week #51

    Jun 29, 2021
    by James
    • A Roller coaster? The Great Crash in 1929? I keep trying to find the right way to describe this week, but I can't. Most everything that was under my control went well. Those that weren't, less so.
    • Japan is handling vaccine distribution in a very measured way. There's basically 3 groups of people getting vaccines right now: the elderly, those with pre-existing conditions, and those that work for large companies. If you are none of those, tough luck. To get a vaccine outside of working for a major company, you need a voucher. My voucher is supposed to come sometime next month, but I won't be able to get an appointment until mid-August at the earliest. Which will have me fully vaccinated my October-ish? Maybe?

      When I postedย  that I found a clinic that would give a vaccine to anyone, even without a vaccine I couldn't believe it. I could get fully vaccinated before the Olympics and take back 3 months of 2021. I had an appointment for 30th.

      But then I saw reports that the health authorities found out and told them to start canceling reservations for people outside from outside of the ward. Existing reservations seemed to be fine for a couple of days. Then the health authorities dropped the hammer on them and they've been forced to turn away everything without a voucher and everyone from outside the ward.

      And just like that. Poof. My hope for getting vaccinated this summer vanished. Gutted. Who knows, maybe once I get my golden ticket in a couple of weeksย  I'll find a clinic that'll let me get vaccinated earlier.ย 

      Silver lining is that I found out I'll get turned away at the door before taking the day off work and making an hour-ish trip train ride into Ikebukuro. I also won't ended up being unable to get a second shot or have to make a trip to Ikebukuro to get a stamp on my voucher so I can get a second shot.
    • I joined Leo for his first field trip to Kodomo no kuni ( Kid country?) Check the link, they got all sorts of slides, trains, and so forth. We watched the cows, ran up and down a big hill, and Leo bounced on a white bouncing dome. I definitely want to go back when it's cooler and when we're not with a huge group. I expanded my checkin to a proper blog post, which is something I want to do more often.
    • The issue of Web+DB Press that I wrote an article for is finally release for sale. I haven't gained any new followers or gotten mentions, so I assume people aren't running into any issues following along.
    • Another work update โ€“ I was the guest this week on BPZM, an internal company podcast(?) / show. It was fun to shoot the breeze in Japanese. One thing I'd like to get better at is off-the-cuff explanations of things in Japanese without having to stop and think. The largest issue ( I think) is I think of how to explain in, then have to reverse the order of some of the explanation for it work in Japanese and I derail my train of thought.
    • I'm trying to focus less on each day and more on the week. I'm not sure if it's helping, but I did manage to run twice this week. Compared to the previous weeks (months) of 0 runs, it's a vast improvement. Yay me.
    ๐Ÿ”—permalink 2 interactions
  • Checkin to Kodomo no Kuni (ใ“ใฉใ‚‚ใฎๅ›ฝ)

    Kodomo no Kuni (ใ“ใฉใ‚‚ใฎๅ›ฝ) 35.56040842396944 139.487338003306
    Jun 28, 2021
    by James
    in Yokohama, Kanagawa, Japan
    We went on Leo's first "ensoku" (field trip) with his pre-school. Originally we were supposed to go to the beach, but with covid-19 they don't want people going to the beaches, so we had it at Kodomo no Kuni instead.

    Kodomo no Kuni is this huge park in Yokohama close to Tokyo. Inside they've got some huge jungle gyms, different pedal-powered rides, a full-on dairy farm and heaps of open space to run and explore in. You can buy the milk (to drink on the spot) and soft-serve, which I believe comes from the cows (they have a dairy farm, so it would make sense).

    Since we were with a big group, we just played in this huge field / hill and went and saw the cows. The cows are a major attraction, so much so that the train that comes to Kodomo no Kuni is cow themed.

    Next time I want to go by the cow-themed train!

    The field and huge ground that we played


    The view from the top of the hill. The white domes are bouncy.


    The cows taking a rest
    ๐Ÿ”—permalink 8 interactions
  • Jun 27, 2021
    by James
    Enoden Monaka. Love the packaging of these. The classic style tickets are great.

    Enoden Monaka
    ๐Ÿ”—permalink
  • ๐Ÿ”— Newsstand

    Jun 26, 2021
    by James
    Google News RSS reader for Mac OS 9 More than 200 curated topics Top news available for 24 countries Designed with an Apple Platinum interface Natively written in Mac OS 9
    The world needs more software like this. So clean and with minimal system requirements. Lovely.
    1. Tagged with
    2. macos
    3. computing
    ๐Ÿ”—permalink
  • Checkin to SOTETSU GOODS STORE ไบŒไฟฃๅท

    SOTETSU GOODS STORE ไบŒไฟฃๅท 35.46294384340541 139.5316490290749
    Jun 26, 2021
    by James
    in Yokohama, Kanagawa, Japan
    ใใ†ใƒ‹ใƒฃใƒณโค๏ธ
    ๐Ÿ”—permalink 3 interactions
  • Checkin to ๅ…ซๅนกๅฑฑๅ…ฌๅœ’

    ๅ…ซๅนกๅฑฑๅ…ฌๅœ’ 35.43180057485677 139.4920816260251
    Jun 26, 2021
    by James
    in Yokohama, Kanagawa, Japan
    Park time. ๐Ÿฅต
    Double wide slide
    ๐Ÿ”—permalink 4 interactions
  • Jun 22, 2021
    by James
    Found a clinic in Ikebukuro (Tokyo) thatโ€™ll vaccinate people without their voucher and managed to get a slot before it filled up. 7-days until V-day! My voucher should be coming in 3 weeks, so just in time for the second jab. Excited doesnโ€™t begin to describe how I feel.
    ๐Ÿ”—permalink 3 interactions
  • The Week #50

    Jun 22, 2021
    by James
    • It was Father's Day this week. I made chicken fajitas for the family and they were a hit. I was also able to talk with both of my dads (father/step-father) for about 2 hours total. It feels like it's been ages since I've been able to focus and talk with them. I always say I should do it more often, but for some reason, I don't.
    • I got the physical copy of Web+DB Press that includes my article on getting started with GraphQL and Django. It took a lot of work to edit the piece down to 8 pages, but in the end I believe we were able to whittle away the weaker parts of the article and I could say everything I wanted. Seeing your name in print never gets old.
    • Pete opened the first issue on Tanzawa not opened by me asking some questions. It made me realize that I should add screenshots and talk about Tanzawa supporting Micropub/Indieauth/Webmentions so you can post with whatever client you'd like.
    • I find myself wanting to use Email more. I don't really use it โ€“ in fact I can count the number of emails I've sent at work in the 4+ years I've been there: 0. Everything happens via Slack or some web interface. I wonder if there isn't a way for me to handle more of async tasks via email to standardize my workflows better?
    • Jacob (who seems to make a weekly appearance on this column) told me about this podcast where they asked the question "What if the newscycle was 100 years โ€“ what would the story be?".ย  Think, you get to ignore the politics of the day, what's the big story? Their answer was that it would likely be the doubling of the average human lifespan.

      This got me thinking โ€“ so much of our life seems to get lost in the daily battles. Often enough that we lose sight of the bigger trends over the weeks, years, decades. Does focusing on too small of a timescale make it difficult to achieve your goals? Would focusing purely on getting things right for the week/year/decade make each day more successful, on average?

      I think it might. We tell ourselves we need to do X everyday (run, eat better, whatever). But we slip up one day and beat ourselves up. Rather than focusing on the 5 days we were successful that week, we dwell on that time we messed up. It all gets you demotivated. I'll have to experiment with reframing things to longer timescapes over the coming weeks and see how it turns out.
    ๐Ÿ”—permalink 1 interaction
  • How to Pipe Python stdout with xargs

    Jun 21, 2021
    by James
    When writing instructions for getting started with Tanzawa, users needed a way to set a unique SECRET_KEY in their environment variable configuration file. Initially I had a secret key entry in the sample file with some instructions to "just modify it". But that felt like I was just passing the buck.

    What I wanted to do was to generate a unique secret_key and output it to the .env file. Outputting just the secret key is simple, you can just use >> and append output to an existing file. But I wanted to use my Python secret key output as an argument to another command.

    I did it as follows:

    python3 -c "import secrets; print(secrets.token_urlsafe())" | xargs -I{} -n1 echo SECRET_KEY={} >> .env

    1. Use the Python secrets module to generate a secure token.
    2. Pipe the output to xargs.
    3. -I is "replace string" and "{}" is the string we want xargs to replace. -n1 limits us to a single argument.
    4. xargs executes and takes our Python output as an argument and replaces the {} with it, giving us our desired string.

    Writing this now, I probably could have just used Python to include the SECRET_KEY= bit and forgone using xargs, but it was good practice anyways.
    ๐Ÿ”—permalink
Previous 139 of 360 Next
Reply by email
Powered by
๐Ÿ”Tanzawa

โ† An IndieWeb Webring ๐Ÿ•ธ๐Ÿ’โ†’
Photo of James Van Dyne James Van Dyne Japan

Web developer living in Japan.