Posts
    158 posts
Shortest Distance to a Character
Here’s another tricky easy LC problem. ...
Matrix Cells in Distance Order
To solve this easy LC problem, my initial idea was to use a TreeMap<Int, Pair<Int, Int>> to store the distance and its corresponding coordinate. TreeMap automatically sorts the keys during insertion so that will save us some time instead of sorting the keys ourselves. ...
Leaf Similar Trees
This problem can be easily solved using recursive way. ...
First Bad Version
This easy LC problem was asked in one of my past interviews (Facebook) which I think I didn’t really answered very well. ...
Maximum Depth of Binary Tree
Another tree traversal easy LC problem. ...
Smallest Range I
Here’s another short answer for an easy LC problem. ...
Reverse Words in a String III
I solved this easy LC problem in less than 10 seconds :D ...
Middle of the Linked List
My first solution for this easy LC problem involves traversing the whole linked list to find the total length. Then calculate the mid point and then use this to traverse the linked list again starting from root until mid point. ...
Increasing Order Search Tree
Tree traversal problems are very common in LC and this easy-level LC problem looks difficult at first but once you find out the pattern, implementing the solution in recursive way is very easy. ...
Available Captures for Rook
I tried to simplify the solution for this easy LC problem but I guess this could’ve been the simplest I can get to. Not a beautiful code but this’ll do for now. ...
Projection Area of 3D Shapes
At first, the problem looks very difficult as it involves multi-dimensional array and projections but the graph in the example really gives out the clue about how to solve this problem. ...
Maximum Depth of N-Ary Tree
Easy LC problem again but this time the problem doesn’t support Kotlin yet so my solution will be in Java. ...
Sort Array By Parity II
Here’s another easy-level LC problem. My initial solution uses two pointers: One to keep track of the index of the next even number and another for odd number. ...
Merge K-Sorted Lists
This is a Hard-level Leetcode problem although the solution looks very trivial to me. ...
Squares of Sorted Array
I solved this problem in like, maybe 5 seconds haha. ...
Total Hamming Distance
My initial solution to this medium leetcode problem uses Kernighan’s way to calculate the number of 1’s in a binary: ...
Height Checker
I really liked the solution to this problem as the code is extremely short. Thanks to Kotlin’s built-in operators. ...
Defanging an IP Address
Just take a look at how easy it is to solve this Easy-level Leetcode question using Kotlin: ...
Candy Dispenser
At Google I/O 2017, people who completed the IoT Codelabs were given an awesome reward: A Pico Maker Kit for Android Things. It’s basically another hardware development platform just like Raspberry Pi and Intel Edison. ...
Hello Android Things
...
Moving to Silicon Valley
Whoah, it’s been a while since I last blogged and all I can say is, now that I’m starting a new life in California, I think I will try to push myself to post more personal stories and technical articles. ...
GDG GeorgeTown Devfest Slides
Here are the slides for the Android Wear presentation that I presented in GDG GeorgeTown’s first ever Devfest + Gdays last November 15, 2014. ...
Reading Heart Rate Data from Samsung Gear Live
Here’s a quick tutorial on how to get data from the heart rate sensor in your Samsung Gear Live watch. ...
SAP Inside Track Singapore 2014
Here are the slides for my talk @ SAP Inside Track Singapore 2014 entitled: Rapid Prototyping with Grails on HANA Cloud Platform. ...
Instagram Network Analysis
Introduction Social networking has become one of the most important topics in recent times because of the several social networking sites that have now become part of our day-to-day living. There’s a huge amount of information that we can gather from analyzing these social network. ...
GDG Kota Kinabalu Devfest Talk
I just want to share the slides that I’ve used during my talk in GDG Kota Kinabalu Devfest last November 16, 2013. My talk is all about Arduino and Android. In the presentation, I briefly discussed the overview of Arduino and presented simple demonstrations of using Google ADK. ...
Visualizing CrazyFlie Flight Data
In this post, we are going to explore one of the smallest quadcopters that are available in the market: CrazyFlie and how we can use node.js, d3.js, socket.io and html5 to visualize the flight data. CrazyFlie is a nano quadcopter from Bitcraze, a swedish company, whose goal is to provide an open-source hardware design and firmware for developing small quadcopters. ...
WallpaperManager and OutOfMemory
While working on an app that sets the wallpaper in Android, I’ve encountered this weird issue with the WallpaperManager API. Initially I thought this will be a very easy and straighforward task because the WallpaperManager APIlooks simple. You just have to get an instance and call setStream() or setBitmap() depending on the type of your source. ...
Social Network Analysis and Online Courses
So it’s my first week in the Social Network Analysis and my 4th week in Programming in Scala by Martin Odersky which are both available as online courses in coursera. I’ve tried enrolling to several online courses before but I never finish a single one because of several factors: being so lazy to work on assignments, day job, personal projects. So hopefully, I can finish at least one of them :) ...
The DigiX Development Board
It’s my first time to back a Kickstarter project and it felt really good to be part of a community that helps small/budding companies launch their products. I’ve seen so many awesome Kickstarter projects before but it always felt like they are too expensive for me or I don’t have any use for them. ...
New Blog Title, new UI and Investments
I’ve decided to change the blog title to something more ‘generic’ because I’m thinking of shifting the type of my posts to a mix of technical stuff and lighter topics such as personal stories and other non-technical stuff. I’ve also changed the color theme so something ‘light’ just to give it a new look. ...
Leap Motion and Android: A Match Made In Heaven
Leap Motion is cool and so is Android so in this post, I’ll explain how to put them together to control a very simple fighter plane in 3D space. The example 3D application was taken from Rajawali’s example and you can take a look at its source code here. ...
Fix the missing R.java on ADT 22
...
Connecting Android to Arduino using Bluetooth
There are multiple ways of how you can connect an Android device to an Arduino board. You can use wifi module, a usb cable or a bluetooth module. In this post, we will try to explore the connection between the two devices using bluetooth. ...
Geocoding and Accessing Google Doc using Python Script
I have a list of around 1000+ churches that contains the name of the church, simple address, the residing priest and some contains mass schedules. I thought it will be nice if we can get the latitude and longitude based on the given address. The way I do it before is to manually search the address in Google Maps and get the latitude/location by centering the marker and executing the javascript below: ...
Heart Rate Monitor using Android and Arduino
Last week I decided to buy some stuff from local reseller of Arduino. I bought a Kyto Heart Sensorthat transmits heart pulses to a receiver via radio frequency. The RF receiver can then be interfaced to an arduino and then pass the results to an Android device for visualization. ...
Fixing the ADK Library to work with Arduino 1.0
If you’ll try to create a sketch using the Android ADK library on the latest version of Arduino (1.0 as of this writing), you will get several errors just like this: Damn it I accidentally deleted the images! This is because they renamed some header files and also changed the signature of some commonly used functions. ...
How to use a Tricolor LED and a Mini Buzzer
...
Controlling a Micro-Servo
...
Sensing Light Variations using LDR
...
Getting Started with Android and Arduino
Writing applications on Android is cool but writing applications on Android that can talk to the physical world is totally awesome. I recently bought a Seeduino ADK Board, which is actually a clone of an Arduino board that has support for the Android Accessory Development Kit. You can find more information about Seeduino here. ...
Pixel Playground using Renderscript Compute API
...
ListView Row Highlight
Basically the idea behind this post is to show unobtrusive way of informing the user that something has changed in the data. When using ListView in Android and the backing data has changed, most of the time, I just call notifyDatasetChanged() and voila, ListView will automatically refresh the UI for me. But I noticed that this isn’t particularly good for the user as most of the time he has no idea that something has changed. ...
Sharing Apps on Android via Bluetooth
There are times when you just want to share a particular application on your phone to a friend and as developer, I encountered this problem several times when I want to let my friend try out an application on his/her phone. ...
Phone Phreaking/Hacking
I suddenly missed all the phone phreaking/hacking I’ve done back in 1999. It all started when someone introduced me to this group of teens calling themselves as “Liners”, most of the them are from Marikina and Pasig area. Basically these “liners” originated from cross-line party, a “bug” in the analog PSTN where multiple people can hear everyone simultaneously. ...
Eircom SSID
...
Converting Bitmap to Grayscale
I’m just going to share this simple snippet to convert your colored bitmap to grayscale. I’ve used this before because my application needs to communicate to a server which will just extract the image features using SURF. It doesn’t really need the color information so we decided that we can remove the color information so save up few kbps and eventually speed up the transfer. ...
Android Development using Maven
...
Alphabet for Android Developers
I just noticed that there are equivalent short URLs for Google’s android-related sites. I hope you’ll find this useful. ...
Custom SeekBar Preference
I just would like to share the code that I’ve posted in the Google Devs mailing list when someone asked about the SeekBar Preference. This allows you to popup a seekbar that you can use to adjust some properties like volume, difficulty and other things where a slider will be useful. ...