text:
package com.amazonaws.services.ecs.model.transform;

import static com.amazonaws.util.StringUtils.UTF8;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.OutputStreamWriter;
import java.io.StringWriter;
import java.io.Writer;
import java.util.Map;
import java.util.List;

import com.amazonaws.AmazonClientException;
import com.amazonaws.services.ecs.model.*;
import com.amazonaws.transform.Marshaller;
import com.amazonaws.util.BinaryUtils;
import com.amazonaws.util.StringUtils;
import com.amazonaws.util.IdempotentUtils;
import com.amazonaws.util.StringInputStream;
import com.amazonaws.util.json.*;

/**
 * MountPointMarshaller
 */
public class MountPointJsonMarshaller {

    /**
     * Marshall the given parameter object, and output to a SdkJsonGenerator
     */
    public void marshall(MountPoint mountPoint, SdkJsonGenerator jsonGenerator) {
        if (mountPoint == null) {
            throw new AmazonClientException(
                    "Invalid argument passed to marshall(...)");
        }

        try {
            jsonGenerator.writeStartObject();

            if (mountPoint.getSourceVolume() != null) {
                jsonGenerator.writeFieldName("sourceVolume").writeValue(
                        mountPoint.getSourceVolume());
            }
            if (mountPoint.getContainerPath() != null) {
                jsonGenerator.writeFieldName("containerPath").writeValue(
                        mountPoint.getContainerPath());
            }
            if (mountPoint.getReadOnly() != null) {
                jsonGenerator.writeFieldName("readOnly").writeValue(
                        mountPoint.getReadOnly());
            }

            jsonGenerator.writeEndObject();
        } catch (Throwable t) {
            throw new AmazonClientException(
                    "Unable to marshall request to JSON: " + t.getMessage(), t);
        }
    }

    private static MountPointJsonMarshaller instance;

    public static MountPointJsonMarshaller getInstance() {
        if (instance == null)
            instance = new MountPointJsonMarshaller();
        return instance;
    }

}


text:
<!DOCTYPE html>

    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
    <meta charset="utf-8"/>
    <title>    LOG_PHP_SDK » \Aliyun_Log_Models_RemoveConfigFromMachineGroupResponse
</title>
    <meta name="author" content=""/>
    <meta name="description" content=""/>

            <link href="../css/template.css" rel="stylesheet" media="all"/>

            <link rel="shortcut icon" href="../img/favicon.ico"/>
        <link rel="apple-touch-icon" href="../img/apple-touch-icon.png"/>
        <link rel="apple-touch-icon" sizes="72x72" href="../img/apple-touch-icon-72x72.png"/>
        <link rel="apple-touch-icon" sizes="114x114" href="../img/apple-touch-icon-114x114.png"/>

                LOG_PHP_SDK

                                API Documentation

                                Charts

                                         Class hierarchy diagram

                                Reports

                                         Errors

                                         Markers

                                         Deprecated

            Back to top

                Javascript is disabled; several features are only available if Javascript is enabled.

        <button class="btn details" title="Show descriptions and method names"></button>
        <button class="btn simple" title="Show only method names"></button>

        <button class="btn public active" title="Show public elements">Public</button>
        <button class="btn protected" title="Show protected elements">Protected</button>
        <button class="btn private" title="Show private elements">Private</button>
        <button class="btn inherited active" title="Show inherited elements">Inherited</button>

             Methods

            Aliyun_Log_Models_Response constructor
__construct

            Get all http headers
getAllHeaders

            Get specified http header
getHeader

            Get the request id of the response. '' will be return if not set.
getRequestId

» Protected

» Private

             Constants

Aliyun_Log_Models_RemoveConfigFromMachineGroupResponse

                                            Extends \Aliyun_Log_Models_Response

The response of the GetLog API from log service.

                                        author

log service dev

                                        package

LOG_PHP_SDK

 Methods

Aliyun_Log_Models_Response constructor

__construct( $headers)

                                inherited

Arguments

$headers

Get all http headers

getAllHeaders() : array

                                inherited

Response

                                        array

HTTP response header

Get specified http header

getHeader(string $key) : string

                                inherited

Arguments

$key

                                                string

key to get header

Response

                                        string

HTTP response header. '' will be return if not set.

Get the request id of the response. '' will be return if not set.

getRequestId() : string

                                inherited

Response

                                        string

request id

 Properties

HTTP response header

headers : array

                                    inherited

                                                        var

HTTP response header

Type(s)

                                            array

\\

\Aliyun_Log_Models_RemoveConfigFromMachineGroupResponse

            Template is built using Twitter Bootstrap 2 and icons provided by
            Glyphicons.

            Documentation is powered by phpDocumentor  and

            generated on Mon, 18 Jan 2016 11:31:12 +0800.

redpajama_set_name: RedPajamaGithub


text:
@extends('layout')

@section('content')

Créer un tournoi

		@if ($errors->any() || isset($customErrors))

				@if ($errors->any())
		            @foreach ($errors->all() as $error)
		                {{ $error }}

		            @endforeach
		        @endif
		        @if (isset($customErrors))
		        	@foreach ($customErrors as $customError)
		                {{ $customError }}

		            @endforeach
		        @endif

        @endif

		{{ Form::open(array('url' => route('events.tournaments.store', $eventId), 'method' => 'post', 'class' => 'add', 'id' => 'formTournament', 'enctype' => 'multipart/form-data')) }}

				{{ Form::label('name', 'Nom') }}
				{{ Form::text('name', null, array('class' => 'form-control')) }}

				{{ Form::label('Sport', 'Sport') }}
				{{ Form::select('sport', array('Avec terrains' => $dropdownListSportsWithCourt, 'Sans terrains' => $dropdownListSportsWithNoCourt), null, array('placeholder' => 'Sélectionner', 'class' => 'allSameStyle form-control', 'id' => 'sport')) }}

				{{ Form::label('startDate', 'Date de début') }}
				{{ Form::date('startDate', \Carbon\Carbon::now(), array('class' => 'allSameStyle form-control')) }}

				{{ Form::label('startTime', 'Heure de début') }}
				{{ Form::text('startTime', null, array('placeholder' => 'hh:mm', 'class'=>'form-control')) }}

				{{ Form::label('endTime', 'Heure de fin') }}
				{{ Form::text('endTime', null, array('placeholder' => 'hh:mm', 'class'=>'form-control')) }}

				{{ Form::label('maxTeams', 'Nombre max d\'equipes') }}
				{{ Form::text('maxTeams', null, array('class'=>'form-control')) }}

				{{ Form::label('teams', 'Équipes participantes') }}
				{{ Form::select('teams[]', $dropdownListTeams, null, array('class' => 'allSameStyle form-control', 'id' => 'multiple-teams-select', 'multiple')) }}

				{{ Form::label('img', 'Image') }}
				{{ Form::file('img', null) }}

{{ Form::button('Créer', array('class' => 'btn btn-success formSend')) }}

		{{ Form::close() }}

@stop


text:
package edu.ucdenver.ccp.nlp.core.mention.impl;

import java.util.Collection;
import java.util.Collections;
import java.util.List;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import edu.ucdenver.ccp.nlp.core.mention.BooleanSlotMention;
import edu.ucdenver.ccp.nlp.core.mention.FloatSlotMention;
import edu.ucdenver.ccp.nlp.core.mention.IntegerSlotMention;
import edu.ucdenver.ccp.nlp.core.mention.InvalidInputException;
import edu.ucdenver.ccp.nlp.core.mention.PrimitiveSlotMention;
import edu.ucdenver.ccp.nlp.core.mention.StringSlotMention;

/**
 * @author Colorado Computational Pharmacology, UC Denver; ccpsupport@ucdenver.edu
 *
 */
public class DefaultPrimitiveSlotMentionFactory {

	private static Logger logger = LogManager.getLogger(DefaultPrimitiveSlotMentionFactory.class);

	public static PrimitiveSlotMention createPrimitiveSlotMention(
		String slotMentionName,
		String slotValue)
	throws InvalidInputException {
		logger.debug("Creating String primitive slot with value type: " + slotValue.getClass().getName());
		StringSlotMention sm = new DefaultStringSlotMention(slotMentionName);
		sm.addSlotValue(slotValue);
		return sm;
	}

	public static PrimitiveSlotMention createPrimitiveSlotMention(
		String slotMentionName,
		Integer slotValue)
	throws InvalidInputException {
		logger.debug("Creating Integer primitive slot with value type: " + slotValue.getClass().getName());
		IntegerSlotMention sm = new DefaultIntegerSlotMention(slotMentionName);
		sm.addSlotValue(slotValue);
		return sm;
	}
	public static PrimitiveSlotMention createPrimitiveSlotMention(
		String slotMentionName,
		Boolean slotValue)
	throws InvalidInputException {
		logger.debug("Creating Boolean primitive slot with value type: " + slotValue.getClass().getName());
		BooleanSlotMention sm = new DefaultBooleanSlotMention(slotMentionName);
		sm.addSlotValue(slotValue);
		return sm;
	}
	public static PrimitiveSlotMention createPrimitiveSlotMention(
		String slotMentionName,
		Float slotValue)
	throws InvalidInputException {
		logger.debug("Creating Float primitive slot with value type: " + slotValue.getClass().getName());
		FloatSlotMention sm = new DefaultFloatSlotMention(slotMentionName);
		sm.addSlotValue(slotValue);
		return sm;
	}

	/* Type Erasure in Java Generics prevents this from being a single function name
      overloaded 4 times.
    */
	public static PrimitiveSlotMention createPrimitiveSlotMentionWithStringCollection(
			String slotMentionName,
			Collection<String> values)
	throws InvalidInputException {
		logger.debug("Creating PrimitiveSlot from Collection...");
		StringSlotMention sm = new DefaultStringSlotMention(slotMentionName);
		for (String s : values) {
			sm.addSlotValue(s);
		}
		return sm;
	}

	public static PrimitiveSlotMention createPrimitiveSlotMentionWithFloatCollection(
			String slotMentionName,
			Collection<Float> values)
	throws InvalidInputException {
		logger.debug("Creating PrimitiveSlot from Collection...");
		FloatSlotMention sm = new DefaultFloatSlotMention(slotMentionName);
		for (Float f : values) {
			sm.addSlotValue(f);
		}
		return sm;
	}

	public static PrimitiveSlotMention createPrimitiveSlotMentionWithIntegerCollection(
			String slotMentionName,
			Collection<Integer> values)
	throws InvalidInputException {
		logger.debug("Creating PrimitiveSlot from Collection...");
		IntegerSlotMention sm = new DefaultIntegerSlotMention(slotMentionName);
		for (Integer i : values) {
			sm.addSlotValue(i);
		}
		return sm;
	}

	public static PrimitiveSlotMention createPrimitiveSlotMentionWithBooleanCollection(
			String slotMentionName,
			Collection<Boolean> values)
	throws InvalidInputException {
		logger.debug("Creating PrimitiveSlot from Collection...");
		BooleanSlotMention sm = new DefaultBooleanSlotMention(slotMentionName);
		for (Boolean b : values) {
			sm.addSlotValue(b);
		}
		return sm;
	}

	/**
	 * Tries to parse the string as one of the other primitives first. Defaults to Float if it is a
	 * number.
	 *
	 * @param slotMentionName
	 * @param slotValueAsString
	 * @return
	 * @throws InvalidInputException
	 */
	public static PrimitiveSlotMention createPrimitiveSlotMentionFromStringValue(String slotMentionName,
			String slotValueAsString) throws InvalidInputException {
		slotValueAsString = slotValueAsString.trim();
		try {
			Integer integerSlotValue = Integer.parseInt(slotValueAsString);
			return createPrimitiveSlotMention(slotMentionName, integerSlotValue);
		} catch (Exception e1) {
			try {
				if (slotValueAsString.equalsIgnoreCase("true") | slotValueAsString.equalsIgnoreCase("false")) {
					Boolean booleanSlotValue = Boolean.parseBoolean(slotValueAsString);
					return createPrimitiveSlotMention(slotMentionName, booleanSlotValue);
				}
				throw new Exception();
			} catch (Exception e2) {
				try {
					Float floatSlotValue = Float.parseFloat(slotValueAsString);
					return createPrimitiveSlotMention(slotMentionName, floatSlotValue);
				} catch (Exception e3) {
					return createPrimitiveSlotMention(slotMentionName, slotValueAsString);
				}
			}
		}

	}

}


text:
#import <Foundation/Foundation.h>
#import "cocos2d.h"
#import "nt_alertview.h"

@interface CreditsAlert : nt_alertview
{
  UITapGestureRecognizer * m_tap;
}

- (void)showEasterEgg;

@end


text:
/*
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
*/
/*
    Created on : 21 Sep, 2015, 1:24:07 AM
    Author     : vrushal
*/
@import "http://fonts.googleapis.com/css?family=Droid+Serif";
/* The Above Line Is To Import Google Font Style */

.maindiv{
    border-style:dashed;
    border-color: red;
    width: 30%;
    text-align: left;
    padding-top: 20px;

}

form h2 {
text-align:center;
text-shadow:2px 2px 2px #cfcfcf;

}

.title{
    background-color: azure;

}
.maindiv{
    background-color: skyblue;

}

.maindiv,.title,.form_div{
   font-family: fantasy;
}

form {

background-color:#f0f8ff
}
body{

}
.input{
    //padding-left: 50px;
   // padding: 1px;
}

label{
    padding-left: 10px;
}

.submit{
    background-color: plum;
    text-align:center;

}
.red{
    color: red;

}

.comsize{
    font-size: 30;
}


text:
'use strict'

require('pkginfo')(module)

function versionIndexTemplate(path) {
    return {
        options: {
            data: {
                path: path
            }
        },
        files: {
            'doc/generated/tutorials/VersionIndex.md': ['doc/generator/VersionIndex.md.tpl'],
        }
    }
}

function branchDocumentationTasks(target) {
    const version = exports.version,
        name = exports.name
        target = target || version
    const path = `doc/generated/versions/${target}`

    return {
        jsdoc: {
            src: ['*.js', 'lib/'],
            options: {
                configure: 'doc/generator/jsdoc.json',
                recurse: true,
                encoding: 'utf8',
                destination: path,
                package: 'package.json',
                template : 'node_modules/ink-docstrap/template',
                readme: 'README.md',
                tutorials: 'doc/generated/tutorials/'
            }
        },
        copy: {
            cwd: `${path}/${name}/${target}`,
            expand: true,
            src: '**',
            dest: path,
        },
        clean: [`${path}/${name}/`],
        push: {
            options: {
                base: 'doc/generated',
                add: true,
                message: `Generated on <%= grunt.template.today('yyyy-mm-dd HH:MM') %> (doc: ${target} pkg: ${version})`,
            },
            src: ['**']
        }
    }
}

module.exports = function(grunt) {
    const docTasksCurrent = branchDocumentationTasks(),
        docTasksMaster = branchDocumentationTasks('master')

    grunt.loadNpmTasks('grunt-mocha-test')
    grunt.loadNpmTasks('grunt-jsdoc')
    grunt.loadNpmTasks('grunt-contrib-clean')
    grunt.loadNpmTasks('grunt-gh-pages')
    grunt.loadNpmTasks('grunt-contrib-copy')
    grunt.loadNpmTasks('grunt-template')

    grunt.initConfig({
        pkg: exports,
        template: {
            'index-root': versionIndexTemplate('./'),
            'index-version': versionIndexTemplate('../../')
        },
        clean: {
          'doc-all': ['doc/generated'],
          'doc-tutorials': ['doc/generated/tutorials'],
          'doc-master':  docTasksMaster.clean,
          'doc-current-version': docTasksCurrent.clean
        },
        copy: {
            'doc-master': docTasksMaster.copy,
            'doc-current-version': docTasksCurrent.copy,
            'doc-index': {
                cwd: 'doc/tutorials',
                expand: true,
                src: ['*.md', 'tutorials.json'],
                dest: 'doc/generated/tutorials/',
            }
        },
        jsdoc: {
            master: docTasksMaster.jsdoc,
            'current-version': docTasksCurrent.jsdoc,
            index: {
                src: ['doc/generator/index-placeholder.jsdoc'],
                options: {
                    configure: 'doc/generator/jsdoc.json',
                    recurse: false,
                    encoding: 'utf8',
                    destination: 'doc/generated',
                    template : 'node_modules/ink-docstrap/template',
                    readme: 'doc/generated/tutorials/VersionIndex.md',
                    tutorials: 'doc/generated/tutorials/'
                }
            }
        },
        'gh-pages': {
            master: docTasksMaster.push,
            'current-version': docTasksCurrent.push
        },
        mochaTest: {
            options: {
                reporter: 'spec',
                // Clear the require cache, since we enable/disable integrations via require.
                clearRequireCache: true
            },
            unit: {
                options: {
                    require: () => {
                        delete global._ZB_INTEGRATION_TEST
                    }
                },
                src: ['test/**/*.js']
            },
            integration: {
                options: {
                    require: () => {
                        global._ZB_INTEGRATION_TEST = true
                    }
                },
                src: ['test/**/*.js']
            }
        }
    })

    grunt.registerTask('doc:index', [
        // Remove all generated files.
        'clean:doc-all',
        // Render the version index template for the root (no relative links).
        // This has the beneficial side effect of creating the doc target
        // directory, `doc/generated` and `doc/generated/tutorials`.
        'template:index-root',
        // Copy the tutorials and their config file into `doc/generated/tutorials`.
        'copy:doc-index',
        // Generate documentation for an empty project (`index-placeholder.jsdoc`)
        // using the version index template as the README. This makes a decent
        // landing page without having to manually write any markup or menus.
        // Laziness trumps elegance.
        'jsdoc:index',
        // Re-render the version index template (it's no longer needed for the
        // landing page generation) with relative links that can be used by the
        // per-version documentation.
        'template:index-version'
    ])
    grunt.registerTask('doc:master', [
        'doc:index',
        'jsdoc:master',
        'copy:doc-master',
        'clean:doc-master',
        'clean:doc-tutorials'
    ])
    grunt.registerTask('doc:current-version', [
        'doc:index',
        'jsdoc:current-version',
        'copy:doc-current-version',
        'clean:doc-current-version',
        'clean:doc-tutorials'
    ])
    grunt.registerTask('doc:master:push', [
        'doc:master',
        'gh-pages:master',
        'clean:doc-all'
    ])
    grunt.registerTask('doc:current-version:push', [
        'doc:current-version',
        'gh-pages:current-version',
        'clean:doc-all'
    ])
    grunt.registerTask('test:unit', 'mochaTest:unit')
    grunt.registerTask('test:integration', 'mochaTest:integration')
}


text:
(function($) {

	$.fn.more_less = function(options) {

		var self = this;
		var o    = $.extend({
			max_height: 100,
			innner_wrap_classname: 'inner-wrap',
			link_wrap_classname: 'link-wrap',
			hidden_state_classname: 'hidden',
			more_link_text: 'more',
			less_link_text: 'less',
			annimate: true,
			show_speed: 'slow',
			hide_speed: 'slow',
			remove_ff_active_outline: true
		}, options);

		function show_text(elem) {
			elem.removeClass(o.hidden_state_classname);
			if (o.annimate === false) {
				elem.find('div.'+o.innner_wrap_classname).css({ height: 'auto', overflow: 'visible' });
			} else {
				var inner_wrap_height = elem.find('div.'+o.innner_wrap_classname).attr("box_h") + "px";
				elem.find('div.'+o.innner_wrap_classname).animate({ "height": inner_wrap_height }, { duration: o.hide_speed });
			}
			elem.find('div.'+o.link_wrap_classname+' a').html(o.less_link_text);
		}

		function hide_text(elem) {
			elem.addClass(o.hidden_state_classname);
			if (o.annimate === false) {
				elem.find('div.'+o.innner_wrap_classname).css({ height: o.max_height, overflow: 'hidden' });
			} else {
				elem.find('div.'+o.innner_wrap_classname).animate({"height": o.inner_height }, {duration: o.hide_speed });
			}
			elem.find('div.'+o.link_wrap_classname+' a').html(o.more_link_text);
		}

		function toggle_more_less(elem) {

			if (elem.hasClass(o.hidden_state_classname)) {
				show_text(elem);
			} else {
				hide_text(elem);
			}

		}

		function create_hide_text(elem) {
			elem.addClass(o.hidden_state_classname);
			elem.wrapInner('

');
			inner_wrap = elem.find('div.'+o.innner_wrap_classname);
			inner_wrap.attr('box_h', elem.height());
			inner_wrap.css({ height: o.inner_height, overflow: 'hidden' }).after('
'+o.more_link_text+'
');
			toggle_link = elem.find('div.'+o.link_wrap_classname+' a');
			if (o.remove_ff_active_outline === true) toggle_link.css('outline', 'none');
			toggle_link.click(function() {
				toggle_more_less(elem);
			});
		}

		function init(elems) {

			if (typeof o.inner_height === 'undefined') o.inner_height = o.max_height;

			return elems.each(function() {

				var elem = $(this);

				if (elem.height() > o.max_height) {
					create_hide_text(elem);
				}

			});
		}

		return init(this);

	};
})(jQuery);


text:
title : Computer Technology Review October 30, 2018
publishedBy : Computer Technology Review
publishedOn : October 30, 2018
link : http://wwpi.com/2018/10/30/storj-labs-v3-platform-now-in-public-alpha-encourages-developers-interested-in-building-tools-on-decentralized-cloud-storage/
weight: 14
articleName : Storj Labs' V3 Platform now in public alpha, encourages developers interested in building tools on decentralized cloud storage
class : pressArticle
---


text:
require 'puppet_x/dell_iom/model'
require 'puppet_x/dell_iom/model/ioa_mode'

module PuppetX::Dell_iom::Model::Ioa_mode::Base
  def self.ifprop(base, param, base_command = param, &block)

    base.register_scoped param, /((.*))/ do
      cmd 'show system stack-unit 0 iom-mode'
      Puppet.debug("Name: #{base.name}")
      match /.*/
      add do |transport, value|
        Puppet.debug(" command #{base_command} value  #{value}" )
        transport.command("#{base_command} #{value}")
      end
      remove do |transport, old_value|
        Puppet.debug(" No  command #{base_command} value  #{value}" )
        transport.command("no #{base_command} #{old_value}")
      end
      evaluate(&block) if block
    end
  end

  def self.register(base)
    Puppet.debug("base: #{base.name}")
    txt = ''
    ifprop(base, :ensure) do
      match do |txt|
        if txt.match(/base.name/)
          :present
        else
          :absent
        end
      end
      default :absent

      add { |*_| }
      remove { |*_| }
    end

    ifprop(base, :ioa_ethernet_mode) do
      Puppet.debug("IOA Ethernet mode , base name: #{base.name}")
      match do |txt|
        :present
      end
      default :absent

      add do |transport, value|
        Puppet.debug("Updating the ethernet mode of the switch")
        if value == :true
          if base.facts['product_name'].match(/2210S/) and
              (base.facts['ioa_ethernet_mode'].nil?)
            Puppet.debug('Switch is not in ethernet mode')
            transport.command('enable')
            transport.command('configure terminal', :prompt => /\(conf\)#\z/n)
            transport.command('stack-unit 0 port-group 0 portmode ethernet',:prompt => /confirm.*/ )
            transport.command('yes')
            transport.command('end')

            # Save the configuration and reload switch
            transport.command('enable')
            transport.command('write memory')
            transport.command('reload', :prompt => /confirm.*/i)
            transport.command('yes')
            # Close connection and call connect method to restore the connection
            transport.close
            # Sleeping for a minute
            (1..5).each do |retry_count|
              sleep(60)
              begin
                transport.connect
                break
              rescue Exception => e
                Puppet.debug("Failed to connect, retry counter #{retry_count}")
              end
            end
            base.facts['ioa_ethernet_mode'] = 'stack-unit 0 port-group 0 portmode ethernet'
          end
        else
          Puppet.debug("Flag for setting the ethernet mode is false")
        end
      end
      remove { |*_| }
    end

    #TODO:  This is pretty inconsistent with the way we usually do the properties.  Usually it's in the "add" block.  Might be nice to change for consistency's sake.
    ifprop(base, :iom_mode) do
      Puppet.debug("Base name: #{base.name}")

      desired_iom_mode = 'programmable-mux' if base.name.downcase.match(/pmux|programmable*/)
      desired_iom_mode = 'standalone' if base.name.downcase.match(/smux|stand*/)
      desired_iom_mode = 'vlt' if base.name.downcase.match(/vlt*/)
      Puppet.debug("desired iom mode: #{desired_iom_mode}")
      match do |txt|
        Puppet.debug("TXT for matching: #{txt}")
        :present
      end
      default :absent

      if base.facts['iom_mode'] != desired_iom_mode
        # For VLT, change the switch to ethernet mode for FN 2210S IOA
        if desired_iom_mode == 'vlt' and base.facts['product_name'].match(/2210/) and base.facts['ioa_ethernet_mode'].nil?
          transport.command('enable')
          transport.command('configure terminal', :prompt => /\(conf\)#\z/n)
          transport.command('stack-unit 0 port-group 0 portmode ethernet',:prompt => /confirm.*/ )
          transport.command('yes')
          transport.command('end')

          # Save the configuration and reload switch
          transport.command('enable')
          transport.command('write memory')
          transport.command('reload', :prompt => /confirm.*/i)
          transport.command('yes')
          # Close connection and call connect method to restore the connection
          transport.close
          # Sleeping for a minute
          (1..5).each do |retry_count|
            sleep(60)
            begin
              transport.connect
              break
            rescue Exception => e
              Puppet.debug("Failed to connect, retry counter #{retry_count}")
            end
          end
          base.facts['ioa_ethernet_mode'] = 'stack-unit 0 port-group 0 portmode ethernet'
        end
        transport.command('enable')
        transport.command('configure terminal', :prompt => /\(conf\)#\z/n)
        transport.command("stack-unit 0 iom-mode #{desired_iom_mode}")
        transport.command('end')
        # Save the configuration and reload switch
        transport.command('write memory')
        transport.command('reload', :prompt => /confirm.*/)
        transport.command('yes')
        base.facts['iom_mode'] = desired_iom_mode

        # Close connection and call connect method to restore the connection
        transport.close
        # Sleeping for a minute
        (1..5).each do |retry_count|
          sleep(60)
          begin
            transport.connect
            # Sleeping for additional minute to allow switch to come to normal state
            Puppet.debug('Sleeping for additional minute to allow switch to come to normal state')
            sleep(60)
            break
          rescue Exception => e
            Puppet.debug("Failed to connect, retry counter #{retry_count}")
          end
        end
      end

      add { |*_| }
      remove { |*_| }
    end
  end

end


text:
#ifndef __UM_THREAD_INFO_H
#define __UM_THREAD_INFO_H

#ifndef __ASSEMBLY__

#include <asm/processor.h>
#include <asm/types.h>

struct thread_info {
	struct task_struct	*task;		/* main task structure */
	struct exec_domain	*exec_domain;	/* execution domain */
	unsigned long		flags;		/* low level flags */
	__u32			cpu;		/* current CPU */
	int			preempt_count;  /* 0 => preemptable,
						   <0 => BUG */
	mm_segment_t		addr_limit;	/* thread address space:
					 	   0-0xBFFFFFFF for user
						   0-0xFFFFFFFF for kernel */
	struct restart_block    restart_block;
	struct thread_info	*real_thread;    /* Points to non-IRQ stack */
};

#define INIT_THREAD_INFO(tsk)			\
{						\
	.task =		&tsk,			\
	.exec_domain =	&default_exec_domain,	\
	.flags =		0,		\
	.cpu =		0,			\
	.preempt_count =	1,		\
	.addr_limit =	KERNEL_DS,		\
	.restart_block =  {			\
		.fn =  do_no_restart_syscall,	\
	},					\
	.real_thread = NULL,			\
}

#define init_thread_info	(init_thread_union.thread_info)
#define init_stack		(init_thread_union.stack)

#define THREAD_SIZE ((1 << CONFIG_KERNEL_STACK_ORDER) * PAGE_SIZE)
/* how to get the thread information struct from C */
static inline struct thread_info *current_thread_info(void)
{
	struct thread_info *ti;
	unsigned long mask = THREAD_SIZE - 1;
	ti = (struct thread_info *) (((unsigned long) &ti) & ~mask);
	return ti;
}

/* thread information allocation */
#define alloc_thread_info(tsk) \
	((struct thread_info *) kmalloc(THREAD_SIZE, GFP_KERNEL))
#define free_thread_info(ti) kfree(ti)

#endif

#define PREEMPT_ACTIVE		0x10000000

#define TIF_SYSCALL_TRACE	0	/* syscall trace active */
#define TIF_SIGPENDING		1	/* signal pending */
#define TIF_NEED_RESCHED	2	/* rescheduling necessary */
#define TIF_POLLING_NRFLAG      3       /* true if poll_idle() is polling
					 * TIF_NEED_RESCHED
					 */
#define TIF_RESTART_BLOCK 	4
#define TIF_MEMDIE	 	5
#define TIF_SYSCALL_AUDIT	6
#define TIF_RESTORE_SIGMASK	7

#define _TIF_SYSCALL_TRACE	(1 << TIF_SYSCALL_TRACE)
#define _TIF_SIGPENDING		(1 << TIF_SIGPENDING)
#define _TIF_NEED_RESCHED	(1 << TIF_NEED_RESCHED)
#define _TIF_POLLING_NRFLAG     (1 << TIF_POLLING_NRFLAG)
#define _TIF_MEMDIE		(1 << TIF_MEMDIE)
#define _TIF_SYSCALL_AUDIT	(1 << TIF_SYSCALL_AUDIT)
#define _TIF_RESTORE_SIGMASK	(1 << TIF_RESTORE_SIGMASK)

#endif


text:
{% extends "dashboard/base.html" %}

{% block main %}

                <form method="POST">
                    {% csrf_token %}

                    {% for field in form %}

                        {{ field.errors }}
                        {{ field.label_tag }}
                        {{ field }}
                        {% if forloop.last %}
                            <button type="submit" class="btn btn-primary">Submit</button>
                        {% endif %}

                    {% endfor %}

                    {{ form.non_field_errors }}

                </form>

{% endblock %}


text:
class Chef
  module Artifact
    class NexusConfiguration
      class << self
        def from_data_bag
          environment = unless Chef::Config[:solo]
            Chef::Node.load(Chef::Config[:node_name]).chef_environment
          else
            nil
          end

          config = Chef::Artifact.data_bag_config_for(environment, Chef::Artifact::DATA_BAG_NEXUS)
          if config.nil? || config.empty?
            Chef::Log.debug "No Data Bag found for NexusConfiguration."
            nil
          else
            new(config['url'], config['repository'], config['username'], config['password'], config['ssl_verify'])
          end
        end
      end

      attr_accessor :url, :repository, :username, :password, :ssl_verify

      def initialize(url, repository, username=nil, password=nil, ssl_verify=true)
        @url, @repository, @username, @password = url, repository, username, password
        @ssl_verify = ssl_verify.nil? || ssl_verify
      end

      alias_method :inspect_without_masking, :inspect
      def inspect
        self.inspect_without_masking.sub(/@password=".*"/, '@password="MASKED"')
      end

      def to_hash
        {
          'url' => url,
          'repository' => repository,
          'username' => username,
          'password' => password
        }
      end
    end
  end
end


text:
require 'xcodeproj/scheme/xml_element_wrapper'
require 'xcodeproj/scheme/environment_variables'
require 'xcodeproj/scheme/command_line_arguments'

module Xcodeproj
  class XCScheme
    # This abstract class aims to be the base class for every XxxAction class
    # that have a #build_configuration attribute
    #
    class AbstractSchemeAction < XMLElementWrapper
      # @return [String]
      #         The build configuration associated with this action
      #         (usually either 'Debug' or 'Release')
      #
      def build_configuration
        @xml_element.attributes['buildConfiguration']
      end

      # @param [String] config_name
      #        The build configuration to associate with this action
      #        (usually either 'Debug' or 'Release')
      #
      def build_configuration=(config_name)
        @xml_element.attributes['buildConfiguration'] = config_name
      end
    end
  end
end


text:
package com.stripes.workshop.action;

import java.util.logging.Logger;
import net.sourceforge.stripes.action.ActionBean;
import net.sourceforge.stripes.action.ActionBeanContext;
import net.sourceforge.stripes.action.After;
import net.sourceforge.stripes.controller.LifecycleStage;

/**
 *
 * @author raf
 */
public class BaseActionBean implements ActionBean {

    protected ActionBeanContext context;
    protected Logger logger;

    @Override
    public ActionBeanContext getContext() {
        return context;
    }

    @Override
    public void setContext(ActionBeanContext context) {
        this.context = (ActionBeanContext) context;
    }

    @After(stages = LifecycleStage.ActionBeanResolution)
    protected void afterActionBeanResolution() {
        logger = Logger.getLogger(getClass().getSimpleName());
    }

}


text:
GameSole

<md-nav-bar atmd-selected-nav-item="currentNavItem">
  <md-nav-item md-nav-href="/#/login" name="page1" class="red">Logout</md-nav-item>
  <md-nav-item md-nav-href="/#/search" name="page2" class="bingoBop">Search</md-nav-item>
  <md-nav-item md-nav-href="/#/home" name="page3" class="bingoBop">Home</md-nav-item>
</md-nav-bar>

    <form>
      <md-card class="md-card-home">

          <md-button ng-click="deletePost(post, key)"><md-icon class="material-icons-x">delete_forever</md-icon>
            <md-tooltip md-direction="right">Delete Post</md-tooltip>
          </md-button>

            <md-card-title>
              <md-card-title-text>
                {{item.name}}

Game Info:

                {{item.information}}

Platform: {{item.platform}}

              </md-card-title-text>
            </md-card-title>
          <md-card-actions layout="row" layout-align="start center"></md-card-actions>
          <md-card-content>
              Comments:

{{item.comment}}

            <md-input-container>
              type comment here
                <input ng-model="user.input" type="" class="input-field">
                  <md-button ng-click="addComment(user.input, key)" class="sendBtn">send
                    <md-tooltip md-direction="bottom">Send Comment</md-tooltip>
                  </md-button>

              <md-button ng-click="upVote(key, item)" class="uvote"><md-icon class="material-icons-y">thumb_up</md-icon> {{ item.likes }} </md-button>

          </md-input-container>
        </md-card-content>
      </md-card>
    </form>


text:
class SearchDropdown < ActiveRecord::Base
end


text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <title>Piñata</title>
  <link rel="stylesheet" href="style/slate.min.css">
  <link rel="stylesheet" href="style/colorMap.css">
  <link rel="stylesheet" href="style/style.css">
  <link rel="stylesheet" href="node_modules/font-awesome/css/font-awesome.min.css">

        <input id="search" class="form-control input-sm" type="text" placeholder="Search..." autofocus>


text:
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace RgsParser
{
    class Source
    {
        public const char EOF = unchecked((char)(-1));

        private readonly string _inputText;

        private int _index  = 0;
        private int _line   = 0;
        private int _column = 0;

        public SourceLocation Location
        {
            get { return new SourceLocation(_index, _line, _column); }
        }

        public bool IsAtEof
        {
            get { return _index >= _inputText.Length; }
        }

        public Source(string inputText)
        {
            _inputText = inputText;
        }

        public char LookAhead(int amount)
        {
            int realIndex = _index + amount;

            if (0 <= realIndex && realIndex < _inputText.Length)
            {
                return _inputText[realIndex];
            }

            return EOF;
        }

        public void Consume(int amount)
        {
            Debug.Assert(amount > 0);

            for (int i = 0;
                 i < amount && !IsEof(_index + i);
                 i++)
            {
                int loc = _index + i;

                if (!IsEof(loc+1) &&
                    _inputText[loc] == '\r' && _inputText[loc+1] == '\n')
                {
                    // Windows newline CRLF
                    if (i + 1 < amount)
                    {
                        // advance past it if we are not set to stop in the middle of the CRLF.
                        i++;
                    }

                    _line++;
                    _column = 0;
                }
                else if (!IsEof(loc-1) && i-1 >= 0 &&
                         _inputText[loc-1] == '\r' && _inputText[loc] == '\n')
                {
                    // Windows newline, but we started after the CR
                }
                else if (_inputText[loc] == '\r' || _inputText[loc] == '\n')
                {
                    // Other newlines.
                    _line++;
                    _column = 0;
                }
                else
                {
                    _column++;
                }
            }

            _index += amount;
        }

        private bool IsEof(int location)
        {
            return location < 0 || _inputText.Length <= location;
        }
    }
}


text:
package org.innovateuk.ifs.project.financecheck.builder;

import org.innovateuk.ifs.BaseBuilder;
import org.innovateuk.ifs.project.finance.resource.CostCategoryResource;
import org.innovateuk.ifs.project.finance.resource.CostResource;

import java.math.BigDecimal;
import java.util.List;
import java.util.function.BiConsumer;

import static java.util.Collections.emptyList;
import static org.innovateuk.ifs.base.amend.BaseBuilderAmendFunctions.setField;
import static org.innovateuk.ifs.base.amend.BaseBuilderAmendFunctions.uniqueIds;

public class CostResourceBuilder extends BaseBuilder<CostResource, CostResourceBuilder> {

    private CostResourceBuilder(List<BiConsumer<Integer, CostResource>> multiActions) {
        super(multiActions);
    }

    public static CostResourceBuilder newCostResource() {
        return new CostResourceBuilder(emptyList()).with(uniqueIds());
    }

    @Override
    protected CostResourceBuilder createNewBuilderWithActions(List<BiConsumer<Integer, CostResource>> actions) {
        return new CostResourceBuilder(actions);
    }

    @Override
    protected CostResource createInitial() {
        return new CostResource();
    }

    public CostResourceBuilder withValue(BigDecimal... values) {
        return withArray((value, cost) -> setField("value", value, cost), values);
    }

    public CostResourceBuilder withValue(String... values) {
        return withArray((value, cost) -> setField("value",  new BigDecimal(value), cost), values);
    }

    public CostResourceBuilder withCostCategory(CostCategoryResource... costCategories) {
        return withArray((costCategory, cost) -> setField("costCategory", costCategory, cost), costCategories);
    }
}


text:
import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
import { Observable, of } from 'rxjs';

import { HeadingComponent } from './heading';
import { ViewTranscriptService } from '../viewtranscript.service';
import { ViewTranscript, ViewTranscriptSample } from '../../../models/sample-data/viewtranscript-sample';

// Create a stub for ViewTranscriptService
class ServiceStub {
  public getMeeting(): Observable<ViewTranscript> {
    return of(ViewTranscriptSample);
  }
}

describe('HeadingComponent', () => {
  let component: HeadingComponent;
  let fixture: ComponentFixture<HeadingComponent>;

  beforeEach(waitForAsync(() => {
    TestBed.configureTestingModule({
      declarations: [HeadingComponent],
      providers: [{ provide: ViewTranscriptService, useClass: ServiceStub }],
    }).compileComponents();
  }));

  beforeEach(() => {
    fixture = TestBed.createComponent(HeadingComponent);
    component = fixture.componentInstance;
    fixture.detectChanges();
  });

  it('should create', () => {
    expect(component).toBeTruthy();
  });
});


text:
/**
 * This software is released as part of the Pumpernickel project.
 *
 * All com.pump resources in the Pumpernickel project are distributed under the
 * MIT License:
 * https://github.com/mickleness/pumpernickel/raw/master/License.txt
 *
 * More information about the Pumpernickel project is available here:
 * https://mickleness.github.io/pumpernickel/
 */
package com.pump.io.location;

import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
import java.util.Map;

import org.apache.tools.tar.TarEntry;
import org.apache.tools.tar.TarInputStream;

import com.pump.io.GuardedInputStream;
import com.pump.io.IOUtils;
import com.pump.io.MeasuredInputStream;
import com.pump.util.Receiver;

public class TarArchiveLocation extends ArchiveLocation<TarEntry> {

	static class EntryLocation {
		final long startPtr;
		final long length;

		EntryLocation(long startPtr, long length) {
			this.startPtr = startPtr;
			this.length = length;
		}
	}

	/**
	 * The root node will catalog every TarEntry's name to an
	 * EntryLocation for easy retrieval.
	 */
	Map<String, EntryLocation> archiveEntryToLocation;

	public TarArchiveLocation(IOLocation archive) {
		super(archive);
		setParent(archive.getParent());
	}

	private TarArchiveLocation(ArchiveLocation<TarEntry> root, TarEntry tarEntry) {
		super(root, tarEntry);
	}

	@Override
	public String getArchivePath() {
		TarEntry entry = getArchiveEntry();
		if (entry == null)
			return null;

		return entry.getName();
	}

	@Override
	protected char getSeparatorChar() {
		return '/';
	}

	@Override
	protected void listArchiveEntries(Receiver<TarEntry> receiver)
			throws IOException {
		archiveEntryToLocation = new HashMap<String, EntryLocation>();
		InputStream in = null;
		try {
			in = archive.createInputStream();
			TarInputStream tarIn = null;
			try {
				tarIn = new TarInputStream(in);
				TarEntry entry = tarIn.getNextEntry();

				// the current position in the InputStream:
				long pos = 512; // all TarEntry headers are 512 bytes

				while (entry != null) {
					long entryStartPtr = pos;
					long entryLength = entry.getSize();

					EntryLocation loc = new EntryLocation(entryStartPtr,
							entryLength);
					archiveEntryToLocation.put(entry.getName(), loc);
					receiver.add(entry);

					// All the data of a TarEntry is expressed in blocks of 512
					// bytes, rounded up:
					if (entryLength % 512 != 0) {
						long d = entryLength / 512L;
						entryLength = (d + 1) * 512L;
					}

					pos += entryLength;

					entry = tarIn.getNextEntry();
					pos += 512;
				}
			} finally {
				if (tarIn != null) {
					try {
						tarIn.close();
					} catch (Throwable t) {
						t.printStackTrace();
					}
				}
			}
		} finally {
			if (in != null) {
				try {
					in.close();
				} catch (Throwable t) {
					t.printStackTrace();
				}
			}
		}
	}

	@Override
	protected TarEntry createDirectory(String path) {
		TarEntry e = new TarEntry(path);
		return e;
	}

	@Override
	protected ArchiveLocation<TarEntry> createArchiveLocation(
			ArchiveLocation<TarEntry> root, TarEntry t) {
		return new TarArchiveLocation(root, t);
	}

	@Override
	public boolean isDirectory(TarEntry entry) {
		return entry.isDirectory();
	}

	@Override
	public long getModificationDate(TarEntry entry) {
		return entry.getModTime().getTime();
	}

	@Override
	public boolean isHidden(TarEntry entry) {
		return false;
	}

	@Override
	public long length(TarEntry entry) {
		return entry.getSize();
	}

	/**
	 * Create an InputStream for a TarEntry.
	 *

	 * The root TarArchiveLocation catalogs every TarEntry, so this method
	 * provides (very nearly) random access to entries.
	 */
	@Override
	public InputStream createInputStream(TarEntry entry) throws IOException {
		/*
		 * The slow way here would be to create a new TarInputStream and iterate
		 * over all TarEntries until we identified the correct entry and return
		 * that input.
		 *
		 * ... but since we cataloged this up front, we can skip all that.
		 */
		EntryLocation loc = archiveEntryToLocation.get(entry.getName());
		if (loc == null)
			throw new IllegalArgumentException("unrecognized tar entry \""
					+ entry.getName() + "\"");

		InputStream in = null;
		try {
			in = root.createInputStream();
			MeasuredInputStream measuredIn = new MeasuredInputStream(in);
			IOUtils.skipFully(measuredIn, loc.startPtr);
			return new GuardedInputStream(measuredIn, loc.length, true);
		} catch (IOException e) {
			if (in != null) {
				try {
					in.close();
				} catch (IOException e2) {
					e2.printStackTrace();
				}
			}
			throw e;
		}
	}
}


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

<widget xmlns="http://www.w3.org/ns/widgets"
		xmlns:gap="http://phonegap.com/ns/1.0"
		id="br.edu.pg.cjap" version="0.0.1"
		android-versionCode="7"	CFBundleVersion = "MAJOR.MINOR.PATCH">

	<name>CJap</name>
	<description>
		Cadastro de conteúdo simples para estudantes..
	</description>
	<author email="pdfritsch@gmail.com" href="http://github.com/PriDF">
		Priscila D. Fritsch
	</author>
	<content src="index.html" />

	<!-- Android preference -->
	<preference name="android-minSdkVersion" value="7" />
	<preference name="android-installLocation" value="auto"/>
	<preference name="KeepRunning" value="false" />
	<preference name="InAppBrowserStorageEnabled" value="false" />
	<preference name="LoadingDialog" value="Carregando. Por favor, aguarde"/>
	<preference name="LoadingPageDialog" value="Carregando, aguarde"/>
	<preference name="ErrorUrl" value="index.html"/>
	<preference name="ShowTitle" value="false"/>
	<preference name="AndroidLaunchMode" value="singleTop"/>

	<!-- Mix preference -->
	<preference name="permissions" value="none"/>
	<preference name="orientation" value="default" />
	<preference name="target-device" value="universal" />
	<preference name="fullscreen" value="true" />
	<preference name="detect-data-types" value="true" />
	<preference name="exit-on-suspend" value="false" />
	<preference name="show-splash-screen-spinner" value="true" />
	<preference name="auto-hide-splash-screen" value="true" />
	<preference name="disable-cursor" value="false" />
	<preference name="webviewbounce" value="true"/>
	<preference name="prerendered-icon" value="true"/>
	<preference name="stay-in-webview" value="false"/>
	<preference name="BackgroundColor" value="0xff888888"/>
	<preference name="SplashScreenDelay" value="10000" />

	<!-- Plugins cordova -->
	<gap:plugin name="cordova-plugin-device" source="npm" version="2.0.2"/>
	<gap:plugin name="cordova-plugin-splashscreen" source="npm" version="5.0.2"/>
	<gap:plugin name="cordova-plugin-dialogs" source="npm" version="2.0.1" />

	<icon src="cjap.png" />

	<!-- Android icons/splash screens -->
	<platform name="android">
		<icon src="www/res/minimap-hdpi/cjap.png" gap:platform="android" gap:qualifier="hdpi"/>
		<icon src="www/res/minimap-mdpi/cjap.png" gap:platform="android" gap:qualifier="mdpi"/>
		<icon src="www/res/minimap-xhdpi/cjap.png" gap:platform="android" gap:qualifier="xhdpi"/>
		<icon src="www/res/minimap-xxhdpi/cjap.png" gap:platform="android" gap:qualifier="xxhdpi"/>
		<icon src="www/res/minimap-xxxhdpi/cjap.png" gap:platform="android" gap:qualifier="xxxhdpi"/>
		<splash src="www/res/drawable-hdpi/cjap.png" density="land-hdpi"/>
		<splash src="www/res/drawable-mdpi/cjap.png" density="land-mdpi"/>
		<splash src="www/res/drawable-xhdpi/cjap.png" density="land-xhdpi"/>
		<splash src="www/res/drawable-xxhdpi/cjap.png" density="land-xxhdpi"/>
		<splash src="www/res/drawable-xxxhdpi/cjap.png" density="land-xxxhdpi"/>
	</platform>
</widget>


text:
require_relative '../events'

module Skoope
  module Models
    class Collection
      include Enumerable
      attr_reader :events, :items

      def initialize
        @events = Events.new
        @items = []
      end

      def [](*args)
        @items[*args]
      end

      def each(&block)
        @items.each(&block)
      end

      def append(item)
        @items << item
        @events.trigger(:append)
      end

      def length
        @items.length
      end

    end
  end
end


text:
@interface HCSubstringMatcher : HCBaseMatcher
{
    NSString *substring;
}

- (instancetype)initWithSubstring:(NSString *)aString;

@end


text:
 0">

			Search: <input ng-model="searchText">
			Item Per page:  <input type="number" min="1" max="100"  ng-model="pageSize">

List Replication

		Disk Id
		Disk Name

{{disk|json}}
			{{disk.diskId}}
			{{disk.diskName}}

No disk found


text:
package org.drools.workbench.screens.scenariosimulation.client.collectioneditor;

import org.junit.Test;

import static org.drools.workbench.screens.scenariosimulation.client.utils.ConstantHolder.FA_ANGLE_DOWN;
import static org.drools.workbench.screens.scenariosimulation.client.utils.ConstantHolder.FA_ANGLE_RIGHT;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.reset;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

public abstract class ElementViewImplTest<E extends ElementView, T extends ElementView.Presenter<E>>  extends AbstractCollectionEditorTest {

    protected T elementPresenterMock;

    protected E elementView;

    protected void setup() {
        super.setup();

    }

    @Test
    public void onFaAngleRightClick() {
        when(faAngleRightMock.getClassName()).thenReturn(FA_ANGLE_RIGHT);
        elementView.onFaAngleRightClick(clickEventMock);
        verify(elementPresenterMock, times(1)).onToggleRowExpansion(eq(elementView), eq(false));
        verify(clickEventMock, times(1)).stopPropagation();
        reset(clickEventMock);
        reset(elementPresenterMock);
        when(faAngleRightMock.getClassName()).thenReturn(FA_ANGLE_DOWN);
        elementView.onFaAngleRightClick(clickEventMock);
        verify(elementPresenterMock, times(1)).onToggleRowExpansion(eq(elementView), eq(true));
        verify(clickEventMock, times(1)).stopPropagation();
    }

    @Test
    public void onEditItemButtonClick() {
        elementView.onEditItemButtonClick(clickEventMock);
        verify(elementPresenterMock, times(1)).onEditItem(eq(elementView));
        verify(clickEventMock, times(1)).stopPropagation();
    }

    @Test
    public void onDeleteItemButtonClick() {
        elementView.onDeleteItemButtonClick(clickEventMock);
        verify(elementPresenterMock, times(1)).onDeleteItem(eq(elementView));
        verify(clickEventMock, times(1)).stopPropagation();
    }

    @Test
    public void onSaveChangeButtonClick() {
        elementView.onSaveChangeButtonClick(clickEventMock);
        verify(elementPresenterMock, times(1)).updateItem(eq(elementView));
        verify(clickEventMock, times(1)).stopPropagation();
    }

    @Test
    public void onCancelChangeButton() {
        elementView.onCancelChangeButton(clickEventMock);
        verify(elementPresenterMock, times(1)).onStopEditingItem(eq(elementView));
        verify(clickEventMock, times(1)).stopPropagation();
    }

    @Test
    public void isShown() {
        when(faAngleRightMock.getClassName()).thenReturn(FA_ANGLE_DOWN);
        assertTrue(elementView.isShown());
        when(faAngleRightMock.getClassName()).thenReturn(FA_ANGLE_RIGHT);
        assertFalse(elementView.isShown());
    }

    @Test
    public void toggleRowExpansion() {
        commonToggleRowExpansion(true);
        commonToggleRowExpansion(false);
    }

    private void commonToggleRowExpansion(boolean toExpand) {
        String classToAdd = toExpand ? FA_ANGLE_DOWN : FA_ANGLE_RIGHT;
        String classToRemove= toExpand ? FA_ANGLE_RIGHT : FA_ANGLE_DOWN;
        elementView.toggleRowExpansion(toExpand);
        verify(faAngleRightMock, times(1)).addClassName(eq(classToAdd));
        verify(faAngleRightMock, times(1)).removeClassName(eq(classToRemove));
        reset(faAngleRightMock);
    }

}


text:
public class BestTimeToBuyAndSellStockII {

	public static void main(String args[]) {

	}

	public static int maxProfit(int[] prices) {

	}
}


text:
//////////////////////////////////////////////
// Apache 2.0  - 2016-2020
// Author : Derek Tremblay (derektremblay666@gmail.com)
//////////////////////////////////////////////

namespace WpfHexaEditor.Core
{
    public static class ConstantReadOnly
    {
        public static readonly string HexLineInfoStringFormat = "x8";
        public static readonly string HexStringFormat = "x";
        public static readonly string DefaultHex8String = "0x00000000";

        public const long Largefilelength = 52_428_800L; //50 MB
        public const int Copyblocksize = 131_072; //128 KB
        public const int Findblocksize = 1_048_576; //1 MB
    }
}


text:
using namespace Palleon;

static std::map<std::string, CLabel::HORIZONTAL_ALIGNMENT> c_horizontalAlignmentTranslator =
{
	{ "left",	CLabel::HORIZONTAL_ALIGNMENT_LEFT		},
	{ "center",	CLabel::HORIZONTAL_ALIGNMENT_CENTER		},
	{ "right",	CLabel::HORIZONTAL_ALIGNMENT_RIGHT		}
};

static std::map<std::string, CLabel::VERTICAL_ALIGNMENT> c_verticalAlignmentTranslator =
{
	{ "top",		CLabel::VERTICAL_ALIGNMENT_TOP			},
	{ "center",		CLabel::VERTICAL_ALIGNMENT_CENTER		},
	{ "bottom",		CLabel::VERTICAL_ALIGNMENT_BOTTOM		}
};

static std::map<std::string, ALPHA_BLENDING_MODE> c_alphaBlendingModeTranslator =
{
	{ "none",		ALPHA_BLENDING_NONE		},
	{ "lerp",		ALPHA_BLENDING_LERP		},
	{ "add",		ALPHA_BLENDING_ADD		}
};

static std::map<std::string, ANIMATION_INTERPOLATION_TYPE> c_animationCurveInterpolationTranslator =
{
	{ "linear",				ANIMATION_INTERPOLATION_LINEAR				},
	{ "easeInOut",			ANIMATION_INTERPOLATION_EASE_INOUT			},
	{ "strongEaseInOut",	ANIMATION_INTERPOLATION_STRONG_EASE_INOUT	}
};

CScene::CScene(const CSceneDescriptor* descriptor)
{
	CreateScene(descriptor);
}

CScene::~CScene()
{

}

ScenePtr CScene::Create(const CSceneDescriptor* descriptor)
{
	return std::make_shared<CScene>(descriptor);
}

SceneNodePtr CScene::FindNode(const std::string& name)
{
	SceneNodePtr result;
	TraverseNodes(
		[&](const SceneNodePtr& node)
		{
			if(result) return false;
			if(node->GetName() == name)
			{
				result = node;
				return false;
			}
			return true;
		}
	);
	assert(result);
	return result;
}

CScene::LayoutObjectPtr CScene::GetLayout() const
{
	return m_layout;
}

SceneNodeAnimationPtr CScene::GetAnimation(const std::string& name) const
{
	auto animationIterator = m_animations.find(name);
	if(animationIterator == std::end(m_animations))
	{
		return SceneNodeAnimationPtr();
	}
	return animationIterator->second;
}

void CScene::CreateScene(const CSceneDescriptor* descriptor)
{
	CreateMaterials(descriptor);
	CreateAnimations(descriptor);
	auto rootNodeInfo = descriptor->GetRootNode();
	CreateNodes(this, descriptor, rootNodeInfo.children);
	auto layoutRootNode = descriptor->GetLayoutRootNode();
	if(!layoutRootNode.children.empty())
	{
		m_layout = CreateLayoutNode(descriptor, layoutRootNode.children[0]);
	}
}

template <typename ValueType>
static ValueType GetValueFromItemInfo(const CSceneDescriptor::ItemInfo& itemInfo, const std::string& propertyName, const ValueType& defaultValue);

template <>
float GetValueFromItemInfo<float>(const CSceneDescriptor::ItemInfo& itemInfo, const std::string& propertyName, const float& defaultValue)
{
	auto valueIterator = itemInfo.find(propertyName);
	if(valueIterator != std::end(itemInfo))
	{
		return ParseFloat(valueIterator->second);
	}
	else
	{
		return defaultValue;
	}
}

template <>
CVector2 GetValueFromItemInfo<CVector2>(const CSceneDescriptor::ItemInfo& itemInfo, const std::string& propertyName, const CVector2& defaultValue)
{
	auto valueIterator = itemInfo.find(propertyName);
	if(valueIterator != std::end(itemInfo))
	{
		return ParseVector2(valueIterator->second);
	}
	else
	{
		return defaultValue;
	}
}

template <>
CVector3 GetValueFromItemInfo<CVector3>(const CSceneDescriptor::ItemInfo& itemInfo, const std::string& propertyName, const CVector3& defaultValue)
{
	auto valueIterator = itemInfo.find(propertyName);
	if(valueIterator != std::end(itemInfo))
	{
		return ParseVector3(valueIterator->second);
	}
	else
	{
		return defaultValue;
	}
}

template <>
CColor GetValueFromItemInfo<CColor>(const CSceneDescriptor::ItemInfo& itemInfo, const std::string& propertyName, const CColor& defaultValue)
{
	auto valueIterator = itemInfo.find(propertyName);
	if(valueIterator != std::end(itemInfo))
	{
		return ParseColor(valueIterator->second);
	}
	else
	{
		return defaultValue;
	}
}

template <>
bool GetValueFromItemInfo<bool>(const CSceneDescriptor::ItemInfo& itemInfo, const std::string& propertyName, const bool& defaultValue)
{
	auto valueIterator = itemInfo.find(propertyName);
	if(valueIterator != std::end(itemInfo))
	{
		if(valueIterator->second == "true")
		{
			return true;
		}
		else if(valueIterator->second == "false")
		{
			return false;
		}
		else
		{
			return defaultValue;
		}
	}
	else
	{
		return defaultValue;
	}
}

template <>
std::string GetValueFromItemInfo<std::string>(const CSceneDescriptor::ItemInfo& itemInfo, const std::string& propertyName, const std::string& defaultValue)
{
	auto valueIterator = itemInfo.find(propertyName);
	if(valueIterator != std::end(itemInfo))
	{
		return valueIterator->second;
	}
	else
	{
		return defaultValue;
	}
}

template <typename ReturnType>
ReturnType GetEnumFromItemInfo(const CSceneDescriptor::ItemInfo& itemInfo, const std::string& propertyName, const std::map<std::string, ReturnType>& translator)
{
	auto valueIterator = itemInfo.find(propertyName);
	if(valueIterator != std::end(itemInfo))
	{
		auto enumValueIterator = translator.find(valueIterator->second);
		if(enumValueIterator != std::end(translator))
		{
			return enumValueIterator->second;
		}
		else
		{
			return ReturnType();
		}
	}
	else
	{
		return ReturnType();
	}
}

MaterialPtr CScene::GetMaterialFromItemInfo(const CSceneDescriptor::ItemInfo& itemInfo) const
{
	auto materialValueIterator = itemInfo.find("Material");
	if(materialValueIterator != std::end(itemInfo))
	{
		auto materialIterator = m_materials.find(materialValueIterator->second);
		if(materialIterator != std::end(m_materials))
		{
			return materialIterator->second;
		}
		else
		{
			//Material was specified but wasn't found in scene
			assert(0);
			return MaterialPtr();
		}
	}
	else
	{
		return MaterialPtr();
	}
}

void CScene::RegisterNodeAnimations(const SceneNodePtr& node, const std::string& animationNamesString)
{
	std::vector<std::string> animationNames;
	boost::split(animationNames, animationNamesString, boost::is_any_of(", "), boost::algorithm::token_compress_on);
	for(const auto& animationName : animationNames)
	{
		if(animationName.empty()) continue;
		const auto& animation = GetAnimation(animationName);
		assert(animation);
		node->GetAnimationController().AddAnimation(animationName, animation);
	}
}

SceneNodePtr CScene::CreateNode(const CSceneDescriptor* descriptor, const CSceneDescriptor::NODE_INFO& baseNodeDesc)
{
	CSceneDescriptor::NODE_INFO nodeDesc = baseNodeDesc;

	auto className = GetValueFromItemInfo<std::string>(nodeDesc.properties, "Class", "");
	const auto& styles = descriptor->GetStyles();
	auto styleInfoIterator = styles.find(className);
	if(styleInfoIterator != std::end(styles))
	{
		for(const auto& styleItemPair : styleInfoIterator->second)
		{
			if(nodeDesc.properties.find(styleItemPair.first) != std::end(nodeDesc.properties)) continue;
			nodeDesc.properties.insert(styleItemPair);
		}
	}

	auto position = GetValueFromItemInfo<CVector3>(nodeDesc.properties, "Position", CVector3(0, 0, 0));
	auto scale = GetValueFromItemInfo<CVector3>(nodeDesc.properties, "Scale", CVector3(1, 1, 1));
	auto hotspot = GetValueFromItemInfo<CVector3>(nodeDesc.properties, "Hotspot", CVector3(0, 0, 0));
	bool visible = GetValueFromItemInfo<bool>(nodeDesc.properties, "Visible", true);
	auto animations = GetValueFromItemInfo<std::string>(nodeDesc.properties, "Animations", "");

	SceneNodePtr result;
	if(nodeDesc.type == "Sprite")
	{
		auto size = GetValueFromItemInfo<CVector2>(nodeDesc.properties, "Size", CVector2(1, 1));
		auto material = GetMaterialFromItemInfo(nodeDesc.properties);

		auto sprite = CSprite::Create();
		sprite->SetSize(size);
		if(material)
		{
			sprite->SetMaterial(material);
		}
		result = sprite;
	}
	else if(nodeDesc.type == "NinePatch")
	{
		auto size = GetValueFromItemInfo<CVector2>(nodeDesc.properties, "Size", CVector2(1, 1));
		auto ninePatch = GetValueFromItemInfo<std::string>(nodeDesc.properties, "NinePatch", "");

		auto ninePatchNode = CNinePatch::Create();
		ninePatchNode->SetDescriptor(CResourceManager::GetInstance().GetResource<CNinePatchDescriptor>(ninePatch));
		ninePatchNode->SetSize(size);
		result = ninePatchNode;
	}
	else if(nodeDesc.type == "Label")
	{
		auto size = GetValueFromItemInfo<CVector2>(nodeDesc.properties, "Size", CVector2(1, 1));
		auto font = GetValueFromItemInfo<std::string>(nodeDesc.properties, "Font", "");
		auto text = GetValueFromItemInfo<std::string>(nodeDesc.properties, "Text", "");
		auto textScale = GetValueFromItemInfo<CVector2>(nodeDesc.properties, "TextScale", CVector2(1, 1));
		auto horizontalAlignment = GetEnumFromItemInfo(nodeDesc.properties, "HorizontalAlignment", c_horizontalAlignmentTranslator);
		auto verticalAlignment = GetEnumFromItemInfo(nodeDesc.properties, "VerticalAlignment", c_verticalAlignmentTranslator);

		auto label = CLabel::Create();
		label->SetSize(size);
		label->SetFont(CResourceManager::GetInstance().GetResource<CFontDescriptor>(font));
		label->SetText(text);
		label->SetHorizontalAlignment(horizontalAlignment);
		label->SetVerticalAlignment(verticalAlignment);
		label->SetTextScale(textScale);
		result = label;
	}
	else if(nodeDesc.type == "SpriteButton")
	{
		auto size = GetValueFromItemInfo<CVector2>(nodeDesc.properties, "Size", CVector2(1, 1));
		auto font = GetValueFromItemInfo<std::string>(nodeDesc.properties, "Font", "");
		auto text = GetValueFromItemInfo<std::string>(nodeDesc.properties, "Text", "");
		auto releasedTexture = GetValueFromItemInfo<std::string>(nodeDesc.properties, "ReleasedTexture", "");
		auto pressedTexture = GetValueFromItemInfo<std::string>(nodeDesc.properties, "PressedTexture", "");

		auto button = CSpriteButton::Create();
		button->SetSize(size);
		if(!font.empty())
		{
			button->SetFont(CResourceManager::GetInstance().GetResource<CFontDescriptor>(font));
		}
		if(!releasedTexture.empty())
		{
			button->SetReleasedTexture(CResourceManager::GetInstance().GetTexture(releasedTexture));
		}
		if(!pressedTexture.empty())
		{
			button->SetPressedTexture(CResourceManager::GetInstance().GetTexture(pressedTexture));
		}
		button->SetText(text);
		result = button;
	}
	else if(nodeDesc.type == "NinePatchButton")
	{
		auto size = GetValueFromItemInfo<CVector2>(nodeDesc.properties, "Size", CVector2(1, 1));
		auto font = GetValueFromItemInfo<std::string>(nodeDesc.properties, "Font", "");
		auto text = GetValueFromItemInfo<std::string>(nodeDesc.properties, "Text", "");
		auto releasedNinePatch = GetValueFromItemInfo<std::string>(nodeDesc.properties, "ReleasedNinePatch", "");
		auto pressedNinePatch = GetValueFromItemInfo<std::string>(nodeDesc.properties, "PressedNinePatch", "");

		auto button = CNinePatchButton::Create();
		button->SetSize(size);
		if(!font.empty())
		{
			button->SetFont(CResourceManager::GetInstance().GetResource<CFontDescriptor>(font));
		}
		button->SetText(text);
		if(!releasedNinePatch.empty())
		{
			button->SetReleasedDescriptor(CResourceManager::GetInstance().GetResource<CNinePatchDescriptor>(releasedNinePatch));
		}
		if(!pressedNinePatch.empty())
		{
			button->SetPressedDescriptor(CResourceManager::GetInstance().GetResource<CNinePatchDescriptor>(pressedNinePatch));
		}
		result = button;
	}
	else
	{
		result = CSceneNode::Create();
	}

	assert(result);
	if(result)
	{
		result->SetName(nodeDesc.name);
		result->SetPosition(position);
		result->SetScale(scale);
		result->SetVisible(visible);
		result->SetHotspot(hotspot);
		RegisterNodeAnimations(result, animations);

		CreateNodes(result.get(), descriptor, nodeDesc.children);
	}

	return result;
}

void CScene::CreateNodes(CSceneNode* parentNode, const CSceneDescriptor* descriptor, const CSceneDescriptor::NodeInfoArray& nodeInfos)
{
	for(const auto& nodeInfo : nodeInfos)
	{
		auto childNode = CreateNode(descriptor, nodeInfo);
		parentNode->AppendChild(childNode);
	}
}

CScene::LayoutObjectPtr CScene::CreateLayoutNode(const CSceneDescriptor* descriptor, const CSceneDescriptor::NODE_INFO& nodeDesc)
{
	LayoutObjectPtr result;
	if(nodeDesc.type == "Horizontal")
	{
		auto layout = Framework::CHorizontalLayout::Create();
		result = layout;
	}
	else if(nodeDesc.type == "Vertical")
	{
		auto layout = Framework::CVerticalLayout::Create();
		result = layout;
	}
	else if(nodeDesc.type == "Stretch")
	{
		auto stretch = Framework::CLayoutStretch::Create();
		result = stretch;
	}
	else if(nodeDesc.type == "Item")
	{
		auto size = GetValueFromItemInfo<CVector2>(nodeDesc.properties, "Size", CVector2(1, 1));
		auto stretch = GetValueFromItemInfo<CVector2>(nodeDesc.properties, "Stretch", CVector2(0, 0));
		auto targetNode = FindNode<ILayoutable>(nodeDesc.name);
		assert(targetNode);
		auto item = std::make_shared<CLayoutNode>(
			static_cast<unsigned int>(size.x), static_cast<unsigned int>(size.y),
			static_cast<unsigned int>(stretch.x), static_cast<unsigned int>(stretch.y), targetNode);
		result = item;
	}
	else
	{
		assert(0);
	}

	if(auto flatLayout = std::dynamic_pointer_cast<Framework::CFlatLayout>(result))
	{
		for(const auto& nodeInfo : nodeDesc.children)
		{
			auto childNode = CreateLayoutNode(descriptor, nodeInfo);
			flatLayout->InsertObject(childNode);
		}
	}
	else
	{
		assert(nodeDesc.children.empty());
	}

	return result;
}

void CScene::CreateMaterials(const CSceneDescriptor* descriptor)
{
	for(const auto& materialInfoPair : descriptor->GetMaterials())
	{
		const auto& materialInfo = materialInfoPair.second;
		auto material = CMaterial::Create();
		auto texture0 = GetValueFromItemInfo<std::string>(materialInfo, "Texture0", "");
		auto alphaBlendingMode = GetEnumFromItemInfo(materialInfo, "AlphaBlendingMode", c_alphaBlendingModeTranslator);
		auto color = GetValueFromItemInfo<CColor>(materialInfo, "Color", CColor(1, 1, 1, 1));
		if(!texture0.empty())
		{
			material->SetTexture(0, CResourceManager::GetInstance().GetTexture(texture0.c_str()));
		}
		material->SetAlphaBlendingMode(alphaBlendingMode);
		material->SetColor(color);
		m_materials.insert(std::make_pair(materialInfoPair.first, material));
	}
}

template <typename ModifierType>
std::shared_ptr<CAnimationCurve<ModifierType>> CreateAnimationCurveFromAnimationInfo(const CSceneDescriptor::ANIMATION_INFO& animationInfo)
{
	auto animationCurve = std::make_shared<CAnimationCurve<ModifierType>>();
	float previousTime = 0;
	typename ModifierType::ItemType previousValue = typename ModifierType::ItemType();
	ANIMATION_INTERPOLATION_TYPE previousInterpolation = ANIMATION_INTERPOLATION_TYPE();
	bool previousValid = false;
	for(const auto& animationKeyInfo : animationInfo.keys)
	{
		auto time = GetValueFromItemInfo<float>(animationKeyInfo, "Time", 0);
		auto value = GetValueFromItemInfo<typename ModifierType::ItemType>(animationKeyInfo, "Value", typename ModifierType::ItemType());
		auto interpolation = GetEnumFromItemInfo(animationKeyInfo, "Interpolation", c_animationCurveInterpolationTranslator);
		if(previousValid)
		{
			assert((time - previousTime) > 0);
			animationCurve->AddPart(previousValue, value, time - previousTime, previousInterpolation);
		}
		previousTime = time;
		previousValue = value;
		previousInterpolation = interpolation;
		previousValid = true;
	}
	return animationCurve;
}

void CScene::CreateAnimations(const CSceneDescriptor* descriptor)
{
	for(const auto& animationInfoPair : descriptor->GetAnimations())
	{
		const auto& animationInfo = animationInfoPair.second;
		auto type = GetValueFromItemInfo<std::string>(animationInfo.properties, "Type", "");
		if(type.empty()) continue;

		SceneNodeAnimationPtr animation;
		if(type == "OpacityCurve")
		{
			animation = CreateAnimationCurveFromAnimationInfo<COpacityModifier>(animationInfo);
		}
		else if(type == "ColorCurve")
		{
			animation = CreateAnimationCurveFromAnimationInfo<CColorModifier>(animationInfo);
		}
		else if(type == "PositionCurve")
		{
			animation = CreateAnimationCurveFromAnimationInfo<CPositionModifier>(animationInfo);
		}
		else if(type == "ScaleCurve")
		{
			animation = CreateAnimationCurveFromAnimationInfo<CScaleModifier>(animationInfo);
		}
		else
		{
			//Unknown animation type
			assert(0);
		}

		if(animation)
		{
			m_animations.insert(std::make_pair(animationInfoPair.first, animation));
		}
	}
}


text:
const char * DummyDevice::getName(){
    return "dummy";
}

const char * DummyDevice::getSensorType(){
    return "dummy";
}

const int DummyDevice::getSensorQuantities(int quantities[]){
    quantities[0] = TEMPERATURE;
    return 1;
}

float DummyDevice::getValue() {
    return 3.14;
}


text:
<?php

class Hybrid_Memory_Task {

	/**
	 * Create memory table
	 *
	 * @param   array   $arguments
	 * @return  void
	 */
	public function install($arguments)
	{
		$name = array_shift($arguments);

		if (empty($name)) $name = Config::get('hybrid::memory.default_table');

		Schema::create($name, function ($table)
		{
			$table->increments('id');

			$table->string('name', 64);
			$table->blob('value');

			$table->unique('name');
		});
	}

	/**
	 * Drop memory table
	 *
	 * @param   array   $arguments
	 * @return  void
	 */
	public function uninstall($arguments)
	{
		$name = array_shift($arguments);

		if (empty($name)) $name = Config::get('hybrid::memory.default_table');

		Schema::drop($name);
	}
}


text:
@implementation BookmarkViewController
@synthesize filteredListContent;
@synthesize sections;
@synthesize dataArray = _dataArray;
@synthesize bookmarkTableView;

#pragma mark -
#pragma mark User Loading  methods

- (void)viewDidAppear:(BOOL)animated {

    [super viewDidAppear:animated];
    bookmarkSearchBar.text = @"";
    [self getDataForBookmarkTable];
}
- (void)viewDidLoad
{
    [super viewDidLoad];

    self.filteredListContent = [[NSMutableArray alloc] init];
    self.sections = [[NSMutableDictionary alloc] init];
    [self getDataForBookmarkTable];

    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(filterContentforText) name:UITextFieldTextDidChangeNotification object:nil];

    //Font Setting
    UIFont* myFont = FONT_TAHOMA_REGULAR(17);
    [titleLabel setFont:myFont];
    titleLabel.textColor = kColor(255, 154, 4, 1);
    bookmarkTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
}

- (void)viewDidUnload
{
    [[NSNotificationCenter defaultCenter] removeObserver:self name:UITextFieldTextDidChangeNotification object:nil];
    [super viewDidUnload];
}

- (NSUInteger)supportedInterfaceOrientations
{

    return 0;
}
- (BOOL)shouldAutorotate
{
    [bookmarkTableView setEditing:NO animated:NO];
    [self getDataForBookmarkTable];
    return NO;
}

#pragma mark -
#pragma mark User Define  methods

- (void)getDataForBookmarkTable
{
    DatabaseConnection*dbCon = [DatabaseConnection sharedConnection];
    _dataArray = [dbCon SelectBookmarkDetail:[NSString stringWithFormat:@"Select * from BOOKMARK"]];
    self.filteredListContent = [_dataArray mutableCopy];
    [self setDataForPlay];
    [self checkStatusOfInfoLabel];
    [self checkPropertyOfDoneButton];
    [bookmarkTableView reloadData];
}

- (void)checkStatusOfInfoLabel
{
    infoLabel.hidden = ([self.filteredListContent count] > 0);
}

- (void)checkPropertyOfDoneButton
{
    if ([filteredListContent count]==0) {
        [doneBtn setImage:[UIImage imageNamed:@"btn_edit.png"] forState:UIControlStateNormal];
        [doneBtn setEnabled:FALSE];

    } else {
        if (bookmarkTableView.editing)
            [doneBtn setImage:[UIImage imageNamed:@"btn_done.png"] forState:UIControlStateNormal];
        else
            [doneBtn setImage:[UIImage imageNamed:@"btn_edit.png"] forState:UIControlStateNormal];
        [doneBtn setEnabled:TRUE];
    }
}

- (void)setDataForPlay
{
    self.sections = [[NSMutableDictionary alloc] init];
    BOOL found;
    // Loop through the Play and create our keys
    for (Bookmark *bookmark in self.filteredListContent)
    {
        NSString *c = [bookmark.playTitle substringToIndex:1];
        found = NO;
        for (NSString *str in [self.sections allKeys])
        {
            if ([str isEqualToString:c])
                found = YES;
        }
        if (!found)
            [self.sections setValue:[[NSMutableArray alloc] init] forKey:c];
    }
    // Loop again and sort the Play into their respective keys
    for (Bookmark *bookmark in self.filteredListContent)
        [[self.sections objectForKey:[bookmark.playTitle substringToIndex:1]] addObject:bookmark];
    // Sort each section array
    for (NSString *key in [self.sections allKeys])
        [[self.sections objectForKey:key] sortUsingDescriptors:[NSArray arrayWithObject:[NSSortDescriptor sortDescriptorWithKey:@"playTitle" ascending:YES]]];
}

- (void)filterContentforText
{
    NSString* string = bookmarkSearchBar.text;
    [self.filteredListContent removeAllObjects]; // First clear the filtered array.
    for (Bookmark *product in _dataArray)
    {
        NSComparisonResult result = [product.playTitle compare:string options:(NSCaseInsensitiveSearch) range:NSMakeRange(0, string.length)];
        if (result == NSOrderedSame)
            [self.filteredListContent addObject:product];
    }
    [self setDataForPlay];
    [bookmarkTableView reloadData];
    [self checkStatusOfInfoLabel];
}

#pragma mark -
#pragma mark UIButton Event methods

- (IBAction)Back_Clicked:(id)sender
{
    AppDelegate* delegate=[UIApplication sharedApplication].delegate;
    [delegate.nyplMenuViewController showRequiredController:RootTabSelected];
    delegate.nyplMenuViewController.hidden=NO;
    bookmarkSearchBar.text=@"";
}

- (IBAction)Edit_Clicked:(id)sender
{
    if(bookmarkTableView.editing && [self.filteredListContent count] > 0) {
        [super setEditing:NO animated:NO];
        [bookmarkTableView setEditing:NO animated:NO];
        [bookmarkTableView reloadData];
        [doneBtn setImage:[UIImage imageNamed:@"btn_edit.png"] forState:UIControlStateNormal];

    } else if ([self.filteredListContent count] > 0) {
        [super setEditing:YES animated:YES];
        [bookmarkTableView setEditing:YES animated:YES];
        [bookmarkTableView reloadData];
        [doneBtn setImage:[UIImage imageNamed:@"btn_done.png"] forState:UIControlStateNormal];
    }
}

#pragma mark -
#pragma mark UITableView Datasource methods

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return [[self.sections valueForKey:[[[self.sections allKeys] sortedArrayUsingSelector:@selector(localizedCaseInsensitiveCompare:)] objectAtIndex:section]] count];
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    NSString *cellIdentifier = nil;
    cellIdentifier = [NSString stringWithFormat:@"cell%d%d",indexPath.row,indexPath.section];
    PlayCustomCell *cell = (PlayCustomCell*)[tableView dequeueReusableCellWithIdentifier:cellIdentifier];
    if (cell == nil)
    {
        UIViewController* viewController = [[UIViewController alloc] initWithNibName:@"PlayCustomCell" bundle:nil];
        cell = (PlayCustomCell*)viewController.view;
        viewController = nil;
    }
    Bookmark *bookmark = [[self.sections valueForKey:[[[self.sections allKeys] sortedArrayUsingSelector:@selector(localizedCaseInsensitiveCompare:)] objectAtIndex:indexPath.section]] objectAtIndex:indexPath.row];
    cell.titleLable.text = bookmark.playTitle;
    cell.authorLabel.text = bookmark.playAuthorName;
    UIFont* myFont=FONT_TAHOMA_BOLD(15);
    [cell.titleLable setFont:myFont];
    cell.titleLable.textColor = kColor(154, 4, 4, 1);

    myFont=FONT_TAHOMA_REGULAR(13);
    [cell.authorLabel setFont:myFont];
    cell.authorLabel.textColor = kColor(42, 42, 42, 1);

    cell.selectedBackgroundView = [[UIView alloc] initWithFrame:CGRectZero] ;
    cell.selectedBackgroundView.backgroundColor = kColor(106, 5, 5, 1);
    return cell;
}

#pragma mark -
#pragma mark UITableView Delegate methods

- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
    UIImage *image = [UIImage imageNamed:@"bar_red.png"];
    UIImageView *imageview = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, image.size.width, image.size.height)];
    imageview.image = image;
    UILabel *labelTitle = [[UILabel alloc] initWithFrame:CGRectMake(imageview.frame.size.width-20, image.size.height/2-11, 20, 20)];
    labelTitle.text = [[[self.sections allKeys] sortedArrayUsingSelector:@selector(localizedCaseInsensitiveCompare:)] objectAtIndex:section];
    UIFont* myfont=FONT_TAHOMA_BOLD(13);
    [labelTitle setFont:myfont];
    [imageview addSubview:labelTitle];
    labelTitle.backgroundColor = [UIColor clearColor];
    labelTitle.textColor = kColor(255, 154, 4, 1);
    return imageview;
}

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return [[self.sections allKeys] count];
}

- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
{
    return [[[self.sections allKeys] sortedArrayUsingSelector:@selector(localizedCaseInsensitiveCompare:)] objectAtIndex:section];
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{

    [bookmarkSearchBar resignFirstResponder];
    MainWebControllerViewController* mainWebControllerViewController=[[MainWebControllerViewController alloc] initWithNibName:@"MainWebControllerViewController" bundle:nil];

    Bookmark *bookmark = [[self.sections valueForKey:[[[self.sections allKeys] sortedArrayUsingSelector:@selector(localizedCaseInsensitiveCompare:)] objectAtIndex:indexPath.section]] objectAtIndex:indexPath.row];
    mainWebControllerViewController.playID=bookmark.playId;
    currentIndex=bookmark.versionNo;
    [self.navigationController pushViewController:mainWebControllerViewController animated:YES];
    bookmarkSearchBar.text=@"";
}

- (UITableViewCellEditingStyle)tableView:(UITableView *)aTableView
           editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (self.editing == NO || !indexPath)
        return UITableViewCellEditingStyleNone;
    else if (self.editing && indexPath.row == ([self.filteredListContent count]))
		return UITableViewCellEditingStyleInsert;
    else
		return UITableViewCellEditingStyleDelete;
    return UITableViewCellEditingStyleNone;
}

- (void)tableView:(UITableView *)aTableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle
forRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (editingStyle == UITableViewCellEditingStyleDelete) {
        DatabaseConnection *dcon = [DatabaseConnection sharedConnection];
        Bookmark *bookmarkObject =(Bookmark*) [[self.sections valueForKey:[[[self.sections allKeys] sortedArrayUsingSelector:@selector(localizedCaseInsensitiveCompare:)] objectAtIndex:indexPath.section]] objectAtIndex:indexPath.row];
        NSString* query = [NSString stringWithFormat:@"delete from BOOKMARK where PLAY_ID = \"%d\" and VERSION_NO=%d",bookmarkObject.playId,bookmarkObject.versionNo];
        [dcon deleteRowOfBookMarkTable:query];
        [self getDataForBookmarkTable];
        [aTableView reloadData];
        [self checkPropertyOfDoneButton];
        [self checkStatusOfInfoLabel];
    }
}

#pragma mark -
#pragma mark UITextfield Delegate methods

- (BOOL)textFieldShouldReturn:(UITextField *)textField
{
    [textField resignFirstResponder];
    return YES;
}

- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range
replacementString:(NSString *)string
{
    return YES;
}

- (void)textFieldDidEndEditing:(UITextField *)textField
{
    [self checkStatusOfInfoLabel];
}
@end


text:
<?php
// POST
if(!empty($_POST['action'])){
	switch($_POST['action']){
		case 'edit':
			$mod = SistemaModuloQuery::create()->findPk($_POST['id']);
			$mod->setDescripcion($_POST['desc']);
			$mod->setEtiqueta($_POST['etiqueta']);
			$mod->save();

			foreach($_POST['idRecurso'] as $idRec){
				$rec = SistemaRecursoQuery::create()->findPk($idRec);
				$rec->setEtiqueta($_POST['etiqueta_'.$idRec]);
				$rec->setNombre($_POST['nombre_'.$idRec]);
				$rec->setPosicion($_POST['posicion_'.$idRec]);
				$rec->setVisible($_POST['visible_'.$idRec]);
				$rec->setIdSistemaModulo($_POST['id']);
				$rec->save();
			}
			header('Location: ?module='.$_POST['module'].'&view='.$_POST['view'].'&action=edit&id='.$mod->getId().'&e=o');exit();
			break;
		case 'addRecursos':
			foreach ($_POST['idRecurso'] as $idRec){
				$rec = new SistemaRecurso();
				$rec->setEtiqueta($_POST['etiqueta_'.$idRec]);
				$rec->setIdSistemaModulo($_POST['id']);
				$rec->setNombre($_POST['nombre_'.$idRec]);
				$rec->setPosicion($_POST['posicion_'.$idRec]);
				$rec->setVisible($_POST['visible_'.$idRec]);
				$rec->save();
			}
			header('Location: ?module='.$_POST['module'].'&view='.$_POST['view'].'&action=edit&id='.$_POST['id'].'&e=o');exit();
			break;
	}
}

// GET
$titulo = 'Listado de Módulos';
$template = 'moduloList.html';
$html = null;
$tmp = new SmartyTemplate();

switch($_GET['action']){
	case 'add':
		$mod = SistemaModuloQuery::getSistemaModuloSinInstalarByNombre($_GET['id']);
		$mod->save();
		//---
		header('Location: ?module='.$_GET['module'].'&view='.$_GET['view'].'&e=o');exit();
		break;
	case 'edit':
		$titulo = 'Edición de Módulo';
		$template = 'moduloFrm.html';

		$modulo = SistemaModuloQuery::create()->findPk($_GET['id']);
		$recursos = array();

		foreach (SistemaRecursoQuery::create()->filterBySistemaModulo($modulo)->orderByPosicion()->find() as $r){
			//$r = new SistemaRecurso();
			$recursos[] = array(
				'posicion'=>$r->getPosicion(),
				'nombre'=>$r->getNombre(),
				'etiqueta'=>$r->getEtiqueta(),
				'id'=>$r->getId(),
				'visibleY'=>($r->getVisible()=='Y')?' checked="checked"':null,
				'visibleN'=>($r->getVisible()=='N')?' checked="checked"':null
			);
		}

		$recursosNuevos = array();
		$i = count($recursos)+1;
		foreach($modulo->getSistemaRecursosNoInstalados() as $r){
			$recursosNuevos[] = array(
				'posicion'=>$i,
				'nombre'=>$r->getNombre(),
				'etiqueta'=>$r->getEtiqueta(),
				'id'=>$r->getNombre(),
				'visibleY'=>($r->getVisible()=='Y')?' checked="checked"':null,
				'visibleN'=>($r->getVisible()=='N')?' checked="checked"':null
			);
		}

		$tmp->assign('recursos',$recursos);
		$tmp->assign('id',$modulo->getId());
		$tmp->assign('recursosNuevos',$recursosNuevos);
		$tmp->assign('nombre',$modulo->getNombre());
		$tmp->assign('etiqueta',$modulo->getEtiqueta());
		$tmp->assign('desc',$modulo->getDescripcion());
		$tmp->assign('action','edit');
		break;
	case 'del':
		break;
	default:
		$modulosInstalados = array();
	$i = 1;
	foreach(SistemaModuloQuery::create()->find() as $m){
		//$m = new SistemaModulo();
		$modulosInstalados[] = array(
				'numero'=>$i,
				'nombre'=>$m->getNombre(),
				'etiqueta'=>$m->getEtiqueta(),
				'recursos'=>$m->getSistemaRecursos()->count(),
				'descripcion'=>$m->getDescripcion(),
				'id'=>$m->getId()
		);
		$i++;
	}

	$modulosSinInstalar = array();
	$i = 1;
	foreach(SistemaModuloQuery::getSistemaModuloSinInstalar() as $m){
		//$m = new SistemaModulo();
		$modulosSinInstalar[] = array(
				'numero'=>$i,
				'nombre'=>$m->getNombre(),
				'etiqueta'=>$m->getEtiqueta(),
				'recursos'=>$m->getSistemaRecursos()->count(),
				'descripcion'=>$m->getDescripcion(),
				'id'=>$m->getNombre()
		);
		$i++;
	}

	$tmp->assign('modulosInstalados',$modulosInstalados);
	$tmp->assign('modulosSinInstalar',$modulosSinInstalar);
	break;
}

$tmp->assign('mensaje',$msj);
$tmp->assign('titulo',$titulo);
$tmp->assign('descripcion',$descripcion);
$html = $tmp->fetch($template);
?>


text:
module.exports = {
  path: 'grades',

  getComponents (cb) {
    require.ensure([], (require) => {
      cb(null, require('./components/Grades'))
    })
  }
}


text:
<?php
/**
 * Created by PhpStorm.
 * @author: Zbyszek Cichanski
 * Date: 30.12.2016
 * Time: 17:30
 */

namespace Core\Service\App\Command;

class TeacherCommand
{
    public $id;

    public $name;

    public $surname;

    public $email;
}


text:
void erasure_tool_run();

#endif


text:
Originally published: 2016-04-28 18:28:58
Last updated: 2016-04-28 18:28:59
Author: Vasudev Ram

This recipe shows how to find the sizes of various common data types in Python, both built-in and user-defined. It uses the sys.getsizeof() function and also discusses a few other points of interest.


text:
namespace safe_browsing {

namespace {

class FakeUploader : public TwoPhaseUploader {
 public:
  FakeUploader(base::TaskRunner* file_task_runner,
               const GURL& base_url,
               const std::string& metadata,
               const base::FilePath& file_path,
               FinishCallback finish_callback);
  ~FakeUploader() override {}

  void Start() override { start_called_ = true; }

  scoped_refptr<base::TaskRunner> file_task_runner_;
  GURL base_url_;
  std::string metadata_;
  base::FilePath file_path_;
  FinishCallback finish_callback_;

  bool start_called_;
};

FakeUploader::FakeUploader(base::TaskRunner* file_task_runner,
                           const GURL& base_url,
                           const std::string& metadata,
                           const base::FilePath& file_path,
                           FinishCallback finish_callback)
    : file_task_runner_(file_task_runner),
      base_url_(base_url),
      metadata_(metadata),
      file_path_(file_path),
      finish_callback_(std::move(finish_callback)),
      start_called_(false) {}

class FakeUploaderFactory : public TwoPhaseUploaderFactory {
 public:
  FakeUploaderFactory() : uploader_(nullptr) {}
  ~FakeUploaderFactory() override {}

  std::unique_ptr<TwoPhaseUploader> CreateTwoPhaseUploader(
      scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory,
      base::TaskRunner* file_task_runner,
      const GURL& base_url,
      const std::string& metadata,
      const base::FilePath& file_path,
      TwoPhaseUploader::FinishCallback finish_callback,
      const net::NetworkTrafficAnnotationTag& traffic_annotation) override;

  raw_ptr<FakeUploader> uploader_;
};

std::unique_ptr<TwoPhaseUploader> FakeUploaderFactory::CreateTwoPhaseUploader(
    scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory,
    base::TaskRunner* file_task_runner,
    const GURL& base_url,
    const std::string& metadata,
    const base::FilePath& file_path,
    TwoPhaseUploader::FinishCallback finish_callback,
    const net::NetworkTrafficAnnotationTag& traffic_annotation) {
  EXPECT_FALSE(uploader_);

  uploader_ = new FakeUploader(file_task_runner, base_url, metadata, file_path,
                               std::move(finish_callback));
  return base::WrapUnique(uploader_.get());
}

}  // namespace

class DownloadFeedbackTest : public testing::Test {
 public:
  DownloadFeedbackTest()
      : file_task_runner_(base::ThreadPool::CreateSequencedTaskRunner(
            {base::MayBlock(), base::TaskPriority::BEST_EFFORT})),
        io_task_runner_(content::GetIOThreadTaskRunner({})),
        feedback_finish_called_(false) {
    EXPECT_NE(io_task_runner_, file_task_runner_);
    shared_url_loader_factory_ =
        base::MakeRefCounted<network::TestSharedURLLoaderFactory>();
  }

  void SetUp() override {
    ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
    upload_file_path_ = temp_dir_.GetPath().AppendASCII("test file");
    upload_file_data_ = "data";
    ASSERT_EQ(static_cast<int>(upload_file_data_.size()),
              base::WriteFile(upload_file_path_, upload_file_data_.data(),
                              upload_file_data_.size()));
    TwoPhaseUploader::RegisterFactory(&two_phase_uploader_factory_);
  }

  void TearDown() override { TwoPhaseUploader::RegisterFactory(nullptr); }

  FakeUploader* uploader() const {
    return two_phase_uploader_factory_.uploader_;
  }

  void FinishCallback() {
    EXPECT_FALSE(feedback_finish_called_);
    feedback_finish_called_ = true;
  }

 protected:
  base::ScopedTempDir temp_dir_;
  base::FilePath upload_file_path_;
  std::string upload_file_data_;
  content::BrowserTaskEnvironment task_environment_;
  scoped_refptr<base::SequencedTaskRunner> file_task_runner_;
  scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_;
  FakeUploaderFactory two_phase_uploader_factory_;
  scoped_refptr<network::TestSharedURLLoaderFactory> shared_url_loader_factory_;

  bool feedback_finish_called_;
};

TEST_F(DownloadFeedbackTest, CompleteUpload) {
  ClientDownloadReport expected_report_metadata;
  auto* request = expected_report_metadata.mutable_download_request();
  request->set_url("http://test");
  request->set_length(upload_file_data_.size());
  request->mutable_digests()->set_sha1("hi");
  expected_report_metadata.mutable_download_response()->set_verdict(
      ClientDownloadResponse::DANGEROUS_HOST);
  std::string ping_request(
      expected_report_metadata.download_request().SerializeAsString());
  std::string ping_response(
      expected_report_metadata.download_response().SerializeAsString());

  std::unique_ptr<DownloadFeedback> feedback = DownloadFeedback::Create(
      shared_url_loader_factory_, file_task_runner_.get(), upload_file_path_,
      ping_request, ping_response);
  EXPECT_FALSE(uploader());

  feedback->Start(base::BindOnce(&DownloadFeedbackTest::FinishCallback,
                                 base::Unretained(this)));
  ASSERT_TRUE(uploader());
  EXPECT_FALSE(feedback_finish_called_);
  EXPECT_TRUE(uploader()->start_called_);

  EXPECT_EQ(file_task_runner_, uploader()->file_task_runner_);
  EXPECT_EQ(upload_file_path_, uploader()->file_path_);
  EXPECT_EQ(expected_report_metadata.SerializeAsString(),
            uploader()->metadata_);
  EXPECT_EQ(DownloadFeedback::kSbFeedbackURL, uploader()->base_url_.spec());

  EXPECT_TRUE(base::PathExists(upload_file_path_));

  EXPECT_FALSE(feedback_finish_called_);
  std::move(uploader()->finish_callback_)
      .Run(TwoPhaseUploader::STATE_SUCCESS, net::OK, 0, "");
  EXPECT_TRUE(feedback_finish_called_);
  feedback.reset();
  content::RunAllTasksUntilIdle();
  EXPECT_FALSE(base::PathExists(upload_file_path_));
}

TEST_F(DownloadFeedbackTest, CancelUpload) {
  ClientDownloadReport expected_report_metadata;
  auto* request = expected_report_metadata.mutable_download_request();
  request->set_url("http://test");
  request->set_length(upload_file_data_.size());
  request->mutable_digests()->set_sha1("hi");
  expected_report_metadata.mutable_download_response()->set_verdict(
      ClientDownloadResponse::DANGEROUS_HOST);
  std::string ping_request(
      expected_report_metadata.download_request().SerializeAsString());
  std::string ping_response(
      expected_report_metadata.download_response().SerializeAsString());

  std::unique_ptr<DownloadFeedback> feedback = DownloadFeedback::Create(
      shared_url_loader_factory_, file_task_runner_.get(), upload_file_path_,
      ping_request, ping_response);
  EXPECT_FALSE(uploader());

  feedback->Start(base::BindOnce(&DownloadFeedbackTest::FinishCallback,
                                 base::Unretained(this)));
  ASSERT_TRUE(uploader());
  EXPECT_FALSE(feedback_finish_called_);
  EXPECT_TRUE(uploader()->start_called_);
  EXPECT_TRUE(base::PathExists(upload_file_path_));

  feedback.reset();
  EXPECT_FALSE(feedback_finish_called_);

  content::RunAllTasksUntilIdle();
  EXPECT_FALSE(base::PathExists(upload_file_path_));
}

}  // namespace safe_browsing


text:
<!doctype html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="chrome=1">
    <title>{{ page.title }}</title>
    <link rel="stylesheet" href="stylesheets/styles.css">
    <link rel="stylesheet" href="stylesheets/pygment_trac.css">

    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">

Hacker Breakfast

Spokane's Weekly Nerd Meetup

        {{ content }}

        site maintained by elasticdog
        hosted on github pages — theme by mattgraham


text:
PostgreSQL create large object with given oid
--SKIPIF--
<?php
include("skipif.inc");
$v = pg_version($conn);
if (version_compare("8.3", $v["client"]) > 0) die("skip - requires pg client >= 8.3\n");
if (version_compare("8.3", $v["server"]) > 0) die("skip - requires pg server >= 8.3\n");
?>
--FILE--
<?php

include('config.inc');

$db = pg_connect($conn_str);

echo "create LO from int\n";
pg_exec ($db, "begin");
$oid = pg_lo_create ($db, 21000);
if (!$oid) echo ("pg_lo_create() error\n");
if ($oid != 21000) echo ("pg_lo_create() wrong id\n");
pg_lo_unlink ($db, $oid);
pg_exec ($db, "commit");

echo "create LO from string\n";
pg_exec ($db, "begin");
$oid = pg_lo_create ($db, "21001");
if (!$oid) echo ("pg_lo_create() error\n");
if ($oid != 21001) echo ("pg_lo_create() wrong id\n");
pg_lo_unlink ($db, $oid);
pg_exec ($db, "commit");

echo "create LO using default connection\n";
pg_exec ("begin");
$oid = pg_lo_create (21002);
if (!$oid) echo ("pg_lo_create() error\n");
if ($oid != 21002) echo ("pg_lo_create() wrong id\n");
pg_lo_unlink ($oid);
pg_exec ("commit");

echo "OK";
?>
--EXPECT--
create LO from int
create LO from string
create LO using default connection
OK


text:
<?php

/**
 * 顧客のデータを削除する。
 *
 * @package VizualizerMember
 * @author Naohisa Minagawa <info@vizualizer.jp>
 */
class VizualizerMember_Module_Customer_Delete extends Vizualizer_Plugin_Module_Save
{

    function execute($params)
    {
        $post = Vizualizer::request();
        $post->set("save", $post["delete"]);
        $post->set("delete_flg", "1");
        $this->executeImpl("Member", "Customer", "customer_id");
        $post->remove("delete");
        $post->remove("save");
        $post->remove("delete_flg");
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

    <link rel="stylesheet" type="text/css" href="../mrald.css" media="screen" title="Gila (screen)" />

    <title>MRALD license and included libraries</title>

Acknowledgements

We acknowledge the following for contributions that made MRALD possible.

The Apache Software Foundation for Tomcat - our preferred application server - and the Commons Upload facility.

Sun Microsystems for Java and the JavaMail API and the Java Beans Activation Framework.

The JUnit project and the Mock Objects project for making our unit testing possible.

The MITRE Corporation.  The CAASD Repository System project, the Neuroinformatics project, and the Technology Transfer Office.

The Baseball Databank for allowing us to redistribute part of their baseball database as an example datasource.


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PrintPartOfASCIITable
{
    class Program
    {
        static void Main(string[] args)
        {
            int charOne = int.Parse(Console.ReadLine());
            int charTwo = int.Parse(Console.ReadLine());
            for (int i = charOne; i <= charTwo; i++)
            {
                Console.Write((char)i + " ");
            }
        }
    }
}


text:
package com.appspot;

import com.google.appengine.api.datastore.Blob;
import com.googlecode.objectify.ObjectifyService;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

/**
 * Created by eljah32 on 12/22/2015.
 */
public class BlobServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        long filedate=Long.parseLong(req.getParameter("date"));
        fileFor(filedate, resp);
    }

    void fileFor(long date, HttpServletResponse res) {

        UploadedFile file = new UploadedFile(date);
        Blob fileBytes = file.getFile();

        // serve the first image
        res.setContentType("application/vnd.ms-excel");
        res.setHeader("Content-Disposition", "attachment; filename="+file.getName());
        try {
            res.getOutputStream().write(fileBytes.getBytes());
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}