text:
#!/usr/bin/env python2.7

from __future__ import print_function

from os.path import dirname, join, isfile, realpath, relpath, split, exists
from os import makedirs
import os
import tarfile
import time
import subprocess
import shutil
from zipfile import ZipFile
import sys
import re

from fnmatch import fnmatch

import jinja2

if os.name == 'nt':
    ANDROID = 'android.bat'
    ANT = 'ant.bat'
else:
    ANDROID = 'android'
    ANT = 'ant'

curdir = dirname(__file__)

# Try to find a host version of Python that matches our ARM version.
PYTHON = join(curdir, 'python-install', 'bin', 'python.host')

BLACKLIST_PATTERNS = [
    # code versionning
    '^*.hg/*',
    '^*.git/*',
    '^*.bzr/*',
    '^*.svn/*',

    # pyc/py
    '*.pyc',
    # '*.py',  # AND: Need to fix this to add it back

    # temp files
    '~',
    '*.bak',
    '*.swp',
]

WHITELIST_PATTERNS = []

python_files = []

environment = jinja2.Environment(loader=jinja2.FileSystemLoader(
    join(curdir, 'templates')))

def render(template, dest, **kwargs):
    '''Using jinja2, render `template` to the filename `dest`, supplying the

    keyword arguments as template parameters.
    '''

    dest_dir = dirname(dest)
    if dest_dir and not exists(dest_dir):
        makedirs(dest_dir)

    template = environment.get_template(template)
    text = template.render(**kwargs)

    f = open(dest, 'wb')
    f.write(text.encode('utf-8'))
    f.close()

def is_whitelist(name):
    return match_filename(WHITELIST_PATTERNS, name)

def is_blacklist(name):
    if is_whitelist(name):
        return False
    return match_filename(BLACKLIST_PATTERNS, name)

def match_filename(pattern_list, name):
    for pattern in pattern_list:
        if pattern.startswith('^'):
            pattern = pattern[1:]
        else:
            pattern = '*/' + pattern
        if fnmatch(name, pattern):
            return True

def listfiles(d):
    basedir = d
    subdirlist = []
    for item in os.listdir(d):
        fn = join(d, item)
        if isfile(fn):
            yield fn
        else:
            subdirlist.append(join(basedir, item))
    for subdir in subdirlist:
        for fn in listfiles(subdir):
            yield fn

def make_python_zip():
    '''
    Search for all the python related files, and construct the pythonXX.zip
    According to
    # http://randomsplat.com/id5-cross-compiling-python-for-embedded-linux.html
    site-packages, config and lib-dynload will be not included.
    '''

    if not exists('private'):
        print('No compiled python is present to zip, skipping.')
        print('this should only be the case if you are using the CrystaX python')
        return

    global python_files
    d = realpath(join('private', 'lib', 'python2.7'))

    def select(fn):
        if is_blacklist(fn):
            return False
        fn = realpath(fn)
        assert(fn.startswith(d))
        fn = fn[len(d):]
        if (fn.startswith('/site-packages/') or
            fn.startswith('/config/') or
            fn.startswith('/lib-dynload/') or
            fn.startswith('/libpymodules.so')):
            return False
        return fn

    # get a list of all python file
    python_files = [x for x in listfiles(d) if select(x)]

    # create the final zipfile
    zfn = join('private', 'lib', 'python27.zip')
    zf = ZipFile(zfn, 'w')

    # put all the python files in it
    for fn in python_files:
        afn = fn[len(d):]
        zf.write(fn, afn)
    zf.close()

def make_tar(tfn, source_dirs, ignore_path=[]):
    '''
    Make a zip file `fn` from the contents of source_dis.
    '''

    # selector function
    def select(fn):
        rfn = realpath(fn)
        for p in ignore_path:
            if p.endswith('/'):
                p = p[:-1]
            if rfn.startswith(p):
                return False
        if rfn in python_files:
            return False
        return not is_blacklist(fn)

    # get the files and relpath file of all the directory we asked for
    files = []
    for sd in source_dirs:
        sd = realpath(sd)
        compile_dir(sd)
        files += [(x, relpath(realpath(x), sd)) for x in listfiles(sd)
                  if select(x)]

    # create tar.gz of thoses files
    tf = tarfile.open(tfn, 'w:gz', format=tarfile.USTAR_FORMAT)
    dirs = []
    for fn, afn in files:
#        print('%s: %s' % (tfn, fn))
        dn = dirname(afn)
        if dn not in dirs:
            # create every dirs first if not exist yet
            d = ''
            for component in split(dn):
                d = join(d, component)
                if d.startswith('/'):
                    d = d[1:]
                if d == '' or d in dirs:
                    continue
                dirs.append(d)
                tinfo = tarfile.TarInfo(d)
                tinfo.type = tarfile.DIRTYPE
                tf.addfile(tinfo)

        # put the file
        tf.add(fn, afn)
    tf.close()

def compile_dir(dfn):
    '''
    Compile *.py in directory `dfn` to *.pyo
    '''

    return  # AND: Currently leaving out the compile to pyo step because it's somehow broken
    # -OO = strip docstrings
    subprocess.call([PYTHON, '-OO', '-m', 'compileall', '-f', dfn])

def make_package(args):
    # # Update the project to a recent version.
    # try:
    #     subprocess.call([ANDROID, 'update', 'project', '-p', '.', '-t',
    #                      'android-{}'.format(args.sdk_version)])
    # except (OSError, IOError):
    #     print('An error occured while calling', ANDROID, 'update')
    #     print('Your PATH must include android tools.')
    #     sys.exit(-1)

    # Delete the old assets.
    if exists('assets/public.mp3'):
        os.unlink('assets/public.mp3')

    if exists('assets/private.mp3'):
        os.unlink('assets/private.mp3')

    # In order to speedup import and initial depack,
    # construct a python27.zip
    make_python_zip()

    # Package up the private and public data.
    # AND: Just private for now
    tar_dirs = [args.private]
    if exists('private'):
        tar_dirs.append('private')
    if exists('crystax_python'):
        tar_dirs.append('crystax_python')
    tar_dirs.append('webview_includes')
    if args.private:
        make_tar('assets/private.mp3', tar_dirs, args.ignore_path)
    # else:
    #     make_tar('assets/private.mp3', ['private'])

    # if args.dir:
    #     make_tar('assets/public.mp3', [args.dir], args.ignore_path)

    # # Build.
    # try:
    #     for arg in args.command:
    #         subprocess.check_call([ANT, arg])
    # except (OSError, IOError):
    #     print 'An error occured while calling', ANT
    #     print 'Did you install ant on your system ?'
    #     sys.exit(-1)

    # Prepare some variables for templating process

    default_icon = 'templates/kivy-icon.png'
    shutil.copy(args.icon or default_icon, 'res/drawable/icon.png')

    default_presplash = 'templates/kivy-presplash.jpg'
    shutil.copy(args.presplash or default_presplash,
                'res/drawable/presplash.jpg')

    # If extra Java jars were requested, copy them into the libs directory
    if args.add_jar:
        for jarname in args.add_jar:
            if not exists(jarname):
                print('Requested jar does not exist: {}'.format(jarname))
                sys.exit(-1)
            shutil.copy(jarname, 'libs')

    versioned_name = (args.name.replace(' ', '').replace('\'', '') +
                      '-' + args.version)

    version_code = 0
    if not args.numeric_version:
        for i in args.version.split('.'):
            version_code *= 100
            version_code += int(i)
        args.numeric_version = str(version_code)

    if args.intent_filters:
        with open(args.intent_filters) as fd:
            args.intent_filters = fd.read()

    if args.extra_source_dirs:
        esd = []
        for spec in args.extra_source_dirs:
            if ':' in spec:
                specdir, specincludes = spec.split(':')
            else:
                specdir = spec
                specincludes = '**'
            esd.append((realpath(specdir), specincludes))
        args.extra_source_dirs = esd
    else:
        args.extra_source_dirs = []

    service = False
    service_main = join(realpath(args.private), 'service', 'main.py')
    if exists(service_main) or exists(service_main + 'o'):
        service = True

    service_names = []
    for sid, spec in enumerate(args.services):
        spec = spec.split(':')
        name = spec[0]
        entrypoint = spec[1]
        options = spec[2:]

        foreground = 'foreground' in options
        sticky = 'sticky' in options

        service_names.append(name)
        render(
            'Service.tmpl.java',
            'src/{}/Service{}.java'.format(args.package.replace(".", "/"), name.capitalize()),
            name=name,
            entrypoint=entrypoint,
            args=args,
            foreground=foreground,
            sticky=sticky,
            service_id=sid + 1,
        )

    render(
        'AndroidManifest.tmpl.xml',
        'AndroidManifest.xml',
        args=args,
        service=service,
        service_names=service_names,
        )

    render(
        'build.tmpl.xml',
        'build.xml',
        args=args,
        versioned_name=versioned_name)

    render(
        'strings.tmpl.xml',
        'res/values/strings.xml',
        args=args)

    render(
        'custom_rules.tmpl.xml',
        'custom_rules.xml',
        args=args)

    render('WebViewLoader.tmpl.java',
           'src/org/kivy/android/WebViewLoader.java',
           args=args)

    with open(join(dirname(__file__), 'res',
                   'values', 'strings.xml')) as fileh:
        lines = fileh.read()

    with open(join(dirname(__file__), 'res',
                   'values', 'strings.xml'), 'w') as fileh:
        fileh.write(re.sub(r'"private_version">[0-9\.]*<',
                           '"private_version">{}<'.format(
                               str(time.time())), lines))

def parse_args(args=None):
    global BLACKLIST_PATTERNS, WHITELIST_PATTERNS
    default_android_api = 12
    import argparse
    ap = argparse.ArgumentParser(description='''\
Package a Python application for Android.

For this to work, Java and Ant need to be in your path, as does the
tools directory of the Android SDK.
''')

    ap.add_argument('--private', dest='private',
                    help='the dir of user files',
                    required=True)
    ap.add_argument('--package', dest='package',
                    help=('The name of the java package the project will be'
                          ' packaged under.'),
                    required=True)
    ap.add_argument('--name', dest='name',
                    help=('The human-readable name of the project.'),
                    required=True)
    ap.add_argument('--numeric-version', dest='numeric_version',
                    help=('The numeric version number of the project. If not '
                          'given, this is automatically computed from the '
                          'version.'))
    ap.add_argument('--version', dest='version',
                    help=('The version number of the project. This should '
                          'consist of numbers and dots, and should have the '
                          'same number of groups of numbers as previous '
                          'versions.'),
                    required=True)
    ap.add_argument('--orientation', dest='orientation', default='portrait',
                    help=('The orientation that the game will display in. '
                          'Usually one of "landscape", "portrait" or '
                          '"sensor"'))
    ap.add_argument('--icon', dest='icon',
                    help='A png file to use as the icon for the application.')
    ap.add_argument('--permission', dest='permissions', action='append',
                    help='The permissions to give this app.', nargs='+')
    ap.add_argument('--meta-data', dest='meta_data', action='append',
                    help='Custom key=value to add in application metadata')
    ap.add_argument('--presplash', dest='presplash',
                    help=('A jpeg file to use as a screen while the '
                          'application is loading.'))
    ap.add_argument('--wakelock', dest='wakelock', action='store_true',
                    help=('Indicate if the application needs the device '
                          'to stay on'))
    ap.add_argument('--window', dest='window', action='store_false',
                    help='Indicate if the application will be windowed')
    ap.add_argument('--blacklist', dest='blacklist',
                    default=join(curdir, 'blacklist.txt'),
                    help=('Use a blacklist file to match unwanted file in '
                          'the final APK'))
    ap.add_argument('--whitelist', dest='whitelist',
                    default=join(curdir, 'whitelist.txt'),
                    help=('Use a whitelist file to prevent blacklisting of '
                          'file in the final APK'))
    ap.add_argument('--add-jar', dest='add_jar', action='append',
                    help=('Add a Java .jar to the libs, so you can access its '
                          'classes with pyjnius. You can specify this '
                          'argument more than once to include multiple jars'))
    ap.add_argument('--sdk', dest='sdk_version', default=-1,
                    type=int, help=('Android SDK version to use. Default to '
                                    'the value of minsdk'))
    ap.add_argument('--minsdk', dest='min_sdk_version',
                    default=default_android_api, type=int,
                    help=('Minimum Android SDK version to use. Default to '
                          'the value of ANDROIDAPI, or {} if not set'
                          .format(default_android_api)))
    ap.add_argument('--intent-filters', dest='intent_filters',
                    help=('Add intent-filters xml rules to the '
                          'AndroidManifest.xml file. The argument is a '
                          'filename containing xml. The filename should be '
                          'located relative to the python-for-android '
                          'directory'))
    ap.add_argument('--with-billing', dest='billing_pubkey',
                    help='If set, the billing service will be added (not implemented)')
    ap.add_argument('--service', dest='services', action='append',
                    help='Declare a new service entrypoint: '
                         'NAME:PATH_TO_PY[:foreground]')
    ap.add_argument('--add-source', dest='extra_source_dirs', action='append',
                    help='Include additional source dirs in Java build')
    ap.add_argument('--port', help='The port on localhost that the WebView will access',
                    default='5000')

    if args is None:
        args = sys.argv[1:]
    args = ap.parse_args(args)
    args.ignore_path = []

    if args.name and args.name[0] == '"' and args.name[-1] == '"':
        args.name = args.name[1:-1]

    if args.billing_pubkey:
        print('Billing not yet supported in sdl2 bootstrap!')
        exit(1)

    if args.sdk_version == -1:
        args.sdk_version = args.min_sdk_version

    if args.permissions is None:
        args.permissions = []
    elif args.permissions:
        if isinstance(args.permissions[0], list):
            args.permissions = [p for perm in args.permissions for p in perm]

    if args.meta_data is None:
        args.meta_data = []

    if args.services is None:
        args.services = []

    if args.blacklist:
        with open(args.blacklist) as fd:
            patterns = [x.strip() for x in fd.read().splitlines()
                        if x.strip() and not x.strip().startswith('#')]
        BLACKLIST_PATTERNS += patterns

    if args.whitelist:
        with open(args.whitelist) as fd:
            patterns = [x.strip() for x in fd.read().splitlines()
                        if x.strip() and not x.strip().startswith('#')]
        WHITELIST_PATTERNS += patterns

    make_package(args)

    return args

if __name__ == "__main__":

    parse_args()


text:
ActiveRecord::Schema.define do
  self.verbose = false

  create_table :api_clients, :force => true do |t|
    t.string :name, null: false
    t.column :key, "uuid", null: false
    t.column :created_at, "timestamp with time zone", null: false
  end
  add_index :api_clients, [:name], unique: true
  add_index :api_clients, [:key], unique: true
end

redpajama_set_name: RedPajamaGithub


text:
<tool id='masc.text_2.0.0' name='MascTextSource' version='2.0.0'>
  <description>Text files from the ANC's Manually Annotated SubCorpus in a JSON container</description>
  <command interpreter='lsd'>invoke.lsd masc.text_2.0.0 $input $output</command>
  <inputs>
    <param name='input' type='data' format='json' label='input' />
  </inputs>
  <outputs>
    <data name='output' format='json' />
  </outputs>
  <help>Text files from the ANC's Manually Annotated SubCorpus in a JSON container</help>
</tool>


text:
#include "webrtc/base/logging.h"
#include "webrtc/base/trace_event.h"
#include "webrtc/modules/video_coding/include/video_coding.h"
#include "webrtc/modules/video_coding/generic_decoder.h"
#include "webrtc/modules/video_coding/internal_defines.h"
#include "webrtc/system_wrappers/include/clock.h"

namespace webrtc {

VCMDecodedFrameCallback::VCMDecodedFrameCallback(VCMTiming* timing,
                                                 Clock* clock)
    : _critSect(CriticalSectionWrapper::CreateCriticalSection()),
      _clock(clock),
      _receiveCallback(NULL),
      _timing(timing),
      _timestampMap(kDecoderFrameMemoryLength),
      _lastReceivedPictureID(0) {}

VCMDecodedFrameCallback::~VCMDecodedFrameCallback() {
  delete _critSect;
}

void VCMDecodedFrameCallback::SetUserReceiveCallback(
    VCMReceiveCallback* receiveCallback) {
  CriticalSectionScoped cs(_critSect);
  _receiveCallback = receiveCallback;
}

VCMReceiveCallback* VCMDecodedFrameCallback::UserReceiveCallback() {
  CriticalSectionScoped cs(_critSect);
  return _receiveCallback;
}

int32_t VCMDecodedFrameCallback::Decoded(VideoFrame& decodedImage) {
  return Decoded(decodedImage, -1);
}

int32_t VCMDecodedFrameCallback::Decoded(VideoFrame& decodedImage,
                                         int64_t decode_time_ms) {
  TRACE_EVENT_INSTANT1("webrtc", "VCMDecodedFrameCallback::Decoded",
                       "timestamp", decodedImage.timestamp());
  // TODO(holmer): We should improve this so that we can handle multiple
  // callbacks from one call to Decode().
  VCMFrameInformation* frameInfo;
  VCMReceiveCallback* callback;
  {
    CriticalSectionScoped cs(_critSect);
    frameInfo = _timestampMap.Pop(decodedImage.timestamp());
    callback = _receiveCallback;
  }

  if (frameInfo == NULL) {
    LOG(LS_WARNING) << "Too many frames backed up in the decoder, dropping "
                       "this one.";
    return WEBRTC_VIDEO_CODEC_OK;
  }

  const int64_t now_ms = _clock->TimeInMilliseconds();
  if (decode_time_ms < 0) {
    decode_time_ms =
        static_cast<int32_t>(now_ms - frameInfo->decodeStartTimeMs);
  }
  _timing->StopDecodeTimer(decodedImage.timestamp(), decode_time_ms, now_ms,
                           frameInfo->renderTimeMs);

  if (callback != NULL) {
    decodedImage.set_render_time_ms(frameInfo->renderTimeMs);
    decodedImage.set_rotation(frameInfo->rotation);
    callback->FrameToRender(decodedImage);
  }
  return WEBRTC_VIDEO_CODEC_OK;
}

int32_t VCMDecodedFrameCallback::ReceivedDecodedReferenceFrame(
    const uint64_t pictureId) {
  CriticalSectionScoped cs(_critSect);
  if (_receiveCallback != NULL) {
    return _receiveCallback->ReceivedDecodedReferenceFrame(pictureId);
  }
  return -1;
}

int32_t VCMDecodedFrameCallback::ReceivedDecodedFrame(
    const uint64_t pictureId) {
  _lastReceivedPictureID = pictureId;
  return 0;
}

uint64_t VCMDecodedFrameCallback::LastReceivedPictureID() const {
  return _lastReceivedPictureID;
}

void VCMDecodedFrameCallback::OnDecoderImplementationName(
    const char* implementation_name) {
  CriticalSectionScoped cs(_critSect);
  if (_receiveCallback)
    _receiveCallback->OnDecoderImplementationName(implementation_name);
}

void VCMDecodedFrameCallback::Map(uint32_t timestamp,
                                  VCMFrameInformation* frameInfo) {
  CriticalSectionScoped cs(_critSect);
  _timestampMap.Add(timestamp, frameInfo);
}

int32_t VCMDecodedFrameCallback::Pop(uint32_t timestamp) {
  CriticalSectionScoped cs(_critSect);
  if (_timestampMap.Pop(timestamp) == NULL) {
    return VCM_GENERAL_ERROR;
  }
  return VCM_OK;
}

VCMGenericDecoder::VCMGenericDecoder(VideoDecoder* decoder, bool isExternal)
    : _callback(NULL),
      _frameInfos(),
      _nextFrameInfoIdx(0),
      _decoder(decoder),
      _codecType(kVideoCodecUnknown),
      _isExternal(isExternal),
      _keyFrameDecoded(false) {}

VCMGenericDecoder::~VCMGenericDecoder() {}

int32_t VCMGenericDecoder::InitDecode(const VideoCodec* settings,
                                      int32_t numberOfCores) {
  TRACE_EVENT0("webrtc", "VCMGenericDecoder::InitDecode");
  _codecType = settings->codecType;

  return _decoder->InitDecode(settings, numberOfCores);
}

int32_t VCMGenericDecoder::Decode(const VCMEncodedFrame& frame, int64_t nowMs) {
    TRACE_EVENT1("webrtc", "VCMGenericDecoder::Decode", "timestamp",
                 frame.EncodedImage()._timeStamp);
    _frameInfos[_nextFrameInfoIdx].decodeStartTimeMs = nowMs;
    _frameInfos[_nextFrameInfoIdx].renderTimeMs = frame.RenderTimeMs();
    _frameInfos[_nextFrameInfoIdx].rotation = frame.rotation();
    _callback->Map(frame.TimeStamp(), &_frameInfos[_nextFrameInfoIdx]);

    _nextFrameInfoIdx = (_nextFrameInfoIdx + 1) % kDecoderFrameMemoryLength;
    int32_t ret = _decoder->Decode(frame.EncodedImage(), frame.MissingFrame(),
                                   frame.FragmentationHeader(),
                                   frame.CodecSpecific(), frame.RenderTimeMs());

    _callback->OnDecoderImplementationName(_decoder->ImplementationName());
    if (ret < WEBRTC_VIDEO_CODEC_OK) {
        LOG(LS_WARNING) << "Failed to decode frame with timestamp "
                        << frame.TimeStamp() << ", error code: " << ret;
        _callback->Pop(frame.TimeStamp());
        return ret;
    } else if (ret == WEBRTC_VIDEO_CODEC_NO_OUTPUT ||
               ret == WEBRTC_VIDEO_CODEC_REQUEST_SLI) {
        // No output
        _callback->Pop(frame.TimeStamp());
    }
    return ret;
}

int32_t VCMGenericDecoder::Release() {
  return _decoder->Release();
}

int32_t VCMGenericDecoder::RegisterDecodeCompleteCallback(
    VCMDecodedFrameCallback* callback) {
  _callback = callback;
  return _decoder->RegisterDecodeCompleteCallback(callback);
}

bool VCMGenericDecoder::External() const {
  return _isExternal;
}

bool VCMGenericDecoder::PrefersLateDecoding() const {
  return _decoder->PrefersLateDecoding();
}

}  // namespace webrtc


text:
@implementation NSString (ExscapeEdits)

-(NSString *)titleCaseString {
	//
	// I have no idea if self CAN be nil here... Please mail me (serenity@exscape.org) if you know. ;)
	//
	if (self == nil)
		return nil;

	NSArray *words = [self componentsSeparatedByString:@" "];
	NSMutableString *outString = [[NSMutableString alloc] init];

	for (NSString *word in words) {
		if (![word isMatchedByRegex:@"^\\w"]) { // could probably use isalpha() or something instead, but the speed hardly matters here
			[outString appendFormat:@"%@ ", word];
			continue;
		}
		[outString appendFormat:@"%@%@ ",
		 [[word substringWithRange:NSMakeRange(0,1)] uppercaseString],
		 [[word substringFromIndex:1] lowercaseString]];
	}

	return [outString stringByTrimmingWhitespace];
}

-(BOOL) containsString:(NSString *)needle {
	// Convenience function for the one below
	return [self containsString:needle ignoringCaseAndDiacritics:NO];
}

-(BOOL) containsString:(NSString *)needle ignoringCaseAndDiacritics:(BOOL) ignoreCase {
	if (self == nil || needle == nil)
		return NO;

	NSStringCompareOptions options;
	if (ignoreCase == YES)
		options = (NSCaseInsensitiveSearch | NSDiacriticInsensitiveSearch);
	else
		options = 0;

	NSRange foundRange = [self rangeOfString:needle options:options];
	return (foundRange.location != NSNotFound);
}

-(NSString *)stringByTrimmingWhitespace {
    NSString *outString = [self stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"\r\n\t "]];
    return outString;
}

-(NSString *)stringByStrippingNonCharacters {
	// Remove all noncharacters (usually all except a-z 0-9 _)
	NSString *str = [NSString stringWithString:self];
    str = [str stringByReplacingOccurrencesOfRegex:@"\\W" withString:@""];
	return [str stringByReplacingOccurrencesOfRegex:@"[\\t ]" withString:@""];;
}

-(BOOL)isEqualToCharactersInString:(NSString *)otherString ignoringCase:(BOOL)ignoreCase {
	//
	// Use the above function to compare strings
	//

	NSString *s1 = [self stringByStrippingNonCharacters];
	NSString *s2 = [otherString stringByStrippingNonCharacters];
	NSStringCompareOptions searchOpt = ( ignoreCase ? NSCaseInsensitiveSearch : 0 );

	return ( [s1 compare: s2 options:searchOpt] == NSOrderedSame );
}

@end


text:
Cara Pesan

                Home

Cara Pesan

Bagaimana Cara Pesannya ?

1. lorem ipsum dolor sit amet

              Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
              tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,

2. lorem ipsum dolor sit amet

              Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
              tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,

3. lorem ipsum dolor sit amet

              Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
              tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,

4. lorem ipsum dolor sit amet

              Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
              tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,


text:
package gifAnimation;

import java.awt.image.BufferedImage;
import java.io.*;

import processing.core.*;

public class Gif extends PImage implements PConstants, Runnable {
	private PApplet parent;
	Thread runner;
	// if the animation is currently playing
	private boolean play;
	// if the animation is currently looping
	private boolean loop;
	// wether the repeat setting from the gif-file should be ignored
	private boolean ignoreRepeatSetting = false;
	// nr of repeats specified in the gif-file. 0 means repeat forever
	private int repeatSetting = 1;
	// how often this animation has repeated since last call to play()
	private int repeatCount = 0;
	// the current frame number
	private int currentFrame;
	// array containing the frames as PImages
	private PImage[] frames;
	// array containing the delay in ms of every frame
	private int[] delays;
	// last time the frame changed
	private int lastJumpTime;
	// version
	private static String version = "3.1";

	public Gif(PApplet parent, String filename) {
		// this creates a fake image so that the first time this
		// attempts to draw, something happens that's not an exception
		super(1, 1, ARGB);

		this.parent = parent;

		// create the GifDecoder
		GifDecoder gifDecoder = createDecoder(parent, filename);

		// fill up the PImage and the delay arrays
		frames = extractFrames(gifDecoder);
		delays = extractDelays(gifDecoder);

		// get the GIFs repeat count
		repeatSetting = gifDecoder.getLoopCount();

		// re-init our PImage with the new size
		super.init(frames[0].width, frames[0].height, ARGB);
		jump(0);
		parent.registerMethod("dispose", this);

		// and now, make the magic happen
		runner = new Thread(this);
		runner.start();
	}

	public void dispose() {
		// fin
		// System.out.println("disposing");
		stop();
		runner = null;
	}

	/*
	 * the thread's run method
	 */
	public void run() {
		while (Thread.currentThread() == runner) {
			try {
				Thread.sleep(5);
			} catch (InterruptedException e) {
			}

			if (play) {
				// if playing, check if we need to go to next frame

				if (parent.millis() - lastJumpTime >= delays[currentFrame]) {
					// we need to jump

					if (currentFrame == frames.length - 1) {
						// its the last frame
						if (loop) {
							jump(0); // loop is on, so rewind
						} else if (!ignoreRepeatSetting) {
							// we're not looping, but we need to respect the
							// GIF's repeat setting
							repeatCount++;
							if (repeatSetting == 0) {
								// we need to repeat forever
								jump(0);
							} else if (repeatCount == repeatSetting) {
								// stop repeating, we've reached the repeat
								// setting
								stop();
							}
						} else {
							// no loop & ignoring the repeat setting, so just
							// stop.
							stop();
						}
					} else {
						// go to the next frame
						jump(currentFrame + 1);
					}
				}
			}
		}
	}

	/*
	 * creates an input stream using processings openStream() method to read
	 * from the sketch data-directory
	 */
	private static InputStream createInputStream(PApplet parent, String filename) {
		InputStream inputStream = parent.createInput(filename);
		return inputStream;
	}

	/*
	 * in case someone wants to mess with the frames directly, they can get an
	 * array of PImages containing the animation frames. without having a
	 * gif-object with a seperate thread
	 *
	 * it takes a filename of a file in the datafolder.
	 */
	public static PImage[] getPImages(PApplet parent, String filename) {
		GifDecoder gifDecoder = createDecoder(parent, filename);
		return extractFrames(gifDecoder);
	}

	/*
	 * probably someone wants all the frames even if he has a playback-gif...
	 */
	public PImage[] getPImages() {
		return frames;
	}

	/*
	 * creates a GifDecoder object and loads a gif file
	 */
	private static GifDecoder createDecoder(PApplet parent, String filename) {
		GifDecoder gifDecoder = new GifDecoder();
		gifDecoder.read(createInputStream(parent, filename));
		return gifDecoder;
	}

	/*
	 * creates a PImage-array of gif frames in a GifDecoder object
	 */
	private static PImage[] extractFrames(GifDecoder gifDecoder) {
		int n = gifDecoder.getFrameCount();

		PImage[] frames = new PImage[n];

		for (int i = 0; i < n; i++) {
			BufferedImage frame = gifDecoder.getFrame(i);
			frames[i] = new PImage(frame.getWidth(), frame.getHeight(), ARGB);
			System.arraycopy(frame.getRGB(0, 0, frame.getWidth(), frame
					.getHeight(), null, 0, frame.getWidth()), 0,
					frames[i].pixels, 0, frame.getWidth() * frame.getHeight());
		}
		return frames;
	}

	/*
	 * creates an int-array of frame delays in the gifDecoder object
	 */
	private static int[] extractDelays(GifDecoder gifDecoder) {
		int n = gifDecoder.getFrameCount();
		int[] delays = new int[n];
		for (int i = 0; i < n; i++) {
			delays[i] = gifDecoder.getDelay(i); // display duration of frame in
			// milliseconds
		}
		return delays;
	}

	/*
	 * Can be called to ignore the repeat-count set in the gif-file. this does
	 * not affect loop()/noLoop() settings.
	 */
	public void ignoreRepeat() {
		ignoreRepeatSetting = true;
	}

	/*
	 * returns the number of repeats that is specified in the gif-file 0 means
	 * repeat forever
	 */
	public int getRepeat() {
		return repeatSetting;
	}

	/*
	 * returns true if this GIF object is playing
	 */
	public boolean isPlaying() {
		return play;
	}

	/*
	 * returns the current frame number
	 */
	public int currentFrame() {
		return currentFrame;
	}

	/*
	 * returns true if the animation is set to loop
	 */
	public boolean isLooping() {
		return loop;
	}

	/*
	 * returns true if this animation is set to ignore the file's repeat setting
	 */
	public boolean isIgnoringRepeat() {
		return ignoreRepeatSetting;
	}

	/*
	 * returns the version of the library
	 */
	public static String version() {
		return version;
	}

	/*
	 * following methods mimic the behaviour of processing's movie class.
	 */

	/**
	 * Begin playing the animation, with no repeat.
	 */
	public void play() {
		play = true;
		if (!ignoreRepeatSetting) {
			repeatCount = 0;
		}
	}

	/**
	 * Begin playing the animation, with repeat.
	 */
	public void loop() {
		play = true;
		loop = true;
	}

	/**
	 * Shut off the repeating loop.
	 */
	public void noLoop() {
		loop = false;
	}

	/**
	 * Pause the animation at its current frame.
	 */
	public void pause() {
		// System.out.println("pause");
		play = false;
	}

	/**
	 * Stop the animation, and rewind.
	 */
	public void stop() {
		//System.out.println("stop");
		play = false;
		currentFrame = 0;
		repeatCount = 0;
	}

	/**
	 * Jump to a specific location (in frames). if the frame does not exist, go
	 * to last frame
	 * @param where : file location (in sketch)
	 */
	public void jump(int where) {
		if (frames.length > where) {
			currentFrame = where;

			// update the pixel-array
			loadPixels();
			System.arraycopy(frames[currentFrame].pixels, 0, pixels, 0, width
					* height);
			updatePixels();

			// set the jump time
			lastJumpTime = parent.millis();
		}
	}

}


text:
cordova.define("cordova-plugin-device-orientation.CompassProxy", function(require, exports, module) {

var Compass = {
    getHeading: function(success, error) {
        var listener = function() {
            var orient = {};
            var heading = (Math.round((Math.random() * 360) * 100) / 100);

            orient.trueHeading = heading;
            orient.magneticHeading = heading;
            orient.headingAccuracy = 0;
            orient.timestamp = new Date().getTime();

            success(orient);

            window.removeEventListener('deviceorientation', listener, false);
        };

        return window.addEventListener('deviceorientation', listener, false);
    }
};

module.exports = Compass;
require('cordova/exec/proxy').add('Compass', Compass);

});


text:
var rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;

var SPECIAL_CHARS_REGEXP = /([\:\-\_]+(.))/g;
var MOZ_HACK_REGEXP = /^moz([A-Z])/;

export function titleCase(string) {

    return string.charAt(0).toUpperCase() + string.slice(1);
}

export function camelCase(name) {
    return name.
    replace(SPECIAL_CHARS_REGEXP,function (_, separator, letter, offset) {
        return offset ? letter.toUpperCase() : letter;
    }).
    replace(MOZ_HACK_REGEXP, 'Moz$1');
}

export function trim( text ) {
    return text == null ?
        "" :
        ( text + "" ).replace( rtrim, "" );
}


text: echo "Successfully executed testrun.sh"


text:
import { Pipe, PipeTransform } from '@angular/core';

import { AlbumNameTitlePair } from '../model/image-info';

/**
 * A pipe used to format the album data attached to an image into a presentable
 * form to dislay to the user
 */
@Pipe({
  name: 'galleryFormat'
})
export class GalleryFormatPipe implements PipeTransform {
  /**
   * Transform a colection of {@link AlbumNameTitlePair} into a comma separated
   * string of album titles
   */
  transform(value: AlbumNameTitlePair[], args?: any): any {
    if (value.length === 0) {
      return 'None';
    }

    const galleryTitles = value.map((obj: AlbumNameTitlePair) => {
      return obj.title;
    });

    return galleryTitles.join(', ');
  }
}


text:
@implementation NSManagedObjectContext (MagicalSaves)

- (void)MR_saveOnlySelfWithCompletion:(MRSaveCompletionHandler)completion;
{
    [self MR_saveWithOptions:0 completion:completion];
}

- (void)MR_saveOnlySelfAndWait;
{
    [self MR_saveWithOptions:MRSaveSynchronously completion:nil];
}

- (void) MR_saveToPersistentStoreWithCompletion:(MRSaveCompletionHandler)completion;
{
    [self MR_saveWithOptions:MRSaveParentContexts completion:completion];
}

- (void) MR_saveToPersistentStoreAndWait;
{
    [self MR_saveWithOptions:MRSaveParentContexts | MRSaveSynchronously completion:nil];
    //[self MR_saveWithOptions:MRSaveParentContexts completion:nil];
}

- (void)MR_saveWithOptions:(MRSaveContextOptions)mask completion:(MRSaveCompletionHandler)completion;
{
    BOOL syncSave           = ((mask & MRSaveSynchronously) == MRSaveSynchronously);
    BOOL saveParentContexts = ((mask & MRSaveParentContexts) == MRSaveParentContexts);

    if (![self hasChanges]) {
        MRLog(@"NO CHANGES IN ** %@ ** CONTEXT - NOT SAVING", [self MR_workingName]);

        if (completion)
        {
            dispatch_async(dispatch_get_main_queue(), ^{
                completion(NO, nil);
            });
        }

        return;
    }

    MRLog(@"→ Saving %@", [self MR_description]);
    MRLog(@"→ Save Parents? %@", @(saveParentContexts));
    MRLog(@"→ Save Synchronously? %@", @(syncSave));

    id saveBlock = ^{
        NSError *error = nil;
        BOOL     saved = NO;

        @try
        {
            saved = [self save:&error];
        }
        @catch(NSException *exception)
        {
            MRLog(@"Unable to perform save: %@", (id)[exception userInfo] ? : (id)[exception reason]);
        }

        @finally
        {
            if (!saved) {
                [MagicalRecord handleErrors:error];

                if (completion) {
                    dispatch_async(dispatch_get_main_queue(), ^{
                        completion(saved, error);
                    });
                }
            } else {
                // If we're the default context, save to disk too (the user expects it to persist)
                BOOL isDefaultContext = (self == [[self class] MR_defaultContext]);
                BOOL shouldSaveParentContext = ((YES == saveParentContexts) || isDefaultContext);

                if (shouldSaveParentContext && [self parentContext]) {
                    [[self parentContext] MR_saveWithOptions:mask completion:completion];
                }
                // If we should not save the parent context, or there is not a parent context to save (root context), call the completion block
                else {
                    MRLog(@"→ Finished saving: %@", [self MR_description]);

                    if (completion) {
                        dispatch_async(dispatch_get_main_queue(), ^{
                            completion(saved, error);
                        });
                    }
                }
            }
        }
    };

    if (YES == syncSave) {
        [self performBlockAndWait:saveBlock];
    } else {
        [self performBlock:saveBlock];
    }
}

#pragma mark - Deprecated methods
// These methods will be removed in MagicalRecord 3.0

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-implementations"

- (void)MR_save;
{
    [self MR_saveToPersistentStoreAndWait];
}

- (void)MR_saveWithErrorCallback:(void (^)(NSError *error))errorCallback;
{
    [self MR_saveWithOptions:MRSaveSynchronously|MRSaveParentContexts completion:^(BOOL success, NSError *error) {
        if (!success) {
            if (errorCallback) {
                errorCallback(error);
            }
        }
    }];
}

- (void)MR_saveInBackgroundCompletion:(void (^)(void))completion;
{
    [self MR_saveOnlySelfWithCompletion:^(BOOL success, NSError *error) {
        if (success) {
            if (completion) {
                completion();
            }
        }
    }];
}

- (void)MR_saveInBackgroundErrorHandler:(void (^)(NSError *error))errorCallback;
{
    [self MR_saveOnlySelfWithCompletion:^(BOOL success, NSError *error) {
        if (!success) {
            if (errorCallback) {
                errorCallback(error);
            }
        }
    }];
}

- (void)MR_saveInBackgroundErrorHandler:(void (^)(NSError *error))errorCallback completion:(void (^)(void))completion;
{
    [self MR_saveOnlySelfWithCompletion:^(BOOL success, NSError *error) {
        if (success) {
            if (completion) {
                completion();
            }
        } else {
            if (errorCallback) {
                errorCallback(error);
            }
        }
    }];
}

- (void)MR_saveNestedContexts;
{
    [self MR_saveToPersistentStoreWithCompletion:nil];
}

- (void)MR_saveNestedContextsErrorHandler:(void (^)(NSError *error))errorCallback;
{
    [self MR_saveToPersistentStoreWithCompletion:^(BOOL success, NSError *error) {
        if (!success) {
            if (errorCallback) {
                errorCallback(error);
            }
        }
    }];
}

- (void)MR_saveNestedContextsErrorHandler:(void (^)(NSError *error))errorCallback completion:(void (^)(void))completion;
{
    [self MR_saveToPersistentStoreWithCompletion:^(BOOL success, NSError *error) {
        if (success) {
            if (completion) {
                completion();
            }
        } else {
            if (errorCallback) {
                errorCallback(error);
            }
        }
    }];
}

#pragma clang diagnostic pop // ignored "-Wdeprecated-implementations"

@end


text:
<refentry xmlns:src="http://nwalsh.com/xmlns/litprog/fragment"
          xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
          id="toc.list.type">
<refmeta>
<refentrytitle>toc.list.type</refentrytitle>
<refmiscinfo role="type">list</refmiscinfo>
<refmiscinfo role="value">dl</refmiscinfo>
<refmiscinfo role="value">ul</refmiscinfo>
<refmiscinfo role="value">ol</refmiscinfo>
</refmeta>
<refnamediv>
<refname>toc.list.type</refname>
<refpurpose>Type of HTML list element to use for Tables of Contents</refpurpose>
</refnamediv>

<refsynopsisdiv>
<src:fragment id='toc.list.type.frag'><xsl:param name="toc.list.type">dl</xsl:param></src:fragment>
</refsynopsisdiv>

<refsect1><title>Description</title>

<para>When an automatically generated Table of Contents (or List of Titles)
is produced, this HTML element will be used to make the list.
</para>

</refsect1>
</refentry>


text:
package edu.usc.lunchnlearn.springmvc.tags;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;

/**
 * EL Custom tag class that handles URL encoding.
 *
 * @author wendel fleming
 *
 */
public class StringUtilities {

    private StringUtilities() {
        //hide the constructor since static class.
    }

    /**
     * encoded url in utf-8 format
     *
     * @param input
     * @return encoded string
     */
    public static String encodeUrl(String input) {
        String out = null;
        try {
            if (input != null) {
                out = URLEncoder.encode(input, "utf-8");
            }
        }
        catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        return out;
    }

}


text:
#include "telescope/oskar_telescope.h"

#ifdef __cplusplus
extern "C" {
#endif

void oskar_telescope_load_station_coords_wgs84(oskar_Telescope* telescope,
        const char* filename, double longitude, double latitude,
        double altitude, int* status)
{
    int num_stations = 0;
    oskar_Mem *lon_deg = 0, *lat_deg = 0, *alt_m = 0;

    /* Load columns from file into memory. */
    lon_deg = oskar_mem_create(OSKAR_DOUBLE, OSKAR_CPU, 0, status);
    lat_deg = oskar_mem_create(OSKAR_DOUBLE, OSKAR_CPU, 0, status);
    alt_m   = oskar_mem_create(OSKAR_DOUBLE, OSKAR_CPU, 0, status);
    num_stations = (int) oskar_mem_load_ascii(filename, 3, status,
            lon_deg, "", lat_deg, "", alt_m, "0.0");

    /* Set the station coordinates. */
    oskar_telescope_set_station_coords_wgs84(telescope, longitude, latitude,
            altitude, num_stations, lon_deg, lat_deg, alt_m, status);

    /* Free memory. */
    oskar_mem_free(lon_deg, status);
    oskar_mem_free(lat_deg, status);
    oskar_mem_free(alt_m, status);
}

#ifdef __cplusplus
}
#endif


text:
void* hash_new();

void hash_print(void* data);

void hash_free(void* data);

#endif


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Fungi Parm. Sept. no. 141 (1879)

#### Original name
Septoria macropoda var. macropoda

### Remarks
null


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

namespace PhantomNet.Entities
{
    public static class NameBasedEntityValidatorExtensions
    {
        public static async Task ValidateNameAsync<TEntity, TEntityManager, TEntityAccessor>(
            this IEntityValidator<TEntity> validator,
            TEntityManager manager, TEntityAccessor entityAccessor, TEntity entity, List<GenericError> errors,
            Func<string, GenericError> invalidName, Func<string, GenericError> duplicateName)
            where TEntity: class
            where TEntityManager : class, INameBasedEntityManager<TEntity>
            where TEntityAccessor : IEntityAccessor<TEntity>,
                                    INameBasedEntityAccessor<TEntity>
        {
            var name = entityAccessor.GetName(entity);
            if (string.IsNullOrWhiteSpace(name))
            {
                errors.Add(invalidName(name));
            }
            else
            {
                var owner = await manager.FindByNameAsync(name);
                if (owner != null &&
                    !string.Equals(entityAccessor.GetId(owner), entityAccessor.GetId(entity)))
                {
                    errors.Add(duplicateName(name));
                }
            }
        }
    }
}