Using Rails Routes Right After Startup

In a new Rails application I am developing at the moment, I have a background job that kicks in every few minutes that may need to send emails to users. This background job is started off in config/initializers/start_something.rb. I had multiple problems with this, but the main one is described in the title of this blog post.

First of all, I originally used FooMailer.foo_email(foo, bar).deliver_later. This would just silently do nothing. Mails just didn’t work. Nothing in /var/mail/maillog either. Drop the _later, and you get a stack trace and finally know why emails aren’t being sent: there is a problem rendering the template, in my case, link_to and url_for weren’t working.

The second problem is the main problem. You get a long stack trace like this:

from /home/.../.rvm/gems/ruby-2.3.0/gems/actionpack-5.0.0.1/lib/action_dispatch/routing/route_set.rb:629:in `generate'
from /home/.../.rvm/gems/ruby-2.3.0/gems/actionpack-5.0.0.1/lib/action_dispatch/routing/route_set.rb:660:in `generate'
from /home/.../.rvm/gems/ruby-2.3.0/gems/actionpack-5.0.0.1/lib/action_dispatch/routing/route_set.rb:707:in `url_for'
from /home/.../.rvm/gems/ruby-2.3.0/gems/actionpack-5.0.0.1/lib/action_dispatch/routing/url_for.rb:172:in `url_for'
from /home/.../.rvm/gems/ruby-2.3.0/gems/actionview-5.0.0.1/lib/action_view/routing_url_for.rb:90:in `url_for'
from /home/.../.rvm/gems/ruby-2.3.0/gems/actionview-5.0.0.1/lib/action_view/helpers/url_helper.rb:196:in `link_to'
from /home/.../kifu-kun/kifukun/app/views/..._mailer/..._email.html.erb:16:in `_app_views_..._mailer_..._html_erb__3955141667319229348_25724800'

And if you place <% byebug %> right before that line 16 in the template, and copy and paste the link_to line into the debugger, you get something like:

*** ActionController::UrlGenerationError Exception: No route matches {:action=>"...", :controller=>"...", :id=>...}

What? After you double and triple-checked the syntax and names of everything, you maybe decide to check the output of Rails.application.routes.routes:

#<ActionDispatch::Journey::Routes:0x00000004a5d940 @routes=[], @ast=nil, @anchored_routes=[], @custom_routes=[], @simulator=nil>

Um, that looks very empty! No routes? (Normally you get a couple screenfuls of stuff.) As stated earlier, we’re using a config/initializers/start….rb file, and I suspected that the routes just aren’t available yet at this point.

Rails.application.config.after_initialize do
  if defined?(Rails::Server) # don't perform job when running rails c
    FooJob.perform_now
  end
end

Sorry, tangent: this job is running every two minutes, so it performs itself later at the end of the perform method:

FooJob.set(wait: 2.minutes).perform_later # why does self. not work?

Yeah, self.set(…).perform_later doesn’t seem to work, so just use the full class name. (There are cron gems around, but I opted to skip those to cut down on dependencies. And that’s what got me into this mess. :p)

And we’re back to our after_initialize thing. I found this page titled “Rails initialization and configuration order” and thought stuff run here would be able to take advantage of most or all of Rails’ capabilities. Well, it turns out that routes are special in that regard. Here’s something I found after searching for a while: “Rails initializer that runs *after* routes are loaded?” So the answer to my problem is:

Rails.application.config.after_initialize do
  if defined?(Rails::Server) # don't perform job when running rails c
    Rails.application.reload_routes!
    FooJob.perform_now
  end
end

The third problem is really simple. This is the message:

*** ArgumentError Exception: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true

That’s a pretty clear message. In other words, you just have to add (e.g.) host: ‘example.com’ (or something from the config) to the (perhaps implicit) options hash ({controller: ‘…’, action: ‘…’}) and you’re set.

Getting a Driver’s License in Japan With 合宿免許 (Gasshuku Menkyo)

I’ve often felt a bit silly for not having a driver’s license, and since I don’t really have much to do at the moment, I decided to get one. In Japan, they have something called 合宿免許, which meansLawson 運転免許 something like “boarding school for driver’s license” or maybe “driver’s license camp”. Long story short, I decided to go to one of these. You can find schools just by googling for 合宿免許, or by going to a convenience store (at least Lawson or Family Mart) and picking up a free brochure (pictured). There is a lot of choice… Some websites show you the ratio between female and male students, some schools offer free onsen (mine had this) or sightseeing trips, some ban alcohol and smoking on the premises, etc.

Some schools maybe don’t have their housing directly on the premises. I would recommend against staying at a hotel or anywhere too far from the actual school, or else you might either be commuting a lot or be trapped at the school between lessons. (I sometimes had three hours between lessons.)

You should also check if the school will make you pay more if for whatever reason you do not manage to graduate within the standard time frame of ~two weeks. My school guaranteed no extra charges for a maximum of five days. Most people manage to get by with zero or one extra day, but one of us used six days, who then had to pay about 12,000 JPY (IIRC) for one extra day. There may also be an age limit (30 or so), after which you do not get any free extra days.

Driving courseI ended up going to the 柿崎自動車学校 (Kakizaki Jidousha Gakkou / Kakizaki Driving School) in Jouetsu, Niigata prefecture, mostly based on the fact that it was the cheapest and that my first choice (in Tottori prefecture) didn’t have any availability on the day I wanted to enrol and also only pays for the night-time bus (rather than the train) for students fruntenmenkyo_no_tabiom Tokyo. The train wouldn’t get you there by 11 am anyway, which appears to be the time enrolment usually starts. (All schools that I looked at “pay” for your traveling expenses.) By the way, I booked this whole thing only two days before my enrolment day. During peak months, this might be a bit difficult, but it worked for me in November. (Payment was via convenience store.)

Here is an important bit: You do not get your license from the school. After graduation, you have to take a theoretical exam at your local 免許センター (menkyo center / licensing center), and this costs ~1,750 JPY for the exam itself and another ~2,050 JPY to get your license issued if you pass the exam. (If you do not pass the exam right away, you have to pay the 1,750 JPY multiple times. Also: ドンマイ!)

The price depends on the season. I went from November 7 to November 22, which is in the cheapest season as far as I know. During peak seasons, the total price could be 50% more expensive. There are a lot of students doing this in the summer and winter vacation weeks/months. I paid 226,800 JPY for an MT license program, single room, three (delicious) meals included every day (two meals on the first and last days). The only thing not included was the examination fee for the 仮免許 (karimenkyo / learner’s permit), but that was maybe 2,000 JPY. There is no fee for the practical exam that you have to take to graduate from the driving school. Also, you shouldn’t attempt to do this if you don’t speak and understand written and spoken Japanese pretty well.

kakizaki_practice_carsThe room included a shower and bath tub, a toilet, a desk, a TV, a fridge, and a well-performing air conditioner. Hair driers were available, but maybe not enough for everyone during the peak seasons. Internet access was via wireless LAN, which got a bit wonky at one point (for everyone). (They fixed it when I reported this at the reception.) Here are a few problems with the room:

  • Cigarette smoke from the neighboring room may enter your room from underneath the connecting door. If this happens, get some tape from the staff and tape it off.
  • Similarly, the connecting door isn’t very sound-proof, so better bring headphones if you want to listen to music
  • The pillow is really thick, hard, and heavy. I’d guess it weighs about 2 kg or so? I doubt it’s very good for you. I ended up using an unused section of my blanket as my pillow.

Textbooks were included in the price. There were four books: one explaining all the rules of driving, one explaining how to actually drive, a short booklet explaining CPR and how to use AEDs, and a booklet with lots of practice exam questions. By the way, all the books (and the exam at the 免許センター) had furigana. (They don’t use particularly complicated language though.) The practice cars were Toyota Corollas.

SchedulesThe learning program is split into two sections: the one before you get the 仮免許 and the one after. Both are about the same length, one week. Both sections have theoretical lessons and practical driving lessons. However, without the 仮免許, you are not allowed on the streets, so you will be practicing on the driving course. My second week was much busier than the first week. If you want to do sightseeing, the first week might be better, but I guess this might depend on the school.

The 仮免許 exam consists of a driving part and a written test. The driving part will be done on the driving course. You’ll just be driving around the course, following directions to turn here and there, going over a (fake, of course) railroad crossing, stop near the top of a slope, and drive over a narrow, S-shaped road. The written test has fifty true-or-false questions. You are allowed to make five mistakes. You are forced to take a few practice exams in the lead-up to this, so you’ll likely be fine. If you don’t manage on the first attempt: ドンマイ!

Most instructors are nice, but some can sometimes be a bit scary when they point out your mistakes. At least at my school, it felt like I got a different instructor every time in the first week, with a few repeats in the second week. There were two instructors who I thought were a bit scary, and the scarier of these two (despite the fact that I only had him once, sometime in the first week) ended up being the examiner on my last day. And he was totally fine during the exam and even praised me a bit.

Side note: I’d managed to lift his (and others’) spirits a bit by wearing this shirt. (Edit: looks like it’s no longer available. It had 仮免ライダー printed on it.) Expensive for something that can only be worn a couple times, but worth it. :D I wore it at the 免許センター as well, but it actually snowed on that November 24, in Yokohama! So it was pretty cold and I couldn’t show it off much.

Most people in the program were in their twenties, but there were some 17/18-year-olds and some over-30s and some over-40s. Many aren’t from Tokyo, but I managed to add some new people to my LINE contacts list. The whole experience is also very 寂しい in some ways: You get to like someone, they graduate before you, and you’re left all alone. :(

I don’t want to spoil too much in case you are planning on doing this, so I’m going to leave it at this for now. But if you have any questions, feel free to post a comment and I’ll get back to you.

If you decide to go to the 柿崎自動車学校, I could in theory hand you a “referral” card that would get both of us? (IIRC) 5,000 JPY, but 5,000 JPY is a pretty small sum compared to the cost of this kind of thing. If you live in or near Tokyo, you might want to consider it though!

One more thing: when you pass the test at the 免許センター, you and the others will probably be ushered into a hall and be asked if you want to support your prefecture’s 交通安全協会 (kōtsū anzen kyōkai / traffic safety association) for a fee of 1,500 JPY (or was it 2,500 JPY?) (your 会員証 will have the same validity as your license for that amount, so no yearly fees). I would have liked to know this beforehand, because you don’t really have much time to decide. (I decided to join in the last moment.) However, it seems that this is a rather inefficient organization, with only 20% of the money being used to actually promote traffic safety, and the rest to pay employees’ salaries, according to this article. There are some other merits beside helping them set up traffic safety booths (this is what I’m imagining anyway):

  • Child safety seat rentals (don’t know how that works)
  • If you get into an accident and have to stay hospitalized for longer than 30 days, you will be paid 300,000 JPY (IIRC)

By the way, I managed the whole thing without owning an 印鑑 (inkan / signature stamp). The written instructions say that you will need a stamp, but on the phone they said that a signature will do. I was a bit worried about that when I arrived at the driving school without a stamp, but it turned out all right.

On living in a shared house (シェアハウス) in Japan

At the time of writing, I’ve lived in two different shared houses, one in Nishi-Nippori (http://nippori.backpackers-guesthouse.com/), and one in Kawasaki (which I’m still living at right now and thus choose not to disclose the location or name of at the moment). Maybe this article will help you figure out if shared houses are a good fit for you.

The first one isn’t really a true shared house. It’s more akin to a capsule hotel that you book for at least one month, except that there is a shared kitchen. Perhaps “dorm” is a better word. It’s quite bad. I wouldn’t recommend staying there for more than maybe a month. (I stayed for about three months and then came back and stayed another five months… Ugh.)

Pros

  • Mostly clean
  • Cheap (36000 JPY per month)
  • You can socialize with people (however: it will be tough if you ever don’t want to do this)
  • It’s on the Yamanote line
  • Obviously you won’t have to buy any furniture (or be able to)

Cons

  • Your “room” isn’t a room at all, but a capsule in a cluster of capsules made of wood. The “door” to your room is a curtain. You won’t be able to stand in the bottom capsules, and only maybe in the top ones.
  • You’ll hear every snore around you.
  • You don’t have any mail privacy either; all mail goes into a single box and everyone goes through it to find their own mail.
  • The neighborhood seems a bit peculiar, having a lot of love hotels.
  • There are only three showers for a maximum of ~60? or ~70? people, so you will most likely have to wait in the mornings.
  • Using the shower costs 100 JPY per 15? minutes.
  • The number of washing machines is pretty low too: two or three if I remember correctly.
  • The kitchen is tiny too.
  • Some of the other people around you might seem depressed.
  • Somebody there stole my wallet when I accidentally left it in the shower room for (I think) less than one hour. (However, I never had anything stolen from my capsule.)

I bet it’s an okay place if you’re a young budget traveler looking to explore Tokyo and socialize for a month. If you’re young, please don’t let people convince you that drinking and smoking are good habits! In any other case you should try to avoid the place.

Now the one I’ve been living in for more than two years! This is one of many shared houses operated by Oak House (https://www.oakhouse.jp/). (Most of them are in Tokyo or nearby.) The one I picked was the second shared house that I wanted to take a look at, and I was mostly convinced when I saw the kitchen having an oven! Most Japanese households don’t have a proper oven. The first one I looked at only had a few rooms and seemed a bit depressing with fluorescent lighting and a rather sad neighborhood (Shin-Koiwa).
Oak House’s website often doesn’t say when a particular property was built, so maybe search for the property’s address and find it listed on other websites, which will often include the year. (This place was built in the 1970s. If possible, maybe try for something newer to get better insulation. :p).

Random facts about the current place

  • I’m paying 63,000 JPY per month.
  • My room is about 10 square meters.
  • Bathrooms, laundry rooms, shower rooms, and kitchen are shared.
  • There’s even a small (big for Japanese standards I guess?) garden (which is mostly used for bicycle and car parking and letting the laundry/futons dry.
  • There are about 25 rooms in total, and they’re occupied most of the time.
  • The rooms come with a bed, reasonably nice desk, fridge, air conditioner, and a closet (押入れ). My closet is divided into three sections – the floor section, where I keep my suit cases and bags, the main section, where I keep my clothes, and the top section (which is pretty hard to reach), which I use for boxes and seasonally useful stuff.
  • The inner walls are reasonably thick — I can listen to music and play on my digital piano without having to use head phones all the time. (I don’t play very noisy pieces in general.)
  • The outer walls are either thin or have bad insulation (as does the ceiling), so it’s pretty cold in winter and pretty hot in summer.
  • You have to pay extra (think about 10,000 JPY) if you decide to let someone stay for longer than three nights in a single month. 10 square meters isn’t that much, so I wouldn’t really recommend roomsharing, though I’ve seen two (petite) sisters share a room for about half a year. I once had my mom over for about three weeks though, which was okay.
  • There aren’t many people around during the day. You’ll probably get to occupy the living room and kitchen all by yourself.
  • With approximately 25 people sharing three showers, I have had to wait in front of the shower rooms only maybe five times so far in these two years.
  • The kitchen tends to be used in the evenings, so you sometimes might have to wait a bit. (It’s big enough for two to three people to do stuff at the same time though.)
  • There are four washing machines, so I’ve never had to wait there.
  • If something breaks, it gets replaced pretty quick — so far, this included at least washing machines, microwave ovens, the shared vacuum cleaners, and frying pans.
  • Wireless internet is included. (We recently got decent routers/access points — Buffalo AirStation Pros, which are quite capable of taking care of the many devices belonging to the 25 people here. The hardware we had before was pretty bad.)
  • You can use up to 100 kWh of electricity per month without being asked to pay extra. However, they only check the meters every six months, so don’t worry if you use more in the winter or summer months, as you won’t be using much in October and April. I’ve never had to pay extra, and I generally try to maintain a comfortable temperature when I’m in.
  • The shared space (kitchen, corridors, shower room, laundry room, toilets) is cleaned by a professional cleaning crew every Saturday from around 1 pm to 2:30 pm. During this time you may not be able to use the showers and kitchen for a while.
  • Another nice thing: If you have a lot of money, you can lend it to Oak House and get a 1,000 JPY discount for every 100,000 JPY that you lend.
  • You can choose to socialize with others, or you can totally stay in your room if you don’t want to. We maybe get some party atmosphere once a month.
  • Oak House’s website allows you to view statistics on gender, age, and nationalities. Most of the people at my shared house are Japanese, most are in their 20s. 36% XX, 64% XY.

I’d say that choosing a nice neighborhood is pretty important. This one is mostly residential, and new. Lots of supermarkets nearby too. It’s about ten minutes to the station, which is pretty good. (By the way, don’t expect to be able to park your bicycle at popular stations.)

When you choose an apartment, shared house or not, pay attention to insulation, what floor you’re on, and what direction your room is facing. If your roof has poor insulation, it’ll be really hot on the top floor in summer and really cold in winter. If you have poor insulation and your room faces west, summer mornings will be okay and afternoons will be brutal, and your AC probably won’t help all that much.

Oak House is the one I’m at right now.
SAKURA HOUSE
is another company that operates shared houses.

If you have any questions, feel free to leave a comment.

“Reply As Original Recipient” Thunderbird Extension

GitHub repository: https://github.com/qiqitori/reply_as_original_recipient

URL: https://addons.mozilla.org/en-US/thunderbird/addon/reply-as-original-recipient/ 

This Thunderbird extension automatically changes the From: field in replies to whatever the original sender’s email had in To:, but only if there is a + in the email address (and there is only one address in To:).

URL: https://addons.mozilla.org/ja/thunderbird/addon/reply-as-original-recipient/ 

返信の時、受信したメールの「宛先」に入っているメールアドレスを返信の送信元に設定してくれるThunderbirdアドオンを作ってみました。
(ただし、仕様上、宛先のメールアドレスに「+」が入っていないと動作しません。メールアドレスが二つ以上入っている場合も動作しません。)

URL: https://addons.mozilla.org/de-DE/thunderbird/addon/reply-as-original-recipient/ 

Mit diesem Thunderbird-Addon wird bei Antworten auf angekommene Emails, die im “An:”-Feld eine Email-Adresse mit einem “+” enthalten, das “Von:”-Feld automatisch auf jene “An:”-Email-Adresse gesetzt. Allerdings funktioniert dies nur bei Emails, die nur einen “An:”-Empfänger haben.

2017-01-29 edit: 1.1 beta version: reply_as_original_recipient-1.1-tb.xpi
This version adds an option in the config editor that allows the extension to work even if there is no plus character in the To: address. The option is at “extensions.replyasoriginalrecipient.use_plus”. The default is true, meaning that the address has to contain a plus character.

クックパッドで見つけた美味しいレシピ、和風&洋風のミックスの編

今年(2016年)の1月から、クックパッドのプレミアム会員です!
今まで見つけた美味しいレシピを共有してもいいのでは?と思って〜
並び順はおすすめ順かな?適当な場合もあるかもしれませんが…
今回は、和風&洋風のミックスの編です!一番わくわくするカテゴリじゃありませんか?^^
和風編はこちらへ
中華編はこちらへ
カレー編はこちらへ

洋風編はこちらへ

http://cookpad.com/recipe/3432724 自宅で作る基本のミートソース
神レシピ!
味噌、料理酒、かつおだし、豚肉が主人公。
パスタよりも、カレーと同じように、ご飯にかけて食べた方が美味しいと思います!
さっきも食べました。これを食べて、この記事を書こう!と思いつきました!
2017年1月30日追記: ほうれん草とかも合います。

http://cookpad.com/recipe/3678114 簡単すぎるトマトクリームうどん
マイルドな味わいで美味しかったです。
作った時のメモによると、うどん400 g、ウインナー 90 gを使用していました。
他のパスタものもうどんで作ってみたいなぁと思います!

http://cookpad.com/recipe/2814803 簡単☆ピザ生地(照り焼きチキン)
美味しいです^^

クックパッドで見つけた美味しいレシピ、洋風編

今年(2016年)の1月から、クックパッドのプレミアム会員です!
今まで見つけた美味しいレシピを共有してもいいのでは?と思って〜
並び順はおすすめ順かな?適当な場合もあるかもしれませんが…
今回は洋風編です。
和風編はこちらへ
中華編はこちらへ
カレー編はこちらへ

http://cookpad.com/recipe/1192653 スウェーデン・レンズ豆のスープ
ヨーロッパでよく食べました!

http://cookpad.com/recipe/2105902 我家の定番ツナベーコントマトパスタソース
そんなに特別なものではないですが、美味しいです^^
塩を減らしてコンソメを入れる時もありますが、意外となくてもいけます!

http://cookpad.com/recipe/1753696 *アボカドとツナのレモン醤油サラダ*
サンドイッチに挟んで食べました。

クックパッドで見つけた美味しいレシピ、カレー編

今年(2016年)の1月から、クックパッドのプレミアム会員です!
今まで見つけた美味しいレシピを共有してもいいのでは?と思って〜
並び順はおすすめ順かな?適当な場合もあるかもしれませんが…
今回はカレー編です。
和風編はこちらへ
中華編はこちらへ

http://cookpad.com/recipe/252807 簡単☆チキンカレー(中毒性あり)
美味しいです〜
手羽先ではなく、もも肉で作りました。
ちょっとは、コンソメなどを入れてもいいと思います!

http://cookpad.com/recipe/529993 レポ1000人感謝●簡単本格ナン●
なんですか?そんなに本格的ではないですが、おいしいですよ!
本格的でないのは、オーブントースターで作っているからかもしれません…
ちなみに、生地を作りすぎて、余った生地を一日くらい冷蔵庫に入れたら、結構大きくなったのですが、美味しかったです。その時はカレー用のナンではなく、サンドイッチにしました。

http://cookpad.com/recipe/2000611 カレー焼きそば
焼きそばならこれがおすすめです。ただし少し飽きやすいかもしれません…

クックパッドで見つけた美味しいレシピ、中華編

今年(2016年)の1月から、クックパッドのプレミアム会員です!
今まで見つけた美味しいレシピを共有してもいいのでは?と思って〜
並び順はおすすめ順かな?適当な場合もあるかもしれませんが…
今回は中華編です。
和風編はこちらへ

http://cookpad.com/recipe/2730789 トマトと卵の中華炒め
中国に住んでいたことがありますが、これはよく出ていました!

  • 仕上げに、米酢を入れます!(小さじ2杯は既に少し多いかもしれません)
  • お弁当には向いていないです。卵とトマトは半熟くらいが美味しいです!
  • 中華スープの素は、顆粒のものを使った方が良いです。私はウェイパーで作っていますが、ウェイパーだと、溶けにくいです。
  • 中国で食べたものは、トマトと卵以外の具は入っていませんでした。

http://cookpad.com/recipe/2563740  ウェイパァーでふわふわ卵のレタススープ

私は肉は入れません。
簡単ですし、すごく中華って感じのスープで、外国人も大喜びしてくれます!

http://cookpad.com/recipe/837544 濃厚ウマ辛♪坦々麺
最近は作っていないですが、お店のよりも美味しいですよ^^
中国の担々麺はだいぶ違うから…中華でいいのかな?
作業タイミング的には、なかなか難しいかもしれません。全部合せておいてから作った方が良いです!

http://cookpad.com/recipe/2183021 簡単ズボラ、味は本格★チンジャオロース
美味しいです^^

クックパッドで見つけた美味しいレシピ、和風編

今年(2016年)の1月から、クックパッドのプレミアム会員です!
今まで見つけた美味しいレシピを共有してもいいのでは?と思って〜
並び順はおすすめ順かな?適当な場合もあるかもしれませんが…

http://cookpad.com/recipe/2588173 簡単☆小麦粉で作るチーズお好み焼き
お好み焼きを作る時は、いつもこのレシピです。
ただし、これだと、少し分厚いかもしれません。
ほんだしは、もうちょっとだけ濃くしてもいいかもしれません。

http://cookpad.com/recipe/2407781 もっちり美味しい♡ニラの薄焼き
初めてのつくれぽを付けたレシピです!
美味しい&安いです!
飽きやすいかもしれませんが、難しくないので初めてでも成功する逸品です!

http://cookpad.com/recipe/2348826 エリンギの帆立風!にんにくバター醤油焼き
ちなみに、これを、豚醤油というもので作ったのですが、大変美味しかったです。
豚醤油は、http://ccib.or.jp/?page_id=308で購入できます。
高いです(´・ω・`)
他のブログなどを見てみたら、たまにお店でも買えることがあるらしいです!最初にメールで、どこか首都圏のお店では購入できませんか、と問い合わせてみましたが、現在できないということで、メールで注文して着払いで払いました。

http://cookpad.com/recipe/2921320 大根と合挽き肉の甘煮
美味しいです^^
「これが日本の味ですよ」と外国人に出すのに良い逸品だと思います!

http://cookpad.com/recipe/2839788 ♡レンコンと秋刀魚の黒酢あんかけ♡
きれいだし、美味しいです^^
ただし、秋刀魚ではなく、チキン竜田で作りました。

http://cookpad.com/recipe/1374729 手作り和風ドレッシング☆
簡単な和風ドレッシングです。美味しいです^^

Buying a new used laptop in Akihabara

The laptop I’m still typing this on recently developed a loose contact in the AC adapter’s cable. The laptop I’m currently using was also bought used in Akihabara in 2013, for only about 8000 JPY. However, it was lacking a wireless card, had only 1 GB of memory, and had an 80 GB harddisk in it. Well, I put in the SSD and memory and wireless card from my old broken laptop, and performance-wise had myself something very close to that old laptop. Except instead of a Core2 Duo P7350 CPU, I now had a T7250. So that’s a tiny performance decrease. (This link has benchmarks for both CPUs: http://cpubenchmark.net/midlow_range_cpus.html)

Annoyed about the AC adapter, I decided to head to Akihabara to find a new (well, or used) one. HP part 384021-001. But since this laptop is kind of old and slow and only supports up to 4 GB of memory, I also headed to Yodobashi Camera to look at new laptops first. I thought the HP Spectre looked quite nice on HP’s website. But the real thing looks a bit flimsy and only seems to come with Thunderbolt ports. Wow, they still sell laptops with 2 GB of memory. They still sell laptops that only support up to 4 GB of memory. They still sell laptops with harddrives! And they’re still like 50,000+ JPY (currently 480 USD). The good ones are all 100,000+ JPY (961 USD). Boo, let’s get out of here.

And I found my AC adapter, for only 1500 JPY! Great, but the guys at the store wouldn’t let me test it right there… Lame, so half-thinking they’d let me after all if I told them that would be a bit risky for me and walked out (they didn’t), I decided to check out other shops, and found one that wanted about 2500 JPY. Hrm. And thus I decided to just go ahead and buy a new used laptop. I’d already sort of looked for bargains while looking for the AC adapter, and found something really good: A 2012 Lenovo ThinkPad (T430S), with an i5-3320M (4013 points vs. 1120 points on the T7250 as per http://cpubenchmark.net/mid_range_cpus.html), 8 GB of memory (upgradable to 16 GB), a 240 GB SSD, and Windows 7 Professional. Price: about 35000 JPY (336 USD). Also, the shop had a dozen of these laptops or more. The shopkeeper asked me if there’s anything I’m especially interested in given all this choice. Well, I just said I’d like a decent battery, and then the shopkeeper looked for a laptop with a clean keyboard, and tried various batteries to see which one had a good remaining capacity. Well, he found me one that had almost 100% remaining.

So how do these specs compare to a new laptop these days? Let’s take the MacBook Pro (“Early 2015”) that I had been using at my previous workplace. Note that this is still the newest MacBook Pro available. Apple hasn’t updated this line yet. The one I was using was purchased new in around October 2015 for I’d assume about 172,800 JPY. That’s the current price for a similar model anyway. Compared to the one I bought used, that’s the same amount of memory, an i5-5257U with a score of 4339 on http://cpubenchmark.net/high_end_cpus.html (i.e. 8% faster than my new 4-year-old laptop), and a similarly sized SSD. Now, the MacBook is lighter, has a really nice touchpad and a very nice retina display, probably higher-grade memory, and the SSD appears to be plugged into PCIe, but is that really worth 4.94 times the price? Not in my opinion. (Note: you can buy used MacBooks, but they’re still around 100,000+ JPY.)

So looking for a used laptop and care about price, condition, and battery performance? I’d say Akihabara is a good place to go.

DSC01872