« first day (953 days earlier)      last day (4220 days later) » 

15:00
@JanDvorak is this a valid object declaration...
var obj{
num1: 5;,
num2: 3;
}
@Arbaaz you're missing =
And omit the semicolons
Please pick up a javascript tutorial
also, remove the semicolons ninja'd
@JanDvorak you are probably right, i should. btw thanks !
sorry i mean @Zirak
Enjoy
15:17
@Zirak I'm wondering if "avoid w3s*****s at all costs" should be an integral part of the room rules
Do a pull request to the room rules
@Zirak, the bot should censor all references to w3schools :)
Or better yet, replace with a link to w3fools
Even the ones condoning it?
the bot should respond "don't ever say "w3schools" out loud! It's a terrible website!" whenever the site is mentioned
And it should get more violent, the more times it is said within a period of time
15:24
I got 100% on the Javascript quiz on w3schools, does that make me a web master
Everybody knows the proper way to make an array is var asd = new Array('asd', 'dsa'); god so noob
The array constructor is so retarded
lol
I was looking for = []; couldn't find it :/
!!> new Array(2, 2);
@phenomnomnominal [2,2]
!!> new Array(2);
15:26
@phenomnomnominal ["undefined","undefined"]
So stupid.
hehe, when you leave, mit-scheme says "Moriturus te saluto."
!!/translate
@XCritics Command translate does not exist.
15:29
Well, it should
-
@XCritics '@Zirak, I would like a translate command if you would please.'
Go right ahead
My pull request doors are always open
Damit she echos my name
You are not exactly a master of disguise
15:31
Especially since you pinged me in the original message...
I just had to be quick :D
Just took a nap thought it would be close to twelve, in reality it was like 15 minutes (9:30)
@XCritics, you should add some Web Speech API functionality to it
Sleeping at work !== Sleeping at home
I need a super low res representaion of a world map if anyone has one
Let me open up minecraft, might take me a while
15:33
@HasnaeIdem Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
What about googles 8-bit map they did for april fools, if that's still around
Something like that but smaller
I don't know what you're planning, but it sounds awesome
If you continue the line of thought from yesterday
I'm going to light up the closest dot to any user that comes on my site
mspaint shrunk that bitch 50%
15:36
@XCritics, thanks bro, that's exactly what I meant :P
LOL
1 min ago, by phenomnomnominal
Something like that but smaller
@maikunari 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.
@phenomnomnominal
@XCritics, i need less dots
*fewer
15:39
That any good?
^ defcon?
@XCritics, dw dude I got it haha
I'm having fun
Googled 'Cool world maps'
Is your site up yet anyways? You said it would be the next day
15:40
9
A: How do I clear all intervals?

SudhirYou could do like, var interval_id = window.setInterval("", 9999); // Get a reference to the last // interval +1 for (var i = 1; i < interval_id; i++) window.clearInterval(i); //for clearing all intervals

@XCritics, no, not quite done
Just adding my projects and stuff now
Why? It's not the best answer, but it's not a really bad one either (better than mine)
This is not a good idea. The specification does not guarantee any specific for the handles, only that they are numeric and unique. — Jan Dvorak 7 secs ago
Can you find a better spec than I found?
"empirically it's true" doesn't count
> Let handle be a user-agent-defined integer that is greater than zero that will identify the timeout to be set by this call.
!!c> 'a' > 0
@phenomnomnominal false
@Arthur 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.
15:50
I heard that this is not good:<script type="text/javascript">
$(document).ready(function() {
var interval_id = window.setInterval('', 9999);
for (var i = 1; i < interval_id; i++)
window.clearInterval(i);
});
</script>
I will clear all the running intervals
var interval_id = window.setInterval('', 9999);
that's always bad since you pass a string (i assume it actually contains code and is not empty?)
oh wait, you just want a new interval_id?
uh, better store the ones you actually used and clear those. that'll be cleaner for sure
Yeah, that's another issue: window.setInterval('', 9999); return undefined for me
I have zero ambition, zero energy, my eye hurts, I'm tired, I just want today to be over x.x
15:53
oh, and to make it worse: you start that dummy interval but use i < interval_id so you never stop it!
@Zirak haha just noticed you caught the @Zir I typod when the tab trigger didn't work cause you weren't here, did you read the entire history or does a partial ping you still?
i had tried something else like if (typeof interval_id !== 'undefined') { clearInterval(interval_id); }
on the upside, the empty string is only executed once each ten seconds
@XCr you tell me.
Neat
@Arthur Why not just keep track of your intervals and push them to an array or something, loop through clearing them?
15:56
@Arthur hint: iterating while some value is below undefined won't end up well
@XCritics that's the Zirak's idea
oh I never seen
I'm too tired to pay attention to the chat atm x.x
so, zirak's answer
I'm not a conformist
But I do love that dick head so I'll toss him an upvote ;)
I have to conclude that you're partially blind
user1125394
@Z @Zi @irak
15:58
Sick paint skills
yeah, paint...
@XCritics Y U no liek freehand circles?
@Zirak i'm sorry
@Zirak Sick.... Whatever preboxed paint utility came with your distro
It didn't come with my distro
I was pro enough to install a lame basic photo editing software, all on my own
16:00
So proud of you sniff
@Bert 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.
Just an example
@XCritics Thanks man!
can a mod force-unaccept an answer?
@Zirak Jeeze, reading your answer, you don't answer with the caution that they might be new to JS, you just go all out :P
16:11
Didn't I explain everything later?
Yeah, but judging on the context of the question, I personally wouldn't use methods that I'd have to link an explanation of :P
Already feeling like shit, might as well eat this chili
What question?
Well, too bad the more general solution is a bit complex.
@BenjaminGruenbaum Scroll up a bit
@Zirak Please don't act like I have a remote hair to question you on Javascript, I was just curious, and at the time, no I didn't even notice you explained a lot of it
@Zirak Answer seems fine to me
The point of answering questions in SO is promoting knowledge, not helping people come up with quick solutions
16:14
Like you have a "remote hair" to my questions?
Answers that don't do that are a waste
Is what I'm eating
I think I should start writing my will
or stop eating it instead
No, this is how I want to go
You guys have any idea what might cause a computer to act like it's blue screening, but not? (Everything freezes and you hear the same sound being repeated 4 billion times a second, but the screen doesn't go blue and dump memory)
When i put the intervals names to an array and clear them by clicking on next the error in the source is Uncaught ReferenceError: refresh_chat_posts is not defined
16:17
gimme codes
clearInterval(refresh_chat_posts);
No like, paste it in jsfiddle.net
or pastebin
or gist.github.com
The whole thing
most likely you didn't define such a variable
hrm. I'm getting infinite recursion. On a non-recursive path. Cool.
16:18
or you defined in a place where it's not visible
@Zirak Are you retired?
Not yet, you don't have enough step-brothers.
var refresh_chat_posts = setInterval(function() {
$('.chat_posts').load('/chat_posts?id=' + data.chat_code).fadeIn('slow');
$('.chat_info').load('/chat_info?id=' + data.chat_code).fadeIn('slow');
}, 2000);
Now where are you calling the clear interval, above or below that code
16:20
yes i'm defined it in the <div class="chat_posts"></div>
Is it fairly clear what that is?
Why is asia connected to...everything?
What is it - yes
@Zirak LOL
but you could tweak the pixels to preserve topology better
@Zirak well, it is
16:22
@Arthur What do you mean, is clearInterval(refresh_chat_posts) below or above that line of code
It's 4.30am, I think it's good enough for now haha
first below and later bij clicking on next above
i must use that two times
Sorry, but without seeing the full JS it's hard to troubleshoot
because people can also clicking on next during a chat sessions
If you're calling clearInterval on that after you declared the var, I see nothing wrong
unless you're declaring it inside a function or something
16:25
Well, there was a hidden recursion. Whadya know.
CoffeeScript prevents forest fires
So we're no longer a gallery?
Because no one is muted so it was useless
Honestly, I like having the ability but I think the room operated just fine before
i declared the var in a $(document).ready function that's not good
16:27
we turn to gallery when oko... err, B7 comes
If we want to mute someone, the option is always there
and are you trying to call clearInterval outside of the dom.ready?
no not yet
@JanDvorak He was actually polite today morning, and well behaved as far as I noticed
s/comes/comes and trolls/
16:28
Time to re-model my socket.js to a WAY more modeled thingamobber
> reify(x, [])
=> "_.0"
BOOYA BITCHES!
PROUD
That was thoroughly unimpressive
> reify([5, x, [true, y, z], z], [ [x, y] ])
=> [5, :_0, [true, :_0, :_1], :_1]
I love it when stuff works
is that ruby?
16:35
@4lbertoC 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.
Especially when you had the core logic right, only the smoothing-for-the-language methods were awry.
@JanDvorak yes
what does that do
Too soon to show off
But it's the premise of a small logical programming "DSL"
The problem is solved now, thank you so much guys
@AndreiDuma 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.
16:41
@Zirak You liked that lecture you sent me, didn't you?
All that's left is to describe...all of the logic. But I have variable declaration and triangulation.
@BenjaminGruenbaum yes, very much
It shows :)
Otherwise I wouldn't have shared
Honestly, I'm not very good at lambda calculus, they don't teach it in university, only Turing Machines.
They just say it exists, and it's another approach, all I know about it is from books I've read
@XCritics I'm sorry, i didn't work with coffeescript yet, i must learn that as soons as possible
16:44
Anyway, I'm off, got to leave work and get home, ttyl
You can link normal js
Why? @Arthur
you should understand JS before you do CFS
user1125394
python is crazy you can do array([2,1]) > array([1,2])
!!> [2,1] > [1,2]
@JanDvorak true
user1125394
16:45
array([true,false])
In ruby, this actually works
@JanDvorak i only worked with jquey yet, i'm sorry, i'm bad i know it
@Arthur jQuery is a DOM library for javascript
Yes i know
you need to know javascript as a language to use jQuery
16:46
Frameworks come easy when you understand the underlying code
(threading model, scoping rules, syntax)
Or have a general idea of how it works
!!> [2,1] > [10,1]
@FizzyTea true
!!> var a=["1,2",3], b=[1,"2,3"]; [a<b,a>b,a==b]
16:48
@JanDvorak [false,false]
@JanDvorak [false,false,false]
user1125394
@FizzyTea stop stating wrong things :p
in Ruby, ["1,2","3"] <=> ["1","2,3"] returns 1
Do you know this guys beta.wercker.com
jsfiddle.net/XJSyL/2 this makes me happy
16:52
One stupid question guys coffeescript you can run in here also <script type="text/javascript"> $(document).ready(function() { }; </script>
@Arthur huh?
coffeescript compiles to javascript
No you can't
<script type="text/coffeescript"> $(-> ... ); </script>
You can do that
but you need to include the compiler too
And it's not really recommended
@phenomnomnominal you can skip the parens: $ ->
thanks! and can you tell me how you can show an alert there?
16:54
@Arthur the same as in javascript: alert
@Arthur if you don't know JavaScript, don't learn CoffeeScript
@phenomnomnominal Can you combine ifs and fors, cause that would be bad fucking ass
user1125394
he wants to go directly from jquery to coffeescript :)
if this is this or this in clients is blah
haha you can too
alert(blah) for blah in blahs when blah is 'haha'
16:56
God this is beautiful
if this is this or this in clients is blah
console.log 'test'
Typed that into js2coffee.org and seems to work
@MagnusKarlsson Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
What it compiles to is meaningless
user1125394
!!c> blah for blah in ['foo'] when blah isnt 'haha'
@xcx "foo"
@phenomnomnominal What do you mean?
16:58
the generated javascript is generally quite ugly
this in clients -> __indexOf.call(clients, this) >= 0
this is clients is blah ->  __indexOf.call(clients, this) >= 0 === blah
oh yeah I just use js2coffee to check syntax errors
so blah can only be true or false, so it's meaningless.
not to mention that if this is this has to be true.
@phenomnomnominal negative
  for client in rooms
    if client.owner is socket.username or
      socket.username in client.occupants
17:00
!!c> NaN is NaN
@JanDvorak false
I'm mainly trying to check if a user is in a room, or occupies a current room
!!/tell xcritics mdn Array any
rooms holds an object
17:02
!!/tell xcritics mdn Object.values
rooms holds an object, where one value is an array :P
OK, Object.keys
@JanDvorak some?
@FizzyTea ah, right
... if rooms.some (client)->
  client.owner is scoket.username or
    socket.username in client.occupants
user1125394
17:06
no thanks
@JanDvorak Isn't that what I just had ;P?
oh nvm
Just trying out :-)
is there anything other than indexOf to see if something exists in an array
17:08
@MikeNolan I hope you don't mind
@XCritics in (cfs)
explicit iteration
some
I was thinking if array.hasvalue 'this'
@XCritics array.some (x)=> x is this
!!/mdn array.some
must be noted that array.some (x)=>(x is this) is quite wasteful
17:10
Is that much different than a for loop?
user1125394
!!c> [1,2].all( (x)->x%2)
Could I just do indexOf >= 0 ?
@xcx "TypeError: [1, 2].any is not a function"
!!c> [1,2].some (x)->x%2
@JanDvorak true
@xcx "TypeError: [1, 2].all is not a function"
17:11
!!c> [1,2].every (x)->x%2
!!C> [1,2,3,4].indexOf(3) >= 0 ? console.log('hi') : console.log('no');
`false`
@XCritics Y U NO MAEK SENSE!? Could not understand `C> [1,2,3,4].indexOf('3') >= 0 ? console.log('`
@XCritics Y U NO MAEK SENSE!? Could not understand C> [1,2,3,4].indexOf('3') >= 0 ? console.log('hi') : console.log('no');
@XCritics hint:case
@XCritics Y U NO MAEK SENSE!? Could not understand C> [1,2,3,4].indexOf(3) >= 0 ? console.log('hi') : console.log('no');
oooowwhhhaaat?
user1125394
17:12
chill
!!/tell xcritics eval "c" == "C"
@xcritics false
They are a bit different
Oh god.
:-)
!!c> if 3 in [1,2,3,4] then console.log("hi") else console.log("no")
17:17
@BenjaminGruenbaum "undefined" Logged: "hi"
(can remove the () )
user1125394
!!c> ['a'..'f']
@xcx ["a"]
!!c> [0..10]
@JanDvorak [0,1,2,3,4,5,6,7,8,9,10]
17:25
!!c> [0..100]
@JanDvorak [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,2‌​9,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,5‌​6,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,8‌​3,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100]
!!c> [1,2,3,4].indexOf(3) >= 0 ? console.log('hi') : console.log('no');
@XCritics Could not process input. Error: unexpected { on line 8
user1125394
!!c> [0..Infinity][50]
@xcx Maximum execution time exceeded
@xcx Maximum execution time exceeded
17:27
[1,2,3,4].indexOf(3) >= 0 ? console.log('hi') : console.log('no'); so this will work for what I need it for awesome
user1125394
not lazy eval
@xcx Soon!
You can do it on firefox, and betas of chrome
user1125394
cool
Well, you can do it now, just not in CoffeeScript
They didn't implement it
Does anybody know of you can use jquery signaturepad with your smartphone?
17:33
Hey, uhm, I want to implement into my project a previous project that consisted in a simple themes system that, in PHP, replaced the content of the "_current.css" file with the selected theme/version's. And I also remember I had this really annoying problem that made the style not update for users who had already visited the page, unless they did Ctrl+F5.
'morning from the west coast!
I tried several JS tips including putting the current timestamp in the URL so it's a different URL, forcing the browser to read the CSS file again, and then re-redirecting to the home page to have a clean URL, but nothing worked, and I gave up
Just send a cache-control:no-cache header and make sure serverside caching is off
But now since this is a final project I'd like to have this update smoothly, so I'd like to know if y'all know additional tips to basically force a style reload.
@BenjaminGruenbaum Serverside caching... How do I know that?
ex-post: timestamp
17:36
Yes, cachebreakers (adding timestamp) works, don't know why you hae a problem
@BenjaminGruenbaum I think it's because I re-redirected to the normal URL to keep it clean. THen the browser just re-used its cache, breaking the purpose. Maybe.
you have to keep the cachebreaker until the original cache expires
Oh, but now that I think of it...
caching is desirable with css
Not on this project :p
Anyway, uhm, wasn't there a way to only visually edit the URL with .htaccess? Then I could add the timestamp on the URL and have .htaccess not display it.
Would that work?
17:39
optimal solution: add the last-modified date as a timestamp
voila`, full cache with auto-flush
Can somebody help to figureout this?

I made this jquery script: http://jsfiddle.net/MxybV/

It reorders rows on a table.

I want to add a line where it says that if it contains "Si" then move the row at the bottom of the rows that :not(:has(img[src*="images/plus.gif"]))')

I have tried


$('#SubscribersManageAnylistList tr:contains("Si"):not(:has(img[src*="images/plus.gif"]))').insertAfter("tr.Heading3:last");

But instead of inserting them at the bottom its inserting them at the top
@sebas format your code (control+k)
(back ticks ( ` ) for single line)
sorry for that
@sebas @Zirak dem selectors
That sounds smart. But does the .htaccess thing sound like it'll work? I find it really ugly to have that weird number in the URL @JanDvorak
17:40
@sebas is this for your site?
yes, for a CRM
i know its better to do this on the server-side but for now i have only access to the clent's side
@sebas Why are you using query selectors for this, you can use a programming language
No, server-side would be a poor approach, just use JavaScript
Instead of handling all your logic on what you're presenting to the user, handle it on the object you're building the table from
Separation of concerns 101
cant do it that way now, all i have access to is the html output
Think how simple what you're trying to do would be if you were working on a JS array instead of a friggin table
@sebas what you're doing is a broken approach, don't you see how complicated your selectors are getting?
@BadgerGirl tell him
yes i can see that, and in the near future this will be moved to the server-side (PHP) but for now this is a patch
can you help me fix my patch?
17:44
@BadgerGirl test ping
It doesn't need to move to php, it can be done with JS, but why would you use query selectors
@JanDvorak Never mind. I discovered you could put that on the CSS file's URL, like href="styles.css?timestamp"
i dont know any other way
@copy is that how you ask each other out now? ("Are you free tonight?" became "test ping"?)
WOW, your jsfiddle contains even more selectors -_-
yes a lot...
17:46
@sebas here's a crazy idea, iterate the output of PHP and create an array of objects from it, operate on that array, then build the table again
i have no idea how to do it, as u can tell im not a programmer but i figured out this temporal solution in jquery all i want to is to able to express what i said and add it to this ugly jquery script until i find a better solution
@copy pong
If you're just interested in 'getting something to work' and not in learning JavaScript then sorry, you're not going to get much help here.
Nice
I'm not going to encourage behavior I consider harmful in a language I like
@copy Looks like someone is getting lucky
17:50
thank you anyways
Yeah
@sebas pregúntale a alguien más, intenta mandando pings al azar.
jua ok
@BadgerGirl Eso no es lo que quise decir...
@BenjaminGruenbaum אני יודעת מה עשית.
17:59
Should we ban non-english conversation here?
Creo que no

« first day (953 days earlier)      last day (4220 days later) »