youtube

21 Best JavaScript Frameworks for Programmers 2015

21 Best JavaScript Frameworks for Programmers 2015

JavaScript is basically an object-oriented scripting language extensively utilized to allow the user for the programmatic access to any type of computational objects within a host atmosphere with run-time evaluation. Dynamic writing created it the first selection of any developer. JavaScript frameworks 2015 can create a magic, when you are working on this framework. There are lots of JavaScript…

View On WordPress

Download V(0.8)

Download

Version 0.8 includes the following:

Added 

More Upgrades, “Buy more than one” function, an actual appealing design.

Fixed

Alot (for example the “buy all upgrades thing”, which is now the “buy more than one” thing.)

Removed

The inframe window. (it was so fucking slow….).

Screenshots:

<The new Design>

<Smoother per second calculating>

<more upgrades… wat>.

Have fun and leave some feedback, on here or on my skype (“skyper-g1”)

24 Best Weekly Web Design & Development Resources #14

24 Best Weekly Web Design & Development Resources #14

Here’s the 24 Best Weekly Web Design & Development Resources #14 Collective that aims to introduce fresh new, trendy and easy-to-use web design & development resources (freebies, codes, graphics, tools, inspiration, etc) from the past week. Have fun with it and remember to share with your friends.

You may also like these :

View On WordPress

Intersection And Union In JavaScript

Used to find unique and similar parts:

var mx5parts = ['engine', '4wheels'],
    ninjaParts = ['engine', '2wheels'],
    enzoParts = ['engine', '4wheels'];

console.log(intersection([mx5parts, ninjaParts, enzoParts]));
// ['engine']
console.log(union([mx5parts, ninjaParts, enzoParts]));
// ['2wheels']

What is interesting is that, although these operations seem opposite, there implementation are extremely similar. First think of all operations performed on an array of them combined. Then they all become is just counting how many times an entry appears:

var correctCounts = function(need, arrays) {
    var used = {},
        correct = [];

    // Find the total counts of numbers
    arrays.forEach(function(arr) {
        arr.forEach(function(element) {
            if (used[element] === undefined){
                used[element] = 0;
            }
            used[element] += 1;
        });
    });

    // Extract the ones that are the number we need
    var correct = [];
    for(var name in used) {
        if (used[name] === need) {
            correct.push(name);
        }
    }

    return correct;
};

Intersection just means each number needs to appear as many arrays as there are:

var intersection = function(arrays) {
    return correctCounts(arrays.length, arrays);
};

Union just means a number can only appear once:

var union = function(arrays) {
    return correctCounts(1, arrays);
};

Of course I could have made correctCounts a lot smaller if I had used other functional calls, but all my posts rely on no external libraries. Also, this will only work if you use flat arrays. Non primitive keys get converted into strings and may cause issues for matching with the used variable.

That is the end of my posts on the most essential functional techniques in JavaScript. For a full implementation see the Lodash versions. The next post will be on Monads.

Github Location: https://github.com/Jacob-Friesen/obscurejs/blob/master/2015/intersectionAndUnion.js