This file contains hidden or 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
| class MainClass | |
| { | |
| public static void Main(string[] args) | |
| { | |
| Console.WriteLine("I'm a c# sample"); | |
| } | |
| } |
This file contains hidden or 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
| JavaParser.getStaticConfiguration().configureSolver(*solverPackages) |
This file contains hidden or 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
| class PageRank(val connections: Map<String, List<String>>) { | |
| private val reversed: Map<String, List<String>> = connections | |
| .flatMap { (k, v) -> v.map { it to k } } | |
| .groupBy { it.first } | |
| .mapValues { (_, v) -> v.map { it.second } } | |
| private var pageRank: Map<String, Double> = connections.mapValues { (_, _) -> 0.0 } | |
| private fun partialSum(point: String): Double { |
This file contains hidden or 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
| data class MethodDescription( | |
| val qualifiedName: String, | |
| val className: String, | |
| val packageName: String, | |
| val declaration: String, | |
| val javaDoc: String, | |
| val content: List<Token> | |
| ) | |
| private object TokenSerializer: JsonSerializer<Token>, JsonDeserializer<Token> { |
This file contains hidden or 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
| class KotlinScope: LanguageScope { | |
| override fun createTokenId(element: PsiElement): Short = when { | |
| isKotlinMethodName(element) -> nonAnonimizedIndex(element) | |
| else -> anonimizedIndex(element) | |
| } | |
| override fun isIndexedFile(fileType: FileType): Boolean { | |
| return fileType.name == "Kotlin" | |
| } |
This file contains hidden or 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
| public class StaticTest { | |
| public static String NAME = new String("Hello, motherfucker!"); | |
| public static class ShitRunner { | |
| public static void runShit(){ | |
| System.out.println(NAME); | |
| } | |
| } | |
| } |
This file contains hidden or 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
| fun main(args: Array<String>) { | |
| var r = 0f | |
| val x = 1.43f | |
| val y = 100.4232f | |
| val time = measureTimeMillis { | |
| for (i in 1..1000000){ | |
| r += x/y; | |
| } | |
| } | |
| println(time) |
This file contains hidden or 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
| fun main(args: Array<String>) { | |
| Context().use { | |
| println(5.trueVal()) | |
| } | |
| } | |
| fun Context.use(body: MyContext.() -> Unit){ | |
| MyContext(this).body() | |
| } |
This file contains hidden or 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
| fun main(args: Array<String>) { | |
| with(Context()){ | |
| println(5.trueValue()) | |
| } | |
| } | |
| class Context { | |
| val theTruth = 42 | |
| fun Int.trueValue() = theTruth + this |
This file contains hidden or 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
| fun main(args: Array<String>) { | |
| with(MyContext()){ | |
| 5.trueValue() | |
| } | |
| } | |
| class MyContext { | |
| val theTruth = 42 | |
| fun Int.trueValue(){ |
NewerOlder