Yegor Bugayenko's Blog, page 19

August 14, 2017

Bitcoin Is Not a Pyramid. Coinbase Is.

In September 2016 I paid Coinbase $1,222 for two BTCs, $611 each. Seven months later, in April 2017, they paid me back $2,490, which was $1,245 for each BTC. My profit before tax was $1,268, over 100% of the investment, in just seven months. Moreover, if I had waited until today, I would have made $6,800 profit instead. Actually, I still have a few BTCs in my Coinbase account and I can make that 750% profit, if I sell now. Should I? The BTC price is over $4,000. Will it go up? Or down? What w...

 •  0 comments  •  flag
Share on Twitter
Published on August 14, 2017 17:00

August 7, 2017

RAII in Java

Resource Acquisition Is Initialization (RAII) is a design idea introduced in C by Bjarne Stroustrup for exception-safe resource management. Thanks to garbage collection Java doesn't have this feature, but we can implement something similar, using try-with-resources.

[image error]At Sachem Farm (1998) by John Huddles

The problem RAII is solving is obvious; have a look at this code (I'm sure you know what Semaphore is and how it works in Java):

class Foo { private Semaphore sem = new Semaphore(5);...
1 like ·   •  0 comments  •  flag
Share on Twitter
Published on August 07, 2017 17:00

July 31, 2017

How to Manage a Manager?

No secret, we you all have managers. Some of them are great, while many are simply idiots. What do you do if you happen to have a boss that fits perfectly into this dominating category? Quit and try to find a better place? This may sound like good advice, but you know as well as I do that a new boss most likely won't be any better. Don't quit. Stay. Manage the manager. Most of them are manageable.

[image error]The Intouchables (2011) by Olivier Nakache

First of all, remember your goal: do nothing...

 •  0 comments  •  flag
Share on Twitter
Published on July 31, 2017 17:00

July 24, 2017

My Favorite Websites

I recently published a summary of the software and hardware I'm using every day. Now I'll list my most favorite websites and online services, which help me do my daily job: write code and manage projects.

[image error] [image error] [image error]
Gmail is the best email system. It aggregates all my accounts in one place: all emails are coming to the @gmail.com address and I have a few aliases for sending responses. Google Calendar helps me keep my plans in sync, and Google Drive helps me share documents with friends somet...

 •  0 comments  •  flag
Share on Twitter
Published on July 24, 2017 17:00

July 17, 2017

The Bigger Victim of Sexual Harassment

You most probably are aware of the recent sexual harassment scandals in Silicon Valley, which led to serious career problems for Dave McClure (former CEO of 500 Startups), Travis Kalanick (former CEO of Uber), Chris Sacca, and a few others. Let's try to put emotions aside and analyze what's happening and what long-term consequences this panic may have for our male-dominated engineering environment.

[image error]Twentynine Palms (2003) by Bruno Dumont

We will never know what really happened betwee...

 •  0 comments  •  flag
Share on Twitter
Published on July 17, 2017 17:00

July 10, 2017

How I Would Re-design equals()

I want to rant a bit about Java design, in particular about the methods Object.equals() and Comparable.compareTo(). I've hated them for years, because, no matter how hard I try to like them, the code inside looks ugly. Now I know what exactly is wrong and how I would design this "object-to-object comparing" mechanism better.

[image error]L'ultimo capodanno (1998) by Marco Risi

Say we have a simple primitive class Weight, objects of which represent the weight of something in kilos:

class...
 •  0 comments  •  flag
Share on Twitter
Published on July 10, 2017 17:00

July 3, 2017

Am I a Sexist?

Recently I said a few words in my Telegram group about "women in tech," which led to some negative reaction on Twitter. I believe I owe my readers an explanation. Some of them already got confused and came to me with the question: "If you're so much against slavery, where is this male chauvinism coming from?" Let me explain what's going on. Indeed I am a big fan of freedom, but recent hysteria around gender equality is not helping us to become more free. Instead it...

 •  0 comments  •  flag
Share on Twitter
Published on July 03, 2017 17:00

June 26, 2017

My Work Environment

I was asked in my Telegram Group which tools and hardware I use in my daily work. Here is the full list of what I have and even how much I paid for them. Maybe it will be helpful for someone.

[image error]
MacBook Pro Retina, 15-inch, Late 2013, 2.3GHz/16Gb/512Gb ($2,900) with MacOS Sierra. I bought it over three years ago and don't want to replace with a new one, simply because rumors are its quality is very low. My smartphone is iPhone 6s.

[image error]
IntelliJ IDEA Ultimate ($499 free) for Java projects....

 •  0 comments  •  flag
Share on Twitter
Published on June 26, 2017 17:00

June 21, 2017

Object-Oriented Declarative Input/Output in Cactoos

[image error]

Cactoos is a library of object-oriented Java primitives we started to work on just a few weeks ago. The intent was to propose a clean and more declarative alternative to JDK, Guava, Apache Commons, and others. Instead of calling static procedures we want to use objects, the way they are supposed to be used. Let's see how input/output works in a pure object-oriented fashion.

Let's say you want to read a file. This is how you would do it with the static method readAllBytes() from the...

1 like ·   •  0 comments  •  flag
Share on Twitter
Published on June 21, 2017 17:00

June 12, 2017

DynamoDB + Rake + Maven + Rack::Test

In SixNines.io, one of my Ruby pet web apps, I'm using DynamoDB, a NoSQL cloud database by AWS. It works like a charm, but the problem is that it's not so easy to create an integration test, to make sure my code works together with the "real" DynamoDB server and tables. Let me show you how it was solved. The code is open source and you can see it in the yegor256/sixnines GitHub repo.

How to bootstrap DynamoDB Local

First, you need to use DynamoDB Local, a command line tool...

 •  0 comments  •  flag
Share on Twitter
Published on June 12, 2017 17:00