« first day (1529 days earlier)      last day (3419 days later) » 

3:07 PM
@Julo0sS You're going to need to be way more specific
 
@AwalGarg The tests help you realize what it is you expect from a method
Initially the test serves just for this, then later it serves to maintain it
 
@Neil umm, I am not sure I follow. Either I haven't yet had a chance to write very high level code, or I am just stupid, but won't I already know what I expect from a method?
 
@AwalGarg Yes, let me put it this way
 
ok
 
Rather than formalize what a method does while you're writing it, you determine what the method should do while you're writing the test itself, which in theory should make the method consequently easier to write
Test-driven development isn't supposed to be faster, it is simply supposed to make you less prone to make bugs and make maintenance easier in the long haul
Surely it has happened to you to be half-way in the construction of a method and then realize that you could write it better another way
 
3:20 PM
true, it happens quite a lot
 
That happens while you write the tests as well, except you've lost less time writing a test
 
what do you mean? i have a collection, i have to fetch through it, with this : $myCollection.each(function(){})
in my function, i have to do a ajax query. The problem is that the .each goes on, even when the .ajax are not finished... result : i get out of my loop and i have some ajax that are not executed yet...
 
@Julo0sS Your point?
 
They'll be executed eventually
 
That's the basis of async code, they'll eventually be done
 
3:21 PM
@Neil hmm makes sense.
 
@SecondRikudo yeh they may be done, but i need them to be done before i can execute next code...
 
@Julo0sS promises
 
I'm not familiar with Q (which jQuery uses)
 
What? Jquery uses Q?
Since when?
 
@FlorianMargaine Last I checked
I may be wrong though
 
3:23 PM
QU!
 
If it's not a recent addition, yeah, you're wrong
Jquery promises don't respect A+, q does
 
Right, my bad
I'm not familiar with whatever crap jQuery uses
So I don't know if it can convert an array of promises to a single promise (that resolves when they all resolve)
 
Typically, Promise.resolve(1).then(console.log.bind(console)); console.log(2); won't have the same behavior
On jquery or on q
On jquery, it will print 1 2, on q it will print 2 1
 
So sync vs async execution of promises
 
On an already resolved promise, yeah
 
3:28 PM
A promise wouldn't be of much use if you necessarily needed it to be synchronous I suppose
 
Yeah, but it's useful when you don't know, for example when you cache
 
The point is that you don't care, that it can handle synchronous or asynchronous events
 
And the behavior becomes inconsistent in this case
 
If order becomes important, then maybe something isn't being done properly from a conceptual pov (imho)
 
@Neil not necessarily.
 
3:31 PM
@SecondRikudo Trying to think of a counterexample in fact
 
I want to find items from one API, search them on the web (with Bing API for the lack of a Google search API), then add the results to the database. All when a user makes a web request to my service
I don't want to block, because that would mean not only this user would have to wait, but many users requesting from the same endpoint would have to wait until all those before them finished.
So I use Promise.then(one).then(two).then(three) where the order of execution matters
I don't see a problem with that.
 
In fact I don't see anything wrong with that either
But when would you do Promise.then(one); two(); and need to have them performed synchronously?
You shouldn't care or else you would have done Promise.then(one).then(two), right?
 
Once you have an async element in your procedure, all of the elements that must execute after it have to be async as well.
You can never trust a sync operation to execute after an async one
 
@SecondRikudo Synchronously wasn't the right word.. performed in the proper order
 
@Neil You can't guarantee that two() would be executed after promise.then(one).
If you want that, you must use promise.then(one).then(two)
 
3:36 PM
@SecondRikudo That's my point.. if you depend on that, then you shouldn't be hoping the implementation gets it right, you shouldn't be doing it that way in the first place
 
Correct
 
It's like using a pointer like a integer.. you could, but it's wrong conceptually
 
Yes and also no.
Yes, it's wrong conceptually
But no, you don't even get a guarantee that it would work the way you want it to.
 
ok, think it's solved with my problem, now facing another one... again... and again... :'(
 
Pointer as an integer, you can prove that your solution is correct
 
3:38 PM
Unless you're adding an amount to a pointer to find an address further down the array.. though dividing pointer values is not a good idea :)
 
@Julo0sS Okay, let's take a step back.
 
i receive a collection item in a variable
 
What are you trying to do?
 
which is a jquery collection $(".items")
i get the item this way : collection.splice(0,1)
how can i get the selected option from this item?^^
can't use "options :selected"
since it's a "var"
 
1 min ago, by Second Rikudo
What are you trying to do?
I'm trying to make a program/application/component that _________
 
3:40 PM
@SecondRikudo kinda hard to explain but, main lines are : have to get dynamic data on a webpage as arrays, and send them to a php script to generate a pdf file
@SecondRikudo good?
or, wrong answer?^^ :P
 
Good enough, for now. Where does input come from?
 
@FlorianMargaine oh my god ._. 'lluminati
 
@SecondRikudo user actions + js
 
Okay, you may benefit from a binding framework like Knockout or Angular
 
no
 
3:42 PM
That seamlessly binds UI components (like form controls) to variables in JavaScript
But let's not do that for the moment
 
@SecondRikudo too late
 
What's the specific problem?
 
specific problem now
 
I want that ____________ would happen when the user does _________________
 
My god, my banker is a moron
The one thing I told him that was a must, he couldn't do, despite saying I was good to go.
 
3:44 PM
how can i get selected item text from a select box (jquery) received as a variable?
 
@Julo0sS $selectElement.val()
Next
 
function(collection) // collection is : $(".items")
var item = collection.splice(0,1);
// now, need to get the selected item from the "item" collectino, and its "text()"
not value
 
terrible way
 
Why in the world would you need the text and not the value?!
 
3:47 PM
Good morning everybody
 
text is human readable, value is machine readable.
 
@SecondRikudo i need both ^^
 
You use the value when you want to pass the information to another machine (i.e. the server), and text when you want to display information nicely to the user, because a bunch of numbers wouldn't make sense for him.
@Julo0sS Include both in the value.
 
@SecondRikudo that's a "trick"...
 
That's not a trick.
Trying to submit the text is the trick.
@Julo0sS think about it this way. Your form needs to be submittable without JavaScript, take it as a challenge.
 
3:49 PM
i have no form! no need for a form
 
Do you want to display the pdf to user?
 
@Julo0sS If you have a selection box and you submit things to the server you have a form.
 
I only need to generate pdf
@SecondRikudo ok then, I have a form, which will never be submitted...
 
@Julo0sS You're submitting things to the server, therefore it will be submitted...
 
xD
 
3:50 PM
I don't understand what's the problem.
You need information from the user to reach the server
And the server is to parse that information and produce something
Am I correct?
 
Just generate a pdf client side
 
use css print
 
That is precisely the usecase for a form.
@Shmiddty Depends for what purpose.
I wouldn't want to generate a PDF invoice client-side.
(Because I want to keep a copy to myself for reference in most cases)
@AwalGarg Eh?
 
ok :
server "builds" generates the page for the user, with some fields the user can set values, some other not
when the user does things with these "inputs" (...) then, js generates some new things to show/hide... ok?
on "Submit" (if you want), then i have to check all things setted on the page, or not, and, considered them, i have to get the wanted page data, and send it to a php script
 
What if I want to save the PDF on my computer rather than printing it?
 
3:54 PM
@SecondRikudo Good point, but storing the data instead of the resulting PDF is probably wiser
 
you can
 
@Julo0sS That was aimed at @AwalGarg
 
ok x)
 
@Julo0sS Again, that is an enhanced form.
The fact that JS does some nice things like changing available options and the such doesn't change the basic functionality of a form, which is submitting data from the client to the server.
@Shmiddty Yes, but in some fields you are required to print a "compiled" (if you'd like) invoice and keep that.
Data on the server can be altered, a printed (or otherwise stored) PDF can't be, supposedly.
@Julo0sS so again, don't use visual things to process data. That's part of the separation of presentation and logic.
 
@SecondRikudo i'm ok with you, but here, in my example, if i use a form, as you mean, if i don't send the "option" text to the form, then i'll have to get it back from db in my php script... job done twice as my "option text" is available on the webpage where i submit...
 
4:03 PM
@SecondRikudo save as pdf
 
@AwalGarg Not all browsers support it (I think), and more importantly, not all users know how to do that.
@Julo0sS If you need just the text, use that as the value.
 
I don't understand why you want to generate a pdf and never display it to the user. You know about databases, right?
 
@AwalGarg Why never display to the user?
Let them download the PDF file afterwards, that's fine
 
@SecondRikudo I asked if he wants to display it to the user, he said he just wants to generate it. No display.
 
Ah, didn't see that
 
4:05 PM
@SecondRikudo i need both... i need value for some stuff, and text to send to the pdf generator
 
@Julo0sS why generate a PDF if you don't intend giving it to the user?
 
i give it to the user
 
@Julo0sS So while you're doing "some stuff", fetch the text from the database anyway.
It doesn't cost you anything more if you're already performing a database read.
 
once generated, it's path is written in db, pdf is downloadable from other places in website, and, directly on submit is downloadable
 
wtf, try catch not working :(
:20617148 not that :(
 
4:06 PM
@AwalGarg Code
 
@SecondRikudo well, guess that's what i'll have to do... since there seem to be no way to get that f**kin .text() the way i'd like to^^ x)
gtg guys
coming back later
thx for help
and if i'm not back.. merry christmas :P
 
@Julo0sS To you as well :)
 
cya
 
ahh shit. I forgot there is nothing like object equality in javascript :(
 
=)
Implement MyObject.prototype.equals(otherObj)
 
4:08 PM
@SecondRikudo Got any mail from CM?
 
Those hits are brutal
 
@AwalGarg I get mails from them all the time
 
@SecondRikudo the holidays one...
 
ok i'll have to redraw yesterdays prize
wonder why my fix didn't work :?
 
You have just started a new blog... so I was wondering if you are interested in their thing @SecondRikudo
 
4:10 PM
I see the mail, haven't read ityet
 
ok
 
@rlemon Sabotage, muahahaha!
Interestingly sabotage seems to derive from the word sabot meaning the brake on a horse wagon, which workers would slow in order to purposefully prevent from being overworked
 
@SterlingArcher Ouch
 
...removed because... reasons
 
4:26 PM
@AwalGarg Nothing. LGTM
 
\o/
no one should know I use the important flag xD
 
Sorry for that everyone. Script should be sorted now. My bad. Day 7 winner has been re-selected.
s/id/profileid/ when checking for myself. silly me.
 
@SterlingArcher I don't know why, but that just cracked me up
 
I was gonna just post the gif but I couldn't exclude that perfect link-noise lol
 
4:31 PM
That gif needed the sound effects. Thank you, @SterlingArcher
 
Someone went to considerable trouble to animate that
 
Don't thank me, thank imgur
 
god bless them
 
@SterlingArcher it's a repost of a repost of a repost of a.... :p That's what is good with imgur, always able to go to the FP with repost.
 
@SterlingArcher rocket science!
 
4:32 PM
There is no original content on the internet anymore D:
@KendallFrey LOL
 
@dievardump not sure how I feel about that second comment
 
"Internet is awesome." is how I feel
 
updated 12 days to list what everyone has won so far
 
Any way to give what I won to someone ? I do not have any Steam account.
 
4:39 PM
can someone help me identify why this keeps throwing undefined function error ?
postwrapper.on("propertychange input text", ".leave_comment input:text", function() {
var charLimit = 149;
var remaining = charLimit - $(this).val().length;

if (remaining === charLimit) {
// No characters entered so disable the button
$(this).parent().find("input[type='submit']").prop('disabled', true).css("opacity", "0.7");

} else if (remaining < 0) {
// remaining = 0; // Prevents the counter going into negative numbers
$(this).parent().find("#counter2").text(remaining);
$(this).parent().find("input[type='submit']").prop('disabled', true).css("opacity", "0.7");
 
Yeah you can ask me why I participated. Because it's fun and it's made by Robert and so it makes my heartbeat go faster when I think of him.
 
imgur.com/gallery/1l7iYCK dammit they got me again xD
@rlemon I see you won one xD
 
roomWeirdness++;
 
@Neil your still here lol
 
@this.Tony What else would I be doing? Work? Pfff
 
4:41 PM
lmao so funny
 
It's the 23rd of december at 5:41 and they expect me to be a productive employee?
 
@SterlingArcher not anymore
 
@Neil fake your death for a week
 
It won't work. They will expect my wife to show up with a death certificate :(
 
lol hey can you help me?
 
4:44 PM
@this.Tony What a vague question. How else can I respond but with a resounding "Sure! What's the problem?"
 
he's got an 'undefined is not a function' somewhere in that code above
 
!!tell this.Tony format
 
@this.Tony Format your code - hit Ctrl+K before sending and see the faq
 
OK, Very loud LoL for this one: lol
 
however he doesn't specify line or give a demo
 
4:46 PM
@rlemon my favorite error line
 
> why do you hate progress
Love it
 
@SterlingArcher progess*
 
@this.Tony Ah I see what you mean now. What line is it complaining on?
 
he typoed D:
 
@SterlingArcher No, you did. He clearly meant progess.
 
4:48 PM
the first one @Neil postwrapper.on("propertychange input text", ".leave_comment input:text", function() {
 
WHY DO YOU HATE PROGESS
 
@SterlingArcher Everyone can still see it
Delete it.
 
Too late
I thought only ROs could see edit history?
 
Only on deleted messages. On edited messages everyone can.
 
Not that it's bad I just wanted to semi-hide my co-workers name
 
@this.Tony Without further context, I'm going to take a stab and say that postwrapper.on isn't defined
 
See? ^^^
 
move to trash
 
1 message moved to Trash can
 
Maybe it isn't a jQuery object like you expect?
 
4:49 PM
dammit
I thought I was owner there
one more test.
 
@Neil window.postWrapper = $("#postwrapper");
 
case sensitive.
@this.Tony postWrapper !== postwrapper
 
@SterlingArcher I wonder if moving the message out and then back in will allow you to delete it
1 message moved to Sandbox
 
@rlemon No
 
1 message moved from Sandbox
 
4:51 PM
Just ping @ThiefMaster ?
 
The message "object" remains the same, all that changes is the room
 
@SterlingArcher try to delete it
quick quick
 
If the message was posted more than 2 minutes ago, it doesn't matter how you move it.
 
Guys it's no big deal ._.
 
@this.Tony Maybe I know why
 
@SterlingArcher but i'm curious
3 mins ago, by Sterling Archer
Not that it's bad I just wanted to semi-hide my co-workers name
 
According to the docs for on, there are two ways to call it
 
I can't find it!
 
@dievardump huh?
 
4:52 PM
@SterlingArcher the one I just linked dork
 
The one taking a handler requires that there be a "data" parameter
 
postwrapper.on("propertychange input text", ".leave_comment input:text", function() {
 
1 message moved from Sandbox
@rlemon now try to delete it
 
@this.Tony according to chat.stackoverflow.com/transcript/message/20618069#20618069 it's postWrapper not postwrapper
 
4:52 PM
7 mins ago, by rlemon
however he doesn't specify line or give a demo
 
@dievardump you're right
stupid w
@Neil he found it out lmao i havent slept
lol
 
Happens to the best of us
 
thanks for the help tho
 
Heh I was right though, posthumously
 
4:56 PM
lol
 
@SterlingArcher Wasted
 
omg the furball
too cute
 
@SterlingArcher wassted
 
booty had me like ^
 
bahaha wasted lmao
 

« first day (1529 days earlier)      last day (3419 days later) »