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
public class TestModule extends AbstractModule { | |
protected void configure() { | |
bind(int.class).annotatedWith(Names.named("int1")).toInstance(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
@Configuration | |
public static class Config { | |
@Bean | |
public int int1() { | |
return 1; | |
} | |
@Bean |
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
@Test | |
void testEmptySpringContext() { | |
val ctx = new AnnotationConfigApplicationContext(); | |
var objectSize = SizeOf.deepMemoryUsageOf(ctx, SizeOf.VisibilityFilter.ALL); | |
System.out.println(objectSize); | |
ctx.register(Cfg.class); | |
ctx.refresh(); |
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
@Getter | |
@Reference( | |
type = ComputeDeploymentTask.class, | |
properties = { | |
@Property(type = RangeElement.class, name = "memory"), | |
@Property(type = RangeElement.class, name = "cpu"), | |
@Property(type = RangeElement.class, name = "disk"), | |
@Property(type = Credential.class, name = "credential"), | |
@Property(type = RangeElement.class, name = "count") | |
} |
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
@Getter | |
@Setter | |
@XmlRootElement | |
public class LinearSolution extends AbstractElement<LinearSolution> { | |
@XmlAttribute(name = "solution-type") | |
private SolutionType solutionType; | |
@XmlElement(name = "statistic") | |
@XmlElementWrapper(name = "statistics") |
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
{ | |
"objective": "minimize", | |
"name": "stigler diet", | |
"type": "io.sunshower.anvil.model.LinearOptimizationProblem", | |
"variables": { | |
"constraint": [ | |
{ | |
"name": "Calories (1000s)", | |
"coefficient": 3.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 * as pug from 'pug'; | |
import {PLATFORM} from 'aurelia-pal'; | |
import { | |
StageComponent, | |
ComponentTester | |
} from 'aurelia-testing'; | |
export function render(template: string, options?:any) : string { | |
return pug.compile(template.trim())(options); |
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 'reflect-metadata'; | |
import 'aurelia-polyfills'; | |
import { Options } from 'aurelia-loader-nodejs'; | |
import { globalize } from 'aurelia-pal-nodejs'; | |
import 'isomorphic-fetch'; | |
import * as path from 'path'; | |
require('jsdom-global')(); | |
require('mutationobserver-shim'); |
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
let component: any; | |
function initialize(bindingContext:any) { | |
let template = ` | |
<hello label.bind="label"></hello> | |
` | |
component = StageComponent.withResources(PLATFORM.moduleName('hello')) |
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
@customElement('hello') | |
export class HelloElement { | |
@bindable label: string; | |
} |