This file contains 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
(ns eviscerate-sequence-test | |
(:require [clojure.test :refer [deftest is run-tests]])) | |
(defn eviscerate-sequence | |
([xs n] (eviscerate-sequence xs n n)) | |
([xs n m] | |
(let [v (vec xs)] | |
(concat (subvec v 0 n) (subvec v (inc m)))))) | |
(deftest eviscerate-sequence-test |
This file contains 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
car name | miles/gallon | cylinders | displacement | horsepower | weight | acceleration | model year | origin | |
---|---|---|---|---|---|---|---|---|---|
chevrolet chevelle malibu | 18 | 8 | 307 | 130 | 3504 | 12 | 70 | 1 | |
buick skylark 320 | 15 | 8 | 350 | 165 | 3693 | 11.5 | 70 | 1 | |
plymouth satellite | 18 | 8 | 318 | 150 | 3436 | 11 | 70 | 1 |
This file contains 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> | |
<meta charset="utf-8" /> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | |
<title>VueJS</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1" /> | |
</head> | |
<body> |
This file contains 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 com.google.gson.GsonBuilder | |
import java.security.MessageDigest | |
import java.util.Date | |
// This example is a port of the Java version described by: | |
// https://medium.com/programmers-blockchain/create-simple-blockchain-java-tutorial-from-scratch-6eeed3cb03fa | |
typealias BlockChain = ArrayList<Block> | |
This file contains 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 Ship { | |
var name: String = "" | |
var crewSize: Int = 0 | |
var numMasts: Int = 0 | |
override fun toString(): String { | |
return "Ship { Name: $name, Num masts: $numMasts Crew Size: $crewSize}" | |
} | |
} |
This file contains 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.PriorityQueue | |
// node class is the basic structure | |
// of each node present in the huffman - tree. | |
class HuffmanNode : Comparable<HuffmanNode> { | |
var freq = 0 | |
var chr = ' ' | |
var left: HuffmanNode? = null | |
var right: HuffmanNode? = null |
This file contains 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
/// | |
/// Each car element accepts a visitor. | |
/// | |
trait CarElement { | |
fn accept(&self, visitor: &CarElementVisitor); | |
} | |
/// | |
/// Each visitor must deal with each element of a car. | |
/// | |
trait CarElementVisitor { |
This file contains 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
// A basic Enum constructor function | |
const Enum = (...values) => { | |
let newEnum = {} | |
for (const value of values) { | |
Object.assign(newEnum, { | |
[value]: value | |
}) | |
} | |
return newEnum | |
} |
This file contains 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 Car { | |
constructor(doors = 4, state = "brand new", color = "silver") { | |
this.doors = doors | |
this.state = state | |
this.color = color | |
} | |
} | |
class Truck { |
This file contains 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
{ | |
"parser": "babel-eslint", | |
"parserOptions": { | |
"ecmaVersion": 2015, | |
"sourceType": "module", | |
"ecmaFeatures": { | |
"jsx": true | |
} | |
}, | |
"plugins": ["react", "prettier"], |
NewerOlder