AltME groups: search
Help · search scripts · search articles · search mailing listresults summary
world | hits |
r4wp | 1023 |
r3wp | 10555 |
total: | 11578 |
results window for this page: [start: 5701 end: 5800]
world-name: r3wp
Group: View ... discuss view related issues [web-public] | ||
Anton: 14-Aug-2005 | James, what do you want to do with your grid of toggles ? (sounds like could be used for an audio application, like drum patterns). Do you want them to have different texts and colors as well, etc. ? | |
james_nak: 14-Aug-2005 | Anton, again thanks for your expert help. What I am trying to do is to set up a grid that has 15 minute increments as toggles for a whole day. To make it easier for the user, I wanted to have the 4 columns: morning, afternoon,evening and night. Your program helped me with getting the rows to be different but the columns were the same. Just minutes ago the idea came to me that perhaps I have been approaching it all wrong and the simple answer (although not too elegant perhaps) was to just create 4 individual lists across. It works so now I can clean up my "scratch" app and move on to making the actual tool. Thanks Anton. You don't know how much you have helped. | |
Pekr: 15-Aug-2005 | I would like to ask, what aproach do others take? | |
Benjamin: 15-Aug-2005 | Hi there i recently had to do a job where i need to make use of read-net or read-thru because i needed to show a graph representing the amount of data beeing downloaded, but when it comes to write or save this is not possible because no callback is addmited, so i ask, is there a way to know how much data form a file has been uploaded or saved ? | |
Anton: 16-Aug-2005 | Sorry, need to update window.r probably. Do this: load-thru/update site/library/window.r | |
Anton: 22-Aug-2005 | Robert, you can see http://www.rebol.com/docs/view-system.html#section-10 for more insight on how pane functions work. An iterated face function is there to save memory, so it must be executed every time the display is refreshed. It creates the illusion of many faces by moving one face around very quickly. It does not create and position new faces like LAYOUT. What LAYOUT allows you to do is set up the pane function that will be used afterwards when SHOW is used or VIEW is used and events start flowing. | |
Geomol: 22-Aug-2005 | Anton, maybe this is to way to do it? It seems to work: change at image1 5x5 copy/part at image2 10x10 20x20 | |
Anton: 22-Aug-2005 | Yes, that is the way to do it. | |
Gabriele: 25-Aug-2005 | hmm, i think what your are trying to do is what the panel accessors do by default (warning: a bit bugged, but easily fixable) | |
Gabriele: 25-Aug-2005 | you could set the window accessor object to the default panel accessor objects, so that you can do the above with the window directly too. | |
Anton: 28-Aug-2005 | I'm expecting you're doing a show every time there is a scroller movement. What you want to do is check if the current row (ie. the one at the top of your list) has changed If so, show the list. If not, ignore. Not all the shows are necessary. | |
Volker: 28-Aug-2005 | Since customizing buttons comes sometimes up, i just found this link: http://www.rebol.com/how-to/btns-cust.html. Did not know that image can do that :) | |
Geomol: 29-Aug-2005 | Is there a way to draw a dot with the draw dialect? I'm looking for a way to do it with the draw dialect, and not just a poke in the image, so e.g. line-width will take effect. A line, where start- and end-point is the same, is not shown. A circle with radius 1 is not a dot, but slightly larger. Any ideas? | |
Anton: 29-Aug-2005 | I am sure Cyphre has this on his to do list already. | |
Henrik: 29-Aug-2005 | Is there any documentation on how the windowsXP-like buttons in View1.3 are made? They are bitmapped, right? I remember the community help that Carl had for making this over a year ago for the first betas. I will need this for some custom buttons for a project that I'm going to do; converting a fully graphical HTML GUI to VID while it keeps the same look. | |
Geomol: 30-Aug-2005 | That might be a good way to do it. Let's see... | |
Henrik: 30-Aug-2005 | Generic newbie-like question: I was spying on source request-dir and am baffled as to how it works? There are many function names, I can't seem to access directly, such as F-LIST and DIROUT. Where do they come from? request-dir: func [ "Requests a directory using a popup list." /title "Change heading on request." title-line /dir "Set starting directory" where [file!] /keep "Keep previous directory path" /offset xy ][ if block? dirout [ dirout: layout dirout max-dirs: to-integer f-list/size/y - 4 / f-txt/size/y center-face dirout ] set-face f-title any [title-line "Select a directory:"] if not all [keep path] [ path: copy either where [clean-path where] [what-dir] ] if all [not empty? path slash = last path] [remove back tail path] last-path: path result: none show-dir either offset [inform/offset dirout xy] [inform dirout] result ] | |
Pekr: 30-Aug-2005 | ... as for request-dir - today I saw another native one dialog. Dunno programmers do have to produce one themselves or not. It was with mySQL installation procedure. I looked like typical Windows request-file requestor, but it had set filter to "directory". Could anyone check on that, please? I really do not like that inconsistency in rebol ... | |
Henrik: 30-Aug-2005 | crude prototype, but it helped me find the file I had been looking for :-) I don't know how to do actual multi columns with the internal text-list. the plan was to allow scrolling (I can't get that working) and when you click on a search result, the file pops up in the viewtop editor. feel free to perfect it... | |
Geomol: 31-Aug-2005 | Good to know, Cyphre. And thanks guys! Preciate it. I hope, this 'little' project will turn out well. I need a DPaint program to do the graphics for a phone-game, I'm involved in. | |
Geomol: 1-Sep-2005 | There seem to be a small anomaly, when doing thick circles and ellipses, in the right side, where the circle/ellipse starts and ends. It may have something to do with "line-cap round", but if that is left out, there will be a tiny gap, when drawing really thick circles/ellipses. Maybe Cyphre should check it out!? | |
Geomol: 2-Sep-2005 | james_nak, uploaded new version with right-click for drawing black. I'll wait with possibility to choose right-click color, until I do GUI. | |
Geomol: 2-Sep-2005 | Problem in "Canvas" is, that I do lots of things depending on tool, when the mouse is pressed. That now also has to be done, when a key is being pressed. Not good. I'll make sure, you can't change tool while drawing. Will solve problem. | |
Geomol: 3-Sep-2005 | I don't have much time today, but next thing, I'll do, is to reimplement the brush, so different shapes are possible. And so you can select an area of the image as a brush. | |
Geomol: 8-Sep-2005 | What is a good way to check for certain values in an input field? Let's say, I want to do an integer field, I've tried this as the action function: if error? try [to-integer value] [set-face face 0] It works first time, but if I try enter an integer afterwards, it just get settet to zero again. Any ideas? | |
Pekr: 15-Sep-2005 | So, mostly, if you work with SQL, you try to find the right context of data, limiting your query as much as possible. Then you do a query, receive result and browse it. In that case, you already have all your data in rebol block already (unless you are reading them from port continuously), and it has nothing to do with SQL database anymore ... | |
MikeL: 15-Sep-2005 | Not using a cursor. Right key action increments current-record-key. Retrieves single row for current-record-key, Displays page with data for row retrieved. The database is local and only has (so far) 120 rows but I have another with three hundred shorter records (no BLOBs) on it and it works well without any wait. i.e. I can hold down the right key and it will flash each page by. MySQL protocol has always seemed very fast to me. Is it possible that View is stacking up the key actions and hanging after it gets too many? p.s. I don't want to read the whole database content into memory because then I have to worry about locking when I allow HTML updates to it by others. Single row updates with the last update 'winning' in the unlikely event of a collision works well for what I need to do. | |
james_nak: 15-Sep-2005 | Pekr, it actually didn't do a list. Instead it sent individual emails. Also I probed send and there is a '/show'' option that will replace the to: address. checking... | |
Pekr: 15-Sep-2005 | but there were cases , where I failed even inside of 'try block, maybe if function contains other functions, dunno ... I am really not an expert in all that throwing errors principles ... Ladislav or other folks here will do much better service to you :-) | |
Group: I'm new ... Ask any question, and a helpful person will try to answer. [web-public] | ||
Henrik: 21-Jun-2010 | >> do http://www.rebol.org/library/scripts/helloworld.r connecting to: www.rebol.org Script: "Great Computer Language Shootout : hello" (27-Sep-2005) hello world | |
BrianH: 21-Jun-2010 | It's unknown at this point whether DELECT will remain: The command-processing functionality of DELECT has been moved into DO-COMMAND. I'm guessing that DELECT will end up being a preprocessor that generates DO-COMMAND blocks; the wiki you mentioned says that a similar preprocessor is run on Draw blocks before they are sent to DO-COMMAND (the "For special draw dialects..." paragraph). | |
Fork: 26-Jun-2010 | Rebol could do this by default, but people screw up enough as it is. Is it worth the potential errors to allow this? Absolutely not... | |
Henrik: 26-Jun-2010 | what I do is normally wrap such code in an ALL block. NONE can mean so many things and it's best to trap a NONE where you know it appears during an operation that requires a series as input. | |
Steeve: 27-Jun-2010 | Yep, this discussion is recurring. There are pros and cons. I would like to know the opinion of Carl about this. #[none] could be a special "transient" value which impacts the behavior of DO . Allowing to passthru a chain of functions without breaking the flow. | |
BrianH: 27-Jun-2010 | And since REBOL can't see your reaction, it has to go by what you said to do, not what think you wanted it to do. | |
Fork: 27-Jun-2010 | I know what you mean, as appending none to a block does add a "none". Though APPEND [A B] NONE currently seems to do the same thing as APPEND [A B] 'NONE. I would be interested to know the side effects of saying APPEND [A B] NONE gave [A B] while APPEND [A B] 'NONE gave [A B NONE]. | |
BrianH: 27-Jun-2010 | What you said to do is append none to a string. By your reaction, you wanted to append an empty string to the string. That means this (assuming that you don't know that the none is there): >> append "mystring" any [none ""] == "mystring" The need for none to be explicitly converted to other values, rather than implicitly, is an intentional design choice that has been applied to a great deal of R3. It is not an error. | |
BrianH: 27-Jun-2010 | The trick for language design is not to get rid of idioms, but instead to do whatever you can to make possible to make simple idioms more powerful. This is usually done by making the different parts of the language fit together better, and and more flexibly. You get more flexibility by making the core concepts simpler, and then making them as widely and consistently applicable as you can without breaking them. Consistency is key here, and not just key in a positive way. More consistency means that you can fit more of the parts of the language together better. However, you have to limit consistency to places where it makes sense, and has real benefits. False consistency can get in your way. | |
BrianH: 30-Jun-2010 | Nice! But you have to do it in sections of 10 or less, due to the length of tuples; not a complaint, a gotcha to look out for. | |
jack-ort: 2-Jul-2010 | Hello - hope someone can find the newbie mistake I'm making here. Wanted to use REBOL to tackle a need to get data from Salesforce using their SOAP API. New to SOAP, WSDL and Salesforce, but using SoapUI mananged to do this POST (edited only to hide personal info): POST https://login.salesforce.com/services/Soap/u/19.0HTTP/1.1 Accept-Encoding: gzip,deflate Content-Type: text/xml;charset=UTF-8 SOAPAction: "" User-Agent: Jakarta Commons-HttpClient/3.1 Host: login.salesforce.com Content-Length: 525 <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:partner.soap.sforce.com"> <soapenv:Header> <urn:CallOptions> <urn:client></urn:client> <urn:defaultNamespace></urn:defaultNamespace> </urn:CallOptions> </soapenv:Header> <soapenv:Body> <urn:login> <urn:username>[jort-:-xxxxxxxxxxxxx-:-com]</urn:username> <urn:password>xxxxxxxxxx78l6g7iFac5uaviDnJLFxxxxx</urn:password> </urn:login> </soapenv:Body> </soapenv:Envelope> and get the desired response: HTTP/1.1 200 OK Server: Content-Encoding: gzip Content-Type: text/xml; charset=utf-8 Content-Length: 736 Date: Fri, 02 Jul 2010 20:32:14 GMT <?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns="urn:partner.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><loginResponse> ...... Then using SoapUI I am able to send a successful Logout message. Using REBOL 2.7.7.3.1, I created an "upload" string containing the POST block above without the "POST " at the beginning, set my url to: >> url == https://login.salesforce.com/services/Soap/u/19.0 and tried this: >> response: read/custom url reduce ['POST upload] but consistently get a Server 500 error: ** User Error: Error. Target url: https://login.salesforce.com:443/services/Soap/u/19.0 could not be retrieved. Se rver response: HTTP... ** Near: response: read/custom url reduce ['POST upload] For completeness, here's the upload value: >> print mold upload {https://login.salesforce.com/services/Soap/u/19.0HTTP/1.1 Accept-Encoding: gzip,deflate Content-Type: text/xml;charset=UTF-8 SOAPAction: "" User-Agent: Jakarta Commons-HttpClient/3.1 Host: login.salesforce.com Content-Length: 525 <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:partner.soap.sforce.com"> <soapenv:Header> <urn:CallOptions> <urn:client></urn:client> <urn:defaultNamespace></urn:defaultNamespace> </urn:CallOptions> </soapenv:Header> <soapenv:Body> <urn:login> <urn:username>[jort-:-researchpoint-:-com]</urn:username> <urn:password>metrics12378l6g7iFac5uaviDnJLFVprDl</urn:password> </urn:login> </soapenv:Body> </soapenv:Envelope>} Would appreciate any help you can give! | |
Gregg: 2-Aug-2010 | IIRC, I used a dash for empty cells. For export purposes, if you really need it blank, you may need to use a special value and then post-process it out. I don't know how to do a blank value right off either. All the normal tricks of NONE or () won't work in this context. | |
jack-ort: 2-Aug-2010 | everything I try seems to get taken as a literal value, so a dash will be a dash. Extra blank lines do not work, if that's what you mean by folded. | |
srwill: 1-Nov-2010 | I''m trying to understand this language, sometimes getting it, sometimes not. Anyway here's my question. In VID, I have a layout. I want to put random images in 3 columns with 5 rows. The images are stored together in a single binary file. (this is a mod of the card game on Nick's tutorial site). So I read in the images into a series, after I set the layout. But how do add those to the layout? Here's my current code: do %cards.r the-tableau: layout [ size 320x480 backdrop 0.170.0 across at 30x20 tc1: box 80x100 teal tc2: box 80x100 teal tc3: box 80x100 teal return at 30x130 tc4: box 80x100 teal tc100: box 80x100 coal tc5: box 80x100 teal return at 30x240 tc6: box 80x100 teal tc200: box 80x100 coal tc7: box 80x100 teal return at 30x350 tc8: box 80x100 teal tc9: box 80x100 teal tc10: box 80x100 teal ] foreach [card label num color pos] cards [ dimg: load to-binary decompress (card) append deck-cards dimg ;feel movestyle throw-away-label: label append deck-cards-num num append deck-cards-color color throw-away-pos: pos ] view/new the-tableau do-events | |
Maxim: 1-Nov-2010 | in REBOL all functions return a value, even if you do not use the return word (its actually better not to use return explicitely, since its faster) so the random-card function returns an image! from the card-images block. the set-face function applies the image to its default meaning for that style. | |
srwill: 1-Nov-2010 | ok. I think I understand that. So here's my new code, which doesn't work. random/seed now ;--include the binary card data do %cards.r the-tableau: layout [ size 320x480 backdrop 0.170.0 style tabstyle image 80x100 teal style holdplace box 80x100 coal across at 30x20 tc1: tabstyle tc2: tabstyle tc3: tabstyle return at 30x130 tc4: tabstyle tc100: holdplace tc5: tabstyle return at 30x240 tc6: tabstyle tc200: holdplace tc7: tabstyle return at 30x350 tc8: tabstyle tc9: tabstyle tc10: tabstyle ] lc: copy [] lc: [tc1 tc2 tc3 tc4 tc5 tc6 tc7 tc8 tc9 tc10] deck-cards: copy [] ; The deck holds all of the cards from the binary file deck-cards-num: copy [] deck-cards-color: copy [] foreach [card label num color pos] cards [ dimg: load to-binary decompress (card) append deck-cards dimg ;feel movestyle throw-away-label: label append deck-cards-num num append deck-cards-color color throw-away-pos: pos ] random-card: does [pick deck-cards random length? deck-cards] foreach c lc [set-face get c deck-cards] view/new the-tableau do-events | |
Maxim: 1-Nov-2010 | I've got important work to do right now, but if you can wait, I can give you a working solution later. | |
Maxim: 2-Nov-2010 | Note I added a bit of meat to the do-events topic raised by Graham, as an extra answer. and yes... it would be swell if you rate the answer as the final one (shameless I know, but worth the time and effort Me thinks ;-) | |
rjshanley: 24-Nov-2010 | Geomol's complex number library represents a workable approach to implementing a large integer math library. But has anyone already implemented one? That is, bc's ability to do +, -, *, and / on very large numbers? I've been trying to call bc from REBOL using the CALL stmt, but success has so far eluded me. | |
Gregg: 24-Nov-2010 | I have an old string-math lib. I don't remember how complete it is, but the basic ops should work. May no be applicable to what you want to do. | |
ChristianE: 29-Nov-2010 | Easy to see for example in code so simple as >> a: b: c: func [ ] [print "What's my name?"] >> do [a b c] | |
BrianH: 29-Nov-2010 | It is really quite similar to what a compiler for a language with lexical scoping does internally, but we do it at runtime instead. | |
mhinson: 22-Dec-2010 | Hi, I had to drive 100 miles to pick up my son nexpectedly. So my apologies for not responding straight away. Thanks very much for your responses. Gregg, I am not doing anything to send data to the session because I dont know how to I am afraid. you mention INSERT, but even after looking at the telent.r code I am afraid I can work out what to do. Steeve, the target device is a CIsco router so I think it would be happy with crlf or just cr I am afraid I will have to be off to bed now, but hopefully a few small pointers will get me thinking in the right direction. Thanks | |
mhinson: 23-Dec-2010 | I was confused by the insert function in the telnet scheme vs the use of INSERT in rebol but I have discovered that insert port "username" does what I was trying to do, looks like I need to sort out the crlf issues but I think I am getting somewhere with it now. I am also unable to identify the method to disconnect, the telnet RFC mentions an "Interrupt Process" code 244, bit I dont see that implimented in the code.. Thanks. | |
mhinson: 23-Dec-2010 | Thanks Greg. I didnt realise the Telnet scheme "port" concept was a Rebol generic thing, I mistakenly thought it was specific to the undocumented telnet scheme. Looks like I need to do a close port This is great, I am now getting somewhere. Thanks again for your help. Will R3 impliment telnet as a native? Or is it too soon to ask? | |
nve: 25-Dec-2010 | Question from ThomasP : how can I create a local SMTP server? the SMTP server should run in the background, I just do: set-net [127.0.0.1] to send my mail I find simulator SMTP server on the web, but no real server. | |
Maxim: 18-Jan-2011 | in the above you use cin ... do you expect the input to be piped ? | |
Henrik: 18-Jan-2011 | the console is for one-line inputs, if you want to type in your code directly. that interactive use of REBOL. the way you want to do this, is create a script in notepad, and run the script from the REBOL console | |
Henrik: 18-Jan-2011 | open a REBOL console and type: do %/path/to/test.r | |
alemar: 18-Jan-2011 | well guys i have to say the community works and i am pleasntly impressed.I am checking the libraries now and trying to get the script to work since i am getting ** Access Error: Cannot open /C/users/alemar/download/test.r ** Where: halt-view ** Near: do %/C/users/alemar/download/test.r i will figure it out eventually and i can get to real programing in this langueage** Access Error: Cannot open /C/users/alemar/download/test.r | |
Maxim: 18-Jan-2011 | the R2 console can actually act like a shell. in the latest release (2.7.8) they added posix style shortcuts to the various file operations directly... so you can do: >> cd %/C/users/alemar/download/ >> ls | |
alemar: 18-Jan-2011 | it`s barely 22:30 but i got a lot to do tommorow | |
Henrik: 8-Apr-2011 | In R2, you can do this: 1. get the body of the object as a block 2. find the word you want to remove 3. remove the word and its value coming right after 4. make a new object from the block | |
jack-ort: 11-Apr-2011 | BrianH said: "But you can create a new object without the field,...." Sorry to be especially dense, but do you mean create the new object from scratch, or based on the old object? I've seen the examples to create new from old and also adding fields, or resetting the value of an existing field, but never excluding old fields. I look forward to more documentation on "map!"; maybe I should move to R3. Last I checked, there was no GUI in R3, even the Windows version, despite what the download page says? One last newbie question for the day - will there be a 64-bit REBOL? I'm thinking my data could get rather large before too long. Thanks to all of you! | |
Ladislav: 11-Apr-2011 | Sorry to be especially dense, but do you mean create the new object from scratch, or based on the old object? - specially in this case he means the above example | |
JosDuchIt: 22-May-2011 | Can i use a bigger font? I can't reach the resize button to reduce the window somewhatt. How can this be done? Is it possible to do a search in a group or the whole of ta world? | |
JosDuchIt: 22-May-2011 | Seems i have a settings of 800 Looks OK to me. What 3d party browsers do exist? | |
MikeL: 5-Oct-2011 | todun - read http://www.rebol.com/docs/core23/rebolcore-6.htmlIt shows you how to handle a series. Getting to the End, backing up a character, and removing it might work. If you just want to remove the last character you can always do that in one simple line. Remember to save the full series from the head. If you are not sure the last character is a LF then you need to add a test ... still in the same line if you want to scrunch it. | |
todun: 5-Oct-2011 | how do I make the data loaded from the file change to another token in the file when I click another button? | |
todun: 5-Oct-2011 | @Pekr, to clarify. Using the right-click does show an Alert button that I have "copied to clipboard" but does not twll me what to do. | |
todun: 5-Oct-2011 | is there a way to make the ALTME push my message to you guys without having to do "CNTRL + S" all the time? | |
Geomol: 5-Oct-2011 | Some might want to use ! as NOT, like in other languages. You can do that by: >> !: :not >> if ! 2 > 4 [print "it's true"] it's true | |
Izkata: 5-Oct-2011 | Linux copy/paste: To copy from AltME to somewhere else, right-clicking on a URL will copy it to the clipboard, right clicking on text will copy the entire thing to the clipboard, or highlighting it and pressing CTRL + C will copy it to the clipboard. To paste it somewhere else, use the middle mouse button. To go from somewhere else to AltME, highlight the text (which automatically copies it), then in AltME press CTRL + V It's confusing because AltME accesses the X clipboard, and uses CTRL+C/CTRL+V to do so, while traditionally the X clipboard is just highlight to copy/middle-click to paste. CTRL+C/CTRL+V elsewhere on linux accesses a different clipboard | |
todun: 8-Oct-2011 | @Henrik, ok. I'm trying your first suggestion but it doesn't work. I'm trying to do the second one to see if it will work now.... | |
Henrik: 8-Oct-2011 | do you not want the DO block in the layout to be performed after FLASHCARD-PARSING? otherwise the questions-list.txt file is not generated in time. | |
Henrik: 8-Oct-2011 | based on its content, there is no reason to put the DO block in the layout. | |
todun: 8-Oct-2011 | I am not sure how to do these individual steps yet, but I actually do understand the gist of them. | |
todun: 8-Oct-2011 | @Henrik, ok. But I do want to explore the options you present because it meets my other goal of working with different data structures in rebol. | |
todun: 9-Oct-2011 | @Henrik, do you have any advice as to the sort of things I can be learning if I want to understand REBOL better? Like specific problem sets for instance.. The tutorials are good, but they don't seem to be getting across to me. | |
todun: 9-Oct-2011 | @Henrik, I do need to do a next in the button so that whenever the button is pressed, the next question comes up. Is there a way of "holding" the list so it doesn't move around while I try to modify it? | |
todun: 10-Oct-2011 | @Henrik, the error had to do with the view. I am putting that on hold for now. | |
Henrik: 10-Oct-2011 | With VID, each action should not be run, unless you are passing some kind of event to a face. you are probably describing your actions in blocks in VID, like this: button "hello" [do stuff here] it should not do anything outside it, unless you have set up a timer (which I doubt) or a FEEL (which I'm not sure you have learned yet), so there is probably something wrong in the action code that is run as you click your button. | |
Pekr: 10-Oct-2011 | todun - I am not a good programmer, so difficult to say :-) But - many ppl get into some gotchas, when using REBOL. Btw - do you know, that subobjects (objects inside objects) are shared? | |
Henrik: 10-Oct-2011 | it's simpler than one might think: if you have two objects, one made from the other: a: make object! [num: 5] b: make a [num: 7] if you do this without showing this part to another person, that person can't tell which object came first, only that two objects, A and B exist in memory. so there are no real prototypes. | |
DideC: 12-Oct-2011 | Could you also Pastebin a sample of %temp-cards.txt so we can test the code to see in action what you want it do do ? | |
james_nak: 15-Oct-2011 | Todun, just some of my thoughts. I think you are changing the order of the cards ito indicate the difficulty of a question. When you are saving the %temp-cards.txt, you are at a particular position in your series because of the "qa: next qa" so when you save/all it is saving the series from the current position to the end. If you want to save the whole series, you can add "head qa" which will bring the pointer back to the first item for the save but leave your pointer at the current question. It may help to do some simple tests: >> a: [1 2 3 4 5 6 7 8 9 10] == [1 2 3 4 5 6 7 8 9 10] >> a: next a == [2 3 4 5 6 7 8 9 10] >> save %test.txt a >> read %test.txt == "2 3 4 5 6 7 8 9 10" >> save %test.txt head a >> read %test.txt == "1 2 3 4 5 6 7 8 9 10" move/to a 5 == [6 7 8 9 10] >> save %test.txt head a >> read %test.txt == "1 3 4 5 2 6 7 8 9 10" etc. Also I like to add "probe" as in "probe qa" to different places in my code so I can see what is happening internally as I do stuff. Finally, might I suggest that you actually approach the issue in a different way altogether? You can have a block that has some metadata in it so that a question's difficulty can be assessed by other means such the word "hard" or some number such as 1 = easy and 10 = hard, for example. And allong with that you could keep track of how many times the person missed the question. [ 1 "California" "Sacramento" 1 1 0 1 ] where the block above refers to [ index Question Answer difficulty Attempts Wrong Correct] There's a lot more work to do this but if you can then search for the difficult questions, etc. Your program would control the order of the questions based on some filter such as difficulty, attempts. The user could just mark a question as difficult. Anyway, just a thought. I don't want to make your life hard and I need to go back to my own mess I started. I am in block-o-rama myself. | |
Sunanda: 24-Oct-2011 | The one thing you do not seem able to change is the [ continuation char | |
Ladislav: 24-Oct-2011 | use do read clipboard:// to input any number of lines | |
Duke: 24-Oct-2011 | @Sunanda I see! So the "[" character is simply a hint. Wouldn't it have been more intuitive to have used the "]" char - to indicate that an open '"[" needs to be closed?? I'm glad that the LISP REPL doesn't do this - not the ones that i use anyway :)) But thanks! You've cleared things up a bit.... | |
Ladislav: 24-Oct-2011 | But, OTOH, if you really do want to write an expression like 1 + 2 in the interpreter console, you can use this trick: do [ 1 + 2 ] | |
Duke: 24-Oct-2011 | @Ladislav Thanks for clearing that up! At the moment, I'm simply reading http://www.rebol.com/docs/words/wswitch.htmland trying out the snippets to do 2 things: 1. Learn to use the REBOL console 2. Learn REBOL syntax etc Entering those multiline snippets is what was a problem - until now. The console prints a "[" after each CR. For a noob, this chars looks and feel just like the ones IN the code. :)) | |
Sunanda: 24-Oct-2011 | here's a cheap'n'cheerful console replacement that concatenates an expression until it reads a blank line. Then it executes it. (Two blank lines to exit). Feel free to change the console prompt characters. my-con: func [ /local in-line in-buff err ][ forever [ in-buff: copy "" in-line: copy "" forever [ in-line: ask "In > " if in-line = "" [break] append in-buff join " " in-line ] if in-buff = "" [break] err: none if error? err: try [print ["Out > " do in-buff] true] [ print ["Oops > " mold disarm err] ] ] exit ] | |
Pekr: 24-Oct-2011 | Duke - I think that in fact it is not much of an issue? How often do you use multiline expression in REBOL interactive console session? It does not allow you to go back anyway, so ... | |
Duke: 24-Oct-2011 | @Ladislav [quote]do read clipboard://[/quote] I see! I'm on a Linux Xubuntu box - so I just highlight the text, and then right-click paste it into the REBOL console. I get to "see" the code, then the results, after a CR. Your method works OK, but all I get is the results -- don't seem like "a full meal deal" :)) Thanks ... | |
Duke: 25-Oct-2011 | I just did a "Help type? at the console, and got: TYPE? value /word Does this output not seem counter-intuitive to you guys? Especially when the syntax is: TYPE?/word/ value ; I used the / char to indicate an option This tells me that the type? word is followed by an optional refinement, but always needs a "value" - in that order. The console help output seems to have it reversed. What do you think? | |
Henrik: 25-Oct-2011 | So, why isn't it just the other way around, like in the help? You could in principle do that. It just gives you many more arguments that you would be forced to type. TYPE? could look like this: type? 5 word So, if you didn't want the refinement, you would have to type: type? 5 none For functions with many arguments, you would have to type something like: my-function 1 none none none none none none which is no fun to type directly. | |
Geomol: 25-Oct-2011 | I personally consider refinements to be one of the less stellar parts of REBOL. Henrik, do you prefer one additional function for each new way of calling a function, instead of refinements? | |
Ladislav: 25-Oct-2011 | I still think that the REBOL Help sub-system should reflect EXACTLY how the function should be written - this is easy. If you find a better way how to display the help, then simply propose it. In REBOL, it is easier to write the code, than to invent what the code should do. | |
Ladislav: 25-Oct-2011 | Aha, you tried to write something above. Well, I do not quite understand the stars you used - where should they be put? | |
Endo: 1-Dec-2011 | I'm also working on very similar to your case right now. I don't know if its useful for you but here how I do (on Windows) command: {csvde -u -f export.ldap -d "ou=myou" -r "(objectClass=user)" -s 10.1.31.2 -a "" "" -l "DN,sn,uid,l,givenName,telephoneNumber,mail"} call/wait/console/shell/error command %export.err ;export all users, bind annonymous if 0 < get in info? %export.err 'size [print "error" editor %export.err halt] lines: read/lines %export.ldap ;create an object from the first line (field names, order may differ from what you give in the batch) ldap-object: construct append map-each v parse first content none [to-set-word v] 'none foreach line lines [ ( set words-of o: make ldap-object [] parse/all line {,} append users: [] o ) ] ;append all valid users as an object to a block probe users I hope it gives some idea. | |
Endo: 8-Dec-2011 | ; use following to have the functionality. I have a very long script and I don't want to put it inside a IF block do-block: [ long long script ] foreach a b [ if any [a = 3 a = 5 ...] do-block] ;continue on other values of a. |
5701 / 11578 | 1 | 2 | 3 | 4 | 5 | ... | 56 | 57 | [58] | 59 | 60 | ... | 112 | 113 | 114 | 115 | 116 |