Better HN
topnewbestaskshowjobs
Log inSign up

capableweb

37,790 karma · joined Sep 7, 2019 (7y ago) · 9,208 submissions

Curabitur pretium dui sit amet quam pharetra, at condimentum turpis auctor. Maecenas vitae varius sem. Sed vel ante massa. Nulla a leo est. Morbi quis pulvinar nulla, et imperdiet nibh. Curabitur varius felis tempor nisl vulputate, id accumsan libero placerat. Sed mi odio, auctor ac lacus vel, sollicitudin mattis dolor.
Submissions

comment 6y ago · link · parent

> how have you approached similar projects before? Where there's a very non-Clojure-native library that will be critical?

Started playing around with Arcadia which is Clojure-CLR + Unity3D tooling/library. Basically used for make some interactions with the Unity3D framework easier.

While most of the code is using interop, having the repl flow is something that for me, after using Clojure professionally for a while, is really really hard to give up. I've tried getting into game development before, but the slow iteration cycles on "make change -> save -> do thing to test" just sucks all the fun out of it.

If I were to use Three.js in a project, I'd approach it the same way. As I try to stay far away from any other languages, I'd write a small layer between my CLJS code and the Three.js API, the smaller the better, and then use that.

Because giving up on being able to eval whatever and having access to a repl is not worth it in the projects I work with.

Basically, any hurdle (like basing my project around a non-CLJS library) is easier to overcome than having to deal with something like TypeScript again.

comment 6y ago · link · parent

> Some animals seem to be able to process things on a screen while others seem to totally ignore it

In my experience, it's more about the particular individual of animal rather than broadly "all eels can see screens", at least that's what I experience with my dogs. One of them ignore screens and seemingly can't see / don't want to see what's on the screen, even if prompted to look at it. The other one watches TV with me, as soon as I'm watching something. And if there is something appearing on the screen resembling an animal, she tries to scare them away with barks. Humans on TV is fine, and she follows them, but birds, dogs or any other animal is an enemy according to her. Even animated animals are recognized as animals for her, unless they are too abstract.

Watching BoJack Horseman was an interesting experience, to see where she would react vs not. Seems most animals/humans in that show are fine, unless they are really behaving like animals, then it's not fine.

comment 6y ago · link · parent

Hm, I'd say in a framework you usually work with the Hollywood principle, but when using something like a library, you're not. So you're 50% correct :)

comment 6y ago · link · parent

"Yep each single microservice is simple - ..." but the whole is not.

I always find it more interesting what's _not_ in the single microservices, the stuff you do see. When you make a diagram with boxes and arrows, the interesting stuff would be the arrows, not the boxes themselves.

comment 6y ago · link · parent

To be fair, the 95K (imaginary, I know, but let's just roll with that) is not for paying you to write those four lines, but rather to pay you for your investment in knowing that you only have to write those four lines.

Same as the restaurant bill is not equal+margin to what they spend on food, it's also everything else like rent, salaries + margin.

comment 6y ago · link · parent

> So I bet there is some internal API that searches or something for an address with all caps.

Rather than something searching with all caps, isn't it more likely that the query/search is case-sensitive, and the data just happens to be stored/retrieved with all caps?

comment 6y ago · link · parent

Yeah, I also don't think that's correct, in most cases. React updates the entire tree internally when anything changes, but actually only changes DOM nodes who's prop or state has changed. The problem is, the check of props and state that React does by default is naive, in that it doesn't check if something is deeply equal, only shallow. So using numbers in props works correctly, but not array of numbers. So if you use anything other than booleans, numbers, strings and so on, where equality works as expected, only changed components will render to the DOM. But if you have arrays or objects, the checks React does will always trigger an update of the DOM, as `[] === []` or `[] == []` will never return true, even though they are the same. The way to work around this is to implement your own `shouldComponentUpdate(newProps, newState) <boolean>` and do your own equality checks.

Maybe a side-effect of the poor equality we have in JS-land.

comment 6y ago · link · parent

Those two commands are not just "zero config and two commands", think about the entire stack you're pulling down behind the scenes. Sure, it's easy when you want to render "hello world" but there is so much context and abstraction happening here, that is hidden. Then we haven't even started thinking about HOCs, SSR and lifecycle hooks, none of them addressed by your terminal snippet.

comment 6y ago · link · parent

I've always found the best distinction between a framework and the library lies in who-calls-who? A library you call when you're ready to use it. With React, that's calling `ReactDOM.render()` when you want to render your application. A framework you just provide code blocks and let the framework call your code, rather than your code calling the libraries/frameworks code.

So with that in mind, you can use React as both. If you ever call `ReactDOM.render()` just once and then live in React land, with all the lifecycle hooks and whatnot, you're essentially treating React as a framework, as React calls everything after the first initialize.

If you call `ReactDOM.render` in multiple places or have something around that handles that for you, then you're using React as a library.

comment 6y ago · link · parent

You seem to confuse "normal" with "required". dvt (correctly) states that "it's normal now to have like 3-4 compilation/transpilation" which is indeed true for most React codebases (open source and not) I've came across. In fact, I don't think I've come across a single React application that is seriously built without using JSX and without a bundler (like including react.js in the beginning of HTML).

While not required, most people use JSX + bundler, at least for anything that resembles a serious application.

comment 6y ago · link · parent

Which is exactly what you found when you clicked on the link to the blogpost in the previous comment. So what is your point?

8442.

Fizz Buzz: An Interview Question(learningclojure.com ↗)

2 points · by capableweb · 6y ago · discuss

comment 6y ago · link · parent

Not sure about drawbacks but another solution would be to change the point where you do the queries instead. So you have a "user" object that is largely saved the same as most other "crud" objects, so you have a layer for those, add the flag there.

comment 6y ago · link · parent

If your texts frequently contain a particular phrase, have aliases! Saying "purple sun" will actually dictate "eggplant emoji smirk emoji"

comment 6y ago · link · parent

Sounds like the only misleading happening here was peoples understanding of how science works. Just because something is not confirmed doesn't mean it's not true.

Tweet reportedly said:

> There is currently no evidence that people who have recovered from #COVID19 and have antibodies are protected from a second infection.

How can they then write that the tweet is misleading? Bloomberg News et al that reported "WHO Warns You May Catch Coronavirus More Than Once" and similar should be the ones shamed for misinformation here, not WHO.

comment 6y ago · link · parent

Indeed! One thing that at least works on zsh is to prefix the command with a space, then the command doesn't go into the history file.

So if you do `date`, it'll end up in the history file but if you do ` date` (one space prefixed), it won't. One `clear` later and it's like the command was never run.

comment 6y ago · link · parent

Fun thing with building applications overusing npm is that you usually don't know exactly what packages you have. Not until you check for the specific package, so you probably don't "know at a glance" if you're affected or not.

comment 6y ago · link · parent

You can also just wrap the nvm commands in a function. I have it named `n`, so before doing any node/npm stuff in a shell, I run `n` then `node ....` whatever I wanted. Simple and doesn't slow down opening new shells.

    function n() {
      export NVM_DIR="$HOME/.nvm"
      [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
      [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
    }
Found it to be a ok workaround for the issue. Otherwise I'm just on nvm just because it continues to work and hasn't gotten in my way, since like 2013 or something. If someone is in the same boat but wanna fix the "slow new shell" thing, this is a quick fix for it.

Would love to hear what the "shell config shenanigans" wayneftw talked about, haven't hit that myself.

comment 6y ago · link · parent

> If you use Shadow CLJSs (all-in-one tool for ClojureScript), you've been able to use NPM packages directly for many years now.

That's not only true for Shadow CLJS but ClojureScript in general have allowed you to use npm packages for many years as well, although it was a bit clunky. Shadow CLJS did improve the developer experience though.

comment 6y ago · link · parent

Not sure exactly what futures you're referring to as there are no "native" futures in any browser (that I know of) so they are either implemented on top of Promises or by using callbacks, and still doesn't solve the problem of cancellation...

comment 6y ago · link · parent

> Switching to another browser to fix a packaging problem with the first browser is using a sledgehammer to crack a nut.

Sure, but some people just want to have their problem fixed and they only have a sledgehammer in front of them. If it works, is it really that bad?

> a browser wrapped in a cryptocurrency promotional wallet thing

I think you have it the wrong way around. It's a browser containing an integration with a cryptocurrency wallet, not the other way around. You'd still be able to use it as a normal browser if you ignore the cryptocurrency stuff.

comment 6y ago · link · parent

> No idea what this is doing on HN.

Most likely because people found it interesting. Not everyone finds the same things interesting.

> which is biased understatement

Funny thing regarding biases in political leaning is that it's all based around context. The US, being very right-leaning, would describe one person as left-leaning while in many European countries that same person would be center or even slightly right. So it all depends. It's useful to outline where you're coming from before laying out your perspective, as it's also biased (just like mine).

comment 6y ago · link · parent

Interesting, I didn't know that (BBS and Usenet was before my time), so thank you for sharing.

That does sound a lot like how Scuttlebot treats feeds as well.

comment 6y ago · link · parent

Ok, great story, but not really relevant to the conversation around the difference ways you can install a .deb, which is the subject of this particular sub-thread.

comment 6y ago · link · parent

Judging by your other comment (https://news.ycombinator.com/item?id=22954061) you were using Software Center for the installing. Gdebi was working fine back before Software Center.

comment 6y ago · link · parent

Oh yeah, used to be at least two more ways. Not sure which one of these are not possible but anymore, but you used to be able to do:

1) Synaptic package manager which is a GUI for searching and installing .debs. My first exposure to a package manager when I first installed Ubuntu some 12 years ago.

2) Simply double-clicking on the file, opening the Gdebi (I think?) UI for installing that specific .deb file.

comment 6y ago · link · parent

You can cancel a Promise by using AbortController and its AbortSignal, still experimental but supported in most browsers already.

comment 6y ago · link · parent

> If you make a package manager, but the only function it has is text editing

If it quacks like a duck, looks like a duck, it's a duck. If it doesn't quack and doesn't look like a duck, it's not a duck. So in your example, if npm just provides text editing, I'd call it a text editor, not package manager. If it manages packages, I'd call it a package manager. So this is judging things based on their functionality, rather than what they want to use it for.

Don't think the intended purpose matters too much in what something is. It is what it is, it is not what it was aimed to be but what the current state of it is.

And AFAIK, people _mostly_ use npm for managing packages, other use cases are not nearly as popular (like distributing assets).

comment 6y ago · link · parent

The idea behind this is that it's streams all the way through, so there could be something more efficient to use for these "rolling" database that basically are streams of data. So instead of SQL, it's map-filter-reduce, a query engine that works over streams. https://github.com/ssbc/ssb-query/blob/master/README.md - https://github.com/dominictarr/map-filter-reduce

It's probably a result of going with pull-streams and basically architecture all scuttlebot tools/libs around pull-streams, so you want something that works over streams.

And yeah, Scuttlebot is not built with SQL as it's query language, but you could probably easily write something that understands both SQL queries and the file format scuttlebot stores the messages in. Thing is, you don't want to send these queries to other peers (they are all local), because the system is setup to be offline-first and only reach out to the network when it has to, not just for listing latest messages.

In general, you want all the action of fetching/syncing of data to happen exactly when you want it to happen, and then when you're done it doesn't continue until next "sync". So everything you do is local.

But then, if "query the feeds the way I want to" is the reason you don't like it, then so be it. But if it's just that you don't understand it, then reading through and digging into the different repositories will give you a better viewpoint. Start at the ssb-query and look what's using it and what it's using.

comment 6y ago · link · parent

I think the quality of X doesn't determine what X is.

npm is a package manager, it manages packages for you. Hard to escape that fact. It's a bit rubbish, but it doesn't make it _not_ a package manager.

Same with the USA, might be a shitty country, doesn't mean it's barely a country

1
281282283
307