« first day (1013 days earlier)      last day (3921 days later) » 

9:00 AM
It seems compile actually destroys regexp
 
In fact this is simply a stupid function
 
room topic changed to JavaScript: Where a (rude) black rectangle got two stars (chat.stackoverflow.com/transcript/message/10822021#10822021) Room pseudo-rules: rules.javascriptroom.com [2.9] [consistency-of-suckiness] [ecmascript] [freedom-croissants] [javascript]
 
@Mr_Green it's a regex builder, it doesn't compile the receiver (this) regex
 
@whyAto8 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:02 AM
@dievardump That's BS.
(The question).
 
yeah
 
@BenjaminGruenbaum let's close it, but with what exact reason ?
 
"off topic, because it describes a problem which doesn't exist"?
I'd wait for OP's response
 
@dystroy Let's wait for a bit.
 
I voted to close because the problem didn't include a reproducable (f... what's the word?) code
 
9:05 AM
reproducible
 
going back to my pluche !
 
Nope, can't reproduce . Please verify that your self contained code example is correct before posting a question. — Benjamin Gruenbaum 16 secs ago
@FlorianMargaine @FlorianMargaine nope ^
Oh wait, that was a reply, sorry
I CVd
This question appears to be off-topic because it contains an incorrect self contained code example whose claimed output can not be reliably reproduced. — Benjamin Gruenbaum 9 secs ago
 
o/
 
9:12 AM
@BenjaminGruenbaum wat
 
Hi , right now i am able to remove bootstrap modal dialog using ok button only . I should be able to dismiss it by hitting the enter key or escape key. Currently the only way I can dismiss it is by mouse click. any one having idea ?
 
@AvinashGarg Did you read the manual? Did you create a self contained example to show? Did you check the debug console and try traditional debugging techniques?
 
@BenjaminGruenbaum Traditional debugging technique No. 1: Join SO chat and ask someone to debug your code.
 
@JohanBouveng 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.
 
Hi!
Can you do code formatting for a one liner in here?
 
9:17 AM
Yea.
 
How? I cant see a legend of acceptable formatting stuff somewhere =)
 
Thanks, same as on the q&a site.
 
wth? That answer is incomplete!
But yea, we have back-ticks based inline code formatting and four space multiline code formatting.
 
eval("var " + foo + "= new bar()"); why on earth would someone do something like that?
 
9:19 AM
The latter can be triggered by the Ctrl + K shortcut.
@JohanBouveng Because that someone doesn't really understand JavaScript.
 
Yes. Haha. I'm doing a code audit at a very large company. They have this web app that is soo sloow, and I find so many stupid things all the time.
eval("window.foo=function(" + args + "){" + str + "}") stupid right?
 
Consider yourself lucky : your audit will be easy to do and will produce significant results.
 
Question, I'm searching for buttons that I can put in a form like u have 3 buttons and u select one whats that called xd
Like T1 T2 T3 and u choose one of those 3
 
radio buttons ?
 
@dystroy yeah.. 17 pages now.
 
9:22 AM
No radio buttons, like real buttons lol
Similiar to radio buttons thou
 
It is radio button functionality you are after.
If only one can be chosen.
 
Yes ^
 
So, use radio buttons, then style them as furry cats =)
2
 
0
A: getJSON with reload functionality

SpokeysetTimeout(function, ms) Example setTimeout(get_stuff(page), 1000) // the function will be executed after 1 second

And someone upvoted the answer
 
9:24 AM
@JohanBouveng I like that idea.
 
I want that but in a post form
Thanks guys ;-)
 
@Tredged wrap it in a form then!
 
Screw flat UIs, no Sir, we're presenting fur UI.
 
Yea :)
 
@dystroy Also, they are doing synchronous ajax request many times..
References to document.* 210+ times.
etc.
:D
 
9:26 AM
@draconis 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.
 
@JohanBouveng That might be because they didn't grasp the deferred concept.
 
What do you guys like the less known methods for string? Like: "johan".link('google.com');
 
didn't know that one
 
But I don't think I'll ever use it
 
"im bold!".bold();
Nah. But its cute.
 
9:30 AM
what's the browser support? mdn doesn't say
 
Prob all of them, this is old stuff.
 
Non-standard. So it's badbadbad
 
Returning HTML like that seems old school.
 
very old school. Especially as there's no way to add attributes, class, target, etc.
 
9:31 AM
still, it's cool.
 
@FlorianMargaine Hu ?
 
yeah
as in, hipster.
 
ok...
 
` for (var i = 0; i < arr.length; ++i) {
with(arr[i]) {`
oh, didn't work.
wonder why their app is slow.
 
9:34 AM
:O
inspector gadget
 
1/ the "I come to break your face" anime effects are... really strong
2/ build high quality web by setting a decent line-height for your title, please :p
 
@FlorianMargaine Yea, 1993 hipster. :P
 
0
Q: Redirect careers.stackexchange to careers.stackoverflow

Benjamin GruenbaumI found myself going to http://careers.stackexchange.com/ when meaning to go to http://careers.stackoverflow.com/ several times. Now it might be just me, but I think it would be nice if careers.stackexchange would redirect to careers.stackoverflow or at least contain a 'did you mean?' bit.

 
@dievardump It was really hot 2008!
 
Got there when working on something for the room :)
 
9:36 AM
@OctavianDamiean more 1995 or 1996
 
line-height: 1.[1-3]em; is pretty universal
 
@SomeKittens That is such an awesome resource!
 
careers are just careers.. isn't it?
 
@dievardump Ok, I'll fix the line height!
 
@Amaan that's goind all around the web these days. Crazy
 
9:37 AM
Asking a question in the room - regulars please read and comment - what would you change? What should be added?
11
 
Search* Google
> I asked a question and didn't get an answer, may I repost it? No, you may not. If you do it will get moved to the trash can as well as your original request for help.
I don't agree with that the way it is framed
 
@BenjaminGruenbaum You're mixing past and present tense.
 
This is the first draft, this is why I'm asking for suggestions :)
 
I think it's okay to ask again as long as the person's waited a suitable amount of time
 
@BenjaminGruenbaum I think we should warn people that we can have a weird humor and are the rudest bastards in the world.
 
9:39 AM
@dievardump Now its 1. :P
 
@Amaan how would you frame it?
@OctavianDamiean where?
 
Better.
 
@dievardump that. Plus off topic happens alot.
 
@dievardump read the last q in the faq :)
 
@BenjaminGruenbaum Second point in the FAQ, you can repost after a reasonable amount of time has passed.
 
9:40 AM
@BenjaminGruenbaum in the bullet points that describe what increases your chance of getting an answer.
 
@BenjaminGruenbaum Not sure. It actually depends on whether people in here agree with it being okay or not. To me, it's okay if people have waited for, say, 6 hours before asking again
 
@dievardump What about the animation? :D Its just 1.679kb for the anim lib. :))
 
@BenjaminGruenbaum I read it, and think it's not enough "we speak about JavaScript sometimes. We help when we can, we will certainly talk about your sister and you probably will be mustachified if you come"
 
Fair enough.
@Zirak Phrase it
 
And you make "regular" sound like some special privilege
 
9:41 AM
> However, if you have a lot of questions and no answers, that might.
Add that comma
 
Can we add something about pinging, or more so pingin others to get help is a no no?
 
@Zirak regular is pretty much everyone who sticks here for more than 2 days .
 
@mikedidthis Good idea.
@OctavianDamiean Yeah, d is right next to s :)
 
@JohanBouveng parseEl.innerHTML = '<div style="'+style+'"></div>'; ewwwwwwwwwwww, now because of you I will have nightmares for 3 or 4 days
 
9:43 AM
@BenjaminGruenbaum "[...] may I repost it? Yes, if a reasonable amount of time has passed. Spamming will just aggravate everyone and reduce the chance of intelligent conversation."
 
The only other thing I can think about is mentioning new users are more than welcome to join, help and get involved in on / off topics.
 
THANKS MAN
 
Maybe a "don't be a dick"
 
@Zirak That's room rules. I just want something to send users who ask badly here.
 
Or "try to only be a dick when we deserve it"
 
9:45 AM
That's quite generalized, innit?
 
Yeah, we always deserve it.
 
@Zirak Congrats!
 
@dievardump ehhee where did you see that?
 
@Amaan ISN'T IT AWESOME!? It might just be Waters, but it's The Wall! Aaannd, Gilmour made a bigass surprise appearance in 2011, so I'm going to learn how this praying thing works.
 
9:48 AM
Hahahaha
 
0
Q: Jquery doesn't display slideshow correctly

ShaySo I have this website http://respectyourfriends.com/ I was trying to implement a Jquery slideshow (inside the computer screen), but for some reason, it shows all the images together, instead of showing it like here: http://respectyourfriends.com/Slider/ I spent 2 days on this stupid thingy. An...

Let's not encourage remote debug
 
@dievardump well, seems like a small nice way to do it =) Here, take a 1x1 blank pixel as a gift: ´image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==´
 
@BenjaminGruenbaum How's the monster slaying going?
 
@JohanBouveng small nice way ?
parseEl.innerHTML = '<div style="'+style+'"></div>'; is a small pretty ugly way to do things.
 
@dievardump elaborate on what he is doing there... its a bit over my head.
 
9:52 AM
But thanks for the gift ♥
 
@dievardump or why he is doing it at all.
 
> I'll keep this as short and brief as i can:
Should be.
> I'll keep this as short and brief as I can:
@JohanBouveng ^
 
function normalize(style){
    var css, rules = {}, i = props.length, v;
    parseEl.innerHTML = '<div style="'+style+'"></div>';
    css = parseEl.childNodes[0].style;
    while(i--) if(v = css[props[i]]) rules[props[i]] = parse(v);
    return rules;
  }
the entire function is crazy.
the guy is adding some style as a string then taking back the string and checks if the properties are applicable to it. That's... ewww
the properties are applicable = the properties his library allow to animate were applyed
 
okay, but there must be a reason.
he is not stupid. its Thomas Fuchs library. =)
 
heh
 
9:59 AM
@JohanBouveng Thomas Fuchs is... ?
 
he wrote scriptaculous
 
not a too big fan of him
 
 
So. he checks if his string of animatable properties are applied to the div?
 
10:01 AM
he has had the "I'm super-duper-awesome" - attitude to him
 
Fuchs did incredibly much for the whole interwebz, especially webdev
 
at least i felt like so
 
@JohanBouveng For me, the problems essentially come from the way he does it.
 
@dievardump that little lib is part of a speech on animation with javascript.
 
yeah, he is no idiot, that's for sure
 
10:02 AM
@dievardump i just want to understand why he needs to do it, why its done like that, and how it could be done instead.
 
never met him in person, which is a shame actually
 
@GNi33 sup bro!
 
why?
 
@JohanBouveng so you can pass a style string (sigh) to the emile function. There he just takes, from the style string, the styles his library can animate. In order to do it, he (for me in a bad manner) creates a div element and set the given css properties to it and filter just the ones he can animate
 
@OctavianDamiean tired as hell, and in front of a pile of tickets i can't reproduce
but other than that, I'm fine :)
 
10:04 AM
@dievardump Ok. But why does he need to check if they are applyable?
Here is the talk btw, it was really interesting: mir.aculo.us/2009/11/07/…
 
You're using my work every day, even if you're not aware of it.
 
@GNi33 :(
 
his "normalize" function just filter the properties and normalize the values.
 
@Mr_Green aha? what? =)
 
Quote of thomas fuchs in his website
 
10:07 AM
ah, ok.
=)
 
you thought I am saying about me right?
:D
 
Yes.
@dievardump He actually explains that function on slide 46 here: slideshare.net/madrobby/…
 
That's what I said.
but parseEl.innerHTML = '<div style="'+style+'"></div>'; is just ugly as hell
innerHTML to create a div. then css = parseEl.childNodes[0] to get it back. And am not talking about the fact he want the css to apply as a string.
 
AND
This is not a JavaScript animation Framework
A JavaScript Animation Framework can animate things, not only css properties of HTML elements.
I need to close this tab or I will never finish my work
SO is really time consuming.
 
10:21 AM
A racist programmer
C_ To a stranger : "Dude you.... you are #000"
Stranger : "A what?"
C_ : "Blaaaaaaaaaaaaaaack"
 
@Darkyen Meh, I'd say you're more like #7B6A56.
 
lol
thats far from #7b6a56
u know :->
 
@JohanBouveng what are you trying to do anyhow? that framework is pretty old, right?
sorry, pinged the wrong person
there are animation-frameworks like anima.js out there now, that make use of css3 - transitions and such
 
funcA( funcB( param ) ) or funcA(funcB(param))?
 
I lean towards the first version.
 
@OctavianDamiean Depends on your overall spacing scheme.
 
@OctavianDamiean first for me.
 
@Zirak I'm just trying to figure out which one to pick for readability.
 
What I have for the bot (which is something I've since been drifting apart from) was a bit weird: I only padded the most wrapping call.
So: funcA( funcB(param) )
 
10:36 AM
^ i do it like that too
although, I'm not a great reference when it comes to nice spacing schemes
 
I found that to be much more readable, but as mentioned, I've been going to the more mainstream "no padding".
 
Mostly, I just do it how I feel like
 
"abc{replaceme}xyz".replace(/replaceme/g, "2$$$s")
 
@phenomnomnominal I'm aware. I was trying to point out the flaw in the code, not re-write it to make it beautiful. What would be a better way of pointing that out?
 
strange output
only two $'s instead of three
 
10:37 AM
Someone hasn't read the docs
!!tell Mr_Green mdn String.replace
 
Double dollar-sign turns into a single dollar-sign.
 
Mhmm
funcA( funcB( param ) )
funcA( funcB(param) )
 
ohh
 
@dievardump Oki! Just curious!
@GNi33 I was just curious, played with it 4 years ago.
 
10:48 AM
Guys, a hand please? Im writing a js simple simon game and im clueless on how to do it.

I know that :

i need to create two arrays, and a level(score) variable
A randomly generated number from 1 to 4 (inclusive) needs to be added to the first array,
When one of four buttons is pressed, the value of it is added to the second array, if the second array is not the same size or bigger than the first array.
Each time a value is added to the second array, check that the value is equal to the value in the same position in the first array, if not, clear both arrays, and set levelvar to 1, and ale
p.s. simple simon, is the game with for lights, and you have to follow a sequence, which gets longer and longer
 
You pretty much described that in code.
 
@deep You just wrote how to do it en pseudo code!
 
You don't really need the 2nd array, since you don't really care what the user did before this move.
 
I know, but how would i differentiate the four butons, ass soon as i have four butons appending to an array, im off, but until then im stuck
Why not?
 
@deep Start by making a fiddle at jsfiddle.net
 
10:53 AM
surely i would need it to compare
Jsfiddle? or my site?
 
@deep You have this online?
 
@Johan, i have a Online Development Environment, and web hosting.
(removed)
MAn, i hate 5kbps internet
 
:-( git why u so bad
 
Me has fiddle, how me save?
and show you?
 
11:00 AM
click on save?
 
i know, that's not very straightforward, but...
 
-1
Q: Java script does not work

BesoI am implementing photos.php that display photo and has infinite scrolling feature by using html,php,js,ajaxs photo.php page <!DOCTYPE HTML> <html> <?php include($_SERVER[ "DOCUMENT_ROOT"]. '/db.php'); $query11="SELECT * FROM photo ORDER by PhotoNo DESC " ; $result11=m ysql_query($que...

 
11:01 AM
I decided to go with a one space padding on every parentheses.
 
@rlemon gotta love "wall-of-code" - questions
 
any UI for jquery?
 
21
A: Expire cache on require.js data-main

JBCPHow are you defining your require.config? I think for it to take effect before you import require.js, you need to code it like this: <script type="text/javascript"> var require = { baseUrl: "/scripts/", waitSeconds: 15, urlArgs : "bust="+new Date().getTime() }; </...

anyone with an idea for me why this doesn't work?
 
@Dileephell Eh?
 
it just appends the bust-param to the module-name, which causes the call to fail
 
user1125394
11:05 AM
1000*(UNIX_TIMESTAMP(least(now(), adddate( ct , 28 - dayofmonth( ct ) ))) - UNIX_TIMESTAMP(least(now(), adddate( ct , 28 - dayofmonth( ct ) ))) % 86400) there might be easier if you feel pity for me
 
user1125394
(basically just getting a end-of-month date (in unix timestamp*1000) or today
 
if you have a global array, and you add something to it in a function, can other functions access it?
 
@cx I'd recommend moment.js
 
user1125394
@OctavianDamiean joking or rly?
 
I'm serious.
 
user1125394
11:06 AM
will see ok, thx
 
0
Q: When to use event.initMouseEvent for simulating mouse clicks?

Protector oneI wonder if there are benign use-cases for simulating mouse clicks using event.initMouseEvent. I found that it is used for creating pop-under ads in the following way: var e = document.createEvent('MouseEvents'); e.initMouseEvent('click', true, true, window, 0, 0, 0, 0, 0, true, ...

 
!!/google js append to array
 
array.push("whatever")
 
I'm not sure if that was what you were asking, anyway, it works but it sounds as if you're trying to do something wrong there.
 
11:13 AM
@BenjaminGruenbaum The page you showed us yesterday.
 
Pow! How d'you like me now?
#ERB
 
blegh
 
How do you contanly check without using while (true)?
setinterval?
 
user1125394
damnit jsFiddle alert on pageclose :-<
 
it thinks we are noobs
 
11:21 AM
0
Q: Comparing a color range using either hex or decimal in javascript

FeathersI am extracting the main color from a picture, and then want to call a different function depending on whether it is red, blue, green, yellow, purple etc. (the more options I can have, the better). So what I would like to be able to do is: if(color < maxColorValueRed && color > minColorValueRed)...

Is it me or hexadecimal as string are totally comparable ?
 
hi, I have this string: "example tabdef sample 1moreSample tabAbc saaampplee" - how can I get the Strings "tabdef" and "tabAbc" via regex now?
 
like... hexa is from 000000 to ffffff so it should be easily comparable, na ?
 
@fnkr why do you want tabdef and tabAbc ? because there is tab in it ?
 
dafu...?
 
11:24 AM
yes
because it starts with tab
 
Why don't you tell us that ? Why do I need to ask you the question ?
 
0
Q: How to make a Simon Js game based on arrays?

deepIm writing a js simple simon game and im clueless on how to do it. I know that : I need to create two arrays, and a level(score) variable A randomly generated number from 1 to 4 (inclusive) needs to be added to the first array, When one of four buttons is pressed, the value of it is adde...

 
@deep Your question will be closed, it's not asking anything
 
Oops.
 
@dievardump sorry
 
11:25 AM
@fnkr You want to match tab followed by word characters?
 
@Zirak yes
 
\w denotes a word character, \w+ means "match 1 or more word characters". That should get you started.
 
@Zirak thanks, tab(\w+) is working!
 
done @zirak
 
@fnkr Enjoy
@deep Now your question is just...javascript 101
 
11:28 AM
?
 
And the question has nothing to do with the question body
 
it does.
 
Your actual question is "how do I compare an array item with something", but your question says "I want to make a Simon game, here's some information and code"
 
hrmmm. How should i fix it?
 
@Deepika 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.
 
11:30 AM
Edit your question so it's just your actual question.
 
user1125394
@BenjaminGruenbaum the bot could filter newcomes ? messages :p and redirect them to this
 
user1125394
s/comes/comers
 
whats wrong with this? y.push(Math.floor((Math.random()*5)+1);)
 
user1125394
;
 
My god. I just discovered JavaScript TypedArray endianness is unspecified... This makes them so useless...
 
11:36 AM
@deep Besides the fact your variable is named y?
 
what wrng wih that?
 
anyone know how to set background image for all mobiles .if i resize the window then also i can view the full image .i gave background-size:100% 100%; its not working .
 
height:100%, Width:100% may do the trick
 
@deep It doesn't say what that variable is.
What's y? I don't know.
Is it an object containing ice-cream? Is it a bowl of spaghetti? Is it an array of your relative's names?
 
okoki get thpoint
 
11:39 AM
oh god, Varnish, you son of a motherless goat!
2
 
how do you get the index of the thing you just pushed?
 
arr.length - 1
 
@deep Really? Really, deep?
 
Nobody will be interested by this note but I don't like to let wrong comments pending : It's possible using a DataView in some browsers to build TypedArray with specified endianness. Why did you read that, I'm the only one here concerned with byte order...
 
11:45 AM
!!tell deep mdn Array.push
 
arr.push(something) - 1
 
? it aint that obvious
 
@deep It is, once you read the fucking manual.
 
lets read the fucking manual.
 
11:47 AM
Good idea.
The summary alone would have told you already.
> Mutates an array by appending the given elements and returning the new length of the array.
 
yh i no
var last = arr.push(red) or whatever?
 
Whatever.
 
array index is 0 based
 
@SimonSarris: http://stackoverflow.com/questions/17857116/does-javascript-object-initialization-time-depends-on-number-of-variables-and-fu

This one may be for you
 
Looking at it again...it looks like I'm shaking tinker.io/a4d8e/3
 
11:50 AM
@Zirak Stop lying, nothing's shaking.
 
well the top+1 left+1 looks like walking up stairs movement
 
Ok, what the hell? What movement?
 
Completely Static. What the hell ae you guys talking about
 
hmm
anyone else experiencing the dev-tools crashing on large minified script-files lately?
 
11:54 AM
@OctavianDamiean like.... the big yellow head that's moving around?
@dievardump awesome!
can't understand anything :P
 
A French small company invented a Photo voltaic transparent film that will be put into mobile screens and will be able to entirely charge a phone in 6 hours, using solar battery energy. The cost is estimated at 1euro per phone, so nothing
 
but there's a picture of McGyver, so.... super awsome!
@dievardump what? that sounds amazing
 
looks very promising
 

« first day (1013 days earlier)      last day (3921 days later) »