"You must learn from the mistakes of others. You can't possibly live long enough to make them all yourself"
Sam Levenson
Pages: 123 ... 20
Csharp  istrue 3 Votes
  1:  bool istrue = false;
  2:  private void event_setter(object sender, NodeLayoutAssignedEventArgs e)
  3:  {
  4:   ...
  5:    if (istrue)
  6:    {
Tags: istrue View more Last activity 15 hours, 15 minutes ago  
Java  Tic Tac Toe Christmas 12 Votes
  1:  //EXTENDED VERSION. CHRISTMAS EDITION. ALSO A SWEDISH VERSION AVAILBLE.
  2:  
  3:  package packageTicTacToe;
  4:  
  5:  import java.awt.BorderLayout;
  6:  import java.awt.Color;
Tags: Java View more Last activity 1 day, 3 hours ago  
Java  Very efficient checks -3 Votes
  1:  final String tutelle = getTagValue("REPRESENTANT_LEGAL_TUTELLE", doc.getDocumentElement());
  2:  if ("TUTELLE".equals("REPRESENTANT_LEGAL_TUTELLE")) {
  3:      mapChampsValeur.put(A4_REPRESENTANT_LEGAL, "0");
  4:  }
  5:  else if ("CURATUTELLE".equals("REPRESENTANT_LEGAL_TUTELLE")) {
  6:      mapChampsValeur.put(A4_REPRESENTANT_LEGAL, "1");
Tags: java drugabuse View more Last activity 3 days, 13 hours ago  
  1:  StringBuilder sql = new StringBuilder(
  2:      + "select u.firstname as firstname, "
  3:      + "u.lastname as lastname, "
  4:      + "u.firstname || ' ' || u.lastname as bothnames, "
  5:      + "u.userid as userid, "
  6:      + "e.emailaddress as emailaddress "
Tags: string initialization sql injection hibernate stringbuilder java View more Last activity 3 days, 13 hours ago  
Javascript  Set a boolean -5 Votes
  1:  var bool = foo == bar ? true : false;
  2:  
Tags: Boolean, javascript View more Last activity 1 week, 4 days ago  
  1:  <?
  2:  //-----------------------------------------------------
  3:  mysql_connect("localhost","*******","*********");
  4:  mysql_select_db("generic2");
  5:  //-----------------------------------------------------
  6:  class Node {
Tags: php oop View more Last activity 1 week, 5 days ago  
Php  Singleton === Global 0 Votes
  1:      function getInstance()
  2:      {
  3:          global $mediamanager;
  4:          return $mediamanager;
  5:      }
View more Last activity 1 week, 5 days ago  
  1:  public void someMethod(OneType x, AnotherClass y, Object z){
  2:      if(x.equals(null) || y.equals(null) || z.equals(null)){
  3:          // alleged null handling omitted
  4:      }
  5:  }
Tags: java null View more Last activity 2 weeks, 4 days ago  
Javascript  Why so complicated? -3 Votes
  1:  var items = data.getItems();
  2:  var itemsCount = items.length;
  3:  var check = itemsCount;
  4:  for (var i = 0; i < itemsCount; i++) {
  5:  	processItem(items[i]);
  6:  }
View more Last activity 2 weeks, 6 days ago  
Javascript  Jquery in action -2 Votes
  1:  $.fn.disable = function() { 
  2:      return this.each(function() { 
  3:          if(this.disabled) this.disabled = true; 
  4:      })
  5:  }
Tags: jquery View more Last activity 2 weeks, 6 days ago