Celery and Web.py

Programming No Comments »

Novadays i am working on celery and web.py. I wrote some python code to practice. You can reach on my github. Adress: https://github.com/askin/celery-webpy-examples.

I wrote readme file to installation and running. Also it is on github repository by i want to copy content in post.

Installation:

# Install RabbitMQ Server
sudo apt-get install rabbitmq-server

# Install Celery
sudo pip install celery

# Install webpy
sudo pip install web.py

Running:

# Run Web.py web services
cd webpy
python services.py

# Run Celery
cd celery
celeryd -I tasks

# run example codes
cd client
python client.py

# play with tasks function
cd celery
python
>>> from tasks import remoteAdd
>>> result = remoteAdd.delay(2, 2)
>>> result.get()
4
Tags : , , , , ,

Svn diff with different revisions

Programming No Comments »

svn diff -r 30:31

Tags : , ,

Delete all of tweets in an account

Internet No Comments »

If you want to delete all of tweets in an account, you can use twitwipe.com. It is tiny nice app for twitter.

Tags : , , ,

Some usefull irc command

Internet No Comments »

Release a nick name
/MSG nickserv release nickname password

Identify
/MSG nickserv identify nickname password

Change nickname
/NICK nickname

Join a channel
/JOIN #channel-name

Tags : ,

I’m back…

Uncategorized No Comments »

I return to you my dear blog 🙂
My vps adventure was very short.

Tags : ,

Create Class With C

Programming No Comments »

Commnents explain everythings.
Let’s fun..

/*
 * Create Class
 */
struct _myobject {
    // attributes
    int a, b;
    /*
     * Methed
     * Fonction pointer
     */
    int (*add)(struct _myobject*);
};

// get out struct prefix
typedef struct _myobject MyObject;

/*
 * Define Method
 * Get MyObject struct as a parameter
 */
int realAdd(MyObject* a) {
  return a->a + a->b;
}

// Constructer
MyObject* InitMyObject(int a, int b) {
    MyObject* obj = malloc(sizeof(MyObject));
    if(obj == NULL) {
        return NULL;
    } else {
        obj->a   = a;
        obj->b   = b;
        obj->add = realAdd;
    }
}

int main ( void ) {
    /*
     * Create Object
     */
    MyObject* mo = InitMyObject(1, 2);
    printf("A + B = %d\n", mo->add(mo));
    return 0;
}
Tags : , , , , , ,

Hello world!

Uncategorized No Comments »

This is really “Hello World”. This is my English blog. I write only in english.

Tags :