-Поиск по дневнику

Поиск сообщений в rss_thedaily_wtf

 -Подписка по e-mail

 

 -Постоянные читатели

 -Статистика

Статистика LiveInternet.ru: показано количество хитов и посетителей
Создан: 06.04.2008
Записей:
Комментариев:
Написано: 0


CodeSOD: Making Progress

Среда, 10 Июня 2015 г. 13:30 + в цитатник

Whenever a program needs to perform a long running process, its important that it supplies some sort of progress indicator, so the user knows that its running. Sometimes its a throbber, a progress bar, an hourglass, or the infamous spinning beachball of death.


Ready for Geocities…

Carol inherited this PHP code, which wants to use a series of dots (&.)

/*snip */

$count = 0;

while ($task) {

    /* run the task */

    $count++;
    if ($count == 50) {
         $dots = ".";
         if ($dotCount == 2) {
            $dots = "..";
         }
         if ($dotCount == 3) {
            $dots = "...";
         }
         if ($dotCount == 4) {
            $dots = "....";
         }
         if ($dotCount == 5) {
            $dots = ".....";
         }
         if ($dotCount == 6) {
            $dots = "......";
         }
         $dotCount++;
         if ($dotCount >= 7) {
            $dotCount = 1;
         }
    }
}

/*snip */

Lets wait and see if the original developer can come up with a better idea

[Advertisement] Use NuGet or npm? Check out ProGet, the easy-to-use package repository that lets you host and manage your own personal or enterprise-wide NuGet feeds and npm repositories. It's got an impressively-featured free edition, too!

http://thedailywtf.com/articles/making-progress

Метки:  

 

Добавить комментарий:
Текст комментария: смайлики

Проверка орфографии: (найти ошибки)

Прикрепить картинку:

 Переводить URL в ссылку
 Подписаться на комментарии
 Подписать картинку