[math] Frequency getUniqueCount

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

[math] Frequency getUniqueCount

Patrick Meyer
I have a small feature request for the org.apache.commons.math.stat
Frequency class. It is often useful to know the unique number of elements in
a frequency table. Would you add this feature? I submitted an issue with
JIRA with the code needed to make this happen,
https://issues.apache.org/jira/browse/MATH-448.

Thanks
Reply | Threaded
Open this post in threaded view
|

Re: [math] Frequency getUniqueCount

Ted Dunning
If you provide a suggested patch, this will go forward much more quickly
than
if you wait for a volunteer to appear out of the mists.

It is after all a volunteer effort.  Go ahead and volunteer!

On Mon, Dec 6, 2010 at 6:07 AM, Patrick Meyer <[hidden email]> wrote:

> I have a small feature request for the org.apache.commons.math.stat
> Frequency class. It is often useful to know the unique number of elements
> in
> a frequency table. Would you add this feature? I submitted an issue with
> JIRA with the code needed to make this happen,
> https://issues.apache.org/jira/browse/MATH-448.
>
> Thanks
>
Reply | Threaded
Open this post in threaded view
|

Re: [math] Frequency getUniqueCount

Patrick Meyer
OK, I attached a diff file to,https://issues.apache.org/jira/browse/MATH-448.
However, I am new to subversion and JIRA and I'm not sure I have done this
correctly. Please let me know if I have done something wrong. I am happy to
volunteer and contribute to the project. I just want to make sure I am using
he right process to submit changes.

Thanks,
Patrick



On Mon, Dec 6, 2010 at 10:46 AM, Ted Dunning <[hidden email]> wrote:

> If you provide a suggested patch, this will go forward much more quickly
> than
> if you wait for a volunteer to appear out of the mists.
>
> It is after all a volunteer effort.  Go ahead and volunteer!
>
> On Mon, Dec 6, 2010 at 6:07 AM, Patrick Meyer <[hidden email]> wrote:
>
> > I have a small feature request for the org.apache.commons.math.stat
> > Frequency class. It is often useful to know the unique number of elements
> > in
> > a frequency table. Would you add this feature? I submitted an issue with
> > JIRA with the code needed to make this happen,
> > https://issues.apache.org/jira/browse/MATH-448.
> >
> > Thanks
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: [math] Frequency getUniqueCount

Ted Dunning
How did you create this diff?

The normal way is to use svn diff in the project root directory.

On Mon, Dec 6, 2010 at 8:29 AM, Patrick Meyer <[hidden email]> wrote:

> OK, I attached a diff file to,
> https://issues.apache.org/jira/browse/MATH-448.
> However, I am new to subversion and JIRA and I'm not sure I have done this
> correctly. Please let me know if I have done something wrong. I am happy to
> volunteer and contribute to the project. I just want to make sure I am
> using
> he right process to submit changes.
>
> Thanks,
> Patrick
>
>
>
> On Mon, Dec 6, 2010 at 10:46 AM, Ted Dunning <[hidden email]>
> wrote:
>
> > If you provide a suggested patch, this will go forward much more quickly
> > than
> > if you wait for a volunteer to appear out of the mists.
> >
> > It is after all a volunteer effort.  Go ahead and volunteer!
> >
> > On Mon, Dec 6, 2010 at 6:07 AM, Patrick Meyer <[hidden email]>
> wrote:
> >
> > > I have a small feature request for the org.apache.commons.math.stat
> > > Frequency class. It is often useful to know the unique number of
> elements
> > > in
> > > a frequency table. Would you add this feature? I submitted an issue
> with
> > > JIRA with the code needed to make this happen,
> > > https://issues.apache.org/jira/browse/MATH-448.
> > >
> > > Thanks
> > >
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: [math] Frequency getUniqueCount

Patrick Meyer
I originally used Netbeans to generate the Diff, then copy and pasted it
into Wordpad to save it. I just uploaded a new patch that was created with
the Netbeans "Export Diff Patch" function. Is this new file in the correct
format? (Please excuse the noob - I'll get the process right eventually.)



On Mon, Dec 6, 2010 at 11:55 AM, Ted Dunning <[hidden email]> wrote:

> How did you create this diff?
>
> The normal way is to use svn diff in the project root directory.
>
> On Mon, Dec 6, 2010 at 8:29 AM, Patrick Meyer <[hidden email]> wrote:
>
> > OK, I attached a diff file to,
> > https://issues.apache.org/jira/browse/MATH-448.
> > However, I am new to subversion and JIRA and I'm not sure I have done
> this
> > correctly. Please let me know if I have done something wrong. I am happy
> to
> > volunteer and contribute to the project. I just want to make sure I am
> > using
> > he right process to submit changes.
> >
> > Thanks,
> > Patrick
> >
> >
> >
> > On Mon, Dec 6, 2010 at 10:46 AM, Ted Dunning <[hidden email]>
> > wrote:
> >
> > > If you provide a suggested patch, this will go forward much more
> quickly
> > > than
> > > if you wait for a volunteer to appear out of the mists.
> > >
> > > It is after all a volunteer effort.  Go ahead and volunteer!
> > >
> > > On Mon, Dec 6, 2010 at 6:07 AM, Patrick Meyer <[hidden email]>
> > wrote:
> > >
> > > > I have a small feature request for the org.apache.commons.math.stat
> > > > Frequency class. It is often useful to know the unique number of
> > elements
> > > > in
> > > > a frequency table. Would you add this feature? I submitted an issue
> > with
> > > > JIRA with the code needed to make this happen,
> > > > https://issues.apache.org/jira/browse/MATH-448.
> > > >
> > > > Thanks
> > > >
> > >
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: [math] Frequency getUniqueCount

Ted Dunning
Looks right.  I think that the base of the patch is one level too low.

It is also a nice convention to name the patch after the JIRA.  Thus your
patch would be called MATH-448.patch

It is also a nice convention to just upload on top of the previous version.
 This leaves JIRA with a development
history which is pretty interesting to take a look.

On Mon, Dec 6, 2010 at 9:03 AM, Patrick Meyer <[hidden email]> wrote:

> I originally used Netbeans to generate the Diff, then copy and pasted it
> into Wordpad to save it. I just uploaded a new patch that was created with
> the Netbeans "Export Diff Patch" function. Is this new file in the correct
> format? (Please excuse the noob - I'll get the process right eventually.)
>
>
>
> On Mon, Dec 6, 2010 at 11:55 AM, Ted Dunning <[hidden email]>
> wrote:
>
> > How did you create this diff?
> >
> > The normal way is to use svn diff in the project root directory.
> >
> > On Mon, Dec 6, 2010 at 8:29 AM, Patrick Meyer <[hidden email]>
> wrote:
> >
> > > OK, I attached a diff file to,
> > > https://issues.apache.org/jira/browse/MATH-448.
> > > However, I am new to subversion and JIRA and I'm not sure I have done
> > this
> > > correctly. Please let me know if I have done something wrong. I am
> happy
> > to
> > > volunteer and contribute to the project. I just want to make sure I am
> > > using
> > > he right process to submit changes.
> > >
> > > Thanks,
> > > Patrick
> > >
> > >
> > >
> > > On Mon, Dec 6, 2010 at 10:46 AM, Ted Dunning <[hidden email]>
> > > wrote:
> > >
> > > > If you provide a suggested patch, this will go forward much more
> > quickly
> > > > than
> > > > if you wait for a volunteer to appear out of the mists.
> > > >
> > > > It is after all a volunteer effort.  Go ahead and volunteer!
> > > >
> > > > On Mon, Dec 6, 2010 at 6:07 AM, Patrick Meyer <[hidden email]>
> > > wrote:
> > > >
> > > > > I have a small feature request for the org.apache.commons.math.stat
> > > > > Frequency class. It is often useful to know the unique number of
> > > elements
> > > > > in
> > > > > a frequency table. Would you add this feature? I submitted an issue
> > > with
> > > > > JIRA with the code needed to make this happen,
> > > > > https://issues.apache.org/jira/browse/MATH-448.
> > > > >
> > > > > Thanks
> > > > >
> > > >
> > >
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: [math] Frequency getUniqueCount

sebb-2-2
On 6 December 2010 17:06, Ted Dunning <[hidden email]> wrote:
> Looks right.  I think that the base of the patch is one level too low.

The base level of patches should ideally be the top-level of an SVN
checkout, in this case commons-math/trunk, or possibly two levels
higher.
[Some people may check out multiple Commons projects at once.]

It's easy enough to drop extra path segments, but the current patch
has no path whatsoever (except in the comments).
This which makes it harder to apply.

Also there could be several files called Frequency.java.

It's also useful to include the SVN revision in the patch (rather than
BASE). If the patch is not applied for a while, it can be important to
know what revision it was created for.

Dunno how to do that in NetBeans; it happens automatically in Eclipse
when creating patches from an SVN workspace.

> It is also a nice convention to name the patch after the JIRA.  Thus your
> patch would be called MATH-448.patch
>
> It is also a nice convention to just upload on top of the previous version.
>  This leaves JIRA with a development
> history which is pretty interesting to take a look.

Possibly not relevant here though, when the content of the patch is
the same - just the wrapping is different.

> On Mon, Dec 6, 2010 at 9:03 AM, Patrick Meyer <[hidden email]> wrote:
>
>> I originally used Netbeans to generate the Diff, then copy and pasted it
>> into Wordpad to save it. I just uploaded a new patch that was created with
>> the Netbeans "Export Diff Patch" function. Is this new file in the correct
>> format? (Please excuse the noob - I'll get the process right eventually.)
>>
>>
>>
>> On Mon, Dec 6, 2010 at 11:55 AM, Ted Dunning <[hidden email]>
>> wrote:
>>
>> > How did you create this diff?
>> >
>> > The normal way is to use svn diff in the project root directory.
>> >
>> > On Mon, Dec 6, 2010 at 8:29 AM, Patrick Meyer <[hidden email]>
>> wrote:
>> >
>> > > OK, I attached a diff file to,
>> > > https://issues.apache.org/jira/browse/MATH-448.
>> > > However, I am new to subversion and JIRA and I'm not sure I have done
>> > this
>> > > correctly. Please let me know if I have done something wrong. I am
>> happy
>> > to
>> > > volunteer and contribute to the project. I just want to make sure I am
>> > > using
>> > > he right process to submit changes.
>> > >
>> > > Thanks,
>> > > Patrick
>> > >
>> > >
>> > >
>> > > On Mon, Dec 6, 2010 at 10:46 AM, Ted Dunning <[hidden email]>
>> > > wrote:
>> > >
>> > > > If you provide a suggested patch, this will go forward much more
>> > quickly
>> > > > than
>> > > > if you wait for a volunteer to appear out of the mists.
>> > > >
>> > > > It is after all a volunteer effort.  Go ahead and volunteer!
>> > > >
>> > > > On Mon, Dec 6, 2010 at 6:07 AM, Patrick Meyer <[hidden email]>
>> > > wrote:
>> > > >
>> > > > > I have a small feature request for the org.apache.commons.math.stat
>> > > > > Frequency class. It is often useful to know the unique number of
>> > > elements
>> > > > > in
>> > > > > a frequency table. Would you add this feature? I submitted an issue
>> > > with
>> > > > > JIRA with the code needed to make this happen,
>> > > > > https://issues.apache.org/jira/browse/MATH-448.
>> > > > >
>> > > > > Thanks
>> > > > >
>> > > >
>> > >
>> >
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [math] Frequency getUniqueCount

Patrick Meyer
OK, I generated the patch file using Eclipse and it seems to have the
information you described. I'm not sure if the revision part is correct
though. The latest patch is named MATH-448.patch and it is now attached to
the JIRA issue, https://issues.apache.org/jira/browse/MATH-448. I hope this
latest file is what you need.

Thanks,
Patrick




> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: [math] Frequency getUniqueCount

Ted Dunning
Looks right to me.

Welcome to Apache contributorhood!

On Mon, Dec 6, 2010 at 7:10 PM, Patrick Meyer <[hidden email]> wrote:

> OK, I generated the patch file using Eclipse and it seems to have the
> information you described. I'm not sure if the revision part is correct
> though. The latest patch is named MATH-448.patch and it is now attached to
> the JIRA issue, https://issues.apache.org/jira/browse/MATH-448. I hope
> this
> latest file is what you need.
>
> Thanks,
> Patrick
>
>
>
>
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden email]
> > For additional commands, e-mail: [hidden email]
> >
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: [math] Frequency getUniqueCount

sebb-2-2
In reply to this post by Patrick Meyer
On 7 December 2010 03:10, Patrick Meyer <[hidden email]> wrote:
> OK, I generated the patch file using Eclipse and it seems to have the
> information you described. I'm not sure if the revision part is correct
> though. The latest patch is named MATH-448.patch and it is now attached to
> the JIRA issue, https://issues.apache.org/jira/browse/MATH-448. I hope this
> latest file is what you need.

Almost there.

I see my previous mail was misleading.

I would expect most Commons developers to check out either a single
project, e.g.

https://svn.apache.org/repos/asf/commons/proper/math/trunk

in which case a patch relative to the project will start like:

Index: src/main/java/org/apache/commons/math/stat/Frequency.java
===================================================================
--- src/main/java/org/apache/commons/math/stat/Frequency.java (revision 1042422)
+++ src/main/java/org/apache/commons/math/stat/Frequency.java (working copy)
etc.

This is easy to apply.
In Eclipse, select the project, then Team/Apply Patch.

With the patch as currently attached, which starts:

### Eclipse Workspace Patch 1.0
#P apache-math
Index: apache/commons/math/stat/Frequency.java
===================================================================
--- apache/commons/math/stat/Frequency.java (revision 1042596)
+++ apache/commons/math/stat/Frequency.java (working copy)
etc.

one first has to navigate to the directory "src/main/java/org" before
applying the patch.

Also, the patch has been done using the Eclipse Workspace as a Patch Root.
Unfortunately, this is not portable, as it depends on the exact names
given to the Eclipse projects.
For example, I use 'commons-math' - you have used "apache-math"

In future, please select Patch Root = Project in Eclipse.
[Unfortunately it does not seem possible to make this the default.]

However, no need to bother redoing this particular patch, but please
bear in mind for any other patches.

For example, it would be useful to have a test case that exercises the
new method.
This can be attached to the same JIRA (but with a different name, of course).

> Thanks,
> Patrick
>
>
>
>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [math] Frequency getUniqueCount

Ted Dunning
Or you can include the test case in the same patch.  That almost guarantees
you are far enough up the tree.

And using the same name is actually good.  Don't bother to delete the old
version, just upload with the same name.
JIRA will show old versions in greyed out style.

On Mon, Dec 6, 2010 at 7:51 PM, sebb <[hidden email]> wrote:

> For example, it would be useful to have a test case that exercises the
> new method.
> This can be attached to the same JIRA (but with a different name, of
> course).
>
Reply | Threaded
Open this post in threaded view
|

Re: [math] Frequency getUniqueCount

sebb-2-2
On 7 December 2010 04:54, Ted Dunning <[hidden email]> wrote:
> Or you can include the test case in the same patch.  That almost guarantees
> you are far enough up the tree.
>
> And using the same name is actually good.  Don't bother to delete the old
> version, just upload with the same name.

I meant - if you attach a new patch containing just the unit test
code, then use a different name.

Re-using the name is recommended if the new version supersedes the old
one, but not otherwise.

> JIRA will show old versions in greyed out style.
>
> On Mon, Dec 6, 2010 at 7:51 PM, sebb <[hidden email]> wrote:
>
>> For example, it would be useful to have a test case that exercises the
>> new method.
>> This can be attached to the same JIRA (but with a different name, of
>> course).
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [math] Frequency getUniqueCount

Patrick Meyer
Ted and Sebb,

Thanks for all of the help! I look forward to submitting more contributions.

Thanks,
Patrick




>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>