greptilian logo

IRC log for #friendlyjava, 2017-11-17

##friendlyjava on freenode

| Channels | #friendlyjava index | Today | | Search | Google Search | Plain-Text | plain, newest first | summary

All times shown according to UTC.

Time S Nick Message
00:15 pdurbin What are you using now? JSP?
00:15 pdurbin I was confused by all the << >>
05:46 aditsu maybe it's C++? :p
05:58 Kemikals joined ##friendlyjava
06:03 Kemikals Hi
06:16 df0_ joined ##friendlyjava
06:17 df0_ joined ##friendlyjava
07:22 mr_lou joined ##friendlyjava
07:25 abba joined ##friendlyjava
09:12 kirua joined ##friendlyjava
13:23 aditsu so, it looks like one of the nastiest parts of working with spreadsheets is data formatting
13:24 aditsu POI has an implementation for that, but it's somewhat tied into the library
13:27 mr_lou joined ##friendlyjava
13:32 aditsu apparently ODF toolkit has something too.. lemme check that
13:47 aditsu ugh, what a terrible library
14:58 aditsu I think I found several bugs too..
15:08 aditsu anyway, looks like excel and ODS have totally different concepts of dates, times and formats; it's quite amazing that LibreOffice is able to convert between them
15:11 aditsu the ODS model is much better, but also more complicated
16:18 df0_ joined ##friendlyjava
16:43 xBADDA555 joined ##friendlyjava
17:40 pdurbin I bet RData is different still.
17:41 aditsu never heard of that..
17:41 pdurbin is the format R uses
17:41 aditsu is it a spreadsheet format?
17:42 aditsu or more generally, tabular data?
17:42 pdurbin yeah, it's for tabular data. When you upload proprietary formats into our app (Dataverse), one of the formats we liberate the data into is Rdata. Also plain text (tsv).
17:44 aditsu a quick search suggests that it's more like a format for storing R objects, like a memory image
17:44 pdurbin yep, but you can write it to disk
17:45 aditsu of course you can, but the point is objects are not necessarily tabular data
17:45 aditsu I'm guessing it's more like json?
17:46 aditsu in terms of structure
17:50 aditsu pdurbin: I have another question though - you use jaxb, right?
17:54 aditsu I'm trying to generate classes for the OpenDocument schema (originally Relax NG), and I'm getting a bunch of errors..
17:57 pdurbin I see one case of `import javax.xml.bind.Unmarshaller` but it's commented out. That's the only line I see when I grep for `javax.xml.bind` so I guess we don't use jaxb.
18:00 aditsu pdurbin: I think you recommended it to me at one point: http://irclog.greptilian.com/friendlyjava/2016-09-30#i_188322
18:01 pdurbin you're linking to something pulsar said
18:02 aditsu oops.. starts with p, contains u and r.. what's the difference? :p
18:04 aditsu pdurbin: do you have a preferred way of converting an xml to a structure of java objects and back?
18:04 aditsu (not DOM nodes but more like pojo classes)
18:04 pdurbin I would certainly start with JAXB, since it's the standard.
18:05 pdurbin I feel like we might use DTO objects in our app.
18:05 aditsu ok, you're just not familiar with it I guess
18:05 pdurbin not that part of the code, no, sorry
18:05 aditsu no worries
18:18 aditsu this might be the problem I'm having... https://github.com/relaxng/jing-trang/issues/81
20:06 xBADDA555 joined ##friendlyjava
21:12 xBADDA555_ joined ##friendlyjava
23:14 aditsu hmm, the concept of choice in an xml schema doesn't seem to map nicely to java
23:16 pdurbin why not?
23:17 aditsu see http://blog.bdoughan.com/2010/10/jaxb-and-xsd-choice-xmlelements.html and http://blog.bdoughan.com/2011/04/xml-schema-to-java-xsd-choice.html
23:18 aditsu you end up with heavy annotations and incomplete type checking
23:21 aditsu I guess a more robust option would be to have a base class/interface, with implementations for the different choices
23:21 pdurbin "Team lead for the TopLink/EclipseLink JAXB". good find
23:21 aditsu no idea if jaxb would support that
23:23 pdurbin "XML Schema has the concept of a choice element.  The choice element indicates that one of the elements defined within the choice may occur at this point in the XML document.  In this example I will demonstrate how easily this can be mapped using JAXB."
23:23 pdurbin And then he shows how, with annotations. But you don't like all those annotations? Is that the problem?
23:25 aditsu that, and you actually end up with an Object in that version
23:25 aditsu you could put anything in there
23:26 aditsu and a reader commented that if you have different choices with the same data type, it has no way to tell which one it is
23:26 pdurbin but he uses `type=Address.class`, not `type=Object.class`
23:27 aditsu I'm meant Object contactInfo
23:27 aditsu what's stopping you from setting it to 2.5 for example?
23:28 pdurbin oh, I see
23:30 aditsu also, those are only examples of simple (single-element) choices, I wonder what happens in more complex cases
23:32 pulsar O.o
23:33 pdurbin Why use XML anyway? Isn't eveyone using JSON instead these days? :)
23:33 aditsu not for office documents
23:33 pdurbin ah, docx or whatever
23:33 pdurbin xlsx
23:33 aditsu ods :)
23:34 pdurbin yeah
23:34 pdurbin even HTML is XML, basically. more like XML than JSON anyway :)
23:38 aditsu I might sidestep jaxb entirely :p I'm already working on a relax ng-based code generator.. it seems like a lot of work though :/

| Channels | #friendlyjava index | Today | | Search | Google Search | Plain-Text | plain, newest first | summary

##friendlyjava on freenode