Why is a static method considered a method?

This quote from 8.4.3.2 may help: A method that is declared static is called a class method. A method that is not declared static is called an instance method […]. Class methods: associated with a class. Instance methods: associated with an instance. Java just wants you to “think object-oriented”. Also, static methods have access to … Read more

Any difference between First Class Function and High Order Function

There is a difference. When you say that a language has first-class functions, it means that the language treats functions as values – that you can assign a function into a variable, pass it around etc. Higher-order functions are functions that work on other functions, meaning that they take one or more functions as an … Read more

What is the difference between the kernel space and the user space?

The really simplified answer is that the kernel runs in kernel space, and normal programs run in user space. User space is basically a form of sand-boxing — it restricts user programs so they can’t mess with memory (and other resources) owned by other programs or by the OS kernel. This limits (but usually doesn’t … Read more

What is a coroutine?

Coroutines and concurrency are largely orthogonal. Coroutines are a general control structure whereby flow control is cooperatively passed between two different routines without returning. The ‘yield’ statement in Python is a good example. It creates a coroutine. When the ‘yield ‘ is encountered the current state of the function is saved and control is returned … Read more

Is Javascript a Functional Programming Language?

Repeating my own answer to a similar question, There’s no accepted definition of functional programming language. If you define functional language as the language that supports first class functions and lambdas, then yes, JavaScript *is* a functional language. If you also consider the factors like support for immutability, algebraic data types, pattern matching, partial application … Read more

What is ‘Pattern Matching’ in functional languages?

Understanding pattern matching requires explaining three parts: Algebraic data types. What pattern matching is Why its awesome. Algebraic data types in a nutshell ML-like functional languages allow you define simple data types called “disjoint unions” or “algebraic data types”. These data structures are simple containers, and can be recursively defined. For example: type ‘a list … Read more

What is the difference between a web API and a web service?

A web service typically offers a WSDL from which you can create client stubs automatically. Web Services are based on the SOAP protocol. ASP.NET Web API is a newer Microsoft framework which helps you to build REST based interfaces. The response can be either JSON or XML, but there is no way to generate clients … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)