text:
package org.littlemonkey.connectivity;

import com.codename1.system.NativeInterface;

/**
 *
 * @author nick
 */
public interface NativeConnectivity extends NativeInterface {
    public int getConnectionStatus();
}


text:
<?php

/* Forms */

foreach ( $languages as $language ) {

	echo form_open('admin/translator', '', $hidden );

	echo form_submit('masterLang', $language);

	echo form_close();

}

?>

redpajama_set_name: RedPajamaGithub


text:
package com.phillypham.ka.infection;

import java.util.TreeSet;
import java.util.Set;

public class User implements Comparable<User> {
	private String id;
	private boolean infected = false;
	private Set<User> students;
	private Set<User> coaches;

	public User(String id) {
		this.id = id;
		students = new TreeSet<User>();
		coaches = new TreeSet<User>();
	}

	public String getId() { return this.id; }
	public Set<User> getStudents() { return this.students; }
	public Set<User> getCoaches() { return this.coaches; }
	public boolean addStudent(User student) {
		student.coaches.add(this);
		return students.add(student);
	}

	public boolean addCoach(User coach) {
		coach.students.add(this);
		return coaches.add(coach);
	}

	public boolean isInfected() { return this.infected; }

	public boolean infect() {
		boolean changed = !infected;
		this.infected = true;
		return changed;
	}

	public boolean uninfect() {
		boolean changed = infected;
		this.infected = false;
		return changed;
	}

	public void toggleInfection() { infected = !infected; }

	public int compareTo(User other) {
		return this.getId().compareTo(other.getId());
	}

	@Override
	public boolean equals(Object other) {
		if (other instanceof User) {
			User otherUser = (User) other;
			return this.getId() == otherUser.getId();
		}
		return false;
	}

	@Override
	public String toString() {
		StringBuilder out = new StringBuilder();
		out.append("User: "); out.append(id);
		return out.toString();
	}
}


text:
package mf.org.apache.xerces.dom;

import mf.org.w3c.dom.Entity;
import mf.org.w3c.dom.Node;

/**
 * Entity nodes hold the reference data for an XML Entity -- either
 * parsed or unparsed. The nodeName (inherited from Node) will contain
 * the name (if any) of the Entity. Its data will be contained in the
 * Entity's children, in exactly the structure which an
 * EntityReference to this name will present within the document's
 * body.
 *

 * Note that this object models the actual entity, _not_ the entity
 * declaration or the entity reference.
 *

 * An XML processor may choose to completely expand entities before
 * the structure model is passed to the DOM; in this case, there will
 * be no EntityReferences in the DOM tree.
 *

 * Quoting the 10/01 DOM Proposal,
 *

 * "The DOM Level 1 does not support editing Entity nodes; if a user
 * wants to make changes to the contents of an Entity, every related
 * EntityReference node has to be replaced in the structure model by
 * a clone of the Entity's contents, and then the desired changes
 * must be made to each of those clones instead. All the
 * descendants of an Entity node are readonly."
 *

 * I'm interpreting this as: It is the parser's responsibilty to call
 * the non-DOM operation setReadOnly(true,true) after it constructs
 * the Entity. Since the DOM explicitly decided not to deal with this,
 * _any_ answer will involve a non-DOM operation, and this is the
 * simplest solution.
 *
 * @xerces.internal
 *
 * @author Elena Litani, IBM
 * @version $Id: EntityImpl.java 447266 2006-09-18 05:57:49Z mrglavas $
 * @since PR-DOM-Level-1-19980818.
 */
public class EntityImpl
    extends ParentNode
    implements Entity {

    //
    // Constants
    //

    /** Serialization version. */
    static final long serialVersionUID = -3575760943444303423L;

    //
    // Data
    //

    /** Entity name. */
    protected String name;

    /** Public identifier. */
    protected String publicId;

    /** System identifier. */
    protected String systemId;

    /** Encoding */
    protected String encoding;

    /** Input Encoding */
    protected String inputEncoding;

    /** Version */
    protected String version;

    /** Notation name. */
    protected String notationName;

    /** base uri*/
    protected String baseURI;

    //
    // Constructors
    //

    /** Factory constructor. */
    public EntityImpl(CoreDocumentImpl ownerDoc, String name) {
    	super(ownerDoc);
        this.name = name;
        isReadOnly(true);
    }

    //
    // Node methods
    //

    /**
     * A short integer indicating what type of node this is. The named
     * constants for this value are defined in the org.w3c.dom.Node interface.
     */
    public short getNodeType() {
        return Node.ENTITY_NODE;
    }

    /**
     * Returns the entity name
     */
    public String getNodeName() {
        if (needsSyncData()) {
            synchronizeData();
        }
        return name;
    }

    /** Clone node. */
    public Node cloneNode(boolean deep) {
        EntityImpl newentity = (EntityImpl)super.cloneNode(deep);
        newentity.setReadOnly(true, deep);
        return newentity;
    }

    //
    // Entity methods
    //

    /**
     * The public identifier associated with the entity. If not specified,
     * this will be null.
     */
    public String getPublicId() {

        if (needsSyncData()) {
            synchronizeData();
        }
        return publicId;

    } // getPublicId():String

    /**
     * The system identifier associated with the entity. If not specified,
     * this will be null.
     */
    public String getSystemId() {

        if (needsSyncData()) {
            synchronizeData();
        }
        return systemId;

    } // getSystemId():String

    /**
      * DOM Level 3 WD - experimental
      * the version number of this entity, when it is an external parsed entity.
      */
    public String getXmlVersion() {

       if (needsSyncData()) {
           synchronizeData();
       }
       return version;

   } // getVersion():String

    /**
     * DOM Level 3 WD - experimental
     * the encoding of this entity, when it is an external parsed entity.
     */
    public String getXmlEncoding() {

       if (needsSyncData()) {
           synchronizeData();
       }

       return encoding;

   } // getVersion():String

    /**
     * Unparsed entities -- which contain non-XML data -- have a
     * "notation name" which tells applications how to deal with them.
     * Parsed entities, which are in XML format, don't need this and
     * set it to null.
     */
    public String getNotationName() {

        if (needsSyncData()) {
            synchronizeData();
        }
        return notationName;

    } // getNotationName():String

    //
    // Public methods
    //

    /**
     * DOM Level 2: The public identifier associated with the entity. If not specified,
     * this will be null. */
    public void setPublicId(String id) {

        if (needsSyncData()) {
            synchronizeData();
        }
    	publicId = id;

    } // setPublicId(String)

    /**
     * NON-DOM
     * encoding - An attribute specifying, as part of the text declaration,
     * the encoding of this entity, when it is an external parsed entity.
     * This is null otherwise
     *
     */
    public void setXmlEncoding(String value) {
        if (needsSyncData()) {
            synchronizeData();
        }
        encoding = value;
    } // setEncoding (String)

    /**
     * An attribute specifying the encoding used for this entity at the tiome
     * of parsing, when it is an external parsed entity. This is
     * null if it an entity from the internal subset or if it
     * is not known..
     * @since DOM Level 3
     */
    public String getInputEncoding(){
        if (needsSyncData()) {
            synchronizeData();
        }
        return inputEncoding;
    }

    /**
     * NON-DOM, used to set the input encoding.
     */
    public void setInputEncoding(String inputEncoding){
        if (needsSyncData()) {
            synchronizeData();
        }
        this.inputEncoding = inputEncoding;
    }

    /**
      * NON-DOM
      * version - An attribute specifying, as part of the text declaration,
      * the version number of this entity, when it is an external parsed entity.
      * This is null otherwise
      */
    public void setXmlVersion(String value) {
        if (needsSyncData()) {
            synchronizeData();
        }
        version = value;
    } // setVersion (String)

    /**
     * DOM Level 2: The system identifier associated with the entity. If not
     * specified, this will be null.
     */
    public void setSystemId(String id) {
        if (needsSyncData()) {
            synchronizeData();
        }
    	systemId = id;

    } // setSystemId(String)

    /**
     * DOM Level 2: Unparsed entities -- which contain non-XML data -- have a
     * "notation name" which tells applications how to deal with them.
     * Parsed entities, which are in XML format, don't need this and
     * set it to null.
     */
    public void setNotationName(String name) {
        if (needsSyncData()) {
            synchronizeData();
        }
    	notationName = name;

    } // setNotationName(String)

    /**
     * Returns the absolute base URI of this node or null if the implementation
     * wasn't able to obtain an absolute URI. Note: If the URI is malformed, a
     * null is returned.
     *
     * @return The absolute base URI of this node or null.
     * @since DOM Level 3
     */
    public String getBaseURI() {

        if (needsSyncData()) {
            synchronizeData();
        }
        return (baseURI!=null)?baseURI:((CoreDocumentImpl)getOwnerDocument()).getBaseURI();
    }

    /** NON-DOM: set base uri*/
    public void setBaseURI(String uri){
        if (needsSyncData()) {
            synchronizeData();
        }
        baseURI = uri;
    }

} // class EntityImpl


text:
package com.arjuna.wstx.tests.arq.basic;

import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.junit.Test;
import org.junit.runner.RunWith;

import com.arjuna.mw.wst11.TransactionManager;
import com.arjuna.mw.wst11.UserTransaction;
import com.arjuna.wstx.tests.arq.WarDeployment;
import com.arjuna.wstx.tests.common.DemoDurableParticipant;

@RunWith(Arquillian.class)
public class MultiParticipantsTest {

    @Deployment
    public static WebArchive createDeployment() {
        return WarDeployment.getDeployment(
                DemoDurableParticipant.class);
    }

    @Test
    public void testMultiParticipants()
            throws Exception
            {
        UserTransaction ut = UserTransaction.getUserTransaction();
        TransactionManager tm = TransactionManager.getTransactionManager();
        DemoDurableParticipant p1 = new DemoDurableParticipant();
        DemoDurableParticipant p2 = new DemoDurableParticipant();
        DemoDurableParticipant p3 = new DemoDurableParticipant();
        DemoDurableParticipant p4 = new DemoDurableParticipant();

        ut.begin();
        try {
            tm.enlistForDurableTwoPhase(p1, p1.identifier());
            tm.enlistForDurableTwoPhase(p2, p2.identifier());
            tm.enlistForDurableTwoPhase(p3, p3.identifier());
            tm.enlistForDurableTwoPhase(p4, p4.identifier());
        }  catch (Exception eouter) {
            try {
                ut.rollback();
            } catch(Exception einner) {
            }
            throw eouter;
        }

        ut.commit();
            }
}


text:
var MessageRepository = require('../app/message-repository');
var messageFixtures = require('./message-fixtures');

describe('MessageRepository', function() {
  var messageData, messageRepository;

  beforeEach(function() {
    messageData = _.cloneDeep(messageFixtures);
    messageRepository = new MessageRepository(messageData);
  });

  it('groups messages by date', function() {
    var groupedMessages = messageRepository.getMessages({showRead: true});
    var firstOfJulyGroup = _.find(groupedMessages, {dateString: '01-07-2015'});
    var lastOfJuneGroup = _.find(groupedMessages, {dateString: '30-06-2015'});

    expect(
      _.find(firstOfJulyGroup.messages, {subject: 'Subject 1'})
    ).toBeTruthy();

    expect(
      _.find(firstOfJulyGroup.messages, {subject: 'Subject 2'})
    ).toBeTruthy();

    expect(
      _.find(lastOfJuneGroup.messages, {subject: 'Subject 3'})
    ).toBeTruthy();

    expect(
      _.find(lastOfJuneGroup.messages, {subject: 'Subject 1'})
    ).toBeFalsy();
  });

  it('orders messages by their datetime within groups', function() {
    var groupedMessages = messageRepository.getMessages({showRead: true});
    var firstOfJulyGroup = _.find(groupedMessages, {dateString: '01-07-2015'});

    expect(firstOfJulyGroup.messages[0].subject).toEqual('Subject 2');
    expect(firstOfJulyGroup.messages[1].subject).toEqual('Subject 1');
  });

  it('filters messages based on whether they are read', function() {
    var groupedMessages = messageRepository.getMessages({showRead: false});
    var firstOfJulyGroup = _.find(groupedMessages, {dateString: '01-07-2015'});
    var lastOfJuneGroup = _.find(groupedMessages, {dateString: '30-06-2015'});

    expect(firstOfJulyGroup.messages.length).toEqual(2);
    expect(lastOfJuneGroup).toBeUndefined();
  });

  it('gets a message by id', function() {
    var message = messageRepository.getMessageById('558070eecadb84b2cd4d5ee2');
    expect(message.subject).toEqual('Subject 1');
  });
});


text:
SHELL = /bin/sh

srcdir = .
top_srcdir = ..

prefix = /usr/local
exec_prefix = ${prefix}

bindir = ${exec_prefix}/bin
sbindir = ${exec_prefix}/sbin
libexecdir = ${exec_prefix}/libexec
datadir = ${prefix}/share
sysconfdir = ${prefix}/etc
sharedstatedir = ${prefix}/com
localstatedir = ${prefix}/var
libdir = ${exec_prefix}/lib
infodir = ${prefix}/info
mandir = ${prefix}/man
includedir = ${prefix}/include
oldincludedir = /usr/include
pkgdatadir = $(datadir)/ntp
pkglibdir = $(libdir)/ntp
pkgincludedir = $(includedir)/ntp
top_builddir = ..

ACLOCAL = ${SHELL} /home/gerg/new-wave.dist/user/ntp/missing --run aclocal
AUTOCONF = ${SHELL} /home/gerg/new-wave.dist/user/ntp/missing --run autoconf
AUTOMAKE = ${SHELL} /home/gerg/new-wave.dist/user/ntp/missing --run automake
AUTOHEADER = ${SHELL} /home/gerg/new-wave.dist/user/ntp/missing --run autoheader

INSTALL = /usr/bin/install -c
INSTALL_PROGRAM = ${INSTALL}
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_SCRIPT = ${INSTALL}
INSTALL_HEADER = $(INSTALL_DATA)
transform = s,x,x,
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_alias =
build_triplet = i686-pc-linux-gnu
host_alias =
host_triplet = i686-pc-linux-gnu
target_alias =
target_triplet = i686-pc-linux-gnu
AMTAR = ${SHELL} /home/gerg/new-wave.dist/user/ntp/missing --run tar
AUTOKEY =
AWK = mawk
#CC = gcc
CFLAGS +=  -Wall -Wcast-qual -Wmissing-prototypes -Wpointer-arith -Wshadow -Wstrict-prototypes -pipe
CHUTEST =
CLKTEST =
CPP = $(CC) -E
DCFD =
DEPDIR = .deps
EF_LIBS =
EF_PROGS =
EXEEXT =
INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s
#LDFLAGS =
LIBPARSE =
LIBRSAREF =
LN_S = ln -s
MAKE_ADJTIMED =
MAKE_CHECK_Y2K =
MAKE_LIBPARSE =
MAKE_LIBPARSE_KERNEL =
MAKE_LIBRSAREF =
MAKE_NTPTIME = ntptime
MAKE_NTP_GENKEYS =
MAKE_PARSEKMODULE =
MAKE_TICKADJ = tickadj
MAKE_TIMETRIM =
OBJEXT = o
OPENSSL =
OPENSSL_INC =
OPENSSL_LIB =
PACKAGE = ntp
PATH_PERL = /usr/bin/perl
PATH_SH = /bin/sh
PROPDELAY =
RANLIB = ranlib
RSADIR =
RSAOBJS =
RSAREF =
RSASRCS =
TESTDCF =
U =
VERSION = 4.1.1
am__include = include
am__quote =
install_sh = /home/gerg/new-wave.dist/user/ntp/install-sh

AUTOMAKE_OPTIONS = ../util/ansi2knr
bin_PROGRAMS =
EXTRA_PROGRAMS = adjtimed
INCLUDES = -I$(top_srcdir)/include
LDADD = ../libntp/libntp.a
#EXTRA_DIST = TAGS
ETAGS_ARGS = Makefile.am
subdir = adjtimed
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
EXTRA_PROGRAMS = adjtimed$(EXEEXT)
bin_PROGRAMS =
PROGRAMS = $(bin_PROGRAMS)

adjtimed_SOURCES = adjtimed.c
adjtimed_OBJECTS = adjtimed$U.$(OBJEXT)
adjtimed_LDADD = $(LDADD)
adjtimed_DEPENDENCIES = ../libntp/libntp.a
adjtimed_LDFLAGS =

DEFS = -DHAVE_CONFIG_H
DEFAULT_INCLUDES =  -I. -I$(srcdir) -I$(top_builddir)
CPPFLAGS =
#LDFLAGS =
LIBS =
depcomp = $(SHELL) $(top_srcdir)/depcomp
DEP_FILES = $(DEPDIR)/adjtimed$U.Po
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
LIBS += $(LDLIBS$(LDLIBS_$@))
DIST_SOURCES = adjtimed.c
DIST_COMMON = README Makefile.am Makefile.in
SOURCES = adjtimed.c

all: all-am

.SUFFIXES:
.SUFFIXES: .c .o .obj
$(srcdir)/Makefile.in:  Makefile.am  $(top_srcdir)/configure.in $(ACLOCAL_M4)
	cd $(top_srcdir) && \
	  $(AUTOMAKE) --gnu  adjtimed/Makefile
Makefile:  $(srcdir)/Makefile.in  $(top_builddir)/config.status
	cd $(top_builddir) && \
	  CONFIG_HEADERS= CONFIG_LINKS= \
	  CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status
install-binPROGRAMS: $(bin_PROGRAMS)
	@$(NORMAL_INSTALL)
	$(mkinstalldirs) $(DESTDIR)$(bindir)
	@list='$(bin_PROGRAMS)'; for p in $$list; do \
	  p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
	  if test -f $$p \
	  ; then \
	    f=`echo $$p1|sed '$(transform);s/$$/$(EXEEXT)/'`; \
	   echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$f"; \
	   $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$f; \
	  else :; fi; \
	done

uninstall-binPROGRAMS:
	@$(NORMAL_UNINSTALL)
	@list='$(bin_PROGRAMS)'; for p in $$list; do \
	  f=`echo $$p|sed 's/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
	  echo " rm -f $(DESTDIR)$(bindir)/$$f"; \
	  rm -f $(DESTDIR)$(bindir)/$$f; \
	done

clean-binPROGRAMS:
	-test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
adjtimed$(EXEEXT): $(adjtimed_OBJECTS) $(adjtimed_DEPENDENCIES)
	@rm -f adjtimed$(EXEEXT)
	$(LINK) $(adjtimed_LDFLAGS) $(adjtimed_OBJECTS) $(adjtimed_LDADD) $(LIBS)

mostlyclean-compile:
	-rm -f *.$(OBJEXT) core *.core

distclean-compile:
	-rm -f *.tab.c

ANSI2KNR = ../util/ansi2knr
../util/ansi2knr:
	cd ../util && $(MAKE) $(AM_MAKEFLAGS) ansi2knr

mostlyclean-kr:
	-rm -f *_.c

include $(DEPDIR)/adjtimed$U.Po

distclean-depend:
	-rm -rf $(DEPDIR)

.c.o:
	source='$<' object='$@' libtool=no \
	depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' \
	$(CCDEPMODE) $(depcomp) \
	$(COMPILE) -c `test -f $< || echo '$(srcdir)/'`$<

.c.obj:
	source='$<' object='$@' libtool=no \
	depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' \
	$(CCDEPMODE) $(depcomp) \
	$(COMPILE) -c `cygpath -w $<`
CCDEPMODE = depmode=gcc
adjtimed_.c: adjtimed.c $(ANSI2KNR)
	$(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/adjtimed.c; then echo $(srcdir)/adjtimed.c; else echo adjtimed.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > adjtimed_.c || rm -f adjtimed_.c
adjtimed_.$(OBJEXT) : $(ANSI2KNR)
uninstall-info-am:

tags: TAGS

ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
	list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
	unique=`for i in $$list; do \
	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
	  done | \
	  $(AWK) '    { files[$$0] = 1; } \
	       END { for (i in files) print i; }'`; \
	mkid -fID $$unique $(LISP)

TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
		$(TAGS_FILES) $(LISP)
	tags=; \
	here=`pwd`; \
	list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
	unique=`for i in $$list; do \
	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
	  done | \
	  $(AWK) '    { files[$$0] = 1; } \
	       END { for (i in files) print i; }'`; \
	test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
	  || etags $(ETAGS_ARGS) $$tags  $$unique $(LISP)

GTAGS:
	here=`CDPATH=: && cd $(top_builddir) && pwd` \
	  && cd $(top_srcdir) \
	  && gtags -i $(GTAGS_ARGS) $$here

distclean-tags:
	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH

DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)

top_distdir = ..
distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)

distdir: $(DISTFILES)
	@for file in $(DISTFILES); do \
	  if test -f $$file; then d=.; else d=$(srcdir); fi; \
	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
	    $(mkinstalldirs) "$(distdir)/$$dir"; \
	  fi; \
	  if test -d $$d/$$file; then \
	    cp -pR $$d/$$file $(distdir) \
	    || exit 1; \
	  else \
	    test -f $(distdir)/$$file \
	    || cp -p $$d/$$file $(distdir)/$$file \
	    || exit 1; \
	  fi; \
	done
check-am: all-am
check: check-am
all-am: Makefile $(PROGRAMS)

installdirs:
	$(mkinstalldirs) $(DESTDIR)$(bindir)

install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am

install-am: all-am
	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am

installcheck: installcheck-am
install-strip:
	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
	  `test -z '$(STRIP)' || \
	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:

clean-generic:

distclean-generic:
	-rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]*

maintainer-clean-generic:
	@echo "This command is intended for maintainers to use"
	@echo "it deletes files that may require special tools to rebuild."
clean: clean-am

clean-am: clean-binPROGRAMS clean-generic mostlyclean-am

distclean: distclean-am

distclean-am: clean-am distclean-compile distclean-depend \
	distclean-generic distclean-tags

dvi: dvi-am

dvi-am:

info: info-am

info-am:

install-data-am:

install-exec-am: install-binPROGRAMS

install-info: install-info-am

install-man:

installcheck-am:

maintainer-clean: maintainer-clean-am

maintainer-clean-am: distclean-am maintainer-clean-generic

mostlyclean: mostlyclean-am

mostlyclean-am: mostlyclean-compile mostlyclean-generic mostlyclean-kr

uninstall-am: uninstall-binPROGRAMS uninstall-info-am

.PHONY: GTAGS all all-am check check-am clean clean-binPROGRAMS \
	clean-generic distclean distclean-compile distclean-depend \
	distclean-generic distclean-tags distdir dvi dvi-am info \
	info-am install install-am install-binPROGRAMS install-data \
	install-data-am install-exec install-exec-am install-info \
	install-info-am install-man install-strip installcheck \
	installcheck-am installdirs maintainer-clean \
	maintainer-clean-generic mostlyclean mostlyclean-compile \
	mostlyclean-generic mostlyclean-kr tags uninstall uninstall-am \
	uninstall-binPROGRAMS uninstall-info-am

# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:


text:
package org.kaaproject.kaa.server.admin.client.mvp.view.user;

import org.kaaproject.avro.ui.gwt.client.widget.grid.AbstractGrid;
import org.kaaproject.kaa.common.dto.admin.UserDto;
import org.kaaproject.kaa.server.admin.client.mvp.view.base.BaseListViewImpl;
import org.kaaproject.kaa.server.admin.client.util.Utils;

public class UsersViewImpl extends BaseListViewImpl<UserDto> {

        public UsersViewImpl() {
            super(true);
        }

        @Override
        protected AbstractGrid<UserDto, String> createGrid() {
            return new UsersGrid();
        }

        @Override
        protected String titleString() {
            return Utils.constants.users();
        }

        @Override
        protected String addButtonString() {
            return Utils.constants.addNewUser();
        }

}


text:
package br.com.bomrastreio.api.configuration;

import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;

@Configuration
@EnableScheduling
public class SchedulingConfiguration {
}


text:
package nl.rivm.cib.episim.hesitant;

import io.coala.config.GlobalConfig;

/**
 * O01 {@link PersonConfig}
 *
 * @version $Id$
 * @author Rick van Krevelen
 */
public interface PersonConfig extends GlobalConfig
{
	String BASE_KEY = "person";

	@DefaultValue( "const(1)" )
	String myConfidence();

	@DefaultValue( "const(0)" )
	String myComplacencyDist();

	@DefaultValue( "const(0.5)" )
	String myCalculationDist();

	// DKTP-1 ~ cauchy(x_0=59;gamma=3.5), subtract 14 days invitation delay
	@DefaultValue( "cauchy(45 day;3.5 day)" )
	String myVaccinationDelayDist();

	@DefaultValue( "[25 day;125 day>" )
	String myVaccinationDelayRange();
}


text:
package uk.dangrew.nuts.graphics.goal;

import java.util.ArrayList;
import java.util.List;
import java.util.TreeSet;

import javafx.beans.property.ObjectProperty;
import javafx.collections.FXCollections;
import javafx.scene.control.ComboBox;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import javafx.scene.control.TitledPane;
import javafx.scene.layout.GridPane;
import javafx.scene.layout.VBox;
import uk.dangrew.kode.javafx.custom.BoundDoubleAsTextProperty;
import uk.dangrew.kode.javafx.custom.PropertiesPane;
import uk.dangrew.kode.javafx.registrations.ChangeListenerBindingImpl;
import uk.dangrew.kode.javafx.registrations.ChangeListenerMismatchBindingImpl;
import uk.dangrew.kode.javafx.registrations.ChangeListenerRegistrationImpl;
import uk.dangrew.kode.javafx.registrations.ReadOnlyChangeListenerRegistrationImpl;
import uk.dangrew.kode.javafx.registrations.RegistrationManager;
import uk.dangrew.kode.javafx.style.Conversions;
import uk.dangrew.kode.javafx.style.JavaFxStyle;
import uk.dangrew.kode.javafx.style.PropertyRowBuilder;
import uk.dangrew.nuts.goal.proportion.ProportionGoal;
import uk.dangrew.nuts.goal.proportion.ProportionType;
import uk.dangrew.nuts.nutrients.NutritionalUnit;

public class ProportionGoalView extends VBox {

   private final Conversions conversions;
   private final RegistrationManager uiRegistrations;
   private final RegistrationManager modelRegistrations;
   private final JavaFxStyle styling;
   private final ProportionGoal viewModel;

   public ProportionGoalView() {
      this.viewModel = new ProportionGoal( "Selected" );
      this.styling = new JavaFxStyle();
      this.conversions = new Conversions();
      this.uiRegistrations = new RegistrationManager();
      this.modelRegistrations = new RegistrationManager();

      createGoalDetails();

      createMacroPane(
               "Carbohydrates",
               viewModel.configuration().carbohydrateProportionType(),
               viewModel.configuration().carbohydrateTargetValue()
      );

      createMacroPane(
               "Fat",
               viewModel.configuration().fatProportionType(),
               viewModel.configuration().fatTargetValue()
      );

      createMacroPane(
               "Protein",
               viewModel.configuration().proteinProportionType(),
               viewModel.configuration().proteinTargetValue()
      );

      createMacroPane(
               "Fiber",
               viewModel.configuration().fiberProportionType(),
               viewModel.configuration().fiberTargetValue()
      );

      createSimpleWeightGoals();
   }//End Constructor

   private final GridPane createMacroPane(
            String paneName,
            ObjectProperty< ProportionType > proportionTypeProperty,
            ObjectProperty< Double > targetProperty
   ){
      GridPane pane = new GridPane();
      styling.configureConstraintsForEvenRows( pane, 2 );
      styling.configureConstraintsForEvenColumns( pane, 2 );

      ComboBox< ProportionType > proportionType = new ComboBox<>( FXCollections.observableArrayList( ProportionType.values() ) );
      proportionType.getSelectionModel().select( proportionTypeProperty.get() );
      proportionType.setMaxWidth( Double.MAX_VALUE );

      pane.add( new Label( "Proportion Type" ), 0, 0 );
      pane.add( proportionType, 1, 0 );

      uiRegistrations.apply( new ChangeListenerRegistrationImpl<>( proportionTypeProperty, ( s, o, n ) -> proportionType.getSelectionModel().select( n ) ) );
      uiRegistrations.apply( new ReadOnlyChangeListenerRegistrationImpl<>( proportionType.getSelectionModel().selectedItemProperty(), ( s, o, n ) -> proportionTypeProperty.set( n ) ) );

      pane.add( new Label( "Target Value" ), 0, 1 );

      TextField field = new TextField();
      pane.add( field, 1, 1 );

      uiRegistrations.apply( new ChangeListenerMismatchBindingImpl<>(
               targetProperty, field.textProperty(),
               conversions.stringToDoubleFunction(), conversions.doubleToStringFunction()
      ) );

      TitledPane title = new TitledPane( paneName, pane );
      title.setCollapsible( false );
      getChildren().add( title );

      return pane;
   }//End Method

   private void createSimpleWeightGoals(){
      List< PropertyRowBuilder > builders = new ArrayList<>();
      TreeSet< NutritionalUnit > orderedUnits = new TreeSet<>( ( a, b ) -> a.displayName().compareToIgnoreCase( b.displayName() ) );
      orderedUnits.addAll( ProportionGoal.weightedGoalUnits() );

      for ( NutritionalUnit unit : orderedUnits ) {
         builders.add( new PropertyRowBuilder()
            .withLabelName( unit.displayName() )
            .withBinding( new BoundDoubleAsTextProperty( unit.of( viewModel ).property(), true ) )
         );
      }
      getChildren().add( new PropertiesPane( "Nutritional Units", builders ) );
   }//End Method

   /**
    * Method to create the details of the {@link Goal}.
    */
   private void createGoalDetails(){
      GridPane wrapper = new GridPane();
      styling.configureConstraintsForEvenColumns( wrapper, 2 );
      styling.configureConstraintsForEvenRows( wrapper, 1 );
      Label nameLabel = new Label( "Goal Name" );
      wrapper.add( nameLabel, 0, 0 );
      TextField name = new TextField();
      wrapper.add( name, 1, 0 );
      viewModel.properties().nameProperty().addListener( ( s, o, n ) -> name.setText( n ) );
      name.textProperty().addListener( ( s, o, n ) -> viewModel.properties().nameProperty().set( n ) );

      TitledPane goalDetails = new TitledPane( "Goal Details", wrapper );
      goalDetails.setCollapsible( false );
      getChildren().add( goalDetails );
   }//End Method

   void detach(){
      modelRegistrations.shutdown();
   }//End Method

   void show( ProportionGoal proportionGoal ) {
      modelRegistrations.apply( new ChangeListenerBindingImpl<>( proportionGoal.properties().nameProperty(), viewModel.properties().nameProperty() ) );
      modelRegistrations.apply( new ChangeListenerBindingImpl<>( proportionGoal.configuration().carbohydrateProportionType(), viewModel.configuration().carbohydrateProportionType() ) );
      modelRegistrations.apply( new ChangeListenerBindingImpl<>( proportionGoal.configuration().carbohydrateTargetValue(), viewModel.configuration().carbohydrateTargetValue() ) );

      modelRegistrations.apply( new ChangeListenerBindingImpl<>( proportionGoal.configuration().fatProportionType(), viewModel.configuration().fatProportionType() ) );
      modelRegistrations.apply( new ChangeListenerBindingImpl<>( proportionGoal.configuration().fatTargetValue(), viewModel.configuration().fatTargetValue() ) );

      modelRegistrations.apply( new ChangeListenerBindingImpl<>( proportionGoal.configuration().proteinProportionType(), viewModel.configuration().proteinProportionType() ) );
      modelRegistrations.apply( new ChangeListenerBindingImpl<>( proportionGoal.configuration().proteinTargetValue(), viewModel.configuration().proteinTargetValue() ) );

      modelRegistrations.apply( new ChangeListenerBindingImpl<>( proportionGoal.configuration().fiberProportionType(), viewModel.configuration().fiberProportionType() ) );
      modelRegistrations.apply( new ChangeListenerBindingImpl<>( proportionGoal.configuration().fiberTargetValue(), viewModel.configuration().fiberTargetValue() ) );

      for ( NutritionalUnit unit : NutritionalUnit.values() ) {
         modelRegistrations.apply( new ChangeListenerBindingImpl<>(
                  unit.of( proportionGoal ).property(),
                  unit.of( viewModel ).property()
         ) );
      }
   }//End Method

}//End Class


text:
/* globals shimNS */
var window = this; // eslint-disable-line no-var, no-unused-vars
var self = this; // eslint-disable-line no-var
self.parent = self;

(function () {
    const nonEnumerables = ['IDBVersionChangeEvent', 'IDBRequest', 'IDBOpenDBRequest', 'IDBTransaction', 'IDBKeyRange', 'IDBCursor', 'IDBCursorWithValue', 'IDBDatabase', 'IDBObjectStore', 'IDBIndex', 'IDBFactory', 'indexedDB'];
    nonEnumerables.concat(
        // Needed early by testing framework
        'clearTimeout', 'setTimeout',
        'addEventListener', 'document'
    ).forEach(function (prop) {
        this[prop] = shimNS.window[prop];
    }, this);
}());


text:
<?xml version="1.0"?>
<tool id="organism_delete_organisms" name="Chado organism delete" version="@WRAPPER_VERSION@">
    <description></description>
	<macros>
		<import>macros.xml</import>
	</macros>
	<expand macro="requirements"/>
    <code file="chado.py"/>
	<command detect_errors="aggressive"><![CDATA[
@START_PSQL@ &&

chakin organism delete_organisms

--organism_id $organism

 > '$results'

@ZIP_PSQL@
    ]]></command>
	<inputs>
    <expand macro="psql_target"/>
    <!-- arguments -->

    <!-- options -->
    <param argument="--organism"
           type="select"
           dynamic_options="list_organisms()"
           label="Organism" />

	</inputs>
	<outputs>
		<data format="txt" name="results"/>
    <data format="postgresql" name="outfile" from_work_dir="postgresql_out.tar.bz2" label="${tool.name} on ${on_string}">
			<filter>psql_target['method'] == "pgtools"</filter>
		</data>
	</outputs>
	<help>
Delete all organisms

@HELP@
	</help>
</tool>


text:
CEP 3 - |Cyclus| Release Procedure
********************************************************

:CEP: 3
:Title: |Cyclus| Release Procedure
:Last-Modified: 2014-09-11
:Author: Anthony Scopatz
:Status: Accepted
:Type: Process
:Created: 2013-10-25

Abstract
========
The purpose of this document is to act as a guideline and checklist for how
to release the |cyclus| core code base and the supported projects in the ecosystem.

The |Cyclus| Ecosystem
======================
The very first thing to do when preparing for an upcoming release is to elect
a release manager.  This person has the special responsibility of making sure
all of the following tasks are implemented.  Therefore, their judgment for the
placement of issues and code stability must be adhered to.

The |cyclus| ecosystem has a few projects which are all released together.
(This may change in the future a development diverges and the core becomes more
stable.)  The projects that are under the release manager's purview are:

* `Cyclus`_
* `Cycamore`_
* `Cycstub`_ - copy the files from |cyclus| core's ``stub/`` dir into the
  cycstub's ``src/`` dir.

The projects which are not yet under the release managers purview are:

* `Cyclist`_
* `CIclus`_

Release Candidates & Branches
=============================
All projects should have a release candidate ('-rc1') that comes out 2 - 5 days
prior to the scheduled release.  During this time, no changes should occur to
a special release branch ('vX.X.X-release').

The release branch is there so that development can continue on the
develop branch while the release candidates (rc) are out and under review.
This is because otherwise any new developments would have to wait until
post-release to be merged into develop to prevent them from accidentally
getting released early.

As such, the 'vX.X.X-release' branch should only exist while there are
release candidates out.  They are akin to a temporary second level of staging
to be used to keep master clean and safe.  As such, everything that is in this
branch should also be part of develop.  Graphically,

.. figure:: cep-0003-1.svg
    :align: center

    **Figure 1:** Branch hierarchy under release.

Every time a new release candidate comes out the vX.X.X-release should be
tagged with the name 'X.X.X-rcX'.  There should be a 2 - 5 day period of time
in between release candidates.  When the full and final release happens, the
'vX.X.X-release' branch is merged into master and then deleted.

If you have a new fix that needs to be in the next release candidate, you should
make a topical branch and then pull request it into the release branch.  After this
has been accepted, the topical branch should be merged with develop as well.

The release branch must be quiet and untouched for 2 - 5 days prior to the full
release.

Project Checklist
=================
When releasing a |cyclus| project, make sure to do the following items in order:

1. Review **ALL** issues in the issue tracker, reassigning or closing them as needed.
2. Ensure that all issues in this release's milestone have been closed.  Moving issues
   to the next release's milestone is a perfectly valid strategy for completing this
   milestone.
3. Perform maintainence tasks for this project, see below.
4. Write and commit the release notes.
5. Review the current state of documentation and make approriate updates.
6. Bump the version (in code, documentation, etc.) and commit the change.
7. If this is a release candidate, tag the release branch with a name that matches
   that of the release:

   * If this is the first release candidate, create a release branch called
     'vX.X.X-release' off of develop.  Tag this branch with the name 'X.X.X-rc1'.
   * If this is the second or later release candidate, tag the release branch
     with the name 'X.X.X-rcX'.

8. If this is the full and final release (and not a release candidate),
   merge the release branch into the master branch.  Next, tag the master branch
   with the name 'X.X.X'.  Finally, delete the release branch.
9. Push the tags upstream
10. Create a DOI. See :doc:`CEP4 <./cep4>` for details.
11. Update release information on the website.

.. note::

    To distingush them, branch names have a ``v`` prefix (``vX.X.X``) while tag
    names lack this prefix (``X.X.X``).

Maintainence Tasks
==================
Each project may have associate maintenance tasks which may need to be performed at
least as often as every micro release.

|Cyclus|
--------
**Update Pyne:**  PyNE source code is included and shipped as part of |cyclus|. As pyne
evolves, we'll want to have our version evolve as well. Here are the steps to do so.
These assume that in your HOME dir there are both the pyne and |cyclus| repos.  Remember
to check in the changes afterwards.

.. code-block:: bash

    $ cd ~/pyne
    $ ./amalgamate.py -s pyne.cc -i pyne.h
    $ cp pyne.* ~/cyclus/src

**Update Nuclear Data:** PyNE also provides a nuclear data library generator which we use for
our source data.  Occassionally, this needs to be updated as updates to pyne itself come out.
The command for generating |cyclus| specific nuclear data is as follows:

.. code-block:: bash

   $ cd ~/pyne
   $ nuc_data_make -o cyclus_nuc_data.h5 \
    -m atomic_mass,scattering_lengths,decay,simple_xs,materials,eaf,wimsd_fpy,nds_fpy

Once the file is generated it must be put onto rackspace.

**Update Gtest:** We include a copy of the fused Gtest source code within our
source tree located in the ``tests/GoogleTest`` directory.  To keep up with
Gtest's natural evolution cycle, please download the latest release of Google Tests
and follow `the fused source directions here`_.  If we go too long without doing this,
it could be very painful to update.

**Verify & Update API Stability:** Since Cyclus v1.0 we promise API stability.
Luckily, we have a tool for keeping track of this mostly automatically.
Every release please run the following command to verify that the release
branch is stable:

.. code-block:: bash

    $ cd cyclus/release
    $ ./smbchk.py --update -t HEAD --no-save --check

If cyclus only has API additions, it is considered stable and the command will
tell you so. If cyclus also has API deletions, then cyclus is considered
unstable and a diff of the symbols will be prinited.
**You cannot release cyclus if it is unstable!** Please post the diff to
either the mailing list or the issue tracker and work to resolve the removed
symbols until it this command declares that cyclus is stable. It is
probably best to do this prior to any release candidates if possible.

Once stable and there are no more code changes to be made, add the symbols
in this release to the database with the following command:

.. code-block:: bash

    $ cd cyclus/release
    $ ./smbchk.py --update -t X.X.X

where ``X.X.X`` is the version tag. This should alter the ``symbols.json``
file.  Commit this and add it to the repo.

Cycamore
------------

On each new release (major, minor, micro), the release manager is responsible
for updating the regression test databases updated.

First, add the actual releases as tags (this can be done through the GitHub
interface).

Next, generate the new databases:

.. code-block:: bash

  $ cd ~/cycamore/tests
  $ python ref.py gen

Next, rename the databases:

.. code-block:: bash

  $ rename 's/^[^_]*_[^_]*_(.*)/<cyclus version>_<cycamore version>_$1/' *.h5

where

* <cyclus version> is replaced by the current version tag name for cyclus
  (e.g. v0.1)
* <cycamore version> is replaced by the current version tag name for cycamore
  (e.g. v0.1)

so that, using the above examples, the command is

.. code-block:: bash

  $ rename 's/^[^_]*_[^_]*_(.*)/v0.1_v0.1_$1/' *.h5

At this point, you will need to get a credentials file, which exists in the
metadata document in the Cyclus-CI shared folder on Google drive. If you have
questions, please email cyclus-ci@googlegroups.com. The file must be named
`rs.cred`.

Now, update (add) them on the regression test server

.. code-block:: bash

  $ python ref.py add *.h5

Next, add the reflist file you just altered:

.. code-block:: bash

  $ git add reflist.json
  $ git commit -m "updated reflist.json"
  $ git push upstream develop

Finally, feel free to clean up after yourself

.. code-block:: bash

  $ rm *.h5

Cycstub
--------
Every release the relevant files from |cyclus| should be copied over to cyclus.
Use the following BASH commands to do so:

.. code-block:: bash

   $ cp ~/cyclus/tests/input/stub_example.xml ~/cycstub/input/example.xml && \
     cp ~/cyclus/stubs/stub_* ~/cycstub/src/

Document History
================
This document is released under the CC-BY 3.0 license.

.. _Cyclus: https://github.com/cyclus/cyclus
.. _Cycamore: https://github.com/cyclus/cycamore
.. _Cycstub: https://github.com/cyclus/cycstub
.. _Cyclist: https://github.com/cyclus/cyclist2
.. _CIclus: https://github.com/cyclus/ciclus
.. _the fused source directions here: https://code.google.com/p/googletest/wiki/V1_6_AdvancedGuide#Fusing_Google_Test_Source_Files


text:
#include <linux/module.h>
#include <linux/kernel.h>

#include "dlmfsver.h"

#define DLM_BUILD_VERSION "1.5.0"

#define VERSION_STR "OCFS2 DLMFS " DLM_BUILD_VERSION

void dlmfs_print_version(void)
{
	printk(KERN_INFO "%s\n", VERSION_STR);
}

MODULE_DESCRIPTION(VERSION_STR);

MODULE_VERSION(DLM_BUILD_VERSION);


text:
/**
 * @author  Thomas Baumann <teebaum@ymail.com>
 *
 * @section LICENSE
 * See LICENSE for more informations.
 *
 */

#include "HighlightListItemDelegate.h"
#include "HighlightingDialog.h"
#include "ui_HighlightingDialog.h"

int HighlightingDialog::HighlightRuleDataRole = Qt::UserRole + 1;

HighlightingDialog::HighlightingDialog(QWidget *parent) :
   QDialog(parent),
   ui(new Ui::HighlightingDialog)
{
   ui->setupUi(this);

   ui->fontPicker->setFontFilters(QFontComboBox::MonospacedFonts);

   ui->wordRulesListWidget->setItemDelegate(new HighlightListItemDelegate(this));
   ui->lineRulesListWidget->setItemDelegate(new HighlightListItemDelegate(this));

   createConnections();
}

void HighlightingDialog::createConnections()
{
   connect(ui->wordRulesListWidget, &QListWidget::itemSelectionChanged,
           [this] {
      if (ui->wordRulesListWidget->selectedItems().count()) {
         ui->lineRulesListWidget->selectionModel()->clear();
      }
      setUiForCurrentSelectedItem();
   });
   connect(ui->lineRulesListWidget, &QListWidget::itemSelectionChanged,
           [this] {
      if (ui->lineRulesListWidget->selectedItems().count()) {
         ui->wordRulesListWidget->selectionModel()->clear();
      }
      setUiForCurrentSelectedItem();
   });

   connect(ui->foregroundColorPicker, &ColorPicker::currentColorChanged,
           this, &HighlightingDialog::updateCurrentSelectedRuleValues);
   connect(ui->backgroundColorPicker, &ColorPicker::currentColorChanged,
           this, &HighlightingDialog::updateCurrentSelectedRuleValues);
   connect(ui->fontPicker, &FontPicker::currentFontChanged,
           this, &HighlightingDialog::updateCurrentSelectedRuleValues);
   connect(ui->regexLineEdit, &QLineEdit::textChanged,
           this, &HighlightingDialog::updateCurrentSelectedRuleValues);
   connect(ui->caseSensitiveCheckBox, &QCheckBox::toggled,
           this, &HighlightingDialog::updateCurrentSelectedRuleValues);
}

QList<HighlightingRule> HighlightingDialog::rulesFromListWidget(QListWidget *listWidget) const
{
   QList<HighlightingRule> rules;

   for (int i = 0; i < listWidget->count(); ++i) {
      QListWidgetItem *item = listWidget->item(i);
      if (!item) {
         continue;
      }

      QVariant highlightingRuleData = item->data(HighlightRuleDataRole);
      HighlightingRule highlightingRule = highlightingRuleData.value<HighlightingRule>();
      rules << highlightingRule;
   }

   return rules;
}

HighlightingDialog::~HighlightingDialog()
{
   delete ui;
}

void HighlightingDialog::setHighlightingRules(const QList<HighlightingRule> &lineRules,
                                              const QList<HighlightingRule> &wordRules)
{
   foreach (const HighlightingRule &rule, lineRules) {
      addNewRuleToListWidget(ui->lineRulesListWidget, rule);
   }
   foreach (const HighlightingRule &rule, wordRules) {
      addNewRuleToListWidget(ui->wordRulesListWidget, rule);
   }
}

void HighlightingDialog::addWordHighlightingRule(const HighlightingRule &rule)
{
   addNewRuleToListWidget(ui->wordRulesListWidget, rule);
}

void HighlightingDialog::addLineHighlightingRule(const HighlightingRule &rule)
{
   addNewRuleToListWidget(ui->lineRulesListWidget, rule);
}

QList<HighlightingRule> HighlightingDialog::wordHighlightingRules() const
{
   return rulesFromListWidget(ui->wordRulesListWidget);
}

QList<HighlightingRule> HighlightingDialog::lineHighlightingRules() const
{
   return rulesFromListWidget(ui->lineRulesListWidget);
}

void HighlightingDialog::on_addRuleButton_clicked()
{
   QListWidgetItem *currentItem = currentSelectedItem();

   QListWidget *listWidget = nullptr;
   if (!currentItem) {
      listWidget = ui->wordRulesListWidget;
   } else {
      listWidget = currentItem->listWidget();
   }

   int currentItemIndex = 0;
   if (currentItem) {
      currentItemIndex = listWidget->row(currentItem);
   }

   addNewRuleToListWidget(listWidget, highlightingRuleFromGui(), currentItemIndex + 1);
}

void HighlightingDialog::on_deleteRuleButton_clicked()
{
   deleteCurrentSelectedRule();
}

void HighlightingDialog::on_buttonBox_clicked(QAbstractButton *button)
{
   QDialogButtonBox::StandardButton standardButton = ui->buttonBox->standardButton(button);
   if (standardButton == QDialogButtonBox::Apply ||
       standardButton == QDialogButtonBox::Ok) {
      emit highlightingRulesChanged(lineHighlightingRules(), wordHighlightingRules());
   }
}

void HighlightingDialog::on_downButton_clicked()
{
   QListWidgetItem *currentItem = currentSelectedItem();
   if (!currentItem) {
      return;
   }

   QListWidget *listWidget = currentItem->listWidget();
   int currentItemRow = listWidget->row(currentItem);
   if (currentItemRow >= (listWidget->count() - 1)) {
      return;
   }

   listWidget->takeItem(currentItemRow);
   listWidget->insertItem(currentItemRow + 1, currentItem);

   selectListWidgetItem(currentItem);
}

void HighlightingDialog::on_upButton_clicked()
{
   QListWidgetItem *currentItem = currentSelectedItem();
   if (!currentItem) {
      return;
   }

   QListWidget *listWidget = currentItem->listWidget();
   int currentItemRow = listWidget->row(currentItem);
   if (currentItemRow <= 0) {
      return;
   }

   listWidget->takeItem(currentItemRow);
   listWidget->insertItem(currentItemRow - 1, currentItem);

   selectListWidgetItem(currentItem);
}

void HighlightingDialog::on_bottomButton_clicked()
{
   QListWidgetItem *currentItem = currentSelectedItem();
   if (!currentItem) {
      return;
   }

   QListWidget *listWidget = currentItem->listWidget();
   int currentItemRow = listWidget->row(currentItem);
   if (currentItemRow >= (listWidget->count() - 1)) {
      return;
   }

   listWidget->takeItem(currentItemRow);
   listWidget->insertItem(listWidget->count(), currentItem);

   selectListWidgetItem(currentItem);
}

void HighlightingDialog::on_topButton_clicked()
{
   QListWidgetItem *currentItem = currentSelectedItem();
   if (!currentItem) {
      return;
   }

   QListWidget *listWidget = currentItem->listWidget();
   int currentItemRow = listWidget->row(currentItem);
   if (currentItemRow <= 0) {
      return;
   }

   listWidget->takeItem(currentItemRow);
   listWidget->insertItem(0, currentItem);

   selectListWidgetItem(currentItem);
}

void HighlightingDialog::updateCurrentSelectedRuleValues()
{
   QListWidgetItem *currentItem = currentSelectedItem();
   if (!currentItem) {
      return;
   }

   HighlightingRule highlightingRule = currentItem->data(HighlightRuleDataRole).value<HighlightingRule>();

   // Foreground color
   highlightingRule.setForegroundColor(ui->foregroundColorPicker->currentColor());
   currentItem->setForeground(ui->foregroundColorPicker->currentColor());

   // Background color
   highlightingRule.setBackgroundColor(ui->backgroundColorPicker->currentColor());
   currentItem->setBackground(ui->backgroundColorPicker->currentColor());

   // Font
   highlightingRule.setFont(ui->fontPicker->currentFont());
   currentItem->setFont(ui->fontPicker->currentFont());

   // Text
   highlightingRule.setText(ui->regexLineEdit->text());
   currentItem->setText(ui->regexLineEdit->text());

   // Case sensitivity
   highlightingRule.setCaseSensitivity((ui->caseSensitiveCheckBox->isChecked() ?
                                           Qt::CaseSensitive : Qt::CaseInsensitive));

   currentItem->setData(HighlightRuleDataRole, QVariant::fromValue<HighlightingRule>(highlightingRule));
}

void HighlightingDialog::changeEvent(QEvent *event)
{
   if (event->type() == QEvent::LanguageChange) {
      ui->retranslateUi(this);
   }

   QDialog::changeEvent(event);
}

HighlightingRule HighlightingDialog::highlightingRuleFromGui() const
{
   HighlightingRule rule;
   rule.setBackgroundColor(ui->backgroundColorPicker->currentColor());
   rule.setForegroundColor(ui->foregroundColorPicker->currentColor());
   rule.setFont(ui->fontPicker->currentFont());
   rule.setText(ui->regexLineEdit->text());
   rule.setCaseSensitivity(ui->caseSensitiveCheckBox->isChecked() ?
                              Qt::CaseSensitive :
                              Qt::CaseInsensitive);

   return rule;
}

/*!
 * \brief HighlightingDialog::addNewRuleToListWidget
 * Adds a new rule to a list widget. If position is a valid position, the new rule will be inserted
 * at this position. If the position isn't valid, the rule will be appended to the list.
 * \param listWidget
 * \param rule
 * \param position
 */
void HighlightingDialog::addNewRuleToListWidget(QListWidget *listWidget, const HighlightingRule &rule, int position)
{
   QListWidgetItem *listItem = new QListWidgetItem;
   listItem->setBackground(rule.backgroundColor());
   listItem->setForeground(rule.foregroundColor());
   listItem->setFont(rule.font());
   listItem->setText(rule.text());
   listItem->setData(HighlightRuleDataRole, QVariant::fromValue<HighlightingRule>(rule));

   int insertIndex = position;
   if (insertIndex < 0 ||
       insertIndex >= listWidget->count()) {
      insertIndex = listWidget->count();
   }
   listWidget->insertItem(insertIndex, listItem);

   selectListWidgetItem(listItem);
}

void HighlightingDialog::deleteCurrentSelectedRule()
{
   QListWidgetItem *selectedItem = currentSelectedItem();
   int currentSelectedRow = selectedItem->listWidget()->row(selectedItem);

   if (!selectedItem) {
      return;
   }

   QListWidget *listWidget = selectedItem->listWidget();
   if (!listWidget) {
      return;
   }

   QWidget *itemWidget = listWidget->itemWidget(selectedItem);
   listWidget->takeItem(listWidget->row(selectedItem));
   if (itemWidget) {
      delete itemWidget;
   }
   delete selectedItem;

   if (listWidget->count() == 0) {
      return;
   }

   int selectIndex = currentSelectedRow;

   if (currentSelectedRow >= listWidget->count()) {
      selectIndex = listWidget->count() - 1;
   }

   listWidget->selectionModel()->clear();
   QModelIndex itemIndex = listWidget->model()->index(selectIndex, 0);
   listWidget->selectionModel()->select(itemIndex, QItemSelectionModel::Select);
}

void HighlightingDialog::setUiForCurrentSelectedItem()
{
   QListWidgetItem *selectedItem = currentSelectedItem();
   if (!selectedItem) {
      return;
   }

   HighlightingRule highlightingRule = selectedItem->data(HighlightRuleDataRole).value<HighlightingRule>();
   ui->foregroundColorPicker->setCurrentColor(highlightingRule.foregroundColor());
   ui->backgroundColorPicker->setCurrentColor(highlightingRule.backgroundColor());
   ui->fontPicker->setCurrentFont(highlightingRule.font());
   ui->regexLineEdit->setText(highlightingRule.text());
   ui->caseSensitiveCheckBox->setChecked(highlightingRule.caseSensitivity() == Qt::CaseSensitive);
}

QListWidgetItem *HighlightingDialog::currentSelectedItem() const
{
   QListWidgetItem *selectedItem = nullptr;

   if (ui->wordRulesListWidget->selectedItems().count()) {
      selectedItem = ui->wordRulesListWidget->selectedItems().at(0);
   }

   if (ui->lineRulesListWidget->selectedItems().count()) {
      selectedItem = ui->lineRulesListWidget->selectedItems().at(0);
   }

   return selectedItem;
}

void HighlightingDialog::selectListWidgetItem(QListWidgetItem *item)
{
   QListWidget *listWidget = item->listWidget();
   if (!listWidget) {
      return;
   }
   int itemRow = listWidget->row(item);
   QModelIndex itemIndex = listWidget->model()->index(itemRow, 0);

   if (!itemIndex.isValid()) {
      return;
   }

   listWidget->selectionModel()->clear();
   listWidget->selectionModel()->select(itemIndex, QItemSelectionModel::Select);
}


text:
//
//  FWViewController.m
//  FWShareSDKDemo
//
//  Created by Liuyong on 14-8-8.
//  Copyright (c) 2014年 FlyWire. All rights reserved.
//

#import "FWViewController.h"
#import "FWShareView.h"
#import "FWShareManager.h"
#import "FWRightViewController.h"

@interface FWViewController ()

@end

@implementation FWViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.

//    self.view.backgroundColor = [UIColor blueColor];

    if ([[[UIDevice currentDevice] systemVersion] floatValue] >  7.0) {
        self.edgesForExtendedLayout = UIRectEdgeNone;
    }

}

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (IBAction)onShareButton:(id)sender
{

    //step 4 显示视图并分享数据内容
    FWShareData *shareData = [FWShareData message];
    shareData.dataType = kShareDataTypeText;
    shareData.text = @"分享一个好玩的游戏信息";
    shareData.bText = YES;

    [FWShareManager showShareViewFrom:self shareContent:shareData completionHandler:^(SocialSNSType socialType, FWResponseState responseState, FWShareData *sourceShareData, NSError *error) {
            [self completionHandlerShareSocialType:socialType responseState:responseState data:sourceShareData error:error];
    }];

}

- (IBAction)showRightView
{
    UIViewController *viewController = [[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"rightview"];

    UINavigationController *nvController = [[UINavigationController alloc] initWithRootViewController:viewController];

    [self presentViewController:nvController animated:YES completion:^{
        //
    }];
}

- (IBAction)showNext:(id)sender
{
    UIViewController *viewController = [[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"rightview"];
    [self presentViewController:viewController animated:YES completion:^{

    }];
}
- (IBAction)onPush:(id)sender
{
    UIViewController *viewController = [[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"mainVC"];

    [self.navigationController pushViewController:viewController animated:YES];
}

/**
 *  分享纯文本消息
 *
 *  @param sender sender description
 */
- (IBAction)shareText:(id)sender
{
    //step 4 显示视图并分享数据内容
    FWShareData *shareData = [FWShareData message];
    shareData.dataType = kShareDataTypeText;
    shareData.text = @"分享一个好玩的游戏信息";
    shareData.bText = YES;

    [FWShareManager showShareViewFrom:self shareContent:shareData completionHandler:^(SocialSNSType socialType, FWResponseState responseState, FWShareData *sourceShareData, NSError *error) {

        [self completionHandlerShareSocialType:socialType responseState:responseState data:sourceShareData error:error];
    }];
}

/**
 *  分享图片信息,可包含文本
 *
 *  @param sender sender description
 */
- (IBAction)shareImageMessage:(id)sender
{
    //step 4 显示视图并分享数据内容
    FWShareData *shareData = [FWShareData message];
    shareData.dataType = kShareDataTypeImage;
    shareData.text = @"分享一个好玩的游戏信息";
    shareData.bText = NO;

    FWImageObject *imageObject = [FWImageObject object];
    imageObject.imageData = [NSData dataWithContentsOfFile: [[NSBundle mainBundle] pathForResource:@"share" ofType:@"jpg"]];
    imageObject.thumbnailData = UIImageJPEGRepresentation([UIImage imageNamed:@"icon58x58"], 1.0);
    shareData.mediaObject = imageObject;

    [FWShareManager showShareViewFrom:self shareContent:shareData completionHandler:^(SocialSNSType socialType, FWResponseState responseState, FWShareData *sourceShareData, NSError *error) {

        [self completionHandlerShareSocialType:socialType responseState:responseState data:sourceShareData error:error];

    }];
}

/**
 *  分享多媒体信息,webpage
 *
 *  @param sender sender description
 */
- (IBAction)shareWebpage:(id)sender
{
    //step 4 显示视图并分享数据内容
    FWShareData *shareData = [FWShareData message];
    shareData.dataType = kShareDataTypeWebPage;
    shareData.text = @"分享一个好玩的游戏信息";
    shareData.bText = NO;

    FWWebpageObject *mediaObject = [FWWebpageObject object];
    mediaObject.title = @"好玩的游戏";
    mediaObject.desc = @"这个游戏很经典,小伙伴快来跟我一起玩吧。";
    mediaObject.thumbnailData = UIImageJPEGRepresentation([UIImage imageNamed:@"menubg"], 1);
    mediaObject.webpageUrl = @"http://nie.163.com";

    shareData.mediaObject = mediaObject;

    [FWShareManager showShareViewFrom:self shareContent:shareData completionHandler:^(SocialSNSType socialType, FWResponseState responseState, FWShareData *sourceShareData, NSError *error) {
        [self completionHandlerShareSocialType:socialType responseState:responseState data:sourceShareData error:error];
            }];
}

- (void)completionHandlerShareSocialType:(SocialSNSType)socialType
                            responseState:(FWResponseState)responseState
                                    data:(FWShareData *)shareData
                                   error:(NSError *)error
{
    if (socialType == kSocialSNSTypeNone) {
        //说明什么也没选择,取消;此时 responseState =FWResponseStateCancel
        NSLog(@"没有选择分享到社交网络,取消");
    }

    NSLog(@"error:%@", error);

    if (responseState == FWResponseStateBegan) {
        NSLog(@"分享开始");
    }
    else if (responseState == FWResponseStateSuccess) {
        NSLog(@"分享成功");
        UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"提示" message:@"分享成功" delegate:nil cancelButtonTitle:@"知道了" otherButtonTitles: nil];
        [alertView show];
    }
    else if (responseState == FWResponseStateFail) {
        NSLog(@"分享失败");
    }
    else if (responseState == FWResponseStateCancel) {
        NSLog(@"分享取消");
    }

}

@end


text:
module Fog
  module SharedFileSystem
    class OpenStack
      class Real
        def list_snapshots(options = {})
          request(
            :expects => 200,
            :method  => 'GET',
            :path    => 'snapshots',
            :query   => options
          )
        end
      end

      class Mock
        def list_snapshots(_options = {})
          response = Excon::Response.new
          response.status = 200
          response.body = {'snapshots' => data[:snapshots]}
          response
        end
      end
    end
  end
end


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>NCCUCY</title>

    <link href="css/simple-sidebar.css" rel="stylesheet">
    <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">

                       NCCUCY

Home

                        <button type="button" class="btn btn-default" id="myBtn">Login</button>
                        <button type="submit" class="btn btn-default">Sign up</button>

寒返

青春無敵,展現返鄉服務的才氣,讓我們帶出小朋友歡樂的嘉雲天空

會卡

讓在政大的我們,因為一樣的歌聲,回憶一樣的感動。

大一

洋溢著幸福的笑容,讓你們的感情乘載著夢想一起飛ㄅ

                Previous

                Next

                  <button type="button" class="close" data-dismiss="modal">×</button>

 Login

                  <form role="form" id="logInForm" class="form-horizontal">

                       Username
                      <input id="username" name="username" type="text" placeholder="username" class="form-control input-md" required="">

                       Password
                      <input id="password" name="password" type="password" placeholder="password" class="form-control input-md" required="">

                      <input type="checkbox" value="" checked>Remember me

                      <button id="signUpBtn" name="signUpBtn" class="btn btn-primary btn-block"> Login</button>
                  </form>

                  <button type="submit" class="btn btn-danger btn-default pull-left" data-dismiss="modal"> Cancel</button>

Not a member? Sign Up

Forgot Password?


text:
require './piece'
class Obstacle < Piece
  def initialize(game_window)
    super(game_window, 'images/obstacle.png')
    restart
  end

  def restart
    @x = rand(@game_window.width - @icon.width)
    @y = 0
    @speed = rand(3..10)
  end

  def update
    @y += @speed
    if @y > @game_window.height
      restart
    end
  end

  def hit_by?(obj)
    # can only be hit by an bullet
    if obj.is_a? Bullet and Intersector.intersects(self, obj)
      @destroyed = true
    end
  end
end


text:
from django.core.urlresolvers import reverse

from base.tests.test_utils import PermTestCase
from enquiry.tests.scenario import default_scenario_enquiry
from login.tests.scenario import default_scenario_login

class TestViewPerm(PermTestCase):

    def setUp(self):
        default_scenario_login()
        default_scenario_enquiry()

    def test_create(self):
        url = reverse('example.enquiry.create')
        self.assert_any(url)


text:
(function(global) {
    var Demo = global.Demo

    Demo.add({
        name: 'Segment Query'

        ,init: function() {
            /*cpVect*/ this.QUERY_START = cp.v(0, 0)

            /*cpSpace*/ var space = this.space
            space.setIterations(5);

            { // add a fat segment
                /*cpFloat*/ var mass = 1.0;
                /*cpFloat*/ var length = 100.0;
                /*cpVect*/ var a = cp.v(-length/2.0, 0.0), b = cp.v(length/2.0, 0.0);

                /*cpBody*/ var body = space.addBody(new cp.Body(mass, cp.momentForSegment(mass, a, b)));
                body.setPos(cp.v(0.0, 100.0));

                space.addShape(new cp.SegmentShape(body, a, b, 20.0));
            }

            { // add a static segment
                space.addShape(new cp.SegmentShape(space.staticBody, cp.v(0, 300), cp.v(300, 0), 0.0));
            }

            { // add a pentagon
                /*cpFloat*/ var mass = 1.0;
                /*int*/ var NUM_VERTS = 5;

                /*cpVect*/ var verts = new Array(NUM_VERTS);
                for(var i=0; i<NUM_VERTS; i++){
                    /*cpFloat*/ var angle = -2*Math.PI*i/(/*cpFloat*/ NUM_VERTS);
                    verts[i] = cp.v(30*Math.cos(angle), 30*Math.sin(angle));
                }

                /*cpBody*/ var body = space.addBody(new cp.Body(mass, cp.momentForPoly(mass, verts, cp.vzero)));
                body.setPos(cp.v(50.0, 30.0));

                space.addShape(new cp.PolyShape2(body, verts, cp.vzero, 10.0));
            }

            { // add a circle
                /*cpFloat*/ var mass = 1.0;
                /*cpFloat*/ var r = 20.0;

                /*cpBody*/ var body = space.addBody(new cp.Body(mass, cp.momentForCircle(mass, 0.0, r, cp.vzero)));
                body.setPos(cp.v(100.0, 100.0));

                space.addShape(new cp.CircleShape(body, r, cp.vzero));
            }

            return space;
        }

        ,update: function(/*double*/ dt) {
            var space = this.space
            space.step(dt);

            var QUERY_START = this.QUERY_START

            if(Demo.rightClick){
                QUERY_START.x = Demo.mouse.x;
                QUERY_START.y = Demo.mouse.y;
            }

            /*cpVect*/ var start = QUERY_START;
            /*cpVect*/ var end = Demo.mouse;
            Demo.renderer.drawSegment(start, end, new Demo.Color(0,255,0,1));

            this.messageString =(Demo.format("Query: Dist({0}) Point {1}, ", cp.v.dist(start, end).toFixed(2), cp.v.str(end)));

            /*cpSegmentQueryInfo*/ var segInfo;
            if(segInfo = space.segmentQueryFirst(start, end, cp.ALL_LAYERS, cp.NO_GROUP)){
                /*cpVect*/ var point = segInfo.hitPoint(start, end);

                // Draw blue over the occluded part of the query
                Demo.renderer.drawSegment(point, end, new Demo.Color(0,0,255,1));

                // Draw a little red surface normal
                Demo.renderer.drawSegment(point, cp.v.add(point, cp.v.mult(segInfo.n, 16)), new Demo.Color(255,0,0,1));

                // Draw a little red dot on the hit point.
                Demo.renderer.drawDot(3, point, new Demo.Color(255,0,0,1));

                this.messageString +=(Demo.format("Segment Query: Dist({0}) Normal {1}", segInfo.hitDist(start, end).toFixed(2), cp.v.str(segInfo.n)));
            } else {
                this.messageString +=("Segment Query (None)");
            }

//            /*cpNearestPointQueryInfo*/ var nearestInfo = {};
            var nearestInfo = space.nearestPointQueryNearest(Demo.mouse, 100.0, cp.ALL_LAYERS, cp.NO_GROUP);
            if(nearestInfo){
                // Draw a grey line to the closest shape.
                Demo.renderer.drawDot(3, Demo.mouse, new Demo.Color(127, 127, 127, 1.0));
                Demo.renderer.drawSegment(Demo.mouse, nearestInfo.p, 	new Demo.Color(127, 127, 127, 1.0));

                // Draw a red bounding box around the shape under the mouse.
                if(nearestInfo.d < 0) Demo.renderer.drawBB(nearestInfo.shape.getBB(), new Demo.Color(255,0,0,1));
            }
        }
    })
})(function() {
   return this;
}())


text:
namespace Oryol {
namespace _priv {

//------------------------------------------------------------------------------
d3d12TextureFactory::d3d12TextureFactory() :
isValid(false) {
    // empty
}

//------------------------------------------------------------------------------
d3d12TextureFactory::~d3d12TextureFactory() {
    o_assert_dbg(!this->isValid);
}

//------------------------------------------------------------------------------
void
d3d12TextureFactory::Setup(const gfxPointers& ptrs) {
    o_assert_dbg(!this->isValid);
    this->isValid = true;
    this->pointers = ptrs;
}

//------------------------------------------------------------------------------
void
d3d12TextureFactory::Discard() {
    o_assert_dbg(this->isValid);
    this->isValid = false;
    this->pointers = gfxPointers();
}

//------------------------------------------------------------------------------
bool
d3d12TextureFactory::IsValid() const {
    return this->isValid;
}

//------------------------------------------------------------------------------
ResourceState::Code
d3d12TextureFactory::SetupResource(texture& tex) {
    o_assert_dbg(this->isValid);
    o_assert_dbg(!tex.Setup.ShouldSetupFromPixelData());
    o_assert_dbg(!tex.Setup.ShouldSetupFromFile());

    if (tex.Setup.ShouldSetupAsRenderTarget()) {
        return this->createRenderTarget(tex);
    }
    else {
        return ResourceState::InvalidState;
    }
}

//------------------------------------------------------------------------------
ResourceState::Code
d3d12TextureFactory::SetupResource(texture& tex, const void* data, int32 size) {
    o_assert_dbg(this->isValid);
    o_assert_dbg(!tex.Setup.ShouldSetupAsRenderTarget());
    o_assert_dbg(!tex.Setup.ShouldSetupFromFile());

    if (tex.Setup.ShouldSetupFromPixelData()) {
        return this->createFromPixelData(tex, data, size);
    }
    return ResourceState::InvalidState;
}

//------------------------------------------------------------------------------
void
d3d12TextureFactory::DestroyResource(texture& tex) {
    o_assert_dbg(this->isValid);
    d3d12ResAllocator& resAllocator = this->pointers.renderer->resAllocator;
    d3d12DescAllocator& descAllocator = this->pointers.renderer->descAllocator;
    const uint64 frameIndex = this->pointers.renderer->frameIndex;

    if (tex.d3d12TextureRes) {
        resAllocator.ReleaseDeferred(frameIndex, tex.d3d12TextureRes);
    }
    if (tex.d3d12DepthBufferRes) {
        resAllocator.ReleaseDeferred(frameIndex, tex.d3d12DepthBufferRes);
    }
    if (InvalidIndex != tex.rtvDescriptorSlot) {
        const Id& rtvHeap = this->pointers.renderer->rtvHeap;
        descAllocator.ReleaseSlotDeferred(rtvHeap, frameIndex, tex.rtvDescriptorSlot);
    }
    if (InvalidIndex != tex.dsvDescriptorSlot) {
        const Id& dsvHeap = this->pointers.renderer->dsvHeap;
        descAllocator.ReleaseSlotDeferred(dsvHeap, frameIndex, tex.dsvDescriptorSlot);
    }
    tex.Clear();
}

//------------------------------------------------------------------------------
ResourceState::Code
d3d12TextureFactory::createRenderTarget(texture& tex) {
    o_assert_dbg(nullptr == tex.d3d12TextureRes);
    o_assert_dbg(nullptr == tex.d3d12DepthBufferRes);
    o_assert_dbg(InvalidIndex == tex.rtvDescriptorSlot);
    o_assert_dbg(InvalidIndex == tex.dsvDescriptorSlot);

    const TextureSetup& setup = tex.Setup;
    o_assert_dbg(setup.ShouldSetupAsRenderTarget());
    o_assert_dbg(setup.NumMipMaps == 1);
    o_assert_dbg(setup.Type == TextureType::Texture2D);
    o_assert_dbg(PixelFormat::IsValidRenderTargetColorFormat(setup.ColorFormat));

    d3d12ResAllocator& resAllocator = this->pointers.renderer->resAllocator;
    d3d12DescAllocator& descAllocator = this->pointers.renderer->descAllocator;
    ID3D12Device* d3d12Device = this->pointers.renderer->d3d12Device;

    // get size of new render target
    int32 width, height;
    texture* sharedDepthProvider = nullptr;
    if (setup.IsRelSizeRenderTarget()) {
        const DisplayAttrs& dispAttrs = this->pointers.displayMgr->GetDisplayAttrs();
        width = int32(dispAttrs.FramebufferWidth * setup.RelWidth);
        height = int32(dispAttrs.FramebufferHeight * setup.RelHeight);
    }
    else if (setup.HasSharedDepth()) {
        sharedDepthProvider = this->pointers.texturePool->Lookup(setup.DepthRenderTarget);
        o_assert_dbg(nullptr != sharedDepthProvider);
        width = sharedDepthProvider->textureAttrs.Width;
        height = sharedDepthProvider->textureAttrs.Height;
    }
    else {
        width = setup.Width;
        height = setup.Height;
    }
    o_assert_dbg((width > 0) && (height > 0));

    // create the color buffer and render-target-view
    tex.d3d12TextureRes = resAllocator.AllocRenderTarget(d3d12Device, width, height, setup.ColorFormat, setup.ClearHint, 1);
    tex.d3d12TextureState = D3D12_RESOURCE_STATE_RENDER_TARGET;
    const Id& rtvHeap = this->pointers.renderer->rtvHeap;
    tex.rtvDescriptorSlot = descAllocator.AllocSlot(rtvHeap);
    D3D12_CPU_DESCRIPTOR_HANDLE rtvCPUHandle;
    descAllocator.CPUHandle(rtvCPUHandle, rtvHeap, tex.rtvDescriptorSlot);
    d3d12Device->CreateRenderTargetView(tex.d3d12TextureRes, nullptr, rtvCPUHandle);

    // create optional depth-buffer
    if (setup.HasDepth()) {
        if (setup.HasSharedDepth()) {
            o_assert_dbg(sharedDepthProvider->d3d12DepthBufferRes);
            tex.d3d12DepthBufferRes = sharedDepthProvider->d3d12DepthBufferRes;
            tex.d3d12DepthBufferRes->AddRef();
        }
        else {
            tex.d3d12DepthBufferRes = resAllocator.AllocRenderTarget(d3d12Device, width, height, setup.DepthFormat, setup.ClearHint, 1);
        }
        tex.d3d12DepthBufferState = D3D12_RESOURCE_STATE_DEPTH_WRITE;
        const Id& dsvHeap = this->pointers.renderer->dsvHeap;
        tex.dsvDescriptorSlot = descAllocator.AllocSlot(dsvHeap);
        D3D12_CPU_DESCRIPTOR_HANDLE dsvCPUHandle;
        descAllocator.CPUHandle(dsvCPUHandle, dsvHeap, tex.dsvDescriptorSlot);
        d3d12Device->CreateDepthStencilView(tex.d3d12DepthBufferRes, nullptr, dsvCPUHandle);
    }

    // setup texture attrs and set on texture
    TextureAttrs attrs;
    attrs.Locator = setup.Locator;
    attrs.Type = TextureType::Texture2D;
    attrs.ColorFormat = setup.ColorFormat;
    attrs.DepthFormat = setup.DepthFormat;
    attrs.TextureUsage = Usage::Immutable;
    attrs.Width = width;
    attrs.Height = height;
    attrs.NumMipMaps = 1;
    attrs.IsRenderTarget = true;
    attrs.HasDepthBuffer = setup.HasDepth();
    attrs.HasSharedDepthBuffer = setup.HasSharedDepth();
    tex.textureAttrs = attrs;

    return ResourceState::Valid;
}

//------------------------------------------------------------------------------
ResourceState::Code
d3d12TextureFactory::createFromPixelData(texture& tex, const void* data, int32 size) {
    o_assert_dbg(nullptr == tex.d3d12TextureRes);
    o_assert_dbg(nullptr != data);
    o_assert_dbg(size > 0);

    const TextureSetup& setup = tex.Setup;
    o_assert_dbg(setup.NumMipMaps > 0);

    if (setup.Type == TextureType::Texture3D) {
        o_warn("d3d12TextureFactory: 3d textures not yet implemented!\n");
        return ResourceState::Failed;
    }
    if (DXGI_FORMAT_UNKNOWN == d3d12Types::asTextureFormat(setup.ColorFormat)) {
        o_warn("d3d12TextureFactory: unknown texture format!\n");
        return ResourceState::Failed;
    }

    // create d3d12 texture resource
    d3d12ResAllocator& resAllocator = this->pointers.renderer->resAllocator;
    ID3D12Device* d3d12Device = this->pointers.renderer->d3d12Device;
    ID3D12GraphicsCommandList* cmdList = this->pointers.renderer->curCommandList();
    const uint64 frameIndex = this->pointers.renderer->frameIndex;
    tex.d3d12TextureRes = resAllocator.AllocTexture(d3d12Device, cmdList, frameIndex, setup, data, size);
    tex.d3d12TextureState = D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE;

    // setup texture attributes
    TextureAttrs attrs;
    attrs.Locator = setup.Locator;
    attrs.Type = setup.Type;
    attrs.ColorFormat = setup.ColorFormat;
    attrs.TextureUsage = Usage::Immutable;
    attrs.Width = setup.Width;
    attrs.Height = setup.Height;
    attrs.NumMipMaps = setup.NumMipMaps;
    tex.textureAttrs = attrs;

    return ResourceState::Valid;
}

} // namespace _priv
} // namespace Oryol


text:
TARGET_DIR := ../../../target/classes
TARGET := $(TARGET_DIR)/librdrandjutil.so

WORKING_DIR := $(TARGET_DIR)/../jni

JAVA_BUILD_DIR := $(TARGET_DIR)

JAVA_HOME ?= /usr/java/default

INCLUDES := -I $(JAVA_HOME)/include -I $(JAVA_HOME)/include/linux -I $(JAVA_HOME)/include/darwin -I $(WORKING_DIR)

# classpath for javah
ifdef CLASSPATH
JAVAH_CLASSPATH = $(JAVA_BUILD_DIR):$(CLASSPATH)
else
JAVAH_CLASSPATH = $(JAVA_BUILD_DIR)
endif

all: $(TARGET)

$(TARGET): net_lizalab_util_RdRandUtil.c $(WORKING_DIR)/config.h $(WORKING_DIR)/rdrand.h $(WORKING_DIR)/net_lizalab_util_RdRandUtil.h
	@echo "[INFO] Compiling JNI implementation and linking shared library .."
	gcc -fPIC -g -O2 -c net_lizalab_util_RdRandUtil.c $(INCLUDES)
	gcc net_lizalab_util_RdRandUtil.o -shared -o $(TARGET) -L$(WORKING_DIR) -lrdrand

$(WORKING_DIR)/net_lizalab_util_RdRandUtil.h: $(TARGET_DIR)/net/lizalab/util/RdRandUtil.class
	@echo "[INFO] Generating JNI header .."
	javah -force -classpath $(JAVAH_CLASSPATH) -d $(WORKING_DIR) net.lizalab.util.RdRandUtil


text: To get started, [sign the Contributor License Agreement](https://www.clahub.com/agreements/aalmiray/naum)


text:
<?php
/**
 * Module Name: Notifications
 * Module Description: Receive instant notifications of site comments and likes.
 * Sort Order: 13
 * First Introduced: 1.9
 * Requires Connection: Yes
 * Auto Activate: Yes
 * Module Tags: Other
 * Feature: General
 * Additional Search Queries: notification, notifications, toolbar, adminbar, push, comments
 */

if ( !defined( 'JETPACK_NOTES__CACHE_BUSTER' ) ) define( 'JETPACK_NOTES__CACHE_BUSTER', JETPACK__VERSION . '-' . gmdate( 'oW' ) );

class Jetpack_Notifications {
	public $jetpack = false;

	/**
	 * Singleton
	 * @static
	 */
	public static function init() {
		static $instance = array();

		if ( !$instance ) {
			$instance[0] = new Jetpack_Notifications;
		}

		return $instance[0];
	}

	function __construct() {
		$this->jetpack = Jetpack::init();

		add_action( 'init', array( &$this, 'action_init' ) );
	}

	function wpcom_static_url($file) {
		$i = hexdec( substr( md5( $file ), -1 ) ) % 2;
		$url = 'http://s' . $i . '.wp.com' . $file;
		return set_url_scheme( $url );
	}

	// return the major version of Internet Explorer the viewer is using or false if it's not IE
	public static function get_internet_explorer_version() {
		static $version;
		if ( isset( $version ) ) {
			return $version;
		}

		$user_agent = isset( $_SERVER['HTTP_USER_AGENT']  ) ? $_SERVER['HTTP_USER_AGENT'] : '';

		preg_match( '/MSIE (\d+)/', $user_agent, $matches );
		$version = empty( $matches[1] ) ? null : $matches[1];
		if ( empty( $version ) || !$version ) {
			return false;
		}
		return $version;
	}

	public static function current_browser_is_supported() {
		static $supported;

		if ( isset( $supported ) ) {
			return $supported;
		}

		$ie_version = self::get_internet_explorer_version();
		if ( false === $ie_version ) {
			return $supported = true;
		}

		if ( $ie_version < 8 ) {
			return $supported = false;
		}

		return $supported = true;
	}

	function action_init() {
		//syncing must wait until after init so
		//post types that support comments
		$filt_post_types = array();
		$all_post_types = get_post_types();
		foreach ( $all_post_types as $post_type ) {
			if ( post_type_supports( $post_type, 'comments' ) ) {
				$filt_post_types[] = $post_type;
			}
		}

		if ( defined( 'DOING_AJAX' ) && DOING_AJAX )
			return;

		if ( !has_filter( 'show_admin_bar', '__return_true' ) && !is_user_logged_in() )
			return;

		if ( !self::current_browser_is_supported() )
			return;

		add_action( 'admin_bar_menu', array( &$this, 'admin_bar_menu'), 120 );
		add_action( 'wp_head', array( &$this, 'styles_and_scripts'), 120 );
		add_action( 'admin_head', array( &$this, 'styles_and_scripts') );
	}

	function styles_and_scripts() {
		if ( !is_rtl() ) {
			wp_enqueue_style( 'wpcom-notes-admin-bar', $this->wpcom_static_url( '/wp-content/mu-plugins/notes/admin-bar-v2.css' ), array(), JETPACK_NOTES__CACHE_BUSTER );
		} else {
			wp_enqueue_style( 'wpcom-notes-admin-bar', $this->wpcom_static_url( '/wp-content/mu-plugins/notes/rtl/admin-bar-v2-rtl.css' ), array(), JETPACK_NOTES__CACHE_BUSTER );
		}
		wp_enqueue_style( 'noticons', $this->wpcom_static_url( '/i/noticons/noticons.css' ), array(), JETPACK_NOTES__CACHE_BUSTER );

		$this->print_js();

		// attempt to use core or plugin libraries if registered
		if ( !wp_script_is( 'mustache', 'registered' ) ) {
			wp_register_script( 'mustache', $this->wpcom_static_url( '/wp-content/js/mustache.js' ), null, JETPACK_NOTES__CACHE_BUSTER );
		}
		if ( !wp_script_is( 'underscore', 'registered' ) ) {
			wp_register_script( 'underscore', $this->wpcom_static_url( '/wp-includes/js/underscore.min.js' ), null, JETPACK_NOTES__CACHE_BUSTER );
		}
		if ( !wp_script_is( 'backbone', 'registered' ) ) {
			wp_register_script( 'backbone', $this->wpcom_static_url( '/wp-includes/js/backbone.min.js' ), array( 'underscore' ), JETPACK_NOTES__CACHE_BUSTER );
		}

		wp_register_script( 'wpcom-notes-common', $this->wpcom_static_url( '/wp-content/mu-plugins/notes/notes-common-v2.js' ), array( 'jquery', 'underscore', 'backbone', 'mustache' ), JETPACK_NOTES__CACHE_BUSTER );
		wp_enqueue_script( 'wpcom-notes-admin-bar', $this->wpcom_static_url( '/wp-content/mu-plugins/notes/admin-bar-v2.js' ), array( 'wpcom-notes-common' ), JETPACK_NOTES__CACHE_BUSTER );
	}

	function admin_bar_menu() {
		global $wp_admin_bar, $current_blog;

		if ( !is_object( $wp_admin_bar ) )
			return;

		$wpcom_locale = get_locale();

		if ( !class_exists( 'GP_Locales' ) ) {
			if ( defined( 'JETPACK__GLOTPRESS_LOCALES_PATH' ) && file_exists( JETPACK__GLOTPRESS_LOCALES_PATH ) ) {
				require JETPACK__GLOTPRESS_LOCALES_PATH;
			}
		}

		if ( class_exists( 'GP_Locales' ) ) {
			$wpcom_locale_object = GP_Locales::by_field( 'wp_locale', get_locale() );
			if ( $wpcom_locale_object instanceof GP_Locale ) {
				$wpcom_locale = $wpcom_locale_object->slug;
			}
		}

		$classes = 'wpnt-loading wpn-read';
		$wp_admin_bar->add_menu( array(
			'id'     => 'notes',
			'title'  => '

					',
			'meta'   => array(
				'html'  => '

' . __( 'Notifications', 'jetpack' ) . '

',
				'class' => 'menupop',
			),
			'parent' => 'top-secondary',
		) );
	}

	function print_js() {
		$link_accounts_url = is_user_logged_in() && !Jetpack::is_user_connected() ? Jetpack::admin_url() : false;
?>

<?php
	}

}

Jetpack_Notifications::init();


text:
package gherkin

import (
	"testing"

	"github.com/gauntlt/gauntlt-go/Godeps/_workspace/src/github.com/stretchr/testify/assert"
)

func TestParseSingleScenario(t *testing.T) {
	s := `
# a line comment
@tag1 @tag2
Attack: Basic attack

  # a comment embedded in the description
  A multiline description of the Attack
  that can contain any text like
  Rules:
  - a
  - b

  @tag3 @tag4
  Scenario: The title of the scenario
    Given an attack tool is installed
    When the tool is run
    And some other condition
    Then there should not be vulnerabilities

# End of file comment with some empty lines below

`
	attacks, err := Parse(s)

	assert.NoError(t, err)
	assert.Equal(t, 1, len(attacks))
	assert.Equal(t, "Basic attack", attacks[0].Title)
	assert.Equal(t, "@tag1", attacks[0].Tags[0])
	assert.Equal(t, "@tag2", attacks[0].Tags[1])
	assert.Equal(t, 1, len(attacks[0].Scenarios))
	assert.Equal(t, "A multiline description of the Attack\nthat can contain any text like\nRules:\n- a\n- b", attacks[0].Description)
	assert.Equal(t, "The title of the scenario", attacks[0].Scenarios[0].Title)
	assert.Equal(t, 4, len(attacks[0].Scenarios[0].Steps))
	assert.Equal(t, "@tag3", attacks[0].Scenarios[0].Tags[0])
	assert.Equal(t, "@tag4", attacks[0].Scenarios[0].Tags[1])
	assert.Equal(t, StepType("Given"), attacks[0].Scenarios[0].Steps[0].Type)
	assert.Equal(t, "an attack tool is installed", attacks[0].Scenarios[0].Steps[0].Text)
	assert.Equal(t, StepType("When"), attacks[0].Scenarios[0].Steps[1].Type)
	assert.Equal(t, "the tool is run", attacks[0].Scenarios[0].Steps[1].Text)
	assert.Equal(t, StepType("And"), attacks[0].Scenarios[0].Steps[2].Type)
	assert.Equal(t, "some other condition", attacks[0].Scenarios[0].Steps[2].Text)
	assert.Equal(t, StepType("Then"), attacks[0].Scenarios[0].Steps[3].Type)
	assert.Equal(t, "there should not be vulnerabilities", attacks[0].Scenarios[0].Steps[3].Text)
}

func TestMultipleScenarios(t *testing.T) {
	s := `
Attack: Parsing multiple scenarios
  Scenario: Scenario name here
    Given some precondition
    Then something happens

  Scenario: The second scenario
    Given a condition
    Then something happens
`
	attacks, err := Parse(s)
	assert.NoError(t, err)
	assert.Equal(t, 2, len(attacks[0].Scenarios))
	assert.Equal(t, 2, len(attacks[0].Scenarios[0].Steps))
	assert.Equal(t, 2, len(attacks[0].Scenarios[1].Steps))
}

func TestBackgroundAndScenarios(t *testing.T) {
	s := `
Attack: Parsing multiple scenarios
  @tag_on_background
  Background:
    Given there is some background

	Scenario: Scenario name here
    Given some precondition
    And then something else
    Then something happens

  Scenario: Another scenario
    Given another precondition
    Then something happens
`
	// Scenario: The scenario is a thing
	//   When there is an action
	//   Then something happens

	// Scenario: Another thing
	//   When there is another action
	//   Then something else happens
	attacks, err := Parse(s)
	assert.NoError(t, err)
	// assert.Equal(t, "@tag_on_background", attacks[0].Background.Tags[0])
	// assert.Equal(t, "there is some background", attacks[0].Background.Steps[0].Text)

	if len(attacks[0].Scenarios) != 2 {
		t.Error("Got length of", len(attacks[0].Scenarios))
	}
	assert.Equal(t, 2, len(attacks[0].Scenarios))
}

// func TestMultipleFeatures(t *testing.T) {
// 	s := `
// Feature: Feature 1
//   Scenario: Scenario name here
//     Given some precondition
//     Then something happens

// Feature: Feature 2
//   Scenario: Another scenario
//     Given another precondition
//     Then something happens
// `
// 	f, err := Parse(s)
// 	assert.NoError(t, err)
// 	assert.Equal(t, 2, len(f))
// 	assert.Equal(t, "Feature 1", f[0].Title)
// 	assert.Equal(t, "Feature 2", f[1].Title)
// 	assert.Equal(t, 1, len(f[0].Scenarios))
// 	assert.Equal(t, 1, len(f[1].Scenarios))

// }

// func TestTagParsing(t *testing.T) {
// 	f, err := Parse("@tag1   @tag2@tag3\nFeature: Tag parsing")
// 	assert.NoError(t, err)
// 	assert.Equal(t, 2, len(f[0].Tags))
// 	assert.Equal(t, "@tag1", f[0].Tags[0])
// 	assert.Equal(t, "@tag2@tag3", f[0].Tags[1])
// }

// func TestBacktrackingCommentsAtEnd(t *testing.T) {
// 	s := `
// Feature: Comments at end
//   Scenario: Scenario name here
//     Given some precondition
//     Then something happens
//   # comments here
// `
// 	_, err := Parse(s)

// 	assert.NoError(t, err)
// }

// func TestBacktrackingCommentsDontAffectIndent(t *testing.T) {
// 	s := `
// Feature: Comments at end
//   Scenario: Scenario name here
//     Given some precondition
//     Then something happens
// # comments here
//   Scenario: Another scenario
//     Given a step
// `
// 	f, err := Parse(s)
// 	assert.NoError(t, err)
// 	assert.Equal(t, 2, len(f[0].Scenarios))
// }

// func TestScenarioOutlines(t *testing.T) {
// 	s := `
// Feature: Scenario outlines
//   Scenario Outline: Scenario 1
//     Given some value <foo>
//     Then some result <bar>

//     Examples:
//     | foo | bar |
//     | 1   | 2   |
//     | 3   | 4   |

//   Scenario: Scenario 2
//     Given some other scenario
// `
// 	f, err := Parse(s)
// 	assert.NoError(t, err)
// 	assert.Equal(t, 2, len(f[0].Scenarios))
// 	assert.Equal(t, StringData("| foo | bar |\n| 1   | 2   |\n| 3   | 4   |"), f[0].Scenarios[0].Examples)
// }

// func TestStepArguments(t *testing.T) {
// 	s := `
// Feature: Step arguments
//   Scenario: Scenario 1
//     Given some data
//                           | 1   | 2   |
//                           | 3   | 4   |
//     And some docstring
//     """
//      hello
//      world
//     """
//     And some table
//     | 1 | 2 |
//     Then other text

//   Scenario: Scenario 2
//     Given some other scenario
// `
// 	f, err := Parse(s)
// 	assert.NoError(t, err)
// 	assert.Equal(t, 2, len(f[0].Scenarios))
// 	assert.Equal(t, StringData("| 1   | 2   |\n| 3   | 4   |"), f[0].Scenarios[0].Steps[0].Argument)
// 	assert.Equal(t, StringData(" hello\n world"), f[0].Scenarios[0].Steps[1].Argument)
// 	assert.Equal(t, StringData("| 1 | 2 |"), f[0].Scenarios[0].Steps[2].Argument)
// 	assert.Equal(t, "other text", f[0].Scenarios[0].Steps[3].Text)
// }

// func TestFailureNoFeature(t *testing.T) {
// 	_, err := Parse("")
// 	assert.EqualError(t, err, `parse error (<unknown>.feature:1): no features parsed.`)
// }

// func TestTagWithoutFeature(t *testing.T) {
// 	_, err := Parse("@tag")
// 	assert.EqualError(t, err, `parse error (<unknown>.feature:1): tags not applied to feature.`)
// }

// func TestFailureExpectingFeature(t *testing.T) {
// 	_, err := Parse("@tag\n@tag")
// 	assert.EqualError(t, err, `parse error (<unknown>.feature:2): expected "Feature:", found "@tag".`)
// }

// func TestFailureInvalidTag(t *testing.T) {
// 	_, err := Parse("@tag tag")
// 	assert.EqualError(t, err, `parse error (<unknown>.feature:1): invalid tag "tag".`)
// }

// func TestFailureDescriptionAfterTags(t *testing.T) {
// 	s := `
// Feature: Descriptions after tags
//   @tag1
//   Descriptions should not be allowed after tags

//   Scenario: Scenario name here
//     Given some precondition
//     Then something happens
// `
// 	_, err := Parse(s)
// 	assert.EqualError(t, err, `parse error (<unknown>.feature:4): illegal description text after tags.`)
// }

// func TestFailureDescriptionAfterScenario(t *testing.T) {
// 	s := `
// Feature: Descriptions after scenario
//   Scenario: Scenario name here
//     Given some precondition
//     Then something happens

//   Descriptions should not be allowed after scenario

//   Scenario: Another scenario
//     Given some precondition
//     Then something happens
// `
// 	_, err := Parse(s)
// 	assert.EqualError(t, err, `parse error (<unknown>.feature:7): illegal description text after scenario.`)
// }

// func TestFailureMultipleBackgrounds(t *testing.T) {
// 	s := `
// Feature: Multiple backgrounds
//   Background:
//     Given one

//   Background:
//     Given two
// `
// 	_, err := Parse(s)
// 	assert.EqualError(t, err, `parse error (<unknown>.feature:6): multiple backgrounds not allowed.`)
// }

// func TestFailureBackgroundAfterScenario(t *testing.T) {
// 	s := `
// Feature: Background after scenario
//   Scenario: Scenario name here
//     Given some precondition
//     Then something happens

//   Background:
//     Given it's after a scenario
// `
// 	_, err := Parse(s)
// 	assert.EqualError(t, err, `parse error (<unknown>.feature:7): illegal background after scenario.`)
// }

// func TestFailureInvalidStep(t *testing.T) {
// 	s := `
// Feature: Invalid steps
//   Scenario: Scenario name here
//     Invalid step
// `
// 	_, err := Parse(s)
// 	assert.EqualError(t, err, `parse error (<unknown>.feature:4): illegal step prefix "Invalid".`)
// }

// func TestFailureNoStepText(t *testing.T) {
// 	s := `
// Feature: No step text
//   Scenario: Scenario name here
//     Given
// `
// 	_, err := Parse(s)
// 	assert.EqualError(t, err, `parse error (<unknown>.feature:4): expected step text after "Given".`)
// }

// func TestFailureInvalidTagOnScenario(t *testing.T) {
// 	s := `
// Feature: Invalid tag on scenario
//   @invalid tags
//   Scenario:
//     Given a scenario
// `
// 	_, err := Parse(s)
// 	assert.EqualError(t, err, `parse error (<unknown>.feature:3): invalid tag "tags".`)

// }

// func TestFailureInvalidBackground(t *testing.T) {
// 	s := `
// Feature: Invalid background
//   Background:
//     Invalid step
//   Scenario: A scenario
//     Given a scenario
// `
// 	_, err := Parse(s)
// 	assert.EqualError(t, err, `parse error (<unknown>.feature:4): illegal step prefix "Invalid".`)
// }


text:
// Copyright 2014 Samsung Electronics. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef NAVIGATION_POLICY_HANDLER_EFL_H_
#define NAVIGATION_POLICY_HANDLER_EFL_H_

#include "navigation_policy_params.h"

namespace content {
class RenderViewHost;
}

namespace IPC {
class Message;
}

class NavigationPolicyHandlerEfl {
 public:
  enum Decision {
    Undecied = 0,
    Handled,
    Unhandled
  };

  NavigationPolicyHandlerEfl(content::RenderViewHost* rvh, const NavigationPolicyParams& params);
  virtual ~NavigationPolicyHandlerEfl();
  void DownloadNavigation();
  Decision GetDecision() const { return decision_; }
  bool SetDecision(Decision);

 private:
  content::RenderViewHost* rvh_;
  Decision decision_;
  NavigationPolicyParams params_;
};

#endif /* NAVIGATION_POLICY_HANDLER_EFL_H_ */


text:
const chai = require('chai')
const expect = chai.expect

const sum = require('subject')

describe('my function', function () {
    it('should return sum of positive numbers', function () {
        const total = sum(3, 5)

        expect(total).to.equal(8)
    })

    it('should return sum of negative numbers', function () {
        const total = sum(-3, -5)

        expect(total).to.equal(-8)
    })

    it('should accept 0 as neutral operand', function () {
        const total = sum(0, 3)

        expect(total).to.equal(3)
    })
})


text:
/* global socket */
console.log('Loaded (editor.js v2)');

var data = [];

var compileData = function(){
  $('#data').empty();
  data.forEach(function(bit,i){
    switch(bit.type){
      case types.multipleChoice:
        var addOption = $('<li>')
          .append($('<input>')
            .val('Click to add option')
            .attr('class','italic multiplechoice input')
            .click());
        $('#data').append($('<div>')
          .append($('<input>')
            .val(bit.help == 0 ? "Click to add text" : bit.help)
            .attr('class','title input'))
          .append($('<input>')
            .val(bit.help == 0 ? "Click to add text" : bit.help)
            .attr('class','helpline input'))
          .append($('<ul>')
            .append(addOption))
        );

        break;
      default:
        console.log("err_type_not_found");
        $('#data').append($('<h1>').text('Error! Type not found'));
    }
  });
};


text:
module Gesmew
  module Api
    module Responders
      module RablTemplate
        def to_format
          if template
            render template, :status => options[:status] || 200
          else
            super
          end
        rescue ActionView::MissingTemplate => e
          api_behavior
        end

        def template
          options[:default_template]
        end

        def api_behavior
          if controller.params[:action] == "destroy"
            # Render a blank template
            super
          else
            # Do nothing and fallback to the default template
          end
        end
      end
    end
  end
end


text:
package com.vini.mysite.core.ec;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
@Entity
@Table(name="Discussion")
public class Discussion extends BaseEntity {

	private static final long serialVersionUID = 1L;

	@Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name="id")
	private Long id;

	@Column(name="title", nullable=false)
	private String title;

	@Column(name="category")
	private String category;

	@Column(name="description")
	private String description;

	@Column(name="tags", nullable=false)
	private String tags;

	@OneToMany(fetch = FetchType.EAGER, cascade = CascadeType.ALL, mappedBy="question")
	private List<Reply> replies;

	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}

	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	public String getDescription() {
		return description;
	}
	public String getTags() {
		return tags;
	}
	public void setTags(String pageTags) {
		this.tags = pageTags;
	}
	public void setReplies(List<Reply> replies) {
		this.replies = replies;
	}
	public List<Reply> getReplies() {
		return replies;
	}
	public void setCategory(String category) {
		this.category = category;
	}
	public String getCategory() {
		return category;
	}

	@Override
	public String toString() {
		return "Discussion [category=" + category + ", description="
				+ description + ", id=" + id + ", replies=" + replies
				+ ", tags=" + tags + ", title=" + title
				+ ", "+ super.toString() + "]";
	}

}


text:
<?php
namespace pdt256\article\RepositoryHydration\Repository;

use pdt256\article\common\Repository\AbstractEntityRepository;
use pdt256\article\RepositoryHydration\DTO\CompanyStatsDTO;
use pdt256\article\RepositoryHydration\Entity\Employee;

final class ManualHydratorCompanyRepository extends AbstractEntityRepository implements CompanyRepositoryInterface
{
    public function getCompanyStats(int $companyId): CompanyStatsDTO
    {
        $companyStatsArray = $this->getEntityManager()
            ->createQueryBuilder()
            ->addSelect('SUM(IF(Employee.isActive=1,1,0)) AS totalActiveEmployees')
            ->addSelect('SUM(IF(Employee.isActive=0,1,0)) AS totalInactiveEmployees')
            ->from(Employee::class, 'Employee')
            ->where('Employee.company = :companyId')
            ->setParameter('companyId', $companyId)
            ->setMaxResults(1)
            ->getQuery()
            ->getArrayResult();

        return new CompanyStatsDTO(
            (int) $companyStatsArray[0]['totalActiveEmployees'],
            (int) $companyStatsArray[0]['totalInactiveEmployees']
        );
    }
}