Bjartr

- friends
1,275 link karma
13,342 comment karma
send messageredditor for
what's this?

TROPHY CASE

I am REALLY struggling with the concept / definition of a callback... can anyone try to explain in layman's terms? by phaggocytosisin javascript

[–]Bjartr 1 point2 points ago

A callback is a function you want to have called when something else happens.

A simple example is an onClick function. When you do

element.onClick = myFunction;

You are using callbacks. More specifically, myFunction will be 'called back to' when the element is clicked.

Another example is when doing async calls like AJAX. Because triggering the AJAX call doesn't usually stop the program until it finishes, just moving onto the next thing immediately after making the call could screw things up if it doesn't complete fast enough. To deal with this, we provide a function to call when the request completes, this function is a callback.

Any time you've done something like someCall(a, b, function() {... you've used a callback. window.setInterval comes to mind here.

I hope this clears things up a bit, I remember trying to wrap my head around callbacks way back when. The key was to realize that even though they are used for many advanced and often convoluted things, what they actually are is relatively straightforward.

Hologram Avatars to be installed in New York airports to help travelers. by Singular_Thoughtin singularity

[–]Bjartr 0 points1 point ago

They had these in a mall near me advertising credit cards.

Believe it when I see it, Nintendo. by GryffinDarkBreedin gaming

[–]Bjartr 0 points1 point ago

Did the Wii shopping channel really outdo PSN and XBLA?

Getting ready for the solar eclipse tonight. Feel like this was meant to be. by bloodfistin space

[–]Bjartr 0 points1 point ago

Woah, that's awesome, I've never seen anything like that.

A game of chess has begun in /r/WTF by LoopyDoodin bestof

[–]Bjartr 2 points3 points ago

The same thing you do if a memory card breaks in half, well actually, with a tape there would still be a chance of recovery at that point.

This articulates an important hang-up of trying to become more sociable that I've never really thought of before. by Mike_V1114in bestof

[–]Bjartr 0 points1 point ago

Yeah, but the advice you give to someone trying to learn to ride isn't "just ride" it's stuff like "kick along with your feet and pull them up for a couple seconds and let the bike coast, then when you've got a feeling for that step on the pedal for a moment to give yourself some thrust, then coast again. Keep working at that, feet on the pedals a bit longer each time, and you'll gain the sense of balance you need to ride a bike."

New Firefox Beta for Android with native UI and Flash support by mbrubeckin Android

[–]Bjartr 0 points1 point ago

Anyone else have problems with the text boxes in FF acting differently than all others on their device? I'm using swype and, for example, spaces aren't getting added between words in FF, but it works fine everywhere else.

So i did an ASAP test of a solar powered canoe yesterday, worked better than expected by FedsAgainstGunSin softscience

[–]Bjartr 1 point2 points ago

I wonder if this could be done with windpower

Sure, it's called a sailboat.

/s

Max Payne 3 Review by asskickingjediin Games

[–]Bjartr 13 points14 points ago

Do you also not flip channels or radio stations when a commercial comes on? I ask this in all seriousness.

Do black holes "overcome" Pauli exclusion in the process of becoming a black hole? by platypodesin Physics

[–]Bjartr 0 points1 point ago

AFAIK, we don't have a strong understanding of the nature of matter at the singularity itself. We have a decent understanding of why they occur, and what the observable consequences are, and even a pretty good guess of what happens as you approach the singularity, but at the point of the singularity itself gravity is infinitely strong and volume is zero, which is where all of our models break down. So, unless there has been progress made on this problem that I am not aware of, the is no accepted-as-correct answer to your question.

Although, some people do have some ideas

The Trouble with Scientism - Why history & the humanities are also a form of knowledge by anutensilin PhilosophyofScience

[–]Bjartr 0 points1 point ago

They're just wastes of money because 'science is the only true way of knowing the world'.

Man, I kind of wish this were a bigger problem.

The Trouble with Scientism - Why history & the humanities are also a form of knowledge by anutensilin PhilosophyofScience

[–]Bjartr 3 points4 points ago

Is it just me or does this whole argument boil down to the semantics of the terms 'science' and 'knowledge' more than anything else?

Demos Defined by asskickingjediin gaming

[–]Bjartr 1 point2 points ago

Well, I'm one

EA kills free Battlfield 3 servers, pushes paid ones by greyishpowerangerin Games

[–]Bjartr 1 point2 points ago

It may not be piracy, but isn't DRM circumvention a violation of the DMCA?

Play the original "Adventure" in your browser! (Javascript) by ColossalCaveTBGin WebGames

[–]Bjartr 0 points1 point ago

Since it may not be clear from other comments, 'first' here means 'first ever' as in, 'adventure' was the first ever text adventure

Adobe releases Creative Cloud, a membership that always gives you access to the latest versions of Photoshop, Lightroom, Illustrator, InDesign, Flash, DreamWeaver, Fireworks, Premiere Pro, After Effects, and more. by KerrickLongin photography

[–]Bjartr 0 points1 point ago

Actually, looking at the services provided, specifically the "Business Catalyst" there's this

Full Creative Cloud Membership comes with hosting for up to 5 sites.

Every cliche title template on reddit in a single thread by culturalelitistin bestof

[–]Bjartr 0 points1 point ago

wait for it

This is what students at my workplace will see if they try and play Draw Something using our Internet connection by pcmattmanin gaming

[–]Bjartr 20 points21 points ago

\ = hack? never heard that term for it before, although it seems the jargon file has

saw a sweet ass zombie killing machine on my lunch break (x-post from r/pics) by sethfergusonin gaming

[–]Bjartr -1 points0 points ago

While I appreciate the effort, I'd rather not see this become Digg, thanks.

Does the 1st Amendment cover clicking 'like' on Facebook? by sd002002in moderatepolitics

[–]Bjartr 2 points3 points ago

transmitting copyrighted information is not protected by the first amendment.

09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0

Ah, nostalgia

Interview: What Happened To Black Mesa: Source? by MonkJammasin Games

[–]Bjartr 4 points5 points ago

I feel the same way, I've been looking forward to HL1 with the rough edges of time smoothed over, not a game inspired by HL1.

Interview: What Happened To Black Mesa: Source? by MonkJammasin Games

[–]Bjartr 2 points3 points ago

People are mad because an awesome, free project is taking a long time to finish?

No, people are mad at being misled. It doesn't matter what it's about, when people get promised something and then it doesn't get delivered, they get upset. It shouldn't be unreasonable to expect a promise to be fulfilled.

Video game console dev kits by ghaibin gaming

[–]Bjartr -3 points-2 points ago

You may not, but I enjoy digging around in configuration files and breaking (or fixing) things. I've even gone so far as to run a debugger/disassembler to make changes to a game on the fly. Then again, I'm not most people.

view more: next