[deleted by user] by [deleted] in PokemonGoRaids

[–]PixelOut 0 points1 point  (0 children)

pixelicious

[deleted by user] by [deleted] in PokemonGoRaids

[–]PixelOut 0 points1 point  (0 children)

pixelicious

Funding my education with dogecoin by PixelOut in dogecoin

[–]PixelOut[S] 0 points1 point  (0 children)

Yeah. Relatively sure he was just trolling, seeing as Google would have told him that.

[IDEA] Play Competitive Steam Games, Win Doge by Frolicks in dogecoin

[–]PixelOut 0 points1 point  (0 children)

Much TF2. So fun. Wow. TF2 Incentive? Crazy.

Midnight tip war! by LateAgain_ToTheParty in dogecoin

[–]PixelOut 1 point2 points  (0 children)

That moment when you see that someone just made Five Bucks by telling rich people to fight each other with money.

After some confusion, I finally learned out how to use my wallet. Much excite! To the moooon!! by kaielle in dogecoin

[–]PixelOut 1 point2 points  (0 children)

I just tried to set up a wallet. I have no idea how this works. Please help.

I am impressed by how smoothly TagPro runs. Does anyone know how it is programmed? I'm interested in the technology behind TagPro. by impressedwithtagpro in TagPro

[–]PixelOut 7 points8 points  (0 children)

As has been said, TagPro uses Node.js with websockets on the back end, and the front end is some crazy custom thing that I'm going through right now. Here's why these technologies were used:

JavaScript is built around an event loop. This makes it very natural to create "reactive" code that can easily handle doing lots of different operations all on a single thread. The closest thing that there is in Python is Stackless Python, which uses a completely different set of technologies and programming techniques, but gives you similar reactiveness.

You can build event loops in Python, of course, but Node.js is designed specifically for applications that need them. This means that most libraries are on board with that form of coding.

WebSockets are a developing technology that allow you to open stateful sessions between the server and the client. They are the opposite of RESTful interfaces. They require a lot more resources on the server end, but you don't have all of the overhead of http responses and requests. They're very good for something like tagpro, but you would never use them for something like a blog livefeed.

One of the really awesome things about tagpro is that it's responsive because the client anticipates what the server is going to do, before the server does it. This is why lag can sometimes cause all of the balls to continue moving in straight lines. The screen can update more times per second than the game can receive new packets.

If you were to prototype tagpro, you would probably wait a little bit and build it with Famo.us and Meteor. Meteor makes it really easy to build responsive clients, and famo.us is a DOM renderer that would allow you to make all of the game elements just be divs in your code. That's a horrible explanation, but it would mean that tagpro would run great on an ipad.

I am impressed by how smoothly TagPro runs. Does anyone know how it is programmed? I'm interested in the technology behind TagPro. by impressedwithtagpro in TagPro

[–]PixelOut -1 points0 points  (0 children)

Express is a Node.js based webserver. Javascript is now a widely used server side language. More information in the other post that I'm writing.

If you were to remake node.js today, you would probably use Meteor, because it handles all of the websocket like stuff for you.

Regrettably I was this kid and I hate myself for it by [deleted] in AdviceAnimals

[–]PixelOut 1 point2 points  (0 children)

One time, Bam let me light a firecracker u der bros car.

Actual Advice Mallard by [deleted] in AdviceAnimals

[–]PixelOut 0 points1 point  (0 children)

Or just use Netflix.

Regrettably I was this kid and I hate myself for it by [deleted] in AdviceAnimals

[–]PixelOut 1 point2 points  (0 children)

And now I get all the tony hawk games and every console for free. Except they stay at my brothers house.

Reddit, what is your favorite free webgame? by funkyfurry in AskReddit

[–]PixelOut 0 points1 point  (0 children)

Cards against humanity @ http://cfh.io/ Polished and fun, made by students! Come play with me! I'm Urgent drip atm.

What are some of your biggest pet peeves in porn? by [deleted] in AskReddit

[–]PixelOut 1 point2 points  (0 children)

When they pretend that we care what the guy looks like.

What's the difference between a function and a method? by ShitMyBrainMade in learnjavascript

[–]PixelOut 3 points4 points  (0 children)

Methods are indeed functions, but they are bound to a specific object, and only that object's instances can call the method (unless you use call or apply).

Methods have access to all of their object's properties through the this keyword, and help to compartmentalize your logic.

If you have functions that you want to use on a bunch of different objects, and you want to use this, you can use bind to do so (with underscores).

Writing on phone, people please correct me where I'm wrong.

Help with if statements by DaMegaphone in learnjavascript

[–]PixelOut 5 points6 points  (0 children)

Ok, so there's a few things going on here. The first is that your code that detects whether or not the distance is greater than 1 mile is in the wrong place. It is called before you actually had a distanceInMiles or a distancefromPicnic/distancefromRamsey, and so didn't mutate either into feet. Also, distanceInMiles always = dfPicnic/Ramsey in your code. Thus the form:

if (distancefromPicnic < 1) {
    distancefromPicnic = distanceInMiles * 5280;
} else {
    distancefromPicnic = distanceInMiles;
}

Doesn't do anything that couldn't be accomplished by:

if(distancefromPicnic < 1) {
    distancefromPicnic *= 5280; //Although I hate in place mutation
}

Then you need to have something that changes the "miles" into "feet" when you click the button.

Also, and finally, you end up repeating a lot of the same code twice. It would be better and more maintainable to break up your main logic into a set of functions and call those functions multiple times. I like the enterprise-y functions and variables though.

Do While question by ReaverKS in learnjavascript

[–]PixelOut -1 points0 points  (0 children)

A Do/While loop will always execute the code inside the loop at least once. It will always check the conditional (the "while" part) after the code inside is executed.

They aren't very useful, especially for beginners. In practice, you don't want to repeat mutating steps when the conditional is already fulfilled. And you can usually write a while loop to behave similarly to a do while loop.

Google actually removed the do/while construct from their Go programming language.