HNHacker News
TopNewBestAskShowJobs

durbatuluk

51 karma · joined May 18, 2013

submissionscomments
durbatuluk··on Today I've made the difficult decision to reduce the size of Coinbase by ~14%
The same coinbase where my manager used # of commits as metric for praise. I'm so anxious to see how this will work out
durbatuluk··on Revisiting Interface Segregation in Go
Any method you forget to overwrite from the embed struct gives a false "impression" you can call any method from mockS3. Most of time code inside test will be:

    // embedded S3Client not properly initialized
    mock := mockS3{}
    // somewhere inside the business logic
    s3.UploadReport(...) // surprise
Go is flexible, you can define a complete interface at producer and consumers still can use their own interface only with required methods if they want.
durbatuluk··on Ask HN: Who wants to be hired? (August 2022)

  Location: Brazil
  Remote: yes
  Willing to relocate: yes
  Technologies: Go, PostgreSQL, Mongo, Kafka, AMQP (rabbitmq), gcp, aws, azure, docker, kubernetes, R, QGIS
  Résumé/CV: https://www.linkedin.com/in/dvdscripter/
  Email: dvdscripter(ᵃᵗ)gmail.com
Hi I'm David, self taught developer looking for profissional challenges using GraphQL, gRPC or more low level. Currently staff engineer with great experience in finance (fintechs) and e-commerce.
durbatuluk··on Adding Optimistic Locking to an API
We had similar problem (banking service). Instead of "moving" directly to destination we include a safe account in the middle.

A > safe > B

Safe account is called this way because we don't risk the misuse of money in case of rollback.

durbatuluk··on Error stack traces in Go with x/xerror
github.com/pkg/errors also is a amazing option
durbatuluk··on Patterns in Confusing Explanations
"I think" posts should always handled with care because we have no real evidence, just your "I think". Pattern 12 is often used to promote critical thinking and to shake previous believes. Most teachers want the class to realize something is wrong because this type of realization helps the process of learning (knowledge coming from you, not them).
durbatuluk··on Generics enabled by default in Go tip
I didn't say they're the same. I'm saying people coming from OO complain all the time of lack of generics, inheritance (besides composition) etc.

I teach basic go at my job to help people wanting to migrate, they start the go journey thinking go will do "less" because we don't have all features as their main language. Which reminds me of this phrase:

> 'You cannot reduce the complexity of your problem by increasing the complexity of your language.'

durbatuluk··on Generics enabled by default in Go tip
If you want all features of language X (I doubt we will stop at generics) use language X. Stop trying to make all languages the same.

I work with programmers from OO background (java) and they can't even grasp the utility of functions as value or closures. Every damn "service" has an interface/generated mock and anemic model. They're desperate waiting for generics for go to "complete".

I fear the influx of OO programmers.

durbatuluk··on Generics enabled by default in Go tip
You can do something similar to container package which has a double impl.
durbatuluk··on Go modules have a v2+ problem
someone cited kubernetes above
durbatuluk··on No net insect abundance and diversity declines across US
This type of measurement using quantitative data should be interpreted with care. At least here in Brazil most of places where some impact occur have an increase in net diversity and abundance. Many new sp. invade the niche left open by the former community and what you see is a shift of the entire community.
durbatuluk··on A look at modern PHP
As someone who freelance php and do on-site go coding on daily basis, modern PHP is amazing (symfony/slim is everything I want).

One simple improvement I would love to see is namespace grouping in standard library. Go has all related functions inside some package. Go pls let me do http.notfound<tab/enter> = http.StatusNotFound. But in php even with inteli I need to google some function/const name.

durbatuluk··on The tools and tricks that let Ars Technica function without a physical office
This "office feeling" is something still strange to me as someone who like to work with less cloth as possible. Maybe is my background in biology which we did everything in same place, research, sample, drink and eat. In fact working in office make my production drop even with 35h/week.

Maybe is related to programming as hobby turning to job.

durbatuluk··on We tested popular web hosting companies and all were easily hacked
I think everyone need to remember CORS is a browser-only protection and anything you expose via CORS protected endpoint in reallity has no protection at all. Try cURL reaching any endpoint protected by CORS and you'll see what I mean.

Also browsers automatic sending cookie enable many of these CSRF, consider JWT.

Amazing how PHP is still bitting developers.

durbatuluk··on K-means clustering using sklearn and Python
I should start calling myself a ML expert? I'm 32 year old and most of these "ML algorithms" are called statistics for me. Maybe I'm missing something, where is the LEARNING on k-means? Numerical solutions seems to be on rise now.

Nice write for someone starting, more details about details of algorithm steps would greatly attract more readers.

durbatuluk··on Dotfile madness
Indeed, without env. var we are stuck with ~ "madness"
durbatuluk··on Dotfile madness
TIL I'm using ~ in the wrong way. For me ~ was always the default place for user-level configurations and time taught me to do so: .X* .bash* .vimrc and others.

Than I create my personal folders ~/{src, docs, bin, porn, anime etc}. ~ is for temporary files I'll delete after use like windows users do with their Desktop folder.

Also my ls isn't an alias with -a flag...I'm alone here? :|

durbatuluk··on SQL as an API language
This is a amazing project. It has many of features I always lost my time writing API.
durbatuluk··on Gene drive used to turn all female mosquitos sterile
I understand this very well but this happen only on low-income countries.

Here in Brazil zika, dengue and malaria are our everyday neighbors but most of problem are from lack of basic sanitation.

One of my first studies was estimating the effect of proximity/density of nearest forest at the neglected tropical diseases. Many people come with the same conclusion: no effect for dengue and yellow fever. Later Brazilian government started doing in-house visits trying to find small pounds of water on backyards. The result was astonishing, most backyards are like paradise for Aedes and similar mosquitos. Even water box are open and full of water for children to play on hot days. Now the campaign is to not create spaces where they can proliferate like: http://infodengue.ikiw.com.br/2015/03/como-evitar-dengue.htm...

Malaria is a special case because seems to not stand urban micro climate and people at these regions cannot afford to move. I understand the case of half million people losing their lives but realistic we will not stop using gene modification only on Anopheles. Here in Brazil will target minimum three genres of mosquito, any of them can cause diseases. Mosquitos also do not respect political borders.

durbatuluk··on Gene drive used to turn all female mosquitos sterile
As ecologist this scare me to death. Yesterday I was wondering where are the predators who didn't fill this "empty niche" on cities? Dragonflies are natural predators on environment but cannot stand urban micro climate. Thinking something will fill a empty niche is a theory. Even "niche" occupation is a theory which is show to not fit many places (amazon basin).

Some consequences are starting to be measured and we're turning our eyes because we don't like bites? I got Dengue in two occasions and I really hate these mosquitos but we must not be innocent to think there is no consequences and nature will solve this for us.

> They found that the birds produced on average two chicks per nest after spraying, compared with three for birds at control sites. > https://www.nature.com/news/2010/100721/full/466432a.html

Old compilation of papers about the consequences.

durbatuluk··on Thank you HN
Congrats, I'm your old one at the moment. I'm a bit more desperate because my wife is pregnant. Happy father's day to me I guess
durbatuluk··on A newcomer’s (angry) guide to R
As someone who taught R for students coming from Biology. Most of them just want to learn some_stat_test(), how to interpret it and who to plot().

These who tried to do modeling using vanilla R just dropped midway because of R performance and switched back to fortran

ggplot2 just should be baseline instead of default gfx.

durbatuluk··on Normalization of deviance in software: broken practices become standard (2015)
That fucking phrase was the motto of one of our devs. Fast-forward one year and we still don't deliver the product to client.
durbatuluk··on Updating Torrents Via Feed URL
and my dreams become reality! 1: create a torrent for every package on archlinux using bep 39. 2: sign them with maintainers keys 3: ??? 4: PROFIT!!!
durbatuluk··on The Most Misleading Measure of Response Time: Average
Sadly is hard to say anything without any value on axis. Difference between mean and 99% is 5s or 20ms? As someone said here, threshold for "slow loading" should be used before picking metric for measuring it. Pick graphic one and draw a line where users whine about slow loading, check how many are under and above. If the number of users below threshold value is "greater" then above threshold you shouldn't be so worried. How much greater can be picked from standard error from threshold measure from users.
durbatuluk··on Statistical Formulas For Programmers
As a programmer and statistician I should warn newcomers about the assumptions of tests (parametric tests like test t). Test t for example need same variance and normality or you'll take wrong decisions. These formulas and p-values shouldn't be used as substitutes for graphics (you should check them first and test later).

Just take care, there's a lot of problems from using statistics in wrong way. special care with small sample size and even large ones [http://scienceblogs.com/mixingmemory/2006/10/31/jeffreylindl...]

durbatuluk··on NixOS - Declarative configuration OS
I tried this distro 2 times since I heard of this rootless package administration. I give up because of poor documentation in both situations. I would love to see this approach in arch or gentoo (without the butthurt of slots)
durbatuluk··on NixOS - Declarative configuration OS
gentoo need slot support for similar behavior