text:
from __future__ import absolute_import, division, print_function
__metaclass__ = type

ANSIBLE_METADATA = {'metadata_version': '1.1',
                    'status': ['preview'],
                    'supported_by': 'community'}

DOCUMENTATION = '''
---
module: cloud_init_data_facts
short_description: Retrieve facts of cloud-init.
description:
  - Gathers facts by reading the status.json and result.json of cloud-init.
version_added: 2.6
author: René Moser (@resmo)
options:
  filter:
    description:
      - Filter facts
    choices: [ status, result ]
notes:
  - See http://cloudinit.readthedocs.io/ for more information about cloud-init.
'''

EXAMPLES = '''
- name: Gather all facts of cloud init
  cloud_init_data_facts:
  register: result

- debug:
    var: result

- name: Wait for cloud init to finish
  cloud_init_data_facts:
    filter: status
  register: res
  until: "res.cloud_init_data_facts.status.v1.stage is defined and not res.cloud_init_data_facts.status.v1.stage"
  retries: 50
  delay: 5
'''

RETURN = '''
---
cloud_init_data_facts:
  description: Facts of result and status.
  returned: success
  type: dict
  sample: '{
    "status": {
        "v1": {
            "datasource": "DataSourceCloudStack",
            "errors": []
        },
    "result": {
        "v1": {
            "datasource": "DataSourceCloudStack",
            "init": {
                "errors": [],
                "finished": 1522066377.0185432,
                "start": 1522066375.2648022
            },
            "init-local": {
                "errors": [],
                "finished": 1522066373.70919,
                "start": 1522066373.4726632
            },
            "modules-config": {
                "errors": [],
                "finished": 1522066380.9097016,
                "start": 1522066379.0011985
            },
            "modules-final": {
                "errors": [],
                "finished": 1522066383.56594,
                "start": 1522066382.3449218
            },
            "stage": null
        }
    }'
'''

import os

from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils._text import to_text

CLOUD_INIT_PATH = "/var/lib/cloud/data/"

def gather_cloud_init_data_facts(module):
    res = {
        'cloud_init_data_facts': dict()
    }

    for i in ['result', 'status']:
        filter = module.params.get('filter')
        if filter is None or filter == i:
            res['cloud_init_data_facts'][i] = dict()
            json_file = CLOUD_INIT_PATH + i + '.json'

            if os.path.exists(json_file):
                f = open(json_file, 'rb')
                contents = to_text(f.read(), errors='surrogate_or_strict')
                f.close()

                if contents:
                    res['cloud_init_data_facts'][i] = module.from_json(contents)
    return res

def main():
    module = AnsibleModule(
        argument_spec=dict(
            filter=dict(choices=['result', 'status']),
        ),
        supports_check_mode=True,
    )

    facts = gather_cloud_init_data_facts(module)
    result = dict(changed=False, ansible_facts=facts, **facts)
    module.exit_json(**result)

if __name__ == '__main__':
    main()


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Agaricus hettematica Britzelm.

### Remarks
null

redpajama_set_name: RedPajamaGithub


text:
import React, { useState } from "react";
import { Editor } from "./editor/Editor";
import { LogKind } from "./LogKind";
import { Terminal } from "./terminal/Terminal";
import { Acl2Response } from "./acl2_driver";
import { Tutorial } from "./tutorial/Tutorial";

export function Main() {
  const [showTutorial, setShowTutorial] = useState(false);

  const [log, setLog] = useState<
    Array<{
      input?: string;
      output: { kind: LogKind; value?: string };
    }>
  >([{ output: { kind: LogKind.WELCOME } }]);

  const [pendingInput, setPendingInput] = useState<string | undefined>(
    undefined,
  );

  function updateLog(r: Acl2Response) {
    let kind: LogKind;
    switch (r.Kind) {
      case "ERROR":
        kind = LogKind.ERROR;
        break;
      case "SUCCESS":
        kind = LogKind.SUCCESS;
        break;
      default:
        console.error(`Unexpected response kind: ${r.Kind}`);
        kind = LogKind.INFO;
        break;
    }
    setLog((log) =>
      log.concat({
        input: pendingInput,
        output: { kind, value: r.Body },
      }),
    );
    setPendingInput(undefined);
  }

  return (
    <>
      {showTutorial ? (
        <Tutorial
          onEdit={() => {
            setShowTutorial(false);
          }}
        />
      ) : (
        <Editor
          onOutput={(r) => {
            updateLog(r);
          }}
          onEnterTutorial={() => {
            setShowTutorial(true);
          }}
        />
      )}
      <Terminal
        log={log}
        pendingInput={pendingInput}
        onOutput={(r) => {
          updateLog(r);
        }}
        onInput={(i) => {
          setPendingInput(i);
        }}
      />
    </>
  );
}


text:
<project>
    <modelVersion>4.0.0</modelVersion>
    <groupId>ru.skilanov</groupId>
    <artifactId>java-a-to-z</artifactId>
    <version>1.0</version>
    <packaging>pom</packaging>

    <modules>
        <module>chapter_001</module>
        <module>tracker</module>
        <module>chapter_002</module>
        <module>chapter_003</module>
        <module>chapter_004</module>
    </modules>
    <build>
        <plugins>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>0.7.9</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>report</id>
                        <phase>test</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>


text:
#import "AMDJSClass.h"
#import "AMDBinding.h"

@class AMDDirectory, L8Value;

/**
 * @brief A class for manipulating the native file system: JavaScript exports.
 */
@protocol AMDFileSystem <L8Export>

/**
 * @section File System structure operations.
 */

/**
 * Get a list of items at specified path.
 *
 * @param path Path of the directory to look in.
 * @return An array with the names of each item in the directory.
 */
L8_EXPORT_AS(list,
+ (NSArray *)contentsOfDirectoryAtPath:(NSString *)path
);

/**
 * Create a directory at given path.
 *
 * If the directory already exists, nil will be returned.
 *
 * @param path Path of the new directory.
 * @return An AMDDirectory initialized with the path on
 * success, or nil on failure.
 */
L8_EXPORT_AS(mkdir,
+ (AMDDirectory *)createDirectoryAtPath:(NSString *)path
);

/**
 * Remove an item on the file system.
 *
 * Directories will be removed recursively. This action can't be undone.
 *
 * @param path Path of the item to remove.
 * @return YES on success, NO on failure.
 */
L8_EXPORT_AS(remove,
+ (BOOL)removeItemAtPath:(NSString *)path
);

/**
 * Rename or move an item.
 *
 * @param from The path of the old item.
 * @param to The new path of the item.
 * @return YES on success, NO on failure.
 */
L8_EXPORT_AS(rename,
+ (BOOL)renameItemAtPath:(NSString *)from toPath:(NSString *)to
);

/**
 * Check whether an item at specified path exists.
 *
 * @param path The path to check.
 * @return YES if the item exists, NO otherwise.
 */
L8_EXPORT_AS(exists,
+ (BOOL)itemExistsAtPath:(NSString *)path
);

/**
 * @section File operations.
 */

/**
 * Read a file into memory.
 *
 * @param path Path of the file.
 * @param encoding Encoding of the file. [utf8,utf16,utf16le,utf16be,bin]
 * @return A binary data object if 'bin', a string otherwise.
 */
L8_EXPORT_AS(readFile,
+ (L8Value *)contentsOfFileAtPath:(NSString *)path withEncoding:(NSString *)encoding
);

/**
 * Write to a file, overwriting the contents.
 *
 * @param path Path of the file.
 * @param data Data for the file.
 * @param encoding Encoding for the file. [utf8,utf16,utf16le,utf16be,bin]
 * @return YES on success, NO on failure.
 */
L8_EXPORT_AS(writeFile,
+ (BOOL)writeToFile:(NSString *)path data:(L8Value *)data withEncoding:(NSString *)encoding
);

@end

/**
 * @brief A class for manipulating the native file system.
 */
@interface AMDFileSystem : NSObject <AMDFileSystem, AMDBinding>

/**
 * Get the Foundation encoding for a JavaScript textual name
 * of the encoding.
 *
 * @param encoding Name of the encoding.
 * @return The encoding, or 0 if no match.
 */
+ (NSStringEncoding)stringEncodingForEncoding:(NSString *)encoding;

@end


text:
//==============================================================================
//         Copyright 2003 - 2011   LASMEA UMR 6602 CNRS/Univ. Clermont II
//         Copyright 2009 - 2011   LRI    UMR 8623 CNRS/Univ Paris Sud XI
//
//          Distributed under the Boost Software License, Version 1.0.
//                 See accompanying file LICENSE.txt or copy at
//                     http://www.boost.org/LICENSE_1_0.txt
//==============================================================================
#ifndef NT2_BITWISE_FUNCTIONS_BITWISE_NOTOR_HPP_INCLUDED
#define NT2_BITWISE_FUNCTIONS_BITWISE_NOTOR_HPP_INCLUDED

#include <boost/simd/bitwise/include/functions/bitwise_notor.hpp>
#include <nt2/include/functor.hpp>

/* Automatically generated for module core.base */

namespace nt2
{
  namespace tag
  {
    #ifdef DOXYGEN_ONLY
    /*! \brief Same as \classref{boost::simd::tag::bitwise_notor_} **/
    struct bitwise_notor_ {};
    #endif
    using boost::simd::tag::bitwise_notor_;
  }

  #ifdef DOXYGEN_ONLY
  /*! \brief Same as \funcref{boost::simd::bitwise_notor} **/
  template<class... Args>
  details::unspecified bitwise_notor(Args&&... args);
  #endif
  using boost::simd::bitwise_notor;
}

#endif


text:
<?php namespace Synthesise\Http\Requests;

use Illuminate\Support\Facades\Auth;

class NoteRequest extends Request {

	/**
	 * Get the validation rules that apply to the request.
	 *
	 * @return array
	 */
	public function rules()
	{
		return [
			// @todo Eine Validation Regel für alpha_dash mit Leerzeichen erstellen.
			'cuepointNumber'	=> 'required'
		];
	}

	/**
	 * Determine if the user is authorized to make this request.
	 *
	 * @return bool
	 */
	public function authorize()
	{
		return Auth::check();
	}

}


text:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="44dp"
    android:background="@drawable/nav_background"
    android:gravity="center_vertical"
    android:orientation="horizontal"  >

    <com.BeeFramework.view.DarkImageView
        android:id="@+id/topview_back"
        android:layout_width="40dp"
        android:layout_height="40dp"
        android:layout_gravity="center_vertical"
        android:padding="10dp"
        android:src="@drawable/b2_publishphotoboard_1"
        android:visibility="gone" />

    <TextView
        android:id="@+id/topview_title"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:gravity="center"
        android:singleLine="true"
        android:ellipsize="marquee"
        android:focusable="true"
        android:focusableInTouchMode="true"
        android:textColor="#ffffff"
        android:textSize="19dp"
        android:layout_marginLeft="45dp"
        android:layout_marginRight="45dp"/>
    <ImageView android:layout_height="30dp"
            android:layout_width="30dp"
            android:id="@+id/rightButton"
            android:src="@drawable/profile_refresh_site_icon"
            android:visibility="visible" android:layout_gravity="center_vertical|right"/>

</FrameLayout>


text:
define(['jQuery', 'configuration'], function(jQuery, config) {
    'use strict';
    return function() {
        function loadIssueCollector(url) {
            return jQuery.ajax({
                url: url,
                type: 'get',
                cache: true,
                dataType: 'script'
            });
        }

        if(config.jiraIssueCollectorUrl) {
            loadIssueCollector(config.jiraIssueCollectorUrl);
        }
    };
});


text:
 * Added `$in` expression for **Arrays**
 * Handle plain keys that contain expressions, Arrays and/or plain values.
 * Update lodash to v0.4.11


text:
/*!
 * \file
 * \brief The Mersenne Twister pseudo-random number generator (PRNG) with fast SIMD instructions.
 *
 * This is an implementation of fast PRNG called MT19937,
 * meaning it has a period of 2^19937-1, which is a Mersenne
 * prime.
 *
 * This PRNG is fast and suitable for non-cryptographic code.
 * For instance, it would be perfect for Monte Carlo simulations,
 * etc.
 *
 * This implementation is inspired by: https://github.com/cslarsen/mersenne-twister.
 * It takes advantage of the fast SIMD instructions of the modern CPUs.
 *
 */

#ifndef PRNG_MT19937_SIMD_HPP
#define PRNG_MT19937_SIMD_HPP

#include <cstdint>
#include <mipp.h>

namespace aff3ct
{
namespace tools
{
/*!
 * \class PRNG_MT19937_simd
 * \brief The Mersenne Twister pseudo-random number generator (PRNG) with fast SIMD instructions.
 */
class PRNG_MT19937_simd
{
protected:
	mipp::vector<mipp::Reg<int32_t>> MT;
	unsigned index;

public:
	explicit PRNG_MT19937_simd(const mipp::Reg<int32_t> seed);
	PRNG_MT19937_simd();
	virtual ~PRNG_MT19937_simd();

	/*!
	 * \brief Initializes Mersenne Twister with given seed value.
	 *
	 * \param seed: a vector register of seeds to initialize the PRNG.
	 */
	void seed(const mipp::Reg<int32_t> seed);

	/*!
	 * \brief Extracts a pseudo-random signed 32-bit integer in the range INT32_MIN ... INT32_MAX.
	 *
	 * \return a vector register of pseudo random numbers.
	 */
	mipp::Reg<int32_t> rand_s32();

	/*!
	 * \brief Returns a random float in the CLOSED range [0, 1]
	 * Mnemonic: randf_co = random float 0=closed 1=closed.
	 *
	 * \return a vector register of pseudo random numbers.
	 */
	mipp::Reg<float> randf_cc();

	/*!
	 * \brief Returns a random float in the OPEN range [0, 1>
	 * Mnemonic: randf_co = random float 0=closed 1=open.
	 *
	 * \return a vector register of pseudo random numbers.
	 */
	mipp::Reg<float> randf_co();

	/*!
	 * \brief Returns a random float in the OPEN range <0, 1>
	 * Mnemonic: randf_oo = random float 0=open 1=open.
	 *
	 * \return a vector register of pseudo random numbers.
	 */
	mipp::Reg<float> randf_oo();

private:
	void generate_numbers();
};
}
}

#endif // PRNG_MT19937_simd_FAST_HPP


text:
<?php

use yii\db\Schema;
use yii\db\Migration;

class m150411_182919_create_user_table extends Migration
{
    public function up()
    {
        $tableOptions = null;
        if ($this->db->driverName === 'mysql') {
            // http://stackoverflow.com/questions/766809/whats-the-difference-between-utf8-general-ci-and-utf8-unicode-ci
            $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB';
        }
        $this->createTable('{{%user}}', [
            'id' => Schema::TYPE_PK,
            'username' => Schema::TYPE_STRING . ' NOT NULL',
            'auth_key' => Schema::TYPE_STRING . '(32) NOT NULL',
            'password_hash' => Schema::TYPE_STRING . ' NOT NULL',
            'password_reset_token' => Schema::TYPE_STRING,
            'email' => Schema::TYPE_STRING . ' NOT NULL',
            'status' => Schema::TYPE_SMALLINT . ' NOT NULL DEFAULT 10',
            'created_at' => Schema::TYPE_INTEGER . ' NOT NULL',
            'updated_at' => Schema::TYPE_INTEGER . ' NOT NULL',
        ], $tableOptions);

        $this->createIndex('idx_user_username', '{{%user}}', 'username');
        $this->createIndex('idx_user_email', '{{%user}}', 'email');
        $this->createIndex('idx_user_status', '{{%user}}', 'status');
    }

    public function down()
    {
        $this->dropTable('{{%user}}');
    }
}


text:
<?php echo $open; ?>
<?php echo $label; ?>
<?php echo $message; ?>
<span class="field">
    <?php foreach ($this->fields() as $checkbox): ?>
        <?php echo $checkbox->render(); ?>
    <?php endforeach; ?>
</span>
<?php echo $close; ?>


text:
<?php

namespace App\Command\User;

use App\Command\BaseCommand;
use Symfony\Component\Validator\Constraints as Assert;

class AddUserRoleCommand extends BaseCommand
{
    /**
     * @var string
     */
    #[Assert\NotNull]
    #[Assert\NotBlank]
    private $username;

    /**
     * @var string
     */
    #[Assert\NotNull]
    #[Assert\NotBlank]
    private $role;

    public function __construct(string $username, string $role)
    {
        $this->username = $username;
        $this->role = $role;
    }

    public function getUsername(): string
    {
        return $this->username;
    }

    public function getRole(): string
    {
        return $this->role;
    }
}


text:
<?php

require(dirname(__FILE__) . '/PHPExcel_Library.php');

class PHPExcel extends PHPExcelBase {

    private $_type = null;
    private $_url = null;
    private $_types = [ 'xlsx' => 'Excel2007', 'xls' => 'Excel5' ];

    private $_path = null;
    private $_filename = null;
    private $_extension = null;

    private $_cells = [ 'A', 'B', 'C', 'D', 'E', 'F' ,'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N' ,'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' ];

    public function setPropertie($properties = array()){
        if (!empty($properties)) {
            foreach ($properties as $propertie => $value) {
                exec('$this->' . ucfirst($propertie) . '(' . $value . ')');
            }
        }
    }
    public function setCells($cells = array()){
        if (!empty($cells)) {
            foreach ($cells as $sheet => $cell) {
                if(!empty($cell['items'])){
                    if ($sheet > 0){
                        $this->createSheet();
                    }
                    $sheet = $this->setActiveSheetIndex($sheet);
                    if(!empty($cell['header'])){
                        foreach ($cell['header'] as $col => $header) {
                            $sheet->setCellValue($this->getColumn($col) . '1', $header);
                        }
                    }
                    foreach ($cell['items'] as $row => $items) {
                        foreach ($items as $col => $text) {
                            $record = (($row + 1) + 1);
                            $sheet->setCellValue($this->getColumn($col).$record, $text);
                        }
                    }
                    $this->getActiveSheet()->setTitle(!empty($cell['title']) ? $cell['title'] : "Sheet");
                }
            }
        }

    }

    public function Output($obj = array(), $file = null, $format = 'S'){
        $newGetFile = $this->getFile($file);
        if (!empty($newGetFile)) {
            $writer = PHPExcel_IOFactory::createWriter($obj, $this->_type); // Excel2007 (xlsx), Excel5 (xls)
            if ($format == 'S') {
                $writer->save($this->_path);
                if ($this->_extension == 'xlsx') {
                    header("Content-type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet; charset=utf-8");
                } else {
                    header("Content-type: application/vnd.ms-excel; charset=utf-8");
                }
                header("Content-Disposition: attachment; filename=" . $this->_filename . "." . $this->_extension);
                readfile($this->_path);
            } else if ($format == 'D') {
                if ($this->_extension == 'xlsx') {
                    header("Content-type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet; charset=utf-8");
                } else {
                    header("Content-type: application/vnd.ms-excel; charset=utf-8");
                }
                header("Content-Disposition: attachment; filename=" . $this->_filename . "." . $this->_extension);
                $writer->save('php://output');
            } else if ($format == 'L') {
                $writer->save($this->_path);
                return '
Download Files: _url . '" target="_blank">' . $this->_url . '
';
            }
        }
    }

    private function getColumn($col){
        $level = 0; // A
        if ( $col <= 25 ) {
            return $this->_cells[$col];
        }
        if ( $col > 25 && $col <= 50) {
            $col = $col - 26;
            return $this->_cells[$level] . $this->_cells[$col];
        }
    }

    private function getFile($file = nul){
        $rootDir = Yii::getAlias('@webroot') . '/';
        $files = explode('/', $file);
        $current = (count($files)-1);
        if (!empty($files[$current])) {
            list($this->_filename, $this->_extension) = explode('.', $files[$current]);
            $this->_type = $this->_types[$this->_extension];
            $this->_path = $rootDir . $file;
            $this->_url = Yii::$app->urlManager->createAbsoluteUrl('/') . $file;
            return true;
        }
        return false;
    }

}


text:
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace MyWorkSpace.Web.Areas.Dashbord.Controllers
{
    [Authorize(Policy = "baseAuth")]
    [Area("Dashbord")]
    public class DefaultController : Controller
    {
        // GET: Dashbord/Home
        public IActionResult Index()
        {
            return View();
        }

        public IActionResult Table()
        {
            return View();
        }

        public IActionResult Form()
        {
            return View();
        }

        public IActionResult PanelsAndWells()
        {
            return View();
        }

        public IActionResult Buttons()
        {
            return View();
        }

        public IActionResult Notifications()
        {
            return View();
        }

        public IActionResult Typography()
        {
            return View();
        }

        public IActionResult Icons()
        {
            return View();
        }

        public ActionResult Grid()
        {
            return View();
        }
    }
}


text:
package com.lee.main.image;

import android.os.Bundle;
import android.widget.ImageView;

import com.lee.base.activity.BaseActivity;
import com.lee.main.R;
import com.lee.main.image.reflection.ReflectionImage;

/**
 * Reflection Image Activity
 * </p>
 * Created by LiYang on 2017/1/15.
 */

public class ReflectionImageActivity extends BaseActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_reflection_image);

        ImageView reflect = (ImageView)findViewById(R.id.iv_reflect_image);
        reflect.setImageBitmap(ReflectionImage.createReflectedImage(this, R.drawable.ic_view_pager_1));
    }

}


text:
#include "setPainterColorBlock.h"

#include "trikKit/robotModel/parts/trikDisplay.h"

using namespace trik::blocks::details;

SetPainterColorBlock::SetPainterColorBlock(kitBase::robotModel::RobotModelInterface &robotModel)
: kitBase::blocksBase::common::DisplayBlock(robotModel)
{
}

void SetPainterColorBlock::doJob(kitBase::robotModel::robotParts::Display &display)
{
	auto trikDisplay = static_cast<robotModel::parts::TrikDisplay *>(&display);
	trikDisplay->setPainterColor(propertyToColor(stringProperty("Color")));
	emit done(mNextBlockId);
}


text:
package org.ansj.library.dao.entity;

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

public class UserWordExample {
    protected String orderByClause;

    protected boolean distinct;

    protected List<Criteria> oredCriteria;

    public UserWordExample() {
        oredCriteria = new ArrayList<Criteria>();
    }

    public void setOrderByClause(String orderByClause) {
        this.orderByClause = orderByClause;
    }

    public String getOrderByClause() {
        return orderByClause;
    }

    public void setDistinct(boolean distinct) {
        this.distinct = distinct;
    }

    public boolean isDistinct() {
        return distinct;
    }

    public List<Criteria> getOredCriteria() {
        return oredCriteria;
    }

    public void or(Criteria criteria) {
        oredCriteria.add(criteria);
    }

    public Criteria or() {
        Criteria criteria = createCriteriaInternal();
        oredCriteria.add(criteria);
        return criteria;
    }

    public Criteria createCriteria() {
        Criteria criteria = createCriteriaInternal();
        if (oredCriteria.size() == 0) {
            oredCriteria.add(criteria);
        }
        return criteria;
    }

    protected Criteria createCriteriaInternal() {
        Criteria criteria = new Criteria();
        return criteria;
    }

    public void clear() {
        oredCriteria.clear();
        orderByClause = null;
        distinct = false;
    }

    protected abstract static class GeneratedCriteria {
        protected List<Criterion> criteria;

        protected GeneratedCriteria() {
            super();
            criteria = new ArrayList<Criterion>();
        }

        public boolean isValid() {
            return criteria.size() > 0;
        }

        public List<Criterion> getAllCriteria() {
            return criteria;
        }

        public List<Criterion> getCriteria() {
            return criteria;
        }

        protected void addCriterion(String condition) {
            if (condition == null) {
                throw new RuntimeException("Value for condition cannot be null");
            }
            criteria.add(new Criterion(condition));
        }

        protected void addCriterion(String condition, Object value, String property) {
            if (value == null) {
                throw new RuntimeException("Value for " + property + " cannot be null");
            }
            criteria.add(new Criterion(condition, value));
        }

        protected void addCriterion(String condition, Object value1, Object value2, String property) {
            if (value1 == null || value2 == null) {
                throw new RuntimeException("Between values for " + property + " cannot be null");
            }
            criteria.add(new Criterion(condition, value1, value2));
        }

        public Criteria andIdPkIsNull() {
            addCriterion("id_pk is null");
            return (Criteria) this;
        }

        public Criteria andIdPkIsNotNull() {
            addCriterion("id_pk is not null");
            return (Criteria) this;
        }

        public Criteria andIdPkEqualTo(Long value) {
            addCriterion("id_pk =", value, "idPk");
            return (Criteria) this;
        }

        public Criteria andIdPkNotEqualTo(Long value) {
            addCriterion("id_pk <>", value, "idPk");
            return (Criteria) this;
        }

        public Criteria andIdPkGreaterThan(Long value) {
            addCriterion("id_pk >", value, "idPk");
            return (Criteria) this;
        }

        public Criteria andIdPkGreaterThanOrEqualTo(Long value) {
            addCriterion("id_pk >=", value, "idPk");
            return (Criteria) this;
        }

        public Criteria andIdPkLessThan(Long value) {
            addCriterion("id_pk <", value, "idPk");
            return (Criteria) this;
        }

        public Criteria andIdPkLessThanOrEqualTo(Long value) {
            addCriterion("id_pk <=", value, "idPk");
            return (Criteria) this;
        }

        public Criteria andIdPkIn(List<Long> values) {
            addCriterion("id_pk in", values, "idPk");
            return (Criteria) this;
        }

        public Criteria andIdPkNotIn(List<Long> values) {
            addCriterion("id_pk not in", values, "idPk");
            return (Criteria) this;
        }

        public Criteria andIdPkBetween(Long value1, Long value2) {
            addCriterion("id_pk between", value1, value2, "idPk");
            return (Criteria) this;
        }

        public Criteria andIdPkNotBetween(Long value1, Long value2) {
            addCriterion("id_pk not between", value1, value2, "idPk");
            return (Criteria) this;
        }

        public Criteria andKeywordIsNull() {
            addCriterion("keyword is null");
            return (Criteria) this;
        }

        public Criteria andKeywordIsNotNull() {
            addCriterion("keyword is not null");
            return (Criteria) this;
        }

        public Criteria andKeywordEqualTo(String value) {
            addCriterion("keyword =", value, "keyword");
            return (Criteria) this;
        }

        public Criteria andKeywordNotEqualTo(String value) {
            addCriterion("keyword <>", value, "keyword");
            return (Criteria) this;
        }

        public Criteria andKeywordGreaterThan(String value) {
            addCriterion("keyword >", value, "keyword");
            return (Criteria) this;
        }

        public Criteria andKeywordGreaterThanOrEqualTo(String value) {
            addCriterion("keyword >=", value, "keyword");
            return (Criteria) this;
        }

        public Criteria andKeywordLessThan(String value) {
            addCriterion("keyword <", value, "keyword");
            return (Criteria) this;
        }

        public Criteria andKeywordLessThanOrEqualTo(String value) {
            addCriterion("keyword <=", value, "keyword");
            return (Criteria) this;
        }

        public Criteria andKeywordLike(String value) {
            addCriterion("keyword like", value, "keyword");
            return (Criteria) this;
        }

        public Criteria andKeywordNotLike(String value) {
            addCriterion("keyword not like", value, "keyword");
            return (Criteria) this;
        }

        public Criteria andKeywordIn(List<String> values) {
            addCriterion("keyword in", values, "keyword");
            return (Criteria) this;
        }

        public Criteria andKeywordNotIn(List<String> values) {
            addCriterion("keyword not in", values, "keyword");
            return (Criteria) this;
        }

        public Criteria andKeywordBetween(String value1, String value2) {
            addCriterion("keyword between", value1, value2, "keyword");
            return (Criteria) this;
        }

        public Criteria andKeywordNotBetween(String value1, String value2) {
            addCriterion("keyword not between", value1, value2, "keyword");
            return (Criteria) this;
        }

        public Criteria andSpeechIsNull() {
            addCriterion("speech is null");
            return (Criteria) this;
        }

        public Criteria andSpeechIsNotNull() {
            addCriterion("speech is not null");
            return (Criteria) this;
        }

        public Criteria andSpeechEqualTo(String value) {
            addCriterion("speech =", value, "speech");
            return (Criteria) this;
        }

        public Criteria andSpeechNotEqualTo(String value) {
            addCriterion("speech <>", value, "speech");
            return (Criteria) this;
        }

        public Criteria andSpeechGreaterThan(String value) {
            addCriterion("speech >", value, "speech");
            return (Criteria) this;
        }

        public Criteria andSpeechGreaterThanOrEqualTo(String value) {
            addCriterion("speech >=", value, "speech");
            return (Criteria) this;
        }

        public Criteria andSpeechLessThan(String value) {
            addCriterion("speech <", value, "speech");
            return (Criteria) this;
        }

        public Criteria andSpeechLessThanOrEqualTo(String value) {
            addCriterion("speech <=", value, "speech");
            return (Criteria) this;
        }

        public Criteria andSpeechLike(String value) {
            addCriterion("speech like", value, "speech");
            return (Criteria) this;
        }

        public Criteria andSpeechNotLike(String value) {
            addCriterion("speech not like", value, "speech");
            return (Criteria) this;
        }

        public Criteria andSpeechIn(List<String> values) {
            addCriterion("speech in", values, "speech");
            return (Criteria) this;
        }

        public Criteria andSpeechNotIn(List<String> values) {
            addCriterion("speech not in", values, "speech");
            return (Criteria) this;
        }

        public Criteria andSpeechBetween(String value1, String value2) {
            addCriterion("speech between", value1, value2, "speech");
            return (Criteria) this;
        }

        public Criteria andSpeechNotBetween(String value1, String value2) {
            addCriterion("speech not between", value1, value2, "speech");
            return (Criteria) this;
        }

        public Criteria andWordFrequencyIsNull() {
            addCriterion("word_frequency is null");
            return (Criteria) this;
        }

        public Criteria andWordFrequencyIsNotNull() {
            addCriterion("word_frequency is not null");
            return (Criteria) this;
        }

        public Criteria andWordFrequencyEqualTo(Integer value) {
            addCriterion("word_frequency =", value, "wordFrequency");
            return (Criteria) this;
        }

        public Criteria andWordFrequencyNotEqualTo(Integer value) {
            addCriterion("word_frequency <>", value, "wordFrequency");
            return (Criteria) this;
        }

        public Criteria andWordFrequencyGreaterThan(Integer value) {
            addCriterion("word_frequency >", value, "wordFrequency");
            return (Criteria) this;
        }

        public Criteria andWordFrequencyGreaterThanOrEqualTo(Integer value) {
            addCriterion("word_frequency >=", value, "wordFrequency");
            return (Criteria) this;
        }

        public Criteria andWordFrequencyLessThan(Integer value) {
            addCriterion("word_frequency <", value, "wordFrequency");
            return (Criteria) this;
        }

        public Criteria andWordFrequencyLessThanOrEqualTo(Integer value) {
            addCriterion("word_frequency <=", value, "wordFrequency");
            return (Criteria) this;
        }

        public Criteria andWordFrequencyIn(List<Integer> values) {
            addCriterion("word_frequency in", values, "wordFrequency");
            return (Criteria) this;
        }

        public Criteria andWordFrequencyNotIn(List<Integer> values) {
            addCriterion("word_frequency not in", values, "wordFrequency");
            return (Criteria) this;
        }

        public Criteria andWordFrequencyBetween(Integer value1, Integer value2) {
            addCriterion("word_frequency between", value1, value2, "wordFrequency");
            return (Criteria) this;
        }

        public Criteria andWordFrequencyNotBetween(Integer value1, Integer value2) {
            addCriterion("word_frequency not between", value1, value2, "wordFrequency");
            return (Criteria) this;
        }

        public Criteria andStateIsNull() {
            addCriterion("state is null");
            return (Criteria) this;
        }

        public Criteria andStateIsNotNull() {
            addCriterion("state is not null");
            return (Criteria) this;
        }

        public Criteria andStateEqualTo(Integer value) {
            addCriterion("state =", value, "state");
            return (Criteria) this;
        }

        public Criteria andStateNotEqualTo(Integer value) {
            addCriterion("state <>", value, "state");
            return (Criteria) this;
        }

        public Criteria andStateGreaterThan(Integer value) {
            addCriterion("state >", value, "state");
            return (Criteria) this;
        }

        public Criteria andStateGreaterThanOrEqualTo(Integer value) {
            addCriterion("state >=", value, "state");
            return (Criteria) this;
        }

        public Criteria andStateLessThan(Integer value) {
            addCriterion("state <", value, "state");
            return (Criteria) this;
        }

        public Criteria andStateLessThanOrEqualTo(Integer value) {
            addCriterion("state <=", value, "state");
            return (Criteria) this;
        }

        public Criteria andStateIn(List<Integer> values) {
            addCriterion("state in", values, "state");
            return (Criteria) this;
        }

        public Criteria andStateNotIn(List<Integer> values) {
            addCriterion("state not in", values, "state");
            return (Criteria) this;
        }

        public Criteria andStateBetween(Integer value1, Integer value2) {
            addCriterion("state between", value1, value2, "state");
            return (Criteria) this;
        }

        public Criteria andStateNotBetween(Integer value1, Integer value2) {
            addCriterion("state not between", value1, value2, "state");
            return (Criteria) this;
        }
    }

    public static class Criteria extends GeneratedCriteria {

        protected Criteria() {
            super();
        }
    }

    public static class Criterion {
        private String condition;

        private Object value;

        private Object secondValue;

        private boolean noValue;

        private boolean singleValue;

        private boolean betweenValue;

        private boolean listValue;

        private String typeHandler;

        public String getCondition() {
            return condition;
        }

        public Object getValue() {
            return value;
        }

        public Object getSecondValue() {
            return secondValue;
        }

        public boolean isNoValue() {
            return noValue;
        }

        public boolean isSingleValue() {
            return singleValue;
        }

        public boolean isBetweenValue() {
            return betweenValue;
        }

        public boolean isListValue() {
            return listValue;
        }

        public String getTypeHandler() {
            return typeHandler;
        }

        protected Criterion(String condition) {
            super();
            this.condition = condition;
            this.typeHandler = null;
            this.noValue = true;
        }

        protected Criterion(String condition, Object value, String typeHandler) {
            super();
            this.condition = condition;
            this.value = value;
            this.typeHandler = typeHandler;
            if (value instanceof List<?>) {
                this.listValue = true;
            } else {
                this.singleValue = true;
            }
        }

        protected Criterion(String condition, Object value) {
            this(condition, value, null);
        }

        protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
            super();
            this.condition = condition;
            this.value = value;
            this.secondValue = secondValue;
            this.typeHandler = typeHandler;
            this.betweenValue = true;
        }

        protected Criterion(String condition, Object value, Object secondValue) {
            this(condition, value, secondValue, null);
        }
    }
}


text:
package com.google.enterprise.secmgr.saml;

import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.util.XMLObjectSupport;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
import org.w3c.dom.Element;

/** A marshaller (object to XML converter) for {@link GsaAuthz}. */
final class GsaAuthzMarshaller extends AbstractSAMLObjectMarshaller {
  @Override
  protected void marshallAttributes(XMLObject xmlObject, Element domElement) {
    GsaAuthz object = (GsaAuthz) xmlObject;
    XMLObjectSupport.marshallAttribute(
        GsaAuthz.VERSION_ATTRIB_NAME, Integer.toString(object.getVersion()), domElement, false);
    if (object.getMode() != null) {
      XMLObjectSupport.marshallAttribute(
          GsaAuthz.MODE_ATTRIB_NAME, object.getMode().toString(), domElement, false);
    }
  }
}


text:
import os, sys, pprint

from django.core.management.base import BaseCommand, CommandError
from optparse import make_option
from django.conf import settings

PROJECT_NAME = settings.SETTINGS_MODULE.split('.')[0]

class Command(BaseCommand):
    requires_model_validation = False
    option_list = BaseCommand.option_list + (
        make_option('--only',
                    default=False,
                    dest="only",
                    action="store_true",
                    help="only print out the named parameters, don't include the defaults"),
        make_option('--all',
                    default=False,
                    dest="all",
                    action="store_true",
                    help="Print out all configuration parameters")    )
    help = ("Print out the configuration options")

    def handle(self, *args, **options):

        result = 0
        if options["only"]:
            display_params = []
        elif options["all"]:
            display_params = dir(settings)
        else:
            display_params = ["DEFAULT_FROM_EMAIL", "EMAIL_BACKEND",
                              "EMAIL_HOST", "EMAIL_SUBJECT_PREFIX",
                              "SESSION_COOKIE_SECURE", "DATABASES"]
        for arg in args:
            if arg not in display_params:
                display_params.append(arg)

        print "DJANGO_SETTINGS_MODULE=%s" % os.environ["DJANGO_SETTINGS_MODULE"]
        print "="*50

        display_params.sort()
        for param in display_params:
            try:
                print "%s: %s" % (param,
                                  pprint.pformat(getattr(settings, param)))
            except AttributeError:
                print "%s: was not found in settings" % param
                result = 1

        return result


text:
Built-in crawlers
=================

This framework contains 6 built-in image crawlers.

-  Google
-  Bing
-  Baidu
-  Flickr
-  General greedy crawl (crawl all the images from a website)
-  UrlList (crawl all images given an url list)

Search engine crawlers
----------------------

The search engine crawlers (Google, Bing, Baidu) have universal APIs.
Here is an example of how to use the built-in crawlers.

.. code:: python

    from icrawler.builtin import BaiduImageCrawler, BingImageCrawler, GoogleImageCrawler

    google_crawler = GoogleImageCrawler(
        feeder_threads=1,
        parser_threads=1,
        downloader_threads=4,
        storage={'root_dir': 'your_image_dir'})
    filters = dict(
        size='large',
        color='orange',
        license='commercial,modify',
        date=((2017, 1, 1), (2017, 11, 30)))
    google_crawler.crawl(keyword='cat', filters=filters, offset=0, max_num=1000,
                         min_size=(200,200), max_size=None, file_idx_offset=0)

    bing_crawler = BingImageCrawler(downloader_threads=4,
                                    storage={'root_dir': 'your_image_dir'})
    bing_crawler.crawl(keyword='cat', filters=None, offset=0, max_num=1000)

    baidu_crawler = BaiduImageCrawler(storage={'root_dir': 'your_image_dir'})
    baidu_crawler.crawl(keyword='cat', offset=0, max_num=1000,
                        min_size=(200,200), max_size=None)

The filter options provided by Google, Bing and Baidu are different.
Supported filter options and possible values are listed below.

GoogleImageCrawler:

- ``type`` -- "photo", "face", "clipart", "linedrawing", "animated".
- ``color`` -- "color", "blackandwhite", "transparent", "red", "orange", "yellow", "green", "teal", "blue", "purple", "pink", "white", "gray", "black", "brown".
- ``size`` -- "large", "medium", "icon", or larger than a given size (e.g. ">640x480"), or exactly is a given size ("=1024x768").
- ``license`` -- "noncommercial"(labeled for noncommercial reuse), "commercial"(labeled for reuse), "noncommercial,modify"(labeled for noncommercial reuse with modification), "commercial,modify"(labeled for reuse with modification).
- ``date`` -- "pastday", "pastweek" or a tuple of dates, e.g. ``((2016, 1, 1), (2017, 1, 1))`` or ``((2016, 1, 1), None)``.

BingImageCrawler:

- ``type`` -- "photo", "clipart", "linedrawing", "transparent", "animated".
- ``color`` -- "color", "blackandwhite", "red", "orange", "yellow", "green", "teal", "blue", "purple", "pink", "white", "gray", "black", "brown"
- ``size`` -- "large", "medium", "small" or larger than a given size (e.g. ">640x480").
- ``license`` -- "creativecommons", "publicdomain", "noncommercial", "commercial", "noncommercial,modify", "commercial,modify".
- ``layout`` -- "square", "wide", "tall".
- ``people`` -- "face", "portrait".
- ``date`` -- "pastday", "pastweek", "pastmonth", "pastyear".

BaiduImageCrawler:

- ``type``: "portrait", "face", "clipart", "linedrawing", "animated", "static"
- ``color``: "red", "orange", "yellow", "green", "purple", "pink", "teal", "blue", "brown", "white", "black", "blackandwhite".

When using ``GoogleImageCrawler``, language can be specified via the argument ``language``, e.g.,
``google_crawler.crawl(keyword='cat', language="us")``.

.. note::

    Tips: Search engines will limit the number of returned images, even when we use a browser
    to view the result page. The limitation is usually 1000 for many search engines such as google and bing. To crawl more than 1000 images with a single keyword, we can specify different date ranges.

    .. code:: python

        google_crawler.crawl(
            keyword='cat',
            filters={'date': ((2016, 1, 1), (2016, 6, 30))},
            max_num=1000,
            file_idx_offset=0)
        google_crawler.crawl(
            keyword='cat',
            filters={'date': ((2016, 6, 30), (2016, 12, 31))},
            max_num=1000,
            file_idx_offset='auto')
        # set `file_idx_offset` to "auto" so that filenames can be consecutive numbers (e.g., 1001 ~ 2000)

Flickr crawler
--------------

.. code:: python

    from datetime import date
    from icrawler.builtin import FlickrImageCrawler

    flickr_crawler = FlickrImageCrawler('your_apikey',
                                        storage={'root_dir': 'your_image_dir'})
    flickr_crawler.crawl(max_num=1000, tags='child,baby',
                         group_id='68012010@N00', min_upload_date=date(2015, 5, 1))

Supported optional searching arguments are listed in
https://www.flickr.com/services/api/flickr.photos.search.html.
Here are some examples.

-  ``user_id`` -- The NSID of the user who's photo to search.
-  ``tags`` -- A comma-delimited list of tags.
-  ``tag_mode`` -- Either "any" for an OR combination of tags, or "all"
   for an AND combination.
-  ``text`` -- A free text search. Photos who's title, description or
   tags contain the text will be returned.
-  ``min_upload_date`` -- Minimum upload date. The date can be in the
   form of ``datetime.date`` object, an unix timestamp or a string.
-  ``max_upload_date`` -- Maximum upload date. Same form as
   ``min_upload_date``.
-  ``group_id`` -- The id of a group who's pool to search.
-  ``extras`` -- A comma-delimited list of extra information to fetch
   for each returned record. See
   `here <https://www.flickr.com/services/api/flickr.photos.search.html>`__
   for more details.
-  ``per_page`` -- Number of photos to return per page.

Some advanced searching arguments, which are not updated in the `Flickr  API
<https://www.flickr.com/services/api/flickr.photos.search.html>`__,
are also supported. Valid arguments and values are shown as follows.

-  ``color_codes`` -- A comma-delimited list of color codes, which filters the
   results by your chosen color(s). Please see any Flickr search page for the
   corresponding relations between the colors and the codes.
-  ``styles`` -- A comma-delimited list of styles, including ``blackandwhite``,
   ``depthoffield``, ``minimalism`` and ``pattern``.
-  ``orientation`` -- A comma-delimited list of image orientation. It can be
   ``landscape``, ``portrait``, ``square`` and ``panorama``. The default
   includes all of them.

Another parameter ``size_preference`` is available for Flickr crawler, it define
the preferred order of image sizes. Valid values are shown as follows.

- original
- large 2048: 2048 on longest side†
- large 1600: 1600 on longest side†
- large: 1024 on longest side*
- medium 800: 800 on longest side†
- medium 640: 640 on longest side
- medium: 500 on longest side
- small 320: 320 on longest side
- small: 240 on longest side
- thumbnail: 100 on longest side
- large square: 150x150
- square: 75x75

``size_preference`` can be either a list or a string, if not specified, all
sizes are acceptable and larger sizes are prior to smaller ones.

.. note::

    \* Before May 25th 2010 large photos only exist for very large original images.
    † Medium 800, large 1600, and large 2048 photos only exist after March 1st 2012.

Greedy crawler
--------------

If you just want to crawl all the images from some website, then
``GreedyImageCrawler`` may be helpful.

.. code:: python

    from icrawler.builtin import GreedyImageCrawler

    greedy_crawler = GreedyImageCrawler(storage={'root_dir': 'your_image_dir'})
    greedy_crawler.crawl(domains='http://www.bbc.com/news', max_num=0,
                         min_size=None, max_size=None)

The argument ``domains`` can be either an url string or list.

URL list crawler
----------------

If you have already got an image url list somehow and want to download all
images using multiple threads, then ``UrlListCrawler`` may be helpful.

.. code:: python

    from icrawler.builtin import UrlListCrawler

    urllist_crawler = UrlListCrawler(downloader_threads=4,
                                     storage={'root_dir': 'your_image_dir'})
    urllist_crawler.crawl('url_list.txt')

You can see the complete example in *test.py*, to run it

::

    python test.py [options]

``options`` can be ``google``, ``bing`` , ``baidu``, ``flickr``,
``greedy``, ``urllist`` or ``all``, using ``all`` by default if no arguments are
specified. Note that you have to provide your flickr apikey if you want
to test FlickrCrawler.


text:
/*eslint-env node*/

//------------------------------------------------------------------------------
// node.js starter application for Bluemix
//------------------------------------------------------------------------------

// This application uses express as its web server
// for more info, see: http://expressjs.com
var express = require('express');

// This application uses body-parser middleware
var bodyParser = require('body-parser');

// cfenv provides access to your Cloud Foundry environment
// for more info, see: https://www.npmjs.com/package/cfenv
var cfenv = require('cfenv');

// This is used to make HTTP requests with nodejs
var request = require('request');

// This is used for File Operations
var fs = require('fs');

// create a new express server
var app = express();

// serve the files out of ./public as our main files
app.use(express.static(__dirname + '/public'));

// View Engine
app.set('view engine', 'ejs');
app.set('views', __dirname + '/views');

// Body Parser Middleware
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({extended: false}));

// get the app environment from Cloud Foundry
var appEnv = cfenv.getAppEnv();

// Global Variables
var username = null;
var password = null;
var sernum = null;
var	usermessage = '';

// Renders and Redirects
app.get('/',function(req, res){
	res.render('index', {
		message: usermessage
	});
	username = null;
	password = null;
	usermessage = '';
});

app.post('/',function(req, res){
	if (req.body.username=="" || req.body.password=="") {
		usermessage='Please enter both Username and Password';
		res.render('index', {
			message: usermessage
		});
		username = null;
		password = null;
		usermessage = '';
	} else {
		username = req.body.username;
		password = req.body.password;
		request.get('https://www.httpwatch.com/httpgallery/authentication/authenticatedimage/default.aspx',
			{ 'auth': {
		    			'user': username,
		    			'pass': password,
		    			'sendImmediately': false
		    		}
			}, function(error, response, body){
		    	if(error || response.statusCode != 200) {
				usermessage='Your credentials are incorrect or You are not authorized';
				res.render('index', {
					message: usermessage
				});
				username = null;
				password = null;
				usermessage = '';
		    	} else {
		    		res.render('app',{
					jsonData: null,
					message: usermessage,
					sernum: sernum,
					jsonFile: null
		});
		    }
		});
	}
});

app.post('/app',function(req, res){
	if (req.body.sernum=="") {
		usermessage='Please enter serial number';
		res.render('app', {
			jsonData: null,
			message: usermessage,
			sernum: null,
			jsonFile: null
		});
		usermessage = '';
	} else {
		sernum = req.body.sernum;
		request.get('https://learnwebcode.github.io/json-example/animals-' + sernum + '.json',
			{ 'auth': {
		    			'user': username,
		    			'pass': password,
		    			'sendImmediately': false
		    		}
			}, function(error, response, body){
		    	if(error || response.statusCode != 200) {
				usermessage='Something went wrong while accessing api - ';
				req.body.sernum = '';
				res.render('index', {
					message: usermessage + error
				});
				username = null;
				password = null;
				usermessage = '';
		    	} else {
			    		try{
			    		fileContents = fs.readFileSync("./public/files/myfile.json");
			    		if(fileContents == "")
			    		{
			    		var jsonFile = { records: [] };
			    		}
			    		else
			    		{
			    		jsonFile = JSON.parse(fileContents);
			    		}
			    		if(req.body.btn == "submit")
			    		{
			    		jsonData = JSON.parse(body);
			    		newname = jsonData[0].name;
			    		newspecies = jsonData[0].species;
			    		jsonFile.records.push({name: newname, species: newspecies});
			    		usermessage = newname + " added to the list !";
			    	    }
			    	    if(req.body.btn == "delete")
			    	    {
			    	      delflag = false;
			    	      for(i=0;i<jsonFile.records.length;i++){
                                 if(req.body[i] == "on") {
			    	      	        jsonFile.records.splice(i,1);
			    	      	        delflag = true;
			    	      	       }
			    	      }
			    	      if(delflag)
			    	      	usermessage = 'Record(s) deleted successfully !'
			    	      else
			    	      	usermessage = 'Nothing selected for deletion !'
			    	    }
			    	    if(req.body.btn == "update")
			    	    {
			    	      updflag = false;
			    	      for(i=0;i<jsonFile.records.length;i++){
                                 if(req.body[i] == "on") {
			    	      	        jsonFile.records[i].species = 'dog';
			    	      	        updflag = true;
			    	      	       }
			    	      }
			    	      if(updflag)
			    	      	usermessage = 'Record(s) updated successfully !'
			    	      else
			    	      	usermessage = 'Nothing selected for update !'
			    	    }
			    		fs.writeFileSync("./public/files/myfile.json",JSON.stringify(jsonFile), null, 2);
			    		res.render('app', {
			    			jsonData: JSON.parse(body),
			    			message: usermessage,
			    			sernum: sernum,
			    			jsonFile: JSON.parse(fs.readFileSync("./public/files/myfile.json")),
			    		});} catch(error){
			    		usermessage='Something went wrong while parsing response. '
			    		res.render('app', {
			    			jsonData: null,
			    			sernum: sernum,
							message: usermessage + error,
							jsonFile: null
						});
						username = null;
						password = null;
						usermessage = '';
						jsonFile = null;
			    		}
		    }
		});
	}
});

app.get('/raw',function(req, res){
	res.set('Content-Type', 'application/json');
	res.send(fs.readFileSync("./public/files/myfile.json"));
});

// start server on the specified port and binding host
app.listen(appEnv.port, '0.0.0.0', function() {
  // print a message when the server starts listening
  console.log("server starting on " + appEnv.url);
});


text:
<?php

use LittleNinja\Lib\Router;

setlocale(LC_ALL, 'bg_BG');
date_default_timezone_set('Europe/Sofia');

require __DIR__ . '/../vendor/autoload.php';
include_once '../config/app.php';
include_once '../config/db.php';
include_once '../config/messages.php';

Router::router();
$dotenv = new Dotenv\Dotenv(__DIR__);
$dotenv->load();


text:
package com.intellij.react.css.modules;

import com.google.common.collect.Lists;
import com.intellij.codeInsight.completion.CompletionType;
import com.intellij.testFramework.LightProjectDescriptor;
import com.intellij.testFramework.fixtures.LightCodeInsightFixtureTestCase;
import com.intellij.usageView.UsageInfo;
import org.jetbrains.annotations.NotNull;
import org.junit.Test;

import java.util.List;

public class CssModulesCodeInsightTest extends LightCodeInsightFixtureTestCase {

    @Override
    public void setUp() throws Exception {
        super.setUp();
        myFixture.copyFileToProject("Component.css");
        myFixture.copyFileToProject("ComponentFindUsages.jsx");
        myFixture.copyFileToProject("react.d.ts");
        myFixture.copyFileToProject("tsconfig.json");
    }

    @Override
    protected String getTestDataPath() {
        return "test-resources/testData";
    }

    @NotNull
    @Override
    protected LightProjectDescriptor getProjectDescriptor() {
        return super.getProjectDescriptor();
    }

    // ---- completion ----

    @Test
    public void testCompletionComponent() {
        doTestCompletion("Component.jsx", Lists.newArrayList("error", "normal", "north"));
    }

    @Test
    public void testCompletionComponentEs6Import() {
        doTestCompletion("ComponentEs6Import.jsx", Lists.newArrayList("error", "normal", "north"));
    }

    @Test
    public void testCompletionComponentEs6ImportStyleName() {
        doTestCompletion("ComponentEs6ImportStyleName.jsx", Lists.newArrayList("error", "normal", "north"));
    }

    @Test
    public void testCompletionComponentNor() {
        doTestCompletion("ComponentNor.jsx", Lists.newArrayList("normal", "north"));
    }

    @Test
    public void testCompletionComponentNormalErr() {
        doTestCompletion("ComponentNormalErr.jsx", null); // single match completion shows as null
    }

    @Test
    public void testCompletionComponentStringLiteral() {
        doTestCompletion("ComponentStringLiteral.jsx", Lists.newArrayList("error", "normal", "north"));
    }

    @Test
    public void testCompletionComponentStringLiteralNor() {
        doTestCompletion("ComponentStringLiteralNor.jsx", Lists.newArrayList("normal", "north"));
    }

    @Test
    public void testCompletionComponentTypeScript() {
        doTestCompletion("ComponentTypeScript.tsx", Lists.newArrayList("error", "normal", "north"));
    }

    @Test
    public void testCompletionComponentTypeScriptStringLiteral() {
        doTestCompletion("ComponentTypeScriptStringLiteral.tsx", Lists.newArrayList("normal", "north"));
    }

    @Test
    public void testCompletionComposesClassName() {
        doTestCompletion("CompletionComposesClassName.css", Lists.newArrayList("normal", "north"));
    }

    @Test
    public void testCompletionComposesClassNameMultiple() {
        doTestCompletion("CompletionComposesClassNameMultiple.css", Lists.newArrayList("north"));
    }

    @Test
    public void testCompletionComposesClassNameSemiColon() {
        doTestCompletion("CompletionComposesClassNameSemiColon.css", Lists.newArrayList("normal", "north"));
    }

    @Test
    public void testCompletionComposesProperty() {
        doTestCompletion("CompletionComposesProperty.css", Lists.newArrayList("composes", "mask-composite", "-webkit-background-composite", "-webkit-mask-composite"));
    }

    private void doTestCompletion(String sourceFile, List<String> expectedCompletions) {
        myFixture.configureByFiles(sourceFile);
        myFixture.complete(CompletionType.BASIC, 1);
        final List<String> completions = myFixture.getLookupElementStrings();
        assertEquals("Wrong completions", expectedCompletions, completions);
    }

    // ---- error highlighting -----

    @Test
    public void testCssAnnotations() {
        myFixture.configureByFiles("Annotations.css");
        myFixture.checkHighlighting(true, false, true);
    }

    @Test
    public void testComponentAnnotations() {
        myFixture.configureByFiles("ComponentAnnotations.jsx");
        myFixture.checkHighlighting(false, false, false);
    }

    @Test
    public void testComponentTypeScriptAnnotations() {
        myFixture.configureByFiles("ComponentTypeScriptAnnotations.tsx");
        myFixture.checkHighlighting(false, false, false);
    }

    // --- PSI references (find usages etc.) ---

    @Test
    public void testComponentFindUsages() {
        final List<UsageInfo> usageInfos = Lists.newArrayList(myFixture.testFindUsages("ComponentFindUsages.css"));
        assertEquals(3, usageInfos.size()); // 2 from this plugin, one is self reference
    }

}


text:
set -e

printf "Running tests without coverage ...\n\n"

(cd test \
  && make)

./build/test/test_result

make clean


text:
{% load i18n %}

    {% blocktrans %}
    Dear {{ name }},
    {% endblocktrans %}

    {% blocktrans %}
    This email is a receipt for your payment of {{ amount }} toward Invoice No.
    {{ invoice_num }} for your project {{ project }}.
    {% endblocktrans %}

{% if is_paid %}

    {% blocktrans %}
    This invoice is now marked as paid as of {{ date_paid }}.
    {% endblocktrans %}

{% trans 'Invoice No.' %}: {{ invoice_num }}

{% trans 'Amount Paid' %}: {{ amount }}

{% trans 'Payment Date' %}: {{ date_paid }}

{% trans 'Transaction No.' %}: {{ transaction_id }}

{% else %}

{% trans 'Invoice No.' %}: {{ invoice_num }}

{% trans 'Amount Paid' %}: {{ amount }}

{% trans 'Payment Date' %}: {{ date_paid }}

{% trans 'Transaction No.' %}: {{ transaction_id }}

{% trans 'Remaining Balance' %}: {{ balance }}

{% trans 'Date Due' %}: {{ date_due }}

{% endif %}

    {% blocktrans %}
    Thank you for using CommCare. If you have any questions, please don't
    hesitate to contact {{ invoicing_contact_email }}.
    {% endblocktrans %}

    {% blocktrans %}
    Best Regards,

    The CommCare HQ Team

    www.commcarehq.org
    {% endblocktrans %}

    {% blocktrans %}
    Email From:

    CommCare HQ and the corporation Dimagi, Inc.

    585 Massachusetts Ave, Ste 4, Cambridge, MA 02139 USA
    {% endblocktrans %}


text:
extern crate wtftw;

use self::wtftw::config::GeneralConfig;
use self::wtftw::core::stack::Stack;
use self::wtftw::layout::Layout;
use self::wtftw::layout::LayoutMessage;
use self::wtftw::window_system::Rectangle;
use self::wtftw::window_system::Window;
use self::wtftw::window_system::WindowSystem;

pub struct WithBordersLayout {
    border: u32,
    layout: Box<dyn Layout>,
}

impl WithBordersLayout {
    pub fn boxed_new(border: u32, layout: Box<dyn Layout>) -> Box<dyn Layout> {
        Box::new(WithBordersLayout {
            border,
            layout: layout.copy(),
        })
    }
}

impl Layout for WithBordersLayout {
    fn apply_layout(
        &mut self,
        window_system: &dyn WindowSystem,
        screen: Rectangle,
        config: &GeneralConfig,
        stack: &Option<Stack<Window>>,
    ) -> Vec<(Window, Rectangle)> {
        if let Some(ref s) = *stack {
            for window in s.integrate().into_iter() {
                window_system.set_window_border_width(window, self.border);
            }
        }
        self.layout
            .apply_layout(window_system, screen, config, stack)
    }

    fn apply_message(
        &mut self,
        message: LayoutMessage,
        window_system: &dyn WindowSystem,
        stack: &Option<Stack<Window>>,
        config: &GeneralConfig,
    ) -> bool {
        self.layout
            .apply_message(message, window_system, stack, config)
    }

    fn description(&self) -> String {
        self.layout.description()
    }

    fn copy(&self) -> Box<dyn Layout> {
        Box::new(WithBordersLayout {
            border: self.border,
            layout: self.layout.copy(),
        })
    }

    fn unhook(
        &self,
        window_system: &dyn WindowSystem,
        stack: &Option<Stack<Window>>,
        config: &GeneralConfig,
    ) {
        if let Some(ref s) = *stack {
            for window in s.integrate().into_iter() {
                window_system.set_window_border_width(window, config.border_width);
                let Rectangle(_, _, w, h) = window_system.get_geometry(window);
                window_system.resize_window(
                    window,
                    w + 2 * config.border_width,
                    h + 2 * config.border_width,
                );
            }
        }
    }
}


text:
<?php

namespace App\CrnBundle\Form;

use Doctrine\Common\Collections\ArrayCollection;
use App\OrderformBundle\Form\CustomType\ScanCustomSelectorType;
use App\UserdirectoryBundle\Form\CustomType\CustomSelectorType;
use App\UserdirectoryBundle\Form\FormNode\FormNodeType;
use App\UserdirectoryBundle\Form\InstitutionType;
use App\UserdirectoryBundle\Form\FormNode\MessageCategoryFormNodeType;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\CollectionType;
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Form\FormEvents;
use Symfony\Component\Form\FormEvent;
use Doctrine\ORM\EntityRepository;

//This form type is used strictly only for scan order: message (message) form has scan order
//This form includes patient hierarchy form.
//Originally it was made the way that message has scanorder.
//All other order's form should have aggregated message type form: order form has message form.
class CrnAccessionDummyType extends AbstractType
{

    protected $entity;
    protected $params;

//    public function __construct( $type = null, $service = null, $entity = null )
    //params: type: single or clinical, educational, research
    //params: cycle: new, edit, show
    //params: service: pathology service
    //params: entity: entity itself
    public function formConstructor( $params=null, $entity=null )
    {
        if( $params ) $this->params = $params;
        if( $entity ) $this->entity = $entity;

        if( !array_key_exists('type', $this->params) ) {
            $this->params['type'] = 'Unknown Order';
        }
    }

    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $this->formConstructor($options['form_custom_value'],$options['form_custom_value_entity']);

        //showAccession
        //As not-mapped accession type and number
        $builder->add( 'accessionType', EntityType::class, array(
            'class' => 'AppOrderformBundle:AccessionType',
            //'choice_label' => 'name',
            'label' => 'Accession Type:',
            'required' => false,
            'multiple' => false,
            'mapped' => false,
            //'data' => $this->params['defaultAccessionType'],
            'attr' => array('class' => 'combobox combobox-width accessiontype-combobox skip-server-populate accessiontype'),
            'query_builder' => function(EntityRepository $er) {
                return $er->createQueryBuilder('list')
                    ->where("list.type = :typedef OR list.type = :typeadd")
                    ->orderBy("list.orderinlist","ASC")
                    ->setParameters( array(
                        'typedef' => 'default',
                        'typeadd' => 'user-added',
                    ));
            },
        ));

        $builder->add('accessionNumber', null, array(
            'label' => 'Accession Number:',
            'required' => false,
            'mapped' => false,
            'attr' => array('class' => 'form-control keyfield accession-mask')
        ));

    }

    public function configureOptions(OptionsResolver $resolver)
    {
        $resolver->setDefaults(array(
            'data_class' => 'App\OrderformBundle\Entity\Accession',
            'form_custom_value' => null,
            'form_custom_value_entity' => null
        ));
    }

    public function getBlockPrefix(): string
    {
        return 'oleg_crnformbundle_accessiontype';
    }

}


text:
.views_slideshow_cycle_no_display,
.views_slideshow_cycle_hidden,
.views_slideshow_cycle_controls,
.views_slideshow_cycle_image_count {
  display: none;
}

/* Pager Settings */

.views_slideshow_cycle_pager div a img {
  width: 75px;
  height: 75px;
}

.views_slideshow_pager_numbered div,
.views_slideshow_pager_thumbnails div {
  display: inline;
  padding-left: 10px;
}

.views_slideshow_cycle_pager.thumbnails a.activeSlide img {
  border: 3px solid #000;
}

.views_slideshow_cycle_pager.numbered a.activeSlide {
  text-decoration: underline;
}


text:
import tinys3
import os
import click
from subprocess import check_call, check_output
from string import Template
import shutil

@click.command()
@click.option('--aws-access-key-id', prompt='AWS ACCESS KEY ID',
              envvar='AWS_ACCESS_KEY_ID')
@click.option('--aws-secret-access-key', prompt='AWS SECRET ACCESS KEY',
              hide_input=True, envvar='AWS_SECRET_ACCESS_KEY')
@click.option('-v', '--version', prompt='New version please(ex 1.0.4)')
@click.option('-n', '--dry-run', is_flag=True, default=False)
@click.option('--local-test', is_flag=True, default=False)
@click.option('-m', '--changelog', prompt='Write changelog')
@click.option('--email', prompt='Write your email(used in changelog)')
@click.option('--name', prompt='Write your name(used in changelog)')
@click.option('--gpg-keyname', prompt='Write gpg key name(used in signing dpkg)')
@click.option('--ssh-keypath', prompt='SSH private key path(used in connecting to apt repository')
def distribute(aws_access_key_id, aws_secret_access_key,
               version, dry_run, local_test,
               changelog, email, name,
               gpg_keyname, ssh_keypath):
    context = {
        'access_key': aws_access_key_id,
        'secret_key': aws_secret_access_key,
        'version': version,
        'dry_run': dry_run,
        'local_test': local_test,
        'changelog': changelog,
        'email': email,
        'name': name,
        'gpg_keyname': gpg_keyname,
        'ssh_keypath': ssh_keypath
    }

    do_move_to_temp_dir(context)
    do_create_git_tag(context)
    do_update_latest_file(context)

    do_update_brew_executable_file(context)
    do_update_homebrew(context)

    do_update_debian_dir(context)
    do_build_linux_executable_file(context)
    do_make_dpkg(context)
    do_publish_dpkg(context)

def do_move_to_temp_dir(context):
    tmp_dir = 'tmp-distribute'
    shutil.rmtree(tmp_dir, ignore_errors=True)
    os.mkdir(tmp_dir)
    os.chdir(tmp_dir)

def do_create_git_tag(context):
    create_git_tag(context)
    push_git_tag(context)

def do_update_latest_file(context):
    update_version_file(context)
    upload_latest(context)

def do_update_brew_executable_file(context):
    build_macOS_go(context)
    compress_executable(context)
    sha256 = create_sha256(context)
    context['sha256'] = sha256
    upload_executable(context)

def do_update_homebrew(context):
    clone_homebrew(context)
    if not context['dry_run']:
        os.chdir('homebrew-kodebox')
    update_homebrew_version_sha256(context)
    push_homebrew(context)
    if not context['dry_run']:
        os.chdir('..')

def do_update_debian_dir(context):
    copy_debian_dir(context)
    update_change_log(context)

def do_build_linux_executable_file(context):
    build_linux_go(context)

def do_make_dpkg(context):
    command = 'debuild -b -k' + context['gpg_keyname']
    print ''
    print 'run debuild using gpg key ' + context['gpg_keyname']
    if not context['dry_run']:
        os.chdir('kodebox-' + context['version'])
        check_output(command.split(' '))
        os.chdir('..')

def do_publish_dpkg(context):
    ssh_keypath = context['ssh_keypath']
    src_file = 'kodebox_' + context['version'] + '_amd64.deb'
    host = 'ubuntu@dl.kodebox.io'
    dest = host + ':~/'

    remote_command = 'cd debian && reprepro --ask-passphrase -Vb . includedeb stable ~/' + src_file

    print ''
    print 'upload dpkg file'
    if not context['dry_run'] and not context['local_test']:
        check_call([
            'scp', '-i', ssh_keypath, src_file, dest
        ])

        check_call([
            'ssh', '-i', ssh_keypath, host, remote_command
        ])

def create_git_tag(context):
    tag_name = 'v' + context['version']
    print ''
    print 'Creating git tag ' + tag_name
    if not context['dry_run']:
        check_call(['git', 'tag', tag_name])

def push_git_tag(context):
    print ''
    print 'Pushing tags'
    if not context['dry_run'] and not context['local_test']:
        check_call(['git', 'push', 'origin', 'master'])
        check_call(['git', 'push', '--tags'])

def update_version_file(context):
    template = Template(
        '{"version":"$version","downloadUrl":"https://kodebox.io/cli/install", "test": 1}')
    latest_content = template.substitute(version=context['version'])
    print ''
    print 'Write to latest.json :'
    print latest_content
    if not context['dry_run']:
        write_to_file('latest.json', latest_content)

def upload_latest(context):
    bucket_name = 'kodebox-cli'
    upload_file_name = 'latest'
    print ''
    print 'Upload latest.json to ' + bucket_name + '/' + upload_file_name
    if not context['dry_run'] and not context['local_test']:
        conn = tinys3.Connection(context['access_key'], context['secret_key'])
        latest_file = open('latest.json', 'rb')
        conn.upload(upload_file_name, latest_file,
                    bucket=bucket_name, close=True)

def build_macOS_go(context):
    print ''
    print 'running go build'
    if not context['dry_run']:
        check_call([
            'env', 'GOOS=darwin', 'GOARCH=amd64',
            'go', 'build', '-o', 'kodebox',
            '-ldflags', '-X main.Version=' + context['version'],
            '..'])

def build_linux_go(context):
    print ''
    print 'running go build'
    if not context['dry_run']:
        check_call([
            'env', 'GOOS=linux', 'GOARCH=amd64',
            'go', 'build', '-o', 'kodebox',
            '-ldflags', '-X main.Version=' + context['version'],
            '..'])
        shutil.copy2('kodebox', 'kodebox-' + context['version'])

def compress_executable(context):
    print ''
    print 'compress executable to ' + get_compressed_filename(context)
    if not context['dry_run']:
        check_call(
            ['tar', '-cvzf', get_compressed_filename(context), 'kodebox'])

def create_sha256(context):
    print ''
    compressed_filename = get_compressed_filename(context)
    print 'create sha256 of compressed file ' + compressed_filename
    if not context['dry_run']:
        shasum_out = check_output(
            ['shasum', '-a', '256', compressed_filename])
        return shasum_out.split(' ')[0]
    else:
        return ''

def upload_executable(context):
    bucket_name = 'kodebox-cli'
    upload_file_name = get_compressed_filename(context)
    print ''
    print 'Upload compressed file to ' + bucket_name + '/' + upload_file_name
    if not context['dry_run'] and not context['local_test']:
        conn = tinys3.Connection(context['access_key'], context['secret_key'])
        latest_file = open(get_compressed_filename(context), 'rb')
        conn.upload(upload_file_name, latest_file,
                    bucket=bucket_name, close=True)

def get_compressed_filename(context):
    return 'kodebox-macOS-{version}.tar.gz'.format(version=context['version'])

def clone_homebrew(context):
    print ''
    print 'clone homebrew repo'
    if not context['dry_run']:
        check_call(
            ['git', 'clone', 'git@github.com:kodebox-io/homebrew-kodebox.git'])

def update_homebrew_version_sha256(context):
    template = Template('''
require "language/go"

class Kodebox < Formula
  desc "Tool for snippet upload"
  homepage "https://kodebox.io"
  url "https://s3-us-west-1.amazonaws.com/kodebox-cli/$compressed_file_name"
  sha256 "$sha256"

  bottle :unneeded

  def install
    bin.install "kodebox"
  end

  test do
    system "#{bin}/kodebox", "-v"
  end
end
''')
    new_formula = template.substitute(compressed_file_name=get_compressed_filename(context),
                                      sha256=context['sha256'])

    print ''
    print 'new formula file will be'
    print '=========FORMULA========='
    print new_formula
    print '=========FORMULA========='
    if not context['dry_run']:
        write_to_file('Formula/kodebox.rb', new_formula)

def push_homebrew(context):
    commit_msg = 'Release ' + context['version']
    print ''
    print 'homebrew commit : ' + commit_msg
    print 'push homebrew repo '
    if not context['dry_run']:
        check_call(['git', 'commit', '-a', '-m', commit_msg])
        if not context['local_test']:
            check_call(['git', 'push', 'origin', 'master'])

def copy_debian_dir(context):
    print ''
    print 'Copying debian dir'
    if not context['dry_run']:
        debian_pkg_dir = 'kodebox-' + context['version']
        shutil.rmtree(debian_pkg_dir, ignore_errors=True)
        os.mkdir(debian_pkg_dir)
        shutil.copytree('../distribute/debian', debian_pkg_dir + '/debian')

def update_change_log(context):
    command_template = Template(
        'env\tEMAIL=$email\tNAME=$name\tdebchange\t-v\t$version\t$changelog')
    command = command_template.substitute(**context)
    print ''
    print 'Run changelog command ' + command
    if not context['dry_run']:
        os.chdir('kodebox-' + context['version'])
        check_call(command.split('\t'))
        os.chdir('..')

def write_to_file(file_name, content):
    file_ = open(file_name, 'w')
    file_.write(content)
    file_.close()

if __name__ == '__main__':
    distribute()


text:
#include "sdcardfs.h"
#include "linux/ctype.h"

/*
 * returns: -ERRNO if error (returned to user)
 *          0: tell VFS to invalidate dentry
 *          1: dentry is valid
 */
static int sdcardfs_d_revalidate(struct dentry *dentry, unsigned int flags)
{
	int err = 1;
	struct path parent_lower_path, lower_path;
	struct dentry *parent_dentry = NULL;
	struct dentry *parent_lower_dentry = NULL;
	struct dentry *lower_cur_parent_dentry = NULL;
	struct dentry *lower_dentry = NULL;

	if (flags & LOOKUP_RCU)
		return -ECHILD;

	spin_lock(&dentry->d_lock);
	if (IS_ROOT(dentry)) {
		spin_unlock(&dentry->d_lock);
		return 1;
	}
	spin_unlock(&dentry->d_lock);

	/* check uninitialized obb_dentry and
	 * whether the base obbpath has been changed or not */
	if (is_obbpath_invalid(dentry)) {
		d_drop(dentry);
		return 0;
	}

	parent_dentry = dget_parent(dentry);
	sdcardfs_get_lower_path(parent_dentry, &parent_lower_path);
	sdcardfs_get_real_lower(dentry, &lower_path);
	parent_lower_dentry = parent_lower_path.dentry;
	lower_dentry = lower_path.dentry;
	lower_cur_parent_dentry = dget_parent(lower_dentry);

	spin_lock(&lower_dentry->d_lock);
	if (d_unhashed(lower_dentry)) {
		spin_unlock(&lower_dentry->d_lock);
		d_drop(dentry);
		err = 0;
		goto out;
	}
	spin_unlock(&lower_dentry->d_lock);

	if (parent_lower_dentry != lower_cur_parent_dentry) {
		d_drop(dentry);
		err = 0;
		goto out;
	}

	if (dentry < lower_dentry) {
		spin_lock(&dentry->d_lock);
		spin_lock(&lower_dentry->d_lock);
	} else {
		spin_lock(&lower_dentry->d_lock);
		spin_lock(&dentry->d_lock);
	}

	if (dentry->d_name.len != lower_dentry->d_name.len) {
		__d_drop(dentry);
		err = 0;
	} else if (strncasecmp(dentry->d_name.name, lower_dentry->d_name.name,
				dentry->d_name.len) != 0) {
		__d_drop(dentry);
		err = 0;
	}

	if (dentry < lower_dentry) {
		spin_unlock(&lower_dentry->d_lock);
		spin_unlock(&dentry->d_lock);
	} else {
		spin_unlock(&dentry->d_lock);
		spin_unlock(&lower_dentry->d_lock);
	}

out:
	dput(parent_dentry);
	dput(lower_cur_parent_dentry);
	sdcardfs_put_lower_path(parent_dentry, &parent_lower_path);
	sdcardfs_put_real_lower(dentry, &lower_path);
	return err;
}

static void sdcardfs_d_release(struct dentry *dentry)
{
	/* release and reset the lower paths */
	if(has_graft_path(dentry)) {
		sdcardfs_put_reset_orig_path(dentry);
	}
	sdcardfs_put_reset_lower_path(dentry);
	free_dentry_private_data(dentry);
	return;
}

static int sdcardfs_hash_ci(const struct dentry *dentry,
				const struct inode *inode, struct qstr *qstr)
{
	/*
	 * This function is copy of vfat_hashi.
	 * FIXME Should we support national language?
	 *       Refer to vfat_hashi()
	 * struct nls_table *t = MSDOS_SB(dentry->d_sb)->nls_io;
	 */
	const unsigned char *name;
	unsigned int len;
	unsigned long hash;

	name = qstr->name;
	//len = vfat_striptail_len(qstr);
	len = qstr->len;

	hash = init_name_hash();
	while (len--)
		//hash = partial_name_hash(nls_tolower(t, *name++), hash);
		hash = partial_name_hash(tolower(*name++), hash);
	qstr->hash = end_name_hash(hash);

	return 0;
}

/*
 * Case insensitive compare of two vfat names.
 */
static int sdcardfs_cmp_ci(const struct dentry *parent,
		const struct inode *pinode,
		const struct dentry *dentry, const struct inode *inode,
		unsigned int len, const char *str, const struct qstr *name)
{
	/* This function is copy of vfat_cmpi */
	// FIXME Should we support national language?
	//struct nls_table *t = MSDOS_SB(parent->d_sb)->nls_io;
	//unsigned int alen, blen;

	/* A filename cannot end in '.' or we treat it like it has none */
	/*
	alen = vfat_striptail_len(name);
	blen = __vfat_striptail_len(len, str);
	if (alen == blen) {
		if (nls_strnicmp(t, name->name, str, alen) == 0)
			return 0;
	}
	*/
	if (name->len == len) {
		if (strncasecmp(name->name, str, len) == 0)
			return 0;
	}
	return 1;
}

const struct dentry_operations sdcardfs_ci_dops = {
	.d_revalidate	= sdcardfs_d_revalidate,
	.d_release	= sdcardfs_d_release,
	.d_hash 	= sdcardfs_hash_ci,
	.d_compare	= sdcardfs_cmp_ci,
};


text:
package characteristic

const TypeTunneledAccessoryStateNumber = "58"

type TunneledAccessoryStateNumber struct {
	*Float
}

func NewTunneledAccessoryStateNumber() *TunneledAccessoryStateNumber {
	char := NewFloat(TypeTunneledAccessoryStateNumber)
	char.Format = FormatFloat
	char.Perms = []string{PermRead, PermEvents}

	char.SetValue(0)

	return &TunneledAccessoryStateNumber{char}
}


text:
package com.treasure_data.td_import.integration;

import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Map;

import org.junit.Ignore;
import org.msgpack.value.Value;
import org.msgpack.value.ValueFactory;

@Ignore
public class SyslogFileGenerator extends FileGenerator {
    private final SimpleDateFormat dateFormat = new SimpleDateFormat("MMM dd HH:mm:ss");

    static Value HOST_VALUE = ValueFactory.newString("host");
    static Value IDENT_VALUE = ValueFactory.newString("ident");
    static Value MESSAGE_VALUE = ValueFactory.newString("message");
    static Value PID_VALUE = ValueFactory.newString("pid");

    protected static final String SPACE = " ";
    protected static final String LF = "\n";

    //"time", "host", "ident", "pid", "message"

    public SyslogFileGenerator(String fileName, String[] header)
            throws IOException {
        super(fileName, header);
    }

    @Override
    public void writeHeader() throws IOException {
        // non header
    }

    @Override
    public void write(Map<String, Object> map) throws IOException {
        StringBuilder sbuf = new StringBuilder();

        sbuf.append(dateFormat.format(new Date(((Long) map.get("time")) * 1000))).append(SPACE);
        sbuf.append(map.get("string_value")).append(SPACE);
        sbuf.append(map.get("string_value")).append("(").append(map.get("string_value")).append(")");
        sbuf.append("[").append(map.get("int_value")).append("]");
        sbuf.append(":").append(SPACE).append(map.get("string_value"));

        out.write(sbuf.toString().getBytes());
        out.write(LF.getBytes());
    }

    @Override
    public void close() throws IOException {
        super.close();
    }
}


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

Choose Google Fonts

        <form>

            <input type="text" class="form-control" placeholder="Filter" ng-model="filterText.family">

        </form>

              Name
              Version

              {{ font.family }}
              {{ font.version }}

                <button class="btn btn-xs btn-default"
                        ng-click="selectFont(font)"
                        ng-hide="isFontSelected(font)">

                </button>
                <button class="btn btn-xs btn-default"
                        ng-click="deselectFont(font)"
                        ng-show="isFontSelected(font)">

                </button>

        <button type="button" class="btn btn-default" ng-click="close()">Cancel</button>
        <button type="button" class="btn btn-primary" ng-click="addToComparison()">
          Compare {{ selectedFonts.length }}
        </button>


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

<title>Content and Child Filters in jQuery</title>

First List Item

Second List Item

Third List Item

Fourth List Item

First Paragraph <p class="normal">

Second Paragraph with id="mainPara"

Third Paragraph <p class="special">

Fourth Paragraph


text:
editAreaLoader.lang["de"]={
new_document: "Neues Dokument",
search_button: "Suchen und Ersetzen",
search_command: "Weitersuchen / öffne Suchfeld",
search: "Suchen",
replace: "Ersetzen",
replace_command: "Ersetzen / öffne Suchfeld",
find_next: "Weitersuchen",
replace_all: "Ersetze alle Treffer",
reg_exp: "reguläre Ausdrücke",
match_case: "passt auf den Begriff<br />",
not_found: "Nicht gefunden.",
occurrence_replaced: "Die Vorkommen wurden ersetzt.",
search_field_empty: "Leeres Suchfeld",
restart_search_at_begin: "Ende des zu durchsuchenden Bereiches erreicht. Es wird die Suche von Anfang an fortgesetzt.", //find a shorter translation
move_popup: "Suchfenster bewegen",
font_size: "--Schriftgröße--",
go_to_line: "Gehe zu Zeile",
go_to_line_prompt: "Gehe zu Zeilennummmer:",
undo: "Rückgängig",
redo: "Wiederherstellen",
change_smooth_selection: "Aktiviere/Deaktiviere einige Features (weniger Bildschirmnutzung aber mehr CPU-Belastung)",
highlight: "Syntax Highlighting an- und ausschalten",
reset_highlight: "Highlighting zurücksetzen (falls mit Text nicht konform)",
word_wrap: "Toggle word wrapping mode",
help: "Info",
save: "Speichern",
load: "Öffnen",
line_abbr: "Ln",
char_abbr: "Ch",
position: "Position",
total: "Gesamt",
close_popup: "Popup schließen",
shortcuts: "Shortcuts",
add_tab: "Tab zum Text hinzufügen",
remove_tab: "Tab aus Text entfernen",
about_notice: "Bemerkung: Syntax Highlighting ist nur für kurze Texte",
toggle: "Editor an- und ausschalten",
accesskey: "Accesskey",
tab: "Tab",
shift: "Shift",
ctrl: "Ctrl",
esc: "Esc",
processing: "In Bearbeitung...",
fullscreen: "Full-Screen",
syntax_selection: "--Syntax--",
close_tab: "Close file"
};


text:
package com.parse.unimelb.Helper;

import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothServerSocket;
import android.bluetooth.BluetoothSocket;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Environment;
import android.util.Log;
import android.widget.Toast;
import com.parse.unimelb.HomeActivity;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.ObjectInputStream;
import java.io.OutputStream;
import java.util.UUID;

/**
 * Created by Rahul on 10/10/2015.
 * This class provides a server thread for users who are receiving image from other users
 */
public class ServerThread extends Thread {

    private final BluetoothServerSocket myServSocket;
    BluetoothAdapter mBluetoothAdapter;
    UUID MY_UUID;
    public Bitmap receivedBitmap = null;
    SerialBitmap serialBitmap;
    private HomeActivity activity;

    // Sets the instance variables including the UUID for transmission.
    public ServerThread(BluetoothAdapter adapter, UUID uuid, HomeActivity activity) {
        mBluetoothAdapter = adapter;
        MY_UUID = uuid;
        BluetoothServerSocket tmp = null;
        this.activity = activity;

        // Sets up the RfcommnSocket which acts as a normal socket used in TCP connections using java.
        try {
            tmp = mBluetoothAdapter.listenUsingRfcommWithServiceRecord("myServer", MY_UUID);
        } catch (Exception e) {
            Log.e("Bluetooth", "Server establishing failed");
        }
        // Set the BluetoothServeer socket to enable us to accept incoming connections in the thread.
        myServSocket = tmp;
    }

    public void run() {
        Log.e("Bluetooth", "Begin waiting for connection");
        BluetoothSocket connectSocket = null;
        InputStream inStream = null;
        OutputStream outStream = null;
        String line = "";
        int byteNo;

        while(true) {
            try {
                // this is a blocking call which waits till it gets a connection from a client.
                connectSocket = myServSocket.accept();
                inStream = connectSocket.getInputStream();

                // Once a connection has been achieved, it stops discovery for new devices.
                mBluetoothAdapter.cancelDiscovery();

                // The image is trasnferred after conversion into an object. Hence we require
                // ObjectOutputStream for receiving the data.
                ObjectInputStream objInStream = new ObjectInputStream(inStream);
                Object received = null;

                // This will continuously accept the incoming data from the client.

                try {
                    // The object is received from the client.
                    received = objInStream.readObject();

                    // The data received is cast into the appropriate format, namely: SerialBitmap as
                    // the Bitmap object is not directly Serializable.
                    SerialBitmap receivedSerialBitmap = (SerialBitmap) received;
                    receivedBitmap = BitmapFactory.decodeByteArray(receivedSerialBitmap.blob, 0, receivedSerialBitmap.blob.length);

                    // This runs another thread to refresh the UI after getting the image from the client.
                    activity.runOnUiThread(new Runnable() {
                        @Override
                        public void run() {
//                            activity.imageview.setImageBitmap(receivedBitmap);
//                            activity.imageview.refreshDrawableState();
                            BitmapStore.setReceivedBitmap(receivedBitmap);

                            File storagePath = new File(Environment.getExternalStorageDirectory()
                                    + "/DCIM/100ANDRO/");
                            storagePath.mkdirs();

                            File myImage = new File(storagePath, Long.toString(System.currentTimeMillis()) + ".jpg");
                            try {
                                FileOutputStream out = new FileOutputStream(myImage);
                                receivedBitmap.compress(Bitmap.CompressFormat.JPEG, 40, out);

                                out.flush();
                                out.close();
                            } catch(FileNotFoundException e) {
                                Log.d("In Saving File", e + "");
                            } catch(IOException e) {
                                Log.d("In Saving File", e + "");
                            }

                            BluetoothImageTempStore.bits.add(myImage.getPath());
                            Toast.makeText(activity, "You have received a photo, please refresh", Toast.LENGTH_LONG).show();
                        }
                    });
                    Log.e("Bluetooth", "Received Something");
                } catch (Exception e) {
                    e.printStackTrace();
                }
            } catch (Exception e) {
                Log.e("Bluetooth", "Connection Failed");
            }
        }
    }
}


text:
EasyAjaxCommunicator
====================

Mit diesem kleines Plugin ist es möglich einfach von der HTML seite aus
eine Funktion in der Ziel PHP aufzurufen.

In PHP Datei:
```php
// Klasse laden
require_once('class/EasyAjaxCom.class.php');

// Diese Funktion wird über den Client aufgerufen
function helloWorld($eins,$zwei,$drei) {

    echo 'Hello WORLD';
    print_r( $eins);
    echo $zwei;
    echo $drei;
}

//Klasse erzeugen
$EasyAjax = new EasyAjaxCom();

// 'helloWorld' Functions Name der Klasse bekannt  machen
$EasyAjax->regFunction('helloWorld');
```

In der HTML Datei:
```javascript
// XMLHttpRequest erzeugen
  var ajax = new XMLHttpRequest();

// Zurückgeben Daten in der Konsole ausgeben
  ajax.onloadend = function(e){
    console.log(this.response);
  };

// Funktionsname in der PHP die aufgerufen werden soll
  ajax.targetFunction = 'helloWorld';

// die übergeben Parametern der Funktion
  ajax.targetFunctionPara = [{1:'test'},'test','test'];

// Daten verschicken an Ziel Datei
  ajax.sendData("index.php");
```