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
| CREATE OR REPLACE FUNCTION choose_other(x bigint, y bigint, z bigint) RETURNS bigint AS | |
| $$ | |
| SELECT CASE x | |
| WHEN y THEN z | |
| ELSE y | |
| END | |
| $$ LANGUAGE SQL; | |
| CREATE OR REPLACE FUNCTION node_connected_component(node_id bigint) RETURNS SETOF bigint AS | |
| $$ |
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
| CREATE OR REPLACE FUNCTION node_polygons(node_id bigint) RETURNS TABLE(visited bigint [], path bigint[], geometry Geometry(LINESTRING,4326)) AS | |
| $$ | |
| WITH RECURSIVE n(id, visited, path, cycle, geometry) AS ( | |
| VALUES (node_id, ARRAY[node_id], ARRAY[]::bigint[], false, ST_GeomFromText('LINESTRING EMPTY')) | |
| UNION ALL | |
| SELECT | |
| choose_other(n.id, l.src_node_id, l.dst_node_id), | |
| n.visited || ARRAY[choose_other(n.id, l.src_node_id, l.dst_node_id)], | |
| n.path || ARRAY[l.id], | |
| choose_other(n.id, l.src_node_id, l.dst_node_id) = ANY (n.visited), |
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
| services: | |
| demo: | |
| tms: | |
| kml: | |
| use_grid_names: true | |
| wmts: | |
| wms: | |
| md: | |
| title: MML Maps | |
| abstract: |
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 {ActionCreator} from 'react-redux-typescript'; | |
| import {ModalType} from './modals'; | |
| import {RootState, Dispatch} from '@src/reducers'; | |
| import {omitBy} from 'lodash'; | |
| export interface State { | |
| readonly loading: boolean; | |
| readonly messages: Readonly<{[messageId:string]:string}>, | |
| readonly modals: ReadonlyArray<ModalType> | |
| } |
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
| type Map<A extends "A" | "B"> = { | |
| "A": "A!", | |
| "B": "B!" | |
| }[A]; | |
| type AA = Map<"A">; | |
| type BB = Map<"B">; | |
| let a:AA = "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
| import {ActionCreator} from 'react-redux-typescript'; | |
| export interface CrudResult { | |
| results: string[]; | |
| totalCount: number; | |
| } | |
| export interface CrudState<E,Q> { | |
| readonly queries: Readonly<{[queryName:string]: Q}>; | |
| readonly results: Readonly<{[queryName:string]: CrudResult}>; |
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 tensorflow as tf | |
| window_size = 10 | |
| batch_size = 10 | |
| data = tf.range(100) | |
| indices = tf.data.Dataset.range(90) | |
| window_fn = lambda x: data[x:x+window_size] |
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 {$call} from 'utility-types'; | |
| import {getType, createAction} from 'typesafe-actions'; | |
| import {ModalType} from './modals'; | |
| import {RootState} from '../reducers'; | |
| export interface State { | |
| readonly loading: boolean; | |
| readonly modals: ReadonlyArray<ModalType>; | |
| } |
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 {actions, reducer} from './ui'; | |
| describe('ui actions', () => { | |
| it('should create an action to set loading state', () => { | |
| expect(actions.setLoading(true)).toEqual({ | |
| type: 'UI_SET_LOADING', | |
| payload: true | |
| }); | |
| }); | |
| it('should create an action to show modal', () => { | |
| expect(actions.showModal({type:'dummy'})).toEqual({ |
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 {createAction} from 'typesafe-actions'; | |
| import {SagaIterator} from 'redux-saga'; | |
| import {all, call, put, select} from 'redux-saga/effects'; | |
| export interface Results { | |
| results: string[]; | |
| loading: boolean; | |
| error?: string; | |
| } | |
| const defaultResults:Results = { |