« first day (659 days earlier)      last day (4514 days later) » 

02:00
o/
Tomorrow
I write a 3D game with webgkl
in one BADASS DAY
-3
Q: Finding gaps in an array of integers in JavaScript

Radek SlupikI have an array of integers. var arr = [1, 2, 3, 7, 9, 10, 11, 15, 16]; How do I find all the gaps (missing numbers) in the array? gaps(arr); // => [4, 5, 6, 8, 12, 13, 14] The array is always sorted. I tried the following, but it gives only the first element in each gap. for (var i in...

sbi
sbi
1 message moved from Lounge<C++>
Javascript Rules!!
if you say so
@Chimera it's just the symettric difference between range(min, max) and that array
03:11
aright you guys im seriously about to shoot my computer...
console.log(typeof $.stopUnload);
$.stopUpload({cancel:true});
the console logs function
then i get:
Uncaught TypeError: Object function ( selector, context ) {
// The jQuery object is actually just the init constructor 'enhanced'
return new jQuery.fn.init( selector, context, rootjQuery );
} has no method 'stopUpload'
03:33
Evening folk
@AndyPerlitch stopUpload vs stopUnload
 
1 hour later…
04:57
I'm trying to run a code on bestbuy.com and its not working , whats wrong?
var rExpIni = /^\b(?:[A-Z][^aeiou\d\s][a-z]{2})\b\s\b(?:[A-Z][a-z]{2}|[a-z]{3})\b/gm;
var rExp = /\b(?:[A-Z][^aeiou\d\s][a-z]{2})\b\s\b(?:[A-Z][a-z]{2}|[a-z]{3})\b/gm;

function sim(){
$("p, a, span, em, i, strong, b, h1, h2, h3, td, th, hr").each(function(){
if( rExpIni.test($(this).text()) == true){
$(this).css({
"background-color":"#DDBB22",
"border-style":"outset",
"border-width":"3px",
"border-color":"#DDBB22",
"font-size":"12pt",
"font-weight":"bold",
"color":"red"
});
}
});
$("img").each(function(){
 
2 hours later…
07:23
0
Q: If something can be achieved using CSS or JavaScript, which will render faster?

DanI have two working solutions for hover navigation that I've built. One solution uses JS, one use CSS. My question is, assuming a browser is JS-enabled, which solution will work faster? I'll most likely opt for CSS anyway to avoid given non-JS browsers trouble, but I was curious. I'm not sure of ...

@Abhishek WHAT?
That's yours?
How?
idk xD
Hahaha. How much do you normally get?
08:06
BSNL is upgrading , thats the most i know though but the ping is incredibly
insane
1 - 2 mbps
Anybody wanna see an only css notification display ?
something that shows [hey u have this many messages and stuff ]
Sure, show me
fiddling :-)
08:29
there you are ;-)
@Abhishek That looks cool
7 looks off center
eeks
I forgot one important rule
text-align:center;
@Abhishek It's rotated now
08:32
its supposed to >_>
Oh :p
but u get the concept ?
a[data-nots]:not([data-nots="0"])::before
Sure. 7 unread messages
thats teh maigc
Oh, I didn't even look at the CSS
08:33
checks an "A" element which has the data-nots attribute and data-nots attribute set to something thats not equal to 0
if finds then applies the rule to the ::before pseudo element
Hmm, makes sense
and the
Why data nots?
content:attr(data-nots); // tells it that the number is going to be from the data-nots
data-notifications;
Ah
08:34
"data-" the preceding tag for all the custom attritbutes
I know about data attributes
:-)
this :attr(); is an epic warrior of the CSS battle ground
Why are you rotating it, though?
What's the JS part doing?
Nothing
i was wanting to make it random :-)
Rotating it to make the pointer come out of the body
also looks a lil bit cool
i can rev-rotate the text
Hahahaha
09:21
calls em pure css :-|
doh background:url(xyz.png);
@Abhishek font-awesome > that stuff
@ThomasBlobaum yeah
I seriously dislike using fonts aswell :P
for a single image y load 50 fonts
if you need a single image then take font-awesome into photoshop and get your image
dunno, depends on use cases
or if you are insane enough like i am
do it pure css XD , right click and view source no image atall
vector style stuff that works everywhere is pretty appealing
09:39
have anyone tried backbone js
 
3 hours later…
12:22
@Abhishek how'd you learn C++?
Le sigh, some people are just so wrong.
Bitwise operators in JS have never involved double->int32->double conversions.
Except, well, in one edge-case (zero-bit unsigned right shift).
I need an image slide show
Like this
Any libraries you might reccomend?
13:00
@Amaan My godfather taught me
since i was 14 :P
and then followed by insane practice , writing games , writing stuff :-)
@IvoWetzel hows your language project coming ?
@Abhishek Not... so... uh.... on hold, got dragged into writing game stuff and other things again
:-) k
13:12
@Amaan lookie lookie some jQuieeriieez i failed to resist!
was playing around with web socket binary stuff and lua for the most part
(and C)
@Abhishek That's pretty impressive
@IvoWetzel oh C is always fun !
@KianMayne thanks
@IvoWetzel do you think i should consider writing a library that writes pure css stuff in nodejs ?
as in the epic classy css only tabs , accordions [ which literally kill semantic html but they are epic i mean hardware supported and blah ] ?
I can make em but i personally feel they are a mess
when u have to write em html way
i can do something like

<tabs>
 <tab><head>Omg THis is effing CSS </head> <content>I ding dong</content> </tab>
 <tab><head>Omg THis is effing Tab </head> <content>I ding ding dong</content> </tab>
 <tab> <head> Le other </head><content> <accordion /> </tab>
</tabs>
which gets compiled into ugly css only tabs which use radio element haxx
wait aint this proper xml already ?
 
1 hour later…
15:02
0
Q: hooking with javascript in the edit post sending process

BakaburgI'm developing a plugin for a complex custom field that need some js checks and validation before sending. Is there a way to hook into the sending process with js/jquery?

 
2 hours later…
17:15
OH MY GOD
.. [removed got too excited ]]
Hahahahaha
What'd you do?
pure css
circle loader :$
wait showing
I've seen that done before, so you aren't the first legend :p
just wait :$
I'm going for dinner. See it after
17:21
o so late!
+ i cant eat anything :-/
for a few days .. so no mentionining food :-|
18:11
@Abhishek Why nothing?
Moo me chalo ki fauj ho gai hai :-/
dher saare , dher saare :-/ & even on tongue
Probably shouldn't talk in Hindi here :p
i dont know
how to say that in english :-|
18:33
Hi
I'm bored now. Hit the rep cap for the first time in my SO career..
:-o
so "Career"
haha
Tenure?
18:58
@IvoWetzel is three.js any good?
@OctavianDamiean PONY
@Raynos if you have prior experience with any GL (openGL or DX )then its great
else "..."
// personal experience
so what is with this backbone.js. Ruby on Rails for JavaScript?
19:06
@Raynos :(
That's an Octocat.
A 20% cooler Octocat to be more precise. :)
Actually, not 20%, 100%. I forgot about the mustache.
it looks promising, Ill give it a go
19:22
Hello!
How can one load and use Fancybox with no conflict jQuery?
Its an app that needs Fancybox on the customers site, and therefore i don't know whether jquery exists or if its a bad version for Fancybox
So i kinda need to be sure, and therefore load my fancybox and my version of jquery in no conflict
get rid of the jquery that is included with fancybox
if it doesn't work with your jquery version, fix it or get another plugin if there is one
any properly written plugin should work fine with noConflict mode
I have these customers, and they might have different JS frameworks. And older versions of jQuery. So these I can't get rid off.
So i think it would be best to load newest jQuery from googles api and then load Fancybox in no conflict, but how?
@ThiefMaster how do you use the noconflict then?
well, you could include the newest jquery version and then use noConflict(true) to restore the old one
Like this:
document.write('<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>');
document.write('<script type="text/javascript">jQuery.noConflict();</script>');
and then everything below would be with the newest version?
Gnight people
i am too tired . see ya tomorrow
19:29
$().redirect('/redirurl/', {'arg1': 'value1', 'arg2': 'value2'}); lol
@ThiefMaster Cause below that code i would need:
document.write('<script type="text/javascript" src="jquery.mousewheel-3.0.6.pack.js"></script>');
document.write('<script type="text/javascript" src="fancybox/jquery.fancybox.pack.js"></script>');
document.write, yuck
you need to include your jquery version first
then include all the scripts that should use that version
Its because I'm loading everything i need from an external js file, i have on my server
19:30
and then use var $new = jQuery.noConflict(true); to restore the old jQuery.
you can then use $new to access "your" jQuery version if necessary
@designer That doesn't mean that you have to use document.write. ;)
document.write('<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>');
document.write('<script type="text/javascript" src="jquery.mousewheel-3.0.6.pack.js"></script>');
document.write('<script type="text/javascript" src="fancybox/jquery.fancybox.pack.js"></script>');
document.write('<script type="text/javascript">$new = jQuery.noConflict(true);</script>');
like so?
@OctavianDamiean oh, how should i load it then?
eh
don't use the document.write crap
Just append the a script element at the position you want to have it.
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript" src="jquery.mousewheel-3.0.6.pack.js"></script>
<script type="text/javascript" src="fancybox/jquery.fancybox.pack.js"></script>
<script type="text/javascript">$new = jQuery.noConflict(true);</script>
19:33
So body append those lines?
You can append them to the body too, yea.
@ThiefMaster thats the same i wrote right, just without document.write
document.write is bad juju.
$('body').append(
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript" src="jquery.mousewheel-3.0.6.pack.js"></script>
<script type="text/javascript" src="fancybox/jquery.fancybox.pack.js"></script>
<script type="text/javascript">$new = jQuery.noConflict(true);</script>
);
19:34
hey <!DOCTYPE>
<HTML>
<HEAD>
<script type="text/javascript">
function change() {
document.getElementById('wrapper').style.opacity=0.3;
document.getElementById('peehaa').disable='true';
document.getElementById('wrap2').style.visibility='visible';
}
function change2() {
document.getElementById('wrapper').style.opacity=1;
document.getElementById('peehaa').disable='false';
document.getElementByID('wrap2').style.display='none';
}
</script>
<style type="text/css">
body
{
margin:0;
padding:0;
}
#wrapper
@designer That won't work.
@OctavianDamiean @ThiefMaster I dont understand how that will not break the older version, AND how this does not break my scripts with a potential older version or maybe prototype or mootools
It will likely throw a syntax error.
@designer: why do you think it breaks anything?
Yea need to put it as a string
@ThiefMaster hmm.. i don't know, i was just thinking it might break something if the customers got loads of ugly weird frameworks that would use $ as well for instance
19:36
it temporarily breaks stuff - between including the new version and calling noConflict(true). but that call restores the old version and whatever else was named $ and you never need to access the overwritten stuff in your code
before setting window.$ and window.jQuery, jQuery stores their old values.
@blackbee getElementByID is not a function. It should be getElementById. And try not to paste large chunks of code into the chat room; it is user-unfriendly
calling noConflict(true) re-sets the variables to those saved values
Ah, but then how can Fancybox use my new version of jQuery? it does that until it restores because of noConflict?
but its also true that on the end of the week i joined stack overflow they shutdown my ability to post questions
@designer: It hopefully uses a closure
i.e. (function($){....})(jQuery);
19:39
but then (jQuery) should be (new) ??
no.
the plugin itself uses $ which is mapped inside that closure to whatever jQuery was set to at the moment the plugin was loaded
and that's your jQuery version
Ah i understand now i think
Thats cool
thanks dude, it helped me
thx both actually :)
@Dennis u meant getElementById.('wrap2)........ i replaced all the getElementById() with getElementById.() and volla......... nothing works anyomre
Oh btw.. i can't use the append thing before loading my jQuery.. right?
@blackbee That was a period at the end of my sentence. It doesn't go in your script
19:42
I do need to use document.write, cause i dont have any frameworks to use - or i don't know for sure @OctavianDamiean
o sorry i got the error
it works but i dont need it. :D
ok.... i have another question... in making a chat..... how do i make sure that the message sent from one user reaches only and only to the desired user
20:06
Guys if I create an object
Then serialise it into a JSON string, how would I pass the JSON string to a PHP form handling page?
20:19
AJAX
 
2 hours later…
22:00
sigh, i hate it if an online shop knows there will be ten thousands of people trying to order something in the same minute and they STILL don't use a proper server that can handle those requests...
 
1 hour later…
23:23
@Abhishek i have used opengl :)
23:35
Has anyone ever had problems with firefox retrieving AFTER the cache is wiped out. I hate to say it, but IE shows the page with no problems. I have deleted all of the js files from the server and re-copied. FF still shows the old page. Am I missing some kind of $()%)$ treasure cache?
I even deleted the file from the server entirely and ran the page. Magically its still there
Has anyone here used Facebook Real-Time Updates API?
:)
nope, sorry
ALL THE DAYS
Why wont this work:
var frameJQ = document.createElement("script");
frameJQ.setAttribute("src", "https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js");
var place = document.getElementsByTagName("head");
place.appendChild(frameJQ);
any one?
and... ?
i mean
23:48
@GiovanniDiToro getElementsByTagName returns a NodeList - you want place[0] instead of place.
probably because you put it in the body?
or more sensibly what dennis said
better yet use document.head

« first day (659 days earlier)      last day (4514 days later) »