World: r3wp
[Core] Discuss core issues
older newer | first last |
[unknown: 5] 2-Apr-2009 [13525] | http://softinnov.org/rebol/nt-services.shtml |
eFishAnt 2-Apr-2009 [13526] | Ask, and you shall receive. Knock and the door will be opened. Thanks, Paul! |
[unknown: 5] 2-Apr-2009 [13527] | Your welcome - thank Doc for the work on that. |
eFishAnt 2-Apr-2009 [13528] | I was going to thank God, but Doc will do. |
[unknown: 5] 2-Apr-2009 [13529] | Thanks them both! |
Geomol 4-Apr-2009 [13530] | I wrote: " --1:23 should be of type url!, shouldn't it?" Actually, it's not a valid url according to the definition: http://en.wikipedia.org/wiki/URI_scheme The scheme name consists of a letter followed by any combination of letters, digits, and the plus ( +"), period ("."), or hyphen ("-") characters; and is terminated by a colon (":")." So it should probably just be an invalid time. |
Janko 4-Apr-2009 [13531] | in R2.. can the object ( via make object! ) know the name ot itself somehow? |
Gregg 4-Apr-2009 [13532] | Only if you add it as a field yourself. |
Geomol 4-Apr-2009 [13533] | An object can refer to itself with SELF, like: o: make object! [a: 1 b: self/a] (maybe not a very useful example.) |
Janko 4-Apr-2009 [13534x2] | Gregg.. aha, yes that was the option if there is no way.. Geomol .. thanks I wasn't avare of self.. but this probably doesn't enable me to see my name either because name of the object is name of the word is was asigned too .. so even if I do >> probe self << I dont have it ... looks like I really need to add it as a field |
I wanted it for debugging and reporting purposes.. btw so I could get messages and see from which object they come from | |
Anton 4-Apr-2009 [13536x2] | a: b: c: make object! [val: 1] 3 words point to the same object. What should its name be? |
(Hypothetical question, obviously.) | |
Janko 4-Apr-2009 [13538] | yes :) I thought of it too ... I will try to make something like a object factory function so I won't have to repeat myself ... to not do big-dog: make dog-agent [ name: "big-dog" .... ] I will see |
Anton 4-Apr-2009 [13539x2] | I believe that since the extra information can so easily get out of sync with reality, that it will just end up causing problems for you. Better to accept that there is no "reverse lookup" (not a quick one, anyway) of objects to words, and just adjust your debugging method somehow. |
(Of course, it depends what you're doing. If you can be strict with managing the objects, then it could be alright. I'd avoid it, though. Less is more, usually.) | |
Graham 4-Apr-2009 [13541x3] | more timezone issues. Switched clocks back last night as daylight savings ended. now still says we are at +13:00 even though we are now +12:00 ... and my PC clock is correct. |
If I turn off adjust for daylight savings in the vista clock settings, then 'now says we are at +12:00 | |
This is really annoying :( | |
Henrik 4-Apr-2009 [13544] | so Vista has clock problems too? very odd. |
Graham 4-Apr-2009 [13545] | well, if anyone is on Vista, and wants to try, just set your timezone to New Zealand and set to automatic daylight savings adjustment. |
Graham 10-Apr-2009 [13546x4] | Anyone got a script to encode html entities ?s |
this is this | |
encode-html: func [ "Make HTML tags into HTML viewable escapes (for posting code)" text ][ foreach [from to] ["&" "&" "<" "<" ">" ">" {"} """ "'" "'" "€" "€" ] [ replace/all text from to ] ] | |
but I think I have to encode accented characters as well ... | |
Ammon 10-Apr-2009 [13550] | Yeah, you need to be escaping a lot more than just those characters to really do it right. I can't help you with building the table of escapes, but this version should be a lot faster if you're escaping large quantities of text... encode-html: func [ "Make HTML tags into HTML viewable escapes (for posting code)" text ][ parse/all text [ any [ h: #"&" (h: change/part h "&" 1) :h | h: #"<" (h: change/part h "<" 1) :h | h: #">" (h: change/part h ">" 1) :h | h: #""" (h: change/part h """ 1) :h | h: #"'" (h: change/part h "'" 1) :h | h: #"€" (h: change/part h "€" 1) :h | skip ] ] text ] |
PeterWood 10-Apr-2009 [13551] | I have one which converts iso-8859-1 to html and escapes characters where necessary. |
Ammon 10-Apr-2009 [13552] | Are you using Parse in that Peter? |
PeterWood 10-Apr-2009 [13553] | Yes |
Ammon 10-Apr-2009 [13554] | Sweet. Is it available on REBOL.org? |
PeterWood 10-Apr-2009 [13555] | Not yet. It is part of some encoding utilities that I am writing to help resolve the character encoding issues in REBOL.org. I have a number of other conversion functions to wrtie. I will then publish them on REBOL.org |
Ammon 10-Apr-2009 [13556] | Good to know. I'll be watching for them! |
Graham 10-Apr-2009 [13557x2] | me 2 |
Ammon, 'replace is native .. are you sure parse will be faster? | |
Dockimbel 10-Apr-2009 [13559] | Graham: you can find such function in Cheyenne sources in %UniServe/libs/html.r. It supports iso-8859-1 entities. |
Ammon 10-Apr-2009 [13560] | Yes. I've tested it heavily. Well, not this particular implementation but one that's a lot similar. |
Dockimbel 10-Apr-2009 [13561] | 'replace is not native in R2. |
PeterWood 10-Apr-2009 [13562] | Romano once wrote "if you need speed, parse is you friend. Smart fellow Romano, much smarter than me. So I'd never question parse's speed. |
Graham 10-Apr-2009 [13563x3] | oops .. stand corrected. |
doc .. didn't notice/remember that you had those as well. | |
Especially since I using it in a rsp page ... | |
Gabriele 10-Apr-2009 [13566] | if you can wait for it (release does not depend on me), i have any-charset to utf-8 and utf-8 to html (and vice-versa, with support for all known named entities as well) |
PeterWood 10-Apr-2009 [13567] | Any idea how long the waitt may be? |
Oldes 10-Apr-2009 [13568] | very long.. I think such a messages comes already very long time. |
Dockimbel 10-Apr-2009 [13569] | Graham: you should look at the RSP doc more often : http://cheyenne-server.org/docs/rsp-api.html#def-25 ;-) |
Graham 10-Apr-2009 [13570] | In my defence, I was looking for encode-html which is a verb, whereas html-encode is not clearly such :) |
Dockimbel 10-Apr-2009 [13571] | You're right, having the verb first is more rebolish. |
Gabriele 11-Apr-2009 [13572] | Peter: does not depend on me. The code is ready for release (actually, there is one thing i have to do first, but it should take a couple hours max), so it could happen "tomorrow" or in two months. |
PeterWood 11-Apr-2009 [13573] | Thanks, Gabriele. I'll probably go ahead and try to build something for use in the Library system but will happily stop work when your code is released. |
Henrik 14-Apr-2009 [13574] | Is there documentation anywhere for using [catch] in a function header? It's a nice trick, but I can't figure out how it was deduced that this would work: f: func [[catch] var] [ if var = 'bad [throw make error! "Something bad happened."] ] I first saw Gabriele doing it a while ago. |
older newer | first last |