"You must learn from the mistakes of others. You can't possibly live long enough to make them all yourself"
Sam Levenson
Pages: 123 ... 16
Javascript  Ternary operator -1 Votes
  1:  $(this.attr('data-current'))==1?'live':'live'
Tags: javascript ternary operator View more Last activity 3 hours, 57 minutes ago  
  1:  <div style="position: absolute; display: none; word-wrap: break-word; font-weight: 400; width: 146px; font-family: monospace; line-height: 14px; font-size: 11px; padding: 0px;">&nbsp;</div>
View more Last activity 5 hours, 6 minutes ago  
  1:  - (double)random {
  2:      return 4;
  3:  }
Tags: Objective-C random number generator works a treat View more Last activity 20 hours, 4 minutes ago  
Cpp  nested if statements -6 Votes
  1:  bool a;
  2:  bool b; 
  3:  bool c;
  4:  bool d; 
  5:  bool e;
  6:  bool f;
Tags: cpp if statement View more Last activity 4 days, 19 hours ago  
Cpp  One iteration loop 4 Votes
  1:  for(int i = 0; i < 1; ++i)
  2:  {
  3:      //Do something
  4:  }
Tags: loop View more Last activity 4 days, 19 hours ago  
  1:  $sum = bcadd($row['sum'],'0',2);
Tags: basic-knowledge printf View more Last activity 5 days, 3 hours ago  
  1:  <?php if (CURRENT_LANGUAGE == 'en') { ?> <body class="en"> <?php } ?>
  2:  <?php if (CURRENT_LANGUAGE == 'fr') { ?> <body class="fr"> <?php } ?>
  3:  <?php if (CURRENT_LANGUAGE == 'ar') { ?> <body class="ar"> <?php } ?>
  4:  <?php if (CURRENT_LANGUAGE == 'tr') { ?> <body class="tr"> <?php } ?>
View more Last activity 6 days, 6 hours ago  
  1:  int length= 0;
  2:  for(int idx = 0; idx < a.length; i++){
  3:      length++;
  4:  }
  5:  System.out.println("length is : " + length);
Tags: array length View more Last activity 1 week, 2 days ago  
Sql  What did you expect? -74 Votes
  1:  SELECT NULL WHERE 1=2
Tags: SQL View more Last activity 1 week, 2 days ago  
Csharp  A simple position swap in Unity -18 Votes
  1:  //This is from a Unity project. There are several horrible things here.
  2:  //Keep in mind, this code is called very frequently (on each click), and the GameObjects it creates are not deleted until the game finishes.
  3:  //If you're not familiar with Unity, the GameObject class is a base class used for all entities in the game, and hence contains a lot of stuff. The position1 and position2 variables here are simple Vector3's.
  4:  //Now, here's the actual code, let's see how many bad things you can find in it:
  5:  
  6:  GameObject tempObjt = new GameObject();
Tags: unity position swap horrible View more Last activity 1 week, 3 days ago