I've always wanted to get around to making some blog posts/tutorials. It was Etienne Jacob's tutorials that introduced me to Processing (I previously used HTML Canvas) and inspired me to start posting on Twitter. Now with a few years of Processing under my belt, it seems as good a time as any to give it a shot!
My main goal with these posts is not necessarily to provide instructions, but to introduce a range of topics across math, science, and coding. Through these introductions, I hope to arouse curiosity, provide inspiration, and maybe even teach you a thing or two.
For this inaugural post, we'll be taking a look at subdivisions. The name is pretty self-explanatory; we'll be taking an object (in this case a square) and dividing it into multiple pieces. Of course to make things more interesting, we'll then be dividing those pieces into more pieces, and so on. I chose this topic since it covers a number of concepts including self-referential classes, looping techniques, and the dreaded recursion. Let's get started! Oh and FYI, we'll end up with something like this:
The finished product.
The Div
Class
To represent each division (or div) in our system, we're going to need a class. This class will contain the div's properties along with methods to render and iterate the system. To visualize a div, we'll draw a rectangle defined by two x-y coordinates.
class Div {
// Coordinates defining rectangle
float x1;
float y1;
float x2;
float y2;
Div(float x1, float y1, float x2, float y2) {
// Constructor for first div
this.x1 = x1;
this.y1 = y1;
this.x2 = x2;
this.y2 = y2;
}
void iterate() {
// Do something
}
void render() {
// Draw rectangle
rect(x1, y1, x2-x1, y2-y1);
}
}
Back in our main file, we can use the following code to define and draw our first div:
float border = 50; // border between main div and frame edge
Div div1; // initialize first div
void setup() {
size(800, 800, P2D); // initialize canvas
// construct first div
div1 = new Div(border, border, height-border, width-border);
}
void draw() {
background(200);
stroke(0);
strokeWeight(2);
fill(255);
div1.render(); // render div
}
Which leads to this very interesting result:
Our initial div. The first of its kind.
Self-Reference
To iterate our system, we are going to split our first div into smaller divs. In other words, our parent div is going to split into multiple child divs. To implement this relationship, we first need to cover the idea of self-reference. Within object-oriented programming, a self-referential object is an object that contains a reference to an object of the same class. In simpler and more familiar terms, each div is going to contain references to its child divs and its parent div. The implementation of this in our class is shown below: (omitting unchanged methods/ constructors)
import java.util.ArrayList;
class Div {
// Coordinates defining rectangle
float x1;
float y1;
float x2;
float y2;
Div parent; // parent Div object
ArrayList<Div> children = new ArrayList<Div>(); // list of child Divs
int childID; // Index of this div in its parent's child list
Div(float x1, float y1, float x2, float y2, Div parent, int childID) {
// Constructor for subsequent divs
this.x1 = x1;
this.y1 = y1;
this.x2 = x2;
this.y2 = y2;
this.parent = parent;
this.childID = childID;
}
}
The split()
Method
To implement the subdivision of our div, we're going to add a split()
method. This method should have two arguments: (1) the number of pieces we want to evenly split our div into and
(2) the axis (x or y) that we are splitting along. We will call these inputs nPieces
and splitAxis
, respectively. To perform the split, we will create a list
of floats, splitRatios
, that represent the ratios/percents that we are splitting at. For example, if we are splitting our div into four pieces along the x-axis, this list
would be [0, 0.25, 0.5, 0.75, 1]
. These ratios can also be seen as representing the locations of the lines drawn in the direction of the y-axis, as shown in the figure below:
Representation of the split()
method. In this figure, a div is split evenly into four pieces along the x-axis. These splits occur at the ratios shown
above (0-1), and are listed at the indeces found in square brackets (0-4). The ratios can be converted into coordinates using the given equation, where 0.5 is replaced
with the desired ratio.
And to calculate these ratios, the following code is used:
splitRatios = new float[nPieces + 1];
for (int i = 0; i <= nPieces; i++) {
// split evenly into nPieces
splitRatios[i] = (float)i/nPieces; // avoid integer division
}
To then convert these ratios into coordinates, we use the equation shown in the figure above, where 0.5
is replaced by the desired ratio, n :
$$x=x_1+n(x_2-x_1)$$
If we are splitting along the y-axis, x1 and x2 are replaced with y1 and y2. The coordinates along the opposite axis are held
constant in either case. Thus, we can construct all i
children using the lines:
if (splitAxis) { // x-axis
// add new subdivisions as children
for (int i = 0; i < nPieces; i++) {
Div newChild = new Div(x1 + splitRatios[i]*(x2-x1), y1,
x1 + splitRatios[i+1]*(x2-x1), y2,
this, i);
children.add(newChild);
}
} else { // y-axis
for (int i = 0; i < nPieces; i++) {
Div newChild = new Div(x1, y1 + splitRatios[i]*(y2-y1),
x2, y1 + splitRatios[i+1]*(y2-y1),
this, i);
children.add(newChild);
}
}
Pieces these two parts together, we get our complete split()
method:
void split(int nPieces) {
// Splits this div into nPieces, stored as child divs
splitRatios = new float[nPieces + 1];
for (int i = 0; i <= nPieces; i++) {
// split evenly into nPieces
splitRatios[i] = (float)i/nPieces; // avoid integer division
}
if (splitAxis) { // x-axis
// add new subdivisions as children
for (int i = 0; i < nPieces; i++) {
Div newChild = new Div(x1 + splitRatios[i]*(x2-x1), y1,
x1 + splitRatios[i+1]*(x2-x1), y2,
this, i);
children.add(newChild);
}
} else { // similar but for y-axis
for (int i = 0; i < nPieces; i++) {
Div newChild = new Div(x1, y1 + splitRatios[i]*(y2-y1),
x2, y1 + splitRatios[i+1]*(y2-y1),
this, i);
children.add(newChild);
}
}
}
Now, you may wonder why splitAxis
was not listed as an argument within the method. This is because we want to split our div in the opposite direction of our parent div.
While it is possibe to split along the same axis, it quickly results in odd-looking divs with extremely large aspect ratios. To avoid this, we will store splitAxis
as a
class property. When constructing a child div, we will set splitAxis
to be the opposite of the parent's splitAxis
value. For our initial div, we will randomly
set splitAxis
. The implementation of this is shown below:
class Div {
...
float[] splitRatios; // ratios representing the location of children
boolean splitAxis; // axis on which this div will split
// True = x-axis, axis False = y-axis
Div(float x1, float y1, float x2, float y2) {
// Constructor for first div
...
splitAxis = (random(0,1) < 0.5); // randomly set
}
Div(float x1, float y1, float x2, float y2, Div parent, int childID) {
// Constructor for subsequent divs
...
splitAxis = !parent.splitAxis; // opposite of parent
}
}
render()
Recursion
Now to test our method! Let's go back to our main function and split our initial div and some of its children:
void setup() {
size(800, 800, P2D);
// construct first div
div1 = new Div(border, border, height-border, width-border);
div1.split(3); // split initial div into three
div1.children.get(0).split(4); // split first child into four
// split that div's first child into five
div1.children.get(0).children.get(0).split(5);
}
Now let's hit run, and... huh.
An unexpected result. We expect to see the div split into multiple pieces.
What happened here is that we only rendered our initial div. Instead, we should now be rendering every div that doesn't have children. If a div has children, we do not
need to draw it, as the renderings of the children will cover it completely. To implement this, we need to use recursion. Returning to our render()
method,
we can add just a few seemingly simple lines:
void render() {
// Draw rectangle
if (children.size() != 0) { // if has children, iterate recursively
for (Div child : children) { // for each child
child.render(); // call this method
}
} else { // if no children, draw
rect(x1, y1, x2-x1, y2-y1);
}
}
What's happening here is essentially a queue. When render()
is called on a div with children, it adds all of its children to the front of the render queue. If any
of those children have children, they will then add them to the front of the queue. Once a div without children is rendered, it is removed from the queue. The queue is only clear
once all divs without children have been rendered. If we run our main file again, we now get the expected result!
Our intitial div was sucessfully split multiple times. It's now a great-grandparent.
The iterate()
Method
Now that we have our methods for splitting and rendering, we need to create a method to generate/split our system for us. That's where the iterate()
method mentioned
earlier comes in. The iterate method will decide both when to split a div, and how many pieces to split it into. There are a wide range of approaches to this step, and I encourage
you to try your own. For the chance to split a div, I arbitrarily came up with the equation:
$$P(split)=0.5^{layer}$$
Where layer
is the depth of the current div. The chance to split is set to 0 if layer
is greater than a class property named maxLayers
(which I set
arbitrarily to 6). For the number of splits, I arbitrarily came up with the equation:
$$nPieces=\lfloor 5\cdot(1-\sqrt{x})+2 \rfloor$$
Where x is generated via random(0,1)
. The weird square brackets represent floor()
. We can then use recursion to run iterate()
on all divs
without children:
class Div {
...
float layer;
int maxLayers = 6;
Div(float x1, float y1, float x2, float y2) {
// Constructor for first div
...
layer = 0;
}
Div(float x1, float y1, float x2, float y2, Div parent, int childID) {
// Constructor for subsequent divs
...
layer = parent.layer + 1;
}
void iterate() {
// Give each div that doesn't have children a chance to split
if (children.size() != 0) { // if has children, repeat recursively
for (Div child : children) {
child.iterate();
}
} else if (layer < maxLayers) { // if no children and < max depth
// chance to split, decreases with depth
float splitChance = pow(0.5, layer);
if (random(0, 1) < splitChance) { // if rolls chance to split
int nPieces = floor(5*(1-sqrt(random(0,1)))+2);
// more likely to have less splits (2 min, 6 max)
this.split(nPieces);
}
}
}
}
Now going back to our main script, we can run iterate()
a few times instead of manually splitting our divs:
void setup() {
size(800, 800, P2D);
// construct first div
div1 = new Div(border, border, height-border, width-border);
for (int i = 0; i < 20; i++) {
div1.iterate(); // iterate div
}
}
Our initial div was sucessfully split into many pieces using recursion.
Looks great! Now to add some dynamic movement.
Movement
To add movement, we need to adjust the splitRatios
of each div with children, then update the position of each div recursively. To adjust splitRatios
we can add a method adjustRatios()
. This method will take the original splitRatios for a given div, and adjust them slightly. We have to be careful, however, since
splitRatios[0]
and splitRatios[end]
must remain 0 and 1, respectively. Also, we must prevent consecutive splitRatios[i]
values from
overlapping. For a given splitRatio value (excluding [0] and [end]), I came up with the equation,
$$newRatio[i] = ogRatio[i] + \frac{\sin{(2\pi\cdot ogRatio[i] + 2\pi t)}}{10}$$
which varies the ratios back and forth slightly with time. sin()
and 2*PI*t
are used so that the ratios are returned to their original position at
t=1
, achieving a loop. This method is implemented in the following code:
class Div {
...
float[] ogSplitRatios; // originally created splitRatios
void split(int nPieces) {
...
ogSplitRatios = splitRatios.clone();
}
void adjustRatios() {
// Adjust childRatios using sin function
// First and last values must remain 0 and 1
// Inner values must not overlap nor cross 0,1
if (children.size() != 0) { // if has children
for (int i = 1; i < ogSplitRatios.length-1; i++) {
splitRatios[i] = ogSplitRatios[i] +
sin(2*PI*ogSplitRatios[i] + 2*PI*t)/10;
}
}
}
}
Note that in our split()
method, we must clone splitRatios
to record the original values (before we change them with adjustRatios()
). Now we
need to write one final method, updatePosition()
. This method will be used to recursively adjust and update the positions of our divs. For a given div, we will (1)
call adjustRatios()
, (2) update its position using the coordinates and splitRatios of its parent, and (3) call updatePosition()
for its children. This method
is implemented below:
void updatePosition() {
// Updates position of all divs dynamically
adjustRatios(); // adjust child ratios
// update position based on location and ratios recorded in parent
if (layer != 0) { // if not first layer
if (!splitAxis) { // parent split along x
x1 = parent.x1 + parent.splitRatios[childID]*(parent.x2 parent.x1);
x2 = parent.x1 + parent.splitRatios[childID+1]*(parent.x2-parent.x1);
y1 = parent.y1;
y2 = parent.y2;
} else { // parent split along y
x1 = parent.x1;
x2 = parent.x2;
y1 = parent.y1 + parent.splitRatios[childID]*(parent.y2-parent.y1);
y2 = parent.y1 + parent.splitRatios[childID+1]*(parent.y2-parent.y1);
}
}
for (Div child : children) { // iterate recursively
child.updatePosition();
}
}
Now we can update our main script to add in the time variable and a updatePosition()
call, and run!
float border = 50; // border between main div and frame edge
Div div1; // initialize first div
int nFrames = 200; // number of animation frames
float t; // global time variable
void setup() {
size(800, 800, P2D);
// construct first div
div1 = new Div(border, border, height-border, width-border);
for (int i = 0; i < 20; i++) {
div1.iterate(); // iterate div
}
}
void draw() {
// update time with frameCount
t = float(frameCount-1)/nFrames;
background(200);
stroke(0);
strokeWeight(2);
fill(255);
div1.updatePosition(); // update div positions
div1.render(); // render div
}
Our subdivisions are now dynamic!
Looks good, albeit a bit plain. Let's add some color to fix that.
Finishing Touches
To add color, we can add a couple class properties to store a color list and select a random color. You can select the colors on your own, or grab a palette online. Then we'll add a
fill()
call to our render()
method.
class Div {
...
// list of possible fill colors
int[][] colorList = {{185, 225, 220},
{243, 129, 129},
{117, 108, 131}};
// select random color
int[] divColor = colorList[int(random(0,colorList.length))];
void render() {
// Draw rectangle
if (children.size() != 0) { // if has children, iterate recursively
for (Div child : children) { // for each child
child.render(); // call this method
}
} else { // if no children, draw
fill(divColor[0],divColor[1],divColor[2]); // fill with divColor
rect(x1, y1, x2-x1, y2-y1);
}
}
}
Our finished product.
and we're done!
Wrap Up
Wow, that ended up being a lot longer than I originally expected. Props to you if you made it all the way through. Hope you learned something! A file with the complete, final code can be found at this GitHub gist.
There's many ways this code could be augmented and added to. Here's a few ideas that I've had/implemented:
- Add motion blur
- Extrude into 3D by adding a height value (see this Tweet)
- Dynamically change the
strokeWeight()
value depending on the layer - Vary the functions used in the
iterate()
method and theadjustRatios()
method - Change div colors based on their parent's color
- Use shapes other than squares/rectangles
- Cycle div contents recursively (see this Tweet)


160. Magic Multiplying Machine
time limit per test: 2 sec.
memory limit per test: 65536
KB
input: standard input
output: standard
output
Well known Las-Vegas casino "Big Jo" has recently introduced the
new playing machine, called Magic Multiplying Machine (MMM). MMM has N levers
and one big red button. Each lever is marked with some integer number ranging
from 1 to M, thus i-th lever is marked with number ai.
A player who wishes
to play on MMM inserts a coin into a special slot. After that she chooses some
levers and pulls them. After she has made her choice, she presses the big red
button. MMM blinks all its lights, rings its bells, plays diRerent tunes and
after that declares whether the player has won the game.
The algorithm for
determining whether the player has won is the following. If the player has
pulled some subset S in {1, 2, ... ,N} of levers, her score is the product of
numbers that these levers are marked with, taken modulo M (if the player has
pulled no levers, her score is 1):
The player has won the game if her score is
maximal possible for the given machine.
Given the description of some MMM
determine which levers should be pulled to win the game.
Input
The first line of the input file contains two integer numbers 1
<= N <= 10000 and 2 <= M <= 1 000. The second line contains N
integer numbers a1, a2, ..., aN ranging from 1 to M.
Output
In the first line of the output file print one integer number -
the score that should be obtained to win the game. In the second line print in
ascending order the numbers of levers that should be pulled to obtain this score
(levers are numbered starting from one). If there are several solutions, output
any one.
Sample test(s)
Input
Sample input #1
4 6
1 2 3 4
Sample input #2
4 4
4 4 4 4
Output
Sample output #1
4
1 4
Sample output #2
1
Note
You can download pdf version of this task
here
| Author: |
Andrew Lopatin, Nikolay Durov |
| Resource: |
ACM ICPC 2002-2003 NEERC, Northern Subregion |
| Date: |
November, 2002
|
| Server time: 2004-01-13 20:14:28 |
Online Contester Team © 2002 - 2003. All
rights
reserved. | | |


1 reference to DictionaryKey
Microsoft.PowerShell.Commands.Utility (1)
commands\utility\CustomSerialization.cs (1)
903
WriteOneObject(dictionaryEnum.Key, CustomSerializationStrings.
DictionaryKey
, depth);


Sweet of taste of freedom: Chocolate Berlin Wall destroyed
by The Associated Press, StaffPARIS -- So this is what freedom tastes like.
A French chocolate sculptor celebrated the 30th anniversary Saturday of the opening of the Berlin Wall by taking a hammer to a chocolate replica of the infamous barrier, distributing the sweet chunks to applauding bystanders.
Patrick Roger said it felt "amazing to share the taste, the values and a certain wind of liberty."
Just as Berliners smashed chunks out of the concrete wall, Roger and an assistant attacked the replica with gusto, quickly smashing a hole with their hammers.
Made with 200 kilos (440 pounds) of chocolate, the wall scrawled with the words "freedom" and, in German, "I am a Berliner!" was then brought crashing down onto the pavement in front of Roger's chocolate store in Paris, shattering into hundreds of pieces.


The light of their lanterns stretched just far enough to touch the other side, thrusting out of the dark like a giant’s broken teeth.  If there was any sound of it striking bottom, Rand never heard it.
He edged Red closer to the gap. As far down as he could thrust his lantern on its pole, there was nothing. Blackness below as blackness above, shearing off the light. If there was a bottom, it could be a thousand feet down. Or never. But on the other side, he could see what was under the bridge, holding it up. Nothing. Less than a span in thickness, and absolutely nothing underneath.
Abruptly the stone under his feet seemed as thin as paper, and the endless drop over the edge pulled at him. The lantern and pole seemed suddenly heavy enough to pull him right out of the saddle. Head spinning, he backed the bay away from the abyss as cautiously as he had approached.
“Is it to this you’ve brought us, Aes Sedai?” Nynaeve said. “All this just to find out we have to go back to Caemlyn after all?”
“We do not have to go back,” Moiraine said. “Not all the way to Caemlyn. There are many paths along the Ways to any place. We need only go back far enough for Loial to find another path that will lead to Fal Dara. Loial? Loial!”
The Ogier pulled himself away from staring at the gap with a visible effort. “What? Oh. Yes, Aes Sedai. I can find another path. I had . . . ” His eyes drifted back to the chasm, and his ears twitched. “I had not dreamed the decay had gone so far. If the bridges themselves are breaking, it may be that I cannot find the path you want. It may be that I cannot find a path back, either. The bridges could be falling behind us even now.”
“There has to be a way,” Perrin said, his voice flat. His eyes seemed to gather the light, to glow golden. A wolf at bay, Rand thought, startled. That’s what he looks like.
“It will be as the Wheel weaves,” Moiraine said, “but I do not believe the decay is as fast as you fear. Look at the stone, Loial. Even I can tell that this is an old break.”
“Yes,” Loial said slowly. “Yes, Aes Sedai. I can see it. There is no rain or wind here, but that stone has been in the air for ten years, at least.” He nodded with a relieved grin, so happy with the discovery that for a moment he seemed to forget his fear. Then he looked around and shrugged uncomfortably. “I could find other paths more easily than Mafal Dadaranell. Tar Valon, for instance? Or Stedding Shangtai. It’s only three bridges to Stedding Shangtai from the last Island. I suppose the Elders want to talk to me by this time.”
“Fal Dara, Loial,” Moiraine said firmly. “The Eye of the World lies beyond Fal Dara, and we must reach the Eye.”
“Fal Dara,” the Ogier agreed reluctantly.
Back at the Island Loial pored over the script-covered slab intently, drooping eyebrows drawn down as he muttered half to himself. Soon he was talking completely to himself, for he dropped into the Ogier language. That inflected tongue sounded like deep-voiced birds singing. It seemed odd to Rand that a people so big had such a musical language.
Finally the Ogier nodded. As he led them to the chosen bridge, he turned to peer forlornly at the signpost beside another. “Three crossings to Stedding Shangtai.” He sighed. But he took them on past without stopping and turned onto the third bridge beyond. He looked back regretfully as they started across, though the bridge to his home was hidden in the dark.
Rand took the bay up beside the Ogier. “When this is over, Loial, you show me your stedding, and I’ll show you Emond’s Field. No Ways, though. We’ll walk, or ride, if it takes all summer.”
“You believe it will ever be over, Rand?”
He frowned at the Ogier. “You said it would take two days to reach Fal Dara.”
“Not the Ways, Rand. All the rest.” Loial looked over his shoulder at the Aes Sedai, talking softly with Lan as they rode side-by-side. “What makes you believe it will ever be over?”
The bridges and ramps led up and down and across. Sometimes a white line ran off into the dark from the Guiding, just like the line they had followed from the Waygate in Caemlyn. Rand saw that he was not the only one who eyed those lines curiously, and a little wistfully. Nynaeve, Perrin, Mat, and even Egwene left the lines reluctantly. There was a Waygate at the other end of each of them, a gate back into the world, where there was sky and sun and wind. Even the wind would have been welcome. Leave them they did, under the Aes Sedai’s sharp eye. But Rand was not the only one to look back even after dark swallowed Island and Guiding and line.
Rand was yawning by the time Moiraine announced that they would stop for the night on one of the Islands. Mat looked at the blackness all around them and snickered loudly, but he got down as quickly as anyone else. Lan and the boys unsaddled and hobbled the horses while Nynaeve and Egwene set up a small oil stove to make tea. Looking like the base of a lantern, it was what Lan said Warders used in the Blight, where the wood could be dangerous to burn. The Warder produced tripod legs from the baskets they took off the packhorse, so the lantern poles could be set in a circle around their campsite.
Loial examined the Guiding for a moment, then dropped down cross legged and rubbed a hand across the dusty, pockmarked stone. “Once things grew on the Islands,” he said sadly. “All the books tell of it. There was green grass to sleep on, soft as any feather bed. Fruit trees to spice the food you’d brought with an apple or a pear or a bellfruit, sweet and crisp and juicy whatever the time of year outside.”
“Nothing to hunt,” Perrin growled, then looked surprised that he had spoken.
Egwene handed Loial a cup of tea. He held it without drinking, staring at it as if he could find the fruit trees in its depths.
“Aren’t you going to set wards?” Nynaeve asked Moiraine. “Surely there must be worse than rats in this. Even if I haven’t seen anything, I can still feel.”
The Aes Sedai rubbed her fingers against her palms distastefully. “You feel the taint, the corruption of the Power that made the Ways. I will not use the One Power in the Ways unless I must. The taint is so strong that whatever I tried to do would surely be corrupted.”
That made everyone as silent as Loial. Lan settled down to his meal methodically, as if he were stoking a fire, the food less important than fueling his body. Moiraine ate well, too, and as tidily as if they were not squatting on bare stone quite literally in the middle of nowhere, but Rand only picked at his food. The tiny flame of the oil stove gave just enough heat to boil water, but he crouched toward it as if he could soak up warmth. His shoulders brushed Mat and Perrin. They all made a tight circle around the stove. Mat held his bread and meat and cheese forgotten in his hands, and Perrin set his tin plate down after only a few bites. The mood became more and more glum, and everyone looked down, avoiding the dark around them.
Moiraine studied them as she ate. Finally she put her plate aside and patted her lips with a napkin. “I can tell you one cheerful thing. I do not think Thom Merrilin is dead.”
Rand looked at her sharply. “But . . . the Fade . . . ”
“Mat told me what happened in Whitebridge,” the Aes Sedai said. “People there mentioned a gleeman, but they said nothing of him dying. They would have, I think, if a gleeman had been killed. Whitebridge is not so big as for a gleeman to be a small thing.  Too important a part, I believe, to be cut off yet.”
Too important? Rand thought. How could Moiraine know . . . ? “Min? She saw something about Thom?”
“She saw a great deal,” Moiraine said wryly. “About all of you. I wish I could understand half of what she saw, but even she does not. Old barriers fail. But whether what Min does is old or new, she sees true. Your fates are bound together. Thom Merrilin’s, too.”
Nynaeve gave a dismissive sniff and poured herself another cup of tea.
“I don’t see how she saw anything about any of us,” Mat said with a grin. “As I remember it, she spent most of her time looking at Rand.”
Egwene raised an eyebrow. “Oh? You didn’t tell me that, Moiraine Sedai.”
Rand glanced at her. She was not looking at him, but her tone had been too carefully neutral. “I talked to her once,” he said. “She dresses like a boy, and her hair is as short as mine.”
“You talked to her. Once.” Egwene nodded slowly. Still not looking at him, she raised her cup to her lips.
“Min was just somebody who worked at the inn in Baerlon,” Perrin said. “Not like Aram.”
Egwene choked on her tea. “Too hot,” she muttered.
“Who’s Aram?” Rand asked. Perrin smiled, much like Mat’s smile in the old days when he was up to mischief, and hid behind his cup.
“One of the Traveling People,” Egwene said casually, but red spots bloomed in her cheeks.
“One of the Traveling People,” Perrin said blandly. “He dances. Like a bird. Wasn’t that what you said, Egwene? It was like flying with a bird?”
Egwene set her cup down deliberately. “I don’t know if anyone else is tired, but I’m going to sleep.”
As she rolled herself up in her blankets, Perrin reached over to nudge Rand in the ribs and winked. Rand found himself grinning back. Burn me, if I didn’t come out best for a change. I wish I knew as much about women as Perrin.
“Maybe, Rand,” Mat said slyly, “you ought to tell Egwene about Farmer Grinwell’s daughter, Else.” Egwene lifted her head to stare first at Mat, then at him.
He hastily got up to fetch his own blankets. “Sleep sounds good to me right now.”
All the Emond’s Field people began seeking their blankets then, and Loial, too. Moiraine sat sipping her tea. And Lan. The Warder did not look as if he ever intended to sleep, or needed to.
Even rolled up for sleep, no one wanted to get very far from the others. They made a small circle of blanket-covered mounds right around the stove, almost touching one another.
“Rand,” Mat whispered, “was there anything between you and Min? I barely got a look at her. She was pretty, but she must be nearly as old as Nynaeve.”
“What about this Else?” Perrin added from the other side of him. “She pretty?”
“Blood and ashes,” he mumbled, “can’t I even talk to a girl? You two are as bad as Egwene.”
“As the Wisdom would say,” Mat chided mockingly, “watch your tongue. Well, if you won’t talk about it, I’m going to get some sleep.”
“Good,” Rand grumbled. “That’s the first decent thing you’ve said.”
Sleep was not easily come by, though. The stone was hard, however Rand lay, and he could feel the pits through his blanket. There was no way to imagine he was anywhere but in the Ways, made by the men who had broken the world, tainted by the Dark One. He kept picturing the broken bridge, and the nothing under it.
When he turned one way he found Mat looking at him; looking through him, really. Mocking was forgotten when the dark around them was remembered. He rolled the other way, and Perrin had his eyes open, too. Perrin’s face was less afraid than Mat’s, but he had his hands on his chest, tapping his thumbs together worriedly.
Moiraine made a circuit of them, kneeling by each person’s head and bending down to speak softly. Rand could not hear what she said to Perrin, but it made his thumbs stop. When she bent over Rand, her face almost touching his, she said in a low, comforting voice, “Even here, your destiny protects you. Not even the Dark One can change the Pattern completely. You are safe from him, so long as I am close. Your dreams are safe. For a time, yet, they are safe.”
As she passed from him to Mat, he wondered if she thought it was that simple, that she could tell him he was safe and he would believe it. But somehow he did feel safe—safer, at least. Thinking that, he drifted into sleep and did not dream.
Lan woke them. Rand wondered if the Warder had slept; he did not look tired, not even as tired as those who had laid some hours on the hard stone. Moiraine allowed enough time to make tea, but only one cup apiece. They ate breakfast in the saddle, Loial and the Warder leading. It was the same meal as the others, bread and meat and cheese. Rand thought it would be easy to get tired of bread and meat and cheese.
Not long after the last crumb was licked off a finger, Lan said quietly, “Someone is following us. Or something.” They were in the middle of a bridge, both ends of it hidden.
Mat jerked an arrow from his quiver and, before anyone could stop him, loosed it in the dark behind them.
“I knew I shouldn’t have done this,” Loial muttered. “Never deal with an Aes Sedai except in a stedding.”
Lan pushed the bow down before Mat could nock another.  There’s no way to tell who it is.”
“That’s the only place they’re safe,” the Ogier went on.
“What else would be in a place like this besides something evil?” Mat demanded.
“That’s what the Elders say, and I should have listened to them.”
“We are, for one,” the Warder said dryly.
“Maybe it’s another traveler,” Egwene said hopefully. “An Ogier, perhaps.”
“Ogier have more sense than to use the Ways,” Loial growled. “All but Loial, who has no sense at all. Elder Haman always said it, and it’s true.”
“What do you feel, Lan?” Moiraine asked. “Is it something that serves the Dark One?”
The Warder shook his head slowly. “I don’t know,” he said as if that surprised him. “I cannot tell. Perhaps it’s the Ways, and the taint. It all feels wrong. But whoever it is, or whatever, he’s not trying to catch us. He almost caught up at the last Island and scampered back across the bridge so as not to.  Even if you can read Ogier, I have never heard or read of a human who could find his path off the first Island lacking an Ogier guide. Can you read Ogier?”
Lan shook his head again, and Moiraine said, “So long as he does not trouble us, we will not trouble him. We have no time. No time.”
As they rode off the bridge onto the next Island, Loial said, “If I remember the last Guiding correctly, there is a path from here that leads toward Tar Valon. Half a day’s journey at most. Not quite as long as it will take us to reach Mafal Dadaranell. I’m sure that—”
He cut off as the light of their lanterns reached the Guiding. Near the top of the slab, deeply chiseled lines, sharp and angular, made wounds in the stone. Suddenly Lan’s alertness was no longer hidden. He remained easily erect in his saddle, but Rand had the sudden impression that the Warder could feel everything around him, even feel the rest of them breathing. Lan began circling his stallion around the Guiding, spiraling outward. He rode as if he were ready to be attacked, or to attack himself.
“This explains much,” Moiraine said softly, “and it makes me afraid. So much. I should have guessed. The taint, the decay. I should have guessed.”
“Guessed what?” Nynaeve demanded just as Loial asked, “What is it? Who did this? I’ve never seen or heard of anything like it.”
The Aes Sedai faced them calmly. “Trollocs.” She ignored their frightened gasps. “Or Fades. Those are Trolloc runes. The Trollocs have discovered how to enter the Ways. That must be how they got to the Two Rivers undiscovered; through the Waygate at Manetheren. There is at least one Waygate in the Blight.” She glanced toward Lan before continuing; the Warder was far enough away that only the faint light of his lantern could be seen. “Manetheren was destroyed, but almost nothing can destroy a Waygate. That is how the Fades could gather a small army around Caemlyn without raising an alarm in every nation between the Blight and Andor.” Pausing, she touched her lips thoughtfully. “But they cannot know all the paths yet, else they would have been pouring into Caemlyn through the gate we used. Yes.”
Rand shivered. Walking through the Waygate to find Trollocs waiting in the dark, hundreds of them, perhaps thousands, twisted giants with half-animal faces snarling as they leaped forward in the blackness to kill. Or worse.
“They don’t use the Ways easily,” Lan called. His lantern was no more than twenty spans off, but the light of it was only a dim, fuzzy ball that seemed very distant to those around the Guiding. Moiraine led the way to him. Rand wished his stomach were empty when he saw what the Warder had found.
At the foot of one of the bridges the frozen shapes of Trollocs reared, caught flailing about them with hooked axes and scythe-like swords. Gray and pitted like the stone, the huge bodies were half sunken in the swollen, bubbled surface. Some of the bubbles had burst, revealing more snouted faces, forever snarling with fear. Rand heard someone retching behind him, and swallowed hard to keep from joining whoever it was.
A few feet beyond the Trollocs the bridge ended. The signpost lay shattered into a thousand shards.
Loial got down from his horse gingerly, eyeing the Trollocs, as if he thought they might come back to life. He examined the remains of the signpost hurriedly, picking out the metal script that had been inlaid in the stone, then scrambled back into his saddle. “This was the first bridge of the path from here to Tar Valon,” he said.
 Egwene hid her face in her hands. Rand moved his horse close to Bela and touched her shoulder. She twisted around and clutched him, shuddering. He wanted to shudder, too; her holding him was the only thing that kept him from it.
“As well we are not going to Tar Valon yet,” Moiraine said.
Nynaeve rounded on the Aes Sedai. “How can you take it so calmly? The same could happen to us!”
“Perhaps,” Moiraine said serenely, and Nynaeve ground her teeth so hard Rand could hear them grate. “It is more likely, though,” Moiraine went on, unruffled, “that the men, the Aes Sedai, who made the Ways protected them, building in traps for creatures of the Dark One. It is something they must have feared then, before the Halfmen and Trollocs had been driven into the Blight. In any case, we cannot tarry here, and whatever way we choose, back or ahead, is as likely to have a trap as any other. Loial, do you know the next bridge?”
“Yes. Yes, they did not ruin that part of the Guiding, thank the Light.” For the first time Loial seemed as eager to go on as Moiraine did. He had his big horse moving before he finished speaking.
Egwene clung to Rand’s arm for two more bridges. He regretted it when she finally let go with a murmured apology and a forced laugh, and not just because it had felt good having her hold onto him that way. It was easier to be brave, he discovered, when someone needed your protection.
Moiraine might not have believed a trap could be set for them, but for all the haste she spoke of, she made them travel more slowly than before, pausing before letting them onto any bridge, or off one onto an Island. She would step Aldieb forward, feeling the air in front of her with an outstretched hand, and not even Loial, or Lan, was allowed to go ahead until she gave permission.
Rand had to trust her judgment about traps, but he peered into the darkness around them as if he could actually see anything more than ten feet away, and strained his ears listening. If Trollocs could use the Ways, then whatever was following them could be another creature of the Dark One. Or more than one. Lan had said he could not tell in the Ways. But as they crossed bridge after bridge, ate a midday meal riding, and crossed still more bridges, all he could hear were their own saddles creaking, and the horses’ hooves, and sometimes one of the others coughing, or muttering to himself.  He could not say in which direction. At first he thought it was his imagination, but with time he became sure.
It’ll be good to feel the wind again, even if it’s cold.
Suddenly he blinked. “Loial, didn’t you say there isn’t any wind in the Ways?”
Loial pulled his horse up just short of the next Island and cocked his head to listen. Slowly his face paled, and he licked his lips. “Machin Shin,” he whispered hoarsely. “The Black Wind. The Light illumine and protect us. It’s the Black Wind.”
“How many more bridges?” Moiraine asked sharply. “Loial, how many more bridges?”
“Two. I think, two.”
“Quickly, then,” she said, trotting Aldieb onto the Island. “Find it quickly!”
Loial talked to himself, or to anyone who was listening, while he read the Guiding. “They came out mad, screaming about Machin Shin. Light help us! Even those Aes Sedai could heal, they . . . ” He scanned the stone hastily, and galloped toward the chosen bridge with a shouted, “This way!”
This time Moiraine did not wait to check. She urged them on to a gallop, the bridge trembling beneath the horses, lanterns swinging wildly overhead.  The sound of the wind became louder. Rand could hear it even over the pounding of hooves on stone. Behind them, and gusting closer.
They did not bother with the last Guiding. As soon as the light of the lanterns caught the white line running from it, they swung in that direction, still galloping. The Island vanished behind, and there was only the pitted, gray stone underfoot and the white line. Rand was breathing so hard he was no longer sure if he could hear the wind.
 Moiraine leaned out of her saddle, reaching toward the carvings, and suddenly pulled back. “The Avendesora leaf is not here!” she said. “The key is gone!”
“Light!” Mat shouted. “Bloody Light!”
Egwene touched Rand’s arm. Her lips trembled, but she only looked at him. He put his hand on top of hers, hoping he did not look more frightened than she did. He felt it. Back toward the Guiding, the wind howled. He almost thought he could hear voices in it, voices screaming vileness that, even half understood, brought bile up in his throat.
Moiraine raised her staff and flame lanced from the end of it. It was not the pure, white flame that Rand remembered from Emond’s Field, and the battle before Shadar Logoth. Sickly yellow streaked through the fire, and slow-drifting flecks of black, like soot. A thin, acrid smoke drifted from the flame, setting Loial coughing and the horses dancing nervously, but Moiraine thrust it at the gates. The smoke rasped Rand’s throat and burned his nose.
Stone melted like butter, leaf and vine withering in the flame and vanishing. The Aes Sedai moved the fire as fast as she could, but cutting an opening big enough for everyone to get through was no quick task. To Rand, it seemed as if the line of melted stone crept along its arc at a snail’s pace. His cloak stirred, as if caught by the edge of a breeze, and his heart froze.
“I can feel it,” Mat said, his voice quavering.
The flame winked out, and Moiraine lowered her staff. “Done,” she said. “Half done.”
A thin line ran across the stone carving. Rand thought he could see light—dim, but still light—through the crack. But despite the cutting, the two big, curved wedges of stone still stood there, half an arc out of each door. The opening would be big enough for everyone to ride through, though Loial might have to lie flat on his horse’s back. Once the two wedges of stone were gone, it would be big enough. He wondered how much each weighed. A thousand pounds? More? Maybe if we all get down and push. Maybe we can push one of them over before the wind gets here. A gust tugged at his cloak. He tried not to listen to what the voices cried.
As Moiraine stepped back, Mandarb leaped forward, straight toward the gates, Lan crouched in the saddle. At the last instant the warhorse twisted to catch the stone with his shoulder, just as he had been taught to catch other horses in battle. With a crash the stone toppled outward, and the Warder and his horse were carried by their momentum through the smoky shimmer of a Waygate. The light that came through was midmorning light, pale and thin, but it seemed to Rand as if the noonday summer sun blazed in his face.
On the far side of the gate Lan and Mandarb slowed to a crawl, stumbling in slow motion as the Warder reined back around toward the gate. Rand did not wait. Pushing Bela’s head toward the opening, he slapped the shaggy mare hard on the croup. Egwene had just enough time to throw a startled look over her shoulder at him before Bela carried her out of the Ways.
“All of you, out!” Moiraine directed. “Quickly! Go!”
As she spoke, the Aes Sedai thrust her staff out at arm’s length, pointed back toward the Guiding. Something leaped from the end of the staff, like liquid light rendered to a syrup of fire, a blazing spear of white and red and yellow, streaking into the black, exploding, coruscating like shattered diamonds. The wind shrieked in agony; it screamed in rage. The thousand murmurs that hid in the wind roared like thunder, roars of madness, half-heard voices cackling and howling promises that twisted Rand’s stomach as much by the pleasure in them as by what he almost understood them to say.
He booted Red forward, crowding into the opening, squeezing after the others, all forcing through the smoky glistening at once. The icy chill ran through him again, the peculiar sensation of being slowly lowered facedown into a winter pond, the cold water crawling across his skin by infinitesimal increments. Just as before it seemed to go on forever, while his mind raced, wondering if the wind could catch them while they were held like that.
As suddenly as a pricked bubble the chill vanished, and he was outside. His horse, for one abrupt instant moving twice as fast as he had been, stumbled and almost pitched him over his head. He threw both arms around the bay’s neck and hung on for dear life. While he got back into the saddle, Red shook himself, then trotted over to join the others as calmly as if nothing at all odd had happened. It was cold, not the chill of the Waygate, but welcome, natural winter-cold that slowly, steadily burrowed into flesh.
He pulled his cloak around him, his eyes on the dull glimmer of the Waygate. Beside him Lan leaned forward in his saddle, one hand on his sword; man and horse were tensed, as if on the point of charging back through if Moiraine did not appear.
The Waygate stood in a jumble of stones at the base of a hill, hidden by bushes except where the falling pieces had broken down the bare, brown branches. Alongside the carvings on the remains of the gates, the brush looked more lifeless than the stone.
Slowly the murky surface bulged like some strange, long bubble rising to the surface of a pond. Moiraine’s back broke through the bubble. Inchmeal, the Aes Sedai and her dim reflection backed out of each other.  Still watching the Waygate, Moiraine backed away.
The Waygate darkened. The hazy shimmer became murkier, sinking through gray to charcoal, then to black as deep as the heart of the Ways. As if from a great distance the wind howled at them, hidden voices filled with an unquenchable thirst for living things, filled with a hunger for pain, filled with frustration.
The voices seemed to whisper in Rand’s ears, right at the brink of understanding, and within it. Flesh so fine, so fine to tear, to gash the skin; skin to strip, to plait, so nice to plait the strips, so nice, so red the drops that fall; blood so red, so red, so sweet; sweet screams, pretty screams, singing screams, scream your song, sing your screams . . .
The whispers drifted, the blackness lessened, faded, and the Waygate was again a murky shimmer seen through an arch of carved stone.
Rand let out a long, shuddering breath. He was not the only one; he heard other relieved exhalations. Egwene had Bela alongside Nynaeve’s horse, and the two women had their arms around each other, their heads on each other’s shoulders. Even Lan seemed relieved, though the hard planes of his face showed nothing; it was more in the way he sat Mandarb, a loosening of the shoulders as he looked at Moiraine, a tilt of the head.
“It could not pass,” Moiraine said. “I thought it could not; I hoped it could not. Faugh!” She tossed her staff on the ground and scrubbed her hand on her cloak. Char, thick and black, marked the staff for over half its length. “The taint corrupts everything in that place.”
“What was that?” Nynaeve demanded. “What was it?”
Loial appeared confused. “Why, Machin Shin, of course. The Black Wind that steals souls.”
“But what is it?” Nynaeve persisted. “Even with a Trolloc, you can look at it, touch it if you have a strong stomach. But that . . . ” She gave a convulsive shiver.
“Something left from the Time of Madness, perhaps,” Moiraine replied. “Or even from the War of the Shadow, the War of Power. Something hiding in the Ways so long it can no longer get out. No one, not even among the Ogier, knows how far the Ways run, or how deep. It could even be something of the Ways themselves. As Loial said, the Ways are living things, and all living things have parasites. Perhaps even a creature of the corruption itself, something born of the decay. Something that hates life and light.”
“Stop!” Egwene cried. “I don’t want to hear any more. I could hear it, saying . . .
“There is worse to be faced yet,” Moiraine said softly. Rand did not think she meant it to be heard.
The Aes Sedai climbed into her saddle wearily and settled there with a grateful sigh. “This is dangerous,” she said, looking at the broken gates. Her charred staff received only a glance. “The thing cannot get out, but anyone could wander in. Agelmar must send men to wall it up, once we reach Fal Dara.” She pointed to the north, to towers in the misty distance above the barren treetops.


The pivot control can be navigated programmatically. Click the forward and backward buttons to navigate the pivot control between pivot items.
Content - Item One
Content - Item Two
Content - Item Three


Preparandooooo
Ingrese su username:
Siguiente
Usuarios
Elliot Fu
added you as a friend
1 Hour Ago
4 Likes


--- tags: - location - society - usps - post office - zip code - po box author: display_name: JP email<EMAIL_ADDRESS>date: 2011-11-23 09:29:34 -0700 categories: [] USPSPostOffices: hub: name: Utah USPS Post Offices item_id: c58ebc2a7c2643fca10e67dd55af71f1 updates: - February 2018 ZipCodePOBoxes: hub: name: Utah Zip Code PO Boxes item_id: 9a07e9d337314bb2af4de8f32502428e updates: - February 2018 ZipCodeBoundaries: hub: name: Utah ZIP Code Areas item_id: 4f9d1d1301864f8cabef08cbae7b2d3c updates: - November, 2019 - Added 84765 polygon for Motoqua in Washington County - January, 2019 - Added 84059 zip code in Utah County - February, 2016 - Updated 84321, 84235, 85326, 84332, 84339 - July, 2015 - Split the 84095 (South Jordan) zip code along the Bangerter Hwy to create the new zip code 84009 (South Jordan) - January, 2015 - Improvements were made to 84773 (Teasdale) and 84775 (Torrey) - January, 2015 - Adjusted the 84747 (Loa) and 84716 (Boulder) zip code boundaries to follow the address grid quadrant boundaries --- {% include abstract.html name="United States Postal Service" stewards="UGRC and the USPS" abstract="These datasets are related to mail delivery. Included are post office locations, zip code PO boxes, and zipcode boundaries in Utah." %}
Utah Post Offices represents the approximate locations of USPS Post Offices in Utah. Each post office includes the post office name, address, city, zip code, and post office type. Data were originally geocoded from a USPS list of post office addresses.
{% include contact.html subject=page.title contact=site.data.contacts.agrc %}
Utah Zip Code PO Boxes represents the approximate locations of USPS PO Boxes in Utah. Each zipcode's assigned post office has a point, therefore if a post office has multiple zipcodes, it will have multiple points.
The native spatial reference for this dataset is UTM Zone 12N, NAD83 (0.01 meter coordinate precision).
{% include contact.html subject=page.title contact=site.data.contacts.agrc %}
Zip Codes Boundaries represent an ongoing effort to approximate the geographic extents of five digit zip codes. The dataset was produced using a combination of methods and is based on several sets of source data. Editing methods include:
In addition, UGRC has used the locations of mailing addresses known to be valid to fine tune this dataset. The native spatial reference for this dataset is UTM Zone 12N, NAD83 (0.01 meter coordinate precision). There are no constraints or warranties with regard to the use of this dataset. Users are encouraged to attribute content to: State of Utah, SGID.
{% include contact.html subject=page.title contact=site.data.contacts.zip_codes %}


URL: {{url + resolvedResource + queryString}}
Method: {{method}}
Headers:
{{key}}: {{value}}
Data:
{{responseStatus}} {{responseStatusText}}
Built with love by @oneguystudio at BitPay. Code is open source on GitHub ».


16 February 2004
Situation (human) in Viet Nam
Laboratory tests have confirmed an additional case of H5N1 infection in Viet Nam. The patient is a young man from Ho Chi Minh City.
Altogether, 20 cases, 14 of them fatal, have been reported in Viet Nam.


How Much Algorithm Would You Like? A Little A Medium Amount A Lot So Much Algorithm
What are you interested in?
What are you disinterested in?
How Much Do You Love Our Machine Overlords? A Ton So Much The Maximum Amount You Have No Idea How Much
Do You Mind If We Sell Your Data To Advertisers/The NSA? Nope No


Toggle navigation
Performance
Usage
Popular Extents
Popular Extents
Dynamic Map Service -
Select Service
Filter -
Select Filter
Graphic -
Select Graphic
Number of draw requests - 0


Async-only api
This library no longer supports synchronous operations after version 20 as it was discovered that the official mongodb driver is doing faux sync (sync-over-async anti-pattern) under the hood in order to maintain backward compatibility.
"One caveat is that the synchronous legacy API in 2.0 is implemented by calling the low level async API and blocking, waiting for the Task to complete. This is not considered a performant way to use async APIs, so for performance-sensitive code you may prefer to use the 1.10 version of the driver until you are ready to convert your application to use the new async API." - Robert Stem
stress/load testing showed that it is inefficient at handling large volumes leading to thread-pool starvation. since the official driver has been made fully async after v2.0, it was decided to discourage consumers of this library from using the faux-sync api of the driver by removing all sync wrapper methods and only support async operations for IO bound work going forward.
it is highly recommended you build applications that run in server environments fully async from top to bottom in order to make sure they scale well.
however, in places where you can't call async code, you can wrap the async methods in a Task.Run()
like so:
Task.Run(async () =>
{
await DB.InitAsync("MyDatabase", "<IP_ADDRESS>");
})
.GetAwaiter()
.GetResult();
Tip
try not to do that except for calling the init method once at app start-up.
Sync-over-async wrapper utility
if for whatever reason you refuse to go the async/await route and don't really care about application performance, you can add the this utility class to your project and use that to wrap any async methods you'd want to call like so:
Run.Sync(() => book.SaveAsync());
var allBooks = Run.Sync(() =>
DB.Find<Book>()
.Match(_ => true)
.ExecuteAsync()
);
LINQ async extensions
in order to write async LINQ queries, make sure to import the mongodb linq extensions and write queries as follows:
using MongoDB.Driver;
using MongoDB.Driver.Linq;
var lastAuthor = await (from a in author.Queryable()
orderby a.ModifiedOn descending
select a).FirstOrDefaultAsync();


Twitter political ads ban no sure fix to voter manipulation
by ReutersLISBON: Brittany Kaiser, a former Cambridge Analytica director turned witness in a cross-Atlantic data privacy scandal, on Tuesday praised Twitter’s move to ban political advertising from its platform but said it was not a “permanent fix”.
She said voters in the United States and Britain were today as likely to be affected by data breaches as they were in 2016 during Donald Trump’s presidential campaign and Britain’s EU referendum campaign.
Cambridge Analytica, the political consultancy at the center of a scandal involving data harvested via Facebook, assisted Trump’s 2016 presidential campaign and the Leave campaign in Britain.
“It’s sad to see we got to the point when we have to ban political advertising in order to protect people from being manipulated, but we do,” Kaiser told reporters on Tuesday during the Lisbon Web Summit, Europe’s largest technology conference.
“I think we need political advertising in order to get people to register to vote, to go to the polls, to care about issues,” Kaiser said.
Last week, Twitter announced it was banning political ads, with CEO Jack Dorsey saying the platform believes “political message reach should be earned, not bought”.
Social media companies, including Twitter rival Facebook, face growing pressure to stop carrying ads that spread false information that could steer elections.
Kaiser believes it is unlikely that Facebook will follow in Twitter’s footsteps. Facebook CEO Mark Zuckerberg last week defended the company’s policy to run ads from politicians containing false or misleading claims, saying that Facebook did not want to stifle political speech.
“By allowing politicians in the UK and the US to engage in voter suppression tactics, using disinformation and discrimination, we are now just as unprotected as we were in December 2016,” she said.
“Why do I say this? Because in 2016 I was there,” Kaiser added. “The greatest threat to our democracies is not foreign but domestic.”


BILOXI BLUES RATING: 7 / 10 --> Good movie
For more reviews and trivia, visit http://surf.to/joblo
This film was the second installment of Neil Simon's trilogy of plays based on his own youth. In 1986, BRIGHTON BEACH MEMOIRS debuted as part one, with Jonathan Silverman embracing the lead role of Eugene Morris Jerome. BILOXI BLUES came out in 1988, with Matthew Broderick as the lead, and three years later, the TV movie BROADWAY BOUND closed off the triad, with Corey Parker as the protagonist.
PLOT: Story follows one Eugene Morris Jerome, an insecure, highly-observant wannabee writer, and virgin, from New York, over his ten-week World War II boot camp trial in Biloxi, Mississippi . Several divergent young recruits highlight his group of trainees, as well as an abusive drill sergeant who will stop at nothing to discipline this na´ve set of youths. Many rites of passages and lessons of life are entertained during this unsure time of their lives.
CRITIQUE: Interesting, playful comedy covers most bases of youthful exuberance and insecurity, offers a terrific performance by Christopher Walken as the highly unstable drill sergeant, but ultimately does nothing to reinvent the boot camp Army flic genre. This movie's strongest points of consideration are its witty and well-skewered lines delivered via the pen of writer extraordinaire, Neil Simon, and the fascinating exhibition delivered by Christopher Walken, in one of his best roles of his career.
Most of the characters in this film play caricatures of this period, but as a whole, the gang worked on the platform on which they were asked to perform, and many of their presentations were top-notch.  Great line!
The style of the film does not offer us much more than any other film of its genre, and the soundtrack could also have used a giant boost, but overall, the film does deliver many laughs, some decent performances, and a pretty intense scene between Walken and Broderick nearing its finish. Also, I have always been a fan of epilogues, so I did enjoy this one as well, but will admit that it did turn out to be a little too schmaltzy if you really think about it. But most of all, it is the idiosyncratic and genuine performance by Christopher Walken that solidified this movie for me. He delivered all of his lines with extreme coolness and pinache, and drew out a perfect scene as the drunk sergeant on the brink of sanity. If you liked him in TRUE ROMANCE (9/10) and AT CLOSE RANGE (7.5/10), you'll love him in this wonderfully unhinged achievement.
Little Known Facts about this film and its stars: The stage version of this film also saw Matthew Broderick playing Eugene Morris Jerome (He also replayed the character in the stage version of BRIGHTON BEACH MEMOIRS), Penelope Ann Miller as Eugene's first love, Matt Mulhern as Eugene's sometime-nemesis Wykowski, and Park Overall as the earthy, whiskey-voiced prostitute who teaches Eugene a thing or two about a thing or two. Corey Parker, the actor who portrays the part of Epstein in this film, played the lead character in Neil Simon's third installment of the series, BROADWAY BOUND, Eugene Morris Jerome (part played by Matthew Broderick in this film.) Jonathan Silverman, the actor who portrayed Eugene in the first installment of the series, BRIGHTON BEACH MEMOIRS, also showed up in the TV movie BROADWAY BOUND, as Stanley Jerome. Christopher Walken's real name is Ronald Walken. He has been married to Georgianne Walken since 1969. During the same year as this film, Penelope Ann Miller also played Winnie, PeeWee Herman's girlfriend, in BIG TOP PEE-WEE. Neil Simon's full name is Marvin Neil Simon.
Review Date: October 11, 1998 Director: Mike Nichols Writer: Neil Simon (based on his play) Producer: Ray Stark Actors: Matthew Broderick as Eugene Morris Jerome Christopher Walken as Sergeant Toomey Corey Parker as Epstein Penelope Ann Miller as Daisy Genre: Comedy Year of Release: 1988
Visit JoBlo's Movie Emporium http://surf.to/joblo
(c) 1998 Berge Garabedian
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


Performance Test(depends on api/perf)
Instance Number: RunAPI DEMO:
MySQL Sample MongoDB SampleCGI DEMO:
PHP DEMO(Fast-CGI/CGI):(PHP info)
Spawn-fcgi/Webpy:(Webpy)
FastCGI:(DEMO for GET)
SCGI:(DEMO for GET)
WebSocket DEMO:
| Send | Replied by Web Server: |
File Upload DEMO:


uk travel insurance compaire - Extensions
Travel Insurance - Single or Annual Travel Insurance - Post Office Whether your going away for a few days or are travelling for most of the year, choose the level of cover that suites you with Post Office Travel Insurance. http://www.postoffice.co.uk/travelinsurance
You can develop your own extensions
using the toshiba iso operating systems.
Syntax-Highlighting Addons
Travel insurance - Insurance - Which? Money Choose the best travel insurance cover for your trip. We compare and review high street, bank, internet and travel agents' travel insurance policies. Save money . http://www.which.co.uk/money/insurance/reviews-ns/travel-insurance/
Travel Insurance Trip Insurance Comparison for Travelers Voted the best travel insurance comparison site. . 250+ travel insurance plans. . Squaremouth provides travel insurance for USA and UK residents. http://www.squaremouth.com/ in one installer (526 kb).
A simple JavaScript Formatter (47kb)Travel insurance - Annual and single trip insurance comparison ... Whatever your trip, make sure you have travel insurance in place before setting off. . comparison service was previously provided by QuoteBanana.co.uk, see . http://www.tescocompare.com/travel-insurance.shtml
Compare Travel Insurance Quotes UK - Single and Annual Multi-trip Feb 20, 2012 . Compare Travel Insurance Quotes the FAST WAY. Get Quotes from up to 30 insurers and brokers in the uk using our unique quote system. http://www.quotezone.co.uk/travel-insurance.htm CertMaker for iOS and Android
Travel Insurance | Annual & Single Trip Travel Insurance ... Columbus is one of the UK's leading Travel Insurance providers. . suggests that a third of us (34%) booked their holiday further in advance in 2012 compared [. http://www.columbusdirect.com/
Windows 8 AppContainer Loopback Utility
UK Travel Insurance - Compare UK Travel Cover - Confused.com See the sights of your home country and get UK travel insurance from Confused. com - cover many eventualities including cancellation. http://www.confused.com/travel-insurance/uk Download
Now (60kb) or
what is pres bush height
Traffic Differ
Top 10 Travel Insurance Comparison UK - Compare Best Cheap ... Find cheap travel insurance quotes for your holiday in minutes - our travel insurance comparison tables make it easy to compare the cover offered by cheap . http://www.money.co.uk/travel-insurance.htm Download now (47kb).
SAZ Clipboard
Travel Insurance - Compare The Market See how much you could save when you compare travel insurance quotes from some of the UK's leading holiday insurance providers through . http://www.comparethemarket.com/travel-insurance/
Gallery
The Gallery extension (50kb) Travel Insurance Guide - Compares over 1500 policies! Compares the UK's top travel insurance policies. Shows the cheapest and most comprehensive cover offered, including single, annual multi-trip and all . http://www.travelinsuranceguide.org.uk/
Travel Insurance | Compare Cheap Holiday Insurance Quotes ... Understand how UK travel insurance companies operate and how your personal circumstances and travel plans affect the price you pay. Learn how to lower . http://www.moneysupermarket.com/travel-insurance/
AnyWHERE (sample)
The AnyWHERE extension (40kb) Travel Insurance Compare Holiday Insurance - Confused.com Compare cheap travel insurance quotes at Confused.com. . travel insurers pay out around £5.3 million in medical costs for UK travellers who fall ill abroad. http://www.confused.com/travel-insurance
RulesTab (sample)
Travel insurance companies and brokers - Macmillan Cancer Support Inclusion of a company or broker in this list does not mean that Macmillan recommends them. http://www.macmillan.org.uk/Cancerinformation/Livingwithandaftercancer/Practicalissues/Travel/Companies.aspx
Privacy Scanner
The Privacy Scanner
(41kb) Travel insurance: Compare smallprint against cheapest premiums ... Jan 28, 2013 . Our tables list THE best deals on travel insurance and allow you compare the small print. We also reveal the important tricks to enable you to . http://www.thisismoney.co.uk/money/holidays/article-1648137/Travel-insurance-Compare-smallprint-cheapest-premiums--quotes.html
Content-Blocking (sample)
The Content Blocker
sample (11kb) Travel Insurance - Compare Quotes For Holiday Insurance Cover ... The issuer of the travel insurance is Great Lakes Reinsurance (UK) PLC (ARBN 127 740 532, ABN 18 964 580 576, AFSL No. 318 603), trading as Great Lakes . http://www.medibank.com.au/travel-insurance/
Image-Flipper (sample)
The Image
Flipper sample (6kb) Top 10 Worldwide Travel Insurance UK - Compare Cheap World ... Find cheap worldwide travel insurance in minutes when you compare worldwide travel insurance quotes from the best world wide holiday insurers offering cover . http://www.money.co.uk/travel-insurance/worldwide-travel-insurance.htm
3rd-Party Extensions
Travel Insurance quotes - American Express UK American Express Travel Insurance quote: Single trip, annual, winter sports & more. 5% online discount. Don't leave home withoutit,Discounts,American Express UK. . Why choose American Express? Compare travel insurance · Single Trip . https://www.americanexpress.com/uk/personal/travel-insurance/travel-insurance.shtml
Travel insurance | Money | The Guardian Latest news and comment on Travel insurance from guardian.co.uk. . you're looking for travel, life or private medical cover, there are companies whose policy is . http://www.guardian.co.uk/money/travelinsurance
neXpert Performance Report Generator
Medical Travel Insurance | Pre-existing medical conditions travel ... Get instant medical travel insurance quotes for pre-existing medical . UK Broker Awards 2012. . Q. How I can compare medical travel insurance quotes? http://www.allcleartravel.co.uk/
StresStimulus
Travel insurance : Cancer Research UK : CancerHelp UK The best advice is to shop around and start well in advance of your planned holiday. It is worth getting . http://www.cancerresearchuk.org/cancer-help/coping-with-cancer/coping-practically/travel/travel-insurance
Watcher - Passive Security Auditor
Travel Insurance: overview of travel insurance benefits | HSBC UK HSBC travel insurance offers a choice of single trip and annual multi-trip. Click for a . Choice of single trip or annual multi-trip policiesWith UK only, European or . http://www.hsbc.co.uk/1/2/insurance/travel-insurance
Top 10 Backpacker Travel Insurance UK - Compare Best Cheap ... Compare the best backpacker travel insurance quotes & find a cheap backpacker travel insurance policy that provides you with the protection you need in . http://www.money.co.uk/travel-insurance/backpacker-travel-insurance.htm
Ammonite - Security Scanner
Compare Travel Insurance Having adequate insurance cover is a must whenever you travel. However, travel insurance prices and policies vary enormously so you have to shop around to . http://www.dealchecker.co.uk/cheap-insurance.html
Find Travel Insurance | Defaqto Find travel insurance using Star Ratings or find the Star Rating of your policy and see . Platinum Account Worldwide Travel Insurance . Travel Insurance.co.uk . http://www.defaqto.com/star-ratings/travel-insurance
christ church palm beach gardens fl
x5s - Automated XSS Security Testing AssistantTravel insurance - Single trip and Annual travel insurance quotes ... Here's a summary of what's included to help you compare travel insurance cover. Up to 9 people covered ideal for family travel insurance; Cancellation or . http://www.aviva.co.uk/travel/
- Detecting where safe encodings were not applied to emitted
user-inputs
- Detecting where Unicode character transformations might bypass
security filters
- Detecting where non-shortest UTF-8 encodings might bypass security
filters
falloutboy from under the cork tree
intruder21
Travel insurance, cheap annual travel insurance - British Airways Book a flight and insurance. You can purchase Value Single Trip travel insurance as part of your flight booking through British Airways online. Book a flight . http://www.britishairways.com/travel/insurance/public/en_gb
united way columbia willamette
HTML Inspector
Travel Insurance from £5.79 | Home | Primary Travel Insurance Get a Travel Insurance quote from Primary Travel Insurance today and see how much . We're sure that when you compare travel insurance quotes from Primary . http://www.primaryinsurance.co.uk/
Why our insurance? - STA Travel Whatever trip you've got planned, STA Travel international insurance has the right level of cover for you. http://www.statravel.co.uk/travel-insurance-comparison.htm
WCF Binary-Encoded Message Inspector
Compare Travel Insurance - American Express UK Compare travel insurance with American Express. Get the best prices and find the right level of cover to meet your needs. Get a quote online today. https://www.americanexpress.com/uk/personal/travel-insurance/compare-travel-insurance.shtml
Chad Sowald's Request-To-Code
Cheap Ski Travel & Holiday Insurance - MoneySupermarket.com Our price comparison tool will enable you to search and compare a large selection of UK travel insurance companies and help you to find the best ski travel . http://www.moneysupermarket.com/travel-insurance/ski-insurance/
Eyal's Extensions
- kentmore photo classic fiber base paper has written two extensions:
Thomas Deml's Export WCAT Script extension
Annual travel insurance - Compare The Market See how much you could save when you compare annual travel insurance quotes from some of the UK's leading providers through comparethemarket.com. http://www.comparethemarket.com/travel-insurance/annual/
Per-Response Latency Extension
Top 10 Long Stay Travel Insurance UK - Compare Cheap Extended ... Compare long stay travel insurance policies from the top long term travel insurance companies in the UK side by side, get quotes for the best long trip travel . http://www.money.co.uk/travel-insurance/long-stay-travel-insurance.htm
WPAD Server
Top 10 Travel Insurance Over 65 UK - Compare Cheap Holiday ... Find over 65 travel insurance that gives you the cover you need for peace of mind when you compare travel insurance over 65 quotes in our holiday insurance . http://www.money.co.uk/travel-insurance/over-65-travel-insurance.htm
XML Request InspectorSki Travel Insurance - Compare The Market Compare ski travel insurance policies for your skiing holiday online through . and then compare quotes from some of the UK's top providers to find ski travel . http://www.comparethemarket.com/travel-insurance/winter-sports/ski/ XML DataSet InspectorTravel advice: the best travel insurance for over-65s - Telegraph May 10, 2011 . But some companies don't increase premiums until age 70, and . JD Travel Insurance (01689 859102; www.jdtravelinsurance.co.uk) has no . http://www.telegraph.co.uk/travel/columnists/nicktrend/8505286/Travel-advice-the-best-travel-insurance-for-over-65s.html
©2013 Telerik
|


Here are some simple examples for each of the methods.
alert
Basic alert dialog:
jqUI.alert("I'm a jqUI alert dialog!");
Alert dialog with a title:
jqUI.alert({text:"I'm a jqUI alert dialog!",title:"This is a title"});
Basic alert dialog with a callback:
jqUI.alert("I'm a jqUI alert dialog!",function(){console.log("jqUI alert dialog closed")});
Alert dialog with a title and callback:
jqUI.alert({text:"I'm a jqUI alert dialog!",title:"This is a title"},function(){console.log("jqUI alert dialog closed")});
Alert dialog with a title, custom button label, and callback:
jqUI.alert({text:"I'm a jqUI alert dialog!",title:"I'm hungry",buttonLabel:"pizza"},function(){console.log("What kind of answer is pizza?")});
confirm
Basic confirm dialog with a callback:
jqUI.confirm("I'm a jqUI confirm dialog!",function(yes){console.log("You pressed "+yes?"OK":"Cancel")});
Confirm dialog with a title and callback:
jqUI.confirm({text:"I'm a jqUI confirm dialog!",title:"This is a title"},function(yes){console.log("You pressed "+yes?"OK":"Cancel")});
Confirm dialog with a title, custom button label, and callback:
jqUI.confirm({text:"True or false: jqUI is cool.",title:"This is a title",buttonLabel:["true","false"]},function(true_or_false){console.log("Your answer is "+true_or_false)});
prompt
Basic prompt dialog with a callback:
jqUI.prompt("Please type your name.",function(name){jqUI.alert("Hello "+name)});
Prompt dialog with a title and callback:
jqUI.prompt({text:"Please type your name.",title:"Have we met before?..."},function(name){jqUI.alert("Hello "+name)});
Prompt dialog with a title, custom button label, and callback:
jqUI.prompt({text:"Please type your name.",title:"Have we met before?...",buttonLabel:["Nice to meet you","I like to keep my personal information private"]},function(name){jqUI.alert("Hello "+name)});
Prompt dialog with a default value and callback:
jqUI.prompt("What's your favorite source-sharing site?","GitHub",function(site){
if (site=="GitHub") jqUI.alert("I like GitHub too.")
else if (site=="SourceForge") jqUI.alert("I'm starting to move away from SourceForge...")
else jqUI.alert("I've never heard of that one.")
});
Prompt dialog with a title, default, and callback:
jqUI.prompt({text:"What's your favorite source-sharing site?",title:"Open source FTW!"},"GitHub",function(site){
if (site==null) jqUI.alert("What, you like proprietary?")
else if (site=="GitHub") jqUI.alert("I like GitHub too.")
else if (site=="SourceForge") jqUI.alert("I'm starting to move away from SourceForge...")
else jqUI.alert("I've never heard of that one.")
});
The same example above, but set using {value:"default"}
:
jqUI.prompt({text:"What's your favorite source-sharing site?",title:"Open source FTW!",value:"GitHub"},function(site){
if (site==null) jqUI.alert("What, you like proprietary?")
else if (site=="GitHub") jqUI.alert("I like GitHub too.")
else if (site=="SourceForge") jqUI.alert("I'm starting to move away from SourceForge...")
else jqUI.alert("I've never heard of that one.")
});
Prompt dialog with a default value and no callback (useful for getting a user to copy something) (currently buggy):
jqUI.prompt("Copy this code:","0a6e846b954e345951e710cd6ce3440e"); // MD5 of jquery-2.0.3.min.js


This is part 4 of a series of articles about deploying your site to Amazon Web Services (AWS), Amazon's counterpart to Windows Azure.
In parts 1, 2 and 3, you saw how to use the AWS service Elastic Beanstalk to deploy a load balanced IIS based web application with a SQL Server database and its own domain name. This involved defining your EC2 servers, database server, etc. by completing a series of menus.
This part introduces the AWS service CloudFormation. This allows you to express your entire environment in a text file called a template.
The solution presented in this article uses a template to define all the web servers, database server, load balancer, name servers, etc. needed to host a web application. It also takes care of deploying the web application itself. Running a single Publish.ps1 PowerShell script will create/update all the bits of infrastructure and deploy the web application, so when it's done, you have a running web site.
Specifying your environment by fillout out a few forms is very convenient. However, once your environment becomes a bit more complicated, you'll quickly run into some drawbacks with this method:
The solution is to express your environment in a text file. This is easy to store, give to others and source control.
The AWS service CloudFormation lets you do exactly that. You define everything as a single large JSON object in a template file. CloudFormation takes that file and creates all the servers, load balancers, etc. you specified. This environment is called a stack.
When it comes time to modify your stack - remove/add servers, upgrade/downgrade servers, etc. - you change your template and invoke CloudFormation again. It will figure out how to modify your existing stack to your desired new stack making the fewest changes and causing the least disruption.
Stacks have their own name, such as "Test" or "Live". You can have multiple stacks and manage them independently. If you want 2 identical stacks, you'd use the same template to create them both.
In addition to infrastructure, CloudFormation will also deploy software for you, such as a web application.
CloudFormation is a low level tool. Whereas Elastic Beanstalk takes care of lots of details such as creating the right security groups, you have to define all this in your template. There are many details to get right - and many ways to get it wrong. I found that the learning curve can be quite steep.
When I set out to create an MVC web application with SQL Server using CloudFormation, I found that:
So I'm publishing the fully fledged working solution here that I arrived at. You should be able to use this as is for your own web application, or as a basis for your own solution.
Note that this is not an introduction to CloudFormation or AWS. The focus of this article is on describing the solution I came up with. However, it has many links to relevant parts of the AWS documentation to get all the details. This is not too hard and you'll learn a lot.
The solution described in this article sets out to achieve 2 goals: to deploy certain infrastructure and to deploy a web application and its updates.
The infrastructure goal was to deploy a web application that uses a database and that has its own domain:
Lets start from the center of the picture:
Although reasonably priced for a company, this feature is probably too expensive for a personal site. So I created both a CloudFormation template without a standy and a template with a standby.
The solution also achieves some software deployment related goals:
I didn't look into database schema updates. If you use Entity Framework Code First, the web application itself will update the schema for you. However, I appreciate more work would be needed if you can't use Entity Framework or Code First.
The solution consists of a number of templates, scripts, etc., which are in the downloads. The next section shows how to use those components.
If you have a look at its web.config file, you'll find that it has a web.release.config transform to generate the Release version. That Release version has the placeholders {{DbUsername}}, {{DbPassword}}, {{DbServer}} and {{Version}}. During deployment these will be replaced by the actual database server details and the software version.
Using AWS services is not free. This section is here to spell this out. Personally, I found the amounts involved to be tiny, except for Multi-AZ deployments - do not leave these running overnight.
| Pricing Page | Service is used for |
|---|---|
| CloudFormation | Deployment configuration |
| EC2 instances | Virtual machines running web servers |
| Elastic Load Balancing | Load balancer |
| Auto Scaling | Spinning up/down web servers in response to load |
| Route53 | DNS name servers |
| S3 | Storing software packages |
| RDS, SQL Server licence | Database server (see below) |
Multi-AZ deployments are much more expensive than a database server without standby.
Amazon have implemented fail over for SQL Server servers using the SQL Server Mirroring feature. This feature is not available on SQL Server Express or SQL Server Web Edition.
As of March 2015, Your cheapest option that supports mirroring would be a SQL Server Standard Edition database on a db.m1.small instance (pricing).
Keep in mind that AWS will charge you for the SQL Server Standard Edition licence, while a SQL Server Express licence is free.
Also, you'll be paying for 2 database servers - the main server and the standby.
If you're just playing around, I wouldn't keep a Multi-AZ deployment running overnight.
This section shows how to spin up the infrastructure plus deploy a web application. First we need to get some once-off preliminaries out of the way, and then we can run the Publish.ps1 script to create the stack. You can use the same script to update your stack later on.
I'm assuming you have an AWS account (get one), and a key pair (get one).
Download all the components to a directory on your computer. It may be easiest to simply download the entire Github project with all the articles in this series and then grab the components.
The user (probably yourself) that will run the Publish.ps1 script needs to have all the permissions required to spin up all the different infrastructure elements.
You express these permissions as an IAM policy. You then attach that policy to the user.
First create the policy:
Then attach your new policy to the user:
When you run an AWS PowerShell command, it sends a message to AWS to make an update or retrieve information. Just as you need to log into AWS before you can do this manually, the command must carry credentials, so it can be authenticated by AWS.
You could pass your credentials to each command, but that means your credentials are exposed in your PowerShell scripts.
A better way is to store your credentials in a credentials store, which is simply a file somewhere on your machine:
Set-AWSCredentials -AccessKey <acess key> -SecretKey <secret key> -StoreAs <store name>
As an aside, if you have a look at the Publish.ps1 script, you'll see that it uses this command to tell the PowerShell commands in the current session to use the credentials in the credentials store:
Set-AWSCredentials -ProfileName <store name>
You don't want everybody in the world to be able to try and RDP into your EC2 instances or SSMS into your database servers.
To lock this down, the Publish.ps1 script lets you pass in the CIDR of the machine that can RDP or SSMS into your servers.
To find the CIDR of your machine:
You only need to do this if you plan to use a Multi-AZ deployment.
AWS' implementation of Multi-AZ deployments for SQL Server is based on the SQL Server Mirroring feature. To switch on this feature, you need to associate your RDS instance with an option group that has the mirroring option enabled.
Because this option group is simply a bit of infrastructure, you'd think you can create this in a CloudFormation template. Oddly, that cannot be done. You have to create it manually once off. When you run Publish.ps1, you'll pass in the name of the option group that you create here via a parameter.
To create the option group:
With the preliminaries done, you can now run the Publish.ps1 script to spin up the infrastructure and deploy the web application.
Running this script takes a while. Spinning up a new stack and deploying the site takes about 20 minutes in my experience. If you go for a stack with a Multi-AZ database deployment, 50 minutes is more like it.
Luckily, updates (running the script again for the same stack) tend to take far less time because CloudFormation does the minimum necessary to do the updates.
If you own a spare domain name that you want to use here, you'll pass that to the script via the websiteDomain parameter.
If you don't have a domain to use right now, just use a bogus domain such as "mybogusdomain.com".
.\publish.ps1 -version <code version> -stackName <stack name> -websiteDomain <web site domain> -keyName <key name> -credentialsStoreName <credential store name> -adminCidr <admin cidr> -dbMasterUsername <database username> -dbMasterUserPassword <database password> -bucketName <S3 bucket to store code> -templatePath <template file> -csProjPath <.csproj file of your web application> -dbOptionGroupName <option group name> -stackPolicyPath <file with stack policy>
This is just an example that spins up infrastructure without a Multi-AZ deployment. It assumes you stored the downloaded files in a directory "c:\aws".
Do not copy this blindly, but use your own parameter values, especially the ones that are underlined below.
.\publish.ps1 -version 1.0.0 -stackName teststack -websiteDomain mybogusdomain.com -keyName mykeyname -credentialsStoreName mycredentials -adminCidr <IP_ADDRESS>0/32 -dbMasterUsername dbusername -dbMasterUserPassword 'MustBe$uperHardToGu3ss!' -bucketName must-be-unique-across-all-S3-buckets-in-AWS -templatePath 'c:\aws\Template with SQL Server Express\Ec2RdsRoute54.template' -csProjPath 'c:\aws\SimpleSiteWithDb\SimpleSiteWithDb\SimpleSiteWithDb.csproj' -stackPolicyPath 'c:\aws\stackpolicy.txt'
If any parameter value contain a $, enclose the parameter value with single quotes ('), not with double quotes. That way, PowerShell won't regard the $ as the start of a variable and try to expand it.
Version of the code you're deploying. For example "2.1.0". The version doubles as the name of the code package in the S3 bucket. If you're running Publish.ps1 to update infrastructure whilst keeping the web application the same, use the same version.
For example, "Test" or "Live". The set of servers, etc. you create with a template is called a stack. You can create a different set of servers by passing in a different stack name.
Domain of the web application that will be associated with the name servers. For example, "mydomain.com" for your Live stack, or "test-domain.com" for your Test stack.
Name of the key pair that you created earlier. You'll use this to log into your EC2 instances. Remember that key pairs are tied to a region.
Name of the credentials store where you stored your credentials earlier.
Use the CIDR you found earlier.
RDS only supports SQL Server Authentication. These are the username and password that will be able to access your new database server via SSMS, and that will be inserted into your web.config.
S3 bucket where the code packages will be stored. This name must be unique across all S3 buckets hosted by AWS. To make sure a given S3 bucket name is available, it would be easiest to create the S3 bucket yourself and then pass your chosen name in via this parameter. To open the S3 dashboard, click Services | S3.
Path to the CloudFormation template to use. Use one of the templates in the downloads or use your own.
If you use your own template and it has parameters, be aware that the Publish.ps1 script sets only a limited set of parameters (in the method launch-stack). All other parameters must be optional and/or have defaults.
Path of the .csproj file of the web application you're deploying. The Publish.ps1 script will build the site in release mode, package up the code and store the package in the S3 bucket.
Name of the option group you created earlier that has mirroring enabled. Only use this if you're using a template that creates a SQL Server Standard Edition (or higher) database server (such as this template).
If you try to use such an option group with an engine that does not support mirroring, such as SQL Server Express or SQL Server Web Edition, CloudFormation will fail to create your stack.
File path of a stack policy to protect for example your database during stack updates (example). If you do not use a stack policy, do not use this parameter.
After you've created your stack, you need to change the configuration of your domain name so it uses your new Route53 name servers.
Part 3 of this series described how to do that here.
If you have an existing database, you'll want to copy its schema and data to your new RDS database. Part 2 of this series described how to do that here.
Unless you delete your database server, this needs to be done only once after the initial creation of your stack.
This section isn't a detailed discussion of every file in the downloads. That would be very boring. I also provided a lot of comments and apart from the templates the files are not very complicated.
Instead, this section discusses some of the more interesting things I learned when building this solution.
On a high level, a CloudFormation template is simply a long list of infrastructure resources. The introduction to building CloudFormation templates is well worth reading, as is the user guide. There are also the Pseudo Parameters Reference and the Intrinsic Function Reference.
I gained a lot from looking at sample templates and snippets. Also, each resource has a type, such as AWS::RDS::DBInstance. Googling those types and understanding what they do taught me a lot on how AWS works.
Having said that, there were a few tricky bits I wanted to discuss here.
The auto scaling group is responsible for creating new EC2 instances. This includes installing the web application, installing IIS, etc.
This installation work is handled by a launch configuration - a separate resource. If you search for AWS::AutoScaling::AutoScalingGroup in the template, you'll find that it is associated with the auto scaling group via the auto scaling group's LaunchConfigurationName property.
If you now search for LaunchConfig, you'll find that it knows everything about configuring a new EC2 instance, including the AMI image id, its instance type and everything related to installing the web application. The installation story is spread over two properties: the UserData property and the AWS::CloudFormation::Init object in the Metadata property.
The UserData property contains scripts that will be run on the new EC2 instance after it has been created. Oddly, it is Base64 encoded. Luckily, the built in intrinsic function Fn::Base64 does the Base64 encoding for us:
"LaunchConfig" : { "Type" : "AWS::AutoScaling::LaunchConfiguration", "Properties" : { "UserData" : { "Fn::Base64" : { "Fn::Join" : ["", [ "<script>\n", "... MS-DOS commands ... \n" "</script>\n", "<powershell>\n", "... PowerShell commands ... \n" "</powershell>\n" ]] } } } }
Looking at the template, you'll see that the one MS-DOS command calls the cfn-init.exe program. This CloudFormation Helper Script is always available on an EC2 instance. It actions the meta data in the AWS::CloudFormation::Init object. You'll see below that the AWS::CloudFormation::Init object used in this template gets cfn-init.exe to load a package file (a .zip file) from the S3 bucket and extract the files into the c:\inetpub\deploy directory.
After cfn-init.exe has executed, the PowerShell script kicks in. This finds all files called Deploy.ps1 within the code package and invokes them as PowerShell scripts. Note that it has to set the execution policy to Bypass temporarily to allow this to happen. It then cleans up the c:\inetpub\deploy directory.
The AWS::CloudFormation::Init documentation is well worth reading. One of its many tricks is the sources section, which allows you to download a .zip file from a URL and extract it into a directory on the EC2 instance. Here that URL is the package in the S3 bucket, but you could also load a .zip file from Github.
In principle you can extract the files in any directory. However, keep in mind that:
This is why in the end I used c:\inetpub\deploy as a temporary directory to extract the web application.
You can run the Publish.ps1 script to purely install a new version of your web application, without changes to the CloudFormation template. As part of this, Publish.ps1 uploads a new package to the S3 bucket. Question is how to get the launch configuration to pick up this new version and replace EC2 instances running the old version with EC2 instances running the new version. Luckily, AWS makes this fairly easy.
Firstly, when you update a property of a launch configuration, that launch configuration gets replaced by a new configuration. Then when its auto scaling group creates new EC2 instances, those instances receive the latest version of your web application.
If you have a look at the AWS::CloudFormation::Init object used in the launch configuration, you see that the sources property changes when you update the Version parameter. This is because the name of every package is based on the version. So that solves how to give new EC2 instances the latest web application version.
Basing the names of packages on their version means that packages of previous versions are preserved (unless you manually delete them). Obviously this takes space. In order to save space, you could give all packages the same name, so old packages get overwritten (you would have to modify the Publish.ps1 script to make this happen). However, in that case the sources property no longer changes with the version.
In that case, to still have the launch configuration replaced when the version changes, you could set the Version property on the Metadata:
"LaunchConfig" : { "Type" : "AWS::AutoScaling::LaunchConfiguration", "Metadata" : { "Version" : { "Ref" : "Version" },
Having made sure that new EC2 instances receive the latest code, we still have to get rid of the EC2 instances running old code. You can do this by specifying an UpdatePolicy Attribute for your auto scaling group (in the template, search for "UpdatePolicy"). In addition to causing the auto scaling group to replace EC2 instances in a rolling update, this also lets you specify how many EC2 insances get replaced in one go, etc.
For the EC2 instances to load the package from the S3 bucket, they have to have permission to do so.
This can be done by creating a role. This is a collection of permissions that can be assigned to for example a user on a temporary basis. The permissions themselves are contained in a policy, which needs to be attached to the role.
In the template, the permission to execute a GetObject action (that is, file load) on the package is encoded in a policy in the RolePolicies resource of type AWS::IAM::Policy. Its Roles property attaches the policy to the InstanceRole resource of type AWS::IAM::Role.
An added twist is that it isn't the EC2 instance itself that will be loading the package, but software running under Windows on that virtual machine. Because of this, InstanceRole needs to be first added to an InstanceProfile (details). In the template this InstanceProfile is imaginatively called InstanceProfile.
Finally, we can now attach InstanceProfile to the launch configuration (resource LaunchConfig) via its IamInstanceProfile property.
In addition to allowing EC2 instances to read a file from an S3 bucket, you also need to provide credentials for accessing those files (unless they are not protected at all).
You do this by adding a AWS::CloudFormation::Authentication object to the Metadata of your launch configuration (search for "AWS::CloudFormation::Authentication" in the template). You can use this to provide credentials for any resources or files listed in your AWS::CloudFormation::Init object. If you were to retrieve files or resources from for example Github, this would be the place to provide your Github credentials.
As far as providing credentials for the S3 bucket is concerned, the simplest way here is to refer to the InstanceRole object that had already been created by the template.
Some pages that I found useful:
One goal was to have a version tag on each EC2 instance, to make it easy to find out what software version it runs. Of course, EC2 instances get created and terminated by the auto scaling group, so you can't add tags directly to the EC2 instances.
A simple solution is to add the version tag to the auto scaling group itself (details). If you look at the WebServerGroup (of type AWS::AutoScaling::AutoScalingGroup) in the template, you'll find that it has a Tags property containing the version tag. Setting PropagateAtLaunch to true ensures that the tag will be copied to newly launced EC2 instances.
You run this PowerShell script to create or update a stack.
This script interacts with AWS using PowerShell Cmdlets provided by AWS Tools for Windows PowerShell. I found that this works well and is very well documented.
Some things I learned while writing this script:
In fact, AWS regularly provides new updated AMIs with new IDs, so hard coding IDs won't work long term. The solution was to get the latest EC2 instance AMI each time you create or update a stack:
$imageId = (Get-EC2ImageByName -Names WINDOWS_2012R2_BASE | Select -ExpandProperty ImageId)
New-CFNStack -Capability @( "CAPABILITY_IAM" ) ....
msbuild $csProjPath /t:Package /p:Configuration=Release /p:PackageLocation=$releaseZip /p:AutoParameterizationWebConfigConnectionStrings=False
I looked at alternatives such as OctoPack, but this is the simplest way and it works well.
By default, the Package target replaces the web.config's connection by a replacable token, which is not what I want here. Setting AutoParameterizationWebConfigConnectionStrings to False suppresses this behaviour.
This PowerShell script runs on the EC2 instance after the web application package has been copied there and has been unzipped. It isn't complicated and well documented.
A few interesting things:
The reason behind this is that the IIS Cmdlets require the WebAdministration module to have been loaded, and I found I couldn't count on this always being the case. So I used appcmd.exe which always works.
The solution was to re-install the .Net framework (Stack Overflow discussion), using
cmd /c %systemroot%\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -i
Out-File ..... -encoding UTF8
This is the web.config transform that generates the release version of the web.config. You can see the placeholders that will be replaced by Deploy.ps1.
Some connection strings use Integrated Security=SSPI;. Do not use this with an AWS hosted site. It will cause AWS to try to log into your database with the NT AUTHORITY\ANONYMOUS LOGON account rather than your own account - which will fail.
In future parts, I am intending to write about deploying a stack from TeamCity, blue/green deployments and breaking large templates into manageable pieces.