text:
package org.apache.jackrabbit.webdav.server;

import org.apache.jackrabbit.webdav.DavCompliance;
import org.apache.jackrabbit.webdav.DavConstants;
import org.apache.jackrabbit.webdav.DavException;
import org.apache.jackrabbit.webdav.DavLocatorFactory;
import org.apache.jackrabbit.webdav.DavMethods;
import org.apache.jackrabbit.webdav.DavResource;
import org.apache.jackrabbit.webdav.DavResourceFactory;
import org.apache.jackrabbit.webdav.DavServletRequest;
import org.apache.jackrabbit.webdav.DavServletResponse;
import org.apache.jackrabbit.webdav.DavSessionProvider;
import org.apache.jackrabbit.webdav.MultiStatus;
import org.apache.jackrabbit.webdav.MultiStatusResponse;
import org.apache.jackrabbit.webdav.WebdavRequest;
import org.apache.jackrabbit.webdav.WebdavRequestImpl;
import org.apache.jackrabbit.webdav.WebdavResponse;
import org.apache.jackrabbit.webdav.WebdavResponseImpl;
import org.apache.jackrabbit.webdav.bind.RebindInfo;
import org.apache.jackrabbit.webdav.bind.UnbindInfo;
import org.apache.jackrabbit.webdav.bind.BindableResource;
import org.apache.jackrabbit.webdav.bind.BindInfo;
import org.apache.jackrabbit.webdav.header.CodedUrlHeader;
import org.apache.jackrabbit.webdav.io.InputContext;
import org.apache.jackrabbit.webdav.io.InputContextImpl;
import org.apache.jackrabbit.webdav.io.OutputContext;
import org.apache.jackrabbit.webdav.io.OutputContextImpl;
import org.apache.jackrabbit.webdav.lock.ActiveLock;
import org.apache.jackrabbit.webdav.lock.LockDiscovery;
import org.apache.jackrabbit.webdav.lock.LockInfo;
import org.apache.jackrabbit.webdav.observation.EventDiscovery;
import org.apache.jackrabbit.webdav.observation.ObservationResource;
import org.apache.jackrabbit.webdav.observation.Subscription;
import org.apache.jackrabbit.webdav.observation.SubscriptionInfo;
import org.apache.jackrabbit.webdav.ordering.OrderPatch;
import org.apache.jackrabbit.webdav.ordering.OrderingResource;
import org.apache.jackrabbit.webdav.property.DavProperty;
import org.apache.jackrabbit.webdav.property.DavPropertyName;
import org.apache.jackrabbit.webdav.property.DavPropertyNameSet;
import org.apache.jackrabbit.webdav.property.DavPropertySet;
import org.apache.jackrabbit.webdav.property.PropEntry;
import org.apache.jackrabbit.webdav.search.SearchConstants;
import org.apache.jackrabbit.webdav.search.SearchInfo;
import org.apache.jackrabbit.webdav.search.SearchResource;
import org.apache.jackrabbit.webdav.security.AclProperty;
import org.apache.jackrabbit.webdav.security.AclResource;
import org.apache.jackrabbit.webdav.transaction.TransactionInfo;
import org.apache.jackrabbit.webdav.transaction.TransactionResource;
import org.apache.jackrabbit.webdav.util.CSRFUtil;
import org.apache.jackrabbit.webdav.version.ActivityResource;
import org.apache.jackrabbit.webdav.version.DeltaVConstants;
import org.apache.jackrabbit.webdav.version.DeltaVResource;
import org.apache.jackrabbit.webdav.version.LabelInfo;
import org.apache.jackrabbit.webdav.version.MergeInfo;
import org.apache.jackrabbit.webdav.version.OptionsInfo;
import org.apache.jackrabbit.webdav.version.OptionsResponse;
import org.apache.jackrabbit.webdav.version.UpdateInfo;
import org.apache.jackrabbit.webdav.version.VersionControlledResource;
import org.apache.jackrabbit.webdav.version.VersionResource;
import org.apache.jackrabbit.webdav.version.VersionableResource;
import org.apache.jackrabbit.webdav.version.report.Report;
import org.apache.jackrabbit.webdav.version.report.ReportInfo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.w3c.dom.Document;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;

/**
 * AbstractWebdavServlet
 *

 */
abstract public class AbstractWebdavServlet extends HttpServlet implements DavConstants {

    // todo respect Position header
    /**
     * default logger
     */
    private static Logger log = LoggerFactory.getLogger(AbstractWebdavServlet.class);

    /** the 'missing-auth-mapping' init parameter */
    public final static String INIT_PARAM_MISSING_AUTH_MAPPING = "missing-auth-mapping";

    /**
     * Name of the optional init parameter that defines the value of the
     * 'WWW-Authenticate' header.

     * If the parameter is omitted the default value
     * {@link #DEFAULT_AUTHENTICATE_HEADER "Basic Realm=Jackrabbit Webdav Server"}
     * is used.
     *
     * @see #getAuthenticateHeaderValue()
     */
    public static final String INIT_PARAM_AUTHENTICATE_HEADER = "authenticate-header";

    /**
     * Default value for the 'WWW-Authenticate' header, that is set, if request
     * results in a {@link DavServletResponse#SC_UNAUTHORIZED 401 (Unauthorized)}
     * error.
     *
     * @see #getAuthenticateHeaderValue()
     */
    public static final String DEFAULT_AUTHENTICATE_HEADER = "Basic realm=\"Jackrabbit Webdav Server\"";

    /**
     * Name of the parameter that specifies the configuration of the CSRF protection.
     * May contain a comma-separated list of allowed referrer hosts.
     * If the parameter is omitted or left empty the behaviour is to only allow requests which have an empty referrer
     * or a referrer host equal to the server host.
     * If the parameter is set to 'disabled' no referrer checks will be performed at all.
     */
    public static final String INIT_PARAM_CSRF_PROTECTION = "csrf-protection";

    /**
     * Name of the 'createAbsoluteURI' init parameter that defines whether hrefs
     * should be created with a absolute URI or as absolute Path (ContextPath).
     * The value should be 'true' or 'false'. The default value if not set is true.
     */
    public final static String INIT_PARAM_CREATE_ABSOLUTE_URI = "createAbsoluteURI";

    /**
     * Header value as specified in the {@link #INIT_PARAM_AUTHENTICATE_HEADER} parameter.
     */
    private String authenticate_header;

    /**
     * CSRF protection utility
     */
    private CSRFUtil csrfUtil;

    /**
     * Create per default absolute URI hrefs
     */
    private boolean createAbsoluteURI = true;

    @Override
    public void init() throws ServletException {
        super.init();

        // authenticate header
        authenticate_header = getInitParameter(INIT_PARAM_AUTHENTICATE_HEADER);
        if (authenticate_header == null) {
            authenticate_header = DEFAULT_AUTHENTICATE_HEADER;
        }
        log.info(INIT_PARAM_AUTHENTICATE_HEADER + " = " + authenticate_header);

        // read csrf protection params
        String csrfParam = getInitParameter(INIT_PARAM_CSRF_PROTECTION);
        csrfUtil = new CSRFUtil(csrfParam);
        log.info(INIT_PARAM_CSRF_PROTECTION + " = " + csrfParam);

        //create absolute URI hrefs..
        String param = getInitParameter(INIT_PARAM_CREATE_ABSOLUTE_URI);
        if (param != null) {
            createAbsoluteURI = Boolean.parseBoolean(param);
        }
        log.info(INIT_PARAM_CREATE_ABSOLUTE_URI + " = " + createAbsoluteURI);
    }

    /**
     * Checks if the precondition for this request and resource is valid.
     *
     * @param request
     * @param resource
     * @return
     */
    abstract protected boolean isPreconditionValid(WebdavRequest request, DavResource resource);

    /**
     * Returns the DavSessionProvider.
     *
     * @return the session provider
     */
    abstract public DavSessionProvider getDavSessionProvider();

    /**
     * Returns the DavSessionProvider.
     *
     * @param davSessionProvider
     */
    abstract public void setDavSessionProvider(DavSessionProvider davSessionProvider);

    /**
     * Returns the DavLocatorFactory.
     *
     * @return the locator factory
     */
    abstract public DavLocatorFactory getLocatorFactory();

    /**
     * Sets the DavLocatorFactory.
     *
     * @param locatorFactory
     */
    abstract public void setLocatorFactory(DavLocatorFactory locatorFactory);

    /**
     * Returns the DavResourceFactory.
     *
     * @return the resource factory
     */
    abstract public DavResourceFactory getResourceFactory();

    /**
     * Sets the DavResourceFactory.
     *
     * @param resourceFactory
     */
    abstract public void setResourceFactory(DavResourceFactory resourceFactory);

    /**
     * Returns the value of the 'WWW-Authenticate' header, that is returned in
     * case of 401 error: the value is retrireved from the corresponding init
     * param or defaults to {@link #DEFAULT_AUTHENTICATE_HEADER}.
     *
     * @return corresponding init parameter or {@link #DEFAULT_AUTHENTICATE_HEADER}.
     * @see #INIT_PARAM_AUTHENTICATE_HEADER
     */
    public String getAuthenticateHeaderValue() {
        return authenticate_header;
    }

    /**
     * Returns if a absolute URI should be created for hrefs.
     *
     * @return absolute URI hrefs
     */
    protected boolean isCreateAbsoluteURI() {
        return createAbsoluteURI;
    }

    /**
     * Service the given request.
     *
     * @param request
     * @param response
     * @throws ServletException
     * @throws IOException
     */
    @Override
    protected void service(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {

        WebdavRequest webdavRequest = new WebdavRequestImpl(request, getLocatorFactory(), isCreateAbsoluteURI());
        // DeltaV requires 'Cache-Control' header for all methods except 'VERSION-CONTROL' and 'REPORT'.
        int methodCode = DavMethods.getMethodCode(request.getMethod());
        boolean noCache = DavMethods.isDeltaVMethod(webdavRequest) && !(DavMethods.DAV_VERSION_CONTROL == methodCode || DavMethods.DAV_REPORT == methodCode);
        WebdavResponse webdavResponse = new WebdavResponseImpl(response, noCache);
        try {
            // make sure there is a authenticated user
            if (!getDavSessionProvider().attachSession(webdavRequest)) {
                return;
            }

            // perform referrer host checks if CSRF protection is enabled
            if (!csrfUtil.isValidRequest(webdavRequest)) {
                webdavResponse.sendError(HttpServletResponse.SC_FORBIDDEN);
                return;
            }

            // check matching if=header for lock-token relevant operations
            DavResource resource = getResourceFactory().createResource(webdavRequest.getRequestLocator(), webdavRequest, webdavResponse);
            if (!isPreconditionValid(webdavRequest, resource)) {
                webdavResponse.sendError(HttpServletResponse.SC_PRECONDITION_FAILED);
                return;
            }
            if (!execute(webdavRequest, webdavResponse, methodCode, resource)) {
                super.service(request, response);
            }

        } catch (DavException e) {
            if (e.getErrorCode() == HttpServletResponse.SC_UNAUTHORIZED) {
                sendUnauthorized(webdavRequest, webdavResponse, e);
            } else {
                webdavResponse.sendError(e);
            }
        } finally {
            getDavSessionProvider().releaseSession(webdavRequest);
        }
    }

    /**
     * Sets the "WWW-Authenticate" header and writes the appropriate error
     * to the given webdav response.
     *
     * @param request The webdav request.
     * @param response The webdav response.
     * @param error The DavException that leads to the unauthorized response.
     * @throws IOException
     */
    protected void sendUnauthorized(WebdavRequest request,
                                    WebdavResponse response, DavException error) throws IOException {
        response.setHeader("WWW-Authenticate", getAuthenticateHeaderValue());
        if (error == null || error.getErrorCode() != HttpServletResponse.SC_UNAUTHORIZED) {
            response.sendError(HttpServletResponse.SC_UNAUTHORIZED);
        } else {
            response.sendError(error.getErrorCode(), error.getStatusPhrase());
        }
    }

    /**
     * Executes the respective method in the given webdav context
     *
     * @param request
     * @param response
     * @param method
     * @param resource
     * @throws ServletException
     * @throws IOException
     * @throws DavException
     */
    protected boolean execute(WebdavRequest request, WebdavResponse response,
                              int method, DavResource resource)
            throws ServletException, IOException, DavException {

        switch (method) {
            case DavMethods.DAV_GET:
                doGet(request, response, resource);
                break;
            case DavMethods.DAV_HEAD:
                doHead(request, response, resource);
                break;
            case DavMethods.DAV_PROPFIND:
                doPropFind(request, response, resource);
                break;
            case DavMethods.DAV_PROPPATCH:
                doPropPatch(request, response, resource);
                break;
            case DavMethods.DAV_POST:
                doPost(request, response, resource);
                break;
            case DavMethods.DAV_PUT:
                doPut(request, response, resource);
                break;
            case DavMethods.DAV_DELETE:
                doDelete(request, response, resource);
                break;
            case DavMethods.DAV_COPY:
                doCopy(request, response, resource);
                break;
            case DavMethods.DAV_MOVE:
                doMove(request, response, resource);
                break;
            case DavMethods.DAV_MKCOL:
                doMkCol(request, response, resource);
                break;
            case DavMethods.DAV_OPTIONS:
                doOptions(request, response, resource);
                break;
            case DavMethods.DAV_LOCK:
                doLock(request, response, resource);
                break;
            case DavMethods.DAV_UNLOCK:
                doUnlock(request, response, resource);
                break;
            case DavMethods.DAV_ORDERPATCH:
                doOrderPatch(request, response, resource);
                break;
            case DavMethods.DAV_SUBSCRIBE:
                doSubscribe(request, response, resource);
                break;
            case DavMethods.DAV_UNSUBSCRIBE:
                doUnsubscribe(request, response, resource);
                break;
            case DavMethods.DAV_POLL:
                doPoll(request, response, resource);
                break;
            case DavMethods.DAV_SEARCH:
                doSearch(request, response, resource);
                break;
            case DavMethods.DAV_VERSION_CONTROL:
                doVersionControl(request, response, resource);
                break;
            case DavMethods.DAV_LABEL:
                doLabel(request, response, resource);
                break;
            case DavMethods.DAV_REPORT:
                doReport(request, response, resource);
                break;
            case DavMethods.DAV_CHECKIN:
                doCheckin(request, response, resource);
                break;
            case DavMethods.DAV_CHECKOUT:
                doCheckout(request, response, resource);
                break;
            case DavMethods.DAV_UNCHECKOUT:
                doUncheckout(request, response, resource);
                break;
            case DavMethods.DAV_MERGE:
                doMerge(request, response, resource);
                break;
            case DavMethods.DAV_UPDATE:
                doUpdate(request, response, resource);
                break;
            case DavMethods.DAV_MKWORKSPACE:
                doMkWorkspace(request, response, resource);
                break;
            case DavMethods.DAV_MKACTIVITY:
                doMkActivity(request, response, resource);
                break;
            case DavMethods.DAV_BASELINE_CONTROL:
                doBaselineControl(request, response, resource);
                break;
            case DavMethods.DAV_ACL:
                doAcl(request, response, resource);
                break;
            case DavMethods.DAV_REBIND:
                doRebind(request, response, resource);
                break;
            case DavMethods.DAV_UNBIND:
                doUnbind(request, response, resource);
                break;
            case DavMethods.DAV_BIND:
                doBind(request, response, resource);
                break;
            default:
                // any other method
                return false;
        }
        return true;
    }

    /**
     * The OPTION method
     *
     * @param request
     * @param response
     * @param resource
     */
    protected void doOptions(WebdavRequest request, WebdavResponse response,
                             DavResource resource) throws IOException, DavException {
        response.addHeader(DavConstants.HEADER_DAV, resource.getComplianceClass());
        response.addHeader("Allow", resource.getSupportedMethods());
        response.addHeader("MS-Author-Via", DavConstants.HEADER_DAV);
        if (resource instanceof SearchResource) {
            String[] langs = ((SearchResource) resource).getQueryGrammerSet().getQueryLanguages();
            for (String lang : langs) {
                response.addHeader(SearchConstants.HEADER_DASL, "<" + lang + ">");
            }
        }
        // with DeltaV the OPTIONS request may contain a Xml body.
        OptionsResponse oR = null;
        OptionsInfo oInfo = request.getOptionsInfo();
        if (oInfo != null && resource instanceof DeltaVResource) {
            oR = ((DeltaVResource) resource).getOptionResponse(oInfo);
        }
        if (oR == null) {
            response.setStatus(DavServletResponse.SC_OK);
        } else {
            response.sendXmlResponse(oR, DavServletResponse.SC_OK);
        }
    }

    /**
     * The HEAD method
     *
     * @param request
     * @param response
     * @param resource
     * @throws IOException
     */
    protected void doHead(WebdavRequest request, WebdavResponse response,
                          DavResource resource) throws IOException {
        spoolResource(request, response, resource, false);
    }

    /**
     * The GET method
     *
     * @param request
     * @param response
     * @param resource
     * @throws IOException
     */
    protected void doGet(WebdavRequest request, WebdavResponse response,
                         DavResource resource) throws IOException, DavException {
        spoolResource(request, response, resource, true);
    }

    /**
     * @param request
     * @param response
     * @param resource
     * @param sendContent
     * @throws IOException
     */
    private void spoolResource(WebdavRequest request, WebdavResponse response,
                               DavResource resource, boolean sendContent)
            throws IOException {

        if (!resource.exists()) {
            response.sendError(HttpServletResponse.SC_NOT_FOUND);
            return;
        }

        long modSince = request.getDateHeader("If-Modified-Since");
        if (modSince > UNDEFINED_TIME) {
            long modTime = resource.getModificationTime();
            // test if resource has been modified. note that formatted modification
            // time lost the milli-second precision
            if (modTime != UNDEFINED_TIME && (modTime / 1000 * 1000) <= modSince) {
                // resource has not been modified since the time indicated in the
                // 'If-Modified-Since' header.
                response.setStatus(HttpServletResponse.SC_NOT_MODIFIED);
                return;
            }
        }

        // spool resource properties and eventually resource content.
        OutputStream out = (sendContent) ? response.getOutputStream() : null;
        resource.spool(getOutputContext(response, out));
        response.flushBuffer();
    }

    /**
     * The PROPFIND method
     *
     * @param request
     * @param response
     * @param resource
     * @throws IOException
     */
    protected void doPropFind(WebdavRequest request, WebdavResponse response,
                              DavResource resource) throws IOException, DavException {

        if (!resource.exists()) {
            response.sendError(DavServletResponse.SC_NOT_FOUND);
            return;
        }

        int depth = request.getDepth(DEPTH_INFINITY);
        DavPropertyNameSet requestProperties = request.getPropFindProperties();
        int propfindType = request.getPropFindType();

        MultiStatus mstatus = new MultiStatus();
        mstatus.addResourceProperties(resource, requestProperties, propfindType, depth);
        response.sendMultiStatus(mstatus);
    }

    /**
     * The PROPPATCH method
     *
     * @param request
     * @param response
     * @param resource
     * @throws IOException
     */
    protected void doPropPatch(WebdavRequest request, WebdavResponse response,
                               DavResource resource)
            throws IOException, DavException {

        List<? extends PropEntry> changeList = request.getPropPatchChangeList();
        if (changeList.isEmpty()) {
            response.sendError(DavServletResponse.SC_BAD_REQUEST);
            return;
        }

        MultiStatus ms = new MultiStatus();
        MultiStatusResponse msr = resource.alterProperties(changeList);
        ms.addResponse(msr);
        response.sendMultiStatus(ms);
    }

    /**
     * The POST method. Delegate to PUT
     *
     * @param request
     * @param response
     * @param resource
     * @throws IOException
     * @throws DavException
     */
    protected void doPost(WebdavRequest request, WebdavResponse response,
                          DavResource resource) throws IOException, DavException {
        doPut(request, response, resource);
    }

    /**
     * The PUT method
     *
     * @param request
     * @param response
     * @param resource
     * @throws IOException
     * @throws DavException
     */
    protected void doPut(WebdavRequest request, WebdavResponse response,
                         DavResource resource) throws IOException, DavException {

        DavResource parentResource = resource.getCollection();
        if (parentResource == null || !parentResource.exists()) {
            // parent does not exist
            response.sendError(DavServletResponse.SC_CONFLICT);
            return;
        }

        int status;
        // test if resource already exists
        if (resource.exists()) {
            status = DavServletResponse.SC_NO_CONTENT;
        } else {
            status = DavServletResponse.SC_CREATED;
        }

        parentResource.addMember(resource, getInputContext(request, request.getInputStream()));
        response.setStatus(status);
    }

    /**
     * The MKCOL method
     *
     * @param request
     * @param response
     * @param resource
     * @throws IOException
     * @throws DavException
     */
    protected void doMkCol(WebdavRequest request, WebdavResponse response,
                           DavResource resource) throws IOException, DavException {

        DavResource parentResource = resource.getCollection();
        if (parentResource == null || !parentResource.exists() || !parentResource.isCollection()) {
            // parent does not exist or is not a collection
            response.sendError(DavServletResponse.SC_CONFLICT);
            return;
        }
        // shortcut: mkcol is only allowed on deleted/non-existing resources
        if (resource.exists()) {
            response.sendError(DavServletResponse.SC_METHOD_NOT_ALLOWED);
            return;
        }

        if (request.getContentLength() > 0 || request.getHeader("Transfer-Encoding") != null) {
            parentResource.addMember(resource, getInputContext(request, request.getInputStream()));
        } else {
            parentResource.addMember(resource, getInputContext(request, null));
        }
        response.setStatus(DavServletResponse.SC_CREATED);
    }

    /**
     * The DELETE method
     *
     * @param request
     * @param response
     * @param resource
     * @throws IOException
     * @throws DavException
     */
    protected void doDelete(WebdavRequest request, WebdavResponse response,
                            DavResource resource) throws IOException, DavException {
        DavResource parent = resource.getCollection();
        if (parent != null) {
            parent.removeMember(resource);
            response.setStatus(DavServletResponse.SC_NO_CONTENT);
        } else {
            response.sendError(DavServletResponse.SC_FORBIDDEN, "Cannot remove the root resource.");
        }
    }

    /**
     * The COPY method
     *
     * @param request
     * @param response
     * @param resource
     * @throws IOException
     * @throws DavException
     */
    protected void doCopy(WebdavRequest request, WebdavResponse response,
                          DavResource resource) throws IOException, DavException {

        // only depth 0 and infinity is allowed
        int depth = request.getDepth(DEPTH_INFINITY);
        if (!(depth == DEPTH_0 || depth == DEPTH_INFINITY)) {
            response.sendError(DavServletResponse.SC_BAD_REQUEST);
            return;
        }

        DavResource destResource = getResourceFactory().createResource(request.getDestinationLocator(), request, response);
        int status = validateDestination(destResource, request, true);
        if (status > DavServletResponse.SC_NO_CONTENT) {
            response.sendError(status);
            return;
        }

        resource.copy(destResource, depth == DEPTH_0);
        response.setStatus(status);
    }

    /**
     * The MOVE method
     *
     * @param request
     * @param response
     * @param resource
     * @throws IOException
     * @throws DavException
     */
    protected void doMove(WebdavRequest request, WebdavResponse response,
                          DavResource resource) throws IOException, DavException {

        DavResource destResource = getResourceFactory().createResource(request.getDestinationLocator(), request, response);
        int status = validateDestination(destResource, request, true);
        if (status > DavServletResponse.SC_NO_CONTENT) {
            response.sendError(status);
            return;
        }

        resource.move(destResource);
        response.setStatus(status);
    }

    /**
     * The BIND method
     *
     * @param request
     * @param response
     * @param resource the collection resource to which a new member will be added
     * @throws IOException
     * @throws DavException
     */
    protected void doBind(WebdavRequest request, WebdavResponse response,
                          DavResource resource) throws IOException, DavException {

        if (!resource.exists()) {
            response.sendError(DavServletResponse.SC_NOT_FOUND);
        }
        BindInfo bindInfo = request.getBindInfo();
        DavResource oldBinding = getResourceFactory().createResource(request.getHrefLocator(bindInfo.getHref()), request, response);
        if (!(oldBinding instanceof BindableResource)) {
            response.sendError(DavServletResponse.SC_METHOD_NOT_ALLOWED);
            return;
        }
        DavResource newBinding = getResourceFactory().createResource(request.getMemberLocator(bindInfo.getSegment()), request, response);
        int status = validateDestination(newBinding, request, false);
        if (status > DavServletResponse.SC_NO_CONTENT) {
            response.sendError(status);
            return;
        }
        ((BindableResource) oldBinding).bind(resource, newBinding);
        response.setStatus(status);
    }

    /**
     * The REBIND method
     *
     * @param request
     * @param response
     * @param resource the collection resource to which a new member will be added
     * @throws IOException
     * @throws DavException
     */
    protected void doRebind(WebdavRequest request, WebdavResponse response,
                            DavResource resource) throws IOException, DavException {

        if (!resource.exists()) {
            response.sendError(DavServletResponse.SC_NOT_FOUND);
        }
        RebindInfo rebindInfo = request.getRebindInfo();
        DavResource oldBinding = getResourceFactory().createResource(request.getHrefLocator(rebindInfo.getHref()), request, response);
        if (!(oldBinding instanceof BindableResource)) {
            response.sendError(DavServletResponse.SC_METHOD_NOT_ALLOWED);
            return;
        }
        DavResource newBinding = getResourceFactory().createResource(request.getMemberLocator(rebindInfo.getSegment()), request, response);
        int status = validateDestination(newBinding, request, false);
        if (status > DavServletResponse.SC_NO_CONTENT) {
            response.sendError(status);
            return;
        }
        ((BindableResource) oldBinding).rebind(resource, newBinding);
        response.setStatus(status);
    }

    /**
     * The UNBIND method
     *
     * @param request
     * @param response
     * @param resource the collection resource from which a member will be removed
     * @throws IOException
     * @throws DavException
     */
    protected void doUnbind(WebdavRequest request, WebdavResponse response,
                            DavResource resource) throws IOException, DavException {

        UnbindInfo unbindInfo = request.getUnbindInfo();
        DavResource srcResource = getResourceFactory().createResource(request.getMemberLocator(unbindInfo.getSegment()), request, response);
        resource.removeMember(srcResource);
    }

    /**
     * Validate the given destination resource and return the proper status
     * code: Any return value greater/equal than {@link DavServletResponse#SC_NO_CONTENT}
     * indicates an error.
     *
     * @param destResource destination resource to be validated.
     * @param request
     * @param checkHeader flag indicating if the destination header must be present.
     * @return status code indicating whether the destination is valid.
     */
    protected int validateDestination(DavResource destResource, WebdavRequest request, boolean checkHeader)
            throws DavException {

        if (checkHeader) {
            String destHeader = request.getHeader(HEADER_DESTINATION);
            if (destHeader == null || "".equals(destHeader)) {
                return DavServletResponse.SC_BAD_REQUEST;
            }
        }
        if (destResource.getLocator().equals(request.getRequestLocator())) {
            return DavServletResponse.SC_FORBIDDEN;
        }

        int status;
        if (destResource.exists()) {
            if (request.isOverwrite()) {
                // matching if-header required for existing resources
                if (!request.matchesIfHeader(destResource)) {
                    return DavServletResponse.SC_PRECONDITION_FAILED;
                } else {
                    // overwrite existing resource
                    destResource.getCollection().removeMember(destResource);
                    status = DavServletResponse.SC_NO_CONTENT;
                }
            } else {
                // cannot copy/move to an existing item, if overwrite is not forced
                return DavServletResponse.SC_PRECONDITION_FAILED;
            }
        } else {
            // destination does not exist >> copy/move can be performed
            status = DavServletResponse.SC_CREATED;
        }
        return status;
    }

    /**
     * The LOCK method
     *
     * @param request
     * @param response
     * @param resource
     * @throws IOException
     * @throws DavException
     */
    protected void doLock(WebdavRequest request, WebdavResponse response,
                          DavResource resource) throws IOException, DavException {

        LockInfo lockInfo = request.getLockInfo();
        if (lockInfo.isRefreshLock()) {
            // refresh any matching existing locks
            ActiveLock[] activeLocks = resource.getLocks();
            List<ActiveLock> lList = new ArrayList<ActiveLock>();
            for (ActiveLock activeLock : activeLocks) {
                // adjust lockinfo with type/scope retrieved from the lock.
                lockInfo.setType(activeLock.getType());
                lockInfo.setScope(activeLock.getScope());

                DavProperty<?> etagProp = resource.getProperty(DavPropertyName.GETETAG);
                String etag = etagProp != null ? String.valueOf(etagProp.getValue()) : "";
                if (request.matchesIfHeader(resource.getHref(), activeLock.getToken(), etag)) {
                    lList.add(resource.refreshLock(lockInfo, activeLock.getToken()));
                }
            }
            if (lList.isEmpty()) {
                throw new DavException(DavServletResponse.SC_PRECONDITION_FAILED);
            }
            ActiveLock[] refreshedLocks = lList.toArray(new ActiveLock[lList.size()]);
            response.sendRefreshLockResponse(refreshedLocks);
        } else {
            int status = HttpServletResponse.SC_OK;
            if (!resource.exists()) {
                // lock-empty requires status code 201 (Created)
                status = HttpServletResponse.SC_CREATED;
            }

            // create a new lock
            ActiveLock lock = resource.lock(lockInfo);

            CodedUrlHeader header = new CodedUrlHeader(
                    DavConstants.HEADER_LOCK_TOKEN, lock.getToken());
            response.setHeader(header.getHeaderName(), header.getHeaderValue());

            DavPropertySet propSet = new DavPropertySet();
            propSet.add(new LockDiscovery(lock));
            response.sendXmlResponse(propSet, status);
        }
    }

    /**
     * The UNLOCK method
     *
     * @param request
     * @param response
     * @param resource
     * @throws DavException
     */
    protected void doUnlock(WebdavRequest request, WebdavResponse response,
                            DavResource resource) throws DavException {
        // get lock token from header
        String lockToken = request.getLockToken();
        TransactionInfo tInfo = request.getTransactionInfo();
        if (tInfo != null) {
            ((TransactionResource) resource).unlock(lockToken, tInfo);
        } else {
            resource.unlock(lockToken);
        }
        response.setStatus(DavServletResponse.SC_NO_CONTENT);
    }

    /**
     * The ORDERPATCH method
     *
     * @param request
     * @param response
     * @param resource
     * @throws IOException
     * @throws DavException
     */
    protected void doOrderPatch(WebdavRequest request,
                                WebdavResponse response,
                                DavResource resource)
            throws IOException, DavException {

        if (!(resource instanceof OrderingResource)) {
            response.sendError(DavServletResponse.SC_METHOD_NOT_ALLOWED);
            return;
        }

        OrderPatch op = request.getOrderPatch();
        if (op == null) {
            response.sendError(DavServletResponse.SC_BAD_REQUEST);
            return;
        }
        // perform reordering of internal members
        ((OrderingResource) resource).orderMembers(op);
        response.setStatus(DavServletResponse.SC_OK);
    }

    /**
     * The SUBSCRIBE method
     *
     * @param request
     * @param response
     * @param resource
     * @throws IOException
     * @throws DavException
     */
    protected void doSubscribe(WebdavRequest request,
                               WebdavResponse response,
                               DavResource resource)
            throws IOException, DavException {

        if (!(resource instanceof ObservationResource)) {
            response.sendError(DavServletResponse.SC_METHOD_NOT_ALLOWED);
            return;
        }

        SubscriptionInfo info = request.getSubscriptionInfo();
        if (info == null) {
            response.sendError(DavServletResponse.SC_UNSUPPORTED_MEDIA_TYPE);
            return;
        }
        Subscription subs = ((ObservationResource) resource).subscribe(info, request.getSubscriptionId());
        response.sendSubscriptionResponse(subs);
    }

    /**
     * The UNSUBSCRIBE method
     *
     * @param request
     * @param response
     * @param resource
     * @throws IOException
     * @throws DavException
     */
    protected void doUnsubscribe(WebdavRequest request,
                                 WebdavResponse response,
                                 DavResource resource)
            throws IOException, DavException {

        if (!(resource instanceof ObservationResource)) {
            response.sendError(DavServletResponse.SC_METHOD_NOT_ALLOWED);
            return;
        }
        ((ObservationResource) resource).unsubscribe(request.getSubscriptionId());
        response.setStatus(DavServletResponse.SC_NO_CONTENT);
    }

    /**
     * The POLL method
     *
     * @param request
     * @param response
     * @param resource
     * @throws IOException
     * @throws DavException
     */
    protected void doPoll(WebdavRequest request,
                          WebdavResponse response,
                          DavResource resource)
            throws IOException, DavException {

        if (!(resource instanceof ObservationResource)) {
            response.sendError(DavServletResponse.SC_METHOD_NOT_ALLOWED);
            return;
        }
        EventDiscovery ed = ((ObservationResource) resource).poll(
                request.getSubscriptionId(), request.getPollTimeout());
        response.sendPollResponse(ed);
    }

    /**
     * The VERSION-CONTROL method
     *
     * @param request
     * @param response
     * @param resource
     * @throws DavException
     * @throws IOException
     */
    protected void doVersionControl(WebdavRequest request, WebdavResponse response,
                                    DavResource resource)
            throws DavException, IOException {
        if (!(resource instanceof VersionableResource)) {
            response.sendError(DavServletResponse.SC_METHOD_NOT_ALLOWED);
            return;
        }
        ((VersionableResource) resource).addVersionControl();
    }

    /**
     * The LABEL method
     *
     * @param request
     * @param response
     * @param resource
     * @throws DavException
     * @throws IOException
     */
    protected void doLabel(WebdavRequest request, WebdavResponse response,
                           DavResource resource)
            throws DavException, IOException {

        LabelInfo labelInfo = request.getLabelInfo();
        if (resource instanceof VersionResource) {
            ((VersionResource) resource).label(labelInfo);
        } else if (resource instanceof VersionControlledResource) {
            ((VersionControlledResource) resource).label(labelInfo);
        } else {
            // any other resource type that does not support a LABEL request
            response.sendError(DavServletResponse.SC_METHOD_NOT_ALLOWED);
        }
    }

    /**
     * The REPORT method
     *
     * @param request
     * @param response
     * @param resource
     * @throws DavException
     * @throws IOException
     */
    protected void doReport(WebdavRequest request, WebdavResponse response,
                            DavResource resource)
            throws DavException, IOException {
        ReportInfo info = request.getReportInfo();
        Report report;
        if (resource instanceof DeltaVResource) {
            report = ((DeltaVResource) resource).getReport(info);
        } else if (resource instanceof AclResource) {
            report = ((AclResource) resource).getReport(info);
        } else {
            response.sendError(DavServletResponse.SC_METHOD_NOT_ALLOWED);
            return;
        }

        int statusCode = (report.isMultiStatusReport()) ? DavServletResponse.SC_MULTI_STATUS : DavServletResponse.SC_OK;
        response.sendXmlResponse(report, statusCode);
    }

    /**
     * The CHECKIN method
     *
     * @param request
     * @param response
     * @param resource
     * @throws DavException
     * @throws IOException
     */
    protected void doCheckin(WebdavRequest request, WebdavResponse response,
                             DavResource resource)
            throws DavException, IOException {

        if (!(resource instanceof VersionControlledResource)) {
            response.sendError(DavServletResponse.SC_METHOD_NOT_ALLOWED);
            return;
        }
        String versionHref = ((VersionControlledResource) resource).checkin();
        response.setHeader(DeltaVConstants.HEADER_LOCATION, versionHref);
        response.setStatus(DavServletResponse.SC_CREATED);
    }

    /**
     * The CHECKOUT method
     *
     * @param request
     * @param response
     * @param resource
     * @throws DavException
     * @throws IOException
     */
    protected void doCheckout(WebdavRequest request, WebdavResponse response,
                              DavResource resource)
            throws DavException, IOException {
        if (!(resource instanceof VersionControlledResource)) {
            response.sendError(DavServletResponse.SC_METHOD_NOT_ALLOWED);
            return;
        }
        ((VersionControlledResource) resource).checkout();
    }

    /**
     * The UNCHECKOUT method
     *
     * @param request
     * @param response
     * @param resource
     * @throws DavException
     * @throws IOException
     */
    protected void doUncheckout(WebdavRequest request, WebdavResponse response,
                                DavResource resource)
            throws DavException, IOException {
        if (!(resource instanceof VersionControlledResource)) {
            response.sendError(DavServletResponse.SC_METHOD_NOT_ALLOWED);
            return;
        }
        ((VersionControlledResource) resource).uncheckout();
    }

    /**
     * The MERGE method
     *
     * @param request
     * @param response
     * @param resource
     * @throws DavException
     * @throws IOException
     */
    protected void doMerge(WebdavRequest request, WebdavResponse response,
                           DavResource resource) throws DavException, IOException {

        if (!(resource instanceof VersionControlledResource)) {
            response.sendError(DavServletResponse.SC_METHOD_NOT_ALLOWED);
            return;
        }
        MergeInfo info = request.getMergeInfo();
        MultiStatus ms = ((VersionControlledResource) resource).merge(info);
        response.sendMultiStatus(ms);
    }

    /**
     * The UPDATE method
     *
     * @param request
     * @param response
     * @param resource
     * @throws DavException
     * @throws IOException
     */
    protected void doUpdate(WebdavRequest request, WebdavResponse response,
                            DavResource resource) throws DavException, IOException {

        if (!(resource instanceof VersionControlledResource)) {
            response.sendError(DavServletResponse.SC_METHOD_NOT_ALLOWED);
            return;
        }
        UpdateInfo info = request.getUpdateInfo();
        MultiStatus ms = ((VersionControlledResource) resource).update(info);
        response.sendMultiStatus(ms);
    }

    /**
     * The MKWORKSPACE method
     *
     * @param request
     * @param response
     * @param resource
     * @throws DavException
     * @throws IOException
     */
    protected void doMkWorkspace(WebdavRequest request, WebdavResponse response,
                                 DavResource resource) throws DavException, IOException {
        if (resource.exists()) {
            AbstractWebdavServlet.log.warn("Cannot create a new workspace. Resource already exists.");
            response.sendError(DavServletResponse.SC_FORBIDDEN);
            return;
        }

        DavResource parentResource = resource.getCollection();
        if (parentResource == null || !parentResource.exists() || !parentResource.isCollection()) {
            // parent does not exist or is not a collection
            response.sendError(DavServletResponse.SC_CONFLICT);
            return;
        }
        if (!(parentResource instanceof DeltaVResource)) {
            response.sendError(DavServletResponse.SC_METHOD_NOT_ALLOWED);
            return;
        }
        ((DeltaVResource) parentResource).addWorkspace(resource);
        response.setStatus(DavServletResponse.SC_CREATED);
    }

    /**
     * The MKACTIVITY method
     *
     * @param request
     * @param response
     * @param resource
     * @throws DavException
     * @throws IOException
     */
    protected void doMkActivity(WebdavRequest request, WebdavResponse response,
                                DavResource resource) throws DavException, IOException {
        if (resource.exists()) {
            AbstractWebdavServlet.log.warn("Unable to create activity: A resource already exists at the request-URL " + request.getRequestURL());
            response.sendError(DavServletResponse.SC_FORBIDDEN);
            return;
        }

        DavResource parentResource = resource.getCollection();
        if (parentResource == null || !parentResource.exists() || !parentResource.isCollection()) {
            // parent does not exist or is not a collection
            response.sendError(DavServletResponse.SC_CONFLICT);
            return;
        }
        // TODO: improve. see http://issues.apache.org/jira/browse/JCR-394
        if (!parentResource.getComplianceClass().contains(DavCompliance.ACTIVITY)) {
            response.sendError(DavServletResponse.SC_METHOD_NOT_ALLOWED);
            return;
        }

        if (!(resource instanceof ActivityResource)) {
            AbstractWebdavServlet.log.error("Unable to create activity: ActivityResource expected");
            response.sendError(DavServletResponse.SC_INTERNAL_SERVER_ERROR);
            return;
        }

        // try to add the new activity resource
        parentResource.addMember(resource, getInputContext(request, request.getInputStream()));

        // Note: mandatory cache control header has already been set upon response creation.
        response.setStatus(DavServletResponse.SC_CREATED);
    }

    /**
     * The BASELINECONTROL method
     *
     * @param request
     * @param response
     * @param resource
     * @throws DavException
     * @throws IOException
     */
    protected void doBaselineControl(WebdavRequest request, WebdavResponse response,
                                     DavResource resource)
        throws DavException, IOException {

        if (!resource.exists()) {
            AbstractWebdavServlet.log.warn("Unable to add baseline control. Resource does not exist " + resource.getHref());
            response.sendError(DavServletResponse.SC_NOT_FOUND);
            return;
        }
        // TODO: improve. see http://issues.apache.org/jira/browse/JCR-394
        if (!(resource instanceof VersionControlledResource) || !resource.isCollection()) {
            AbstractWebdavServlet.log.warn("BaselineControl is not supported by resource " + resource.getHref());
            response.sendError(DavServletResponse.SC_METHOD_NOT_ALLOWED);
            return;
        }

        // TODO : missing method on VersionControlledResource
        throw new DavException(DavServletResponse.SC_NOT_IMPLEMENTED);
        /*
        ((VersionControlledResource) resource).addBaselineControl(request.getRequestDocument());
        // Note: mandatory cache control header has already been set upon response creation.
        response.setStatus(DavServletResponse.SC_OK);
        */
    }

    /**
     * The SEARCH method
     *
     * @param request
     * @param response
     * @param resource
     * @throws DavException
     * @throws IOException
     */
    protected void doSearch(WebdavRequest request, WebdavResponse response,
                            DavResource resource) throws DavException, IOException {

        if (!(resource instanceof SearchResource)) {
            response.sendError(DavServletResponse.SC_METHOD_NOT_ALLOWED);
            return;
        }
        Document doc = request.getRequestDocument();
        if (doc != null) {
            SearchInfo sR = SearchInfo.createFromXml(doc.getDocumentElement());
            response.sendMultiStatus(((SearchResource) resource).search(sR));
        } else {
            // request without request body is valid if requested resource
            // is a 'query' resource.
            response.sendMultiStatus(((SearchResource) resource).search(null));
        }
    }

    /**
     * The ACL method
     *
     * @param request
     * @param response
     * @param resource
     * @throws DavException
     * @throws IOException
     */
    protected void doAcl(WebdavRequest request, WebdavResponse response,
                         DavResource resource) throws DavException, IOException {
        if (!(resource instanceof AclResource)) {
            response.sendError(DavServletResponse.SC_METHOD_NOT_ALLOWED);
            return;
        }
        Document doc = request.getRequestDocument();
        if (doc == null) {
            throw new DavException(DavServletResponse.SC_BAD_REQUEST, "ACL request requires a DAV:acl body.");
        }
        AclProperty acl = AclProperty.createFromXml(doc.getDocumentElement());
        ((AclResource)resource).alterAcl(acl);
    }

    /**
     * Return a new InputContext used for adding resource members
     *
     * @param request
     * @param in
     * @return
     * @see #spoolResource(WebdavRequest, WebdavResponse, DavResource, boolean)
     */
    protected InputContext getInputContext(DavServletRequest request, InputStream in) {
        return new InputContextImpl(request, in);
    }

    /**
     * Return a new OutputContext used for spooling resource properties and
     * the resource content
     *
     * @param response
     * @param out
     * @return
     * @see #doPut(WebdavRequest, WebdavResponse, DavResource)
     * @see #doPost(WebdavRequest, WebdavResponse, DavResource)
     * @see #doMkCol(WebdavRequest, WebdavResponse, DavResource)
     */
    protected OutputContext getOutputContext(DavServletResponse response, OutputStream out) {
        return new OutputContextImpl(response, out);
    }
}

redpajama_set_name: RedPajamaGithub


text:
Paramount Pictures Begins New 'Terminator' Trilogy in June of 2015
As if the year 2015 wasn't already crammed with big films like The Avengers 2, Pirates of the Caribbean 5, Independence Day 2 and hopefully Star Wars: Episode VII, another big franchise is arriving that summer. Paramount Pictures, Skydance Productions and Annapurna Pictures have just announced that they will be releasing Terminator on June 26th, 2015. However, the film is not exactly Terminator 5 as once thought as the press release calls it a rebooted movie and the first in a stand-alone trilogy. Despite recent confirmation from Arnold Schwarzenegger, there's no mention of the iconic actor in the announcement.
So what's the deal here? Well, Schwarzenegger could easily still be starring in the film as the titular killing machine, but the story just won't have anything to do with John Connor or any of the mythology created in the previous films. It would make sense considering the Terminator in the previous franchise was merely one out of an entire line of robotic assassins, so there's plenty of other assignments that these machines could be involved with around the world and through time. Hearing that this is the first in a planned stand-alone trilogy, with the first script coming from from Avatar and Shutter Island writer Laeta Kalogridis and Drive Angry writer and director Patrick Lussier, is pretty damn intriguing and exciting, so we hope to hear more soon. Sound good?
Find more posts: Development, Movie News, Sci-Fi
Reader Feedback - 35 Comments
Meh, because they changed the story around to be completely different doesn't mean it will be a sensible movie. Now you have time traveling Terminators trying to change human history in their favor? I suppose a terminator will be sent back to stop the Berlin wall from falling? No thanks, I'll stick to Back to the Future movies.
BinaryChaos on Jun 27, 2013
mooreworthy on Jun 27, 2013
Your avatar is sad
Liberals_are_morons on Jun 28, 2013
Yours is sadder.
avconsumer2 on Jun 28, 2013
I comment on films, not troll shite like that.
Don't forget they also have the entire run of stories that were produced from the Dark Horse Terminator comics.... All those stories were officially franchised along with all their Alien material too....
MovieLuvr on Jun 27, 2013
3 Production Houses? Too many cooks in the kitchen.
DAVIDPD on Jun 27, 2013
At this point it sounds like a bad idea, i would have rather seen where they were going to take the 5th movie in the franchise .. it wasnt over they had yet to send back whats his face but they introduced him. This could end up saving the terminator name though, it had been soiled after T3 & T:S, here to hoping it wont be shitty
Sky on Jun 27, 2013
Nielsen700 on Jun 27, 2013
I'm very open to the idea of a new trilogy but that Drivd Angry fuckbag better not have too much say.
Jon Odishaw on Jun 27, 2013
I'm optimistic...I think
N. on Jun 27, 2013
Been there, done that ... Terminate Terminator reboots, sequels, prequels and all other quels.
Hattori Hanzo on Jun 27, 2013
NOOOOOOOOOOOOOOOOOOO!!!!!!!!!!
John on Jun 27, 2013
Yeah sounds good good because Arnie is too old to play the terminator. So a reboot is the wisest thing to do...
Avi on Jun 27, 2013
Fuck Hollywood. Fuck reboots and remakes. Just make some original material. Stuff audiences haven't seen before. Take a fucking risk already.
kLO on Jun 27, 2013
Pacific Rim is an original and risky movie (although inspired by anime and the one I'm looking forward to), people keep bashing it, they are willing to watch that stupid Grown Up 2 than Pacific Rim. Besides its audience who want to watch pre-existing stuff rather than original movies. Don't blame everything on Hollywood, blame the audience. Plus, it's fans like me who want more of terminator movies that's why Hollywood is making more films for them. Damn, I'm tired of these MAPOTI's "fuck reboots and remakes, make original movies" comments -.-
terminator fan on Jun 28, 2013
Oh please. It's basically another Transformers movie.
Joblanksy on Jun 28, 2013
Well there is still Elysium
Mr Oddjob on Jun 28, 2013
The title might be original but, the idea sure as hell isn't.
Abel on Jul 6, 2013
I'd rather enjoy a 'Star Trek' like approach, use the time-travel aspect to create a new timeline that doesn't erase what came before. That's essentially what each sequel did, anyways. Each movie's time travel then changes the future a bit, resulting in more time travel down the road and a constantly evolving/re-writing of time...an example being how the occurrence of Judgement Day shifts from 1997 to 2004. But with Arnold and possibly Dwayne Johnson on board...that would make an optimist out of me. I also REALLY hope that they do an interested reboot as opposed to a full-blown remake of the original or something.
Chris Groves on Jun 27, 2013
SO long as they keep it in the J.Conner universe I would be fine with other stories. A full reboot would make me unhappy.
Brian Sleider on Jun 27, 2013
ENOUGH with the remakes and reboots, already! ENOUGH!
CHEWBACCA on Jun 27, 2013
Looks like its going the way of Friday the 13th
ak on Jun 27, 2013
so will Chris Nolan be attached to it, so they can make it Ground to Earth kinda movie AGAIN, may be some science being shed on time travel and how it came to be or a reason why those machines turned against humans or the machines behave that way cuz they were created and programmed by violent humans or a reason why machines became self aware and why did they turn against us humans and what made/how John connor become the Leader of the resistant team and how did machines discovered time travel or was it fed by human program ..... we have a lot of things to that can be looked at .... more to come ....
han solo on Jun 28, 2013
This sounds awful. Continue the story on from Salvation. Plan a new trilogy in the future wars and just recast Christian Bale who was awful as John Connor.
Last Son on Jun 28, 2013
Yeah, rumor mill will grind a while on this. I read that Arnold would be playing the human the Terminator was based on. I haven't read the Terminator comicbooks, but I believe that story is from there?
David Banner on Jun 28, 2013
ChrisIlls on Jun 28, 2013
Why don't they concentrate on making ONE good Terminator movie to begin with, instead of planning a new trilogy already!? The original and T2 were awesome, but I'm not really interested in this franchise anymore; they're just trying to make money instead of making good movies!
moutchy on Jun 28, 2013
Yeesh... so. many. reboots. If there's yet another actor playing John Connor, I'm out. If it's a completely new story line... possibly even paralleling the existing universe... maybe. I'm cool with the way Orci & Kurtzman did Trek. Who knows. Maybe.
2015 Terminator (reboot, similar to T1 and T2) 2017 Terminators (the machines rise) 2019 Terminated (future war)
Avatar1209 on Jun 28, 2013
Drive Angry writer.... oh crap.
Fidel Reyes on Jun 28, 2013
Is Pat Lussier being considered an actual writer now. Don't get me wrong he's a good editor and I understand a director writing his/her own material but... PATRICK LUSSIER.
Samurai Jammer on Jun 28, 2013
OMG I want a trilogy of salvation like they said they would do! Bale is CONNOR Period!
SkyNet300 on Jun 29, 2013
Oh man, I hated him as Connor. As for the reboot: "I have a bad feeling about this"
Fox on Jun 30, 2013
Fox come on man! Bale was the Connor fans have been waiting for! He just didn't have enough screen time in the first installment. Sam "can't act" Worthington was clogging up the movie.
jigsawlegend33@gmail.com on Jul 1, 2013

redpajama_set_name: RedPajamaCommonCrawl


text:
Q: Two Tables Add New Row Button - Conflicting I have two tables, each with different ID's.  I have a button below each table that adds a row (or so I want it to happen).  When I just have the one button to click it works but when I introduce another, the buttons on both tables no longer work so I'm guessing there is a conflict between the two.  Here are the tables:
Table 1

Column 1	Column 2

<button type='button' onclick='displayResult()'>Add New Row</button>

Table 2

Column 1	Column 2

<button type='button' onclick='displayResultEdit()'>Add New Row</button>

The javascript:
function displayResult()
{
var table=document.getElementById("addTable");
var row=table.insertRow(2);
var cell1=row.insertCell(0);
var cell2=row.insertCell(1);
cell1.innerHTML="Additional row to column one on the Add table";
cell2.innerHTML="Additional row to column two on the Add table";
}

function displayResultEdit()
{
var table=document.getElementById("editTable");
var row=table.insertRow(2);
var cell1=row.insertCell(0);
var cell2=row.insertCell(1);
cell1.innerHTML="Additional row to column one on the Edit table";
cell2.innerHTML="Additional row to column two on the Edit table";
}

This is saved in a .js file and called upon below the tables.  As I said, the table row gets added if only one table is present (and the top set of javascript) but when I introduce another, when you click the button nothing happens.
Hope you can help..

A: Both work just fine if you fix the index bug you have in insertRow:
var row=table.insertRow(2);

2 is an invalid index as there is only 1 row currently in the table and this is 0-indexed.  I dont' see how it could have ever worked.  This should be:
var row=table.insertRow(1);

http://jsfiddle.net/5Fdwk/

redpajama_set_name: RedPajamaStackExchange


PSY Week, 10th March to 18th March, the first ever Meme_Kitteh event!
Gundam Style for Anime weekend, an UnbreakLP, PowerMetalhead and isayisay event on Nov 25-27.
PSY week a Meme_Kitteh event!
PSY week, 10-18th March, the first ever Meme_Kitteh event!


 High CVE-2011-3050: Use-after-free with first-letter handling. Credit to miaubiz.
 High CVE-2011-3051: Use-after-free in CSS cross-fade handling. Credit to Arthur Gerkis.
 High CVE-2011-3053: Use-after-free in block splitting. Credit to miaubiz.
 High CVE-2011-3056: Cross-origin violation with "magic iframe". Credit to Sergey Glazunov.
lucid-oneiric now have packages in their respective proposed repository .


Your favorite community of Lake Jackson apartments is back with another brand new blog post, and this one is all about the best restaurants in the area! In the blog post below, we'll be sharing some reviews of the most popular eateries in the Lake Jackson area. There are a lot to choose from, but we've managed to whittle the list down to three of our favorite spots.
Without further delay, let's take a look at some of the reviews! When you're done reading through it, please be sure to share the link to this page with your friends and neighbors at Plantation Park — the luxury apartments Lake Jackson residents choose for comfort and style.
Reviews don't get much better than this one. Not only does Jane claim that Hoghenheiferz is the best barbecue she's ever had, but she also raves about the side dishes. It's one thing for a barbecue place to make delicious meat, but it's another for the restaurant to be able to serve delicious sides as well. If you like your barbecue to be tender and smothered in sauce, check out Hoghenheiferz BBQ in Lake Jackson.
When a restaurant managed to stay open as long as Dairy Bar has stayed open, you know it must be doing something right. Dairy Bar knows how to make the best grilled chicken sandwich in town, unbeatable chicken strips, and a burger than fills you up with some of the most flavorful patties you've ever tasted. Plus, they've got top-notch malts and milkshakes. This place is a classic, so give it a shot next time you need a cheat day meal!
That concludes our list of restaurant reviews! We'd like to thank those of you who have been coming back month after month to read all the latest blogs from Plantation Park, and we sincerely hope that you'll continue to check back when we post more blogs in the future! While you wait for those blogs to go up on our website, be sure to take some time out of your weekend to check out one of the top-rated restaurants on the list above.
If you feel like you learned something from this week's post and you want to see the next one right when it goes up on our website, please be sure to bookmark our blog page so you can enjoy easy access to the next post when it goes live. Until then, you can stay informed about all the events, promotions and giveaways happening in your community by following us on social media! There's no better way to ensure you're always in-the-know with what's happening at Plantation Park — the luxury apartments Lake Jackson residents choose for modern comfort and convenience.


MASVINGO – With the economic situation worsening in Zimbabwe and the populace struggling to pay council bills and putting food on the table, the city council is proposing to buy Apple iPhone 7 and Samsung Galaxy S9 smartphones for its managers.
The finance and general purpose meeting which sat on January 21, 2019, agreed that the city treasurer be instructed to procure conditions of service cellphones for management with heads of departments getting Apple iPhone 7 valued at US$ 3 088 while deputy heads of departments get Samsung Galaxy S9 valued at US$2 708.
Masvingo United Residents and Ratepayers Alliance (MURRA) spokesperson Godfrey Mtimba said they are appalled on the levels of extravagance showcased by the city council.
"This is the same city council which failed to purchase a small water pump component costing US$4 000 and the city went without water for more than a week.
"It's just a case of misplaced priorities and outrageous greediness. They say they do not have money and service delivery is plummeting but they want to spend over US$20 000 on cellphones, this is an abomination to say the least.
"The water challenges are refusing to go away and the city is faced with a lot of challenges which require discipline on finances not to be spendthrifts like we are seeing," said Mtimba.


text:
X-MEN: DARK PHOENIX Adding New and Old Characters to the Cast
Filming is now underway on the next main X-Men film, subtitled Dark Phoenix. The bulk of the cast from the First Class trilogy are coming back, along with new additions such as Jessica Chastain's Lilandra. Now, a new report suggests that four more characters are joining the cast – two are new, while we've met the other two before.
According to That Hashtag Show, actors Kota Eberhardt and Scott Shepherd have joined the X-Men universe. Eberhardt plays a character currently known as Luna, described as "…intense and exudes a sense of power. Although she is a commanding presence, she is also slightly unhinged." Meanwhile, Shepherd plays Dr. John Grey, the father of Jean Grey.
Additionally, Fox is in talks with actors Evan Jonigkeit and Gregg Lowe to reprise their roles of Toad and Ink, respectively, from 2014's X-Men: Days of Future Past. It's unknown exactly what their roles in Dark Phoenix would be, but That Hashtag Show speculates that the movie could feature Magneto assembling his Brotherhood of Evil Mutants, hence why Toad would show up.
Stay tuned for more news as we have it.
X-Men: Dark Phoenix is scheduled to hit theaters on November 2nd, 2018. The 13th installment of the X-Men series stars Sophie Turner, James McAvoy, Michael Fassbender, Jennifer Lawrence, Nicholas Hoult, Tye Sheridan, Alexandra Shipp, Kodi Smit-McPhee, Evan Peters, and Jessica Chastain. Simon Kinberg writes and directs.
Katie Rentschler
Contributor at WOBAM! Entertainment
Clemson University Graduate. Lover of all things Star Wars and DC.
Latest posts by Katie Rentschler (see all)
Slice of Dune: Part One: A Slice of Film Podcast - October 26, 2021
Slice of Army of the Dead: A Slice of Film Podcast - May 28, 2021
Slice of Jurassic Park 3: A Slice of Film Podcast - May 23, 2021
By Katie Rentschler
FLASH SPOILER Review: Episode 4×16- "Run Iris, Run"
WONDER WOMAN 2 Director Patty Jenkins Teases New Love Interest and Characters
Review: BATMAN FOREVER


text:
<!DOCTYPE html>

		<meta charset="utf-8">
		<title>Adaptive Card Accessibility Testing Samples</title>
		<link href="AdaptiveCard.css" rel="stylesheet">

Adaptive Card Accessibility Testing

			<ui-integration-card id="my-input-card" manifest="./adaptive-card-inputs.json"></ui-integration-card>

			<ui-integration-card id="my-richtext-adaptive-card" manifest="./adaptive-card-richtext.json"></ui-integration-card>


Home / Trending Now / Dine with Royalty. Literally.
It's not everyday that you get to brush shoulders with royalty. In India's new initiative, Indian royals are hosting guests as they open up their kitchens and serve the best they offer whilst entertaining you with family stories as well as the history of some of their famous dishes.
Food isn't the only thing on the menu when you opt for this experience. Heritage is the key highlight. While preserving centuries-old recipes and traditions, the royals have changed many a recipe – proving that India moves with the century.
Before the royals dazzle you, you have the unique opportunity to read about the different royal families and pick one that you'd like to meet.
Don't be fooled by the image that most royal families have. Most royals in India are working professionals and proud of it. If you're worried that you would have to be on your guard, just be yourself! These royals are most definitely relatable and have lives just like us.
If you're looking for an unforgettable experience, this is right up your street.


text:
"Somebody Up There Likes You"
Free Will and Determinism on a Journey through Space in Kurt Vonnegut's The Sirens of Titan (1959)
Raymond Radford University of Sydney
https://doi.org/10.1558/imre.34366
science fiction, Kurt Vonnegut, free will, determinism, pilgrimage
Kurt Vonnegut's Sirens of Titan (1959) is the story of the world's richest man caught up in the machinations of an unfeeling universe. Vonnegut discusses the place of humanity in the universe, and the problems inherent in society. This novel is used primarily to explore the way that pilgrimage functions in a real, and tangible world, primarily the way that pilgrimage is seen as freedom of choice for when and where a pilgrim will go on pilgrimage. Using Sirens of Titan this article will investigate the concept of free will, choice and determinism within both a fictional world and a real world in which all characters believe they are in control of their own destiny. Through characters such as Malachi Constant, determinism, religion, free will, and choice shall be explored through the lens of pilgrimage with the expressed desire to find one's self or answers they seek. Free will and determinism is explored through the usage of Sam Harris and Daniel C. Dennett whose theories about free will allow for concepts to be explored within science-fiction and that of real-life pilgrimage, and the change that these journeys bring for the pilgrim. This article shall also explore the context of the journey, be it a quest or a pilgrimage, both of which are performed for higher reasons. These higher reasons are explored as reasons why pilgrimages and quests are undertaken, and whether these journeys are undertaken freely, or has the universe indeed mandated that this is the time and place a pilgrim will undertake their journey.
Blogdispiccioli. 2004. Kurt Vonnegut—So It Goes BBC Documentary Arena 1983. https://youtu.be/NDS-rtbW5KU
Broer, Lawrence R. 1989. Sanity Plea: Schizophrenia in the Novels of Kurt Vonnegut. Studies in Speculative Fiction 18. Ann Arbor, MI: UMI Research Press.
Dennett, Daniel C. 1984. Elbow Room: The Varieties of Free Will Worth Wanting. Cambridge, MA: MIT Press.
Digance, Justine. 2003. "Pilgrimage at Contested Sites." Annals of Tourism
Research 30(1): 143–159. https://doi.org/10.1016/S0160-7383(02)00028-2
———. 2014. "Religious and secular pilgrimage: Journeys redolent with meaning." In Religion, Pilgrimage, and Tourism, edited by Alex Norman and Carole M. Cusack, 249–261. New York: Routledge.
DuBose, Todd. 2014. "Fate." In Encyclopedia of Psychology and Religion, edited by David A. Leeming, 659–661. Boston, MA: Springer US. https://doi.org/10.1007/978-1-4614-6086-2_232
FitzGerald, Desmond J. 1989. "Adler's The Idea of Freedom." In Freedom in the Modern World, edited by Jacques Maritain, Yves R. Simon, and Mortimer J. Adler, 47–56. New York: Gordian Press.
Foran, Donna. 2001. "Kurt Vonnegut's Search for Soul." In Issues in Travel Writing: Empire, Spectacle, and Displacement, edited by Kristi Siegel, 179–196. New York: Peter Lang.
Glover, Chris. 2009. '"Somewhere in there was springtime': Kurt Vonnegut, his apocalypses, and his post-9/11 heirs." In New Critical Essays on Kurt Vonnegut, edited by David Simmons, 193–212. New York: Palgrave Macmillan. https://doi.org/10.1057/9780230100817_11
Haq, Farooq and John Jackson. 2009. "Spiritual journey to Hajj: Australian and Pakistani experience and expectations." Journal of Management, Spirituality & Religion 6(2): 141–156. https://doi.org/10.1080/14766080902815155
Harris, Sam. 2010. The Moral Landscape: How Science Can Determine Human Values. New York: Free Press.
———. 2012. Free Will. New York: Free Press.
Hasker, William. 2011. "Divine knowledge and human freedom." In The Oxford Handbook of Free Will, edited by Robert Kane, 39–55. Oxford: Oxford University Press. https://doi.org/10.1093/oxfordhb/9780195399691.003.0002
Marvin, Thomas F. 2002. Kurt Vonnegut: A Critical Companion. Critical Companions to Popular Contemporary Writers. Westport, CT: Greenwood Press.
May, John R. 1972. "Vonnegut's humor and the limits of hope." Twentieth Century Literature 18(1): 25–36. https://doi.org/10.2307/440692
Mustazza, Leonard. 1990. Forever Pursuing Genesis: The Myth of Eden in the Novels of Kurt Vonnegut. Lewisburg, PA: Bucknell University Press.
Norman, Alex. 2011. Spiritual Tourism: Travel and Religious Practice in Western Society. London: Continuum International.
Pascual, Mónica Calvo. 2001. "Kurt Vonnegut's The Sirens of Titan: Human will in a Newtownian narrative gone chaotic." Miscelánea: A Journal of English and American Studies 24: 53–63.
Sandars, N. K., ed. 1977. The Epic of Gilgamesh. Revised ed., Incorporating new material. Penguin Classics. Harmondsworth. New York: Penguin.
Thacker, Eugene. 2015. Cosmic Pessimism. 1st edition. Pharmakon. Minneapolis, MN: Univocal Pub.
Thomas, Paul L. 2009. '"No damn cat, and no damn cradle": The fundamental flaws in fundamentalism according to Vonnegut." In New Critical Essays on Kurt Vonnegut, edited by David Simmons, 27–46. New York: Palgrave Macmillan. https://doi.org/10.1057/9780230100817_3
Van Nortwick, Thomas. 1996. Somewhere I Have Never Travelled: The Hero's Journey. Oxford: Oxford University Press.
Vidal, Clément. 2014. The Beginning and the End: The Meaning of Life in a Cosmological Perspective. The Frontiers Collection. Cham: Springer. https://doi.org/10.1007/978-3-319-05062-1
Vonnegut, Kurt. 1987. Cat's Cradle. Harmondsworth: Penguin Books.
——— 1991. Slaughterhouse-Five: Or, The Children's Crusade: A Duty-Dance with Death. London: Vintage.
———. 1999. The Sirens of Titan. London: Millennium.
Wepler, Ryan. 2011. '"I can't tell if you're being serious or not': Vonnegut's comic realism in Slaughterhouse-Five." Hungarian Journal of English and American Studies 17(1): 97–126.
Radford, R. (2018). "Somebody Up There Likes You": Free Will and Determinism on a Journey through Space in Kurt Vonnegut's The Sirens of Titan (1959). Implicit Religion, 20(2), 149–166. https://doi.org/10.1558/imre.34366
Related Interest
Tweets by@EQUINOXPUB


text:
Be Smarter Than a Toddler: 5 Ways To Avoid Reading Books to Your Kids
Column by Bart Bishop	April 12, 2017	1 comment
Children's Authors
Every parent of young children knows the experience. Your kid has started to read and you're so proud, but they've also latched on to a few certain books. This could last for days or weeks or even months, and as a 33-year-old individual there's only so much you can take—reading it to them every night, every day, sometimes all day. You're the adult, you're responsible for this little creature's upbringing, so you know you're doing the right thing. But inside your head you're screaming and dying a little.
In the last six months this has happened with my two-year-old daughter and with one book in particular. It's called That's Not My Mermaid. Written and illustrated by Fiona Watt and released in 2005, it's a board book for very young children, part of their popular Touchy-Feely series created by Watt. If you're not familiar with board books, they have the pages pasted to heavy cardboard, making them easy to grip and harder to destroy.
That's Not My Mermaid is one of many, many Usborne Books with the premise of "that's not my…", with each page showing different kinds of creatures from the title, in this case mermaids. Each page has different patches of texture on the mermaid designed to develop sensory awareness and language awareness in toddlers. The idea is that the kids touch each page to study the mermaids until they get to the last page that is, in fact, their mermaid, with a mirror for the child to look in.
It's your sanity at stake here, folks. You can't look at those cherubic mermaid faces one more time. You know every page by heart and it's murdering your soul.
In the Bishop household there's also That's Not My Snowman, That's Not My Reindeer and That's Not My Monkey. They're pretty big with the kid. The mermaid book, however, is at the apex of a perfect storm in the development of my child.
See, she also loves The Little Mermaid because her mom and aunt love the movie too, and introduced it to her very early on. "Part of Your World" is the song my wife sings to our eldest daughter every night, and we also got her an Ariel doll that sings and can go underwater. The result is my daughter insists that while in the bath she's a mermaid, and splashes around like a mad woman.
It was all very cute…at first. Compounded with the fact that she also watches the TV show Sofia the First and one of the titular character's magical abilities is to transform into a mermaid, it was the culmination of several events.
Now I know what you're thinking: this guy lets his daughter watch way too much TV, and that TV needs to consist of much more than Disney. But don't be so quick to judge, my friend. Before kids you have high standards about "screen time," but just wait until the infant is screaming and the toddler is repeating "Ariel Ariel Ariel Ariel Ariel Ariel Ariel Ariel" 50 times in a row. You'll break. They all break.
So the insult to injury is this mermaid book that she wants to read every night after six months of it. And I have a few suggestions for you if you find yourself in a similar situation on how to outsmart the two-year-old.
1. Hide the Book
This one is almost guaranteed to fail. First of all, there's the aforementioned fact that kids have more willpower than you, and will never give up when it comes to insisting on getting their way. See the chant of "Ariel" up above. If you hide a book that your kid wants, they won't catch on that you hid it from them. They won't suspect that foul play is afoot. But they will incessantly seek out that book until the end of time, and they'll bring you along with them.
That's when you realize you're faking ignorance as to the location of the book that you hid. But you're also helping your toddler look for said book. It all comes crashing down that this is what you've been reduced to. But even though, as already stated, they don't realize you've pulled a fast one on them, you still feel compelled to come up with an elaborate way to act like you found the book. As if they would know any better.
2. Turn them on to Other Books
This is probably the best alternative. I have many ambitions for introducing my two daughters to my interests somewhere down the line. For instance, I have the entirety of the amazing graphic novels series Bone by Jeff Smith, all nine volumes lined up on my toddler's book shelf. But at least for the moment it's hard to sway her in a direction away from her natural inclinations. If you say, hey honey, why don't we read this tonight, she'll throw up her hands and say no no no no no , mermies (her word for mermaids).
But luckily there are natural occurrences of life that may push them in a certain direction. For example, last year my wife was pregnant with our second child, who is now a three-month-old infant. Our toddler, as far as I could tell, seemed to grasp the concept of another baby on the way but probably didn't feel its full weight. This came with a whole new set of emotions, namely jealousy and resentment. So we brought in a few new books.
The New Baby, written by Anne Civardi, illustrated by Stephen Cartwright and also from Usborne books (my wife has a friend that sells them), tells the story of the Bunn family. They are a traditionally nuclear family, with a little girl and boy, welcoming a new baby to the world. The grandparents come over to watch the children while the mom and dad go to the hospital, then they return with a baby girl. The rest of the book follows the transition of having the baby around, with bathing her and in a nicely progressive image the mother breastfeeding.
And for whatever reason this book really connected with my daughter. Perhaps it was because the family in the book very much resembled our own. Perhaps it's because she was clinging to a way to understand the changes in her world. But it worked as an educational tool and as an emotional salve. At least for a while.
Because eventually she went back to mermaids.
3. Spice Up Your Reading Performance
This really should be a prerequisite for all readings of books. There's a certain rhythm built in to most children's books anyway. They are either designed to rhyme like Dr. Seuss, or have a certain sense of setup and payoff from page to page. These things are only about a dozen pages long most of the time anyway.
So this book in particular has about a dozen mermaids, each with distinctive fashions and skin colors and settings. So mix things up a bit. Imagine that one of them is Irish and one of them is Jamaican. Go for a pirate voice and really bellow out those highs and whispers those lows.
The kid can sense blood in the water. They don't want you phoning it in. And the more you enjoy it, the more they enjoy it.
4. Get Mommy to Read It
This one may not score you points in the marriage or relationship department, but there's always steering the kid toward the other parent. There's no feeling in the world better than the love and admiration of your child…but it is nice to have some peace and quiet to yourself for a brief respite. So plant the seed in their head that your significant other, their other parent whether it be mommy or another mommy or another daddy, is the one that reads the book the best.
They do the best voices, they do the best faces and they have the best lap for sitting in. It's dirty pool, and of course you're sympathetic to the inner battle the other parent is going through in relation to the kids. If the mom is breastfeeding, for instance, she may be not just emotionally but physically exhausted on an actual caloric level.
But it's your sanity at stake here, folks. You can't look at those cherubic mermaid faces one more time. You know every page by heart and it's murdering your soul.
5. Accept and Embrace Your Cruel Fate
You've lost and now you're resigned to your fate. You'll be reading this book to your kid five times a day for the rest of your days. Or at least until they move on to The Very Hungry Caterpillar or something like that.
So entertain yourself. Start writing fan fiction about these mermaids in your head. Cross them over into the Marvel Universe. Ship them with one another. Or my personal favorite is imagining that they're trapped within the pages of the book and are trying to get you to touch them in a vain attempt at escape.
Yeah, I've read these books one too many times.
You may think I'm horrible, and you're probably right. But if you have kids you know that on the one hand you have these tiny bundles of joy that you would sacrifice everything, including your, life for but on the other they're kind of little screaming sociopaths and you're not sure if they're trying to kill you.
But you love them, you want them to succeed, you want them to be smart, and you also want them to be happy. So read the damn book.
That's Not My Mermaid... (Usborne Touchy-Feely Books)
Author: Fiona Watt
Publisher: Usborne (2012)
Binding: Board book, 10 pages
Column by Bart Bishop
A professor once told Bart Bishop that all literature is about "sex, death and religion," tainting his mind forever. A Master's in English later, he teaches college writing and tells his students the same thing, constantly, much to their chagrin. He's also edited two published novels and loves overthinking movies, books, the theater and fiction in all forms at such varied spots as CHUD, Bleeding Cool, CityBeat and Cincinnati Magazine. He lives in Cincinnati, Ohio with his wife and daughter.
Follow @BartLBishop
Five Inappropriate Parenting Books Every Reader Will Enjoy
Twisted And Wrong: 6 Children's Books Intended for Adults
12 Hysterical, Offensive, Ridiculous, Controversial, Frightening, Sexy Book Covers
10 Children's Books That Are (still) Frightening To Adults
Say Cheese! 12 Terrible Photos of Bestselling Authors
"Space Odyssey": How Science Fiction Can Predict the Future
The Complex Exploration of Sex and Identity in Christopher Buehlman's 'The Necromancer's House'
Catherynne M. Valente's 'Space Opera' and the Delights of a Plotless Novel
Wonderful and Strange: Twin Peaks — The Literary Tie-Ins
Analyzing The Last Two Decades of Online Film Criticism
The Key Lime	from Staten Island is reading The Hitchhiker's Guide to the Galaxy April 12, 2017 - 7:43pm
Two additional tricks I've employed at my house:
6. Can you read it to me? Sit back while the toddler adorably shouts random words from the book.
7. Facilitate its destruction Kid wants to read book. Offer water in a "big girl glass". Let water spill all over book. Oh no! Book is broken! Bye-bye book! (I have only done this once. I felt a little bad, but not really.)


text:
Latest Politics Entertainment Sports Business Swahili
Over 7,000 train passengers daily is enough proof Kenyans truly appreciate the SGR
Author: Rene Otinga
Category: TUKO.co.ke
On the first week after the launch of the Madaraka Express trains between Mombasa and Nairobi, 7,000 passengers traveled on the new line, the highest number Kenya Railways had recorded in its history.
Today, some two years down the line, the passenger numbers have grown drastically, with the SGR ferrying an average of 7,000 passengers between the two cities daily. Over 3.5 million passengers have used the service since operations started, generating billions of shillings in revenue.
READ ALSO: Governor Waititu's endless public humiliation proves why Uhuru Kenyatta's word must be taken seriously
READ ALSO: Civil Society must declare its secret agenda in ongoing 'anti-SGR' protests
The impressive figures highlight the overwhelming popularity of the SGR as the transport mode of choice for majority of Kenyans travelling to the coast and vice versa; a massive endorsement for the single biggest transformational infrastructural milestone in independent Kenya and the region.
Yet, it is cargo transport on the nearly 472km route that has had the most impact and success. Official data shows that over six million tonnes of cargo have been transported on the SGR so far. Kenya Railways generated sales of over KSh 5.7 billion in 2018 alone on the back of cargo business that opened long after the passenger service. The latter raked in a total of KSh 1.61 billion last year.
Over 22.8 million tonnes of cargo was handled in the eight months to August this year compared to 20.7 million tonnes over the same period last year, illustrating the steady continued growth. The freight hauled currently includes loose cargo such as steel coils, fertilizer, pallets and even grains.
READ ALSO: Likoni ferry passengers scamper for safety after commuter's phone bursts into flames
The Nairobi-Mombasa railway line, which is fully operational with 14 freight and four passenger trains, has greatly reduced the cost of moving goods between two of the country's biggest cities. At the moment, the cost of transporting imported and exported goods in East Africa accounts for 40 percent of total cargo charges.
The SGR, a towering flagship project of President Uhuru Kenyatta's administration, has revolutionized passenger transport in the country. It has proved a hit with travelers because of its speed and comfort, with the smooth train journey taking around 4.5 hours compared what can be a 12-hour, bone-rattling trip by road.
For passengers, the SGR has proved to be a safer and more convenient option, with no safety incidents recorded since launch.
By ferrying a huge chunk of cargo from the port of Mombasa, the SGR has greatly helped reduce the number of trucks on the accident-prone Nairobi-Mombasa highway, saving motorists the pain of enduring the infamous Mariakani weighbridge snarl-up that trapped people in traffic for hours on end.
Before the SGR, at least 95 per cent of cargo was being moved by road, with over 1,600 loaded trucks plying the Mombasa-Malaba route. The heavy trucks were a major contributor to excessive wear and tear that occasioned serious accidents on the highway and further necessitated costly regular road repairs.
Economically, more urban centers continue to emerge along the SGR line as Kenya's economy is market-based.
These new centers, supporting emerging local businesses, will help improve the fortunes of people living around by promoting the growth of key sectors such as agriculture, financial services and manufacturing.
More job openings have also been created along the complete route. Indirect jobs in sectors such as catering and entertainment have been created to support the need for goods and services by SGR passengers and employees.
This is not to mention that the project has directly created thousands of job opportunities for Kenyans.
On the Mombasa-Nairobi line alone, about 2,300 Kenyans from diverse professional backgrounds are working at the 33 train stations.
The railway has accelerated industrialization owing to increased demand for construction materials such as steel, electricity cables, roofing materials, cement, stones and glass, with construction-related industries particularly witnessing a boom in opportunities rarely seen before.
READ ALSO: Lady who cheated with Terrence Creative claims she's receiving threats from comedian's wife
With relative ease in moving goods and more markets due to a new network of trading routes, more manufacturing and processing plants in other sectors such as agriculture, forestry, fishing and mining will automatically emerge and grow.
But perhaps the greatest beneficiary of the railway line is the tourism sector, which dramatically resurrected with the launch of the line.
With a safer, convenient and low-cost means of transport, coupled with breathtaking scenery along the Nairobi-Mombasa route that passes through Tsavo National Park, tourist numbers have grown steadily, with the sector surpassing the two million mark for the first time in history last year.
There is every reason to believe that the newly launched SGR line from Nairobi to Naivasha, which will eventually be extended to Malaba, will see the same benefits that the Mombasa-Nairobi line has witnessed in the last two years.
The writer is Milan Kiplagat, a regular commentator on social and political matters.
The views expressed in this opinion piece are his and do not necessarily represent the position of TUKO Media Limited in any way.
We welcome writers, bloggers, photographers and all sorts of "noise makers" to become a part of our Blog network Send your opinion, story or both to news@tuko.co.ke.
I don't want to lose another child - Stella Wabomba | Tuko TV:
To get news every day from TUKO.co.ke
THANK YOU FOR YOUR SUBSCRIPTION! CHECK YOUR EMAIL AND FOLLOW THE INSTRUCTIONS.
SUBSCRIBE ERROR !
Meru boy who scored 417 marks appeals for help after he was turned away by principal Weekly wrap: Gladys Shollei's husband remarries, Lulu Hassan on struggles of working with hubby North Rift politicians claim Uhuru short-changed them during Cabinet reshuffle Liverpool vs Manchester United? Where is your money? US singer Rihanna splits with billionaire lover after three years of dating Showdown in Mumias as anti-BBI team is locked out of venue by police officers CS Magoha dissolves entire UoN council, revokes appointment of vice chancellor


At Sainsbury's Argos, the great digital transformation is under way. It's our aim to become the digital market leader in choice, value and convenience, so our Finance teams are more important to us now than ever before.
They're the people who provide support across the business and help make the crucial decisions that will allow us to develop into a leading digital retailer.
Sainsbury's Argos is at the heart of the Group's growth strategy. Since joining Sainsbury's, Argos has revolutionised the way we do business, bringing expertise, technological innovation and hugely talented people to the team.
We have outperformed the market in a number of our key business areas by presenting customers with convenience, choice and value.
As well as opening c.280 Argos stores in Sainsbury's supermarkets, customers can also pick up their Argos and Tu clothing orders from 320 collection points in our supermarkets and Convenience Stores, where customers can also collect eBay and DPD parcels.
Our own delivery network is also breaking new ground. We are the only retailer in the UK who can deliver to 92% of UK postcodes within four hours.
The Reporting & Forecasting team provides a key link between the various business partnering and FP&A teams across the business to create budgets, forecasts and strategic plans as well as delivering corporate performance reporting e.
g. weekly trading packs, periodic management accounts and investor relations analysis.
In this role you establish and drive the on-going delivery of the Sainsbury's Argos strategic planning, budgeting and forecasting processes with support from the Strategic Planning & Forecasting Assistant Analyst, from initial planning of processes to final delivery to key stakeholders.
You will produce impactful channel reporting, analysis and insight in a format that the business can easily interpret and act upon.
As Analyst you will consolidate and communicate business performance to various key stakeholders including board level.
Drive creation of the Sainsbury's Argos strategic planning and forecasting process to provide the board with insight and analysis to understand the direction of the business.
This will include short term Latest Views, medium term forecasts and long term strategic plans.
Help convert the Sainsbury's Argos strategic planning, budgeting and forecasting processes from long arduous planning cycles to quick and agile processes that provide the same business understanding and insight but requiring fewer resources without the comprise on accuracy, insight and direction.
Own the periodic outturn process, fully understanding all key movements and liaising with all of the finance teams to challenge any variances to then consolidate into one clear view which can be presented to the R&F controller.
Own the creation of forecasting timetables, ensuring buy-in from key finance stakeholders to deliver achievable but challenging plans.
Support the delivery of Finance improvement initiatives and implementation of internal & external best practices to enhance process efficiency and quality.
Responsible for managing relationships with relevant internal stakeholders.
Share relevant tools and lessons learnt with Finance & Non-Finance stakeholders.
Ideally be a fully Qualified Accountant (ACCA / CIMA / ACA) or studying towards qualification.
Proven experience working in a similar level finance role.
Experience of influencing financial stakeholders and presenting analytical results to Non-Finance users.
Strong analytical skills, Excel & Access skills and high attention to detail.
Ability to operate and influence effectively at a senior finance level.
Be assertive, challenging and confident with strong inter-personal skills.
as-you-earn scheme, pension and staff discounts at Argos, Sainsbury's and Habitat.