Categories
401k and Personal Finance

Weekend thoughts: Zoom and Math

Reading Time: 2 minutes

For most Americans, Zoom meeting probably becomes the hottest potato in last few weeks, as we saw the pandemic situation got worse: New York, New Orleans, Detroit, Dallas, and so on. I started to using Zoom about a year ago when I started my new job, and the product experience was good. Note I have used many meeting software in the past, from Webex, Skype, GoToMeeting to google hangout, Slack, Microsoft Teams. Before Zoom GoToMeeting was my favorite. Skype probably is the worst. This is not a scientific comparison, mostly my gut feeling. Zoom is pretty standard in technology companies as well, even for interviewing (no more airplane ride, and uber ride, and hotel stay). Couple more points on Zoom. Zoom is not perfect in terms of security and privacy. And yours truly owns a few shares of Zoom. Last but not least, I do like Zoom’s founder, Eric S. Yuan (wiki English; wiki Chinese). It looks like he came to the US the same year I came. He is very much grounded person, even though is a billionaire now. I think he came from a humble background in China, which is common in China in those days (he was born in 1970, one year earlier than me).

But my point here is while Zoom is important, we should not equivalent zoom = learning or communicating or working. For that I am very much appreciative of this tweet by @DHH.

A more important task, in nowadays’ always-on culture, is the basics: reading, writing, thinking and so on. Otherwise we will end like this. Everyone makes mistakes, my point is not that Brian Williams makes stupid math mistakes. It’s more the issue two people talking about the talking points without realizing that their math is totally wrong. This is more issue in the America right now: the guy or the girl who have the microphone (in some sort of public facing position) usually don’t know what they are talking about. If in doubt, just look at the white house.

Last but not least, here is a stimulus check calculator developed by OmniCalculator.

Stimulus Check Calculator

Categories
401k and Personal Finance

Financial crisis and wall streets movies

Reading Time: < 1 minute

Hank: about Hank Paulson, available at Netflix

Too Big To Fail: on Amazon Prime

I am only curious about Wall Street and movies by Michael Lewis

Categories
401k and Personal Finance

Technology, distance learning and my meltdown

Reading Time: < 1 minuteI was thinking about this as we are at least expecting one month of distance learning for our two kids (K and 4th grade) due to the lockdown of Coronavirus pandemic. Ladue School use google suite and I think they may use google classroom for some or most teacher / students interactions. I was thinking about Zoom as Zoom recently announced free usage K-12 due to the pandemic. Many tech companies have similar initiatives. Not sure how my two kids will handle this. They are not super confident or outspoken in the class: I was hoping they could be a bit more confident (or a lot more) and be a bit more assertive.

This remind me one thing when I was already graduating from middle school. I called my classmate, at that time it’s not the direct phone, it’s like operator assisted phone. The classmate came online, and I did not know what to say (I was shy at the time too), and just freaked out in the end. I don’t think I would freak out in person. So there is my 2 cents on the distance or online learning. It may create some challenges to students who may not be comfortable with microphone or public speaking. For myself, I tried to improve myself on this aspect, I made some progress: and it was still working in progress. 🙂

Categories
401k and Personal Finance

I love Italy

Reading Time: < 1 minuteThe news coming from Italy is heartbreaking: Italy lost nearly 800 people in one day due to Coronavirus. Overall Italy lost more people than the epicenter of outbreak in China’s Hubei province (Wuhan is the capital city of Hubei, with 11 millions people). I think Italy has a population comparable to Hubei’s. In my high school years, a while ago, I watched quite a bit Italian soccer league, from Maradona to other Italian and International players. Milan has two teams: AC and Inter. And I know a little about Italy from the world history class. They are some explanations of the higher death rate in Italy. I hope things can get better from here. Besides the difference in terms of social distancing and lock down, Wuhan / Hubei did have one advantage that Italy does not have: that is China poured help from many other provinces: in total there were more than 40,000 doctors and nurses coming from all over China to help, that was about 10% of the relevant healthcare resources in China. Here is an article talking about the people in Wuhan sending off the medic teams leaving Wuhan when the mission is completed.  This kind of arrangement is difficult to accomplish in Italy, if not all possible. But note China did send some help in terms of advisors (doctors) and medical supplies to Italy, Iran, Spain and other countries (Serbia, Czech), also neighboring Asian countries too.

Categories
401k and Personal Finance Career Life

Working from home amid pandemic and financial crisis

Reading Time: 2 minutesI have my first experience of working from home amid financial crisis in Nov 2008. I started a new job with Autodesk consulting division at the time, after working for my previous employer for 8+ years. My intention is to get more customer engagement experience, and also if I stayed, I would probably stay for a year or more to go through the financial crisis. So I decided to jump ship.

It was not smooth experience. I probably would not do it if I have to do it again. Couple reasons: 1) I was not familiar with the software I was supporting or consulting with, it’s a new language and new application for me; 2) I was new to working from home. Before that I did some working from home due to doctor appointment, or as integrator doing after hours work, or doing development work on thanksgiving when I am bored (I was single then). I also worked from remote office (Shanghai) for 6 months: I social with my Chinese colleagues there though. Some of the bad memory I had: I wear panamas all day, the work never stops really, from morning say 9 am until 10 pm, because the laptop was always on. There is no colleague to ask for ideas or chitchat, or have an intelligent discussion.

Financial crisis is another source of uncertainty, as the economy is basically in decline or flat for a while. Job security, project renewal etc. I think of things I can control, and things I cannot (this is something I learned from Arch Coal, esp. from David the CIO later on). I have a bit more control on my work, but absolutely no control on the market or economy. I have some control on the project, or best practice or process. At that time my sweet point is actually work from Panera bread, Borders (the book store, not gone), Barnes Noble and Starbucks (not my favorite because it’s a bit crowded). I recall seeing Frank Cusumano couple times at the Borders (maybe Bread Co too).

So slowly I gained some confidence this way, by playing my strength: developer mentality, analytical, source code version control (even for the automation design we were doing). I still switched to a regular office developer job in Feb 2010. But I think I learned some valuable WFH or remote lessons in my 15 months at Autodesk $ADSK

Also read work from home friendly companies.

(Update 05-27-2023) Came across this article – Elon Musk says the ‘laptop class’ needs to ‘get off their moral high horse’ when it comes to remote work” (also the original interview on CNBC with David Faber on video). My quick comment: Elon made his point. My counter point is knowledge workers (teachers and principals included) don’t stopping working when they are off-work: the brain doesn’t working or thinking in off hours. Sometimes I think about work related problem in sleep (dream) too. || Btw, Elon obviously needs more sleep (and chill) looking from the picture in the article. A side point from Elon is more valid though: that is the envy, or jealousy or “comparison with others is the thief of the joy” are very common in our daily thinkings. Or “grass is greener at neighbors yard”. This is more a physiological phenomena though.

Categories
401k and Personal Finance

Market, corona virus, panic

Reading Time: 2 minutes

The US stock market started to feel the heat of corona virus in recent weeks. This week is the worst in term of the percentage loss (8%) and the fear of the market.

Along the same lines, so much fear among the ordinary people due to the news such as Tom Hanks got infected, NBA / NCAA games cancelled, Italy was getting into situation like Wuhan (healthcare system was overwhelmed), and the quarantine / shutdown of the whole country. I can feel the fear of the market as my friends talked much more about the market on wechat.

Last time things were like this, in terms of both the percentage drop (and the speed of the drop), CNBC running extra evening shows, and friends got excited and discussing stocks nonstop (at mitbbs, trader1688, gutone etc websites, no wechat app yet). Then comes the craziness of the stocking things from grocery store or drug stores, from hand sanitizer to toilet paper, from food to drinks. I do understand the situation in Italy and other countries. I also understand the “under-test” of US sick population. It’s improving as time goes, just as the WH made announcement this afternoon. As to the “buying craziness”, I still think it’s unnecessary. When this thing first started in Wuhan, China, friends here asked about buying face masks. I did not listen. I may still a few left in my year 2017 trip. But I am not overly worried. I am cautious though: try to stay away from the crowds, including office. I think we will likely to overcome this.

While for me compared to 2008/9 financial crisis, I am both older and have 2 young kids, I am not overly scared. I do have some savings and lift insurance. I will try my best to keep myself from getting sick. Short term it will be horrible for many people who have less meanings. We should try to help if / when we can.

Last but not least, I maintained a wiki page for the corona virus at github. You may also note I made some changes to this wordpress website recently. Started about a year ago to upgrade the WP to 5.0 (manual) to the upgrade a day ago. I am still trying to figure out things as I made changes, for example, I found out the comments not longer show: I likely did intentionally a while ago to battle the spams, but I could not put it back as the stlplace.com/uudaddy has. Also note uudaddy.com is moved under stlplace.com/uudaddy (site consolidation, I don’t want to pay $18 for the uudaddy.com domain name). I had the domain in 2010 when my first daughter is born, and I think going forward I am ok with the stlplace.com only. A lot has changed since I have the stlplace.com domain, with the virus I think longer term we will use more internet, web, devices and virtual learn / interaction instead of physical. This is a bit unfortunate, but we live in ab “adapt, or die” world.

Categories
Software development Technology

Java thread and interview questions

Reading Time: 2 minutes(Update 2026-04-11) Refer to this coding example at GitHub.

(Update 3 10-28-2020) Link to JoelOnSoftware

(Update 2  10-27-2020)

Java
1) What is the difference between and interface and an abstract class(pre Java 8)?
2) Name a design pattern you have used (or would like to use)?
3) How would you implement the Singleton Design Pattern?
4) Since Java 8, what is the preferred way to avoid an NPE?
5) What goes on the heap and what goes on the stack? What can you tell me about the Garbage Collector in java? Can you have memory leaks in java?

API development
1) Difference between SOAP and REST
2) Difference between REST and RESTful
3) What are the best practices that are to be followed while designing RESTful web services?
4) Some of the methods (verbs) in REST: 1) GET, POST, PUT, DELETE; 2) Is Post idempotent?
5) Describe some of the API management tools you used, for example, Swagger, Apigee etc?

Microservices Cloud environment (Azure, AWS or GCP)
1) What are some features of a Microservices architecture?
2) What is 12 factor application? List some of the factors and explain them.
3) What cloud providers did you use? What are their strength and weakness? Or some pain points?
4) What are some of the frameworks and tools you used for micro-services development?
5) How do you monitor the apps? Do you have any recommendations or best practice for logging and tracing?

Some devops and automation experience as well (i.e. Docker, Kubernetes)
1) Where did you deploy the micro-services you or your team developed? Or what is your deployment environment? Is it IAAS (infrastructure as a service), or PAAS (platform as a service)?
2) How do you deploy apps to the dev, test and production environment? Did you use any CI / CD tools?
3) What are the main steps in a pipeline build / deployment?
4) Have you done any automated testing / validation?
5) For cloud infrastructure build out, do you use the console (UI), command line or some kind of source code (yaml etc) as well as tools such as Terraform?

(Update 09-01-2020) Java 8

(baeldung) Introduction to Java 8 Streams

Lambda Expressions and Functional Interfaces: Tips and Best Practices

New Features in Java 8

GitHub (eugenp) :

Core Java 8

Core Java 8 (part 2)

Also:

Java 8 Features with Examples

Prominent Java 8 Features With Code Examples

(Update 05-19-2020) There are a lot of online code playground or white boarding tools for code testing on the spot.

(Original ) Hibernate map one to many (Vlad Mihalcea)

A collection of the posts I saw recently.

Java World
Introduction to Java threads (need to check the link?)

Java 101: Understanding Java threads, Part 1: Introducing threads and runnables

Others
Java Callable Future Example

Java – Multithreading

Java Thread Tutorial: Creating Threads and Multithreading in Java

Vaadin chat example
It needs multi session (thread) support when we need to use tabs to chat back and forth. The app description is here.

The annotation to support this: @VaadinSessionScope

Java interview questions
Placeholder: I still need to clean up the list below (to incorporate my recent interview experience).

aop
dependency injection
refactor
agile
test driven
code review (what to look)
static vs. final
interface
spring
hibernate

java generics

tree set vs hash set

tree map vs linked hash map
https://dzone.com/articles/hashmap-vs-treemap-vs

.equals() vs ==
https://www.journaldev.com/18302/java-string-equals

Elasticsearch 

Digitalocean installation

Get started

Categories
iPhone app

Dotnet core

Reading Time: < 1 minuteBuild a CRUD App with ASP.NET Core 2.2 and Entity Framework Core

One advantage I see using dotnet core is for .Net shops the transition is relatively smooth in terms of skill set. Second advantage is it’s cross platform (Windows, Mac and Linux): so in away it’s get the same cross platform capability as Java (Spring etc)

also
.NET for Java developers

Migrate your .NET app to Azure

Categories
Software development

Javascript jasmine node.js and Alexa

Reading Time: 2 minutes

(Update 11-23-2023) It’s funny, I found out when I changed the mac input mode from English to Chinese (Pin’yin), and it messed up all the special symbols in the javscript code, double quotes, semi colon, bracket etc. It’s probably due to the difference between Ascii and Unicode.

(Update 10-14-2023) I messed up the folder name AWS lambda – the fix is to correct the folder name. I typed something like “oralce” instead of “oracle” for the folder name. Took me a while to find out. The error message says it could not find the index.mjs file which is usually the entry point for node.js app (including lambda function on AWS).

{
  "errorType": "Runtime.ImportModuleError",
  "errorMessage": "Error: Cannot find module 'index'\nRequire stack:\n- /var/runtime/index.mjs",
  "stack": [
    "Runtime.ImportModuleError: Error: Cannot find module 'index'",
    "Require stack:",
    "- /var/runtime/index.mjs",
    "    at _loadUserApp (file:///var/runtime/index.mjs:997:17)",
    "    at async Object.load (file:///var/runtime/index.mjs:1032:21)",
    "    at async start (file:///var/runtime/index.mjs:1195:23)",
    "    at async file:///var/runtime/index.mjs:1201:1"
  ]
}

I encountered some other error too, and some of which includes traceback to my own code, which gives hints on what went wrong. Another tricky one is whether to include { in the import statement (When should I use curly braces for ES6 import?).

Another error from Oracle DB is it didn’t like the SQL with single quote, and at the same time the sql itself has a condition of =’1’. Put the slash before the single quote to escape the single quote before 1, in cloud 9, and cloud 9 automatically add double quote around the sql, and it seems solve the issue.

{
  "errorType": "Runtime.UserCodeSyntaxError",
  "errorMessage": "SyntaxError: Unexpected number",
  "stack": [
    "Runtime.UserCodeSyntaxError: SyntaxError: Unexpected number",
    "    at _loadUserApp (file:///var/runtime/index.mjs:1058:17)",
    "    at async Object.load (file:///var/runtime/index.mjs:1093:21)",
    "    at async start (file:///var/runtime/index.mjs:1256:23)",
    "    at async file:///var/runtime/index.mjs:1262:1"
  ]
}

(Update 12-22-2022)

The Modern JavaScript Tutorial

w3school

(Original 02-27-2019 below)

Alexa

Alexa Account Linking: 5 Steps to Seamlessly Link Your Alexa Skill to User Systems That Require Authentication (Sebastien Stormacq, done)

User Account Linking in Alexa with ASP.NET Web API (Heather Downing, Okta)

Linking Your Alexa Skill Securely with Okta (Jefferson Haw, Okta)

Account Linking : Amazon Alexa and ForgeRock OpenAM using OAuth2 Authorization grant (karthik, Medium)

How to set up Account Linking for Alexa with Auth0 and Jovo (Kaan Kilic, Jovo)

Build an Alexa Skill in Node.js with Jovo (Jan Konig, Jovo, done) : If a user responds with a name, the MyNameIsIntent is triggered. The code is shown below in index.js

Webhook.listen(port, () => {
console.info(`Local server listening on port ${port}.`);
});

Webhook.post(‘/webhook’, async (req, res) => {
await app.handle(new ExpressJS(req, res));
});

also, how to test the code in AWS Lamda…Click “Test” right next to the “Save” button and select “Alexa Start Session” as the event template…

Interaction-Based Authentication for Alexa Skills with Auth0 (Joao Angelo, Auth0)

Developing Alexa Skills Locally with Node.js: Account Linking Using OAuth (Juan Pablo Claude)

The Alexa Skills Kit SDK for Node.js helps you get a skill up and running quickly, letting you focus on skill logic instead of boilerplate code.

JavaScript
Node.js based testing (npm test)

jasmine official website

commonly used commands:
npm install –save-dev jasmine
npm init
npm test

Sample project can be seen here: (please contact me if the repository is private)

Also from Okta dev blogs:
Learn JavaScript in 2019 (David Neal)

Add Authentication to Your Vanilla JavaScript App in 20 Minutes (work in progress):

With ES6, async/await brings you added control over asynchronous programming by leveraging promises but in a synchronous way. You can use async/await to make your code cleaner while maintaining non-blocking operations. github

Note this post has some examples that uses angular as well.

Categories
iPhone app

Code exercise : linear chamber animation / simulation

Reading Time: < 1 minuteThis is the code that works (my code):

Junit test code is here.

I will add some ReadME as time permits. This is not as straightforward as it sounds. I didn’t get it working initially after spending hours on it 🙁