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
package org.frice.game.utils.kotlin | |
/** | |
* Kotlin language extension | |
* for Kotlin only | |
* | |
* | |
* Created by ice1000 on 2016/8/17. | |
* @author ice1000 | |
* @since v0.3.2 |
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
// 不得不说,虽然是个水题,但是还是应该保证内存安全,按照@Yoto Chang的说法。于是我就写了一个内存安全的。 | |
#include <stdio.h> | |
#include <math.h> | |
#include <stdlib.h> | |
double **a; | |
int *x, *y; | |
int squared (int x) { |
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
@file:JvmMultifileClass | |
@file:JvmName("CodeGen") | |
package org.algo4j.gen | |
import org.algo4j.test.print | |
/** | |
* Created by ice1000 on 2016/12/6. | |
* |
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
package sb | |
import ( | |
"fmt" | |
"strings" | |
) | |
const maxLength = 150 | |
/// a java style string buffer |
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
import java.io.File | |
import javax.imageio.ImageIO | |
/** | |
* Created by ice1000 on 2017/3/28. | |
* | |
* @author ice1000 | |
*/ | |
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
import java.awt.BorderLayout | |
import java.awt.Color | |
import java.awt.Graphics | |
import java.io.File | |
import javax.swing.JFrame | |
import javax.swing.JPanel | |
import javax.swing.WindowConstants | |
/** | |
* Created by ice1000 on 2017/3/18. |
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
package main | |
/** | |
* Created by ice1000 on 2017/4/27. | |
* | |
* @author ice1000 | |
*/ | |
fun <A, B, C : Any> zipWith(op: (A, B) -> C) = { x: Sequence<A> -> | |
{ y: Sequence<B> -> |
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
package main | |
/** | |
* Created by ice1000 on 2017/5/2. | |
* | |
* @author ice1000 | |
*/ | |
fun main(args: Array<String>) { | |
fun lambda(it: Int): Int = |
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
operator fun <A, B, C> ((B) -> A).plus(p: (C) -> B) = { it: C -> this(p(it)) } | |
fun main(args: Array<String>) { | |
val a: (Int) -> String = { it.toString() } | |
val b: (String) -> ByteArray = { it.toByteArray() } | |
println((b + a)(233)) | |
val c: (ByteArray) -> List<Int> = { it.map { it.toInt() } } | |
println((c + b + a)(666)) // Haskell: c . b . a $ 666 | |
} |
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
struct Config { blabla }; | |
typedef int ConfigType; | |
enum ConfigType_ { Type1, Type2, Type3, TypeCOUNT; }; | |
auto SetConfig(ConfigType type, Config config) -> void { | |
switch (type) { | |
case Type1: blablba; break; | |
case Type2: blablba; break; | |
case Type3: blablba; break; | |
default: error(); break; |
OlderNewer