verbose

Looking for a (pseudo) XSLT preprocessor/templater to make it less verbose [closed]

只谈情不闲聊 提交于 2019-11-30 22:57:18
Does anybody know of a preprocessor for XSLT to make it less verbose? Something like what SASS is to CSS, a little proggy that will take light syntax: "/": { <html> <head> <title>My book collection</title> </head> <body> {@ "//media"} {@ quantity = calc_abs_value("//total_quantity")} Price : {@ multiply(price:"//item[@selected='true'][@price]",qty :$quantity) } </body> </html> } "media[@type='book']": { <div id="{@id}"> {title} by {author} published in {published_date} </div> } function calc_abs_value(value) { if ($value < 0) {- $value} else {$value} } function multiply(price,qty:"1") { switch

Git Tag list, display commit sha1 hashes

落爺英雄遲暮 提交于 2019-11-28 16:08:15
问题 so the git tag command lists the current git tags tag1 tag2 git tag -n prints tag's message tag1 blah blah tag2 blah blah What's the best way to get the hash of tag1 & tag2 ? 回答1: How about this? git show-ref --tags 回答2: The git tag command is underdeveloped. A lot is desired but missing in it, like full tag details and tags in the commit history order. I like this instead, which gives exactly what I want but can't get from git tag : git log --oneline --decorate --tags --no-walk This gives a

Make cURL output STDERR to file (or string)

泄露秘密 提交于 2019-11-27 14:44:33
We're trying to debug some cURL errors on the server, and I would like to see the STDERR log. Currently, all we can see for our error is "error code: 7" and that we can't connect to target server. We have contacted the host and made special rule to open the port we need and we're even ignoring the certificate for the time being. Still, we can't connect. I need to debug this, but I can't see any pertinent information on my end. The lines mentioning "VERBOSE" and "STDERR" are the most important, I think. Nothing is written to $curl_log. What am I doing wrong? Following the manuals logic, this

Is it good practice to use ordinal of enum?

余生颓废 提交于 2019-11-27 02:32:21
问题 I have an enum: public enum Persons { CHILD, PARENT, GRANDPARENT; } Is there any problem with using ordinal() method to check "hierarchy" between enum members? I mean - is there any disadvantages when using it excluding verbosity, when somebody can change accidentally order in future. Or is it better to do something like that: public enum Persons { CHILD(0), PARENT(1), GRANDPARENT(2); private Integer hierarchy; private Persons(final Integer hierarchy) { this.hierarchy = hierarchy; } public