text:
<?php require_once("../includes/session.php"); ?>
<?php require_once("../includes/db_connection.php"); ?>
<?php require_once("../includes/functions.php"); ?>
<?php confirm_logged_in(); ?>

<?php
  $current_page = find_page_by_id($_GET["page"], false);
  if (!$current_page) {
    // page ID was missing or invalid or
    // page couldn't be found in database
    redirect_to("manage_content.php");
  }

  $id = $current_page["id"];
  $query = "DELETE FROM pages WHERE id = {$id} LIMIT 1";
  $result = mysqli_query($connection, $query);

  if ($result && mysqli_affected_rows($connection) == 1) {
    // Success
    $_SESSION["message"] = "Page deleted.";
    redirect_to("manage_content.php");
  } else {
    // Failure
    $_SESSION["message"] = "Page deletion failed.";
    redirect_to("manage_content.php?page={$id}");
  }

?>


text:
Two-Bite Movies, Part VI: "Bonnie and Clyde" (1967) and "The Highwaymen" (2019)
Time haunts these two films about the outlaws Bonnie and Clyde.
The Texas Bandit War, the motivation of Frank Hammer (hero of The Highwaymen), occurred in 1915.
Seventeen years later, in 1932, Bonnie and Clyde began their high-profile career.
Thirty-five years after that, in 1967, Arthur Penn's film Bonnie and Clyde stylized their crimes.
Fifty-two years after that, in 2019, John Lee Hancock's *The Highwaymen retells the story, from the perspective of law enforcement, and in the shadow of the Texas Bandit War.
The events become closer to myth, and the style becomes more realistic.
Bonnie and Clyde (1967) is odd. It's formed as if it were a comedy. Action sequences have humorous music and over-the-top (or deadpan) action. This was bizarre at first, but eventually I realized this is how some must see Kill Bill (2003). The interlude with the kidnapping of Gene Wilder, or the subplot in which Clyde Barrow (apparently) learns not to be gay and/or impotent, reinforce this stylized comedy.
The Highwaymen (2019) is definitely not a comedy. It is a crime drama taking place in a world where the Texas Rangers had just been disestablished, and anti-police and anti-bank sentiment are spreading through the country. Woody Harrelson is not quite up to the level he was in True Detective (2014). But Kevin Costner is the best he's ever been, at least since Dances with Wolves (1990). While Bonnie and Clyde is stylish in its violence, The Highwaymen is stylish in its writing… the silence that characterizes the main antagonists through most of The Highwaymen stays with you
I watched Bonnie and Clyde on Amazon Video, and The Highwaymen on Netflix.
← Qur'an 26: The Poets
Impressions of "Devolution: A Firsthand Account of the Rainier Sasquatch Massacre," by Max Brooks →
Short Review of "Who Killed Vincent Chin?"
Books Films
Mini Reviews of The Weather Underground, The Good Earth movie, and The Voyage of the Dawn Treader
Positive Review of "Lady in the Water" by M. Night Shyamalan

redpajama_set_name: RedPajamaCommonCrawl


3 Beds cottages with sea view, tennis court, 14 acre meadow, near Rye.
Pixies Croft' was built in oak in a secluded spot. It has two terraces with spectacular sea and country views, a large fence in private wood garden and a private court yard for parking .It has been refurbished to a high standard with walls clad in oak panels creating a warm rustic atmosphere, The cottage offers three bedrooms all with en-suite bath/shower rooms. One bath room has stone clad walls and deep roll top cast iron bath, the other two en-suite have walk in shower. There is a sitting room with floor to ceiling windows looking on to sea and country views. The kitchen is in the ground floor, again with floor to ceiling windows and folding doors opening to a large terrace with BBQ facility. There are three TV, DVD players, telephone, wireless Internet. The oak kitchen units house dish washer, tumble dryer, washing machine, fridge freezer. It is a perfect hide away embrace by nature. Can sleep up to 6 , ideal for family with young children or a couple seeking a romantic break.


I'm fortunate enough to have my dream home and studio built on a piece of land that my parents purchase in the 70's. I spent many hot summers sleeping in a trailer on the hill and dreaming about the future here. Once the house project was complete, we were surrounded by dirt and debt. You think you'll have money left to do the 'small' projects- It also turns out that landscaping is not a small project, but one that costs a surprising amount of money. My husband and I spent one year with the dirt and dust, then I cracked open some library books, discovered the Okanagan Xeriscape association and the five year project started.
This summer is year four for the garden. Things are filling in beautifully and I feel a real sense of pride when I'm surrounded by blossoms and bees buzzing in the sun. Since I've started working from home I have time in the morning to keep on top of weeding and watering. That always seemed to be a chore I had to squeeze in when I was rushing into town to get into the studio. Now I can putz around with my cup of coffee and still get into the studio by 8:30.
The best thing has been how the garden has inspired me. My yucca blossoms have been the jumping off point for a new earring design this summer. My color combinations feel like flower arrangements. I have a leaf inspired ring I'm working on too. I love how one hobby can fuel creativity in another area of life. Gardening also reminds me that nature is truly the greatest creative inspiration of all.


Looking for an exciting and fulfilling PR and marketing career? Want to join our army of awesome? ARPR is always looking for new talent to join our growing team of tech marcom gurus. We're seeking humble, hungry and smart A+ players who want to pitch media, write like a champ, grow digital marketing programs and be their best every single day. Candidates must be passionate about technology companies and feel energized by a fast-paced, ever-changing work environment. Proficiency with Cision, PRWeb, Pages, HubSpot, WordPress, SproutSocial, Google AdWords and/or Google Analytics will put your resume top of stack.
Team members enjoy a fun, flexible and casual workplace full of perks. This is not your run-of-the-mill marketing job opportunity. We've built a global client roster of high growth technology innovators and enterprise tech leaders. Combined, our team executes integrated communications campaigns that #makenews in outlets such as TODAY Show, TechCrunch, WSJ and #driveleads using a strategic mix of content marketing, social media and lead gen activities. In fact, our unique PR approach, workplace culture and diverse skillsets landed us at #5 on the Best Places to Work in Atlanta list and PR News named us a TOP Place to Work in PR! Join us as we continue to disrupt the industry and write the next chapter of PR!


So you're going to announce new TBs on reddit? I like the idea And yeah, I think the format is good, all the important info is there.
Oh good glad you like it, I also want people to post screen shots and other server/Tolkien related things there. If you have any ideas of what else to include I'd love to hear it.


text:
Literary journals: The writers' sandbox
Peter J. Thompson/National Post
Scott McIntyre speaks as fellow members of Descant look on at their monthly Toronto meeting.
Mark Medley, National Post · Jan. 24, 2009 | Last Updated: Jan. 27, 2009 12:01 PM ET
This is the second instalment of a monthly series examining the ecology of books, the complex interrelationships that, taken together, form Canada's publishing industry - from small-press proprietors to the country's biggest houses, from booksellers to book bloggers to book reviewers. We continue the series with literary journals.
If there's a ground zero in the world of Canadian literary journals, it is the historic George Brown House on the northwest corner of Beverley and Baldwin streets, a few blocks from the noodle houses and knick-knack shops of Toronto's Chinatown. Housed behind the red-brick walls of this Second Empire building are two of the country's most-esteemed literary journals, Brick and Descant, as well as Broken Pencil magazine, which while not a journal, is an important commentator on literary culture.
Descant's small third-floor office is a collision of old and new. Five computers compete for space with hundreds of books; framed National Magazine Award certificates hang on one wall over a couple of densely packed bookshelves; bins are filled to the brim with submissions awaiting their turn to be read; a long, rectangular table occupies the middle of the room, covered with cardboard boxes filled with the latest issue, "Cats," a thematic exploration of all things feline; a huge shelving unit rests against one wall, home to recent back issues; across the room stands the "Descant vault," shelves holding every issue in the journal's nearly 40-year history, 143 issues in all.
Akin to the minor leagues in professional sports, literary journals are where emerging writers can cut their teeth and established writers can try new things. They are the hunting grounds of agents and editors eager to snag untapped talent. They are where most major writers get their start. There are dozens of these publications in Canada, ranging from austere university-affiliated journals (The Fiddlehead, PRISM international, The Malahat Review) to scrappy literary 'zines, edited by one or two people (Front&Centre, dig, Syd & Shirley) to the new generation of online lit mags (The Danforth Review, Feathertale, Wet Ink). Though read by few, literary journals are a vital part of the publishing industry.
"They're the seabed, they're the ground for literature," says Karen Mulhallen, Descant's long-serving editor-in-chief and a professor of English at Ryerson University. "If you look at the history of literature in the last hundred years, writers get their start in the small journals. And they learn, by seeing their work in print, to become writers."
Descant was founded in 1970 by a group of mostly graduate students from the University of Toronto. Then it was mimeographed, a far cry from the perfect-bound publication of today. It was a vibrant time for writing in Canada, with writers such as Michael Ondaatje and Timothy Findley setting out on their publishing careers. "The magazine started when that energy was happening," says Mulhallen.
She has been in charge since the fifth issue — for almost 25 years Descant was run out of her home — though day-to-day operations now fall on Jesse Harris, the circulation manager, and Mark Laliberte, the managing editor, plus a freelance bookkeeper, the only paid staff on the journal side of the Descant Arts and Letters Foundation, which oversees a community literacy program called Now Hear This! They are responsible for putting out four issues of Descant a year, aided by a host of interns and a small army of co-editors.
Descant prints 1,600 copies of each issue, 1,200 of which go out to subscribers and newsstands. A single copy carries a $15 cover price, though subscriptions carry a steep discount (one year costs $28, two years go for $46). Harris, who's in charge of ad sales, admits there isn't a lot of paid advertising; it's predominantly ad exchanges with other literary magazines. Advertising may be tough to secure because of the target audience, which is mainly writers "who may not have a [lot] of time to read," says Harris, "or if they do, probably don't have any damn money."
Some money is generated by entry fees, currently $29, from the Winston Collins/Descant Prize for Best Canadian Poem, which entitles the entrant to a year's subscription, a practice almost universally adopted among literary journals. Most of its $200,000-a-year budget comes from grants.
The co-editors meet once a month in the basement boardroom of George Brown House. On a recent Sunday evening, about 15 people sat around the table, a pile of file folders and manila envelopes pushed into the middle.
"The editorial meetings are open to anybody who is interested," says Mulhallen. "There are lots of people at the table who are not co-editors. They are volunteers, or they may just drop in. Lots of people drop in and want to talk about writing, or just read manuscripts. Descant is a community. It's not just a magazine."
"It keeps me in the scene," says co-editor Jason Paradiso, who by day holds an office job with Canadian Tire. "Otherwise, I'd just be editing marketing documents."
The room alternates between hushed and bustling, as the editors and readers pluck short stories and poems from the slush pile. It takes three "yeses" from co-editors for an acceptance, a single "no" for a rejection.
Mulhallen interrupts the reading for a quick meeting; they talk about upcoming issues, the 40th-anniversary celebrations next year, and schedule the meetings for the remainder of 2009. She also delivers some good news: a three-year grant, worth $225,000, from the Ontario Trillium Foundation to expand the Now Hear This! program. "Things are good," Mulhallen tells the room. "Everything is very stable, financially, which is a relief."
Five years ago, when the journal was running a deficit of $5,000 and "everyone said we couldn't survive," she managed to raise the money, but admits "nothing's guaranteed."
Dire financial straits, of course, are nothing new for journals, which virtually always rely on grants for their survival. For the 2007 fiscal year, the latest year figures are available, the Canada Council for the Arts dispensed 106 grants in the Literary and Arts Magazines program; more than $800,000 went to English-language literary journals (Descant received $35,900). In 2008, the Ontario Arts Council awarded 29 grants totalling $604,000 to periodicals, half of them literary journals. Descant received $32,000. It's safe to say that no one runs a literary journal to get rich. (Martin Amis, in his 1995 novel The Information, captured this reality through his protagonist Richard Tull, an editor of The Little Magazine. "The money was running out," writes Amis. "The money was always running out. Its identity — the only thing it had plenty of — was patrician; its owner and editor, despite the desperate squalor of his surroundings, always wore a monocle and took frequent pinches of snuff. Prodigiously inefficient and self-pitying, The Little Magazine drained money from anyone who went anywhere near it.")
"There's atrophy," says Mulhallen of the dwindling number of literary journals. "Things are getting tighter and tighter. There's some really great journals, there always are. It's finding the audience for them. Because a literary journal is a hard sell."
In addition to Descant, Laliberte also oversees Carousel, a literary journal that he revived in 2003 while he was a graduate student at the University of Guelph. Managing them — Carousel is entirely volunteer-based and receives no grants — underlines for him what a difficult environment it is. "I think every magazine has to build its own system for surviving," he says. "We're a niche magazine, like all literary and art journals are, but we have a strong audience."
Michael Callaghan is the publisher of Exile: The Literary Quarterly, a York University-affiliated journal founded in 1972 by his father, Barry, who is editor-in-chief. Grants, he says, supply about 65% of the $75,000 annual operating budget; the university helps offset postage costs. The journal is affiliated with Exile Editions, which will publish 17 titles this year.
"It's not like anyone in this publishing house makes really any money from doing this," Callaghan says.
Another problem is the "totally terrible" bookstore sales, because journals are "stuffed in a little obscure corner where no one sees it." Callaghan says about 40% of copies sent to bookstores are sold; the rest are trashed. The print run is between 1,350 and 1,450 copies. "When you're dealing with a big-box store like Chapters/Indigo, they have no interest in promoting literary journals."
Then why go to all this trouble? "The reason why we do this is because we love it," Callaghan says. "If young writers cannot find a place to be published for the first time, if writers, I guess at any point in their career, can't find support for what they're doing, well, I guess that McDonald's job starts to look pretty tempting. And so we have tried to support, through the publication of these writers, their dreams."
We asked editors of literary magazines across Canada why their publications are important. Here are a few of their responses.
- "For the same reason that small-to medium-sized art galleries are important to Canada's visual arts community. If we decide that our cultural lives are important to the health of communities, venues for the dissemination of new and established work and opportunities to build constituency around cultural activity must be provided. As agents of the greater community, lit mags provide part of this service."
-- Pauline Conley, Arc Poetry Magazine
- "Most Canadian poets and short-story writers start out in journals and small magazines. Journals and small magazines do foundational cultural work in Canada."
-- Bonnie McIsaac, The Antigonish Review
- "Literary journals provide a space for emerging voices to flourish. The great poets and novelists of tomorrow are featured in every issue of Matrix and its peer journals. These journals provide a sense of community for a new generation of writers and, more important, a sense of legacy and of common ground with literary practitioners of previous generations."
-- Jon Paul Fiorentino, Matrix
- "Because they give new writers hope!" -- Jenny Penberthy, The Capilano Review
Jason Paradiso
Arc Poetry Society
Post Movie Reviews
Find the latest showtimes at canada.com
Complete Arts Coverage
How TikTok, a new video-sharing platform, is changing the way we communicate
The real thrill of watching Weathering With You is in the visuals
What She Said: The Art of Pauline Kael captures the critic's incendiary and multi-faceted life
Clemency makes clear the trauma of those who deal in death
A little extra aging has done Bad Boys for Life no harm


text:
var comb = require("comb"),
    define = comb.define,
    array = comb.array,
    toArray = array.toArray,
    intersect = array.intersect,
    compact = array.compact,
    string = comb.string,
    format = string.format,
    argsToArray = comb.argsToArray,
    isInstanceOf = comb.isInstanceOf,
    isArray = comb.isArray,
    isNumber = comb.isNumber,
    isDate = comb.isDate,
    isNull = comb.isNull,
    isBoolean = comb.isBoolean,
    isFunction = comb.isFunction,
    isUndefined = comb.isUndefined,
    isObject = comb.isObject,
    isHash = comb.isHash,
    isEmpty = comb.isEmpty,
    merge = comb.merge,
    hitch = comb.hitch,
    isUndefinedOrNull = comb.isUndefinedOrNull,
    isString = comb.isString,
    sql = require("../sql").sql,
    Json = sql.Json,
    JsonArray = sql.JsonArray,
    Expression = sql.Expression,
    ComplexExpression = sql.ComplexExpression,
    AliasedExpression = sql.AliasedExpression,
    Identifier = sql.Identifier,
    QualifiedIdentifier = sql.QualifiedIdentifier,
    OrderedExpression = sql.OrderedExpression,
    CaseExpression = sql.CaseExpression,
    SubScript = sql.SubScript,
    NumericExpression = sql.NumericExpression,
    ColumnAll = sql.ColumnAll,
    Cast = sql.Cast,
    StringExpression = sql.StringExpression,
    BooleanExpression = sql.BooleanExpression,
    SQLFunction = sql.SQLFunction,
    LiteralString = sql.LiteralString,
    PlaceHolderLiteralString = sql.PlaceHolderLiteralString,
    QueryError = require("../errors").QueryError, patio;

var Dataset;

var clauseMethods = function (type, clauses) {
    if (isString(clauses)) {
        clauses = clauses.split(" ");
    }
    return clauses.map(function (clause) {
        return ["_", type, clause.charAt(0).toUpperCase(), clause.substr(1), "Sql"].join("");
    });
};

define({

    instance: {
        /**@lends patio.Dataset.prototype*/

        /**
         * Dataset mixin that provides functions to the {@link patio.dataset.Dataset} to
         * create SELECT, UPDATE, CREATE, and DELETE SQL statements, based off of the the
         * methods invoked in the {@link patio.dataset._Query}
         * mixin. This class should not be used directly by
         *
         * @constructs
         * @memberOf patio.dataset
         * @name _Query
         *
         * @property {String} sql Readonly property that returns a SELECT statement.
         * @property {String} deleteSql DELETE SQL query string.  See {@link patio.dataset._Actions#delete}.
         *
         *

         *       dataset.filter(function(){
         *           return this.price.gte(100);
         *       }).deleteSql;
         *           // => "DELETE FROM items WHERE (price >= 100)"
         *

         * @property {String} selectSql  Returns a SELECT SQL query string.
         *
         *

         *
         *       DB.from("items").selectSql;
         *              //=> "SELECT * FROM items"
         *

         * @property {String} truncateSql Returns a TRUNCATE SQL query string.  See {@link patio.dataset._Actions#truncate}
         *
         *

         *
         *       DB.from("items").truncateSql();
         *              //=> 'TRUNCATE items'
         *

         * @property {String} exists  Returns an EXISTS clause for the dataset as a {@link patio.sql.LiteralString}.
         *
         *

         *
         *       var ds = DB.from("test");
         *       ds.filter(ds.filter(sql.price.lt(100))).exists()).sql;
         *              //=> 'SELECT * FROM test WHERE (EXISTS (SELECT * FROM test WHERE (price < 100)))'
         *
         *

         **/
        constructor: function () {
            //We initialize these here because otherwise
            //the will be blank because of recursive dependencies.
            !patio && (patio = require("../index"));
            !Dataset && (Dataset = patio.Dataset);
            this.outputIdentifier = hitch(this, this.outputIdentifier);
            this._super(arguments);
        },

        /**
         * Returns an INSERT SQL query string.  See {@link patio.dataset._Actions#insert}
         *
         * @example
         *
         *
         * DB.from("items").insertSql({a : 1});
         *      //=> INSERT INTO items (a) VALUES (1)
         *
         * var ds = DB.from("test");
         *
         * //default values
         * ds.insertSql();
         *      //=> INSERT INTO test DEFAULT VALUES
         *
         * //with hash
         * ds.insertSql({name:'wxyz', price:342});
         *      //=> INSERT INTO test (name, price) VALUES ('wxyz', 342)
         * ds.insertSql({});
         *      //=> INSERT INTO test DEFAULT VALUES
         *
         * //object that has a values property
         * ds.insertSql({values:{a:1}});
         *      //=> INSERT INTO test (a) VALUES (1)
         *
         * //arbitrary value
         * ds.insertSql(123);
         *      //=> INSERT INTO test VALUES (123)
         *
         * //with dataset
         * ds.insertSql(DB.from("something").filter({x:2}));
         *      //=> INSERT INTO test SELECT * FROM something WHERE (x = 2)
         *
         * //with array
         * ds.insertSql('a', 2, 6.5);
         *      //=> INSERT INTO test VALUES ('a', 2, 6.5)
         *
         * @throws {patio.QueryError} if there are Different number of values and columns given to insertSql or
         *                                  if an invalid BooleanExpresion is given.
         *
         * @param {patio.Dataset|patio.sql.LiteralString|Array|Object|patio.sql.BooleanExpression|...} values  values to
         *      insert into the database. The INSERT statement generated depends on the type.
         *

         *
Empty object| Or no arugments: then DEFAULT VALUES is used.

         *
Object: the keys will be used as the columns, and values will be the values inserted.

         *
Single {@link patio.Dataset} : an insert with subselect will be performed.

         *
Array with {@link patio.Dataset} : The array will be used for columns and a subselect will performed with the dataset for the values.

         *
{@link patio.sql.LiteralString} : the literal value will be used.

         *
Single Array : the values in the array will be used as the VALUES clause.

         *
Two Arrays: the first array is the columns the second array is the values.

         *
{@link patio.sql.BooleanExpression} : the expression will be used as the values.
         *
An arbitrary number of arguments : the {@link patio.Dataset#literal} version of the values will be used

         *

         *
         *
         * @return {String} a INSERT SQL query string
         */
        insertSql: function (values) {
            values = argsToArray(arguments);
            var opts = this.__opts;
            if (opts.sql) {
                return this._staticSql(opts.sql);
            }
            this.__checkModificationAllowed();

            var columns = [];

            switch (values.length) {
            case 0 :
                //we have no values
                return this.insertSql({});
            case 1 :
                var vals = values[0], v;
                if (isInstanceOf(vals, Dataset, LiteralString) || isArray(vals)) {
                    values = vals;
                } else if (vals.hasOwnProperty("values") && isObject((v = vals.values))) {
                    return this.insertSql(v);
                } else if (isHash(vals)) {
                    vals = merge({}, opts.defaults || {}, vals);
                    vals = merge({}, vals, opts.overrides || {});
                    values = [];
                    for (var i in vals) {
                        columns.push(i);
                        values.push(vals[i]);
                    }
                } else if (isInstanceOf(vals, BooleanExpression)) {
                    var op = vals.op;
                    values = [];
                    if (!isUndefinedOrNull(this._static.TWO_ARITY_OPERATORS[op])) {
                        var args = vals.args;
                        columns.push(args[0]);
                        values.push(args[1]);
                    } else {
                        throw new QueryError("Invalid Expression op: " + op);
                    }
                }
                break;
            case 2 :
                var v0 = values[0], v1 = values[1];
                if (isArray(v0) && isArray(v1) || isInstanceOf(v1, Dataset, LiteralString)) {
                    columns = v0, values = v1;
                    if (isArray(values) && columns.length !== values.length) {
                        throw new QueryError("Different number of values and columns given to insertSql");
                    }
                }
                break;
            }
            columns = columns.map(function (k) {
                return isString(k) ? new Identifier(k) : k;
            }, this);
            return this.mergeOptions({columns: columns, values: values})._insertSql();
        },

        /**
         * Returns an array of insert statements for inserting multiple records.
         * This method is used by {@link patio.dataset._Actions#multiInsert} to format insert statements.
         * This method is not typically used directly.
         *
         *

         *      Note:This method should be overridden by descendants if there is support for
         *                      inserting multiple records in a single SQL statement.
         *

         *
         * @param {Array} columns The columns to insert values for.
         *                  This array will be used as the base for each values item in the values array.
         * @param {Array[Array]} values Array of arrays of values to insert into the columns.
         *
         * @return {String[]} array of insert statements.
         */
        multiInsertSql: function (columns, values) {
            return values.map(function (r) {
                return this.insertSql(columns, r);
            }, this);
        },

        /**
         *Formats an UPDATE statement using the given values.  See {@link patio.dataset._Actions#update}.
         *
         * @example
         *
         * DB.from("items").updateSql({price : 100, category : 'software'});
         *      //=> "UPDATE items SET price = 100, category = 'software'
         *
         * @throw {QueryError} If the dataset is grouped or includes more than one table.
         *
         * @param {*...} Variable number of values to update the table with.
         *  The UPDATE statement created depends on the values passed in.
         *

         *
Object : the keys will be used as the columns and the values will be the values to set to columns to

         *
{@link patio.sql.Expression} : the {@link patio.dataset._Sql#literal} representation of the
         *                      {@link patio.sql.Expression} will be used as the value
         *

         *
 Other : the {@link patio.dataset._Sql#literal} value will be used as the value

         *

         *
         * @return {String} the UPDATE statement.
         */
        updateSql: function (values) {
            values = argsToArray(arguments);
            var update;
            if (this.__opts.sql) {
                update = this._staticSql(this.__opts.sql);
            } else {
                this.__checkModificationAllowed();
                update = this.mergeOptions({values: values})._updateSql();
            }
            return update;
        },

        /**
         * Returns a qualified column name (including a table name) if the column
         * name isn't already qualified.
         *
         * @example
         *
         * dataset.qualifiedColumnName("b1", "items");
         *      //=> items.b1
         *
         * dataset.qualifiedColumnName("ccc__b"));
         *      //=> 'ccc.b'
         *
         * dataset.qualifiedColumnName("ccc__b", "items"));
         *      //=> 'ccc.b'
         *
         * @param {String} column the column to qualify. If the column is already qualified (e.g. ccc__b) then the
         *                        table name (e.g. ccc) will override the provided table.
         *
         * @param {String} table the name of the table to qualify the column to.
         *
         * @return {String} the qualified column name..
         *
         */
        qualifiedColumnName: function (column, table) {
            if (isString(column)) {
                var parts = this._splitString(column);
                var columnTable = parts[0], alias = parts[2], schema, tableAlias;
                column = parts[1];
                if (!columnTable) {
                    if (isInstanceOf(table, Identifier)) {
                        table = table.value;
                    }
                    if (isInstanceOf(table, AliasedExpression)) {
                        tableAlias = table.alias;
                    } else if (isInstanceOf(table, QualifiedIdentifier)) {
                        tableAlias = table;
                    } else {
                        parts = this._splitString(table);
                        schema = parts[0];
                        tableAlias = parts[2];
                        table = parts[1];
                        if (schema) {
                            tableAlias = new Identifier(tableAlias) || new QualifiedIdentifier(schema, table);
                        }
                    }
                    columnTable = tableAlias || table;
                }
                return new QualifiedIdentifier(columnTable, column);
            } else if (isInstanceOf(column, Identifier)) {
                return column.qualify(table);
            } else {
                return column;
            }
        },

        /**
         * Creates a unique table alias that hasn't already been used in this dataset.
         *
         * @example
         *
         * DB.from("table").unusedTableAlias("t");
         *       //=> "t"
         *
         * DB.from("table").unusedTableAlias("table");
         *   //=> "table0"
         *
         * DB.from("table", "table0"]).unusedTableAlias("table");
         *   //=> "table1"
         *
         * @param {String|patio.sql.Identifier} tableAlias the table to get an unused alias for.
         *
         * @return {String} the implicit alias that is in tableAlias with a possible "N"
         *                  if the alias has already been used, where N is an integer starting at 0.
         */
        unusedTableAlias: function (tableAlias) {
            tableAlias = this._toTableName(tableAlias);
            var usedAliases = [], from, join;
            if ((from = this.__opts.from) != null) {
                usedAliases = usedAliases.concat(from.map(function (n) {
                    return this._toTableName(n);
                }, this));
            }
            if ((join = this.__opts.join) != null) {
                usedAliases = usedAliases.concat(join.map(function (join) {
                    if (join.tableAlias) {
                        return this.__toAliasedTableName(join.tableAlias);
                    } else {
                        return this._toTableName(join.table);
                    }
                }, this));
            }
            if (usedAliases.indexOf(tableAlias) !== -1) {
                var base = tableAlias, i = 0;
                do {
                    tableAlias = string.format("%s%d", base, i++);
                } while (usedAliases.indexOf(tableAlias) !== -1);
            }
            return tableAlias;
        },

        /**
         * Returns a literal representation of a value to be used as part
         * of an SQL expression.
         *
         * @example
         *
         *  DB.from("items").literal("abc'def\\") //=> "'abc''def\\\\'"
         *  DB.from("items").literal("items__id") //=> "items.id"
         *  DB.from("items").literal([1, 2, 3]) //=> "(1, 2, 3)"
         *  DB.from("items").literal(DB.from("items")) //=> "(SELECT * FROM items)"
         *  DB.from("items").literal(sql.x.plus(1).gt("y")); //=> "((x + 1) > y)"
         *
         * @throws {patio.QueryError} If an unsupported object is given.
         * @param {*} v the value to convert the the SQL literal representation
         *
         * @return {String} a literal representation of the value.
         */
        literal: function (v) {
            if (isInstanceOf(v, Json, JsonArray)) {
                return this._literalJson(v);
            } else if (isInstanceOf(v, LiteralString)) {
                return "" + v;
            } else if (isString(v)) {
                return this._literalString(v);
            } else if (isNumber(v)) {
                return this._literalNumber(v);
            } else if (isInstanceOf(v, Expression)) {
                return this._literalExpression(v);
            } else if (isInstanceOf(v, Dataset)) {
                return this._literalDataset(v);
            } else if (isArray(v)) {
                return this._literalArray(v);
            } else if (isInstanceOf(v, sql.Year)) {
                return this._literalYear(v);
            } else if (isInstanceOf(v, sql.TimeStamp, sql.DateTime)) {
                return this._literalTimestamp(v);
            } else if (isDate(v)) {
                return this._literalDate(v);
            } else if (isInstanceOf(v, sql.Time)) {
                return this._literalTime(v);
            } else if (Buffer.isBuffer(v)) {
                return this._literalBuffer(v);
            } else if (isNull(v)) {
                return this._literalNull();
            } else if (isBoolean(v)) {
                return this._literalBoolean(v);
            } else if (isHash(v)) {
                return this._literalObject(v);
            } else {
                return this._literalOther(v);
            }
        },

        //BEGIN PROTECTED

        /**
         *
         * Qualify the given expression to the given table.
         * @param {patio.sql.Expression} column the expression to qualify
         * @param table the table to qualify the expression to
         */
        _qualifiedExpression: function (e, table) {
            var h, i, args;
            if (isString(e)) {
                //this should not be hit but here just for completeness
                return this.stringToIdentifier(e);
            } else if (isArray(e)) {
                return e.map(function (exp) {
                    return this._qualifiedExpression(exp, table);
                }, this);
            } else if (isInstanceOf(e, Identifier)) {
                return new QualifiedIdentifier(table, e);
            } else if (isInstanceOf(e, OrderedExpression)) {
                return new OrderedExpression(this._qualifiedExpression(e.expression, table), e.descending,
                    {nulls: e.nulls});
            } else if (isInstanceOf(e, AliasedExpression)) {
                return new AliasedExpression(this._qualifiedExpression(e.expression, table), e.alias);
            } else if (isInstanceOf(e, CaseExpression)) {
                args = [this._qualifiedExpression(e.conditions, table), this._qualifiedExpression(e.def, table)];
                if (e.hasExpression) {
                    args.push(this._qualifiedExpression(e.expression, table));
                }
                return CaseExpression.fromArgs(args);
            } else if (isInstanceOf(e, Cast)) {
                return new Cast(this._qualifiedExpression(e.expr, table), e.type);
            } else if (isInstanceOf(e, SQLFunction)) {
                return SQLFunction.fromArgs([e.f].concat(this._qualifiedExpression(e.args, table)));
            } else if (isInstanceOf(e, ComplexExpression)) {
                return ComplexExpression.fromArgs([e.op].concat(this._qualifiedExpression(e.args, table)));
            } else if (isInstanceOf(e, SubScript)) {
                return new SubScript(this._qualifiedExpression(e.f, table), this._qualifiedExpression(e.sub, table));
            } else if (isInstanceOf(e, PlaceHolderLiteralString)) {
                args = [];
                var eArgs = e.args;
                if (isHash(eArgs)) {
                    h = {};
                    for (i in eArgs) {
                        h[i] = this._qualifiedExpression(eArgs[i], table);
                    }
                    args = h;
                } else {
                    args = this._qualifiedExpression(eArgs, table);
                }
                return new PlaceHolderLiteralString(e.str, args, e.parens);

            } else if (isHash(e)) {
                h = {};
                for (i in e) {
                    h[this._qualifiedExpression(i, table) + ""] = this._qualifiedExpression(e[i], table);
                }
                return h;
            } else {
                return e;
            }
        },

        /**
         * Returns a string that is the name of the table.
         *
         * @throws {patio.QueryError} If the name is not a String {@link patio.sql.Identifier},
         * {@link patio.sql.QualifiedIdentifier} or {@link patio.sql.AliasedExpression}.
         *
         * @param {String|patio.sql.Identifier|patio.sql.QualifiedIdentifier|patio.sql.AliasedExpression} name
         *          the object to get the table name from.
         *
         * @return {String} the name of the table.
         */
        _toTableName: function (name) {
            var ret;
            if (isString(name)) {
                var parts = this._splitString(name);
                var schema = parts[0], table = parts[1], alias = parts[2];
                ret = (schema || alias) ? alias || table : table;
            } else if (isInstanceOf(name, Identifier)) {
                ret = name.value;
            } else if (isInstanceOf(name, QualifiedIdentifier)) {
                ret = this._toTableName(name.column);
            } else if (isInstanceOf(name, AliasedExpression)) {
                ret = this.__toAliasedTableName(name.alias);
            } else {
                throw new QueryError("Invalid object to retrieve the table name from");
            }
            return ret;
        },

        /**
         * Return the unaliased part of the identifier.  Handles both
         * implicit aliases in strings, as well as {@link patio.sql.AliasedExpression}s.
         * Other objects are returned as is.
         *
         * @param {String|patio.sql.AliasedExpression|*} tableAlias the object to un alias
         *
         * @return {patio.sql.QualifiedIdentifier|String|*} the unaliased portion of the identifier
         */
        _unaliasedIdentifier: function (c) {
            if (isString(c)) {
                var parts = this._splitString(c);
                var table = parts[0], column = parts[1];
                if (table) {
                    return new QualifiedIdentifier(table, column);
                }
                return column;

            } else if (isInstanceOf(c, AliasedExpression)) {
                return c.expression;
            } else {
                return c;
            }
        },

        /**
         * Return a [@link patio.sql._Query#fromSelf} dataset if an order or limit is specified, so it works as expected
         * with UNION, EXCEPT, and INTERSECT clauses.
         */
        _compoundFromSelf: function () {
            var opts = this.__opts;
            return (opts["limit"] || opts["order"]) ? this.fromSelf() : this;
        },

        /**
         * Return true if the dataset has a non-null value for any key in opts.
         * @param opts the options to compate this datasets options to
         *
         * @return {Boolean} true if the dataset has a non-null value for any key in opts.
         */
        _optionsOverlap: function (opts) {
            var o = [];
            for (var i in this.__opts) {
                if (!isUndefinedOrNull(this.__opts[i])) {
                    o.push(i);
                }
            }
            return intersect(compact(o), opts).length !== 0;
        },

        //Formats in INSERT statement using the stored columns and values.
        _insertSql: function () {
            return this._clauseSql("insert");
        },

        //Formats an UPDATE statement using the stored values.
        _updateSql: function () {
            return this._clauseSql("update");
        },
        //Formats the truncate statement.  Assumes the table given has already been
        //literalized.
        _truncateSql: function (table) {
            return "TRUNCATE TABLE" + table;
        },

        //Prepares an SQL statement by calling all clause methods for the given statement type.
        _clauseSql: function (type) {
            var sql = [("" + type).toUpperCase()];
            try {
                this._static[sql + "_CLAUSE_METHODS"].forEach(function (m) {
                    if (m.match("With")) {
                        this[m](sql);
                    } else {
                        var sqlRet = this[m]();
                        if (sqlRet) {
                            sql.push(sqlRet);
                        }
                    }
                }, this);
            } catch (e) {
                throw e;
            }
            return sql.join("");
        },

        //SQL fragment specifying the table to insert INTO
        _insertIntoSql: function (sql) {
            return string.format(" INTO%s", this._sourceList(this.__opts.from));
        },

        //SQL fragment specifying the columns to insert into
        _insertColumnsSql: function (sql) {
            var columns = this.__opts.columns, ret = "";
            if (columns && columns.length) {
                ret = " (" + columns.map(
                    function (c) {
                        return c.toString(this);
                    }, this).join(this._static.COMMA_SEPARATOR) + ")";
            }
            return ret;
        },

        //SQL fragment specifying the values to insert.
        _insertValuesSql: function () {
            var values = this.__opts.values, ret = [];
            if (isArray(values)) {
                ret.push(values.length === 0 ? " DEFAULT VALUES" : " VALUES " + this.literal(values));
            } else if (isInstanceOf(values, Dataset)) {
                ret.push(" " + this._subselectSql(values));
            } else if (isInstanceOf(values, LiteralString)) {
                ret.push(" " + values.toString(this));
            } else {
                throw new QueryError("Unsupported INSERT values type, should be an array or dataset");
            }
            return ret.join("");
        },

        //SQL fragment for Array
        _arraySql: function (a) {
            return !a.length ? '(NULL)' : "(" + this.__expressionList(a) + ")";
        },

        //This method quotes the given name with the SQL standard double quote.
        //should be overridden by subclasses to provide quoting not matching the
        //SQL standard, such as backtick (used by MySQL and SQLite).
        _quotedIdentifier: function (name) {
            return string.format("\"%s\"", ("" + name).replace('"', '""'));
        },

        /*
         This section is for easier adapter overrides of sql formatting. These metthods are used by patio.sql.* toString
         methods to generate sql.
         */

        /**
         * @private  For internal use by patio
         *
         * SQL fragment for AliasedExpression
         */
        aliasedExpressionSql: function (ae) {
            return this.__asSql(this.literal(ae.expression), ae.alias);
        },

        /**
         * @private For internal use by patio
         * SQL fragment for BooleanConstants
         * */
        booleanConstantSql: function (constant) {
            return this.literal(constant);
        },

        /**
         * @private For internal use by patio
         * SQL fragment for CaseExpression
         */
        caseExpressionSql: function (ce) {
            var sql = ['(CASE '];
            if (ce.expression) {
                sql.push(this.literal(ce.expression), " ");
            }
            var conds = ce.conditions;
            if (isArray(conds)) {
                conds.forEach(function (cond) {
                    sql.push(format("WHEN %s THEN %s", this.literal(cond[0]), this.literal(cond[1])));
                }, this);
            } else if (isHash(conds)) {
                for (var i in conds) {
                    sql.push(format("WHEN %s THEN %s", this.literal(i), this.literal(conds[i])));
                }
            }
            return format("%s ELSE %s END)", sql.join(""), this.literal(ce.def));
        },

        /**
         * @private For internal use by patio
         * SQL fragment for the SQL CAST expression
         * */
        castSql: function (expr, type) {
            return string.format("CAST(%s AS %s)", this.literal(expr), this.db.castTypeLiteral(type));
        },

        /**
         * @private For internal use by patio
         * SQL fragment for specifying all columns in a given table
         **/
        columnAllSql: function (ca) {
            return string.format("%s.*", this.quoteSchemaTable(ca.table));
        },

        /**
         * @private For internal use by patio
         * SQL fragment for complex expressions
         **/
        complexExpressionSql: function (op, args) {
            var newOp;
            var isOperators = this._static.IS_OPERATORS, isLiterals = this._static.IS_LITERALS, l;
            if ((newOp = isOperators[op]) != null) {
                var r = args[1], v = isNull(r) ? isLiterals.NULL : isLiterals[r];
                if (r == null || this.supportsIsTrue) {
                    if (isUndefined(v)) {
                        throw new QueryError(string.format("Invalid argument('%s') used for IS operator", r));
                    }
                    l = args[0];
                    return string.format("(%s %s %s)", isString(l) ? l : this.literal(l), newOp, v);
                } else if (op === "IS") {
                    return this.complexExpressionSql("EQ", args);
                } else {
                    return this.complexExpressionSql("OR",
                        [BooleanExpression.fromArgs(["NEQ"].concat(args)), new BooleanExpression("IS", args[0],
                            null)]);
                }

            } else if (["IN", "NOTIN"].indexOf(op) !== -1) {
                var cols = args[0], vals = args[1], colArray = isArray(cols), valArray = false, emptyValArray = false;

                if (isArray(vals)) {
                    valArray = true;
                    emptyValArray = vals.length === 0;
                }
                if (colArray) {
                    if (emptyValArray) {
                        if (op === "IN") {
                            // if the array is empty, we return an expression that will be false
                            return this.literal({1: 0});
                        } else {
                            return this.literal({1: 1});
                        }
                    } else if (!this.supportsMultipleColumnIn) {
                        if (valArray) {
                            var expr = BooleanExpression.fromArgs(["OR"].concat(vals.map(function (vs) {
                                return BooleanExpression.fromValuePairs(array.zip(cols, vs));
                            })));
                            return this.literal(op === "IN" ? expr : expr.invert());
                        }
                    } else {
                        //If the columns and values are both arrays, use _arraySql instead of
                        //literal so that if values is an array of two element arrays, it
                        //will be treated as a value list instead of a condition specifier.
                        return format("(%s %s %s)", isString(cols) ? cols : this.literal(cols),
                            ComplexExpression.IN_OPERATORS[op],
                            valArray ? this._arraySql(vals) : this.literal(vals));
                    }
                }
                else {
                    if (emptyValArray) {
                        if (op === "IN") {
                            // if the array is empty, we return an expression that will be false
                            return this.literal({1: 0});
                        } else {
                            return this.literal({1: 1});
                        }
                    } else {
                        return format("(%s %s %s)", isString(cols) ? cols : this.literal(cols),
                            ComplexExpression.IN_OPERATORS[op], this.literal(vals));
                    }
                }
            } else if ((newOp = this._static.TWO_ARITY_OPERATORS[op]) != null) {
                l = args[0];
                return format("(%s %s %s)", isString(l) ? l : this.literal(l), newOp,
                    this.literal(args[1]));
            } else if ((newOp = this._static.N_ARITY_OPERATORS[op]) != null) {
                return string.format("(%s)", args.map(this.literal, this).join(" " + newOp + " "));
            } else if (op === "NOT") {
                return string.format("NOT %s", this.literal(args[0]));
            } else if (op === "NOOP") {
                return this.literal(args[0]);
            } else {
                throw new QueryError("Invalid operator " + op);
            }
        },

        /**
         * @private For internal use by patio
         *
         * SQL fragment for constants
         * */
        constantSql: function (constant) {
            return "" + constant;
        },

        /**
         * @private For internal use by patio
         *
         * SQL fragment specifying an SQL function call
         * */
        functionSql: function (f) {
            var args = f.args;
            return string.format("%s%s", f.f, args.length === 0 ? '()' : this.literal(args));
        },

        /**
         * @private For internal use by patio
         * SQL fragment specifying a JOIN clause without ON or USING.
         * */
        joinClauseSql: function (jc) {
            var table = jc.table,
                tableAlias = jc.tableAlias;
            if (table === tableAlias) {
                tableAlias = null;
            }
            var tref = this.__tableRef(table);
            return string.format(" %s %s", this._joinTypeSql(jc.joinType), tableAlias ? this.__asSql(tref, tableAlias) : tref);
        },

        /**
         * @private For internal use by patio
         * SQL fragment specifying a JOIN clause with ON.
         **/
        joinOnClauseSql: function (jc) {
            return string.format("%s ON %s", this.joinClauseSql(jc), this.literal(this._filterExpr(jc.on)));
        },

        /**
         * @private For internal use by patio
         * SQL fragment specifying a JOIN clause with USING.
         **/
        joinUsingClauseSql: function (jc) {
            return string.format("%s USING (%s)", this.joinClauseSql(jc), this.__columnList(jc.using));
        },

        /**
         * @private For internal use by patio
         * SQL fragment for NegativeBooleanConstants.
         **/
        negativeBooleanConstantSql: function (constant) {
            return string.format("NOT %s", this.booleanConstantSql(constant));
        },

        /**
         * @private For internal use by patio
         *
         * SQL fragment for the ordered expression, used in the ORDER BY
         * clause.
         */
        orderedExpressionSql: function (oe) {
            var s = string.format("%s %s", this.literal(oe.expression), oe.descending ? "DESC" : "ASC");
            if (oe.nulls) {
                s = string.format("%s NULLS %s", s, oe.nulls === "first" ? "FIRST" : "LAST");
            }
            return s;
        },

        /**
         * @private For internal use by patio
         * SQL fragment for a literal string with placeholders
         * */
        placeholderLiteralStringSql: function (pls) {
            var args = pls.args;
            var s;
            if (isHash(args)) {
                for (var i in args) {
                    args[i] = this.literal(args[i]);
                }
                s = string.format(pls.str, args);
            } else {
                s = pls.str.replace(this._static.QUESTION_MARK, "%s");
                args = toArray(args).map(this.literal, this);
                s = string.format(s, args);

            }
            if (pls.parens) {
                s = string.format("(%s)", s);
            }
            return s;
        },

        /**
         * @private For internal use by patio
         * SQL fragment for the qualifed identifier, specifying
         * a table and a column (or schema and table).
         */
        qualifiedIdentifierSql: function (qcr) {
            return [qcr.table, qcr.column].map(function (x) {
                var isLiteral = [QualifiedIdentifier, Identifier, String].some(function (c) {
                    return x instanceof c;
                }), ret;
                if (isLiteral) {
                    ret = this.literal(x);
                } else {
                    ret = this.quoteIdentifier(x);
                }
                return ret;
            }, this).join('.');
        },

        /**
         * @private For internal use by patio
         *
         * Adds quoting to identifiers (columns and tables). If identifiers are not
         * being quoted, returns name as a string.  If identifiers are being quoted
         * quote the name with {@link patio.dataset._Sql#_quotedIdentifier}.
         */
        quoteIdentifier: function (name) {
            if (isInstanceOf(name, LiteralString)) {
                return name;
            } else {
                if (isInstanceOf(name, Identifier)) {
                    name = name.value;
                }
                name = this.inputIdentifier(name);
                if (this.quoteIdentifiers) {
                    name = this._quotedIdentifier(name);
                }
            }
            return name;
        },

        /**
         * @private For internal use by patio
         *
         * Modify the identifier returned from the database based on the
         * identifierOutputMethod.
         */
        inputIdentifier: function (v) {
            var i = this.__identifierInputMethod;
            v = v.toString(this);
            return !isUndefinedOrNull(i) ?
                isFunction(v[i]) ?
                    v[i]() :
                    isFunction(comb[i]) ?
                        comb[i](v)
                        : v
                : v;
        },

        /**
         * @private For internal use by patio
         *
         * Modify the identifier sent to the database based on the
         * identifierOutputMethod.
         */
        outputIdentifier: function (v) {
            (v === '' && (v = 'untitled'));
            var i = this.__identifierOutputMethod;
            return !isUndefinedOrNull(i) ?
                isFunction(v[i]) ?
                    v[i]() :
                    isFunction(comb[i]) ?
                        comb[i](v)
                        : v
                : v;
        },

        /**
         * @private For For internal use by patio
         *
         * Separates the schema from the table and returns a string with them
         * quoted (if quoting identifiers)
         */
        quoteSchemaTable: function (table) {
            var parts = this.schemaAndTable(table);
            var schema = parts[0];
            table = parts[1];
            return string.format("%s%s", schema ? this.quoteIdentifier(schema) + "." : "", this.quoteIdentifier(table));
        },

        /**
         * @private For For internal use by patio
         * Split the schema information from the table
         */
        schemaAndTable: function (tableName) {
            var sch = this.db ? this.db.defaultSchema || null : null;
            if (isString(tableName)) {
                var parts = this._splitString(tableName);
                var s = parts[0], table = parts[1];
                return [s || sch, table];
            } else if (isInstanceOf(tableName, QualifiedIdentifier)) {
                return [tableName.table, tableName.column];
            } else if (isInstanceOf(tableName, Identifier)) {
                return [null, tableName.value];
            } else if (isInstanceOf(tableName, LiteralString)) {
                return [null, tableName];
            } else {
                throw new QueryError("table should be a QualifiedIdentifier, Identifier, or String");
            }
        },

        /**
         * @private For For internal use by patio
         * SQL fragment for specifying subscripts (SQL array accesses)
         * */
        subscriptSql: function (s) {
            return string.format("%s[%s]", this.literal(s.f), this.__expressionList(s.sub));
        },

        /**
         * Do a simple join of the arguments (which should be strings) separated by commas
         * */
        __argumentList: function (args) {
            return args.join(this._static.COMMA_SEPARATOR);
        },

        /**
         * SQL fragment for specifying an alias.  expression should already be literalized.
         */
        __asSql: function (expression, alias) {
            return string.format("%s AS %s", expression, this.quoteIdentifier(alias));
        },

        /**
         * Converts an array of column names into a comma seperated string of
         * column names. If the array is empty, a wildcard (*) is returned.
         */
        __columnList: function (columns) {
            return (!columns || columns.length === 0) ? this._static.WILDCARD : this.__expressionList(columns);
        },

        /**
         * The alias to use for datasets, takes a number to make sure the name is unique.
         * */
        _datasetAlias: function (number) {
            return this._static.DATASET_ALIAS_BASE_NAME + number;
        },

        /**
         * Converts an array of expressions into a comma separated string of
         * expressions.
         */
        __expressionList: function (columns) {
            return columns.map(this.literal, this).join(this._static.COMMA_SEPARATOR);
        },

        //Format the timestamp based on the default_timestamp_format, with a couple
        //of modifiers.  First, allow %N to be used for fractions seconds (if the
        //database supports them), and override %z to always use a numeric offset
        //of hours and minutes.
        formatTimestamp: function (v, format) {
            return this.literal(patio.dateToString(v, format));
        },

        /**
         * SQL fragment specifying a JOIN type, splits a camelCased join type
         * and converts to uppercase/
         */
        _joinTypeSql: function (joinType) {
            return (joinType || "").replace(/([a-z]+)|([A-Z][a-z]+)/g, function (m) {
                    return m.toUpperCase() + " ";
                }).trimRight() + " JOIN";
        },

        /*
         Methods for converting types to a SQL .
         */

        /**
         * @return SQL fragment for a type of object not handled by {@link patio.dataset._Sql#literal}.
         * If object has a method sqlLiteral then it is called with this dataset as the first argument,
         * otherwise raises an error. Classes implementing sqlLiteral should call a class-specific method
         * on the dataset provided and should add that method to {@link patio.dataset.Dataset}, allowing for adapters
         * to provide customized literalizations.
         * If a database specific type is allowed, this should be overriden in a subclass.
         */
        _literalOther: function (v) {
            if (isFunction(v.sqlLiteral)) {
                return v.sqlLiteral(this);
            } else {
                throw new QueryError(string.format("can't express %j as a SQL literal", [v]));
            }
        },

        /**
         *@return SQL fragment for Buffer, treated as an expression
         * */
        _literalBuffer: function (b) {
            return "X'" + b.toString("hex") + "'";
        },

        /**
         *@return SQL fragment for Hash, treated as an expression
         * */
        _literalObject: function (v) {
            return this._literalExpression(BooleanExpression.fromValuePairs(v));
        },

        /**
         * @return SQL fragment for Array.  Treats as an expression if an array of all two pairs, or as a SQL array otherwise.
         */
        _literalArray: function (v) {
            return Expression.isConditionSpecifier(v) ? this._literalExpression(BooleanExpression.fromValuePairs(v)) : this._arraySql(v);
        },

        /**
         * @return SQL fragment for a number.
         */
        _literalNumber: function (num) {
            var ret = "" + num;
            if (isNaN(num) || num === Infinity) {
                ret = string.format("'%s'", ret);
            }
            return ret;
        },

        /**
         * @return SQL fragment for Dataset.  Does a subselect inside parantheses.
         */
        _literalDataset: function (dataset) {
            return string.format("(%s)", this._subselectSql(dataset));
        },

        /**
         * @return SQL fragment for Date, using the ISO8601 format.
         */
        _literalDate: function (date) {
            return (this.requiresSqlStandardDateTimes ? "DATE '" : "'") + patio.dateToString(date) + "'";
        },

        /**
         *@return SQL fragment for a year.
         */
        _literalYear: function (o) {
            return patio.dateToString(o, this._static.YEAR_FORMAT);
        },

        /**
         *@return SQL fragment for a timestamp, using the ISO8601 format.
         */
        _literalTimestamp: function (v) {
            return this.formatTimestamp(v, this._static.TIMESTAMP_FORMAT);
        },

        /**
         *@return SQL fragment for a timestamp, using the ISO8601 format.
         */
        _literalTime: function (v) {
            return this.formatTimestamp(v, this._static.TIME_FORMAT);
        },

        /**
         * @return SQL fragment for a boolean.
         */
        _literalBoolean: function (b) {
            return b ? this._static.BOOL_TRUE : this._static.BOOL_FALSE;
        },

        /**
         * @return SQL fragment for SQL::Expression, result depends on the specific type of expression.
         * */
        _literalExpression: function (v) {
            return v.toString(this);
        },

        /**
         *@return SQL fragment for Hash, treated as an expression
         * */
        _literalHash: function (v) {
            return this._literalExpression(BooleanExpression.fromValuePairs(v));
        },

        /**@return SQL fragment for null*/
        _literalNull: function () {
            return this._static.NULL;
        },

        /**
         * @return SQL fragment for String.  Doubles \ and ' by default.
         * */
        _literalString: function (v) {
            var parts = this._splitString(v);
            var table = parts[0], column = parts[1], alias = parts[2], ret;
            if (!alias) {
                if (column && table) {
                    ret = this._literalExpression(QualifiedIdentifier.fromArgs([table, column]));
                } else {
                    ret = "'" + v.replace(/\\/g, "\\\\").replace(/'/g, "''") + "'";
                }
            } else {
                if (column && table) {
                    ret = new AliasedExpression(QualifiedIdentifier.fromArgs([table, column]), alias);
                } else {
                    ret = new AliasedExpression(new Identifier(column), alias);
                }
                ret = this.literal(ret);
            }
            return ret;
        },

        /**
         * @return SQL fragment for json.  Doubles ' by default.
         * */
        _literalJson: function (v) {
            throw new QueryError("Json not supported.");
        },

        /*SQL STATEMENT CREATION METHODS*/

        _selectQualifySql: function () {
            var o = this.__opts;
            var table = this.__opts.alwaysQualify;
            if (table && !o.sql) {
                array.intersect(Object.keys(o), this._static.QUALIFY_KEYS).forEach(function (k) {
                    o[k] = this._qualifiedExpression(o[k], table);
                }, this);
                if (!o.select || isEmpty(o.select)) {
                    o.select = [new ColumnAll(table)];
                }
            }
        },

        _deleteQualifySql: function () {
            return this._selectQualifySql.apply(this, arguments);
        },

        /**
         * @return the columns selected
         * */
        _selectColumnsSql: function () {
            return " " + this.__columnList(this.__opts.select);
        },

        /**@return the DISTINCT clause.*/
        _selectDistinctSql: function () {
            var distinct = this.__opts.distinct, ret = [];
            if (distinct) {
                ret.push(" DISTINCT");
                if (distinct.length) {
                    ret.push(format(" ON (%s)", this.__expressionList(distinct)));
                }
            }
            return ret.join("");
        },

        /**
         * @return the EXCEPT, INTERSECT, or UNION clause.
         * This uses a subselect for the compound datasets used, because using parantheses doesn't
         * work on all databases.
         **/
        _selectCompoundsSql: function () {
            var opts = this.__opts, compounds = opts.compounds, ret = [];
            if (compounds) {
                compounds.forEach(function (c) {
                    var type = c[0], dataset = c[1], all = c[2];
                    ret.push(string.format(" %s%s %s", type.toUpperCase(), all ? " ALL" : "", this._subselectSql(dataset)));
                }, this);
            }
            return ret.join("");
        },

        /**
         * @return the sql to add the list of tables to select FROM
         **/
        _selectFromSql: function () {
            var from = this.__opts.from;
            return from ? string.format(" %s%s", this._static.FROM, this._sourceList(from)) : "";
        },

        /**
         * @return the GROUP BY clause
         **/
        _selectGroupSql: function () {
            var group = this.__opts.group;
            return group ? string.format(" GROUP BY %s", this.__expressionList(group)) : "";
        },

        /**
         *@return the sql to add the filter criteria in the HAVING clause
         **/
        _selectHavingSql: function () {
            var having = this.__opts.having;
            return having ? string.format(" HAVING %s", this.literal(having)) : "";
        },

        /**
         * @return the JOIN clause.
         **/
        _selectJoinSql: function () {
            var join = this.__opts.join, ret = [];
            if (join) {
                join.forEach(function (j) {
                    ret.push(this.literal(j));
                }, this);
            }
            return ret.join("");
        },

        /**
         * @return the LIMIT and OFFSET clauses.
         * */
        _selectLimitSql: function () {
            var ret = [], limit = this.__opts.limit, offset = this.__opts.offset;
            !isUndefined(limit) && !isNull(limit) && (ret.push(format(" LIMIT %s", this.literal(limit))));
            !isUndefined(offset) && !isNull(offset) && (ret.push(format(" OFFSET %s", this.literal(offset))));
            return ret.join("");
        },

        /**
         * @return SQL for different locking modes.
         **/
        _selectLockSql: function () {
            var lock = this.__opts.lock, ret = [];
            if (lock) {
                if (lock === "update") {
                    ret.push(this._static.FOR_UPDATE);
                } else {
                    ret.push(" ", lock);
                }
            }
            return ret.join("");
        },

        /**
         * @return the SQL ORDER BY clause fragment.
         */
        _selectOrderSql: function () {
            var order = this.__opts.order;
            return order ? string.format(" ORDER BY %s", this.__expressionList(order)) : "";
        },

        /**
         * @return the SQL WHERE clause fragment.
         */
        _selectWhereSql: function () {
            var where = this.__opts.where;
            return where ? string.format(" WHERE %s", this.literal(where)) : "";
        },

        /**
         * @return SQL WITH clause fragment.
         * @param sql
         */
        _selectWithSql: function (sql) {
            var wit = this.__opts["with"];
            if (wit && wit.length) {
                //sql.length = 0;
                var base = sql.join("");
                sql.length = 0;
                sql.push([this._selectWithSqlBase(), wit.map(function (w) {
                    return [
                        this.quoteIdentifier(w.name),
                        (w.args ? ("(" + this.__argumentList(w.args) + ")") : ""),
                        " AS ",
                        this._literalDataset(w.dataset)
                    ].join("");
                }, this).join(this._static.COMMA_SEPARATOR), base].join(" "));
            }
        },

        _deleteWithSql: function () {
            return this._selectWithSql.apply(this, arguments);
        },

        _insertWithSql: function () {
            return this._selectWithSql.apply(this, arguments);
        },

        _updateWithSql: function () {
            return this._selectWithSql.apply(this, arguments);
        },

        _insertReturningSql: function (sql) {
            var opts = this.__opts, ret = "";
            if (opts.hasOwnProperty("returning")) {
                return [this._static.RETURNING, this.__columnList(array.toArray(opts.returning))].join("");
            }
            return ret;
        },

        _deleteReturningSql: function () {
            return this._insertReturningSql.apply(this, arguments);
        },

        _updateReturningSql: function () {
            return this._insertReturningSql.apply(this, arguments);
        },

        /**
         * @return The base keyword to use for the SQL WITH clause
         **/
        _selectWithSqlBase: function () {
            return this._static.SQL_WITH;
        },

        /**
         * @see patio.dataset._Sql#_selectFromSql
         */
        _deleteFromSql: function () {
            return this._selectFromSql();
        },

        /**
         * @see patio.dataset._Sql#_selectOrderSql
         */
        _deleteOrderSql: function () {
            return this._selectOrderSql();
        },

        /**
         * @see patio.dataset._Sql#_selectWhereSql
         */
        _deleteWhereSql: function () {
            return this._selectWhereSql();
        },

        /**
         * @see patio.dataset._Sql#_selectOrderSql
         */
        _updateOrderSql: function () {
            return this._selectOrderSql();
        },

        /**
         * @see patio.dataset._Sql#_selectWhereSql
         */
        _updateWhereSql: function () {
            return this._selectWhereSql();
        },

        /**
         * @return SQL fragment specifying the tables to delete from.
         * Includes join table if modifying joins is allowed.
         */
        _updateTableSql: function (sql) {
            var ret = [this._sourceList(this.__opts.from)];
            if (this.supportsModifyingJoins) {
                ret.push(this._selectJoinSql());
            }
            return ret.join("");
        },

        /**
         * @returns The SQL fragment specifying the columns and values to SET.
         * */
        _updateSetSql: function () {
            var values = this.__opts.values, defs = this.__opts.defaults, overrides = this.__opts.overrides;
            var st = [" SET "];
            if (isArray(values)) {
                var v = [], mergedDefsAndOverrides = false, length = values.length, ident, val;

                for (var i = 0; i < length; i++) {
                    val = values[i];
                    if (isHash(val)) {
                        mergedDefsAndOverrides = true;
                        val = merge({}, defs || {}, val);
                        val = merge({}, val, overrides || {});
                        for (var j in val) {
                            ident = this.stringToIdentifier(j);
                            v.push(this.quoteIdentifier(ident) + " = " + this.literal(val[j]));
                        }
                    } else if (isInstanceOf(val, Expression)) {
                        v.push(this._literalExpression(val).replace(/^\(|\)$/g, ""));
                    } else {
                        v.push(val);
                    }
                }
                if (!mergedDefsAndOverrides) {
                    val = merge({}, defs || {});
                    val = merge({}, val, overrides || {});
                    for (i in val) {
                        ident = this.stringToIdentifier(i);
                        v.push(this.quoteIdentifier(ident) + " = " + this.literal(val[i]));
                    }
                }
                st.push(v.join(this._static.COMMA_SEPARATOR));
            } else {
                st.push(values);
            }

            return st.join("");
        },

        /**
         * Converts an array of source names into into a comma separated list.
         **/
        _sourceList: function (source) {
            if (!Array.isArray(source)) {
                source = [source];
            }
            if (!source || !source.length) {
                throw new QueryError("No source specified for the query");
            }
            return " " + source.map(
                    function (s) {
                        return this.__tableRef(s);
                    }, this).join(this._static.COMMA_SEPARATOR);
        },

        /**
         * @return SQL to use if this dataset uses static SQL.  Since static SQL
         * can be a PlaceholderLiteralString in addition to a String,
         * we literalize nonstrings.
         **/
        _staticSql: function (sql) {
            return isString(sql) ? sql : this.literal(sql);

        },

        /**
         * @return SQL fragment for a subselect using the given database's SQL.
         **/
        _subselectSql: function (ds) {
            return ds.sql;
        },

        /**
         * @returns SQL fragment specifying a table name.
         **/
        __tableRef: function (t) {
            return isString(t) ? this._quotedIdentifier(t) : this.literal(t);
        },

        //Raise an InvalidOperation exception if deletion is not allowed
        //for this dataset
        __checkModificationAllowed: function () {
            if (this.__opts.group) {
                throw new QueryError("Grouped datasets cannot be modified");
            }
            if (!this.supportsModifyingJoins && this._joinedDataset) {
                throw new QueryError("Joined datasets cannot be modified");
            }
        },

        __toAliasedTableName: function (alias) {
            var ret;
            if (isString(alias)) {
                ret = alias;
            } else if (isInstanceOf(alias, Identifier)) {
                ret = alias.value;
            } else {
                throw new QueryError("Invalid table alias");
            }
            return ret;
        },

        getters: {
            //Same as selectS, not aliased directly to make subclassing simpler.
            sql: function () {
                return this.selectSql;
            },

            selectSql: function () {
                var selectSql;
                if (this.__opts.sql) {
                    selectSql = this._staticSql(this.__opts.sql);
                } else {
                    selectSql = this._clauseSql("select");
                }
                return selectSql;
            },

            deleteSql: function () {
                var opts = this.__opts;
                if (opts.sql) {
                    return this._staticSql(this.sql);
                } else {
                    this.__checkModificationAllowed();
                    return this._clauseSql("delete");
                }
            },

            truncateSql: function () {
                if (this.__opts.sql) {
                    return this._staticSql(this.__opts.sql);
                } else {
                    this.__checkModificationAllowed();
                    if (this.__opts.where) {
                        throw new QueryError("cant truncate filtered datasets");
                    }
                    return this._truncateSql(this._sourceList(this.__opts.from));
                }
            },

            exists: function () {
                return new LiteralString("EXISTS (" + this.selectSql + ")");
            },

            //Whether this dataset is a joined dataset
            _joinedDataset: function () {
                var from = this.__opts.from;
                return (isArray(from) && from.length > 1) || this.__opts.join;
            }
        }
    },

    static: {
        /**@lends patio.Dataset*/

        /**
         * Default FROM clause
         */
        FROM: "FROM",
        /**
         * Default SQL AND separator.
         */
        AND_SEPARATOR: " AND ",
        /**
         * Default SQL boolean false operator.
         */
        BOOL_FALSE: "'f'",
        /**
         * Default SQL boolean true operator.
         */
        BOOL_TRUE: "'t'",
        /**
         * Default SQL comma sperator.
         */
        COMMA_SEPARATOR: ', ',
        /**
         * Default COUNT expression.
         */
        COUNT_OF_ALL_AS_COUNT: sql.count(sql.literal('*')).as("count"),
        /**
         * Default alias for datasets.
         */
        DATASET_ALIAS_BASE_NAME: 't',
        /**
         * Default FOR UPDATE SQL fragment.
         */
        FOR_UPDATE: ' FOR UPDATE',
        /**
         * Hash of IS literals
         */
        IS_LITERALS: {NULL: 'NULL', true: 'TRUE', false: 'FALSE'},
        /**
         * Defaults IS OPERATORS. See {@link patio.sql.ComplexExpression.IS_OPERATORS}.
         */
        IS_OPERATORS: ComplexExpression.IS_OPERATORS,
        /**
         * Defaults N(Multi arity) OPERATORS. See {@link patio.sql.ComplexExpression.N_ARITY_OPERATORS}.
         */
        N_ARITY_OPERATORS: ComplexExpression.N_ARITY_OPERATORS,
        /**
         * Defaults TWO OPERATORS. See {@link patio.sql.ComplexExpression.TWO_ARITY_OPERATORS}.
         */
        TWO_ARITY_OPERATORS: ComplexExpression.TWO_ARITY_OPERATORS,
        /**
         * Defaults SQL NULL.
         */
        NULL: "NULL",
        /**
         * Default SQL clauses that need qualifying. This may be overrode by adapters.
         */
        QUALIFY_KEYS: ["select", "where", "having", "order", "group"],
        /**
         * Regexp used to replace '?' in {@link patio.sql.PlaceHolderLiteralString}
         */
        QUESTION_MARK: /\?/g,
        /**
         * Default SQL DELETE clause methods. This may be overrode by adapters.
         */
        DELETE_CLAUSE_METHODS: clauseMethods("delete", "qualify from where"),
        /**
         * Default SQL INSERT clause. This may be overrode by adapters.
         */
        INSERT_CLAUSE_METHODS: clauseMethods("insert", "into columns values"),
        /**
         * Default SQL SELECT clause. This may be overrode by adapters.
         */
        SELECT_CLAUSE_METHODS: clauseMethods("select", "qualify with distinct columns from join where group having compounds order limit lock"),
        /**
         * Default SQL UPDATE clause. This may be overrode by adapters.
         */
        UPDATE_CLAUSE_METHODS: clauseMethods("update", "table set where"),
        /**
         * Default SQL '*' literal string.
         */
        WILDCARD: new LiteralString('*'),

        /**
         * Default SQL 'RETURNING' literal string
         */
        RETURNING: " RETURNING ",

        /**
         * Default SQL WITH base. This may be overrode by adapters.
         */
        SQL_WITH: "WITH",

        /**
         * Default space to use when building SQL queries
         */
        SPACE: " ",

        clauseMethods: clauseMethods

    }
}).as(module);

redpajama_set_name: RedPajamaGithub


Imagine one week where everything is just about kitesurfing & sailing?
Discover the best kite spots and enjoy private kite sessions while sailing and living on a luxury catamaran.
Singles, Couples or Families.. You choose!
We are now matching people with common interests making sure this will be the trip of your lives!


Sarah Mitchell-Hume didn't know anything about mental health when she had a panic attack at her desk. She was two years into her career in engineering recruitment, a job she absolutely loved, when she suddenly became unwell. Sarah was diagnosed with depression. "I felt pressurised to go back to work, even though I was signed off sick," she recalls. "I was physically present but mentally I wasn't doing anything. And I'd just zone out, there was nothing going on behind my eyes. I think I just cleared my inbox every day. It made me more ill. I should've been at home recovering."
Aged 24, she was just starting her career when she felt like it had come to an end. If you break a leg, it's clear you need time off. Having a mental illness or suffering from workplace stress can be harder to spot. But Vitality's research has shown that these are the biggest factors behind the growing problem of people turning up for work when they're not fit enough to do their jobs.
Vitality runs an annual survey, Britain's Healthiest Workplace, involving 167 organisations and 32,000 staff. The aim is to understand and tackle poor health and wellbeing across the UK workforce. Presenteeism is a clear and accelerating trend. It's just one of a number of studies which have come to the same conclusion. It's obvious that if we're not at our best, then we're less productive employees. When Dale Garbacki lost his wife in 2014, he hit rock bottom. He was her main carer as well as trying to hold down a full time job in technical support for Dixons Carphone. "Productivity dropped to what I call bare minimums," he now admits. "I'd had several warnings. By finally reaching out to the company and having a private chat with one of my managers, about how I was feeling and what I was going through at home, the loss of my wife, he said 'ah, why didn't you tell me sooner. We'll need to get you some help'."Whilst Ms Mitchell-Hume felt she had no support in her workplace and ultimately left her job, Mr Garbacki started a work sponsored fitness programme to help him turn things around. He runs before work in his local park in Preston as well as working out in the company gym. "I'm definitely a lot better than I was. Overall I feel better in myself. I have more positive and confident feelings and I actually look forward to each day." He has now earned his first ever full bonus.
His employer has been on a journey, too. Dixons Carphone's Head of Corporate Social Responsibility, Kesah Trowell, had her work cut out trying to persuade her company to sponsor one of the UK's biggest long distance treks or runs, the Race to the Stones. It proved a huge success with its workers who took part, kick starting a raft of other wellbeing initiatives including Mr Garbacki's bootcamp programme.
"It really does make good business sense," says Ms Trowell. "It's important that we have happy, healthy and an engaged workforce, particularly since we're in a retail environment. "She adds: "Technology makes it easy for people to hide behind their desks, their computers or their phones. It's easier for more presenteeism than their would've been a few years ago. That's why it's important for us to manage this."
Could reducing presenteeism help solve the UK's chronic productivity puzzle? "Absolutely," says Vitality's chief executive Neville Koopwitz. Productivity is the main driver of long-term economic growth and living standards. But our workers aren't anything like as efficient as they should be. "Workplace stress and mental wellbeing has a massive impact. We believe presenteeism is the key issue to Britain's productivity problem, where people are at work and not performing in an optimal way," Mr Koopwitz says.Ms Mitchell-Hume does freelance and voluntary work now as well as being a busy mother. She's happy but she just wishes her employer had handled things differently. "It was so incredibly difficult. A bit of compassion, empathy and flexibility would've made all the difference," she says."The workplace can be a tough place to be. There's so much more to be done to look after employees."


The study sought to establish effects of workforce diversity management on the organizational effectiveness selected branches of Kenya commercial bank limited .Specifically, the study sought to establish the extent of demographic diversity , extent of social-cultural diversity, the management of diversity at the bank"s branches and how the management of the workforce diversity affect organizational effectiveness. The Study adopted a descriptive research design .The study population consisted of all branches of KCB limited in five countries in the East African region. A sample size of 100 respondents was selected. The internet mail survey had a 60% response rate. Data collection was by use of questionnaire through internet mail. Analysis was by use of descriptive and inferential statistics and SPSS version 15.0. The Pearson"s correlation coefficient indicated the relationship between each independent variables and the dependent variable and tested at 5% significance level. The study established that overall, diversity affects the cohesion of the KCB and although the problems related to diversity are intermittent occurrences, in some branches, less than 20% of the branches, these happen very often. Although in 20% of the branches, diversity issues are minimal. Although, there are deliberate efforts to capitalize on diversity at KCB, very little is being achieved, and negative diversity is likely to affect organizational effectiveness, if not properly addressed. The study recommended that in order leverage of the existing diversity, a philosophy be established on diversity that would affect most of the human resources activities with regard to the differences as existing among its employees.


Cannabis inhalation is the more traditional form of cannabis therapy*. However, the modern generation has turned to vapor due to the belief it is a cleaner form of ingestion. While there are studies, some of which do state and make clear the lack of data, marijuana inhalation theories clearly need more studies need to take place in order to have solid science.
For every source which supports cannabis therapy and marijuana inhalation there is a contradicting source comparing it to tobacco. However, tobacco and cannabis are completely different and the data should not be compared. Concern over inhalation through smoking the cannabis flower has turned many cannabis therapy patients to vaporizing.
Vaporizing is inhaling a vapor rather than smoke using an electronic machine. The theory, inhaling concentrated vapors is safer than inhaling smoked flower, is do to the belief it is more natural and pure. While vaporizers are a relatively new products, the initial impression is that inhaling vapors is much safer; though some do believe there is not enough evidence to prove the safety of vaporizers because of the relatively short amount of time they have been on the market.
It continues saying "compared to other proposed non-smoked delivery systems using pharmaceutical extracts and synthetics, vaporization also offers the economic advantage of allowing patients to use inexpensive, homegrown cannabis." Most patients using cannabis therapy do so not only because of it's benefits but also because it is natural and they seek the purest treatment possible.
Cannabis Vaporizer Combines Efficient Delivery of THC with Effective Suppression of Pyrolytic Compounds. Gieringer. St. Laurent. Goodrich.
Journal of Cannabis Therapeutics, Vol. 4(1) 2004 (c) 2004 by The Haworth Press, Inc. All rights reserved.
*cannabis therapy, defined as, the use of cannabis, will be used to denote the positive nature of cannabis rather than the traditional terminology typically used which has negative connotations.


text:
Who gets to be a writer?
Drew Coffman | Flickr
More than 400,000 people, including 100,000 kids, participated in '30 days and 30 nights of literary abandon' this November. It was National Novel Writing Month, and if you were up to it, the task was to write 50,000 words of a novel in one month. The goal of National Novel Writing Month (also known as NaNoWriMo) is to get people writing and keep them motivated. It's not about finishing a novel. It's about first drafts. Anyone who gets to 50,000 words is a winner. The idea is that anyone who gets to 50,000 words, or even close, gets past the hardest part of novel writing. They get momentum, structure, and perhaps something really special to pursue.
Why would someone do this?
Research has a lot to say about what compels people to do creative, difficult work. Writing a novel qualifies as both. Intrinsic motivation, doing something for its inherent satisfactions, is necessary for high-quality learning and creativity. However, it's not a completely independent quality. Intrinsic motivation seems to be conditional on people realizing some basic psychological needs associated with their participation in an activity. Structures that facilitate feelings of competence and a sense of autonomy in an activity increase intrinsic motivation.
Extrinsic motivation can help too. Extrinsic motivation refers to behavior that is driven by external rewards such as money or grades; some outcome that is separate from any inherent satisfaction associated with completing a task. While extrinsic motivation can undermine creativity if it is perceived to be controlling, it can also support intrinsic motivation. Structures that focus work, thus promoting self-regulation for making progress, can help people internalize values and behaviors that are necessary for creative, difficult work. The key is that there is still some level of autonomy or choice associated with participation. Choice is critical. It is both a necessary component for intrinsic motivation and a pathway from less autonomous forms of extrinsic motivation to more autonomous forms.
A research article recently published in Studies in Continuing Education explores issues around identity and learning in becoming a fiction author. Patricia Gouthro, who interviewed 40 published fiction authors, argues that fiction writers have a strong desire to do work that is meaningful to them. They are compelled to write. They are intrinsically motivated. Becoming a fiction writer is a particular kind of work that is pursued by personal choice. One does not stumble into this line of work. Gouthro found that successful authors benefited from gradual successes and feedback regarding their work, things that facilitate feelings of competence and autonomy. Also, while writers often report that much of the work is solitary, they benefit from the affirmation that comes through being connected to others in the field - writers, editors, and even readers - during the writing process. Stephen King, in On Writing: A Memoir of the Craft, talks about writing for his "constant reader," someone who reviews his work and is always in his mind as he is writing.
But for some, intrinsic motivation is not enough. While NaNoWriMo appeals to intrinsically motivated people and provides structures that help writers feel competent, autonomous, and connected to others, it also provides some external structure that is purely extrinsic: a word-count, a deadline, and the potential for status associated with being a winner. But choice is still important. One does not have to submit to this sort of structure. But they do, in increasingly large numbers.
Well, more than 90 novels begun during NaNoWriMo have been published, including New York Times Best Sellers Water for Elephants by Sara Gruen, The Night Circus by Erin Morgenstern, and Cinder by Marissa Meyer.
So who gets to be a writer?
I like what National Novel Writing Month Executive Director Grant Faulkner says about this. "Start writing. Now. Write with moxie, with derring-do, with abandon," Faulkner said. "Don't let anyone tell you you're not a writer because the definition of being a writer is to write."
Gouthro, P. (2014). Who gets to become a writer? Exploring identity and learning issues in becoming a fiction writer. Studies in Continuing Education, 36(2), 173-187.
Ryan, R. &, Deci, E. (2000). Intrinsic and extrinsic motivations: Classic definitions and new directions, Contemporary Educational Psychology, 25, 54-57.
Posted by Scott Powers at 8:59 PM
Labels: Writing


Helpful, quick, and fair. I was able to get a great car and neither the owner nor anyone else there treated me like I didn't know what I was doing (other 20-something females who have ever bought a car on their own might understand.) They offered a warranty, even on an older vehicle and the car is running great. Car was totally clean and had just had routine maintenance done on it when I picked it up. Very happy with my experience.
I got my last two cars from this place and the guys who work there really made the whole thing very easy and fun,,were going to be family for a long time,you gotta check it out for yourself.


Post Production is underway for new features as well as another season for BoundheatAFterDark.com site. Our Lesbian Mistresses will keep those gorgeous teen slaves in line!
And remember, good things will come to those who wait.
getting hotter,...... and hotter,...... and coming soon!


Yep, Will Smith is Lucifer. And he hangs out in a weird chamber under the sewers of New York, waiting for demons like Pearly (Russell Crowe) to come visit him and give him status updates on whether or not they're preventing people from falling in true love. On the other side, Rafe McCawley from Defiance is busy dispensing old timey wisdom about magic horses to Colin Farrell, who's rocking a succession of terrible hairstyles.
Anyway, this moment, in which Will Smith totally just goes for it as an imprisoned, pissed-off Lucifer, is the one part of the movie that actually stuck in my mind afterwards. If the whole movie had been like this, it would at least have been a weirdly entertaining crazy "B" movie, along the lines of Legion or something. Anyway, enjoy.


#SPB got a chance to visit INFINITY Bridal Salon, which recently opened its doors to Isloo-ites in F-11. How was our experience... Read More To Reveal More!!!
I was over-whelmed by the interior but the amazing services won me over. Mr. Sahil the owner of the Salon is very clear about his notion on providing the best services in affordable price plus a proper hygienic experience along with the use of only quality products. Ms. Soni the partner-owner of the Infinity Bridal Salon, is a sweet smiling lady, who personally take care of every client and give attention and guide as well. She has her beauty training from London School of beauty. So at Infinity Salon you won't experience any compromise over Hygiene, quality and prices. Great!
The staff is very friendly, co-operative, and well trained. Only quality products are used, in hair they use L'Oreal Professionnel Paris (colour and treatments), for skin its Thalgo and Janssen, for mani/pedi they use Essie and The Body Shop.
I chose to have a hair treatment for my bad-behaving hair, a facial for my skin, badly under weather influence and a hair makeover.
First I was taken to the facial room, which was small but well airy and secured (you know what I mean). There was a rack and cabinet for cloth storing. I was provided with a gown and privacy to change into it. The facial Ms. Soni recommended me was Thalgo Brightening facial a little customized for my sensitive skin. The procedure was done by Aasma. I must say that this facial was the most relaxing facial I have ever had, with all that neck, shoulder and head massages included in the 1 hour long procedure, I almost slept. I loved it as I was sure that I am treated with high-quality brand plus for every step brand new tools, like Sponges and blackhead remover was used and then discarded in front of me. Winner!
Then I went to the hair section and after a detailed consultation I finalized for highlights on my crown (ear to ear) in two shades Blonde and Ash (9.1 and 8.1). This procedure took 45 minutes and tada I got my desired hair makeover. Taania, the girl who dyed my hair was well trained and guided me through, plus she listened to me.
I was given L'Oreal Professionnel Paris Fiberceutic hair treatment for my dull, life-less and dry hair, as recommended by Ms. Soni. After the treatment I could feel a drastic change in my hair.
I left the Salon happy, contended and satisfied! What a relaxing experience I had, can't wait to re-visit the lovely team of Infinity Salon soon.
Follow Infinity Bridal Salon & Academy on FaceBook.
Here is the address details for you all, this place is a must visit and I highly recommend it!
Follow #SPBatInfinity on Instagram, Facebook and Twitter.


text:
php -d memory_limit=1024M app/console cache:clear --env=dev
php -d memory_limit=1024M app/console cache:clear --env=prod