text:
import sys

from JumpScale import j
from LogHandlerDB import LogHandlerDB

import sys
import simplejson
# import zmq
import struct
import zlib
import cPickle

# MESSAGETYPES
# 1:log
# 2:signal
# 3:errorcondition
# 4:alert
# 5:stat

class MessageHandler:

    def __init__(self):
        """
        for doc see messagehandler part in doc section of jumpscale repo
        """
        self.localLogServerEnabled = False
        self.start = 0
        self._client = None
        self._silentRetry = False
        self.queue = False  # when true will queue to local FS
        self.loghandlerdb = LogHandlerDB()
        if len(j.application.whoAmIBytestr) <> 6:
            raise RuntimeError("Cannot start messagehandler, the whoAmiBytestr on j.application should be 6 bytes")

    def data2Message(self, ttype, data):
        """
        @param data is already compressed/serialzed data block
        @param ttype is 1:log, 2:signal, 3:ec, 4:alert, 5:perfinfo, 6:raw
                                         type : 10 = uncompressed, json
                                         type : 11 = uncompressed, cpickle
                                         type : 12 = compressed, json
                                         type : 13 = compressed, cpickle
        @return 4byte_sizepacket,4byte_epoch,4byte_grid_id,4byte_nodeid,4byte_pid,1byteDataType,crcOfData,data
        """
        # print len(data)
        # print "who:%s" % len(j.application.whoAmIBytestr)
        # print "crc:%s" % zlib.crc32(data)
        dataLength = len(data)
        if dataLength == 0:
            raise RuntimeError('Couln\'t format message, data length is 0')
        ttype = struct.pack("B", ttype)
        crc = zlib.crc32(data)
        # 25 is length of everything before the data
        msg = struct.pack("I", dataLength + 25) + struct.pack("I", 0) +\
            j.application.whoAmIBytestr + ttype + struct.pack("i", crc) + data

        return msg

    def getRPCMessage(self, appname, actorname, instance, methodname, data, timeout=0,
                      sync=True, serializertype=11):
        """
        JSModelid= appname,actorname,modelname    (use the commas)
        data = dict with data (can be used to create JSModel from) or a var dict
        timeout = in seconds how long the call can take, 0 is not specified
        @param serializertype:
          12 = compressed & json
          13 = compressed & cpickle
          10 = json
          11 = cpickle
        """
        data2 = {}
        data2["app"] = appname
        data2["actor"] = actorname
        data2["method"] = methodname
        data2["inst"] = instance
        data2["timeout"] = timeout
        data2["data"] = data
        data2["sync"] = sync
        if serializertype == 11:
            return self.data2Message(11, cPickle.dumps(data2))
        else:
            raise NotImplementedError()

        return self.data2Message()

    def getMessageSize(self, message):
        # @TODO: Document.
        return struct.unpack('I', message[0:4])[0]

    def getMessageType(self, message):
        # @TODO: Document.
        typeIdStr = struct.unpack('B', message[20])[0]
        return int(typeIdStr)
        # return o.enumerators.MessageServerMessageType.getByLevel(typeId)  #@REMARK do not use this, too slow

    def getErrorConditionMessage(self, errorconditionObject):
        # protocol see http://confluence.incubaid.com/display/SHAREDPROJ/Protocol
        obj = simplejson.dumps(errorconditionObject.obj2dict())
        return self.data2Message(3, obj)

    def redirectStdOutStdErrorToLogger(self, yesno):
        if yesno:
            print "REDIRECT STD & STERR to LOGGER"
            from JumpScale.core.logging.RedirectStreams import redirectStreams
            redirectStreams(hideoutput=False)
        else:
            # print "stdout to stderror are not redirected"
            if sys.__dict__.has_key("_stdout_ori"):
                sys.stdout = sys._stdout_ori
            # else:
            #    print "WARNING could not find original stdout"
            if sys.__dict__.has_key("_stderr_ori"):
                sys.stderr = sys._stderr_ori
            else:
                sys.stderr = sys.stdout
            #   print "WARNING could not find original stderror"
            print "restored redirection"

    def connect2localLogserver(self, reconnect=False):

        self.localLogServerEnabled = True
        self._context = zmq.Context(1)

        self._client = self._context.socket(zmq.REQ)
        self._client.connect("tcp://127.0.0.1:7777")

        self._poll = zmq.Poller()
        self._poll.register(self._client, zmq.POLLIN)

        self.start = j.base.time.getTimeEpoch()
        self._silentRetry = False

        if not self.ping():
            self._client = None
        else:
            if not reconnect:
                self.redirectStdOutStdErrorToLogger(False)
                self._monkeyPatch()

    def queueMessage(self, message):
        path = j.system.fs.joinPaths(j.dirs.varDir, "messagequeue", j.application.appname)
        j.system.fs.createDir(path)
        path = "%s/%s.queue" % (path, int(round(j.base.time.getTimeEpoch() / 300, 0) * 300))
        j.system.fs.writeFile(path, message, True)  # will append to file

    def resendQueue(self, applicationName=None):
        """
        will read the queue and try to resend
        """
        def resend(message):
            return self.sendMessage(self, message, retries=1, ignoreError=False, queue=False)
        self.processQueue(resend, applicationName=applicationName, removeWhenDone=True)

    def unPackMessageSeries(self, content):
        """
        unpack text to series of messages
        #format is concatenation of
        4byte_sizepacket,4byte_epoch,4byte_grid_id,4byte_nodeid,4byte_pid,1byteDataType,crcOfData,data
        @return [[dtype,length,epoch,gid,nid,pid,data]]
        """

        result = []
        while content <> "":
            length = struct.unpack("I", content[0:4])[0]
            dtype = struct.unpack("B", content[20])[0]
            epoch, gid, nid, pid = struct.unpack("IIII", content[4:20])
            crc = struct.unpack("i", content[21:25])[0]
            data = content[25:length]
            if zlib.crc32(data) <> crc:
                raise RuntimeError("Could not decode data from message, crc was not valid, data:\n%s" % data)
            content = content[length:]
            result.append([dtype, length, epoch, gid, nid, pid, data])
        # I LEAVE THIS CODE TO SHOW HOW how it is constructed (documentation)
        # while content:
            # [size|unknown|epoch|gid|nid|pid|logType|crc|data]
            # [4|1|4|4|4|4|1|4] => 26
            # size = struct.unpack('I', content[0:4])[0]
            # epoch = struct.unpack('I', content[5:9])[0]
            # gid = struct.unpack('I', content[9:13])[0]
            # nid = struct.unpack('I', content[13:17])[0]
            # pid = struct.unpack('I', content[17:21])[0]
            # logType = struct.unpack('B', content[21:22])[0]
            # crc = struct.unpack('i', content[22:26])[0]
            # data = content[26:size]
            # crcCheck = zlib.crc32(data)
            # if crc != crcCheck:
                # raise RuntimeError('Could not unpack message series, crc invalid')

            # result.append([logType, size, epoch, gid, nid, pid, data])
            # content = content[size:]

        return result

    def unPackMessage(self, message):
        """
        unpack 1 message
        #format is
        4byte_sizepacket,1byte_type,4byte_epoch,4byte_grid_id,4byte_nodeid,4byte_pid,1byteDataType,crcOfData,data
        @return dtype,length,epoch,gid,nid,pid,data
        """
        return self.unPackMessageSeries(message)[0]

    def processQueue(self, method, messageType=0, applicationName=None, removeWhenDone=False):
        """
        read the queue and call method with as param the message
        @param messageType 0 means all types, 1=log,2=signal,3=error,5=stat
        @removeWhenDone if True then when message processed succesfully, remove from queue succesfull means method needs to return True
        """
        if self.ping():
            if applicationName == None:
                applicationName = j.application.appname
            path = j.system.fs.joinPaths(j.dirs.varDir, "messagequeue", applicationName)
            if j.system.fs.exists(path):
                for item in j.system.fs.listFilesInDir(path):
                    contentOut = ""
                    content = j.system.fs.fileGetContents(path)
                    while content <> "":
                        length = struct.unpack("I", content[0:4])[0]
                        dtype = struct.unpack("B", content[21])[0]
                        if messageType == 0 or (messageType <> 0 and messageType == dtype):
                            result = method(content[0:length])
                            if removeWhenDone and result:
                                content = content[length:]
                    if removeWhenDone:
                        if contentOut == "":
                            # means all processed well
                            j.system.fs.remove(path)
                        else:
                            j.system.fs.writeFile(path, contentOut)

    def ping(self):
        return self.sendMessage("ping", retries=1, queue=False)

    def modifyTimeInMessage(self, message, epoch):
        return message[:5] + struct.pack("I", epoch) + message[9:]

    def sendMessage(self, message, retries=3, ignoreError=False, queue=True):

        def echo2(msg):
            if self._silentRetry == False:
                j.console.echo(msg, log=False)

        if self._client == None:  # if none means logserver is not available
            if self.start + 60 < j.base.time.getTimeEpoch() or ignoreError == False:
                self.connect2localLogserver()  # every 60 sec retry to connect to logserver
                if not self.ping():
                    self._client = None  # could still not connect
            else:
                return False
            if self._client == None and queue and self.queue:
                self.queueMessage(message)
        if self._client <> None:
            retries_left = retries
            while retries_left:
                self._client.send(message)
                socks = dict(self._poll.poll(100))  # is request time out in ms
                if socks.get(self._client) == zmq.POLLIN:
                    reply = self._client.recv()
                    if reply == "1":
                        return True
                    else:
                        return False
                else:
                    # Socket is confused. Close and remove it.
                    self._client.setsockopt(zmq.LINGER, 0)
                    self._client.close()
                    self._poll.unregister(self._client)
                    retries_left -= 1
                    if retries_left == 0:
                        echo2("Local Log Server seems to be offline, will not use.")
                        self._client = None
                        self._context.term()
                        return False
                    # Create new connection
                    self._silentRetry = True
                    self.connect2localLogserver(reconnect=True)

    def _monkeyPatch(self):
        j.logger.cleanup = self._notImplemented
        j.logger.logTargets = []
        j.logger.cleanupLogsOnFilesystem = self._notImplemented
        # j.logger.consoleloglevel
        j.logger.clear = self._notImplementedIgnore
        j.logger.decodeLogMessage = self._notImplemented
        # j.logger.maxlevel
        j.logger.close = self._notImplementedIgnore
        j.logger.exception = self._notImplemented
        j.logger.logTargetAdd = self._notImplemented
        j.logger.nolog = False
        j.logger.log = self.log

    def _notImplemented(self, *args, **kwargs):
        raise RuntimeError("Not implemented on messagehandler 6")

    def _notImplementedIgnore(self, *args, **kwargs):
        pass

    def log(self, message, level=5, tags="", dontprint=False, category=""):
        """
        @param category is in dot notation e.g. appserver3.status or system.fs
        """

        try:
            if level < (j.logger.consoleloglevel + 1) and not dontprint and j.application.shellconfig.interactive:
                j.console.echo(message, log=False)
            if j.logger.nolog:
                return
            if level < j.logger.maxlevel + 1:
                # send to logserver
                self.sendMessage(self.data2Message(1, "%s,%s,%s" % (level, category, message)), 1, True)

        except Exception, e:
            print "HAVE SERIOUS BUG IN LOGGER 4 MESSAGEHANDLER 6\n"
            print e
            import pdb
            pdb.Pdb().set_trace(None)
            # pdb.pm()

    def sendSignal(self, signalcategory, jumpscaletags=None):
        if jumpscaletags == None:
            jumpscaletags = ""
        self.sendMessage(self.data2Message(2, "%s,%s" % (signalcategory, jumpscaletags)), 3)

    def sendErrorConditionObject(self, errorConditionObject):
        """
        send errorcondtion object from jumpscale 6 to local logserver
        """
        self.sendMessage(self.getErrorConditionMessage(errorConditionObject), 3)

    def sendStat(self, category, stat):
        msg = "%s,%s" % (signalcategory, jumpscaletags)
        self.sendMessage(self.data2Message(5, msg), 3)


text:
/**
 * Created by dom on 25/04/15.
 */

function UI(pTransport)
{
  var treedata = [
    {
      id: "days", value: "Wochentage",
      data: [
        { id: "1", value: "Montag" },
        { id: "2", value: "Dienstag" },
        { id: "3", value: "Mittwoch" },
        { id: "4", value: "Donnerstag" },
        { id: "5", value: "Freitag" },
        { id: "6", value: "Samstag" },
        { id: "7", value: "Sonntag" }
      ]
    }
  ];

  webix.ui(
    {
      rows:[
        { type:"header", template:"Sera Schule Alarm System" },
        {
          view:"toolbar",
          id:"myToolbar",
          cols:[
            { view:"button", id:"addNewRecord", value:"Neuer Zeit-Eintrag", width:300, align:"left", click:function(){addEmptyRecord();} }
            //,{ view:"button", id:"stopSound", value:"Alarm stummschalten", width:300, align:"left", click:function(){deactivateSound();} }
            ]
        },
        { cols:[
          { view:"tree", id:'daytree', data:treedata, gravity:0.2, select:true, minHeight:500, width:300 },
          { view:"resizer" },
          {
            view:"datatable",
            id: "timetable",
            columns:[
              { id:"id",		                  header:"",   		     width:1, hidden: true},
              { id:"from",	        editor:"text",		header:"Von", width:300},
              { id:"to",	        editor:"text",		header:"Bis", width:300},
              { id:"active",		editor:"checkbox",		header:"Aktiviert", width:100}
            ],
            editable:true,
            autoheight:true,
            autowidth: true,
            gravity:0.8,
            data: [],
            select: "row"
          }
        ]}
      ]
    });

  function isEmptyResult(pResult){
    return !pResult || pResult.length==0;
  }

  function getTimeTable(pAccessor){
    return pAccessor ? $$("timetable")[pAccessor] : $$("timetable");
  }

  function getDayTree(pAccessor){
    return pAccessor ? $$("daytree")[pAccessor] : $$("daytree");
  }

  function getTableData(){
    return getTimeTable('data').serialize();
  }

  function getSelectedDayId(){
    return getDayTree().getSelectedId();
  }

  function getSelectedDayName(id){
    return getDayTree().getItem(id).value;
  }

  function clearTimeTable(){
    getTimeTable('data').clearAll();
  }

  function addEmptyRecord(){
    addRecord({from:'', to:'', active:true});
  }

  function deactivateSound(){
    pTransport.stopSound();
  }

  function addRecord(pRecord){
    getTimeTable('data').add(pRecord);
  }

  function showMessage(pMessage){
    webix.message(pMessage);
  }

  function getCurrentDate(){
    var day = (new Date()).getDay();
    return day == 0 ? 7 : day;
  }

  function adjestSelectedDate(pSelectedDay){
    return pSelectedDay == 7 ? 0 : pSelectedDay;
  }

  function handleIncomingData(pResponse)
  {
    if(isEmptyResult(pResponse)){
      addEmptyRecord();
    }
    else{
      pResponse.forEach(function (pRow) {
        addRecord(pRow);
      });
    }
  }

  this.init = function()
  {
    getDayTree().attachEvent("onAfterSelect", function (selectedDayId) {
      clearTimeTable();
      pTransport.loadDayData(adjestSelectedDate(+selectedDayId));
    });

    getTimeTable().attachEvent("onDataUpdate", function(id, pDayData)
    {
      if(pDayData.from && pDayData.to) {
        var selectedDayId = getSelectedDayId();
        showMessage("Sie haben gerade die Zeituhr geändert! Die Änderungen werden gespeichert...

" +
        getSelectedDayName(selectedDayId) + ":" + pDayData.from + " - " + pDayData.to);
        pTransport.saveDayData(pDayData, adjestSelectedDate(+selectedDayId));
        return true;
      }
      return false;
    });

    pTransport.setIncomingDataHandler(handleIncomingData);

    getDayTree().openAll();
    getDayTree().select(getCurrentDate());
  }
};

redpajama_set_name: RedPajamaGithub


text:
package org.nanocontainer.persistence.hibernate.annotations;

import junit.framework.TestCase;

import org.hibernate.Session;
import org.hibernate.SessionFactory;

/**
 * @version $Revision: 2043 $
 */
public class ConstructableConfigurationTestCase extends TestCase {

    public void fixme_testDefaultConstruction() throws Exception {
        ConstructableConfiguration config = new ConstructableConfiguration();
        //assertNotNull(config);
		//Because of melding hibernate and hibernate-jpa, we're skipping this write for the hibernate-annotations
		//stuff since the configuration file is designed for annotation configurations.
		//attemptWrite(config);
    }

    public void testResourceConstruction() throws Exception {
        ConstructableConfiguration config = new ConstructableConfiguration("/hibernate3.cfg.xml");
        assertNotNull(config);
		attemptWrite(config);
    }

 /**
     * Works Hibernate's configuration by attempting a write to the 'database'.  With the latest
     * hiberanates, the configuration isn't really built until the session factory is built, and even
     * then, some of the data doesn't exist until a write occurs.
     * @param config
     */
    private void attemptWrite(ConstructableConfiguration config) {
        Pojo pojo = new Pojo();
        pojo.setFoo("Foo!");

        SessionFactory sessionFactory = config.buildSessionFactory();
        Session session = null;
        try {

            session = sessionFactory.openSession();
            Integer result = (Integer) session.save(pojo);
            assertNotNull(result);
            session.close();

            session = sessionFactory.openSession();
            Pojo pojo2 = (Pojo) session.load(Pojo.class, result);
            assertNotNull(pojo);
            assertEquals(pojo.getId(), pojo2.getId());
            assertEquals(pojo.getFoo(), pojo2.getFoo());
        } finally {
            if (session != null && session.isOpen()) {
                session.close();
            }

            sessionFactory.close();
        }
    }

}


text:
import {
  List,
  Map,
  OrderedMap,
  OrderedSet,
  Set,
  Stack,
} from '../../';

class A { x: number; }
class B extends A { y: string; }
class C { z: string; }

// List covariance
var listOfB: List<B> = List<B>();
var listOfA: List<A> = listOfB;

// $ExpectType List<B>
listOfA = List([new B()]);

// $ExpectError
var listOfC: List<C> = listOfB;

// Map covariance
declare var mapOfB: Map<string, B>;
var mapOfA: Map<string, A> = mapOfB;

// $ExpectType Map<string, B>
mapOfA = Map({b: new B()});

// $ExpectError
var mapOfC: Map<string, C> = mapOfB;

// Set covariance
declare var setOfB: Set<B>;
var setOfA: Set<A> = setOfB;

// $ExpectType Set<B>
setOfA = Set([new B()]);
// $ExpectError
var setOfC: Set<C> = setOfB;

// Stack covariance
declare var stackOfB: Stack<B>;
var stackOfA: Stack<A> = stackOfB;
// $ExpectType Stack<B>
stackOfA = Stack([new B()]);
// $ExpectError
var stackOfC: Stack<C> = stackOfB;

// OrderedMap covariance
declare var orderedMapOfB: OrderedMap<string, B>;
var orderedMapOfA: OrderedMap<string, A> = orderedMapOfB;
// $ExpectType OrderedMap<string, B>
orderedMapOfA = OrderedMap({b: new B()});
// $ExpectError
var orderedMapOfC: OrderedMap<string, C> = orderedMapOfB;

// OrderedSet covariance
declare var orderedSetOfB: OrderedSet<B>;
var orderedSetOfA: OrderedSet<A> = orderedSetOfB;
// $ExpectType OrderedSet<B>
orderedSetOfA = OrderedSet([new B()]);
// $ExpectError
var orderedSetOfC: OrderedSet<C> = orderedSetOfB;


text:
/* ===========================================================
 * ro.js
 * Romanian translation for Trumbowyg
 * http://alex-d.github.com/Trumbowyg
 * ===========================================================
 * Author : Vladut Radulescu (pacMakaveli)
 *
 *          Email: pacMakaveli90@gmail.com
 *          Twitter : @pacMakaveli90
 *          Website : creative-studio51.co.uk
 *          Github : https://github.com/pacMakaveli
 */
jQuery.trumbowyg.langs.pt={viewHTML:"Vizualizare HTML",formatting:"Format",p:"Paragraf",blockquote:"Citație",code:"Cod",header:"Titlu",bold:"Bold",italic:"Italic",strikethrough:"Tăiat",underline:"Subliniat",strong:"Puternic",em:"Accentuat",del:"Sterge",unorderedList:"Lista dezordonată",orderedList:"Liste ordonată",insertImage:"Adăugare Imagine",insertVideo:"Adăugare Video",link:"Link",createLink:"Crează link",unlink:"Remover link",justifyLeft:"Aliniază stânga",justifyCenter:"Aliniază centru",justifyRight:"Aliniază dreapta",justifyFull:"Justificare",horizontalRule:"Linie orizontală",fullscreen:"Tot ecranul",close:"Închide",submit:"Procesează",reset:"Resetează",required:"Obligatoriu",description:"Descriere",title:"Titlu",text:"Text"};


text:
<!doctype html>

    <meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

	<title>23andCSB</title>

	<meta name="description" content="23andMe API Demo" />

    <link rel="apple-touch-icon-precomposed" sizes="114x114" href="{{ STATIC_URL }}images/apple-touch-icon-114x114-precomposed.png">

    <link rel="apple-touch-icon-precomposed" sizes="72x72" href="{{ STATIC_URL }}images/apple-touch-icon-72x72-precomposed.png">

    <link rel="apple-touch-icon-precomposed" href="{{ STATIC_URL }}images/apple-touch-icon-precomposed.png">

	<link rel="shortcut icon" href="{{ STATIC_URL }}images/favicon.ico">

	{% block extra_head_css %}{% endblock %}

    <link rel="stylesheet" href="{{ STATIC_URL }}js/libs/google-code-prettify/prettify.css" >
	<link rel="stylesheet" href="{{ STATIC_URL }}css/base.001.css">
	<link rel="stylesheet" href="{{ STATIC_URL }}css/home.001.css">

	{% block content %}{% endblock %}

    {% block extra_body_js %}{% endblock %}


text:
// (c) 2010-2015 IndiegameGarden.com. Distributed under the FreeBSD license in LICENSE.txt

using System;
using System.Threading;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Ionic.Zip;
using IndiegameGarden.Base;

namespace IndiegameGarden.Unpack
{
    /**
     * wraps the Ionic.Zip unzipping library as a ITask, task to unzip a single archive
     */
    public class UnzipTask: Task
    {
        public string zipfile;
        public string destdir;
        long bytesDoneWithinFile = 0;
        long totalSize = 0;
        long doneSize = 0;
        bool isAborted = false;

        public UnzipTask(string zipfile, string destdir)
        {
            this.zipfile = zipfile;
            this.destdir = destdir;
        }

        public override double Progress()
        {
            if (totalSize > 0)
                return ((double)(doneSize + bytesDoneWithinFile)) / ((double)totalSize);
            else
                return 0;
        }

        protected override void StartInternal()
        {
            try
            {
                // Specifying Console.Out here causes diagnostic msgs to be sent to the Console
                // In a WinForms or WPF or Web app, you could specify nothing, or an alternate
                // TextWriter to capture diagnostic messages.
                var options = new ReadOptions { StatusMessageWriter = System.Console.Out }; // TODO change to another writer
                using (ZipFile zip = ZipFile.Read(zipfile, options))
                {
                    //zip.Entries
                    ICollection<ZipEntry> zipFiles = zip.Entries;
                    foreach (ZipEntry ze in zipFiles)
                    {
                        totalSize += ze.UncompressedSize;
                        if (isAborted)
                            throw new Exception("UnzipTask aborted.");
                    }

                    zip.ExtractProgress += new EventHandler<ExtractProgressEventArgs>(EvHandlerExtractProgress);

                    foreach (ZipEntry ze in zipFiles)
                    {
                        ze.Extract(destdir);
                        doneSize += ze.UncompressedSize;
                        if (isAborted)
                            throw new Exception("UnzipTask aborted.");
                    }
                }
                status = ITaskStatus.SUCCESS;
            }
            catch (ZipException)
            {
                status = ITaskStatus.FAIL;
                statusMsg = "Zip file corrupt or unzip failed. Maybe try again?";
            }
            catch (System.Exception ex1)
            {
                status = ITaskStatus.FAIL;
                statusMsg = ex1.ToString();
            }
        }

        protected override void AbortInternal()
        {
            isAborted = true;
        }

        // called by the ZipFile class progressContributionSingleFile event
        void EvHandlerExtractProgress(object sender, ExtractProgressEventArgs e)
        {
            if (isAborted)
                throw new Exception("UnzipTask aborted.");
            try
            {
                if (e.EventType.Equals(ZipProgressEventType.Extracting_EntryBytesWritten))
                {
                    bytesDoneWithinFile = e.BytesTransferred;
                }
            }
            catch(Exception)
            {
                ;
            }
        }
    }
}


text:
<TITLE>Review for Event Horizon (1997)</TITLE>
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/ramr.css">

Event Horizon (1997)

reviewed by
James Berardinelli

EVENT HORIZON

A Film Review by James Berardinelli

RATING (0 TO 10): 4.0
Alternative Scale: ** out of ****

United States, 1997
U.S. Release Date: 8/15/97 (wide)
Running Length: 1:37
MPAA Classification: R (Violence, gore, profanity, brief nudity)
Theatrical Aspect Ratio: 2.35:1

Cast: Laurence Fishburne, Sam Neill, Kathleen Quinlan, Joely Richardson,=20
      Richard T. Jones, Jack Noseworthy, Jason Isaacs, Sean Pertwee
Director: Paul Anderson
Producers: Lawrence Gordon, Lloyd Levin, and Jeremy Bolt=20
Screenplay: Philip Eisner
Cinematography: Adrian Biddle
Music: Michael Kamen
U.S. Distributor: Paramount Pictures

     I went into EVENT HORIZON expecting an ALIEN clone.  However,=20
although this film has successfully recaptured some of the look and=20
claustrophobic feel of Ridley Scott's science fiction classic, that's=20
where the similarity ends.  Because, while ALIEN was tautly paced and=20
deftly scripted, EVENT HORIZON is a mess.  This is one of the most=20
chaotic movies that I have seen since 1996's nearly-incomprehensible=20
MISSION: IMPOSSIBLE.  Half of what's going on is never explained, and=20
what is explained, doesn't make much sense.  And that's just the=20
beginning of the problems encountered in director Paul Anderson's=20
(MORTAL KOMBAT) poorly executed endeavor=85

     August is traditionally the month when studios dump their least-
attractive summer prospects into the market, so EVENT HORIZON has plenty=20
of company.  This is the kind of motion picture that would be killed in=20
a direct competition against a LOST WORLD or CONTACT, but stands a=20
chance against such second-rate opponents as SPAWN and MIMIC.  And,=20
because the film is extremely light on intelligent dialogue and heavy on=20
gore-laden action and superficial shocks, it should play well in a=20
dubbed version overseas, so the producers have a chance to make back=20
their money.=20

     EVENT HORIZON takes us to the year 2047 and onto the deep space=20
rescue craft LEWIS & CLARK as it departs from Earth orbit on a two-month=20
journey to Neptune.  On board are the usual suspects, a group of outer=20
space military veterans:  Captain Miller (Laurence Fishburne) and=20
crewmembers Starck (Joely Richardson), Peters (Kathleen Quinlan), Cooper=20
(Richard T. Jones), Justin (Jack Noseworthy), D.J. (Jason Isaacs), and=20
Smith (Sean Pertwee).  There's also the mysterious and elusive Dr.=20
William Weir (Sam Neill), who's the only one aware of what's truly going=20
on.

     The primary mission of the LEWIS & CLARK is to go into a low orbit=20
around Neptune and make contact with the deep space research vessel=20
EVENT HORIZON, which was initially thought destroyed seven years ago. =20
The would-be rescuers are to search for survivors and salvage anything=20
that's reclaimable, but no one is prepared for the horror that lurks=20
deep within the dark corridors of the dead ship.  The crew of the EVENT=20
HORIZON may have had their innards splattered over the bulkheads, but=20
something aboard the ship is very much alive.

     Sadly, despite what seems to be a promising premise (a haunted=20
house in space), EVENT HORIZON misfires badly.  Those who thought the=20
minor technical slip-ups in CONTACT were egregious will be floored by=20
the slipshod "science" embraced by this film, where "miniature black=20
holes" are created with little effort and ships are sucked through=20
singularities without even the slightest bit of gravity distortion. =20
When it comes to labeling EVENT HORIZON as a science fiction film, put=20
the emphasis heavily on the "fiction" portion of the term.

     For movies like this to work, we have to develop a rooting interest=20
in at least one member of the crew, otherwise the film becomes a=20
pointless exercise in watching men and women get cut down one-by-one. =20
ALIEN was effective because we cared about Sigourney Weaver's Ripley. =20
Here, however, none of the characters are remotely sympathetic or=20
interesting.  They're a bunch of familiar types thrown onto the screen,=20
most of whom have neither past nor future.  We are given some background=20
information about a few of these individuals (one lost a wife, another=20
has a son she left back on Earth, and another made a tragic command=20
decision that cost a life), but it's hardly enough to flesh them out. =20
Even a solid actor like Laurence Fishburne (Ike Turner in WHAT'S LOVE=20
GOT TO DO WITH IT?) can't rescue such a poorly-developed character.  The=20
likes of Joely Richardson (the live-action 101 DALMATIANS), Kathleen=20
Quinlan (BREAKDOWN), and Sean Pertwee (the son of the third DR. WHO, Jon=20
Pertwee) blend into the background.  Sam Neill manages to develop the=20
semblance of a personality, but that's because he's given a little more=20
to work with than the others.  The most memorable performance belongs to=20
Richard T. Jones (THE TRIGGER EFFECT), whose eccentric Cooper provides=20
most of the comic relief.

     There are a few means by which it's possible to relieve the tedium=20
of sitting through a screening of EVENT HORIZON.  The first is to=20
identify rip-offs of other horror and dark science fiction films (most=20
notably THE EXORCIST, THE SHINING, and the ALIEN series).  The second is=20
to count the number of times that the film uses a nightmare sequence to=20
"shock" us (with a plot device as overused as this one, even once would=20
seem to be too much).  Another possibility would be to start a betting=20
pool for which of the cardboard cut-out characters will die first.=20
(Note: blood gushing out of certain orifices does not count as "dead"=20
unless the heart stops pumping.)  The bottom line is that EVENT HORIZON=20
isn't particularly effective as a horror, adventure, or science fiction=20
film, and, to enjoy it, you're going to have to resort to something more=20
creative than sitting passively in your seat and absorbing the=20
atmospheric confusion that transpires on screen. =20

Copyright 1997 James Berardinelli

- James Berardinelli
e-mail: berardin@mail.cybernex.net
ReelViews web site: http://www.cybernex.net/~berardin

"A film is a petrified fountain of thought."
- Jean Cocteau

The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).

The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.

Please direct comments/criticisms of the review to relevant newsgroups.

Broken URLs inthe reviews are the responsibility of the author.

The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.

Related links: index of all rec.arts.movies.reviews reviews


text:
using System;
using System.Linq.Expressions;
using System.Reflection;
using System.Runtime.Serialization;
using System.Text;
using Zyan.InterLinq.Expressions.Helpers;

namespace Zyan.InterLinq.Expressions.SerializableTypes
{
	/// <summary>
	/// A serializable version of <see cref="MemberBinding"/>.
	/// </summary>
	[Serializable]
	[DataContract]
	public abstract class SerializableMemberBinding
	{
		#region Constructors

		/// <summary>
		/// Default constructor for serialization.
		/// </summary>
		protected SerializableMemberBinding() { }

		/// <summary>
		/// Constructor with an <see cref="MemberBinding"/> and an <see cref="ExpressionConverter"/>.
		/// </summary>
		/// <param name="memberBinding">The original, not serializable <see cref="MemberBinding"/>.</param>
		/// <param name="expConverter">The <see cref="ExpressionConverter"/> to convert contained <see cref="Expression">Expressions</see>.</param>
		protected SerializableMemberBinding(MemberBinding memberBinding, ExpressionConverter expConverter)
		{
			Member = memberBinding.Member;
			BindingType = memberBinding.BindingType;
		}

		#endregion

		#region Properties

		/// <summary>
		/// See <see cref="MemberBinding.Member"/>
		/// </summary>
		[DataMember]
		public MemberInfo Member { get; set; }

		/// <summary>
		/// See <see cref="MemberBinding.BindingType"/>
		/// </summary>
		[DataMember]
		public MemberBindingType BindingType { get; set; }

		#endregion

		#region ToString() Methods

		/// <summary>
		/// Builds a <see langword="string"/> representing the <see cref="MemberBinding"/>.
		/// </summary>
		/// <param name="builder">A <see cref="System.Text.StringBuilder"/> to add the created <see langword="string"/>.</param>
		internal abstract void BuildString(StringBuilder builder);

		/// <summary>
		/// Returns a <see langword="string"/> representing the <see cref="MemberBinding"/>.
		/// </summary>
		/// <returns>Returns a <see langword="string"/> representing the <see cref="MemberBinding"/>.</returns>
		public override string ToString()
		{
			StringBuilder builder = new StringBuilder();
			BuildString(builder);
			return builder.ToString();
		}

		#endregion
	}
}


text:
function splitAccessors (variable) {
    var accessors = [];

    //This RegExp is used to capture the first object of a bracket notation
    //It captures everything before an open square bracket
    //For example it will capture 'obj' in the expression obj['prop1']['prop2']
    var objectRegexp = /[^\[]+/;

    //This RegExp is used to capture all properties of a bracket notation
    //It captures everything in between [' '] or [" "]
    //For example it will capture 'prop1' and 'prop2' in the above expression
    var propertiesRegexp = /\['(.+?)'\]|\["(.+?)"\]/g;

    //This RegExp is a combination of the two RegExp above
    //Make sure that each component follows the correct bracket notation
    //[0-9a-zA-Z_$]+ is to make sure that the captured variable has a valid variable name or key value
    var validationRegexp = /^[a-zA-Z_$][0-9a-zA-Z_$]*(\['[0-9a-zA-Z_$]+'\]|\["[0-9a-zA-Z_$]+"\])*$/;
    var components = variable.split('.');

    for (var n = 0; n < components.length; n++) {
        var component = components[n];
        var object = component.match(objectRegexp);
        var property = propertiesRegexp.exec(component);

        if (!validationRegexp.test(component)) {
            //casper's log doesn't exist when running tests
            if (typeof log !== 'undefined') {
                log(variable + ' has an invalid syntax', 'ERROR');
            }
            return;
        }

        if (object) {
            accessors = accessors.concat(object);
        }

        while (property !== null) {
            //property[1] holds the value that satisfies [' ']
            //property[2] holds the value that satisfies [" "]
            accessors = accessors.concat(property[1] || property[2]);
            property = propertiesRegexp.exec(component);
        }

    }
    return accessors;
}

//This function retrieve a list of accessors
//Set the first accessor as the main object
//Get the value of window.object using casper.evaluate()
//Access continuously to the next property until the end of the list
function getVariable (variable, variableValue) {
    var object;
    var accessors = splitAccessors(variable);

    if (!accessors) {
        return;
    }

    object = accessors.shift();
    if (variableValue === undefined) {
        variableValue = this.evaluate(function (object) {
            return window[object];
        }, object);
    } else {
        variableValue = variableValue[object];
    }

    accessors.forEach(function (property) {
        if (variableValue === undefined) {
            return;
        }
        variableValue = variableValue[property];
    });
    return variableValue;
}

//This function retrieves the first attribute or text of the selector
//Apply the RegExp if there is one
function getAttribute (params) {
    var attributeValue;

    if (!this.exists(params.selector)) {
        return;
    }

    if (params.attribute === '@text') {
        attributeValue = this.getElementInfo(params.selector).text;
    } else {
        attributeValue = this.getElementAttribute(params.selector,
            params.attribute);
    }

    if (attributeValue && params.modifier) {
        var regexpModifier = new RegExp(params.modifier);
        var matchedRegexp = regexpModifier.exec(attributeValue);
        if (!matchedRegexp) {
            return;
        }
        // Try to get a captured group, return the matched string if there is no capture group
        attributeValue = matchedRegexp[1] || matchedRegexp[0];
    }

    //when getting an HTML attribute, '' is equivalent of not existing, so undefined
    if (attributeValue === '') {
        return;
    }
    return attributeValue;
}

function encodeResource (resource, regexp) {
    if (regexp === true) {
        return new RegExp(resource);
    } else {
        //The resource will be an url, so URI encoding is needed
        return encodeURI(resource);
    }
}

function getResource (resourceMatcher, method, variable, status) {
    var responses = this.resources;
    var request;
    var parsedData;
    var res;
    status = +status || 200;

    for (var i = 0; i < responses.length; i++) {
        res = responses[i];

        if (resourceMatcher instanceof RegExp &&
            resourceMatcher.test(res.url) ||
            res.url.indexOf(resourceMatcher) !== -1) {

            request = this.options.requests[res.id];

            // Get the resource with corresponding method or first resource if no method
            if ((!method || method === request.method) &&
                res.status === status) {

                if (!variable) {
                    return request;
                }

                //Parse postData as an object and save it as payload
                if (request.postData !== undefined) {
                    try {
                        request.payload = JSON.parse(request.postData);
                    } catch (e) {
                        request.payload = request.postData;
                    }
                }
                return getVariable(variable, request);
            }
        }
    }
}

function getElementsCount (selector) {
    var n = this.evaluate(function (selector) {
        return __utils__.findAll(selector).length;
    }, selector);
    return n;
}

module.exports = function () {
    return {
        getAttribute: getAttribute.bind(this),
        getVariable: getVariable.bind(this),
        splitAccessors: splitAccessors,
        getResource: getResource.bind(this),
        encodeResource: encodeResource,
        getElementsCount: getElementsCount.bind(this)
    };
};


text:
layout: page
title: Travis - Farrell Wedding
date: 2016-05-24
author: Anthony Walters
tags: weekly links, java
status: published
summary: Vestibulum at erat ligula. Nunc ac.
banner: images/banner/meeting-01.jpg
booking:
  startDate: 01/08/2017
  endDate: 01/10/2017
  ctyhocn: MLTNYHX
  groupCode: TFW
published: true
---
Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Curabitur vel pretium ante. Pellentesque at pharetra ante. Suspendisse fermentum libero vitae arcu sagittis, ac ultrices felis dapibus. Sed lobortis est et auctor vulputate. Fusce id neque volutpat, sollicitudin leo et, finibus lorem. Vivamus egestas lorem eget sagittis pretium. Quisque rhoncus nunc dui, sed euismod lorem aliquet sed. Cras rutrum dictum eros. Etiam vitae convallis dui. Donec malesuada enim sed elit tempor tristique. In lobortis quam at nunc iaculis, eu interdum nibh rhoncus.

* Sed eget nulla venenatis, eleifend metus quis, efficitur est
* Cras vitae leo id orci blandit pharetra ut in arcu
* Donec pharetra augue non lorem lobortis varius.

Sed sed interdum ante, non pulvinar sem. Maecenas blandit ipsum erat, non suscipit purus pellentesque ac. Sed fermentum faucibus dolor eget fermentum. Mauris ultrices augue non massa pulvinar varius. Duis egestas odio leo, in mollis diam vulputate id. Nunc dapibus ultricies finibus. Quisque tempor diam est, vel pellentesque massa scelerisque et. Aenean nec sem lorem. Nullam tempus dolor vel interdum blandit. Maecenas ut dui a tellus maximus finibus. In hac habitasse platea dictumst. Quisque hendrerit nec risus at sollicitudin. Nam metus mi, sagittis consequat ante ac, sollicitudin porta sapien.


text:
package org.kapunga.tm.world

import org.kapunga.tm.soul.Agent
import org.slf4j.LoggerFactory

/**
 * A container for rooms.  This groups related rooms allowing them to be loaded
 * and unloaded in a batch and to allow areas to be easily built by creators.
 *
 * @author Paul J Thordarson kapunga@gmail.com
 */
class Zone(tmId: Int, name: String) extends Persistent {
  private val log = LoggerFactory.getLogger(s"Zone-${name.replaceAll(" ", "-")}")
  private var rooms: Map[Int, Room] = Map()
  private var loaded = false
  protected var spawnPoint: Option[SpawnPoint] = None

  log.info(s"$name initialized.")

  def id = tmId

  def getName = name

  def registerRoom(room: Room) = {
    log.info(s"Loading room ${room.id}:'${room.getTitle}'")
    rooms = rooms + (room.id -> room)
  }

  def load() = {
    if (!loaded) {
      WorldDAO.getRoomsForZone(this)
      WorldDAO.getRoomLinksForZone(this).foreach(link => {
        if (rooms.contains(link.orig) && rooms.contains(link.dest)) {
          log.info(s"Linking room id:${link.orig} to id:${link.dest} direction: '${link.direction}'")
          rooms(link.orig).setDirection(link.direction, rooms(link.dest))
        }
      })

      if (rooms.size > 0) {
        spawnPoint = Some(new SpawnPoint(rooms(rooms.keys.toList.sorted.head)))
        log.info(s"Setting spawn point for '$name' to '${spawnPoint.get.room.getTitle}'")
      }

      loaded = true
    }
  }

  def getRooms = rooms

  def warp(agent: Agent, oldRoom: Room) = {
    spawnPoint match {
      case Some(room) =>
        oldRoom.vacate(agent, "disappears in a puff of smoke.")
        agent.tell("You feel your body get tugged through the fabric of space.")
        room.room.enter(agent, "appears in a puff of smoke.")
      case None =>
        agent.tell("You cannot warp to that zone.")
        agent.prompt()
    }
  }
}

/**
 * A bottom level zone to be used instead of null for zones.
 * The only room that should be in here is TheVoid
 */
object TheNether extends Zone(-1, "The Nether") {
  this.spawnPoint = Some(new SpawnPoint(TheVoid))

  override def load(): Unit = {}
}

object NullZone extends Zone(-2, "NULL")

object NoSuchZone extends Zone(-3, "NULL")


text:
"""Integration tests for methods implemented on Project."""
import github3
from .helper import IntegrationHelper

class TestProject(IntegrationHelper):
    """Project integration tests."""

    def test_column(self):
        """Test the ability to retrieve a single project column."""
        self.token_login()
        cassette_name = self.cassette_name("column")
        with self.recorder.use_cassette(cassette_name):
            repository = self.gh.repository("github3py", "delete_contents")
            project = repository.project(1177360)

            # Grab a project, any project
            first_column = next(project.columns())

            fetched_column = project.column(first_column.id)
            assert first_column == fetched_column

    def test_columns(self):
        """Test the ability to retrieve an project's columns."""
        self.token_login()
        cassette_name = self.cassette_name("columns")
        with self.recorder.use_cassette(cassette_name):
            repository = self.gh.repository("github3py", "delete_contents")
            project = repository.project(1177360)

            for column in project.columns():
                assert isinstance(column, github3.projects.ProjectColumn)

    def test_create_column(self):
        """Test the ability to create a column in a project."""
        self.token_login()
        cassette_name = self.cassette_name("create_column")
        with self.recorder.use_cassette(cassette_name):
            repository = self.gh.repository("github3py", "delete_contents")
            project = repository.project(1177360)
            column = project.create_column("test column")
            assert isinstance(column, github3.projects.ProjectColumn)
            assert column.delete() is True

    def test_delete(self):
        """Test the ability to delete a Project."""
        self.token_login()
        cassette_name = self.cassette_name("delete")
        with self.recorder.use_cassette(cassette_name):
            repository = self.gh.repository("github3py", "delete_contents")
            project = repository.create_project("delete-me")
            assert project.delete()

    def test_update(self):
        """Show that one can update a Project."""
        self.token_login()
        cassette_name = self.cassette_name("update")
        with self.recorder.use_cassette(cassette_name):
            repository = self.gh.repository("github3py", "delete_contents")
            project = repository.project(1177360)
            assert project.update(project.name, project.body) is True

class TestProjectColumn(IntegrationHelper):
    """ProjectColumn integration tests."""

    def test_card(self):
        """Test the ability to retrieve a single project card."""
        self.token_login()
        cassette_name = self.cassette_name("card")
        with self.recorder.use_cassette(cassette_name):
            repository = self.gh.repository("github3py", "delete_contents")
            project = repository.project(1177360)
            column = project.create_column("test column")
            card = column.create_card_with_note("Delete mmeeeeeeee")

            fetched_card = column.card(card.id)
            assert card == fetched_card
            card.delete()
            column.delete()

    def test_cards(self):
        """Test the ability to retrieve an project's cards."""
        self.token_login()
        cassette_name = self.cassette_name("cards")
        with self.recorder.use_cassette(cassette_name):
            repository = self.gh.repository("github3py", "delete_contents")
            project = repository.project(1177360)
            column = project.create_column("test column")
            card = column.create_card_with_note("Delete mmeeeeeeee")
            assert card is not None

            for card in column.cards():
                assert isinstance(card, github3.projects.ProjectCard)

            card.delete()
            column.delete()

    def test_create_card_with_content_id(self):
        """Test the ability to create a note card in project column."""
        self.token_login()
        cassette_name = self.cassette_name("create_card_with_content_id")
        with self.recorder.use_cassette(cassette_name):
            repository = self.gh.repository("github3py", "delete_contents")
            project = repository.project(1177360)
            column = project.create_column("test column")
            issues = list(repository.issues())
            card = column.create_card_with_content_id(issues[0].id, "Issue")
            assert isinstance(column, github3.projects.ProjectColumn)
            assert card.delete() is True
            column.delete()

    def test_create_card_with_issue(self):
        """Test the ability to create a note card in project column."""
        self.token_login()
        cassette_name = self.cassette_name("create_card_with_issue")
        with self.recorder.use_cassette(cassette_name):
            repository = self.gh.repository("github3py", "delete_contents")
            project = repository.project(1177360)
            column = project.create_column("test column")
            issues = list(repository.issues())
            card = column.create_card_with_issue(issues[0])
            assert isinstance(column, github3.projects.ProjectColumn)
            assert card.delete() is True
            column.delete()

    def test_create_card_with_note(self):
        """Test the ability to create a note card in project column."""
        self.token_login()
        cassette_name = self.cassette_name("create_card_with_note")
        with self.recorder.use_cassette(cassette_name):
            repository = self.gh.repository("github3py", "delete_contents")
            project = repository.project(1177360)
            column = project.create_column("test column")
            card = column.create_card_with_note("note content")
            assert isinstance(column, github3.projects.ProjectColumn)
            assert card.delete() is True
            column.delete()

    def test_delete(self):
        """Test the ability to delete a ProjectColumn."""
        self.token_login()
        cassette_name = self.cassette_name("delete")
        with self.recorder.use_cassette(cassette_name):
            repository = self.gh.repository("github3py", "delete_contents")
            project = repository.project(1177360)
            column = project.create_column("test column")
            assert column.delete()

    def test_move(self):
        """Show that one can move a ProjectColumn."""
        self.token_login()
        cassette_name = self.cassette_name("move")
        with self.recorder.use_cassette(cassette_name):
            repository = self.gh.repository("github3py", "delete_contents")
            project = repository.project(1177360)
            column = project.create_column("test column")
            column.move("first")
            assert list(project.columns())[0] == column
            column.delete()

    def test_update(self):
        """Show that one can update a ProjectColumn."""
        self.token_login()
        cassette_name = self.cassette_name("update")
        with self.recorder.use_cassette(cassette_name):
            repository = self.gh.repository("github3py", "delete_contents")
            project = repository.project(1177360)
            column = project.create_column("test column")
            assert column.update("test column rename") is True
            column.delete()

class TestProjectCard(IntegrationHelper):
    """ProjectCard integration tests."""

    def test_delete(self):
        """Test the ability to delete a ProjectCard."""
        self.token_login()
        cassette_name = self.cassette_name("delete")
        with self.recorder.use_cassette(cassette_name):
            repository = self.gh.repository("github3py", "delete_contents")
            project = repository.project(1177360)
            column = project.create_column("test column")
            card = column.create_card_with_note("note content")
            assert card.delete()
            column.delete()

    def test_move(self):
        """Show that one can move a ProjectCard."""
        self.token_login()
        cassette_name = self.cassette_name("move")
        with self.recorder.use_cassette(cassette_name):
            repository = self.gh.repository("github3py", "delete_contents")
            project = repository.project(1177360)
            column = project.create_column("test column")
            topcard = column.create_card_with_note("note content")
            bottomcard = column.create_card_with_note("bottom note")
            bottomcard.move("top", column.id)
            assert list(column.cards())[0] == bottomcard
            topcard.delete()
            bottomcard.delete()
            column.delete()

    def test_update(self):
        """Show that one can update a ProjectCard."""
        self.token_login()
        cassette_name = self.cassette_name("update")
        with self.recorder.use_cassette(cassette_name):
            repository = self.gh.repository("github3py", "delete_contents")
            project = repository.project(1177360)
            column = project.create_column("test column")
            card = column.create_card_with_note("note content")
            assert card.update("new note content") is True
            card.delete()
            column.delete()

    def test_retrieve_issue_from_content(self):
        """Verify we can retrieve an issue from a card."""
        self.token_login()
        cassette_name = self.cassette_name("retrieve_issue_from_content")
        with self.recorder.use_cassette(cassette_name):
            repository = self.gh.repository("github3py", "delete_contents")
            project = repository.project(1177360)
            column = project.column(1941635)
            card = column.card(15057578)
            assert isinstance(
                card.retrieve_issue_from_content(), github3.issues.issue.Issue
            )

    def test_retrieve_pull_request_from_content(self):
        """Verify we can retrieve a pull request from a card."""
        self.token_login()
        cassette_name = self.cassette_name(
            "retrieve_pull_request_from_content"
        )
        with self.recorder.use_cassette(cassette_name):
            repository = self.gh.repository("github3py", "delete_contents")
            project = repository.project(1177360)
            column = project.column(1941635)
            card = column.card(15057575)
            assert isinstance(
                card.retrieve_pull_request_from_content(),
                github3.pulls.PullRequest,
            )


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"><title>Lock Report</title>

Zimbra Thread Dump Lock Report

<form method="post" action="/cgi-bin/lock_report.cgi" name="uploadForm" enctype="multipart/form-data">
Upload a Java thread dump to generate a report:

<input name="file" type="file">

<input name="Submit" value="Upload!" type="submit">
</form>


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

using Microsoft.Azure.Commands.Network.Models;
using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
using Microsoft.Azure.Management.Internal.Resources.Utilities.Models;
using Microsoft.WindowsAzure.Commands.Utilities.Common;
using System.Linq;
using System.Management.Automation;

namespace Microsoft.Azure.Commands.Network
{
    [Cmdlet("Remove", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "ServiceEndpointPolicyDefinition", DefaultParameterSetName = "RemoveByNameParameterSet", SupportsShouldProcess = true), OutputType(typeof(PSServiceEndpointPolicy))]
    public class RemoveAzureServiceEndpointPolicyDefinitionCommand : NetworkBaseCmdlet
    {
        [Parameter(
            Mandatory = false,
            ParameterSetName = "RemoveByNameParameterSet",
            HelpMessage = "The name of the service endpoint definition")]
        [ValidateNotNullOrEmpty]
        public string Name { get; set; }

        [Parameter(
            Mandatory = true,
            ValueFromPipelineByPropertyName = true,
            ParameterSetName = "DeleteByResourceIdParameterSet")]
        [ValidateNotNullOrEmpty]
        public virtual string ResourceId { get; set; }

        [Parameter(
            Mandatory = true,
            ValueFromPipeline = true,
            ParameterSetName = "DeleteByInputObjectParameterSet")]
        [ValidateNotNullOrEmpty]
        public PSServiceEndpointPolicyDefinition InputObject
        {
            get; set;
        }

        [Parameter(
             Mandatory = true,
             ValueFromPipeline = true,
             HelpMessage = "The ServiceEndpointPolicy")]
        public PSServiceEndpointPolicy ServiceEndpointPolicy { get; set; }

        public override void Execute()
        {
            if (this.ShouldProcess(Name, VerbsLifecycle.Restart))
            {
                base.Execute();

                if (this.IsParameterBound(c => c.InputObject))
                {
                    this.Name = this.InputObject.Name;
                }

                if (this.IsParameterBound(c => c.ResourceId))
                {
                    var resourceIdentifier = new ResourceIdentifier(this.ResourceId);
                    this.Name = resourceIdentifier.ResourceName;
                }

                // Verify if the rule exists in the NetworkSecurityGroup
                var serviceEndpointPolicyDefinition = this.ServiceEndpointPolicy.ServiceEndpointPolicyDefinitions.SingleOrDefault(resource => string.Equals(resource.Name, this.Name, System.StringComparison.CurrentCultureIgnoreCase));

                if (serviceEndpointPolicyDefinition != null)
                {
                    this.ServiceEndpointPolicy.ServiceEndpointPolicyDefinitions.Remove(serviceEndpointPolicyDefinition);
                }

                WriteObject(this.ServiceEndpointPolicy);
            }
        }
    }
}


text:
Reveal.addEventListener('slidechanged', function(event) {
    // event.previousSlide, event.currentSlide, event.indexh, event.indexv

    // Type text into slide title
    var text = $(event.currentSlide).attr('data-type-title');
    var target = $(event.currentSlide).find('.title').first();
    if (text && target && $(target).text().length == 0) {
        typeText(text, target);
    }
});

Reveal.addEventListener('fragmentshown', function(event) {
    // event.fragment = the fragment DOM element

    // Type text into fragment element
    var text = $(event.fragment).attr('data-type-text');
    if (text  && $(event.fragment).text().length == 0) {
        typeText(text, $(event.fragment));
    }

    // Apply class to current slide (section tag)
    var sectionClass = $(event.fragment).attr('data-section-class');
    if (sectionClass) {
        $(event.fragment).parent().addClass(sectionClass);
    }
});

// "Type" text into an html element
function typeText(text, targetElement, erase)
{
    var deferred = $.Deferred();

    if (erase) {
        setTimeout(
            function() {
                eraseTextFromElement(
                    targetElement,
                    true
                ).done(function() {
                    typeTextToElement(text, targetElement)
                    .done(function() {
                        deferred.resolve();
                    });
                });
            },
            400
        );
    }
    else {
        typeTextToElement(text, targetElement)
        .done(function() {
            deferred.resolve();
        });
    }

    return deferred.promise();
}

function typeTextToElement(text, targetElement)
{
    var deferred = $.Deferred();

    if (text.length <= 0) return;

    $(targetElement).text($(targetElement).text() + text.charAt(0));

    var remainingText = text.substring(1);

    if (remainingText.length > 0) {
        setTimeout(function(){
            typeTextToElement(remainingText, targetElement).done(deferred.resolve)
        }, randomBetween(50, 150));
    }
    else {
        deferred.resolve();
    }

    return deferred.promise();
}

function eraseTextFromElement(targetElement, first)
{
    var deferred = $.Deferred();

    var text = $(targetElement).text();

    var remainingText = text.substring(0, (text.length - 1));

    if (text.length > 0) {
        $(targetElement).text(remainingText);
    }

    var timeout = (first) ? 500 : 30;

    if (remainingText.length > 0) {
        setTimeout(function(){
            eraseTextFromElement(targetElement).done(deferred.resolve)
        }, timeout);
    }
    else {
        deferred.resolve();
    }

    return deferred.promise();
}

function randomBetween(from,to)
{
    return Math.floor(Math.random() * (to - from + 1) + from);
}


text:
import {connect} from "react-redux"
import {bindActionCreators} from "redux"
import TileLanguageComponent from "../components/tileLanguage"
import photosGet from "../middlewares/photos"
import {selectedLanguageIDsAddRemove} from "../actions/languages"

// Can use "ownProps" here
// For accessing params for example.
const mapStateToProps = (state, ownProps) => {
	const {
		pagination: {
			photos: photosPagination
		},
		entitiesBuffered: {
			photos
		}
	} = state
	const {
		language: {ID}
	} = ownProps
	return {
		languagePhoto: photosPagination[ID] && photos[photosPagination[ID].IDs[0]]
	}
}

const mapDispatchToProps = dispatch => bindActionCreators(
	{
		photosGet,
		selectedLanguageIDsAddRemove
	},
	dispatch
)

const TileLanguage = connect(mapStateToProps, mapDispatchToProps)(TileLanguageComponent)

export default TileLanguage


text:
package org.supercsv.ext;

import java.lang.annotation.Annotation;

import org.supercsv.cellprocessor.ift.CellProcessor;
import org.supercsv.ext.builder.AbstractCellProcessorBuilder;

public class CustomBuilder extends AbstractCellProcessorBuilder<Class> {

    @Override
    public CellProcessor buildOutputCellProcessor(Class<Class> type, Annotation[] annos,
            CellProcessor cellProcessor, final boolean ignoreValidableProcessor) {
        System.out.println("カスタムセル");
        return cellProcessor;
    }

    @Override
    public CellProcessor buildInputCellProcessor(Class<Class> type, Annotation[] annos,
            CellProcessor cellProcessor) {
        System.out.println("カスタムセル");
        return cellProcessor;
    }

    @Override
    public Class getParseValue(Class<Class> type, Annotation[] annos, String defaultValue) {
        // TODO Auto-generated method stub
        return null;
    }

}


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
    <EditText android:id="@+id/edit_input"
    			android:layout_width="fill_parent"
    			android:layout_height="wrap_content"
    			android:singleLine="true" android:hint="Enter search keyword"/>
	<Button android:layout_width="wrap_content"
			android:layout_height="wrap_content" android:typeface="serif"
			android:text="Search" android:id="@+id/btn" />
</LinearLayout>


text:
/*
 * Description: Internal ethread exports
 * Author: Rickard Green
 */

#ifndef ETHR_INTERNAL_H__
#define ETHR_INTERNAL_H__

#include "erl_misc_utils.h"

extern ethr_memory_allocators ethr_mem__;
extern erts_cpu_info_t *ethr_cpu_info__;
extern size_t ethr_pagesize__;
extern size_t ethr_min_stack_size__; /* kilo words */
extern size_t ethr_max_stack_size__; /* kilo words */
extern int ethr_not_completely_inited__;
extern int ethr_not_inited__;

extern void *(*ethr_thr_prepare_func__)(void);
extern void (*ethr_thr_parent_func__)(void *);
extern void (*ethr_thr_child_func__)(void *);

#define ETHR_PAGE_ALIGN(SZ) \
  (((((size_t) (SZ)) - 1)/ethr_pagesize__ + 1)*ethr_pagesize__)
#define ETHR_B2KW(B) ((((size_t) (B)) - 1)/(sizeof(void *)*1024) + 1)
#define ETHR_KW2B(KW) (((size_t) (KW))*sizeof(void *)*1024)

#undef ETHR_STACK_GUARD_SIZE
#ifdef ETHR_HAVE_PTHREAD_ATTR_SETGUARDSIZE
#  define ETHR_STACK_GUARD_SIZE (ethr_pagesize__)
#endif

/* implemented in lib_src/<thr-lib>/ethread.c */
int ethr_set_tse__(ethr_ts_event *tsep);
ethr_ts_event *ethr_get_tse__(void);
ETHR_PROTO_NORETURN__ ethr_abort__(void);
#ifdef ETHR_WIN32_THREADS
int ethr_win_get_errno__(void);
#endif

/* implemented in lib_src/common/ethread_aux.c */
int ethr_init_common__(ethr_init_data *id);
int ethr_late_init_common__(ethr_late_init_data *lid);
void ethr_run_exit_handlers__(void);
void ethr_ts_event_destructor__(void *vtsep);

#if defined(ETHR_X86_RUNTIME_CONF__)
int ethr_x86_have_cpuid__(void);
void ethr_x86_cpuid__(int *eax, int *ebx, int *ecx, int *edx);
#endif

#endif