« first day (1130 days earlier)      last day (3801 days later) » 

12:03 AM
jQuery 2.x support IE8? does it fix any issues with comparability mode in IE9?
 
ahah
and for anyone who isn't a reddit user: goto healthcare.gov and goto the search and type in 'select' and wait for the auto complete / type ahead thingy
golden
 
2 hours ago, by Shea
https://twitter.com/kevinmitnick/status/402324878843330560
 
awww
that isn't as fun anymore
:(
I'm laughing crying
 
12:21 AM
@jbolanos 2.x specifically doesn't support old IE
 
12:36 AM
 
hahaha
before you take the thumbnail as offensive, watch it
(damn you YouTube)
 
0
A: How to get websocket url path from php or node.js

SomeKittensThere isn't a native way to work with websockets in PHP or Node. You'll need to use a library of some sort. Fortunately, there are plenty to choose from: Node.JS PHP

I don't understand this guy's comments...
 
@SomeKittens I think he's talking about url parsing or substring at the very least.
Oh nevermind, I had to really think about that one
 
1:25 AM
is it bad to create functions that take in multiple parameters and only pass in one parameter?
 
That's SOP for JS
 
SOP?
standard op procedure?
 
yeah
 
thanks for the answer
 
Ugg. I forgot to get new shaving razor blades.. dull shaving huuuuuuurts.
 
1:33 AM
!!are you currently shaving?
 
@SomeKittens Definitely
 
:P
 
1:46 AM
is there a way to select a element by attribute without jquery?
 
document.querySelector('input[type="text"]');
 
@SomeKittens thanks. does that function take in all css style selectors?
 
Yes
and returns the first one applicable
 
If you want all the elements, use querySelectorAll
 
seems like plain js has advanced a lot since i last used JS
browser didnt used to support all these
 
1:51 AM
yES
this is ie9+ from memory
edit: actually ie8 supports it
 
N5 Shipped!
YISSSSsssssss
 
2:17 AM
Hmm, can I run a conceptual idea past somebody?
I'm designing a simple vampire based javascript game. Initially, every 5 seconds you can hunt and collect blood. But after you collect X amount of blood, I want to start cycling between "times of day", again every X seconds. Making it work isn't the issue, designing it properly is.
If you were designing this, how would you shape the code so that it's neat, easy to work with, etc?
jsfiddle.net/srx4Y Here's a fiddle of what I have. But I feel like it's spaghetti code (I just made the dayStatus object which I will cycle through with I guess an interval countdown)
 
2:56 AM
First off, you're missing a major opportunity when var count doesn't reference the Sesame Street character.
Secondly, I'd create some objects to represent different things in the game. player, timeOfDay, etc.
 
Hi very kind Javascript people! I am having a problem with Jplayer.... I think it's quite simple but when a link is clicked to play the file it loads in a new window and not the player, also the waveform for the file does not load. Anyone kind enough to help me? I have been stuck on this for about 8 hours tonight :(
 
@ChrisP Eight hours? What have you been doing?
 
Posting it on various forums and trying to find similar examples...
If it was PHP it wouldn't be a problem but my Javascript is very rusty
 
If you've spent eight hours asking for help, then you must have made a self-contained example by now. Let's see that.
 
3:02 AM
stackoverflow.com/a/20061596/1216976 <- Not an answer, you should delete it and merge the info into your question via edits
 
ah yes will do so now
 
@SomeKittens I'm afraid I don't get the Sesame Street reference :P
 
Also, that's not a self-contained example. Use JSFiddle to recreate the problem.
 
ok will do now
 
Count von Count, often known simply as "the Count", is one of the Muppet characters on Sesame Street. The Count is a vampire modeled after Bela Lugosi's interpretation of Count Dracula. Description The Count's main purpose is educating children on simple mathematical concepts, most notably counting. The Count has a love of counting; he will count anything and everything, regardless of size, amount, weird choices he makes or how much annoyance he is causing the other Muppets or human cast. For instance, he once prevented Ernie from answering a telephone because he wanted to continue coun...
 
3:04 AM
Oh :P
I'm a right in assuming you can't traverse an object in order? (for instance, if (condition is true) x = obj.nextElementInOrder;)?
 
Like Java's Iterator? You can...ish
 
var status = ["day","dusk","night","dawn"];
var huntStatus = {"day":0,"dusk":2,"night":3,"dawn":1.5};
function timeDayCycle(x) {
    var cycle = document.getElementById("cycle");
    if (!(count % 10 )) {
        for(var z=0;z<status.length;z++) {
            dayStatus = huntStatus[status[z+1]];
        }
        cycle.innerHTML = dayStatus;
    }
}
That's what I have to iterate the days, triggered when !(count%10)
Currently getting undefined, but I'm debugging that part.
lol im dumb.. count should be x
 
I'm not quite sure what you're doing there.
 
Yeah, still undefined. I would assume so because if z+1 > status.length it would be out of bounds
@SomeKittens basically trying to cycle through times of day every 10 seconds (the object values are multipliers for later)
and I keep seeing stupid mistakes..
 
Why not setInterval?
 
3:14 AM
Here you go SomeKitten
 
If setInterval is triggered in a function, will it keep running until you tell it to stop?
 
HAMMERTIME!
 
You know what Caprica..
 
haha
excellent
 
LOL
 
3:15 AM
@CapricaSix that's inappropriate.
 
@RUJordan Yes.
(as opposed to setTimeout, which executes once)
 
Hmm, that will be much easier.
 
@ChrisP Have you confirmed that the error occurs in the fiddle?
 
my apologies i haven't set it so that jquery is initialized too... 1 mo
here you go SomeKitten

http://jsfiddle.net/xjDeN/4/
 
!!afk soup
 
3:20 AM
@RUJordan Apricots are people too!
 
Are you suuuure?
> Uncaught SyntaxError: Unexpected token }
 
@CapricaSix You're back! I missed you.
 
@SomeKittens @monners You're back! I missed you. (source)
 
Eh?
 
She misses you!
 
3:24 AM
@monners It's true!
 
Tidied it up SomeKitten - http://jsfiddle.net/xjDeN/6/

Still having the problem with the player though! Keeps loading the mp3 in the new window :(
 
@ChrisP The issue here is that you've given us a massive code dump and didn't bother to check if it was working.
You need to invest some time into learning how to ask a question well
I'm still getting an error in the console. This is a really easy error to fix. You can't bother to get that right before you paste it here?
We're offering you expert help for free. What does it say about your opinion of us if you can't even be bothered to go through basic debugging?
2
 
^ well said.
 
Massive apologies for this, I will re-edit my post.

Are you sure as I have just had this message?

JSLint Valid!
Close window
Good work! Your JavaScript code is perfectly valid.
I have a very high opinion of you guys, I remember from school that sometimes the most simplest of errors are often missed, and I do apologise for this but it is nearly 9 hours now I have been spent trying to solve this problem. Am very thankful for all help!
 
jsfiddle has a jshint button
use it
 
3:30 AM
I think what it is (this is only the second time I have ever used JSfiddle) i didnt save the latest update...

http://jsfiddle.net/xjDeN/7/
 
Why does my Else statment fire in a for loop when the If part already accepted a value?
 
where is your code?
 
@phenomnon I just did and it returned the JSLint Valid! Close Window message above?? That is what's correct isn't it??
 
Correct.
 
jshint, not jslint. It adds red dots next to any issues
 
3:31 AM
		for(var i = 0; i < supportedRooms.length; i++)
		{
			if(bot.roomName == supportedRooms[i])
			{
				CurrentRooom = supportedRooms[i];
				break;
			}
			else
			{
				// Do something .. Firing for some reason?
			}
		}
If i print the values, both the value in the If and the else is printed
 
@EliteGamer Please format your code, press ctrl+k
 
Is that C nomenclature?
 
thanks
 
Phenomenom - the message came up "JSLint Valid", I copied it from the console, can send you a screen grab if you do not believe me, but this was after pressing the JSHint option on the menu
Phenomnon sory*
 
@ChrisP great, that wasn't the case with the old version
 
3:34 AM
@Loktar and once the IF statment is done, i break; so it should stop the fore loop correct?
 
@EliteGamer Well the else section's gonna fire for every iteration that doesn't pass the test (thus breaking the loop)
 
@EliteGamer Thanks.
 
Sadly my problems still exist :(
the mp3 still loads in a new window....
 
yeah exactly what @monners said
 
@ChrisP I'm getting an error: Uncaught ReferenceError: promo_folder is not defined
 
3:35 AM
@monners ah, ok. That makes sense.
is there any way i can complete the for loop then tell the users somethign did not match?
 
@SomeKitten that's strange as in the javascript code it says

$(document).ready(function () {

var promo_folder = '2bc84834af4d6fd6dafc95a687d51a70';

});
 
Or?
 
@ChrisP learn how scope works
 
@ChrisP Simply declaring it in once place does not mean it's available elsewhere.
Now we're hitting more advanced issues
 
@EliteGamer you could set a value to an external variable within your loop (if your test matches) then return that value once the loop is complete
 
3:40 AM
@NinjaEcho Who are you?
 
I am a bot who goes by the name Ninja Echo.
 
@NinjaEcho Should I buy an Xbox One or a PS4?
 
A PS4.
 
@ChrisP promo_folder no longer is defined when the anon function in the $(document).ready call finishes executing.
 
@EliteGamer
    function() {
        var testcase = 0;
        for (var i=0; i<10; i++) {
            if (condition[i] === true) {
                testcase = 1;
            }
        }
        return testcase;
    }
 
3:42 AM
I've got a working copy here, but I want you to understand the concepts behind why it doesn't work before I show you code.
 
In that case I think I should move that particular line to the

var changeTune = function(track_name,mp3_to_play) {

Section....
 
What happens then?
 
Every time that function is called (which changes the waveform) the promo folder is defined there
 
@ChrisP Correct! Now we're getting somewhere.
Try that in your JSFiddle, does it solve the problem?
 
Yes, It fixes the problem of the mp3 not loading in the new window however it doesn't sadly change the waveform to the correct file . Both are the same when in reality both are different
I get the feeling that track_name is not being passed correctly.....
 
3:51 AM
How would you determine if that was the case?
 
var status = [];
status.push("day","dusk","night","dawn");
 
@RUJordan You taste just like raisin.
 
Is there a reason that would yield: TypeError: 'undefined' is not a function (evaluating 'status.push("day","dusk","night","dawn")')
 
@SomeKitten in the html I have the track_name information stored as an ID but can see in the java there is nothing picking it up

<a href="http://www.icanpromo.co.uk/meta/promos/2bc84834af4d6fd6dafc95a687d51a70/clips/Friend-FootballEnemy-OriginalMix-Tekno-128.mp3" id="Friend-FootballFriend-OriginalMix-Tekno" class="play_track_btn">Football Friend</a> (Techno)</td>
oh hang on yes it does

$('.play_track_btn').click(function (event) {
changeTune($(this).attr("id"), $(this).attr("href"));
event.preventDefault();
});
am glad the mp3 problem is sorted though that was doing my head in... Many thanks! Where are you guys from btw?
 
San Francisco
 
4:03 AM
Down Unda
 
ah fair play, I am from England.
 
What the.. this array is being treated like a string..
 
SomeKitten do you have any pointers how to fix my waveform changing problem? I can't work out what is going wrong.... the html passes the ID to the play_track_btn function which changes the jplayer and in the javascript is being passed to it...
 
@RUJordan is said array arguments? Because that's not technically an array.
 
What do you mean?
 
4:08 AM
i'm surprised status isn't a reserved word
 
var status = ["day","dusk","night","dawn"];
console.log(status[0]); //yields "d"
 
@ChrisP Honestly, I'm stumped by this one too.
You're doing everything right, the CSS is updating correctly.
The new image just isn't being displayed.
 
Unless the waveforms are the same
for me it changes and then changes back
 
Sadly, they aren't.... one is

http://www.icanpromo.co.uk/meta/promos/2bc84834af4d6fd6dafc95a687d51a70/artform/Friend-FootballFriend-OriginalMix-Tekno-wvf.png

and the other....

http://www.icanpromo.co.uk/meta/promos/2bc84834af4d6fd6dafc95a687d51a70/artform/Friend-FootballEnemy-OriginalMix-Tekno-wvf.png
 
They're not, the network request is going through and grabbing the new one.
@phenomnomnominal Browser?
 
4:11 AM
Chrome
 
huh.
 
same as me
 
<- also Chrome
 
also the play pause button is flickering
 
@monners you were right, the variable name was the reason for the odd behavior.
 
4:14 AM
the 'ended' event is firing over and over
 
Curious now as to why it only outputted the first letter of the first array index.
 
@RUJordan Strange
 
you see the second waveform changes when i click it then changes back (oddly to the first waveform which it shouldn't do) but the first one does nothing at all,
 
@phenomnomnominal Because the clip's only one second long.
 
Do you think it would be worth a SO question to find out why?
 
4:16 AM
!!One last story or cat pictures
 
@SomeKittens cat pictures
 
\o/
 
I think I know what the problem is.
 
@Somekitten my bad i got those back to front, the second track displays the correct waveform, but oddly when i click it you can see the first waveform flicker for a brief period........ - the first track plays correctly but the waveform is of the second tune...
 
@RUJordan Looks like status is a property of the window
 
4:18 AM
I think you might be making multiple instances of jPlayer
 
hmmm
 
hahahahahhaha i've linked the files back to front... d'oh

http://jsfiddle.net/xjDeN/11/ has them sorted out

Has them in the correct order... but still the second waveform loads briefly then back to the first one :(

Ahh no way, any way I can stop that.... and just have one instance...
 
You could create two classes, each with background-url set, and just switch the class.
 
@monners Yes, it is. Was previously used by browsers status bar. developer.mozilla.org/en-US/docs/Web/API/Window.status
 
Well, ya learn something new every day
 
4:23 AM
It was misused by nearly every site back in the end of the last century, so support for it has been dropped.
 
I'm just surprised it actually returns something meaningful when assigned to an array
 
Right?
 
agh! He's stolen half my name!
 
@SomeKittens Or was it you that stole half of mine?? ;)
 
SomeKitten do you reckon that would work? I am confused as to why this doesn't change the background and override the css :( Java is such a headfuck.
 
4:25 AM
@ChrisP Lucky you're not using Java then.
 
@ChrisP You're right about Java, wrong about the language you're using.
Java is to JavaScript like Car is to Carpet
 
Javascript as well
hahahah
i studied some java at uni 10 years ago but that was even more intense using Eclipse...
 
Java is to JavaScript as Pen is to Penis
 
Java is to JavaScript like Some is to SomeKittens
8
 
Java is to JavaScript as Mike Rowe is to Microphone.
 
4:27 AM
hahahhaha
 
Java is to JavaScript as Jake Weary is to jQuery.
 
!!google Jake Weary
 
stackoverflow.com/questions/20063127/reserved-word-behavior quite a few comments here. Interesting
Oh wow, 3 upvotes
 
@RUJordan There are many variables in the global scope for historical reasons. You have probably heard a million times that global variables are bad. Now you been bitten by one reason why :)
 
4:37 AM
This is very interesting
I wish it would throw a better error ("Invalid variable name: status is a reserved word")
setInterval(function() {
    var index = statusCycle.indexOf(dayStatus);
    var cycleNext = statusCycle[(index+1)];
    if (cycleNext) dayStatus = cycleNext;
    else dayStatus = statusCycle[0];
    cycle.innerHTML = dayStatus;
},10000);
@SomeKittens MUCH better than before. Thanks for the tip
*pro-tip ;)
 
Ahhh i'm lost as to how to do this........
 
@CJRamki Hey , GM
there ?
want to ask something
 
@chintankhetiya Hai, GM...
@chintankhetiya No man...
 
@RUJordan Sounds like someone's learning!
 
@SomeKittens R u working?
 
4:49 AM
@CJRamki ha ha , are you web developer ?
 
@CJRamki yeah, for a bit more.
 
@SomeKittens thanks to y'all. My professor NEVER even touched on dynamic javascript. He went right to jQuery for that.
 
As a bootcamp instructor, that's an interesting conundrum. Do you teach RAD (jQuery), or language foundations (pureJS)?
 
@chintankhetiya Yeah...
 
@RUJordan Not even Douglas Crockford has included test for it in his JSLINT: jslint.com And when trying jshint that gave no response either. May I suggest that you send them a report jshint.com
 
4:50 AM
jsfiddle.net/4MhBG Successful day cycle :3 Next step, blood gain multiplier based on the time of day, and if it's "day", HP is hurt :3
 
@CJRamki How you are calling this type of loader , in each and every task or there are any other global way
because this would be hard to manage show and hide in each event ,
 
@SomeKittens setInterval > setTimeout?
 
@some wow really? damn
 
@chintankhetiya In that same way only...
@chintankhetiya But I don't know about mobile environment
 
@RUJordan Oddly, that's highlighted for me.
@Shea He wanted something to execute every ten seconds. Sounds like interval to me
 
4:54 AM
@somekittens I may just remove the initial background waveform from the css, see if that fixes the problem
@SomeKitten sorry*
 
hmm , because its really hard and remember that add and remove that function and mange it , so that is the reason
@CJRamki
 
Oh that sounds fine
 
I think in this particular case I could have used a function call inside my original 1 second counter !(count%10) func() would have worked as well, but this is cleaner
 
@SomeKitten - fixed it! That was the problem, i had the same waveform on the progress bar and the seek bar..... awesome!!!

Fucking love this site, many thanks for all your efforts!

http://jsfiddle.net/xjDeN/13/
 
@RUJordan Just practicing?
 
4:59 AM
@chintankhetiya Yesterday How many seconds you set for time interval to show_loader function?
 
Mhm, learning vanilla js just to get better.
 
It would be a good exercise, if it actually got big and complex enough, that you start to notice issues with setInterval at low settings.
 
@CJRamki for 4 to 5 sec
 
@chintankhetiya It is depends upon the process or you hard code that time?
 
@Shea what do you mean?
 
5:03 AM
@chintankhetiya @CJRamki GM
 
@Gamex GM... have a nice day...
 
@CJRamki Same 2 u
 
Functions can start rerunning again, before the previous one has finished, but you won't really notice that until you mess with xhr in it.
 
@Gamex Thank you... R U a game developer?
 
@CJRamki Yes
 
5:05 AM
@Gamex I love playing games...
 
@Shea What are you talking about? Javascript in the browser is single threaded.
 
@CJRamki Yeah , now i am putting my loader function in all over my code and testing it thoroughly
 
xhr?
 
@RUJordan "ajax"-calls.
 
!!afk smoke ping me
 
5:06 AM
@chintankhetiya What my question is, If you hard coded the time interval, It will just run on that particular time interval only...
 
@RUJordan Stay safe.
 
Oh, this wont be using ajax
 
@RUJordan Were you bitten!? Strip! Prove you weren't bitten.
 
!!afk for real
 
@RUJordan Hurry back, ok?
 
5:07 AM
(function(){
    this.window.setInterval(function() {
        var xhr = new XMLHttpRequest();
        xhr.open('GET', '', false);
        xhr.send();
    }, 50);
}).call(this);
That would be a bad idea
 
@chintankhetiya If that process take more than you time interval, What will happen?
 
@CJRamki From ?
 
@chintankhetiya So my opinion is set time interval depends upon the process time...
@Gamex India, Tamilnadu
 
@CJRamki Tamil ?
 
@Gamex Yeah...
 
5:10 AM
@CJRamki i have so many tamil frnd here
 
@Gamex wow... really.. What about you man?
 
@CJRamki Yes , that will throw error , do you remember my last query of yesterday ? that is same issue , dialog is going to close before end that process
so that is the i am looking for once the dialog or popup open it will close on process time not as per give fix time interval
 
@CJRamki i m gujju !
 
@Gamex seriously ? where are you from ?
 
@CJRamki a'bad
@CJRamki R u dev ?
 
5:14 AM
Ugh, please use full words.
 
@Gamex check that who had asked you ? :P
 
@Gamex Yes...
 
@chintankhetiya Yes
@chintankhetiya @CJRamki Yes sir ?
 
@chintankhetiya for global call that function, use single class name to all clickable tags...
 
@Shea that's for an interval of 50 milliseconds though, in an interval of say 10 seconds, most ajax calls would be fine, no?
 
5:16 AM
@RUJordan I thought you'd never come back!
 
@RUJordan Well what if it's 10 seconds, and the server begins to lag, and requests take a long time to finish?
Realistically, 10 seconds would be a really long time, but there's chances there.
 
@RUJordan That's a really dirty way of stacking requests. Kinda like long-polling (except in this instance ultra-tiny-mini-polling)
 
@Gamex How many games you already developed?
 
@CJRamki 4
 
So what's a non-dirty way of achieving interval-like ajax calls?
 
5:20 AM
@Gamex Hmmm... great...
 
@CJRamki What abt u ?
 
Funny you should ask
 
@Gamex Just now i started my career... I'm a web application developer... Working in one organization
 
@CJRamki Technology or on which platform ?
 
@Gamex Currently using php...
 
5:23 AM
@CJRamki Good
 
@Gamex Thanks for the appreciation...
@chintankhetiya there?
 
@CJRamki Anytime ?
 
@Gamex 10 to 7
 
@CJRamki hahah ok..
 
@Gamex why that laugh?
 
5:25 AM
@CJRamki yes
 
@CJRamki Nothing
 
@chintankhetiya Send me you jsfiddle link...
 
@CJRamki wait
 
@chintankhetiya ok...
 
@CJRamki next thing is when i am going to use live JQuery URL as locally file , (save in local dir) then they are not calling resources like images
 
5:28 AM
@chintankhetiya ?
@chintankhetiya for images u have to download images
 
@C5H8NNaO4 Like with sausages, it's better not to look how it's made.
 
@Shea I gotta go to bed, but ping me why your setTimeout is better than the setInterval please (not saying you're wrong, just wondering why :) )
 
@RUJordan It's really not going to do anything as it is, but with a large application, possibly involving xhr, canvas rendering, and/or (depending on the application) large scale text processing, it's going to serve as a keep alive rather than a simple ticker.
 
m59
5:45 AM
If anyone is down for a conversation about Dependency Injection - I'm wondering how a class (or object in js terms) can be instantiated without breaking DI if the thing that instantiates the class doesn't know what it's instantiating
 
@m59 looks like a job for a factory pattern
 
m59
meaning, object foo is instantiating object bar because some external input told it to. bar depends on baz, but foo doesn't have it.
 
or maybe just pass it a closure that will instantiate bar
s/or maybe/=/
 
m59
My intuition tells me it's impossible to do what I'm wanting to do without breaking DI
 
pass foo a BarFactory
 
m59
5:51 AM
Because nothing can know about the controller being instantiated
so that won't work.
 
does barFactory not have enough information?
from the closure and from the arguments passed by foo?
 
m59
it's like this:
api/bar/blah
 
m59
instantiate bar
well, that's the very light version, lol.
But it's imperative that nothing know about bar
 
then it's an apiFactory
whose instance would be part of the controller
 
m59
5:54 AM
In other words, I could just as soon delete bar altogether and nothing will ever know better. That uri will just be invalid.
 
@AbhishekHingnikar Hai... GM
 
I assume that foo knows it wants an instance of api. Then you could just pass it an instance of apiFactory from the controller
 
YOU'RE ALL ZEBRAS.
 
m59
@JanDvorak still lost :( let me write some quick code
 

« first day (1130 days earlier)      last day (3801 days later) »