Andreas Antonopoulos: How bitcoin is changing the world
I don’t know anyone who is better at painting a word picture of just how revolutionary the realm of Bitcoin/cryptocurrency protocol innovation is.
Cosimo Galluzzi
i don't do bad sauce passes
Claire Keane

No title available
RMH
YOU ARE THE REASON
Alisa U Zemlji Chuda
Game of Thrones Daily
wallacepolsom
tumblr dot com
NASA
No title available
dirt enthusiast

shark vs the universe
ojovivo

Discoholic 🪩
Sade Olutola
Mike Driver
styofa doing anything
Misplaced Lens Cap

seen from Singapore

seen from Germany
seen from United States

seen from United States
seen from United States
seen from United States
seen from United States
seen from United States

seen from United States

seen from United States

seen from United States

seen from United States
seen from Switzerland

seen from Australia
seen from Canada
seen from T1
seen from United States

seen from Malaysia

seen from United States
seen from United Kingdom
@jeremyoke
Andreas Antonopoulos: How bitcoin is changing the world
I don’t know anyone who is better at painting a word picture of just how revolutionary the realm of Bitcoin/cryptocurrency protocol innovation is.
Locus of Control
In psychology there is a concept of “locus of control” that refers to the extent to which individuals believe they can control events affecting them. [1]
People that have an internal locus of control tend to be happier and feel more in control of their lives. People with an external locus of control tend to be the type of person that blame everything that goes wrong in their life on factors outside of their control. We all know someone like this. Bad luck seems to follow them around, and listening to them, it’s never their fault.
One strategy for happiness is to strive for that internal locus of control. Take responsibility for your situation, take control of the factors that you actually have control over, and don’t let things that you don’t have control over get you down.
I was thinking today about the current political circus and how much it affects us. There is a lot of stress, anxiety, hate, and rage that is created and fueled by politics. Sometimes there is a little hope and optimism, but that seems to be the exception. Democracy was supposed to empower us all, but looking at it through the lens of locus of control, it seems designed to divert our attention to the very things that are the most distant from our control.
As I have gotten older I have distanced myself from politics as much as possible. I’ve focused on myself, my family, my friends, my work - the realms that I actually have some real tangible influence with. I'm more happy and at ease because of it. I feel that this is a much more natural way of being. I’ve read many philosophers, psychologists, and various thinkers ruminate on how humans “should” or “could” live, but if there is such a thing as “human nature” it is that they are extremely flexible or malleable. We are social creatures that evolved living in small tribal groups, yet we have created large scale socio-political systems that are often in direct conflict with our needs.
There are an endless number of things to find offensive or to be outraged by in the world. Before getting caught up in them consider these simple truths:
You have a limited amount of time in this life.
You cannot change other people.
Allocate your time accordingly.
Combining Arrays with Ruby’s Array#product Method
Have you ever needed to combine two or more arrays? If so this one’s for you. Imagine you have arrays nums = ["1", "2"] and alphas = ["a", "b"]. You want to get all the possible combinations of each item in the first array with each item in the second. One way would be to use the #map or #collect method. However, Ruby has a handy little method called #product that can be used like this:
nums.product(alphas)
=> [["1", "a"], ["1", "b"], ["2", "a"], ["2", "b"]]
What if you have more than two arrays? No problem
Let’s say we need to model a card game, but it has variations where some suits or numbers aren’t needed. We can use the #product method to build our deck in a flexible way. For simplicity lets assume we have a game that requires cards with three attributes:
card_types = ["Jack", "Queen", "King", "Ace"]
card_suits = [" of Kittens", "of Unicorns"]
card_actions = ["move 1", "move 3", "pass"]
Now our method would look like this:
card_types.product(card_suits, card_actions)
=> [["Jack", " of Kittens", "move 1"], ["Jack", " of Kittens", "move 3"], ["Jack", " of Kittens", "pass"], ["Jack", "of Unicorns", "move 1"], ["Jack", "of Unicorns", "move 3"], ["Jack", "of Unicorns", "pass"], ["Queen", " of Kittens", "move 1"], ["Queen", " of Kittens", "move 3"], ["Queen", " of Kittens", "pass"], ["Queen", "of Unicorns", "move 1"], ["Queen", "of Unicorns", "move 3"], ["Queen", "of Unicorns", "pass"], ["King", " of Kittens", "move 1"], ["King", " of Kittens", "move 3"], ["King", " of Kittens", "pass"], ["King", "of Unicorns", "move 1"], ["King", "of Unicorns", "move 3"], ["King", "of Unicorns", "pass"], ["Ace", " of Kittens", "move 1"], ["Ace", " of Kittens", "move 3"], ["Ace", " of Kittens", "pass"], ["Ace", "of Unicorns", "move 1"], ["Ace", "of Unicorns", "move 3"], ["Ace", "of Unicorns", "pass"]]
What if we have an arbitrary number of arrays?
This was the question I ran into that prompted me to write this up. The good news is that the answer is simple. Set up an array of arrays with all of the attributes you want to combine and voila!
primary_attributes = ['Foo','Bar']
array_of_arrays = [[1,2], ['a','b'], [true, false], ['etc']]
primary_attributes.product(*array_of_arrays)
=> [["Foo", 1, "a", true, "etc"], ["Foo", 1, "a", false, "etc"], ["Foo", 1, "b", true, "etc"], ["Foo", 1, "b", false, "etc"], ["Foo", 2, "a", true, "etc"], ["Foo", 2, "a", false, "etc"], ["Foo", 2, "b", true, "etc"], ["Foo", 2, "b", false, "etc"], ["Bar", 1, "a", true, "etc"], ["Bar", 1, "a", false, "etc"], ["Bar", 1, "b", true, "etc"], ["Bar", 1, "b", false, "etc"], ["Bar", 2, "a", true, "etc"], ["Bar", 2, "a", false, "etc"], ["Bar", 2, "b", true, "etc"], ["Bar", 2, "b", false, "etc"]]
I hope this helps someone else as much as it helped me!
Resources:
http://ruby-doc.org/core-2.3.0/Array.html#method-i-product
Implementing a Linked List Data Structure in Ruby
Last night a friend of mine gave me a crash course in linked list data structures. Just for fun and a little practice we implemented a simple version in Ruby. You can do this using Structs, but I used classes to set it up.
This is a singly linked list, meaning each node has a pointer to the next node, but not the other way around. There are two classes - LinkedList, and Node (which is isolated within LinkedList). Here’s teh codez:
class LinkedList def initialize @head = nil end def add_data data if @head.nil? @head = Node.new(data) else current_node = @head while current_node.next_node.present? current_node = current_node.next_node end current_node.next_node = Node.new(data) end end class Node attr_accessor :next_node def initialize(value) @value = value @next_node = nil end end end
Calling the add_data method checks if the head node is empty, and if so it instantiates a new node, saves the data there, and sets it's next_node value is now nil. If head is not nil it will keep walking through the list until it finds a node that has a nil next_node, and instantiates the new node at current_node.next_node.
When would you use this? In Ruby, almost never since we have flexible Array and Hash structures that are best 99.9% of the time. But hey, the more you know!
Ruby 12 hour time to 24 hour time conversion
I’m just going to leave this here.
time = “8:30 PM” (for example)
DateTime.parse(time).strftime("%H:%M:%S")
=> "20:30:00"
Might come in handy again later.
The guy that built this temple wanted to outdo his dad. Talk about a complex!
Trekking from Kalaw to Inle Lake
We hired a guide to take us off the usual tourist routes to Inle Lake. Tonight we sleep at a guest house in a village, the second night in a monastary. On the third day we should reach the south end of Inle Lake around mid day. No more internet till then. Wish me luck!
Gawdawpalin Temple viewed through a window of Shwegugyi Temple in Old Bagan
Morning temples in Bagan
Sunset on the Strand in Mawlamyine, Myanmar last night
How much is that Buddha in the window? View from inside the world's largest reclining Buddha. Near Mawlamyine, Myanmar
Behold! The largest reclining Buddha in the world.
Happy Independence Day Myanmar!
Road side activity in Mon State, Myanmar
A girl selling food to bus riders on the way to Mawlamyine, Myanmar.
Breakfast in Hpa-An
We drank the sweet local version of tea along with pastries, samosas, and fresh hand made nan bread with a spicy bean curry. Total bill: 1550 kyat, or about 1 USD. For two people. Amazing.
Hpa-an, Kayin State, Myanmar