Tuesday, 15 September 2015

xsl fo - xsl-fo table - text align right - numbers not quite right-justified - a bit wonky -



xsl fo - xsl-fo table - text align right - numbers not quite right-justified - a bit wonky -

having bit of problem doing table numbers - seems right justification bit wonky.

when fo renders this, seems right justification of invoice number (ie 2311678) tiny bit left, , of vat number bit much right.

i had table positioned top right of page in test, , right border of vat number tiny bit left.

<xsl:template name="testlayout"> <fo:table width="59mm"> <fo:table-column column-width="23mm"/> <fo:table-column column-width="20mm"/> <fo:table-column column-width="25mm"/> <fo:table-body> <fo:table-row> <fo:table-cell number-columns-spanned="3"> <fo:block font-weight="bold">details</fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell> <fo:block>our ref:</fo:block> </fo:table-cell> <fo:table-cell number-columns-spanned="2"> <fo:block text-align="right"> e/2004/001234 </fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell> <fo:block>policy no:</fo:block> </fo:table-cell> <fo:table-cell number-columns-spanned="2"> <fo:block text-align="right"> gb0012345678 </fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell> <fo:block>invoice date:</fo:block> </fo:table-cell> <fo:table-cell number-columns-spanned="2"> <fo:block text-align="right"> 17th june, 2014 </fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell> <fo:block>invoice no:</fo:block> </fo:table-cell> <fo:table-cell number-columns-spanned="2"> <fo:block text-align="right"> 2311678 </fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell> <fo:block>due date:</fo:block> </fo:table-cell> <fo:table-cell number-columns-spanned="2"> <fo:block text-align="right"> 17th july, 2014 </fo:block> </fo:table-cell> </fo:table-row> <!-- vat details --> <fo:table-row> <fo:table-cell number-columns-spanned="2"> <fo:block>vat registration no:</fo:block> </fo:table-cell> <fo:table-cell text-align="right"> <fo:block>119 1699 59</fo:block> </fo:table-cell> </fo:table-row> </fo:table-body> </fo:table> </xsl:template>

xsl-fo

jquery - Receiving an AJAX response in Node.js local server -



jquery - Receiving an AJAX response in Node.js local server -

i succesfully posting ajax post request mongodb.

however cannot seem grasp how receive response. scoured info , got impression has same-origin policy when running local server.

i trying log code sent via ajax in console.

ps: finish beginner in node.js.

here code in users.js file

router.post('/adduser', function(req, res) { var db = req.db; db.collection('userlist').insert(req.body, function(err, result){ res.send( (err === null) ? { msg: '',code:'1234' } : { msg: err } ); }); });

and ajax phone call in global.js file

$.ajax({ type: 'post', data: newuser, url: '/users/adduser', datatype: 'json' }).done(function( response ) { // check successful (blank) response if (response.msg === '') { console.log(response.code); // clear form inputs $('#adduser fieldset input').val(''); // update table populatetable(); } else { // if goes wrong, alert error message our service returned alert('error: ' + response.msg); }

jquery ajax node.js mongodb

file sharing - Why does directory vanish when I do SSHFS? How to setup SSHFS share on Max OSX 10.9? -



file sharing - Why does directory vanish when I do SSHFS? How to setup SSHFS share on Max OSX 10.9? -

i'm running max osx 10.9.3 , i'm trying setup sshfs file-share between macbook pro , remote file system. however, when seek it, doesn't work.

strangely enough, makes target directory disappear. has else seen happen? bug?

first see can ssh target machine:

% ssh remoteuser@xxx.xxx.xxx.xxx # <--- ssh remote scheme works! see below. remoteuser@xxx.xxx.xxx.xxx % ls -altr remotedir total 8 drwxr-xr-x 26 remoteuser remoteuser 4096 jun 22 01:00 .. drwxrwxrwx 2 remoteuser remoteuser 4096 jun 22 01:08 . remoteuser@xxx.xxx.xxx.xxx % exit % # <--- logged out of remote scheme

next, create directory locally , verify created:

% pwd /mnt % ls total 0 drwxr-xr-x 31 root admin 1122 jun 18 18:34 ../ drwxr-xr-x 2 root admin 68 jun 23 08:11 ./ % sudo mkdir share1 % ls drwxr-xr-x 31 root admin 1122 jun 18 18:34 ../ drwxr-xr-x 4 root admin 136 jun 23 08:50 ./ drwxr-xr-x 2 root admin 68 jun 23 08:50 share/

now seek setup sshfs share:

% sudo sshfs remoteuser@xxx.xxx.xxx.xxx:remotedir /mnt/share1 remoteuser@xxx.xxx.xxx.xxx's password: %

ok. seems have worked. no errors. let's see share created, shall we?

% ls ls: share1: no such file or directory total 0 drwxr-xr-x 31 root admin 1122 jun 18 18:34 ../ drwxr-xr-x 3 root admin 102 jun 23 08:12 ./

what? not file sharing not working, share1 directory seems have vanished! (although file scheme seems know missing, weird).

where did /mnt/share1 go , how setup sshfs?

sshfs doesn't come os x afaik, should mention how installed it. i'm guessing sshfs designed used fstab or mount rather called directly. seek like:

mount -t sshfs remoteuser@xxx.xxx.xxx.xxx:remotedir /mnt/share1

osx file-sharing sshfs

doxywizard - Generate Source Code for specific file using Doxygen -



doxywizard - Generate Source Code for specific file using Doxygen -

setting source_browser = true show source code files.

is possible show source of specific file? or enable \ref or equivalent using source_browser = false or remove source code specifics files if source_browser = true or equivalent

it possible using \include , \verbinclude.

/** * \verbinclude example.cs * \include example.cs * */ public class illustration { }

doxygen doxywizard doxygen-wizard doxygen-addtogroup

google maps api v3 - waypoints not returned in response object -



google maps api v3 - waypoints not returned in response object -

this question exact duplicate of:

google maps route generation waypoints 1 reply

i have next code, send requestobj 1 waypoint. result show me path 2 legs , 0 waypoints. want maintain waypoints. doing wrong ?

var requestobj = { origin: new google.maps.latlng(sn['lat'],sn['lng']), destination: new google.maps.latlng(en['lat'],en['lng']), travelmode: google.maps.directionstravelmode.driving, waypoints: new google.maps.latlng(45.00334,-73.00228), optimizewaypoints: true }; directionsservice.route(requestobj, function(response, status) { if (status == google.maps.directionsstatus.ok) { //process data. no way points found in : //directionsdisplay.directions.routes[0].legs[0].via_waypoints.length }});

see examples in the documentation

a waypoint consists of next fields:

location (required) specifies address of waypoint. stopover (optional) indicates whether waypoint actual stop on route (true) or instead preference route through indicated location (false). stopovers true default.

from api reference:

waypoints | array. | array of intermediate waypoints. directions calculated origin destination way of each waypoint in array. maximum allowed waypoints 8, plus origin, , destination. maps api business customers allowed 23 waypoints, plus origin, , destination. waypoints > not supported transit directions. optional.

you aren't passing in valid array of waypoints. see below:

var requestobj = { origin: new google.maps.latlng(sn['lat'],sn['lng']), destination: new google.maps.latlng(en['lat'],en['lng']), travelmode: google.maps.directionstravelmode.driving, waypoints: [{location:new google.maps.latlng(45.00334,-73.00228)}], optimizewaypoints: true }; directionsservice.route(requestobj, function(response, status) { if (status == google.maps.directionsstatus.ok) { //process data. no way points found in : //directionsdisplay.directions.routes[0].legs[0].via_waypoints.length }});

working fiddle

google-maps-api-3

linux - multi cpu core gzip a big file -



linux - multi cpu core gzip a big file -

how can utilize cpu cores in server(has 4 cores) linux debian on openvz gzipping faster one big file?

i trying utilize these commands can not set pieces together

get number of cores cores=$(grep -c '^processor' /proc/cpuinfo)

this split big file in more split -b100 file.big

this utilize gzip command multiple core find /source -type f -print0 | xargs -0 -n 1 -p $cores gzip --best

i don't know if best way optimize gzip process of big files..

use pigz, parallel gzip implementation.

unlike parallel gzip, pigz produces single gzip stream.

linux compression gzip cpu-cores

How do I call a JavaScript function that uses jQuery? -



How do I call a JavaScript function that uses jQuery? -

this question has reply here:

how execute jquery code [closed] 2 answers

i found function:

function squarifyme(element) { squareitup() window.onresize = function(element) { squareitup(); } function squareitup() { $(element).height($(element).width()); } }

with call:

$(document).ready(function() { squarifyme('.myelement'); });

but don't know how add together webpage... i've done bunch of times can't work.

the function named squarifyme() uses jquery.

this means first thing have import jquery.

the easiest way utilize hosted library.

to utilize google's hosted version of jquery, add together html page:

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>

alternatively, download jquery , include yourself.

. . .

now explain sec piece of code:

$(document).ready(function() { squarifyme('.myelement'); });

the first line says "execute next code when page ready."

you can learn more reading documentation $(document).ready().

. . .

now explain next piece of code:

squarifyme('.myelement'); function squareitup() { $(element).height($(element).width()); }

the first line above invokes function squarifyme() string parameter when document ready.

inside squarifyme() function squareitup() invoked.

it next (piece piece):

$('.myelement')

this code selects elements in document have css class myelement.

all such elements returned set, manipulated chained jquery code follows.

you can learn more selecting dom elements class here.

let's rewrite line of code clarity:

$(element).height($(element).width());

we'll rewrite this:

var $s = $(element); $s.height($s.width());

now $s equals set of dom elements have css class myelement.

in sec half of line, get width of each element in $s this:

$s.width()

you can learn more reading documentatino jquery.width().

we set height of element equal width this:

$s.height($s.width());

this create every element class myelement square.

. . .

now explain lastly piece of code:

window.onresize = function(element) { squareitup(); }

this code registers event handler window.onresize.

in other words, causes squareitup() invoked whenever user resizes browser window.

so... every time resize browser, every dom element class myelement become square.

you can learn more reading documentation window.onresize.

javascript jquery