« first day (639 days earlier)      last day (4323 days later) » 

1:06 AM
Anyone here besides me?
 
Nope
 
alright see ya guys
Hey copy, would you happen to know how when jquery has finished loading?
 
There's nobody here to say goodbye
 
lol
 
Yes
 
1:11 AM
I'm having this problem with a bookmarklet
in which I try to load jquery
but if I do not call alert then my jquery commands do not work
 
if($) { alert("HAI JQUERY HAZ LOADED") }
Oh
 
I'm guessing the alert gives it enough time for jquery to load
and then the commands just work
 
Probably ~function a() { if($) { alert("HAI JQUERY HAZ LOADED") } else { setTimeout(a, 50) } }()
 
Let me see
 
That's just off the top of my head
 
1:13 AM
makes since
 
And there are better solutions
 
I can make a loop
to check if it has loaded
and if it hasn't then set a time out
I'll try that
 
You already have a loop.
 
Yeah. Don't do function a() { /* something */ setInterval(a, 1000) } or Zirak will murder you
 
Nor stick a while loop in a.
 
1:22 AM
ok, no, this is not good. Somehow jquery wants me to display a message
 
Does jQuery talk to you?
 
I'm not sure what that means
but look, lets try a simple example shall we?
 
I know nothing about jQuery, so don't get excited.
 
[bookMark]( javascript:(function(){
var jqueryScript = document.createElement("script");
jqueryScript.type = "text/javascript";
jqueryScript.src = "http://code.jquery.com/jquery-latest.min.js";
document.getElementsByTagName("head")[0].appendChild(jqueryScript);
var jqueryUIScript = document.createElement("script");
jqueryUIScript.type = "text/javascript";
jqueryUIScript.src = "http://code.jquery.com/ui/1.8.21/jquery-ui.min.js";
document.getElementsByTagName("head")[0].appendChild(jqueryUIScript);
nooo
I suck at this
javascript:(function(){
var jqueryScript = document.createElement("script");
jqueryScript.type = "text/javascript";
jqueryScript.src = "http://code.jquery.com/jquery-latest.min.js";
document.getElementsByTagName("head")[0].appendChild(jqueryScript);
var jqueryUIScript = document.createElement("script");
jqueryUIScript.type = "text/javascript";
jqueryUIScript.src = "http://code.jquery.com/ui/1.8.21/jquery-ui.min.js";
document.getElementsByTagName("head")[0].appendChild(jqueryUIScript);
alert("Logo will go away soon");
You are suppose to bookmark that
and then go to google
click on the bookmark
and the logo will dissapear
this only happens if we have the alert("Logo will go away soon")
if we remove it
then things just don't work
this has been driving me nuts for the past few hours
 
???
 
1:33 AM
Ok, here is what you do, you make a new bookmark, and in the section location you put that code that I have given
When you go to google then just click on your bookmakr
 
The code is horribly broken.
 
and first you will obtain an alert telling you "logo will go away soon"
hmm... I'm sorry?
 
Why don't you do that without jquery
 
I'm just trying some things because I will be using jquery
with more complex stuff
such as making draggable objects
I was already at that point but then I realized that everything came down to this example
in which I load jquery.js and jquery-ui.js
 
Ohh
 
1:36 AM
and then use the function.
but if I remove the alert then, sigh*
 
I just ran your code through JSLint, and it gave me the answer.
 
what is the answer besides: jmlopez sucks at javascript?
 
The answer is to run your code through JSLint, fixing one mistake at a time, until one of them makes you go 'ohhhh ...'.
Followed by facepalm.
 
yeah, :D that's what I'm doing right now
 
I can't recommend JSLint enough.
 
1:41 AM
I am in fact doing lots of facepalms
Yeah, I had no idea that JSLint existed
bookmarked
 
I only did one. :-)
Hint: your alert fixes the problem, as you said. So guess where the facepalming code is.
 
I'm actually more confused now hold on
 
I don't get it
 
Well, you can't use jQuery if it doesn't exist yet.
 
Why does jsLint allow one to tolerate stupidity? I've seen programmers tolerate many things but never once have I seen a true hacker tolerate stupid.
 
1:45 AM
I think that's what Jennifer Lopez realized by herself
 
lol
No, j does not stand for Jennifer
 
@SomeKittens You've never met a Java hacker then. Oh, wait ... :-)
 
and yes, I realized that jQuery needs to be loaded first
 
@adscriven I think the term "Java Hacker" is an oxymoron
 
@jmlopez Keep pondering ...
 
1:47 AM
I'm not quite sure if I'm using JSLint correctly
 
@SomeKittens :-)
 
if I just try: alert("HI"); in JSLint
then it says: 'alert' was used before it was defined.
 
@jmlopez You're using it correctly.
 
so yes, I'm still pondering
 
JavaScript doesn't define alert.
You can set options in JSLint.
One of them is to assume that you're running JS in a browser.
Try turning that one on.
 
1:48 AM
I'm guessing it also doesn't define document then?
 
Nope.
That's part of the host environment when running in a web browser.
 
Huh... yeah, I don't know why I wasn't told this before
keep educating me please
 
I still don't see what JSLint should tell us that we don't know yet
 
Well, it doesn't exactly, but it made me go 'duh'.
test4.js|15 col 16| '$' was used before it was defined.
 
Yes, I just saw that
and I was telling copy, I thought that maybe doing a loop to check if it was defined would fix the problem
 
1:52 AM
Okay, now we did all the overly restricting whitespace cleanup (and other things) and learned nothing new ?
 
@copy Heh, I always add /*jslint white: true*/ to my code.
But that's all.
 
Ok, I want to be able to say duh, what am I not seeing here?
 
A loop to check if it's defined would fix the problem.
Well, a wait of some kind.
That's what the alert does.
 
the alert gives it enough time for jquery to load
 
Right.
 
1:55 AM
so how would one fix it so that JSLint doesn't complain
I'm not planning on using JSLint religiously
 
The two aren't directly related. JSLint just pointed me in the right direction.
 
I mean, now*
 
Well, you can tell JSLint about global variables.
/*global $*/
 
@adscriven In my opinion, Closure Compiler is more useful for checking your code
 
Ok, so now that I put global $ in JSLint it works
 
1:57 AM
@copy Thanks, I'll check it out. I've only ever used it for a bit of compression.
 
but I'm still not sure how to make the right loop or just the right code (besides alert)
 
Maybe I'm just crap, but JSLint has found so many bugs for me.
 
to make that thing work
 
It's not so restrictive regarding code style, but warns about bad function calls and also checks the type of variables and return values if you tell it to
 
@copy That sounds rather cool.
 
1:59 AM
Ok, so I'm looking here: learningjquery.com/2009/04/…
I will try to use the function getScript
 
Yeah, that looks like the ticket.
@copy What's a 'bad function call'?
 
2:16 AM
What is the difference between == and ===?
 
== does type coercion.
Most of the stuff JSLint checks for is documented.
 
hehe...yeeahh... about that... no, but I will now. Thank you.
anyway, I better stop myself now. Its late and I haven't eaten. Thank you guys for your help.
 
np
SO has nice colours. Links should be blue. Or this colour.
And all IM should have an edit feature.
 
2:59 AM
Is there any soul here?
 
hello everyone :)
I need some help here jsfiddle.net/sevtiandy/8KUVB/2
I want to show the name of month from number of month in json object
 
3:28 AM
@nhahtdh yep ?
 
3:49 AM
Is it better to clone "template" hidden element in HTML, or is it better to use template framework to create dynamic HTML elements?
 
4:03 AM
0
Q: Performance difference between reassigning variable and redefining

JackMahoneyWhich style is better practice for performance in Javascript? Style1 var x = '' for(var i = 0 ; i < arr.length ; i ++){ x = .... //do something with x } Style2 for(var i = 0 ; i < arr.length ; i ++){ var x = .... //do something with x }

 
4:42 AM
anyone please help me jsfiddle.net/sevtiandy/8KUVB/2 :(
 
5:07 AM
@blankon91 are you serious ?
You posted the same thing 2 hours ago
and your code didn't change since then
Did you try ? made some research ?
 
5:24 AM
So, I checked, and I guess there are no other rooms. But basically, I'm wanting to implement an ability to allow users to login, edit, create, and rate articles on my site. I already have a huge chunk of the site wrote, and I think I need a CMS, but I'm not sure how to go about implementing a CMS into an already made site.
 
5:52 AM
I have a question, how can I save the changed made to a document via DOM , using javscript ?
Here is the link to the source code of my html file hastebin.com/sakolijoco.xml
line #36
I searched it on google, but havent been able to find something as of yet, is it even possible to do this with javscript ?
it is supposed to be taking the url from the user and displaying it, and it does that , but when i refresh the page , everything is lost
How can I use DOM to save the recent changes ?
 
@dievardump yes I was trying to search the solution but I can't find it..I don't know what is the best keyword for my problem so I can find it on google correctly
 
Okay guys please ping me your suggestions as to how to solve that problem. I am sorry but I have to be afk now, against my will, :(
 
6:10 AM
@SauravTomar You can't. The DOM is local to the page. If you want consistent change, you need a server to do it.
Or somehow store the fact that there's been change on the client (cookies, localStorage, etc) and then respond to that on load
 
So I should use a server side language like php.
or Ajax
 
...the term ajax is like the plague...
ajax, which is a bullshit gimmick name for XMLHttpRequest, is about sending an http request asynchronously to the server. You can't either use a server OR send an http request to the server...
 
So php will do the thing for me.
 
It won't do it for you, you'll have to tell it do, but at the end, yes.
 
I want to kill node.js
 
6:16 AM
yes , i guess that was apparent :)
 
really kill it an burn it alive
 
It caused your bottleneck, or just programming angst?
Also, what? kill it, and then burn it alive?
 
@OctavianDamiean so here is my problem [ native modules ]
i send nice very high precision - 0.000000000000000000000000000000001 value
i use googles functions to send it
when it comes to JavaScript . it turns into NaN
 +ve 935 / 935
 -ve 0 / 217
NaN 217
Got Array Buffer 1152
JS / C++ counts.
give me one reason to not burn it alive :-|
 
Well, I can just tell you that I didn't get a single word.
 
6:24 AM
sorry (xD)
 
managed to publish 7 npm modules this weekend
 
well i am writing a native module for nodejs which returns audio samples to the JS side of node , when i send very low -ve floating point numbers to javascript ithey mysteriously become NaN
 
this is acceptable progress
 
@Raynos what is NaN in javascript i mean the binary pattern for NaN
 
no clue
 
6:25 AM
:-/
 
@Abhishek have you tried flagging your work as a micro optimization and writing some other code?
 
@Raynos can u re-type that in english ?
micro optimization , ? flagging ? what ?
 
do you need access to ffmpeg over a C++ bridge
why not just use the CLI ?
are you sure this performance increase as a native module is worthwhile use of your time ?
 
Cause i dont want the full file to get converted at once
i want frame by frame decoding
@Raynos yes it does
this way i can parse 100+ Mp3 files on an 8 core xeon simulatenously
the other approach will parse maximum upto 30 files in shorter time
but i dont need it .
I just need to de-code them in real time { say the next 1s of play back } mix with the other buffer and then re-encode it and broadcast .
 
Are you sure that the CLI of ffmpeg doesn't offer frame by frame decoding?
 
6:29 AM
@OctavianDamiean havent seen any example of such yet. moreover ffmpeg is for a different purpose
 
I'm asking because it appears to have a bazillion of options.
 
I read em :-)
+ a cli approach for frame - frame decoing wont scale much either
consider 100 cli together and then another 100 encoding back
[dirty]
I think i will just wrap everything into C++ , nothing with node other then the top level interface :-/
 
you think so ?
 
@Raynos have tested it
 
It would be the same thing.
 
6:32 AM
have you tested the performance increases ?
 
yes.
 
have you tested wether using the cli is a real bottleneck ?
this smells badly of a micro optimization
 
yeah sadly, but this is related to job so can't quit.
 
well you can
you can use the CLI
and be done with it
if the CLI is not a bottleneck
then dont optimize it
 
@Raynos i think the way cli acts is a bottleneck
see the situation is this. i dont want the fastest audio de-code
i want the maximum simulatneous scale
for me de-coding 200 mp3 files in there playbacktiem ( 4:00 minutes for instance ) is okay
but when u run the cli it just greedily tries to de-code in one go , which is very optimized and fast but not for the required case
 
6:40 AM
Can you fiddle something up where such a number would result in NaN?
I still don't quite understand how that would happen.
 
Thats what i am wondering :P
 
For me that number always results in -1e-33 when I parse it.
 
from C++ to JS ?
 
I don't see how that'd make any difference.
It is a number.
 
it can sometime number is just a binary pattern depends on the language how it identifies it
 
6:46 AM
I still think that you somehow pass an invalid number.
 
I don't know. Show us how you create the number and pass it,
 
line 185
the for loop has the code which sends the number to JS
when i run the code JS identifies all +ve samples correctly [ the counts in C++ and JavaScript Matches ]

but when it comes to negetive numbers javascript doesnt catch :-/
 
Alright, what's this mysterious +ve thing?
 
where ?
 
6:50 AM
> ... all +ve samples ...
 
ah the audio samples are in floating point -1 to +1
the +ve samples are the ones which are over 0 , javascript has no problem understanding those.
@FlorianMargaine hey there o/
maybe i should not bring numbers to javascript atall :-/
 
Alright, and where exactly do you call the JS function?
 
still struggling with NaN, heh
 
maybe i should stick to buffers instea.
@FlorianMargaine you wont believe what i am seeing
 
6:54 AM
@Raynos how do you like this framework? github.com/Ralt/tartempion
@Abhishek I saw that
 
even worse now (XD) negetive == nan
 
don't send if isNaN, and you get isNan
oh
every negative?
 
yes
 
sounds like signed.
 
@OctavianDamiean call in where javascript or c++ ?
// there are two candidates for your question (x
 
6:55 AM
are you sure you're sending unsigned numbers?
 
I assume both. Tell me both.
 
and can't you send absolute values to js with a flag to know whether it's negative or positive, this way the js gets positive only and can work with this according to the flag?
 
@FlorianMargaine i think i am just gonna send a buffer to js now and convert to numbers in here
 
nah, still slower
bitwise stuff in js is slow
 
6:57 AM
or even better i can just write all the module in C++ and just provide javascript interface to control em ?
 
@Abhishek Be sure.
 
[ as in the whole transcoding happens inside C++ and just the final buffer in mp3frame data comes out of it ]
 
if it's enough, yeah
 
God C++ is an ugly beast ...
 
lol
 
6:58 AM
It is like the Anticorn.
 
(x
pastebin.com/zPLczwSu @OctavianDamiean
they get worse with the documentation they provide
 
@adscriven skype has it since a few weeks
@Raynos any useful one? :D
 
@FlorianMargaine skype has always had the edit feature !
 
never noticed it before :|
 
lol
i found it out idk when by accidently pressing the up arrow
// on windows i am talking about
 
7:15 AM
-2147483648
 
(int) of the sample that gets turned into NaN
 
kinda normal then
 
yeap
though converting to int loses its 2 bytes
but still ^_^
 
0
Q: Correct use of "wanting"

ZirakTo begin with a clarification: I'm not speaking of "wanting" as in "lacking" (e.g. a box wanting its lid.) Rather, it's about uses like this one: Person A: I want to go with you. Person B: Thank you for wanting to go with me. To me, it sounds so horribly wrong to use "want" like that, ...

 
7:19 AM
0
Q: Sort a view by country - according to the translated countries

Florian MargaineI have a view displaying some nodes of a content type. Each node has a location assigned (with the location module). I want to group and sort the results by countries. The grouping works fine, and the sorting is almost fine too. It does sort by country, but it does it using the english countrie...

@Zirak > but I can't figure out wh.
 
@FlorianMargaine ugh, thanks
 
@Abhishek Can you log how the number looks like when it's on the JavaScript side?
I mean how your JavaScript function receives it.
 
same
when i convert to int there is no issue
 
Yea got that I meant when you don't convert it.
 
When i get it on JS side without (int) , its simple NaN
 
7:25 AM
PHP folks discovering forEach
 
lol
okay i am going to drop the idea :-/
this aint gonna work , even when all are getting converted to int i still have 192 NaN
@FlorianMargaine lets drop the idea of Samples lol
i guess i am going to have to write the full "AV" module of tapeer :P
 
enjoy :]
 
i was writing this module wise because i thought i could re-use the work code in tapeer
but nah i will have to write it seperately ^_^ no issue i learnt a bad lesson today
 
Hi @Abhishek, How r u today?
 
how are setTimeout( fn, 0 ) any useful? can't he just use fn()?
 
7:42 AM
@phpGeek hi
 
Do you have any good link,reference, or article about Node.js,Socket.io
I want to spend today to Node.js
 
@FlorianMargaine setTimeout() is used to provide delay
 
@hiteshtr did you read? setTimeout( fn, 0 ) provides a 0ms delay
which is translated in a 4ms delay in modern browsers
 
@Abhishek I'm not talking about parsing the number but about just logging what the function received.
 
@OctavianDamiean It receives an Array.
of such numbers
 
7:46 AM
Did you inspect the content of the array before parsing them?
 
yes
 
They're all valid numbers?
 
yes
 
setTimeout has a minimum timeout of 4ms
 
are you even reading me?!
6 mins ago, by Florian Margaine
which is translated in a 4ms delay in modern browsers
10 mins ago, by Florian Margaine
http://dbaron.org/log/20100309-faster-timeouts
 
7:51 AM
@Abhishek Then burn something down.
 
lol
@OctavianDamiean lol told yew
i am going to write this purely on the top of libuv now instead of nodejs
 
@FlorianMargaine setTimeout has a minimum timeout of 4ms did u get why browser convert 0ms to 4ms and ans to ur question is if u need delay then only use setTimeout() otherwise don't use it
 
Just to make sure, you are trying to parse each number in the array on its own right? You are not trying to parse the array as a number.
 
yes
 
7:52 AM
@hiteshtr are you even fucking reading me?!
 
let me perform a few more tests
 
o/
 
@FlorianMargaine You gotta scream, maybe he can't hear you. :P
 
@FlorianMargaine this link will clear your doubts stackoverflow.com/questions/779379/…
 
@OctavianDamiean well, clearly, he's not reading what I'm writing
 
7:54 AM
Yea.
He's like totally ignoring everything you write. :P
 
@hiteshtr you're useless.
 
Kinda funny.
 
kinda frustrating, too.
 
this doesn't answer me tho
 
7:57 AM
@FlorianMargaine AHAHAHAHAHAHAHAHHAHAHAHAHAHHAHAHAHAHAHAHHAHAHAHAHAHAHAHAHHAHA
 
why would someone want to have a real setTimeout( fn, 0 ) instead of just fn()?
 
@hiteshtr do you know english
 

« first day (639 days earlier)      last day (4323 days later) »