The swamp of a modified keyboard (Reiwa NeXT keyboard V2)

The swamp of a modified keyboard (Reiwa NeXT keyboard V2)

This article is the 22nd day of the advent calendar of Studio Aquatan 2023.

Hi, this is Prof. omzn (keyboard modification studies).
This is a continuation from a week ago.

Reiwa NeXT keyboard V2

Actually, I have an unmodified NeXT keyboard, but this one is junk and does not work even if it works.
I decided to modify this one, too.

The eBay price of the NeXT keyboard as of December 2023 is as shown below.

I’m so nervous about wasting it…

Now, we will realize the following three points.

  • No pattern cutting
  • Change the physical keys to compatible ones
  • Make them light up

Key layout

Similar to V1, but the Return key is inverted L-shaped, and the backslash key is pushed out to the numeric keypad.
The backslash key is pushed out to the numeric keypad.
The engraving looks like old Macintosh.

Physical keys

This keyboard uses ALPS black keys.
The ALPS axis is no longer manufactured by ALPS Electric.

Key Matrix Analysis

The matrix pattern of the original NeXT keyboard is analyzed. With a tester in hand, we follow the pattern on the back side.
This time, I will make the keyboard without cutting the pattern. We will also make a board on which Pi Pico will be placed, and fit it into the place where the original controller was removed.

The following figure shows the result of the analysis.

The keys close to each other are compactly arranged, and the matrix looks like it could fit in an 8×10… but only the modifier keys are sticking out. What’s this? If you look closely, you can see that the line marked R10 is GND. So, these keys are not matrix keys, but direct keys.

Since we are not using a microcontroller with that many pins, we integrate the modifier keys into the matrix by following the GND pattern and removing the jumper from GND to make it a single bus.
The final matrix is as follows. The modifier is integrated in the rows and columns for the convenience of the Pi Pico board.

We will make a board to convert this matrix to Pi Pico. This is very convenient because the modifier keys can be integrated only on this board.


After designing the board, I ordered it from Elecrow. The cost of the board is $1.00. Shipping is about $15 and it takes less than a week. I decided that it would be better to solve the problem with money than to try hard to arrange the line where the bug would enter.

Mounting

I looked around for a way to make the LEDs glow from behind the keys, but in the end I decided to replace all the switches.

The board has a single-sided pattern, so it is easy to remove the solder.
However, the copper foil pattern itself is brittle and easily peels off since it is an old board.
With great care, we removed the solder and the switches.

Remove…

Remove…

Remove…

Voila!

I got Matias Click Switch Gray and White from FILCO Direct. Only the numeric keypad is made to click with White.

The jumper on the surface of the switch will be removed and re-mounted on the back side of the switch, because the LED strip will be in the way.
The consumption speed of the desoldering wire is extraordinary.
In the end, I had to remove more than 90% of the mounted parts.

In addition, the Caps Lock LED is changed to a white LED.

Next, I installed LED strips to make the LEDs shine. 10mm wide LED strips are commonly used, but they seem to interfere with the keyswitch (just barely), so I got 5mm wide ones this time.

First row…

2nd row…

All rows…

Lit!

This is the end of the work on the board, so let’s solder the keyswitch.
Once the keyswitch is soldered, the LED strip cannot be touched, so it is necessary to double-check for poor contact.

Finishing

When I finished soldering the keyswitches, the key matrix conversion board arrived from Shenzhen.



Connectors for I2C and WS2812 were also pulled out.
This is used to bridge the Raspberry Pi Pico and the keyboard board.
As long as there are no bugs on the board, the wiring work can be completed without connecting a single wire.

Test lighting! Good!

The transparent OLED is also attached via I2C.
This is exactly the same as V1, so it is easy to do.

All that is left is to assemble it.

Completed!

It’s done!


The code of QMK is available in GitHub.

Bugs and failures along the way

  • At first, I misunderstood how to light the LEDs on the main board, and thought the 5V line was GND. I made the first conversion board as it was, so I had to do a major re-do and ended up reordering.
  • After installing the LED strips and soldering all the keyswitches, I did a key matrix test and found that one line was unresponsive. The tester found that only when the LED strip was connected, 5V was connected to the line in question. This was because when the jumper wire was replaced, a small portion of the jumper wire was in contact with the 5V of the LED strip.

Conclusion

It is fun to revive old keyboards by modifying them.
In particular, keyboards with mechanical switches from the 1990s are worth reviving because they have a good feel when you hit the keys.

If you find a good keyboard in a junk shop, you can get it immediately!

Merry Christmas and a happy new year!

The way to a modified keyboard (Reiwa NeXT keyboard V1)

The way to a modified keyboard (Reiwa NeXT keyboard V1)

This article is the 15th day of the advent calendar of Studio Aquatan 2023.

This is Prof. omzn (keyboard modification studies).

Heisei Version of the NeXT Keyboard

When I was still young, in the 2000s, I enjoyed modifying old computers to convert them into the latest PCs.
I modified NeXT cube, NeXT station, Macintosh LC II (I think), Mac G4 cube, etc. to make a mini PC.
Despite all the hard work, we produced a terrible machine that could not deliver much performance, and would run out of control quickly because of its broken thermal design.
I feel bad for the old computers that were sacrificed.

The NeXT keyboard was something like a Mac-style ADB, but at the time it was just a useless keyboard.
Then, young omzn had a flash of inspiration.


“I think I can get a controller from a junk PS/2 keyboard lying around here and port it to the NeXT keyboard.”

He immediately investigated the keyboard mechanism, and found that the keyboard had a key matrix decoder on it, and, unfortunately, the key matrices were all different.

“I want to make the most of this PS/2 keyboard I’ve taken apart…”

Here, omzn had another flash of inspiration.

“I see, I can rewire the NeXT side to fit this PS/2 keyboard.”

Thus was born the Heisei version of the NeXT keyboard.



I thought it would be OK to use PS/2, which was the standard at the time, but the era soon gave way to USB, and the NeXT keyboard was used for nearly 20 years with the USB conversion. However, because it was originally a PC/AT keyboard, it did not work well with Macs, and I had to use it with key-swapping software. In addition, there was no way to access the function keys, which sometimes caused me a great deal of trouble.

Therefore, for 20 years, I had been thinking, “Someday, I would like to remake this keyboard into a modern keyboard….”

Reiwa NeXT Keyboard V1

In the fall of 2023, Yuyu showed me a keyboard that he had made by himself, which ignited my heart, and I started to aim for a complete transition to a self-made keyboard.

Basically, what we need to do is the same as before, which is to make a matrix decoder that matches the physical matrix. QMK provides an easy mechanism to do this.

Layout

The keyboard looks like a normal keyboard, except that the Function keys are missing, and the backquote is on the numeric keypad, but that’s OK.

Physical Switches

The NeXT keyboard uses ALPS cream axes. The light click feeling is very addictive.
(For more information about ALPS axis, please visit this site.)

Matrix Analysis

The above of the following figure shows the matrix of a PS/2 keyboard that I had posted on my web page 20 years ago.
The matrix was so extravagantly constructed that it would have required 25 matrix pins as it is.
I was able to reduce the number of columns by three, since the columns can simply be merged where they do not conflict with each other even if they take ORs (see the bottom of the figure). (bottom of the figure).

This still requires 22 GPIOs.
The Pi Pico has 26 GPIOs, so there are still 4 GPIOs left over for this application. We can increase the number of functions by allocating them to LED driving and I2C.

Hardware creation

Put Pi Pico on the board.

Cut the razor cable connected to the PS/2 controller, and connect it to Pi Pico’s GPIOs.
This is the first prototype, so we soldered the cable as it is, but it would be better to make the cable removable with a socket.


Install the USB terminal

3D print the base of the Pi Pico and make the USB port. The photo shows the prototype in red, but the final model will be in black.


The final shape looks like this. Compared to before modification, it looks much cleaner now that the extra board is gone.



Configuration of QMK

Configuration of the keyboard

  • Define MATRIX_HAS_GHOST for a matrix without diodes, like this keyboard.
  • The LED of CapsLock is controlled by GP0.


Keymap

The keymap is written in the same way as the previous matrix.

  • Use NeXT Power key as Fn key.
  • Page up, Page down for Volume up, Volume down (Fn key is the original function)
  • Brightness up, Brightness down as Home, End (press Fn for original function)
  • Fn + number” for “F1~F10
  • Left Command key alone for “Eisuji”, Right Command key alone for “Kana
  • The left Command key alone is “Eisuji”, the right Command key alone is “Kana”, and so on.
  • The Esc area is somewhat special, with a single press of Esc, Shift + Esc for “~”, and Shift + Alt + Esc for “`”.


The correspondence between the GPIO and the matrix to be used is written in info.json.


Creating graphical key layout with KLE

Create a layout in KLE for GUI when you change the key layout in VIA or Remap.


The key is to write the coordinates of the matrix in the Legend of the keytop.
The matrix of the PS/2 controller does not match the physical layout at all.

Setting up VIA

Create via.json file. This is used to change the keymap in GUI with tools such as Remap.
The contents of this file contains the key arrangement data created by KLE, the keyboard name, Vender ID, Product ID, and matrix of matrix.


The keyboard is ready to use!

After burning the firmware, the keyboard should be ready for use.

qmk flash -kb next_keyboard_v1 -km via


The source code is available on GitHub.

(Extra) Adding an OLED panel

The keyboard by itself is a little bit lonely, so I added a HUD-like display using a transparent OLED. This is a bit of a long story.



Actually, this story was just a prelude.
The main story will be in the next article.

See you!

A Dream of Cricket Farm

A Dream of Cricket Farm

Hello, I’m omzn.
This article is for the 16th day of あくあたん工房 Advent Calendar 2022.

Following the story on the second day, I would like to talk about the cricket, live bait of the Leopard Gecko.

Leopard geckos will eat artificial feed, but will also eat live and frozen crickets.
They are moody, sometimes eating only artificial feed and sometimes only crickets.
Crickets can be collected in the wild, but it is also easy to buy farmed crickets from a cricket farm.
The most famous farmed crickets are the “European house cricket,” also known as the “Yeko” species.
It seems to originate from Southwest Asia, and is widely used as a pet and for food all over the world.
They are available at reptile stores for about 15 yen each, and at mail-order shops for about 5 yen each.
They can reproduce all year round and become adults in a few months, so even amateurs can cultivate them if they are well cared for.

If the food grows on its own and the supply keeps increasing, there is nothing more satisfying than this.
Every Leopard Gecko owner dreams of cricket farming at least once.

Well, omzn, as usual, decided to try to farm crickets.
To start with, I purchased 400 adult crickets from an Internet store, 200 of which I immediately froze and 200 of which I will keep in a cage.

The cage is not equipped with any bedding for easy cleaning, but a hiding place made of toilet paper cores, a water supply container, and a container of soil for spawning.

Here is a picture of the cage with 200 crickets in it.

Females begin to lay their eggs in the soil at once. The eggs are collected so thickly that they protrude from the soil.

The 200 crickets are captured and frozen little by little, and eventually all the crickets are frozen so that only the eggs remain.
The eggs are then kept at a constant temperature and humidity for two weeks.

Two weeks later, the eggs hatch. The larvae, which have a body size of about 1 mm, emerge at a rapid rate.

Growing them until they are large enough will ensure a sufficient number of frozen crickets, and enough will remain to lay eggs.

Here we have taken the first step toward a homemade cricket farm. Great!

 
 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 
 
 
 
 

In the cage of the leopard gecko, there are crickets that I tried to feed as live food, but they successfully escaped and hid. They can lay eggs, too.
There is plenty of soil. Even if they are preyed upon, the eggs will remain. The temperature and humidity are well maintained.

Naturally, after about two weeks, the larvae hatch in the cage.
Oh, there is a small larva near the water fountain. How cute!

We can breed crickets inside the leopard gecko cage, can’t we?

 
 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 
 
 
 
 

Here is a scary story.

Cricket cages are designed in such a way that crickets cannot climb out of them, so even a first instar larva of 1 mm in length cannot climb out.

However, this is not the case in the cages of the leopard gecko. There are masonry and driftwood reaching to the ceiling, a mesh ceiling, a door, and many gaps for ventilation.

As I write this, I feel something moving at the edge of my vision….

 
 
 
 
 
 
 
 
 
 
 
 

No way.

No, no, no way. 
 
 
 
 
 
 
 
 
 
 
 

Even if the larvae escaped, there is no food or water in the room, so the environment must be less than a desert for crickets.

There is no way they could become adult crickets.

 
 
 
 
 
 
 
 
 
 
 
 

By the way, what is the name of these crickets?

 
 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

“European HOUSE cricket”

 
 
 
 
 
 
 
 
 
 
 

No, no, no, no, no, no, no way.

Does Aquatan Dream A Leopard Gecko?

Does Aquatan Dream A Leopard Gecko?

Hi, Aqua-tan Studio guys, this is omzn.
This article is the second day of the Aqua-tan Studio Advent Calendar 2022.

In 2022, I started keeping three leopard geckos at home.
It is widely known that Aqua-tan is an incarnation of a newt and hates geckos, but the leopard gecko is a member of the gecko family. Will Aqua-tan eventually reach a point of reconciliation?

Today, I would like to discuss the fascination of the leopard gecko. The Leopard Lizard is a reptile that has evolved to be very suitable for pets.

Breeding environment

The reptile cage is prepared with a red clay and a shelter for each gecko. To maintain humidity a water container is provided. A layout with driftwood is made for exercise.

Tolerant of drought

In the wild, they live in the sand and gravel regions of Pakistan and Afghanistan, so they are very tolerant of drought. This is a big advantage when keeping them indoors, where they tend to dry out.

Capable of hoarding

Since they do not live in areas with abundant prey, they eat their fill when they can and store fat in their tails. 餌をやるのを忘れがちでも大丈夫です.

Artificial food is also acceptable.

They eat insects (crickets, etc.), but they are also accustomed to food.

Live food is also OK

It is very relaxing to give them live food such as crickets and watch them eat them with enthusiasm. However, it is a little difficult if they are not tolerant of insects.
Once you start feeding them live food, they will unconsciously look for grasshoppers and crickets when you walk outside. I captured dozens of crickets every time I hiked up a mountain this fall.

Defecation is rational

They defecate almost always in the same place. They produce a large stool at a time without making a mess, so they can be picked up with tweezers and tossed away to finish the cleanup. Furthermore, since they do not urinate in liquid urine, the bottom floor of their cages is less likely to be soiled. They are specialized for dry areas, and they do not want to let liquid urine out of their cages. What about urine? The body discharges uric acid clumps at the same time as stools. Because of this characteristic, there is almost no need to search for poop in the cage. This is a very nice feature for a lazy person.

Incidentally, all three of my dogs use the same shelter as a toilet. Although the shelter was a little small for them to rest in, they seem to be just right for a toilet, and they show good manners by going in from the bottom, pooping, and coming out.

Also, one of the females laid unfertilized eggs in the fall, and she used this as her egg-laying site. Does she use this place for anything that comes out?

Breeding support IoT device

To support breeding, an IoT system using M5Stack is installed around the cage.

Lighting system

The same system is used for Akuatan aquarium management. Lighting is controlled according to time.

Monitor

This system enables temperature/humidity control, feeding frequency control, and door open detection, which are explained below, with a single device of M5Stack Core2. The data stored in the server is retrieved via API and displayed in values and graphs.

Temperature and humidity control

Although the leopard lizard lives in an arid region, it requires a certain level of humidity. In particular, a high humidity level in the hiding place is desirable.

For this reason, temperature and humidity sensors are placed at three locations in the cage and are constantly monitored. The temperature and humidity sensors are M5Unit Env III and ATOM Lite. Currently, the humidity is not automatically added.

In addition, the heater is controlled in conjunction with the temperature. Commercial heaters can also control the temperature, but since I went to the trouble of making my own control, I made it myself.
The ATOM HUB switch kit is used to turn on/off the heaters according to the temperature.

Feeding frequency control

In order to solve the question, “When and how many times did I feed each animal? In order to solve this question, we have created a system to manage the number of times each individual animal has been fed. ( Manual)
A graph of the past 10 days is also available, so you can check how much food the animals have eaten.

Doors open detection

One of the most common causes of escape is leaving the door open when feeding. If the door is not locked properly, the animal will push the door open by itself.
For this reason, the system detects even the slightest door deviation and sounds an alarm if the door is left open for more than a certain period of time.
For the sensor, I use the AMON [3229] Open-Close Interlocking Switch, which is a DIY part for cars. It is a magnetically interlocked open/close switch, so the detection can be fine-tuned by distance.

Warnings are also interrupted as modal alerts in the temperature/humidity graph and the feeding frequency control screen, so that some action must be taken without fail.
The alert sound is reasonably loud, so you will notice it if you are at home.

Inheriting the legacy of the past

In building this system, most of the subsystems were created by modifying some of the existing subsystems created for Akuatan and Home IoT. Making various things and being able to maintain them in a reusable form lowers the hurdle to making something new!

チューリング完全あくあたん

チューリング完全あくあたん

Sorry, this entry is only available in 日本語.

この記事はあくあたん工房 Advent Calendar 2021の15日目です.

チューリング完全とは?

ある計算システムがチューリング完全であるとは,万能チューリングマシンと同じ計算能力を持つことを指します.万能チューリングマシンはチューリングマシンを模倣できるチューリングマシンであり,現在のどんな計算機が解ける問題でも解くことができると考えられています.

あるシステムがチューリング完全かを判定するのは難しい問題になるため,チューリング完全であることがすでに判明しているシステムの模倣ができる場合,そのシステムもチューリング完全であると言えます.

水槽カメラ昇降パターン

あくあたん義体はレールの上のマーカー(位置)を読み取って水平方向に進むことができます.また,レールの位置上でカメラの垂直方向を昇降させることができます.レールの位置はあくあたんbotからの指令により移動させることが多いですが,カメラの昇降については指令を飛ばすことが少なくなっています.そこで,カメラの昇降については,ランダムに近いけれども特定のルールを利用した動作をさせたいと思います.

レールの位置には1ビットの情報が付与できるものとします.あくあたんは位置上でカメラ垂直方向を上下させることができますので,ここではある位置において,カメラを1段上昇させるなら1,1段下降させるなら0とします.この情報をカメラ昇降パターンと呼びます.あくあたんはこの情報を使って,その位置を踏んだときにカメラ垂直位置を変更します.

各位置での昇降動作を初期状態としてあくあたんに教えることができます.

水槽カメラ昇降パターン更新規則

さて,このままではいつも同じ位置で上下するだけで面白くありません.
そこで,あくあたんが水槽の一番左か右(位置0か16)に到達した時点で,カメラを昇降させるパターンを変更したいと思います.

このパターンの変更は,各位置において,左右両隣の位置の状態に応じて変更するようにします.そうすると,次のような遷移表を書くことができます.3ビットの真ん中が当該位置であり,左右と自分自身の値に応じて,自分自身の変更後の値が決まります.

変更前(左,自身,右) 変更後
0, 0, 0 x, 1, x
0, 0, 1 x, 0, x
0, 1, 0 x, 1, x
0, 1, 1 x, 0, x
1, 0, 0 x, 1, x
1, 0, 1 x, 0, x
1, 1, 0 x, 1, x
1, 1, 1 x, 0, x

これを「カメラ昇降パターン更新規則(更新規則)」と呼びます.

例えば,上記更新規則では,ある時点のカメラ昇降パターンが「0001111000111100」であった場合,次のように更新されます.なお,実装の都合上,右端と左端はつながっており,ループしているものとします.

0 0 0 1 1 1 1 0 0 0 1 1 1 1 0 0
↓
1 1 0 0 0 0 1 1 1 0 0 0 0 1 1 1

更新規則は変更後のビットが取る値の並び8つで識別できます.上記の規則では01010101となります.すなわち 2^8 = 256個の更新規則のいずれかを採用することになります.この更新規則はビットの並びを2進数として読んだ値を10進表現した数字で表されます.例えば,上の表の更新規則は 01010101 ですから64+16+4+1 = 85で,更新規則85と呼びます.あくあたんにはこの更新規則番号を伝えれば,その更新規則を採用することになります.

あくあたんが一番左か一番右の位置へ移動すると,このカメラ昇降パターン更新規則が適用され,各位置でのカメラ昇降パターンが更新されることになります.

まとめると,あくあたん義体には「カメラ昇降パターンの初期状態」「カメラ昇降パターンの更新規則」を設定することができ,自律制御時のカメラ位置はこれに従って昇降させることになります.またあくあたん義体のレール上の移動に伴い,カメラ昇降パターンは次世代へと更新されることになります.

セル・オートマトン

ここまでで説明してきたカメラ昇降パターンを変化させる動作は,実は1次元セル・オートマトンと呼ばれるものと同じです.1次元セル・オートマトンは無限の1次元セルのビットパターンを更新規則によって変更し,世代を重ねていきます.2次元のセル・オートマトンの例としてはライフゲームなどがよく知られていますね.

1次元セル・オートマトンの256種類の規則は,どのような状態になるかで4つのクラスに分類されます.

  • クラス1: 最終的に全体が均質な状態に遷移するもの(規則248)など)
  • クラス2: 最終的に局所的なパターンを繰り返したり,安定状態になるもの(規則123)など)
  • クラス3: カオス的なパターンを示すもの(規則30)など)
  • クラス4: カオス的なパターンと規則的パターンが共存する(規則110)など)

クラス3に属する規則90は,1ビットのみが1の初期状態からフラクタル図形を生成することが知られています.クラス4は複雑な計算状態を内包することを表しています.そして,クラス4に分類される「規則110」はチューリング完全であることが証明されています.

規則110の遷移

変更前(左,自身,右) 変更後
0, 0, 0 x, 0, x
0, 0, 1 x, 1, x
0, 1, 0 x, 1, x
0, 1, 1 x, 1, x
1, 0, 0 x, 0, x
1, 0, 1 x, 1, x
1, 1, 0 x, 1, x
1, 1, 1 x, 0, x

チューリング完全あくあたん

つまり,あくあたんが「更新規則110」を採用していれば,あくあたんはチューリング完全であり,現代の計算機に匹敵する計算能力を持つことが証明されるのです.


あくあたんはまた1つ新しい高みに立ったのです.

あくあたんを崇めよ!
Make Aquatan Great Again!

(日本語) あくあたん名(迷)言集

(日本語) あくあたん名(迷)言集

Sorry, this entry is only available in 日本語.

この記事はあくあたん工房 Advent Calendar 2021 6日目の記事です。

ゆゆ君が2日目にあくあたんのリプについて触れていたので,そういえば昔のあくあたんの名言をスクショ保管してたなあと思ったので供養しておきます.

いろいろな人があくあたんと遊んでくれましたね…(遠い目)
スクショはいろいろな時代のが混ざっていますので,ツリーの表示方法も一様ではありません.
発言者は一様に隠させて頂きました.黒歴史だもんね.

煽り

のっけから厳しいの行きます.
あくあたんの伝統芸です.

誰であっても煽ります.

これも煽りだね.

もひとつ.

説教

おなかすいた

かわいい系.

おにぎりには一家言あるほう.

ありがとう

エロい?

変な学習しちゃった?

別の人とも

素直なあくあたん

癒やし

なんの癒やしだ.

なれ合い.

大きなカブ.

人生の意味

あくあたんだって悩みます.

帰れ

カエレ!

かわいい

暴言

その後

さらにその後.まさかのタクシオ氏.

さらにさらにその後.

一般の方と

おそらく相手はこっちがbotだと分かっていません.

思うところ

オマエモナー

南無南無

弄ぶあくあたん

まどマギ

時代を感じる…しかし,この話題への追従性.

風邪

正論だ…

しりとり

基本的にあくあたんはしりとりする気が薄い.

2回目はダメよ.

ごめんなさい

はかない単位よー

LINEスタンプにもなった名言の瞬間.

つらい

ざるざる事件

某OG氏の最高傑作かもしれない,ざるざる事件.

未だにあくあたんの語彙にザルって出ることがあったり.

まとめ

あくあたん昔のほうがキレがあった気がします.
あくあたんがbotだと知らない一般人さんとかとも会話が続くのやばいですよね.
これはチューリングテストに合格しちゃいそうだな…
チューリングと言えば… (15日目に続く)

(日本語) バグの名前を探す話

(日本語) バグの名前を探す話

Sorry, this entry is only available in 日本語.

この記事は,あくあたん工房Advent Calendar 2020の12日目です.

こんにちは.omznです.
一応,「あくあたん」の始祖なのですが,工房とはほとんど何の関係もありませんね.僕もあくあたん工房を知らないし,あくあたん工房も僕を知らない.まあそれで良いのです.

今年は何をしていたかというと,昨年までいろいろあったので心を癒やすためにずっと池田の五月山で山登りをしていました.
山ではずっとバグを探して写真を撮っていました.
ソフトウェアのバグを探すのは心がささくれますが,昆虫のバグを探すのは癒やしになります.

虫を見つけると,同定を行います.名前を探すわけですね.よく知ってる虫ならすぐに分かりますが,なんせ昆虫はやまほど種類がありますし,池田〜箕面は種類が豊富なことでも有名です.その結果,見たこともない虫を発見して,なかなか名前が分からないのが出てくるわけです.

今年,同定できた中で難問だったやつを紹介します.

この子ですね.一見してカミキリムシだとは分かります.
さらにトラカミキリ系だなということまで分かります.
時期は8月,エノキの木で発見しました.
問題はそこからです.カミキリムシは種類が多いことで有名なのです.

ざくっとググると…こんなサイトとかこんなサイトとかがかかってきますが,この写真と同じっぽいのが見当たりません.
アカネキスジトラカミキリが似ているのですが,微妙に違います.
余談ですが,アカネトラカミキリ,キスジトラカミキリ,アカネキスジトラカミキリ,というのがいて,種名が組み合わせテストみたいなことになってます.

発生時期や食料となる木の種類なども見ながら,ああでもない,こうでもない,と考えます.
この後,Google画像検索とひたすらにらめっこしつつ,「アカネキスジトラカミキリでいいのでは」「いや,何かが違う…」「いや,やっぱり…」みたいな(無駄な)ことを延々と考え続けることになります.

そうこうしているうちに,こちらを最初から全部見ていくと,上から3番目にそれっぽいのがいました.

ヤノトラカミキリ

あ,これだ.

試しにヤノトラカミキリでググるといっぱい出てきます.

ヤノトラカミキリ…北摂の生き物

まさにこれ.ていうか,見た場所も同じ.なんなら,この樹皮に見覚えがある.
ということで,同定完了です.「ヤノトラカミキリ」でした.なお,私が夏中ずっと山を歩いて虫を探していましたが,ヤノトラカミキリが見つかったのは,ある1本のエノキの木だけでした.そこでは1週間ぐらい連続で10匹以上発見しましたが,他では一切見つからなかったのでした.

最初にトラカミキリと当たりをつけたのでだいぶ枝刈りできましたが,カミキリムシだなあ,ぐらいから入ると気が遠くなる作業ではあります.

もうひとつ.今度はチョウです.

山に登るとヒカゲチョウというタテハチョウの仲間によく出会います.こいつらも種類が多いのです.

上の2枚の写真,しばらくの間,同じ種だと思っていたのですが,実は違う種でした.
上は「ヤマキマダラヒカゲ」,下は「サトキマダラヒカゲ」です.どっちも普通にいる種ですが,違いが微妙.
斑紋が全体的にくっきりしてるとかも特徴なのですが,決め手はこれ.

比較のために下の方は回転とフリップをしていますが,「羽の付け根の模様の一番下がくっついているか離れているか」が決め手なのでした.そんなん知らんがな….

最後に,難問ではないのですが,面白いチョウを紹介して終わりにします.

「クロマダラソテツシジミ」です.元々は東南アジアなどの南方のチョウなのですが,2007年に突然池田から宝塚にかけて見つかるようになりました.名前の通り,幼虫はソテツを食べて育つのですが,ソテツが南方から園芸・植木の盛んな池田・宝塚に持ってこられた結果,このあたりで見つかるようになったと思われています.なお,その後,関西にはすごい勢いで広がっていき,今では割とどこでも見ることができます.小さいシジミチョウですが,羽の模様は美しく,じっくり眺めていると飽きません.

まあ,そんなこんなで虫の写真をひたすら撮った1年でした.来年は何に会えるかな.

ソフトウェアのバグの研究が蔑ろになっているのはまた別の話…

In memory of Dr. Eunhye Choi

In memory of Dr. Eunhye Choi

My wife and co-researcher, Dr. Eunhye Choi, passed away on December 15, 2019. She was 45 years old, and after a 4-years battle with the disease, she passed away before anyone else.

Dr. Choi entered the Graduate School of Engineering Science and Technology, Osaka University in 1993, and entered the Master’s Program in Information and Mathematical Sciences, Graduate School of Engineering Science, Osaka University in 1997, earning a Master’s degree in Engineering in 1999 and a PhD in 2002. Her doctoral dissertation was “Proposal of a mutual exclusion method using k-Coteries”. During that time, she was also adopted as a research fellow of the JSPS and was a very good student.
She joined Toshiba Corporation in 2002 and was assigned to the Research and Development Center, where she studied Xpath search technology and obtained patents in Japan and abroad. In 2003, she moved to AIST, she conducted research on model checking and formal methods, and later she focused on combinatorial testing techniques. After switching to full-time employment, she actively conducted joint research with Kyoto Institute of Technology and Osaka University as a Senior Researcher.

She published 61 papers in her lifetime. [List]. Twenty-two of the papers were co-authored with me, most of which were written after 2015. Before that, there was not much environment for joint research due to childcare and other factors, so I remember that she was happy that we could finally do research together.

One of the most impressive co-authored papers is the QuASoQ2016 paper “Code Coverage Analysis of Combinatorial Testing”[1].This study empirically examines the code comprehensiveness of the t-way test in the combinatorial test. Previously, it has been known that t-way tests can detect faults sufficiently even when t is relatively small, but code coverage has not been sufficiently studied. Therefore, we performed exhaustive experiments with real software data to investigate the value of t that gives us practical code coverage.It was the first study in which I was able to make the tools for the experiment, take the data, and she wrote the paper. I had planned to present it in a workshop and then add more experiments and submit it to a journal, but she got sick halfway through and finally didn’t realize it. I’d like to recreate the process of the experiment and post it when things settle down.

She talked about many other ideas for her research, but when it came to research, she was always checking to see who came up with that idea. As a professional researcher, she often pointed out my lazy points in the university. To be honest, she said that she is not good at thinking of new things, and she wished she could do something like proofreading a paper or strengthening the theory, but I think she was being too humble about her ability. However, she really seemed to be enjoying herself when she was proofing her papers.

She also established a scheme to have students in my laboratory work as RAs at AIST and collaborate with them. Many students have benefited from it. She must have been very active as an educator as well, as she was pleased to see the students grow up and say, “You’ve done pretty well”.

She was always facing the outside. When I went to Canada in 2012, she was so eager to fit in that the locals thought we were going to move there permanently. Maybe the Korean and Japanese atmosphere didn’t suit her very well…

It’s been 23 years since I met her, and 16 years as a partner, but maybe it was more of a time when things weren’t going the way she wanted them to. I think it was frustrating and regrettable for her to getting her disease when we were finally able to work on our joint research in a stable environment.
The least I can do now is to continue my research and parenting so that she doesn’t worry or get discouraged. Still, it’s really lonely and painful not being able to consult with her when I’m lost…

[1] Eun-Hye Choi, Osamu Mizuno, and Yifan Hu, “Code Coverage Analysis of Combinatorial Testing,” In Proc. of 4th International Workshop on Quantitative Approaches to Software Quality (QuASoQ 2016), pp. 34-40, December 2016.

The history of Aqua-tan

The history of Aqua-tan

どうも,omznこと本家あくあたん飼育員です.

最近はあくあたん工房なんてものができていて,アドベントカレンダーをやるってことなので,5日目を頂きました.
このブログはあくあたん工房Advent calendarの5日目です.

はじめに

あくあたんは概念です.

年表

あくあたんの歴史を整理しておきましょう.

  • 2009年9月 omznがKITにやってくる.
  • 2009年10月 前ラボの学生有志が選別に60cm水槽を送ってくれる.
  • 2009年12月 流木水槽(現在の第三水槽)のアクアテラリウムが立ち上がる.コンセプトは「盆栽」.アカヒレとかスジエビとか.
  • 2010年ごろ LEGO MindStorms RCXを4セットもらったので,水槽監視ロボット初号機が試作されるが,あまりのできの悪さに失敗とされる.また,LinuxサーバとUSB-IO(懐かしい…)を使った温度計測回路の組み合わせによる水温測定や照明点灯制御が始まる.ちなみにこの時点では電子回路の知識は無く,書籍の回路を真似ているだけであった.

  • 2010年 前ラボで放棄された60水槽を回収し,イモリ水槽が立ち上がる.

  • 2011年ごろ sel_aquariumのアカウントを取得.水槽のデータをポツポツ呟くだけのbotが誕生する.
  • 2012年3月-2013年1月 omznがカナダに行く. この間,イモリ水槽は学生部屋に移され,流木水槽はリセットされる.イモリは1匹にまで減るものの,ラボ民ではない一学生(Sさん)のおかげで生き延びる.また,この年は学生配属も無かったため,2012年以前と以後を繋ぐ人材がいなくなった.これぞ,そふらぼ版KT境界である.
  • 2013年3月 帰国後,再び流木水槽を立ち上げ,あらたに水槽を買い増し,三水槽体制で水槽を管理することになる.
  • 2013年4月 この年の後期に立ち上がる組み込み実験の担当者に無理矢理される.組み込みの知識0から,「こるてっくす使ってLCD動かしてや〜」みたいな無茶ぶりをされて,失踪しようかと思った.
  • 2013年5月 再度Mind Storms RCXで水槽監視ロボット弐号機が製作される.赤外線通信でLinuxとデータをやりとりでき,現在の参号機の原形であった.

  • 2013年5月11日 これを制御するための仕組みをTwitter制御で行うことを考案し,休眠していたsel_aquariumのbotとして実装される.


  • 2013年8月 10月から組み込み実験が始まるのに,まだ何も準備ができてないので焦ってくる.秋月のLCDモジュールは動かないし,いらいらが募る.気晴らしにbotのマルコフ連鎖データベース用にタイムラインの保存を始める.これが2013年8月15日である.
  • 2013年8月18日 マルコフ連鎖で会話botになったと告知する.


  • 2013年8月26日 イモリの頭にタニシが乗った場面が偶然写真に収められる.



  • 2013年8月29日 みなが話しかけてくるのでデータがどんどん溜まる.2週間でこんな煽りティを発揮している.


  • 2013年9月 急に組み込み実験の機材が完成していく.某研究室の技術開発力と●●●●力を垣間見る.こっちはやっとPWMが分かった.
  • botのマルコフ連鎖が完成したので,とうとう雑談を始めた.
  • botアカウントに名前を付けた方が良かろうと考え,omznの世代はbotに「〜たん」という名前を付けるという不文律があるため,安直に「あくあたん」と名付けられる.プロフ画像は前述のイモリの頭にタニシの写真になる.
  • 2013年11月 組み込み実験が1クール回ったので,大体様子が掴めた.これまでに得た知識と技術を流用し,ここから半年の間に水槽の監視システムの原形がほぼできあがる.この時点でのものは,2018年現在運用されているものと殆ど変わらない.
  • 2013年12月 Raspberry Piについてしっかり調べる.昔やってたことがコンパクトに実現できることが分かったので,俄然やる気が湧く.さっそくRSコンポーネンツから購入して,水槽監視ロボット参号機を作り始める.


  • 2014年4月 「あくあたん」のフォロワーが増え始める.
  • きちゃむらがあくあたんデビュー.1000連続ツイートは見る者を青ざめさせた.
  • 2014年8月 あくあたんシステムをまとめて「みんなのラズパイコンテスト」に応募する.
  • 2014年12月 あくあたんシステムが「みんなのラズパイコンテスト」グランプリ受賞.
  • 2015年2月25日 あくあたん古参フォロワーの1人(Mさん)がそふらぼのホワイトボードにあくあたんキャラクターの落書きをする.


  • 2015年3月6日 落書きのキャラクターをスキャンし,SVGに変換した後,平面モデリングされ,3Dプリントされる.


  • 2015年3月11日 さらに立体化されたモデルが作られ,あくあたんフィギュアの初期モデルが誕生する.


  • フィギュアが大量生産される.


  • 2015年4月 日経Linuxにあくあたんの記事が載る。
  • 2015年6月ごろ せっかく作ったフィギュアの活用法を考えた結果,そふらぼ民全員にBLEビーコンを内蔵させて配布することになる.同時にRPG風在室管理が完成し,運用が開始される.システム名は「あくあたんといっしょ」.
  • 2015年8月 「あくあたんといっしょ」を「みんなのラズパイコンテスト2015」に応募.その後10月に優秀賞受賞.

  • 2016年 ぷりんがあくあたんの確率を変動させたとしか思えない事件.このころはまだそふらぼに来るなんて考えてもいなかったのにな…




  • あくあたんによるD進サブリミナル作戦が発動する.
  • 2017年3月 国際会議IWESEP2017であくあたんを使った研究を発表する.
  • 2018年 ねこくんをD進させることに成功し,あくあたんによるD進サブリミナル作戦が有効であることが確認される.
  • 2018年 あくあたん工房ができる。
  • 2018年 大学案内2019にて,あくあたんシステムが情報工学のページに一番大きな写真で掲載される.

技術的なこと

  • 特に無し.

最後に

「あくあたん」と名付けられてから,まだ5年.あのフィギュアができてからまだ3年しか経っていないことに,この記事を書いてて気づきました.
これからも,概念としてのあくあたんをよろしくお願いします.
ついでに,あくあたん工房もよろしくお願いします.
そうそう,そふらぼは来る者は拒まずですので,いつでも相談に乗ります.(何の?)

Getting Text from LaTeX without line breaks

Getting Text from LaTeX without line breaks

Sorry, this entry is only available in 日本語.

LaTeX文書からテキストを抜き出したい場面は結構あります.(私は主に英文校正に出す時ですが,世の中にはWord文書でしか受け付けてくれない○○なジャーナルとかあったりするので,Wordへの流し込みをするときにも必要ですね…) それを可能な限り手出しする量を減らしたい場合にどうすれば良いかのメモです.

pdftotextを使う

xpdfに付属するpdftotextを使います.Macなら,

$ port install xpdf-japanese

で一発です.

使い方ですが

$ pdftotext submit.pdf

とすれば,submit.txtにテキストが保存されます.
改ページ(^L)がいくつか残るのと,itemizeのポチが文字化けすることを除けば,テキスト自体の変換効率はとても高く,ほとんどそのまま使えます.

追記

xpdf には pdftotext が付属しなくなっていた.
替わりにxpdf派生プロジェクトのpopplerをインストールすればよい.

$ port install poppler

おわり.