Re: [Factor-talk] db.tuples and boolean types

2011-06-14 Thread Tadhg O'Meara
I tried this and it seems that 0 is treated as t. I guess because 0 is
not f. I think I might have to use an INTEGER instead of a BOOLEAN
type and that way I can select for 0 and 1.

Thanks.


On 14 June 2011 16:15, Fred Alger  wrote:
> I haven't tried this, but you might try passing a value that will get
> converted to FALSE at the database level, for example:
> [ T{ book { sold 0 } } select-tuples ] with-books-db
>

--
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


[Factor-talk] db.tuples and boolean types

2011-06-10 Thread Tadhg O'Meara
Hi,

How do you select-tuples from a db with a slot set to f? The help says
that "A SQL query is constructed from the slots of the exemplar tuple
that are not f." So for example the following won't work:

[ T{ book { sold f } } select-tuples ] with-books-db

Do you have to use two slots, sold and unsold, and select T{ book {
unsold t } }? Is there some other way that still lets you use
select-tuples?

Thanks,
Tadhg.

--
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] sqlite performance question

2011-04-21 Thread Tadhg O'Meara
That's great. It takes 0.3 seconds now. Thanks for the help.

On 21 April 2011 22:59, Andrey Onymov  wrote:
> Oh, realized there is with-transaction word only after sending the message.
> So it becomes
>
> : insert-test ( -- )
>          [
>              sqltest recreate-table
>              [ 100 [ sqltest new insert-tuple ] times ] with-transaction
>          ] with-sqltest-db ;
>
> On Fri, 22 Apr 2011 03:52:46 +0600, Andrey Onymov 
> wrote:
>
>> : insert-test ( -- )
>>          [
>>              sqltest recreate-table
>>              begin-transaction
>>              100 [ sqltest new insert-tuple ] times
>>              commit-transaction
>>          ] with-sqltest-db ;
>
> --
> Fulfilling the Lean Software Promise
> Lean software platforms are now widely adopted and the benefits have been
> demonstrated beyond question. Learn why your peers are replacing JEE
> containers with lightweight application servers - and what you can gain
> from the move. http://p.sf.net/sfu/vmware-sfemails
> ___
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk
>

--
Fulfilling the Lean Software Promise
Lean software platforms are now widely adopted and the benefits have been 
demonstrated beyond question. Learn why your peers are replacing JEE 
containers with lightweight application servers - and what you can gain 
from the move. http://p.sf.net/sfu/vmware-sfemails
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


[Factor-talk] sqlite performance question

2011-04-21 Thread Tadhg O'Meara
It takes about 6 seconds to insert 100 records into a sqlite db on my
Linux x64 system. Is sqlite normally that slow?

Thanks,
Tadhg

Here is the code I used:

USING: db db.sqlite db.tuples db.types ;

TUPLE: sqltest id ;

sqltest "SQLTEST" {
{ "id" "ID" +db-assigned-id+ }
} define-persistent

: with-sqltest-db ( quot -- )
"sqltest.db"  swap with-db ; inline

: insert-test ( -- )
[
sqltest recreate-table
100 [ sqltest new insert-tuple ] times
] with-sqltest-db ;

[ insert-test ] time

--
Fulfilling the Lean Software Promise
Lean software platforms are now widely adopted and the benefits have been 
demonstrated beyond question. Learn why your peers are replacing JEE 
containers with lightweight application servers - and what you can gain 
from the move. http://p.sf.net/sfu/vmware-sfemails
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] cond-case or similar word

2011-04-20 Thread Tadhg O'Meara
Thanks, that's great.

On 19 April 2011 23:14, Martial Boniou  wrote:
> Hi,
>
> I did a quick hack for this:
>
> MACRO: cond-case ( assoc -- )
>        [ dup callable? not
>                [
>                        [ first '[ dup @ ] ]
>                        [ second '[ drop @ ] ] bi 2array
>                ]
>                [ '[ drop @ ] ] if
>        ] map '[ _  cond ] ;
>
> I guess someone can do a better code by coding a more specific cond.
>
> my 2 cents...
>
> At Tue, 19 Apr 2011 20:49:51 +0100,
> "Tadhg O'Meara"  wrote:
>>
>> I'm looking for a word that's like cond but doesn't need all the dups
>> and drops for the simple case where you want to check various
>> properties of the object on the stack and call an appropriate
>> quotation. So instead of
>>
>> {
>>     { [ dup 0 > ] [ drop "positive" ] }
>>     { [ dup 0 < ] [ drop "negative" ] }
>>     [ drop "zero" ]
>> } cond
>>
>> I could use
>>
>> {
>>     { [ 0 > ] [ "positive" ] }
>>     { [ 0 < ] [ "negative" ] }
>>     [ "zero" ]
>> } cond-case
>>
>> I tried to write a cond-case word that adds the necessary dups and
>> drops to a cond assoc but this results in a error.
>>
>> USING: arrays combinators kernel quotations sequences ;
>>
>> : cond-case ( assoc -- )
>>         [ dup callable? not
>>                 [
>>                         [ first [ dup ] prepose ]
>>                         [ second [ drop ] prepose ] bi 2array
>>                 ]
>>                 [ [ drop ] prepose ] if
>>         ] map cond ;
>>
>> Error: Cannot apply “cond” to a run-time computed value
>> It also says cond is a macro.
>>
>> Any ideas?
>>
>> Thanks,
>> Tadhg
>>
>> --
>> Benefiting from Server Virtualization: Beyond Initial Workload
>> Consolidation -- Increasing the use of server virtualization is a top
>> priority.Virtualization can reduce costs, simplify management, and improve
>> application availability and disaster protection. Learn more about boosting
>> the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
>> ___
>> Factor-talk mailing list
>> Factor-talk@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/factor-talk
>
>
> --
> Martial Boniou
>
> --
> Benefiting from Server Virtualization: Beyond Initial Workload
> Consolidation -- Increasing the use of server virtualization is a top
> priority.Virtualization can reduce costs, simplify management, and improve
> application availability and disaster protection. Learn more about boosting
> the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
> ___
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk
>
>

--
Benefiting from Server Virtualization: Beyond Initial Workload 
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve 
application availability and disaster protection. Learn more about boosting 
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


[Factor-talk] cond-case or similar word

2011-04-19 Thread Tadhg O'Meara
I'm looking for a word that's like cond but doesn't need all the dups
and drops for the simple case where you want to check various
properties of the object on the stack and call an appropriate
quotation. So instead of

{
{ [ dup 0 > ] [ drop "positive" ] }
{ [ dup 0 < ] [ drop "negative" ] }
[ drop "zero" ]
} cond

I could use

{
{ [ 0 > ] [ "positive" ] }
{ [ 0 < ] [ "negative" ] }
[ "zero" ]
} cond-case

I tried to write a cond-case word that adds the necessary dups and
drops to a cond assoc but this results in a error.

USING: arrays combinators kernel quotations sequences ;

: cond-case ( assoc -- )
[ dup callable? not
[
[ first [ dup ] prepose ]
[ second [ drop ] prepose ] bi 2array
]
[ [ drop ] prepose ] if
] map cond ;

Error: Cannot apply “cond” to a run-time computed value
It also says cond is a macro.

Any ideas?

Thanks,
Tadhg

--
Benefiting from Server Virtualization: Beyond Initial Workload 
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve 
application availability and disaster protection. Learn more about boosting 
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] New here

2009-06-19 Thread Tadhg O'Meara
For me this FAQ was a helpful intro to the ideas behind stack languages:
http://www.latrobe.edu.au/philosophy/phimvt/joy/faq.html

2009/6/18 Emeka 

> Hello All,
>
> I'm new here and I would like to know where to start? i need  introductory
> materials and summary of what Factor is?
>
> Regards,
> Emeka
>
>
> --
> Crystal Reports - New Free Runtime and 30 Day Trial
> Check out the new simplified licensing option that enables unlimited
> royalty-free distribution of the report engine for externally facing
> server and web deployment.
> http://p.sf.net/sfu/businessobjects
> ___
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk
>
>
--
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] best way to search the documentation?

2009-05-14 Thread Tadhg O'Meara
Thanks.

One reason I've been using FUEL is that I prefer a dark background. Is
it possible to change the background/foreground colors of the UI? I'm
using Linux.

2009/5/14 Slava Pestov :
> Hi,
>
> In the UI listener, press F1 to open the help browser. Then type
> something to search for in the top-left 'search' field.
>
> Slava
>
> On Thu, May 14, 2009 at 2:42 PM, Tadhg O'Meara  wrote:
>> Hi,
>>
>> What is the best way to search the documentation? I was looking for an
>> infinity number and only found it after using grep from the command
>> line which I found a bit messy and hard to read.
>>
>> I'm using FUEL but I'm new to emacs as well so maybe there's some
>> emacs-fu that I'm not aware
>> of. If there's an UI based method I'd be interested in that too.
>>
>> Thanks,
>> Tadhg.
>>
>> --
>> The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
>> production scanning environment may not be a perfect world - but thanks to
>> Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
>> Series Scanner you'll get full speed at 300 dpi even with all image
>> processing features enabled. http://p.sf.net/sfu/kodak-com
>> ___
>> Factor-talk mailing list
>> Factor-talk@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/factor-talk
>>
>
> --
> The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
> production scanning environment may not be a perfect world - but thanks to
> Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
> Series Scanner you'll get full speed at 300 dpi even with all image
> processing features enabled. http://p.sf.net/sfu/kodak-com
> ___
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk
>

--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


[Factor-talk] best way to search the documentation?

2009-05-14 Thread Tadhg O'Meara
Hi,

What is the best way to search the documentation? I was looking for an
infinity number and only found it after using grep from the command
line which I found a bit messy and hard to read.

I'm using FUEL but I'm new to emacs as well so maybe there's some
emacs-fu that I'm not aware
of. If there's an UI based method I'd be interested in that too.

Thanks,
Tadhg.

--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk