Friday, January 29, 2016

North Karnataka - The Rome of India - Part 3

In my previous post, I described what we saw at the historic city of Bijapur.

In this post, I will narrate what fun it was to see the beautiful caves of Badami Pattadakal and Aihole.

Day - 3 - Badami

We woke up early and decided to visit the famous cave temples of Badami since, it would be much easier to climb up during the early hours of the day.  There are 4 cave temples at Badami.

The idols and carvings are superb, it takes you back in the time when they were actually made.  So much effort would have been put to carve these beautiful sculptures out of rocky mountains.
Beautiful idols at Badami Cave Temples
Beautiful idols at Badami Cave Temples
Beautiful idols at Badami Cave Temples
 On the other side of the cave temples there is a beautiful lake.  On one edge of the lake you can see beautiful Shiva temple standing in all its glory.
Superb lake on the other side of Badami Cave Temples

Shiva Temple at the edge of the lake
Visiting the cave temples was an enchanting experience.  We then headed towards Pattadakal Temples.

Pattadakal & Aihole

You got to see this to believe it, this temple complex has many ancient temples which are very well kept.  Services of a guide are highly recommended here.
Temple Complex at Pattadakal
There are many stories carved out into these temples.  Entire Ramayana and Mahabharata have been carved on some stones.
Ramayana carved on stone
After Pattadakal, we marched on and reached Aihole to see the famous horseshoe shaped Durga temple.
Horseshoe shaped Durga temple at Aihole
The places we covered today were simply mind blowing, each one had rich history behind them.  The fact that they are all in this great shape after so many centuries, is just amazing.

Finally at about 1930 hrs we reached our hotel near Hampi.  After yet another amazing day, we were all very excited to see what Hampi has to offer us the next day!


Wednesday, December 30, 2015

North Karnataka - The Rome of India - Part 2

In my previous post, I narrated how we started our trip to explore North Karnataka and visited Almatti Dam on our way towards Bijapur.

In this post, I will describe what we was at the historic city of Bijapur.

Day - 2 - Bijapur

It was fully packed eventful day ahead of us.  We started at about 1030 hrs and reached Gol Gumbaz.  There we got into conversation with local "horse cart - cab drivers".  They seemed to offer us a good deal,

  • They would take us to all the famous places in Bijapur in their horse cart 
  • Tell us a bit of history about these places.  
  • All this for some 800-1000 Rs.  
  • That sounded great because, I would not have to drive the big car in city traffic and look for parking all the time!
We almost instantly decided to take the deal and start off.  The first place we visited was the Bijapur Jama Masjid.  It was an humongous mosque where nearly 20000 people could offer prayers!  The building was beautiful and well maintained.

Jama Masjid - Bijapur
Next they took us to Jod Gumbaz, Ibrahim Roza, Malik-e-Maidan and Bara Kaman.  Ibrahim Roza was the crown jewel of all these places.  Its a beautiful monument built on a single rock bed, it is noted for the symmetry of its features. It is said that the design for the Ibrahim Roza served as an inspiration for that of the famous Taj Mahal.

Ibrahim Roza - Bijapur
Finally, they dropped us to Gol Gumbaz and we could hardly wait to see the biggest dome ever built in India, next in size only to St Peter's Basilica in Rome.

We hired a professional guide (highly recommended) to see this monument in detail.  He showed us the central chamber, where every sound is echoed seven times!  

Then he took us to the top of the monument to see the Whispering Gallery.  There are around 7 stories in this monument.  The cross ventilation (or whatever you want to call it) is so well designed that even at 45 C summer heat, the constant flow of cool breeze through the windows keeps you cool!

Once at top, we obviously wanted to witness and experience the Whispering Gallery.  Its said that even minute sounds can be heard clearly 37 meters away!  

The guide made us stand at one spot and he went and stood diagonally opposite (some 37 meters away) to where we were standing.  Amazingly, we could hear even the most minute sounds he was making at the other end - like lighting of a match stick!

Gol Gumbaz - Bijapur
All the monuments we saw at Bijapur where very well maintained.  By the time we finished visiting the Gol Gumbaz it was already 1500 hrs.  We decided to grab some quick lunch and then started our journey towards Badami.  We reached our hotel, had some nice dinner and crashed into bed.  Next morning we had to see the beautiful cave temples of Badami and much more!

In the next post, will describe what we saw at Badami. 

Monday, November 30, 2015

North Karnataka - The Rome of India - Part 1

It was Diwali of 2015 and we decided to take some time off and do 5 day road trip to North Karnataka.  Decided to visit these cities in particular Bijapur, Badami and Hampi.  I booked a nice and comfortable XUV W6 ZoomCar for this trip.

Before the trip, I had very low expectations from the places we were visiting.  I thought, mostly we will see almost destroyed and not well kept monuments.  But, was I in for a pleasant surprise!  The places were extremely well kept and monuments were beautiful and showing off their glorious past!

The route we had taken can be found here, round trip of around 1200 KM in 5 days and I was very much looking forward to have a nice time on the road!

Day - 1 - Bangalore to Bijapur

First day was mostly driving from Bangalore to Bjiapur, around 550 KM.  We started at about 0730 hrs, it was only 1630 hrs and we were only 70 KM away from Bijapur.  We took a slight detour and visited the Almatti Dam.  Its a beautiful dam with easy access to the dam's reservoir.  One could take a dip into clean dam waters and have some fun.  Were luck to see a beautiful sunset at the reservoir!




The dam also has a beautiful and super well kept garden with lots of fountain and lights and stuff.





Spent the evening there and we resumed our journey towards Bijapur.

It was Diwali day, all restaurants were closed by the time reached Bijapur - at about 2030.  We had tough time finding dinner, but eventually we did find one Restaurant who was ready to cook something for us.  It seems there is some tradition, all restaurants close their kitchens after the Diwali Puja is done - obviously I didn't know about it :P.

We crashed into the bed soon after dinner, next day was all jam packed and we were very much looking fwd for it!

In the next post, will describe what we saw at Bijapur.

Saturday, October 31, 2015

How to fix Cocos2.1 shader crash on iOS 9 - Part 2

In my previous post, I explained how to fix the open GL Shader related crash on iOS 9.  This crash was specifically occurring for apps using Cocos 2.1, the crash fix did work correctly on iOS8 and above.  But the fix had introduced another crash on iOS7 devices.  The crash report looked like this:

I investigated the issue for sometime and then I had my "duh!" moment.  The code that fixes the crash on iOS 9 used the method "containsString" of NSString class to find whether string A contains string B (on line no 18).

The method "containsString" was only introduced in iOS 8 hence, it was not available on devices running iOS 7 and below.  When the code tries to use that method it obviously crashes the app!

We changed the code to not use "containsString" and used "rangeOfString" instead.  This method was supported on iOS 7 as well.  The updated code looks like this:

Heres the fully updated code that works on all devices running iOS 7 and above.
Such a silly mistake this was!

Wednesday, September 30, 2015

How to fix Cocos2.1 shader crash on iOS 9

We have been using Cocos2D 2.1 for our game Monster Math.  Recently we decided to release an update to the game by compiling it against iOS 9.  To our surprise the game started crashing right at the launch with the following error.

A little investigation showed that it was crashing while creating OpenGL shaders.  A little googling proved that others were facing the same issue (more details here and here).

Whats the Fix - How Do They Do It! 

To fix the crash, I had to modify code in file CCGLProgram.m of Cocos2D and change the method compileShader as follows.

Once I made the change, the crash disappeared and it stared launching the game without any problems.

After this change we released an update of our game to AppStore.  We did however see a few crash reports around this very same issue from devices that were running iOS 7.

Will have to investigate further and fix it for iOS 7 devices as well.  Will keep you guys posted on what we did to fix it for iOS 7 devices, till then, have fun!

Monday, August 31, 2015

How to generate smaller snapshots when adding new articles to SQL Server replication

We had SQL Server transaction replication configured in our environment.  I wanted to add new articles to the publication.

To do this efficiently, I wanted to initialize only the new articles.  I wanted to avoid taking a full snapshot of all the existing articles all over again.

I googled around and found a pretty simple way in which this can be achieved.

How Do They Do It!

This can be achieved in four simple steps.

Add the new articles to the transaction replication setup

To add new articles to the publication either you can use the Management Studio interface or use the following script

Turn off "allow_anonymous" and "immediate_sync" properties on the publication

To take a smaller and faster snapshot this is the single most important step.  We need to disable "allow_anonymous" and "immediate_sync" properties of the publication.  To do this use the following script

Start the Snapshot agent

We need to start the snapshot from the replication monitor as follows


Once this agent completes you will notice that it has created a snapshot with only the newly added article.  This is super fast and saves disk space as well.  This is how it looks after the Snapshot agent has finished running.


Turn on "allow_anonymous" and "immediate_sync" properties on the publication

This is the last and final step which reverses the Step 2.  The script to do this is also exactly opposite of what we did in Step 2

For bigger databases it saves a hell lot of time.  I hope this saves you some time as it did for me!

Friday, July 31, 2015

Fastest way to parse XML in SQL Server

In one of my projects, we had a need to parse XML and populate a temporary table.  The stored procedure was supposed to be written in SQL Server.

As we know, there are multiple ways in which we could parse an XML in SQL Server, I wanted to use the one that performs fastest.

I looked around to see if I could find some sort of performance numbers for each of the method.  After a bit of googling, I found out a few places where there were bits and pieces of information which compared the different approaches.  Taking inspiration from this thread, I wrote a simple test which prints out the performance stats for parsing our XML using three different approaches.

The test SQL itself has nothing specific to our application,

  • It basically generates a very big XML so that we can have a decent comparison between three approaches.
  • It then parses this XML using different techniques
  • It uses following three approaches to parse the XML
    • OPENXML
    • The nodes() with text() 
    • The nodes() without text()
  • It then spits out the performance stats for each of the approach.

Here is the Sample test SQL file.
Sample Output
As you can see:

  • nodes() without text() was the slowest of all
  • Then came OPENXML
  • nodes() with text() was significantly faster than even the OPENXML.
Obviously, we decided to go with nodes() with text() approach.  Use the sample test SQL and find for yourself which one performs best for your requirement.  That's all folks!
Have some Fun!