Ask a Question related to Ruby, Design and Development.
-
T. Onoma #1
Re: can't flush I know why, but no fix
I figured out why it won't work. i'm using 1.8's open_uri to retrieve the url with open(url). as soon as this executes everything stops until it downloads the whole file! it isn't a real IO. blah! that stinks. not i wonder if net/http and net/ftp do the same since that's what oprn_uri is based on. if so then means i might have to get down to the socket level just to do a progess reported download. frig'n wonderful!
If anyone knows of a better way, or a code snippet i can steal, Please let me know.
Thanks,
-t0
T. Onoma Guest
-
Buffer Flush
So, I'm trying to play streaming video from Dlash Media Server. nc = new NetConnection(); nc.connect('rtmp://mysite/myapp'); ns = new... -
Flush right type not flush
With Illustrator CS in Win XP, my flush right lines of type are not cleanly aligned on the right (using Gill Sans postscript typeface, but it doesn't... -
flush right type
With Illustrator CS in XP, a block of flush right type is slightly ragged on the right edge. Any ideas why? Thanks -
Flush Right Type ISN'T FLUSH !!!
Something about ai CS is making me feel like it's still in beta ... I'm designing a small CD-ROM package, and I typed a couple of lines of text,... -
flush command on AIX 4.3
Hi I have program flush in /usr/local/bin and i don't know what is it maybe something like sync command ? please advice and thanks JK -
Harry Ohlsen #2
Re: can't flush I know why, but no fix
Hi tO,
T. Onoma wrote:
Sorry, I don't know of any code snippets you could use as a starting point.> I figured out why it won't work. i'm using 1.8's open_uri to retrieve the url with open(url). as soon as this executes everything stops until it downloads the whole file! it isn't a real IO. blah! that stinks. not i wonder if net/http and net/ftp do the same since that's what oprn_uri is based on. if so then means i might have to get down to the socket level just to do a progess reported download. frig'n wonderful!
>
> If anyone knows of a better way, or a code snippet i can steal, Please let me know.
However, it might be worthwhile modifying open_uri to allow the asynchronous download and progress notification you want, and then submit a patch, so this can end up in the core code.
Cheers,
Harry O.
Harry Ohlsen Guest
-
Gavin Sinclair #3
Re: can't flush I know why, but no fix
On Friday, November 14, 2003, 2:15:18 PM, T. wrote:
> I figured out why it won't work. i'm using 1.8's open_uri to
> retrieve the url with open(url). as soon as this executes everything
> stops until it downloads the whole file! it isn't a real IO. blah!
> that stinks. not i wonder if net/http and net/ftp do the same since
> that's what oprn_uri is based on. if so then means i might have to
> get down to the socket level just to do a progess reported download.
> frig'n wonderful!> If anyone knows of a better way, or a code snippet i can steal, Please let me know.
net/ftp allows you to download a file a bit at a time. Dunno about
net/http.
Gavin
Gavin Sinclair Guest
-
T. Onoma #4
Re: can't flush I know why, but no fix
> However, it might be worthwhile modifying open_uri to allow the asynchronous download and progress notification you want, and then submit a patch, so this can end up in the core code.
Thanks Harry! I took your advice. Its not quite asynchronous download, but what i did was add in a hook. So now you can do this:
require 'open_uri'
progress_proc = proc { |b| print "Downloaded #{b} bytes so far." }
open(url, progress_proc) { |f| print "Done" }
This of course will print many lines like:
Downloaded 1 bytes so far.
Downloaded 2 bytes so far.
Downloaded 3 bytes so far.
Downloaded 4 bytes so far.
Downloaded 5 bytes so far.
...
Done.
Not sure the exact count of bytes for each cycle. This really works well with Ruby/ProgressBar though (which moves back to the same line with each pass).
It probably could be made a tad more robust but I am pretty sure i covered all the base in the code. The this lib's in the distribution of Ruby, so how/who do i give the new version to now?
-t0
T. Onoma Guest
-
Austin Ziegler #5
Re: can't flush I know why, but no fix
On Fri, 14 Nov 2003 15:13:58 +0900, T. Onoma wrote:
...> Thanks Harry! I took your advice. Its not quite asynchronous download,>> However, it might be worthwhile modifying open_uri to allow the
>> asynchronous download and progress notification you want, and then
>> submit a patch, so this can end up in the core code.
> but what i did was add in a hook. So now you can do this:
Create a patch file (diff -u, I think) and post it to ruby-core, along with> It probably could be made a tad more robust but I am pretty sure i
> covered all the base in the code. The this lib's in the distribution of
> Ruby, so how/who do i give the new version to now?
why you think it would be good to apply. (Not everyone on -core reads
-talk.)
-austin
--
austin ziegler * [email]austin@halostatue.ca[/email] * Toronto, ON, Canada
software designer * pragmatic programmer * 2003.11.14
* 07.57.22
Austin Ziegler Guest
-
T. Onoma #6
Re: can't flush I know why, but no fix
> Create a patch file (diff -u, I think) and post it to ruby-core, along with
thanks austin,> why you think it would be good to apply. (Not everyone on -core reads
> -talk.)
i tried it, but core rejected my post saying i wasn't a member. perhaps i should [ANN] here to get it noticed?
-t0
T. Onoma Guest
-
T. Onoma #7
Re: can't flush I know why, but no fix
> i tried it, but core rejected my post saying i wasn't a member. perhaps i should [ANN] here to get it noticed?
hey i became member of core! and i even helped contribute. damn that feels good! :)
-t0
T. Onoma Guest
-
Austin Ziegler #8
Re: can't flush I know why, but no fix
On Sat, 15 Nov 2003 04:49:30 +0900, T. Onoma wrote:
Send it directly to me and I'll post it to -core on your behalf.> i tried it, but core rejected my post saying i wasn't a member. perhaps i
> should [ANN] here to get it noticed?
-austin
--
austin ziegler * [email]austin@halostatue.ca[/email] * Toronto, ON, Canada
software designer * pragmatic programmer * 2003.11.14
* 16.57.02
Austin Ziegler Guest



Reply With Quote

