532 karma · joined Sep 23, 2010 (16y ago) · 74 submissions
Currently: Movin' money at Square
Previously: Backend developer at Airbnb, mobile developer at Khan Academy, lead developer on Burner, SWE at Google
comment 4y ago · link · parent
comment 6y ago · link · parent
For example, `ReadableInstant` [1] in Joda implements 3 interfaces and has 7 subclasses. And really, what is the difference between `AbstractDateTime` and `BaseDateTime`? Whereas `Instant` from java.time [2] is an immutable value type and I haven't found it lacking in any respect.
On the whole java.time has struck me as extremely well designed (after coming from Python and previous date and time libraries in Java) and I think it would behoove other languages to liberally copy its design.
[1] https://www.joda.org/joda-time/apidocs/org/joda/time/Readabl...
[2] https://docs.oracle.com/javase/8/docs/api/java/time/Instant....
comment 7y ago · link · parent
I mostly read non-fiction. To improve my recall over the past 7 years, I type up notes as I read. It's made the process of reading much slower, but it has helped when I've needed to recall some example or detail or framework of a book.
I did this (selfishly) for myself, but decided to upload my notes at https://github.com/mgp/book-notes. (Shameless plug I suppose?) The README explains exactly how I take the notes – but essentially there's no shortcut. I have my text editor open and simply type notes as I read.
comment 7y ago · link · parent
Some people are uncomfortable with the extensive bytecode manipulation that it does. While Lombok provides annotations, it is not your normal annotation processor. From http://notatube.blogspot.com/2010/11/project-lombok-trick-ex...:
> Project Lombok hooks itself into the compilation process as an annotation processor. But Lombok is not your normal annotation processor... The trick is that Lombok modifies the AST. It turns out that changes made to the AST in the Annotation Processing phase will be visible to the Analyse and Generate phase. Thus, changing the AST will change the generated class file.
That said, we never encountered any Lombok-related problems when running services in the cloud or locally. And the Lombok plugin for IntelliJ is good enough in that the auto-complete will "see" the Lombok-modified version of the file. For example, using the @Value annotation creates an immutable value type, which among other things a) makes every field private and final, and b) generates a getter method for each now-private field. With the Lombok plugin, IntelliJ auto-complete will a) not auto-complete the composed fields which are now private, and b) auto-complete the generated getter methods.
I highly recommend looking past the voodoo bytecode manipulation and using Lombok. The @Value annotation alone is worth the price of admission and made me a more productive programmer.
comment 9y ago · link · parent
Most Android applications that rely on both Retrofit and RxJava use them together in this manner.
As for too many requests pending, I'm not sure if OkHttp (which Retrofit uses for making requests and is again on that list) is configurable in that regard. If you want to handle it at the application level, you could maybe model the request queue to the network layer as an Observable<Request> and use RxJava's backpressure operators.
For more information on functional reactive programming (which I would call promises or CompletableFuture done better), see http://reactivex.io/
And for more information on RxJava, see https://github.com/ReactiveX/RxJava
comment 13y ago · link · parent
The author says that Google is making the same mistakes that LiveNinja made over a year ago. And that LiveNinja has learned a lot and iterated since then. At this point, I'm ready to believe that LiveNinja is the more mature product. That if I have a need, I should probably go to LiveNinja. I'm ready to be sold... But then the author does nothing. He don't actually tell me WHY LiveNinja is better. Instead, he mentions Google Answers, Buzz, and Wave.
Why not drop the ad hominem, and sell to your potential customers instead?
comment 13y ago · link · parent
That said, at least they adopted a Unicode encoding, and helped it establish mindshare.
14.
Monitoring with Monit(omgitsmgp.com ↗)
2 points · by shadowmatter · 13y ago · discuss
15.
Why you should prefer placeholder selectors in Sass(omgitsmgp.com ↗)
2 points · by shadowmatter · 13y ago · discuss
comment 13y ago · link · parent
comment 13y ago · link · parent
Note that if there is a lot of text traffic on a given number, carriers like AT&T, Verizon, et al will block texts to and from that number until the traffic subsides. What's worse is that if you send a message to that number from the Twilio dashboard, its status will be "sent," but you will not actually receive it. Apparently in the world of SMS, "sent" simply means the message has been delivered to the destination carrier, and it is not a delivery receipt like with iMessage or BBM.
Twilio suggests that, to reduce this risk, you load balance across a collection of such numbers, or purchase a short code, which isn't cheap: http://www.twilio.com/sms/shortcodes
comment 13y ago · link · parent
You've got to let go of this attitude. If you cling to it, then you will never leave, even if your co-founders are idiots and the business is a failure. What you need to do is quit as soon as possible. Only then can you start on a better endeavor and improve your quality of life.
I once heard someone say, "Give up on crap." It may sound juvenile, and it goes against the rosy, feel-good "Never give up" pep talks that we're used to and almost expect to hear. But I've found it to be a much better guide in life decisions. Go with it.
comment 13y ago · link · parent
And trust me, there is no way Google ever would have said "rewrite it in Python." They would have said "rewrite it in Java," like every other frontend they run (Gmail, Calendar, Docs, etc).
comment 13y ago · link · parent
comment 13y ago · link · parent
comment 13y ago · link · parent
Prefer itertools.izip instead of zip to avoid materializing a new list.
Appending the comma operator to the print statement suppresses the newline character and appends a space instead, which is how print 1, "world" works.
The only tip I'd add is using mapping keys in string formatting operations:
>>> d = {'cow': 'moo'}
>>> print 'the cow says %(cow)s' % d
the cow says moocomment 13y ago · link · parent
Don't ask me why Google didn't throw lots of resources at making Python more efficient like they did with JS and V8. I often wonder that myself.
comment 13y ago · link · parent
comment 14y ago · link · parent