Re: [Factor-talk] May 5th

2021-05-12 Thread Sankaranarayanan Viswanathan
Thank you for the video! I enjoyed watching it, and they've done a great
job going over their work on compression and http2 support.

- Sankar

On Wed, May 12, 2021 at 4:47 PM John Benediktsson  wrote:

> For anyone that missed the session, or is interested in looking at the 20
> minute video portion of their presentation, you can look here:
>
> https://www.youtube.com/watch?v=lGWMNK5C5go
>
> Best,
> John.
>
> On Tue, Apr 20, 2021 at 9:04 AM John Benediktsson 
> wrote:
>
>> Hi everyone,
>>
>> We have a team of college students from Harvey Mudd College working on
>> some improvements to the Factor web frameworks, specifically implementing a
>> Factor native GZIP vocabulary and a HTTP/2 web server.
>>
>> They are going to discuss and present their results on May 5th at 9am PST
>> online via a Zoom session. It would be nice if anyone with interest would
>> come and listen and perhaps ask them about their work and future steps.
>>
>> Please write me back directly if you would like an invitation to this
>> session.
>>
>> Best,
>> John.
>>
> ___
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk
>
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] May 5th

2021-04-25 Thread Sankaranarayanan Viswanathan
Hello John,

I'm interested in participating as well.

Thanks!
Sankar

On Thu, Apr 22, 2021 at 2:57 PM Jon Harper  wrote:

> sure ! How long have they been working on it ? How much time do they have
> left ?
> Jon
>
> On Thu, Apr 22, 2021 at 1:51 AM cat via Factor-talk
>  wrote:
> >
> > I'm interested!
> >
> >
> >
> > ‐‐‐ Original Message ‐‐‐
> > On Tuesday, April 20, 2021 12:04 PM, John Benediktsson 
> wrote:
> >
> > Hi everyone,
> >
> > We have a team of college students from Harvey Mudd College working on
> some improvements to the Factor web frameworks, specifically implementing a
> Factor native GZIP vocabulary and a HTTP/2 web server.
> >
> > They are going to discuss and present their results on May 5th at 9am
> PST online via a Zoom session. It would be nice if anyone with interest
> would come and listen and perhaps ask them about their work and future
> steps.
> >
> > Please write me back directly if you would like an invitation to this
> session.
> >
> > Best,
> > John.
> >
> >
> > ___
> > Factor-talk mailing list
> > Factor-talk@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/factor-talk
>
>
> ___
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk
>
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] How to introduce factor to java programmers?

2017-06-16 Thread Sankaranarayanan Viswanathan
Glad you guys liked it. And, I did not notice that typo until you 
pointed it out - will fix.


Thanks,
Sankar


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] How to introduce factor to java programmers?

2017-06-16 Thread Sankaranarayanan Viswanathan

Hello Everyone,

Thank you for your inputs. In the end, I decided to focus on the aspects 
of Factor that I was most amazed by when I first discovered the language 
last year. I presented yesterday, and it was received well. I think I 
kindled the interest of a few people who attended.


The slide I went over are here:
https://github.com/viswans83/stack-based-languages-presentation

Thanks again,
Sankar


On 6/1/17 4:05 AM, Alexander Ilin wrote:

John, the question was specifically about the quotation parameter's
stack effects in general, i.e. `quot: ( x -- x )` vs. simply `quot` in
the parameter lists.

My take is that the quotation stack effects are not checked separately
on a per-parameter basis, only the word as a whole is checked. So, they
are merely for documentation purposes, and may be incorrect with no
penalty. From the documentation: "For words that are not inline, only
the number of inputs and outputs carries semantic meaning, and effect
variables are ignored."

http://docs.factorcode.org/content/article-effects.html

01.06.2017, 05:33, "John Benediktsson" <mrj...@gmail.com>:

Well, technically neither ``dip`` nor ``keep`` need those stack
effects, they are inlined which means the non-inline word that
includes them will have it's stack effect checked by the compiler for
correctness.

There are few reasons why we want to have the ".." variadic stack
effects, and those are useful in the stack-checker and visually for
documentation, but if you removed them and tried to compile a word
that was incorrect, it would give you a worse error message but still
give you an error.



On Wed, May 31, 2017 at 7:03 PM, Sankaranarayanan Viswanathan
<rationalrev...@gmail.com <mailto:rationalrev...@gmail.com>> wrote:

Thanks for the ideas John!

I have been looking at the collection of talks, and they've been
quite helpful. Your thoughts about discussing "Java like" things
makes a lot of sense and I think contrasting Factor's object
system with Java's should be a nice topic.

That said, I did run into a question preparing the slides related
to stack-effects. I noticed that some combinators do not specify
stack effects for quotation inputs.

e.g.
dip  ( x quot -- x )
keep ( ..a x quot: ( ..a x -- ..b ) -- ..b x )

Why does `dip` not need to specify the quotations stack effect,
but `keep` did? I suspect they also have something to do with the
inline word, but I'm not really sure. Could you explain?

Thanks,
Sankar



On 5/30/17 11:47 PM, John Benediktsson wrote:

We have a few "talks" that were given a number of years ago
(not all
code in them is up to date, but it's mostly good -- if you
have problems
updating the code let me know and I can help):

https://github.com/factor/factor/tree/master/extra/talks

https://github.com/slavapestov/boston-lisp-talk

https://github.com/slavapestov/emerging-langs-talk

You might find it interesting to discuss "Java-like" things, for
example, interfaces vs protocols:

public interface Foo {
String a();
int b();
}

   public class FooImpl {
public String a() { return "hello" } ;
public int b() { return 42 } ;
}

vs a protocol (two generic methods) and a concrete class that
implements
it...

GENERIC: a ( obj -- a )
GENERIC: b ( obj -- a )

TUPLE: foo ;
M: foo a "hello" ;
M: foo b 42 ;

Could also talk about ``SINGLETON:``, so instead of (plus or minus
thread safety):

public class Foo {
private static _instance = null;
public static Foo getInstance() {
if ( _instance == null ) { _instance = new Foo() };
return _instance;
}
}

vs.

SINGLETON: foo

So, touching on code generation and higher level concepts.

Maybe macros might be interesting?

Some other ideas from my blog, not sure of your audience's
interest:


https://re-factor.blogspot.com/2009/08/calculating-with-ebnf.html


https://re-factor.blogspot.com/2010/11/estimating-cpu-speed.html

https://re-factor.blogspot.com/2011/02/simple-rpg.html

https://re-factor.blogspot.com/2011/04/powers-of-2.html

https://re-factor.blogspot.com/2011/04/mail-with-gui.html


https://re-factor.blogspot.com/2011/07/concatenative-thinking.html

https://re-factor.blogspot.com/2011/07/one-liners.html

https://re-factor.blogspot.com/2011/08/printf.html

https://re-factor.blogspot.com/2012/02/readability.html


https://re-factor.bl

[Factor-talk] Adjust font sizes in Listener and Help Browser

2017-06-06 Thread Sankaranarayanan Viswanathan

Hi Guys,

Is there a way to increase the font-size of the UI globally?

Thanks,
Sankar


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] How to introduce factor to java programmers?

2017-05-31 Thread Sankaranarayanan Viswanathan

Thanks for the ideas John!

I have been looking at the collection of talks, and they've been quite 
helpful. Your thoughts about discussing "Java like" things makes a lot 
of sense and I think contrasting Factor's object system with Java's 
should be a nice topic.


That said, I did run into a question preparing the slides related to 
stack-effects. I noticed that some combinators do not specify stack 
effects for quotation inputs.


e.g.
dip  ( x quot -- x )
keep ( ..a x quot: ( ..a x -- ..b ) -- ..b x )

Why does `dip` not need to specify the quotations stack effect, but 
`keep` did? I suspect they also have something to do with the inline 
word, but I'm not really sure. Could you explain?


Thanks,
Sankar


On 5/30/17 11:47 PM, John Benediktsson wrote:

We have a few "talks" that were given a number of years ago (not all
code in them is up to date, but it's mostly good -- if you have problems
updating the code let me know and I can help):

https://github.com/factor/factor/tree/master/extra/talks

https://github.com/slavapestov/boston-lisp-talk

https://github.com/slavapestov/emerging-langs-talk

You might find it interesting to discuss "Java-like" things, for
example, interfaces vs protocols:

public interface Foo {
String a();
int b();
}

   public class FooImpl {
public String a() { return "hello" } ;
public int b() { return 42 } ;
}

vs a protocol (two generic methods) and a concrete class that implements
it...

GENERIC: a ( obj -- a )
GENERIC: b ( obj -- a )

TUPLE: foo ;
M: foo a "hello" ;
M: foo b 42 ;

Could also talk about ``SINGLETON:``, so instead of (plus or minus
thread safety):

public class Foo {
private static _instance = null;
public static Foo getInstance() {
if ( _instance == null ) { _instance = new Foo() };
return _instance;
}
}

vs.

SINGLETON: foo

So, touching on code generation and higher level concepts.

Maybe macros might be interesting?

Some other ideas from my blog, not sure of your audience's interest:

https://re-factor.blogspot.com/2009/08/calculating-with-ebnf.html

https://re-factor.blogspot.com/2010/11/estimating-cpu-speed.html

https://re-factor.blogspot.com/2011/02/simple-rpg.html

https://re-factor.blogspot.com/2011/04/powers-of-2.html

https://re-factor.blogspot.com/2011/04/mail-with-gui.html

https://re-factor.blogspot.com/2011/07/concatenative-thinking.html

https://re-factor.blogspot.com/2011/07/one-liners.html

https://re-factor.blogspot.com/2011/08/printf.html

https://re-factor.blogspot.com/2012/02/readability.html

https://re-factor.blogspot.com/2012/08/literate-programming.html

https://re-factor.blogspot.com/2013/10/rock-paper-scissors.html

https://re-factor.blogspot.com/2015/06/send-more-money.html

https://re-factor.blogspot.com/2017/02/711.html

Best,
John.











On Tue, May 30, 2017 at 8:14 PM, Sankaranarayanan Viswanathan
<rationalrev...@gmail.com
<mailto:rationalrev...@gmail.com>> wrote:

Hi Guys,

We have a developer community at where I work, and we do monthly
tech talks that usually last between 30 and 40 minutes. I presume
very few in that group have looked at stack based languages before,
and I've been wanting to do a small talk about Factor there.

After spending a week preparing slides, I'm having a bit of trouble
understanding what would be a meaningful scope for my talk. I really
want to touch upon a couple of aspects:
 - show what stack based code looks like (i.e. avoid naming
variables most of the time)
 - show that all syntax is just words, and that syntax is extensible
 - show a little of the help system
 - show a bit of the interactive development workflow (change,
refresh, test)

But, I'm suspecting before I even get here I might need to spend a
lot of time talking about stack-effects, combinators, and other
basics before they might get a feel for what factor code feels like.
And this I'm afraid might be a little too much to digest in a short
time. Words like dip, bi@ and sequence combinators like map seem
fundamental to work with factor, and I'm afraid a short presentation
might not be the best place to introduce these topics. But, without
them code examples are going to be hard to understand.

Any ideas?

Thanks,
Sankar



--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
<mailto:Factor-talk@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/facto

[Factor-talk] How to introduce factor to java programmers?

2017-05-30 Thread Sankaranarayanan Viswanathan

Hi Guys,

We have a developer community at where I work, and we do monthly tech 
talks that usually last between 30 and 40 minutes. I presume very few in 
that group have looked at stack based languages before, and I've been 
wanting to do a small talk about Factor there.


After spending a week preparing slides, I'm having a bit of trouble 
understanding what would be a meaningful scope for my talk. I really 
want to touch upon a couple of aspects:
 - show what stack based code looks like (i.e. avoid naming variables 
most of the time)

 - show that all syntax is just words, and that syntax is extensible
 - show a little of the help system
 - show a bit of the interactive development workflow (change, refresh, 
test)


But, I'm suspecting before I even get here I might need to spend a lot 
of time talking about stack-effects, combinators, and other basics 
before they might get a feel for what factor code feels like. And this 
I'm afraid might be a little too much to digest in a short time. Words 
like dip, bi@ and sequence combinators like map seem fundamental to work 
with factor, and I'm afraid a short presentation might not be the best 
place to introduce these topics. But, without them code examples are 
going to be hard to understand.


Any ideas?

Thanks,
Sankar


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


[Factor-talk] Slava's Factor blog - posts before 2005

2017-03-31 Thread Sankaranarayanan Viswanathan
Hi,

There's a lot of useful ans interesting information about Factor's 
evolution that is documented in Slava's blog. The earliest[1] post there 
is from 2005 which has a link to a jroller blog that isn't online 
anymore. Its not on the archive.org either.

Is the information from that blog still available somewhere? I'm 
interested in reading through the early evolution of Factor, and I think 
it would be useful to collect and keep the information in those old 
blog(s) alive somehow (with Slava's permission of-course).

Thanks,
Sankar

[1]: 
http://factor-language.blogspot.com/2005/09/welcome-to-my-new-weblog.html


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] Question about updating models in UI gesture handlers

2016-10-21 Thread Sankaranarayanan Viswanathan
Never-mind folks. Turned out to be a simple bug, my menu-items word did
not correctly return the items of the menu passed in.

Fixing that solved my issue :)

Thanks,
Sankar

On 10/21/16 12:16 AM, Sankaranarayanan Viswanathan wrote:
> Hi,
>
> I'm trying to use the models vocabulary in order to implement keyboard
> navigation on menus. I still have some work to do, but right now I have
> something like this:
>
> :: prepare-menu ( menu -- )
>   f  :> model
>   menu menu-items :> items
>   items [ model add-connection ] each
>   model menu model<< ;
>
> Here menu is a gadget that contains menu-item gadgets. I have a
> model-changed on my menu-item like this:
>
> M: menu-item model-changed
>   swap value>> over = >>selected? relayout-1 ;
>
> My menu-items inherit from button and have a gesture handler setup like
> this:
>
> : activate-item ( item -- )
>   dup find-menu set-control-value ;
>
> : inactivate-item ( item -- )
>   f swap find-menu set-control-value ;
>
> M: menu-item handle-gesture
>   [
>   {
>   { [ over mouse-enter? ] [ nip activate-item ] }
>   { [ over mouse-leave? ] [ nip inactivate-item ] }
>   [ 2drop ]
>   } cond
>   ] 2keep call-next-method ;
>
> The problem I'm having is that the model-changed doesn't seem to trigger
> at all on the menu-items as I mouse over them. I expected the following
> sequence of events:
> (1) mouse-enter on menu-item
> (2) gesture handler updates value on menu model
> (3) menu model triggers model changed on all menu-item(s)
> (4) menu-item(s) update their appearances based on model value
>
> I know for sure that:
>- the gesture handler is being invoked
>- the menu gadget has its model slot populated
>
> Is there any reason the model-changed might not be triggered? I see that
> set-model first checks its "locked?" slot before doing anything. Does
> the UI set "locked?" to true during the event handling?
>
> Thanks,
> Sankar
>
>
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>



--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


[Factor-talk] Question about updating models in UI gesture handlers

2016-10-20 Thread Sankaranarayanan Viswanathan
Hi,

I'm trying to use the models vocabulary in order to implement keyboard 
navigation on menus. I still have some work to do, but right now I have 
something like this:

:: prepare-menu ( menu -- )
 f  :> model
 menu menu-items :> items
 items [ model add-connection ] each
 model menu model<< ;

Here menu is a gadget that contains menu-item gadgets. I have a 
model-changed on my menu-item like this:

M: menu-item model-changed
 swap value>> over = >>selected? relayout-1 ;

My menu-items inherit from button and have a gesture handler setup like 
this:

: activate-item ( item -- )
 dup find-menu set-control-value ;

: inactivate-item ( item -- )
 f swap find-menu set-control-value ;

M: menu-item handle-gesture
 [
 {
 { [ over mouse-enter? ] [ nip activate-item ] }
 { [ over mouse-leave? ] [ nip inactivate-item ] }
 [ 2drop ]
 } cond
 ] 2keep call-next-method ;

The problem I'm having is that the model-changed doesn't seem to trigger 
at all on the menu-items as I mouse over them. I expected the following 
sequence of events:
(1) mouse-enter on menu-item
(2) gesture handler updates value on menu model
(3) menu model triggers model changed on all menu-item(s)
(4) menu-item(s) update their appearances based on model value

I know for sure that:
  - the gesture handler is being invoked
  - the menu gadget has its model slot populated

Is there any reason the model-changed might not be triggered? I see that 
set-model first checks its "locked?" slot before doing anything. Does 
the UI set "locked?" to true during the event handling?

Thanks,
Sankar


--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


[Factor-talk] Label issues with Hacktoberfest?

2016-10-04 Thread Sankaranarayanan Viswanathan
Hi Maintainers,

I came across this today: https://hacktoberfest.digitalocean.com and I'm 
hoping one of you could tag some of the issues with the label 
hacktoberfest as noted in the website.

I'm looking to win the free t-shirt, and sending in pull requests to 
factor seems like something I could do :-)

Thanks,
Sankar


--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] How would I solve this better in Factor?

2016-02-26 Thread Sankaranarayanan Viswanathan
Wow, your words are simple and fit in single lines. Do you write pseudo 
code that is more expressible in factor or do you write traditional 
imperative style pseudo code and then translate them to a factor 
representation?

Thanks,
Sankar

On 2/25/16 12:01 PM, Jon Harper wrote:
> "Hi,
> I wrote a basic o(n^4) solution to see how simple it could get. The
> code looks nice to me, but it's sllw :) like 1 hour on the 3200
> chars string.. http://paste.factorcode.org/paste?id=3843
>
> I noticed we have 1 function in common : remove-after-underscore. You
> can can see how head and when* make my implementation shorter (and
> more readable?)
>
> Cheers,
> Jon
>
>
> On Wed, Feb 24, 2016 at 5:50 AM, Sankaranarayanan Viswanathan
> <rationalrev...@gmail.com> wrote:
>> Hi,
>>
>> It had been awhile since I wrote any Factor code, so I was trying to
>> solve the following problem from reddit's dailyprogrammer subreddit:
>> http://bit.ly/1OtP8Qj
>>
>> The solution I came up with in Factor looks like this:
>> http://bit.ly/1PY8j98
>>
>> I struggled quite a lot coming up with this. Mainly in keeping things in
>> my head and figuring out what I needed to do to bring the stack in order
>> for the operations I was attempting..
>>
>> Coming from an iterative programming background (with a little bit of
>> exposure to functional programming), I find it quite hard to formulate
>> solutions in Factor. Can someone help me with tips on how they approach
>> writing code in Factor? What is your though process to turn a given
>> pseudo code into a factor program?
>>
>> For example, my pseudo code for the main portion of this problem (the
>> find-match function) was as follows:
>>
>> let buff = ""
>> let match = (indx=0, length=-1)
>> for each char c in input:
>>  find count(c) in buff
>>  if count == 2
>>  append c to buff
>>  check if str(first c to end) is longest and update match
>>  remove chars in buff before second c occurrence
>>  else if count == 1
>>  append c to buff
>>  check if str(first c to end) is longest and update match
>>  remove chars in buff before first c occurrence
>>  else
>>  append c to buff
>> discard buff and return match
>>
>> Any pointers is greatly appreciated.
>>
>> Thanks,
>> Sankar
>>
>>
>> --
>> Site24x7 APM Insight: Get Deep Visibility into Application Performance
>> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
>> Monitor end-to-end web transactions and take corrective actions now
>> Troubleshoot faster and improve end-user experience. Signup Now!
>> http://pubads.g.doubleclick.net/gampad/clk?id=272487151=/4140
>> ___
>> Factor-talk mailing list
>> Factor-talk@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/factor-talk
>
> --
> Site24x7 APM Insight: Get Deep Visibility into Application Performance
> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
> Monitor end-to-end web transactions and take corrective actions now
> Troubleshoot faster and improve end-user experience. Signup Now!
> http://pubads.g.doubleclick.net/gampad/clk?id=272487151=/4140
>



--
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151=/4140
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


[Factor-talk] How would I solve this better in Factor?

2016-02-23 Thread Sankaranarayanan Viswanathan
Hi,

It had been awhile since I wrote any Factor code, so I was trying to 
solve the following problem from reddit's dailyprogrammer subreddit:
http://bit.ly/1OtP8Qj

The solution I came up with in Factor looks like this:
http://bit.ly/1PY8j98

I struggled quite a lot coming up with this. Mainly in keeping things in 
my head and figuring out what I needed to do to bring the stack in order 
for the operations I was attempting..

Coming from an iterative programming background (with a little bit of 
exposure to functional programming), I find it quite hard to formulate 
solutions in Factor. Can someone help me with tips on how they approach 
writing code in Factor? What is your though process to turn a given 
pseudo code into a factor program?

For example, my pseudo code for the main portion of this problem (the 
find-match function) was as follows:

let buff = ""
let match = (indx=0, length=-1)
for each char c in input:
find count(c) in buff
if count == 2
append c to buff
check if str(first c to end) is longest and update match
remove chars in buff before second c occurrence
else if count == 1
append c to buff
check if str(first c to end) is longest and update match
remove chars in buff before first c occurrence
else
append c to buff
discard buff and return match

Any pointers is greatly appreciated.

Thanks,
Sankar


--
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151=/4140
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


[Factor-talk] help.markup: Add icon legend for link-icon?

2015-12-12 Thread Sankaranarayanan Viswanathan
Hi,

The browser tool shows vocabularies and words with different icons, and 
I thought it would be nice if we could show what the icons meant 
somewhere (or maybe the icons are already described somewhere and I 
couldn't find it). The icons themselves are present in 
basic:definitions.icons. Some implementation ideas I had were:

(a) Have a legend article and put a link in vocabs-docs. Maybe the 
definitions.icons doc could be modified to include a legend and a link 
to this put out on the vocabs-docs (e.g. a link named "Icon legend" 
under the existing "Vocabulary authors" link

(b) Show a tool-tip on hover over the icon. The tool-tip text could be 
derived from the icon file name. But, this might look misleading for the 
"open-vocab" icon since the user could be scratching his head expecting 
how to "open vocab" ;)

Let me know what sounds most reasonable and I can submit a pull request 
if we think having this makes sense.

Thanks,
Sankar


--
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] help.markup: Add icon legend for link-icon?

2015-12-12 Thread Sankaranarayanan Viswanathan
Ah, I did not look closely enough - the link is right there on the 
definitions.icons vocab docs!

Thanks,
Sankar

On 12/12/15 9:30 PM, John Benediktsson wrote:
> We should link the docs a bit better, but that does kind of exist:
>
> http://docs.factorcode.org/content/article-definitions.icons.html
>
> Also, we should probably improve those icons, hah.
>
> I think the tooltip might be confusing like you say, but if you want to
> try out the tooltip and see if it is awesome, go for it!
>
>
>
> On Sat, Dec 12, 2015 at 2:09 AM, Sankaranarayanan Viswanathan
> <rationalrev...@gmail.com
> <mailto:rationalrev...@gmail.com>> wrote:
>
> Hi,
>
> The browser tool shows vocabularies and words with different icons, and
> I thought it would be nice if we could show what the icons meant
> somewhere (or maybe the icons are already described somewhere and I
> couldn't find it). The icons themselves are present in
> basic:definitions.icons. Some implementation ideas I had were:
>
> (a) Have a legend article and put a link in vocabs-docs. Maybe the
> definitions.icons doc could be modified to include a legend and a link
> to this put out on the vocabs-docs (e.g. a link named "Icon legend"
> under the existing "Vocabulary authors" link
>
> (b) Show a tool-tip on hover over the icon. The tool-tip text could be
> derived from the icon file name. But, this might look misleading for the
> "open-vocab" icon since the user could be scratching his head expecting
> how to "open vocab" ;)
>
> Let me know what sounds most reasonable and I can submit a pull request
> if we think having this makes sense.
>
> Thanks,
> Sankar
>
>
> 
> --
> ___
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> <mailto:Factor-talk@lists.sourceforge.net>
> https://lists.sourceforge.net/lists/listinfo/factor-talk
>
>
>
>
> --
>
>
>
> ___
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk
>



--
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


[Factor-talk] images: new words to handle sprites and extract parts of an image

2015-11-29 Thread Sankaranarayanan Viswanathan
Hi,

For a small game that I was making in order to get accustomed to factor, 
I needed to load textures from a sprite sheet. Basically, I wanted to 
take an image and split it into pieces of fixed dimensions. I wasn't 
able to find words to help me there (may be there are and I am unaware). 
So I ended up introducing a few new words:

new-image-like: create a new empty image having properties of an 
existing image but with modified dimensions

image-part: extract a part of an image into a separate image

generate-sprite-sheet: given an image, produce a sequence of images 
having fixed width and heights

These new words can be seen implemented here: 
https://github.com/rationalrevolt/factor-practice/blob/master/images/sprites/sprites.factor

A small test program using these words is present here: 
https://github.com/rationalrevolt/factor-practice/blob/master/sprite-test/sprite-test.factor

If these are useful, could someone recommend a vocabulary that could 
contain them? The words new-image-like and image-part could reside in 
the images vocab. I'm not sure where the generate-sprite-sheet word 
could fit in or if it is sufficiently useful to include.

Thanks,
Sankar


--
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] Problem drawing an image in a new window

2015-11-29 Thread Sankaranarayanan Viswanathan
On 11/29/15 7:22 PM, Jon Harper wrote:
> There's an image-gadget implementation from images.viewer, maybe you
> should start from that and expand to get all the functionnality you
> need ?
>
> IN: scratchpad
> "resource:./misc/icons/factor_48...@2x.png"  gadget.
> "resource:./misc/icons/factor_48...@2x.png"  "image" open-window
>
> Jon
>
>
> On Sun, Nov 29, 2015 at 1:37 PM, Sankaranarayanan Viswanathan
> <rationalrev...@gmail.com> wrote:
>> Hi,
>>
>> Hi, i'm facing a problem drawing textures in a new window. when I
>> create the gadget and add it to the listener using gadget. the image
>> shows corretly, when I create the gadget and use open-window, the
>> image does not show up on the new window.
>>
>> Sample code below:
>>
>> TUPLE: i-gadget < gadget
>>  image texture ;
>>
>> :  ( path -- gadget )
>>  [ i-gadget new ] dip load-image >>image ;
>>
>> M: i-gadget pref-dim*
>>  image>> dim>> [ 20 + ] map ;
>>
>> M: i-gadget graft*
>>  dup find-gl-context
>>  dup image>> { 0 0 }  >>texture drop ;
>>
>> M: i-gadget ungraft*
>>  dup find-gl-context
>>  dup texture>> dispose
>>  f >>texture drop ;
>>
>> M: i-gadget draw-gadget*
>>  [ { 10 10 } ] dip texture>> [ draw-texture ]
>>  curry with-translation ;
>>
>> ! In the listener
>>
>> "vocab:images/sprites/game_drop.png"  gadget.
>>
>> ! the above works and shows the image in the listener
>>
>> "vocab:images/sprites/game_drop.png"  "i-gadget" open-window
>>
>> ! the above opens a new window but the image does not show
>>
>> What could I be missing?
>>
>> Thanks,
>> Sankar
>>
>>
>> --
>> ___
>> Factor-talk mailing list
>> Factor-talk@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/factor-talk
>
> --
>

I see that moving the texture creation code from graft* to draw-gadget* 
solves the issue. I'm wondering if this is a bug, since the 
documentation for graft* mentions that resources can be allocated on 
this method (and to use find-gl-context to ensure the correct GL context 
is setup before allocating the resources).

The modified the code shown below works correctly:

M: i-gadget graft*
 drop ;

M: i-gadget draw-gadget*
 [ { 10 10 } ] dip
 dup texture>> [ ]
 [ dup image>> { 0 0 }  >>texture texture>> ] ?if
 [ draw-texture ] curry with-translation ;

image-gadget seems to have been implemented in the same way though (i.e. 
setting up textures is done on the 1st call into draw-gadget*).

Thanks,
Sankar


--
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


[Factor-talk] Problem drawing an image in a new window

2015-11-29 Thread Sankaranarayanan Viswanathan
Hi,

Hi, i'm facing a problem drawing textures in a new window. when I
create the gadget and add it to the listener using gadget. the image
shows corretly, when I create the gadget and use open-window, the
image does not show up on the new window.

Sample code below:

TUPLE: i-gadget < gadget
image texture ;

:  ( path -- gadget )
[ i-gadget new ] dip load-image >>image ;

M: i-gadget pref-dim*
image>> dim>> [ 20 + ] map ;

M: i-gadget graft*
dup find-gl-context
dup image>> { 0 0 }  >>texture drop ;

M: i-gadget ungraft*
dup find-gl-context
dup texture>> dispose
f >>texture drop ;

M: i-gadget draw-gadget*
[ { 10 10 } ] dip texture>> [ draw-texture ] 
curry with-translation ;

! In the listener

"vocab:images/sprites/game_drop.png"  gadget.

! the above works and shows the image in the listener

"vocab:images/sprites/game_drop.png"  "i-gadget" open-window

! the above opens a new window but the image does not show

What could I be missing? 

Thanks,
Sankar


--
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] Problem drawing an image in a new window

2015-11-29 Thread Sankaranarayanan Viswanathan
Opened issue #1510

Thanks,
Sankar

On 11/29/15 8:01 PM, John Benediktsson wrote:
> That could be a bug, or maybe a side effect of the design. Would you mind 
> opening an issue on github for us to look into later?
>
> Thanks,
> John.
>
>> On Nov 29, 2015, at 6:10 AM, Sankaranarayanan Viswanathan 
>> <rationalrev...@gmail.com> wrote:
>>
>>> On 11/29/15 7:22 PM, Jon Harper wrote:
>>> There's an image-gadget implementation from images.viewer, maybe you
>>> should start from that and expand to get all the functionnality you
>>> need ?
>>>
>>> IN: scratchpad
>>> "resource:./misc/icons/factor_48...@2x.png"  gadget.
>>> "resource:./misc/icons/factor_48...@2x.png"  "image" 
>>> open-window
>>>
>>> Jon
>>>
>>>
>>> On Sun, Nov 29, 2015 at 1:37 PM, Sankaranarayanan Viswanathan
>>> <rationalrev...@gmail.com> wrote:
>>>> Hi,
>>>>
>>>> Hi, i'm facing a problem drawing textures in a new window. when I
>>>> create the gadget and add it to the listener using gadget. the image
>>>> shows corretly, when I create the gadget and use open-window, the
>>>> image does not show up on the new window.
>>>>
>>>> Sample code below:
>>>>
>>>> TUPLE: i-gadget < gadget
>>>>  image texture ;
>>>>
>>>> :  ( path -- gadget )
>>>>  [ i-gadget new ] dip load-image >>image ;
>>>>
>>>> M: i-gadget pref-dim*
>>>>  image>> dim>> [ 20 + ] map ;
>>>>
>>>> M: i-gadget graft*
>>>>  dup find-gl-context
>>>>  dup image>> { 0 0 }  >>texture drop ;
>>>>
>>>> M: i-gadget ungraft*
>>>>  dup find-gl-context
>>>>  dup texture>> dispose
>>>>  f >>texture drop ;
>>>>
>>>> M: i-gadget draw-gadget*
>>>>  [ { 10 10 } ] dip texture>> [ draw-texture ]
>>>>  curry with-translation ;
>>>>
>>>> ! In the listener
>>>>
>>>> "vocab:images/sprites/game_drop.png"  gadget.
>>>>
>>>> ! the above works and shows the image in the listener
>>>>
>>>> "vocab:images/sprites/game_drop.png"  "i-gadget" open-window
>>>>
>>>> ! the above opens a new window but the image does not show
>>>>
>>>> What could I be missing?
>>>>
>>>> Thanks,
>>>> Sankar
>>>>
>>>>
>>>> --
>>>> ___
>>>> Factor-talk mailing list
>>>> Factor-talk@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/factor-talk
>>>
>>> --
>>
>> I see that moving the texture creation code from graft* to draw-gadget*
>> solves the issue. I'm wondering if this is a bug, since the
>> documentation for graft* mentions that resources can be allocated on
>> this method (and to use find-gl-context to ensure the correct GL context
>> is setup before allocating the resources).
>>
>> The modified the code shown below works correctly:
>>
>> M: i-gadget graft*
>>  drop ;
>>
>> M: i-gadget draw-gadget*
>>  [ { 10 10 } ] dip
>>  dup texture>> [ ]
>>  [ dup image>> { 0 0 }  >>texture texture>> ] ?if
>>  [ draw-texture ] curry with-translation ;
>>
>> image-gadget seems to have been implemented in the same way though (i.e.
>> setting up textures is done on the 1st call into draw-gadget*).
>>
>> Thanks,
>> Sankar
>>
>>
>> --
>> ___
>> Factor-talk mailing list
>> Factor-talk@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/factor-talk
>
> --
>



--
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


[Factor-talk] Mutation on tuple instances

2015-11-26 Thread Sankaranarayanan Viswanathan
Hi,

I'm having trouble understanding the behavior below:

Running the code below on the listener:

TUPLE: test a b c ;
:  ( -- t ) { 1 2 } { 3 4 } { 5 6 } test boa ;
: f1 ( -- )  . ;
: f2 ( -- )  a>> [ [ 10 0 ] dip set-nth ] [ [ 20 1 ] dip set-nth ] bi ;

f1 
! outputs T{ test { a { 1 2 } } { b { 3 4 } } { c { 5 6 } } }

f2 f1 
! outputs T{ test { a { 10 20 } } { b { 3 4 } } { c { 5 6 } } }

Why is the mutation on a separate tuple instance impacting another?
Am I doing something incorrectly? 


Thanks,
Sankar


--
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741551=/4140
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


[Factor-talk] Error fetching https URLs: urls.secure not already loaded

2015-10-25 Thread Sankaranarayanan Viswanathan
Hi,

I'm running the latest factor (commit 753ebb15829543ecbef23fae8a7cbbf572d45225).

I was trying out the hacker-news vocab in extra, and I came across an error
running the hacker-news. 
word:
Generic word >secure-addr does not define a method for the inet class.
Dispatching on object: T{ inet f "hacker-news.firebaseio.com" 443 }

Following the definition of url-addr, I see towards the end of "urls.private"
vocab source code: { "urls" "io.sockets.secure" } "urls.secure" require-when

So, it seems like some thing was responsible to load "io.sockets.secure" (which
would have caused "urls.secure" to load) but did not.

So, in the listener, I load the vocab io.sockets.secure:
USE: io.sockets.secure
Looking at the output in the listener, I can see that loading this vocab 
caused "urls.secure" to load.

After this executing the hacker-news. word in the listener runs without error.

Is this a bug?

Thanks,
Sankar



--
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] Factor on OS X El Capitan broken?

2015-10-01 Thread Sankaranarayanan Viswanathan
I tried re-downloading factor-macosx-x86-64-0.97.dmg from the
factorcode.org site, but that shows the same problem. I then tried the
development release links for OS X, but those links seem broken. I
have yet to attempt to build from source..


--
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


[Factor-talk] Factor on OS X El Capitan broken?

2015-10-01 Thread Sankaranarayanan Viswanathan
Hello,

I just upgraded my macbook to El Capitan today, and the opening the
factor help browser seems broken.  I get the message:

An error occurred while drawing the world T{ world f ~array~ ~array~ f
f ~vector~ ~array~ ~debugger~ t t f  This world has been
deactivated to prevent cascading errors.  gl-error-tuple function f
code 1286 string "Invalid framebuffer operation"

Wondering if there's a newer binary for OS X?

Thanks, 
Sankar


--
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk