Monday, 23 November 2015

let's think about it


Saturday, 1 August 2015

Deploy NodeJS application on Bluemix+Cloudfare


  1. Create a project on Github or Bitbucket
  2. Development on Cloud9
  3. Deploy application on Bluemix
  4. Configure Cloudfare

Thursday, 30 July 2015

Free web application solution


  • CVS
    • Github
    • Bitbucket
  • Development
    • Cloud9
    • Koding
  • Collaboration
    • Asana
  • Host
    • Openshift
    • Bluemix
  • CDN
    • Cloudfare

Friday, 1 May 2015

Uncaught UndefinedTemplateError: Cannot render the template since it is null or undefined.

define([
'marionette',
// 'templates',
    'underscore',
    'models/Itinerary'
], function (Marionette, templates, _,Model) {
'use strict';
template: templates.route_itinerary_item,


the 'templates' require has been comment out by accident.

Wednesday, 8 April 2015

Failed to retrieve user from session after authentication by passport



Note that enabling session support is entirely optional, though it is recommended for most applications. If enabled, be sure to use express.session() before passport.session() to ensure that the login session is restored in the correct order.

Thursday, 29 January 2015

I can ping ip, but failed to ping hostname on redhat linux


  1. check DNS server configuration to see if there is a record for the server.
  2. check /etc/resolv.conf file to see if the DNS server is correct, and if there is a domain, 
    • search <domainName> (if there is no this line, need to check /etc/sysconfig/network-script/ifcfg-eth0 to see if there is a "DOMAIN=<domain server ip>" existed
    • nameserver <ipaddress>

Thursday, 22 January 2015

How to use findByIdAndUpdate on mongdb2.4

backbone client update a model property:
ocase.save({ currentStep : theStep },callback);
server side mongoose code :
OCase.findByIdAndUpdate(req.params.id,
        req.body, callback);
it works fine on mongodb2.6, but it doesn't work on mongodb2.4, and the error is :
update err:MongoError: exception: Mod on _id not allowed
so I tried to remove "_id",and only save other attributes:
OCase.findByIdAndUpdate(req.params.id,
            {subject    : req.body.subject,
            description : req.body.description    
        },callback);
then I got another error :
update err:TypeError: Cannot read property '_id' of undefined
I am really confused, what can I do now?
Finally, I have to query(findById) the document first, and then call "save" method to update.
OCase.findById(req.params.id,
        function(err,ocase){
            ocase.set(req.body);
            ocase.save(function(err,ocase){
                res.send(ocase);

            });
        });

com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-206, SQLSTATE=42703, SQLERRMC=T0.TASK_MODE, DRIVER=3.65.77

com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-206, SQLSTATE=42703, SQLERRMC=T0.TASK_MODE, DRIVER=3.65.77

=-==============================
Column "T0.TASK_MODE" is not existed.