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

<title>Configuration</title>
<meta name="date" content="2015-11-19">
<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Tree

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

main

Class Configuration

java.lang.Object

main.Configuration

public class Configuration
extends java.lang.Object

This class provides configuration options: paths to the project directory and
 configuration files, paths to images, and other configuration parameter.

Field Summary

Fields

Modifier and Type
Field and Description

static javax.swing.Icon
ADD_ICON

Image icon, for add buttons

private static java.util.List<AbstractAlgorithm>
algorithms

static javax.swing.Icon
DELETE_ICON

Image icon for delete buttons

static java.lang.String
LIBRARY_DIRECTORY

Directory in which external libraries are stored

static java.lang.String
OUTPUT_DIRECTORY

The result files of encapsulation processes will be stored here

static java.lang.String
RESTORED_DIRECTORY

If encapsulated files are restored, they will be stored here

static javax.swing.Icon
SAVE_ICON

Image icon for save buttons

static java.lang.String
SCENARIO_DIRECTORY

Directory where the scenarios or roles are stored

static javax.swing.Icon
START_ICON

Image icon for buttons that start a process

static java.lang.String
TEST_DIRECTORY

Directory for test data.

static java.lang.String
TOOL_DESCRIPTION

General short description text to be encapsulated

static java.lang.String
VERSION

Version number of the tool

static java.lang.String
WORKING_DIRECTORY

The directory where the projects directory will be created.

Constructor Summary

Constructors

Modifier
Constructor and Description

private
Configuration()

Method Summary

Methods

Modifier and Type
Method and Description

static void
createEncapsulationConstants()

Configures the constants of the projects directories.

static void
createProjectDirectories()

Creates the project directories.

static java.util.List<AbstractAlgorithm>
getAlgorithms()

Get the list of available algorithms

 Add here further algorithms, and comment out the "not yet finished"
 algorithms.

private static java.io.File
getCurrentJarFolder()

Gets the location of the .jar, to figure out where to create the project
 directory.

static java.awt.Image
getImage(java.lang.String path)

Load an image icon to be displayed on a button.

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

ADD_ICON

public static final javax.swing.Icon ADD_ICON

Image icon, for add buttons

algorithms

private static java.util.List<AbstractAlgorithm> algorithms

DELETE_ICON

public static final javax.swing.Icon DELETE_ICON

Image icon for delete buttons

LIBRARY_DIRECTORY

public static java.lang.String LIBRARY_DIRECTORY

Directory in which external libraries are stored

OUTPUT_DIRECTORY

public static java.lang.String OUTPUT_DIRECTORY

The result files of encapsulation processes will be stored here

RESTORED_DIRECTORY

public static java.lang.String RESTORED_DIRECTORY

If encapsulated files are restored, they will be stored here

SAVE_ICON

public static final javax.swing.Icon SAVE_ICON

Image icon for save buttons

SCENARIO_DIRECTORY

public static java.lang.String SCENARIO_DIRECTORY

Directory where the scenarios or roles are stored

START_ICON

public static final javax.swing.Icon START_ICON

Image icon for buttons that start a process

TEST_DIRECTORY

public static final java.lang.String TEST_DIRECTORY

Directory for test data. This is for the unit tests.

TOOL_DESCRIPTION

public static final java.lang.String TOOL_DESCRIPTION

General short description text to be encapsulated

See Also:

Constant Field Values

VERSION

public static final java.lang.String VERSION

Version number of the tool

See Also:

Constant Field Values

WORKING_DIRECTORY

public static java.lang.String WORKING_DIRECTORY

The directory where the projects directory will be created.

Constructor Detail

Configuration

private Configuration()

Method Detail

createEncapsulationConstants

public static void createEncapsulationConstants()

Configures the constants of the projects directories.

createProjectDirectories

public static void createProjectDirectories()

Creates the project directories. To be called on tool start.

getAlgorithms

public static java.util.List<AbstractAlgorithm> getAlgorithms()

Get the list of available algorithms

 Add here further algorithms, and comment out the "not yet finished"
 algorithms.

Returns:

algorithms for information encapsulation

getCurrentJarFolder

private static java.io.File getCurrentJarFolder()

Gets the location of the .jar, to figure out where to create the project
 directory.

Returns:

File with path to jar directory

getImage

public static java.awt.Image getImage(java.lang.String path)

Load an image icon to be displayed on a button.

Parameters:

path -

Returns:

image for a button

Overview

Package

Class

Tree

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text:
require 'spec_helper'

module ClosureTreeHelper
  describe TreeListHelper do
    describe '#close_tag' do
      it { expect(helper.send(:close_tag, nil)).to eq(nil) }
      it { expect(helper.send(:close_tag, '')).to eq(nil) }
      it { expect(helper.send(:close_tag, '
')).to eq('
') }
      it { expect(helper.send(:close_tag, '
')).to eq('
') }
    end
  end
end

redpajama_set_name: RedPajamaGithub


text:
"""
Created on Tue Feb 11 09:09:06 2014
Build a report page to monitor different MONK services
@author: xm
"""
from monk.roles.configuration import get_config
import monk.core.api as monkapi
import logging
from monk.network.broker import KafkaBroker
from monk.network.server import taskT, Task, MonkServer
import sys
import time
from collections import deque
from tornado.web import RequestHandler
from bokeh.resources import INLINE
from bokeh.plotting import figure, file_html, decode_utf8
import numpy as np

logger = logging.getLogger('monk.roles.monitor')

DEFAULT_MONITOR_USER='_monitor_'

class MonitorBroker(KafkaBroker):
    def track(self, name, value, user=DEFAULT_MONITOR_USER):
        self.produce('Track', name, user=user, value=value, time=time.time())

    def aggregate(self, name, value, user=DEFAULT_MONITOR_USER):
        self.produce('Aggregate', name, user=user, value=value)

    def measure(self, name, value, label=1, user=DEFAULT_MONITOR_USER):
        self.produce('Measure', name, user=user, value=value, label=label)

    def reset_tracker(self, name):
        self.produce('ResetTracker', name)

    def reset_aggregator(self, name):
        self.produce('ResetAggregator', name)

    def reset_measurer(self, name):
        self.produce('ResetMeasurer', name)

    def rename_tracker(self, name, newname):
        self.produce('RenameTracker', name, newname=newname)

    def rename_aggregator(self, name, newname):
        self.produce('RenameAggregator', name, newname=newname)

    def rename_measurer(self, name, newname):
        self.produce('RenameMeasurer', name, newname=newname)

    def annotate_tracker(self, name, annotator):
        self.produce('AnnotateTracker', name, annotator=annotator, time=time.time())

class MonkMonitor(MonkServer):
    def init_brokers(self, config):
        self.trackers = {}
        self.aggregators = {}
        self.measurers = {}
        monkapi.initialize(config)
        self.MAINTAIN_INTERVAL = config.monitorMaintainInterval
        self.POLL_INTERVAL = config.monitorPollInterval
        self.EXECUTE_INTERVAL = config.monitorExecuteInterval
        self.MAX_QUEUE_SIZE = config.monitorMaxQueueSize
        self.monitorBroker = MonitorBroker(config.kafkaConnectionString,
                                           config.monitorGroup,
                                           config.monitorTopic,
                                           KafkaBroker.SIMPLE_CONSUMER)
        return [self.monitorBroker]

monitor = MonkMonitor()

class Tracker(object):
    def __init__(self, retireTime=7200, resolution=1):
        self.valuesTimed = dict()
        self.numTimed = dict()
        self.annotatorTimed = dict()
        self.queue = deque()
        self.resolution = resolution
        self.retiredTime = int(retireTime / resolution)

    def add(self, t, value, user):
        t = int(t / self.resolution)
        firstTime = self.queue[0]
        if t - firstTime > self.retiredTime:
            if firstTime in self.valuesTimed:
                del self.valuesTimed[firstTime]
                del self.numTimed[firstTime]
                del self.annotatorTimed[firstTime]
            self.queue.popleft()
        self.queue.append(t)
        if t in self.valuesTimed:
            if user in self.valuesTimed:
                self.valuesTimed[t][user] += value
                self.numTimed[t][user] += 1.0
            else:
                self.valuesTimed[t][user] = value
                self.numTimed[t][user] = 1.0
        else:
            self.valuesTimed[t] = {user:value}
            self.numTimed[t] = {user:1.0}

    def annotate(self, t, annotator):
        t = int(t / self.resolution)
        if t in self.annotatorTimed:
            logger.warning('another annotator {} already at time {}'.format(\
                self.annotatorTimed[t], t * self.resolution))
        else:
            self.annotatorTimed[t] = annotator

    def clear(self):
        self.queue.clear()
        self.valuesTimed.clear()
        self.numTimed.clear()

class Track(Task):
    def act(self):
        key = self.name
        if not key:
            self.warning(logger, 'no valid tracking name set')
            return
        try:
            value = float(self.get('value'))
        except:
            self.warning(logger, 'no valid value set')
            return
        try:
            t = float(self.get('time'))
        except:
            self.warning(logger, 'no valid time set')
            return
        user = self.get('user')
        if key not in monitor.trackers:
            monitor.trackers[key] = Tracker()
        tracker = monitor.trackers[key]
        tracker.add(t, value, user)
taskT(Track)

class ResetTracker(Task):
    def act(self):
        key = self.name
        if not key:
            self.warning(logger, 'no valid tracking name set')
            return
        if key in monitor.trackers:
            monitor.trackers[key].clear()
taskT(ResetTracker)

class RenameTracker(Task):
    def act(self):
        key = self.name
        if not key:
            self.warning(logger, 'no valid tracking name set')
            return
        newname = self.get('newname')
        if key in monitor.trackers and newname:
            monitor.trackers[newname] = monitor.trackers[key]
            del monitor.trackers[key]
taskT(RenameTracker)

class AnnotateTracker(Task):
    def act(self):
        key = self.name
        if not key:
            self.warning(logger, 'no valid tracking name set')
            return
        annotator = self.get('annotator')
        try:
            t = float(self.get('time'))
        except:
            self.warning(logger, 'no valid time set')
            return
        if annotator and key in monitor.trackers:
            tracker = monitor.trackers[key]
            tracker.annotate(t, annotator)
taskT(AnnotateTracker)

class Aggregator(object):
    def __init__(self, resolution=0.01):
        self.resolution = resolution
        self.hist = dict()
        self.num = dict()

    def clear(self):
        self.hist.clear()
        self.num.clear()

    def add(self, value, user):
        vL = int(value / self.resolution)
        vH = vL + 1
        wL = value / self.resolution - vL
        wH = 1.0 - wL
        if user in self.hist:
            hist = self.hist[user]
            if vL in hist:
                hist[vL] += wL
            else:
                hist[vL] = wL
            if vH in hist:
                hist[vH] += wH
            else:
                hist[vH] = wH
            self.num[user] += 1.0
        else:
            self.hist[user] = {vL:wL, vH:wH}
            self.num[user] = 1.0

class Aggregate(Task):
    def act(self):
        key = self.name
        if not key:
            self.warning(logger, 'no valid aggregator name set')
            return
        try:
            value = float(self.get('value'))
        except:
            self.warning(logger, 'no valid value set')
            return
        user = self.get('user')
        if key not in monitor.aggregators:
            monitor.aggregators[key] = Aggregator()
        aggregator = monitor.aggregators[key]
        aggregator.add(value, user)
taskT(Aggregate)

class ResetAggregator(Task):
    def act(self):
        key = self.name
        if not key:
            self.warning(logger, 'no valid aggregator name set')
            return
        if key in monitor.aggregators:
            monitor.aggregators[key].clear()
taskT(ResetAggregator)

class RenameAggregator(Task):
    def act(self):
        key = self.name
        if not key:
            self.warning(logger, 'no valid aggregator name set')
            return
        newname = self.get('newname')
        if key in monitor.aggregators and newname:
            monitor.aggregators[newname] = monitor.aggregators[key]
            del monitor.aggregators[key]
taskT(RenameAggregator)

class Measurer(object):
    def __init__(self, resolution=0.01):
        self.resolution = resolution
        self.scores = dict()
        self.totalPos = dict()
        self.totalNeg = dict()
        self.PRCs = None
        self.ROCs = None
        self.invalid = True

    def clear(self):
        self.scores.clear()
        self.totalPos.clear()
        self.totalNeg.clear()
        self.PRCs = None
        self.ROCs = None
        self.invalid = True

    def add(self, value, user, label):
        if user not in self.scores:
           self.scores[user] = []
           self.totalNeg[user] = 0
           self.totalPos[user] = 0
        self.scores[user].append((value, label))
        if label > 0:
            self.totalPos[user] += 1
        else:
            self.totalNeg[user] += 1
        self.invalid = True

    def intervals(self):
        num = int(1.0 /self.resolution) + 1
        return np.linspace(0.0, 1.0, num)

    def compute_metrics(self):
        # the number of buckets for the curves
        num = int(1.0 /self.resolution) + 1
        logger.debug('num = {}'.format(num))
        self.PRCs = None
        self.ROCs = None
        PRCn = np.zeros(num, dtype=int)
        ROCn = np.zeros(num, dtype=int)
        for user in self.scores:
            if user is DEFAULT_MONITOR_USER:
                continue
            # initialize basic metrics
            tp = self.totalPos[user]
            tn = 0
            fp = self.totalNeg[user]
            fn = 0
            totalP = tp
            totalN = fp
            logger.debug('totalP={}, totalN={}'.format(totalP, totalN))
            # ignore incomplete user
            if totalP == 0 or totalN == 0:
                continue
            # sort the scores
            score = self.scores[user]
            logger.info('scores for {} : {}'.format(score, user))
            score.sort()
            logger.info('scores for {} : {}'.format(score, user))
            # initialize PRC and ROC
            PRC = np.zeros(num)
            ROC = np.zeros(num)
            PRCn.fill(0)
            ROCn.fill(0)
            # loop through scores
            for s, label in score:
                if label > 0: # positive example
                    fn += 1
                    tp -= 1
                else:   # negative example
                    tn += 1
                    fp -= 1
                recall = float(tp) / float(totalP)
                # precision value
                if tp + fp == 0:
                    precision = 1
                else:
                    precision = float(tp) / float(tp + fp)
                v = int(precision / self.resolution)
                PRC[v] += recall
                PRCn[v] += 1
                # false positive rate value
                fpr = float(fp) / float(totalN)
                v = int(fpr / self.resolution)
                ROC[v] += recall
                ROCn[v] += 1
            logger.info('PRC {}'.format(PRC))
            logger.info('PRCn {}'.format(PRCn))
            logger.info('ROC {}'.format(ROC))
            logger.info('ROCn {}'.format(ROCn))

            # averaging ROC and PRC since multiple recalls might fall into the same bucket
            # fill the missing buckets
            for v in reversed(range(num-1)):
                if PRCn[v] == 0:
                    # fill the missing values from high precision
                    # precision == 1 is assumed to exist all the time
                    PRC[v] = PRC[v+1]
                else:
                    # average over all recalls at this precision
                    PRC[v] /= PRCn[v]
            for v in range(2,num):
                if ROCn[v] == 0:
                    # fill the missing values from low fpr
                    # fpr == 0 is assumed to exist all the time
                    ROC[v] = ROC[v-1]
                else:
                    # average over all recalls at this fpr
                    ROC[v] /= ROCn[v]
            if self.ROCs is None:
                self.ROCs = ROC
            else:
                self.ROCs = np.vstack((self.ROCs, ROC))
            if self.PRCs is None:
                self.PRCs = PRC
            else:
                self.PRCs = np.vstack((self.PRCs, PRC))
        self.ROCs.sort(axis=0)
        self.PRCs.sort(axis=0)
        logger.info('ROCs {}'.format(self.ROCs))
        logger.info('PRCs {}'.format(self.PRCs))
        self.invalid = False

    def set_resolution(self, resolution):
        try:
            self.resolution = float(resolution)
            self.invalid = True
        except:
            logger.warning('resolution can not be converted to a float {}'.format(resolution))

    def get_ROCs(self):
        if self.invalid:
            self.compute_metrics()
        return self.ROCs

    def get_PRCs(self):
        if self.invalid:
            self.compute_metrics()
        return self.PRCs

class Measure(Task):
    def act(self):
        logger.info('measure {}'.format(self.decodedMessage))
        key = self.name
        if not key:
            self.warning(logger, 'no valid measurer name set')
            return
        try:
            value = float(self.get('value'))
        except:
            self.warning(logger, 'no valid value set')
            return
        try:
            pos = int(self.get('label'))
        except:
            self.warning(logger, 'no valid label')
            return
        user = self.get('user')
        if key not in monitor.measurers:
            monitor.measurers[key] = Measurer()
        measurer = monitor.measurers[key]
        measurer.add(value, user, pos)
taskT(Measure)

class ResetMeasurer(Task):
    def act(self):
        key = self.name
        if not key:
            self.warning(logger, 'no valid measurer name set')
            return
        if key in monitor.measurers:
            monitor.measurers[key].clear()
taskT(ResetMeasurer)

class RenameMeasurer(Task):
    def act(self):
        key = self.name
        if not key:
            self.warning(logger, 'no valid measurer name set')
            return
        newname = self.get('newname')
        if key in monitor.measurers and newname:
            monitor.measurers[newname] = monitor.measurers[key]
            del monitor.measurers[key]
taskT(RenameMeasurer)

# TODO: TrackerHandler
# TODO: AggregatorHandler

class AccuracyHandler(RequestHandler):
    def draw(self, p, accuracies, intervals, resolution, fillColor):
        if accuracies is not None:
            m = accuracies.shape[0]
            logger.debug('m = {}'.format(m))
            maxs   = accuracies[-1]
            mins   = accuracies[0]
            uppers = accuracies[-(1 + m/4)]
            lowers = accuracies[m/4]
            logger.debug('maxs = {}'.format(maxs))
            logger.debug('mins = {}'.format(mins))
            logger.debug('uppers = {}'.format(uppers))
            logger.debug('lowers = {}'.format(lowers))
            p.segment(intervals, maxs, intervals, mins, color='black', toolbar_location='left')
            p.rect(intervals, (uppers + lowers) / 2, resolution / 2, \
                   abs(uppers - lowers), fill_color=fillColor, line_color='black')

    def get(self):
        name = self.get_argument('name', None)
        fillColor = self.get_argument('fillColor', "#F2583E")
        resolution = self.get_argument('resolution', None)
        accType = self.get_argument('accType', 'ROC')
        logger.info('request {} {} {}'.format(name, fillColor, resolution))
        if name and name in monitor.measurers:
            measurer = monitor.measurers[name]
            logger.debug('set resolution {}'.format(resolution))
            measurer.set_resolution(resolution)
            if accType == 'ROC':
                accuracies = measurer.get_ROCs()
            elif accType == 'PRC':
                accuracies = measurer.get_PRCs()
            else:
                accuracies = None
            intervals = measurer.intervals()
            resolution = measurer.resolution
        else:
            accuracies = None
            intervals = None
            resolution = 0.01
        logger.debug('accuracies {}'.format(accuracies))
        logger.debug('intervals {}'.format(intervals))
        logger.debug('resolution {}'.format(resolution))
        TOOLS = 'pan,wheel_zoom,box_zoom,reset,save'
        p = figure(tools=TOOLS, plot_width=1000)
        self.draw(p, accuracies, intervals, resolution, fillColor)
        p.title = '{} for {}'.format(accType, name)
        p.grid.grid_line_alpha = 0.3
        response = file_html(p, INLINE, p.title)
        self.write(decode_utf8(response))
        self.set_header("Content-Type", "text/html")

def main():
    global monitor
    myname = 'monitor'
    config = get_config(sys.argv[1:], myname, 'monkmonitor.py')
    monitor = MonkMonitor(myname, config)
    monitor.add_application(r'/accuracy', AccuracyHandler)
    monitor.run()

if __name__=='__main__':
    main()


text:
    Azure AD B2C

Home

{{userInfo.displayName}}

            Logout


text:
Gistribute is a simple file distribution system based on GitHub's Gist service.

I decided to make Gistribute when I found myself sharing configuration files
and such with others by placing all of them into a Gist along with a little
Bash script that curled all of the files, via their raw URLs, to the right
location on the other's computer. This program removed the need to make that
script, and the need to update the raw URLs in that script whenever you make
a tweak to one of the files that you're sharing.

## Installation

    $ gem install gistribute

## How It Works

Gistribute looks at the filename that you enter on Gist to find all of the
data that it needs to download the file to the other user's computer. It
allows you to choose what Gistribute will call the file when it is installing
it, and where it will install the file.

## Usage

If, for example, you were sharing a .vimrc file, and you wanted Gistribute to
call it "Vim configuration" when it was installing it, you would name the file
`Vim configuration||~|.vimrc`. If the filename contains the sequence `||`,
anything before that will be considered the description of that file, and
anything after it the installation path. If there is no `||`, Gistribute will
use the name of the file (without the path to it) as the default description.

The file path separator is the pipe character because GitHub Gist doesn't
allow slashes in filenames- this quirk is the result of Gist actually saving
those files to a Git repository on their servers, and handling slashes in
file names can't possibly be very nice.

If the resulting Gist link was, for example, https://gist.github.com/123456,
the user would be able to run either of these commands to download the file
to `~/.vimrc`:

```Shell
$ gistribute 123456
$ gistribute https://gist.github.com/123456
```


text:
const views::KeyEvent& KeyEventFromKeyIdentifier(
    const std::string& key_identifier);

#endif  // CHROME_BROWSER_EXTENSIONS_KEY_IDENTIFIER_CONVERSION_VIEWS_H_


text:
//
//  YXDNetworkUploadObject.h
//  YXDExtensionDemo
//
//  Copyright © 2016年 YangXudong. All rights reserved.
//

#import <Foundation/Foundation.h>

/**
 *  上传文件对象
 *
 *  @param paramName    接口对应的文件参数名
 *  @param file         文件对象 仅支持 UIImage 或 NSData 类型
 *
 *  @param fileName     文件名称
 *  @param fileType     文件类型 默认 image/jpeg 其他类型则必须 示例:image/png 、text/plain 、application/zip
 *  @param imageQuality 图片压缩质量 范围(0.1 ~ 1) 默认 0.1
 */
@interface YXDNetworkUploadObject : NSObject

//required
@property (nonatomic, strong) NSString *paramName;
@property (nonatomic, strong) id file;

//optional
@property (nonatomic, strong) NSString *fileName;
@property (nonatomic, strong) NSString *fileType;
@property (nonatomic, assign) float imageQuality;

@end


text:
#include <aws/privatenetworks/model/NetworkSiteFilterKeys.h>
#include <aws/core/utils/HashingUtils.h>
#include <aws/core/Globals.h>
#include <aws/core/utils/EnumParseOverflowContainer.h>

using namespace Aws::Utils;

namespace Aws
{
  namespace PrivateNetworks
  {
    namespace Model
    {
      namespace NetworkSiteFilterKeysMapper
      {

        static const int STATUS_HASH = HashingUtils::HashString("STATUS");

        NetworkSiteFilterKeys GetNetworkSiteFilterKeysForName(const Aws::String& name)
        {
          int hashCode = HashingUtils::HashString(name.c_str());
          if (hashCode == STATUS_HASH)
          {
            return NetworkSiteFilterKeys::STATUS;
          }
          EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
          if(overflowContainer)
          {
            overflowContainer->StoreOverflow(hashCode, name);
            return static_cast<NetworkSiteFilterKeys>(hashCode);
          }

          return NetworkSiteFilterKeys::NOT_SET;
        }

        Aws::String GetNameForNetworkSiteFilterKeys(NetworkSiteFilterKeys enumValue)
        {
          switch(enumValue)
          {
          case NetworkSiteFilterKeys::STATUS:
            return "STATUS";
          default:
            EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
            if(overflowContainer)
            {
              return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
            }

            return {};
          }
        }

      } // namespace NetworkSiteFilterKeysMapper
    } // namespace Model
  } // namespace PrivateNetworks
} // namespace Aws


text:
#include "psft.h"
#include <freetype/internal/ftdebug.h>

#include "psglue.h"
#include "psarrst.h"

#include "pserror.h"

  /*
   * CF2_ArrStack uses an error pointer, to enable shared errors.
   * Shared errors are necessary when multiple objects allow the program
   * to continue after detecting errors.  Only the first error should be
   * recorded.
   */

  FT_LOCAL_DEF( void )
  cf2_arrstack_init( CF2_ArrStack  arrstack,
                     FT_Memory     memory,
                     FT_Error*     error,
                     size_t        sizeItem )
  {
    FT_ASSERT( arrstack );

    /* initialize the structure */
    arrstack->memory    = memory;
    arrstack->error     = error;
    arrstack->sizeItem  = sizeItem;
    arrstack->allocated = 0;
    arrstack->count     = 0;
    arrstack->totalSize = 0;
    arrstack->ptr       = NULL;
  }

  FT_LOCAL_DEF( void )
  cf2_arrstack_finalize( CF2_ArrStack  arrstack )
  {
    FT_Memory  memory = arrstack->memory;     /* for FT_FREE */

    FT_ASSERT( arrstack );

    arrstack->allocated = 0;
    arrstack->count     = 0;
    arrstack->totalSize = 0;

    /* free the data buffer */
    FT_FREE( arrstack->ptr );
  }

  /* allocate or reallocate the buffer size; */
  /* return false on memory error */
  static FT_Bool
  cf2_arrstack_setNumElements( CF2_ArrStack  arrstack,
                               size_t        numElements )
  {
    FT_ASSERT( arrstack );

    {
      FT_Error   error  = FT_Err_Ok;        /* for FT_REALLOC */
      FT_Memory  memory = arrstack->memory; /* for FT_REALLOC */

      size_t  newSize = numElements * arrstack->sizeItem;

      if ( numElements > FT_LONG_MAX / arrstack->sizeItem )
        goto exit;

      FT_ASSERT( newSize > 0 );   /* avoid realloc with zero size */

      if ( !FT_QREALLOC( arrstack->ptr, arrstack->totalSize, newSize ) )
      {
        arrstack->allocated = numElements;
        arrstack->totalSize = newSize;

        if ( arrstack->count > numElements )
        {
          /* we truncated the list! */
          CF2_SET_ERROR( arrstack->error, Stack_Overflow );
          arrstack->count = numElements;
          return FALSE;
        }

        return TRUE;     /* success */
      }
    }

  exit:
    /* if there's not already an error, store this one */
    CF2_SET_ERROR( arrstack->error, Out_Of_Memory );

    return FALSE;
  }

  /* set the count, ensuring allocation is sufficient */
  FT_LOCAL_DEF( void )
  cf2_arrstack_setCount( CF2_ArrStack  arrstack,
                         size_t        numElements )
  {
    FT_ASSERT( arrstack );

    if ( numElements > arrstack->allocated )
    {
      /* expand the allocation first */
      if ( !cf2_arrstack_setNumElements( arrstack, numElements ) )
        return;
    }

    arrstack->count = numElements;
  }

  /* clear the count */
  FT_LOCAL_DEF( void )
  cf2_arrstack_clear( CF2_ArrStack  arrstack )
  {
    FT_ASSERT( arrstack );

    arrstack->count = 0;
  }

  /* current number of items */
  FT_LOCAL_DEF( size_t )
  cf2_arrstack_size( const CF2_ArrStack  arrstack )
  {
    FT_ASSERT( arrstack );

    return arrstack->count;
  }

  FT_LOCAL_DEF( void* )
  cf2_arrstack_getBuffer( const CF2_ArrStack  arrstack )
  {
    FT_ASSERT( arrstack );

    return arrstack->ptr;
  }

  /* return pointer to the given element */
  FT_LOCAL_DEF( void* )
  cf2_arrstack_getPointer( const CF2_ArrStack  arrstack,
                           size_t              idx )
  {
    void*  newPtr;

    FT_ASSERT( arrstack );

    if ( idx >= arrstack->count )
    {
      /* overflow */
      CF2_SET_ERROR( arrstack->error, Stack_Overflow );
      idx = 0;    /* choose safe default */
    }

    newPtr = (FT_Byte*)arrstack->ptr + idx * arrstack->sizeItem;

    return newPtr;
  }

  /* push (append) an element at the end of the list;         */
  /* return false on memory error                             */
  /* TODO: should there be a length param for extra checking? */
  FT_LOCAL_DEF( void )
  cf2_arrstack_push( CF2_ArrStack  arrstack,
                     const void*   ptr )
  {
    FT_ASSERT( arrstack );

    if ( arrstack->count == arrstack->allocated )
    {
      /* increase the buffer size */
      if ( !cf2_arrstack_setNumElements(
             arrstack, arrstack->allocated * 2 + 16 ) )
      {
        /* on error, ignore the push */
        return;
      }
    }

    FT_ASSERT( ptr );

    {
      size_t  offset = arrstack->count * arrstack->sizeItem;
      void*   newPtr = (FT_Byte*)arrstack->ptr + offset;

      FT_MEM_COPY( newPtr, ptr, arrstack->sizeItem );
      arrstack->count += 1;
    }
  }

/* END */


text:
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
                                                 xmlns:app="http://schemas.android.com/apk/res-auto"
              android:layout_width="match_parent"
              android:layout_height="match_parent">

        <android.support.v7.widget.RecyclerView
            android:id="@+id/rclview_home_page_container"
            android:layout_width="match_parent"
            android:layout_height="match_parent"/>

        <LinearLayout android:layout_width="match_parent"
                      android:layout_height="wrap_content"
                      android:paddingTop="10dp"
                      android:paddingBottom="10dp"
                      android:gravity="center"
                      android:orientation="horizontal"
                      app:layout_behavior="com.brightdairy.personal.brightdairy.view.Behavior.HomeTopSearchBg">

                <TextView
                    android:id="@+id/txtview_home_show_or_select_city"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="14dp"
                    android:text="上海"
                    android:textSize="15dp"
                    android:drawableRight="@mipmap/nav_addressarrow"
                    android:drawablePadding="5dp"
                    />

                <LinearLayout
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:gravity="center_vertical"
                    android:orientation="horizontal"
                    android:layout_marginLeft="6dp"
                    android:background="@drawable/shape_general_search_bg"
                    >

                        <EditText
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_weight="1"
                            android:hint="请输入搜索关键字"
                            android:singleLine="true"
                            android:textSize="@dimen/txt_hint"
                            android:background="@null"
                            android:drawableLeft="@mipmap/nav_search"
                            android:drawablePadding="5dp"
                            />

                        <ImageButton
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:scaleType="centerCrop"
                            android:src="@mipmap/nav_code"
                            android:background="@android:color/transparent"
                            />

                </LinearLayout>

                <com.brightdairy.personal.brightdairy.view.badgeview.BadgeRadioButton
                    android:id="@+id/search_shopping_cart"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="4dp"
                    android:layout_marginRight="7dp"
                    android:button="@null"
                    android:textColor="@android:color/white"
                    android:textSize="10sp"
                    android:text="购物车"
                    android:drawablePadding="3dp"
                    android:drawableTop="@mipmap/nav_cart"/>

        </LinearLayout>

</android.support.design.widget.CoordinatorLayout>


text:
\hypertarget{classcom_1_1lasarobotics_1_1library_1_1drive_1_1_tank}{}\section{com.\+lasarobotics.\+library.\+drive.\+Tank Class Reference}
\label{classcom_1_1lasarobotics_1_1library_1_1drive_1_1_tank}\index{com.\+lasarobotics.\+library.\+drive.\+Tank@{com.\+lasarobotics.\+library.\+drive.\+Tank}}
\subsection*{Static Public Member Functions}
\begin{DoxyCompactItemize}
\item
static void \hyperlink{classcom_1_1lasarobotics_1_1library_1_1drive_1_1_tank_ad00f8c122db08fdf3399e10a50dabede}{Motor2} (Dc\+Motor left, Dc\+Motor right, double left\+Value, double right\+Value)
\item
static void \hyperlink{classcom_1_1lasarobotics_1_1library_1_1drive_1_1_tank_a49450548769799647ee538ea4e8a7d01}{Motor4} (Dc\+Motor left\+Front, Dc\+Motor right\+Front, Dc\+Motor left\+Back, Dc\+Motor right\+Back, double left\+Value, double right\+Value)
\end{DoxyCompactItemize}

\subsection{Detailed Description}
Methods for the \hyperlink{classcom_1_1lasarobotics_1_1library_1_1drive_1_1_tank}{Tank} drive train.

\subsection{Member Function Documentation}
\hypertarget{classcom_1_1lasarobotics_1_1library_1_1drive_1_1_tank_ad00f8c122db08fdf3399e10a50dabede}{}\index{com\+::lasarobotics\+::library\+::drive\+::\+Tank@{com\+::lasarobotics\+::library\+::drive\+::\+Tank}!Motor2@{Motor2}}
\index{Motor2@{Motor2}!com\+::lasarobotics\+::library\+::drive\+::\+Tank@{com\+::lasarobotics\+::library\+::drive\+::\+Tank}}
\subsubsection[{Motor2(\+Dc\+Motor left, Dc\+Motor right, double left\+Value, double right\+Value)}]{\setlength{\rightskip}{0pt plus 5cm}static void com.\+lasarobotics.\+library.\+drive.\+Tank.\+Motor2 (
\begin{DoxyParamCaption}
\item[{Dc\+Motor}]{left, }
\item[{Dc\+Motor}]{right, }
\item[{double}]{left\+Value, }
\item[{double}]{right\+Value}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [static]}}\label{classcom_1_1lasarobotics_1_1library_1_1drive_1_1_tank_ad00f8c122db08fdf3399e10a50dabede}
Implements the \hyperlink{classcom_1_1lasarobotics_1_1library_1_1drive_1_1_tank}{Tank} drive train with two motors
\begin{DoxyParams}{Parameters}
{\em left} & Left motor \\
\hline
{\em right} & Right motor \\
\hline
{\em left\+Value} & Left motor target value \\
\hline
{\em right\+Value} & Right motor target value \\
\hline
\end{DoxyParams}
\hypertarget{classcom_1_1lasarobotics_1_1library_1_1drive_1_1_tank_a49450548769799647ee538ea4e8a7d01}{}\index{com\+::lasarobotics\+::library\+::drive\+::\+Tank@{com\+::lasarobotics\+::library\+::drive\+::\+Tank}!Motor4@{Motor4}}
\index{Motor4@{Motor4}!com\+::lasarobotics\+::library\+::drive\+::\+Tank@{com\+::lasarobotics\+::library\+::drive\+::\+Tank}}
\subsubsection[{Motor4(\+Dc\+Motor left\+Front, Dc\+Motor right\+Front, Dc\+Motor left\+Back, Dc\+Motor right\+Back, double left\+Value, double right\+Value)}]{\setlength{\rightskip}{0pt plus 5cm}static void com.\+lasarobotics.\+library.\+drive.\+Tank.\+Motor4 (
\begin{DoxyParamCaption}
\item[{Dc\+Motor}]{left\+Front, }
\item[{Dc\+Motor}]{right\+Front, }
\item[{Dc\+Motor}]{left\+Back, }
\item[{Dc\+Motor}]{right\+Back, }
\item[{double}]{left\+Value, }
\item[{double}]{right\+Value}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [static]}}\label{classcom_1_1lasarobotics_1_1library_1_1drive_1_1_tank_a49450548769799647ee538ea4e8a7d01}
Implements the \hyperlink{classcom_1_1lasarobotics_1_1library_1_1drive_1_1_tank}{Tank} drive train with four motors
\begin{DoxyParams}{Parameters}
{\em left\+Front} & The motor on the front left \\
\hline
{\em right\+Front} & The motor on the front right \\
\hline
{\em left\+Back} & The motor on the back left \\
\hline
{\em right\+Back} & The motor on the back right \\
\hline
{\em left\+Value} & Left motors target value \\
\hline
{\em right\+Value} & Right motors target value \\
\hline
\end{DoxyParams}

The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize}
\item
ftc-\/library/src/main/java/com/lasarobotics/library/drive/Tank.\+java\end{DoxyCompactItemize}


text:
/**
 * @author duant
 */

(function(){
	function _$(){
		//alert(typeof id);
		 this.elements = [];
		for (var i = 0, len = arguments.length; i < len; ++i) {
			var element = arguments[i];
			if (element instanceof  String) {
				alert("string");
				element = document.getElementById(element);
			}
			this.elements.push(element);
		}
		//return elements;
		//return document.getElementById(id);
	}

	_$.prototype={
		each:function(fn){
			for(var i=0,len=this.elements.length;i<len;++i){
				fn.call(this,this.elements[i]);
			}
			return this;
		},

		setStyle:function(prop,val){
			this.each(function(el){
				el.style[prop]=val;
			});
			return this;
		},

		show:function(){
			var that=this;
			this.each(function(el){
			that.setStyle('display','block');
			});
			return this;
		}
		/*,

		addEvent:function(type,fn){
			var add=function(el){
				if(window.addEventListener){
					el.addEventListener(type,fn,false);
				}else if(window.attachEvent){
					el.attachEvent('on'+type,fn);
				}
			};
			this.each(function(el){
				add(el);
			});
			return this;
		}
		*/
	};

	window.$=function(){
		return new _$(arguments);
	};

})();

var Public=function(){

	var secret=3;
	this.privateSecret=function(){
	    return secret;
	};
};

/*
$(window).addEvent('load', function(){
		alert("data");
	});
	*/

function test(){
	/*
    var value=$('name').type;
	alert(value);
	*/
	var pub=new Public;
	alert("fdf"+pub.privateSecret());

}


text:
// Copyright 2018 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.

#include "ash/assistant/ui/main_stage/assistant_progress_indicator.h"

#include <algorithm>

#include "ash/assistant/ui/assistant_view_ids.h"
#include "ash/assistant/util/animation_util.h"
#include "ash/public/cpp/app_list/app_list_features.h"
#include "base/bind.h"
#include "base/time/time.h"
#include "ui/compositor/layer.h"
#include "ui/compositor/layer_animation_element.h"
#include "ui/compositor/layer_animator.h"
#include "ui/compositor/scoped_animation_duration_scale_mode.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/color_palette.h"
#include "ui/views/background.h"
#include "ui/views/layout/box_layout.h"

namespace ash {

namespace {

// Appearance.
constexpr int kDotCount = 3;
constexpr float kDotLargeSizeDip = 6.f;
constexpr float kDotSmallSizeDip = 4.f;
constexpr int kDotSpacingDip = 3;
constexpr int kPreferredHeightDip = 9;

// Animation.
constexpr float kTranslationDip = -(kDotLargeSizeDip - kDotSmallSizeDip) / 2.f;
constexpr float kScaleFactor = kDotLargeSizeDip / kDotSmallSizeDip;

// Helpers ---------------------------------------------------------------------

bool AreAnimationsEnabled() {
  return ui::ScopedAnimationDurationScaleMode::duration_multiplier() !=
         ui::ScopedAnimationDurationScaleMode::ZERO_DURATION;
}

// DotBackground ---------------------------------------------------------------

class DotBackground : public views::Background {
 public:
  DotBackground() = default;

  DotBackground(const DotBackground&) = delete;
  DotBackground& operator=(const DotBackground&) = delete;

  ~DotBackground() override = default;

  void Paint(gfx::Canvas* canvas, views::View* view) const override {
    cc::PaintFlags flags;
    flags.setAntiAlias(true);
    flags.setColor(gfx::kGoogleGrey300);

    const gfx::Rect& b = view->GetContentsBounds();
    const gfx::Point center = gfx::Point(b.width() / 2, b.height() / 2);
    const int radius = std::min(b.width() / 2, b.height() / 2);

    canvas->DrawCircle(center, radius, flags);
  }
};

}  // namespace

// AssistantProgressIndicator --------------------------------------------------

AssistantProgressIndicator::AssistantProgressIndicator() {
  SetID(AssistantViewID::kProgressIndicator);
  InitLayout();
}

AssistantProgressIndicator::~AssistantProgressIndicator() = default;

const char* AssistantProgressIndicator::GetClassName() const {
  return "AssistantProgressIndicator";
}

gfx::Size AssistantProgressIndicator::CalculatePreferredSize() const {
  const int preferred_width = views::View::CalculatePreferredSize().width();
  return gfx::Size(preferred_width, GetHeightForWidth(preferred_width));
}

int AssistantProgressIndicator::GetHeightForWidth(int width) const {
  return kPreferredHeightDip;
}

void AssistantProgressIndicator::AddedToWidget() {
  VisibilityChanged(/*starting_from=*/this, /*is_visible=*/GetVisible());
}

void AssistantProgressIndicator::RemovedFromWidget() {
  VisibilityChanged(/*starting_from=*/this, /*is_visible=*/false);
}

void AssistantProgressIndicator::OnLayerOpacityChanged(
    ui::PropertyChangeReason reason) {
  VisibilityChanged(/*starting_from=*/this,
                    /*is_visible=*/GetVisible());
}

void AssistantProgressIndicator::VisibilityChanged(views::View* starting_from,
                                                   bool is_visible) {
  // Stop the animation when the view is either not visible or is "visible" but
  // not actually visible to the user (because it is faded out).
  const bool is_drawn =
      IsDrawn() && !cc::MathUtil::IsWithinEpsilon(layer()->opacity(), 0.f);
  if (is_drawn_ == is_drawn)
    return;

  is_drawn_ = is_drawn;

  if (!is_drawn_) {
    // Stop all animations.
    for (auto* child : children())
      child->layer()->GetAnimator()->StopAnimating();
    return;
  }

  using assistant::util::CreateLayerAnimationSequence;
  using assistant::util::CreateTransformElement;

  // The animation performs scaling on the child views. In order to give the
  // illusion that scaling is being performed about the center of the view as
  // the transformation origin, we also need to perform a translation.
  gfx::Transform transform;
  transform.Translate(kTranslationDip, kTranslationDip);
  transform.Scale(kScaleFactor, kScaleFactor);

  // Don't animate if animations are disabled (during unittests).
  // Otherwise we get in an infinite loop due to the cyclic animation used here
  // repeating over and over without pause.
  if (!AreAnimationsEnabled())
    return;

  base::TimeDelta start_offset;
  for (auto* child : children()) {
    if (!start_offset.is_zero()) {
      // Schedule the animations to start after an offset.
      child->layer()->GetAnimator()->SchedulePauseForProperties(
          start_offset,
          ui::LayerAnimationElement::AnimatableProperty::TRANSFORM);
    }
    start_offset += base::Milliseconds(216);

    // Schedule transformation animation.
    child->layer()->GetAnimator()->ScheduleAnimation(
        CreateLayerAnimationSequence(
            // Animate scale up.
            CreateTransformElement(transform, base::Milliseconds(266)),
            // Animate scale down.
            CreateTransformElement(gfx::Transform(), base::Milliseconds(450)),
            // Pause before next iteration.
            ui::LayerAnimationElement::CreatePauseElement(
                ui::LayerAnimationElement::AnimatableProperty::TRANSFORM,
                base::Milliseconds(500)),
            // Animation parameters.
            {/*is_cyclic=*/true}));
  }
}

void AssistantProgressIndicator::InitLayout() {
  views::BoxLayout* layout_manager =
      SetLayoutManager(std::make_unique<views::BoxLayout>(
          views::BoxLayout::Orientation::kHorizontal, gfx::Insets(),
          kDotSpacingDip));

  layout_manager->set_cross_axis_alignment(
      views::BoxLayout::CrossAxisAlignment::kCenter);

  // Initialize dots.
  for (int i = 0; i < kDotCount; ++i) {
    auto dot_view = std::make_unique<views::View>();
    dot_view->SetBackground(std::make_unique<DotBackground>());
    dot_view->SetPreferredSize(gfx::Size(kDotSmallSizeDip, kDotSmallSizeDip));

    // Dots will animate on their own layers.
    dot_view->SetPaintToLayer();
    dot_view->layer()->SetFillsBoundsOpaquely(false);

    AddChildView(std::move(dot_view));
  }
}

}  // namespace ash


text:
<?php

return [

    'delete_confirmation_text' => 'Möchten Sie dieses Element wirklich löschen?',

];


text:
package de.hub.cs.dbis.aeolus.queries.utils;

import java.text.ParseException;
import java.util.Map;

/**
 * @author Matthias J. Sax
 */
class TestOrderedFileInputSpout extends AbstractOrderedFileInputSpout {
	private final static long serialVersionUID = -5336858069313450395L;

	@Override
	protected long extractTimestamp(String line) throws ParseException {
		return Long.parseLong(line.trim().split(",")[1].trim());
	}

	@Override
	public void activate() {}

	@Override
	public void deactivate() {}

	@Override
	public void ack(Object msgId) {}

	@Override
	public void fail(Object msgId) {}

	@Override
	public Map<String, Object> getComponentConfiguration() {
		return null;
	}

}


text:
//
//  Generated by the J2ObjC translator.  DO NOT EDIT!
//  source: ./core/src/java/org/apache/lucene/search/BitsFilteredDocIdSet.java
//

#include "J2ObjC_header.h"

#pragma push_macro("INCLUDE_ALL_OrgApacheLuceneSearchBitsFilteredDocIdSet")
#ifdef RESTRICT_OrgApacheLuceneSearchBitsFilteredDocIdSet
#define INCLUDE_ALL_OrgApacheLuceneSearchBitsFilteredDocIdSet 0
#else
#define INCLUDE_ALL_OrgApacheLuceneSearchBitsFilteredDocIdSet 1
#endif
#undef RESTRICT_OrgApacheLuceneSearchBitsFilteredDocIdSet

#if __has_feature(nullability)
#pragma clang diagnostic push
#pragma GCC diagnostic ignored "-Wnullability"
#pragma GCC diagnostic ignored "-Wnullability-completeness"
#endif

#if !defined (OrgApacheLuceneSearchBitsFilteredDocIdSet_) && (INCLUDE_ALL_OrgApacheLuceneSearchBitsFilteredDocIdSet || defined(INCLUDE_OrgApacheLuceneSearchBitsFilteredDocIdSet))
#define OrgApacheLuceneSearchBitsFilteredDocIdSet_

#define RESTRICT_OrgApacheLuceneSearchFilteredDocIdSet 1
#define INCLUDE_OrgApacheLuceneSearchFilteredDocIdSet 1
#include "org/apache/lucene/search/FilteredDocIdSet.h"

@class OrgApacheLuceneSearchDocIdSet;
@protocol OrgApacheLuceneUtilBits;

/*!
 @brief This implementation supplies a filtered DocIdSet, that excludes all
  docids which are not in a Bits instance.This is especially useful in
 org.apache.lucene.search.Filter to apply the acceptDocs
  passed to getDocIdSet() before returning the final DocIdSet.
 - seealso: DocIdSet
 - seealso: org.apache.lucene.search.Filter
 */
@interface OrgApacheLuceneSearchBitsFilteredDocIdSet : OrgApacheLuceneSearchFilteredDocIdSet

#pragma mark Public

/*!
 @brief Constructor.
 @param innerSet Underlying DocIdSet
 @param acceptDocs Allowed docs, all docids not in this set will not be returned by this DocIdSet
 */
- (instancetype __nonnull)initWithOrgApacheLuceneSearchDocIdSet:(OrgApacheLuceneSearchDocIdSet *)innerSet
                                    withOrgApacheLuceneUtilBits:(id<OrgApacheLuceneUtilBits>)acceptDocs;

/*!
 @brief Convenience wrapper method: If acceptDocs == null it returns the original set without wrapping.
 @param set Underlying DocIdSet. If null , this method returns null
 @param acceptDocs Allowed docs, all docids not in this set will not be returned by this DocIdSet.  If
 null , this method returns the original set without wrapping.
 */
+ (OrgApacheLuceneSearchDocIdSet *)wrapWithOrgApacheLuceneSearchDocIdSet:(OrgApacheLuceneSearchDocIdSet *)set
                                             withOrgApacheLuceneUtilBits:(id<OrgApacheLuceneUtilBits>)acceptDocs;

#pragma mark Protected

- (jboolean)matchWithInt:(jint)docid;

// Disallowed inherited constructors, do not use.

- (instancetype __nonnull)initWithOrgApacheLuceneSearchDocIdSet:(OrgApacheLuceneSearchDocIdSet *)arg0 NS_UNAVAILABLE;

@end

J2OBJC_EMPTY_STATIC_INIT(OrgApacheLuceneSearchBitsFilteredDocIdSet)

FOUNDATION_EXPORT OrgApacheLuceneSearchDocIdSet *OrgApacheLuceneSearchBitsFilteredDocIdSet_wrapWithOrgApacheLuceneSearchDocIdSet_withOrgApacheLuceneUtilBits_(OrgApacheLuceneSearchDocIdSet *set, id<OrgApacheLuceneUtilBits> acceptDocs);

FOUNDATION_EXPORT void OrgApacheLuceneSearchBitsFilteredDocIdSet_initWithOrgApacheLuceneSearchDocIdSet_withOrgApacheLuceneUtilBits_(OrgApacheLuceneSearchBitsFilteredDocIdSet *self, OrgApacheLuceneSearchDocIdSet *innerSet, id<OrgApacheLuceneUtilBits> acceptDocs);

FOUNDATION_EXPORT OrgApacheLuceneSearchBitsFilteredDocIdSet *new_OrgApacheLuceneSearchBitsFilteredDocIdSet_initWithOrgApacheLuceneSearchDocIdSet_withOrgApacheLuceneUtilBits_(OrgApacheLuceneSearchDocIdSet *innerSet, id<OrgApacheLuceneUtilBits> acceptDocs) NS_RETURNS_RETAINED;

FOUNDATION_EXPORT OrgApacheLuceneSearchBitsFilteredDocIdSet *create_OrgApacheLuceneSearchBitsFilteredDocIdSet_initWithOrgApacheLuceneSearchDocIdSet_withOrgApacheLuceneUtilBits_(OrgApacheLuceneSearchDocIdSet *innerSet, id<OrgApacheLuceneUtilBits> acceptDocs);

J2OBJC_TYPE_LITERAL_HEADER(OrgApacheLuceneSearchBitsFilteredDocIdSet)

#endif

#if __has_feature(nullability)
#pragma clang diagnostic pop
#endif
#pragma pop_macro("INCLUDE_ALL_OrgApacheLuceneSearchBitsFilteredDocIdSet")


text:
- Download brexx from (github)[http://github.com/vlachoudis/brexx]
- Open the make.cnf
- Set the correct path in the ANDNDK
- ANDOS = android OS to use
- ANDVER = android version to use
- ANDBIT = compiler architecture
- Compile with **make android**
- Run the **mkandroid.sh** to create the zip files

# Building the apk
- Needs to change the location of the BASE_INSTALL_URL to github


text:
package adjaceny_list_graph

import (
	"github.com/Ch3ck/AlGo/queuestack"
)

// A vertex (or node) in the graph.
// Each vertex has the following attributes:
//
// id (int): a number to help access the node in O(1) time
//	item (interface): the item stored in the vertex
//	outgoingEdges (list.List): a list of the vertices, that along
// 							   with the current vertex form an outgoing edge.
//	incomingEdges (list.List): a list of the vertices, that along
//							   with the current vertex form an outgoing edge.
type vertex struct {
	id            int
	item          interface{}
	outgoingEdges []*edge
	incomingEdges []*edge
}

// An edge in the directed graph.
// Each edge is represented as a 2-tuple struct that has the following attributes
//
// weight (interface): a value denoted the weight of an edge (when dealing with weighted graphs).
//						It is set to nil for unweighted graphs.
// fromVertex (vertex): the vertex this edge starts from. The outgoing vertex.
// toVertex (vertex): the vertex this edge is incident on. The incoming vertex.
type edge struct {
	id         int
	weight     interface{}
	fromVertex *vertex
	toVertex   *vertex
}

func NewEdge() *edge {
	return &edge{
		0,
		"sugar",
		new(vertex),
		new(vertex),
	}
}

// The Directed Adjacency List Graph.
//
// ATTRIBUTES
//
// primaryStructure (map[int]vertex): holds the vertices in the graph. A map is used
//                                    because it provides O(1) access to a node.
// numVertices (int): The total number of vertices in the graph.
// numEdges (int): The total number of edges in the graph.
type DirectedAdjacencyListGraph struct {
	primaryStructure map[int]*vertex
	numVertices      int
	numEdges         int
}

func NewDALGraph() *DirectedAdjacencyListGraph {
	return &DirectedAdjacencyListGraph{
		make(map[int]*vertex),
		0,
		0,
	}
}

// NumVertices returns the total number of vertices currently in the graph.
func (dalg *DirectedAdjacencyListGraph) NumVertices() int {
	return dalg.numVertices
}

// NumEdges returns the total number of edges currently in the graph.
func (dalg *DirectedAdjacencyListGraph) NumEdges() int {
	return dalg.numEdges
}

// Edges returns a list of all the edges in the graph.
func (dalg *DirectedAdjacencyListGraph) Edges() []*edge {
	var edges = make([]*edge, dalg.numEdges)
	for _, v := range dalg.primaryStructure {
		edges = append(edges, v.outgoingEdges...)
	}

	return edges
}

// Edges returns a list of all the edges in the graph
func (dalg *DirectedAdjacencyListGraph) Vertices() []*vertex {
	var vertices = make([]*vertex, dalg.numVertices)
	for _, v := range dalg.primaryStructure {
		vertices = append(vertices, v)
	}

	return vertices
}

// GetEdge returns the `edge` that start from `fromVertex` and ends at `toVertex`
// if one exists; otherwise return null.
//
// ARGUMENTS
//
// fromVertex (vertex): the vertex this edge starts from. The outgoing vertex.
// toVertex (vertex): the vertex this edge is incident on. The incoming vertex.
func (dalg *DirectedAdjacencyListGraph) GetEdge(fromVertexID, toVertexID int) *edge {
	fromVertex := dalg.primaryStructure[fromVertexID]
	toVertex := dalg.primaryStructure[toVertexID]
	if fromVertex != nil && toVertex != nil {
		for _, e := range fromVertex.outgoingEdges {
			if e.toVertex == toVertex {
				return e
			}
		}
	}

	return nil
}

// OutDegree returns the number of outgoing edges from vertex with the specified ID.
//
// ARGUMENTS
//
// id (int): ID of the vertex of interest
func (dalg *DirectedAdjacencyListGraph) OutDegree(id int) int {
	if dalg.primaryStructure[id] != nil {
		return len(dalg.primaryStructure[id].outgoingEdges)
	}

	return -1
}

// InDegree returns the number of outgoing edges from vertex with the specified ID.
//
// ARGUMENTS
//
// id (int): ID of the vertex of interest
func (dalg *DirectedAdjacencyListGraph) InDegree(id int) int {
	if dalg.primaryStructure[id] != nil {
		return len(dalg.primaryStructure[id].incomingEdges)
	}

	return -1
}

// OutgoingEdges Returns a list of all outgoing edges from vertex with the specified ID.
//
// ARGUMENTS
//
// id (int): ID of the vertex of interest
func (dalg *DirectedAdjacencyListGraph) OutgoingEdges(id int) []*edge {
	if dalg.primaryStructure[id] != nil {
		return dalg.primaryStructure[id].outgoingEdges
	}

	return nil
}

// IncomingEdges Returns a list of all outgoing edges from vertex with the specified ID.
//
// ARGUMENTS
//
// id (int): ID of the vertex of interest
func (dalg *DirectedAdjacencyListGraph) IncomingEdges(id int) []*edge {
	if dalg.primaryStructure[id] != nil {
		return dalg.primaryStructure[id].outgoingEdges
	}

	return nil
}

// InsertVertex Creates and returns a new Vertex storing element `item`.
//
// ARGUMENTS
// item (interface): the item the vertex will hold.
func (dalg *DirectedAdjacencyListGraph) InsertVertex(item interface{}) *vertex {
	if item != nil {
		v := &vertex{
			dalg.numVertices,
			item,
			make([]*edge, 0),
			make([]*edge, 0),
		}
		dalg.primaryStructure[dalg.numVertices] = v
		dalg.numVertices++

		return v
	}

	return nil
}

// InsertEdge Creates and returns a new Edge from vertex `fromVertex` to vertex `toVertex`,
// storing element x; an error occurs if there already exists an edge from `fromVertex` to `toVertex`
//
// ARGUMENTS
//
// fromVertex (vertex): the vertex this edge starts from. The outgoing vertex.
// toVertex (vertex): the vertex this edge is incident on. The incoming vertex.
// item (interface): the item the edge will hold (in the case of a weighted graph).
func (dalg *DirectedAdjacencyListGraph) InsertEdge(fromVertexID, toVertexID int, item interface{}) interface{} {
	if dalg.GetEdge(fromVertexID, toVertexID) == nil {
		fromVertex := dalg.primaryStructure[fromVertexID]
		toVertex := dalg.primaryStructure[toVertexID]
		if fromVertex != nil && toVertex != nil {
			e := &edge{
				dalg.numEdges,
				item,
				fromVertex,
				toVertex,
			}

			fromVertex.outgoingEdges = append(fromVertex.outgoingEdges, e)
			toVertex.incomingEdges = append(toVertex.incomingEdges, e)

			dalg.numEdges++

			return e
		}
	}

	return nil
}

// RemoveVertex Removes vertex with the specified ID and all its incident edges from the graph.
//
// ARGUMENTS
//
// id (int): ID of the vertex of interest
func (dalg *DirectedAdjacencyListGraph) RemoveVertex(id int) bool {
	if dalg.primaryStructure[id] != nil {
		delete(dalg.primaryStructure, id)
		dalg.numVertices--

		return true
	}

	return false
}

// RemoveEdge removes edge e from the graph.
//
// ARGUMENTS
//
// e (edge): the edge to be removed
func (dalg *DirectedAdjacencyListGraph) RemoveEdge(e *edge) bool {
	if e != nil && e.id >= 0 && e.id < len(e.fromVertex.outgoingEdges) {

		e.fromVertex.outgoingEdges[e.id] = e.fromVertex.outgoingEdges[len(e.fromVertex.outgoingEdges)-1]
		e.fromVertex.outgoingEdges = e.fromVertex.outgoingEdges[:len(e.fromVertex.outgoingEdges)-1]

		e.toVertex.incomingEdges[e.id] = e.toVertex.incomingEdges[len(e.toVertex.incomingEdges)-1]
		e.toVertex.incomingEdges = e.toVertex.incomingEdges[:len(e.toVertex.incomingEdges)-1]

		dalg.numEdges--

		return true
	}

	return false
}

// Performs a Generic Breadth-First Search on the graph. All is does is
// return a list of the IDs of the nodes in the order they were visited.
//
// Example: [4, 2, 0, 3, 1]
func (dalg *DirectedAdjacencyListGraph) BFS() []int {
	var l []int
	visitedTable := make(map[int]bool, dalg.numVertices)
	for key := range dalg.primaryStructure {
		visitedTable[key] = false
	}

	for key, vertex := range dalg.primaryStructure {
		if !visitedTable[key] {
			l = bfs(vertex, visitedTable)
		}
	}

	return l
}

func bfs(v *vertex, visitedTable map[int]bool) []int {
	l := make([]int, 0)
	queue := queuestack.NewQueue()
	queue.Enqueue(v)
	visitedTable[v.id] = true

	l = append(l, v.id)

	for !queue.Empty() {
		if node, err := queue.Dequeue(); err == nil {
			for _, ed := range node.(*vertex).outgoingEdges {
				if !visitedTable[ed.toVertex.id] {
					visitedTable[ed.toVertex.id] = true
					queue.Enqueue(ed.toVertex)

					l = append(l, ed.toVertex.id)
				}
			}
		}
	}

	return l
}


text:
/***************************************************************************
 * Data for doing a post effect on the scene.
 ***************************************************************************/

#ifndef SHADER_DATA_H_
#define SHADER_DATA_H_

#include <map>
#include <memory>
#include <string>
#include <functional>

#include "objects/hybrid_object.h"
#include "objects/textures/texture.h"
#include "objects/uniform_block.h"

namespace gvr {

class Texture;
class RenderData;

class ShaderData : public HybridObject
{
public:
    enum DIRTY_BITS
    {
        NONE = 0,
        NEW_TEXTURE = 2,
        MOD_TEXTURE = 4,
        MAT_DATA = 8,
    };

    explicit ShaderData(const char* texture_desc);

    virtual ~ShaderData() { }

    const char* getUniformDescriptor() const;
    const char* getTextureDescriptor() const;
    Texture* getTexture(const char* key) const;
    void    setTexture(const char* key, Texture* texture);
    void    forEachTexture(std::function< void(const char* texname, Texture* tex) > func) const;
    int     getByteSize(const char* name) const;
    int     getTotalSize() const;
    int     getNumUniforms() const { return uniforms().getNumEntries(); }
    std::string getShaderType(const char* descriptorType);
    bool    getFloat(const char* name, float& v) const;
    bool    getInt(const char* name, int& v) const;
    bool    setInt(const char* name, int val);
    bool    setFloat(const char* name, float val);
    bool    setIntVec(const char* name, const int* val, int n);
    bool    setFloatVec(const char* name, const float* val, int n);
    bool    getFloatVec(const char* name, float* val, int n) const;
    bool    getIntVec(const char* name, int* val, int n) const;
    bool    setVec2(const char* name, const glm::vec2& v);
    bool    setVec3(const char* name, const glm::vec3& v);
    bool    setVec4(const char* name, const glm::vec4& v);
    bool    getMat4(const char* name, glm::mat4& m) const;
    bool    setMat4(const char* name, const glm::mat4& m);
    void    makeDirty(DIRTY_BITS bits);
    void    clearDirty();
    bool    isDirty(DIRTY_BITS bits) const;
    bool    hasTexture(const char* key) const;
    bool    hasUniform(const char* key) const;
    bool    copyUniforms(const ShaderData* src);

    void forEachEntry(std::function< void(const DataDescriptor::DataEntry&) > func) const
    {
        return uniforms().forEachEntry(func);
    }

    void forEachEntry(std::function< void(DataDescriptor::DataEntry&) > func)
    {
        return uniforms().forEachEntry(func);
    }

    virtual int updateGPU(Renderer* renderer, RenderData* rdata);
    std::string makeShaderLayout();
    u_int32_t getNumTextures() const { return mTextures.size(); }
    virtual UniformBlock&   uniforms() = 0;
    virtual const UniformBlock& uniforms() const = 0;
    virtual void useGPUBuffer(bool flag) = 0;
private:
    ShaderData(const ShaderData&) = delete;
    ShaderData(ShaderData&&) = delete;
    ShaderData& operator=(const ShaderData&) = delete;
    ShaderData& operator=(ShaderData&&) = delete;

protected:
    int mNativeShader;
    std::string mTextureDesc;
    std::vector<std::string> mTextureNames;
    std::vector<Texture*> mTextures;
    mutable std::mutex mLock;
    DIRTY_BITS mDirty;
};

}
#endif


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.netapp.generated;

import com.azure.core.management.serializer.SerializerFactory;
import com.azure.core.util.Context;
import com.azure.core.util.serializer.SerializerEncoding;
import java.io.IOException;

/** Samples for Snapshots Update. */
public final class SnapshotsUpdateSamples {
    /*
     * x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Snapshots_Update.json
     */
    /**
     * Sample code: Snapshots_Update.
     *
     * @param manager Entry point to NetAppFilesManager.
     */
    public static void snapshotsUpdate(com.azure.resourcemanager.netapp.NetAppFilesManager manager) throws IOException {
        manager
            .snapshots()
            .update(
                "myRG",
                "account1",
                "pool1",
                "volume1",
                "snapshot1",
                SerializerFactory
                    .createDefaultManagementSerializerAdapter()
                    .deserialize("{}", Object.class, SerializerEncoding.JSON),
                Context.NONE);
    }
}


text:
package com.peterverzijl.softwaresystems.qwirkle;

/**
 * The block class that contains all the block's info.
 * @author Peter Verzijl en Dennis Vinke
 *
 */
public class Block {
	/**
	 * The shape that is on the block.
	 */
	public static enum Shape {
		CIRCLE, CROSS, DIAMOND, SQUARE, STAR, PLUS
	}

	/**
	 * The current shape of the block.
	 */
	private Shape mShape = null;

	/**
	 * The color that the shape has on the block.
	 */
	public static enum Color {
		RED, ORANGE, YELLOW, GREEN, BLUE, PURPLE
	}

	/**
	 * The current color of the block.
	 */
	private Color mColor = null;

	/**
	 * Creates a new block.
	 * @param shape The shape on the block.
	 * @param color The color of the block.
	 */
	public Block(Block.Shape shape, Block.Color color) {
		mShape = shape;
		mColor = color;
	}

	/* --- Getters and Setters --- */

	/**
	 * Gets the block shape.
	 * @return Shape of the block
	 */
	public Shape getShape() {
		return mShape;
	}

	/**
	 * Gets the block color.
	 * @return Color of the block
	 */
	public Color getColor() {
		return mColor;
	}

	/**
	 * Checks if two blocks have the same shape and color;\.
	 * @param other The block to to compare with the this block.
	 * @return Weighter the shape and the color are the same.
	 */
	public boolean equals(Block other) {
		boolean result = false;
		if (other.getColor() == getColor() &&
						other.getShape() == getShape()) {
			result = true;
		}
		return result;
	}

	/**
	 * Sets the Block.Shape and Block.Color of a block.
	 * @param shape The new shape of the block.
	 * @param color The new color of the block.
	 */
	public void setBlock(Block.Shape shape, Block.Color color) {
		mShape = shape;
		mColor = color;
	}

	/**
	 * Gets a new block by a two character string AA - FF.
	 * @param stone The string representing the stone.
	 * @return A new stone if the string is valid.
	 */
	public static Block getBlockFromCharPair(String stone) {
		Color c = null;
		Shape s = null;
		if (stone.length() != 2) {
			return null;
		}
		// Get color
		char color = stone.charAt(0);
		switch (color) {
			case 'A':
				c = Color.RED;
				break;
			case 'B':
				c = Color.ORANGE;
				break;
			case 'C':
				c = Color.YELLOW;
				break;
			case 'D':
				c = Color.GREEN;
				break;
			case 'E':
				c = Color.BLUE;
				break;
			case 'F':
				c = Color.PURPLE;
				break;
			default:
				return null;
		}

		// Get shape
		char shape = stone.charAt(1);
		switch (shape) {
			case 'A':
				s = Shape.CIRCLE;
				break;
			case 'B':
				s = Shape.CROSS;
				break;
			case 'C':
				s = Shape.DIAMOND;
				break;
			case 'D':
				s = Shape.SQUARE;
				break;
			case 'E':
				s = Shape.STAR;
				break;
			case 'F':
				s = Shape.PLUS;
				break;
			default:
				return null;
		}
		// Return the correct block type
		return new Block(s, c);
	}

	/**
	 * Converts the stone to a two char representation.
	 * Example: RED CROSS AB
	 * @param b The block to convert.
	 * @return The two char representation for a stone.
	 */
	public static String toChars(Block b) {
		String result = "";
		switch (b.mColor) {
			case RED:
				result += 'A';
				break;
			case ORANGE:
				result += 'B';
				break;
			case YELLOW:
				result += 'C';
				break;
			case GREEN:
				result += 'D';
				break;
			case BLUE:
				result += 'E';
				break;
			case PURPLE:
				result += 'F';
				break;
		}
		switch (b.mShape) {
			case CIRCLE:
				result += 'A';
				break;
			case CROSS:
				result += 'B';
				break;
			case DIAMOND:
				result += 'C';
				break;
			case SQUARE:
				result += 'D';
				break;
			case STAR:
				result += 'E';
				break;
			case PLUS:
				result += 'F';
				break;
		}
		return result;
	}
}


text:
package com.infotech.app.model;

import java.io.Serializable;

import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
import javax.validation.constraints.NotNull;

import org.joda.time.DateTime;

/**
 * The parent class for all reference entities (i.e. reference data as opposed to transactional data).
 *
 * @see TransactionalEntity
 *
 * @author MohammadReza Alagheband
 */
@MappedSuperclass
public class ReferenceEntity implements Serializable {

    /**
     * The default serial version UID.
     */
    private static final long serialVersionUID = 1L;

    /**
     * The primary key identifier.
     */
    @Id
    private Long id;

    /**
     * The unique code value, sometimes used for external reference.
     */
    @NotNull
    private String code;

    /**
     * A brief description of the entity.
     */
    @NotNull
    private String label;

    /**
     * The ordinal value facilitates sorting the entities.
     */
    @NotNull
    private Integer ordinal;

    /**
     * The timestamp at which the entity's values may be applied or used by the system.
     */
    @NotNull
    private DateTime effectiveAt;

    /**
     * The timestamp at which the entity's values cease to be used by the system. If null the entity is not
     * expired.
     */
    private DateTime expiresAt;

    /**
     * The timestamp when this entity instance was created.
     */
    @NotNull
    private DateTime createdAt;

    public Long getId() {
        return id;
    }

    public void setId(final Long id) {
        this.id = id;
    }

    public String getCode() {
        return code;
    }

    public void setCode(final String code) {
        this.code = code;
    }

    public String getLabel() {
        return label;
    }

    public void setLabel(final String label) {
        this.label = label;
    }

    public Integer getOrdinal() {
        return ordinal;
    }

    public void setOrdinal(final Integer ordinal) {
        this.ordinal = ordinal;
    }

    public DateTime getEffectiveAt() {
        return effectiveAt;
    }

    public void setEffectiveAt(final DateTime effectiveAt) {
        this.effectiveAt = effectiveAt;
    }

    public DateTime getExpiresAt() {
        return expiresAt;
    }

    public void setExpiresAt(final DateTime expiresAt) {
        this.expiresAt = expiresAt;
    }

    public DateTime getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(final DateTime createdAt) {
        this.createdAt = createdAt;
    }

}


text:
// ==========================================================================
// Project:   SproutCore - JavaScript Application Framework
// Copyright: ©2006-2011 Strobe Inc. and contributors.
//            Portions ©2008-2011 Apple Inc. All rights reserved.
// License:   Licensed under MIT license (see license.js)
// ==========================================================================

/*global module test equals context ok */

var context = null, elem = null;

module("SC.RenderContext#update", {
  setup: function() {
    elem = document.createElement('div');
    context = SC.RenderContext(elem) ;
  },

  teardown: function() {
    elem = context = null; // avoid memory leaks
  }
});

test("should replace innerHTML of DIV if strings were pushed", function() {
  elem.innerHTML = "initial";
  context.push("changed").update();
  equals(elem.innerHTML, "changed", "innerHTML did change");
});

test("should NOT replace innerHTML of DIV if no strings were pushed", function() {
  elem.innerHTML = "initial";
  context.update();
  equals(elem.innerHTML, "initial", "innerHTML did NOT change");
});

test("returns receiver if no prevObject", function() {
  equals(context.update(), context, "return value");
});

test("returns previous context if there is one", function() {
  var c2 = context.begin(elem);
  equals(c2.update(), context, "returns prev context");
});

test("clears internal _elem to avoid memory leaks on update", function() {
  ok(!!context._elem, 'precondition - has element')  ;
  context.update();
  ok(!context._elem, "no longer an element");
});

// ..........................................................
// Attribute Editing
//
module("SC.RenderContext#update - attrs", {
  setup: function() {
    elem = document.createElement('div');
    SC.$(elem).attr("foo", "initial");
    context = SC.RenderContext(elem);
  },

  teardown: function() {
    elem = context = null ;
  }
});

test("does not change attributes if attrs were not actually changed", function() {
  context.update();
  equals(elem.getAttribute("foo"), "initial", "attribute");
});

test("updates attribute if attrs changed", function() {
  context.attr('foo', 'changed');
  context.update();
  equals(elem.getAttribute("foo"), "changed", "attribute");
});

test("adds attribute if new", function() {
  context.attr('bar', 'baz');
  context.update();
  equals(elem.getAttribute("bar"), "baz", "attribute");
});

test("removes attribute if value is null", function() {
  context.attr('foo', null);
  context.update();
  equals(elem.getAttribute("foo"), null, "attribute");
});

// ..........................................................
// ID
//
module("SC.RenderContext#update - id", {
  setup: function() {
    elem = document.createElement('div');
    SC.$(elem).attr("id", "foo");
    context = SC.RenderContext(elem);
  },

  teardown: function() {
    elem = context = null ;
  }
});

test("does not change id if retrieved but not edited", function() {
  context.id();
  context.update();
  equals(elem.getAttribute("id"), "foo", "id");
});

test("replaces id if edited", function() {
  context.id('bar');
  context.update();
  equals(elem.getAttribute("id"), "bar", "id");
});

test("set id overrides attr", function() {
  context.attr("id", "bar");
  context.id('baz');
  context.update();
  equals(elem.getAttribute("id"), "baz", "should use id");
});

// ..........................................................
// Class Name Editing
//
module("SC.RenderContext#update - className", {
  setup: function() {
    elem = document.createElement('div');
    SC.$(elem).attr("class", "foo bar");
    context = SC.RenderContext(elem);
  },

  teardown: function() {
    elem = context = null ;
  }
});

test("does not change class names if retrieved but not edited", function() {
  context.classNames();
  context.update();
  equals(SC.$(elem).attr("class"), "foo bar", "class");
});

test("replaces class name if classNames edited", function() {
  context.classNames('bar baz'.w());
  context.update();
  equals(SC.$(elem).attr("class"), "bar baz", "attribute");
});

test("set class names override class attr", function() {
  context.attr("class", "bar");
  context.classNames('baz'.w());
  context.update();
  equals(SC.$(elem).attr("class"), "baz", "should use classNames");
});

// ..........................................................
// Style Editing
//
module("SC.RenderContext#update - style", {
  setup: function() {
    elem = document.createElement('div');
    SC.$(elem).attr("style", "color: red;");
    context = SC.RenderContext(elem);
  },

  teardown: function() {
    elem = context = null ;
  }
});

test("does not change styles if retrieved but not edited", function() {
  context.styles();
  context.update();
  var style = SC.$(elem).attr("style");
  if (!style.match(/;$/)) style += ';' ;

  equals(style.toLowerCase(), "color: red;", "style");
});

test("replaces style name if styles edited", function() {
  context.styles({ color: "black" });
  context.update();

  // Browsers return single attribute styles differently, sometimes with a trailing ';'
  // sometimes, without one. Normalize it here.
  var style = SC.$(elem).attr("style");
  if (!style.match(/;$/)) style += ';' ;

  equals(style.toLowerCase(), "color: black;", "attribute");
});

test("set styles override style attr", function() {
  context.attr("style", "color: green");
  context.styles({ color: "black" });
  context.update();

  // Browsers return single attribute styles differently, sometimes with a trailing ';'
  // sometimes, without one. Normalize it here.
  var style = SC.$(elem).attr("style");
  if (!style.match(/;$/)) style += ';' ;

  equals(style.toLowerCase(), "color: black;", "attribute");
});

test("set styles handle custom browser attributes", function() {
  context.styles({ mozColumnCount: '3', webkitColumnCount: '3', oColumnCount: '3', msColumnCount: '3' });
  context.update();

  // Browsers return single attribute styles differently, sometimes with a trailing ';'
  // sometimes, without one. Normalize it here.
  var style = SC.$(elem).attr("style");
  if (!style.match(/;$/)) style += ';' ;

  // Older Gecko completely ignores css attributes that it doesn't understand.
  if(SC.browser.isMozilla &&
      SC.browser.compare(SC.browser.engineVersion, '2.0') < 0) equals(style, "-moz-column-count: 3;");
  else if (SC.browser.isIE) equals(style, "-webkit-column-count: 3; -moz-column-count: 3; -o-column-count: 3; -ms-column-count: 3;");
  else equals(style, "-moz-column-count: 3; -webkit-column-count: 3; -o-column-count: 3; -ms-column-count: 3;");
});


text:
/*
 * config_cp.h
 *
 *  Created on: 2015Äê12ÔÂ14ÈÕ
 *      Author: weiteng
 */

#ifndef CONFIG_PROCESSOR_SRC_CONFIG_CP_H_
#define CONFIG_PROCESSOR_SRC_CONFIG_CP_H_

#include "app_platform/tcp_handle_base.h"
#include "app_platform/svr_reactor_facade.h"

#include "config_cp_adapter.h"

namespace cc
{
namespace cp
{
class ConfigCP: ITCPPacketHandleSink, ITimerHandler
{
public:
	ConfigCP()
	{
		this->m_pTcpHandler = NULL;
		this->m_iServerId = 0;
		this->m_iTimerId_UpdateMachineStatus = 0;
		this->m_iTimerId_RefreshCache = 0;
		ConfigCP::m_pThis = this;
	}

	int Init(const cc::cp::CCPConfigInfo & oCPConfigInfo);

	// network service
	int OnConnect(CTcpHandleBase* pTcpHandleBase, const char* pszPeerIP, unsigned short ushPeerPort);
	int OnRecv(CTcpHandleBase* pTcpHandleBase, char* pBuffer, uint32_t nBufLen);
	int OnSend(CTcpHandleBase* pTcpHandleBase);
	int OnClose(CTcpHandleBase* pTcpHandleBase);

	// timer service
	int OnTimer(int iTimerID);

	// ·¢ËÍÊý¾Ý
	void SendDataToPeer(CTcpHandleBase * pTargetTcpHandler, const std::string & sData);

	// ´¦ÀíAdapter½á¹û
	void ProcessAdapterResult(const OperationResult & oOPResult);

	void StartLoop();
	void StopLoop();
private:
	static void Kill(int iCode);
	void Setaffinity();

private:
	CReactor m_oReactor;
	ConfigCPAdapter m_oConfigCPAdapter;
	cc::cp::CCPConfigInfo m_oCPConfigInfo;
	CTcpHandleBase * m_pTcpHandler;
	int m_iServerId;

	int m_iTimerId_UpdateMachineStatus; // ¸üлúÆ÷״̬
	int m_iTimerId_RefreshCache; // ¸üлº´æÊý¾Ý¶¨Ê±Æ÷

	static ConfigCP * m_pThis;

};

}
}

#endif /* CONFIG_PROCESSOR_SRC_CONFIG_CP_H_ */


text:
#include <bsp.h>
#include <kern.h>
#include <config.h>
#include <bfin_dma.h>
#include <string.h>

#include "lw_emac.h"

/* MII standard registers.
   See IEEE Std 802.3-2005 clause 22:
   "Reconciliation Sublayer (RS) and Media Independent Interface (MII)",
   section 2.4.1 to 3.
   http://standards.ieee.org/getieee802/download/802.3-2005_section2.pdf */
#define MII_BMCR    0x00        /* Basic Mode Control Register */
#define MII_BMSR    0x01        /* Basic Mode Status Register */
#define MII_PHYIDR1 0x02        /* PHY Identifier Register 1 */
#define MII_PHYIDR2 0x03        /* PHY Identifier Register 2 */
#define MII_LPAR    0x05        /* Auto-Negotiation Link Partner Ability Register */

/* MII basic mode control register */
#define MII_BMCR_RST                BIT (15)
#define MII_BMCR_ANEG_EN            BIT (12)
#define MII_BMCR_ANEG_RST           BIT (9)

/* MII basic mode status register */
#define MII_BMSR_ANEGACK            BIT (5)
#define MII_BMSR_LINK               BIT (2)

/* MII auto-negotiation advertisement register */
#define MII_ANAR_100_FD             BIT (8)  /* Can do 100BASE-TX full duplex */
#define MII_ANAR_10_FD              BIT (6)  /* Can do 10BASE-T full duplex */

/* Management Data Clock (MDC) frequency.
 * 2.5Mz corresponds to the minimum period for MDC as defined by the standard.
 * This is independent of whether the PHY is in 10Mbit/s or 100Mbit/s mode.
 * See Std. IEEE 802.3 (Ethernet) Clause 22.2.2.11 ("management data clock"). */
#define PHY_MDC_Hz            2500000
#define PHY_RETRIES           3000
/* TODO: This might need changing for different boards. Fix? */
#define PHY_ADDR              0

#define ETH_RX_BUF_SIZE       2
#define ETH_TX_BUF_SIZE       1
#define ETH_FRAME_SIZE        0x614

/* Ethernet MAC register structure */
typedef struct bfin_emac_regs
{
   /* Control-Status Register Group */
   uint32_t opmode;           /* operating mode */
   uint32_t addrlo;           /* address low */
   uint32_t addrhi;           /* address high */
   uint32_t hashlo;           /* multicast hash table low */
   uint32_t hashhi;           /* multicast hash table high */
   uint32_t staadd;           /* station management address */
   uint32_t stadat;           /* station management data */
   uint32_t flc;              /* flow control */
   uint32_t vlan1;            /* VLAN1 tag */
   uint32_t vlan2;            /* VLAN2 tag */
   uint32_t _reserved1;
   uint32_t wkup_ctl;         /* wakeup frame control and status */
   uint32_t wkup_ffmsk[4];    /* wakeup frame n byte mask (n == 0,..,3) */
   uint32_t wkup_ffcmd;       /* wakeup frame filter commands */
   uint32_t wkup_ffoff;       /* wakeup frame filter offsets */
   uint32_t wkup_ffcrc0;      /* wakeup frame filter CRC0/1 */
   uint32_t wkup_ffcrc1;      /* wakeup frame filter CRC2/3 */
   uint32_t _reserved2[4];
   /* System Interface Register Group */
   uint32_t sysctl;           /* system control */
   uint32_t systat;           /* system status */
   /* Ethernet Frame Status Register Group */
   uint32_t rx_stat;          /* RX Current Frame Status */
   uint32_t rx_stky;          /* RX Sticky Frame Status */
   uint32_t rx_irqe;          /* RX Frame Status Interrupt Enable */
   uint32_t tx_stat;          /* TX Current Frame Status Register */
   uint32_t tx_stky;          /* TT Sticky Frame Status */
   uint32_t tx_irqe;          /* TX Frame Status Interrupt Enable */
   /* MAC Management Counter Register Group */
   uint32_t mmc_ctl;          /* Management Counters Control */
   uint32_t mmc_rirqs;        /* MMC RX Interrupt Status */
   uint32_t mmc_rirqe;        /* MMC RX Interrupt Enable */
   uint32_t mmc_tirqs;        /* MMC TX Interrupt Status */
   uint32_t mmc_tirqe;        /* MMC TX Interrupt Enable */
   uint32_t _reserved3[27];
   uint32_t mmc_rxc_ok;       /* FramesReceivedOK */
   uint32_t mmc_rxc_fcs;      /* FrameCheckSequenceErrors */
   uint32_t mmc_rxc_align;    /* AlignmentErrors */
   uint32_t mmc_rxc_octet;    /* OctetsReceivedOK */
   uint32_t mmc_rxc_dmaovf;   /* FramesLostDueToIntMACRcvError */
   uint32_t mmc_rxc_unicst;   /* UnicastFramesReceivedOK */
   uint32_t mmc_rxc_multi;    /* MulticastFramesReceivedOK */
   uint32_t mmc_rxc_broad;    /* BroadcastFramesReceivedOK */
   uint32_t mmc_rxc_lnerri;   /* InRangeLengthErrors */
   uint32_t mmc_rxc_lnerro;   /* OutOfRangeLengthField */
   uint32_t mmc_rxc_long;     /* FrameTooLongErrors */
   uint32_t mmc_rxc_macctl;   /* MACControlFramesReceived */
   uint32_t mmc_rxc_opcode;   /* UnsupportedOpcodesReceived */
   uint32_t mmc_rxc_pause;    /* PAUSEMACCtrlFramesReceived */
   uint32_t mmc_rxc_allfrm;   /* FramesReceivedAll */
   uint32_t mmc_rxc_alloct;   /* OctetsReceivedAll */
   uint32_t mmc_rxc_typed;    /* TypedFramesReceived */
   uint32_t mmc_rxc_short;    /* FramesLenLt64Received */
   uint32_t mmc_rxc_eq64;     /* FramesLenEq64Received */
   uint32_t mmc_rxc_lt128;    /* FramesLen65_127Received */
   uint32_t mmc_rxc_lt256;    /* FramesLen128_255Received */
   uint32_t mmc_rxc_lt512;    /* FramesLen256_511Received */
   uint32_t mmc_rxc_lt1024;   /* FramesLen512_1023Received */
   uint32_t mmc_rxc_ge1024;   /* FramesLen1024_MaxReceived */
   /* TODO: add all registers */
} bfin_emac_regs_t;

COMPILETIME_ASSERT (offsetof (bfin_emac_regs_t, opmode) == 0x0);
COMPILETIME_ASSERT (offsetof (bfin_emac_regs_t, staadd) == 0x14);
COMPILETIME_ASSERT (offsetof (bfin_emac_regs_t, wkup_ctl) == 0x2c);
COMPILETIME_ASSERT (offsetof (bfin_emac_regs_t, wkup_ffcrc1) == 0x4c);
COMPILETIME_ASSERT (offsetof (bfin_emac_regs_t, sysctl) == 0x60);
COMPILETIME_ASSERT (offsetof (bfin_emac_regs_t, rx_stat) == 0x68);
COMPILETIME_ASSERT (offsetof (bfin_emac_regs_t, mmc_ctl) == 0x80);
COMPILETIME_ASSERT (offsetof (bfin_emac_regs_t, mmc_tirqe) == 0x90);
COMPILETIME_ASSERT (offsetof (bfin_emac_regs_t, mmc_rxc_ok) == 0x100);
COMPILETIME_ASSERT (offsetof (bfin_emac_regs_t, mmc_rxc_dmaovf) == 0x110);
COMPILETIME_ASSERT (offsetof (bfin_emac_regs_t, mmc_rxc_ge1024) == 0x15c);

/* 32-bit aligned struct for ethernet data */
typedef struct ethernet_data {
   uint16_t length;     /* When TX = frame data length in bytes, not including 'length'
                         * When RX = 0x0000 padding when using RXDWA
                         */
   uint8_t data[ETH_FRAME_SIZE]; /* Hold the ethernet frame */
   uint16_t padding;    /* To make the struct 32-bit aligned */
} ethernet_data_t;

COMPILETIME_ASSERT (sizeof (ethernet_data_t) == 0x618) ;

static volatile bfin_emac_regs_t * pEth = (bfin_emac_regs_t *) EMAC_OPMODE;

/* Buffers for rx and tx DMA operations */
static ethernet_data_t rxBuffer[ETH_RX_BUF_SIZE] __attribute__((section(".dma")));
static ethernet_data_t txBuffer[ETH_TX_BUF_SIZE] __attribute__((section(".dma")));
static volatile uint32_t rxStatusWord[ETH_RX_BUF_SIZE] __attribute__((section(".dma")));
static volatile uint32_t txStatusWord[ETH_TX_BUF_SIZE] __attribute__((section(".dma")));
static bfin_dma_descriptor_t rxDMADesc[ETH_RX_BUF_SIZE * 2] __attribute__((section(".dma")));
static bfin_dma_descriptor_t txDMADesc[ETH_TX_BUF_SIZE * 2] __attribute__((section(".dma")));

/* Hold the current index of rx and tx buffers */
static uint8_t rxIdx, txIdx;

/* Internal function that writes to a PHY register  */
static void lw_emac_write_phy_reg(uint8_t phy_addr, uint8_t reg_addr, uint32_t data) {
   /* Set the flags that should be set reg_addr on PHY */
   pEth->stadat = data;

   /* Wait for our turn then initiate writing of stadat to PHY register */
   pEth->staadd = SET_PHYAD(phy_addr) | SET_REGAD(reg_addr) | STAOP | STABUSY;
   while (pEth->staadd & STABUSY) ;
}

/* Internal function that reads from; and returns a PHY register  */
static uint32_t lw_emac_read_phy_reg(uint8_t phy_addr, uint8_t reg_addr) {
   pEth->staadd = SET_PHYAD(phy_addr) | SET_REGAD(reg_addr) | STABUSY;
   while (pEth->staadd & STABUSY) ;

   return pEth->stadat;
}

/* Internal function that sets the MAC address */
static void lw_emac_set_mac_addr(uint8_t * ethAddr)
{
   pEth->addrlo =
      ethAddr[0] |
      ethAddr[1] << 8 |
      ethAddr[2] << 16 |
      ethAddr[3] << 24;
   pEth->addrhi =
      ethAddr[4] |
      ethAddr[5] << 8;
}

static uint8_t lw_emac_init_registers(uint8_t * ethAddr) {
   uint32_t clock_divisor, sysctl_mdcdiv, phy_stadat, counter;

   /* CONFIGURE MAC MII PINS */

   /* Enable PHY Clock Output */
   *(volatile uint16_t *) VR_CTL |= PHYCLKOE;

   /* Set all bits to 1 to use MII mode */
   *(uint16_t *) PORTH_FER = 0xFFFF;

   /* CONFIGURE MAC REGISTERS */

   /*
    * Set the MMC (MAC Management Counter) control register
    * RTSC = Clear all counters
    *
    * Note that counters are not enabled at this time
    */
   pEth->mmc_ctl = RSTC;

   /* Set MAC address */
   lw_emac_set_mac_addr (ethAddr);

   clock_divisor = SCLK / PHY_MDC_Hz;
   sysctl_mdcdiv = clock_divisor / 2 - 1;
   ASSERT (sysctl_mdcdiv <= 0x3f);

   rprintp ("PHY ID: %04x %04x\n",
         lw_emac_read_phy_reg (PHY_ADDR, MII_PHYIDR1),
         lw_emac_read_phy_reg (PHY_ADDR, MII_PHYIDR2)
         );

   /*
    * Set the system control register
    * SET_MDCDIV(x) = Set MDC to 2.5 MHz
    * RXDWA = Pad incoming frame with 0x0000 as to make the data-part 32-bit aligned
    * RXCKS = Enable Receive Frame TCP/UDP Checksum Computation
    */
   pEth->sysctl = SET_MDCDIV(sysctl_mdcdiv) | RXDWA ;

   /* CONFIGURE PHY */

   /*
    * Set the PHY basic control register
    * MII_BMCR_ANEG_EN = Auto negotiation on
    * MII_BMCR_ANEG_RST = Restart the auto-neg process by setting
    * Speed handled by auto negotiation
    */
   phy_stadat = MII_BMCR_ANEG_EN | MII_BMCR_ANEG_RST;
   lw_emac_write_phy_reg(PHY_ADDR, MII_BMCR, phy_stadat);

   /* Loop until link is up or time out after PHY_RETRIES */
   counter = 0;
   do {
      if (counter > PHY_RETRIES) {
         rprintp("Ethernet link is down\n");
         return -1;
      }

      task_delay (tick_from_ms (10));
      phy_stadat = lw_emac_read_phy_reg(PHY_ADDR, MII_BMSR);

      ++counter;
   } while (!(phy_stadat & MII_BMSR_LINK)) ;

   /* Check whether link partner can do full duplex or not */
   phy_stadat = lw_emac_read_phy_reg(PHY_ADDR, MII_LPAR);

   if (phy_stadat & (MII_ANAR_100_FD | MII_ANAR_10_FD) ) {
      pEth->opmode = FDMODE;
   }
   else {
      pEth->opmode = 0;
   }

   /*
    * Setup DMA MAC receive/transfer channels with XCOUNT 0 (which we use
    * together with description based DMA) and XMODIFY 4 (bytes per transfer)
    */
   bfin_dma_channel_init(DMA_CHANNEL_EMAC_RX, 0, 4);
   bfin_dma_channel_init(DMA_CHANNEL_EMAC_TX, 0, 4);

   return 0;
}

int bfin_EMAC_init (uint8_t *ethAddr)
{
   rxIdx = txIdx = 0;

   if (lw_emac_init_registers(ethAddr) != 0) {
      return -1;
   }

   // Reset status words
   memset ((uint8_t *)rxStatusWord, 0, sizeof(rxStatusWord));
   memset ((uint8_t *)txStatusWord, 0, sizeof(txStatusWord));

   txDMADesc[0].next = &txDMADesc[1];
   txDMADesc[0].start_addr = &txBuffer[0];
   txDMADesc[0].config = DMA_CONFIG_DMA_EN |
                         DMA_CONFIG_WDSIZE(DMA_WDSIZE_32BIT) |
                         DMA_CONFIG_NDSIZE(5) |
                         DMA_CONFIG_FLOW(DMA_FLOW_DESCRIPTOR_LIST_LARGE);

   txDMADesc[1].next = &txDMADesc[0];
   txDMADesc[1].start_addr = &txStatusWord[0];
   txDMADesc[1].config = DMA_CONFIG_DMA_EN |
                         DMA_CONFIG_WNR |
                         DMA_CONFIG_WDSIZE(DMA_WDSIZE_32BIT) |
                         DMA_CONFIG_NDSIZE(0) |
                         DMA_CONFIG_FLOW(DMA_FLOW_STOP);

   rxDMADesc[0].next = &rxDMADesc[1];
   rxDMADesc[0].start_addr = &rxBuffer[0];
   rxDMADesc[0].config = DMA_CONFIG_DMA_EN |
                         DMA_CONFIG_WNR |
                         DMA_CONFIG_WDSIZE(DMA_WDSIZE_32BIT) |
                         DMA_CONFIG_NDSIZE(5) |
                         DMA_CONFIG_FLOW(DMA_FLOW_DESCRIPTOR_LIST_LARGE);

   rxDMADesc[1].next = &rxDMADesc[2];
   rxDMADesc[1].start_addr = &rxStatusWord[0];
   rxDMADesc[1].config = DMA_CONFIG_DMA_EN |
                         DMA_CONFIG_WNR |
                         DMA_CONFIG_WDSIZE(DMA_WDSIZE_32BIT) |
                         DMA_CONFIG_NDSIZE(5) |
                         DMA_CONFIG_FLOW(DMA_FLOW_DESCRIPTOR_LIST_LARGE);

   rxDMADesc[2].next = &rxDMADesc[3];
   rxDMADesc[2].start_addr = &rxBuffer[1];
   rxDMADesc[2].config = DMA_CONFIG_DMA_EN |
                         DMA_CONFIG_WNR |
                         DMA_CONFIG_WDSIZE(DMA_WDSIZE_32BIT) |
                         DMA_CONFIG_NDSIZE(5) |
                         DMA_CONFIG_FLOW(DMA_FLOW_DESCRIPTOR_LIST_LARGE);

   rxDMADesc[3].next = &rxDMADesc[0];
   rxDMADesc[3].start_addr = &rxStatusWord[1];
   rxDMADesc[3].config = DMA_CONFIG_DMA_EN |
                         DMA_CONFIG_WNR |
                         DMA_CONFIG_WDSIZE(DMA_WDSIZE_32BIT) |
                         DMA_CONFIG_NDSIZE(5) |
                         DMA_CONFIG_FLOW(DMA_FLOW_DESCRIPTOR_LIST_LARGE);

   bfin_dma_channel_enable(DMA_CHANNEL_EMAC_RX, &rxDMADesc[0]);

   /* Enable Receiving, Automatic Pad Stripping and receiving of frames with length < 64 butes */
   pEth->opmode |= ASTP | PSF | RE;

   return 0;
}
int bfin_EMAC_send (void *packet, int length)
{
   UASSERT(length > 0, EARG);
   UASSERT(length < ETH_FRAME_SIZE, EARG);

   /* TODO: Check DMA Error in IRQ status */

   while (bfin_dma_channel_interrupt_is_active (DMA_CHANNEL_EMAC_TX));

   txBuffer[txIdx].length = length;
   memcpy(txBuffer[txIdx].data, packet, length);

   bfin_dma_channel_enable(DMA_CHANNEL_EMAC_TX, txDMADesc);
   pEth->opmode |= TE;

   while ((txStatusWord[txIdx] & TX_COMP) == 0);

   ASSERT(txStatusWord[txIdx] & TX_OK);

   txStatusWord[txIdx] = 0;

   ++txIdx;

    if (txIdx == ETH_TX_BUF_SIZE) {
       txIdx = 0;
    }

   return 0;
}

int bfin_EMAC_recv (uint8_t * packet, size_t size)
{
   uint32_t length;
   uint32_t status = rxStatusWord[rxIdx];

   /* Check if rx frame is completed */
   if ((status & RX_COMP) == 0) {
      return -1;
   }
   else if ((status & RX_OK) == 0) {
      ASSERT(0);
      /* TODO: Handle error */
      return -1;
   }
   else if (status & RX_DMAO) {
      ASSERT(0);
      /* TODO: Handle overrun */
      return -1;
   }

   length = status & RX_FRLEN;

   if (size < length) {
      length = size;
   }

   memcpy(packet, rxBuffer[rxIdx].data, length);

   bfin_dma_channel_interrupt_clear (DMA_CHANNEL_EMAC_RX);
   rxStatusWord[rxIdx] = 0;

   ++rxIdx;

   if (rxIdx == ETH_RX_BUF_SIZE) {
      rxIdx = 0;
   }

   return length;
}


text:
using Xamarin.Forms;

namespace GiTracker.Controls
{
    public class NiceLabel : Label
    {
        public static readonly BindableProperty IsUnderlinedProperty =
            BindableProperty.Create<NiceLabel, bool>(p => p.IsUnderlined, false);

        public bool IsUnderlined
        {
            get { return (bool) GetValue(IsUnderlinedProperty); }
            set { SetValue(IsUnderlinedProperty, value); }
        }
    }
}


text:
FROM google/dart

WORKDIR /app

VOLUME ["/encodeOut", "/encodeIn"]

ADD pubspec.* /app/
RUN pub get
ADD . /app
RUN pub get --offline
RUN echo "*******DONE BUILDING*****"

ENTRYPOINT ["/usr/bin/dart", "--enable-async", "bin/web_watcher.dart"]


text:
package org.ms123.common.system.jndi;

import org.apache.xbean.naming.global.GlobalContextManager;
import bitronix.tm.jndi.*;

/**
 * A very simple writable initial context factory.
 * @see org.apache.xbean.naming.context.WritableContext for details.
 */
public class InitialContextFactory extends GlobalContextManager {

	public InitialContextFactory() throws Exception {
		super();
		setGlobalContext(new GlobalContext());
	}
}


text:
/**
 */

package org.apache.harmony.test.func.api.java.util.Locale;

import java.util.Locale;

import org.apache.harmony.share.MultiCase;
import org.apache.harmony.share.Result;

/*
 * Mar 16, 2006
 */
public class GetVariantTest extends MultiCase {

    public Result testGetVariant() {
        StringBuffer builder = new StringBuffer();
        builder.append('V');
        builder.append("ARIANT");

        Locale loc = new Locale("en", "US", "VARIANT");
        assertEquals(loc.getVariant(), builder.toString());

        assertFalse(builder.toString() == "VARIANT");

        String s = "VARIANT";
        assertTrue(s == "VARIANT");

        return result();
    }

    public static void main(String[] args) {
        System.exit(new GetVariantTest().test(args));
    }

}


text:
var http = require('http'),
express = require('express'),
sio = require('socket.io'),
esl = require('modesl');

var Chatty = exports.Chatty = function(opts) {
    opts = opts || {};

    this.port = opts.port || 8181;
    this.host = opts.host || '0.0.0.0';
    this.provider = opts.provider || 'sms-proxy-01.bandwidthclec.com';
    this.from = opts.from || '19515529832@199.44.241.115';
    this.profile = opts.profile || 'external';

    this.app = express();

    this.config = require('../config.json');

    this.clients = {};

    this.lastSeq = 0;
};

Chatty.prototype._configure = function() {
    var self = this;

    self.app.use(express.static('public'));

    self.io.set('log level', 1);
};

Chatty.prototype._init = function() {
    var self = this;

    //self.app.get('/', function(req, res) {
        //res.render('index.html');
    //});

    self.io.on('connection', function(socket) {
        socket.on('setup', function(num, fn) {
            if(num.length === 10) num = '1' + num.toString();

            self.clients[num.toString()] = socket;
            socket.set('number', num.toString(), function() {
                fn();
            });
        });

        socket.on('sendmsg', function(msg, fn) {
            socket.get('number', function(err, num) {
                self.fsw.message({
                    to: num + '@' + self.provider,
                    from: self.from,
                    profile: self.profile,
                    body: msg
                }, function(evt) {
                    fn(evt.serialize('json'));
                });
            });
        });
    });
};

Chatty.prototype.start = function() {
    var self = this;

    self.server = self.app.listen(self.port, self.host);
    self.io = sio.listen(self.server);

    //connect to freeswitch
    self.fsw = new esl.Connection(self.config.fsw.host, self.config.fsw.port, self.config.fsw.password, function() {
        self.fsw.subscribe('MESSAGE', function() {
            self._configure();
            self._init();
        });
    });

    self.fsw.on('esl::event::**', function(evt) {
        console.log('Event:', evt);
    });

    self.fsw.on('esl::event::MESSAGE::*', function(evt) {
        var n = evt.getHeader('from_user'),
        seq = parseInt(evt.getHeader('Event-Sequence'), 10);

        //with action="fire" in the chatplan, you sometimes
        //will get the message 2 times O.o
        if(seq <= self.lastSeq) return;

        self.lastSeq = seq;

        if(self.clients[n]) {
            self.clients[n].emit('recvmsg', evt.getBody());
        }
    });

    self.fsw.on('error', function(err) {
        console.log(err);
    });
};


text:
"""""
https://github.com/hyves-org/p2ptracker
Copyright (c) 2011, Ramon van Alteren
MIT license: http://www.opensource.org/licenses/MIT

Default settings for the app
"""""
HOST = "localhost"
PORT = "5000"
DEBUG = True
REDISHOST = "localhost"
REDISPORT = 6379
SMDB_URL = 'http://192.168.135.20:5000'
MAX_REPR_RACK = 2
ACTIVE_INTERVAL = 15
PASSIVE_INTERVAL = 5 * 60 # 5 minutes
UPLOAD_PATH="/tmp/p2ptracker"
MAXPEERS=30
PROXYPASS = True