Full Width [alt+shift+f] Shortcuts [alt+shift+k]
Sign Up [alt+shift+s] Log In [alt+shift+l]
20
Tabbed Content Without JavaScript 2019-01-28 Creating tabs is a fairly trivial and common practice in web design, but many times it requires JavaScript to properly implement. Fortunately it is possible to create tabbed content with only using CSS. Live CodePen Example Sidenote: While this method is semantic and accessible, you might consider using a pre-existing plugin for tabbed data. This component tends to feel a little "stiff" compared to more fleshed out variations available. This pure CSS version is better suited as a fallback for when users have disabled JavaScript. The HTML The skeleton for this component is fairly basic - we just need the following structure: Parent element for each tab item Default radio input Label linked to corresponding input Inner content associated with each tab item Tab 1 Content goes here Full HTML for reference: <div class="tabs"> <div class="tab-item"> <input class="tab-input" type="radio" name="tabs"...
over a year ago

Improve your reading experience

Logged in users get linked directly to articles resulting in a better reading experience. Please login for free, it takes less than 1 minute.

More from bt RSS Feed

Installing OpenBSD on Linveo KVM VPS

Installing OpenBSD on Linveo KVM VPS 2024-10-21 I recently came across an amazing deal for a VPS on Linveo. For just $15 a year they provide: AMD KVM 1GB 1024 MB RAM 1 CPU Core 25 GB NVMe SSD 2000 GB Bandwidth It’s a pretty great deal and I suggest you look more into it if you’re interested! But this post is more focused on setting up OpenBSD via the custom ISO option in the KVM dashboard. Linveo already provides several Linux OS options, along with FreeBSD by default (which is great!). Since there is no OpenBSD template we need to do things manually. Getting Started Once you have your initial VPS up and running, login to the main dashboard and navigate to the Media tab. Under CD/DVD-ROM you’ll want to click “Custom CD/DVD” and enter the direct link to the install76.iso: https://cdn.openbsd.org/pub/OpenBSD/7.6/amd64/install76.iso The "Media" tab of the Linveo Dashboard. Use the official ISO link and set the Boot Order to CD/DVD. Select “Insert”, then set your Boot Order to CD/DVD and click “Apply”. Once complete, Restart your server. Installing via VNC With the server rebooting, jump over to Options and click on “Browser VNC” to launch the web-based VNC client. From here we will boot into the OpenBSD installer and get things going! Follow the installer as you normally would when installing OpenBSD (if you’re unsure, I have a step-by-step walkthrough) until you reach the IPv4 selection. At this point you will want to input your servers IPv4 and IPv6 IPs found under your Network section of your dashboard. Next you will want to set the IPv6 route to first default listed option (not “none”). After that is complete, choose cd0 for your install media (don’t worry about http yet). Continue with the rest of the install (make users if desired, etc) until it tells you to reboot the machine. Go back to the Linveo Dashboard, switch your Boot Order back to “Harddrive” and reboot the machine directly. Booting into OpenBSD Load into the VNC client again. If you did everything correctly you should be greeted with the OpenBSD login prompt. There are a few tweaks we still need to make, so login as the root user. Remember how we installed our sets directly from the cd0? We’ll want to change that. Since we are running OpenBSD “virtually” through KVM, our target network interface will be vio0. Edit the /etc/hostname.vio0 file and add the following: dhcp !route add default <your_gateway_ip> The <your_gateway_ip> can be found under the Network tab of your dashboard. The next file we need to tweak is /etc/resolv.conf. Add the following to it: nameserver 8.8.8.8 nameserver 1.1.1.1 These nameservers are based on your selected IPs under the Resolvers section of Network in the Linveo dashboard. Change these as you see fit, so long as they match what you place in the resolve.conf file. Finally, the last file we need to edit is /etc/pf.conf. Like the others, add the following: pass out proto { tcp, udp } from any to any port 53 Final Stretch Now just reboot the server. Log back in as your desired user and everything should be working as expected! You can perform a simple test to check: ping openbsd.org This should work - meaning your network is up and running! Now you’re free to enjoy the beauty that is OpenBSD.

6 months ago 69 votes
Vertical Tabs in Safari

Vertical Tabs in Safari 2024-09-26 I use Firefox as my main browser (specifically the Nightly build) which has vertical tabs built-in. There are instances where I need to use Safari, such as debugging or testing iOS devices, and in those instances I prefer to have a similar experience to that of Firefox. Luckily, Apple has finally made it fairly straight forward to do so. Click the Sidebar icon in the top left of the Safari browser Right click and group your current tab(s) (I normally name mine something uninspired like “My Tabs” or simply “Tabs”) For an extra “clean look”, remove the horizontal tabs by right clicking the top bar, selected Customize Toolbar and dragging the tabs out When everything is set properly, you’ll have something that looks like this: One minor drawback is not having access to a direct URL input, since we have removed the horizontal tab bar altogether. Using a set of curated bookmarks could help avoid the need for direct input, along with setting our new tab page to DuckDuckGo or any other search engine.

7 months ago 71 votes
Build and Deploy Websites Automatically with Git

Build and Deploy Websites Automatically with Git 2024-09-20 I recently began the process of setting up my self-hosted1 cgit server as my main code forge. Updating repos via cgit on NearlyFreeSpeech on its own has been simple enough, but it lacked the “wow-factor” of having some sort of automated build process. I looked into a bunch of different tools that I could add to my workflow and automate deploying changes. The problem was they all seemed to be fairly bloated or overly complex for my needs. Then I realized I could simply use post-receive hooks which were already built-in to git! You can’t get more simple than that… So I thought it would be best to document my full process. These notes are more for my future self when I inevitably forget this, but hopefully others can benefit from it! Before We Begin This “tutorial” assumes that you already have a git server setup. It shouldn’t matter what kind of forge you’re using, so long as you have access to the hooks/ directory and have the ability to write a custom post-receive script. For my purposes I will be running standard git via the web through cgit, hosted on NearlyFreeSpeech (FreeBSD based). Overview Here is a quick rundown of what we plan to do: Write a custom post-receive script in the repo of our choice Build and deploy our project when a remote push to master is made Nothing crazy. Once you get the hang of things it’s really simple. Prepping Our Servers Before we get into the nitty-gritty, there are a few items we need to take care of first: Your main git repo needs ssh access to your web hosting (deploy) server. Make sure to add your public key and run a connection test first (before running the post-receive hook) in order to approve the “fingerprinting”. You will need to git clone your main git repo in a private/admin area of your deploy server. In the examples below, mine is cloned under /home/private/_deploys Once you do both of those tasks, continue with the rest of the article! The post-receive Script I will be using my own personal website as the main project for this example. My site is built with wruby, so the build instructions are specific to that generator. If you use Jekyll or something similar, you will need to tweak those commands for your own purposes. Head into your main git repo (not the cloned one on your deploy server), navigate under the hooks/ directory and create a new file named post-receive containing the following: #!/bin/bash # Get the branch that was pushed while read oldrev newrev ref do branch=$(echo $ref | cut -d/ -f3) if [ "$branch" == "master" ]; then echo "Deploying..." # Build on the remote server ssh user@deployserver.net << EOF set -e # Stop on any error cd /home/private/_deploys/btxx.org git pull origin master gem install 'kramdown:2.4.0' 'rss:0.3.0' make build rsync -a build/* ~/public/btxx.org/ EOF echo "Build synced to the deployment server." echo "Deployment complete." fi done Let’s break everything down. First we check if the branch being pushed to the remote server is master. Only if this is true do we proceed. (Feel free to change this if you prefer something like production or deploy) if [ "$branch" == "master" ]; then Then we ssh into the server (ie. deployserver.net) which will perform the build commands and also host these built files. ssh user@deployserver.net << EOF Setting set -e ensures that the script stops if any errors are triggered. set -e # Stop on any error Next, we navigate into the previously mentioned “private” directory, pull the latest changes from master, and run the required build commands (in this case installing gems and running make build) cd /home/private/_deploys/btxx.org git pull origin master gem install 'kramdown:2.4.0' 'rss:0.3.0' make build Finally, rsync is run to copy just the build directory to our public-facing site directory. rsync -a build/* ~/public/btxx.org/ With that saved and finished, be sure to give this file proper permissions: chmod +x post-receive That’s all there is to it! Time to Test! Now make changes to your main git project and push those up into master. You should see the post-receive commands printing out into your terminal successfully. Now check out your website to see the changes. Good stuff. Still Using sourcehut My go-to code forge was previously handled through sourcehut, which will now be used for mirroring my repos and handling mailing lists (since I don’t feel like hosting something like that myself - yet!). This switch over was nothing against sourcehut itself but more of a “I want to control all aspects of my projects” mentality. I hope this was helpful and please feel free to reach out with suggestions or improvements! By self-hosted I mean a NearlyFreeSpeech instance ↩

7 months ago 82 votes
Burning & Playing PS2 Games without a Modded Console

Burning & Playing PS2 Games without a Modded Console 2024-09-02 Important: I do not support pirating or obtaining illegal copies of video games. This process should only be used to copy your existing PS2 games for backup, in case of accidental damage to the original disc. Requirements Note: This tutorial is tailored towards macOS users, but most things should work similar on Windows or Linux. You will need: An official PS2 game disc (the one you wish to copy) A PS2 Slim console An Apple device with a optical DVD drive (or a portable USB DVD drive) Some time and a coffee! (or tea) Create an ISO Image of Your PS2 Disc: Insert your PS2 disc into your optical drive. Open Disk Utility (Applications > Utilities) In Disk Utility, select your PS2 disc from the sidebar Click on the File menu, then select New Image > Image from [Disc Name] Choose a destination to save the ISO file and select the format as DVD/CD Master Name your file and click Save. Disk Utility will create a .cdr file, which is essentially an ISO file Before we move on, we will need to convert that newly created cdr file into ISO. Navigate to the directory where the .cdr file is located and use the hdiutil command to convert the .cdr file to an ISO file: hdiutil convert yourfile.cdr -format UDTO -o yourfile.iso You’ll end up with a file named yourfile.iso.cdr. Rename it by removing the .cdr extension to make it an .iso file: mv yourfile.iso.cdr yourfile.iso Done and done. Getting Started For Mac and Linux users, you will need to install Wine in order to run the patcher: # macOS brew install wine-stable # Linux (Debian) apt install wine Clone & Run the Patcher Clone the FreeDVDBoot ESR Patcher: git clone https://git.sr.ht/~bt/fdvdb-esr Navigate to the cloned project folder: cd /path/to/fdvdb-esr The run the executable: wine FDVDB_ESR_Patcher.exe Now you need to select your previously cloned ISO file, use the default Payload setting and then click Patch!. After a few seconds your file should be patched. Burning Our ISO to DVD It’s time for the main event! Insert a blank DVD-R into your disc drive and mount it. Then right click on your patched ISO file and run “Burn Disk Image to Disc...". From here, you want to make sure you select the slowest write speed and enable verification. Once the file is written to the disc and verified (verification might fail - it is safe to ignore) you can remove the disc from the drive. Before Playing the Game Make sure you change the PS2 disc speed from Standard to Fast in the main “Browser” setting before you put the game into your console. After that, enjoy playing your cloned PS2 game!

8 months ago 60 votes
"This Key is Useless Now. Discard?"

“This Key is Useless Now. Discard?” 2024-08-28 The title of this article probably triggers nostalgic memories for old school Resident Evil veterans like myself. My personal favourite in the series (not that anyone asked) was the original, 1998 version of Resident Evil 2 (RE2). I believe that game stands the test of time and is very close to a masterpiece. The recent remake lost a lot of the charm and nuance that made the original so great, which is why I consistently fire up the PS1 version on my PS2 Slim. Resident Evil 2 (PS1) running on my PS2, hooked up to my Toshiba CRT TV. But the point of this post isn’t to gush over RE2. Instead I would like to discuss how well RE2 handled its interface and user experience across multiple in-game systems. HUD? What HUD? Just like the first Resident Evil that came before it, RE2 has no in-game HUD (heads-up display) to speak of. It’s just your playable character and the environment. No ammo-counters. No health bars. No “quest” markers. Nothing. This is how the game looks while you play. Zero HUD elements. The game does provide you with an inventory system, which holds your core items, weapons and notes you find along your journey. Opening up this sub-menu allows you to heal, reload weapons, combine objects or puzzle items, or read through previously collected documents. Not only is this more immersive (HUDs don’t exist for us in the real world, we need to look through our packs as well…) it also gets out of the way. The main inventory screen. Shows everything you need to know, only when you need it. (I can hear this screenshot...) I don’t need a visual element in the bottom corner showing me a list of “items” I can cycle through. I don’t want an ammo counter cluttering up my screen with information I only need to see in combat or while manually reloading. If those are pieces of information I need, I’ll explicitly open and look for it. Don’t make assumptions about what is important to me on screen. Capcom took this concept of less visual clutter even further in regards to maps and the character health status. Where We’re Going, We Don’t Need Roads Mini-Maps A great deal of newer games come pre-packaged with a mini-map on the main interface. In certain instances this works just fine, but most are 100% UI clutter. Something to add to the screen. I can only assume some devs believe it is “helpful”. Most times it’s simply a distraction. Thank goodness most games allow you to disable them. As for RE2, you collect maps throughout your adventure and, just like most other systems in the game, you need to consciously open the map menu to view them. You know, just like in real life. This creates a higher tension as well, since you need to constantly reference your map (on initial playthroughs) to figure out where the heck to go. You feel the pressure of someone frantically pulling out a physical map and scanning their surroundings. It also helps the player build a mental model in their head, thus providing even more of that sweet, sweet immersion. The map of the Raccoon City Police Station. No Pain, No Gain The game doesn’t display any health bar or player status information. In order to view your current status (symbolized by “Fine”, “Caution” or “Danger”) you need to open your inventory screen. From here you can heal yourself (if needed) and see the status type change in real-time. The "condition" health status. This is fine. But that isn’t the only way to visually see your current status. Here’s a scenario: you’re traveling down a hallway, turn a corner and run right into the arms of a zombie. She takes a couple good bites out of your neck before you push her aside. You unload some handgun rounds into her and down she goes. As you run over her body she reaches out and chomps on your leg as a final “goodbye”. You break free and move along but notice something different in your character’s movement - they’re holding their stomach and limping. Here we can see the character "Hunk" holding his stomach and limping, indicating an injury without the need for a custom HUD element. If this was your first time playing, most players would instinctively open the inventory menu, where their characters health is displayed, and (in this instance) be greeted with a “Caution” status. This is another example of subtle UX design. I don’t need to know the health status of my character until an action is required (in this example: healing). The health system is out of the way but not hidden. This keeps the focus on immersion, not baby-sitting the game’s interface. A Key to Every Lock Hey! This section is in reference to the title of the article. We made it! …But yes, discarding keys in RE2 is a subtle example of fantastic user experience. As a player, I know for certain this key is no longer needed. I can safely discard it and free up precious space from my inventory. There is also a sense of accomplishment, a feeling of “I’ve completed a task” or an internal checkbox being ticked. Progress has been made! Don’t overlook how powerful of a interaction this little text prompt is. Ask any veteran of the series and they will tell you this prompt is almost euphoric. The game's prompt asking if you'd like to discard a useless key. Perfection. Inspiring Greatness RE2 is certainly not the first or last game to implement these “minimal” game systems. A more “modern” example is Dead Space (DS), along with its very faithful remake. In DS the character’s health is displayed directly on the character model itself, and a similar inventory screen is used to manage items. An ammo-counter is visible but only when the player aims their weapon. Pretty great stuff and another masterpiece of survival horror. In Dead Space, the character's health bar is set as part of their spacesuit. The Point I guess my main takeaway is that designers and developers should try their best to keep user experience intuitive. I know that sounds extremely generic but it is a lot more complex than one might think. Try to be as direct as possible while remaining subtle. It’s a delicate balance but experiences like RE2 show us it is attainable. I’d love to talk more, but I have another play-through of RE2 to complete…

8 months ago 60 votes

More in programming

How to provide feedback on documents.

At Carta, we recently ran a reading group for Facilitating Software Architecture by Andrew Harmel-Law. We already loosely followed the ideas of an architectural advice process (from this 2021 article by the same Andrew Harmel-Law), but in practice we found that internal tech spec and architecture decision record (ADR) authors tended to exclusively share their documents locally within their team rather than more widely. As we asked authors why they preferred sharing locally, the most common answer was that they got enough feedback from their team that they didn’t want to pay the time overhead of sharing widely. The wider feedback wasn’t necessarily bad or combative. It just wasn’t good enough to compensate for the additional time it cost to process. This made sense from the authors’ perspectives, but didn’t work well for me from the executive perspective, as I was seeing teams make misaligned decisions due to lack of cross-team communication. As one step in reducing the overhead of sharing documents widely, I wrote up and shared this recommended process for providing feedback on documents: Before starting, remember that the goal of providing feedback on a document is to help the author. Optimizing for anything else, even if it’s a worthy cause, discourages authors from sharing their future writing. If you prioritize something other than helping the author, you are discouraging them from sharing future work. Start by skimming the document to understand its structure and where various kinds of topics are addressed. Why? This helps avoid giving feedback on ways the document’s actual structure diverges from how you imagined it would be structured. It also reduces questions about topics that are answered later in the document. Both of these sorts of feedback are a distraction during a discussion on a tech spec. In general, it’s better to avoid them. If you notice an author making the same significant structural mistake over several ADRs, it’s worth delivering that feedback separately. After skimming, reread the document, leaving comments with concerns. Each comment should include these details: What your suggested change or concern is Why you believe this is meaningful to address How important this seems (from ignorable nitpick to critical) If you find yourself leaving more than three or four issues, then you should either raise your threshold for commenting or you should schedule time with the individual to talk over the feedback. If the document is unreasonably weak, then it’s appropriate to nudge their leadership to dig into what’s happening on that team. The most important idea behind these steps is that your goal as a feedback giver is to help the document’s author. It is not to protect your team’s strategy or platform. It is not to optimize for your goals. It’s to help the author. This might feel wrong, but ultimately optimizing for anything else will lead to an environment where sharing widely is an irrational behavior. As a final aside, I think the user experience around commenting on documents is fundamentally wrong in most document editors. For example, Google Docs treats individual comments as first-order objects, similarly to how old version control systems like CVS tracked changes to individual files without tracking an overall state of the project. Ultimately, you want to collect all your comments into a bundle, then review that bundle for consistency and duplicates, and then submit that bundle as commentary, but editors don’t support that flow particularly well.

17 hours ago 1 votes
How (and Why) to Get a Bank Account in Japan

You can technically get by in Japan without a Japanese bank account. For those who are here on short-term visas, or who plan to move frequently from city to city, it’s perfectly possible to live and work in Japan without one. However, if you want to work a full-time job, rent an apartment, join social activities, or enroll your children in school, you’ll almost certainly need to make an account. Following is an overview on what you’ll need to open an account, some common problems foreigners encounter, and what banks will work best for your needs. If you don’t have a bank account . . . The “chicken-and-egg problem” is what many foreigners call it—that strange bureaucratic trap you encounter when moving to Japan. You need a local phone number to get an apartment, but you need a registered address to get a bank account, and you need a bank account to get a local phone number! Luckily, there is an order of operations that can get you all three as fast as possible. But let’s say you haven’t decided where you want to live yet, or there’s some other reason for delay. Can you get by in Japan without an account? Strangely enough, it’s not that difficult, thanks to Japan’s cash-based society. Getting paid Direct deposit is more common now, and most companies will also ask you to make an account with a specific bank to receive your paycheck. Nonetheless, they cannot require you to make an account with that bank. You are within your rights to insist on being paid to the account of your choice. Getting cash Be aware that Japan has two methods of getting cash from a machine: ATMs, which function generally like ATMs around the world, and cash machines, which are usually located in banks and are only usable with that bank’s cash card. For example, if you go into Mitsui Sumitomo and have a cash card for some other bank, you will not be able to use it. Many ATMs found at convenience stores, as well as Japan Post Bank ATMs, will allow you to withdraw yen from your foreign accounts. Of the various convenience store options, 7-Eleven ATMs are your best bet. There are some limitations: Depending on the ATM, additional fees may be charged Many ATMs can’t check your foreign account’s balance The single transaction withdrawal limit may be reduced—at Japan Post Bank ATMs, you can’t withdraw more than 50,000 yen from a foreign account at one time 7-Eleven ATMs do not allow you to freely select an amount to withdraw and instead require you to pick from options starting from 10,000 yen and up Using your foreign card In addition, most stores that accept credit or debit cards will also be able to process foreign-issued cards—at least, I’ve never had mine rejected. If the store is not large or is not part of a national chain, however, the odds of them not being able to process your card are higher. Additionally, some stores may not be able to support chips, so if your card does not have a magnetic stripe, you would be unable to use it. As a side note, one of the services that does not permit foreign credit cards is the one you’d least expect—Disneyland. If you want to purchase park tickets online, the website theoretically accepts most foreign cards, yet very few seem to actually work. Personally I got around this problem by using Klook, a third-party app that had no difficulty processing my credit card, and delivered my digital tickets without issue. Finding housing Finally, share-houses and other short-term, foreigner-friendly rental accommodations don’t require a Japanese bank account to rent. These often come furnished, may include utilities, and can be rented without the hassle of a deposit or key money. Of course, they will cost more overall than long-term housing, but they’re good options for those without a Japanese account. But you should make a bank account As you can see, it’s possible to live in Japan without a Japanese account, at least for a while. But it’s not convenient, and the longer you live in Japan, the more inconvenient it becomes. Renting Renting your own apartment with a long-term lease will almost certainly require a Japanese bank account. In this case, having a Japanese bank account and phone number is the bare minimum; they will also want to see your residency status, employment contract or income statement, and either guarantors or the endorsement of a guarantor company. In addition, while you can pay most utility bills with cash at a convenience store, it’s becoming more and more convenient to set up automatic withdrawal, with some companies attempting to discourage convenience store payments by applying a service fee for the paper bill. Automatic withdrawals also mean you’re less likely to miss a payment and have your gas turned off without warning, as happened to me! Employment Your employer will also want you to make a bank account, as almost all big businesses prefer direct deposits. Government benefits The government, at a certain point, requires you to have a local account. It’s how you can expect to receive your tax refund and any social benefits you may be entitled to, such as the child support allowance (jidou teate, 児童手当). Japanese society Aside from the basics of life, many social clubs, activities, and schools require participants to have bank accounts. This will depend somewhat on where you live. In Tokyo, my husband’s taiko club insisted that he set up monthly debits from a Japanese account in order to participate. My children’s public elementary school required us to make an entirely new account with their preferred bank, so that they could withdraw lunch fees. By contrast, in our new small town in Kansai, the children’s karate and ballet classes are cash-only. The school did ask us to make a new account at a regional bank for lunch fees, but when we were unsuccessful—a point I’ll explore below—they were fine with collecting the payments in cash. In short, it’s better to bite the bullet and make the account. The actual difficulty of doing so will depend on which bank you choose. The kinds of banks in Japan There are of course all kinds of banks in Japan, from online banks to large national institutions. From the immigrant’s point of view, however, there are several distinct categories. Japan Post Bank The Japan Post Bank (Yuucho Ginkou, ゆうちょ銀行) deserves a category of its own. Unlike other banks in Japan, the Japan Post Bank does not require six months residency or an employment contract in Japan to open an account. You must, however, have at least three months remaining on your residence card when you apply. In addition, if you have less than six months residency and no employment contract, your account will be treated as a non-resident account with limited services. There are branches all over Japan wherever a post office is; you can also open an account online. Conventional foreigner-friendly banks Several banks in Japan are well known for being foreigner-friendly and providing some English services. SMBC Trust Bank Prestia and SBI Shinsei Bank are the usual recommendations in this category. Both offer English-language online banking, and English support via chat. Online banks You can also select a bank that operates purely online (netto ginkou, ネット銀行). For simple bank procedures, such as acquiring a debit card and depositing your paycheck, these don’t operate much differently from conventional banks. Popular choices include: PayPay, which operates a thriving cashless payment service Sony Bank, which has 90,000 partner ATMs in Japan Seven Bank, the official online bank of 7-Eleven and has ATMs in every branch Japanese-speaking banks Aside from convenience, there’s really nothing stopping you from banking with any bank in Japan. You should be able to make an appointment at any branch and request their help in opening an account. Granted, this approach requires time, patience, possibly multiple appointments, and—if you don’t speak Japanese—a lot of translation. Nonetheless it can be done, and will probably even be necessary at one point or another, since jobs, schools, and activities in Japan may ask you to work with their preferred bank. What you’ll need to apply Typically, this is what you’ll need to open an account with a bank: Your residence card. This is always required. A second form of ID. This could include your My Number card, your student ID, your Residence Certificate (住民票, juuminhyo), or a utility bill or other document with your full name in katakana. The exact specifications for a second form of ID differ from bank to bank, so check their instructions carefully. An employment contract and/or Employee ID. For most banks, if you want to open an account before you’ve lived in the country for six months, you will need to provide proof of employment. A local phone number Do I need a hanko? A hanko (判子, also called an inkan 印鑑) is a stamp which, on many Japanese documents, serves as your official signature. Do you absolutely need to have one to open an account? Not necessarily. Some banks, such as Japan Post Bank, will permit you to start banking with only your signature. Should you buy and use one anyway? Yes, for several good reasons: You may need it later for more advanced procedures, such as renting an apartment, getting a loan, or car registration. If your signature doesn’t match exactly when you’re submitting paperwork in the future, your bank may reject it. A hanko will remain the same, as long as it is not damaged. If you damage or lose your hanko, the bank will require you to re-register the imprint so that they have a current copy on file. If you sign up for a bank account with your signature, but later acquire and use a hanko, this can lead to confusion with your bank. Again, a Japanese bank will reject paperwork with any inconsistencies. This may not seem like a hard thing to keep straight, but if and when you have multiple accounts in Japan, remembering which requires your signature and which requires hanko can be a hassle. Why not? Hanko are not that expensive, they make great souvenirs, and they’re an easy way to integrate. My own hanko has my surname in katakana, and receives a lot of interest from Japanese people due to its unique appearance. If you’re intimidated by the process of buying a hanko in person, you can order one online. I used Google Translate to buy mine at Shibuya Stamp Shop, but there are English websites available as well. Be careful not to buy a hanko that is self-stamping (such as a shachihata), as many banks will refuse to accept them. Additionally, you should make sure that you carefully store the hanko you use for bank accounts and use it only for bank accounts. It is fine to use one hanko for multiple bank accounts. People commonly have several hanko, each for different levels of tasks; you don’t want to be stamping delivery slips or kids’ homework with the same security device you use to control your finances! U.S. citizen requirements U.S. citizens and green card holders will require a few more documents, thanks to the Foreign Account Tax Compliance Act (FATCA). If you’re opening an account in person, you should bring your passport and social security card with you. If you’re opening the account online, expect to fill out additional forms to establish your TIN (Taxpayer Identification Number). Usually these forms will be requested by mail, which delays the so-called “online application” process considerably. For U.S. citizens and green card holders, it’s faster to apply for an account in person. Should I apply online? Quite a few banks now claim to offer online applications in English, to ease account opening procedures. But what is meant by an “online application” can differ hugely. By smartphone is best First, if you want to apply online, it’s best to have a smartphone with a domestic SIM. Smartphones are the main way consumers access the internet in Japan, so many solutions are built smartphone-first. You can often save several steps by using a smartphone. For example, if you apply via smartphone with SMBC Trust Bank Prestia, you have the option to take a selfie as one form of ID, which means you only need your residence card. Do note that the facial ID process can be finicky for these systems, and may reject your photo. If you use a computer or tablet, however, the bank requires two forms of ID. Seven Bank, as an online bank, also strongly prefers customers to use a smartphone; those who don’t have one can use a Debit Card and conduct transactions from its ATMs, but won’t be able to use their Direct Banking Service. Is it really online? “Applying online” isn’t always as simple as it sounds. Japan Post Bank and Sony Bank both allow users to make an account via the bank’s app, a process that they claim takes around 30 minutes. But Shinsei’s online application barely qualifies as such. While you do fill out the initial form on the website, it’s only so you can receive a printed application form in the mail around one week later. You’ll then have to send back copies of your IDs to the bank via mail, for an additional 7-10 business days of processing—at which point, you might be better served by visiting a branch with Google Translate. Online-only banks often have similar processing times for foreigners, but with an additional down side: since they’re online-only, there is no option to visit a local branch and hammer everything out in one go! These estimated application times also depend on everything going smoothly via the bank’s app or website, which is not guaranteed. Modern banks often rely on relatively new MyNumber card integrations, or “AI” facial/document recognition, and bugs are unfortunately common. Common problems Forewarned is forearmed, and in that spirit, here are some of the most common issues experienced by foreigners banking in Japan. Technical difficulties Personally I bank with Japan Post Bank, and am very happy with the service I receive—-except when I need to try and set up a new direct withdrawal online. For whatever reason, I’ve found that trying to access the forms via Chrome causes all sorts of problems. Switch to Safari, though, and suddenly everything works. Using VPNs, adblockers, or other common security extensions can also frequently cause issues with financial sites in Japan. Name issues If you take away one important thing from this article, let it be this. From the beginning, choose the Japanese version of your name and keep it consistent. It’s a given that if you do not have a Japanese name, you will need to spell it out in katakana. However, for many names there are several accepted katakana variations. For example, I prefer to spell my surname Callahan as カラハン (Karahan), but it was spelled (without my input) as キャラハン (Kyarahan) on my health insurance card. Fortunately I didn’t run into any issues and was able to change it later. However, that would have caused issues with opening a bank account, if I’d attempted to use my health insurance card as a secondary form of ID. Long names and middle names will also cause problems—unfortunately, these are mostly unavoidable. There frequently isn’t enough space in a form to write your name properly, either in the Roman alphabet or in katakana. You might be tempted to leave out your middle name whenever possible, but you risk your application not being accepted because it doesn’t match your full legal name. For me personally, a long legal name has been only a minor inconvenience. However, for my Sri Lankan neighbor, her long name created so many problems that she was unable to open an account at our local bank. Although she is a permanent resident and speaks Japanese fluently, even after three separate trips to the bank, she was still unable to open the account. Banks will also unfortunately have different recommendations in the event that your full name does not fit their paper or electronic application; some will ask that you fill in as much as possible and truncate, while others may concede and allow only your first and last names. Still other banks may require you to use your English name and not accept a primary katakana rendering. These mismatches can cause issues when attempting to connect accounts in the future, and those can usually only be solved with human help—perhaps a reason to consider banking at an institution that has physical branches. Kanji difficulties Several times I’ve been asked to create a new account with a regional bank that didn’t offer service in English. Both times, I was asked by bank employees to fill out several forms with my address written in kanji. Best practice, of course, would be to have already memorized my own address in kanji. In reality, I ended up copying it from the tiny writing on the back of my residence card. At the first bank, the kind employees carefully showed me how to write some of the more complicated kanji. At the second, I was mostly left to my own devices, and the subsequent scrawl caused my application to be rejected; they asked me to come back with someone who spoke, and wrote, Japanese. If you do need to open an account at a Japanese-speaking bank, try keeping a copy of your address in your phone, or even printing out the kanji version in large characters that are easier to copy. Of course, if you have a Japanese-writing friend who is willing to accompany you that day, that will also speed things along. I’ll add that the bank that rejected me was the same bank that my neighbor applied to three times. I wouldn’t describe my visit there as an ordinary banking experience in Japan; this particular branch is clearly unwilling to assist or accommodate foreign residents. A cash card is not a debit card Perhaps this isn’t a widespread misunderstanding, but it caught me by surprise: most banks provide only cash cards by default, and debit cards are opt-in. A cash card is not a debit card—it is good only for pulling cash out of a cash machine or ATM. Some banks, such as Prestia and Sony, do give you a debit card straight away. Others, such as Japan Post Bank, require a subsequent application for a debit card once the account is open. You can distinguish a cash card from a debit card by looking for a network logo such as Visa, Mastercard, or JCB. If it does not have one, it’s likely a cash card. Holidays and ATM times If you live or work near convenience stores, you shouldn’t have much problem withdrawing cash whenever you want. However, you should still keep an eye out for ATM working hours or your bank’s maintenance hours. For example, many ATMs are unusable over a portion of the New Year or Golden Week. Japan Post Bank shuts down completely for part of Golden Week—a shutdown that includes ATMs, online services, the smartphone app, and even your debit card! You should also keep an eye on time-sensitive withdrawal fees. Many ATMs will display a screen that shows one withdrawal fee for business hours, and another for early morning or late-night transactions. The difference is fairly small—a business-hour withdrawal may cost 110 yen, as opposed to a late-night withdrawal at 220 yen—but if you’re cost-conscious, it’s good to take note. Sending and receiving money internationally The cost of sending and receiving money internationally adds up quickly. Not only do Japanese banks often charge steep fees for currency conversion and wiring, but there’s yet more paperwork involved. If you enjoy a prestigious bank account, such as the Sony Bank and Shinsei Platinum accounts, then one of the perks is lowered or waived fees for international transfers. If you don’t, then an online transfer service like Wise is certainly faster and frequently cheaper. If you are interested in moving large amounts of money and want to avoid fees as much as possible, here’s a detailed breakdown of the average transfer rates for various institutions and accounts. Frequently-recommended banks Following are some of the banks most often recommended by other immigrants, with a brief overview of their pros and cons. Japan Post Bank Japan Post Bank is one of the easiest banks to open an account with when you first arrive in Japan. Pros Doesn’t require six months residency or an employment contract to open an account Branches all over Japan in the post offices Can open an account and check your virtual bankbook via apps No monthly maintenance fees Cons Service is mostly in Japanese Services may be limited and fees may be high during the first six months if you do not have an employment contract Have to apply separately for a debit or bank card Access to ATMs on post office grounds is limited to the hours for that branch, which can be inconsistent High fees for international transfers SBI Shinsei Bank Shinsei is a good choice for those who want some service in English, and who intend to send and receive money internationally. Pros English Internet banking and online service Foreign currency accounts with high interest rates Free ATM withdrawals up to five times a month If you have a higher-level account (Diamond, Platinum, Gold, or Silver) you can receive foreign currency remittances for free Cons The “online” application procedure is really more by mail Initially only given a cash card Standard accounts are charged 2,200 yen per remittance SMBC Trust Bank Prestia Prestia is ideal for those who want a full-service bank that offers a travel-friendly debit card. Pros English-language bank app, online service, and assistance for housing loans, investment, etc. If you apply for an account via the app, you only need your residence card as a form of ID (assuming you meet the six-month residency requirement) Upon opening an account, automatically get both a yen account and a foreign currency account Immediately receive a GLOBAL PASS Visa debit card that can be used domestically and overseas Cons Monthly maintenance fee of 2,200 yen unless you keep a minimum balance of 500,000 yen or meet other requirements Easily confused with SMBC Bank, but the services and branches are not interchangeable Sony Bank For those who’d prefer an online bank, Sony Bank offers another international-friendly debit card and a comprehensive rewards system. Pros Automatically get the Sony Bank WALLET cash card, which can be used internationally Has Club S, a three-tier rewards system based on the balance of your yen and foreign currency accounts. Platinum members can get perks such as 2% cashback, unlimited free cash withdrawals, waived transfer and remittance fees, etc. Cons Only online banking is available in English (the app is in Japanese) As an online bank it has no physical branch to visit Special note: the Rakuten credit card Rakuten also has an online bank. While this is less often suggested as a bank for new immigrants, it is one of the few places foreigners can easily apply for a credit card. Conclusion Like most bureaucratic processes in Japan, opening an account can take quite a bit of time and paperwork, but is ultimately doable, not to mention beneficial in the long run. To recap: If you intend to live and work in Japan for more than a few months, you should open a local bank account. Japan Post Bank doesn’t require six months residency or employment to open an account, as other banks do. Banks such as SBI Shinsei, SMBC Trust Bank Prestia, and Sony Bank have a reputation for being foreigner-friendly; however, with proper preparation, you can have an account at any bank in Japan. The greatest difficulties in banking tend to be name-related. You can avoid most of them by keeping your legal name and its katakana spelling consistent from the beginning, as well as obtaining a hanko before opening the account. U.S. citizens and green card holders should expect more paperwork related to FATCA. Judging by these banks’ English-language sites, they’re pushing non-Japanese-speaking customers towards applying online or via mail rather than visiting their branches. However, if you’re a U.S. citizen, or just don’t want to download yet another app, don’t be afraid to go in person. With the exception of one local bank, I’ve consistently had positive experiences with bank personnel—they’ve often gone above and beyond to help me, despite the language barrier. So long as you’re patient with the process, and do your research on bank requirements, then opening an account will swiftly be one more item checked off that moving-to-Japan list.

4 hours ago 1 votes
systems-mcp: generate systems models via LLM

Back in 2018, I wrote lethain/systems as a domain-specific language for writing runnable systems models, and introduced it with this blog post modeling a hiring funnel. While it’s far from a perfect system, I’ve gotten a lot of value out of it over the last seven years, because it allows me to maintain systems models in version control. As I’ve been playing with writing Model Context Protocol (MCP) servers, one I’ve been thinking about frequently is one to help writing systems syntax, and I finally put that together in the lethain/systems-mcp repository. More detailed installation and usage instructions are in the GitHub repository, so I’ll just share a couple of screenshots and comments here. Starting with the load_systems_documentation tool which loads a copy of lethain/systems/README.md and a file with example systems into the context window. The biggest challenge of properly writing DSLs with an LLM is providing enough in-context learning (ICL) examples, and I think the idea of providing tools that are specifically designed to provide that context is a very interesting idea. Eventually I imagine there will be generalized tools for this, e.g. a search index of the best ICL examples for a wide variety of DSLs. Until then, my guess is that this sort of tool is particularly valuable. The second tool is run_systems_model which passes the DSL (and an optional parameter for number of rounds) to the tool and then returns the result. I experimented with interface design here, initially trying to return a rendered chart of the results, but ultimately even multi-modal models are just much better at working with text than with images. This meant that I had the best results returning JSON of the results and then having the LLM build a tool for interacting with the results. Altogether, a fun little experiment, and another confirmation in my mind that the most interesting part of designing MCPs today is deciding where to introduce and eliminate complexity from the LLM. Introduce too little and the tool lacks power; eliminate too little and the combination rarely works.

15 hours ago 1 votes
How Cursor Indexes Codebases Fast

Merkle Trees in the real world

2 days ago 5 votes
a whippet waypoint

Hey peoples! Tonight, some meta-words. As you know I am fascinated by compilers and language implementations, and I just want to know all the things and implement all the fun stuff: intermediate representations, flow-sensitive source-to-source optimization passes, register allocation, instruction selection, garbage collection, all of that. It started long ago with a combination of curiosity and a hubris to satisfy that curiosity. The usual way to slake such a thirst is structured higher education followed by industry apprenticeship, but for whatever reason my path sent me through a nuclear engineering bachelor’s program instead of computer science, and continuing that path was so distasteful that I noped out all the way to rural Namibia for a couple years. Fast-forward, after 20 years in the programming industry, and having picked up some language implementation experience, a few years ago I returned to garbage collection. I have a good level of language implementation chops but never wrote a memory manager, and Guile’s performance was limited by its use of the Boehm collector. I had been on the lookout for something that could help, and when I learned of it seemed to me that the only thing missing was an appropriate implementation for Guile, and hey I could do that!Immix I started with the idea of an -style interface to a memory manager that was abstract enough to be implemented by a variety of different collection algorithms. This kind of abstraction is important, because in this domain it’s easy to convince oneself that a given algorithm is amazing, just based on vibes; to stay grounded, I find I always need to compare what I am doing to some fixed point of reference. This GC implementation effort grew into , but as it did so a funny thing happened: the as a direct replacement for the Boehm collector maintained mark bits in a side table, which I realized was a suitable substrate for Immix-inspired bump-pointer allocation into holes. I ended up building on that to develop an Immix collector, but without lines: instead each granule of allocation (16 bytes for a 64-bit system) is its own line.MMTkWhippetmark-sweep collector that I prototyped The is funny, because it defines itself as a new class of collector, fundamentally different from the three other fundamental algorithms (mark-sweep, mark-compact, and evacuation). Immix’s are blocks (64kB coarse-grained heap divisions) and lines (128B “fine-grained” divisions); the innovation (for me) is the discipline by which one can potentially defragment a block without a second pass over the heap, while also allowing for bump-pointer allocation. See the papers for the deets!Immix papermark-regionregionsoptimistic evacuation However what, really, are the regions referred to by ? If they are blocks, then the concept is trivial: everyone has a block-structured heap these days. If they are spans of lines, well, how does one choose a line size? As I understand it, Immix’s choice of 128 bytes was to be fine-grained enough to not lose too much space to fragmentation, while also being coarse enough to be eagerly swept during the GC pause.mark-region This constraint was odd, to me; all of the mark-sweep systems I have ever dealt with have had lazy or concurrent sweeping, so the lower bound on the line size to me had little meaning. Indeed, as one reads papers in this domain, it is hard to know the real from the rhetorical; the review process prizes novelty over nuance. Anyway. What if we cranked the precision dial to 16 instead, and had a line per granule? That was the process that led me to Nofl. It is a space in a collector that came from mark-sweep with a side table, but instead uses the side table for bump-pointer allocation. Or you could see it as an Immix whose line size is 16 bytes; it’s certainly easier to explain it that way, and that’s the tack I took in a .recent paper submission to ISMM’25 Wait what! I have a fine job in industry and a blog, why write a paper? Gosh I have meditated on this for a long time and the answers are very silly. Firstly, one of my language communities is Scheme, which was a research hotbed some 20-25 years ago, which means many practitioners—people I would be pleased to call peers—came up through the PhD factories and published many interesting results in academic venues. These are the folks I like to hang out with! This is also what academic conferences are, chances to shoot the shit with far-flung fellows. In Scheme this is fine, my work on Guile is enough to pay the intellectual cover charge, but I need more, and in the field of GC I am not a proven player. So I did an atypical thing, which is to cosplay at being an independent researcher without having first been a dependent researcher, and just solo-submit a paper. Kids: if you see yourself here, just go get a doctorate. It is not easy but I can only think it is a much more direct path to goal. And the result? Well, friends, it is this blog post :) I got the usual assortment of review feedback, from the very sympathetic to the less so, but ultimately people were confused by leading with a comparison to Immix but ending without an evaluation against Immix. This is fair and the paper does not mention that, you know, I don’t have an Immix lying around. To my eyes it was a good paper, an , but, you know, just a try. I’ll try again sometime.80% paper In the meantime, I am driving towards getting Whippet into Guile. I am hoping that sometime next week I will have excised all the uses of the BDW (Boehm GC) API in Guile, which will finally allow for testing Nofl in more than a laboratory environment. Onwards and upwards! whippet regions? paper??!?

3 days ago 6 votes