Skip to content

Instantly share code, notes, and snippets.

View josiahhaswell's full-sized avatar

Josiah Haswell josiahhaswell

  • https://sunshower.io
  • Ft. Collins
View GitHub Profile
public class TestModule extends AbstractModule {
protected void configure() {
bind(int.class).annotatedWith(Names.named("int1")).toInstance(1);
}
@Configuration
public static class Config {
@Bean
public int int1() {
return 1;
}
@Bean
@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();
@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")
}
@Getter
@Setter
@XmlRootElement
public class LinearSolution extends AbstractElement<LinearSolution> {
@XmlAttribute(name = "solution-type")
private SolutionType solutionType;
@XmlElement(name = "statistic")
@XmlElementWrapper(name = "statistics")
{
"objective": "minimize",
"name": "stigler diet",
"type": "io.sunshower.anvil.model.LinearOptimizationProblem",
"variables": {
"constraint": [
{
"name": "Calories (1000s)",
"coefficient": 3.0
},
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);
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');
let component: any;
function initialize(bindingContext:any) {
let template = `
<hello label.bind="label"></hello>
`
component = StageComponent.withResources(PLATFORM.moduleName('hello'))
@customElement('hello')
export class HelloElement {
@bindable label: string;
}