Better HN
topnewbestaskshowjobs
Log inSign up

rtpg

21,281 karma · joined Nov 23, 2012 (14y ago) · 6,748 submissions

real name: Raphael

blog: https://rtpg.co

email: raphael at above domain

Submissions

comment 11y ago · link · parent

Yeah, RAII helps encapsulate this pretty well at least for the object case, but the notion of having an "inverse" operation is useful in many other situations.

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

So much of this copy seems to be "other knives suck" rather than "our knives are cool". Why would I ever want to go through the purchase process if I'm on the fence and see this?

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

Does it really? Does it test for whether a button you thought was present isn't actually clickable?

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

The little bit about people believing the "AIs will take over the world" non-sense is gold.

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

As someone who neglected statistics as a student ( topology was a lot funner) , would you have any recommendations for self-learning tools for statistics?

comment 11y ago · link · parent

why would you care if they're making as much as you?

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

I agree that things need to be pragmatic. But there are classes of bugs ruled out absolutely by things like immutable structures and referential transparency.

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

https://hackage.haskell.org/package/dsp-0.2.1/docs/src/Matri... link to the function itself

Never really seen something like this before, really hope someone will clean it up

comment 11y ago · link · parent

the issue I have with this statement is that stale data exists when going full-imperative as well.

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

I really like the API of the framework, unfortunately some of the core elements suffer from being extremely stateful code

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 don't get it. How are we unable to make a reliable mechanism to increment numbers and then print the result at the end?!

comment 11y ago · link · parent

unreadable code means the code doesn't work for 1 of its 2 purposes : conveying to the reader what it actually does. So it only accomplishes half its job

comment 11y ago · link · parent

I've started contributing recently to proofwiki (https://proofwiki.org/wiki/Main_Page) which is a similar sort of collection (this one is strictly proofs though).

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

I'm saying that because I found pretty much nothing offensive about this layout (compared to actually offensive things like scrolljacking and whatnot), and the only difference between this and an "ideal" webpage would be to have it all on one page.

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

I think this is a scale thing as well.

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

There are a lot of broken articles in the universe, but is this one of them?

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?

comment 11y ago · link · parent

This is a bit of a myopic view isn't it? Given that these treaties often force Most Favored Nation status on the participants, the end result is lower tariffs overall (if only that they can't make it worse), so pro-free-trade

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

how does this work? Is there a business model?

comment 11y ago · link · parent

You do realize we had a time before unions and common benefits right? What makes this time any different?

comment 11y ago · link · parent

There's xmonad, the tiling window manager. Apart from that I can't think of anything that is actively worked on and has any major traction.

comment 11y ago · link · parent

There's just a couple tricky ones in these scenarios.

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

You're making the assumption that the people accomplish the same time in the desktop version and the web version.

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've had only a little exposure to Coq, but for the life of me I could not understand how to use it. I mean on the practical level, not the conceptual level.

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

the avantage of using a full programming language as a base for your DSL is that you don't have to deal with some of the "simpler" things.

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

Googling about this to confirm things made me find this pretty neat public data graph tool from google

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.

comment 11y ago · link · parent

I thought there was only one debt devaluation (50-odd percent in 2010), but it was combined with austerity measures that destroyed any potential of growth.
1
172173174
225