Author: johayek
-
XQuery: padding an integer or a number, but not with “0”
I found this function, but it pads on the right: http://www.xqueryfunctions.com/xq/functx_pad-string-to-length.html : functx:pad-string-to-length I derived pad-string-to-length-on-the-left from it: https://github.com/JochenHayek/misc/blob/master/xqueryfunctions/pad-string-to-length-on-the-left.xqy https://github.com/JochenHayek/misc/blob/master/xqueryfunctions I use it around format-integer and format-number, e.g. let $net_amount_formatted := local:pad-string-to-length-on-the-left( format-number( data($invoice/@net_amount) , ‘#,###.#####’ ) , ‘ ‘ , 12 )
-
XPath and XQuery Functions and Operators 3.0: Formatting integers and numbers
https://www.w3.org/TR/xpath-functions-30 https://www.w3.org/TR/xpath-functions-30/#formatting-integers https://www.w3.org/TR/xpath-functions-30/#formatting-the-number http://www.xqueryfunctions.com/xq/functx_pad-integer-to-length.html http://www.xqueryfunctions.com/xq/functx_pad-string-to-length.html https://github.com/JochenHayek/misc/blob/master/xqueryfunctions https://github.com/JochenHayek/misc/blob/master/xqueryfunctions/pad-string-to-length-on-the-left.xqy I need to pad a decimal number to a given length with leading white space. Looks like there is nothing in the “built-in library”. Looks like there is no functx:pad-integer-to-length as well, but functx:pad-string-to-length looks intriguing – but it only pads on the right. I created a variant, that pads on…
-
2016 Turkish coup d’état attempt
https://en.wikipedia.org/wiki/2016_Turkish_coup_d’état_attempt President Recep Tayyip Erdoğan and his AKP government being removed from office? Isn’t that an intriguing idea?!? If I am not mistaken, the Turkish generals are traditionally quite pro-Israeli, I am sure they are not pro-IS, they can’t really be worse then an Erdoğan government, …
-
the Mercurial SCM: TortoiseHg, …
https://en.wikipedia.org/wiki/Mercurial https://www.mercurial-scm.org https://www.mercurial-scm.org/wiki/QuickReferenceCardsAndCheatSheets https://www.mercurial-scm.org/wiki/TortoiseHg http://TortoiseHg.bitbucket.org The driver program hg – a reference to Hg – the chemical symbol of the element mercury.
-
XmlStarlet UG on “Studying Structure of XML Document” – “xmlstarlet elements …”
http://xmlstar.sourceforge.net/doc/UG/xmlstarlet-ug.html#idm47077139665568 http://xmlstar.sourceforge.net/doc/UG/xmlstarlet-ug.html I really like “xmlstarlet elements …” – but these very nice and useful XPath expressions come without index. So what if you really, really need them with indexes? I am not sure, you can write a general utility, that rewrites these XPath expressions without index into XPath expressions with index, but for my…
-
Jenkins CI jobs described in YAML – “Jenkins Job Wrecker” and “Jenkins Job Builder”
https://github.com/openstack-infra/jenkins-job-builder http://docs.openstack.org/infra/jenkins-job-builder/ http://docs.openstack.org/infra/jenkins-job-builder/definition.html http://docs.openstack.org/infra/jenkins-job-builder/definition.html#module-jenkins_jobs.local_yaml : include, include-raw, include-raw-escape – keeping building blocks in separate files – good for dealing with Shell scripts etc as build steps http://docs.openstack.org/infra/jenkins-job-builder/quick-start.html http://docs.openstack.org/infra/jenkins-job-builder/execution.html https://www.mediawiki.org/wiki/Continuous_integration/Jenkins_job_builder (JJB) https://www.cloudbees.com/jenkins/juc-2015/presentations/JUC-2015-USEast-Scaling-Your-Jenkins-Do.pdf And this software lets you extract Jenkins jobs to YAML: https://github.com/ktdreyer/jenkins-job-wrecker (JJW) I don’t know, how well the two (“builder” and “wrecker”) work together – how does the…
-
extract your build steps from a Jenkins CI job to ordinary and “easy to edit” flat files
Over time Jenkins jobs can grow into something “a little confusing”, in other words: like cancer. The Jenkins developers were thoughtful enough to provide an API to all the data structures, that Jenkins and its jobs operate on, so we are able to export an entire Jenkins job as XML. You certainly do not want…
-
Microsoft Sysinternals “Autologon for Windows” — yet another nice utility
https://technet.microsoft.com/en-us/sysinternals/autologon.aspx Autologon enables you to easily configure Windows’ built-in autologon mechanism. Instead of waiting for a user to enter their name and password, Windows uses the credentials you enter with Autologon, which are encrypted in the Registry, to log on the specified user automatically. Autologon is easy enough to use. Just run autologon.exe, fill in…
-
Synology “Note Station” – no more trouble over price and space
DiskStation Manager offers a library of apps, a cost-free cloud service, a complete multimedia platform, powerful Synology Hybrid RAID and extensive virtualization support. https://www.synology.com/en-global/dsm/6.0/productivity#noteStation https://www.synology.com/en-global/knowledgebase/DSM/tutorial/Network/How_to_migrate_Evernote_notebooks_to_Note_Station This is just another service running on my Diskstation at home, coming out of the box and quite, quite handy.
-
Jenkins CI: the Matrix Project Plugin and the Template Project Plugin
https://wiki.jenkins-ci.org/display/JENKINS/Matrix+Project+Plugin https://wiki.jenkins-ci.org/display/JENKINS/Building+a+matrix+project https://wiki.jenkins-ci.org/display/JENKINS/Template+Project+Plugin If you have a list of “identical” tasks, maybe even a (2-dimensional) matrix, the MPP may be useful for you. If you have further needs, the TPP may be for you. There you define: a template job, that you disable “forever”, and then the true jobs, that make use of the template job’s…