1
有一個程序員,入職了一家公司,上午剛剛寫下一段代碼,沒想到下午就有人事來通知他被開除了。

這個程序員表示很委屈。感覺這個方法,除了性能差一點,沒啥別的問題呀。。。
2
除了獲取時間以外,一位程序員因為自己寫了個排序算法,也被開除了。
3
統計用戶總數,這代碼還真是666呢。

4
前段時間網傳的價值一個億的AI核心代碼,你能看出其中的端倪嗎?

5
甩鍋俠瞭解一下。

6
英語不夠,拼音來湊。
<code>public void shit(){
// 本身邏輯沒什麼問題,就這個命名,中英混合
// 工作流中的 直接辦理到結束節點
// 節點類型是【辦到底】
boolean isbandaodi = confirmMenuindexOfActivityName(processdefinitionid, nextNodeName, "bandaodi");
if (isbandaodi) {
// 。。。
}
}/<code>
7
下面這段代碼的作者所在的公司,該不會是按代碼行數開工資的吧?
8
最後,下面這段代碼,看懂算我輸。
<code>//Stream 用的66的
final EventAction eventAction = redisObj(
EventActionKey + distributionEventId,
() -> Optional
.of(distributionEventId)
.map(eventId -> {
final EventActionExample example = new EventActionExample();
example.createCriteria()
.andEventIdEqualTo(eventId)
.andTriggerTypeEqualTo(EnumEventTriggerType.DISTRIBUTION_PURCHASE.getCode().byteValue());
return example;
})
.map(eventActionMapper::selectByExample)
.filter(StringUtil::isNotEmpty)
.map(e -> e.get(0)).orElseThrow(() -> ExceptionUtil.createParamException("事件觸發信息不存在"))
, EventAction.class);
final AwardConfig awardConfig = redisObj(EventConfigKey + eventAction.getId(),
() -> Optional.ofNullable(eventAction.getId())
.map(actionId -> {
final AwardConfigExample example = new AwardConfigExample();
example.createCriteria()
.andActionIdEqualTo(actionId);
return example;
})
.map(awardConfigMapper::selectByExample)
.filter(StringUtil::isNotEmpty)
.map(e -> e.get(0)).orElseThrow(() -> ExceptionUtil.createParamException("xxx")),
AwardConfig.class
);
Optional.of(req)
.map(e -> e.clueUid)
.map(id -> {
final ClueExample example = new ClueExample();
example.createCriteria()
.andClueUidEqualTo(id)
.andDeletedEqualTo(false)
.andReceivedEqualTo(false)
.andCreateTimeGreaterThan(now - cluetime);
example.setOrderByClause("create_time asc");
return example;
}) // 獲取該被邀請人所有未過期且未被領取的線索的線索
.map(clueMapper::selectByExample)
.filter(StringUtil::isNotEmpty)
.ifPresent(clues -> {
final ClueResp clueResp = Optional.of(req)
.filter(c -> {
c.count = clues.size();
return true;
})
.map(this::awardValue)
.orElseThrow(() -> ExceptionUtil.createParamException("參數錯誤"));
final Integer specialId = req.getIsHead()
? clues.get(0).getId()
: clues.get(clues.size() - 1).getId();
clues.stream()
.peek(clue -> {
final AwardConfig awardConfigclone = Optional.of(awardConfig)
.map(JSONUtil::obj2Json)
.map(json -> JSONUtil.json2Obj(json, AwardConfig.class))
.orElseGet(AwardConfig::new);
awardConfigclone.setMoney(
Optional.of(clue.getId())
.filter(specialId::equals)
.map(e -> clueResp.specialReward.longValue())
.orElse(clueResp.otherAverageReward.longValue())
);
eventActionService.assembleAward(
awardConfigclone,
clue.getAdviserUid(),
clue.getAdviserUid(),
clue.getClueUid(),
eventAction,
new PasMessageParam(),
clue.getId(),
AwardRelationType.Clud.code()
);
})
.forEach(clue -> {
clue.setOrderNo(req.orderNo);
clue.setCommodityName(req.commodityName);
clue.setOrderAmount(req.orderAmount);
clue.setReceived(true);
clue.setModifyTime(now);
clueMapper.updateByPrimaryKeySelective(clue);
});
}
);/<code>
https://gitee.com/oschina/bullshit-codes/tree/master/java
閱讀更多 JAVA技術刀 的文章