text:
<?PHP
require_once('dbsupport.php');
require_once('model/bug.php');
try{
	$project = $_REQUEST['project'];
	$subject = $_REQUEST['subject'];
	$priority = $_REQUEST['priority'];
	$labels = json_decode($_REQUEST['labels']);
	$description = $_REQUEST['description'];

	if (!isset($_COOKIE["auth"])){
		http_response_code(401);
	}else{

		//Get cookie
		$auth_cookie = json_decode($_COOKIE['auth']);

		//Find user and compare to auth token from auth cookie
		$get_user_query = $mysqli->prepare("SELECT id FROM user WHERE email = ? and auth_token = ?");
		$get_user_query->bind_param('ss', $auth_cookie->{'email'},$auth_cookie->{'authtoken'});
		$get_user_query->execute();
		$get_user_query->bind_result($returned_user_id);

		if($get_user_query->fetch()){
			$get_user_query->free_result();

			//Get the ID of the project...
			$get_project_query = $mysqli->prepare("SELECT id from project where `key` = ?");
			$get_project_query->bind_param('s',$project);
			$get_project_query->execute();
			$get_project_query->bind_result($returned_project_id);

			if($get_project_query->fetch()){
				$get_project_query->free_result();

				$sqlstr = "INSERT INTO bug (project,reporter,subject,description,created,modified,`status`) VALUES (?,?,?,?,NOW(),NOW(),1)";
				if(!isset($priority)){
					$sqlstr = "INSERT INTO bug (project,reporter,subject,description,created,modified,`status`,priority) VALUES (?,?,?,?,NOW(),NOW(),1,?)";
				}

				$insert_bug_query = $mysqli->prepare($sqlstr);
				if(!isset($priority)){
					$insert_bug_query->bind_param('iissi',$returned_project_id,$returned_user_id,$subject,$description,$priority);
				}else{
					$insert_bug_query->bind_param('iiss',$returned_project_id,$returned_user_id,$subject,$description);
				}

				$insert_bug_query->execute();
				$bug_id = $mysqli->insert_id;
				$insert_bug_query->free_result();

				$insert_bug_label_query = $mysqli->prepare("INSERT INTO bug_label (bug_id,label_id) VALUES (?,?)");
				foreach ($labels as &$label) {

					$insert_bug_label_query->bind_param('ii',$bug_id,$label);
					$insert_bug_label_query->execute();

				}

				$insert_bug_label_query->free_result();

				$return_bug = new bug;
				$return_bug->id = $bug_id;

				echo json_encode($return_bug);

			}else{
				error_log('Failed to find project in DB.');
				http_response_code(404);
			}

		}else{
			http_response_code(403);
		}
		$get_user_query->close();
	}
} catch (Exception $e) {
	error_log('Unexpected Exception occurred: ' . $e);
	http_response_code(500);
}
?>


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Project 1 (kopya)</title>
    <meta name="viewport" content="width=device-width">
    <meta name="description" content="Write an awesome description for your new site here. You can edit this line in _config.yml. It will appear in your document head meta (for Google search results) and in your feed.xml site description.">
    <meta name="author" content="LastName FirstName">
    <link rel="canonical" href="https://example.github.io/web%20development/2014/07/18/project-1-kopya/">
    <link rel="alternate" type="application/rss+xml" title="RSS" href="/feed.xml">

    <link rel="stylesheet" href="/style.css">

    <link rel="stylesheet" href="/css/font-awesome/css/font-awesome.min.css">
    <link href="//fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css">
    <link href="//fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic" rel="stylesheet" type="text/css">

                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                    Toggle navigation

                </button>
                Mİrİvet-ün Mİrİvİx

                        Blog

                        Hakkımda

                        İletişim

                        Mİrİvet-ün Mİrİvİx

                        Web Developer - Graphic Artist - User Experience Designer

Portfolio

Hakkımda

-----------------

----------------------------

Contact Me

				<form  action="//formspree.io/you@email.com" method="POST" name="sentMessage" id="contactForm" novalidate>

							Name
							<input type="text" name="name" class="form-control" placeholder="Name" id="name" required data-validation-required-message="Please enter your name.">

							Email Address
							<input type="email" name="_replyto" class="form-control" placeholder="Email Address" id="email" required data-validation-required-message="Please enter your email address.">

						<input type="hidden"  name="_subject" value="New submission!">
						<input type="text" name="_gotcha" style="display:none" />

							Message
							<textarea rows="5" name="message" class="form-control" placeholder="Message" id="message" required data-validation-required-message="Please enter a message."></textarea>

							<button type="submit" class="btn btn-success btn-lg">Send</button>

				</form>

Location

                                3481 Melrose Place

                                Beverly Hills, CA 90210

Around the Web

Credits

Freelancer is a free to use, open source Bootstrap theme created by Start Bootstrap.

                        Copyright © Dr. Henry Jekyll 2015

Project 1

Use this area of the page to describe your project. The icon above is part of a free icon set by Flat Icons. On their website, you can download their free set with 16 icons, or you can purchase the entire set with 146 icons for only $12!

Client:
                                    Start Bootstrap

Date:
                                    April 2014

Service:
                                    Web Development

                            <button type="button" class="btn btn-default" data-dismiss="modal"> Close</button>

Project 1 (kopya)

Use this area of the page to describe your project. The icon above is part of a free icon set by Flat Icons. On their website, you can download their free set with 16 icons, or you can purchase the entire set with 146 icons for only $12!

Client:
                                    Start Bootstrap

Date:
                                    April 2014

Service:
                                    Web Development

                            <button type="button" class="btn btn-default" data-dismiss="modal"> Close</button>

Project 2

Use this area of the page to describe your project. The icon above is part of a free icon set by Flat Icons. On their website, you can download their free set with 16 icons, or you can purchase the entire set with 146 icons for only $12!

Client:
                                    Start Bootstrap

Date:
                                    April 2014

Service:
                                    Web Development

                            <button type="button" class="btn btn-default" data-dismiss="modal"> Close</button>

Project 3

Use this area of the page to describe your project. The icon above is part of a free icon set by Flat Icons. On their website, you can download their free set with 16 icons, or you can purchase the entire set with 146 icons for only $12!

Client:
                                    Start Bootstrap

Date:
                                    April 2014

Service:
                                    Web Development

                            <button type="button" class="btn btn-default" data-dismiss="modal"> Close</button>

Project 4

Use this area of the page to describe your project. The icon above is part of a free icon set by Flat Icons. On their website, you can download their free set with 16 icons, or you can purchase the entire set with 146 icons for only $12!

Client:
                                    Start Bootstrap

Date:
                                    April 2014

Service:
                                    Web Development

                            <button type="button" class="btn btn-default" data-dismiss="modal"> Close</button>

Project 6

Mİrivix

Client:
                                    Start Bootstrap

Date:
                                    April 2014

Service:
                                    Web Development

                            <button type="button" class="btn btn-default" data-dismiss="modal"> Close</button>

Project 5

Use this area of the page to describe your project. The icon above is part of a free icon set by Flat Icons. On their website, you can download their free set with 16 icons, or you can purchase the entire set with 146 icons for only $12!

Client:
                                    Start Bootstrap

Date:
                                    April 2014

Service:
                                    Web Development

                            <button type="button" class="btn btn-default" data-dismiss="modal"> Close</button>

redpajama_set_name: RedPajamaGithub


text:
#ifndef _ASM_PGTABLE_2LEVEL_H
#define _ASM_PGTABLE_2LEVEL_H

/*
 * Hardware-wise, we have a two level page table structure, where the first
 * level has 4096 entries, and the second level has 256 entries.  Each entry
 * is one 32-bit word.  Most of the bits in the second level entry are used
 * by hardware, and there aren't any "accessed" and "dirty" bits.
 *
 * Linux on the other hand has a three level page table structure, which can
 * be wrapped to fit a two level page table structure easily - using the PGD
 * and PTE only.  However, Linux also expects one "PTE" table per page, and
 * at least a "dirty" bit.
 *
 * Therefore, we tweak the implementation slightly - we tell Linux that we
 * have 2048 entries in the first level, each of which is 8 bytes (iow, two
 * hardware pointers to the second level.)  The second level contains two
 * hardware PTE tables arranged contiguously, preceded by Linux versions
 * which contain the state information Linux needs.  We, therefore, end up
 * with 512 entries in the "PTE" level.
 *
 * This leads to the page tables having the following layout:
 *
 *    pgd             pte
 * |        |
 * +--------+
 * |        |       +------------+ +0
 * +- - - - +       | Linux pt 0 |
 * |        |       +------------+ +1024
 * +--------+ +0    | Linux pt 1 |
 * |        |-----> +------------+ +2048
 * +- - - - + +4    |  h/w pt 0  |
 * |        |-----> +------------+ +3072
 * +--------+ +8    |  h/w pt 1  |
 * |        |       +------------+ +4096
 *
 * See L_PTE_xxx below for definitions of bits in the "Linux pt", and
 * PTE_xxx for definitions of bits appearing in the "h/w pt".
 *
 * PMD_xxx definitions refer to bits in the first level page table.
 *
 * The "dirty" bit is emulated by only granting hardware write permission
 * iff the page is marked "writable" and "dirty" in the Linux PTE.  This
 * means that a write to a clean page will cause a permission fault, and
 * the Linux MM layer will mark the page dirty via handle_pte_fault().
 * For the hardware to notice the permission change, the TLB entry must
 * be flushed, and ptep_set_access_flags() does that for us.
 *
 * The "accessed" or "young" bit is emulated by a similar method; we only
 * allow accesses to the page if the "young" bit is set.  Accesses to the
 * page will cause a fault, and handle_pte_fault() will set the young bit
 * for us as long as the page is marked present in the corresponding Linux
 * PTE entry.  Again, ptep_set_access_flags() will ensure that the TLB is
 * up to date.
 *
 * However, when the "young" bit is cleared, we deny access to the page
 * by clearing the hardware PTE.  Currently Linux does not flush the TLB
 * for us in this case, which means the TLB will retain the transation
 * until either the TLB entry is evicted under pressure, or a context
 * switch which changes the user space mapping occurs.
 */
#define PTRS_PER_PTE		512
#define PTRS_PER_PMD		1
#define PTRS_PER_PGD		2048

#define PTE_HWTABLE_PTRS	(PTRS_PER_PTE)
#define PTE_HWTABLE_OFF		(PTE_HWTABLE_PTRS * sizeof(pte_t))
#define PTE_HWTABLE_SIZE	(PTRS_PER_PTE * sizeof(u32))

/*
 * PMD_SHIFT determines the size of the area a second-level page table can map
 * PGDIR_SHIFT determines what a third-level page table entry can map
 */
#define PMD_SHIFT		21
#define PGDIR_SHIFT		21

#define PMD_SIZE		(1UL << PMD_SHIFT)
#define PMD_MASK		(~(PMD_SIZE-1))
#define PGDIR_SIZE		(1UL << PGDIR_SHIFT)
#define PGDIR_MASK		(~(PGDIR_SIZE-1))

/*
 * section address mask and size definitions.
 */
#define SECTION_SHIFT		20
#define SECTION_SIZE		(1UL << SECTION_SHIFT)
#define SECTION_MASK		(~(SECTION_SIZE-1))

/*
 * ARMv6 supersection address mask and size definitions.
 */
#define SUPERSECTION_SHIFT	24
#define SUPERSECTION_SIZE	(1UL << SUPERSECTION_SHIFT)
#define SUPERSECTION_MASK	(~(SUPERSECTION_SIZE-1))

#define USER_PTRS_PER_PGD	(TASK_SIZE / PGDIR_SIZE)

/*
 * "Linux" PTE definitions.
 *
 * We keep two sets of PTEs - the hardware and the linux version.
 * This allows greater flexibility in the way we map the Linux bits
 * onto the hardware tables, and allows us to have YOUNG and DIRTY
 * bits.
 *
 * The PTE table pointer refers to the hardware entries; the "Linux"
 * entries are stored 1024 bytes below.
 */
#define L_PTE_VALID		(_AT(pteval_t, 1) << 0)		/* Valid */
#define L_PTE_PRESENT		(_AT(pteval_t, 1) << 0)
#define L_PTE_YOUNG		(_AT(pteval_t, 1) << 1)
#define L_PTE_FILE		(_AT(pteval_t, 1) << 2)	/* only when !PRESENT */
#define L_PTE_DIRTY		(_AT(pteval_t, 1) << 6)
#define L_PTE_RDONLY		(_AT(pteval_t, 1) << 7)
#define L_PTE_USER		(_AT(pteval_t, 1) << 8)
#define L_PTE_XN		(_AT(pteval_t, 1) << 9)
#define L_PTE_SHARED		(_AT(pteval_t, 1) << 10)	/* shared(v6), coherent(xsc3) */
#define L_PTE_NONE		(_AT(pteval_t, 1) << 11)

/*
 * These are the memory types, defined to be compatible with
 * pre-ARMv6 CPUs cacheable and bufferable bits:   XXCB
 */
#define L_PTE_MT_UNCACHED	(_AT(pteval_t, 0x00) << 2)	/* 0000 */
#define L_PTE_MT_BUFFERABLE	(_AT(pteval_t, 0x01) << 2)	/* 0001 */
#define L_PTE_MT_WRITETHROUGH	(_AT(pteval_t, 0x02) << 2)	/* 0010 */
#define L_PTE_MT_WRITEBACK	(_AT(pteval_t, 0x03) << 2)	/* 0011 */
#define L_PTE_MT_MINICACHE	(_AT(pteval_t, 0x06) << 2)	/* 0110 (sa1100, xscale) */
#define L_PTE_MT_WRITEALLOC	(_AT(pteval_t, 0x07) << 2)	/* 0111 */
#define L_PTE_MT_DEV_SHARED	(_AT(pteval_t, 0x04) << 2)	/* 0100 */
#define L_PTE_MT_DEV_NONSHARED	(_AT(pteval_t, 0x0c) << 2)	/* 1100 */
#define L_PTE_MT_DEV_WC		(_AT(pteval_t, 0x09) << 2)	/* 1001 */
#define L_PTE_MT_DEV_CACHED	(_AT(pteval_t, 0x0b) << 2)	/* 1011 */
#define L_PTE_MT_MASK		(_AT(pteval_t, 0x0f) << 2)

#ifndef __ASSEMBLY__

/*
 * The "pud_xxx()" functions here are trivial when the pmd is folded into
 * the pud: the pud entry is never bad, always exists, and can't be set or
 * cleared.
 */
#define pud_none(pud)		(0)
#define pud_bad(pud)		(0)
#define pud_present(pud)	(1)
#define pud_clear(pudp)		do { } while (0)
#define set_pud(pud,pudp)	do { } while (0)

static inline pmd_t *pmd_offset(pud_t *pud, unsigned long addr)
{
	return (pmd_t *)pud;
}

#define pmd_large(pmd)		(pmd_val(pmd) & 2)
#define pmd_bad(pmd)		(pmd_val(pmd) & 2)

#define copy_pmd(pmdpd,pmdps)		\
	do {				\
		pmdpd[0] = pmdps[0];	\
		pmdpd[1] = pmdps[1];	\
		flush_pmd_entry(pmdpd);	\
	} while (0)

#define pmd_clear(pmdp)			\
	do {				\
		pmdp[0] = __pmd(0);	\
		pmdp[1] = __pmd(0);	\
		clean_pmd_entry(pmdp);	\
	} while (0)

/* we don't need complex calculations here as the pmd is folded into the pgd */
#define pmd_addr_end(addr,end) (end)

#define set_pte_ext(ptep,pte,ext) cpu_set_pte_ext(ptep,pte,ext)

/*
 * We don't have huge page support for short descriptors, for the moment
 * define empty stubs for use by pin_page_for_write.
 */
#define pmd_hugewillfault(pmd)	(0)
#define pmd_thp_or_huge(pmd)	(0)

#endif /* __ASSEMBLY__ */

#endif /* _ASM_PGTABLE_2LEVEL_H */


text:
var exec = require('child_process').execSync;

// Create a user token otherwise you'll hit API rate limit pretty fast
// Link: https://github.com/settings/applications
var token = process.env.ghkey || '',
    tokenStr;

if (token) {
    tokenStr = ' -H "Authorization: token ' + token + '" ';
} else {
    console.log('\n\x1B[31mWarning: ghkey not set, you might hit API rate limit.\x1B[39m\n');
    tokenStr = ' ';
}

function travisStatus(owner, project) {
    var result = [];
    //curl -i https://api.travis-ci.org/repos/apache/cordova-lib/builds
    var builds = exec('curl -s "https://api.travis-ci.org/repos/' + owner +
        '/' + project + '/builds"', {encoding: 'utf8'});
    try {
        builds = JSON.parse(builds);
        if (builds.message) throw Error(builds.message);
    } catch (e) {
        return ['err: ' + e.message];
    }

    builds = builds.sort(function(a,b) {
        return parseInt(b.number, 10) - parseInt(a.number, 10);
    });

    var build = builds[0];

    if (builds.length === 0) {
        console.log('\x1B[31mTravis not set for ' + project + '.\x1B[39m');
        return;
    }

    if (build.state === "finished") {
        if (parseInt(build.result, 10) === 0) {
            console.log('\x1B[32mBuild successful ✓\x1B[39m');
        } else {
            // console.log(build.number + ',' + build.state + ','
            // + build.result);
            console.log('\x1B[31mBuild failed X\x1B[39m');
        }
    } else {
        console.log('\x1B[33mTests are currently running for ' + project + '.\x1B[39m');
    }
}

console.log('Fetching project list from github..');

// get list of msopentech cordova repos
var apachePages = exec('curl -s -I' + tokenStr + 'https://api.github.com/users/apache/repos', {encoding: 'utf8'});

apachePages = apachePages.split('\n').filter(function(line){
    return ~line.indexOf('Link: ');
})[0];

if (!apachePages) {
    console.log('Probably hit api limit, please add your key.');
    process.exit(1);
}

apachePages = apachePages.split(',')[1];
apachePages = apachePages.match(/page=(\d+)/i)[1];

var apacheRepos = [];

for (var i = 1; i <= apachePages; i++) {
    try {
        var repos = exec('curl -s' + tokenStr + '"https://api.github.com/orgs/apache/repos?page=' + i + '"');
        repos = JSON.parse(repos);
        if (repos.message) throw Error(repos.message);
    } catch (e) {
        console.log('err: ' + e.message);
        break;
    }
    repos = repos.filter(function(repo) {
        return !!~repo.name.indexOf('cordova');
    }).map(function(repo) {
        return repo.name;
    });
    apacheRepos = apacheRepos.concat(repos);
}

// Sort elements
apacheRepos = apacheRepos.sort();

apacheRepos.forEach(function(project) {
    console.log('Checking travis status for \x1B[32m' + project + '\x1B[39m');
    travisStatus('apache', project);
});


text:
docker-hello-world-nodejs
=========================

A sample Dockerfile for a Hello World web server built with Node.js


text:
static const int kMaxPollWaitTime = 10;
static const int kEpollFdCount = 1024;

namespace minirpc
{

//object sematic
class ReactorLoop
{
 public:
  //you nerver should init reactorloop in different thread!!!!
  ReactorLoop();
  ~ReactorLoop();

  ReactorLoop(const ReactorLoop&) = delete;
  ReactorLoop& operator=(const ReactorLoop&) = delete;

  void startLoop();
  void stopLoop();

  //thread
  void startInOtherThread(Condition *monitor);
  void stopInOtherThread();

  //event_callback
  void addEvent(Event* events);
  void ModifyEvent(Event* events);
  void deleteEvent(Event* events);
  bool searchEvent(Event* events);

  void wakeUp();
  void runTask(std::shared_ptr<Task> handler);
  bool isInLoopThread() const;
  class Impl;

 private:
  ::std::unique_ptr<Impl> impl_;
};

}// namespace minirpc

#endif  //  MINIRPC_ReactorLoop_H_


text:
<!DOCTYPE html>

  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>The source code</title>
  <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />

/**
 * # Cross-tab query
 *
 * Cross-tab query that could be used in the methods:
 *
 * - askiaVista.display
 * - askiaVista.getPages
 *
 *       // Using the display method obtain the first page
 *       askiaVista.display({
 *            survey : 'EX',
 *            rows : 'gender',
 *            containerId : 'gender_age'
 *       });
 *
 *       // Display the second page
 *       askiaVista.display({
 *            survey : 'EX',
 *            rows   : 'appreciation',
 *            columns : 'age',
 *            edges   : 'gender',
 *            settings : {
 *                edges : {
 *                    breakTable : true
 *                }
 *            },
 *            page : 1, // Second page
 *            containerId : 'female_appreciation_by_age'
 *       });
 *
 *       // Get all pages from a portfolio item
 *       askiaVista.getPages({
 *           survey : 'EX',
 *           portfolioItem : 'Default|CSP',
 *           containerId : 'csp'
 *       });
 *
 *
 *
 * @class askiaVista.queries.xTab
 * @extends askiaVista.abstracts.queryWithTimer
 * @mixins askiaVista.abstracts.LSWU
 * @protected
 */
/**
 * Title of the cross-tab.<br />
 * This title could contains keywords to interpret
 * such as *??R??* for caption of the question in rows, *??C??* for the caption of the question in columns ....
 *
 *      // Display the result with dynamic type
 *      // Will produce: "Age of the respondent x gender of the respondent"
 *      askiaVista.display({
 *          title : '??C?? x ??R??'
 *          rows : 'age',
 *          columns : 'gender',
 *          containerId : 'result'
 *      });
 * @member askiaVista.queries.xTab
 * @property {String} [title=null]
 */
/**
 * Defines the questions in dimension (rows, columns or edges)
 *
 * The value could be:
 *
 * * The shortcut of one question
 * * The shortcuts of several questions separate with the pipe characters (`|`)
 * * An array of question shortcuts or question keys
 * * An array of {@link askiaVista.queries.xTab.question question} object
 *
 * This value has a higher priority on his equivalent `profile` property (`profile(Rows|Columns|Edges)`)..<br />
 * That mean if you are using `rows` and `profileRows` in the same query. the `rows` will be applied not the `profileRows`
 *
 * If the cross-tab query uses a portfolio item, this property will then override the entire list of questions on this dimension.
 *
 *       // Different syntaxes
 *       askiaVista.display({
 *           rows : "profession", // Only one question
 *           columns : "age|gender", // Several question using string
 *           edges : ["satisfaction", "appreciation"] // Several question using an array
 *           // ... rest of the query
 *       });
 *
 *       // Since 2.2.0
 *       askiaVista.display({
 *          rows : ['1|1@@0', '1|2@@0', 'satisfaction']     // Use the keys of the question and one shortcut
 *          // ,, rest of the query
 *       });
 *
 *       // Using advanced question definition
 *       askiaVista.display({
 *          rows : [{
 *              key     : "1|1@@0",
 *              caption : "Gender of the respondent"
 *          }, {
 *              shortcut : "age",
 *              caption : "Age of the respondent"
 *          }]
 *           // ... rest of the query
 *       });
 *
 *
 *       // Mix syntax with object and string in the array
 *       askiaVista.display({
 *          rows : [{
 *              shortcut : "gender",
 *              caption : "Gender of the respondent"
 *           }, "profession"]
 *           // ... rest of the query
 *       });
 *
 *       // Priority
 *       askiaVista.display({
 *          rows : 'gender',
 *          profileRows : 'CSP'  // This one will be ignored
 *       });
 *
 *       askiaVista.display({
 *           portfolioItem : 'Default|Statisfaction',
 *           rows : 'gender' // Override the questions in rows of the portfolio item
 *           // ... rest of the query
 *       });
 *
 * Also see:
 *
 * @localdoc
 * - askiaVista.queries.xTab#columns
 * - askiaVista.queries.xTab#edges
 *
 * - askiaVista.queries.xTab#profileRows
 * - askiaVista.queries.xTab#profileColumns
 * - askiaVista.queries.xTab#profileEdges
 *
 * @member askiaVista.queries.xTab
 * @property {String|String[]|askiaVista.queries.xTab.question[]} [rows=null]
 */
/**
 * @inheritdoc #rows
 *
 * @localdoc
 * - askiaVista.queries.xTab#rows
 * - askiaVista.queries.xTab#edges
 *
 * - askiaVista.queries.xTab#profileRows
 * - askiaVista.queries.xTab#profileColumns
 * - askiaVista.queries.xTab#profileEdges
 *
 * @member askiaVista.queries.xTab
 * @property {String|String[]|askiaVista.queries.xTab.question[]} [columns=null]
 */
/**
 * @inheritdoc #rows
 *
 * @localdoc
 * - askiaVista.queries.xTab#rows
 * - askiaVista.queries.xTab#columns
 *
 * - askiaVista.queries.xTab#profileRows
 * - askiaVista.queries.xTab#profileColumns
 * - askiaVista.queries.xTab#profileEdges
 *
 * **Note:** At least one question must be specified in order to use the edges.
 *
 * @member askiaVista.queries.xTab
 * @property {String|String[]|askiaVista.queries.xTab.question[]} [edges=null]
 */
/**
 * Id or name of the predefined profile of questions to use in dimension (rows, columns or edges).
 *
 * **Note:** The property `rows`, `columns` or `edges` parameter will override his relative `profileRows`, `profileColumns` or `profileEdges`
 *
 * If the cross-tab query uses a portfolio item, this property will then override the entire list of questions on this dimension.
 *
 *       // Different syntaxes
 *       askiaVista.display({
 *           profileRows : "Satifactions",
 *           profileColumns : "Regions",
 *           profleEdges : "CSP"
 *           // ... rest of the query
 *       });
 *
 *       askiaVista.display({
 *           portfolioItem : 'Default|Statisfaction',
 *           profileRows : 'CSP' // Override the questions in rows of the portfolio item
 *           // ... rest of the query
 *       });
 *
 * Also see:
 *
 * @localdoc
 * - askiaVista.queries.xTab#rows
 * - askiaVista.queries.xTab#columns
 * * - askiaVista.queries.xTab#edges
 *
 * - askiaVista.queries.xTab#profileColumns
 * - askiaVista.queries.xTab#profileEdges
 *
 * @member askiaVista.queries.xTab
 * @property {Number|String} [profileRows=null]
 */
/**
 * @inheritdoc askiaVista.queries.xTab#profileRows
 * @localdoc
 * - askiaVista.queries.xTab#rows
 * - askiaVista.queries.xTab#columns
 * * - askiaVista.queries.xTab#edges
 *
 * - askiaVista.queries.xTab#profileRows
 * - askiaVista.queries.xTab#profileEdges
 *
 * @member askiaVista.queries.xTab
 * @property {Number|String} [profileColumns=null]
 */
/**
 * @inheritdoc askiaVista.queries.xTab#profileRows
 * @localdoc
 * - askiaVista.queries.xTab#rows
 * - askiaVista.queries.xTab#columns
 * - askiaVista.queries.xTab#edges
 *
 * - askiaVista.queries.xTab#profileRows
 * - askiaVista.queries.xTab#profileColumns
 *
 * @member askiaVista.queries.xTab
 * @property {Number|String} [profileEdges=null]
 */
/**
 * Defines a portfolio item that will be use for the cross-tab.
 * This property indicates both the name of the portfolio and the name of the item within the portfolio separate with the pipe characters (`|`).
 *
 *       askiaVista.display({
 *          portfolioItem : `Default|CSP` // Where 'Default' is the name of the portfolio
 *                                        // and 'CSP' is the name of the item in the portfolio
 *           // ... rest of the query
 *        });
 *
 * All other property within the query could override a specific part of the portfolio:
 *
 *       askiaVista.display({
 *           portfolioItem : 'Default|Statisfaction',
 *           rows          : 'CSP',  // Override the questions in rows
 *           subPopulation : 'man'   // Override the sub-population
 *           // ... rest of the query
 *       });
 *
 * @member askiaVista.queries.xTab
 * @property {String} [portfolioItem=null]
 */
/**
 * Defines the token of a portfolio item to use for the cross-tab.
 *
 * When using this property, the query will run under the portfolio item context:
 *
 * - Use the account of the user who has created the portfolio
 * - Use the sub-population specified during the generation of the token
 *
 * **Be careful:** When using this property all other properties which affect the cross-tab results will be ignored
 *
 *      askiaVista.display({
 *         survey : 'EX',
 *         portfolioItemToken "M8bpZj%2b%2fYMJLlj0KTkIbitd3ID7q2Kmg%2bXbWUd%2bsixHzfqBfpcoXY%2bQdBtHFRE8N",
 *         containerId : "result"
 *      });
 *
 * @member askiaVista.queries.xTab
 * @property {String} [portfolioItemToken=null]
 */
/**
 * Defines the cross-tab settings to use.
 *
 * The value could be:
 *
 * - Id of a predefined cross-tab settings (Number)
 * - Name of a predefined cross-tab settings (String)
 * - The definition of the cross-tab settings ({@link askiaVista.queries.xTab.settings})
 *
 * @member askiaVista.queries.xTab
 * @property {Number|String|askiaVista.queries.xTab.settings} [settings=null]
 */
/**
 * Id or name of the sub-population or the definition of a temporary sub-population to use for this cross-tab.
 *
 *       // Use the id of the sub-population
 *       askiaVista.display({
 *          rows : 'region',
 *          subPopulation : 1024
 *          // ... rest of the query
 *       });
 *
 *
 *       // Use the name of the sub-population
 *       askiaVista.display({
 *          rows : 'region',
 *          subPopulation : 'US'
 *          // ... rest of the query
 *       });
 *
 *       // Use a temporary sub-population
 *       askiaVista.display({
 *          rows : 'region',
 *          subPopulation : {
 *              name : "US And UK",
 *              script : "??region?? has {1; 2}" // AskiaScript goes here
 *          }
 *          // ... rest of the query
 *       });
 *
 *
 * @member askiaVista.queries.xTab
 * @property {Number|String|Object} [subPopulation=null]
 * @property {String} [subPopulation.name=""] Name of the temporary sub-population
 * @property {String} subPopulation.script AskiaScript definition of the temporary sub-population (synonym of definition)
 * @property {String} subPopulation.definition AskiaScript definition of the temporary sub-population (synonym of script)
 */
/**
 * Defines code or codes separate with the pipe characters (`|`) or an array list of calculations object.
 *
 * By default `Counts`, `Percentage` and `Mean` are used.
 *
 *       // Only one flat calculation
 *       askiaVista.display({
 *          rows : 'gender',
 *          calculations : 0 // 0 => Count
 *          // ... rest of the query
 *       });
 *
 *       // Two flat calculations
 *       askiaVista.display({
 *          rows : 'gender',
 *          calculations : '0|1' // 0 => Count, 1 => Percentage
 *          // ... rest of the query
 *       });
 *
 *       // Calculations as an array of object
 *       askiaVista.display({
 *           rows    : ['profession', 'appreciation'],
 *           columns : ['gender', 'age'],
 *           calculations : [{
 *              code : 100,
 *              name : 'Counts',
 *              subPopulation : 'Man'
 *           }, {
 *              code : 101,
 *              name : '%',
 *              displayInRows : false
 *           }]
 *           // ... rest of the query
 *       });
 *
 * Also see:
 *
 * - List of calculations code
 * - askiaVista.queries.xTab.calculation
 *
 * @member askiaVista.queries.xTab
 * @property {Number|String|askiaVista.queries.xTab.calculation[]} [calculations=null]
 */
/**
 * Defines id or id(s) of waves separate with the pipe character (`|`).
 *
 * By default all waves are used.
 *
 *        // Using one wave
 *        askiaVista.display({
 *             rows : 'appreciation',
 *             waves : 1
 *             // ... rest of the query
 *        });
 *
 *        // Several waves
 *        askiaVista.display({
 *            rows : 'appreciation',
 *            waves : '1|2|3'
 *            // ... rest of the query
 *        });
 *
 * @member askiaVista.queries.xTab
 * @property {Number|String} [waves=null]
 */
/**
 * Define id or name of the table style
 *
 *      askiaVista.display({
 *          rows : 'gender',
 *          tabStyle : 'My Beautiful style'
 *          // ... rest of the query
 *      });
 *
 * @member askiaVista.queries.xTab
 * @property {Number|String} [tabStyle=null]
 */
/**
 * Define id or name of a chart template or define a chart that will be render by a Javascript chart library
 *
 * While using the chart it's important to load the appropriate chart engine library and it's associated AskiaVista AJAX plugin
 *
 *       askiaVista.display({
 *           rows  : 'gender',
 *           chart : 'Default Columns'
 *           // ... rest of the query
 *       });
 *
 *       askiaVista.display({
 *            rows  : 'gender',
 *            chart : {
 *                name : 'Highcharts', // Name of the plugin/chart library to use
 *                options : {          // Options that will be passed to the chart library
 *                    chartType : 'pie'
 *                }
 *            }
 *            // ... reset of the query
 *       });
 *
 * @member askiaVista.queries.xTab
 * @property {Number|String|Object} [chart=null]
 */
/**
 * Defines the desired format of the output.
 *
 * Right now there is 'json' or 'html' output.
 *
 * **Be careful** JSON output has a different semantics for the table output and the chart output
 * Unless you want to create an table by yourself, we encourage to use the JSON chart output cause it's easier to parse.
 *
 *       // All pages will be produced in JSON
 *       askiaVista.getPages({
 *            rows : ['gender', 'age', 'profession'],
 *            format : 'json'
 *            // ... rest of the query
 *       });
 *
 *       // Serve JSON output for chart and html for table
 *       askiaVista.getPages({
 *            rows : ['gender', 'age', 'profession'],
 *            format : {
 *                table : 'htnml',
 *                chart : 'json'
 *            }
 *            // ... rest of the query
 *       });
 *
 * @member askiaVista.queries.xTab
 * @property {'html'|'json'|Object} [format=null]
 * @property {'html'|'json'} [format.table=null] Output format for table(s)
 * @property {'html'|'json'} [format.chart=null] Output format for chart(s)
 */
/**
 * Override the default loading message for the current query.
 *
 *       askiaVista.getPages({
 *           rows    : 'huge_question_1',
 *           columns : 'huge_question_2',
 *           loadingMessage : '<img src="loader.png" alt="loader" /><br /> This cross-tab could take a while please waiting...'
 *           // ... rest of the query
 *       });
 *
 *       askiaVista.display({
 *           rows : 'gender',
 *           loadingMessage : false // Disable the loader
 *           // ... rest of the query
 *       });
 *
 *       askiaVista.display({
 *           rows : 'gender',
 *           loadingMessage : function () {
 *               // Code to create a light-box...
 *           }
 *       });
 *
 * Also see:
 *
 * - askiaVista.queries.config.loadingMessage
 *
 * @member askiaVista.queries.xTab
 * @property {String|Boolean|Function} [loadingMessage=null]
 */
/**
 * Defines the width (in pixel) of the chart to generate.
 *
 *        askiaVista.display({
 *            rows : 'gender',
 *            chart : 'Default columns',
 *            width : 100,
 *            height : 100
 *            // ... rest of the query
 *        });
 *
 * @member askiaVista.queries.xTab
 * @property {Number} [width=null]
 */
/**
 * Defines the height (in pixel) of the chart to generate.
 *
 *        askiaVista.display({
 *            rows : 'gender',
 *            chart : 'Default columns',
 *            width : 100,
 *            height : 100
 *            // ... rest of the query
 *        });
 *
 * @member askiaVista.queries.xTab
 * @property {Number} [height=null]
 */
/**
 * Index of the page (based 0) to display by default
 *
 * This property is useful when you know in advanced the number of pages that will be generated
 *
 *       askiaVista.getPages({
 *            rows : ['gender', 'age', 'profession'],
 *            settings : {
 *                 rows : {
 *                     breakTable : true // One page per question in rows
 *                 }
 *            },
 *            page : 1 // Display the question 'age' by default
 *       });
 *
 * @member askiaVista.queries.xTab
 * @property {Number} [page=null]
 */
/**
 * Indicates if the askiaVista#getPages should returns the result for each pages.
 *
 *  By using the verbose parameter the processing time and the size of the AJAX response will increase considerably, so be careful.
 *
 *  The rule is easy:
 *
 *  - If the cross-tab can produce a very long list of pages don't use the verbose.
 *  - If the cross-tab produce a small number of pages (<20) then use the verbose parameter to have the pages and the results at the same time.
 *
 * @member askiaVista.queries.xTab
 * @property {Boolean|0|'disable'|1|'enable'} [verbose=null]
 */
/**
 * Callback when the query succeed
 *
 * Also see:
 *
 * - {@link askiaVista.data.xTab.table JSON format with the table semantic}
 * - {@link askiaVista.data.xTab.chart JSON format with the chart semantic}
 *
 * - {@link askiaVista.data.xTab.page List of pages}
 *
 * @member askiaVista.queries.xTab
 * @method success
 * @param {String|askiaVista.data.xTab|askiaVista.data.xTab.page[]} data HTML String or JSON data
 * @param {askiaVista.queries.xTab} query Query that has produced the result. <br />It's the context of the data
 * @param {"display"|"getPages"} query.action Method/action that has produced the result.
 */


text:
<?php

namespace AppBundle\Command;

use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException;

class TimerFetchCommand extends ContainerAwareCommand
{
    protected function configure()
    {
        $this
            ->setName('timer:fetch')
            ->setDescription('Fetch timers')
            ->addArgument('provider', InputArgument::REQUIRED, 'Provider to use')
            //->addOption('yell', null, InputOption::VALUE_NONE, 'Si définie, la tâche criera en majuscules')
        ;
    }

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $providerName = $input->getArgument('provider');
        $verbose = $input->getOption('verbose');

        try {
            $provider = $this->getContainer()->get(sprintf('timer.provider.%s', $providerName));
        } catch(ServiceNotFoundException $e) {
            $output->writeln(sprintf('<error>Provider "%s" unknown.</error>', $providerName));
            return 1;
        }

        $timer = $this->getContainer()->get('timer.timer');
        $timer->setProvider($provider);
        $timer->setIo($input, $verbose ? $output : null);

        return $timer->run();
    }
}


text:
<?php
namespace AppBundle\Controller;

use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;

class ContactController extends Controller
{
    public function submitAction(Request $req)
    {
        $json = $req->getContent();
        $data = json_decode($json, true);
        $text = sprintf(
            "%s\r\n\r\n%s\r\nUser-Agent: %s\r\nIP: %s",
            $data["message"],
            str_repeat("-", 78),
            $req->headers->get("user-agent"),
            $req->getClientIp()
        );

        $mailer  = $this->get("mailer");
        $message = \Swift_Message::newInstance()
            ->setSubject($data["subject"])
            ->setReplyTo($data["email"])
            ->setFrom("contact@headzoo.io")
            ->setTo("sean@headzoo.io")
            ->setBody($text);
        $sent = $mailer->send($message);

        return new Response($sent);
    }
}


text:
const BaseTrigger = require('./baseTrigger.js').BaseTrigger;
const _ = require('lodash');
const Moment = require('moment');

const util = require('util');

//Trigger that queries steamapi for a players csgo stats
//Similar to csgo-stats.com
//command - defaults to !csgostats
//apiKey - put it in the trigger options or globally in chatbot options
var CSGOStatTrigger = function() {
	CSGOStatTrigger.super_.apply(this, arguments);
}

util.inherits(CSGOStatTrigger, BaseTrigger);

const type = 'CSGOStatTrigger';
exports.triggerType = type;
exports.create = function(name, chatBot, options) {
	var trigger = new CSGOStatTrigger(type, name, chatBot, options);
	trigger.options.command = trigger.options.command || '!csgostats';
	trigger.options.apiKey = trigger.options.apiKey || (chatBot.apikey || undefined);
	return trigger;
}

CSGOStatTrigger.prototype._respondToChatMessage = function(roomId, chatterId, message) {
	return this._respond(roomId, chatterId, message);
}

CSGOStatTrigger.prototype._respondToFriendMessage = function(userId, userId, message) {
	return this._respond(userId, userId, message);
}

CSGOStatTrigger.prototype._respond = function(toId, userId, message) {
	const query = this._stripCommand(message, this.options.command);
	if(query && query.params.length === 2) {
		this.chatBot.steamApi('ISteamUserStats', 'GetUserStatsForGame', 2, 'get', this.options.apiKey, {
			steamid: query.params[1],
			appid: "730"
		}).then(body => {
			try {
				console.log('Attempting to get info...');
				const stats = body.playerstats.stats;

				const totalKills = _.where(stats, { "name": "total_kills" })[0].value;
				const totalDeaths = _.where(stats, { "name": "total_deaths" })[0].value;

				const shotsHit = _.where(stats, { "name": "total_shots_hit" })[0].value;
				const shotsFired = _.where(stats, { "name": "total_shots_fired" })[0].value;

				const matchesWon = _.where(stats, { "name": "total_matches_won" })[0].value;
				const matchesTotal = _.where(stats, { "name": "total_matches_played" })[0].value;

				const timePlayed = _.where(stats, { "name": "total_time_played" })[0].value;
				const date = Moment.duration(timePlayed, 'seconds');
				const hours = Math.floor(date.asHours());
				const minutes = Math.floor(date.asMinutes()) - (hours * 60);

				const headshots = _.where(stats, { "name": "total_kills_headshot" })[0].value;

				const windows = _.where(stats, { "name": "total_broken_windows" })[0].value;

				const kdRatio = totalKills / totalDeaths;
				const accuracy = shotsHit / shotsFired;
				const winRatio = matchesWon / matchesTotal;
				this._sendMessageAfterDelay(toId, `${this.chatBot.steamFriends.personaStates[body.playerstats.steamID].player_name} (${body.playerstats.steamID}) has ${totalKills} kills and ${totalDeaths} deaths (${kdRatio.toFixed(2)}), accuracy of ${accuracy.toFixed(2)}, win percentage of ${winRatio.toFixed(3)*100}%, total playtime of ${hours.toFixed(0)} hours and ${minutes.toFixed(0)} minutes, ${headshots} headshots, and has broken ${windows} windows.`);
			}
			catch(e) {
				this.winston.error(this.chatBot.name + '/' + this.name + ': Error: ' + e.stack);
				this._sendMessageAfterDelay(toId, 'Error: ' + e.message);
			}
		}).catch(error => {
			this.winston.error(this.chatBot.name + '/' + this.name + ': Error: ' + e.stack);
			this._sendMessageAfterDelay(toId, 'Error: ' + e.message);
		});
		return true;
	}
	else {
		return false;
	}
}

CSGOStatTrigger.prototype._stripCommand = function(message, command) {
	if(command && message && message.toLowerCase().indexOf(command.toLowerCase()) === 0) {
		return {
			message: message,
			params: message.split(' ')
		};
	}
}


text:
package com.liangmayong.base.support.theme.listener;

import com.liangmayong.base.support.theme.Theme;

/**
 * Created by LiangMaYong on 2016/9/11.
 */
public interface OnThemeListener {

    /**
     * onThemeEdited
     *
     * @param theme theme
     */
    void onThemeEdited(Theme theme);

}


text:
package org.pepstock.charba.client.ml;

import org.pepstock.charba.client.commons.ArrayDouble;
import org.pepstock.charba.client.commons.NativeName;

import jsinterop.annotations.JsMethod;
import jsinterop.annotations.JsPackage;
import jsinterop.annotations.JsType;

/**
 * Robust regression is a form of regression analysis designed to overcome some limitations of traditional parametric and non-parametric methods.

 * Regression analysis seeks to find the relationship between one or more independent variables and a dependent variable. Certain widely used methods of regression, such as
 * ordinary least squares, have favourable properties if their underlying assumptions are true, but can give misleading results if those assumptions are not true; thus ordinary
 * least squares is said to be not robust to violations of its assumptions.

 * Robust regression methods are designed to be not overly affected by violations of assumptions by the underlying data-generating process.

 *

 * In particular, least squares estimates for regression models are highly sensitive to outliers.

 * While there is no precise definition of an outlier, outliers are observations that do not follow the pattern of the other observations.

 * This is not normally a problem if the outlier is simply an extreme observation drawn from the tail of a normal distribution, but if the outlier results from non-normal
 * measurement error or some other violation of standard ordinary least squares assumptions, then it compromises the validity of the regression results if a non-robust regression
 * technique is used.

 * The Polynomial Regression equation is given below:

 *

 * y = b0 + b1x1 + b2x12 +
 * b2x13 +...... bnx1n

 *

 * It maps mljs/regression-robust-polynomial.
 *
 * @author Andrea "Stock" Stocchero
 *
 */
@JsType(isNative = true, name = NativeName.ML_ROBUST_POLYNOMIAL_REGRESSION, namespace = JsPackage.GLOBAL)
final class NativeRobustPolynomialRegression extends NativeBasePolynomialRegression {

	/**
	 * Creates the robust polynomial regression object, using the passed data to calculate the formula.
	 *
	 * @param x values bound to x
	 * @param y values bound to y
	 * @param degree the maximum degree of the polynomial
	 */
	// Ignores SonarCloud issue, java:S1172 - Unused method parameters should be removed, because this is the way of JSINTEROP to invoke a JavaScript constructor.
	@SuppressWarnings("java:S1172")
	NativeRobustPolynomialRegression(ArrayDouble x, ArrayDouble y, int degree) {
		// nothing
	}

	/**
	 * Creates new regression by a descriptor.
	 *
	 * @param descriptor regression description used to create new regression
	 * @return new regression instance
	 */
	@JsMethod
	static native NativeRobustPolynomialRegression load(RegressionDescriptor descriptor);

}


text:
/* globals module, require, __dirname */
const webpack = require("webpack");
const CssMigrationWebpackPlugin = require("./CssMigrationWebpackPlugin");
const WebpackShellPlugin = require("webpack-shell-plugin");

module.exports = {
  entry: "./index.js",
  output: {
    path: __dirname + "/dist",
    filename: "index.js",
    libraryTarget: "umd"
  },
  module: {
    rules: [
      {
        loader: "babel-loader",
        test: /\.(js|jsx)$/,
        exclude: /node_modules\/proptypes|scripts\/sw.js/,
        options: {
          presets: [["es2015", { modules: false }]],
          plugins: [
            ["transform-react-jsx", { pragma: "h" }],
            "transform-object-rest-spread"
          ]
        }
      }
    ]
  },
  plugins: [
    new CssMigrationWebpackPlugin(),
    new WebpackShellPlugin({
      onBuildEnd: ["node compileComponents.js"]
    })
  ]
};


text:
/* $Id: util.h 2 2009-10-12 09:51:22Z mamonski $ */
/*
 *  FedStage DRMAA utilities library
 *  Copyright (C) 2006-2008  FedStage Systems
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

/**
 * @file util.h
 * Various functions.
 */

#ifndef __DRMAA_UTILS__UTIL_H
#define __DRMAA_UTILS__UTIL_H

#ifdef HAVE_CONFIG_H
#	include <config.h>
#endif

#include <time.h>

#include <drmaa_utils/common.h>
#include <drmaa_utils/compat.h>

char *fsd_explode( const char *const *vector, char glue, int n );
void fsd_free_vector( char **vector );
char **fsd_copy_vector( const char *const * vector );
char *fsd_replace( char *input, const char *placeholder, const char *value );

char *fsd_strdup( const char *s );
char *fsd_strndup( const char *s, size_t n );

int fsd_atoi( const char *s );

void
fsd_str_append(
		bool *truncated,
		char **p, char *end,
		const char *fmt, ...
		)
		__attribute__(( format( printf, 4, 5 ) ));

size_t
fsd_snprintf(
		bool *truncated,
		char *str, size_t size,
		const char *fmt, ...
		)
		__attribute__(( format( printf, 4, 5 ) ));

size_t
fsd_vsnprintf(
		bool *truncated,
		char *str, size_t size,
		const char *fmt, va_list args
		);

/**
 * Behaves like asprintf function from standard C library
 * except any errors are marked in error context structure.
 *
 * It substitutes `%m` format string as in glibc
 * (with `strerror(errno)`).
 */
char *fsd_asprintf( const char *fmt, ... )
		__attribute__(( format( __printf__, 1, 2 ) ));

/**
 * Behaves like vasprintf function from standard C library
 * except any errors are marked in error context structure.
 */
char *fsd_vasprintf( const char *fmt, va_list args );

/**
 * Implements GNU version of strerror_r function - thread-safe
 * function returning message describing error code.
 *
 * From Linux Programmer's Manual:
 *
 * <code> char *strerror_r(int errnum, char *buf, size_t buflen); </code>
 *
 * The GNU-specific strerror_r() returns a pointer to a string containing
 * the error message.  This may be either a pointer to a string that the
 * function stores in buf, or a pointer to some (immutable) static string
 * (in which case buf is unused).  If the function stores a string in
 * buf, then at most buflen bytes are stored (the string may be truncated
 * if buflen is too small) and the string always includes a terminating
 * null byte.
 */
const char *
fsd_strerror_r( int errnum, char *buffer, size_t buffer_size );

char *
fsd_astrerror( int errnum, bool *malloced );

/** Retrievs current system timestamp. */
void fsd_get_time( struct timespec *ts );

/** Add delta to timestamp. */
void fsd_ts_add( struct timespec *a, const struct timespec *b );

/**
 * Compares two timestamps.
 * @return Negative integer when a < b (a represents earlier timestamp),
 *   positive integer when a > b or 0 when timestamps are equal.
 */
int fsd_ts_cmp( const struct timespec *a, const struct timespec *b );

/**
 * Reads file contents.
 * @param filename  Path to the file.
 * @param must_exist  Controls behaviour when file not exist
 *   (or is not readable).  If set to \c true DRMAA_ERRNO_INTERNAL_ERROR
 *   is raised on such occasion.  If set to \c false only
 *   \a content is set to \c NULL and no error is raised.
 * @param content  Filled with pointer to buffer with file contents
 *   or \c NULL when error is encoureged.  Caller is responsible
 *   for free()'ing it.
 * @param length  Filled with length of \a content buffer.
 */
void
fsd_read_file(
		const char *filename, bool must_exist,
		char **content, size_t *length
		);

/**
 * Gets path to current working directory.
 * @return  Path to process's current working directory
 *   in malloc'ed '\0' terminated buffer
 *   or \c NULL in case of error.
 */
char *
fsd_getcwd(void);

/**
 * Returns signal name.
 * @param signum  Valid signal number.
 */
const char *
fsd_strsignal( int signum );

#endif /* __DRMAA_UTILS__UTIL_H */


text:
project_path: /web/_project.yaml
book_path: /web/fundamentals/_book.yaml
description: Finding and fixing mixed content is an important task, but it can be time-consuming. This guide discusses some tools that are available to help with the process.

{# wf_published_on: 2015-09-28 #}
{# wf_updated_on: 2016-08-24 #}

# Preventing Mixed Content {: .page-title }

{% include "web/_shared/contributors/johyphenel.html" %}

Success: Supporting HTTPS for your website is an important step to protecting your site and your users from attack, but mixed content can render that protection useless. To protect your site and your users, it is very important to find and fix mixed content issues.

Finding and fixing mixed content is an important task, but it can be time-consuming. This guide discusses some tools and techniques that are available to help with the process. For more information on mixed content itself, see [What is Mixed Content](./what-is-mixed-content).

### TL;DR {: .hide-from-toc }

* Always use https:// URLs when loading resources on your page.
* Use the `Content-Security-Policy-Report-Only` header to monitor mixed content errors on your site.
* Use the `upgrade-insecure-requests` CSP directive to protect your visitors from insecure content.

## Find and fix mixed content

Manually finding mixed content can be time consuming, depending on the number of issues you have. The process described in this document uses the Chrome browser; however most modern browsers provide similar tools to help with this process.

### Finding mixed content by visiting your site

When visiting an HTTPS page in Google Chrome, the browser alerts you to mixed
content as errors and warnings in the JavaScript console.

To view these alerts, go to our passive mixed content or active mixed content sample page and open the Chrome JavaScript console. You can open the console either from the View menu: _View_ -> _Developer_ -> _JavaScript Console_, or by right-clicking the page, selecting _Inspect Element_, and then selecting _Console_.

The [passive mixed content example](https://googlesamples.github.io/web-fundamentals/fundamentals/security/prevent-mixed-content/passive-mixed-content.html){: .external} on the [What Is Mixed Content](what-is-mixed-content#passive-mixed-content){: .external} page causes mixed content warnings to be displayed, like the ones below:

[Try it](https://googlesamples.github.io/web-fundamentals/fundamentals/security/prevent-mixed-content/passive-mixed-content.html){: target="_blank" .external }

While the active mixed content example causes mixed content errors to be
displayed:

[Try it](https://googlesamples.github.io/web-fundamentals/fundamentals/security/prevent-mixed-content/active-mixed-content.html){: target="_blank" .external }

You need to fix the http:// URLs listed in these errors and warnings, in your site's source. It's helpful to make a list of these URLs, along with the page you found them on, for use when you fix them.

Note: Mixed content errors and warnings are only shown for the page your are currently viewing, and the JavaScript console is cleared every time you navigate to a new  page. This means you will have to view every page of your site individually to find these errors. Some errors may only show up after you interact with part of the page, see the image gallery mixed content example from our previous guide.

### Finding mixed content in your source code

You can search for mixed content directly in your source code. Search for
`http://` in your source and look for tags that include HTTP URL attributes.
Specifically, look for tags listed in the [mixed content types & security threats associated](what-is-mixed-content#mixed-content-types--security-threats-associated){: .external} section of our previous guide.
Note that having `http://` in the href attribute of anchor tags (`<a>`)
is often not a mixed content issue, with some notable exceptions discussed later.

If you have a list of HTTP URLs from Chrome mixed content errors and warnings,
you can also search for these complete URLs in your source to find where they
are included in your site.

### Fixing mixed content

Once you've found where the mixed content is included in your site's source,
follow these steps to fix it.

Using the following mixed content error in Chrome as an example:

Which you found in source here:

#### Step 1

Check that the URL is available over HTTPS by opening a new tab in
your browser, entering the URL in the address bar, and changing `http://` to `https://`

If the resource displayed is the same over **HTTP** and **HTTPS**, everything is OK.
Proceed to [Step 2](#step-2).

      HTTP image loads without error.

      HTTPS image loads without error, and image is the same as HTTP. Go to step 2!

If you see a certificate warning, or if the content can't be displayed over
**HTTPS**, it means the resource is not available securely.

      Resource not available over HTTPS

      Certificate warning when attempting to view resource over HTTPS.

In this case, you should consider one of the following options:

* Include the resource from a different host, if one is available.
* Download and host the content on your site directly, if you are legally allowed to do so.
* Exclude the resource from your site altogether.

#### Step 2

Change the URl from `http://` to `https://`, save the source file, and redeploy the updated file if necessary.

#### Step 3

View the page where you found the error originally and verify that the error no longer appears.

### Beware of non-standard tag usage

Beware of non-standard tag usage on your site. For instance, anchor (`<a>`)
tag URLs don't cause mixed content by themselves, as they cause the browser to
navigate to a new page. This means they usually don't need to be fixed. However
some image gallery scripts override the functionality of the `<a>` tag and
load the HTTP resource specified by the `href` attribute into a lightbox display
on the page, causing a mixed content problem.

{% includecode content_path="web/fundamentals/security/prevent-mixed-content/_code/image-gallery-example.html" region_tag="snippet1" adjust_indentation="auto" %}

[Try it](https://googlesamples.github.io/web-fundamentals/fundamentals/security/prevent-mixed-content/image-gallery-example.html){: target="_blank" .external }

In the code above, it may seem safe to leave the `<a>` tags href as `http://`;
however if you view the sample and click the image, you'll see that it loads
a mixed content resource and displays it on the page.

## Handle mixed content at scale

The manual steps above work well for smaller websites; but for large websites
or sites with many separate development teams, it can be tough to keep track of
all the content being loaded. To help with this task, you can use content
security policy to instruct the browser to notify you about mixed content and
ensure that your pages never unexpectedly load insecure resources.

### Content security policy

[**Content security policy**](/web/fundamentals/security/csp/) (CSP) is a
multi-purpose browser feature that you can use to manage mixed content at
scale. The CSP reporting mechanism can be used to track the mixed content on
your site; and the enforcement policy, to protect users by upgrading or
blocking mixed content.

You can enable these features for a page by including the
`Content-Security-Policy` or `Content-Security-Policy-Report-Only` header in the
response sent from your server. Additionallyyou can set `Content-Security-Policy` (but
**not** `Content-Security-Policy-Report-Only`) using a `<meta>` tag
in the `<head>` section of your page. See examples in the following
sections.

CSP is useful for many things outside of its mixed content uses. Information about other CSP directives is available at the following resources:

* [Mozilla's intro to CSP](https://developer.mozilla.org/en-US/docs/Web/Security/CSP/Introducing_Content_Security_Policy){: .external}
* [HTML5 Rocks' intro to CSP](//www.html5rocks.com/en/tutorials/security/content-security-policy/){: .external}
* [CSP playground](http://www.cspplayground.com/){: .external }
* [CSP spec](//www.w3.org/TR/CSP/){: .external }

Note: Browsers enforce all content security policies that they receive.
Multiple CSP header values received by the browser in the response header or
<meta> elements are combined and enforced as a single policy;
reporting policies are likewise combined. Policies are combined by taking the
intersection of the policies; that is to say, each policy after the first can
only further restrict the allowed content, not broaden it.

### Finding mixed content with content security policy

You can use content security policy to collect reports of mixed content on your
site. To enable this feature, set the `Content-Security-Policy-Report-Only`
directive by adding it as a response header for your site.

Response header:

    Content-Security-Policy-Report-Only: default-src https: 'unsafe-inline' 'unsafe-eval'; report-uri https://example.com/reportingEndpoint

Whenever a user visits a page on your site, their browser sends JSON-formatted
reports regarding anything that violates the content security policy to
`https://example.com/reportingEndpoint`. In this case, anytime a
subresource is loaded over HTTP, a report is sent. These reports include the
page URL where the policy violation occurred and the subresource URL that
violated the policy. If you configure your reporting endpoint to log these
reports, you can  track the mixed content on your site without visiting each
page yourself.

The two caveats to this are:

* Users have to visit your page in a browser that understands the CSP header.
  This is true for most modern browsers.
* You only get reports for pages visited by your users. So if you have pages
  that don't get much traffic, it might be some time before you get reports for
  your entire site.

For more information on CSP header format, see the [Content Security Policy specification](https://w3c.github.io/webappsec/specs/content-security-policy/#violation-reports){: .external}.

If you don't want to configure a reporting endpoint yourself,
[https://report-uri.io/](https://report-uri.io/){: .external} is a reasonable
alternative.

### Upgrading insecure requests

One of the newest and best tools to automatically fix mixed content is the
[**`upgrade-insecure-requests`**](//www.w3.org/TR/upgrade-insecure-requests/){: .external}
CSP directive. This directive instructs the browser to upgrade insecure URLs
before making network requests.

As an example, if a page contains an image tag with an HTTP URL:

The browser instead makes a secure request for
https://example.com/image.jpg, thus saving the user from mixed
content.

You can enable this behavior either by sending a `Content-Security-Policy` header
with this directive:

    Content-Security-Policy: upgrade-insecure-requests

Or by embedding that same directive inline in the document's `<head>`
section using a `<meta>` element:

    <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">

It is worth noting, that if the resource is not available over HTTPS, the
upgraded request fails and the resource is not loaded. This maintains the
security of your page.

The `upgrade-insecure-requests` directive cascades into `<iframe>` documents,
ensuring the entire page is protected.

### Blocking all mixed content

Not all browsers support the upgrade-insecure-requests directive, so an
alternative for protecting users is the
[**`block-all-mixed-content`**](http://www.w3.org/TR/mixed-content/#strict-checking){: .external}
CSP directive. This directive instructs the browser to never load mixed content;
all mixed content resource requests are blocked, including both active and
passive mixed content. This option also cascades into `<iframe>` documents,
ensuring the entire page is mixed content free.

A page can opt itself into this behavior either by sending a
`Content-Security-Policy` header with this directive:

    Content-Security-Policy: block-all-mixed-content

Or by embedding that same directive inline in the document's `<head>`
section using a `<meta>` element:

    <meta http-equiv="Content-Security-Policy" content="block-all-mixed-content">

The downside of using `block-all-mixed-content` is, perhaps obviously, that all
content is blocked. This is a security improvement, but it means that these
resources are no longer available on the page. This might break features and
content that your users expect to be available.

### Alternatives to CSP

If your site is hosted for you by a platform such as Blogger, you may not have
access to modify headers & add a CSP.
Instead a viable alternative could be to use a website crawler to find issues
across your site for you, such as
[HTTPSChecker](https://httpschecker.net/how-it-works#httpsChecker){: .external }
or
[Mixed Content Scan](https://github.com/bramus/mixed-content-scan){: .external }


text:
xkeyscore-bullshitgenerator
===========================

This program generates random *fake* bridges for the NSA and their "anti-TOR-project".
NSA's XKeyScore system parse e-mails outgoing from the tor project to users, in order to block TOR-Bridges and destroy the TOR-network.

You can select the amount of bridges to generate.

Then select an output folder and press "Starten" in order to start the process.


text:
layout: default
---

{% include _masthead.html %}

{% if page.format contains "plate" %}

{% endif %}

    {% if page.sidebar == "toc" %}

      {% include _sidebar-toc.html %}

    {% elsif page.sidebar == "toc-left" %}

      {% include _sidebar-toc.html side="left" %}

    {% endif %}

        {% if page.inside_heading == true %}

          {% if page.image.title %}

            {% if page.image.caption_url and page.image.caption %}

              {{ page.image.caption }}

            {% elsif page.image.caption %}

              {{ page.image.caption }}

            {% endif %}

          {% endif %}

          {% if page.subheadline %}

{{ page.subheadline }}

          {% endif %}

{{ page.title }}

          {% if page.teaser %}

{{ page.teaser }}

          {% endif %}

        {% endif %}

        {{ content }}

        {% if page.show_meta == true %}
        {% include _meta_information.html %}
        {% endif %}

      {% if page.comments == true %}

        {% include _comments.html %}

      {% endif %}

    {% if page.sidebar == "left" %}

      {% include _sidebar.html %}

    {% endif %}

    {% if page.sidebar == "right" %}

      {% if page.lang == "en" %}
        {% include _sidebar_en.html %}
      {% else %}
        {% include _sidebar.html %}
      {% endif %}

    {% endif %}

{% if page.format contains "plate" %}

{% endif %}


text:
MarkedObject::MarkedObject()
{
	m_depth = 0;
	m_object = NULL;
	m_window_size = -1;
	m_num_custom_names = 0;
	m_custom_names = NULL;
}

MarkedObject::MarkedObject(unsigned long depth, HeeksObj* object, int window_size, unsigned int num_custom_names, unsigned int *custom_names)
{
	m_object = object;
	m_depth = depth;
	m_window_size = window_size;
	m_num_custom_names = num_custom_names;
	m_custom_names = NULL;
	if(num_custom_names>0)
	{
		m_custom_names = (unsigned int *)malloc(num_custom_names * sizeof(unsigned int));
		memcpy(m_custom_names, custom_names, num_custom_names * sizeof(unsigned int));
	}
}

MarkedObject::MarkedObject(const MarkedObject &so)
{
	operator=(so);
}

MarkedObject::~MarkedObject(){
	Clear();
	delete(m_custom_names);
}

const MarkedObject& MarkedObject::operator=(const MarkedObject &so)
{
	m_depth = so.m_depth;
	m_object = so.m_object;
	m_num_custom_names = so.m_num_custom_names;
	m_custom_names = NULL;
	if(m_num_custom_names>0)
	{
		m_custom_names = (unsigned int *)malloc(m_num_custom_names * sizeof(unsigned int));
		memcpy(m_custom_names, so.m_custom_names, m_num_custom_names * sizeof(unsigned int));
	}
	return (*this);
}

MarkedObject* MarkedObject::GetCurrent()
{
	if(m_map.size() == 0)return this;
	if(CurrentIt == m_map.end())return this;
	return CurrentIt->second->GetCurrent();
}

unsigned long MarkedObject::GetDepth()
{
	return GetCurrent()->m_depth;
}

unsigned int MarkedObject::GetNumCustomNames()
{
	return GetCurrent()->m_num_custom_names;
}

unsigned int* MarkedObject::GetCustomNames()
{
	return GetCurrent()->m_custom_names;
}

void MarkedObject::Clear()
{
	for(std::map<HeeksObj*, MarkedObject*>::iterator It = m_map.begin(); It != m_map.end(); It++)
	{
		MarkedObject* object = It->second;
		delete object;
	}
	m_map.clear();
	m_types.clear();
}

MarkedObject* MarkedObject::Add(HeeksObj* object, unsigned long depth, int window_size, unsigned int num_custom_names, unsigned int *custom_names)
{
	std::map<HeeksObj*, MarkedObject*>::iterator FindIt = m_map.find(object);
	MarkedObject* marked_object = NULL;
	// if this object has not been added yet
	if(FindIt == m_map.end())
	{
		std::map<int, MarkedObject*>::iterator FindIt2 = m_types.end();
		if(single_type())
		{
			FindIt2 = m_types.find(object->GetType());
			if(FindIt2 != m_types.end())
			{
				MarkedObject* so = FindIt2->second;
				if(depth < so->GetDepth() && window_size<= so->GetWindowSize())
				{
					m_types.erase(FindIt2);
					m_map.erase(so->GetObject());
					so->Clear();
					delete so;
				}
				else{
					return NULL;
				}
			}
		}
		if(single_type())
		{
			marked_object = new MarkedObjectOneOfEach(depth, object, window_size, num_custom_names, custom_names);
		}
		else
		{
			marked_object = new MarkedObjectManyOfSame(depth, object, window_size, num_custom_names, custom_names);
		}
		m_map.insert(std::pair<HeeksObj*, MarkedObject*>(object, marked_object));
		CurrentIt = m_map.end();
		if(single_type())
		{
			std::pair<int, MarkedObject*> type_entry(object->GetType(), marked_object);
			m_types.insert(type_entry);
		}
	}
	else
	{
		marked_object = FindIt->second;
		if(depth<marked_object->m_depth && window_size<= marked_object->m_window_size)
		{
			marked_object->m_depth = depth;
			marked_object->m_window_size = window_size;
		}
	}
	return marked_object;
}

void MarkedObject::SetFirst(EnumStackedType stacked_type)
{
	m_stacked_type = stacked_type;
	if(m_map.size() > 0)
	{
		CurrentIt = m_map.begin();
	}
	switch(m_stacked_type)
	{
		case EverythingStackedType:
		case BottomOnlyStackedType:
		case OneFromLevelStackedType:
			{
				if(m_map.size() > 0){
					CurrentIt = m_map.begin();
					for(std::map<HeeksObj*, MarkedObject*>::iterator It = m_map.begin(); It != m_map.end(); It++)
					{
						It->second->SetFirst(m_stacked_type);
					}
				}
			}
			break;
		default:
			break;
	}
	m_processed = false;
}

HeeksObj* MarkedObject::GetFirstOfEverything()
{
	SetFirst(EverythingStackedType);
	return Increment();
}

HeeksObj* MarkedObject::GetFirstOfTopOnly()
{
	SetFirst(TopOnlyStackedType);
	return Increment();
}

HeeksObj* MarkedObject::GetFirstOfBottomOnly()
{
	SetFirst(BottomOnlyStackedType);
	return Increment();
}

HeeksObj* MarkedObject::GetFirstOfOneFromLevel()
{
	SetFirst(OneFromLevelStackedType);
	return Increment();
}

HeeksObj* MarkedObject::Increment()
{
	if(m_stacked_type == TopOnlyStackedType)
	{
		if(m_map.size() == 0)return NULL;
		if(!m_processed)
		{
			m_processed = true;
			CurrentIt = m_map.begin();
		}
		else
		{
			if(CurrentIt == m_map.end())return NULL;
			CurrentIt++;
			if(CurrentIt == m_map.end())return NULL;
		}
		return CurrentIt->first;
	}
	if(m_stacked_type == BottomOnlyStackedType)
	{
		if(!m_processed && m_map.size() == 0)
		{
			m_processed = true;
			return m_object;
		}
		if(m_map.size() == 0)return NULL;
		if(!m_processed)
		{
			m_processed = true;
			CurrentIt = m_map.begin();
		}
		HeeksObj* object = CurrentIt->second->Increment();
		if(object)return object;
		if(CurrentIt == m_map.end())return NULL;
		CurrentIt++;
		if(CurrentIt == m_map.end())return NULL;
		return Increment();
	}
	if(m_stacked_type == OneFromLevelStackedType)
	{
		if(!m_processed)
		{
			m_processed = true;
			if(m_object)return m_object;
		}
		if(m_map.size() == 0)return NULL;
		return m_map.begin()->second->Increment();
	}
	if(!m_processed)
	{
		m_processed = true;
		if(m_stacked_type == 0 && m_object)return m_object;
	}
	if(m_map.size() == 0)return NULL;
	if(CurrentIt == m_map.end())return NULL;
	HeeksObj* object = CurrentIt->second->Increment();
	if(object)return object;
	CurrentIt++;
	return Increment();
}


text:
[![Build Status](https://travis-ci.org/phase/board.svg?branch=master)](https://travis-ci.org/phase/board)

This is some board software written in Crystal. It was inspired by Acmlmboard
and its derivatives.

There is no name for it yet. `CryBoard` or `BoardCr` may be used.

## Installing

Create a `config.json` modeled after `example_config.json`.

### MySQL

Open your MySQL shell.

```bash
mysql -u root -p
```

Create the database and tables. You can use the provided SQL file or use the
statements below.

```bash
mysql -e 'create database cryboard;' --verbose
mysql cryboard --verbose < install.sql
```

or

```sql
-- Create the database and select it
create database cryboard;
use cryboard;

-- Create the tables
CREATE TABLE `users` (
  `id` int(32) NOT NULL PRIMARY KEY AUTO_INCREMENT,
  `name` varchar(32) NOT NULL,
  `displayname` varchar(255) DEFAULT NULL,
  `title` varchar(255) DEFAULT NULL,
  `password` varchar(255) NOT NULL,
  `powerlevel` int(1) NOT NULL DEFAULT '0',
  `sex` int(1) NOT NULL DEFAULT '2',
  `namecolor` varchar(6) DEFAULT NULL,
  `lastip` varchar(32) DEFAULT NULL,
  `ban_expire` int(32) DEFAULT '0',
  `since` int(32) NOT NULL DEFAULT '0',
  `ppp` int(3) NOT NULL DEFAULT '25',
  `tpp` int(3) NOT NULL DEFAULT '25',
  `head` text,
  `sign` text,
  `dateformat` varchar(32) DEFAULT NULL,
  `timeformat` varchar(32) DEFAULT NULL,
  `lastpost` int(32) NOT NULL DEFAULT '0',
  `lastview` int(32) NOT NULL DEFAULT '0',
  `lastforum` int(32) NOT NULL DEFAULT '0',
  `bio` text,
  `posts` int(32) NOT NULL DEFAULT '0',
  `threads` int(32) NOT NULL DEFAULT '0',
  `email` varchar(64) NOT NULL DEFAULT '',
  `homepage` varchar(64) NOT NULL DEFAULT '',
  `youtube` varchar(64) NOT NULL DEFAULT '',
  `twitter` varchar(64) NOT NULL DEFAULT '',
  `facebook` varchar(64) NOT NULL DEFAULT '',
  `homepage_name` varchar(64) NOT NULL DEFAULT '',
  `tzoff` int(2) NOT NULL DEFAULT '0',
  `realname` varchar(64) NOT NULL DEFAULT '',
  `location` varchar(64) NOT NULL DEFAULT '',
  `birthday` int(32) DEFAULT NULL,
  `theme` int(8) NOT NULL DEFAULT '1',
  `showhead` tinyint(1) NOT NULL DEFAULT '1',
  `signsep` int(3) NOT NULL DEFAULT '1',
  `icon` text,
  `spent` int(32) NOT NULL DEFAULT '0',
  `gcoins` int(32) NOT NULL DEFAULT '0',
  `gspent` int(32) NOT NULL DEFAULT '0',
  `radar_mode` int(4) NOT NULL DEFAULT '0',
  `profile_locked` tinyint(1) NOT NULL DEFAULT '0',
  `editing_locked` int(1) NOT NULL DEFAULT '0',
  `title_status` int(1) NOT NULL DEFAULT '0',
  `rankset` int(4) NOT NULL DEFAULT '1',
  `publicemail` tinyint(1) NOT NULL DEFAULT '2',
  `class` smallint(4) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE `posts` (
  `id` int(32) NOT NULL PRIMARY KEY AUTO_INCREMENT,
  `text` text NOT NULL,
  `time` int(32) NOT NULL,
  `thread` int(32) NOT NULL,
  `user` int(32) NOT NULL,
  `rev` int(4) NOT NULL DEFAULT '0',
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  `nohtml` tinyint(1) NOT NULL DEFAULT '0',
  `nosmilies` tinyint(1) NOT NULL DEFAULT '0',
  `nolayout` tinyint(1) NOT NULL DEFAULT '0',
  `lastedited` int(32) NOT NULL DEFAULT '0',
  `avatar` int(32) NOT NULL DEFAULT '0',
  `noob` tinyint(1) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE `threads` (
  `id` int(32) NOT NULL PRIMARY KEY AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `title` varchar(255) NOT NULL,
  `time` int(32) NOT NULL,
  `forum` int(32) NOT NULL,
  `user` int(32) NOT NULL,
  `sticky` tinyint(1) NOT NULL DEFAULT '0',
  `closed` tinyint(1) NOT NULL DEFAULT '0',
  `views` int(32) NOT NULL DEFAULT '0',
  `replies` int(32) NOT NULL DEFAULT '0',
  `icon` text,
  `ispoll` tinyint(1) NOT NULL DEFAULT '0',
  `lastpostid` int(32) DEFAULT NULL,
  `lastpostuser` int(32) DEFAULT NULL,
  `lastposttime` int(32) DEFAULT NULL,
  `noob` tinyint(1) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE `forums` (
  `id` int(32) NOT NULL PRIMARY KEY AUTO_INCREMENT,
  `name` varchar(256) NOT NULL,
  `title` varchar(256) NOT NULL,
  `minpower` tinyint(1) NOT NULL DEFAULT '0',
  `minpowerreply` tinyint(1) NOT NULL DEFAULT '0',
  `minpowerthread` tinyint(1) NOT NULL DEFAULT '0',
  `hidden` tinyint(1) NOT NULL DEFAULT '0',
  `threads` int(32) NOT NULL DEFAULT '0',
  `posts` int(32) NOT NULL DEFAULT '0',
  `category` int(32) NOT NULL DEFAULT '0',
  `ord` int(32) NOT NULL DEFAULT '0',
  `theme` int(32) DEFAULT NULL,
  `lastpostid` int(32) DEFAULT NULL,
  `lastpostuser` int(32) DEFAULT NULL,
  `lastposttime` int(32) DEFAULT NULL,
  `pollstyle` tinyint(4) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- Test data
INSERT INTO `forums` (`id`, `name`, `title`, `minpower`, `minpowerreply`, `minpowerthread`, `category`, `ord`) VALUES
(1, 'General Forum', 'For everybody!', 0, 0, 0, 1, 1),
(2, 'General Staff Forum', 'Not for everybody.', 2, 2, 2, 2, 2),
(3, 'Garbage', 'The worst posts.', 0, 0, 0, 3, 99);

INSERT INTO `threads` (`id`, `name`, `title`, `time`, `forum`, `user`) VALUES
(1, 'Test Thread 1', 'Sub title thing', 0, 1, 1),
(2, 'Test Thread 2', 'another sub title', 0, 1, 1);

INSERT INTO `posts` (`text`, `time`, `thread`, `user`, `rev`) VALUES
("Woah, this is pretty cool.", 123, 1, 1, 1),
("Yeah, this is neato!", 124, 1, 1, 1),
("Get your shit board out of here.", 125, 1, 2, 1);

INSERT INTO `users` (`name`, `password`) VALUES
("phase", "some_hash"),
("StapleButter", "some_weak_hash");
```

## Uninstalling

```sql
-- Delete a specific table
drop table users;

-- Delete the database
drop database cryboard;
```


text:
package resource

import "github.com/shurcooL/githubv4"

// ReleaseObject represent the graphql release object
// https://developer.github.com/v4/object/release
type ReleaseObject struct {
	CreatedAt    githubv4.DateTime `graphql:"createdAt"`
	PublishedAt  githubv4.DateTime `graphql:"publishedAt"`
	ID           string            `graphql:"id"`
	DatabaseId   githubv4.Int      `graphql:"databaseId"`
	IsDraft      bool              `graphql:"isDraft"`
	IsPrerelease bool              `graphql:"isPrerelease"`
	Name         string            `graphql:"name"`
	TagName      string            `graphql:"tagName"`
	URL          string            `graphql:"url"`
}

// ReleaseObjectEnterprise Workaround until DatabaseId will appear in enterprise installation
// https://github.com/concourse/github-release-resource/issues/109
type ReleaseObjectEnterprise struct {
	CreatedAt    githubv4.DateTime `graphql:"createdAt"`
	PublishedAt  githubv4.DateTime `graphql:"publishedAt"`
	ID           string            `graphql:"id"`
	IsDraft      bool              `graphql:"isDraft"`
	IsPrerelease bool              `graphql:"isPrerelease"`
	Name         string            `graphql:"name"`
	TagName      string            `graphql:"tagName"`
	URL          string            `graphql:"url"`
}


text:
package com.ethlo.schematools.jsons2xsd;

import com.ethlo.schematools.jsons2xsd.Jsons2XsdSingleFile.OuterWrapping;
import org.junit.Test;
import org.w3c.dom.Document;

import javax.xml.transform.TransformerException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.Reader;

/**
 *
 * @author mha
 *
 */
public class ConversionTestSingleFile
{

	@Test
	public void testConversionCMTS() throws IOException, TransformerException
	{

			final Reader r = new InputStreamReader(getClass().getResourceAsStream("/schema/account.json"));
			final Reader def = new InputStreamReader(getClass().getResourceAsStream("/schema/definitions.json"));

			final Document doc = Jsons2XsdSingleFile.convert(r, def, "http://cableapi.cablelabs.com/schemas/v1/CMTS", OuterWrapping.ELEMENT, "CMTS");
			System.out.println(XmlUtil.asXmlString(doc.getDocumentElement()));

	}

}


text:
package org.keycloak.adapters.jetty.spi;

import org.keycloak.adapters.spi.AuthenticationError;
import org.keycloak.adapters.spi.HttpFacade;
import org.keycloak.adapters.spi.LogoutError;
import org.keycloak.common.util.MultivaluedHashMap;
import org.keycloak.common.util.UriUtils;

import javax.security.cert.X509Certificate;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.List;

/**
 * @author Bill Burke
 * @version $Revision: 1 $
 */
public class JettyHttpFacade implements HttpFacade {
    public final static String __J_METHOD = "org.eclipse.jetty.security.HTTP_METHOD";
    protected org.eclipse.jetty.server.Request request;
    protected HttpServletResponse response;
    protected RequestFacade requestFacade = new RequestFacade();
    protected ResponseFacade responseFacade = new ResponseFacade();
    protected MultivaluedHashMap<String, String> queryParameters;

    public JettyHttpFacade(org.eclipse.jetty.server.Request request, HttpServletResponse response) {
        this.request = request;
        this.response = response;
    }

    @Override
    public Request getRequest() {
        return requestFacade;
    }

    @Override
    public Response getResponse() {
        return responseFacade;
    }

    @Override
    public X509Certificate[] getCertificateChain() {
        throw new IllegalStateException("Not supported yet");
    }

    public boolean isEnded() {
        return responseFacade.isEnded();
    }

    protected class RequestFacade implements Request {
        @Override
        public String getURI() {
            StringBuffer buf = request.getRequestURL();
            if (request.getQueryString() != null) {
                buf.append('?').append(request.getQueryString());
            }
            return buf.toString();
        }

        @Override
        public String getFirstParam(String param) {
            return request.getParameter(param);
        }

        @Override
        public boolean isSecure() {
            return request.isSecure();
        }

        @Override
        public String getQueryParamValue(String paramName) {
            if (queryParameters == null) {
                queryParameters = UriUtils.decodeQueryString(request.getQueryString());
            }
            return queryParameters.getFirst(paramName);
        }

        @Override
        public Cookie getCookie(String cookieName) {
            if (request.getCookies() == null) return null;
            javax.servlet.http.Cookie cookie = null;
            for (javax.servlet.http.Cookie c : request.getCookies()) {
                if (c.getName().equals(cookieName)) {
                    cookie = c;
                    break;
                }
            }
            if (cookie == null) return null;
            return new Cookie(cookie.getName(), cookie.getValue(), cookie.getVersion(), cookie.getDomain(), cookie.getPath());
        }

        @Override
        public List<String> getHeaders(String name) {
            Enumeration<String> headers = request.getHeaders(name);
            if (headers == null) return null;
            List<String> list = new ArrayList<String>();
            while (headers.hasMoreElements()) {
                list.add(headers.nextElement());
            }
            return list;
        }

        @Override
        public InputStream getInputStream() {
            try {
                return request.getInputStream();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }

        @Override
        public String getMethod() {
            return request.getMethod();
        }

        @Override
        public String getHeader(String name) {
            return request.getHeader(name);
        }

        @Override
        public String getRemoteAddr() {
            return request.getRemoteAddr();
        }

        @Override
        public void setError(AuthenticationError error) {
            request.setAttribute(AuthenticationError.class.getName(), error);

        }

        @Override
        public void setError(LogoutError error) {
            request.setAttribute(LogoutError.class.getName(), error);
        }

    }

    protected class ResponseFacade implements Response {
        protected boolean ended;

        @Override
        public void setStatus(int status) {
            response.setStatus(status);
        }

        @Override
        public void addHeader(String name, String value) {
            response.addHeader(name, value);
        }

        @Override
        public void setHeader(String name, String value) {
            response.setHeader(name, value);
        }

        @Override
        public void resetCookie(String name, String path) {
            setCookie(name, "", null, path, 0, false, false);
        }

        @Override
        public void setCookie(String name, String value, String path, String domain, int maxAge, boolean secure, boolean httpOnly) {
            javax.servlet.http.Cookie cookie = new javax.servlet.http.Cookie(name, value);
            if (domain != null) cookie.setDomain(domain);
            if (path != null) cookie.setPath(path);
            if (secure) cookie.setSecure(true);
            if (httpOnly) cookie.setHttpOnly(httpOnly);
            cookie.setMaxAge(maxAge);
            response.addCookie(cookie);
        }

        @Override
        public OutputStream getOutputStream() {
            try {
                return response.getOutputStream();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }

        @Override
        public void sendError(int code) {
            try {
                response.sendError(code);
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }

        @Override
        public void sendError(int code, String message) {
            try {
                response.sendError(code, message);
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }

        @Override
        public void end() {
            ended = true;
        }

        public boolean isEnded() {
            return ended;
        }
    }
}


text:
using ATTS.Infrastructure.IoC;
using Ninject;
using System.Reflection;
using System.Windows;

namespace ATTS.View
{
    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App : Application
    {
        protected override void OnStartup(StartupEventArgs e)
        {
            IoCKernel.Init(new BootstrapperModule());

            base.OnStartup(e);
        }
    }
}


text:
import org.lwjgl.opengl.Display;
import org.lwjgl.opengl.GL11;
import org.newdawn.slick.Color;
import org.newdawn.slick.opengl.Texture;
import org.newdawn.slick.opengl.TextureLoader;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;

import static org.lwjgl.opengl.GL11.*;
import static org.lwjgl.opengl.GL11.GL_TEXTURE_2D;
import static org.lwjgl.opengl.GL11.glDisable;

/**
 * @author Cameron Steer
 * @date 13/02/2014
 * @since 20/02/2014
 * @version *1.0.1*
 * @brief creates a new C4 square, extends the AbstractSquare class
 */
public class C4Square extends AbstractSquare{

    private static Texture m_square;
    private static boolean m_Test = false;

    /**
     * Constructor for a new square
     * @param x
     * @param  y
     * @param width
     * @param height
     * @param used
     */
    public C4Square(double x, double y, double width, double height, boolean used) {
        super(x, y, width, height, used);
    }

	/**
	* Draws the squared of the using the texture loaded in the constructor
	*/
    @Override
    public void draw(){
        glEnable(GL_TEXTURE_2D);
        Color.white.bind();
        m_square.bind();
        glBegin(GL11.GL_QUADS);
        glTexCoord2f(0, 0);
        glVertex2d(m_x, m_y);
        glTexCoord2f(1, 0);
        glVertex2d(m_x + m_square.getTextureWidth(), m_y);
        glTexCoord2f(1, 1);
        glVertex2d(m_x + m_square.getTextureWidth(), m_y + m_square.getTextureHeight());
        glTexCoord2f(0, 1);
        glVertex2d(m_x, m_y + m_square.getTextureHeight());
        glEnd();
        glDisable(GL_TEXTURE_2D);
    }

	/**
	* loads in the texture file for the square
	*/
    public static void setTexture(){
        try {
            m_square = TextureLoader.getTexture("PNG", new FileInputStream(new File("res/square.png")));
            if (m_Test){
                System.out.println("Texture loaded: " + m_square);
                System.out.println(">> Image width: " + m_square.getImageWidth());
                System.out.println(">> Image height: " + m_square.getImageHeight());
                System.out.println(">> Texture width: " + m_square.getTextureWidth());
                System.out.println(">> Texture height: " + m_square.getTextureHeight());
                System.out.println(">> Texture ID: " + m_square.getTextureID());
            }
        } catch (FileNotFoundException e) {
            e.printStackTrace();
            System.out.println("File not found");
            Display.destroy();
            System.exit(1);
        } catch (IOException e) {
            e.printStackTrace();
            System.out.println("IOException");
            Display.destroy();
            System.exit(1);
        }
    }

	/**
	* removes textures when games connect 4 is closed
	*/
    public void releaseTexture(){
        m_square.release();
    }
}