Sunday, May 17, 2015

xcode intellisense/autocomplete stopped working - How to bring it back?


While doing swift code in Xcode the intenseness suddenly stopped working. How do I bring it back?

Here are few things you can try -


  • Restart the Xcode - you may get lucky and it may start working
  • Next option - Start with Command + Shift + Key and clean the project
  • If its still not working, now we are going little detail, go to /Users/Library/Developer/Xcode/DerivedData
    • Find your project directory for which its broken, delete the content of the folder
    • Other way to do the same is from Xcode, go to Windows > Organize > Delete the Derived data
  • Delete the ModuleCache folder content from the 
    /Users/Library/Developer/Xcode/DerivedData and restart the Xcode, it should come up fine.
Good luck with the fix, let me know if it works or if I should add any additional technique to handle this.

Saturday, May 16, 2015

payment processing gateways and facilitator startups & business in India


Lately there has been buzz on the payment processor companies around the world, and so there so many companies trying to break into the market in India too. Its huge market, though not much regulated and still people rely on cash for most of their transactions/ at least small transactions. 

Here are some of the companies in the space. I'll try to update the list periodically.

Square type of -

ezetap - dongle
mobiswipe - dongle
prizmpayments - payment gateway, ATM
mosambee - dongle (in UAE as well)
aasaanpay - dongle
paypos - dongle
mswipe- dongle
swiftpay - dongle


Payment Gateways-

payU - payment gateway, popular
ebs - payment gateway, Axis bank collaboration, popular
CCAvenue - payment gateway, this one is most successful and most expensive
ZaakPay - payment gateway
DirectPay - payment gateway, times group payment service
payzippy - payment gateway, getting popular because of flipcart
citrus - payment gateway
atom - payment gateway
payumoney - payment gateway
transecute - payment gateway
epaymentglobal - payment gateway
fethr - new one
billdesk - not sure why this one is popular

There are few other services, but can't really understand their stand or competitive advantage over others.


The issues you can smell from the online comments and threads -

Dongle - 

1. Merchants don't have devices (cellphones which can accept the cash).
2. People carrying cash, also some merchant prefer cash.
3. Door to door service while setting it up and spread knowledge of the advantages, though if its executed sophistically, it sure has a good future. At the same time it requires proactive merchants who are willing to do technology way, which anyway going to be future. 

For the payment gateways 
- The integration takes at least 3 weeks, which is really bad. Unlike stripe its mostly a day or two.
- On top of none of them are transparent in terms of the charges. Lot of different charges and for someone to setup online store withpayment gateway is really tough. Thats why people rely on Shopify, which makes it little bit easy. even after integrating payU, its such an awful service you can read in the comments
- Here is some comparison between leading payment gateways, and some more (Its little older so some already been demised).
- Also banks like ICICI, HDFC and AXIS have their own gateways.
- The most common complain is none of them are responsive, if anything happens you cant reach the support and sometimes for months. 

Keyboard stopped working in xcode simulator

While doing some first time coding on xcode first time I run into an issue where suddenly my keyboard stopped working when select of text box. 

Why it happened?
Because first time when the textbox opened, you might have clicked on escape and what it will do is it connects the simulator keyboard to your hardware keyboard instead of simulator keyboard.

How to enable again?
For your simulator follow below steps:

iOS Simulator > Hardware > Keyboard

Uncheck "Connect Hardware Keyboard"

It will disconnect the hardware keyboard connection for the simulator. 

Sunday, December 28, 2014

Convert .dta file to .csv file

.dta is stata data file format, often you want to see the content with other more known tools like google spreadsheet or excel or any other open data format and you need to convert the file to csv format. Follow below steps to quick easy conversion.

Download python pandas if you already don't have it installed.


pip install pandas

Navigate to the folder where you have stored .dta file and follow below set of instruction to get csv out of it -

>>> import pandas as pd
>>> data = pd.io.stata.read_stata('sample.dta')
>>> data.to_csv('changed_to_csv.csv')

And you will get quick csv conversion of the dta file.

Tuesday, June 17, 2014

Setup New Relic with Webfaction Django App (Python setup)


New Relic is awesome Application Performance management tool. You can setup your application's health check in few easy steps -

Create a free account with New Relic. Here, below are the steps to setup your app's performance management on New Relic Dashboard :

- Get the licence key from newrelic


- install package on your server - pip install newrelic


- generate config file - newrelic-admin generate-config newrelic.ini
(It should generate newrelic.ini file)


- Add following lines in to .wsgi file (provide the full path of the newrelic.ini)
import newrelic.agent
newrelic.agent.initialize('/path/newrelic.ini')

- Restart the application

Within few minutes the you should be able to see the dashboard with different metrics. Also setup the web url of your application for the ping checker. In case of any issue with it, you will get real time notification. 


There are other tools like DataDog also used by so many companies. Both allows setup of different hosts and apps health check setup. I am also planning to setup celery and solr in new relic dashboard. I'll add setup steps for those as and when its done.

Tuesday, March 18, 2014

Use bitly python to shorten the url

We are using bitly to provide short url to users, which is little easy to look at visually and also (probably) motivate user to share instead of long long urls.  You might have seen those on while trying to tweet the link or share it on Facebook.

We are using Django for our web app, and getting short url from bitly while sending certain links in the email to user and provide it on the app to enable sharing.

- Get your code from bitly account, you can get it from settings > Advanced > Legacy API Key



- Install bitly-python-api - Its official api provided by bitly for python.

- Now in following quick steps you can get the short URL:

import bitly_api
con = bitly_api.Connection(
                    'myapp',
                    'R_12345....'
                )
shorten = con.shorten('https://myapp.com/abc/?item=55678')
shorten_url = shorten['url']
//output - https://bit.ly/xyz123

bitly_api takes care of underlying connection complexity, if you using any other platform you can find related packages and instruction over here - http://dev.bitly.com/code_libraries.html


Monday, March 10, 2014

Update Django on Webfaction

We are using webfaction for our Django Application, and its been really awesome service for the Django apps. Most of the things are configurable from their support dashboard.

Now you get to choose the Django and python version when you setup your application first time. However, later if you want to upgrade to newer version of the Django as it made available by Django community, you can follow below steps. In this example my current version of Django is 1.4.1 and I am going for Django 1.4.5.

Please note, following steps are just to update the Django version, if there are functional, API, Model query, settings or any other changes required inside your application, you will need to refer to Django official documentation or migration guide provided on the Django.

Here are the steps to upgrade Django in Webfaction -

1. Go to your App directory. 
> $HOME/webapps/

2. Get the version you want. (here we are extracting 1.4.5)
> wget https://www.djangoproject.com/download/1.4.5/tarball/

3. Extract.
> tar -zxvf Django-1.4.5.tar.gz

4. Rename the existing one. (existing django to django.old)
> mv lib/python2.7/django lib/python2.7/django.old

5. move the new one to lib (now as we have renamed, we can move the content from new django package to lib/python 2.7)
> cp -R Django-1.4.5/django lib/python2.7

6. move the management scripts (copy management script for wsgi, and app creation etc.)
> cp Django-1.4.5/django/bin/* bin
7. Restart and make sure it runs fine.
> apache2/bin/restart

8. delete the extract and tar (only after checking that it works fine, you can remove the floating folder and file from the directory.)
> rm -rf Django-1.4.5*

And that should do the trick! Feel free to drop message or email if you run into any issue.

Thanks.