So I found that amazing falafel food venue in Berlin open 24/7. The food is delicious.
After coming back from the meetup on day 2 of btc++ I was pretty hungry and got myself two wraps, a full spec falafel and halloumi wraps, ready to consume both at the same time!
11 seconds after leaving their place I shared one with a random homeless dude on the street.
I think he was happy and it felt like a right thing to do.
Treat others like you want to be treated.
Trear others with dignity and have compassion. Positive vibrations come back to you in the least expected moment.
Expect nothing in return, build none transactional partnerships as that's the purest form of the energy exchange.
After all, we are just a form of manifestation of the beaty,
Everyone around you is a mirror of yourself. Think about it deeply.
Sandwich layer validator (Rust)
#[derive(Debug, PartialEq, Eq)]
enum Layer {
Bread,
Cheese,
Ham,
Cucumber,
Other(&'static str),
}
fn validate_layers(layers: &[Layer]) -> Result<(), String> {
// Helper to find index of first occurrence
let pos = |item: Layer| -> Option<usize> {
layers.iter().position(|l| *l == item)
};
// Cheese must exist
let cheese_idx = pos(Layer::Cheese)
.ok_or_else(|| "Invalid sandwich: missing cheese".to_string())?;
// Ham must be above (i.e., appear after) cheese
if let Some(ham_idx) = pos(Layer::Ham) {
if ham_idx < cheese_idx {
return Err("Awkward: ham is below cheese; ham should be on top of cheese".into());
}
}
// Cucumber must be on top of cheese (i.e., after cheese).
if let Some(cuke_idx) = pos(Layer::Cucumber) {
if cuke_idx < cheese_idx {
return Err("Invalid: cucumber is below cheese; cucumber must be on top of cheese".into());
}
}
// If both ham and cucumber exist, order among them is allowed as long as both are after cheese.
Ok(())
}
fn main() {
let good = vec![
Layer::Bread,
Layer::Cheese,
Layer::Ham,
Layer::Cucumber,
Layer::Bread,
];
let bad_ham = vec![
Layer::Bread,
Layer::Ham,
Layer::Cheese,
Layer::Bread,
];
let bad_cuke = vec![
Layer::Bread,
Layer::Cucumber,
Layer::Cheese,
Layer::Bread,
];
for (name, s) in &[("good", &good), ("bad_ham", &bad_ham), ("bad_cuke", &bad_cuke)] {
match validate_layers(s) {
Ok(()) => println!("{}: valid sandwich", name),
Err(e) => println!("{}: {}", name, e),
}
}
}
Notes:
Cheese must exist.
Ham and cucumber, if present, must appear after the cheese (i.e., on top of it).
Order between ham and cucumber is allowed (both on top of cheese).