text:
Colorful connection found in coral's ability to survive higher temperatures
A coral's color can tell of its resilience to climate change, and a new study has shed light on the underlying genetic factors that may be at work behind this.
Coral within the family Acropora are fast growers and thus important for reef growth, island formation, and coastal protection but, due to global environmental pressures, are in decline
A species within this family has three different color morphs – brown, yellow-green, and purple, which appear to respond differently to high temperatures
Researchers looked at the different proteins expressed by the different color morphs, to see whether these were related to their resilience to a changing environment
The green variant was found to maintain high levels of green fluorescent proteins during summer heatwaves and was less likely to bleach than the other two morphs
This suggest that resistance to thermal stress is influenced by a coral's underlying genetics, which, coincidentally, also lead to the different color morphs
Anyone who visits the Great Barrier Reef in Australia, Southeast Asia's coral triangle, or the reefs of Central America, will surely speak of how stunning and vibrant these environments are. Indeed, coral reefs are believed to house more biodiversity than any other ecosystem on the planet, with the coral providing protection and shelter for hundreds of species of fish and crustaceans.
But these ecosystems are under threat. Global pressures, such as rising ocean temperatures, are causing coral to turn ghostly white, a phenomenon called bleaching, and die. One family of coral – Acropora – seems to be particularly susceptible and its numbers are expected to decline in the future. This is especially concerning as these corals are fast growers and thus structurally important for the reefs. Researchers took a close look at Acropora tenuis, a species within this family, which is known to have three color morphs – brown, purple, and yellow-green. Their new study, published in G3: Genes|Genomes|Genetics, indicates that these color morphs speak of the coral's resilience to high temperatures, and found the underlying genetic factors that seem to be responsible for this.
Acropora Tenuis is a common coral around Okinawa. It has three distinct color morphs – brown, yellow-green, and purple. Photo credit: Daisuke Kezuka.
Photo credit: Daisuke Kezuka
"Coral reefs are very beautiful and have a whole variety of different colors," said Professor Noriyuki Satoh, who leads the Marine Genomics Unit at the Okinawa Institute of Science and Technology Graduate University (OIST). "When we started looking at the different color morphs of A. tenuis we noticed that some morphs bleach more readily and die more frequently than others. During the summer of 2017, we saw that many of the brown and purple morphs bleached, with the brown morph dying at a higher rate, but the yellow-green morph seemed to show resilience to the summer temperatures."
The Unit worked with several individuals from the Okinawan community, including Koji Kinjo from Sea Seed, who directs a private aquarium where the different color morphs have been grown for around 20 years. This aquarium was instrumental for the researchers to observe the coral over the last two decades and to determine how resilient this species is to climate change, and the underlying causes.
The three different color morphs of this coral have been grown in the private aquarium - Umino-Tane Co. LTD (Sea Seed) – located in Okinawa, for the last two decades. This aquarium was instrumental in the OIST researchers being able to conduct this study.
In 2020, Professor Satoh and his collaborators decoded the genome of A. tenuis, which provided them with the toolkit for this research, allowing them to look at the genetic foundations that cause the different morphs.
"At first, we thought the difference in resilience might be linked to the corals housing different kinds of symbiotic algae, which photosynthesize for the coral and thus provide the coral with energy. Previous research has shown that some symbiotic algae are more resilient to climate change than others. But when we looked at the three-color morphs, we found that they all housed very similar algae," explained Professor Satoh.
With this in mind, the research group instead focused the expression levels of the proteins that are thought responsible for the coral's color. There are four different groups of these proteins – green fluorescent proteins (GFP), red fluorescent proteins (RFP), cyan fluorescent proteins (CFP), and non-fluorescent blue/purple chromoproteins (ChrP). The researchers looked at the gene expression levels of five types of GFP, three types of RFP, two types of CFP and seven types of ChrP in several coral in each morph.
As can be expected, they found that the green morph expressed high quantities of FGPs, but the researchers found that two of the five were expressed at particularly high levels. More surprising was that these two proteins were expressed at even higher levels during summer, which indicates that they help the coral to withstand warmer temperatures. Specifically, these proteins seemed to protect the symbiotic algae, which meant that this color morph experienced very little bleaching.
In contrast, the corals with the brown color morph, which express much lower quantities of these two proteins, bleached by around 50% over July and August 2017.
The purple morph was different again. It expressed very little of any of the fluorescent proteins, but much higher levels of Chrp. The corals with this color morph bleached at levels in between that seen in corals with the brown morph and that seen in corals with the green morph.
"Coral reefs are so important for biodiversity," concluded Professor Satoh. "Finding out more about them will help us to conserve them. Right now, we cannot help so much about the coral reef situation but gathering this fundamental knowledge, understanding how corals work, is very important for long-term conservation."
This research has showcased that the color morphology of coral is very much involved in its response to high temperatures. The underlying reasons behind this, such as exactly how the green fluorescent protein protects the symbiosis, will no doubt be the topic of research in the future.
The green color morph (pictured in the lower right corner) was more resilient to rising sea temperatures than the purple color morph (also pictured) and the brown color morph. This research has shed light on the underlying genetic and protein factors that may be at work behind this. Photo credit: Kohei Shintaku.
Kohei Shintaku
Professor Satoh and his Unit worked with people from Umino-Tane Co. LTD, IDEA Consultants, Inc., and Okinawa Environmental Research Co., Ltd., as well as researchers from the University of Tokyo. In addition, OIST's DNA Sequencing Section and Imaging Section were also involved in this project. This research was partially funded by a donation from the Imano family.
Title: Color morphs of the coral, Acropora tenuis, show different responses to environmental stress and different expression profiles of fluorescent-protein genes
Journal: G3: Genes|Genomes|Genetics
Authors: Noriyuki Satoh, Koji Kinjo, Kohei Shintaku, Daisuke Kezuka, Hiroo Ishimori, Atsushi Yokokura, Kazutaka Hagiwara, Kanako Hisata, Mayumi Kawamitsu, Koji Koizumi, Chuya Shinzato, Yuna Zayasu
DOI: https://doi.org/10.1093/g3journal/jkab018
Lucy Dickie
Genomics Marine science
The three color morphs of Acropora Tenuis
Sea Seed aquarium
Corals at Sea Seed aquarium
Acropora Tenuis is found around Okinawa
Into the DNA of a Coral Reef Predator
Researchers from OIST and Australia have sequenced and decoded for the first time the genome of the Crown-of-Thorns Starfish, paving the way for the biocontrol of this invasive predator responsible for the destruction of coral reefs across indo-pacific oceans.
Marine drifters: Interdisciplinary study explores plankton diversity
Researchers combine mathematical models, marine science, and metagenomics to answer a decades-old question – why are there so many species in the ocean?
Decoding the Complex Life of a Simple Parasite
Scientists decode the genome sequence of one of nature's most complex parasites, dicyemids.


text:
Here's how much a Pulitzer Prize actually boosts book sales for winners
ByGina Ragusa
Winning one of the most prestigious awards for writing is great for your career — not to mention your ego. No more toiling in obscurity as you struggle to make ends met. But you might be surprised at how little a Pulitzer affects actual book sales: While a win almost always gives books a sales bump, its overall effect might be more modest than you'd expect.
Take Colson Whitehead's The Underground Railroad, which won the Pulitzer Prize for fiction, and moved from No. 323 on Amazon's best seller rank to No. 12 a day later on April 11. The acclaimed novel, which had previously won the National Book Award and was an Oprah book club choice, is an imaginative tale of an escaped slave's journey to freedom in the pre-Civil war era.
Yet while an Amazon ranking of 12 is solid, it's not clear Whitehead's book will regain the No. 1 sales ranking it enjoyed on the New York Times bestseller list in 2016 — after Oprah made it her book club pick.
Indeed, the last two Pulitzer fiction winners, Anthony Doerr's All the Light We Cannot See and Donna Tartt's The Goldfinch, never reascended to the bestseller status they earned before winning the Pulitzer following their wins. Notably, other book awards, such as the Newbery and the National Book Award seem to be better at drumming up sales.
Meanwhile, Evicted by MacArthur "genius" Matthew Desmond, winner of the 2017 Pulitzer Prize in general nonfiction, jumped from Amazon's No. 6,760 on April 10 to No. 1,056 on April 11. The book, which explores the mass evictions during the financial crisis, is still a long way from the sales ranking it would need to make it onto the New York Times bestseller list like it did in 2016.
A Pulitzer can pluck a book out of obscurity
Lesser-known winners, to be fair, saw tremendous sales bumps following the 2017 Pulitzer announcements. Hisham Matar's The Return, which recounts the author's search for his father in Libya, rose from No. 219,668 to No. 5,396. Blood in the Water by Heather Ann Thompson rose from a dismal No. 20,142 ranking to No. 817 after winning the Pulitzer Prize for history.
The book examines the brutality and severe prison conditions that led to the Attica prison uprising in 1971.
Finally, in the poetry category, the paperback version of Tyehimba Jess' Olio, which explores racial discord and collaborative identity, soared from No. 35,127 to No. 429 in 24 hours.
George Rudy/Shutterstock
...but it won't always make the author rich
Winning a Pulitzer doesn't always equate to big money, however. "Whether awards such as the Pulitzer automatically translate to a significant improvement in sales depends on the award itself — and the book in question," Forbes noted.
While this year's poetry winner has already enjoyed a seismic rise in its Amazon sales ranking, poetry winners only "rarely" see a big increase in sales, Forbes added.
All of this said, sometimes Pulitzer winners do hit the sales jackpot. Olive Kitteridge by Elizabeth Strout, for example, rose from weekly sales of 1,197 to as much as 11,141 sold per week shortly after it won the 2009 fiction award, according to Publisher's Weekly.
By 2012, it was a mega-hit, with some 914,000 copies sold.
Sign up for The Payoff — your weekly crash course on how to live your best financial life. Additionally, for all your burning money questions, check out Mic's credit, savings, career, investing and health care hubs for more information — that pays off.
These activities may boost your memory and brain function
Thinx has been the subject of multiple lawsuits. Now they're paying up.

redpajama_set_name: RedPajamaCommonCrawl


text:
// bdlde_base64encoder.h                                              -*-C++-*-

// ----------------------------------------------------------------------------
//                                   NOTICE
//
// This component is not up to date with current BDE coding standards, and
// should not be used as an example for new development.
// ----------------------------------------------------------------------------

#ifndef INCLUDED_BDLDE_BASE64ENCODER
#define INCLUDED_BDLDE_BASE64ENCODER

#include <bsls_ident.h>
BSLS_IDENT("$Id: $")

//@PURPOSE: Provide automata for converting to and from Base64 encodings.
//
//@CLASSES:
//  bdlde::Base64Encoder: automata performing Base64 encoding operations
//
//@SEE_ALSO: bdlde_base64decoder
//
//@DESCRIPTION: This component provides a 'class', 'bdlde::Base64Encoder',
// which provides a pair of template functions (each parameterized separately
// on both input and output iterators) that can be used respectively to encode
// and to decode byte sequences of arbitrary length into and from the printable
// Base64 representation described in Section 6.8 "Base64 Content Transfer
// Encoding" of RFC 2045, "Multipurpose Internet Mail Extensions (MIME) Part
// One: Format of Internet Message Bodies."
//
// The 'bdlde::Base64Encoder' and 'bdlde::Base64Decoder' support the standard
// "base64" encoding (described in https://tools.ietf.org/html/rfc4648) as well
// as the "Base 64 Encoding with URL and Filename Safe Alphabet", or
// "base64url", encoding.  The "base64url" encoding is very similar to "base64"
// but substitutes a couple characters in the encoded alphabet to avoid
// characters that conflict with special characters in URL syntax or filename
// descriptions (replacing '+' for '-'. and '/' for '_').  See
// {Base 64 Encoding with URL and Filename Safe Alphabet} for more information.
//
// Each instance of either the encoder or decoder retains the state of the
// conversion from one supplied input to the next, enabling the processing of
// segmented input -- i.e., processing resumes where it left off with the next
// invocation on new input.  Instance methods are provided for both the encoder
// and decoder to (1) assert the end of input, (2) determine whether the input
// so far is currently acceptable, and (3) indicate whether a non-recoverable
// error has occurred.
//
///Base 64 Encoding
///----------------
// The data stream is processed three bytes at a time from left to right (a
// final quantum consisting of one or two bytes, as discussed below, is handled
// specially).  Each sequence of three 8-bit quantities
//..
//      7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
//     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
//     |               |               |               |
//     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
//      `------v------' `------v------' `------v------'
//           Byte2           Byte1           Byte0
//..
// is segmented into four intermediate 6-bit quantities.
//..
//      5 4 3 2 1 0 5 4 3 2 1 0 5 4 3 2 1 0 5 4 3 2 1 0
//     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
//     |           |           |           |           |
//     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
//      `----v----' `----v----' `----v----' `----v----'
//         char3       char2       char1        char0
//..
// Each 6-bit quantity is in turn used as an index into the following character
// table to generate an 8-bit character.  The four resulting characters hence
// form the encoding for the original 3-byte sequence.
//..
//     ======================================================================
//     *              Table of Numeric BASE-64 Encoding Characters          *
//     ----------------------------------------------------------------------
//     Val Enc  Val Enc  Val Enc  Val Enc  Val Enc  Val Enc  Val Enc  Val Enc
//     --- ---  --- ---  --- ---  --- ---  --- ---  --- ---  --- ---  --- ---
//       0 'A'    8 'I'   16 'Q'   24 'Y'   32 'g'   40 'o'   48 'w'   56 '4'
//       1 'B'    9 'J'   17 'R'   25 'Z'   33 'h'   41 'p'   49 'x'   57 '5'
//       2 'C'   10 'K'   18 'S'   26 'a'   34 'i'   42 'q'   50 'y'   58 '6'
//       3 'D'   11 'L'   19 'T'   27 'b'   35 'j'   43 'r'   51 'z'   59 '7'
//       4 'E'   12 'M'   20 'U'   28 'c'   36 'k'   44 's'   52 '0'   60 '8'
//       5 'F'   13 'N'   21 'V'   29 'd'   37 'l'   45 't'   53 '1'   61 '9'
//       6 'G'   14 'O'   21 'W'   30 'e'   38 'm'   46 'u'   54 '2'   62 '+'
//       7 'H'   15 'P'   22 'X'   31 'f'   39 'n'   47 'v'   55 '3'   63 '/'
//     ======================================================================
//..
// This component also supports a slightly different alphabet, "base64url",
// that is more appropriate if the encoded representation would be used in a
// file name or URL (see
// {Base 64 Encoding with URL and Filename Safe Alphabet}).
//
// The 3-byte grouping of the input is only a design of convenience and not a
// requirement.  When the number of bytes in the input stream is not divisible
// by 3, sufficient 0 bits are padded on the right to achieve an integral
// number of 6-bit character indices.  Then one of two special cases will apply
// for the final processing step:
//
// I) There is a single byte of data, in which case there will be two Base64
// encoding characters (the second of which will be one of [AQgw]) followed by
// two equal ('=') signs.
//
// II) There are exactly two bytes of data, in which case there will be three
// Base64 encoding characters (the third of which will be one of
// [AEIMQUYcgkosw048] followed by a single equal ('=') sign.
//
// The MIME standard requires that the maximum line length of emitted text not
// exceed 76 characters exclusive of CRLF.  The caller may override this
// default if desired.
//
// Input values of increasing length along with their corresponding Base64
// encodings are illustrated below:
//..
//        Data: /* nothing */
//    Encoding: /* nothing */
//
//        Data: 0x01
//    Encoding: AQ==
//
//        Data: 0x01 0x02
//    Encoding: AQI=
//
//        Data: 0x01 0x02 0x03
//    Encoding: AQID
//
//        Data: 0x01 0x02 0x03 0x04
//    Encoding: AQIDBA==
//..
// In order for a Base64 encoding to be valid, the input data must be either of
// length a multiple of three (constituting maximal input), or have been
// terminated explicitly by the 'endConvert' method (initiating bit padding
// when necessary).
//
///Base 64 Encoding with URL and Filename Safe Alphabet
///----------------------------------------------------
// The encoder and decoder in this component also support the "base64url"
// encoding, which is the same as standard "base64" but substitutes (a couple)
// characters in the alphabet that are treated as special characters when used
// in a URL or in a file system.  The following table is technically identical
// to the table presented in {Base 64 Encoding}, except for the 62:nd and 63:rd
// alphabet character, that indicates '-' and '_' respectively.
//..
//     ======================================================================
//     *            The "URL and Filename Safe" BASE-64 Alphabet            *
//     ----------------------------------------------------------------------
//     Val Enc  Val Enc  Val Enc  Val Enc  Val Enc  Val Enc  Val Enc  Val Enc
//     --- ---  --- ---  --- ---  --- ---  --- ---  --- ---  --- ---  --- ---
//       0 'A'    8 'I'   16 'Q'   24 'Y'   32 'g'   40 'o'   48 'w'   56 '4'
//       1 'B'    9 'J'   17 'R'   25 'Z'   33 'h'   41 'p'   49 'x'   57 '5'
//       2 'C'   10 'K'   18 'S'   26 'a'   34 'i'   42 'q'   50 'y'   58 '6'
//       3 'D'   11 'L'   19 'T'   27 'b'   35 'j'   43 'r'   51 'z'   59 '7'
//       4 'E'   12 'M'   20 'U'   28 'c'   36 'k'   44 's'   52 '0'   60 '8'
//       5 'F'   13 'N'   21 'V'   29 'd'   37 'l'   45 't'   53 '1'   61 '9'
//       6 'G'   14 'O'   22 'W'   30 'e'   38 'm'   46 'u'   54 '2'   62 '-'
//       7 'H'   15 'P'   23 'X'   31 'f'   39 'n'   47 'v'   55 '3'   63 '_'
//     ======================================================================
//..
///Base 64 Decoding
///----------------
// The degree to which decoding detects errors can significantly affect
// performance.  The standard permits all non-Base64 characters to be treated
// as whitespace.  One variant mode of this decoder does just that; the other
// reports an error if a bad (i.e., non-whitespace) character is detected.  The
// mode of the instance is configurable.  The standard imposes a maximum of 76
// characters exclusive of CRLF; however, the decoder implemented in this
// component will handle lines of arbitrary length.
//
// The following kinds of errors can occur during decoding and are reported
// with the following priority:
//..
// BAD DATA: A character (other than whitespace) that is not a member of the
//           Base64 character set (including '=').  Note that this error
//           is detected only if the 'decoder' is explicitly configured (at
//           construction) to do so.
//
// BAD FORMAT: An '=' character precedes a valid numeric Base64 character,
//             more than two '=' characters appear (possibly separated by
//             non-Base64 characters), a numeric Base64 character other than
//             [AEIMQUYcgkosw048] precedes a single terminal '=' character,
//             or a character other than [AQgw] precedes a terminal pair of
//             consecutive '=' characters.
//..
// The 'isError' method is used to detect such anomalies, and the 'numIn'
// output parameter (indicating the number of input characters consumed) or
// possibly the iterator itself (for iterators with reference-semantics)
// identifies the offending character.
//
// Note that the existence of an '=' can be used to reliably indicate the end
// of the valid data, but no such assurance is possible when the length (in
// bytes) of the initial input data sequence before encoding was evenly
// divisible by 3.
//
///Usage
///-----
// The following example shows how to use a 'bdlde::Base64Encoder' object to
// implement a function, 'streamEncoder', that reads text from a
// 'bsl::istream', encodes that text in base 64 representation, and writes the
// encoded text to a 'bsl::ostream'.  'streamEncoder' returns 0 on success
// and a negative value if the input data could not be successfully encoded or
// if there is an I/O error.
//..
// streamencoder.h                    -*-C++-*-
//
// int streamEncoder(bsl::ostream& os, bsl::istream& is);
//     // Read the entire contents of the specified input stream 'is', convert
//     // the input plain text to base 64 encoding, and write the encoded text
//     // to the specified output stream 'os'.  Return 0 on success, and a
//     // negative value otherwise.
//..
// We will use fixed-sized input and output buffers in the implementation, but,
// because of the flexibility of 'bsl::istream' and the output-buffer
// monitoring functionality of 'bdlde::Base64Encoder', the fixed buffer sizes
// do *not* limit the quantity of data that can be read, encoded, or written to
// the output stream.  The implementation file is as follows.
//..
// streamencoder.cpp                  -*-C++-*-
//
// #include <streamencoder.h>
//
// #include <bdlde_base64encoder.h>
//
// namespace BloombergLP {
//
// int streamEncoder(bsl::ostream& os, bsl::istream& is)
// {
//     enum {
//         SUCCESS      =  0,
//         ENCODE_ERROR = -1,
//         IO_ERROR     = -2
//     };
//..
// We declare a 'bdlde::Base64Encoder' object 'converter', which will encode
// the input data.  Note that various internal buffers and cursors are used as
// needed without further comment.  We read as much data as is available from
// the user-supplied input stream 'is' *or* as much as will fit in
// 'inputBuffer' before beginning conversion.
//..
//     bdlde::Base64Encoder converter;
//
//     const int INBUFFER_SIZE  = 1 << 10;
//     const int OUTBUFFER_SIZE = 1 << 10;
//
//     char inputBuffer[INBUFFER_SIZE];
//     char outputBuffer[OUTBUFFER_SIZE];
//
//     char *output    = outputBuffer;
//     char *outputEnd = outputBuffer + sizeof outputBuffer;
//
//     while (is.good()) {  // input stream not exhausted
//
//         is.read(inputBuffer, sizeof inputBuffer);
//..
// With 'inputBuffer' now populated, we'll use 'converter' in an inner 'while'
// loop to encode the input and write the encoded data to 'outputBuffer' (via
// the 'output' cursor').  Note that if the call to 'converter.convert' fails,
// our function terminates with a negative status.
//..
//         const char *input    = inputBuffer;
//         const char *inputEnd = input + is.gcount();
//
//         while (input < inputEnd) { // input encoding not complete
//
//             int numOut;
//             int numIn;
//
//             int status = converter.convert(output, &numOut, &numIn,
//                                            input,   inputEnd,
//                                            outputEnd - output);
//             if (status < 0) {
//                 return ENCODE_ERROR;                               // RETURN
//             }
//..
// If the call to 'converter.convert' returns successfully, we'll see if the
// output buffer is full, and if so, write its contents to the user-supplied
// output stream 'os'.  Note how we use the values of 'numOut' and 'numIn'
// generated by 'convert' to update the relevant cursors.
//..
//             output += numOut;
//             input  += numIn;
//
//             if (output == outputEnd) {  // output buffer full; write data
//                 os.write (outputBuffer, sizeof outputBuffer);
//                 if (os.fail()) {
//                     return IO_ERROR;                               // RETURN
//                 }
//                 output = outputBuffer;
//             }
//         }
//     }
//..
// We have now exited both the input and the "encode" loops.  'converter' may
// still hold encoded output characters, and so we call 'converter.endConvert'
// to emit any retained output.  To guarantee correct behavior, we call this
// method in an infinite loop, because it is possible that the retained output
// can fill the output buffer.  In that case, we solve the problem by writing
// the contents of the output buffer to 'os' within the loop.  The most likely
// case, however, is that 'endConvert' will return 0, in which case we exit the
// loop and write any data remaining in 'outputBuffer' to 'os'.  As above, if
// 'endConvert' fails, we exit the function with a negative return status.
//..
//     while (1) {
//
//         int numOut;
//
//         int more = converter.endConvert(output, &numOut, outputEnd-output);
//         if (more < 0) {
//             return ENCODE_ERROR;                                   // RETURN
//         }
//
//         output += numOut;
//
//         if (!more) { // no more output
//             break;
//         }
//
//         assert (output == outputEnd);  // output buffer is full
//
//         os.write (outputBuffer, sizeof outputBuffer);  // write buffer
//         if (os.fail()) {
//             return IO_ERROR;                                       // RETURN
//         }
//         output = outputBuffer;
//     }
//
//     if (output > outputBuffer) { // still data in output buffer; write it
//                                  // all
//         os.write(outputBuffer, output - outputBuffer);
//     }
//
//     return (is.eof() && os.good()) ? SUCCESS : IO_ERROR;
// }
//
// } // Close namespace BloombergLP
//..
// For ease of reading, we repeat the full content of the 'streamencoder.cpp'
// file without interruption.
//..
// streamencoder.cpp                  -*-C++-*-
//
// #include <streamencoder.h>
//
// #include <bdlde_base64encoder.h>
//
// namespace BloombergLP {
//
// int streamEncoder(bsl::ostream& os, bsl::istream& is)
// {
//     enum {
//         SUCCESS      =  0,
//         ENCODE_ERROR = -1,
//         IO_ERROR     = -2
//     };
//
//     bdlde::Base64Encoder converter;
//
//     const int INBUFFER_SIZE  = 1 << 10;
//     const int OUTBUFFER_SIZE = 1 << 10;
//
//     char inputBuffer[INBUFFER_SIZE];
//     char outputBuffer[OUTBUFFER_SIZE];
//
//     char *output    = outputBuffer;
//     char *outputEnd = outputBuffer + sizeof outputBuffer;
//
//     while (is.good()) {  // input stream not exhausted
//
//         is.read(inputBuffer, sizeof inputBuffer);
//
//         const char *input    = inputBuffer;
//         const char *inputEnd = input + is.gcount();
//
//         while (input < inputEnd) { // input encoding not complete
//
//             int numOut;
//             int numIn;
//
//             int status = converter.convert(output, &numOut, &numIn,
//                                            input,   inputEnd,
//                                            outputEnd - output);
//             if (status < 0) {
//                 return ENCODE_ERROR;                               // RETURN
//             }
//
//             output += numOut;
//             input  += numIn;
//
//             if (output == outputEnd) {  // output buffer full; write data
//                 os.write(outputBuffer, sizeof outputBuffer);
//                 if (os.fail()) {
//                     return IO_ERROR;                               // RETURN
//                 }
//                 output = outputBuffer;
//             }
//         }
//     }
//
//     while (1) {
//
//         int numOut;
//
//         int more = converter.endConvert(output, &numOut, outputEnd-output);
//         if (more < 0) {
//             return ENCODE_ERROR;                                   // RETURN
//         }
//
//         output += numOut;
//
//         if (!more) { // no more output
//             break;
//         }
//
//         assert (output == outputEnd);  // output buffer is full
//
//         os.write (outputBuffer, sizeof outputBuffer);  // write buffer
//         if (os.fail()) {
//             return IO_ERROR;                                       // RETURN
//         }
//         output = outputBuffer;
//     }
//
//     if (output > outputBuffer) {
//         os.write (outputBuffer, output - outputBuffer);
//     }
//
//     return (is.eof() && os.good()) ? SUCCESS : IO_ERROR;
// }
//
// }  // close namespace BloombergLP
//..

#include <bdlscm_version.h>

#include <bdlde_base64alphabet.h>
#include <bdlde_base64encoderoptions.h>

#include <bsls_assert.h>
#include <bsls_deprecatefeature.h>
#include <bsls_review.h>

#include <bsl_cstddef.h>
#include <bsl_limits.h>

namespace BloombergLP {
namespace bdlde {

                            // ===================
                            // class Base64Encoder
                            // ===================

class Base64Encoder {
    // This class implements a mechanism capable of converting data of
    // arbitrary length to its corresponding Base64 representation.

    // TYPES
    typedef Base64EncoderOptions EncoderOptions;

  public:
    // PUBLIC TYPES
    typedef Base64Alphabet::Enum Alphabet;

    // PUBLIC CLASS DATA
    static const Alphabet    e_BASIC = Base64Alphabet::e_BASIC;
    static const Alphabet    e_URL   = Base64Alphabet::e_URL;

  private:
    // PRIVATE TYPES
    enum State {
        // Symbolic state values.

        e_ERROR_STATE     = -1, // Input is irreparably invalid.
        e_INITIAL_STATE   =  0, // Ready to accept input.
        e_DONE_STATE      =  1  // Any additional input is an error.
    };

    // INSTANCE DATA
    const int           d_maxLineLength;  // maximum length of output line
    int                 d_lineLength;     // current length of output line
    int                 d_outputLength;   // total number of output characters
    unsigned            d_stack;          // storage of non-emitted input
    int                 d_bitsInStack;    // number of bits in 'd_stack'
    const char * const  d_alphabet_p;     // alphabet
    State               d_state;          // state as per above enum 'State'
    const Alphabet      d_alphabet;       // alphabet
    const bool          d_isPadded;       // is output tail-padded with '='

  private:
    // NOT IMPLEMENTED
    Base64Encoder(const Base64Encoder&);
    Base64Encoder& operator=(const Base64Encoder&);

    // PRIVATE CLASS METHODS
    static
    bsl::size_t lengthWithoutCrlfs(const EncoderOptions& options,
                                   bsl::size_t           inputLength);
        // Return the expected length of output, not including CRLF's, given
        // the specified 'options' and 'inputLength'.  The behavior is
        // undefined if 'inputLength' is large enough to overflow the result.

    // PRIVATE MANIPULATORS
    template <class OUTPUT_ITERATOR>
    void append(OUTPUT_ITERATOR *out, char character, int maxLength);
        // Append a soft new line to the specified 'out' if necessary and then
        // append the specified 'character' without the total number of emitted
        // characters equaling the specified 'maxLength'.  The behavior is
        // undefined unless the total number of emitted characters does not
        // equal 'maxLength' at entry to this method.

    template <class OUTPUT_ITERATOR>
    void encode(OUTPUT_ITERATOR *out, int maxLength);
        // Append a soft new line to the specified 'out' if necessary and then
        // emit an internally buffered character without the total number of
        // emitted characters equaling the specified 'maxLength'.  The
        // behavior is undefined unless the total number of emitted characters
        // does not equal 'maxLength' at entry to this method and the internal
        // buffer contains at least one character of output.

    void setState(State newState);
        // Set the state to the specified 'newState'.

    // PRIVATE ACCESSORS
    bool isResidualOutput(int numBytes) const;
        // Return 'true' if an output sequence of the specified 'numBytes' from
        // this encoder would be an acceptable input to a 'Base64Decoder'
        // expecting padded input, and 'false' otherwise.  The behavior is
        // undefined unless padding is enabled.

    State state() const;
        // Return the state of this encoder.

  public:
    // CLASS METHODS
    static bsl::size_t encodedLength(const EncoderOptions& options,
                                     bsl::size_t           inputLength);
        // Return the exact number of encoded bytes that would result from an
        // input byte sequence of the specified 'inputLength' provided to the
        // 'convert' method of an encoder configured with the specified
        // 'options'.  The behavior is undefined if 'inputLength' is large
        // enough for the result to overflow a 'size_t'.

    BSLS_DEPRECATE_FEATURE("bdl",
                           "encodedLength",
                           "use overload with 'options'")
    static
    int encodedLength(int inputLength);
        // Return the exact number of encoded bytes that would result from an
        // input byte sequence of the specified 'inputLength' provided to the
        // 'convert' method of an encoder with the maximum allowable
        // line-length of the output being 76 characters (as recommended by the
        // MIME standard).  The behavior is undefined unless
        // '0 <= inputLength'.
        //
        // DEPRECATED: use the overload with 'options' instead.

    BSLS_DEPRECATE_FEATURE("bdl",
                           "encodedLength",
                           "use overload with 'options'")
    static
    int encodedLength(int inputLength, int maxLineLength);
        // Return the exact number of encoded bytes that would result from an
        // input byte sequence of the specified 'inputLength' provided to the
        // 'convert' method of an encoder configured with the specified
        // 'maxLineLength'.  The behavior is undefined unless
        // '0 <= inputLength' and '0 <= maxLineLength'.  Note that if
        // 'maxLineLength' is 0, no CRLF characters will appear in the output.
        // Note also that the number of encoded bytes need not be the number of
        // *output* bytes.
        //
        // DEPRECATED: use the overload with 'options' instead.

    static bsl::size_t encodedLines(const EncoderOptions& options,
                                    bsl::size_t           inputLength);
        // Return the exact number of encoded lines that would result from an
        // input byte sequence of the specified 'inputLength' provided to the
        // 'convert' method of an encoder configured with the specified
        // 'options'.  The behavior is undefined if 'inputLength' is large
        // enough to overflow the result.

    BSLS_DEPRECATE_FEATURE("bdl",
                           "encodedLines",
                           "use overload with 'options'")
    static
    int encodedLines(int inputLength);
        // Return the exact number of encoded lines that would result from an
        // input byte sequence of the specified 'inputLength' provided to the
        // 'convert' method of an encoder with the maximum allowable
        // line-length of the output being 76 characters (as recommended by the
        // MIME standard).  The behavior is undefined unless
        // '0 <= inputLength'.  Note also that the number of encoded bytes need
        // not be the number of *output* bytes.
        //
        // DEPRECATED: use the overload with 'options' instead.

    BSLS_DEPRECATE_FEATURE("bdl",
                           "encodedLines",
                           "use overload with 'options'")
    static
    int encodedLines(int inputLength, int maxLineLength);
        // Return the exact number of encoded lines that would result from an
        // input byte sequence of the specified 'inputLength' provided to the
        // 'convert' method of an encoder configured with the specified
        // 'maxLineLength'.  The behavior is undefined unless
        // '0 <= inputLength' and '0 <= maxLineLength'.  Note that if
        // 'maxLineLength' is 0, no CRLF characters will appear in the output.
        // Note also that the number of encoded bytes need not be the number of
        // *output* bytes.
        //
        // DEPRECATED: use the overload with 'options' instead.

    // CREATORS
    explicit
    Base64Encoder(const EncoderOptions& options = EncoderOptions::mime());
        // Create a Base64 encoder in the initial state, defaulting the state
        // of the maximum allowable line-length, the padding, and the alphabet
        // according to the values of the specified 'options'.

    BSLS_DEPRECATE_FEATURE("bdl",
                           "Base64Encoder",
                           "use overload with 'options'")
    explicit
    Base64Encoder(Alphabet alphabet);
        // Create a Base64 encoder in the initial state, defaulting the maximum
        // allowable line-length of the output to 76 (as recommended by the
        // MIME standard).  Optionally specify an alphabet used to encode
        // characters.  If 'alphabet' is not specified, then the basic
        // alphabet, "base64", is used.  Note that the 'convert' and
        // 'endConvert' methods of this encoder will insert a CRLF to prevent
        // each line of the output from exceeding 76 characters.
        //
        // DEPRECATED: Create and pass an 'options' object instead.

    BSLS_DEPRECATE_FEATURE("bdl",
                           "Base64Encoder",
                           "use overload with 'options'")
    explicit
    Base64Encoder(int maxLineLength, Alphabet alphabet = e_BASIC);
        // Create a Base64 encoder in the initial state, setting the maximum
        // allowable line-length of the output to the specified
        // 'maxLineLength'.  Specifying 0 for 'maxLineLength' will result in a
        // single output line (i.e., one with no CRLF in it).  Optionally
        // specify an alphabet used to encode characters.  If 'alphabet' is not
        // specified, then the basic alphabet, "base64", is used.The behavior
        // is undefined unless '0 <= maxLineLength'.  Note that when
        // 'maxLineLength' is positive, the 'convert' and 'endConvert' methods
        // of this encoder will insert a CRLF to prevent each line of the
        // output from exceeding 'maxLineLength'.
        //
        // DEPRECATED: Create and pass an 'options' object instead.

    ~Base64Encoder();
        // Destroy this object.

    // MANIPULATORS
    template <class OUTPUT_ITERATOR, class INPUT_ITERATOR>
    int convert(OUTPUT_ITERATOR out,
                INPUT_ITERATOR  begin,
                INPUT_ITERATOR  end);
    template <class OUTPUT_ITERATOR, class INPUT_ITERATOR>
    int convert(OUTPUT_ITERATOR  out,
                int             *numOut,
                int             *numIn,
                INPUT_ITERATOR   begin,
                INPUT_ITERATOR   end,
                int              maxNumOut = -1);
        // Encode the sequence of input characters starting at the specified
        // 'begin' position up to, but not including, the specified 'end'
        // position, writing any resulting output characters to the specified
        // 'out' buffer.  Optionally specify the 'maxNumOut' limit on the
        // number of bytes to output; if 'maxNumOut' is negative, no limit is
        // imposed.  If the 'maxNumOut' limit is reached, no further input will
        // be consumed.  Load into the (optionally) specified 'numOut' and
        // 'numIn' the number of output bytes produced and input bytes
        // consumed, respectively.  Return a non-negative value on success and
        // a negative value otherwise.  A positive return status indicates the
        // number of valid processed output bytes retained by this encoder and
        // not written to 'out' because 'maxNumOut' has been reached; these
        // bytes are available for output if this method is called with
        // appropriate input.  Note that calling this method after 'endConvert'
        // has been invoked without an intervening 'resetState' call will place
        // this instance in an error state, and return an error status.  Note
        // also that it is recommended that after all calls to 'convert' are
        // finished, the 'endConvert' method be called to complete the encoding
        // of any unprocessed input characters that do not complete a 3-byte
        // sequence.

    template <class OUTPUT_ITERATOR>
    int endConvert(OUTPUT_ITERATOR out);
    template <class OUTPUT_ITERATOR>
    int endConvert(OUTPUT_ITERATOR out, int *numOut, int maxNumOut = -1);
        // Terminate encoding for this encoder; write any retained output
        // (e.g., from a previous call to 'convert') to the specified 'out'
        // buffer.  Optionally specify the 'maxNumOut' limit on the number of
        // bytes to output; if 'maxNumOut' is negative, no limit is imposed.
        // Load into the (optionally) specified 'numOut' the number of output
        // bytes produced.  Return 0 if output was successfully completed and a
        // non-zero value otherwise.  Any retained bytes are available on a
        // subsequent call to 'endConvert'.  Once this method is called, no
        // additional input may be supplied without an intervening call to
        // 'resetState'; once this method returns a zero status, a subsequent
        // call will place this encoder in the error state, and return an error
        // status.

    void resetState();
        // Reset this instance to its initial state (i.e., as if no input had
        // been consumed).

    // ACCESSORS
    Alphabet alphabet() const;
        // Return the alphabet supplied at construction of this object.

    bool isAcceptable() const;
        // Return 'true' if the input read so far is considered syntactically
        // complete and all resulting output has been emitted to 'out', and
        // 'false' otherwise.  Note that 'endConvert' must be called if the
        // total length of all data processed is not divisible by 3.

    bool isDone() const;
        // Return 'true' if the current input is acceptable and any additional
        // input (including 'endConvert') would be an error, and 'false'
        // otherwise.  Note that if this decoder 'isDone' then all resulting
        // output has been emitted to 'out'.

    bool isError() const;
        // Return 'true' if there is no possibility of achieving an
        // "acceptable" result, and 'false' otherwise.

    bool isInitialState() const;
        // Return 'true' if this instance is in the initial state (i.e., as if
        // no input had been consumed), and 'false' otherwise.

    bool isPadded() const;
        // Return true if padding by '=' characters was specified at
        // construction of this object.

    int maxLineLength() const;
        // Return the currently installed value for the maximum line length.

    EncoderOptions options() const;
        // Return an 'options' object reflecting the options this object was
        // configured with.

    int outputLength() const;
        // Return the total length of the output emitted thus far (including
        // soft line breaks where appropriate).
};

// ============================================================================
//                            INLINE DEFINITIONS
// ============================================================================

                            // -------------------
                            // class Base64Encoder
                            // -------------------

// PRIVATE CLASS METHODS
inline
bsl::size_t Base64Encoder::lengthWithoutCrlfs(
                                             const EncoderOptions& options,
                                             bsl::size_t           inputLength)
{
    static const bsl::size_t maxSize_t = bsl::numeric_limits<
                                                           bsl::size_t>::max();
    (void) maxSize_t;

    if (0 == inputLength) {
        return 0;                                                     // RETURN
    }

    const bsl::size_t numTripletsRoundedDown = (inputLength + 2) / 3 - 1;
    const bsl::size_t numResidual = inputLength - numTripletsRoundedDown * 3;

    // 'numResidual' is in the range '[ 1 .. 3 ]'.  If 'numResidual' is '1'
    // byte, that takes 2 bytes to encode, 2 bytes takes 3 bytes to encode, 3
    // bytes takes 4 bytes to encode.

    const bsl::size_t pad = options.isPadded() ? 4 : numResidual + 1;

    BSLS_ASSERT(numTripletsRoundedDown <= (maxSize_t - pad) / 4);

    return numTripletsRoundedDown * 4 + pad;
}

// PRIVATE MANIPULATORS
template <class OUTPUT_ITERATOR>
void Base64Encoder::append(OUTPUT_ITERATOR *out,
                           char             value,
                           int              maxLength)
{
    BSLS_ASSERT(out);

    if (d_maxLineLength && d_lineLength >= d_maxLineLength) {
        if (d_lineLength == d_maxLineLength) {
            **out = '\r';
            ++*out;
            ++d_outputLength;
            ++d_lineLength;
            if (d_outputLength == maxLength) {
                return;                                               // RETURN
            }
        }
        **out = '\n';
        ++*out;
        ++d_outputLength;
        d_lineLength = 0;
        if (d_outputLength == maxLength) {
            return;                                                   // RETURN
        }
    }
    **out = value;
    ++*out;
    ++d_outputLength;
    ++d_lineLength;
}

template <class OUTPUT_ITERATOR>
void Base64Encoder::encode(OUTPUT_ITERATOR *out, int maxLength)
{
    BSLS_ASSERT(out);

    if (d_maxLineLength && d_lineLength >= d_maxLineLength) {
        if (d_lineLength == d_maxLineLength) {
            **out = '\r';
            ++*out;
            ++d_outputLength;
            ++d_lineLength;
            if (d_outputLength == maxLength) {
                return;                                               // RETURN
            }
        }
        **out = '\n';
        ++*out;
        ++d_outputLength;
        d_lineLength = 0;
        if (d_outputLength == maxLength) {
            return;                                                   // RETURN
        }
    }
    d_bitsInStack -= 6;
    **out = d_alphabet_p[(d_stack >> d_bitsInStack) & 0x3f];
    ++*out;
    ++d_outputLength;
    ++d_lineLength;
}

inline
void Base64Encoder::setState(State newState)
{
    d_state = newState;
}

// PRIVATE ACCESSORS
inline
bool Base64Encoder::isResidualOutput(int numBytes) const
{
    BSLS_ASSERT(0 <= numBytes);
    BSLS_ASSERT(d_isPadded);

    if (d_maxLineLength) {
        const int lineSize           = d_maxLineLength + 2;
        const int linesSoFar         = numBytes / lineSize;
        const int bytesSinceLastCrlf = numBytes - linesSoFar * lineSize;
        const int partialCrlf        = d_maxLineLength < bytesSinceLastCrlf;
        const int nonCrlfBytes       = linesSoFar * d_maxLineLength +
                                              bytesSinceLastCrlf - partialCrlf;

        return 0 != nonCrlfBytes % 4;                                 // RETURN
    }
    else {
        return 0 != numBytes % 4;                                     // RETURN
    }
}

inline
Base64Encoder::State Base64Encoder::state() const
{
    return d_state;
}

// CLASS METHODS
inline
bsl::size_t Base64Encoder::encodedLength(const EncoderOptions& options,
                                         bsl::size_t           inputLength)
{
    static const bsl::size_t maxSize_t = bsl::numeric_limits<
                                                           bsl::size_t>::max();
    (void) maxSize_t;

    if (0 == inputLength) {
        return 0;                                                     // RETURN
    }

    const bsl::size_t length   = lengthWithoutCrlfs(options, inputLength);
    const bsl::size_t numCrlfs = 0 == options.maxLineLength()
                               ? 0
                               : (length - 1) / options.maxLineLength();

    BSLS_ASSERT(numCrlfs <= maxSize_t / 2);
    BSLS_ASSERT(length <= maxSize_t - numCrlfs * 2);

    return length + 2 * numCrlfs;
}

inline
int Base64Encoder::encodedLength(int inputLength, int maxLineLength)
{
    BSLS_ASSERT(0 <= inputLength);
    BSLS_ASSERT(0 <= maxLineLength);

    return static_cast<int>(encodedLength(EncoderOptions::custom(maxLineLength,
                                                                 e_BASIC,
                                                                 true),
                                          inputLength));
}

inline
int Base64Encoder::encodedLength(int inputLength)
{
    BSLS_ASSERT(0 <= inputLength);

    return static_cast<int>(encodedLength(EncoderOptions::mime(),
                                          inputLength));
}

inline
bsl::size_t Base64Encoder::encodedLines(const EncoderOptions& options,
                                        bsl::size_t           inputLength)
{
    return 1 +
        (0 == options.maxLineLength()
         ? 0
         : lengthWithoutCrlfs(options, inputLength) / options.maxLineLength());
}

inline
int Base64Encoder::encodedLines(int inputLength, int maxLineLength)
{
    BSLS_ASSERT(0 <= inputLength);
    BSLS_ASSERT(0 <= maxLineLength);

    return static_cast<int>(encodedLines(EncoderOptions::custom(maxLineLength,
                                                                e_BASIC,
                                                                true),
                                         inputLength));
}

inline
int Base64Encoder::encodedLines(int inputLength)
{
    BSLS_ASSERT(0 <= inputLength);

    return static_cast<int>(encodedLines(EncoderOptions::mime(), inputLength));
}

// MANIPULATORS
template <class OUTPUT_ITERATOR, class INPUT_ITERATOR>
int Base64Encoder::convert(OUTPUT_ITERATOR out,
                           INPUT_ITERATOR  begin,
                           INPUT_ITERATOR  end)
{
    int dummyNumOut;
    int dummyNumIn;

    return convert(out, &dummyNumOut, &dummyNumIn, begin, end, -1);
}

template <class OUTPUT_ITERATOR, class INPUT_ITERATOR>
int Base64Encoder::convert(OUTPUT_ITERATOR  out,
                           int             *numOut,
                           int             *numIn,
                           INPUT_ITERATOR   begin,
                           INPUT_ITERATOR   end,
                           int              maxNumOut)
{
    int dummyNumOut;
    if (!numOut) {
        numOut = &dummyNumOut;
    }
    int dummyNumIn;
    if (!numIn) {
        numIn  = &dummyNumIn;
    }

    if (e_ERROR_STATE == state() || e_DONE_STATE == state()) {
        setState(e_ERROR_STATE);
        *numOut = 0;
        *numIn  = 0;
        return -1;                                                    // RETURN
    }

    const int initialLength = d_outputLength;
    const int maxLength     = d_outputLength + maxNumOut;

    // Emit as many output bytes as possible.

    while (6 <= d_bitsInStack && d_outputLength != maxLength) {
        encode(&out, maxLength);
    }

    // Consume as many input bytes as possible.

    int tmpNumIn = 0;

    while (4 >= d_bitsInStack && begin != end) {
        const unsigned char byte = static_cast<unsigned char>(*begin);

        ++begin;
        ++tmpNumIn;

        d_stack        = (d_stack << 8) | byte;
        d_bitsInStack += 8;

        if (d_outputLength != maxLength) {
            encode(&out, maxLength);
            if (6 <= d_bitsInStack && d_outputLength != maxLength) {
                encode(&out, maxLength);
            }
        }
    }

    *numIn  = tmpNumIn;
    *numOut = d_outputLength - initialLength;

    return 0;
}

template <class OUTPUT_ITERATOR>
int Base64Encoder::endConvert(OUTPUT_ITERATOR out)
{
    int dummyNumOut;

    return endConvert(out, &dummyNumOut, -1);
}

template <class OUTPUT_ITERATOR>
int Base64Encoder::endConvert(OUTPUT_ITERATOR  out,
                              int             *numOut,
                              int              maxNumOut)
{
    BSLS_ASSERT(numOut);

    if (e_ERROR_STATE == state() || isDone()) {
        setState(e_ERROR_STATE);
        *numOut = 0;
        return -1;                                                    // RETURN
    }

    const int initialLength = d_outputLength;
    const int maxLength = d_outputLength + maxNumOut;

    // Handle trailing bits.

    const int residualBits = d_bitsInStack % 6;
    if (residualBits) {
        const int shift = 6 - residualBits;
        d_stack = d_stack << shift;
        d_bitsInStack += shift;
    }

    BSLS_ASSERT(0 == d_bitsInStack % 6);

    // Emit as many output bytes as possible.

    while (6 <= d_bitsInStack && d_outputLength != maxLength) {
        encode(&out, maxLength);
    }

    // Append trailing '=' as necessary.

    if (0 == d_bitsInStack) {
        while (true) {
            if (!d_isPadded || !isResidualOutput(d_outputLength)) {
                setState(e_DONE_STATE);

                break;
            }

            if (d_outputLength == maxLength) {
                break;
            }

            append(&out, '=', maxLength);
        }
    }

    *numOut = d_outputLength - initialLength;

    return !isDone();
}

inline
void Base64Encoder::resetState()
{
    setState(e_INITIAL_STATE);
    d_outputLength = 0;
    d_lineLength   = 0;
    d_stack        = 0;
    d_bitsInStack  = 0;
}

// ACCESSORS
inline
Base64Alphabet::Enum Base64Encoder::alphabet() const
{
    return d_alphabet;
}

inline
bool Base64Encoder::isAcceptable() const
{
    return e_ERROR_STATE != state();
}

inline
bool Base64Encoder::isDone() const
{
    return e_DONE_STATE == state()
        && !d_bitsInStack
        && (!d_isPadded || !isResidualOutput(d_outputLength));
}

inline
bool Base64Encoder::isError() const
{
    return e_ERROR_STATE == state();
}

inline
bool Base64Encoder::isInitialState() const
{
    return 0 == d_outputLength && e_INITIAL_STATE == state();
}

inline
bool Base64Encoder::isPadded() const
{
    return d_isPadded;
}

inline
int Base64Encoder::maxLineLength() const
{
    return d_maxLineLength;
}

inline
Base64EncoderOptions Base64Encoder::options() const
{
    return EncoderOptions::custom(
                          d_maxLineLength,
                          alphabet(),
                          d_isPadded);
}

inline
int Base64Encoder::outputLength() const
{
    return d_outputLength;
}
}  // close package namespace

}  // close enterprise namespace

#endif

// ----------------------------------------------------------------------------
// Copyright 2015 Bloomberg Finance L.P.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ----------------------------- END-OF-FILE ----------------------------------

redpajama_set_name: RedPajamaGithub


text:
As managing director in the global legal technology solutions practice and information security segment lead at Navigant, Bob Anderson collaborates with clients to tackle their most critical security issues to safeguard against adversity and ensure that risks are managed rigorously. As a former national security executive with the FBI, his unique expertise in industry-leading cybersecurity threats and incident response strategies are instrumental in helping clients manage and protect their businesses. Having been directly involved in investigating and prosecuting some of the most famous spies in U.S. history, Anderson is an expert in theft of proprietary/trade secrets investigations. He has been retained as an expert witness in several ongoing litigations. Anderson and his team perform criminal and cyber investigations worldwide, conducting forensic analyses to determine how an incident occurred, assess whether there is evidence of information compromise, and identify affected individuals through data mining. By combining computer forensic expertise with investigative, modern technical data mining; endpoint monitoring; and industry knowledge; the team provides expert information security solutions to companies, law firms, cyber insurers, and healthcare brokers, assisting with regulatory responses when necessary. After serving with the FBI for over 20 years, Anderson is a recognized expert in cybersecurity, incidence response, cyber hacking, counterintelligence, and economic espionage. He has directed strategic initiatives and operations for high-profile international investigations in partnership with several Fortune 50 companies, the U.S. Departments of Defense, Justice, Energy, and Treasury, the U.S. Intelligence Community, and other federal agencies.
@Navigant
FISA and the Nunes Memo
Bob Anderson and John Malcolm discuss the release of the Nunes memo, impact, the Democrat's response to the memo, FISA, and the legalities surrounding this release.


BABEL is a play without words. Bodies as building blocks, creating towers and structures: climbing, yielding, flying, falling. BABEL tells the story of a tower, built so high it offends god. God divides the people who build it and gives them separate languages so that they cannot build again. The piece explores the human desire to create, the necessity of communication, and how human ambition can overcome adversity. Babel is co-created by WT McRae and Jeremy Williams in collaboration with the company.


A charity chairman wants to clear up confusion and rumours surrounding the future of Age UK Barrow and District.
Stephen Harris is responding to recent planning applications made by Age UK South Lakes and on claims there could be a merger.
He said they were fully aware of their planning application and their desire to to open two super stores in the area.
He explained how Age UK Barrow and District has been providing services in the district for a significant number of years and will continue to do so.
He said: "We, like Age UK South Lakes, are independent charities working under the umbrella Age UK organisation. We cover Barrow and Furness and Kendal-based Age UK covers south Lakeland.
"Up until the end of March Age UK South Lakes have been providing services under a contract which they won as the preferred bidder two years ago.
"That contact was not extended at the end of the two year period and they continue to want to deliver those services in the Barrow area.
"Given that we are independent organisations there is synergy in the services that we have continued to offer over the same two year period.
Steve added that they had some concerns that the plans being made by Age UK South Lakeland may be detrimental to the services currently delivered in Barrow and potentially may prevent Age UK Barrow from developing any further services that may meet the needs of our users within the Barrow and District area.
He added: "In addition we also have concerns that the provision of two additional large charity stores may adversely impact other local charities and their ability to obtain charitable donations and the relevant income streams to maintain the important local work they do.
"Over the last two years we have worked extremely hard to find ways to deliver the services the local population needs whilst finding ourselves severely challenged to find grants and funding to deliver those services and activities.
"To this end we have been moving from a grant funded delivery of services to asking for a small charge from our users, which they are happy to pay to support the activities they want us to provide.
"If we wish to continue to expand and deliver more to our local users then we need to have the opportunity to do that without seeing funding streams potentially reduced.
"In terms of the money we generate as your local Age UK we can be certain that that money will be spent on services that benefit our community.
"The primary aid of my charity is to service the needs of the population of the Barrow and District area and will continue to do everything we can to allow us to enable us to do that.
Barbecue safely this Bank Holiday weekend!


Bottle hunter: Collect 5 empty bottles.
Collector: Make the city cleaner. Pick up 4 packs of cigarettes.
Gourmet: Empty shelves at the grocery!
It happens..: Wash dog's dung off your shoes.
One-size-fits-all: Stock up on stationery.
Paramedic: Assemble a first aid kit.


text:
La Resolució 2346 del Consell de Seguretat de les Nacions Unides fou adoptada per unanimitat el 23 de març de 2017. El Consell va ampliar el mandat de la Missió d'Assistència de les Nacions Unides a Somàlia (UNSOM) per dos mesos i mig, fins al 16 de juny de 2017.

Observacions
El recentment elegit president somali Mohamed Abdullahi Mohamed va dir que les eleccions s'havien produït pacíficament i democràticament malgrat l'escepticisme. Per primera vegada a la història del seu país, un de cada tres diputats era una dona. També va dir que Al-Xabab era afeblit gràcies a l'exèrcit somali i a les tropes de l'AMISOM de la Unió Africana, però va afegir que només es podia assegurar Somàlia reconstruint completament l'exèrcit amb ajuda internacional.

El representant de la UA a Somàlia i al capdavant d'AMISOM, Francisco Caetano José Madeira, va afegir que el 80% del país havia estat recapturat a Al-Xabab i l'economia havia reviscolat. Els homes de l'exèrcit somali havien de ser degudament examinats, equipats, pagats i dirigits. El mandat AMISOM caducaria el 2018.

El ministre d'Afers Exteriors d'Etiòpia, Hirut Zemene, va dir que l'ONU i la comunitat internacional havien de proporcionar finançament estable a AMISOM perquè pogués "acabar el treball".

El representant suec va dir que havien de començar a preparar-se per a les pròximes eleccions l'any 2020 al més aviat possible. Les eleccions també havien de celebrar-se segons la planificació i segons el principi d'un vot per a una sola persona. També es va fer una referència a la imminent fam. L'ONU estava buscant 825 milions de dòlars per ajudar a 5.5 milions de persones. A més, Al-Xabab continuava representant una amenaça a la regió. El representant egipci va dir que es necessitaven més esforços regionals i internacionals per vèncer el grup terrorista.

Contingut
Atès que les eleccions a Somàlia, que normalment haurien d'haver tingut lloc a l'agost de 2016, es retardaren, s'havia posposat una avaluació de la presència de les Nacions Unides al país fins que finalitzessin les eleccions. Les eleccions es van celebrar al febrer de 2017 i es van esperar els resultats de l'avaluació. Atès que el mandat de la UNSOM finalitzava el 31 de març i volien tenir prou temps per estudiar els resultats de l'avaluació, el mandat de la missió es va ampliar per un curt període, fins al 16 de juny de 2017.

Referències

Vegeu també
 Llista de resolucions del Consell de Seguretat de les Nacions Unides 2301 a la 2400 (2016 - 2018)

Enllaços externs
  Text de la Resolució a UN.org

Resolucions del Consell de Seguretat de les Nacions Unides de 2017
Resolucions del Consell de Seguretat de les Nacions Unides sobre Somàlia

redpajama_set_name: RedPajamaWikipedia


Are you thinking of hiring a regular home cleaner in Tower Hamlets?
What was once seen as a luxury to many, home cleaners are now popular in houses across the country. Having a regular cleaner visit your home and take care of your chores has numerous benefits, something that could change the way in which you live your life.
At Cleaning Express, we offer reasonable rates and flexible hours to suit you and your commitments. All of our cleaners are fully vetted and qualified, and will never leave a cleaning job until you are 100% happy with the results.
Take a look at our website today to view our competitive rates. If you'd like to get in touch, give us a call today on 020 3633 0390.


text:
Micheline Calmy-Rey
Micheline Anne-Marie Calmy-Rey (born 8 July 1945) is a Swiss politician. [1]
40 relations: Alain Berset, BBC, Canton of Geneva, Canton of Valais, Conseil d'État (Switzerland), Council of Women World Leaders, Didier Burkhalter, Doris Leuthard, European Union, Eveline Widmer-Schlumpf, F. W. de Klerk, Federal Council (Switzerland), Federal Department of Foreign Affairs, Foreign minister, Global Leadership Foundation, Graduate Institute of International and Development Studies, Head of state, Israel, Joseph Deiss, License, Mahmoud Ahmadinejad, Maria Roth-Bernasconi, Moritz Leuenberger, Natural gas, Pascal Couchepin, President of the Swiss Confederation, President of the United Nations General Assembly, Primus inter pares, Ruth Dreifuss, Saint-Maurice, Switzerland, Sérgio Vieira de Mello, Serbia, Simonetta Sommaruga, Sion, Switzerland, Sixty-seventh session of the United Nations General Assembly, Social Democratic Party of Switzerland, Swiss order of precedence, Switzerland, Vuk Jeremić, World Jewish Congress.
Alain Berset
Alain Berset (born 9 April 1972) is a Swiss politician of the Social Democratic Party.
New!!: Micheline Calmy-Rey and Alain Berset · See more »
The British Broadcasting Corporation (BBC) is a British public service broadcaster.
New!!: Micheline Calmy-Rey and BBC · See more »
Canton of Geneva
The Republic and Canton of Geneva (République et canton de Genève; Rèpublica et canton de Geneva; Republik und Kanton Genf; Repubblica e Canton di Ginevra; Republica e chantun Genevra) is the French-speaking westernmost canton or state of Switzerland, surrounded on almost all sides by France.
New!!: Micheline Calmy-Rey and Canton of Geneva · See more »
Canton of Valais
The canton of Valais (Kanton Wallis) is one of the 26 cantons of Switzerland, situated in the southwestern part of the country, around the valley of the Rhône from its headwaters to Lake Geneva, separating the Pennine Alps from the Bernese Alps.
New!!: Micheline Calmy-Rey and Canton of Valais · See more »
Conseil d'État (Switzerland)
In Switzerland, Conseil d'État is the name of the council constituting the cantonal government of French-speaking cantons.
New!!: Micheline Calmy-Rey and Conseil d'État (Switzerland) · See more »
Council of Women World Leaders
The Council of Women World Leaders, created in 1996, is a network of 70 current and former Presidents and Prime Ministers.
New!!: Micheline Calmy-Rey and Council of Women World Leaders · See more »
Didier Burkhalter
Didier Burkhalter (born 17 April 1960 in Neuchâtel) is a former Swiss politician.
New!!: Micheline Calmy-Rey and Didier Burkhalter · See more »
Doris Leuthard
Doris Leuthard (born 10 April 1963) is a Swiss politician and lawyer.
New!!: Micheline Calmy-Rey and Doris Leuthard · See more »
The European Union (EU) is a political and economic union of EUnum member states that are located primarily in Europe.
New!!: Micheline Calmy-Rey and European Union · See more »
Eveline Widmer-Schlumpf
Eveline Widmer-Schlumpf (born 16 March 1956) is a Swiss lawyer, politician, and former member of the Swiss Federal Council from 2008 to 2015.
New!!: Micheline Calmy-Rey and Eveline Widmer-Schlumpf · See more »
F. W. de Klerk
Frederik Willem de Klerk (born 18 March 1936) is a South African politician who served as State President of South Africa from 1989 to 1994 and as Deputy President from 1994 to 1996.
New!!: Micheline Calmy-Rey and F. W. de Klerk · See more »
Federal Council (Switzerland)
The Federal Council is the seven-member executive council which constitutes the federal government of the Swiss Confederation and serves as the collective executive head of government and state of Switzerland.
New!!: Micheline Calmy-Rey and Federal Council (Switzerland) · See more »
Federal Department of Foreign Affairs
The Federal Department of Foreign Affairs (FDFA, Eidgenössisches Departement für auswärtige Angelegenheiten, Département fédéral des affaires étrangères, Dipartimento federale degli affari esteri, Departament federal d'affars exteriurs), so named since 1979, is one of the seven Departments of the Swiss government federal administration of Switzerland, and corresponds in its range of tasks to the ministry of foreign affairs in other countries.
New!!: Micheline Calmy-Rey and Federal Department of Foreign Affairs · See more »
A foreign minister or minister of foreign affairs (less commonly for foreign affairs) is generally a cabinet minister in charge of a state's foreign policy and relations.
New!!: Micheline Calmy-Rey and Foreign minister · See more »
Global Leadership Foundation
The Global Leadership Foundation (GLF) is a not-for-profit, non-governmental organisation that arranges the use of a network of former Heads of State or Government and other distinguished leaders who make their personal experience and advice discreetly available to those in power today.
New!!: Micheline Calmy-Rey and Global Leadership Foundation · See more »
Graduate Institute of International and Development Studies
The Graduate Institute of International and Development Studies, or the Graduate Institute (in French: Institut de hautes études internationales et du développement (previously known as Institut (universitaire) de hautes études internationales), abbreviated IHEID (previously HEI, IHEI, or IUHEI) is a post-graduate university located in Geneva, Switzerland. The institution counts one UN secretary-general (Kofi Annan), seven Nobel Prize recipients, one Pulitzer Prize winner, and numerous ambassadors, foreign ministers, and heads of state among its alumni and faculty. Founded by two senior League of Nations officials, the Graduate Institute maintains strong links with that international organisation's successor, the United Nations, and many alumni have gone on to work at UN agencies. The school is a full member of the APSIA. Founded in 1927, the Graduate Institute of International Studies (IHEI or HEI) is continental Europe's oldest school of international relations and was the world's first university dedicated solely to the study of international affairs. It offered one of the first doctoral programmes in international relations in the world. In 2008, the Graduate Institute absorbed the Graduate Institute of Development Studies, a smaller post-graduate institution also based in Geneva founded in 1961. The merger resulted in the current Graduate Institute of International and Development Studies. Today the school enrolls about 800 graduate students from over 100 countries. Foreign students make up nearly 80% of the student body and the school is officially a bilingual English-French institution, although the majority of classes are in English.. With Maison de la Paix acting as its primary seat of learning, the Institute's campuses are located blocks from the United Nations Office at Geneva, International Labour Organization, World Trade Organization, World Health Organization, International Committee of the Red Cross, World Intellectual Property Organization and many other international organizations. It runs joint degree programmes with universities such as Smith College and Yale University, and is Harvard Kennedy School's only partner university to co-deliver double degrees.
New!!: Micheline Calmy-Rey and Graduate Institute of International and Development Studies · See more »
Head of state
A head of state (or chief of state) is the public persona that officially represents the national unity and legitimacy of a sovereign state.
New!!: Micheline Calmy-Rey and Head of state · See more »
Israel, officially the State of Israel, is a country in the Middle East, on the southeastern shore of the Mediterranean Sea and the northern shore of the Red Sea.
New!!: Micheline Calmy-Rey and Israel · See more »
Joseph Deiss
Joseph Deiss (born 18 January 1946) is an economist, Swiss politician and a member of the Christian Democratic People's Party (CVP/PDC).
New!!: Micheline Calmy-Rey and Joseph Deiss · See more »
A license (American English) or licence (British English) is an official permission or permit to do, use, or own something (as well as the document of that permission or permit).
New!!: Micheline Calmy-Rey and License · See more »
Mahmoud Ahmadinejad (Mahmūd Ahmadinezhād, born Mahmoud Sabbaghian (Sabbāghyān) on 28 October 1956) is an Iranian politician who was the sixth President of Iran from 2005 to 2013.
New!!: Micheline Calmy-Rey and Mahmoud Ahmadinejad · See more »
Maria Roth-Bernasconi
Maria Roth-Bernasconi (born 14 September 1955) is a Swiss politician who had served in the legislature and been former co-president of the women's chapter of the Social Democratic Party of Switzerland.
New!!: Micheline Calmy-Rey and Maria Roth-Bernasconi · See more »
Moritz Leuenberger
Moritz Leuenberger (born 21 September 1946) is a Swiss politician, lawyer, was a member of the Swiss Federal Council from 1995 to 2010 and President of the Confederation in 2001 and in 2006.
New!!: Micheline Calmy-Rey and Moritz Leuenberger · See more »
Natural gas is a naturally occurring hydrocarbon gas mixture consisting primarily of methane, but commonly including varying amounts of other higher alkanes, and sometimes a small percentage of carbon dioxide, nitrogen, hydrogen sulfide, or helium.
New!!: Micheline Calmy-Rey and Natural gas · See more »
Pascal Couchepin (born 5 April 1942) is a Swiss politician, former member of the Swiss Federal Council (1998–2009) and President of the Confederation in 2003 and 2008.
New!!: Micheline Calmy-Rey and Pascal Couchepin · See more »
President of the Swiss Confederation
The President of the Confederation, colloquially known as the President of Switzerland or Federal President, is the head of Switzerland's seven-member Federal Council, the country's executive branch.
New!!: Micheline Calmy-Rey and President of the Swiss Confederation · See more »
President of the United Nations General Assembly
The President of the United Nations General Assembly is a position voted for by representatives in the United Nations General Assembly (UNGA) on a yearly basis.
New!!: Micheline Calmy-Rey and President of the United Nations General Assembly · See more »
Primus inter pares (Πρῶτος μεταξὺ ἴσων) is a Latin phrase meaning first among equals.
New!!: Micheline Calmy-Rey and Primus inter pares · See more »
Ruth Dreifuss
Ruth Dreifuss (born 9 January 1940 in St. Gallen) is a Swiss politician affiliated with the Social Democratic Party.
New!!: Micheline Calmy-Rey and Ruth Dreifuss · See more »
Saint-Maurice, Switzerland
Saint-Maurice, or Saint-Maurice d'Agaune, is a small city located in the canton of Valais in Switzerland.
New!!: Micheline Calmy-Rey and Saint-Maurice, Switzerland · See more »
Sérgio Vieira de Mello
Sérgio Vieira de Mello (15 March 1948 – 19 August 2003) was a Brazilian United Nations diplomat who worked for the UN for more than 34 years, earning respect and praise around the world for his efforts in the humanitarian and political programs of the UN.
New!!: Micheline Calmy-Rey and Sérgio Vieira de Mello · See more »
Serbia (Србија / Srbija),Pannonian Rusyn: Сербия; Szerbia; Albanian and Romanian: Serbia; Slovak and Czech: Srbsko,; Сърбия.
New!!: Micheline Calmy-Rey and Serbia · See more »
Simonetta Sommaruga
Simonetta Sommaruga (born 14 May 1960) is a Swiss politician of the Social Democratic Party of Switzerland who is a current member of the Swiss Federal Council, the federal government of Switzerland, and head of the Federal Department of Justice and Police (the Swiss justice minister).
New!!: Micheline Calmy-Rey and Simonetta Sommaruga · See more »
Sion, Switzerland
Sion (Sitten; Seduno; Sedunum) is a Swiss town, a municipality, and the capital of the canton of Valais and of the district of Sion.
New!!: Micheline Calmy-Rey and Sion, Switzerland · See more »
Sixty-seventh session of the United Nations General Assembly
The sixty-seventh session of the United Nations General Assembly opened on 18 September 2012 and having its last scheduled meeting on 11 September 2013.
New!!: Micheline Calmy-Rey and Sixty-seventh session of the United Nations General Assembly · See more »
Social Democratic Party of Switzerland
The Social Democratic Party of Switzerland (also rendered as Swiss Socialist Party; Sozialdemokratische Partei der Schweiz, SP; Parti socialiste suisse, PS; Partito Socialista Svizzero; Partida Socialdemocrata de la Svizra) is a political party in Switzerland.
New!!: Micheline Calmy-Rey and Social Democratic Party of Switzerland · See more »
Swiss order of precedence
The Swiss order of precedence is a hierarchy of important positions within the government of Switzerland.
New!!: Micheline Calmy-Rey and Swiss order of precedence · See more »
Switzerland, officially the Swiss Confederation, is a sovereign state in Europe.
New!!: Micheline Calmy-Rey and Switzerland · See more »
Vuk Jeremić
Vuk Jeremić (Вук Јеремић,; born 3 July 1975) is a Serbian diplomat who served as Serbia's Minister of Foreign Affairs between 2007 and 2012 and President of the 67th session of the United Nations General Assembly between September 2012 and September 2013.
New!!: Micheline Calmy-Rey and Vuk Jeremić · See more »
The World Jewish Congress (WJC) was founded in Geneva, Switzerland, in August 1936 as an international federation of Jewish communities and organizations.
New!!: Micheline Calmy-Rey and World Jewish Congress · See more »
Calmy-Rey, Micheline Anne-Marie Calmy-Rey.
[1] https://en.wikipedia.org/wiki/Micheline_Calmy-Rey


We offer these calling features to help our customers make better use of their telephone. Call Features can be purchased individually or as part of Simple Solution Bundle.
*90 Call Forward - Busy When your line is busy, forward the calls to another number.
*92 Call Forward - No Answer Whenever you are unable to answer the phone, forward your calls to another number.
*63 Call Forward - Selective Allows you to program your phone to forward only those calls from a special list of people to another number.
*69 Automatic Recall Allows you to dial the number that called you last.
*72 Call Forwarding Allows you to forward your calls to another number.
*77 Call Rejection - Anonymous Allows you to reject calls from private numbers.
*60 Call Rejection - Selective Allows you to reject calls from any number you place in the rejection list.
Allows you to turn on, turn off, or change your forwarding number from any location.
Alerts you with a beep if someone else is trying to call while you are already on the line.
Alerts you with a beep and the caller's name and/or phone number if someone else is trying to call while you are already on the line.
Displays the name and number of the calling party before you answer the phone on your caller ID display screen.
Allows two numbers to be assigned to a single line. Each number is assigned a unique ringing pattern.
Assigns special call waiting tone to numbers on your list.
Incoming long distance calls have a distinctive ring.
Telephone number no one can provide or obtain.
Published telephone number but not listed in the directory. Can be recovered through directory assistance.
Adds a third party to a two-way conversation.
Establishes a conference bridge allowing multiple parties to participate in the conversation.


It's no exaggeration to say I've watched a lot of television since being diagnosed with Guillain-Barre Syndrome at the beginning of February. I've been clearing the backlog on my DVR of things like CBS's Person Of Interest (the whole season), Fox's Alcatraz and Discovery's Gold Rush, but I have also been getting my money's worth (and more) from both my NetFlix DVD queue and my Instant Watch Queue. Below is a list of the DVD's I've gotten, followed by the movies I've streamed.
1) This does not include every movie we've streamed in the house because my kids watch a lot that way. It also doesn't include the movies we got for my kids which I watched part of, or movies or shows I watched part of and turned off because they were so bad I couldn't watch any more.
2) In general, the movies I have been getting are ones that are on the queue that I put on which my wife doesn't have any ambition to watch. i.e. I can watch it while she's working and she won't miss it. This also means that I've watched a fair amount of crap, so the average score here is on the low side.
3) The numbers in ( ) after each movie / show is my rating (1-5), but the numbers in [ ] are the number of episodes or parts I have seen in the last 6 weeks.
4) I've bolded the ones I think are extraordinary, must watches. Make sure these are on your queue and you watch them soon.
I've still got a couple hundred items on my NetFlix queue, so they have me hooked for a couple more months at least. But I'll certainly be glad when I can read books again and can just turn the TV off once in a while.


text:
Date: 30 October 2004 | Season: London Film Festival 2004 | Tags: London Film Festival
THE TIMES BFI 48th LONDON FILM FESTIVAL
Saturday 30 – Sunday 31 October 2004
London National Film Theatre
As with last year, the Experimenta Avant-Garde Weekend will present a concentrated, international programme of artists' film and video. It is a unique opportunity to survey some of the most original and vital works made around the world in recent years, and our only annual chance to do so on such a scale in England.
This year's festival includes new films by old masters such as Bruce Conner, Peter Kubelka and Jonas Mekas, alongside work by younger artists including Michaela Grill, Julie Murray and Emily Richardson. There is an opportunity to discover the work of forgotten pioneer José Val del Omar, and featured artist Nathaniel Dorsky will present a lecture to introduce his exquisite silent films. All the mixed programmes plus selected features will be shown over the two-day period, and several of the filmmakers will be present to discuss their work.
Outside of the weekend, the festival also features screenings of Jennifer Reeves' feature The Time We Killed, Gianikian & Ricci Lucchi's Oh, Uomo, both versions of Straub / Huillet's Une Visite au Louvre and a newly preserved print of Shirley Clarke's Portrait of Jason.


Accounting, tax planning and preparation, business consulting, employee benefit plan audits, virtual bookkeeping and outsourced accounting, payroll administration, nonprofit & local government audits.
A leading audit and accounting, tax and business advisory firm serving privately-held and family-owned businesses in the Greater Philadelphia region since 1975.
Pritchard, Bieler, Gruver & Willison P.C.


text:
Anatomy of an executive order: What President Trump's order on family separation does
A guide to how to read and interpret Trump's executive order on immigrant children.
Anatomy of an executive order: What President Trump's order on family separation does A guide to how to read and interpret Trump's executive order on immigrant children. Check out this story on desertsun.com: https://usat.ly/2K48JNs
Gregory Korte, USA TODAY Published 1:59 p.m. PT June 21, 2018 | Updated 6:30 p.m. PT June 21, 2018
President Donald Trump signs an executive order on family separations at the border in the Oval Office Wednesday.(Photo: Pablo Martinez Monsivais, AP)
WASHINGTON — In less than 800 words, President Donald Trump's executive order on immigrant children seeks a balance between his "zero tolerance" policy for families crossing the border and ending the practice of separating children from their parents.
But a careful reading shows that Trump hasn't eliminated the problem with a stroke of a pen, and that it still could face legal, budgetary and practical hurdles.
Here's a guide to the order:
Setting the tone
EXECUTIVE ORDER: AFFORDING CONGRESS AN OPPORTUNITY TO ADDRESS FAMILY SEPARATION
Executive orders are increasingly rhetorical as well as legal documents, and even in the title, Trump is making a point: Congress is ultimately responsible for fixing the problem, not him.
In an indication of how hastily drafted the order was, the original version on the White House web site misspelled the word "seperation." Regardless, the title sends the message that Trump sees his order as a short-term solution, and expects Congress to pass an immigration bill.
The executive order doesn't have a number yet. That's assigned by the National Archives when it's published in the Federal Register, which is the official version. This one will likely be Executive Order 13841.
Claim of authority
By the authority vested in me as President by the Constitution and the laws of the United States of America, including the Immigration and Nationality Act (INA), 8 U.S.C. 1101 et seq., it is hereby ordered as follows:
The format of executive orders is governed by — what else — another executive order. In 1962, President Kennedy signed Executive Order 11030, which requires that every executive order contain "a citation of the authority under which it is issued."
Here, Trump is claiming that he's not encroaching on congressional authority because Congress already gave the president broad immigration powers under the Immigration and Nationality Act of 1965.
The 'why' of the executive order
Section 1. Policy. It is the policy of this Administration to rigorously enforce our immigration laws. Under our laws, the only legal way for an alien to enter this country is at a designated port of entry at an appropriate time. When an alien enters or attempts to enter the country anywhere else, that alien has committed at least the crime of improper entry and is subject to a fine or imprisonment under section 1325(a) of title 8, United States Code. This Administration will initiate proceedings to enforce this and other criminal provisions of the INA until and unless Congress directs otherwise. It is also the policy of this Administration to maintain family unity, including by detaining alien families together where appropriate and consistent with law and available resources. It is unfortunate that Congress's failure to act and court orders have put the Administration in the position of separating alien families to effectively enforce the law.
The first section of an executive order usually doesn't do anything — it simply explains the policy, signaling to the public and the government why the president is taking a particular action.
Here, Trump is: (1) defending the "zero tolerance" policy that led to the separation of immigrant children from their families; (2) expressing a policy of maintaining family unity; and (3) continuing to blame Congress for the border crisis.
Trump has also used this section in anticipation of lawsuits in order to signal to the courts why he's taking action. His second travel ban executive order, for example, contained a 19-paragraph policy section after his first travel ban was struck down in the courts.
In accordance with Government Printing Office style, common nouns referring to the United States or its government — like "Administration" — are capitalized.
Definitions: Who it applies to
Sec. 2. Definitions. For purposes of this order, the following definitions apply:
(a) "Alien family" means
(i) any person not a citizen or national of the United States who has not been admitted into, or is not authorized to enter or remain in, the United States, who entered this country with an alien child or alien children at or between designated ports of entry and who was detained; and
(ii) that person's alien child or alien children.
(b) "Alien child" means any person not a citizen or national of the United States who
(i) has not been admitted into, or is not authorized to enter or remain in, the United States;
(ii) is under the age of 18; and
(iii) has a legal parent-child relationship to an alien who entered the United States with the alien child at or between designated ports of entry and who was detained.
These definitions are pretty straightforward, but it's important to note that the order does not apply to so-called unaccompanied alien children, who cross the border without parents and are already held in separate facilities from adults.
And it makes clear that there must be a "legal parent-child relationship," so the order would not apply to smugglers who pose as parents.
What the executive order actually does
Sec. 3. Temporary Detention Policy for Families Entering this Country Illegally. (a) The Secretary of Homeland Security (Secretary), shall, to the extent permitted by law and subject to the availability of appropriations, maintain custody of alien families during the pendency of any criminal improper entry or immigration proceedings involving their members.
This provision is an instruction to Homeland Security Secretary Kirstjen Nielsen to hold families that cross the border. But it also includes an important caveat: "to the extent permitted by law and subject to the availability of appropriations."
Executive orders cannot trump laws passed by Congress, so if any law conflicts with this order, the law prevails. And the president also cannot spend money without approval from Congress, so this order doesn't spend any money the agency doesn't already have.
But that also means that the effect of this executive order relies largely on how quickly and efficiently the government can implement it.
(b) The Secretary shall not, however, detain an alien family together when there is a concern that detention of an alien child with the child's alien parent would pose a risk to the child's welfare.
In short: Border agents can still separate children from their parents in cases of suspected abuse or domestic violence.
(c) The Secretary of Defense shall take all legally available measures to provide to the Secretary, upon request, any existing facilities available for the housing and care of alien families, and shall construct such facilities if necessary and consistent with law. The Secretary, to the extent permitted by law, shall be responsible for reimbursement for the use of these facilities.
Secretary of Defense James Mattis seemed to be taken by surprise Wednesday when asked which military bases would be used to detain families crossing the border.
"I think you need to talk to another department about that. I handle the stuff beyond the border," he told reporters outside the Pentagon. "We support DHS and right now this is their lead and we'll respond if requested."
(d) Heads of executive departments and agencies shall, to the extent consistent with law, make available to the Secretary, for the housing and care of alien families pending court proceedings for improper entry, any facilities that are appropriate for such purposes. The Secretary, to the extent permitted by law, shall be responsible for reimbursement for the use of these facilities.
Similar to the above paragraph, this provision would allow Homeland Security to look for other federal facilities to detain immigrant families.
(e) The Attorney General shall promptly file a request with the U.S. District Court for the Central District of California to modify the Settlement Agreement in Flores v. Sessions, CV 85-4544 ("Flores settlement"), in a manner that would permit the Secretary, under present resource constraints, to detain alien families together throughout the pendency of criminal proceedings for improper entry or any removal or other immigration proceedings.
The Flores settlement is a 20-year-old consent decree in which the Clinton administration settled a long-standing lawsuit concerning the treatment of immigrant children. The settlement puts a 20-day limit on the amount of time children can be held in detention.
Trump's zero tolerance policy gets around this limit because the children — while separated from their parents — aren't legally detained. They're in foster care, as if they were abandoned by their parents.
Here's Trump's problem: If he detains children with their parents, the children may run into the 20-day limit before the parents' case is resolved. That means the administration must either violate the court order, re-separate the families, or release the parents as with the children after 20 days — a modified "catch and release" system that would violate the zero tolerance policy.
Another problem: The Flores settlement requires immigrant children to be held in state-licensed foster care facilities. Immigration detention facilities for adults don't qualify.
On Thursday, the Justice Department asked a federal judge in California to approve a change in the settlement to allow Trump's order to go into effect.
Sec. 4. Prioritization of Immigration Proceedings Involving Alien Families. The Attorney General shall, to the extent practicable, prioritize the adjudication of cases involving detained families.
In part because of that 20-day limit, the president is asking prosecutors to put family cases to the front of the line, seeking a quick decision on amnesty and deportation.
And here's the fine print
Sec. 5. General Provisions. (a) Nothing in this order shall be construed to impair or otherwise affect:
(i) the authority granted by law to an executive department or agency, or the head thereof; or
(ii) the functions of the Director of the Office of Management and Budget relating to budgetary, administrative, or legislative proposals.
(b) This order shall be implemented in a manner consistent with applicable law and subject to the availability of appropriations.
(c) This order is not intended to, and does not, create any right or benefit, substantive or procedural, enforceable at law or in equity by any party against the United States, its departments, agencies, or entities, its officers, employees, or agents, or any other person.
All of these provisions are commonly found in most executive orders, and each has its own purpose and history.
The last one, in paragraph (c), is particularly relevant here. It makes clear that immigrant families cannot sue an agency for failing to follow the executive order.
THE WHITE HOUSE,
What the order doesn't say
As important as what's in the executive order is what's not. For example: There's no provision for reunifying families already separated at the border.
The Department of Health and Human Services, which is caring for children of parents accused of crossing the border illegally, says those issues remain unresolved.
"It is still very early and we are awaiting further guidance on the matter," said Brian Marriott, an HHS spokesman.
Read or Share this story: https://usat.ly/2K48JNs
Mountain lion attacks child in Orange County park
Corona man arrested on suspicion of ramming car, killing 3 teens
Human remains found in Joshua Tree
Incumbents, In-N-Out opponents on RM ballot
Calif. voters can start casting ballots same day as Iowa caucus
Morongo tribe to defend Indian Child Welfare Act


Fully Buffered DIMM (or FB-DIMM) is a memory technology which can be used to increase reliability, speed and density of memory systems. Conventionally, data lines from the memory controller have to be connected to data lines in every DRAM module.
As memory width, as well as access speed, increases, the signal degrades at the interface of the bus and the device. This limits the speed and/or the memory density. FB-DIMMs take a different approach to solve this problem. As with nearly all RAM specifications, the FB-DIMM specification was published by JEDEC.
Recommended Fully buffered DDR2 Memory RAM Upgrades.
Fully Buffered DIMM architecture introduces an Advanced Memory Buffer (AMB) between the memory controller and the memory module. Unlike the parallel bus architecture of traditional DRAMs, an FB-DIMM has a serial interface between the memory controller and the AMB. This enables an increase to the width of the memory without increasing the pin count of the memory controller beyond a feasible level.
With this architecture, the memory controller does not write to the memory module directly, rather it is done via the AMB. The AMB can thus compensate for signal deterioration by buffering and resending the signal. In addition, the AMB can also offer error correction, without posing any overhead on the processor or the memory controller. It can also use the Bit Lane Failover Correction feature to identify bad data paths and remove them from operation, which dramatically reduces command/address errors.