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
<?php | |
function matMul( $a, $b ) { | |
$countI = count( $a ); | |
$countJ = count( $b[0] ); | |
$countK = count( $b ); | |
$c = []; | |
for ( $i = 0; $i < $countI; $i ++ ) { | |
for ( $j = 0; $j < $countJ; $j ++ ) { | |
$sum = 0; | |
for ( $k = 0; $k < $countK; $k ++ ) { |
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
<?php | |
function matMul($a,$b){ | |
$countI = count($a); | |
$countJ = count($b[0]); | |
$countK = count($b); | |
$c=[]; | |
for($i=0;$i<$countI;$i++){ | |
for($j=0;$j<$countJ;$j++){ | |
$sum = 0; |
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
package com.wimpuzzle | |
import java.util.* | |
fun main(args: Array<String>) { | |
val solver = Solver() | |
solver.solve() | |
} | |
class Piece(val positions: Array<Array<Array<Int>>>,val id:Int,var orientation: Int=0){ |
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
/* | |
* This file implement a very simple text game engine and a DSL. | |
*/ | |
fun main(args: Array<String>) { | |
val game=Branch("You awake in a dark forest. Where do you want to go ?"){ | |
WalkNorth() leadsTo TerminalBranch("You went too far in the dark and have been killed by a somber creature") | |
WalkSouth() leadsTo TerminalBranch("You just fel from a cliff. Dumb move !") | |
WalkEast() leadsTo Branch("""In front of you is a yellowish box. | |
It really stand out from the night."""){ | |
OpenAction() leadsTo TerminalBranch("A snake pop out of the box and bite you. You die of a painful poisoning!") |
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
package main | |
import ( | |
"fmt" | |
"math/rand" | |
) | |
func Generate(ch chan<- int) { | |
for i := 2; ; i++ { | |
ch <- i |
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
import io.netty.buffer.ByteBufInputStream | |
import io.vertx.core.Vertx | |
import io.vertx.ext.web.client.WebClient | |
import org.jsoup.Jsoup | |
import org.jsoup.nodes.Element | |
fun main(args: Array<String>) { | |
val vertx = Vertx.vertx() | |
val server = vertx.createHttpServer() | |
val client = WebClient.create(vertx) |
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
import java.io.File | |
fun main(args: Array<String>) { | |
args.map { name -> File(name) } | |
.filter { file -> file.isFile } | |
.map { file -> Pair(file.name, file.readLines().partition { line -> line.trim().isEmpty() }) } | |
.forEach { | |
val name = it.first | |
val (filledLines,emptyLines) = it.second | |
println("$name: ${filledLines.size+emptyLines.size} total, ${emptyLines.size} empty") |
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
package main | |
import ( | |
"fmt" | |
"math/rand" | |
"math" | |
"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
-- V1 | |
[ if x `mod` 3 == 0 then | |
"Fizz" | |
else | |
if x `mod` 5 == 0 then | |
"Buzz" | |
else | |
if x `mod` 15 == 0 then | |
"FizzBuzz" | |
else show x |
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
gameService.gamelistArray() | |
.subscribeOn(Schedulers.io()) | |
.observeOn(AndroidSchedulers.mainThread()) | |
.subscribe { | |
gameList -> | |
adapter=GameListAdapter(gameList.toList().map { it.second },ctx) | |
} |