« first day (1359 days earlier)      last day (3584 days later) » 

5:02 PM
Bleh, two of my photos got posted on a facebook page with almost 700k followers and they didn't credit me (besides the watermark that's in all my photos) :/
 
sue them
 
he doesn't live in Murica
 
there are laws outside of america too
 
it was a joke
 
I know :(
 
5:20 PM
~50 hours no smoke.
I think this is going to work :)
 
!!play skyrim or trim plants
 
@rlemon trim plants
 
too bad.
 
!!should rlemon play skyrim or trim plants
 
5:30 PM
@AbhishekHingnikar trim plants
 
@rlemon seems like shes determined on you trimming plants
 
5:44 PM
window.Screen.lockOrientation OMG IT IS SUPPORTED !
 
5:59 PM
guys, I'm trying to adapt jquery validation script to show a button if all fields are valid
this is what I came up with, but it isn't working:

        onfocusout: function (element) {
                        $(element).valid();
                        if ($('#theform').valid()) {
                            $('#.blocked').css('display','none');
                            $('#.continue').css('display','block');
                        };
                    },
it's being run even if the form is empty
 
why not onchange ?
 
onchange or onkeyup?
While googling found only onkeyup
 
@LucasB #. uhm, what?
 
this function I posted do two things at once: It checks if the input is valid onfocusout, and check if the entire form is valid
if the entire form is valid, it should show the Continue button :)
 
Can you tell me what #. is supposed to select?
There's #, which is "select by id", and there's ., which is "select by class". I honestly never saw the two next to each other.
 
6:12 PM
rsrs, messed up with the Cntrl+C to here, sorry
but in the code it's right
tried to simplify it to post here
this is what it looks now:
 onkeyup: function(element) {
        $(element).valid();
        var form = $( "#form-comprar" );
        if ($form.valid()) {
            $('#comprar-2 .blocked').css('display','none');
            $('#comprar-2 .continuar').css('display','block');
        };
},
 
Does anyone know why this jQuery UI sortable is not working? jsfiddle.net/tmyie/u2khA
 
How can somebody require that much cooling/performance ?
unless they are mining bitcoins
 
.. games
 
jesus. why not just go out and play if they want such realistic ness :-|
 
Because murdering people with large swords is illegal.
@Loktar You call this FREEDOM!?
 
6:21 PM
@Zirak paintballs is not :'(
fencing is not [unless you are in rules]
I am happy with the bullshit -stock pc i have, and it runs most of games i play pretty decently
 
6:38 PM
I am now going to test a "supposedly" new DDoS attack vector abusing Google spreadsheet's content fetching against StackOverflow and if it works I'll report it to the devs to fix.

Just so you're aware this is nothing to worry about and will be possibly something you'll not notice.
 
that's sure not to piss anyone off
 
Anyone here familiar with jquery mobile?
 
@user3669154 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.
 
I've got a problem with my jquery mobile site due to the hash navigation caching the wrong locations making data-rel="back" buttons not to work right
 
I love it when print ads show signs of jpeg compression
 
6:54 PM
the problem is that when you refresh the page, the hash navigation is still in the URL, but the way I am building it, pages are separate files loaded in at run time. So, when you refresh, it loads the login page, and everything works, but as soon as you click a "back" button that is supposed to go to the page you refreshed on, you go to the login page instead. I need a way around this
 
Is there any time limit on reddit post's edits? I want to submit an answer to @FlorianMargaine, but it's huge and will probably take a few edits.
 
No time limit
Except the 5 minutes
(I'm kidding, there isn't a time limit)
 
@Zirak thanks for the answer
reading it in a couple of minutes.
 
@SomeKittensUx2666 why do they even use jpeg compression for soemthing that is going to be printed ?
png etc are bettaaar
 
7:04 PM
That's my point
 
I made a time lapse capturing app ... in "javascript" .. i must be satan
 
@Zirak I knew I could count on you. If I understood correctly though, you only described generators there, right? Coroutines are a little bit more?
 
isn't raw better for print?
 
print? tiff.
 
@FlorianMargaine Correct. I didn't want to touch on that too much, but generators are a special case of coroutines, used as an abstraction over iteration.
 
7:10 PM
@FlorianMargaine aye, you're right
 
What happened?
 
Coroutines can be nested arbitrarily, composed and so forth - treated like regular functions.
 
@Zirak example?
@Loktar the printing industry only uses tiff
I worked at a printing factory for 2 years, they need huge disks to handle their data
 
function*foo(){ // like:
    yield * bar(); // yield from another iterator
    yield foo(); // recurse
};
also, generators are not coroutines, they're a very limited version of them
Coroutines are more like sigsetjmp and siglongjmp in C if you played with those
They're functions with arbitrary return points and arbitrary start points.
Also, hi
 
@BenjaminGruenbaum it clearly shows that you're knowledgeable about your stuff, but I never understand your explainations
 
7:13 PM
haha, I wasn't attempting to explain anything, sorry. I was just giving an example to what Zirak was saying
Also, the part about coroutines not being generators was more aimed at zirak :P
Let me try to explain them @FlorianMargaine , have you ever used threads?
 
Cool :) What problem do they solve?
 
"academic" is the word I was looking for to adjectify your explainations, usually
@BenjaminGruenbaum running 2 different things in parallel?
 
So a computer with 4 CPUs never needs more than 4 threads?
 
yes and no
I know the difference between parallelism and concurrency
 
7:15 PM
In that case, I can agree to running several things concurrently.
Now, let's see what coroutines are
 
concurrency: several things on the same thread, because a single thread can wait for something, in the mean time another function can run
 
Say you have a function, it always gets invoked by getting an input, then it does some processing, then it is done and it returns, once it returns we are done with it, and we always start it from the same place.
Modern programming languages, like JS and C let us return from our functions in several places, for an obvious example:
function foo(){
    if(Math.random() < 0.5) return 3;
    return 5; // a second return spot
}
However, no matter how we call foo, it always starts by executing the if
 
followin' ya
 
(not very hard to :P I was just giving feedback :))
 
7:18 PM
for Lego in msApplebee()
 
Now, the problem threading solved for us is concurrency, we want to interleave stuff
 
I don't think that's home you use Legos
 
That's impossible with normal JS functions, since once we start a function we must end it, because we can't pause it and resume it again in different places
 
@SomeKittensUx2666 she has an interesting home life..
 
(aside: I just came across this issue: xkcd.com/541)
@BenjaminGruenbaum you could just export what's after the if in another function
 
7:19 PM
coroutines let us do just that, they let us pause execution, and then resume it later from the same place
@FlorianMargaine you could, and that would also work solving the same problem - it would just be harder.
 
do you have an example? I just don't see how that can be used
 
In a minute
So coroutines are just functions we can enter at different locations just like we can exit functions at different locations. generators are a special kind of coroutine that we always enter where we last left off, and subroutines (aka functions) are special kind of generators that we only enter and leave once - at the start until a return or it ends.
 
@FlorianMargaine isn't tiff like wav just a thin wrapper on raw ?
 
Coroutines let a function have state, not unlike a closure - so we can keep track of where things were when we last left off.
So, in Java, a fibonacci number iterator would require a class, or a global variable to maintain state.
In JavaScript prior to version 6, I'd do something like:
function getFibo(){
    var a = 1, b = 2, tmp;
    return function(){
       tmp = a;
       a += b;
       b = tmp;
       return tmp;
    };
}
 
7:24 PM
ok
 
That's likely incorrect, but you get the idea (it has an offset)
 
yeah got it
don't worry
 
With generators, the bookkeeping would be implicit
 
i.e. passed as argument?
 
function getFibo*(){
    var a = 1, b = 1; tmp;
    while(true){
        tmp = a;
        a += b;
        b = tmp;
        yield tmp;
    }
}
 
7:25 PM
ah
nice
 
This does something similar to what the last one did (only the results returned are wrapped in an object with .value and .done)
 
how do you consume that?
 
So, now I can keep state inside iterables, I don't need to do the bookkeeping myself the coroutine maintains state for me.
You'd do:
 
for (var i = 0; i < 3; i++) {
    console.log(getFibo());
}
 
for(let item of getFibo()){
    //iterate all fibonacci numbers ever
}
 
7:26 PM
?
oh
 
There are for of loops for iterables in ES6, but you can use regular for loops, if you do it with a regular for loop append .value
Now, in ES6 generators are extra powerful, much more powerful than in Python or in C# since you can feed something to them.
 
Yield is an expression, and not just a statement that returns a value.
 
what will getFibo(x).next do ?
 
getFibo is a generator, you'd have to call .next on it to access the value:
 
7:28 PM
@BenjaminGruenbaum (side-note: Python's yield also lets you do that. foo = yield bar)
 
@BenjaminGruenbaum feed in which way? an argument?
(we're still only at generators :P)
 
// for of loops are better
for (var i = getFibo(); !val || val.done ; val = i.next()) {
    console.log(val.value);
}
@FlorianMargaine let's return the the older problem, concurrency
 
In JavaScript until ES6, because functions are subroutines, they have to manage state themselves, so in order to continue - you have to use a callback, or another mechanism that manages a callback for you (like a promise)
However, with coroutines, your functions can have state, and can yield control to the event loop themselves. Let's see an example and analyze what happened:
Are you familiar with Bluebird's promise API?
 
is javascript considered intepreted?
 
7:32 PM
@Crow that's never a property of the language, but a property of the compiler or runtime
 
@BenjaminGruenbaum yeah, except the Promise.coroutine part :)
 
cool, let's explore that
 
@BenjaminGruenbaum yes, but is it an interpreted program? I imagine so
 
var f = Promise.coroutine(function * foo(){
     yield Promise.delay(3000);
     var result = yield $.get("http://....");
     return result.people[0];
})
@Crow depends on the runtime, in Chrome for example - never.
 
(side note: I'm using Promise.using here)
 
7:33 PM
That code will wait for 3 seconds, then make an AJAX request, when it is done - it returns a value depending on it.
 
@BenjaminGruenbaum when called once?
 
I could do var g = yield f() in another functions for its return value.
Yeah
So how does .coroutine work? It's actually pretty simple, all it does is:
yieldedValue.then(function(val){
    returnedFromFCall.next(val);
},function(e){
    returnedFromFCall.throw(val);
});
Basically, every time we yield a value, we add a .then handler to the promise, if it fulfills - we call .next progressing the generator, if it rejects we call .throw on a generator which does what you'd expect it to do (throws inside the generator function).
 
it does that until done?
 
Every time you yield a promise, it will wait for its .then, when you return it returns the value and does .done, I wrote an implementation here iirc once
 
7:36 PM
jsfiddle.net/f2cF2 (requires chrome canary)
 
I don't see how that's related to the fact that you can run or end a function wherever you want
 
Good question, basically - like in the previous example: whenever we yield we give control over the function to someone else
In Bluebird's case - that's Bluebird, it is now in charge of running the function.
When it starts - the promise library runs it until the first yield, it only calls .next on it then in a .then handler of the promise yielded (like .delay(1000))
So the coroutine does not progress or keep running until the promise resolves
 
it seems more like bluebird considers the function as a simple generator there tbh
 
Yes, that's exactly what it is. A generator is a type of coroutine, and bluebird uses the fact it can yield control in order to wait for the yielded promise it gave control to to resolve.
 
let me reread that
oh, ok
 
7:40 PM
function async(gen){ "use strict"; // asynchronous generator
    gen = gen(); // invoke the generator to get the iterator
    // make the following code throw safe
    return Promise.resolve().then(function cont(a){
        var n = gen.next(a); // yield the next value
        if(n.done) return Promise.resolve(n.value); // a `return`
        if(!n.value.then) return cont(n.value); // yield plain value
        return n.value.catch(gen.throw.bind(gen)).then(cont); // yield the promise
    });
};
 
so that still doesn't show me an example of a coroutine
 
A generator is a coroutine.
 
or does it, kinda?
yeah, I got that
it's a type of coroutine
 
A generator can be used to represent a sequence, like in the fibonacci example, or to represent concurrency control - which is a sequence in itself like in the Promise.coroutine example.
 
what I originally asked was "what other kind can it be?" since Zirak already explained what a generator is (and I already knew that anyway)
 
7:41 PM
Using a coroutine for flow control is basically acknowledging that the sequence of numbers in the fibonacci sequence is just like the sequence of actions in program flow control. The two are the same.
Oh, it doesn't have to be a sequence, but then examples can't be in JS
 
I don't want to be dismissive of your explaination; it's great
I don't care about JS
 
There is Dijkstra's joke COMEFROM keyword :D
 
I want to use that anyway
although the library only shows generators ~~
 
That's because the other use case of coroutines which is fully fledged state machines isn't that popular - most people doing state machines either use languages better suited - or use gotos
 
damn
@BenjaminGruenbaum ok
 
7:44 PM
Jumping into an arbitrary position in a function isn't too expected or commonly used. It's an interesting idea that people built and dropped. Like lots of things - goto itself, self modifying code etc.
 
@BenjaminGruenbaum ok
yeah I got the idea of how it works
and I can see why it's confusing/not used
 
I did a few experiments with it at a point, I was not very pleased
 
in a sense, is HTML basically XML?
 
yes and no
it's inspired by
but HTML is way less strict than XML
 
XHTML is basically a specific schema for xml
 
7:49 PM
@BenjaminGruenbaum An angular structure question.
 
god why :D
 
@BenjaminGruenbaum cause i have thought on it for a few minutes
and am still confused :-(
 
@Zirak Screw your life, your bot, your sister, your brother, your mother, your father, and screw you.
 
woa
watch out
 
7:50 PM
More specifically your bot.
 
@TheWobbuffet Merry christmas to you, too.
 
I am making an app with camera filters & webrtc so far i have made GetUserMedia a service, so with the WebGL thingy that does so ? should i break down the logic further and rip off the defined filters as a seperate service ? Plus in directives i have a single directive that handles the whole viewing thing... should be broken down right ?
 
This is Zirak Hotline speaking, how may I be of assistance?
 
@Zirak I wouldn't be surprised if you were part of lulzsec or something
 
7:51 PM
tl;dr; how do you draw a line to stop modulerizing things ? /cc florian
 
Alright, time for another battle against promises!
 
@Zirak I'm having a strange sensation down my pants whenever I see a slide, am I pregnant?
3
 
@AbhishekHingnikar When you find out the answer to that, is the point where you go from a good programmer to a great programmer.
 
@TheWobbuffet i kinda feel that about him too :P
@SecondRikudo lol
 
@AbhishekHingnikar yes, you probably should
 
7:52 PM
@BenjaminGruenbaum That depends. Did you hold hands with a goat in the past 27 years?
 
@AbhishekHingnikar I feel that about anyone who dedicates their lives to trolling people.
 
@Zirak I AM the goat :O
 
@TheWobbuffet no his level of expertise is insane
 
@SecondRikudo I got like 10 minutes, did you manage promisifying downloading a file?
 
@BenjaminGruenbaum We should totally !!teach that to Caprica
 
7:52 PM
@Zirak What trolling program are you currently working on? What was the last black hat hacking you did about?
 
 
@BenjaminGruenbaum Yes, still not to associate it with the file's name/id/whatever
o/ @copy
 
@Zirak lol
 
@SecondRikudo oh hey, I know now
 
7:53 PM
!!libby
 
@SecondRikudo ok, so you have a downloadFile(url) function?
 
@Zirak I used to like your bot before I saw the hammertime thing.
 
@TheWobbuffet who are you again?
 
@SecondRikudo Hi
 
7:54 PM
@BenjaminGruenbaum Um... a wobbuffet?
 
@TheWobbuffet You want the hammertime thing to...stop?
7
 
HAMMERTIME!
 
@TheWobbuffet See, I want to take you seriously, but you make it difficult. So if you don't actually form a coherent sentence and/or complaint which I can address, I'll start replying to everything you post with goat pictures.
 
@SomeGuy maybe he just wants it to halt
 
7:54 PM
HAMMERZEIT!
 
My previous usernames were Man of Snow and Doorhandle
 
@SecondRikudo well, if you're stuck let me know I got a few minutes
 
Oh, Doorhandle sounds familiar
 
@SomeGuy nah that's @Doorknob
 
7:55 PM
srsly, guis, tis sparta needs to stahp
 
Ah, right
 
HAMMAHTIME!
 
@BenjaminGruenbaum I am, lemme get my code from the other machine
 
@Zirak It would be a paradox if Pinocchio said his nose was going to grow
 
Gotcha
 
7:56 PM
@TheWobbuffet no it wouldn't
 
@BenjaminGruenbaum Elaborate.
 
Promise.all(['stuff', 'thing'].map(function(name) {
    return Promise.coroutine(function*() {
        var result = yield http('your' + name + 'url');
        console.log('result is available: ' + result);
        console.log('name is also available: ' + name);
        return result;
    });
})).then(function(results) {
    // all results available, but you've done your work already
});
@SecondRikudo how about that?
@BenjaminGruenbaum check?
 
His nose grows if he lies and he wouldn't be lying :P
 
@TheWobbuffet that's not the liar's paradox at all. It is possible that he would say that just being aware of going to lie at some point in the future. That's not even the liar's paradox in temporal logic.
 
7:58 PM
@FlorianMargaine watwatwatwatwat :D There are at least 2 things I haven't even begun to learn yet
 
@BenjaminGruenbaum What if he said, "I am lying"?
 
"My noise will grow as a direct result of this sentence" might be better, but still not "this is a lie"
 
@TheWobbuffet that would be correct, and the liar's paradox, then again that wouldn't require Pinocchio
 
@BenjaminGruenbaum nose?
 
7:59 PM
@FlorianMargaine why the extra coroutine?
 
@BenjaminGruenbaum hm, you're right
no point there
I just like it now :(
 
@BenjaminGruenbaum But would his nose grow or not grow?
 
yield is so much better than .then()
 
In result of a lying paradox, I mean.
 

« first day (1359 days earlier)      last day (3584 days later) »