Carl's Blog Alert
[Most Recent Entries]
[Calendar View]
[Friends]
Below are the 20 most recent journal entries recorded in
carlsblogalert's LiveJournal:
[ << Previous 20 ]
| Saturday, June 24th, 2006 | | 1:30 am |
Carl's Blog Alert
Sat, 24 Jun 2006 0:07:42 Copy and Checksum Large FilesLast week I wrote a short example of how to use checksum ports, and last year I gave an example of how to use the /seek refinement to deal with large files. The code below combines these two concepts in a function that copies a file, even if the file is larger than memory (e.g. MPG, MP3, WAV). It will also compute and return the checksum of the file's data. This is a robust "commercial quality" file copy function that you can use in your applications. If you find a bug, please let me know and I will correct it here. REBOL [ Title: "Copy File with Optional Checksum" Author: "Carl Sassenrath" License: 'MIT ] copy-file: func [ "Copy a file. Return WORD for failure or return optional checksum." from [file!] dest [file!] /sum "checksum the data" /local data path ff ; from file port tf ; to file port ][ path: split-path dest foreach [block err-word] [ [make-dir/deep path/1] dir-failed [ff: open/binary/read/seek from] read-failed [tf: open/binary/write dest] write-failed [if sum [sum: open [scheme: 'checksum]]] sum-failed [ while [not tail? ff] [ print index? ff data: copy/part ff 100000 insert tail tf data if sum [insert sum data] ff: skip ff length? data ] ;print index? ff ] copy-failed ][ if error? try block [ if port? sum [close sum] if tf [close tf] if ff [close ff] return err-word ] ] data: none if sum [ update sum data: copy sum close sum ] close tf close ff data ; checksum value or none ] print copy-file/sum %movie.mpg %movie2.mpg ask "done" ---Notes: #The code has only been tested on REBOL 2.6.2. The code requires a newer REBOL that supports the /seek refinement (Core 2.6). #If you are new to REBOL, note the way the foreach is used to perform error checking for each step and return the appropriate error word for failures. #The make-dir line is correct as written. If you do a source on make-dir you will see that it becomes a no-op if the dir exists. Adding an additional exists? check is not needed. #The "from file" (ff) is opened with /read access. This is done to cause an error if the file cannot be opened. Without it, the file will open as an empty file, even if it does not exist. #The checksum port defaults to the SHA1 (secure hash) algorithm. #The code remembers to close the ports if an error occurs. #File data are copied in chunks of 100000. This number is arbitrary, and you can set it to whatever buffer size you prefer. Smaller numbers may slow the transfer. Larger numbers will require more memory. #Uncomment the print lines if you want to see it working. You could also modify those lines to show a progress bar. More here: http://www.rebol.net/article/0281.html | | Friday, June 23rd, 2006 | | 9:30 pm |
Carl's Blog Alert
Fri, 23 Jun 2006 19:50:49 RebGUI - REBOL/View Graphical User InterfaceRebGUI is a good way to build user interfaces in REBOL. If you've not tried it yet, you should. RebGUI takes many of the best concepts of VID (the visual interface dialect) and provides a useful, smart, clean way to quickly build graphical user interfaces in REBOL. To see a quick tour of RebGUI click on it in the Demos folder of the REBOL Viewtop or type this URL into your REBOL/View GoTo box (or just DO it in the console): http://www.rebol.com/rebgui-demo.rThe above script simply does this: do http://www.dobeash.com/RebGUI/get-rebgui.r do view-root/public/www.dobeash.com/RebGUI/t our.r I should mettion that Ashley and his team at Dobeash Software have done a nice job documenting RebGUI. Here's the main page where you can get started: \in RebGUI Home Page /in For me, RebGUI is exactly the kind of thing I've wanted to see done in REBOL. Remember, VID was/is a prototype. Back in 2001 I expected VID to be replaced with something better in less than a year. VID had some unique and cool ideas (e.g. dialected interface specification, datatyped property dispatch, extensible), but also more than a few quirks and loose ends. Some of you have asked, "Is it ok to use RebGUI for my REBOL applications?" I say yes! Use what works best for your needs and requirements. For many types of applications, I think RebGUI is a good choice. More here: http://www.rebol.net/article/0280.html | | 8:30 pm |
Carl's Blog Alert
Fri, 23 Jun 2006 19:50:49 RebGUI - REBOL/View Graphical User InterfaceRebGUI is a great way to build user interfaces in REBOL. If you've not tried it yet, you should. RebGUI takes many of the good things about VID (the visual interface dialect) and provides a useful, smart, clean way to quickly build graphical user interfaces in REBOL. To see a quick, simple demo of RebGUI, type this URL into your REBOL/View GoTo box (or just DO it in the console): http://www.rebol.com/rebgui-demo.rThe script simply does this: do http://www.dobeash.com/RebGUI/get-rebgui.r do view-root/public/www.dobeash.com/RebGUI/t our.r In addition, Ashley and his team at Dobeash Software have done a nice job documenting RebGUI. Here's the main page where you can get started: \in RebGUI Home Page /in For me, RebGUI is exactly the kind of thing I've wanted to see done in REBOL. Remember, VID was/is a prototype. I expected VID would be totally replaced within less than a year (of 2001!). It had some cool new ideas (e.g. dialected interface specification, datatyped property dispatch, extensible), but also more than a few quirks and loose ends. VID proved its point, and still has its uses, but it's time to move on (and has been for a while now). Some of you have asked, "Is it ok to use RebGUI for my REBOL applications?" I say yes! Use what works best for your needs and requirements. For many types of applications, I think RebGUI is a good choice. More here: http://www.rebol.net/article/0280.html | | Tuesday, June 20th, 2006 | | 11:30 pm |
Carl's Blog Alert
Tue, 20 Jun 2006 22:45:02 REBOL/Core Guide in the French LanguageDid you know that there is a French language translation of the REBOL/Core documentation? I am posting this message to make the link more visible to French speaking developers (and increase search engine ranking for it as well). Guide Utilisateur de REBOL/Core (Fr) This translation was created by Philippe Le Goff, with editing revisions from Christophe Coussement, and contribution from Olivier Auverlot. PS: I would like to personally thank Philippe and his team for making this translation a reality and helping to expand the awareness of REBOL into the French community. More here: http://www.rebol.net/article/0279.html | | Tuesday, June 13th, 2006 | | 12:30 pm |
Carl's Blog Alert
Tue, 13 Jun 2006 12:18:08 How to Calculate Checksums for Large Data or StreamsOk, so you probably know how to calculate checksums in REBOL. It is easy. For example, a simple checksum is: sum: checksum data For a stronger checksum, you can use a secure hashing algorithm, such as SHA1 with code like this: sum: checksum/secure data But, what happens if your data is too large to fit in memory, or you are streaming data that needs to be checked on the fly? The answer is: checksum ports. A checksum port is like any other REBOL port. Here's a quick example of how to compute an ongoing (streaming) checksum: sport: open [scheme: 'checksum] insert sport "this is some text" insert sport "this is more text" insert sport "this is the final text" insert sport ... update sport sum: copy sport close sport print sum The update function is required to compute the final checksum value. Without it, the copy function will return none. The default algorithm for the checksum above is SHA1. The open line above is equivalent to writing: sport: open [scheme: 'checksum algorithm: 'sha1] If you want MD5 instead, use this line: sport: open [scheme: 'checksum algorithm: 'md5] I hope you find this checksum technique of value for your networking and file operations. More here: http://www.rebol.net/article/0278.html | | Wednesday, June 7th, 2006 | | 10:30 pm |
Carl's Blog Alert
Wed, 7 Jun 2006 21:58:26 Browser Plugin UpdateYou may have noticed that we released a REBOL/View 1.3.2 compatible version fo the browser plugin. Now, all of those nice draw demos can be done within your web browsers. In addition, we have a Firefox/Mozilla version of the plugin (but you must install it manually at this time). The two big features we are working on right now are: :Multi-DLL - to allow multiple instances of REBOL within a web page. Each is run as a separate process, independent of the other. :Auto-update - makes it possible for us to update the REBOL plugin automatically. This is tricky because we want to provide a smooth upgrade method and not store each release of REBOL on your hard disk (unless it is an entirely new version of REBOL, such as 3.0). We are also looking at a number of other features, as well as better support for installing in Firefox/Mozilla browsers (and eventually other browsers as well). More here: http://www.rebol.net/article/0277.html | | Thursday, May 25th, 2006 | | 8:30 pm |
Carl's Blog Alert
Wed, 24 May 2006 15:54:45 REBOL Road to FranceFor a few weeks near the end of June, we will be roaming around France. For the first few days, we will be touring around the Paris area, sightseeing. Then, we will be getting lost in the countryside of south-west France in some quiet place within the Aquitaine Region (in English, sort of) between Toulouse and Bordeaux (close to Agen and Moissac, along the Garonne River). For some of the trip, we will be travelling with our ballet troupe (Mendocino Ballet), but there will be times when I hope to escape for lunch, wine, beer, or tour with any REBOLers or Amigans that happen to be around these areas. I can also drive a couple hours in any direction to meet up, should the timing work out. I realize that our location is far from the busy city life, so if schedule or distance is a problem... well then... I think I will enjoy relaxing with the fine French food, wine, countryside... and write even more creative and inspiring code working on REBOL 3.0. If you think there is any chance of getting together in the Paris area or in south-western France, we would very much welcome that. I don't think that there will be time for any kind of official conference, but I do hope to meet up with friendly REBOLers and Amigans alike. Contact us at REBOL feedback and Cindy will work out the details. Vers la fin juin, nous allons nous balader en France. Nous passerons nos premiers jours en touristes dans la r | | Wednesday, May 24th, 2006 | | 11:30 pm |
Carl's Blog Alert
Wed, 24 May 2006 15:54:45 REBOL Road to FranceFor a few weeks near the end of June, we will be roaming around France. For the first few days, we will be touring around the Paris area, sightseeing. Then, we will be getting lost in the countryside of south-west France in some quiet place within the Aquitaine Region (in English, sort of) between Toulouse and Bordeaux (close to Agen and Moissac, along the Garonne River). For some of the trip, we will be travelling with our ballet troupe (Mendocino Ballet), but there will be times when I hope to escape for lunch, wine, beer, or tour with any REBOLers or Amigans that happen to be around these areas. I can also drive a couple hours in any direction to meet up, should the timing work out. I realize that our location is far from the busy city life, so if schedule or distance is a problem... well then... I think I will enjoy relaxing with the fine French food, wine, countryside... and write even more creative and inspiring code working on REBOL 3.0. If you think there is any chance of getting together in the Paris area or in south-western France, we would very much welcome that. I don't think that there will be time for any kind of official conference, but I do hope to meet up with friendly REBOLers and Amigans alike. Contact us at REBOL feedback and Cindy will work out the details. PS: If someone can translate the above to French, I will post it here. Also, if you have a photo I can use of France (Paris or countryside) I would like to use it on the REBOL.net home page. Thanks! More here: http://www.rebol.net/article/0276.html | | 10:30 pm |
Carl's Blog Alert
Wed, 24 May 2006 15:54:45 REBOL Roads to FranceFor a few weeks near the end of June, we will be roaming around France. For the first few days, we will be touring around the Paris area, sightseeing. Then, we will be getting lost in the countryside of south-west France in some quiet place within the Aquitaine Region (in English, sort of) between Toulouse and Bordeaux (close to Agen and Moissac, along the Garonne River). For some of the trip, we will be travelling with our ballet troupe (Mendocino Ballet), but there will be times when I hope to escape for lunch, wine, beer, or tour with any REBOLers or Amigans that happen to be around these areas. I can also drive a couple hours in any direction to meet up, should the timing work out. I realize that our location is far from the busy city life, so if schedule or distance is a problem... well then... I think I will enjoy relaxing with the fine French food, wine, countryside... and write even more creative and inspiring code working on REBOL 3.0. If you think there is any chance of getting together in the Paris area or in south-western France, we would very much welcome that. I don't think that there will be time for any kind of official conference, but I do hope to meet up with friendly REBOLers and Amigans alike. Contact us at REBOL feedback and Cindy will work out the details. PS: If someone can translate the above to French, I will post it here. Also, if you have a photo I can use of France (Paris or countryside) I would like to use it on the REBOL.net home page. Thanks! More here: http://www.rebol.net/article/0276.html | | 6:30 pm |
Carl's Blog Alert
Wed, 24 May 2006 15:54:45 REBOL Roads in FranceFor a few weeks near the end of June, we will be roaming around France. For the first few days, we will be touring around the Paris area, sightseeing. Then, we will be getting lost in the countryside of south-west France in some quiet place within the Aquitaine Region (in English, sort of) between Toulouse and Bordeaux (close to Agen and Moissac, along the Garonne River). For some of the trip, we will be travelling with our ballet troupe (Mendocino Ballet), but there will be times when I hope to escape for lunch, wine, beer, or tour with any REBOLers or Amigans that happen to be around these areas. I can also drive a couple hours in any direction to meet up, should the timing work out. I realize that our location is far from the busy city life, so if schedule or distance is a problem... well then... I think I will enjoy relaxing with the fine French food, wine, countryside... and write even more creative and inspiring code working on REBOL 3.0. If you think there is any chance of getting together in the Paris area or in south-western France, we would very much welcome that. I don't think that there will be time for any kind of official conference, but I do hope to meet up with friendly REBOLers and Amigans alike. Contact us at REBOL feedback and Cindy will work out the details. PS: If someone can translate the above to French, I will post it here. Also, if you have a photo I can use of France (Paris or countryside) I would like to use it on the REBOL.net home page. Thanks! More here: http://www.rebol.net/article/0276.html | | Monday, May 22nd, 2006 | | 2:30 pm |
Carl's Blog Alert
Mon, 22 May 2006 14:17:03 Note: REBOL.com Feedback OutageIf you posted a feedback message (not a comment) or email to REBOL.com, to me directly, or to my blog since 17-May-2006, we probably did not receive it. Sorry! Please send it to us again. What happened? It turns out that the file space quota system used by our web service provider simply ignores a file write when the quota has been reached. As a result, it appeared that email and CGI services were working fine (at the program level), but they were not. To avoid this problem in the future: We've enhanced a few of our scripts to verify that file writes actually happen and to tell us (and you) if a failure occurred. At least that way we'll both know that there was a problem. Again, sorry about that! More here: http://www.rebol.net/article/0275.html | | Monday, May 8th, 2006 | | 8:30 pm |
Carl's Blog Alert
Thu, 4 May 2006 12:44:33 REBOL Bloat BustingI've received a few feedbacks from people who are worried about REBOL 3.0 becoming bloated. Comments like: I like the fact that REBOL/Core is only 220K and does not require special libraries or installation. Please do not change that. And, this one is even more blunt: I have a concern that REBOL 3.0 will try to become more "like the others" -- garbage like Python, Ruby, et. al, designed to pander to the Corporate CIO brainless. To this I say: Do not worry! REBOL is all about being powerful but lightweight, and we're going to keep it that way. That's the REBOL way. So far, even with several new datatypes and features, REBOL 3.0 is actually smaller and faster than prior versions. I cannot promise 3.0 will remain smaller (there's still more to do) but my point is... we're going to keep REBOL being REBOL: lean and mean. I think part of the problem may have been the term programming in the large that I used in the REBOL 3.0 Roadmap. This term has a special meaning that could be misleading. Programing in the large does not mean that the REBOL system or its programs must be large. You can still write a 10K program that does amazing things. The term actually means that if you do write large programs, you will have better internal mechanisms to manage them. For example, modules (namespaces) allow you to write sections of code without worrying about global words colliding with other parts of your code. Tasks allow you to easily create asynchronous sections of code. Object attributes let you control how object fields are accessed and let you attach documentation to your objects (similar to functions). So, let's keep REBOLing. Bloat is dead. Leaner is smarter. \note Personal note: I think most software and systems are insanely out of control. As a result, not only do they crash (e.g. my satellite TV receiver crashes almost daily), but they do not improve and adapt to user demands quickly. I think the world is doomed if that bigger-is-better approach continues to dominate modern software designs. I cannot wait for the day when REBOL 3.0 lets us get our little reblets running not only on the desktop (all of them), but the same code runs on the set-top (TV) and the cell-phone! "I want a REBOL-programmable cell-phone, and I want it now!" /note More here: http://www.rebol.net/article/0274.html | | Thursday, May 4th, 2006 | | 1:30 pm |
Carl's Blog Alert
Thu, 4 May 2006 12:44:33 REBOL Bloat BustingI've received a few feedbacks from people who are worried about REBOL 3.0 becoming bloated. Comments like: I like the fact that REBOL/Core is only 220K and does not require special libraries or installation. Please do not change that. And, this one is even more blunt: I have a concern that REBOL 3.0 will try to become more "like the others" -- garbage like Python, Ruby, et. al, designed to pander to the Corporate CIO brainless. To this I say: Do not worry! REBOL is all about being powerful but lightweight, and we're going to keep it that way. That's the REBOL way. So far, even with several new datatypes and features, REBOL 3.0 is actually smaller and faster than prior versions. I cannot promise 3.0 will remain smaller (there's still more to do) but my point is... we're going to keep REBOL being REBOL: lean and mean. I think part of the problem may have been the term programming in the large that I used in the REBOL 3.0 Roadmap. This term has a special meaning that could be misleading. Programing in the large does not mean that the REBOL system or its programs must be large. You can still write a 10K program that does amazing things. The term actually means that if you do write large programs, you will have better internal mechanisms to manage them. For example, modules (namespaces) allow you to write sections of code without worrying about global words colliding with other parts of your code. Tasks allow you to easily create asynchronous sections of code. Object attributes let you control how object fields are accessed and let you attach documentation to your objects (similar to functions). So, let's keep REBOLing. Bloat is dead. Leaner is smarter. \note Personal note: I think most software and systems are insanely out of control. As a result, not only do they crash (e.g. my satellite TV receiver crashes almost daily), but they do not improve and adapt to user demands quickly. I think the world is doomed if that bigger-is-better approach continues to dominate modern software designs. I cannot wait for the day when REBOL 3.0 let's us get our little reblets running not only on the desktop (all of them), but the same code runs on the set-top (TV) and the cell-phone! "I want a REBOL-programmable cell-phone, and I want it now!" /note More here: http://www.rebol.net/article/0274.html | | Wednesday, April 26th, 2006 | | 6:30 pm |
Carl's Blog Alert
Wed, 26 Apr 2006 17:22:39 A Kona fishing story...Someone posted a message asking why the blog had not been updated in over a week. Exactly what was going on anyway?! Well, it's been a very long winter with more than 52 inches (132cm) of rain, mudslides and other problems, so... we took time off to scout around for "a good REBOL Devcon 2006" location. This site is not so bad, do you think: | | 1:30 pm |
Carl's Blog Alert
Wed, 26 Apr 2006 12:04:15 Ask the Guru... on REBOL Talk ForumThe admin powers of the REBOL Talk forum have granted me a special guru area to answer your deep REBOL questions. Why this open forum? Because most new REBOLers do not have access to the AltME worlds where I can be reached (and only from time to time, I must admit). Why not let other experts answer such questions? Yes, Gabriele, Gregg, Ladislav, and many others do a great job at that (and it helps, thanks!), and I do not want to interfere with such a good thing. But, there are times, now and then and every other Monday, when I see specific design questions about the language, and I really do want to answer those questions rather than have a "void of knowledge" floating around. Will this forum really work? I don't know. It is an experiment, just like this blog is an experiment. But, I figure if my forum on REBOL Talk only helps to boost interest and visibility in that forum, then it will be worth doing... I very much appreciate the DefiantPc folks setting up and running the forum, and I want to give it as much support as I can. Here is the link to the REBOL Talk Ask the Guru Forum. More here: http://www.rebol.net/article/0272.html | | 12:30 pm |
Carl's Blog Alert
Wed, 26 Apr 2006 12:04:15 Ask the Guru... on REBOL Talk ForumThe admin powers of the REBOL Talk forum have granted me a special Guru area to answer your deep REBOL questions. Why this open forum? Because most new REBOLers do not have access to the AltME worlds where I can be reached (and only from time to time, I must admit). Why not let other experts answer such questions? Yes, Gabriele, Gregg, Ladislav, and many others do a great job at that (and it helps, thanks!), and I do not want to interfere with such a good thing! But, there are times, now and then and every other Monday, when I see specific design questions about the language, and I really do want to answer those questions rather than have a "void of knowledge" floating around. Will this forum really work? I don't know. It is an experiment, just like this blog is an experiment. But, I figure if my forum on REBOL Talk only helps to boost interest and visibility in that forum, then it will be worth doing... I very much appreciate the DefiantPc folks setting up and running the forum, and I want to give it as much support as I can. Here is the link to the REBOL Talk Ask the Guru Forum. More here: http://www.rebol.net/article/0272.html | | Monday, April 24th, 2006 | | 9:30 pm |
Carl's Blog Alert
Mon, 24 Apr 2006 20:42:58 REBOL Talk Forum Back UpI just noticed that the REBOL Talk Forum is back up and working well again. This is a nicely run, open, independent forum for new users. The operators reported a problem caused by MySql updates, and they have moved the data to a Simple Machines web forum system. In addition, they have put more spam guards in place. I would very much like to see REBOL Talk get more visitors. (Our AltME channels are great, but AltME was not intended for open discussions.) So... to help it grow, I'm planning to drop-by REBOL Talk a lot more often, and participate more in the discussions, answer questions, etc. I hope you get a chance to stop by and offer your own comments or ask questions. (PS: Now if only someone had a way that I could access it via REBOL rather than the web, I'd be really happy. But, I'm not expecting that any time soon.) More here: http://www.rebol.net/article/0271.html | | Monday, April 10th, 2006 | | 4:30 pm |
Carl's Blog Alert
Mon, 10 Apr 2006 16:05:01 Browser Plugin Project ResumesThe REBOL-as-a browser plugin project has been resumed. We welcome Josh Mitts back to the project (Josh was the original creator of the REBOL IE plugin.) Briefly the goals of the project are: #To build a newer plugin for supporting REBOL 1.3.2. #To experiment and perfect methods of embedding REBOL application encryption into browser plugins (the REBOL/Platform concept). #To prepare for deeper integration between the browser and REBOL 3.0. We want more control, more power over the browser as well as threading (to allow multiple REBOL page instances). #To examine what it will take, then build, support for non-IE browsers, including those on Windows, OSX, Linux, BSD, etc. Of course, this is a big project due to the number of browsers and platforms, and I know that Josh and I cannot do it alone. So, this is more of an open project than before and a few of you have already volunteered to help. We're going to need that help. We would also like to invite anyone else who has deep programming experience in browser plugin technology. It can get pretty complex, depending on the browser. Contact me via feedback. Thanks. More here: http://www.rebol.net/article/0270.html | | 4:30 pm |
| | Sunday, April 9th, 2006 | | 6:30 pm |
Carl's Blog Alert
Sun, 9 Apr 2006 17:41:13 HTML CSS Fix WantedUnfortunately (and not unusual), HTML CSS do not work the same way between different browser implementations. Those of you who use Firefox may have noticed that the Recent Articles table (above, on the main blog page) does not format correctly. The correct formatting right aligns the dates (that is, all the "-" line up vertically). If anyone knows a fix for my CSS .offset style, please let me know or post a comment here. I suppose we could go back to using good-old HTML tables if necessary. More here: http://www.rebol.net/article/0268.html |
[ << Previous 20 ]
|