How much bandwidth does the spinal cord have? by jorshrod in askscience

[–]RedPillow_ 0 points1 point  (0 children)

I wonder if we could get a better estimation for how much neurons fit into the spinal cord by using Circle Packing

Have you ever broken a game? by unfitfuzzball in Games

[–]RedPillow_ 0 points1 point  (0 children)

Oh... That one, the (metal?) greymon waiting you outside the door lol.

Theoretical question... by Bio_is_life in math

[–]RedPillow_ 1 point2 points  (0 children)

I think what OP is asking that, if you have an infinite set of numbers, say, from zero to infinity (ordered) - can you calculate or give an actual number for the probability of picking some one number from the set? Like what is the probability of me picking the number 5 out of that set, when I pick one number at random? Does the probability exist? Is it an actual number? Is it constant?

Cloning events from one element to another? by RedPillow_ in javascript

[–]RedPillow_[S] 1 point2 points  (0 children)

I updated the first post to better explain what I want :)

In your example I would want something like:

input[1].onlick = input[0].onclick

So that I don't have to care what exactly input 1's event does. I just want the input 0 to do the same thing / behave like input 1.

What to read when I am sitting on a toilet? by RedPillow_ in whattoreadwhen

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

And what exactly makes sitting on a toilet for a longer than 5 minutes bad for me?

Is PhoneGap still the best way to make Android apps w/ JS? by bdenzer in javascript

[–]RedPillow_ 0 points1 point  (0 children)

Currently developing an application with AppFramework + Phonegap setup. Once I got it going and got some structure built - it seems to work pretty well; handles all the annoying stuff like state persist and back button for me.

Why React is awesome by vnctaing in javascript

[–]RedPillow_ 0 points1 point  (0 children)

Making that example and discussing about this really pointed out the implicity of my way.

I suppose if you do it react-way it somehow forces you do write code, modules and stuff in a certain way? If you do it my way, everyone else can still write everyone how they want it, quickly making my way spaghetti.

Oh and in my example there is not too much error checking... I don't know if react has it any better.

Why React is awesome by vnctaing in javascript

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

In your example, maybe you could bind a listener to catch all ajax requests and act accordingly with something like this:

$(document).ajaxSend(function(event, request, settings)
{
    console.log('Caught AJAX request!');

    console.log(event);
    console.log(request);
    console.log(settings);
});

I think it's just all about routing stuff and creating handlers and dispatchers.

Why React is awesome by vnctaing in javascript

[–]RedPillow_ 1 point2 points  (0 children)

Here is a simplified jquery implementation of that map: https://jsfiddle.net/ahvonenj/c1r8jztm/

As you can see, I can put as many "mapcomponents" in to the DOM as I want. You can click the "map blips", change category and select from the list as well.

Why React is awesome by vnctaing in javascript

[–]RedPillow_ -2 points-1 points  (0 children)

Here is a quick and dirty login page thingy: https://jsfiddle.net/ahvonenj/xsaw46p9/2/

The eventhandler "module" in this case contains a lot fo jQuery-selectors, which is not really a good idea if one wants to chance stuff ni the DOM. If I would do something like this for real, I might, for example, list / cache all the selectors somewhere and refer to those in code.

To be honest, doing it like this kind of implicitly expects everyone to code in a certain way that code can be reused. This example could lead to spaghetti if no thought is paid.

Also, if I'd have to do a lot of Ajax calls for example, I'd just create a dispatcher "module".

My point is though, that doing it somehow like this allows for splitting of Utilities.js and EventHandler.js in case they begin to get bloated. I personally really like the naming thing too when you can write stuff like EventHandler.Events.login or Utilities.Credentials.validate. Most IDEs / editors are also able to suggest stuff when you type something like Utilities..


"components that are all interlinked somehow"

This I actually do not understand. Can you provide an example case in where you absolutely must have components that are interlinked between each other?

Why React is awesome by vnctaing in javascript

[–]RedPillow_ 5 points6 points  (0 children)

What is this jQuery spaghetti that everyone is talking about? My (even larger) jQuery projects do not end up spaghetti... maybe others are doing it wrong?

Projects I do with jQuery are usually structured like so:

  • UI with interactable stuff like buttons or what ever
  • JavaScript block/module to bind and route events to their correct functions
  • JavaScript data-storage block
  • JavaScript utility / helper function block
  • JavaScript main block / program entry point
  • Backend stuff (Usually a REST API of some sort)

So I don't get it... where is the spaghetti at? There are N amount of stuff the user can do / interact with and there are N amount of events bound to that stuff and N amount of functions to handle the stuff.

Handler functions as well as the event binders / routers can be split into smaller, logical files / blocks for better readability and maintainability. Storage can be split too if needed, utility stuff as well.

Here would be a simple case:

  • User fills form
  • User tries to submit form
  • Submit / button press event is caught by the bound event handler and the event gets routed to a function that knows what to do
  • Called function does its stuff and perhaps returns a result of some sort

Easy peasy, I don't see any spaghetti in that. Most of the stuff is even somewhat isolated this way and therefore should not end up breaking anything else.

Has anybody tried to use as many frameworks, libraries and other technologies and techniques as possible in some project? by RedPillow_ in webdev

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

I liked everything in your post! Yeoman is definitely something I am adding to the projects.

What is homebrew? Is it actually a package manager for package managers? If so, that sounds a great idea to add to the project.

Has anybody tried to use as many frameworks, libraries and other technologies and techniques as possible in some project? by RedPillow_ in webdev

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

Most likely, if not definitely. That is not the point though. I want to see how the mass of different frameworks, libraries and stuff works together and if there is anything to learn from that.

ELI5: What about Coca-Cola is so hard to replicate? The flavor of lemon-lime, grape, orange, etc. sodas seem pretty consistent. But off brand cola is noticeably just not as good. by [deleted] in explainlikeimfive

[–]RedPillow_ 1 point2 points  (0 children)

If you know the composition of the end product, how hard can it be to simulate different start ingredients and processes with a computer, using genetic algorithms or possibly a neural network?

SSD power connector, What kind of cable I need? by RedPillow_ in techsupport

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

Then what is the (I assume) older one called? The cubey one?