Controlling Unity with Leap Motion

Screen Shot 2014-09-04 at 11.59.16 AM

 

I’m still waiting for the Oculus DK2 to ship so I’m doing an open source project to find a more intuitive way to translate, scale, and rotate objects in the Unity. If you’ve seen the Iron Man movies or Elon Musk designing rockets with his hands, you’ll understand what I’m going for. Manipulating 3D objects using keyboard and mouse is quite limiting. If we can improve on this, it would allow us to create content for VR faster.

We’ll be using the Leap Motion, which ships in 2 days from Amazon :-). The plan is to create a custom Unity editor window that will communicate with the Leap Motion sensor. We’ll then connect the hand movements directly to the translation, scale, and rotation controls for the currently selected GameObject. Feedback is always welcome. Here’s a link to the source on Github:

https://github.com/tuesy/leap_motion_editor

 

coolstartup.io / or How To Choose a Web Service API

Most startups today leverage commercial SaaS services. When it comes to choosing an API, there are many choices but I tend to try the ones that end in “.io” first. For example, when looking at weather forecast APIs, I skipped over familiar names like Yahoo and Weather Channel and went straight for Forecast.io. Better service APIs tend to have domains ending in “.io” and they have straightforward APIs, solid documentation, libraries in your favorite language and simple freemium plans. All of this usually allows you you decide within minutes whether this service will work for you. Check out my super short tutorial on using forecast.io:

https://github.com/tuesy/forecast_io_tutorial

 

Rails Google OAuth2 Tutorial

Google recently deprecated OpenID 2.0 authentication, which I used to authenticate users via Google Apps for internal projects like our Dashboard. In a couple of months, it will just stop working so I’ve been converting projects to use OAuth 2.0. Google login is pretty convenient, especially if your team is on Google Apps. The conversion process was very annoying so I hope this tutorial saves you time.

First, we’ll need to setup a new project in the Google Developers Console.

Google_Developers_Console

Next, enable the “Google+ API”:

google plus

Go to “APIS & AUTH > Credentials” and click “Create New Client ID”. You’ll need to configure the origins and redirect URIs for every domain you need. I’ve configured it for development and for Heroku so you can see a live demo.

client settings

You should now have a CLIENT ID and CLIENT SECRET. Let’s put them in your shell startup script so that your app can access them. We do it this way so that you don’t check in sensitive information into your source code.


~/.bash_profile

export GOOGLE_CLIENT_ID_TUTORIAL=<your CLIENT_ID>
export GOOGLE_CLIENT_SECRET_TUTORIAL=<your CLIENT_SECRET>

Now we can run the example:

source ~/.bash_profile
cd ~/Sites
git clone https://github.com/tuesy/google_oauth2_tutorial
cd google_oauth2_tutorial/
bundle install
bundle exec rake db:setup
bundle exec rails s

This loads your shell startup script, grabs the source code, setups up the database and starts the app. If all went well, you should be presented with the Google Login screen. After logging in and approving the app permissions, you should see “You are logged in via OAuth 2.0 as <your email>!”.

More Details

This tutorial uses the Omniauth gem, which makes it easier to provide multiple ways for users to authenticate into your app. You specify what you want your app to allow as individual “strategies”:

config/initializers/omniauth.rb

Rails.application.config.middleware.use OmniAuth::Builder do
provider :google_oauth2, ENV['GOOGLE_CLIENT_ID_TUTORIAL'], ENV['GOOGLE_CLIENT_SECRET_TUTORIAL'], {scope: 'email,profile'}
end

Tip: If you want to use this for your Google Apps domain, simple pass an additional parameter:

provider :google_oauth2, ENV['GOOGLE_CLIENT_ID_TUTORIAL'], ENV['GOOGLE_CLIENT_SECRET_TUTORIAL'], {hd: 'mydomain.io', scope: 'email,profile'}

The whole flow can be confusing so make sure you reference the Omniauth documentation before trying to troubleshoot. I found that if you don’t fully understand the flow, it will be very hard to debug your code. However, once you do, adding other strategies like Facebook or Twitter should be much easier.

Troubleshooting

If you’re seeing “invalid client_id”, your environment variables are probably not set correctly. You can use the “printenv” command to verify if the particular terminal tab you’re running the server in has the right variables. If not, source your shell startup script again. If you’re seeing API permission errors, you probably forgot to enable the Google+ API. Google’s documentation has more detailed information on specific errors that may help. If all else fails, clear your browser cookies for localhost.

Links

Startup Landscapes

Print

Diagrams like this one for the Crowdsourcing space can be very help for entrepreneurs. However, it’s frustrating when you can’t click on the company logos and you’re always wondering how out-of-date it is. That’s why I created a project called Startup Landscapes. You can click on each logo and the grouping is a little more organized so you can see it in a table view. I’ve played around with other visualizations like circle packing, but it’s more confusing then helpful at this point. I’ve only added a couple of the most popular diagrams out there. LUMA makes them for quite a few industries so check those out. Don’t miss the Robotics one.

Why I Chose iPad Mini Over iPad Air

IMG_0207

Most reviews start by telling you about specs. It’s more useful to understand personal behavior.

Watching Videos

When you’re lying in bed on your side, the weight of the iPad isn’t as big of an issue because most likely the edge is resting on the bed so you’re just keeping it from falling over. Like many people, I watch lots of videos—NBA highlights, game walkthroughs, movies, etc. I also have NBA League Pass so I watch full games on demand with scrubbing capability—it’s awesome. I found that the Full is too big for this position so I’m either extending my arms out uncomfortably or I’m in windowed mode. You do this because if you hold it too close, everything looks gigantic and your eyes get tired darting around the large field of view. With a Mini, I can go full screen and watch J-Lin slice through the lane at just the right distance.

Reading

The Mini is a paperback and the Full is a hardcover. Honestly, I prefer reading on my iPhone 5S over the Full. I’m not sure if it’s the longer travel distance for my eyes from side to side or not being as easy to handle while shifting positions or just feeling self-conscious—people who read with a Full look silly, almost as silly as people who use iPads as video cameras. Whereas before I’d take one look at my Full and then turn on my phone to read, now I read a lot more and on the Mini. For reading, I would actually prefer something lighter and narrower (uh oh, starting to describe a Kindle) but it’s good enough.

Taking Notes

I take a lot of notes because my brain needs Evernote. I’ve been searching for a long time for a good way to get me past my laziness. I had a brick of a convertible Toshiba tablet with OneNote back in the day, I’ve used Penultimate with a Full plus stylus, I’ve even tried a real world Moleskin notebooks because they feel so good. In all these cases, I couldn’t reliably get typed text at the end of the day. Handwriting recognition is never perfect and transcribing real world notebooks is a pain in the arse. The Mini solves this problem. In meetings, bringing your laptop is bad for attention because you usually lose eye contact not to mention the disrespect. Thumbing away on your phone usually makes people think you’re playing Candy Crush. With the Mini, I feel like Data from TNG and all my ideas get recorded.

I should have bought this last year even without the retina display. It feels better when watching, reading, taking notes, sketching—mostly because this is the right size for me. Think about how you would use it…and then go buy a Mini either way. I guarantee you’ll understand your personal behavior before those 30 days are up.

Read the Bad Reviews and Ignore the Good Ones

nose sucker

 

The holiday shopping season has started so I wanted to share some advice to fellow buyers. This applies whether you’re buying a $5 toy or a $50k cars.

Good Reviews Are Bad for You

Beware of reviews like “great product” and “would totally buy again”. Most startups you work for will ask their employees give good ratings for their own products whether it’s electronics or iPad apps. That’s just common sense. Why wouldn’t you ask employees, friends, family, and the homeless guy on the street corner to give you a good rating? Every bit helps right? People tend to quietly accept this type of ethical transgression and not the other kind: writing a bad review for a competitor. You can get sued for libel right? Good reviews tend to be shorter as well because the marketing material already covered the bases so it’s hard to come up with something nuanced to rave about. For example, when looking for a “nose sucker” to remove boogers from my baby’s nose (true story), I found this useless 5-star review. The subject is “it works” and the user “HappyDays” admits that “we never tried other more traditional aspirators so I can’t compare it to those”. It’s reviews like this that helped create helpfulness ratings.

Bad Reviews Are Good for you

On the other hand, I love bad reviews. When I’m on Amazon, I look at reviews starting with the most scathing first. The longer and nastier the review the better. That’s because bad reviews tend to get to the heart of the problem. The customer likely ran into a shortcoming of the product and like stepping on dog poo, wanted to warn the rest of the us of the stinking pile. In many cases, I can quickly decide whether the negative review is warranted and whether it affects my decision. For the same product, I came across this 1-star review. Her complaint was that using this made her ill because you are basically sucking the germs into your mouth. I thought about this for a second and decided that I’d be fine with this outside risk since my germs are probably more dangerous to the baby than hers to me. Other times, the reasons are legitimate but it doesn’t apply to you. For example, another customer may not like the heating system of a car but you live in Las Vegas so you only care about the air conditioning.

What to Look For

Start by asking whether the problem is a legitimate concern to you. If the “defect” doesn’t apply to you, move on. If it does, be extra sensitive to it. For example, if a customer suggests that a baby crib’s construction is shoddy, take it as a red flag and look for similar reports in other reviews. You don’t want to take any chances. Next, try to determine whether the review was influenced by emotion. If someone is screaming in all caps, “OMG, THIS IS THE WORST PRODUCT IN THE WORLD”, it’s probably less credible than someone writing “this product doesn’t feel safe because pieces came off after daily use of 1-2 hours”. At the end of the day, bad reviews are harder to come by because you’re counting on people to do a solid for the community and it’s easiest to be lazy. There are also cases like Yelp’s where companies take bribes to remove or hide bad reviews (rumored). Just remember that all reviews are biased and that bad reviews are more likely to be helpful.