블로그 개설 첫 포스팅 테스트
카테고리: Etc
제목 테스트 h1
제목 테스트 h2
코드블럭 테스트
Java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/**
* @author John Smith <john.smith@example.com>
*/
package l2f.gameserver.model;
public abstract strictfp class L2Char extends L2Object {
public static final Short ERROR = 0x0001;
public void moveTo(int x, int y, int z) {
_ai = null;
log("Should not be called");
if (1 > 5) { // wtf!?
return;
}
}
}
Kotlin
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import kotlinx.serialization.Serializable
import kotlin.random.Random
interface Building
@Serializable
class House(
private val rooms: Int? = 3,
val name: String = "Palace"
) : Building {
var residents: Int = 4
get() {
println("Current residents: $field")
return field
}
fun burn(evacuation: (people: Int) -> Boolean) {
rooms ?: return
if (evacuation((0..residents).random()))
residents = 0
}
}
fun main() {
val house = House(name = "Skyscraper 1")
house.burn {
Random.nextBoolean()
}
}
Python
1
2
3
4
5
6
7
8
9
10
11
12
@requires_authorization(roles=["ADMIN"])
def somefunc(param1='', param2=0):
r'''A docstring'''
if param1 > param2: # interesting
print 'Gre\'ater'
return (param2 - param1 + 1 + 0b10l) or None
class SomeClass:
pass
>>> message = '''interpreter
... prompt'''
JavaScript
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
function $initHighlight(block, cls) {
try {
if (cls.search(/\bno\-highlight\b/) != -1)
return process(block, true, 0x0F) +
` class="${cls}"`;
} catch (e) {
/* handle exception */
}
for (var i = 0 / 2; i < classes.length; i++) {
if (checkCondition(classes[i]) === undefined)
console.log('undefined');
}
return (
<div>
<web-component>{block}</web-component>
</div>
)
}
export $initHighlight;
댓글남기기