« first day (956 days earlier)      last day (4006 days later) » 

9:00 AM
$("#test").append($('.gradestable > tbody > tr[id]:first').prevAll("tr").get().reverse())
 
@GNi33 maybe svg + vml (with raphael.js) is a more viable option?
 
yeah, probably, we need to support mobile (Android) too, so we dropped the thougt about SVG
the canvas-component is pretty much finished, so I'll probably just test some fallback-libs, just wanted to see if anyone in here ever came in contact with some of those
 
cool. thanks again! time for sleep.
and I'll def suggest fixing the server side code. I just didn't wanna show up empty handed. I write a lot of code at my job thats never used. still in my first year though, so I guess its expected
 
@JamesBlond 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:17 AM
@CapricaSix Cheers, just having a look around :-)
 
totally off subject, but has anyone recorded a screencast? I need some advice.
 
9:34 AM
Could you please suggest me a cool lambda function that you know?
(Not typical ones)
 
What for?
 
This is basically for an assignment
 
f=(x)->f?x*x*f(x-1):1
 
what is a name of it?
 
I've just made it up
 
9:37 AM
dang
 
but it's basically (x!)**2
f=(x)->x?x*f(x):1 // x!
 
IDK,
I guess I will borrow one of idea from here
 
x=>(y=>x+y) //currying demo
 
that's like passing in 2 arguments
right?
and adding them
 
x=>(f=>f(x);x)
 
9:41 AM
I haz arrived.
 
I can haz left
kthxbai
 
I'm interested in things like where function which is quite generic and is versatile
or filter function that takes a function and a list then returns filtered list
 
@O0oO0oOO0ooO Y-Combinator
 
function() {
    return function() {
    }
}
@O0oO0oOO0ooO [null, undefined, 1, 2, NaN].filter(Boolean)
 
@Zirak nice one
 
9:43 AM
or [1, 'a', 3, '3'].map(Number)
 
I think I will have a look at it, but I couldn't understand it yet
 
@Zirak Hackernews.
I don't know why I said that.
 
@OctavianDamiean HN.
 
Y = λf.(λx.f (x x)) (λx.f (x x))
pfft, what's difficult to understand? :P
It's a beautiful thing
 
basically nope, because I haven't read about it yet
only heard it from my friend talking about it
 
9:45 AM
That looks promising
 
sick, thx
 
Oh now I know why, because the company behind HN is called Y Combinator! :D
 
I couldn't resist, saw the conversation on the bot's screen...now I have to vanish
 
and because the url is news.ycombinator.com ?
 
I think there are whole bunch of other alphabetical combinators
Combinatory logic is a notation to eliminate the need for variables in mathematical logic. It was introduced by Moses Schönfinkel and Haskell Curry and has more recently been used in computer science as a theoretical model of computation and also as a basis for the design of functional programming languages. It is based on combinators. A combinator is a higher-order function that uses only function application and earlier defined combinators to define a result from its arguments. Combinatory logic in mathematics Combinatory logic was originally intended as a 'pre-logic' that would clarif...
 
9:49 AM
@Zirak No! Don't vanish, stay here.
 
(It's dangerous to vanish alone)
 
Good day people!
Has anyone here ever worked with the highcharts.js lib?
 
Ziraaaaaaaaak! (screamed in a Marlon Brando Stellaaaaa way)
 
Is there a setting in the Highcharts lib to force lines off each other when they have the exact same value (for example both have value 3 and the one line is nudged just a bit to the top and the other just a bit to the bottom to show both)?
 
hahah, today's exocomic is just awesome!
 
10:00 AM
Yeah XD
POP POP!
 
@Zirak That's what she said.
 
Shoelace is so cool.
 
oh damn
I used a closure in js code at work
will it pass code review?!
you'll see at the next episode!
 
@FlorianMargaine Send them a picture of shoelace.
 
10:11 AM
I don't find it real fun...
 
@FlorianMargaine Same js time, same js channel.
 
@Neil To your (ex)-girlfriend?
 
@Zirak She said to my ex girlfriend? Eh?
 
heh
That's what I found while shopping today. :P
The translation: Share your CocaCola with your bro
 
Your shoes are weird
 
10:21 AM
Why, because they are blue?
 
no, because the laces are yellow
 
It has nothing to do with their mood
 
yeah... looks like what I had when I was 15
 
Those are my downhill biking shoes.
 
10:25 AM
hey is it possible to fire when a method is launched?
 
@OctavianDamiean some of those are totally stupid
 
@FlorianMargaine I see, so blue and yellow means that you have to be 15 to wear them?
 
"mit deinem Gipfelstürmer" and so on
 
omg
I had to smile when I saw the bro one.
lol wat, have you guys seen the flag in the PHP room? :D
 
10:29 AM
For those of us who can't see flags, what was the message?
 
Oh, yea sorry, forgot to tell you.
in PHP, 9 mins ago, by Ocramius
javascript is outdated, we use jQuery.
 
LOL
 
A flag well deserved!
 
Maybe it was just a joke
 
@dArc 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:33 AM
probably, yeah
 
Yeah, seeing the context, it's a joke
 
maybe they meant "plain javascript". Then it makes sense.
Though Vanilla is getting more important lately.
 
wat wat?
 
"makes sense" in the sense "is parseable", not "it might look true"
 
user1125394
!!> "red greenyellowblue".match(/((blue|red|yellow|green|purple)?){4}/i)
 
10:39 AM
@xcx ["red","","undefined"]
 
user1125394
for my cousin I need to find a regex for his mastermind game, validate user input
 
wow, that's quite beautiful.
 
@CapricaSix thx for the info :)
 
user1125394
!!> "red greenyellowblue".match(/([^\w]*(blue|red|yellow|green|purple)?){4}/i) //seems ok
 
@xcx ["red greenyellowblue","blue","blue"]
 
user1125394
10:47 AM
if match[0] is the same length than the initial input
 
user1125394
!!> "red foo bar blue".match(/([^\w]*(blue|red|yellow|green|purple)?){4}/i) //fail
 
@xcx ["red ","","undefined"]
 
@mikedidthis how was that website called you showed me? You know the one with the fancy artwork.
 
@OctavianDamiean I have shown you many sites? You mean the card site?
 
guys, I noticed I get refreshed whenever I join this chatroom
am I being monitored or spyed?
 
user1125394
10:51 AM
@O0oO0oOO0ooO spyware :p
 
The CIA are on to you. They know what you did.
 
@mikedidthis Yea that one.
 
@xcx great, i feel safer now
 
@O0oO0oOO0ooO I love to hear our room has such a huge emotional benefit
 
@O0oO0oOO0ooO whispers They're everywhere! looks behind him
 
10:52 AM
@OctavianDamiean neonmob.com
 
Ah yea, that. Cheers.
 
ok, I'm not being refreshed anymore
 
user1125394
!!c> (f.toLowerCase() for f in ['Foo','B']; console.log('test'))
 
@xcx "b"
 
@OctavianDamiean its a 'login each day' kinda site for the rewards.
 
10:55 AM
@xcx "b"
@xcx "undefined" Logged: "test"
 
@mikedidthis I kinda enjoy the artwork.
 
@OctavianDamiean yep, the artwork is amazing. Currently collecting: neonmob.com/profile/mikedidthis/collection/?set=14
@JanDvorak another 'login each day' reward! :)
 
user1125394
men seriously I'd love to get the matches as the 4 lowercased colors in "red GreenyellowBlue".match(/([^\w]*(blue|red|yellow|green|purple)?){4}/i) any idea please?
 
"4 consecutive"
goddammit, you weekends
 
10:58 AM
@xcx Wat!?
 
@xcx uh, matches[1].toLowerCase() ?
matches.map(function (s) { return s.toLowerCase(); })
 
user1125394
@Zirak the 4 separated
 
huh? what's the expected behaviour?
What are you trying to do?
 
user1125394
I only get the original string, and in [1] the last match I guess
 
11:00 AM
0 is the entire match, the rest are capturing groups
 
guys, could you please click that link? I need to collect pictures
 
user1125394
@Zirak parsing it to ['red','green','yellow','blue']
 
user1125394
or whaveter case,, I can lowercase after of course
 
So string.match(/red|green|yellow|blue/gi)
And you can do length checks after that
 
user1125394
hmm, k, simply... thanks Z
 
11:04 AM
Enjoy
 
Blender, see the comma after n1 declaration. n2 is not global. — rlemon 3 mins ago
I hope he just didn't see it, I would like tot think with 80k rep that he doesn't think I have to var them all
 
@rlemon y u no indent properly?
it really is kinda hard to stop this way
 
Seeing Blender several times before, he's not the most colourful crayon
2
 
What you mean? Looks fine to me
 
var n1 = "something",
    n2 = "something else";
 
11:08 AM
Ohh, that's the editor I was using auto formatting
I should fix that
 
oh, and "stop" should be "spot" in my last message ;)
 
Lol oooooooooo OK makes a lot more sense now
 
@Zirak hah, what a beautiful expression.
 
hi guys... how to create concentric divs? given the inner div?
 
:968948 I am sooo stealing that one.
 
11:11 AM
Why do this match
"http://rgr-ashley.vertica.dk/us/en-us/search#!/q=/test".match(/q=\/([^/]*)/)
 
@rlemon figured after re-reading it that it could cause some confusion ;) (what the hell is wrong with my typing today)
 
while this one doesn't
"http://rgr-ashley.vertica.dk/us/en-us/search#!/q=/test".match(/\!q=\/([^/]*)/)
(I can't seem to be able to add the initial ! in the pattern)
 
@dystroy You're missing a slash.
 
@OctavianDamiean Damn.... Thanks
 
!!> "http://rgr-ashley.vertica.dk/us/en-us/search#!/q=/test".match(/\!\/q=\/([^/]*)/)
 
11:13 AM
@OctavianDamiean ["!/q=/test","test"]
 
Time to coffee, obviously...
 
:)
@rlemon Did that for you.
 
String.prototype.every = Array.prototype.every;
var isNumeric = function(x) { return x.toString().every(function(c) { return c >= '0' && c <= '9'; }) }
 
@copy and the dot ?
 
Todo: Emtpy String.
Shouldn't be accepted
 
11:19 AM
<div id="outer">
<div id="inner">
</div>
</div>
how can i make the outer div (some height and width )concentric? without css
 
@rlemon I've also renamed the function to isNaturalNumber to convey its meaning.
@Amitd I guess you'll have to be more specific about that.
 
how can i make the outer div (some height and width )concentric? without css
srry abt that
inner div has some height and width
now i need to make the outer div concentric with some height and width
 
lol
 
This history guy became a popular meme :)
 
11:33 AM
NO SHIT SHERLOCK
 
@SomeKittens Man. I'd code an adventure game in Prolog, where your decisions along the way are of significant emotional impact. And the climax will be a coin flip.
 
btw. @rlemon how is +42 not a natural number? The positiveness of a number doesn't make it less natural.
 
Why would op want to accept +42 or 1.0 or 0xdeafd00d
 
Well, don't know, I'm just saying that the function doesn't work the way it should if it evaluates +42 as being non-natural.
Which it clearly does.
 
I get this message in the console in Firefox:
> [13:40:18.614] The Web Console logging API (console.log, console.info, console.warn, console.error) has been disabled by a script on this page.
Not sure what is causing this
Maybe a plugin?
 
11:41 AM
8
Q: Firefox Web Console Disabled?

yeeenHow come I get this message from Firefox Web Console The Web Console logging API (console.log, console.info, console.warn, console.error) has been disabled by a script on this page The same webpage can print messages in Chrome Console but not Firefox. I opened the same webpage in another c...

Make sure to read the comments as well.
 
What the... ?
I'm not redefining console.
 
Read the comments.
 
Firebug apparently
 
@yeeen Do you have Firebug installed? It also overrides window.console with its own console... — Boris Zbarsky Nov 22 '11 at 3:47
Yup.
 
12:00 PM
@Mvision 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.
 
/\<body[^\>]*\>([^]*)\<\/body/m I must be blind but what the hell did i forget to escape here? it works like a charm on all browsers except < IE8
"SCRIPT5019: ']' wordt verwacht in reguliere expressie " (dutch for , expected in regular expression) .. this doesn't really deserve its own stackquestion methinks
 
oh god i've been laughing for 2 minutes with that answer
 
@OctavianDamiean see the comment I left to Benji, he doesn't want real natural numbers.
at least, that is what it appears to be
 
@Mvision If it doesn't get an answer here, it might deserve its own SO question. And as I'm curious I'd be grateful for the link
 
12:07 PM
Didn't I already solve that question with a 1 liner yesterday if he meant natural numbers, and then say OP probably wants what @rlemon did because he's likely validating user input, and rare are the cases your users enter 1e5 and mean 10000
@dystroy That's not very nice :P
@copy Why? JavaScript considers empty string to be 0
 
@Mvision Is that normal : [^] ?
@BenjaminGruenbaum What ? What's not nice ?
 
@dystroy He's parsing HTML with regex, if he opens an SO questions he's going to get the downvotes of a lifetime :P
 
Oh dang, I didn't bother reading the comments above. :(
 
@BenjaminGruenbaum ... well... there should be some precautions done when asking but I'm tired of the pavlovian answer we get sometimes... that's like the downvote or stupid comment on any answer containing eval
 
@dystroy It's correct in this case, @Mvision 's regex breaks pretty easily :)
0
Q: Make Rotating Jquery clock with HTML

user2432324I need html code for Rotating Jquery clock for integration in Free Wordpress blog widget. Please reply me ASAP.

^ also
 
12:10 PM
@BenjaminGruenbaum that's not the problem, the problem is why different in ie
But I think the [^] is wrong
 
After I write you this code, would you like me to code the rest of the site too? What about hosting? Would you be requiring that as well sir? — Benjamin Gruenbaum 17 secs ago
 
Okay, so i get that i maybe shouldn't be parsing html with regex :) [^] means "any character set not matching the empty string)
 
@Mvision . means any character and doesn't match the empty string, what are you really trying to do?
 
> [^] means "any character set not matching the empty string)
 
basically it avoids matching content from an empty body tag <body></body>
 
12:11 PM
What ???
 
0
Q: Dynamically creating concentric div given the inner div

AmitdI have 2 divs as : <div id="outer"> <div id="inner"> </div> </div> The inner div has some fixed height(H) and width(W) . Initially the "outer" div doesn't have width and height.Also has same top and left values.(same origin) How can I create/place a concentric "outer" div (or mak...

 
Use this : ([^<]+)
 
@Mvision What are you really trying to do?
 
user image
2
 
12:12 PM
BatBenji!
 
@rlemon lmfao
 
@BenjaminGruenbaum You have something on your back
 
It looks like a monkey ... -> []
 
> Can I ask you something I always wanted to ask the real Batman?
 
Basically there's an ajax call made to a server I don't control, and I want to remove everthing except the content of the body tag, it's experimental i know
var reg = /\<body[^\>]*\>([^]*)\<\/body/m;
var everythingexceptthebody = entirehtmlstring.match(reg)[1]
 
12:15 PM
yucky
 
just create a fiddle with what you have done yet — Rohit Agrawal 56 secs ago
I told you just that.
 
Also... [^] ? wat? That's a really stupid way to say . (the dot, i.e. anything)
 
@BenjaminGruenbaum watch your six!
 
allright so originally I tried something like $(entirehtmlstring).find('body').html() but that just didn't work at all, so I switched to someones regex I found here... what's the approach you guys would use to just get the body html? thanks for the many responses:)
 
@Mvision And you're using jQuery ?
 
12:17 PM
yup
 
@Zirak Woah! I don't know how it got there :O
@Mvision let's say your AJAX page is test.html ok?
$("#WhatYou'reLoadingInto").load("test.html body")
that would tell it to load the body content of test.html into a div with that ID
No magic regex
 
@BenjaminGruenbaum I've heard of the phenomenon before. It kind of grows on you.
 
@OctavianDamiean Woah
 
He wasn't on guard, that's what happens when you're not on guard ...
 
@OctavianDamiean ...he exclaimed, after noticing how the watches' six was shaking with fear
"What happened!?" the watch asked his six
 
12:21 PM
@BenjaminGruenbaum aha I didn't know that was possible with jquery load, worth looking into that...!
 
"It's 7...the horror...he just...and 9..."
 
@Zirak fyi, var reg = /\<body[^\>]*\>(.*)\<\/body/m; with the . instead of the [^] works perfectly thanks for that
 
@Mvision You still shouldn't use it
 
every time I post a regex to this chat the whole freaking chatbox starts spitting out animated rotating letters :D:D
 
12:22 PM
@Mvision you can't parse HTML with regex in JavaScript, for every regex you find I can find a case where it doesn't work.
 
Yeah, because it's trained to catch html matching regexps and tell you you're insane
I'm serious
 
LOL
 
@zirak I just noticed you are the controller of this board :)
 
I thought it only worked as a global function :-)
 
@Mvision Yep, that's him
-25
Q: Can the abuse over regular expressions to parse HTML stop?

PP.I'm getting sick of it. Can we please start suspending people that say "don't parse HTML with regular expressions"? While it may be good advice it isn't necessary on EVERY question that involves regular expressions. If n00bs want to learn regular expressions then they should be given good answe...

 
12:28 PM
He lost all the points which he got from previous question
sad :)
 
From a jquery standpoint you could do that as well. — Judson Terrell 6 mins ago
wat?
 
A jQuery standpoint lol
 
@AlexisChevalier 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.
 
@OctavianDamiean wait. wat?!
 
12:43 PM
@OctavianDamiean Am I missing something here: jsfiddle.net/mikedidthis/8WKAH
@RyanKinal beat me too it!
 
@VladTsepelev 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.
 
@mikedidthis Holy crap.
 
:ninja'd:
 
I really wish people would look at CSS before using the word 'jQuery'.
 
Agreed
 
12:46 PM
@mikedidthis explain?
briefly..
sorry, I just walked in...
the two are very much in cahoots
 
use CSS if CSS is capable of providing a solution to your problem before solving it with JavaScript
 
for that matter, it's a love triangle.
 
@skopp no probs. Lot's of layout issues can be resolved with just CSS. People are too quick to say, I can't do this with CSS, so... JQUERY!! But most of the time, they haven't exhausted solutions using only CSS.
 
You know, I hear people say IS's are the satan!!
 
12:48 PM
and then I see renowned lecturers using them
some sparingly
 
what's IS?
 
@GNi33 that summed up what I was saying, much better than I did. :)
 
others like they get a sick pleasure out it
with the !important magic spell too
 
@skopp if you don't say what IS stands for in 10 seconds, I bin all your messages
 
12:49 PM
^
 
are you talking about ID's ?
 
@mikedidthis jsfiddle.net/X3GHW that's what I had in mind, but yours is more elegant.
 
@FlorianMargaine you'll be helping me carry my shit home
 
@GNi33 that'd make sense.
 
o.O
 
12:50 PM
:D
 
@skopp ???
 
yesss
yes.
 
Seriously, wtf is an IS?
 
@OctavianDamiean still nice though. Sadly he didn't want height / width on the outer.
 
:\
 
12:50 PM
@RyanKinal looks like it's an ID.
 
@RyanKinal He's talking about IDs
 
@mikedidthis Oh crap, he didn't?
 
um... hold on...
 
@skopp IS == ID?
 
2 mins ago, by skopp
You know, I hear people say IS's are the satan!!
 
12:51 PM
^ that looks like a messed up penis.
I don't mean @FlorianMargaine btw.
 
@mikedidthis ... thank you very much.
 
Dayumn, I should read more carefully.
 
@FlorianMargaine timing is everything :)
 
Assuming he's talking about IDs... they are, in fact, satan (when it comes to CSS, at least)
 
12:51 PM
@mikedidthis your comment is antisemitic.
 
I hate jQuery answers to JS questions -_-
 
@RyanKinal mmhmm
 
@dystroy how so?
 
</joke explainer>
 
12:52 PM
they can only be used once-ish
 
@BenjaminGruenbaum dude. Knockout everywhere.
 
just like a cut-pen is
@dystroy YOU!!!
 
@skopp Not once-ish but once.
 
@RyanKinal not always.
 
Please don't answer with jQuery to non jQuery questions, we're trying to teach people how to use the language here, not how to use a library. OP would have to import 80KB of code just to increase a counter which sounds absurd. Moreover, you do not cache your selectors, and you treat the DOM as a source of knowledge. — Benjamin Gruenbaum 4 secs ago
@FlorianMargaine What can I say, I love it :)
 
12:53 PM
@dystroy I didn't even think of it that way. :(
 
@mikedidthis I know
 
@dystroy you... you're the Narwhal Joker from RedditChan...
 
i don't remember him saying increment in minus — Rohit Agrawal 1 min ago
hahaha, it's revenge there
 
@FlorianMargaine There are, of course, exceptions to the rule. But every time I come across an element I need to reuse that's styled with an ID, or a style I need to override that uses an ID, I die a little.
 
@skopp no, I don't joke on reddit. A lot.
 
12:54 PM
@dystroy i know.
i doubt many SO peeps use that crap
 
although we've probably been there
down that alley
 
+1 it's a long answer
 
Hey guys is there a way to bind a knockout viewModel to a jquery UI tab?
 
@mikedidthis jsfiddle.net/X3GHW/1 borrowed an inline-block from you.
 
12:56 PM
@BenjaminGruenbaum for you ^
 
@SnakeEater Hey
 
@OctavianDamiean borrow away, also nice :)
 
@SnakeEater Knockout's applyBindings accepts a second parameter dom selector
 
@BenjaminGruenbaum what about a third?
 
I'm happy, I got in to Stack Carreers 2.0
 
12:57 PM
@SnakeEater Huh?
 
[retracted - wtf kind of a word is that] on me
 
ko.applyBindings(p.viewModel, p.view);
currently using that, could I have a third param?
 
@skopp Can you stop now, or do we need to turn this room into a gallery?
@SnakeEater what's p.view?
 
!!/info
 
` page.on('page:view:created', function(p){
ko.applyBindings(p.viewModel, p.view);
});
`
 
12:58 PM
@JanDvorak I awoke on Wed, 29 May 2013 07:30:40 GMT (that's about 5 hours ago), got invoked 16 times, learned 93 commands
 
@BenjaminGruenbaum stop what?
 
`page = new app.Page({name: 'policy'});
app.pages[page.name] = page;`
 
@SnakeEater p.view is a selector?
 
@skopp Your randomness is just crazy.
 
Bot is up, we can start muting
 
12:58 PM
Yes it is
 
@SnakeEater then I don't get the problem, why not apply to the selector of the jQuery UI tab?
 

« first day (956 days earlier)      last day (4006 days later) »