Ray Casting Algorithm

If you’ve been struggling with the problem of determining whether a point lies inside or outside a polygon, perhaps in google maps, read on. This post is specific to Android and Node.js but the algorithm can easily be implemented in any other language/platform as the algorithm itself is a piece of cake once understood.

Computer Vision – Face Detection

COMPUTER VISION What is it…? Computer Vision is mimicking the abilities of human vision by electronically perceiving and understanding an image. It is a broad term and includes a lot of domains like Gesture Recognition, Optical Character Recognition, Face detection and a lot more. In this article, we will be focussing on face detection and try to understand the key ideas that allow us to detect human faces in real time. It all begins with a pixel! As shown below, a digital representation of an image comprises a large number of pixels depending on the resolution of the image. Each pixel represents the smallest unit containing the…

Voronoi: A solution to proximity based problems

In computational geometry, Voronoi diagram is a partitioning of a plane with n points into n convex polygons such that each polygon contains exactly one generating point and every point in a given polygon is closer to its generating point than to any other. A Voronoi diagram is sometimes also known as a Dirichlet tessellation. GeoVoronoi is an extension of Voronoi optimized for geo locations. To dive deeper into Voronoi geometry, read chapter seven of Computational Geometry: Algorithms and Applications. Or maybe play with this cool demo. If you’re working on any proximity-based problem, Voronoi diagram can be a lot of help. In layman’s language, Voronoi diagram…

Ruby on Rails Caching And JavaScript Techniques

Cross posted from darthsid While implementing caching in a recent rails project I came across some typical caching issues. In a lot of pages the content is same for all users but certain components in them have user specific actions. As an example, I have a page listing all public messages that users have posted(similar to the public timeline in twitter) but actions on those messages are user specific(eg: only owner or admin can delete a message). Also, most of these actions use ajax and the rails authenticity token in them also gets cached resulting in subsequent failures if the session changes. Another issue was that the…

Configuring TinyMCE SpellChecker with rails application

Last month I spent much time while configuring tinymce’s spellchecker with my rails application. But finally I got it working and thought I could be a good post. To configure this I took some help form gusto’s blog and google (as usual). So, Lets do it now without spending more time.
First of all create a […]