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: < 1 minute(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

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 ==

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
iPhone app

Javascript jasmine node.js and Alexa

Reading Time: < 1 minuteAlexa

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
Learn JavaScript in 2019 (David Neal)

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 🙁

Categories
Software development

Spring, Spring Boot, React and OAuth

Reading Time: 3 minutesBaeldung : A Comparison Between Spring and Spring Boot

Tutorials from Okta
Working in progress

Identity, Claims, Tokens – An OpenID Connect Primer, Part 1 of 3 (Micah Silverman, below 2 and 3, are also by Micah)

OIDC in Action – An OpenID Connect Primer, Part 2 of 3

What’s in a Token? – An OpenID Connect Primer, Part 3 of 3

Secure Service-to-Service Spring Microservices with HTTPS and OAuth 2.0 (Matt Raible) : some errors due to java certs

Completed

Secure a Spring Boot REST API with JSON Web Token Plus references to Angular integration (Nouhoun Y. Diarra) : a small typo: the health check URL should be http://localhost:8080/actuator/healthTutorial:

Develop Apps with Secure WebSockets in Java (Jimena Garbarino): 

Secure Reactive Microservices with Spring Cloud Gateway (Matt Raible) link to my github

A Quick Guide to Spring Boot Login Options (Andrew Hughes)

Easy Single Sign-On with Spring Boot and OAuth 2.0 (Micah Silverman): note the need for JDK 11 (I used Amazon JDK 11), and please remove the double quotes around claim name and re-type (copy paste does not work well from blog post to okta dev console)

Build Spring Microservices and Dockerize Them for Production by Raphael do Vale. As I was finishing up the regular part (the exercise before docker), the service discovery reminded me of Hashicorp Consul tutorial I followed along a while ago. Note this tutorial used Netflix Eureka which is a bit more cool than pure command lines from Consul / Vagrant 🙂 Note this for Docker (quote the tutorial): You must store the file school-ui.properties in the same folder specified on the volume mapping (in the example above, the relative folder ./config-data). This is also my first complete tutorial on Docker container running java web apps (on my local MacBook and Windows 10). In the past I followed tutorial that runs Chef as well as Tomcat / Jenkins on docker (GCP).

Build a Secure Notes Application with Kotlin, TypeScript, and Okta by Matt Raible. Note the last part also talked about how to push code to Pivotal Cloud Foundry and deploy the apps there. This is interesting as I have done the PCF 15 minutes tutorial in the past (and recently).

Bootiful Development with Spring Boot and React (Matt Raible at Okta): I followed this tutorial until the point that I get the basic beer list (in other words, I made both the basics of Spring Boot and React work). This is my very first venture into React, and I had to install “yarn” as well using brew install. In the process I had to upgrade the Xcode via command line.

Also: Use React and Spring Boot to Build a Simple CRUD App (Matt Raible at Okta): I made small mistake when initiating the project with Spring website: I copied / pasted the dependency frameworks, which seems does not have any effect when the pom.xml was created. So I added the dependencies manually.

			org.springframework.boot
			spring-boot-starter-web
		
		
			org.projectlombok
			lombok
			provided
		
		
			com.h2database
			h2
			runtime
		

Also in my Eclipse, I need to install Lombok manually by following instruction here. Note Matt did mentioned the IDE cannot recognize some of the Lombok things if there is no plugin. In the past I used to install Plugin via the menu inside Eclipse. I noticed “Whitelabel error” when I was hitting the end points: http://localhost:8080/api/groups/ (this is working as expected actually, before I add any JUG meeting to the list, as I don’t have access to the default list).

Last but not least: I need to make a small adjustment in GroupEdit.js sample code

'X-XSRF-TOKEN': this.state.csrfToken, (it was just csrfToken and Yarn did not like it)
Categories
iPhone app

h2 database

Reading Time: < 1 minuteH2 Database – Installation

H2 Database – JDBC Connection (the only differs from the docs is we need to add “mem” before the “:~/test”. Otherwise it gives me error.

Mixed mode

Another Java H2 tutorial

Last but not least, how much time should a coding test be? I feel couple hours are probably the way to go (think of Filtered AI, Hacker Rank etc). The other approach is more like open-ended projects: those could take from a few hours to a few days 🙁 In some cases I was suspecting the hiring companies could use this opportunity to get some real work done (if they ask for source code 🙂

Something to keep in mind when doing code test.

Categories
iPhone app

Streaming data, data streaming

Reading Time: < 1 minuteApache flink
SE-Radio Episode 346: Stephan Ewen on Streaming Architecture;
Software Engineering Daily Apache Flink with Stephan Ewen – Nov 2015; Spark and Streaming with Matei Zaharia – Feb 2018

AWS Streaming data

Categories
iPhone app

Database deployment automation

Reading Time: < 1 minuteDB deployment (schema or DDL, package)
Continuous integration and deployment of database is a main issue for many legacy monolithic web app. I came across this article recently, and I think it touched some good points.

On a related matter, Jeff Atwood (cofounder of stack overflow), has a good piece on database version control.

I understand the world is going microservice, and the monolithic relational database is not used as frequently as it’s being used in those legacy web apps. But nonetheless, it helps the dev team to be agile if version control / CI / CD can be applied to database update as well as the application update.

Tracking data changes in DB
This also reminds me of an app I worked in 2010/11, in which we have an DB audit log for many (if not most) database changes: add, update, delete. It’s usually achieved via trigger in Oracle, or interceptor in Java. I read an article from a startup engineering blog (credit karma? Or something like this), they detailed how this is implemented.

Categories
iPhone app

Working from home friendly companies

Reading Time: < 1 minuteOr companies that allows or encourages remoting.

Zapier (Emily Irish) The Remote Work Survival Guide: 9 Do’s & Don’ts Every Remote Worker Needs to Know

stackoverflow remote dev jobs:
e.g., MobyMax: this is very interesting because I learned about Mobymax because my daughter’s school has the subscription.

Top 30 Companies for Work-from-Anywhere Remote Jobs in the U.S.

Work From Home 2018: The Top 100 Companies For Remote Jobs

Last but not least, LinkedIn has the top startup list for 2017 and 2018. Note many startup like people to work onsite for more communication but there are some exceptions (InVision for one).