« first day (1648 days earlier)      last day (3286 days later) » 

2:10 PM
Hi Guyz, Any one aware of this jsbin.com/zipuzu/1 . How it will works. I am very new to this one.Could any one tell how it will works or give any reference links please
 
@user3454479 You probably should read the script file it references: vkbansal.github.io/react-finder/bundle.js
it looks like that's the meat of the application code
but if that's the case, then you probably can't reuse that code unless you implement your own
 
@ShotgunNinja Yes i check that. But in that also some js files included "E:\\projects\\react-column-view\\src\\index.js if you see that. I am little confusing how to start and where to start
How can we know which type of JS we need to use...@ShotgunNinja
 
I think your goal shouldn't be trying to replicate all that code; you should try to replicate the behavior from scratch first.
It's fairly simple. There is what looks to be a table structure or a div structure. When an element is clicked, if it's a folder, it pulls out another table or div structure.
Don't try to reinvent the mechanical loom if you know how to use a sewing machine.
 
Without using that JS we can create like that using pure Javascript or Jquery?
 
Look at the markup using your favorite element inspector, and see what changes when you click on stuff. Then try to replicate it using onclick bindings.
 
2:18 PM
Ok. Do you have any reference links to create like that
 
Remember the election ends in 5 hours :) so if you want to vote: stackoverflow.com/election?cb=1
 
bonjour
Anyone have any experience collecting JS events and throwing them away, so to speak, if you have too many?
 
@SimonSarris You mean "debouncing"?
 
like a pipeline optimizing driver?
 
@ShotgunNinja more or less
 
2:23 PM
simply throwing away events after a threshold or collapsing redundant state changes?
 
I have experience with that
 
How do I link to a different page within my web application that uses html/css/javascript? I have a page called learnmore.html that I'm trying to link to from index.html.
 
I only have experience with bouncing, not debouncing. I tried to stop bouncing once and almost died.
 
a simple <a href> says error loading page, so do I have to do javascript?
 
then you probably are doing something wrong if <a> isn't working
 
2:24 PM
I don't want to limit the rate that events can fire, I just want to start not-handling events that are queued up if the frame rate is too slow
 
@chronotrigga you sure you used the right syntax? <a href="link here">Link text</a>
 
@SimonSarris Yeah, start with a simple debounce on the event handler, and see if that strikes a nice balance between handling and speedup
 
in your event handler, add each event (the parts you care about) to a queue
in your requestanimationframe handler, process the first few events and discard the queue
 
@BramDriesen yeah I put learnmore.html as the link
 
you don't actually want to debounce them
 
2:25 PM
does the file exist at the given location?, what is the error? @chronotrigga
 
For instance in Firefox mobile, I might be issuing touchMoves that cause it to draw at 5 frames per second. I touch-drag the screen everywhere and the scene redraws and redraws, then I let go. And it plays my touches back to me, slowly, like a recorded, which can take quite some time even after I let go with my finger
 
dont know if it has to be like local/learnmore.html? i thought it would already know
 
I do not want that
 
just buffer and handle on the render loop
 
the file already exists. it just says error loading page
 
2:26 PM
oh yeah @ssube that makes sense too
 
@chronotrigga and if you manually go to the url of that page?
 
it's not a webpage though i'm using xcode at the moment
so it's a .html within the folder but technically i thought it would already know the files are local
 
let events = [];
$(document).on('click', it => events.push(it) /* don't actually do this literally, it will hold way too many refs to the DOM */);
window.requestAnimationFrame = f => {
    for (let i = 0; i < 5; ++i) {
        process(events[i]);
    }
    events = [];
}
 
It really depends on what sort of system you're running; if you're coordinating events to work with a regularly-reoccurring process, then queuing and discarding excess events is acceptable.
You could then extend that to save those events for the next round, if you wanted.
But if you're trying to map up randomly-occurring events with something that's supposed to not happen too frequently in a certain timeframe, then you should debounce.
 
@ssube Why not events.push.bind(events)?
(Maybe even events.push not sure though)
Ah, it's example code. Carry on.
 
2:41 PM
@SecondRikudo because you probably don't want to hang onto the whole event object. More likely just a few fields.
 
:(
all of the eeproms I had written for me are bad
 
@SecondRikudo nope
 
it would really be more like:
 $('#game-canvas').on('click', it => { let {target} = it; return {target, now: new Date()}; });
 
How can I push an item off the front of an array onto the end? I have tried array.push(array.shift()) but it didn't work?
 
@rlemon oh shit dude
that sucks
 
2:46 PM
yup
 
user1596138
@rlemon dude
 
@ssube That's not what you do there though :P
 
ugh... waiting for my sites to bounce
 
@JustSteveKing That should work afaik
 
stupid fucking deployment process
 
2:46 PM
@ssube How does returning from a click handler help you?
 
user1596138
I spent an hour and a half today trying to send money with moneygram because the CVS lady is fucking incompetent. So. Mine sucks less but I'm mad too :P
 
@RoelvanUden I did this : var productArray = $('.slider').children('article.product'); $(productArray).push($(productArray).shift()); (Don't hate me for jQuery)
 
@SecondRikudo it does not, I still did it wrong.
 
@Jhawins CVS the pharmacy? or CVS the version control system?
 
user1596138
@ShotgunNinja pharmacy
 
2:48 PM
@JustSteveKing Yeah well I have no idea about jQ
 
@Jhawins I know
 
@RoelvanUden How about pure JS?
 
now I'm manually re-writing and testing them
again..
 
@JustSteveKing Then your snippet will work.
 
Hey guys how to pass input element data on ajax request to php file
when I try the below step I get invalid invocation error
    var formData = new FormData();
        formData.append("files", $('#choose_image')[0].files);
        formData.append('name' , filename);
        formData.append('sa' , 'Repository.upload');
        formData.append('securityToken' , ip.securityToken);

        console.log($('#choose_image')[0].files);
        $.ajax({
            url : 'localhost/ImpressPages/?Repository.upload',
 
2:50 PM
@StraightForward 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.
 
!!> var a = [1, 2, 3]; a.push(a.shift()); console.log(a);
 
@RoelvanUden "undefined" Logged: [2,3,1]
 
@JustSteveKing ^
 
@CapricaSix :)
 
@rlemon :(
 
2:51 PM
the worst is it is a single character typo
00A0 -> 00A1
 
user1596138
@StraightForward Have you googled it?
 
user1596138
!!google formdata Invalid invocation
 
user1596138
Oh look at that!
 
@RoelvanUden so : var productArray = document.querySelector('article.product'); productArray.push(productArray.shift());
 
2:52 PM
@Jhawins I am googling for 6 hours and more but didn't find the exact solution yet...
 
user1596138
@StraightForward DUDE. It's in the first 2 links right there
 
@RoelvanUden I keep getting the error that shift() is not a function .....
 
user1596138
processData
 
I do not want to false the processdata cz I need the data while requesting the page
I'm passing security Token which is required..
 
user1596138
> data
Type: PlainObject or String or Array
Data to be sent to the server. It is converted to a query string, if not already a string. It's appended to the url for GET-requests. See processData option to prevent this automatic processing. Object must be Key/Value pairs. If value is an Array, jQuery serializes multiple values with same key based on the value of the traditional setting
 
2:55 PM
posted on April 21, 2015 by admin

Hovertext: Tell me I'm not a remarkably predictable unit in an economic system beyond my control! New comic! Today's News: I'm tumblring 

 
@JustSteveKing the query selector result is not an array, is it?
 
user1596138
@StraightForward Google -> open link -> READ LINK // step 3 is the part you forgot
 
@RoelvanUden No I guess I am just grabbing the first one ...
 
@JustSteveKing yep, use the all version and convert to array then
because mdn says it returns a NodeList, not an array
 
@RoelvanUden Like this: var productArray = [].slice.call(document.querySelectorAll('article.product'));
 
user1596138
3:00 PM
@JustSteveKing You want [].slice.call(document.querySelectorAll('article.product'))
 
@Jhawins snap ;)
 
user1596138
You beat me ;P
 
@JustSteveKing Juap.
 
So this turns it into an array, but the productArray.push(productArray.shift()); does not seem to do what I expected
 
user1596138
The news is competent today: "An Uber driver put his concealed carry permit to use Friday night when he pulled a shotgun . . ."
 
3:01 PM
I wanted to move an article element from first child to last child. Then work on the opposite lol
 
@Jhawins trench coat
 
I'm half-tempted to replace the global scoped Promise with bluebird. someone talk me out of it.
 
user1596138
@Loktar lol I just meant that concealed carry permits have nothing to do with shotguns/rifles ;P
 
@Luggage I don't know what it is - do it!
 
oops, gotta go. i'll be back later.
 
user1596138
3:03 PM
Unless it was like the Taurus Judge or something, .410 pistol, but it's technically not a shotgun either.
 
@Jhawins CC isn't limited to handguns
iirc
 
@Jhawins iirc conceal carry counts for anything
if it would be comfortable is another question though haha
 
@JustSteveKing Hah, well, you should edit the DOM then. Assume el is the element you wish to move, and it has .parentNode so you can do something like var parentNode = el.parentNode; parentNode.removeChild(el); parentNode.appendChild(el). Operate on the DOM if that's your intention ;-)
 
@RoelvanUden in recent browsers, there's el.remove();
 
@RoelvanUden I will see what I can do!
 
3:04 PM
Concealed carried rocket launcher
 
user1596138
@Loktar I'm pretty sure in Indiana it's a handgun license
 
@FlorianMargaine Work has scrambled my mind in such a way that I write code as if it was 2010 :-(
(Good tip tho :D)
 
It has to do with him having it in the car it sounds like
which is also considered concealed
unless properly transported in your trunk
 
user1596138
Yup it says "State of Indiana License to Carry Handgun"
 
user1596138
Cause we don't differentiate between concealed and non-concealed, it's just a broad license to carry handguns.
 
3:06 PM
It should just be a "if you can conceal it, you can carry it" rule.
If you can hide a tank, you deserve to bring your tank.
 
user1596138
@ssube I think it actually is in most places. But in Indiana it's not a concealed carry permit, you can open carry with the same permit. So it's just a handgun license
 
:22827119 Could you please suggest what's wrong in this code?

 var formData = new FormData();
        formData.append("files", $('#choose_image')[0].files);
        formData.append('name' , filename);
        formData.append('sa' , 'Repository.upload');
        formData.append('securityToken' , ip.securityToken);

        console.log($('#choose_image')[0].files);
        $.ajax({
            url : 'localhost/ImpressPages/?Repository.upload',
            type: 'POST',
            data: formData,
while choose_image is input file
 
@StraightForward you can't really send files through AJAX
 
@StraightForward We don't know what it is you want or intend, what is wrong, what it is doing, and what related materials you have (e.g. your HTML). Please stop asking such ambiguous questions and check back with something a little more... refined, and concrete.
 
@Jhawins it looks like Indiana honors pretty much every states conceal carry law
 
user1596138
3:09 PM
@Loktar Yeah we're really good about permits
 
user1596138
Well... They. I live in Nebraska... Soon. ;P
 
user1596138
I paid my deposit this morning
 
@JanDvorak Actually, you can nowadays. :-)
 
why are background images loaded last or not loaded until the element is not brought into view. I mean like I have a carousel , with 4 <div class="item slide-1"> <div class="item slide-2"> <div class="item slide-3"> and each has one background image, so until the slide-2 or slide-3 comes into view the background-image is not loaded. (but that's for the first time)
 
@Jhawins wait this didn't even happen in Indiana
 
3:10 PM
I want to get file input data in my php file..........
 
looks like it happened in Illinoise
the Uber driver shooting thing
 
user1596138
I thought IL was super strict and anti-guns
 
yea they are
one of the stricter areas of the US for sure... and yet Chicago...
 
Google maps has added "underwater street view" or "Apple maps emulation mode," since you end up seeing the same thing.
 
user1596138
Nobody would've been using Uber in my area lol
 
3:13 PM
I have my conceal carry
 
haha
 
user1596138
@JanDvorak XHR2 brah
 
@Jhawins does jQuery support that?
 
iirc yes
 
user1596138
@JanDvorak You can use FormData, you can use Blobs, why would it matter that you're using jQuery
 
3:15 PM
or did I just say something unmeaningfull
 
user1596138
0
A: Jquery,Ajax post file upload

ManwalUsing XHR2, File upload through AJAX is supported. E.g. through FormData object, but unfortunately it is not supported by all/old browsers. FormData support: IE 10+ Firefox 4.0+ Chrome 7+ Safari 5+ Opera 12+ FormData Example: Markup: <form class="form-inline" role="form" id="form" enctype=...

 
user1596138
@StraightForward seriously bro, google.
 
user1596138
You'd be amazed how much you could learn
 
off topic or not ?
0
Q: I need to translate the text inside the code

Raymondinitial <!DOCTYPE html> <html> <body> <h1>My First Heading</h1> <p>My first paragraph.</p> </body> </html> result <!DOCTYPE html> <html> <body> <h1>translated text</h1> <p>translated text.</p> </body> </html> please help to find translator, i have so much text. and w...

 
rec-tool? Given the excerpt.
 
user1596138
3:18 PM
You want formData.append("files", $('#choose_image')[0].files[0], fileName); // you forgot that input.files is an array.... Or however you're actually doing this. Just google that shit it's incredible easy to find
 
rec-tool
(cv-pls)
 
user1596138
@StraightForward You're using a form anyway aren't you? Why don't you just do new FormData(referenceToForm) and call it good instead of initializing an empty FormData object
 
@Jhawins e.x new FormData($("myformid"));
 
user1596138
Stop using jQuery when you don't need it (that won't work because of it, and I wonder if you'll understand why)
 
user1596138
@StraightForward Do you know how to get a reference to your form without jQuery?
 
user1596138
^ I told him to Google I assumed he would've found that by now... Anyway I'm officially calling vamp status on your ass. Go learn to use google, then learn to use JavaScript, then come back.
 
but pls
 
urgent!
 
!important
 
3:33 PM
Super useful...
 
Do you guys put descriptions on your commits?
(More than the summary line, I mean. I sure hope you guys don't just use completely blank commit messages)
 
eww you cant scroll while its going up
don't break my scroll.
 
@Loktar functions just like a real elevator :P
 
You wouldn't just jump out of an elevator, would you?
 
no, but I'd download a car
 
3:39 PM
@Retsam id hit the stop button though
 
Hi @Thargor
 
Hi
 
@Thargor 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.
 
your answer was fine
but had some doubts
 
ok just ask
 
3:46 PM
can we make that think as generic
particularly for wrapper
class
so that it will be applied for the child components
 
@Thargor don't use a boolean like that
just remove the event listener
.on has .off counterpart
 
ah cool thx :)
then add it back again on mouseleave?
 
elm.on('click', foo);
function foo() {
  elm.off('click', foo);
}
 
@rlemon why?
oh.
 
@rlemon but say if we have n no of components then we need to off all those components clicks right
 
3:48 PM
there's also $#one
 
yea but it looks like it might wanna be attached again later.
dunno if one will be 'concise'
@AlexMan or delegate
 
I would expect one to be reattachable
 
container.on('click', '.foo', foo);
container.off('click', '.foo', foo);
 
@rlemon so whether it will be applied to all the child components
 
if they match the .foo selector, yes
!!jQuery delegate
 
except, don't use delegate. use on and off
or one as Jan mentions (if that is what you need)
 
can you share me a jsfiddle @rlemon
 
user1596138
@Loktar watchu working on these days
 
Hey, is is possible to add something after two elements? I need to use div because the message should only appear on the actual element.
 
IE9 bugs
 
3:52 PM
$this.after("<p class='success;'>The comment has been added ..</p>");
 
user1596138
lol could be IE8
 
haha nah, I fought hard enough to not have to support it :p
 
What would be cohesive functions that go well together in a module?
 
user1596138
We should do dinner when I get out there
 
Treat him to a romantic dinner. He's earned it. :)
 
3:56 PM
@AlexMan I suppose
 
How does NodeJS resolve the circular dependency problems?
 
It returns some dependencies before they're fully initialised
 
@rlemon so that I will get a idea on that
 
bullshit
 
@StevensHaen it doesn't, you can't, unless you break the circle (or defer part of it)
 
4:03 PM
delegation adds the listener multiple times
do what @Thargor suggested
stupid jQuery
 
@ssube I'm reading about overwriting the exports object but can't reallypicture how it works in the real world
 
<div class="foo"></div>
<div class="foo"></div>
<div class="foo"></div>
$(document.body).one('click, '.foo', fn); // I can click EACH of the foo's once.
bs
 
I think that's a desired behavior
 
@ssube "This is a bit of a hack, but seems to be one common way of resolving circular dependencies by moving the module.exports before the require for the dependency B"
 
𝖄𝖔𝖚 𝖏𝖚𝖘𝖙 𝖑𝖔𝖘𝖙 𝖙𝖍𝖊 𝕲𝖆𝖒𝖊.
 
user1596138
4:06 PM
@phenomnomnominal I like your github.io
 
@rlemon what I have to give for fn
 
user1596138
gh-pages... Whatever you wanna call it
 
how do I find the average of 2 radiants again?
Completely forgot
 
average of what?
 
let's say rad1 = 2*PI - 1 and rad2 = 1
their average rad should be 0
but I always forget how to achieve it
 
4:12 PM
Why should it be?
 
isn't that a sum, not an average?
oh
 
sorry, messed up the formula
 
sum and divide by two?
 
there are two averages for two modular values
so you need to decide which one you want
 
?
 
4:14 PM
don't you just add then mod by the max?
 
unless you're in a finite cyclic field of odd order
 
every two values you average, you'll get two results, each on opposite sides of the circle
 
i.e., 2*PI - 1 + 1 = 2*PI and (2*PI) % (2*PI) = 0 and 0 / 2 = 0
 
so pick one
the one in the right half, perhaps
 
@StevensHaen generally avoid circular dependencies, but 2 modules can reference each other if they don't actually use those reference until later. If youhave one you can't avoid, I might be able to give some advice, but no gaurantees
 
4:15 PM
which is the one with the lowest absolute numerical value
or the one in the top half, which is the one with the lowest numerical value
 
So.. back to polluting the global scope with bluebird.. bad idea?
 
Just don't zone residential too close to the industry
 
@Luggage This is the exercise I'm working on. Doesn't even have an example eloquentjavascript.net/10_modules.html#h_E/zWqBFdy8
 
ohh. i'm not interested in these book exercises if that previous 'make-your-own-require' is anythingto judge by.
 
I know, it's a pain
 
4:18 PM
if you have a REAL problem, then i might be able to offer advice
but I'm not going to help with fictional situtations. sorry.
 
Ok, here's one - what would be the best way to start making apps with Node. Obviously a real-life project. Where do I get the assignment from?
 
since in real life you should just avoid the circular dependency when you can..
yea. make something.
 
Actually, I have made primitive apps related to MongoDB in the past, nothing spectacular though.
 
make it start to finish even if you have to do parts of it in a shitty way. it's more important to try to get to the goal then for each step to be 'perfect' at first.
then you can learn from it
and revisit ares you don't like
 
It'd be a great drill for skilling up in REST as well.
 
4:28 PM
can I use a PowerBook G4 for web dev today?
 
if it can runa text editor and node.js and a modern browser, then yes
(replace node with your platform of choice)
 
@BenjaminGruenbaum since when did babel have TCO?
 
uuuuuh: in the new chrome console code is finally not boring blue!
try inserting a function with some ifs in it and press return
 
it cant run chome
 
I wonder how hard it'd be to generate other kinds of jokes
 
4:43 PM
which IE has the rules / css file limit?
does 9?
 
yes
limit on style tags on a page, and rule limit per sheet
 
ok.. i need to deal with that, then. hopefully it's only the limit / sheet that is my issue
 
yeah thats why I extract the css to a seperate file in webpack
then I use bless css which will actually split up the file into mult sheets based on the rule limit
 
it's a separate file but it's a heavy pre-made theme. I'm goign to jsut split it into 2 ro 3 files for now
i've trimmed some unneeded styles already but need to trim more
 
@Luggage eh why do it manually, run it through a minifier and use something like bless css on it
 
4:45 PM
ohh, bless.. i'll look at that
 
it will auto split the files and add the imports it needs
so like stylesheet 1 will have @import stylesheet 2
 
I have the same problem as this person: stackoverflow.com/questions/15059616/…
Does that mean I should just update my lib?
 
thats the only reason I even use gulp now
is for our full release build, for the CSS
@KalaJ according to the accepted answer.
 
I'm running v2.2.0 for qtip2
 
is that the latest build or no?
2.2.1 looks like its the latest
 
4:48 PM
I can't find any bless webpack loaders and am not in the mood to make one..
 
id at least update it to that first and then try
@Luggage there isn't lol
its why I'm just using gulp
 
but my css is already in like 30 files, so splitting it myself isn't actually a big deal.
 
I was in the same boat, I was like hmm I could make a loader..
but then I didn't feel like it
 
I can just split my 'entry' .less file up
 
we have a tight timeline for this project so I dont have a lot of go off and play around time unfortunately
 
4:50 PM
it's just list of includes anyawy.
 
btw, this averaging formula works:
function averageRad(r1, r2){
   return r2 - r1 < Math.PI ?
       (r1 + r2)/2 :
       (r1 + r2 + Math.PI)/2;
}
 
Oh. You want the closer average
 
and this is what I made with it :D
 
@towc uh, no it doesn't
the false branch of the ternary is broken
 
oh. Right. Precedence
Lisp is unreadable but at least it doesn't have precedence issues :-D
 
4:57 PM
precedence?
 
whoa, that's the wrong bless.. don't need to make any disks bootable.
 
@KendallFrey operator precedence
 
what about it?
 
It can trip up antiparenthesists
 

« first day (1648 days earlier)      last day (3286 days later) »