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
| pub type alias Decider[c, e, s] = { | |
| decide = c -> s -> List[e], | |
| evolve = s -> e -> s, | |
| initialState = s, | |
| isTerminal = s -> Bool | |
| } | |
| mod Decider { | |
| pub def fold(decider: Decider[c, e, s], events: List[e]): s = |
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 example | |
| import scala.xml._ | |
| import scala.xml.transform._ | |
| object Hello extends App { | |
| val xml = """ | |
| |<root> | |
| |<p><a href="http://foo@gmail.com">abc</a></p> | |
| |<p><a href="http://foo.com">abc</a></p> |
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
| module Main exposing (main) | |
| import Browser | |
| import Html exposing (Html, input, main_, p, text) | |
| import Html.Attributes exposing (class, placeholder, value) | |
| import Html.Events exposing (onInput) | |
| -- MAIN |
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.math.BigInteger; | |
| import java.util.ArrayList; | |
| import java.util.Date; | |
| // Collatz.check() checks the Collatz conjecture for a given | |
| // number n. | |
| // Now, to prove the conjecture to be correct, we would need to | |
| // to verify it for all n. | |
| // This is not possible to check for all n with a given computer |
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" | |
| "net/http" | |
| "strconv" | |
| "strings" | |
| ) | |
| func main() { |
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 org.abab; | |
| import java.util.Objects; | |
| public class GoodsPair { | |
| public final String name1; | |
| public final String name2; | |
| public GoodsPair(String name1, String name2) { | |
| this.name1 = name1; |
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 org.abab; | |
| import javax.swing.*; | |
| import java.awt.*; | |
| public class Main { | |
| public static void main(String[] args) { | |
| JFrame frame = new JFrame("Hello label"); | |
| frame.setSize(300, 200); |
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
| module Main exposing (main) | |
| import Browser | |
| import Html exposing (Html, input, li, text, ul) | |
| import Html.Attributes exposing (value) | |
| import Html.Events exposing (onInput) | |
| -- MAIN |
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 Main { | |
| public static void main(String args[]) { | |
| Point p1 = new Point(1, 1); | |
| Point p2 = new Point(2, 3); | |
| Point p3 = new Point(1, 1); | |
| // false | |
| System.out.println(p1.equals(p2)); | |
| // true |
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
| Hello, World! |
NewerOlder