This page explains what types of experiments exist and how to run them.
In this step, all considered preseration actions are applied to all sample objects, and the outcomes are documented in detail.Correspondingly, this page provides a list of considered preservation actions at the top, similar to the view at Develop experiment. The difference is that for preservation action services, you will find a little play button like in a multimedia player:
Clicking this button will bring up a modal window for running the selected service. Clicking the green arrow in that window starts the experiments:
Clicking the green checkmark closes the window.
The experiment status as indicated by the icons can be one of the following:
-
means the experiment has failed.
-
means the experiment has not been executed yet.
-
means the experiment has not executed successfully.
You can run all automated actions at once using the button at the bottom:
If you have been running actions that use quality-aware services,
such as minimee services, you will find a new link saying Show
migration result metadata below this button after the experiments
have finished.
Activating it displays the measurements
obtained from these services in a separate windows.
The lower part of the screen contains the results of experiments, i.e. the resulting files after the experiments have been run. (eg. for migration the migrated files). For migration web services that are executed by the planning tool, these files we be retrieved automatically. For all experiments that you are carrying out yourself, please upload all resulting files and documentation here.


Before Change
if resp.status == 200:
job_resource = json.loads(content)
service = get_service()
poll_job(service, **job_resource["jobReference"])
print("Success!")
else:
print("Http error code: {}".format(resp.status))
// [END main]
After Change
def main(project_id, dataset_id, table_name, schema_path, data_path):
credentials = GoogleCredentials.get_application_default()
http = credentials.authorize(httplib2.Http())
bigquery = discovery.build("bigquery", "v2", credentials=credentials)
with open(schema_path, "r") as schema_file:
schema = schema_file.read()
with open(data_path, "r") as data_file:
data = data_file.read()
resp, content = make_post(
http,
schema,
data,
project_id,
dataset_id,
table_name)
if resp.status == 200:
job = json.loads(content)
poll_job(bigquery, job)
print("Success!")
else:
print("Http error code: {}".format(resp.status))
// [END main]


First level
Second level
A
paragraph
with
some text
An important paragraph
A centered paragraph
Third level
First level again
First level again
First level again
Item 1
Item 2
sub item
sub item
Item 3
Item 4
Here is my multiple lines of text


WWF's goal is to : Build a future where people live in harmony with nature.
WWF's goal is to :
Build a future where people live in harmony with nature.
The WHO whas founded in 1948
Written by NVS.The Scream by EM. Painted in 1893.(Đây là trích dẫn cho bức ảnh ở trên)
This text will be written from right to left


1. This is a long string that is OK to truncate please and thank you
2. This is a long string that is OK to truncate please and thank you
3. This is a long string that is OK to truncate please and thank you


The browser is connected to the vert.x event bus and interact with the services using the event bus.
The browser retrieves the result from the API Gateway invoking all the services (in parallel) and aggregating the results. The API Gateway interacts with the services using the vert.x event bus.
The browser is connected to the vert.x event bus. It sends a message to Hello
, sending a
message to Hola
and so on. The result is computed using replies
.


public interface PartialComparator
DatabaseConfig.setBtreeComparator(java.util.Comparator)
or
DatabaseConfig.setBtreeComparator(Class)
, and
DatabaseConfig.setDuplicateComparator(java.util.Comparator)
or
DatabaseConfig.setDuplicateComparator(Class)
.
As described in the javadoc for these methods, a partial comparator is a comparator that allows for the keys of a database to be updated, but only if the updates are not significant with respect to uniqueness and ordering. Also described is the fact that comparators must be used with great caution, since a badly behaved comparator can cause B-tree corruption.
Even greater caution is needed when using partial comparators, for several reasons. Partial comparators are normally used for performance reasons in certain situations, but the performance trade-offs are very subtle and difficult to understand. In addition, as of JE 6, this tag interface must be added to all partial comparator classes so that JE can correctly perform transaction aborts, while maintaining the last committed key or duplicate data values properly. In addition, for a database with duplicates configured, a partial comparator (implementing this tag interface) will disable optimizations in JE 6 that drastically reduce cleaner costs.
For these reasons, we do not recommend using partial comparators, although they are supported in order to avoid breaking applications that used them prior to JE 6. Whenever possible, please avoid using partial comparators.
Copyright (c) 2002, 2017 Oracle and/or its affiliates. All rights reserved.


ColorProtocol
public protocol ColorProtocol
The ColorProtocol
protocol exposes the methods and properties of an underlying CoglColor
instance.
The default implementation of these can be found in the protocol extension below.
For a concrete class that implements these methods and properties, see Color
.
Alternatively, use ColorRef
as a lighweight, unowned
reference if you already have an instance you just want to use.
A structure for holding a color definition. The contents of the CoglColor structure are private and should never by accessed directly.
-
Untyped pointer to the underlying
CoglColor
instance.Declaration
Swift
var ptr: UnsafeMutableRawPointer { get }
-
color_ptr
Default implementationTyped pointer to the underlying
CoglColor
instance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
CoglColor
instance.Declaration
Swift
var color_ptr: UnsafeMutablePointer<CoglColor> { get }
-
copy()
Extension methodCreates a copy of
color
Declaration
Swift
func copy() -> UnsafeMutablePointer<CoglColor>!
-
free()
Extension methodFrees the resources allocated by
cogl_color_new()
andcogl_color_copy()
Declaration
Swift
func free()
-
getAlpha()
Extension methodRetrieves the alpha channel of
color
as a fixed point value between 0 and 1.0.Declaration
Swift
func getAlpha() -> CFloat
-
getAlphaByte()
Extension methodRetrieves the alpha channel of
color
as a byte value between 0 and 255Declaration
Swift
func getAlphaByte() -> CUnsignedChar
-
getAlphaFloat()
Extension methodRetrieves the alpha channel of
color
as a floating point value between 0.0 and 1.0Declaration
Swift
func getAlphaFloat() -> CFloat
-
getBlue()
Extension methodRetrieves the blue channel of
color
as a fixed point value between 0 and 1.0.Declaration
Swift
func getBlue() -> CFloat
-
getBlueByte()
Extension methodRetrieves the blue channel of
color
as a byte value between 0 and 255Declaration
Swift
func getBlueByte() -> CUnsignedChar
-
getBlueFloat()
Extension methodRetrieves the blue channel of
color
as a floating point value between 0.0 and 1.0Declaration
Swift
func getBlueFloat() -> CFloat
-
getGreen()
Extension methodRetrieves the green channel of
color
as a fixed point value between 0 and 1.0.Declaration
Swift
func getGreen() -> CFloat
-
getGreenByte()
Extension methodRetrieves the green channel of
color
as a byte value between 0 and 255Declaration
Swift
func getGreenByte() -> CUnsignedChar
-
getGreenFloat()
Extension methodRetrieves the green channel of
color
as a floating point value between 0.0 and 1.0Declaration
Swift
func getGreenFloat() -> CFloat
-
getRed()
Extension methodRetrieves the red channel of
color
as a fixed point value between 0 and 1.0.Declaration
Swift
func getRed() -> CFloat
-
getRedByte()
Extension methodRetrieves the red channel of
color
as a byte value between 0 and 255Declaration
Swift
func getRedByte() -> CUnsignedChar
-
getRedFloat()
Extension methodRetrieves the red channel of
color
as a floating point value between 0.0 and 1.0Declaration
Swift
func getRedFloat() -> CFloat
-
initFrom4f(red:green:blue:alpha:)
Extension methodSets the values of the passed channels into a
CoglColor
Declaration
Swift
func initFrom4f(red: gfloat, green: gfloat, blue: gfloat, alpha: gfloat)
-
initFrom4fv(colorArray:)
Extension methodSets the values of the passed channels into a
CoglColor
Declaration
Swift
func initFrom4fv(colorArray color_array: UnsafePointer<CFloat>)
-
initFrom4ub(red:green:blue:alpha:)
Extension methodSets the values of the passed channels into a
CoglColor
.Declaration
Swift
func initFrom4ub(red: UInt8, green: UInt8, blue: UInt8, alpha: UInt8)
-
premultiply()
Extension methodConverts a non-premultiplied color to a pre-multiplied color. For example, semi-transparent red is (1.0, 0, 0, 0.5) when non-premultiplied and (0.5, 0, 0, 0.5) when premultiplied.
Declaration
Swift
func premultiply()
-
set(alpha:)
Extension methodSets the alpha channel of
color
toalpha
.Declaration
Swift
func set(alpha: gfloat)
-
setAlphaByte(alpha:)
Extension methodSets the alpha channel of
color
toalpha
.Declaration
Swift
func setAlphaByte(alpha: UInt8)
-
setAlphaFloat(alpha:)
Extension methodSets the alpha channel of
color
toalpha
.Declaration
Swift
func setAlphaFloat(alpha: gfloat)
-
set(blue:)
Extension methodSets the blue channel of
color
toblue
.Declaration
Swift
func set(blue: gfloat)
-
setBlueByte(blue:)
Extension methodSets the blue channel of
color
toblue
.Declaration
Swift
func setBlueByte(blue: UInt8)
-
setBlueFloat(blue:)
Extension methodSets the blue channel of
color
toblue
.Declaration
Swift
func setBlueFloat(blue: gfloat)
-
setFrom4f(red:green:blue:alpha:)
Extension methodSets the values of the passed channels into a
CoglColor
set_from_4f is deprecated: Use cogl_color_init_from_4f instead.
Declaration
Swift
@available(*, deprecated) func setFrom4f(red: gfloat, green: gfloat, blue: gfloat, alpha: gfloat)
-
setFrom4ub(red:green:blue:alpha:)
Extension methodSets the values of the passed channels into a
CoglColor
.set_from_4ub is deprecated: Use cogl_color_init_from_4ub instead.
Declaration
Swift
@available(*, deprecated) func setFrom4ub(red: UInt8, green: UInt8, blue: UInt8, alpha: UInt8)
-
set(green:)
Extension methodSets the green channel of
color
togreen
.Declaration
Swift
func set(green: gfloat)
-
setGreenByte(green:)
Extension methodSets the green channel of
color
togreen
.Declaration
Swift
func setGreenByte(green: UInt8)
-
setGreenFloat(green:)
Extension methodSets the green channel of
color
togreen
.Declaration
Swift
func setGreenFloat(green: gfloat)
-
set(red:)
Extension methodSets the red channel of
color
tored
.Declaration
Swift
func set(red: gfloat)
-
setRedByte(red:)
Extension methodSets the red channel of
color
tored
.Declaration
Swift
func setRedByte(red: UInt8)
-
setRedFloat(red:)
Extension methodSets the red channel of
color
tored
.Declaration
Swift
func setRedFloat(red: gfloat)
-
toHsl(hue:saturation:luminance:)
Extension methodConverts
color
to the HLS format.The
hue
value is in the 0 .. 360 range. Theluminance
andsaturation
values are in the 0 .. 1 range.Declaration
Swift
func toHsl(hue: UnsafeMutablePointer<CFloat>, saturation: UnsafeMutablePointer<CFloat>, luminance: UnsafeMutablePointer<CFloat>)
-
unpremultiply()
Extension methodConverts a pre-multiplied color to a non-premultiplied color. For example, semi-transparent red is (0.5, 0, 0, 0.5) when premultiplied and (1.0, 0, 0, 0.5) when non-premultiplied.
Declaration
Swift
func unpremultiply()
-
initFromHsl(hue:saturation:luminance:)
Extension methodConverts a color expressed in HLS (hue, luminance and saturation) values into a
CoglColor
.Declaration
Swift
func initFromHsl(hue: gfloat, saturation: gfloat, luminance: gfloat)
-
clear(buffers:)
Extension methodClears all the auxiliary buffers identified in the
buffers
mask, and if that includes the color buffer then the specifiedcolor
is used.clear is deprecated: Use cogl_framebuffer_clear() api instead
Declaration
Swift
@available(*, deprecated) func clear(buffers: CUnsignedLong)
-
colorInitFromHsl(hue:saturation:luminance:)
Extension methodConverts a color expressed in HLS (hue, luminance and saturation) values into a
CoglColor
.Declaration
Swift
func colorInitFromHsl(hue: gfloat, saturation: gfloat, luminance: gfloat)
-
setFog(mode:density:zNear:zFar:)
Extension methodEnables fogging. Fogging causes vertices that are further away from the eye to be rendered with a different color. The color is determined according to the chosen fog mode; at it’s simplest the color is linearly interpolated so that vertices at
z_near
are drawn fully with their original color and vertices atz_far
are drawn fully withfog_color
. Fogging will remain enabled until you callcogl_disable_fog()
.The fogging functions only work correctly when primitives use unmultiplied alpha colors. By default Cogl will premultiply textures and cogl_set_source_color()
will premultiply colors, so unless you explicitly load your textures requesting an unmultiplied internal format and usecogl_material_set_color()
you can only use fogging with fully opaque primitives. This might improve in the future when we can depend on fragment shaders.set_fog is deprecated: Use #CoglSnippet shader api for fog
Declaration
Swift
@available(*, deprecated) func setFog(mode: FogMode, density: gfloat, zNear z_near: gfloat, zFar z_far: gfloat)
-
setSourceColor()
Extension methodThis is a convenience function for creating a solid fill source material from the given color. This color will be used for any subsequent drawing operation.
The color will be premultiplied by Cogl, so the color should be non-premultiplied. For example: use (1.0, 0.0, 0.0, 0.5) for semi-transparent red.
See also
cogl_set_source_color4ub()
andcogl_set_source_color4f()
if you already have the color components.set_source_color is deprecated: Latest drawing apis all take an explicit #CoglPipeline argument so this stack of #CoglMaterial<!– –>s shouldn’t be used.
Declaration
Swift
@available(*, deprecated) func setSourceColor()
-
alpha
Extension methodRetrieves the alpha channel of
color
as a fixed point value between 0 and 1.0.Declaration
Swift
var alpha: CFloat { get nonmutating set }
-
alphaByte
Extension methodRetrieves the alpha channel of
color
as a byte value between 0 and 255Declaration
Swift
var alphaByte: CUnsignedChar { get nonmutating set }
-
alphaFloat
Extension methodRetrieves the alpha channel of
color
as a floating point value between 0.0 and 1.0Declaration
Swift
var alphaFloat: CFloat { get nonmutating set }
-
blue
Extension methodRetrieves the blue channel of
color
as a fixed point value between 0 and 1.0.Declaration
Swift
var blue: CFloat { get nonmutating set }
-
blueByte
Extension methodRetrieves the blue channel of
color
as a byte value between 0 and 255Declaration
Swift
var blueByte: CUnsignedChar { get nonmutating set }
-
blueFloat
Extension methodRetrieves the blue channel of
color
as a floating point value between 0.0 and 1.0Declaration
Swift
var blueFloat: CFloat { get nonmutating set }
-
green
Extension methodRetrieves the green channel of
color
as a fixed point value between 0 and 1.0.Declaration
Swift
var green: CFloat { get nonmutating set }
-
greenByte
Extension methodRetrieves the green channel of
color
as a byte value between 0 and 255Declaration
Swift
var greenByte: CUnsignedChar { get nonmutating set }
-
greenFloat
Extension methodRetrieves the green channel of
color
as a floating point value between 0.0 and 1.0Declaration
Swift
var greenFloat: CFloat { get nonmutating set }
-
red
Extension methodRetrieves the red channel of
color
as a fixed point value between 0 and 1.0.Declaration
Swift
var red: CFloat { get nonmutating set }
-
redByte
Extension methodRetrieves the red channel of
color
as a byte value between 0 and 255Declaration
Swift
var redByte: CUnsignedChar { get nonmutating set }
-
redFloat
Extension methodRetrieves the red channel of
color
as a floating point value between 0.0 and 1.0Declaration
Swift
var redFloat: CFloat { get nonmutating set }


Open Angel Arena 3.13.4 Update
For readability purposes ONLY!
General Changes
Reduced poop ward detection radius from 200 to 150.
Reduced boss leash range from 1500 to 1200 (to prevent Roshan fountain pull).
Increased starting gold from 625 to 825.
Changed upgrade core costs (this is purely for spectator reasons.)
Hero Changes
Alchemist:
Greevil's Greed gold bonus cap removed.
Greevil's Greed extra bonus gold per stack increased from 4 to 4/8/12/16/32/64.
Anti-Mage:
Mana Void AoE reduced from 500 to 300.
Fights in OAA are often more clumped than in regular Dota, making hitting more heroes easier. This makes it harder again.
Blink range decreased from 925/1000/1075/1150/1450/1900 to 925/1000/1075/1150/1225/1300.
Spell Shield magic resistance decreased from 20/30/40/50/60/70% to 10/20/30/40/50/60%.
Spell Shield (with Aghanim Scepter) spell block/reflect cooldown increased from 12 to 15 seconds.
Arc Warden:
Spark Wraith damage increased from 100/160/220/280/560/880 to 150/225/300/375/775/1175.
Axe:
Culling Blade kill threshold increased from 250/325/400/775/1150 to 350/550/750/1050/1450.
Batrider:
Firefly damage per second increased from 10/30/50/70/170/270 to 20/40/60/80/180/280.
Flamebreak damage per second increased from 25/30/35/40/65/90 to 25/35/45/55/95/135.
Flaming Lasso cooldown reduced from 100/80/60/60/60 to 60 seconds at all levels.
Beastmaster:
Call of the Wild: Boar HP increased from 275/350/425/500/1000/3000 to 275/350/425/500/2500/5000.
Call of the Wild: Boar attack damage increased from 20/30/40/50/150/500 to 20/30/40/50/250/500.
Damage values are lower actually: 16/24/32/40/250/500
Call of the Wild: Hawk vision improved.
Wild Axes damage per axe increased from 30/60/90/120/270/420 to 40/80/120/160/360/560.
Bounty Hunter:
Track self bonus gold increased from 500/1000/1500/3000/4500 to 1000/2000/3000/6000/9000.
Track allies bonus gold increased from 250/500/750/1500/2250 to 500/1000/1500/3000/4500.
Shadow Walk duration changed from 20/25/30/35/45/85 to 30 seconds at all levels.
Brewmaster:
Primal Split level 5 duration decreased from 25 to 24 seconds.
Primal Split's Earth level 4 attack damage increased from 145-155 to 245-255.
Primal Split's Earth level 4 HP increased from 4500 to 8000.
Primal Split's Earth level 5 attack damage increased from 385-395 to 585-595.
Primal Split's Earth level 5 HP increased from 10500 to 15000.
Primal Split's Fire level 4 BAT improved from 1.35 to 1.05
Primal Split's Fire level 4 attack damage increased from 235-245 to 335-345.
Primal Split's Fire level 4 HP increased from 2600 to 4000.
Primal Split's Fire level 5 BAT improved from 1.35 to 0.75
Primal Split's Fire level 5 attack damage increased from 555-565 to 655-665.
Primal Split's Storm level 4 attack damage increased from 95-105 to 195-205.
Primal Split's Storm level 4 HP increased from 2800 to 6000.
Primal Split's Storm level 5 attack damage increased from 255-265 to 355-365.
Primal Split's Storm level 5 HP increased from 6400 to 10000.
Broodmother:
Spin Web count (number of charges) rescaled from 2/4/6/8/12/28 to 6/8/10/12/14/16.
Centaur Warrunner:
Hoof Stomp stun duration decreased from 2/2.25/2.5/2.75/2.75/2.75 to 1.75/2.0/2.25/2.5/2.5/2.5 seconds.
Chaos Knight:
Chaos Bolt max damage increased from 200/225/250/275/325/525 to 200/225/250/275/425/575.
Phantasm cooldown reduced from 145 to 100 seconds.
Phantasm cooldown (with Aghanim Scepter) reduced from 110 to 70 seconds.
Phantasm mana cost reduced from 125/200/275/625/1025 to 125/200/275/475/675.
Chen:
Holy Persuasion minimum base health increased from 700/800/900/1000/5000/10000 to 700/1400/2100/2800/5000/10000.
Hand of God cooldown reduced from 160/140/120/115/110 to 80 seconds at all levels.
Clinkz:
Strafe attack speed bonus decreased from 110/160/210/260/320/380 to 80/130/180/230/280/330.
Clockwerk:
Battery Assault cooldown reduced from 32/28/24/20/20/20 to 20 seconds at all levels.
Hookshot cooldown reduced from 70/55/40/40/40 to 40 seconds at all levels.
Crystal Maiden:
Crystal Nova damage increased from 130/170/210/260/520/780 to 130/200/270/340/740/1140.
Crystal Nova cooldown decreased from 11/10/9/8/8/8 to 8 seconds at all levels.
Dazzle:
Poison Touch no longer scales in number of targets. Number of targets is 8 at all levels.
Shadow Wave number of bounces reduced from 3/4/5/6/8/16 to 2/3/4/5/6/7.
Shadow Wave damage/heal increased from 80/100/120/140/310/480 to 80/120/160/200/400/600.
Dragon Knight:
Dragon Blood bonus hp regeneration increased from 4/6/8/10/20/30 to 6/8/10/12/24/36.
Dragon Blood bonus armor increased from 3/6/9/12/26/42 to 6/9/12/15/30/45.
Elder Dragon Form (level 4) Draconic Rage chance increased from 20% to 40%.
Drow Ranger:
Marksmanship agility bonus increased from 40/60/80/180/280 to 40/80/120/200/280.
Earth Spirit:
Boulder Smash damage increased from 50/100/150/200/450/700 to 75/150/225/300/675/1050.
Stone Remnant charge replenish time decreased from 30 to 20 seconds.
Magnetize damage per second increased from 50/75/100/225/350 to 50/100/150/350/550.
Earthshaker:
Echo Slam echo search radius improved from 600 to 800.
Echo Slam damage radius improved from 600 to 800.
Echo Slam cooldown decreased from 150/130/110/105/100 to 100 seconds at all levels.
Fissure damage rescaled from 110/160/210/260/610/960 to 110/170/230/290/620/950.
Faceless Void:
Chronosphere cooldown decreased from 140/130/120/100/90 to 120/110/100/90/80 seconds.
Legion Commander:
Moment of Courage cooldown reduced from 2.3/1.8/1.3/0.8/0.8/0.8 to 0.8 seconds at all levels.
Lina:
Light Strike Array damage increased from 80/120/160/200/400/600 to 80/120/160/200/500/800.
Fiery Soul bonus movement speed per stack rescaled from 5/6/7/8/10/18% to 7/9/11/13/15/17%.
Luna:
Moon Glaives number of bounces reduced from 1/2/3/6/7/8 to 1/2/3/4/5/6.
Moon Glaives damage reduction per bounce reduced from 35/35/35/35/30/25% to 25% at all levels.
Lunar Blessing attack damage bonus increased from 14/22/30/38/78/120 to 14/28/42/56/112/168.
Lunar Blessing night vision bonus increased from 250/500/750/1000/1200/1400 to 250/500/750/1000/1250/1500.
Medusa:
Mana Shield damage absorbed per mana decreased from 1.6/1.9/2.2/2.5/4.1/5.7 to 1.6/1.9/2.2/2.5/4.0/5.5
Meepo:
Disabled Meepo in all game modes for pressing ceremonial reasons.
Mirana:
Sacred Arrow level 6 base damage reduced from 1200 to 1120.
Sacred Arrow max bonus damage rescaled from 140 to 100/175/250/300/500/700.
Leap charge replenish time decreased from 60/50/40/30/25/20 to 30 seconds at all levels.
Monkey King
Disabled Monkey King in all game modes for pressing ceremonial reasons.
Nyx Assassin:
Mana Burn cooldown reduced from 28/20/12/4/4/4 to 4 seconds at all levels.
Ogre Magi:
Bloodlust bonus movement speed rescaled from 10/12/14/16/20/36% to 20/22/24/26/30/34%.
Bloodlust self attack speed bonus increased from 30/50/70/90/130/180 to 50/70/90/110/150/190.
Ignite move speed slow increased from 20/22/24/26/30/35% to 30/32/34/36/40/45%.
Outworld Devourer:
Arcane Orb damage type changed from Physical to Magical damage.
Phantom Lancer:
Disabled Phantom Lancer in all game modes for pressing ceremonial reasons.
Phoenix:
Supernova hero attacks to destroy increased from 5/8/11/14/17 to 7/10/13/16/19 (9/12/15/18/21 with Aghanim Scepter).
Puck:
Dream Coil initial stun duration increased from 0.5 to 1.5 seconds.
Queen of Pain:
Shadow Strike move speed slow increased from 20/30/40/50/55/60% to 35/40/45/50/55/60%.
Shadow Strike cast range from 450/500/550/600/650/700 to 500/550/600/650/700/750.
Razor:
Unstable Current bonus movement speed increased from 4/8/12/16/32/50% to 10/15/20/25/30/40%.
Sand King:
Burrowstrike cast range increased from 350/450/550/650/675/700 to 450/525/600/650/675/700.
Sand Storm cooldown reduced from 34/26/18/10/10/10 to 10 seconds at all levels.
Shadow Shaman:
Ether Shock number of targets increased from 3/4/5/6/8/10 to 10 at all levels.
Mass Serpent Ward cooldown reduced from 120 to 60 seconds at all levels.
Skywrath Mage:
Ancient Seal duration reduced from 3/4/5/6/7/8 to 2/3/4/5/6/7 seconds.
Slardar:
Bash of the Deep proc chance inscreased from 10/15/20/25/25/25% to 25% at all levels.
Sniper:
Headshot proc chance reduced from 40% to 35%.
Sohei:
Momentum crit damage increased from 120/130/140/150/160/175% to 130/140/150/160/170/185%.
Spirit Breaker:
Greater Bash move speed as damage percent increased from 12/24/36/48/108/168% to 30/60/90/120/180/300%.
Nether Strike cooldown reduced from 100/80/60/60/60 to 60 seconds at all levels.
Timbersaw:
Chakram damage per second rescaled from 50/75/100/250/400 to 50/100/150/250/400.
Tiny:
Tree grab splash damage increased from 30/40/50/60/80/100% to 100% at all levels.
Grow attack damage bonus increased from 30/45/60/120/180 to 30/60/90/150/270.
Treant Protector:
Living Armor cooldown reduced 30/24/18/12/12/12 to 12 seconds at all levels.
Troll Warlord:
Berserker's Rage bonus armor set to 6 at all levels.
Berserker's Rage bash duration reduced from 0.6/0.8/1/1.2/1.4/1.6 to 0.5/0.65/0.8/0.951.1/1.25 seconds.
Tusk:
Ice Shards damage increased from 60/120/180/240/540/840 to 75/150/225/300/675/1050.
Ice Shards cooldown reduced from 23/20/17/14/14/14 to 20/18/16/14/14/14 seconds.
Underlord:
Highway to Hell cast range increased from 1800/2400/3000/3600/4200 to 3000/3600/4200/4800/5400.
Venomancer:
Poison Sting damage increased from 6/14/22/30/70/110 to 10/20/30/40/70/110.
Poison Sting duration increased from 6/9/12/15/15/15 to 15 seconds at all levels.
Poison Nova cooldown reduced from 140/120/100/100/100 to 80 seconds at all levels.
Poison Nova cooldown (with Aghanim Scepter) reduced from 140/120/60/60/60 to 40 seconds at all levels.
Witch Doctor:
Death Ward damage increased from 60/105/150/675/1200 to 60/120/200/700/1200.
Previous
Home
Next


| DOSE: |
2 hits |
oral |
LSD |
(gel tab) |
12:42
Two hits of acid, reportedly weak ones, consumed. mm, gelatinthings. They taste funny. I thought they were friggin' plastic at first! I was like... 'durrh? How's this supposed to work???' Then it dissolved.
1:05
I'm hungry. I think I will nibble on something.
1:15
Yay! Mama's homemade rice gruel!  I feel different, though I am at a loss to describe exactly how. It is as if I'm me, but I'm not me. I suppose the philosophical implications are that either I am undergoing a change in state of mind or I am undergoing a change in dimensional occupation. Somehow, I like thinking about the change in dimensional occupation. Why?  I don't know. I'm noticing a rather definite change in the space around me and the method in which it is being processed through my head. I mean, everything's still there and where it should be, it's just the relative identification my mind has with is... drifting somewhere. Wait, that was terrible. It's... changing. Yes. No. Argh.
1:37
Motion is as it is supposed to be, but my ultimate perception of it is defying explanation. In techie terms, the end user is misreading the EULA (End User License Agreement), the lawyer defining it is a pothead, and the lawyer that wrote it is probably a crackhead. Yeah. The telephone game at its finest. 'Mm-mm good!' turns into 'O RLY?' by the time I hear the last guy say it. Besides that, my initial impressions are good. Amusing. Why bother to do something if it does not serve a purpose, yes? When the purpose is fun, it is technically devoid of meaning and, simultaneously, full of it. With that in mind, is there anything that is truly devoid of meaning? Any given action we have. Even if we consider the seemingly pointless and shallow actions of, say, Paris Hilton (may she burn forever). Is any of it truly meaningless? Purpose in purposelessness. Intriguing concept, is it not? I could probably write of this for days, but I shall not bore you.
1:55
As the effects intensify, I am forced to grin at the possible futility of logging my experience. The very basis of all of my perception is being altered in what seems to be a systematic desynchronization of interneural communication. The keyboard seems to shift with every mental waver, but it does not. My muscle memory retains its integrity, and allows me to type with barely a blink of effort. I've been noticing a mild tremor or jitteriness in just about every skeletal muscle group I know about. The last time this occurred, Ecstasy had worked on me for the first time (details later, I suppose). I would say the trembling is anticipatory, but that does not seem to be the case. Rather, it appears to be a reflexive adrenal outburst in response to an unknown (and possibly dangerous) situation. Rest assured I am fully alert, though I cannot promise the integrity of my feedback on... anything, really.
2:02
The computer screen appears to have turned a mild, but no less dazzling array of colors. The text appearing onscreen is practically meaningless. I hardly want to look at it. Far more fascinating are my fingers, which dance a song unheard of in any human land in any human tongue.
What I am appearing to experience is a complete and utter defiance of every physical law I was told was fundamentally irrefutable. Obviously, these people have never done acid in their lives.
2:08
I think I'm still making sense, but I am... not entirely sure of this anymore. I made one statement with the perception of two... states. Think Gollum from Lord of the Rings, except as a coin flipping so fast I can barely identify which side is where. Fascinating. This idea is... somehow a revelation to me. The image of a coin... It's all in my head, too...
2:15
I was completely and utterly enthralled and entertained by nothing. I spent a few minutes just laughing. I think after a few seconds, I was laughing at the fact that I was laughing. Because laughing is infectious... and I cannot deny that when someone bursts out laughing for no apparent reason, that in and of itself, is worthy of a laugh. May laughter consume our world, then!
...no. It doesn't work that way. Though I may wear a silly smile on my face, I harbor a bitterness towards mankind many people will never know, and that is probably for the better.
What upsets me is not the pointlessness of it all-- no. I already have that internal debate as to whether or not anything is truly pointless or meaningless. What upsets me about mankind is the needlessness of it. Let me say that again.
Needlessness.
Call it a vicious appraisal, call it contempt for the greater good, call it what you like... but the things that man has suffered at the hands of man... the things that animals have suffered at the hands of man...
There was never any need for it.
Never.
Needless violence. The only violence one need engage in is the violence requisite of ensuring one's own survival. Anything past that is as I've said: needless.
Beyond survival. Let's discuss that. What does that mean? It means... more than I need to do to survive. It means... I'm kinda full, but I'd like to have a little more.
The violence involved in the rise of all these great empires which we are so quick to revere is all invariably condemnable by man's own standards. Man's own standards. That's the punchline.  All these heroes... they were born in strife and made by horror, not this brazen glory we paint them in... not these ridiculous renderings of marble, gold, and brass...
How much glory could I possibly bestow Jesus Christ in that tiny little gold necklace of mine? How much love can I possibly depict in one gesture that I would so rightfully call myself a child of God, that I truly know his intentions and can speak his mind?
2:25
...I digress. It seems I've lost myself in a little swirl of anger. Yes, that happens sometimes. Then again, I am here for the trip, so to speak. I suppose... you're all my passengers-- you being whoever is reading this, of course.
This involuntary trembling-- this shivering... it needs to stop. It's rather unnerving. I have a good idea what is causing it, though I can't say it is of much relief.
2:30
I'm noticing more and more during this experience that I am susceptible to suggestion. ...being a bitter person at heart is one thing, but bringing it up is fuelling the fire. Ha. I probably make no sense. I'm forced to laugh at myself. I'm forced to smile at the preposterous nature of all of this writing-- all of these letters all neatly lined up like they're marching into a slaughterhouse. Mmm... meat...  Really, what is all this? Obviously, speaking as someone who is not within the experience, I would say 'dude... you're tripping. It happens.' when what I should really say is: 'Obviously, you.'
 The best of comebacks are spawned by their point of origin. It makes sense, right now, I swear! You're staring at this like 'WTF, mate?
Why?  BWAAAAAAAAAAAAAHAHAHAHAHAHAHAAAAAAAAAAAAAAAAAAAAAAA
Guess what? There aren't any!  But if I don't know about it, then my lack of knowledge of its existence really makes that question moot, doesn't it?
HA!
Expansion of the mind, this is... Strange (a word that has been appearing a lot), but... I lost my train of thought. Nevermind. It'll come back to me eventually. Like a snake. rar.
2:40
Oh, yes. Acid is definitely an expansion of the mind, and should be used with that purpose in-hand. Needlessly (there's that word again) 'expanding my mind' is ultimately pointless, though the fun involved in it is not. Oh, the decadence of considering needless brain-expansion for fun... It makes me want to put on a brilliant peacock-array of feathers in blue, purple, and green... and vomit.
See, that is what has been upsetting me about mankind. Needlessness. Yes, back to beating on that old, dead horse... Whatever.
Bottom.
Fragment mind.
Unsure.
Fear? Should I intentionally invoke fear? Dare I?
2:50
...Incredibly fascinating. I've found that by digging into my own head I can weave virtual realities and simulated experiences that essentially feel as real as the things I touch to send out this message.
Death. It is many of our ultimate fears. In some cultures, it is a phenomenon to be embraced. In others, such as our arguably more narcissistic and hedonistic American society, it is the ugliest of the ugly. We daren't touch it with a ten foot pole.
As someone who's felt the movement of his hand one too many times... I find it as another unknown... another infinity to explore, much like this one, though attempting to write about it might be a little difficult once I know what it really is like.
I've dug into my own head and explored some of my fears-- darkness and what it portends.
It doesn't help a child's natural fears of the nonexistant beasts beyond the shadows waiting for a barely noticable soul to cross by its macrocosmic path to be consumed. Am I making any sense anymore? I understand that I am not trying to, and this is all... quite hilarious... I must sound like some pretentious goth doing the basement troll thing. Rarrarr.
3:00
This is driving me MAD! I am attempting to pursue my darkness, but I am simultaneously avoiding it for fear of my life. Why? If I am my own darkness, then what is there to fear but that which one instills upon themselves? Does that theoretically mean fear is a moot point? Hmm... ... ... ... With that in mind, what need is there for any aggressive action? It all seems so ludicrous.
All these technologies we develop to kill each other. It really is enough to make me burst out laughing at the hopelessmess of it all. This computer you sit at evolved from a machine that projected the trajectory of a battleship's multi-ton explosive shell so that we humans could put it where it would do the most damage. The irony of the origins of our information superhighway.
And this journal seems to reflect such bitterness.... why? In a way, that in and of itself is pointless. The bitterness at the actions of man. I need not punish myself for foul deeds of others, yet philosophically, we all cut off our noses to spite our faces. That is-- some of us would forsake our conveniences so that we can feel better about ourselves. All these concepts... they are so ludicrous, but as humans, we are so attached to these ideas... these... models...
3:10
Fear. It produces a very distinct 'burning knot' sensation in one's chest. Confronting it feels like fire through the very heart of you. Right now, it is difficult for me to explore, since I am easily distracted. The things that would typically make me cringe--things like rotting veins of flesh on my body-- I can see them when I close my eyes... but I don't feel fear when I see them because I am aware that I am controlling them. It would be redundant to fear the product of one's own mind, but if that were the intention, would that mean I was unsuccessful? Or not entirely, as I continue to flip-flop about this like a dying fish? The images are funny-- hardly fearful.
You're probably asking, 'why fear? Why do you -want- to feel fear? Right now, of all times?  Yeah, I guess that's your answer.
I'm trying to come up with the most terrifying means by which my existence would consume itself... but to no avail. Odd.
Is it because I want to be able to feel real fear without being in real danger? What is this human obsession with being close to that? Because we can barely touch it, perhaps....
...
...
I might be thinking too much...
...Oh my god it hasn't been ten minutes.
 The lovely headswimming details of which, I'm afraid, I must deprive you all... but for the record... this has been a definitively positive experience.
Well, I suppose images of anthropomorphized drugs swimming in pools of liquid of questionable origin will have to suffice.
Without any surprise, I must note this powerful hallucingen's near-miraculous qualities in the right hands while simultaneously remarking on the immutable truth of the following quote: 'with the ability to help comes the ability to harm'.
Anything involving the mind can be thought of as a jigsaw puzzle. All the pieces are there. I just have to pick out the pieces and arrange them myself. Just as this drug can make a mind whole again, it has the ability to completely shatter one. It doesn't really matter whether that happens by my own hands or someone else's, the potential to go in either direction is still there.
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


Teen injured in hit and run in Teaneck, New Jersey
by Eyewitness NewsTEANECK, New Jersey (WABC) -- Police in Teaneck, New Jersey are investigating a hit and run that injured a 14-year-old boy.
He was run over while crossing Teaneck Road just before 6 p.m. Friday. He tells police he was hit by a black SUV that was driven by a middle-aged woman, who then continued driving.
The teen is being treated for non-life threatening injuries.


Setting the Order of Document Columns
How to set the order of columns in the Documents module.
-
- Select the Documents Module Settings tab.
- At Display Columns, perform the following as required:
- Click the Up button to move a column one position up (i.e. one position to the left on the module)
- Click the Down button to move a column one position down (i.e. one position to the right on the module).
- Click the OK button to confirm.
Documents with the columns reordered as shown above


Bus Mall
Instructions
You will be shown three products at a time
Please select the product you would most likely purchase by clicking on the product
After 25 product selections, click on the Submit button to see your results
Submit


{% extends "base.html" %} {% block title %}{{ block.super }} :: Datasets{% endblock %} {% block js %} {% load static %} {% endblock %} {% block content %}
What follows is a collection of graphs and networks used in our experiments and evaluations. The graphs are in the dot format.
| dataset | description | source |
|---|---|---|
| GD collaboration | Co-authorship network for the International Symposiums on Graph Drawing, 1994-2015. The vertices represent the authors with weights corresponding to the total number of papers in the conference. An edge is between two authors if they published at least one paper together; the weight of the edge corresponds to the number of such joint papers. | Computer Science Bibliography |
| SODA collaboration | Co-authorship network for the Symposium on Discrete Algorithms, 1990-2015. | Computer Science Bibliography |
| CHI collaboration | Co-authorship network for the International Conference on Human Factors in Computing Systems, 1990-2014. | Computer Science Bibliography |
| ICML collaboration | Co-authorship network for the International Conference on Machine Learning, 1988-2014. | Computer Science Bibliography |
| KDD collaboration | Co-authorship network for the Knowledge Discovery and Data Mining, 1994-2014. | Computer Science Bibliography |
| TVCG collaboration | Co-authorship network for the IEEE Transactions on Visualization and Computer Graphics, 1995-2015. | Computer Science Bibliography |
| Recipes | Recipe-ingredients contain 381 unique cooking ingredients extracted from 56498 cooking recipes. Edges are weighted based on co-occurrence of the ingredients in the recipes. | Ahn et al., 2011 |
| Trade | The network contains trade relationships between 211 countries. Edges are weighted based on normalized combined import/export between pairs of countries. | |
| Colors | The graph is constructed using the 954 most common RGB monitor colors, as defined by several hundred thousand participants in the xkcd color name survey. The edge-weights are defined by the distance in the RGB space between corresponding pairs. | xkcd.com |
| Books | The network of 3204 popular books. The edges are obtained with a breadth-first traversal following Amazon's "Customers Who Bought This Item Also Bought" links, starting from the root node, George Orwell's 1984. | Gansner et al., 2010 |
| LastFM | The network of 2588 popular bands and musicians crawled from the last.fm system. The edges correspond to similarities between the musicians, as suggested by last.fm. | Gansner et al., 2009 |
| Universities | Network of US universities and their average SAT scores. The vertices are universities and edges are constructed based on their similarities of the admissions data. | Fiske Guide to Colleges |
| ALGO | The network of topics of research papers published in Algorithmica, 1950-2013. The graph contains the prominent words and phrases extracted from the titles of the papers. The edges represent similarities between the topics computed based on their co-occurrence in titles. | MoCS |
| IPL | The network of topics of research papers published in Inf. Process. Lett., 1950-2013. The graph contains the prominent words and phrases extracted from the titles of the papers. The edges represent similarities between the topics computed based on their co-occurrence in titles. | MoCS |
| SOCG | The network of topics of research papers published in the Symposium on Computational Geometry, 1950-2013. The graph contains the prominent words and phrases extracted from the titles of the papers. The edges represent similarities between the topics computed based on their co-occurrence in titles. | MoCS |
| SODA | The network of topics of research papers published in the Symposium on Discrete Algorithms, 1950-2013. The graph contains the prominent words and phrases extracted from the titles of the papers. The edges represent similarities between the topics computed based on their co-occurrence in titles. | MoCS |
| TARJAN | The network of topics of research papers published by Robert Endre Tarjan. The graph contains the prominent words and phrases extracted from the titles of the papers. The edges represent similarities between the topics computed based on their co-occurrence in titles. | MoCS |


Angela's Ashes **
Rated on a 4-star scale Screening venue: Odeon (Liverpool City Centre) Released in the UK by UIP on 14 January, 1999; certificate 15; 145 minutes; countries of origin Ireland/USA; aspect ratio 1.85:1
Directed by Alan Parker; produced by David Brown, Alan Parker, Scott Rudin. Written by Laura Jones, Alan Parker; based on the memoir by Frank McCourt. Photographed by Michael Seresin; edited by Gerry Hambling.
CAST..... Emily Watson..... Angela McCourt Robert Carlyle..... Malachy McCourt Joe Breen..... Young Frank Clarán Owens..... Middle Frank Michael Legge..... Older Frank Andrew Bennett..... Narrator Frank Pauline McLynn..... Aunt Aggie
At first, things did not look good for Frank McCourt. The eldest of six children in a poor Irish family, born in America before his parents made the fatal decision to go back to the old country looking for work, he witnessed three of his siblings die before he was old enough to take his first communion. His family, living in Limerick in the '30s and '40s, had to put up with a flooded house next to a communal lavatory, a city plagued by tuberculosis and a man of the house with a fondness for the drink. Malachy McCourt didn't often have a job, but when he did, the wages were spent on Guinness.
And yet Frank did endure, and prevail. He coped with a no-good father, lunatic teachers and bouts of conjunctivitis and diptheria; then returned to America, got a degree, became a teacher and wrote a pair of best-selling autobiographies, "Angela's Ashes" and "'Tis". The movie rights to Frank's memoirs were quickly snapped up -- unsurprising, as tales of hardship, poverty, misery and escape are just what studios need for their Oscar season prestige releases.
The film of "Angela's Ashes" has been directed by Alan Parker, whose credits make him seem ideal: "The Commitments" was an Irish film, "Bugsy Malone" was filled with wonderful child performances and few big movies are as harsh as "Midnight Express" or "Mississippi Burning". Here, however, he doesn't have so much as a basic grasp on the material -- this should not be the story of Frank McCourt's suffering, but that of his survival, and what should be emphasised is the way he maintained his sanity by using gallows humour and ambitious dreaming. Instead, the movie shows us a series of miserable vignettes, which end with Frank suddenly hopping onto a boat to get away from everything.
There is never any rhythm established; Parker has just filmed all the moments of the book that took place in Limerick and edited them together in a way that keeps jumping ahead but still takes two-and-a-half hours to end. He and his co-writer, Laura Jones, should have taken a look at Steven Spielberg's brilliant adaptation of "The Color Purple", another rambling, episodic novel about growing up in brutal surroundings. It makes clear the main character's wish to reunite with her sister, and uses that ever-present desire as the backbone of the film, to give some significance to everything else that goes on. Here, the scenes in America are over before the opening credits, and we're left with no indication that Frank even remembers the place, let alone that he yearns to go back there more than anything.
The film stars Emily Watson and Robert Carlyle, but even the acting is off. People who are unfamiliar with the source material will still be able to detect which lines are direct quotes -- the performers seem to say them in respectful inverted commas, after solemn dramatic pauses. There is no life here, especially not in the narrator, Andrew Bennett, whose flat, forced, monotonous delivery kills every bit of irony and truth the script assigns him.
"Angela's Ashes" is a terrific production, with realistic period detail and atmospheric photography. But it bewilders me that this is the film Parker, one of the best of all working directors, has been so publicly exerting himself over for the past two years. Perhaps he put so much effort into worrying about getting it right that he forgot to actually do so. Is it a dull waste of time, talent and toil? 'Tis.
COPYRIGHT(c) 2000 Ian Waldron-Mantgani
Please visit, and encourage others to visit, the UK Critic's website, located at http://members.aol.com/ukcritic
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


Largest Marathons for 1954
148 Polytechnic 26 Jun Chiswick ENG 83 Doncaster to Sheffield 19 Apr Sheffield ENG 70 Kosice 10 Oct Kosice SVK 37 Asahi Shimbun 05 Dec Kamakura JPN 22 European Championships 25 Aug Bern SUI 21 French Championships 01 Aug Fontainebleau FRA 10 Beppu Mainichi 07 Feb Beppu JPN 4 AAA 01 Aug Port of Spain TRI 4 Newfoundland Provincial Championships 18 Oct Saint John's NF CAN 3 Commonwealth Games Trial 24 Apr Sydney AUS 10 1 Southland Jan Invercargill NZLLast Updated on
07 Jan 2016


A FREE(!!) smart decision app for complex accounting issues
GAAP Logic is a very smart decision application that helps you interpret even the most complex accounting guidance. We believe that the application of accounting rules should not be the private domain of very expensive accounting firms and subject matter experts. Application of GAAP is usually a methodical decision process that lends itself to decision analysis. GAAP Logic is just that, a decision analysis application designed to get you to the right answer while saving you time and money.
We envisioned GAAP Logic as a crowd-sourced app, with user input into Help, Examples and other content as a critical feature. We also welcome feedback on functionality, bugs and anything else that occurs to you that would improve the user experience and make the app a world-class accounting ressearch tool. We have built in an Issues feature for commenting on anything and everything. We will monitor Issues and do our best to respond to all Issues raised with complete transparency. All Issues and related comments/resolutions are available for view and comment by all users. So have at it!
No modules currently live.
No modules currently in beta.
No modules currently in development.


How to create a site-to-site VPN connection using PowerShell
Overview
This guide shows you how to use PowerShell to create a site-to-site VPN from your UKCloud for Microsoft Azure environment to public Azure.
Note
In public Azure - virtual network gateways can take up to 45 minutes to deploy, for more information see here.
Intended audience
To complete the steps in this guide, you must have appropriate access to subscriptions in UKCloud for Microsoft Azure and public Azure.
Prerequisites
Before you begin, ensure your PowerShell environment is set up as detailed in Configure the Azure Stack Hub user's PowerShell environment.
Declare variables
Enter details below to provide values for the variables in the scripts in this article:
| Variable name | Variable description | Input |
|---|---|---|
| $ArmEndpoint | The Azure Resource Manager endpoint for Azure Stack Hub | |
| $AzsRGName | Name of resource group to create in Azure Stack Hub | |
| $AzsVNetName | Name of virtual network to create in Azure Stack Hub | |
| $AzsVNetRange | Address space of virtual network to create in Azure Stack Hub in CIDR notation | |
| $AzsSubnetRange | Address space of virtual network subnet to create in Azure Stack Hub in CIDR notation | |
| $AzsGWSubnetRange | Address space of virtual network gateway subnet to create in Azure Stack Hub in CIDR notation | |
| $AzsPublicIPName | Name of public IP to create in Azure Stack Hub | |
| $AzsVirtualGWName | Name of virtual network gateway to create in Azure Stack Hub | |
| $AzsLocalGWName | Name of local network gateway to create in Azure Stack Hub | |
| $AzsGWConnectionName | Name of virtual network gateway connection to create in Azure Stack Hub | |
| $AzureLocation | Name of location to create resources within in public Azure | |
| $AzureRGName | Name of resource group to create in public Azure | |
| $AzureVNetName | Name of virtual network to create in public Azure | |
| $AzureVNetRange | Address space of virtual network to create in public Azure in CIDR notation | |
| $AzureSubnetRange | Address space of virtual network subnet to create in public Azure in CIDR notation | |
| $AzureGWSubnetRange | Address space of virtual network gateway subnet to create in public Azure in CIDR notation | |
| $AzurePublicIPName | Name of public IP to create in public Azure | |
| $AzureVirtualGWName | Name of virtual network gateway to create in public Azure | |
| $AzureLocalGWName | Name of local network gateway to create in public Azure | |
| $AzureGWConnectionName | Name of virtual network gateway connection to create in public Azure | |
| $SharedKey | Encryption key to use for VPN connection |
Create site-to-site VPN connection from Azure Stack Hub to public Azure
From your PowerShell window:
# Declare Variables
$AzsRGName = ""
$AzsVNetName = ""
$AzsVNetRange = ""
$AzsSubnetRange = ""
$AzsGWSubnetRange = ""
$AzsPublicIPName = ""
$AzsVirtualGWName = ""
$AzsLocalGWName = ""
$AzsGWConnectionName = ""
$AzureLocation = ""
$AzureRGName = ""
$AzureVNetName = ""
$AzureVNetRange = ""
$AzureSubnetRange = ""
$AzureGWSubnetRange = ""
$AzurePublicIPName = ""
$AzureVirtualGWName = ""
$AzureLocalGWName = ""
$AzureGWConnectionName = ""
$SharedKey = ""
# Azure Stack Hub
## Login
### Declare endpoint
$ArmEndpoint = ""
### Add environment
Add-AzureRmEnvironment -Name "AzureStackUser" -ArmEndpoint $ArmEndpoint
### Connect to environment
$AzsContext = (Connect-AzureRmAccount -EnvironmentName "AzureStackUser").Context
### Retrieve Access token
$AzsAccessToken = ($AzsContext.TokenCache.ReadItems() | Where-Object -FilterScript { $_.TenantId -eq $AzsContext.Tenant.Id } | Sort-Object -Property ExpiresOn -Descending)[0].AccessToken
### Get location of Azure Stack Hub
$AzsLocation = (Get-AzureRmLocation).Location
## Create resource group
Write-Output -InputObject "Creating resource group"
New-AzureRmResourceGroup -Name $AzsRGName -Location $AzsLocation
## Create network
### Create subnet configuration
Write-Output -InputObject "Creating virtual network"
$AzsSubnetConfig = New-AzureRmVirtualNetworkSubnetConfig -Name "Default" -AddressPrefix $AzsSubnetRange
$AzsGWSubnetConfig = New-AzureRmVirtualNetworkSubnetConfig -Name "GatewaySubnet" -AddressPrefix $AzsGWSubnetRange
### Create virtual network
$AzsVirtualNetwork = New-AzureRmVirtualNetwork -ResourceGroupName $AzsRGName -Location $AzsLocation -Name $AzsVNetName -AddressPrefix $AzsVNetRange -Subnet $AzsSubnetConfig, $AzsGWSubnetConfig
### Retrieve gateway subnet config
$AzsGWSubnetConfig = Get-AzureRmVirtualNetworkSubnetConfig -Name "GatewaySubnet" -VirtualNetwork $AzsVirtualNetwork
## Create public IP address
Write-Output -InputObject "Creating public IP address"
$AzsPublicIP = New-AzureRmPublicIpAddress -ResourceGroupName $AzsRGName -Location $AzsLocation -AllocationMethod "Dynamic" -Name $AzsPublicIPName
## Create virtual network gateway
Write-Output -InputObject "Creating virtual network gateway"
$AzsGatewayIPConfig = New-AzureRmVirtualNetworkGatewayIpConfig -Name "GatewayIP" -Subnet $AzsGWSubnetConfig -PublicIpAddress $AzsPublicIP
$AzsVirtualGW = New-AzureRmVirtualNetworkGateway -ResourceGroupName $AzsRGName -Location $AzsLocation -Name $AzsVirtualGWName -IpConfigurations $AzsGatewayIPConfig -GatewayType "VPN" -VpnType "RouteBased" -GatewaySku "VpnGw1"
## Create local network gateway
Write-Output -InputObject "Creating local network gateway"
$AzsLocalGW = New-AzureRmLocalNetworkGateway -ResourceGroupName $AzsRGName -Location $AzsLocation -Name $AzsLocalGWName -GatewayIpAddress "<IP_ADDRESS>" -AddressPrefix $AzureVNetRange
## Create IPsec Policy
$IPsecPolicy = New-AzureRmIpsecPolicy -IkeEncryption "AES256" -IkeIntegrity "SHA256" -DhGroup "DHGroup14" -IpsecEncryption "AES256" -IpsecIntegrity "SHA256" -PfsGroup "PFS2048" -SALifeTimeSeconds 3600 -SADataSizeKilobytes 102400000
## Create virtual network gateway connection
Write-Output -InputObject "Creating virtual network gateway connection"
$AzsVirtualGWConnection = New-AzureRmVirtualNetworkGatewayConnection -ResourceGroupName $AzsRGName -Location $AzsLocation -Name $AzsGWConnectionName -VirtualNetworkGateway1 $AzsVirtualGW -LocalNetworkGateway2 $AzsLocalGW -ConnectionType IPsec -IpsecPolicies $IPsecPolicy -SharedKey $SharedKey
## Retrieve public IP address of virtual network gateway
$AzsPublicIP = Get-AzureRmPublicIpAddress -ResourceGroupName $AzsRGName -Name $AzsPublicIPName
# Azure
## Connect to environment
Connect-AzureRmAccount
## Create resource group
Write-Output -InputObject "Creating resource group"
New-AzureRmResourceGroup -Name $AzureRGName -Location $AzureLocation
## Create network
### Create subnet configurations
Write-Output -InputObject "Creating virtual network"
$AzureSubnetConfig = New-AzureRmVirtualNetworkSubnetConfig -Name "Default" -AddressPrefix $AzureSubnetRange
$AzureGWSubnetConfig = New-AzureRmVirtualNetworkSubnetConfig -Name "GatewaySubnet" -AddressPrefix $AzureGWSubnetRange
### Create virtual network
$AzureVirtualNetwork = New-AzureRmVirtualNetwork -ResourceGroupName $AzureRGName -Location $AzureLocation -Name $AzureVNetName -AddressPrefix $AzureVNetRange -Subnet $AzureSubnetConfig, $AzureGWSubnetConfig
### Retrieve gateway subnet config
$AzureGWSubnetConfig = Get-AzureRmVirtualNetworkSubnetConfig -Name "GatewaySubnet" -VirtualNetwork $AzureVirtualNetwork
## Create public IP address
Write-Output -InputObject "Creating public IP address"
$AzurePublicIP = New-AzureRmPublicIpAddress -ResourceGroupName $AzureRGName -Location $AzureLocation -AllocationMethod "Dynamic" -Name $AzurePublicIPName
## Create virtual network gateway
Write-Output -InputObject "Creating virtual network gateway"
$AzureGatewayIPConfig = New-AzureRmVirtualNetworkGatewayIpConfig -Name "GatewayIP" -Subnet $AzureGWSubnetConfig -PublicIpAddress $AzurePublicIP
$AzureVirtualGW = New-AzureRmVirtualNetworkGateway -ResourceGroupName $AzureRGName -Location $AzureLocation -Name $AzureVirtualGWName -IpConfigurations $AzureGatewayIPConfig -GatewayType "VPN" -VpnType "RouteBased" -GatewaySku "VpnGw1"
## Create local network gateway
Write-Output -InputObject "Creating local network gateway"
$AzureLocalGW = New-AzureRmLocalNetworkGateway -ResourceGroupName $AzureRGName -Location $AzureLocation -Name $AzureLocalGWName -GatewayIpAddress $AzsPublicIP.IpAddress -AddressPrefix $AzsVNetRange
## Create virtual network gateway connection
Write-Output -InputObject "Creating virtual network gateway connection"
$AzureVirtualGWConnection = New-AzureRmVirtualNetworkGatewayConnection -ResourceGroupName $AzureRGName -Location $AzureLocation -Name $AzureGWConnectionName -VirtualNetworkGateway1 $AzureVirtualGW -LocalNetworkGateway2 $AzureLocalGW -ConnectionType IPsec -IpsecPolicies $IPsecPolicy -SharedKey $SharedKey
## Retrieve public IP address of virtual network gateway
$AzurePublicIP = Get-AzureRmPublicIpAddress -ResourceGroupName $AzureRGName -Name $AzurePublicIPName
# Azure Stack Hub
## Reconnect to environment
Connect-AzureRmAccount -EnvironmentName "AzureStackUser" -AccessToken $AzsAccessToken -AccountId $AzsContext.Account.Id
## Set the public IP on the local network gateway
$AzsLocalGW.GatewayIpAddress = $AzurePublicIP.IpAddress
## Update the local network gateway
Set-AzureRmLocalNetworkGateway -LocalNetworkGateway $AzsLocalGW
After a short amount of time, the connection between Azure Stack Hub and public Azure should change to Connected.
Feedback
If you find a problem with this article, click Improve this Doc to make the change yourself or raise an issue in GitHub. If you have an idea for how we could improve any of our services, send an email to feedback@ukcloud.com.


Blogging With JBake
01 May 2016
I have an existing Octopress blog which is probably near its useful days. Octopress which is Jekyll underneath the covers, is still one of the best static site generator. It has more community support and more written plugins. If I'm a Ruby guy, I will certainly stick with Octopress or Jekyll. But I'm not, being a Java developer. One of the biggest reason why I'm switching to jbake
is being able to run it on JVM. JBake is not as mature as Jekyll, it's Github inception was 17th of July 2012.
Prerequisites
-
JDK - the oven
-
git - the stupid content tracker
-
sdkman - to easily install Software Development Kits
$ curl -s "https://get.sdkman.io" | bash
-
lazybones - template generator
$ sdk install lazybones
-
gradle - for the optional github deployment script
$ sdk install gradle
Setting up your bakery
I followed CoffeaElectronica to initially setup my bakery.
$ lazybones create jbake-groovy blog
Creating project from template jbake-groovy (latest) in 'blog'
Define value for 'JBake Plugin Version' [0.2]:
Define value for 'JBake Version' [2.3.2]: 2.4.0
Define value for 'Gradle version' [2.3]: 2.9
GitHub project: [username/projectname.git]: drmanalo/dhon.github.io.git
Then I cloned one of knes1 repositories git clone https://github.com/knes1/tehartikli-jbake-template.git
since it has the Freemarker templates that I wanted for my blog. After cloning, I placed the cloned template into src/jbake
replacing all existing folders there. I also deleted the initial contents under content/blog/2013
folder which are initial posts on HTML, Markdown and AsciiDoc format to show you how to write your posts.
I changed the build.gradle
slightly to support Freemarker.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'me.champeau.gradle:jbake-gradle-plugin:0.2'
classpath 'org.jbake:jbake-core:2.3.1'
classpath 'org.pegdown:pegdown:1.4.2'
classpath 'org.asciidoctor:asciidoctorj:1.5.2'
classpath 'org.freemarker:freemarker:2.3.19'
}
}
apply plugin: 'me.champeau.jbake'
task publish(type: GradleBuild) {
buildFile = 'publish.gradle'
tasks = ['publishGhPages']
}
Header of every recipe
title=Disclaimer
date=2015-05-01
type=page
keywords=drmanalo,disclaimer
status=published
On the above snippet type could be either ``post`` or ``page``. The difference on how it will be baked is purely based on your moulder which happen to be the files inside ``templates`` folder.
### Baking your recipe
$ gradle jbake
:jbake
BUILD SUCCESSFUL
Total time: 5.542 secs
### Previewing your posts
$ groovy serve.groovy
Starting Jetty, press Ctrl+C to stop.
2016-05-07 15:17:10.455:INFO:oejs.Server:jetty-7.6.15.v20140411
2016-05-07 15:17:10.496:INFO:oejsh.ContextHandler:started o.e.j.s.ServletContextHandler{/,file:/home/drmanalo/workspace/blog/}
2016-05-07 15:17:10.520:INFO:oejs.AbstractConnector:Started SelectChannelConnector@<IP_ADDRESS>:8080
### Publishing to github
This requires your associated ``SSH key`` for the configured github username.
$ gradle publish
:publish
:dhon.github.io:publishGhPages
BUILD SUCCESSFUL
Total time: 14.107 secs


##Welcome to Drupal & Node.js Training
To test test out the internet visit our class notes google doc and put in your name, your spice and what you want to do with Node and drupal. [http://bit.ly/12ERwzm](http://bit.ly/12ERwzm)
## Hello Class
```javascript
console.log('Welcome!');
```
![slides](assets/img/slides.jpg)
* **[fourkitchens.github.com/train-node](http://fourkitchens.github.com/train-node)**
* We use [reveal.js](http://lab.hakim.se/reveal-js/)
* Use ```esc``` to get a top level view of the slides.
* Feel free to open the slides in a browser locally and use them to copy code.
* You can see which slide we are on from the number in the lower right.
Who we are
Elliott Foster
Mike Minecki
## What you'll walk away with
* Callbacks!
* You'll know why that's funny
* A Socket.io app
* A chance to use the Express Node.js framework.
* A few strategies on how to work node into your Drupal projects.
## What we'll build
A "real-time" webapp.
* Pulls nodes from Drupal
* Has the basis for a chat
* BONUS: Pulls images from Flickr
## What we'll build
![block diagram](assets/img/client.png)
## Class outline.
* Intro to node.js
* Console.log
* Hello World
* Integrating with Drupal 1
* **Lunch**
* Async programing
* Using Require() *NPM & Modules*
* Quick intro to Events
* Integrating with Drupal 2
* Socket.io
## Frustrated?
* Who here has been confused, lost, or frustrated?
* Raise your hand! It's ok to be confused, lost, or frustrated!
* If you are lost tell us, it's normal and you're not slowing us down.
* We're here to help and enable!
## Shy?
- So are we.
- We have candy and will give it to you for asking questions.
![engineer](assets/img/penguin.jpg)
What is node.js?
## From Nodejs.org
Node.js is a platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices.
Node.js is a platform built on Chrome's JavaScript runtime [...]
* Chrome's JavaScript runtime is called V8, it's one of the reasons
Chrome is considered so fast.
* node.js leverages V8's speed on the server!
[...] easily building fast, scalable network applications.
* Node wants to act as a message passer (more on this later).
Node.js uses an event-driven, non-blocking I/O model [...]
* Only one thing gets executed at a time, but libraries allow I/O
or other intensive tasks to be executed asynchronously so the
script doesn't need to wait for them to finish.
### What Makes it
### *Fast and Scaleable?*
* V8 Engine
* Asynchronous libraries
* Event Driven.
## Why do we need another server side language/framework?
## What do you mean by slow?
## We actually mean Drupal and we mean it's bad at concurrency.
### Why is PHP/Drupal bad at handling concurrency?
* Big memory foot print.
* If you need to load 100Meg of Code to deliver 4 lines of JSON. . .
* Everything happens in order.
* Your 100ms database call will hold up the execution of the entire process.
* Your next 100ms call will do the same, etc.
* Only after all the database calls have completed can we return the 4 lines of JSON.
## In node:
Everything happens in Parellel execpt for your code.
## Imagine a King with servants
* Every morning the servants line up.
* One at a time they come into his throne room.
* They report on what they've done.
* Sometimes the king gives them more to do.
* Always one at a time, so the king can focus.
## Code Please.
var fs = require('fs');
var sys = require('sys');
fs.readFile('treasure-chamber-report.txt', function readFile(report) {
sys.puts("oh, look at all my money: "+report);
});
fs.writeFile('letter-to-princess.txt', '...', function writeFile() {
sys.puts("can't wait to hear back from her!");
});
### Explain the Code Please.
* Code gives node 2 things to do.
* Each callback gets fired one at a time
* Until one callback is fired all others wait in line
### However
* We don't need to wait for the file being read, to write the file.
* Both System IO calls are started independently.
### Don't need to wait for one to finish before the next starts!
## Why not write non-blocking/event-driven PHP
## There are event driven Async PHP frameworks.
For example: [PRADOTM](http://www.photon-project.com/)
## Libraries.
* PHP libraries are primarily blocking and not event driven.
* Node.js libraries are almost all non-blocking and event driven.
### What is node.js good for
* Rapid prototyping
* Bursty load
* API glue
* Queue-ish stuff
* "Real-time" applications
* Easy example: chat
* **Message passing!**
### What is node.js NOT good for
* General purpose web server
* (Large) static assets
* Complex systems (business logic)
* Lots of processing - use C or PHP
### What We've used it for
* [RSS Hub](https://github.com/elliotttf/PubHub)
* [Interactive game](http://drupalpoetry.com)
* Realtime video commenting
* [IRC Bot](http://hubot.github.com/)
* [Parsing HTML](https://github.com/tmpvar/jsdom)
### What about the community?
* Welcoming community
* Package manager that kicks butt
* Over 16k packages
* Very fast moving project
* 63 Releases in the last year and half
* BUT has really good test coverage
* Lots of Frameworks
* Drupal module
## Share client and server side code.
![yeah](assets/img/glasses-off.gif)
## Lets get into it!
![Adventure Time](assets/img/adventuretime.png)
Your environment
## Connecting to the server
* SSH into the server from your local machine
$ ssh<EMAIL_ADDRESS>* Pro-tip: You may want to keep two terminal sessions open to the server so
you can edit files while running a node process or edit two files
at once in different windows.
## Editing files
* Use your preferred editor on server
(we like vim but won't judge if you use emacs -- but we can't help you either).
* If you want to edit files locally, SFTP with the credentials you were provided
$ sftp<EMAIL_ADDRESS>* You can also use your preferred SFTP client.
## File structure
* All course code is located in
~/nodejs
* Familiarize yourself with the files and directories here,
you'll be spending most of your time in the following directories:
~/nodejs/js101
~/nodejs/exercises/drupal
~/nodejs/exercises/server
## Commands you'll be using
* ```cp [src] [dst]``` - to copy a file
* ```mv [src] [dst]``` - to move or rename a file
* ```rm [file]``` - to delete a file
* ```node [file]``` - to start a node process (or just ```node``` to
use the node REPL shell).
* ```CTRL+C``` - to stop a node process that does not automatically exit.
## ```console.log()```
Same debugging tool you use in the browser.
* Create your first app!
* Make an app.js file in the _/console.log_ folder.
* Add one line. . .
console.log('Mathamatical!');
Now run it
$ node app
![result](assets/img/consolelog.png)
Hello world server
## Port Number
* A unique port has been assigned to each of you, it's in the
```~/port-xxxxx``` file in your home directory. You'll need
this when we start a node server.
* The ```~/config.json``` file in your home directory can be used to
inject settings in your node code (more on that later).
## Your first Server.
```~/nodejs/hello/app.js```
* Respond to the HTTP request with a hello world message
var http = require('http');
http.createServer(function hello(request, response) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
}).listen(1337);
console.log('Server running at http://<IP_ADDRESS>:1337/');
change *1337* to your port number.
## WAT
* We've secretly replaced the js101 section with a funny video.
* Lets see if the class notices.
* Don't worry we'll dive down into the basics after lunch.
* For now lets have some fun!
## WAT
[![wat](assets/img/wat.png)](assets/video/wat.mov)
A quick intro to Express
### Express
* A web application framework for node.js
* Provides:
* Static asset handling
* Dynamic router
* [Connect](http://www.senchalabs.org/connect/) middleware
### Getting started
* Use the ```express``` command to set up some scaffolding for a new application:
$ cd ~/nodejs/exercies
$ express myserver
$ cd myserver
$ npm install
### Copy your personal Config file.
* We're going to make a few changes to support the application we're going to build:
1. Copy the config.js file and client directory from your home directory to the example dirctory:
$ cp ~/config.js ~/nodejs/exercises/myserver/config.js
## Edit app.js
Include the config we copied by adding it after the where path is required. Don't forget to remove the ";" after require('path').
- , path = require('path');
+ , path = require('path')
+ , config = require('./config');
Use the port number from the config file.
- app.set('port', process.env.PORT || 3000);
+ app.set('port', config.port);
## Try it.
![express works](assets/img/express.png)
## Integrating with Drupal I
Integrating with Drupal I
## What we'll build.
* We'll ping the node server with with node title
* We'll create a list of Drupal nodes in our app.
### Create the Node.js Endpoint.
app.post('/ping', function postPing(request, response){
console.log(request.body); // your JSON
response.send(request.body); // echo the result back
});
### Create a Drupal module to send the title to node.
1. Stub drupal module is created already.
2. We'll put the code that talks to node in a node_view hook.
3. Hint: we'll use drupal\_json\_encode() and drupal\_http\_request()
4. Be sure to handle errors.
### Example Drupal Module code.
$data = array('title' => $node->title);
$data = drupal_json_encode($data);
$uri = variable_get('ping_nodejs_uri','http://localhost:3000/ping');
$options = array();
$options['headers'] = array('Content-Type' => 'application/json');
$options['method'] = 'POST';
$options['data'] = $data;
$response = drupal_http_request($uri, $options);
if ($response->code != 200) {
drupal_set_message("Got an error: " . $response->error, 'error');
}
else {
drupal_set_message('Successfully contacted node server. Response was: ' . $response->data);
}
## Munch on Lunch
![lunch](assets/img/alpaca-lunch.jpg)
## Asynchronous programming
Asynchronous programming
## How to stop Code-blocking
```async/```
![log jam](assets/img/log_jam.jpg)
## Remember the King with servants?
* Every morning the servants line up.
* One at a time they come into his throne room.
* They report on what they've done.
* Sometimes the king gives them more to do.
* Always one at a time, so the king can focus.
## Syncrounous example
Checkout the order of the log messages.
console.log("I'm going to read a file synchronously.");
syncContents = fs.readFileSync(__filename);
console.log("I'm done reading the file synchronously.");
console.log('I read ' + syncContents.length + ' characters.');
console.log("Now I'm ready to do the next thing.");
## Asynchronous Example
Now see how the log messages have changed.
console.log("I'm going to read a file asynchronously.");
fs.readFile(__filename, function readFile(err, data) {
asyncContents = data;
console.log("I'm done reading the file asynchronously.");
console.log('I read ' + asyncContents.length + ' characters.');
});
console.log("Now I'm ready to do the next thing.");
## Results
![async](assets/img/async.png)
## Why have both?
* Sometimes simplifies code flow.
* Useful if you _need_ to stop code from executing until the operation is completed.
* Generally you should ask yourself "Should this be a callback instead."
### Don't do complicated stuff in the event looop.
var start = Date.now();
setTimeout(function timeout1() {
console.log('We started execution ' + (Date.now() - start) + 'ms ago.');
for (var x = 0; x <<PHONE_NUMBER>; x++) {}
console.log('Done with timeout1().');
}, 1000);
setTimeout(function timeout2() {
console.log('We started execution ' + (Date.now() - start) + 'ms ago.');
console.log('Done with timeout2().');
}, 2000);
## Keep it simple.
Don't put complicated logic in the main event thread.
* Long sorts/searches.
* Long Math (fibbonacci sequence).
* Processing lots of raw data.
### How to get around this problem:
* Fork process
* Hand off to other program and listen for event.
* Write C
* Use a queue
## Events
* Lots of node functions emit events.
* Events are what trigger our callbacks.
* Eventually you'll write your own.
[Events Explained.](http://howtonode.org/demystifying-events-in-node)
## Using ```require()```, NPM, and modules
Using require(), NPM, and modules
## ```require()```
* Used to include built in libraries, libraries from package manager and local files.
* Automatically handles dependenies.
~/nodejs/require/modules
module_a.js
console.log('this is a');
module_b.js
console.log(' this is b');
main.js
// Note the relative paths, leaving this off for libraries you
// define is a common mistake.
require('./module_a');
require('./module_b')
```$ node main.js```
### Dependency Handling AKA Package.json
{
"author": "Four Kitchens (http://fourkitchens.com/)",
"name": "npmExample",
"description": "An example from the world famous Four Kitchens Node.js training.",
"version": "0.0.1",
"homepage": "http://fourkitchens.com",
"repository": {
"type": "git",
"url": "git://github.com/fourkitchens/train-node.git"
},
"engines": {
"node": "~0.8.8"
},
"dependencies": {},
"devDependencies": {},
"optionalDependencies": {}
}
[package.json reference](http://package.json.jit.su/)
NPM
- Node's Personal Manservant
- Collection of over 16k community built libraries
- Handles installation and dependencies
- Everything from GPIO libraries to a few CMSs
## NPM Commands
* npm install - install module
* add -g to install at the system level.
* npm install --save - installs module and adds it to your local package.json file.
* npm install - installs everything from the local package.json file.
* npm init - creates an empty package.json file
* npm search - search for modules
[NPM help (if --help is too old school for you.)](https://npmjs.org/doc/)
## Try it
$ mkdir ~/nodejs/require/colorsExample
$ cd ~/nodejs/require/colorsExample
$ npm init
$ npm install colors
To add a library to your package.json file at install time add --save:
npm install --save colors
* Create a file called colorsExample.js in the colorsExample directory
* Here's an example of using the colors library, give it a try and run
the script with ```node colorsExample``` when you're done editing.
// colorsExample.js
var colors = require('colors');
console.log('hello'.green); // outputs green text
## More fun with colors
console.log('i like cake and pies'.underline.red) // outputs red underlined text
console.log('inverse the color'.inverse); // inverses the color
console.log('OMG Rainbows!'.rainbow); // rainbow (ignores spaces)
## Where does ```require()``` look for files?
* Core libraries
* modules in the node_modules directory
* locally defined modules _if the module is prefixed with a path_
* Paths can be absolute, but this is highly discouraged, use the relative paths or package your own module.
[the mystery explained](http://www.bennadel.com/blog/2169-Where-Does-Node-js-And-Require-Look-For-Modules-.htm)
## Integrating with Drupal II
Integrating with Drupal II
## Getting a list of Drupal Nodes.
1. Install and configure Services modules.
2. Create and theme a route in our app for drupal to ping.
## Install and Configure Services module.
1. It's already there, just enable it.
2. go to admin/structure/services
3. configure a rest server with endpoint "rest".
4. configure the rest server with the node resource.
## Create & theme a route to show a list of nodes.
1. Create a new Express middleware
2. Create an endpoint that uses that middleware
3. Add a template engine to Express.
4. Create a template for the page of nodes.
## Add a new library
*npm install --save superagent*
## Create the Express middleware AKA route.
Create file: */routes/nodes.js
![superagent](http://visionmedia.github.com/superagent/)
var request = require('superagent');
/**
* Get Nodes function
*
*/
module.exports = function nodes (url, fn) {
request.get(url)
.end(function gotNodes(res) {
if (res.body) {
return fn(null, res.body);
}
});
};
## Change to our theme engine.
[handlebars](https://github.com/donpark/hbs), [hbs handlebars for Expresss](https://github.com/wycats/handlebars.js)
```npm install --save hbs```
#### add the themeing engine to our app.
- app.set('view engine', 'jade');
+ app.set('view engine', 'html');
+ app.engine('html', require('hbs').__express);
## Create the layout.
Renders the page.
* Create the file ```/views/layout.html```
* [gist with layout](https://gist.github.com/3982145)
![handlebars layout](assets/img/handlebars-layout.png)
## Create the template
Render's the content.
Create the file ```/views/nodes.html```
![handlebars template](assets/img/handlebars-node-template.png)
[gist with template](https://gist.github.com/3982229)
## Add code to the app.
app.get('/nodes', function getNodes(req, res, next) {
nodes('http://instructor.nodejs.4kclass.com/exercises/drupal/rest/node.json', function renderNodes(err, nodes) {
console.log(nodes);
if (err) return next( err);
res.render('nodes', { results: nodes });
});
});
Socket.io
### What is Socket.io
Socket.IO aims to make realtime apps possible in every browser and mobile device, blurring the differences between the different transport mechanisms. It's care-free realtime 100% in JavaScript.
#### Server
var io = require('socket.io').listen(80);
io.sockets.on('connection', function onConnection(socket) {
socket.emit('news', { hello: 'world' });
socket.on('my other event', function onMyOtherEvent(data) {
console.log(data);
});
});
#### Client
var socket = io.connect('http://localhost');
socket.on('news', function onNews(data) {
console.log(data);
socket.emit('my other event', { my: 'data' });
});
### What you'll build
![client](assets/img/client.png)
* A backend to this...
![block diagram](assets/img/block-diagram.png)
### What you'll build
* A loop to fill out content in the stories region
* A [socket.io server](https://github.com/learnboost/socket.io#express-3x).
The client is currently aware of three entities and two events each...
### Story
* story - contains a title, description, and link.
{
title: 'Story title',
description: 'Story body text',
link: 'URL to the story'
}
* socket.io events:
* newStories - array of story objects to add to the region.
* refreshStories - array of story objects to replace what's
in the region with.
### Message
* message - contains a name, message, and time.
{
name: 'Message Author',
message: 'Message body text!',
time: new Date()
}
* socket.io events:
* newMessages - array of message objects to add to the region.
* refreshMessages - array of message objects to replace what's
in the region with.
### Image (bonus)
* image - contains a picture (URL) and link.
{
picture: 'URL to the image',
link: 'URL to where the image should be linked to'
}
* socket.io events:
* newImages - array of image objects to add to the region.
* refreshImages - array of image objects to replace what's
in the region with.
### Bonus challenges!
1. Save new stories in memory (a variable) so they are accessible to
your application.
1. Save messages in memory.
1. Serve saved stories and messages to clients when they (re)connect.
1. Fetch custom stories from RSS feeds, third party APIs, or your Drupal site!
### Bonus challenges, cont
1. Fetch custom images and save them in memory.
1. Serve custom images to clients when they (re)connect.
1. Store the stories, messages, and images in either MySQL or MongoDB.
Use this list to avoid creating duplicate content in case the feed
re-sends an item or you need to restart your node server.
* Hint: see the next set of slides for some tips on working with
databases in node.
![get on with it](assets/img/get-on-with-it.jpg)
The exercises
### Where's the code?
~/nodejs/exercises/server/app.js
* This is where you'll be living for the remainder of the class.
The code is highly commented.
* Anything marked with ```TODO``` is a task we're going to guide
the class through.
* Anything with ```(bonus)``` is a bonus task that we'll guide you through
if we get to it, but feel free to tackle these on your own if you
complete the other tasks.
### Create some story content.
// Keep a counter.
var count = 0;
/**
* Notifies the client of new stories.
*/
setInterval(function newStories() {
// Increment the counter.
count++;
// Create some story content to send to the client.
var newStories = [
{
title: 'New story ' + count,
description: 'New story text for ' + count,
link: 'http://fourkitchens.com'
}
];
// Broadcast the new stories to all clients.
io.sockets.emit('newStories', newStories);
}, config.pollInterval || 10000);
### Create stories from Drupal
/**
* Notifies the client of new stories.
*/
setInterval(function newStories() {
nodes('http://instructor.nodejs.4kclass.com/rest/node.json', function gotNodes(err, nodes) {
if (err) { return next(err); }
var newStories = [];
nodes.forEach(function eachNode(node) {
newStories.push({
title: node.title,
description: node.title + ' (nid: ' + node.nid + ')',
link: 'http://instructor.nodejs.4kclass.com/node/' + node.nid
});
});
io.sockets.emit('newStories', newStories);
});
});
### Create stories from Drupal
* Create new content on your Drupal site, you should see it show
up on the client the next time the site is polled.
* Want to make it better? Keep a variable with the nodes you've
already received and only emit the new ones.
### Welcome new clients
app.get('/messages', function getMessages(req, res) {
var messages = [
{
name: 'Training bot',
message: 'Welcome to node.js training!',
time: new Date()
}
];
res.json(messages);
});
### Message chat
app.post('/message', function postMessage(req, res) {
res.writeHead(204);
res.end();
var newMessages = [req.body];
io.sockets.emit('newMessages', newMessages);
});
### Message chat
* Try opening your client site in another browser and start
sending messages!
* Want to make it better? Store the new messages so you can
serve chat history to new clients.
Working with streams
### Overview
* As its name implies, streams are a continuous flow of information that can be diverted or processed as it comes in.
### Overview
* As its name implies, streams are a continuous flow of information that can be diverted or processed as it comes in.
* This is incredibly efficient, because you don't have to wait until a stream is finished before working with any data that's come in.
### Overview
* As its name implies, streams are a continuous flow of information that can be diverted or processed as it comes in.
* This is incredibly efficient, because you don't have to wait until a stream is finished before working with any data that's come in.
* Fundumantal abstraction in node.js I/O.
### Overview
* As its name implies, streams are a continuous flow of information that can be diverted or processed as it comes in.
* This is incredibly efficient, because you don't have to wait until a stream is finished before working with any data that's come in.
* Fundumantal abstraction in node.js I/O.
* Can be readable (reading a file), writeable (HTTP response) or both TCP connection.
### Best part is. . .
. . . You are already using them.
### First code we wrote used a stream.
var http = require('http');
http.createServer(function hello(request, response) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
}).listen(1337);
console.log('Server running at http://<IP_ADDRESS>:1337/');
### Lets give it a shot.
```~/nodejs/streams```
* Read a file from the file system and write it out to the console.
### On the stream data event write to console.log.
file.on('data', function(chunk){
console.log(chunk.toString());
});
### For comparison lets use readFile instead
fs.readFile('index.html', function(err, data) {
if (err) throw err;
console.log(data.toString());
});
### For comparison lets use readFile instead
```fs.readFile(filename, [options], callback)```
* Reads the contents of the file asyncrounsly.
* [fs.readFile Docs](http://nodejs.org/api/fs.html#fs_fs_readfile_filename_options_callback)
### console.log the file contents using readFile().
### Now create an HTTP server using readFile
fs.readFile('index.html', function (err, data) {
if (err) {
res.statusCode = 500;
res.end(String(err));
}
else res.end(data);
});
## Pipe
* Method on streams that allows you to route the data from one stream to another directly
* Allows for some very powerful and performat opperations.
* works like the unix pipe '|'
```history | grep node```
var file = fs.createReadStream('index.html');
file.pipe(res);
### Adding a stream of images from flickr to our little webapp.
* Helper code to get a feed from flickr and pipe into into a stream.
** https://gist.github.com/mirzu/5828095
* New emitter for images.
https://gist.github.com/mirzu/5828092
## Working with Databases
Working with databases
### Overview
* One of the easiest places to see asynchronous programming:
1. Application makes call to database and immediately returns to the event loop.
1. Later, database calls back with results.
* For the more advanced examples in this class you'll be given the opportunity to work with a database, either MySQL or MongoDB.
### MySQL
* [http://www.mysql.com/](http://www.mysql.com/)
* Relational database system
* If you're a Drupal developer you're probably pretty familiar with it, but the libraries we'll be using to interact with it aren't as abstracted as DBTNG.
* i.e. you'll have to write actual SQL queries ಠ_ಠ
### Node.js and MySQL
* We'll be using the [node-mysql](https://github.com/felixge/node-mysql) library.
* ```$ npm install<EMAIL_ADDRESS>var mysql = require('mysql');
var conn = mysql.createConnection({
host: 'localhost',
user: 'you',
password: 'unsafe'
});
conn.connect();
conn.query('SELECT "Hello world" AS message', function selectResult(err, rows, fields) {
if (err) {
throw err;
}
console.log(rows[0].message);
});
conn.end();
### MongoDB
* [http://www.mongodb.org/](http://www.mongodb.org/)
* Schemaless document store
* Documents are stored as BSON which is very similar to JSON and therefore extremely convenient to work with in node.js!
### MongoDB Examples
* There's not a real query language in the same sense as MySQL and since the database is schemaless you can throw whatever you like at it:
```$ mongo```
db.test.insert({
title: 'test',
message: 'Hello world'
});
db.test.find({ title: 'test' }).pretty();
db.test.update(
{ title: 'test' },
{ $set: { message: 'Yo dawg' } }
);
db.test.find({ title: 'test' }).pretty();
### Sub documents
* One of the most useful parts of MongoDB is the ability to store "sub documents" or objects within a primary document:
db.test.update(
{ title: 'test'},
{ $set: {
speaker: {
name: 'Elliott Foster',
occupation: 'Hipster Technologist',
interests: [
'JavaScript',
'beer',
'bicycles'
]
}
} }
);
db.test.find({ 'speaker.name': 'Elliott Foster' }).pretty();
![mind blown](assets/img/mind-blown.gif)
### Node.js and MongoDB
* We'll be using the [mongode](https://github.com/milewise/mongode) library to interact with MongoDB
var mongode = require('mongode');
var test = mongode.connect('mongo://<IP_ADDRESS>/test');
var collection = test.collection('test');
var doc = { title: 'test2', message: 'node and mongo, yay!' };
collection.insert(doc, {safe:true}, function insertResult(err, objects) {
if (err) {
console.error(err.message);
process.exit(1);
}
collection.findOne({ title: 'test2' }, function findOneResult(err, document) {
if (err) {
console.error(err.message);
process.exit(1);
}
console.log(document.message);
process.exit(0);
});
});
Writing your own events
## Roll your own
// basic imports
var events = require('events');
var util = require('util');
function Poll(feed) { this.feed = feed; };
util.inherits(Poll, events.EventEmitter);
Poll.prototype.getStories = function(callback) {
var self = this;
/**
* Assume fetchStories grabs an array of content and
* executes this callback on completion.
*/
fetchStories(self.feed, function gotStories(err, newStories) {
if (!err && newStories.length) {
self.emit('fed', null, newStories);
}
});
};
exports.Poll = Poll;
JavaScript 101
### Hashes (AKA Objects)
* A hash is an object, they can contain properties:
var awesomeCompany = {
name: 'Four Kitchens',
location: 'Austin, TX'
};
console.log(awesomeCompany.name + ' is awesome!');
### Hashes (AKA Objects)
* They can also contain functions:
var awesomeCompany = {
name: 'Four Kitchens',
location: 'Austin, TX',
knowsNode: function() {
return true;
}
};
if (awesomeCompany.knowsNode()) {
console.log(awesomeCompany.name + ' knows node!');
}
### Scope: Local Variable Scope
/**
* This function defines its own 'pet' variable that
* will not alter the one defined in the global scope.
*/
var example2 = function() {
var pet = 'chupacabra';
console.log("My function's pet is a " + pet);
};
console.log('Example 2: My pet is a ' + pet);
example2();
console.log('Now my pet is a ' + pet);
### Scope: Local Variable Scope
![result](assets/img/scope2.png)
## Anonymous and named functions
![spy vs spy](assets/img/spy-vs-spy.png)
## Functions in Javascript.
* Functions are objects.
* Functions can be passed in as arguments.
* Refered to as a callback.
## Functions
var Func = function() {
console.trace("I'm a function.");
console.log('==========================');
};
setTimeout(Func, 2000);
## Named functions
setTimeout(function named() {
console.trace("I'm named, somebody loves me.");
console.log('==========================');
}, 1000);
## Anonymous functions
setTimeout(function() {
console.trace("I'm anonymous, see?");
console.log('==========================');
}, 1);
## Use named functions.
* Makes it easier to find what is wrong in the stack trace
* Whats a stack trace?
## Stack Trace
* Node outputs a list of which functions were called when your code broke
* Makes it easier to find out where the error was.
## Stack Trace Example.
* First we'll try using console.trace
* Second we'll uncomment a real mistake and we'll see how it works.
![stacktrace](assets/img/stacktrace.png)
### This
var unicorn = new Unicorn();
unicorn.addHorns(1);
![output](assets/img/this1.png)
### Whyyy!?!?
![whyyyy](assets/img/this-wat.jpg)
### Whyyy!?!?
* Remember when we said everything's an object?
* The value of ```this``` changed when we entered the ```countHorns()``` function.
### Ok, let's fix it!
/**
* Update the Unicorn prototype to be aware of
* the scope of 'this'.
*/
Unicorn.prototype.addHorn = function(horns) {
// Assign the local variable 'self' to the value of 'this' so we can still
// access 'this' in other scopes.
var self = this;
self.horns = horns;
setTimeout(function countHorns() {
if (self.horns > 0) {
console.log("I'm a unicorn!");
}
else {
console.log("I have 0 horns. I must be a horse!");
}
}, 1);
};
### This (fixed)
var unicorn2 = new Unicorn();
unicorn2.addHorn(2);
![output](assets/img/this2.png)
### Yay!
![yay](assets/img/this-yay.jpg)


SOMEONE LIKE YOU ----------------
Jane Goodale (Ashley Judd) is a talent booker for a hot new daytime talk show who falls into a whirlwind romance for new executive producer Ray (Greg Kinnear). When he dumps her to return to the woman he was cheating on, Jane bitterly develops her 'new cow' theory, utilizing the womanizing ways of her new roommate Eddie (Hugh Jackman "X-Men") for research in "Someone Like You."
Trading the much better title of its book source "Animal Husbandry" for the song title "Someone Like You" sums up the unoriginality at work in this film. While the supporting cast provide some bright spots, Ashley Judd is bland and unsympathetic in her first romantic comedy.
Jane moves in with Eddie (who also works with her and Ray), the kind of bachelor who has a stylish loft right above NYC's Hogs and Heifers the bar featured in "Coyote Ugly", a source for new cows (apparently bulls will only mate with the same cow once). Of course we learn that Eddie suffered a bad breakup from a monogamous relationship, which can only mean that he's really sensitive and eventually the one for Jane.
Jane's buddy Liz (Marisa Tomei), who conveniently works for a men's magazine, convinces Jane to write up her theory, and Jane agrees, but only after creating a 65 year old PhD (shades of Dr. Ruth) as an authorial front. The article's a sensation and everyone's clammering for the author as a guest, including Jane's boss Diane Roberts (Ellen Barkin).
Hugh Jackman, resembling a lanky, young Clint Eastwood out from under his wolfen makeup, displays an easy likeable charm and warmth which elevates the material when he's on screen. Marisa Tomei is sharply creating a career as the funny, witty best friend ('remember, time wounds all heels'). Kinnear goes from eager puppy to whipped puppy as the subject of Jane's love/disdain. Barkin is fabulously slinkly as Diane Roberts, always on the prowl for the elusive interview. Except for one scene where she allows herself to get silly showing Eddie her old cheerleading moves, Judd is simply stale.
The oh-so-trite material (adapted from Laura Zigman's novel by Elizabeth Chandler, "The Little Princess") goes so far as to rip off the missed opportunity New Year's Eve party pairing of "When Harry Met Sally." Director Tony Goldwyn ("A Walk on the Moon") can't avoid cliches like title cards, schoolgirls making pronouncements directly to the camera and video montages.
"Someone Like You" is largely inoffensive. At least it has the convictions to turn its male bashing on its ear.
C
For more Reeling reviews visit www.reelingreviews.com
<EMAIL_ADDRESS><EMAIL_ADDRESS>The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


Nostra Conventions
This site is meant to be used as a reference and standard for any project that is build as part of the Nostra
Project.
Table of Contents
Note that the following items are not necessarily in order and they do not build upon each other.
- Versioning
- Naming Conventions
- Project Directory Structure
- Components
- README Structure
- Tests
- Examples
- Documentation
-
Tools
- NostraCMake
- clang-format
- clang-tidy
- TravisCI
- Doxygen


Hello there! I'm
Kevin Logue
I manage multi-disciplinary teams, write code, design things and wonder what caused all the grey hairs.
I'm currently an engineering manager in the sports technology industry.