CI/CD for Private Repositories on Github and Bitbucket

For private repositories managed on Github and Bitbucket, we will implement CI (Continuous Integration) and CD (Continuous Delivery). Here, I’ll note how to automate testing and deployment using wercker. wercker supports both Github and Bitbucket private repositories, and is currently available for free. The deployment target is heroku. heroku is basically free and allows you to easily use a PaaS environment. However, when using the free tier, note that it goes to sleep if there’s no access for 30 minutes, and operating time is limited to 1,000 hours per month....

June 19, 2017

Noto Wakura Manyo no Sato Marathon 2017

On March 12, 2017 (Sunday), I participated in the Noto Wakura Manyo no Sato Marathon 2017 held in Nanao City, Ishikawa Prefecture. It was my first full marathon. The large elevation changes were a disadvantage, but since the course circled around Nanao West Bay, I could fully enjoy nature including fishing ports, mountains, the sea, and bridges. Furthermore, I enjoyed Noto-madon (a bowl with oysters) and rice balls, and the temperature and weather were just right, making the entire experience pleasant....

April 8, 2017

Notes on Go Language

I read “Understanding Go Language from Basics”. Since the book was published in 2012, the Go version is a bit old (Go 1.0.3), but I think the syntax and concepts haven’t changed much. I might use Go in the future, so I’m taking notes on points of interest. Instance Creation and Initialization: There are several options for creating instances, as shown in the code example below. What you especially need to be careful about is that Go also has the concept of pointers, so the question is whether a pointer or the actual value is generated....

January 21, 2017

2016 Year in Review

As is customary every year, I decided to look back on this past year. I’ll summarize my research life, part-time jobs, hobbies, etc. by category. This year marks the end of my student life. However, with my master’s thesis and journal papers remaining, it looks like I’ll be busy even after the new year. I’ll be moving to the Kanto region starting in April next year. I haven’t been to UFJ, Takarazuka, or Tsutenkaku yet, so I’d like to visit them at least once while I’m in Kansai....

December 31, 2016

RTX1200 Initial Configuration

I bought a router RTX1200 for home use 1. It was a used one for just under 20,000 yen. I configured what could be done via GUI through the GUI, and configured the rest via CUI 2. Specifically, I configured PPPoE and filters via GUI, and VPN and DDNS via CUI. To avoid forgetting, I’ll summarize the configuration contents here. Note that initialization to factory settings is performed by pressing all three buttons on the front (microSD, USB, and DOWNLOAD) while turning on the power....

December 17, 2016

Ansible Notes

Recently, I started using Ansible. Just when an Ansible guide book “Ansible Perfect Guide” was available on Kindle Unlimited, so I read it. Omitting installation methods and usage, I’ll just note down points that might be tricky in the future. Configuration files are written in YAML format. When handling arrays and associative arrays, basically write one element per line. Arrays have - as prefix, and associative arrays have key: , followed by elements....

December 12, 2016

NUMA Policy

I investigated how to explicitly specify thread and memory placement in a NUMA environment, so I’m leaving this as a note. In environments where multiple multi-core CPUs are installed in a single chassis, memory is connected to each CPU. In such environments, data can be transferred at high speed between directly connected memory (local memory) and the CPU via the bus. On the other hand, to transfer data to memory that is not directly connected (remote memory), it is necessary to go through other CPU sockets via interconnects such as QPI (QuickPath Interconnect)....

October 7, 2016

Numerical Analysis of Advection Equations

For simplicity, consider a one-dimensional wave Let the value at coordinate \(x\) at time \(t\) be \(f(x-ut)\) For example, if a sine wave moves in the positive x-axis direction at velocity \(u\), then \(f(x-ut) = sin(x-ut)\) At this time, \(\frac{\partial f}{\partial t} + u \frac{\partial f}{\partial x} =0 \) holds. This is the advection equation First-Order Upwind Difference Method Approximate with a straight line Since this is numerical analysis, \(x\) is discrete like \(\dots,x_{i-1},x_i,x_{i+1},\dots\) Let the approximation of \(f\) at \(x = x_i\) be \(F_i^n(x)\) This method approximates with a straight line, so \(F_i^n(x)=a(x-x_i) + f_i^n, a = \frac{f_i^n - f_{i-1}^n}{\Delta x}\) Where \(f_i^n\) is the value after advancing the time step \(n\) times at \(x = x_i\) Time advances by \(\Delta t\) per time step When advancing the time step, $f_i^{n+1} = F_i^n(x_i-u\Delta t) = a(-u \Delta t) + f_i^n= - \frac{u \Delta t}{\Delta x}(f_i^n - f_{i-1}^n) + f_i^n$ In the program, just repeat the following with $K=u \frac{\Delta t}{\Delta x}$ The figure shows a rectangular wave input There’s also downwind for(i=1; i<99; i++) f_new[i] = -K * (f[i]-f[i-1]) + f[i]; for(i=1; i<99; i++) f[i] = f_new[i]; Lax-Wendroff Method Approximate with a quadratic function Approximate with $F_i^n(x) = a(x-x_i)^2 + b(x-x_i) + c$ Since three constants $a,b,c$ are needed, put appropriate values into $x$: $F_i^n(x_{i-1}) = a \Delta x ^2 - b \Delta x + c = f_{i-1}^n$ $F_i^n(x_{i}) = c = f_{i-1}^n$ $F_i^n(x_{i+1}) = a \Delta x ^2 + b \Delta x + c = f_{i+1}^n$ Where $x_{i+1} - x_{i} = x_{i} - x_{i-1}=\Delta x$ Solving this gives: $$ F_{i}^n(x) = a(x-x_i)^2 + b(x-x_i) + f_i^n, \\ a = \frac{f_{i+1}^n - 2f_{i}^n + f_{i-1}^n}{2\Delta x^2}, b = \frac{f_{i+1}^n - f_{i-1}^n}{2\Delta x} $$ When advancing the time step: $$ f_i^{n+1} = F_i^n(x_i-u\Delta t) = f_i^n - \frac{u\Delta t}{2 \Delta x}(f_{i+1}^n - f_{i-1}^n) + \frac{(u\Delta t)^2}{2 \Delta x ^2}(f_{i+1}^n -2 f_i^n- f_{i-1}^n) $$ In the program, similar to upwind difference, just repeat the following with $K=u \frac{\Delta t}{\Delta x}$ for(i=1; i<99; i++) f_new[i] = f[i] - K*K*(f[i+1]-f[i-1])/2....

April 26, 2016

Handwritten Digit Recognition on MNIST with Feedforward Neural Network

I decided to study deep learning and read a book on deep learning [1]. Furthermore, I created a handwritten digit recognition program using the MNIST dataset [2] MNIST is like the Hello World for building classifiers I’ll use the simplest feedforward neural network (FFNN) (I don’t understand the others well) Just reading chapters 1 through 4 provides enough information for implementation Composed of only 3 layers: input layer, hidden layer, and output layer I’ll use existing packages for matrix calculations and datasets I’ll implement the image recognition program itself (not using caffe, TensorFlow, etc....

April 24, 2016

Installing debian 8.0 jessie on Macbook Air (13-inch, Mid2012)

Notes on installing debian 8.0 jessie on Macbook Air (13-inch, Mid2012). Installing on SD Card First, prepare an appropriate media (/dev/diskX) other than the target SD card, and burn the debian 8.0 jessie Live install image to /dev/diskX. Once burned, restart while holding the command key and boot debian from /dev/diskX. $ diskutil unmount /dev/diskX $ dd if=debian-live-8.3.0-amd64-lxde-desktop.iso of=/dev/diskX Next, create two partitions on the SD card (/dev/diskY). Use GUID Partition Table (GPT) as the partitioning scheme....

March 15, 2016

2015 Summary

Happy New Year. I hope you have a great year. Here’s a brief summary of what happened last year. Research I became an M1 student. Since there were no clear deadlines like for bachelor’s or master’s theses, I spent time leisurely without much anxiety or pressure. To briefly introduce my research, it involves automatically converting sequential code for CPUs into code for GPUs. Until around October, I was tuning the GPU code to be output....

January 3, 2016

Building an Energy-Efficient Server

I’m running a Sakura VPS 1G plan instance as a web server and storage, but there are some dissatisfactions. Storage is split between home and VPS PC is on at home anyway So I decided to place a server at home. The requirements are typical, but like this: Has PCI slot Don’t particularly use PCIe, but nice to have Quiet (fanless, spinless) Cheap (total budget up to 40,000 yen) Power efficient 2 or more SATA ports After some research, I thought I’d use a NUC (Next Unit of Computing) called DN2820FYKH (15,000 yen)....

July 20, 2015

Codeforces Round 308 (Div.2), ARC040

I tried competitive programming for a bit. Codeforces #308 (Div.2) First time participating in Codeforces. In the end, I only solved A out of the 5 problems (A-E). Problem A was just implementation, so it didn’t take much time to solve. For problem B, I think it could have been solved by making a histogram, but I realized that too late. For problem C, I failed on the 4th pretest. I didn’t attempt D or E....

June 15, 2015

Notes on Creating a 5×5 Shogi AI

I’ve been gradually working on an AI for “5×5 Shogi,” a subset of standard Shogi. Here are some notes on what I’ve learned. Data Structure Each piece is managed using bitboards. For example, if a Black pawn exists at position 7, it’s represented as bitboard[B_PAWN] = 0x40. The range of rooks and bishops is derived using AVX2’s _pext_u32 instruction [5]. Search Strategy The basic approach uses alpha-beta pruning for search. Additionally, legal moves are sorted while performing iterative deepening....

May 29, 2015

Complete Analysis of Dobutsu Shogi

(Added 7/10) I’ve placed an AI that uses the complete analysis results at dobutsu-shogi.jar (17MB). Please try playing against it. It’s a bit late, but I performed a complete analysis of Dobutsu Shogi. The method has already been published, so please refer to that for unclear points (“Complete Analysis of Dobutsu Shogi”, Tetsuro Tanaka). My implementation also references that. The goal of the analysis is to complete an AI that, when playing as the second player, wins in exactly 78 moves, and when playing as the first player, plays moves that are hardest to lose (moves that maximize the number of moves until defeat)....

May 28, 2015

Recommendation for 4clojure

One of the Clojure learning sites is 4clojure. The difficulty levels are divided into Elementary, Easy, Medium, and Hard, so it’s just right for beginners. Things like infinite lazy sequences are unique to Clojure, and they’re interesting since we don’t usually think about them in everyday coding. Anyway, I just completed all the challenges.

May 16, 2015

2014 Year in Review

I haven’t written articles recently, so I’ll write a summary. I’m writing from memory, so there are probably many things I’ve forgotten. Looking at this, I spent a long time just playing around. Shachihoko 3/29 ZEPP FINAL! 2014@zepp namba 4/19 ZEPP FINAL! 2014@zepp Nagoya 4/26 Iikurashi Release Commemoration Free Event Tour@Kyoto Shinpukan 8/28 Shachiサマ@Budokan I think I ended up using the shinkansen partway Honoka was flying, tanma 11/02 Karaoke Wonderland Tour@Hamamatsu Act City Hall Went using a combination of Kintetsu, Meitetsu, and JR Sawayaka 11/24 Shampoo Hat Release Commemoration Free Live@Senri Selcy Handshake twice 11/30 Karaoke Wonderland Tour@Osaka Orix Theater Someone drove me there, 3rd floor seats Ii ja nai no~, Deacchatta yade- (Honoka), Anpanman, Subekkamu (Yuzuki) Lab Successfully got into the lab I wanted....

January 2, 2015

Clojure Class Reloading

I wrote about the class loader area last time, but I wasn’t quite satisfied, so I’ll investigate a bit more. I didn’t understand the mechanism of Java’s ClassLoader. Let’s start from Stack Overflow’s How does clojure class reloading work?. Question I’ve been investigating code and documentation about how class reloading works in Clojure. Many websites, such as http://tutorials.jenkov.com/java-reflection/dynamic-class-loading-reloading.html, indicate that loading a class essentially involves obtaining a byte sequence from any data structure, converting it to an instance of class Class using defineClass, and resolving (linking) that class using resolveClass....

May 20, 2014

Clojure Bytecode and Namespace Loading

Let’s investigate what kind of bytecode is generated when Clojure compiles *.clj files. First, let’s start with a simple example: (ns example.hello). Things to Note Compilation unit is a namespace A class loader “namespace__init.class” is created for each namespace Details are available at http://clojure.org/compilation During compilation, include the (Clojure code to be compiled) source directory in the classpath At runtime, include clojure.jar in the classpath in addition to the compiled class files Compilation Without using leiningen, let’s compile with raw Clojure....

May 15, 2014

How to Create a Debian LiveCD

I was curious about how to create a LiveCD, so I tried it. Having a LiveCD might make demos and such easier. 1. Install Tools # aptitude -y install xorriso live-build syslinux squashfs-tools 2. debootstrap Create an appropriate work directory (~/livework) and use debootstrap to create a new environment. This creates structures like bin, etc, var under ~/livework/chroot. # mkdir ~/livework && cd ~/livework # debootstrap --arch=amd64 sid chroot 3. chroot Use chroot to enter the new environment created by debootstrap....

April 7, 2014