JapanesePod101.com

Blog / March 2023

  • 31 March 2023Small fix on Review Summary screen

    The sorting and paging of the SRS Review Summary screen has been fixed.

    Thanks to ilya112358 for reminding me in Review Summary Multipage Bug #304.

    Server move, server woes

    We are working on moving the website to a new platform. Specifically to a LINODE compute instance. In theory this would provide a more reliable uptime than on shared hosting.

    I should write more about this later. This has kept me busy since February. The site is running fine on LINODE. The main blocker for me right now is I can no longer use the simple php mail() functionality since those kind of re-usable servers can have their IP flagged and the emails are blocked by the receiver mail servers (or something like that).

    In theory using SMTP email sending via Google servers would improve the reliability and delivery of the emails, so this is a good improvement. However I have been struggling this week trying to get GMail via SMTP with XOAuth2 working.

    I managed to send a few mails with PHPMailer, but the documentation is anything but clear to me. I havenĀ“t figured out a reliable way for the code to continue refreshing the OAuth tokens. Are there any other packages that I could use with step by step guide on how to set it up and refresh the tokens for a client app like this site?

    If I get really frustrated with this there is a simpler method where you can use an "app password" but this requires enabling 2-factor authentication and I hate this feature. I hate having to pickup my iPad or phone whenever I want to sign in GMail. At least the hassle is not worth it on a secondary email account - since this is not my main email account.

    If someone knows a good working example somewhere of implementing Google SMTP with XOauth2 and the token refresh part - that would be useful.

    I'll be honest I hate that stuff. I hate it with a passion. Every hour I have to spend doing devops/backend stuff, is an hour I could be sitting with FIGMA doing some app design and implementing actual real features on the site and I'm sorry to vent but I am seriously PISSED OFF right now that I haven't been able to do anything worthwhile on this site for two months at least? This small bug fix today was actually a relief, however minor that was.

    I have looked at a bunch of email services and they all cost money. Paying ~ 15 USD a month upfront just to send emails for a simple free web app to me is unacceptable. All these costs add up. Database backup, potential upgrade of the LINODE instance, etc.

    I looked at various free options, for example SendGrid's free tier is up to 100 emails per day. Unfortunately 100 emails/day is just about the minimum. At peak times the site has seen upwards of 60-80 signups in a day. So if you add "forgot password", "update passord" emails and so on, we're just barely under 100 emails/day.

    Google SMTP servers allow to send up to 500 emails for free per day (per rolling 24h to be precise). So this should be plenty for awhile... once I can get it working that is.

    Here is Froschroom by Mouse on Mars. 1994 baby! That should soothe my soul for a little while...

  • 16 March 2023Small and not so small fixes

    A few fixes from recent weeks:

    • Progress Chart fix for Old Edition RTK Supplement
      When using RTK Old Edition, the RTK Supplement lesson is now displayed correctly (Lesson 58 with 23 characters index #3008-3030). Thanks to Vinickw for issue #295 on github!

    • Minor tweak to RTK Edition selection
      The RTK Edition selection screen (in Account Settings) now displays frame number ranges so it's more obvious how the RTK indexes add up to 3030 / 3000 characters.

    • Fixed misspelled keyword
      Fixed a typo for keyword #1296 "facsimile". Thanks to peytontucker for issue #292 on github.

    From here on this will be mostly developer stuff, so feel free to skip. If you like the gory details though let's dive in :)

    Updates to the source code repository

    Fixing the keyword wasn't as easy as I hoped. I ended up refreshing an old script that has not been run in years. The script essentially combine data for RTK1+3, along with KANJIDIC2 and UNIHAN - and then output the kanjis table for the database.

    To be fair since the indexes for 5th/6th edition do not change, and data sources like KANJIDIC2 do not change that much over the years - the script kinda fell out of my radar.

    So here's a recap of some of the steps for those who are interested in the nitty gritty:

    • We need a "source of truth" for RTK1/3 data, so as not to lose any fixes that accumulate over time. To simplify this process I deleted old data files rtk1_data, and rtk3_keywords and consolidated this data into a single spreadsheet called "RTK Editions Compared".

    • This very useful spreadsheet was originally created by Chris/Katsuo (of the now closed RevTK Forums). Chris put the old & new edition indexes side by side, along with the old & new edition keywords. It was really helpful as a reference. The updated spreadsheet now has lesson numbers for both OLD and NEW editions, on every line - so it's easier to parse regardless of sorting order.

    • Since the spreadsheet is now input for all RTK-related data, it is now included in the repository. You can find it in src/data/datafiles/ (the .ods file can be opened in eg. LibreOffice).

    • Updated & fixed the kanjis_table.php script and added it to the repo.

    • The script was re-run on an up to date version of KANJIDIC2 and UNIHAN. Unihan is used to provide the stroke order for all the CJK Unified Ideograph characters that are not part of KANJIDIC2. KANJIDIC2 covers Japanese characters which is approx. 12K characters - while UNIHAN covers the entire CJK Unified range which is ~21K characters - which is what goes in Kanji Koohii database (as a reminder Koohii intentionally includes all the Chinese characters from the RSH/RTH books - all of them are part of CJK Unified Ideographs).

    • To make sure that the script works as intended and does not introduce new errors - I ran a diff between an export of the last live data and the script's output. The diff is viewable here. You'll see the first entry is the keyword typo fix. Interestingly there aren't many changes, even though I haven't run the script in years. There is like 25-ish characters, which are not part of RTK. Most of these have either had their stroke count updated (from Unihan), or the first/principal Onyomi was updated in KANJIDIC.

    So even though it was not terribly exciting work I am glad that it is done. My commitment to the community, as I have stated on the Patreon page, is that I maintain the open source repository github.com/fabd/kanji-koohii.

    While the open source repo was technically complete in that it includes a sample database, with the full kanjis table - it did not include some of the older scripts that I was either too embarrassed to share, or that were broken in some ways. So I am happy that the script was fixed and is now part of the repository.

    Since you read thus far I'll share with you a song by one of my favorite electronic music bands from the late 90's ... here is Stereomission from the Iaora Tahiti album by Mouse on Mars!

By Month