You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Claude Warren <cl...@xenei.com> on 2020/01/26 16:52:08 UTC

[collections] example code.

I see that there is no example code directory in the collections project.
I was thinking of contributing an example of how to construct a Bloom
filter that operates like the Hadoop Bloom filter but this seems like
something that we may not want to include in the library.

In the Jena project we have example code that we package for users if they
wish and we reference it in the documentation as well.

Any thoughts on this?

Claude

-- 
I like: Like Like - The likeliest place on the web
<http://like-like.xenei.com>
LinkedIn: http://www.linkedin.com/in/claudewarren

Re: [collections] example code.

Posted by Gary Gregory <ga...@gmail.com>.
On Sun, Jan 26, 2020 at 4:30 PM Claude Warren <cl...@xenei.com> wrote:

> The doxia snippet extension allows you to reference code in the source tree
> and include it in the generated HTML files.  This means that the example
> code in the documentation/site can come directly from code that compiles
> and can be run in the examples.  Best of both worlds I think.
>

Indeed. The way we wrote
https://www.manning.com/books/java-persistence-with-hibernate-second-edition
was
using such "code slurping" through
http://4thline.org/projects/lemma/manual/lemma-manual.xhtml. The whole book
was written in XHTML in a project that contained all example sources are
real running Java code.

Gary


> Claude
>
> On Sun, Jan 26, 2020 at 8:48 PM Gary Gregory <ga...@gmail.com>
> wrote:
>
> > No code in the site please. It must be compiled with the build and
> > available as a plain source file for refactoring from IDEs and tools.
> >
> > Gary
> >
> > On Sun, Jan 26, 2020, 15:19 Bruno P. Kinoshita <ki...@apache.org> wrote:
> >
> > >  That's exactly what we have in commons imaging. +1 to either an
> example
> > > directory in src/test and maybe a link in the website, or the code
> direct
> > > in the site.
> > > Cheers
> > > Bruno
> > >
> > >     On Monday, 27 January 2020, 6:07:21 am NZDT, Gary Gregory <
> > > garydgregory@gmail.com> wrote:
> > >
> > >  I think the simplest is to create an examples package under src/test
> > which
> > > also let you put example data under src/resources.
> > >
> > > This way, that code would get processed just like any other test code
> > > included the source xref report.
> > >
> > > Gary
> > >
> > > On Sun, Jan 26, 2020, 11:52 Claude Warren <cl...@xenei.com> wrote:
> > >
> > > > I see that there is no example code directory in the collections
> > project.
> > > > I was thinking of contributing an example of how to construct a Bloom
> > > > filter that operates like the Hadoop Bloom filter but this seems like
> > > > something that we may not want to include in the library.
> > > >
> > > > In the Jena project we have example code that we package for users if
> > > they
> > > > wish and we reference it in the documentation as well.
> > > >
> > > > Any thoughts on this?
> > > >
> > > > Claude
> > > >
> > > > --
> > > > I like: Like Like - The likeliest place on the web
> > > > <http://like-like.xenei.com>
> > > > LinkedIn: http://www.linkedin.com/in/claudewarren
> > > >
> > >
> >
>
>
> --
> I like: Like Like - The likeliest place on the web
> <http://like-like.xenei.com>
> LinkedIn: http://www.linkedin.com/in/claudewarren
>

Re: [collections] example code.

Posted by Claude Warren <cl...@xenei.com>.
The doxia snippet extension allows you to reference code in the source tree
and include it in the generated HTML files.  This means that the example
code in the documentation/site can come directly from code that compiles
and can be run in the examples.  Best of both worlds I think.

Claude

On Sun, Jan 26, 2020 at 8:48 PM Gary Gregory <ga...@gmail.com> wrote:

> No code in the site please. It must be compiled with the build and
> available as a plain source file for refactoring from IDEs and tools.
>
> Gary
>
> On Sun, Jan 26, 2020, 15:19 Bruno P. Kinoshita <ki...@apache.org> wrote:
>
> >  That's exactly what we have in commons imaging. +1 to either an example
> > directory in src/test and maybe a link in the website, or the code direct
> > in the site.
> > Cheers
> > Bruno
> >
> >     On Monday, 27 January 2020, 6:07:21 am NZDT, Gary Gregory <
> > garydgregory@gmail.com> wrote:
> >
> >  I think the simplest is to create an examples package under src/test
> which
> > also let you put example data under src/resources.
> >
> > This way, that code would get processed just like any other test code
> > included the source xref report.
> >
> > Gary
> >
> > On Sun, Jan 26, 2020, 11:52 Claude Warren <cl...@xenei.com> wrote:
> >
> > > I see that there is no example code directory in the collections
> project.
> > > I was thinking of contributing an example of how to construct a Bloom
> > > filter that operates like the Hadoop Bloom filter but this seems like
> > > something that we may not want to include in the library.
> > >
> > > In the Jena project we have example code that we package for users if
> > they
> > > wish and we reference it in the documentation as well.
> > >
> > > Any thoughts on this?
> > >
> > > Claude
> > >
> > > --
> > > I like: Like Like - The likeliest place on the web
> > > <http://like-like.xenei.com>
> > > LinkedIn: http://www.linkedin.com/in/claudewarren
> > >
> >
>


-- 
I like: Like Like - The likeliest place on the web
<http://like-like.xenei.com>
LinkedIn: http://www.linkedin.com/in/claudewarren

Re: [collections] example code.

Posted by Gary Gregory <ga...@gmail.com>.
No code in the site please. It must be compiled with the build and
available as a plain source file for refactoring from IDEs and tools.

Gary

On Sun, Jan 26, 2020, 15:19 Bruno P. Kinoshita <ki...@apache.org> wrote:

>  That's exactly what we have in commons imaging. +1 to either an example
> directory in src/test and maybe a link in the website, or the code direct
> in the site.
> Cheers
> Bruno
>
>     On Monday, 27 January 2020, 6:07:21 am NZDT, Gary Gregory <
> garydgregory@gmail.com> wrote:
>
>  I think the simplest is to create an examples package under src/test which
> also let you put example data under src/resources.
>
> This way, that code would get processed just like any other test code
> included the source xref report.
>
> Gary
>
> On Sun, Jan 26, 2020, 11:52 Claude Warren <cl...@xenei.com> wrote:
>
> > I see that there is no example code directory in the collections project.
> > I was thinking of contributing an example of how to construct a Bloom
> > filter that operates like the Hadoop Bloom filter but this seems like
> > something that we may not want to include in the library.
> >
> > In the Jena project we have example code that we package for users if
> they
> > wish and we reference it in the documentation as well.
> >
> > Any thoughts on this?
> >
> > Claude
> >
> > --
> > I like: Like Like - The likeliest place on the web
> > <http://like-like.xenei.com>
> > LinkedIn: http://www.linkedin.com/in/claudewarren
> >
>

Re: [collections] example code.

Posted by "Bruno P. Kinoshita" <ki...@apache.org>.
 That's exactly what we have in commons imaging. +1 to either an example directory in src/test and maybe a link in the website, or the code direct in the site.
Cheers
Bruno

    On Monday, 27 January 2020, 6:07:21 am NZDT, Gary Gregory <ga...@gmail.com> wrote:  
 
 I think the simplest is to create an examples package under src/test which
also let you put example data under src/resources.

This way, that code would get processed just like any other test code
included the source xref report.

Gary

On Sun, Jan 26, 2020, 11:52 Claude Warren <cl...@xenei.com> wrote:

> I see that there is no example code directory in the collections project.
> I was thinking of contributing an example of how to construct a Bloom
> filter that operates like the Hadoop Bloom filter but this seems like
> something that we may not want to include in the library.
>
> In the Jena project we have example code that we package for users if they
> wish and we reference it in the documentation as well.
>
> Any thoughts on this?
>
> Claude
>
> --
> I like: Like Like - The likeliest place on the web
> <http://like-like.xenei.com>
> LinkedIn: http://www.linkedin.com/in/claudewarren
>
  

Re: [collections] example code.

Posted by Gary Gregory <ga...@gmail.com>.
I think the simplest is to create an examples package under src/test which
also let you put example data under src/resources.

This way, that code would get processed just like any other test code
included the source xref report.

Gary

On Sun, Jan 26, 2020, 11:52 Claude Warren <cl...@xenei.com> wrote:

> I see that there is no example code directory in the collections project.
> I was thinking of contributing an example of how to construct a Bloom
> filter that operates like the Hadoop Bloom filter but this seems like
> something that we may not want to include in the library.
>
> In the Jena project we have example code that we package for users if they
> wish and we reference it in the documentation as well.
>
> Any thoughts on this?
>
> Claude
>
> --
> I like: Like Like - The likeliest place on the web
> <http://like-like.xenei.com>
> LinkedIn: http://www.linkedin.com/in/claudewarren
>