No video

Why are Progress Bars Always Wrong? Progress Bar Example in C.

  Рет қаралды 35,389

Jacob Sorber

Jacob Sorber

Күн бұрын

Patreon ➤ / jacobsorber
Courses ➤ jacobsorber.th...
Website ➤ www.jacobsorbe...
---
Why are Progress Bars Always Wrong? Progress Bar Example in C // Progress bars are extremely common and nearly always inaccurate. Why? This tutorial shows you how to add a simple progress bar to your terminal programs. The example is in C and uses libcurl, but easily translates to any other language. I also talk about the difficulties of predicting when tasks will complete.
Related Video: • Easy Networking in C (...
***
Welcome! I post videos that help you learn to program and become a more confident software developer. I cover beginner-to-advanced systems topics ranging from network programming, threads, processes, operating systems, embedded systems and others. My goal is to help you get under-the-hood and better understand how computers work and how you can use them to become stronger students and more capable professional developers.
About me: I'm a computer scientist, electrical engineer, researcher, and teacher. I specialize in embedded systems, mobile computing, sensor networks, and the Internet of Things. I teach systems and networking courses at Clemson University, where I also lead the PERSIST research lab.
More about me and what I do:
www.jacobsorbe...
people.cs.clem...
persist.cs.clem...
To Support the Channel:
+ like, subscribe, spread the word
+ contribute via Patreon --- [ / jacobsorber ]
Source code is also available to Patreon supporters. --- [jsorber-youtub...]

Пікірлер: 104
@sukivirus
@sukivirus 3 жыл бұрын
Love to see graphics/gui in C so much.
@JacobSorber
@JacobSorber 3 жыл бұрын
I haven't played with IUP. Should I?
@sukivirus
@sukivirus 3 жыл бұрын
@@JacobSorber Thanks @Tarun I found IUP. I never knew there exist a library like this. Would love to learn it.
@yangliu3754
@yangliu3754 3 жыл бұрын
Your video always remind me how challenging working with C can be compared with working with other languages. But this may be also why so many programmers love C. Challenging but cool.
@TheCocoaDaddy
@TheCocoaDaddy 3 жыл бұрын
Awesome video! I'm definitely someone who gets frustrated with inaccurate progress bars and even though I'm a programmer, I never stopped to think about the implementation of a progress bar. So, this video changed my perspective significantly. :) Plus, it was fun watching you create the progress bar. :) Thanks for posting!
@JacobSorber
@JacobSorber 3 жыл бұрын
Thanks!
@tordjarv3802
@tordjarv3802 3 жыл бұрын
Also the Turing halting problem is a problem to consider for the humble programmer that just want a progress bar for their program
@manla9921
@manla9921 3 жыл бұрын
Could you make a video showing how to Configure/Setup VS Code for C programming please?
@bishoppebbles5699
@bishoppebbles5699 3 жыл бұрын
Checkout the video by CodeVault called "Compile and run C code using Visual Studio Code". He has another video for Linux as well.
@adriancostin9138
@adriancostin9138 3 жыл бұрын
this video actually made me want to code in C again. really appreciated the production quality on this, thank you.
@NicolaiSyvertsen
@NicolaiSyvertsen 3 жыл бұрын
The point is that the progress bar says nothing about how long something is going to take. There are progress dialogs that show estimated time left but that is also something that is based on an algorithm often by sampling the download speed at intervals and updating it. Also one more thing you should have mentioned is that on the terminal and in single threaded applications you actually shouldn't print too much to the terminal while doing processing as then the processing will be limited by the throughput of the terminal. rsync with and without -v argument (verbose) shows this clearly. It prints a line per file copied which does slow it down. A timer signal handler (POSIX timers) that sets a volatile flag which you can then poll in your processing code to do status updates every second or so would definitely help. Though I'm not sure how to fix rsync other than doing the processing in its own thread. The problem with this approach is that the status updates would start to lag behind what is actually being processed fast.
@adambishop328
@adambishop328 2 жыл бұрын
I liked this video because it included a small amount of many things like networking, prediction methods, and gui. And the great part was that it was presented in a digestable chunk of just a few short functions. I'm currently a third-year CS student and for specific topics it's really great to see someone actually build programs like this, it makes it so much more concrete and memorable.
@aaryan6577
@aaryan6577 3 жыл бұрын
Love your content! There aren't many channels who do this good quality C videos. I'd love to see any good C project videos too!
@JacobSorber
@JacobSorber 3 жыл бұрын
Thanks. I'll see what I can do.
@ivelinkarageorgiev3111
@ivelinkarageorgiev3111 2 жыл бұрын
Damn that's my favorite cs channel, keep rocking ^^
@lorensims4846
@lorensims4846 3 жыл бұрын
Wheee! I always knew there was a lot of guesswork involved but hoo boy! You've clearly made a valiant effort and yet your progress bar still parked when it hit that Debian download. Thank you SO much for the example. It gives us a place to start from.
@dovias5665
@dovias5665 3 жыл бұрын
Oh boy! This is gold content. Even better than Cherno's C++ series. Thanks!
@eqanio
@eqanio 3 жыл бұрын
True legends of the game
@Ythishate
@Ythishate 3 жыл бұрын
Really loved the old days , C and the pointers, will start programing again , Anything can be done in C.
@nagarajahuliyapuradamata3447
@nagarajahuliyapuradamata3447 3 жыл бұрын
I have been disappointed recently with, 1. Horrible hobby projects available online with fake update %ge bar graphics (hold cpu time just to show a fake progress whereas nothing is happening in the background!) 2. Live code sessions recorded with huge screen/monitors, that I couldn’t see fonts (therefore couldn’t understand what was going on). They missed the whole idea of live coding sessions! (note: developers are watching KZfaq live coding sessions on mobile mobile because they have lost jobs/no access to laptops, thanks to corona pandemic! Such videos are useful to keep our skills sharp) I like this video because, 1. It addresses all above points 2. I liked the initial prediction and calibration logic Thanks for sharing this video!
@zxuiji
@zxuiji 2 жыл бұрын
25:22, for accuracy I would default to url_index vs url_total for done vs expect but when ever a url provides the total bytes I would add that to the expect parameter and add the total bytes done to the done parameter, the write function can detect this difference by simply checking what the initial handler given has set something like max_current_url_bytes to, if it's 0, stick with what you have, if it's not, add the byte count working with to the done parameter as the expect parameter is already been added to by the same function that set max_current_url_bytes, this method provides more accuracy when available but sticks to what it know when it's not, the max_current_url_bytes parameter is then also usable by the update function to produce either "current url: bytes of max bytes" or just "current url: bytes"
@d97x17
@d97x17 3 жыл бұрын
Thank you for this video! I do have a question about the use of the predict_next function. In the video, you always supply statusinfo::exp_bytes_per_url as the value for the last prediction. Based on that one and the estimate_current, you make a new prediction and store it in guess_next_prediction. Subsequently, guess_next_prediction is used to (eventually) calculate the percentage, but afterwards it's discarded. Wouldn't it be better to either store guess_next_prediction into statusinfo::exp_bytes_per_url or keep track of it in another way and use it as a first argument for the predict_next function? I think in that manner, you actually take into account the full history
@FreddieDeetlefs
@FreddieDeetlefs 3 жыл бұрын
What I normally do is have a progress bar for each separate task and then one main progress bar to show the overall progress.This way you can see which tasks have been completed and which ones are still executing, I also add a label that indicates the amount of tasks that have completed and the amount that still need to be done.So still no indication of the amount of time needed but this way you see the actual progress being made.
@svdinverse4025
@svdinverse4025 3 жыл бұрын
Professor, great video as always. Thank you for this and so many other wonderful tutorials. I have a request. Can you do some tutorials(s) on sockets, zeromq messaging and related topics. It would be v helpful. Thank you again.
@JacobSorber
@JacobSorber 3 жыл бұрын
Thanks. I already have some on sockets. Let me know what specifically you think I'm missing. And, I'll add ZeroMQ to the topic list and see what I can do.
@svdinverse4025
@svdinverse4025 3 жыл бұрын
@@JacobSorber Thank you, I went and watched the websocket client that does a simple get http. I was looking for tutorials of clients that can get streaming market data from some web server. How to change your example so that whenever the server pushes new data, the client automatically updates itself?
@PlasticCogLiquid
@PlasticCogLiquid 2 жыл бұрын
I first time I ever made a progress bar I just tied it to some behind the scenes stuff for a 2d game. It generated a bunch of random items every time a level started so I tied the graphic of the bar to the amount of objects being generated. On modern computers you don't even know there is a progress bar, but on ancient computers it works great :P That made me start wondering what the progress bars in other games are actually tied too and how many other people sorta fake it like I did. You expect that it's magically loading everything in the game, and maybe for other games it is, I wouldn't know because I'm a hack
@carolinemathieson
@carolinemathieson 2 жыл бұрын
Write the progress bar to stderr first of all then you don't need the fflush. Also if you do this and need to redirect the output of your program to a file to keep a record of what happened then the file will not contain a huge number of lines for each step of the progress bar updates.
@agustinanfuso6505
@agustinanfuso6505 3 жыл бұрын
This was amazing!
@JacobSorber
@JacobSorber 3 жыл бұрын
Thanks.
@philippejean1102
@philippejean1102 3 жыл бұрын
Super channel !! I just discovered and I love it !! great job !!
@JacobSorber
@JacobSorber 3 жыл бұрын
Thanks and welcome, Philippe.
@JaimeWarlock
@JaimeWarlock 2 жыл бұрын
Just make your progress bar work like Microsoft progress bar does. Speed depends on remaining amount of the bar with no link to reality. So if the bar is 90% done, that means it moves at 10% speed. At 99% done, moves at 1% speed.
@SHONNER
@SHONNER 2 жыл бұрын
I have lots of progress bar example code. But none of what I do can be applied to them because my apps don't know when they will finish. So I don't use them.
@leonardusl5141
@leonardusl5141 2 жыл бұрын
10:19 Why isn't sizeof(urls) just giving the size of a pointer?
@JohnB-2021
@JohnB-2021 3 жыл бұрын
I've not watched all the video yet, added it to watch later. You wrote for i=0; i
@JacobSorber
@JacobSorber 3 жыл бұрын
True. My wording was not very precise. I wanted it to execute the loop body for 1== 100, not just count to 100.
@JohnB-2021
@JohnB-2021 3 жыл бұрын
@@JacobSorber Thank you Jacob. I program Pic Microcontrollers and only now moving to visual studio to learn more... Great video.
@johnconnorstopskynet
@johnconnorstopskynet 2 жыл бұрын
I'm not a programmer I'm just starting out maybe I'm just speaking on something that I don't know anything about which I probably am. But wouldn't the most accurate way be to determine the total download size and then factor in the average download speed. As you said it's not easy to figure out the download file size which I'm not sure why if a web browser can do it.
@subhankarkarmakar2650
@subhankarkarmakar2650 2 жыл бұрын
where does curl save the files ?? I cannot find them !
@samuelmartin7319
@samuelmartin7319 3 жыл бұрын
Loved the video! Would you ever dive into something like the Quake 3 engine and do videos on that? The engine is “simple” compared to something like unreal.
@von-fur-wegen-gegenolli9196
@von-fur-wegen-gegenolli9196 2 жыл бұрын
Finally i know how that works!! 🙏
@apexstate3127
@apexstate3127 3 жыл бұрын
Sir, Today I am start learning about getchar and putchar , I can't Understand why getchar read single char if we use without loop. and why getchar read all character if we use within loops.
@danielbodovs1195
@danielbodovs1195 3 жыл бұрын
Hey, great video, but I feel like it could have been summarized in a minute or two in the beginning and then the code could've been shown. The whole idea is quite simple and writing out the code seems like a waste of time, at least for people who have coded for some time. I thought that it would be this exact reason, but still watched as it seemed like you were gonna make an important point about something else or at least discuss these issues more at length in the end (e.g. you could've said how with many files requiring download estimating may be better than just asking so many separate servers about the size of the files due to the inefficiency of that, which you kinda said, but didn't elaborate on why this is only really a problem with many files and mainly in the beginning (spending a minute on just loading the size and then actually starting the download and updating the progress bar would cause a lot of people to quit midway through (and how making so many requests to different servers is not that great of an idea because some servers would not receive the actual file request until possibly a lot of time later, even hours, therefore initializing the connection would be the big inefficiency problem here); with few options to request it's not that big of a deal)). Or you could've talked about how this could be at least partially solved by the server of the program we are developing storing the latest size of the downloads and using that. What I'm trying to say is that you could've covered things with words first and then with code so as not to have the video be underwhelming. Again, though, the explanation was pretty good for the level of depth.
@danielrazulay
@danielrazulay 3 жыл бұрын
Progress bars should measure bytes v total bytes, not files vs total files. Time prediction shouldn't even be part of the code.
@zxuiji
@zxuiji 2 жыл бұрын
6:14, frankly I would've just not set i on the second loop and used PROG_BAR_LENGTH as is, less prone to mistakes that way, but the integer conversion was new to me, was looking for how to do that without floats, didn't occur to me to just multiply 1st
@iltrovatoremanrico
@iltrovatoremanrico 3 жыл бұрын
Great video, thanks! Can I ask, what is the font you use in VS here?
@edenr1988
@edenr1988 3 жыл бұрын
Great video, I remember getting challenged to draw multiple progress bars for multiple processes running in parallel, and couldn't really find a proper solution for it. Idea perhaps for your next video ;)
@JacobSorber
@JacobSorber 3 жыл бұрын
Thanks. Yeah, we could probably do that. Were you working in the terminal, or using some sort of graphics framework?
@edenr1988
@edenr1988 3 жыл бұрын
@@JacobSorber was working in the terminal. A good example for this kind of progress bar is perhaps docker cli when downloading a container image you would see multiple digest layers being downloaded in multiple progress bars and I wonder how did they implement it, I couldn't figure it out. I would assume they're opening channels between the main thread and that thread which currently running the download and transmiting the progress to the main thread to draw it.
@JacobSorber
@JacobSorber 3 жыл бұрын
@%9F%98%80nel/UCvQtSHqKNUKpVbWkfhesmKA They were probably using control sequences. Sounds like we'll need a future video on that. Thanks for the idea.
@papaoese6258
@papaoese6258 2 жыл бұрын
@@JacobSorber I've also seen similar behavior by pacman (Arch Linux package manager). It would be interesting to get an explanation of how the parallel download progress bars are implemented
@siddharthpandey3204
@siddharthpandey3204 3 жыл бұрын
I've this question as I'm in a dilemma for sometime that should I switch to C for competitive programming, or the popular C++ (knowing the few drawbacks of C, as mentioned no direct method to compute array length) from my till now CP partner JAVA? The question arises coz presently I'm associated with Embedded C projects & have been learning C for that matter & wish to be more fluent in it. Would really appreciate some advices on this :)
@user-vz3mj5qk4d
@user-vz3mj5qk4d 3 жыл бұрын
In competitive programming speed is everything once you understand how to solve the problem, so STL algorithms and data structures in C++ (like sort, vector, set and map) are just too good to throw away. If you want to practice and get a better understanding of their internals then consider implementing some of them yourself with C++ templates (maybe even in C-style to some extent) but still go with the standard library implementations for actual contests. They are robust, very fast, versatile and can be customized on the fly for any kind of input data
@roshandsouza2329
@roshandsouza2329 3 жыл бұрын
Cool stuff, thank you 👍
@JacobSorber
@JacobSorber 3 жыл бұрын
Glad you liked it!
@smrtfasizmu6161
@smrtfasizmu6161 2 жыл бұрын
Flushing the output stream is done in Java as well. In Java I write bufferedOutputStream.flush();
@JacobSorber
@JacobSorber 2 жыл бұрын
Very true. Thanks.
@FiveNineO
@FiveNineO 2 жыл бұрын
Make progress bars great again 👍
@SealedKiller
@SealedKiller 3 жыл бұрын
What font are you using?
@DerDill
@DerDill Жыл бұрын
What symbol is this arrow on the keyboard in 17:31? Thanks
@ksherif482
@ksherif482 Жыл бұрын
I suppose it is a fance symbol replacing the -> (arrow). He also uses the ≥ which replaces the >= . I tried it in my code but it isn't recognized. Probably something in the settings, but I wouldn't mind it
@flowingcode8069
@flowingcode8069 Жыл бұрын
Nerd fonts
@islandcave8738
@islandcave8738 3 жыл бұрын
Having made a progress bar, I know why. If there are say 4 steps that are hard to compare, you could break that up into 25% each, but thats not accurate. Maybe some of those steps have n items to go through, so 25% / n...
@ChoudharyRamesh
@ChoudharyRamesh 3 жыл бұрын
love this video
@rmcf7514
@rmcf7514 3 жыл бұрын
Love the shirt man!
@JacobSorber
@JacobSorber 3 жыл бұрын
Thanks. I know where you can get one of your own. 😀
@georgeomara
@georgeomara 3 жыл бұрын
Wow I love this.
@JacobSorber
@JacobSorber 3 жыл бұрын
Thanks!
@sababugs1125
@sababugs1125 3 жыл бұрын
Will you make a video about graphics in c ?
@JacobSorber
@JacobSorber 3 жыл бұрын
There are lots of ways to do graphics. I've touched on a few in the past (the curses videos and the pandemic simulator video). Do you have something specific in mind?
@sababugs1125
@sababugs1125 3 жыл бұрын
@@JacobSorber you could do something about basic drawing objects to the screen and opening windows and what not ? Do you have any plans for those kinds of videos ?
@adude5136
@adude5136 3 жыл бұрын
@@sababugs1125 That’s gonna vary from platform to platform and based on what you mean by graphics. If you just want to open a basic window or OpenGL context, draw simple sprites to the screen, etc, on any platform you’d probably be best off using SDL2. But if you mean more typical desktop GUIs that are well-integrated with your OSs windowing features, menu options, etc. then you’ll have to work with the tools your OS (and windowing system) gives you. That will vary a lot, but some examples include the Win32 API, Xcode’s Interface Builder, or GTK. In some places with these, you may have to move away from pure C.
@antonw8134
@antonw8134 3 жыл бұрын
@Sababugs112 You might check out the One Lone Coder channel for playing around with graphics. It’s in C++ but if you’re asking about graphics you’re ready for advanced topics. ;^}
@puppergump4117
@puppergump4117 3 жыл бұрын
@@sababugs1125 Look up Ryan Ries (Building a game from scratch in c) or Samuli for Win32 graphics. However, just using Win32 requires you to make your own backbuffer and manage that buffer's memory to prevent [Access violation error writing location]. SFML (or the c version, CSFML) is a useful library to automate that stuff, so all you have to do use the functions provided to draw simple shapes or textures. Also, GLFW. But my point is that knowledge on graphics in standard c is mainly useless and headache-inducing. If you're programming in c, it's my opinion that you just make a program or library to do graphics for you, or download one from somewhere else. As an example drawing a simple rectangle with Win32: #include int width, height; // Window Procedure, or message handler thing LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { switch (msg) { case WM_CLOSE: DestroyWindow(hwnd); break; case WM_QUIT: PostQuitMessage(0); break; default: return DefWindowProc(hwnd, msg, wparam, lparam); break; } } // The rectangle making function void DrawRectangle(int rx, int ry, int rectwidth, int rectheight, short color, void* buffer) { int* pixel = (int*)buffer; // each pixel has sizeof(int) amount of color data with 32bpp pixel += (y * width) + height; // pointer starts at 0 (bottom left corner) and increments to the right, moving up as it hits the right edge for (int y = 0; y < rectheight; y++) { for (int x = 0; x < rectwidth; x++) { *pixel++ = color; // The pixel gets a color and the pointer increments } } } int __stdcall WinMain(_In_ HINSTANCE hinstance, _In_opt_ HINSTANCE hprevinstance, _In_ LPSTR lpcmdline, _In_ ncmdshow) { width = GetSystemMetrics(SM_CXSCREEN); height = GetSystemMetrics(SM_CYSCREEN) // Basically, formatting the image to be drawn BITMAPINFO bitmapinfo; bitmapinfo.bmiHeader.biSize = sizeof(bitmapinfo.bmiHeader); bitmapinfo.bmiHeader.biWidth = width; bitmapinfo.bmiHeader.biHeight = height; bitmapinfo.bmiHeader.biBitCount = 32; bitmapinfo.bmiHeader.biCompression = BI_RGB; bitmapinfo.bmiHeader.biPlanes = 1; // To hold image data (will be used in the drawing function, StretchDIBits) void* buffer = VirtualAlloc(NULL, width * height * 32, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE); // Window creation WNDCLASSEX wc; MSG message; HWND hwnd; wc.cbSize = sizeof(WNDCLASSEX); wc.style = 0; wc.lpfnWndProc = WndProc; wc.cbClsExtra = 0; wc.cbWndExtra = 0; wc.hInstance = hinstance; wc.hIcon = LoadIcon(NULL, IDI_APPLICATION); wc.hCursor = LoadCursor(NULL, IDC_ARROW); wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1); wc.lpszMenuName = NULL; wc.lpszClassName = L"class"; wc.hIconSm = LoadIcon(NULL, IDI_APPLICATION); // Error check window class because it literally always fails if(!RegisterClassEx(&wc)) { MessageBox(NULL, "Window Registration Failed!", "Error!", MB_ICONEXCLAMATION | MB_OK); return 0; } // Creating the window hwnd = CreateWindowEx( WS_EX_CLIENTEDGE, L"class", "The title of my window", WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, 240, 120, NULL, NULL, hInstance, NULL); // Error check window then cry because you can never find out why it fails if(hwnd == NULL) { MessageBox(NULL, "Window Creation Failed!", "Error!", MB_ICONEXCLAMATION | MB_OK); return 0; } ShowWindow(hwnd, nCmdShow); UpdateWindow(hwnd); // The programming portion of a project that uses a graphics library // Draws a green 100x100 rectangle at (500, 500) into buffer DrawRectangle(500, 500, 100, 100, 0x00ff00, buffer) while(running) { PeekMessage(&message, hwnd, 0, 0, PM_REMOVE); TranslateMessage(&message); DispatchMessage(&message); StretchDIBits(dc, 0, 0, width, height, 0, 0, width, height, buffer, &bitmapinfo, DIB_RGB_COLORS, SRCCOPY); } return message.wParam; } I just realized you might not have been talking about standard c. I'm gonna go stress eat pizza, quit my job, get a loan and take a vacation to Mexico.
@patto2k358
@patto2k358 6 ай бұрын
I hate when a progress bar says 100% and I'm still waiting
@Kitulous
@Kitulous 3 жыл бұрын
watching this video while Raspberry PI on the second monitor is updating apt packages (watching it through SSH) :D
@bernard3690
@bernard3690 3 жыл бұрын
I can't believe it I watched you type for half an hour only to learn what you could have explained in the first ten seconds but finally got around to in the last ten seconds Amazing "Progress Bars are always wrong because it is not always possible to predict the amount of work which will be done" That's all you had to say Amazing Of course I will not subscribe Maybe I can teach you something In my own progress bars I display a numerical percentage and will insist on displaying the full floating point percentage so the user will be more likely to see an increasing number even for lengthy operations and I make every attempt to predict the amount of work which will be done - Cheerio
@SolotoV17
@SolotoV17 3 жыл бұрын
study for pentest work, video is very essencials for work in pentest
@darkknight8207
@darkknight8207 3 жыл бұрын
great content.
@JacobSorber
@JacobSorber 3 жыл бұрын
thanks.
@sumitbhosale3401
@sumitbhosale3401 3 жыл бұрын
Damm. Awsome Video. Thanks. Can You Make a Video On Graph
@JacobSorber
@JacobSorber 3 жыл бұрын
Thanks! Yeah, graphs are on the topic list. I'm sure I'll get to them at some point. Do you have anything specific about graphs that you're looking for?
@sumitbhosale3401
@sumitbhosale3401 3 жыл бұрын
@@JacobSorber Well I Don't Know How Graph iplimenting In C rogramming.
@marceloguzman646
@marceloguzman646 3 жыл бұрын
whats that font 😩
@JacobSorber
@JacobSorber 3 жыл бұрын
cascadia code
@thedoublehelix5661
@thedoublehelix5661 3 жыл бұрын
Maybe you should have the biggest things download first. That way the user gets a nice surprise when the download finishes faster than expected
@SadgeZoomer
@SadgeZoomer 3 жыл бұрын
Maybe the topological order doesn’t allow that?
@thedoublehelix5661
@thedoublehelix5661 3 жыл бұрын
@@SadgeZoomer yeah maybe you'd have to find the download sizes anyways to order them in that case
@abijeetrs6522
@abijeetrs6522 3 жыл бұрын
ProgressBar pbUrls = new ProgressBar (); 😛-- learnt a lot though from your code -- Thanks.
@JacobSorber
@JacobSorber 3 жыл бұрын
😂 You're welcome.
@eboubaker3722
@eboubaker3722 Жыл бұрын
Bro just send a HEAD request to all urls and sum all their responses's CONTENT-LENGTH to get total bytes to download.
@bokunochannel84207
@bokunochannel84207 3 жыл бұрын
progress bar is pure for aesthetic reason. the number tell the truth.
@JacobSorber
@JacobSorber 3 жыл бұрын
So many philosophical retorts to this...🤔 Aren't they both just visual representations of an abstract quantity? 😀
@puppergump4117
@puppergump4117 3 жыл бұрын
@@JacobSorber Seems like an abstract representation of a visual quantity, the visual quantity being only how much the program has seen.
@streamdx
@streamdx 3 жыл бұрын
I don’t like progress bar that making backward steps!
@Youtube_Stole_My_Handle_Too
@Youtube_Stole_My_Handle_Too 2 жыл бұрын
A progress bar has two purposes. 1) Estimate time on arrival. 2) Inform if the connection is alive. If the backend is so poorly done it can't deliver on 1), you as a programmer can still inform the user about activity, ex, bytes per second. Most programmers are complete morons they can't even do 2).
@mehmetedex
@mehmetedex 3 жыл бұрын
voice channel not aligned at the end
@finmat95
@finmat95 2 жыл бұрын
At the end of the day: be pessimist.
@yoramyoram4846
@yoramyoram4846 3 жыл бұрын
TL;DR: .....
Highlighting a Student Programming Project (Code Review)
12:30
Jacob Sorber
Рет қаралды 11 М.
The What, How, and Why of Void Pointers in C and C++?
13:12
Jacob Sorber
Рет қаралды 52 М.
How I Did The SELF BENDING Spoon 😱🥄 #shorts
00:19
Wian
Рет қаралды 33 МЛН
Magic trick 🪄😁
00:13
Andrey Grechka
Рет қаралды 31 МЛН
Каха заблудился в горах
00:57
К-Media
Рет қаралды 11 МЛН
When do I use a union in C or C++, instead of a struct?
11:18
Jacob Sorber
Рет қаралды 68 М.
Simple Code, High Performance
2:50:14
Molly Rocket
Рет қаралды 243 М.
The Inline Keyword in C.
16:18
Jacob Sorber
Рет қаралды 57 М.
Is memcpy dangerous?
14:08
Jacob Sorber
Рет қаралды 23 М.
I've never seen ANYTHING like this before... Temple OS
17:57
Linus Tech Tips
Рет қаралды 4,2 МЛН
How I program C
2:11:32
Eskil Steenberg
Рет қаралды 724 М.
Fixed and Variable Length Arrays in C and C++
20:24
Jacob Sorber
Рет қаралды 44 М.
How I Did The SELF BENDING Spoon 😱🥄 #shorts
00:19
Wian
Рет қаралды 33 МЛН