Wednesday, November 19, 2014

PyCharm: Unresolved reference 'print'

PyCharm can sometimes get confused specially if you have multiple interpreters and using virtualenv. To fix "Unresolved reference 'print'" message, do File | Setting... (Ctrl+Alt+S) | Project Interpreter | Show All (drop down) | Show path for the selected interpreter () | Reload List of Paths ().


Sunday, November 16, 2014

Installing Pyro 4.30 in IronPython 2.7.4

This assumes that IronPython is installed in D:\ipy.
  1. Download Serpent archive file - used 1.7 (link). Serpent is needed by Pyro 4.
  2. Extract to a folder, say D:\Serpent.
  3. Change directory to where Serpent was extracted then do D:\Serpent>D:\ipy\ipy.exe install. This will install Serpent.
  4. Download Pyro 4 tar archive (link).
  5. Extra to a folder, say D:\Pyro4.
  6. Change directory to where Pyro4 was extracted then do D:\Pyro4>D:\ipy\ipy.exe install.

Tuesday, November 11, 2014

Change network category in Windows 8.1

Windows 8.x network category or network profile affects how other Windows machines detects or discover the node. A machine on  a domain or private network will most of the time allow file sharing and printing, more relaxed firewall, etc.

For computers with multiple network interfaces changing network profile can be difficult using the GUI. To force a network interface to be in private profile for example you can do:

PS c:\> Set-NetConnectionProfile -InterfaceAlias "VirtualBox Host-Only Network" -NetworkCategory Private

"Virtual Host-Only Network" - is the name associated with the network interface
"Private" - is the profile


Saturday, November 08, 2014

Going fallback mode in Ubuntu 13.04 due to performance issues with Unity

I configured Virtualbox guest machine to run Ubuntu 13.04 (Raring Ringtail) but performance is just not acceptable. It probably has to do with my host machine not having a good enough graphics hardware.

Anyway, to make it bearable, I have gone Gnome Fallback mode. Anyway, below is my clean configuration from scratch to have a better performance running under VirtualBox.

Initial clean-up and pre-requisites, open terminal (Ctrl+Alt+T):
$: sudo apt-get update
$: sudo apt-get upgrade
$: sudo apt-get install gnome-session-fallback

Log out from session
$: gnome-session-quit
From the GDM, select Gnome Fallback(No effects), see below for screen capture.

Log back in to Ubuntu. To make it even better, install VirtualBox guest additions. But first let us install the pre-requisites and some clean-up.
$: apt-get purge xserver-xorg-video-vmware libxatracker1
$: apt-get install dkms build-essential

From VirtualBox Guest main UI, select Devices | Install Guest Additions....Hit on cancel for the window like below.
Now, install guest additions, like:
$: cd /media/timus/VBOXADDITIONS_4.2.12_84980
$: sudo ./ 
$: sudo reboot

Of course you have to change folder location (with your username) and version based on your VirtualBox. After reboot, you have pretty good setup for daily use.

This applies to 13.10, 14.04, 14.10.

Tuesday, November 04, 2014

"console: Failed to install '': java.nio.charset.UnsupportedCharsetException: cp0" message when opening a PyDev console

When opening a PyDev console using Jython 2.7b3, I am getting the following error message.

console: Failed to install '': java.nio.charset.UnsupportedCharsetException: cp0

This does not show up in Jython 2.5. Note that this was already reported elsewhere, like:

To workaround this issue, add -Dpython.console.encoding=UTF-8 in PyDev configuration, see below for details.

Sunday, November 02, 2014

Drop database in SQL Server using sqlcmd

c:\> sqlcmd -S .\Db_INSTANCE -Q "DROP DATABASE dbname"
Db_INSTANCE is the name of SQL Server instance
dbname is the name of the database to drop


Creating a new SQL Server instance in SQL 2005 Express

This may apply to other SQL Server 2005 products but since I haven't not tried them myself, I can't definitely say that this is the case. Anyway, on default SQL Server 2005 Express install it will create one sql server instance named "SQLEXPRESS." For most occasions this should do just fine but in some cases a named/new instance is necessary to partition/compartmentalize the development of an application.

Creating a new sql server instance is actually very easy. To create a new instance, do the following:
a) Secure a copy of SQL 2005 Express installation media.
b) Run setup.exe.
c) Accept license agreement. After accepting the agreement, the installation program will perform various other checks like disk space available... etc.
d) "Welcome to the Microsoft SQL Server Installation Wizard" just lazily hit on "Next" button.
e) In System Configuration Check screen, if the reports are okay then proceed, hit on "Next" button again.
f) For the Registration Information screen, supply necessary information. Now this is very important, ensure that "Hide Advanced Configuration Options" is unchecked.
g) Accept the default selection for "Feature Selection" screen and hit on "Next."
h) In "Instance Name" screen provide the sql server instance name you would like to use. Then just follow and use the default for next screens and off you go, you got new SQL Server instance.

Or you can also supply instance name in command line when running setup.exe, i.e.:
C:\SQLServer2005Express>setup.exe INSTANCENAME=NEW_DB_INSTANCE
Then accept the defaults.