text:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
	"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
	"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping
	package="org.codehaus.mojo.dashboard.report.plugin.beans">
	<!-- org.codehaus.mojo.dashboard.report.plugin.beans.DashBoardMultiReportBean root -->
	<class name="DashBoardMavenProject" table="MavenProject">
		<id name="id" type="long" column="MAVENPROJECT_ID">
			<generator class="native" />
		</id>
		<property name="groupId" column="groupId" type="string" />
		<property name="artifactId" column="artifactId" type="string" />
		<property name="version" column="version" type="string" />
		<property name="projectName" column="projectName" type="string" />
		<set name="modules" cascade="save-update">
			<key column="PARENT_ID" />
			<one-to-many class="DashBoardMavenProject" />
		</set>
		<set name="reports" inverse="true" cascade="save-update">
			<key column="MAVENPROJECT_ID" not-null="true" />
			<one-to-many class="AbstractReportBean" />
		</set>
		<query name="getDashBoardMavenProjectID">
			<![CDATA[
			select m.id from DashBoardMavenProject m where m.artifactId = :artifactid and m.groupId = :groupid and m.version = :version
			]]>
		</query>
		<query name="getDashBoardMavenProjectIDWithoutVersion">
			<![CDATA[
			select max(m.id) from DashBoardMavenProject m where m.artifactId = :artifactid and m.groupId = :groupid
			]]>
		</query>
	</class>
	<class name="AbstractReportBean" abstract="true">
		<id name="id" type="long" column="report_id">
			<generator class="hilo" />
		</id>
		<many-to-one name="mavenProject" column="MAVENPROJECT_ID"
			class="DashBoardMavenProject" />
		<property name="dateGeneration" column="dateGeneration"
			type="timestamp" />
		<property name="branchName" column="branchName"
            type="string" />
	</class>
	<!-- org.codehaus.mojo.dashboard.report.plugin.beans.CheckstyleReportBean root -->
	<!-- table="CheckstyleReportBean"  -->
	<union-subclass name="CheckstyleReportBean"
		table="CheckstyleReportBean" extends="AbstractReportBean">
		<property name="nbClasses" column="nbClasses" type="int" />
		<property name="nbInfos" column="nbInfos" type="int" />
		<property name="nbErrors" column="nbErrors" type="int" />
		<property name="nbWarnings" column="nbWarnings" type="int" />
		<property name="nbTotal" column="nbTotal" type="int" />
		<query name="getCheckstyleByDashBoardMavenProjectID">
			<![CDATA[
		select c from CheckstyleReportBean c,DashBoardMavenProject m where c.mavenProject = m and m.id = :id
		]]>
		</query>
		<query name="getCheckstyleByPeriodByVersion">
			<![CDATA[
		select c from CheckstyleReportBean c,DashBoardMavenProject m where c.mavenProject = m and m.id = :id and c.dateGeneration >= :startdate and c.dateGeneration <= :enddate and c.branchName is null
		]]>
		</query>
		<query name="getCheckstyleByPeriodByVersionByBranchName">
            <![CDATA[
        select c from CheckstyleReportBean c,DashBoardMavenProject m where c.mavenProject = m and m.id = :id and c.dateGeneration >= :startdate and c.dateGeneration <= :enddate and c.branchName = :branchName
        ]]>
        </query>
        <query name="getCheckstyleByPeriod">
            <![CDATA[
        select c from CheckstyleReportBean c, DashBoardMavenProject m, DashBoardMavenProject m2 where c.mavenProject = m and m2.id = :id and m2.groupId = m.groupId and m2.artifactId = m.artifactId and c.dateGeneration >= :startdate and c.dateGeneration <= :enddate and c.branchName is null
        ]]>
        </query>
		<query name="getCheckstyleByPeriodByBranchName">
			<![CDATA[
        select c from CheckstyleReportBean c, DashBoardMavenProject m, DashBoardMavenProject m2 where c.mavenProject = m and m2.id = :id and m2.groupId = m.groupId and m2.artifactId = m.artifactId and c.dateGeneration >= :startdate and c.dateGeneration <= :enddate and c.branchName = :branchName
        ]]>
		</query>
		<query name="getMarkerVersionByDate">
			<![CDATA[
        select c.mavenProject.version, min(c.dateGeneration) from CheckstyleReportBean c
        where c.mavenProject.id in (
		   select
		    m.id
		   from
		    DashBoardMavenProject m,
		    DashBoardMavenProject m2
		   where
		    m2.id = :id
		    and m2.groupId = m.groupId
		    and m2.artifactId = m.artifactId
		  )
		  and c.branchName is null
		  group by c.mavenProject.version
		  having min(c.dateGeneration) between :startdate and :enddate
        ]]>
		</query>
		<query name="getMarkerVersionByDateByBranchName">
            <![CDATA[
        select c.mavenProject.version, min(c.dateGeneration) from CheckstyleReportBean c
        where c.mavenProject.id in (
           select
            m.id
           from
            DashBoardMavenProject m,
            DashBoardMavenProject m2
           where
            m2.id = :id
            and m2.groupId = m.groupId
            and m2.artifactId = m.artifactId
          )
          and c.branchName = :branchName
          group by c.mavenProject.version
          having min(c.dateGeneration) between :startdate and :enddate
        ]]>
        </query>
	</union-subclass>
	<!-- org.codehaus.mojo.dashboard.report.plugin.beans.CoberturaReportBean root -->
	<!-- table="CoberturaReportBean"  -->
	<union-subclass name="CoberturaReportBean"
		table="CoberturaReportBean" extends="AbstractReportBean">
		<property name="nbClasses" column="nbClasses" type="int" />
		<property name="lineCoverRate" column="lineCoverRate"
			type="double" />
		<property name="numberOfValidLines" column="numberOfValidLines"
			type="int" />
		<property name="numberOfCoveredLines"
			column="numberOfCoveredLines" type="int" />
		<property name="branchCoverRate" column="branchCoverRate"
			type="double" />
		<property name="numberOfValidBranches"
			column="numberOfValidBranches" type="int" />
		<property name="numberOfCoveredBranches"
			column="numberOfCoveredBranches" type="int" />
		<query name="getCoberturaByDashBoardMavenProjectID">
			<![CDATA[
		select c from CoberturaReportBean c,DashBoardMavenProject m where c.mavenProject = m and m.id = :id
		]]>
		</query>
		<query name="getCoberturaByPeriodByVersion">
			<![CDATA[
		select c from CoberturaReportBean c,DashBoardMavenProject m where c.mavenProject = m and m.id = :id and c.dateGeneration >= :startdate and c.dateGeneration <= :enddate and c.branchName is null
		]]>
		</query>
		<query name="getCoberturaByPeriodByVersionByBranchName">
            <![CDATA[
        select c from CoberturaReportBean c,DashBoardMavenProject m where c.mavenProject = m and m.id = :id and c.dateGeneration >= :startdate and c.dateGeneration <= :enddate and c.branchName = :branchName
        ]]>
        </query>
		<query name="getCoberturaByPeriod">
			<![CDATA[
        select c from CoberturaReportBean c, DashBoardMavenProject m, DashBoardMavenProject m2 where c.mavenProject = m and m2.id = :id and m2.groupId = m.groupId and m2.artifactId = m.artifactId and c.dateGeneration >= :startdate and c.dateGeneration <= :enddate and c.branchName is null
        ]]>
		</query>
        <query name="getCoberturaByPeriodByBranchName">
            <![CDATA[
        select c from CoberturaReportBean c, DashBoardMavenProject m, DashBoardMavenProject m2 where c.mavenProject = m and m2.id = :id and m2.groupId = m.groupId and m2.artifactId = m.artifactId and c.dateGeneration >= :startdate and c.dateGeneration <= :enddate and c.branchName = :branchName
        ]]>
        </query>
		<query name="getMarkerVersionByDate">
			<!--
				select c.mavenProject.version, min(c.dateGeneration) from CoberturaReportBean c, DashBoardMavenProject m , DashBoardMavenProject m2 where c.mavenProject = m and m2.id = :id and m2.groupId = m.groupId and m2.artifactId = m.artifactId and c.dateGeneration >= :startdate and c.dateGeneration <= :enddate group by c.mavenProject.version
			-->
			<![CDATA[
        select c.mavenProject.version, min(c.dateGeneration) from CoberturaReportBean c
        where c.mavenProject.id in (
		   select
		    m.id
		   from
		    DashBoardMavenProject m,
		    DashBoardMavenProject m2
		   where
		    m2.id = :id
		    and m2.groupId = m.groupId
		    and m2.artifactId = m.artifactId
		  )
		  and c.branchName is null
		  group by c.mavenProject.version
		  having min(c.dateGeneration) between :startdate and :enddate
        ]]>
		</query>
		      <query name="getMarkerVersionByDateByBranchName">
            <![CDATA[
        select c.mavenProject.version, min(c.dateGeneration) from CoberturaReportBean c
        where c.mavenProject.id in (
           select
            m.id
           from
            DashBoardMavenProject m,
            DashBoardMavenProject m2
           where
            m2.id = :id
            and m2.groupId = m.groupId
            and m2.artifactId = m.artifactId
          )
          and c.branchName = :branchName
          group by c.mavenProject.version
          having min(c.dateGeneration) between :startdate and :enddate
        ]]>
        </query>
		<!--  select c.mavenProject.version, min(c.dateGeneration) from CoberturaReportBean c, DashBoardMavenProject m , DashBoardMavenProject m2 where c.mavenProject = m and m2.id = 37 and m2.groupId = m.groupId and m2.artifactId = m.artifactId and c.dateGeneration >= '2008-03-15' and c.dateGeneration <= '2008-04-15' group by c.mavenProject.version -->
	</union-subclass>
	<!-- org.codehaus.mojo.dashboard.report.plugin.beans.CloverReportBean root -->
	<!-- table="CloverReportBean"  -->
	<union-subclass name="CloverReportBean" table="CloverReportBean"
		extends="AbstractReportBean">
		<property name="elements" column="elements" type="int" />
		<property name="conditionals" column="conditionals" type="int" />
		<property name="statements" column="statements" type="int" />
		<property name="methods" column="methods" type="int" />
		<property name="coveredElements" column="coveredElements"
			type="int" />
		<property name="coveredConditionals"
			column="coveredConditionals" type="int" />
		<property name="coveredStatements" column="coveredStatements"
			type="int" />
		<property name="coveredMethods" column="coveredMethods"
			type="int" />
		<query name="getCloverByDashBoardMavenProjectID">
			<![CDATA[
		select c from CloverReportBean c,DashBoardMavenProject m where c.mavenProject = m and m.id = :id
		]]>
		</query>
		<query name="getCloverByPeriodByVersion">
			<![CDATA[
		select c from CloverReportBean c,DashBoardMavenProject m where c.mavenProject = m and m.id = :id and c.dateGeneration >= :startdate and c.dateGeneration <= :enddate and c.branchName is null
		]]>
		</query>
        <query name="getCloverByPeriodByVersionByBranchName">
            <![CDATA[
        select c from CloverReportBean c,DashBoardMavenProject m where c.mavenProject = m and m.id = :id and c.dateGeneration >= :startdate and c.dateGeneration <= :enddate and c.branchName = :branchName
        ]]>
        </query>
        <query name="getCloverByPeriod">
            <![CDATA[
        select c from CloverReportBean c, DashBoardMavenProject m, DashBoardMavenProject m2 where c.mavenProject = m and m2.id = :id and m2.groupId = m.groupId and m2.artifactId = m.artifactId and c.dateGeneration >= :startdate and c.dateGeneration <= :enddate and c.branchName is null
        ]]>
        </query>
		<query name="getCloverByPeriodByBranchName">
			<![CDATA[
        select c from CloverReportBean c, DashBoardMavenProject m, DashBoardMavenProject m2 where c.mavenProject = m and m2.id = :id and m2.groupId = m.groupId and m2.artifactId = m.artifactId and c.dateGeneration >= :startdate and c.dateGeneration <= :enddate and c.branchName = :branchName
        ]]>
		</query>
		<query name="getMarkerVersionByDate">
			<![CDATA[
        select c.mavenProject.version, min(c.dateGeneration) from CloverReportBean c
        where c.mavenProject.id in (
		   select
		    m.id
		   from
		    DashBoardMavenProject m,
		    DashBoardMavenProject m2
		   where
		    m2.id = :id
		    and m2.groupId = m.groupId
		    and m2.artifactId = m.artifactId
		  )
		  and c.branchName is null
		  group by c.mavenProject.version
		  having min(c.dateGeneration) between :startdate and :enddate
        ]]>
		</query>
		      <query name="getMarkerVersionByDateByBranchName">
            <![CDATA[
        select c.mavenProject.version, min(c.dateGeneration) from CloverReportBean c
        where c.mavenProject.id in (
           select
            m.id
           from
            DashBoardMavenProject m,
            DashBoardMavenProject m2
           where
            m2.id = :id
            and m2.groupId = m.groupId
            and m2.artifactId = m.artifactId
          )
          and c.branchName = :branchName
          group by c.mavenProject.version
          having min(c.dateGeneration) between :startdate and :enddate
        ]]>
        </query>
	</union-subclass>
	<!-- org.codehaus.mojo.dashboard.report.plugin.beans.CpdReportBean root -->
	<!-- table="CpdReportBean"  -->
	<union-subclass name="CpdReportBean" table="CpdReportBean"
		extends="AbstractReportBean">
		<property name="nbClasses" column="nbClasses" type="int" />
		<property name="nbDuplicate" column="nbDuplicate" type="int" />
		<query name="getCpdByDashBoardMavenProjectID">
			<![CDATA[
		select c from CpdReportBean c,DashBoardMavenProject m where c.mavenProject = m and m.id = :id
		]]>
		</query>
		<query name="getCpdByPeriodByVersion">
			<![CDATA[
		select c from CpdReportBean c,DashBoardMavenProject m where c.mavenProject = m and m.id = :id and c.dateGeneration >= :startdate and c.dateGeneration <= :enddate and c.branchName is null
		]]>
		</query>
        <query name="getCpdByPeriodByVersionByBranchName">
            <![CDATA[
        select c from CpdReportBean c,DashBoardMavenProject m where c.mavenProject = m and m.id = :id and c.dateGeneration >= :startdate and c.dateGeneration <= :enddate and c.branchName = :branchName
        ]]>
        </query>
        <query name="getCpdByPeriod">
            <![CDATA[
        select c from CpdReportBean c, DashBoardMavenProject m, DashBoardMavenProject m2 where c.mavenProject = m and m2.id = :id and m2.groupId = m.groupId and m2.artifactId = m.artifactId and c.dateGeneration >= :startdate and c.dateGeneration <= :enddate and c.branchName is null
        ]]>
        </query>
		<query name="getCpdByPeriodByBranchName">
			<![CDATA[
        select c from CpdReportBean c, DashBoardMavenProject m, DashBoardMavenProject m2 where c.mavenProject = m and m2.id = :id and m2.groupId = m.groupId and m2.artifactId = m.artifactId and c.dateGeneration >= :startdate and c.dateGeneration <= :enddate and c.branchName = :branchName
        ]]>
		</query>
		<query name="getMarkerVersionByDate">
			<![CDATA[
        select c.mavenProject.version, min(c.dateGeneration) from CpdReportBean c
        where c.mavenProject.id in (
		   select
		    m.id
		   from
		    DashBoardMavenProject m,
		    DashBoardMavenProject m2
		   where
		    m2.id = :id
		    and m2.groupId = m.groupId
		    and m2.artifactId = m.artifactId
		  )
		  and c.branchName is null
		  group by c.mavenProject.version
		  having min(c.dateGeneration) between :startdate and :enddate
        ]]>
		</query>
		      <query name="getMarkerVersionByDateByBranchName">
            <![CDATA[
        select c.mavenProject.version, min(c.dateGeneration) from CpdReportBean c
        where c.mavenProject.id in (
           select
            m.id
           from
            DashBoardMavenProject m,
            DashBoardMavenProject m2
           where
            m2.id = :id
            and m2.groupId = m.groupId
            and m2.artifactId = m.artifactId
          )
          and c.branchName = :branchName
          group by c.mavenProject.version
          having min(c.dateGeneration) between :startdate and :enddate
        ]]>
        </query>
	</union-subclass>
	<!-- org.codehaus.mojo.dashboard.report.plugin.beans.PmdReportBean root -->
	<!-- table="PmdReportBean"  -->
	<union-subclass name="PmdReportBean" table="PmdReportBean"
		extends="AbstractReportBean">
		<property name="nbClasses" column="nbClasses" type="int" />
		<property name="nbViolations" column="nbViolations" type="int" />
		<query name="getPmdByDashBoardMavenProjectID">
			<![CDATA[
		select c from PmdReportBean c,DashBoardMavenProject m where c.mavenProject = m and m.id = :id
		]]>
		</query>
		<query name="getPmdByPeriodByVersion">
			<![CDATA[
		select c from PmdReportBean c,DashBoardMavenProject m where c.mavenProject = m and m.id = :id and c.dateGeneration >= :startdate and c.dateGeneration <= :enddate  and c.branchName is null
		]]>
		</query>
        <query name="getPmdByPeriodByVersionByBranchName">
            <![CDATA[
        select c from PmdReportBean c,DashBoardMavenProject m where c.mavenProject = m and m.id = :id and c.dateGeneration >= :startdate and c.dateGeneration <= :enddate and c.branchName = :branchName
        ]]>
        </query>
		<query name="getPmdByPeriod">
			<![CDATA[
        select c from PmdReportBean c, DashBoardMavenProject m, DashBoardMavenProject m2 where c.mavenProject = m and m2.id = :id and m2.groupId = m.groupId and m2.artifactId = m.artifactId and c.dateGeneration >= :startdate and c.dateGeneration <= :enddate and c.branchName is null
        ]]>
		</query>
		<query name="getPmdByPeriodByBranchName">
            <![CDATA[
        select c from PmdReportBean c, DashBoardMavenProject m, DashBoardMavenProject m2 where c.mavenProject = m and m2.id = :id and m2.groupId = m.groupId and m2.artifactId = m.artifactId and c.dateGeneration >= :startdate and c.dateGeneration <= :enddate and c.branchName = :branchName
        ]]>
        </query>
		<query name="getMarkerVersionByDate">
			<![CDATA[
        select c.mavenProject.version, min(c.dateGeneration) from PmdReportBean c
        where c.mavenProject.id in (
		   select
		    m.id
		   from
		    DashBoardMavenProject m,
		    DashBoardMavenProject m2
		   where
		    m2.id = :id
		    and m2.groupId = m.groupId
		    and m2.artifactId = m.artifactId
		  )
		  and c.branchName is null
		  group by c.mavenProject.version
		  having min(c.dateGeneration) between :startdate and :enddate
        ]]>
		</query>
		<query name="getMarkerVersionByDateByBranchName">
            <![CDATA[
        select c.mavenProject.version, min(c.dateGeneration) from PmdReportBean c
        where c.mavenProject.id in (
           select
            m.id
           from
            DashBoardMavenProject m,
            DashBoardMavenProject m2
           where
            m2.id = :id
            and m2.groupId = m.groupId
            and m2.artifactId = m.artifactId
          )
          and c.branchName = :branchName
          group by c.mavenProject.version
          having min(c.dateGeneration) between :startdate and :enddate
        ]]>
        </query>
	</union-subclass>
	<!-- org.codehaus.mojo.dashboard.report.plugin.beans.SurefireReportBean root -->
	<!-- table="SurefireReportBean"  -->
	<union-subclass name="SurefireReportBean" table="SurefireReportBean"
		extends="AbstractReportBean">
		<property name="nbTests" column="nbTests" type="int" />
		<property name="nbErrors" column="nbErrors" type="int" />
		<property name="nbFailures" column="nbFailures" type="int" />
		<property name="nbSkipped" column="nbSkipped" type="int" />
		<property name="sucessRate" column="sucessRate" type="double" />
		<property name="elapsedTime" column="elapsedTime" type="double" />
		<query name="getSurefireByDashBoardMavenProjectID">
			<![CDATA[
		select c from SurefireReportBean c,DashBoardMavenProject m where c.mavenProject = m and m.id = :id
		]]>
		</query>
		<query name="getSurefireByPeriodByVersion">
			<![CDATA[
		select c from SurefireReportBean c,DashBoardMavenProject m where c.mavenProject = m and m.id = :id and c.dateGeneration >= :startdate and c.dateGeneration <= :enddate and c.branchName is null
		]]>
		</query>
        <query name="getSurefireByPeriodByVersionByBranchName">
            <![CDATA[
        select c from SurefireReportBean c,DashBoardMavenProject m where c.mavenProject = m and m.id = :id and c.dateGeneration >= :startdate and c.dateGeneration <= :enddate and c.branchName = :branchName
        ]]>
        </query>
        <query name="getSurefireByPeriod">
            <![CDATA[
        select c from SurefireReportBean c, DashBoardMavenProject m, DashBoardMavenProject m2 where c.mavenProject = m and m2.id = :id and m2.groupId = m.groupId and m2.artifactId = m.artifactId and c.dateGeneration >= :startdate and c.dateGeneration <= :enddate and c.branchName is null
        ]]>
        </query>
		<query name="getSurefireByPeriodByBranchName">
			<![CDATA[
        select c from SurefireReportBean c, DashBoardMavenProject m, DashBoardMavenProject m2 where c.mavenProject = m and m2.id = :id and m2.groupId = m.groupId and m2.artifactId = m.artifactId and c.dateGeneration >= :startdate and c.dateGeneration <= :enddate and c.branchName = :branchName
        ]]>
		</query>
		<query name="getMarkerVersionByDate">
			<![CDATA[
        select c.mavenProject.version, min(c.dateGeneration) from SurefireReportBean c
        where c.mavenProject.id in (
		   select
		    m.id
		   from
		    DashBoardMavenProject m,
		    DashBoardMavenProject m2
		   where
		    m2.id = :id
		    and m2.groupId = m.groupId
		    and m2.artifactId = m.artifactId
		  )
		  and c.branchName is null
		  group by c.mavenProject.version
		  having min(c.dateGeneration) between :startdate and :enddate
        ]]>
		</query>
		      <query name="getMarkerVersionByDateByBranchName">
            <![CDATA[
        select c.mavenProject.version, min(c.dateGeneration) from SurefireReportBean c
        where c.mavenProject.id in (
           select
            m.id
           from
            DashBoardMavenProject m,
            DashBoardMavenProject m2
           where
            m2.id = :id
            and m2.groupId = m.groupId
            and m2.artifactId = m.artifactId
          )
          and c.branchName = :branchName
          group by c.mavenProject.version
          having min(c.dateGeneration) between :startdate and :enddate
        ]]>
        </query>
	</union-subclass>
	<!-- org.codehaus.mojo.dashboard.report.plugin.beans.FindBugsReportBean root -->
	<!-- table="FindBugsReportBean"  -->
	<union-subclass name="FindBugsReportBean" table="FindBugsReportBean"
		extends="AbstractReportBean">
		<property name="nbClasses" column="nbClasses" type="int" />
		<property name="nbBugs" column="nbBugs" type="int" />
		<property name="nbErrors" column="nbErrors" type="int" />
		<property name="nbMissingClasses" column="nbMissingClasses"
			type="int" />
		<query name="getFindBugsByDashBoardMavenProjectID">
			<![CDATA[
		select c from FindBugsReportBean c,DashBoardMavenProject m where c.mavenProject = m and m.id = :id
		]]>
		</query>
		<query name="getFindBugsByPeriodByVersion">
			<![CDATA[
		select c from FindBugsReportBean c,DashBoardMavenProject m where c.mavenProject = m and m.id = :id and c.dateGeneration >= :startdate and c.dateGeneration <= :enddate and c.branchName is null
		]]>
		</query>
        <query name="getFindBugsByPeriodByVersionByBranchName">
            <![CDATA[
        select c from FindBugsReportBean c,DashBoardMavenProject m where c.mavenProject = m and m.id = :id and c.dateGeneration >= :startdate and c.dateGeneration <= :enddate and c.branchName = :branchName
        ]]>
        </query>
        <query name="getFindBugsByPeriod">
            <![CDATA[
        select c from FindBugsReportBean c, DashBoardMavenProject m, DashBoardMavenProject m2 where c.mavenProject = m and m2.id = :id and m2.groupId = m.groupId and m2.artifactId = m.artifactId and c.dateGeneration >= :startdate and c.dateGeneration <= :enddate and c.branchName is null
        ]]>
        </query>
		<query name="getFindBugsByPeriodByBranchName">
			<![CDATA[
        select c from FindBugsReportBean c, DashBoardMavenProject m, DashBoardMavenProject m2 where c.mavenProject = m and m2.id = :id and m2.groupId = m.groupId and m2.artifactId = m.artifactId and c.dateGeneration >= :startdate and c.dateGeneration <= :enddate and c.branchName = :branchName
        ]]>
		</query>
		<query name="getMarkerVersionByDate">
			<![CDATA[
        select c.mavenProject.version, min(c.dateGeneration) from FindBugsReportBean c
        where c.mavenProject.id in (
		   select
		    m.id
		   from
		    DashBoardMavenProject m,
		    DashBoardMavenProject m2
		   where
		    m2.id = :id
		    and m2.groupId = m.groupId
		    and m2.artifactId = m.artifactId
		  )
		  and c.branchName is null
		  group by c.mavenProject.version
		  having min(c.dateGeneration) between :startdate and :enddate
        ]]>
		</query>
		<query name="getMarkerVersionByDateByBranchName">
            <![CDATA[
        select c.mavenProject.version, min(c.dateGeneration) from FindBugsReportBean c
        where c.mavenProject.id in (
           select
            m.id
           from
            DashBoardMavenProject m,
            DashBoardMavenProject m2
           where
            m2.id = :id
            and m2.groupId = m.groupId
            and m2.artifactId = m.artifactId
          )
          and c.branchName = :branchName
          group by c.mavenProject.version
          having min(c.dateGeneration) between :startdate and :enddate
        ]]>
        </query>
	</union-subclass>
	<!-- org.codehaus.mojo.dashboard.report.plugin.beans.TagListReportBean root -->
	<!-- table="TagListReportBean"  -->
	<union-subclass name="TagListReportBean" table="TagListReportBean"
		extends="AbstractReportBean">
		<property name="nbClasses" column="nbClasses" type="int" />
		<property name="nbTotal" column="nbTotal" type="int" />
		<query name="getTagListByDashBoardMavenProjectID">
			<![CDATA[
		select c from TagListReportBean c,DashBoardMavenProject m where c.mavenProject = m and m.id = :id
		]]>
		</query>
		<query name="getTagListByPeriodByVersion">
			<![CDATA[
		select c from TagListReportBean c,DashBoardMavenProject m where c.mavenProject = m and m.id = :id and c.dateGeneration >= :startdate and c.dateGeneration <= :enddate and c.branchName is null
		]]>
		</query>
        <query name="getTagListByPeriodByVersionByBranchName">
            <![CDATA[
        select c from TagListReportBean c,DashBoardMavenProject m where c.mavenProject = m and m.id = :id and c.dateGeneration >= :startdate and c.dateGeneration <= :enddate and c.branchName = :branchName
        ]]>
        </query>
        <query name="getTagListByPeriod">
            <![CDATA[
        select c from TagListReportBean c, DashBoardMavenProject m, DashBoardMavenProject m2 where c.mavenProject = m and m2.id = :id and m2.groupId = m.groupId and m2.artifactId = m.artifactId and c.dateGeneration >= :startdate and c.dateGeneration <= :enddate and c.branchName is null
        ]]>
        </query>
		<query name="getTagListByPeriodByBranchName">
			<![CDATA[
        select c from TagListReportBean c, DashBoardMavenProject m, DashBoardMavenProject m2 where c.mavenProject = m and m2.id = :id and m2.groupId = m.groupId and m2.artifactId = m.artifactId and c.dateGeneration >= :startdate and c.dateGeneration <= :enddate and c.branchName = :branchName
        ]]>
		</query>
		<query name="getMarkerVersionByDate">
			<![CDATA[
        select c.mavenProject.version, min(c.dateGeneration) from TagListReportBean c
        where c.mavenProject.id in (
		   select
		    m.id
		   from
		    DashBoardMavenProject m,
		    DashBoardMavenProject m2
		   where
		    m2.id = :id
		    and m2.groupId = m.groupId
		    and m2.artifactId = m.artifactId
		  )
		  and c.branchName is null
		  group by c.mavenProject.version
		  having min(c.dateGeneration) between :startdate and :enddate
        ]]>
		</query>
		      <query name="getMarkerVersionByDateByBranchName">
            <![CDATA[
        select c.mavenProject.version, min(c.dateGeneration) from TagListReportBean c
        where c.mavenProject.id in (
           select
            m.id
           from
            DashBoardMavenProject m,
            DashBoardMavenProject m2
           where
            m2.id = :id
            and m2.groupId = m.groupId
            and m2.artifactId = m.artifactId
          )
          and c.branchName = :branchName
          group by c.mavenProject.version
          having min(c.dateGeneration) between :startdate and :enddate
        ]]>
        </query>
	</union-subclass>
</hibernate-mapping>


text:
import requests
import lxml.html as lh

import datetime
now = datetime.datetime.now()
import time

import sqlite3

# In[25]:

# do we print all messages every days, or only several to check received data
printAll = True
#printAll = False
# total counter of received news
allNews = 0
# how many do we show
maxShow = 5
# seconds to wait between calls (may be 0.1 etc)
waitSec = 1

# In[14]:

db = "mp-nettemp3-fru.db"
conn = sqlite3.connect(db)

conn.execute('''DROP TABLE IF EXISTS netdata''')
conn.execute('''CREATE TABLE netdata (source text, ndate text, addr text, header text, wpos int, wneg int, mark number)''')
conn.commit()
source = "fontanka"

# In[15]:

url = "http://www.fontanka.ru/fontanka/"

# In[16]:

myyear, mymonth, myday = now.year, now.month, now.day
plus = "{0:04d}/{1:02d}/{2:02d}" .format (myyear, mymonth, myday)
fullurl = url + plus + '/all.html'
print ("Getting data from {}" .format(fullurl))

# In[26]:

def getoneday(ayear, amonth, aday, fullurl):
    """get all headers from fontanka for 1 given day"""
    global allNews
    thisdt = "{0:04d}-{1:02d}-{2:02d}" .format (ayear, amonth, aday)
    print ("This DT {}" .format (thisdt))
    try:
        print ("Full URL = {}" .format (fullurl))
        page = requests.get(fullurl)
        tree = lh.fromstring(page.text)

        arts = tree.xpath("//div[@class='calendar-item']")
        print ("found {} records" .format(len(arts)))
        weShowed = 0

        for art in arts:
            dt = art.xpath("div[@class='calendar-item-date']")[0].text.strip()
            tit = art.xpath("div[@class='calendar-item-title']/a")[0].text.strip()
            outdt = thisdt + " " + dt

            conn.execute("""INSERT INTO netdata (source, ndate, addr, header, wpos, wneg, mark) VALUES (?, ?, ?, ?, ?, ?, ?)""", (source, outdt, fullurl, tit, 0, 0, 0))
            conn.commit()

            weShowed += 1
            if weShowed <= maxShow:
                print ("{} {}" .format (dt, tit))
            else:
                print (".", end="")

    except:
        print ("Error or no such date")
    time.sleep(waitSec)

    print ("...\nTotal records: {}" .format(len(arts)))
    allNews += len(arts)

# In[1]:

def getalldays():
    """get info for all days in history"""
    for ayear in range(2000, 2016):
        for amonth in range(1, 13):
            for aday in range(1, 32):
                fulldate = "{0:04d}/{1:02d}/{2:02d}" .format (ayear, amonth, aday)
                fullurl = url + fulldate + "/all.html"
                print ("Processing {}" .format(fullurl))
                getoneday (ayear, amonth, aday, fullurl)

# In[20]:

getalldays()

# In[24]:

conn.close()

# Details and refs:
#
# SQLite
# https://docs.python.org/2/library/sqlite3.html#sqlite3.connect
#
# XSL
# https://msdn.microsoft.com/ru-ru/library/ms256086(v=vs.120).aspx
#

redpajama_set_name: RedPajamaGithub


text:
title: "Class 9: Content Strategy & Sketching"
date: 2017-03-14 12:00:00
description: "Content strategy, sketching, information architecture, mobile-first design, work on content and sketching in class.  Visit from Whitespace Creative."
assignment: Content & Sketching
reading:

Web Design Book - Ch. 18 Process & Design

Content-First Design by Steph Hay

Structure First. Content Always. by Mark Boulton

Sketching - the Visual Thinking Power Tool by Mike Rohde

Mobile First - Luke Wroblewski

due: Mid-Semester Survey and Research/Competitive Analysis
part: "2"
layout: wide
semester: spring-2017
current: no
slides: "/class/slides/9/9-Slides-RWD.pdf"
status: blog-post-date--past

---

## In Class

* Discuss Advanced Layout and Media Queries
* Common Responsive Patterns
* Hands On With Media Queries + Work On Layout/Media Query Assignment
* [Modern Layouts: Getting Out of Our Ruts with Jen Simmons](https://www.youtube.com/watch?v=ZNpn7FBp_9U&feature=youtu.be)


text:
package org.keycloak.exportimport.util;

import org.jboss.logging.Logger;
import org.keycloak.Version;
import org.keycloak.exportimport.ExportImportConfig;
import org.keycloak.exportimport.ExportProvider;
import org.keycloak.exportimport.UsersExportStrategy;
import org.keycloak.models.KeycloakSession;
import org.keycloak.models.KeycloakSessionFactory;
import org.keycloak.models.KeycloakSessionTask;
import org.keycloak.models.RealmModel;
import org.keycloak.models.UserModel;
import org.keycloak.models.utils.KeycloakModelUtils;
import org.keycloak.representations.idm.RealmRepresentation;

import java.io.IOException;
import java.util.List;

/**
 * @author Marek Posolda
 */
public abstract class MultipleStepsExportProvider implements ExportProvider {

    protected final Logger logger = Logger.getLogger(getClass());

    @Override
    public void exportModel(KeycloakSessionFactory factory) throws IOException {
        final RealmsHolder holder = new RealmsHolder();

        KeycloakModelUtils.runJobInTransaction(factory, new KeycloakSessionTask() {

            @Override
            public void run(KeycloakSession session) {
                List<RealmModel> realms = session.realms().getRealms();
                holder.realms = realms;
            }

        });

        for (RealmModel realm : holder.realms) {
            exportRealmImpl(factory, realm.getName());
        }

        writeVersion("version.json", Version.SINGLETON);
    }

    @Override
    public void exportRealm(KeycloakSessionFactory factory, String realmName) throws IOException {
        exportRealmImpl(factory, realmName);
        writeVersion("version.json", Version.SINGLETON);
    }

    protected void exportRealmImpl(KeycloakSessionFactory factory, final String realmName) throws IOException {
        final UsersExportStrategy usersExportStrategy = ExportImportConfig.getUsersExportStrategy();
        final int usersPerFile = ExportImportConfig.getUsersPerFile();
        final UsersHolder usersHolder = new UsersHolder();
        final boolean exportUsersIntoRealmFile = usersExportStrategy == UsersExportStrategy.REALM_FILE;

        KeycloakModelUtils.runJobInTransaction(factory, new ExportImportSessionTask() {

            @Override
            protected void runExportImportTask(KeycloakSession session) throws IOException {
                RealmModel realm = session.realms().getRealmByName(realmName);
                RealmRepresentation rep = ExportUtils.exportRealm(session, realm, exportUsersIntoRealmFile);
                writeRealm(realmName + "-realm.json", rep);
                logger.info("Realm '" + realmName + "' - data exported");

                // Count total number of users
                if (!exportUsersIntoRealmFile) {
                    usersHolder.totalCount = session.users().getUsersCount(realm);
                }
            }

        });

        if (usersExportStrategy != UsersExportStrategy.SKIP && !exportUsersIntoRealmFile) {
            // We need to export users now
            usersHolder.currentPageStart = 0;

            // usersExportStrategy==SAME_FILE  means exporting all users into single file (but separate to realm)
            final int countPerPage = (usersExportStrategy == UsersExportStrategy.SAME_FILE) ? usersHolder.totalCount : usersPerFile;

            while (usersHolder.currentPageStart < usersHolder.totalCount) {
                if (usersHolder.currentPageStart + countPerPage < usersHolder.totalCount) {
                    usersHolder.currentPageEnd = usersHolder.currentPageStart + countPerPage;
                } else {
                    usersHolder.currentPageEnd = usersHolder.totalCount;
                }

                KeycloakModelUtils.runJobInTransaction(factory, new ExportImportSessionTask() {

                    @Override
                    protected void runExportImportTask(KeycloakSession session) throws IOException {
                        RealmModel realm = session.realms().getRealmByName(realmName);
                        usersHolder.users = session.users().getUsers(realm, usersHolder.currentPageStart, usersHolder.currentPageEnd - usersHolder.currentPageStart);

                        writeUsers(realmName + "-users-" + (usersHolder.currentPageStart / countPerPage) + ".json", session, realm, usersHolder.users);

                        logger.info("Users " + usersHolder.currentPageStart + "-" + (usersHolder.currentPageEnd -1) + " exported");
                    }

                });

                usersHolder.currentPageStart = usersHolder.currentPageEnd;
            }
        }
    }

    protected abstract void writeRealm(String fileName, RealmRepresentation rep) throws IOException;

    protected abstract void writeUsers(String fileName, KeycloakSession session, RealmModel realm, List<UserModel> users) throws IOException;

    protected abstract void writeVersion(String fileName, Version version) throws IOException;

    public static class RealmsHolder {
        List<RealmModel> realms;

    }

    public static class UsersHolder {
        List<UserModel> users;
        int totalCount;
        int currentPageStart;
        int currentPageEnd;
    }
}


text:
<?php

namespace Mduk\Gowi\Http\Application\Builder;

use Mduk\Gowi\Http\Application;
use Mduk\Gowi\Http\Application\Stage\Stub as StubStage;
use Mduk\Gowi\Http\Application\Builder as ApplicationBuilder;
use Mduk\Gowi\Http\Request;
use Mduk\Gowi\Factory;

class RouterTest extends \PHPUnit_Framework_TestCase {

  public function testColonHookExpansion() {
    $builderFactory = new Factory( [
      'stub' => function() {
        return new StubBuilder;
      }
    ] );

    $builder = new Router;
    $builder->setApplicationBuilderFactory( $builderFactory );

    $builder->defineRoute( 'stub', 'GET:/foo', [
      'builder' => 'stub',
      'config' => []
    ] );

    $response = $builder->build()->run( Request::create( '/foo', 'GET' ) );
    $this->assertEquals( 200, $response->getStatusCode() );

    $response = $builder->build()->run( Request::create( '/foo', 'POST' ) );
    $this->assertEquals( 405, $response->getStatusCode() );
  }

  public function testNotFound() {
    $builder = new Router;
    $app = $builder->build();
    $response = $app->run( Request::create( '/foo' ) );

    $this->assertEquals( 404, $response->getStatusCode() );
  }

  public function testMethodNotAllowed() {
    $builderFactory = new Factory( [
      'stub' => function() {
        return new StubBuilder;
      }
    ] );

    $builder = new Router;
    $builder->setApplicationBuilderFactory( $builderFactory );

    $builder->defineRoute( 'stub', '/foo', [] );

    $response = $builder->build()->run( Request::create( '/foo', 'POST' ) );

    $this->assertEquals( 405, $response->getStatusCode() );
  }

  public function testOk() {
    $builderFactory = new Factory( [
      'stub' => function() {
        return new StubBuilder;
      }
    ] );

    $builder = new Router;
    $builder->setApplicationBuilderFactory( $builderFactory );

    $builder->defineRoute( 'stub', '/foo', [
      'builder' => 'stub',
      'config' => []
    ] );

    $response = $builder->build()->run( Request::create( '/foo' ) );

    $this->assertEquals( 200, $response->getStatusCode() );
  }

}

class StubBuilder extends ApplicationBuilder {
  public function build( Application $app = null, array $config = [] ) {
    if ( !$app ) {
      $app = parent::build( $app, $config );
    }

    $app->addStage( new StubStage( function( $app, $req, $res ) {
      return $res->ok()->text( 'ok' );
    }) );

    return $app;
  }
}


text:
@interface CircledNumberView : UIView {
	int			number;
	NSString	*numberString;
	BOOL		highlighted;
}
@property (nonatomic, assign) int number;
- (id)init;
- (void)setHighlighted:(BOOL)newValue;
@end


text:
module Mongo
  class Server

    # Responsible for periodically polling a server via hello commands to
    # keep the server's status up to date.
    #
    # Does all work in a background thread so as to not interfere with other
    # operations performed by the driver.
    #
    # @since 2.0.0
    # @api private
    class Monitor
      include Loggable
      extend Forwardable
      include Event::Publisher
      include BackgroundThread

      # The default interval between server status refreshes is 10 seconds.
      #
      # @since 2.0.0
      DEFAULT_HEARTBEAT_INTERVAL = 10.freeze

      # The minimum time between forced server scans. Is
      # minHeartbeatFrequencyMS in the SDAM spec.
      #
      # @since 2.0.0
      MIN_SCAN_INTERVAL = 0.5.freeze

      # The weighting factor (alpha) for calculating the average moving round trip time.
      #
      # @since 2.0.0
      # @deprecated Will be removed in version 3.0.
      RTT_WEIGHT_FACTOR = 0.2.freeze

      # Create the new server monitor.
      #
      # @example Create the server monitor.
      #   Mongo::Server::Monitor.new(address, listeners, monitoring)
      #
      # @note Monitor must never be directly instantiated outside of a Server.
      #
      # @param [ Server ] server The server to monitor.
      # @param [ Event::Listeners ] event_listeners The event listeners.
      # @param [ Monitoring ] monitoring The monitoring..
      # @param [ Hash ] options The options.
      #
      # @option options [ Float ] :connect_timeout The timeout, in seconds, to
      #   use when establishing the monitoring connection.
      # @option options [ Float ] :heartbeat_interval The interval between
      #   regular server checks.
      # @option options [ Logger ] :logger A custom logger to use.
      # @option options [ Mongo::Server::Monitor::AppMetadata ] :monitor_app_metadata
      #   The metadata to use for regular monitoring connection.
      # @option options [ Mongo::Server::Monitor::AppMetadata ] :push_monitor_app_metadata
      #   The metadata to use for push monitor's connection.
      # @option options [ Float ] :socket_timeout The timeout, in seconds, to
      #   execute operations on the monitoring connection.
      #
      # @since 2.0.0
      # @api private
      def initialize(server, event_listeners, monitoring, options = {})
        unless monitoring.is_a?(Monitoring)
          raise ArgumentError, "Wrong monitoring type: #{monitoring.inspect}"
        end
        unless options[:app_metadata]
          raise ArgumentError, 'App metadata is required'
        end
        unless options[:push_monitor_app_metadata]
          raise ArgumentError, 'Push monitor app metadata is required'
        end
        @server = server
        @event_listeners = event_listeners
        @monitoring = monitoring
        @options = options.freeze
        @mutex = Mutex.new
        @sdam_mutex = Mutex.new
        @next_earliest_scan = @next_wanted_scan = Time.now
        @update_mutex = Mutex.new
      end

      # @return [ Server ] server The server that this monitor is monitoring.
      # @api private
      attr_reader :server

      # @return [ Mongo::Server::Monitor::Connection ] connection The connection to use.
      attr_reader :connection

      # @return [ Hash ] options The server options.
      attr_reader :options

      # The interval between regular server checks.
      #
      # @return [ Float ] The heartbeat interval, in seconds.
      def heartbeat_interval
        options[:heartbeat_interval] || DEFAULT_HEARTBEAT_INTERVAL
      end

      # @deprecated
      def_delegators :server, :last_scan

      # The compressor is determined during the handshake, so it must be an
      # attribute of the connection.
      #
      # @deprecated
      def_delegators :connection, :compressor

      # @return [ Monitoring ] monitoring The monitoring.
      attr_reader :monitoring

      # @return [ Server::PushMonitor | nil ] The push monitor, if one is being
      #   used.
      def push_monitor
        @update_mutex.synchronize do
          @push_monitor
        end
      end

      # Perform a check of the server.
      #
      # @since 2.0.0
      def do_work
        scan!
        # @next_wanted_scan may be updated by the push monitor.
        # However we need to check for termination flag so that the monitor
        # thread exits when requested.
        loop do
          delta = @next_wanted_scan - Time.now
          if delta > 0
            signaled = server.scan_semaphore.wait(delta)
            if signaled || @stop_requested
              break
            end
          else
            break
          end
        end
      end

      # Stop the background thread and wait for it to terminate for a
      # reasonable amount of time.
      #
      # @return [ true | false ] Whether the thread was terminated.
      #
      # @api public for backwards compatibility only
      def stop!
        stop_push_monitor!

        # Forward super's return value
        super.tap do
          # Important: disconnect should happen after the background thread
          # terminates.
          connection&.disconnect!
        end
      end

      def create_push_monitor!(topology_version)
        @update_mutex.synchronize do
          if @push_monitor && !@push_monitor.running?
            @push_monitor = nil
          end

          @push_monitor ||= PushMonitor.new(
            self,
            topology_version,
            monitoring,
            **Utils.shallow_symbolize_keys(options.merge(
              socket_timeout: heartbeat_interval + connection.socket_timeout,
              app_metadata: options[:push_monitor_app_metadata],
              check_document: @connection.check_document
            )),
          )
        end
      end

      def stop_push_monitor!
        @update_mutex.synchronize do
          if @push_monitor
            @push_monitor.stop!
            @push_monitor = nil
          end
        end
      end

      # Perform a check of the server with throttling, and update
      # the server's description and average round trip time.
      #
      # If the server was checked less than MIN_SCAN_INTERVAL seconds
      # ago, sleep until MIN_SCAN_INTERVAL seconds have passed since the last
      # check. Then perform the check which involves running hello
      # on the server being monitored and updating the server description
      # as a result.
      #
      # @note If the system clock moves backwards, this method can sleep
      #   for a very long time.
      #
      # @note The return value of this method is deprecated. In version 3.0.0
      #   this method will not have a return value.
      #
      # @return [ Description ] The updated description.
      #
      # @since 2.0.0
      def scan!
        # Ordinarily the background thread would invoke this method.
        # But it is also possible to invoke scan! directly on a monitor.
        # Allow only one scan to be performed at a time.
        @mutex.synchronize do
          throttle_scan_frequency!

          begin
            result = do_scan
          rescue => e
            run_sdam_flow({}, scan_error: e)
          else
            run_sdam_flow(result)
          end
        end
      end

      def run_sdam_flow(result, awaited: false, scan_error: nil)
        @sdam_mutex.synchronize do
          old_description = server.description

          new_description = Description.new(server.address, result,
            average_round_trip_time: server.round_trip_time_averager.average_round_trip_time
          )

          server.cluster.run_sdam_flow(server.description, new_description, awaited: awaited, scan_error: scan_error)

          server.description.tap do |new_description|
            unless awaited
              if new_description.unknown? && !old_description.unknown?
                @next_earliest_scan = @next_wanted_scan = Time.now
              else
                @next_earliest_scan = Time.now + MIN_SCAN_INTERVAL
                @next_wanted_scan = Time.now + heartbeat_interval
              end
            end
          end
        end
      end

      # Restarts the server monitor unless the current thread is alive.
      #
      # @example Restart the monitor.
      #   monitor.restart!
      #
      # @return [ Thread ] The thread the monitor runs on.
      #
      # @since 2.1.0
      def restart!
        if @thread && @thread.alive?
          @thread
        else
          run!
        end
      end

      def to_s
        "#<#{self.class.name}:#{object_id} #{server.address}>"
      end

      private

      def pre_stop
        server.scan_semaphore.signal
      end

      def do_scan
        begin
          monitoring.publish_heartbeat(server) do
            check
          end
        rescue => exc
          msg = "Error checking #{server.address}"
          Utils.warn_bg_exception(msg, exc,
            logger: options[:logger],
            log_prefix: options[:log_prefix],
            bg_error_backtrace: options[:bg_error_backtrace],
          )
          raise exc
        end
      end

      def check
        if @connection && @connection.pid != Process.pid
          log_warn("Detected PID change - Mongo client should have been reconnected (old pid #{@connection.pid}, new pid #{Process.pid}")
          @connection.disconnect!
          @connection = nil
        end

        if @connection
          result = server.round_trip_time_averager.measure do
            begin
              doc = @connection.check_document
              cmd = Protocol::Query.new(
                Database::ADMIN, Database::COMMAND, doc, :limit => -1
              )
              message = @connection.dispatch_bytes(cmd.serialize.to_s)
              message.documents.first
            rescue Mongo::Error
              @connection.disconnect!
              @connection = nil
              raise
            end
          end
        else
          connection = Connection.new(server.address, options)
          connection.connect!
          result = server.round_trip_time_averager.measure do
            connection.handshake!
          end
          @connection = connection
          if tv_doc = result['topologyVersion']
            # Successful response, server 4.4+
            create_push_monitor!(TopologyVersion.new(tv_doc))
            push_monitor.run!
          else
            # Failed response or pre-4.4 server
            stop_push_monitor!
          end
          result
        end
        result
      end

      # @note If the system clock is set to a time in the past, this method
      #   can sleep for a very long time.
      def throttle_scan_frequency!
        delta = @next_earliest_scan - Time.now
        if delta > 0
          sleep(delta)
        end
      end
    end
  end
end

require 'mongo/server/monitor/connection'
require 'mongo/server/monitor/app_metadata'


text:
/* --------------------------------------------------------------  */
/* (C)Copyright 2007,2008,                                         */
/* International Business Machines Corporation                     */
/* All Rights Reserved.                                            */
/*                                                                 */
/* Redistribution and use in source and binary forms, with or      */
/* without modification, are permitted provided that the           */
/* following conditions are met:                                   */
/*                                                                 */
/* - Redistributions of source code must retain the above copyright*/
/*   notice, this list of conditions and the following disclaimer. */
/*                                                                 */
/* - Redistributions in binary form must reproduce the above       */
/*   copyright notice, this list of conditions and the following   */
/*   disclaimer in the documentation and/or other materials        */
/*   provided with the distribution.                               */
/*                                                                 */
/* - Neither the name of IBM Corporation nor the names of its      */
/*   contributors may be used to endorse or promote products       */
/*   derived from this software without specific prior written     */
/*   permission.                                                   */
/*                                                                 */
/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND          */
/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,     */
/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF        */
/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE        */
/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR            */
/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,    */
/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT    */
/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;    */
/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)        */
/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN       */
/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR    */
/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,  */
/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.              */
/* --------------------------------------------------------------  */
/* PROLOG END TAG zYx                                              */
#ifdef __SPU__
#ifndef _TGAMMAF4_H_
#define _TGAMMAF4_H_	1

#include <spu_intrinsics.h>
#include "simdmath.h"

#include "recipf4.h"
#include "truncf4.h"
#include "expf4.h"
#include "logf4.h"
#include "divf4.h"
#include "sinf4.h"
#include "powf4.h"
#include "tgammad2.h"

/*
 * FUNCTION
 *  vector float _tgammaf4(vector float x)
 *
 * DESCRIPTION
 *  The tgammaf4 function returns a vector containing tgamma for each
 *  element of x
 *
 *	We take a fairly standard approach - break the domain into 5 separate regions:
 *
 *	1. [-infinity, 0)  - use gamma(x) = pi/(x*gamma(-x)*sin(x*pi))
 *	2. [0, 1)          - push x into [1,2), then adjust the
 *	                     result.
 *	3. [1, 2)          - use a rational approximation.
 *	4. [2, 10)         - pull back into [1, 2), then adjust
 *	                     the result.
 *	5. [10, +infinity] - use Stirling's Approximation.
 *
 *
 * Special Cases:
 *	- tgamma(+/- 0) returns +/- infinity
 *	- tgamma(negative integer) returns NaN
 *	- tgamma(-infinity) returns NaN
 *	- tgamma(infinity) returns infinity
 *
 */

/*
 * Coefficients for Stirling's Series for Gamma() are defined in
 * tgammad2.h
 */

/*
 * Rational Approximation Coefficients for the
 * domain [1, 2) are defined in tgammad2.h
 */

static __inline vector float _tgammaf4(vector float x)
{
    vector float signbit = spu_splats(-0.0f);
    vector float zerof   = spu_splats(0.0f);
    vector float halff   = spu_splats(0.5f);
    vector float onef    = spu_splats(1.0f);
    vector float ninep9f = (vector float)spu_splats(0x411FFFFF); /* Next closest to 10.0 */
    vector float t38f    = spu_splats(38.0f);
    vector float pi      = spu_splats((float)SM_PI);
    vector float sqrt2pi = spu_splats(2.506628274631000502415765284811f);
    vector float inf     = (vec_float4)spu_splats(0x7F800000);
    vector float nan     = (vec_float4)spu_splats(0x7FFFFFFF);

    vector float xabs;
    vector float xscaled;
    vector float xtrunc;
    vector float xinv;
    vector float nresult; /* Negative x result */
    vector float rresult; /* Rational Approx result */
    vector float sresult; /* Stirling's result */
    vector float result;
    vector float pr,qr;

    vector unsigned int gt0   = spu_cmpgt(x, zerof);
    vector unsigned int gt1   = spu_cmpgt(x, onef);
    vector unsigned int gt9p9 = spu_cmpgt(x, ninep9f);
    vector unsigned int gt38  = spu_cmpgt(x, t38f);

    xabs    = spu_andc(x, signbit);

    /*
     * For x in [0, 1], add 1 to x, use rational
     * approximation, then use:
     *
     * gamma(x) = gamma(x+1)/x
     *
     */
    xabs = spu_sel(spu_add(xabs, onef), xabs, gt1);
    xtrunc = _truncf4(xabs);

    /*
     * For x in [2, 10):
     */
    xscaled = spu_add(onef, spu_sub(xabs, xtrunc));

    /*
     * For x in [1,2), use a rational approximation.
     */
    pr = spu_madd(xscaled, spu_splats((float)TGD2_P07), spu_splats((float)TGD2_P06));
    pr = spu_madd(pr, xscaled, spu_splats((float)TGD2_P05));
    pr = spu_madd(pr, xscaled, spu_splats((float)TGD2_P04));
    pr = spu_madd(pr, xscaled, spu_splats((float)TGD2_P03));
    pr = spu_madd(pr, xscaled, spu_splats((float)TGD2_P02));
    pr = spu_madd(pr, xscaled, spu_splats((float)TGD2_P01));
    pr = spu_madd(pr, xscaled, spu_splats((float)TGD2_P00));

    qr = spu_madd(xscaled, spu_splats((float)TGD2_Q07), spu_splats((float)TGD2_Q06));
    qr = spu_madd(qr, xscaled, spu_splats((float)TGD2_Q05));
    qr = spu_madd(qr, xscaled, spu_splats((float)TGD2_Q04));
    qr = spu_madd(qr, xscaled, spu_splats((float)TGD2_Q03));
    qr = spu_madd(qr, xscaled, spu_splats((float)TGD2_Q02));
    qr = spu_madd(qr, xscaled, spu_splats((float)TGD2_Q01));
    qr = spu_madd(qr, xscaled, spu_splats((float)TGD2_Q00));

    rresult = _divf4(pr, qr);
    rresult = spu_sel(_divf4(rresult, x), rresult, gt1);

    /*
     * If x was in [2,10) and we pulled it into [1,2), we need to push
     * it back out again.
     */
    rresult = spu_sel(rresult, spu_mul(rresult, xscaled), spu_cmpgt(x, xscaled)); /* [2,3) */
    xscaled = spu_add(xscaled, onef);
    rresult = spu_sel(rresult, spu_mul(rresult, xscaled), spu_cmpgt(x, xscaled)); /* [3,4) */
    xscaled = spu_add(xscaled, onef);
    rresult = spu_sel(rresult, spu_mul(rresult, xscaled), spu_cmpgt(x, xscaled)); /* [4,5) */
    xscaled = spu_add(xscaled, onef);
    rresult = spu_sel(rresult, spu_mul(rresult, xscaled), spu_cmpgt(x, xscaled)); /* [5,6) */
    xscaled = spu_add(xscaled, onef);
    rresult = spu_sel(rresult, spu_mul(rresult, xscaled), spu_cmpgt(x, xscaled)); /* [6,7) */
    xscaled = spu_add(xscaled, onef);
    rresult = spu_sel(rresult, spu_mul(rresult, xscaled), spu_cmpgt(x, xscaled)); /* [7,8) */
    xscaled = spu_add(xscaled, onef);
    rresult = spu_sel(rresult, spu_mul(rresult, xscaled), spu_cmpgt(x, xscaled)); /* [8,9) */
    xscaled = spu_add(xscaled, onef);
    rresult = spu_sel(rresult, spu_mul(rresult, xscaled), spu_cmpgt(x, xscaled)); /* [9,10) */

    /*
     * For x >= 10, we use Stirling's Approximation
     */
    vector float sum;
    xinv    = _recipf4(xabs);
    sum = spu_madd(xinv, spu_splats((float)STIRLING_16), spu_splats((float)STIRLING_15));
    sum = spu_madd(sum, xinv, spu_splats((float)STIRLING_14));
    sum = spu_madd(sum, xinv, spu_splats((float)STIRLING_13));
    sum = spu_madd(sum, xinv, spu_splats((float)STIRLING_12));
    sum = spu_madd(sum, xinv, spu_splats((float)STIRLING_11));
    sum = spu_madd(sum, xinv, spu_splats((float)STIRLING_10));
    sum = spu_madd(sum, xinv, spu_splats((float)STIRLING_09));
    sum = spu_madd(sum, xinv, spu_splats((float)STIRLING_08));
    sum = spu_madd(sum, xinv, spu_splats((float)STIRLING_07));
    sum = spu_madd(sum, xinv, spu_splats((float)STIRLING_06));
    sum = spu_madd(sum, xinv, spu_splats((float)STIRLING_05));
    sum = spu_madd(sum, xinv, spu_splats((float)STIRLING_04));
    sum = spu_madd(sum, xinv, spu_splats((float)STIRLING_03));
    sum = spu_madd(sum, xinv, spu_splats((float)STIRLING_02));
    sum = spu_madd(sum, xinv, spu_splats((float)STIRLING_01));
    sum = spu_madd(sum, xinv, spu_splats((float)STIRLING_00));

    sum = spu_mul(sum, sqrt2pi);
    sum = spu_mul(sum, _powf4(x, spu_sub(x, halff)));
    sresult = spu_mul(sum, _expf4(spu_or(x, signbit)));

    /*
     * Choose rational approximation or Stirling's result.
     */
    result = spu_sel(rresult, sresult, gt9p9);

    result = spu_sel(result, inf, gt38);

    /* For x < 0, use:
     * gamma(x) = pi/(x*gamma(-x)*sin(x*pi))
     */
    nresult = _divf4(pi, spu_mul(x, spu_mul(result, _sinf4(spu_mul(x, pi)))));
    result = spu_sel(nresult, result, gt0);

    /*
     * x = non-positive integer, return NaN.
     */
    result = spu_sel(result, nan, spu_andc(spu_cmpeq(x, xtrunc), gt0));

    return result;
}

#endif /* _TGAMMAF4_H_ */
#endif /* __SPU__ */


text:
package goja.mvc.security;

/**
 * <p>
 * .
 * </p>
 *
 * @author sagyf yang
 * @version 1.0 2014-02-12 22:20
 * @since JDK 1.6
 */
public class CookieUser {

    private final long id;

    private final String password;

    private final boolean blocked;

    public CookieUser(long id, String password, boolean blocked) {
        this.id = id;
        this.password = password;
        this.blocked = blocked;
    }

    public long getId() {
        return id;
    }

    public String getPassword() {
        return password;
    }

    public boolean isBlocked() {
        return blocked;
    }
}


text:
Class: `StarTrekDictionaries`

Test Class: `StarTrekDictionariesTests`

Implement the methods in `StarTrekDictionaries` so that all of the unit tests pass.


text:
/*
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
 */
/*
 * This code was generated by https://github.com/googleapis/google-api-java-client-services/
 * Modify at your own risk.
 */

package com.google.api.services.displayvideo.v1.model;

/**
 * A strategy that automatically adjusts the bid to optimize a specified performance goal while
 * spending the full budget.
 *
 *
 This is the Java data model class that specifies how to parse/serialize into the JSON that is
 * transmitted over HTTP when working with the Display & Video 360 API. For a detailed explanation
 * see:
 * https://developers.google.com/api-client-library/java/google-http-java-client/json
 *

 *
 * @author Google, Inc.
 */
@SuppressWarnings("javadoc")
public final class MaximizeSpendBidStrategy extends com.google.api.client.json.GenericJson {

  /**
   * The ID of the Custom Bidding Algorithm used by this strategy. Only applicable when
   * performance_goal_type is set to `BIDDING_STRATEGY_PERFORMANCE_GOAL_TYPE_CUSTOM_ALGO`.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key @com.google.api.client.json.JsonString
  private java.lang.Long customBiddingAlgorithmId;

  /**
   * The maximum average CPM that may be bid, in micros of the advertiser's currency. Must be
   * greater than or equal to a billable unit of the given currency. For example, 1500000 represents
   * 1.5 standard units of the currency.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key @com.google.api.client.json.JsonString
  private java.lang.Long maxAverageCpmBidAmountMicros;

  /**
   * Required. The type of the performance goal that the bidding strategy tries to minimize while
   * spending the full budget. `BIDDING_STRATEGY_PERFORMANCE_GOAL_TYPE_VIEWABLE_CPM` is not
   * supported for this strategy.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String performanceGoalType;

  /**
   * Whether the strategy takes deal floor prices into account.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.Boolean raiseBidForDeals;

  /**
   * The ID of the Custom Bidding Algorithm used by this strategy. Only applicable when
   * performance_goal_type is set to `BIDDING_STRATEGY_PERFORMANCE_GOAL_TYPE_CUSTOM_ALGO`.
   * @return value or {@code null} for none
   */
  public java.lang.Long getCustomBiddingAlgorithmId() {
    return customBiddingAlgorithmId;
  }

  /**
   * The ID of the Custom Bidding Algorithm used by this strategy. Only applicable when
   * performance_goal_type is set to `BIDDING_STRATEGY_PERFORMANCE_GOAL_TYPE_CUSTOM_ALGO`.
   * @param customBiddingAlgorithmId customBiddingAlgorithmId or {@code null} for none
   */
  public MaximizeSpendBidStrategy setCustomBiddingAlgorithmId(java.lang.Long customBiddingAlgorithmId) {
    this.customBiddingAlgorithmId = customBiddingAlgorithmId;
    return this;
  }

  /**
   * The maximum average CPM that may be bid, in micros of the advertiser's currency. Must be
   * greater than or equal to a billable unit of the given currency. For example, 1500000 represents
   * 1.5 standard units of the currency.
   * @return value or {@code null} for none
   */
  public java.lang.Long getMaxAverageCpmBidAmountMicros() {
    return maxAverageCpmBidAmountMicros;
  }

  /**
   * The maximum average CPM that may be bid, in micros of the advertiser's currency. Must be
   * greater than or equal to a billable unit of the given currency. For example, 1500000 represents
   * 1.5 standard units of the currency.
   * @param maxAverageCpmBidAmountMicros maxAverageCpmBidAmountMicros or {@code null} for none
   */
  public MaximizeSpendBidStrategy setMaxAverageCpmBidAmountMicros(java.lang.Long maxAverageCpmBidAmountMicros) {
    this.maxAverageCpmBidAmountMicros = maxAverageCpmBidAmountMicros;
    return this;
  }

  /**
   * Required. The type of the performance goal that the bidding strategy tries to minimize while
   * spending the full budget. `BIDDING_STRATEGY_PERFORMANCE_GOAL_TYPE_VIEWABLE_CPM` is not
   * supported for this strategy.
   * @return value or {@code null} for none
   */
  public java.lang.String getPerformanceGoalType() {
    return performanceGoalType;
  }

  /**
   * Required. The type of the performance goal that the bidding strategy tries to minimize while
   * spending the full budget. `BIDDING_STRATEGY_PERFORMANCE_GOAL_TYPE_VIEWABLE_CPM` is not
   * supported for this strategy.
   * @param performanceGoalType performanceGoalType or {@code null} for none
   */
  public MaximizeSpendBidStrategy setPerformanceGoalType(java.lang.String performanceGoalType) {
    this.performanceGoalType = performanceGoalType;
    return this;
  }

  /**
   * Whether the strategy takes deal floor prices into account.
   * @return value or {@code null} for none
   */
  public java.lang.Boolean getRaiseBidForDeals() {
    return raiseBidForDeals;
  }

  /**
   * Whether the strategy takes deal floor prices into account.
   * @param raiseBidForDeals raiseBidForDeals or {@code null} for none
   */
  public MaximizeSpendBidStrategy setRaiseBidForDeals(java.lang.Boolean raiseBidForDeals) {
    this.raiseBidForDeals = raiseBidForDeals;
    return this;
  }

  @Override
  public MaximizeSpendBidStrategy set(String fieldName, Object value) {
    return (MaximizeSpendBidStrategy) super.set(fieldName, value);
  }

  @Override
  public MaximizeSpendBidStrategy clone() {
    return (MaximizeSpendBidStrategy) super.clone();
  }

}


text:
cask "baidunetdisk" do
  version "4.10.1"
  sha256 "f6608a58a42890c5d74175a3594330d70644484efaffad59f989199610eaf01f"

  url "https://issuepcdn.baidupcs.com/issue/netdisk/MACguanjia/BaiduNetdisk_mac_#{version}.dmg",
      verified: "issuepcdn.baidupcs.com/issue/netdisk/MACguanjia/"
  name "Baidu NetDisk"
  name "百度网盘"
  desc "Cloud storage service"
  homepage "https://pan.baidu.com/download"

  livecheck do
    url "https://pan.baidu.com/disk/cmsdata?do=client"
    regex(/BaiduNetdisk[._-]mac[._-]v?(\d+(?:\.\d+)+)\.dmg/i)
  end

  auto_updates true

  app "BaiduNetdisk_mac.app"

  zap trash: [
    "~/Library/Application Scripts/com.baidu.BaiduNetdisk-mac.FinderSync",
    "~/Library/Application Support/baidunetdisk",
    "~/Library/Application Support/com.baidu.BaiduNetdisk-mac",
    "~/Library/Caches/com.baidu.BaiduNetdisk-mac",
    "~/Library/Caches/com.plausiblelabs.crashreporter.data/com.baidu.BaiduNetdisk-mac",
    "~/Library/Containers/com.baidu.BaiduNetdisk-mac.FinderSync",
    "~/Library/Cookies/com.baidu.BaiduNetdisk-mac.binarycookies",
    "~/Library/HTTPStorages/com.baidu.BaiduNetdisk-mac",
    "~/Library/Preferences/com.baidu.BaiduNetdisk-mac.plist",
    "~/Library/sapi/wappass.baidu.com",
    "~/Library/Saved Application State/com.baidu.BaiduNetdisk-mac.savedState",
  ],
      rmdir: [
        "~/Library/Caches/com.plausiblelabs.crashreporter.data",
        "~/Library/sapi",
      ]
end


text:
package com.tesshu.subsonic.client.fx.command.logic;

import com.tesshu.subsonic.client.fx.command.param.PlayQueueEntryParam;

public interface PlayQueueAddLogic extends PlayQueueLogic<PlayQueueEntryParam> {
}


text:
"""
defines class L{mdecl_wrapper_t} that allows to work on set of declarations,
as it was one declaration.

The L{class<mdecl_wrapper_t>} allows user to not write "for" loops within the code.
"""

import os

class call_redirector_t( object ):
    """Internal class used to call some function of objects"""
    def __init__( self, name, decls ):
        """creates call_redirector_t instance.

        @param name: name of method, to be called on every object in C{decls} list
        @param decls: list of objects
        """
        object.__init__( self )
        self.name = name
        self.decls = decls

    def __call__( self, *arguments, **keywords ):
        """calls method C{self.name} on every object within C{self.decls} list"""
        for d in self.decls:
            callable_ = getattr(d, self.name)
            callable_( *arguments, **keywords )

class mdecl_wrapper_t( object ):
    """Multiple declarations wrapper.

    The main purpose of this class is to allow an user to work on many
    declarations, as they were only one single declaration.

    Example:
    mb = module_builder_t( ... )
    #lets say we want to exclude all member functions, that returns reference to int:
    mb.member_functions( return_type='int &' ).exclude()

    "exclude" function will be called on every function that match the criteria.
    """

    def __init__( self, decls ):
        """@param decls: list of declarations to operate on.
        @type decls: list of L{declaration wrappers<decl_wrapper_t>}
        """
        object.__init__( self )
        self.__dict__['declarations'] = decls

    def __nonzero__( self ):
        return bool( self.declarations )

    def __len__( self ):
        """returns the number of declarations"""
        return len( self.declarations )

    def __getitem__( self, index ):
        """provides access to declaration"""
        return self.declarations[index]

    def __iter__( self ):
        return iter(self.declarations)

    def __ensure_attribute( self, name ):
        invalid_decls = filter( lambda d: not hasattr( d, name ), self.declarations )
        sep = os.linesep + '    '
        if invalid_decls:
            raise RuntimeError( "Next declarations don't have '%s' attribute: %s"
                                % ( name, sep.join( map( str, invalid_decls ) ) ) )

    def __setattr__( self, name, value ):
        """Updates the value of attribute on all declarations.
        @param name: name of attribute
        @param value: new value of attribute
        """
        self.__ensure_attribute( name )
        for d in self.declarations:
            setattr( d, name, value )

    def __getattr__( self, name ):
        """@param name: name of method
        """
        return call_redirector_t( name, self.declarations )

    def __contains__( self, item ):
        return item in self.declarations

    def to_list(self):
        l = []
        for d in self.declarations:
            l.append( d )
        return l


text:
  Grignan est
      une ville localisée dans le département de Drôme en Rhône-Alpes. Elle totalisait 1 464 habitants en 2008.

À Grignan, la valeur moyenne à l'achat d'un appartement s'évalue à 1 704 € du m² en vente. La valeur moyenne d'une maison à l'achat se situe à 2 339 € du m². À la location la valeur moyenne se situe à 6,4 € du m² par mois.

À proximité de Grignan sont situées les communes de
Salles-sous-Bois localisée à 4 km, 205 habitants,
Chantemerle-lès-Grignan localisée à 6 km, 214 habitants,
Colonzelle à 3 km, 474 habitants,
Grillon localisée à 3 km, 1 700 habitants,
Valréas localisée à 7 km, 9 732 habitants,
Montjoyer à 7 km, 275 habitants,
 entre autres. De plus, Grignan est située à seulement 19 km de Montélimar.

La commune propose de nombreux  aménagements, elle dispose, entre autres, de un bassin de natation, un terrain de tennis, un équipement de cyclisme et deux boucles de randonnée.

Le nombre d'habitations, à Grignan, se décomposait en 2011 en 194 appartements et 823 maisons soit
 un marché relativement équilibré.