Category Archives: iPhone app

iPhone app

Setup JBoss with Eclipse

I have been doing this for a while, mostly for my new work (back to dev). My goal is being able to debug a Java web application, just like what I did for my previous work (Spring STS + Tomcat). The new work requires Eclipse + JBoss (some coworkers uses the not free Intelli-J).

Download / install Eclipse
link here, need to unzip, and install the Eclipse for JEE

Add a new server
I picked Wirefly 11. Read this post regarding JBoss EAP vs Wirefly. This has been helpful.

After that I was able to import a “maven project” (that runs on STS with vFabric server), and start the app in debugging mode. This seems like baby steps, but for me it’s a long time “not doing” :-)

Paradigm shift

(07-08-2018) Came across this multi-cloud article form Glenn.

(Original) Good old Oracle is shifting Java SE from perpetual license model to subscription based. Link here.

Note John Chen (CEO of blackberry) mentioned the subscription model makes more revenue more predicable for the business (video here, noticed he mentioned new accounting rules here).

Btw, heart broken to see the Blackberry phones go away.

Docker – second take

(Update 02-13-2018) So I found out today I have AWS bill of $2.62 (mostly due to EC2 instances) today. This is due to the fact that I did fire up the VM as well as the docker swarm instances (total 9? maybe due to I ran the deploy script multiple times?) Anyway I fired up the instance last night, this evening I looked at the “instances” and looked at the bill, I know what happened. I still did not make the connection from outside to ec2 working though. For the time being, I “terminated” the docker swarm, and stopped AWS VM.

(Update 02-12-2018) I am also following the tutorial at Docker’s official website. I am at step 6 here. And right now, I am stuck in connecting to the AWS vm (was following this Docker guide): step 6 “docker node ls”. I did follow the steps to create docker credentials for AWS.

error during connect: Get https://192.168.99.102:32768/v1.35/nodes: http: server gave HTTP response to HTTPS client

Note this IP address looks like the local default machine: one thing I am not quite sure is how the local connects AWS

(Original 01-31-2018) I installed docker on my mac a while ago and did a simple tutorial. But I never had much chance to play with it until recently. After the training, esp. after I saw use docker container to host Tomcat, and then use Jenkins to trigger Tomcat, this whole thing got me interested in docker again. Note I have been learning about docker contain and they seem to be the future deployment model for scalable mobile apps backend: e.g., I know the Robinhood app (the free stock trading app) is container based in the back.

Some resources I used to get started:
1) Youtube docker tutorials;
2) Install docker or docker.io on Ubuntu (I have a digitalocean droplet / VM, and its OS is Utuntu);
3) Overcome the error message:
FATA[0000] Get http:///var/run/docker.sock/v1.17/version: dial unix /var/run/docker.sock

The answer is this:

The problem is that your user has not been added to the docker group.

Try:

sudo usermod -a -G docker
If you don’t want to log in/out from your current shell, run:

newgrp docker

Last but not least, install Jenkins on Ubuntu 14.04.

Other error messages (note I am on a Mac)
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? (when I tried to run some docker command)

It seems the solution is
eval “$(docker-machine env default)”

Alipay wechat Pay

IMG_8760

I was travelling in China for 9, 10 days recently, and I can see those two payments method everywhere. From the small food stall to KFC, one of those two methods are widely accepted, and in many cases cash transactions are very rare. I noticed this trend about 1.5 years ago during my China trip too, at that time I saw some promotions around those new payment methods. This time I saw many promotions too, such as discount to points (reward) system.

Just use my own shopping experience as an example. I purposefully did not get a local mobile phone number this time, which in other words, this disqualified me from using those new payment methods. I did not want the hassle of getting a new mobile phone number, with or without data plan, and then have to give up the number later. Because my trip is really a 9 day trip. I noticed in most “free” or public wifi hotspots, the setup is such that they send a validation code to the mobile phone. For me I can live without because my phone has international data roaming, in other words, I still get to wechat on the go. But I cannot get to those free public wifi hotspots, at a bookstore when I tried to sign up to be their member via wechat, I realized my lack of local phone number is preventing me from doing that, or getting the discount. Same thing in KFC. I did noticed some China Unionpay (flash pay, or its own contactless payment methods, like masterpass or visa checkout, if you will) promotion along with Apple Pay and Samsung Pay, but it’s very obvious they are not in the same magnitude as Alipay or wechat pay. There is news saying that China central bank is regulating Alipay and wechat pay, such as limit the amount of transaction. It will be interesting to observe though, we know Unionpay is very much state owned, while the other 2 are in theory private owned. But all in all, this is a very difficult market for Mastercard and Visa to crack.

Fully disclosure: as of this writing, yours truly works for Mastercard. And this article is just my personal opinion, not my employer’s.

PS, in order to get a local mobile phone number, one usually needs a local identification card. I am not sure how foreigners can get one, via their passport. I assume there is a legal/legit way to get that.

Last but not least, my friend in Ningbo, used Alipay app to rent a car (I assume it’s similar to Uber), to pick me up at Ningbo railway station. He said he even sold his car recently, due to the convenience of car-rent app, public transportation, and the desire to walk/cycle (again bike sharing here, needs a phone and app) more instead of trying to finding a parking spot for his car (and the cost of maintain a car). When we got off the car, the payment is automatic just like Uber.

Stay away from work over weekend

My older daughter just finish 1st grade. One thing I learned is first graders do have some homework, at the same time they usually don’t have homework over the weekend (Friday, Saturday and Sunday). In other words, homework usually won’t be assigned out on Friday and due to Monday. This is something I like to talk about it today. Over the years I worked professionally, mostly for employers, I did encounter tight deadlines or last minute assignment which means I have to work or “hinted to work” over weekend and holidays. I recall in some scenarios we need to come into office and work. There is the line I want to draw: don’t commit to it if all at possible. In fact this is mostly a sign of bad management or planning when at Friday afternoon, the boss (project manager, someone who manages our work) came in, and say something needs to be done that urgently, and we need to work non-stop over Friday evening or Saturday, or even Sunday. This is both non-sense and counter productive.

We as knowledge workers usually don’t completely stop working even after normal work hours, sometimes we will (I know I do) think about the technical issues on the way from work to home, and sometimes we recall something like “ah, I may have done something wrong there, I will go back and fix it”. In fact I did something like that in my early career. Some other times, we monitor a long run job at home, or we test out new ideas coding on a company laptop. But we need break as human beings. Force us to work over weekend basically took away that, not to mention people who have families.

The downside of mandatory “overtime” in weekend (esp. coming to office) is that the workers never get rest in a normal weekend, thus hurting the productivity in the following week. In the example I gave earlier (the supervisor asked us to show up for work), looking back I think even him did not believe by coming in work on Saturday we will complete the project on time. This is mostly a show from management side, to let the upper management know that we are working hard. One of the dumbest thing I saw in my 17 years professional life.

On the positive side, I do have a few successful stories where I worked or thinking hard on a problem, and was able to solve a critical problems, all on a voluntary bases (nobody told me to come to office, I understand the urgency of the issue).

Apple TV 4th gen – initial impression

I finally decided to upgrade to the 4th gen Apple TV, which I had it as a developer kit about 2 years ago. I had not used it as the gen 2 Apple TV worked out fine mostly of the time, until recently it appears “play on Apple TV” feature did not work well on my old iPad mini (it could be caused by the old router too, oh well, I will replace it one at a time). I recall last time (a year ago) when I tried to use it, the TV comes as dev kit was locked, so I went ahead and did the “restore” in iTunes first. After that the setup was fairly smooth, it seems the main improvement over gen 2 was the voice recognition (Siri) and touch control (the touch control is not as precise as the four way control in the old remote in one case though).

Installed PBS kids app, and the screen saver looks new! Over the weekend I bought some TV from iTunes store (peppa pig, for younger daughter). It showed up fairly quickly on Apple TV.

Now the next step is for me to find the box for the old gen 2 and post it on eBay.

Some thoughts on United Airlines and the industry in general

Over the years I have rode quite a few United Air on my trips from US to China. Amid the most recent incident on the UA (warning: the video may not be suitable for little kids), I am thinking of a few UA trips I took, such as this one on March 2007, which worked out ok. Another trip (Summer 2002), which is also my first UA flight, was also eventful. The UA857 (from SFO to PVG) was spotted some fire (presumably under the wing, per some passenger) during the take-off. The plane had to drop most of the fuel above the sea, and turn back to SFO. And we had to reboard another plan to PVG. Here are some of the pictures of the plane releasing the fuel. I recall one flight attendant specially mentioned how much weight was the fuel, and the unit price of fuel, I calculated it was about $350,000 worth of the fuel.

UA867_July2002_4

UA867_July2002_1

plane2

Fast forward, the industry had another meltdown during the financial crisis, and has since come back. The regional carriers, such as the one had the incident on Sunday night, was never the money maker. In fact, I recall in year 2009 (Colgan 3407) there was an fatal accident on a flight from NYC to Buffalo NY. And I learned from that accident that those regional carrier’s pilots are not really well paid or trained. This combined with my observations of over the years, when the airlines tries to charge the baggage fees, and on those regional flights, people would just check in the baggages at the gate (to save the money). Then at the destination, esp. when during winter time, you will see a long line of people picking up the luggages. It just feels America is a 3rd world country at that time.

Last but not the least, my friend Wang Jianshuo wrote on similar topic almost 10 years ago.

Replacing iAd with admob etc.

Recently I picked up my old iOS app as the framework it replied on Parse was going sunset (the date was Jan 28, 2017). I picked up Google firebase after reading a few posts including the one at Raywenderlich.com. In the process I also upgraded CocoaPods, and replacing the ads from iAd to admob. About 3 months passed by since the initial launch of admob, it seems the performance of admob is much better than the iAd. Note I only used the banner ads for now: this is similar to the iAd banner ads it replaces with. Per Matthijs Hollemans (the famous iOS dev, also raywenderlich.com tutorial writer), interstitial ads is more powerful when possible, but I have not successfully made it work yet.

Going forward, I am thinking learn about the Swift language, as David Smith and Marco Arment mentioned in recent Under the Radar podcast (State of Swift), this is increasingly urgent now, for iOS native app dev.

Back to ads, for me I have seen the steady declining of my blog website viewership, and the income from google ads. This admob thing gave me some hope. This also confirms the trend of people increasingly switching from desktop to mobile, esp. smart phone.

Many roads to Rome

I mentioned sometime ago that LaunchCode is a great way to get into programming / software development world for a grown-up whose background is not computer science or information science.

But that’s not the only way. More recently I noticed some friends made the transition from research position at Washington University to industry. Again there is more than one way. One friend took a lot of statistical courses from coursera, combined with the background in statistics, R and computer at Wash. U., that particular friend is a senior data scientist on healthcare. A couple more friends made transition earlier, from research technician to statistical analysts after getting a MS degree (all at Wash U.), then transition to industry.

So there is really no single approach to Rome. :-)

There is one thing in common though: one has to learn, either via nontraditional degree programs, such as online sources coursera, or launch code, or a degree program. So in other words there is no free lunch, or no pain no gain :-)