« first day (2111 days earlier)      last day (2851 days later) » 

5:00 PM
There's literally no reason to use var anymore.
 
^
I did just interview a guy that said that he didn't see the need to use let or const, but he was good otherwise. I'll just have to teach him the ways of the force if we move forward with him
 
i've been using const so much
 
@JanDvorak and the net is shot full of examples like let foo = require('foo');
 
i like it
 
@KendallFrey code golf?
 
5:01 PM
!!afk chasing scyther
 
@ndugger My internet's been out since Saturday, haven't been able to do any research. : /
 
As in, I want a variable that gets initialised inside the function body but also gets shared between iterations.
 
then define it outside of the scope
let foo;

for (...) {
    foo = yourMum;
}
 
too many bytes
 
Don't use var like a pansy
bull
 
5:04 PM
@JanDvorak BS
 
I said "code golf"
 
@JanDvorak Ah
Valid then.
Why use it at all?
Just use globals
 
2true
 
// @JanDvorak
let foo = (function() {
    let persistentVariable = 0;
    return function() {
        return persistentVariable++;
    };
))();
 
Good point. Recursion?
 
5:05 PM
Hi guys
 
for(i=0;i<c[i];i++){console.log(c[i])}
 
what are we discussing?
 
Potatoes
 
*you guys discussion about
 
potatoes are constant
 
5:06 PM
@Trasiva every click is Risky
 
@JanDvorak I've rarely seen recursion in code golfing
 
const potatoes;
 
r=c=>{console.log(c[0]);r(c.pop())}
I think they're exactly equal in length
 
@rlemon Friday night I came across sooo much MLP stuff it was just...horrifying.
 
@SterlingArcher holly hatched a cp220 pikachu
 
5:06 PM
@MadaraUchiha lambda
 
@MadaraUchiha 42, this one, vs 43
 
@MadaraUchiha for(i=0;c[i];i++)
 
@rlemon don't tell her I hatched a more powerful one
But it only came with 4 candies
 
hers was a 2k egg I'm pretty sure
 
Manual stack to avoid local variables? Feels roundabout, but that's within the spirit of code golf.
 
5:07 PM
:31964974 r=()=>...
 
@KendallFrey smart
 
const _for = i => i < 10 ? true : _for(i++)
pls
 
@ndugger You can still write decent code with only var. I rarely end up need true block-scope, or const enforcement. I don't agree that they are pointless, though.
 
Did you just use post-increment inside an expression?
 
@ndugger you probably want ++i
 
5:08 PM
even better: for(i=-1;c[++i];)
 
@Luggage you're wrong
 
@JanDvorak Everything is fair in code-golf.
 
@FlorianMargaine correct
 
actually that might be the same
 
!!> 'for(i=0;i<c[++i])console.log(c[i])'.length
 
5:09 PM
@MadaraUchiha 36
 
looks legit
 
!!> 'r=c=>console.log(c[0])||r(c.pop())'.length
 
@MadaraUchiha 35
 
Recursion still wins
 
braces? madara pls
 
5:09 PM
is there a way I can have two processes communicating with one?
 
@MadaraUchiha 34
 
@deostroll many.
 
@deostroll on Linux, named pipes
 
You did it wrong though
 
@deostroll child_process.spawn/exec
 
5:10 PM
@deostroll That is what operating systems DO.
 
@MadaraUchiha 34
 
I think they're the same
 
or simply any kind of api
 
Now they're the same
 
oh
now recursion wins
 
5:10 PM
No, now both are 34
 
No
you missed -1
 
@deostroll many
 
6 secs ago, by Neal
@KendallFrey You will know when recursion wins
 
From my main program I start 3 forks...Say the fork3 is responsible for synchronizing access to some data...
So now how does fork1 and fork2 have to communicate with fork3?
 
@KendallFrey ?
 
5:11 PM
@deostroll oh, forks? use pipes.
 
3 mins ago, by Kendall Frey
even better: for(i=-1;c[++i];)
 
this forking feels very XY.
 
Can anyone help me out with this issue: stackoverflow.com/questions/38596401/…
 
@Buccaneer Welcome to the JavaScript chat! Please review the room rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
wait
what
 
5:11 PM
@KendallFrey I did not
 
Where did you even get yours
 
Oh wait, I did forget to add a ; at the end
 
3 mins ago, by Madara Uchiha
!!> 'for(i=0;i<c[++i])console.log(c[i])'.length
 
I was thinking more of hosting a localhost express server in fork3
 
that's so wrong it's laughable
 
5:12 PM
for(i=0;i<c[++i];)console.log(c[i])
 
@deostroll I can't think of a reason to host an express server in a fork.
 
@MadaraUchiha Still missing -1, and what's with the i<
 
just tell us, more generally, what you are trying to accomplish.
 
or wait for random links from @FilipDupanović
 
5:13 PM
@KendallFrey That's what happens when you copy-paste.
Don't copy-paste kids.
 
but.. copying and pasting from SO is how I put food on the table.
 
I thought pipes were for stdin and stdout usually
 
I'm not sure pipe() is available in nodejs :/
 
for(i=0;c[++i];)console.log(c[i-1])
vs
 
for(i=0;c[i];)console.log(c[i++])
winner
 
5:13 PM
@FlorianMargaine streams have pipe, I thought
 
@FlorianMargaine AFAIK you can stream in Node.js from a child
 
sure it is. node can doo all sort of things with pipes and streams
 
#knowledge
 
@deostroll uh.. wat. Have you tried something like RabbitMQ?
 
r=c=>console.log(c[0])||r(c.pop());r(c)
 
5:15 PM
@Luggage hey, you're the one that said there's many ways to do IPC in Node.js, I have a canonical link to prove it
 
JSFunge
 
wait... where's Faye and my other favs... damnit
brainfart, case-sensitive npmjs.com/browse/keyword/ipc
 
@MadaraUchiha doesn't work
c.pop() isn't an array
 
console.log returns undefined
yeah?
 
@ndugger Yup
 
5:17 PM
that too
 
infinite recursion?
 
@KendallFrey Yeah, recursion won't win here
 
@KendallFrey reddit.com/r/AskReddit/comments/4ut9tw/… this thread.. this thread is for you
 
You can use .slice(1) but you have to add the .length==0 check
 
is background: none; valid css?
 
@Luggage Yes, I think
 
What a baller intro
 
@Luggage You can try
 
r=(c,i)=>c[i]&&console.log(c[i])+r(c,i+1);r(c,0)
not great
 
background-color: transparent; is what I am trying to actually set, but it's not clear if background: none is a valid shortcut.
 
5:21 PM
@KendallFrey Nope.
 
@Luggage it sets your background image to none
 
hm, yes. that's no good.
 
@rlemon holy... holy shit
 
argh, bootstrap style is leaking where I don't want it.
 
@KendallFrey :O
 
5:23 PM
@rlemon dude LOL
 
> What's the difference between John Wayne and Jack Daniels?
Jack Daniels is still killing Indians.
(he means my kinda Indian)
 
dark.
 
Dude this thread is amazing
Like I can't post half of these in here
 
OMG The mediterranean joke is brilliant
 
more than half
 
5:25 PM
short and to the point
 
Ph.D. one is dark
 
Oh I love Ethiopian jokes
 
> What's the most difficult part of a vegetable to eat?
The wheelchair.
Bruh
 
OMG the Usain Bolt one actually has me like :O
 
> Jesus fed 2000 people with 5 loaves of bread, but Hitler made 6,000,000 Jews toast.
BRUH
 
5:29 PM
lmao
 
I don't consider jewish to be a race
 
5:33 PM
This whole thread is amazing.
I'm dying and getting stares at work.
 
@KendallFrey Ninjad :P
@SterlingArcher Ninja'd twice
 
Came in for JavaScript discussion, saw racist jokes, left...
 
bye
 
@littlepootis sorry for delay...so in essence I've to start a socket server of sorts?
 
@deostroll You'll have to, yeah. But there are libraries like RabbitMQ that provide a nice messaging interface on top of sockets.
 
ohhhh damn
 
Alright, alright. Before the flags start coming in
Use your inside voices :P
 
THIS IS MY INSIDE VOICE
 
@deostroll what are you trying to do?
 
5:37 PM
@MadaraUchiha At least they're links, and not blatantly pasted.
 
@Luggage trying to make a fork in-charge of synchronizing access to a file...
 
@littlepootis RabbitMQ isn't a library tho
 
also who announces it? you ever walk into a restaurant and decide you don't like the atmosphere so tell everyone "this place isn't friendly for me" and leave? not that I'm siding with the jokes, it was the "most fucked up joke you know" thread.
 
any AQMP library ought to be able to hit a Rabbit server
 
just saying..
 
5:40 PM
@ssube right yeah, thank for correcting me
 
@deostroll you don't fork for that. You fork when you need to make multiple of the same process.
but.. a single process to lock and access a file does make sense.
potentially.
are you ever returning large blocks of data or relatively small blocks?
 
@littlepootis can AQMP go over sockets?
I thought it was an HTTP-like messaging protocol on TCP
 
okay, its just the term I've used to convey the basic idea...I should rather use spawn
its not just file access, it also meant to do some cpu intensive work
 
spawn is an implementation detail, not a solution.
 
@deostroll what does this file have?
can you use redis or something instead of a literal file?
 
5:44 PM
a process that reads from a message queue, like others are suggesting, does make sense
 
in my experience, synchronized random access to a file is usually an atomic key-value store in disguise
or a message queue
 
So, instead of saying "I am trying to fork", just tell us what you want to do.
34 mins ago, by Luggage
this forking feels very XY.
I am confident there is a fairly simple solution.
 
This one sounds particularly farfetched though.
 
okay, program A is a web server, program B queries the db and computes stuff regularly at a specified interval... A ask data from B. B must return its most recently computed result which is cached...
Program A can be a forked-cluster express server...
 
ok, so a cron job that writes a file.
 
5:50 PM
@Luggage pls no
 
:)
 
@MadaraUchiha I'm kind of surprised nobody here has tried that, but then again, they don't understand how vcs works.
@deostroll redis
you want redis with expiration and string/hash values
 
@MadaraUchiha I threw up in my mouth a little.
 
@ssube yes, I've seen several libraries do that. The one I currently use doesn't, though.
 
@littlepootis what does it get you? I was under the impression that AQMP is pretty fast on its own.
 
5:52 PM
is this one result, or can process A ask for a wide range of queries?
 
one result for now...
 
and is it a simple answer or a big document?
 
uh, nodejs streams can work with fork()?
 
and hopw often is it updated? once per second/minute/hour/day?
 
using all of the tools, I would have a MQ for the incoming work (maybe fed by a cache-sweeping process) and Redis for the results
 
5:54 PM
big document
 
if you have a component in react that relies on another parent component completing some task, what is the best practice? Eg:
 
@ssube I love redis, but for a single 'large' document, it might not be the right choice.
 
as far as I understood, streams are objects, not OS constructs (eg file descriptors), so I don't see how they could work with fork()
 
@deostroll how big?
@Luggage it can handle some pretty good size stuff, iirc, but not well
 
and if you use redis, it can be your message queue, too.
I use github.com/OptimalBits/bull (redis-based message queue) with no regrets.
 
5:56 PM
@corvid why wouldnt the parent just pass down the fact that it's "done" with new data?
 
Or the parent never even renders the child until it's ready.
 
user1596138
@corvid Don't render the child until the parent decides it should? Or any variation of such with the same result
 
user1596138
Dammit @Luggage
 
@MadaraUchiha did that really happen though?
 
{complete ? <Child result={result} /> : null}
 
5:57 PM
It is a big dictionary...it really depends on the characteristics of the upstream application the whole system is trying to support...
 
@bitten Like I said
It sounds farfetched.
 
@deostroll how big?
 
*farfetch'd
 
1 mb, 10mb, 100mb, etc. Just ballpark here.
 
bytes? mb? tb?
 
5:58 PM
or that.
 
don't bring pokemon into this Jan
:p
 
Petabytes?
Yodabytes?
 
Pedobytes.
 
{ complete && <Child result={ result }/> }
pls
 
@MadaraUchiha yeah.. i agree. Tom probably had his quirks and this was written in rage
 
5:59 PM
@Luggage Totally different thing.
 
so prone to exaggerations
 
@bitten don't misunderestimate people who still use SVN.
 
Should be less than 10mb I think...
 
haha fair enough
:,)
 
We had a server in prod that was for static content and they specified the file and which rev they wanted
on a per-file basis
 
5:59 PM
@ssube But as a runtime database that holds code?
 

« first day (2111 days earlier)      last day (2851 days later) »