HNHacker News
TopNewBestAskShowJobs

dbsmith83

814 karma · joined August 17, 2016

submissionscomments
dbsmith83··on The Kotlin Foundation
We use MyBatis annotations. Usually, for our specific use case we are calling a Postgres sproc. It was a little tricky for one part since we have a json type column, so we had to create our own little pgobject mapper which took a day to figure out how. Other than that, it has been a breeze.
dbsmith83··on The Kotlin Foundation
My team uses Kotlin + Dropwizard + Postgres a lot. I would absolutely recommend trying Kotlin out on your next API. You will find the code very easy to learn coming from Java, and it is honestly a joy to work with compared to Java. You will find your code much more concise yet more readable. Also, IntelliJ gives you all kinds of hints for how you can make use of Kotlin language features.

You can also easily handle nulls in Kotlin, since values have to be explicitly nullable in order to be able to have one. This is great for your application model layers. The val/var paradigm is nice so you can stop having to remember to write 'final'.

If you ever get stuck and don't know how to write something in Kotlin, you can just write it in Java and either use it, or just paste the code in IntelliJ and it will convert it to Kotlin.

Lastly, Kotest + Mockk is awesome--super readable testing.

dbsmith83··on From First Principles: Why Scala?
val list = listOf('a', 'b', 'c')

val map = hashMapOf( "John" to "Doe", "Jane" to "Smith" )

Seems pretty non-ridiculous to me. Maybe you were using an old version? I guess you can switch now :)

dbsmith83··on From First Principles: Why Scala?
Scala is nice for doing things with Spark compared to say, Java, but I really think that Kotlin can do just as well. The only advantage Scala has with Spark is the syntactic sugar. Once there is an API for Kotlin (beyond the preview version), I will be dropping Scala like a bad habit. Kotlin is also concise, has better IntelliJ support, less "implicit magic", and better Java interop.

https://github.com/JetBrains/kotlin-spark-api

dbsmith83··on The war on disinformation is a war on dissent
An article which begins by talking about why people don't trust their government, while curiously (or, conveniently?) leaving out all of Donald Trump's "alternative fact" bullshit which went on for 4 years.. What a ridiculously one-sided heap of garbage. Honestly surprised to see this article here.

Also, to those who down-voted me: Do you not see the irony? Thank you for waging war upon my dissent :). I merely pointed out that the article is one-sided, which is obvious. Perhaps you should look inside to see why you are so defensive of it.

dbsmith83··on Peter Naur's view of programming
Hah, nice try, but no. Arguing that something is a liability if it fell into the wrong hands does not mean it is worthless or worth less than zero. It simply means it is worth protecting.
dbsmith83··on Peter Naur's view of programming
I agree with the conclusions drawn in the article, but not the premise. Source code is definitely not worthless. Two examples:

1) using source code to find security exploits

2) competitive machine learning algorithms

In the second case, imagine if a competitor had access to algorithms used in marketing for bidding on ads. You know what features it uses, what default values it uses, how it works, etc. You could do some damage with that knowledge

dbsmith83··on You don't really need a virtualenv
Interesting, thanks!
dbsmith83··on You don't really need a virtualenv
Curious, what about environment variables? I like the ability to put my environment variables in my activate script. It seems like if you did things the way the author does, you would need all of your env variables to be global, which could be hazardous
dbsmith83··on UCSF team has engineered a tiny antibody capable of neutralizing the coronavirus
Indeed, I have noticed this trend with "news" more and more. The style is characterized as being written like a non-fiction novel. I wish news was just more concise and to the point. I don't have time to read thru the fluff.
dbsmith83··on US Navy – Tic Tac UFO – High frequency gravitational wave generator
Creating the infrastructure and business to manufacture the thing to sell takes time. If you created a proof of concept but it wasn't ready for sale you should still patent it so someone doesn't swoop in. Waiting for it to be on sale before patenting it is for the birds.
dbsmith83··on Why can't I write code inside my browser?
The whole sentiment of this article just comes off a little whiny to me. Nowadays there is so much more information available for learning how to code and set up your dev environment. There are literally coding books for kids at book stores. And StackOverflow!

When I was younger, one had to search high and low on the net trying to find help using shitty dial-up service. Then, you'd end up in some IRC channel asking for help and someone simply says 'RTFM!'

dbsmith83··on Twitter deletes China embassy's Xinjiang 'emancipation' tweet
To me, simply saying "False." with a link is not any colder than saying "That is false." or "that is untrue, see this ___", etc..

I admit, I agree that "Lie." was a little on the cold side. I find that when people blurt out something so obviously and verifiably false that they are either being lazy or facetious which also does not "lead to a constructive conversation". Perhaps if I had the ability to downvote it I would have done that and moved on. Not an excuse, just an explanation.

dbsmith83··on Twitter deletes China embassy's Xinjiang 'emancipation' tweet
Lie.

> The user must click a button or check a box. This action helps confirm the user's agreement of the terms.

https://www.upcounsel.com/are-website-terms-and-conditions-l...

dbsmith83··on Twitter deletes China embassy's Xinjiang 'emancipation' tweet
> I think when you set out to become ubiquitous, gobble up competitors in your space and advertise yourself in order to gain more followers to cement your network effects.

You mean, be successful?

> It’s like denying someone electricity.

Like electricity? That's a laughable assertion.

Thankfully you are completely mistaken about what the law is.

dbsmith83··on Twitter deletes China embassy's Xinjiang 'emancipation' tweet
https://jamestown.org/wp-content/uploads/2020/06/Zenz-Intern...
dbsmith83··on EFF's response to social media companies' decisions to block Trump’s accounts
They focus on certain things while plenty of other companies run their own hosting services. It is not needed effort.
dbsmith83··on EFF's response to social media companies' decisions to block Trump’s accounts
The fact is that a company has the right to moderate their own content because that in and of itself is free speech. There is a difference between the government not allowing you to have a say vs. a company moderating their own platform that they own
dbsmith83··on EFF's response to social media companies' decisions to block Trump’s accounts
Why would they do that? How would it be any different if the government shut down their hosting service vs. someone else's?

They'd still have to do their normal legal thing they do, while also having to manage a hosting service.

dbsmith83··on Open letter from computer scientists to ACM opposing cancel culture
I agree. In fact, the moment someone tells me I can't do something that I want to do is the moment I say "fuck you, watch me"
dbsmith83··on Stealing private documents through a bug in Google Docs
Why should it be illegal? From a US perspective, I don't think selling words/ideas should be illegal in most cases--especially just because it could be used for doing something illegal. For instance, there are books which describe chemical processes for synthesizing methamphetamine (https://www.amazon.com/Secrets-Methamphetamine-Manufacture-U...). But they are not illegal, because if they were it would infringe upon freedom of speech. Deciding what can and cannot be sold/published is a very authoritarian path to go down. It is better to just outlaw the criminal behavior.
dbsmith83··on How AltaVista, the first good search engine, fell into the digital abyss
I remember AltaVista even had a free dialup service. IIRC, it was like netzero, in that it displayed ads in a window that stayed on top. Of course, I would just find the window handle and set it to invisible
dbsmith83··on Experiments on a $50 DIY air purifier that takes 30s to assemble
Love the data on this experiment. I made one of these during the wildfires, and it was apparent that it was working after just a few days. The once colorless filter had become noticeably grey/yellowed.
dbsmith83··on Winning back the Internet by building our own
He is ruining the internet though with his removal of net neutrality, which has a lot to do with the article's critiques of internet access companies.
dbsmith83··on No Config for Old Men
UI developers tell us how an app should look, never mind how you would like it to appear...

Snap developers tell us they won't let you disable an update on our own systems, never mind if we don't want to update...

It feels almost like there is some arrogance going on nowadays in the industry.

Nowadays, if software is not customizable or if it forces updates, I will look elsewhere for alternatives. It has actually started to inspire me to start some new side projects.

dbsmith83··on No Config for Old Men
Why can't there be reasonable defaults and also the ability to customize/override on your own box? Profiles can always be used for if you need to use a different environment and want to use the default.
dbsmith83··on Please disable JavaScript to view this site
Forced client updates
dbsmith83··on Pfizer submits Covid vaccine to FDA for approval, to distribute in December
https://www.acsh.org/news/2020/10/21/how-pfizers-rna-vaccine...

Essentially the mRNA is packaged into a lipid, which the body's cells can uptake thru its phospholipid bilayer

dbsmith83··on ‘Extremely aggressive’ internet censorship spreads in the world’s democracies
Completely agree with your sentiment. I think the only recourse is to aggressively use the legal system for any case of arbitrary censorship. If you are blocked, you must sue your ISP and/or the government. Articles like this make me happy that we at least have a few organizations to help with this (EFF). Hopefully, with a new administration net neutrality can be restored as well.
dbsmith83··on Changes to the pip dependency resolver in 20.3
So happy that Python is taking more steps to improve its dependency resolution. The previous behavior has bitten me countless times. Also happy that they decided to allow a workaround, since countless projects depend upon the 'broken' behavior:

> Temporarily use the old resolver when necessary. If you run into resolution errors and need a workaround while you’re fixing their root causes, you can choose the old resolver behavior using the flag --use-deprecated=legacy-resolver

← PreviousPage 11 of 14Next →