Re: [Factor-talk] "group-by" word

2011-11-19 Thread John Benediktsson
You might also be interested in this blog post, which walks through how to
build a group-by word:

http://re-factor.blogspot.com/2011/04/group-by.html



On Sat, Nov 19, 2011 at 10:19 AM, Joe Groff  wrote:

> You can look at math.statistics:collect-by as a reference:
>
> USE: math.statistics
>
> { "hello" "hola" "ball" "scala" "java" "factor" "python" } [ length
> ] collect-by
>
>
> --
> All the data continuously generated in your IT infrastructure
> contains a definitive record of customers, application performance,
> security threats, fraudulent activity, and more. Splunk takes this
> data and makes sense of it. IT sense. And common sense.
> http://p.sf.net/sfu/splunk-novd2d
> ___
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk
>
>
--
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] "group-by" word

2011-11-19 Thread Joe Groff
You can look at math.statistics:collect-by as a reference:

USE: math.statistics

{ "hello" "hola" "ball" "scala" "java" "factor" "python" } [ length
] collect-by
--
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] "group-by" word

2011-11-19 Thread P.
Do it step by step - think about the steps you need to take.
I would first sort the array by length.
Then I would group them by length (look at the monotonic-split word for that).
That would be very close to what you want.

On Nov 19, 2011, at 12:49 PM, missingfaktor wrote:

> I want to write a word "group-by" that has following stack effect and 
> behavior:
> 
> Signature: 
> 
> : group-by ( seq quot -- alist ) (group-by-impl) ;
> 
> Input: 
> 
> { "hello" "hola" "ball" "scala" "java" "factor" "python" } [ length ] group-by
> 
> Output:
> 
> H{
>   { 5 { "hello" "scala" } }
>   { 4 { "hola" "ball" "java" } }
>   { 6 { "factor" "python" } }
> }
> 
> I tried this many times, but failed. Can someone please provide me an 
> implementation for this, preferably with an explanation?
> -- 
> Cheers,
> missingfaktor.
> 
> When you stand for what you believe in, you can change the world.
> 
> --
> All the data continuously generated in your IT infrastructure 
> contains a definitive record of customers, application performance, 
> security threats, fraudulent activity, and more. Splunk takes this 
> data and makes sense of it. IT sense. And common sense.
> http://p.sf.net/sfu/splunk-novd2d___
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk

--
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


[Factor-talk] "group-by" word

2011-11-19 Thread missingfaktor
I want to write a word "group-by" that has following stack effect and
behavior:

Signature:

: group-by ( seq quot -- alist ) (group-by-impl) ;

Input:

{ "hello" "hola" "ball" "scala" "java" "factor" "python" } [ length ]
group-by

Output:

H{
  { 5 { "hello" "scala" } }
  { 4 { "hola" "ball" "java" } }
  { 6 { "factor" "python" } }
}

I tried this many times, but failed. Can someone please provide me an
implementation for this, preferably with an explanation?
-- 
Cheers,
missingfaktor .

When you stand for what you believe in, you can change the world.
--
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] Where can I get this Factor Listener?

2011-11-19 Thread John Benediktsson
What about it is less convenient?

IIRC, one of the main motivations for the change was to show what the stack
looks like between computations, rather than just the current values.



On Sat, Nov 19, 2011 at 5:16 AM, missingfaktor
wrote:

> Where can I get the Factor Listener used in this video:
> http://www.youtube.com/watch?v=f_0QlhYlS8g?
>
> The one I downloaded from the project site is different and less
> convenient to use.
>
> --
> Cheers,
> missingfaktor .
>
> When you stand for what you believe in, you can change the world.
>
>
>
> --
> All the data continuously generated in your IT infrastructure
> contains a definitive record of customers, application performance,
> security threats, fraudulent activity, and more. Splunk takes this
> data and makes sense of it. IT sense. And common sense.
> http://p.sf.net/sfu/splunk-novd2d
> ___
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk
>
>
--
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] Where can I get this Factor Listener?

2011-11-19 Thread Joe Groff
On Sat, Nov 19, 2011 at 5:16 AM, missingfaktor
wrote:

> Where can I get the Factor Listener used in this video:
> http://www.youtube.com/watch?v=f_0QlhYlS8g?
>
> The one I downloaded from the project site is different and less
> convenient to use.
>

The listener you get now is the same one as in the video. The only
difference from the video is how the data stack is displayed. I think it
was changed so that the data stack would also be displayed during terminal
listener sessions.

-Joe
--
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


[Factor-talk] Where can I get this Factor Listener?

2011-11-19 Thread missingfaktor
Where can I get the Factor Listener used in this video:
http://www.youtube.com/watch?v=f_0QlhYlS8g?

The one I downloaded from the project site is different and less convenient
to use.

-- 
Cheers,
missingfaktor .

When you stand for what you believe in, you can change the world.
--
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk