"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
Php  \\Is this a supplement? -2 Votes
  1:          $is_supplement = false;
  2:          if((isset($_REQUEST['is_supplement'])
  3:              && $_REQUEST['is_supplement'])
  4:              || $is_real_supplement
  5:          )
  6:          {
Tags: php html to-be-sure-to-be-sure html View more Last activity 2 days, 20 hours ago  
Cpp  I don't trust "if" -125 Votes
  1:  if (result <= 10) {
  2:     handling();
  3:  }
  4:  else if (result > 10) {
  5:    otherHandling();
  6:  }
View more Last activity 2 days, 20 hours ago  
Java  Hello World! -1 Votes
  1:  import java.io.OutputStreamWriter;
  2:  import java.io.BufferedWriter;
  3:  
  4:  public class HelloWorldJoke {
  5:    public static void main(String[] commandLineArgumentStringArray) {
  6:      char[]charArrayHelloWorld=new char[] {72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100, 33, 10};
Tags: hello-world java bad View more Last activity 4 days, 17 hours ago  
Php  Array count 0 Votes
  1:  function arrayLength($array)
  2:  {
  3:      $i = 0;
  4:      foreach($array as $key => $value)
  5:      {
  6:          $i++; 
Tags: php,bad programming, View more Last activity 5 days, 12 hours ago  
  1:  public final boolean createZipFile(final String directory,
  2:  		final String zipFileName, final boolean overwrite) throws Exception {
  3:  	boolean created = false;
  4:  	final Map<String, String> env = new HashMap<>();
  5:  	env.put("create", "true");
  6:  	env.put("encoding", StandardCharsets.ISO_8859_1.displayName());
Tags: finally-block View more Last activity 5 days, 15 hours ago  
  1:  // SQL-query:
  2:  // "date" (int) -> cast (substring(cast(f.date as char(8)), 7,2) + '.' + substring(cast(f.date as char(8)), 5,2) + '.' + substring(cast(f.date as char(8)), 1,4) as smalldatetime) as 'myDateTime', 
  3:  
  4:  // C# snippet:
  5:  DateTime dateTime = DateTime.Parse(drv.Row["myDateTime"].ToString());
  6:  
Tags: SQL Date DateTime conversion smalldatetime day month year parse View more Last activity 5 days, 21 hours ago  
  1:  /*This code should compare the changes of two multi-dimensional boolean arrays but the applications manages 4 multi-dimensional changes. The original programmer designed the method to accept a List which will hold the result of the comparison of arrayOne vs arrayOneBackup and return a List of changes describing the differences in arrayTwo vs arrayTwoBackup.*/
  2:  
  3:  public List<ChangedValue> checkChangedValues(List<ChangedValue> personChanges) {
  4:          for (int i = 0; i < nbPersonReason; i++) {
  5:              for (int j = 0; j < nbPersonReason; j++) {
  6:                  if (personMappingTable[i][j] != origninPersonMappingTable[i][j]) {
Tags: java zkoss View more Last activity 6 days, 1 hour ago  
Csharp  How NOT to convert to decimal -4 Votes
  1:  // For reference, CalculatePrice() returns 'decimal', Model.Quantity is an int
  2:  decimal hprice = Model.CalculatePrice() * decimal.Parse(Model.Quantity.ToString());
Tags: decimal-conversion decimal conversion typecast type-cast View more Last activity 1 week, 4 days ago  
  1:  public static int arrayLength (int[] array) {
  2:      int length = 0;
  3:      while (true) {
  4:          try {
  5:              int n = array[length];
  6:              length++;
Tags: java while-loop try/catch array View more Last activity 2 weeks, 2 days ago  
  1:  /**
  2:  *created on: 23.06.2013 - 11:06
  3:  *created by: ke
  4:  *
  5:  *
  6:  *Changelog:
View more Last activity 2 weeks, 4 days ago