SOS

Shane O'Sullivan's technical blog… really ties the room together

Looking back at WebOS

Posted by Shane O'Sullivan on September 11, 2017

I recently found my old Palm Pre 3 (the unreleased on I received as a gift), and was amazed at how good it still felt. Here’s a quick video I made of some of it’s features, and one of my favourite apps that I built, Mazer

Advertisements

Posted in Technical | Leave a Comment »

Consolidated everything on Chofter.com

Posted by Shane O'Sullivan on May 3, 2017

Many years ago I wrote a search engine site called Chofter.com, that I thought was pretty cool.  It pulled together search results from Google, Bing, Flickr and many other search services all into one UI.

Time has moved on, and most of the APIs have been shut down, so I’ve decided to shutter the site.  At the same time, the internet server for my alma mater on which I served all my academic research has shut down after 25 years in operation.

So, I’ve thrown together a simple site for Chofter.com which provides links to many of the things I’ve built over the years that still have some value (it was a shock to see how useless stuff gets over 15 years!), including my mobile apps for non-dead platforms, my robotics research and Voronoi graph code, and more.

Screen Shot 2017-05-02 at 22.56.14

Posted in Technical | Leave a Comment »

folder-backup-service: Consolidate your files

Posted by Shane O'Sullivan on January 9, 2017

A common problem I’m come across is that of similar files being scattered around my computer by various services, that I wished were all located in the same place.  For example, my iPad syncing photos to Dropbox’s “Camera Uploads” folder, whereas my phone syncing with the Mac’s Photos hidden folder, since I plug it in much more often.

My preference is that they would all just be in a single folder.  But I don’t want to do this manually, on a regular basis.

To fix this I’ve written a simple script that can be installed on a Mac as a service.  It is called folder-backup-service, and can be downloaded either as a ZIP file, or checked out out using Git (if you’re more of a web engineer) from GitHub at https://github.com/shaneosullivan/folder-backup-service .

For usage, see the README file.

Some benefits of using this include

  • Keep the amount of space used in Dropbox low.  As soon as any device puts a file in a Dropbox folder you’ve specified, and it syncs to your computer, it will be moved off Dropbox to your local machine.
  • Should keep the local cache usage on mobile devices by Dropbox low, rather than using up gigabytes on iPads and iPhones.
  • Makes it easier to find your original images when syncing through Photos, rather than having to dig around for them in the hidden folders that Apple insists on storing them in.

This is open source, licensed with MIT, and I’m very open to people sending pull requests if you’re interested in getting the service working with operating systems other than Mac.

Posted in Technical | Leave a Comment »

Dark Legacy Comics for Android launched!

Posted by Shane O'Sullivan on October 5, 2016

Over the past few months I have been building an app for a friend called Dark Legacy Comics in my spare time.  I previously wrote about the iOS version I released, and now I’m very happy to say that I’ve launched the Android version!

You can get the app from https://play.google.com/store/apps/details?id=com.chofter.dlc, using any Android device.

As with the iOS version, the app costs $2, and all proceeds go the author of the comic to help with funding his site costs.  Given the comic gets about 200k visitors per month, it’s quite expensive!

On a technical level this is very cool, as I got to reuse about 98% of all the code from the iOS version due to building it with React Native from Facebook.  This allowed me to write the app in JavaScript, but it runs using fast native code on both iOS and Android.  The process wasn’t exactly smooth, as there are still a lot of differences between the platforms that have not been papered over by the framework (some of which I describe here), but in general it’s far, far more efficient than learning both Objective-C and Android development.  So, thanks to my colleagues at Facebook for building such great tools!

simulator-screen-shot-oct-4-2016-9-34-14-pm

 

 

Posted in Technical | Leave a Comment »

Troubleshooting setting up a React Native Android dev environment

Posted by Shane O'Sullivan on September 9, 2016

React Native is awesome, but the docs leave something to be desired, particularly for Android (the RN team is working on it!).  I recently wanted to get started on building an Android version of the completed iOS app I previously shipped using React Native, but it turned out to be an overly painful process.  The docs assume knowledge of Android development, which I do not have, so here are the steps I used to get up and running on my Mac.

My setup

  • React Native version 0.32
  • Mac OSX 10.11.6 (15G1004)
  • javac version 1.8.0_011

Steps

  1. Follow the instructions for installation in Dependencies for Mac & Android.
  2. Open Android Studio from Applications, step through the setup wizard to download all the packages it needs (about 250MB)
  3. To run the emulator, you need to create a Virtual Device
    – Use AVD Manager to create a virtual device (https://developer.android.com/studio/run/managing-avds.html).   I chose to use a Nexus 5X emulator for no other reason as it was the default selected one.Screen Shot 2016-09-08 at 10.04.40 PM.pngScreen Shot 2016-09-08 at 10.05.50 PM.png
    – Run that device by clicking on the green Play button
  4. In your terminal, change directory to the root of your React Native app, and run
    react-native run-android

If at this point your React Native app shows up in your emulator, congrats, you’re now a React Native Android developer!

If not, read on.

Troubleshooting

You might see this error:
Could not run adb reverse: spawnSync

If so, add the following to ~/.bash_profile if not already there:
export ANDROID_HOME=~/Library/Android/sdk
then run
source ~/.bash_profile
and run
react-native run-android
from the root of your app again. (From Stack Overflow: http://stackoverflow.com/questions/38835931/react-native-adb-reverse-enoent).


If you get the error
failed to find target with hash string ‘android-23’
try deleting the folder
~/.gradle
and running the command again (from http://stackoverflow.com/questions/33417537/failed-to-find-target-with-hash-string-android-23).  This apparently worked for some people, but not me.

screen-shot-2016-09-08-at-8-31-49-pm
You should install:

  •  “SDK Platform” for android-23
    • Go to Tools/Android/SDK Manager
    • Click the “SDK Platforms” tab, if not already selected
    • Check the box for Android 6.0, which is API version 23

Screen Shot 2016-09-08 at 9.28.01 PM.png

  • Android SDK Build tools for version 23 (I installed 3 of them, see screenshot)
    • Go to Tools/Android/SDK Manager
    • Click the SDK Tools tab
    • Check the “Show Package Details” box in the bottom right
    • Under “Android SDK Build Tools” check all boxes for anything with version 23.

Screen Shot 2016-09-08 at 8.21.11 PM.png

This got me past this error.


I then got the errors:
<project folder>/android/app/src/main/java/com/dlc/MainActivity.java:35: error: method does not override or implement a method from a supertype
    @Override

and

<project folder>/android/app/src/main/java/com/dlc/MainActivity.java:39: error: constructor FBSDKPackage in class FBSDKPackage cannot be applied to given types;
            new FBSDKPackage()
            ^
  required: CallbackManager
  found: no arguments
  reason: actual and formal argument lists differ in length

It turns out I had generated my project on an earlier version of React Native, as I was working on the iOS version first, and the Android code it generated was no longer compatible with React Native v0.32.  To fix this:

  • Create a temporary folder
    • mkdir ~/tempFolder
    • cd ~/tempFolder
  • Now create a new React Native application with the exact same name as your application in that folder.  This is important as the React Native tools embed that in a number of files that they generate.
    • react-native init MyAppName
    • Rename the folder in your original app “/android/app” to something else, e.g. “/android/app_old_and_busted”
    • Copy the folder ~/tempFolder/MyAppName/android/app to the “android” folder in your app.
    • run the command “react-native run-android” from the root of your app again.
  • Woohoo, it worked for me!

Posted in Javascript, React Native, ReactJS, Technical | 2 Comments »

Dark Legacy Comics, my first React Native app

Posted by Shane O'Sullivan on May 30, 2016

I’ve been a fan of the React Native framework for a while, even ignoring the fact it’s built by my colleagues at Facebook.  However since I spend my work days talking to engineers rather than coding these days, I haven’t had a chance to build anything real with it.  While I had some time off recently I fixed that, and built a fun new app for a friend, Dark Legacy Comics, now available on the Apple App Store.

It was a fun process, getting to build an app that runs really fast and smooth using all native UI components on iOS, but writing 99% JavaScript.  Given that I neither know Objective-C nor have the time (nor inclination) to learn it, it’s pretty amazing that I can now write an app that works this well.

The process was nowhere as smooth as it needs to be, given I ran into many tricky roadblocks with upgrading versions, importing 3rd party libraries, weird iOS build errors and more.  Still, with a little perseverance and quite a bit of cursing, I got it all working.  So, try it out (sorry it’s not free, all proceeds to the author of the comic, but he’s awesome and more than deserves it after 10 years of hard work) and let me know what you think!

Posted in Technical | 2 Comments »

Mobile Tesla Motors forum

Posted by Shane O'Sullivan on November 24, 2014

I like to keep up with discussions about the Tesla Model S in their online forum, but this is very difficult to do on a mobile device, since it it not optimized for that, and still focuses on a desktop layout.

So I fixed it!  Behold the mobile Telsa Motors forum – http://chofter.com/tesla .

Open this on a mobile device and enjoy browsing through all the comment threads.

Since I do not work for Tesla and don’t have access to their forum code there are some limitations:

  • It’s read only.  If you want to comment you have to go to their site.
  • It can’t show private posts, so only public posts are visible
  • To save on server costs, it refreshes every 10 minutes, so sometimes may not be as up to date as the real forum.  This should be mostly fine though

Enjoy!

Posted in Technical | Leave a Comment »

URL & JSON Decoder in ReactJS

Posted by Shane O'Sullivan on July 20, 2014

I was debugging some network traffic, and needed to decode a URL that contained JSON values.  It looked like there was no good example readily discoverable on Google, so I threw together one using ReactJS, the amazing JavaScript library from my colleagues at Facebook.

Check it out at http://chofter.com/decode

It’s a simple single page application, and can be used as a good example of how to structure a simple ReactJS application. The source code is available on GitHub at https://github.com/shaneosullivan/react-url-decoder .

Screen Shot 2014-07-19 at 6.21.10 PM

Posted in Technical | Tagged: , , | Leave a Comment »

Tesla Forum Search

Posted by Shane O'Sullivan on August 22, 2013

Tesla Forum Search

I like to read the forums on the teslamotors.com site, but a big problem they have is that there is no search feature.

To solve this problem, I wrote a Chrome plugin to do the searching for you.  It basically crawls the forums, tokenizes the posts and builds a simple search index.  This is stored on your computers hard drive, which makes searches very quick.

Try it out!

Posted in Technical | Tagged: , , , | Leave a Comment »

Launching Ads Reporting at Facebook

Posted by Shane O'Sullivan on June 26, 2013

For many months I and a few other engineers at Facebook have been building a new reporting tool for advertisers. This involved both a huge amount of work to build a fast, flexible backend that lets you slice your data in almost any way you can think of, in real time, and a UI to match.

I’m really proud of this work, which involved building a DataTable that can handle an infinite number of rows and columns, in place column reordering, resizing and all the other fun stuff that goes along with it.

If you run ads on Facebook, give it a try. It provides an unprecedented level of detail on the performance of your campaigns including how much you’re paying for the actions that you care about, such as mobile app installs, page likes etc.

Some press about it:

FB Studio (with video): http://www.facebook-studio.com/news/item/updates-to-ads-manager-reports

Techcrunch: http://techcrunch.com/2013/06/26/facebook-ad-manager-reports-update/

Adweek: http://www.adweek.com/news/technology/facebook-doubles-stats-ad-buyers-150778

AdExchanger: http://www.adexchanger.com/social-media/facebook-adds-device-reporting-new-reach-frequency-metrics/

Posted in Technical | Tagged: , , , | Leave a Comment »

 
%d bloggers like this: