Blog

Hello 👋 I'm Ken. I love writing and editing, as well as reading a variety of books not only from Technology but also from Social Sciences, Neuroscience, and History. These blog posts are mostly about Technology, Health & Well-being, and about our society.

  1. Ruby: Swap Variables in Oneline

    November 15, 2022
    In Ruby, there is a way to swap values of two different variables without using temporary variables. Let's say there are two variables that we'd like to swap. …
  2. Ruby: Array Brackets Operator Edge Cases

    November 14, 2022
    In Ruby, there is a [] (brackets) operator to access items in Array. https://ruby-doc.org/core-3.1.2/Array.html#method-i-5B-5D You can pass [start, length] to …
  3. How to Initialize Vector in Rust

    November 12, 2022
    In Rust, there are a couple of ways to initialize Vector. Vec::new() Vec::new() returns an empty vector. You can initialize a new empty vector and then pushing…
  4. Tuple with a Single Value in Rust

    November 11, 2022
    In Rust, tuples can be used to have different types of values as a container. Array does not allow you to have different types of elements instead. When Tuple …
  5. Wrapping Integers in Rust

    November 10, 2022
    In Rust, integers can be wrapped to avoid panicking during runtime. Checking operations Let's think the following example. The following source code panicks, b…
1/7
...
Next