« first day (523 days earlier)      last day (4425 days later) » 

12:01 AM
0
A: What should I "forget" when going to Javascript?

Gabriel LlamasYou should forget all you know about JavaScript because you've said that you used it as simple scripting language and today JavaScript has new de facto standards. The next version of the ECMAScript specification (ECMAScript Harmony) will include two major changes: classes and modules. Meanwhile,...

 
hello
anyone here decent with memoization and algorithms? i have an approach i want to implement but need help setting up the structure
 
that question should have been asked on stackoverflow
i dont even really see the difference between most of these stackexchange sites
@JohnSmith thats quite vague
 
well
say i have an array of dice
and i want to determine which dice each die beats
instead of comparing each die to each die
i an wondering if i can use a multidimensional array somehow
and with recursion and memoization,
be able to say
actually you know what this method won't work
sigh
 
u just use indexof
check item against array with indexof to see if its greater than -1
i think you trying to apply complex formula to simple problem
that said, there is a good book on algorithms that you should check out, you probably find a pdf online on a torrent
its called algorithm design manual
 
12:17 AM
I think you also can use the ~ operator instead of checking it's != -1
 
and you can use the filter method for multidimensoinal array by the ay
multiple ways to do this @JohnSmith
use the one that is most understandable to you
 
12:37 AM
?
 
he is spamming it everywhere .. just flag it
 
1:30 AM
hello room
 
!!cowsay e=>< The snozberries taste like snozberries
 
 _______________________________________
< The snozberries taste like snozberries >
 ---------------------------------------
    \   ^__^
     \  (><)\_______
        (__)\       )\/\
            ||----w |
            ||     ||
 
1:43 AM
:(
 
2:12 AM
!!cowsay e=òó your tears taste sweet!
 
 ________________________
< your tears taste sweet! >
 ------------------------
    \   ^__^
     \  (òó)\_______
        (__)\       )\/\
            ||----w |
            ||     ||
 
whoa, custom eyes.
!!cowsay e=OO moar cowbell!
 
 ______________
< moar cowbell! >
 --------------
    \   ^__^
     \  (OO)\_______
        (__)\       )\/\
            ||----w |
            ||     ||
 
(in case you hadn't noticed, I like making it say "moar cowbell")
 
user1385191
2:35 AM
lol I'm reading the $ 1.7.2 changelog
 
user1385191
they've never been able to calculate position properly
 
user1385191
I've got some questions if anyone wants to hop over to the MDU room
 
2:50 AM
mdu?
 
ooooh Mat's DOM Utils
 
evening
who would of thought a simple JS issue would stump the people answering =/
 
user1385191
3:11 AM
2 messages moved to bin
 
guys if you edit a div width in JS can you use % and if you have style="stuff " on the div will it over-ride the JS changing it?
 
3:23 AM
i give up >.>
 
user1385191
oh look; another popular JS blogger lands a job they don't deserve
 
?
 
3:49 AM
So, i'm thinking about consolidating this into one core file, so I can do stuff like Euler.solve(15) or Euler.problems[14].solve() ...any better ideas?
 
4:04 AM
@MattMcDonald lol
@MattMcDonald jealous much?
AddyOsmani isn't stupid
He works hard and can deliver significantly more then you can :\
 
@ThomasShields Rename every file to something more useful like euler15-sum-of-primes.js and leave it as it is.
 
@copy ah, that's a good idea. thanks
 
or put them into one big file :D
 
user1385191
@Raynos quantity !== quality
 
@MattMcDonald haters gonna hate
Pro tip: Utils is not quality :\
its cute but dear god ._.
 
user1385191
4:15 AM
you don't like the style
 
That
and I dont like your dead code, everywhere
 
user1385191
I don't like Mylib's style
 
user1385191
but both work
 
addy osmani's code works too
 
user1385191
in pet browsers
 
4:16 AM
jQuery works <trollface />
 
user1385191
back to the my barb about bloggers:
 
user1385191
I'm just annoyed that people who post a ton of mediocre crap get primo speaking gigs and then use that popularity to get big jobs
 
user1385191
resig has done the same thing
 
user1385191
but even he actually made something significant
 
...
Stop looking down on these people
 
user1385191
4:28 AM
it isn't even about money
 
@MattMcDonald are you better then them?
 
user1385191
it's the propagation of ignorance
 
Do you honestly think your more skilled them then?
 
doesn't matter whos the most skilled, it matters whos the most known
goes to bed
 
there's nothing wrong with thinking you're better than someone when you are
 
4:30 AM
@Loktar true dat
 
it's is what it is
 
user1385191
my concern is accuracy
 
user1385191
ignorance begets ignorance
 
blind leading the blind?
 
user1385191
people use DOM libraries because they're told the DOM is big and scary
 
4:33 AM
well... that, and they're too lazy to read
people often want to know new things without learning
 
5:07 AM
@ThomasShields people who dont link to github in their SO profile get shot
 
oh, crap.
oh well, it's updated @Raynos
JQUERY Y U ON MY TAGS
 
my euler problem 3 run out of memory >_<
 
I did a bunch of refactoring on mine and got it down to a reasonable speed, if i'm thinking of the right one
yeah mine runs in under half a second
one sec lemme time it
...how do I time how long something takes with JS... </sheepish-noob>
 
github can burn in hell
 
var now = Date.now();
// something
console.log(now - Date.now())
 
5:13 AM
oh yeah
and then...yeah.
@Raynos runs in 12ms.
 
@andrewjackson you can burn in hell :D
 
will do capt'n
 
!!cowsay T=\/ Raynos looks yummy
 ___________________
< Raynos looks yummy >
 -------------------
    \   ^__^
     \  (oo)\_______
        (__)\       )\/\
         \/ ||----w |
            ||     ||
 
5:21 AM
O_O
 
a goat?
!!learn echo $0
 
@andrewjackson Y U NO MAEK SENSE!?
 
ok ive made a weird js problem
 
!!/learn echo $0
!!/echo `@andrewjackson`
 
@andrewjackson Command echo learned
@andrewjackson `@andrewjackson`
 
5:24 AM
my JS is creating two different answers with the same hard coded maths.
 
that's not what I excpected lol
 
the only difference is one is called via ajax request the other is viewed directly...
any one seen such a result before?
wonder if its a browser bug =/
 
why does so many people think this room is full of psychics?
 
i dont see how i was suggested some psychic ability?
suggesting*
 
because I have absolutely no clue what you're talking about
 
5:27 AM
@Dave while focused in the text box, press the up key to edit your previous message (as long as it's younger than 2 minutes old) ...like so, or so, ...or so, even.
 
make a jsfiddle or provide a working link
 
JSFiddle won't help cos it doesn't simulate ajax requests but i posted it here stackoverflow.com/questions/9816670/…
@ThomasShields thanks for the tip
If you look at my two image examples posted in the question the green bar is different numbers but the maths is both the same. The only variable is the ajax request calls it rather than user directly viewing the page.
 
@Dave *facepalm*
 
hm?
 
5:32 AM
ah :P thats new to me xD
i bet £10 it'll work on JSfiddle
 
yep... code usually works when you remove the other code that's making it not work...
 
i told you its the "same" code
its requesting the same script u view directly so it should work either way
 
I still don't know exactly what that means
you mean you're loading the same code from two separate files?
 
if u view the script directly via url... such as index2.html it works. but if i ajax request index2.html and display it in a document element it gives a different result
by result i mean the maths calculation
which uses fixed numbers so the numbers don't change
 
I bet £10 you figure out what's wrong with it as you're making that jsfiddle
 
5:41 AM
the maths is a simple 500/2500 * 100 = 20. (this is correct viewing it directly in browser). via ajax request it returns 100.
well hopefully :)
hmm think i need to do more research on this one. something suspicious about it.
 
99% of the time that you think it's a bug, it's not
 
I got the same result as you. So im still not sure where this 100 result is coming from on my ajax request
my XHR response also shows the correct number too
 
what's your ajax code look like?
 
u mean my request?
if u look at the maths there the green bar should not cover 100% of the red div
 
5:57 AM
show me your ajax function
the part that's loading it
 
http://www.paste.to/MzYyMzM0 request function.
Called like this ajaxFunction('create_bar.php',res[0]);
i dont use any GET's in this situation cos im just testing it
 
what type of element is "offset"?
 
<p id="offset"></p>
 
smh
remove the html, head, and body tags in create_bar.php
 
i have - no change
 
6:02 AM
well, I'm just saying, you don't put "<html>" inside of "<html>", that's just stupid
nor do you put "<head>" or "<body>" inside of "<body>"
 
i didnt initially but then i added it to see if it would change anything
tinyurl.com/7p29sjg this is the script directly
uploaded it - notice it works cos its not used via ajax request :P
 
where's the script that's loading it?
 
id have to upload that aswell - hang on itll take a few minutes :P
 
you probably just have some cache issues
oh nm
as soon as you upload the next part, I'm going to figure it out in 30 sec =]
 
lol i know u will :P
 
6:12 AM
page me when you're done......
 
will do
server is fussy with security
@andrewjackson done
click the green tile
the bar will load
 
says I have no access
 
refresh
 
I see no green tile
what browser?
 
chrome
what u using ?
 
6:18 AM
chrome...
nm...
 
try clicking in the div in the white border
might work anyway
 
refreshed a couple times and it showed up
 
ah okay
 
but clicking does nothing
 
no bar loads
 
6:20 AM
I haven't ever used canvas....
but afaik...
you shouldn't ever need more than one
nothing
 
the canvas is kinda not related... its the on "onmousedown"
if u follow that - it calls the ajax reuqest
request*
do u get a xhr request in console
when u click
 
ok... ya
 
strange its not showing it for you =/
whats you're chrome version ?
 
canvas is covering menu
deleted the canavas
lol duh
onload = percentage;
this isn't going to execute percentage
the math isn't even happening
 
well - i tried just running straight
without a function
refresh the js script to see edit
it still wont work without onload
 
6:28 AM
you either need to called percentage() inside your script after it loads...
or make it...
	(function (){
			//var perc = Math.round( (/) * 100 );
			var perc = Math.round((500 / 2500) * 100);

			if(perc > 100)
			{perc = 100;}

			else if(perc < 0 )
			{perc = 0;}
			d = document.getElementById('health');
			d.style.width = perc + "%";
		}());
 
but onload wont work for it will for inner html ?
 
you do't even need onload...
onload is for when the page is done loading...
 
i know i added it afterwards as it wasn't working first time round :P
 
the page is done loading long before you load this script
 
refresh i tried you're function
still 100% :P
 
6:30 AM
it's still not running
throw an alert() inside that function
 
shall i alert(perc); ? or some other value
 
it'll never alert
sure, why not?
 
ok done - but yeh it wont show an alert
wheres the best place to call the function =/
 
hmmm
ajaxDisplay.innerHTML = ajaxRequest.responseText;
lol
*facepalm*
 
?
 
6:35 AM
ajaxDisplay.innerHTML = ajaxRequest.responseHTML;
you're welcome
 
yeh i tried that earlier doesn't get a response - as u can see when u refresh
 
console.log(ajaxRequest); above that
 
refresh
 
oops my bad
it should be responseXML
either that or just response
not sure
 
ok refresh
still blank
 
6:39 AM
maybe I'm wrong
 
well this why im so confused - its first time i've come accross this issue
 
change it to just "response"
that's probably not it anyways...
the script should just auto execute, but it's not
 
refresh
it shows the bar
but its still not calculating correctly xD
 
it's not that it's not doing it correctly, it's that it's not calculating at all
 
hmm
if u view the script of the bar directly it shows 100% aswell now
 
6:45 AM
just to test, uncomment your function so that it's named, remove mine, and called "percentage();" in the ajax function right after it sets innerHTML
 
where in the ajax function
 
after ajaxDisplay.innerHTML = ajaxRequest.response;
 
@TusharAhirrao no
 
ok
done
 
6:49 AM
percentage is not defined
 
indeed
perhaps js is not excuted in a request script
perhaps my best option is return an array of the value perc
and then create the bar on the main script instead
 
any body work on extjs 4?
 
i really need to get some sleep! thanks for the help @andrewjackson ! ill see what i come up with with a fresh mind tomorrow ^_^
 
okay seeya
I'll probably figure it out, it might be the dtd
or something, not sure
 
ping me if you work it out xD
 
6:54 AM
ok
 
hello room.
I am trying to use twitters carousel plugin but I keep failing hard. Can anyone please help me?
 
7:11 AM
@all hi
can any one help me in jquery
 
room looks pretty much dead
i will help if you help tho..
 
@AnPel can u help me
 
I dug into underscore_string lib on github, found a function: count , which is to count the number of occurance of a substring in a string​. Out of curiosity, I re-implement it, found that my implementation is much faster, could you please point out what's cons of my implementation, code is here jsfiddle.net/didxga/g4xnC/1
 
7:26 AM
Hello everybody!
How can help me with loading images or divs on demand? Here is my question:
0
Q: Unsorted list: load images or divs on demand

VansFannelI made a horizontal slider using iScroll. I want to show a lot of images, and I added those images like this: <ul> <li style="background: url(fotos/PabloskiMarzo2008.jpg) no-repeat; background-size: 100%; -moz-background-size: 100%; -o-background-size: 100%; -webkit-background-size: 1...

 
GGG
@didxga how does the speed compare to something like "banananana".match(/na/g).length;
 
@GGG the test is here jsperf.com/didxga-test001
 
I answer my question with this: stackoverflow.com/questions/1145208/…
 
GGG
@didxga yep your way is fastest
 
@didxga: pull some request on the project :)
 
7:42 AM
@FlorianMargaine yes, I have sent an email about this to the project owner
may pull a request directly later
 
GGG
you should include the type conversions though
  str = '' + str;
  substr = '' + substr;
other than that they should be identical
 
Yes, right @GGG
 
if we're talking about performance on strings, you should think about buffers then.
especially for concatenation
even though it adds some overhead.
 
8:01 AM
foo%2B%26%2Bbar
Given that I am trying to decode it
decodeURIComponent(foo%2B%26%2Bbar)
Any reason why that don't returns "foo & bar"?
 
Do you know why octavian?
 
GGG
 
9:04 AM
greets, guys
 
@hi All.....
I am android developer. I want to disable the address bar...
of the mobile screen
I am using the HTML5 and Javascript
to create the application
window.open('fname.htm','null','width=400,height=350,location=no');
I have used above but it's not working
@GGG Hii
r u der??
 
 
2 hours later…
10:48 AM
headdesk
 
@OctavianDamiean what's going on?
 

« first day (523 days earlier)      last day (4425 days later) »