r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[Core] Discuss core issues

btiffin
6-May-2007
[7802]
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
[7803]
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
[7804]
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.  :)
Anton
7-May-2007
[7805x5]
Henrik:
result: [] 
foreach word first system/words [
	if value? in system/words word [
		type: type?/word get in system/words word 
		either blk: select result type [
			append blk word
		][
			repend result [type reduce [word]]
		]
	]
]

print ["actions:" length? result/action! "natives:" length? result/native! 
"funcs:" length? result/function!]
actions: 120 natives: 137 funcs: 238
(and don't forget op!)
Brian, Gregg, in electronics, which of high and low voltage is considered 
"true" and "false" can be different in each circuit.
Henrik
7-May-2007
[7810x2]
anton, interesting, thanks
does RENAME not support renaming dirs?
Pekr
7-May-2007
[7812]
RENAME - new name for Rebol :-) Rename your toolset :-)
Maxim
7-May-2007
[7813x2]
I would have thought someone would have suggested 
Do
cause you just want to DO stuff.
btiffin
7-May-2007
[7815]
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"?
Sunanda
7-May-2007
[7816]
RT seem happy the word function in both cases:
http://www.rebol.com/docs/dictionary.html
Perhaps we have to distniguish two types: native and mezzanine.
btiffin
7-May-2007
[7817x2]
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.  ;)
In this case, (I'm doc'ing the timer and timing related scripts) 
I think I'll go verbose.
BrianH
7-May-2007
[7819x2]
As long as you don't elaborate on the differences between natives, 
actions and ops on every reference to functions of any of those types, 
then it is cool to use the term "native" to refer to all of those. 
The only things that matter about the difference between native and 
REBOL functions are the speed of natives and the available source 
code of REBOL functions.
IMHO
btiffin
7-May-2007
[7821x2]
Thanks for the opinion Brian.  Noted.
I can usually get away with the expression 'utility' when doc'ing 
the library scripts, but
I don't want to slip up too many times.  :)
BrianH
7-May-2007
[7823]
I usually reserve "utility" for standalone scripts, not library functions.
btiffin
7-May-2007
[7824x2]
A lot of the library scripts are "stand alone".  Hopefully that situation 
will change as we
progress.
We (well some smarter guys) are hard at work defining a real library 
function library :)
BrianH
7-May-2007
[7826]
I don't mean scripts from the script library, I mean functions that 
are meant to be part of an API.
btiffin
7-May-2007
[7827x2]
Yeah, understood.  Right now I'm putting up Usage docs for the more 
'fluffy' rebol.org 
entries.  Meaty docs should start soon.
Fluffy may me the wrong term.  There is a lot to learn in the samples.
Chris
8-May-2007
[7829]
>> any-function? :now
== true
TimW
10-May-2007
[7830]
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
[7831x2]
looks like the double quotes are throwing load/markup off
so it thinks the rest is a big string inside the tags
Gregg
10-May-2007
[7833]
If that's the case, check RAMBO and submit it if it isn't there already.
Anton
10-May-2007
[7834x2]
We should try to isolate the problem first.
A huge bunch of html isn't very useful. Can you make a small example 
of the problem.
Gregg
10-May-2007
[7836x3]
>> load/markup {<span id="xprofimg"">}
== [{span id="xprofimg"">}]
Looks like it can't load it, so just returns the whole thing, unparsed, 
as a string.
Because of the trailing open quote. Remove that and it parses.
Anton
10-May-2007
[7839]
Good Gregg. This issue came up years ago. Load/markup only accepts 
perfect input.
TimW
10-May-2007
[7840]
Well, that's what I was afraid of.  Thanks guys.  I'll just have 
to parse it another way.
Oldes
10-May-2007
[7841]
I never found load/markup useful for getting data from html content... 
using just parse is faster and safer
btiffin
10-May-2007
[7842]
TimW;  Haven't tried it, but check mdlparser.r in the rebol.org library. 
 It make work
round some of the problems.
Anton
10-May-2007
[7843]
Yes, you can't rely on html to be well-formed. In my web data extractors, 
I found that brutish, direct methods required less code and were 
less brittle than methods that tried to parse each html tag correctly.
TimW
10-May-2007
[7844]
Well, I guess I'll just parse the string.  I'll check out the other 
script as well.  Thanks.
Anton
10-May-2007
[7845x2]
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!
So I usually look for short key strings which are unlikely to change 
to jump ever closer to the data I need.
TimW
10-May-2007
[7847]
Yeah, I was actually parsing on the div class sections, but I can 
just as easily ''parse on the class names.  I just liked being able 
to get to the data by throwing the tags away like [thru <div class="x"> 
any tag! copy data string! to end].
Brock
10-May-2007
[7848x4]
I do the same as Anton.  Grab the smallest unique text to bracket 
the content you want using parse first.  I then use load/markup to 
get at the other bits.
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.
here's an example of the type of content I am trying to effectively 
parse.
http://www.nhl.com/nhl/app?service=page&page=Schedule