-  [JOIN IRC!]


[Return]
Posting mode: Reply
Name
Subject   (reply to 232)
Message
File
Password  (for post and file deletion)
¯\(°_O)/¯
  • Supported file types are: BMP, GIF, JPG, PNG
  • Maximum file size allowed is 10000 KB.
  • Images greater than 400x400 pixels will be thumbnailed.
  • Currently 317 unique user posts. View catalog

  • Blotter updated: 2015-09-02 Show/Hide Show All


File 133974627595.gif - (3.14KB , 400x300 , progress.gif )
232 No. 232
How the fuck are progress bars coded? The more I think about it the more amazing of a topic it seems.
>> No. 235
while theres_something_to_do do_something() update_bar()


So depending on how it's done reaching 99% may take a second while the final 1% takes five minutes. On the other hand if it's for a download and you know the file size it's easier to make it accurate. But... am I missing something? How's this "amazing"?
>> No. 236
>>235
I'm new to programming and just hadn't thought about it before. It's less amazing to think of it as breaking up tasks and not too amazing at all to think about following fairly consistent streams like for a download. I suppose progress bars generally don't care if somethingtodo[i+1] takes a little longer than somethingtodo[i], and more sophisticated ones probably have checks to see if each instance is taking way longer than expected. At first I was imagining them initially predicting the total time the process would take, but that seems unlikely/maybe impossible.
>> No. 237
loadingBarLength = (workDone / totalWork) * 100


You see 12 year olds doing it for their little Flash animations.
>> No. 247
>>237
12 year olds are amazing
>> No. 249
>>247
12chan is that way -->
>> No. 260
>>249

Thanks.


Delete post []
Password  
Report post
Reason