World: r3wp
[Rebol School] Rebol School
older newer | first last |
Vladimir 3-Oct-2007 [626x3] | But, why? Ohhhh why do I need to do it like that? :) |
I red part of docs (6.4 Focus and Keyboard Events) but it doesnt help......... Well so far I'm ok, my editor can move on.... :) | |
But I would love to know: How to set key press event on something so that it would be timed? Or how to make insert-event-func function get called in precise timed intervals? | |
Oldes 4-Oct-2007 [629] | insert-event-func is simply used for global events, you can use it to detect 'close, 'resize, 'active and 'inactive as well. Why you should have such a event handlers in feels? |
Vladimir 4-Oct-2007 [630] | I'm actually interested only in keypress events... But I have to limit the rate of events... I know there is the rate element in every face, and I did make it work for time event and that is ok. But I couldn't make keypress event occur in timed intervals. I'm not saying I have to have it. Maybe it just isnt supossed to be. But it says in docs: The focal-face must be set to a valid face object (one that is part of a pane in the face hierarchy) and the system/view/caret (explained in next section) must also be set in order to: 1. Receive keyboard events .... So I put this inside engage func: system/view/focal-face: face system/view/caret: tail "" And now it works... I dont even use caret but you have to set it to some bogus value! So in my opinion rate element has no influence on key events (if I type like crazy I get 19 key events for 1 second...). But I can make some sort of counter and simply do keypress response only when I want to... |
Gregg 4-Oct-2007 [631] | The event handling system will call your insert-event-func handler as fast as it can, if there are availalbe events, and there will always be time events, occurring at whatever rate REBOL uses them. I don't know of any way to control when, or how often, your func is called. |
Vladimir 4-Oct-2007 [632] | Its ok like this... :) I can make what ever I need for my editor using this method. I guess things will be more controllable in R3... Thanks again for help! |
Anton 7-Oct-2007 [633x2] | Vladimir, the window/feel gets time events at full speed. Any subface/feel gets time events at subface/rate. |
So, I advise to trap events in subface/feel/engage, not in window/feel or screen-face/feel. (insert-event-func adds a handler which is processed in screen-face/feel) | |
Vladimir 26-Oct-2007 [635] | What could be problem with this script? set-net [[user-:-mail-:-com] smtp.mail.com pop3.mail.com] today: now/date view center-face layout [ size 340x120 button "Send mail" font [size: 26] 300x80 [ send/attach/subject [user-:-mail-:-com] "" %"/c/file.xls" reduce [join "Today " :danas] quit ] ] I get this error: ** User Error: Server error: tcp 554 5.7.1 <[user-:-mail-:-com]>: Relay access denied ** Near: insert smtp-port reduce [from reduce [addr] message] Could it be some security issue? It worked with previous internet provider... A week ago we changed it and now this happens... Should I contact my provider to change some security settings or should I change something in the script? |
Pekr 26-Oct-2007 [636x3] | The problem probably is, that you are trying to send your email from outside of @mail.com domain. |
smtp servers usually don't allow you to send email via themselves, if you are not part of particular network, or they require authentication to smtp - usually your accont name and password is enough. I think that in such case, you are out of luck with REBOL. Not sure our smtp protocol can handle it ... but - go to www.rebol.org and try to search for "smtp" - there are some scripts which could help you .... | |
before you do so though, please try to configure your mail client (FireBird, Outlook), to see what kind of setting you are heading for, as the problem as well can be related to some other issue :-) | |
Vladimir 26-Oct-2007 [639x5] | I just set up outlookexpress and "my server requires authentication" is a problem.... |
:( | |
So this means my old provider was not that rigid on smtp control.... uffff.... :) | |
is there a way to give this user authentication data to it? Ill check rebol.org for that... | |
I would think someone else already came with a solution for such acommon problem.......... | |
Pekr 26-Oct-2007 [644] | try to look for esmtp. Usually there is a requirement for sending your user account name and pass. Hopefully you can find something ... |
Vladimir 26-Oct-2007 [645] | I found it! :) all you need to do is add info in set-net fields.... instead of this: set-net [[user-:-mail-:-com] smtp.mail.com pop3.mail.com] use this: set-net [[user-:-mail-:-com] smtp.mail.com pop3.mail.com none none none "user" "pass"] Im happy :) |
Pekr 26-Oct-2007 [646] | heh, I know there can be user and pass set, I just did not know it could be set via set-net, I always used max of 6 params for the function :-) |
Brock 26-Oct-2007 [647] | I thought the problem may have been that the first character following set-net is a "|" characther rather than theh "[", that must just be a typo. |
Vladimir 26-Oct-2007 [648x2] | Now it works... |
This functionality was not present in previous versions of rebol... I think it was introduced in some patch this year... By the way I dont know wich version of view I use on every other pc... one at home, one at work... laptop... I will download newest and update all.... :) Thanks for help... | |
Vladimir 29-Oct-2007 [650] | How complicated is it to make simple file transfer between two computers (one client and one server) in rebol? What protocol should I use? Any ideas? Currently I'm sending e-mails from clients with file-atachments because its the simplest way of collecting data from clients. (so far they were doing it by hand - so this is a big improvement :) |
Henrik 29-Oct-2007 [651] | how big files are you transfering? |
Gregg 29-Oct-2007 [652x2] | There are a lot of ways you could do it, FTP, LNS, AltMe file sharing, custom protocol on TCP. It shouldn't be hard, but I would try to use something existing. The devil is in the details. |
You could also write a custom app that sends via email, and a reader on the other end that grabs them. | |
Graham 29-Oct-2007 [654x2] | I've done file transfer using async Rebol rpc, and also using Uniserve |
I think Carl posted some code on how to do huge file transfers. | |
james_nak 30-Oct-2007 [656] | Here is something from the rebservices section from Gabriele: client has experimental generic http proxy support; server has the new, much improved file service. see http://www.rebol.net/rs/demos/file-client.r for example usage to transfer big files. |
btiffin 30-Oct-2007 [657] | Vladimir; Check out http://rebol.net/cookbook/recipes/0058.html for one way. It's a good exercise in getting a client server app running as well. And of course, follow the advice of the others here; there are many options. |
Vladimir 30-Oct-2007 [658] | Files are 1-2 Mb. Ziped archives of dbf files. As I said now I'm using small rebol script to send file as attachment, human on the other side is downloading them and unpacking them, and its working. I planed to make a "server" side script that would download newly arrived attachments and unpack them in designated folders, but then I thought about trying some real client-server approch... Then again, server would have to be started at the time of transfer. I have to know ip adresses and to make them public (hamachi jumps in as help)... E-mail used as buffer for data is not bad... And it works... But I have to check max mailbox size .... What if workers execute sending script more then ones? There is one strange thing with sending big (>1 Mb) files:: On win98 it goes without any problem. On XP at the end of transfer rebol returns an error message about network timeout, but the file is sent and all is ok.. Thanks guys... Lot of info... Will check it out and send my experiences. |
Ingo 30-Oct-2007 [659] | A script to send files over the network using tcp. It once started with 2 3-liners, http://www.rebol.org/cgi-bin/cgiwrap/rebol/view-script.r?script=remote-file.r |
Gabriele 30-Oct-2007 [660] | we're using rebol/services to transfer backups from www.rebol.net to mail.rebol.net. files are a couple hundred MB. see http://www.rebol.net/rs/demos/file-client.r |
Vladimir 28-Jan-2008 [661] | How can i convert content of dbf file to readable html file on webserver ? I thought to use rebol to make conversion, and then transfer html to server using ftp... Can someone point me in the right direction ? |
Gregg 28-Jan-2008 [662x2] | Francois Jouen did a DBF viewer some time back. I'm not sure if REBOLFrance is still up or not. I have the old code here. http://www.rebol.org/cgi-bin/cgiwrap/rebol/ml-display-thread.r?m=rmlQZKQ I thought it would be a nice thing to have, but never pursued it since I didn't *need* it. |
One thing REBOL isn't particularly good at is structured file I/O, which is what you need for DBF. Perfect job for a dialect though. :-) | |
Vladimir 28-Jan-2008 [664] | Should I make dbf dialect ? :) |
Pekr 28-Jan-2008 [665] | Gregg - don't forget you need to parse indices too :-) |
Oldes 28-Jan-2008 [666] | what do you mean with "structured file I/O"? |
BrianH 28-Jan-2008 [667] | File I/O with binary file structures needs better conversion facilities than REBOL has, at least to do efficiently. |
Gregg 29-Jan-2008 [668] | Vladimir, yes, if you need it. I think it would be a neat thing to have, but there hasn't been a rush of people clamoring for it. Petr, it can be done, it just won't be as much fun as it should be. :-) Oldes, Brian is correct. QuickBASIC/VB and PowerBASIC were well-suited to this task, because you could declare a type structure and get/put it directly. |
Vladimir 29-Jan-2008 [669] | There is only one file that needs to be put online..... Its 13 Mb big.... Anybody has some advice how to parse it in binary mode? |
Oldes 29-Jan-2008 [670x5] | I'm using this script to parse binary formats: http://box.lebeda.ws/~hmm/rebol/stream-io_latest.r |
Here is for example script for parsing AVI file using the %stream-io.r script: http://box.lebeda.ws/~hmm/rebol/avi_latest.rbut I use it to parse other formats as well | |
here is a version with some rebcode optimizations: http://box.lebeda.ws/~hmm/rebol/stream-io_rebcode_latest.r | |
The output (write functions) is not complete as I don't need it so much | |
I don't have any DBF file, but looking at spec, it should not be difficult to read it. | |
Pekr 29-Jan-2008 [675] | DBF is rather simple format. Not sure it would not be better to use some ODBC driver for it though. There is a problem with indices and memo files. There were several systems out there with different aproaches. E.g. Clipper implemented RDD - abstracted "replaceable database drivers", which took different strategies for indices and memo files. I am also not sure, that nowadays, there is any advantage in using DBF files against e.g. SQLite. |
older newer | first last |