Android Studio Error on First Run (Windows)


After installing Android Studio on my new laptop and then running it for the first time, it throw a dialog box detailing error messages, a quick search on Google point me to this link Issue 172032: Android Studio Start failed with internal error and the “temporary solution” is simple, just edit idea.properties file located in

C:\Program Files\Android\Android Studio\bin\

then add this text

disable.android.first.run=true

and save, then try to relaunch Android Studio, it works like a charm :)

Note: editing idea.properties file required Administrator privileges so you maybe need to launch your editor as Administrator

Python – PyODBC – Microsoft Access : Simple script


Here’s a simple python script showing how to access MDB (Microsoft Access) database

import os
import pyodbc

dataFile = "Northwind.mdb"
databaseFile  = os.getcwd() + "\\" + dataFile
connectionString = "Driver={Microsoft Access Driver (*.mdb, *.accdb)};Dbq=%s" % databaseFile
dbConnection   = pyodbc.connect(connectionString)
cursor = dbConnection.cursor()
cursor.execute("select top 5 * from Suppliers")
rows = cursor.fetchall()
for row in rows:
    print row.CompanyName

take a look at the script below to get column names, column type and width

import os
import pyodbc

dataFile = "Northwind.mdb"
databaseFile  = os.getcwd() + "\\" + dataFile
connectionString = "Driver={Microsoft Access Driver (*.mdb, *.accdb)};Dbq=%s" % databaseFile
dbConnection   = pyodbc.connect(connectionString)
cursor = dbConnection.cursor()

for row in cursor.columns(table='Suppliers'):
    print "Field name: " + str(row.column_name)
    print "Type: " + str(row.type_name)
    print "Width: " + str(row.column_size)

Casperjs – Couldn’t find nor compute phantom.casperPath, exiting


I just installed phantomjs v2.0 on a Windows box, add its location to its path, download casperjs v1.0.4, extract to root folder on C: drive, rename the folder to casperjs, add casperjs\batchbin to its path (not casperjs\bin as suggested in its documentation), invoking casperjs –version on the command line, but then getting this error message

Couldn’t find nor compute phantom.casperPath, exiting

googling for a minutes, I got the solution here https://github.com/n1k0/casperjs/issues/1150

just add these 4 lines code into casperjs\bin\bootstrap.js file


var system = require('system');
var argsdeprecated = system.args;
argsdeprecated.shift();
phantom.args = argsdeprecated;

Adminer – Set Number of Rows to Display


I’ve ever wrote how to set this on PhpMyAdmin, now I want to do it on Adminer. I want Adminer to show 200 records when I select a table. I’ve try it using Adminer v4.1.0 and v4.2.0 both for MySQL english only.

I just search the string “selectLimitProcess(){” with no quote off course and then replace its default number from 50 to 200, you can use any number you want.