Posts

Chatbot application with React and Node

https://medium.com/p/setting-up-a-simple-client-server-chatbot-application-using-react-and-node-45b3c7bd5235

5 javascript oops!

https://medium.com/p/5-javascript-oops-9c4ecdcca781

.Net TripleDES encryption not matching in Javascript

https://medium.com/p/net-tripledes-encryption-not-matching-in-javascript-f8c7037f593a

Adding react native admob in your app

https://medium.com/p/adding-react-native-admob-in-your-app-c32f3be2de2d

Reading weights from a specific layer in Keras Model

Image
Follow my video below to know how to read weights for a specific layer in a Keras model. Link to the code sample is here . 

MySQL in Node.js

Image
You can follow my video below to connect to MySQL from Node.js Code sample here .

Finding the version of a python package

pip list | grep [package name]

Finding the location of all pip installed packages

We all agree that it is convenient to install packages using pip . But where do these packages get installed? Which directory? You can find this in many ways, but two of the quickest include using the inspect module or pip show . inspect module: import inspect from class import classname inspect(classname) The third line will give you the full path pip show: pip show [package name] will do the trick too.

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!