NetLogo is available for Windows, Mac, and Linux machines, downloadable from the project homepage.
Windows Installer:
NetLogo runs on Windows 10, Windows 8, Windows 7 and Vista. NetLogo 5.2.1 was the last version to support Windows XP and Windows 2000.
Mac:
Mac OS X 10.8.3 or newer is requ...
When writing a copy assignment operator, it is very important that it be able to work in the event of self-assignment. That is, it has to allow this:
SomeType t = ...;
t = t;
Self-assignment usually doesn't happen in such an obvious way. It typically happens via a circuitous route through vario...
The InputRange concept has three functions, example:
struct InputRange(T) {
@property bool empty();
@property T front();
void popFront();
}
In short, a way to
check if the range is empty
get the current element
move to the next element
To make our own type a InputRange, w...
A data race or race condition is a problem that can occur when a multithreaded program is not properly synchronized. If two or more threads access the same memory without synchronization, and at least one of the accesses is a 'write' operation, a data race occurs. This leads to platform dependent, p...
To create a build target producing an executable, one should use the add_executable command:
add_executable(my_exe
main.cpp
utilities.cpp)
This creates a build target, e.g. make my_exe for GNU make, with the appropriate invocations of the configured compiler to pr...
To create an build target that creates an library, use the add_library command:
add_library(my_lib lib.cpp)
The CMake variable BUILD_SHARED_LIBS controls whenever to build an static (OFF) or an shared (ON) library, using for example cmake .. -DBUILD_SHARED_LIBS=ON. However, you can explicitly se...
In this example will render five <li> tags
<ul id="render-sample">
<li v-for="n in 5">
Hello Loop
</li>
</ul>
(Readonly variable: Memorizes its first data item and passes out copies of it as its output. Ignores all other data items)
If BufferBlock is the most fundamental block in TPL Dataflow, WriteOnceBlock is the simplest.
It stores at most one value, and once that value has been set, it will never be r...
(Collects a certain number of total items from 2-3 inputs and groups them into a Tuple of collections of data items)
BatchedJoinBlock<T1, T2,…> is in a sense a combination of BatchBlock and JoinBlock<T1, T2,…>.
Whereas JoinBlock<T1, T2,…> is used to aggregate one input from each ...
(FIFO Queue: The data that comes in is the data that goes out)
In short, BufferBlock provides an unbounded or bounded buffer for storing instances of T.
You can “post” instances of T to the block, which cause the data being posted to be stored in a first-in-first-out (FIFO) order by the block.
Yo...
Dim sites() As String = {"Stack Overflow", "Super User", "Ask Ubuntu", "Hardware Recommendations"}
Dim query = From x In sites Where x.StartsWith("S")
' result = "Stack Overflow", "Super User"
Query will be enumerable objec...
Dim sites() As String = {"Stack Overflow",
"Super User",
"Ask Ubuntu",
"Hardware Recommendations"}
Dim query = From x In sites Select x.Length
' result = 14, 10, 10, 24
Query...
Dim sites() As String = {"Stack Overflow",
"Super User",
"Ask Ubuntu",
"Hardware Recommendations"}
Dim query = From x In sites
Order By x.Length
' result = &qu...
ListView - A core component designed for efficient display of vertically scrolling lists of changing data. The minimal API is to create a ListView.DataSource, populate it with a simple array of data blobs, and instantiate a ListView component with that data source and a renderRow callback which take...
Public Function GetUserFirstName(UserName As String) As String
Dim Firstname As String = ""
'Specify the SQL that you want to use including a Parameter
Dim SQL As String = "select firstname from users where username=@UserName"
'Provide a Data Sourc...
A stream is an object that provides a low-level means to transfer data. They themselves do not act as data containers.
The data that we deal with is in form of byte array(byte []). The functions for reading and writing are all byte orientated, e.g. WriteByte().
There are no functions for dealing w...
Java and most other languages store negative integral numbers in a representation called 2's complement notation.
For a unique binary representation of a data type using n bits, values are encoded like this:
The least significant n-1 bits store a positive integral number x in integral representati...
Variables are SHADOWED and methods are OVERRIDDEN.
Which variable will be used depends on the class that the variable is declared of.
Which method will be used depends on the actual class of the object that is referenced by the variable.
class Car {
public int gearRatio = 8;
public St...
Casting an instance of a base class to a subclass as in : b = (B) a; is called narrowing (as you are trying to narrow the base class object to a more specific class object) and needs an explicit type-cast.
Casting an instance of a subclass to a base class as in: A a = b; is called widening and does...