/** * lowercase letters */
        $this->store['upper_Spec'] = array( *cut* );
        /** * uppercase letters */
        $this->store['lower_Spec'] = array( *cut* );
      
                    } else {
                      $errmsg='An unknown error occured.';
                    }
                  } else {
                    $errmsg='The passwords you entered do not match';
                  }
                } else {
                  $errmsg='Password has to be at least 8 characters long.';
                }
              } else {
                $errmsg='The email you entered is already in our database.';
              }
            } else {
              $errmsg='Please enter your email address.';
            }
          } else {
            $errmsg='Please enter your first name and your last name.';
          }
        } else {
        (...)
      
        // Happy debugging, suckers
        # define true (rand() > 10)
      

+1

// Indentation was a total mess
// This is my first post!

if((znak == 'a') || 
     (znak == 'B') || 
     (znak == 'c') || 
     (znak == 'D') || 
     (znak == 'e') || 
     (znak == 'F') || 
     (znak == 'g') || 
     (znak == 'H') || 
     (znak == 'i') || 
     (znak == 'J') || 
     (znak == 'k') || 
     (znak == 'L') || 
     (znak == 'm') || 
     (znak == 'N') || 
     (znak == 'o') || 
     (znak == 'P') || 
     (znak == 'q') || 
     (znak == 'R') || 
     (znak == 's') || 
     (znak == 'T') || 
     (znak == 'u') || 
     (znak == 'V') || 
     (znak == 'w') || 
     (znak == 'X') || 
     (znak == 'y') || 
     (znak == 'Z'))
    {
        tab_a[i][j] = 0;
    }
else if((znak == 'A') || 
            (znak == 'b') || 
                (znak == 'C') || 
                (znak == 'd') || 
                (znak == 'E') || 
                (znak == 'f') || 
                (znak == 'G') || 
                (znak == 'h') || 
                (znak == 'I') || 
                (znak == 'j') || 
                (znak == 'K') || 
                (znak == 'l') || 
                (znak == 'M') || 
                (znak == 'n') || 
                (znak == 'O') || 
                (znak == 'p') || 
                (znak == 'Q') || 
                (znak == 'r') || 
                (znak == 'S') || 
                (znak == 't') || 
                (znak == 'U') || 
                (znak == 'v') || 
                (znak == 'W') || 
                (znak == 'x') || 
                (znak == 'Y') || 
                (znak == 'z'))
    {
        tab_a[i][j] = 1;
    }
 

anonymous

+1

using System;
using System.Collections;
using System.Collections.Generic;

namespace xyz
{
  public static partial class CommandInterpreter
  {
    private struct StrStrA
    {
      public string str;
      public string[] str_a;
    };

    private struct StrStrStrA
    {
      public string str1;
      public string str2;
      public string[] str_a;
    };

    private struct StrStrStrStrA
    {
      public string str1;
      public string str2;
      public string str3;
      public string[] str_a;
    };

    private struct StrStrStrStrStrA
    {
      public string str1;
      public string str2;
      public string str3;
      public string str4;
      public string[] str_a;
    };

    private struct StrStr
    {
      public string str1;
      public string str2;
    };

    private struct StrStrStr
    {
      public string str1;
      public string str2;
      public string str3;
    };


    private static StrStrA GetStringStringArray(string[] tcl_params)
    {
      StrStrA p = new StrStrA();
      if (tcl_params.Length > 1)
      {
        p.str = tcl_params[1];
        p.str_a = new string[tcl_params.Length - 2];
        Array.Copy(tcl_params, 2, p.str_a, 0, tcl_params.Length - 2);
      }

      return p;
    }

    private static StrStrStrA GetStringStringStringArray(string[] tcl_params)
    {
      StrStrStrA p = new StrStrStrA();
      if (tcl_params.Length > 1)
        p.str1 = tcl_params[1];
      if (tcl_params.Length > 2)
      {
        p.str2 = tcl_params[2];
        p.str_a = new string[tcl_params.Length - 3];
        Array.Copy(tcl_params, 3, p.str_a, 0, tcl_params.Length - 3);
      }

      return p;
    }

    private static StrStrStrStrA GetStringStringStringStringArray(string[] tcl_params)
    {
      StrStrStrStrA p = new StrStrStrStrA();
      if (tcl_params.Length > 1)
        p.str1 = tcl_params[1];
      if (tcl_params.Length > 2)
        p.str2 = tcl_params[2];
      if (tcl_params.Length > 3)
      {
        p.str3 = tcl_params[3];
        p.str_a = new string[tcl_params.Length - 4];
        Array.Copy(tcl_params, 4, p.str_a, 0, tcl_params.Length - 4);
      }

      return p;
    }

    private static StrStrStrStrStrA GetStringStringStringStringStringArray(string[] tcl_params)
    {
      StrStrStrStrStrA p = new StrStrStrStrStrA();
      if (tcl_params.Length > 1)
        p.str1 = tcl_params[1];
      if (tcl_params.Length > 2)
        p.str2 = tcl_params[2];
      if (tcl_params.Length > 3)
        p.str3 = tcl_params[3];
      if (tcl_params.Length > 4)
      {
        p.str4 = tcl_params[4];
        p.str_a = new string[tcl_params.Length - 5];
        Array.Copy(tcl_params, 5, p.str_a, 0, tcl_params.Length - 5);
      }

      return p;
    }

    private static string GetString(string[] tcl_params)
    {
      if (tcl_params.Length > 1)
        return tcl_params[1];
      else
        return String.Empty;
    }

    private static StrStr GetStringString(string[] tcl_params)
    {
      StrStr s = new StrStr();
      if (tcl_params.Length > 1)
        s.str1 = tcl_params[1];
      if (tcl_params.Length > 2)
        s.str2 = tcl_params[2];

      return s;
    }

    private static StrStrStr GetStringStringString(string[] tcl_params)
    {
      StrStrStr s = new StrStrStr();
      if (tcl_params.Length > 1)
        s.str1 = tcl_params[1];
      if (tcl_params.Length > 2)
        s.str2 = tcl_params[2];
      if (tcl_params.Length > 3)
        s.str3 = tcl_params[3];

      return s;
    }

    private static bool IsNumber(string value)
    {
      int test;
      return Int32.TryParse(value, out test);
    }

    private static Dictionary<string, string> GetKeyValueParameters(string[] pargs)
    {
      Dictionary<string, string> dictionary = new Dictionary<string, string>();
      string paramChache = "";
      for (int i = 0; i < pargs.Length; i++)
      {//Elfogadott paraméterformátum: -paraméterAzonosító paraméterÉrték
        if (paramChache.Length > 0 && paramChache[0] == Globals.Instance.ParamDelimiter)
        {
          if (pargs[i].Length > 0)
          {
            if (pargs[i][0] != Globals.Instance.ParamDelimiter ||
              (pargs[i][0] == Globals.Instance.ParamDelimiter && pargs[i].Length == 1) ||
              (pargs[i][0] == Globals.Instance.ParamDelimiter && CommandInterpreter.IsNumber(pargs[i])))
            {
              dictionary.Add(paramChache.Substring(1), pargs[i]);
            }
          }
          else
            dictionary.Add(paramChache.Substring(1), String.Empty);
        }
        paramChache = pargs[i];
      }

      return dictionary;
    }


  }

}
 

+1

// my coworker is excited about the Java 8 stream api, so he uses it anywhere it's possible

if (list.stream().count() > 0) {
    // do something
}
 

anonymous

0

//This does not need any further explanation. Found on a large project I've inherited.

success = success && true;
 

+1

public Optional<User> getCurrentUser() {
  ...
  if (user != null) {
    return Optional.of(user);
  }
  return null;
}
 

anonymous

+1

// found today in some large system, simplified

// veryImportantFile.cpp
#define HALF (arg/2)

// ... a lot of code ....

int veryImportantFunction(int arg)
{
  return HALF;
}
 

+1

.page-hom .home-we-location #locations .50                                                             { width: 100% }
 

anonymous

+1

if ([][0] || "".includes("/")){
    ...
}
 

+1

##Import files
df1=fread("Master_September 26, 2018_08.18.000.csv")
df2=fread("Master_September 26, 2018_08.18.001.csv")
df3=fread("Master_September 26, 2018_08.18.002.csv")
df4=fread("Master_September 26, 2018_08.18.003.csv")
df5=fread("Master_September 26, 2018_08.18.004.csv")
df6=fread("Master_September 26, 2018_08.18.005.csv")
df7=fread("Master_September 26, 2018_08.18.006.csv")
df8=fread("Master_September 26, 2018_08.18.007.csv")
df9=fread("Master_September 26, 2018_08.18.008.csv")
df10=fread("Master_September 26, 2018_08.18.009.csv")

##Remove duplicate column
df1=df1[,-50]
df2=df2[,-50]
df3=df3[,-50]
df4=df4[,-50]
df5=df5[,-50]
df6=df6[,-50]
df7=df7[,-50]
df8=df8[,-50]
df9=df9[,-50]
df10=df10[,-50]

##Reduce columns
df1=sqldf('select Finished,ResponseId,RecordedDate,UserLanguage,S1,S1a,S2_1,S2_2,S2_3,S2_4,S2_5,M1,M2,Country,SelectedTP,E1,E2,E2a,E2a_9_TEXT,E2b_1,E2b_2,E2b_3,E2b_4,E2b_5,E2b_6,E3_1,E3_2,E3_3,E3_4,E3_5,E3_6,E4,E1a from df1')
df2=sqldf('select Finished,ResponseId,RecordedDate,UserLanguage,S1,S1a,S2_1,S2_2,S2_3,S2_4,S2_5,M1,M2,Country,SelectedTP,E1,E2,E2a,E2a_9_TEXT,E2b_1,E2b_2,E2b_3,E2b_4,E2b_5,E2b_6,E3_1,E3_2,E3_3,E3_4,E3_5,E3_6,E4,E1a from df2')
df3=sqldf('select Finished,ResponseId,RecordedDate,UserLanguage,S1,S1a,S2_1,S2_2,S2_3,S2_4,S2_5,M1,M2,Country,SelectedTP,E1,E2,E2a,E2a_9_TEXT,E2b_1,E2b_2,E2b_3,E2b_4,E2b_5,E2b_6,E3_1,E3_2,E3_3,E3_4,E3_5,E3_6,E4,E1a from df3')
df4=sqldf('select Finished,ResponseId,RecordedDate,UserLanguage,S1,S1a,S2_1,S2_2,S2_3,S2_4,S2_5,M1,M2,Country,SelectedTP,E1,E2,E2a,E2a_9_TEXT,E2b_1,E2b_2,E2b_3,E2b_4,E2b_5,E2b_6,E3_1,E3_2,E3_3,E3_4,E3_5,E3_6,E4,E1a from df4')
df5=sqldf('select Finished,ResponseId,RecordedDate,UserLanguage,S1,S1a,S2_1,S2_2,S2_3,S2_4,S2_5,M1,M2,Country,SelectedTP,E1,E2,E2a,E2a_9_TEXT,E2b_1,E2b_2,E2b_3,E2b_4,E2b_5,E2b_6,E3_1,E3_2,E3_3,E3_4,E3_5,E3_6,E4,E1a from df5')
df6=sqldf('select Finished,ResponseId,RecordedDate,UserLanguage,S1,S1a,S2_1,S2_2,S2_3,S2_4,S2_5,M1,M2,Country,SelectedTP,E1,E2,E2a,E2a_9_TEXT,E2b_1,E2b_2,E2b_3,E2b_4,E2b_5,E2b_6,E3_1,E3_2,E3_3,E3_4,E3_5,E3_6,E4,E1a from df6')
df7=sqldf('select Finished,ResponseId,RecordedDate,UserLanguage,S1,S1a,S2_1,S2_2,S2_3,S2_4,S2_5,M1,M2,Country,SelectedTP,E1,E2,E2a,E2a_9_TEXT,E2b_1,E2b_2,E2b_3,E2b_4,E2b_5,E2b_6,E3_1,E3_2,E3_3,E3_4,E3_5,E3_6,E4,E1a from df7')
df8=sqldf('select Finished,ResponseId,RecordedDate,UserLanguage,S1,S1a,S2_1,S2_2,S2_3,S2_4,S2_5,M1,M2,Country,SelectedTP,E1,E2,E2a,E2a_9_TEXT,E2b_1,E2b_2,E2b_3,E2b_4,E2b_5,E2b_6,E3_1,E3_2,E3_3,E3_4,E3_5,E3_6,E4,E1a from df8')
df9=sqldf('select Finished,ResponseId,RecordedDate,UserLanguage,S1,S1a,S2_1,S2_2,S2_3,S2_4,S2_5,M1,M2,Country,SelectedTP,E1,E2,E2a,E2a_9_TEXT,E2b_1,E2b_2,E2b_3,E2b_4,E2b_5,E2b_6,E3_1,E3_2,E3_3,E3_4,E3_5,E3_6,E4,E1a from df9')
df10=sqldf('select Finished,ResponseId,RecordedDate,UserLanguage,S1,S1a,S2_1,S2_2,S2_3,S2_4,S2_5,M1,M2,Country,SelectedTP,E1,E2,E2a,E2a_9_TEXT,E2b_1,E2b_2,E2b_3,E2b_4,E2b_5,E2b_6,E3_1,E3_2,E3_3,E3_4,E3_5,E3_6,E4,E1a from df10')

##Append data and Output to CSV
L1 = list(df1,df2,df3,df4,df5,df6,df7,df8,df9,df10)
 

anonymous

+1

//  found in several places of a program from one coder during his vacations
// when asked about he replied it is taking the absolute value of axisX

axisX=axisX*axisX/axisX