text:
var expect = require('expect.js');
var Quantimodo = require('../../index');
var instance;
beforeEach(function(){
    instance = new Quantimodo.Explanation();
});
describe('Explanation', function(){
    it('should create an instance of Explanation', function(){
        // uncomment below and update the code to test Explanation
        //var instance = new Quantimodo.Explanation();
        //expect(instance).to.be.a(Quantimodo.Explanation);
    });
    it('should have the property description (base name: "description")', function(){
        // uncomment below and update the code to test the property description
        //var instance = new Quantimodo.Explanation();
        //expect(instance).to.be();
    });
    it('should have the property image (base name: "image")', function(){
        // uncomment below and update the code to test the property image
        //var instance = new Quantimodo.Explanation();
        //expect(instance).to.be();
    });
    it('should have the property ionIcon (base name: "ionIcon")', function(){
        // uncomment below and update the code to test the property ionIcon
        //var instance = new Quantimodo.Explanation();
        //expect(instance).to.be();
    });
    it('should have the property startTracking (base name: "startTracking")', function(){
        // uncomment below and update the code to test the property startTracking
        //var instance = new Quantimodo.Explanation();
        //expect(instance).to.be();
    });
    it('should have the property title (base name: "title")', function(){
        // uncomment below and update the code to test the property title
        //var instance = new Quantimodo.Explanation();
        //expect(instance).to.be();
    });
    it('should have the property html (base name: "html")', function(){
        // uncomment below and update the code to test the property html
        //var instance = new Quantimodo.Explanation();
        //expect(instance).to.be();
    });
});

redpajama_set_name: RedPajamaGithub


text:
/**
 * Created by hender on 11/02/16.
 */

(function(){
    'use strict';

    /**
     * @ngdoc function
     * @name SolucionesCucutaApp.controller:IndexCtrl
     * @description
     * # IndexCtrl
     * Controller of the SolucionesCucutaApp
     */
    angular.module('SolucionesCucutaApp')
        .controller('IndexCtrl', [
            "$rootScope",
            "$mdMedia",
            "$translatePartialLoader",
            "pempoLocalStorage",
            "pempoResource",
            '$state',
            '$mdToast',
            '$mdDialog',
            '$mdBottomSheet',
            'templateCache',
            '$clientid',
            '$clientsecret',
            '$location',
            'Connect',
            '$q',
            '$timeout',
            '$log',
            IndexCtrl]);

    function IndexCtrl(
        $rootScope,
        $mdMedia,
        $translatePartialLoader,
        pempoLocalStorage,
        pempoResource,
        $state,
        $mdToast,
        $mdDialog,
        $mdBottomSheet,
        templateCache,
        $clientid,
        $clientsecret,
        $location,
        Connect,
        $q,
        $timeout,
        $log
    ) {
        console.log('IndexCtrl');

        /*Connect.checkAuthenticated().then(function(isAuthenticated){
            console.log('isAuthenticated', isAuthenticated)
            if(isAuthenticated){
                $log.log('OK')
            }else{
                $log.error('BAD')
            }
        });*/

        $translatePartialLoader.addPart('index');

        var
            almacen         = pempoLocalStorage,
            vm              = this,
            identity        = {},
            host            = $location.host(),
            path            = $location.path(),
            watches         = {},
            Menu            = pempoResource('menu'),
            Publicacion     = pempoResource('publicacion'),
            Usuario         = pempoResource('usuario'),
            menuDirectorio  = []
        ;

        Menu.filter({
            // Menú Directorio
            tipo: '5717e66041201db50a61b484'
        }).then(function(rta){
            rta.$promise.then(function(menus){
                // quitar al crear el tipo de menu directorio
                menus = menus.filter(function(menu, key){
                    return menu.nombre.toLowerCase() === 'empresas'
                });
                menuDirectorio = menus[0];
                vm.menu = menuDirectorio && menuDirectorio.submenu;
            });
        });

        /*Publicacion.filter({
            // Usuario Súper Admin
            usuario: '5716eb93a3580a9f4fb63cf9',
            // Publicación Principal
            tipo: '5718bd248b3eb386310287c1',
            // Publicado
            estado: '5718cb7930af6e38379cb4c0'
        }).then(function(publicaciones){
            //console.log(publicaciones)
            vm.publicaciones = publicaciones;
        });*/

        Usuario.filter({
            // Rol Empresa
            rol: '5717e66041201db50a61b484'
        }).then(function(empresas){
            console.log(empresas)
            vm.empresas = empresas;
        });

        // Initialize Credentials
        //$rootScope.theme            = $rootScope.theme || 'solucionescucuta';
        $rootScope.exit             = Connect.exit;
        $rootScope.getIdentity      = Connect.getIdentity;
        $rootScope.isAuthenticated  = Connect.isAuthenticated();
        $rootScope.template         = templateCache;

        //vm.templateLogin    = templateCache.get('login');
        vm.search          = {
            label:  'que estás buscando?',
            filter: filterQuery,
            query:  '',
            button: {
                label:  'buscar'/*,
                icon:   'magnify'*/
            }
        };

        vm.isState          = isState;
        vm.isAdmin          = isAdmin;
        vm.credentials      = {
            /*email:      '',
            username:   '',
            password:   '',
            password2:  ''*/
        };
        vm.register     = Connect.register;
        //vm.checkEmail   = Connect.infoToken;
        vm.captchaData  = {};
        vm.authenticate = authenticated;

        vm.images = [
            {
                src: 'images/cover.jpg',
                title: 'Soluciones Cúcuta'
            },
            {
                src: 'images/cover-cian.jpg',
                title: 'Soluciones Cúcuta'
            },
            {
                src: 'images/cover-grey.jpg',
                title: 'Soluciones Cúcuta'
            },
            {
                src: 'images/cover-magenta.jpg',
                title: 'Soluciones Cúcuta'
            }
        ];

        $rootScope.$watchCollection(function(){return vm.credentials}, Connect.isValidCredentials);

        //console.log($location);

        almacen.$sync();

        //Connect.checkAuthenticated();
        $rootScope.$on('$viewContentLoading', function(event, viewConfig){
            // Access to all the view config properties.
            // and one special property 'targetView'
            // viewConfig.targetView
            //Connect.checkAuthenticated();
            $rootScope.loading = false;
        });
        $rootScope.$on('$stateChangeStart',
            function(event, toState, toParams, fromState, fromParams, options){
                $rootScope.loading = true;
            });

        function filterQuery(item, index,list){
            var found = true;
            if(!_.isEmpty(vm.search.query) && angular.isString(vm.search.query)){
                //console.log(item)
                var querycanonical = _.kebabCase(_.deburr(vm.search.query));
                found = item.canonical.indexOf(querycanonical) > -1;
            }
            return found;
        }

        function authenticated(){
            Connect.authenticate(vm.credentials);
        }

        function isValid(){
            return Connect.isValidCredentials(vm.credentials, vm.captchaData);
        }

        function isState(statename, params, opts){
            var isState = false;
            opts = opts || {};
            params = params || {};
            if(angular.isString(statename)){
                isState = $state.is(statename, params, opts);
            }
            return isState;
        }

        function isAdmin(){
            return isState('index.admin');
        }
    }
})();


text:
"""
views.py

URL route handlers

Note that any handler params must match the URL route params.
For example the *say_hello* handler, handling the URL route '/hello/<username>',
  must be passed *username* as the argument.

"""
from google.appengine.api import users
from google.appengine.runtime.apiproxy_errors import CapabilityDisabledError
import datetime

from flask import request, render_template, flash, url_for, redirect

from flask_cache import Cache

from application import app
from models import TestResult, TestRun

# Flask-Cache (configured to use App Engine Memcache API)
cache = Cache(app)

def home():
    testruns = TestRun.query()
    return render_template('index.html', testruns=testruns)

def result_list(testrun_id):
    testrun = TestRun.get_by_id(testrun_id)
    test_results = TestResult.query(TestResult.testRun == testrun.key).fetch()
    return render_template('result_list.html', test_results=test_results)

def result_detail(result_id):

    return "hi"

def warmup():
    """App Engine warmup handler
    See http://code.google.com/appengine/docs/python/config/appconfig.html#Warming_Requests

    """
    return ''


text:
[% page.title = 'Parrot 0.4.15 "Augean Stable" Released!' %]
[% page.style = "default.html" %]

Parrot 0.4.15 "Augean Stable" Released!

August 22, 2007

The Parrot team is proud to announce Parrot 0.4.15
"Augean Stable." Parrot
is a virtual machine aimed at running all dynamic languages.

Parrot 0.4.15 can be obtained via CPAN
(soon), or follow the download instructions.
For those who would like to develop on Parrot, or help develop Parrot itself,
we recommend using Subversion
or SVK
on our source code repository
to get the latest and best Parrot code.

Parrot 0.4.15 News:

- Implementation:
 + Lots of code review, many bugs fixed
 + Many more code cleanups and compiler warning levels
 + Started a new jit engine for 64-bit processors
 + Refactored configure process, with tests and new diagnostic options
 + Added new CodeString PMC for dynamic generation of PIR code
 + More pdd15 support for object metamodel.
- Languages:
 + Added NQP ("Not Quite Perl"), a very lightweight Perl 6-like language
 + Significant improvements and refactors to PCT (Parrot Compiler Toolkit)
 + perl6 passes more spec tests
 + Lua works now with a PGE/TGE/PAST-pm based compiler, lives in one pbc,
   and the interpreter has same behavior as original.
- Documentation
 + Added a committers' HOWTO
 + More PIR tutorial examples
 + Added PAUSE guide

Thanks to all our contributors for making this possible, and our
sponsors for supporting this project.

Enjoy!


text:
namespace p4_symbolic {
namespace symbolic {
namespace values {

// This class is responsible for translating string values into consistent
// numberic ids, that can then be used to create bitvector values to use in
// z3.
// It also handles the reverse translation of previously allocated ids to
// their corresponding string value.
class IdAllocator {
 public:
  // Allocates an arbitrary integer id to this string identifier.
  // The Id is guaranteed to be consistent (the same bitvector is
  // allocated to equal strings), and unique per instance of this class.
  uint64_t AllocateId(const std::string &string_value);

  // Reverse translation of an allocated bit vector to the string value for
  // which it was allocated.
  gutil::StatusOr<std::string> IdToString(uint64_t value) const;

 private:
  // A mapping from string values to bitvector values.
  std::unordered_map<std::string, uint64_t> string_to_id_map_;

  // A mapping from bitvector values to string values.
  std::unordered_map<uint64_t, std::string> id_to_string_map_;

  // Counter used to come up with new values per new allocation.
  uint64_t counter_ = 0;
};

// This struct stores all the state that is required to translate string values
// to internal bitvectors per custom p4 type (e.g. vrf_t), and reverse translate
// bitvector values of fields of such a custom type to a string value.
struct P4RuntimeTranslator {
  // Maps a type name to an allocator responsible for translating values for
  // that type.
  // We have an instance of the allocator class per translatable type.
  // The generated ids are unique only per type, different types may re-use
  // the same id.
  std::unordered_map<std::string, IdAllocator> p4runtime_translation_allocators;
  // Maps field name to a type name, only for fields we were able to detect had
  // a custom p4 type with a @p4runtime_translation annotation attached to it.
  // This information is not available in the bmv2 file, since it strips away
  // type aliases and  annotations, so we must build it ourselves with a best
  // effort approach.
  std::unordered_map<std::string, std::string> fields_p4runtime_type;
};

// Transforms a hex string literal from bmv2 json to a pdpi::IrValue
gutil::StatusOr<pdpi::IrValue> ParseIrValue(std::string value);

// Transforms a value read from bmv2 (e.g. hardcoded in the program)
// to a z3::expr.
// Essentially, this is just a formatting function that can format ipv4, ipv6
// hexstrings, and macs as bitvectors in z3's format.
// This function does not perform any string translation, and instead assumes
// the values are already in the actual domain of values in the p4 program,
// because p4 and bmv2 both do not support string translation, it is only used
// as a logical translation at the boundry between P4RT and bmv2.
gutil::StatusOr<z3::expr> FormatBmv2Value(const pdpi::IrValue &value);

// Transforms a value read from a table entry to a z3::expr.
// On top of formatting ipv4, ipv6, hexstrings, and macs as bitvectors,
// this function also translates string values to unique bitvectors.
// The mapping of strings to bitvectors is stored in the translator state,
//  and used to map the same string to the same consistent bitvector, and to
// do a reverse-translation when extracting values for headers and fields from
// the z3 model.
gutil::StatusOr<z3::expr> FormatP4RTValue(const std::string &field_name,
                                          const std::string &type_name,
                                          const pdpi::IrValue &value,
                                          P4RuntimeTranslator *translator);

// Reverse translation: operates opposite to FormatP4RTValue().
// If the given field was not detected to be translatable (perhaps it is indeed
// not translatable), the function returns the value unchanged.
// If the given field was detected to be translatable (e.g. some values for it
// were previously translated by a call to FormatP4RTValue), then the value
// is looked up using the reverse mapping inside the given translator, if that
// look fails, an absl error is returned.
gutil::StatusOr<std::string> TranslateValueToP4RT(
    const std::string &field_name, const std::string &value,
    const P4RuntimeTranslator &translator);

}  // namespace values
}  // namespace symbolic
}  // namespace p4_symbolic

#endif  // P4_SYMBOLIC_SYMBOLIC_VALUES_H_


text:
.app-phone-images {
    background-color: white;
    width: 400px;
    height: 400px;
    overflow: hidden;
    position: relative;
    float: left;
}

.app-phone-images img {
    float: left;
    margin-right: 2em;
    height: 350px;
    width: 350px;
}

.app-phone-thumbs {
    margin: 0;
    list-style: none;
}

.app-phone-thumbs li {
    margin: 1em;
    border: 1px solid black;
    display: inline-block;
    background-color: white;
}

.app-phone-thumbs img {
    height: 100px;
    width: 100px;
    padding: 1em;
}

.app-phone-thumbs img:hover {
    cursor: pointer;
}


text:
Submit a new work order

        <form class="form-horizontal" method="post" id="submit-order-form">

                Account

                    <input type="text" class="form-control" id="inputAccount" placeholder="#<%= user.account.acct %>" readonly>

                Phone

                    <input type="number" class="form-control" id="inputPhone">

                Email

                    <input type="email" class="form-control" id="inputEmail" placeholder="<%= user.email %>">

                Quantity

                    <input type="number" class="form-control" id="inputQuantity">

                Description

                    <textarea id="inputDescription" class="form-control" rows="3"></textarea>

                Tracking
                    Info

                    <input type="text" class="form-control" id="inputTracking">

                I require the following:

                            <input id="service-1" type="checkbox" value="">
                            Service 1

                            <input id="service-2" type="checkbox" value="">
                            Service 2

                            <input id="service-3" type="checkbox" value="">
                            Service 3

                            <input id="service-4" type="checkbox" value="">
                            Service 4

                            <input id="service-5" type="checkbox" value="">
                            Service 5

                            <input id="service-6" type="checkbox" value="">
                            Service 6

                            <input id="service-7" type="checkbox" value="">
                            Service 7

                            <input id="misc-services" type="checkbox" value="">
                            Misc. service (please provide further details)

                    Further
                        details

                        <textarea id="inputMisc" class="form-control" rows="3"></textarea>

Please note that by clicking Submit, you acknowledge that you have read, understood, and
                        agree to all terms listed in the User Agreement.

                    <button type="submit" class="btn btn-primary">Submit Order</button>

        </form>


text:
package com.golshadi.majid.report;

import com.golshadi.majid.Utils.helper.FileUtils;
import com.golshadi.majid.core.enums.TaskStates;
import com.golshadi.majid.database.elements.Chunk;
import com.golshadi.majid.database.elements.Task;
import org.json.JSONException;
import org.json.JSONObject;

import java.util.List;

/**
 * Created by Majid Golshadi on 4/10/2014.
 */
public class ReportStructure {

    private int id;
    private String name;
    private int state;
    private String url;
    private long fileSize;
    private boolean resumable;
    private String type;
    private int chunks;
    private double percent;
    private long downloadLength;
    private String saveAddress;
    private boolean priority;

    public long setDownloadLength(long downloadedLength){
        return downloadLength += downloadedLength;
    }

    public long getTotalSize(){
        return fileSize;
    }

    public boolean isResumable(){
        return resumable;
    }

    public ReportStructure setObjectValues(Task task, List<Chunk> taskChunks){
        this.id = task.id;
        this.name = task.name;
        this.state = task.state;
        this.resumable = task.resumable;
        this.url = task.url;
        this.fileSize = task.size;
        this.type = task.extension;
        this.chunks = task.chunks;
        this.priority = task.priority;
        this.saveAddress = task.save_address+"/"+task.name+"."+task.extension;

        this.percent = calculatePercent(task, taskChunks);

        return this;
    }

    /** calculate download percent from compare chunks size with real file size **/
    private double calculatePercent(Task task, List<Chunk> chunks){
    	// initialize report
    	double report = 0;

    	// if download not completed we have chunks
    	if (task.state != TaskStates.DOWNLOAD_FINISHED) {
	        int sum = 0;
	        for (Chunk chunk : chunks){
	            this.downloadLength += FileUtils.size(task.save_address, String.valueOf(chunk.id));
	        }

	        if (task.size > 0) {
	            report = ((float)downloadLength / task.size * 100);
	        }
    	} else {
    		this.downloadLength = task.size;
    		report = 100;
    	}

    	return report;
    }

    public JSONObject toJsonObject(){
        JSONObject json = new JSONObject();
        try {
            return json.put("token", String.valueOf(id))
                    .put("name", name)
                    .put("state", state)
                    .put("resumable", resumable)
                    .put("fileSize", fileSize)
                    .put("url", url)
                    .put("type", type)
                    .put("chunks", chunks)
                    .put("percent", percent)
                    .put("downloadLength", downloadLength)
                    .put("saveAddress", saveAddress)
                    .put("priority", priority);

        } catch (JSONException e) {
            e.printStackTrace();
        }

        return json;
    }
}


text:
@class MPHMenuController;
@class MPHRulesTableWindowController;

@interface MPHApplicationDelegate : NSObject <NSApplicationDelegate> {
@private
	MPHMenuController *_menuController;
}

@property (assign) IBOutlet NSWindow *window;

- (IBAction) showPreferences:(id) sender;

@property (nonatomic, readonly) MPHRulesTableWindowController *rulesTableWindowController;
@end


text:
"""
Benchmarks (string size = 10):
- Took 6.607ms to sort 1000 elements.
- Took 86.542ms to sort 10000 elements.
- Took 1091.928ms to sort 100000 elements.
"""
import time

from strings.three_way_quicksort import sort
from utils.arrays import is_sorted
from utils.strings import generate_random_string

if __name__ == "__main__":
    string_size = 10
    number_of_strings = 1000
    random_strings = [generate_random_string(string_size) for _ in range(number_of_strings)]

    t0 = time.time()
    sort(random_strings)
    t1 = time.time()

    if not is_sorted(random_strings):
        raise Exception('The array was not correctly sorted.')
    print('Took {:.3f}ms to sort {} elements.'.format((t1 - t0) * 1000, number_of_strings))

    # with open("msd_string_sort_usage_data.txt", "w") as f:
    #    for string in sorted_strings:
    #        f.write(string + "\n")


text:
package org.databene.commons.tree;

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

/**
 * Default implementation of a tree node.
 * Created: 08.05.2007 19:06:49
 * @param <E> the type of the wrapped object
 * @author Volker Bergmann
 */
public class DefaultTreeNode<E> {

    private DefaultTreeNode<E> parent;
    private boolean leaf;
    private List<DefaultTreeNode<E>> children;
    protected E object;

    public static <T> DefaultTreeNode<T> createLeaf(DefaultTreeNode<T> parent, T object) {
        return new DefaultTreeNode<T>(parent, object, true);
    }

    public static <T> DefaultTreeNode<T> createFolder(DefaultTreeNode<T> parent, T object) {
        return new DefaultTreeNode<T>(parent, object, false);
    }

    public DefaultTreeNode(E object) {
        this(null, object);
    }

    public DefaultTreeNode(DefaultTreeNode<E> parent, E object) {
        this(parent, object, false);
    }

    public DefaultTreeNode(DefaultTreeNode<E> parent, E object, boolean leaf) {
        this.parent = parent;
        this.leaf = leaf;
        this.children = new ArrayList<DefaultTreeNode<E>>();
        this.object = object;
    }

    public void addChild(DefaultTreeNode<E> child) {
        if (leaf)
            throw new IllegalStateException("Can't add a child to a leaf");
        children.add(child);
    }

    public DefaultTreeNode<E> getParent() {
        return parent;
    }

    public DefaultTreeNode<E> getChild(int index) {
        return children.get(index);
    }

    public int getChildCount() {
        return children.size();
    }

    public boolean isLeaf() {
        return leaf;
    }

    public int getIndexOfChild(DefaultTreeNode<E> child) {
        return children.indexOf(child);
    }

    public E getObject() {
        return object;
    }

    @Override
    public String toString() {
        return String.valueOf(object);
    }
}


text:
module Grape
  module ActiveModelSerializers
    VERSION = '1.3.1'
  end
end


text:
import pytest

from api.base.settings.defaults import API_BASE
from osf.models.metaschema import FileMetadataSchema
from osf_tests.factories import (
    AuthUserFactory,
)

@pytest.mark.django_db
class TestFileMetadataSchemaList:

    def test_schema_list_crud(self, app):

        user = AuthUserFactory()
        url = '/{}schemas/files/'.format(API_BASE)

        # test_authenticated_user_can_view_schemas
        res = app.get(url, auth=user.auth)
        assert res.status_code == 200
        assert (len(res.json['data']) == FileMetadataSchema.objects.filter(active=True).count())

        # test_cannot_create_schemas
        res = app.post_json_api(url, auth=user.auth, expect_errors=True)
        assert res.status_code == 405

        # test_unauthenticated_user_can_view_schemas
        res = app.get(url)
        assert res.status_code == 200


text:
require 'action_dispatch'
require 'rails_4_session_flash_backport/rails3/flash_hash'

describe ActionDispatch::Flash::FlashHash, "hax" do

  let(:rails_2_marshaled) { "\x04\bIC:'ActionController::Flash::FlashHash{\a:\vnoticeI\"\x11I'm a notice\x06:\x06ET:\nerrorI\"\x11I'm an error\x06;\aT\x06:\n@used{\a;\x06T;\bF" }
  let(:rails_3_marshaled) { "\x04\bo:%ActionDispatch::Flash::FlashHash\t:\n@usedo:\bSet\x06:\n@hash{\x06:\vnoticeT:\f@closedF:\r@flashes{\a;\tI\"\x11I'm a notice\x06:\x06EF:\nerrorI\"\x11I'm an error\x06;\fF:\t@now0" }
  let(:rails_2_vanilla)   { Marshal.load(rails_2_marshaled) }
  let(:rails_3_vanilla)   { Marshal.load(rails_3_marshaled) }
  let(:rails_4_style)     { {'flashes' => {:notice => "I'm a notice", :error => "I'm an error"}, 'discard' => [:notice]} }
  let(:rails_2_marshaled) { "\x04\bIC:'ActionController::Flash::FlashHash{\a:\vnoticeI\"\x11I'm a notice\x06:\x06ET:\nerrorI\"\x11I'm an error\x06;\aT\x06:\n@used{\a;\x06T;\bF" }
  let(:rails_2_vanilla) { Marshal.load(rails_2_marshaled) }

  it "happily unmarshals a Rails 2 session without exploding" do
    Marshal.load(rails_2_marshaled).should be_a(ActionController::Flash::FlashHash)
  end

  context "#from_session_value" do
    def this_is_the_flash_hash_were_looking_for(flash_hash)
      flash_hash.should be_a(described_class)
      flash_hash[:notice].should == "I'm a notice"
      flash_hash[:error].should == "I'm an error"
      flash_hash.sweep
      flash_hash[:notice].should be_nil
      flash_hash[:error].should == "I'm an error"
    end

    it "decodes rails 2 style to an empty FlashHash" do
      this_is_the_flash_hash_were_looking_for(ActionDispatch::Flash::FlashHash.from_session_value(rails_2_vanilla))
    end

    it "decodes rails 3 style to a FlashHash" do
      this_is_the_flash_hash_were_looking_for(ActionDispatch::Flash::FlashHash.from_session_value(rails_3_vanilla))
    end

    it "decodes rails 4 style to a FlashHash" do
      this_is_the_flash_hash_were_looking_for(ActionDispatch::Flash::FlashHash.from_session_value(rails_4_style))
    end
  end

  context "#to_session_value" do
    it "dumps to basic objects like rails 4" do
      rails_3_vanilla.to_session_value.should be_a(Hash)
      rails_3_vanilla.to_session_value.should == rails_4_style
    end
  end

end


text:
@interface UIColor (DLColor)
+ (instancetype)dl_colorWithHex:(unsigned int) hex;
+ (instancetype)dl_randomColor;
+ (instancetype)dl_randomColorWithAlpha:(double)alpha;
@end


text:
set -eo pipefail -o nounset

## Get the .genome  file
genome=https://raw.githubusercontent.com/gogetdata/ggd-recipes/master/genomes/Homo_sapiens/GRCh38/GRCh38.genome

## Get the structural variant file, sort it, bgzip it, tabix it
wget --quiet ftp://ftp.ensembl.org/pub/release-99/variation/vcf/homo_sapiens/homo_sapiens_structural_variations.vcf.gz

## Get the reference genome
fai_file=$(ggd get-files grch38-reference-genome-ensembl-v1 --pattern "*.fai")
bcftools reheader --fai $fai_file homo_sapiens_structural_variations.vcf.gz  > homo_sapiens_structural_variations.vcf

gsort homo_sapiens_structural_variations.vcf $genome \
    | bgzip -c > grch38-structural-variants-ensembl-v1.vcf.gz

tabix grch38-structural-variants-ensembl-v1.vcf.gz

rm homo_sapiens_structural_variations.vcf.gz
rm homo_sapiens_structural_variations.vcf


text:
typedef int Int;
typedef char Char;
typedef Char* Carp;

Int main(Int argc, Carp argv[]) {
}


text:
import TooltipsterComponent from 'ember-cli-tooltipster/components/tool-tipster';

export default TooltipsterComponent.extend({
  tagName: 'button',

  classNames: ['my-awesome-button'],

  // define properties
  content: 'My awesome tooltip button',

  side: 'right',

  timer: 2000, // tooltip will close automatically after 2 seconds

  theme: 'tooltipster-noir'
});


text:
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using HolojamEngine;
using UnityEngine.EventSystems;
namespace AssemblyCSharp {
    public class WiiPointerBrush : MonoBehaviour, IGlobalWiiMoteAHandler, IGlobalWiiMoteBPressDownHandler, IGlobalWiiMoteOneHandler {

        public bool debugMode = true;

        public WiiMoteModule module;
        public BulbManager BM;
        public Stroke strokePrefab;

        public bool IsDrawing {
            get { return activeBulb; }
        }

        public Bulb activeBulb;

        private float timer = 0f;

        Ray ray;
        RaycastHit hit;

        void OnDisable() {
            if (activeBulb) {
                activeBulb.FinishStroke();
                activeBulb = null;
            }
        }

        void Update() {
            if (debugMode) {

                if (Input.GetKeyDown(KeyCode.A)) {
                    this.OnGlobalAPressDown(new WiiMoteEventData());
                } else if (Input.GetKey(KeyCode.A)) {
                    this.OnGlobalAPress(new WiiMoteEventData());
                } else if (Input.GetKeyUp(KeyCode.A)) {
                    this.OnGlobalAPressUp(new WiiMoteEventData());
                }

                if (Input.GetKeyDown(KeyCode.O)) {
                    this.OnGlobalOnePressDown(new WiiMoteEventData());
                }
            }
        }

        public void OnGlobalAPressDown(WiiMoteEventData eventData) {
            if (debugMode || eventData.module.Equals(module)) {
                ray = new Ray(module.boundObject.transform.position, module.boundObject.transform.forward);
                if (Physics.Raycast(ray, out hit)) {
                    activeBulb = BM.FindClosestBulb(hit.point);
                    activeBulb.strokePrefab = this.strokePrefab;
                    activeBulb.DrawStroke(hit.point);
                }
            }

        }

        public void OnGlobalAPress(WiiMoteEventData eventData) {
            if (debugMode || eventData.module.Equals(module)) {
                if (activeBulb) {
                    ray = new Ray(module.boundObject.transform.position, module.boundObject.transform.forward);
                    if (Physics.Raycast(ray, out hit))
                        activeBulb.DrawStroke(hit.point);
                }
            }
        }

        public void OnGlobalAPressUp(WiiMoteEventData eventData) {
            if (debugMode || eventData.module.Equals(module)) {
                if (activeBulb) {
                    activeBulb.FinishStroke();
                    activeBulb = null;
                }
            }
        }

        public void OnGlobalBPressDown(WiiMoteEventData eventData) {

        }

        //public void CollapseStrokes() {
        //    foreach (Stroke stroke in createdStrokes) {
        //        stroke.SwitchToFinish();
        //    }
        //    createdStrokes.Clear();
        //}

        public void OnGlobalOnePressDown(WiiMoteEventData eventData) {
            if (debugMode || eventData.module.Equals(module)) {
                //foreach (Stroke stroke in createdStrokes) {
                //   stroke.SwitchToFinish();
                //}
                //createdStrokes.Clear();
            }
        }

        public void OnGlobalOnePress(WiiMoteEventData eventData) {
            //throw new System.NotImplementedException();
        }

        public void OnGlobalOnePressUp(WiiMoteEventData eventData) {
            //throw new System.NotImplementedException();
        }
    }
}


text:
#include <stdio.h>
#include "unity.h"
#include "esp32/rom/ets_sys.h"
#include "esp32/rom/uart.h"
#include "soc/rtc.h"
#include "soc/rtc_cntl_reg.h"
#include "soc/rtc_io_reg.h"
#include "soc/sens_reg.h"
#include "soc/io_mux_reg.h"
#include "driver/rtc_io.h"
#include "test_utils.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/semphr.h"
#include "../esp_clk_internal.h"
#include "esp32/clk.h"

#define CALIBRATE_ONE(cali_clk) calibrate_one(cali_clk, #cali_clk)

static uint32_t calibrate_one(rtc_cal_sel_t cal_clk, const char* name)
{
    const uint32_t cal_count = 1000;
    const float factor = (1 << 19) * 1000.0f;
    uint32_t cali_val;
    printf("%s:\n", name);
    for (int i = 0; i < 5; ++i) {
        printf("calibrate (%d): ", i);
        cali_val = rtc_clk_cal(cal_clk, cal_count);
        printf("%.3f kHz\n", factor / (float) cali_val);
    }
    return cali_val;
}

TEST_CASE("RTC_SLOW_CLK sources calibration", "[rtc_clk]")
{
    rtc_clk_32k_enable(true);
    rtc_clk_8m_enable(true, true);

    CALIBRATE_ONE(RTC_CAL_RTC_MUX);
    CALIBRATE_ONE(RTC_CAL_8MD256);
    uint32_t cal_32k = CALIBRATE_ONE(RTC_CAL_32K_XTAL);

    if (cal_32k == 0) {
        printf("32K XTAL OSC has not started up");
    } else {
        printf("switching to RTC_SLOW_FREQ_32K_XTAL: ");
        rtc_clk_slow_freq_set(RTC_SLOW_FREQ_32K_XTAL);
        printf("done\n");

        CALIBRATE_ONE(RTC_CAL_RTC_MUX);
        CALIBRATE_ONE(RTC_CAL_8MD256);
        CALIBRATE_ONE(RTC_CAL_32K_XTAL);
    }

    printf("switching to RTC_SLOW_FREQ_8MD256: ");
    rtc_clk_slow_freq_set(RTC_SLOW_FREQ_8MD256);
    printf("done\n");

    CALIBRATE_ONE(RTC_CAL_RTC_MUX);
    CALIBRATE_ONE(RTC_CAL_8MD256);
    CALIBRATE_ONE(RTC_CAL_32K_XTAL);
}

/* The following two are not unit tests, but are added here to make it easy to
 * check the frequency of 150k/32k oscillators. The following two "tests" will
 * output either 32k or 150k clock to GPIO25.
 */

static void pull_out_clk(int sel)
{
    REG_SET_BIT(RTC_IO_PAD_DAC1_REG, RTC_IO_PDAC1_MUX_SEL_M);
    REG_CLR_BIT(RTC_IO_PAD_DAC1_REG, RTC_IO_PDAC1_RDE_M | RTC_IO_PDAC1_RUE_M);
    REG_SET_FIELD(RTC_IO_PAD_DAC1_REG, RTC_IO_PDAC1_FUN_SEL, 1);
    REG_SET_FIELD(SENS_SAR_DAC_CTRL1_REG, SENS_DEBUG_BIT_SEL, 0);
    REG_SET_FIELD(RTC_IO_RTC_DEBUG_SEL_REG, RTC_IO_DEBUG_SEL0, sel);
}

TEST_CASE("Output 150k clock to GPIO25", "[rtc_clk][ignore]")
{
    pull_out_clk(RTC_IO_DEBUG_SEL0_150K_OSC);
}

TEST_CASE("Output 32k XTAL clock to GPIO25", "[rtc_clk][ignore]")
{
    rtc_clk_32k_enable(true);
    pull_out_clk(RTC_IO_DEBUG_SEL0_32K_XTAL);
}

TEST_CASE("Output 8M XTAL clock to GPIO25", "[rtc_clk][ignore]")
{
    rtc_clk_8m_enable(true, true);
    SET_PERI_REG_MASK(RTC_IO_RTC_DEBUG_SEL_REG, RTC_IO_DEBUG_12M_NO_GATING);
    pull_out_clk(RTC_IO_DEBUG_SEL0_8M);
}

static void test_clock_switching(void (*switch_func)(const rtc_cpu_freq_config_t* config))
{
    uart_tx_wait_idle(CONFIG_CONSOLE_UART_NUM);

    const int test_duration_sec = 10;
    ref_clock_init();
    uint64_t t_start = ref_clock_get();

    rtc_cpu_freq_config_t cur_config;
    rtc_clk_cpu_freq_get_config(&cur_config);

    rtc_cpu_freq_config_t xtal_config;
    rtc_clk_cpu_freq_mhz_to_config((uint32_t) rtc_clk_xtal_freq_get(), &xtal_config);

    int count = 0;
    while (ref_clock_get() - t_start < test_duration_sec * 1000000) {
        switch_func(&xtal_config);
        switch_func(&cur_config);
        ++count;
    }
    uint64_t t_end = ref_clock_get();
    printf("Switch count: %d. Average time to switch PLL -> XTAL -> PLL: %d us\n", count, (int) ((t_end - t_start) / count));
    ref_clock_deinit();
}

TEST_CASE("Calculate 8M clock frequency", "[rtc_clk]")
{
    // calibrate 8M/256 clock against XTAL, get 8M/256 clock period
    uint32_t rtc_8md256_period = rtc_clk_cal(RTC_CAL_8MD256, 100);
    uint32_t rtc_fast_freq_hz = 1000000ULL * (1 << RTC_CLK_CAL_FRACT) * 256 / rtc_8md256_period;
    printf("RTC_FAST_CLK=%d Hz\n", rtc_fast_freq_hz);
    TEST_ASSERT_INT32_WITHIN(500000, RTC_FAST_CLK_FREQ_APPROX, rtc_fast_freq_hz);
}

TEST_CASE("Test switching between PLL and XTAL", "[rtc_clk]")
{
    test_clock_switching(rtc_clk_cpu_freq_set_config);
}

TEST_CASE("Test fast switching between PLL and XTAL", "[rtc_clk]")
{
    test_clock_switching(rtc_clk_cpu_freq_set_config_fast);
}

#define COUNT_TEST      3
#define TIMEOUT_TEST_MS (5 + CONFIG_ESP32_RTC_CLK_CAL_CYCLES / 16)

void stop_rtc_external_quartz(){
    const uint8_t pin_32 = 32;
    const uint8_t pin_33 = 33;
    const uint8_t mask_32 = (1 << (pin_32 - 32));
    const uint8_t mask_33 = (1 << (pin_33 - 32));

    rtc_clk_32k_enable(false);

    gpio_pad_select_gpio(pin_32);
    gpio_pad_select_gpio(pin_33);
    gpio_output_set_high(0, mask_32 | mask_33, mask_32 | mask_33, 0);
    ets_delay_us(500000);
    gpio_output_set_high(0, 0, 0, mask_32 | mask_33); // disable pins
}

static void start_freq(rtc_slow_freq_t required_src_freq, uint32_t start_delay_ms)
{
    int i = 0, fail = 0;
    uint32_t start_time;
    uint32_t end_time;
    rtc_slow_freq_t selected_src_freq;
    stop_rtc_external_quartz();
#ifdef CONFIG_ESP32_RTC_CLOCK_SOURCE_EXTERNAL_CRYSTAL
    uint32_t bootstrap_cycles = CONFIG_ESP32_RTC_XTAL_BOOTSTRAP_CYCLES;
    printf("Test is started. Kconfig settings:\n External 32K crystal is selected,\n Oscillation cycles = %d,\n Calibration cycles = %d.\n",
            bootstrap_cycles,
            CONFIG_ESP32_RTC_CLK_CAL_CYCLES);
#else
    uint32_t bootstrap_cycles = 5;
    printf("Test is started. Kconfig settings:\n Internal RC is selected,\n Oscillation cycles = %d,\n Calibration cycles = %d.\n",
            bootstrap_cycles,
            CONFIG_ESP32_RTC_CLK_CAL_CYCLES);
#endif
    if (start_delay_ms == 0 && CONFIG_ESP32_RTC_CLK_CAL_CYCLES < 1500){
        start_delay_ms = 50;
        printf("Recommended increase Number of cycles for RTC_SLOW_CLK calibration to 3000!\n");
    }
    while(i < COUNT_TEST){
        start_time = xTaskGetTickCount() * (1000 / configTICK_RATE_HZ);
        i++;
        printf("attempt #%d/%d...", i, COUNT_TEST);
        rtc_clk_32k_bootstrap(bootstrap_cycles);
        ets_delay_us(start_delay_ms * 1000);
        rtc_clk_select_rtc_slow_clk();
        selected_src_freq = rtc_clk_slow_freq_get();
        end_time = xTaskGetTickCount() * (1000 / configTICK_RATE_HZ);
        printf(" [time=%d] ", (end_time - start_time) - start_delay_ms);
        if(selected_src_freq != required_src_freq){
            printf("FAIL. Time measurement...");
            fail = 1;
        } else {
            printf("PASS. Time measurement...");
        }
        uint64_t clk_rtc_time;
        uint32_t fail_measure = 0;
        for (int j = 0; j < 3; ++j) {
            clk_rtc_time = esp_clk_rtc_time();
            ets_delay_us(1000000);
            uint64_t delta = esp_clk_rtc_time() - clk_rtc_time;
            if (delta < 900000LL || delta > 1100000){
                printf("FAIL");
                fail = 1;
                fail_measure = 1;
                break;
            }
        }
        if(fail_measure == 0) {
            printf("PASS");
        }
        printf(" [calibration val = %d] \n", esp_clk_slowclk_cal_get());
        stop_rtc_external_quartz();
        ets_delay_us(500000);
    }
    TEST_ASSERT_MESSAGE(fail == 0, "Test failed");
    printf("Test passed successfully\n");
}

#ifdef CONFIG_SPIRAM_SUPPORT
// PSRAM tests run on ESP-WROVER-KIT boards, which have the 32k XTAL installed.
// Other tests may run on DevKitC boards, which don't have a 32k XTAL.
TEST_CASE("Test starting external RTC quartz", "[rtc_clk]")
{
    int i = 0, fail = 0;
    uint32_t start_time;
    uint32_t end_time;
    stop_rtc_external_quartz();
#ifdef CONFIG_ESP32_RTC_CLOCK_SOURCE_EXTERNAL_CRYSTAL
    uint32_t bootstrap_cycles = CONFIG_ESP32_RTC_XTAL_BOOTSTRAP_CYCLES;
    printf("Test is started. Kconfig settings:\n External 32K crystal is selected,\n Oscillation cycles = %d,\n Calibration cycles = %d.\n",
            bootstrap_cycles,
            CONFIG_ESP32_RTC_CLK_CAL_CYCLES);
#else
    uint32_t bootstrap_cycles = 5;
    printf("Test is started. Kconfig settings:\n Internal RC is selected,\n Oscillation cycles = %d,\n Calibration cycles = %d.\n",
            bootstrap_cycles,
            CONFIG_ESP32_RTC_CLK_CAL_CYCLES);
#endif
    if (CONFIG_ESP32_RTC_CLK_CAL_CYCLES < 1500){
        printf("Recommended increase Number of cycles for RTC_SLOW_CLK calibration to 3000!\n");
    }
    while(i < COUNT_TEST){
        start_time = xTaskGetTickCount() * (1000 / configTICK_RATE_HZ);
        i++;
        printf("attempt #%d/%d...", i, COUNT_TEST);
        rtc_clk_32k_bootstrap(bootstrap_cycles);
        rtc_clk_select_rtc_slow_clk();
        end_time = xTaskGetTickCount() * (1000 / configTICK_RATE_HZ);
        printf(" [time=%d] ", end_time - start_time);
        if((end_time - start_time) > TIMEOUT_TEST_MS){
            printf("FAIL\n");
            fail = 1;
        } else {
            printf("PASS\n");
        }
        stop_rtc_external_quartz();
        ets_delay_us(100000);
    }
    TEST_ASSERT_MESSAGE(fail == 0, "Test failed");
    printf("Test passed successfully\n");
}

TEST_CASE("Test starting 'External 32kHz XTAL' on the board with it.", "[rtc_clk]")
{
    start_freq(RTC_SLOW_FREQ_32K_XTAL, 200);
    start_freq(RTC_SLOW_FREQ_32K_XTAL, 0);
}

#else

TEST_CASE("Test starting 'External 32kHz XTAL' on the board without it.", "[rtc_clk][ignore]")
{
    printf("Tries to start the 'External 32kHz XTAL' on the board without it. "
            "Clock switching to 'Internal 150 kHz RC oscillator'.\n");

    printf("This test will be successful for boards without an external crystal or non-working crystal. "
            "First, there will be an attempt to start from the external crystal after a failure "
            "will switch to the internal RC circuit. If the switch to the internal RC circuit "
            "was successful then the test succeeded.\n");

    start_freq(RTC_SLOW_FREQ_RTC, 200);
    start_freq(RTC_SLOW_FREQ_RTC, 0);
}

#endif // CONFIG_SPIRAM_SUPPORT


text:
@class IOSLongArray;
@class JavaNioByteOrder;

#include "J2ObjC_header.h"
#include "java/nio/LongBuffer.h"

@interface JavaNioLongArrayBuffer : JavaNioLongBuffer {
}

- (instancetype)initWithLongArray:(IOSLongArray *)array;

- (JavaNioLongBuffer *)asReadOnlyBuffer;

- (JavaNioLongBuffer *)compact;

- (JavaNioLongBuffer *)duplicate;

- (JavaNioLongBuffer *)slice;

- (jboolean)isReadOnly;

- (IOSLongArray *)protectedArray;

- (jint)protectedArrayOffset;

- (jboolean)protectedHasArray;

- (jlong)get;

- (jlong)getWithInt:(jint)index;

- (JavaNioLongBuffer *)getWithLongArray:(IOSLongArray *)dst
                                withInt:(jint)dstOffset
                                withInt:(jint)longCount;

- (jboolean)isDirect;

- (JavaNioByteOrder *)order;

- (JavaNioLongBuffer *)putWithLong:(jlong)c;

- (JavaNioLongBuffer *)putWithInt:(jint)index
                         withLong:(jlong)c;

- (JavaNioLongBuffer *)putWithLongArray:(IOSLongArray *)src
                                withInt:(jint)srcOffset
                                withInt:(jint)longCount;

@end

J2OBJC_EMPTY_STATIC_INIT(JavaNioLongArrayBuffer)

CF_EXTERN_C_BEGIN
CF_EXTERN_C_END

J2OBJC_TYPE_LITERAL_HEADER(JavaNioLongArrayBuffer)

#endif // _JavaNioLongArrayBuffer_H_


text:
package org.zstack.core.rest;

import org.zstack.core.GlobalProperty;
import org.zstack.core.GlobalPropertyDefinition;

@GlobalPropertyDefinition
public class RESTApiGlobalProperty {
    @GlobalProperty(name="cleanRESTApiVODelaySecond", defaultValue = "600")
    public static long CLEAN_RESTAPIVO_DELAY;

    //If set -1, will not clean RestApiVO
    @GlobalProperty(name="RESTApiVORetentionDay", defaultValue = "10")
    public static long RESTAPIVO_RETENTION_DAY;

    @GlobalProperty(name="cleanRestApiIntervalSecond", defaultValue = "86400")
    public static long CLEAN_INTERVAL_SECOND;
}


text:
var xlsx       = require('node-xlsx');
var fs         = require('fs');
var toContract = require('./tocontract');

module.exports = function(filePath, callBack ) {
    var xls  = parseExcel(filePath);
    //console.log(xls);
    //fs.writeFile("tttttttttt",JSON.stringify(xls))
    var json = toContract(xls, callBack);

}

function parseExcel(filePath){
    var filename  = __dirname + '/../酒店 - 服务接口 - H5.xlsx'; // 测试文件
    var xlsObject = xlsx.parse(filePath);
    return xlsObject;
}


text:
#import <Foundation/Foundation.h>
#import <React/RCTBridgeModule.h>
#import <React/RCTUIManager.h>
#import <React/RCTSurfacePresenterStub.h>
#import <React/RCTEventDispatcherProtocol.h>

@protocol RCTValueAnimatedNodeObserver;

@interface RCTNativeAnimatedNodesManager : NSObject

- (nonnull instancetype)initWithBridge:(RCTBridge *)bridge
                      surfacePresenter:(id<RCTSurfacePresenterStub>)surfacePresenter;

- (void)updateAnimations;

- (void)stepAnimations:(nonnull CADisplayLink *)displaylink;

- (BOOL)isNodeManagedByFabric:(nonnull NSNumber *)tag;

- (void)getValue:(nonnull NSNumber *)nodeTag
        saveCallback:(nullable RCTResponseSenderBlock)saveCallback;

// graph

- (void)createAnimatedNode:(nonnull NSNumber *)tag
                    config:(NSDictionary<NSString *, id> *__nonnull)config;

- (void)connectAnimatedNodes:(nonnull NSNumber *)parentTag
                    childTag:(nonnull NSNumber *)childTag;

- (void)disconnectAnimatedNodes:(nonnull NSNumber *)parentTag
                       childTag:(nonnull NSNumber *)childTag;

- (void)connectAnimatedNodeToView:(nonnull NSNumber *)nodeTag
                          viewTag:(nonnull NSNumber *)viewTag
                         viewName:(nonnull NSString *)viewName;

- (void)restoreDefaultValues:(nonnull NSNumber *)nodeTag;

- (void)disconnectAnimatedNodeFromView:(nonnull NSNumber *)nodeTag
                               viewTag:(nonnull NSNumber *)viewTag;

- (void)dropAnimatedNode:(nonnull NSNumber *)tag;

// mutations

- (void)setAnimatedNodeValue:(nonnull NSNumber *)nodeTag
                       value:(nonnull NSNumber *)value;

- (void)setAnimatedNodeOffset:(nonnull NSNumber *)nodeTag
                       offset:(nonnull NSNumber *)offset;

- (void)flattenAnimatedNodeOffset:(nonnull NSNumber *)nodeTag;

- (void)extractAnimatedNodeOffset:(nonnull NSNumber *)nodeTag;

// drivers

- (void)startAnimatingNode:(nonnull NSNumber *)animationId
                   nodeTag:(nonnull NSNumber *)nodeTag
                    config:(NSDictionary<NSString *, id> *__nonnull)config
               endCallback:(nullable RCTResponseSenderBlock)callBack;

- (void)stopAnimation:(nonnull NSNumber *)animationId;

- (void)stopAnimationLoop;

// events

- (void)addAnimatedEventToView:(nonnull NSNumber *)viewTag
                     eventName:(nonnull NSString *)eventName
                  eventMapping:(NSDictionary<NSString *, id> *__nonnull)eventMapping;

- (void)removeAnimatedEventFromView:(nonnull NSNumber *)viewTag
                          eventName:(nonnull NSString *)eventName
                    animatedNodeTag:(nonnull NSNumber *)animatedNodeTag;

- (void)handleAnimatedEvent:(nonnull id<RCTEvent>)event;

// listeners

- (void)startListeningToAnimatedNodeValue:(nonnull NSNumber *)tag
                            valueObserver:(nonnull id<RCTValueAnimatedNodeObserver>)valueObserver;

- (void)stopListeningToAnimatedNodeValue:(nonnull NSNumber *)tag;

@end


text:
In order to configure your build, you must include a `.drone.yml` file in the root of your repository. This section provides a brief overview of the `.drone.yml` configuration file format.

Example `.drone.yml` for a Go repository:

```yaml
build:
  image: golang
  commands:
    - go get
    - go build
    - go test
```

A more comprehensive example with linked service containers, deployment plugins and notification plugins:

```yaml
build:
  image: golang
  commands:
    - go get
    - go build
    - go test

compose:
  cache:
    image: redis
  database:
    image: mysql

deploy:
  heroku:
    app: pied_piper
    when:
      branch: master

notify:
  slack:
    channel: myteam
```


text:
from openerp.osv import fields,osv
from openerp.tools.translate import _

import openerp.addons.decimal_precision as dp

# Overloaded stock_picking to manage carriers :
class stock_picking(osv.osv):
    _inherit = 'stock.picking'

    def _cal_weight(self, cr, uid, ids, name, args, context=None):
        res = {}
        uom_obj = self.pool.get('product.uom')
        for picking in self.browse(cr, uid, ids, context=context):
            total_weight = total_weight_net = 0.00

            for move in picking.move_lines:
                total_weight += move.weight
                total_weight_net += move.weight_net

            res[picking.id] = {
                                'weight': total_weight,
                                'weight_net': total_weight_net,
                              }
        return res

    def _get_picking_line(self, cr, uid, ids, context=None):
        result = {}
        for line in self.pool.get('stock.move').browse(cr, uid, ids, context=context):
            result[line.picking_id.id] = True
        return result.keys()

    _columns = {
        'carrier_id':fields.many2one("delivery.carrier","Carrier"),
        'volume': fields.float('Volume'),
        'weight': fields.function(_cal_weight, type='float', string='Weight', digits_compute= dp.get_precision('Stock Weight'), multi='_cal_weight',
                  store={
                 'stock.picking': (lambda self, cr, uid, ids, c={}: ids, ['move_lines'], 20),
                 'stock.move': (_get_picking_line, ['product_id','product_qty','product_uom','product_uos_qty'], 20),
                 }),
        'weight_net': fields.function(_cal_weight, type='float', string='Net Weight', digits_compute= dp.get_precision('Stock Weight'), multi='_cal_weight',
                  store={
                 'stock.picking': (lambda self, cr, uid, ids, c={}: ids, ['move_lines'], 20),
                 'stock.move': (_get_picking_line, ['product_id','product_qty','product_uom','product_uos_qty'], 20),
                 }),
        'carrier_tracking_ref': fields.char('Carrier Tracking Ref', size=32),
        'number_of_packages': fields.integer('Number of Packages'),
        'weight_uom_id': fields.many2one('product.uom', 'Unit of Measure', required=True,readonly="1",help="Unit of measurement for Weight",),
        }

    def _prepare_shipping_invoice_line(self, cr, uid, picking, invoice, context=None):
        """Prepare the invoice line to add to the shipping costs to the shipping's
           invoice.

            :param browse_record picking: the stock picking being invoiced
            :param browse_record invoice: the stock picking's invoice
            :return: dict containing the values to create the invoice line,
                     or None to create nothing
        """
        carrier_obj = self.pool.get('delivery.carrier')
        grid_obj = self.pool.get('delivery.grid')
        if not picking.carrier_id or \
            any(inv_line.product_id.id == picking.carrier_id.product_id.id
                for inv_line in invoice.invoice_line):
            return None
        grid_id = carrier_obj.grid_get(cr, uid, [picking.carrier_id.id],
                picking.partner_id.id, context=context)
        if not grid_id:
            raise osv.except_osv(_('Warning!'),
                    _('The carrier %s (id: %d) has no delivery grid!') \
                            % (picking.carrier_id.name,
                                picking.carrier_id.id))
        price = grid_obj.get_price_from_picking(cr, uid, grid_id,
                invoice.amount_untaxed, picking.weight, picking.volume,
                context=context)
        account_id = picking.carrier_id.product_id.property_account_income.id
        if not account_id:
            account_id = picking.carrier_id.product_id.categ_id\
                    .property_account_income_categ.id

        taxes = picking.carrier_id.product_id.taxes_id
        partner = picking.partner_id or False
        if partner:
            account_id = self.pool.get('account.fiscal.position').map_account(cr, uid, partner.property_account_position, account_id)
            taxes_ids = self.pool.get('account.fiscal.position').map_tax(cr, uid, partner.property_account_position, taxes)
        else:
            taxes_ids = [x.id for x in taxes]

        return {
            'name': picking.carrier_id.name,
            'invoice_id': invoice.id,
            'uos_id': picking.carrier_id.product_id.uos_id.id,
            'product_id': picking.carrier_id.product_id.id,
            'account_id': account_id,
            'price_unit': price,
            'quantity': 1,
            'invoice_line_tax_id': [(6, 0, taxes_ids)],
        }

    def action_invoice_create(self, cr, uid, ids, journal_id=False,
            group=False, type='out_invoice', context=None):
        invoice_obj = self.pool.get('account.invoice')
        picking_obj = self.pool.get('stock.picking')
        invoice_line_obj = self.pool.get('account.invoice.line')
        result = super(stock_picking, self).action_invoice_create(cr, uid,
                ids, journal_id=journal_id, group=group, type=type,
                context=context)
        for picking in picking_obj.browse(cr, uid, result.keys(), context=context):
            invoice = invoice_obj.browse(cr, uid, result[picking.id], context=context)
            invoice_line = self._prepare_shipping_invoice_line(cr, uid, picking, invoice, context=context)
            if invoice_line:
                invoice_line_obj.create(cr, uid, invoice_line)
                invoice_obj.button_compute(cr, uid, [invoice.id], context=context)
        return result
    def _get_default_uom(self,cr,uid,c):
        uom_categ, uom_categ_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'product', 'product_uom_categ_kgm')
        return self.pool.get('product.uom').search(cr, uid, [('category_id', '=', uom_categ_id),('factor','=',1)])[0]
    _defaults = {
        'weight_uom_id': lambda self,cr,uid,c: self._get_default_uom(cr,uid,c)
    }

stock_picking()

class stock_move(osv.osv):
    _inherit = 'stock.move'

    def _cal_move_weight(self, cr, uid, ids, name, args, context=None):
        res = {}
        uom_obj = self.pool.get('product.uom')
        for move in self.browse(cr, uid, ids, context=context):
            weight = weight_net = 0.00
            if move.product_id.weight > 0.00:
                converted_qty = move.product_qty

                if move.product_uom.id <> move.product_id.uom_id.id:
                    converted_qty = uom_obj._compute_qty(cr, uid, move.product_uom.id, move.product_qty, move.product_id.uom_id.id)

                weight = (converted_qty * move.product_id.weight)

                if move.product_id.weight_net > 0.00:
                    weight_net = (converted_qty * move.product_id.weight_net)

            res[move.id] =  {
                            'weight': weight,
                            'weight_net': weight_net,
                            }
        return res

    _columns = {
        'weight': fields.function(_cal_move_weight, type='float', string='Weight', digits_compute= dp.get_precision('Stock Weight'), multi='_cal_move_weight',
                  store={
                 'stock.move': (lambda self, cr, uid, ids, c=None: ids, ['product_id', 'product_qty', 'product_uom'], 20),
                 }),
        'weight_net': fields.function(_cal_move_weight, type='float', string='Net weight', digits_compute= dp.get_precision('Stock Weight'), multi='_cal_move_weight',
                  store={
                 'stock.move': (lambda self, cr, uid, ids, c=None: ids, ['product_id', 'product_qty', 'product_uom'], 20),
                 }),
        'weight_uom_id': fields.many2one('product.uom', 'Unit of Measure', required=True,readonly="1",help="Unit of Measure (Unit of Measure) is the unit of measurement for Weight",),
        }
    def _get_default_uom(self,cr,uid,c):
        uom_categ, uom_categ_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'product', 'product_uom_categ_kgm')
        return self.pool.get('product.uom').search(cr, uid, [('category_id', '=', uom_categ_id),('factor','=',1)])[0]
    _defaults = {
        'weight_uom_id': lambda self,cr,uid,c: self._get_default_uom(cr,uid,c)
    }
stock_move()

# Redefinition of the new fields in order to update the model stock.picking.out in the orm
# FIXME: this is a temporary workaround because of a framework bug (ref: lp996816). It should be removed as soon as
#        the bug is fixed

# TODO in trunk: Remove the duplication below using a mixin class!

class stock_picking_out(osv.osv):
    _inherit = 'stock.picking.out'

    def _cal_weight(self, cr, uid, ids, name, args, context=None):
        return self.pool.get('stock.picking')._cal_weight(cr, uid, ids, name, args, context=context)

    def _get_picking_line(self, cr, uid, ids, context=None):
        return self.pool.get('stock.picking')._get_picking_line(cr, uid, ids, context=context)

    _columns = {
        'carrier_id':fields.many2one("delivery.carrier","Carrier"),
        'volume': fields.float('Volume'),
        'weight': fields.function(_cal_weight, type='float', string='Weight', digits_compute= dp.get_precision('Stock Weight'), multi='_cal_weight',
                  store={
                 'stock.picking': (lambda self, cr, uid, ids, c={}: ids, ['move_lines'], 20),
                 'stock.move': (_get_picking_line, ['product_id','product_qty','product_uom','product_uos_qty'], 20),
                 }),
        'weight_net': fields.function(_cal_weight, type='float', string='Net Weight', digits_compute= dp.get_precision('Stock Weight'), multi='_cal_weight',
                  store={
                 'stock.picking': (lambda self, cr, uid, ids, c={}: ids, ['move_lines'], 20),
                 'stock.move': (_get_picking_line, ['product_id','product_qty','product_uom','product_uos_qty'], 20),
                 }),
        'carrier_tracking_ref': fields.char('Carrier Tracking Ref', size=32),
        'number_of_packages': fields.integer('Number of Packages'),
        'weight_uom_id': fields.many2one('product.uom', 'Unit of Measure', required=True,readonly="1",help="Unit of measurement for Weight",),
        }
stock_picking_out()

class stock_picking_in(osv.osv):
    _inherit = 'stock.picking.in'

    def _cal_weight(self, cr, uid, ids, name, args, context=None):
        return self.pool.get('stock.picking')._cal_weight(cr, uid, ids, name, args, context=context)

    def _get_picking_line(self, cr, uid, ids, context=None):
        return self.pool.get('stock.picking')._get_picking_line(cr, uid, ids, context=context)

    _columns = {
        'carrier_id':fields.many2one("delivery.carrier","Carrier"),
        'volume': fields.float('Volume'),
        'weight': fields.function(_cal_weight, type='float', string='Weight', digits_compute= dp.get_precision('Stock Weight'), multi='_cal_weight',
                store={
                'stock.picking': (lambda self, cr, uid, ids, c={}: ids, ['move_lines'], 20),
                'stock.move': (_get_picking_line, ['product_id','product_qty','product_uom','product_uos_qty'], 20),
                }),
        'weight_net': fields.function(_cal_weight, type='float', string='Net Weight', digits_compute= dp.get_precision('Stock Weight'), multi='_cal_weight',
                store={
                'stock.picking': (lambda self, cr, uid, ids, c={}: ids, ['move_lines'], 20),
                'stock.move': (_get_picking_line, ['product_id','product_qty','product_uom','product_uos_qty'], 20),
                }),
        'carrier_tracking_ref': fields.char('Carrier Tracking Ref', size=32),
        'number_of_packages': fields.integer('Number of Packages'),
        'weight_uom_id': fields.many2one('product.uom', 'Unit of Measure', required=True,readonly="1",help="Unit of measurement for Weight",),
        }
stock_picking_in()

# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:


text:
#ifndef TT_H_INCLUDED
#define TT_H_INCLUDED

#include "misc.h"
#include "types.h"

/// TTEntry struct is the 10 bytes transposition table entry, defined as below:
///
/// key        16 bit
/// move       16 bit
/// value      16 bit
/// eval value 16 bit
/// generation  6 bit
/// bound type  2 bit
/// depth       8 bit

struct TTEntry {

  Move  move()  const { return (Move )move16; }
  Value value() const { return (Value)value16; }
  Value eval()  const { return (Value)eval16; }
  Depth depth() const { return (Depth)depth8; }
  Bound bound() const { return (Bound)(genBound8 & 0x3); }

  void save(Key k, Value v, Bound b, Depth d, Move m, Value ev, uint8_t g) {

    if (m || (k >> 48) != key16) // Preserve any existing move for the same position
        move16 = (uint16_t)m;

    key16     = (uint16_t)(k >> 48);
    value16   = (int16_t)v;
    eval16    = (int16_t)ev;
    genBound8 = (uint8_t)(g | b);
    depth8    = (int8_t)d;
  }

private:
  friend class TranspositionTable;

  uint16_t key16;
  uint16_t move16;
  int16_t  value16;
  int16_t  eval16;
  uint8_t  genBound8;
  int8_t   depth8;
};

/// A TranspositionTable consists of a power of 2 number of clusters and each
/// cluster consists of ClusterSize number of TTEntry. Each non-empty entry
/// contains information of exactly one position. The size of a cluster should
/// not be bigger than a cache line size. In case it is less, it should be padded
/// to guarantee always aligned accesses.

class TranspositionTable {

  static const int CacheLineSize = 64;
  static const int ClusterSize = 3;

  struct Cluster {
    TTEntry entry[ClusterSize];
    char padding[2]; // Align to the cache line size
  };

public:
 ~TranspositionTable() { free(mem); }
  void new_search() { generation8 += 4; } // Lower 2 bits are used by Bound
  uint8_t generation() const { return generation8; }
  TTEntry* probe(const Key key, bool& found) const;
  int hashfull() const;
  void resize(size_t mbSize);
  void clear();

  // The lowest order bits of the key are used to get the index of the cluster
  TTEntry* first_entry(const Key key) const {
    return &table[(size_t)key & (clusterCount - 1)].entry[0];
  }

private:
  size_t clusterCount;
  Cluster* table;
  void* mem;
  uint8_t generation8; // Size must be not bigger than TTEntry::genBound8
};

extern TranspositionTable TT;

#endif // #ifndef TT_H_INCLUDED


text:
#include "config.h"

#if ENABLE(INDEXED_DATABASE)

#include "IDBBindingUtilities.h"

#include "IDBKey.h"

namespace WebCore {

PassRefPtr<IDBKey> createIDBKeyFromValue(JSC::ExecState* exec, JSC::JSValue value)
{
    if (value.isNull())
        return IDBKey::create();
    if (value.isInt32())
        return IDBKey::create(value.toInt32(exec));
    if (value.isString())
        return IDBKey::create(ustringToString(value.toString(exec)));
    // FIXME: Implement dates.
    return 0;
}

} // namespace WebCore

#endif // ENABLE(INDEXED_DATABASE)


text:
package org.apache.catalina.ssi;

/**
 * Parses an expression string to return the individual tokens. This is
 * patterned similar to the StreamTokenizer in the JDK but customized for SSI
 * conditional expression parsing.
 *
 *
 * @author Paul Speed
 */
public class ExpressionTokenizer {
    public static final int TOKEN_STRING = 0;
    public static final int TOKEN_AND = 1;
    public static final int TOKEN_OR = 2;
    public static final int TOKEN_NOT = 3;
    public static final int TOKEN_EQ = 4;
    public static final int TOKEN_NOT_EQ = 5;
    public static final int TOKEN_RBRACE = 6;
    public static final int TOKEN_LBRACE = 7;
    public static final int TOKEN_GE = 8;
    public static final int TOKEN_LE = 9;
    public static final int TOKEN_GT = 10;
    public static final int TOKEN_LT = 11;
    public static final int TOKEN_END = 12;
    private char[] expr;
    private String tokenVal = null;
    private int index;
    private int length;

    /**
     * Creates a new parser for the specified expression.
     */
    public ExpressionTokenizer(String expr) {
        this.expr = expr.trim().toCharArray();
        this.length = this.expr.length;
    }

    /**
     * Returns true if there are more tokens.
     */
    public boolean hasMoreTokens() {
        return index < length;
    }

    /**
     * Returns the current index for error reporting purposes.
     */
    public int getIndex() {
        return index;
    }

    protected boolean isMetaChar(char c) {
        return Character.isWhitespace(c) || c == '(' || c == ')' || c == '!'
                || c == '<' || c == '>' || c == '|' || c == '&' || c == '=';
    }

    /**
     * Returns the next token type and initializes any state variables
     * accordingly.
     */
    public int nextToken() {
        // Skip any leading white space
        while (index < length && Character.isWhitespace(expr[index]))
            index++;
        // Clear the current token val
        tokenVal = null;
        if (index == length) return TOKEN_END; // End of string
        int start = index;
        char currentChar = expr[index];
        char nextChar = (char)0;
        index++;
        if (index < length) nextChar = expr[index];
        // Check for a known token start
        switch (currentChar) {
            case '(' :
                return TOKEN_LBRACE;
            case ')' :
                return TOKEN_RBRACE;
            case '=' :
                return TOKEN_EQ;
            case '!' :
                if (nextChar == '=') {
                    index++;
                    return TOKEN_NOT_EQ;
                } else {
                    return TOKEN_NOT;
                }
            case '|' :
                if (nextChar == '|') {
                    index++;
                    return TOKEN_OR;
                }
                break;
            case '&' :
                if (nextChar == '&') {
                    index++;
                    return TOKEN_AND;
                }
                break;
            case '>' :
                if (nextChar == '=') {
                    index++;
                    return TOKEN_GE; // Greater than or equal
                } else {
                    return TOKEN_GT; // Greater than
                }
            case '<' :
                if (nextChar == '=') {
                    index++;
                    return TOKEN_LE; // Less than or equal
                } else {
                    return TOKEN_LT; // Less than
                }
            default :
                // Otherwise it's a string
                break;
        }
        int end = index;
        // If it's a quoted string then end is the next unescaped quote
        if (currentChar == '"' || currentChar == '\'') {
            char endChar = currentChar;
            boolean escaped = false;
            start++;
            for (; index < length; index++) {
                if (expr[index] == '\\' && !escaped) {
                    escaped = true;
                    continue;
                }
                if (expr[index] == endChar && !escaped) break;
                escaped = false;
            }
            end = index;
            index++; // Skip the end quote
        } else {
            // End is the next whitespace character
            for (; index < length; index++) {
                if (isMetaChar(expr[index])) break;
            }
            end = index;
        }
        // Extract the string from the array
        this.tokenVal = new String(expr, start, end - start);
        return TOKEN_STRING;
    }

    /**
     * Returns the String value of the token if it was type TOKEN_STRING.
     * Otherwise null is returned.
     */
    public String getTokenValue() {
        return tokenVal;
    }
}


text:
<?php

namespace Magento\Client\Rest;

use Guzzle\Common\Collection;
use Guzzle\Http\Exception\ClientErrorResponseException;
use Guzzle\Service\Client;

class MagentoRestClient extends Client
{
    /**
     * {@inheritdoc}
     *
     * @return \Magento\Client\Rest\MagentoRestClient
     */
    public static function factory($config = array())
    {
        $defaults = array(
            'base_url' => 'http://localhost',
            'base_path' => '',
        );

        $required = array(
            'base_url',
            'base_path',
            'consumer_key',
            'consumer_secret',
        );

        $config = Collection::fromConfig($config, $defaults, $required);

        $magento = new static($config->get('base_url'), $config);
        $magento->addSubscriber(new MagentoOauthPlugin($config->toArray()));

        $magento->setDefaultOption('headers', array(
            'Content-Type' => 'application/json',
            'Accept' => '*/*',
        ));

        return $magento;
    }

    /**
     * {@inheritdoc}
     *
     * Prepends the {+base_path} expressions to the URI
     */
    public function createRequest($method = 'GET', $uri = null, $headers = null, $body = null, array $options = array())
    {
        $uri = '{+base_path}/' . ltrim($uri, '/');
        return parent::createRequest($method, $uri, $headers, $body, $options);
    }

    /**
     * @return \Magento\Client\Rest\RequestToken
     *
     * @throws \Magento\Client\Rest\OauthException
     */
    public function getRequestToken()
    {
        try {
            $response = $this->post('/oauth/initiate')->send();
        } catch (ClientErrorResponseException $e) {
            throw OauthException::factory($e->getRequest(), $e->getResponse());
        }
        return new RequestToken($this, $response);
    }

    /**
     * @return \Magento\Client\Rest\AccessToken
     *
     * @throws \Magento\Client\Rest\OauthException
     */
    public function getAccessToken()
    {
        try {
            $response = $this->post('/oauth/token')->send();
        } catch (ClientErrorResponseException $e) {
            throw OauthException::factory($e->getRequest(), $e->getResponse());
        }
        return new AccessToken($this, $response);
    }
}


text:
<?php

namespace bcmt;

class KnackSync {

	private static $nameMap=array();

	public function checkDuplicates($record, $i) {

		if(!key_exists($record->title, self::$nameMap)){
			self::$nameMap[$record->title]=array();
		}

		self::$nameMap[$record->title][]=$record;

		if(count(self::$nameMap[$record->title])>1){

			echo "Found duplicate:\n";

			if(count(self::$nameMap[$record->title])==2){
				//$this->print(self::$nameMap[$record->title][0]);
			}

			//$this->print(self::$nameMap[$record->title][count(self::$nameMap[$record->title])-1]);

		}

	}

	public function printDuplicates(){

		foreach (self::$nameMap as $title=>$items) {
			if(count($items)<2){
				continue;
			}
			echo "Found duplicate: ".$title."\n";
			foreach( $items as $item) {
				$this->print($item);
			}
		}
	}

	protected function print($record){

			echo $record->knackid.': '$record->id.': '.$record->title.": ".$record->coordinates."\n";

	}
}


text:
package com.datastax.spark.connector.rdd.partitioner

import java.net.InetAddress

import Ordering.Implicits._

import com.datastax.spark.connector.rdd.partitioner.dht.{Token, TokenRange}

import scala.annotation.tailrec

/** Divides a set of token rangesContaining into groups containing not more than `maxRowCountPerGroup` rows
  * and not more than `maxGroupSize` token rangesContaining. Each group will form a single `CassandraPartition`.
  *
  * The algorithm is as follows:
  * 1. Sort token rangesContaining by endpoints lexicographically.
  * 2. Take the highest possible number of token rangesContaining from the beginning of the list,
  *    such that their sum of rowCounts does not exceed `maxRowCountPerGroup` and they all contain at
  *    least one common endpoint. If it is not possible, take at least one item.
  *    Those token rangesContaining will make a group.
  * 3. Repeat the previous step until no more token rangesContaining left.*/
class TokenRangeClusterer[V, T <: Token[V]](maxRowCountPerGroup: Long, maxGroupSize: Int = Int.MaxValue) {

  private implicit object InetAddressOrdering extends Ordering[InetAddress] {
    override def compare(x: InetAddress, y: InetAddress) =
      x.getHostAddress.compareTo(y.getHostAddress)
  }

  @tailrec
  private def group(tokenRanges: Stream[TokenRange[V, T]],
                    result: Vector[Seq[TokenRange[V, T]]]): Iterable[Seq[TokenRange[V, T]]] = {
    tokenRanges match {
      case Stream.Empty => result
      case head #:: rest =>
        val firstEndpoint = head.replicas.min
        val rowCounts = tokenRanges.map(_.dataSize)
        val cumulativeRowCounts = rowCounts.scanLeft(0L)(_ + _).tail // drop first item always == 0
        val rowLimit = math.max(maxRowCountPerGroup, head.dataSize) // make sure first element will be always included
        val cluster = tokenRanges
          .take(math.max(1, maxGroupSize))
          .zip(cumulativeRowCounts)
          .takeWhile { case (tr, count) => count <= rowLimit && tr.replicas.min == firstEndpoint }
          .map(_._1)
          .toVector
        val remainingTokenRanges = tokenRanges.drop(cluster.length)
        group(remainingTokenRanges, result :+ cluster)
    }
  }

  /** Groups small token ranges on the same server(s) in order to reduce task scheduling overhead.
    * Useful mostly with virtual nodes, which may create lots of small token range splits.
    * Each group will make a single Spark task. */
  def group(tokenRanges: Seq[TokenRange[V, T]]): Iterable[Seq[TokenRange[V, T]]] = {
    // sort by endpoints lexicographically
    // this way ranges on the same host are grouped together
    val sortedRanges = tokenRanges.sortBy(_.replicas.toSeq.sorted)
    group(sortedRanges.toStream, Vector.empty)
  }

}


text:
package org.snaker.designer.commands;

import org.eclipse.draw2d.geometry.Rectangle;
import org.eclipse.gef.commands.Command;

import org.snaker.designer.model.BaseElement;
import org.snaker.designer.model.Field;
import org.snaker.designer.model.Form;
import org.snaker.designer.model.ModelHelper;
import org.snaker.designer.model.Task;
import org.snaker.designer.config.Component;
import org.snaker.designer.config.ConfigManager;

/**
 * field创建命令
 * @author yuqs
 * @version 1.0
 */
public class FieldCreateCommand extends Command {
	private BaseElement parent;

	private Field field;

	public FieldCreateCommand() {
		super();
		field = null;
		parent = null;
	}

	public void setField(Object o) {
		if (o instanceof Field)
			this.field = (Field) o;
	}

	public void setParent(BaseElement o) {
		this.parent = o;
	}

	public void setLayout(Rectangle rect) {
		if (this.field == null)
			return;
		// this.field.setLocation(rect.getLocation());
		// this.field.setSize(rect.getSize());
		this.field.setLayout(rect);
	}

	@Override
	public boolean canExecute() {
		if (this.field == null || this.parent == null)
			return false;
		return true;
	}

	@Override
	public boolean canUndo() {
		if (this.field == null || this.parent == null)
			return false;
		if (this.parent instanceof Form) {
			return ((Form) this.parent).getFields().contains(this.field);
		} else if (this.parent instanceof Task) {
			return ((Task) this.parent).getFields().contains(this.field);
		} else {
			return false;
		}
	}

	@Override
	public void execute() {
		if (getLabel() == null || getLabel().trim().length() == 0) {
			return;
		}
		Component component = ConfigManager.getComponent(
				ConfigManager.COMPONENT_TYPE_FIELD, getLabel());
		this.field.setType(getLabel());
		this.field.setDisplayName("新建" + component.getDisplayName());
		if (this.parent instanceof Form) {
			((Form) this.parent).addField(this.field);
		} else if (this.parent instanceof Task) {
			((Task) this.parent).addField(this.field);
		}
		this.field.setParent(this.parent);
		field.setName(ModelHelper.getModelName(field, component.getType()));
	}

	@Override
	public void undo() {
		if (this.parent instanceof Form) {
			((Form) this.parent).removeField(this.field);
		} else if (this.parent instanceof Task) {
			((Task) this.parent).removeField(this.field);
		}
	}

}


text:
namespace GelGto {

// Just a list of objects that understands regular expressions.
class Set
{
protected:
    friend class DataBase;
    Set( const std::string &ref,
         const std::string &open,
         const std::string &close,
         const char *stripPrefix = NULL );

    ~Set();

    bool isMe( const std::string &ref,
               const std::string &open,
               const std::string &close ) const
    {
        return ( m_ref == ref &&
                 m_open == open &&
                 m_close == close );
    }

    void doneReading( ReaderPhase rp );

public:
    void addObject( Object *obj ) { m_objects.push_back( obj ); }

    Object *object( const std::string &name );

    void declareRi( const OnOffList &onList,
                    const OnOffList &offList,
                    const OnOffList &onList2,
                    const OnOffList &offList2,
                    GelatoAPI *_rend ) const;

    const std::string &ref() const { return m_ref; }
    const std::string &open() const { return m_open; }
    const std::string &close() const { return m_close; }
    const char *stripPrefix() const { return m_stripPrefix; }

private:
    std::string m_ref;
    std::string m_open;
    std::string m_close;
    const char *m_stripPrefix;

    std::vector<Object *> m_objects;
};

} // End namespace GelGto

#endif


text:
/*
 * Bit definitions for the MCF54xx ACR and CACR registers.
 */

#ifndef	m54xxacr_h
#define m54xxacr_h

/*
 *	Define the Cache register flags.
 */
#define CACR_DEC	0x80000000	/* Enable data cache */
#define CACR_DWP	0x40000000	/* Data write protection */
#define CACR_DESB	0x20000000	/* Enable data store buffer */
#define CACR_DDPI	0x10000000	/* Disable invalidation by CPUSHL */
#define CACR_DHCLK	0x08000000	/* Half data cache lock mode */
#define CACR_DDCM_WT	0x00000000	/* Write through cache*/
#define CACR_DDCM_CP	0x02000000	/* Copyback cache */
#define CACR_DDCM_P	0x04000000	/* No cache, precise */
#define CACR_DDCM_IMP	0x06000000	/* No cache, imprecise */
#define CACR_DCINVA	0x01000000	/* Invalidate data cache */
#define CACR_BEC	0x00080000	/* Enable branch cache */
#define CACR_BCINVA	0x00040000	/* Invalidate branch cache */
#define CACR_IEC	0x00008000	/* Enable instruction cache */
#define CACR_DNFB	0x00002000	/* Inhibited fill buffer */
#define CACR_IDPI	0x00001000	/* Disable CPUSHL */
#define CACR_IHLCK	0x00000800	/* Intruction cache half lock */
#define CACR_IDCM	0x00000400	/* Intruction cache inhibit */
#define CACR_ICINVA	0x00000100	/* Invalidate instr cache */
#define CACR_EUSP	0x00000020	/* Enable separate user a7 */

#define ACR_BASE_POS	24		/* Address Base */
#define ACR_MASK_POS	16		/* Address Mask */
#define ACR_ENABLE	0x00008000	/* Enable address */
#define ACR_USER	0x00000000	/* User mode access only */
#define ACR_SUPER	0x00002000	/* Supervisor mode only */
#define ACR_ANY		0x00004000	/* Match any access mode */
#define ACR_CM_WT	0x00000000	/* Write through mode */
#define ACR_CM_CP	0x00000020	/* Copyback mode */
#define ACR_CM_OFF_PRE	0x00000040	/* No cache, precise */
#define ACR_CM_OFF_IMP	0x00000060	/* No cache, imprecise */
#define ACR_CM		0x00000060	/* Cache mode mask */
#define ACR_WPROTECT	0x00000004	/* Write protect */

#if defined(CONFIG_M5407)

#define ICACHE_SIZE 0x4000	/* instruction - 16k */
#define DCACHE_SIZE 0x2000	/* data - 8k */

#elif defined(CONFIG_M54xx)

#define ICACHE_SIZE 0x8000	/* instruction - 32k */
#define DCACHE_SIZE 0x8000	/* data - 32k */

#endif

#define CACHE_LINE_SIZE 0x0010	/* 16 bytes */
#define CACHE_WAYS 4		/* 4 ways */

/*
 *	Version 4 cores have a true harvard style separate instruction
 *	and data cache. Enable data and instruction caches, also enable write
 *	buffers and branch accelerator.
 */
/* attention : enabling CACR_DESB requires a "nop" to flush the store buffer */
/* use '+' instead of '|' for assembler's sake */

	/* Enable data cache */
	/* Enable data store buffer */
	/* outside ACRs : No cache, precise */
	/* Enable instruction+branch caches */
#if defined(CONFIG_M5407)
#define CACHE_MODE (CACR_DEC+CACR_DESB+CACR_DDCM_P+CACR_BEC+CACR_IEC)
#else
#define CACHE_MODE (CACR_DEC+CACR_DESB+CACR_DDCM_P+CACR_BEC+CACR_IEC+CACR_EUSP)
#endif
#if defined(CONFIG_CACHE_COPYBACK)
#define DATA_CACHE_MODE (ACR_ENABLE+ACR_ANY+ACR_CM_CP)
#else
#define DATA_CACHE_MODE (ACR_ENABLE+ACR_ANY+ACR_CM_WT)
#endif
#define INSN_CACHE_MODE (ACR_ENABLE+ACR_ANY)

#define CACHE_INIT	(CACR_DCINVA+CACR_BCINVA+CACR_ICINVA)
#define CACHE_INVALIDATE  (CACHE_MODE+CACR_DCINVA+CACR_BCINVA+CACR_ICINVA)
#define CACHE_INVALIDATEI (CACHE_MODE+CACR_BCINVA+CACR_ICINVA)
#define CACHE_INVALIDATED (CACHE_MODE+CACR_DCINVA)
#define ACR0_MODE	(0x000f0000+DATA_CACHE_MODE)
#define ACR1_MODE	0
#define ACR2_MODE	(0x000f0000+INSN_CACHE_MODE)
#define ACR3_MODE	0

#if ((DATA_CACHE_MODE & ACR_CM) == ACR_CM_CP)
/* Copyback cache mode must push dirty cache lines first */
#define	CACHE_PUSH
#endif

#endif	/* m54xxacr_h */


text:
package org.apache.ignite.internal.processors.platform.client.cache;

import org.apache.ignite.internal.binary.BinaryRawWriterEx;
import org.apache.ignite.internal.processors.platform.client.ClientResponse;

import java.util.Map;

/**
 * GetAll response.
 */
class ClientCacheGetAllResponse extends ClientResponse {
    /** Result. */
    private final Map<Object, Object> res;

    /**
     * Ctor.
     *
     * @param requestId Request id.
     * @param res Result.
     */
    ClientCacheGetAllResponse(long requestId, Map<Object, Object> res) {
        super(requestId);

        assert res != null;

        this.res = res;
    }

    /** {@inheritDoc} */
    @Override public void encode(BinaryRawWriterEx writer) {
        super.encode(writer);

        writer.writeInt(res.size());

        for (Map.Entry e : res.entrySet()) {
            writer.writeObjectDetached(e.getKey());
            writer.writeObjectDetached(e.getValue());
        }
    }
}


text:
package MooseX::Attribute::LazyInflator::Meta::Role::Attribute;
{
  $MooseX::Attribute::LazyInflator::Meta::Role::Attribute::VERSION = '2.2.2';
}

# ABSTRACT: Lazy inflate attributes
use strict;
use warnings;
use Moose::Role;
use Eval::Closure;

with 'MooseX::Attribute::Deflator::Meta::Role::Attribute';

override verify_against_type_constraint => sub {
    my ( $self, $value, undef, $instance ) = @_;
    return $value if ( !$self->is_inflated( $instance, undef, $value ) );
    return super();
};

before get_value => sub {
    my ( $self, $instance ) = @_;
    return
        if ( !$self->has_value($instance) || $self->is_inflated($instance) );
    my $value = $self->inflate( $instance, $self->get_raw_value($instance) );
    $value = $self->type_constraint->coerce($value)
        if ( $self->should_coerce && $self->type_constraint->has_coercion );
    $self->verify_against_type_constraint( $value, instance => $instance );
    $self->set_raw_value( $instance, $value );
};

# this is just for reference, this method is replaced with an inlined version
sub is_inflated {
    my ( $self, $instance, $value, $from_constructor ) = @_;
    return $instance->_inflated_attributes->{ $self->name } = $value
        if ( defined $value );
    if ( $instance->_inflated_attributes->{ $self->name } ) {
        return 1;
    }
    else {
        my $value
            = defined $from_constructor
            ? $from_constructor
            : $self->get_raw_value($instance);
        return 1 if(!defined $value && $self->is_required);
        $value = $self->type_constraint->coerce($value)
            if ( $self->should_coerce
            && $self->type_constraint->has_coercion );
        return
               $self->has_type_constraint
            && $self->type_constraint->check($value)
            && ++$instance->_inflated_attributes->{ $self->name };
    }
}

after install_accessors => sub {
    my $self = shift;
    my @code
        = $self->_inline_instance_is_inflated( '$_[1]', '$type_constraint',
        '$type_coercion', '$value', );
    my $role = Moose::Meta::Role->create_anon_role;
    $role->add_method(
        'is_inflated' => eval_closure(
            environment => $self->_eval_environment,
            source      => join( "\n",
                'sub {',
                'return $_[1]->{_inflated_attributes}->{"'
                    . quotemeta( $self->name )
                    . '"} = $_[2] if(defined $_[2]);',
                'my $value = defined $_[3] ? $_[3] : '
                    . $self->_inline_instance_get('$_[1]') . ';',
                @code,
                '}' ),
        )
    );
    Moose::Util::apply_all_roles($self, $role);
} if ( $Moose::VERSION >= 1.9 );

if ( Moose->VERSION < 1.9900 ) {
    require MooseX::Attribute::LazyInflator::Meta::Role::Method::Accessor;
    override accessor_metaclass => sub {
        'MooseX::Attribute::LazyInflator::Meta::Role::Method::Accessor';
    };
}

sub _inline_instance_is_inflated {
    my ( $self, $instance, $tc, $tc_obj, $value ) = @_;
    my @code
        = (   $instance
            . '->{_inflated_attributes}->{"'
            . quotemeta( $self->name )
            . '"}' );
    return 1 if ( !$self->has_type_constraint );    # TODO return 1 ?
    $value ||= $self->_inline_instance_get($instance);
    my $coerce
        = $self->should_coerce && $self->type_constraint->has_coercion
        ? $tc_obj . '->coerce(' . $value . ')'
        : $value;
    push @code,
        (     ' || ('
            . $tc . '->('
            . $coerce
            . ') && ++'
            . $instance
            . '->{_inflated_attributes}->{"'
            . quotemeta( $self->name )
            . '"})' );
    return @code;
}

if ( Moose->VERSION >= 2.0100 ) {
    override _inline_get_value => sub {
        my ( $self, $instance, $tc, $coercion, $message ) = @_;
        $tc       ||= '$type_constraint';
        $coercion ||= '$type_coercion';
        $message  ||= '$type_message';
        my $slot_exists = $self->_inline_instance_has($instance);
        my @code        = (
            "if($slot_exists && !(",
            $self->_inline_instance_is_inflated( $instance, $tc, $coercion ),
            ")) {",
            'my $inflated = '
                . "\$attr->inflate($instance, "
                . $self->_inline_instance_get($instance) . ");",
            $self->has_type_constraint
            ? ( $self->_inline_check_coercion(
                    '$inflated', $tc, $coercion, 1
                ),
                $self->_inline_check_constraint(
                    '$inflated', $tc, $message, 1
                )
                )
            : (),
            $self->_inline_init_slot( $instance, '$inflated' ),
            "}"
        );
        push @code, super();
        return @code;
    };

    __PACKAGE__->meta->add_method(
        _inline_instance_is_inflated => sub {
            my ( $self, $instance, $tc, $coercion, $value ) = @_;
            my @code
                = (   $instance
                    . '->{_inflated_attributes}->{"'
                    . quotemeta( $self->name )
                    . '"}' );
            return @code if ( !$self->has_type_constraint );
            $value ||= $self->_inline_instance_get($instance);
            my $coerce
                = $self->should_coerce && $self->type_constraint->has_coercion
                ? $coercion . '->(' . $value . ')'
                : $value;
            my $check
                = $self->type_constraint->can_be_inlined
                ? $self->type_constraint->_inline_check($coerce)
                : $tc . '->(' . $coerce . ')';
            push @code,
                (     ' || ('
                    . $check
                    . ' && ++'
                    . $instance
                    . '->{_inflated_attributes}->{"'
                    . quotemeta( $self->name )
                    . '"})' );
            return @code;
        }
    );

    override _inline_tc_code => sub {
        my $self = shift;
        my ( $value, $tc, $coercion, $message, $is_lazy ) = @_;
        return (
            $self->_inline_check_coercion(
                $value, $tc, $coercion, $is_lazy,
            ),

            # $self->_inline_check_constraint(
            #     $value, $tc, $message, $is_lazy,
            # ),
        );
    };

    override _eval_environment => sub {
        my $self = shift;
        return { %{ super() }, '$attr' => \$self, };
    };
}
else {
    override _inline_get_value => sub {
        my ( $self, $instance, $tc, $tc_obj ) = @_;
        $tc     ||= '$type_constraint';
        $tc_obj ||= '$type_constraint_obj';
        my $slot_exists = $self->_inline_instance_has($instance);
        my @code        = (
            "if($slot_exists && !(",
            $self->_inline_instance_is_inflated( $instance, $tc, $tc_obj ),
            ")) {",
            'my $inflated = '
                . "\$attr->inflate($instance, "
                . $self->_inline_instance_get($instance) . ");",
            $self->has_type_constraint
            ? ( $self->_inline_check_coercion( '$inflated', $tc, $tc_obj, 1 ),
                $self->_inline_check_constraint(
                    '$inflated', $tc, $tc_obj, 1
                )
                )
            : (),
            $self->_inline_init_slot( $instance, '$inflated' ),
            "}"
        );
        push @code, super();
        return @code;
        }
        if Moose->VERSION >= 1.9900;

    __PACKAGE__->meta->add_method(
        _inline_instance_is_inflated => sub {
            my ( $self, $instance, $tc, $tc_obj ) = @_;
            my @code
                = (   $instance
                    . '->{_inflated_attributes}->{"'
                    . quotemeta( $self->name )
                    . '"}' );
            return @code if ( !$self->has_type_constraint );
            my $value = $self->_inline_instance_get($instance);
            my $coerce
                = $self->should_coerce && $self->type_constraint->has_coercion
                ? $tc_obj . '->coerce(' . $value . ')'
                : $value;
            push @code,
                (     ' || ('
                    . $tc . '->('
                    . $coerce
                    . ') && ++'
                    . $instance
                    . '->{_inflated_attributes}->{"'
                    . quotemeta( $self->name )
                    . '"})' );
            return @code;
        }
    );

    override _inline_tc_code => sub {
        my $self = shift;
        return (
            $self->_inline_check_coercion(@_),

            # $self->_inline_check_constraint(@_),
        );
        }
        if Moose->VERSION >= 1.9900;
}

1;

=pod

=head1 NAME

MooseX::Attribute::LazyInflator::Meta::Role::Attribute - Lazy inflate attributes

=head1 VERSION

version 2.2.2

=head1 SYNOPSIS

  package Test;

  use Moose;
  use MooseX::Attribute::LazyInflator;
  # Load default deflators and inflators
  use MooseX::Attribute::Deflator::Moose;

  has hash => ( is => 'rw',
               isa => 'HashRef',
               traits => ['LazyInflator'] );

  package main;

  my $obj = Test->new( hash => '{"foo":"bar"}' );
  # Attribute 'hash' is being inflated to a HashRef on access
  $obj->hash;

=head1 ROLES

This role consumes L<MooseX::Attribute::Deflator::Meta::Role::Attribute>.

=head1 METHODS

=over 8

=item B<is_inflated( $intance )>

Returns a true value if the value of the attribute passes the type contraint
or has been inflated.

=item before B<get_value>

The attribute's value is being inflated and set if it has a value and hasn't been inflated yet.

=item override B<verify_against_type_constraint>

Will return true if the attribute hasn't been inflated yet.

=back

=head1 FUNCTIONS

=over 8

=item B<accessor_metaclass>

The accessor metaclass is set to L<MooseX::Attribute::LazyInflator::Meta::Role::Method::Accessor>.

=back

=head1 AUTHOR

Moritz Onken

=head1 COPYRIGHT AND LICENSE

This software is Copyright (c) 2012 by Moritz Onken.

This is free software, licensed under:

  The (three-clause) BSD License

=cut

__END__


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Struct template managed_unique_ptr</title>
<link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="../../interprocess/indexes_reference.html#header.boost.interprocess.smart_ptr.unique_ptr_hpp" title="Header <boost/interprocess/smart_ptr/unique_ptr.hpp>">
<link rel="prev" href="make_man_idm45598468497616.html" title="Function template make_managed_shared_ptr">
<link rel="next" href="make_managed_unique_ptr.html" title="Function template make_managed_unique_ptr">

Home
Libraries
People
FAQ
More

Struct template managed_unique_ptr

boost::interprocess::managed_unique_ptr

Synopsis

// In header: <boost/interprocess/smart_ptr/unique_ptr.hpp>

template<typename T, typename ManagedMemory>
struct managed_unique_ptr {
  // types
  typedef boost::movelib::unique_ptr< T, typename ManagedMemory::template deleter< T >::type > type;
};

Description

Returns the type of a unique pointer of type T with boost::interprocess::deleter deleter that can be constructed in the given managed segment type.

Copyright © 2005-2015 Ion Gaztanaga

        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


text:
#include "awt.h"
#include "awt_KeyboardFocusManager.h"
#include "awt_Component.h"
#include "awt_Toolkit.h"
#include <java_awt_KeyboardFocusManager.h>

jclass AwtKeyboardFocusManager::keyboardFocusManagerCls;
jmethodID AwtKeyboardFocusManager::shouldNativelyFocusHeavyweightMID;
jmethodID AwtKeyboardFocusManager::heavyweightButtonDownMID;
jmethodID AwtKeyboardFocusManager::markClearGlobalFocusOwnerMID;
jmethodID AwtKeyboardFocusManager::removeLastFocusRequestMID;
jfieldID  AwtKeyboardFocusManager::isProxyActive;
jmethodID AwtKeyboardFocusManager::processSynchronousTransfer;

static jobject getNativeFocusState(JNIEnv *env, void*(*ftn)()) {
    jobject lFocusState = NULL;

    jobject gFocusState = reinterpret_cast<jobject>(AwtToolkit::GetInstance().
        InvokeFunction(ftn));
    if (gFocusState != NULL) {
        lFocusState = env->NewLocalRef(gFocusState);
        env->DeleteGlobalRef(gFocusState);
    }

    return lFocusState;
}

extern "C" {

/*
 * Class:     java_awt_KeyboardFocusManager
 * Method:    initIDs
 * Signature: ()V
 */
JNIEXPORT void JNICALL
Java_java_awt_KeyboardFocusManager_initIDs
    (JNIEnv *env, jclass cls)
{
    TRY;

    AwtKeyboardFocusManager::keyboardFocusManagerCls = (jclass)
        env->NewGlobalRef(cls);
    AwtKeyboardFocusManager::shouldNativelyFocusHeavyweightMID =
        env->GetStaticMethodID(cls, "shouldNativelyFocusHeavyweight",
            "(Ljava/awt/Component;Ljava/awt/Component;ZZJLsun/awt/CausedFocusEvent$Cause;)I");
    AwtKeyboardFocusManager::heavyweightButtonDownMID =
        env->GetStaticMethodID(cls, "heavyweightButtonDown",
            "(Ljava/awt/Component;J)V");
    AwtKeyboardFocusManager::markClearGlobalFocusOwnerMID =
        env->GetStaticMethodID(cls, "markClearGlobalFocusOwner",
                               "()Ljava/awt/Window;");
    AwtKeyboardFocusManager::removeLastFocusRequestMID =
        env->GetStaticMethodID(cls, "removeLastFocusRequest",
                               "(Ljava/awt/Component;)V");

    AwtKeyboardFocusManager::processSynchronousTransfer =
        env->GetStaticMethodID(cls, "processSynchronousLightweightTransfer",
                               "(Ljava/awt/Component;Ljava/awt/Component;ZZJ)Z");

    jclass keyclass = env->FindClass("java/awt/event/KeyEvent");
    DASSERT (keyclass != NULL);

    AwtKeyboardFocusManager::isProxyActive =
        env->GetFieldID(keyclass, "isProxyActive", "Z");

    env->DeleteLocalRef(keyclass);

    DASSERT(AwtKeyboardFocusManager::keyboardFocusManagerCls != NULL);
    DASSERT(AwtKeyboardFocusManager::shouldNativelyFocusHeavyweightMID !=
            NULL);
    DASSERT(AwtKeyboardFocusManager::heavyweightButtonDownMID != NULL);
    DASSERT(AwtKeyboardFocusManager::markClearGlobalFocusOwnerMID != NULL);
    DASSERT(AwtKeyboardFocusManager::removeLastFocusRequestMID != NULL);
    DASSERT(AwtKeyboardFocusManager::processSynchronousTransfer != NULL);
    CATCH_BAD_ALLOC;
}

/*
 * Class:     sun_awt_KeyboardFocusManagerPeerImpl
 * Method:    getNativeFocusOwner
 * Signature: ()Ljava/awt/Component;
 */
JNIEXPORT jobject JNICALL
Java_sun_awt_KeyboardFocusManagerPeerImpl_getNativeFocusOwner
    (JNIEnv *env, jclass cls)
{
    TRY;

    return getNativeFocusState(env, AwtComponent::GetNativeFocusOwner);

    CATCH_BAD_ALLOC_RET(NULL);
}

/*
 * Class:     sun_awt_KeyboardFocusManagerPeerImpl
 * Method:    getNativeFocusedWindow
 * Signature: ()Ljava/awt/Window;
 */
JNIEXPORT jobject JNICALL
Java_sun_awt_KeyboardFocusManagerPeerImpl_getNativeFocusedWindow
    (JNIEnv *env, jclass cls)
{
    TRY;

    return getNativeFocusState(env, AwtComponent::GetNativeFocusedWindow);

    CATCH_BAD_ALLOC_RET(NULL);
}

/*
 * Class:     sun_awt_KeyboardFocusManagerPeerImpl
 * Method:    clearNativeGlobalFocusOwner
 * Signature: (Ljava/awt/Window;)V
 */
JNIEXPORT void JNICALL
Java_sun_awt_KeyboardFocusManagerPeerImpl_clearNativeGlobalFocusOwner
    (JNIEnv *env, jobject self, jobject activeWindow)
{
    TRY;

    AwtToolkit::GetInstance().InvokeFunction
        ((void*(*)(void))AwtComponent::ClearGlobalFocusOwner);

    CATCH_BAD_ALLOC;
}
}


text:
package org.schema;

/**
 *
 * A body of water, such as a sea, ocean, or lake.
 *
 * @fullPath Thing > Place > Landform > BodyOfWater
 *
 * @author Texelz (by Onhate)
 *
 */
public class BodyOfWater extends Landform {

}


text:
@implementation ViewController
- (void)viewDidLoad {
  self.label.text = @"Test String to Localize";
  self.label.text =
NSLocalizedStringWithDefaultValue(@"test-string-to-auto-localize",
  kDefaultLocalizationsTable, kClassBundle,
  @"Test String to Auto Localize",
  @"Test String to Auto Localize"
);
}
@end