fedora 蓝色小药丸

BP 1st year

Basic Program is a reading program from UChicago. The information can be found here [1] and currently it is open for signing up for the next year [2]

Other than BP there are also Open to All Courses and something called "Alumni Courses".  If one follows closely, there are often trials and free events to sign up as well, to get a sense who the educators are, and what topics are being discussed, and how the courses are taught.  For example, the first Friday of every month, there is a signature event — one hour seminar that I always look forward to. In this summer, there is the class "BASC70100 -    How to Read Classic Texts:  75th Anniversary Edition" [3], highly recommended.

Last year there were frequent discussion events on movies too. I tried once but did not watch the movie in advance. Then I signed up for another one, "Force Majeure", and watched a couple of times, then I forgot to join the discussion. Same for the movie "Black Panther".. so somehow I refused to share my takes, more to that later.

Collapse )
fedora 蓝色小药丸

2020

Last time I wrote a review was in 2018, about 2017. Or maybe I wrote something elsewhere, maybe on Twitter? It was hard to write something freely even with my mother language.

The last week of 2020 was a happy time. The company I worked for (Morningstar) made a decision to let everyone take off this entire week. I kept telling myself unlike before, a break does not really mean a break to me. As a developer I know the feeling of overly relaxed and then find it hard to get back to work — when you pick up the left over programming work, only to find it written so badly and could have a completely rewrite. Right now I am thinking more like a PM, so when a project is not physically going, I still can think about it, and there is no way to re-submit a WIP project. But nevertheless, the past week was a happy one. Sleep late at night to read or watch movies, then wake up quite late, a long missed luxury. Have lunch and prepare to go skating, then have dinner when come back from the Warren Park Ice Rink. I prefer simple and repetitive days like this. In 2016 when my parents came over, I also took a long leave. During that time, the daily schedule was just swimming with dad. Even though we lack the skill in either activities, it is good to kill time together.

Collapse )
fedora 蓝色小药丸

Crime and Punishment

As a step to improve the illiterate situation I joined the Basic Program this year. It had been in my mind for a couple years, but glad this time I signed up in time — the program starts every Fall, but it was some programs that the company paid in 2019 that finally set things in motion. Plus, one good friend also took the class and her feedback was a great positive, esp. for Mr. AR

Indeed I enjoyed the session on "How to read a book" -- https://www.amazon.com/dp/B004Z0TU0W/ and the Fall session that just concluded was enjoyable as well.  I kind of understand the story but from Antigone to C&P, they did not go really deep inside me. I'd prefer the more abstract, analytical "Meno", where I can find reasoning, while author's intention is of least concern.

C&P did give me a tearing moment, but many people may find it strange. It is when Raskolnikov went to see his mother. It is totally breaking my heart as that is a goodbye. Raskolnikov did not have an idea that Napoleon may not have treated his mother like that.

Collapse )
fedora 蓝色小药丸

THOTCON 0xA recap

Sessions https://www.thotcon.org/schedule.html

THOTCON 0xA had these parts relevant to me

— Visit the villages

Usually I can spend half an hour or more to work on something. Last year it was a car hack game, and this year there was a radio related booth. I am always interested in radio stuff, but never tried it. Now everything is digital, software based (SDR) so it feels even more complex. I wondered why people are still playing with that, when there are better ways to communicate. One of the booth hosts told me he is into radios because things like wifi or bluetooth are just radios, so working on radios helps to understand or work on those things.

Didn't have time or the fun to work on car hacking booth. Every time I feel I am an outsider, it takes a lot time to settle down and enjoy some puzzles or conversations. I don't work in security, just interested, and I know so little. Worse is that I only attend the first day without the party. I have to take my son to a mini maker faire at Schurz HS on Saturday. Have to persuade myself to buy next year's ticket, but it might be better if someone I know can attend too? 

— Luckily there is someone I know (and who is always kind to me) also attending. Watched how he and another colleague solved puzzles

Collapse )
fedora 蓝色小药丸

Cost of living 2019

Now first quarter is over..

Things you have to pay all the time

— Mortgage, $1427/mo because we have a small condo and pay the minimum

— HOA, $189/mo, also on the lower side

— Car loan, $211/mo; gas is about $40/mo ($2.9/gallon) because we drive so little (but everyday), insurance is $106/mo. So far the car did not require maintenance. Maybe we'd be better off using Uber, but nobody bothered to calculate it.

— Utilities, $220/mo, electricity is around $40, remaining is gas, too much for a too small room :( we use Nest (and 3 extra sensors) to keep the room at ~71F

— RCN internet, $46/mo, I used Google Fi and had to pay for device, $70/mo; wife uses T-mobile $35/mo. We are not on speaking terms so she does not need even the included 100min talk time.

Things you cannot really miss

— Charitable givings, $200/mo and not recurring. This year I had to skip CSO season tickets due to tight budget, so sorry no more donations from me..

— Healthcare, $900/mo, but it is a one time event. I can only see one or two similar events coming up, not in a hurry

— Groceries, $600/mo

— Education, $500/mo, and it is including skating for both JY and me ($101/season), his Ukulele enrichment class ($35/30min), his after school programs (chess and piano for this term), other CPD programs like swimming and drumming

— Restaurant, $260/mo, include coffee shops, since only I eat lunch out, and the cost of lunch has increased to around $11/meal

Things that are flexible

— Electronics, $120/mo, got a pair of AirPods recently

Collapse )
fedora 蓝色小药丸

Shutdown application context

Recent technical issue at work involves how a sprint-boot application shutdown itself. There are several types of applications we have over here, some are simply spring-boot web applications or scheduled applications, which should never shutdown. Some are SQS listeners that also do not shutdown. On the other hand, there are batch type of applications that should shutdown gracefully. And such batch type might be SQS listeners too. So someone built a SQS handler that can shutdown when after a given time there is no message, and another guy built an override handler that also shutdown when a message matches some criteria (it does not matter if message is handled, it seems nobody cares as the message will be retried in the next scheduled batch). And some batch simply shutdown after it is done. The technical issue was that, they refuse to shutdown. It turns out such application has defined DataSource bean using the commons-dbcp2 module. In there there is a thread pool that has to be destroyed by calling BasicDataSource.close(), which is automatically done by spring-boot if everything is configured as intended. But in one case, the DataSource is not defined as a bean, so its "close()" method is not called. The IDE was able to catch some errors but the stack trace was wrong — did not show the problematic DataSource but point to a different one. In another case, DataSource has JMX warnings after application shutdown, so instead of disabling JMX, developer added (destroyMethod="") to the bean annotation, which means the "close()" method is ignored by spring-boot. Finally, some application does not close its application context. It is fine to ignore the "close()" in most cases, as most applications are supposed to run forever. And if the context is closed for a web application, such application will shutdown immediately after startup. Having subtle difference in an often boilerplate "Main" class is not a good practice when there are so many modules to maintain.. and it caused problem. If developer has to call System.exit(0) that is a bad smell.

Collapse )
fedora 蓝色小药丸

#thotcon badge?

[root@m4700 ~]# esptool write_flash 0x00000 /home/yuan/tracking/thotcon0x9/tc0x9.bin 
esptool.py v2.3.1
Connecting....
Detecting chip type... ESP8266
Chip is ESP8266EX
Features: WiFi
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Warning: Could not auto-detect Flash size (FlashID=0x1851f, SizeID=0x1), defaulting to 4MB
Flash params set to 0x0240
Compressed 296480 bytes to 211973...
Wrote 296480 bytes (211973 compressed) at 0x00000000 in 18.8 seconds (effective 126.0 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...

不知道为什么,Windows 下 curl 只下载到一半文件, esptool 的 exe 和 py 都报 timeout receiving header,只能看到板子上有灯在闪。 Linux 下一下子就刷完了。大概是因为转到 Linux 下尝试之前拨动了开关,我本来以为刷 flash 一定要把开关拨到 off

刚拿到的时候,TPP 那一页可以显示几行字,现在停在 "Loading" 不动弹。大概是坏掉了吧。
fedora 蓝色小药丸

Portfolio weighted averages

Last week I got an assignment to make a small Java library for some often used portfolio calculations. A portfolio is a collection of holdings, each holding has a weight, has multiple associated attributes. All data type is Double. The calculation involved are just sum and averaging, which is so easy in Java 8 Stream. So I said there is nothing to re-use about.. plus a very generic routine is hard to understand and use. As an example I hand crafted a "classify" method that accepts a Function<H,C> to find its classification, and also uses a Map<C,Double> as its internal state, a method to update this state, a method to export a result. And that method internally calls another GenericAccumulator that simply iterates input. Long/Short handling was added as part of the iteration loop, and sum/averaging on the other hand was part of the "classify" method body. This successfully confused everyone including myself.

Collapse )
fedora 蓝色小药丸

Installed nvidia driver

Since Fedora 28 wayland is crashing for me (Dell m4700 with external monitor), I got some time to try the nvidia GPU driver. At first I looked at https://www.if-not-true-then-false.com/2015/fedora-nvidia-guide/ which shows the actual output when installed: in "About" page it will show the nvidia card name. Then since it is easier to install from RPM Fusion, I followed https://rpmfusion.org/Howto/NVIDIA. The document is concise but helpful. For example, when it says "Secure Boot" has issue, then it is best turned off in BIOS. For another example, when it says "Wayland" has issue and must install something from Copr, indeed that is the case. Also the "grubby" command to update kernel command line is helpful too.

I followed another article https://gorka.eguileor.com/vbox-vmware-in-secureboot-linux/ to sign the modules. First create a key, then register the key to UEFI, I never did this before. I cannot find the keyring ".system_keyring" but /proc/keys shows something else.

Collapse )