« first day (1490 days earlier)      last day (3463 days later) » 

8:00 PM
It's pretty amazing
any screenshot you take is indistinguishable from random noise
 
@KendallFrey that sounds like it could get popular for being unique (the sound based game)
you should definitely try it
 
@BenjaminGruenbaum Yeah - I'm currently in the process of adding things one-by-one to the empty test
was hoping to avoid this.
 
@KendallFrey Sounds like Dwarf Fortress.
 
@BenjaminGruenbaum Sure, but there a thread can be blocking and once it continues merrily on its way the thing it was doing is completed. We have no such thing in JS yet still have the need for knowing.
 
@KendallFrey link?
 
8:01 PM
@RoelvanUden how would you handle this in C#? How do you usually catch an exception, do some processing and then signal it's not handled?
 
@JanDvorak trying to find it
 
@BenjaminGruenbaum rethrow?
 
@BenjaminGruenbaum If I have a Task that may swallow some exception I can still await it and know it has finished.
 
Look at those sexy screenshots
 
@JanDvorak exactly
 
8:02 PM
wow not sure if my video card can handle it
 
"or their eyes get "all woggly""
 
@RoelvanUden oh, yeah, ES6 promises are horrible like that. They don't have unhandled rejection tracking yet.
 
that's what my medical professional says
 
> (These are not random dot stereograms. Do not try crossing your eyes.)
Who tried crossing their eyes?
 
@Loktar Imagine that in the rift
 
8:03 PM
@JanDvorak /me slowly raises his hand
 
@RoelvanUden anyway .catch(...).catch(...) only makes sense if you might rethrow in the first catch - like Jan said - it's just like synchronous code.
 
@Zirak HE LIIIIIIIVES!
 
@BenjaminGruenbaum Honestly I don't care how I get the signal this promise is done. So long as I can get it if the promise has decided to swallow its own fatal error. So I suppose I should switch to bluebird and use finally then?
 
@SomeKittens HE SKITTLES!
 
delicious
 
8:05 PM
but not enough chocolate
smarties are better
 
@RoelvanUden finally
 
@RoelvanUden it's not .finally, you can do something akin to .finally. The thing is Bluebird doesn't swallow errors. If a promise is rejected but you never unwrap it via .then or .catch - just like C# tasks you'll have a swallowed error. Bluebird will find it and give you a big red warning. You can also hook on it.
 
aaaand it's a $httpBackend issue.
 
You can .catch(function(e){ setTimeout(function(){ throw e; }); }); all your promises as an alternative, but that's ugly, and if you forget it in just one place you get a suppressed error.
@SomeKittens aw
 
or at least the test passes without it.
hmm - some work.
 
8:08 PM
@BenjaminGruenbaum So, .finally is not the solution I'm after? Perhaps I should discuss my use case?
 
hooray, I can now get a valid parse out of this.that _ (x + 1 - 2, ++++y+++++3^3 << 2, 3 + 4^2 - 2);
 
@RoelvanUden discussing your use case is always good.
 
in case you would ever need to use that
(using this with that)
now to add maps, arrays, declarations, and the interpreter
 
@RoelvanUden finally and solution never sit well with me
 
Oh that's cool, I just wrote a small CSS parser today, we're doing this monthly challenge thing and one of the ideas is a CSS parser in clojure and it probably won't get elected but I wanted to do it anyway. It's wip.
 
8:09 PM
:P home time have a good weekend all
 
hah whatever father :P
 
@BenjaminGruenbaum I want a JS-like language, literally using singly-linked maps as scopes. Sort of scala-ish, but much lighter.
 
@BenjaminGruenbaum I'm working on a JavaScript equivalent of my C#.NET comic book downloader (manga, actually). In the C# version I would limit the amount of concurrent downloads using n threads and a Queue<T> of things to run. I envisioned that each "download" could be a promise and I could build an extremely simple enqueue/run mechanism for it. I would need to track when a download finishes, but if it has its own error handlers, that's a no-go. What I thought: pastebin.com/2rp4tcSV
 
@ssube I completely lost you at 'singly-linked maps as scopes'
I'd be ok with scala on the web though, if they drop stupid stuff like xml literals and singletons and allow free functions.
 
8:11 PM
@BenjaminGruenbaum Scope { Scope parent; Map<String, any> vars; }
any { ... } is a new scope (using [x: 1] for map literals).
 
@RoelvanUden So Promise.map(data, fn, {concurrency: n })?
Kind of like WithDegreeOfParallelism.
 
When you ref a var, check the current scope (scope.vars.hasKey) and recurse up.
 
@BenjaminGruenbaum Uh? I don't know the amount of tasks, or promises, at the start. A promise can produce new promises and enqueue them as well. What's that snippet tho?
 
@ssube yeah, that sounds like a symbol table but what makes scope?
@RoelvanUden Ah, you just want n workers?
 
@BenjaminGruenbaum Precisely.
Well that was a rather quick description of what I was after. Hell, language.
 
8:13 PM
@BenjaminGruenbaum any instance of { ... }. Conditionals, loops, and functions.
 
@RoelvanUden what you have looks fine, how do you know when a job is done though?
 
I have a <form> inside a modal that's not visible inside jquery/devtools until I open the modal. What would cause that?
In other words, I can see the contents of the Modal with several elements, the <form> element being one of them, but I can't look inside the <form> until I actually open the modal.
 
@BenjaminGruenbaum Because it's a promise I would then it with a complete and error to next. Problem there appears: if the promise itself swallows its own error, my worker-thingy won't start the new promise in queue and a worker silently dies.
 
Wait, I see a problem, shouldn't it be this._queue.unshift()().then(next, next)? As in - actually invoke the function?
 
@BonsaiOak Welcome to the JavaScript chat! Please review the room pseudo-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.
 
8:15 PM
I also want ruby-esque inline if, rather than a traditional ternary. Going to make if/else/while symbols, and probably omit for.
Is there any case where a for loop can't be written using a while?
 
@BenjaminGruenbaum Good catch but that's not the problem I'm describing. This was a mock up harr harr :P
 
@RoelvanUden your Pool is not a promise conceptually, it's either an observable or an event emitter.
The pool itself can't be a promise since it doesn't have a clear end time.
Or a single value
 
@ssube - C# will compile a for loop to a while loop
 
It doesnt have to be.
 
It can't be.
 
8:17 PM
That's OK too. Not a problem. It should just run promises I enqueue and start new promises from the queue when running < n. That's really all I'm after. But yeah, a promise can swallow its error and the "pool" won't fire the next one.
 
@RoelvanUden well, .queue could return a promise that resolves when that particular task is done.
@RoelvanUden well, you have .then(next, next) so that'd prevent that, you start the next one anyway.
 
You're on a completely different problem (one I don't have) now..
That bit, .then(next, next) won't work if the promise has its own .catch
That's the problem :P
Pretty much this
var pool = new Pool(4);
pool.queue(function () {
    return Promise.reject().catch(function () {
        console.log('I eat babies for breakfast!');
    });
});
// And thus a worker died.
 
Well, you're handling success too though, so I don't see the problem
 
@RoelvanUden - how are you downloading the files, are you creating a WriteStream and a Pipe, if so why do you need promises like this, just keep an array and check it's length, and what do you mean by "worker"
 
@BenjaminGruenbaum Because the error is never handled in the pool it won't fire the next promise
 
8:22 PM
It is handled though, the second next in next, next is a error handler.
 
lol the star queue is ... so abnormal right now
!!afk kicking myself
 
@RoelvanUden lemme try writing a pool, one sec.
 
"kid approved" with that icon?
 
@RoelvanUden this requires forwarding in order to get returning promises right, it's almost like implementing promises again hmm :)
It also feels like implementing merge from RxJS
 
Just completed Lost in the Static. Awesome game
 
8:31 PM
There's also kriskowal's promise queue
 
@BenjaminGruenbaum Nevermind man. Seems like my pool will work fine so long as I don't do weird stunts. I'm again sick and tired of jumping through hoops to get simple shit functional, I'll just deal with not catching anywhere else.
 
Morning again
 
@JanDvorak Are your eyes woggly yet?
 
Back to normal
 
@RoelvanUden And again, you don't know the collection beforehand?
You should really check out FRP, RxJS deals with all these weird issues you're having directly.
I'm not sure why you're doing things the way you're doing them, but it seems relevant.
 
8:33 PM
@BenjaminGruenbaum Because necessity, really. Having hundreds of concurrent downloads is going to make the downloader and the resource site cry in agony. Limiting concurrency just has to be done
@BenjaminGruenbaum And nope, each promise can produce new tasks to do. e.g. a task can be "inspect this manga series" which can spawn more tasks "download this chapter"
 
Right, but how come you don't know the number of links in advance?
@RoelvanUden you do realize, you can limit download concurrency on node itself right?
Even if you set concurrency to 10000 in your pool, it'll still only do X connections where X is node's limit.
 
@BenjaminGruenbaum Cross-platform, what about browsers, phonegap, node-webkit, ...
 
 http.globalAgent.maxSockets = 20; // or we
@RoelvanUden browsers limit to 6 I think, phonegap runs in a webview so the same applies.
You can change it as a setting but noone defaults to making a thousand requests at once.
 
Point being that I want to be the one in control, not some arbitrary random value in some random environment that my code just happens to run in.
 
8:35 PM
Using concurrency at the promise level will just give you an impression that it'll actually set it to that level of concurrency where it's being limited elsewhere.
 
That's almost as bad as relying on the .NET thread pool "not having more than n threads anyway" :P
 
You're not in control anyway, they can limit you, they can run multiple copies of the program etc.
You are not in charge of the browser's net stack and you're no in charge of the computer's for sure.
 
Again, problems I don't have nor need to deal with. It's not a doomsday scenario where every single user is out to fuck things up. All I was doing was limiting my code concurrency and nothing else.
 
Literally no environment that runs JS and makes HTTP requests defaults to letting you run lots of connections.
 
> It's not a doomsday scenario where every single user is out to fuck things up
Uhhhm that's exactly what they are out to do :P
 
8:37 PM
What if a user runs two copies of your code? Or runs one copy and uses a library that uses your code?
 
@PeeHaa Never trust your users, they're trying to break everything and will succeed eventually.
 
@ssube Wrong ping?
 
@BenjaminGruenbaum It, doesn't, matter. That's not my goal.
Nevermind. Thanks for your time.
 
@PeeHaa Agreeing with you.
 
Ah k :)
brofist
 
8:40 PM
@RoelvanUden sorry for not understanding your problem better. Glad I could help with the parts I could help with :)
 
@PeeHaa \o
 
user logout, makes sense to be a post yes? not a get?
app.post('/logout', users.logout);
 
Not a get
 
kk, just making sure.
ty
 
You could do a DELETE, if you want to treat sessions as an object rather than the weird thing they usually are.
Might be an interesting technique.
 
8:46 PM
well there is two actions the logout could do. log you out of a temp state, or log you out if said state isn't present
 
POST /session vs POST /session/login, GET /session vs GET /session/valid, and DELETE /session vs POST /session/logout
 
I think that makes sense to tie them to the same endpoint on the server?
 
cause sessions totally have the unique Id, so you can treat them as a thing (if you want)
 
HTTP verbs don't make sense for login/logout since HTTP is stateless.
You have state, so just pick POST
 
Yeah, DELETE to a /session is what I've seen mostly
 
8:47 PM
Since you don't want users accidently logging out when they clicked a link a friend sent them on another site.
 
sessions are a hack ducks for cover
 
app.post('/logout', function(req, res) {
  if( req.user.foo ) { req.user.state = 1; return req.redirect('/foo'); }
  // destroy session.
});
 
@PeeHaa we're all saying that
 
@PeeHaa For sure.
@Retsam Really? I don't think I've ever actually seen that, it just sort of makes sense.
 
but does the DELETE make sense if the session destroy is conditional?
you can login, then login again - logout backtracks you once, logout again kills the session
sounds messy but it probably isn't - I'm just being vague
 
8:50 PM
@ssube It's what we use in the product I work on for my work, which I suppose is what I mean by "mostly" seen. I haven't exactly done a wide survey
 
Live is too short to worry about HTTP verbs in state.
 
POST it is then
 
You have state, the verbs are only meaningful when you don't
 
bot!listcommands
I dunno what bot!listcommands is
 
GET/HEAD are problematic because of idempotency, others should work, POST is just the easiest.
 
8:51 PM
SO CLOSE
GGAAAHH
 
292
Q: What is an idempotent operation?

WillWhat is an idempotent operation?

incase anyone else had to look that up
 
ohgod
made parens optional in my scripty grammar, something terrible happened
 
@rlemon Psh, do you even idempotent operations, bro?
 
parse time went from <50ms to 10s+
 
bot!listcommands
I dunno what bot!listcommands is
Bah fuck you
 
8:53 PM
for this.that _ (x + 1 - 2, ++++y+++-++3^3 << 2, ? (x) { y; } !? q > 3 { z; } ! { w; } + 4^2 - 2), true, false, this _ x, y;
 
Wait that was supposed to be a message reply
 
@Retsam I don't think it be like it is but it do
 
where is that from ????
 
@CSᵠ #fail ?
 
heh not sure but I love it
 
8:55 PM
I've seen it a while ago
 
yeah same here its so well done lol
 
I think it is just someones short about perpetual energy
 
@PeeHaa fail?
 
looks like its from a movie or a commercial
 
i'd like to see the full vid + audio
 
8:56 PM
bot!listcommands
@Zirak listcommands, wat
 
The buttered cat paradox is a common joke based on the tongue-in-cheek combination of two adages: Cats always land on their feet. Buttered toast always lands buttered side down. The paradox arises when one considers what would happen if one attached a piece of buttered toast (butter side up) to the back of a cat, then dropped the cat from a large height. The buttered cat paradox, submitted by artist John Frazee of Kingston, New York, won a 1993 OMNI magazine competition about paradoxes. == Thought experiments == Some people jokingly maintain that the experiment will produce an anti-gravity effect...
 
bot!wat
@Zirak wat?
IT'S ALIVE
 
@CSᵠ It kinda kills my browser tab
 
bot!yes
 
@rlemon I dunno what yes is
 
8:57 PM
bot!!slidepoop
 
@BenjaminGruenbaum I dunno what !slidepoop is
 
Bot's borked
 
yes is a Unix command, which outputs an affirmative response, or a user-defined string of text continuously until killed. == Description == By itself, the yes command outputs 'y' or whatever is specified as an argument, followed by a newline repeatedly until stopped by the user or otherwise killed; when piped into a command, it will continue until the pipe breaks (i.e., the program completes its execution). It can also be used to test how well a system handles high loads, as using yes results in 100% processor usage, for systems with a single processor (for a multiprocessor system, a process must...
bot!love
 
@SomeKittens I dunno what love is
 
@PeeHaa dude... buy mo' ram?
 
8:57 PM
 
bot!echo "I'm in love with jQuery"
 
@BenjaminGruenbaum I dunno what !echo is
 
bot!the_advantages_of_macs
 
@SomeKittens I dunno what the_advantages_of_macs is
 
Oh man you guys see the news about DirectX 12?
 
8:57 PM
@BenjaminGruenbaum I dunno what echo is
 
not compatible with Windows 7
 
@rlemon dude thanx !!!
 
they should make DX opensource
 
bot!love
 
@BenjaminGruenbaum I dunno what love is
 
8:58 PM
@Zirak there there buddy, it'll come in time.
 
lol
 
@Loktar ugh.
1 min ago, by SomeKittens
bot!love
 
@Loktar :(
 
@SomeKittens aww
 
8:59 PM
like ten times :(
 
bot!shrek
 
@rlemon Windows 10 is looking good
its compatible with that as well as 8
 
but I own windows 7!
 
Aww double time, shrek is love, shrek is life
 
I won't pay another $400
 
8:59 PM
Any JS experts here that know Ionic :P
 
Windows 10 is nice, didn't really play with it too much
 

« first day (1490 days earlier)      last day (3463 days later) »