This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-10-30
Channels
- # aws (5)
- # aws-lambda (2)
- # beginners (29)
- # boot (5)
- # cider (3)
- # cljs-dev (3)
- # cljsjs (2)
- # clojure (112)
- # clojure-austin (1)
- # clojure-brasil (2)
- # clojure-italy (9)
- # clojure-nl (2)
- # clojure-russia (5)
- # clojure-spec (49)
- # clojure-uk (41)
- # clojurescript (157)
- # core-logic (5)
- # crypto (1)
- # cursive (12)
- # data-science (38)
- # datomic (31)
- # emacs (3)
- # events (2)
- # garden (3)
- # graphql (10)
- # immutant (4)
- # jobs (3)
- # juxt (5)
- # klipse (1)
- # luminus (3)
- # off-topic (40)
- # om (1)
- # onyx (39)
- # other-languages (7)
- # protorepl (3)
- # re-frame (40)
- # reagent (60)
- # ring (8)
- # ring-swagger (14)
- # shadow-cljs (159)
- # spacemacs (1)
- # specter (6)
- # uncomplicate (3)
- # yada (2)
Scala has explicit rules for it iirc, depending on which symbol a given operator starts or ends with
Anyone here live in an RV by choice? I'd like to DM you about programming from an RV / doing remote work.
I used to, although it wasn't a going-places RV, more just an inexpensive form of tiny/alternative housing.
@qqq Surely that's just a matter of having a reasonably high bandwidth 'net connection on the road?
Or at least, regular places/times where you can get online with high bandwidth?
is anybody using Ergodox with emacs ? trying to find inspiration for my configuration.
maybe a dumb programming question, but if you're dealing with epoch days (days since unix epoch) is it an ok programming practice to do normal arithmetic for adding days or should I stick to using real date apis (in this case java.time). in other words, if i need an epoch day that's 45 days from today can I just add 45 to the current epoch day or should i convert to LocalDate
and use LocalDate/plusDays
to add days (I'm leaning towards the latter, more involved method)
would leap year already be accounted for with epoch-days though? like if feb 28th is epoch-day 10,000 on a leap year and i add 2, wouldn't I still get march 1st as epoch day 10,002?
(i guess the confusingness of all these edge cases is a good reason to just stick to date-specific arithmetic)
if you know that when you are getting the date for that day that the february of that year had 29 days
xslt question:
how can I introduce a scope like, from here I select foo
and then I can do <xsl:value-of select="bar">
for <foo><bar></bar></foo>
, so I don’t have to write foo/bar
?
which for-each is that?
d’oh, of course, you mean the xsl:for-each
in xslt
> does selecting bar
in that context not work?
how would I do that without for-each
? I basically want for-each
but for a single element
do you have a sample of your xml file and the ideal output? I don't really understand what you're asking for (which is likely because of my unfamiliarity with xslts and not your lack of explanation)
I had this structure:
<foo>
<bar><baz><inner1><elt1>1</elt1><elt2>1</elt2></inner1></baz></bar>
<bar><baz><inner2><elt1>2</elt1><elt2>2</elt2></inner2></baz></bar>
</foo>
where I had to select either inner1
or inner2
and then the same things under that:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<xsl:for-each select="foo/bar/baz">
<xsl:for-each select="inner1|inner2">
<tr>
<td><xsl:value-of select="elt1"/></td>
<td><xsl:value-of select="elt2"/></td>
</tr>
</xsl:for-each>
</xsl:for-each>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
I guess for-each
does exactly what I want and the fact that it can select multiple or just one doesn’t matterYep, you'll definitely want to do something like this instead of using xsl:for-each
:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/">
<html>
<body>
<xsl:apply-templates select="foo/bar/baz/*"/>
</body>
</html>
</xsl:template>
<xsl:template match="inner1 | inner2">
<tr>
<td>
<xsl:value-of select="elt1"/>
</td>
<td>
<xsl:value-of select="elt2"/>
</td>
</tr>
</xsl:template>
</xsl:stylesheet>
Or <xsl:apply-templates select="foo/bar/baz/inner1 | foo/bar/baz/inner2"/>
if you want to be more explicit.
yeah. i forget the default rules but you could take it all the way to template match="elt1" etc.
<xsl:template match="elt1"> <td> <xsl:apply-templates/> </td> </xsl:template> etc.
Yeah, cool, but these elements are not namespaced, so this could easily lead to name clashes I think?
anyway, same applies to using for-each, select, etc. you're namespaced or you're not. i recommend always using namespaces, it's easy.
You can also use a more specific match pattern, like <xsl:template match="foo/bar/baz/inner1"/>
.