Python: sys.path

path to module
import sys
sys.path

MySQL change root password

 

Install MySQLdb for Python

Download and install MySQL package installer
Download MySQLdb mysql-python (1.2.3)
Install MySQLdb 
    ARCHFLAGS='-arch x86_64' python setup.py build
    ARCHFLAGS='-arch x86_64' python setup.py install

Python & command line

ตัวอย่างคำสั่งการ Import แบบ command line โดยที่ยังไม่ต้องเข้าไปที่ shell ของ python
python -c "import MySQLdb"

Install MySQL on Mac OS X

Download MySQL Community Server
http://www.mysql.com/downloads/mysql/
File name: mysql-5.5.9-osx10.6-x86_64.dmg
เปิดไฟล์ Image (.dmg) จากนั้นทำการติดตั้ง ดังนี้
1. Install mysql-5.5.9-osx10.6-x86_64.pkg 
2. Install MySQLStartupItem.pkg
3. double click MySQL.prefPane
 
 
alias mysql=/usr/local/mysql/bin/mysql
alias mysqladmin=/usr/local/mysql/bin/mysqladmin
 

How to Turn Your Mac Into a Web Server

Enable Web Server
    goto System Preferences > Internet & Wireless > Sharing
    on left side, check on Web Sharing
Enable php module
    cd /private/etc/apache2
    sudo nano httpd.conf
    uncomment this line
    #LoadModule php5_module        libexec/apache2/libphp5.so
 

Python: converting datetime to POSIX time

Python: converting datetime to POSIX time

import time, datetime

d = datetime.datetime.now()
print time.mktime(d.timetuple())

 

Python: converting POSIX time to datetime

import datetime

datetime.datetime.fromtimestamp(1299030400)

วิธีการแก้ไข Install ActiveX Control ไม่ได้

 กรณี install activex control แล้วขึ้นหน้าต่างมีข้อความว่า
 
Windows has blocked this software because it can’t verify the publisher.

Folx: download manager on Mac

 Folx: download manager on Mac

ปัญหาการใช้ XmlSerializer ใน Silverlight

ปัญหาการใช้ XmlSerializer ใน Silverlight 4
สาเหตุ: เกิด error message ดังนี้
 The type or namespace name 'XmlSerializer' could not be found (are you missing a using directive or an assembly reference?)
แก้ไข: ให้ไปเพิ่ม References ที่ชื่อว่า System.Xml.Serialization
ที่มา: forums.silverlight.net

Syndicate content