21,281 karma · joined Nov 23, 2012 (14y ago) · 6,748 submissions
blog: https://rtpg.co
email: raphael at above domain
comment 11y ago · link · parent
An example I've run into a lot is wanting a generalized "toggle" for DOM actions in javascript (for example, show/hide), so if some property is true, I apply a transformation, and when the property is switched off I can apply the reverse easily.
The trickiness with RAII (or things like context managers in python) is that it mainly works when you have a companion object representing the action (files are the companion object to getting handlers through opening/closing for example). But what is the object you could use for scaling?
You can, of course, build a Scaler object (or MultiplierFactory ;) ), but I find myself wanting to avoid objects and methods to instead go for plain functions as much as possible.
5162.
In J, functions have inverses (2012)(prog21.dadgum.com ↗)
49 points · by rtpg · 11y ago · 52 comments
comment 11y ago · link · parent
Also, just personal but I don't think "Buttermilk Supply" is a super name for a knife vendor, but naming is tricky. The wording is a major turnoff for me
comment 11y ago · link · parent
If you're going to write tests, I think it makes an insane amount of sense to emulate real world conditions as much as feasibly possible (making judgement calls on things that don't matter like speed of the mouse).
comment 11y ago · link · parent
I am still shocked that Elon Musk seriously believes in the pseudosciency "well Google has gotten better so obviously we will build a self-learning self-replicating AI that will also control our nukes and also be connected in a way and have the capabilities to actually really kill all humans."
Meanwhile researchers can't get an AI to tell the difference between birds and houses.
EDIT: I looked a bit more into the research that these people are funding. A huge amount of it does seem very silly, but there is an angle that is valid: dealing with things like HFT algorithms or routing algorithms causing chaos in finance or logistics.
comment 11y ago · link · parent
Case 1: You're making as much as you want (given relevant factors)
Therefore you're fine, why are you complaining
Case 2: You're not making as much as you want
Isn't your beef with your boss for not paying you more, instead of with your coworker? Ask for a raise
Though I guess the core is you wouldn't want to work in a place where there's restrictions against you getting a raise (which equal pay could theoretically do if the rules are restrictive enough)
As a side note, two thirds of your skill? How would you define that really? Are you able to gauge your coworker's skill levels with that amount of granularity?
5168.
Let's be mainstream – User focused design in Elm [video](youtube.com ↗)
4 points · by rtpg · 11y ago · discuss
comment 11y ago · link · parent
Now, the thing is that there's always a way to model state, but at least I can rule out things like the term "x" to mean different things depending on how many times f was called beforehand for the most part.
comment 11y ago · link · parent
Never really seen something like this before, really hope someone will clean it up
comment 11y ago · link · parent
The solutions might be harder to implement in an immutable environment if your setup isn't right, but not an order of magnitude harder. And you get all the advantages of immutability.
People complain about stale data issues in immutable programming styles not because they're more prevalent, but because they can rule out so many other classes of bugs immediately.
comment 11y ago · link · parent
The "self.thing = bar" in one function that only gets used in some other function ( or even worse something only used in a companion class) pattern is super prevalent.
Might just be me but I think a lot of the older code suffers from massive locality problems that makes debugging framework bugs super tricky
comment 11y ago · link · parent
I think there's a pretty big fascination among mathematicians to collect and organize the universe of information. It's always fun to think of mapping dependencies between all known proofs
comment 11y ago · link · parent
Otherwise this is just a web page with some embedded images and some larger text (which is pretty common practice on any long-form story website).
comment 11y ago · link · parent
Bigger structures like EA have a lot of overhead, making small projects not as worth it (even if its just opportunity cost)
Steam and Kickstarter (combined with everyone having good computers now and of course the internet) have made small games super viable now, luckily
comment 11y ago · link · parent
This article seems to just have chapter separation and a cover image on each chapter, as well as some video inserts.
Apart from the video, this is pretty much exactly how it would be formatted in a magazine. Do you think magazines are for chumps too, because they use too many pictures?
5180.
Apple Releases iTunes 12.2.1 with iTunes Match Fix(macrumors.com ↗)
1 points · by rtpg · 11y ago · discuss
comment 11y ago · link · parent
For me, there's virtualenv and rvm that both mess with shell stuff deeply enough to where running them in fish can be tricky.
virtualenv has good fish support, but never really got rvm working. I ended up going back to zsh after 2 years or so in fish because of small issues like that and realising that so long as I had reverse search I wasn't really gaining much in productivity from fish.
comment 11y ago · link · parent
Given that the desktop version and the web versions are the same, the assumption is that both are at least similarly productive. Therefore the desktop version is actually helping people accomplish more (or it's more useful for high-usage people? Or it's just correlation)
comment 11y ago · link · parent
I know people talk about it as a theorem-prover, but how do I actually _use_ that? This might be due to my general lack of exposure to theorem provers in general, but I can't wrap my head around how I can use this to make my programs better in a practical environment (despite my total buy-in to the concept)
comment 11y ago · link · parent
Your base language already has variable assignment, loops, recursion? Great, you don't have to deal with that. Type checking? Wonderful, don't have to go read up on type inference
comment 11y ago · link · parent
https://www.google.co.jp/publicdata/explore?ds=z8o7pt6rd5uqa...
Basically Spain and Greece are in a different category from the rest of the EU (at least w.r.t. unemployment). Spain is recovering like Greece is, though Greece is suffering more from the precarity of their initial situation. But Spain is still at 22% unemployment
Spain is also seeing negative GDP growth since the start of the recession, and isn't expected to hit positive GDP growth until 2018 at the earliest.