Category Archives: Programming

Use MySQL database in Python

PyMySQL its a pure python client library, you can install using pip install PyMySQL (find documentation at https://pymysql.readthedocs.io/en/latest/). The following is a simple example to demonstrate how to use the library. #!/usr/bin/env python from __future__ import print_function import pymysql conn … Continue reading

Share
Posted in MySQL, Python | Tagged , , | Leave a comment

Use python to create PowerPoint slides automatically

I have a large number of images. I want to organize them in powerpoint files by automatically insert each picture to a new powerpoint slide and control it’s position and size. I came across a nice Python library – python-pptx … Continue reading

Share
Posted in Python | Tagged , , , , | Leave a comment

Python development environment

I productive python development environment is important when you want to use Python to develop applications. Download the right version of Python from https://www.python.org/ and install it. For example, I downloaded macOS version Python 3.6 and installed it to the machine. … Continue reading

Share
Posted in Python | Tagged , , , , | Leave a comment

Dealing with Date in R language

In R there is a class called Date. If we want to get the components of a date variable or date string, we can use the following function to do it. toNumerics <- function(Date) { stopifnot(inherits(Date, c(“Date”, “POSIXt”))) day <- … Continue reading

Share
Posted in R, R/S-Plus | Leave a comment

Removing the password of an Excel VBA project

‘ to remove the password of a excel with .xlam extension ‘ 1. use the Savexlam2xls subroutine to save a copy of xlam file to xls file ‘ 2. run the moveprotect subroutine to remove the password of the xls … Continue reading

Share
Posted in Excel, VBA/ASP | Tagged , , , | Leave a comment