Fork me on GitHub
#off-topic
<
2018-03-23
>
donaldball01:03:38

I don’t do much graph work, but I have a graph problem. I have an undirected graph with a set of nodes that I want to consider to be roots, and would like to find all nodes that are not connected to those roots. I’m playing with loom and it’s easy enough to build the graph but none of the fns seem obviously correct to do what I’d like. Any tips?

tbaldridge02:03:24

Pretty much like a mark and sweep gc

tbaldridge02:03:14

Mark roots, push connected nodes into a stack, mark everything in the stack, mark connected nodes, etc. Don’t push any nodes onto the stack that are already marked. When the stack is empty unmarked nodes are unconnected.

tbaldridge02:03:13

Something like that ^^

qqq02:03:32

@tbaldridge: do you know of a good resource for "programming in datascript exercises" ? I'm looking for a resource that would have 100 exercises of common problems in CS, and solutions of how they would be solved in datascript. Most datascript resources seems to cover the basics, but never quite reach the level of "datascript idioms" or "datascript mastery"

tbaldridge02:03:18

No it’s not a Turing complete language

tbaldridge02:03:35

So most examples are going to be quite limited

fellshard02:03:21

@donaldball https://github.com/armstnp/advent-of-code-2017/blob/master/src/advent_of_code_2017/day_12_jgrapht.clj - Fiddled with JGraphT during Advent of Code, they've got a solver for that kind of problem; `ConnectivityInspector`. This snippet builds the same kind of undirected graph. You can make short work of the problem by adding artifical edges between each root, making all the roots and their connected nodes join in a single set; all remaining nodes not in that set are by definition not connected to the roots.

fellshard02:03:04

For a lighter-weight dependency, you can implement it by hand with a disjoint set lib

donaldball02:03:57

Thanks y’all, with loom the fn wound up being pretty simple: https://gist.github.com/dball/b1489171d8f4e55af1716534190bdc64

👍 4
qqq03:03:40

I'm building a webapp, which offers new users a free trial. I don't want users to be able to get more free trails via creating more fake email addrs. Thus, I want to force "one phone # -- one free trail." Now, I could send SMS verification and paty those fees -- but is there some way to leverage an external api (whatsapp? telegram? signal?) where they do the auth and guarantees me unique phohne numbers ?

jgh03:03:46

firebase has a phone api

tbaldridge04:03:37

IMO it’s not worth the effort @qqq . Just make a good app, tie it to the email, and trust your users. Most people have no problem paying for quality products. And you’ll never stop the pirates

qqq07:03:26

@tbaldridge: I think you're right. Per unit time, it's better spent making the software better so the user base will grow by X%, rather than trying to fight the X% of jerks who would never pay anyway.

Gaurav09:03:35

Hey everyone, I am currently trying to figure out problems which developers face ? any one want to help me out . i have few question

qqq09:03:15

My biggest problem is the lack of a paid StackOverflow. I want a resource where I can post request for sample code to do FOOBAR, attach a bounty, and get working code.

gklijs11:03:00

@qqq so something like provided a test, the first code to pass the test would get the bounty, and the code only is visible for the one who put the bounty on?

orestis15:03:04

I’ve read “out of the tarpit” and really enjoyed it. Any suggestions for other papers of that nature?

tbaldridge15:03:01

And this also goes a bit into the same subjects shown in the paper https://www.youtube.com/watch?v=O3tVctB_VSU

orestis15:03:43

Thanks @tbaldridge — any other suggestions for things a bit closer to the daily practices? I’m joining a new team and I’d like to woo them into paper reading a bit. Out of the tarpit was quite approachable even for someone who hasn’t ready any papers since uni days 15 years ago…

tbaldridge15:03:27

I know what you mean, the tarpit article is pretty unique in that regard.

tbaldridge15:03:58

Lol yeah, that's an awesome resource

tbaldridge15:03:10

Also there's Joe Armstrong's thesis... let me hunt that up

tbaldridge15:03:06

digs into Erlang a bit, but it's a good overview of how they deal with fault tolerant systems.

orestis15:03:57

Yes, that’s been on my radar for some time…

dpsutton15:03:08

wow. in the paper describing the correctness of the tools in erlang > At the time of writing the largest of these projects is a major Ericsson product, having over a million lines of Erlang code. This product (the AXD301) is thought to be one of the most reliable products ever made by Ericsson.

dpsutton15:03:12

that's "all in" on a new language.

tbaldridge15:03:20

The paper was written in 2003? Erlang was first written in 1986 by engineers at Ericsson, so it wasn't exactly a "all-in"

dpsutton15:03:41

2003 summarizing work from 1981 it says

tbaldridge15:03:30

But yeah, for what it was designed to do, Erlang is really good at it. My only complaints with the language is that I don't often need to do those things.

tbaldridge15:03:21

Erlang works best with message rates and small message sizes a few hundred bytes or so. So it baffles me when people want to write web servers with it where the headers alone are 1KB.

dpsutton15:03:47

> The language started as an experiment to add concurrent processes to Prolog sounds right up your alley

tbaldridge15:03:04

lol yeah, that's where the nasty syntax comes from

tbaldridge15:03:34

who thought that this was a good idea?

```````
expr1,
expr2,
expr3,
final-expr.
``````

tbaldridge15:03:40

that's a pain to edit, lol ^^

dpsutton15:03:55

looks both smalltalky and prology to me

tbaldridge15:03:53

Apparently they got the compiler written fairly quickly. According to Joe Armstrong: "the hardest part was the pattern matcher. That was 10k lines of code, and there was only one code comment about half way through that said 'now for the hard part'"

dpsutton15:03:26

reminds me of this comment that was in emacs' display code below an ascii skull and cross bones > BEWARE!! All ye who enter here: Most of the code in this module is twisted beyond belief! Tread carefully. If you think you understand it, You Don't, So Look Again.

☠️ 4
mpenet15:03:58

well some erlang http servers can nearly match nginx in terms of performance atm (depending on the scenario of course)

mpenet15:03:34

there's a lot of dirty tricks internally to avoid message passing everywhere, but it works

dpsutton15:03:36

hahaha

``````Once the design of the JAM was complete I started a C implementation
of the virtual machine—which was soon abandoned ader Mike
Williams read some of my C code—ader which I worked on the compiler.
Mike Williams wrote the virtual machine emulator and Robert
Virding worked on the Erlang libraries.
``````

orestis15:03:08

Yeah, in Erlang most of the IO can be done using lists (and malformed ones to boot) to boost performance — this maps almost directly to the system IO calls rather than having to build a big string in user land and copy that over to the OS.

tbaldridge15:03:54

a bit like Java zero copy code I assume

orestis15:03:21

iolist, exactly.

mpenet15:03:45

you can nest them etc etc and it gets flattened/mapped nicely, it's kind of cool

orestis15:03:59

Downloaded and printed “no silver bullet” and “equal rights for functional objects”

orestis16:03:22

Ah, can’t delete the annoying preview from mobile. Sorry about that...

qqq19:03:36

https://deeptalent.com/blog/tenure-length-tech-titans-compared/ <-- is this accurate? most people I've talked to tend to stick with a company for 4+ years, but anecdote != global data

andy.fingerhut19:03:44

@qqq It seems unlikely that someone here has already done a similar data analysis on such a large data sample as the authors, and can refute the article's claims based upon their own knowledge.

andy.fingerhut19:03:40

Anecdotally, I recall hearing that around 1999-2000 time frame, the average time for engineers to stay at one company was around 14 months, and the only reason it was that long, instead of shorter, is because typical contracts include a clause that you vest 0 stock options until working at the same place for 12 months.

andy.fingerhut19:03:08

So at the time of that Internet bubble, people on average were sticking around long enough to get 1 year's worth of vested stock options, then moving on.

andy.fingerhut19:03:25

There are a lot of contract positions in the tech industry, too, which I would guess tend to have shorter average durations at one company. The article you linked does not mention whether they tried to separate out contract positions from full time positions.

andy.fingerhut19:03:09

They say that their sample only includes people who say they worked at, then stopped working at, one of the companies they listed. It does not include people who started working at, and continue to work at, those companies.

andy.fingerhut19:03:22

That would pull the average way down, yes?

qqq20:03:33

Yes, that would bias the data.

qqq20:03:25

andy.fingerhut20:03:29

They would still have the same issues of "position changes while remaining at the same company" to handle. Not sure it would be significantly easier for LinkedIn vs. other people.

jgh20:03:04

probably also depends on what stage of careers they tend to hire at. You kinda need to bounce around a lot at the beginning to get decent pay raises in tech. I guess once that starts to plateau you can stick to one company longer…also you probably know what you like more

gklijs22:03:36

I'm at my fourth company in 6 years. And the first one was a large one, and we had a peer group of about 15 people, and they are all gone by now. It seems how bigger the company, how faster people leave, maybe because they feel less commented to the company.

orestis22:03:15

I stayed 9 years at my previous company. Staff of 4 people :)