« first day (643 days earlier)      last day (4310 days later) » 

4:00 PM
The Drag and Drop
maybe because it's an iframe ?
 
@Zirak I'd modify jQuery to use a new symbol
 
Nop, It's the body size
 
@Steven10172 You go do that
I'm gonna eat cake
 
lol
 
@dievardump is working in firefox now jsfiddle.net/U2fqR/4
 
4:03 PM
@Zirak I made a new anti-sex drug. I called it Microsoft.
 
I wasnt preventing default on right events
it has now
$(document).on("drop drag dragend dragenter dragleave dragover dragstart", function(e) {
    e.preventDefault();

    if (e.type === "drop") {
        handle(e.originalEvent.dataTransfer.files);
    }

});
lol
to do ad-hoc drag/drop you need mouseup/mousedown/mousemove
to do it with native you need 7 events
 
@rlemon I made a website, where whenever someone did your gf, they'd say something random. I called it Twitter.
 
gf? Way more fun to go with 'mom.' But of course there's always the higher risk somebody's mom died. For some reason that just sucks the ha-ha out of screwing-your-mom jokes.
 
mom-sister-gf. The holy trinity of jokes.
dad-brother-bf is the Mormon version
 
how do you get the image from canvas
toDataURL is not even in the prototype and webkitGetImageDataHD throws not supported error
 
4:11 PM
getImageData IIRC
 
wow $("canvas")[0].getContext("2d").getImageData()
Error: NOT_SUPPORTED_ERR: DOM Exception 9
 
The Mormons officially cooled it on the anti-gay, apparently.
 
ok this gives me the pixels
but I want png binaries from it
 
Put it on another canvas
 
wow lol
 
4:14 PM
@Esailija you can save it as a png
 
toDataURL needs to be called on canvas, not the context
 
http://www.nihilogic.dk/labs/canvas2image/
 
/fail
 
Can you at l least specify the context in toDataURL?
 
Context doesn't matter
It's the current canvas, all context included.
I'm not sure you can have more than one context, though
 
4:16 PM
I mean, .toDataURL method is not in CanvasRenderingContext2d but in the canvas element itself
 
Can you get an image object out of a context?
Oh okay. NM.
I can kind of understand modelling it that way. Whatever's in the canvas element is its contents.
 
Hi all! I saw this regex : /^\s+|\s+$/g in stackoverflow.com/a/10876281/1344937 Can anyone tell me what's the point of writing \s+|\s+ instead of \s+
?
 
it's ^\s+ OR \s+$
meaning at the beginning or at the end
\s+ means spaces
the ^ means at the beginning of the string
and the $ means at the end of the string
 
@FlorianMargaine Thanks a lot :)
 
4:29 PM
I'm surprised it works without parens. I would add them just for clarity: (^\s|\s$)
Oh no, I shouldn't be surprised nm.
 
parens/no parens? why?
I'm kinda nooby at regexes
Esailija explained me some stuff, so I can somehow get it
but still.
 
I just got it in my head that they were necessary to keep it from being \s|\s but I think people tend to wrap in parens to avoid other kinds of confusion.
But it doesn't really matter if there's nothing else in the regEx.
@FlorianMargaine Did he explain about '.' being disastrous to regEx performance?
 
in PHP, 2 mins ago, by Truth
http://stackoverflow.com/questions/11583028/boobs-operator-in-c-c-code-is-it-possible
 
'.' is just "matches one character", right?
 
4:34 PM
No it's a wildcard. To find a match it compares every character possible until it finds it.
Actually I think there's some old teletype whitespace characters it doesn't match but that's not likely to matter.
 
I thought it was a wildcard for one character only?
do you mean *?
 
One character yes, but it still runs a matching process.
/a./
1st character: Is this an a? Yes, good, on to character 2.
2nd character: Is this an a? No. Is this a b? No. Is this a c? No. Etc...
 
yeah... like any wildcard
 
It's stupid but there are some obscure characters it doesn't match so it has to run comparisons for everything it does.
 
oh
I see
 
4:37 PM
@ErikReppen source please. Sounds like you are talking bs to me
 
@ErikReppen Why does it not do the reverse ?
 
yeah... it sounds weird
 
If there is only some that it does not match, then it has to only match if it's not one of them
 
. matches everything except for newlines as far as I know (and you can add a flag to change that)
What are some old teletype whitespace characters ?
 
hehe
-1 not enough boost. — R. Martinho Fernandes 2 mins ago
hmmm it said jQuery before
odd
 
4:42 PM
I was reading it in an O'Reilly book. That was my understanding of why it was subOptimal to use wildcard over negating character classes. Looking for an online reference.
 
weird... whatever... :-\
 
@Esailija you could have just looked at lememe
:P
 
I am trying to follow this tutorial blog.flashgen.com/gaming/starling/…
I have now all separate images, now I m supposed to create some kind of textureatlas
 
I used substr(22)
 
4:45 PM
@ErikReppen You might even be right: es5.github.com/x15.10.html#x15.10.2.8
The production Atom :: . evaluates as follows:

(1) Let A be the set of all characters except LineTerminator.
(2) Call CharacterSetMatcher(A, false) and return its Matcher result.
That's...scary
 
Only if CharacterSetMatcher sucks
 
is it just me or does the search button at the bottom look like a slider
 
I suspect the idea in regEx matching is to reduce logic as much as possible so you can hit really big strings more efficiently when you take into account stuff like the wildcard not doing what would typically be the smart thing.
The teletype thing might be irrelevant in JS. Not sure about that now.
 
@rlemon lol yea
ok I finally managed to create stupid textureatlas \o
the tutorial could have said 1 word and it would have saved me 10 mins
 
4:52 PM
But I've definitely read in multiple places that it's better to do one of these:

/[^s]*sassy/

than one of these:

/.*sassy/
Which is why seeing Crockford put [^] on his jsLint shitlist kind of made me want to kick him in the nards.
 
Hey guys, with node.js how do you decode a query string such as test[name] to { test: { name: "value" } } ?
I used querystring to decode but it gives me {
"project[name]": "test"
} instead
 
you need a custom parser
iirc it's what express uses
@TomShreds you could use a regex for this :p
alright
gotta go
have a nice week end guys!
 
lol ide is pretty awesome.. it's writing half the code for me
 
Query strings don't have "nested objects". If you're using custom syntax, you'll need to make a custom parser, as Florian Margaine said.
 
5:00 PM
@FlorianMargaine good idea, have a nice weekend too
 
-1 not enough jquery — Sam DeHaan 19 mins ago
There. it finally worked ^_^
 
thx for the answer
has this express custom parser been published?
 
@Esailija !!!
 
@copy, negation probably adds some overhead too. [^\s] should technically represent fewer characters than'.'. Maybe best to only use single-characters on it.
 
@Esailija ide for what?
 
5:09 PM
I am doing flash
 
o_O why?
 
for gpu accelerated sprite animation
for work :/
our "flash developer" has no idea what that means
he made software animated sprites and says flash is slow and he can't help it
so I'm doing it now
because I tried to explain to him that he is using software methods for animating
and he didn't understand at all
 
i'm sorry I stopped reading at 'flash'
 
I suck at this, I cannot rename stuff right
 
@jasonjifly thanks! i have to think on that pattern, only choice
 
5:13 PM
Error: A file found in a source-path must have the same package structure 'xxx', as the definition's package, ''.
what does that mean
 
anybody with experience in neural network programming ?
 
@Abhishek I wrote some stuff in 2005 using c#.net for facial recognition.
wasn't too accurate (but that was my training and lack of understanding on how to actually teach the thing)
 
hmm
 
codeproject.com/Articles/16447/Neural-Networks-on-C after reading the page that looks promising
also looks like he followed the same 'guide' I did :P
 
I have a small programming issue
i have multiple nodes connected to same node and each such node can have multiple nodes aswell
 
5:18 PM
yea?
that is a neural network
 
i have reference to the node [ which is where ultimately all nodes are connected to]
 
ahh
what do you need to do (high level)
 
i cant figure out the best method to call each and every node to do its processing before calling hte last function
call them all :-/
 
by node you mean 'net' or node === neuron
 
neuron
 
5:20 PM
'net' === layers or neurons connected and weighted
 
can i sketch ? just a minute
in short though say i have reference to a;
now b , c are connected to a;
d,e are connected to b;
when i call a function in a;
 
hi
 
it should call d/e at first and then b ,c then a; I know how to do this but whats the best method ?
 
i have a website
i want to change the host
will this effect the search traffic?
 
why would you come into the js room to ask such things?
 
5:22 PM
please guide me
 
I can point you in the right direction
-----> google.com
 
I mean, I don't go into English Lit and ask about my car problems do I?
@Abhishek lol when neural networks are concerned the best method is the one least prone to failure and the fastest one. albeit fast is not always going to matter so long as it is accurate (fast is what the trained network will be.... i'm assuming this is for training purposes)
 
This is rather for production purpose (XD)
remember i was trying to make web-audio in nodejs :P the audionodes interface in web-audio is one hell of a mess to code for optimisazation
 
You mean, a breadth-first call? Recursion
You can borrow the logic from trees
 
hmm.
Currently what i am doing is .. [wait let me write a js version ]
 
5:26 PM
a -> b, c
b -> d, e

call(a) ->
	call(b),
	call(c)
	do_stuff;
call(b) ->
	call(d),
	call(e),
	do_stuff;
and so on
Instead of the manual call(...), you do it over all children programatically of course
That's how I'd do it, at least
 
in case we didn't see this the other day
gist: Javascript F U, 2012-07-19 19:36:21Z
    function FF() { return "F"; };                     function UU(){                 return "U";};
    var i,F,f=FF();                                    j=0,U=[],u=UU(),               i = 0,F=[],
    F[i++]=f,                                            U[j++]=u,                     U[j++]=u,
    F[i++]=f,                                            U[j++]=u,                     U[j++]=u,
    F[i++]=f,                                            U[j++]=u,                     U[j++]=u,
    F[i++]=f,                                            U[j++]=u,                     U[j++]=u,
    F[i++]=f,                                            U[j++]=u,                     U[j++]=u,
    F[i++]=f,                                            U[j++]=u,                     U[j++]=u,
    F[i++]=f,                                            U[j++]=u,                     U[j++]=u,
    D = function(a,b){return a+b},                       U[j++]=u,                     U[j++]=u,
    F[i++]=f,                                            U[j++]=u,                     U[j++]=u,
    F[i++]=f,                                            U[j++]=u,                     U[j++]=u,
    F[i++]=f,                                            U[j++]=u,                     U[j++]=u,
    F[i++]=f,                                            U[j++]=u,                     U[j++]=u,
    F[i++]=f,                                            U[j++]=u,                     U[j++]=u,
    F[i++]=f,                                            U[j++]=u,                     U[j++]=u,
    F[i++]=f,                                            console.log(D(F.join(''),U.join('')));​
F U javascript... F U so hard.
I run this when i'm pissed at js now.
then I instantly run this one to calm myself down.
gist: trolololol, 2012-07-20 14:29:12Z
var a = 'abcdefghijklmnopqrstuvwxyz1234567890.',
    i = 18, j = 0,
    b = [a[i++],a[++i],a[++j],a[--i-1],a[i],a[--i-1],a[++j*(j+j)],a[--i-(j+j)],a[j*j+j]].join(''),
    f = function(x,y) { switch(x){case(1):o=y;break;case(0):l=y;break;} return y; }, o,l,
    c = [a[b](i+j)[0], a[b](i++,i), f(1,a[b](--i-(++j),i-(--j))), f(0,a[b](--i-((j++)+j), (i++)-(--j+j))) ].join(''),
    e = o + l,
    d = c+Array(++j+j).join(e);


alert(d); // you mad bro?
 
function foo(int){
  var val = int;
  var family = [];
    this.connect = function(sibling){
        if( sibling instanceof foo){
          family.push(sibling);
        }
    }
    this.food = function(){
        for(sibling in family){
         family[sibling].food(); // "Do the process"
        }
        console.log(int);
    };
}​
thats what i am doing , looks like its what zirak tells me :-)
// all this looks so beautiful in javascript.
 
Spocktopus
 
okay @rlemon i have a question again
since you helped me a lot previously
 
so shouldn't you be letting me do my work now?
:P I kid, it's friday. i'm not working. :P do ahead
 
5:38 PM
haha okay :P
I want to do this now: <object> <param /> <param /> <embed /> </object>
make an object instance, and put those things inside of it
I've been emulating the way you did the embed part
but now i don't know how to arrange them using js
can you even do that?
 
yes
yes you can
are you doing a lot of client side 'templating' like this?
 
well not really, this is just a single video player on a webpage where people can stream
all i have is a player and a grid below where people can click on a video and play
 
so this is the only thing html wise that is being manipulated by js
 
yup
 
ok and you want to replace <object><param/><param/><embed/></object> with an entire new object
function vidSwap(vidURL) {
    var embed = document.createElement('embed'),
		param1 = document.createElement('param'),
		param2 = document.createElement('param'),
		obj   = document.createElement('object');
    embed.type = "application/x-mplayer2";
    embed.id = "embeddedVideo";
    embed.pluginspage = "http://www.microsoft.com/Windows/MediaPlayer/";
    embed.src = vidURL;
    embed.name = "MediaPlayer1";
    embed.style.width = "680px";
    embed.style.height = "656px";
    embed.autostart = "1";
youtube vids?
 
5:52 PM
Nah, I work with police dashboard cam vids
 
but similar yes? <embed> code wise
 
but thanks man, i like the .appendChild magic
oh yeah, it's pretty much the same aside from the new function/method you called on object
it's re-creating and playing the audio
which is a good thing
unfortunately the video isn't working, but that can be fixed easily i imagine
 
@Abhishek ugh, why instanceof and the likes?
 
there is my take on it
however this is youtube vids.
but you can imagine how this would work for you right?
 
@Zirak call effect of working with a strict typed language
i just wanted to make sure all of family have the same basic structure
 
6:06 PM
It's even discouraged in Java, and I'm in favour of the "if you're stupid and you use my API, then things will go wrong" approach
 
ahh the anti-jQuery pattern
 
Probably a good place for console.assert(elem instanceof bar);
 
Because that enables people who are smarter than me to use my API
 
yeah, i see how this works
and the embedding part in the html area looks almost exactly like mine
except i'm using wmp of course
 
6:10 PM
Also, for in over an array is super highly discouraged
 
...
 
why did I download canary build....
 
@Zirak @Zirak it was the fastest code i could do.
the actual code is in C++
 
Relax, I won't eat your face :P
This time
 
i did js more like an example of what i am doing and i know why should not do "in" for array because of length etc Btw those merely 12 lines in JS are over 40 in C++
 
6:13 PM
Rage at massively downvoted question :\ - stackoverflow.com/q/11581717
 
@user1438003 the coments explain why they downvoted.
 
Reason to love Emacs #1294: M-x regexp-builder, insta built-in regex testing
 
@user1438003 It's typically referred to as a 'dropdown.' Downvotes are a little harsh when you don't have the vocab to Google. I would downvote if you were asking for bootstrap dropdown code links.
 
@Zirak tinkerbin seems usefull, but... OMG Y IS IT SO UGLY ?
 
6:18 PM
@dievardump I agree, but I like it more than jsfiddle. Alt-4 and you can actually see what you're doing
Though I heard Opera doesn't like it
 
@Er
@ErikReppen Yeah, I was asking for something a little fiddly and just watched as my question got more and more downvoted >.<
 
Actually I think bootstrap just uses it in the sense of dropdown menu like a select form element replacement.
I usually just make the button the container for the message part and set it to position:relative.
 
Nevertheless I was annoyed that I couldn't add my code as an answer
And my answer was rather elegant BTW
 
Then the inner part absolute and bottom:-height of alert.
People are a bit touchy about "How do I do X with this library" questions since they tend to end up being highly googlable or have extensive documentation.
 
Anybody have opinions on open source sound editors? I'm thinking simple sound effects.
Ick. Drupal's not pointless enough?
 
@user1438003 You can edit the crap answer to be your answer. yay! ^_^
As long as people learn :-)
 
:)
Does that mean the question is to be reopened now?
 
NO NO BAD DOG! — Neal 2 mins ago
Why for the love of jQuery....
-1
Q: Simple js replace and return text?

Jonah Katzthis is probably pretty simple. Basically, i want to replace the _ with nothing and return the text. Take a look.. http://jsfiddle.net/NcG78/ function formatNice(text) { $(function() { var new = text.replace('_', ' '); return new; }); }​

 
7:03 PM
@Neal I think it's a Friday troll.
 
Hmm
shall i just remove the jsAudioNode interface from my Cpp api :-/
@Zirak sorry to bug you again
but can u suggest something.
The issue is the traverse on the neural network occurs inside a different thread ( so that its asynchronous )
but a specific type of node requires it to come back to the main javascript thread.
I can't figure out how to identify which node does that JS event occured in , well even if i can do that i am confused how to actually do this :-|
 
@Abhishek Can't you attach more data to the event? Like you have in DOM events, an evt.target property
 
in PHP, 17 hours ago, by rdlowrey
Man if I could torrent beer and hot chicks food I'd never leave the house.
 
@Zirak hmm
 
@rlemon It's called a takeout. Never seen the insides of a Pizza Hut place.
 
7:14 PM
but still i can't figure out how the traverse can occur after it :-o
 
A free takeout is when a shotgun is involved
 
i mean it will just stop the whole traverse for no reason :-( , no fun!
 
But since they live on different threads, and if I got it right and all you need to do is trigger an event for the other thread, why does execution halt on the node-traversal one?
Inside of the call method of whatever it was, if ( this.type === something ) { fireEvent('somethingOrAnother', this); }, and you move on as usual
 
@Zirak I live at number 10, there is a 9 and 12 but no 11 on my street. I order stuff (which has a X minutes of free policy) to 11 and watch the delivery man drive down the street for five minutes - then I call back and complain and tell them "I SAID 10 YOU <insert profanity>" They usually apologize a bunch give me no charge - this is how you get meals for free
 
@Zirak it doesnt happen that easily :-)
 
7:18 PM
 
for instance the js audio node will require the execution of the javascript function to end
before it gets the javascript updated buffer
moreover to call a javascript function or even trigger an event i will need to come into the js thread or it will throw exception
 
@Abhishek I'm sure it doesn't, but why does calling the event on another thread halts the current thread? I think I just misunderstood
 
and worst case die with a seg. fault.
 
ah, the wonderful world of C++
 
hmm how to explain this
by design of awesome v8 , its written to run inside a single thread now when u run some C++ code for nodjs which has to deal with JS it just runs with the main javascript thread.
 
7:21 PM
@rlemon This is how french people do it: youtube.com/watch?v=27NX_MMIkLY
 
when u have to go for asynchronous I/O you make a different thread into a thread pool
and wait for that huge function to complete and then fire another function in the original javascript thread
to let javascript engine known .. woot i am done! now here is the shit u wanted done at lightning speed
so my traverse will work in a thread but if it encounters a jsaudionode it will just stop execution and come back to main thread which will totally mess the whole traverse as then we wont know where we were :-(
 
How about a state? Store where you were somewhere
 
still . it wll create complex issues
like in the code example i showed
 
State always creates complex issues
 
@Abhishek can you rewrite the gigantic JS function that's causing you touble?
 
7:26 PM
...
urgh :-/
draing time
 
Maybe break into pieces that can be queued and interrupted as needed?
 
@copy that is awesome
 
@ErikReppen its not js function its js function called from C++
 
But the two solutions I can think of out the top of my head are a state and callbacks, and you shattered the latter
 
@Zirak the issue with state is
i will have to store the whole execution queue aswell
or its gonna be one hell of a bloody mess :-|
 
7:29 PM
@rlemon If you have 4 hours time, also watch the other Remi Gaillard videos
 
Kittens frolicking beneath a rainbow. Unicorns prance across the background.
 
wait zirak you are awesome! , callbacks!
 
That's not the only issue with state; which is why FP is "no state land"
 
@copy if I had four hours time i'd be sleeping / fucking / gaming or dead.
 
Really? oh. Well. cough Yes/
 
7:29 PM
there is never enough time
 
Yes, I am awesome. calls dad SEE!? TOLD YOU
 
i can pretty much call another function from the thread in the main thread , by some blackmagic which just invokes one callback at a time!
 
@rlemon Didn't you create a whole bunch of useless obfuscated code ? You gotta have some free time, bro
 
on next tick all these will be invoked , and till then our other hyperthread can rest :o lol can rest :-/
 
Glad that works out for you
 
7:31 PM
gosh if this works i will give u credits in ReadMe on top lol
 
@copy yea but that only took like 10 minutes
LMAO
that is by far my fav of the 5/6 i just watched.
 
ok so I have .isAnimated
tehn I wanted to make public function isAnimated()
apparently that is ambiguous?
 
On a scale of 0 to Al Gore, how pathetic is it that the most romantic moment you had in the last year was cleaning your com's CPU?
 
I give it a convenient lie
 
@rlemon Pathetic/lame. I wonder why nobody noticed that before (and why that guy didn't remove it after noticing that it doesn't work)
 
@ThiefMaster he is a content scraper - owner of advancesharp.com
i've been red flagging this guy for ages now
 
isn't that one of the sites mentioned in the meta post on sites who steal SO content without proper attribution?
 
8:16 PM
9
A: Report sites that use SE content without following attribution rules here

rlemonhttp://www.advancesharp.com Example of content: Why does $($) crash my page? is the original; here is the copy: http://www.advancesharp.com/Questions/7587/why-does-crash-my-page Beating jQuery addiction: Which jQuery methods are easily translated into pure javascript? original Copy which...

14
A: Report high-Google-ranking SE content copiers here

rlemonhttp://www.advancesharp.com/Questions/7587/why-does-crash-my-page is a direct copy of Why does $($) crash my page? and so far (other than the retained links from the sister sites) I do not see any citation or linkage to the SO site or question. The do not follow the the content attribution rules...

i've also contacted asp.net
dude has like 4 or more accounts
also be on the lookout for ubuntu365.com - he is a one day user with already 4/5 removed posts because of spam ads
still a few on the index
 
8:31 PM
@Esailija What does it do?
 
it returns whether the class wrapping a movieclip is animated
now I am wondering how do I replace a movieclip with an image while it's idle
 
What do you mean that the class is animated?
 
nevermind
 
Sorry, did scroll, but could find any more context.
isAnimated returns a boolean, right? It's ambiguous though in the sense that it isn't clear if the verb is transitive or intransitive.
 
I mean there cannot be a method and property with the same name
 
8:36 PM
A method is a verb and a property is a noun. But properties can be returned by methods.
isAnimated is a question, not a verb.
It's a message.
Why would you have a public isAnimated property and a public isAnimated() method? Surely the property would have to be private.
 
I don't have it
it's not allowed ;D
 
Then all is well. :-)
 
9:19 PM
hello
 
hey , can someone help with this ? I have an ajax json response that is comming back html encoded , how can I decode it , all examples on SO say to do .text() , that is not working , this is where I get response - success: function (doc) {
it looks like this
{ &quot;event&quot; : {&quot;title&quot; : &quot;Milwaukee Avenue Arts Festival&quot;,
I tried unescape(doc); that didn't work
 
Fix the code to return proper JSON instead of HTML
If you can't do that: var data = JSON.parse($('<div/>').html(doc).text()); should do the job.
 
I am purposly getting encoded response because one of the json attributes is long html description and parseJSON gets confused with the html in there
 
9:35 PM
Then you are not properly JSON-encoding it.
 
hmmm, alright , thanks i'll look into it
 
Another reason why it breaks could be returning valid JSON but with a HTML content-type instead of application/json
 
no, it works fine for the responses that don't have a description attribute - the description attribute is the one that, if present, is all HTML
 
10:09 PM
any body knows how to repeat a function many times or recall a function if a number exists in a db?
0
Q: Callback recall itself

andrescabana86i have a function that insert in db a random number in a column that is primary key i have a problem when the number is already in db i wanna call again the process to change the number and insert again but im noob with javascript so here is the code... code of the function that create a random...

 
10:42 PM
ok I've been googling 20 mins for what is release mode and cannot find anything on it
only stuff how to detect release mode/debug mode but not actually anything on how to enable it
this is incredibly frustrating
 
11:01 PM
LOL it was in the toolbar this whole time
no wonder it is not mentioned anywhere ... I googled for 40 mins
 

« first day (643 days earlier)      last day (4310 days later) »