Python Tools for Visual Studio extension (PTVS)

A great tool!

PTVS is a free, open source plugin that turns Visual Studio into a Python IDE. 

PTVS supports CPython, IronPython, editing, browsing, Intellisense, mixed Python/C++ debugging, remote linux/MacOS debugging, profiling, IPython, Django, and cloud computing with client libraries for Windows, Linux and MacOS.  

Designed, developed, and supported by Microsoft and the community.

https://pytools.codeplex.com/

Quick Guide to Vim Editor

Here is a quick guide to learn and use the Vim editor.

Basically, you always switch between two modes in Vim, which are command mode and insert mode.
In command mode, you move around the file, delete text, or execute other commands.
In insert mode, you insert and edit text.

During start, Vim is always at command mode.
To change from command mode to insert mode, press i/I/a/A/o/O (refer table below).
To change from insert mode to command mode, press Esc (escape key).

Insert mode

To enter insert mode, use any of the following commands.

How to Copy and Paste in PuTTY

What is PuTTY? PuTTY is a client program for the SSH, Telnet and Rlogin network protocols. Typically, you use it to remotely access a Linux server from your Windows machine. You can also use it to open serial ports (aka COM ports) and TCP/IP raw sockets.

A problem that often troubles the user is how do you copy and paste from the PuTTY terminal. So here are the tips.

Wireframing Tool - Cacoo

Wireframing is an important step in website or app design process. It allows you to plan the layout of content, without being distracted by colors, typeface choices or even copy.

Cacoo is a user friendly online drawing tool that allows you to create a variety of diagrams such as site maps, wireframes, UML and network charts. Register for free here.

Installing PHP FastCGI and Zend OPcache on XAMPP for Windows

Why install PHP + FastCGI?

Mod-PHP comes installed with XAMPP, and it is slow.

You also cannot utilise the Zend opcode cache, which is included with PHP itself since PHP 5.5.
 

Installing PHP FastCGI and Zend OPcache on WampServer

Why install PHP + FastCGI?

Mod-PHP comes installed with WampServer, and it is slow.

You also cannot utilise the Zend opcode cache, which is included with PHP itself since PHP 5.5.
 

Compiling python source code into byte-code

Normally, when a python module is imported, python automatically generate a .pyc file containing the compiled byte code. The next time the same program is run, the compilation step can thus be skipped.

However, in order to manually pre-compile the python modules even before running them, here are two ways of doing it:

  1. Use a python script.

    To compile a single file / module, use the py_compile module.

    import py_compile
    if __name__ == "__main__":
      py_compile.compile('abc.py')

     

Installing Django on Windows

Django is a Python web framework which allows rapid development of website by following the Model-View-Controller architecture.

To install Django, definitely you need to have python installed first. If you haven't, download it from the official website here.

Migrating from TortoiseSvn to TortoiseHg

SVN is the centralized repository system that many developers should have been familiar with. Mercurial (Hg) is one of the latest distributed repository system that is gaining popularity, besides Bazaar and Git. TortoiseSVN and TortoiseHg are GUI tools to manage SVN and Hg respectively in windows. That said, this note would apply mostly to windows users.

I would demonstrate two options to the migration but the outcomes might not be the same and I would detail the difference of each.

Command Line Tips & Tricks for Ubuntu Server

  1. Find out whether a package is installed or not.
    $ dpkg -s [package-name]
    $ dpkg -s apache2-mpm-worker
    $ dpkg -l apache*
  2. List files in a package which has been installed.
    $ dpkg -L [package-name]
    $ dpkg -L python-openssl
    
  3. Check the reason a package was installed, ie. find out the reverse dependencies of a package
    $ apt-cache rdepends --installed [package-name]
    $ apt-cache rdepends --installed nano
    

Pages