{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Exercise 1\n", "\n", "## Part 2\n", "\n",
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
trait Greetable { | |
fn greeting_for_other(&self, other: &Self) -> String; | |
} | |
struct Person<'a> { | |
name: &'a str, | |
age: u8, | |
} | |
impl<'a> Greetable for Person<'a> { |
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
var datasets = { | |
small: { | |
orderly: [5, 10, 15, 20, 25], | |
messy: [25, 7, 5, 26, 11], | |
}, | |
large: { | |
messy: [ | |
25, 7, 5, 26, 11, 8, 25, 14, 23, 19, 14, 11, 22, 29, 11, 13, 12, 17, | |
18, 10, 24, 18, 25, 9, 3 | |
], |
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
@Override | |
public Object execute(ExecutionEvent event) throws ExecutionException | |
{ | |
final Transition transition = getTransition(event.getApplicationContext()); | |
if (isEnabled(transition)) | |
{ | |
EditingDomain domain = AdapterFactoryEditingDomain.getEditingDomainFor(transition); | |
if (domain != null) | |
{ | |
domain.getCommandStack().execute(new FireTransitionCommand(domain, transition)); |
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
@Override | |
public Object execute(ExecutionEvent event) throws ExecutionException | |
{ | |
final Transition transition = getTransition(event.getApplicationContext()); | |
if (isEnabled(transition)) | |
{ | |
EditingDomain domain = AdapterFactoryEditingDomain.getEditingDomainFor(transition); | |
if (domain != null) | |
{ | |
domain.getCommandStack().execute(new FireTransitionCommand(domain, transition)); |
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
class LambdaTester { | |
interface MathOperation { | |
int operation(int a, int b); | |
} | |
public static void main(String[] args) { | |
System.out.println(testLambda( | |
2, | |
3, | |
(a, b) -> a + b |
NewerOlder