« first day (1487 days earlier)      last day (3674 days later) » 
00:00 - 20:0020:00 - 23:00

12:12 AM
Hi all.
@Cereal ?
what do you mean?
@FlorianMargaine I asked the wrong question.
It's fine, I figured it out
Any angularjs users in here?
12:35 AM
I am one user373221
@user3732216 I am one
Can I send you a message grasshopper?
@user3732216 I too am one, I was lying before.
also, just ask your question, you'd have an answer by now.
Well I have a school assignment that I have written that is requiring the use of using localstorage however without the localstorage code it works but when I use it then it doesn't.
12:45 AM
have you made a JSFiddle to show off the problem?
0
Q: AngularJS state doesn't initially redirect on $stateChangeStart

grasshopperI have a different states that have a requireLogin parameter like this one. .state('store', url: '/store', templateUrl: 'partials/store/main.jade' data: requireLogin: true ) So I have angular listen on rootscope when ever the statechanges to check if the state requires a login and if...

I am currently putting together a fiddle for you yes
delightful
However I can't seem to figure out how I can upload to the fiddle so it can use the files.
So I copied the code from both my dataService.js and application.js files into the javascript section of the fiddle.
your fiddle isn't even running. Fix the js errors first, then ping me
12:53 AM
Heck I"m trying to figure out how to even ping you?
I'm not sure how.
And try the fiddle again.
how do you ping someone on here?
Hello?
@ symbol then name
Oh okay.
Can you save the fiddle and send the new link
Well @phenomnomnominal I tried updating and hoping it works.
I keep getting the message about duplicates in my array.
array of objects
I have to go to a meeting, sorry.
1:36 AM
{x:'-=960'} how do I write this into %?
 
3 hours later…
m59
m59
4:48 AM
Any suggestions for a < $200 24 inch monitor?
I see 2 BenQ's and an ASUS... not sure which to go with, if any.
MGE
MGE
5:08 AM
any info about .is_errors?
5:46 AM
Downvote? Seriously?
-1
A: Javascript Using array to populate select option

Rahul DesaiThe ID that you mentioned in your 2nd line in Javascript is wrong. Change it to: var parent = document.getElementById("parent"); Working Demo

Upvote for that question? Seriously?
Thanks.
MGE
MGE
voted
Thanks mate \o/
MGE
MGE
any info about .is_errors?
what is .is_errors?
m59
m59
@RahulDesai it is a terrible question and not very informative answer...
5:57 AM
ok
m59
m59
Some people will downvote answers on questions like that just because the question is clutter and should be deleted.
so, answering it kind of encourages that behavior, ya know?
MGE
MGE
@grasshopper
for example:
response = $.parseJSON(response);

$(".wrong-data").removeClass("wrong-data");
$response.find('img').remove();

if(response.is_errors){
m59
m59
@MGE that's not something anyone is going to know. That's something specific to whatever server you're getting the data from. Also, that's not how ajax works (unless it's synchronous and that's not a good idea) and naming something .is_errors suggests that whoever wrote the server code doesn't do things very sensefully.
That's problem the common mistake of responding to a request that failed using a 200 OK status anyway and making you deal with the errors in a request that appears to have succeeded
the server ought to return a status code like 500 or 4 something instead, so that the request actually fails and you handle the failure.
MGE
MGE
@m59 ty bro
m59
m59
oops, meant to say "that's probably the common mistake..."
@MGE Oh, ignore my comment about ajax/asynchronous. I read that as $.getJSON. Why not just use JSON.parse(response)?
@towc looks cool!
6:38 AM
When you can snatch the pebble from my hand, your training is complete, @grasshopper
7:14 AM
-3
Q: Describe this code

newbieprogrammerI have a problem here. I don't understand how to create a code from this. May someone explain what does it mean? Sorry if this explain isn't clear function track() { //set xy //get_next xy //reset xy }

7:29 AM
morning
@m59 y u no cum 2 miaou?
7:52 AM
Is there a way to trigger autogrow so that it resizes elements when they're created, if the text is long enough, without waiting for user to type something?
@Nemo-Omen 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.
resizes textarea*
@Nemo-Omen set height and width
or number of rows and columns
Awal, the # changes dynamically; I can't predict how many will be needed. Autogrow does that, but not until the user enters something.
@Nemo-Omen: you might be able to trigger a keypress on the field, with jQuery
7:54 AM
I will look into that, thanks.
But triggering event like that... meh :-/
I won't do that.
I'm listening. :)
Or try to figure out if Autogrow has a function you can call to force the thing to update.
I've looked a few times, I haven't found anything.. Autoresize does, but I wasn't able to get it to work. I guess I'll try it again.
8:59 AM
@SecondRikudo I'll be honest, I was slightly disappointed that it was sfw
9:33 AM
0
Q: Define 'this' keyword in a variable

Mr_GreenI have a function in the following format: var obj = { doSomething: function(){ this.callSomething(); }, callSomething: function(){ this.doThis(); this.andDoThis(); }, doThis: function(){ if(!this.bln){ this.bln = true; } ...

^ Any help?
@Mr_Green y u wanna do dat?
@AwalGarg what?
cv'd too broad (impossible)
@Mr_Green this ain't too long a name. Look at document.getElementsByTagNameNS
$$ ;-)
9:38 AM
@JanDvorak Press and Hold the Shift key, then press the $ key twice! //that is so fuckin long
is it weird that I;ve developed an attraction to javascript
It's not. Nice GUI API
fuck javascript, goto jQuery
!!tell awal wiki jquery
9:42 AM
I love objects so much and how flexible they are, how do other people feel about js?
ha ha
Hello All.
well I actually like coffeescript
@Mr_Green boop
what is jayQuery
@JanDvorak you like to spoil my silly jokes, eh
9:43 AM
sql for javascript?
@SecondRikudo thanks.. I think that is what is done to create a plugin :)
@techie_28 Please fix that.
@techie_28 use moment js
:19886779 EEK
9:44 AM
Im sorry
@techie_28 Paste, make sure they are all indented the same, and press CTRL+K a few times until there are only 4 spaces
remember case sensitive
I have an options string like this:

<option value="Jan">Jan</option>
<option value="Feb">Feb</option>
<option value="Mar">Mar</option>... so on..

I need to set this in the select boxes occurring in multiple rows but each time will have a different option selected.
Do I have to loop for each row to match the selected value?Or Can I use jQuery object to select this option strings and make option selected some how?
eek
"do I have to loop"... Why not????
are you looking for $select.value()?
9:55 AM
yes @JanDvorak something like that,I m getting the options in an array and will have to loop it separately for each row,I was thinking just to form a select drop down once by looping and then place it for each row with required option selected.
like
jQuery(option string here).selected(2)...
sorry for indentation.
are you looking for the selected attribute on options?
@SecondRikudo I was using Fixed Font button here,ctrl +K was moving code to one space only for me
yes @JanDvorak
ok angularJS sensei's help me out here. stackoverflow.com/questions/26845450/…
For each row I will be having the value to be set as selected in the drop down,but I will have to re iterate to match and set the attribute.
I was thinking to form the option string once and then set option selected for each row according to the value
$select.find("[value="+x+"]")'.prop("selected", true)?
10:03 AM
$select will have the generic drop down?
$select.clone()...?
jQuery('<select><option>Month</option><option value="Jan">Jan</option><option value="Feb">Feb</option></select>').find("[value='Feb']").prop('selected',true);
Would that be correct @JanDvorak
<option>Month</option>? Not a fan.
Im sorry?
if you don't have the select in a variable, you can use .end() to go to the previous selection, but the code can get ugly quickly
@techie_28 use a label
10:11 AM
@JanDvorak I do have it in a variable,I meant would it be like this?:

jQuery(selectvar).find("[value=......
thanks @JanDvorak
10:38 AM
Hi all
0
Q: How can I generate HEX-encoded CMAC-AES digest in Node JS?

PirabaI need to generate HEX encoded CMAC-AES digest using Node.JS. I have found library from GitHub. I want to know how to call it? This is the part I want to do it in node.js. I want to pass key and message. I imported this library into my node.js project. I want to know how to call this method ae...

@MirkoCianfarani Other way around
@SecondRikudo But if the other not look the date... :P
I said so my opinion, you have the choice (say in general for moderator), or drop everything...
@MirkoCianfarani Duplicates are not determined by date.
Duplicates are determined by which has the better answer
And the question's duplicate (that I say) contain answer recent and more acceptable
ok thx and drop all
lol see you new comment.... @SecondRikudo
10:51 AM
hello everyone...does anybody knows if it is possible to costumize the colums in kendo ui scheduler?
hey guys can anyone help me with this:
http://snippi.com/s/enaeut8

I use pickadate.js calendar plugin. What i want to do is to trigger the open event on checkbox change. But somehow it doesnt work. It works outside the function though.
Is there any difference between these other than the look?
(function () {
    console.log("foo");
} )();

(function () {
    console.log("bar");
} ());
@Schoening no
@Schoening no
Alright. Thanks :)
And that is the case for every self-executing anonymous function, right? You aren't playing some evil trick on me where only this simple example does the same?
11:06 AM
@BikerJohn I can only guess: can it only open once? Do you have to initialise the picker just before usage? Is the element it uses destroyed in the meantime? Does the checkbox actually trigger?
@JanDvorak Yes, if you look at my snippi link (comments), you can see that picker.open() works normally outside the checkbox change event. Also, the checkbox does trigger, i tried with console log. I assume it has to do something with variables out of scope, but not sure. LINK AGAIN: snippi.com/s/enaeut8
Is there possible to do minStart +1 if today is from sunday to thursday AND +2 if today is friday or saturday in datetime picker?
@Xinel 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.
No practical difference, but you still need to watch out for operator precedence
34
Q: Location of parenthesis for auto-executing anonymous JavaScript functions?

Kevin HakansonI was recently comparing the current version of json2.js with the version I had in my project and noticed a difference in how the function expression was created and self executed. The code used to wrap an anonymous function in parenthesis and then execute it, (function () { // code here })()...

11:19 AM
hello
11:34 AM
wello
anyone here with react experience, does the react mixin allow to define propTypes property checking ?
@SecondRikudo there?
I did as you said here in this code
but as you can see in above code, I am using the object name directly to bind a function to event
like Element.onmousedown = doSomething.bind(obj);
11:51 AM
Why the hell are you binding if there're no thiss in any of the functions?
Have you tried without binding?
ohh hehe.. I didn't
@SecondRikudo working fine :D
but I didn't get why binding worked before and now there is no need of binding ?
@Mr_Green Do you know what .bind does?
!!tell Mr_Green mdn bind
12:07 PM
Here is the refactored code Thanks to Second Rikudo. :)
CORS question : in what senarios would the preflight would execute ? Im doing a cross domain ajax reaquest with a custom header and I dont see prelight request. however - when I add request header (named "aaa") - I do see the preflight request : OPTIONS - so when does a preflight request is executed ?
12:20 PM
http://test/link/with/strikeout/
Hey !
I have a list of elements on a page. Now all of these elements have a same class, say myClass. Now I want to change the css of the element on hover. But for that I need to change the css of the element hovered upon. How can I do this using just css ?
the hover css will change for all elements
0
Q: Striked out links behave differently in chat room and in transcript

Second RikudoCheck out this message. If you enter the room, you'll see that it's linked and shows like this: test/link/with/strikeout/. In the transcript however, it reads like this: http​://te​st/link/with/strikeout/, without a link.

@charger73 Rephrase
@charger73 .myClass:hover{ ... }?
yeah
.myClass:hover { color: red }
this will change the color of all the elements with class .myClass
12:31 PM
No, it would not.
but I need to just change the color of element "hovered upon"
that's how :hover acts
try it out
leme ses
see
oh thanks !
12:35 PM
anyone knows what could cause firefox's Inspector not to focus the element when you try to inspect it ?
@tereško is it not present in the DOM?
such as :before, :after
12:56 PM
sup
1:16 PM
@tereško usually that the element is behind another one, z-index wise
@BartekBanachewicz sup
in Lounge<C++>, 32 mins ago, by Bartek Banachewicz
I can into atomic monad transformer stacks!
Is there a javascript library that when loaded does something? Anything. I need to just test that whether of not external library is loaded or not. So upon loading it immediately does something that clearly shows that it has been loaded. Is there any such library?
Not even a library exactly, just an external js resource..
@laggingreflex How are you loading said external library?
script tag
in an angular template
1:34 PM
@FlorianMargaine that wasn't it
i had to kill the profile
of course, as a long term Opera user, I had the stupid assumption that FirefoxSync is keeping my bookmarks in the cloud ... after removing profile, I discovered it to be not so
 
1 hour later…
2:38 PM
so we have an app
consumes various bower-components
this leaves us with multiple css files
we are having the discussion about do we have 1 css file for whole app, or multiple and let components have their own css?
anyone had this discussion at work already?
I always use 1 to maintain consistency
@NathanArthur 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.
Anyone know why a Karma test would fail this way?: Expected [ [ 1, 1, 1 ], [ 2, 2, 2 ] ] to be [ [ 1, 1, 1 ], [ 2, 2, 2 ] ].
@DrogoNevets multiple fail for maintainability + minifier for performance?
@JanDvorak Do you mean by multiple fail avoiding a single point of failure?
2:51 PM
!!> [[1,1,1],[2,2,2]] === [[1,1,1],[2,2,2]]
@KendallFrey false
@NathanArthur Because comparing arrays is not as straightforward as you think
@NathanArthur probably different array instances
@NathanArthur no; to provide physical separation of different concerns
@KendallFrey So two instances of identical arrays aren't equal?
Gah, why does this chat room keep duplicating my messages? =P
2:53 PM
@NathanArthur indeed
They are in Haskell ;-)
@JanDvorak so what are you saying?
@DrogoNevets how many LoC do you expect?
how can i impersonate keyword "this"
@CustomizedName wear an arrow hat
can i do something like this,,,,

if(true)
this = $("#this");
2:57 PM
Why?
@NathanArthur I think you can use expect(arr1).toEqual(arr2)
@CustomizedName no
@StephanMuller Ooh, nice
@SecondRikudo it makes me feel good :) joking, it's because I have a method which is using this but I am using it at load time and then in somewhere else as well
on runtime it's this is null
and at sometime it's this is this
overwriting this is a bad idea
2:58 PM
so I want to change this to something on runtime
@CustomizedName Refactor your function.
Can you give an example?
@SecondRikudo tomorrow, today I am going to give a lecture about JavaScript patterns at this uni
gotta go, laters
@StephanMuller Works like a charm. Thanks a bunch.
@JanDvorak LoC?
@DrogoNevets lines of code
3:10 PM
unminified, 110 (it will me minified)
the main issue is this is a 3rd party CSS file
as in, maintained by someone else?
yes "chief fancy pants" to be precise
thats his github name
Sometimes javascript can be frustrating
!!> isNaN("")
@Shmiddty false
m59
m59
@AwalGarg busy busy
3:23 PM
Hmm?
!!> isNaN(6)
@NathanArthur false
Pretty nifty.
A string is not a number
it should return true
!!> isNaN("6")
@Shmiddty false
should also return true
3:25 PM
lol
Seems pretty broken.
remember that one time jesus tried to divide 7 loaves of bread over 0 people and ended up with NaaN bread?
Actually, he ended up with Infinity
!!> 7 / 0
@KendallFrey "Infinity"
posted on November 11, 2014

var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); try { var pageTracker = _gat._getTracker("UA-3727700-1"); pageTracker._trackPageview(); } catch(err) {} KERPOW

@Shmiddty neither is it NaN
3:36 PM
@Shmiddty Take a look at this answer: stackoverflow.com/a/825430/1928529
@dennisschagt 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.
How do you guys name classes and objects as to avoid confusions and conflicts between classes, objects, and variables?
Class, object
what do you mean by "variables"?
ie, a string var vs an object var
There's probably a better way to say it.
upper-case for types, lower-case for values.
3:48 PM
UpperCamel for constructor functions, lowerCamel for all else
So it wouldn't concern you that you couldn't look at a variable name and know whether or not it was an object by the case?
UpperCamel for namespaces as well
@NathanArthur no. Use a descriptive name
@NathanArthur I'd be concerned if I saw an UpperCamel variable
Alright.
lol Fair 'nuf.
3:52 PM
@RajendarTalatam 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.
how can i call servlet from javascript , which is written in jspx page
i can use JQuery also for this reqierement...
look up how AJAX works. The rest is Java, which is out of scope of this room. Have fun.
Pranking a coworker with the SysRq shortcut to remount all filesystems on his machine as readonly is fun. Pranking the other coworker by making him run "echo u > /proc/sysrq-trigger" in hos shell is hilarious.
Anyone familiar with Cordova 4? I am trying to follow the docs for local notification plugin as per ngCordova, and I am getting $window.plugin undefined. Only thing I see different is that I have Cordova 4 not 3...
4:12 PM
Trying to understand private methods in JS: javascript.crockford.com/private.html
What's the use of private methods if you have to create privileged methods to access them from public methods, and these privileged methods are themselves visible to the outside?
Just that, there's no reason to
Sometimes the public methods need to do additional work besides the private method
So private methods aren't used in JS?
Well, there is no concept of private (or method) in JS
Ok, private members
Private in JS usually means a variable local to a function
(public would be a property of an object)
4:19 PM
Mr. Crockford is recommending creating private members by putting functions inside the constructor
a method is just a property that is a function
Mr. Crockford also doesn't use for loops
He's a bit funny in the head.
lol Alright.
So do you use underscores to denote "privacy," or do you not worry about private functions at all?
Usually the easiest way to make a private member is to declare a local variable in the constructor function.
@NathanArthur I'm one of the group that doesn't start identifiers with underscores. Some people do
Yeah, np. I'd much rather have true privacy than underscores any day.
So this is what gets me—how do you use those private members in public members without exposing them to the outside?
closure
4:22 PM
Hmm.
If the private member is a local variable in the constructor function, anything you define in the constructor function has access to it
Right, but other methods of that class outside the constructor don't.
prototype methods etc. can't
Anything from a different scope can't see it
Does prototype always refer to prototype.js?
4:25 PM
no
it refers to the normal prototype
Alright.
I think somewhere in the ECMAScript spec there's private properties, but I'm not sure when they will be implemented
So a prototype method is a method accessible to all instances of that class.
It is accessible, but differently than a method assigned to an instance.
If you assign something in the ctor, it's going to be accessible to all instances (unless replaced)
On the prototype, it's a function shared by all instances (as a method)
Gotcha.
So functions within the constructor retain access to everything out in the constructor, even when somehow accessed elsewhere. That makes sense.
4:35 PM
Function scopes in JS act much like a stack, from the point they're declared.
They can see anything declared in a surrounding scope, even if you call them later from an entirely unrelated place.
Right.
But to use those functions in a public method, you'd have to have some way of returning them to the public method—Crockford's privileged members, no?
not sure, I avoid crockford's work
lol Alright.
He's controversial much?
this.method = function () { ... } is the common convention
(within the ctor)
Hmmm.
And this.method would remain private?
4:38 PM
Nope, this.method is used to make it public. Not assigning it to this.something makes it private.
"Private" in this case meaning accessible only within the scope of the ctor (since each function has a scope).
Your public function can access closed ("private") variables in the constructor
So if you wanted to have simple public and private methods, you'd just put them all into the ctor.
the only functions that can "see into" the constructor's variables are functions lexically defined inside the constructor
even after those functions leave the constructor
Right.
So just do everything in the ctor and you have public and private "methods."
4:40 PM
It's complicated
Yes, if you want "private" variables you're really looking for "per-instance variable declared inside the constructor closure"
and if you want functions that can access those "private" vars, those functions must also be per-instance
Very roughly, if you declarer it in the ctor, it's private until you assign it to this.something.
I tend to use prototype for methods, but I usually end up assigning properties in the constructor
4:41 PM
That goes for almost anything declared in a function, actually.
You have to explicitly attach it to something publicly visible.
Also, MDN's article on closure is pretty good: developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Closures
You can't have a shared prototype function that can reach into the constructor-closure of every instance; any function that can see into a particular instance's constructor-closure must be declared inside that constructor-closure.
By "the constructor-closure" for some instance I mean the closure-based variable environment created when the constructor runs to create a particular instance
@ssube Yes, that moz article helped me quite a bit.
Is there an easy way to save out chat transcripts?
Click room, under the description, and select "create new bookmark"
Sweet. ty.
5:54 PM
I have watching good few number of AngularJs videos and still have a number of thing unclear
every exists on the browser JSON object until you finalize everything and send it to the server via ajax
is this right?
I see many shitty questions upvoted but not the good ones ... very sad
2
Q: JQuery Emoji picker

JSHelpI wanted my users to be allowed to insert emojis into a text box. I have searched for a JQuery plugin, which would allow me to give them a picker like the Mac, iOS or Webogram integrated Emojipicker. But I couldn't find a proper one, which sorted all icons and displayed them? Is there any possib...

@RobertMallow I have a ignore:jquery in my research :(
Wow did the guy created and answerd the question, at the same minute?
6:14 PM
@dievardump ohhh that is it then :D yep it seems so haha
6:41 PM
@dennisschagt I know how to work around the problem. I was just frustrated at the bug. :P
 
1 hour later…
7:51 PM
!!div or canvas
@towc canvas
yay
00:00 - 20:0020:00 - 23:00

« first day (1487 days earlier)      last day (3674 days later) »