Posts

Showing posts from September, 2020

A guessing game in Rust

If you'd like to learn Rust,  The Book  from Rust's official website, is freely available and quite good. I've gotten to chapter 10ish so farband have adapted the book's guessing game to flex my newfound skills. Here's that game . secret_numbers.rs  defines the  SecretNumber  struct, representing a guessable secret number and  Accuracy , representing how arbitrarily close to the guess a given number is. Some interesting points are the  derived traits automatically provided by the compiler  by decorating the  Accuracy  enum with  #[derive(PartialEq, Eq, Hash)] . PartialEq  and  Eq  implements functionality to compare values and, well - if you don't have it (or your own implementation), the compuler will tell you error[E0277]: can't compare  secret_number::Accuracy  with  secret_number::Accuracy  --> src\secret_number.rs:12:10 | 12 | #[derive(Eq, Hash, Debug)] | ^^ no implementation for  secret_number::Accuracy == secret_number::Accuracy  | = help: the trai

Objectives ... and Key Results

 A colleague of mine ran an open-space session today, wherein we discussed OKRs, a topic that had been presented in a recent conference they'd taken part in. If you've never heard the term OKR before, it's short for Objectives and Key Result and is a useful thinking process for strategic improvement. This is what I learned. When discussing OKRs, it's important to get back to the reason - the why - of an Objective. What are we trying to achieve? Why are we trying to achieve this thing? The Key Results needs to be on the right level, so that teams can act on them. Therefore, OKRs needs to be paired with the power/authority/autonomy to act. For a fictitious bedding store, the manager might say: "I'd like us this improve the sales of beds; you have free reign to come up with ideas to that effect!". His employees might here start to observe which types of customers tend to purchase beds and eventually find out that people trying beds are more likely to purchas

Vagrant failed to initialize at a very early stage ... nil:NilClass

I ran across an issue where most vagrant commands would fail, saying Vagrant failed to initialize at a very early stage: There was an error loading a Vagrantfile. The file being loaded and the error message are shown below. This is usually caused by a syntax error. Path: <provider config: virtualbox> Line number: 45 Message: NoMethodError: undefined method `start_with?' for nil:NilClass Naturally, I begun investigating my local Vagrantfile , but found nothing exciting at line 45 but an array iteration whose array I knew was initialized ...  machines.each do |machine| Eventually, I found a directory in my home directory whose name matched the box_name entry of my machines array: :box_name => ' redacted-company-name / centos-7-oracle12c2 ' Path: C:\Users\Sami.Lamti\.vagrant.d\boxes\ redacted-company-name -VAGRANTSLASH- centos-7-oracle12c2 \2020.02.11\virtualbox\Vagrantfile On line 45 is this file, there was a statement who indeed could cause the above error message