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 { right, left, Either } from 'fp-ts/lib/Either' | |
import { InjectedIntl } from 'react-intl' | |
export type Mixed = undefined | null | string | number | boolean | |
export type Schema = Record<string, Rule> | |
type Errors = ReadonlyArray<string> | |
export type ValidationErrors<T> = Partial<Record<keyof T, Errors>> | |
export interface Validation { | |
readonly message: string |
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 HashMapLinearProbing { | |
} | |
object HashMapLinearProbing { | |
val TABLE_SIZE: Int = 10 | |
} | |
case class HashItem(key: Int, value: Int) | |
class HashTable(val hashItem: Array[HashItem]) { |
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
image = "0.15.0" | |
imageproc = "0.9.0" | |
image-utils = "0.2.0" | |
raster = "0.2.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
export function querystring(queries: Record<string, string | undefined>): string { | |
const querystrings = Object.keys(queries) | |
.filter(key => !!queries[key]) | |
.map(key => `${key}${encodeURI(`=${queries[key]}` || '')}`) | |
if (querystrings.length > 0) { | |
return `?${querystrings.join('&')}` | |
} else { | |
return '' | |
} | |
} |
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
extern crate petgraph; | |
use petgraph::Graph; | |
use petgraph::visit::Bfs; | |
//use petgraph::prelude::*; | |
fn main() { | |
let mut graph = Graph::new(); | |
let n1 = graph.add_node(1); |
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
extern crate image; | |
use std::path::Path; | |
use std::fs::File; | |
use image::imageops::Nearest; | |
use image::imageops::Gaussian; | |
use image::GenericImage; | |
fn 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
Show hidden characters
{ | |
"extends": "tslint:all", | |
"rules": { | |
"ordered-imports": false, | |
"member-access": false, | |
"member-ordering": false, | |
"object-literal-sort-keys": false, | |
"trailing-comma": false, | |
"interface-name": false, | |
"no-console": 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
fn main() { | |
let mut ids: Vec<usize> = (0..10).collect(); | |
connect(&mut ids, 0, 1); | |
assert_eq!(ids, [1, 1, 2, 3, 4, 5, 6, 7, 8, 9]); | |
let is_connected = connected(&ids, 0, 1); | |
println!("is_connected {:?}", is_connected); | |
connect(&mut ids, 5, 9); |
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
export interface Folder { | |
id: string | number | |
isClose?: boolean | |
isSelected?: boolean | |
deep?: number | |
name: string | |
childrens: Folder[] | |
} | |
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
0x9329B1e5dF3e54b1e03c3F7E3650069F15bfAb1b |
NewerOlder