>DansTonCode();

Tous les codes sources "Mais pourquoi ?"page 19

C#
 21 August, 2014 à 05:14
#116
/// <summary>
/// We want to check if record date is proper.
/// </summary>
/// <returns>TRUE if Ok.</returns>
public bool IsRecordDateIsOk()
{
  int act, min, max;

  /* We compare only the date, not the time */

  act = System.DateTime.Now.Year * 10000 + System.DateTime.Now.Month * 100 + System.DateTime.Now.Day;
  min = this.recordDate.Year * 10000 + this.recordDate.Month * 100 + this.recordDate.Day;
  max = this.dateMax.Year * 10000 + this.dateMax.Month * 100 + this.dateMax.Day;

  if ((min <= act) && (act <= max))
  {
    return (true);
  }
  else
  {
    return (false);
  }
}
PHP
 20 August, 2014 à 09:04
#104
if (q.exec('SELECT * FROM admins WHERE username LIKE :username AND password LIKE :password', user, pass).num() > 0) {
 ... giving admin privileges ...
ActionScript
 19 August, 2014 à 11:24
#103
switch(page) {
		case 0:
			showCurrentCar(page);
			hidePreviousCar(currentModel);
			currentModel = page;
			break;
		case 1:
			showCurrentCar(page);
			hidePreviousCar(currentModel);
			currentModel = page;
			break;
		case 2:
			showCurrentCar(page);
			hidePreviousCar(currentModel);
			currentModel = page;
			break;
		case 3:
			showCurrentCar(page);
			hidePreviousCar(currentModel);
			currentModel = page;
			break;
}