Call to an end of keys and locks as we know them

Screen Shot 2013-05-30 at 8.45.12 AM

I’m personally trying to simplify my life as much as possible, getting rid of the things I don’t need/enjoy. Keys are one of them. When you have too many locks in your life, this is particularly uncomfortable, and those few electronic locks in the mix that you find nowadays with fobs/passwords can only help so much, fobs still can be lost (lost my office’s key fob this week for example, it’s been a nightmare and it’ll cost me $50 to replace if I don’t find it)

In an ideal world, whoever solves this problem in a way that it’s cheap, safe, uses as little energy as possible (none would be sick so it can compete with regular keys, or at least human energy) wil have a billion dollar in his/her hands.

The ideal solution should work like magic, and these locks should be installable in doors, gates and vehicles. No passwords should be shared, and the lock magically opens to those who are authorized to use them.

These news by Motorola/Google are very promising, however I don’t buy the “pill” solution, but I’d definitively be willing to apply some sort of invisible electronic NFC tattoo in my hand or my arm, so that when my hand is near the lock it gives off a unique magnetic signature so I can be validated. Think NFC chips for your body.

For those of you who don’t want to have a tattoo, perhaps there could be a version of the NFC tag that we could place on the back of your watch if you wear one, or if you wear rings or some kind of jewelry at all times it could be attached there.

The idea is that you don’t have to carry your authentication mechanism in a wallet or a key ring, so that you can just go out not worrying about carrying keys with you because you are or have the keys on you all the time.

My Git Cheat-sheet

I don’t know if it’s the crazy syntax, but for the life of me, I always need to come back to this cheat sheet, maybe you will too:

GIT CHEATSHEET

fetch remote branch.
git fetch origin nameofbranch
“fetch” downloads the changes of the remote branch but doesn’t automatically merge them.
If you have commited local changes on that branch, you usually fetch and then rebase your changes at the end of the fetched updates.

push local branch to remote
git push origin (pushes current branch to default remote branch)
git push origin nameofbranch (pushes current branch to the remote nameofbranch branch)

delete remote branch (who the fuck thought of this syntax?)
git push origin :branchToDelete (deletes branch on remote repo)
git branch -D branchToDelete (deletes branch on local repo)

clean untracked files (not folders)
git clean -f -x

list your remote repository aliases and full paths
git remote -v

How to undo the last commit but keeping the changes
git reset HEAD~1

How to remove the last commit from the remote
git reset --hard HEAD~1
git push --force (careful with the –force if you’re working with somebody else)

While working on a feature branch

“Ideally, you do git pull –rebase or git rebase upstream/master instead of merges while working on a feature branch so that you don’t get merges.”
-@laanwj

Discard local changes and replace with what’s on the remote repository for current branch.
git fetch origin
git reset --hard origin/myBranchHere

Rebase+Squash all changes of your feature branch (since you started that branch out of master.)

Standing on the branch…

git rebase -i master (the -i stands for interactive rebase)

All commits will shown.

Switch to Pull Request branch
git fetch origin pull/ID/head:BRANCHNAME
$ git checkout BRANCHNAME

Checking out a branch from someone’s fork of your project to test/fix pull request.
Say user ‘alice’ is submitting a pull request from a branch called ‘wonderland-feature’
You want to test that branch locally, this is how you get it.
#first add a remote for that repo.
git remote add alice https://github.com/alice/our_project
#download her branch
git fetch alice wonderland-feature
#create a local branch with her remote wonderland-feature branch
git checkout -b wonderland-feature alice/wonderland-feature

Now git log should show the same commits as on her repo.
Commit to the branch if you want to fix something for alice, and then push to your
fork (by convention your fork is called origin) of the repo, then send her a pull request
from your fork.
# uploads the branch to your fork, from there send her pull request.
git push origin wonderland-feature

Once she has merged your changes, if you feel her branch is good now, you can now merge hell pull request on the upstream repository.

OUYA Unboxing and first impressions

I was one of the July 2012 backers and I finally received my OUYA right on Memorial weekend on Saturday afternoon.

Here’s my unboxing, thoughts, and if you don’t have time to see the whole thing and you’re thinking about getting one, get it, totally worth the $99. They did a great job overall, this thing can play any Android video game, it runs Android 4.1 out of the box, it can also stream video really nice as well (see the Twich app to watch live streams from gamers worldwide to get the picture of the streaming capabilities)

I can safely say “I love OUYA”.
(and sorry for the pronuciation, the way to pronounce it is “OOH-Yah”

Adobe Premiere Pro CS6 recommended settings to edit and export YouTube videos

1920×1080
16:9
PAR 1
Progressive
30 fps drop frame timecode
48k
General
Editing mode: Custom
Timebase: 29.97fps

Video Settings
Frame size: 1920h 1080v (1.0000)
Frame rate: 29.97 frames/second
Pixel Aspect Ratio: Square Pixels (1.0)
Fields: No Fields (Progressive Scan)

Audio Settings
Sample rate: 48000 samples/second

Default Sequence
Total video tracks: 3
Master track type: Stereo
Audio Tracks:
Audio 1: Standard
Audio 2: Standard
Audio 3: Standard

Export Settings:

VIDEO
Codec: MainConcept H.264 Video
TV Standard: NTSC
Frame Size: 1920 x 1080
FPS: 29.97fps
Filed Order: None (Progressive)
PAR: Widescreen 16:9
Profile: Main
Bitrate Encoding: VBR, 1 Pass (some recommend 2 Pass)
Target Bitrate [Mbps]: 13.89 (nitrate could be lower 8-10 MB/s if file size too large)
Maximum Bitrate [Mbps]: 15.36

AUDIO
Codec: AAC
Output Channels: Stereo
Frequency: 48kHz
Audio Quality: High
Bitrate [kbps]: 128 – 192kbps depending on how important is the audio vs file size (background noise vs music video)
Advanced Settings->Precedence: Bitrate

How to use Google’s calculator to convert Amps and Volts, to kWh

Say you have an electric engine that consumes 8 amps at 12 V, and you would like to know how much this would translate in kilowatt hours?

Go to Google’s search box and type

8 amps * 12 v * 1 hour

Screen Shot 2013-05-26 at 8.27.15 AM

And you will get the total output in Joules, which is 345,600 joules.

Then tell google

345600 joules to kwh

And google will tell you

0.096 kilowatt hours (which is what a small electric fan will consume in an hour), or the same as 8 * 12 = 96 watts * 1 hr, 96 Wh

Screen Shot 2013-05-26 at 8.29.47 AM

How to avoid Android compilation/building issues – Setting up the Eclipse Buildpath correctly

This post is the product of about 48 hours of not being able to work on what I was supposed to be working because I had to deal with build issues in Eclipse.

Hopefully If you follow these steps you will be able to solve some of the issues you may be facing right now with your build.

Some of these issues are:
– Class not found errors, even though your app was built and uploaded to your device.
– R.java not being compiled.
– *.aidl interfaces not generating .java files.

Screen Shot 2013-05-20 at 6.09.53 PM
1. Make sure your project’s compiler is set (as of the current android release) to be Java 1.6 compliant.

If you work on several java projects outside of Android, you may probably need to work with Java 1.7 compiler specs and by mistake you may have set it as the default for all projects.

This may cause a lot of stuff to break on your Android projects, including the generation of .java files out of .aidl files.

Make sure your Android project is using Java 1.6 (which is sadly all of what Android supports as of this writing)

2. Make sure the .jars you want to export are CHECKED in your Java Build Path > Order and Export settings

Screen Shot 2013-05-20 at 6.24.00 PM

After updating my Android SDK tools last friday, I wasted a whole day trying to figure out why on earth my application was giving me runtime Class Not Found errors on classes that exist inside android-support-v4.jar, even though I had all my jars placed on the proper standard “libs/” directory in my project.

The culprit was that the checkboxes along the .jars in my Order and Export tab were not checked.

3. Make sure your source folders are placed in the right order in your Java Build Path > Order and Export settings

Screen Shot 2013-05-21 at 12.13.46 PM

That right order for me has been:
1. My source folders at the top.
2. The “gen” folder right after the source folders.
3. My jars and Android dependencies at the the bottom.
4. Make sure “Android Dependencies” and “Android Private Libraries” are all the way at the bottom. I found out having them before the .jars causes issues when you want to attach source code to your .jars, eclipse will try to browse the .class inside the “Android Private Libraries” which does not allow for source code attachments, therefore not letting you see the source code you’ve attached on the build settings.

3. Make sure the .jar dependencies you need are saved inside the libs/ folder in your project.

That’s all I have for you.
Clean and Rebuild.

Key chain solution for Tesla Model-S tiny key fob hole.

Tesla designed a really cool fob “key” to control the car’s locks, trunk and “frunk”, it looks like a little toy car, but there’s a fundamental problem, it wasn’t designed to be part of a regular keychain, and if you’re not careful you might lose the key fob easily.

Tesla Model-S Key Fob keyring whole not meant for keyrings.

I hope you came across this post and you didn’t scratch your fob already, I suggest you get something like this and then attach that to your key chain, it only costs $6 and it’s quite convenient.

51KD4rH7GpL._SL1000_

via evstories.com