« first day (2117 days earlier)      last day (2848 days later) » 

12:04 AM
hey guys, can I do: var array=[]; arraycopy=[0,1,2]; array[0]=arraycopy[0]; ? or better do array.push(arraycopy[0]) ?
 
wtf why does my object assign not work
  Object.assign(('div10').style, { width: 100, height: 50, backgroundColor: "blue" });
 
('div10').style
 
how do i fix?
 
you need to retrieve the 'div10' reference
 
how?
 
12:13 AM
document.getElementById() ?
 
oh
jesus
 
rekt
also, 50 and 100 are not valid values (for width and height)--you need to make them a string, and add a unit, like px
 
i ran the code before you replied, and the code worked
maybe ur used to old js :3
 
@AdanRamirez don't tell anyone I gave you this. We aren't allowed to feed strays: jsfiddle.net/z57Lnree
 
Maybe number value default to px in the style object... I generally don't style elements in this manner, so I could have been mistaken
 
12:20 AM
yea :3
 
anyone has a quick answer to my quest? so when I assign a new value to an empty array object, what is the underlying operation that v8 does? like var a=[]; a[0] = 1; is it a push? or what? sorry for my ignorance
 
@MarcoValente, probably similar to var a = {}; a[0] = 1;. You're directly accessing an index, so I doubt it would be doing a push.
 
   //hover function 2
        $('#h2ID').hover(function() {
            $('#div10').css('right', '300px');
        });
why does this not work? im just trying to move a div element 300 px to the right
 
12:35 AM
that's not what right means.
 
oh...
 
if anything it is the opposite
 
@AdanRamirez developer.mozilla.org/en-US/docs/Web/CSS/… Relative Positioning.
w/ examples
 
thanks
 
1:16 AM
hey yall
 
yey hall
 
lol
What's up?
 
the sky
 
nice lol
which company you would prefer to use for api authentication ?
 
disney
 
1:18 AM
this dude :(
lol
I found stormpath
 
I found waldo
 
⚡️
😔😞\
 
Question to the JavaScript wizards here. Are the new ES6 arrow functions faster?
 
I don't think there's a performance impact, but that's an interesting question--I honestly don't know
 
Any sites where you can test performances online?
 
1:25 AM
jsperf
 
@ndugger Thanks
 
They could well be slower, they're newer so the code to handle them is likely less tuned.
 
That's quite possible, and it will also be different in different JS engines
so it might be faster in FF while slower in chrome--you never know
 
2:00 AM
You know a youtube channel has issues when they use lowercase for emphasis
 
@RichardHamilton See es6 row at kpdecker.github.io/six-speed
 
has anyone here dealt with implementing oauth2 authentication with angularjs and nodejs?
 
2:45 AM
i tried reading the documentation for passport then gave up... does that count?
 
I'm so confused...:(
 
I'm confusing
 
hey @littlepootis
can I ask you a question?
WTH I HATE YOU SCHOOLWIRES
wtf
who the hell makes classes called 'hide745' and writes jquery to fucking HIDE THE ELEMENTS WHEN THE SCREEN IS LESS THAN 745px WTF??
 
@thepiercingarrow hey
 
honestly they dont deserve their money
I can't believe IM the one forced to write this stupid userstyle
and I think userstyle wont be enough - I might have to write a USERSCRIPT just to reSTYLE this fucking website
Im gonna write to their CEO with death threats... brb
@littlepootis does the !important thingy override jquery? (plz i want it to)
 
3:05 AM
You thought Pokèmon GO was the next big thing? Ionic GO tutorial coming out later today 😏 https://t.co/uIMQJodc74
 
@thepiercingarrow of course it does
 
Awesome thanks so much lil poot!!!
 
3:18 AM
@thepiercingarrow So I looked up what Schoolwires is
Found their website
and saw this
If you don't get it, look at the scrollbars.
 
lolol
@littlepootis What web browser is that?
 
Chromium
 
wow me too
Im sorta in between Palemoon/Chromium. I use chromium for normal stuff, but Palemoon for web-dev.
@littlepootis I read your gist. Are you parents unhappy with you?
 
They just.. don't give a damn.
 
 
3 hours later…
6:43 AM
Hello guys. I'm having a hard time making regexes that work for specific sites. The sites I'm trying to make regexes for include YouTube, Vimeo, Dailymotion, Metacafe, Imgur, Puush.me and SoundCloud. I've tried using txt2re.com and it worked somewhat although my problem is that the regex it gave me works for all the websites. I need to distinguish between the websites. This is the regex it gave me: '((?:http|https)(?::\\/{2}[\\w]+)(?:[\\/|\\.]?)(?:[^\\s"]*))'
The reason why I need different regexes is because I have a userscript that is supposed to search the content on a thread and change any links that it finds that don't have tags around them and include those tags.
If you guys know a better approach than using regexes to search for sites in HTML then tell me.
 
/YouTube|Vimeo|Dailymotion|Metacafe|Imgur|Puush.me|SoundCloud/
 
Doesn't that search for the exact word though i.e. youtube and not youtube.com/watch?numbers
 
I guess
try using a url parser
new URL(urlString) should give you all you need
 
I hope you don't mind me asking, but what exactly does new URL(urlstring) return? How does it help me search for links in a HTML page?
 
you can find all addresses on the page
parse them and do whatever you want
 
6:54 AM
I see.
 
7:12 AM
@FlorianMargaine Aaaaaaaaaand there's a lawsuit
There should be a database of all names that entities have gone to court over, so the rest of us can stop feeling like naming a product is like walking through a minefield
 
7:40 AM
@Neil congrats, you read the first comment
 
which service do you use for showing bootstrap dialog boxes using Angular ?
 
7:58 AM
Has anyone used the new RxJS 5beta with typescript with any success? particularly when trying to import the operators and observables selectively?
 
@Mathematics I use ngDialog
 
Why does this code not work?
var links_array = document.links;

for (var i = 0; i < links_array.length; i++){
console.log(links_array[i]);
}
the console doesn't print any links
 
@SstrykerR it will print all area and anchor elements
 
I thought document.links gave you all the links
 
@SstrykerR works for me
 
8:02 AM
@SstrykerR create a fiddle
 
@SstrykerR it returns a node list of all area and anchor elements (area and a)
 
One second
 
perhaps this is what you were looking for: console.log(links_array[i].href);
 
@GandalftheWhite thanks going to try it
 
I have had few issues along the way, ping me if something stupid happens.
 
8:05 AM
I tried that bitten, but it didn't work. Still doesn't output anything for some odd reason.
 
your code works for me and for Florian
where are you running the code?
 
I've tried running it in labs.codecademy.com in their online JS editor
and I have tried running this fiddle jsfiddle.net/phz3bn0s
Neither work
Running it in the developer console of Chrome works however
Weird
 
@SstrykerR there's a small typo in that fiddle
 
Oh
 
also you're running your script before your declaration of your elements
you should wrap this code in a document ready, or at least put it just before the closing body tag
 
8:10 AM
Okay it's working. Sorry for being so stupid haha.
 
@SstrykerR we have all been there once. Learn and go forth!
 
:D
 
@SstrykerR heh it's okay, the order of your javascript is something that can be confusing
js is executed as it's found, and as the browser reads your code from top to the bottom, it ran your code before the dom nodes had been parsed and those elements did not exist yet ^^
 
Ah I see
I have another issue
 
Is gitter down?
 
8:17 AM
I have tried running the following code in the developer console and it returns undefined:
var links_array = document.links;

for (var i = 0; i < links_array.lengths; i++) {
if (links_array[i].href == "https://vimeo.com") {
alert("test1234");
} else {
alert("this isn't working");
}
}
 
@SstrykerR Please don't post unformatted code
You need to press Ctrl+K
And you can edit previous messages, there's no need to post a new one
That's better
 
There are many things that I don't know about this chat, I apologize.
 
@SstrykerR It's fine, you'll know next time ;)
 
So anyway, why does that code return undefined? I don't get it.
 
:32063833 my guess is that the the url is actually something like "https://vimeo.com/28201216" instead of "https://vimeo.com"?
 
8:21 AM
Oh wait, it's a typo once again.. I wrote .lengths, it's supposed to be .length
 
or the typo on the 3rd line, "lengths"
 
@GandalftheWhite looks really good, thank you
 
Now the code is working, but it isn't working as intended though. I know for a fact that the document I'm pulling links from has "https://vimeo.com" in there, which means "test1234" should be alerted. However, it's "this isn't working" that's being shown.
I have to go. If any of you find a solution to my problem please write to me: wevlington@gmail.com
 
Hello everyone, I need to convert my "jQuery.each"s to "for" loops. Is there anyone can help me?
 
8:32 AM
I will post my code if anyone interested
 
hey guys
i have a simple question probably one of you already knows the answer
i have a jquery carousel that slides like 5 pictures
and i have a sidebar with 5 boxes
i'd like these 5 boxes to slide with these 5 pictures
how would you attach them to the carousel slider?
 
8:46 AM
How can i write this with each?
jQuery(this.selector).each(function(i,e){
var field = this_.get_field($(this));
if (field)
window.dynfields_orig_field_order[this_.name].push(field);
}
Sorry with "FOR"
 
@F.Bek why are you asking that?
 
because it takes much more time to do with each
 
is there a name for SO's upvote/downvote system?
 
and I am not quite capable to do this converting from each to fomr
to for
 
"voting system" seems like a candidate selection
 
8:59 AM
0
Q: jQuery needs Optimization - Each Loops vs For Loops

F.Bek TLDR: Rendering is too slow when having lots of custom fields and rules. So I need help to improve this javascript code. #9606: Trac ticket about issue I have a trac 1.0.8 installed on a ubuntu machine with DynamicFields 1.2.6 installed (compiled from latest revisions 0.11 folder). I have m...

0
Q: jQuery needs Optimization - Each Loops vs For Loops

F.Bek TLDR: Rendering is too slow when having lots of custom fields and rules. So I need help to improve this javascript code. Duplicate of CodeReview #9606: Trac ticket about issue I have a trac 1.0.8 installed on a ubuntu machine with DynamicFields 1.2.6 installed (compiled from latest revision...

these are my posts if anyone interested, thats all from me. Thank you anyway Keep good work =)
 
9:16 AM
@F.Bek you won't get faster by converting jQuery.each to for ()
 
 
9:34 AM
@F.Bek well ok technically yes, but it is micro optimization.
Most program speedup comes from writing the algorithms as best as possible
Minimizing big O
That said, if that is your only reason to include jquery, then by all means, make the change
 
When i have in my database more than 100 custom fields with 30 ticket types, it is something i guess
 
@Neil no
the problem here is that he's doing DOM manipulations in a loop
 
@F.Bek you can't say, subdivide into multiple pages?
 
whether he uses jQuery.each or for won't change anything.
 
@cswl bingo! :)
 
9:39 AM
If he has to perform those changes, what can he do otherwise?
 
So my if my DOM manipulations are untouchable, because they have to search the entire tickets and that is what it does (i know this is very very rich); there is not much space to do my optimization.
Where should i look at?
 
@F.Bek work on JS data structures and map to DOM at specified times, in batch (e.g. using fragments, or use virtual-dom)
 
If you need information, there is no reason why you wouldn't be able to retrieve it from an object in javascript instead of the DOM
 
Here is my inspectation
 
Use the DOM when you want to make a change or attach an event listener
 
9:45 AM
Parsing HTML is necessary, and all the other things that take time is jquery(yellow and dark purple).
 
@F.Bek Layout is your bottleneck here, atleast from the flame graph. although the scale looks a bit off (why did you zoom into that specific timeframe?). Does your CSS change a lot during runtime?
 
I really dont know where to look at then
No my css is constant, but it have to process all tickets when new page is loaded, because of my dynamic fields plugin on my trac.
I zoomed into that specific timeline because that interval is taking time more than anything else.
Should I narrow down my search to DOM operations? (If you say there is no gain from jQuery optimizations)
 
dom layout, I meant, lol. anyways, not enough information here. the "anonymous function" pointer just above the layout call will point you to what calls are causing layout changes. see if you can batch those to rAF. cutting down on jquery will help a bit too, but I think it will be easier to batch layout changes here.
 
You're not going to see more than a 10ms speedup using for instead of each unless you are nesting each
The problem is almost certainly in what you're doing repeatedly within the loop
 
This is Trac:trac.edgewall.org and its DynamicFieldsPlugin:trac-hacks.org/wiki/DynamicFieldsPlugin
Coders left support 10 months ago to this plugin
And I am currently using with my whole company's project
I am currently trying to narrow down target areas
 
9:55 AM
I would bet $20 that this loop is the problematic one:
        // determine which fields need to move and move 'em!
        jQuery(this.selector).each(function(i, e) {
            var old_field = this_.get_field($(this));
            var old_slot = -1;
            if (old_field.length)
                old_slot = jQuery.inArray(old_field, new_fields);
            var new_field = new_fields[i];

            // check to allow *this* field be in its own row
            if (i%2==1 && old_field.length && this_.needs_own_row(new_field))
                skip_slot += 1;
 
This is anonymous function
Ups
I will have to upload
Sorry wait
 
enable blockboxing for jquery and rerun the profiling. anyways I am out, cya!
 
@FlorianMargaine do you have ideas to improve?
Thanks for everything
C y
 
@F.Bek delete the code, see if you still have performance issues
if not, then you know that you can concentrate on this
do that before moving on, or you're just blindly doing stuff.
 
Ok i will try, would you comment on codereview.stackexchange.com/questions/136636/… so I don't lose your connection
Thank you
 
10:03 AM
@F.Bek one idea would be deleting the whole list of fields and re-add it at once, using DocumentFragments
I'm not sure that would be faster.
 
https://t.co/O8COQGR8bD
2
 
Now I am about to start my trying process.
Are you around? Should I be afraid of losing your connection?
If so, please add comment, I want to keep in touch if you have time too
But even now you helped me very much, thanks
@FlorianMargaine
 
10:21 AM
@FlorianMargaine @FlorianMargaine this is not a whole code block, you pasted the suspicious ones right?
 
10:41 AM
Hi Everyone Hello!
 
I am reading the blog of this organic chemist. I have since developed a huge appreciation for what they do. Sounds hella terrifying
It's a bit like discovering that the SCP foundation is real and there are occasional outbreaks
 
Can anyone help me?
 
I just finished reading latest news on project Ara. Looks good and on time to deliver next year. I was worried it might be dead...
@x'tian Welcome. You can ask your question here. If someone is free and capable they will help.
 
Thank you @Sheepy
Okay I will post my question now here
 
11:44 AM
@MadaraUchiha lol
 
Hey guys.
I am calling ajax, and passing a url from my controller in MVC
I have the url in ajax something like: localhost/controller/Action
The thing is i want this url to change if the action has received an id
So it would become localhost/controller/Action/Id.
Any tips?
 
what exactly do you mean?
you want to redirect ?
 
11:59 AM
the ajax call gets me data from a certain url. I have different data on different urls, and those just differ in the Id, like Action/1 is a certain dataset, and Action/2 is another
 
12:33 PM
Hey, I'm working on a bot for SO Documentation to autopilot the processes of finding and removing plagiarized content, which seems to be a hot issue. It autopilots the process of selecting text in a Documentation tag of your choice, copies code from each piece of each topic, opens Google, searches each chunk in 30 word segments there comes the tricky part:
I need to do some sort of fuzzy string search that works on paragraphs. If its a little computationally expensive that's fine, a web worker is already involved, but using a typical fuzzy string search seems to be extremely expensive for testing a 30 word segment against a Google search result summary.
 
@ElieSaad keep your logic of fetching different dataset according to the request received at the server end and not at the client end
 
Does anyone know of some technique or libraries to do this kind of similarity testing in JS? The goal is to test a 30 word string against the descriptions of the first 3 google search results to determine whether the documentation chunk is plagiarized from a 3rd party source then automatically edit it out, citing the plagiarized source, in a single click autopiloted process.
 
@OmkarBandkar the thing is that the url is changing, so i need to do something on client side, on ajax url specifically.
 
@ElieSaad then you can create an array with your parameter as key and the url as value, so according to the key you can fetch which url you need to hit
 
@OmkarBandkar I shall check it out, but i think this will work
 
12:52 PM
is anyone familiar with oauth2 authorization grant flow with nodejs?
 
@jory What is your question? I may be able to help
 
TIL v8 can delete object properties for optimization
it felt sooooo weird
 
@corvid So I'm using angularjs as well but i've sent the user to the authorization url for linkedin and defined a redirect_uri. The thing is, the redirect_uri is not the same for every client. Sometimes the client will want to login at '/user/inbox' and when the client logs in, I need to send the user back to '/user/inbox'. To do this, would I have to define the authorization to access token exchange for that url as well? or is there a way to define just a single route to do all that
 
I was giving some objects in an array a certain value to sort them by using .sort()
 

« first day (2117 days earlier)      last day (2848 days later) »