« first day (428 days earlier)      last day (4521 days later) » 

5:07 PM
@Raynos See comments
Didn't know about .data
Well, I knew it existed, not it's purpose
 
how do I remove everything from my fb timeline
I don't feel very comfortable with it
Finding Ways to Disable the Timeline? Unfortunately Facebook Doesn’t Let You Do That
FML
 
@Esailija Hah. What I thought
You could put all your friends on limited lists so they wouldn't be able to see your profile at all
 
Well I want them to see the normal profile but the timeline makes it ridiculously easy to see everything in the past
with normal profile you'd have to sift through show more like 1500 times
 
That is something you can't do.
 
@Zirak countered
@Zirak did you solve this one yet? gist.github.com/1348400
 
5:18 PM
The removing of listeners itself? Yes. I had to resort to a special array, though...
 
you could do it like jQuery... use DOM store / jQuery.data whatever you wanna call it
 
I was actually implementing a DOM 3 event mechanism, and then I realized something...it'd be slow as fuck.
The delegation and all that was easy (you just split the event mechanism into two parts - event targets and event objects.) Bubbling, capturing etc was also easy. The problem was firing events
 
why is firing events slow?
 
One could latch onto the existing mechanism, addEventListener or attachEvent, but it'll do a double job - first the native event handling, then the latched one.
 
No you dont want that
if you want to implement DOM 3 you avoid attachEvent
you write your own event model
 
5:21 PM
That's what I did. And I just thought of a way to solve my problem ~_~
wow, duck debugging actually works
 
I love when some clueless question asker accepts your answer, and then removes the accept and goes into help vampire mode in the comments and after banging your head to a brick wall for a while you finally get the sweet +15 rep back
 
I only implemented DOM4 event target
@Esailija I love how you are a rep whore
 
yeah that's me <3
It's funny cos logically I know rep doesn't mean shit these days
but I am still tempted to whore it
 
@Esailija You have less rep then @Neal you must be a worse programmer then him!
@Esailija you know what is worth it? Open source. Awesome open source.
 
5:25 PM
like jQuery?
:DDDD
 
@Raynos Y U GUILT ME FOR BEING A LAZY ASSHOLE ;_;
 
ok I trolls you
 
@Zirak I LAZY ASSHOLE TOO.
@Raynos Y U NO FINISH DOM SHIM
@Raynos Y U NO FINISH TRINITY
@Raynos Y U NO REWRITE BLOG SO IT NO MEMORY LEAK
@Raynos Y U NO WRITE CORE
etc. etc.
 
being lazy is prerequisite to being a programmer :P
 
@Raynos I LAZY ASSHOLE WHO PLAYS POKEMON AND UT AND PROCRASTINATES IN JS CHAT ROOMS AND RANDOM MATH PROBLEMS
 
5:28 PM
It's even worse for me.. I procrastinate in SO which is far less productive than playing pokemon
 
@Zirak Stop whatever your doing, sit and down and think. "What problem do I have" "How do I solve it with OSS"
@Esailija meh, if didnt procrastinate in SO so much I wouldn't be anywhere near as good as I am now
 
@Raynos true but 98% of the time you are just answering braindead questions imo =(
it's just hard to find a good js question
hurr durr how to jQuery select this dom node
 
@Raynos stops breathing, thinks about lack of oxygen as a solvable problem, dies before thinking of solution
 
@Esailija I stopped doing that because it's a waste of my time
 
I see but you are still sneaking in short comments
yesterday I saw you comment on the livequery question
:D
 
5:30 PM
last answer explains the callback mechanism and how node.js defines asynchronous APIs
last answer -1 explains what engine.io is. I learned about it
last answer -2 clarifies my own opinion on "documentation phrases"
@Esailija the main point is, only answer questions that involve you learning something
As for "hurr durr" answers I leave a vague one line comment that explains why they fail
 
lol
I was tempted to comment in the livequery question but it would have been far too offensive
I cannot reasonably communicate just how much someone fails if they use livequery
 
you can communicate it with a screwdriver in their knee
 
Most people will just be bewildered as to why their computer suddenly attacked them with a screwdriver
 
5:46 PM
2
A: Does jQuery do some magic with the `this` variable?

EsailijaIt's just regular javascript with .call() and .apply(). https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Function/call Relevant part from jQuery source: if ( isObj ) { for ( name in object ) { if ( callback.apply( object[ name ], args ) === false ) { ...

Just what exactly is so much better about SLak's answer
:(
 
His avatar is a face with the visual studio symbol. Facism and Microsocism, I say!
 
@Esailija he has over a 100k rep, you dont
 
yeah and on top of some dickhead edit bombed my post
 
his answer is an easy one liner "dem noobs" can understand
 
I had wrong part of source code
and had to edit it in again
fucking fucktards
 
5:50 PM
upvotes are really simple, the more noobs can understand your answer as being "correct" the more upvotes you get
 
I see it now
but I added a braindead example
function asd
 
To appeal to them n00bs, I use funny names like moop and grawrel
 
"jQuery uses the 100% non-magical Function.call method to call the callback with a specific this"
that's not really understandable
it needs example
 
user1385191
people tend to give you more upvotes if you use lots of flashy markdown as well
 
@Esailija but he defended jQuery by sayings its not a magical piece of shit.
 
5:52 PM
But the guy's avatar is a face and he has over 100k rep!!!! Surely he must be right?
2
 
I hope the asker isn't completely retarded and actually accepts mine, he asked for the relevant part of jQuery source after all
but still.... FFFFFFFFFFUUU
 
I mean, it's obvious the only competent people are the ones who have a rep of over 10k
 
user1385191
0
Q: Changing image src with jQuery

Jason CraigI'm replacing some code in an old application, and instead of getting the node by it's id I get it by it's class. Because there isn't a good way to get a node by it's class in native JS I do it with jQuery, however the new code doesn't change the img src. Is there an obvious reason? Old code: ...

 
user1385191
[guys, please help me turn good code into bad code]
 
someone needs to make a FUUUU comic of someone with high rep and gold badge farting in a question and that getting 50 upvotes vs actual answer with low rep getting no upvotes and then the fUUU Face
I suck at photoshop :D
 
user1385191
5:54 PM
actually, FUUUU comics and their ilk need to become extinct
 
I like Y U NO comic :(
when raynos does Y U NO comic it's guaranteed laughs
 
Neal is, obviously, 11.00878798974735 times the programmer Matt is.
@Esailija May I stealz answer?
 
I have heard thing such as SO reputation affecting positively in decision of getting you hired :/
 
Always wanted to write stuff about call and apply
 
user1385191
I've got 35.69 rep/ answer, Neal's got 17.602
 
5:57 PM
sure
 
user1385191
but rep is meaningless :)
 
0
A: Changing image src with jQuery

Raynosfunction updateGameAreaImages(id, place) { var gameareas = toArray(document.getElementsByClassName('gamearea')); gameareas.forEach(updateImages); function updateImages(elem) { var images = elem.getElementsByTagName("img"); images[place].src = "pics/" + id + ".png"; ...

 
lol raynos
that guy is an ego maniac
 
@Esailija what?
 
in my answer to jQuery this
he keeps commenting how he is not an idiot
Raynos great answer cos he asked how to get by class in regular js
 
6:12 PM
does the DOM contain information about :before and :after generated css content?
 
user1385191
depends on the type of content, I'd think
 
The ':before' and ':after' pseudo-elements can be used to insert generated content before or after an element's content. They are explained in the section on generated text.
and here is the section w3.org/TR/CSS2/generate.html
 
.foo:before {
content: '<';
}
I want to attach onclick
 
is that it?
 
user1385191
> Generated content does not alter the document tree. In particular, it is not fed back to the document language processor (e.g., for reparsing).
 
6:15 PM
@rlemon no basically
 
so no.
ok
 
The only information that is contained is meta information about the CSS
:before and :after are basically the shadow dom
 
Shadow DOM. Basically you can't interact with the shadow dom
 
6:32 PM
wow I got 100 rep in SO just by linking my account with meta SO :O
could I farm like 4000 rep just by linkin with each site
 
0
A: Does jQuery do some magic with the `this` variable?

ZirakTrimmed and rephrased from source to match your usage: jQuery.each = jQuery.fn.each = function( object, callback ) { for ( var i = 0, length = object.length ; i < length; i++ ) { if ( callback.call( object[ i ], i, object[ i ] ) === false ) { break; } } ...

In a bit of a hurry, could've went on and on...
 
yeah it's a shame SO doesn't incentivize answers like that
people usually accept answer right away or never at all
 
@Zirak TL;DR
 
LOL
 
@Esailija depends on your definition of "4000 rep"
 
6:37 PM
well 100 for each linked site
and there are many sites
must be over 40
 
i mean yes youll get 4000 rep
but thats 40x 100 rep on each of those sites
so you stackexchange rep goes up by 4000
and your stackoverflow rep goes up by 0
 
no, I got 100 on BOTH SO and meta SO when I linked
or is that for linking with meta only
 
Thats linking with one account
you get 100 on each SE website once
 
I just linked with programmers no SO rep :(
though I got 136 in programmers for some reason
ah nvm it's from a migrated question
 
7:05 PM
@Esailija have you tried breaking your SO addiction?
 
nope
it's a huge problem
are the're SOers Anonymous?
I am not even sarcastic, it takes a lot of productivity out of me .(
and I can't stop
 
I know what you mean
I have the same problem
I also have it with hitting f5 on gmail ._.
 
yeah but the problem is that SO uses your "productive fuel" while it's not really being productive at all
 
I can only be productive for so much in a day after which i wanna just watch movie or play games
 
7:07 PM
@Esailija I see what you mean, what's your normal day job thing?
you know banning yourself from SO at work is an excellent solution
 
I work from home :D
 
...
your fucked
 
yeah I know
 
I recommend two computers
 
thankfully my job isn't so demanding
 
7:08 PM
the no procrast computer and the procrast computer
 
I mean I can get away with lot of slacking :P
 
@Esailija do you get paid well o.o
 
well 2500 euros a month
 
No, must not be tempted into well paid slacker job
 
before taxes
I started at 2000 and did 16 hour days sometimes
 
7:09 PM
software dev?
 
web dev with js and php
the usual
 
I see
seriously though the real solution is the not touch So
talking about not touching SO
 
yep but that f5 key just itches
 
I need to GTFO
 
lol
ok bye :)
 
7:10 PM
Hey guys, do me a favour and flag me so I'm muted from chat and can actaully get on with my work
2
 
done :P
 
7:29 PM
@Raynos nice, you already got six flags ;)
 
0
Q: Translating between Python-Django and Javascript

ChrisI have a conceptual question about 'translating' between objects I have stored in Django (in Postgres) that I want to use on the front-end. So I have a user object in Python that holds basic things: an id, a username, a password. Let's say I want to output all of that information using Javascript...

 
:( I could never flag Raynos.
 
It's tough love, Loktar :-)
 
7:45 PM
0
Q: review of work-in-progress javascript

Justin808I'm looking for a review of my current code. This is not the final form as I will be converting it into a jQuery plugin but I'm looking for a review of the logic behind the code. jfiddle: http://jsfiddle.net/JgU37/44/ $(document).ready(function() { // Fake paste var doFakePaste = false;...

 
7:58 PM
Pffft, one message won't be enough
That'll only get you suspended for half an hour, hardly enough time to be productive
You'll just wonder off to read reddit or something :P
 
haha @YiJiang thats part of my routine.. SO/reddit/twitter repeat
 
@YiJiang :(
> Bad code is an anti-pattern
However the community cannot interpret bad code :\
 
8:18 PM
is there a built in jquery function that iterates an array and returns true if any elements return true for given expression (such as at least one of the elements containing content)
thanks for response
 
Even better, there's a native function for that. Array.prototype.some
 
supported by all browsers?
 
es5
Easily shimmed
You asked for something that returns true or false. grep is like Array.prototype.filter
 
yeah, i tried to remove message before anyone saw it
 
@JohnMerlino no sorry, you have to use native js for that.
 
8:29 PM
jQuery.prototype.some = function ( fun ) {
    return Array.prototype.some.call( this, fun );
}; //</troll>
 
Please do not abuse flags.
3
 
Sowee! Just trying to help. To be clear, is there a real negative impact from using flags in that way? (serious question)
 
I guess they send some notice to moderators :P
that Raynos was being naughty
 
It most likely annoys mods and deters them from real issues.
 
8:43 PM
Yes, that makes sense, thanks.
 
oh
@RebeccaChernoff sorry :(
@adscriven the real negative impact is that your annoy the moderators
they have to manually fix flags by punishing us
Basically we waste their time by saying "please babysit us"
I should have known better.
 
raynos what type of responses are expected in code review? are full rewrites ok?
 
anyone have an idea of why i get unexpected identifier here:
 
though what a waste of time
:D
 
function add_input(){
if($('#chart-container div').some(function(){$(this).html()}){
$('#chart-container form#chart-form').show();
}
}
 
8:54 PM
@JohnMerlino you are missing a bracket and also jquery doesn't have .some I think
function add_input() {
    if ($('#chart-container div').some(function () {
        $(this).html()
    })) {
        $('#chart-container form#chart-form').show();
    }
}
 
@esailija: i know some posters expect a full rewrite ... :-(
 
thanks for response, but I added it to jquery object like Zirak mentioned
 
@Esailija full rewrites are ok, diffs are the best
 
@adscriven I basically almost did that... then I realized that codereview is gonna be even bigger waste of time than SO
 
@Esailija Also STOP WASTING YOUR TIME
 
8:56 PM
yes I will never post there again, hopefully
 
@esailija: yep, and then the op says that that's great, but it doesn't do x & y -- could you add that please?
 
it's like world of warcraft all over again
damn it
 
@Esailija this is still an open question : codereview.stackexchange.com/questions/5514/…
 
and indeed you were right, it was missing bracke thanks for repsonse
 
I'm going to try and solve high level code structure using Core
 
8:58 PM
@Esailija
 
That needs to be a single image
 
@Esailija yes it is
@Esailija fixed
 
Well I usually make one file per "class", if it's just a php style list of utility functions I group them by namespace in one file. To use shorthands with namespaces I do like
use( "Application.Whatever.Foo", "Another.NamespaceLol", function( Foo, NamespaceLol ) {

Foo.bar = function(){};

});
it's also a free closure at the same time
 
:(
I dont like that
I mean it works
but ugh
 
9:03 PM
but you have the automatic closure by modules or something?
I don't have that
 
I do
because of my build script
it wraps my code in a closure
I also use a blocking require for utilities
and use a mediator for getting anything else
 
yeah, basically I use use to do that and make shorthands at the same time
 
and by use I mean "this is the unimplemented architecture I have in my head"
@Esailija did you know theres another good 6 hours of time before you go to bed
@Esailija normally you would waste it procrastinating on stackoverflow
 
but it's sunday
 
@Esailija today your not going to do that. Your going to do something useful
"its sunday, therefore I no open sauce" >:(
 
9:06 PM
I have also kind of an ad hoc way of mapping dependencies
 
open sauce it.
 
then using homebrewed php script to compile
that calls google closure compiler java
it's a mess
 
Esailija i do something similar
my require is an m4 script lol
 
@user886931 m4?
@Esailija y u no build with homebrewed nodejs ;(
@Esailija y u traitor
 
9:08 PM
lol I have never been into node.js to begin with, therefore no traitor :D
 
no srs.
 
i like being able to build my js stuff with a regualt makefile
regular*
for those rare instances where i want to use eclipse or netbeans or something
 
9:25 PM
Hey guys, I hurd u liek C
So here's a C problem: this code won't run o/ : gist.github.com/1494490#L66
 
where is dim and precision defined
 
"Doesn't run" is not very informative
 
shouldn't you be calling free() somewhere to free up all the memory allocated with malloc and calloc?
 
@Esailija globals :D
@Zirak doesn't run
-----------------------------------------------------------------------------
One of the processes started by mpirun has exited with a nonzero exit
code.  This typically indicates that the process finished in error.
If your process did not finish in error, be sure to include a "return
0" or "exit(0)" in your C code before exiting the application.

PID 28668 failed on node n0 (127.0.0.1) due to signal 11.
-----------------------------------------------------------------------------
@user886931 you should, but I don't
 
Change void main to int main, at the end return 0;, see if that works
 
9:33 PM
ah yes
that is probably it
i'd def fix those memory leaks tho
 
@user886931 there not leaks. Because they get freed when the program terminates
 
doesn't the OS release memory anyway
when the program ends
 
@Zirak nah bro, the problem is in those MPI calls
 
what is this anyway
 
((I'm bro? the closeness. it's touching ;_;)) still, try it
 
9:35 PM
assumed it was some kind of daemon
 
-1
Q: bit shifting in php (cryptography)

Aram MkrtchyanI need a bit shifting program in php. only in [A-Z] words need to be a user write the word in INPUT field and press encrypt In both INPUT field write coded word and press decrypt can anybody help me plz.

Has anyone really been far even as decided to use even go want to do look more like?
 
WHAT
that sentence
omg
 
just saying the OP's question is like that sentence
 
lol
 
9:41 PM
this reminds me why I dont like C/C++
 
i'm not looking at any more memes. that good guy greg thing is still bugging me. I couldn't sleep last night because of it :(
 
@Raynos With great power, comes great debugging.
 
C++ is definitely better than C though
 
AMAGAD NO YOU DIDN'T SFSDYAUFBSDHARKB2389423BN NRWEANRAS RAAAGE
 
@Raynos my coding style is fine
 
9:48 PM
@ThomasBlobaum meh. it ain't readable.
 
what is this style that isn't readable
 
it is readable, that is why i write like that
 
readable code means having chainable methods with meaningful names where you can accomplish a whole lot on one single line
readable code means using built i functionality or library functionality that is common to a community
 
@Raynos
  function _pinger (bool) {
    _send()
    if (bool) interval = reset
    if (bool === false) return clearTimeout(nextTick)
    else if (interval > 200000) interval = 200000
    else interval = interval * (3 / 2)
    clearTimeout(nextTick)
    nextTick = setTimeout(_pinger, interval)
    _watch(win._tracker.push)
  }
highly readable
 
readable code does not necessarily mean reinventing the wheel @Raynos
 
9:54 PM
except I didn't realize it was javascript until 3rd line
you cannot be consistent with leaving semicolons out, so why leave them out
 
    var doc = document
      , queue = win.tracker || []
      , transport = []
      , reset = 2750
      , app = {}
      , instance = { onscroll: 0, onkeydown: 0, onmousemove: 0 }
      , interval = reset
      , listen = doc.addEventListener = win.addEventListener
      , shim = { domain: (location.host.replace(/^www./, '') || '')
        , referer: (doc.referrer || doc.referer)
        , path: (win.pathname || location.href || '')
        , title: (doc.title.slice(0, 1028) || win.title.slice(0, 1028)) }
semi colons go where they go
 
@ThomasBlobaum troll
 
There is nothing wrong with this code, u is the troll
 
@Esailija you can
 
@Raynos I read that there are some cases where you must use a semicolon to resolve ambiguity but I don't remember what they were
 
9:56 PM
@Esailija you just avoid writing those cases :D
 
function pinger (bool) {
    send()

    if (bool) {
        interval = reset;
    }
    else if (!bool) {
        return clearTimeout(nextTick)
    }

    if (interval > 200000) {
        interval = 200000
    }
    else {
        interval = interval * (3 / 2)
    }

    clearTimeout(nextTick)
    nextTick = setTimeout(pinger, interval)
    watch(win.tracker.push)
}
woops, mixed tabs...1 sec
 
srsly, looking at alternate styles of the same logic brings home how readable my style is
 
@Zirak I lol'd at the laziness of only adding one semicolon
 
With your style, the entire logic paths were not clear at first glance
 
why would you ever rely on ASI when you can just insert semicolons yourself
 
9:59 PM
because it's <sarcasm>fun</sarcasm> to memorize all the situations where ASI will screw you up
 
i hope nobody ever has to look at that code in eclipse
 

« first day (428 days earlier)      last day (4521 days later) »