public class CarpetExpression
extends java.lang.Object
scarpet
language add-ons and commandsHere is the gist of the Minecraft related functions. Otherwise the CarpetScript could live without Minecraft.
One note, which is important is that most of the calls for entities and blocks
would refer to the current dimension of the caller, meaning, that if we for example
list all the players using player('all')
function, if a player is in the
other dimension, calls to entities and blocks around that player would point incorrectly.
Moreover, running commandblocks in the spawn chunks would mean that commands will always
refer to the overworld blocks and entities.
In case you would want to run commands across all dimensions, just run three of them, using
/execute in overworld/the_nether/the_end run script run ...
and query
players using player('*')
, which only returns players in current dimension.
| Constructor and Description |
|---|
CarpetExpression(java.lang.String expression,
net.minecraft.server.command.ServerCommandSource source,
net.minecraft.util.math.BlockPos origin)
.
|
| Modifier and Type | Method and Description |
|---|---|
void |
API_AuxiliaryAspects()
Auxiliary aspects
|
void |
API_BlockManipulation()
Blocks / World API
|
void |
API_EntityManipulation()
Entity API
|
void |
API_InventoryManipulation()
Inventory and Items API
|
void |
API_IteratingOverAreasOfBlocks()
Iterating over larger areas of blocks
|
void |
BreakExecutionOfAllScriptsWithCommands(boolean doStop)
script stop/script resume command |
boolean |
fillAndScanCommand(carpet.script.ScriptHost host,
int x,
int y,
int z)
/script scan , /script fill and /script outline commands |
void |
gameEventsSystem()
Scarpet events system
|
void |
invokeGlobalFunctionCommand()
/script invoke / invokepoint / invokearea , /script globals commands |
void |
loadScriptsFromFilesCommand()
/script load / unload <module> (shared?) , /script in <module> commands |
java.lang.String |
scriptRunCommand(carpet.script.ScriptHost host,
net.minecraft.util.math.BlockPos pos)
/script run command |
public CarpetExpression(java.lang.String expression, net.minecraft.server.command.ServerCommandSource source, net.minecraft.util.math.BlockPos origin)
expression
- expressionsource
- sourceorigin
- originpublic void API_AuxiliaryAspects()
Collection of other methods that control smaller, yet still important aspects of the game
sound(name, pos, volume?, pitch?)
Plays a specific sound name
, at block or position pos
, with optional
volume
and modified pitch
. pos
can be either a block, triple of coords,
or a list of thee numbers. Uses the same options as a corresponding playsound
command.
particle(name, pos, count?. spread?, speed?, playername?)
Renders a cloud of particles name
centered around pos
position, by default
count
10 of them, default speed
of 0, and to all players nearby, but these
options can be changed via optional arguments. Follow vanilla /particle
command on details on those
options. Valid particle names are for example
'angry_villager', 'item diamond', 'block stone', 'dust 0.8 0.1 0.1 4'
particle_line(name, pos, pos2, density?)
Renders a line of particles from point pos
to pos2
with supplied density (defaults 1),
which indicates how far part you would want particles to appear, so 0.1
means one every 10cm.
particle_rect(name, pos, pos2, density?)
Renders a cuboid of particles between point pos
to pos2
with supplied density.
create_marker(text, pos, rotation?, block?)
Spawns a (permanent) marker entity with text or block at position. Returns that entity for further manipulations
remove_all_markers()
Removes all scarpet markers from the loaded portion of the world in case you didn't want to do the cleanup
nbt(expr)
Treats the argument as a nbt serializable string and returns its nbt value. In case nbt is not in a correct nbt compound tag format, the execution of a script will stop with an error, whenever that tag is used.
print(expr)
Displays the result of the expression to the chat. Overrides default scarpet
behaviour of
sending everyting to stderr.
run(expr)
Runs a command from the string result of the expr
expression, and returns its success count
save()
Performs autosave, saves all chunks, player data, etc. Useful for programs where autosave is disabled due to performance reasons and saves the world only on demand.
tick_time()
Returns game tick counter. Can be used to run certain operations every n-th ticks, or to count in-game time
game_tick(mstime?)
Causes game to run for one tick. By default runs it and returns control to the program, but can optionally
accept expected tick length, in milliseconds. You can't use it to permanently change the game speed, but
setting longer commands with custom tick speeds can be interrupted via /script stop
command
loop(1000,tick()) // runs the game as fast as it can for 1000 ticks loop(1000,tick(100)) // runs the game twice as slow for 1000 ticks
current_dimension()
Returns current dimension that scripts run in.
schedule(delay, function, args...)
Schedules a user defined function to run with a specified delay
ticks of delay.
Scheduled functions run at the end of the tick, and they will run in order they were scheduled.
plop(pos, what)
Plops a structure or a feature at a given pos
, so block, triple position coordinates
or a list of coordinates. To what
gets plopped and exactly where it often depends on the
feature or structure itself. For example, all structures are chunk aligned, and often span multiple chunks.
Repeated calls to plop a structure in the same chunk would result either in the same strucuture generated on
top of each other, or with different state, but same position. Most
structures generate at specific altitudes, which are hardcoded, or with certain blocks around them. API will cancel
all extra position / biome / random requirements for structure / feature placement, but some hardcoded limitations
may still cause some of strucutures/features not to place.
All generated structures will retain their properties, like mob spawning, however in many cases the world / dimension itself has certain rules to spawn mobs, like plopping a nether fortress in the overworld will not spawn nether mobs because nether mobs can spawn only in the nether, but plopped in the nether - will behave like a valid nether fortress.
plop
will not use world random number generator to generate structures and features, but its own.
This has a benefit that they will generate properly randomly, not the same time every time
Structure list:
monument
: Ocean Monument. Generates at fixed Y coordinate, surrounds itself with water.fortress
: Nether Fortress. Altitude varies, but its bounded by the code.mansion
: Woodland Mansionjungle_temple
: Jungle Templedesert_temple
: Desert Temple. Generates at fixed Y altitude.end_city
: End City with Shulkersigloo
: Iglooshipwreck
: Shipwreck, version1?shipwreck2
: Shipwreck, version2?witchhut
oceanruin, oceanruin_small, oceanruin_tall
: Stone variants of ocean ruins.oceanruin_warm, oceanruin_warm_small, oceanruin_warm_tall
: Sandstone variants of ocean ruins.treasure
: A treasure chest.  Require snow block below to place.glowstone
: glowstone cluster. Required netherrack above it.melon
: a patch of melonspumpkin
: a patch of pumpkinssugarcane
lilypad
dungeon
: Dungeon. These are hard to place, and fail often.iceberg
: Iceberg. Generate at sea level.iceberg_blue
: Blue ice iceberg.lake
lava_lake
end_island
chorus
: Chorus plant. Require endstone to place.sea_grass
: a patch of sea grass. Require water.sea_grass_river
: a variant.kelp
coral_tree, coral_mushroom, coral_claw
: various coral types, random color.coral
: random coral structure. Require water to spawn.sea_pickle
boulder
: A rocky, mossy formation from a giant taiga biome. Doesn't update client properly,
needs relogging.public void API_BlockManipulation()
block(x, y, z), block(state)
Returns either a block from specified location, or block with a specific state
(as used by /setblock
command), so allowing for block properties, block entity data etc.
Blocks otherwise can be referenced everywhere by its simple string name, but its only used in its default state
block('air') => air block('iron_trapdoor[half=top]') => iron_trapdoor block(0,0,0) == block('bedrock') => 1 block('hopper[facing=north]{Items:[{Slot:1b,id:"minecraft:slime_ball",Count:16b}]}') => hopper
All the functions below can be used with block value, queried with coord triple, or 3-long list.
All pos
in the functions referenced below refer to either method of passing block position
set(pos, block, property?, value?, ...)
First part of the set
function is either a coord triple, list of three numbers, or other block
with coordinates. Second part, block
is either block value as a result of block()
function
string value indicating the block name, and optional property - value
pairs for extra block properties.
If block
is specified only by name, then if a destination block is the same the set
operation
is skipped, otherwise is executed, for other potential extra properties
The returned value is either the block state that has been set, or false
if block setting was skipped
set(0,5,0,'bedrock') => bedrock set(l(0,5,0), 'bedrock') => bedrock set(block(0,5,0), 'bedrock') => bedrock scan(0,5,0,0,0,0,set(_,'bedrock')) => 1 set(pos(players()), 'bedrock') => bedrock set(0,0,0,'bedrock') => 0 // or 1 in overworlds generated in 1.8 and before scan(0,100,0,20,20,20,set(_,'glass')) // filling the area with glass scan(0,100,0,20,20,20,set(_,block('glass'))) // little bit faster due to internal caching of block state selectors b = block('glass'); scan(0,100,0,20,20,20,set(_,b)) // yet another option, skips all parsing set(x,y,z,'iron_trapdoor') // sets bottom iron trapdoor set(x,y,z,'iron_trapdoor[half=top]') // Incorrect. sets bottom iron trapdoor - no parsing of properties set(x,y,z,'iron_trapdoor','half','top') // correct - top trapdoor set(x,y,z,block('iron_trapdoor[half=top]')) // also correct, block() provides extra parsing set(x,y,z,'hopper[facing=north]{Items:[{Slot:1b,id:"minecraft:slime_ball",Count:16b}]}') // extra block data
place_item(item, pos, facing?, sneak?)
Places a given item in the world like it was placed by a player. Item names are default minecraft item name, less the minecraft prefix. Default facing is 'up', but there are other options: 'down', 'north', 'east', 'south', 'west', but also there are other secondary directions important for placement of blocks like stairs, doors, etc. Try experiment with options like 'north-up' which is placed facing north with cursor pointing to the upper part of the block, or 'up-north', which means a block placed facing up (player looking down) and placed smidge away of the block center towards north. Optional sneak is a boolean indicating if a player would be sneaking while placing the block - this option only affects placement of chests and scaffolding at the moment. Returns true if placement was successful, false otherwise.
place_item('stone',x,y,z) // places a stone block on x,y,z block place_item('piston,x,y,z,'down') // places a piston facing down place_item('carrot',x,y,z) // attempts to plant a carrot plant. Returns true if could place carrots at that position.
set_biome(pos, biome_name)
changes biome at that block position.
update(pos)
Causes a block update at position.
block_tick(pos)
Causes a block to tick at position.
random_tick(pos)
Causes a random tick at position.
destroy(pos), destroy(pos, -1), destroy(pos, <N>)
Destroys the block like it was mined by a player. Add -1 for silk touch, and positive number for fortune level. This function, unlike harvest, will affect all kinds of blocks
harvest(player, pos)
Causes a block to be harvested by a specified player entity. Honors player item enchantments, as well as damages the tool if applicable. If the entity is not a valid player, no block gets destroyed. If a player is not allowed to break that block, a block doesn't get destroyed either.
pos(block), pos(entity)
Returns a triple of coordinates of a specified block or entity. Technically entities are queried with
query
function and the same can be achieved with query(entity,'pos')
, but for simplicity
pos
allows to pass all positional objects.
pos(block(0,5,0)) => l(0,5,0) pos(players()) => l(12.3, 45.6, 32.05) pos(block('stone')) => Error: Cannot fetch position of an unrealized block
block_properties(pos)
Returns a list of available block properties for a particular block. If a block has no properties, returns an empty list.
property(pos, name)
Returns property of block at pos
, or specified by block
argument. If a block doesn't
have that property, null
value is returned. Returned values are always strings. It is expected from
the user to know what to expect and convert values to numbers using number()
function or booleans
using bool()
function.
set(x,y,z,'iron_trapdoor','half','top'); property(x,y,z,'half') => top set(x,y,z,'air'); property(x,y,z,'half') => null property(block('iron_trapdoor[half=top]'),'half') => top property(block('iron_trapdoor[half=top]'),'powered') => false bool(property(block('iron_trapdoor[half=top]'),'powered')) => 0
block_data(pos)
Return NBT string associated with specific location, or null if the block does not carry block data. Can be currently used to match specific information from it, or use it to copy to another block
block_data(x,y,z) => '{TransferCooldown:0,x:450,y:68, ... }'
solid(pos)
Boolean function, true if the block is solid
air(pos)
Boolean function, true if a block is air.... or cave air... or void air.... or any other air they come up with.
liquid(pos)
Boolean function, true if the block is liquid, or liquidlogged
flammable(pos)
Boolean function, true if the block is flammable
transparent(pos)
Boolean function, true if the block is transparent
opacity(pos)
Numeric, returning opacity level of a block
blocks_daylight(pos)
Boolean function, true if the block blocks daylight
emitted_light(pos)
Numeric, returning light level emitted from block
light(pos)
Integer function, returning total light level at position
block_light(pos)
Integer function, returning block light at position. From torches and other light sources.
sky_light(pos)
Numeric function, returning sky light at position. From the sky access.
see_sky(pos)
Boolean function, returning true if the block can see sky.
hardness(pos)
Numeric function, indicating hardness of a block.
blast_resistance(pos)
Numeric function, indicating blast_resistance of a block.
top(type, pos)
Returns the Y value of the topmost block at given x, z coords (y value of a block is not important), according to the
heightmap specified by type
. Valid options are:
light
: topmost light blocking block (1.13 only)motion
: topmost motion blocking blockterrain
: topmost motion blocking block except leavesocean_floor
: topmost non-water blocksurface
: topmost surface blocktop('motion', x, y, z) => 63 top('ocean_floor', x, y, z) => 41
loaded(pos)
Boolean function, true if the block is loaded. Normally scarpet
doesn't check if operates on
loaded area - the game will automatically load missing blocks. We see this as advantage.
Vanilla fill/clone
commands only check the specified corners for loadness.
loaded(pos(players())) => 1 loaded(100000,100,1000000) => 0
loaded_ep(pos)
Boolean function, true if the block is loaded and entity processing, as per 1.13.2
suffocates(pos)
Boolean function, true if the block causes suffocation.
power(pos)
Numeric function, returning redstone power level at position.
ticks_randomly(pos)
Boolean function, true if the block ticks randomly.
blocks_movement(pos)
Boolean function, true if block at position blocks movement.
block_sound(pos)
Returns the name of sound type made by the block at position. One of:
wood
gravel
grass
stone
metal
glass
wool
sand
snow
ladder
anvil
slime
sea_grass
coral
material(pos)
Returns the name of material of the block at position. very useful to target a group of blocks. One of:
air
void
portal
carpet
plant
water_plant
vine
sea_grass
water
bubble_column
lava
snow_layer
fire
redstone_bits
cobweb
redstone_lamp
clay
dirt
grass
packed_ice
sand
sponge
wood
wool
tnt
leaves
glass
ice
cactus
stone
iron
snow
anvil
barrier
piston
coral
gourd
dragon_egg
cake
map_colour(pos)
Returns the map colour of a block at position. One of:
air
grass
sand
wool
tnt
ice
iron
foliage
snow
clay
dirt
stone
water
wood
quartz
adobe
magenta
light_blue
yellow
lime
pink
gray
light_gray
cyan
purple
blue
brown
green
red
black
gold
diamond
lapis
emerald
obsidian
netherrack
white_terracotta
orange_terracotta
magenta_terracotta
light_blue_terracotta
yellow_terracotta
lime_terracotta
pink_terracotta
gray_terracotta
light_gray_terracotta
cyan_terracotta
purple_terracotta
blue_terracotta
brown_terracotta
green_terracotta
red_terracotta
black_terracotta
public void API_EntityManipulation()
Entities have to be fetched before using them. Entities can also change their state between calls to the script
if game happens either in between separate calls to the programs, or if the program calls game_tick
on its own. In this case - entities would need to be re-fetched, or the code should account for entities getting dead
player(), player(type), player(name)
With no arguments, it returns the calling player or the player closest to the caller. Note that the main context
will receive p
variable pointing to this player. With type
or name
specified
it will try first to match a type, returning a list of players matching a type, and if this fails, will assume its
player name query retuning player with that name, or null
if no player was found.
With 'all'
, list of all players in the game, in all dimensions, so end user needs to be cautious, that
you might be referring to wrong blocks and entities around the player in question.
WIth type = '*'
it returns all players in caller dimension, 'survival'
returns all survival
and adventure players, 'creative'
returns all creative players, 'spectating'
returns all spectating
players, and '!spectating'
, all not-spectating players. If all fails,
with name
, the player in question, if is logged in.
entity_id(uuid), entity_id(id)
Fetching entities wither by their ID obtained via entity ~ 'id'
, which is unique
for a dimension and current world run, or by UUID, obtained via entity ~ 'uuid'
.
It returns null if no such entity
is found. Safer way to 'store' entities between calls, as missing entities will be returning null
.
Both calls using UUID or numerical ID are O(1)
, but obviously using UUIDs takes more memory and compute.
entity_list(type)
Returns global lists of entities in the current dimension of a specified type. Currently the following selectors are available:
*
: allliving
items
players
!players
entity_area(type, cx, cy, cz, dx, dy, dz)
Returns entities of a specified type in an area centered on cx, cy, cz
and
at most dx, dy, dz
blocks away from the center point. Uses same selectors as entities_list
entity_selector(selector)
Returns entities satisfying given vanilla entity selector. Most complex among all the methods of selecting entities, but the most capable. Selectors are cached so should be as fast as other methods of selecting entities.
spawn(name, pos, nbt?)
Spawns and places an entity in world, like /summon
vanilla command.
Requires a position to spawn, and optional extra nbt data to merge with the entity. What makes it different from calling
run('summon ...')
, is the fact that you get the entity back as a return value, which is swell.
Unlike with blocks, that use plethora of vastly different querying functions, entities are queried with
query
function and altered via modify
function. Type of information needed or
values to be modified are different for each call
Using ~
(in) operator is an alias for query
. Especially useful if a statement has
no arguments, which in this case can be radically simplified
query(p, 'name') <=> p ~ 'name' // much shorter and cleaner query(p, 'holds', 'offhand') <=> p ~ l('holds', 'offhand') // not really but can be done
query(e,'removed')
Boolean. True if the entity is removed
query(e,'id')
Returns numerical id of the entity. Most efficient way to keep track of entites in a script. Ids are only unique within current game session (ids are not preserved between restarts), and dimension (each dimension has its own ids which can overlap.
query(e,'uuid')
Returns UUID (unique id) of the entity. Can be used to access entities with the other vanilla commands and remains unique regardless of the dimension, and is preserved between game restarts. Apparently players cannot be accessed via UUID, but name instead.
map(entities_area('*',x,y,z,30,30,30),run('kill '+query(_,'id'))) // doesn't kill the player
query(e,'pos')
Triple of entity position
query(e,'location')
Quin-tuple of entity position (x, y, and z coords), and rotation (yaw, pitch)
query(e,'x'), query(e,'y'), query(e,'z')
Respective entity coordinate
query(e,'pitch'), query(e,'yaw')
Pitch and Yaw or where entity is looking.
query(e,'look')
Returns a 3d vector where the entity is looking.
query(e,'motion')
Triple of entity motion vector, l(motion_x, motion_y, motion_z)
query(e,'motion_x'), query(e,'motion_y'), query(e,'motion_z')
Respective component of the motion vector
query(e,'name'), query(e,'custom_name'), query(e,'type')
String of entity name
query(e,'name') => Leatherworker query(e,'custom_name') => null query(e,'type') => villager
query(e,'is_riding')
Boolean. True if riding another entity.
query(e,'is_ridden')
Boolean. True if another entity is riding it.
query(e,'passengers')
List of entities riding the entity.
query(e,'mount')
Entity that e
rides.
query(e,'tags')
List of entity tags.
query(e,'has_tags',tag)
Boolean, True if the entity is marked with tag
.
query(e,'is_burning')
Boolean, True if the entity is burning.
query(e,'fire')
Number of remaining ticks of being on fire.
query(e,'silent')
Boolean, True if the entity is silent.
query(e,'gravity')
Boolean, True if the entity is affected by gravity, like most entities do.
query(e,'immune_to_fire')
Boolean, True if the entity is immune to fire.
query(e,'dimension')
Name of the dimension entity is in.
query(e,'height')
Height of the entity.
query(e,'width')
Width of the entity.
query(e,'eye_height')
Eye height of the entity.
query(e,'age')
Age, in ticks, of the entity, i.e. how long it existed.
query(e,'item')
Name of the item if its an item entity, null
otherwise
query(e,'count')
Number of items in a stack from item entity, null
otherwise
query(e,'is_baby')
Boolean, true if its a baby.
query(e,'target')
Returns mob's attack target or null if none or not applicable.
query(e,'home')
Returns creature's home position or null if none or not applicable.
query(e,'sneaking')
Boolean, true if entity is sneaking.
query(e,'sprinting')
Boolean, true if entity is sprinting.
query(e,'swimming')
Boolean, true if entity is swimming.
query(e,'jumping')
Boolean, true if entity is jumping.
query(e,'gamemode')
String with gamemode, or null
if not a player.
query(e,'gamemode_id')
Good'ol gamemode id, or null if not a player.
query(e,'effect',name?)
Without extra arguments, it returns list of effect active on a living entity.
Each entry is a triple of short effect name, amplifier, and remaining duration.
With an argument, if the living entity has not that potion active, returns null
, otherwise
return a tuple of amplifier and remaining duration
query(p,'effect') => [[haste, 0, 177], [speed, 0, 177]] query(p,'effect','haste') => [0, 177] query(p,'effect','resistance') => null
query(e,'health')
Number indicating remaining entity health, or null
if not applicable.
query(e,'holds',slot?)
Returns triple of short name, stack count, and NBT of item held in slot
.
Available options for slot
are:
mainhand
offhand
head
chest
legs
feet
If slot
is not specified, it defaults to the main hand.
query(e,'selected_slot')
Number indicating the selected slot of entity inventory. Currently only applicable to players.
query(e,'facing', order?)
Returns where the entity is facing. optional order (number from 0 to 5, and negative), indicating primary directions where entity is looking at. From most prominent (order 0) to opposite (order 5, or -1)
query(e,'trace', reach?, options?...)
Returns the result of ray tracing from entity perspective, indicating what it is looking at. Default reach is 4.5
blocks (5 for creative players), and by default it traces for blocks and entities, identical to player attack tracing action.
This can be customized with options
, use 'blocks' to trace for blocks only, 'liquids' to include liquid blocks
as possible results, and 'entities' to trace entities as well.
Regardless of the options selected, the result could be null
if nothing is in reach, entity, if look
targets an antity, and block value if block is in reach. Tracing always hits blocks. Even if an entity tracing is requested
and there is a block in the way - the block will be returned.
query(e,'nbt',path?)
Returns full NBT of the entity. If path is specified, it fetches only that portion of the NBT,
that corresponds to the path. For specification of path
attribute, consult
vanilla /data get entity
command.
Note that calls to nbt
are considerably more expensive comparing to other
calls in Minecraft API, and should only be used when there is no other option. Also returned
NBT is just a string to any retrieval of information post can currently only be done with matching
operator ~
. With time we are hoping not to support the 'nbt'
call better,
but rather to fill the API, so that 'nbt'
calls are not needed
Like with entity querying, entity modifications happen through one function. Most position and movements modifications don't work currently on players as their position is controlled by clients.
Currently there is no ability to modify NBT directly, but you could always use run('data modify entity
modify(e,'remove')
Removes (not kills) entity from the game.
modify(e,'kill')
Kills the entity.
modify(e, 'pos', x, y, z), modify(e, 'pos', l(x,y,z) )
Moves the entity to a specified coords.
modify(e, 'location', x, y, z, yaw, pitch), modify(e, 'location', l(x, y, z, yaw, pitch) )
Changes full location vector all at once.
modify(e, 'x', x), modify(e, 'y', y), modify(e, 'z', z)
Moves the entity in.... one direction.
modify(e, 'pitch', pitch), modify(e, 'yaw', yaw)
Changes entity's pitch or yaw.
modify(e, 'move', x, y, z), modify(e, 'move', l(x,y,z) )
Moves the entity by a vector from its current location.
modify(e, 'motion', x, y, z), modify(e, 'motion', l(x,y,z) )
Sets the motion vector (where and how much entity is moving).
modify(e, 'motion_z', x), modify(e, 'motion_y', y), modify(e, 'motion_z', z)
Sets the corresponding component of the motion vector.
modify(e, 'accelerate', x, y, z), modify(e, 'accelerate', l(x, y, z) )
Adds a vector to the motion vector. Most realistic way to apply a force to an entity.
modify(e, 'custom_name'), modify(e, 'custom_name', name )
Sets a custom name for an entity. Removes a custom name if the argument is null
modify(e, 'dismount')
Dismounts riding entity.
modify(e, 'mount', other)
Mounts the entity to the other
.
modify(e, 'drop_passengers')
Shakes off all passengers.
modify(e, 'mount_passengers', passenger, ? ...), modify(e, 'mount_passengers', l(passengers) )
Mounts on all listed entities on e
.
modify(e, 'tag', tag, ? ...), modify(e, 'tag', l(tags) )
Adds tag / tags to the entity.
modify(e, 'clear_tag', tag, ? ...), modify(e, 'clear_tag', l(tags) )
Removes tag from entity.
modify(e, 'talk')
Make noises.
modify(e, 'home', null), modify(e, 'home', block, distance?), modify(e, 'home', x, y, z, distance?)
Sets AI to stay around the home position, within distance
blocks from it. distance
defaults to 16 blocks. null
removes it. May not work fully with mobs that have this AI built in, like
Villagers.
public void API_InventoryManipulation()
Most functions in this category require inventory as the first argument. Inventory could be specified by an entity, or a block, or position (three coordinates) of a potential block with inventory. If the entity or a block doesn't have an inventory, they typically do nothing and return null.
Most items returned are in the form of a triple of item name, count, and nbt or the extra data associated with an item. Manipulating of the nbt data can be costly, but retrieving them from the tuple to match other aspects is cheap
stack_limit(item)
Returns number indicating what is the stack limit for the item. Its typically 1 (non-stackable), 16 (like buckets), or 64 - rest. It is recommended to consult this, as other inventory API functions ignore normal stack limits, and it is up to the programmer to keep it at bay. As of 1.13, game checks for negative numbers and setting an item to negative is the same as empty.
stack_limit('wooden_axe') => 1 stack_limit('ender_pearl') => 16 stack_limit('stone') => 64
inventory_size(inventory)
Returns the size of the inventory for the entity or block in question. Returns null if the block or entity don't have an inventory
inventory_size(player()) => 41 inventory_size(x,y,z) => 27 // chest inventory_size(block(pos)) => 5 // hopper
inventory_get(inventory, slot)
Returns the item in the corresponding inventory slot, or null if slot empty or inventory is invalid. You can use negative numbers to indicate slots counted from 'the back'.
inventory_get(player(), 0) => null // nothing in first hotbar slot inventory_get(x,y,z, 5) => ['stone', 1, {}] inventory_get(player(), -1) => ['diamond_pickaxe', 1, {Damage:4}] // slightly damaged diamond pick in the offhand
inventory_set(inventory, slot, count, item?, nbt?)
Modifies or sets a stack in inventory. specify count 0 to empty the slot. If item is not specified, keeps existing item, just modifies the count. If item is provided - replaces current item. If nbt is provided - adds a tag to the stack at slot. Returns previous stack in that slot.
inventory_set(player(), 0, 0) => ['stone', 64, {}] // player had a stack of stone in first hotbar slot inventory_set(player(), 0, 6) => ['diamond', 64, {}] // changed stack of diamonds in player slot to 6 inventory_set(player(), 0, 1, 'diamond_axe','{Damage:5}') => null //added slightly damaged pick to first player slot
inventory_find(inventory, item, start_slot?, ), inventory_find(inventory, null, start_slot?)
Finds the first slot with a corresponding item in the inventory, or if queried with null: the first empty slot. Returns slot number if found, or null otherwise. Optional start_slot argument allows to skip all preceeding slots allowing for efficient (so not slot-by-slot) inventory search for items.
inventory_find(player(), 'stone') => 0 // player has stone in first hotbar slot inventory_find(player(), null) => null // player's inventory has no empty spot while( (slot = inventory_find(p, 'diamond', slot)) != null, 41, drop_item(p, slot) ) // spits all diamonds from player inventory wherever they are inventory_drop(x,y,z, 0) => 64 // removed and spawned in the world a full stack of items
inventory_remove(inventory, item, amount?)
Removes amount (defaults to 1) of item from inventory. If the inventory doesn't have the defined amount, nothing happens, otherwise the given amount of items is removed wherever they are in the inventory. Returns boolean whether the removal operation was successful. Easiest way to remove a specific item from player inventory without specifying the slot.
inventory_remove(player(), 'diamond') => 1 // removed diamond from player inventory inventory_remove(player(), 'diamond', 100) => 0 // player doesn't have 100 diamonds, nothing happened
drop_item(inventory, slot, amount?, )
Drops the items from indicated inventory slot, like player that Q's an item or villager, that exchanges food. You can Q items from block inventories as well. default amount is 0 - which is all from the slot. NOTE: hoppers are quick enough to pick all the queued items from their inventory anyways. Returns size of the actual dropped items.
inventory_drop(player(), 0, 1) => 1 // Q's one item on the ground inventory_drop(x,y,z, 0) => 64 // removed and spawned in the world a full stack of items
public void API_IteratingOverAreasOfBlocks()
These functions help scan larger areas of blocks without using generic loop functions,
like nested loop
.
scan(cx, cy, cz, dx, dy, dz, px?, py?, pz?, expr)
Evaluates expression over area of blocks defined by its center (cx, cy, cz
),
expanded in all directions by dx, dy, dz
blocks, or optionally in negative with d
coords,
and p
coords in positive values. expr
receives _x, _y, _z
as coords of current analyzed block and _
which represents the block itself.
volume(x1, y1, z1, x2, y2, z2, expr)
Evaluates expression for each block in the area, the same as the scan
function, but using two opposite
corners of the rectangular cuboid. Any corners can be specified, its like you would do with /fill
command
neighbours(x, y, z), neighbours(block), neighbours(l(x,y,z))
Returns the list of 6 neighbouring blocks to the argument. Commonly used with other loop functions like for
for(neighbours(x,y,z),air(_)) => 4 // number of air blocks around a block
rect(cx, cy, cz, dx?, dy?, dz?, px?, py?, pz?)
returns an iterator, just like range
function that iterates over rectangular cubarea of blocks. If
only center point is specified, it iterates over 27 blocks. If d
arguments are specified, expands selection
of respective number of blocks in each direction. If p
arguments are specified, it uses d
for
negative offset, and p
for positive.
diamond(cx, cy, cz, radius?, height?)
Iterates over a diamond like area of blocks. With no radius and height, its 7 blocks centered around the middle (block + neighbours). With a radius specified, it expands shape on x and z coords, and with a custom height, on y. Any of these can be zero as well. radius of 0 makes a stick, height of 0 makes a diamond shape pad.
public void BreakExecutionOfAllScriptsWithCommands(boolean doStop)
script stop/script resume
command
/script stop
allows to stop execution of any script currently running that calls the
gametick()
function which
allows the game loop to regain control of the game and process other commands. This will also make sure
that all current and future programs will stop their execution. Execution of all programs will be
prevented until /script resume
command is called.
Lets look at the following example. This is a program computes Fibonacci number in a recursive manner:
fib(n) -> if(n<3, 1, fib(n-1)+fib(n-2) ); fib(8)
That's really bad way of doing it, because the higher number we need to compute the compute requirements will rise
exponentially with n
. It takes a little over 50 milliseconds to do fib(24), so above one tick,
but about a minute to do fib(40). Calling fib(40) will not only freeze the game, but also you woudn't be able to interrupt
its execution. We can modify the script as follows
fib(n) -> ( gametick(50); if(n<3, 1, fib(n-1)+fib(n-2) ) ); fib(40)
But this would never finish as such call would finish after ~ 2^40
ticks. To make our computations
responsive, yet able to respond to user interactions, other commands, as well as interrupt execution,
we could do the following:
fib(n) -> ( if(n==23, gametick(50) ); if(n<3, 1, fib(n-1)+fib(n-2) ) ); fib(40)
This would slow down the computation of fib(40) from a minute to two, but allows the game to keep continue running
and be responsive to commands, using about half of each tick to advance the computation.
Obviously depending on the problem, and available hardware, certain things can take
more or less time to execute, so portioning of work with calling gametick
should be balanced in each
case separately
doStop
- .public boolean fillAndScanCommand(carpet.script.ScriptHost host, int x, int y, int z)
/script scan
, /script fill
and /script outline
commandsThese commands can be used to evaluate an expression over an area of blocks. They all need to have specified
the origin of the analyzed area (which is used as referenced (0,0,0), and two corners of an area to analyzed. If
you would want that the script block coordinates refer to the actual world coordinates, use origin of 0 0 0
,
or if it doesn't matter, duplicating coordinates of one of the corners is the easiest way.
These commands, unlike raw /script run
are limited by vanilla fill / clone command
limit of 32k blocks, which can be altered with carpet mod's own /carpet fillLimit
command.
/script scan origin<x y z> corner<x y z> corner<x y z> expr
Evaluates expression for each point in the area and returns number of successes (result was positive). Since the command by itself doesn't affect the area, the effects would be in side effects.
/script fill origin<x y z> corner<x y z> corner<x y z> "expr" <block> (? replace <replacement>)
Think of it as a regular fill command, that sets blocks based on whether a result of the command was successful.
Note that the expression is in quotes. Thankfully string constants in scarpet
use single quotes. Can be used
to fill complex geometric shapes.
/script outline origin<x y z> corner<x y z> corner<x y z> "expr" <block> (? replace <replacement>)
Similar to fill
command it evaluates an expression for each block in the area, but in this case setting blocks
where condition was true and any of the neighbouring blocks were evaluated negatively. This allows to create surface areas,
like sphere for example, without resorting to various rounding modes and tricks.
Here is an example of seven ways to draw a sphere of radius of 32 blocks around 0 100 0:
/script outline 0 100 0 -40 60 -40 40 140 40 "x*x+y*y+z*z < 32*32" white_stained_glass replace air /script outline 0 100 0 -40 60 -40 40 140 40 "x*x+y*y+z*z <= 32*32" white_stained_glass replace air /script outline 0 100 0 -40 60 -40 40 140 40 "x*x+y*y+z*z < 32.5*32.5" white_stained_glass replace air /script fill 0 100 0 -40 60 -40 40 140 40 "floor(sqrt(x*x+y*y+z*z)) == 32" white_stained_glass replace air /script fill 0 100 0 -40 60 -40 40 140 40 "round(sqrt(x*x+y*y+z*z)) == 32" white_stained_glass replace air /script fill 0 100 0 -40 60 -40 40 140 40 "ceil(sqrt(x*x+y*y+z*z)) == 32" white_stained_glass replace air /draw sphere 0 100 0 32 white_stained_glass replace air fluffy ball round(sqrt(x*x+y*y+z*z)-rand(abs(y)))==32
The last method is the one that world edit is using (part of carpet mod). It turns out that the outline method with 32.5
radius,
fill method with round
function and draw command are equivalent
host
- .x
- .y
- .z
- .public void gameEventsSystem()
Provides the ability to execute specific function whenever an event occurs. The functions to be registered
need to conform with the arguments to the event specification. When loading module functions, each function that
starts with __on_...
and has the required arguments, will be bound automatically.
In case of player specific modules, all player action events will be directed to the appropriate player space, and
all tick events will be executed in the global context, so its not a good idea to mix these two, so use either of these,
or use commands to call tick events directly, or handle player specific data inside a module.
Here is a list of events that can be handled by scarpet. This list includes prefixes required by modules to autoload them, but you can add any function to any event if it had required parameters:
__on_tick() // can access blocks and entities in the overworld __on_tick_nether() // can access blocks and entities in the nether __on_tick_ender() // can access blocks and entities in the end // player specific callbacks __on_player_jumps(player) __on_player_deploys_elytra(player) __on_player_wakes_up(player) __on_player_rides(player, forward, strafe, jumping, sneaking) __on_player_uses_item(player, item_tuple, hand) __on_player_clicks_block(player, block, face) __on_player_right_clicks_block(player, item_tuple, hand, block, face, hitvec) __on_player_breaks_block(player, block) __on_player_interacts_with_entity(player, entity, hand) __on_player_attacks_entity(player, entity) __on_player_starts_sneaking(player) __on_player_stops_sneaking(player) __on_player_starts_sprinting(player) __on_player_stops_sprinting(player)
/script event
commandused to display current events and bounded functions. use add_to
ro register new event, or remove_from
to unbind a specific function from an event.
public void invokeGlobalFunctionCommand()
/script invoke / invokepoint / invokearea
, /script globals
commandsinvoke
family of commands provide convenient way to invoke stored procedures (i.e. functions
that has been defined previously by any running script. To view current stored procedure set,
run /script globals
, to define a new stored procedure, just run a /script run function(a,b) -> ( ... )
command with your procedure once, and to forget a procedure, use undef
function:
/script run undef('function')
/script invoke <fun> <args?> ...
Equivalent of running /script run fun(args, ...)
, but you get the benefit of getting the tab completion of the
command name, and lower permission level required to run these (since player is not capable of running any custom code
in this case, only this that has been executed before by an operator). Arguments will be checked for validity, and
you can only pass simple values as arguments (strings, numbers, or null
value). Use quotes to include
whitespaces in argument strings.
Command will check provided arguments with required arguments (count) and fail if not enough or too much arguments are provided. Operators defining functions are advised to use descriptive arguments names, as these will be visible for invokers and form the base of understanding what each argument does.
invoke
family of commands will tab complete any stored function that does not start with '_'
,
it will still allow to run procedures starting with '_'
but not suggest them, and ban execution of any
hidden stored procedures, so ones that start with '__'
. In case operator needs to use subroutines
for convenience and don't want to expose them to the invoke
callers, they can use this mechanic.
/script run example_function(const, phrase, price) -> print(const+' '+phrase+' '+price) /script invoke example_function pi costs 5
/script invokepoint <fun> <coords x y z> <args?> ...
It is equivalent to invoke
except it assumes that the first three arguments are coordinates, and provides
coordinates tab completion, with looking at...
mechanics for convenience. All other arguments are expected
at the end
/script invokearea <fun> <coords x y z> <coords x y z> <args?> ...
It is equivalent to invoke
except it assumes that the first three arguments are one set of ccordinates,
followed by the second set of coordinates, providing tab completion, with looking at...
mechanics for convenience,
followed by any other required arguments
public void loadScriptsFromFilesCommand()
/script load / unload <module> (shared?)
, /script in <module>
commandsload / unload
commands allow for very conventient way of writing your code, providing it to the game
and distribute with your worlds without the need of use of commandblocks. Just place your scarpet code in the /scripts
folder of your world files and make sure it ends with .sc
extension. The good thing about editing that
code is that you can no only use normal editing without the need of marking of newlines, but you can also use
comments in your code.
a comment is anything that starts with a double slash, and continues to the end of the line:
foo = 1; //This is a comment bar = 2; // This never worked, so I commented it out // baz = foo()
/script load/unload <module> (?shared)
Loading operation will load that script code from disk and execute it right away. You would probably use it to
load some stored procedures to be used for later. To reload the module, just type /script load
again.
Reloading removes all the current global state (globals and functions) that were added later by the module.
Loading a module, if it contains a __command()
method, will attempt to registed a command with that
module name, and register all public (no underscore) functions available in the module as subcommands. It will also
bind specific events to the event system (check Events section for details).
Unloading a module removes all of its state from the game, disables commands, and removes bounded events
Scripts can be loaded in shared and player mode. Default is player, so all globals and stored functions are
individual for each player, meaning scripts don't need to worry about making sure they store some intermittent data
for each player independently. In shared mode - all global values and stored functions are shared among all players.
To access specific player data with commandblocks, use /execute as (player) run script in (module) run ...
To access global/server state, you need to disown the command from any player, so use a commandblock, or any arbitrary
entity: /execute as @e[type=bat,limit=1] run script in (module) globals
for instance.
/script in <module> ...
Allows to run normal /script commands in a specific module, like run, invoke,..., globals
etc...
public java.lang.String scriptRunCommand(carpet.script.ScriptHost host, net.minecraft.util.math.BlockPos pos)
/script run
commandPrimary way to input commands. The command executes in the context, position, and dimension of the executing
player, commandblock, etc... The command receives 4 variables, x
, y
, z
and p
indicating position and the executing entity of the command.
You will receive tab completion suggestions as you type your code suggesting functions and global variables.
It is advisable to use /execute in ... at ... as ... run script run ...
or similar, to simulate running
commands in a different scope
host
- .pos
- .


astropy.coordinates supports leverages the coordinate framework to make it straightforward to find the closest coordinates in a catalog to a desired set of other coordinates. For example, assuming ra1/dec1 and ra2/dec2 are arrays loaded from some file
>>> from astropy.coordinates import ICRS
>>> from astropy import units as u
>>> #assume ra1/dec1 and ra/dec2 are arrays loaded from some file
>>> c = ICRS(ra1, dec1, unit=(u.degree, u.degree))
>>> catalog = ICRS(ra2, dec2, unit=(u.degree, u.degree))
>>> idx, d2d, d3d = c.match_to_catalog_sky(catalog)
>>> from astropy.coordinates import match_coordinates_sky
>>> idx, d2d, d3d = match_coordinates_sky(c, catalog) # same thing
You can also find the nearest 3d matches, different from the above when the coordinates have distances
>>> #assume ra1/dec1 and ra/dec2 are arrays loaded from some file
>>> c = ICRS(ra1, dec1, unit=(u.degree, u.degree))
>>> catalog = ICRS(ra2, dec2, unit=(u.degree, u.degree))
>>> idx, d2d, d3d = c.match_to_catalog_3d(catalog)
Now idx are indices into catalog that are the closest objects to each of the coordinates in c, d2d are the on-sky distances between them, and d3d are the 3-dimensional distances. Because coordinate objects support indexing, idx enables easy access to the matched set of coordinates in the catalog:
>>> matches = catalog[idx]
>>> (matches.separation_3d(c) == d3d).all()
True
>>> dra = (matches.ra - c.ra).arcmin
>>> ddec = (matches.dec - c.dec).arcmin


WPCOM.JS
JavaScript API for WordPress
Official JavaScript library for the WordPress.com REST API.
Compatible with Node.js and web browsers.
source on github
Check out more open-source goodness from


--- layout: page title: About header-img: "img/about-bg.png" ---
Full stack web developer with a passion for designing creative and helpful web applications. With experience in Ruby on Rails, JavaScript, and React and a background in technology education, I discovered web development through an interest in employing programming to teach logical thinking. I bring strong skills in mentorship, creative problem solving, and communication.


CHANGELOG
2012/11/5 Version 1.0.1
- Functions decorated with patch variants have a __wrapped__ attribute
pointing to the original function. This brings compatibility with the
default behaviour in Python 3.3 (due to a new feature in functools.wraps).
Note that due to changes in tox, mock is no longer tested with Python 2.4.
The compatibility code has not been removed so it probably still works, but
tests are no longer run.
2012/10/07 Version 1.0.0
No changes since 1.0.0 beta 1. This version has feature parity with
unittest.mock
in Python 3.3.
Full list of changes since 0.8:
- mocksignature, along with the mocksignature argument to patch, removed
- Support for deleting attributes (accessing deleted attributes will raise an
AttributeError)
- Added the mock_open helper function for mocking the builtin open
- __class__ is assignable, so a mock can pass an isinstance check without
requiring a spec
- Addition of PropertyMock, for mocking properties
- MagicMocks made unorderable by default (in Python 3). The comparison
methods (other than equality and inequality) now return NotImplemented
- Propagate traceback info to support subclassing of _patch by other
libraries
- create_autospec works with attributes present in results of dir that
can’t be fetched from the object’s class. Contributed by Konstantine Rybnikov
- Any exceptions in an iterable side_effect will be raised instead of
returned
- In Python 3, create_autospec now supports keyword only arguments
- Added patch.stopall method to stop all active patches created by start
- BUGFIX: calling MagicMock.reset_mock wouldn’t reset magic method mocks
- BUGFIX: calling reset_mock on a MagicMock created with autospec could
raise an exception
- BUGFIX: passing multiple spec arguments to patchers (spec , spec_set and
autospec) had unpredictable results, now it is an error
- BUGFIX: using spec=True and create=True as arguments to patchers could
result in using DEFAULT as the spec. Now it is an error instead
- BUGFIX: using spec or autospec arguments to patchers, along with
spec_set=True did not work correctly
- BUGFIX: using an object that evaluates to False as a spec could be ignored
- BUGFIX: a list as the spec argument to a patcher would always result in a
non-callable mock. Now if __call__ is in the spec the mock is callable
2012/07/13 Version 1.0.0 beta 1
- Added patch.stopall method to stop all active patches created by start
- BUGFIX: calling MagicMock.reset_mock wouldn’t reset magic method mocks
- BUGFIX: calling reset_mock on a MagicMock created with autospec could
raise an exception
2012/05/04 Version 1.0.0 alpha 2
- PropertyMock attributes are now standard MagicMocks
- create_autospec works with attributes present in results of dir that
can’t be fetched from the object’s class. Contributed by Konstantine Rybnikov
- Any exceptions in an iterable side_effect will be raised instead of
returned
- In Python 3, create_autospec now supports keyword only arguments
2012/03/25 Version 1.0.0 alpha 1
The standard library version!
- mocksignature, along with the mocksignature argument to patch, removed
- Support for deleting attributes (accessing deleted attributes will raise an
AttributeError)
- Added the mock_open helper function for mocking the builtin open
- __class__ is assignable, so a mock can pass an isinstance check without
requiring a spec
- Addition of PropertyMock, for mocking properties
- MagicMocks made unorderable by default (in Python 3). The comparison
methods (other than equality and inequality) now return NotImplemented
- Propagate traceback info to support subclassing of _patch by other
libraries
- BUGFIX: passing multiple spec arguments to patchers (spec , spec_set and
autospec) had unpredictable results, now it is an error
- BUGFIX: using spec=True and create=True as arguments to patchers could
result in using DEFAULT as the spec. Now it is an error instead
- BUGFIX: using spec or autospec arguments to patchers, along with
spec_set=True did not work correctly
- BUGFIX: using an object that evaluates to False as a spec could be ignored
- BUGFIX: a list as the spec argument to a patcher would always result in a
non-callable mock. Now if __call__ is in the spec the mock is callable
2012/02/13 Version 0.8.0
The only changes since 0.8rc2 are:
- Improved repr of sentinel objects
- ANY can be used for comparisons against call objects
- The return value of MagicMock.__iter__ method can be set to
any iterable and isn’t required to be an iterator
Full List of changes since 0.7:
mock 0.8.0 is the last version that will support Python 2.4.
- Addition of mock_calls list for all calls (including magic
methods and chained calls)
- patch() and patch.object() now create a MagicMock
instead of a Mock by default
- The patchers (patch, patch.object and patch.dict), plus Mock and
MagicMock, take arbitrary keyword arguments for configuration
- New mock method configure_mock() for setting attributes and
return values / side effects on the mock and its attributes
- New mock assert methods assert_any_call() and
assert_has_calls()
- Implemented Autospeccing (recursive, lazy speccing of mocks with
mocked signatures for functions/methods), as the autospec argument to
patch
- Added the create_autospec() function for manually creating
‘auto-specced’ mocks
- patch.multiple() for doing multiple patches in a single call, using
keyword arguments
- Setting side_effect to an iterable will cause calls to the mock
to return the next value from the iterable
- New new_callable argument to patch and patch.object allowing you to
pass in a class or callable object (instead of MagicMock) that will be
called to replace the object being patched
- Addition of NonCallableMock and NonCallableMagicMock, mocks
without a __call__ method
- Addition of mock_add_spec() method for adding (or changing) a
spec on an existing mock
- Protocol methods on MagicMock are magic mocks, and are created
lazily on first lookup. This means the result of calling a protocol method is
a MagicMock instead of a Mock as it was previously
- Addition of attach_mock() method
- Added ANY for ignoring arguments in assert_called_with()
calls
- Addition of call helper object
- Improved repr for mocks
- Improved repr for Mock.call_args and entries in
Mock.call_args_list, Mock.method_calls and
Mock.mock_calls
- Improved repr for sentinel objects
- patch lookup is done at use time not at decoration time
- In Python 2.6 or more recent, dir on a mock will report all the dynamically
created attributes (or the full list of attributes if there is a spec) as
well as all the mock methods and attributes.
- Module level FILTER_DIR added to control whether dir(mock) filters
private attributes. True by default.
- patch.TEST_PREFIX for controlling how patchers recognise test methods when
used to decorate a class
- Support for using Java exceptions as a side_effect on Jython
- Mock call lists (call_args_list, method_calls & mock_calls) are now
custom list objects that allow membership tests for “sub lists” and have
a nicer representation if you str or print them
- Mocks attached as attributes or return values to other mocks have calls
recorded in method_calls and mock_calls of the parent (unless a name is
already set on the child)
- Improved failure messages for assert_called_with and
assert_called_once_with
- The return value of the MagicMock __iter__ method can be set to
any iterable and isn’t required to be an iterator
- Added the Mock API (assert_called_with etc) to functions created by
mocksignature()
- Tuples as well as lists can be used to specify allowed methods for spec &
spec_set arguments
- Calling stop on an unstarted patcher fails with a more meaningful error
message
- Renamed the internal classes Sentinel and SentinelObject to prevent abuse
- BUGFIX: an error creating a patch, with nested patch decorators, won’t leave
patches in place
- BUGFIX: __truediv__ and __rtruediv__ not available as magic methods on
mocks in Python 3
- BUGFIX: assert_called_with / assert_called_once_with can be used with
self as a keyword argument
- BUGFIX: when patching a class with an explicit spec / spec_set (not a
boolean) it applies “spec inheritance” to the return value of the created
mock (the “instance”)
- BUGFIX: remove the __unittest marker causing traceback truncation
- Removal of deprecated patch_object
- Private attributes _name, _methods, ‘_children’, _wraps and _parent
(etc) renamed to reduce likelihood of clash with user attributes.
- Added license file to the distribution
2012/01/10 Version 0.8.0 release candidate 2
- Removed the configure keyword argument to create_autospec and allow
arbitrary keyword arguments (for the Mock constructor) instead
- Fixed ANY equality with some types in assert_called_with calls
- Switched to a standard Sphinx theme (compatible with
readthedocs.org)
2011/12/29 Version 0.8.0 release candidate 1
- create_autospec on the return value of a mocked class will use __call__
for the signature rather than __init__
- Performance improvement instantiating Mock and MagicMock
- Mocks used as magic methods have the same type as their parent instead of
being hardcoded to MagicMock
Special thanks to Julian Berman for his help with diagnosing and improving
performance in this release.
2011/10/09 Version 0.8.0 beta 4
- patch lookup is done at use time not at decoration time
- When attaching a Mock to another Mock as a magic method, calls are recorded
in mock_calls
- Addition of attach_mock method
- Renamed the internal classes Sentinel and SentinelObject to prevent abuse
- BUGFIX: various issues around circular references with mocks (setting a mock
return value to be itself etc)
2011/08/15 Version 0.8.0 beta 3
- Mocks attached as attributes or return values to other mocks have calls
recorded in method_calls and mock_calls of the parent (unless a name is
already set on the child)
- Addition of mock_add_spec method for adding (or changing) a spec on an
existing mock
- Improved repr for Mock.call_args and entries in Mock.call_args_list,
Mock.method_calls and Mock.mock_calls
- Improved repr for mocks
- BUGFIX: minor fixes in the way mock_calls is worked out,
especially for “intermediate” mocks in a call chain
2011/08/05 Version 0.8.0 beta 2
- Setting side_effect to an iterable will cause calls to the mock to return
the next value from the iterable
- Added assert_any_call method
- Moved assert_has_calls from call lists onto mocks
- BUGFIX: call_args and all members of call_args_list are two tuples of
(args, kwargs) again instead of three tuples of (name, args, kwargs)
2011/07/25 Version 0.8.0 beta 1
- patch.TEST_PREFIX for controlling how patchers recognise test methods when
used to decorate a class
- Mock call lists (call_args_list, method_calls & mock_calls) are now
custom list objects that allow membership tests for “sub lists” and have
an assert_has_calls method for unordered call checks
- callargs changed to always be a three-tuple of (name, args, kwargs)
- Addition of mock_calls list for all calls (including magic methods and
chained calls)
- Extension of call object to support chained calls and callargs for better
comparisons with or without names. call object has a call_list method for
chained calls
- Added the public instance argument to create_autospec
- Support for using Java exceptions as a side_effect on Jython
- Improved failure messages for assert_called_with and
assert_called_once_with
- Tuples as well as lists can be used to specify allowed methods for spec &
spec_set arguments
- BUGFIX: Fixed bug in patch.multiple for argument passing when creating
mocks
- Added license file to the distribution
2011/07/16 Version 0.8.0 alpha 2
- patch.multiple for doing multiple patches in a single call, using keyword
arguments
- New new_callable argument to patch and patch.object allowing you to
pass in a class or callable object (instead of MagicMock) that will be
called to replace the object being patched
- Addition of NonCallableMock and NonCallableMagicMock, mocks without a
__call__ method
- Mocks created by patch have a MagicMock as the return_value where a
class is being patched
- create_autospec can create non-callable mocks for non-callable objects.
return_value mocks of classes will be non-callable unless the class has
a __call__ method
- autospec creates a MagicMock without a spec for properties and slot
descriptors, because we don’t know the type of object they return
- Removed the “inherit” argument from create_autospec
- Calling stop on an unstarted patcher fails with a more meaningful error
message
- BUGFIX: an error creating a patch, with nested patch decorators, won’t leave
patches in place
- BUGFIX: __truediv__ and __rtruediv__ not available as magic methods on
mocks in Python 3
- BUGFIX: assert_called_with / assert_called_once_with can be used with
self as a keyword argument
- BUGFIX: autospec for functions / methods with an argument named self that
isn’t the first argument no longer broken
- BUGFIX: when patching a class with an explicit spec / spec_set (not a
boolean) it applies “spec inheritance” to the return value of the created
mock (the “instance”)
- BUGFIX: remove the __unittest marker causing traceback truncation
2011/06/14 Version 0.8.0 alpha 1
mock 0.8.0 is the last version that will support Python 2.4.
The patchers (patch, patch.object and patch.dict), plus Mock and
MagicMock, take arbitrary keyword arguments for configuration
New mock method configure_mock for setting attributes and return values /
side effects on the mock and its attributes
In Python 2.6 or more recent, dir on a mock will report all the dynamically
created attributes (or the full list of attributes if there is a spec) as
well as all the mock methods and attributes.
Module level FILTER_DIR added to control whether dir(mock) filters
private attributes. True by default. Note that vars(Mock()) can still be
used to get all instance attributes and dir(type(Mock()) will still return
all the other attributes (irrespective of FILTER_DIR)
patch and patch.object now create a MagicMock instead of a Mock by
default
Added ANY for ignoring arguments in assert_called_with calls
Addition of call helper object
Protocol methods on MagicMock are magic mocks, and are created lazily on
first lookup. This means the result of calling a protocol method is a
MagicMock instead of a Mock as it was previously
Added the Mock API (assert_called_with etc) to functions created by
mocksignature
Private attributes _name, _methods, ‘_children’, _wraps and _parent
(etc) renamed to reduce likelihood of clash with user attributes.
Implemented auto-speccing (recursive, lazy speccing of mocks with mocked
signatures for functions/methods)
Limitations:
- Doesn’t mock magic methods or attributes (it creates MagicMocks, so the
magic methods are there, they just don’t have the signature mocked nor
are attributes followed)
- Doesn’t mock function / method attributes
- Uses object traversal on the objects being mocked to determine types - so
properties etc may be triggered
- The return value of mocked classes (the ‘instance’) has the same call
signature as the class __init__ (as they share the same spec)
You create auto-specced mocks by passing autospec=True to patch.
Note that attributes that are None are special cased and mocked without a
spec (so any attribute / method can be used). This is because None is
typically used as a default value for attributes that may be of some other
type, and as we don’t know what type that may be we allow all access.
Note that the autospec option to patch obsoletes the mocksignature
option.
Added the create_autospec function for manually creating ‘auto-specced’
mocks
Removal of deprecated patch_object
2011/05/30 Version 0.7.2
- BUGFIX: instances of list subclasses can now be used as mock specs
- BUGFIX: MagicMock equality / inequality protocol methods changed to use the
default equality / inequality. This is done through a side_effect on
the mocks used for __eq__ / __ne__
2011/05/06 Version 0.7.1
Package fixes contributed by Michael Fladischer. No code changes.
- Include template in package
- Use isolated binaries for the tox tests
- Unset executable bit on docs
- Fix DOS line endings in getting-started.txt
2011/03/05 Version 0.7.0
No API changes since 0.7.0 rc1. Many documentation changes including a stylish
new Sphinx theme.
The full set of changes since 0.6.0 are:
- Python 3 compatibility
- Ability to mock magic methods with Mock and addition of MagicMock
with pre-created magic methods
- Addition of mocksignature and mocksignature argument to patch and
patch.object
- Addition of patch.dict for changing dictionaries during a test
- Ability to use patch, patch.object and patch.dict as class decorators
- Renamed patch_object to patch.object (patch_object is
deprecated)
- Addition of soft comparisons: call_args, call_args_list and method_calls
now return tuple-like objects which compare equal even when empty args
or kwargs are skipped
- patchers (patch, patch.object and patch.dict) have start and stop
methods
- Addition of assert_called_once_with method
- Mocks can now be named (name argument to constructor) and the name is used
in the repr
- repr of a mock with a spec includes the class name of the spec
- assert_called_with works with python -OO
- New spec_set keyword argument to Mock and patch. If used,
attempting to set an attribute on a mock not on the spec will raise an
AttributeError
- Mocks created with a spec can now pass isinstance tests (__class__
returns the type of the spec)
- Added docstrings to all objects
- Improved failure message for Mock.assert_called_with when the mock
has not been called at all
- Decorated functions / methods have their docstring and __module__
preserved on Python 2.4.
- BUGFIX: mock.patch now works correctly with certain types of objects that
proxy attribute access, like the django settings object
- BUGFIX: mocks are now copyable (thanks to Ned Batchelder for reporting and
diagnosing this)
- BUGFIX: spec=True works with old style classes
- BUGFIX: help(mock) works now (on the module). Can no longer use __bases__
as a valid sentinel name (thanks to Stephen Emslie for reporting and
diagnosing this)
- BUGFIX: side_effect now works with BaseException exceptions like
KeyboardInterrupt
- BUGFIX: reset_mock caused infinite recursion when a mock is set as its own
return value
- BUGFIX: patching the same object twice now restores the patches correctly
- with statement tests now skipped on Python 2.4
- Tests require unittest2 (or unittest2-py3k) to run
- Tested with tox on Python 2.4 - 3.2,
jython and pypy (excluding 3.0)
- Added ‘build_sphinx’ command to setup.py (requires setuptools or distribute)
Thanks to Florian Bauer
- Switched from subversion to mercurial for source code control
- Konrad Delong added as co-maintainer
2011/02/16 Version 0.7.0 RC 1
Changes since beta 4:
- Tested with jython, pypy and Python 3.2 and 3.1
- Decorated functions / methods have their docstring and __module__
preserved on Python 2.4
- BUGFIX: mock.patch now works correctly with certain types of objects that
proxy attribute access, like the django settings object
- BUGFIX: reset_mock caused infinite recursion when a mock is set as its own
return value
2010/11/12 Version 0.7.0 beta 4
- patchers (patch, patch.object and patch.dict) have start and stop
methods
- Addition of assert_called_once_with method
- repr of a mock with a spec includes the class name of the spec
- assert_called_with works with python -OO
- New spec_set keyword argument to Mock and patch. If used,
attempting to set an attribute on a mock not on the spec will raise an
AttributeError
- Attributes and return value of a MagicMock are MagicMock objects
- Attempting to set an unsupported magic method now raises an AttributeError
- patch.dict works as a class decorator
- Switched from subversion to mercurial for source code control
- BUGFIX: mocks are now copyable (thanks to Ned Batchelder for reporting and
diagnosing this)
- BUGFIX: spec=True works with old style classes
- BUGFIX: mocksignature=True can now patch instance methods via
patch.object
2010/09/18 Version 0.7.0 beta 3
- Using spec with MagicMock only pre-creates magic methods in the spec
- Setting a magic method on a mock with a spec can only be done if the
spec has that method
- Mocks can now be named (name argument to constructor) and the name is used
in the repr
- mocksignature can now be used with classes (signature based on __init__)
and callable objects (signature based on __call__)
- Mocks created with a spec can now pass isinstance tests (__class__
returns the type of the spec)
- Default numeric value for MagicMock is 1 rather than zero (because the
MagicMock bool defaults to True and 0 is False)
- Improved failure message for assert_called_with() when the mock
has not been called at all
- Adding the following to the set of supported magic methods:
- __getformat__ and __setformat__
- pickle methods
- __trunc__, __ceil__ and __floor__
- __sizeof__
- Added ‘build_sphinx’ command to setup.py (requires setuptools or distribute)
Thanks to Florian Bauer
- with statement tests now skipped on Python 2.4
- Tests require unittest2 to run on Python 2.7
- Improved several docstrings and documentation
2010/06/23 Version 0.7.0 beta 2
- patch.dict() works as a context manager as well as a decorator
- patch.dict takes a string to specify dictionary as well as a dictionary
object. If a string is supplied the name specified is imported
- BUGFIX: patch.dict restores dictionary even when an exception is raised
2010/06/22 Version 0.7.0 beta 1
- Addition of mocksignature()
- Ability to mock magic methods
- Ability to use patch and patch.object as class decorators
- Renamed patch_object to patch.object() (patch_object is
deprecated)
- Addition of MagicMock class with all magic methods pre-created for you
- Python 3 compatibility (tested with 3.2 but should work with 3.0 & 3.1 as
well)
- Addition of patch.dict() for changing dictionaries during a test
- Addition of mocksignature argument to patch and patch.object
- help(mock) works now (on the module). Can no longer use __bases__
as a valid sentinel name (thanks to Stephen Emslie for reporting and
diagnosing this)
- Addition of soft comparisons: call_args, call_args_list and method_calls
now return tuple-like objects which compare equal even when empty args
or kwargs are skipped
- Added docstrings.
- BUGFIX: side_effect now works with BaseException exceptions like
KeyboardInterrupt
- BUGFIX: patching the same object twice now restores the patches correctly
- The tests now require unittest2
to run
- Konrad Delong added as co-maintainer
2009/08/22 Version 0.6.0
- New test layout compatible with test discovery
- Descriptors (static methods / class methods etc) can now be patched and
restored correctly
- Mocks can raise exceptions when called by setting side_effect to an
exception class or instance
- Mocks that wrap objects will not pass on calls to the underlying object if
an explicit return_value is set
2009/04/17 Version 0.5.0
- Made DEFAULT part of the public api.
- Documentation built with Sphinx.
- side_effect is now called with the same arguments as the mock is called with and
if returns a non-DEFAULT value that is automatically set as the mock.return_value.
- wraps keyword argument used for wrapping objects (and passing calls through to the wrapped object).
- Mock.reset renamed to Mock.reset_mock, as reset is a common API name.
- patch / patch_object are now context managers and can be used with with.
- A new ‘create’ keyword argument to patch and patch_object that allows them to patch
(and unpatch) attributes that don’t exist. (Potentially unsafe to use - it can allow
you to have tests that pass when they are testing an API that doesn’t exist - use at
your own risk!)
- The methods keyword argument to Mock has been removed and merged with spec. The spec
argument can now be a list of methods or an object to take the spec from.
- Nested patches may now be applied in a different order (created mocks passed
in the opposite order). This is actually a bugfix.
- patch and patch_object now take a spec keyword argument. If spec is
passed in as ‘True’ then the Mock created will take the object it is replacing
as its spec object. If the object being replaced is a class, then the return
value for the mock will also use the class as a spec.
- A Mock created without a spec will not attempt to mock any magic methods / attributes
(they will raise an AttributeError instead).
2008/10/12 Version 0.4.0
Default return value is now a new mock rather than None
return_value added as a keyword argument to the constructor
New method ‘assert_called_with’
Added ‘side_effect’ attribute / keyword argument called when mock is called
patch decorator split into two decorators:
- patch_object which takes an object and an attribute name to patch
(plus optionally a value to patch with which defaults to a mock object)
- patch which takes a string specifying a target to patch; in the form
‘package.module.Class.attribute’. (plus optionally a value to
patch with which defaults to a mock object)
Can now patch objects with None
Change to patch for nose compatibility with error reporting in wrapped functions
Reset no longer clears children / return value etc - it just resets
call count and call args. It also calls reset on all children (and
the return value if it is a mock).
Thanks to Konrad Delong, Kevin Dangoor and others for patches and suggestions.
2007/12/03 Version 0.3.1
patch maintains the name of decorated functions for compatibility with nose
test autodiscovery.
Tests decorated with patch that use the two argument form (implicit mock
creation) will receive the mock(s) passed in as extra arguments.
Thanks to Kevin Dangoor for these changes.
2007/11/30 Version 0.3.0
Removed patch_module. patch can now take a string as the first
argument for patching modules.
The third argument to patch is optional - a mock will be created by
default if it is not passed in.
2007/11/21 Version 0.2.1
Bug fix, allows reuse of functions decorated with patch and patch_module.
2007/11/20 Version 0.2.0
Added spec keyword argument for creating Mock objects from a
specification object.
Added patch and patch_module monkey patching decorators.
Added sentinel for convenient access to unique objects.
Distribution includes unit tests.
2007/11/19 Version 0.1.0
Initial release.
TODO and Limitations
Contributions, bug reports and comments welcomed!
Feature requests and bug reports are handled on the issue tracker:
wraps is not integrated with magic methods.
patch could auto-do the patching in the constructor and unpatch in the
destructor. This would be useful in itself, but violates TOOWTDI and would be
unsafe for IronPython & PyPy (non-deterministic calling of destructors).
Destructors aren’t called in CPython where there are cycles, but a weak
reference with a callback can be used to get round this.
Mock has several attributes. This makes it unsuitable for mocking objects
that use these attribute names. A way round this would be to provide methods
that hide these attributes when needed. In 0.8 many, but not all, of these
attributes are renamed to gain a _mock prefix, making it less likely that
they will clash. Any outstanding attributes that haven’t been modified with
the prefix should be changed.
If a patch is started using patch.start and then not stopped correctly then
the unpatching is not done. Using weak references it would be possible to
detect and fix this when the patch object itself is garbage collected. This
would be tricky to get right though.
When a Mock is created by patch, arbitrary keywords can be used to set
attributes. If patch is created with a spec, and is replacing a class, then
a return_value mock is created. The keyword arguments are not applied to the
child mock, but could be.
When mocking a class with patch, passing in spec=True or autospec=True,
the mock class has an instance created from the same spec. Should this be the
default behaviour for mocks anyway (mock return values inheriting the spec
from their parent), or should it be controlled by an additional keyword
argument (inherit) to the Mock constructor? create_autospec does this, so
an additional keyword argument to Mock is probably unnecessary.
The mocksignature argument to patch with a non Mock passed into
new_callable will probably cause an error. Should it just be invalid?
Note that NonCallableMock and NonCallableMagicMock still have the unused
(and unusable) attributes: return_value, side_effect, call_count,
call_args and call_args_list. These could be removed or raise errors on
getting / setting. They also have the assert_called_with and
assert_called_once_with methods. Removing these would be pointless as
fetching them would create a mock (attribute) that could be called without
error.
Some outstanding technical debt. The way autospeccing mocks function
signatures was copied and modified from mocksignature. This could all be
refactored into one set of functions instead of two. The way we tell if
patchers are started and if a patcher is being used for a patch.multiple
call are both horrible. There are now a host of helper functions that should
be rationalised. (Probably time to split mock into a package instead of a
module.)
Passing arbitrary keyword arguments to create_autospec, or patch with
autospec, when mocking a function works fine. However, the arbitrary
attributes are set on the created mock - but create_autospec returns a
real function (which doesn’t have those attributes). However, what is the use
case for using autospec to create functions with attributes that don’t exist
on the original?
mocksignature, plus the call_args_list and method_calls attributes of
Mock could all be deprecated.


Before Change
// -------------------------
if debug:
logging.basicConfig(level=logging.DEBUG)
def find_scripts():
return [
s for s in setuptools.findall("scripts/") if os.path.splitext(s)[1] != ".pyc"
]
After Change
import setuptools
setuptools.setup(
name="hyperopt",
version="0.2.3",
packages=setuptools.find_packages(include=["hyperopt*"]),
entry_points={"console_scripts": ["hyperopt-mongo-worker=hyperopt.mongoexp:main"]},
url="http://hyperopt.github.com/hyperopt/",
author="James Bergstra",
<EMAIL_ADDRESS>description="Distributed Asynchronous Hyperparameter Optimization",
long_description="",
classifiers=[
"Development Status :: 3 - Alpha",
"Intended Audience :: Education",
"Intended Audience :: Science/Research",
"Intended Audience :: Developers",
"Environment :: Console",
"License :: OSI Approved :: BSD License",
"Operating System :: MacOS :: MacOS X",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX",
"Operating System :: Unix",
"Programming Language :: Python",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 3",
"Topic :: Scientific/Engineering",
"Topic :: Software Development",
],
platforms=["Linux", "OS-X", "Windows"],
license="BSD",
keywords="Bayesian optimization hyperparameter model selection",
include_package_data=True,
install_requires=[
"numpy",
"scipy",
"six",
"networkx>=2.2",
"future",
"tqdm",
"cloudpickle",
],
extras_require={
"SparkTrials": "pyspark",
"MongoTrials": "pymongo",
"ATPE": ["lightgbm", "scikit-learn"],
"dev": ["black", "pre-commit", "nose", "pytest"],
},
tests_require=["nose", "pytest"],
zip_safe=False,
)


SVCS_UNLOAD_LOG
Use the SVCS_UNLOAD_LOG to get details of UNLOAD operations.
SVCS_UNLOAD_LOG records one row for each file created by an UNLOAD statement. For example, if an UNLOAD creates 12 files, SVCS_UNLOAD_LOG contains 12 corresponding rows.
This table is visible to all users. Superusers can see all rows; regular users can see only their own data. For more information, see Visibility of Data in System Tables and Views.
Table Columns
| Column Name | Data Type | Description |
|---|---|---|
| userid | integer | The ID of the user who generated the entry. |
| query | integer | The query ID. |
| pid | integer | The process ID associated with the query statement. |
| path | character(1280) | The complete Amazon S3 object path for the file. |
| start_time | timestamp | The start time for the UNLOAD operation. |
| end_time | timestamp | The end time for the UNLOAD operation. |
| line_count | bigint | The number of lines (rows) unloaded to the file. |
| transfer_size | bigint | The number of bytes transferred. |
| file_format | character(10) | The format of unloaded file. |
Sample Query
To get a list of the files that were written to Amazon S3 by an UNLOAD command, you can call an Amazon S3 list operation after the UNLOAD completes; however, depending on how quickly you issue the call, the list might be incomplete because an Amazon S3 list operation is eventually consistent. To get a complete, authoritative list immediately, query SVCS_UNLOAD_LOG.
The following query returns the path name for files that were created by an UNLOAD with for the last query executed:
select query, substring(path,0,40) as path from svcs_unload_log where query = pg_last_query_id() order by path;
This command returns the following sample output:
query | path ------+--------------------------------- 2320 | s3://my-bucket/venue0000_part_00 2320 | s3://my-bucket/venue0001_part_00 2320 | s3://my-bucket/venue0002_part_00 2320 | s3://my-bucket/venue0003_part_00 (4 rows)


SLC Python — July Meetup
Hi Faris!
Zaniac hosting - If you know anyone grades k-8 look for opportunities to enroll them at Zaniac
slcpy.com - Our website
PyLadies - meet first Tuesday of every month at Zaniac.
--------------------------
Name
Where you work
Favorite Animal
-------------------------
SLCPython git hub repository - https://github.com/SLCPython
Agenda/Minutes:
- Round robin introduction (who you are, what you do, favorite animal)
- instruction for how to fork and run slcpy.com
# Both easy_install and pip are python package installers
sudo easy_install pip
pip install virtualenv virtualenvwrapper
Open ~/.bashrc and add the line
source /usr/local/bin/virtualenvwrapper.sh
[virtualenv install](http://virtualenv.readthedocs.org/en/latest/virtualenv.html)
# Now that virtualenv (and virtualenvwrapper) is installed, create a new virtualenv called slcpy
mkvirtualenvwrapper slcpy
workon slcpy
# then go to
cd slcpy.com/requirements
# and run
pip install -r base.txt
pip install -r local.txt
- Civic hacking possibilities
- Coalio - chrome plug-in for flagging bullying posts on social media
- Clean air in Utah - data sets
- Others....
- Raffle


Input here
Escape Apostrophes
Escape Newlines
Output
Convert
Favicon icon made by
Daniel Bruce
from
www.flaticon.com


I was introduced to coding while earning a degree in visual communications. The first time I saw my code become reality in a browser, I knew the path I wanted to take, and I changed majors. The more I learned about the problem-solving aspect of coding, the happier I was about my decision. I'm still passionate about design, but software development fascinates me because I love to be challenged, solve problems, and build things, and coding allows me to build just about anything I can imagine.
magna cum laude
The Maintenance Log is an app for anyone who owns anything that requires maintenance or repairs. Users can create a list of items organized by category. They can store details, notes, model numbers, and repair manuals for the items, and log all of the maintenance and repairs performed on the items. Users can access maintenance details on one item or all items. User authentication and persistent storage allow multiple users to store, create, read, edit, and delete their lists of items, and their maintenance lists.
MowPro is a lawn care management application that allows users to create, read, update, and delete a list of customers, services provided, and jobs performed. It also affords users the ability to upload an image of the job site, see a dynamically generated map of the job site, and create pdf invoices and receipts for the customers, once the job is completed. Additionally, users can keep records of all jobs and sort them by customers who owe and customers who have paid. There is also a search feature that permits users to search all job records by customer name, address, email, phone number, service name, service description, and job notes. I owned and operated a lawn and landscape business for 8 years. One great, yet frustrating aspect of it was getting jobs while working on jobs. When people inquired about services, I had to stop working, walk to my truck, find a piece of paper and a pen, take notes and hope I didn’t lose them before getting back home. I would have absolutely loved to have had this app in my pocket during that time
Welcome to Nashville is an itinerary builder application that allows users to make an itinerary of things to do on a day trip to Nashville. Users can select parks, restaurants, and concerts to see and print the results to take with them. This was a team project I built with Brian Wilson and Bennett Foster. I was individually responsible for the design, and the restaurant module which collected user input, leveraged JSON-Server to ping an external API, displayed search results in the DOM and saved the user's choices.
The Daily Journal was an ongoing project during the front-end course at Nashville Software School. Every new concept learned was implemented in the journal. It was a rewarding project because I actually used the journal. On the days I was feeling defeated, I reflected on all that I had learned in a very short time, and that made me feel better.
Although I spend a large amount of my free time exploring the latest technology advancements in the web development world, I have many other interests.
Apart from being a web developer, I love all things outdoors. I enjoy biking, hiking, camping, and working in my yard. I also enjoy cooking tasty vegan meals, and you can often find me with a power tool in each hand, elbow deep in DIY remodel projects.


Hello, Stucco!
Welcome to your new single-page translator:
- MongoDB is used for data persistance.
- Service is listening on 'mongodb://localhost:27017' (configurable in appsettings.json)
- DB should be entitled 'TranslationsDB' (configurable in appsettings.json)
- Collection should be entitled 'Translations' (configurable in TranslationContext)
- Angular 4.2 is used for client-side code
- Unfortunatelly the provided helper API doesn't translate very well if the from text is with special characters even if encoded (tested with Postman).
- The API seems to be translating OK if letters are latin, thus the output is good even if there are special characters :)


{% extends "base_login.html" %} {% block content %}
Already a member ? Log in
©2016 All Rights Reserved.UI/UX Authoring Tool


What begin as a trickle, soon turned to a shower. Nessie cried and she cried,
she cried by the hour. She cried cups, and pitchers, and bottles, and buckets.
She cried tubs and barrels, quintets and quintuplets. For days Nessie cried, nay,
for weeks on it went. Till one day she sniffed, her tears finally spent.
In surprise she looked up, at MacQuack there, afloat? Dunkin' and bobbin' in what looked like... A moat, nay, 'twas a lake! A great loch! Nessie gasped in delight. Sure 'twas the paradise, with no golf tee in sight!
Nessie learned herself a lesson
on that bright and happy day. And it bears worth repeatin', no matter what folks may
say. Don't ever be afraid to cry, it really is okay.
Sometimes it's through our tears,
we find a better way. As for Nessie, and MacQuack, well, they're still there, I guess.
Forever playing hide and seek, all along Loch Ness.


Search Collector Demo
This example demonstrates the use of the search-collector
library.
Checkout the collector-integration.js
file for the example implementation based on data-* attributes and the window attached bundle.
For a template using es6 modules and a build tool checkout our
blueprint
project.
Usage
- Search for any search phrase
- Click a product
- Put it into the basket
- Repeat as many times you wish
- Proceed to the checkout
- Analyze all tracked events
- Clear the event data


Jerry Sandusky is resentenced to 30 to 60 years in prison, same as before, in Penn State child ...
by EndPlayBELLEFONTE, Pa. - BELLEFONTE, Pa. (AP) - Jerry Sandusky is resentenced to 30 to 60 years in prison, same as before, in Penn State child sex abuse case.


{% set pageTitle = "Do you need to leave your home to go to work?" %} {% set mainClasses = "nhsuk-main-wrapper--s" %} {% set version = "v1" %} {% extends "layout.html" %} {% block backLink %}


--- layout: wrapper --- {% include landing.html %} {% include banner.html %} {% include scrolltop.html %}


{{ error }}
Payment successfully sent.
Transaction ID: {{ txp?.txid }}
Are you sure you want to send {{ amountInMrt }} MRT to Merit escrow?
Fee: {{ fee }} MRT
Total: {{ fee + amountInMrt }} MRT
{{ error }}
Payment successfully sent.
Transaction ID: {{ txp?.txid }}
Fee: {{ fee }} MRT
Total: {{ fee + amountInMrt }} MRT


|
MindScape
1.0
MindScape é um jogo plataforma com elementos de terror e suspense. Como o jogo se situa na mente da protagonista, há monstros surreais que são criados com base em seus medos.
|
A keyboard's event class. More...
#include <keyboard_event.hpp>
Public Member Functions | |
| KeyboardEvent (unsigned timestamp, State key_state, unsigned pressed_key, bool p_was_repeated=false) | |
| State | state () const |
| Key | key () const |
| Modifier | modifier () const |
| bool | repeated () const |
| Public Member Functions inherited from engine::Event | |
| Event (unsigned t) | |
| unsigned | timestamp () const |
| void | set_timestamp (unsigned t) |
Static Public Attributes | |
| static KeyMap | keymap |
A keyboard's event class.
A class which has all the enums and types necessaries for handling keyboard events.


Functions to perform the reliability/survival analysis using a parametric Transform-both-sides (TBS) model.
| Version: | 1.3 |
| Depends: | R (≥ 3.3.0) |
| Imports: | normalp, survival, mcmc, R.utils, coda, Rsolnp, BMS |
| Published: | 2017-01-05 |
| Author: | Adriano Polpo, Cassio de Campos, D. Sinha, Stuart Lipsitz, Jianchang Lin TBSSurvival author details |
| Maintainer: | Cassio de Campos <cassiopc at acm.org> |
| License: | GPL (≥ 3) |
| URL: | http://code.google.com/p/tbssurvival/ |
| NeedsCompilation: | no |
| Citation: | TBSSurvival citation info |
| Materials: | README |
| In views: | Survival |
| CRAN checks: | TBSSurvival results |
| Reference manual: | TBSSurvival.pdf |
| Vignettes: |
TBSSurvival |
| Package source: | TBSSurvival_1.3.tar.gz |
| Windows binaries: | r-devel: TBSSurvival_1.3.zip, r-release: TBSSurvival_1.3.zip, r-oldrel: TBSSurvival_1.3.zip |
| OS X binaries: | r-release: TBSSurvival_1.3.tgz, r-oldrel: TBSSurvival_1.3.tgz |
| Old sources: | TBSSurvival archive |
Please use the canonical form https://CRAN.R-project.org/package=TBSSurvival to link to this page.


Country:
Active cases:
Deaths:
Total recovered:
Last updated:
Total cases:
New active cases:
New deaths:
New recovered:
Death percentage:


Your browser doesn't support the features required by impress.js, so you are presented with a simplified version of this presentation.
For the best experience please use the latest Chrome, Safari or Firefox browser.
Getting Started with Windows Server Containers.

This guarantees that the software
will
run the same, everytime.
Wait, i'm not a developer!
Docker can act as a learning gateway and abstract complexity.
Let's talk about how this
works*
You can think of Docker as the next level to the Virtual Machine.
Just like the Virtual Machine cut into the the Physical Machine market
Open Source
PowerShell
Docker CLI
You have most likely been using Docker and not even knowing it.
Docker uses the concept of Images, that are stored in a
repository and are shareable between the community.
this is one of the fundamental tools of the DevOps toolkit.
Microsoft LOVES Linux!
1 in 3 workloads in Azure are running a Linux distribution.
Let's Demo how this all works!


{% extends "partials/_layout.html" %} {% block title %} Bible :: {% endblock title %} {% block body %} Books of the Bible Start reading the Bible to improve your knowledge of the scriptures Old Testament ({{ old_books.count }}) {% for verse in old_books %} {{ verse.book }} {% endfor %} New Testament ({{ new_books.count }}) {% for verse in new_books %} {{ verse.book }} {% endfor %} {% endblock body %}
Start reading the Bible to improve your knowledge of the scriptures
{{ verse.book }}


Learn HTML & CSS
I learnt the basis of HTML5 & CSS2-CSS3 in a course in 2013/2014, but you can do it from scratch with a lot of online resources. I found a very good article From zero to Front-end hero where it explains how to start and keep learning HTML & CSS:
- Getting started:
- Beginning courses:
- Advanced course:
Written on June 18, 2016


HOW TO PLAY?
JUST USE YOUR ARROW-KEYS
DIFFICULTY:
EASY
MEDIUM
HARD
MODUS:
ThirdPerson
FirstPerson
WELL PLAYED!
YOUR SCORE:
1000
Turn your device to start game!
Click here to start game:
play_arrow
play_arrow
help
settings
DIFFICULTY: MEDIUM
SCORE:
0
LENGTH:
3


?6
7
8
9
10
SgÈ*
The
New
York
copyright
reserved
Botanical
Garden
The
New
York
Botanical
Garden
T
/
¥
/-/
*r?
À
.
/
o
I
f
£u#\t
k
DOMINICAN
REPUBLIC
prov.
San
Juan
^£W
Vo.
BOTANICAL
Á†
NEW
YORK
BOTANICAL
GARDEN
0
334354
<0>IMAGED
Buchnera
elongata
Sw.
Lavender
flowered
herb
of
hillsides
in
pine
woods.
Plant
mixed
in
with
Pteridium.
Piedra
del
Aguacate.
Coll.
R.
A.
&
E.
S.
Howard
9350
Sept.
9
1943
01334354
Legend -
Level of confidence that token is an accurately-transcribed word
extremely low
very low
low
undetermined
medium
high
very high