Calibre “read next” query

I read a lot, and a common problem I have is keeping track of the series I’m currently reading. For a while I’ve toyed with the idea of writing a Calibre plugin that would allow me to see books that belong to a series which I’ve started but haven’t caught up with (I rate books as I finish them, but parsing my library at a glance to see what comes next is difficult). Today I found the Multi-Column Search plugin and it turns out to have exactly what I need to solve this problem: a freeform SQLite field.

select id from (
  select *,
    row_number() over(
      partition by series order by series_index asc
    ) row_num
  from (
    select
      b.id, bsl.series, b.series_index, r.rating
    from books b
    inner join books_series_link bsl on b.id = bsl.book
    left join books_ratings_link brl on b.id = brl.book
    left join ratings r on brl.rating = r.id
  ) where rating is null
)
where row_num = 1 and series_index > 1

This script will filter the library to include the next unread (unrated) book in your library from each series that has at least one book that has been rated. It’s a little uglier than I would have liked, since I had to use one long query instead of CTEs, and I would have liked to be able to return them in order (maybe by overall average score), but due to limitations in the plugin this is as good as it’s going to get. Even so, I can tell it’s going to be super useful.

Book review: 京都寺町三条のホームズ vol. 4 (Holmes of Kyoto)

Whoops, I finished this one kind of a long time ago. I’ve already finished another whole book and I’m partway into the next. I guess I have to say my overall opinion of this one was not that great, and maybe that has something to do with why it’s taken me so long to write about it. Aside from the super difficult fourth chapter of volume 1, the first two chapters here were probably the hardest to date. This volume also introduces Rikyuu (who was incorporated much earlier into the anime) and he’s honestly pretty unlikable…he’s intentionally cruel from the moment he appears, and it doesn’t even seem to be a cover for some deeper character flaw, which would at least make him somewhat relatable. Holmes often admits to being 腹黒い but as far as we’ve ever seen, it’s in response to bad behavior rather than just a constant state. By the end of the book, Rikyuu has come to accept Aoi to a certain extent but he needs to be taken down a peg if he’s going to become a regular character.

Aoi’s development in this volume is nice though. There’s a great scene where she’s challenged (pretty rudely) to prove herself as an appraiser and ends up passing with flying colors. I wish there was a bit more relationship development but I guess they do call this a “slow romance” so I suppose I’ll hold out for something else in vol. 5.

I do think I’ll be putting this series on hold for a little while though. It’s a bit of a bummer to stop now that I’m finally all caught up (the anime’s last episode is also this book’s last chapter) but I do enjoy reading it and I would like to continue enjoying it rather than getting burned out.

YMD Revisited

In Year, Month, Day, I explained an annoying problem with Javascript dates, and outlined the solution I took to avoid it in Moyase (which only needs to deal with dates in local time, and shouldn’t care if you move your device across timezones). Well, as it turns out, even this solution was not foolproof, and I totally should have seen it coming.

See, Date.toISOString() does indeed return a pretty nicely-formatted string that I can carve up and use for date components…the (obvious, in retrospect) problem is that it gives it to you in UTC time with a timezone offset, which can very well be a totally different calendar day than in local time. I probably would have never noticed this until I found myself on the other side of the world at some point in the future, or happened to be working in the app very early in the morning, so I’m very lucky to have a friend in Australia as an early adopter; she noticed that at certain times in the day, her work would be counted towards the previous day and her calendar wouldn’t display the right dates.

The fix ended up being pretty simple; instead of this:

return date.toISOString().substr(10);

I went with this instead:

return [
    String(date.getFullYear()).padStart(4, '0'),
    String(date.getMonth() + 1).padStart(2, '0'),
    String(date.getDate()).padStart(2, '0'),
].join('-');

With this, the app works correctly no matter the timezone or time of day. Hopefully this is the last time I have to think about this problem.

Google’s deliberate dishonesty about Translate

So, Google’s Fall lineup for their Pixel phones just dropped.

I use a Pixel 3 myself and I quite like it. I’m not in the market for a new phone right now but I will probably stick with the brand in the future. But for some reason every new update comes with a segment on how Google Translate will improve your phone experience, and it’s always quite frustrating. Google translate is bad, and it’s difficult to explain just how bad it is to someone who only speaks one language, or who only has experience with one language of a source/target pair — for example, if I see an English or Japanese sentence that was produced with Translate, I can identify it immediately, but I’d have no clue whatsoever when looking at a Thai or French sentence.

Sometimes I hear people say “Google Translate is a bad fit for Japanese, but it’s great at other languages”. I can’t personally refute this, so fortunately at times like this I can refer to this excellent article that shows how Translate isn’t necessarily better at dealing with other languages, it’s just that the problems it has are different problems.

The thing that constantly baffles me is that surely Google themselves would know that Translate isn’t a product that deserves first billing, right? They’re a global company that offers support in many many languages, and I can tell you for a fact that they don’t use Translate themselves when localizing their services for their target regions. It’s inconceivable that none of the higher-ups at Google have ever bothered to check to make sure that it actually works before pushing it so hard.

Well, today (thanks to the video above), it became abundantly obvious that they do know it’s broken, and it’s all thanks to Marie Kondo.

Continue reading →

は・が・も: The Focus Particles

“Quick question; what is the difference between は and が?”

It’s a quick question, to be sure, but it doesn’t have a quick answer. Canned lines like “は is the topic particle” or “が is the subject marker” are rarely of any help; the English and Japanese notions of “subject” don’t map 1:1 to each other, and the concept of grammatical topic is unlikely to strike home intuitively for a native English speaker. These one-line explanations are perhaps useful to people who have studied linguistics formally, but as a fan of more naturalistic language learning processes I (personally) never find them to be helpful, and I have no interest in diving into theory in order to make sense of them.

My chosen strategy was to tolerate the ambiguity and just read until I had had enough exposure to the Japanese language that I was able to form a somewhat intuitive understanding of these two particles (plus one more which I feel is often overlooked despite serving a similar function). You can absolutely do this too, and in fact I would strongly recommend that rather than approaching the problem by trying to learn “when to use は vs が”, you instead pump the brakes on output and focus on getting exposure to a LOT of the language so you too can build up this intuition.

However, since I fully recognize that I’m probably a little weird for being comfortable with this kind of delayed gratification (and since the question above is just so, so common), I thought I’d try to put into words the simple one-line rules that I personally use to conceptualize these two (or three) tricky particles.

Continue reading →

Getting out of the output rut

I still have a long way to go before I can call myself “fluent” in Japanese, by any definition. While there are many areas in which I can smoothly follow along with no issue, every time I crack a book that deals with an unfamiliar domain or subject, it hits me all over again just how extensive my English vocabulary actually is, and how lacking my Japanese vocabulary is in comparison. But my “input fluency” is far and away better than my “output fluency”, and this is a point that I’ve been struggling with for some time now.

The underlying idea of extensive reading is that after enough exposure to native material, you’ll not only become able to intuitively understand your target language, but you will also reach a point where you can suddenly start to produce it as well. It’s taken a long time, but I do feel like I’ve started to see the fruits of my labor in this respect. I’m able to communicate effectively with people online (albeit still with some difficulty and a lot of uncertainty). However, I’m keenly aware of the fact that if I were to have a face-to-face conversation, in real time and without the benefit of a sentence bank, I would be floundering. I’d like to fix that.

Continue reading →

Sekiro’s straw doll

A youtuber I follow recently uploaded the video below. There’s an “unsolved mystery” regarding the writing on a talisman that features in the model, but a bit of digging around on Japanese internet led me to some interesting discoveries. The following text was originally posted as a comment on the video itself, but I figured I would preserve it on my own blog as well since it involved a decent amount of research.

The “writing” on the talisman has its roots in Daoist magic (符籙 in Chinese, 呪符 in Japanese; English wikipedia has an article on it called “Fulu”), where the symbols are basically formed from kanji components but don’t actually make up real characters at all. These talismans are usually written in seal script, which ranges from “I can read it if I squint” to “how the heck is that supposed to be the same character”, but even so, the writing here is really more like drawing ; while it does contain valid characters like 竜 (dragon) and 王 (king), they aren’t arranged in such a way to suggest that they’re intended to either produce composite kanji nor that they should be interpreted on their own. There are also some other characters which are likely chosen for their appearance alone, like the one that looks like 丑 missing its bottom stroke, or 弗, which can be taken to mean “dollar” but considering the time period I think it’s more likely just the right-hand component of something like 沸. Other parts have no basis in writing at all, like the mirrored squiggles that extend from the bottom of the 田 character, or the cartouche that encloses the bottom two thirds.

Here’s a post (all in Japanese unfortunately) that has some interesting insights into this talisman and also some others that are found elsewhere in the game:

One other thing I’ll point out, is that this guy is definitely a wara-ningyou (lit. straw doll), but he’s not constructed in the typical way of tying together two straight bundles of straw. He’s actually made from a shimenawa, which is a type of rope which is used to cordon off sacred areas and provide protection from evil. The talisman itself (according to that link above) is a warding-against-evil type, though the author points out that depending on how the talisman is affixed, the effect can be reversed, resulting in an invitation for possession by an evil spirit. It’s not obvious which is the case here, but it’s an interesting thing to consider.

Book review: 青春ブタ野郎はバニーガール先輩の夢を見ない (Rascal does not dream of Bunny Girl Senpai)

This is one of those titles that’s enough to make me rule out the series at first blush, which is almost exactly what happened a couple of years ago when the anime first launched. I don’t remember what changed my mind about it, but it ended up being one of my favorite shows and I’ve been wanting to continue with the novels for some time now. Since Kate recently watched it (for the first time) I took the opportunity to rewatch it (without subtitles this time), and once I finished the anime I decided this was as good a time as any to pick vol. 1 as my next book this year.

As good as the anime is, honestly the old adage “the book is always better” still holds very true here. All the key scenes and plot beats are present in both, but the writing feels sharper and the dialogues always have a few extra lines which, while it makes sense to cut them in order to fit an episode’s runtime, are often delightful and hilarious and I frequently found myself grateful that I decided to read the books from the beginning rather than starting at vol. 6 (which picks up immediately after the end of the show). The anime does a great job of conveying the two leads’ chemistry, but it feels extra charming here for some reason, and the side characters feel even more well-developed. Specifically, I felt that the (still ridiculous) “Schrodinger’s cat” explanation was a bit better justified in the book, and that the stakes of the final arc felt higher and the payoff more satisfying.

I’ll definitely be continuing the series pretty soon and would highly recommend it (the first five books have been translated into English as well).

Book review: 京都寺町三条のホームズ 3 (Holmes of Kyoto)

Three books in, and I’m starting to feel like writing individual reviews for each entry in a long series might not be all that sustainable, especially considering 1) the consistent quality of each entry and 2) the fact that as my reading speed continues to improve, the number of books I can read in a short amount of time will also continue to increase. Perhaps the main factor is that I’m still in review mode, and even though I thought I would be in uncharted waters with the end of this book, apparently I actually need to finish the first four books in order to completely catch up with the anime. (It seems I did know this at one point but must have forgotten).

For now, I’ll at least say that this volume was as good as ever; the parts that were adapted for the anime were even better in the source material, and of course the parts that didn’t make the cut were were a welcome surprise whenever they appeared.

Translating Moyase with Deepl

I recently added localization support to Moyase and wrote a Japanese locale file to test it with. Just for fun, I thought I would take the translation strings and run them through a machine translation service to see how it fared. The results are not dramatically bad, but they definitely aren’t good.

Moyase’s localization files are available on Github. The Deepl translation I made for this video is available in my recycle bin.