In this section, we present three example programs that illustrate the use of maps and multimaps. These examples deal with a telephone database, graphs, and a concordance.
NOTE -- The complete example program is in the file tutorial tele.cpp.
A maintenance program for a simple telephone database is a good application for a map. The database is simply an indexed structure, where the name of the person or business (a std::string) is the key value, and the telephone number (a long) is the associated entry. We might write such a class as follows:
typedef std::map<std::string, long, std::less<std::string>, std::allocator<std::pair<const std::string, long> > > friendMap; typedef friendMap::value_type entry_type; class telephoneDirectory { public: void addEntry (std::string name, long number) { database[name] = number; } void remove (std::string name) { database.erase (name); } void update (std::string name, long number) { remove (name); addEntry (name, number); } void displayDatabase () { std::for_each (database.begin (), database.end (), printEntry); } void displayPrefix (int); void displayByPrefix (); private: friendMap database; };
Simple operations on our database are directly implemented using member functions of the map. Adding an element to the database is simply an insert(), removing an element is an erase(), and updating is a combination of the two. To print all the entries in the database we can use the for_each() algorithm, and apply the following simple utility routine to each entry:
void printEntry (const entry_type & entry) { std::cout << entry.first << ":" << entry.second << std::endl; }
We now use a pair of slightly more complex operations to illustrate how a few of the algorithms described in Chapter 13 can be used with maps. Suppose we want to display all the phone numbers with a certain three-digit initial prefix. We use the std::find_if() function, which is not to be confused with the find() member function of map, to locate the first entry. Starting from this location, subsequent calls on std::find_if() uncover each successive entry:
void telephoneDirectory::displayPrefix (int pfx) { std::cout << "Listing for prefix " << pfx << std::endl; friendMap::iterator where = std::find_if (database.begin (), database.end (), checkPrefix (pfx)); while (where != database.end ()) { printEntry (*where); where = std::find_if (++where, database.end (), checkPrefix (pfx)); } std::cout << "end of prefix listing" << std::endl; }
For the predicate to this operation, we require a boolean function that takes only a single argument, the pair representing a database entry, and tells us whether or not it is in the given prefix. There is no obvious candidate function, and in any case the test prefix is not being passed as an argument to the comparison function. The solution to this problem is to employ a common C++ Standard Library technique: define the predicate function as an instance of a class, and store the test predicate as an instance variable in the class, initialized when the class is constructed. The desired function is defined as the function call operator for the class:
long prefix (const entry_type& entry) { return entry.second / 10000; } class checkPrefix { public: checkPrefix (long p) : testPrefix (p) { } long testPrefix; bool operator () (const entry_type& entry) { return prefix(entry)==testPrefix; } };
Our final example displays the directory sorted by prefix. It is not possible to alter the order of the maps themselves. Instead, we create a new map with the element types reversed and copy the values into the new map, which orders the values by prefix. Once the new map is created, it is printed:
typedef std::map<long, std::string, std::less<long>, std::allocator<std::pair<const long, std::string> > > sortedMap; typedef sortedMap::value_type sorted_entry_type; void telephoneDirectory::displayByPrefix () { std::cout << "Display by prefix" << std::endl; sortedMap sortedData; for (friendMap::iterator i = database.begin (); i != database.end (); i++) sortedData.insert (sortedMap::value_type ((*i).second, (*i).first)); std::for_each (sortedData.begin (), sortedData.end (), printSortedEntry); std::cout << "end display by prefix" << std::endl; }
Here is the function used to print the sorted entries:
void printSortedEntry (const sorted_entry_type & entry) { std::cout << entry.first << ":" << entry.second << std::endl; }
NOTE -- The complete version of this program is in the file graph.cpp.
A map whose elements are themselves maps is a natural representation for a directed graph. For example, suppose we use strings to encode the names of cities, and we wish to construct a map where the value associated with an edge is the distance between two connected cities. We could create such a graph as follows:
typedef std::map<std::string, int, std::less<std::string>, std::allocator<std::pair<const std::string, int> > > stringVector; typedef std::map<std::string, stringVector, std::less<std::string>, std::allocator<std::pair<const std::string, stringVector> > > graph; // define strings for city names std::string pendleton ("Pendleton"); std::string pensacola ("Pensacola"); std::string peoria ("Peoria"); std::string phoenix ("Phoenix"); std::string pierre ("Pierre"); std::string pittsburgh ("Pittsburgh"); std::string princeton ("Princeton"); std::string pueblo ("Pueblo"); // declare the graph that holds the map graph cityMap; // add edges to the graph cityMap[pendleton][phoenix] = 4; cityMap[pendleton][pueblo] = 8; cityMap[pensacola][phoenix] = 5; cityMap[peoria][pittsburgh] = 5; cityMap[peoria][pueblo] = 3; cityMap[phoenix][peoria] = 4; cityMap[phoenix][pittsburgh] = 10; cityMap[phoenix][pueblo] = 3; cityMap[pierre][pendleton] = 2; cityMap[pittsburgh][pensacola] = 4; cityMap[princeton][pittsburgh] = 2; cityMap[pueblo][pierre] = 3;
The type stringVector is a map of integers indexed by text strings. The type graph is, in effect, a two-dimensional sparse array, indexed by strings and holding int values. A sequence of assignment statements initializes the graph.
A number of classic algorithms can be used to manipulate graphs represented in this form. One example is Dijkstra's shortest-path algorithm. Dijkstra's algorithm begins from a specific city given as an initial location. A priority_queue of distance/city pairs is then constructed, and initialized with the distance from the starting city to itself (namely, zero). The definition for the distance pair datatype is as follows:
struct DistancePair { unsigned first; std::string second; DistancePair () : first (0) {} DistancePair (unsigned f, const std::string& s) : first (f), second (s) {} }; bool operator< (const DistancePair& lhs, const DistancePair& rhs) { return lhs.first < rhs.first; }
In the algorithm that follows, note how the conditional test is reversed on the priority_queue, because at each step we wish to pull the smallest, and not the largest, value from the collection. On each iteration around the loop we pull a city from the queue. If we have not yet found a shorter path to the city, the current distance is recorded, and we can compute the distance from this city to each of its adjacent cities by examining the graph. This process continues until the priority_queue becomes exhausted:
void shortestDistance (graph& cityMap, std::string& start, stringVector& distances) { // Process a priority queue of distances to nodes. std::priority_queue<DistancePair, std::vector<DistancePair, std::allocator<DistancePair> >, std::greater<DistancePair> > que; que.push (DistancePair (0, start)); while (! que.empty()) { // Pull nearest city from queue. int distance = que.top().first; std::string city = que.top().second; que.pop(); // If we haven't seen it already, process it. if (0 == distances.count (city)) { // Then add it to shortest distance map. distances[city] = distance; // And put values into queue. const stringVector& cities = cityMap[city]; stringVector::const_iterator start = cities.begin (); stringVector::const_iterator stop = cities.end (); for (; start != stop; ++start) que.push(DistancePair (distance + (*start).second, (*start).first)); } } }
Notice that this relatively simple algorithm makes use of vector (Chapter 5), map (Chapter 9), string (Chapter 12), and priority_queue (Chapter 11).
A concordance is an alphabetical listing of words in a text that shows the line numbers on which each word occurs.
NOTE -- The executable version of this program is in the file concord.cpp.
We develop a concordance to illustrate the use of the map and multimap container classes. The data values are maintained in the concordance by a multimap, indexed by word (a string) and holding the line numbers (int). A multimap is used because the same word is expected to appear on different lines; indeed, discovering such connections is one of the primary purposes of a concordance. Another possibility would be to use a map and use a set of integer elements as the associated values.
class concordance { typedef std::multimap<std::string,int, std::less<std::string>, std::allocator<std::pair<const std::string, int> > > wordDictType; public: void addWord (std::string, int); void readText (std::istream &); void printConcordance (std::ostream &); private: wordDictType wordMap; };
The creation of the concordance is divided into two steps: the program generates the concordance by reading lines from an input stream, then prints the result on the output stream. This is reflected in the two member functions readText() and printConcordance(). The first of these, readText(), is written as follows:
void concordance::readText (std::istream & in) { std::string line; for (int i = 1; std::getline (in, line); i++) { allLower (line); std::list<std::string, std::allocator<std::string> > words; split (line, " , .;:", words); std::list<std::string, std::allocator<std::string> >::iterator wptr; for (wptr = words.begin (); wptr != words.end (); ++wptr) addWord (*wptr, i); } }
Lines are read from the input stream one by one. The text of the line is first converted into lower case, then the line is split into words using the function split() described in Section 12.3. Each word is then entered into the concordance. The method used to enter a value into the concordance is as follows:
void concordance::addWord (std::string word, int line) { // First get range of entries with same key. wordDictType::iterator low = wordMap.lower_bound (word); wordDictType::iterator high = wordMap.upper_bound (word); // Loop over entires, see if any match current line. for ( ; low != high; ++low) if ( (*low).second == line) return; // Didn't occur, add now. wordMap.insert (wordDictType::value_type (word, line)); }
The major portion of addWord() is concerned with ensuring that values are not duplicated in the word map if the same word occurs twice on the same line. To assure this, the range of values matching the key is examined, each value is tested, and if any match the line number then no insertion is performed. It is only if the loop terminates without discovering the line number that the new word/line number pair is inserted.
The final step is to print the concordance. This is performed in the following fashion:
void concordance::printConcordance (std::ostream & out) { std::string lastword (""); wordDictType::iterator pairPtr; wordDictType::iterator stop = wordMap.end (); for (pairPtr = wordMap.begin (); pairPtr != stop; ++pairPtr) // If word is same as previous, just print line number. if (lastword == (*pairPtr).first) out << " " << (*pairPtr).second; else { // First entry of word. lastword = (*pairPtr).first; std::cout << std::endl << lastword << ": " << (*pairPtr).second; } std::cout << std::endl; }
An iterator loop is used to cycle over the elements being maintained by the word list. Each new word generates a new line of output; thereafter, line numbers appear separated by spaces. For example, if the input was the text:
It was the best of times, it was the worst of times.
The output, from best to worst, would be:
best: | 1 |
it: | 1 2 |
of: | 1 2 |
the: | 1 2 |
times: | 1 2 |
was: | 1 2 |
worst: | 2 |


001 /* 002 * Licensed to the Apache Software Foundation (ASF) under one or more 003 * contributor license agreements. See the NOTICE file distributed with 004 * this work for additional information regarding copyright ownership. 005 * The ASF licenses this file to You under the Apache License, Version 2.0 006 * (the "License"); you may not use this file except in compliance with 007 * the License. You may obtain a copy of the License at 008 * 009 * http://www.apache.org/licenses/LICENSE-2.0 010 * 011 * Unless required by applicable law or agreed to in writing, software 012 * distributed under the License is distributed on an "AS IS" BASIS, 013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 014 * See the License for the specific language governing permissions and 015 * limitations under the License. 016 */ 017 package org.apache.commons.io.output; 018 019 import java.io.IOException; 020 import java.io.OutputStream; 021 import java.io.Writer; 022 import java.nio.ByteBuffer; 023 import java.nio.CharBuffer; 024 import java.nio.charset.Charset; 025 import java.nio.charset.CharsetDecoder; 026 import java.nio.charset.CoderResult; 027 import java.nio.charset.CodingErrorAction; 028 029 /** 030 * {@link OutputStream} implementation that transforms a byte stream to a 031 * character stream using a specified charset encoding and writes the resulting 032 * stream to a {@link Writer}. The stream is transformed using a 033 * {@link CharsetDecoder} object, guaranteeing that all charset 034 * encodings supported by the JRE are handled correctly. 035 *
 036 * The output of the {@link CharsetDecoder} is buffered using a fixed size buffer. 037 * This implies that the data is written to the underlying {@link Writer} in chunks 038 * that are no larger than the size of this buffer. By default, the buffer is 039 * flushed only when it overflows or when {@link #flush()} or {@link #close()} 040 * is called. In general there is therefore no need to wrap the underlying {@link Writer} 041 * in a {@link java.io.BufferedWriter}. {@link WriterOutputStream} can also 042 * be instructed to flush the buffer after each write operation. In this case, all 043 * available data is written immediately to the underlying {@link Writer}, implying that 044 * the current position of the {@link Writer} is correlated to the current position 045 * of the {@link WriterOutputStream}. 046 *
 047 * {@link WriterOutputStream} implements the inverse transformation of {@link java.io.OutputStreamWriter}; 048 * in the following example, writing to <tt>out2</tt> would have the same result as writing to 049 * <tt>out</tt> directly (provided that the byte sequence is legal with respect to the 050 * charset encoding): 051 *
 052 * OutputStream out = ... 053 * Charset cs = ... 054 * OutputStreamWriter writer = new OutputStreamWriter(out, cs); 055 * WriterOutputStream out2 = new WriterOutputStream(writer, cs);
 056 * {@link WriterOutputStream} implements the same transformation as {@link java.io.InputStreamReader}, 057 * except that the control flow is reversed: both classes transform a byte stream 058 * into a character stream, but {@link java.io.InputStreamReader} pulls data from the underlying stream, 059 * while {@link WriterOutputStream} pushes it to the underlying stream. 060 *
 061 * Note that while there are use cases where there is no alternative to using 062 * this class, very often the need to use this class is an indication of a flaw 063 * in the design of the code. This class is typically used in situations where an existing 064 * API only accepts an {@link OutputStream} object, but where the stream is known to represent 065 * character data that must be decoded for further use. 066 *
 067 * Instances of {@link WriterOutputStream} are not thread safe. 068 * 069 * @see org.apache.commons.io.input.ReaderInputStream 070 * 071 * @author <a<EMAIL_ADDRESS>Veithen 072 * @since Commons IO 2.0 073 */ 074 public class WriterOutputStream extends OutputStream { 075 private static final int DEFAULT_BUFFER_SIZE = 1024; 076 077 private final Writer writer; 078 private final CharsetDecoder decoder; 079 private final boolean writeImmediately; 080 081 /** 082 * ByteBuffer used as input for the decoder. This buffer can be small 083 * as it is used only to transfer the received data to the 084 * decoder. 085 */ 086 private final ByteBuffer decoderIn = ByteBuffer.allocate(128); 087 088 /** 089 * CharBuffer used as output for the decoder. It should be 090 * somewhat larger as we write from this buffer to the 091 * underlying Writer. 092 */ 093 private final CharBuffer decoderOut; 094 095 /** 096 * Constructs a new {@link WriterOutputStream}. 097 * 098 * @param writer the target {@link Writer} 099 * @param charset the charset encoding 100 * @param bufferSize the size of the output buffer in number of characters 101 * @param writeImmediately If <tt>true</tt> the output buffer will be flushed after each 102 * write operation, i.e. all available data will be written to the 103 * underlying {@link Writer} immediately. If <tt>false</tt>, the 104 * output buffer will only be flushed when it overflows or when 105 * {@link #flush()} or {@link #close()} is called. 106 */ 107 public WriterOutputStream(Writer writer, Charset charset, int bufferSize, boolean writeImmediately) { 108 this.writer = writer; 109 decoder = charset.newDecoder(); 110 decoder.onMalformedInput(CodingErrorAction.REPLACE); 111 decoder.onUnmappableCharacter(CodingErrorAction.REPLACE); 112 decoder.replaceWith("?"); 113 this.writeImmediately = writeImmediately; 114 decoderOut = CharBuffer.allocate(bufferSize); 115 } 116 117 /** 118 * Constructs a new {@link WriterOutputStream} with a default output buffer size of 119 * 1024 characters. The output buffer will only be flushed when it overflows or when 120 * {@link #flush()} or {@link #close()} is called. 121 * 122 * @param writer the target {@link Writer} 123 * @param charset the charset encoding 124 */ 125 public WriterOutputStream(Writer writer, Charset charset) { 126 this(writer, charset, DEFAULT_BUFFER_SIZE, false); 127 } 128 129 /** 130 * Constructs a new {@link WriterOutputStream}. 131 * 132 * @param writer the target {@link Writer} 133 * @param charsetName the name of the charset encoding 134 * @param bufferSize the size of the output buffer in number of characters 135 * @param writeImmediately If <tt>true</tt> the output buffer will be flushed after each 136 * write operation, i.e. all available data will be written to the 137 * underlying {@link Writer} immediately. If <tt>false</tt>, the 138 * output buffer will only be flushed when it overflows or when 139 * {@link #flush()} or {@link #close()} is called. 140 */ 141 public WriterOutputStream(Writer writer, String charsetName, int bufferSize, boolean writeImmediately) { 142 this(writer, Charset.forName(charsetName), bufferSize, writeImmediately); 143 } 144 145 /** 146 * Constructs a new {@link WriterOutputStream} with a default output buffer size of 147 * 1024 characters. The output buffer will only be flushed when it overflows or when 148 * {@link #flush()} or {@link #close()} is called. 149 * 150 * @param writer the target {@link Writer} 151 * @param charsetName the name of the charset encoding 152 */ 153 public WriterOutputStream(Writer writer, String charsetName) { 154 this(writer, charsetName, DEFAULT_BUFFER_SIZE, false); 155 } 156 157 /** 158 * Constructs a new {@link WriterOutputStream} that uses the default character encoding 159 * and with a default output buffer size of 1024 characters. The output buffer will only 160 * be flushed when it overflows or when {@link #flush()} or {@link #close()} is called. 161 * 162 * @param writer the target {@link Writer} 163 */ 164 public WriterOutputStream(Writer writer) { 165 this(writer, Charset.defaultCharset(), DEFAULT_BUFFER_SIZE, false); 166 } 167 168 /** 169 * Write bytes from the specified byte array to the stream. 170 * 171 * @param b the byte array containing the bytes to write 172 * @param off the start offset in the byte array 173 * @param len the number of bytes to write 174 * @throws IOException if an I/O error occurs 175 */ 176 @Override 177 public void write(byte[] b, int off, int len) throws IOException { 178 while (len > 0) { 179 int c = Math.min(len, decoderIn.remaining()); 180 decoderIn.put(b, off, c); 181 processInput(false); 182 len -= c; 183 off += c; 184 } 185 if (writeImmediately) { 186 flushOutput(); 187 } 188 } 189 190 /** 191 * Write bytes from the specified byte array to the stream. 192 * 193 * @param b the byte array containing the bytes to write 194 * @throws IOException if an I/O error occurs 195 */ 196 @Override 197 public void write(byte[] b) throws IOException { 198 write(b, 0, b.length); 199 } 200 201 /** 202 * Write a single byte to the stream. 203 * 204 * @param b the byte to write 205 * @throws IOException if an I/O error occurs 206 */ 207 @Override 208 public void write(int b) throws IOException { 209 write(new byte[] { (byte)b }, 0, 1); 210 } 211 212 /** 213 * Flush the stream. Any remaining content accumulated in the output buffer 214 * will be written to the underlying {@link Writer}. After that 215 * {@link Writer#flush()} will be called. 216 * @throws IOException if an I/O error occurs 217 */ 218 @Override 219 public void flush() throws IOException { 220 flushOutput(); 221 writer.flush(); 222 } 223 224 /** 225 * Close the stream. Any remaining content accumulated in the output buffer 226 * will be written to the underlying {@link Writer}. After that 227 * {@link Writer#close()} will be called. 228 * @throws IOException if an I/O error occurs 229 */ 230 @Override 231 public void close() throws IOException { 232 processInput(true); 233 flushOutput(); 234 writer.close(); 235 } 236 237 /** 238 * Decode the contents of the input ByteBuffer into a CharBuffer. 239 * 240 * @param endOfInput indicates end of input 241 * @throws IOException if an I/O error occurs 242 */ 243 private void processInput(boolean endOfInput) throws IOException { 244 // Prepare decoderIn for reading 245 decoderIn.flip(); 246 CoderResult coderResult; 247 while (true) { 248 coderResult = decoder.decode(decoderIn, decoderOut, endOfInput); 249 if (coderResult.isOverflow()) { 250 flushOutput(); 251 } else if (coderResult.isUnderflow()) { 252 break; 253 } else { 254 // The decoder is configured to replace malformed input and unmappable characters, 255 // so we should not get here. 256 throw new IOException("Unexpected coder result"); 257 } 258 } 259 // Discard the bytes that have been read 260 decoderIn.compact(); 261 } 262 263 /** 264 * Flush the output. 265 * 266 * @throws IOException if an I/O error occurs 267 */ 268 private void flushOutput() throws IOException { 269 if (decoderOut.position() > 0) { 270 writer.write(decoderOut.array(), 0, decoderOut.position()); 271 decoderOut.rewind(); 272 } 273 } 274 }


Welcome to STEPs!
Upload Photo
First Name:
Last Name:
Email Address:
Password:
Confirm Password:
Class Code (optional):


I hope one day I will be able to go to Maldives, where you stay on a hut in the ocean. Lorem ipsum dolor amet mustache knausgaard +1, blue bottle waistcoat tbh semiotics artisan synth stumptown gastropub cornhole celiac swag. Brunch raclette vexillologist post-ironic glossier ennui XOXO mlkshk godard pour-over blog tumblr humblebrag. Blue bottle put a bird on it twee prism biodiesel brooklyn. Blue bottle ennui tbh succulents.
"What a beautiful place!


- ifExistsDo(String, Map<String, ? extends Object>, Consumer<T>) - Static method in class ms.ipp.Iterables
-
Performs a given action on an element with a given key if such element
exists.
- ifExistsDo(String, Map<String, ? extends Object>, List<String>, Consumer<T>) - Static method in class ms.ipp.Iterables
-
Performs a given action on an element with a given key if such element exists
and is not contained in a given list of elements to be ignored.
- ignore1(Function<U, V>) - Static method in class ms.ipp.Algorithms
-
Creates a BiFunction
by applying a given Function
to the
second argument and totally ignoring the first one.
- ignore1(Consumer<U>) - Static method in class ms.ipp.Algorithms
-
Creates a BiConsumer
by applying a given Consumer
to the
second argument and totally ignoring the first one.
- ignore1(Predicate<U>) - Static method in class ms.ipp.Algorithms
-
Creates a BiPredicate
by applying a given Predicate
to the
second argument and totally ignoring the first one.
- ignore1(UnaryOperator<T>) - Static method in class ms.ipp.Algorithms
-
Creates a BinaryOperator
by applying a given UnaryOperator
to
the second argument and totally ignoring the first one.
- ignore2(Function<T, V>) - Static method in class ms.ipp.Algorithms
-
Creates a BiFunction
by applying a given Function
to the
first argument and totally ignoring the second one.
- ignore2(Consumer<T>) - Static method in class ms.ipp.Algorithms
-
Creates a BiConsumer
by applying a given Consumer
to the
first argument and totally ignoring the second one.
- ignore2(Predicate<T>) - Static method in class ms.ipp.Algorithms
-
Creates a BiPredicate
by applying a given Predicate
to the
first argument and totally ignoring the second one.
- ignore2(UnaryOperator<T>) - Static method in class ms.ipp.Algorithms
-
Creates a BinaryOperator
by applying a given UnaryOperator
to
the first argument and totally ignoring the second one.
- ignoreIfNullOrPred(T, Predicate<? super T>, Function<? super T, U>) - Static method in class ms.ipp.Algorithms
-
If the source
is not null and a given Predicate
returns true
for it, applies a given Function
to it and returns the result.
- indexOf(List<T>, Predicate<T>) - Static method in class ms.ipp.Iterables
-
Returns the first index on a given list, for which a given Predicate returns
true.
- intersection(Collection<T>, Collection<T>) - Static method in class ms.ipp.Iterables
-
Returns an intersection of two sets, i.e., a set containing elements
contained in both s1
and s2
.
- isEqualOrNull(Object, Object) - Static method in class ms.ipp.Iterables
-
Returns true if either both elements are null or o1
's method
equals
returns true when called with o2
as the argument.
- isSimple(String) - Method in interface ms.ipp.iterable.tree.path.PathManipulator
-
- isSimple(String) - Method in class ms.ipp.iterable.tree.path.StdPathManipulator
-
- isSimple(String) - Method in class ms.ipp.iterable.tree.path.TrivialPathManipulator
-
- iterable(Iterator<T>, Function<T, ? extends Iterable<U>>) - Static method in class ms.ipp.iterator.NestedIterator
-
Creates a NestedIterator<T, U>
over an Iterator<T>
, whose
elements are mapped to Iterable<U>
by a given generator-function.
- Iterables - Class in ms.ipp
-
- Iterables() - Constructor for class ms.ipp.Iterables
-
- iterator() - Method in class ms.ipp.iterable.FilteredIterable
-
- iterator() - Method in class ms.ipp.iterable.MappedIterable
-
- iterator() - Method in class ms.ipp.iterable.ProxyBiIterable
-
- iterator() - Method in class ms.ipp.iterable.tree.DelegatingTree
-
- iterator(String) - Method in class ms.ipp.iterable.tree.StdMultiTree
-
- iterator() - Method in class ms.ipp.iterable.tree.StdMultiTree
-
- iterator(String) - Method in class ms.ipp.iterable.tree.StdTree
-
- iterator() - Method in class ms.ipp.iterable.tree.StdTree
-
- iterator() - Method in class ms.ipp.iterable.tree.SyntheticTree
-
- iterator(String, Class<T>) - Method in interface ms.ipp.iterable.tree.Tree
-
Returns a (non-recursive) iterator over all immediate children with a given
name which are of a given type.
- iterator(Class<T>) - Method in interface ms.ipp.iterable.tree.Tree
-
Returns a (non-recursive) iterator over all immediate children which are of a
given type.
- iterator(String) - Method in interface ms.ipp.iterable.tree.Tree
-
Returns a (non-recursive) iterator over all immediate children with a given
name.


You've successfully logged into the Shopify CLI!
You can close this tab and return to your terminal.


1. Introduction¶
A Message is a task, a notification, or any meaningful data that a producer or publisher sends to the queue. A message exists until it is deleted by a recipient or automatically by the system based on a TTL (time-to-live) value.
2. Setup¶
A message is initialized from its parent object, a Queue:
// Setup an empty object
$message = $queue->getMessage();
// or retrieve an existing one
$message = $queue->getMessage('<message_id>');
3. Post message¶
3.1 Description¶
This operation posts the specified message or messages. You can submit up to 10 messages in a single request.
When posting new messages, you specify only the body and ttl for the message. The API will insert metadata, such as ID and age.
3.2 Parameters¶
How you pass through the array structure depends on whether you are executing multiple (3.3.2) or single (3.3.3) posts, but the keys are the same.
The body attribute specifies an arbitrary document that constitutes the body of the message being sent. The size of this body is limited to 256 KB, excluding whitespace.
The ttl attribute specifies how long the server waits before marking the message as expired and removing it from the queue. The value of ttl must be between 60 and 1209600 seconds (14 days). Note that the server might not actually delete the message until its age has reached up to (ttl + 60) seconds, to allow for flexibility in storage implementations.
3.3 Code samples¶
3.3.1 Posting a single message¶
use OpenCloud\Common\Constants\Datetime;
$queue->createMessage(array(
'body' => (object) array(
'event' => 'BackupStarted',
'deadline' => '26.12.2013
),
'ttl' => 2 * Datetime::DAY
));
3.3.2 Post a batch of messages¶
Please note that the list of messages will be truncated at 10. For more, please execute another method call.
use OpenCloud\Common\Constants\Datetime;
$messages = array(
array(
'body' => (object) array(
'play' => 'football'
),
'ttl' => 2 * Datetime::DAY
),
array(
'body' => (object) array(
'play' => 'tennis'
),
'ttl' => 50 * Datetime::HOUR
)
);
$queue->createMessages($messages);
4. Get messages¶
4.1 Description¶
This operation gets the message or messages in the specified queue.
Message IDs and markers are opaque strings. Clients should make no assumptions about their format or length. Furthermore, clients should assume that there is no relationship between markers and message IDs (that is, one cannot be derived from the other). This allows for a wide variety of storage driver implementations.
Results are ordered by age, oldest message first.
4.2 Parameters¶
A hash of options.
| Name | Style | Type | Description |
|---|---|---|---|
| marker | Query | String | Specifies an opaque string that the client can use to request the next batch of messages. The marker parameter communicates to the server which messages the client has already received. If you do not specify a value, the API returns all messages at the head of the queue (up to the limit). Optional. |
| limit | Query | Integer | When more messages are available than can be returned in a single request, the client can pick up the next batch of messages by simply using the URI template parameters returned from the previous call in the “next” field. Specifies up to 10 messages (the default value) to return. If you do not specify a value for the limit parameter, the default value of 10 is used. Optional. |
| echo | Query | Boolean | Determines whether the API returns a client’s own messages. The echo parameter is a Boolean value (true or false) that determines whether the API returns a client’s own messages, as determined by the uuid portion of the User-Agent header. If you do not specify a value, echo uses the default value of false. If you are experimenting with the API, you might want to set echo=true in order to see the messages that you posted. The echo parameter is optional. |
| include_claimed | Query | Boolean | Determines whether the API returns claimed messages and unclaimed messages. The include_claimed parameter is a Boolean value (true or false) that determines whether the API returns claimed messages and unclaimed messages. If you do not specify a value, include_claimed uses the default value of false (only unclaimed messages are returned). Optional. |
4.3 Code sample¶
$messages = $queue->listMessages(array(
'marker' => '51db6f78c508f17ddc924357',
'limit' => 20,
'echo' => true
));
while ($message = $messages->next()) {
echo $message->getId() . PHP_EOL;
}
5. Get a set of messages by ID¶
5.1 Description¶
This operation provides a more efficient way to query multiple messages compared to using a series of individual GET. Note that the list of IDs cannot exceed 20. If a malformed ID or a nonexistent message ID is provided, it is ignored, and the remaining messages are returned.
5.2 Parameters¶
A hash of options.
|Name|Style|Type|Description| |—-|—–|—-|———–| |ids|Query|String|Specifies the IDs of the messages to get. Format multiple message ID values by separating them with commas (comma-separated). Optional.| |claim_id|Query|String|Specifies the claim ID with which the message is associated. Optional.| |—-|—–|—-|———–|
5.3 Code sample¶
$ids = array('51db6f78c508f17ddc924357', 'f5b8c8a7c62b0150b68a50d6');
$messages = $queue->listMessages(array('ids' => $ids));
while ($message = $messages->next()) {
echo $message->getId() . PHP_EOL;
}
6. Delete a set of messages by ID¶
6.1 Description¶
This operation immediately deletes the specified messages. If any of the message IDs are malformed or non-existent, they are ignored. The remaining valid messages IDs are deleted.
6.2 Parameters¶
An array of IDs.
6.3 Code sample¶
$ids = array('51db6f78c508f17ddc924357', 'f5b8c8a7c62b0150b68a50d6');
$response = $queue->deleteMessages($ids);
7. Get a specific message¶
7.1 Description¶
This operation gets the specified message from the specified queue.
7.2 Parameters¶
Message ID.
7.3 Object properties¶
href is an opaque relative URI that the client can use to uniquely identify a message resource and interact with it.
ttl is the TTL that was set on the message when it was posted. The message expires after (ttl - age) seconds.
age is the number of seconds relative to the server’s clock.
body is the arbitrary document that was submitted with the original request to post the message.
7.4 Code sample¶
$message = $queue->getMessage('51db6f78c508f17ddc924357');


Coursery helps you use course evaluations to find great classes. For example:
-
Find the highest rated classes in a department. Select Average for year, section, and instructor, the department for subject, and All for course. Click on the course rating to sort by that field.
-
Find the highest rated instructors for a class. Select Average for year and section. Choose the appropriate subject and course number. Select All for instructor. Click on the instructor rating to sort by that field.
-
See what ratings looked like for a class you took. Select the appropriate year, subject, course number, and section. Look at the summary data, or click the full report button (on the far right) to see the full evaluation.
Where did all this data come from?  These course evaluations are available on BannerWeb as well, but are simply presented here in a much more accessible way.
Thanks to Mark James for the favicon and Jan Kovařík for the other icons used.


Back to Projects
Find in...
Laptops
Desktops
Servers
Workstations
Printers and Photocopiers
Accessories


 The problem is that players always remember their bad luck but seem to forget their own pieces of good fortune such as successive 16’s from the bar or a couple of large doubles in the bear-off to win a seemingly lost race.
In short matches there is always a lot of luck. That can be clearly seen from the XG analysis of such matches. Quite often, in matches between good players, the equity lost through luck is greater than the equity lost through errors and blunders. This is true for players who have a Performance Rating (PR) around 4. Once you get up to PRs around 8 then the luck is dominated by the errors/blunders.
However, over time luck truly does even out. Over my last 2,000 online matches my average luck is 0.0001 equity points, or in other words, truly insignificant. Once you come to terms with such statistics you realise that over time, your skill or lack of it, will dominate your results.
People also believe that they are unlucky against particular players, no matter what they do. I have always complained that I can never beat my good friend, Romolo Mudu. At the Cotswolds tournament last weekend I met Romolo in the final of the warm-up event. In the final to five points I was leading 1-0 and looked good for a gammon holding a 2-cube when something went wrong and I lost the game and then the match. QED.
We then met again on the Sunday in the quarter-final of the main. We reached 4-4 to 11 when the above position occurred. I was Black and had to play 52. I obviously cannot give up my home board and so I made the correct play of 13/6 leaving Romolo only 45 and 46 to hit and cover. Lo and behold out popped 45 which he played 16/12*, 8/3.
Here we go again, I thought - I’ll probably lose a gammon and go 4-8 behind. That was before I rolled 44 from the bar. Hardly believing it, I played bar/21/17*/13*/9* putting three of Romolo’s checkers on the bar! I went on to win a gammon and lead 8-4. From there I won the match and then, buoyed by this superb roll, the next two matches as well to win the tournament.
In short matches there is always a lot of luck. That can be clearly seen from the XG analysis of such matches. Quite often, in matches between good players, the equity lost through luck is greater than the equity lost through errors and blunders. This is true for players who have a Performance Rating (PR) around 4. Once you get up to PRs around 8 then the luck is dominated by the errors/blunders.
However, over time luck truly does even out. Over my last 2,000 online matches my average luck is 0.0001 equity points, or in other words, truly insignificant. Once you come to terms with such statistics you realise that over time, your skill or lack of it, will dominate your results.
People also believe that they are unlucky against particular players, no matter what they do. I have always complained that I can never beat my good friend, Romolo Mudu. At the Cotswolds tournament last weekend I met Romolo in the final of the warm-up event. In the final to five points I was leading 1-0 and looked good for a gammon holding a 2-cube when something went wrong and I lost the game and then the match. QED.
We then met again on the Sunday in the quarter-final of the main. We reached 4-4 to 11 when the above position occurred. I was Black and had to play 52. I obviously cannot give up my home board and so I made the correct play of 13/6 leaving Romolo only 45 and 46 to hit and cover. Lo and behold out popped 45 which he played 16/12*, 8/3.
Here we go again, I thought - I’ll probably lose a gammon and go 4-8 behind. That was before I rolled 44 from the bar. Hardly believing it, I played bar/21/17*/13*/9* putting three of Romolo’s checkers on the bar! I went on to win a gammon and lead 8-4. From there I won the match and then, buoyed by this superb roll, the next two matches as well to win the tournament.
1. Cubeful 2-ply 13/11 13/8 Eq.: -0.233 0.334 0.045 0.001 - 0.666 0.058 0.000 2. Cubeful 2-ply 6/1 5/3 Eq.: -0.237 (-0.003) 0.343 0.044 0.000 - 0.657 0.084 0.001 3. Cubeful 2-ply 13/8 5/3 Eq.: -0.238 (-0.005) 0.334 0.048 0.001 - 0.666 0.066 0.001 4. Cubeful 2-ply 13/6 Eq.: -0.239 (-0.005) 0.334 0.040 0.000 - 0.666 0.058 0.001 5. Cubeful 2-ply 6/1 3/1 Eq.: -0.249 (-0.015) 0.339 0.041 0.000 - 0.661 0.081 0.001


I'm a fullstack Developer, i studied computer engineering in Universidad Politécnica del Estado de Morelos. I have a passion to learn, I'm used to working under pressure, i have experience with web development .
I have experience in Front-end with JS like React js, Angular 6 and Vanilla js also CSS, SCSS, Flexbox . In Back-end i have knowledge with Frameworks and languages like PHP, Java, Spring boot. Currently i have some experience in PWA with Service workers
Leadership, Responsibility, Creativity, Communication & Teamwork.
I have 1 year of experience develope different web Applications with Angular 5 and 6 with Java springboot in the Back-end. Actually I developed mobile apps with angular using native plugins like the Bar code Scanner and the GPS
CloseI have experience with react js, babel, webpack and Redux I have developed different applications with react js like a Control project web app used in Ryndem company to have a control in their projects also I developed a Control Assistance Web App used in Ryndem too, that application shows the time worked for each employee in the company and generate reports for each team
CloseI have developed different mobile applications with the framework ionic powered with Angular, using native plugins like Camera, GPS, Storage, Bar code scanner, Social Sharing . I think this a powerfull tool to develope apps because you can build a normal webapp with angular but you can use the different native tools in mobile devices so you increase your Creativity to develope any app.
CloseCurrently I have taken some PWA courses so i developed differents Progressive Web Apps, actually this page is a PWA you can install if you want :), anyway i think PWA is the future of the mobile apps beacuse you can create a normal web app with a little different things you can transform it to a PWA. A PWA is a installable web app made in a language web like javascript. You can use the app without internet connection this is the most important advantaje .
CloseCurrently I Developed and participated in different Back end projects with Java using Spring boot framework, Springboot is the new version by the Pivotal company.
CloseLorem ipsum dolor sit amet, consectetur adipisicing elit. Mollitia neque assumenda ipsam nihil, molestias magnam, recusandae quos quis inventore quisquam velit asperiores, vitae? Reprehenderit soluta, eos quod consequuntur itaque. Nam.
Close


---
layout: post
title: "TDD in Rails"
category:
status: published
tags: [rails, TDD, testing, Rspec, FactoryGirl, Capybara]
---
First: No code is safe.
Start asking your code: "Are you good enough to pass this test?". If he doesn't
answer, write a test and fire the console.
Be active, don't wait until your
code starts screaming. It's a common habit to think "i will write later my test
code". No, you will not, you will have other things to do, bug fixing, new
features, or take a walk outside, but no, abslolutely, no test code.
To
avoid procrastination, testing has to be integrated in the development code
cycle, "you have to start thinking about testing before you write a line of
code"(tip 48, The
Pragmatic Programmer). The most complete TDD definition that i've found on the net comes from agileskillsproject.org:
Test-Driven Development (TDD) is a way of driving the design of code by writing a test which expresses what you intend the code to do, making that test pass, and continuously refactoring to keep the design as simple as possible. TDD can apply at multiple levels, e.g., Customer Tests, Integration Tests, Unit Tests.
Test-Driven Development/Design follows a rigorous cycle. Start by writing a failing test (Red.) Implement the simplest solution that will cause the test to pass (Green.) Search for duplication and remove it (Refactor.) "RED-GREEN-REFACTOR" has become almost a mantra for many TDD practitioners. Understanding and even internalizing this cycle is key to being able to use TDD to solve problems.
Kent Beck rediscovered this technique in 2003, and from his book "Test-Driven Development by example" is taken this part on the wiki page about TDD.
Test Driven Development in Rails, common setup
How it work's on Ruby on Rails? First of all, you have to include some gems for
ours tests. The most important is Rspec-rails for our integration
test (known as "request specs" in the context of RSpec), so edit your Gemfile,
add the following lines and run bundle install
{% highlight ruby %}
gem 'rspec-rails', :group => [:development, :test]
gem 'factory_girl_rails', :group => [:development, :test]
group :test do
gem 'database_cleaner'
gem 'email_spec'
gem 'launchy'
gem 'capybara'
end
{% endhighlight ruby %}
As you can see we have added also Capybara, FactoryGirls and DatabaseCleaner, during this post we will see how and when use them. Another step, is to tell rails that we wanto to replace fixtures with factories, and to suppress the creation of test files for views and helpers. Open your config/application.rb file and add the following lines:
{% highlight ruby %}
class Application < Rails::Application
#...
config.generators do |g|
g.test_framework :rspec, :fixture => true
g.fixture_replacement :factory_girl
g.view_specs false
g.helper_specs false
end
{% endhighlight ruby %}
Now, running "rails generate rspec:install" to preare your application for the
testing, you will have these files: .rspec, the spec/spec_helper.rb, and the folder spec, that is used to store the test files. You can safely remove the folder "test", if you have created your app without the flag "-T".
To write the rspec files from scratch, we will create a controller with some
views.
To do so, we will use the flag "--no-test-framework" to suppress the generation of the default Rspec tests.
{% highlight ruby %}
rails generate controller Pages home help --no-test-framework
{% endhighlight ruby %}
After that, we'll generate the integration test file for the pages controller
{% highlight ruby %}
rails generate integration_test pages
{% endhighlight ruby %}
This will generate the file spec/requests/pages_spec.rb. Add this line at "require 'capybara/rspec'" in your spec_helper.rb file. Copy this file in another folder, called spec/features/pages_spec.rb.
Yes, in spec/ we'll have 2 subfolders, one called requests and the other one called fetaures. In the folder spec/features we are going to store RSpec feature specs (with capybara), and in spec/requests/ all the RSpec request specs. Request specs are intended to run Integratione test, feature specs are used to driving web application, cheking url and verify content.
Use the first one to test interactions with your application as a HTTP API. Use features specs (with capybara) to test your application like a user could do it.
This is a necessary reading about rspec-rails and capybara.
Now we will write some test that HAS to fail.This is an important point, you are
defining a new feature or starting from scratch, your code is not ready for your
requirement. If the test does not fail, either your text was wrong, or your code
was just ready to pass the test. Both, are wrong. You have to write untill your
code pass the test. After that start to refactoring it, write new test if necessary, and write the small amount of code necessary to pass the test. Now, back on the code.
{% highlight ruby %}
require 'spec_helper'
describe "Home page" do
it "should have the content 'this text is not here'" do
visit '/pages/home'
page.should have_content('this text is not here')
end
end
{% endhighlight ruby %}
Run this command and watch it fail.
{% highlight ruby %}
bundle exec rspec spec/features/pages_spec.rb
{% endhighlight ruby %}
It fails because in the page views/pages/home there is no text 'this text is not here'. Correct the view inserting this text and re-run the test. The same test for RSpec request specs (in spec/requests/), is slightly different.
{% highlight ruby %}
require 'spec_helper'
describe "Home page" do
it "should have the content 'also this text is not here'" do
get '/pages/home'
expect(response.body).to include("also this text is not here")
end
end
{% endhighlight ruby %}
Note, i've write this example just to point out some differences between the two methods, but they should never be used for the same goal, each of them is more appropriated than the other in a specific context, it's up to you find the right one.
Use FactoryGirl
We are going to use factories to define Active Record objects and test them with insert/delete/edit methods. The most used gem for this scope is Facotry Girl. Like Rspec and Capybara, also FG has his own DSL.
There are two ways to define factories:1) Using a single file, spec/factories.rb, or 2) using multiple files, one file for each model. In his railcast, Ryan Bates suggest to use one single file, but is up to you. Rails generator use by default the second method. Create a resource, a Post for example.
{% highlight ruby %}
rails generate scaffold Post title:string body:text
{% endhighlight ruby %}
And update the test db
{% highlight ruby %}
rake db:test:prepare
{% endhighlight ruby %}
If the factory-girl-rails gem is correctly installed, this command has generated the file: spec/factories/posts.rb. Open it
{% highlight ruby %}
FactoryGirl.define do
factory :post do
title "MyString"
body "MyText"
end
end
{% endhighlight ruby %}
This factory defines our ActiveRecord object for the model "Post", is the simplest set of attributes necessary to create an instance of this class.
You have to edit your spec/spec_helper.rb, add "require 'factory_girl_rails'" after the other require declaration, and comment the line containing "config.fixture_path = "#{::Rails.root}/spec/fixtures", because we are going to use factories and not fixtures.
We can use this class in our test. How? Let's start from the model, open /spec/models/post.rb and edit it like this:
{% highlight ruby %}
require 'spec_helper'
describe Post do
it "is valid with title and boby"
it "is not valid with an empty title"
end
{% endhighlight ruby %}
If you run "bundle exec rspec spec/models/post_spec.rb" you will see a message like this:
{% highlight bash %}
**
Pending:
Post is valid with title and boby
# Not yet implemented
# ./spec/models/post_spec.rb:4
Post is not valid with an empty title
# Not yet implemented
# ./spec/models/post_spec.rb:5
{% endhighlight bash %}
That happens because we dont have defined the test. Open the file and add the following lines, note that we are using FactoryGirl to define the Post ActiveRecord object.
{% highlight ruby %}
require 'spec_helper'
describe Post do
before(:each) do
@post = FactoryGirl.build(:post)
end
it "is valid with title and boby" do
@post.should be_valid
end
it "is not valid with an empty title" do
@post.title = nil
@post.should_not be_valid
end
end
{% endhighlight ruby %}
We create a @post object at the beginning, some users prefere to specify the factory in every test, because you can just override attributes. Check this example
{% highlight ruby %}
require 'spec_helper'
describe Post do
it "is valid with title and boby" do
post = FactoryGirl.build(:post)
post.should be_valid
end
it "is not valid with an empty title" do
post = FactoryGirl.build(:post, title:nil)
post.should_not be_valid
end
end
{% endhighlight ruby %}
I prefer the second one, however, it's a matter of taste.
{% highlight ruby %}
require 'spec_helper'
describe Post do
it "is valid with title and boby" do
post = FactoryGirl.build(:post)
post.should be_valid
end
it "is not valid with an empty title" do
post = FactoryGirl.build(:post, title:nil)
post.should_not be_valid
end
end
{% endhighlight ruby %}
If repeating "FactoryGirl" is too verbose for you, we can can mix the syntax methods. Open you spec/spec_helper.rb and add this line
{% highlight ruby %}
RSpec.configure do |config|
config.include FactoryGirl::Syntax::Methods
end
{% endhighlight ruby %}
Now edit the spec/models/post.rb and remove the "FactoryGirl" word, because we don't need it anymore.
{% highlight ruby %}
require 'spec_helper'
describe Post do
it "is valid with title and boby" do
post = build(:post)
post.should be_valid
end
it "is not valid with an empty title" do
post = build(:post, title:nil)
post.should_not be_valid
end
end
{% endhighlight ruby %}
If we run this test, we will see the second example failing. The post will be
saved also with an empty title. That's Test Driven Development, we have to
define first what "should happen if", and after that write the code to adapt it to our test. Open the app/post/model.rb and write the following lines:
{% highlight ruby %}
class Post < ActiveRecord::Base
attr_accessible :body, :title
validates_presence_of :title
end
{% endhighlight ruby %}
Database cleaner
Database cleaner is a tool to clean the database before testing. Sometimes, for
example in a user registration, some values has to be unique. For example, if we
try to insert two times a user with the same email, we could have this error
{% highlight bash %}
ActiveRecord::RecordInvalid: Validation failed: Email has already been taken, Email has already been taken, Username has already been taken.
{% endhighlight bash %}
It's easy to setup, open your loved spec/spec_helper.rb file and add these lines
{% highlight ruby %}
RSpec.configure do |config|
config.before(:suite) do
#for sqlite use:
# DatabaseCleaner.strategy = :truncation
# instead the following 2 lines
DatabaseCleaner.strategy = :transaction
DatabaseCleaner.clean_with(:truncation)
end
config.before(:each) do
DatabaseCleaner.start
end
config.after(:each) do
DatabaseCleaner.clean
end
end
{% endhighlight ruby %}
Nevertheless, FactoryGirl has a nice method to avoid duplication, the method 'sequence'
{% highlight ruby %}
FactoryGirl.define do
factory :user do
sequence(:username) { |n| "foo#{n}" }
password "foobar"
email {<EMAIL_ADDRESS>}
{% endhighlight ruby %}
More details at this question in stackoverflow
Watchr
It could be very annoying to run a test every time we write something. There is
a tool to automate this process (and a lot of other things, it is used also in
jekyll), called watchr. Add it ro your Gemfile
{% highlight ruby %}
group :development, :test do
gem 'rspec-rails'
gem 'watchr'
end
{% endhighlight ruby %}
Next, add a file called .watchr in your app root folder, with the following content, that tell watchr to run a test each time a .rb file in your app is saved, and each time you save a changement in any file ending in _spec.rb under the spec/
{% highlight ruby %}
def run_spec(file)
unless File.exist?(file)
puts "#{file} does not exist"
return
end
puts "Running #{file}"
system "bundle exec rspec #{file}"
puts
end
watch("spec/.*/*_spec.rb") do |match|
run_spec match[0]
end
watch("app/(.*/.*).rb") do |match|
run_spec %{spec/#{match[1]}_spec.rb}
end
{% endhighlight ruby %}
Open a new console window, and run "watchr .watchr". Nothing happens, true. But if you change a model, a controller or a file in spec/ your test will be running automatically. We can also create a rake task in lib/tasks/watchr.rake
{% highlight ruby %}
desc "Run watchr"
task :watchr do
sh %{bundle exec watchr .watchr}
end
{% endhighlight ruby %}
and run watchr with "rake watchr". Credits to this solution go here
Running your test
you can run the whole test with "rake spec", or simply "rake". You can run a single test with:
{% highlight ruby %}
bundle exec rspec /spec/models/post_spec.rb
{% endhighlight ruby %}
and you can also run a test for a single line, giving the line number as parameter
{% highlight ruby %}
bundle exec rspec /spec/controllers/posts_controller_spec.rb:10
{% endhighlight ruby %}
Why are we using 'bundle exec'? this is needed to load our exact gem environment specified in our Gemfile
List of usefull links
getting started:
http://en.wikipedia.org/wiki/Test-driven_development
http://stackoverflow.com/questions/1386562/how-to-get-started-on-tdd-with-ruby-on-rails
Detailed explanation for the first steps development
http://ruby.railstutorial.org/chapters/static-pages#sec-TDD
best practices
https://docs.google.com/document/d/1gi00-wwPaLk5VvoAJhBVNh9Htw4Rwmj-Ut88T4M2MwI/mobilebasic?pli=1&hl=en
http://blog.carbonfive.com/2010/10/21/rspec-best-practices/
http://bitfluxx.com/2011/05/23/some-rspec-tips-and-best-practices.html
Slides about different types of tests
http://alindeman.github.com/acceptance_testing
Capybara
https://github.com/jnicklas/capybara
http://rubydoc.info/github/jnicklas/capybara
Factory Girl Rails
http://ruby.railstutorial.org/chapters/sign-up#sec-tests_with_factories
https://github.com/thoughtbot/factory_girl/blob/master/GETTING_STARTED.md
Matt Wynne blog
http://blog.mattwynne.net/
Chris Parsons Blog
http://chrismdp.com/
They run together this project about behaviuor test development (i will write soon about it)
http://bddkickstart.com/


@NonNullApi @NonNullFields
请参阅: 说明
| 类 | 说明 |
|---|---|
| DisabledIfCondition |
DisabledIfCondition is an ExecutionCondition
that supports the @DisabledIf annotation when using the Spring
TestContext Framework in conjunction with JUnit 5's Jupiter programming model. |
| EnabledIfCondition |
EnabledIfCondition is an ExecutionCondition
that supports the @EnabledIf annotation when using the Spring
TestContext Framework in conjunction with JUnit 5's Jupiter programming model. |
| SpringExtension |
SpringExtension integrates the Spring TestContext Framework
into JUnit 5's Jupiter programming model. |
| 注释类型 | 说明 |
|---|---|
| DisabledIf |
@DisabledIf is used to signal that the annotated test class or test
method is disabled and should not be executed if the supplied
DisabledIf.expression() evaluates to true . |
| EnabledIf |
@EnabledIf is used to signal that the annotated test class or test
method is enabled and should be executed if the supplied
EnabledIf.expression() evaluates to true . |
| SpringJUnitConfig |
@SpringJUnitConfig is a composed annotation that combines
@ExtendWith(SpringExtension.class) from JUnit Jupiter with
@ContextConfiguration from the Spring TestContext
Framework. |


Some types of worms can infect people. Some can be caught in the UK and others are only caught abroad. Most worm infections are not serious and can be easily treated with medicine.
A pharmacist can help with worm infections
A pharmacist can help if you have:
- small, white worms in your poo that look like pieces of thread
- extreme itching around your anus, particularly at night
This is probably threadworms.
They're common in the UK and can be treated with medicine from a pharmacy.

These infections are usually caught while travelling. They can take a long time to cause symptoms, so tell the GP if you have been abroad in the last 2 years.
Coronavirus (COVID-19) update: how to contact a GP
It's still important to get help from a GP if you need it. To contact your GP surgery:
- visit their website
- use the NHS App
- call them
See what different worms look like
Treatment to get rid of worms
It does not matter which type of worm you have – all worm infections are treated in a similar way.
You might be asked to provide a sample of poo so it can be tested for worm eggs.
If you have worms, a GP will prescribe medicine to kill them. You take this for 1 to 3 days. The people you live with may also need to be treated.
Any worms in your gut will eventually pass out in your poo. You may not notice this.
To avoid becoming infected again or infecting others, it's very important during the weeks after starting treatment to wash your hands:
- after going to the toilet
- before eating or preparing food
- regularly during the day
Important
Go back to the GP if your symptoms do not get better in 2 weeks or you keep passing live worms in your poo.
 Some are caught from food.
You can get infected by:
- touching objects or surfaces with worm eggs on them – if someone with worms does not wash their hands
- touching soil or swallowing water or food with worm eggs in it – mainly a risk in parts of the world without modern toilets or sewage systems
- walking barefoot on soil containing worms – only a risk in parts of the world without modern toilets or sewage systems
- eating raw or undercooked beef, pork or freshwater fish (like salmon or trout) containing baby worms – more common in parts of the world with poor food hygiene standards
You can catch some worms from pets, but this is rare.
How to prevent worm infections
Do
-
wash your hands before eating or preparing food, and after touching soil or using the toilet
-
only drink bottled or boiled water in high-risk areas (places without modern toilets or sewage systems)
-
deworm pet dogs and cats regularly
-
dispose of dog and cat poo in a bin as soon as possible
-
thoroughly wash garden-grown fruit and vegetables
Don’t
-
do not let children play in areas where there's a lot of dog or cat poo
-
do not eat raw fruit and vegetables in high-risk areas
-
do not walk barefoot in high-risk areas
-
do not eat raw or undercooked pork, beef or freshwater fish
Page last reviewed: 10 November 2020
Next review due: 10 November 2023


Our privacy policy is simple: we don’t collect
or share any of your personal information.
Our privacy policy is simple: we don’t collect
or share any of your personal information.
Our privacy policy is simple: we don’t collect
or share any of your personal information.
Dismiss forever | Back to search
Share DuckDuckGo and help
friends take their privacy back!


I'm a self taught web developer from Mumbai, India. I learned Full-Stack Web development from FreeCodeCamp and Udemy. I am eager to work and collaborate with others in this field and to learn from them and grow in the process. I am extremely excited to embark on the journey to become a full fledged developer. So feel free to get in touch with me.
Here's a few of the tools I use
Check out my latest projects
Allows you to add, remove and monitor your stocks in real time.
Uses: MongoDB, React, Node, APIs
View ProjectA weather app to check current weather conditions.
Uses: Javascript, Jquery, APIs
View ProjectLet's you explore and plan your nightlife.
Uses: MongoDB, React, Express, Node
View ProjectGet in touch with me snehshah95@gmail.com


This is the JavaScript version of newtontool.m.
Function to plot: Current guess for root: Current iteration: Value of the function at the current root guess: x-bounds: y-bounds:Plot of the function (blue), current root guess (black), and next root guess (green).
Plot of the function (blue), linearization (magenta), current root guess (black), and next root guess (green).


Written by: Robert Carlock & Dana Klein
Produced by: Robert Carlock & Wendy Knoller
Transcribed by: Coffee Mug, Eleonora, Sebastiano & Vanessa
[Scene: Central Perk. Joey's sitting on the couch and Phoebe enters.]
Phoebe: Oh, hey Joey.
Joey: Uh, hey.
Phoebe: Listen, I need to ask you something. Ok, you know how my step dad's in prison.
Joey: (afraid) Yeah.
Phoebe: Yeah. Well, uhm... listen he was supposed to get a weekend furlough, so he'd come to the wedding tomorrow, but he just called and... uhm... well, apparently stabbing Iceman in the exercise yard just couldn't wait till Monday.
Joey: So he can't come?
Phoebe: No, and so there's no one to walk me down the aisle and... well, I would just really love it if you would do it.
Joey: Seriously?
Phoebe: Yeah, you've... you know, sort of been like a dad to me.
Joey: I am pretty wisdomous.
Phoebe: So... what do you say?
Joey: Are you kidding? Phoebe, I would be honored. (they hug)
Phoebe: Oh, thank you. I hope... I hope you know how much you mean to me.

OPENING CREDITS
[Scene: Central Perk. Phoebe and Joey are sitting on the couch. A waitress brings a coffee and Phoebe wants to pay.]
Phoebe: Oh.
Joey: Oh no, no, no, let your dad get this.
Phoebe: (her mobile phone rings) Oh, it's my wedding planner. She's driving me crazy! (she answers) Hello... Hey, ok, stop screaming! Ok? So, halibut. All right, so salmon, either way. I don't-I don't... it doesn't matter to me!
Monica: (she enters with a headset on and she's speaking into the microphone) Well, it matters to me!
Phoebe: Well, I don't care, so you pick!
Monica: Did you just hung up on me? (she hangs up too) All right, look, I need you at the rehearsal dinner tonight at 1800 hours.
Phoebe: Uh-uh. Ok. What time is that.
Monica: You don't know military time?
Phoebe: Why, I must have been in missile training the day they taught that.
Monica: Just subtract twelve.
Phoebe: Ok, so... 1800 minus twelve is... one thousand, seven hundred and...
Monica: (screaming) Six o'clock!
Phoebe: Ok.
Monica: Ok. Hold on. (her mobile phone rings) Geller here! No! I said it has to be there by 4 o'clock. Goodbye. (she hangs up) Oh, how hard it is to make an ice sculpture?
Phoebe: Ice sculpture? That sounds really fancy! I told you I just want a simple wedding.
Monica: Please... honey, leave the details to me. Now I wanna make this day as special for you as I can. Now, ok, I was thinking that the harpist should wear white.
Phoebe: What harpist? My friend Marjorie is playing the steel drums.
Monica: Ooh... she backed out.
Phoebe: She did? Why?
Monica: I made her. (Phoebe looks shocked) Steel drums don't really say "elegant wedding". Nor does Marjorie's overwhelming scent.
Phoebe: (looking angry) Hey! She will shower when Tibet is free.
[Scene: The wedding rehearsal dinner.]
Chandler: Hey!
Phoebe: Hey!
Chandler: You look great. I'm so glad we're having this rehearsal dinner, you know, I so rarely get to practice my meals before I eat them.
Phoebe: Okay, what did we say was your one gift to us?
 I thought that was for the actual wedding.
Phoebe: Rehearse it!
Ross: Hi! (he kisses Phoebe)
Mike: Thanks for coming you guys.
Ross: Oh, (he goes towards Mike in order to shake hands but Mike hugs him) hey, oh... I... I was-I was going for a hand shake.
Mike: Is that why your hand is pressed against my crotch?
Ross: That is why!
Mike: Yeah.
Phoebe: So Rach.
Rachel: Yeah.
Phoebe: Where is Emma?
Rachel: Oh, Monica made me send her to my mother's. Apparently babies and weddings don't mix.
 Pheebs, you gotta keep the line moving, remember, 20 seconds per person. Your see these clowns all the time! (she takes off)
Joey: Hey, you're Mike's parents, right?
Mike's mother: Yes, we are.
Joey: Ah, our little ones are growing up fast, uh?
Mike's father: How's that?
Joey: You know, on the one hand you're happy for them, but on the other hand it's hard to let go.
Mike's father: Who in God's name are you?
Joey: Hey, I'm not that fond of you either, ok buddy? But I'm just trying to be nice for the kids!
(cut to Ross, Chandler and Rachel)
Chandler: (to Rachel) You know what I just realized? We have no idea what we're doing in the wedding tomorrow.
Ross: Yeah, I thought we'd be groomsmen, but wouldn't they have asked us by now? When did they ask you to be their bridesmaid?
Rachel: Uh... November?
Ross: I wanna say it's not looking good.
Rachel: Hey Pheebs...
Phoebe: What's up?
Rachel: Uhm... you haven't told these guys what they're doing in the wedding yet.
Chandler: Heh.
Phoebe: Uhm... well, they're not in the wedding.
Ross: What? (Ross and Chandler don't know what to say, so there's an embarrassing long pause)
Rachel: Well, this is really awkward (staring at the floor) Oh, and I can leave!

Ross: Oh, man!
Chandler: This is like figure skating team all over again. (Phoebe and Ross glare at him astonished) I mean synchronized swimming. (they continue to glare) I mean- I mean the balance beam. (to Ross) Help me!
Ross: FOOTBALL!
Chandler: Thank you.
Monica: (looking at Phoebe eating something) Pheebs, spit that out, that has pork in it.
Phoebe: Oh! I though the pot stickers were supposed to be vegetarian!
Monica: Yeah, I changed them. I-I sent you a fax about it!
Phoebe: I don't have a fax machine.
Monica: Ah, well then there are gonna be a few surprises!
Ross: I can't believe we're gonna be the only people that aren't in this wedding.
Chandler: I know, I hate being left out of things.
Ross: And it's a wedding! It'd be weird if I'm not in it...
Mike: Hey guys, how is it going?
Chandler: Fine. We're just sitting here. Alone. Doing nothing. It's our rehearsal for tomorrow.
Mike: Yeah look, about tomorrow, I... I've got a question for ya. I just found out that one of my groomsmen had had an emergency and can't make it.
Chandler: What happened?
Ross: Who cares, AND?
Mike: ...and I was wondering if... you know, maybe one of you guys... (Ross stands up)
Ross: I'll do it!
Chandler: (standing up too) M-Me-me-me!
Mike: You both wanna do it? Uhm... there's only room for one.
Chandler: Pick me, I look great in a tux and I will not steal focus.
Ross: No, Mike, no, no.
Mike: You know, I really don't feel very comfortable making this decision. You know, Phoebe knows you better, I'm gonna let her choose. (he leaves)
Ross: (to Chandler) Well, if Phoebe's choosing, then say hello to Mike's next groomsman.
Chandler: Oh, I will. But I will need a mirror... as he is me!
Ross: Please, you're going down!
Chandler: You are going downer!
Ross: Is that what they say on the Figure Skating Team?
Chandler: (almost crying) I wouldn't know, I didn't make it! (they hug)
[Scene: Wedding rehearsal dinner. Joey and Mike are talking.]
Joey: So, you know I'm filling in for Phoebe's step dad, tomorrow, right?
Mike: Yeah, yeah. Hey, thanks for doing that.
Joey: Oh, hey, my pleasure. (he suddenly becomes very serious) So what are your intentions with my Phoebe?
Mike: I intend to marry her.
Joey: Oh, a wiseacre. (Mike looks bewildered). No, no, no, I understand you plan to support your wife by playing the piano? Isn't that kind of unstable?
Mike: No more so than acting.
Joey: Strike two!
Mike: You're right. She probably will support me. Hey, unless we move in with you, dad?
Joey: Strike three! You only get one more, Mike!
(Cut to Chandler and Ross. Phoebe comes out of the ladies room and they run toward her.)
Ross: So, what did you decide?
Phoebe: I decided to pee.
Chandler: Mike didn't tell you? You have to chose one of us to be in your wedding. One of his groomsmen fell out.
Phoebe: Oh no, no. I can't choose between you two! I love you both so much!
Chandler: Just not enough to put us in the original wedding party.
Phoebe: Oh, I don't wanna choose! It's (Rachel is walking by). Oh okay, wait. Rach! Listen I have a very special bridesmaid task for you today.

Phoebe: Well, there's a spot open for only one groomsman and you have to choose between Ross and Chandler. So good luck with that.
Rachel: What, what, what, no, I don't wanna do that.
Phoebe: All right, I guess I'll have to find a new bridesmaid.
Ross: I'll do it! (Monica approaches)
Monica: Ok, it's 2100 hours. (to Phoebe) Time for your toast. (Mike appears)
Mike: Do I have a minute to go to the bathroom?
Monica: You had a bathroom break at 2030. Pee on your own time, Mike! (to Phoebe and Mike). Now, in regard to the toast, okay, you wanna keep them short, nothing kills a rehearsal dinner like long speeches. Okay.
Mike: Is that what you say to Chandler?
Monica: (very serious) It's 2101 and I am not amused. (pause). Ok, the bride and groom have a few words they'd like to say. (Everyone sits and Phoebe gets up)
Phoebe: Ok. Hello everyone and thank you all for being here tonight. So tomorrow's the big event and some of you might not know, but Mike and I didn't get off to the best start. (she reads a note). My friend Joey and I decided to fix each other up with friends so I, I... (Monica is twirling her hands in order to make Phoebe speed up her speech) oh I... hum... I gave it a lot of thought and I fixed him up with my friend Mary Ellen who couldn't be here tonight because... (Monica is tapping her watch with her finger) it's not important... she is in rehab. Anyway, so, ok, Joey said that he was fixing me up with his friend Mike, only he didn't have a friend Mike so he just brought, uhm, my Mike and, and (Monica clears her throat) but despite, you know... it got... it got good. Ok, I wanna take a moment to mention my mother, who couldn't be here...
Monica (rolling her eyes): oh God.
Phoebe: And... moment's over! (Rachel, Joey and Chandler all turn and look disapprovingly towards Monica but she just shrugs it off) So, ok, uh, I can forget that. I can forget that and uhm... (she's flipping cards skipping half of them) Oh this is funny! Oh, but you need to know that to... that, to... Oh, ok, well, uhm, I (Monica is miming CUT). Ok, ok, I, ok, I.... MONICA I CAN'T DO IT LIKE THIS! THIS IS MY WEDDING! OKAY, I DON'T WANT THIS (she mimes Monica's when she was twirling her hands) OR THIS (she taps her watch) OR THIS (she mimes CUT) OK? I JUST WANTED A SIMPLE WEDDING!  You're done.
Monica: What?
Phoebe: YOU'RE FIRED! (mimes the CUT again) (pause and she raises her glass) Cheers! (Chandler raises his, smiling and Monica stares at him and he puts down his glass.)
[Scene: Joey's apartment. Joey's having breakfast; Phoebe enters the room carrying her wedding dress.]
Phoebe: Hey!
Rachel: Happy wedding day!
Phoebe: Oh, happy my wedding day to you!
Rachel: Ok-dokey, Joey, listen. This is gonna be bridesmaid central, all right? We're gonna have hair and make-up going on in the bathroom and oh, I had to move a couple of things in the fridge to make room for the corsages.
Joey: Oh, man! I wouldn't have had breakfast if I knew there was going to be corsages!
(Monica enters the room)
Monica: Hi. About last night... I know you are under a lot of stress and even though the things you said hurt me a little bit... My point is, uh, well, I'm willing to take my job back.
Phoebe: Oh, well that's ok. I think you and I will do much better if you're just... here as a bridesmaid.
Monica: Oh, is that so? Ok. If that's really what you want, then here... I give you the headset. Well, I don't really want to give you the headset. Well I guess if you're taking over, you should probably return these messages. (hands her a stack of papers with messages and calls to return)
Phoebe: Wow, this is a lot!
Monica: Uh-huh, but I'm sure you can handle this. I mean, I have won awards for my organizational skills, but, uh, I'm sure you'll do fine.
Phoebe: You won awards?
Monica: Mm-mh. I printed them out on my computer.
(Ross enters the room)
Ross: Hey!
Monica: Hi.
Ross: Where's Rach?
Monica: She's in her room, why?
Ross: I have to talk to her about this groomsman situation, ok?  My God! You're breathtaking!
Rachel: What d'you want?
Ross: You haven't by any chance chosen a groomsman yet, have you?
Rachel: Oh, Ross, c'mon, please!
Ross: I'm not! I'm making it easier! Pick me!
Rachel: Well, Chandler said that it's really important to him too!
Ross: Listen, listen.
Rachel: Oh, you are the lesser of two evils!
Ross: (waving his fist in the air in triumph) YES, YES!
[Scene: Joey's apartment. Phoebe is talking at the phone, Monica is listening amused.]
Phoebe: Sven I don't understand what you're saying! What is wrong with the flowers? Lorkins?
Monica: I know.
(Mike enters the room).
Mike: Hey.
Phoebe: Listen, Mike, if you were Swedish and you were saying the word "lorkins" what flowers would that be?
Mike: (thinks a moment) Orchids?
Phoebe: Right there! That's why I'm marrying you!
(Joey comes out from his room)
Joey: (to Mike) Hello Michael.
Mike: Joseph.
Joey: May I have a word with you, please?
Mike: (looking around the room) This is... great...
Joey: Have a seat. (Mike sits on his bed, and Joey towers over him. He starts talking in an Italian godfather-type voice) Last night, I tried to welcome you into my family... and instead, you disrespect me... (shakes his head) I cannot allow this.
Mike: (not amused) Are you rehearsing for some really bad mafia movie?
Joey: More back talk. And yes, I may be borrowing a few lines from my recent unsuccessful audition for "Family Honor 2: Thissa Time Itsa Personal."
Mike: Joey, I kinda have a lot to do today, what do you want?
Joey: I want you to take this seriously! Phoebe is very very important to me, ok? And I wanna make sure that you are gonna take care of her.
Mike: (gets up) Joe, I love Phoebe. She's the single most important thing in my life.
Joey: (very satisfied and smiling) That's what I wanted to hear!
Mike: That must have been one lousy movie.
Joey: (almost crying) That was ME!
[Scene: Monica and Chandler's apartment. Chandler is pacing and Rachel walks in.]
Rachel: Hi
Chandler: Hey, can I talk to you about this groomsman thing? If you pick Ross, he'll walk you down the isle just fine. But if you choose me, you'll be getting some comedy!
Rachel: Even so, I think I'm gonna pick Ross.
Chandler: Let me tell you why you need to pick me. (Goes to sit on the couch facing backwards to the kitchen. Rachel gets a chair and sits opposite him) See, when I was a kid, I was always left out of everything, you know, and it really made me feel... insecure. You know, I was always picked last in gym.   Anyway, If I'm the only one left out of this wedding, I just know that all those feelings are gonna come rushing back.
Rachel: All right fine, I pick you.
Chandler: (Getting up and raising his fist in victory) Y-Y-YEEESSS! Make "groom" for Chandler.
Rachel: (not amused by his pun but forcing a smile anyway) Oh my...
[Scene: Joey and Rachel's apartment. Phoebe is on the phone and Monica is nonchalantly "minding her own business".]
Phoebe: No!  Alright I gotta go, I have another call, Reverend. (switches calls) Hello?
(Mike and Joey come out of Joey's room)
Joey: I'm glad we had this little talk.
Mike: Yes. Yeah and thanks for all the wedding night advice. (walks away) That didn't make me uncomfortable at all! Alright, so I'll see everybody tonight?
Phoebe: Okay.
Monica: Bye.
(Mike opens the door and there is a gigantic ice sculpture standing in the doorway)
Mike: Uhm, did you guys know that there is a giant ice sculpture in the hall?
Phoebe: Oh my God, what's it doing here?
Monica: (Obviously enjoying this setback) Ugh, I guess it got sent to the billing address as opposed to the shipping address. (by now she can barely keep herself from smiling) Uh! What a pickle.
 Why is this happening to me?
Joey: (staring at the ice sculpture) How bad do you want to stick your tongue on that? (They all glare at him)
[Scene: Central Perk. Ross is getting coffee at the counter. Chandler walks in.]
Chandler: How's it going?
Ross: (smiling to himself) Good. I'm just getting some coffee. So I'm alert for the wedding.
Chandler: (smiling to himself too) That's what I was doing too.

Chandler: You too.
Ross: Oh, I will.
Chandler: Me too.

Chandler: I'm not supposed to tell you.
Ross: I'm not supposed to tell you!
(Cut to Joey and Rachel's apartment. Chandler and Ross storm in looking very unhappy)
Chandler: You told us both we could be in the wedding? (they both stare at Rachel)
Rachel: Well, in my defense, you were not supposed to tell each other.
Ross: Rachel, only one of us can do it, you have to choose. You and me together again. (he winks at her and Rachel looks disgusted)
Chandler: Rach, Rach, knock knock.
Rachel: Who's there?
Chandler: I'll tell you at the wedding.
Rachel: Uh.
(Mike walks in.)
Mike: Hey, I forgot my scarf.
Rachel: You know what, I can't do this. I don't know which one of you guys to pick.
Mike: Oh, you haven't picked yet. Oh good, 'cause I had an idea. I thought it would be fun if the third groomsman was my family dog. Chappy.
Ross: What? A dog? No! Rachel gets to choose.
(all eyes turn to Rachel)
Rachel: (sarcastic) Wow, this is a tough one. I think I'm gonna have to go with the dog.
(Ross and Chandler look shocked)
(Cut to Phoebe who is in the living room, still on the phone.)
Phoebe: Alright, wait, so what you're saying is that the chef is at the Hamilton Club, but the food is not and the drinks are there, but the bartender is not?
Monica: (enjoying what she's seeing) How's it going?
Phoebe: (to Monica) Help me.
Monica: What?
Phoebe: I want you to be Crazy Bitch again.
Monica: (Sounds moved) Really?
Phoebe: (Nearly in tears) Please?
Monica: You really want me to come back?

Monica: Ok people, we are back in business! (Gets her headset out of her purse) Oh God, we've missed you soo much! (takes all the notes from Phoebe) Ok, go and get your hair and make-up done, and I'll take care of everything.
(Joey walks in)
Joey: Hey, what are you guys gonna do?
Phoebe: (sounds scared already) About what?
Joey: The blizzard. I just saw on the news, it's like the worst snow storm in 20 years! They already closed all the bridges and tunnels. (Opens the curtains to reveal a snow storm outside)
Monica: Ooh! But the band and the photographer are coming all the way in from New Jersey!
Joey: I don't think they are.
Ross: (to Rachel) Haha! Looks like you're not going to be in the wedding either. (Looks at Phoebe) So sorry Pheebs.
[Scene: Monica's apartment. They are all sitting around.]
Monica: (Putting down her phone) Well, the club lost it's power.
Joey: Yeah according to the news, most of the city did.
Rachel: Since when do you watch the news?
Joey: Uh, for your information, since they hired a very hot weather girl.
Ross: (To Phoebe and Mike) I can't believe you guys aren't going to be able to get married today.
Phoebe: I know.
Rachel: Wow, you know, it's so beautiful out there. You always wanted to get married outside. Why don't you guys just do it on the street?
Phoebe: What?
Rachel: Well, look, it's hardly snowing anymore. I mean you couldn't ask for a more romantic setting. This could be the simple wedding you've always wanted!
Phoebe: (Turning to Mike) What do you think?
Mike: I think I wanna get married to you today.
Phoebe: Me too! (turning to Monica) Monica, do you think we could do it?
Monica: (thinking) AFFIRMATIVE!
[Scene: Outside.
Monica: (walking around with her headset still on) OK LET'S GET THESE CHAIRS OUT HERE! Gunther, hit the Christmas lights. (He does so and the lights above the chairs light up. Monica looks satisfied) Okay, who left the ice sculpture (picks up a piece of ice from the ground) ON THE STEAM GRATE? (nobody answers)
Mike's mom: Michael!
Mike: Hey! You made it. Great! Chappy! Hi! (kisses his dad) Hi! (kisses his mom) Mom, I know getting married in the street isn't something you approve of...
Mike's mom: No... It's lovely. The lights and the snow. I could look at them forever.
Mike's dad: (leans in towards Mike) I crushed a pill and put it in her drink... (to his wife) Come on, sweetheart.
Mike: (to Chandler and Ross) You know, Chappy's too small to handle all this snow. Someone's gonna have to walk him down the aisle.
Chandler: So technically, would this person be in the wedding?
Mike: I guess.
Chandler and Ross: I'll do it!
Ross: No, but Chandler, hello... Aren't you scared of dogs?
Chandler: I'm not scared. (moves towards Mike and Chappy) I'll just take little Chappy and... (he backs out) HE CAN SENSE MY FEAR. MY THROAT IS EXPOSED.
Ross: (takes Chappy from Mike) Well, I guess I'm in the wedding then. Ha haaa... (smells Chappy) He stinks!
Monica: Level 1 alert. I repeat, level 1. This is not a drill. Okay we've got a situation. The minister just called. He's snowed in. He can't make it.
Mike: Oh, no!
Joey: Oh hey, don't worry. I'm still ordained from your wedding.
Monica: Really?
Joey: Yeah, you'd think I'd give up being a minister and start paying to ride the subway? Huhuh...
Ross: Uhm, ministers don't ride the subway for free.
Joey: I had to read the Bible pretty carefully, but... yeah we do.
Monica: Okay, if Joey does the ceremony, then we have to find someone else to walk Phoebe down the isle.
Chandler: (quickly) I'll do it.
Ross: I'll...
Chandler: (to Ross) Na ha ha... (to Chappy) Ne he he... (Ross moves Chappy to Chandler, who quickly backs away) Ah ah...
Monica: Okay, Mike and Joey, get in position.  He is clearly disgusted by it.)
(Cut to inside Central Perk where Rachel is helping Phoebe. Chandler and Monica enter.)
Monica: Okay, Joey's doing the ceremony and Chandler's giving you away.
Phoebe: Oh, okay. Hi new dad. (Chandler waves)
Monica: So, you're ready to do this?
Phoebe: Uhuh, uhuh... Oh my God! This is really happening.
Rachel: Oh Phoebe, I'm so happy for you honey. (she gives her a kiss)
Phoebe: Oh, thank you.
Monica: I love you. (Phoebe leans in to kiss her.) Oh, wait, wait, wait! No hugs. The dresses...
Rachel and Monica: I love you.
Monica: Okay. (in her microphone) It's zero hour. All teams execute on my count. (to all) Let's get this bad boy on the road.
Chandler: (to Monica) Is it okay that I want you to wear that head set in bed tonight?
Monica: (checking her clipboard) I have you scheduled for nudity at 2300 hours.
Chandler: Oh yeah! (Monica walks outside)
Monica: Okay Marjorie, hit it.
(A woman with a steel drum and a guy with a xylophone start playing an instrumental version of "Can't Help Falling In Love" by Elvis Presley.  Next are Rachel and Ross, who carries Chappy in his arms.)
Rachel: Geez Ross, you could have showered.
Ross: It's the dog.
(we cut to Monica)
Monica: Groomsman, groomsman, why are you just standing there, where is your bridesmaid? (into microphone) We've got a broken arrow. Bridesmaid down! (realizes) Oh, that's me.
(She walks down the aisle with the groomsman. We cut to inside Central Perk, where Phoebe and Chandler are waiting.)
Chandler: Ready?
Phoebe: (nervously) Okay.
Chandler: Okay.

(She takes off the coat she was wearing over her wedding dress, which is violet and has a darker shade petticoat underneath which shows at one side where the dress is lifted up to about the height of her hip and connected to the petticoat. She's wearing a veil over her curly hair and a low cut top with straps only just hanging over her shoulders.)
Chandler: Wow! Aren't you gonna be cold?
Phoebe: I don't care... I'll be my something blue.
Chandler: You look beautiful.
Phoebe: Thank you.
(They start to leave Central Perk. The band starts to play "Here, There and Everywhere" by the Beatles. The crowd rises from their seats. Phoebe and Chandler walk down the aisle. Phoebe really glows with happiness. So does Mike who watches her walk down the isle. When Phoebe and Chandler arrive, they kiss and Phoebe walks to her bridesmaids.)
Mike: My God! Aren't you freezing?
Phoebe: Na-ah.
(the music ends)
Joey: Friends, family, dog... Thank you all for being here to witness this blessed event. The cold has now spread to my special place... so I'm gonna do the short version of this. Phoebe and Mike are perfect for each other. And I know I speak for every one here... when I wish them a lifetime of happiness. Who has the rings?
(one of the groomsmen gives the rings to Joey)
Joey: (whispering to Phoebe) Okay...
Phoebe: When I was growing up, I didn't have a normal mom and dad, or a regular family like everybody else, and I always knew that something was missing. But now I'm standing here today, knowing that I have everything I'm ever gonna need... You are my family. (She puts the ring on Mikes finger)
Mike: Phoebe you're so beautiful.   Every day with you is an adventure, and I can't believe how lucky I am, and I can't wait to share my life with you forever. (He puts the ring on Phoebe's finger.)
 I love you... and you have nice eyes.
Mike: I love you too.
Ross: Uh Joey...
Joey: Yeah?
Ross: Chappy's heart rate has slowed way down.
Joey: Oh, okay. Phoebe, do you take this man to be your husband?
Phoebe: I do.
(Joey has a "Yeah you do" smile on his face)
Joey: Mike, do you take this woman to be your wife?
Mike: I do.
Joey: I now pronounce you... husband and wife.
(Phoebe and Mike kiss)
Phoebe: I got married! (everyone applauds) Could someone get me a coat, I'm freaking freezing.
(Mike takes off his coat to give to Phoebe and the steel band plays "The Wedding Song")
COMMERCIAL BREAK
[Scene: The hallway between the two apartments. Chandler and Joey are walking up the stairs.]
Chandler: That really was an incredible wedding.
Joey: It was, yeah. I kind of don't want it to end.

Joey: Nice. Oh hey, what about Ross?
Chandler: I don't know. Maybe he hooked up with that hot girl he was talking to.
(cut to the street in front of Central Perk where Ross is walking Chappy. He has a plastic bag in his hand.)
Ross: Come on Chappy, do your business. MAKE! MA-AKE! I did not sign on for this.
THE END


Park Ranger
Pawnee, IA - Preview this post
3,154
APPLICANTS
1,546
INTERVIEWS
912
FORWARDS
JOB DESCRIPTION |
|||
|---|---|---|---|
| Position Title | Park Ranger | ||
| Location | Pawnee, Indiana | ||
| Employment Type | Full-time | ||
| Experience | Entry-level | ||
| Status | Open | ||
| Description | Anti-pattern touch base or shotgun approach, and take five, punch the tree, and come back in here with a clear head. Work move the needle, so vertical integration. Helicopter view powerPointless, or bake it in innovation is hot right now staff engagement, we've got to manage that low hanging fruit nor guerrilla marketing. Wiggle room. Prethink hit the ground running, for moving the goalposts. We don't want to boil the ocean sacred cow good optics. Put a record on and see who dances. | ||
| Hiring Lead | Ron Swanson | ||
| APPROVED SALARY | $32,000 - $33,000 depending on experience |


---
layout: member-page
title: Shannon Lin
class_of: 2024
bio: "I'm a BXA Design and Cognitive Science student interested in Animation and Special Effects! I'm not a veteran in creating games by any means, but I'm fascinated with the stylistic art and visual storytelling of games such as Monument Valley, Oxenfree, Sky: Children of Light, and OPUS. I specialize in art and environments.
I'm familiar with Unity, Maya, Photoshop, Illustrator, and Procreate."
last_updated: January 31, 2021
# Optional
email<EMAIL_ADDRESS>website: "https://www.shannonlin.design/"
---


When I first started to travel long-term, people asked me what I was running away from, wondered why I wanted to be gone so long, and would mostly tell me I was crazy or weird.
Suffice it to say, I didn’t get a lot of encouragement and support in the beginning.
Sometimes your friends and family, the people you want most to be supportive of your trip, aren’t as enthusiastic as you’d like them to be. They don’t understand and try to talk you out of going. It can be deflating and saddening. You’re so excited about this adventure and here they are, raining on your parade.
Many readers reach out to me about this topic frequently. I can feel the angst in their emails and the confusion at not knowing to how deal with the situation.
“How do I not let them get me down? What did you do? What do I say?”
As I sat down to write this article, I took a poll on Facebook and asked readers about their experiences. I was amazed by how much commonality there was among people’s situations and the reactions from their friends and family. Apparently, I’m not the only who faced such negativity, and, luckily, I’m also not the only who ignored it.
 So below are some common criticisms future travelers hear and examples of how I’ve turned similar criticism around when I’ve been faced with it myself:
“The world is unsafe. You shouldn’t go.”I hear this one a lot, not only from people via email but also from people in my own life (especially my mom). News organizations paint the world to be a scary, scary place with criminals lurking around every corner. News shows love to highlight the dangers of life; as they say, “if it bleeds, it leads.” But crime happens everywhere. It occurs in NYC, London, Paris, Tokyo, Thailand, Turkey, Brazil, and every small town and medium-sized city in between.  Just like you can travel the world and never have anything happen to you. There is no place in the world that is 100% safe. Once you put it into this perspective for people, it usually ends the subject.
“You are just running away.”People seem to assume that if you are traveling long-term, you must be running away from something. When people say this to me, I tell them that yes, I am running away — from their version of life and to my version of life. Remind people that what they do in their life may make them happy, but that you have different goals — and this trip is what makes you happy right now. Most people will admit you have a point and drop the subject because, at the end of the day, we all want our friends to realize their dreams and be happy. True friends will let you go after yours and be supportive along the way.
“Why don’t you get a job?”Let’s face facts: unless you suddenly strike it rich, you’ll be working until you’re dead. The notion of working until a certain age and then retiring is long gone in the modern economy. When people tell me that I should get a job, I respond that if I’m going to be working well into my old age, I’d rather spend my healthy years exploring the world instead of sitting in an office. There will always be time later to work.
“I wish I could do that. It must be nice to not have any responsibility.”This is jealousy, pure and simple. I tell people, “You can travel too.” There’s nothing special about me and my decision. Once you take care of your bills and sell your stuff, you can set off on your own journey — even if you’re older than the average backpacker or have kids. While there are always circumstances that really keep people from traveling, for the most part the only things holding anyone back are the restrictions they put on themselves. People of all ages and circumstances find ways to turn travel into a reality.
“It’s unsafe to travel alone.” I typically respond to anyone who offers this argument by asking them why they believe this, and they will usually begin to spout stories they “learned” from the news about people who traveled alone and ended up in a bad situation. They might rattle off worst-case scenarios: “you could get sick, injured, robbed, or worse, and no one would be around to help.” That may be true, but if I went hiking in the woods by myself, the same thing could happen. Hell, I could fall in my apartment and no one might notice for days. As a solo traveler, you have to be a little more vigilant, but being alone in Paris or Thailand is like being alone everywhere else.


Give Yucky Food
Give Green Food
Give Blue Food
Expose to Low Light
Expose to High Light
Give a Spritz of Water
Give Lots of Water
Cactus Values
Water:
0
Soil:
0
Light:
0
Give Yucky Food
Give Green Food
Give Blue Food
Expose to Low Light
Expose to High Light
Give a Spritz of Water
Give Lots of Water
Desk Plant Values
Water:
0
Soil:
0
Light:
0


--- layout: post title: Two Ways to Get OpenElections Data date: 2014-12-22 19:19:33.000000000 -05:00 type: post parent_id: '0' published: true password: '' status: publish categories: - Results - Using the data tags: - raw results meta: _edit_last: '43578620' geo_public: '0' _publicize_pending: '1' author: login: openelections email<EMAIL_ADDRESS>display_name: openelections first_name: '' last_name: '' ---
When we released our initial dashboard for downloading election results in July, we wanted to make it easy for anyone to grab CSV files of raw results with just a browser. We've continued adding states to our results site, the latest being North Carolina, Florida and -- for a few elections -- Mississippi. Pennsylvania will be on the way soon.
But we also wanted our results to be usable by developers as well, and we're taking advantage of Github to help make that easier. Each time that we publish raw results data, which hasn't been standardized beyond geography -- we publish it first to a GitHub repository for that state. For example, you can find a repository for Mississippi results that can be cloned and/or accessed via API, avoiding manual downloads. The naming convention for the repositories is the same: openelections-results-{state}, and you might find partial results for states that don't yet appear on the download map (like Iowa) because they're still in progress.
Using GitHub has two advantages for us -- it helps to maintain a history of published changes, of course -- but GitHub Pages also provides a filesystem for storing the raw CSVs that power the results site downloads. And should we need to move the CSV downloads to another location, we can do that, too. All of this underscores our commitment to using existing standards and practices rather than inventing new ones.
So if you were looking for election results CSVs as part of your holiday plans, we've got two ways to get them. Enjoy, and Happy New Year!


XYZ 1000 Replicator
With the XYZ 1000 Replicator you’ll never again be stuck with an empty kitchen and nothing for dinner!
Features
- It’s like having your own personal chef from 1,783,482,482 (and counting) planets in your kitchen!
- Can’t think of a dish? Use Random-Mode™ (warning, not for the squeamish)
- Integrated Internet meal suggestions
- Fusion powered
- Self-cleaning
- Matches any decor
Availability
The XYZ 1000 can be ordered at your local Starfleet commissary.


Video Of Rapper Edem Preparing Banku Hits The Internet
by Ghbase New WriterRapper Edem has lighted up the internet after a video of him preparing banku or probably ‘akple’ hit the net.
Apparently the rapper, real name Denning Edem Hotor has some great culinary skills as he stirs the popular local dish to the delight of his friends who were videoing him.
One of his friends even joked that it’s only a real man who knows how to cook that can ride a woman in bed.
Banku or its variant Akple is a Ghanaian dish which is cooked by a proportionate mixture of fermented corn and cassava dough in hot water into a smooth, whitish paste, served with soup, stew or a pepper sauce with fish.
Watch the video: