Categories
iPhone app

Three good iOS Mac focused podcast

Reading Time: 2 minutes

I have listened to Paul Kemp’s the App Guy Podcast (TAGP) recently, got to know this from @raywenderlich via twitter. Paul’s podcast is not purely technical, it’s more about entrepreneurship, and start own business. It’s an interview format. Paul usually asks indie developers (iOS, web, etc.) questions on how they get started, any pain points or difficulties to strike out on own, vs. getting steady paycheck from corp. Paul himself is an indie developer/podcast too. I think Paul is a good interviewer because he asks good questions, which reminds me of other good/great interviewer such as Charlie Rose (PBS/CBS), and Wealthtrack’s Consuelo Mack (formerly PBS). Again this is not only about blocks, MVC, Xcode, but more about going indie (independent developer).

Another good podcast, which started recently, is raywenderlich’s. There we have Ray plus 4 developers (Tammy, Jake, Felipe, and Mic). It’s more technical, but it also covers going indie. For that matter, the 4 podcasters have been going indie for some time, and Ray himself was an independent developer before the tutorial site/book took off. So they have a lot to share. And we (as techies) got to listen all the nitty gritty of NSNotifications, design patterns as well, which is cool.

Categories
Software development

Dumb code mistake continues

Reading Time: < 1 minute

So I was able to fix that performance problem I mentioned in my previous post. But I inadvertently introduced a new problem in my previous fix. And here is the gist of how I did:


while (some condition) {
if(some other condition) {
...
return;
}
}

Guess what, I was able to put it into infinite loop…I can explain more if needed 🙂

Categories
Software development

Tree, recursive function and my dumb mistake

Reading Time: < 1 minute

Tree data structure is fairly common in software development, and luckily I have quite a bit experience working on those in my career. I started working on this as I was working for UGS/Siemens PLM Software, and I was involved in the development of XML based data adapter for CAD data exchange, a key piece of information we want to translate is the assembly information, or product structure, or in computer/software terms, the tree hierarchy. I did learned a few things on recursive function, etc. Interestingly enough, later on I got a interview phone call from Google, and the guy asked me about recursion, for a simple problem like this: basically they are 100 matches, every time one can take one or 2, how many combinations are there? I said let’s do it in recursive fashion, after quite a bit reminder/hint, finally I said n(100) = n(99) + n(98)

But they were not very impressed with me, as I did not come up with the solutions fast enough, which is fine. I am who I am, I can work on those kind of interesting problems, in my own pace. Or explained in my Chinese name, it’s getting faster gradually 🙂

My dumb mistake

Categories
Fun

I enjoyed the time spent driving Yoyo to/back from school

Reading Time: < 1 minute

She will ask a lot questions on the way to school, as the iPhone/iPad/work takes over my spare time these days, I did not get a lot quality time with Yoyo alone. Driving her to school and take her back to home provide good opportunities for communications. She will usually have a lot of questions on the way to school, probably because her mind is more active. She will ask questions on everything, e.g., cars, planet, plants, flowers, some of which I can not answer, and I will tell her to ask teachers. Sometimes she will say “grown ups don’t know everything, but teachers do”.

On the way to home, sometimes she will talk about things at school. Not always. Sometimes she will say “just sit there”. Obvious she was kidding, as I knew they do a lot things at school, and Serenity is busy most of the time. She will talk more sometimes before sleep.

Teach the right thing
Serenity likes to be the roles in the story these days. Here is what she usual says: I want to be everyone on this book except the one does not look nice. So today when she says this: I want to be everyone on this book because everyone is pretty. I was pleasantly surprised. Now I reflected a bit I know her teachers have told the kids the right thing 🙂

Categories
Software development

Test Driven Development and Unit Test

Reading Time: 2 minutes

(Update 02-19-2021)

spring.io Testing the Web Layer

Mockito Example with Best Practices

JUnit and Mockito : Best Practices, Do’s and Don’ts

(Original) Test Driven Development (TDD) is getting popular these days. I had opportunity to being exposed it recently. I am not new to unit test. In the software company I worked for 8 years, we have regression test suites that runs automatically (at least daily), and we update the test suites as we find edge cases from customer bug reports, or in our development. That was about 8 years ago. Since the switch into Java land (2010), I started using JUnit and create/run the unit tests. One thing I was exposed to recently is Mocking in unit test, and TDD. Both takes a little time, and I am not fully bought into TDD yet. But I did learned something interesting on both topics lately, and like to share.

1) TDD
One of my coworker is very experienced and in-grained in this, as we are doing pair programming, I learned this a bit. An interesting back and forth as I was making changes to a method.

Coworker: “Do you have a test case?”
Me: test case for what?
Coworker: for the change?
Me: do we need this? …

But eventually we wrote the case, magically the web app also worked as soon as we passed the unit test. But overall I still have some reservation to do this, as I am not good at mocking e.g. Mockito, or writing test, and I think there is some cases pair programming can get the code right without go heavy in unit test.

Some links for mockito and spring test

Stubbing and Mocking with Mockito and JUnit


https://www.vogella.com/tutorials/Mockito/article.html
https://stackoverflow.com/questions/39486521/how-do-i-mock-a-rest-template-exchange
https://www.baeldung.com/spring-mock-rest-template
https://stackoverflow.com/questions/11969609/junit-mockito-when-thenreturn-throws-nullpointerexception/18060451
https://javacodehouse.com/blog/mockito-tutorial/

2) Unit test (auto test suites)
I heard from my coworker recently that test suites should not use the implementation data source (database). I thought the main reason is the heavy weight/use from database resources point of view. But there is more, today I found if auto test consistently changes things on dev database, it’s really hard to find out the root cause, and cause confusion. Initially we thought the problem was caused by batch job, or the web app, spent a lot time trying to figure out, both are not the cause. And luckily, at the end we were able to find out the real cause.

Categories
advice and tips Fun

Kids Summer Camp in St. Louis Area

Reading Time: < 1 minute

It’s finally spring time here, which also means summer is around the corner. And we need to get kids into summer camp, instead of let them glue to Netflix or iPads all day 🙂

There are quite a few summer camps in the area, some are almost full time (like regular semester), some are more short. And I recall YMCA has some discount a few months ago for early registrations (early Feb), don’t know if they still have it.

There is also a kids summer camp at St. Louis Community College Meramec. There is this Missouri Science Camp, which is being held at Rolla, MO, where I went to graduate school.

I know Ladue News has a nice summary for the summer camps, but I could not find it online. IndependentSchools (the association of private schools in St. Louis) has a good list too.

Categories
iPhone app

How to make iPhone app iPhone 5 5s compatible

Reading Time: 2 minutes

(Update 03-05-2019, almost 5 years since original post) I did something similar for iPhone X, XR, XS screen size. Basically I stretched the Default-568h@2x.png to Default-375w-812h@3x.png and added that in the “launch image”. I also noticed the some of the nib files have the wrong constraints for label, textfield and button. I made some simple changes so that the top and bottom portions stick. Last but not least, the constraints and the size of google admob banner ads needed similar work: I did the needful and checked those changes worked both for iPhone SE and iPhone X.

I don’t have iPhone X (XR or XS). My first impression they are much longer than the SE I have.

(Original 04-13-2014) I found some iPhone apps are still not updated to take advantage the iPhone 5 screen size (4 inch vs. iPhone 4/4s 3.5 inch). I think in many cases the owner of the apps may not have time or the developers don’t know how to stretch the screen. This is a quite common problem. The solution is also fairly straightforward. We only need the stretched version of the screenshot, and name it as Default-568h@2x.png (exactly like this). But to get this all started, you might want to use this blank png file, something like this:

Default-568h@2x

Add this file to the Xcode project, and run the simulator. Screen capture the first screen and edit it to make sure it’s 640×1136, and name it as the file name above. This way the app will both have a good launch screen and stretched screen for iPhone 5/5s

(Update 04-20-14) I found something more interesting. When I tried to add auto layout for the nib (xib) file created in Xcode 3.x, it basically give me a blanket (black) screen. So basically we can not reuse those old nibs for auto layout.

Categories
advice and tips finance iOS iPhone app

Small changes coming to collegeFund app

Reading Time: < 1 minute

I was listening/reading two stories on the college debt (source: NPR) and the financial well beings of millennials (source: fortune/cnn), which lead to to add some new features to the collegeFund app. The app was essentially a college savings (529 plan) and I did not thought too much of this college debt problem at the time the app was conceived 3.5 years ago. At the time I opened 529 plan for my daughter, and started put some money into it.

A lot has changed in my personal finance and to the economy in general. Now I felt for a lot of people, college debt is like a mortgage, it’s just something they have to bear with, and manage while go on with their lives. Btw, I saw another good resource for college debt here.

I just updated the app, submitted to the app store, it’s under review now. Here is the screenshot. Let me know if you have any questions. Email me at minjie dot xu AT gmail dot com.

collegeFund_iPhone5_screen

(Update 05-10-2014) I made couple more updates to fix bugs I introduced when adding this “debt free” tab/screen. It’s mostly settled now. I am thinking other enhancements, along with myNestEgg app.

Categories
advice and tips finance

Redeem British Airways Avios Points for Free Flights

Reading Time: < 1 minute

From my limited experience BA Avios points are difficult to redeem for international flights, esp. from where I live STL to PVG Shanghai. But I also heard BA miles is very efficient for the US domestic flights, the trick is also to find them. So here is how I did recently, for one way STL to LGA (New York). I used AA advantage account to search award flights first (note AA is the BA partner in the US), and I saw some openings. Then I go to BA site, search the same date, I got the award seats.

I have not done round trip or multi-stop in this case. This is something I will try next time.

(Update 04-20-2014) Today I booked the round trip ticket for STL to CLL (College Station, Texas), it costs 36,000 points plus $20 for 2 tickets. This is compared to 22,500 points + $7.50 for three STL to LGA (New York) tickets. It’s a bit more expensive for the round trip tickets, even considering breaking it into 2 legs, it’s 9,000 points per leg.

Also, I noticed the points guy has some good stuff (this one and this one) about redeeming BA Avois points.

Categories
Uncategorized

Exchange Euro into US dollar

Reading Time: < 1 minute

I have a need to exchange some euro into US dollars. I did some research online as I recall previously I did not have very good experience on this. Saw a few articles (such as this MSN one, and this independentTraveller one). They are relevant but not totally applicable, I think they are more geared toward international travelers. Anyway, I compared 3 banks in St. Louis area, Bank of America (BoA), Regions, and US bank. On April 4 Friday, the rate I got was 1.2943, 1.27xx, and 1.18xx. The rate at US bank was a bit low, which is contrary to the results from the previous MSN article:

“…Among the 15 largest U.S. banks, the exchange rates ranged from 1.3000 at Citibank to 1.4400 at U.S. Bank…”

I eventually went to back to the BoA I checked out in the morning. And finished transaction.

PS, the previous experience I mentioned was due to the fee charged. They usually waive fees once the balance is over certain amount. This is true in most places including China.