text:
// HTMLParser Library - A java-based parser for HTML
// http://htmlparser.org
// Copyright (C) 2006 Derrick Oswald
//
// Revision Control Information
//
// $URL: https://svn.sourceforge.net/svnroot/htmlparser/trunk/lexer/src/main/java/org/htmlparser/http/ConnectionManager.java $
// $Author: derrickoswald $
// $Date: 2006-09-16 10:44:17 -0400 (Sat, 16 Sep 2006) $
// $Revision: 4 $
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the Common Public License; either
// version 1.0 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// Common Public License for more details.
//
// You should have received a copy of the Common Public License
// along with this library; if not, the license is available from
// the Open Source Initiative (OSI) website:
//   http://opensource.org/licenses/cpl1.0.php

package org.htmlparser.http;

import java.io.File;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import java.net.UnknownHostException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Properties;
import java.util.StringTokenizer;
import java.util.Vector;

import org.htmlparser.util.ParserException;

/**
 * Handles proxies, password protected URLs and request properties
 * including cookies.
 */
public class ConnectionManager
{
    /**
     * Default Request header fields.
     * So far this is just "User-Agent" and "Accept-Encoding".
     */
    protected static Hashtable mDefaultRequestProperties = new Hashtable ();
    static
    {
        mDefaultRequestProperties.put ("User-Agent", "HTMLParser/"
            + org.htmlparser.lexer.Lexer.VERSION_NUMBER);
        mDefaultRequestProperties.put ("Accept-Encoding", "gzip, deflate");
    }

    /**
     * Messages for page not there (404).
     */
    private static final String[] FOUR_OH_FOUR =
    {
        "The web site you seek cannot be located,"
            + " but countless more exist",
        "You step in the stream, but the water has moved on."
            + " This page is not here.",
        "Yesterday the page existed. Today it does not."
            + " The internet is like that.",
        "That page was so big. It might have been very useful."
            + " But now it is gone.",
        "Three things are certain: death, taxes and broken links."
            + " Guess which has occured.",
        "Chaos reigns within. Reflect, repent and enter the correct URL."
            + " Order shall return.",
        "Stay the patient course. Of little worth is your ire."
            + " The page is not found.",
        "A non-existant URL reduces your expensive computer to a simple stone.",
        "Many people have visited that page."
            + " Today, you are not one of the lucky ones.",
        "Cutting the wind with a knife. Bookmarking a URL."
            + " Both are ephemeral.",
    };

    /**
     * Base 64 character translation table.
     */
    private static final char[] BASE64_CHAR_TABLE =
         ("ABCDEFGHIJKLMNOPQRSTUVWXYZ"
        + "abcdefghijklmnopqrstuvwxyz0123456789+/").toCharArray ();

    /**
     * Request header fields.
     */
    protected Hashtable mRequestProperties;

    /**
     * The proxy server name.
     */
    protected String mProxyHost;

    /**
     * The proxy port number.
     */
    protected int mProxyPort;

    /**
     * The proxy username name.
     */
    protected String mProxyUser;

    /**
     * The proxy user password.
     */
    protected String mProxyPassword;

    /**
     * The username name for accessing the URL.
     */
    protected String mUser;

    /**
     * The user password for accessing the URL.
     */
    protected String mPassword;

    /**
     * Cookie storage, a hashtable (by site or host) of vectors of Cookies.
     * This will be null if cookie processing is disabled (default).
     */
    protected Hashtable mCookieJar;

    /**
     * The object to be notified prior to and after each connection.
     */
    protected ConnectionMonitor mMonitor;

    /**
     * Flag determining if redirection processing is being handled manually.
     */
    protected boolean mRedirectionProcessingEnabled;

    /**
     * Cookie expiry date format for parsing.
     */
    static protected SimpleDateFormat mFormat =
        new SimpleDateFormat ("EEE, dd-MMM-yy kk:mm:ss z");

    /**
     * Create a connection manager.
     */
    public ConnectionManager ()
    {
        this (getDefaultRequestProperties ());
    }

    /**
     * Create a connection manager with the given connection properties.
     * @param properties Name/value pairs to be added to the HTTP request.
     */
    public ConnectionManager (Hashtable properties)
    {
        mRequestProperties = properties;
        mProxyHost = null;
        mProxyPort = 0;
        mProxyUser = null;
        mProxyPassword = null;
        mUser = null;
        mPassword = null;
        mCookieJar = null;
        mMonitor = null;
        mRedirectionProcessingEnabled = false;
    }

    //
    // static methods
    //

    /**
     * Get the current default request header properties.
     * A String-to-String map of header keys and values.
     * These fields are set by the parser when creating a connection.
     * @return The default set of request header properties that will
     * currently be used.
     * @see #mDefaultRequestProperties
     * @see #setRequestProperties
     */
    public static Hashtable getDefaultRequestProperties ()
    {
        return (mDefaultRequestProperties);
    }

    /**
     * Set the default request header properties.
     * A String-to-String map of header keys and values.
     * These fields are set by the parser when creating a connection.
     * Some of these can be set directly on a URLConnection,
     * i.e. If-Modified-Since is set with setIfModifiedSince(long),
     * but since the parser transparently opens the connection on behalf
     * of the developer, these properties are not available before the
     * connection is fetched. Setting these request header fields affects all
     * subsequent connections opened by the parser. For more direct control
     * create a URLConnection massage it the way you want and
     * then set it on the parser.

     * From
     * RFC 2616 Hypertext Transfer Protocol -- HTTP/1.1:
     *

     * 5.3 Request Header Fields
     *
     *    The request-header fields allow the client to pass additional
     *    information about the request, and about the client itself, to the
     *    server. These fields act as request modifiers, with semantics
     *    equivalent to the parameters on a programming language method
     *    invocation.
     *
     *        request-header = Accept                   ; Section 14.1
     *                       | Accept-Charset           ; Section 14.2
     *                       | Accept-Encoding          ; Section 14.3
     *                       | Accept-Language          ; Section 14.4
     *                       | Authorization            ; Section 14.8
     *                       | Expect                   ; Section 14.20
     *                       | From                     ; Section 14.22
     *                       | Host                     ; Section 14.23
     *                       | If-Match                 ; Section 14.24
     *                       | If-Modified-Since        ; Section 14.25
     *                       | If-None-Match            ; Section 14.26
     *                       | If-Range                 ; Section 14.27
     *                       | If-Unmodified-Since      ; Section 14.28
     *                       | Max-Forwards             ; Section 14.31
     *                       | Proxy-Authorization      ; Section 14.34
     *                       | Range                    ; Section 14.35
     *                       | Referer                  ; Section 14.36
     *                       | TE                       ; Section 14.39
     *                       | User-Agent               ; Section 14.43
     *
     *    Request-header field names can be extended reliably only in
     *    combination with a change in the protocol version. However, new or
     *    experimental header fields MAY be given the semantics of request-
     *    header fields if all parties in the communication recognize them to
     *    be request-header fields. Unrecognized header fields are treated as
     *    entity-header fields.
     *

     * @param properties The new set of default request header properties to
     * use. This affects all subsequently created connections.
     * @see #mDefaultRequestProperties
     * @see #setRequestProperties
     */
    public static void setDefaultRequestProperties (Hashtable properties)
    {
        mDefaultRequestProperties = properties;
    }

    /**
     * Get the current request header properties.
     * A String-to-String map of header keys and values,
     * excluding proxy items, cookies and URL authorization.
     * @return The request header properties for this connection manager.
     */
    public Hashtable getRequestProperties ()
    {
        return (mRequestProperties);
    }

    /**
     * Set the current request properties.
     * Replaces the current set of fixed request properties with the given set.
     * This does not replace the Proxy-Authorization property which is
     * constructed from the values of {@link #setProxyUser}
     * and {@link #setProxyPassword} values or the Authorization property
     * which is constructed from the {@link #setUser}
     * and {@link #setPassword} values. Nor does it replace the
     * Cookie property which is constructed from the current cookie jar.
     * @param properties The new fixed properties.
     */
    public void setRequestProperties (Hashtable properties)
    {
        mRequestProperties = properties;
    }

    /**
     * Get the proxy host name, if any.
     * @return Returns the proxy host.
     */
    public String getProxyHost ()
    {
        return (mProxyHost);
    }

    /**
     * Set the proxy host to use.
     * @param host The host to use for proxy access.
     * Note: You must also set the proxy {@link #setProxyPort port}.
     */
    public void setProxyHost (String host)
    {
        mProxyHost = host;
    }

    /**
     * Get the proxy port number.
     * @return Returns the proxy port.
     */
    public int getProxyPort ()
    {
        return (mProxyPort);
    }

    /**
     * Set the proxy port number.
     * @param port The proxy port.
     * Note: You must also set the proxy {@link #setProxyHost host}.
     */
    public void setProxyPort (int port)
    {
        mProxyPort = port;
    }

    /**
     * Get the user name for proxy authorization, if any.
     * @return Returns the proxy user,
     * or null if no proxy authorization is required.
     */
    public String getProxyUser ()
    {
        return (mProxyUser);
    }

    /**
     * Set the user name for proxy authorization.
     * @param user The proxy user name.
     * Note: You must also set the proxy {@link #setProxyPassword password}.
     */
    public void setProxyUser (String user)
    {
        mProxyUser = user;
    }

    /**
     * Set the proxy user's password.
     * @return Returns the proxy password.
     */
    public String getProxyPassword ()
    {
        return (mProxyPassword);
    }

    /**
     * Get the proxy user's password.
     * @param password The password for the proxy user.
     * Note: You must also set the proxy {@link #setProxyUser user}.
     */
    public void setProxyPassword (String password)
    {
        mProxyPassword = password;
    }

    /**
     * Get the user name to access the URL.
     * @return Returns the username that will be used to access the URL,
     * or null if no authorization is required.
     */
    public String getUser ()
    {
        return (mUser);
    }

    /**
     * Set the user name to access the URL.
     * @param user The user name for accessing the URL.
     * Note: You must also set the {@link #setPassword password}.
     */
    public void setUser (String user)
    {
        mUser = user;
    }

    /**
     * Get the URL users's password.
     * @return Returns the URL password.
     */
    public String getPassword ()
    {
        return (mPassword);
    }

    /**
     * Set the URL users's password.
     * @param password The password for the URL.
     */
    public void setPassword (String password)
    {
        mPassword = password;
    }

    /**
     * Predicate to determine if cookie processing is currently enabled.
     * @return true if cookies are being processed.
     */
    public boolean getCookieProcessingEnabled ()
    {
        return (null != mCookieJar);
    }

    /**
     * Enables and disabled cookie processing.
     * @param enable if true cookie processing will occur,
     * else cookie processing will be turned off.
     */
    public void setCookieProcessingEnabled (boolean enable)
    {
        if (enable)
            mCookieJar = (null == mCookieJar) ? new Hashtable () : mCookieJar;
        else
            mCookieJar = null;
    }

    /**
     * Adds a cookie to the cookie jar.
     * @param cookie The cookie to add.
     * @param domain The domain to use in case the cookie has no domain attribute.
     */
    public void setCookie (Cookie cookie, String domain)
    {
        String path;
        Vector cookies;
        Cookie probe;
        boolean found; // flag if a cookie with current name is already there

        if (null != cookie.getDomain ())
            domain = cookie.getDomain ();
        path = cookie.getPath ();
        if (null == mCookieJar)
            mCookieJar = new Hashtable (); // turn on cookie processing
        cookies = (Vector)mCookieJar.get (domain);
        if (null != cookies)
        {
            found = false;
            for (int j = 0; j < cookies.size (); j++)
            {
                probe = (Cookie)cookies.elementAt (j);
                if (probe.getName ().equalsIgnoreCase (cookie.getName ()))
                {
                    // we keep paths sorted most specific to least
                    if (probe.getPath ().equals (path))
                    {
                        cookies.setElementAt (cookie, j); // replace
                        found = true; // cookie found, set flag
                        break;
                    }
                    else if (path.startsWith (probe.getPath ()))
                    {
                        cookies.insertElementAt (cookie, j);
                        found = true; // cookie found, set flag
                        break;
                    }
                }
            }
            if (!found)
                // there's no cookie with the current name, therefore it's added
                // at the end of the list (faster then inserting at the front)
                cookies.addElement (cookie);
        }
        else
        {   // new cookie list needed
            cookies = new Vector ();
            cookies.addElement (cookie);
            mCookieJar.put (domain, cookies);
        }
    }

    /**
     * Get the monitoring object, if any.
     * @return Returns the monitor, or null if none has been assigned.
     */
    public ConnectionMonitor getMonitor ()
    {
        return (mMonitor);
    }

    /**
     * Set the monitoring object.
     * @param monitor The monitor to set.
     */
    public void setMonitor (ConnectionMonitor monitor)
    {
        mMonitor = monitor;
    }

    /**
     * Predicate to determine if url redirection processing is currently enabled.
     * @return true if redirection is being processed manually.
     * @see #setRedirectionProcessingEnabled
     */
    public boolean getRedirectionProcessingEnabled ()
    {
        return (mRedirectionProcessingEnabled);
    }

    /**
     * Enables or disables manual redirection handling.
     * Normally the HttpURLConnection follows redirections
     * (HTTP response code 3xx) automatically if the
     * followRedirects property is true.
     * With this flag set the ConnectionMonitor performs the
     * redirection processing; The advantage being that cookies (if enabled)
     * are passed in subsequent requests.
     * @param enabled The new state of the redirectionProcessingEnabled property.
     */
    public void setRedirectionProcessingEnabled (boolean enabled)
    {
        mRedirectionProcessingEnabled = enabled;
    }

    /**
     * Get the Location field if any.
     * @param http The connection to get the location from.
     */
    protected String getLocation (HttpURLConnection http)
    {
        String key;
        String value;
        String ret;

        ret = null;

        for (int i = 0; ((null == ret) && (null != (value = http.getHeaderField (i)))); i++)
            if ((null != (key = http.getHeaderFieldKey (i))) && (key.equalsIgnoreCase ("Location")))
                ret = value;

        return (ret);
    }

    /**
     * Opens a connection using the given url.
     * @param url The url to open.
     * @return The connection.
     * @exception ParserException if an i/o exception occurs accessing the url.
     */
    public URLConnection openConnection (URL url)
        throws
            ParserException
    {
        boolean repeat;
        int repeated;
        Properties sysprops;
        Hashtable properties;
        Enumeration enumeration;
        String key;
        String value;
        String set = null; // old proxySet value
        String host = null; // old proxyHost value
        String port = null; // old proxyPort value
        String host2 = null; // old http.proxyHost value
        String port2 = null; // old http.proxyPort value
        HttpURLConnection http;
        String auth;
        String encoded;
        int code;
        String uri;
        URLConnection ret;

        repeated = 0;
        do
        {
            repeat = false;
            try
            {
                try
                {
                    // set up for proxy
                    if ((null != getProxyHost ()) && (0 != getProxyPort ()))
                    {
                        sysprops = System.getProperties ();
                        set = (String)sysprops.put ("proxySet", "true");
                        host = (String)sysprops.put ("proxyHost", getProxyHost ());
                        port = (String)sysprops.put ("proxyPort",
                            Integer.toString (getProxyPort ()));
                        // see http://java.sun.com/j2se/1.4.2/docs/guide/net/properties.html
                        host2 = (String)sysprops.put ("http.proxyHost",
                            getProxyHost ());
                        port2 = (String)sysprops.put ("http.proxyPort",
                            Integer.toString (getProxyPort ()));
                        System.setProperties (sysprops);

                    }

                    // open the connection... but don't connect yet
                    ret = url.openConnection ();
                    if (ret instanceof HttpURLConnection)
                    {
                        http = (HttpURLConnection)ret;

                        if (getRedirectionProcessingEnabled ())
                            http.setInstanceFollowRedirects (false);

                        // set the fixed request properties
                        properties = getRequestProperties ();
                        if (null != properties)
                            for (enumeration = properties.keys ();
                                    enumeration.hasMoreElements ();)
                            {
                                key = (String)enumeration.nextElement ();
                                value = (String)properties.get (key);
                                ret.setRequestProperty (key, value);
                            }

                        // set the proxy name and password
                        if ((null != getProxyUser ())
                            && (null != getProxyPassword ()))
                        {
                            auth = getProxyUser () + ":" + getProxyPassword ();
                            encoded = encode (auth.getBytes("ISO-8859-1"));
                            ret.setRequestProperty ("Proxy-Authorization", encoded);
                        }

                        // set the URL name and password
                        if ((null != getUser ()) && (null != getPassword ()))
                        {
                            auth = getUser () + ":" + getPassword ();
                            encoded = encode (auth.getBytes("ISO-8859-1"));
                            ret.setRequestProperty ("Authorization",
                                "Basic " + encoded);
                        }

                        if (getCookieProcessingEnabled ())
                            // set the cookies based on the url
                            addCookies (ret);

                        if (null != getMonitor ())
                            getMonitor ().preConnect (http);
                    }
                    else
                        http = null;

                    try
                    {
                        ret.connect ();

                        if (null != http)
                        {
                            if (null != getMonitor ())
                                getMonitor ().postConnect (http);

                            if (getCookieProcessingEnabled ())
                                parseCookies (ret);

                            code = http.getResponseCode ();
                            if ((3 == (code / 100)) && (repeated < 20))
                                if (null != (uri = getLocation (http)))
                                {
                                    url = new URL (uri);
                                    repeat = true;
                                    repeated++;
                                }
                        }
                    }
                    catch (UnknownHostException uhe)
                    {
                        int message = (int)(Math.random () * FOUR_OH_FOUR.length);
                        throw new ParserException (FOUR_OH_FOUR[message], uhe);
                    }
                    catch (IOException ioe)
                    {
                        throw new ParserException (ioe.getMessage (), ioe);
                    }
                }
                finally
                {
                    if ((null != getProxyHost ()) && (0 != getProxyPort ()))
                    {
                        sysprops = System.getProperties ();
                        if (null != set)
                            sysprops.put ("proxySet", set);
                        else
                            sysprops.remove ("proxySet");
                        if (null != host)
                            sysprops.put ("proxyHost", host);
                        else
                            sysprops.remove ("proxyHost");
                        if (null != port)
                            sysprops.put ("proxyPort", port);
                        else
                            sysprops.remove ("proxyPort");
                        if (null != host2)
                            sysprops.put ("http.proxyHost", host2);
                        else
                            sysprops.remove ("http.proxyHost");
                        if (null != port2)
                            sysprops.put ("http.proxyPort", port2);
                        else
                            sysprops.remove ("http.proxyPort");
                        System.setProperties (sysprops);
                    }
                }
            }
            catch (IOException ioe)
            {
                String msg = "Error in opening a connection to "
                    + url.toExternalForm ();
                ParserException ex = new ParserException (msg, ioe);
                throw ex;
            }
        }
        while (repeat);

        return (ret);
    }

    /**
     * Encodes a byte array into BASE64 in accordance with
     * RFC 2045.
     * @param array The bytes to convert.
     * @return A BASE64 encoded string.
     */
    public final static String encode (byte[] array)
    {
        int last; // last byte
        int count; // character count
        int separators; // line separator count
        int length; // length of returned string
        char[] encoded; // encoded characters
        int left; // bytes left
        int end;
        int block; // encoding buffer
        int r; // shift count
        int n; // byte to encode
        int index; // index into output array
        String ret;

        if ((null != array) && (0 != array.length))
        {
            last = array.length - 1;
            count = (last / 3 + 1) << 2;
            separators = (count - 1) / 76;
            length = count + separators;
            encoded = new char[length];
            index = 0;
            separators = 0;
            for (int i = 0; i <= last; i += 3)
            {
                left = last - i;
                end = (left > 1 ? 2 : left);

                // collect 1 to 3 bytes to encode
                block = 0;
                r = 16;
                for (int j = 0; j <= end; j++)
                {
                    n = array[i + j];
                    block += (n < 0 ? n + 256 : n) << r;
                    r -= 8;
                }

                // encode into 2-4 chars padding with '=' if no data left
                encoded[index++] = BASE64_CHAR_TABLE[(block >>> 18) & 0x3f];
                encoded[index++] = BASE64_CHAR_TABLE[(block >>> 12) & 0x3f];
                encoded[index++] = left > 0 ?
                    BASE64_CHAR_TABLE[(block >>> 6) & 0x3f] :
                    '=';
                encoded[index++] = left > 1 ?
                    BASE64_CHAR_TABLE[block & 0x3f] :
                    '=';

                if ((0 == (index - separators) % 76) && (index < length))
                {
                    encoded[index++] = '\n';
                    separators += 1;
                }
            }
            ret = new String (encoded);
        }
        else
            ret = "";

        return (ret);
    }

    /**
     * Turn spaces into %20.
     * ToDo: make this more generic
     * (see RFE #1010593 provide URL encoding/decoding utilities).
     * @param url The url containing spaces.
     * @return The URL with spaces as %20 sequences.
     */
    public String fixSpaces (String url)
    {
        int index;
        int length;
        char ch;
        StringBuffer buffer;

        index = url.indexOf (' ');
        if (-1 != index)
        {
            length = url.length ();
            buffer = new StringBuffer (length * 3);
            buffer.append (url.substring (0, index));
            for (int i = index; i < length; i++)
            {
                ch = url.charAt (i);
                if (ch==' ')
                    buffer.append ("%20");
                else
                    buffer.append (ch);
            }
            url = buffer.toString ();
        }

        return (url);
    }

    /**
     * Opens a connection based on a given string.
     * The string is either a file, in which case file://localhost
     * is prepended to a canonical path derived from the string, or a url that
     * begins with one of the known protocol strings, i.e. http://.
     * Embedded spaces are silently converted to %20 sequences.
     * @param string The name of a file or a url.
     * @return The connection.
     * @exception ParserException if the string is not a valid url or file.
     */
    public URLConnection openConnection (String string)
        throws
            ParserException
    {
        final String prefix = "file://localhost";
        String resource;
        URL url;
        StringBuffer buffer;
        URLConnection ret;

        try
        {
            url = new URL (fixSpaces (string));
            ret =  openConnection (url);
        }
        catch (MalformedURLException murle)
        {   // try it as a file
            try
            {
                File file = new File (string);
                resource = file.getCanonicalPath ();
                buffer = new StringBuffer (prefix.length ()
                    + resource.length ());
                buffer.append (prefix);
                if (!resource.startsWith ("/"))
                    buffer.append ("/");
                buffer.append (resource);
                url = new URL (fixSpaces (buffer.toString ()));
                ret = openConnection (url);
            }
            catch (MalformedURLException murle2)
            {
                String msg = "Error in opening a connection to " + string;
                ParserException ex = new ParserException (msg, murle2);
                throw ex;
            }
            catch (IOException ioe)
            {
                String msg = "Error in opening a connection to " + string;
                ParserException ex = new ParserException (msg, ioe);
                throw ex;
            }
        }

        return (ret);
    }

    /**
     * Generate a HTTP cookie header value string from the cookie jar.
     *

     *   The syntax for the header is:
     *
     *    cookie          =       "Cookie:" cookie-version
     *                            1*((";" | ",") cookie-value)
     *    cookie-value    =       NAME "=" VALUE [";" path] [";" domain]
     *    cookie-version  =       "$Version" "=" value
     *    NAME            =       attr
     *    VALUE           =       value
     *    path            =       "$Path" "=" value
     *    domain          =       "$Domain" "=" value
     *
     *

     * @param connection The connection being accessed.
     * @see RFC 2109
     * @see RFC 2396
     */
    public void addCookies (URLConnection connection)
    {
        Vector list;
        URL url;
        String host;
        String path;
        String domain;

        if (null != mCookieJar)
        {
            list = null;
            // get the site from the URL
            url = connection.getURL ();
            host = url.getHost ();
            path = url.getPath ();
            if (0 == path.length ())
                path = "/";
            if (null != host)
            {   // http://www.objectsdevelopment.com/portal/modules/freecontent/content/javawebserver.html
                list = addCookies ((Vector)mCookieJar.get (host), path, list);
                domain = getDomain (host);
                if (null != domain)
                    list = addCookies ((Vector)mCookieJar.get (domain),
                        path, list);
                else
                    // maybe it is the domain we're accessing
                    list = addCookies ((Vector)mCookieJar.get ("." + host),
                        path, list);
            }
            if (null != list)
                connection.setRequestProperty ("Cookie",
                    generateCookieProperty (list));
        }
    }

    /**
     * Add qualified cookies from cookies into list.
     * @param cookies The list of cookies to check (may be null).
     * @param path The path being accessed.
     * @param list The list of qualified cookies.
     * @return The list of qualified cookies.
     */
    protected Vector addCookies (Vector cookies, String path, Vector list)
    {
        Cookie cookie;
        Date expires;
        Date now;

        if (null != cookies)
        {
            now = new Date ();
            for (int i = 0; i < cookies.size (); i++)
            {
                cookie = (Cookie)cookies.elementAt (i);
                expires = cookie.getExpiryDate ();
                if ((null != expires) && expires.before (now))
                {
                    cookies.remove (i);
                    i--; // dick with the loop variable
                }
                else
                    if (path.startsWith (cookie.getPath ()))
                    {
                        if (null == list)
                            list = new Vector ();
                        list.addElement (cookie);
                    }
            }
        }

        return (list);
    }

    /**
     * Get the domain from a host.
     * @param host The supposed host name.
     * @return The domain (with the leading dot),
     * or null if the domain cannot be determined.
     */
    protected String getDomain (String host)
    {
        StringTokenizer tokenizer;
        int count;
        String server;
        int length;
        boolean ok;
        char c;
        String ret;

        ret = null;

        tokenizer = new StringTokenizer (host, ".");
        count = tokenizer.countTokens ();
        if (3 <= count)
        {
            // have at least two dots,
            // check if we were handed an IP address by mistake
            length = host.length ();
            ok = false;
            for (int i = 0; i < length && !ok; i++)
            {
                c = host.charAt (i);
                if (!(Character.isDigit (c) || (c == '.')))
                    ok = true;
            }
            if (ok)
            {
                // so take everything after the first token
                server = tokenizer.nextToken ();
                length = server.length ();
                ret = host.substring (length);
            }
        }

        return (ret);
    }

    /**
     * Creates the cookie request property value from the list of
     * valid cookies for the domain.
     * @param cookies The list of valid cookies to be encoded in the request.
     * @return A string suitable for inclusion as the value of
     * the "Cookie:" request property.
     */
    protected String generateCookieProperty (Vector cookies)
    {
        int version;
        Cookie cookie;
        StringBuffer buffer;
        String ret;

        ret = null;

        buffer = new StringBuffer ();
        version = 0;
        for (int i = 0; i < cookies.size (); i++)
            version = Math.max (version,
                ((Cookie)cookies.elementAt (i)).getVersion ());
        if (0 != version)
        {
            buffer.append ("$Version=\"");
            buffer.append (version);
            buffer.append ("\"");
        }
        for (int i = 0; i < cookies.size (); i++)
        {
            cookie = (Cookie)cookies.elementAt (i);
            if (0 != buffer.length ())
                buffer.append ("; ");
            buffer.append (cookie.getName ());
            buffer.append (cookie.getName ().equals ("") ? "" : "=");
            if (0 != version)
                buffer.append ("\"");
            buffer.append (cookie.getValue ());
            if (0 != version)
                buffer.append ("\"");
            if (0 != version)
            {
                if ((null != cookie.getPath ())
                    && (0 != cookie.getPath ().length ()))
                {
                    buffer.append ("; $Path=\"");
                    buffer.append (cookie.getPath ());
                    buffer.append ("\"");
                }
                if ((null != cookie.getDomain ())
                    && (0 != cookie.getDomain ().length ()))
                {
                    buffer.append ("; $Domain=\"");
                    buffer.append (cookie.getDomain ());
                    buffer.append ("\"");
                }
            }
        }
        if (0 != buffer.length ())
            ret = buffer.toString ();

        return (ret);
    }

    /**
     * Check for cookie and parse into cookie jar.
     * @param connection The connection to extract cookie information from.
     */
    public void parseCookies (URLConnection connection)
    {
        String string;
        Vector cookies;
        StringTokenizer tokenizer;
        String token;
        int index;
        String name;
        String key;
        String value;
        Cookie cookie;

        string = connection.getHeaderField ("Set-Cookie");
        if (null != string)
        {
//            set-cookie      =       "Set-Cookie:" cookies
//            cookies         =       1#cookie
//            cookie          =       NAME "=" VALUE *(";" cookie-av)
//            NAME            =       attr
//            VALUE           =       value
//            cookie-av       =       "Comment" "=" value
//                            |       "Domain" "=" value
//                            |       "Max-Age" "=" value
//                            |       "Path" "=" value
//                            |       "Secure"
//                            |       "Version" "=" 1*DIGIT
            cookies = new Vector ();
            tokenizer = new StringTokenizer (string, ";,", true);
            cookie = null;
            while (tokenizer.hasMoreTokens ())
            {
                token = tokenizer.nextToken ().trim ();
                if (token.equals (";"))
                    continue;
                else if (token.equals (","))
                {
                    cookie = null;
                    continue;
                }

                index = token.indexOf ('=');
                if (-1 == index)
                {
                    if (null == cookie)
                    {   // an unnamed cookie
                        name = "";
                        value = token;
                        key = name;
                    }
                    else
                    {
                        name = token;
                        value = null;
                        key = name.toLowerCase ();
                    }
                }
                else
                {
                    name = token.substring (0, index);
                    value = token.substring (index + 1);
                    key = name.toLowerCase ();
                }

                if (null == cookie)
                {
                    try
                    {
                        cookie = new Cookie (name, value);
                        cookies.addElement (cookie);
                    }
                    catch (IllegalArgumentException iae)
                    {
                        // should print a warning
                        // for now just bail
                        break;
                    }
                }
                else
                {
                    if (key.equals ("expires")) // Wdy, DD-Mon-YY HH:MM:SS GMT
                    {
                        String comma = tokenizer.nextToken ();
                        String rest = tokenizer.nextToken ();
                        try
                        {
                            Date date = mFormat.parse (value + comma + rest);
                            cookie.setExpiryDate (date);
                        }
                        catch (ParseException pe)
                        {
                            // ok now what
                            cookie.setExpiryDate (null);
                        }
                    }
                    else
                        if (key.equals ("domain"))
                            cookie.setDomain (value);
                        else
                            if (key.equals ("path"))
                                cookie.setPath (value);
                            else
                                if (key.equals ("secure"))
                                    cookie.setSecure (true);
                                else
                                    if (key.equals ("comment"))
                                        cookie.setComment (value);
                                    else
                                        if (key.equals ("version"))
                                            cookie.setVersion (
                                                Integer.parseInt (value));
                                        else
                                            if (key.equals ("max-age"))
                                            {
                                                Date date = new Date ();
                                                long then = date.getTime ()
                                                + Integer.parseInt (value)
                                                * 1000;
                                                date.setTime (then);
                                                cookie.setExpiryDate (date);
                                            }
                                            else
                                                // error,? unknown attribute,
                                                // maybe just another cookie
                                                // not separated by a comma
                                                try
                                                {
                                                    cookie = new Cookie (name,
                                                        value);
                                                    cookies.addElement (cookie);
                                                }
                                                catch (IllegalArgumentException iae)
                                                {
                                                    // should print a warning
                                                    // for now just bail
                                                    break;
                                                }
                }
           }
           if (0 != cookies.size ())
               saveCookies (cookies, connection);
        }
    }

    /**
     * Save the cookies received in the response header.
     * @param list The list of cookies extracted from the response header.
     * @param connection The connection (used when a cookie has no domain).
     */
    protected void saveCookies (Vector list, URLConnection connection)
    {
        Cookie cookie;
        String domain;

        for (int i = 0; i < list.size (); i++)
        {
            cookie = (Cookie)list.elementAt (i);
            domain = cookie.getDomain ();
            if (null == domain)
                domain = connection.getURL ().getHost ();
            setCookie (cookie, domain);
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
« Good Stuff | Main | Simplicity »
Influencing Pop Culture
I just stumbled upon a really good interview with Alex Bogusky administered by the New Denver Ad Club earlier this year. Check it out here.
One of Alex's sound bites that I found particularly inspiring was a comment made about shaping pop culture. I think it's something we can all learn from.
The question surrounded how CP+B, as an agency, penetrates pop culture so effectively with its campaigns for truth, Burger King and more... How is it possible for brands to change and shape pop culture?
Alex: Pop culture has only one job, and that is to constantly change. It wants to change. It needs to change. And it changes everyday.
Of course... the door is always open and it's open to anyone. Hearing that was one of those duh obvious moments where you say to yourself, "why didn't I phrase it like that?" He's right. Pop culture rises and falls and there's no real rhyme or reason to it. It's ever-changing and the important thing is to participate.
But what makes some things catch on in pop culture, while others pass by unnoticed? Who can know such things for sure?? But for collective debate and commentary, below are three things that are probably at work:
1. A unique twist on something common or mundane.
Take something you see everyday, now apply a new filter to it. Twist it in some new way. Add something to it. Make people feel kinda silly for never looking at something so common in the way you see it.
2. It doesn't really mean anything.
When you peel pack the surface and ask, "why," there's no universal answer. One single movement could stand for such diverse things as politics, fun or individuality, depending on who you ask. It just "is."
3. It's sharable, but not totally describable.
Try articulating Warhol's work for a minute or two... How'd that go? Like the paintings of the king himself, things that become part of pop culture can be described in such a way that people are intrigued, but their exact existence can't totally be re-created by word of mouth. This quality makes it so people must come in contact with the item and deduce their own feelings (see #2 again).
That's my view. I'd love to hear from those more in-tune than I... calling social-creature, luke stetson and whoever else....
Alex's comment was freeing to me. Internalizing the idea that pop culture is something that's constantly changing is liberating. It means everyone is invited and that effecting pop culture is not just for the sneaker heads, the cool hunters, the musicians and the artists of the world.
The stage is open for everyone...it's just that very few really try.
November 20, 2007 | Permalink
that was so incredibly fascinating! thanks for turning me on to those interview videos. i just watched them both. really cool stuff! (plus, having once managed a circus, i totally vibe on the whole p.t. barnum as hero concept ;) ).
to overlook advertising's role in influencing culture is, indeed, to miss all the fun. there's a great faith popcorn quote that i rip off all the time, "culture is the new media." and it's also not one standard "pop culture," but the different "channels" of all sorts of different lifestyles. this is where the transmission of the values, aesthetics, ideals, etc. that define identity and community come from.
for a brand to *create* culture is to become a part of that transmission itself.
i actually wrote a bit on the topic here:
http://social-creature.com/create-culture
altho after watching those videos, i'm getting ideas for a whole new level of beadth of the application of this concept.
and by the way.... while whether or not sneakerheads actually create pop culture is debatable, that they do not do it in a vaccum outside of the influence of the brand is certain:
http://online.wsj.com/article/SB119317864699068959-email.html
Posted by: jenka | November 22, 2007 at 01:14 AM

redpajama_set_name: RedPajamaCommonCrawl


text:
COMMISSIONS: (over 150 commissions)
o Oklahoma Centennial Land Run, (365' long; 45 life and a half elements), Bronze, Commissioned by the State of Oklahoma, Federal Government, and the City of Oklahoma City, placed at Bricktown, Oklahoma City, OK, Completed element #45 (final piece, 20 year project). Installed #44 and #45.
o James Duit, bronze bust, Duit Constriction, Edmond, OK, unveiled May 3, 2019.
o Fred Jones, (life-size bust and maquette), Fred Jones family, Oklahoma City, OK, 2019.
o Commander Ernest Evans, Medal of Honor Recipient, Navy WW2, (life-size bust), 2019.
o Oklahoma Centennial Land Run, (365' long; 45 life and a half elements), Bronze, Commissioned by the State of Oklahoma, Federal Government, and the City of Oklahoma City, placed at Bricktown, Oklahoma City, OK, Completed elements #43 and #44, Installed #42 and #43.
o Molly Boren, bronze relief, sculpted, cast, installed and unveiled North Oval, University of Oklahoma, Norman, OK.
o David Boren, 10' bronze, installed and unveiled, North Oval, University of Oklahoma, Norman, OK.
o David Boren, 10' bronze, installed and unveiled, University of Oklahoma Health and Science Center, Oklahoma City, OK.
o Coach Bob Stoop, 9' 6" bronze, installed and unveiled, University of Oklahoma, Norman, OK.
o Oklahoma's Centennial Land Run, (365' long; 46 life and a half elements), Bronze, Commissioned by the State of Oklahoma, Federal Government, and the city of Oklahoma City, placed at Bricktown, Oklahoma City, OK. Completed element #41, started #42. Installed #40 and 41.
o Oklahoma's Centennial Land Run, (365' long; 46 life and a half elements), Bronze, Commissioned by the State of Oklahoma, Federal Government, and the city of Oklahoma City, placed at Bricktown, Oklahoma City, OK. Completed elements #39-40, started #41. Installed #37, 38 and 39.
o Ken Moore, life-size bust, bronze, Legal Shield Law Firm, PPL Services, Ada, OK.
o David Savula, life-size bust, bronze, Legal Shield Law Firm, PPL Services, Ada, OK.
o T. Boone Pickens, Life-size portrait head in clay for possible commission with Oklahoma State University, Stillwater, OK.
o Bob Stoops, (nine and a half foot figure), bronze, University of Oklahoma, Norman, OK. Sculpting and casting completed.
o Joe Taylor relief, 14" diameter, Bizzell Library, University of Oklahoma, Norman, OK.
o Design and completion for an iron element to the Joe Taylor sculpture wall at the History of Science Rare Book Collection, Bizzell Library, University of Oklahoma, Norman, OK.
o Oklahoma's Centennial Land Run, (365' long; 46 life and a half elements), Bronze, Commissioned by the State of Oklahoma, Federal Government, and the city of Oklahoma City, placed at Bricktown, Oklahoma City, OK. Completed element #36-38, signed contract for the last seven life and a half elements. New estimated completion date 2020.
o Kevin Durant, life-size portrait head, commissioned by Clay Bennett owner of the Thunder Basketball team.
o Kevin Durant, 42" maquette, commissioned by Clay Bennett owner of the Thunder Basketball team.
o Russell Westbrook, life-size portrait head, commissioned by Clay Bennett owner of the Thunder Basketball team.
o Russell Westbrook, 42" maquette, commissioned by Clay Bennett owner of the Thunder Basketball team.
o Peggy Helmerick, (life-size bust), bronze, University of Oklahoma, Norman, OK.
o Robert Kennedy, (life-size bust), bronze, private collection.
o Gov. Mary Fallin, (life-size bust), bronze, Hall of the Governors, Oklahoma State Capitol, Oklahoma City, OK. Completed and installed.
o Bob Stoops, (nine and a half foot figure), bronze, University of Oklahoma, Norman, OK. Currently being sculpted.
o Oklahoma's Centennial Land Run, (365' long; 46 life and a half elements), Bronze, Commissioned by the State of Oklahoma, Federal Government, and the city of Oklahoma City, placed at Bricktown, Oklahoma City, OK. Estimated completion date 2014.
o Winston Churchill, (life-size bust), bronze, private collection.
o Edward Everett Dale, bronze, Western History Collection, University of Oklahoma, Norman campus.
o Gov. Mary Fallin, (life-size bust), bronze, Hall of the Governors, Oklahoma State Capitol, Oklahoma City, OK.
o Bob Stoops, (maquette for a nine and a half foot figure), bronze, University of Oklahoma, Norman, OK.
o John F. Kennedy Presidential Library and Museum, (bronze bust of John F. Kennedy) Columbia Point, Boston, Mass.
o Edith Gaylord, (life-size bust), bronze, Inasmuch Foundation, Gaylord School of Journalism, University of Oklahoma, Norman, OK.
o Edith Gaylord, (life-size bust), bronze, Inasmuch Foundation, Edith Kinney Gaylord Cornerstone Arts Building, Colorado College, Colorado Springs, CO.
o Oklahoma's Centennial Land Run, (365' long; 46 life and a half elements), Bronze, Commissioned by the State of Oklahoma, Federal Government, and the city of Oklahoma City, to be placed at Bricktown, Oklahoma City, OK. Thirty three bronze elements have been installed since the beginning of the project. Currently, three additional pieces are being sculpted or cast; estimated completion date 2014.
o Dean Sul Lee, (life-size bust), bronze, Bizzell Library, University of Oklahoma, Norman, OK.
o David Boren (10' bronze figure), University of Oklahoma, Norman Campus, Norman, OK.
o David Boren (10' bronze figure), University of Oklahoma, Health and Science Center, Oklahoma City, OK.
o Medal of Honor recipients Michael Thornton and Thomas Norris, (10' figures), National Navy UDT-Seal Museum, Fort Pierce, Florida. Commissioned by Ross Perot.
o General Yarborough and John F. Kennedy, (seven foot figures), Collection of the John F. Kennedy Special Warfare Museum, Fort Bragg, NC (Unveiled April 5, 2012).
o Walter Neustadt, (life-size figure), Polymer, World Literature Today, University of Oklahoma, Norman, OK.
o Oklahoma's Centennial Land Run, (365' long; 46 life and a half elements), Bronze, Commissioned by the State of Oklahoma, Federal Government, and the city of Oklahoma City, to be placed at Bricktown, Oklahoma City, OK. Twenty eight bronze elements have been installed since the beginning of the project. Currently, three additional pieces are being sculpted or cast; estimated completion date 2014.
o Charles Alan Wright, (life-size bust), University of Texas, School of Law, Austin, TX.
o Oklahoma's Centennial Land Run, (365' long; 46 life and a half elements), Bronze, Commissioned by the State of Oklahoma, Federal Government, and the city of Oklahoma City, to be placed at Bricktown, Oklahoma City, OK. Twenty six bronze elements have been installed since the beginning of the project. Currently, four additional pieces are being sculpted or cast; estimated completion date 2014.
o Charles Stephenson (life-size bust), University of Oklahoma, Stephenson Research Center, Norman Campus, Norman, OK.
o Peggy Stephenson (life-size bust), University of Oklahoma, Stephenson Research Center, Norman Campus, Norman, OK.
o Curtis Mewbourne (10' bronze figure), Curtis W. Mewbourne School of Earth and Energy. University of Oklahoma, Norman Campus, Norman, OK (completed and installed).
o Bust of Curtis Mewbourne (life and a half bust), Phi Gamma Delta House, University of Oklahoma, Norman Campus, Norman, OK (completed and installed).
o General Yarborough and John F. Kennedy, (seven foot figures), Collection of the John F. Kennedy Special Warfare Museum, Fort Bragg, NC (sculpting and casting completed).
o General Hugh Shelton, (10' bronze figure), Airborne and Special Operation Museum, Fayetteville, NC (installed and unveiled).
o General Wayne Downing, (11' bronze figure), General Wayne A. Downing Airport, Peoria, IL (installed and unveiled).
o Governor Brad Henry, (life-size bust), Hall of the Governors, Oklahoma State Capitol, Oklahoma City, OK.
o Oklahoma's Centennial Land Run, (365' long; 46 life and a half elements), Bronze, Commissioned by the State of Oklahoma, Federal Government, and the city of Oklahoma City, to be placed at Bricktown, Oklahoma City, OK. Twenty three bronze elements have been installed since the beginning of the project. Currently, four additional pieces are being sculpted or cast; estimated completion date 2014.
oGeneral Wayne Downing, (11' bronze figure), General Wayne Downing Airport, Peoria, IL (completed).
oGeneral Hugh Shelton, (10' bronze figure), Collection of Fayetteville, NC (completed).
oHarold Hamm (life and a half bust), University of Oklahoma, Schusterman Health and Science Center, Tulsa, OK (installed).
oHarold Hamm (life and a half bust), University of Oklahoma, Health and Science Center, Oklahoma City, OK (installed).
oCurtis Mewbourne (10' bronze figure), University of Oklahoma, Norman Campus, Norman, OK (sculpted).
o Oklahoma's Centennial Land Run, (365' long; 46 life and a half elements), Bronze, Commissioned by the State of Oklahoma, Federal Government, and the city of Oklahoma City, to be placed at Bricktown, Oklahoma City, OK. Nineteen bronze elements have been installed since the beginning of the project. Currently, four additional pieces are being sculpted or cast; estimated completion date 2014.
o Cy Wagner, portrait bust (life-size), bronze, University of Oklahoma's Cy and Lissa Wagner Hall, Norman, OK.
oLissa Wagner, portrait bust (life-size), bronze, University of Oklahoma's Cy and Lissa Wagner Hall, Norman, OK.
oSooner Schooner, 24" version, bronze Ed. 190, Scholarship program, University of Oklahoma.
oGeneral Wayne Downing, (11' bronze figure), General Wayne A. Downing Airport, Peoria, IL.
oGeneral Hugh Shelton, (10' bronze figure), Collection of Fort Bragg, NC.
o Oklahoma's Centennial Land Run, (365' long; 46 life and a half elements), Bronze, Commissioned by the State of Oklahoma, Federal Government, and the city of Oklahoma City, to be placed at Bricktown, Oklahoma City, OK. Seventeen bronze elements have been installed since the beginning of the project. Currently, five additional pieces are being sculpted or cast; estimated completion date 2014.
o Nicolai Fechin, portrait head, (life-size posthumous), Bronze, Collection of the Fred Jones, Jr. Museum, University of Oklahoma, Norman, OK.
o Dr. Thomas D. Rees, (life-size portrait head), Bronze, Flying Doctors of East Africa's headquarters, Nairobi, Kenya, Africa.
o "Coming of Age", (life-size figure), Bronze, Collection of Brookgreen Gardens, Pawley's Island, South Carolina.
o President David Boren, (life-size bust), Bronze, University of Oklahoma, Norman, OK.
o Oklahoma's Centennial Land Run, (365' long; 46 life and a half elements), Bronze, Commissioned by the State of Oklahoma, Federal Government, and the city of Oklahoma City, to be placed at Bricktown, Oklahoma City, OK. Three elements completed; estimated completion date 2014.
o "The Ozark Broadcaster" (9' figure), Bronze, Ozark Christian College, Joplin, MO.
o Neil Estern, Sculptor of the FDR Memorial, Washington, DC, (life-size portrait), plaster, private collection.
o Tom Love, (life-size bust), Polymer, Memorial Union Bldg., University of Oklahoma, Norman, OK.
o George Wadsack, (life-size bust), Polymer, Memorial Union Bldg., University of Oklahoma, Norman, OK.
o Dr. Maurice H. Merrill, (life-size bust), Polymer, Memorial Union Bldg., University of Oklahoma, Norman, OK.
o Ivar Ivask, (life-size bust), Polymer, Whitehand Hall, University of Oklahoma, Norman, OK.
o Oklahoma's Centennial Land Run, (365' long; 46 life and a half elements), Bronze, Commissioned by the State of Oklahoma, Federal Government, and the city of Oklahoma City, to be placed at Bricktown, Oklahoma City, OK. Two elements completed; estimated completion date 2014.
o Donald Reynolds, (life-size bust posthumous), Plaster, Private Collection.
o Michael Price, (life-size bust), Bronze, Michael Price College of Business, University of Oklahoma, Norman, OK.
o Lloyd Noble, (life-size bust posthumous), Bronze, Samuel Roberts Noble Foundation Campus, Ardmore, OK. 1st casting.
o Lloyd Noble, (life-size bust posthumous), Bronze, Noble Energy Headquarters, Houston, TX. 2nd casting.
o Lloyd Noble, (life-size bust posthumous), Bronze, Noble Corp. Headquarters, Sugarland, TX. 3rd casting.
o Lloyd Noble, (life-size bust posthumous), Bronze, Samuel Roberts Noble Foundation Administration Building., Ardmore, OK. 4th casting.
o Lloyd Noble, (life-size bust posthumous), Bronze, (location to be announced). 5th casting.
o Donald Reynolds, (life-size figure posthumous), Bronze, Holmberg Hall, Reynolds Performing Arts Center, University of Oklahoma.
o Bust of Carl Albert, 46th Speaker of the House, (life-size), Bronze, Collection of the US Capitol Collection / US House of Representatives on March 3rd, 2004 in Statuary Hall, United States Capital, Washington, DC.
o Blackhawk Memorial, Bronze, 5th Battalion, 158th Aviation Regiment, Giebelstadt, Germany.
o Gaylord Family Memorial Stadium Monument, (30' high), Granite and bronze, Gaylord Family Memorial Stadium, University of Oklahoma.
o Edward Gaylord, (9'), Bronze, Gaylord School of Journalism, University of Oklahoma, Norman, OK.
o Paul David, (life-size bust posthumous), Polymer, Memorial Union Building, University of Oklahoma, Norman, Oklahoma.
o Nathan Court, (life-size bust), Polymer, Memorial Union Building, University of Oklahoma, Norman, Oklahoma.
o Emil Kraettli, (life-size bust), Polymer, Memorial Union Building, University of Oklahoma, Norman, Oklahoma. In collaboration with Sohail Shehada.
o Rick Haney, (life-size bust), Bronze, PPL Services, Ada, Oklahoma.
o Wilburn Smith, (life-size bust), Bronze, PPL Services, Ada, Oklahoma.
o Harland Stonecipher, (life-size bust), Bronze, PPL Services, Ada, Oklahoma.
o Shirley Stonecipher, (life-size bust), Bronze, PPL Services, Ada, Oklahoma.
o Oklahoma's Centennial Land Run, (365' long; 46 life and a half elements), Bronze, Commissioned by the State of Oklahoma, Federal Government, and the city of Oklahoma City, to be placed at Bricktown, Oklahoma City, OK. Three pieces completed; estimated completion date 2014.
o David L. Boren, (half life-size figure) Polymer, Commissioned by the University of Oklahoma, Evans Hall, University of Oklahoma, Norman, OK.
o Oscar Jacobson, Polymer, Commissioned by the University of Oklahoma, Jacobson Hall, University of Oklahoma, Norman, OK. In collaboration with Lisa Clayton and Sohail Shehada.
o Dr. J. Willis Stovall, (life-size bust posthumous), Bronze, Oklahoma Sam Noble Natural History Museum. University of Oklahoma, Norman, Oklahoma.
o Guy Williams, (life-size head), Polymer, Science Building, University of Oklahoma, Norman, Oklahoma.
o Dr. Michael Mares, (life-size bust), Bronze, Oklahoma Sam Noble Natural History Museum. University of Oklahoma, Norman, Oklahoma.
o Paul Massad, (life-size bust), Polymer, Memorial Union Hall, University of Oklahoma.
o The Seed Sower (12' figure), Bronze, Second casting, Health and Science Center, University of Oklahoma, Oklahoma City, Oklahoma.
o Lawton Land Auction, (13' high x 9' wide x 3' deep), Bronze, Commissioned by the McMahon Foundation for the Museum of the Great Plains, Lawton, Oklahoma.
o Oklahoma's Centennial Land Run, (365' long; 46 life and a half elements), Bronze, Commissioned by the State of Oklahoma, Federal Government, and the city of Oklahoma City, to be placed at Bricktown, Oklahoma City, OK. Contracts completed and signed in October and the enlargements begin; estimated completion date 2014.
o Portrait head of David Ross Boyd (4' head), Bronze, Commissioned by the University of Oklahoma, Memorial Union Courtyard, University of Oklahoma, Norman, Oklahoma.
o Johnny Bench, (9' figure), Bronze, Commissioned by the Bricktown Ball Park, Oklahoma City, Oklahoma.
o "War Memorial Relief", Bronze, Commissioned by the University of Oklahoma, Memorial Union Building, University of Oklahoma, Norman, Oklahoma.
o Memorial to the Cadaver, (life-size figure), Bronze, Commissioned by the University of Oklahoma, Health and Science Center, Oklahoma City, Oklahoma. In collaboration with Vieda Blick.
o Oklahoma's Centennial Land Run, (365' long; 46 life and a half elements), Bronze, Commissioned by the State of Oklahoma, Federal Government, and the city of Oklahoma City, to be placed at Bricktown, Oklahoma City, OK. 15' clay sketch completed for proposal and contract negotiations begin; estimated completion date 2014.
o Portrait of Barbara Flicker, (life-size), Bronze, Private Collection.
o "Primitive Family", (three life-size figures and a dog), Bronze, Commissioned by the University of Oklahoma, The Sam Noble Oklahoma Natural History Museum, Norman, Oklahoma, In collaboration with Sohail Shehada.
o Seal of the University of Oklahoma (6' diameter), Bronze, Collection of the University of Oklahoma, Schusterman Health and Science Center, Tulsa, Oklahoma.
o The Seed Sower (12' figure), Bronze, Third casting, Schusterman Health and Science Center, Tulsa Campus, Tulsa, Oklahoma.
o "Seed Sower" (12"), Bronze (179 castings), Commissioned by the University of Oklahoma, Seed Sower Society.
o "Seed Sower" (22"), Bronze (51 castings), for the Kim and Paul Moore Scholarship Fund, University of Oklahoma, Norman, Oklahoma.
o Senator Henry Bellmon (life-size figure), Bronze, Commissioned by the State Fair of Oklahoma Inc., Oklahoma State Fairgrounds, Oklahoma City, Oklahoma.
o Portrait of Paul Harter (life-size, high relief, with 26 animals in low to high relief), Bronze, Commissioned by the San Diego Zoo, San Diego, CA.
o "Sower" (5' 2" figure), Bronze, First casting, Commissioned by the University of Oklahoma, First casting - Memorial Union Hall, University of Oklahoma, Norman, Oklahoma.
o "Sower" (5' 2" figure), Bronze, Second casting, Schusterman Health and Science Center, University of Oklahoma, Tulsa, Oklahoma.
o "Sower" (5' 2" figure), Bronze, Third casting - Private collection.
o Abner E. Norman (life-size figure), Bronze, Commissioned by the Norman Arts and Humanity Council, For the City of Norman, Oklahoma. In collaboration with Tim Sullivan.
o Dr, James Beard (life-size figure), Bronze, Commissioned by the Oklahoma Christian University of Science and Arts, Oklahoma City, Oklahoma.
o"Wait For Me", five life-size children, (14' L x 4' 8" H x 2' 3" W ), Bronze, Collection of the Muncie Children's Museum, Muncie, Indiana.
o Portrait of Barry Switzer (life-size bust), Bronze, The Switzer Center, University of Oklahoma, Norman, Oklahoma.
o "On the Chisholm Trail, Monument to the American Cowboy," (34' L x 11' H x 7' W life-size cattle drive), Bronze, Commissioned by the McCasland Foundation. Unveiled April 25, 1998, Chisholm Trail Heritage Center, McCasland Park, Duncan, Oklahoma.
o The Seed Sower (12' figure), Bronze, First casting, Commissioned by the University of Oklahoma, South Oval, Main Campus University of Oklahoma, Norman, Oklahoma.
o Portrait of Joseph Ruehl (life-size), Bronze, Collection of the New Mexico Bar Association, Albuquerque, NM.
o Edward Gaylord (9' figure), Bronze, Commissioned by the State Fair of Oklahoma Inc., Oklahoma State Fairgrounds, Oklahoma City, OK. Six maquettes purchased; 1st collection of The National Cowboy and Western Heritage Museum, Oklahoma City, Oklahoma; 2nd collection of the Grand Old Opry, Nashville, Tenn.; 3rd collection of the Daily Oklahoman Publishing Co., Oklahoma City, Oklahoma; 4th - 6th private collections.
o Portrait of David Ross Boyd, (life-size, posthumous), Plaster, Collection of the University of Oklahoma, Norman, Oklahoma .
o Portrait of Dr. George Lynn Cross, (life-size), Plaster, Collection of the University of Oklahoma, Norman, Oklahoma.
o Portrait of Edward Gaylord (life-size), Bronze, Commissioned by the Oklahoma Christian University of Science and Arts, Oklahoma City, Oklahoma
o Seal of the University of Oklahoma (6' diameter), Bronze, Collection of the University of Oklahoma, Norman, Oklahoma.
o Portrait of Ted Flicker, creator of the Barney Miller TV Series, (life-size), Bronze, Private Collection.
o "Gods of Energy" (26" H x 10" W x 12" D), Bronze, Collection of the Associate Energy Management, Inc., Longmeadow, MA.
o Islamic Studies - Peace Award design. Commissioned by the University of Oklahoma.
o Portrait of Sohail Shehada (life-size), Plaster, Private Collection.
o Nurses Memorial (maquette), Commissioned by the Paralyzed Veterans of America.
o Portrait of Jack Cohen (life-size), Plaster, Private Collection.
o Bust of Carl Albert, 46th Speaker of the House, (life-size), Plaster, Evans Hall, University of Oklahoma, Norman, OK.
o George Lynn Cross (two times life-size figure), Bronze, Collection of the University of Oklahoma, Norman, OK.
o Cleo Cross Relief, Bronze, Collection of the University of Oklahoma, Norman, Oklahoma.
o St. Francis (6' figure), Bronze, Collection of the Archdiocese of San Diego, San Diego, California.
o Portrait of Joy Bodensteiner (life-size), Bronze, Collection of Tom and Jaymie Bodensteiner, Flagstaff, Arizona.
o Portrait of Carly Bodensteiner (life-size), Bronze, Collection of Tom and Jaymie Bodensteiner, Flagstaff, Arizona.
o Portrait of Tommy Bodensteiner (life-size), Bronze, Collection of Tom and Jaymie Bodensteiner, Flagstaff, Arizona.
o Portrait of Bob Mathias, Two time Olympic Decathlon Gold Medalist, 1948 and 1952 (life-size), Plaster, Private collection.
o Portrait of Bob Thaves, creator of "Frank and Ernest" comic strip, (life-size with Frank and Ernest cartoon characters), Bronze, Private Collection.
o "Awakening" (life-size female figure), Bronze, Collection of the Black Entertainment Television, Washington, DC.
o "Fireflies" (two life-size children), Bronze, Harlington Public Library, City of Harlington, TX.
o Carl Albert, 46th Speaker of the House, (1 1/4 life-size figure), Bronze, First casting, Collection of the City of McAlester, Oklahoma, Commissioned by Clark and Wanda Bass.
o Carl Albert, 46th Speaker of the House, (1 1/4 life-size figure), Bronze, 2nd casting, Collection of the University of Oklahoma, Norman, Oklahoma. Commissioned by Clark and Wanda Bass.
o Portrait of Chuck Jones (life-size with 16 cartoon characters, including Bugs Bunny, Elmer Fudd, Daffy Duck, Wile E. Coyote and the Road Runner), Bronze, First casting, Collection of the National Portrait Gallery, Smithsonian Institution, Washington, DC.
o Portrait of Chuck Jones, Bronze, 2nd casting, Collection of the Warner Brothers Studios, Burbank, CA.
o Portrait of Chuck Jones, Bronze, 3rd casting, Collection of the Warner Brothers Studios, Burbank, CA.
o Portrait of Chuck Jones, Bronze, 4th casting, Collection of the Chuck Jones Film Productions, Burbank, CA.
o Portrait of Dick Trudell (life-size), Bronze, Private collection.
o Portrait relief of Elizabeth George Plouffe, Bronze, Collection of Skip Haywood, Foxwood Resort, Ledyard, Connecticut.
o Portrait of David Huddelston (life-size), Bronze, Private collection.
o Portrait of David Nordahl (life-size), Plaster, Private collection.
o "Fireflies" (two life-size children), Bronze, Collection of the Muncie Children's Museum, Muncie, Indiana.
o Portrait of Reese Phifer (life-size), Bronze, Collection of Phifer Wire Products, Tuscaloosa, Alabama.
o Vietnam Memorial (6'), Bronze, Quachita Baptist University, Arkadelphia, Arkansas.
o. Portrait of Zach Clayton (life-size, posthumous), Bronze, Collection of William and Virginia Clayton Felch.
o Portrait of Dr. William Schackel (life-size), Bronze, Private Collection.
o Portrait relief of I. H. Kempner, Founder of Imperial Sugar Co., Bronze, Collection of the Imperial Sugar Company, 150th Anniversary, Sugarland, Texas.
o North America wall relief (5' diameter), Bronze, Collection of the Chesebrough-Ponds USA Co., Greenwich, Connecticut.
o George Maloof (life-size figure, posthumous), Bronze, Collection of the City of Albuquerque, George Maloof Memorial Building, Department of Motor Vehicles, Albuquerque, NM.
o Dr. John S. Rihehart Award (4" medallion), Bronze, Commissioned by Explomet. The first two award recipients were Dr. Mark L. Wilkins, Senior Scientist, Lawrence Livermore Labs, Livermore, CA; and Dr. Andreya Deribas USSR Academy of Science, Nobosibrirsk, USSR.
o "Caduceus", (6'), Bronze, Collection of the OBGYN Associates Medical Building, Dr. Alfred Bassall, Farmington, NM.
o Portrait of Michael Cordone (life-size), Bronze, Collection of Cordone Industries, Philadelphia, Pennsylvania.
o Portrait of Nicolai Fechin (life-size, posthumous), Bronze, Collection of the Fechin Institute, Taos, NM.
o Portrait of Thomas C. Hicks (life-size), Bronze, Collection of Shidoni Foundry, Tesuque, NM.
o Portrait of Governor John Simms (life-size, posthumous), Bronze, Collection of the University of New Mexico, Albuquerque, NM.
o "Blanket Injun", Bronze, Collection of the Embassy of the Federal Republic of Germany, Ottawa, Ontario.
o Portrait of Rod Iverson (life-size, posthumous), Bronze, Collection of Peter Iverson, Pleasanton, CA.


text:
Trinidad and Tobago Advances Progress to a Sustainable Blue Economy through Partnership with Commonwealth Blue Charter
Trinidad and Tobago is collaborating with the Commonwealth Blue Charter Programme to accelerate the nation's readiness in transitioning to a Sustainable Blue Economy. Through this partnership, a Blue Economy Rapid Readiness Assessment (RRA), coordinated by the Commonwealth Blue Charter programme with the United Nations Environment Program (UNEP), will be executed to evaluate the preparedness of national systems, structures and stakeholders to advance the blue economy transition.
A 'Sustainable Blue Economy' is a crosscutting concept that marries innovation and natural resource stewardship for the sustainable use of marine resources for economic growth, improved livelihoods, and social well-being. This means that citizens can benefit from greater job opportunities in the marine sector and increased avenues to meet Trinidad and Tobago's growing need for food. In addition, as the global climate summit, COP27 wraps up in Egypt, being part of the Blue Economy can also support our climate change commitments in Trinidad and Tobago.
The RRA process brings together stakeholders from various spheres, including the Institute of Marine Affairs, the Fisheries Division, the Trinidad and Tobago Coast Guard, Aquaculture practitioners and CSOs, among others, to comprehensively examine multiple indicators of blue economy readiness, identify opportunities and challenges, and plot a clear roadmap for national transformation. The RRA commenced in the 3rd quarter of 2022 and the actionable report laying out clear transition next steps will be delivered at the close of November.
Speaking on this partnership at a RRA stakeholder consultation, Planning and Development Minister Pennelope Beckles said, "This process will go a great distance in recognising the challenges faced as Small Island Developing State, with the goal of plotting our next steps in our continuous quest towards becoming a sustainable 'blue' economy. This means expanded opportunities to effectively tap into ocean resources and support long-term economic growth, while also protecting Trinidad and Tobago's marine and coastal ecosystems."
The Rapid Readiness Assessment, which is also being deployed in Antigua and Barbuda, will make the blue economy transition practical, achievable and most critically, tailored to our national context, by examining sustainable finance, existing policy and regulatory framework, institutional infrastructure and culture, stakeholder engagement, baseline data and monitoring and evaluation systems among other vital indicators.
Project lead, Dr Jeff Ardron from the Commonwealth Secretariat stated, "Commonwealth ocean states are acutely aware of the vast ocean resources that exist within their waters as well as the need to protect the marine environment. We are pleased to be able to support Trinidad & Tobago and Antigua & Barbuda in developing sustainable blue economies, and thank them for their willingness to pilot this new methodology. Both face similar challenges as SIDS, but they also have key economic differences. The rapid readiness assessments should pinpoint gaps and opportunities for each."
The 5th National Report of Trinidad and Tobago to the Convention on Biological Diversity (CBD), which was approved by Cabinet in 2017, stated that the value of shoreline protection provided by coastal ecosystems for Trinidad and Tobago ranges between US three dollars and US one hundred and thirty three dollars per hectare, per year. Aside from protection services, coastal ecosystems also support recreation and tourism-based activities, valued at up to US three hundred and ninety thousand, four hundred and twenty eight dollars per hectare per year. This demonstrates the economic possibilities of the blue economy, further emphasising the need for initiatives that will catalyse the blue economy transition.
As the UN Global Climate Change Conference, COP27, comes to an end in Egypt, and Trinidad and Tobago prepares to participate in the 15th Meeting of the Parties on Biodiversity, COP15, the Ministry of Planning and Development continues to undertake holistic climate action interventions that acknowledge our unique context as a SIDS. Advancing our progress towards a blue economy through this partnership not only contributes to achieving our multilateral environmental agreements, but will also bolster food security through marine protection, improve livelihoods via sustainable job creation, and support economic diversification through new industry development. Coastal tourism which includes cruise ship tourism, waste management and protection of the marine environment and supporting infrastructure, and shipping which includes transshipment, vessel lay-ups, offshore installations and ship pollution, have been identified as priority sectors.


text:
Programming insights to Storytelling, it's all here.
You don't just say No, you have to earn it first.
Saying yes is much easier than saying no. Most of the time, we say yes because we don't want to hurt feelings or we want to be nice. But what is the point saying yes if you don't plan to do what you are asked? Saying no is mostly seen as rude, even though it makes perfect sense in some situations. This may not be a big deal when friends and family are asking you for a favor, but sometimes answering a yes or no question can determine our future.
The best thing you can do is to start making mistakes
Pair programming is amazing. Looking at your own codes for hours on end makes you overlook the smallest mistakes. When debugging instead of reading the code we recite it in your mind, because we think we know what we wrote. When someone else sits next to me and point out obvious mistakes I made I yell "fire!" and use the distraction to quicly fix the error. No, I don't really do that, I would have to come up with too many puns and my creative moments are as rare as gold. But I am not afraid of making mistakes.
Working from home is not for everyone.
The notion of working remotely or from home is amazing. You don't have to drive to work, you don't have to think about parking ,you can work in your pajamas, and so on. But do you end up being productive?
What do you do when your idea is already taken
When I was still in college, I had a friend who was trying to convince me to get on board for the new life changing idea she had. It was a big secret. She called me into a room and looked over her shoulders to make sure no one was eavesdropping.
My solution is to run away ... at least for a moment
What do you do when you hit a wall? When you found a bug and you can't figure out how to fix it. You spend hours and hours in front of the screen and nothing seems to work. Sometimes this can be the worse nightmare for a programmer and putting more hours trying to fix it won't make a difference.
From full stack dev to backend dev and then back.
When you are working on your own as a developer you get exposed to many aspect of the business. You don't really draw border lines. As a web developer you blend in all kind of technology and you consider it all just web development. When you work in a big or established company it is a little different. They don't need full stack developers. They have a person or a group of people that work in just one thing; DBA or Unix for example. If you do this for a while you can become an expert in your field, but lose something in other areas.
Staying motivated when things are not that exciting.
The tech world has developed a hollywood-ish image over the years. When you say work in the tech industry, everyone imagine a cool new start-up where hip youngsters dressed in the latest fashion thread, program by day and hit the clubs by night. They play video games at lunch and work on cool projects that disrupt big companies and change the world. Maybe that's how it is when you work at Google, Facebook, or some other company, however that's not what I am experiencing.
« June 2013 May 2013 April 2013 »
JS Tip of the day
Please don't detect the browser
Feature detection is a term everyone in the web development world has heard of. Yet, we still find code that tries to detect which browser the user is running t…


text:
Q: Can electron's --log-file flag capture main console logs, or only renderer logs? I've been trying to figure out a way to log my electron app's main console logs in production, without having to install an additional npm package such as electron-logger.  When starting electron manually from the command line, this is no problem of course; I can just pipe the output to a logfile. Similarly, if starting via npm start, I can just create a package.json like this:
{
  "name": "my-app",
  "version": "1",
  "description": "an app",
  "main": "main.js",
  "scripts": {
    "start": "electron . | tee myfile.txt"
  },
  "author": "me",
  "devDependencies": {
    "electron": "latest"
  },
}

However, if the app is packaged into an executable, by say electron-packager or electron-builder, that start command is ignored, and the file is not generated.
I discovered that electron has some built-in command line options for logging: notably, log-file=FILE and --enable-logging. I can even set these directly in my main.js as follows:
app.commandLine.appendSwitch('log-file', 'myfile.txt');
app.commandLine.appendSwitch('enable-logging');

This works even when the app is bundled as an exe, but it only appears to capture console output from the renderer process (what would display in the browser's debugging tools.)
Is there a way to get electron's built in logs to capture main console statements as well? Or is limited to renderer logs? The documentation was unclear to me on this. I did find this link, which gave me the impression that --log-file only capture's the chromium logs (which I assume are only the renderer logs?) But I was unsure if my assumption was correct.

redpajama_set_name: RedPajamaStackExchange


text:
Exploring Human Nature in Macbeth
by heather
William Shakespeare's Macbeth explores human nature, in particular the ambition of his main character Macbeth. Macbeth makes ill-fated decisions based upon ambitions to become King and retain that position. So
throughout the play, Macbeth's ambition clouds his judgment, which leads to eventual death. Although his fate is inexorable, Macbeth uses his ambition to fuel his evil intentions. This undertaking is the drive that seals Macbeth's fate.
At the beginning of 1. 3. , Macbeth's ambition leads him to hear his fate given to him by the three witches:
Stay, you imperfect speakers, tell me more.
By Sinel's death I know I am Thane of Galmis,
But how of Cawdor? The Thane of Cawdor lives,
A prosperous gentleman, and to be King
Stands not within the prospect of belief,
No more than to be Cawdor. Say from whence
You owe this strange intelligence? Or why
Upon this blasted heath you stop our way
With such prophetic greeting? Speak, I charge you. (1. 3. 70-78)
Immediately one can see that Macbeth wanted to hear the witches' prophecies and not that he was forced to hear them. According to Harold Bloom in his book Shakespeare: The Invention of the Human "The witchcraft in Macbeth, though persuasive, cannot alter material events, yet hallucination can and does" (516). Macbeth is shrouded by his own ambitions of becoming King. Macbeth is intrigued that he will become King and astonished that he has another title of a man that he believes is still alive and loyal to King Duncan. Also one can see some foreshadowing in this excerpt because the Thane of Cawdor was a traitorous individual, and by Macbeth gaining that title it only strengthens his misguided ambitions.
At the end of 1. 3. , Macbeth already attempts to go against human nature when he questions his own character:
If good, why do I yield to that suggestion
Whose horrid image doth unfix my hair
And make my seated heart knock against my ribs,
Against the use of nature? …(1. 3. 134-137)
Here, Macbeth questions his very being by asking if he should against nature, by killing the King of Scotland instead of waiting out the prophecy given to him by the three witches. Human nature is questioned in this excerpt as well because the act of killing, or murder goes against human nature. Also Macbeth would be going against nature, or the natural course of things by forcing fate if he murdered King Duncan to become King.
In the very beginning of Act 2, Banquo addresses Macbeth about the witches' prophecies saying, "I dreamed last night of the weird sisters. / To you they have shown some truth" (2. 1. 21-22). Now that Macbeth has be granted the title of Thane of Cawdor, Banquo realizes that all that is left for Macbeth is to become King. This assertion also indicates that Banquo is also interested in the prophecies because of Macbeth's prophecies are starting to be fulfilled, than so will his. Banquo's prophecy was that his issues or bloodline would become King, so although he himself will not take the throne, he can be assured that his feature generations will.
Now that Macbeth has claimed the throne threw unlawful deeds, he begins to wonder about the heirs to his throne. He is unable to conceive a male heir with his wife Lady Macbeth and begins to ponder about Banquo's issue saying, "To make them kings-the seed of Banquo kings! / Rather than so, come, Fate, into the list, / And champion me to utterance! …" (3. 1. 70-72). Here, Macbeth formally states that he will go against fate, which as stated is inexorable or unchangeable. At this very moment, Macbeth has just sealed his fate, by trying to defy anothers.
Shortly after, Macbeth claims the throne through the murder of King Duncan. Clouded in his own personal goals, Macbeth attempts to go against the prophecy given to Banquo:
… And with him-
To leave no rubs nor botches in the work-
Fleance his son, that keeps him company,
Whose absence is no less material to me
Than is his father's must embrace the fate
Of that dark hour. … (3. 1. 133-138)
At this point, Macbeth plots the murders of Banquo and his son Fleance, in order to stop Banquo's issue from becoming heirs to Macbeth's throne as prophesized by the three witches. He states he will leave no remnants of Banquo's bloodline in order to stop that prophecy from becoming true. Macbeth's ambition to remain King and do what he sees fit only further affirms his very own demise.
Macbeth is becoming more ruthless as the play progresses. In 4. 1. , Macbeth is approached by three apparitions, all of which tell him more of his prophecy. Macbeth is told Macduff is the only man Macbeth has to fear despite the fact that another apparition tells him that no man born from a woman can harm him. Macbeth's ambition leads him to make further irrational decisions concerning these prophecies:
Then live, Macduff. What need I fear of thee?
But yet I'll make assurance double sure,
And take a bond of fate. Thou shalt not live,
That I may tell pale-hearted fear it lies,
And sleep in spite of thunder. (4. 1. 82-86)
Macbeth's ambitious nature clouds his better judgment, which leads him to want to stop this prophecy from happening as well. He failed at killing both Banquo and Fleance but that does not alter his plot of killing Macduff. Macbeth gets some assurance from the witches however when they claim no man can harm Macbeth. For this reason Macbeth damns himself further by believing he is invincible. It is only a matter of time before Macbeth will fall by the hand of Macduff.
When Macduff confront Macbeth, Macbeth is fearless because he was told he could not be harmed by anyone of being born from a woman. However, Macduff is an exception to this rule and tells Macbeth "Tell thee Macduff was from his mother's womb / Untimely ripped" (5. 8. 15-17). Now Macbeth realizes that his judgment was incorrect, there nothing he can do that will save him from the ultimate mistake which ends his life.
Not long after being confronted by Macduff, Macbeth comes to the realization that he is doomed saying, "Accursed be that tongue that tells me so, / For it hath cowed me better part of man!" (5. 8. 17-18). At this point Macbeth knows he cannot defeat Macduff because Macduff is the one exception to the witches' prophecy. He can no longer cower away in his castle, nor make any more extremely misguided decisions. Perhaps if his ambition to be the best and the King of Scotland has not overtaken his better decision-making abilities, he would not have been damned to hell for murder, but he wouldn't be slain for treason as well.
Finally in his last action Macbeth makes one last charge toward Macduff despite the fact that all signs are pointing to his death and demise:
Though Birnam Wood be come to Dunsinance,
And thou opposed, being of no woman born,
Yet I will try the last. Before my body
I throw my warlike shield. Lay on, Macduff,
And damned be him that first cries 'Hold, enough!' (5. 8. 30-34)
Macbeth knows there is no coming back from his mistakes and decides to go out in a valiant clash of metal swords. Macbeth is slain, and Macduff is the hero. It is impossible to assume that Macbeth would have done anything different had he known Macduff would kill him because it is part of Macbeth's human nature. In closing, Wendy Greenhill, in her book Shakespeare: Man of the Theater concludes that, "As the play unfolds the audience and with the Macbeths, become painfully aware that destiny and choice are two edges of the same sword" (18). In one aspect of human nature, ambition was able to take a once noble hero, and transform him into a ruthless King that sealed his own fate by following clouded judgment.
Bloom, Harold. Shakespeare: The Invention of the Human. New York: Riverhead, 1998.
Greenhill, Wendy. Shaespeare: Man of the Theater. Chicago: Heinemann Library, 2000.
Shakespeare, William. Macbeth. Adventures in English Literature. Ed. Holt, Rinehart, and Winston. New York: Harcourt School, 1996.179-249.
Research Papers on Exploring Human Nature in Macbeth
Hamlet, by William Shakespeare
Death of a Salesman - Essay
Hedda Gabler Essay
Romeo and Juliet - 9th Grade Book Report
Essay on Woyzeck by Georg Büchner
Tartuffe by Moliere - College Essay
Machinal by Sophie Treadwell - College Essay
Uncle Vanya by Anton Chekhov - College Essay
The Homecoming Essay
Previous post Major and Minor Characters in Literature
Next post Education Field Study – Building Literacy


The Panama - Costa Rica border crossing is relatively simple to do independently with a little bit of planning. You don't need a shuttle and you don't need a tour company!
Here's our guide on the transport, the fees and the onward travel options for crossing the border at Guabito/Sixaola to reach Puerto Viejo and the east coast of Costa Rica.
From David City, you can access two borders. The first at Paso Canoas (less than an hour away) is the largest in the country and is best if you want direct access to the south or west coast of Costa Rica - don't make the mistake of going here if your hostel reservation is in Puerto Viejo!
The second - in Guabito/Sixaola - is around four hours travel from David City.
An early morning start is recommended. Make your way to David's bus terminal where the mini-buses to Changuinola are located, leaving at least once every hour.
Though often quite tightly packed, these buses have air-con and will stop once en-route for some food.
If you have been enjoying the beaches in Bocas del Toro, then this bus will pick you up from Almirante, from where it takes 30 minutes to Changuinola ($1.25).
Just around the corner from the final stop, you'll find Changuinola bus station. Ask around for a bus to 'Guabito or La Frontera' and someone will point you to the clunky old school buses, which depart every half-hour or so.
Once in Guabito, the bus will drop you off in a vacant lot and your first port of call is the immigration office.
It's a little confusingly located: make your way up the stairs and then down the stairs on the other side and it's a little further ahead on your right.
Take care of business here, get your exit stamp then turn around back up the stairs, heading towards the bridge.
However, given the office's location, it's difficult to bypass them and you're probably best to pay this charge to avoid quite a bit of aggro.
Get your camera out as this old railway bridge is probably one of the coolest border crossings you'll ever do!
Officially, you need to have proof of onward travel in order to enter the country, although this is not always strictly enforced. However, we definitely advise you to make arrangements and have some proof with you - why not read our guide on how to create a proof of onward travel document here.
An alternative - if you know you're only going to be in country for a 7-14 days - is to state the date you're leaving and ask for a visa up until that time. They may not grant this to everyone, but it is possible.
Unfortunately, at this border crossing there is only one small immigration office where they process both incoming and outgoing tourists with just two members of staff. Therefore, there are often quite lengthy queues.
Whilst waiting in line, you will usually be offered an arrival form. Do take it - they don't expect a tip or payment (unlike other Central American countries) and this will save some time once you reach the head of the queue.
Present this form, along with your passport to the immigration officer.
Avoid any mini-bus or taxi touts as it's very easy to make your way independently to Puerto Viejo, it just takes a little more time. After you've got your passport stamped, go down the stairs on the right where you'll see some little shops - the bus station is just behind these.
Buses leave for Puerto Viejo at half past the hour, every hour (starting from 5.30 a.m.) On Sundays and Holidays, it is every two hours from 5.30 a.m.
The journey takes around 90 minutes and drops you off in the centre of Puerto Viejo.
looking for some latin american inspiration? we've got you covered!


text:
Wallpaper* Celebrates 200 Issues and the Ultimate Design Power Couple
Oct 9, 2015 12:03 pm EDT
The 200th issue of the Wallpaper* magazine is now on newsstands. The November issue is a momentous double milestone for Wallpaper*. Not only is it the 200th print edition but it is also the 100th with editor-in-chief Tony Chambers in charge. And to mark the occasion Chambers has paid tribute to some of the friends and collaborators who have been there for Wallpaper* since issue one, amongst them Alice Rawsthorn, Michael Reynolds and Sir Paul Smith.
Also for this landmark issue, legendary French typographer Philippe Apeloig has designed a special cover and new typeface just for Wallpaper*.
"It's a remarkable double century for Wallpaper* and it's been fun foraging though the archive," commented Tony Chambers, editor-in-chief Wallpaper*. "Retracing our steps has reminded us how sharp our eye and sound our judgement has been. This issue proves we're sharper than ever."
Apple's Chief Design Officer Sir Jonathan Ive and designer, and new Apple recruit, Marc Newson have fought off strong competition to top Wallpaper's all-new, 16-page Power 200 table. In celebration of its 200th edition, the magazine has doubled down on last year's Power 100, adding new league tables for product-designing architects, market-leading management, interior designers and designers under 40 already rocking the Wallpaper* world. The most powerful designers have again been ranked according to market value, quality and quantity of output and reputational shift. This year though, the magazine has dug into the archive, retraced its expert truffling and reprinted debut appearances of future power listers. Look out for a very young and follicly unchallenged Ive, amongst many others.
wallpaper.com (13,251)
category Design Magazines
filed under: Multidisciplinary Design
last updated Oct 9, 2015 12:04 pm EDT - 27,022 impressions, 818 clicks
Wallpaper* Launches Danish Christmas Market in London
Wallpaper* Honours Nemo with 2013 Best Reissues Design Award
Wallpaper* Magazine January 2013: Next Generation
Wallpaper* November '12 Issue: Reigning in Russia