"You must learn from the mistakes of others. You can't possibly live long enough to make them all yourself"
Sam Levenson
Pages: 123 ... 22
  1:  
  2:  // msg is some global structure
  3:  // they were wondering why program was stalling for a while
  4:  
  5:  void clearmsgdata()
  6:  {
Tags: C++ inefficiant bug semantic_error View more Last activity 1 day, 16 hours ago  
  1:  - (BOOL)detectIfMathWorks {
  2:  	if ((7*3) == 4) {
  3:  		return NO;
  4:  	} else {
  5:  		return YES;
  6:  	}
Tags: objective-c, detect, fault, alu, robust, efficient View more Last activity 4 days, 4 hours ago  
Java  MINUS 1 Votes
  1:  int a = - --b - - --c;
  2:  
  3:  Clarifying:
  4:  int a = - (--b) - (-(--c));
Tags: java decrement minus View more Last activity 6 days, 6 hours ago  
  1:  Integer.toString((byteVal & 0xff) + 0x100, 16).substring(1)
Tags: bangalore leading zeroes View more Last activity 1 week ago  
  1:  USE database_test
Tags: database,production View more Last activity 1 week ago  
Csharp  Magic class name -1 Votes
  1:  if (docVal.docID != null && DoNotMaslate())
  2:  {
  3:  	Maslator.Maslate(docVal);
  4:  	ForceMaslate = true;
  5:  }
  6:  
Tags: c# magicnames View more Last activity 1 week, 4 days ago  
Java  Thorough variable check -81 Votes
  1:  if(status!= null){	
  2:  	if(status == true || status == false ){
  3:  		Integer i = status == true ? 1 : 0 ;
  4:  		select.append(" AND C.IN_STATUS = ").append("'").append(i).append("'");
  5:  }
Tags: unnecessary checking View more Last activity 1 week, 6 days ago  
  1:  try{
  2:     task();
  3:  } catch(IOException | IllegalArgumentException | NullPointerException ex){
  4:     if (ex.getClass() == IOException.class){
  5:         ioError();
  6:     } else if (ex.getClass() == IllegalArgumentException.class){
Tags: exception,multicatch View more Last activity 2 weeks, 1 day ago  
  1:  public void testMethodDoesNotThrownException() {
  2:    try {
  3:      myObjectUnderTest.doSomething();
  4:    } catch (MyException e) {
  5:      assertNull(e);
  6:    }
Tags: JUnit java View more Last activity 2 weeks, 3 days ago  
Csharp  Optimized my loops -1 Votes
  1:  public static void BetterFor(Action<int> action, int count) {
  2:      int i = 0;
  3:  start:
  4:      if (i < count) {
  5:          action(i);
  6:          i++;
Tags: C# for loops optimization goto View more Last activity 2 weeks, 5 days ago