This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Java 29 hrs 6 mins ███████████████▏░░░░░ 72.5% | |
Groovy 3 hrs 49 mins ██░░░░░░░░░░░░░░░░░░░ 9.5% | |
C 3 hrs 37 mins █▉░░░░░░░░░░░░░░░░░░░ 9.0% | |
Text 1 hr 5 mins ▌░░░░░░░░░░░░░░░░░░░░ 2.7% | |
Bash 36 mins ▎░░░░░░░░░░░░░░░░░░░░ 1.5% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pthread_cond_t *condv = nullptr; | |
pthread_mutex_t *mlock = nullptr; | |
static data *phead = nullptr; | |
static void initLock() { | |
condv = new pthread_cond_t; | |
mlock = new pthread_mutex_t; | |
pthread_mutex_init(mlock, nullptr); | |
pthread_cond_init(condv, nullptr); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 在[range]范围内生成一个正的随机数 | |
* @param range 范围 | |
* @return 随机数 | |
*/ | |
static int randomNum(int range) { | |
// 用当前时间戳生成随机数种子 | |
time_t seed = time(0); | |
// 将随机数种子填写到随机数生成器里面 | |
srand(seed); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object StringProducer { | |
fun produce(): String? { | |
return "abc" | |
} | |
} | |
fun main() { | |
StringProducer.produce()?.let { | |
println(it) | |
} ?: run { |