Skip to main content

Posts

Solve an error when migrating Mysql tables

We may copy the files under /var/lib/mysql when migrating Mysql tables. But we may get following erros in mysql client: mysql> select * from test; ERROR 1017 (HY000): Can't find file: './testdb/test.frm' (errno: 13) This is the issue of permission, you need to: sudo chown -R mysql.mysql /var/server/mysql/testdb/

pygapbide -- Python implementation of Gap-Bide algorithm

I have implemented a python version of the Gap-Bide algorithm according to  Efficiently Mining Closed Subsequences with Gap Constraints  . The algorithm is to mine a set of gap-constrained patterns from a set of sequence. The source code is release at  http://code.google.com/p/pygapbide/  , under MIT License . Note the code has been migrated to github, at https://github.com/socrateslee/pygapbide .

test youtube html5 embed video

<p><br /> </p>

Some ssh tricks

1 ssh log on without password 1) in localhost, ssh-key-gen 2) in localhost, ssh-copy_id username@remotehost 2 remove entries from known_hosts you may get the error like the following message, if remotehost change it's ip address: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ ... Add correct host key in /home/username/.ssh/known_hosts to get rid of this message. Offending key in /home/username/.ssh/known_hosts:$line_number$ ... To solve this, you may 1) edit ~/.ssh/known_hosts 2) remove line $line_number$

Some svn tricks

1.Sovle checksum mismatch when update   When performing "svn up test.h", you may get error:   svn: Checksum mismatch for …   To solve the issue, you may want to backup files mentioned below, and perform following actions:   1) vi .svn/entries, find and delete content like  ^L test.c file 712 2010-10-24T09:39:39.000000Z d41d8cd98f00b204e9800998ecf8427e 2008-10-21T19:51:09.435185Z 3 foo 0 ^L 2) delete related files in .svn/text-base/(e.g., test.c.svn-base) 3) delete related files in .svn/tmp/text-base/   4) delete test.c 5) svn up test.c

The "hello world" for celery

This is a simple "hello world" case for python based task queue celery on ubuntu 9.10. Install sudo apt-get install rabbitmq-server sudo easy_install celery In celerytest directory: Create celeryconfig.py: BROKER_HOST = "localhost" BROKER_PORT = 5672 BROKER_USER = "guest" BROKER_PASSWORD = "guest" BROKER_VHOST = "/" CELERY_RESULT_BACKEND = "amqp" import os import sys sys.path.append(os.getcwd()) CELERY_IMPORTS = ("tasks", ) Create tasks.py: from celery.decorators import task @task def add(x, y):     return x + y Start celery worker: celeryd Excute the program: python -c "from tasks import *;r=add.delay(3,5);print r.wait()"