text:
lummox-nscollection-extensions
=======================
*Version 1.0*

A collection of useful functionality built on top of Foundation collections: NSDictionary, NSArray, NSSet,
and their mutable versions.

Some of this overlaps with stuff offered by BlocksKit, among other libraries.

Examples
---------
    // Safe accessors
    NSString *stringId = [dictionary lmx_stringForKey:@"id"]; // Returns nil if the key isn't there, or the value isn't a string.
    MyClass *myObject = [dictionary lmx_objectForKey:@"key" ofClass:[MyClass class]];

    // Mapping
    NSDictionary *addedBirds = [dictionary lmx_dictionaryWithMapping:^(NSString *key, NSString *value) {
            return @[[key stringByAppendingString:@"bird"], [value stringByAppendingString:@"bird"]];
        }];

Setup Instructions
------------------
The recommended way is to install via Cocoapods.

It uses a private repo, which you can add to your pods installation like this:
pod repo add lummox-podrepo https://github.com/mbusheikin/lummox-podrepo.git

Add into your Podfile:
pod 'lummox-nscollection-extensions'

Then run:
pod update (or pod install)

MIT License
-----------
    Copyright (c) 2013 Charles Scalesse.

    Permission is hereby granted, free of charge, to any person obtaining a
    copy of this software and associated documentation files (the
    "Software"), to deal in the Software without restriction, including
    without limitation the rights to use, copy, modify, merge, publish,
    distribute, sublicense, and/or sell copies of the Software, and to
    permit persons to whom the Software is furnished to do so, subject to
    the following conditions:

    The above copyright notice and this permission notice shall be included
    in all copies or substantial portions of the Software.

    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
    OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
    IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
    CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
    TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
    SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

redpajama_set_name: RedPajamaGithub


text:
using AssetID = std::string;

#endif


text:
/**
 * \file
 * \brief Driver for booting the Xeon Phi Coprocessor card on a Barrelfish Host
 */

/*
 * Copyright (c) 2014 ETH Zurich.
 * All rights reserved.
 *
 * This file is distributed under the terms in the attached LICENSE file.
 * If you do not find this file, copies can be found by writing to:
 * ETH Zurich D-INFK, Universitaetsstrasse 6, CH-8092 Zurich. Attn: Systems Group.
 */

#ifndef XEON_PHI_SERVICE_H_
#define XEON_PHI_SERVICE_H_

/**
 * \brief initializes the service
 *
 * \param iref  returns the iref of the initialized service
 *
 * \return SYS_ERR_OK on success
 */
errval_t service_init(struct xeon_phi *phi);

/**
 * \brief registers the local service with the other Xeon Phi drivers
 *        in the topology
 *
 * \param phi   pointer to the local card structure
 * \param irefs the irefs of the other cards
 * \param num   the number of irefs in the array
 */
errval_t service_register(struct xeon_phi *phi,
                          iref_t *irefs,
                          uint8_t num);

/**
 * \brief registers an intra card communication frame
 *
 * \param phi      the local xeon phi card
 * \param xphi_id  target xeon phi id
 * \param cap      capability of the messaging frame
 */
errval_t service_bootstrap(struct xeon_phi *phi,
                           uint8_t xphi_id,
                           struct capref frame);

/**
 * \brief starts the service request handling
 */
errval_t service_start(struct xeon_phi *phi);

#endif // XEON_PHI_SERVICE_H_


text:
module( 'Rekord Polymorphic' );

test( 'poly hasOne', function()
{
  Rekord.promises = {};

  var prefix = 'poly_hasOne_';

  var Discriminators = {
    Email:    1,
    Address:  2,
    Phone:    3
  };

  var Email = Rekord({
    name: prefix + 'email',
    className: 'Email',
    fields: ['address']
  });

  var Address = Rekord({
    name: prefix + 'address',
    className: 'Address',
    fields: ['door_number', 'street', 'city', 'state']
  });

  var Phone = Rekord({
    name: prefix + 'phone',
    className: 'Phone',
    fields: ['number']
  });

  var Person = Rekord({
    name: prefix + 'person',
    fields: ['first', 'last', 'contact_id', 'contact_type'],
    hasOne: {
      contact: {
        local: 'contact_id',
        discriminator: 'contact_type',
        discriminators: Discriminators,
        dynamic: true,
        cascade: false
      }
    }
  });

  var c0 = Email.create({address: 'pdiffenderfer@gmail.com'});
  var c1 = Address.create({door_number: 613, street: 'Easy', city: 'Towne', state: 'PA'});
  var c2 = Phone.create({number: '8675309'});

  var p0 = Person.create({first: 'Phil', last: 'Diffy', contact: c0});

  strictEqual( p0.contact, c0 );
  strictEqual( p0.contact_id, c0.id );
  strictEqual( p0.contact_type, Discriminators.Email );

  p0.contact = c1;

  strictEqual( p0.contact, c1 );
  strictEqual( p0.contact_id, c1.id );
  strictEqual( p0.contact_type, Discriminators.Address );

  p0.contact = null;

  strictEqual( p0.contact, null );
  strictEqual( p0.contact_id, null );
  strictEqual( p0.contact_type, null );

  var p1 = Person.create({
    id: 92,
    first: 'Tim',
    last: 'John',
    contact_id: c1.id,
    contact_type: Discriminators.Address
  });

  strictEqual( p1.contact, c1 );
});

test( 'poly belongsTo', function()
{
  Rekord.promises = {};

  var prefix = 'poly_belongsTo_';

  var Discriminators = {
    Email:    1,
    Address:  2,
    Phone:    3
  };

  var Email = Rekord({
    name: prefix + 'email',
    className: 'Email',
    fields: ['address']
  });

  var Address = Rekord({
    name: prefix + 'address',
    className: 'Address',
    fields: ['door_number', 'street', 'city', 'state']
  });

  var Phone = Rekord({
    name: prefix + 'phone',
    className: 'Phone',
    fields: ['number']
  });

  var Person = Rekord({
    name: prefix + 'person',
    fields: ['first', 'last', 'contact_id', 'contact_type'],
    belongsTo: {
      contact: {
        local: 'contact_id',
        discriminator: 'contact_type',
        discriminators: Discriminators,
        dynamic: true
      }
    }
  });

  var c0 = Email.create({address: 'pdiffenderfer@gmail.com'});
  var c1 = Address.create({door_number: 613, street: 'Easy', city: 'Towne', state: 'PA'});
  var c2 = Phone.create({number: '8675309'});

  var p0 = Person.create({first: 'Phil', last: 'Diffy', contact: c0});

  strictEqual( p0.contact, c0 );
  strictEqual( p0.contact_id, c0.id );
  strictEqual( p0.contact_type, Discriminators.Email );

  p0.contact = c1;

  strictEqual( p0.contact, c1 );
  strictEqual( p0.contact_id, c1.id );
  strictEqual( p0.contact_type, Discriminators.Address );

  p0.contact = null;

  strictEqual( p0.contact, null );
  strictEqual( p0.contact_id, null );
  strictEqual( p0.contact_type, null );

  var p1 = Person.create({
    id: 92,
    first: 'Tim',
    last: 'John',
    contact_id: c1.id,
    contact_type: Discriminators.Address
  });

  strictEqual( p1.contact, c1 );
});

test( 'poly hasMany', function()
{
  Rekord.promises = {};

  var prefix = 'poly_hasMany_';

  var Discriminators = {
    Email:    1,
    Address:  2,
    Phone:    3,
    Person:   4
  };

  var Email = Rekord({
    name: prefix + 'email',
    className: 'Email',
    fields: ['parent_id', 'parent_type', 'address']
  });

  var Address = Rekord({
    name: prefix + 'address',
    className: 'Address',
    fields: ['parent_id', 'parent_type', 'door_number', 'street', 'city', 'state']
  });

  var Phone = Rekord({
    name: prefix + 'phone',
    className: 'Phone',
    fields: ['parent_id', 'parent_type', 'number']
  });

  var Person = Rekord({
    name: prefix + 'person',
    className: 'Person',
    fields: ['first', 'last'],
    hasMany: {
      contacts: {
        foreign: 'parent_id',
        discriminator: 'parent_type',
        discriminators: Discriminators,
        dynamic: true,
        clearKey: false
      }
    }
  });

  var c0 = Email.create({address: 'pdiffenderfer@gmail.com'});
  var c1 = Address.create({door_number: 613, street: 'Easy', city: 'Towne', state: 'PA'});
  var c2 = Phone.create({number: '8675309'});

  var p0 = Person.create({first: 'Phil', last: 'Diffy', contacts: [c0, c1, c2]});

  deepEqual( p0.contacts.toArray(), [c0, c1, c2] );
  notOk( c0.$isDeleted() );
  strictEqual( c0.parent_id, p0.id );
  strictEqual( c0.parent_type, Discriminators.Person );
  notOk( c1.$isDeleted() );
  strictEqual( c1.parent_id, p0.id );
  strictEqual( c1.parent_type, Discriminators.Person );
  notOk( c2.$isDeleted() );
  strictEqual( c2.parent_id, p0.id );
  strictEqual( c2.parent_type, Discriminators.Person );

  c1.$remove();

  deepEqual( p0.contacts.toArray(), [c0, c2] );
  notOk( c0.$isDeleted() );
  strictEqual( c0.parent_id, p0.id );
  strictEqual( c0.parent_type, Discriminators.Person );
  ok( c1.$isDeleted() );
  strictEqual( c1.parent_id, p0.id, 'foreign key does not get cleared' );
  strictEqual( c1.parent_type, Discriminators.Person, 'discriminator does not get cleared' );
  notOk( c2.$isDeleted() );
  strictEqual( c2.parent_id, p0.id );
  strictEqual( c2.parent_type, Discriminators.Person );

  p0.contacts = null;

  deepEqual( p0.contacts.toArray(), [] );
  ok( c0.$isDeleted() );
  ok( c1.$isDeleted() );
  ok( c2.$isDeleted() );
});

test( 'polymorphic hasmany', function(assert) {

  // Polymorphic Relationships
  // hasMany: discriminator on related
  // hasManyThrough: discriminator on through
  // hasOne: discriminator on model
  // belongsTo: discriminator on model

  var prefix = 'polymorphic_hasmany_';

  var ListenName = prefix + 'listen';
  var TodoName = prefix + 'todo';
  var TodoListName = prefix + 'todo_list';

  var ListenRest = Rekord.rest[ ListenName ] = new TestRest();
  var TodoRest = Rekord.rest[ TodoName ] = new TestRest();
  var TodoListRest = Rekord.rest[ TodoListName ] = new TestRest();

  ListenRest.map.put(1, {id: 1, related_id: 't1', related_type: 't', on_event: 'e0'});
  ListenRest.map.put(2, {id: 2, related_id: 'tl1', related_type: 'tl', on_event: 'e1'});
  ListenRest.map.put(3, {id: 3, related_id: 't1', related_type: 't', on_event: 'e2'});
  ListenRest.map.put(4, {id: 4, related_id: 't2', related_type: 't', on_event: 'e3'});

  TodoRest.map.put('t1', {id: 't1', name: 'todo1', done: true});
  TodoRest.map.put('t2', {id: 't2', name: 'todo2', done: false});

  TodoListRest.map.put('tl1', {id: 'tl1', name: 'todolist1'});
  TodoListRest.map.put('tl2', {id: 'tl2', name: 'todolist2'});

  var Discriminators = {};
  Discriminators[ TodoName ] = 't';
  Discriminators[ TodoListName ] = 'tl';

  Rekord.autoload = false;

  var Listen = Rekord({
    name: ListenName,
    fields: ['related_id', 'related_type', 'on_event'],
    hasOne: {
      related: {
        local: 'related_id',
        discriminator: 'related_type',
        discriminators: Discriminators,
        cascade: Rekord.Cascade.None
      }
    }
  });

  var HasListens = function(options) {
    var discriminator = Discriminators[ options.name ];
    return {
      hasMany: {
        listens: {
          model: ListenName,
          foreign: 'related_id',
          where: function(related, relation) {
            return Rekord.equals( related.related_type, discriminator );
          }
        }
      }
    };
  };

  var Todo = Rekord({
    name: TodoName,
    fields: ['name', 'done', 'order'],
    traits: [HasListens]
  });

  var TodoList = Rekord({
    name: TodoListName,
    fields: ['name'],
    traits: [HasListens]
  });

  Rekord.load();
  Rekord.autoload = true;

  var l1 = Listen.get(1);
  var l2 = Listen.get(2);
  var l3 = Listen.get(3);
  var l4 = Listen.get(4);

  var t1 = Todo.get('t1');
  var t2 = Todo.get('t2');

  var tl1 = TodoList.get('tl1');
  var tl2 = TodoList.get('tl2');

  strictEqual( l1.related, t1 );
  strictEqual( l2.related, tl1 );
  strictEqual( l3.related, t1 );
  strictEqual( l4.related, t2 );

  strictEqual( t1.listens.length, 2 );
  strictEqual( t1.listens[0], l1 );
  strictEqual( t1.listens[1], l3 );

  strictEqual( t2.listens.length, 1 );
  strictEqual( t2.listens[0], l4 );

  strictEqual( tl1.listens.length, 1 );
  strictEqual( tl1.listens[0], l2 );

  strictEqual( tl2.listens.length, 0 );
});


text:
import codecs
from collections import defaultdict, OrderedDict
import json
import re
import glob, os
import math
import itertools

f_in = "tweets_taxonomy_clean.JSON"
f_in_user_ids = "user_IDs.dat"
IN_DIR = "../DATA/taxonomy_stats/"

def read_user_IDs():

    user_ids = defaultdict(str)

    with codecs.open(f_in_user_ids,'r', encoding='utf8') as f:
        for line in f:
            line = line.split()
            user_id = line[0]
            user =  line[1]
            user_ids[user] = user_id

    return user_ids

def read_save_taxonomy(users="ALL", user_list=None, WRITE=False,TOP_N = 20):

    docSentiment_sum = defaultdict(int)
    taxonomies_sum = defaultdict(int)

    user_ids = read_user_IDs()

    cnt = 0

    with codecs.open(f_in,'r', encoding='utf8') as input_file:
        for line7s in input_file:
            try:
                line = json.loads(line7s)
                taxonomy_all = line["taxonomy"]
                keywords = taxonomy_all["keywords"]
                entities = taxonomy_all["entities"]
                taxonomy = taxonomy_all["taxonomy"]
                docSentiment = taxonomy_all["docSentiment"]
                concepts = taxonomy_all["concepts"]
            except KeyError:
                #print line7s
                continue

            sentiment = docSentiment["type"]
            if sentiment == "neutral":
                docSentiment_sum[sentiment] += 1
            else:
                if not sentiment in docSentiment_sum:
                    docSentiment_sum[sentiment] = defaultdict(int)
                old_score = docSentiment_sum[sentiment][0]
                old_cnt = docSentiment_sum[sentiment][1]
                old_mixed_cnt = docSentiment_sum[sentiment][2]
                try:
                    new_score = old_score + float(docSentiment["score"])
                except KeyError:
                    continue
                new_cnt = old_cnt + 1
                try:
                    new_mixed_cnt = old_mixed_cnt + int(docSentiment["mixed"])
                except KeyError:
                    continue
                docSentiment_sum[sentiment] = (new_score, new_cnt, new_mixed_cnt)

            for el in taxonomy:
                try:
                    if el["confident"] == "no":
                        continue
                except: KeyError
                taxonomy_tree = el["label"]
                taxonomy_tree = taxonomy_tree.split("/")
                taxonomy_tree.pop(0)
                levels = len(taxonomy_tree)

                s = taxonomies_sum
                # go until the last element; on the last, we will not create a dict NONO
                for tax_class in taxonomy_tree:
                    #print tax_class
                    if tax_class not in s.keys():
                        s[tax_class] = defaultdict(int)
                        #print taxonomies_sum
                        #return
                    s = s[tax_class]
                #last_tax_class = taxonomy_tree[levels-1]
                #s = s[last_tax_class]

                old_score = s["size"]
                #old_cnt = s[tax_class][1]
                #old_sent = s[tax_class][2]
                new_score = old_score + float(el["score"])
                s["size"] = new_score

                # this shows that it takes as confident only those above 0.4
                if float(el["score"]) < 0.4:
                    print float(el["score"])

                if sentiment <> "neutral":
                    old_sent = s["sentiment"]
                    new_sent = old_sent + float(docSentiment["score"])
                    s["sentiment"] = new_sent

            cnt += 1

        com_size = cnt

        N = cnt

        print cnt
        print "Total taxonomies on different levels found ", len(taxonomies_sum)
        print "Total Sentiments found ", len(docSentiment_sum)

        if WRITE:
            f_out_name = "ALL/taxon_ALL.json"

            #taxonomies_out7s = recursive_writeable_json_from_dict(taxonomies_sum)
            print len(taxonomies_sum), type(taxonomies_sum)

            #for el in taxonomies_sum.items():
            #    print el

            taxonomies_out7s = recursive_writeable_json_from_dict(taxonomies_sum, "thing")
            print len(taxonomies_out7s), type(taxonomies_out7s)

            with codecs.open(f_out_name,'w', encoding='utf8') as f:
                f.write("{ \"name\": \"thing\", \n \"children\": \n ")
                f.write(unicode(json.dumps(taxonomies_out7s, ensure_ascii=False)) + '\n')
                f.write("\n }")

def recursive_writeable_json_from_dict(d, dname):

    # stop criteria: len(d) == 1 means this is a leaf
    # (should not allow here to arrive, for example { "size": 1.381699 }  )
    # only, for example { "poetry": { "size": 1.381699 } }
    if len(d) == 1:
        s = {}
        #print d, d.items()[0][1], d.items()[0][0]
        s["size"] = d.items()[0][1]["size"]
        s["name"] = d.items()[0][0]
        #print s["name"]
        return s
    # recursive criteria satisfied: create a new dict
    # add me my children, since I have
    #s = {}
    #s["children"] = []
    s = []
    for child_k in d.keys():
        if child_k == "size":
            if d[child_k] <> 0:
            #s["size"] = d[child_k]
                s.append({"size":d[child_k], "name":dname})
        else:
            child_el = d[child_k]
            ss = {"name": child_k}
            try:
                ss["size"] = child_el["size"]
            except: KeyError
            # this is a check to avoid passing { "size": 1.381699 }
            #if child_el.items()[0][0] == "size" and len(child_el) == 1:
            #    s["children"].append()
            #    continue
            #print child_el
            #if len(child_el) > 1:
                #ss["children"] = recursive_writeable_json_from_dict(child_el)
            if child_el.items()[0][0] == "size" and len(child_el) == 1:
                #s["children"].append(ss)
                s.append(ss)
                continue
            ss["children"] = recursive_writeable_json_from_dict(child_el, child_k)
            #s["children"].append(ss)
            s.append(ss)

    return s

def main():

    os.chdir(IN_DIR)

    read_save_taxonomy(WRITE=True)

main()


text:
import type { PackageJson } from 'type-fest';
import Generator from '../generator.js';

export default class TypescriptGenerator extends Generator {
  public async configuring(): Promise<void> {
    this.packageJson.merge({
      scripts: {
        'check-types': 'tsc --noEmit',
        build: 'tsc -p tsconfig.build.json',
      },
    });

    if (!this.hasAnyDependency('typescript')) {
      await this.addDevDependencies(['typescript']);
    }
  }

  public async writing(): Promise<void> {
    const packageFiles = (this.packageJson.get('files') as PackageJson['files']) ?? [];
    const exclude = [...packageFiles];

    if (this.hasDevDependency('flow-bin')) {
      exclude.push('**/*.flow');
    }

    const options = {
      excludeFiles: exclude.map((file) => `"${file}"`).join(','),
      flow: this.hasDevDependency('flow-bin'),
      jest: this.hasDevDependency('jest'),
      lit: this.hasAnyDependency('lit'),
      module: this.packageJson.get('type') === 'module' ? 'ESNext' : 'commonjs',
      outDir: packageFiles.includes('/lib') ? '.' : packageFiles[0]?.replace(/^\//g, ''),
      puppeteer: this.hasDevDependency('puppeteer'),
      react: this.hasAnyDependency('react'),
      storybook:
        this.hasDevDependency('@storybook/react') ||
        this.hasDevDependency('@storybook/web-components'),
    };

    await this.renderTpl('tsconfig.json', 'tsconfig.json', options, { rmWhitespace: true });
    await this.renderTpl('tsconfig.build.json', 'tsconfig.build.json', options, {
      rmWhitespace: true,
    });
  }
}


text:
<?php

namespace App\Optimizers\ShotgunOptimizer\Examples;

use App\Optimizers\ShotgunOptimizer\ShotgunOptimizer;
use App\Utils\Functions\ObjectiveFunctions\SchwefelFunction;
use App\Utils\Loggable\TerminalLoggable;

error_reporting(E_ALL);
ini_set('display_errors', 'On');
require_once(__DIR__ . '/../../../../vendor/autoload.php');

$so = new ShotgunOptimizer(50, 5000, 50, -500, 500, new SchwefelFunction(), new TerminalLoggable());
$so->run();
var_dump($so->getBest());


text:
package se.vandmo.textchecker.maven.rules;

import static com.google.common.collect.Lists.newArrayList;
import static java.util.Collections.emptyList;
import static org.apache.commons.lang3.StringUtils.isNotBlank;

import java.util.Collection;

import se.vandmo.textchecker.maven.Complaint;
import se.vandmo.textchecker.maven.Content;
import se.vandmo.textchecker.maven.Rule;
import se.vandmo.textchecker.maven.annotations.FixWith;
import se.vandmo.textchecker.maven.fixers.RemoveWhitespaceOnBlankLines;

@FixWith(RemoveWhitespaceOnBlankLines.class)
public final class NoWhitespaceOnBlankLines implements Rule {

  @Override
  public Collection<Complaint> check(Content content) {
    if (!content.checkLines(NoWhitespaceOnBlankLines::isOk)) {
      return newArrayList(new Complaint("File contains whitespace on blank line"));
    }
    return emptyList();
  }

  public static boolean isOk(String line) {
    return isNotBlank(line) || line.length() == 0;
  }

}


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

<title>Uses of Class org.w3c.dom.ls.LSException (Java Platform SE 7 )</title>
<meta name="date" content="2014-12-18">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Java™ Platform
Standard Ed. 7

Prev

Next

Frames

No Frames

All Classes

Uses of Class
org.w3c.dom.ls.LSException

Packages that use LSException

Package
Description

org.w3c.dom.ls

Uses of LSException in org.w3c.dom.ls

Methods in org.w3c.dom.ls that throw LSException

Modifier and Type
Method and Description

Document
LSParser.parse(LSInput input)

Parse an XML document from a resource identified by a
 LSInput.

Document
LSParser.parseURI(String uri)

Parse an XML document from a location identified by a URI reference [IETF RFC 2396].

Node
LSParser.parseWithContext(LSInput input,
                Node contextArg,
                short action)

Parse an XML fragment from a resource identified by a
 LSInput and insert the content into an existing document
 at the position specified with the context and
 action arguments.

boolean
LSSerializer.write(Node nodeArg,
     LSOutput destination)

Serialize the specified node as described above in the general
 description of the LSSerializer interface.

String
LSSerializer.writeToString(Node nodeArg)

Serialize the specified node as described above in the general
 description of the LSSerializer interface.

boolean
LSSerializer.writeToURI(Node nodeArg,
          String uri)

A convenience method that acts as if LSSerializer.write
 was called with a LSOutput with no encoding specified
 and LSOutput.systemId set to the uri
 argument.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Java™ Platform
Standard Ed. 7

Prev

Next

Frames

No Frames

All Classes

 Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
 Copyright © 1993, 2015, Oracle and/or its affiliates.  All rights reserved.


text:
import React, { Component } from 'react';
import styled from 'styled-components';
import MediaQuery from 'react-responsive';
import MenuItem from 'material-ui/MenuItem';
import SelectField from 'material-ui/SelectField';

import {
    bonusPeriodIconList,
    getBonusPeriodIndexFromPeriod,
    getPeriodDisplayByPeriod,
    periodList
} from '../assets/bonusPeriod';

// styled components
const DescriptionWrapper = styled.div`
    margin: 0 auto;
    width: 75%;
    @media (max-width: 768px) {
        margin-bottom: 20px;
    }
`;

const IconWrapper = styled.div`
    display: flex;
    justify-content: center;

    img {
        height: 120px;
        width: 100%;
    }
`;

const LabelWrapper = styled.div`
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 30px;
`;

const LeftWrapper = styled.div`
    display: flex;
    flex-direction: column;
    width: 50%;
    @media (max-width: 768px) {
        width: auto;
    }
`;

const PeriodWrapper = styled.div`
    font-size: 48px;
    margin-bottom: 50px;
    @media (max-width: 768px) {
        margin-bottom: 20px;
    }
`;

const RightWrapper = styled.div`
    text-align: center;
    width: 50%;
    @media (max-width: 768px) {
        width: auto;
    }
`;

const SelectFieldWrapper = styled.div`
    margin: 0 auto;
    text-align: center;
    width: 50%;

    @media (max-width: 768px) {
        width: auto;
    }
`;

const Wrapper = styled.div`
    display: flex;
    flex-direction: row;
    width: 100%;

    @media (max-width: 768px) {
        align-items: center;
        display: flex;
        flex-direction: column;
    }
`;

// override material ui
const iconStyle = {
    top: '30px',
};

const menuStyle = {
    top: '-30px',
};

const deskTopLabelStyle = {
    backgroundColor: '#F0F0F0',
    height: 'auto',
    lineHeight: '30px',
    top: '41px',
};

const mobileLabelStyle = {
    ...deskTopLabelStyle,
    paddingLeft: '25px',
};

class BonusPeriodSelectForm extends Component {
    constructor(props) {
        super(props);
        this.state = {
            bonusPeriodIndex: 4,
            period: '0-24',
        };
    }

    componentDidMount() {
        if (this.props.period && this.props.period !== this.state.period) {
            const bonusPeriodIndex = getBonusPeriodIndexFromPeriod(this.props.period);
            this.setState({
                bonusPeriodIndex,
                period: this.props.period,
            });
        }
    }

    componentWillReceiveProps(nextProps) {
        if (nextProps.period !== this.props.period || this.props.period !== this.state.period) {
            const bonusPeriodIndex = getBonusPeriodIndexFromPeriod(nextProps.period);
            this.setState({
                bonusPeriodIndex,
                period: nextProps.period,
            });
        }
    }

    render() {
        const {
            handlePeriodChange,
        } = this.props;
        const {
            bonusPeriodIndex,
            period,
        } = this.state;

        const width = window.innerWidth || document.body.clientWidth;

        const labelStyle = (width <= 768) ? mobileLabelStyle : deskTopLabelStyle;

        return (
            <Wrapper>
                <LeftWrapper>
                    <IconWrapper>
                        <img src={bonusPeriodIconList[bonusPeriodIndex]} />
                    </IconWrapper>
                    <SelectFieldWrapper>
                        <SelectField
                            fullWidth
                            iconStyle={iconStyle}
                            menuStyle={menuStyle}
                            labelStyle={labelStyle}
                            onChange={handlePeriodChange}
                            value={period}
                        >
                            {
                                periodList.map((periodInfo, periodIndex) => {
                                    return (
                                        <MenuItem
                                            key={`create-card-period-${periodIndex}`}
                                            primaryText={periodInfo.label}
                                            value={periodInfo.period}
                                        />
                                    );
                                })
                            }
                        </SelectField>
                    </SelectFieldWrapper>
                </LeftWrapper>
                <RightWrapper>
                    <LabelWrapper>
                        回報時段:
                    </LabelWrapper>
                    <PeriodWrapper>
                        {getPeriodDisplayByPeriod(bonusPeriodIndex)}
                    </PeriodWrapper>
                    <DescriptionWrapper>
                        您可以在一天之中隨意回報,若選擇特定時段,則該時段內回報分數會加成。
                    </DescriptionWrapper>
                </RightWrapper>
            </Wrapper>
        );
    }
}

export default BonusPeriodSelectForm;


text:
// This file is automatically generated.

package adila.db;

/*
 * ViewSonic
 *
 * DEVICE: viewpad7x
 * MODEL: ViewPad7X
 */
final class viewpad7x {
    public static final String DATA = "ViewSonic||";
}


text:
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

package org.chromium.base;

import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;

/**
 * This class provides package checking related methods.
 */
public class PackageUtils {
    /**
     * Retrieves the version of the given package installed on the device.
     *
     * @param context Any context.
     * @param packageName Name of the package to find.
     * @return The package's version code if found, -1 otherwise.
     */
    public static int getPackageVersion(Context context, String packageName) {
        int versionCode = -1;
        PackageManager pm = context.getPackageManager();
        try {
            PackageInfo packageInfo = pm.getPackageInfo(packageName, 0);
            if (packageInfo != null) versionCode = packageInfo.versionCode;
        } catch (PackageManager.NameNotFoundException e) {
            // Do nothing, versionCode stays -1
        }
        return versionCode;
    }

    private PackageUtils() {
        // Hide constructor
    }
}


text:
namespace gli
{
	/// 2d array texture
	class texture2d_array : public texture
	{
	public:
		typedef extent2d extent_type;

	public:
		/// Create an empty texture 2D array
		texture2d_array();

		/// Create a texture2d_array and allocate a new storage_linear
		texture2d_array(
			format_type Format,
			extent_type const& Extent,
			size_type Layers,
			size_type Levels,
			swizzles_type const& Swizzles = swizzles_type(SWIZZLE_RED, SWIZZLE_GREEN, SWIZZLE_BLUE, SWIZZLE_ALPHA));

		/// Create a texture2d_array and allocate a new storage_linear with a complete mipmap chain
		texture2d_array(
			format_type Format,
			extent_type const& Extent,
			size_type Layers,
			swizzles_type const& Swizzles = swizzles_type(SWIZZLE_RED, SWIZZLE_GREEN, SWIZZLE_BLUE, SWIZZLE_ALPHA));

		/// Create a texture2d_array view with an existing storage_linear
		explicit texture2d_array(
			texture const& Texture);

		/// Create a texture2d_array view with an existing storage_linear
		texture2d_array(
			texture const& Texture,
			format_type Format,
			size_type BaseLayer, size_type MaxLayer,
			size_type BaseFace, size_type MaxFace,
			size_type BaseLevel, size_type MaxLevel,
			swizzles_type const& Swizzles = swizzles_type(SWIZZLE_RED, SWIZZLE_GREEN, SWIZZLE_BLUE, SWIZZLE_ALPHA));

		/// Create a texture view, reference a subset of an exiting texture2d_array instance
		texture2d_array(
			texture2d_array const& Texture,
			size_type BaseLayer, size_type MaxLayer,
			size_type BaseLevel, size_type MaxLevel);

		/// Create a view of the texture identified by Layer in the texture array
		texture2d operator[](size_type Layer) const;

		/// Return the dimensions of a texture instance: width and height
		extent_type extent(size_type Level = 0) const;

		/// Fetch a texel from a texture. The texture format must be uncompressed.
		template <typename gen_type>
		gen_type load(extent_type const& TexelCoord, size_type Layer, size_type Level) const;

		/// Write a texel to a texture. The texture format must be uncompressed.
		template <typename gen_type>
		void store(extent_type const& TexelCoord, size_type Layer, size_type Level, gen_type const& Texel);
	};
}//namespace gli

#include "./core/texture2d_array.inl"


text: This is workshops page


text:
using System;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;

namespace ZendeskApi_v2.Models.Organizations
{
    public class OrganizationMembership
    {
        [JsonProperty("id")]
        public long? Id { get; set; }

        [JsonProperty("url")]
        public string Url { get; set; }

        [JsonProperty("user_id")]
        public long? UserId { get; set; }

        [JsonProperty("organization_id")]
        public long? OrganizationId { get; set; }

        [JsonProperty("default")]
        public bool Default { get; set; }

        [JsonProperty("created_at")]
        [JsonConverter(typeof(IsoDateTimeConverter))]
        public DateTimeOffset? CreatedAt { get; set; }

        [JsonProperty("updated_at")]
        [JsonConverter(typeof(IsoDateTimeConverter))]
        public DateTimeOffset? UpdatedAt { get; set; }
    }
}


text:
package com.phoenixnap.oss.ramlplugin.raml2code.github;

import org.junit.Before;
import org.junit.Test;

import com.phoenixnap.oss.ramlplugin.raml2code.plugin.TestConfig;
import com.phoenixnap.oss.ramlplugin.raml2code.rules.GitHubAbstractRuleTestBase;
import com.phoenixnap.oss.ramlplugin.raml2code.rules.Spring4ControllerDecoratorRule;
import com.phoenixnap.oss.ramlplugin.raml2code.rules.Spring4ControllerInterfaceRule;
import com.phoenixnap.oss.ramlplugin.raml2code.rules.Spring4RestTemplateClientRule;
import com.phoenixnap.oss.ramlplugin.raml2code.rules.SpringFeignClientInterfaceRule;

/**
 * @author aleksandars
 * @since 2.0.4
 */
public class Issue254RulesTest extends GitHubAbstractRuleTestBase {

	@Before
	public void init() {
		super.setGitHubValidatorBase(DEFAULT_GITHUB_VALIDATOR_BASE + "issue-254/");
	}

	@Test
	public void verify_decorator_inject_header() throws Exception {

		TestConfig.setInjectHttpHeadersParameter(true);

		loadRaml("issue-254.raml");
		rule = new Spring4ControllerDecoratorRule();
		rule.apply(getControllerMetadata(), jCodeModel);
		verifyGeneratedCode("Issue254-1Spring4ControllerDecorator");

		TestConfig.setInjectHttpHeadersParameter(false);
	}

	@Test
	public void verify_decorator_no_inject_header() throws Exception {

		TestConfig.setInjectHttpHeadersParameter(false);

		loadRaml("issue-254.raml");
		rule = new Spring4ControllerDecoratorRule();
		rule.apply(getControllerMetadata(), jCodeModel);
		verifyGeneratedCode("Issue254-2Spring4ControllerDecorator");

		TestConfig.setInjectHttpHeadersParameter(false);
	}

	@Test
	public void verify_interface_inject_header() throws Exception {

		TestConfig.setInjectHttpHeadersParameter(true);

		loadRaml("issue-254.raml");
		rule = new Spring4ControllerInterfaceRule();
		rule.apply(getControllerMetadata(), jCodeModel);
		verifyGeneratedCode("Issue254-1Spring4ControllerInterface");

		TestConfig.setInjectHttpHeadersParameter(false);
	}

	@Test
	public void verify_interface_no_inject_header() throws Exception {

		TestConfig.setInjectHttpHeadersParameter(false);

		loadRaml("issue-254.raml");
		rule = new Spring4ControllerInterfaceRule();
		rule.apply(getControllerMetadata(), jCodeModel);
		verifyGeneratedCode("Issue254-2Spring4ControllerInterface");

		TestConfig.setInjectHttpHeadersParameter(false);
	}

	@Test
	public void verify_client_inject_header() throws Exception {

		TestConfig.setInjectHttpHeadersParameter(true);

		loadRaml("issue-254.raml");
		rule = new Spring4RestTemplateClientRule();
		rule.apply(getControllerMetadata(), jCodeModel);
		verifyGeneratedCode("Issue254-Spring4RestTemplateClient");

		TestConfig.setInjectHttpHeadersParameter(false);
	}

	@Test
	public void verify_feign_client_inject_header() throws Exception {

		TestConfig.setInjectHttpHeadersParameter(true);

		loadRaml("issue-254.raml");
		rule = new SpringFeignClientInterfaceRule();
		rule.apply(getControllerMetadata(), jCodeModel);
		verifyGeneratedCode("Issue254-FeignClientInterface");

		TestConfig.setInjectHttpHeadersParameter(false);
	}

}


text:
// (C) Copyright 1996,1998 by Autodesk, Inc.
//
// Permission to use, copy, modify, and distribute this software in
// object code form for any purpose and without fee is hereby granted,
// provided that the above copyright notice appears in all copies and
// that both that copyright notice and the limited warranty and
// restricted rights notice below appear in all supporting
// documentation.
//
// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE.  AUTODESK, INC.
// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
// UNINTERRUPTED OR ERROR FREE.
//
// Use, duplication, or disclosure by the U.S. Government is subject to
// restrictions set forth in FAR 52.227-19 (Commercial Computer
// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
// (Rights in Technical Data and Computer Software), as applicable.
//
//  edreact.cpp

#include "acdb.h"             // acdb definitions
#include "adslib.h"           // ads defs
#include "dbents.h"           // "old" entities
#include "aced.h"             // aced stuff
#include "dbdict.h"           // dictionaries
#include "dbsymtb.h"          // symboltables
#include "acgi.h"             // graphical definitions
#include "dbidmap.h"          // id mapping
#include "edreact.h"
#include "mkrenti.h"
#include "arxutils.h"
#include "mkrobje.h"

Adesk::Boolean
isCloned( const AcDbObjectId&  refId,
		 const AcDbIdMapping& idMap )
{
	AcDbIdPair pair;
	pair.setKey( refId );
	return idMap.compute( pair ) && pair.value() != 0;
}

// editor reactor EditorReactor
//
static AsdkEditorReactor* pEditorReactor = NULL; // MDI Safe

// call this function to
// create the reactor EditorReactor
//
void
create_EditorReactor()
{
	if (NULL == pEditorReactor)
		pEditorReactor = new AsdkEditorReactor();
	acedEditor->addReactor( pEditorReactor );
}

// call this function to
// erase the reactor EditorReactor
//
void
erase_EditorReactor()
{
	acedEditor->removeReactor(pEditorReactor);
	delete pEditorReactor;
}

void
AsdkEditorReactor::beginDeepCloneXlation(AcDbIdMapping&     idMap,
										 Acad::ErrorStatus* pRetStatus)
{
#ifdef NOD
#if defined( XLATE ) && !defined( DIRECT )
	AcDbDatabase *pOrigDb, *pDestDb;
	idMap.origDb( pOrigDb );
	idMap.destDb( pDestDb );
	bool res;

	AcDbIdMappingIter iter(idMap);
	AcDbIdPair idPair;
	bool bDictCloned = false;
	Acad::ErrorStatus es;
	AcDb::DeepCloneType  dcc = idMap.deepCloneContext();
	for (iter.start(); !iter.done(); iter.next())
	{
		if (!iter.getMap(idPair))
			continue;
		if (!idPair.isCloned())
			continue;

		AsdkMkrEntity *pMkrEnt;
		if (Acad::eOk != acdbOpenObject( pMkrEnt, idPair.key(), AcDb::kForRead ))
			continue;
		AcDbObjectId refId = pMkrEnt->id();
		pMkrEnt->close();

		if (!isCloned( refId, idMap ))
		{
			// for soft pointer id's.
			//
			AcDbObject* pO=NULL,*pClone=NULL;
			if (acdbOpenObject(pO,refId,AcDb::kForRead)!=Acad::eOk)
				continue;
			AcDbObjectId newId;
			if (AcDb::kDcWblock == idMap.deepCloneContext()
#ifndef HARDPOINTER
				|| AcDb::kDcWblkObjects == idMap.deepCloneContext()
#endif  // !HARDPOINTER
				)
			{
				// no action required when using hard pointer id's
#ifndef HARDPOINTER
				//pDestDb->addAcDbObject( newId, pClone );
				es = pO->wblockClone(pDestDb,pClone,idMap,false);
				if (pClone!=NULL)
					pClone->close();
#endif  // !HARDPOINTER
			}
			else
			{
				assert(pOrigDb!=NULL);
				assert(pDestDb!=NULL);
				//get or create our dictionary in the destination database
				AcDbDictionary *pDestDict =
					getDict( /*NOXLATE*/"ASDK_MYDICT", AcDb::kForWrite, pDestDb );
				assert(NULL != pDestDict);
				//get our dictionary in the the source db
				AcDbObjectId srcId = getDictId( /*NOXLATE*/"ASDK_MYDICT", pOrigDb,false );
				//make sure that this pair appears in the id map
				AcDbIdPair searchPair(srcId,pDestDict->objectId(),false,true,true);
				if (pDestDict->isNewObject())
					searchPair.setIsCloned(true); //it was 'cloned': we just created it
				idMap.assign(searchPair);
				//clone the object
				es = pO->deepClone(pDestDict,pClone,idMap,true);
				assert(es==Acad::eOk);
				if (pClone!=NULL)
				{
					if (pDestDict->has( /*NOXLATE*/"MYENTRY" ))
						pDestDict->setAt( "*", pClone, newId );
					else
						pDestDict->setAt( /*NOXLATE*/"MYENTRY", pClone, newId );
					searchPair.setKey(pO->objectId());
					//find this pair
					res = idMap.compute(searchPair);
					assert(res);
					//let everyone know that its owner has been xlated
					searchPair.setIsOwnerXlated(true);
					//change it
					idMap.change(searchPair);
					pClone->close();
				}
				pDestDict->close();
			}
			pO->close();
		}
		//handle refedit across dbs
		if (AcDb::kDcWblkObjects == idMap.deepCloneContext() )
		{
			//we use the same code for check-in and check-out!
			AcDbIdPair pair;
			//lookup the object in the map
			pair.setKey( refId);
			res = idMap.compute( pair );
			assert(res);
			AcDbObject* pClone;
			AcDbObjectId newId;
			//open clone, it has already been copied either automatically (hard pointer) or
			//by the code above (soft pointer)
			if (acdbOpenObject(pClone,pair.value(),AcDb::kForWrite)==Acad::eOk)
			{
				//try to get our dictionary in the destination database
				AcDbDictionary* pDestDict =
					getDict( /*NOXLATE*/"ASDK_MYDICT",AcDb::kForWrite, pDestDb,false);
				if (pDestDict == NULL)
				{
					//Not yet there:
					//it is being copied so find it and set up its owner
					AcDbObject* pO;
					if ((es = acdbOpenObject(pO,pair.key(),AcDb::kForRead))==Acad::eOk)
					{
						AcDbIdPair searchPair;
						searchPair.setKey(pO->ownerId());
						es = pO->close();
						if (es == Acad::eOk && idMap.compute(searchPair))
						{
							AcDbDictionary* pNOD;
							if ((es=pDestDb->getNamedObjectsDictionary(pNOD,AcDb::kForWrite))==Acad::eOk)
							{
								if ((es=acdbOpenObject(pO,searchPair.value(),AcDb::kForWrite))==Acad::eOk)
								{
									//Let NOD in the dest db know that this dict belongs to it
									if ((es = pNOD->setAt(/*NOXLATE*/"ASDK_MYDICT",pO,newId))==Acad::eOk)
									{
										//Let the cloning process know that we have set
										//the owner
										searchPair.setIsOwnerXlated(true);
										idMap.change(searchPair);
										bDictCloned = true;
									}
									es = pO->close();
								}
								es = pNOD->close();
							}
						}
					}
				}
				else
				{
					//the destination db has our dictionary:
					//check if it was just cloned above
					//if it was cloned then there's nothing we need to do
					if (!bDictCloned)
					{
						//simply use anonymous objects
						if ((es =pDestDict->setAt("*",pClone,newId))==Acad::eOk)
						{
							//make sure the the longtransaction tries to use swapIdWith
							//(it only applies during checkin)
							pair.setIsPrimary(true);
							//Let the cloning process know that we have set
							//the owner
							pair.setIsOwnerXlated(true);
							idMap.change(pair);
						}
					}
					pDestDict->close();
				}
				if (es!=Acad::eOk)
				{
					*pRetStatus = es;
					return;
				}
				pClone->close();
			}
		}
	}
#endif  // XLATE
#endif //NOD
}


text:
package org.apache.camel.http.common;

import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.assertFalse;

public class HttpOperationFailedExceptionTest {

    @Test
    public void testUriIsSanitized() {
        HttpOperationFailedException httpOperationFailedException
                = new HttpOperationFailedException("http://user:password@host", 500, "", "", null, "");

        assertFalse(httpOperationFailedException.getMessage().contains("password"));
        assertFalse(httpOperationFailedException.getUri().contains("password"));
    }
}


text:
// -*- c++ -*-
// Generated by gmmproc 2.44.0 -- DO NOT MODIFY!
#ifndef _GTKMM_FLOWBOXCHILD_H
#define _GTKMM_FLOWBOXCHILD_H

#include <glibmm/ustring.h>
#include <sigc++/sigc++.h>

#include <gtkmm/bin.h>

#ifndef DOXYGEN_SHOULD_SKIP_THIS
typedef struct _GtkFlowBoxChild GtkFlowBoxChild;
typedef struct _GtkFlowBoxChildClass GtkFlowBoxChildClass;
#endif /* DOXYGEN_SHOULD_SKIP_THIS */

#ifndef DOXYGEN_SHOULD_SKIP_THIS
namespace Gtk
{ class FlowBoxChild_Class; } // namespace Gtk
#endif //DOXYGEN_SHOULD_SKIP_THIS

namespace Gtk
{

/** See the description of FlowBox.
 *
 * @ingroup Widgets
 * @ingroup Containers
 *
 * @newin{3,12}
 */

class FlowBoxChild
  : public Bin
{
  public:
#ifndef DOXYGEN_SHOULD_SKIP_THIS
  typedef FlowBoxChild CppObjectType;
  typedef FlowBoxChild_Class CppClassType;
  typedef GtkFlowBoxChild BaseObjectType;
  typedef GtkFlowBoxChildClass BaseClassType;
#endif /* DOXYGEN_SHOULD_SKIP_THIS */

  virtual ~FlowBoxChild();

#ifndef DOXYGEN_SHOULD_SKIP_THIS

private:
  friend class FlowBoxChild_Class;
  static CppClassType flowboxchild_class_;

  // noncopyable
  FlowBoxChild(const FlowBoxChild&);
  FlowBoxChild& operator=(const FlowBoxChild&);

protected:
  explicit FlowBoxChild(const Glib::ConstructParams& construct_params);
  explicit FlowBoxChild(GtkFlowBoxChild* castitem);

#endif /* DOXYGEN_SHOULD_SKIP_THIS */

public:

  /** Get the GType for this class, for use with the underlying GObject type system.
   */
  static GType get_type()      G_GNUC_CONST;

#ifndef DOXYGEN_SHOULD_SKIP_THIS

  static GType get_base_type() G_GNUC_CONST;
#endif

  ///Provides access to the underlying C GtkObject.
  GtkFlowBoxChild*       gobj()       { return reinterpret_cast<GtkFlowBoxChild*>(gobject_); }

  ///Provides access to the underlying C GtkObject.
  const GtkFlowBoxChild* gobj() const { return reinterpret_cast<GtkFlowBoxChild*>(gobject_); }

public:
  //C++ methods used to invoke GTK+ virtual functions:

protected:
  //GTK+ Virtual Functions (override these to change behaviour):

  //Default Signal Handlers::
  /// This is a default handler for the signal signal_activate().
  virtual void on_activate();

private:

public:

  /** Creates a new FlowBoxChild, to be used as a child of a FlowBox.
   */
  FlowBoxChild();

  /** Gets the current index of the @a child in its Gtk::FlowBox container.
   *
   * @newin{3,12}
   *
   * @return The index of the @a child, or -1 if the @a child is not
   * in a flow box.
   */
  int get_index() const;

  /** Returns whether the @a child is currently selected in its
   * Gtk::FlowBox container.
   *
   * @newin{3,12}
   *
   * @return <tt>true</tt> if @a child is selected.
   */
  bool is_selected() const;

  /** Marks @a child as changed, causing any state that depends on this
   * to be updated. This affects sorting and filtering.
   *
   * Note that calls to this method must be in sync with the data
   * used for the sorting and filtering functions. For instance, if
   * the list is mirroring some external data set, and *two* children
   * changed in the external data set when you call
   * changed() on the first child, the sort function
   * must only read the new data for the first of the two changed
   * children, otherwise the resorting of the children will be wrong.
   *
   * This generally means that if you don't fully control the data
   * model, you have to duplicate the data that affects the sorting
   * and filtering functions into the widgets themselves. Another
   * alternative is to call invalidate_sort() on any
   * model change, but that is more expensive.
   *
   * @newin{3,12}
   *
   */
  void changed();

  /**
   * @par Slot Prototype:
   * <tt>void on_my_%activate()</tt>
   *
   * The signal_activate() signal is emitted when the user activates
   * a child widget in a Gtk::FlowBox, either by clicking or
   * double-clicking, or by using the Space or Enter key.
   *
   * While this signal is used as a
   * [keybinding signal][GtkBindingSignal],
   * it can be used by applications for their own purposes.
   *
   */

  Glib::SignalProxy0< void > signal_activate();

};

} // namespace Gtk

namespace Glib
{
  /** A Glib::wrap() method for this object.
   *
   * @param object The C instance.
   * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
   * @result A C++ instance that wraps this C instance.
   *
   * @relates Gtk::FlowBoxChild
   */
  Gtk::FlowBoxChild* wrap(GtkFlowBoxChild* object, bool take_copy = false);
} //namespace Glib

#endif /* _GTKMM_FLOWBOXCHILD_H */


text:
<!DOCTYPE html>

  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no"/>
  <title>DL Divine | Home</title>

  <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
  <link href="css/materialize.css" type="text/css" rel="stylesheet" media="screen,projection"/>
  <link href="css/style.css" type="text/css" rel="stylesheet" media="screen,projection"/>

Home

Rooms

Gallery

Book a Room

Dashboard

Adminarrow_drop_down

Profile Settings

Logout

Home

Rooms

Gallery

Logout

      menu

  Select

Announcements

Promos

Activities

Accepted Users

Reservations

List of Transactions

      Made by Materialize


text:
package com.amazonaws.services.apprunner.model;

import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;

/**
 *

 * Network configuration settings for inbound network traffic.
 *

 *
 * @see AWS API
 *      Documentation
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class IngressConfiguration implements Serializable, Cloneable, StructuredPojo {

    /**
     *

     * Specifies whether your App Runner service is publicly accessible. To make the service publicly accessible set it
     * to True. To make the service privately accessible, from only within an Amazon VPC set it to
     * False.
     *

     */
    private Boolean isPubliclyAccessible;

    /**
     *

     * Specifies whether your App Runner service is publicly accessible. To make the service publicly accessible set it
     * to True. To make the service privately accessible, from only within an Amazon VPC set it to
     * False.
     *

     *
     * @param isPubliclyAccessible
     *        Specifies whether your App Runner service is publicly accessible. To make the service publicly accessible
     *        set it to True. To make the service privately accessible, from only within an Amazon VPC set
     *        it to False.
     */

    public void setIsPubliclyAccessible(Boolean isPubliclyAccessible) {
        this.isPubliclyAccessible = isPubliclyAccessible;
    }

    /**
     *

     * Specifies whether your App Runner service is publicly accessible. To make the service publicly accessible set it
     * to True. To make the service privately accessible, from only within an Amazon VPC set it to
     * False.
     *

     *
     * @return Specifies whether your App Runner service is publicly accessible. To make the service publicly accessible
     *         set it to True. To make the service privately accessible, from only within an Amazon VPC set
     *         it to False.
     */

    public Boolean getIsPubliclyAccessible() {
        return this.isPubliclyAccessible;
    }

    /**
     *

     * Specifies whether your App Runner service is publicly accessible. To make the service publicly accessible set it
     * to True. To make the service privately accessible, from only within an Amazon VPC set it to
     * False.
     *

     *
     * @param isPubliclyAccessible
     *        Specifies whether your App Runner service is publicly accessible. To make the service publicly accessible
     *        set it to True. To make the service privately accessible, from only within an Amazon VPC set
     *        it to False.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public IngressConfiguration withIsPubliclyAccessible(Boolean isPubliclyAccessible) {
        setIsPubliclyAccessible(isPubliclyAccessible);
        return this;
    }

    /**
     *

     * Specifies whether your App Runner service is publicly accessible. To make the service publicly accessible set it
     * to True. To make the service privately accessible, from only within an Amazon VPC set it to
     * False.
     *

     *
     * @return Specifies whether your App Runner service is publicly accessible. To make the service publicly accessible
     *         set it to True. To make the service privately accessible, from only within an Amazon VPC set
     *         it to False.
     */

    public Boolean isPubliclyAccessible() {
        return this.isPubliclyAccessible;
    }

    /**
     * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
     * redacted from this string using a placeholder value.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getIsPubliclyAccessible() != null)
            sb.append("IsPubliclyAccessible: ").append(getIsPubliclyAccessible());
        sb.append("}");
        return sb.toString();
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;

        if (obj instanceof IngressConfiguration == false)
            return false;
        IngressConfiguration other = (IngressConfiguration) obj;
        if (other.getIsPubliclyAccessible() == null ^ this.getIsPubliclyAccessible() == null)
            return false;
        if (other.getIsPubliclyAccessible() != null && other.getIsPubliclyAccessible().equals(this.getIsPubliclyAccessible()) == false)
            return false;
        return true;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;

        hashCode = prime * hashCode + ((getIsPubliclyAccessible() == null) ? 0 : getIsPubliclyAccessible().hashCode());
        return hashCode;
    }

    @Override
    public IngressConfiguration clone() {
        try {
            return (IngressConfiguration) super.clone();
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
        }
    }

    @com.amazonaws.annotation.SdkInternalApi
    @Override
    public void marshall(ProtocolMarshaller protocolMarshaller) {
        com.amazonaws.services.apprunner.model.transform.IngressConfigurationMarshaller.getInstance().marshall(this, protocolMarshaller);
    }
}


text:
'use strict';

/**
 * Delete Module
 * @namespace Modules
 */
angular.module('kauppapaikka.controllers.delete', []).controller('DeleteController', DeleteController);
DeleteController.$inject = ['$scope', 'marketadService'];

/**
 * @namespace DeleteController
 * @desc Controller for deleting marketads.
 * @memberOf Controllers
 */
function DeleteController($scope, marketadService) {

  $scope.deleteAd = function(id) {
    $scope.deleteStatus = "pending";
    // Delete the ad from the backend.
    marketadService.deleteAd(id)
    .then(
      function success(response) {
        $scope.deleteStatus = "ok";
      },
      function error(response) {
        $scope.deleteStatus = "failure";
      }
    );
  };
}


text:
<?php

namespace Parametros\Form;

use Zend\InputFilter\InputFilter;
use Zend\InputFilter\Input;
use Zend\Validator\StringLength;
use Zend\I18n\Validator\Alnum;
use Zend\Validator\Digits;
use Zend\Validator\NotEmpty;
use Zend\I18n\Filter\Alpha;

class EstadoValidator extends InputFilter {
	function __construct() {

		$est_id = new Input ( 'EST_ID' );
		$est_id->setRequired ( false );
		$est_id->getValidatorChain ()->attach ( new StringLength ( array (
				'max' => 4,
				'min' => 1
		) ) )->attach ( new Digits () );

		$this->add ( $est_id );

		$pai_id = new Input ( 'PAI_ID' );
		$pai_id->setRequired ( true );
		$pai_id->getValidatorChain ()->attach ( new StringLength ( array (
				'max' => 4,
				'min' => 1,
		) ) )->attach(new NotEmpty())
		->attach ( new Digits () );

		$this->add ( $pai_id );

		$est_nombre = new Input ( 'EST_NOMBRE' );
		$est_nombre->setRequired ( true );
		$est_nombre->getValidatorChain ()->attach ( new StringLength ( array (
				'max' => 150,
		) ) )->attach ( new Alnum ( array (
				'allowWhiteSpace' => true
		) ) )->attach(new NotEmpty());

		$this->add ( $est_nombre );

	}
}


text:
#include <Array.hpp>

namespace cpu
{

template<typename T>
Array<T> * regions(const Array<uchar> &in, af_connectivity_type connectivity);

}


text:
layout: page
title: About Meeplebox
tags: [about, Meeplebox]
modified: 2015-01-17T21:53:07.573882-04:00
comments: true
image:
  feature: playing-cards.jpg
  credit: Gabriela Pinto
  creditlink: https://www.flickr.com/photos/gabrielap93/
---

Meeplebox aims to provide a platform for boardgames and cardgames to be played online on your computer, tablet and/or phone. Our hope is to provide game settings appealing to both casual players as well has hardcore grognards. We hope o deliver a platform that is going to enable designers to use Meeplebox as a tool to design and test their games, delivering a game sandbox that is usable without the need to write any code.

## Play formats

* Real time
* Turn based ranging from near real time to weekly
* Single games
* Tournaments

## Status of the project

Meeplebox are currently in an very early plannng stage. Some initial coding have been done but there is as of yet no public plan as to when we will be able to invite gamers, designers and others that might have an interest in the project. Watch this space for future updates.

* January 2015 - Planning, architectual decisions and some coding for key elements that need early proof of concept


text:
package com.gfein.pimonitor.model.stat;

import android.util.Log;

import org.json.JSONObject;

public class Voltage {
    static final String LOGGING_TAG = "Voltage";

    protected String mCore;
    public String getmCore() { return mCore; }

    protected String mRAM_P;
    public String getmRAM_P() { return mRAM_P; }

    protected String mRAM_C;
    public String getmRAM_C() { return mRAM_C; }

    protected String mRAM_I;
    public String getmRAM_I() { return mRAM_I; }

    public Voltage(JSONObject json) {
        try {
            mCore = json.getString("core");
            mRAM_C = json.getString("sdram_c");
            mRAM_I = json.getString("sdram_i");
            mRAM_P = json.getString("sdram_p");
        }
        catch(Exception ex) {
            Log.e(LOGGING_TAG, "Couldn't parse Voltage");
        }
    }
}


text:
module Blogit
  module ApplicationHelper

    # Format content using the {Blogit::Configuration#default_parser_class default_parser_class}
    #
    # content - A String containing the content to be formatted (defaults: nil)
    # block   - A Proc that returns a String of content to be formatted
    #
    # Examples
    #
    #   format_content("# This is a Markdown header")
    #   # => "
This is a Markdown header
"
    #
    #   format_content do
    #     "some text"
    #   end
    #   # => "
some text
"
    #
    # Returns an HTML safe String.
    def format_content(content = nil, &block)
      content = capture(&block) if block_given?
      parser  = Blogit::configuration.default_parser_class.new(content)
      parser.parsed.to_s.html_safe
    end

    # The first error message for an ActiveRecord::Base model instance attribute
    #
    # object    - An ActiveRecord::Base instance to check
    # attribute - A Symbol or String with the attribute name to check errors on
    #
    # Examples
    #
    #  errors_on(@user, :first_name)
    #  # => "Can't be blank"
    #
    # Returns a String with the error message
    def errors_on(object, attribute)
      error_message = object.errors[attribute].first
      content_tag(:span, error_message, class: "blogit_error_message") if error_message
    end

    # A helper method for creating a div tag with class 'field'. Used for separating
    # form fields.
    #
    # content_or_options - The content to include in the div when not using a block. The
    #                      options Hash when using a block
    # options            - The options when not using a block
    # block              - A block that returns HTML content to include in the div
    #
    # Returns an HTML safe String
    def field(content_or_options = {}, options ={}, &block)
      div_tag_with_default_class("field", content_or_options, options, &block)
    end

    # A helper method for creating a div tag with class 'actions'. Used as a wrapper
    # for form actions.
    #
    # content_or_options - The content to include in the div when not using a block. The
    #                      options Hash when using a block
    # options            - The options when not using a block
    # block              - A block that returns HTML content to include in the div
    #
    # Returns an HTML safe String
    def actions(content_or_options={}, options ={}, &block)
      div_tag_with_default_class("actions", content_or_options, options, &block)
    end

    private

    # Creates an HTML div with a default class value added
    #
    # default_class      - The CSS class name to add to the div
    # content_or_options - The content to include in the div when not using a block. The
    #                      options Hash when using a block
    # options            - The options when not using a block
    # block              - A block that returns HTML content to include in the div
    #
    #
    # Returns an HTML safe String
    def div_tag_with_default_class(default_class, content_or_options, options, &block)
      if block_given?
        options = content_or_options
        content = capture(&block)
      else
        content = content_or_options
      end
      options[:class] = Array(options[:class]) + [default_class]
      content_tag(:div, content, options)
    end

  end

end


text:
@XmlSchema (
  namespace = "http://samples.enunciate.webcohesion.com/vehicles"
)
package com.webcohesion.enunciate.examples.java_xml_client.schema.vehicles;

import javax.xml.bind.annotation.XmlSchema;


text:
cask "cloudflare-warp" do
  version "2022.8.861.0,20220912.22"
  sha256 :no_check

  url "https://1111-releases.cloudflareclient.com/mac/Cloudflare_WARP.zip",
      verified: "1111-releases.cloudflareclient.com/mac/"
  name "Cloudflare WARP"
  desc "Free app that makes your Internet safer"
  homepage "https://cloudflarewarp.com/"

  livecheck do
    # :sparkle strategy using appcenter url cannot be used - see below link
    # https://github.com/Homebrew/homebrew-cask/pull/109118#issuecomment-887184248
    url :url
    strategy :extract_plist
  end

  auto_updates true

  pkg "Cloudflare_WARP.pkg"

  uninstall launchctl: "com.cloudflare.1dot1dot1dot1.macos.loginlauncherapp",
            script:    {
              executable: "/Applications/Cloudflare WARP.app/Contents/Resources/uninstall.sh",
              input:      ["Y\n"],
              sudo:       true,
            }

  zap trash: [
    "~/Library/Application Scripts/com.cloudflare.1dot1dot1dot1.macos.loginlauncherapp",
    "~/Library/Application Support/com.cloudflare.1dot1dot1dot1.macos",
    "~/Library/Caches/com.cloudflare.1dot1dot1dot1.macos",
    "~/Library/Caches/com.plausiblelabs.crashreporter.data/com.cloudflare.1dot1dot1dot1.macos",
    "~/Library/Containers/com.cloudflare.1dot1dot1dot1.macos.loginlauncherapp",
    "~/Library/HTTPStorages/com.cloudflare.1dot1dot1dot1.macos",
    "~/Library/HTTPStorages/com.cloudflare.1dot1dot1dot1.macos.binarycookies",
    "~/Library/Preferences/com.cloudflare.1dot1dot1dot1.macos.plist",
  ]
end


text:
<?xml version="1.0" encoding="utf-8"?>
<!--Layout for an individual layer item in the recyclerview for a GeoPackage detail-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:orientation="horizontal"
    android:paddingLeft="35dp">

    <!--    Right aligned enable switch-->
    <RelativeLayout
        android:id="@+id/RelativeLayout01"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_alignParentLeft="true">

        <!--Layer type icon-->
        <ImageView
            android:id="@+id/layer_icon"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerVertical="true"
            android:layout_gravity="center_vertical"
            android:src="@drawable/colored_layers"></ImageView>

        <!--Layer name-->
        <TextView
            android:id="@+id/layer_label"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_centerVertical="true"
            android:layout_gravity="bottom|start"
            android:layout_marginRight="88dp"
            android:layout_toRightOf="@id/layer_icon"
            android:paddingLeft="16dp"
            android:paddingTop="16dp"
            android:paddingRight="0dp"
            android:paddingBottom="16dp"
            android:text="layer"
            android:textAppearance="@style/textAppearanceSubtitle2_light_heavy"></TextView>

        <!--Active layer switch-->
        <Switch
            android:id="@+id/simpleSwitch"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true"
            android:layout_centerInParent="true"
            android:gravity="center_vertical"
            android:paddingTop="16dp"
            android:paddingRight="16dp"
            android:paddingBottom="16dp" />

        <ProgressBar
            android:id="@+id/progressBar"
            style="?android:attr/progressBarStyle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true"
            android:layout_centerInParent="true"
            android:gravity="center_vertical"
            android:paddingTop="16dp"
            android:paddingRight="16dp"
            android:paddingBottom="16dp"
            android:visibility="invisible" />
    </RelativeLayout>

</LinearLayout>


text:
#include <freertos/FreeRTOS.h>
#include <freertos/semphr.h>
#include <freertos/task.h>

#include <lwip/sockets.h>
#include <lwip/sys.h>

#include <string.h>

#include "echo.h"

#define OS_IS_FREERTOS 1

unsigned short echo_port = 7;

typedef struct
{
    int new_sd;
    SemaphoreHandle_t StatSem;
}echo_param;

void print_echo_app_header()
{
    printf("%13s %4d %s\r\n", "echo server",echo_port,"$ telnet <board_ip> 7");
}

/* thread spawned for each connection */
void process_echo_request(void *p)
{
    echo_param* echo_param1 = (echo_param*)p;
	int sd = (int)echo_param1->new_sd;
	int RECV_BUF_SIZE = 50;
	char recv_buf[RECV_BUF_SIZE];
	int n, nwrote;
	//xTaskHandle taskHello;
	//xTaskHandle taskBye;

	while (1) {
		/* read a max of RECV_BUF_SIZE bytes from socket */
		if ((n = read(sd, recv_buf, RECV_BUF_SIZE)) < 0) {
			printf("%s: error reading from socket %d, closing socket\r\n", __FUNCTION__, sd);
#ifdef OS_IS_FREERTOS
			break;
#else
    #ifdef APISSYS_RTOS
			break;
    #else
			close(sd);
			return;
    #endif
#endif
		}
		//printf("read %d echosocket bytes\n",n);

		/* break if the recved message = "quit" */
		if (!strncmp(recv_buf, "quit", 4))
			break;

		/* break if client closed connection */
		if (n <= 0)
			break;

		/* handle request */
		if ((nwrote = write(sd, recv_buf, n)) < 0) {
			printf("%s: ERROR responding to client echo request. received = %d, written = %d\r\n",__FUNCTION__, n, nwrote);
			printf("Closing socket %d\r\n", sd);
#ifdef OS_IS_FREERTOS
			break;
#else
    #ifdef APISSYS_RTOS
			break;
    #else
			close(sd);
			return;
    #endif
#endif
		}
	}

	/* close connection */
	close(sd);
#ifdef OS_IS_FREERTOS
	vTaskDelete(NULL);
#endif
#ifdef APISSYS_RTOS
	TaskDelete(NULL);
#endif
}

void echo_application_thread(void *pvParameters)
{
	int sock, new_sd;
	struct sockaddr_in address, remote;
	int size;
        echo_param* echo_param1 = malloc(sizeof(echo_param));

	if ((sock = socket(AF_INET, SOCK_STREAM, 0)) < 0)
		return;

	address.sin_family = AF_INET;
	address.sin_port = htons(echo_port);
	address.sin_addr.s_addr = INADDR_ANY;

	if (bind(sock, (struct sockaddr *)&address, sizeof (address)) < 0)
		return;

	listen(sock, 0);

	size = sizeof(remote);
        echo_param1->StatSem = pvParameters;

	while (1) {
		if ((new_sd = accept(sock, (struct sockaddr *)&remote, (socklen_t *)&size)) > 0) {
			printf("accepted new echo connection\n");
                        echo_param1->new_sd = new_sd;
			sys_thread_new("echo connection", process_echo_request,(void*)echo_param1,2*THREAD_STACKSIZE,DEFAULT_THREAD_PRIO);
		}
	}
}


text:
package com.intellij.ide.macro;

import com.intellij.ide.IdeBundle;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.actionSystem.LangDataKeys;
import com.intellij.openapi.module.Module;

public final class ModuleNameMacro extends Macro {
  @Override
  public String getName() {
    return "ModuleName";
  }

  @Override
  public String getDescription() {
    return IdeBundle.message("macro.module.file.name");
  }

  @Override
  public String expand(DataContext dataContext) {
    final Module module = LangDataKeys.MODULE.getData(dataContext);
    if (module == null) {
      return null;
    }
    return module.getName();
  }
}


text:
/********************************************************************************
** Form generated from reading UI file 'overviewpage.ui'
**
** Created: Mon Jan 27 22:16:18 2014
**      by: Qt User Interface Compiler version 4.8.2
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
********************************************************************************/

#ifndef UI_OVERVIEWPAGE_H
#define UI_OVERVIEWPAGE_H

#include <QtCore/QVariant>
#include <QtGui/QAction>
#include <QtGui/QApplication>
#include <QtGui/QButtonGroup>
#include <QtGui/QFormLayout>
#include <QtGui/QFrame>
#include <QtGui/QHBoxLayout>
#include <QtGui/QHeaderView>
#include <QtGui/QLabel>
#include <QtGui/QListView>
#include <QtGui/QVBoxLayout>
#include <QtGui/QWidget>

QT_BEGIN_NAMESPACE

class Ui_OverviewPage
{
public:
    QHBoxLayout *horizontalLayout;
    QVBoxLayout *verticalLayout_2;
    QFrame *frame;
    QVBoxLayout *verticalLayout_4;
    QFormLayout *formLayout_2;
    QLabel *label;
    QLabel *labelBalance;
    QLabel *label_3;
    QLabel *labelUnconfirmed;
    QLabel *label_2;
    QLabel *labelNumTransactions;
    QLabel *labelImmatureText;
    QLabel *labelImmature;
    QLabel *label_6;
    QLabel *labelWalletStatus;
    QVBoxLayout *verticalLayout_3;
    QFrame *frame_2;
    QVBoxLayout *verticalLayout;
    QHBoxLayout *horizontalLayout_2;
    QLabel *label_4;
    QLabel *labelTransactionsStatus;
    QListView *listTransactions;

    void setupUi(QWidget *OverviewPage)
    {
        if (OverviewPage->objectName().isEmpty())
            OverviewPage->setObjectName(QString::fromUtf8("OverviewPage"));
        OverviewPage->resize(624, 424);
        OverviewPage->setStyleSheet(QString::fromUtf8(""));
        horizontalLayout = new QHBoxLayout(OverviewPage);
        horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout"));
        verticalLayout_2 = new QVBoxLayout();
        verticalLayout_2->setObjectName(QString::fromUtf8("verticalLayout_2"));
        frame = new QFrame(OverviewPage);
        frame->setObjectName(QString::fromUtf8("frame"));
        frame->setFrameShape(QFrame::NoFrame);
        frame->setFrameShadow(QFrame::Raised);
        verticalLayout_4 = new QVBoxLayout(frame);
        verticalLayout_4->setObjectName(QString::fromUtf8("verticalLayout_4"));
        formLayout_2 = new QFormLayout();
        formLayout_2->setObjectName(QString::fromUtf8("formLayout_2"));
        formLayout_2->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow);
        formLayout_2->setHorizontalSpacing(12);
        formLayout_2->setVerticalSpacing(12);
        label = new QLabel(frame);
        label->setObjectName(QString::fromUtf8("label"));
        QFont font;
        font.setFamily(QString::fromUtf8("URW Gothic L"));
        font.setPointSize(11);
        font.setBold(false);
        font.setItalic(false);
        font.setWeight(50);
        label->setFont(font);

        formLayout_2->setWidget(1, QFormLayout::LabelRole, label);

        labelBalance = new QLabel(frame);
        labelBalance->setObjectName(QString::fromUtf8("labelBalance"));
        labelBalance->setFont(font);
        labelBalance->setCursor(QCursor(Qt::IBeamCursor));
        labelBalance->setText(QString::fromUtf8("0 PMM"));
        labelBalance->setTextInteractionFlags(Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse);

        formLayout_2->setWidget(1, QFormLayout::FieldRole, labelBalance);

        label_3 = new QLabel(frame);
        label_3->setObjectName(QString::fromUtf8("label_3"));
        label_3->setFont(font);

        formLayout_2->setWidget(2, QFormLayout::LabelRole, label_3);

        labelUnconfirmed = new QLabel(frame);
        labelUnconfirmed->setObjectName(QString::fromUtf8("labelUnconfirmed"));
        labelUnconfirmed->setFont(font);
        labelUnconfirmed->setCursor(QCursor(Qt::IBeamCursor));
        labelUnconfirmed->setText(QString::fromUtf8("0 PMM"));
        labelUnconfirmed->setTextInteractionFlags(Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse);

        formLayout_2->setWidget(2, QFormLayout::FieldRole, labelUnconfirmed);

        label_2 = new QLabel(frame);
        label_2->setObjectName(QString::fromUtf8("label_2"));
        label_2->setFont(font);

        formLayout_2->setWidget(4, QFormLayout::LabelRole, label_2);

        labelNumTransactions = new QLabel(frame);
        labelNumTransactions->setObjectName(QString::fromUtf8("labelNumTransactions"));
        labelNumTransactions->setFont(font);
        labelNumTransactions->setText(QString::fromUtf8("0"));

        formLayout_2->setWidget(4, QFormLayout::FieldRole, labelNumTransactions);

        labelImmatureText = new QLabel(frame);
        labelImmatureText->setObjectName(QString::fromUtf8("labelImmatureText"));
        labelImmatureText->setFont(font);

        formLayout_2->setWidget(3, QFormLayout::LabelRole, labelImmatureText);

        labelImmature = new QLabel(frame);
        labelImmature->setObjectName(QString::fromUtf8("labelImmature"));
        labelImmature->setFont(font);
        labelImmature->setText(QString::fromUtf8("0 PMM"));
        labelImmature->setTextInteractionFlags(Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse);

        formLayout_2->setWidget(3, QFormLayout::FieldRole, labelImmature);

        label_6 = new QLabel(frame);
        label_6->setObjectName(QString::fromUtf8("label_6"));
        QFont font1;
        font1.setFamily(QString::fromUtf8("URW Gothic L"));
        font1.setPointSize(20);
        font1.setBold(false);
        font1.setItalic(false);
        font1.setWeight(3);
        label_6->setFont(font1);
        label_6->setStyleSheet(QString::fromUtf8("font: 25 20pt \"URW Gothic L\";"));

        formLayout_2->setWidget(0, QFormLayout::LabelRole, label_6);

        labelWalletStatus = new QLabel(frame);
        labelWalletStatus->setObjectName(QString::fromUtf8("labelWalletStatus"));
        QFont font2;
        font2.setFamily(QString::fromUtf8("URW Gothic L"));
        font2.setPointSize(12);
        font2.setBold(false);
        font2.setItalic(false);
        font2.setWeight(50);
        labelWalletStatus->setFont(font2);
        labelWalletStatus->setStyleSheet(QString::fromUtf8("QLabel { color: red; }"));

        formLayout_2->setWidget(0, QFormLayout::FieldRole, labelWalletStatus);

        verticalLayout_4->addLayout(formLayout_2);

        verticalLayout_2->addWidget(frame);

        horizontalLayout->addLayout(verticalLayout_2);

        verticalLayout_3 = new QVBoxLayout();
        verticalLayout_3->setObjectName(QString::fromUtf8("verticalLayout_3"));
        frame_2 = new QFrame(OverviewPage);
        frame_2->setObjectName(QString::fromUtf8("frame_2"));
        frame_2->setStyleSheet(QString::fromUtf8("border-color: rgb(255, 255, 255);\n"
"font: 25 11pt \"URW Gothic L\";\n"
"border-top-color: rgb(255, 255, 255);\n"
"border-right-color: rgb(255, 255, 255);\n"
"border-left-color: rgb(255, 255, 255);"));
        frame_2->setFrameShape(QFrame::NoFrame);
        frame_2->setFrameShadow(QFrame::Raised);
        verticalLayout = new QVBoxLayout(frame_2);
        verticalLayout->setObjectName(QString::fromUtf8("verticalLayout"));
        horizontalLayout_2 = new QHBoxLayout();
        horizontalLayout_2->setObjectName(QString::fromUtf8("horizontalLayout_2"));
        label_4 = new QLabel(frame_2);
        label_4->setObjectName(QString::fromUtf8("label_4"));
        QFont font3;
        font3.setFamily(QString::fromUtf8("URW Gothic L"));
        font3.setPointSize(12);
        font3.setBold(false);
        font3.setItalic(false);
        font3.setWeight(3);
        label_4->setFont(font3);
        label_4->setStyleSheet(QString::fromUtf8("font: 25 12pt \"URW Gothic L\";"));

        horizontalLayout_2->addWidget(label_4);

        labelTransactionsStatus = new QLabel(frame_2);
        labelTransactionsStatus->setObjectName(QString::fromUtf8("labelTransactionsStatus"));
        QFont font4;
        font4.setFamily(QString::fromUtf8("URW Gothic L"));
        font4.setPointSize(11);
        font4.setBold(false);
        font4.setItalic(false);
        font4.setWeight(3);
        labelTransactionsStatus->setFont(font4);
        labelTransactionsStatus->setStyleSheet(QString::fromUtf8("QLabel { color: red; }\n"
"font: 12pt;"));
        labelTransactionsStatus->setText(QString::fromUtf8("out of sync!"));
        labelTransactionsStatus->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);

        horizontalLayout_2->addWidget(labelTransactionsStatus);

        verticalLayout->addLayout(horizontalLayout_2);

        listTransactions = new QListView(frame_2);
        listTransactions->setObjectName(QString::fromUtf8("listTransactions"));
        QSizePolicy sizePolicy(QSizePolicy::Expanding, QSizePolicy::MinimumExpanding);
        sizePolicy.setHorizontalStretch(0);
        sizePolicy.setVerticalStretch(0);
        sizePolicy.setHeightForWidth(listTransactions->sizePolicy().hasHeightForWidth());
        listTransactions->setSizePolicy(sizePolicy);
        listTransactions->setFont(font4);
        listTransactions->setStyleSheet(QString::fromUtf8("QListView { background: transparent; }"));
        listTransactions->setFrameShape(QFrame::NoFrame);
        listTransactions->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
        listTransactions->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
        listTransactions->setSelectionMode(QAbstractItemView::NoSelection);

        verticalLayout->addWidget(listTransactions);

        verticalLayout_3->addWidget(frame_2);

        horizontalLayout->addLayout(verticalLayout_3);

        horizontalLayout->setStretch(0, 1);
        horizontalLayout->setStretch(1, 1);

        retranslateUi(OverviewPage);

        QMetaObject::connectSlotsByName(OverviewPage);
    } // setupUi

    void retranslateUi(QWidget *OverviewPage)
    {
        OverviewPage->setWindowTitle(QApplication::translate("OverviewPage", "Form", 0, QApplication::UnicodeUTF8));
        label->setText(QApplication::translate("OverviewPage", "Balance:", 0, QApplication::UnicodeUTF8));
#ifndef QT_NO_TOOLTIP
        labelBalance->setToolTip(QApplication::translate("OverviewPage", "Your current balance", 0, QApplication::UnicodeUTF8));
#endif // QT_NO_TOOLTIP
        label_3->setText(QApplication::translate("OverviewPage", "Unconfirmed:", 0, QApplication::UnicodeUTF8));
#ifndef QT_NO_TOOLTIP
        labelUnconfirmed->setToolTip(QApplication::translate("OverviewPage", "Total of transactions that have yet to be confirmed, and do not yet count toward the current balance", 0, QApplication::UnicodeUTF8));
#endif // QT_NO_TOOLTIP
        label_2->setText(QApplication::translate("OverviewPage", "Number of transactions:", 0, QApplication::UnicodeUTF8));
#ifndef QT_NO_TOOLTIP
        labelNumTransactions->setToolTip(QApplication::translate("OverviewPage", "Total number of transactions in wallet", 0, QApplication::UnicodeUTF8));
#endif // QT_NO_TOOLTIP
        labelImmatureText->setText(QApplication::translate("OverviewPage", "Immature:", 0, QApplication::UnicodeUTF8));
#ifndef QT_NO_TOOLTIP
        labelImmature->setToolTip(QApplication::translate("OverviewPage", "Mined balance that has not yet matured", 0, QApplication::UnicodeUTF8));
#endif // QT_NO_TOOLTIP
        label_6->setText(QApplication::translate("OverviewPage", "Wallet", 0, QApplication::UnicodeUTF8));
        labelWalletStatus->setText(QApplication::translate("OverviewPage", "out of sync!", 0, QApplication::UnicodeUTF8));
        label_4->setText(QApplication::translate("OverviewPage", "Recent transactions", 0, QApplication::UnicodeUTF8));
#ifndef QT_NO_TOOLTIP
        labelTransactionsStatus->setToolTip(QApplication::translate("OverviewPage", "The displayed information may be out of date. Your wallet automatically synchronizes with the momentum-beta network after a connection is established, but this process has not completed yet.", 0, QApplication::UnicodeUTF8));
#endif // QT_NO_TOOLTIP
    } // retranslateUi

};

namespace Ui {
    class OverviewPage: public Ui_OverviewPage {};
} // namespace Ui

QT_END_NAMESPACE

#endif // UI_OVERVIEWPAGE_H


text:
package org.sakaiproject.attendance.tool.pages.panels;

import org.apache.wicket.AttributeModifier;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
import org.apache.wicket.ajax.markup.html.form.AjaxCheckBox;
import org.apache.wicket.ajax.markup.html.form.AjaxSubmitLink;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.form.CheckBox;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.markup.html.form.NumberTextField;
import org.apache.wicket.markup.html.form.TextField;
import org.apache.wicket.markup.html.panel.FeedbackPanel;
import org.apache.wicket.model.CompoundPropertyModel;
import org.apache.wicket.model.ResourceModel;
import org.sakaiproject.attendance.model.AttendanceSite;
import org.sakaiproject.attendance.tool.pages.panels.util.GradebookItemNameValidator;

/**
 * AttendanceGradeFormPanel is a Panel is used to get AttendanceSite settings for Grades.
 * Such as to send it to the Gradebook, show grades to students, and the maximum points allowed.
 * A non-null value for Maximum points turns on grading.
 *
 * @author Leonardo Canessa [lcanessa1 (at) udayton (dot) edu]
 * @author David Bauer [dbauer1 (at) udayton (dot) edu]
 */
public class AttendanceGradeFormPanel extends BasePanel {
    private static final    long            serialVersionUID = 1L;

    private                 FeedbackPanel   pageFeedbackPanel;
    private                 boolean         previousSendToGradebook;
    private                 String          previousName;
    private                 Double          previousMaxGrade;

    public AttendanceGradeFormPanel(String id, FeedbackPanel pg) {
        super(id);
        this.pageFeedbackPanel = pg;

        init();
    }

    private void init() {
        add(createSettingsForm());
    }

    private Form<AttendanceSite> createSettingsForm() {
        final AttendanceSite aS = attendanceLogic.getCurrentAttendanceSite();
        this.previousSendToGradebook = aS.getSendToGradebook() == null ? false : aS.getSendToGradebook();
        this.previousName = aS.getGradebookItemName();
        this.previousMaxGrade = aS.getMaximumGrade();

        Form<AttendanceSite> aSForm = new Form<AttendanceSite>("settings", new CompoundPropertyModel<AttendanceSite>(aS)) {
            @Override
            public void onSubmit() {
                AttendanceSite aS = (AttendanceSite) getDefaultModelObject();

                if(aS.getMaximumGrade() == null && previousMaxGrade != null) {
                    aS.setSendToGradebook(false);
                }

                boolean result = attendanceLogic.updateAttendanceSite(aS);

                if (result) {
                    if(aS.getSendToGradebook()){
                        if(previousSendToGradebook) { // if previously true, see if any relevant values have changed
                            if(!previousName.equals(aS.getGradebookItemName()) || !previousMaxGrade.equals(aS.getMaximumGrade())){
                                attendanceGradebookProvider.update(aS);
                            }

                            previousName = aS.getGradebookItemName();
                        } else {
                            attendanceGradebookProvider.create(aS);
                        }
                    } else {
                        if(previousSendToGradebook) {
                            attendanceGradebookProvider.remove(aS);
                        }
                    }

                    previousMaxGrade = aS.getMaximumGrade();
                    previousSendToGradebook = aS.getSendToGradebook();

                    getSession().info(getString("attendance.settings.grading.success"));
                } else {
                    getSession().error(getString("attendance.settings.grading.failure"));
                }

            }
        };

        final WebMarkupContainer grading = new WebMarkupContainer("grading") {
            @Override
            public boolean isVisible() {
                return !(aS.getMaximumGrade() == null);
            }
        };
        grading.setOutputMarkupPlaceholderTag(true);

        Label maxGradeLabel = new Label("maximum-grade-label", new ResourceModel("attendance.settings.grading.max.points.possible"));
        NumberTextField<Double> maximum = new NumberTextField<Double>("maximumGrade");
        maximum.setMinimum(0.1);
        maximum.setStep(0.1);
        maximum.add(new AjaxFormComponentUpdatingBehavior("onkeyup") {
            @Override
            protected void onUpdate(AjaxRequestTarget target) {
                target.add(grading);
            }
        });
        aSForm.add(maximum);
        aSForm.add(maxGradeLabel);

        Label isGradeShownLabel = new Label("is-grade-shown-label", new ResourceModel("attendance.settings.grading.is.grade.shown"));
        CheckBox isGradeShown = new CheckBox("isGradeShown");
        grading.add(isGradeShown);
        grading.add(isGradeShownLabel);

        final WebMarkupContainer gradebook = new WebMarkupContainer("gradebook") {
            @Override
            public boolean isVisible() {
                return aS.getSendToGradebook();
            }
        };
        gradebook.setOutputMarkupPlaceholderTag(true);
        Label gbItemName = new Label("gradebook-item-name", new ResourceModel("attendance.settings.grading.gradebook.item.name"));
        TextField<String> gradebookItemName = new TextField<String>("gradebookItemName");
        gradebookItemName.add(new GradebookItemNameValidator(aS, aS.getGradebookItemName()));
        gradebookItemName.setRequired(true);
        gradebook.add(gbItemName);
        gradebook.add(gradebookItemName);
        grading.add(gradebook);

        final boolean gradebookDefined = attendanceGradebookProvider.isGradebookDefined(aS.getSiteID());
        final AjaxCheckBox sendToGradebook = new AjaxCheckBox("sendToGradebook") {
            @Override
            protected void onUpdate(AjaxRequestTarget target) {
                target.add(gradebook);
            }

            @Override
            public boolean isVisible() {
                return gradebookDefined;

            }
        };
        Label sendToGBLabel = new Label("send-to-gradebook", new ResourceModel("attendance.settings.grading.send.to.gradebook")) {
            @Override
            public boolean isVisible() {
                return gradebookDefined;
            }
        };
        grading.add(sendToGradebook);
        grading.add(sendToGBLabel);
        aSForm.add(grading);

        AjaxSubmitLink submit = new AjaxSubmitLink("submit") {
            @Override
            protected void onError(AjaxRequestTarget target, Form<?> form) {
                target.add(pageFeedbackPanel);
            }

            @Override
            protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
                super.onSubmit(target, form);
                target.add(pageFeedbackPanel);
            }
        };
        submit.add(new AttributeModifier("value", new ResourceModel("attendance.settings.grading.save")));
        aSForm.add(submit);

        return aSForm;
    }
}


text:
package org.jfree.xml.util;

/**
 * A collection of tags used in the object model description.
 */
public final class ClassModelTags {

    /** Objects tag text. */
    public static final String OBJECTS_TAG = "objects";

    /** Include tag text. */
    public static final String INCLUDE_TAG = "include";

    /** Source attribute text. */
    public static final String SOURCE_ATTR = "src";

    /** Object tag text. */
    public static final String OBJECT_TAG = "object";

    /** Ignore attribute text. */
    public static final String IGNORE_ATTR = "ignore";

    /** Class attribute text. */
    public static final String CLASS_ATTR = "class";

    /** Register name attribute text. */
    public static final String REGISTER_NAMES_ATTR = "register-name";

    /** Element property tag text. */
    public static final String ELEMENT_PROPERTY_TAG = "element-property";

    /** Attribute property tag text. */
    public static final String ATTRIBUTE_PROPERTY_TAG = "attribute-property";

    /** Lookup property tag text. */
    public static final String LOOKUP_PROPERTY_TAG = "lookup";

    /** Name attribute tag text. */
    public static final String NAME_ATTR = "name";

    /** Element attribute text. */
    public static final String ELEMENT_ATTR = "element";

    /** Attribute text. */
    public static final String ATTRIBUTE_ATTR = "attribute";

    /** Lookup attribute text. */
    public static final String LOOKUP_ATTR = "lookup";

    /** Constructor tag text. */
    public static final String CONSTRUCTOR_TAG = "constructor";

    /** Parameter tag text. */
    public static final String PARAMETER_TAG = "parameter";

    /** Property attribute text. */
    public static final String PROPERTY_ATTR = "property";

    /** Attribute handler text. */
    public static final String ATTRIBUTE_HANDLER_ATTR = "handler";

    /** Ignored property tag text. */
    public static final String IGNORED_PROPERTY_TAG = "ignore";

    /** Manual tag text. */
    public static final String MANUAL_TAG = "manual";

    /** Read handler attribute text. */
    public static final String READ_HANDLER_ATTR = "read-handler";

    /** Write handler attribute text. */
    public static final String WRITE_HANDLER_ATTR = "write-handler";

    /** Mapping tag text. */
    public static final String MAPPING_TAG = "mapping";

    /** Type attribute text. */
    public static final String TYPE_ATTR = "type-attribute";

    /** Base class attribute text. */
    public static final String BASE_CLASS_ATTR = "base-class";

    /** Type tag text. */
    public static final String TYPE_TAG = "type";

    /**
     * Private constructor prevents instantiation.
     */
    private ClassModelTags() {
        super();
    }

}


text:
using Loquat.MessageBus.Messages;

namespace Loquat.MessageBus.Nodes
{
    public interface IMessengerInputNode<in TMessage> : IMessengerNode
        where TMessage : class, IMessage
    {
        void PushMessage(TMessage message);

        void PushMessages(IMessageCollection<TMessage> messages);
    }
}


text:
HC=/etc/hadoop/conf.my_cluster
HBC=/etc/hbase/conf.dist
for node in `cat slaves`
do
  cd $HC
  scp core-site.xml hdfs-site.xml root@$node:$HC
  scp mapred-site_slave.xml root@$node:$HC/mapred-site.xml
  cd $HBC
  scp hbase-site.xml root@$node:$HBC
done


text:
using webkit_blob::ShareableFileReference;

namespace content {

namespace {

const char kTestData[] = "0123456789";
const int kTestDataSize = arraysize(kTestData) - 1;

class WaitForFileStream {
 public:
  base::File::Error error() const { return error_; }
  net::FileStream* file_stream() const { return file_stream_.get(); }
  ShareableFileReference* deletable_file() const {
    return deletable_file_.get();
  }

  void OnFileStreamCreated(base::File::Error error,
                           scoped_ptr<net::FileStream> file_stream,
                           ShareableFileReference* deletable_file) {
    error_ = error;
    file_stream_ = file_stream.Pass();
    deletable_file_ = deletable_file;
    loop_.Quit();
  }

  void Wait() {
    loop_.Run();
  }

  void Release() {
    file_stream_.reset(NULL);
    deletable_file_ = NULL;
  }
 private:
  base::RunLoop loop_;
  base::File::Error error_;
  scoped_ptr<net::FileStream> file_stream_;
  scoped_refptr<ShareableFileReference> deletable_file_;
};

}  // namespace

TEST(TemporaryFileStreamTest, Basic) {
  TestBrowserThreadBundle thread_bundle(TestBrowserThreadBundle::IO_MAINLOOP);

  // Create a temporary.
  WaitForFileStream file_stream_waiter;
  CreateTemporaryFileStream(base::Bind(&WaitForFileStream::OnFileStreamCreated,
                                       base::Unretained(&file_stream_waiter)));
  file_stream_waiter.Wait();

  // The temporary should exist.
  EXPECT_EQ(base::File::FILE_OK, file_stream_waiter.error());
  base::FilePath file_path = file_stream_waiter.deletable_file()->path();
  EXPECT_TRUE(base::PathExists(file_path));

  // Write some data to the temporary.
  int bytes_written = 0;
  scoped_refptr<net::IOBufferWithSize> buf =
      new net::IOBufferWithSize(kTestDataSize);
  memcpy(buf->data(), kTestData, kTestDataSize);
  scoped_refptr<net::DrainableIOBuffer> drainable =
      new net::DrainableIOBuffer(buf.get(), buf->size());
  while (bytes_written != kTestDataSize) {
    net::TestCompletionCallback write_callback;
    int rv = file_stream_waiter.file_stream()->Write(
        drainable.get(), drainable->BytesRemaining(),
        write_callback.callback());
    if (rv == net::ERR_IO_PENDING)
      rv = write_callback.WaitForResult();
    ASSERT_LT(0, rv);
    drainable->DidConsume(rv);
    bytes_written += rv;
  }

  // Verify the data matches.
  std::string contents;
  ASSERT_TRUE(base::ReadFileToString(file_path, &contents));
  EXPECT_EQ(kTestData, contents);

  // Close the file.
  net::TestCompletionCallback close_callback;
  int rv = file_stream_waiter.file_stream()->Close(close_callback.callback());
  if (rv == net::ERR_IO_PENDING)
    rv = close_callback.WaitForResult();
  EXPECT_EQ(net::OK, rv);

  // Release everything. The file should be gone now.
  file_stream_waiter.Release();
  base::MessageLoop::current()->RunUntilIdle();

  // The temporary should be gone now.
  EXPECT_FALSE(base::PathExists(file_path));
}

}  // content


text:
class CreateDummies < ActiveRecord::Migration
  def self.up
    if RAILS_ENV == 'test'
      create_table :dummies do |t|
        t.string :name
        t.text :description
        t.integer :age
        t.datetime :date

        t.timestamps
      end
    end
  end

  def self.down
    if RAILS_ENV == 'test'
      drop_table :dummies
    end
  end
end