text:
<?xml version="1.0" encoding="utf-8"?>
<geo:GeodesyML gml:id="MAKE00USA" xmlns:gco="http://www.isotc211.org/2005/gco" xmlns:geo="urn:xml-gov-au:icsm:egeodesy:0.4" xmlns:gmd="http://www.isotc211.org/2005/gmd" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <geo:siteLog gml:id="make_20101207.log">
        <geo:formInformation>
            <geo:preparedBy>David Maggert</geo:preparedBy>
            <geo:datePrepared>2010-12-07</geo:datePrepared>
            <geo:reportType>UPDATE</geo:reportType>
        </geo:formInformation>
        <geo:siteIdentification>
            <geo:siteName>Mauna Kea</geo:siteName>
            <geo:fourCharacterID>MKEA</geo:fourCharacterID>
            <geo:monumentInscription>none</geo:monumentInscription>
            <geo:iersDOMESNumber>40477M001</geo:iersDOMESNumber>
            <geo:cdpNumber>none</geo:cdpNumber>
            <geo:monumentDescription codeSpace="urn:ga-gov-au:monument-description-type">STEEL PILLAR</geo:monumentDescription>
            <geo:heightOfTheMonument>1.2</geo:heightOfTheMonument>
            <geo:monumentFoundation>CONCRETE</geo:monumentFoundation>
            <geo:foundationDepth>3.4</geo:foundationDepth>
            <geo:markerDescription>(CHISELLED CROSS/DIVOT/BRASS NAIL/etc)</geo:markerDescription>
            <geo:dateInstalled>1996-08-08</geo:dateInstalled>
            <geo:geologicCharacteristic codeSpace="urn:ga-gov-au:geologic-characteristic-type">(BEDROCK/CLAY/CONGLOMERATE/GRAVEL/SAND/etc)</geo:geologicCharacteristic>
            <geo:bedrockType>(IGNEOUS/METAMORPHIC/SEDIMENTARY)</geo:bedrockType>
            <geo:bedrockCondition>(FRESH/JOINTED/WEATHERED)</geo:bedrockCondition>
            <geo:fractureSpacing>(1-10 cm/11-50 cm/51-200 cm/over 200 cm)</geo:fractureSpacing>
            <geo:faultZonesNearby codeSpace="urn:ga-gov-au:fault-zones-type">(YES/NO/Name of the zone)</geo:faultZonesNearby>
            <geo:notes>(multiple lines) The monument is a 4" steel pipe cemented 11'below ground, protruding 4' above ground. The antenna is mounted to a 3/4" bolt welded to a screw cap on top of the mount.</geo:notes>
        </geo:siteIdentification>
        <geo:siteLocation>
            <geo:city>Mauna Kea</geo:city>
            <geo:state>Hawaii</geo:state>
            <geo:countryCodeISO codeList="http://xml.gov.au/icsm/geodesyml/codelists/country-codes-codelist.xml#GeodesyML_CountryCode" codeListValue="USA" codeSpace="urn:xml-gov-au:icsm:egeodesy:0.4">USA</geo:countryCodeISO>
            <geo:tectonicPlate codeSpace="urn:ga-gov-au:plate-type">Pacific</geo:tectonicPlate>
            <geo:approximatePositionITRF>
                <geo:cartesianPosition>
                    <gml:Point gml:id="itrf_cartesian" srsName="EPSG:7789">
                        <gml:pos>-5464105.249 -2495166.133 2148291.315</gml:pos>
                    </gml:Point>
                </geo:cartesianPosition>
                <geo:geodeticPosition>
                    <gml:Point gml:id="itrf_geodetic" srsName="EPSG:7912">
                        <gml:pos>19.8013550556 -155.456342528 3755.0</gml:pos>
                    </gml:Point>
                </geo:geodeticPosition>
            </geo:approximatePositionITRF>
            <geo:notes></geo:notes>
        </geo:siteLocation>
        <geo:gnssReceiver>
            <geo:GnssReceiver gml:id="gnss-receiver-1">
                <geo:manufacturerSerialNumber>220</geo:manufacturerSerialNumber>
                <geo:igsModelCode codeList="http://xml.gov.au/icsm/geodesyml/codelists/antenna-receiver-codelists.xml#GeodesyML_GNSSReceiverTypeCode" codeListValue="ROGUE SNR-12 RM" codeSpace="urn:xml-gov-au:icsm:egeodesy:0.4">ROGUE SNR-12 RM</geo:igsModelCode>
                <geo:satelliteSystem codeSpace="urn:ga-gov-au:satellite-system-type">GPS</geo:satelliteSystem>
                <geo:firmwareVersion>3.2 LINK 03/09/1995</geo:firmwareVersion>
                <geo:elevationCutoffSetting>4.0</geo:elevationCutoffSetting>
                <geo:dateInstalled>1996-08-08T00:00:00Z</geo:dateInstalled>
                <geo:dateRemoved>1999-03-03T00:00:00Z</geo:dateRemoved>
                <geo:temperatureStabilization xsi:nil="true"></geo:temperatureStabilization>
            </geo:GnssReceiver>
            <geo:dateInserted>1996-08-08T00:00:00Z</geo:dateInserted>
        </geo:gnssReceiver>
        <geo:gnssReceiver>
            <geo:GnssReceiver gml:id="gnss-receiver-2">
                <geo:manufacturerSerialNumber>220</geo:manufacturerSerialNumber>
                <geo:igsModelCode codeList="http://xml.gov.au/icsm/geodesyml/codelists/antenna-receiver-codelists.xml#GeodesyML_GNSSReceiverTypeCode" codeListValue="ROGUE SNR-12 RM" codeSpace="urn:xml-gov-au:icsm:egeodesy:0.4">ROGUE SNR-12 RM</geo:igsModelCode>
                <geo:satelliteSystem codeSpace="urn:ga-gov-au:satellite-system-type">GPS</geo:satelliteSystem>
                <geo:firmwareVersion>0.9 LINK 02/23/1999</geo:firmwareVersion>
                <geo:elevationCutoffSetting>4.0</geo:elevationCutoffSetting>
                <geo:dateInstalled>1999-03-03T00:00:00Z</geo:dateInstalled>
                <geo:dateRemoved>1999-03-18T00:00:00Z</geo:dateRemoved>
                <geo:temperatureStabilization xsi:nil="true"></geo:temperatureStabilization>
            </geo:GnssReceiver>
            <geo:dateInserted>1999-03-03T00:00:00Z</geo:dateInserted>
        </geo:gnssReceiver>
        <geo:gnssReceiver>
            <geo:GnssReceiver gml:id="gnss-receiver-3">
                <geo:manufacturerSerialNumber>220</geo:manufacturerSerialNumber>
                <geo:igsModelCode codeList="http://xml.gov.au/icsm/geodesyml/codelists/antenna-receiver-codelists.xml#GeodesyML_GNSSReceiverTypeCode" codeListValue="ROGUE SNR-12 RM" codeSpace="urn:xml-gov-au:icsm:egeodesy:0.4">ROGUE SNR-12 RM</geo:igsModelCode>
                <geo:satelliteSystem codeSpace="urn:ga-gov-au:satellite-system-type">GPS</geo:satelliteSystem>
                <geo:firmwareVersion>3.3 LINK</geo:firmwareVersion>
                <geo:elevationCutoffSetting>4.0</geo:elevationCutoffSetting>
                <geo:dateInstalled>1999-03-18T00:00:00Z</geo:dateInstalled>
                <geo:dateRemoved>1999-06-14T00:00:00Z</geo:dateRemoved>
                <geo:temperatureStabilization xsi:nil="true"></geo:temperatureStabilization>
            </geo:GnssReceiver>
            <geo:dateInserted>1999-03-18T00:00:00Z</geo:dateInserted>
        </geo:gnssReceiver>
        <geo:gnssReceiver>
            <geo:GnssReceiver gml:id="gnss-receiver-4">
                <geo:manufacturerSerialNumber>220</geo:manufacturerSerialNumber>
                <geo:igsModelCode codeList="http://xml.gov.au/icsm/geodesyml/codelists/antenna-receiver-codelists.xml#GeodesyML_GNSSReceiverTypeCode" codeListValue="ROGUE SNR-12 RM" codeSpace="urn:xml-gov-au:icsm:egeodesy:0.4">ROGUE SNR-12 RM</geo:igsModelCode>
                <geo:satelliteSystem codeSpace="urn:ga-gov-au:satellite-system-type">GPS</geo:satelliteSystem>
                <geo:firmwareVersion>3.2.32.8</geo:firmwareVersion>
                <geo:elevationCutoffSetting>4.0</geo:elevationCutoffSetting>
                <geo:dateInstalled>1999-06-14T00:00:00Z</geo:dateInstalled>
                <geo:dateRemoved>2000-04-26T00:00:00Z</geo:dateRemoved>
                <geo:temperatureStabilization xsi:nil="true"></geo:temperatureStabilization>
            </geo:GnssReceiver>
            <geo:dateInserted>1999-06-14T00:00:00Z</geo:dateInserted>
        </geo:gnssReceiver>
        <geo:gnssReceiver>
            <geo:GnssReceiver gml:id="gnss-receiver-5">
                <geo:notes>samplerate - 1s offload format - soc conversion to 30s - soc2rnx</geo:notes>
                <geo:manufacturerSerialNumber>LP019991617</geo:manufacturerSerialNumber>
                <geo:igsModelCode codeList="http://xml.gov.au/icsm/geodesyml/codelists/antenna-receiver-codelists.xml#GeodesyML_GNSSReceiverTypeCode" codeListValue="ASHTECH Z-XII3" codeSpace="urn:xml-gov-au:icsm:egeodesy:0.4">ASHTECH Z-XII3</geo:igsModelCode>
                <geo:satelliteSystem codeSpace="urn:ga-gov-au:satellite-system-type">GPS</geo:satelliteSystem>
                <geo:firmwareVersion>CC00 1s soc2rnx</geo:firmwareVersion>
                <geo:elevationCutoffSetting>4.0</geo:elevationCutoffSetting>
                <geo:dateInstalled>2000-04-26T00:00:00Z</geo:dateInstalled>
                <geo:dateRemoved>2008-11-03T21:30:00Z</geo:dateRemoved>
                <geo:temperatureStabilization xsi:nil="true"></geo:temperatureStabilization>
            </geo:GnssReceiver>
            <geo:dateInserted>2000-04-26T00:00:00Z</geo:dateInserted>
        </geo:gnssReceiver>
        <geo:gnssReceiver>
            <geo:GnssReceiver gml:id="gnss-receiver-6">
                <geo:manufacturerSerialNumber>IR2200716006</geo:manufacturerSerialNumber>
                <geo:igsModelCode codeList="http://xml.gov.au/icsm/geodesyml/codelists/antenna-receiver-codelists.xml#GeodesyML_GNSSReceiverTypeCode" codeListValue="ASHTECH UZ-12" codeSpace="urn:xml-gov-au:icsm:egeodesy:0.4">ASHTECH UZ-12</geo:igsModelCode>
                <geo:satelliteSystem codeSpace="urn:ga-gov-au:satellite-system-type">GPS</geo:satelliteSystem>
                <geo:firmwareVersion>CQ00</geo:firmwareVersion>
                <geo:elevationCutoffSetting>4.0</geo:elevationCutoffSetting>
                <geo:dateInstalled>2008-11-07T00:00:00Z</geo:dateInstalled>
                <geo:dateRemoved>2010-12-06T22:27:00Z</geo:dateRemoved>
                <geo:temperatureStabilization xsi:nil="true"></geo:temperatureStabilization>
            </geo:GnssReceiver>
            <geo:dateInserted>2008-11-07T00:00:00Z</geo:dateInserted>
        </geo:gnssReceiver>
        <geo:gnssReceiver>
            <geo:GnssReceiver gml:id="gnss-receiver-7">
                <geo:manufacturerSerialNumber>IR2200714001</geo:manufacturerSerialNumber>
                <geo:igsModelCode codeList="http://xml.gov.au/icsm/geodesyml/codelists/antenna-receiver-codelists.xml#GeodesyML_GNSSReceiverTypeCode" codeListValue="ASHTECH UZ-12" codeSpace="urn:xml-gov-au:icsm:egeodesy:0.4">ASHTECH UZ-12</geo:igsModelCode>
                <geo:satelliteSystem codeSpace="urn:ga-gov-au:satellite-system-type">GPS</geo:satelliteSystem>
                <geo:firmwareVersion>CQ00</geo:firmwareVersion>
                <geo:elevationCutoffSetting>4.0</geo:elevationCutoffSetting>
                <geo:dateInstalled>2010-12-06T22:27:00Z</geo:dateInstalled>
                <geo:dateRemoved></geo:dateRemoved>
                <geo:temperatureStabilization xsi:nil="true"></geo:temperatureStabilization>
            </geo:GnssReceiver>
            <geo:dateInserted>2010-12-06T22:27:00Z</geo:dateInserted>
        </geo:gnssReceiver>
        <geo:gnssAntenna>
            <geo:GnssAntenna gml:id="gnss-antenna-1">
                <geo:notes>The existing 2X1 powered splitter was on May 13, 2010 with another powered splitter of the same type. The UNAVCO ID is 71281.</geo:notes>
                <geo:manufacturerSerialNumber>482</geo:manufacturerSerialNumber>
                <geo:igsModelCode codeList="http://xml.gov.au/icsm/geodesyml/codelists/antenna-receiver-codelists.xml#GeodesyML_GNSSAntennaTypeCode" codeListValue="AOAD/M_T NONE" codeSpace="urn:xml-gov-au:icsm:egeodesy:0.4">AOAD/M_T        NONE</geo:igsModelCode>
                <geo:antennaReferencePoint codeSpace="urn:ga-gov-au:antenna-reference-point-type">BPA</geo:antennaReferencePoint>
                <geo:marker-arpUpEcc.>0.006</geo:marker-arpUpEcc.>
                <geo:marker-arpNorthEcc.>0.0</geo:marker-arpNorthEcc.>
                <geo:marker-arpEastEcc.>0.0</geo:marker-arpEastEcc.>
                <geo:alignmentFromTrueNorth xsi:nil="true"></geo:alignmentFromTrueNorth>
                <geo:antennaRadomeType codeSpace="urn:igs-org:gnss-radome-model-code">NONE</geo:antennaRadomeType>
                <geo:radomeSerialNumber></geo:radomeSerialNumber>
                <geo:antennaCableType>(vendor & type number)</geo:antennaCableType>
                <geo:antennaCableLength xsi:nil="true"></geo:antennaCableLength>
                <geo:dateInstalled>1996-08-08T00:00:00Z</geo:dateInstalled>
                <geo:dateRemoved></geo:dateRemoved>
            </geo:GnssAntenna>
            <geo:dateInserted>1996-08-08T00:00:00Z</geo:dateInserted>
        </geo:gnssAntenna>
        <geo:surveyedLocalTie>
            <geo:SurveyedLocalTie gml:id="local-tie-1">
                <geo:tiedMarkerName>none</geo:tiedMarkerName>
                <geo:tiedMarkerUsage>(SLR/VLBI/LOCAL CONTROL/FOOTPRINT/etc)</geo:tiedMarkerUsage>
                <geo:tiedMarkerCDPNumber></geo:tiedMarkerCDPNumber>
                <geo:tiedMarkerDOMESNumber></geo:tiedMarkerDOMESNumber>
                <geo:differentialComponentsGNSSMarkerToTiedMonumentITRS>
                    <geo:dx xsi:nil="true"></geo:dx>
                    <geo:dy xsi:nil="true"></geo:dy>
                    <geo:dz xsi:nil="true"></geo:dz>
                </geo:differentialComponentsGNSSMarkerToTiedMonumentITRS>
                <geo:localSiteTiesAccuracy>0.0</geo:localSiteTiesAccuracy>
                <geo:surveyMethod>(GPS CAMPAIGN/TRILATERATION/TRIANGULATION/etc)</geo:surveyMethod>
                <geo:dateMeasured></geo:dateMeasured>
                <geo:notes></geo:notes>
            </geo:SurveyedLocalTie>
            <geo:dateInserted></geo:dateInserted>
        </geo:surveyedLocalTie>
        <geo:frequencyStandard>
            <geo:FrequencyStandard gml:id="frequency-standard-1">
                <geo:standardType codeSpace="urn:ga-gov-au:frequency-standard-type">INTERNAL</geo:standardType>
                <geo:inputFrequency>5.0</geo:inputFrequency>
                <gml:validTime>
                    <gml:TimePeriod gml:id="frequency-standard-1--time-period-1">
                        <gml:beginPosition>2000-04-26</gml:beginPosition>
                        <gml:endPosition></gml:endPosition>
                    </gml:TimePeriod>
                </gml:validTime>
                <geo:notes>clock steering enabled</geo:notes>
            </geo:FrequencyStandard>
            <geo:dateInserted>2000-04-26</geo:dateInserted>
        </geo:frequencyStandard>
        <geo:collocationInformation>
            <geo:CollocationInformation gml:id="instrumentation-type-1">
                <geo:instrumentationType codeSpace="urn:ga-gov-au:instrumentation-type">none</geo:instrumentationType>
                <geo:status codeSpace="urn:ga-gov-au:status-type"></geo:status>
                <gml:validTime>
                    <gml:TimePeriod gml:id="instrumentation-type-1--time-period-2">
                        <gml:beginPosition></gml:beginPosition>
                        <gml:endPosition></gml:endPosition>
                    </gml:TimePeriod>
                </gml:validTime>
                <geo:notes></geo:notes>
            </geo:CollocationInformation>
            <geo:dateInserted></geo:dateInserted>
        </geo:collocationInformation>
        <geo:humiditySensor>
            <geo:HumiditySensor gml:id="humidity-sensor-1">
                <geo:type codeSpace="urn:ga-gov-au:humidity-sensor-type">none</geo:type>
                <geo:manufacturer></geo:manufacturer>
                <geo:serialNumber></geo:serialNumber>
                <geo:heightDiffToAntenna>0.0</geo:heightDiffToAntenna>
                <geo:calibrationDate></geo:calibrationDate>
                <gml:validTime>
                    <gml:TimePeriod gml:id="humidity-sensor-1--time-period-1">
                        <gml:beginPosition></gml:beginPosition>
                        <gml:endPosition></gml:endPosition>
                    </gml:TimePeriod>
                </gml:validTime>
                <geo:dataSamplingInterval>0.0</geo:dataSamplingInterval>
                <geo:accuracy-percentRelativeHumidity>0.0</geo:accuracy-percentRelativeHumidity>
                <geo:aspiration>(UNASPIRATED/NATURAL/FAN/etc)</geo:aspiration>
            </geo:HumiditySensor>
            <geo:dateInserted></geo:dateInserted>
        </geo:humiditySensor>
        <geo:pressureSensor>
            <geo:PressureSensor gml:id="pressure-sensor-1">
                <geo:type codeSpace="urn:ga-gov-au:pressure-sensor-type">none</geo:type>
                <geo:manufacturer></geo:manufacturer>
                <geo:serialNumber></geo:serialNumber>
                <geo:heightDiffToAntenna>0.0</geo:heightDiffToAntenna>
                <geo:calibrationDate></geo:calibrationDate>
                <gml:validTime>
                    <gml:TimePeriod gml:id="pressure-sensor-1--time-period-2">
                        <gml:beginPosition></gml:beginPosition>
                        <gml:endPosition></gml:endPosition>
                    </gml:TimePeriod>
                </gml:validTime>
                <geo:dataSamplingInterval>0.0</geo:dataSamplingInterval>
                <geo:accuracy-hPa>0.0</geo:accuracy-hPa>
            </geo:PressureSensor>
            <geo:dateInserted></geo:dateInserted>
        </geo:pressureSensor>
        <geo:temperatureSensor>
            <geo:TemperatureSensor gml:id="temperature-sensor-1">
                <geo:type codeSpace="urn:ga-gov-au:temperature-sensor-type">none</geo:type>
                <geo:manufacturer></geo:manufacturer>
                <geo:serialNumber></geo:serialNumber>
                <geo:heightDiffToAntenna>0.0</geo:heightDiffToAntenna>
                <geo:calibrationDate></geo:calibrationDate>
                <gml:validTime>
                    <gml:TimePeriod gml:id="temperature-sensor-1--time-period-3">
                        <gml:beginPosition></gml:beginPosition>
                        <gml:endPosition></gml:endPosition>
                    </gml:TimePeriod>
                </gml:validTime>
                <geo:dataSamplingInterval>0.0</geo:dataSamplingInterval>
                <geo:accuracy-degreesCelcius>0.0</geo:accuracy-degreesCelcius>
                <geo:aspiration>(UNASPIRATED/NATURAL/FAN/etc)</geo:aspiration>
            </geo:TemperatureSensor>
            <geo:dateInserted></geo:dateInserted>
        </geo:temperatureSensor>
        <geo:waterVaporSensor>
            <geo:WaterVaporSensor gml:id="water-vapor-1">
                <geo:type codeSpace="urn:ga-gov-au:water-vapor-sensor-type">none</geo:type>
                <geo:manufacturer></geo:manufacturer>
                <geo:serialNumber></geo:serialNumber>
                <geo:heightDiffToAntenna>0.0</geo:heightDiffToAntenna>
                <geo:calibrationDate></geo:calibrationDate>
                <gml:validTime>
                    <gml:TimePeriod gml:id="water-vapor-1--time-period-4">
                        <gml:beginPosition></gml:beginPosition>
                        <gml:endPosition></gml:endPosition>
                    </gml:TimePeriod>
                </gml:validTime>
                <geo:distanceToAntenna>0.0</geo:distanceToAntenna>
            </geo:WaterVaporSensor>
            <geo:dateInserted></geo:dateInserted>
        </geo:waterVaporSensor>
        <geo:siteContact gml:id="agency-1">
            <gmd:MD_SecurityConstraints>
                <gmd:classification gco:nilReason="missing"/>
            </gmd:MD_SecurityConstraints>
            <gmd:CI_ResponsibleParty>
                <gmd:individualName>
                    <gco:CharacterString>Bill (Lyman)Hancock</gco:CharacterString>
                </gmd:individualName>
                <gmd:organisationName>
                    <gco:CharacterString>NRAO Mauna Kea</gco:CharacterString>
                </gmd:organisationName>
                <gmd:contactInfo>
                    <gmd:CI_Contact>
                        <gmd:phone>
                            <gmd:CI_Telephone>
                                <gmd:voice>
                                    <gco:CharacterString>808-935-6719</gco:CharacterString>
                                </gmd:voice>
                                <gmd:voice>
                                    <gco:CharacterString></gco:CharacterString>
                                </gmd:voice>
                                <gmd:facsimile>
                                    <gco:CharacterString></gco:CharacterString>
                                </gmd:facsimile>
                            </gmd:CI_Telephone>
                        </gmd:phone>
                        <gmd:address>
                            <gmd:CI_Address>
                                <gmd:deliveryPoint>
                                    <gco:CharacterString>VLBA Station P.O. Box 7050 Kamusla,Hawaii USA   96743</gco:CharacterString>
                                </gmd:deliveryPoint>
                                <gmd:city>
                                    <gco:CharacterString></gco:CharacterString>
                                </gmd:city>
                                <gmd:postalCode>
                                    <gco:CharacterString></gco:CharacterString>
                                </gmd:postalCode>
                                <gmd:country>
                                    <gco:CharacterString></gco:CharacterString>
                                </gmd:country>
                                <gmd:electronicMailAddress>
                                    <gco:CharacterString>bhancock@aoc.nrao.edu</gco:CharacterString>
                                </gmd:electronicMailAddress>
                            </gmd:CI_Address>
                        </gmd:address>
                    </gmd:CI_Contact>
                </gmd:contactInfo>
                <gmd:role>
                    <gmd:CI_RoleCode codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_RoleCode" codeListValue="pointOfContact"></gmd:CI_RoleCode>
                </gmd:role>
            </gmd:CI_ResponsibleParty>
        </geo:siteContact>
        <geo:siteContact gml:id="agency-2">
            <gmd:MD_SecurityConstraints>
                <gmd:classification gco:nilReason="missing"/>
            </gmd:MD_SecurityConstraints>
            <gmd:CI_ResponsibleParty>
                <gmd:individualName>
                    <gco:CharacterString>Tony Sylvester</gco:CharacterString>
                </gmd:individualName>
                <gmd:organisationName>
                    <gco:CharacterString>NRAO Mauna Kea</gco:CharacterString>
                </gmd:organisationName>
                <gmd:contactInfo>
                    <gmd:CI_Contact>
                        <gmd:phone>
                            <gmd:CI_Telephone>
                                <gmd:voice>
                                    <gco:CharacterString>808-935-6719</gco:CharacterString>
                                </gmd:voice>
                                <gmd:voice>
                                    <gco:CharacterString></gco:CharacterString>
                                </gmd:voice>
                                <gmd:facsimile>
                                    <gco:CharacterString></gco:CharacterString>
                                </gmd:facsimile>
                            </gmd:CI_Telephone>
                        </gmd:phone>
                        <gmd:address>
                            <gmd:CI_Address>
                                <gmd:deliveryPoint>
                                    <gco:CharacterString>VLBA Station P.O. Box 7050 Kamusla,Hawaii USA   96743</gco:CharacterString>
                                </gmd:deliveryPoint>
                                <gmd:city>
                                    <gco:CharacterString></gco:CharacterString>
                                </gmd:city>
                                <gmd:postalCode>
                                    <gco:CharacterString></gco:CharacterString>
                                </gmd:postalCode>
                                <gmd:country>
                                    <gco:CharacterString></gco:CharacterString>
                                </gmd:country>
                                <gmd:electronicMailAddress>
                                    <gco:CharacterString>tsylvest@aoc.nrao.edu</gco:CharacterString>
                                </gmd:electronicMailAddress>
                            </gmd:CI_Address>
                        </gmd:address>
                    </gmd:CI_Contact>
                </gmd:contactInfo>
                <gmd:role>
                    <gmd:CI_RoleCode codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_RoleCode" codeListValue="pointOfContact"></gmd:CI_RoleCode>
                </gmd:role>
            </gmd:CI_ResponsibleParty>
        </geo:siteContact>
        <geo:siteMetadataCustodian gml:id="agency-3">
            <gmd:MD_SecurityConstraints>
                <gmd:classification gco:nilReason="missing"/>
            </gmd:MD_SecurityConstraints>
            <gmd:CI_ResponsibleParty>
                <gmd:individualName>
                    <gco:CharacterString>David A.Stowers</gco:CharacterString>
                </gmd:individualName>
                <gmd:organisationName>
                    <gco:CharacterString>Jet Propulsion Laboratory</gco:CharacterString>
                </gmd:organisationName>
                <gmd:contactInfo>
                    <gmd:CI_Contact>
                        <gmd:phone>
                            <gmd:CI_Telephone>
                                <gmd:voice>
                                    <gco:CharacterString>818-354-7055</gco:CharacterString>
                                </gmd:voice>
                                <gmd:voice>
                                    <gco:CharacterString>818-354-2950</gco:CharacterString>
                                </gmd:voice>
                                <gmd:facsimile>
                                    <gco:CharacterString>818-393-4965</gco:CharacterString>
                                </gmd:facsimile>
                            </gmd:CI_Telephone>
                        </gmd:phone>
                        <gmd:address>
                            <gmd:CI_Address>
                                <gmd:deliveryPoint>
                                    <gco:CharacterString>4800 Oak Grove Drive Pasadena,CA USA  91109</gco:CharacterString>
                                </gmd:deliveryPoint>
                                <gmd:city>
                                    <gco:CharacterString></gco:CharacterString>
                                </gmd:city>
                                <gmd:postalCode>
                                    <gco:CharacterString></gco:CharacterString>
                                </gmd:postalCode>
                                <gmd:country>
                                    <gco:CharacterString></gco:CharacterString>
                                </gmd:country>
                                <gmd:electronicMailAddress>
                                    <gco:CharacterString>dstowers@jpl.nasa.gov</gco:CharacterString>
                                </gmd:electronicMailAddress>
                            </gmd:CI_Address>
                        </gmd:address>
                    </gmd:CI_Contact>
                </gmd:contactInfo>
                <gmd:role>
                    <gmd:CI_RoleCode codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_RoleCode" codeListValue="pointOfContact"></gmd:CI_RoleCode>
                </gmd:role>
            </gmd:CI_ResponsibleParty>
        </geo:siteMetadataCustodian>
        <geo:moreInformation>
            <geo:dataCenter>JPL (ODC-Operational Data Center)</geo:dataCenter>
            <geo:dataCenter>CDDIS (GDC-Global Data Center)</geo:dataCenter>
            <geo:urlForMoreInformation></geo:urlForMoreInformation>
            <geo:siteMap>(Y or URL)</geo:siteMap>
            <geo:siteDiagram>Y</geo:siteDiagram>
            <geo:horizonMask>(Y or URL)</geo:horizonMask>
            <geo:monumentDescription>Y</geo:monumentDescription>
            <geo:sitePictures>Y</geo:sitePictures>
            <geo:notes></geo:notes>
            <geo:antennaGraphicsWithDimensions></geo:antennaGraphicsWithDimensions>
            <geo:insertTextGraphicFromAntenna></geo:insertTextGraphicFromAntenna>
            <geo:DOI codeSpace="urn:ga-gov-au:self.moreInformation-type">TODO</geo:DOI>
        </geo:moreInformation>
    </geo:siteLog>
</geo:GeodesyML>


text:
<?php
	$presenter = new Fly\Pagination\BootstrapPresenter($paginator);
?>

<?php if ($paginator->getLastPage() > 1): ?>

			<?php echo $presenter->render(); ?>

<?php endif; ?>

redpajama_set_name: RedPajamaGithub


text:
function Add-VSConfigConformancePackConformancePackInputParameter {
    <#
    .SYNOPSIS
        Adds an AWS::Config::ConformancePack.ConformancePackInputParameter resource property to the template. Input parameters in the form of key-value pairs for the conformance pack, both of which you define. Keys can have a maximum character length of 255 characters, and values can have a maximum length of 4096 characters.

    .DESCRIPTION
        Adds an AWS::Config::ConformancePack.ConformancePackInputParameter resource property to the template.
Input parameters in the form of key-value pairs for the conformance pack, both of which you define. Keys can have a maximum character length of 255 characters, and values can have a maximum length of 4096 characters.

    .LINK
        http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-config-conformancepack-conformancepackinputparameter.html

    .PARAMETER ParameterName
        One part of a key-value pair.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-config-conformancepack-conformancepackinputparameter.html#cfn-config-conformancepack-conformancepackinputparameter-parametername
        UpdateType: Mutable
        PrimitiveType: String

    .PARAMETER ParameterValue
        Another part of the key-value pair.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-config-conformancepack-conformancepackinputparameter.html#cfn-config-conformancepack-conformancepackinputparameter-parametervalue
        UpdateType: Mutable
        PrimitiveType: String

    .FUNCTIONALITY
        Vaporshell
    #>
    [OutputType('Vaporshell.Resource.Config.ConformancePack.ConformancePackInputParameter')]
    [cmdletbinding()]
    Param
    (
        [parameter(Mandatory = $true)]
        [ValidateScript( {
                $allowedTypes = "System.String","Vaporshell.Function","Vaporshell.Condition"
                if ([string]$($_.PSTypeNames) -match "($(($allowedTypes|ForEach-Object{[RegEx]::Escape($_)}) -join '|'))") {
                    $true
                }
                else {
                    $PSCmdlet.ThrowTerminatingError((New-VSError -String "This parameter only accepts the following types: $($allowedTypes -join ", "). The current types of the value are: $($_.PSTypeNames -join ", ")."))
                }
            })]
        $ParameterName,
        [parameter(Mandatory = $true)]
        [ValidateScript( {
                $allowedTypes = "System.String","Vaporshell.Function","Vaporshell.Condition"
                if ([string]$($_.PSTypeNames) -match "($(($allowedTypes|ForEach-Object{[RegEx]::Escape($_)}) -join '|'))") {
                    $true
                }
                else {
                    $PSCmdlet.ThrowTerminatingError((New-VSError -String "This parameter only accepts the following types: $($allowedTypes -join ", "). The current types of the value are: $($_.PSTypeNames -join ", ")."))
                }
            })]
        $ParameterValue
    )
    Begin {
        $obj = [PSCustomObject]@{}
        $commonParams = @('Verbose','Debug','ErrorAction','WarningAction','InformationAction','ErrorVariable','WarningVariable','InformationVariable','OutVariable','OutBuffer','PipelineVariable')
    }
    Process {
        foreach ($key in $PSBoundParameters.Keys | Where-Object {$commonParams -notcontains $_}) {
            switch ($key) {
                Default {
                    $obj | Add-Member -MemberType NoteProperty -Name $key -Value $PSBoundParameters.$key
                }
            }
        }
    }
    End {
        $obj | Add-ObjectDetail -TypeName 'Vaporshell.Resource.Config.ConformancePack.ConformancePackInputParameter'
        Write-Verbose "Resulting JSON from $($MyInvocation.MyCommand): `n`n$($obj | ConvertTo-Json -Depth 5)`n"
    }
}


text:
package snapshot

import (
	"net/http"

	"github.com/akutz/goof"
	"github.com/thecodeteam/rexray/libstorage/api/context"
	"github.com/thecodeteam/rexray/libstorage/api/server/httputils"
	"github.com/thecodeteam/rexray/libstorage/api/server/router/volume"
	"github.com/thecodeteam/rexray/libstorage/api/server/services"
	"github.com/thecodeteam/rexray/libstorage/api/types"
	"github.com/thecodeteam/rexray/libstorage/api/utils"
	"github.com/thecodeteam/rexray/libstorage/api/utils/schema"
)

func (r *router) snapshots(
	ctx types.Context,
	w http.ResponseWriter,
	req *http.Request,
	store types.Store) error {

	var (
		tasks   = map[string]*types.Task{}
		taskIDs []int
		reply   = types.ServiceSnapshotMap{}
	)

	for service := range services.StorageServices(ctx) {

		run := func(
			ctx types.Context,
			svc types.StorageService) (interface{}, error) {

			ctx = context.WithStorageService(ctx, svc)
			var err error
			if ctx, err = context.WithStorageSession(ctx); err != nil {
				return nil, err
			}

			objs, err := svc.Driver().Snapshots(ctx, store)
			if err != nil {
				return nil, err
			}

			objMap := map[string]*types.Snapshot{}
			for _, obj := range objs {
				objMap[obj.ID] = obj
			}
			return objMap, nil
		}

		task := service.TaskEnqueue(ctx, run, schema.SnapshotMapSchema)
		taskIDs = append(taskIDs, task.ID)
		tasks[service.Name()] = task
	}

	run := func(ctx types.Context) (interface{}, error) {

		services.TaskWaitAll(ctx, taskIDs...)

		for k, v := range tasks {
			if v.Error != nil {
				return nil, utils.NewBatchProcessErr(reply, v.Error)
			}

			objMap, ok := v.Result.(map[string]*types.Snapshot)
			if !ok {
				return nil, utils.NewBatchProcessErr(
					reply, goof.New("error casting to []*types.Snapshot"))
			}
			reply[k] = objMap
		}

		return reply, nil
	}

	return httputils.WriteTask(
		ctx,
		r.config,
		w,
		store,
		services.TaskEnqueue(ctx, run, schema.ServiceSnapshotMapSchema),
		http.StatusOK)
}

func (r *router) snapshotsForService(
	ctx types.Context,
	w http.ResponseWriter,
	req *http.Request,
	store types.Store) error {

	service := context.MustService(ctx)

	run := func(
		ctx types.Context,
		svc types.StorageService) (interface{}, error) {

		var reply types.SnapshotMap = map[string]*types.Snapshot{}

		objs, err := svc.Driver().Snapshots(ctx, store)
		if err != nil {
			return nil, err
		}

		for _, obj := range objs {
			reply[obj.ID] = obj
		}
		return reply, nil
	}

	return httputils.WriteTask(
		ctx,
		r.config,
		w,
		store,
		service.TaskEnqueue(ctx, run, schema.SnapshotMapSchema),
		http.StatusOK)
}

func (r *router) snapshotInspect(
	ctx types.Context,
	w http.ResponseWriter,
	req *http.Request,
	store types.Store) error {

	service := context.MustService(ctx)

	run := func(
		ctx types.Context,
		svc types.StorageService) (interface{}, error) {

		return svc.Driver().SnapshotInspect(
			ctx,
			store.GetString("snapshotID"),
			store)
	}

	return httputils.WriteTask(
		ctx,
		r.config,
		w,
		store,
		service.TaskEnqueue(ctx, run, schema.SnapshotSchema),
		http.StatusOK)
}

func (r *router) snapshotRemove(
	ctx types.Context,
	w http.ResponseWriter,
	req *http.Request,
	store types.Store) error {

	service := context.MustService(ctx)

	run := func(
		ctx types.Context,
		svc types.StorageService) (interface{}, error) {

		return nil, svc.Driver().SnapshotRemove(
			ctx,
			store.GetString("snapshotID"),
			store)
	}

	return httputils.WriteTask(
		ctx,
		r.config,
		w,
		store,
		service.TaskEnqueue(ctx, run, nil),
		http.StatusResetContent)
}

func (r *router) volumeCreate(
	ctx types.Context,
	w http.ResponseWriter,
	req *http.Request,
	store types.Store) error {

	service := context.MustService(ctx)

	run := func(
		ctx types.Context,
		svc types.StorageService) (interface{}, error) {

		v, err := svc.Driver().VolumeCreateFromSnapshot(
			ctx,
			store.GetString("snapshotID"),
			store.GetString("name"),
			&types.VolumeCreateOpts{
				AvailabilityZone: store.GetStringPtr("availabilityZone"),
				IOPS:             store.GetInt64Ptr("iops"),
				Size:             store.GetInt64Ptr("size"),
				Type:             store.GetStringPtr("type"),
				Opts:             store,
			})

		if err != nil {
			return nil, err
		}

		if volume.OnVolume != nil {
			ok, err := volume.OnVolume(ctx, req, store, v)
			if err != nil {
				return nil, err
			}
			if !ok {
				return nil, utils.NewNotFoundError(v.ID)
			}
		}

		return v, nil
	}

	return httputils.WriteTask(
		ctx,
		r.config,
		w,
		store,
		service.TaskEnqueue(ctx, run, schema.VolumeSchema),
		http.StatusCreated)
}

func (r *router) snapshotCopy(
	ctx types.Context,
	w http.ResponseWriter,
	req *http.Request,
	store types.Store) error {

	service := context.MustService(ctx)

	run := func(
		ctx types.Context,
		svc types.StorageService) (interface{}, error) {

		return svc.Driver().SnapshotCopy(
			ctx,
			store.GetString("snapshotID"),
			store.GetString("snapshotName"),
			store.GetString("destinationID"),
			store)
	}

	return httputils.WriteTask(
		ctx,
		r.config,
		w,
		store,
		service.TaskEnqueue(ctx, run, schema.SnapshotSchema),
		http.StatusCreated)
}


text:
package io.getunleash.lang;

import java.lang.annotation.*;
import javax.annotation.Nonnull;
import javax.annotation.meta.TypeQualifierDefault;

@Retention(RetentionPolicy.RUNTIME)
@Documented
@Nonnull
@TypeQualifierDefault({ElementType.PARAMETER, ElementType.METHOD})
@Target({ElementType.PACKAGE, ElementType.TYPE})
public @interface NonNullApi {}


text:
namespace Extension_Methods_Delegates_Lambda_LINQ
{
    using System;
    using System.Threading;

    public class Timer
    {
        // 07. Using delegates write a class Timer that can execute certain method at each t seconds.
        // the method that help to repeat other method after some time in some duration
        public delegate void MethodToExecute(string message);

        public static void RepeatSomeMethod(MethodToExecute method, int stepInSeconds, long durationInSeconds)
        {
            long secondsCount = 1;

            while (secondsCount <= durationInSeconds)
            {
                method("Seconds: " + secondsCount);
                Thread.Sleep(stepInSeconds * 1000);
                secondsCount += stepInSeconds;
            }
        }

        public static void Print(string message)
        {
            Console.WriteLine(message);
        }
    }
}


text:
package org.apache.carbondata.spark.testsuite.datacompaction

import java.io.{File, PrintWriter}

import scala.util.Random

import org.apache.spark.sql.test.util.QueryTest
import org.scalatest.{BeforeAndAfterAll, BeforeAndAfterEach}

import org.apache.carbondata.core.constants.CarbonCommonConstants
import org.apache.carbondata.core.util.CarbonProperties

class CompactionSupportGlobalSortBigFileTest
  extends QueryTest with BeforeAndAfterEach with BeforeAndAfterAll {
  val file1 = resourcesPath + "/compaction/fil1.csv"
  val file2 = resourcesPath + "/compaction/fil2.csv"
  val file3 = resourcesPath + "/compaction/fil3.csv"
  val file4 = resourcesPath + "/compaction/fil4.csv"
  val file5 = resourcesPath + "/compaction/fil5.csv"

  override protected def beforeAll(): Unit = {
    resetConf("10")
    // n should be about 5000000 of reset if size is default 1024
    val n = 150000
    CompactionSupportGlobalSortBigFileTest.createFile(file1, n, 0)
    CompactionSupportGlobalSortBigFileTest.createFile(file2, n * 4, n)
    CompactionSupportGlobalSortBigFileTest.createFile(file3, n * 3, n * 5)
    CompactionSupportGlobalSortBigFileTest.createFile(file4, n * 2, n * 8)
    CompactionSupportGlobalSortBigFileTest.createFile(file5, n * 2, n * 13)
  }

  override protected def afterAll(): Unit = {
    CompactionSupportGlobalSortBigFileTest.deleteFile(file1)
    CompactionSupportGlobalSortBigFileTest.deleteFile(file2)
    CompactionSupportGlobalSortBigFileTest.deleteFile(file3)
    CompactionSupportGlobalSortBigFileTest.deleteFile(file4)
    CompactionSupportGlobalSortBigFileTest.deleteFile(file5)
    resetConf(CarbonCommonConstants.DEFAULT_CARBON_MAJOR_COMPACTION_SIZE)
  }

  override def beforeEach {
    sql("DROP TABLE IF EXISTS compaction_globalsort")
    sql(
      """
        | CREATE TABLE compaction_globalsort(id INT, name STRING, city STRING, age INT)
        | STORED AS carbondata
        | TBLPROPERTIES('SORT_COLUMNS'='city,name', 'SORT_SCOPE'='global_sort')
      """.stripMargin)

    sql("DROP TABLE IF EXISTS carbon_localsort")
    sql(
      """
        | CREATE TABLE carbon_localsort(id INT, name STRING, city STRING, age INT)
        | STORED AS carbondata
      """.stripMargin)
  }

  override def afterEach {
    sql("DROP TABLE IF EXISTS compaction_globalsort")
    sql("DROP TABLE IF EXISTS carbon_localsort")
  }

  test("Compaction major:  segments size is bigger than default compaction size") {
    sql(s"LOAD DATA LOCAL INPATH '$file1' INTO TABLE carbon_localsort OPTIONS('header'='false')")
    sql(s"LOAD DATA LOCAL INPATH '$file2' INTO TABLE carbon_localsort OPTIONS('header'='false')")
    sql(s"LOAD DATA LOCAL INPATH '$file3' INTO TABLE carbon_localsort OPTIONS('header'='false')")
    sql(s"LOAD DATA LOCAL INPATH '$file4' INTO TABLE carbon_localsort OPTIONS('header'='false')")
    sql(s"LOAD DATA LOCAL INPATH '$file5' INTO TABLE carbon_localsort OPTIONS('header'='false')")
    // scalastyle:off lineLength
    sql(s"LOAD DATA LOCAL INPATH '$file1' INTO TABLE compaction_globalsort OPTIONS('header'='false')")
    sql(s"LOAD DATA LOCAL INPATH '$file2' INTO TABLE compaction_globalsort OPTIONS('header'='false')")
    sql(s"LOAD DATA LOCAL INPATH '$file3' INTO TABLE compaction_globalsort OPTIONS('header'='false')")
    sql(s"LOAD DATA LOCAL INPATH '$file4' INTO TABLE compaction_globalsort OPTIONS('header'='false')")
    sql(s"LOAD DATA LOCAL INPATH '$file5' INTO TABLE compaction_globalsort OPTIONS('header'='false')")
    // scalastyle:on lineLength
    sql("ALTER TABLE compaction_globalsort COMPACT 'MAJOR'")
    checkExistence(sql("DESCRIBE FORMATTED compaction_globalsort"), true, "global_sort")

    checkExistence(sql("DESCRIBE FORMATTED compaction_globalsort"), true, "city,name")

    checkExistence(sql("SHOW SEGMENTS FOR TABLE compaction_globalsort"), true, "Compacted")

    checkAnswer(sql("select count(*) from compaction_globalsort"),
      sql("select count(*) from carbon_localsort"))
    val segments = sql("SHOW SEGMENTS FOR TABLE compaction_globalsort")
    val SegmentSequenceIds = segments.collect().map { each => (each.toSeq) (0) }
    assert(SegmentSequenceIds.contains("0.1"))
  }

  private def resetConf(size: String) {
    CarbonProperties.getInstance()
      .addProperty(CarbonCommonConstants.CARBON_MAJOR_COMPACTION_SIZE, size)
  }
}

object CompactionSupportGlobalSortBigFileTest {
  def createFile(fileName: String, line: Int = 10000, start: Int = 0): Boolean = {
    try {
      val write = new PrintWriter(fileName);
      for (i <- start until (start + line)) {
        // scalastyle:off println
        write.println(i + "," + "n" + i + "," + "c" + (i % 10000) + "," + Random.nextInt(80))
        // scalastyle:on println
      }
      write.close()
    } catch {
      case _: Exception => false
    }
    true
  }

  def deleteFile(fileName: String): Boolean = {
    try {
      val file = new File(fileName)
      if (file.exists()) {
        file.delete()
      }
    } catch {
      case _: Exception => false
    }
    true
  }
}


text:
use crate::{
    domains::Transition,
    fa::StateActionUpdate,
    Enumerable,
    Function,
    Handler,
    Parameterised,
};
use std::ops::Index;

#[derive(Clone, Debug)]
#[cfg_attr(
    feature = "serde",
    derive(Serialize, Deserialize),
    serde(crate = "serde_crate")
)]
pub struct Response<R> {
    pub q_res: R,
    pub error: f64,
}

/// Watkins' Q-learning.
///
/// # References
/// - Watkins, C. J. C. H. (1989). Learning from Delayed Rewards. Ph.D. thesis,
/// Cambridge University.
/// - Watkins, C. J. C. H., Dayan, P. (1992). Q-learning. Machine Learning,
/// 8:279–292.
#[derive(Clone, Debug, Parameterised)]
#[cfg_attr(
    feature = "serde",
    derive(Serialize, Deserialize),
    serde(crate = "serde_crate")
)]
pub struct QLearning<Q> {
    #[weights]
    pub q_func: Q,

    pub gamma: f64,
}

impl<'m, S, Q> Handler<&'m Transition<S, usize>> for QLearning<Q>
where
    Q: Enumerable<(&'m S,)> + Handler<StateActionUpdate<&'m S, usize, f64>>,
    <Q as Function<(&'m S,)>>::Output: Index<usize, Output = f64> + IntoIterator<Item = f64>,
    <<Q as Function<(&'m S,)>>::Output as IntoIterator>::IntoIter: ExactSizeIterator,
{
    type Response = Response<Q::Response>;
    type Error = Q::Error;

    fn handle(&mut self, t: &'m Transition<S, usize>) -> Result<Self::Response, Self::Error> {
        let state = t.from.state();
        let qsa = self.q_func.evaluate_index((state,), t.action);

        let error = if t.terminated() {
            t.reward - qsa
        } else {
            let ns = t.to.state();
            let (_, nqsna) = self.q_func.find_max((ns,));

            t.reward + self.gamma * nqsna - qsa
        };

        self.q_func
            .handle(StateActionUpdate {
                state,
                action: t.action,
                error,
            })
            .map(|q_res| Response { q_res, error })
    }
}


text:
.syntaxhighlighter,
.syntaxhighlighter div,
.syntaxhighlighter code,
.syntaxhighlighter table,
.syntaxhighlighter table td,
.syntaxhighlighter table tr,
.syntaxhighlighter table tbody
{
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	outline: 0 !important;
	background: none !important;
	text-align: left !important;
	float: none !important;
	vertical-align: baseline !important;
	position: static !important;
	left: auto !important;
	top: auto !important;
	right: auto !important;
	bottom: auto !important;
	height: auto !important;
	width: auto !important;
	line-height: 1.1em !important;
	font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important;
	font-weight: normal !important;
	font-style: normal !important;
	font-size: 1em !important;
	min-height: inherit !important; /* For IE8, FF & WebKit */
	min-height: auto !important; /* For IE7 */
}

.syntaxhighlighter
{
	width: 99% !important; /* 99% fixes IE8 horizontal scrollbar */
	margin: 1em 0 1em 0 !important;
	padding: 1px !important; /* adds a little border on top and bottom */
	position: relative !important;
}

.syntaxhighlighter .bold
{
	font-weight: bold !important;
}

.syntaxhighlighter .italic
{
	font-style: italic !important;
}

.syntaxhighlighter .line
{
}

.syntaxhighlighter .no-wrap .line .content
{
	white-space: pre !important;
}

.syntaxhighlighter .line table
{
	border-collapse: collapse !important;
}

.syntaxhighlighter .line td
{
	vertical-align: top !important;
}

.syntaxhighlighter .line .number
{
	width: 3em !important;
}

.syntaxhighlighter .line .number code
{
	width: 2.7em !important;
	padding-right: .3em !important;
	text-align: right !important;
	display: block !important;
}

.syntaxhighlighter .line .content
{
	padding-left: .5em !important;
}

.syntaxhighlighter .line .spaces
{
}

/* Disable border and margin on the lines when no gutter option is set */
.syntaxhighlighter.nogutter .line .content
{
	border-left: none !important;
}

.syntaxhighlighter .bar
{
	display: none !important;
}

.syntaxhighlighter .bar.show
{
	display: block !important;
}

.syntaxhighlighter.collapsed .bar
{
	display: block !important;
}

/* Adjust some properties when collapsed */

.syntaxhighlighter.collapsed .lines
{
	display: none !important;
}

.syntaxhighlighter .lines.no-wrap
{
	overflow: auto !important;
	overflow-y: hidden !important;
}

/* Styles for the toolbar */

.syntaxhighlighter .toolbar
{
	position: absolute !important;
	right: 0px !important;
	top: 0px !important;
	font-size: 1px !important;
	padding: 8px 8px 8px 0 !important; /* in px because images don't scale with ems */
}

.syntaxhighlighter.collapsed .toolbar
{
	font-size: 80% !important;
	padding: .2em 0 .5em .5em !important;
	position: static !important;
}

.syntaxhighlighter .toolbar a.item,
.syntaxhighlighter .toolbar .item
{
	display: block !important;
	float: left !important;
	margin-left: 8px !important;
	background-repeat: no-repeat !important;
	overflow: hidden !important;
	text-indent: -5000px !important;
}

.syntaxhighlighter.collapsed .toolbar .item
{
	display: none !important;
}

.syntaxhighlighter.collapsed .toolbar .item.expandSource
{
	background-image: url(magnifier.png) !important;
	display: inline !important;
	text-indent: 0 !important;
	width: auto !important;
	float: none !important;
	height: 16px !important;
	padding-left: 20px !important;
}

.syntaxhighlighter .toolbar .item.viewSource
{
	background-image: url(page_white_code.png) !important;
}

.syntaxhighlighter .toolbar .item.printSource
{
	background-image: url(printer.png) !important;
}

.syntaxhighlighter .toolbar .item.copyToClipboard
{
	text-indent: 0 !important;
	background: none !important;
	overflow: visible !important;
}

.syntaxhighlighter .toolbar .item.about
{
	background-image: url(help.png) !important;
}

/**
 * Print view.
 * Colors are based on the default theme without background.
 */

.syntaxhighlighter.printing,
.syntaxhighlighter.printing .line.alt1 .content,
.syntaxhighlighter.printing .line.alt2 .content,
.syntaxhighlighter.printing .line.highlighted .number,
.syntaxhighlighter.printing .line.highlighted.alt1 .content,
.syntaxhighlighter.printing .line.highlighted.alt2 .content
{
	background: none !important;
}

/* Gutter line numbers */
.syntaxhighlighter.printing .line .number
{
	color: #bbb !important;
}

/* Add border to the lines */
.syntaxhighlighter.printing .line .content
{
	color: #000 !important;
}

/* Toolbar when visible */
.syntaxhighlighter.printing .toolbar
{
	display: none !important;
}

.syntaxhighlighter.printing a
{
	text-decoration: none !important;
}

.syntaxhighlighter.printing .plain,
.syntaxhighlighter.printing .plain a
{
	color: #000 !important;
}

.syntaxhighlighter.printing .comments,
.syntaxhighlighter.printing .comments a
{
	color: #008200 !important;
}

.syntaxhighlighter.printing .string,
.syntaxhighlighter.printing .string a
{
	color: blue !important;
}

.syntaxhighlighter.printing .keyword
{
	color: #069 !important;
	font-weight: bold !important;
}

.syntaxhighlighter.printing .preprocessor
{
	color: gray !important;
}

.syntaxhighlighter.printing .variable
{
	color: #a70 !important;
}

.syntaxhighlighter.printing .value
{
	color: #090 !important;
}

.syntaxhighlighter.printing .functions
{
	color: #ff1493 !important;
}

.syntaxhighlighter.printing .constants
{
	color: #0066CC !important;
}

.syntaxhighlighter.printing .script
{
	font-weight: bold !important;
}

.syntaxhighlighter.printing .color1,
.syntaxhighlighter.printing .color1 a
{
	color: #808080 !important;
}

.syntaxhighlighter.printing .color2,
.syntaxhighlighter.printing .color2 a
{
	color: #ff1493 !important;
}

.syntaxhighlighter.printing .color3,
.syntaxhighlighter.printing .color3 a
{
	color: red !important;
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{#upload.title}</title>

<link rel="stylesheet" type="text/css" href="../../css/index.php?type=im&theme=im&package=core_css" />

{#upload.title}

{#upload.description}

					<form id="uploadForm_0" method="post" action="../../stream/index.php" enctype="multipart/form-data" target="uploadFrame">

							<input type="hidden" name="cmd" value="im.upload" />
							<input type="hidden" name="path" value="" />
							<input type="hidden" name="domain" value="" />

										{#upload.file_to_upload}
										<input id="file0" name="file0" type="file" size="20" class="file required" />

										{#upload.as_file_name}
										<input id="name0" name="name0" type="text" size="42" maxlength="255" class="text required" />

							<input type="submit" name="upload" value="{#upload.button_upload}" class="submit default" />
							<input type="button" id="cancel" name="cancel" value="{#button.cancel}" class="button cancel" />

					</form>

{#upload.choose_files}

								{#upload.file}
								{#upload.size}
								{#upload.status}

 {#upload.add_more}

{#upload.upload_to_server}

 {#upload.abort}


text:
import {GUI} from "dat.gui";
import * as React from "react";
import {Font, FontLoader} from "three";
import "../../fonts/droid/droid_serif_bold.typeface.json";
import "../../fonts/droid/droid_serif_regular.typeface.json";
import "../../fonts/gentilis_bold.typeface.json";
import "../../fonts/gentilis_regular.typeface.json";
import "../../fonts/helvetiker_bold.typeface.json";
import "../../fonts/helvetiker_regular.typeface.json";
import "../../fonts/optimer_bold.typeface.json";
import "../../fonts/optimer_regular.typeface.json";
import {gui} from "../geometry-browser";

interface IState {
  bevelEnabled: boolean;
  bevelSegments: number;
  bevelSize: number;
  bevelThickness: number;
  curveSegments: number;
  font: string;
  height: number;
  loadedFont: Font | undefined;
  size: number;
  text: string;
  weight: string;
}

const fonts = ["helvetiker", "optimer", "gentilis", "droid/droid_serif"];

const weights = ["regular", "bold"];

export class TextGeometry extends React.Component<{}, IState> {
  public state = {
    bevelEnabled: false,
    bevelSegments: 3,
    bevelSize: 0.5,
    bevelThickness: 1,
    curveSegments: 12,
    font: "helvetiker",
    height: 2,
    loadedFont: undefined,
    size: 5,
    text: "TextGeometry",
    weight: "regular",
  };
  public folder: GUI;

  public componentDidMount() {
    this.loadFont();

    this.folder = gui.addFolder("THREE.TextGeometry");

    const data = {
      bevelEnabled: this.state.bevelEnabled,
      bevelSegments: this.state.bevelSegments,
      bevelSize: this.state.bevelSize,
      bevelThickness: this.state.bevelThickness,
      curveSegments: this.state.curveSegments,
      font: this.state.font,
      height: this.state.height,
      size: this.state.size,
      text: this.state.text,
      weight: this.state.weight,
    };

    this.folder.add(data, "text").onChange(() => this.setState({ text: data.text }));
    this.folder.add(data, "size", 1, 30).onChange(() => this.setState({ size: data.size }));
    this.folder.add(data, "height", 1, 20).onChange(() => this.setState({ height: data.height }));
    this.folder
      .add(data, "curveSegments", 1, 20)
      .step(1)
      .onChange(() => this.setState({ curveSegments: data.curveSegments }));
    this.folder.add(data, "font", fonts).onChange(() => {
      this.setState({ font: data.font });
      this.loadFont();
    });
    this.folder.add(data, "weight", weights).onChange(() => {
      this.setState({ weight: data.weight });
      this.loadFont();
    });
    this.folder.add(data, "bevelEnabled").onChange(() => this.setState({ bevelEnabled: data.bevelEnabled }));
    this.folder
      .add(data, "bevelThickness", 0.1, 3)
      .onChange(() => this.setState({ bevelThickness: data.bevelThickness }));
    this.folder.add(data, "bevelSize", 0.1, 3).onChange(() => this.setState({ bevelSize: data.bevelSize }));
    this.folder
      .add(data, "bevelSegments", 0, 8)
      .step(1)
      .onChange(() => this.setState({ bevelSegments: data.bevelSegments }));
  }

  public componentWillUnmount() {
    gui.removeFolder(this.folder);
  }

  public loadFont() {
    const loader = new FontLoader();
    loader.load(
      "../../fonts/" +
      this.state.font +
      "_" +
      this.state.weight +
      ".typeface.json",
      (font) => {
        this.setState({ loadedFont: font });
      },
    );
  }

  public render() {
    // TODO: Add center prop to geometry to center the text
    if (this.state.loadedFont === undefined) {
      return <geometry />;
    }
    return (
      <textGeometry
        text={this.state.text }
        parameters={{
          bevelEnabled: this.state.bevelEnabled,
          bevelSegments: this.state.bevelSegments,
          bevelSize: this.state.bevelSize,
          bevelThickness: this.state.bevelThickness,
          curveSegments: this.state.curveSegments,
          font: this.state.loadedFont,
          height: this.state.height,
          size: this.state.size,
        }}
      />
    );
  }
}


text:
<?xml version="1.0" encoding="UTF-8" standalone="no"?><!--

 Copyright 2003 - 2016 The eFaps Team

 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.

-->
<ui-command xmlns="http://www.efaps.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.efaps.org/xsd http://www.efaps.org/xsd/eFaps_1.0.xsd">
    <uuid>65325556-f633-4983-a93b-af745648f84c</uuid>
    <file-application>eFaps-Kernel</file-application>
    <definition>
        <version-expression>(version==latest)</version-expression>
        <name>Admin_Program_CSSTree_Menu_Action_EditCSS</name>
        <target>
            <form>Admin_Program_CSSEditForm</form>
            <execute method="updateCSS" program="org.efaps.esjp.admin.program.CSS" />
        </target>
        <property name="Target">modal</property>
        <property name="TargetMode">edit</property>
        <property name="WindowWidth">1200</property>
        <property name="WindowHeight">1000</property>
    </definition>
</ui-command>


text:
class CreateComments < ActiveRecord::Migration[5.1]
  def change
    create_table :comments do |t|
      t.string :commenter
      t.text :body
      t.references :article, foreign_key: true

      t.timestamps
    end
  end
end


text:
var Express = require('express');
var bodyParser = require('body-parser');
var http = require('http');
var multer = require('multer');
var app = new Express();
var server = new http.Server(app);
var path = require('path');

var PkgReader = require('../../index');
var utils = require('../utils');

app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));

var uploader = multer({
  dest: path.resolve(__dirname, '../uploads/')
}).single('qqfile');

app.post('/upload', function(req, res, next) {
  uploader(req, res, function(err) {
    if (err) {
      console.error(err);
      return res.status(500).send({
        message: err.stack
      });
    }

    if (req.file) {
      var file = req.file;
      var extension = utils.getExtension(file.originalname);
      var reader = new PkgReader(file.path, extension, { searchResource: true });

      reader.parse(function(err, pkgInfo) {
        if (err) {
          return res.status(500).send({
            message: 'Error happened when parsing pkg.',
            error: err.stack
          });
        }

        res.send(pkgInfo);
      });
    } else {
      res.sendStatus(204);
    }
  });
});

server.listen('3002');


text:
require 'sequel'

def set_up_tables(db)
    begin
        db.create_table :received_mesages do
            primary_key :update_id
            Integer :message_id
            Integer :from_id
            String  :from_username
            String  :from_first_name
            String  :from_last_name
            String  :group_id
            String  :group_title
            String  :chat_received_date
            String  :chat_text
            String  :forwarded_chat
        end
    rescue Sequel::Error => e
        p e.message
    end

    begin
        db.create_table :sent_messages do
            primary_key :id
            Integer :message_id
            String :chat_text
            String :sent_to_group
            Date :sent_at
        end
    rescue Sequel::Error => e
        p e.message
    end
end

def connect_to_db
    return Sequel.connect('sqlite://db/tumibot.db')
end

db = connect_to_db
set_up_tables(db)


text:
package org.apache.kafka.streams.processor.internals;

import org.apache.kafka.common.TopicPartition;
import org.apache.kafka.streams.KeyValue;
import org.apache.kafka.streams.processor.StateRestoreListener;

import java.util.Collection;

public class StateRestorer {

    static final int NO_CHECKPOINT = -1;

    private final long offsetLimit;
    private final boolean persistent;
    private final String storeName;
    private final TopicPartition partition;
    private final CompositeRestoreListener compositeRestoreListener;

    private long checkpointOffset;
    private long restoredOffset;
    private long startingOffset;
    private long endingOffset;

    StateRestorer(final TopicPartition partition,
                  final CompositeRestoreListener compositeRestoreListener,
                  final Long checkpoint,
                  final long offsetLimit,
                  final boolean persistent,
                  final String storeName) {
        this.partition = partition;
        this.compositeRestoreListener = compositeRestoreListener;
        this.checkpointOffset = checkpoint == null ? NO_CHECKPOINT : checkpoint;
        this.offsetLimit = offsetLimit;
        this.persistent = persistent;
        this.storeName = storeName;
    }

    public TopicPartition partition() {
        return partition;
    }

    public String storeName() {
        return storeName;
    }

    long checkpoint() {
        return checkpointOffset;
    }

    void setCheckpointOffset(final long checkpointOffset) {
        this.checkpointOffset = checkpointOffset;
    }

    void restoreStarted() {
        compositeRestoreListener.onRestoreStart(partition, storeName, startingOffset, endingOffset);
    }

    void restoreDone() {
        compositeRestoreListener.onRestoreEnd(partition, storeName, restoredNumRecords());
    }

    void restoreBatchCompleted(final long currentRestoredOffset, final int numRestored) {
        compositeRestoreListener.onBatchRestored(partition, storeName, currentRestoredOffset, numRestored);
    }

    void restore(final Collection<KeyValue<byte[], byte[]>> records) {
        compositeRestoreListener.restoreAll(records);
    }

    boolean isPersistent() {
        return persistent;
    }

    void setUserRestoreListener(final StateRestoreListener userRestoreListener) {
        this.compositeRestoreListener.setUserRestoreListener(userRestoreListener);
    }

    void setRestoredOffset(final long restoredOffset) {
        this.restoredOffset = Math.min(offsetLimit, restoredOffset);
    }

    void setStartingOffset(final long startingOffset) {
        this.startingOffset = Math.min(offsetLimit, startingOffset);
    }

    void setEndingOffset(final long endingOffset) {
        this.endingOffset = Math.min(offsetLimit, endingOffset);
    }

    long startingOffset() {
        return startingOffset;
    }

    boolean hasCompleted(final long recordOffset, final long endOffset) {
        return endOffset == 0 || recordOffset >= readTo(endOffset);
    }

    Long restoredOffset() {
        return restoredOffset;
    }

    long restoredNumRecords() {
        return restoredOffset - startingOffset;
    }

    long offsetLimit() {
        return offsetLimit;
    }

    private Long readTo(final long endOffset) {
        return endOffset < offsetLimit ? endOffset : offsetLimit;
    }

}


text:
package com.redshape.ui.data.bindings;

import com.redshape.ui.application.UIException;
import com.redshape.ui.data.bindings.views.IComposedModel;

/**
 * Interface for all view model builders.
 *
 * Expect some bean class object as input and based on
 * it's metadata gathered through @see com.redshape.bindings.IBeanInfo
 * generate UI objects cascade.
 *
 * This interface is a part of Redshape UI Automation package.
 *
 * @author nikelin
 */
public interface IViewModelBuilder {

    /**
     * Return true is this class type has been already rendered
     * and present in a renderer cache storage.
     *
     * @param type
     * @return
     * @throws UIException
     */
	public boolean isProcessed( Class<?> type ) throws UIException;

    /**
     * Process metadata of a given class type
     * @param type
     * @return
     * @throws UIException
     */
	public IComposedModel createUI( Class<?> type ) throws UIException;

    /**
     * Process metadata of a given class type
     * @param type
     * @param name
     * @return
     * @throws UIException
     */
	public IComposedModel createUI( Class<?> type, String name ) throws UIException;

    /**
     * Process metadata of a given class type and based on a @param processDeffered
     * value neither process or not it's children.
     *
     * @param type
     * @param processDeffered
     * @return
     * @throws UIException
     */
	public IComposedModel createUI( Class<?> type, boolean processDeffered ) throws UIException;

    /**
     * @todo: Needs to remove this method from a public interface
     *
     * @deprecated
     * @param type
     * @param id
     * @param name
     * @param processDeffered
     * @return
     * @throws UIException
     */
	public IComposedModel createUI( Class<?> type, String id, String name, boolean processDeffered ) throws UIException;
}


text:
import validatorjs from 'validatorjs';
import dvr from '../../../../src/validators/DVR';
import { Form } from '../../../../src';

const fields = [
  'deep',
  'deep.nested',
  'deep.nested.column2',
  'deep.nested.column3',
  'deep.nested.column2[].title',
  'deep.nested.column3[].title',
  'layout.column1',
  'layout.column1[].title',
  'users[].settings[].name',
  'users[].settings[].active',
  'users[].settings[].bool',
  'users[].settings[].anotherBool',
];

const types = {
  'users[].settings[].anotherBool': 'checkbox',
};

const rules = {
  'layout.column1[].title': 'string|required',
  'layout.column2[].title': 'string|required',
  'deep.nested.column2[].title': 'string|required',
  'deep.nested.column3[].title': 'string|required',
};

const defaults = {
  'users[].settings[].name': 'Default Name',
  'users[].settings[].active': true,
  'users[].settings[].bool': true,
};

const initials = {
  'users[].settings[].name': 'Initial Name',
  'users[].settings[].active': true,
  'users[].settings[].bool': false,
};

class NewForm extends Form {

  plugins() {
    return {
      dvr: dvr(validatorjs),
    };
  }

  hooks() {
    return {
      onInit(form) {
        // form.update({
        //   users: [{
        //     settings: [{
        //       active: false,
        //     }],
        //   }],
        // });

        // form.$('users[0].settings[0]').update({
        //   active: false,
        // });

        form.$('users').add();
        form.$('users[0].settings[0].active').set('value', false);

        form.$('layout').update({
          column1: [{
            title: 'THE NEW TITLE',
          }],
        });

        form.$('deep.nested').update({
          column2: [{
            title: 'THE NEW TITLE',
          }],
          column3: [{
            title: 'THE NEW TITLE',
          }],
        });
      },
    };
  }
}

export default new NewForm({
  fields, rules, defaults, initials, types,
}, { name: 'Fixes-I' });


text:
title: Play Audio & Video with mediaelement.js
date: 2015-10-15 00:00:00 Z
categories:
- design
tags:
- audio player
- video player
- streaming music
layout: page
subheadline: Video & Music Player
teaser: Do you like music? Or are you a podcaster? Do you want to stream your videos
  in a nice player? Than you likely will like the integration of mediaelement.js.
  It enables you to play music and stream video in a consistent player that looks
  in each browser delicious. It even works in IE6-8.
header: false
image:
  title: mediaplayer_js-title.jpg
  thumb: mediaplayer_js-thumb.jpg
  homepage: mediaplayer_js-home.jpg
  caption: Photo by Corey Blaz
  caption_url: https://blaz.photography/
mediaplayer: true
---

[mediaelement.js][1] is like magic. It's browser and device support is perfect. To activate the video or audio player just set the following variable in front matter to `true`.

~~~
mediaplayer: true
~~~

To use the player just use some HTML5-magic like...

{% highlight html %}
<audio src="http://path-to-file.com/music.mp3" type="audio/mp3" controls="controls"></audio>
{% endhighlight %}

All possible functions and how to use *mediaelement.js* is well-documented on the [players website][1].

## »Music From All Around The World«

[»Music From All Around The World«][5] is a compilation curated by Jeannette Corneille and Moritz "mo." Sauer for [Phlow-Magazine.com][4]. Cover [Artwork designed by Jeannette Corneille][1]. All tracks were released under a [creative commons licence][2].

### B-Ju - »Philly Run«

<audio src="http://archive.org/download/music_from_all_around_the_world/13._music_from_all_around_the_world_-_b-ju_-_philly_run.mp3" type="audio/mp3" controls="controls"></audio>

### Comfort Fit - »Freeze The Cut«

<audio src="http://archive.org/download/music_from_all_around_the_world/05._music_from_all_around_the_world_-_comfort_fit_-_freeze_the_cut_opolopos_emotional_draft_remix.mp3" type="audio/mp3" controls="controls"></audio>

### The Black Atlantic - »Dandelion«

<audio src="http://archive.org/download/music_from_all_around_the_world/02._music_from_all_around_the_world_-_the_black_atlantic_-_dandelion.mp3" type="audio/mp3" controls="controls"></audio>

[Download Compilation ›](https://archive.org/details/music_from_all_around_the_world)
{: .t30 .button .radius}

 [1]: http://mediaelementjs.com/
 [2]: http://jcorneille.de/
 [3]: www.creativecommons.org/licenses/by-nc-nd/3.0/
 [4]: http://phlow-magazine.com/
 [5]: https://archive.org/details/music_from_all_around_the_world
 [6]: #
 [7]: #
 [8]: #
 [9]: #
 [10]: #


text:
package ro.isdc.wro.cache;

import java.io.BufferedOutputStream;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.Serializable;
import java.util.zip.GZIPOutputStream;

import org.apache.commons.io.IOUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import ro.isdc.wro.WroRuntimeException;
import ro.isdc.wro.config.Context;

/**
 * Entry holding a resource content along with its associated hash.
 *
 * @author Alex Objelean
 */
@SuppressWarnings("serial")
public final class CacheValue
  implements Serializable {
  private static final Logger LOG = LoggerFactory.getLogger(CacheValue.class);
  private String rawContent;
  private byte[] gzippedContent;
  private String hash;

  private CacheValue(final String rawContent, final String hash) {
    this.rawContent = rawContent;
    this.hash = hash;
    //the trade-off between the memory and processing time
    if (Context.get().getConfig().isCacheGzippedContent()) {
      gzippedContent = computeGzippedContent(rawContent);
    }
  }

  private byte[] computeGzippedContent(final String content) {
    LOG.debug("Gzipping the content....");
    try {
      final ByteArrayOutputStream baos = new ByteArrayOutputStream();
      final OutputStream os = new GZIPOutputStream(new BufferedOutputStream(baos));
      IOUtils.copy(new ByteArrayInputStream(content.getBytes(Context.get().getConfig().getEncoding())), os);
      os.close();
      return baos.toByteArray();
    } catch (final IOException e) {
      throw WroRuntimeException.wrap(e, "Problem while computing gzipped content").logError();
    }
  };

  /**
   * Factory method.
   *
   * @return {@link CacheValue} based on supplied values.
   */
  public static final CacheValue valueOf(final String rawContent, final String hash) {
    return new CacheValue(rawContent, hash);
  }

  /**
   * @return the content
   */
  public String getRawContent() {
    return this.rawContent;
  }

  /**
   * @param rawContent the content to set
   */
  public void setRawContent(final String rawContent) {
    this.rawContent = rawContent;
  }

  /**
   * @return the hash
   */
  public String getHash() {
    return this.hash;
  }

  /**
   * @param hash the hash to set
   */
  public void setHash(final String hash) {
    this.hash = hash;
  }

  /**
   * @return the gzippedContent
   */
  public byte[] getGzippedContent() {
    return this.gzippedContent == null ? computeGzippedContent(rawContent) : gzippedContent;
  }

  /**
   * Used by unit test to prove that gzipped content is cached only when required.
   */
  byte[] getGzippedContentInternal() {
    return this.gzippedContent;
  }

  /**
   * {@inheritDoc}
   */
  @Override
  public String toString() {
    return "hash: " + hash;
  }
}


text:
/*
 * VarNgram.cc --
 *	Variable length N-gram backoff language model
 *
 */

#ifndef lint
static char Copyright[] = "Copyright (c) 1995-2010 SRI International.  All Rights Reserved.";
static char RcsId[] = "@(#)$Header: /home/srilm/CVS/srilm/lm/src/VarNgram.cc,v 1.19 2010/06/02 05:49:58 stolcke Exp $";
#endif

#ifdef PRE_ISO_CXX
# include <iostream.h>
#else
# include <iostream>
using namespace std;
#endif
#include <stdlib.h>
#include <math.h>

#include "VarNgram.h"

#include "Array.cc"

#define DEBUG_ESTIMATE_WARNINGS	1
#define DEBUG_PRUNE_HOEFFDING 2

VarNgram::VarNgram(Vocab &vocab, unsigned neworder, double alpha)
    : Ngram(vocab, neworder), pruneAlpha(alpha)
{
}

/*
 * This is mostly a copy of Ngram::estimate(), except that
 * pruneNgram() is consulted to determine when to exclude an ngram from
 * the model.
 */
Boolean
VarNgram::estimate(NgramStats &stats, Discount **discounts)
{
    /*
     * For all ngrams, compute probabilities and apply the discount
     * coefficients.
     */
    makeArray(VocabIndex, context, order);
    unsigned vocabSize = Ngram::vocabSize();

    /*
     * Remove all old contexts ...
     */
    clear();

    /*
     * ... but save time by allocating unigram probabilities for all words in
     * the vocabulary.
     */
    {
	VocabIndex emptyContext = Vocab_None;
	contexts.find(&emptyContext)->probs.setsize(vocab.numWords());
    }

    /*
     * Ensure <s> unigram exists (being a non-event, it is not inserted
     * in distributeProb(), yet is assumed by much other software).
     */
    if (vocab.ssIndex() != Vocab_None) {
	context[0] = Vocab_None;

	*insertProb(vocab.ssIndex(), context) = LogP_Zero;
    }

    for (unsigned i = 1; i <= order; i++) {
	NgramCount *contextCount;
	NgramsIter contextIter(stats, context, i-1);

	/*
	 * This enumerates all contexts, i.e., i-1 grams.
	 */
	while ((contextCount = contextIter.next())) {
	    /*
	     * Skip contexts ending in </s>.  This typically only occurs
	     * with the doubling of </s> to generate trigrams from
	     * bigrams ending in </s>.
	     * If <unk> is not real word, also skip context that contain
	     * it.
	     */
	    if ((i > 1 && context[i-2] == vocab.seIndex()) ||
	        (vocab.isNonEvent(vocab.unkIndex()) &&
				 vocab.contains(context, vocab.unkIndex())))
	    {
		continue;
	    }

	    VocabIndex word[2];	/* the follow word */
	    NgramsIter followIter(stats, context, word, 1);
	    NgramCount *ngramCount;

	    /*
	     * Total up the counts for the denominator
	     * (the lower-order counts may not be consistent with
	     * the higher-order ones, so we can't just use *contextCount)
	     * Only if the trustTotal flag is set do we override this
	     * with the count from the context ngram.
	     */
	    NgramCount totalCount = 0;
	    Count observedVocab = 0;
	    while ((ngramCount = followIter.next())) {
		if (vocab.isNonEvent(word[0])) {
		    continue;
		}
		totalCount += *ngramCount;
		observedVocab ++;
	    }
	    if (i > 1 && trustTotals()) {
		totalCount = *contextCount;
	    }

	    if (totalCount == 0) {
		continue;
	    }

	    /*
	     * reverse the context ngram since that's how
	     * the BO nodes are indexed.
	     */
	    Vocab::reverse(context);

	    /*
	     * Compute the discounted probabilities
	     * from the counts and store them in the backoff model.
	     */
	retry:
	    followIter.init();
	    Prob totalProb = 0.0;

	    /*
	     * check if discounting is disabled for this round
	     */
	    Boolean noDiscount =
			    (discounts == 0) ||
			    (discounts[i-1] == 0) ||
			    discounts[i-1]->nodiscount();

	    while ((ngramCount = followIter.next())) {
		Prob prob;
		LogP lprob;
		double discount;

		if (vocab.isNonEvent(word[0])) {
		    /*
		     * Discard all pseudo-word probabilities,
		     * except for unigrams.  For unigrams, assign
		     * probability zero.  This will leave them with
		     * prob zero in all case, due to the backoff
		     * algorithm.
		     * Also discard the <unk> token entirely in closed
		     * vocab models, its presence would prevent OOV
		     * detection when the model is read back in.
		     */
		    if (i > 1 || word[0] == vocab.unkIndex()) {
			continue;
		    }

		    lprob = LogP_Zero;
		    discount = 1.0;
		} else if (pruneNgram(stats, word[0], *ngramCount,
						context, totalCount))
		{
		    /*
		     * Right now, pruning just means replacing an
		     * ngram with its backed-off estimate.
		     */
		    discount = 0.0;
		} else {
		    /*
		     * Ths discount array passed may contain 0 elements
		     * to indicate no discounting at this order.
		     */
		    if (noDiscount) {
			discount = 1.0;
		    } else {
			discount =
			    discounts[i-1]->discount(*ngramCount, totalCount,
								observedVocab);
		    }
		    Prob prob = (discount * *ngramCount) / totalCount;
		    lprob = ProbToLogP(prob);
		    totalProb += prob;
		}

		/*
		 * A discount coefficient of zero indicates this ngram
		 * should be omitted entirely (presumably to save space).
		 */
		if (discount != 0.0) {
		    *insertProb(word[0], context) = lprob;
		}
	    }

	    /*
	     * This is a hack credited to Doug Paul (by Roni Rosenfeld in
	     * his CMU tools).  It may happen that no probability mass
	     * is left after totalling all the explicit probs, typically
	     * because the discount coefficients were out of range and
	     * forced to 1.0.  Unless we have seen all vocabulary words in
	     * this context, to arrive at some non-zero backoff mass,
	     * we try incrementing the denominator in the estimator by 1.
	     * Another hack: If the discounting method uses interpolation
	     * we first try disabling that because interpolation removes
	     * probability mass.
	     */
	    if (!noDiscount && totalCount > 0 &&
		observedVocab < vocabSize &&
		totalProb > 1.0 - Prob_Epsilon)
	    {
		totalCount += 1;

		if (debug(DEBUG_ESTIMATE_WARNINGS)) {
		    cerr << "warning: no backoff probability mass left for \""
			 << (vocab.use(), context)
			 << "\" -- incrementing denominator"
			 << endl;
		}
		goto retry;
	    }

	    /*
	     * Undo the reversal above so the iterator can continue correctly
	     */
	    Vocab::reverse(context);
	}
    }

    /*
     * With all the probs in place, BOWs are obtained simply by the usual
     * normalization.
     */
    recomputeBOWs();

    return true;
}

/*
 * Decide if a the ngram consisting of the context (in reverse order)
 * and the word should be omitted from the ngram model
 *
 * The criterion used here is that the difference in relative frequency
 * between the higher and the lower-order estimate doesn't exceed a
 * Hoeffding bound
 *
 *	| f1/n1 - f2/n2 | < sqrt( 1/2 log(2/alpha) ) (1/sqrt(n1) + 1/sqrt(n2))
 *
 * which is true with probability > 1-alpha
 * (alpha is a confidence level parameter).
 *
 * Here, alpha is set by the user, and we check that that the difference
 *
 *	delta = | f1/n1 - f2/n2 |
 *
 * satisfies
 *
 *      2 exp (- 2 sqr(delta / (1/sqrt(n1) + 1/sqrt(n2)))) < alpha
 */
Boolean
VarNgram::pruneNgram(NgramStats &stats,
			VocabIndex word, NgramCount ngramCount,
			const VocabIndex *context, NgramCount contextCount)
{
    if (context[0] == Vocab_None) {
	return false;
    } else {
	/*
	 * Reverse the context to make count lookups easy
	 */
	Vocab::reverse((VocabIndex *)context);

	NgramCount f1 = ngramCount;
	NgramCount n1 = contextCount;
	NgramCount *f2 = stats.findCount(context + 1, word);
	NgramCount *n2 = stats.findCount(context + 1);

	Boolean prune;

        if (n1 == 0 || f2 == 0 || n2 == 0 || *n2 == 0) {
	    prune = false;
	} else {
	    double delta = fabs(f1/(double)n1 - (double)(*f2)/(double)*n2);
	    double dev = 1.0 / (1.0/sqrt((double)n1) + 1.0/sqrt((double)*n2));

	    double val = 2.0 * exp(-2.0 * (delta * delta) * (dev * dev));

	    prune = (val > pruneAlpha);

	    if (prune && debug(DEBUG_PRUNE_HOEFFDING)) {
		dout() << "pruning ngram \""
		       << (vocab.use(), context)
		       << " " << vocab.getWord(word)
		       << "\" (f1 = " << f1 << "/" << n1
		       << " f2 = " << *f2 << "/" << *n2
		       << "; d = " << val << ")\n" ;
	    }
	}

	Vocab::reverse((VocabIndex *)context);

	return prune;
    }
}


text:
#ifndef __ccRandom_H_
#define __ccRandom_H_

#include <random>
#include <cstdlib>

#include "platform/CCPlatformMacros.h"

NS_CC_BEGIN

class CC_DLL RandomHelper {
public:
    template<typename T>
    static inline T random_real(T min, T max) {
        std::uniform_real_distribution<T> dist(min, max);
        auto &mt = RandomHelper::getEngine();
        return dist(mt);
    }

    template<typename T>
    static inline T random_int(T min, T max) {
        std::uniform_int_distribution<> dist(min, max);
        auto &mt = RandomHelper::getEngine();
        return dist(mt);
    }
private:
    static std::mt19937 &getEngine();
};

/**
* returns a random value between `min` and `max`
*/
template<typename T>
inline T random(T min, T max) {
    return RandomHelper::random_int(min, max);
}

template<>
inline float random(float min, float max) {
    return RandomHelper::random_real(min, max);
}

template<>
inline long double random(long double min, long double max) {
    return RandomHelper::random_real(min, max);
}

template<>
inline double random(double min, double max) {
    return RandomHelper::random_real(min, max);
}

/**
 * Returns a random int between 0 and RAND_MAX
 */
inline int random() {
    return cocos2d::random(0, RAND_MAX);
};

/**
 * Returns a random float between -1 and 1.
 * It can be seeded using std::srand(seed);
 */
inline float rand_minus1_1() {
    // FIXME: using the new c++11 random engine generator
    // without a proper way to set a seed is not useful.
    // Resorting to the old random method since it can
    // be seeded using std::srand()
    return ((std::rand() / (float)RAND_MAX) * 2) -1;

//    return cocos2d::random(-1.f, 1.f);
};

/**
 * Returns a random float between 0 and 1.
 * It can be seeded using std::srand(seed);
 */
inline float rand_0_1() {
    // FIXME: using the new c++11 random engine generator
    // without a proper way to set a seed is not useful.
    // Resorting to the old random method since it can
    // be seeded using std::srand()
    return std::rand() / (float)RAND_MAX;

//    return cocos2d::random(0.f, 1.f);
};

NS_CC_END
#endif //__ccRandom_H_