Перейти к содержанию
Посмотреть в приложении

A better way to browse. Learn more.

Форум Академгородка, Новосибирск

A full-screen app on your home screen with push notifications, badges and more.

Чтобы установить это приложение на iOS и iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
Чтобы установить это приложение на Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Namespacing and Code Organization

Опубликовано

Если не сложно, то очень хотелось бы посмотреть на чужие кода. Какой код для вас идеальный, какой наглядный. Или вам вообще все равно, главное чтобы работало?

Не важно какоя язык. Важно как вы даете названия кирпичикам вашего проекта. От переменных функции/процедуры до названия классов.

 

https://academ.club/html/emoticons/smile.gif

Рекомендуемые сообщения

Опубликовано

В имени переменной указываю ёё тип.

Каждое слово в переменной с большой буквы (iMaxSize)

Имена функций иногда вот так get_list () или getList ()

/me Новичок...

Опубликовано

надо уметь читать/писать в любых нотациях https://academ.club/html/emoticons/smile.gif

 

ну и лично мне, больше всего нравицо gnu(? не помню точно) нотация.

 

namespace foo {
class Bar { 
  void method_with_spaces_as_undescores() {}
private: 
  int _member; 
};
}

 

хотя чаще всего приходится писать в java нотации или в венгерке https://academ.club/html/emoticons/_censored_.gif

 

PS: тема какая-то бессмысленная. вы бы хоть голосование вывесили. или надпись: "венгерка ацтой!!!"

Изменено пользователем Гость

Опубликовано

BOOL
GetPasswordExpired (
   IN LARGE_INTEGER PasswordLastSet,
   IN LARGE_INTEGER MaxPasswordAge
   )

/*++

Routine Description:

   This routine returns true if the password is expired, false otherwise.

Arguments:

   PasswordLastSet - Time when the password was last set for this user.

   MaxPasswordAge - Maximum password age for any password in the domain.

Return Value:

   Returns true if password is expired.  False if not expired.

--*/
{
   LARGE_INTEGER PasswordMustChange;
   NTSTATUS Status;
   BOOLEAN rc;
   LARGE_INTEGER TimeNow;

   //
   // Compute the expiration time as the time the password was
   // last set plus the maximum age.
   //

   if ( PasswordLastSet.QuadPart < 0 || MaxPasswordAge.QuadPart > 0 ) {

       rc = TRUE;      // default for invalid times is that it is expired.

   } else {

       try {

           PasswordMustChange.QuadPart =
               PasswordLastSet.QuadPart - MaxPasswordAge.QuadPart;
           //
           // Limit the resultant time to the maximum valid absolute time
           //

           if ( PasswordMustChange.QuadPart < 0 ) {

               rc = FALSE;

           } else {

               Status = QuerySystemTime( &TimeNow );
               if (NT_SUCCESS(Status)) {

                   if ( TimeNow.QuadPart >= PasswordMustChange.QuadPart ) {
                       rc = TRUE;

                   } else {

                       rc = FALSE;
                   }
               } else {
                   rc = FALSE;     // won't fail if QuerySystemTime failed.
               }
           }

       } except(EXCEPTION_EXECUTE_HANDLER) {

           rc = TRUE;
       }
   }

   return rc;

}  // GetPasswordExpired

 

;)))

Присоединяйтесь к обсуждению

Вы можете написать сейчас и зарегистрироваться позже. Если у вас есть аккаунт, авторизуйтесь, чтобы опубликовать от имени своего аккаунта.

Гость
Ответить в этой теме...

Аккаунт

Навигация

Поиск

Поиск

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.