Posts

Swallow - My next game

Image
Guide the fireball (orange block) to the hole (blue block). Simple! Download the project here (5.2.1f1 and above). It uses the UUEX framework mentioned in the previous post.

Unity3D / C# - Tetris 3D

Image
I could not find any reference for Tetris game anywhere :-(. So, I decided to write one and here it is. This is in Unity3D and is 3D. The only thing missing is the J piece.... just lazy!! This version has no gravity. This means you will see blocks hanging after rows are cleared.  I tried making things easy by attaching Rigidbody to the tiles but they create some nasty side effects. You need to freeze rotation, add physics materials for zero friction and what not. I removed them and used a simply 2D grid instead. A total effort of 15 hours. This is not a full blown game. No bonus, no score, no levels.. just plain and simple game play. Uses a PoolManager for optimising the spawning of blocks and the UUEX framework in my previous post for a start and end UI. And yes, a background music and an effect when a row is cleared. Feel free to adapt it anyway you want. Download the Unity3D project here (version 5.2.1f1 and above). 

A framework on top of the Unity 5 UI system - UUEX v1.0

After a long shot at this, I finally feel I am ready to ship the first cut of this sucker. It's a framework built on top of the UGUI system. I spent a lot of time building a framework on top of NGUI, but with new revisions and fixes, we always ended up doing a lot of patch work. End result.. bloated code. And then came UGUI, which was more or less similar to NGUI, but without the crazy gizmos, editor scripts and what not. It just seemed much slimmer, cleaner and nicer than NGUI. So, I decided to write a framework around it. The framework glues all the elements of UGUI nicely. You don't have to be worried about Canvas, Graphic, MaskableGraphic etc. What is available to you is, SetVisibility, SetTexture, SetSprite which is more neater and friendly. Download the zip and explore it. Let me know what you think. Download UUEX 1.0

Web Crawling using Apache Nutch + MySQL + Solr

If you have come here, then you probably know what Nutch is and you are looking for a test to integrate it with MySQL and Solr or Elasticsearch. So, lets get started. I am not going to guide you with the steps, but give you this awesome link which helped me run a test crawl in couple of hours. Technically, it should have taken not more than half hour, but I had to spend more time trying to figure out the issues mentioned below on my Mac - El Capitan. Firstly follow the steps mentioned in this link.  https://anil.io/post/92/apache-nutch-2-2-mysql-and-solr-5-2-1-tutorial In the process of trying to make things work, you may come across the following issues. I have provided solution for each below 1) Don't ignore this step [STEP 2 in the link above] export JAVA_HOME = "$(/usr/libexec/java_home -v 1.8)" export NUTCH_JAVA_HOME = "$(/usr/libexec/java_home -v 1.8)" 2) Issue when creating the database nutch in MySQL. [STEP 3. 2 in the li...

Search strings from a list using Radix Tree

A logic to build a Radix tree (not completely though..) to search a string from a list of strings. Ideally the radix tree should be built something like this , but the logic below constructs a node for every character in the string. using System ; using System.Collections.Generic ; using System.Linq ; using System.Text ; using System.Threading.Tasks ; namespace RadixTree { class Program { public class Node { public char _Character; public List<Node> _Children = new List<Node>(); } private static List<Node> traversedNodes = new List<Node>(); private static bool stopTraversing = false ; private static string wordString = "" ; private static string mainString = "" ; private static string [] searchStrings = new string [] { "Chicago" , ...

Ionic app for Windows 8.1, Windows 10 and Windows Phone

If you like me have bumped into crazy issues like the ones mentioned below when attempting to build an Ionic app for Windows 8.1/ 10 and Windows Phone, then the following tips will definitely help you. Adding the windows platform ionic platform add windows Note: ionic platform add wp8 is deprecated, but you can test this on windows 8.0 at your own risk. Inside the platform/windows folder you will see a solution named CordovaApp. Open this and you will see three projects CordovaApp.Phone CordovaApp.Windows CordovaApp.Windows10 You can either choose to open the main solution containing all the three projects i.e CordovaApp or open each individually for a particular platform.  Note: I have used Visual Studio Community Edition 2015 and tested on both Windows 8.1 and Windows 10. Now the interesting bit. When you build the project, you will see any or all of the below mentioned issues 1) A broken reference to Win JS "Could not find SDK Win JS 2.x.......

iOS Linking errors - missing required architecture i386

If you have ever faced issues similar to the one below ld: warning: ignoring file ../lib/iPhone/xxxxx.a, missing required architecture i386 in file ../lib/iPhone/xxx.a (3 slices) Undefined symbols for architecture i386:   "_OBJC_CLASS_$xxxxxx", referenced from:       objc-class-ref in ViewController.o   "_OBJC_CLASS_$xxxxxx", referenced from: then most probably your project is set to test in a simulator. Change this to device, Command + B and magic!  Remember, never ignore the warnings and always read it completely. In this case, Xcode ignored linking the xxx.a file in the iPhone directory due to compatibility issues. I spent couple of hours on this one. Arrrrghhhh!

When Rackspace is down

Image
Neat!!!

SSH on Mac keeps asking for the private key password

If you have come here because of a dialog that keeps showing up each time you attempt to ssh on mac with or without a passphrase, maybe this will help you. Issue: I generated a public / private key without a passphrase using the putty key gen on windows. Copied id_rsa.pub and id_rsa.ppk to ~/.ssh directory on my Mac Ran the below command ssh -i id_rsa.ppk xxx@xx.xx.xx.xx I kept getting the dialog asking for the password. After three attempts, it would terminate with a permission denied error. Failed attempts: Attempt 1: Renamed id_rsa.ppk to id_rsa Ran the below commands chmod 600 id_rsa ssh -i id_rsa xxx@xx.xx.xx.xx Attempt 2: Renamed id_rsa.ppk to id_rsa Ran the below commands chmod 600 id_rsa sudo ssh -i id_rsa xxx@xx.xx.xx.xx and more... Successful attempts: Download puttygen.exe Import (Conversions -> Import Key) the private key id_rsa.ppk Click Conversions -> Export OpenSSH Key Save as id_rsa.pem Copy id_rsa.pem to ~/.ssh. You sho...

NSArray, NSNumber, NSValue... What is 'NS'? What is 'IB'?

In Objective-C, NS stands for NeXTSTEP , the platform for which these classes of the Foundation Framework were originally designed. While it helps, but I like it when it is Number instead of NSNumber , and Array instead of NSArray .  Similarly, IB in IBOutlet and IBAction stands for Interface Builder which is the tool used for designing the user interface of your apps. The interface builder file has the extension .xib (originally .nib) NeXTStep was an object oriented operating system based on UNIX. Remember the story of Steve Jobs getting sacked from Apple, and then founding NeXT and then folks in Apple begging him to come back? Just makes you wonder how amazing Steve was. Something developed in the 1980s to 1990s becomes the building block for most of the apps built on iOS and OSX today. Simply brilliant!

Sentinel Value

In computer  programming , a  sentinel  value (also referred to as a flag value, trip value, rogue value, signal value, or dummy data) is a special value in the context of an algorithm which uses its presence as a condition of termination, typically in a loop or recursive algorithm. More info on the same here  https://en.wikipedia.org/wiki/Sentinel_value In Objective-C it looks something like this where 'nil' is the sentinel. NSArray *arrayElements = [ NSArray arrayWithObjects : @"One" , @"Two" , @"Three" , @"Four" , nil ];

JackOfAllThreads - First attempt

Image
My first attempt at JackOfAllThreads I know this blog is not for this.. but hey! a little marketing for my campaign does not hurt. You like it? You can buy it by clicking on the link below. http://jackofallthreads.co/Look-at-me

CISC vs RISC

Image
One of the best explanations on these two architectures.

Visual studio code

It would be nice to have visual studio on OSX too.. so here it is. https://code.visualstudio.com/  

Objective C on windows. OMG!!

So much to compile and run Objective C on windows?? http://www.gnustep.org/windows/installer.html But if you still want to go ahead then.. http://sweettutos.com/2012/08/11/objective-c-on-windows-yes-you-can/