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 (..) | |
{- import Html exposing (Html, text) -} | |
import Benchmark exposing (Benchmark, describe, compare, benchmark1) | |
import Benchmark.Runner exposing (BenchmarkProgram, program) | |
import List.Extra as List | |
import Set | |
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
splitAtHybrid : Int -> List a -> ( List a, List a ) | |
splitAtHybrid index list = | |
if index < 0 then | |
( [], list ) | |
else | |
splitAtFast 1 index list | |
|> Maybe.withDefault ( list, [] ) | |
splitAtFast : Int -> Int -> List a -> Maybe ( List a, List 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
class Main | |
{ | |
public static void main (String[] args) throws java.lang.Exception | |
{ | |
// Bar does not declare a constructor, so the default will be used. | |
Bar b = new Bar(); | |
System.out.println(b.getX()); | |
// Foo has a constructor that accepts one argument. | |
Foo f1 = new Foo(2); |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="https://code.jquery.com/jquery-1.12.4.js"></script> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<input id="addmediaFileSelector" type="file" onchange="chooseFile()"> |
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
#ifndef NSMALLPOSINTS | |
#define NSMALLPOSINTS 257 | |
#endif | |
#ifndef NSMALLNEGINTS | |
#define NSMALLNEGINTS 5 | |
#endif | |
#if NSMALLNEGINTS + NSMALLPOSINTS > 0 | |
/* References to small integers are saved in this array so that they | |
can be shared. | |
The integers that are saved are those in the range |
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
var KEY = ''; | |
var getRequestSync = function(url) { | |
var xhr = new XMLHttpRequest(); | |
var responseText; | |
xhr.onreadystatechange = function() { | |
if (xhr.readyState === XMLHttpRequest.DONE) | |
responseText = xhr.status === 200 ? xhr.responseText : null; | |
}; |
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
var KEY = ''; | |
var word = 'Thank you'; | |
var langOne = 'English'; | |
var langTwo = 'German'; | |
var getRequest = function(url, callback) { | |
var xhr = new XMLHttpRequest(); | |
xhr.onreadystatechange = function() { |
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
var getRequest = function(url, callback) { | |
var xhr = new XMLHttpRequest(); | |
xhr.onreadystatechange = function() { | |
if (xhr.readyState === XMLHttpRequest.DONE) | |
callback(xhr.status === 200 ? xhr.responseText : null); | |
}; | |
xhr.open('GET', url, true); | |
xhr.send(); |
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.util.ArrayList; | |
class ClosestPoints | |
{ | |
public static void main (String[] args) throws java.lang.Exception | |
{ | |
CoordSystem coords = new CoordSystem(); | |
coords.addPoint(new Point(3, 4)); | |
coords.addPoint(new Point(1, 2)); |
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
.text-center { | |
text-align: center; | |
} | |
.cat-img { | |
width: 60%; | |
max-width: 480px; | |
min-width: 320px; | |
} | |
#cats-list { | |
text-align: center; |