« first day (1400 days earlier)      last day (3771 days later) » 
00:00 - 19:0019:00 - 00:00

00:21
@Neal no
:P
@Jhawins Why me?
Building a Node/Express/Ember app and have a few questions if any one has a sec
00:48
0
Q: What's the equivalent of jQuery.when() in angular

user3304774In jQuery we can do $.when( $.ajax( "/page1.php" ), $.ajax( "/page2.php" ) ).done(function( a1, a2 ) { ... }); What's the equivalent in angular? I really need to wait for all ajax calls finish then do stuff. Thanks.

 
3 hours later…
m59
m59
03:46
Hey guys, when I update a user's profile, what's the best strategy for creating the query on the server?
hmm...then again, I can just validate/update it all, right?
Yes
m59
m59
hah, there it is again. I can't think well unless I talk :)
thanks @copy
Hello. Could anybody help me understand something a little better?
@kaloncpu57 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.
Oh, alright! I'm having trouble understanding what a bitmask is. I first heard about them when I learned that the Nintendo Wii U has it's own JavaScript functions and objects. It turns out that you can get a number value which represents all of the buttons currently being depressed on the GamePad with the variable wiiu.gamepad.hold but if you press more than one button, you don't get each value, you get all the values added together.
03:54
Do you know what a set is?
The site I found this on says that the buttons being depressed are represented as a bitmask, but from what I've read by searching questions on here, the number values assigned to each button being added together doesn't seem like a bitmask.
I'm not sure what a set in JavaScript is.
JavaScript doesn't have sets, I mean as in math or python
A bitmask is internally an integer, used to represent a set of booleans
Oh, well then I would say I have a good understanding of what a set is.
Buttons are not added together (although that sometimes makes sense too), they are or'd
From what I've read, a bitmask uses 0's and 1's to tell whether something is true(/truthy) or false(falsey). Is that true? The "bitmask" for the Wii U buttons uses other numbers. In fact, here's the list: wiiubrew.org/wiki/Internet_Browser#Buttons
04:00
Do you understand how numbers are represented in binary?
Well, I can count (slowly) in binary if that's what you mean.
5 in binary is 101 (or 00000101)
You can use that to represent other things
..and I can associate each number with it's decimal equivalent.
Yeah, I understand that much.
Essentially you can store 8 boolean values in a byte
For example, the number 5 might represent a pattern of lights.
off off off off off on off on
That makes sense, but if the Wii U browser automatically adds them together can I get each individual bit?
04:03
yes, you can use bitwise operators
to test a single bit, use &
say you want to test the third bit
Oh, great!
input & 00000100 returns 00000100 if the bit is set, 0 if it's not
Typically you use hex numbers for bitwise math
Like 0x00000002?
0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40 and 0x80 are the bits in a byte
@kaloncpu57 Yup, that would test the second bit
Okay, so if each button is assigned a hex number, the hex number is referring to a single bit. Since these double, you shouldn't get conflicting numbers by adding them together, right?
m59
m59
04:09
Is debouncing with promises a good idea?
Unless I'm reading wrong, I'm seeing people use debounce functions to make ajax calls, even if others aren't back yet. I'm not sure if that's useful..
@kaloncpu57 you won't have problems if you add them, but use or ( | ) for clarity
m59
m59
oh hm...I think if you use promises, you'll end up getting a result that's outdated
right?
Awesome! So to check the fourth and sixteenth bit, you would use
input & 0x00000014
Is that right? @KendallFrey
that would check the third and fifth (from right)
0x10 is the fifth, 0x04 is the third
Alright.. the decimal numbers given don't quite correspond to a hex number then. The chart (and my own test) returns the decimal number 16 when you press the "R" button on the GamePad, but the chart says that the hex number is 0x10
04:15
Yes, 0x10 == 16
But 16 is 00010000 in binary
so it checks the fifth bit
Every hex digit is 4 bits
Oh right... three different bases here.
Let me test this out then, and I'll check back in a minute either way.
04:35
@copy
Okay, I tested wiiu.gamepad.hold.toString(16) & 0x4 which told me the button was being pressed for three different buttons.
It told me when 0x4, 0x20, and 0x100 were pressed. It returned to 0 when two were pressed at the same time, but told me when all three were pressed at the same time.
So.. I should probably check specific binary numbers in that case..
@KendallFrey Thank you! You get my brownie points. ".toString(2)" worked.
05:25
:(
Hello
can anyone help me about hostname validation
I have little confusion
is it 00.test.test.org valid host name as per tools.ietf.org/html/rfc1123#page-13 ?
I have wrote validation function for it
but my function does not allowed doted string
so please help me
hi
hi all
05:48
@copy >:(
@Harry what function?
@monkeyinsight javascirpt function
@Harry want to share it?
sure
function = function (inputDat) {
		var singlechar=/^\s*[a-zA-Z\d]\s*$/;
		var multicharHost=/^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$/;
		var ipPat=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/;

		var blankTest=strHlpObj.stripOuterBlanks(inputDat);
		if (blankTest.toString() == "false") {
			alert("Spaces not permitted in hostnames.");
			return false;
		}
		else if (blankTest=="")
			return true;

		if (strHlpObj.stripBlanks(inputDat).length==1) {
@monkeyinsight see
@Harry too much unassigned functions inside... can't read
06:06
@monkeyinsight Please copy function and use any editor for view
@Harry no, i mean you have functions like stripOuterBlanks that i have no idea what they are doing
@monkeyinsight I explain you
In this function its allowed hostname start with digit
I have wrote two regular expression for it
one for single character hostname
other for multi character host name
you regular expression looks weird
([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9]) what does this do?
why ?
I have got reference from stackoverflow.com/questions/106179/…
i just tried and it matched 00.test.test.org fine, should be something with input data
i guess it's here if (inputDat.indexOf(".")!=-1)
06:16
You are right
ip and domain name both will have indexOf(".")!=-1
I have wrote code for check dot in hostname string
because i have allow dot only with IP address
so my function not work from my side
but my question is that as per RFC 1123 00.test.test.org is it ok ?
yes, domain can start from number
a-z
0-9
- but not as a starting or ending character
. as a separator for the textual portions of a domain name
okay
means that type of hostname is allow ?
06:22
need to modify my function right ?
@monkeyinsight thank you so much
I have modify code as per your suggestion
06:41
@rlemon what kind?
Anyone using compass with sass and bootstrap plugin?
07:09
Hello,
Has anybody here worked with D3?
@rlemon's girlfriend
She plays it all the time
07:33
@sara_123 yep
I have a problem and I am working on that for two days :(
I have a csv file, and I am drawing parallel coordinates for that
everything is fine, and it works just grat
*great
Problem solved!
Now, I want to modify my code in a way that it gets an input from user, such as 20
and it selects 20 rows from csv file and draws parallel coordinate for that 20 rows
I have managed to change my code to get the input from user
but I don't know how I should filter my data to select just some rows randomly
you want to select 100 rows at random?
07:44
158
Q: How to randomize (shuffle) a javascript array?

Click UpvoteI have one array like this: var arr 1 = ["a", "b", "c", "d"]; How can I randomize / shuffle it?

I read the csv file using d3.csv(...) command
It does not store the data as an array
the csv reading and rendering part is similar to the code in this link : http://bl.ocks.org/syntagmatic/3150059
If you search for "d3.csv" you can see the relate part of the code
does anyone know a similar-to-canvas-API library for c++?
@sara_123 it does d3.csv("path/to/file.csv", function(rows) {
07:59
@towc SDL
@monk
0
Q: Looking for html's canvas-like library for c++

towcI just started with c++ and I thought that the iostream isn't enough for my likings, but full OpenGL (or any of his 3d libraries) was too much. I'm looking for a simple 2d library for c++, and since my only knowledge of 2d graphics API with my main language (javascript) is the canvas API (yes, I ...

post it there
Not SDL
SFML
@monkeyinsight, but when I test "console.log(Mydata[0])" I get something like this:
Object {Type: "K1", feat1: -0.370243, feat2: -0.423497, feat3: 0.503701, feat5: -0.162725…}
which is not array
@sara_123 console.log(Mydata) it is array
if you need to pick random properties of object, use Object.keys(Mydata[0]) as your array
08:05
@monkeyinsight, I meant this (Object {Type: "InfDead", bug_hif1: -0.370243, bug_hif2: -0.423497, bug_hif3: 0.503701, bug_hif5: -0.162725…}) is not a row of an array.
No, I want to select all the properties of 20 random rows
each row is a sample with properties
so Mydata is your array of all rows
randomize it and pick first 20
@monkeyinsight, Okay, I will try that :)
Thanks!
@copy what are the differences?
two letters difference!
@towc SFML is C++ish
08:09
SDL isn't?
SDL is more Cish
oh
08:24
@monkeyinsight, Yay! It is working now! Thank you so much!!! :)
0
Q: How can I sequentially chain promises using bluebirdjs?

redgeoffPromise.all() doesn't guarantee that promises will be resolved in order. How can this be done?

@Feeds lol, that was silly.
hmm--- I'm on a c++ project of VS2012 express, and I want to add a library to my External Dependencies file.. how would I do that?
I feel like there should be
woops
So, I want to add a new external library to my project, and I saw that my #include <lib> points to a folder that I see in the Solution Explorer called 'External Dependencies', problem is that I can't find anywhere in Documents > Visual Studio 2012 a folder named like that. I tried to google it but couldn't find much.
hi
09:23
guys where can I get sample html content to test xss filtering?
@Qantas94Heavy done
@AwalGarg use this site?
@BenjaminGruenbaum Do you mean copy source of this site?
I do not reply to the content of messages that use 'u' 'i' etc.
@BenjaminGruenbaum kk. sorry.
Why the kk :/
@AwalGarg yes.
09:29
@BenjaminGruenbaum Do you think it will contain most of the html tags?
oh wait, I can check that myself. :D
Yes, you can.
Lemme rephrase that link on the rhs
Nothing happened! :(
09:44
@BadgerGirl What does your "accepted" image on Facebook say?
0
Q: ng-model in angularjs directive

user3587919I am trying to create a directive that would create input(s) field with different types and different numbers. That works fine, but my problem is, I can't use any of my ng-model inside my directive's input field. My code is given below: HTML :: <form method="post" ng-submit="CheckAddReceivedGoo...

10:30
hayageek.com/jquery-multiple-file-upload I found this code and I need something similar to this, but, can I do it w/o drag'n'drop zone but with only input?
Anybody? :)
11:06
Hello to all
@AbhishekHingnikar Happy birthday! :D
10
@Qantas94Heavy i just wanted to ask that Can javascript files run codebehind?
"Code behind"?
@yash: I'm not sure what you mean. Are you referring to running server-side code from browser code?
11:14
If you mean, on the back end, yeah, NodeJS
@SomeGuy thanks :-)
@Abhishek How was your bachelor's party?
Its going to happen tonight :P
I mean to say can we transfer messages between pages by just javascript files anytime?
@SomeGuy
Still don't know what you mean
@Abhishek Oh, have fun!
11:18
so... I was thinking about a game to make, and for once I thought of clarifying my idea before coding it... I usually do it on paper, and after 2 lines were drew I usually get bored and start programming... This time I tried to use paint to design it... Is this how you actually design games?
3 images explain everything that the game should contain... or almost
I may not have specified what should the colors be, or the restrictions of the boxes
@SomeGuy Actually i want to create such type of chat application in which only have to insert some line of javascript codes and we can connect it to other website for chat
what's wrong in my code ::

.directive("invoiceProduct", function () {
return {
restrict: 'E',
template: '<div></div>',
link: function (scope, iElement, iAttrs) {
var templatex = '<input type="text" ng-model="demoxx" />';

iElement.find('div').append(templatex);
}
};
})\
I can't use "demoxx", it always "undefined"
@SomeGuy Any idea about what i am talking? Can we do this in pure javascript or i have to move on some other language?\
!!are you alive?
no cap :( may her soul rest in peace...
11:40
@yash everything could be done on pure javascript!
<- liar
@monkeyinsight Can you give me running example of back end javascripts?
@monkeyinsight ???
@yash that is site running on js backend
ok i will study it Thank you for your help @monkeyinsight
11:50
@yash paypal and wallmart are on js backend too if you're interested
@monkeyinsight wallmart? when?
@AwalGarg about 6-8 months ago
 
2 hours later…
14:20
0
Q: Calling defer.notify() in synchronous context does not execute the callback

Svilen Ivanov Consider the following snippet (demo): function asyncCall() { var result = $q.defer(); result.notify("Notify: sync"); setTimeout(function () { result.notify("Notify: async (timeout)"); }, 1000); return result.promise; } asyncCall().then(null /* success */, null...

1
A: How to transform xml and keep newlines?

OdedYou need to use <xsl:preserve-space> for this. See this w3cSchools article for details.

@Qantas94Heavy edit for a better documentation?
@JanDvorak yeah I am, just found it amusing even he can refer to it as "w3cSchools" (sic)
oh. EEEW
I need an eye bleach
unonebox plz
sorry, I can't take you out of your misery
14:31
guys, can JS in an iframe effect the page on which the iframe is?
@AwalGarg yes
@JanDvorak how?
CORS might stand in the way, though
@AwalGarg window.parent and window.top
there's also a message passing API that works across domains
ohh ok. also, can you please tell me what exactly does wrapping in <![cdata.. do in jsfiddle and how does that help?
@AwalGarg that's for javascript inside XHTML
14:33
CDATA is an XML thing, you can find out more by reading in the XML spec
@JanDvorak so it won't work if they don't wrap it in those tags?
@AwalGarg it will, but you'll have to escape it
@KendallFrey I know its use in xml. it basically tells the parser not to parse it. but, I didn't understand why jsfiddle guys use it to wrap user input JS.
or avoid ordering comparisons
@JanDvorak but why?
14:35
@AwalGarg 1 < 2 is invalid XML
@JanDvorak ahh! ok, got it :)
@SomeGuy lol
!!should i have a hangover or a hackathon
@AbhishekHingnikar It's your birthday!
Go have fun!
@SomeGuy both are fun for me ^^
14:42
@AbhishekHingnikar both. look up "Balmer's peak"
I just came back from the more official party.
@DrPatil78 I wonder would u change your twitter handle to DrHingnikar78 ;-) ;-) ? Cause that would be #soon #lovely ;-)
I will be getting married by december :P
@dystroy hey, u there?
14:58
@AwalGarg I don't know. Why ?
@dystroy hey... please tell me how do you upload images to imgur without having the user signin to imgur in miaou?
@AwalGarg The user doesn't upload to imgur, my server does it. And my server has a imgur key.
@dystroy so the user sends the image to your server, and the server sends it to imgur, right?
@dystroy do you also store the images at your server?
15:03
23rd December it is, yall are invited in India
@dystroy I was inspecting the network requests in miaou on image uploads to imgur, and what worries me is that the response includes the delete image hash, which the user can use to delete the image. Anyway to avoid that?
we're all hackers here, @dystroy
@AbhishekHingnikar :D
Now that i have less days left, lets hackathon
15:09
@JanDvorak all except me :D
@AbhishekHingnikar has she got anything to do with computer science?
@towc she is my ceo, and writes better code then anybody i can hire in the city. but shes a dentist by profession
lol
congratulations mate
i.sstatic.net/LxsCC.png , that moment when you realize your wife is your boss ..... and you can say "I nailed the boss ;-)"
3
thats her
and oh f why is the export so blurry :-/
It isn't in the actual picture
15:11
@AbhishekHingnikar that seriously needs to be pinned with some captions xD
I guess she cannot give that card for long lol
@AbhishekHingnikar she is ceo, what are you? :P
CTO
If I had to guess
@SomeGuy bulls eye ;D
but i just write co-founder
@AwalGarg happy now ?
superb :D
15:15
!!are you jealous?
@dystroy y u json parse image data?
@rlemon Cap's down
@DrPatil78
Student dentist from India, curious about medical technology and science.
31 tweets, 22 followers, following 43 users
^ Her twitter accont for those who want to follow.
@AwalGarg Well, if you upload an image to imgur, I don't see why you wouldn't be allowed to delete it
15:22
@dystroy if you want it to be publicly visible...
@dystroy because the user has uploaded the image for my app, now it is mine...
@JanDvorak I don't know
if only for moderation purposes
@AwalGarg That's not really the case in miaou. Nothing is mine.
@dystroy well, anyway to prevent showing the delete hash to the user?
15:23
@dystroy user uploads a rude image => user posts the image => others complain to mods => user deletes the image => mods don't know what the image was
@JanDvorak lol you think like a burglar! :D
15:37
is the ALS bucket of water thing challenge based ? or can i start my own branch ?
You can start your own
Alright then, I am doing it tomorrow and challenging Kul, Sneha and @SomeGuy
15:54
@FlorianMargaine 3 people
its not 2.
7 people.
@SecondRikudo lol i can challenge the whole js chatroom :P if you guys feel like
i wanna challenge my russian friend though, he lives in tundra
I actually have no idea what we're talking about, I just got here.
a water bucket on his head is going to be ice xD
42 people?
@Madara, the anime room had a complaint against you. (kinda)
15:58
@SecondRikudo Is Code Geass worth the second season?
Just finished the first, ended with a bad taste
16:11
anime not worth
16:25
wow i helped Ana Tudor debug a problem. :o
Congrats!
erm... guys, I wrote some quite long messages in the ecmascript room, could who's allowed to go in there go and have a look?
it's logics help needed
for a minigame of mine
anyway, g2g
16:53
@Zirak Second season is about an order of magnitude better than the first.
Definitely worth the watch.
-5
Q: Burninate specific event tags

bjb568onload, onload-event, onunload, onbeforeload, onbeforeunload, onbeforeprint, onchange, oncheckchange, onmouseover, onmouseout, onmousedown, onmouseup, onmousemove, onmouseclick, onclick, onclicklistener, ontouch, ontouchlistener, ontouchevent, onblur, onchange, onreadystatechange, onfocus, onkill...

Agree/disagree?
@Zirak wanna host cap
she pinged you her memory yesterday
17:15
I've come to the conclusion that I'm a bit of a sociopath.
@rlemon Sounds downright kinky
At least it's not upright kinky.
upleft
@JanDvorak That's the same for texts : you can change the text of a message and the old version isn't kept. And the URL of images is in the text. I don't think it's really a problem.
You going to tickle her bytes while you're at it?
Maybe you'll make it to 1st bus
What pick-up line would you use? Maybe that her dress looks good on her, but it would look even better on the motherboard.
17:34
> Your motherboard is so old she can't use the universal bus.
!!listcommands
Interesting
0
Q: How to test ES6 promises with Jasmine 2.0?

ntrrgcI have a function that returns a (probably shimmed) ES6 promise and I want to write a Jasmine test that checks it successfully resolves and the resolved value is correct. How would I do that? This is the way I've found at the moment, but it's boring at the least: describe("Promises", function()...

And now?
!!info
@Zirak I awoke on Sat, 16 Aug 2014 17:36:53 GMT (that's about 1 minute ago), haven't done anything yet!
17:38
Up and about
17:59
Im touching up on my javascript by reading the "Good Parts" but when I get to the precedence and associativity list, it seems to be missing quite a few operators that the C Programming Language has, including assignment, comparison (not equality), post and pre icnrement, binary operators, etc:
. [] ( )                    Refinement and invocation

delete new typeof + - !     Unary operators

* / %                       Multiplication, division, modulo

+ -                         Addition/concatenation, subtraction

>= <= > <                   Inequality

=== !==                     Equality

&&                          Logical and

||                          Logical or

?:                          Ternary
MDN has a comprehensive list
but the basic idea is the same everywhere
!!tell JohnMerlino mdn operator precedence
Not necessarily in Java if you want to right shift an unsigned byte, you have to use >>> wheras C uses >>, so there are definitely differences between the languages, and I would like to know the full scope of javascript operators, which "Good parts" seems to be missing.
@CapricaSix yeah that works. Didn't realize javascript had a yield.
@JohnMerlino new in ES6
btw...
!!caniuse arrow_functions
18:05
@JanDvorak That didn't make much sense. Use the !!/help command to learn more.
@JanDvorak That didn't make much sense. Use the !!/help command to learn more.
!!should I be an insensitive douche
@JanDvorak All signs point to yes
@JanDvorak Can't argue with a random number generator
@JohnMerlino A lot of languages don't offer the same functionality as C for a good reason
@Neil except that === is not for a good reason :-/
@JanDvorak That's a whole 'nother ball o' wax
18:32
18:49
HEATHEN
hahah
Never use ==, only ===
m59
m59
@IGRACH not never. == is sometimes useful.
@m59 when?
Well yes, but its cant lead to confusion
m59
m59
hmm, well, come to think of it - I was thinking more like:
var x = 0;
if (!x)
if (x == false)
18:58
Yes
and this
> 0 == "00"
true
> 0 === "00"
false
@m59 that's ugly as sin and it doesn't even work
can be usefull someimes
!!> +0 === +"00"
@JanDvorak true
if you want type conversion, do type conversion
m59
m59
18:59
What do you mean it doesn't work?
00:00 - 19:0019:00 - 00:00

« first day (1400 days earlier)      last day (3771 days later) »