For anything below 1.9
SpawnEgg egg = new SpawnEgg(EntityType.CREEPER);
ItemStack creeperEgg = egg.toItemStack(5);
For 1.9 and above
In versions 1.9 and higher, Spigot does not have an implementation for creating spawn eggs without using NMS. To accomplish this, you can use a small custom cl...
class Functor f where
fmap :: (a -> b) -> f a -> f b
One way of looking at it is that fmap lifts a function of values into a function of values in a context f.
A correct instance of Functor should satisfy the functor laws, though these are not enforced by the compiler:
fmap id = i...
The Data.Functor module contains two combinators, <$ and $>, which ignore all of the values contained in a functor, replacing them all with a single constant value.
infixl 4 <$, $>
<$ :: Functor f => a -> f b -> f a
(<$) = fmap . const
$> :: Functor f => f a ...
If you installed Node using the default directory, while in the global mode, NPM installs packages into /usr/local/lib/node_modules. If you type the following in the shell, NPM will search for, download, and install the latest version of the package named sax inside the directory /usr/local/lib/node...
When we refer the module in the code, node first looks up the node_module folder inside the referenced folder in required statement
If the module name is not relative and is not a core module, Node will try to find it inside the node_modules folder in the current directory.
For instance, if you do...
Steps to create "Hello, World!" application in Oracle Application Express:
Log in to your workspace.
Click Application Builder. Application Builder page opens.
Click Create. Page with 4 application types appears. Page contains short help text about each application type.
Click Deskto...
Introduction
System Workbench for STM32 is a free IDE on Windows, Linux and OS X. Description from ST Microelectronics:
The System Workbench toolchain, called SW4STM32, is a free multi-OS
software development environment based on Eclipse, which supports the
full range of STM32 microcontrollers...
Introduction
IAR Integrated development environment and optimizing C/C++ compiler for ARM Cortex-M.
Description from ST Microelectronics:
The IAR-EWARM is a software development suite delivered with
ready-made device configuration files, flash loaders and 4300 example
projects included. IAR E...
Introduction
C/C++ IDE for ARM development.
Atollic TrueSTUDIO® is tested and verified on the following Operating Systems:
Microsoft® Windows ®Vista (32-bit version)
Microsoft® Windows® Vista (64-bit version)
Microsoft® Windows® 7 (32-bit version)
Microsoft® Windows® 7 (64-bit version)
Micr...
Introduction
CooCox CoIDE, a free and highly-integrated software development environment for ARM Cortex MCUs. Description from ST Microelectronics:
CoIDE is a free software development environment based on Eclipse and
GCC tool chain, which has been customized and simplified to give users
an ea...
Some of the queryFor* methods available in JdbcTemplate are useful for simple sql statements that perform CRUD operations.
Querying for Date
String sql = "SELECT create_date FROM customer WHERE customer_id = ?";
int storeId = jdbcTemplate.queryForObject(sql, java.util.Date.class, custom...
This is a simple RMI example with five Java classes and two packages, server and client.
Server Package
PersonListInterface.java
public interface PersonListInterface extends Remote
{
/**
* This interface is used by both client and server
* @return List of Persons
* @throws...
Lists as arguments are just another variable:
def func(myList):
for item in myList:
print(item)
and can be passed in the function call itself:
func([1,2,3,5,7])
1
2
3
5
7
Or as a variable:
aList = ['a','b','c','d']
func(aList)
a
b
c
d
/in {72 mul} def
/delta {1 in 10 div} def
/X 612 def
/Y 792 def
0 delta Y {
0 1 index X exch % i 0 X i
moveto exch % 0 i
lineto
stroke
} for
0 delta X {
0 1 index Y % i 0 i Y
moveto % i 0
lineto
stroke
} for
showpage
Tkinter has three mechanisms for geometry management: place, pack, and grid.
The place manager uses absolute pixel coordinates.
The pack manager places widgets into one of 4 sides. New widgets are placed next to existing widgets.
The grid manager places widgets into a grid similar to a dynamicall...
In addition to libraries defined in EcmaScript language specification and EcmaScript internationalization API specification, d8 also implements the following functions and objects.
print(args...): function. Print to stdout.
printErr(args...): function. Print to stderr.
write(args...): function....