Re: Here are my slides (if attachments are not stripped)

2018-10-19 Thread Dave Fisher
Thanks!

On 2018/10/19 12:23:18, "pj.fanning"  wrote: 
> LGTM.
> 
> 2 minor typos:
> conjuction
> uneccessary
> 
> 
> 
> --
> Sent from: http://apache-poi.1045710.n5.nabble.com/POI-Dev-f2312866.html
> 
> -
> To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
> For additional commands, e-mail: dev-h...@poi.apache.org
> 
> 

-
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org



Re: Using StAX parser for .xlsx files

2018-10-19 Thread Jörn Franke
thanks a lot to all comments. I updated the hadoopoffice library to include
also Stax parsing. In a later stage I will also add reading comments.

On Fri, May 18, 2018 at 11:37 PM Jörn Franke  wrote:

> Hi,
>
> I wonder if someone has already used successfully the StAX parser with
> .xlsx files (ie instead of an event driven push model a pull model, cf.
> https://docs.oracle.com/javase/tutorial/jaxp/stax/why.html).
>
> Reason that I ask is that on Big Data platforms (for which we implemented
> the HadoopOffice library powered by Apache POI, cf.
> https://github.com/ZuInnoTe/hadoopoffice) the event driven model causes a
> lot of memory overhead, because virtually all Big Data platforms implement
> a pull model, which means if I use the push model provided by the event API
> then I need to load the full content in memory to make it available as a
> pull model, since those platforms are not event driven.
>
> I found the StaxHelper class, but I have little idea how it can be used
> within Apache POI:
> https://poi.apache.org/apidocs/org/apache/poi/util/StaxHelper.html
>
>
> The main goal is to have a light weight approach as proposed by the
> current POI event push model for reading .xlsx files (
> https://poi.apache.org/spreadsheet/how-to.html#xssf_sax_api) , but in
> form of a pull model, e.g. as illustrated in the following pseudo code:
>
> XMLInputFactory xmlif;
>
> XSSFReader.SheetIterator iter;
> InputStream currentInputStream;
>
> XMLStreamReader xmlr;
>
>
> /* function called once at the start of processing */
> public void init() {
> r = new XSSFReader( pkg );
> ReadOnlySharedStringsTable strings = new ReadOnlySharedStringsTable(pkg);
> // inputstream sheet iterator
>  iter = (XSSFReader.SheetIterator)r.getSheetsData();
> // XML factory to create Stax Parser
>
> xmlif = XMLInputFactory.newInstance();
>
> }
>
>
> /** the following method is called by the Big Data platform (Flink, Spark,
> Hadoop, Hive etc.) do get the next row without reading the full file in
> memory as in the DOM or SAX (Push) model
> returns null if no further record exist, otherwise sets the current cell
> content as String
> **/
> public String getNextRow() {
> // check if we have data to read
> if ((xmlr==null) || xmlr.hasNext()==false) {
>   if (!iter.hasNext()) {
>  return null;
> } else {
> // read sheet into stax parser
>
> xmlr=xmlif.createXMLStreamReader(iter.next());
>
> }
> // read the data from stax
>  //
> return xmlr.getText(); // just an example, in fact i need to check for a c
> tag, check its type, if it is string then check the string table, otherwise
> convert the numeric to a data or indeed a number
> }
>
> Any pitfalls with this approach? I assume I need to link the sharedstring
> table somehow to the cell tag (I can derive probably from the source code
> of the event API how to do this).
> Formula evaluation is not of so much importance for this currently (the
> HadoopOffice library offers for formula evaluation to load the full file in
> memory).
> Of course still the full sharedstringtable needs to be loaded in memory,
> but I expect for the data to have a very small sharedstring table and/or
> use of numerics.
>
> Has anyone used the StAX API together with .xlsx files with POI?
>
>
> Thank you.
>
> best regards
>


Re: svn commit: r1844311 - /poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/BaseXSSFFormulaEvaluator.java

2018-10-19 Thread Greg Woolsey
Thanks for fixing that before I got back online. Not sure how I didn't run
those tests locally.

On Fri, Oct 19, 2018 at 12:43 AM  wrote:

> Author: fanningpj
> Date: Fri Oct 19 07:43:04 2018
> New Revision: 1844311
>
> URL: http://svn.apache.org/viewvc?rev=1844311=rev
> Log:
> fix class cast issur recently introduced in BaseXSSFFormulaEvaluator
>
> Modified:
>
> poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/BaseXSSFFormulaEvaluator.java
>
> Modified:
> poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/BaseXSSFFormulaEvaluator.java
> URL:
> http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/BaseXSSFFormulaEvaluator.java?rev=1844311=1844310=1844311=diff
>
> ==
> ---
> poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/BaseXSSFFormulaEvaluator.java
> (original)
> +++
> poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/BaseXSSFFormulaEvaluator.java
> Fri Oct 19 07:43:04 2018
> @@ -73,9 +73,14 @@ public abstract class BaseXSSFFormulaEva
>  }
>
>  protected void setCellType(Cell cell, CellType cellType) {
> -EvaluationWorkbook evaluationWorkbook = getEvaluationWorkbook();
> -BaseXSSFEvaluationWorkbook xewb =
> BaseXSSFEvaluationWorkbook.class.isAssignableFrom(evaluationWorkbook.getClass())
> ? (BaseXSSFEvaluationWorkbook) evaluationWorkbook : null;
> -
> -((XSSFCell) cell).setCellType(cellType, xewb);
> +if (cell instanceof  XSSFCell) {
> +EvaluationWorkbook evaluationWorkbook =
> getEvaluationWorkbook();
> +BaseXSSFEvaluationWorkbook xewb =
> BaseXSSFEvaluationWorkbook.class.isAssignableFrom(evaluationWorkbook.getClass())
> ? (BaseXSSFEvaluationWorkbook) evaluationWorkbook : null;
> +
> +((XSSFCell) cell).setCellType(cellType, xewb);
> +} else {
> +// could be an SXSSFCell
> +cell.setCellType(cellType);
> +}
>  }
>  }
>
>
>
> -
> To unsubscribe, e-mail: commits-unsubscr...@poi.apache.org
> For additional commands, e-mail: commits-h...@poi.apache.org
>
>


[Bug 62839] New: MathX.floor for negative n

2018-10-19 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=62839

Bug ID: 62839
   Summary: MathX.floor for negative n
   Product: POI
   Version: 4.0.0-FINAL
  Hardware: PC
OS: Linux
Status: NEW
  Severity: normal
  Priority: P2
 Component: SS Common
  Assignee: dev@poi.apache.org
  Reporter: p...@table2web.de
  Target Milestone: ---

Behavior in LibreOffice / Excel:
The result of function call FLOOR.XCL(-123;10) in LibreOffice 6.1.2.1 is -130.
The result in Excel Office 365 is also -130.
The result in POI 4.0.0 via cell.getNumericCellValue() is -130.0.

Problem:
The result of new DataFormatter().formatCellValue(cell, formulaEvaluator) is
#NUM!.

Expected result:
I suppose that the result in POI also should be -130.

Idea for improvement:
Remove the condition (n<0 && s>0) in the if-statement in
org.apache.poi.ss.formula.functions.MathX.floor(double, double) 

And I suggest that the condition (s==0 && n!=0) in
org.apache.poi.ss.formula.functions.MathX.floor(double, double) could be
removed also. Excel returns 0 for floor(0;10) and LibreOffice also returns 0.

I guess that org.apache.poi.ss.formula.functions.MathX.ceiling(double, double)
has already been changed this way, because the docs tell about negative n, but
the if-statement does not check that.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org



Build failed in Jenkins: POI-DSL-OpenJDK #534

2018-10-19 Thread Apache Jenkins Server
See 

--
[...truncated 222 B...]
LANG=en_US.UTF-8
FORREST_HOME=/home/jenkins/tools/forrest/latest

[EnvInject] - Variables injected successfully.
[EnvInject] - Injecting contributions.
Building remotely on beam15 (beam) in workspace 

[WS-CLEANUP] Deleting project workspace...
[WS-CLEANUP] Done
Updating https://svn.apache.org/repos/asf/poi/trunk at revision 
'2018-10-19T12:40:14.246 +'
AUtest-data/spreadsheet/62815.xlsb
AUtest-data/spreadsheet/62834.xlsx
AUtest-data/spreadsheet/62815.xlsb.txt
U src/java/org/apache/poi/ss/usermodel/WorkbookFactory.java
U src/java/org/apache/poi/ss/usermodel/Sheet.java
U src/java/org/apache/poi/ss/formula/eval/FunctionEval.java
U src/java/org/apache/poi/ss/formula/BaseFormulaEvaluator.java
AUsrc/java/org/apache/poi/ss/formula/functions/Frequency.java
U src/ooxml/testcases/org/apache/poi/ss/TestWorkbookFactory.java
U src/ooxml/testcases/org/apache/poi/ooxml/util/OOXMLLite.java
U 
src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTextParagraph.java
U src/ooxml/testcases/org/apache/poi/openxml4j/opc/ZipFileAssert.java
U 
src/ooxml/testcases/org/apache/poi/xssf/extractor/TestXSSFBEventBasedExcelExtractor.java
U src/ooxml/testcases/org/apache/poi/xssf/util/MemoryUsage.java
U src/ooxml/testcases/org/apache/poi/xssf/XSSFTestDataSamples.java
U 
src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFColGrouping.java
U 
src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFWorkbook.java
U 
src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFFormulaEvaluation.java
U src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java
U src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheet.java
U 
src/ooxml/testcases/org/apache/poi/xssf/usermodel/charts/TestXSSFChartTitle.java
U 
src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFDataValidation.java
U src/ooxml/java/org/apache/poi/xdgf/util/HierarchyPrinter.java
U src/ooxml/java/org/apache/poi/xdgf/util/VsdxToPng.java
U src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFText.java
U src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFShape.java
U src/ooxml/java/org/apache/poi/xslf/util/PPTX2PNG.java
U src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFShape.java
U src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFColor.java
U src/ooxml/java/org/apache/poi/xslf/usermodel/XMLSlideShow.java
U src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFNotes.java
U src/ooxml/java/org/apache/poi/poifs/crypt/dsig/SignatureConfig.java
U src/ooxml/java/org/apache/poi/xssf/binary/XSSFBUtils.java
U src/ooxml/java/org/apache/poi/xssf/binary/XSSFBSheetHandler.java
U src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFRow.java
U src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFRow.java
U src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFDrawing.java
U src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCell.java
U 
src/ooxml/java/org/apache/poi/xssf/usermodel/BaseXSSFFormulaEvaluator.java
U src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java
U src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFSDTContent.java
U src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFTable.java
AUsrc/testcases/org/apache/poi/ss/formula/functions/TestFrequency.java
U .classpath

<-- Got one external: forrest.properties, svn url: 
https://svn.apache.org/repos/asf/poi/site/forrest.properties -->
Fetching 'https://svn.apache.org/repos/asf/poi/site/forrest.properties' at -1 
into '
At revision 1844333


<-- Got one external: documentation, svn url: 
https://svn.apache.org/repos/asf/poi/site/src/documentation -->
Fetching 'https://svn.apache.org/repos/asf/poi/site/src/documentation' at -1 
into '
U src/documentation/content/xdocs/status.copy_module_from_bugzilla.py
U src/documentation/content/xdocs/changes.xml
At revision 1844333

At revision 1844333

org.tmatesoft.svn.core.SVNException: svn: E130003: Parser configuration 
problem: namespace reporting is not enabled
at 
org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:70)
at 
org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:57)
at 
org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:760)
at 
org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:352)
at 

Re: Here are my slides (if attachments are not stripped)

2018-10-19 Thread pj.fanning
LGTM.

2 minor typos:
conjuction
uneccessary



--
Sent from: http://apache-poi.1045710.n5.nabble.com/POI-Dev-f2312866.html

-
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org



Here are my slides (if attachments are not stripped)

2018-10-19 Thread Dave Fisher
Hi -

Any typos, tiny enhancements or other comments?

Regards,
Dave



Dave-poi.pptx
Description: MS-Powerpoint 2007 presentation

-
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org

Proposal - host javadocs of recent versions too

2018-10-19 Thread Nick Burch

Hi All

As many of you will know, we have javadocs on the website, but these 
correspond to the latest (typically unreleased) code. Javadocs for a 
specific release are shipped in the binary package, and as a javadoc jar 
via Maven central (eg for IDE use). Based on stackoverflow posts though, 
this approach can sometimes cause new user confusion.


What I'd propose is that we host additionally the javadocs of the last few 
main releases, so people can easily look up the javadocs of the version 
they're using, without needing to re-find a past download / download 
something else.



The immediate change would be:
 * Everything at https://poi.apache.org/apidocs/ gets pushed to
   https://poi.apache.org/apidocs/dev/
 * A new page at https://poi.apache.org/apidocs/ which says which
   versions you can see javadocs for online, and instructions on getting
   older ones from the released files
 * Redirects for as much as possible from https://poi.apache.org/apidocs/
   to https://poi.apache.org/apidocs/dev/ to avoid breaking links
 * Tweaks to the site build ant file to support the changes


Then, and this is the bit which could use some more feedback:
 * /apidocs/40/ for the latest 4.0.x release (eg when we do 4.0.1 we
   replace them)
 * /apidocs/317/ for 3.17 final
 * /apidocs/316/ for 3.16 final
 * No betas, nothing older than 3.16
 * Using 40 not 4.0 nor 4.0.x
 * Using 317 not 3.17

On these last parts especially, what do people think?

Nick

-
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org



Jenkins build is back to normal : POI-DSL-Maven #683

2018-10-19 Thread Apache Jenkins Server
See 



-
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org



Jenkins build is back to normal : POI-DSL-1.8 #553

2018-10-19 Thread Apache Jenkins Server
See 



-
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org



[Bug 62836] [PATCH] Implementation of Excel TREND function

2018-10-19 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=62836

--- Comment #1 from Matthias Becht  ---
Created attachment 36201
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=36201=edit
Test cases for TREND

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org



[Bug 62836] New: [PATCH] Implementation of Excel TREND function

2018-10-19 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=62836

Bug ID: 62836
   Summary: [PATCH] Implementation of Excel TREND function
   Product: POI
   Version: 4.0.x-dev
  Hardware: All
OS: All
Status: NEW
  Severity: enhancement
  Priority: P2
 Component: SS Common
  Assignee: dev@poi.apache.org
  Reporter: matthi...@protonmail.com
  Target Milestone: ---

Created attachment 36200
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=36200=edit
TREND patch

This is an incomplete implementation of the Excel TREND function. Most cases do
work already, but some don't work yet due to the way the math library handles
multiple linear regression. Specifically, cases where there are more x
variables than the sample size and some cases where there are duplicate x
values fail. The former seems to have been fixed since in the math library
(https://github.com/Hipparchus-Math/hipparchus/issues/13), but the fix isn't in
the currently used version yet. I'm not sure how to fix the latter because
having duplicate x values doesn't seem to make too much sense, so I'm not
entirely sure what Excel actually does.
Some of the code (especially for handling all the different shapes excel
allows) is pretty rough, but I hope it's acceptable as a first implementation.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org