text:
<?php

/**
 * politico actions.
 *
 * @package    Voota
 * @subpackage politico
 * @author     Sergio Viteri
 * @version    SVN: $Id: actions.class.php 12474 2008-10-31 10:41:27Z fabien $
 */
class fixInstitucionTask extends sfBaseTask
{
  protected function configure()
  {
    // // add your own arguments here
    // $this->addArguments(array(
    //   new sfCommandArgument('my_arg', sfCommandArgument::REQUIRED, 'My argument'),
    // ));

    $this->addOptions(array(
      new sfCommandOption('application', null, sfCommandOption::PARAMETER_REQUIRED, 'The application name', 'backend'),
      new sfCommandOption('env', null, sfCommandOption::PARAMETER_REQUIRED, 'The environment', 'dev'),
      new sfCommandOption('connection', null, sfCommandOption::PARAMETER_REQUIRED, 'The connection name', 'propel'),
      // add your own options here
    ));

    $this->namespace        = '';
    $this->name             = 'fixInstitucion';
    $this->briefDescription = '';
    $this->detailedDescription = <<<EOF
The [fixInstitucion|INFO] generates vanity urls for the specified tables (--table option).
Call it with:

  [php symfony fixInstitucion|INFO]
EOF;
  }

  protected function execute($arguments = array(), $options = array())
  {
      // initialize the database connection
    $databaseManager = new sfDatabaseManager($this->configuration);
    $connection = $databaseManager->getDatabase($options['connection'] ? $options['connection'] : null)->getConnection();

    $c = new Criteria();
    $instituciones = InstitucionPeer::doSelect( $c );
    foreach ($instituciones as $institucion){
    	if ( preg_match("/Ayuntamiento\-de\-/is", $institucion->getVanity('es')) || preg_match("/Ayuntamiento de /is", $institucion->getNombreCorto()) ){

    		echo "Setting vanity of  " . $institucion->getId() ." ";
    		echo " from  " . $institucion->getVanity('es') ." ";
    		echo " to  " . str_replace("-de-", "-", $institucion->getVanity('es')) .", ";
    		echo " nombre_corto from  " . $institucion->getNombreCorto('es') ." ";
    		$newNombreCorto = str_replace(" de ", " ", $institucion->getNombreCorto('es'));
    		$newNombreCorto = str_replace("  ", " ", $newNombreCorto);
    		$newNombreCorto = str_replace("  ", " ", $newNombreCorto);
    		echo " to  " . $newNombreCorto ." ...\n";

    		$institucion->setVanity( str_replace("Ayuntamiento-de-", "Ayuntamiento-", $institucion->getVanity('es')), 'es' );
    		$institucion->setNombreCorto( str_replace("Ayuntamiento de ", "Ayuntamiento ", $newNombreCorto), 'es' );
    		$institucion->save();
    		/*
    		$vanityUrl = SfVoUtil::encodeVanity($institucion->getNombreCorto()) ;

		    $c2 = new Criteria();
		    $c2->add(InstitucionPeer::VANITY, "$vanityUrl%", Criteria::LIKE);
		    $c2->add(InstitucionPeer::ID, $institucion->getId(), Criteria::NOT_EQUAL);
		    $institucionesLikeMe = InstitucionPeer::doSelect( $c2 );
		    $counter = 0;
    		foreach ($institucionesLikeMe as $institucionLikeMe){
    			$counter++;
    		}
    		InstitucionPeer::doUpdate( $institucion );
    		*/
    	}

    	//if ($institucion->getVanity('ca') == '' || $institucion->getVanity('ca') == null){
    		echo "creando ca en ". $institucion->getId() ."... \n";
    		$institucion->setVanity( str_replace("Ayuntamiento", "Ajuntament", $institucion->getVanity('es')), 'ca' );
    		$institucion->setNombreCorto( str_replace("Ayuntamiento ", "Ajuntament ", $institucion->getNombreCorto('es')), 'ca' );
    		$institucion->setNombre( str_replace("Ayuntamiento ", "Ajuntament ", $institucion->getNombre('es')), 'ca' );
    		$institucion->save();
    	//}
    }
  }

}


text:
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models

class Migration(SchemaMigration):

    def forwards(self, orm):

        # Deleting field 'PostWithSlideshow.single_post_width'
        db.delete_column('post_postwithslideshow', 'single_post_width')

        # Deleting field 'PostWithSlideshow.many_post_width'
        db.delete_column('post_postwithslideshow', 'many_post_width')

        # Deleting field 'PostWithSlideshow.single_post_height'
        db.delete_column('post_postwithslideshow', 'single_post_height')

        # Deleting field 'PostWithSlideshow.many_post_height'
        db.delete_column('post_postwithslideshow', 'many_post_height')

        # Adding field 'PostWithSlideshow.resize_contents'
        db.add_column('post_postwithslideshow', 'resize_contents', self.gf('django.db.models.fields.BooleanField')(default=False), keep_default=False)

        # Adding field 'PostWithSlideshow.delay'
        db.add_column('post_postwithslideshow', 'delay', self.gf('django.db.models.fields.PositiveIntegerField')(default=10000), keep_default=False)

        # Adding field 'PostWithSlideshow.animation_time'
        db.add_column('post_postwithslideshow', 'animation_time', self.gf('django.db.models.fields.PositiveIntegerField')(default=600), keep_default=False)

    def backwards(self, orm):

        # Adding field 'PostWithSlideshow.single_post_width'
        db.add_column('post_postwithslideshow', 'single_post_width', self.gf('django.db.models.fields.IntegerField')(default=0), keep_default=False)

        # Adding field 'PostWithSlideshow.many_post_width'
        db.add_column('post_postwithslideshow', 'many_post_width', self.gf('django.db.models.fields.IntegerField')(default=0), keep_default=False)

        # Adding field 'PostWithSlideshow.single_post_height'
        db.add_column('post_postwithslideshow', 'single_post_height', self.gf('django.db.models.fields.IntegerField')(default=0), keep_default=False)

        # Adding field 'PostWithSlideshow.many_post_height'
        db.add_column('post_postwithslideshow', 'many_post_height', self.gf('django.db.models.fields.IntegerField')(default=0), keep_default=False)

        # Deleting field 'PostWithSlideshow.resize_contents'
        db.delete_column('post_postwithslideshow', 'resize_contents')

        # Deleting field 'PostWithSlideshow.delay'
        db.delete_column('post_postwithslideshow', 'delay')

        # Deleting field 'PostWithSlideshow.animation_time'
        db.delete_column('post_postwithslideshow', 'animation_time')

    models = {
        'contenttypes.contenttype': {
            'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
            'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
        },
        'copyright.copyright': {
            'Meta': {'ordering': "['title']", 'object_name': 'Copyright'},
            'easy_text': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
            'html_text': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'legal_text': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
            'title': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
            'url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'})
        },
        'credit.credit': {
            'Meta': {'ordering': "['last_name']", 'object_name': 'Credit'},
            'first_names': ('django.db.models.fields.CharField', [], {'max_length': '200', 'blank': 'True'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'is_person': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
            'last_name': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
            'url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'})
        },
        'credit.orderedcredit': {
            'Meta': {'ordering': "['position']", 'unique_together': "(('credit', 'content_type', 'object_id'),)", 'object_name': 'OrderedCredit'},
            'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
            'credit': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['credit.Credit']"}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'object_id': ('django.db.models.fields.PositiveIntegerField', [], {}),
            'position': ('django.db.models.fields.PositiveIntegerField', [], {})
        },
        'gallery.gallery': {
            'Meta': {'ordering': "['-last_modified']", 'object_name': 'Gallery'},
            'copyright': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['copyright.Copyright']", 'null': 'True', 'blank': 'True'}),
            'date_added': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
            'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'images': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['gallery.Image']", 'null': 'True', 'through': "orm['gallery.OrderedImage']", 'blank': 'True'}),
            'last_modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
            'title': ('django.db.models.fields.CharField', [], {'max_length': '200'})
        },
        'gallery.image': {
            'Meta': {'ordering': "['-last_modified']", 'object_name': 'Image'},
            'caption': ('django.db.models.fields.CharField', [], {'max_length': '200', 'blank': 'True'}),
            'copyright': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['copyright.Copyright']", 'null': 'True', 'blank': 'True'}),
            'date_added': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
            'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
            'file': ('filebrowser.fields.FileBrowseField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'last_modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
            'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '50', 'db_index': 'True'}),
            'title': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
            'url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'})
        },
        'gallery.orderedimage': {
            'Meta': {'ordering': "['gallery', 'position']", 'unique_together': "(('gallery', 'image'),)", 'object_name': 'OrderedImage'},
            'gallery': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['gallery.Gallery']"}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'image': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['gallery.Image']"}),
            'position': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'})
        },
        'post.basicpost': {
            'Meta': {'ordering': "['-sticky', '-date_published']", 'unique_together': "(('slug', 'date_published'),)", 'object_name': 'BasicPost'},
            'allow_comments': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
            'body': ('enhancedtext.fields.EnhancedTextField', [], {'default': "'\\\\W'", 'blank': 'True'}),
            'copyright': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['copyright.Copyright']", 'null': 'True', 'blank': 'True'}),
            'date_added': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
            'date_published': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
            'homepage': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'introduction': ('enhancedtext.fields.EnhancedTextField', [], {'default': "'\\\\W'", 'blank': 'True'}),
            'last_modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
            'many_post_template': ('django.db.models.fields.CharField', [], {'max_length': '200', 'blank': 'True'}),
            'pullout_text': ('django.db.models.fields.CharField', [], {'max_length': '400', 'blank': 'True'}),
            'single_post_template': ('django.db.models.fields.CharField', [], {'max_length': '200', 'blank': 'True'}),
            'sites': ('django.db.models.fields.related.ManyToManyField', [], {'default': '1', 'to': "orm['sites.Site']", 'symmetrical': 'False'}),
            'slug': ('django.db.models.fields.SlugField', [], {'max_length': '50', 'db_index': 'True'}),
            'sticky': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'subtitle': ('django.db.models.fields.CharField', [], {'max_length': '200', 'blank': 'True'}),
            'teaser': ('enhancedtext.fields.EnhancedTextField', [], {'default': "'\\\\W'", 'blank': 'True'}),
            'title': ('django.db.models.fields.CharField', [], {'max_length': '200'})
        },
        'post.postwithembeddedobject': {
            'Meta': {'object_name': 'PostWithEmbeddedObject'},
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'many_post_embedded_html': ('enhancedtext.fields.EnhancedTextField', [], {'default': "'\\\\W'", 'blank': 'True'}),
            'single_post_embedded_html': ('enhancedtext.fields.EnhancedTextField', [], {'default': "'\\\\W'", 'blank': 'True'})
        },
        'post.postwithimage': {
            'Meta': {'ordering': "['-sticky', '-date_published']", 'object_name': 'PostWithImage', '_ormbases': ['post.BasicPost']},
            'basicpost_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['post.BasicPost']", 'unique': 'True', 'primary_key': 'True'}),
            'image': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['gallery.Image']", 'null': 'True', 'blank': 'True'}),
            'many_post_height': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
            'many_post_width': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
            'single_post_height': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
            'single_post_width': ('django.db.models.fields.IntegerField', [], {'default': '0'})
        },
        'post.postwithslideshow': {
            'Meta': {'ordering': "['-sticky', '-date_published']", 'object_name': 'PostWithSlideshow', '_ormbases': ['post.BasicPost']},
            'animation_time': ('django.db.models.fields.PositiveIntegerField', [], {'default': '600'}),
            'basicpost_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['post.BasicPost']", 'unique': 'True', 'primary_key': 'True'}),
            'delay': ('django.db.models.fields.PositiveIntegerField', [], {'default': '10000'}),
            'gallery': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['gallery.Gallery']", 'null': 'True', 'blank': 'True'}),
            'resize_contents': ('django.db.models.fields.BooleanField', [], {'default': 'False'})
        },
        'sites.site': {
            'Meta': {'ordering': "('domain',)", 'object_name': 'Site', 'db_table': "'django_site'"},
            'domain': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
        },
        'tagging.tag': {
            'Meta': {'ordering': "('name',)", 'object_name': 'Tag'},
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '50', 'db_index': 'True'})
        },
        'tagging.taggeditem': {
            'Meta': {'unique_together': "(('tag', 'content_type', 'object_id'),)", 'object_name': 'TaggedItem'},
            'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'object_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
            'tag': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'items'", 'to': "orm['tagging.Tag']"})
        }
    }

    complete_apps = ['post']

redpajama_set_name: RedPajamaGithub


text:
namespace boost { namespace process { namespace windows { namespace initializers {

class inherit_env : public initializer_base
{
public:
};

}}}}

#endif


text:
require 'spec_helper'

describe ActiveRestClient::Connection do
  before do
    @connection = ActiveRestClient::Connection.new("http://www.example.com")
  end

  after do
    ActiveRestClient::Base._reset_configuration!
    @connection.reconnect
  end

  it "should contain a Farday connection" do
    expect(@connection.session).to be_a_kind_of(Faraday::Connection)
  end

  it "should set the Base URL to be the one passed in" do
    expect(@connection.session.url_prefix.to_s).to eq("http://www.example.com/")
  end

  it "should set a user agent for the session" do
    expect(@connection.headers["User-Agent"]).to match(/^ActiveRestClient\/[0-9.]+$/)
  end

  it "should try to Keep-Alive session connections" do
    expect(@connection.headers["Connection"]).to match(/Keep-Alive/)
  end

  it "should pass a GET request through to Faraday" do
    stub_request(:get, "www.example.com/foo").to_return(body: "{result:true}")
    result = @connection.get("/foo")
    expect(result.body).to eq("{result:true}")
  end

  it "should pass a PUT request through to Faraday" do
    stub_request(:put, "www.example.com/foo").with(body: "body").to_return(body: "{result:true}")
    result = @connection.put("/foo", "body")
    expect(result.body).to eq("{result:true}")
  end

  it "should pass a POST request through to Faraday" do
    stub_request(:post, "www.example.com/foo").with(body: "body").to_return(body: "{result:true}")
    result = @connection.post("/foo", "body")
    expect(result.body).to eq("{result:true}")
  end

  it "should pass a DELETE request through to Faraday" do
    stub_request(:delete, "www.example.com/foo").to_return(body: "{result:true}")
    result = @connection.delete("/foo")
    expect(result.body).to eq("{result:true}")
  end

  describe "with default Faraday headers" do
    before do
      @default_headers = { "User-Agent" => "Custom" }

      ActiveRestClient::Base.faraday_config do |faraday|
        faraday.adapter ActiveRestClient::Base.adapter
        faraday.headers.update(@default_headers)
      end
      @connection.reconnect
    end

    it "should pass a GET request through to Faraday preserving headers" do
      stub_request(:get, "www.example.com/foo").
        with(:headers => @default_headers).
        to_return(body: "{result:true}")

      result = @connection.get("/foo")
      expect(result.body).to eq("{result:true}")
    end

    it "should pass a PUT request through to Faraday" do
      stub_request(:put, "www.example.com/foo").
        with(body: "body").
        to_return(body: "{result:true}", :headers => @default_headers)

      result = @connection.put("/foo", "body")
      expect(result.body).to eq("{result:true}")
    end

    it "should pass a POST request through to Faraday" do
      stub_request(:post, "www.example.com/foo").
        with(body: "body", :headers => @default_headers).
        to_return(body: "{result:true}")

      result = @connection.post("/foo", "body")
      expect(result.body).to eq("{result:true}")
    end

    it "should pass a DELETE request through to Faraday" do
      stub_request(:delete, "www.example.com/foo").
        with(:headers => @default_headers).
        to_return(body: "{result:true}")

      result = @connection.delete("/foo")
      expect(result.body).to eq("{result:true}")
    end
  end

  context 'with api auth signing requests' do
    before(:each) do
      # Need to still call this to load the api_auth library so tests work
      ActiveRestClient::Base.api_auth_credentials('id123', 'secret123')

      @options = {
        :api_auth => {
          :api_auth_access_id => 'id123',
          :api_auth_secret_key => 'secret123'
        }
      }

      @default_headers = {'Date' => 'Sat, 14 Mar 2015 15:13:24 GMT'}

      ActiveRestClient::Base.faraday_config do |faraday|
        faraday.adapter ActiveRestClient::Base.adapter
        faraday.headers.update(@default_headers)
      end
      @connection.reconnect
    end

    it 'should have an Authorization header' do
      stub_request(:get, "www.example.com/foo")
        .with(:headers => @default_headers)
        .to_return(body: "{result:true}")
      result = @connection.get("/foo", @options)
      expect(result.env.request_headers['Authorization']).to eq("APIAuth id123:PMWBThkB8vKbvUccHvoqu9G3eVk=")
    end

    it 'should have an Content-MD5 header' do
      stub_request(:put, "www.example.com/foo").
        with(body: "body", :headers => @default_headers).
        to_return(body: "{result:true}")

      result = @connection.put("/foo", "body", @options)
      expect(result.env.request_headers['Content-MD5']).to eq("hBotaJrYa9FhFEdFPCLG/A==")
    end
  end

  it "should retry once in the event of a connection failed" do
    stub_request(:get, "www.example.com/foo").to_raise(Faraday::Error::ConnectionFailed.new("Foo"))
    expect { @connection.get("/foo") }.to raise_error(ActiveRestClient::ConnectionFailedException)
  end

  it "should raise an exception on timeout" do
    stub_request(:get, "www.example.com/foo").to_timeout
    expect { @connection.get("/foo") }.to raise_error(ActiveRestClient::TimeoutException)
  end

  it "should raise an exception on timeout" do
    stub_request(:get, "www.example.com/foo").to_timeout
    begin
      @connection.get("foo")
      fail
    rescue ActiveRestClient::TimeoutException => timeout
      expect(timeout.message).to eq("Timed out getting http://www.example.com/foo")
    end
  end
end


text:
from pydojo import *
from actors.gobo import *
from actors.pyco import *
from actors.arrow import *

# CREATE GAME DISPLAY
screen(800, 600)

# setup()

pyco = Pyco('example_asset/characters/pyco1.png')
gobo = Gobo('example_asset/characters/gobo.png')
arrow = Arrow()

# MAIN LOOP
gameover = False
while not gameover:

    mainloop()


text:
package app.healthdiary.Helper;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

import app.healthdiary.Activities.WeeklyQ1Direct;

public class MyAlarmReceiver extends BroadcastReceiver {
    public MyAlarmReceiver() {
    }

    @Override
    public void onReceive(Context context, Intent intent) {
        // TODO: This method is called when the BroadcastReceiver is receiving
        // an Intent broadcast.
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        //intent.setClass(context, RandomMomentContacts.class);
        intent.setClass(context, WeeklyQ1Direct.class);
        intent.putExtra("notify", 1);
        context.startActivity(intent);
        //throw new UnsupportedOperationException("Not yet implemented");
    }
}


text:
#ifndef MAX_COMPILING_CONFIGURATION_PLATFORM_MACOS_HPP
#define MAX_COMPILING_CONFIGURATION_PLATFORM_MACOS_HPP

#define MAX_PLATFORM_MACOS

#if defined( __i386__ )
	#define MAX_32BIT_WORD_SIZE
	#define MAX_X86
	#define MAX_LITTLE_ENDIAN
#elif defined( __x86_64__ )
	#define MAX_64BIT_WORD_SIZE
	#define MAX_X86_64
	#define MAX_LITTLE_ENDIAN
#elif defined( __ppc__ )
	#define MAX_32BIT_WORD_SIZE
	#define MAX_PPC
	#define MAX_BIG_ENDIAN
#elif #defined( __ppc64__ )
	#define MAX_64BIT_WORD_SIZE
	#define MAX_PPC64
	#define MAX_BIG_ENDIAN
#else
	static_assert( false, "Unknown platform" );
#endif

#endif // #ifndef MAX_COMPILING_CONFIGURATION_PLATFORM_MACOS_HPP


text:
"""
Basic server tests.
"""

from __future__ import absolute_import, print_function

import re

# pylint: disable=unused-import
from .utils import server_url  # noqa: F401
# pylint: enable=unused-import
from ..unit.utils import execute_command

def test_server_is_pegasus(server_url):
    # pylint: disable=redefined-outer-name
    """
    Test that this WBEM server is OpenPegasus and that it provides the
    expected Interop namespace, and the namespaces and profiles we want to test
    against.

    This container-packaged version of OpenPegasus is provided by the
    OpenPegasus project on GitHub (https://github.com/OpenPegasus/OpenPegasus).
    It includes OpenPegasus 2.14.2, the CIM Schema version 2.41.0, and a number
    of providers including a namespace provider.
    """

    # Check the server brand
    rc, stdout, stderr = execute_command(
        'pywbemcli',
        ['-s', server_url, '--no-verify', 'server', 'brand'])
    assert rc == 0
    assert stderr == ''
    brand = stdout.strip('\n')
    assert brand == 'OpenPegasus'

    # Check the expected Interop namespace
    rc, stdout, stderr = execute_command(
        'pywbemcli',
        ['-s', server_url, '--no-verify', 'namespace', 'interop'])
    assert rc == 0
    assert stderr == ''
    interop = stdout.strip('\n')
    assert interop == 'root/interop'

    # Check the namespaces our tests will use
    rc, stdout, stderr = execute_command(
        'pywbemcli',
        ['-s', server_url, '--no-verify', 'namespace', 'list'])
    assert rc == 0
    assert stderr == ''
    namespaces = stdout.strip('\n').split('\n')[2:]
    assert 'root/interop' in namespaces
    assert 'test/TestProvider' in namespaces

    # Check the profiles our tests will use
    rc, stdout, stderr = execute_command(
        'pywbemcli',
        ['-s', server_url, '--no-verify', 'profile', 'list'])
    assert rc == 0
    assert stderr == ''
    profile_lines = stdout.strip('\n').split('\n')[3:]
    profiles = []
    for line in profile_lines:
        m = re.match(r'^(.+?) {2,}(.+?) {2,}(.+)$', line)
        assert m, "Cannot parse 'profile list' output line: {!r}".format(line)
        profiles.append(m.groups())
    assert ('SNIA', 'Array', '1.1.0') in profiles
    assert ('SNIA', 'Indication', '1.2.0') in profiles
    assert ('SNIA', 'Profile Registration', '1.0.0') in profiles
    assert ('SNIA', 'SMI-S', '1.2.0') in profiles


text:
function checkbox_click(event)
{
    event.stopPropagation();
    do_email(enable_email.url);
    if($(event.target).attr('checked'))
    {
	$(event.target).parent().parent().find("td").addClass('selected').css("backgroundColor","");
    }
    else
    {
	$(event.target).parent().parent().find("td").removeClass();
    }
}

function enable_search(suggest_url,confirm_search_message)
{
    //Keep track of enable_email has been called
    if(!enable_search.enabled)
	enable_search.enabled=true
}
enable_search.enabled=false;

function do_search(show_feedback,on_complete)
{
    // event.preventDefault();
    oTable.fnDraw();
    if(typeof on_complete=='function')
	on_complete();
    if(show_feedback)
	$('#spinner').show();
    return;
}
function enable_email(email_url)
{
    //Keep track of enable_email has been called
    if(!enable_email.enabled)
	enable_email.enabled=true;

    //store url in function cache
    if(!enable_email.url)
    {
	enable_email.url=email_url;
    }

    $('#select_all, #sortable_table tbody :checkbox').click(checkbox_click);
}
enable_email.enabled=false;
enable_email.url=false;

function do_email(url)
{
    //If email is not enabled, don't do anything
    if(!enable_email.enabled)
	return;

    $.post(url, {
	'ids[]': get_selected_values()
    },function(response)
    {
	$('#email').attr('href',response);
    });

}

function enable_checkboxes()
{
    $('#sortable_table tbody :checkbox').click(checkbox_click);
}

function enable_delete(confirm_message,none_selected_message)
{
    //Keep track of enable_delete has been called
    if(!enable_delete.enabled)
	enable_delete.enabled=true;

    $('#delete').click(function(event)
    {
	event.preventDefault();
	if($("#sortable_table tbody :checkbox:checked").length >0)
	{
	    if(confirm(confirm_message))
	    {
		do_delete($("#delete").attr('href'));
	    }
	}
	else
	{
	    alert(none_selected_message);
	}
    });
}
enable_delete.enabled=false;

function do_delete(url)
{
    //If delete is not enabled, don't do anything
    if(!enable_delete.enabled)
	return;

    var row_ids = get_selected_values();
    var selected_rows = get_selected_rows();
    $.post(url, {
	'ids[]': row_ids
    },function(response)
    {
	//delete was successful, remove checkbox rows
	if(response.success)
	{
	    $(selected_rows).each(function(index, dom)
	    {
		$(this).find("td").animate({
		    backgroundColor:"green"
		},1200,"linear")
		.end().animate({
		    opacity:0
		},1200,"linear",function()

		{
			$(this).remove();
			//Re-init sortable table as we removed a row
			update_sortable_table();

		    });
	    });
	    set_feedback(response.message,'success_message',false);
	}
	else
	{
	    set_feedback(response.message,'error_message',true);
	}

    },"json");
}

function enable_bulk_edit(none_selected_message, size)
{
    //Keep track of enable_bulk_edit has been called
    if(!enable_bulk_edit.enabled)
	enable_bulk_edit.enabled=true;

    $('#bulk_edit').click(function(event)
    {
	event.preventDefault();
	if($("#sortable_table tbody :checkbox:checked").length >0)
	{
	    var row_ids = get_selected_values();
	    // tb_show($(this).attr('title'),$(this).attr('href'),false);
	    tb_show($(this).attr('title'),$(this).attr('href')+"/"+row_ids[0]+size,false);
	    $(this).blur();
	}
	else
	{
	    alert(none_selected_message);
	}
    });
}
enable_bulk_edit.enabled=false;

function enable_select_all()
{
    //Keep track of enable_select_all has been called
    if(!enable_select_all.enabled)
	enable_select_all.enabled=true;

    $('#select_all').click(function()
    {
//	!$(this).prop('checked')
//	if($(this).attr('checked'))
	if($(this).prop('checked'))
	{
	    $("#sortable_table tbody :checkbox").each(function()
	    {
//		$(this).attr('checked',true);
		$(this).prop('checked','checked');
		$(this).parent().parent().find("td").addClass('selected').css("backgroundColor","");

	    });
	}
	else
	{
	    $("#sortable_table tbody :checkbox").each(function()
	    {
		$(this).attr('checked',false);
		$(this).parent().parent().find("td").removeClass();
	    });
	}
    });
}
enable_select_all.enabled=false;

function enable_row_selection(rows)
{
    //Keep track of enable_row_selection has been called
    if(!enable_row_selection.enabled)
	enable_row_selection.enabled=true;

    if(typeof rows =="undefined")
	rows=$("#sortable_table tbody tr");

    rows.hover(
	function row_over()
	{
	    $(this).find("td").addClass('over').css("backgroundColor","");
	    $(this).css("cursor","pointer");
	},

	function row_out()
	{
	    if(!$(this).find("td").hasClass("selected"))
	    {
		$(this).find("td").removeClass();
	    }
	}
	);

    rows.click(function row_click(event)
    {

	var checkbox = $(this).find(":checkbox");
	var resp = !checkbox.prop('checked');

	if(!resp)
	   checkbox.removeAttr('checked');
       else
	   checkbox.prop("checked", 'checked');

//	checkbox.attr('checked',resp);
	//do_email(enable_email.url);

	if(checkbox.attr('checked'))
	{
	    $(this).find("td").addClass('selected').css("backgroundColor","");
	}
	else
	{
	    $(this).find("td").removeClass();
	}
    });
}
enable_row_selection.enabled=false;

function update_sortable_table()
{
    //let tablesorter know we changed <tbody> and then triger a resort
    $("#sortable_table").trigger("update");

    if(typeof $("#sortable_table")[0].config!="undefined")
    {
	var sorting = $("#sortable_table")[0].config.sortList;
	$("#sortable_table").trigger("sorton",[sorting]);
    }
}

function update_row(row_id,url)
{
    $.post(url, {
	'row_id': row_id
    },function(response)
    {
	//Replace previous row
	var row_to_update = $("#sortable_table tbody tr :checkbox[value="+row_id+"]").parent().parent();
	row_to_update.replaceWith(response);
	reinit_row(row_id);
	hightlight_row(row_id);
    });
}

function reinit_row(checkbox_id)
{
    var new_checkbox = $("#sortable_table tbody tr :checkbox[value="+checkbox_id+"]");
    var new_row = new_checkbox.parent().parent();
    enable_row_selection(new_row);
    //Re-init some stuff as we replaced row
    update_sortable_table();
    //re-enable e-mail
    new_checkbox.click(checkbox_click);
}

function hightlight_row(checkbox_id)
{
    var new_checkbox = $("#sortable_table tbody tr :checkbox[value="+checkbox_id+"]");
    var new_row = new_checkbox.parent().parent();

    new_row.find("td").animate({
	backgroundColor:"#e1ffdd"
    },"slow","linear")
    .animate({
	backgroundColor:"#e1ffdd"
    },5000)
    .animate({
	backgroundColor:"#ffffff"
    },"slow","linear");
}

function get_selected_values()
{
    var selected_values = new Array();
    $("#sortable_table tbody :checkbox:checked").each(function()
    {
	selected_values.push($(this).val());
    });
    return selected_values;
}

function get_selected_rows()
{
    var selected_rows = new Array();
    $("#sortable_table tbody :checkbox:checked").each(function()
    {
	selected_rows.push($(this).parent().parent());
    });
    return selected_rows;
}

function get_visible_checkbox_ids()
{
    var row_ids = new Array();
    $("#sortable_table tbody :checkbox").each(function()
    {
	row_ids.push($(this).val());
    });
    return row_ids;
}

function refresca(event)
{
	event.preventDefault();
	oTable.fnDraw();
}

function init_table_sorting()
{
	//Only init if there is more than one row
	if($('.tablesorter tbody tr').length >1)
	{
		$("#sortable_table").tablesorter(
		{
			sortList: [[1,0]],
			headers:
				{
				0: { sorter: false}
			}
		})
		.tablesorterPager({container: $("#pager")});
	}
}


text:
import {isAbsolute, resolve} from 'path';

import {resolveNgLangSvc, resolveTsServer} from '../version_provider';

describe('Node Module Resolver', () => {
  const probeLocations = [__dirname];

  it('should be able to resolve tsserver', () => {
    const result = resolveTsServer(probeLocations);
    expect(result).toBeDefined();
    expect(result.resolvedPath).toMatch(/typescript\/lib\/tsserverlibrary.js$/);
  });

  it('should resolve tsserver from typescript.tsdk provided as fs path', () => {
    // Resolve relative to cwd.
    const absPath = resolve('node_modules/typescript/lib');
    expect(isAbsolute(absPath)).toBeTrue();
    const result = resolveTsServer([absPath]);
    expect(result.resolvedPath.endsWith('typescript/lib/tsserverlibrary.js')).toBeTrue();
  });

  it('should be able to resolve Angular language service', () => {
    const result = resolveNgLangSvc(probeLocations);
    expect(result).toBeDefined();
    expect(result.resolvedPath.endsWith('@angular/language-service/index.js')).toBeTrue();
  });
});


text:
<?xml version="1.0" encoding="UTF-8"?>
<!-- Licensed to the Austrian Association for Software Tool Integration (AASTI) under one or more contributor license agreements.
  See the NOTICE file distributed with this work for additional information regarding copyright ownership. The AASTI licenses
  this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
  the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable
  law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
  OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and
  limitations under the License. -->

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

  <parent>
    <groupId>org.openengsb.framework</groupId>
    <artifactId>openengsb-framework-parent</artifactId>
    <version>3.0.0-SNAPSHOT</version>
    <relativePath>../../</relativePath>
  </parent>

  <modelVersion>4.0.0</modelVersion>
  <groupId>org.openengsb.ui</groupId>
  <artifactId>org.openengsb.ui.api</artifactId>

  <name>OpenEngSB :: User Interface :: API</name>
  <description>API definition for classes in the wicket UIs</description>

  <url>http://www.openengsb.org</url>
  <licenses>
    <license>
      <name>Apache 2</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>
  <scm>
    <connection>scm:git:git://github.com/openengsb/openengsb-framework.git</connection>
    <developerConnection>scm:git:git@github.com:openengsb/openengsb-framework.git</developerConnection>
    <url>http://github.com/openengsb/openengsb-framework</url>
    <tag>HEAD</tag>
  </scm>

  <packaging>bundle</packaging>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <extensions>true</extensions>
      </plugin>
    </plugins>
  </build>

  <dependencies>
    <dependency>
      <groupId>org.openengsb.framework</groupId>
      <artifactId>org.openengsb.framework.api</artifactId>
      <version>${project.version}</version>
      <scope>provided</scope>
    </dependency>
  </dependencies>

  <repositories>
    <repository> <!-- OEB snapshots are deployed here -->
      <id>sonatype-snapshots</id>
      <name>Sonaype Snapsht Repository</name>
      <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
      <releases>
        <enabled>false</enabled>
      </releases>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
    </repository>
  </repositories>

</project>


text:
(function(){
	"use strict";
	_gaq.push(['_trackPageview']);

	$(document).on("ready", function(){
		// Initialize data managers
		ConfigManager.load();
		KC3Meta.init("../../data/");
		KC3Master.init();
		PlayerManager.init();
		KC3ShipManager.load();
		KC3GearManager.load();
		KC3Database.init( PlayerManager.hq.id );

		// Click a menu item
		$("#menu .submenu ul.menulist li").on("click", function(){
			// If loading another page, stop
			if($(this).hasClass("disabled")){ return false; }
			if(KC3StrategyTabs.loading){ return false; }
			KC3StrategyTabs.loading = $(this).data("id");

			// Google Analytics
			_gaq.push(['_trackEvent', "Strategy Room: "+KC3StrategyTabs.loading, 'clicked']);

			// Interface
			$("#menu .submenu ul.menulist li").removeClass("active");
			$(this).addClass("active");
			$("#contentHtml").hide();
			$("#contentHtml").html("");
			window.location.hash = KC3StrategyTabs.loading;

			// Tab definition execution
			var thisTab = KC3StrategyTabs[ KC3StrategyTabs.loading ];
			if(typeof thisTab != "undefined"){
				// Execute Tab with callback
				thisTab.apply();
				window.scrollTo(0,0);
			}else{
				KC3StrategyTabs.loading = false;
				console.log("Clicked "+$(this).data("id")+" menu with no bound actions");
			}
		});

		// If there is a hash tag on URL, set it as initial selected
		KC3StrategyTabs.pageParams = window.location.hash.substring(1).split("-");
		if(KC3StrategyTabs.pageParams[0] !== ""){
			$("#menu .submenu ul.menulist li").removeClass("active");
			$("#menu .submenu ul.menulist li[data-id="+KC3StrategyTabs.pageParams[0]+"]").addClass("active");
		}

		// Load initially selected
		$("#menu .submenu ul.menulist li.active").click();

	});

})();


text:
package java.security;

import java.io.Serializable;

/**
 * This class is a Service Provider Interface (therefore the Spi suffix) for
 * secure random number generation algorithms to be supplied by providers.
 *
 */
public abstract class SecureRandomSpi implements Serializable {
	/**
	 * Constructs a new instance of this class.
	 */
	public SecureRandomSpi() {
		// Intentionally empty
	}

	/**
	 * Generates a certain number of seed bytes
	 *
	 * @param numBytes
	 *            int Number of seed bytes to generate
	 * @return byte[] The seed bytes generated
	 */
	protected abstract byte[] engineGenerateSeed(int numBytes);

	/**
	 * Generates a certain number of random bytes
	 *
	 *
	 * @param bytes
	 *            byte[] array to be filled with random bytes
	 */
	protected abstract void engineNextBytes(byte[] bytes);

	/**
	 * Reseeds this random object
	 *
	 *
	 * @param seed
	 *            byte[] The number of seed bytes to generate
	 */
	protected abstract void engineSetSeed(byte[] seed);
}


text:
The NGSI Type Browser widgets allows you to browser the entities types used in
a given [Orion Context
Broker](http://catalogue.fiware.org/enablers/publishsubscribe-context-broker-orion-context-broker)
server in a easy and paginated way. This is done using the `contextTypes` querys, so
updates made into the context broker are not reflected immediately when using
this widget.

> Latest version of this widget is always provided in [FIWARE
> Lab](https://store.lab.fiware.org/search/keyword/OrionStarterKit) where you
> can make use of it on the [Mashup portal](https://mashup.lab.fiware.org).
> Remember to take a look into the example mashups provided in the OrionStarterKit offering.

## Settings

- **NGSI server URL:** URL of the Orion Context Broker to use for retrieving
  entity information.
- **Use the FIWARE credentials of the user:** Use the FIWARE credentials of the
  user logged into WireCloud. Take into account this option cannot be enabled if
  you want to use this widget in a public workspace as anonoymous users doesn't
  have a valid FIWARE auth token. As an alternative, you can make use of the
  "Use the FIWARE credentials of the workspace owner" preference.
- **Use the FIWARE credentials of the dashboard owner**: Use the FIWARE
  credentials of the owner of the workspace. This preference takes preference
  over "Use the FIWARE credentials of the user". This feature is available on
  WireCloud 0.7.0+ in a experimental basis, future versions of WireCloud can
  change the way to use it making this option not funcional and requiring you to
  upgrade this operator.
- **NGSI tenant/service**: Tenant/service to use when connecting to the context
  broker. Must be a string of alphanumeric characters (lowercase) and the `_`
  symbol. Maximum length is 50 characters. If empty, the default tenant will be
  used
- **NGSI scope**: Scope/path to use when connecting to the context broker. Must
  be a string of alphanumeric characters (lowercase) and the `_` symbol
  separated by `/` slashes. Maximum length is 50 characters. If empty, the
  default service path will be used: `/`

## Wiring

##### Input Endpoints

- This widget has no input endpoint

##### Output Endpoints

- **Selection**: always an user clicks on a row, an event is sent using this
  endpoint and providing info about the selected type. This data is encoded
  using JSON. E.g.:

    ```json
    {
        "name": "Agrarium",
        "attributes": ["moisture", "ambientLight", "position", "humidity", "temperature"]
    }
    ```


text:
@implementation CCTeamCoreDataModel

- (void)updateWithServerModel:(CCTeamServerModel *)serverModel {
    self.imageURL = serverModel.imageURL.absoluteString;
    self.name = serverModel.name;
    self.teamID = serverModel.teamID;
}

@end


text:
<resources>
    <string name="app_name">ApiDemo</string>
    <string name="get_package_info_error">获取包信息异常。</string>
    <string name="open_activity_error">Activity打开异常。</string>
</resources>


text:
<readable><title>2555535057_007501dae5</title><content>
A beige , white and black little dog is bounding towards the camera from the street onto the green grass .
A dog is running along the grass .
A multicolor puppy running on the lawn beside a road .
A puppy running along a street .
A small dog is running on the grass beside the road .
</content></readable>


text:
package org.ops4j.ramler.gradle;

import org.gradle.api.Plugin;
import org.gradle.api.Project;
import org.gradle.api.plugins.JavaPlugin;

/**
 * Ramler Gradle plugin class. Adds all tasks of type {@link RamlerJavaGenerator} and
 * {@link RamlerJavaTestGenerator} as dependencies of the {@code compileJava} and
 * {@code compileTestJava} tasks, respectively.
 *
 * @author Harald Wellmann
 *
 */
public class JavaRamlerPlugin implements Plugin<Project> {

    @Override
    public void apply(Project project) {
        project.getTasks()
            .withType(RamlerJavaGenerator.class, task -> project.getTasks()
                .getByName(JavaPlugin.COMPILE_JAVA_TASK_NAME)
                .dependsOn(task));

        project.getTasks()
            .withType(RamlerJavaTestGenerator.class, task -> project.getTasks()
                .getByName(JavaPlugin.COMPILE_TEST_JAVA_TASK_NAME)
                .dependsOn(task));
    }
}


text:
<!DOCTYPE html>

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

        <link href="/apps-include/bootstrap/css/bootstrap.min.css" rel="stylesheet">
        <link href="/apps-include/icomoon/icomoon.css" rel="stylesheet">
        <link href="/apps-include/css/multilevel-dropdown.css" rel="stylesheet">
        <link href="/apps-include/css/layout.css" rel="stylesheet">
        <link href="../non/css/main.css" rel="stylesheet">

        <link rel="shortcut icon" href="/apps-include/img/favicons/favicon.ico">
        <link rel="icon" sizes="16x16 32x32 64x64" href="/apps-include/img/favicons/favicon.ico">
        <link rel="icon" type="image/png" sizes="64x64" href="/apps-include/img/favicons/favicon-64.png">
        <link rel="icon" type="image/png" sizes="32x32" href="/apps-include/img/favicons/favicon-32.png">
        <link rel="apple-touch-icon" href="/apps-include/img/favicons/favicon-57.png">
        <link rel="apple-touch-icon" sizes="144x144" href="/apps-include/img/favicons/favicon-144.png">
        <meta name="msapplication-TileImage" content="/apps-include/img/favicons/favicon-white-144.png">
        <meta name="msapplication-TileColor" content="#00569c">

        <title>ELIXIR bioinfo-cz mailing list manager</title>

mailing list manager

Javascript is disabled

This site will not work correctly because your browser is blocking JavaScript. Please enable JavaScript and reload page.


text:
// (C) Copyright 2015 Moodle Pty Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

import { Injectable, Type } from '@angular/core';
import { CoreDelegate, CoreDelegateHandler } from '@classes/delegate';
import { AddonModDataDefaultFieldHandler } from './handlers/default-field';
import { makeSingleton } from '@singletons';
import { AddonModDataEntryField,
    AddonModDataField,
    AddonModDataSearchEntriesAdvancedFieldFormatted,
    AddonModDataSubfieldData,
} from './data';
import { CoreFormFields } from '@singletons/form';
import { FileEntry } from '@ionic-native/file/ngx';
import { CoreFileEntry } from '@services/file-helper';

/**
 * Interface that all fields handlers must implement.
 */
export interface AddonModDataFieldHandler extends CoreDelegateHandler {

    /**
     * Name of the type of data field the handler supports. E.g. 'checkbox'.
     */
    type: string;

    /**
     * Return the Component to use to display the plugin data.
     * It's recommended to return the class of the component, but you can also return an instance of the component.
     *
     * @param field The field object.
     * @return The component to use, undefined if not found.
     */
    getComponent?(plugin: AddonModDataField): Type<unknown> | undefined;

    /**
     * Get field search data in the input data.
     *
     * @param field Defines the field to be rendered.
     * @param inputData Data entered in the search form.
     * @return With name and value of the data to be sent.
     */
    getFieldSearchData?(
        field: AddonModDataField,
        inputData: CoreFormFields,
    ): AddonModDataSearchEntriesAdvancedFieldFormatted[];

    /**
     * Get field edit data in the input data.
     *
     * @param field Defines the field to be rendered.
     * @param inputData Data entered in the edit form.
     * @return With name and value of the data to be sent.
     */
    getFieldEditData?(
        field: AddonModDataField,
        // eslint-disable-next-line @typescript-eslint/no-explicit-any
        inputData: CoreFormFields<any>,
        originalFieldData: AddonModDataEntryField,
    ): AddonModDataSubfieldData[];

    /**
     * Get field data in changed.
     *
     * @param field Defines the field to be rendered.
     * @param inputData Data entered in the edit form.
     * @param originalFieldData Original field entered data.
     * @return If the field has changes.
     */
    hasFieldDataChanged?(
        field: AddonModDataField,
        inputData: CoreFormFields,
        originalFieldData: AddonModDataEntryField,
    ): boolean;

    /**
     * Get field edit files in the input data.
     *
     * @param field Defines the field..
     * @return With name and value of the data to be sent.
     */
    getFieldEditFiles?(
        field: AddonModDataField,
        inputData: CoreFormFields,
        originalFieldData: AddonModDataEntryField,
    ): CoreFileEntry[];

    /**
     * Check and get field requeriments.
     *
     * @param field Defines the field to be rendered.
     * @param inputData Data entered in the edit form.
     * @return String with the notification or false.
     */
    getFieldsNotifications?(field: AddonModDataField, inputData: AddonModDataSubfieldData[]): string | undefined;

    /**
     * Override field content data with offline submission.
     *
     * @param originalContent Original data to be overriden.
     * @param offlineContent Array with all the offline data to override.
     * @param offlineFiles Array with all the offline files in the field.
     * @return Data overriden
     */
    overrideData?(
        originalContent: AddonModDataEntryField,
        offlineContent: CoreFormFields,
        offlineFiles?: FileEntry[],
    ): AddonModDataEntryField;
}

/**
 * Delegate to register database fields handlers.
 */
@Injectable({ providedIn: 'root' })
export class AddonModDataFieldsDelegateService extends CoreDelegate<AddonModDataFieldHandler> {

    protected handlerNameProperty = 'type';

    constructor(
        protected defaultHandler: AddonModDataDefaultFieldHandler,
    ) {
        super('AddonModDataFieldsDelegate', true);
    }

    /**
     * Get the component to use for a certain field field.
     *
     * @param field The field object.
     * @return Promise resolved with the component to use, undefined if not found.
     */
    getComponentForField(field: AddonModDataField): Promise<Type<unknown> | undefined> {
        return Promise.resolve(this.executeFunctionOnEnabled(field.type, 'getComponent', [field]));
    }

    /**
     * Get database data in the input data to search.
     *
     * @param field Defines the field to be rendered.
     * @param inputData Data entered in the search form.
     * @return Name and data field.
     */
    getFieldSearchData(field: AddonModDataField, inputData: CoreFormFields): AddonModDataSearchEntriesAdvancedFieldFormatted[] {
        return this.executeFunctionOnEnabled(field.type, 'getFieldSearchData', [field, inputData]) || [];
    }

    /**
     * Get database data in the input data to add or update entry.
     *
     * @param field Defines the field to be rendered.
     * @param inputData Data entered in the search form.
     * @param originalFieldData Original field entered data.
     * @return Name and data field.
     */
    getFieldEditData(
        field: AddonModDataField,
        inputData: CoreFormFields,
        originalFieldData: AddonModDataEntryField,
    ): AddonModDataSubfieldData[] {
        return this.executeFunctionOnEnabled(field.type, 'getFieldEditData', [field, inputData, originalFieldData]) || [];
    }

    /**
     * Get database data in the input files to add or update entry.
     *
     * @param field Defines the field to be rendered.
     * @param inputData Data entered in the search form.
     * @param originalFieldData Original field entered data.
     * @return Name and data field.
     */
    getFieldEditFiles(
        field: AddonModDataField,
        inputData: CoreFormFields,
        originalFieldData: CoreFormFields,
    ): CoreFileEntry[] {
        return this.executeFunctionOnEnabled(field.type, 'getFieldEditFiles', [field, inputData, originalFieldData]) || [];
    }

    /**
     * Check and get field requeriments.
     *
     * @param field Defines the field to be rendered.
     * @param inputData Data entered in the edit form.
     * @return String with the notification or false.
     */
    getFieldsNotifications(field: AddonModDataField, inputData: AddonModDataSubfieldData[]): string | undefined {
        return this.executeFunctionOnEnabled(field.type, 'getFieldsNotifications', [field, inputData]);
    }

    /**
     * Check if field type manage files or not.
     *
     * @param field Defines the field to be checked.
     * @return If the field type manages files.
     */
    hasFiles(field: AddonModDataField): boolean {
        return this.hasFunction(field.type, 'getFieldEditFiles');
    }

    /**
     * Check if the data has changed for a certain field.
     *
     * @param field Defines the field to be rendered.
     * @param inputData Data entered in the search form.
     * @param originalFieldData Original field entered data.
     * @return If the field has changes.
     */
    hasFieldDataChanged(
        field: AddonModDataField,
        inputData: CoreFormFields,
        originalFieldData: CoreFormFields,
    ): boolean {
        return !!this.executeFunctionOnEnabled(
            field.type,
            'hasFieldDataChanged',
            [field, inputData, originalFieldData],
        );
    }

    /**
     * Check if a field plugin is supported.
     *
     * @param pluginType Type of the plugin.
     * @return True if supported, false otherwise.
     */
    isPluginSupported(pluginType: string): boolean {
        return this.hasHandler(pluginType, true);
    }

    /**
     * Override field content data with offline submission.
     *
     * @param field Defines the field to be rendered.
     * @param originalContent Original data to be overriden.
     * @param offlineContent Array with all the offline data to override.
     * @param offlineFiles Array with all the offline files in the field.
     * @return Data overriden
     */
    overrideData(
        field: AddonModDataField,
        originalContent: AddonModDataEntryField,
        offlineContent: CoreFormFields,
        offlineFiles?: FileEntry[],
    ): AddonModDataEntryField {
        originalContent = originalContent || {};

        if (!offlineContent) {
            return originalContent;
        }

        return this.executeFunctionOnEnabled(field.type, 'overrideData', [originalContent, offlineContent, offlineFiles]) ||
            originalContent;
    }

}
export const AddonModDataFieldsDelegate = makeSingleton(AddonModDataFieldsDelegateService);


text:
import json
from quizzer.domain.test import Test

__author__ = 'David Moreno García'

def deserialize(json_string):
    """
    Deserializes the JSON representation received as arguments to a list of Test objects.

    :param json_string: JSON representation of Test objects
    :return: a list containing the tests deserialized
    """
    tests = list()

    if json_string:
        data = json.loads(json_string)
        if 'tests' in data:
            for test in data['tests']:
                if 'quizz' in test and 'assessment' in test and 'scores' in test:
                    tests.append(Test(test['quizz'], test['assessment'], test['scores']))

    return tests


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

var ExcludeRegexp;
var useAsLoader;
var Bundles;
var includeFilePaths;
var Encoding;
var AllowDuplicatesInBundle;
var printProgress;
var CommentTags = { Start: "/* ", End: " */" };
var FileEnding;

function MergeIntoFile(options) {
    ExcludeRegexp = options.excludedFilenames || null;
    useAsLoader = options.useAsLoader || false;
    includeFilePaths = options.includeFilePathComments || false;
    Encoding = options.readEncoding || null;
    AllowDuplicatesInBundle = options.allowDuplicatesInBundle || false;
    Bundles = options.bundles;
    printProgress = options.printProgress || false;
    FileEnding = options.fileEnding || "\n\n";

    if (includeFilePaths)
        CommentTags = options.commentTags || CommentTags;

    this.options = options;
}

function isExcluded(aString, currentBundleOptions) {
    var isIncluded = (currentBundleOptions && currentBundleOptions.match)
        ? currentBundleOptions.match.test(aString)
        : true;

    return ExcludeRegexp && isIncluded
        ? ExcludeRegexp.some(function (exp) {
            return exp.test(aString)
        })
        : !isIncluded;
}

// List all files in a directory in Node.js recursively in a synchronous fashion
var walkSync = function (dir, filelist, ext, currentBundleOptions) {
    var path = path || require('path');
    var fs = fs || require('fs');
    var files = fs.readdirSync(dir);
    filelist = filelist || [];
    files.forEach(function (file) {
        if (fs.statSync(path.join(dir, file)).isDirectory()) {
            filelist = walkSync(path.join(dir, file), filelist, ext, currentBundleOptions);
        }
        else {
            if (file.match(new RegExp("." + ext + "$")) && !isExcluded(file, currentBundleOptions))
                filelist.push(path.join(dir, file));
        }
    });
    return filelist;
};

var RelativeRegexp = /(.*?)\*.(.*?)$/;
var BeenHere = {};
function mergeFiles(list, currentBundleOptions, FileExt, BeenHere, callback, ind) {
    if (!ind) ind = 0;
    if (!AllowDuplicatesInBundle && list[ind] && BeenHere[list[ind]]) ind++; else BeenHere[list] = 1;

    // Recursive ending conditions
    if (typeof list == "string") {
        if (ind > 0) {
            return callback(null, "");
        }
    } else if (ind >= list.length) {
        return callback(null, "");
    }

    // Parse a folder for it's files dynamically
    if (FileExt == null && (currentBundleOptions || typeof list == "string" || typeof list[ind] == "string")) {
        var useThisString = (currentBundleOptions) ? currentBundleOptions.path : ((typeof list == "string") ? list : list[ind]);
        var Matched = useThisString.match(RelativeRegexp);
        if (Matched) {
            FileExt = Matched[2];

            // Merge the newly found files into the list of things to deal with
            list = walkSync(Matched[1], [], FileExt, currentBundleOptions).concat(list.slice(ind+1));
            ind = 0;
            currentBundleOptions = null; // Clear out the options to keep on processing
        }
    }

    var curfile = (currentBundleOptions) ? currentBundleOptions.path : ((typeof list == "string") ? list : list[ind]);

    if (printProgress)
        console.log("Bundling: " + curfile + "[" + (ind + 1) + "/" + list.length + "]");

    if (typeof curfile == "undefined")
        return callback(null, "");

  fs.readFile(curfile, Encoding, (err, body) =>{
      if (err) return callback(err);

      // Add the debug tags to see what file is what
      if(includeFilePaths)
        body = CommentTags.Start + curfile + CommentTags.End + "\n" + body;

      var nextOptions = (list[ind + 1] && list[ind + 1].path) ? list[ind + 1] : null;

    mergeFiles(list, nextOptions, FileExt, BeenHere, (err, otherFilesBody)=>{
      if(err) return callback(err);
      callback(null, body + FileEnding + otherFilesBody)
    }, ind+1)
  })
}

MergeIntoFile.prototype.apply = function(compiler) {
  var options = this.options;
  compiler.plugin('emit', function(compilation, callback) {
    var count=0;
    var file2createCnt = 0;
    Bundles.forEach(function (filename) {

        if (printProgress)
            console.log("Starting to bundle: " + filename);

        var files = options[filename];
            var BundleMe;
            var currentBundlePartOptions;

            if (typeof files[0] == "string") {
                //BundleMe = files[0];
                currentBundlePartOptions = null;
            } else {
                //BundleMe = files[0].path;
                currentBundlePartOptions = files[0];
            }

            // files = [./bin/file1.txt
            //        ./bin/*.txt]
            file2createCnt++;
            (function (filenaname2create) {
                mergeFiles(files, currentBundlePartOptions, null, {}, (err, content) => {
                    if (err) return callback(err);
                    compilation.assets[filenaname2create] = {
                        source: function () {
                            return content;
                        },
                        size: function () {
                            return content.length;
                        }
                    };
                    count++;
                    if (file2createCnt === count) {
                        callback();
                    }
                });
            })(filename);
    });
  });
};

module.exports = MergeIntoFile;


text:
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE479_Signal_Handler_Use_of_Non_Reentrant_Function__basic_07.c
Label Definition File: CWE479_Signal_Handler_Use_of_Non_Reentrant_Function__basic.label.xml
Template File: point-flaw-07.tmpl.c
*/
/*
 * @description
 * CWE: 479 Signal Handler Use of Non-Reentrant Function
 * Sinks:
 *    GoodSink: Don't call a function from within the signal handler
 *    BadSink : malloc() and free() inside a signal handler
 * Flow Variant: 07 Control flow: if(staticFive==5) and if(staticFive!=5)
 *
 * */

#include "std_testcase.h"

#include <signal.h>

static void helperBad(int sig)
{
    /* FLAW: malloc and free are not re-entrant */
    /* Used to be printf in here, but we are trying to avoid that.
     * Detecting that printLine ultimately calls printf requires inter-
     * procedural analysis, so we cannot do that either.  So instead,
     * do something very contrived with malloc/free
     */
    void *voidPointer = malloc(10);
    if (voidPointer == NULL) {exit(-1);}
    free(voidPointer);
}

static volatile sig_atomic_t volatileSigAtomic = 0;

static void helperGood(int sig)
{
    /* FIX: Basically, "don't do anything" in signal handlers.  Set a flag at
     * best, and if you have to call a function, ensure it's a re-entrant
     * asynchronous-safe one that doesn't eat up a lot of time
     */
    volatileSigAtomic = sig;
}

/* The variable below is not declared "const", but is never assigned
   any other value so a tool should be able to identify that reads of
   this will always give its initialized value. */
static int staticFive = 5;

#ifndef OMITBAD

void CWE479_Signal_Handler_Use_of_Non_Reentrant_Function__basic_07_bad()
{
    if(staticFive==5)
    {
        signal(SIGINT, helperBad);
    }
}

#endif /* OMITBAD */

#ifndef OMITGOOD

/* good1() uses if(staticFive!=5) instead of if(staticFive==5) */
static void good1()
{
    if(staticFive!=5)
    {
        /* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
        printLine("Benign, fixed string");
    }
    else
    {
        signal(SIGINT, helperGood);
    }
}

/* good2() reverses the bodies in the if statement */
static void good2()
{
    if(staticFive==5)
    {
        signal(SIGINT, helperGood);
    }
}

void CWE479_Signal_Handler_Use_of_Non_Reentrant_Function__basic_07_good()
{
    good1();
    good2();
}

#endif /* OMITGOOD */

/* Below is the main(). It is only used when building this testcase on
   its own for testing or for building a binary to use in testing binary
   analysis tools. It is not used when compiling all the testcases as one
   application, which is how source code analysis tools are tested. */

#ifdef INCLUDEMAIN

int main(int argc, char * argv[])
{
    /* seed randomness */
    srand( (unsigned)time(NULL) );
#ifndef OMITGOOD
    printLine("Calling good()...");
    CWE479_Signal_Handler_Use_of_Non_Reentrant_Function__basic_07_good();
    printLine("Finished good()");
#endif /* OMITGOOD */
#ifndef OMITBAD
    printLine("Calling bad()...");
    CWE479_Signal_Handler_Use_of_Non_Reentrant_Function__basic_07_bad();
    printLine("Finished bad()");
#endif /* OMITBAD */
    return 0;
}

#endif


text:
<?php

class MorphToManyEntityTwo extends \Illuminate\Database\Eloquent\Model
{
    use \Rutorika\Sortable\MorphToSortedManyTrait;

    public function relatedEntities()
    {
        return $this->morphToSortedMany('MorphToManyRelatedEntity', 'morphable', 'morph_to_many_related_entity_position');
    }
}


text:
ChatApp.factory('appService', function(/*$location, $rootScope, $http, $state, $ionicLoading*/ ) {
	function checkLogin(callback){
		window.FB.getLoginStatus(function(response) {
			if (response.status === 'connected') {
				FB.api('/me', {fields: 'name'}, function(nameRes) {
					if (!nameRes || nameRes.error){
						callback && callback(false);
					}
					else{
						response.authResponse.name = nameRes.name;
						callback && callback(response.authResponse);
					}
				});

			}
			else{
				callback && callback(false);
			}
		});
	};

	function doLogin(callback){
		FB.login(function(response) {
			if(response.authResponse) {
				FB.api('/me', {fields: 'name'}, function(nameRes) {
					response.authResponse.name = nameRes.name;
					callback && callback(response.authResponse);
				});
			} else {
				//console.log('User cancelled login or did not fully authorize.');
				callback && callback(false);
			}
		});
	};

	return {
		checkLogin: checkLogin,
		doLogin: doLogin
	};
});

ChatApp.factory('chatService', function(/*$location, $rootScope, $http, $state, $ionicLoading*/ WebsocketService){
	// callbackSendMessage, callbackReceiveMessage, callbackConnect, callbackClose
	var callbacks = {};
	function init(_callbacks){
		callbacks = _callbacks;
		ensureConnect();
	};

	function onConnect(){
		//console.log('Websocket connected!!');
		callbacks.callbackConnect && callbacks.callbackConnect();
	};

	function onClose(){
		//console.log('Websocket close');
		callbacks.callbackClose && callbacks.callbackClose();
	};

	function ensureConnect(){
		var state = WebsocketService.getState();
		if (state !== 0 && state !== 1) {
			var uuid = 'browser';
			if (window.device){
				uuid = window.device.uuid;
			}
			var url = Config.urlWebSocket + '?userID=' + userData.userID + '&accessToken=' + userData.accessToken + '&uuid=' + uuid;

			//console.log('Connecting... ' + url);
			WebsocketService.unbind('open', onConnect);
			WebsocketService.unbind('close', onClose);
			WebsocketService.unbind('message', onReceiceMessage);

			WebsocketService.bind('open', onConnect);
			WebsocketService.bind('close', onClose);
			WebsocketService.bind('message', onReceiceMessage);
			WebsocketService.connect(url);

			return false;
		}
		if (state === 0){
			return false;
		}
		return true;
	};

	function onReceiceMessage(payload){
		//console.log(payload);
		payload = angular.fromJson(payload);

		callbacks.callbackReceiveMessage && callbacks.callbackReceiveMessage(payload);
	};

	function sendMessage(messageData){
		//if (typeof messageData == 'object'){
			messageData = JSON.stringify(messageData);
		//}
		WebsocketService.send('message', messageData);
		callbacks.callbackSendMessage && callbacks.callbackSendMessage();
	};

	function exit(){
		WebsocketService.disconnect();
	};

	return {
		init: init,
		ensureConnect: ensureConnect,
		sendMessage: sendMessage,
		exit: exit

	};
});

ChatApp.factory('WebsocketService', function(){
	var callbacks = {};
	var conn;
	function bind(event_name, callback){
		callbacks[event_name] = callbacks[event_name] || [];
		callbacks[event_name].push(callback);
		return this;// chainable
	}

	function unbind(event_name, callback){
		var chain = callbacks[event_name];
		if (typeof chain == 'undefined') return;
		for (var i = chain.length -1 ; i >= 0 ; i--){
			if(chain[i] == callback) {
				chain.splice(i, 1);
				return this;
			}
		}
		return this;// chainable
	}

	function send(event_name, event_data){
		//console.log('websocket send: ' + event_data);
		if (conn.readyState == 1){
			conn.send(event_data);
		}
		return this;
	}

	function connect(url) {
		if (typeof(MozWebSocket) == 'function')
			conn = new MozWebSocket(url);
		else
			conn = new WebSocket(url);

		// dispatch to the right handlers
		conn.onmessage = function(evt){
			dispatch('message', evt.data);
		};

		conn.onclose = function(){dispatch('close',null)};
		conn.onopen = function(){dispatch('open',null)};
	}

	function getState() {
		if(!conn) return -1;
		return conn.readyState;
	}

	function disconnect() {
		if(conn) {
			conn.close();
		}
	}

	function dispatch(event_name, message){
		var chain = callbacks[event_name];
		if(typeof chain == 'undefined') return; // no callbacks for this event
		for(var i = 0; i < chain.length; i++){
			chain[i]( message );
		}
	}
	return {
		bind:bind,
		unbind:unbind,
		send:send,
		connect:connect,
		disconnect:disconnect,
		getState:getState
	};
});


text:
var vows = require('vows'),
    assert = require('assert'),

    common = require('../common.js'),
    prope = require(common.watcher('interface.js'));

var preOption = {
  strategy: 'daemon',
  auto: false
};

function startImmortal(callback) {
  prope.createInterface(common.fixture('longlive.js'), preOption, callback);
}

var monitor = null;
vows.describe('testing daemon restart with auto:false').addBatch({

  'when creating the immortal group': {
    topic: function () {
      var self = this;
      startImmortal(function (error, prope) {
        monitor = prope;
        self.callback(error, prope);
      });
    },

    'pid should match alive processors': function (error, monitor) {
      assert.ifError(error);

      // Since montor.ready hasn't been executed
      assert.isNull(monitor.pid.process);

      // The daemon process should be alive
      assert.isNumber(monitor.pid.daemon);
      assert.isTrue(common.isAlive(monitor.pid.daemon));

      // The pump process should be alive
      assert.isNumber(monitor.pid.monitor);
      assert.isTrue(common.isAlive(monitor.pid.monitor));
    }
  }

}).addBatch({

  'when the child process is started': {
    topic: function () {
      monitor.ready();
      this.callback(null, monitor);
    },

    'and daemon event has emitted': {
      topic: function (monitor) {
        var self = this;
        monitor.once('daemon', function (state) {
          self.callback(null, monitor, state);
        });
      },

      'the state argument should be start': function (error, monitor, state) {
        assert.ifError(error);
        assert.equal(state, 'start');
      }
    },

    'and monitor event has emitted': {
      topic: function (monitor) {
        var self = this;
        monitor.once('monitor', function (state) {
          self.callback(null, monitor, state);
        });
      },

      'the state argument should be start': function (error, monitor, state) {
        assert.ifError(error);
        assert.equal(state, 'start');
      }
    },

    'and process event has emitted': {
      topic: function (monitor) {
        var self = this;
        monitor.once('process', function (state) {
          self.callback(null, monitor, state);
        });
      },

      'the pid informations should be updated': function (error, monitor) {
        assert.ifError(error);

        // Since montor.ready hasn't been executed
        assert.isNumber(monitor.pid.process);
        assert.isTrue(common.isAlive(monitor.pid.process));

        // The daemon process should be alive
        assert.isNumber(monitor.pid.daemon);
        assert.isTrue(common.isAlive(monitor.pid.daemon));

        // The pump process should be alive
        assert.isNumber(monitor.pid.monitor);
        assert.isTrue(common.isAlive(monitor.pid.monitor));
      },

      'the state argument should be start': function (error, monitor, state) {
        assert.ifError(error);
        assert.equal(state, 'start');
      }
    }
  }

}).addBatch({

  'when the child process stops': {
    topic: function () {
      process.nextTick(function () {
        process.kill(monitor.pid.process, 'SIGTERM');
      });
      this.callback(null, monitor);
    },

    'the process event should emit': {
      topic: function (monitor) {
        var self = this;
        monitor.once('process', function (state) {
          self.callback(null, monitor, state);
        });
      },

      'the state shoud be stop': function (error, monitor, state) {
        assert.ifError(error);
        assert.equal(state, 'stop');
      },

      'the process pid should be null': function (error, monitor) {
        assert.ifError(error);
        assert.isNull(monitor.pid.process);
      },

      'and': {
        topic: function (monitor) {
          var self = this;
          var listen = function (state) {
            self.callback(null, monitor, false, state);
          };
          monitor.once('process', listen);
          setTimeout(function () {
            monitor.removeListener('process', listen);
            self.callback(null, monitor, true, null);
          }, 500);
        },

        'there should be no restart': function (error, monitor, fake, state) {
          assert.ifError(error);
          assert.isTrue(fake);
          assert.isNull(state);
        }
      }
    }
  }

}).addBatch({

  'when the child process restarts manually': {
    topic: function () {
      var self = this;
      monitor.restart();

      monitor.once('process', function (state) {
        self.callback(null, monitor, state);
      });
    },

    'the state should be restart': function (error, monitor, state) {
      assert.ifError(error);
      assert.equal(state, 'restart');
    },

    'the pid information should match': function (error, monitor) {
      assert.ifError(error);
      assert.isNumber(monitor.pid.process);
      assert.isTrue(common.isAlive(monitor.pid.process));
    }
  }

}).addBatch({

  'when the pump process stops': {
    topic: function () {
      var self = this;
      var pids = common.copy(monitor.pid);

      setTimeout(function () {
        process.kill(monitor.pid.monitor, 'SIGTERM');
      }, 200);

      monitor.once('reconnect', function () {
        self.callback(null, monitor, pids);
      });
    },

    'the montor RPC sever should restart': function (error, monitor) {
      assert.ifError(error);
    },

    'the daemon process should stil be alive': function (error, monitor, pids) {
      assert.ifError(error);

      assert.isNumber(pids.daemon);
      assert.isTrue(common.isAlive(pids.daemon));
    },

    'the old monitor process should be dead': function (error, monitor, pids) {
      assert.ifError(error);

      assert.isNumber(pids.monitor);
      assert.isFalse(common.isAlive(pids.monitor));
    },

    'the old child process should be dead': function (error, monitor, pids) {
      assert.ifError(error);

      assert.isNumber(pids.process);
      assert.isFalse(common.isAlive(pids.process));
    }
  }

}).addBatch({

  'when montor.ready is executed again': {
    topic: function () {
      monitor.ready();
      this.callback(null, monitor);
    },

    'the process event': {
      topic: function (monitor) {
        var self = this;
        monitor.once('process', function (state) {
          self.callback(null, monitor, state);
        });
      },

      'should emit with a restart state': function (error, monitor, state) {
        assert.ifError(error);
        assert.equal(state, 'restart');
      }
    },

    'the monitor event': {
      topic: function (monitor) {
        var self = this;
        monitor.once('monitor', function (state) {
          self.callback(null, monitor, state);
        });
      },

      'should emit with a restart state': function (error, monitor, state) {
        assert.ifError(error);
        assert.equal(state, 'restart');
      }
    }
  }

}).addBatch({

  'when the daemon process stops': {
    topic: function () {
      var self = this;
      var pids = common.copy(monitor.pid);
      process.nextTick(function () {
        process.kill(monitor.pid.daemon, 'SIGTERM');
      });

      monitor.once('reconnect', function () {
        self.callback(null, monitor, pids);
      });
    },

    'the montor RPC sever should restart': function (error, monitor) {
      assert.ifError(error);
    },

    'the old daemon process should be dead': function (error, monitor, pids) {
      assert.ifError(error);

      assert.isNumber(pids.daemon);
      assert.isFalse(common.isAlive(pids.daemon));
    },

    'the old monitor process should be dead': function (error, monitor, pids) {
      assert.ifError(error);

      assert.isNumber(pids.monitor);
      assert.isFalse(common.isAlive(pids.monitor));
    },

    'the old child process should be dead': function (error, monitor, pids) {
      assert.ifError(error);

      assert.isNumber(pids.process);
      assert.isFalse(common.isAlive(pids.process));
    }
  }

}).addBatch({

  'when montor.ready is executed again': {
    topic: function () {
      monitor.ready();
      this.callback(null, monitor);
    },

    'the daemon event': {
      topic: function (monitor) {
        var self = this;
        monitor.once('daemon', function (state) {
          self.callback(null, monitor, state);
        });
      },

      'should emit with a restart state': function (error, monitor, state) {
        assert.ifError(error);
        assert.equal(state, 'restart');
      }
    },

    'the process event': {
      topic: function (monitor) {
        var self = this;
        monitor.once('process', function (state) {
          self.callback(null, monitor, state);
        });
      },

      'should emit with a restart state': function (error, monitor, state) {
        assert.ifError(error);
        assert.equal(state, 'restart');
      }
    },

    'the monitor event': {
      topic: function (monitor) {
        var self = this;
        monitor.once('monitor', function (state) {
          self.callback(null, monitor, state);
        });
      },

      'should emit with a restart state': function (error, monitor, state) {
        assert.ifError(error);
        assert.equal(state, 'restart');
      }
    }
  }

}).addBatch({

  'when immortal stops': {
    topic: function () {
      var self = this;
      var pids = common.copy(monitor.pid);;
      monitor.shutdown(function () {
        monitor.close(function () {
          setTimeout(function () {
            self.callback(null, monitor, pids);
          }, 500);
        });
      });
    },

    'the immortal group should be dead': function (error, monitor, pid) {
      assert.ifError(error);

      assert.isNumber(pid.daemon);
      assert.isFalse(common.isAlive(pid.daemon));

      assert.isNumber(pid.monitor);
      assert.isFalse(common.isAlive(pid.monitor));

      assert.isNumber(pid.process);
      assert.isFalse(common.isAlive(pid.process));
    }
  }

}).exportTo(module);


text:
namespace cc {
class ScrollbarLayerBase;
}

namespace blink {

class GraphicsContext;
class TransformPaintPropertyNode;

// Represents a non-custom scrollbar in CompositeAfterPaint. During paint, we
// create a ScrollbarDisplayItem for a non-custom scrollbar. During
// PaintArtifactCompositor::Update(), we decide whether to composite the
// scrollbar and, if not composited, call Paint() to actually paint the
// scrollbar into a paint record, otherwise call CreateLayer() to create a
// cc scrollbar layer.
class PLATFORM_EXPORT ScrollbarDisplayItem final : public DisplayItem {
 public:
  ScrollbarDisplayItem(const DisplayItemClient&,
                       Type,
                       scoped_refptr<cc::Scrollbar>,
                       const IntRect& rect,
                       const TransformPaintPropertyNode* scroll_translation,
                       CompositorElementId element_id);

  const TransformPaintPropertyNode* ScrollTranslation() const {
    return scroll_translation_;
  }
  CompositorElementId ElementId() const { return element_id_; }

  // Paints the scrollbar into the internal paint record, for non-composited
  // scrollbar.
  sk_sp<const PaintRecord> Paint() const;

  // Create or reuse the cc scrollbar layer, for composited scrollbar.
  scoped_refptr<cc::ScrollbarLayerBase> CreateOrReuseLayer(
      cc::ScrollbarLayerBase* existing_layer) const;

  // DisplayItem
  bool Equals(const DisplayItem&) const override;
#if DCHECK_IS_ON()
  void PropertiesAsJSON(JSONObject&) const override;
#endif

  // Records a scrollbar into a GraphicsContext. Must check
  // PaintController::UseCachedItem() before calling this function.
  // |rect| is the bounding box of the scrollbar in the current transform space.
  static void Record(GraphicsContext&,
                     const DisplayItemClient&,
                     DisplayItem::Type,
                     scoped_refptr<cc::Scrollbar>,
                     const IntRect& rect,
                     const TransformPaintPropertyNode* scroll_translation,
                     CompositorElementId element_id);

 private:
  scoped_refptr<cc::Scrollbar> scrollbar_;
  IntRect rect_;
  const TransformPaintPropertyNode* scroll_translation_;
  CompositorElementId element_id_;
  // This is lazily created for non-composited scrollbar.
  mutable sk_sp<const PaintRecord> record_;
};

}  // namespace blink

#endif  // THIRD_PARTY_BLINK_RENDERER_PLATFORM_GRAPHICS_PAINT_SCROLLBAR_DISPLAY_ITEM_H_


text:
<?php

namespace Ozdemir\Datatables;

use Closure;
use Ozdemir\Datatables\DB\DatabaseInterface;
use Ozdemir\Datatables\Http\Request;
use Ozdemir\Datatables\Iterators\ColumnCollection;

/**
 * Class Datatables
 *
 * @package Ozdemir\Datatables
 */
class Datatables
{
    /**
     * @var DatabaseInterface
     */
    protected $db;

    /**
     * @var ColumnCollection
     */
    protected $columns;

    /**
     * @var QueryBuilder
     */
    protected $builder;

    /**
     * @var Option
     */
    protected $options;

    /**
     * Custom escapes
     * @var array
     */
    public $escapes = [];

    /**
     * @var array
     */
    protected $response;

    /**
     * @var array
     */
    protected $distinctColumn = [];

    /**
     * @var array
     */
    protected $distinctData = [];

    /**
     * Datatables constructor.
     *
     * @param DatabaseInterface $db
     * @param Request $request
     */
    public function __construct(DatabaseInterface $db, Request $request = null)
    {
        $this->db = $db->connect();
        $this->options = new Option($request ?: Request::createFromGlobals());
    }

    /**
     * @param $column
     * @param Closure $closure
     * @return Datatables
     */
    public function add($column, Closure $closure): Datatables
    {
        $column = new Column($column);
        $column->closure = $closure;
        $column->interaction = false;
        $this->columns->append($column);

        return $this;
    }

    /**
     * @param $column
     * @param Closure $closure
     * @return Datatables
     */
    public function edit($column, Closure $closure): Datatables
    {
        $column = $this->columns->getByName($column);
        $column->closure = $closure;

        return $this;
    }

    /**
     * @param $column
     * @param Closure $closure
     * @return Datatables
     */
    public function filter($column, Closure $closure): Datatables
    {
        $column = $this->columns->getByName($column);
        $column->customFilter = $closure;

        return $this;
    }

    /**
     * @param string $key
     * @param string $value
     * @return Datatables
     */
    public function escape($key, $value): Datatables
    {
        $this->escapes[$key] = $value;

        return $this;
    }

    /**
     * @param $name
     * @return Datatables
     */
    public function setDistinctResponseFrom($name): Datatables
    {
        $this->distinctColumn[] = $name;

        return $this;
    }

    /**
     * @param $array
     * @return Datatables
     */
    public function setDistinctResponse($array): Datatables
    {
        $this->distinctData = $array;

        return $this;
    }

    /**
     * @return array
     */
    public function getColumns(): array
    {
        return $this->columns->names();
    }

    /**
     * @return Query
     */
    public function getQuery(): Query
    {
        return $this->builder->full;
    }

    /**
     * @param string $column
     * @return Datatables
     */
    public function hide(string $column, $searchable = false): Datatables
    {
        $this->columns->getByName($column)->hide($searchable);

        return $this;
    }

    /**
     * @param string $query
     * @return Datatables
     */
    public function query($query): Datatables
    {
        $this->builder = new QueryBuilder($query, $this->options, $this->db);
        $this->columns = $this->builder->columns();

        return $this;
    }

    /**
     * @return Datatables
     */
    public function generate(): Datatables
    {
        $this->builder->setColumnAttributes();
        $this->builder->setFilteredQuery();
        $this->builder->setFullQuery();
        $this->builder->setEscapes($this->escapes);

        $this->setResponseData();

        return $this;
    }

    /**
     * @return array
     */
    protected function getData(): array
    {
        $data = $this->db->query($this->builder->full);

        return array_map([$this, 'prepareRowData'], $data);
    }

    /**
     * @param $row
     * @return array
     */
    protected function prepareRowData($row): array
    {
        $keys = $this->builder->isDataObject() ? $this->columns->names() : array_keys($this->columns->names());

        $values = array_map(function (Column $column) use ($row) {
            return $column->value($row);
        }, $this->columns->visible()->getArrayCopy());

        return array_combine($keys, $values);
    }

    /**
     * @return array
     */
    private function getDistinctData(): array
    {
        foreach ($this->distinctColumn as $column) {
            $output[$column] = array_column($this->db->query($this->builder->getDistinctQuery($column)), $column);
        }

        return $output ?? [];
    }

    /**
     *
     */
    public function setResponseData(): void
    {
        $this->response['draw'] = $this->options->draw();
        $this->response['recordsTotal'] = $this->db->count($this->builder->query);

        if($this->builder->query->sql === $this->builder->filtered->sql) {
            $this->response['recordsFiltered'] = $this->response['recordsTotal'];
        } else {
            $this->response['recordsFiltered'] = $this->db->count($this->builder->filtered);
        }

        $this->response['data'] = $this->getData();

        if (\count($this->distinctColumn) > 0 || \count($this->distinctData) > 0) {
            $this->response['distinctData'] = array_merge($this->response['distinctData'] ?? [],
                $this->getDistinctData(), $this->distinctData);
        }
    }

    /**
     * @return string
     */
    public function __toString()
    {
        return $this->toJson();
    }

    /**
     * @return string
     */
    public function toJson(): string
    {
        header('Content-type: application/json;');

        return json_encode($this->response, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_AMP | JSON_HEX_QUOT);
    }

    /**
     * @return array
     */
    public function toArray(): array
    {
        return $this->response;
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<panel title="Minima 1.4">
	<item type="checkBox" name="autoSlideshow">
		<title><![CDATA[AutoSlideshow]]></title>
		<description><![CDATA[]]></description>
		<selected>true</selected>
	</item>
	<item type="numericSteper" name="slideshowDelay">
		<title><![CDATA[Slideshow Delay]]></title>
		<description><![CDATA[]]></description>
		<maximum>30</maximum>
		<minimum>0</minimum>
		<stepSize>1</stepSize>
		<value>10</value>
	</item>
	<item type="numericSteper" name="thumbnailsHeight">
		<title><![CDATA[Thumbnail Height]]></title>
		<description><![CDATA[]]></description>
		<maximum>300</maximum>
		<minimum>40</minimum>
		<stepSize>1</stepSize>
		<value>75</value>
	</item>
	<item type="numericSteper" name="thumbnailsWidth">
		<title><![CDATA[Thumbnail Width]]></title>
		<description><![CDATA[]]></description>
		<maximum>300</maximum>
		<minimum>40</minimum>
		<stepSize>1</stepSize>
		<value>75</value>
	</item>
	<item type="comboBox" name="property0">
		<title><![CDATA[Flash Object WMode]]></title>
		<description><![CDATA[If 'transparent' - "Background Color" option is ignored, but you can position the absolute elements over the flash.]]></description>
		<data>
			<![CDATA[window]]>
			<![CDATA[transparent]]>
			<![CDATA[opaque]]>
		</data>
		<prompt><![CDATA[]]></prompt>
		<rowCount>3</rowCount>
		<value><![CDATA[opaque]]></value>
	</item>
	<item type="checkBox" name="swfmousewheel">
		<title><![CDATA[SWF Mouse Wheel]]></title>
		<description><![CDATA[Turn On/Off mouse wheel detection over Gallery.]]></description>
		<selected>false</selected>
	</item>
	<item type="colorPicker" name="property1">
		<title><![CDATA[Background Color]]></title>
		<description><![CDATA[]]></description>
		<showTextField>true</showTextField>
	<selectedColor>0xffffff</selectedColor>
	</item>
	<item type="checkBox" name="counterStatus">
		<title><![CDATA[Show image views/likes counter]]></title>
		<selected>true</selected>
	</item>
	<item type="colorPicker" name="barBgColor">
		<title><![CDATA[Header & Footer Background Color]]></title>
	<description><![CDATA[]]></description>
		<showTextField>true</showTextField>
		<selectedColor>0x282828</selectedColor>
	</item>
	<item type="colorPicker" name="labelColor">
		<title><![CDATA[Label Color (Buttons)]]></title>
		<description><![CDATA[]]></description>
		<showTextField>true</showTextField>
	<selectedColor>0x75c30f</selectedColor>
	</item>
	<item type="colorPicker" name="labelColorOver">
	<title><![CDATA[Label MouseOver Color (Buttons)]]></title>
		<description><![CDATA[]]></description>
		<showTextField>true</showTextField>
		<selectedColor>0xffffff</selectedColor>
	</item>
	<item type="colorPicker" name="backgroundColorButton">
		<title><![CDATA[Background Color (Buttons)]]></title>
		<description><![CDATA[]]></description>
		<showTextField>true</showTextField>
		<selectedColor>0x000000</selectedColor>
	</item>
	<item type="colorPicker" name="descriptionBGColor">
		<title><![CDATA[Description BG Color]]></title>
		<description><![CDATA[Background for the image description that appears on mouseover.]]></description>
		<showTextField>true</showTextField>
		<selectedColor>0x000000</selectedColor>
	</item>
	<item type="slider" name="descriptionBGAlpha">
		<title><![CDATA[Description BG Alpha]]></title>
		<description><![CDATA[Opacity of the image description background.]]></description>
		<maximum>100</maximum>
		<minimum>0</minimum>
		<snapInterval>5</snapInterval>
		<tickInterval>5</tickInterval>
		<value>75</value>
	</item>
	<item type="colorPicker" name="imageTitleColor">
		<title><![CDATA[Image Title Color]]></title>
		<description><![CDATA[Color of text for image title in the description.]]></description>
		<showTextField>true</showTextField>
		<selectedColor>0x75c30f</selectedColor>
	</item>
	<item type="numericSteper" name="galleryTitleFontSize">
		<title><![CDATA[Gallery Title Font Size]]></title>
		<description><![CDATA[]]></description>
		<maximum>30</maximum>
		<minimum>10</minimum>
		<stepSize>1</stepSize>
		<value>15</value>
	</item>
	<item type="numericSteper" name="titleFontSize">
		<title><![CDATA[Image Title Font Size]]></title>
		<description><![CDATA[]]></description>
		<maximum>30</maximum>
		<minimum>10</minimum>
		<stepSize>1</stepSize>
		<value>12</value>
	</item>
	<item type="colorPicker" name="imageDescriptionColor">
		<title><![CDATA[Image Description Color (Text)]]></title>
		<description><![CDATA[Color of text for image description.]]></description>
		<showTextField>true</showTextField>
		<selectedColor>0xffffff</selectedColor>
	</item>
	<item type="numericSteper" name="descriptionFontSize">
		<title><![CDATA[Image Description Font Size]]></title>
		<description><![CDATA[]]></description>
		<maximum>30</maximum>
		<minimum>10</minimum>
		<stepSize>1</stepSize>
		<value>12</value>
	</item>
	<item type="colorPicker" name="linkColor">
		<title><![CDATA[Link Color (image description)]]></title>
		<description><![CDATA[]]></description>
		<showTextField>true</showTextField>
		<selectedColor>0xffffff</selectedColor>
	</item>
	<item type="colorPicker" name="backButtonColorText">
		<title><![CDATA[Back Button Text Color]]></title>
		<description><![CDATA[Full Window Gallery Template.]]></description>
		<showTextField>true</showTextField>
		<selectedColor>0xffffff</selectedColor>
	</item>
	<item type="colorPicker" name="backButtonColorBg">
		<title><![CDATA[Back Button BG Color]]></title>
		<description><![CDATA[Full Window Gallery Template.]]></description>
		<showTextField>true</showTextField>
		<selectedColor>0x000000</selectedColor>
	</item>
    <item type="checkBox" name="showAlternate">
        <title><![CDATA[Show Alternative JS Gallery instead of Flash]]></title>
        <description><![CDATA[This option is just if you want to see how the gallery looks on browsers without flash support]]></description>
        <selected>false</selected>
    </item>
<properties>
  <property0><![CDATA[opaque]]></property0>
  <swfmousewheel>false</swfmousewheel>
  <property1>0xffffff</property1>
  <slideshowDelay>10</slideshowDelay>
  <thumbnailsHeight>75</thumbnailsHeight>
  <thumbnailsWidth>75</thumbnailsWidth>
  <showDownload>true</showDownload>
  <autoSlideshow>true</autoSlideshow>
  <labelColor>0x75c30f</labelColor>
  <labelColorOver>0xffffff</labelColorOver>
  <backgroundColorButton>0x000000</backgroundColorButton>
  <thumbnailBGColor>0xffffff</thumbnailBGColor>
  <property12>0x75c30f</property12>
  <descriptionBGColor>0x000000</descriptionBGColor>
  <descriptionBGAlpha>75</descriptionBGAlpha>
  <imageTitleColor>0x75c30f</imageTitleColor>
  <imageDescriptionColor>0xffffff</imageDescriptionColor>
  <backButtonColorText>0xffffff</backButtonColorText>
  <backButtonColorBg>0x000000</backButtonColorBg>
  <barBgColor>0x282828</barBgColor>
  <titleFontSize>12</titleFontSize>
  <galleryTitleFontSize>15</galleryTitleFontSize>
  <linkColor>0xffffff</linkColor>
  <descriptionFontSize>12</descriptionFontSize>
  <counterStatus>true</counterStatus>
  <showAlternate>true</showAlternate>
</properties>

</panel>


text:
<resources xmlns:android="http://schemas.android.com/apk/res/android">

    <!-- Base application theme. -->
    <style name="AppTheme" parent="android:Theme.Holo.Light.DarkActionBar">
        <!-- Customize your theme here. -->
    </style>

    <style name="NameTitle" parent="@android:style/TextAppearance.Medium">
        <item name="android:textColor">#000000</item>
        <item name="android:textStyle">bold</item>
    </style>

    <style name="heartRating">
        <item name="android:textColor">@color/bbutton_primary</item>
    </style>

    <style name="heartButton">
        <item name="android:textColor">@color/bbutton_info</item>
    </style>

</resources>


text:
package br.com.objectos.code.pojo;

import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;

import javax.lang.model.element.Modifier;

import br.com.objectos.core.testing.Testables;

import com.google.common.collect.ImmutableList;
import com.squareup.javapoet.CodeBlock;
import com.squareup.javapoet.MethodSpec;
import com.squareup.javapoet.ParameterSpec;
import com.squareup.javapoet.TypeName;

/**
 * @author marcio.endo@objectos.com.br (Marcio Endo)
 */
class SimpleTestable implements IsTestable {

  final Naming naming;
  final TypeName testableOf;

  public SimpleTestable(Naming naming, TypeName testableOf) {
    this.naming = naming;
    this.testableOf = testableOf;
  }

  @Override
  public final Optional<MethodSpec> get(List<AttributeMethod> attributeMethodList) {
    List<CodeBlock> header = header();
    List<CodeBlock> body = body(attributeMethodList);
    return body.isEmpty()
        ? Optional.<MethodSpec> empty()
        : Optional.of(isEqual(header, body));
  }

  List<CodeBlock> header() {
    return ImmutableList.of();
  }

  List<CodeBlock> body(List<AttributeMethod> attributeMethodList) {
    return attributeMethodList.stream()
        .map(AttributeMethod::testableBody)
        .collect(Collectors.toList());
  }

  String parameterName() {
    return "that";
  }

  private MethodSpec isEqual(List<CodeBlock> header, List<CodeBlock> body) {
    MethodSpec.Builder b = MethodSpec.methodBuilder("isEqual")
        .addModifiers(Modifier.PUBLIC)
        .addAnnotation(Override.class)
        .returns(boolean.class)
        .addParameter(parameterSpec());

    for (CodeBlock code : header) {
      b.addCode(code);
    }

    b.addCode("return $T.isEqualHelper()\n", testablesClass());
    for (CodeBlock code : body) {
      b.addCode(code);
    }
    b.addStatement("    .result()");

    return b.build();
  }

  Class<?> testablesClass() {
    return Testables.class;
  }

  private ParameterSpec parameterSpec() {
    return ParameterSpec.builder(testableOf, parameterName()).build();
  }

}