« first day (1050 days earlier)      last day (3896 days later) » 

12:39 AM
0
Q: Improvments of existing javascript code

Kenny FlashlightA while now I have tried to develop a BigPipe solution ala Facebook, and I use it daily. It is out on Github. The link to my GitHub repo is here: For me it's working allmost ok, but I hae a few questions for improvments. How can I fix this: Optimize the script and shrink the code size Add stat...

 
@Zirak I got green olives pepperoni and mushrooms
and a green pepper pepperoni and double cheese for the GF
 
@rlemon how's the world coming along?
 
didn't work on it tonight
played some bf3 then went to lay down
think i'm getting sick
 
m59
1:06 AM
@rlemon bf3 on pc or console?
 
pc
 
m59
dern
I like ps3 since I have a 40in LED-LCD and surround sound hooked to it
 
rlemon: what's your origin?
 
1:27 AM
@synth3tk someone dumped radioactive goo on a lemon
 
lol! not the answer i expected, but the answer i deserved.
 
@EvelynLoo 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.
 
What is the for loop equivalent of the following while loop: while (0 != array.length) {
 
for(; Math.pow(Math.PI, array.length) ^ 1;)
 
1:39 AM
True story
 
Cool, but I really need to understand what the equivalent is.
Or atleast what the meaning of that condition is.
 
for (var i = 0; i < array.length; i += 1) {}
now go away
 
@phenomnomnominal Doesn't work. I already tried it. :D
 
oh, that's because you're doing something retarded
you're looping over a array with a changing length?
 
1:41 AM
either the length is changing, the array is empty and the loop never happens, or that condition is always true.
 
I guess the length is changing then.
 
Wow you cannot be serious
 
which is a retarded thing to be doing
 
trying to make it a for loop or just the original code?
 
you want to start at lenght and go down
 
1:44 AM
Just figured it out, thanks :)
 
for (var i = array.length; i > 0 ; i -= 1) {}
 
I guess the lesson to learn is that even when someone tries to insult you here, they will still help you.
 
or they just want you to go away
 
you'll quickly learn that all of the helpful people here are just cranky old guys who tell you to get off their lawn.
 
1:52 AM
Except, even though the code logically makes sense, turns out it doesn't work...
 
You need to show what you are doing inside the actual loop.
 
@user1635256 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.
 
2:08 AM
going for pycon :D
am excited.... [joking[
 
@AbhishekHingnikar It depends. Do you have enough money to buy it?
 
I got my salary yesterday
it kinda looks col :D
I dunno how it will look on me though :$
 
Is there anyone holding a gun to your head telling you not to buy it?
Do you have the means to purchase it online using a bank/credit card, web browser, ISP, and website account at Amazon.com?
If so, then yes. You shall.
 
I am wondering if i will look like a fucktard init
if so there is NO Point in buying it
anyways going to pycon chya
 
you probably will, because it's not homemade.
you should consider quitting your job for a few months to create an authentic replica.
forward the bill collectors to your best friend's phone. after all, if a friend can't take a few hundred calls a week while you make a costume from a video game, what are they good for?
 
2:39 AM
hey guys
anyone good in css: jsfiddle.net/T7cVg look at this
trying to center the icons
who can help me?
 
center them horizontally?
 
and vertically
I mean to center whats inside circle
 
3:06 AM
Have you tried margin:0 auto;?
 
@vignesh 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.
 
@TuralAliyev center the icons!?!
chk dis I have done for facebook
looking to learn about OO Concepts (Object oriented) any best online resource suggestions?!
 
Google.
 
^--- what he said
..I've had my headphones in for 20 minutes and I forgot to play music..
 
Yeah, that happens to the bes-- no. No it doesn't. You've failed.
 
3:51 AM
I have just about heard it all.
 
0
Q: My first OSS software AngularJS drag/drop - please review code and documentation

JasonI just posted some AngularJS directives to my github account, I think they are both useful and easy. This is my first attempt at publishing OSS, I would love some feedback on the documentation, examples and code. Repo Demo: Drag/Drop directive var module = angular.module("lvl.directives.dragdr...

 
funny, i've been looking at options for angular drag/drop for the last hour
 
eh, still liking this one the most
http://codef0rmer.github.io/angular-dragdrop/#/
 
@synth3tk it's easier to make your own. I currently have 500 bounty on a drag and drop question that is nearly ended and i haven't got any good answers lol
 
4:03 AM
what were your requirements?
 
@synth3tk Droppable in all possible places. it's quite complicated.
7
Q: Drop-able in all possible places

PinocchioI am currently building a website designer, and one of the core features is to be able to drag & drop to rearrange elements. I have been working on this feature for a few days and have come unstuck a few times. The most important note about this drag and drop system is that the drag-able element ...

LOL WHAT A TWAT
 
what the hell?
why would anyone do that?
also, yeah, your requirement is a bit more stringent than mine
 
That was on my answer aswell lol
 
i'm helping to refactor a web app built when someone was learning JS/jQuery. we're now learning Angular to make the code a bit more modular.
so the normal drag/drop functionality provided by the one i linked to would work well
@Pinocchio i can completely understand not wanting to implement jquery for one simple piece of functionality.
 
@synth3tk I just can't understand why someone would recommend Twenty Five Thousand lines of code for a drag and drop feature. and plus. Adding jQuery & jQuery UI to angular.js is something i would never ever never ever never do
 
4:12 AM
well in our case, we don't have much of a choice. but again, we're using angular to replace a major part of a webapp. some elements still need jquery.
 
@synth3tk I would only ever include Zepto.js if i really needed it. nothing else
How to do strikethrough text?
 
on SO? ~test~
nope
 
<strike>
 
probably doesn't work on chat.
 
test
---test--- <= That's how you do it on chat! SEE => Strike Through
 
4:19 AM
that's so odd
 
LOL
 
first time i've seen an editor or chat interface that used dashes to signify strike-through
even though it should be intuitive
 
@synth3tk Have you tried out Angular Batarang?
 
@Pinocchio never even hoid of it.
ermagerd that looks like something i'd need
 
 
2 hours later…
6:50 AM
Hello
 
hello
 
hello
 
hello
 
wow i feel loved :D
 
You have broke the chain now :(
 
7:35 AM
-1
A: RequireJS - why should i shim libs like jquery, backbone etc

Yasser MoradiThere is no guarantee for downloading scripts one by one in [scrip src=""] method. So , when require js is loaded, maybe backbone is not loaded yet and ... You should create a bundle file that includes [Common] files such as jQuery and backbone To create that bundle you can use require js itself,...

Why do people like posting mistakes?
 
@BenjaminGruenbaum What do you mean ? It's downvoted, no ?
 
I downvoted it.. I don't understand people who post mistakes that are easy to verify..
"There is no guarantee for downloading scripts one by one in [scrip src=""] method. So , when require js is loaded, maybe backbone is not loaded yet " I mean... when you write something like that, the least you can do is check
Heh, his Linkedin:
> A senior JavaScript & C# developer who experienced in both back end and front end.
 
Well... I'm sure I'm full of misconceptions too, even if I hope few of them are so big
 
Yeah, but you would never write anything that wrong
Not to mention, it's an answer, it's not a personal belief..
 
7:54 AM
to be pedantic, the answer speaks about the order of download, not evaluation. In practice, they will load in parallel.
Scratch that, he's just changed the answer to be wrong
 
8:08 AM
@Pinocchio No, I just ask for olives so I won't be able to eat it.
 
@Zirak Oh, that's strange!
 
People don't get my groove.
 
Yeah, they do!
People don't get my groove.
 
8:44 AM
done. Now i'm at a nice number of 12100 rep.
 
@MarcosEusebi 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.
 
9:06 AM
TOTALLY LOVING console.group();
@JanDvorak not anymore, haha
 
12110, waiting for 12111 :-)
 
@JanDvorak and how would you get that?
 
downvote removed. Happens regurarly
 
ok
 
Wow. I was upvoted out of spite :-O
 
9:11 AM
Easy opportunity to get some helpful flag count: here is a spam post to flag: stackoverflow.com/a/18546426
 
@MartijnPieters done. Do you have anything outside SO?
I feel the need to update my spam helper to include answers.
 
Is it me or is there more and more spam on SO ?
 
I keep the realtime tab open and there's stuff to delete daily
network-wide
 
@dystroy I must admit, it's the first one i have ever seen.
But what a twat. lol
Gone now anyways.
 
@MartijnPieters That's the first time I see you on this room. Are you interested in JavaScript ?
 
9:14 AM
does anyone use console.group(); I'm loving it right now?
 
@Pinocchio I intend to but I never have
most of my logs are $(...).on(..., console.log.bind(console, ...))
 
@dystroy: I tend to avoid it; just was looking for some active members to flag some spam.
 
@JanDvorak It basically gives you a scope of console.logs its pretty cool
 
@MartijnPieters Cool. I was afraid you would answer all our questions too :)
 
@JanDvorak I have a group set up for every function, so whenever i log something, i know immediately what function it came from.
 
9:16 AM
@dystroy: :-P Maybe I should!
 
@Pinocchio I use the stack trace for that
 
@JanDvorak OMG, i have to go and look that up now!
 
@dystroy: btw, don't remove spam links from spam posts; just flag. Future automated tools may need that info there.
 
@Pinocchio LOL...
@MartijnPieters OK, good to know. But I hope the future automated tools will read the initial post, not the modified ones...
 
should I pin that?
 
9:17 AM
;)
 
53
Q: Should Spam posts be edited?

Mad ScientistI noticed that the posts of the recent spam surge on AskUbuntu were all edited by community members into something like EDITED - REMOVED SPAM ANSWER or similar. While I understand why the users have done this and I too don't want to leave the spam content visible for longer than absolutely...

 
@dystroy I've noticed some posts that start as a semi-sensible question but get replaced by a spam post afterwards
 
@JanDvorak: you mean the Python troll?
Those are not spam, don't flag them as spam.
 
aye
what as, then?
 
Flag them as 'other' for mod attention, just state it is the troll again.
 
9:20 AM
what about "offensive"?
 
His accounts are nuked on sight, persistent spammers are instead merged.
No, not offensive either.
Just 'troll'.
 
I want that auto-handled. Shouldn't I?
 
It's a one-off mentally unstable nut.
Auto-handling doesn't prevent him from posting again.
Nuking his account does.
at least for that account.
Downvote to keep him off the homepage, perhaps.
 
A single spam post should be enough for the quality filter to kick in
 
But you are now polluting the spam filters with the troll postings.
and he's prolific enough that that is going to make a difference.
 
9:26 AM
so, flag as other and downvote?
@MartijnPieters is there a meta post supporting that view?
 
user1125394
!!define hedge
 
@cc hedge A thicket of bushes, usually thorn bushes; especially, such a thicket planted as a fence between any two portions of land; and also any sort of shrubbery, as evergreens, planted in a line or as a fence; particularly, such a thicket planted round a field to fence it, or in rows to separate the parts of a garden.
 
9:57 AM
@lodopidolo 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.
 
10:10 AM
Ahoy hoy
How goes the wonderful word of Javascript chat tonight?
 
mostly spam talk, bot's greetings and CC's definition requests :-)
!!weather prague
 
@JanDvorak Prague: 24.1899C (297.34K), few clouds
 
So... good?
 
yeah
I am torn. I want to listen to Celtic Woman but I have to leave for a lunch.
 
user1125394
10:22 AM
lol@Jan
 
how to implement an abstract method like this:
Objects.prototype.CustomPositioning = function() {
    throw new Error("Call to unimplemented Abstract method.");
}
 
The language is behaviorally typed.. "abstract" solves a problem that doesn't exist in JavaScript
 
user1125394
!!> Object.prototype.CustomPositioning = function() { throw new Error("Call to unimplemented Abstract method.");}; var o=new Object(); o.CustomPositioning();
 
@cc "Error: Call to unimplemented Abstract method."
 
In JS the type of objects is determined by their behavior and not structure... Just implement your method where you need it
 
user1125394
10:34 AM
!!> function MyObject() { this.CustomPositioning = function(){ throw new Error("Call to unimplemented Abstract method.");}; } var o=new MyObject(); o.CustomPositioning();
 
@cc "Error: Call to unimplemented Abstract method."
 
@MRS1367 It's Object not Objects?
!!> Object.prototype.CustomPositioning = function() {throw new Error("Call to unimplemented Abstract method.");}; ({}).CustomPositioning();
 
@Pinocchio "ReferenceError: Objects is not defined"
@Pinocchio "Error: Call to unimplemented Abstract method."
 
@cc Yeah, why not just ({})?
 
@Adrian.S 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.
 
10:47 AM
Hello everyone
I'm having such a hard time with ajax. Is it possible to load ajax inside ajax?
 
user1125394
@Pinocchio the java's side of script
 
HI
 
user1125394
the dark side
 
@cc I would have thought new Object(); was more Dark Side.
@Adrian.S You can load another AJAX after one.
 
I've been trying to get this to work for like 4 hours now and no luck :(
if someone wants to take a look, jsfiddle.net/46ntt
Is basically a infinite scroll that would show all user posts, and inside each post I want to show a heart (like/dislike) icon that inserts a row into the database. The like/dislike is on the html content (jsfiddle), and the infinite scroll is on the js.
 
user1125394
 
Awwww
 
@Krishna 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.
 
Finally cleaned up my vim config mess :) github.com/BonsaiDen/.vim
2
 
user1125394
11:11 AM
always a bit amazed how you could put so much work in an editor config
 
@cc people are generally very eager to pimp out their homes
 
@cc Well, I use it nearly every day of my live, so even the smallest thing that doesn't feel right / plays nicely gets annoying really fast.
 
user1125394
yes right, sry
anyway, on windows intelliJ behaves a little like vim I think, you can place text anywhere on a line clicking/dragging it
 
user1125394
 
11:43 AM
@IvoWetzel pin yoir github link pls, the clipboard fix interests me but I can't do it now
@cc if you use the mouse, it's not vim :)
 
@FlorianMargaine If you go ahead and star it, I can't do it myself
 
I'm on mobile so no can do
 
@FlorianMargaine I'll just annoy.. I mean, remind you about it the next time I see you around
 
user1125394
yes :)
 
@FlorianMargaine @IvoWetzel You're welcome!
 
11:54 AM
@SomeGuy Thanks!
 
What I dislike a bit with intelliJ and all its siblings: Even if you set it to remove trailing whitespace, it doesn't do so if the cursor is in a line containing trailing whitespace within or at the end of said whitespace
@cc I think those sublime text users are sometimes even worse when it comes to configuring their edit
 
I haven't edited my ST2 config much.
Just bits here and there.
I've tried out a lot of plugins, though. They're fun to spend time on.
@FlorianMargaine Took you long enough! :P
 
@ThiefMaster Don't think so, after all I can change pretty much everything in VIM... and don't even get me started on my customized plugins :D
 
12:13 PM
finally got some time to play with angularjs
 
Do you like it?
 
What should i think of answers that just contain code and no text info or comments at all?
 
If the question is simple, sometimes answers like that may suffice.
 
@Pinocchio: NAA or downvote and comment, depending on the post
 
@ThiefMaster NNA?
 
12:17 PM
i highly prefer the latter unless someone just dumped code that doesn't answer the question
not-an-answer flag
 
@SomeGuy Well we have a CSS block and a JS Block.
oh
I was looking here, and there's two answers with no explanation at all of what's happening and how/why it works
1
Q: How do I show a background image in the first part of a page and make it cover 100% of the visible part of the screen?

arielI am new to development and have been tasked with a task that seems a bit challenging. I have to create a one page website where in the navigation I have about us and contact us link. When the user clicks on about us the user's screen should scroll to that section on the page and same thing f...

 
user1125394
developping with mouse is bearable, but you need to be ambidextrian :)
 
@SomeGuy in space, any penetration is usually fatal for all parties involved
 
How do you know that?
 
12:26 PM
depressurisation
unless you escort to the spaceship expediently to repair or replace the suit, you're going to lose pressure
 
having your blood boil from low pressure kinda sucks
 
LOL
 
@JanDvorak Ah, you meant while floating in space.
I'd imagine that it'd be okay inside a spaceship.
 
if you mean sex inside a spaceship, then yes, it seems safe
as far as sex is
What I meant were micro-asteroids
 
12:30 PM
Does anyone prefer the code review design to stackoverflow design?
 
s/code review/default/g
 
HUH?
 
I like StackOverflow.
 
I like both
 
Yeah, well i've just moved the codeReview styles to stackoverflow, it's lush
 
12:35 PM
4
A: How can I create a method in JS like an abstract method in Java?

Felix KlingYou can define an empty function on the prototype: RPSPlayer.prototype.play = function() {}; or if you want to force an implementation of this function, you can make it throw an error: RPSPlayer.prototype.play = function() { throw new Error('Call to abstract method play.'); }; This is ...

plz check this
I create an abstract method
and now, I want to override it from another class
 
Ain't it lush => d.pr/i/Zr8C
 
what I must do for implement it from another class?
I don't want to run its code
I've something like this:
Objects.prototype.CustomPositioning = function() {
    throw new Error("Call to unimplemented Abstract method.");
}
and want to implement it from another class
 
there's no such thing as abstract methods in javascript
 
user1125394
@JanDvorak isn't it going to freeze instead (pv = nrt)
 
@cc the pressure decreases
 
user1125394
12:41 PM
so the temperature also?
 
but the question tell we can do it
 
@cc no. pressure will decrease proportionally to the number of particles
 
plz see this:
 
12:46 PM
Q. Reverse of Final, can I make any method as an abstract (enforcing child to define it)?

A. Yes.You can mark any method as an abstract and child class will be enforced to define body for it. This is kind of reverse of Final. This makes parent to put certain restriction like child must do somethings themselves and parent will not provide any default implementation for that. Abstract method should not have body. It should be empty method. This is how you can define abstract method.

var MyClass = function(){
 
user1125394
12:56 PM
js class inheritance, hmm
 
@cc -> how to implement the abstract method from another class?
 
IE7 just made me write several lines of code I've not written before. The joys of being an early 20-something coder in 2013. I'm really spoiled. — BoltClock 16 hours ago
Ladies
 
user1125394
function ifIE7{
    throw new Error('not supported')
}
 
user1125394
 
1:11 PM
@cc or if( isIE ) { while( 1 ) { document.body.innerHTML = document.body.innerHTML } }
 
@programmer1 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.
 
user1125394
if( isIE ) { location.href='https://www.google.com/intl/en/chrome/browser/' }
 
user1125394
if( isChrome ) { location.href='https://www.mozilla/firefox' }
 
user1125394
if( isFirefox) { location.href='https://www.microsoft/ie' }
 
you hate browsers, don't you? :p
 
1:14 PM
if( !opera ) { location.href='https://www.opera.com/' }
 
ew.
 
user1125394
either bruce, either vador
 
user1125394
I should stop wrting this is java double rsi = rsi(); because in js it would fuck up I think
 
user1125394
!!> var foo = function(){return 1;}; var foo = foo(); foo;
 
1:19 PM
@cc 1
 
user1125394
well when it's declared globally like function foo() {return 1;}
 
1:33 PM
Everyone that thinks trigger.io is great because of that should be slapped really really hard.
 
who's saying trigger.io is great because of that?
 
@synth3tk He should have put a comma after the because I think!
 
@OctavianDamiean they linked to SO on that page; maybe that's where some terrible questions come from :P
 
-1
Q: how to call javascript function from SmartGWT function

mohammadhi all i am trying to call a native Js function called test i wrote in the HTML file in the smartGWT project but it sayes test is not a function the native java script code in the smartGWT class : public static native void callTest()/*-{ window.test(); }-*/; the java script function...

0
Q: Append content inside UL with list item and anchor tag <li><a></a></li>

Karolis RamanauskasHow to append content to UL with LIST ITEM and ANCHOR TAG inside it using Javascript? At the moment I am doing this. for( var i = 0; i < projects.length; i++) { $('<li><a href="#"></a></li>', { text: projects[i].author }).appendTo('#contributors'); } I can get it to work if...

-1
Q: how to use piwik with smartGWT

mohammadhey all i am trying to use Piwik in smartGWT to make some statistics the method i use is : public static native void PiwikReport(String email)/*-{ window.alert("hello1"); var pkBaseURL ="https://hpsmartplanner.com/piwik/piwik.js"; var piwikTracker = Piwik.getTracker(pkBaseURL + "piw...

 
2:04 PM
@Octavian o/
 
Sup yo?
 
DTG?
(Down To Game?)
 
Nah, sorry not right now. I'll watch this thing Zirak showed me, then I'll have to tidy up a bit and then the gyms waiting for me.
 
Hello, does anyone know how I can center an image element inside a parent div. The parent div should be a kind of mask. The middle of the image should always in the center of the parent div
 
Later on I'll be available for a couple of games.
 
2:06 PM
Fine... I'll go kill the Americans without you... I guess...
 
@rlemon You can play with me, bro.
 
user1125394
they have an army, a big 1, they want to use it
 
@Zirak OK. Ill be in game eta 10 minutes
 
I have made a JSfiddle: jsfiddle.net/Ex5ax/41
 
@rlemon We can try some co-op if you want, there're some fun missions.
 
2:09 PM
i want to play BF3 with people.
 
@synth3tk I sometimes want to play it with dolphins.
 
@OctavianDamiean they're fun, but only in moderation
 
And little boys.
 
user1125394
how do you check if 2 numbers have opposite sign?
 
a === -b
 
user1125394
2:11 PM
just sign not value
 
@cc Uhm, ohh ... bananas?
 
college football today! wooooo!!!
 
user1125394
ab === -1 is good maybe
 
Use signum (google it)
 
Do a banana check on them.
 
2:11 PM
A>1&&A>B
 
(psst, 0.5 is positive)
 
user1125394
!!mdn signum
 
The banana check is easy, it they look like a banana and feel like a banana they're not numbers.
 
Bah
 
2:12 PM
@cc There's no signum builtin, but it's easy to make.
 
(a > 0) != (b > 0)
 
Hello, does anyone know how I can center an image element inside a parent div. The parent div should be a kind of mask. The middle of the image should always in the center of the parent div jsfiddle.net/Ex5ax/41
 
user1125394
@copy yep
 
2:24 PM
@Zirak Psst. Make your damn Steam account.
 

« first day (1050 days earlier)      last day (3896 days later) »