Wednesday 31 August 2011

Installing dojo

wget http://download.dojotoolkit.org/release-1.6.1/dojo-release-1.6.1-src.tar.gz
tar zxvf dojo-release-1.6.1-src.tar.gz
rm *.gz
stackoverflow

This very naive approach results in ...
59 requests


 489.4 KB
(12.1 KB from cache) 42.32s (onload: 42.44s)


Compared with ~12sec from the CDN

Tuesday 23 August 2011

login

review login forms

This the dojo 1.6 answer. Updated forum

Tried connect-dojo did not work for me. need to get dojo build working.

Wednesday 17 August 2011

now.js

Will look at this

Looking at this color palette for app.

Updated all modules with
npm update
. Needed to install ejs after this. Has been unbundled?

Wednesday 10 August 2011

xslt

Found this project for xslt on Node https://github.com/bahblah/node_xslt. . Looks like what I need...
Installing the dependencies on the nas..
velvet:~# apt-get install libxml2
Reading package lists... Done
Building dependency tree... Done
Recommended packages:
  xml-core
The following packages will be upgraded:
  libxml2
1 upgraded, 0 newly installed, 0 to remove and 40 not upgraded.
Need to get 757kB of archives.
After unpacking 36.9kB of additional disk space will be used.
Get:1 http://archive.debian.org etch/main libxml2 2.6.27.dfsg-6+etch1 [757kB]
Fetched 757kB in 2s (298kB/s)
debconf: delaying package configuration, since apt-utils is not installed
(Reading database ... 24801 files and directories currently installed.)
Preparing to replace libxml2 2.6.27.dfsg-6 (using .../libxml2_2.6.27.dfsg-6+etch1_i386.deb) ...
Unpacking replacement libxml2 ...
Setting up libxml2 (2.6.27.dfsg-6+etch1) ...
libxslt was not found by apt-get, but this worked
velvet:~# apt-get install xsltproc
...
velvet:~# xsltproc -V
Using libxml 20627, libxslt 10124 and libexslt 813
xsltproc was compiled against libxml 20627, libxslt 10119 and libexslt 813
libxslt 10124 was compiled against libxml 20627
libexslt 813 was compiled against libxml 20627

More work required as
velvet:~/faye# npm install node_xslt

> node_xslt@0.1.0 preinstall /root/faye/node_modules/node_xslt
> node-waf clean || true; node-waf configure build

Cleaning nothing...
'clean' finished successfully (0.000s)
Checking for program g++ or c++          : /usr/bin/g++
Checking for program cpp                 : /usr/bin/cpp
Checking for program ar                  : /usr/bin/ar
Checking for program ranlib              : /usr/bin/ranlib
Checking for g++                         : ok
Checking for node path                   : not found
Checking for node prefix                 : ok /root/local/node
Checking for library ['xml2', 'xslt']    : not found
/root/faye/node_modules/node_xslt/wscript:13: error: the configuration failed (see '/root/faye/node_modules/node_xslt/build/config.log')
npm ERR! error installing node_xslt@0.1.0 Error: node_xslt@0.1.0 preinstall: `node-waf clean || true; node-waf configure build`
npm ERR! error installing node_xslt@0.1.0 `sh "-c" "node-waf clean || true; node-waf configure build"` failed with 1
npm ERR! error installing node_xslt@0.1.0     at ChildProcess. (/root/local/node/lib/node_modules/npm/lib/utils/exec.js:49:20)
npm ERR! error installing node_xslt@0.1.0     at ChildProcess.emit (events.js:67:17)
npm ERR! error installing node_xslt@0.1.0     at ChildProcess.onexit (child_process.js:192:12)
npm ERR! node_xslt@0.1.0 preinstall: `node-waf clean || true; node-waf configure build`
npm ERR! `sh "-c" "node-waf clean || true; node-waf configure build"` failed with 1
npm ERR!
npm ERR! Failed at the node_xslt@0.1.0 preinstall script.
npm ERR! This is most likely a problem with the node_xslt package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-waf clean || true; node-waf configure build
npm ERR! You can get their info via:
npm ERR!     npm owner ls node_xslt
npm ERR! There is likely additional logging output above.
npm ERR!
npm ERR! System Linux 2.6.37.6.RNx86_64.2.1
npm ERR! command "node" "/root/local/node/bin/npm" "install" "node_xslt"
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /root/faye/npm-debug.log
npm not ok
velvet:~/faye#
Tried
apt-get install libxml2-dev
more progress,after setting NODE_PATH and creating libxslt.so link
velvet:/usr/lib# ls -l libxslt*
lrwxrwxrwx 1 root root     17 2011-08-14 18:13 libxslt.so -> libxslt.so.1.1.24
lrwxrwxrwx 1 root root     17 2011-07-10 15:58 libxslt.so.1 -> libxslt.so.1.1.24
-rw-r--r-- 1 root root 208188 2011-01-25 01:17 libxslt.so.1.1.24
now trying to build from source
File "/root/bahblah-node_xslt-34c6509/wscript", line 19, in build
    obj.cxxflags = subprocess.check_output(["xml2-config", "--cflags"]).strip()
AttributeError: 'module' object has no attribute 'check_output'
Python2.7+ required, nas has 2.6.6, trying this get a bit further.
a=subprocess.Popen(['xml2-config', '--cflags'], stdout=subprocess.PIPE).comm
    obj.cxxflags = a.strip()
    obj.lib = ['xml2', 'xslt']
    obj.libpath = ['/usr/lib']

velvet:~/bahblah-node_xslt-34c6509# node-waf configure build
Checking for program g++ or c++          : /usr/bin/g++
Checking for program cpp                 : /usr/bin/cpp
Checking for program ar                  : /usr/bin/ar
Checking for program ranlib              : /usr/bin/ranlib
Checking for g++                         : ok
Checking for node path                   : ok /root/local/node
Checking for node prefix                 : ok /root/local/node
Checking for library ['xml2', 'xslt']    : yes
'configure' finished successfully (0.260s)
Waf: Entering directory `/root/bahblah-node_xslt-34c6509/build'
[1/2] cxx: node_xslt.cc -> build/default/node_xslt_1.o
../node_xslt.cc:3:26: error: libxslt/xslt.h: No such file or directory
../node_xslt.cc:4:35: error: libxslt/xsltInternals.h: No such file or directory
../node_xslt.cc:5:31: error: libxslt/transform.h: No such file or directory
../node_xslt.cc:6:31: error: libxslt/xsltutils.h: No such file or directory
../node_xslt.cc: In function âvoid jsXmlDocCleanup(v8::Persistent, void*)â:
../node_xslt.cc:19: error: âxmlDocPtrâ was not declared in this scope
../node_xslt.cc:19: error: expected `;' before âdocâ
../node_xslt.cc:20: error: âdocâ was not declared in this scope
../node_xslt.cc:20: error: âxmlFreeDocâ was not declared in this scope
../node_xslt.cc: In function âvoid jsXsltStylesheetCleanup(v8::Persistent, void*)â:
../node_xslt.cc:27: error: âxsltStylesheetPtrâ was not declared in this scope
../node_xslt.cc:27: error: expected `;' before âstyleâ
../node_xslt.cc:28: error: âstyleâ was not declared in this scope
../node_xslt.cc:28: error: âxsltFreeStylesheetâ was not declared in this scope
../node_xslt.cc: At global scope:
../node_xslt.cc:32: error: âxmlDocPtrâ was not declared in this scope
../node_xslt.cc:32: error: expected â,â or â;â before â{â token
../node_xslt.cc:38: error: âxsltStylesheetPtrâ was not declared in this scope
../node_xslt.cc:38: error: expected â,â or â;â before â{â token
../node_xslt.cc: In function âv8::Handle readXmlString(const v8::Arguments&)â:
../node_xslt.cc:48: error: âxmlDocPtrâ was not declared in this scope
../node_xslt.cc:48: error: expected `;' before âdocâ
../node_xslt.cc:49: error: âdocâ was not declared in this scope
../node_xslt.cc:52: error: âdocâ was not declared in this scope
../node_xslt.cc: In function âv8::Handle readXsltString(const v8::Arguments&)â:
../node_xslt.cc:59: error: âxmlDocPtrâ was not declared in this scope
../node_xslt.cc:59: error: expected `;' before âdocâ
../node_xslt.cc:60: error: âdocâ was not declared in this scope
../node_xslt.cc:63: error: âxmlFreeDocâ was not declared in this scope
../node_xslt.cc:63: error: âdocâ was not declared in this scope
../node_xslt.cc:65: error: âxsltStylesheetPtrâ was not declared in this scope
../node_xslt.cc:65: error: expected `;' before âstylesheetâ
../node_xslt.cc:66: error: âstylesheetâ was not declared in this scope
../node_xslt.cc:70: error: âstylesheetâ was not declared in this scope
../node_xslt.cc: In function âv8::Handle transform(const v8::Arguments&)â:
../node_xslt.cc:86: error: âxsltStylesheetPtrâ was not declared in this scope
../node_xslt.cc:86: error: expected `;' before âstylesheetâ
../node_xslt.cc:87: error: âxmlDocPtrâ was not declared in this scope
../node_xslt.cc:87: error: expected `;' before âdocumentâ
../node_xslt.cc:112: error: expected `;' before âresultâ
../node_xslt.cc:113: error: âresultâ was not declared in this scope
../node_xslt.cc:116: error: âxmlFreeDocâ was not declared in this scope
../node_xslt.cc:116: error: âresultâ was not declared in this scope
../node_xslt.cc:118: error: âxmlCharâ was not declared in this scope
../node_xslt.cc:118: error: âdoc_ptrâ was not declared in this scope
../node_xslt.cc:120: error: âstylesheetâ was not declared in this scope
../node_xslt.cc:120: error: âxsltSaveResultToStringâ was not declared in this scope
../node_xslt.cc:121: error: âxmlFreeâ was not declared in this scope
Waf: Leaving directory `/root/bahblah-node_xslt-34c6509/build'
Build failed:  -> task failed (err #1):
        {task: cxx node_xslt.cc -> node_xslt_1.o}
velvet:~/bahblah-node_xslt-34c6509#

Guess missing libxslt-dev
velvet:/usr/include# sudo apt-get install libxslt-dev
Reading package lists... Done
Building dependency tree... Done
Note, selecting libxslt1-dev instead of libxslt-dev
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.

Since you only requested a single operation it is extremely likely that
the package is simply not installable and a bug report against
that package should be filed.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
  libxslt1-dev: Depends: libxslt1.1 (= 1.1.19-3) but 1.1.24-2 is to be installed
E: Broken packages

Asked on forum

Monday 8 August 2011

graphviz

Having problems with node and graphviz 2.8, dot parser which uses gvpr fails
 xOut = tolower(<<<
 -- syntax error
Will try backport

Wednesday 3 August 2011

hookbox to faye

Currently:
chataws.php+ hookchat.js:
  1. checks session for username
  2.  subscribes to topic chat
  3. handles onPublish  and for presence: onSubscribe onUnsubscribe 
faye auth, another here

file upload module node-formidable, full tutorial here.
connect tutorial here 
role based auth 
dojo widget tutorial 
looking at template engine ejs