• Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

AltME groups: search

Help · search scripts · search articles · search mailing list

results summary

worldhits
r4wp5907
r3wp58701
total:64608

results window for this page: [start: 37801 end: 37900]

world-name: r3wp

Group: Core ... Discuss core issues [web-public]
Henrik:
6-May-2007
A question: Does anyone know the ratio of mezzanine vs. native functions 
in a standard REBOL/View 1.3.2? I'm trying to use that as a statistical 
argument of how much of REBOL 2 is currently open source. :-)
Sunanda:
6-May-2007
These two lines get you close to a answer
  help function!
  help native!

May also need to count various things in the system object as available 
source (not quite *open* source)
btiffin:
6-May-2007
Hi,  I've been pondering electrical circuits.  Should NOT none return 
none?

low voltage NOT should be high, high voltage NOT should go low, but 
a zero voltage NOT should be no volts? No?
btiffin:
6-May-2007
Yeah, I was looking at that.  The output wire I have on a NOT circuit 
is always lit.  I
have to test for "no input" along with the 1's and 0's.  :)
Gregg:
6-May-2007
I would say a zero voltage is zero volts which, in that domain, might 
be called a lack of voltage, or no voltage. i.e. a REBOL none value 
is not the same as no voltage, but you might have a NONE? func in 
that domain that means "zero? volts".
btiffin:
6-May-2007
I'm coding an interactive half-adder circuit today.  The NOT gate 
outputs are lit even

if the "circuit" doesn't have any virtual power running through it. 
 Easy to work round

but this was more of a theoretical.  :)  In real life, a NOT gate 
doesn't go high for
no-volts, only low-volts no?  I don't know enough.  :)
btiffin:
7-May-2007
Terminology question.  For proper REBOL terms, now is a native!  
But is it a misnomer

to say function?  The question came up as I'm trying to describe 
now/time.  Can I

say function, or is it more properly the verbose "time refinement 
of the now native"?
btiffin:
7-May-2007
I'm aiming a lot of the Usage docs at beginners, but I don't won't 
to pollute the purity
of the terminology too soon in their careers.  ;)
btiffin:
7-May-2007
A lot of the library scripts are "stand alone".  Hopefully that situation 
will change as we
progress.
btiffin:
7-May-2007
We (well some smarter guys) are hard at work defining a real library 
function library :)
btiffin:
7-May-2007
Fluffy may me the wrong term.  There is a lot to learn in the samples.
TimW:
10-May-2007
Well, I didn't know where to ask this, so maybe here is a good place.
x: load/markup http://www.xanga.com/timwylie/588202056/item.html

then look at x/211, It's a big chunk of tags.  Why?  The only issue 
I can see is that the first tag at 211 has two quotes in a row.  
Any help in fixing this problem?
Henrik:
10-May-2007
so it thinks the rest is a big string inside the tags
Anton:
10-May-2007
A huge bunch of html isn't very useful. Can you make a small example 
of the problem.
Gregg:
10-May-2007
Looks like it can't load it, so just returns the whole thing, unparsed, 
as a string.
Anton:
10-May-2007
One of the problems is that the format of web pages changes often. 
Web developers don't hand out any guarantee that the format of their 
data in a html page is going to be in the same place all the time. 
eg. I can' t always go to the second table inside the fourth row 
of the third outermost table to get my data, because after all that 
navigation, they might just rearrange the data into the third table 
of the second row of the second outermost table. Arg!
Brock:
10-May-2007
I was actually thinking of building a dialect to extract the data 
that I want, but not certain how to proceed with this as each row 
of the table I need to grab although similar is always missing the 
odd element so using element /x will not always give me the same 
data.  I have found approx 10 variations in the data for the tables 
I'm trying to pull the data out of, so not sure if that is the best 
way or not.  Any advice would be great.
Brock:
10-May-2007
I was using the length of the returned block after the load-markup, 
but I would likely be better off defining a simple parse statement 
to grab the contents of the rows.
btiffin:
10-May-2007
Brock;  Check out Daniel's rebol.org submissons...  mdlparser, quickparser 
and 
rblxelparser.  Might be a few hints and tips.
Terry:
12-May-2007
I have a question.. 

What's the best way to iterate through a hash/dict! etc looking for 
values to multiple keys with the same name  ie:

n:[one "test1"  two "test2"  one "test3"]

where it returns an array of all 'one' key values?
btiffin:
12-May-2007
Of course, you'd want a copy  :)
btiffin:
12-May-2007
During a Sunanda ML contest, someone came up with a parse solution 
to compacting

...it was fairly blazing in speed, but I got busy after phase one 
of the contest and didn't 
follow as close as I would have liked to.

Check http://www.rebol.org/cgi-bin/cgiwrap/rebol/ml-display-thread.r?m=rmlPCJC
for some
details...watch the entries by Romano, Peter and Christian.
The winning code ended up in

http://www.rebol.org/cgi-bin/cgiwrap/rebol/view-script.r?script=rse-ids.r

It's not the same problem set, but parse seems to be a bit of a magic 
bullet, speed
wise.
btiffin:
12-May-2007
Terry;  Sunanda's contest was using  the parse technique on some 
very large

indexes...for skimp.  A foreach solution was actually the fastest 
for a teenie window of

time, until Romano posted the parse winner.  But...it was a different 
problem set.

It was a very informative contest in terms of efficient REBOL coding.
Terry:
12-May-2007
These don't feel right. .. looking for the equiv. of  SQL's  "select 
value where key = 'one'" .. Isn't rifling through a 100mb hash table 
using parse similar to rifling through an un-indexed SQL table?
Terry:
12-May-2007
The rse-ids.r  file seems what Im looking for .. need to have a play.
btiffin:
12-May-2007
Yep.  You could sort, find first, find last and copy the range?  
But that introduces sort...

There is a blog entry about hash! but we have to wait till R3.  RSN.


Yeah, there was some high-level optimizing going on for that res-ids 
little beauty.  :)
Terry:
12-May-2007
What do you use for the key? a word value .. 'one ?
Terry:
12-May-2007
Im tryin real hard to get my simple data into a Rebol hash table, 
or blocks.. whatever.. but it seems like traditional Relational DB 
is the way to go.. even used only as a flat file DB :(
Chris:
12-May-2007
; This may slow things down a little:

select-all: func [block [any-block!] key /locals result val fork][
    result: copy []
    parse block [
        any [
            thru key fork:

            (fork: pick [[set val skip (append result val)][]] even? index? fork)
            fork
        ]
    ]
    result
]
btiffin:
12-May-2007
I'm a little confused... what word limit are you bumping into?  I 
thought the limit was

only for set-words?  Can't blocks have any number of symbols inside? 
 Until ram
is gone...
Tomc:
12-May-2007
knowing more about how it will be accesses inser delete moce selecr 
would help choose a stratagey
Terry:
12-May-2007
if everytime you do a 'write' you need to sort 400mb file.. i would 
say yeah
Terry:
12-May-2007
My data is structured using a semantic network model..  entites.. 
ie:

tweety   isa   canary
canary   isa  bird
Terry:
12-May-2007
so currently its stored as entity - attribute - value  in a single 
db table using 3 cols
Terry:
12-May-2007
(lots of arguments out there regarding EAV as DB model...  most say 
it cant be done.. I say rubish.. works beautifully on a university 
project currently at 3 million rows of data)
Tomc:
12-May-2007
I am wondering if you have a smallish number of relationship types 
 if splitting  into EA tables  getes you anything
btiffin:
12-May-2007
I do REBOL with pretty small datasets.  Could be  I just did a test 
of 1'020'000, but
I was inserting the same word with a number...not unique words.
Chris:
12-May-2007
Is there a need to maintain three columns, over say -- (bird [haspart 
feathers]) or (bird haspart/feathers)
Terry:
13-May-2007
any benchmark docs comparing certain functions with others?  ie: 
  foreach [ a b c ]  n..  vs   forskip n 3   ?
Henrik:
13-May-2007
well, forskip is a mezzanine. you'd want fast loops to be done with 
natives like foreach
Tomc:
13-May-2007
Joel Needly  et .al. used to bench mark all sorts of things on the 
mail list a few years back .tthe benchmarks would likely need to 
be redone with current versions of rebol
Ladislav:
13-May-2007
benchmarking: my site contains a very accurate block execution time 
measurement function
Ladislav:
13-May-2007
(and I have got a benchmark there measuring overall speed using a 
couple of algorithms - they are derived from a Byte benchmark published 
in june 1988) - we are quite a bit faster than the C language was 
on an average computer back then :-p)
btiffin:
13-May-2007
Ladislav;  I hope you don't mind, but I put a link to %timblk.r in 
a lot of the rebol.org
timing script documents.

Check http://www.rebol.org/cgi-bin/cgiwrap/rebol/documentation.r?script=timeit.r#toc-4
for a sample.
Terry:
14-May-2007
Any ideas on the best way to escape javascript as a Rebol string.. 

It's not uncommon to have double quotes, single quotes and curly 
braces in a single line  ie:


<a href="" onclick="$('mydiv').alpha({transparency:50%});"> Fade</a>
Terry:
14-May-2007
FYI .. built a block with 1 million  (random 1000000) integers then 
ran a forskip myblock 3   vs  foreach[ a b c ] myblock
forskip time:  0:00:02.828
foreach time: 0:00:00.046
Volker:
14-May-2007
and a parse-rule.
Anton:
14-May-2007
Terry, the reason is foreach is native and forskip is a somewhat 
heavier mezzanine which calls WHILE to do its work. See Henrik's 
comment above.
BrianH:
14-May-2007
Not being able to escape { in strings is a bug, by the way.
Volker:
14-May-2007
a ^{ is enough of course, but must be escaped for the ""
Volker:
15-May-2007
The ^ is filtert out by the loader, in the string is only a {
Terry:
15-May-2007
yeah, but what happens when you send that to a web page?
Oldes:
15-May-2007
isn't this a little bit strange?
Henrik:
15-May-2007
does anyone have a function to calculate the age of a person exactly? 
I need maximum precision in that his birthday is correct every time.
btiffin:
15-May-2007
There is a rebol.org script that prints age to the second.  New user 
wrote it so it

assumes you were born at midnight.   %now.r  Probably needs a pro 
touch up.
Gregg:
15-May-2007
Where does it produce incorrect results? Do you have a good test 
case or two. I think stuff I've done is based on the same simple 
concept.
Gregg:
15-May-2007
days-between: func [date-1 [date!] date-2 [date!]][
    return date-1 - date-2
]

persons-age: func [
    "Return a persons age, in years."
    b-day [date!]
    /precise   "Include decimal portion of age."

    /days      "Return result as how many *days* old the person is."

    /yrs-days  "Return result as number of years and days (2 item block)."

    /on        "Use alternate date instead of current date, to figure 
    age."
        date
    /local result
][
    date: any [date now]
    if days     [return days-between date b-day]
    if precise  [return (days-between date b-day) / 365.25]

    if yrs-days [return compose [(to-integer date - b-day / 365.25)(date 
    - b-day // 365.25)]]

    ; otherwise, take away 1 year if their birthday hasn't come yet this 
    year.
    return date/year - b-day/year - either any [
        (date/month > b-day/month) all [

            (date/month = b-day/month)(date/day >= b-day/day)]] [0][1]
]
Gregg:
15-May-2007
Yes, it's mine. Well, either it's mine or I forgot to keep a credit 
for it, which I'm usually pretty good about. :-)
Henrik:
15-May-2007
seems to be missing by a day here...
Geomol:
17-May-2007
Is there a loader for Targa images (.tga)? Does it require a license 
to support the Targa format? Does anybody know?
Geomol:
17-May-2007
I need a REBOL->C converter. I spend hours programming in C to do 
something, it'll take minutes to do in REBOL.
Sunanda:
17-May-2007
R3 runs as a DLL......Car showed his basic development C script at 
DevCon.

It was abouy 12 lines of C, the heart of it being a call to REBOL, 
passing a string to be DOne.
That may be all you need to run REBOL from C with R3.
Geomol:
17-May-2007
It's not actually that, I'm after. In this project I need all the 
speed, I can get, so I do it in C, but it's a lot of time spent. 
I was thinking about a dialect in REBOL, that can be converted to 
C and compiled. That way it should be possible to produce C source 
a lot faster, than I do now.
Geomol:
17-May-2007
Something like:
[img: load-image/tga %gfx/image.tga]

The converter should then convert that to a lot of C source, that 
I can compile with gcc.
Rebolek:
17-May-2007
I wrote a dialect that is converted to C and compilable. It just 
covers basic math operations though, as that was all I needed. No 
pointers stuff and so on. But if you're interested to expand it, 
I can publish it somewhere (not sure how ugly the code is, didn't 
touch that in year or so).
Geomol:
17-May-2007
Rebolek, thanks for the offer, but I haven't got the time right now. 
Maybe it'll be a good idea to take this idea up, when R3 is released 
with rebcode. Then it'll be the right time to check the possibilities 
regarding performance.
Jerry:
17-May-2007
D is a good language.
btiffin:
17-May-2007
See http://www.rebol.org/cgi-bin/cgiwrap/rebol/documentation.r?script=view-html.r
for
a little blurb on D.  It is a good language...
TimW:
17-May-2007
Is there a way to change the format of to-date?  In oracle you can 
specify to-date(field, 'MM-DD-YYYY') and I need to read in a lot 
of dates that are in MM/DD/YYYY, but to-date assumes it's DD/MM/YYYY. 
 I also have dates that are Month DD, YYYY.
Gregg:
17-May-2007
parse-simple-date: func [
	"Parse a string containing a date value; return a date! value."
    date [any-string!]

    /def-day def-d [integer! word!] "Default day for mm/yyyy format. 
    Number or 'last."
    /local dig sep d m y set-def-day tmp-dt
][
    dig: charset [#"0" - #"9"]
    sep: charset " -/."
    set [d m y] none
    set-def-day: does [
        d: any [
            all [integer? def-d  def-d]
            all [
                'last = def-d
                foreach fld [d m y] [set fld to integer! get fld]
                tmp-dt: subtract make date! reduce [1 m + 1 y] 1
                tmp-dt/day
            ]
            1
        ]
    ]
    ; assuming mm/dd/yy or mm/yy format
    ; Do we really want to use PARSE/ALL here?
    either parse/all date [

        [copy m 1 2 dig  sep  copy d 1 2 dig  sep  copy y 1 4 dig]
        | [copy m 1 2 dig  sep  copy y 1 4 dig  (set-def-day)]
    ][
        foreach fld [d m y] [set fld to integer! get fld]
        ; add century if necessary; window from 1926-2025
        if y < 100 [y: add y pick [1900 2000] y > 25]
        ; swap day and month if it makes sense
        if all [m > 12  d <= 12] [set [m d] reduce [d m]]
        make date! reduce [d m y]
    ][none]
]


set 'date-val func [
	"Do everything possible to convert a value to a date."
    date

    /def-day d [integer! word!] "Default day for mm/yyyy format. Number 
    or 'last"
    /local res
] [
    if any-string? date [trim date]
    any [
        all [date? date  date]
        parse-simple-date/def-day date any [d 1]
        attempt [to date! date]
    ]
]
btiffin:
17-May-2007
Yeah, my exposure to D is less than a month old, but I'm becoming 
quite a fan of
Walter.
btiffin:
17-May-2007
Umm, my exposure is still cursory.  But it's been working great under 
GNU/Linux.

Samples are sparse, but building.  iirc, the first release was January 
2007.
OS X support with through a gcc front/back end
TimW:
18-May-2007
foo: func[a[integer!]][switch[a][ 1["one"] 2["two"]]]  If you change 
it to switch[2] it will always return "two", so why doesn't the switch 
work when using a parameter?
Graham:
18-May-2007
anyone got any timestamp routines ?  digits only - no alpha - eg 
seconds since a partciular time?
Oldes:
18-May-2007
btw... this is my favourite example of non compilable Rebol code: 
 b: [a b c] b/(print length? read http://rebol.comrandom 3)
Gabriele:
18-May-2007
now try to change the meaning of PRINT after the f: does b line, 
or maybe change DOES so that b is interpreted as a dialect...
Gabriele:
18-May-2007
it's much easier to just have a compilable dialect that is used in 
tight loops and so on.
Dockimbel:
18-May-2007
a simple not-compilable code example :  a/b
Dockimbel:
18-May-2007
with 'a defined at runtime, could be object!, function!, string!, 
block!, etc...
BrianH:
18-May-2007
Compilation doesn't necessarily mean ahead-of-time - it could be 
at runtime or function creation time. Type inference could handle 
a/b.
Dockimbel:
18-May-2007
well, but the meaning (and so the datatype) of 'a and 'b can change 
during runtime, even a JIT can have a hard-time tracking those changes, 
don't you think so ?
BrianH:
18-May-2007
You are thinking that a/b means what a.b means in other languages 
- it doesn't. You can use type inference and partial evaluation to 
make it reduce to some simple behavior in many cases.
Dockimbel:
18-May-2007
how do you infer the type of 'a in such case :
Dockimbel:
18-May-2007
c: call-function-returning-a-logic-value
a: make pick [object! block!] c [b: 1]
a/b ??
BrianH:
18-May-2007
Rewrite the pick to an either and move the a/b into both code blocks.
Sunanda:
18-May-2007
Probably 90% of all rebol code is compilable. 

There may be some speed improvements if code was identified as such, 
eg....
        a: func/compilable [a b] [return add a b]

....could (in effect) inline the (current) assembler code for 'add 
and 'return....So if they change value, this code continues unchanged.

But what would we have saved? One level of lookup. Is it worth it?
BrianH:
18-May-2007
I've been telling people, unless the compiler is really smart, don't 
expect too much of a speedup.
Dockimbel:
18-May-2007
Brian, do you really think that one could write a usable compiler 
being able to handle such (too ?) specific cases ? How about that 
:
Dockimbel:
18-May-2007
c: call-function-returning-a-logic-value
list: call-function-returning-a-list-of-datatype ; (1 <= n < ??)
a: make pick list c [b: 1]
a/b ??
Dockimbel:
18-May-2007
do you think that a JIT could determine the type of 'list and 'c, 
and be able to take adequat decision regarding how he should handle 
'pick ?
btiffin:
18-May-2007
BrianH;  I like to idea of using a REBOL to rebcode dialect.  JIT 
for developing.
Pre "compiled" for released scripts.
Dockimbel:
18-May-2007
I guess that only a (small?) subset of REBOL semantic rules can be 
compiled to rebcode or native code. Maybe Brian has already defined 
that subset during his research.
BrianH:
18-May-2007
There is nothing really sacrosanct about the DO dialect's semantics. 
A compilable dialect could have different semantics that would be 
similar enough at the high level for most programmers to not have 
to change most of their code.
BrianH:
18-May-2007
RT did something similar when they switched from R1 to R2. They switched 
from a Scheme-like engine to a Forth-like engine and most code was 
able to run without changes.
BrianH:
18-May-2007
Doc, my research has been put on hold waiting for R3. I can't justify 
using REBOL as a primary platform at work until I can make it integrate 
better with Microsoft technologies. Plus, they put rebcode on hold 
before they resolved the security/stability issues.


This research is going to have to be a spare-time thing for me for 
now, and I won't have any of that until after summer.
Volker:
18-May-2007
For one, i dont do stuff like in Gabrieles examples, dso if they 
perform terrible, i dont worry :)

For the ability, hotspot can do the following: it analyses the current 
code, sees, the is a virtuall call . but only one class with that 
method. and inlines the method. Later more code is loaded. now there 
are two classes, and the call must be really dispatched. Yes, it 
can change the code. I think that is somewhat similar to GAbirles 
changing of 'print.

For a/b, self did that long ago. it started with very flexible code, 
which checkt for object function and so on. keept track of what really 
occured. and generated optimized versions for the common cases. some 
runtime-checks for types, and branching to the quick version most 
of the time. quite fast results.
BrianH:
18-May-2007
Native library access to C is not enough, I need fast COM and .NET 
integration. Now that the DLR is out I may be able to implement the 
.NET stuff, when I get the time. With plugins and user-defined data 
types I could integrate COM. Mostly I would like to use /Services 
and I can't unless I can call them from .NET, or serve up .NET services 
to REBOL quickly. I think the lower overhead compared to SOAP would 
be a plus, but it has to be seamless, and as fast as local services 
when running on the same machine.
BrianH:
18-May-2007
Cross-platform is not a problem for me - I can use Mono if I need 
to.
BrianH:
18-May-2007
It would also be a plus to have proper WinCE support, as many of 
the people I support are running it in their cell phones. J2ME would 
be good for many others.
BrianH:
18-May-2007
Well, SynCE will help if I am connecting to WinCE from a non-Windows 
machine, but the ActiveSync program is already doing the connection 
on Windows, so I will have to integrate with that. Same on the WinCE 
side.
37801 / 6460812345...377378[379] 380381...643644645646647