2019 Echigo Yuzawa Cosmos Half Marathon

I participated in the Cosmos Half Marathon held in Echigo Yuzawa. The event itself was great, but around halfway through the course, my stomach started feeling bad, and I had to retire at 13km with a frustrating result. There were several lessons learned, so I’m recording them here. First, my meal timing was bad. The start was at 9:30 AM, and I ate a rice ball around 8:00 AM. I should aim to eat 3 hours before the start....

September 29, 2019

TCP Technology Introduction - Reading Notes

I read TCP Technology Introduction, so I’ll take some notes on the interesting parts, although they’re rather miscellaneous. First, the first half. I’ve heard about network-related topics, but I often forget them if I don’t use them. Chapter 1: Introduction to TCP Transmission efficiency Ethernet frame 1500 bytes, TCP header 60 bytes, IP header 20 bytes Applications can use 1420 bytes Considering Ethernet header 14 bytes and FCS (Frame Check Sequence) 4 bytes, transmission efficiency is $1420/(1500+18) \times 100=93....

September 25, 2019

ABC139-141

ABC #139 D - ModSum If we set $p_1=N, p_2=1, p_3=2, … , p_N=N-1$, then $m_1=0, m_2=1, m_3=2, … , m_N=N-1$. So the answer is the sum of $1, 2, 3, …, N-1$. ABC #139 E - League Represent the match between $i$ and $j$ as vertex $(i,j)$. However, treat the reversed one as the same. Each vertex has the number of matches that should be done before $prev_{(i,j)}$ and a list of next possible matches $next_{(i,j)}$....

September 20, 2019

ABC136-138

I solved several ABC problems but forgot to record them in my blog. I’ll write them all together here. ABC #136 D - Gathering Children Once you enter an RL pair, you can’t escape. Move an even distance and attach to the RL pair. ABC #136 E - Max GCD Sort first, bring small values closer to 0, and bring large values closer to the answer $d$. Calculate the cumulative sum from both forward and backward directions....

August 24, 2019

ABC135

This time, problem E was quite difficult. It felt harder than problem F. After listening to the explanation broadcast on Youtube, I finally understood. This is a memo for myself, so the Japanese is rough… ABC #135 D - Digits Parade Let dp[i][j] be the number of cases where the remainder is j when looking up to the i-th digit. ABC #135 E - Golf Prepare X>=0,Y>=0 in advance 1) X+Y is odd AND K is even Return -1....

August 3, 2019

Filled ABC EF Problems (Continued)

Continuation from last time. I solved AtCoder Beginner Contest #130 ~ #133, so I’m summarizing them. I still can’t solve them without explanations… ABC #130 F - Minimum Bounding Box Let dp[i][j] be the number of combinations when the i-th and j-th are partial common substrings. By memoizing the update formula, it can be calculated quickly. ABC #131 F - Must Be Rectangular! Consider the (x,y) coordinates as a bipartite graph....

July 15, 2019

Filled in ABC EF Problems

I solved all CD problems of Atcoder Beginner Contest #116 ~ #129. Also, for #126 ~ #129, EF problems were added, so I solved all of them. For F problems, I referred to explanation PDFs, explanation YouTube videos, and explanation blogs. ABC #126 F - XOR Matching https://atcoder.jp/contests/abc126/submissions/5909511 When M=3, a sequence of length 2^(M+1) has elements like {0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7}. In this case, set it as {<0,1,...,7 excluding K in ascending order> K <7,6,....

June 16, 2019

Reading Notes on Concurrency in Go

I read O’REILLY’s “Concurrency in Go” and am leaving notes for myself. Also, I’ve compiled useful functions for concurrent processing based on the ideas in the book at https://godoc.org/github.com/bobuhiro11/gostream. Race conditions occur when two or more operations must be executed in the correct order, but the program doesn’t guarantee that order. We should aim for logical correctness, and cannot solve it by methods like inserting Sleep functions. The necessary conditions for deadlock are known as the Coffman conditions....

April 22, 2019

BGP in the Data Center Reading Notes

I read the first half of BGP in the Data Center, so I’ll note down what caught my attention. It contained practical content about how to design CLOS networks and how to operate BGP. Since it’s an area I don’t usually deal with, there might be misunderstandings. 1. Introduction to Data Center Networks Communication between servers in a local network is called East-West traffic, and communication between the local network and external networks is called North-South traffic....

March 21, 2019

Tokyo Marathon 2019

Two weeks after the Kyoto Marathon, I participated in the Tokyo Marathon on Sunday, March 3, 2019. This was also my first time applying and participating. It kept raining from before the start until after the finish. Especially waiting for more than 30 minutes before the start without any shelter was tough. In the second half, I was walking about half the time, and my pace was all over the place, but I’m glad I finished safely....

March 4, 2019

Kyoto Marathon 2019

On February 17, 2019 (Sunday), I participated in the Kyoto Marathon 2019. This was my first application and first participation. I’ll record my passing times at each point. Even after the halfway point, I didn’t have to walk for long distances. I brought plenty of supplies like sports yōkan, jelly, and salt candy, so I probably didn’t run out of stamina. I think most marathon races have a 7-hour time limit, but Kyoto Marathon has a 6-hour limit, which is a bit strict....

February 20, 2019

Filled in ABC CD Problems

I solved all CD problems from Atcoder Beginner Contest #1 to #115. I was able to solve about 70% of the C problems and about half of the D problems on my own. I rarely used special algorithms, and I think they can be solved if you can think through them properly. Here are some useful things to note: Try solving the first 1-2 examples by hand. Especially for geometry problems, actually draw them out....

January 18, 2019

x86 Emulator Development Log (5)

Happy New Year. I have been continuing the development of the x86 emulator, but as six months have passed and the development pace has slowed down, I have decided to make the code public at this point. It is available at https://github.com/bobuhiro11/tiny_x86_emu, so please take a look if you are interested.

January 4, 2019

x86 Emulator Development Log (4)

Last month, Go 1.11 was released and WebAssembly was experimentally supported. Since the emulator I’m developing is also written in Go, I took this opportunity to port it to WebAssembly. Simply compiling Go to WebAssembly uses the browser console as standard output, but I wanted to output to a div tag, so I manipulated the DOM using the syscall/js package. No other changes were necessary. It’s published at https://bobuhiro11.net/tiny_x86_emu/. It’s still a work in progress, and development on user process execution has been stalled, so I should start working on that soon....

September 19, 2018

x86 Emulator Development Log (3)

The emulator development has progressed to the point where process switching is possible through mpmain(), scheduler(), and swtch(). The xv6 code at line 334 of proc.c keeps issuing the sti instruction, and it seems to have entered a loop, so I’d like to summarize scheduling and context switching here. The process being switched to performs I/O immediately after being switched in the forkret() and iinit() functions. Here, it enters a sleep state and appears to be waiting for an interrupt....

August 19, 2018

Reading Notes on "First Time Reading the 486"

I read “First Time Reading the 486,” so I’ll note down what caught my attention. It’s helpful since I’m making an emulator. Throughout the book, the diagrams are very clear, so just looking at them is educational. Segments When reading instructions from EIP, the segment pointed to by the CS register is used, and when accessing memory during instruction execution, the segment pointed to by the DS register is used. Also, for stack-related operations like PUSH, POP, CALL, RET, the segment pointed to by the SS register is used....

August 4, 2018

x86 Emulator Development Log (2)

I want to summarize xv6’s paging. In the kernel main function, the page table and page directory initialization is performed twice. The first initialization of the paging mechanism maps the lower 4MB of virtual addresses 0x0 ~ 0x400000 directly to physical addresses 0x0 ~ 0x400000. Also, virtual addresses 0x80000000 ~ 0x80400000 with 0x80000000 as an offset are also mapped to the same physical addresses 0x0 ~ 0x400000. This paging is only used during kernel initialization....

July 21, 2018

x86 Emulator Development Log (1)

I read a book titled “Learning x86 Architecture by Creating Your Own Emulator.” As a continuation, with the goal of fully running xv6, an x86 OS mainly used for educational purposes, I plan to extend the self-made emulator. Since I’ll be developing over a relatively long period, I want to summarize the current situation. Currently, the bootloader has deployed the kernel body into memory, and I can start execution from the kernel’s main function....

July 1, 2018

Chef Practical Guide Reading Notes

I had an opportunity to use Chef and wanted to know it systematically, so I read Chef Practical Guide. I’ll leave notes for myself. Overview There are two types of operation modes depending on whether a management server is involved. The first is a server-client model using Chef Server as a management server. In addition to the local terminal and managed nodes, a Chef Server is required. Communication occurs between the local terminal and Chef Server, and between Chef Server and nodes (Chef Client)....

October 21, 2017

Serving Static Sites with GitHub Pages and Cloudflare

Previously, bobuhiro11.net and blog.bobuhiro11.net were served from a server I managed myself. However, since both are static sites, I don’t necessarily need to manage the infrastructure myself, so to make things easier, I decided to serve them using GitHub Pages from now on. After investigating, I found that GitHub Pages allows custom domains but cannot serve via HTTPS. Therefore, I placed a CDN capable of SSL termination in front of GitHub Pages....

October 7, 2017