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
<form [formGroup]="sandwichForm"> | |
<div> | |
<mat-form-field appearance="fill"> | |
<mat-label>Sandwich Type</mat-label> | |
<mat-select [formControlName]="'selectedSandwich'"> | |
<mat-option *ngFor="let food of sandwichTypes" [value]="food.value"> | |
{{food.value}} | |
</mat-option> | |
</mat-select> | |
</mat-form-field> |
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> | |
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/aptlyundecided/angular-web-components/bundle/styles.css" onload="this.media='all'"></link> | |
<script src="https://cdn.jsdelivr.net/gh/aptlyundecided/angular-web-components/bundle/web-components-package_v0.0.1.js" id='myScript'></script> | |
</div> |
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 { Injector, NgModule } from '@angular/core'; | |
import { BrowserModule } from '@angular/platform-browser'; | |
import { createCustomElement } from '@angular/elements'; | |
import { AppRoutingModule } from './app-routing.module'; | |
import { AppComponent } from './app.component'; | |
import { FoodFormComponent } from './components/food-form/food-form.component'; | |
@NgModule({ | |
declarations: [ |
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
// This function takes three arguments: | |
// 1. soil_dryness: A floating-point number representing the current soil dryness level | |
// 2. dryness_limit: A floating-point number representing the maximum dryness level before the soil is considered too dry | |
// 3. interlocks: A boolean value representing whether any interlocks are currently engaged | |
// The function returns a boolean value indicating whether the soil is considered too dry | |
fn check_soil_dryness( | |
soil_dryness: f64, | |
dryness_limit: f64, | |
interlocks: bool | |
) -> bool { |
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
#[derive(Debug, PartialEq)] | |
enum SoilDrynessLevel { | |
VeryDry, | |
Dry, | |
Medium, | |
Moist, | |
VeryMoist, | |
} | |
struct SystemState { |
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
#[derive(Debug, PartialEq)] | |
pub enum PVLevel { | |
VeryLow, | |
Low, | |
Medium, | |
High, | |
VeryHigh | |
} | |
pub struct PVLevelConfig { |
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
fn get_anon_intro<Person, Cat>(t: &Person, u: &Cat) -> String | |
where | |
Person: AgeHandler, | |
Cat: AgeHandler + NameHandler | |
{ | |
let mut intro = String::new(); | |
intro.push_str("Hello, I am Anonymous and I am "); | |
intro.push_str(t.get_age().to_string().as_str()); | |
intro.push_str(" years old. I have a cat named "); | |
intro.push_str(u.get_name()); |
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
pub struct Person { | |
first_name: String, | |
last_name: String, | |
stickittothemanness: u8, | |
age: u8, | |
hp: u8 | |
} | |
pub struct Dog { | |
first_name: String, |
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
asf |
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
pub trait GreetingNode { | |
fn new() -> MenuNode; | |
fn greet_text(n: &str) -> String; | |
} | |
impl GreetingNode for MenuNode { | |
fn new() -> MenuNode { | |
MenuNode { | |
node_id: 300, | |
next_ref: 0, |
NewerOlder