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 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
| <?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
| <?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
| const Realm = require('realm'); | |
| const LOGIN_URL = `http://localhost:9080/`; | |
| const SYS_UNAME = ''; | |
| const SYS_PWD = ''; | |
| async function loginSysUser29(){ | |
| return Realm.Sync.User.login(LOGIN_URL,Realm.Sync.Credentials.usernamePassword(SYS_UNAME,SYS_PWD)); | |
| } |
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
| /** | |
| * | |
| * @param {Array<{name:string}>} schema | |
| */ | |
| function fixSchema(schema) { | |
| let fixedSchema = []; | |
| let hasUser = false; | |
| let hasSysRole = false; | |
| let hasRole = false; |
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
| const fetch = require('node-fetch'); | |
| const {ApolloClient,gql} = require('apollo-boost'); | |
| const {createHttpLink} =require('apollo-link-http'); | |
| const {WebSocketLink} =require('apollo-link-ws'); | |
| const WebSocket = require('ws'); | |
| const {InMemoryCache} = require('apollo-cache-inmemory'); | |
| const TEST_EMAIL = 'test-email'; | |
| const TEST_PWD = 'test-password'; |
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
| #ifdef GL_ES | |
| precision mediump float; | |
| #endif | |
| uniform vec2 u_resolution; | |
| uniform vec2 u_mouse; | |
| uniform float u_time; | |
| vec2 rotate(vec2 v, float a) { | |
| float s = sin(a); |
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 "container/heap" | |
| // Mind that this is slower than doing one pass to count occurances of each letter then a second pass to get the first non repeating letter | |
| // This one does something else though, it will take the first least repeated letter. So, with any permutation of "aaaabbbcc" it would yield "c" | |
| type indexedChar struct { | |
| index int | |
| rune rune |
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
| from manim import * | |
| class CreateCircle(Scene): | |
| def construct(self): | |
| mat1_data = [[1, 3, 5], [7, 9, 11], [13, 15, 17]] | |
| mat1 = Matrix(mat1_data, left_bracket="(", | |
| right_bracket=")") | |
| mat2_data = [[2, 4, 6], [8, 10, 12], [14, 16, 18]] | |
| mat2 = Matrix(mat2_data, left_bracket="(", |