Mistři v programování na #hovnokod

Jak se na jedne nejmenovane vysoke skole v Brne zjistuje datum v C++

    // to add actual year of generated file
    time_t timeTmp = time(NULL);
    struct tm *actualTime = localtime(&timeTmp);
   templates["year"] = actualTime->tm_year + 1900;

Anonymous,


Anonymous,

je to jasne???

var fromId = lastId;
var nextId = fromId;
do
{
   fromId = nextId;
   ...
}(nextId != fromId);

Anonymous,

Holy crap. Co takhle kolekce pouzit kdyz uz je pouzivas kamo?! Tohle je zahravani si s peklem...

		eb.setRecipients(StringUtils.join(recipients, "; "));
		eb.setRecipients2(StringUtils.join(recipients2, "; "));
		eb.setRecipients3(recipients3);
		eb.setSubject(subject);
		eb.setBody(body);
		eb.setType("Outage");
		eb.setSentBy(user.getUserName());
		eb.setSentDate(now);
		eb.setUpdatedBy(user.getUserName());
		eb.setUpdatedDate(now);

		emailsDao.save(eb);
		emailsCache.put(eb.getId(), eb);

		// send email(s)
		try {
			Email email = new Email(subject, body, "text/html");
			if (!recipients.isEmpty()) {
				for (String recipient : recipients) {
					email.addTo(recipient + "@ourdomain.com");
				}
			}
			if (!recipients2.isEmpty()) {
				for (String recipient : recipients2) {
					email.addTo(recipient + "@ourdomain.com");
				}
			}
			if (recipients3.length() != 0) {
				String[] recipients3AsArray = recipients3.split(";");
				for (String recipient : recipients3AsArray) {
					email.addTo(recipient.trim());
				}
			}
			email.send();
		}

Anonymous,

def roll_dice():
    for i in range(1):
        if i == 6:
            print("6")
            return(random.randint(1,6))
        else:
            return(random.randint(1,6))
    print("166")
        
def analyse_rolls(count):
    total = 0
    sum_throws = 0
    while sum_throws < count:
        throw = random.randint(1,6)
        total +=1
    for i in range(len(count)):
        total += count[i]
    return (total /len(count)), (total)

Anonymous,