1. Список говнокодов пользователя megatraher

    Всего: 3

  2. JavaScript / Говнокод #19207

    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
    function saveTrainingData() {
    
        function getStorylineCsvStr(lineNumber) {
            var storyline = loadedLines[lineNumber];
            var csvStr = "";
            for (var i = 0; i < storyline.entities.length; i++) {
                if (i > 0) {
                    csvStr = csvStr + ",";
                }
                var entityName = storyline.entities[i].name;
    
                if (storyline.entities[i].relation != null && storyline.entities[i].relation.length > 0) {
                    for (var j = 0; j < storyline.entities[i].relation.length; j++) {
                        if ($("#relation-checkbox-" + lineNumber + "-" + i + "-" + j).is(":checked")) {
                            entityName = entityName + ":" + storyline.entities[i].relation[j];
                        }
                    }
                }
    
                if (entityName.indexOf(",") >= 0 || entityName.indexOf("\"") >= 0) {
                    if (entityName.indexOf("\"") >= 0) {
                        entityName = entityName.replace(/"/g, "\"\"");
                    }
                    entityName = "\"" + entityName + "\"";
                }
                csvStr = csvStr + entityName;
            }
            return csvStr;
        }
    
        var trainingData = "";
        $(".training").each(function (index, element) {
            var trainingHolder = $(element);
            var lineNumber = trainingHolder.attr("line-number");
            if (trainingHolder.find(".positive").is(":checked")) {
                trainingData = trainingData + getStorylineCsvStr(lineNumber) + ",1\n";
            } else if (trainingHolder.find(".negative").is(":checked")) {
                trainingData = trainingData + getStorylineCsvStr(lineNumber) + ",0\n";
            }
        });
    
        var groupId = $('#group-name-selector :selected').val();
        var bandType = $('#band-selector').val();
    
        sendRequest("/app/view/set/trainingData", {
            trainingData: trainingData,
            groupId: groupId,
            bandType: bandType
        }, true, true);
    }

    meow

    megatraher, 21 Декабря 2015

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

    −45

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    //Create new collection
                TweetsCollection tweetsCollection = new TweetsCollection(userHref, userName,
                        collectionName,
                        keywords,
                        0,
                        0,
                        storeFolder,
                        false,
                        null, null, null, null, null,
                        null, null, null, null, null, null, null,
                        null
                );

    Да.

    megatraher, 26 Ноября 2015

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

    −37

    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
    String createCollection(
                @RequestParam(value = "taskName") String taskName,
                @RequestParam(value = "keywords") String keywords,
    
                @RequestParam(value = "singleStart") String singleStart,
    
                @RequestParam(value = "tweetsQuantityLimit", required = false) Integer tweetsQuantityLimit,
                @RequestParam(value = "timeLimit", required = false) Integer timeLimit,
    
                @RequestParam(value = "timeZoneId", required = false) String timeZoneId,
                @RequestParam(value = "startDate", required = false) String startDate,
                @RequestParam(value = "stopDate", required = false) String stopDate,
    
                @RequestParam(value = "inSunday", required = false) Boolean inSunday,
                @RequestParam(value = "startSunday", required = false) Integer startSunday,
                @RequestParam(value = "timeSunday", required = false) Integer timeSunday,
                @RequestParam(value = "tweetsQuantitySunday", required = false) Integer tweetsQuantitySunday,
                @RequestParam(value = "inMonday", required = false) Boolean inMonday,
                @RequestParam(value = "startMonday", required = false) Integer startMonday,
                @RequestParam(value = "timeMonday", required = false) Integer timeMonday,
                @RequestParam(value = "tweetsQuantityMonday", required = false) Integer tweetsQuantityMonday,
                @RequestParam(value = "inTuesday", required = false) Boolean inTuesday,
                @RequestParam(value = "startTuesday", required = false) Integer startTuesday,
                @RequestParam(value = "timeTuesday", required = false) Integer timeTuesday,
                @RequestParam(value = "tweetsQuantityTuesday", required = false) Integer tweetsQuantityTuesday,
                @RequestParam(value = "inWednesday", required = false) Boolean inWednesday,
                @RequestParam(value = "startWednesday", required = false) Integer startWednesday,
                @RequestParam(value = "timeWednesday", required = false) Integer timeWednesday,
                @RequestParam(value = "tweetsQuantityWednesday", required = false) Integer tweetsQuantityWednesday,
                @RequestParam(value = "inThursday", required = false) Boolean inThursday,
                @RequestParam(value = "startThursday", required = false) Integer startThursday,
                @RequestParam(value = "timeThursday", required = false) Integer timeThursday,
                @RequestParam(value = "tweetsQuantityThursday", required = false) Integer tweetsQuantityThursday,
                @RequestParam(value = "inFriday", required = false) Boolean inFriday,
                @RequestParam(value = "startFriday", required = false) Integer startFriday,
                @RequestParam(value = "timeFriday", required = false) Integer timeFriday,
                @RequestParam(value = "tweetsQuantityFriday", required = false) Integer tweetsQuantityFriday,
                @RequestParam(value = "inSaturday", required = false) Boolean inSaturday,
                @RequestParam(value = "startSaturday", required = false) Integer startSaturday,
                @RequestParam(value = "timeSaturday", required = false) Integer timeSaturday,
                @RequestParam(value = "tweetsQuantitySaturday", required = false) Integer tweetsQuantitySaturday,
    
                @RequestParam(value = "autoStart") Boolean autoStart,
                @RequestParam(value = "wrkId", required = false) Long wrkId,
                @RequestParam(value = "wrkName") String wrkName,
                @RequestParam(value = "rptName") String rptName,
                @RequestParam(value = "rptKeywords") String rptKeywords,
                @RequestParam(value = "rptEntityNetworkDistance") Integer rptEntityNetworkDistance,
                @RequestParam(value = "grpId", required = false) Long grpId,
                @RequestParam(value = "grpName", required = false) String grpName,
                @RequestParam(value = "autoStorylineClusters", required = false) Boolean autoStorylineClusters,
                @RequestParam(value = "autoStorylineTopics", required = false) Boolean autoStorylineTopics,
                @RequestParam(value = "autoClassificationScores", required = false) Boolean autoClassificationScores,
                @RequestParam(value = "autoMarketingScores", required = false) Boolean autoMarketingScores

    Контроллер с входными параметрами.

    megatraher, 16 Ноября 2015

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