text:
package com.cosmocode.image.filtering.servlet;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.log4j.Logger;

import com.cosmocode.image.filtering.ImageFiltering;
import com.cosmocode.image.filtering.JAIImageFiltering;
import com.cosmocode.image.filtering.filters.BorderImageFilter;
import com.cosmocode.image.filtering.filters.CropImageFilter;
import com.cosmocode.image.filtering.filters.InvertImageFilter;
import com.cosmocode.image.filtering.filters.RotateImageFilter;
import com.cosmocode.image.filtering.filters.ScaleImageFilter;

/**
 *
 * Parameter, die dem servlet uebergeben werden koennen:
 *

 *

 * 		Parameter
 * 		Wert
 * 		Beschreibung
 *

 *

 * 		url
 * 		beliebig
 * 		Dokument, welches nach dem filtern aufgerufen werden soll. Dabei handelt es sich in den meisten Faellen um das
 * 		gleiche Dokument, welches das Servlet im form-Tag aufruft.
 *

 *

 * 		filein
 * 		file
 * 		Datei, welches gefiltert werden soll
 *

 *

 * 		fileout
 * 		file | empty</d>
 * 		Wenn keine Datei angegeben wird, wird filein ueberschrieben.
 *

 *

 * 		outformat
 * 		jpeg | bmp | fpx | png | pnm | tiff | empty</d>
 * 		wenn keins angegeben ist, dann wird das eingangsformat benutzt
 *

 *

 *

 * Filter-Parameter, die dem servlet uebergeben werden koennen:
 *

 *

 * 		Parameter
 * 		Wert
 * 		Beschreibung
 * 		Beispiel
 *

 *

 * 		filter_quality
 * 		0.0 - 1.0
 * 		setzt die qualitaet des bildes (hat nur effekt bei jpeg)
 * 		filter_quality=0.5
 *

 *

 * 		filter_dimension
 * 		width*height
 * 		setzt neue breite und hoehe fuer das bild
 * 		filter_dimension=150*233 | filter_dimension=150* (ratio beibehalten) | filter_dimension=*150 (ratio beibehalten)
 *

 *

 * 		filter_scale
 * 		percent (0.0-1.0)
 * 		scaliert das Bild
 * 		filter_scale=0.1
 *

 *

 * 		filter_rotate
 * 		angle (0.0-1.0)
 * 		rotiert das Bild
 * 		filter_rotate=0.5
 *

 *

 * 		filter_border
 * 		border (int-value)
 * 		malt einen rahmen um das bild
 * 		filter_border=10
 *

 *

 * 		filter_crop
 * 		x,y,w,h (float-value)
 * 		schneidet ein teil des bildes aus
 * 		filter_crop=0.0,10.0,100.0,100.0
 *

 *

 * 		filter_invert
 * 		0 | 1
 * 		invertiert das bild
 * 		filter_invert=on
 *

 *

 *
 * @version $Id: FilterServlet.java,v 1.3 2005/01/05 12:03:19 rademacher Exp $
 */
public class FilterServlet extends HttpServlet {

    private static final long serialVersionUID = 1736328756120697692L;

    public static final String cvsID = "$Id: FilterServlet.java,v 1.3 2005/01/05 12:03:19 rademacher Exp $";

	static Logger logger = Logger.getLogger( FilterServlet.class ) ;

	static final String TMP_DIR = "/tmp/";

	static final String[] errorStr = {
			"FILE_EXISTS",
			"NULL_REQUEST",
			"NO_TMP",
			"MAXPOSSIZE",
			"READONLY",
			"WRONG_POST_TYPE",
			"FILE_TOO_BIG",
			"WRONG_DATA",
			"NO_BOUNDARY",
			"MALFORMED_LINE",
			"CONTENT_CORRUPT"
	};

	public void doGet( HttpServletRequest request, HttpServletResponse resp ) throws ServletException {
		try {
			doPost( request, resp ) ;
		} catch ( Exception e) {
			throw new ServletException ( e ) ;
		}
	}

	public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {

		res.setStatus( HttpServletResponse.SC_OK );
		res.setContentType("text/html");

		PrintWriter out = res.getWriter();

		out.println("");

		String url = req.getParameter("url");
		String filein = req.getParameter("filein") ;
		String fileout = req.getParameter("fileout") ;
		String outformat = req.getParameter("outformat") ;

		if ( outformat==null || outformat.equals("") )
			outformat = (fileout!=null && !fileout.equals("") ?
						fileout.substring( fileout.lastIndexOf(".")+1 )
						: filein.substring( filein.lastIndexOf(".")+1 ) ) ;

		String filter_quality = req.getParameter("filter_quality") ;
		String filter_dimension = req.getParameter("filter_dimension") ;
		String filter_scale = req.getParameter("filter_scale") ;
		String filter_rotate = req.getParameter("filter_rotate") ;
		String filter_border = req.getParameter("filter_border") ;
		String filter_crop = req.getParameter("filter_crop");
		String filter_invert = req.getParameter("filter_invert") ;

		try {
			ImageFiltering filtering = null ;
			if ( filein.startsWith("http") || filein.startsWith("ftp") )
				filtering = new JAIImageFiltering( new java.net.URL( filein) ) ;
			else
				filtering = new JAIImageFiltering( filein ) ;

			// Filtern
			if ( filter_quality != null &&  !filter_quality.equals("") ) {
				filtering.setQuality( Float.parseFloat( filter_quality) );
				System.err.println( "*** quality: " + filter_quality );
			}
			if ( filter_border != null &&  !filter_border.equals("") ) {
				filtering.addFilter( new BorderImageFilter( Integer.parseInt( filter_border ) ) );
				System.err.println( "*** border: " + filter_border );
			}
			if ( filter_invert != null &&  !filter_invert.equals("") ) {
				filtering.addFilter( new InvertImageFilter( ) );
				System.err.println( "*** invert: " + filter_invert );
			}
			if ( filter_rotate != null &&  !filter_rotate.equals("") ) {
				filtering.addFilter( new RotateImageFilter( Float.parseFloat( filter_rotate ) ) ) ;
				System.err.println( "*** rotate: " + filter_rotate ) ;
			}
			if ( filter_crop != null &&  !filter_crop.equals("") ) {
				StringTokenizer st = new StringTokenizer(filter_crop,",") ;
				float x = Float.parseFloat( st.nextToken() ) ;
				float y = Float.parseFloat( st.nextToken() ) ;
				float w = Float.parseFloat( st.nextToken() ) ;
				float h = Float.parseFloat( st.nextToken() ) ;
				filtering.addFilter( new CropImageFilter( x,y,w,h) ) ;
				System.err.println( "*** rotate: " + filter_rotate ) ;
			}

			if ( filter_scale != null &&  !filter_scale.equals("") ) {
				filtering.addFilter( new ScaleImageFilter( Float.parseFloat( filter_scale ) ) ) ;
				System.err.println( "*** scaling per: " + filter_scale + "%" ) ;
			} else
			if ( filter_dimension != null &&  !filter_dimension.equals("") ) {
				float newW = -1.0f ;
				float newH = -1.0f ;
				String sw = filter_dimension.substring(0,filter_dimension.indexOf("*")) ;
				String sh = filter_dimension.substring(filter_dimension.indexOf("*")+1) ;
				if ( ! sw.equals("") ) newW = (float)Integer.parseInt(sw)/(float)filtering.getWidth();
				if ( ! sh.equals("") ) newH = (float)Integer.parseInt(sh)/(float)filtering.getHeight();
				if ( newW<0.0 ) newW = newH ;
					else
				if ( newH<0.0 ) newH = newW ;

				filtering.addFilter( new ScaleImageFilter( newW, newH ) ) ;
				System.err.println( "*** scaling to: " + newW + "/" + newH ) ;
			}

			filtering.proceedFilters() ;

			FileOutputStream fout = new FileOutputStream( fileout ) ;
			filtering.writeToStream( fout, outformat );
			fout.close() ;

			out.println("");

		} catch (Exception e) {

			e.printStackTrace() ;
			suckContent( req ) ;
			url = res.encodeURL(url + "?error=" + getErrorNr( e.toString() ) );
			out.println("");

		} finally {

		}

		out.println("");
	}

	// -- private --

	private void suckContent( HttpServletRequest req ) {
		try {
			InputStream in = req.getInputStream() ;
			byte [] buf = new byte[ 100000 ] ; // ~ 100 k
			while ( 0 < in.read( buf, 0, buf.length ) ) {
			}
		} catch ( Exception e ) {
			e.printStackTrace();
		}
	}

	private int getErrorNr(String err) {
		for (int i=0;i<errorStr.length;i++) {
			if (err.indexOf(errorStr[i])>=0) return i;
		}

		return -1;
	}

} // end class FilterServlet

//////////////////////////////////////////////////////////////////////////////////
//
// $Log: FilterServlet.java,v $
// Revision 1.3  2005/01/05 12:03:19  rademacher
// 0.3.0.0
//
// Revision 1.2  2004/10/01 13:10:32  rademacher
// 0.2.1.0
//
// Revision 1.1  2004/10/01 09:33:57  rademacher
// 0.2.0.1
//
//
//


text:
package drivers

import (
	"fmt"

	"github.com/docker/machine/libmachine/log"
	"github.com/docker/machine/libmachine/mcnutils"
	"github.com/docker/machine/libmachine/ssh"
)

func GetSSHClientFromDriver(d Driver) (ssh.Client, error) {
	address, err := d.GetSSHHostname()
	if err != nil {
		return nil, err
	}

	port, err := d.GetSSHPort()
	if err != nil {
		return nil, err
	}

	var auth *ssh.Auth
	if d.GetSSHKeyPath() == "" {
		auth = &ssh.Auth{}
	} else {
		auth = &ssh.Auth{
			Keys: []string{d.GetSSHKeyPath()},
		}
	}

	client, err := ssh.NewClient(d.GetSSHUsername(), address, port, auth)
	return client, err

}

func RunSSHCommandFromDriver(d Driver, command string) (string, error) {
	client, err := GetSSHClientFromDriver(d)
	if err != nil {
		return "", err
	}

	log.Debugf("About to run SSH command:\n%s", command)

	output, err := client.Output(command)
	log.Debugf("SSH cmd err, output: %v: %s", err, output)
	if err != nil {
		return "", fmt.Errorf(`Something went wrong running an SSH command!
command : %s
err     : %v
output  : %s
`, command, err, output)
	}

	return output, nil
}

func sshAvailableFunc(d Driver) func() bool {
	return func() bool {
		log.Debug("Getting to WaitForSSH function...")
		if _, err := RunSSHCommandFromDriver(d, "exit 0"); err != nil {
			log.Debugf("Error getting ssh command 'exit 0' : %s", err)
			return false
		}
		return true
	}
}

func WaitForSSH(d Driver) error {
	// Try to dial SSH for 30 seconds before timing out.
	if err := mcnutils.WaitFor(sshAvailableFunc(d), d.GetMaxAttempt()); err != nil {
		return fmt.Errorf("Too many retries waiting for SSH to be available.  Last error: %s", err)
	}
	return nil
}

redpajama_set_name: RedPajamaGithub


text:
#ifndef HTTP_H__
#define HTTP_H__

#include <cstring>
#include <map>
#include <sstream>
#include <string>
#include <vector>

namespace i2p {
namespace http {
  const char CRLF[] = "\r\n";         /**< HTTP line terminator */
  const char HTTP_EOH[] = "\r\n\r\n"; /**< HTTP end-of-headers mark */
  extern const std::vector<std::string> HTTP_METHODS;  /**< list of valid HTTP methods */
  extern const std::vector<std::string> HTTP_VERSIONS; /**< list of valid HTTP versions */

  struct URL {
    std::string schema;
    std::string user;
    std::string pass;
    std::string host;
    unsigned short int port;
    std::string path;
    std::string query;
    std::string frag;

    URL(): schema(""), user(""), pass(""), host(""), port(0), path(""), query(""), frag("") {};

    /**
     * @brief Tries to parse url from string
     * @return true on success, false on invalid url
     */
    bool parse (const char *str, std::size_t len = 0);
    bool parse (const std::string& url);

    /**
     * @brief Parse query part of url to key/value map
     * @note Honestly, this should be implemented with std::multimap
     */
    bool parse_query(std::map<std::string, std::string> & params);

    /**
     * @brief Serialize URL structure to url
     * @note Returns relative url if schema if empty, absolute url otherwise
     */
    std::string to_string ();
  };

  struct HTTPMsg {
    std::map<std::string, std::string> headers;

    void add_header(const char *name, std::string & value, bool replace = false);
    void add_header(const char *name, const char *value, bool replace = false);
    void del_header(const char *name);

    /** @brief Returns declared message length or -1 if unknown */
    long int content_length();
  };

  struct HTTPReq : HTTPMsg {
    std::string version;
    std::string method;
    std::string uri;

    HTTPReq (): version("HTTP/1.0"), method("GET"), uri("/") {};

    /**
     * @brief Tries to parse HTTP request from string
     * @return -1 on error, 0 on incomplete query, >0 on success
     * @note Positive return value is a size of header
     */
    int parse(const char *buf, size_t len);
    int parse(const std::string& buf);

    /** @brief Serialize HTTP request to string */
    std::string to_string();

		void write(std::ostream & o);

  };

  struct HTTPRes : HTTPMsg {
    std::string version;
    std::string status;
    unsigned short int code;
    /**
     * @brief Simplifies response generation
     *
     * If this variable is set, on @a to_string() call:
     *   * Content-Length header will be added if missing,
     *   * contents of @a body will be included in generated response
     */
    std::string body;

    HTTPRes (): version("HTTP/1.1"), status("OK"), code(200) {}

    /**
     * @brief Tries to parse HTTP response from string
     * @return -1 on error, 0 on incomplete query, >0 on success
     * @note Positive return value is a size of header
     */
    int parse(const char *buf, size_t len);
    int parse(const std::string& buf);

    /**
     * @brief Serialize HTTP response to string
     * @note If @a version is set to HTTP/1.1, and Date header is missing,
     *   it will be generated based on current time and added to headers
     * @note If @a body is set and Content-Length header is missing,
     *   this header will be added, based on body's length
     */
    std::string to_string();

		void write(std::ostream & o);

    /** @brief Checks that response declared as chunked data */
    bool is_chunked();

    /** @brief Checks that response contains compressed data */
    bool is_gzipped();
  };

  /**
   * @brief returns HTTP status string by integer code
   * @param code HTTP code [100, 599]
   * @return Immutable string with status
   */
  const char * HTTPCodeToStatus(int code);

  /**
   * @brief Replaces %-encoded characters in string with their values
   * @param data Source string
   * @param null If set to true - decode also %00 sequence, otherwise - skip
   * @return Decoded string
   */
  std::string UrlDecode(const std::string& data, bool null = false);

  /**
   * @brief Merge HTTP response content with Transfer-Encoding: chunked
   * @param in  Input stream
   * @param out Output stream
   * @return true on success, false otherwise
   */
  bool MergeChunkedResponse (std::istream& in, std::ostream& out);
} // http
} // i2p

#endif /* HTTP_H__ */


text:
#ifndef _PHRASE_BUILDER_H_
#define _PHRASE_BUILDER_H_

#include <memory>
#include <vector>

using namespace std;

namespace extractor {

class Phrase;
class Vocabulary;

/**
 * Component for constructing phrases.
 */
class PhraseBuilder {
 public:
  PhraseBuilder(shared_ptr<Vocabulary> vocabulary);

  // Constructs a phrase starting from an array of symbols.
  Phrase Build(const vector<int>& symbols);

  // Extends a phrase with a leading and/or trailing nonterminal.
  Phrase Extend(const Phrase& phrase, bool start_x, bool end_x);

 private:
  shared_ptr<Vocabulary> vocabulary;
};

} // namespace extractor

#endif


text:
<?php
include "./core/bootstrap.php";

//connect to database
include 'dbconnect.php';

//check that user has a valid cookie, redirect if no valid cookie
include 'php_common/cookiecheck.php';

//extract their user preferences
$userService = new UserService();
$userprefs = $userService->getUserPrefs($userid);

$show_boulder = $userprefs['show_boulder'];
$show_TR = $userprefs['show_TR'];
$show_Lead = $userprefs['show_Lead'];

$show_project = $userprefs['show_project'];
$show_redpoint = $userprefs['show_redpoint'];
$show_flash = $userprefs['show_flash'];
$show_onsight = $userprefs['show_onsight'];

$minB = $userprefs['minV'];
$maxB = $userprefs['maxV'];
$minTR = $userprefs['minTR'];
$maxTR = $userprefs['maxTR'];
$minL = $userprefs['minL'];
$maxL = $userprefs['maxL'];

$boulderGradingID = $userprefs['boulderGradingSystemID'];
$routeGradingID = $userprefs['routeGradingSystemID'];

//Find out user's country
$countryCode = $userService->getUserCountryCode($userid);

//find user's main gym
$mainClimbingAreas = $userService->getUserMainClimbingAreas($userid);
$main_gymid = $mainClimbingAreas['main_gym'];
$main_cragid = $mainClimbingAreas['main_crag'];

?>
<!DOCTYPE HTML>

		<title>Gym Climbing Tracker</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1">

		<link rel="icon" href="images/favicon.ico" type="image/x-icon">
		<link rel="stylesheet" type="text/css" href="css/bootstrap.css">
		<link rel="stylesheet" type="text/css" href="css/datepicker.css">
		<link rel="stylesheet" type="text/css" href="style.php/mycss.scss">

		<link rel="stylesheet" type="text/css" href="style.php/mycss.scss">

		<?php include_once("php_common/analyticstracking.php") ?>
		<?php require("navigation.php"); ?>

		<form action="workout-result.php" method="post" id="workout-form" name="workout-form" onsubmit="return dateCheck()">

				Select a Country:
				<select name="country-select" class="form-control" id="country-select" onchange="updateCountryGyms()" required>
					<option value="">Please select a country</option>
					<option value="--" <?php echo $countryCode=="--"?'selected':'';?>>none</option>
					<option value="AF" <?php echo $countryCode=="AF"?'selected':'';?>>Afghanistan</option>
					<option value="AL" <?php echo $countryCode=="AL"?'selected':'';?>>Albania</option>
					<option value="DZ" <?php echo $countryCode=="DZ"?'selected':'';?>>Algeria</option>
					<option value="AS" <?php echo $countryCode=="AS"?'selected':'';?>>American Samoa</option>
					<option value="AD" <?php echo $countryCode=="AD"?'selected':'';?>>Andorra</option>
					<option value="AO" <?php echo $countryCode=="AO"?'selected':'';?>>Angola</option>
					<option value="AI" <?php echo $countryCode=="AI"?'selected':'';?>>Anguilla</option>
					<option value="AQ" <?php echo $countryCode=="AQ"?'selected':'';?>>Antarctica</option>
					<option value="AG" <?php echo $countryCode=="AG"?'selected':'';?>>Antigua and Barbuda</option>
					<option value="AR" <?php echo $countryCode=="AR"?'selected':'';?>>Argentina</option>
					<option value="AM" <?php echo $countryCode=="AM"?'selected':'';?>>Armenia</option>
					<option value="AW" <?php echo $countryCode=="AW"?'selected':'';?>>Aruba</option>
					<option value="AU" <?php echo $countryCode=="AU"?'selected':'';?>>Australia</option>
					<option value="AT" <?php echo $countryCode=="AT"?'selected':'';?>>Austria</option>
					<option value="AZ" <?php echo $countryCode=="AZ"?'selected':'';?>>Azerbaijan</option>
					<option value="BS" <?php echo $countryCode=="BS"?'selected':'';?>>Bahamas</option>
					<option value="BH" <?php echo $countryCode=="BH"?'selected':'';?>>Bahrain</option>
					<option value="BD" <?php echo $countryCode=="BD"?'selected':'';?>>Bangladesh</option>
					<option value="BB" <?php echo $countryCode=="BB"?'selected':'';?>>Barbados</option>
					<option value="BY" <?php echo $countryCode=="BY"?'selected':'';?>>Belarus</option>
					<option value="BE" <?php echo $countryCode=="BE"?'selected':'';?>>Belgium</option>
					<option value="BZ" <?php echo $countryCode=="BZ"?'selected':'';?>>Belize</option>
					<option value="BJ" <?php echo $countryCode=="BJ"?'selected':'';?>>Benin</option>
					<option value="BM" <?php echo $countryCode=="BM"?'selected':'';?>>Bermuda</option>
					<option value="BT" <?php echo $countryCode=="BT"?'selected':'';?>>Bhutan</option>
					<option value="BO" <?php echo $countryCode=="BO"?'selected':'';?>>Bolivia</option>
					<option value="BA" <?php echo $countryCode=="BA"?'selected':'';?>>Bosnia and Herzegowina</option>
					<option value="BW" <?php echo $countryCode=="BW"?'selected':'';?>>Botswana</option>
					<option value="BV" <?php echo $countryCode=="BV"?'selected':'';?>>Bouvet Island</option>
					<option value="BR" <?php echo $countryCode=="BR"?'selected':'';?>>Brazil</option>
					<option value="IO" <?php echo $countryCode=="IO"?'selected':'';?>>British Indian Ocean Territory</option>
					<option value="BN" <?php echo $countryCode=="BN"?'selected':'';?>>Brunei Darussalam</option>
					<option value="BG" <?php echo $countryCode=="BG"?'selected':'';?>>Bulgaria</option>
					<option value="BF" <?php echo $countryCode=="BF"?'selected':'';?>>Burkina Faso</option>
					<option value="BI" <?php echo $countryCode=="BI"?'selected':'';?>>Burundi</option>
					<option value="KH" <?php echo $countryCode=="KH"?'selected':'';?>>Cambodia</option>
					<option value="CM" <?php echo $countryCode=="CM"?'selected':'';?>>Cameroon</option>
					<option value="CA" <?php echo $countryCode=="CA"?'selected':'';?>>Canada</option>
					<option value="CV" <?php echo $countryCode=="CV"?'selected':'';?>>Cape Verde</option>
					<option value="KY" <?php echo $countryCode=="KY"?'selected':'';?>>Cayman Islands</option>
					<option value="CF" <?php echo $countryCode=="CF"?'selected':'';?>>Central African Republic</option>
					<option value="TD" <?php echo $countryCode=="TD"?'selected':'';?>>Chad</option>
					<option value="CL" <?php echo $countryCode=="CL"?'selected':'';?>>Chile</option>
					<option value="CN" <?php echo $countryCode=="CN"?'selected':'';?>>China</option>
					<option value="CX" <?php echo $countryCode=="CX"?'selected':'';?>>Christmas Island</option>
					<option value="CC" <?php echo $countryCode=="CC"?'selected':'';?>>Cocos (Keeling) Islands</option>
					<option value="CO" <?php echo $countryCode=="CO"?'selected':'';?>>Colombia</option>
					<option value="KM" <?php echo $countryCode=="KM"?'selected':'';?>>Comoros</option>
					<option value="CG" <?php echo $countryCode=="CG"?'selected':'';?>>Congo</option>
					<option value="CD" <?php echo $countryCode=="CD"?'selected':'';?>>Congo, the Democratic Republic of the</option>
					<option value="CK" <?php echo $countryCode=="CK"?'selected':'';?>>Cook Islands</option>
					<option value="CR" <?php echo $countryCode=="CR"?'selected':'';?>>Costa Rica</option>
					<option value="CI" <?php echo $countryCode=="CI"?'selected':'';?>>Cote d'Ivoire</option>
					<option value="HR" <?php echo $countryCode=="HR"?'selected':'';?>>Croatia (Hrvatska)</option>
					<option value="CU" <?php echo $countryCode=="CU"?'selected':'';?>>Cuba</option>
					<option value="CY" <?php echo $countryCode=="CY"?'selected':'';?>>Cyprus</option>
					<option value="CZ" <?php echo $countryCode=="CZ"?'selected':'';?>>Czech Republic</option>
					<option value="DK" <?php echo $countryCode=="DK"?'selected':'';?>>Denmark</option>
					<option value="DJ" <?php echo $countryCode=="DJ"?'selected':'';?>>Djibouti</option>
					<option value="DM" <?php echo $countryCode=="DM"?'selected':'';?>>Dominica</option>
					<option value="DO" <?php echo $countryCode=="DO"?'selected':'';?>>Dominican Republic</option>
					<option value="TP" <?php echo $countryCode=="TP"?'selected':'';?>>East Timor</option>
					<option value="EC" <?php echo $countryCode=="EC"?'selected':'';?>>Ecuador</option>
					<option value="EG" <?php echo $countryCode=="EG"?'selected':'';?>>Egypt</option>
					<option value="SV" <?php echo $countryCode=="SV"?'selected':'';?>>El Salvador</option>
					<option value="GQ" <?php echo $countryCode=="GQ"?'selected':'';?>>Equatorial Guinea</option>
					<option value="ER" <?php echo $countryCode=="ER"?'selected':'';?>>Eritrea</option>
					<option value="EE" <?php echo $countryCode=="EE"?'selected':'';?>>Estonia</option>
					<option value="ET" <?php echo $countryCode=="ET"?'selected':'';?>>Ethiopia</option>
					<option value="FK" <?php echo $countryCode=="FK"?'selected':'';?>>Falkland Islands (Malvinas)</option>
					<option value="FO" <?php echo $countryCode=="FO"?'selected':'';?>>Faroe Islands</option>
					<option value="FJ" <?php echo $countryCode=="FJ"?'selected':'';?>>Fiji</option>
					<option value="FI" <?php echo $countryCode=="FI"?'selected':'';?>>Finland</option>
					<option value="FR" <?php echo $countryCode=="FR"?'selected':'';?>>France</option>
					<option value="FX" <?php echo $countryCode=="FX"?'selected':'';?>>France, Metropolitan</option>
					<option value="GF" <?php echo $countryCode=="GF"?'selected':'';?>>French Guiana</option>
					<option value="PF" <?php echo $countryCode=="PF"?'selected':'';?>>French Polynesia</option>
					<option value="TF" <?php echo $countryCode=="TF"?'selected':'';?>>French Southern Territories</option>
					<option value="GA" <?php echo $countryCode=="GA"?'selected':'';?>>Gabon</option>
					<option value="GM" <?php echo $countryCode=="GM"?'selected':'';?>>Gambia</option>
					<option value="GE" <?php echo $countryCode=="GE"?'selected':'';?>>Georgia</option>
					<option value="DE" <?php echo $countryCode=="DE"?'selected':'';?>>Germany</option>
					<option value="GH" <?php echo $countryCode=="GH"?'selected':'';?>>Ghana</option>
					<option value="GI" <?php echo $countryCode=="GI"?'selected':'';?>>Gibraltar</option>
					<option value="GR" <?php echo $countryCode=="GR"?'selected':'';?>>Greece</option>
					<option value="GL" <?php echo $countryCode=="GL"?'selected':'';?>>Greenland</option>
					<option value="GD" <?php echo $countryCode=="GD"?'selected':'';?>>Grenada</option>
					<option value="GP" <?php echo $countryCode=="GP"?'selected':'';?>>Guadeloupe</option>
					<option value="GU" <?php echo $countryCode=="GU"?'selected':'';?>>Guam</option>
					<option value="GT" <?php echo $countryCode=="GT"?'selected':'';?>>Guatemala</option>
					<option value="GN" <?php echo $countryCode=="GN"?'selected':'';?>>Guinea</option>
					<option value="GW" <?php echo $countryCode=="GW"?'selected':'';?>>Guinea-Bissau</option>
					<option value="GY" <?php echo $countryCode=="GY"?'selected':'';?>>Guyana</option>
					<option value="HT" <?php echo $countryCode=="HT"?'selected':'';?>>Haiti</option>
					<option value="HM" <?php echo $countryCode=="HM"?'selected':'';?>>Heard and Mc Donald Islands</option>
					<option value="VA" <?php echo $countryCode=="VA"?'selected':'';?>>Holy See (Vatican City State)</option>
					<option value="HN" <?php echo $countryCode=="HN"?'selected':'';?>>Honduras</option>
					<option value="HK" <?php echo $countryCode=="HK"?'selected':'';?>>Hong Kong</option>
					<option value="HU" <?php echo $countryCode=="HU"?'selected':'';?>>Hungary</option>
					<option value="IS" <?php echo $countryCode=="IS"?'selected':'';?>>Iceland</option>
					<option value="IN" <?php echo $countryCode=="IN"?'selected':'';?>>India</option>
					<option value="ID" <?php echo $countryCode=="ID"?'selected':'';?>>Indonesia</option>
					<option value="IR" <?php echo $countryCode=="IR"?'selected':'';?>>Iran (Islamic Republic of)</option>
					<option value="IQ" <?php echo $countryCode=="IQ"?'selected':'';?>>Iraq</option>
					<option value="IE" <?php echo $countryCode=="IE"?'selected':'';?>>Ireland</option>
					<option value="IL" <?php echo $countryCode=="IL"?'selected':'';?>>Israel</option>
					<option value="IT" <?php echo $countryCode=="IT"?'selected':'';?>>Italy</option>
					<option value="JM" <?php echo $countryCode=="JM"?'selected':'';?>>Jamaica</option>
					<option value="JP" <?php echo $countryCode=="JP"?'selected':'';?>>Japan</option>
					<option value="JO" <?php echo $countryCode=="JO"?'selected':'';?>>Jordan</option>
					<option value="KZ" <?php echo $countryCode=="KZ"?'selected':'';?>>Kazakhstan</option>
					<option value="KE" <?php echo $countryCode=="KE"?'selected':'';?>>Kenya</option>
					<option value="KI" <?php echo $countryCode=="KI"?'selected':'';?>>Kiribati</option>
					<option value="KP" <?php echo $countryCode=="KP"?'selected':'';?>>Korea, Democratic People's Republic of</option>
					<option value="KR" <?php echo $countryCode=="KR"?'selected':'';?>>Korea, Republic of</option>
					<option value="KW" <?php echo $countryCode=="KW"?'selected':'';?>>Kuwait</option>
					<option value="KG" <?php echo $countryCode=="KG"?'selected':'';?>>Kyrgyzstan</option>
					<option value="LA" <?php echo $countryCode=="LA"?'selected':'';?>>Lao People's Democratic Republic</option>
					<option value="LV" <?php echo $countryCode=="LV"?'selected':'';?>>Latvia</option>
					<option value="LB" <?php echo $countryCode=="LB"?'selected':'';?>>Lebanon</option>
					<option value="LS" <?php echo $countryCode=="LS"?'selected':'';?>>Lesotho</option>
					<option value="LR" <?php echo $countryCode=="LR"?'selected':'';?>>Liberia</option>
					<option value="LY" <?php echo $countryCode=="LY"?'selected':'';?>>Libyan Arab Jamahiriya</option>
					<option value="LI" <?php echo $countryCode=="LI"?'selected':'';?>>Liechtenstein</option>
					<option value="LT" <?php echo $countryCode=="LT"?'selected':'';?>>Lithuania</option>
					<option value="LU" <?php echo $countryCode=="LU"?'selected':'';?>>Luxembourg</option>
					<option value="MO" <?php echo $countryCode=="MO"?'selected':'';?>>Macau</option>
					<option value="MK" <?php echo $countryCode=="MK"?'selected':'';?>>Macedonia, The Former Yugoslav Republic of</option>
					<option value="MG" <?php echo $countryCode=="MG"?'selected':'';?>>Madagascar</option>
					<option value="MW" <?php echo $countryCode=="MW"?'selected':'';?>>Malawi</option>
					<option value="MY" <?php echo $countryCode=="MY"?'selected':'';?>>Malaysia</option>
					<option value="MV" <?php echo $countryCode=="MV"?'selected':'';?>>Maldives</option>
					<option value="ML" <?php echo $countryCode=="ML"?'selected':'';?>>Mali</option>
					<option value="MT" <?php echo $countryCode=="MT"?'selected':'';?>>Malta</option>
					<option value="MH" <?php echo $countryCode=="MH"?'selected':'';?>>Marshall Islands</option>
					<option value="MQ" <?php echo $countryCode=="MQ"?'selected':'';?>>Martinique</option>
					<option value="MR" <?php echo $countryCode=="MR"?'selected':'';?>>Mauritania</option>
					<option value="MU" <?php echo $countryCode=="MU"?'selected':'';?>>Mauritius</option>
					<option value="YT" <?php echo $countryCode=="YT"?'selected':'';?>>Mayotte</option>
					<option value="MX" <?php echo $countryCode=="MX"?'selected':'';?>>Mexico</option>
					<option value="FM" <?php echo $countryCode=="FM"?'selected':'';?>>Micronesia, Federated States of</option>
					<option value="MD" <?php echo $countryCode=="MD"?'selected':'';?>>Moldova, Republic of</option>
					<option value="MC" <?php echo $countryCode=="MC"?'selected':'';?>>Monaco</option>
					<option value="MN" <?php echo $countryCode=="MN"?'selected':'';?>>Mongolia</option>
					<option value="MS" <?php echo $countryCode=="MS"?'selected':'';?>>Montserrat</option>
					<option value="MA" <?php echo $countryCode=="MA"?'selected':'';?>>Morocco</option>
					<option value="MZ" <?php echo $countryCode=="MZ"?'selected':'';?>>Mozambique</option>
					<option value="MM" <?php echo $countryCode=="MM"?'selected':'';?>>Myanmar</option>
					<option value="NA" <?php echo $countryCode=="NA"?'selected':'';?>>Namibia</option>
					<option value="NR" <?php echo $countryCode=="NR"?'selected':'';?>>Nauru</option>
					<option value="NP" <?php echo $countryCode=="NP"?'selected':'';?>>Nepal</option>
					<option value="NL" <?php echo $countryCode=="NL"?'selected':'';?>>Netherlands</option>
					<option value="AN" <?php echo $countryCode=="AN"?'selected':'';?>>Netherlands Antilles</option>
					<option value="NC" <?php echo $countryCode=="NC"?'selected':'';?>>New Caledonia</option>
					<option value="NZ" <?php echo $countryCode=="NZ"?'selected':'';?>>New Zealand</option>
					<option value="NI" <?php echo $countryCode=="NI"?'selected':'';?>>Nicaragua</option>
					<option value="NE" <?php echo $countryCode=="NE"?'selected':'';?>>Niger</option>
					<option value="NG" <?php echo $countryCode=="NG"?'selected':'';?>>Nigeria</option>
					<option value="NU" <?php echo $countryCode=="NU"?'selected':'';?>>Niue</option>
					<option value="NF" <?php echo $countryCode=="NF"?'selected':'';?>>Norfolk Island</option>
					<option value="MP" <?php echo $countryCode=="MP"?'selected':'';?>>Northern Mariana Islands</option>
					<option value="NO" <?php echo $countryCode=="NO"?'selected':'';?>>Norway</option>
					<option value="OM" <?php echo $countryCode=="OM"?'selected':'';?>>Oman</option>
					<option value="PK" <?php echo $countryCode=="PK"?'selected':'';?>>Pakistan</option>
					<option value="PW" <?php echo $countryCode=="PW"?'selected':'';?>>Palau</option>
					<option value="PA" <?php echo $countryCode=="PA"?'selected':'';?>>Panama</option>
					<option value="PG" <?php echo $countryCode=="PG"?'selected':'';?>>Papua New Guinea</option>
					<option value="PY" <?php echo $countryCode=="PY"?'selected':'';?>>Paraguay</option>
					<option value="PE" <?php echo $countryCode=="PE"?'selected':'';?>>Peru</option>
					<option value="PH" <?php echo $countryCode=="PH"?'selected':'';?>>Philippines</option>
					<option value="PN" <?php echo $countryCode=="PN"?'selected':'';?>>Pitcairn</option>
					<option value="PL" <?php echo $countryCode=="PL"?'selected':'';?>>Poland</option>
					<option value="PT" <?php echo $countryCode=="PT"?'selected':'';?>>Portugal</option>
					<option value="PR" <?php echo $countryCode=="PR"?'selected':'';?>>Puerto Rico</option>
					<option value="QA" <?php echo $countryCode=="QA"?'selected':'';?>>Qatar</option>
					<option value="RE" <?php echo $countryCode=="RE"?'selected':'';?>>Reunion</option>
					<option value="RO" <?php echo $countryCode=="RO"?'selected':'';?>>Romania</option>
					<option value="RU" <?php echo $countryCode=="RU"?'selected':'';?>>Russian Federation</option>
					<option value="RW" <?php echo $countryCode=="RW"?'selected':'';?>>Rwanda</option>
					<option value="KN" <?php echo $countryCode=="KN"?'selected':'';?>>Saint Kitts and Nevis</option>
					<option value="LC" <?php echo $countryCode=="LC"?'selected':'';?>>Saint LUCIA</option>
					<option value="VC" <?php echo $countryCode=="VC"?'selected':'';?>>Saint Vincent and the Grenadines</option>
					<option value="WS" <?php echo $countryCode=="WS"?'selected':'';?>>Samoa</option>
					<option value="SM" <?php echo $countryCode=="SM"?'selected':'';?>>San Marino</option>
					<option value="ST" <?php echo $countryCode=="ST"?'selected':'';?>>Sao Tome and Principe</option>
					<option value="SA" <?php echo $countryCode=="SA"?'selected':'';?>>Saudi Arabia</option>
					<option value="SN" <?php echo $countryCode=="SN"?'selected':'';?>>Senegal</option>
					<option value="SC" <?php echo $countryCode=="SC"?'selected':'';?>>Seychelles</option>
					<option value="SL" <?php echo $countryCode=="SL"?'selected':'';?>>Sierra Leone</option>
					<option value="SG" <?php echo $countryCode=="SG"?'selected':'';?>>Singapore</option>
					<option value="SK" <?php echo $countryCode=="SK"?'selected':'';?>>Slovakia (Slovak Republic)</option>
					<option value="SI" <?php echo $countryCode=="SI"?'selected':'';?>>Slovenia</option>
					<option value="SB" <?php echo $countryCode=="SB"?'selected':'';?>>Solomon Islands</option>
					<option value="SO" <?php echo $countryCode=="SO"?'selected':'';?>>Somalia</option>
					<option value="ZA" <?php echo $countryCode=="ZA"?'selected':'';?>>South Africa</option>
					<option value="GS" <?php echo $countryCode=="GS"?'selected':'';?>>South Georgia and the South Sandwich Islands</option>
					<option value="ES" <?php echo $countryCode=="ES"?'selected':'';?>>Spain</option>
					<option value="LK" <?php echo $countryCode=="LK"?'selected':'';?>>Sri Lanka</option>
					<option value="SH" <?php echo $countryCode=="SH"?'selected':'';?>>St. Helena</option>
					<option value="PM" <?php echo $countryCode=="PM"?'selected':'';?>>St. Pierre and Miquelon</option>
					<option value="SD" <?php echo $countryCode=="SD"?'selected':'';?>>Sudan</option>
					<option value="SR" <?php echo $countryCode=="SR"?'selected':'';?>>Suriname</option>
					<option value="SJ" <?php echo $countryCode=="SJ"?'selected':'';?>>Svalbard and Jan Mayen Islands</option>
					<option value="SZ" <?php echo $countryCode=="SZ"?'selected':'';?>>Swaziland</option>
					<option value="SE" <?php echo $countryCode=="SE"?'selected':'';?>>Sweden</option>
					<option value="CH" <?php echo $countryCode=="CH"?'selected':'';?>>Switzerland</option>
					<option value="SY" <?php echo $countryCode=="SY"?'selected':'';?>>Syrian Arab Republic</option>
					<option value="TW" <?php echo $countryCode=="TW"?'selected':'';?>>Taiwan, Province of China</option>
					<option value="TJ" <?php echo $countryCode=="TJ"?'selected':'';?>>Tajikistan</option>
					<option value="TZ" <?php echo $countryCode=="TZ"?'selected':'';?>>Tanzania, United Republic of</option>
					<option value="TH" <?php echo $countryCode=="TH"?'selected':'';?>>Thailand</option>
					<option value="TG" <?php echo $countryCode=="TG"?'selected':'';?>>Togo</option>
					<option value="TK" <?php echo $countryCode=="TK"?'selected':'';?>>Tokelau</option>
					<option value="TO" <?php echo $countryCode=="TO"?'selected':'';?>>Tonga</option>
					<option value="TT" <?php echo $countryCode=="TT"?'selected':'';?>>Trinidad and Tobago</option>
					<option value="TN" <?php echo $countryCode=="TN"?'selected':'';?>>Tunisia</option>
					<option value="TR" <?php echo $countryCode=="TR"?'selected':'';?>>Turkey</option>
					<option value="TM" <?php echo $countryCode=="TM"?'selected':'';?>>Turkmenistan</option>
					<option value="TC" <?php echo $countryCode=="TC"?'selected':'';?>>Turks and Caicos Islands</option>
					<option value="TV" <?php echo $countryCode=="TV"?'selected':'';?>>Tuvalu</option>
					<option value="UG" <?php echo $countryCode=="UG"?'selected':'';?>>Uganda</option>
					<option value="UA" <?php echo $countryCode=="UA"?'selected':'';?>>Ukraine</option>
					<option value="AE" <?php echo $countryCode=="AE"?'selected':'';?>>United Arab Emirates</option>
					<option value="GB" <?php echo $countryCode=="GB"?'selected':'';?>>United Kingdom</option>
					<option value="US" <?php echo $countryCode=="US"?'selected':'';?>>United States</option>
					<option value="UM" <?php echo $countryCode=="UM"?'selected':'';?>>United States Minor Outlying Islands</option>
					<option value="UY" <?php echo $countryCode=="UY"?'selected':'';?>>Uruguay</option>
					<option value="UZ" <?php echo $countryCode=="UZ"?'selected':'';?>>Uzbekistan</option>
					<option value="VU" <?php echo $countryCode=="VU"?'selected':'';?>>Vanuatu</option>
					<option value="VE" <?php echo $countryCode=="VE"?'selected':'';?>>Venezuela</option>
					<option value="VN" <?php echo $countryCode=="VN"?'selected':'';?>>Viet Nam</option>
					<option value="VG" <?php echo $countryCode=="VG"?'selected':'';?>>Virgin Islands (British)</option>
					<option value="VI" <?php echo $countryCode=="VI"?'selected':'';?>>Virgin Islands (U.S.)</option>
					<option value="WF" <?php echo $countryCode=="WF"?'selected':'';?>>Wallis and Futuna Islands</option>
					<option value="EH" <?php echo $countryCode=="EH"?'selected':'';?>>Western Sahara</option>
					<option value="YE" <?php echo $countryCode=="YE"?'selected':'';?>>Yemen</option>
					<option value="YU" <?php echo $countryCode=="YU"?'selected':'';?>>Yugoslavia</option>
					<option value="ZM" <?php echo $countryCode=="ZM"?'selected':'';?>>Zambia</option>
					<option value="ZW" <?php echo $countryCode=="ZW"?'selected':'';?>>Zimbabwe</option>
				</select>

				Select Climbing Area Type:

					Indoor Gym
					Outdoor Crag

Gym:

					(Add a new climbing area)

					<select id="select-gym" class="form-control" name="gymid" required>

					</select>

				<input type='checkbox' name='default-gym' checked>
Set as default gym

			<input id="main_gymid" value=<?php echo empty($main_gymid) ? 0 : $main_gymid ?> style="display:none">
			<input id="main_cragid" value=<?php echo empty($main_cragid) ? 0 : $main_cragid ?> style="display:none">
			<input id="main_climbingid" value=<?php echo empty($main_gymid) ? 0 : $main_gymid ?> style="display:none">

			<input id="climbingAreaType" value="1" name="gym-indoor" type="number" style="display:none">

				Workout Date:
				<input type="text" name="workoutdate" class="form-control datepicker">

			<div data-content="Points calculation detailed here" class="alert alert-info fixedElement" id="current-points">

Current Points: 0

			<div class = "panel panel-default"
			<?php echo $show_boulder ? '' : 'style="display:none'?>">

  Bouldering

Bouldering Notes:

							<textarea name="boulderNotes" cols="50" rows="5"></textarea>

			<div class = "panel panel-default"
				<?php echo $show_TR ? '' : 'style="display:none'?>">

  Top-Roping

				<div id="collapseTwo" class="panel-collapse collapse <?php echo $show_boulder ? '' : 'in'?>">

Top-Roping Notes:

							<textarea name="TRNotes" cols="50" rows="5"></textarea>

			<div class = "panel panel-default"
				<?php echo $show_Lead ? '' : 'style="display:none'?>">

  Leading

				<div id="collapseThree" class="panel-collapse collapse <?php echo (!$show_boulder)&&(!$show_TR) ? 'in' : ''?>">

Leading Notes:

							<textarea name="LeadNotes" cols="50" rows="5"></textarea>

  Other (Hangboard, Campus board, etc.)

Other Notes:

							<textarea name="OtherNotes" cols="50" rows="6"></textarea>

		<button type="submit" name="workoutsubmit" class="btn btn-default btn-success" id="btn-submit-workout">
			Submit Workout
		</button>

		</form>


text:
<?php

namespace Backend\Modules\Faq\Actions;

use Backend\Core\Engine\Base\ActionAdd as BackendBaseActionAdd;
use Backend\Core\Engine\Authentication as BackendAuthentication;
use Backend\Core\Engine\Form as BackendForm;
use Backend\Core\Language\Language as BL;
use Backend\Core\Engine\Model as BackendModel;
use Backend\Core\Engine\Meta as BackendMeta;
use Backend\Modules\Faq\Engine\Model as BackendFaqModel;
use Backend\Modules\Search\Engine\Model as BackendSearchModel;
use Backend\Modules\Tags\Engine\Model as BackendTagsModel;

/**
 * This is the add-action, it will display a form to create a new item
 */
class Add extends BackendBaseActionAdd
{
    public function execute(): void
    {
        parent::execute();

        $this->loadForm();
        $this->validateForm();

        $this->parse();
        $this->display();
    }

    private function loadForm(): void
    {
        // create form
        $this->form = new BackendForm('add');

        // set hidden values
        $rbtHiddenValues = [
            ['label' => BL::lbl('Hidden'), 'value' => 1],
            ['label' => BL::lbl('Published'), 'value' => 0],
        ];
        // get categories
        $categories = BackendFaqModel::getCategories();

        // create elements
        $this->form->addText('title', null, null, 'form-control title', 'form-control danger title')->makeRequired();
        $this->form->addEditor('answer')->makeRequired();
        $this->form->addRadiobutton('hidden', $rbtHiddenValues, 0);
        $this->form->addDropdown('category_id', $categories);
        $this->form->addText('tags', null, null, 'form-control js-tags-input', 'form-control danger js-tags-input');

        // meta
        $this->meta = new BackendMeta($this->form, null, 'title', true);
    }

    protected function parse(): void
    {
        parent::parse();

        // get url
        $url = BackendModel::getUrlForBlock($this->url->getModule(), 'Detail');
        $url404 = BackendModel::getUrl(BackendModel::ERROR_PAGE_ID);

        // parse additional variables
        if ($url404 != $url) {
            $this->template->assign('detailURL', SITE_URL . $url);
        }
    }

    private function validateForm(): void
    {
        if ($this->form->isSubmitted()) {
            $this->form->cleanupFields();

            // validate fields
            $this->form->getField('title')->isFilled(BL::err('QuestionIsRequired'));
            $this->form->getField('answer')->isFilled(BL::err('AnswerIsRequired'));
            $this->form->getField('category_id')->isFilled(BL::err('CategoryIsRequired'));
            $this->meta->validate();

            if ($this->form->isCorrect()) {
                // build item
                $item = [];
                $item['meta_id'] = $this->meta->save();
                $item['category_id'] = $this->form->getField('category_id')->getValue();
                $item['user_id'] = BackendAuthentication::getUser()->getUserId();
                $item['language'] = BL::getWorkingLanguage();
                $item['question'] = $this->form->getField('title')->getValue();
                $item['answer'] = $this->form->getField('answer')->getValue(true);
                $item['created_on'] = BackendModel::getUTCDate();
                $item['hidden'] = $this->form->getField('hidden')->getValue();
                $item['sequence'] = BackendFaqModel::getMaximumSequence(
                    $this->form->getField('category_id')->getValue()
                ) + 1;

                // save the data
                $item['id'] = BackendFaqModel::insert($item);
                BackendTagsModel::saveTags(
                    $item['id'],
                    $this->form->getField('tags')->getValue(),
                    $this->url->getModule()
                );

                // add search index
                BackendSearchModel::saveIndex(
                    $this->getModule(),
                    $item['id'],
                    [
                        'title' => $item['question'],
                        'text' => $item['answer'],
                    ]
                );
                $this->redirect(
                    BackendModel::createUrlForAction('Index') . '&report=added&var=' .
                    rawurlencode($item['question']) . '&highlight=' . $item['id']
                );
            }
        }
    }
}


text:
define([
], function(
) {
	'use strict';
	var _canvas, _config, _canvasInnerWrapper, _canvasOuterWrapper;

	var CanvasWrapper = {
		setup: function(canvas, config) {
			_canvas = canvas;
			_canvas.id = 'goo';
			_config = config || {};
		},

		add: function() {
			_canvasOuterWrapper = document.getElementById('canvas-outer');
			_canvasInnerWrapper = document.getElementById('canvas-inner');
			_canvasInnerWrapper.appendChild(_canvas);

			// Put the goo logo inside the inner canvas wrapper.
			var gooLogo = document.getElementById('goologo');
			if(gooLogo){
				_canvasInnerWrapper.appendChild(gooLogo);
			}

			// Make sure the canvas is updated when the window is resized.
			window.addEventListener('resize', CanvasWrapper.resize);

			_canvas.addEventListener('mousedown', CanvasWrapper.uninterruptedPan, true);
			_canvas.addEventListener('mouseup', CanvasWrapper.allowSelection, true);

			function prevent(e) {
				e.preventDefault();
				e.stopPropagation();
			}

			_canvas.addEventListener('mousewheel', prevent, true);
			_canvas.addEventListener('DOMMouseScroll', prevent, true);

			CanvasWrapper.resize();
		},

		hide: function() {
			_canvas.style.visibility = 'hidden';
		},

		show: function() {
			_canvas.style.visibility = 'visible';
		},

		/**
		 * Resizes the camera according to the configuration included in the
		 * bundle.
		 */
		resize: function() {
			if (_config.mode === 'Resolution' && _config.resolution) {
				setSize(_config.resolution.width, _config.resolution.height);
			} else if (_config.mode == 'AspectRatio' && _config.aspect) {
				var aspectWidth = _config.aspect.width;
				var aspectHeight = _config.aspect.height;

				var ratio = aspectWidth / aspectHeight;
				var windowAspectRatio = window.innerWidth / window.innerHeight;

				var width, height;

				// Top/Bottom letterbox
				if (ratio > windowAspectRatio) {
					width = window.innerWidth;
					height = width / ratio;
				// Left/Right letterbox
				} else {
					height = window.innerHeight;
					width = height * ratio;
				}

				setSize(width, height);
			} else {
				setSize();
			}
		},

		uninterruptedPan: function() {
			var htmlEntities = document.querySelectorAll('.goo-entity');
			for (var i = 0; i < htmlEntities.length; i++) {
				htmlEntities[i].classList.add('no-pointer');
			}
		},

		allowSelection: function() {
			var htmlEntities = document.querySelectorAll('.goo-entity');
			for (var i = 0; i < htmlEntities.length; i++) {
				htmlEntities[i].classList.remove('no-pointer');
			}
		}
	};

	/**
	 * Sets a custom size on the canvas.
	 *
	 * @param {number} width
	 *        The new width of the canvas.
	 * @param {number} height
	 *        The new height of the canvas.
	 */
	function setSize(width, height) {
		var classList = _canvasOuterWrapper.classList;

		if (width && height) {
			classList.add('custom');
			_canvasInnerWrapper.style.width = width + 'px';
			_canvasInnerWrapper.style.height = height + 'px';

			if (window.innerWidth > width) {
				classList.add('center-h');
			} else {
				classList.remove('center-h');
			}

			if (window.innerHeight > height) {
				classList.add('center-v');
			} else {
				classList.remove('center-v');
			}
		} else {
			classList.remove('custom');
			_canvasInnerWrapper.style.width = '';
			_canvasInnerWrapper.style.height = '';
		}
	};

	return CanvasWrapper;
});


text:
select (@i:=@i+1) as id
from (select (@i:=0)) as t0
cross join (select 0 union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) as t1
cross join (select 0 union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) as t2
;


text:
<?php

declare(strict_types=1);

namespace Broadway\Auditing;

/**
 * Command serializer that uses php hacks to get the data from a command.
 *
 * There are many other ways to implement serialization on commands, but since
 * this is only for logging purposes we get away with this solution for now.
 */
final class NullByteCommandSerializer implements CommandSerializer
{
    /**
     * {@inheritdoc}
     */
    public function serialize($command): array
    {
        $serializedCommand = [];
        foreach ((array) $command as $key => $value) {
            $serializedCommand[str_replace("\0", '-', $key)] = $value;
        }

        return $serializedCommand;
    }
}


text:
var futureStream = require('..');
var fs = require('fs');

function makeStream() {
  return fs.createWriteStream('/tmp/junk', { encoding: 'utf8' });
}

var start = Date.now();
function condition() {
  // true after 1 second
  return (Date.now() - start) > 1000;
}

var s = futureStream.write(makeStream, condition);
s.write('hello ');
s.write('world');
s.end();


text:
import { createCollection, /* getDefaultResolvers, getDefaultMutations */ } from 'meteor/vulcan:core';
import schema from './schema.js';

const Votes = createCollection({

  collectionName: 'Votes',

  typeName: 'Vote',

  schema,

  resolvers: null,

  mutations: null,

});

export default Votes;


text:
<!DOCTYPE html>
<link rel="author" title="Morten Stenshorne" href="mailto:mstensho@chromium.org">

There should be one blue square and one hotpink one.


text:
<?php

return array(
    'ezcArchiveException'                 => 'Archive/exceptions/exception.php',
    'ezcArchiveBlockSizeException'        => 'Archive/exceptions/block_size.php',
    'ezcArchiveChecksumException'         => 'Archive/exceptions/checksum.php',
    'ezcArchiveEmptyException'            => 'Archive/exceptions/empty.php',
    'ezcArchiveEntryPrefixException'      => 'Archive/exceptions/entry_prefix.php',
    'ezcArchiveInternalException'         => 'Archive/exceptions/internal_exception.php',
    'ezcArchiveIoException'               => 'Archive/exceptions/io.php',
    'ezcArchiveUnknownTypeException'      => 'Archive/exceptions/unknown_type.php',
    'ezcArchiveValueException'            => 'Archive/exceptions/value.php',
    'ezcArchive'                          => 'Archive/archive.php',
    'ezcArchiveV7Header'                  => 'Archive/tar/headers/v7.php',
    'ezcArchiveV7Tar'                     => 'Archive/tar/v7.php',
    'ezcArchiveFile'                      => 'Archive/file/file.php',
    'ezcArchiveLocalFileHeader'           => 'Archive/zip/headers/local_file.php',
    'ezcArchiveUstarHeader'               => 'Archive/tar/headers/ustar.php',
    'ezcArchiveUstarTar'                  => 'Archive/tar/ustar.php',
    'ezcArchiveBlockFile'                 => 'Archive/file/block_file.php',
    'ezcArchiveCentralDirectoryEndHeader' => 'Archive/zip/headers/central_directory_end.php',
    'ezcArchiveCentralDirectoryHeader'    => 'Archive/zip/headers/central_directory.php',
    'ezcArchiveCharacterFile'             => 'Archive/file/character_file.php',
    'ezcArchiveChecksums'                 => 'Archive/utils/checksums.php',
    'ezcArchiveEntry'                     => 'Archive/entry.php',
    'ezcArchiveFileStructure'             => 'Archive/structs/file.php',
    'ezcArchiveFileType'                  => 'Archive/utils/file_type.php',
    'ezcArchiveGnuHeader'                 => 'Archive/tar/headers/gnu.php',
    'ezcArchiveGnuTar'                    => 'Archive/tar/gnu.php',
    'ezcArchiveOptions'                   => 'Archive/options/archive.php',
    'ezcArchivePaxHeader'                 => 'Archive/tar/headers/pax.php',
    'ezcArchivePaxTar'                    => 'Archive/tar/pax.php',
    'ezcArchiveStatMode'                  => 'Archive/utils/stat_mode.php',
    'ezcArchiveZip'                       => 'Archive/zip/zip.php',
);
?>


text:
title: CAROLINE FRIES, SÜDDEUTSCHE ZEITUNG (Germany) on Stella Descending
book: en/books/stella-descending.md
date: 2004-01-05 00:00:00 -0500
type: review
attribution: CAROLINE FRIES, SÜDDEUTSCHE ZEITUNG (Germany)
file: ''
featured: false
weight: ''

---
After her first novel _Before You Sleep_, the 36 year old literary critic … with _Stella Decending_ once again succeeds in writing a book about longing, dreams and the absurdities of life. Simply beautiful.


text:
neutron_path=$(cd "$(dirname "$0")/.." && pwd)
base_test_path=neutron/tests/unit
test_path=$neutron_path/$base_test_path

test_files=$(find ${test_path} -iname 'test_*.py')

ignore_regexes=(
    # The following vendor plugins are not required to confrm to the
    # structural requirements.
    "^plugins/brocade.*$"
    "^plugins/cisco.*$"
    "^plugins/embrane.*$"
    "^plugins/ibm.*$"
    "^plugins/oneconvergence.*$"
    # The following open source plugin tests are not actually unit
    # tests and are ignored pending their relocation to the functional
    # test tree.
    "^plugins/ml2/drivers/mech_sriov/mech_driver/test_mech_sriov_nic_switch.py$"
    "^plugins/ml2/test_security_group.py$"
    "^plugins/ml2/test_port_binding.py$"
    "^plugins/ml2/test_extension_driver_api.py$"
    "^plugins/ml2/test_ext_portsecurity.py$"
    "^plugins/ml2/test_agent_scheduler.py$"
    "^plugins/ml2/drivers/openvswitch/agent/test_agent_scheduler.py$"
    "^plugins/ml2/drivers/openvswitch/agent/test_ovs_tunnel.py$"
    "^plugins/openvswitch/test_agent_scheduler.py$"
)

error_count=0
ignore_count=0
total_count=0
for test_file in ${test_files[@]}; do
    relative_path=${test_file#$test_path/}
    expected_path=$(dirname $neutron_path/neutron/$relative_path)
    test_filename=$(basename "$test_file")
    expected_filename=${test_filename#test_}
    # Module filename (e.g. foo/bar.py -> foo/test_bar.py)
    filename=$expected_path/$expected_filename
    # Package dir (e.g. foo/ -> test_foo.py)
    package_dir=${filename%.py}
    if [ ! -f "$filename" ] && [ ! -d "$package_dir" ]; then
        for ignore_regex in ${ignore_regexes[@]}; do
            if [[ "$relative_path" =~ $ignore_regex ]]; then
                ((ignore_count++))
                continue 2
            fi
        done
        echo "Unexpected test file: $base_test_path/$relative_path"
        ((error_count++))
    fi
    ((total_count++))
done

if [ "$ignore_count" -ne 0 ]; then
    echo "$ignore_count unmatched test modules were ignored"
fi

if [ "$error_count" -eq 0 ]; then
    echo 'Success!  All test modules match targets in the code tree.'
    exit 0
else
    echo "Failure! $error_count of $total_count test modules do not match targets in the code tree."
    exit 1
fi


text:
package com.flipkart.flux.client.intercept;

import java.lang.reflect.Method;
import java.util.Arrays;

/**
 * Used to uniquely Identify a task's method.
 * There are times when we need to work out individual components of a method name
 * This class provides for easy access to them
 * @author yogesh.nachnani
 */
public class MethodId {
    public static final String UNDERSCORE = "_";
    /* Canonical Name of the class containing the method */
    private String className;
    /* Name of the method that needs to be executed */
    private String methodName;
    /* Ordered list of parameter types used by the method */
    private Class<?>[] parameterTypes;
    /* Return type of the method */
    private String returnType;

    /* Creates a MethodId representation using a given string representation */
    public static MethodId fromIdentifier(String identifier) throws ClassNotFoundException {
        final String[] splitIdentifier = identifier.split(UNDERSCORE);
        final MethodId generatedMethodId = new MethodId();
        try {
            generatedMethodId.className = splitIdentifier[0];
            generatedMethodId.methodName = splitIdentifier[1];
            generatedMethodId.returnType = splitIdentifier[2];
        } catch (ArrayIndexOutOfBoundsException e) {
            /* We have a case of a malformed String identifier */
            throw  new MalformedIdentifierException("Malformed identifier : " + identifier);
        }
        if (splitIdentifier.length > 3 ) {
            generatedMethodId.parameterTypes = new Class<?>[splitIdentifier.length - 3];
            for (int i = 3; i < splitIdentifier.length ; i++) {
                generatedMethodId.parameterTypes[splitIdentifier.length-i-1] = Class.forName(splitIdentifier[i]);
            }
        }
        return generatedMethodId;
    }

    private MethodId() {
    }

    public MethodId(Method method) {
        this.className = method.getDeclaringClass().getCanonicalName();
        this.methodName = method.getName();
        this.parameterTypes = method.getParameterTypes();
        this.returnType = method.getReturnType().getCanonicalName();
    }

    public String getPrefix() {
        return className + UNDERSCORE + methodName;
    }

    /* Accessor methods */
    public String getClassName() {
        return className;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        MethodId methodId = (MethodId) o;

        if (className != null ? !className.equals(methodId.className) : methodId.className != null) return false;
        if (methodName != null ? !methodName.equals(methodId.methodName) : methodId.methodName != null) return false;
        // Probably incorrect - comparing Object[] arrays with Arrays.equals
        if (!Arrays.equals(parameterTypes, methodId.parameterTypes)) return false;
        return !(returnType != null ? !returnType.equals(methodId.returnType) : methodId.returnType != null);

    }

    @Override
    public int hashCode() {
        int result = className != null ? className.hashCode() : 0;
        result = 31 * result + (methodName != null ? methodName.hashCode() : 0);
        result = 31 * result + (parameterTypes != null ? Arrays.hashCode(parameterTypes) : 0);
        result = 31 * result + (returnType != null ? returnType.hashCode() : 0);
        return result;
    }

    @Override
    public String toString() {
        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append(getPrefix());
        stringBuilder.append(UNDERSCORE);
        stringBuilder.append(this.returnType);
        for (Class<?> parameterType : parameterTypes) {
            stringBuilder.append(UNDERSCORE);
            stringBuilder.append(parameterType.getName());
        }
        return stringBuilder.toString();
    }

    public String getMethodName() {
        return this.methodName;
    }

    public Class<?>[] getParameterTypes() {
        return parameterTypes;
    }
}


text:
package v2

import (
	"os"

	"code.cloudfoundry.org/cli/cf/cmd"
	"code.cloudfoundry.org/cli/commands"
	"code.cloudfoundry.org/cli/commands/flags"
)

type DisallowSpaceSSHCommand struct {
	RequiredArgs    flags.Space `positional-args:"yes"`
	usage           interface{} `usage:"CF_NAME disallow-space-ssh SPACE_NAME"`
	relatedCommands interface{} `related_commands:"disable-ssh, space-ssh-allowed, ssh, ssh-enabled"`
}

func (_ DisallowSpaceSSHCommand) Setup(config commands.Config, ui commands.UI) error {
	return nil
}

func (_ DisallowSpaceSSHCommand) Execute(args []string) error {
	cmd.Main(os.Getenv("CF_TRACE"), os.Args)
	return nil
}


text:
namespace Envoy {
namespace Http {
namespace RateLimit {

namespace {

static const Http::HeaderMap* getTooManyRequestsHeader() {
  static const Http::HeaderMap* header_map = new Http::HeaderMapImpl{
      {Http::Headers::get().Status, std::to_string(enumToInt(Code::TooManyRequests))}};
  return header_map;
}

} // namespace;

void Filter::initiateCall(const HeaderMap& headers) {
  bool is_internal_request =
      headers.EnvoyInternalRequest() && (headers.EnvoyInternalRequest()->value() == "true");

  if ((is_internal_request && config_->requestType() == FilterRequestType::External) ||
      (!is_internal_request && config_->requestType() == FilterRequestType::Internal)) {
    return;
  }

  Router::RouteConstSharedPtr route = callbacks_->route();
  if (!route || !route->routeEntry()) {
    return;
  }

  const Router::RouteEntry* route_entry = route->routeEntry();
  Upstream::ThreadLocalCluster* cluster = config_->cm().get(route_entry->clusterName());
  if (!cluster) {
    return;
  }
  cluster_ = cluster->info();

  std::vector<Envoy::RateLimit::Descriptor> descriptors;

  // Get all applicable rate limit policy entries for the route.
  populateRateLimitDescriptors(route_entry->rateLimitPolicy(), descriptors, route_entry, headers);

  // Get all applicable rate limit policy entries for the virtual host if the route opted to
  // include the virtual host rate limits.
  if (route_entry->includeVirtualHostRateLimits()) {
    populateRateLimitDescriptors(route_entry->virtualHost().rateLimitPolicy(), descriptors,
                                 route_entry, headers);
  }

  if (!descriptors.empty()) {
    state_ = State::Calling;
    initiating_call_ = true;
    client_->limit(
        *this, config_->domain(), descriptors,
        {headers.RequestId() ? headers.RequestId()->value().c_str() : EMPTY_STRING,
         headers.OtSpanContext() ? headers.OtSpanContext()->value().c_str() : EMPTY_STRING});
    initiating_call_ = false;
  }
}

FilterHeadersStatus Filter::decodeHeaders(HeaderMap& headers, bool) {
  if (!config_->runtime().snapshot().featureEnabled("ratelimit.http_filter_enabled", 100)) {
    return FilterHeadersStatus::Continue;
  }

  initiateCall(headers);
  return (state_ == State::Calling || state_ == State::Responded)
             ? FilterHeadersStatus::StopIteration
             : FilterHeadersStatus::Continue;
}

FilterDataStatus Filter::decodeData(Buffer::Instance&, bool) {
  ASSERT(state_ != State::Responded);
  return state_ == State::Calling ? FilterDataStatus::StopIterationAndBuffer
                                  : FilterDataStatus::Continue;
}

FilterTrailersStatus Filter::decodeTrailers(HeaderMap&) {
  ASSERT(state_ != State::Responded);
  return state_ == State::Calling ? FilterTrailersStatus::StopIteration
                                  : FilterTrailersStatus::Continue;
}

void Filter::setDecoderFilterCallbacks(StreamDecoderFilterCallbacks& callbacks) {
  callbacks_ = &callbacks;
}

void Filter::onDestroy() {
  if (state_ == State::Calling) {
    state_ = State::Complete;
    client_->cancel();
  }
}

void Filter::complete(Envoy::RateLimit::LimitStatus status) {
  state_ = State::Complete;

  switch (status) {
  case Envoy::RateLimit::LimitStatus::OK:
    cluster_->statsScope().counter("ratelimit.ok").inc();
    break;
  case Envoy::RateLimit::LimitStatus::Error:
    cluster_->statsScope().counter("ratelimit.error").inc();
    break;
  case Envoy::RateLimit::LimitStatus::OverLimit:
    cluster_->statsScope().counter("ratelimit.over_limit").inc();
    Http::CodeUtility::ResponseStatInfo info{config_->scope(), cluster_->statsScope(), EMPTY_STRING,
                                             *getTooManyRequestsHeader(), true, EMPTY_STRING,
                                             EMPTY_STRING, EMPTY_STRING, EMPTY_STRING, false};
    Http::CodeUtility::chargeResponseStat(info);
    break;
  }

  if (status == Envoy::RateLimit::LimitStatus::OverLimit &&
      config_->runtime().snapshot().featureEnabled("ratelimit.http_filter_enforcing", 100)) {
    state_ = State::Responded;
    Http::HeaderMapPtr response_headers{new HeaderMapImpl(*getTooManyRequestsHeader())};
    callbacks_->encodeHeaders(std::move(response_headers), true);
    callbacks_->requestInfo().setResponseFlag(Http::AccessLog::ResponseFlag::RateLimited);
  } else if (!initiating_call_) {
    callbacks_->continueDecoding();
  }
}

void Filter::populateRateLimitDescriptors(const Router::RateLimitPolicy& rate_limit_policy,
                                          std::vector<Envoy::RateLimit::Descriptor>& descriptors,
                                          const Router::RouteEntry* route_entry,
                                          const HeaderMap& headers) const {
  for (const Router::RateLimitPolicyEntry& rate_limit :
       rate_limit_policy.getApplicableRateLimit(config_->stage())) {
    const std::string& disable_key = rate_limit.disableKey();
    if (!disable_key.empty() &&
        !config_->runtime().snapshot().featureEnabled(
            fmt::format("ratelimit.{}.http_filter_enabled", disable_key), 100)) {
      continue;
    }
    rate_limit.populateDescriptors(*route_entry, descriptors, config_->localInfo().clusterName(),
                                   headers, callbacks_->downstreamAddress());
  }
}

} // RateLimit
} // Http
} // Envoy


text:
package imageshack

// "success":true,
//    "process_time":32,
//    "result":{
//       "id":"idggZf2Aj",
//       "server":661,
//       "bucket":8761,
//       "filename":"ggZf2A.jpg",
//       "original_filename":"e1ab262c288441e252ea507676e6c8a8.jpg",
//       "direct_link":"imagizer.imageshack.com\/img661\/8761\/ggZf2A.jpg",

// Image struct that hold JSON http response
type Image struct {
	Result struct {
		Direct_link string
	}
}

// ImageShack naked struct
// Note that naked structs are zero cost memory
type ImageShack struct {
}

// NewImageShack alloc and returns a new *ImageShack
func NewImageShack() (i *ImageShack) {
	return &ImageShack{}
}


text:
'use strict';

const path = require('path');

module.exports = config => {
        config.set({
                basePath: path.resolve(__dirname, '..'),
                frameworks: ['mocha-webworker'],

                files: [
                        {pattern: 'test/mocha/simple.js', included: false},
                        {pattern: 'test/mocha/assert-type-shared.js', included: false},
                ],

                client: {
                        mochaWebWorker: {
                                worker: 'SharedWorker',
                                pattern: [
                                        'test/mocha/simple.js',
                                        'test/mocha/assert-type-shared.js',
                                ],
                        },
                },
                reporters: ['progress'],
                port: 9876,
                colors: true,
                logLevel: config.LOG_DEBUG,

                browsers: ['Firefox', 'Chrome'],
                singleRun: true,
        });
};


text:
/**
 * Genome Sequencing (hard)
 * https://www.codingame.com/training/hard/genome-sequencing
 * Statement:
 * The goal of this puzzle is calculate the length of the shortest string
 * sequence that contains all the sub-sequences of the input data. You will
 * have to compute the list of all possible permutations and merge strings
 * together. This is also a good exercise for optimization and to discover
 * dynamic programming.
 * Story:
 * Guanine, Thymine, Cytosine... You might have heard of those things in
 * biology class, but forgot them on the spot. Don't worry, we all have. The
 * goal of this exercise is to find how to combine chains of nucleotides
 * (sorry, characters) in a way in which they take the least possible room.
 */
let N = +readline();
const subseq = [];

while (N--) {
    subseq.push(readline());
}

const results = [];

function mutate(arr, firstpart) {
    if (arr.length) {
        for(let i = 0; i < arr.length; i++) {
            const chain = arr.slice();
            const part = chain.splice(i, 1);
            mutate(chain, (firstpart || []).concat(part));
        }
    } else {
        let totalLength = firstpart.join``.length;

        if (firstpart.length === 1) {
            return results.push(firstpart[0].length);
        }

        for (let i=1; i<firstpart.length; i++) {
            const [curr, prev] = [firstpart[i], firstpart[i-1]];
            const [cLength, pLength] = [curr.length, prev.length];

            if (~prev.indexOf(curr)) {
                totalLength -= cLength;
            } else {
                for(let j = Math.max(0, pLength - cLength); j < pLength; j++) {
                    if (curr.indexOf(prev.slice(j)) === 0) {
                        totalLength -= pLength - j;
                        break;
                    }
                }
            }
        }
        results.push(totalLength);
    }
}

mutate(subseq);
print(Math.min(...results));


text:
published: true
layout: guide-post
order: 2

title: Incrementar la interoperabilidad y usabilidad de los Datos Abiertos
date: 2015-07-06
step: 2
step_order: 2.2
prev_link: /guia/publica/paso-2-1.html
next_link: /guia/publica/paso-2-3.html
section_title: Publica

permalink: "/guia/publica/paso-2-2.html"
section: publish
category: publish
---

      Tiempo para el cumplimiento
      90 días naturales para la primera iteración, y de manera continua y según sea recomendado por la Unidad en conjunto con la Coordinación.

      Áreas Involucradas
      Administrador de Datos Abiertos; Unidades Administrativas o áreas generadoras y/o administradoras de datos.

      Resumen de acciones a realizar

Utilizar el Marco Geoestadístico Nacional para todos los nuevos Recursos de Datos publicados que contengan referencias geográficas.

Utilizar el formato UTF-8 para la codificación de los textos en todos los nuevos Recursos de Datos publicados.

Utilizar el estándar ISO 8601 para todos los nuevos Recursos de Datos publicados que contengan referencias temporales.

Utilizar el estándar para la generación y publicación de boletines y notificaciones técnicas como Datos Abiertos.

Cuando sea necesario, utilizar el estándar para fomentar el uso y visualización de datos en datos.gob.mx.

Adecuar los procesos de generación o administración de datos para orientar la generación de Recursos de Datos de conformidad con estándares y convenciones generales.

A fin de que los datos sean más útiles, estos deben ser fáciles de encontrar y comparar dentro y entre sectores, a través de localizaciones geográficas y del tiempo, por lo anterior, se deben emprender acciones para mejorar:
- La **interoperabilidad** de los datos publicados mediante su estandarización, y
- La **usabilidad** de los datos, mejorando la legibilidad y lógica de publicación de los conjuntos y recursos de datos.

#### Interoperabilidad de Datos Abiertos

Para incrementar la interoperabilidad de los Datos Abiertos las áreas generadoras o administradoras de Datos deberán utilizar:
- El **Catálogo Único de Claves de Áreas Geoestadísticas Estatales Municipales y Localidades** para el registro de información de domicilios (Anexo 2);
- El estándar **ISO-8601** para el registro fechas, horas y periodos de tiempo;
- Codificación de texto en formato **UTF-8**;
- El estándar **ASCII6**;
- Los estándares en materia de **datos para contrataciones abiertas** impulsados por el Gobierno de la República;
- El estándar **para la generación y publicación de boletines y notificaciones técnicas como Datos Abiertos** (ver manuales en línea en datos.gob.mx/guia) impulsados por el Gobierno de la República; y,
- Los **lineamientos para fomentar el uso y visualización de datos** en datos.gob.mx (ver recursos en línea) establecidos por la UGD, en colaboración con la  Coordinación.

#### Usabilidad

Para incrementar la usabilidad de los Datos Abiertos, las instituciones deberán:
- **Promover la legibilidad por máquinas**: Se deberá utilizar en la medida de lo posible, formatos de archivo como JSON y XML. Incrementar la legibilidad por máquinas se refiere a hacer disponible información en un formato digital, así como a que la información se encuentre en un formato de archivo cuya estructura sea adecuada para su procesamiento por computadora. Para lo anterior se recomienda:
  * Eliminar cálculos adicionales en formatos tabulares, p. ej. una celda "Total" con la suma de una de las columnas.
  * Remover imágenes, celdas unidas, y cualquier otra decoración de los archivos; para facilitar su procesamiento, estos deben ser planos.
  * Los campos numéricos, incluyendo los monetarios y magnitudes, deben permanecer en un formato numérico de tipo entero o flotante. Es decir, evitar agregar símbolos monetarios o de unidades de medición, p. ej. "200 m2" o "£20", haciendo explícitas las unidades en el nombre de la columna, o en una segunda columna. P. ej. "Monto en MXN", "Distancia en KM".
- **Promover la legibilidad por humanos**: Se podrá publicar los datos en diversos formatos que, además de permitir la legibilidad por máquina, permitan a un usuario comprender los Datos Abiertos. Para lo anterior se recomienda:
  * Acompañar formatos abiertos por archivos XLS, a manera de que usuarios de diferentes niveles de conocimiento técnico puedan usarlo.
  * Describir claramente los nombres de columnas, p. ej. "Fecha de solicitud" en lugar de "fech_sol". En caso de mantener dicha codificación, se deberá acompañar el conjunto de datos con un diccionario de datos11 (ver ACTIVIDAD C: Documentar los conjuntos de datos).
  * Evitar tener valores de diferentes tipos (como texto y número) para una columna en diferentes registros o filas.
  * Evitar información duplicada.
  * Eliminar redundancia en datos.
  * Asegurar la representación de variables (unificar datos).
  * Evitar el uso de rangos numéricos y optar por rangos definidos en el ISO 8601, p. ej. en lugar de 0-5, 6-10, usar quinquenios; y,
  * Evitar errores sintácticos.
- **Establecer categorizaciones de datos**: Utilizar categorías bien definidas facilita la consulta y el análisis de datos masivos. Las categorías permiten agrupar datos conforme a una cierta característica o propiedad en común. El establecimiento de categorías en los datos se podrá realizar utilizando atributos de los datos para los cuales es posible establecer valores predefinidos.
- Cualquier recomendación de estándares realizada por la Unidad, en colaboración con la Coordinación.


text:
package com.bitlimit.bits.persistence;

import com.bitlimit.bits.configuration.ConfigurationManager;
import org.javalite.activejdbc.Base;

/**
 * Created with IntelliJ IDEA.
 * User: kolin
 * Date: 12/15/13
 * Time: 4:31 PM
 * To change this template use File | Settings | File Templates.
 */
public class PersistenceThread extends Thread
{
	PersistenceThread(Runnable target)
	{
		super(target);
	}

	@Override
	public void run()
	{
		this.setup();

		super.run();

		this.cleanup();
	}

	private void setup()
	{
		/* Create a database connection for the runnables to use. */
		ConfigurationManager configurationManager = ConfigurationManager.getSharedManager();

		Base.open("org.postgresql.Driver", configurationManager.getPostgresURI(), configurationManager.getPostgresUsername(), configurationManager.getPostgresPassword());
	}

	private void cleanup()
	{
		/* Close the shared database connection. */
		Base.close();
	}
}


text:
DD_DETAIL_BEGIN_
template <>
struct WeakPointer<void> {
	public:
	DD_ALIAS(ThisType, WeakPointer<void>);
	DD_VALUE_TYPE_NESTED(void);

	public:
	DD_SPECIFIC_TYPE_NESTED(Manager, ReferenceManagerBase_);

	public:
	DD_ALIAS(StrongType, StrongPointer<ValueType>);

	private:
	ManagerPointerType m_manager_pointer_ DD_IN_CLASS_INITIALIZE(get_nil_reference_manager_());

	public:
#	if __cplusplus >= 201103L
	WeakPointer() = default;
#	else
	WeakPointer() throw() : m_manager_pointer_(get_nil_reference_manager_()) {
	}
#	endif

	public:
	WeakPointer(ThisType const& origin_) DD_NOEXCEPT : m_manager_pointer_(origin_.get_manager_pointer_()) {
		get_manager_pointer_()->weakly_referred_();
	}

	public:
	WeakPointer(ThisType&& origin_) DD_NOEXCEPT : m_manager_pointer_(origin_.get_manager_pointer_()) {
		origin_.m_manager_pointer_ = get_nil_reference_manager_();
	}

	public:
	WeakPointer(
		StrongPointer<ValueType> const& strong_pointer_
	) DD_NOEXCEPT : m_manager_pointer_(strong_pointer_.get_manager_pointer_()) {
		get_manager_pointer_()->weakly_referred_();
	}

	private:
	WeakPointer(ManagerPointerType manager_pointer_) DD_NOEXCEPT : m_manager_pointer_(manager_pointer_) {
		get_manager_pointer_()->weakly_referred_();
	}

#	if __cplusplus >= 201103L
	private:
	WeakPointer(UnguardedTag tag_, ManagerPointerType manager_pointer_) DD_NOEXCEPT : m_manager_pointer_(manager_pointer_) {
	}

#	endif

	public:
	~WeakPointer() DD_NOEXCEPT {
		destruct_();
	}

	private:
	static ManagerPointerType get_nil_reference_manager_() DD_NOEXCEPT {
		return ManagerType::get_nil_reference_manager_();
	}

	protected:
	ManagerPointerType get_manager_pointer_() const DD_NOEXCEPT {
		return m_manager_pointer_;
	}

	public:
	LengthType get_strong_reference_count() const DD_NOEXCEPT {
		return get_manager_pointer_()->get_strong_reference_count_();
	}

	public:
	LengthType get_weak_reference_count() const DD_NOEXCEPT {
		return get_manager_pointer_()->get_weak_reference_count_();
	}

	public:
	ValidityType is_valid() const DD_NOEXCEPT {
		return get_strong_reference_count();
	}

	public:
	ValidityType is_expired() const DD_NOEXCEPT {
		return !is_valid();
	}

	public:
	StrongType lock() const DD_NOEXCEPT {
		return is_valid() ? StrongType(get_manager_pointer_()) : StrongType();
	}

	public:
	ProcessType swap(ThisType& other_) DD_NOEXCEPT {
		::DD::swap(m_manager_pointer_, other_.m_manager_pointer_);
	}

	public:
	ProcessType reset() DD_NOEXCEPT {
		ThisType temp_;
		swap(temp_);
	}

	public:
	ProcessType reset(ThisType const& origin_) DD_NOEXCEPT {
		ThisType temp_(origin_);
		swap(temp_);
	}

#	if __cplusplus >= 201103L
	public:
	ProcessType reset(ThisType&& origin_) noexcept {
		swap(origin_);
	}
#	endif

	private:
	ProcessType destruct_() DD_NOEXCEPT {
		get_manager_pointer_()->weakly_released_();
	}

	public:
	ThisType& operator =(ThisType const& origin_) DD_NOEXCEPT {
		reset(origin_);
		return *this;
	}

#	if __cplusplus >= 201103L
	public:
	ThisType& operator =(ThisType&& origin_) noexcept {
		reset(::DD::move(origin_));
		return *this;
	}

#	endif

#	if __cplusplus >= 201103L
	public:
	explicit operator ValidityType() const DD_NOEXCEPT {
		return is_valid();
	}

#	endif
};

template <typename ValueT_>
struct WeakPointer : WeakPointer<void> {
	public:
	DD_ALIAS(SuperType, WeakPointer<void>);
	DD_ALIAS(ThisType, WeakPointer<ValueT_>);
	DD_VALUE_TYPE_NESTED(ValueT_);

	public:
	DD_ALIAS(StrongType, StrongPointer<ValueType>);
	DD_ALIAS(ConstStrongType, StrongPointer<ValueConstType>);
	DD_ALIAS(ConstWeakType, WeakPointer<ValueConstType>);

	private:
	DD_SPECIFIC_TYPE_NESTED(Manager, ReferenceManagerBase_);

	public:
	friend StronglyReferable<ValueT_>;
	friend WeakPointer<DD_MODIFY_TRAIT(RemoveConst, ValueType)>;

#	if __cplusplus >= 201103L
	public:
	WeakPointer() = default;

	public:
	WeakPointer(ThisType const& origin_) = default;

	public:
	WeakPointer(ThisType&& origin_) = default;
#	else
	public:
	WeakPointer() throw() : SuperType(get_nil_reference_manager_()) {
	}
#	endif

	public:
	WeakPointer(StrongType const& strong_pointer_) DD_NOEXCEPT : SuperType(strong_pointer_) {
	}

	private:
	WeakPointer(ManagerPointerType manager_pointer_) DD_NOEXCEPT : SuperType(manager_pointer_) {
	}

#	if __cplusplus >= 201103L
	private:
	WeakPointer(UnguardedTag tag_, ManagerPointerType manager_pointer_) DD_NOEXCEPT : SuperType(tag_, manager_pointer_) {
	}

#	endif

	public:
	ConstWeakType get_const_weak_pointer() const DD_CALLABLE_WITH_LVALUE_ONLY DD_NOEXCEPT {
		return ConstWeakType(get_manager_pointer_());
	}

#	if __cplusplus >= 201103L
	public:
	ConstWeakType get_const_weak_pointer() const DD_CALLABLE_WITH_RVALUE_ONLY DD_NOEXCEPT {
		ManagerPointerType manager_pointer_ = get_manager_pointer_();
		m_manager_pointer_ = get_nil_reference_manager_();
		return ConstWeakType(unguarded_tag, manager_pointer_);
	}

#	endif

	public:
	StrongType lock() const DD_NOEXCEPT {
		return is_valid() ? StrongType(get_manager_pointer_()) : StrongType();
	}

	public:
	ProcessType swap(ThisType& other_) DD_NOEXCEPT {
		SuperType::swap(other_);
	}

	public:
	ProcessType reset() DD_NOEXCEPT {
		ThisType temp_;
		swap(temp_);
	}

#	if __cplusplus >= 201103L
	public:
	ProcessType reset(ThisType&& origin_) noexcept {
		swap(origin_);
	}

	public:
	template <typename ObjectT_>
	ProcessType reset(ObjectT_&& object__) noexcept(noexcept(ThisType(::DD::forward<ObjectT_>(object__)))) {
		ThisType temp_(::DD::forward<ObjectT_>(object__));
		swap(temp_);
	}
#	else
	public:
	template <typename ObjectT_>
	ProcessType reset(ObjectT_ const& object__) {
		ThisType temp_(object__);
		swap(temp_);
	}
#	endif

	private:
	ProcessType set_manager_(ManagerPointerType manager_pointer_) DD_NOEXCEPT {
		m_manager_pointer_ = manager_pointer_;
	}

	public:
	ThisType& operator =(ThisType const& origin_) DD_NOEXCEPT_AS(::DD::fabricate<ThisType>().reset(origin_)) {
		reset(origin_);
		return *this;
	}

#	if __cplusplus >= 201103L
	public:
	ThisType& operator =(ThisType&& origin_) noexcept(noexcept(::DD::fabricate<ThisType>().reset(::DD::move(origin_)))) {
		reset(::DD::move(origin_));
		return *this;
	}

	public:
	template <typename ObjectT__>
	ThisType& operator =(ObjectT__&& object___) noexcept(
		noexcept(::DD::fabricate<ThisType>().reset(::DD::forward<ObjectT__>(object___)))
	) {
		reset(::DD::forward<ObjectT__>(object___));
		return *this;
	}
#	else
	public:
	template <typename ObjectT__>
	ThisType& operator =(ObjectT__ const& object___) {
		reset(object___);
		return *this;
	}
#	endif

};

DD_DETAIL_END_

DD_BEGIN_
using detail_::WeakPointer;

DD_END_

#endif


text:
define('AlexFMS/ApplicationModule', [
    'dojo/_base/declare',
    'dojo/_base/lang',
    'dojo/string',
    'dojo/query',
    'dojo/dom-class',
    'Mobile/SalesLogix/Format',
    'Mobile/SalesLogix/Validator',
    'Sage/Platform/Mobile/ApplicationModule',
    'AlexFMS/Views/Job/TodaySchedule',
    'AlexFMS/Views/Job/Detail',
    'AlexFMS/Views/Job/Complete',
    'AlexFMS/Views/Job/Cancel',
    'AlexFMS/Views/Job/Reschedule',
    'AlexFMS/SignatureField'
    ],
    function (declare, lang, string, query, domClass, format, validator, ApplicationModule, todaySchedule, jobDetail, jobComplete, jobCancel, jobReschedule, signatureField) {
		return declare('AlexFMS.ApplicationModule', ApplicationModule, {
			loadCustomizations: function() {
				// no customizations to stock forms
				this.inherited(arguments);
			},
			loadViews: function() {
				this.inherited(arguments);
				// loading custom views
				this.registerView(new todaySchedule());
				this.registerView(new jobDetail());
				this.registerView(new jobComplete());
				this.registerView(new jobCancel());
				this.registerView(new jobReschedule());
				lang.extend(Mobile.SalesLogix.ApplicationModule, {
					getDefaultViews: function(){
						var views = originalDefViews.apply(this, arguments) || [];
						views.push('TodayJobSchedule');
						return views;
					}
				});
			}
		});
});


text:
/**
 * Core Firmata features.
 *
 * Core features are included in the ConfigurableFirmata library. They provide support for
 * board-level features such as digital and analog I/O and I2C as well as support for core
 * Arduino libraries such as Servo.
 *
 */
var coreFeatures = {
  "DigitalInputFirmata": {
    className: "DigitalInputFirmata",
    instanceName: "digitalInput",
    description: "Read digital input pins"
  },
  "DigitalOutputFirmata": {
    className: "DigitalOutputFirmata",
    instanceName: "digitalOutput",
    description: "Write to digital output pins"
  },
  "AnalogInputFirmata": {
    className: "AnalogInputFirmata",
    instanceName: "analogInput",
    description: "Read analog input pins",
    reporting: true
  },
  "AnalogOutputFirmata": {
    className: "AnalogOutputFirmata",
    instanceName: "analogOutput",
    description: "Write to analog output (PWM) pins"
  },
  "ServoFirmata": {
    className: "ServoFirmata",
    instanceName: "servo",
    description: "Control servo motors",
    dependencies: [
      {
        className: "Servo"
      }
    ]
  },
  "I2CFirmata": {
    className: "I2CFirmata",
    instanceName: "i2c",
    description: "Interface with I2C devices",
    reporting: true,
    dependencies: [
      {
        className: "Wire"
      }
    ]
  },
  "OneWireFirmata": {
    className: "OneWireFirmata",
    instanceName: "oneWire",
    description: "Interface with OneWire devices"
  },
  "StepperFirmata": {
    className: "StepperFirmata",
    instanceName: "stepper",
    description: "DEPRECATED, use AccelStepperFirmata instead. Control stepper motor drivers (2 and 4 wire H-bridge and step + direction style drivers such as EasyDriver)",
    update: true
  },
  "AccelStepperFirmata": {
    className: "AccelStepperFirmata",
    instanceName: "accelStepper",
    description: "Control 2 wire, 3 wire and 4 wire half or full step motor drivers and step + direction drivers (such as EasyDriver). Also supports control of groups of stepper motors",
    update: true
  },
  "SerialFirmata": {
    className: "SerialFirmata",
    instanceName: "serial",
    description: "Connect to serial peripherals using hardware (UART) or software serial",
    update: true
  },
  "FirmataScheduler": {
    className: "FirmataScheduler",
    instanceName: "scheduler",
    description: "A task scheduler for Firmata"
  }
};

module.exports = coreFeatures;


text:
/*
does not use built-in detection functionality

#alert tcp $EXTERNAL_NET $HTTP_PORTS -> $HOME_NET any (msg:"WEB-CLIENT Malicious PICT file download"; flow:established,to_client; content:"|00 11 02 FF 0C 00|"; reference:cve,2008-3021; reference:url ,technet.microsoft.com/en-us/security/bulletin/ms08-044; metadata:service http, policy security-ips drop; policy balanced-ips drop; classtype: attempted-user; sid:13946; rev:1;)
*/

/*
 * Use at your own risk.
 *
 * Copyright (C) 2005-2008 Sourcefire, Inc.
 *
 * This file is autogenerated via rules2c, by Brian Caswell <bmc@sourcefire.com>
 */

#include "sf_snort_plugin_api.h"
#include "sf_snort_packet.h"

#include "so-util.h"

/* declare detection functions */
int rule13946eval(void *p);

/* declare rule data structures */
/* precompile the stuff that needs pre-compiled */
/* flow:established, to_client; */
static FlowFlags rule13946flow0 =
{
    FLOW_ESTABLISHED|FLOW_TO_CLIENT
};

static RuleOption rule13946option0 =
{
    OPTION_TYPE_FLOWFLAGS,
    {
        &rule13946flow0
    }
};
// content:"|00 11 02 FF 0C 00|";
static ContentInfo rule13946content1 =
{
    (uint8_t *) "|00 11 02 FF 0C 00|", /* pattern (now in snort content format) */
    0, /* depth */
    0, /* offset */
    CONTENT_BUF_NORMALIZED, /* flags */ // XXX - need to add CONTENT_FAST_PATTERN support
    NULL, /* holder for boyer/moore PTR */
    NULL, /* more holder info - byteform */
    0, /* byteform length */
    0 /* increment length*/
};

static RuleOption rule13946option1 =
{
    OPTION_TYPE_CONTENT,
    {
        &rule13946content1
    }
};

/* references for sid 13946 */
/* reference: cve "2008-3021"; */
static RuleReference rule13946ref1 =
{
    "cve", /* type */
    "2008-3021" /* value */
};

/* reference: url "technet.microsoft.com/en-us/security/bulletin/ms08-044"; */
static RuleReference rule13946ref2 =
{
    "url", /* type */
    "technet.microsoft.com/en-us/security/bulletin/ms08-044" /* value */
};

static RuleReference *rule13946refs[] =
{
    &rule13946ref1,
    &rule13946ref2,
    NULL
};
/* metadata for sid 13946 */
/* metadata:service http, policy balanced-ips drop, policy security-ips drop; */
static RuleMetaData rule13946service1 =
{
    "service http"
};

static RuleMetaData rule13946policy1 =
{
   "policy max-detect-ips drop"
};

static RuleMetaData *rule13946metadata[] =
{
    &rule13946service1,
    &rule13946policy1,
    NULL
};
RuleOption *rule13946options[] =
{
    &rule13946option0,
    &rule13946option1,
    NULL
};

Rule rule13946 = {

   /* rule header, akin to => tcp any any -> any any               */{
       IPPROTO_TCP, /* proto */
       "$EXTERNAL_NET", /* SRCIP     */
       "$HTTP_PORTS", /* SRCPORT   */
       0, /* DIRECTION */
       "$HOME_NET", /* DSTIP     */
       "any", /* DSTPORT   */
   },
   /* metadata */
   {
       3,  /* genid (HARDCODED!!!) */
       13946, /* sigid */
       11, /* revision */

       "attempted-user", /* classification */
       0,  /* hardcoded priority XXX NOT PROVIDED BY GRAMMAR YET! */
       "FILE-IMAGE Apple PICT/Quickdraw image converter packType 4 buffer overflow exploit attempt",     /* message */
       rule13946refs /* ptr to references */
       ,rule13946metadata
   },
   rule13946options, /* ptr to rule options */
   &rule13946eval, /* use the built in detection function */
   0 /* am I initialized yet? */
};

/* detection functions */
int rule13946eval(void *p) {
    const uint8_t *beg_of_payload, *end_of_payload;
    const uint8_t *cursor_normal = 0;
    uint16_t packType = 0;
    uint16_t pixelSize = 0;

    SFSnortPacket *sp = (SFSnortPacket *) p;

    if(sp == NULL)
        return RULE_NOMATCH;

    if(sp->payload == NULL)
        return RULE_NOMATCH;

    // flow:established, to_client;
    if (checkFlow(p, rule13946options[0]->option_u.flowFlags) > 0 ) {
        // content:"|00 11 02 FF 0C 00|";
        if (contentMatch(p, rule13946options[1]->option_u.content, &cursor_normal) > 0) {

            if(getBuffer(sp, CONTENT_BUF_NORMALIZED, &beg_of_payload, &end_of_payload) <= 0)
                return RULE_NOMATCH;

           // for the current vuln, the maximum offset from opCode is 35 bytes (case 0x9A
           // and 0x9B below).
            while (cursor_normal < end_of_payload) {
                // opCode, packType and pixelSize are big-endian
                // looking for 0x009[0,1,8-B]
                if (*cursor_normal == 0) {
                    if(cursor_normal + 31 >= end_of_payload)
                       return RULE_NOMATCH;

                    // packType = 4 and pixelSize = 0
                    switch (*(cursor_normal+1)) {
                        case 0x90: // BitsRect
                        case 0x91: // BitsRgn
                        case 0x98: // PackBitsRect
                        case 0x99: // PackBitsRgn
                             packType  = read_big_16(cursor_normal+14);
                             pixelSize = read_big_16(cursor_normal+30);
                             if (packType == 0x0004 && pixelSize == 0x0000) return RULE_MATCH;
                        break;
                        case 0x9A: // DirectBitsRect
                        case 0x9B: // DirectBitsRgn
                             if(cursor_normal + 35 >= end_of_payload)
                                return RULE_NOMATCH;
                             packType  = read_big_16(cursor_normal+18);
                             pixelSize = read_big_16(cursor_normal+34);
                             if (packType == 0x0004 && pixelSize == 0x0000) return RULE_MATCH;
                        break;
                    }
                }
                cursor_normal++;
            }
        }
    }
    return RULE_NOMATCH;
}

/*
Rule *rules[] = {
    &rule13946,
    NULL
};
*/


text:
package com.textrazor.classifier;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.List;

import com.textrazor.AnalysisException;
import com.textrazor.NetworkException;
import com.textrazor.classifier.model.AllCategoriesResponse;
import com.textrazor.classifier.model.Category;
import com.textrazor.classifier.model.GetCategoryResponse;
import com.textrazor.classifier.model.PagedAllCategories;
import com.textrazor.net.QueryBuilder;
import com.textrazor.net.TextRazorConnection;
import com.textrazor.net.TextRazorResponse;

public class ClassifierManager extends TextRazorConnection {
	public ClassifierManager(String apiKey) {
		super(apiKey);
	}

	public TextRazorResponse createClassifier(String classifierId, List<Category> categories) throws NetworkException, AnalysisException {
		String encodedId = encodeURLParam(classifierId);

		if (null == encodedId) {
			throw new RuntimeException("Invalid Classifier ID.");
		}

		return sendRequest("categories/" + encodedId,
				categories,
				ContentType.JSON,
				"PUT",
				TextRazorResponse.class);
	}

	public TextRazorResponse createClassifierWithCSV(String classifierId, String classifierFileName) throws IOException, NetworkException, AnalysisException {
		String encodedId = encodeURLParam(classifierId);

		if (null == encodedId) {
			throw new RuntimeException("Invalid Classifier ID.");
		}

		String csvContents;

		BufferedReader br = new BufferedReader(new FileReader(classifierFileName));
		try {
		    StringBuilder sb = new StringBuilder();
		    String line = br.readLine();

		    while (line != null) {
		        sb.append(line);
		        sb.append('\n');
		        line = br.readLine();
		    }

		    csvContents = sb.toString();
		} finally {
		    br.close();
		}

		return sendRequest("categories/" + encodedId,
				csvContents,
				ContentType.CSV,
				"PUT",
				TextRazorResponse.class);
	}

	public TextRazorResponse deleteClassifier(String classifierId) throws NetworkException, AnalysisException {
		String encodedId = encodeURLParam(classifierId);

		if (null == encodedId) {
			throw new RuntimeException("Invalid Classifier ID.");
		}

		return sendRequest("categories/" + encodedId,
				null,
				ContentType.JSON,
				"DELETE",
				TextRazorResponse.class);
	}

	public TextRazorResponse deleteCategory(String classifierId, String categoryId) throws NetworkException, AnalysisException {
		String encodedClassifierId = encodeURLParam(classifierId);
		if (null == encodedClassifierId) {
			throw new RuntimeException("Invalid Classifier ID.");
		}

		String encodedCategoryId = encodeURLParam(categoryId);
		if (null == encodedCategoryId) {
			throw new RuntimeException("Invalid Category ID.");
		}

		return sendRequest("categories/" + encodedClassifierId + "/" + encodedCategoryId,
				null,
				ContentType.JSON,
				"DELETE",
				TextRazorResponse.class);
	}

	public Category getCategory(String classifierId, String categoryId) throws NetworkException, AnalysisException {
		String encodedClassifierId = encodeURLParam(classifierId);
		if (null == encodedClassifierId) {
			throw new RuntimeException("Invalid Classifier ID.");
		}

		String encodedCategoryId = encodeURLParam(categoryId);
		if (null == encodedCategoryId) {
			throw new RuntimeException("Invalid Category ID.");
		}

		GetCategoryResponse response = sendRequest("categories/" + encodedClassifierId + "/" + encodedCategoryId,
				null,
				ContentType.JSON,
				"GET",
				GetCategoryResponse.class);

		return response.getResponse();
	}

	public PagedAllCategories allCategories(String classifierId, int limit, int offset) throws NetworkException, AnalysisException {
		String encodedId = encodeURLParam(classifierId);

		if (null == encodedId) {
			throw new RuntimeException("Invalid Category ID.");
		}

		QueryBuilder paramBuilder = new QueryBuilder();

		try {
			if (limit > 0) {
				paramBuilder.addParam("limit", Integer.toString(limit));
			}

			if (offset > 0) {
				paramBuilder.addParam("offset", Integer.toString(offset));
			}
		}
		catch (UnsupportedEncodingException e) {
			throw new RuntimeException("Unable to encode category paging paramaters.");
		}

		AllCategoriesResponse response = sendRequest("categories/" + encodedId + "/_all?" + paramBuilder.build(),
				null,
				ContentType.JSON,
				"GET",
				AllCategoriesResponse.class);

		return response.getResponse();
	}

	public PagedAllCategories allCategories(String classifierId, int limit) throws NetworkException, AnalysisException {
		return allCategories(classifierId, limit, -1);
	}

	public PagedAllCategories allCategories(String classifierId) throws NetworkException, AnalysisException {
		return allCategories(classifierId, -1);
	}
}


text:
using System.Threading;
using System.Threading.Tasks;
using FluentSpotifyApi.Core.Utils;
using FluentSpotifyApi.Extensions;
using FluentSpotifyApi.Model;

namespace FluentSpotifyApi.Builder.Me.Personalization
{
    internal class TopBuilder<T> : BuilderBase, ITopBuilder<T>
    {
        public TopBuilder(BuilderBase parent, string entityName)
            : base(parent, new[] { "top", entityName })
        {
            SpotifyArgumentAssertUtils.ThrowIfNullOrEmpty(entityName, nameof(entityName));
        }

        public Task<Page<T>> GetAsync(TimeRange? timeRange, int? limit, int? offset, CancellationToken cancellationToken)
        {
            return this.GetAsync<Page<T>>(
                cancellationToken,
                queryParams: new { time_range = timeRange?.GetEnumMemberValue(), limit, offset });
        }
    }
}


text:
<?php

namespace ZQ\SunSearchBundle\Tests\Doctrine\Annotation\Entities;

use ZQ\SunSearchBundle\Doctrine\Annotation as Sun;

/**
 *
 * @Sun\Document(boost="1.4")
 */
class ValidTestEntityFloatBoost
{

    /**
     * @Sun\Id
     */
    private $id;

}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Sarcographa actinobola var. actinobola (Nyl.) Zahlbr.

### Remarks
null