The code below is a plugin to this algorithm to generate path.
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 math | |
def generate_dist_vector(size, start, tot_length, length): | |
tmp = [start] | |
count = 0 | |
l, r = -length, tot_length - length | |
for i in range(size): | |
left = tmp[0] | |
right = tmp[count] | |
left += (l*2) | |
right += (r*2) |
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
from IPython.display import HTML, display | |
class Tag: | |
def __init__(self, name, value): | |
self.name = name | |
self.value = value | |
def __repr__(self): | |
return "<%s>%s</%s>"%(self.name, str(self.value), self.name) | |
class Linear: | |
def __init__(self, data): |
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
<html> | |
<style> | |
.begin { | |
background: #f1f1f1; | |
width : 100%; | |
} | |
.anim { | |
background: red; | |
width: 0%; |
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 { Injectable } from '@angular/core'; | |
import { blueGrace } from './themes'; | |
const themeKey = 'app:theme'; | |
export const themeStore = { | |
'Blue Grace': blueGrace, | |
'Default': 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
export const blueGrace = { | |
appSidebarClass: 'blue_grace_sidebar', | |
sidebarSectionClass: 'blue_grace_sidebar_section', | |
'app-inputs': 'blue_grace_app_inputs', | |
'app-tags': 'blue_grace_app_inputs', | |
'app-sources': 'blue_grace_app_inputs', | |
'myCustomThemeKey': 'myCustomClass', | |
}; |
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 { Directive, Input, OnInit, ElementRef, Renderer2 } from '@angular/core'; | |
import { ThemeService } from './theme.service'; | |
@Directive({ | |
selector: '[appTheme]' | |
}) | |
export class ThemeDirective implements OnInit { | |
@Input('appTheme') appTheme: string; // appTheme="customClassKey" | |
constructor( | |
private themeService: ThemeService, |
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
div(class="overflow-fix") | |
app-inputs( | |
#myCustomInput | |
appTheme | |
) | |
app-inputs( | |
#myCustomInput | |
appTheme="myCustomThemeKey" | |
) |
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
.blue_grace_preview_button { | |
box-shadow: 0 3px 2px #e0e0e0; | |
margin-left: 11px !important; | |
} | |
.blue_grace_toolbar_buttons { | |
color: #3F51B5 !important; | |
margin-right: 5px !important; |
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
// Create batches out of big array | |
// Map those batches to a lambda | |
export async function asyncBatchMap<T, F>( | |
items: ReadonlyArray<T>, | |
predicate: (input: T[]) => Promise<F>, | |
batchSize: number = 10, | |
): Promise<F[]> { | |
const newContainer = items.map((e) => e); | |
const result: F[] = []; | |
while (newContainer.length > 0) { |
OlderNewer