Wednesday, January 9, 2019

Tips from my experience as an Aussie moving to San Francisco

It's been a while since I posted anything on this blog - I figured it was about time to rectify that!

Since my last post I've spent nearly 4 years working at Invoice2go, an Australian startup that received funding from some VC firms in Silicon Valley. I spent the first couple of years working out of their office in North Sydney before the opportunity came up to relocate to the Bay Area to work out of the Redwood City office. This was something I'd wanted to do at some point in my life so I jumped on the chance to make the move. 15 months on I am settled into the area and thought I would share some tips that I found during the relocation process. Hopefully this post comes in handy for anyone else looking to make the move.

Background

First of all, some context. There were a number of things that made this move easier on me than perhaps it would have been for other people. First of all, I'm fortunate enough to have been born and raised in Australia, which has a long history of being a very close ally of the United States. As a result we have access to a special class of visa called the E-3. This (strangely enough) was created as part of free trade deal negotiations that happened during the wars in Iraq & Afghanistan - it supposedly was added a a sweetener to try and get Australia to continue it's commitment of troops. This visa is much simpler than other visas like the H1-B in that it's purely reserve for Australians, with a yearly limit that we never come close to hitting. It's a 2 year visa that you can renew indefinitely by leaving the country and doing another interview. It's also very cheap and the process is relatively simple. I often reflect on how fortunate I am to have access to this visa and have sympathy for others who have a tougher visa situation.

Secondly, as I was relocated by my existing employer I'd already had the chance to visit the Bay Area a number of times and knew the team quite well over there. I was also continuing in a pretty similar role to what I was doing in the Sydney office, so there wasn't any stress of starting a new job added into the move - I simply continued my job the next week but in a different office. 


Prior to the move

If you are planning to make a similar move there are some things you can do to make things easier on you when you come over. 

Get an American Express credit card

Building credit in the USA takes a long time, and most credit providers won't recognize your great Australian credit rating. This means that when you arrive in the USA you'll be stuck either with your Australian credit cards, your debit card from your bank (which may take a few paychecks to build up in funds) or a secured credit card with a very low limit. However American Express is an exception to this rule - they can transfer you from Australia to the USA, and they will take into account your internal credit history with them. So as soon as you are thinking of making a move to the USA I'd recommend applying for an Amex. You can often find good bonus points deals for Amex cards on Ozbargain which might help you pay for some flights in the future. Sign up, use it as much as you can and always pay it off promptly. Then when you move to the USA give them a call and ask to do a global transfer

Thanks to my history with Amex in Australia I was able to get approved for a Platinum Amex card, which was very helpful in the first month until a couple of my paychecks at come through. This allowed me to avoid transferring too much money from my Australian bank account (with the associated fees). Even after a year the only credit cards I had were this fancy Amex and a bunch of secured credit cards meant for people with bad credit scores - kind of weird, but it works.

Move your mobile number to a prepaid sim card

This may not apply to everyone, but I wanted to keep my Australian number active while living in the USA. There are a few reasons that I wanted to do this:
  • I planned to keep bank accounts, credit cards etc active in Australia - so a local phone number is useful for authentication purposes where a 2fa app isn't an option
  • While many USA sim cards offer free global data roaming at slow speeds, I'd prefer to use my old number when I visit Australia and pay for high speed data
  • You never know what is tied to your old phone number that you'll suddenly need access to, or who will attempt to contact you
Obviously you don't want to pay a high monthly fee for the phone when you aren't using it, so move your phone to a prepaid sim that has the option of a small yearly top-up. I went with Aldi Mobile. They had a pay as you go option with 365 day expiry for $15. Whenever I visit Australia I just top up with a 'value pack' (last time was $25 for 9gb and unlimited calls/sms). It's great. 

It's worth moving to this plan before you go as transferring your number gets more complicated if the address is different on your two phone accounts and it is more complicated to do it from overseas.

Plan your Australian mailing address

If you're planning on keeping some accounts open in Australia (bank, credit card, super, etc) it's useful to have an Australian mailing address. Hopefully your parents, siblings or close friends are ok with you sending your mail to their place, or you could do a P.O. box or something like that. I'd recommend starting to update all of your addresses before you move. Once you move out of your place in Australia you can also setup a mail redirection through Australia post to this new address to catch any accounts you've forgotten to update. 

Renew your passport and drivers license

This is something I didn't do, but wish I did. My passport had a 10 year expiry and I was over 8 years through it when I got my E3 visa. The visa gets affixed to a page inside your passport, and if you get a new passport it doesn't get transferred. There are generally problems with traveling to the USA on a passport with less than 6 months until the expiry, so after a year of living in the USA I had to get a new passport. This involved finding a a place who understood the strict Australian passport photo requirements (A Better Passport Photo in San Francisco was perfect for this) and then going to the Australian Consulate to renew the passport. This wasn't such a big deal, but as the E-3 doesn't transfer you I now had to carry around two passports everywhere I went. It would have been easier if I just renewed it in Australia prior to applying for the visa.

I also have a NSW drivers license that is going to expire soon, and I'm sure renewing it will be a pain - I have no NSW residential address (my parents are in QLD) and even just getting to the office to renew it will be a pain given I mainly transfer over the holiday period. It would be easier if I had a longer expiration date on my license to begin with. 

The visa application process

After receiving the offer to relocate we kicked off the visa process. There's a few good posts online about it so I won't go into too much detail, but in my experience the process from engaging the lawyers to receiving my passport with visa attached was around 3 weeks. This fluctuates depending on appointment timing and other factors, but for me it went quite smoothly.

Some people opt to do this process without the assistance of an immigration lawyer, but I'd recommend getting your employer to engage with one - it reduces the stress and uncertainty of the process. 

I was living in Sydney and did my interview at the consulate there, whilst working with the lawyers in the USA. Here's an idea of the timings:

Day 1 - Lawyers started the process
Day 3 - LCA filed
Day 8  - LCA certified
Day 14  - Documentation signed & case filed
Day 20  - Visa interview at consulate, approved on the spot
Day 22 - Received passport with visa in the mail

Logistics of the move 

Moving country is always going to be a logistical challenge. My partner and I had no pets or children and our apartment lease was month to month which meant that things were simpler for us than they might otherwise have been. It was still a lot of work to pack pup the apartment, sell my car & a bunch of other possessions, make good on the lease, move to temporary accommodation and then get to the airport. 

Every situation is likely to be unique, but some tips that I have in general are:
  • Before you sell every little thing on Gumtree/Ebay consider if it's worth your time. It may not be worth the hassle to sell various $10-50 smaller items in the rush of planning a big move. The weird and wonderful people of Gumtree can take up quite a lot of your time!
  • Take note of the local council rubbish collection policy in your area. My area only collected large items (like mattresses) on a certain day of certain weeks. We thought someone was going to buy our whole bed/mattress setup so we didn't put it out for collection on that day, but they didn't end up coming. As a result we had to pay a bunch of money for a garbage collection agency to come pick up the mattress and some other items in a last minute rush. Granted we could have just dumped it outside our apartment but we wanted to do the right thing.
  • Use the recommended cleaners from your real estate agent. It just makes the process easier - they know each-other and if the cleaners don't do a good enough job they'll chase up with them directly. You don't want that stress just before you fly out of the country!
  • Think about if you really want to move your stuff to the USA. I decided that it wasn't worth it. The cost of shipping is quite high and it takes a long time. Consumer goods are much cheaper in the USA, chances are you can furnish your whole apartment with Ikea and Amazon for around the same price as shipping everything across. We ended up just maxing out our luggage allowance on the flight over (we had status with Virgin Australia so were able to get 6 checked bags total).

Getting setup in the USA

When we arrived in the USA we were in a motel for a few weeks while we found an apartment to live. It'll probably take 3-4 weeks to find an apartment so you'll definitely need some temporary accommodation, and in the Bay Area even Airbnb is not cheap, so make sure you factor this into your costs/negotiation with employers. 

Finding an apartment

The Bay Area has a real housing shortage at the moment, so housing is competitive and very overpriced. A one bedroom apartment can set you back between 3 and 4.5 thousand dollars a month. If you thought Sydney was expensive wait until you arrive here! 

There's a few websites for finding rental properties - Zillow, Trulia and Craiglist are some popular ones. Craiglist can be known for scams - if it looks too good to be true it probably is. 

Given that you've just arrived in the area, you won't have any credit or rental history, so some of the cheaper more competitive places might be harder for you to get. Given that we had limited time in our temporary accommodation and were brand new to the area our strategy was to just pay a little extra for an apartment in a large building. There's a number of newer developments that have a rental office attached to them, you can book an appointment and go for a tour of the amenities and see some example apartments. We figured we'd rather pay more for at least the first year and avoid any stress with bad landlords or not-so-great areas. 

When we applied for a place our lack of credit history meant we needed to pay a months worth of rent up front as a deposit, not a big deal but it was lucky we had a couple of pays in our bank account by this point. 

Something else to keep in mind here is the location of your work and what your commute will be like. As we were working in Redwood City we ended up in Mission Bay as it's close to the Caltrain. There's only 2 Caltrain stops in the city, so it really constraints your options unless you are willing to  do a commute that involves multiple forms of transport. 

Social Security Number

One of your top priorities after landing should be to get your Social Security Number. The advice I received is that you need to wait 4-5 days after entering the USA in order for your information to be in the system, so we waited a week and then tried to go into the social security office. Katherine has a good post on this process. It took me 3 visits to get it done, first day I went there was a public holiday that government offices observed so it was closed. Second day I went as soon as they opened and the line was massive already - part of this is because of the build up from the day before I'm sure, but from what I've read this isn't uncommon. Third day I decided to get there 40 mins before they opened, and was 6th person in line. This is what I'd recommend you do - get there before they open and line up. 

Once you've got your SSN, you should provide it to your employer. Strangely enough I didn't need it in order to get my first pay - a temporary SSN was used and the tax agency was updated afterwards. I'm not really sure how that works, but it was helpful.

Bank accounts

Getting a bank account was surprisingly easy. I walked into a Wells Fargo office and was able to get a bank account by bringing in my Australian passport. I didn't have an SSN (I added it later - it's important for your credit score) and put in my companies address.  It's important to fix all this information up later, and apparently you should remember that your companies address was once used as a bank account location as it may come up when dealing with credit score related things later on. 

For a credit card, as mentioned above I did a global transfer with Amex. A couple of months later I also setup a couple of secured credit cards in order to build my credit score. Don't rely on your Amex alone to build the score as it's a charge card rather than a traditional credit card so it will hold you back a bit. 

Drivers license

Your Australian drivers license will only work for a short period of time in California. There's a bit of confusing information flying around (apparently the DMV has been giving out conflicting information). The guide I followed was that 10 days after arriving in the state on your E-3 visa you won't be able to legally drive with your Australian license anymore. It will probably be different in other states as each state has a different set of rules. Some people choose to continue driving after this point, but the main thing I was worried about is not being covered under insurance if you are technically driving unlicensed. 

So after 10 days you'll need to look at getting a Californian drivers license. Katherine has a great blog post with some information on this. It involves taking a knowledge test, much like the learners license in Australia, and then a practical test. In my experience the knowledge test took a bit of study, as there's a different enough set of rules to remember and all the speeds and distances aren't in the metric system like I was used to. The DMV website has a downloadable handbook to refer to, and I found a great website with extra practice tests. With some study I was able to pass the written test. 

Even though I had signed up for Zipcar (possible even with an Australian license) to get easy access to a car to drive around, you cannot use it for the practical test. Because you aren't legally allowed to drive, you need someone to bring you to the test and you apparently can't just bring a rental car. I found a great service called YoGov who will pick you up, let you practice for a couple of hours and then come with you to the test. The couple of hours of practice were more than enough for me - the practical test was much less strict than in Australia - instead of parallel parking all I had to do was reverse in a straight line! 

Make sure to refer to the DMV website to find out what forms of I.D. you need to bring to your appointment, and be sure to make an appointment - the lines can be very long without it. 

Useful resources 

There's a good community of fellow Aussie expats that have also made the move to the USA. I found some great Facebook groups that are useful to search through for information, particularly around the visa process. Here's a list of useful resources I found:

Good luck!

Hopefully there's some useful information in this post for anyone who is looking to make a similar move. The USA is a great country to live in and explore, and is full of great people. Feel free to reach out to me if there's anything I can do to help you on your journey, or post on one of the Facebook groups - there's lost of helpful Aussies there. 



Saturday, January 24, 2015

Layouts in Xamarin Forms

I recently gave a presentation at the second Xamarin Hack Day in Sydney. While I spoke about iBeacons at the first hack day, this time around I spoke about the various options for laying out UI's in Xamarin Forms. For those of you that don't know, Forms is a cross platform UI abstraction from Xamarin, which translates the Forms controls and layouts into the native UI appropriate for each platform. A ListView in iOS translates to a UITableView for example. It doesn't cover all scenarios, but for the common tasks it can save a lot of time, and you can break in and out of the abstraction whenever you like.

With any new UI abstraction comes new things to learn, new quirks and tricks. Much like HTML and CSS, if you are just starting out your options for laying out your web pages are limited by how much you know. As a result, your UI's don't look as nice as they do once you learn more about the box model etc. I've noticed a similar thing happens to developers starting out with Xamarin Forms. As the documentation is still a bit of a work in progress, there can be a temptation to stick to UI's that are easy to layout, but I found once I took the time to dig in and learn more about the various controls and layouts, I was able to create much nicer interfaces.

There's no video online of this one, however you can view the slides, and the accompanying GitHub examples. I also thoroughly recommend reading the preview of Petzold's Xamarin Forms book, as it's the best Xamarin Forms UI documentation.

Sunday, September 7, 2014

Handling references to images in Xamarin iOS

I recently submitted a minor cosmetic update to an iOS app that I had created, and had a user report that after updating the app the app would crash on a certain screen (which was puzzling, given that it hadn't been affected by the update). I did some investigation and uncovered what is potentially a trap for app developers, so I thought I'd share it.

The app allowed users to take photos and would store them in the app's Documents directory (Environment.SpecialFolder.Personal in Xamarin) waiting to be uploaded to a web server. A SQLite database would maintain a reference to the full path of the documents directory and access that path when the time came to upload the image. The user in question had taken some photos and then updated the app before uploading them, which caused the app to crash. It turns out that when an iOS app is updated, the GUID of the path to the data directory for that app is changed and all of the existing files are moved there, meaning that the paths in the SQLite database were now invalid and caused a crash upon trying to access them.  This scenario, and the workaround for Objective-C apps is outlined on this Stack Overflow question.

Basically, the way to stop this from happening is to not store the full path to the file on disk, but instead store just the filename, and append it the Documents directory each time you access it. In Xamarin I did this via a helper class:



To illustrate it's usage, here is the code used to save the image:

var path = GetFullImagePath.ForFileName(imageFileName);
System.IO.File.Copy (t.Result.Path, path);

Then imageFileName is stored in SQLite, not 'path'.

If you implement this code you may not need the check to see if the path supplied is a full path, however it was necessary in my example because some of our users, including the one that reported the issue, will have the full path stored in the SQLite database - which will now call that helper method.

The moral of the story is: if you store a reference to files stored in your Documents directory in your iOS apps, make sure you don't store the full path or this will cause problems when your app is updated.

Sunday, August 3, 2014

[Video] Introduction to iBeacons with Xamarin

Recently I attended a 'Xamarin Hack Day' organised by Michael Ridland & SSW here in Sydney. It was a great day which started with a few presentations, and led into everyone sitting down and coding away on Xamarin applications.

SSW are taking the concept around the world, so if you're interested in learning more about Xamarin you should check out XamarinHackDay.com

In the morning I gave a presentation on iBeacons and how to use them with Xamarin. I've got a keen interest in beacons and think there are big opportunities for developers that create applications which leverage them. I've spent some time trying out different beacon brands and trying out the iOS and third party Android SDK's. I've also been involved in discussing potential use cases to customers of Envoy as part of our iBeacon software development offering.

SSW recorded and edited the video, and have put it online here on their SSW TV website.

For convenience, here is the youtube video embedded:


And here are the slides:

Saturday, March 29, 2014

Thoughts on Xamarin for iOS development

Recently I had the opportunity to develop an iPad/iPhone application using Xamarin iOS. For those of you that don't know Xamarin are a company that develop cross-platform implementations of the .NET framework. Their two main mobile product are Xamarin.iOS and Xamarin.Android, which are wrappers around the native iOS and Android SDK's. This allows you to write C# code that is compiled into native mobile apps.



The good thing about this is that it allows you to write applications that have a shared 'core' library of platform agnostic code (for instance connections to web services, in-app database, business logic) while the user interface is written individually for each platform, providing an a good user experience while allowing for some code-sharing. This is in contrast to writing the app twice, in either Java for Android, or Objective C for iOS, and also differs from fully cross-platform solutions like PhoneGap, which requires some compromise in terms of the user interface. I often say the benefit of Xamarin is you write your  app 1.5 times instead of 2, while maintaining an optimal user experience.


The project I was tasked with was to create a mobile inspection app for building certifiers which was to replace a JQuery mobile website. The goals of the replacement app were to improve the offline support, which was subject to some limitation in HTML5 offline storage API's on iOS devices, to improve the user interface and to add some extra features like the ability to take photos of defects. Given these requirements, and especially that we really wanted to give a top quality experience for the user, I decided that a native app was the best way to go (note that I'm referring to Xamarin as native apps, which isn't technically correct however the terms native, hybrid and cross-platform are often mixed around. I consider hybrid to be a combination of native UI elements and webviews, others consider Xamarin to be hybrid).

Having decided on a 'native' app, it came down to writing it with XCode and Objective-C, or giving Xamarin a go. Envoy (the company I work for) specialise in .NET development, which is one factor, however I'm a believer in choosing the best tool for the job, and that learning new languages/technologies isn't something to be afraid of. In the end I went with Xamarin because it allows code sharing with a possible future Android version of the app, and because the core library could be built out faster in C#.



The app was finished in around 7 developer-weeks (including back-end work), and is live on the app store. After completing the app, and having worked on Objective-C iOS projects previously, I thought I'd share some of my observations on the current state of Xamarin.

The Good

Xamarin is a high quality product

One concern I had was that if Xamarin goes broke the code we produce is probably useless as the framework and tooling won't get updated for new iOS updates, however they are well funded and have been around for quite a while now in various forms, and just keep getting bigger and bigger. Updates are pushed frequently, documentation is well written and kept up to date, and they even put on a yearly conference that has some great presentations. They also have a partnership with Microsoft, and there's all sorts of rumours about Microsoft possibly buying them.

Our app ended up performing well and I didn't feel my development time was held back by the Xamarin product at all.

C# and Xamarin Studio fit in well with Cocoa Touch

I don't think Objective C is that bad, however there's no doubt that I found C# to be a more productive language, you can use Linq, Async/Await and some great .NET libraries including the SQLite.NET mini ORM. Xamarin Studio, which is their IDE for the Mac worked well, and integration with storyboards in Xcode works well enough.

Growing community

There is a growing community of developers who are making great things in Xamarin, there are open source projects like MVVMCross (which I chose not to use this time, but will look at in the future) that are actively contributed to and user groups around the globe full of developers. There are many blog posts and Stack Overflow questions that are Xamarin specific, which helps to accompany the official documentation.

The Bad

Missing out on iOS open source 

This is the biggest one for me, so many components and UI widgets for iOS are available as open-source drop-ins to your app. Xamarin has a component store where they attempt to make up for this, however it still has a long way to go. For me, if I knew I was creating an app that was only ever going to be on iOS, this factor alone would probably mean I gave Xamarin a miss for that particular project so that I can make use of CocoaPods, however it's pretty rare that you know for certain you are never going to want an android version of an app.

Visual studio integration is flaky

Xamarin has a feature that allows you to write code in Visual Studio and have it remotely compile and launch on a network connected Mac. This was very flaky and slow for me, so I didn't bother with it, Xamarin Studio isn't too bad, and if you like you can develop your core library code as a separate PCL DLL on Windows so you can use NCrunch for increase test driven development productivity and then develop the UI of the app on the Mac.

Extra layer of potential bugs

While the Xamarin team are extremely smart, and have created a great platform, they are not infallible. There is still an extra layer of code between your app and the hardware which could cause bugs, either in the Xamarin code itself, or as a result of you needing to know about how both iOS and the Xamarin garbage collectors/compilation works. After we released the app, we wanted to add some image resizing features, and came across a memory leak (Xamarin ships their own garbage collector in your app) that we had a hard time fixing. After contacting support with a trimmed down app to reproduce the problem they indicated to us they found a bug in Xamarin and were going to push an update shortly. They also gave us a workaround which got us going straight away which was great, however it still cost us a few days of developer time debugging it.

Other things to note

Using Xamarin is not an excuse not to learn Cocoa Touch and bits of Objective C

My earlier point about not being afraid to learn new things applies here as you'll still be reading Objective C code from blog posts and Apple's official documentation. Xamarin just wraps the Cocoa Touch libraries so you'll need to understand how that works - it's different to the web, and different to WPF, so don't think you Xamarin is a choice to help you just use your .NET developer knowledge to ship an iOS app. A great book to get introduced is iOS programming for .NET developers.

License Fees

Xamarin licenses for companies are $999 USD a year, per platform. This isn't cheap, but compared to developers salaries, or some of the common license fees for Microsoft developer products this is as cheap as chips.

Overall

All in all I'm a fan of Xamarin and would definitely use it again in the future, however I wouldn't say it's what you should always use for mobile development, it's a matter of picking the best tool for the job, which may be an Objective C/Android app, a Xamarin app, PhoneGap or a responsive website depending on the project, budget, goals etc. I do however believe Xamarin should definitely be something you consider as a serious option.

Also..
I'd like to give some credit to Vanessa Grixti (@vgrixti) for the visual design/UX work on the Buildaform app, she did a great job working to a tight deadline. Also if you are looking for Xamarin mobile developers in Sydney, get into contact with Envoy, as I'd love to work on some more Xamarin projects. 

Sunday, February 16, 2014

[Revit API] Binding a project parameter to all categories

In a recent project I had the need to create a new project parameter, and then set the value of it on certain elements. This post has great information on creating project parameters, however that post along with much of the Autodesk documentation add certain parameters to the CategorySet for the InstanceBinding method, what I wanted to do was add all of them. Unfortunately adding all categories in document.Settings.Categories throws an error as not all categories can have parameters bound.

There is a simple solution to this, only add categories to the CategorySet if they have their AllowsBoundParameters property set to true. It’s an obvious solution once you know this flag is available.

CategorySet categories = app.Application.Create.NewCategorySet();

foreach (Category category in doc.Settings.Categories)
{
    if (category.AllowsBoundParameters)
    {
        categories.Insert(category);
    }
}

Saturday, January 4, 2014

Setting up node-postgres with a new PostgreSQL installation on OSX

I was getting a PostgreSQL installation setup with NodeJS today on my computer and ran into some difficulty that I thought I'd write a post about in case someone else comes across the issue.

I started off by downloading the PostgreSQL installer from the PostgreSQL website (I had also tried Postgres.app) and running through the installer with mostly default settings.

Once that was done I went to install the node-postgres module in my node project via 'npm install pg', this threw the following error:

gyp: Call to 'pg_config --libdir' returned exit status 127. while trying to load binding.gyp

After some searching I found this Github issue which pointed me to the solution. The problem is that the installer did not add the PostgreSQL binary folder to my PATH. To get around this, I updated my ~/.bash_profile (vim ~/.bash_profile is the easiest way to do this) to add the following line:

export PATH=/Library/PostgreSQL/9.3/bin:$PATH

(be sure to use the version of PostgreSQL you installed. Also, if you already have that line, you should just add '/Library/PostgreSQL/9.3/bin:' after PATH=)

Save that file, restart terminal and you should be able to type pg_config and get some output on your screen. Once you've done that, reinstall the node-postgres module and you should not see the error anymore.

Hope this helps!