Over all, if this is your first time coding, you've really done a stellar job. I'm having a hard time believing this was a first attempt without replicating someone else's code, just because of how cleanly you've approached it. Very well done.
The below suggestions are more further improvements than they are corrections on what you were doing. Some of the things I suggest may not make full sense now, but are good habits to breed early on, because when you start working on more complex applications, you'll significantly benefit from not having to learn every mistake the hard way.

Avoid repetition
How often do you see this code:
Console.ForegroundColor = /* some color */;
Console.WriteLine(/* some message */);

The answer is a lot. So to save yourself some repeated code, abstract it into a method:
public void WriteMessage(string message, ConsoleColor color = ConsoleColor.White)
{
    Console.ForegroundColor = color;
    Console.WriteLine(message);
}

It seems like a little thing, but it effectively halves amount of lines (revolving around printing logic) in your main method, since you can now just do:
WriteMessage("error", ConsoleColor.Red);

Note that I also made the color an optional parameter, so it can be omitted when no special color is needed:
WriteMessage("a message without special color");

Syntax improvements
This is just a little thing, but notice how every condition ends with drawing a line:
if (op == "+")
{
    Console.WriteLine(num1 + num2);
    Console.WriteLine("--------------------------------");
}
else if (op == "-")
{
    Console.WriteLine(num1 - num2);
    Console.WriteLine("--------------------------------");
}
// and so on...

If all of them end on the same instruction, it's easier to just put that instruction behind the if/else:
if (op == "+")
{
    Console.WriteLine(num1 + num2);
}
else if (op == "-")
{
    Console.WriteLine(num1 - num2);
}
// and so on...

Console.WriteLine("--------------------------------");

But you can go further. The same applies to printing the result. So you can also move that outside of the chain:
double result = 0;

if (op == "+")
{
    result = num1 + num2;
}
else if (op == "-")
{
    result = num1 - num2;
}
// and so on...

Console.WriteLine(result);
Console.WriteLine("--------------------------------");

Syntax improvements
You should avoid if else chains where you keep checking if the same variable matches a given value. That's precisely what a switch was made for:
switch(op)
{
    case "+":
        Console.WriteLine(num1 + num2);
        break;
    case "-":
        Console.WriteLine(num1 - num2);
        break;
    case "*":
        Console.WriteLine(num1 * num2);
        break;
    // and so on...
}

Break it up
The code you wrote is relatively neat for a beginner program. Good indentation, reasonable whitespace separation between lines.
But the next step is breaking your method down into smaller steps. If I were to sum up what this code does, I'd list it as follows:

Takes in a number (twice)
Takes in a mathematical operation
Writes messages to the console, sometimes in color.
Performs the selected operation on the selected numbers

You could add a lot more bullet points here if you wanted, e.g whether you consider drawing a horizontal separator as a different task from writing a message to the console. I'm sticking with these four as it's a basic example.
These four bullet points are a great (but not complete) guideline to how you need to break down your application. Anything you consider a separate task, is generally going to want to be in a method on its own. So in this case you'd be looking at methods like:

double GetNumber()
char GetOperation() - I'd consider using a custom enum here instead of a character, but let's keep it simple for now.
void WriteMessage(string message, ConsoleColor color = ConsoleColor.White) - see previous point section
Separate operator methods:

double Add(double a, double b)
double Subtract(double a, double b)
double Multiply(double a, double b)
double Divide(double a, double b)
double Power(double a, double b) - This mirrors Math.Pow and you could technically skip your own method and use Math.Pow directly. However, due to abstraction considerations, it's good practice to still define your own method. This is maybe beyond your current skill level, but the idea behind it is that if you suppose that you change your calculation logic in the future, it's easier to rewrite the content of your Power method once, than it is to go hunt for all references to Math.Pow and substitute them all individually.

There's definitely still room for improvement, but you're still a beginner and this is a good first step. Try to write the code in your Main method in a way that it relies on these methods I just listed, instead of having the Main menu do all the heavy lifting by itself.
Think of it this way: when you stop being a cook and instead become a chef (= better code), then you're no longer doing the small jobs yourself, e.g. peeling the potatoes and washing the dishes. Tasks get delegated. Chefs (the Main method) rely on the small things being done by others (the submethods).
Refactoring
I noticed this:
Console.WriteLine("{0}", value1);

It's needlessly complex. Just do:
Console.WriteLine(value1);

I suspect that this is a refactoring remnant. It used to do more than just print value1, but over time you changed the code, and never steered away from using the String.Format approach.
That's completely normal, but this is precisely why developers should always revisit code when it's "finished", to see if there are some remnants of past attempts that can be cleaned up or refactored into something better.
A better user experience
It helps to sometimes think like a user instead of like a developer. When adding 1 and 2 together, how do we write things?

+ 1 2
1 + 2
1 2 +

I hope you'll agree that the second bullet point is vastly preferred. Note that the first bullet point also exists (it's called Polish notation), but unless you have reason to believe that your users predominantly use Polish notation, the second bullet point is how users think.
But when you ask for user input, you are asking for + 1 2:
Console.Write("Enter operator: ");
string op = (Console.ReadLine());

Console.Write("Enter First Number: ");
double num1 = Convert.ToDouble(Console.ReadLine());

Console.Write("Enter Second Number: ");
double num2 = Convert.ToDouble(Console.ReadLine());

That doesn't match with how users think. It's a very simple improvement to just change the order of your code. It doesn't change how your code works, but it does improve the user experience.
An even better user experience
This is not as simple, but as a next challenge, you could see if you could move away from users having to input separate values and having to press enter inbetween.
See if you can figure out how to let users input the whole formula, e.g. "1+2" and take it from there. Or, alternatively, read every key the user presses and dynamically figure out what they mean.
If you think about a real-world calculator, it works without needing to press enter inbetween its data input. So try and make yours similar. It's a great user experience improvement, and a good exercise for someone who's new to coding.


Finding all possible pairs of square numbers in an array

Avoid string addition

String addition is not good for building up strings from many pieces inside of loops.  You should use StringBuilder instead.

StringBuilder sb = new StringBuilder();

// ... omitted ...

        sb.append(arr[j]).append(',').append(arr[j]).append(' ');

// ... omitted ...

String s = sb.toString();
System.out.println(s);

Avoid square-roots

Checking \$\sqrt x == y\$ is ... dangerous.

The results of the square-root are a float-point number, and may not exactly equal your integer value.
If you have a negative number in your list, Math.sqrt() will raise an exception, yet { -5, 25 } is a valid pair.

Testing x == y*y is safer, as long as there is no danger of y*y overflowing.

Avoid repeated calculations

for(int i =0; i < arr.length;i++) {
    for(int j = 0;j < arr.length;j++) {
        if(Math.sqrt(arr[i]) == arr[j]) {
            ...

In the inner-loop, i is constant.  Yet you are computing Math.sqrt(arr[i]) every time through the loop.  The value should not be changing, so you could compute it once, outside of the inner loop.

for(int i =0; i < arr.length;i++) {
    double sqrt_arr_i = Math.sqrt(arr[i]);
    for(int j = 0;j < arr.length;j++) {
        if(sqrt_arr_i == arr[j]) {
            ...

Pairs need distinct indices

If your input contains a single 0 or 1, it will mistakenly report that it has found a pair, since 0 == 0*0 and 1 == 1*1.  You can protect against this by adding i != j && to your test.

If the input contains two 0's (or two 1's), your algorithm will emit 4 pairs: [first,first], [first,second], [second,first], and [second,second].  Adding the i != j guard will eliminate the first and last of those pairs, but it will still declare two pairs: [first,second], [second,first] since first² = second and first = second² would both be true.  You'd have to weight in on whether this would be two distinct pairs or not.

Formatting

Consistent and liberal use of white space is always recommended.  Add white space after every semicolon inside of for(...), on both sides of operators (i = 0 not i =0), and after every comma in {5,25,3,25,4,2,25}.

With the above recommendations, your function body would become:

int arr[] = { 5, 25, 3, 25, 4, 2, 25 };
StringBuilder sb = new StringBuilder();

for(int i = 0; i < arr.length; i++)
{
    for(int j = 0; j < arr.length; j++)
    {
        if(arr[i] == arr[j] * arr[j])
        {
            sb.append(arr[j]).append(',').append(arr[i]).append(" ");
        }
    }
}

String s = sb.toString();
System.out.println(s);

Additional considerations

You have a trailing space in your resulting string.  There are several tricks you can use to remove it.  However, an interesting alternative is to use StringJoiner:

StringJoiner sj = new StringJoiner(" ");

// ... omitted ...

        sj.add(arr[j] + "," + arr[j]);

// ... omitted ...

String s = sj.toString();
System.out.println(s);

When StringJoiner adds the second and successive strings, it automatically adds the delimiter specified in the constructor.


Your get_url function is confusing. It looks like you keep assigning new values to url and ignoring all the previous values. This is what happens when I run it:

>>> get_url("Hello", "World")
'https://thepiratebay.se/user/World/'

Surely this is either a bug or redundant behaviour, since the only argument that matters is the last one? It seems like instead you should be using str.join, which will concatenate all the arguments together with a string separator, so for example:

def get_url(*args):
    return BASE_USER + "/".join(args)

>>> get_url("Hello", "World")
'https://thepiratebay.se/user/Hello/World'
>>> get_url("ban", "an", "a")
'https://thepiratebay.se/user/ban/an/a'

Though as @Mathias Ettinger noted, you should use map(str, args) to ensure that all the arguments are converted to strings as join will raise errors if any of the arguments aren't strings.

check_page_content is hard to understand at first, a lot happens in one line so you should try spread it out to multiple lines. It would be easier to build rows with a list comprehension that filters in advance, rather than gathering up a lot of rows just to later remove them:

def check_page_content(url):
    bs = BeautifulSoup(request_html(url), "html.parser")
    rows = [row for row in bs.findAll("tr")
            if row.findChildren('div', {'class': 'detName'})]

But then I see that you're just returning the boolean value of the list! That means you can break as soon as you found that there's any row, no need to store the list at all. Luckily there's the any function that will do this for you. It supports short circuiting, which means that it will return as soon as it finds a condition that evaluates as True:

def check_page_content(url):
    bs = BeautifulSoup(request_html(url), "html.parser")
    return any(row.findChildren('div', {'class': 'detName'})
               for row in bs.findAll("tr"))

any will apply truthiness to all the values in bs.findAll so if any of them have truthy results then your function will immediately return. Even if you have to check every single row, this is faster than building a full list, mapping and filtering it.

In get_max_pages you have the default value links=list(). I'm not sure if you know about the mutable default and thought this would avoid it but it wont. links will be created once as an empty list. Every time you call the function the same list exists so the same list will be appended to, which is not what you need. Here's a simple example:

>>> def a(b=list()):
    b.append("another")
    return b

>>> a()
['another']
>>> a()
['another', 'another']
>>> a()
['another', 'another', 'another']

Instead you need to use links=None and then use if links is None: links = [] so that a new list is created within each function call.

You have most of your code nested inside if valid, but if you flipped it around you could save nesting by doing this:

def get_max_pages(user, url=None, placeholder=0, links = list(), valid=True):
    if url is None:
        url = get_url(user, str(placeholder), 3)
    if not valid:
        return links

    td = BeautifulSoup(request_html(url), "html.parser").find('td', {'colspan': 9, 'style':'text-align:center;'})

Less nesting generally makes it easier to read code like this.

You have another map filter, I'd recommend doing a similar list comprehension, though it's a little harder to follow:

    regex = re.compile("/user/%s/\d{,3}/\d{,2}" % user)
    pages = [int(a.text) - 1
             for a in td.findAll('a', {'href': regex}) if a.text]

What's happening here is that I'm iterating through td.findAll, and if a.text is True then I'm storing int(a.text) - 1 in pages. This does what your next line does without needing multiple calls.

However, you then may need to further filter pages based on a condition. You could still do this in a comprehension though, just run a list comprehension over pages itself:

if links:
    pages = [x for x in pages if x > placeholder]

Note I removed the int call because you already store them as integers to it's not necessary.

Lastly, your while loop here is strange. It would be easier to just do for element in pages and then break from the loop instead of setting valid = False. This gives you a much simpler loop with less lines:

        for element in pages:
            valid_page = check_page_content(get_url(user, element, 3))
            if valid_page:
                links.append(element)
            else:
                break


If any of fmid, fx1 or fx2 are zero (or close to zero), you should stop, since you already found an answer. That's also in Wikipedia's example algorithm. Even for the constant function f = [](double){return 0;}, your code will still continue and take a total of \$ \log_2 \left(\frac{x_2-x_1}{\varepsilon}\right)\$ calls.
Your recursion cannot get transformed into a loop by GCC. The recursive algorithm looks nice, but since we end up with \$ \log_2 \left(\frac{x_2-x_1}{\varepsilon}\right)\$ calls. An iterative variant is easy to write, so I'd use that one.
Not only must \$x_1 <x_2 \$, but also \$f(x_1) f(x_2) < 0\$, that is, the signs of \$f(x_1)\$ and \$f(x_2)\$ must differ. Otherwise your algorithm might not find the root. I only mention this because you wrote that \$x_1\$ and \$x_2\$ are expected to be ordered, but that's not enough.

Other than that, I strongly suggest you to use braces even for single statement ifs, as missing braces have been a source of errors too often.

Alternatively a little bit more whitespace in your function can make it a lot easier to read:

namespace {
double bisection(double x1,
                 double x2,
                 double e,
                 std::function<double(double)>& f,
                 double fx1,
                 double fx2){

    const double mid = x1*0.5 + x2*0.5;
    const double fmid = f(mid);

    if (x2 - x1 < e || fmid == 0.0) {
        return mid;
    }

    if ((fmid > 0.0) == (fx1 > 0.0)) {
        return bisection(mid, x2, e, f, fmid, fx2);
    } else {
        return bisection(x1, mid, e, f, fx1, fmid);
    }
}
}

I would use the ternary operator though instead of if/else, but that's only a style question. But then again, I would write this in an iterative way, since we don't need an additional helper.


Simplify Raphael JS code: display text in DIV on click event

I agree with tiffon it's better to extract a function, but I don't agree with the rest of their edits, so here's what I would have done (I also kept the style intact).

var initPath = (function () {
    var currentEl;

    function init(el, path) {
        path.attr({
            fill: "#0B0",
            stroke: "#fff",
            "stroke-width": 3,
        });

        path[0].style.cursor = "pointer";
        path[0].onmousedown = function () {
            currentEl && (currentEl.style.display = "");

            path.toFront();
            path.paper.safari();

            el.style.display = "block";
            currentEl = el;
        };
    }

    return init;
})();

window.onload = function () {
    var R = Raphael("paper", 532, 500);
    var paths = {
        'btn_1': R.path("M 180,130 L 340,130, L 392,212, L 128,212 z"),
        'btn_2': R.path("M 128,212 L 392,212, L 435,280, L 85,280 z")
    };

    for (var id in paths) {
        initPath(document.getElementById(id), paths[id]);
    }
};

Firstly, I think st and state were confusing names, so I changed them to be path and id, respectively, and then changed id to el to avoid additional lookups.

I separated the infrastructure (current and initPath) from the usage (R, paths and the loop).

I also think an object literal looks better than a series of assignments, so I changed that.

Finally, I like it better if I move initPath and currentEl into a closure of their own—after all, they don't depend on window.onload anymore.

I left the inner init a named function so it is named in a stack trace, if there is an error.


Optimization in overcoming TLE in interviewStreet problem

Algorithmic optimizations.
As you read the values in work out what quadrant the point belongs to and keep a running total for each quadrant (not adjustment needed on X/Y query). Then you do not need to re-calculate everything every time there is a 'C' request.
As it stands complexity for each C request of O(n). If you keep a running total then it is merely o(1). Think of the situation where you have a 1,000,000 points and you do a 1,000,000 C requests. The code would basically do 1,000,000 * 1,000,000 operations rather than just 1,000,000.
Style
Please stop using this:
using namespace std;

For simple ten line programs it makes things simpler. But once you get past that stage it makes things exceedingly more complex. By causing name clashing problems. It is preferable to prefix stuff in the standard namespace with std:: (why do you think they kept it so short).
A personal opinion. So feel free to ignore. But to distinguish types and objects. I nae types with a leading capitol letter. A lower case indicates an object (or reference).
typedef pair <int,int> pii;

What happens below if any point is on the line (first or second == 0)?
    if ( (pointList[k].first > 0 ) && ( pointList[k].second > 0) ) {
        q1++;
    }
    else if ( (pointList[k].first < 0) && ( pointList[k].second > 0) ) {
        q2++;
    }
    else if  ( ( pointList[k].first < 0) && (pointList[k].second < 0 ) ) {
        q3++;
    }
    else if ( ( pointList[k].first > 0) && (pointList[k].second < 0 ) ) {
        q4++;
    }
}

Here:
void performXYquery(char qType, int i, int j, vector< pii > &pointList)

For readability I would just make this two separate functions performXquery() and performYquery(). It make the code more readable and removes the need for an if statement in the middle of a tight loop.
There is a standard utility function for creating std::pair<> called make_pair.
    pii temp(x,y);
    pointList.push_back(temp);

    // can be written as:
    pointList.push_back(std::make_pair(x, y));

Since qName is a char you can use a switch statement here:
    if (qName == 'C') {
        performCquery(startIndex,endIndex, pointList);
    }
    else if (qName == 'X' || qName == 'Y') {
        performXYquery(qName, startIndex,endIndex, pointList);
    }

    // can be written as:
    switch(qName)
    {
        case 'C': performCquery(startIndex,endIndex, pointList);break;
        case 'X': performXquery(startIndex,endIndex, pointList);break;
        case 'Y': performYquery(startIndex,endIndex, pointList);break;
        default: /* Error Msg */
    }

No need to return 0 from main() in C++. If no explicit return is placed then an automatic return 0 is planted.
Algorithmic optimizations.
As you read the values in work out what quadrant the point belongs to and keep a running total for each quadrant (not adjustment needed on X/Y query). Then you do not need to re-calculate everything every time there is a 'C' request.
As it stands complexity for each C request of O(n). If you keep a running total then it is merely o(1). Think of the situation where you have a 1,000,000 points and you do a 1,000,000 C requests. The code would basically do 1,000,000 * 1,000,000 operations rather than just 1,000,000.
Macro optimizations
Only do these to make the code more readable. Usually the compiler already handles this kind of optimization.
Assume we have an average distribution of points in 4 quadrants:
100 pts                 // cmp == conditional test like > or <
25 in q1 use 2   cmp    // must pass both to enter
25 in q2 use 3.5 cmp    // Note: average (12.5 will do 3 cmp 12.5 will do 4 cmp)
25 in q3 use 5   cmp    //       to enter the code section that will do q2++
25 in q4 use 6.5 cmp

Total: 425 cmp

If we change the code so you include values on the line (ie first or second == 0) in an appropriate quadrant. You don't need the last if statement which reduces the number of comparisons so that:
100 pts                 // cmp == conditional test like > or <
25 in q1 use 2   cmp    // must pass both to enter
25 in q2 use 3.5 cmp
25 in q3 use 5   cmp
25 in q4 use 4.5 cmp

Total: 375 cmp

If we re-range the tests:
if (first >= 0)
{
    if (second >= 0)  ++q1;
    else              ++q4;
}
else // first = 0
{
    if (second >= 0)  ++q2;
    else              ++q3;
}

In this case there are always 2 cmp:
100 nodes * 2 cmp = 200 cmp
Approximately a 100% reduction in the number of cmp.
Note: this does not mean a doubling of speed (maybe a slight improvement on average).
      Assuming the compiler has not already worked this out.

But in my opinion makes the code more readable.


Given a 2D array of digits, try to find the occurrence of a given 2D pattern of digits

Duplication

Your nested loops are almost equal, write a generator that contains the loops and use it twice.

Power

enumerate has more power then you think: you can specify a starting index, so you do not need manual increment.

all

You want all items to be equal, so use all.

Minimalism

Return a boolean not a string, a string is an unecessary complication.


I'd recommend taking advantage of the excellent Mono.Options module.  It's a single .cs file you can drop in to your solution and get full-featured parsing of GNU getopt-style command lines.  (Things like -x -y -z, which is equivalent to -xyz, or -k value, or --long-opt, and so forth.)


Is it bad to have splitInternal function? I couldn't figure out a way without it.

Well, according to your procedure, I think it is necessary, but you can improve the readibility by writing some small functions and then combining them together. Besides, if there are consecutive delimiters, your split function doesn't work as expected. The code can be rewritten as following:
splitInternal :: Char -> ([String], String) -> ([String], String)
splitInternal _ (result, "") = (result, "")
splitInternal c (result, remain) = splitInternal c (getBefore c remain, getAfter c remain)
  where
    getBefore delimiter rest = result ++ [takeWhile (/= delimiter) rest]
    getAfter delimiter rest = dropWhile (== delimiter) . dropWhile (/= delimiter) $ rest

Is there maybe a simpler way to write the function?

Yes, you can use the break and span function defined in Prelude:
split :: Char -> String -> [String]
split _ "" = []
split delimiter str =
    let (start, rest) = break (== delimiter) str
        (_, remain) = span (== delimiter) rest
     in start : split delimiter remain

So in this case, your splitInternal is unnecessary.

Any other feedback is welcome as well

Well, if you are dealing with string, then a better choice is Text from Data.Text. Text is more efficient than String when you are dealing with string. In the module Data.Text, there is a pre-defined function splitOn that works almost as you expect:
ghci> :seti -XOverloadedString

ghci> splitOn "," "123,456,789"
["123","456","789"]

ghci> splitOn "," "123,,,456,789"
["123","","","456","789"]           -- This is what I mean "almost", since splitOn doesn't use the consecutive delimiters. Maybe this is what you want.
```


Speed up Django migration that adds two fields into one

Unfortunately you're using django<2.2, since from 2.2 onwards you can use bulk_update , but you can still use something like

ParticipationCount.objects.all().update(
    people=F("male") + F("female")
)

Which will do it in one query to save time. This will fail for certain fields in Postgres however as it requires some specific type casting, but this can be done within the query


Search and sort customers from JSON file

Your code is really hard to read as noted by @Sumurai8.  That is the first thing that jumps out at you, which is bad.
Consider placing all your javascript code within $(document).ready() handler.  There is no reason any of this code needs to operate in global scope.
Cache your JSON data. There seems to be no reason to continually call getJSON() if you are calling a static file anyway.
Don't keep re-querying the DOM.  If you ever have a case where a selector is going to be used more than once during code operations on a page, you should consider storing the jQuery resource in a variable, so as to minimize queries against the DOM. Of course there is is a trade-off of increased memory consumption for this performance gain, but for most applications, that should not be a concern. Particularly good candidates for this approach are those jQuery selectors that happen within event-handler callbacks that get called repeatedly.
Your filtering condition in the getJSON() success handler does not seem appropriate to me.  I think perhaps the JSON data structure is bad.  Why would you need to iterate over the whole array of searchable objects to figure out which ones meets the keyword criteria?  Why are you then only working with the first returned result that meets this criteria? The data structure should support your desired lookup case. I would consider building a key-based data structure where you combine the keys from the object id and name values and references to applicable objects against that key.  Or alternately have two different data structures - one indexed by id and one indexed by name and make two lookups in response to each find() activity.  Either approach would give operational complexity of O(1) in that the find() operation would take a (relatively) fixed amount of time to execute regardless of the size of the data set you are searching against (once data is loaded).  Your current approach is O(n), such that operation takes linearly longer to complete as the size of your dataset being searched increases. There is no reason at all to make this method perform so poorly.  Between your lack of caching of the data structure and linear complexity, you have a really poorly performing find() function which does all of the following EVERY time the function is called:

You re-load JSON (perhaps via HTTP request, perhaps just from browser cache if lucky) - a costly operation where you read a potentially large string into memory.
You then deserialize that JSON into a javascript array of objects (again a costly operation for potentially large string)
You then iterate every member of that javascript to perform lookup.

You should be striving for a solution where:

Either prior to or with first request to find() you retrieve the JSON data source(s), deserialize them and store them in named javascript variables.
You have a data structure that allows O(1) lookup against the data set.
find() operation uses the stored data structure in javascript to operate against.


implement the merge functionality for 2048 with JavaScript

Review
Some review points on your code

Always delimit code blocks with {}. Eg  if (target !== 0) startIndex++; is safer as         if (target !== 0) { startIndex++; }

Avoid using continue (Its a goto in disguise). Rather the line if (array[endIndex] === 0) continue; is better as if (array[endIndex]) { /*... loop code ...*/ }. See rewrite.

Try to reduce array indexing by storing values in a variable. See rewrite

0 is falsey so if (target !== 0) startIndex++; can be if (target) { startIndex++; } and if (target === 0 ||  can be if (!target ||

Variables that do not change should be constants. eg  let target = array[start]; can be const target = array[start];

Try to keep names short. Long names make code harder to read

Rewrite
rewriting your function using the points above.

function mergeLeft(row) {
    var start = 0;
    for (let end = 1; end < row.length; end++) {
        const tile = row[end];
        if (tile) {
            const target = row[start];
            if (!target || target === tile ) {
                row[start] += tile ;
                row[end] = 0;
            } else if (start + 1 < end) {
                end--;
            }
            if (target) { start++; }
        }
    }
    return row;
}

Coordinate transform
Use a single dimension (1D) array to store the game board. The position on the board can be calculated from a coordinate pair. x = 2, y = 1 is 3rd column 2nd row. The index in a 1D array is index = x + y * size where size is the number of columns (4 in this case)
Your merge function moves from left to right, then down (I assume) to the next row and does the same. You can create an inner (columns) and outer (rows) loop, and calculate the board index from the coordinate pairs x,y

for (y = 0; y < 4; y ++) {
    for (x = 0; x < 4; x ++) {
        index = x + y * 4;
        // merge row
    }
}

The above steps over the arrays in the same direction as your mergeLeft function
To have it handle different directions you can define some functions that convert (transform) the x, y position to the correct index for the 4 directions. Up, Right, Left, and Down
For Example
const size = 4;                             // width and height of board
const tileCount = size * size;
const board = new Array(tileCount).fill(0); // Create the array of tiles

// named directions. The name of the key press
const moves = {
    up: 0,
    right: 1,
    down: 2,
    left: 3,
};

// functions that convert x,y position into board index
const coordTransform = [
    (x, y) => y + x * size,                // up from top down
    (x, y) => (size - 1) - x + y * size,   // right for right to left
    (x, y) => y + ((size - 1) - x) * size, // down from bottom up
    (x, y) => x + y * size,                // left from left to right
];

Before merging the rows we get the direction function const move = coordTransform[moves.up];
Then in the loop we use that function to transform the coordinates so that we step over items in the correct direction for the move. const idx = move(x, y); gets the transformed position.
Example using the above code to merge in any direction.
// The comments and naming is in terms of rows from left to right. move(moves.left)
// Call the function with the direction index eg move(moves.up);
function move(dir) {
    // Tiles will stack to the left.
    // left is the idx of the next left free pos
    // prev holds the prev left pos and is used to merge values if same
    var x, y = 0, left, prev;

    // get the function to convert coord to board index
    const move = coordTransform[dir];  //  transform function for direction
    while (y < size) {
        left = x = 0;
        prev = -1;
        while (x < size) {
            const idx = move(x, y);  // Get the tile index using transform function
            const tile = board[idx]; // Get the tile value
            if (tile) {              // Does tile have a value
                board[idx] = 0;                  // Remove the tile from the board
                const idxLeft = move(left, y);   // Get next stack pos
                board[idxLeft] = tile;           // Set the tile value
                if (prev > -1) {                 // Is there a tile to left
                    if (tile === board[prev]) {  // Is tile to left the same
                        board[prev] += tile;     // Merge the tile values
                        board[idxLeft] = 0;      // Remove second tile,
                        left--                   // Move index back
                        prev = -1;               // Ensure only two merge at a time
                    } else { prev = idxLeft }    // If tile did not merge remember
                } else { prev = idxLeft  }       //    position of tile
                left ++;                         // Move stack pos to next tile
            }
            x++;     // step to next column
        }
        y++;         // step to next row.
    }
}

UPDATE Implementing the game.
The snippet is an implementation of the game without an in depth study of the original game.
It uses a partial OO approach

"If we are going to build this game using a traditional object-oriented way, what are the class we need to design here?"

Objects used

Note that JS uses Objects. You should not use the term class due to the significant differences between classes and objects in computer science.

I do not use the class syntax due to its very ill though out implementation (incomplete and a syntactical hack)

There is a factory function Game that encapsulates the game, with support code to add the UI for the particular environment (Code review snippet) placed outside Game.
The Game object uses closure to create private functions and properties. It also reduces the need to add the noisy this. and the even hackier this.#
Within Game is the Object Tile that uses the traditional OO JS prototype object style to implement the display and animation of tiles.
There are also various simple objects within Game
. states  Holds enumerated game states.
. moves Holds enumerated game actions (a move is a keyboard (swipe, or mouse, if implemented)) direction to move tiles
. moveTransform is the transform used to convert 2D tile positions to 1D tile array positions depending on the move direction. (See details in first part of answer)
Outside the Game object
The keyboard interface uses a simple static object keys via an immediately invoked factory function (using closure to encapsulate private function) that ensures the will only be one instance of the keyboard interface.
Question 2

"I figured that we can use a 2-dimensional array to represent the board, or as one of the answers presented, we can use a 1-dimensional array to hold x,y coordinates, I wonder what are some of the pros and cons with either approach?"

The main reason is to reduce complexity. Rather than have to deal with coordinate pairs only a single value is needed to locate a tile. This reduces the complexity .
This game only has a small number of tiles 16 (though example allows up to 64 (it will handle many more but has be limited in the example to prevent poor performance on low end devices).
Many games use 2D layouts with 1000s of tiles, using 1D rather than 2D has many advantages

1D arrays reduce the overhead associated with indexing arrays items

1D arrays use less memory

1D arrays can easily be converted to typed arrays without the need for complex instantiation code. On low end devices a typed array (as a shared array) allows logic in worker threads to share the data.

Question 3

"I was looking at it from an OOD approach and I was also aware that we can use functional programming instead. Here is my attempt"

Functional programming (FP) as a style in JS adds way too much processing and memory overheads to make it a practical for realtime games.
FP in JS has been adopted as a defense against poor encapsulation that is so common in JS.
Using a robust encapsulation style there is (in my view) no need to write in FP style in JS
The example below is written to fit the code review snippet and as such can not use modules.
Modules add an additional layer of encapsulation to JS code preventing side effects by creating privates scopes per module further reducing the need to use the FP style.

const eCurve = (v, p = 2) =>  v <= 0 ? 0 : v >= 1 ? 1 : v ** p / (v ** p + (1 - v) ** p);
const bellCurve = (v, p = 2) =>  v <= 0 ? 0 : v >= 1 ? 0 : (v *= 2, (v = v > 1 ? 2 - v : v),  v ** p / (v ** p + (1 - v) ** p));
const bCurve = (v, a, b) => v <= 0 ? 0 : v >= 1 ? 1 : 3*v*(1-v)*(a*(1-v)+b*v)+v*v*v; // cubic bezier curve
Math.PI90 = Math.PI / 2;
Math.TAU = Math.PI * 2;
Math.PI270 = Math.PI * (3 / 2);
const randUI = (min, max) => (max !== undefined ? Math.random() * (max - min) + min : Math.random() * min) | 0;
const randPick = arr => arr.splice(randUI(arr.length), 1)[0];
const randItem = arr => arr[randUI(arr.length)];
const tag = (tag, props = {}) => Object.assign(document.createElement(tag), props);

canvas.width = innerWidth;
canvas.height = innerHeight;
const ctx = canvas.getContext("2d");
const keys = (()=>{
    const keys = {
        ArrowLeft: false,
        ArrowRight: false,
        ArrowUp: false,
        ArrowDown: false
    };
    document.addEventListener("keydown", keyEvent);
    document.addEventListener("keyup", keyEvent);
    function keyEvent(e) {
       if (keys[e.code] !== undefined) { keys[e.code] = e.type === "keydown"; e.preventDefault() }
    }
    return keys;
})();
var pageResized = false, inGame = false, instructionsKnown = 0, gameType = 1;
addEventListener("resize", () => { if (inGame) { pageResized = true } });
sel.addEventListener("click", (e) => {
  if (!inGame && e.target.dataset.game !== undefined) {
      gameType = e.target.dataset.game;
      sel.style.display = "none";
      playGame(gameType);
  }

});

const pathRoundBox = (ctx, x, y, w, h, r) => {
    const w2 = w / 2, h2 = h / 2;
    ctx.arc(x - w2 + r, y - h2 + r, r, Math.PI, Math.PI270);
    ctx.arc(x + w2 - r, y - h2 + r, r, Math.PI270, Math.TAU);
    ctx.arc(x + w2 - r, y + h2 - r, r, 0, Math.PI90);
    ctx.arc(x - w2 + r, y + h2 - r, r, Math.PI90, Math.PI);
}
function Game(size, winTile, speed = 20, tilesPerMove = 2) {
    var state;
    var moveCount = 0, displayDirty = true;
    const animRate = 1 / speed;
    const tileCount = size * size;
    const board = new Array(tileCount).fill(0);
    const mergingTiles = [];
    const freeTiles = [];
    const newTileVal = [];
    const newTileSet = [2,4,2,4,2,4,2,4,2,4,2,4];
    const states = {
        over: 1,
        inPlay: 2,
        animating: 3,
        win: 4,
    };
    state = states.inPlay;
    const moves = {
        up: 0,
        right: 1,
        down: 2,
        left: 3,
    };
    const moveTransform = [
        (x, y) => y + x * size,
        (x, y) => (size - 1) - x + y * size,
        (x, y) => y + ((size - 1) - x) * size,
        (x, y) => x + y * size,
    ];
    function Tile(val, idx, growDelay = 0) {
        this.nx = this.x = idx % size;
        this.ny = this.y = idx / size | 0;
        this.val = val;
        this.anim = 0;
        this.alpha = 1;
        this.animate = true;
        this.merging = false;
        this.grow = true;
        this.size = -growDelay;
        this.flash = false;
        this.flashAlpha = 0;
    }
    Tile.prototype = {
        newPos(idx) {
            this.nx = idx % size;
            this.ny = idx / size | 0;
            this.ax = this.x;
            this.ay = this.y;
            this.anim = 1;
            this.animate = true;
        },
        merge(idx) {
            this.newPos(idx);
            this.merging = true;
            return this;
        },
        mergeFlash(idx) {
            this.animate = true;
            this.flash = true;
            this.flashAlpha = 1;
            this.val *= 2;
            return this;
        },
        update() {
            if (this.merging) {
                this.alpha -= animRate;
                if (this.alpha <= 0) {
                    this.alpha = 0;
                    this.merging = false;
                }
            }
            if (this.anim > 0) {
                this.anim -= animRate;
                if (this.anim <= 0) { this.anim = 0 }
            }
            if (this.grow) {
                this.size += animRate;
                if (this.size > 1) {
                    this.size = 1;
                    this.grow = false;
                }
            }
            if (this.flash) {
                this.flashAlpha -= animRate * 2;
                if (this.flashAlpha < 0) {
                    this.flashAlpha = 0;
                    this.flash = false;
                }
            }
            this.animate =  this.flash || this.grow || this.merging || this.anim > 0;
            displayDirty = this.animate ? true : displayDirty;
            if (this.anim > 0) {
                const p = eCurve(1 - this.anim);
                this.x = (this.nx - this.ax) * p + this.ax;
                this.y = (this.ny - this.ay) * p + this.ay;
            } else {
                this.x = this.nx;
                this.y = this.ny;
            }
        },
        render(target) {
            const {ctx, scale, radius, cols, textCol, pad} = target;
            ctx.save()
            const hS = scale / 2;
            var x = this.x * scale;
            var y = this.y * scale;
            const inScale = this.flash ?  1 + bellCurve(this.flashAlpha) * 0.1 : bCurve(this.size, 0, 1.6);
            ctx.transform(inScale, 0, 0 , inScale, x + hS, y + hS);
            ctx.globalAlpha = eCurve(this.alpha);
            ctx.fillStyle = cols[this.val];
            ctx.beginPath();
            pathRoundBox(ctx, 0, 0, scale - pad * 2, scale - pad * 2, radius);
            ctx.fill();
            if (this.flash) {
                ctx.globalCompositeOperation = "lighter";
                ctx.globalAlpha = eCurve(this.flashAlpha);
                ctx.fillStyle = "#FFF";
                ctx.fill();
                ctx.globalCompositeOperation = "source-over";
                ctx.globalAlpha = 1;
            }
            ctx.fillStyle = textCol;
            ctx.fillText(this.val, 0, 0 + scale * 0.05);
            ctx.restore()
        }
    }
    function addTile(growDelay) {
        const pos = randPick(freeTiles);
        if (newTileVal.length === 0) { newTileVal.push(...newTileSet) }
        board[pos] = new Tile(randPick(newTileVal), pos, growDelay);
    }
    function checkBoard() {
        var i = tileCount, s = state;
        freeTiles.length = 0;
        while (i--) {
            const t = board[i];
            if (t?.val === winTile) {
                s = states.win;
            } else if (t === 0) {
                freeTiles.push(i);
            }
        }
        if (freeTiles.length < tilesPerMove && s !== states.win) { s = states.over }
        API.state = s;
    }
    function move(dir) {
        moveCount ++;
        var x, y = 0, f, prev;
        const move = moveTransform[dir];
        while (y < size) {
            f = x = 0;
            prev = -1;
            while (x < size) {
                const idx = move(x, y);
                const tile = board[idx];
                board[idx] = 0;
                if (tile) {
                    const idxf = move(f, y);
                    board[idxf] = tile;
                    idxf !== idx && tile.newPos(idxf);
                    if (prev > -1) {
                        if (tile.val === board[prev].val) {
                            board[prev].mergeFlash();
                            mergingTiles.push(tile.merge(prev));
                            board[idxf] = 0;
                            f--;
                            prev = -1;
                        } else { prev = idxf }
                    } else { prev = idxf }
                    f++;
                }
                x++;
            }
            y++;
        }
    }
    const API = {
        states: Object.freeze(states),
        moves: Object.freeze(moves),
        get displayDirty() {
            if (state === states.animating) { displayDirty = true }
            const res = displayDirty;
            displayDirty = false;
            return res;
        },
        get moveCount() { return moveCount },
        get state() { return state },
        set state(s) {
            if (s !== state) {
                if (state === states.animating && s === states.inPlay) {
                    state = s;
                    checkBoard();
                    if (state === states.inPlay) {
                        let i = 0
                        while (i < tilesPerMove) { addTile(i++ / 2) }
                        displayDirty = true;
                    }
                } else {
                    state = s;
                    displayDirty = true;
                }
            }
        },
        set move(dir) {
            if (state === states.inPlay) {
                if (dir >= 0 && dir < 4) {
                    move(dir);
                    API.state = states.animating;
                }
            }
        },
        reset() {
            board.fill(0);
            API.state = states.animating;
            moveCount = 0;
            checkBoard();
        },
        render(target) {
            var i = 0, tail = 0, animating = false;
            board.forEach(tile => {
                if (tile !== 0) {
                    tile.animate && (animating = true, tile.update());
                    tile.render(target);
                }
            });
            while (i < mergingTiles.length) {
                const tile = mergingTiles[i];
                tile.update();
                tile.render(target);
                if (tile.animate) {
                    animating = true
                    mergingTiles[tail++] = tile
                }
                i++;
            }
            mergingTiles.length = tail;
            !animating && state === states.animating && (API.state = states.inPlay);
        },
    }
    return Object.freeze(API);
}

function createBGImage(img, tiles, pad, radius) {
    const ctx = img.getContext("2d");
    ctx.fillStyle = "#222";
    ctx.beginPath();
    pathRoundBox(ctx, img.width / 2, img.height / 2, img.width, img.height, radius + pad * 2);
    ctx.fill();
    var i = 0;
    const size = img.width / tiles;
    ctx.fillStyle = "#666";
    while (i < tiles * tiles) {
        const x = (i % tiles) + 0.5;
        const y = (i / tiles | 0)  + 0.5;
        ctx.beginPath();
        pathRoundBox(ctx, x * size, y * size, size - pad * 2, size - pad * 2, radius);
        ctx.fill();
        i++;
    }
    return img;
}

function playGame(game = gameType) {
    inGame = true;
    const GAMES = [
       [4, 512,  20, 2],
       [5, 2048, 20, 2],
       [6, 2048, 20, 2],
       [7, 1024, 20, 3],
       [8, 2048, 16, 4],
    ];
    const SIZE = GAMES[game][0];
    const g = Game(...GAMES[game]);
    g.reset();
    ctx.canvas.width = innerWidth;
    ctx.canvas.height = innerHeight;
    requestAnimationFrame(animLoop);
    const minRes =  Math.min(ctx.canvas.width, ctx.canvas.height);
    const unit =  minRes / 64;
    const RADIUS = minRes / SIZE / 8, PAD = minRes / SIZE / 16;
    const bgImage = createBGImage(tag("canvas", {width: minRes, height: minRes}), SIZE, PAD / 2, RADIUS + PAD / 2);
    const renderTarget = {
        ctx,
        scale:  minRes / SIZE,
        radius: RADIUS,
        pad:    PAD,
        textCol: "#000",
        cols: {
            [2]:    "#F40",
            [4]:    "#F80",
            [8]:    "#FA0",
            [16]:   "#FC0",
            [32]:   "#FF0",
            [64]:   "#CF0",
            [128]:  "#8F0",
            [256]:  "#0F0",
            [512]:  "#0F8",
            [1024]: "#0FF",
            [2048]: "#FFF",
        }
    }
    ctx.font = (renderTarget.scale * 0.7 | 0) + "px Arial";
    ctx.textAlign = "center";
    ctx.textBaseline = "middle";
    function animLoop() {
        var m = -1;

        // Rather than dynamic resize this just restarts on resize
        if (pageResized) {
            pageResized = false;
            setTimeout(playGame, 0);
            inGame = false;
            return;
        }
        if (keys.ArrowUp) { keys.ArrowUp = false; m = g.moves.up }
        if (keys.ArrowRight) { keys.ArrowRight = false; m = g.moves.right }
        if (keys.ArrowDown) { keys.ArrowDown = false; m = g.moves.down }
        if (keys.ArrowLeft) { keys.ArrowLeft = false; m = g.moves.left }

        if (m > -1) {
            g.move = m;
            instructionsKnown++;
        }
        const state = g.state;
        if (g.displayDirty) {
            ctx.textAlign = "center";
            ctx.textBaseline = "middle";
            ctx.setTransform(1,0,0,1,0,0);
            ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);
            ctx.font = (renderTarget.scale * 0.45 | 0) + "px Arial";
            ctx.setTransform(1,0,0,1,(canvas.width - SIZE * renderTarget.scale) / 2, 0);
            ctx.drawImage(bgImage, 0, 0);
            g.render(renderTarget);
            if (!(state === g.states.inPlay || state === g.states.animating)) {
                ctx.fillStyle = "#0008";
                ctx.setTransform(1,0,0,1,0,0);
                ctx.fillRect(0, 0, ctx.canvas.width,  ctx.canvas.height);
                ctx.font = (renderTarget.scale * 0.7 | 0) + "px Arial";
                ctx.textAlign = "center";
                ctx.textBaseline = "middle";
                ctx.fillStyle = "#FFF";
                ctx.strokeStyle = "#000";
                ctx.lineWidth = unit * 2;
                ctx.lineJoin = "round";
                const cx =  ctx.canvas.width * 0.5;
                const cy =  ctx.canvas.height * 0.3
                if (state === g.states.win) {
                    ctx.strokeText("WINNER!", cx + unit / 2, cy + unit / 2);
                    ctx.fillText("WINNER!",cx, cy)
                    ctx.strokeStyle = "#FED";
                    ctx.lineWidth = unit / 2;
                    ctx.lineJoin = "round";
                    ctx.strokeText("WINNER!", cx, cy)
                    ctx.font = (renderTarget.scale * 0.4 | 0) + "px Arial";
                    ctx.fillStyle = "#FFF";
                    ctx.strokeStyle = "#000";
                    ctx.lineWidth = unit;
                    const mC = g.moveCount;
                    ctx.strokeText("Moves: " + mC, cx + unit / 4, cy + unit * SIZE * 3 + unit / 4);
                    ctx.fillText("Moves: " + mC, cx, cy + unit * SIZE * 3);

                } else {
                    ctx.strokeText("GAME OVER", cx + unit / 2, cy + unit / 2);
                    ctx.fillText("GAME OVER", cx, cy)
                    ctx.strokeStyle = "#DEF";
                    ctx.lineWidth = unit  / 2;
                    ctx.lineJoin = "round";
                    ctx.strokeText("GAME OVER", cx, cy);
                }

                inGame = false;
                return;
            }
            if (instructionsKnown < 2) {
                ctx.setTransform(1,0,0,1,0,0);
                ctx.fillStyle = "#FFF";
                ctx.font = "16px Arial";
                ctx.fillText("Use arrow keys to play", ctx.canvas.width / 2, 20);
            }
        }
        requestAnimationFrame(animLoop);
    }
}
canvas {
   position: absolute;
   top: 0px;
   left: 0px;
   pointer-events: none;
}
#sel {
  font-family: arial;
  display: flex;
}
.bt {
   flex-wrap: row;
   cursor: pointer;
   width: 50px;
   text-align: center;
   border: 1px solid black;
   margin: 4px;
   padding-top: 3px;
}
.bt:hover {
   background: #D92;
}
.txt {
  margin-top: 8px;
}
<canvas id="canvas"></canvas>
<div id="sel">
   <div class="txt">Select grid size:</div>
   <div class="bt" data-game="0">4 by 4</div>
   <div class="bt" data-game="1">5 by 5</div>
   <div class="bt" data-game="2">6 by 6</div>
   <div class="bt" data-game="3">7 by 7</div>
   <div class="bt" data-game="4">8 by 8</div>
</div>

Note Code review pages use a lot of JS and as such impact the performance of snippets. To get a true feel of how the game plays copy the code to a stand alone page..
Note as there is a limit to code review answer size the above was coded to fit and as such lost a lot of code and reduced naming length to fit.


Minimum cost path of matrix using Python

You can do it without using any additional table. I want to do it without recursion, but you can create recursive version very easily yourself.

First, let's see what is the second table in the link solution. In that table, the value of each table cell is the minimum cost for accessing that cell. But what about the cost table? in the cost table, the value of each cell is simply the cost of that cell.

So, for turning the cost table to the minimum cost table of each cell, we need to run the minimum-path algorithm on it.

For each cell, we will choose the minimum value of {cost of upper cell + cost of the current cell, cost of top-left cell + cost of the current cell, cost of left cell + cost of current cell}. Don't forget that we only allowed moving to the right, down and right-down, and because now we are moving in the opposite direction in each row, we should consider opposite movements.

Talking is enough, let's code speaks a little:

def test(cost, m, n):
    # Initializing the first column
    for i in range(1, m + 1):
        cost[i][0] += cost[i - 1][0]
    # Initializing the first row
    for j in range(1, n + 1):
        cost[0][j] += cost[0][j - 1]
    for j in range(1, n + 1):
        for i in range(1, m + 1):
            cost[i][j] += min(cost[i - 1][j - 1], cost[i][j - 1], cost[i - 1][j])
    return cost

Two first steps are like the solution in the link. In the first column of the table, we don't have any left cell, so for avoiding complex works on indexes, we first calculate the weight of cells those belong to the first column of the table.

Again, we should do different work for the first row of the table. Because this row has no top and top left cell.

Then, we start to calculate the minimum value for moving to each cell for 1..=m column and 1..=n row. We Don't calculate the weights of cells that are after the desired cell, because it is not necessary.

In the cost table, for calculating the values of each row, we only need the values of the previous row. So, As you can see, we can use the cost table as the minimum-cost paths table without any problem.

Here is the final code:

def trip_min(num1, num2, num3):
    return min([num1, num2, num3])[0]

def test(cost, m, n):
    for i in range(1, m + 1):
        cost[i][0] += cost[i - 1][0]
    for j in range(1, n + 1):
        cost[0][j] += cost[0][j - 1]
    for j in range(1, n + 1):
        for i in range(1, m + 1):
            cost[i][j] += min(cost[i - 1][j - 1], cost[i][j - 1], cost[i - 1][j])
    return cost

if __name__ == '__main__':
    input_list = [[i+j for i in range(10)] for j in range(10)]
    res = test(input_list, 8, 8)
    print(res)
    print(res[8][8])

I changed the trip_min function and used the min function instead of writing the code of minimum by myself. Why? Because using builtin functions is always better than writing your own code, unless those behavior or performance is not exactly what you want. That reduces the probability of bug in your code any many times makes your code faster and cleaner.

Also, I changed the name of the cost table form input to the input_list. input is the name of a build-in function of the Python and it's a very bad idea to declear a variable with the same name of other things. That will make you and your collaborators confused about the code in the future.

You can get the minimum cost to each cell by calling res[row][col] on the result of the test function (You can't do that on the indexes after m and n as described).

The last thing I should say is if you use the cost table as the minimum-cost paths table,  you can not re-use that costs. Because we actually changed the value of the input_list. As you may know, if you send a list as a parameter to a function, and you change the values of that list, the original list will change. Why? Because Python will not copy the lists when you pass them as function parameters.

So if you want to calculate minimum paths for different cells, it's better to first calculate the minimum-path table for entire cost table (by passing m and n to the lengths of the table), and then access values from the result table.

And, I promise it's the final note, don't forget that res and input_list both are exactly same lists (Actually, you can remove the return in the test function).


I'll start from the top and work my way down to the bottom.

 def gtin_check(gtin: str)-> str:

Your type-hinting is incorrect here. Except in cases of invalid input, you are returning a boolean, not a string. Which leads me to...
    if not isinstance(gtin, str) or len(gtin) not in (8,12,13,14,17,18):
        return 'Not a string'

In general it is a bad idea to mix two completely different return types for one function, unless there is some pressing reason to do so. The mixing creates more work for whoever is calling your function, since they have to handle both types. (Null value/None is probably the most common exception to this rule; sometimes it's appropriate to return None, e.g. if a function that is searching for a single specific object or value doesn't find one.)
To get rid of the string return value, I would suggest one of these alternatives:

If the calling function really needs to know the difference between an input that had a bad check digit, and an input that was invalid in a "stronger" way: either raise an exception, or make your return type an enum with three possible values (e.g. VALID, INVALID, and MALFORMED).
If the calling function only needs to know whether an input was a valid GTIN or not: just return False.

    if not isinstance(gtin, str) or len(gtin) not in (8,12,13,14,17,18):
        return False

Now let's talk about performance. in / not in checks are generally faster on sets than they are on lists or tuples. This is because sets do clever things with hashing (\$O(1)\$), while with lists and tuples you have to go down the line and check every value in order (\$O(n)\$). So let's use a set instead.
    if not isinstance(gtin, str) or len(gtin) not in {8,12,13,14,17,18}:
        return False

While we're doing these other checks, it would also be good to use .isdecimal() to check that the input string is numeric. Right now we don't have any code to catch non-numeric inputs like 'asdfghjk', so we get a slightly ugly error (ValueError: invalid literal for int() with base 10: 'a').
    if (not isinstance(gtin, str)
            or not gtin.isdecimal()
            or len(gtin) not in {8,12,13,14,17,18}):
        return False

The line was getting a bit long, so I added some line breaks. See the PEP 8 document for guidelines on when and how to use line breaks.

        gtin_lst = [int(x) for x in gtin]
        #print("step 1 - give the gtin but as a list of integers",gtin_lst)
        gtin_lst.reverse()
        #print("step 2 reverse the gtin",gtin_lst)
        gtin_original = gtin_lst #saving the list to gtin_original
        #print("step 3 : gtin original still reverse",gtin_original)
        gtin_lst = gtin_original[1:]
        #print("step 4 - gtin_lst starting from the first element",gtin_lst)
        gtin_original.reverse()

This section is confusing - you're putting the original value in a new variable and the altered value in the original variable, not to mention reversing a reversal. It would be easier to understand if you left gtin_lst intact and used negative indexes to extract the subset you need:
        gtin_lst = [int(x) for x in gtin]
        gtin_lst_without_check_digit = gtin_lst[:-1]
        gtin_lst_without_check_digit.reverse()

        # arriving at the algorithm part
        gtin_lst = [x*3 if i%2 == 0 else x for i,x in enumerate(gtin_lst)]

It is more "pythonic" to avoid == 0 in conditions, and instead use the inherent "falsiness" of 0.
x*3 if not i%2 else x

I see you have already done this in another part of the code: if (som_gtin1 % 10):.

        if (som_gtin1 % 10):
            som_gtin2 = som_gtin1 + (10 - som_gtin1 % 10) # (10 // gcd(som_gtin1, 10)) *  som_gtin1 #int(round(som_gtin1, -1)) #som_gtin1 + (10 - som_gtin1 % 10)
        else:
            som_gtin2 = som_gtin1

The logic here is solid, but this seems like a good place to talk about naming.
In general, naming variables by the pattern foo1, foo2, etc. is a code smell. If you have more than one of the same kind of thing, why aren't they in some kind of list or collection? And if
they aren't the same kind of thing, why do they have the same name? There are exceptions, but I would say this is a bad idea nine times out of ten.
In this case, som_gtin1 and som_gtin2 aren't the same kind of thing.

som_gtin1 is a sum of some numbers. (Is "som" instead of "sum" a typo, or are you deliberately using a non-English word?)
som_gtin2 is som_gtin1 rounded to the nearest highest 10. In other words, it is based on a sum, but it is not a sum itself.

Also, since the function is named gtin_check, we already know that everything we're doing is related to GTINs somehow. So adding _gtin to the variable names doesn't really give the reader any additional information.
Picking accurate and descriptive names throughout your code will make it easier to read and understand. You will sometimes hear people describe this kind of code as "self-documenting", because it does not need nearly as many comments or external documents.
        if (digits_sum % 10):
            uprounded_sum = digits_sum + (10 - digits_sum % 10)
        else:
            uprounded_sum = digits_sum

Let me be clear: I'm not claiming that my names are perfect either. There's an old joke that "there are only two hard problems in computer science: cache invalidation and naming things."

        if (som_gtin2 - som_gtin1) == gtin_original[-1]:
            return True
        else:
            return False

I had a computer science professor in college who specifically warned us not to use this construction. So naturally, I didn't notice it until an hour after I finished writing the rest of this answer.
As my professor pointed out, any logic of the form "if boolean value, return true, else return false" can be reduced to "return boolean value".
        return ((som_gtin2 - som_gtin1) == gtin_original[-1])

The wrapping parentheses aren't strictly necessary, but I think they make the code clearer.

Putting it all together
def gtin_check(gtin: str) -> bool:
    """Returns whether the input is a well-formed GTIN string."""
    # Check for obvious problems
    if (not isinstance(gtin, str)
            or not gtin.isdecimal()
            or len(gtin) not in (8,12,13,14,17,18)):
        return False
    else:
        # Compute correct "check digit" and compare to input's digit
        original_digits = [int(x) for x in gtin]
        digits_without_check_digit = original_digits[:-1]

        digits_without_check_digit.reverse()
        multiplied_digits = [x*3 if not i%2 else x
                             for i,x
                             in enumerate(digits_without_check_digit)]
        digits_sum = sum(multiplied_digits)

        if (digits_sum % 10):
            uprounded_sum = digits_sum + (10 - digits_sum % 10)
        else:
            uprounded_sum = digits_sum
        expected_check_digit = uprounded_sum - digits_sum

        return (original_digits[-1] == expected_check_digit)


When writing maintainable code, I'd recommend to declare variables in narrow scopes, if possible. If you do something like:

var inputStr, inputsArray, numsArray, arrayStrNumber, isAdd, isSub, isMul, isDiv;

at the very beginning, then on every line throughout the rest of the program, you'll have to keep in mind the possible values for all of those variables. If the script is long, this can be a problem. Consider encapsulating related functionality into separate functions instead - for example, you could turn the input into an array in one function, sort it in another, and then finally iterate through it to produce the result in a third. That way, for example, inputStr will only be visible to the first function (as an argument), and neither of the first two functions will have isAdd etc visible to them. Separating functionality into smaller self-contained sections makes code a lot more readable.

Since it's 2020, it would be nice to write source code in modern syntax - at least in ES2015. Modern syntax generally makes code more concise, easier to read, and less buggy. (I'll be using modern syntax in suggestions below.)

Consider always using strict mode - you have some variables that you never declare (strArray and x), which means that they get implicitly assigned to the global object. This is an easy source of bugs, not to mention inelegant; strict mode will throw an error when this sort of thing happens, allowing you to fix it on sight.

When you have to iterate over an array or a string, it's nice to be able to immediately work with each item being iterated over immediately, rather than having to mess with indicies. Both strings and arrays have iterators (which iterate over either each character, or each array item), so you can do this concisely with for..of. For example:

for (let i = 0; i < inputsArray.length; i++) {
  const inputValue = inputsArray[i];

can be replaced with

for (const inputValue of inputsArray) {

You do

isNaN(numsArray[i]) ?
  (numsArray[i] = "" + inputValue[x] + "") :
  (numsArray[i] += "" + inputValue[x] + "");

The conditional operator should only be used when you need an expression which is identified conditionally, like console.log(cond ? '1' : '2'). If the expression that results from using the conditional operator isn't being used, like in your code, it would be more readable to remove it and use if/else instead. (It's fine for minifiers to do that, but minified code isn't intended to be read - source code that developers write should be as readable as possible). There's even a linting rule to help you automatically identify and fix this sort of thing.

So, you have a string which is composed of numbers, plus one letter somewhere inside it, and you need to separate them. If you want to do this concisely, you might consider using replace to replace the letter character with the empty string, and use a callback to assign the matched value (the letter) to an outer variable, like this:

function separateWord(word) {
  let char;
  const num = Number(
    word.replace(
      /[a-z]/i,
      match => {
        char = match;
        return ''; // replace this match with the empty string
      }
    )
  );
  return { char, num };
}
console.log(separateWord('123b456'));

On a broader scale, using the above function, I think the first section of the code which turns each word into a sorted array would be easier to manage if you used an object indexed by character instead, whose values are arrays of numbers. Eg, for the above 123b456, that would result in the following object:

{
  b: [123456]
}

Iterate over each word, pushing to an array on the object, creating it first if necessary. Then, the object properties can be arranged lexiographically by sorting its entries (Object.entries returns an array of entries, where an entry is an array containing the key and the value, so just compare the keys in the .sort). This makes things so much shorter and cleaner:

function getOrderedNumbers(numbersByChar) {
  return Object.entries(numbersByChar)
    .sort((a, b) => (a[0] > b[0]) - 0.5) // Order entries alphabetically
    .map(entry => entry[1]) // Take only the value of each entry
    .flat(); // Turn the array of arrays of numbers into a single array of numbers
}
function parseString(inputStr) {
  const numbersByChar = {};
  for (const word of inputStr.split(' ')) {
    const { char, num } = separateWord(word);
    if (!numbersByChar[char]) {
      numbersByChar[char] = [];
    }
    numbersByChar[char].push(num);
  }
  const numbersArr = getOrderedNumbers(numbersByChar);
  return doMath(numbersArr);
}

For the doMath function, keeping track of 4 separate booleans and performing 4 different if checks is a bit verbose for the task at hand. You might consider using an array of functions instead, and using the modulo operator to identify which function to call:

function doMath(numbersArr) {
  const fns = [
    (subtotal, num) => subtotal + num,
    (subtotal, num) => subtotal - num,
    (subtotal, num) => subtotal * num,
    (subtotal, num) => subtotal / num,
  ];
  // Remove first value so operation can start with + with first and second value:
  let subtotal = numbersArr.shift();
  numbersArr.forEach((num, i) => {
    subtotal = fns[i % 4](subtotal, num);
  });
  return subtotal;
}
console.log(doMath([1, 2, 4, 5])); // ((1 + 2) - 4) * 5

reduce would be more appropriate than forEach to transform the array of numbers into a single number, but if you're a beginner, you probably prefer the forEach version since it's more intuitive:

function doMath(numbersArr) {
  const fns = [
    (subtotal, num) => subtotal + num,
    (subtotal, num) => subtotal - num,
    (subtotal, num) => subtotal * num,
    (subtotal, num) => subtotal / num,
  ];
  // Remove first value so operation can start with + with first and second value:
  const initialValue = numbersArr.shift();
  return numbersArr.reduce((subtotal, num, i) => fns[i % 4](subtotal, num), initialValue);
}
console.log(doMath([1, 2, 4, 5])); // ((1 + 2) - 4) * 5

Put it all together:

'use strict';

console.log(doMath("10a 90x 14b 78u 45a 7b 34y"));

function separateWord(word) {
  let char;
  const num = Number(
    word.replace(
      /[a-z]/i,
      match => {
        char = match;
        return ''; // replace this match with the empty string
      }
    )
  );
  return { char, num };
}
function getOrderedNumbers(numbersByChar) {
  return Object.entries(numbersByChar)
    .sort((a, b) => (a[0] > b[0]) - 0.5) // Order entries alphabetically
    .map(entry => entry[1]) // Take only the value of each entry
    .flat(); // Turn the array of arrays of numbers into a single array of numbers
}
// Entry point:
function doMath(inputStr) {
  const numbersByChar = {};
  for (const word of inputStr.split(' ')) {
    const { char, num } = separateWord(word);
    if (!numbersByChar[char]) {
      numbersByChar[char] = [];
    }
    numbersByChar[char].push(num);
  }
  const numbersArr = getOrderedNumbers(numbersByChar);
  return getTotal(numbersArr);
}

function getTotal(numbersArr) {
  const fns = [
    (subtotal, num) => subtotal + num,
    (subtotal, num) => subtotal - num,
    (subtotal, num) => subtotal * num,
    (subtotal, num) => subtotal / num,
  ];
  // Remove first value so operation can start with + with first and second value:
  let subtotal = numbersArr.shift();
  numbersArr.forEach((num, i) => {
    subtotal = fns[i % 4](subtotal, num);
  });
  return Math.round(subtotal);
}

Unfortunately, the latest JS version that Codewars supports is Node 8, which is old, end-of-life, and probably shouldn't be used - it doesn't support Array.prototype.flat. An alternative to achieve the same functionality is to spread into concat instead:

arr.flat()

can be replaced by

[].concat(...arr);


Solving a practical problem involving square of root of a number

You don't usually need to import java.lang, as it is built in, but maybe this is a special case. Either way, It's best to only import the classes you need. Regardless, java.io, and java.util are unused.

Did you import java.io for exceptions? In general's, it's preferable to throw a specific Exception, this alone doesn't really say much. As it is I think it's entirely unnecessary, and wonder why you're throwing any exception in the first place.

You don't need to break when you reach the sum, your while loops condition is already checking if sum reaches 411.

411 is a magic number. Looking at the code alone in the future it would serve you to instantiate the value in a final field.

In java it's conventional for variables and methods to be camelCase, so as an example, in your code firstpage should be firstPage and squareofroot should be squareOfRoot. Additionally, class names are PascalCase, so your class ADG would be Adg (Though I'd pick a better class name), doesn't hurt to be as descriptive as possible. I'd wager if you stepped back for a few months and just saw a file named ADG you'd wonder what it is. Try to keep these standards in mind going forward, they will help keep your code readable not only to yourself but anyone else you present it to.

Lastly, you don't really answer the question. The challenge asks

  How many pages did she read on each day?`

Answering that would be trivial with your code, you actually went one further and found out different ways she could have finished the book using her method.

Suggested Implementation:

import java.util.Map;
import java.util.LinkedHashMap;

public class Test {
    public static void main(String[] args) {
        final int pageTotal = 411;
        final int daysRequired = 6;
        Map<Integer, Integer> pagesReadPerDay = new LinkedHashMap<>();

        for (int firstPage = 1; firstPage <= pageTotal; firstPage++) {
            int sum = firstPage;
            int day = 1;

            while (sum <= pageTotal) {
                sum += squareSumDigit(sum);
                day++;

                if (sum == pageTotal && day == daysRequired) {
                    int pagesRead = firstPage;
                    int currentPage = pagesRead;

                    for (int onDay = 1; onDay <= daysRequired; onDay++) {
                        pagesReadPerDay.put(onDay, pagesRead);
                        pagesRead = squareSumDigit(currentPage);
                        currentPage += pagesRead;
                    }
                }
            }
        }

        for (Map.Entry<Integer, Integer> entry : pagesReadPerDay.entrySet()){
            System.out.println(
                "Day: " + entry.getKey() +
                ", Pages Read: " + entry.getValue() + "."
            );
        }
    }

    public static int squareSumDigit(int num) {
        int sum = 0;

        while (num > 0) {
            sum += num % 10;
            num /= 10;
        }

        return sum * sum;
    }
}

Output:

  Day: 1, Pages Read: 61.
  Day: 2, Pages Read: 49.
  Day: 3, Pages Read: 4.
  Day: 4, Pages Read: 36.
  Day: 5, Pages Read: 36.
  Day: 6, Pages Read: 225.


How to create a 'tee' command in Ruby for a Unix like pipeline?

I know it's an old question, but it's an interesting one.

First, a couple small things:

In Pipe#run:

enum = method(command).call(enum, options)

Calling method has a lot of overhead, and send(command, enum, options) does the same thing.
Also in Pipe#run:

enum.each {}

The purpose of this is to cause the final object to be enumerated. We can do the same thing cheaper (even an empty block takes CPU cycles) with enum.to_a, which is also aliased as enum.force.

Those things aside, the first thing I noticed is that there's a lot of repetition. grep and upcase, for example, only differ on one line. We can extract the shared code out into another method, which I'll call enum_lazy:

def upcase(enum, options)
  enum_lazy(enum) do |line, yielder|
    yielder << line.upcase
  end
end

def grep(enum, options)
  enum_lazy(enum) do |line, yielder|
    yielder << line if line.match(options[:pattern])
  end
end

private
def enum_lazy(enum, &block)
  Enumerator.new do |yielder|
    enum.each do |line|
      yield(line, yielder)
    end
  end.lazy
end

...but this made me realize that some of these methods don't need the yielder pattern at all. For example, upcase takes one element at a time, performs an operation on it, and yields one value each time—it's just a lazy map, and this is equivalent:

def upcase(enum, options)
  enum.lazy.map(&:upcase)
end

Since we called lazy, this will return an Enumerator::Lazy as expected. We can simplify cut and out in the same way:

def out(enum, options)
  enum.lazy.map do |line|
    puts line
    line
  end
end

def cut(enum, options)
  enum.lazy.map do |line|
    fields = line.chomp.split(options[:delimiter])
    fields[ options[:field] ]
  end
end

grep is different, because we only don't want output for every input line. As it turns out, though, grep is just a lazy select:

def grep(enum, options)
  enum.lazy.select {|line| line =~ options[:pattern] }
end

That just leaves cat. I have a strong inkling that there's a similar optimization we could do for cat, but I haven't yet been able to actually figure it out. Perhaps someone else can help figure it out.

Here's the final code:

class Pipe
  class Tee
    # (no changes here)
  end

  attr_writer :source

  def initialize
    @commands = []
    @source = nil
  end

  def add(command, opts = {})
    @commands << [command, opts]
    self
  end

  def run
    enum = @source

    @commands.each do |command, options|
      enum = send(command, enum, options)
    end

    enum.force
    enum
  end

  def cat(enum, options)
    Enumerator.new do |yielder|
      enum.map { |line| yielder << line } if enum

      options[:input].tap do |ios|
        ios.each { |line| yielder << line }
      end
    end.lazy
  end

  def out(enum, options)
    enum.lazy.map do |line|
      puts line
      line
    end
  end

  def cut(enum, options)
    enum.lazy.map do |line|
      fields = line.chomp.split(/#{options[:delimiter]}/)
      fields[ options[:field] ]
    end
  end

  def upcase(enum, options)
    enum.lazy.map(&:upcase)
  end

  def tee(enum, options)
    teed = Tee.new(options.fetch(:other))

    enum_lazy(enum) do |line, yielder|
      yielder << line
      teed << line
    end
  end

  def grep(enum, options)
    enum.lazy.select {|line| line =~ options[:pattern] }
  end

  private
  def enum_lazy(enum, &block)
    Enumerator.new do |yielder|
      enum.each do |line|
        yield(line, yielder)
      end
    end.lazy
  end
end


PEP-8 Conventions

Top-level functions should be separated (preceded and followed) by two blank lines:

logger.setLevel(logging.INFO)

def l(*args, **kwargs):
     <body>

Don't mix single quotes ' and double quotes " in a single file (or project). You may you use either of them, but

  Pick a rule and stick to it.

Lines should not exceed 79 characters (or 73 characters for documentation).

General concerns

l is a bad name for a function. Always try to pick a name that describes what the function does, like log.
You haven't added any docstrings to your function. If anyone else wants to use your code, they have no way to know what parameters to pass (or what the function actually does). According to PEP-257,

  All modules should normally have docstrings, and all functions and classes exported by a module should also have docstrings.

A good docstring describes what your function does, what parameters it expects, what it returns and if applicable, what Exception it raises if something goes wrong.
assert should really only be used for debugging purposes, not in the 'stable' release. I propose raising a ValueError instead.
Since you're only retrieving the level argument from **kwargs, you may as well make it a keyword argument.

Improved code

Taking into account all of the above, here's my rewritten version of your code:

import logging
from inspect import getframeinfo, stack

logger = logging.getLogger()
formatter = logging.Formatter('
    %(asctime)s %(name)-7s %(levelname)-8s %(message)s
')
file_handler = logging.FileHandler('mm.log')
file_handler.setFormatter(formatter)
stream_handler = logging.StreamHandler()
stream_handler.setFormatter(formatter)
logger.addHandler(file_handler)
logger.addHandler(stream_handler)
logger.setLevel(logging.INFO)

def log(*args, level='info'):
    """Log a message to stdout and a log file.
    Arguments:
    - *args: All messages to be logged (as strings).

    - level: The level for debugging. Any of 'debug', 'info', 'warning',
             'error', 'critical'. Defaults to 'info'.

    Raises:
    - ValueError if an invalid `level` argument is passed.
    """
    LEVELS = ('debug', 'info', 'warning', 'error', 'critical')
    level = level.lower()
    if level not in LEVELS:
        raise ValueError('`level` argument must be any of {}'.format(
            str(LEVELS)[1:-1]
        )
    caller = getframeinfo(stack()[1][0])
    file_line = '%s:%d - ' % (caller.filename, caller.lineno)
    logger_input = file_line + ' '.join([str(a) for a in args])
    getattr(logger, level)(logger_input)

The use of *args in the above snippet breaks backward compatibility!


Two similar functions for writing data to binary file using BinaryWriter

Both methods are public so I would like to suggest doing proper argument validation up front which enables you to throw the correct exceptions and return early.
Use the var type if the right hand side of an assignment makes the type obvious.

For instance

var isDone = false;
var quitTime = DateTime.Now.AddMilliseconds(500);

instead of

bool isDone = false;
DateTime quitTime = DateTime.Now.AddMilliseconds(500);

use braces {} although they might be optional. This makes your code less error prone and the intent of the code is more clear.
Don't talk to Program but let Program pass any needed parts to your class and use it then. A child object should only talk to its parent by using events.
you should pass the 500 ms as a optional parameter to that method. This will make your code more flexible in case you need to adjust the timeout.
you should always try to code against interfaces rather than against concrete implementations. So either use IList<RollHeader> or better IEnumerable<RollHeader> as the passed in type of WriteHeadersToIndexer(). This enables you to pass for instance either an List<RollHeader> or RollHeader [] to that method. In fact each type which implements IEnumerable<T> will be good to pass.

From the comments of the question

  I am using different FileModes and Seek() because in the first case, I write single data object to existing file, in the second case, I create new file and write all data objects from List to this file.

Based on the above I would like to suggest adding another method which is called from the former 2 methods. This new method will have one method argument being a FileMode value like so

private void WriteToIndexer(string path, IEnumerable<RollHeader> headers, FileMode mode, double timeOutMs = 500d)
{
    if (path == null) { throw new ArgumentNullException($"{path}"); }
    if (headers == null) { throw new ArgumentNullException($"{headers}"); }
    if (string.IsNullOrWhiteSpace(path)) { throw new ArgumentException("Parameter may not be empty", $"{path}"); }

    if (!headers.Any()) { return; }

    bool isDone = false;
    bool error = false;

    DateTime quitTime = DateTime.Now.AddMilliseconds(timeOutMs);

    while (!isDone && DateTime.Now < quitTime)
    {
        try
        {

            using (var stream = File.Open(path, mode))
            using (var writer = new BinaryWriter(stream))
            {
                writer.Seek((int)writer.BaseStream.Length, new SeekOrigin());
                foreach (RollHeader header in headers)
                {
                    WriteSingleHeader(writer, header);
                }

                isDone = true;

                if (error)
                {
                    Program.logger.Write(LogLevel.Error, "Done after timeout.");
                }
            }

            SetReadRightToFileForEveryone(path);
        }
        catch (IOException ex)
        {
            if (!error)
            {
                Program.logger.Write(LogLevel.Error, ex.Message);
            }
            error = true;
        }
    }
}

this takes advantage of the string interpolation of C# 6.0.

No you can call this like so

public void AddHeaderToIndexer(string path, RollHeader header)
{
    WriteToIndexer(path, new RollHeader[] { header }, FileMode.OpenOrCreate);
}
public void WriteHeadersToIndexer(string path, IEnumerable<RollHeader> headers)
{
    WriteToIndexer(path, headers, FileMode.Create);
}


Is this a workable UnitOfWork with Repository pattern design?

The UoW pattern has a couple of properties. The UoW will:

track changes to entities, wether that be adding, removing or updating.
coordinate the persisting of these changes in one atomic action. Which also means rolling back if an error occurs.

Since you're using EF, you don't have to implement this stuff, it's done for you. The ObjectContext is actually the UoW object. So unless you plan to switch out Persistence frameworks later on, any additional abstraction will be wasted effort.

I'm guessing you want to make sure your domain isn't aware of how it's persisted. Your domain should only know of the repository interfaces. The repository interfaces are actually part of your domain. The repository implementation though, is part of the persistance layer.

The repository implementation looks OK. I'm only curious about FindByFilter; if you're returning an IQueryable<T> object, you're saying you can query it. OTOH the FindByFilter function already takes an Expression<Func<T, bool>> filter parameter. I'd pick one of the two like the following:

public IEnumerable<T> FindByFilter(Expression<Func<T, bool>> filter)
{
    //
}

or

public IQueryable<T> FindAll()
{
    //
}

Hope this helps.


Performance
(Without any profiling data, I'm guessing blindly here)
You have a linked data structure (a tree), traversing the tree has poor cache locality and this is where your performance will likely suffer. Because every node could be a cache miss at worst. But please do measure this first, if you see that most of your time is spent getting the next node or close to a line of code that does, you're having cache issues.
One thing you can do to try to improve your cache performance is to encode your tree into a linear sequence (std::vector preferrably). And then measure to see if it actually is faster.
As for the encoding, we'll refer to a level of the tree as k and the root has k=0. This means that the level k has at most 8^k nodes. If we refer to each node in a level by it's grid coordinate (x,y, z) then the node n(k,x,y,z) (at level k and position (x,y,z)) will have it's child nodes on:

n(k+1, 2*x, 2*y, 2*z)
... (all combinations of +1 to the x,y,z) ...
n(k+1, 2*x + 1, 2*y + 1, 2*z + 1)

We can order all the nodes into a linear random access sequence v (std::vector) like this:
level_base = ipow(8,k) - 1;
level_width = ipow(2,k);
grid_index = x + level_width * y + level_width*level_width*z;
n(k, x, y) = v[level_base + grid_index];

Note that the width of the grid at level k is 2^k (example: 1, 2, 4, 8). Here ipow is an optimized integer power function. If ipow proves to be a bottle neck, you can use a LUT for the powers of 8 and 2.
Benefits

The benefits to doing this is that Breadth First Traversal/Search becomes a linear access pattern which your CPU's pre-fetcher will love you for. This is very fast.
If you know before hand which node you want (k,x,y,z), you can get it directly.
You can get all the neighbours easily.
Given your (r,g,b) triplet, you may be able to just directly compute the index of the destination node, write the value and you're done. No iteration to the right node.
Less memory fragmentation.
For dense trees this actually takes less memory as you don't have the heap bookkeeping overhead etc.
You do not need the child[] array making your data structure smaller and more of them can fit in each cache line.

Drawbacks

The std::vector is dense, if your tree is very sparse, you may end up allocating a lot more nodes than you need. On the other hand, if you have the memory it might be acceptable.
It's a more complex indexing which can result in bugs or more complex code if proper caution isn't taken.
If you need to distinguish between empty and non-empty nodes (as opposed to having value == 0), you need to introduce a has_data flag. But the nodes are still smaller than having the child array.
Not as resilient against off-by-one type of bugs. In a linked-tree type structure if you manage to somehow write outside of the node's structure you'll write into the canary values on the heap or in the heap book-keeping. Under debug mode your RT should let you know you have an issue. With this approach you will silently corrupt nearby nodes. Not necessarily likely but something to be aware of.


Implementing hash table in Python using Tuples

Despite the code produce the desired output in your simple test case, your implementation is quite flawed.
a = hash_table(size)

insert_hash(a, 1, 'john')
insert_hash(a, 2, 'edward')
delete_hash(a, 1)
print_hash(a, 2)

Output:
Traceback (most recent call last):
  File "C:/Code Review/hash_table.py", line 53, in <module>
    print_hash(a, 2)
  File "C:/Code Review/hash_table.py", line 30, in print_hash
    while table[index][0] != key:      #in case there is a collision:
TypeError: 'NoneType' object is not subscriptable
>>>

The issue: table.pop(index) will move items after the one being delete forward by one position in the table.  Given that they are indexed by the hash values, this would mean that they can't be found anymore.
a = hash_table(size)

for _ in range(2000):
    insert_hash(a, 1, 'john')
    delete_hash(a, 1)

Output:
Traceback (most recent call last):
  File "C:/Code Review/hash_table.py", line 51, in <module>
    insert_hash(a, 1, 'john')
  File "C:/Code Review/hash_table.py", line 22, in insert_hash
    if table[index] == None:
IndexError: list index out of range
>>>

After each insert/delete, the table size has shrunk by one item.  After a thousand insert/deletes, the table can't hold any values!
a = hash_table(size)

insert_hash(a, 999, 'john')
insert_hash(a, 999, 'edward')

Output:
Traceback (most recent call last):
  File "C:/Code Review/hash_table.py", line 51, in <module>
    insert_hash(a, 999, 'edward')
  File "C:/Code Review/hash_table.py", line 25, in insert_hash
    collision_handler(table, index, item)
  File "C:/Code Review/hash_table.py", line 42, in collision_handler
    while table[index] != None:
IndexError: list index out of range
>>>

A collision at the last slot in the hash table doesn't have room to handle the collision, despite the table only having a 999 empty slots.  You need to use circular addressing.
You need to add more test cases, and rework the code to handle these issues.  I generated these issues quickly by exploiting the fact that hash(int) == int for sufficiently small integers, but they would arise using strings for keys as well.  It is just be harder to generate cases which deterministicly fail using string keys.


I think this looks pretty efficient.  Let me add a few more minor, detailed comments (more than 1 year after the question was asked; I hope they are still useful):

After you convert to a NumPy array, the keys are longer guaranteed to be unique (if someone re-uses your code in a different context, etc).  This will cause searchsorted to fail.  You might want to add a check such as:

assert len(self.data[:, 0]) == len(np.unique(self.data[:, 0])

to make sure users and readers of your code know that the first column of your array must be unique.
I agree that record arrays (aka structured arrays) would be better.  Your code would be more readable because instead of things like:

self.data[ix][1:]

you could write:

self.data[ix]['Float_1'], self.data[ix]['Float_2']

(but please use more descriptive names for your context than 'Float_1 etc.!)

Also, and more importantly: without using a structured array, your hash keys will be stored as floats instead of ints.  That will take extra memory, and make future calls to searchsorted and __eq slightly less efficient.
Your __contains__ method seems overly stringent to me, which would result in it being slower.  Do you need to call searcshorted in __contains__ at all?  Wouldn't something like this suffice and be more efficient?

def __contains__(self, key):
    hkey = hash(key)
    return np.in1d(self.data[:, 0], hkey).any()

You are duplicating the __contains__ check in your __getitem__ code.  I'd just say it this way:

if __contains__(self, key): return self.data[ix][1:]

Very minor, but the idiom is always import numpy as np.  It's probably best to use that so you can do np.searchsorted etc. instead of typing numpy.searchsorted as that's what most NumPy users do.


Python 3.6+ Conventions for fetching paginated data

You should let the requests module do the urlencoding for you. It can take a dictionary of parameters and do it right.

Instead of having a variable around which you check in your while condition, I would prefer a while True and an explicit break here. The loop is small enough that this makes it more readable IMO.

I would indeed use yield, or rather yield from here, in order to flatten the response. This means that the next page is only fetched when you have consumed the previous data. If you need to, you could also make it asynchronously using aiohttp, have a look at this question of mine which used it or the documentation I linked.

You can also use response.raise_for_status to raise an exception if the status code is not 2XX. Note that any code after a raise is not accessible, so your payload['has_more'] = False and return will never run (unless you run it in a debugger or something).

Python has an official style-guide, PEP8, which you are following (nice!). One thing it does not recommend but I would nevertheless encourage you to do is not using unnecessary parenthesis in if statements. Python is not C.

def fetch_paginated_data(url, query, timeout=0):
    params = {"q": query}
    while True:
        response = requests.get(url, params=params)
        response.raise_for_status()
        data = response.json()
        if data and data['data']:
            yield from data['data']
        if not data['has_more']:
            break
        url = data['next_page']
        time.sleep(timeout)

Here I left the interface as is. If you are free to change it, I would consider taking params directly as an argument or even collect all keyword arguments (except for the timeout, which I also gave a defualt value) directly into a dictionary with **params. The latter would give you the very nice interface:

data = fetch_paginated_data("example.com", q="FooBar", timeout=3)

Instead of if data and data['data']: you could also just use a try..except block. This will be slightly more performant if the response usually has this key:

try:
    yield from data['data']
except (KeyError, TypeError):  # for dict, list
    pass

You should definitely add a docstring describing what this function does. Especially your naming the timeout a rate can be confusing for other people reading your code, or yourself in half a year.


Dynamic social media component w/ dark mode

consider using The strict equality operator (===) over the abstract equality operator (==) , see == VS ===

avoid nested if blocks using optional chaining , it can get pretty messy if you have a lot of nested properties, it's a relatively new feature but you can always use a babel plugin.

consider a different aproach to styling ( i recommend styled-components ), adding styles like that would affect other components on the same page.

since the images urls' are hardcoded , use an object to toggle dark mode

keep your code DRY , you can use an Array of social media names and loop through it to display the icons

for counting the props , you could use Object.keys or if you have other props to pass along the social media icons, use Array.filter to check how many are there and grab the resulting array's length

snippet of the end result :
import styeld from "styled-components";

const Wrapper = styled.div`
  .social {
    display: flex;
    flex-wrap: wrap;
    align-content: center;
    justify-content: center;
  }

  .social img {
    max-height: 25px;
    margin: 0 15px;
  }
`;

const icons = {
  darkMode: {
    facebook: "facebook_white",
    twitter: "twitter_white",
    instagram: "instagram_white"
  },

  lightMode: {
    facebook: "facebook",
    twitter: "twitter",
    instagram: "instagram"
  }
}

const options = ["facebook", "twitter", "imstagram"];

const Social = props => {
  // check for dark mode
  const mode = props.dark ? "darkMode" : "lightMode";

  // count social media icons
  const count = option.filter(option => props[option]?.url ? true : false).length();

  return (
    <Wrapper>

        {/* show the text if there's at least one social media is supplied */}
        {count > 1 ? Follow us on: : ``}

        {
          // loop through the social media array to display the ones available in props
          options.map(option => props[option]?.url
            ?
               <img src={`./assets/social/${icons[mode].facebook}.svg`} alt={option} />

           : null)
        }

    </Wrapper>

  )
};

export default Social;