IOException: The process cannot access the file ‘file path’ because it is being used by another process

What is the cause? The error message is pretty clear: you’re trying to access a file, and it’s not accessible because another process (or even the same process) is doing something with it (and it didn’t allow any sharing). Debugging It may be pretty easy to solve (or pretty hard to understand), depending on your … Read more

What is ADT? (Abstract Data Type)

The Abstact data type Wikipedia article has a lot to say. In computer science, an abstract data type (ADT) is a mathematical model for a certain class of data structures that have similar behavior; or for certain data types of one or more programming languages that have similar semantics. An abstract data type is defined indirectly, only … Read more

What’s the difference between passing by reference vs. passing by value?

First and foremost, the “pass by value vs. pass by reference” distinction as defined in the CS theory is now obsolete because the technique originally defined as “pass by reference” has since fallen out of favor and is seldom used now.1 Newer languages2 tend to use a different (but similar) pair of techniques to achieve the same effects (see below) which … Read more

What and where are the stack and heap?

The stack is the memory set aside as scratch space for a thread of execution. When a function is called, a block is reserved on the top of the stack for local variables and some bookkeeping data. When that function returns, the block becomes unused and can be used the next time a function is … Read more

What is dependency injection?

Dependency Injection is passing dependency to other objects or framework( dependency injector). Dependency injection makes testing easier. The injection can be done through constructor. SomeClass() has its constructor as following: Problem: If myObject involves complex tasks such as disk access or network access, it is hard to do unit test on SomeClass(). Programmers have to … Read more

What is an ORM, how does it work, and how should I use one? [closed]

Introduction Object-Relational Mapping (ORM) is a technique that lets you query and manipulate data from a database using an object-oriented paradigm. When talking about ORM, most people are referring to a library that implements the Object-Relational Mapping technique, hence the phrase “an ORM”. An ORM library is a completely ordinary library written in your language … Read more