Saturday, April 11, 2020

Project Euler - 300 problems solved


300 times of thrill, out of exactly two years of hobby that cost zero money (I started on 2018/04/10). Only ~800 people in the world above me now.

WarnerBros.com | 300 | Movies

Saturday, February 8, 2020

LeetCode resumed : zero execution time???

I could not solve either LeetCode or Project Euler problems for about 3 months as I was very busy with new job and transcontinental relocation. Now that I am mostly settled, I find some time to get back to my recent hobby. I was afraid whether the python basic skills are all gone. It turns out that it is not the case. I solved a few easiest LeetCode problems to learn that I still have the most basics pretty much like I had until a few months ago. Great.

Anyway while solving #1323 [Maximum 69 Number] I hit zero run time. The first time ever seeing zero, out of 600+ problems solved so far. Interesting.



Friday, October 11, 2019

A strange approach pattern toward JFK airport


I was on American Airline flight #4 from LAX (Los Angeles) to JFK (New York Kennedy) on 10/05. That was roughly my 30th time flying that route, way over 50th times landing onto JFK airport. And I have watched hundreds of actual approaches in Flightaware. But I have never seen that sort of landing approach.

AA4 was cleared for landing onto runway 22L, southwest-bound. Typical approach pattern when flying in from the west, or particularly north-west, is right along the Hudson river southward (to avoid interference with nearby EWR on the west and LGA on the east), turn southeast into Atlantic Ocean, then make a great counter-clockwise circle centered around JFK, finally lining up along 22L for landing. 31R (northwest-bound landing) approach is quite similar except at the very last step. I know this annoying pattern very well since this detour adds 15~20 minutes of extra airborne time right near the destination airport (compare it with westbound straight approach / landing into LAX). There are lucky days where the flight takes southern route (along KY-WV-MD-NJ) and lands along 4R, or takes more common northern route (along IA-Chicago-Lake Erie-NY/PA border) but are allowed to go straight to north of JFK through Bronx and lands along 22L. Latter case can save 10+ minutes. However, they are both relatively rare. These three are all patterns I've known so far for landing along heading 4 / 22 / 31. Until the above AA4. Which flies toward JFK along heading 13, turn NE, making 180 deg turn to land right away. While the heading was along 13, the airplane was flying quite high. It disproves the possibility that the landing direction suddenly changed from 13 to 22. In fact 13 landing requires steep right turn at the very last minute, very different from the type above.

I just wonder what happened on that day.

Wednesday, September 25, 2019

LeetCode (bi-)weekly contest

I have practiced Python coding as well as data structure + algorithm using LeetCode for over a year now. I solved all easy level problems, and almost half of the medium level ones. Although I liked solving problems one by one I started feeling the need for new challenges to further improve my coding skill. One of them is contributing to open source project to experience product grade codes, and the other one is doing coding contests.

Last Saturday there were two contests on LeetCode - weekly #155 & biweekly #9. The latter one was held in the morning and the former was at night in US Eastern time. Both sets had four problems; one easy, two medium, one hard over 1.5 hours. My goal was to solve one easy and one medium at the minimum. In the end, in the morning contest I solved two in time, and the third one 10 minutes after the contest was over. Not bad. However, in the night session I solved the easiest one in 5 minutes, and the second one 20 minutes after the contest. I spent the entire time on one medium level problem. Frustrating as I could not solve any other problem in time, amusing as I solved it at last. That particular problem turned out to be a difficult one. It scored nearly the lowest acceptance rate out of medium level ones. And people seemed to agree that this week's set was particularly harder compared to average weekly contest.

Solving problems under fixed time limit was quite different from solving without. Strong time pressure worked both ways: on the one hand it restricted my reasoning so that I had hard time coming up with ideas which I could have realized easily otherwise, but on the other hand it brought me into high level of concentration and efficiency which I haven't experienced in the past.

Quite fun. Will keep participating contest weekly. Do you have any advice on how to get the most out of coding contest?

Wednesday, August 28, 2019

How to distinguish aircraft types?



I have been an avid enthusiast of airline industry for about 15 years. I am thrilled by almost all aspects of aviation. From mechanical technicality of flight itself such as engine thrust / aerodynamics / navigation control to airline operation in both passenger and freight markets worldwide. Even just watching airplanes flying or taxing is what I can do for hours everyday.

Interest brought in curiosity. I kept searching for and learning about everything of anything aviation. Here is one demonstration of years-long self study: a guide to discriminating aircraft types. The initial version of the slides was compiled 8.5 years ago for a friend looking for help. Today I post the revised version including newer aircrafts like Boeing 787 Dreamliner and Airbus 350. You can download PDF here.

Note that no airline appears twice. I deliberately chose only one picture for each airline so that as many different airlines are included as possible. As the watermarks indicate, most of the images were imported from airliners.net, a popular website for high quality aircraft photos. They do not keep the photos from being used for hobby purpose. Nonetheless I appreciate for the efforts of all the photographers and do acknowledge the generosity. The above image is one of them, showing Boeing 777-200, my favorite.

Tuesday, August 20, 2019

select vs. selected

I was probably no different from you. I believed selected is the only grammatically correct adjective for publication whereas select is not. I observed, however, that 'select publication' are frequently used in CVs (curriculum vitae) of numerous native English speaking professors of top ranking universities. It must not be a collective coincidence of mistakes. In fact, according to this article it turns out that both are correct. You can use either, depending on context. "select" is best suited for cases were the choices are made based upon excellence or superiority, while "selected" is better when the choices are made based upon neutral criteria such as years in which a product was manufactured. Select is not only correct for publication but is far more appropriate than selected if you would like to highlight top papers. There could be cases of course where you meant selected publication. But don't be tempted to feel incorrect when you see select publication in my CV. That is precisely what I intended to mean. You're wrong, like I was.

Tuesday, August 13, 2019

Enigmatic

One of the moments I truly enjoy. I am trying to figure out the underlying logic for Project Euler problem #248, scribbling on a restaurant napkin while waiting for food. Specifically, analyzing numbers for which phi(n) = 120 (5!), which I obtained with a brief brute-force code.


Philips SAECO Xsmall espresso machine repaired

I have a SAECO Xsmall espresso machine. I bought it in Dec 2014, and brewed 2~3 cups of espresso per day on the average over the last 6 year...