text:
@echo on

set framework=v4.0.30319
set src=%~dp0src\

"%src%.nuget\nuget.exe" restore %src%

"%SystemDrive%\Windows\Microsoft.NET\Framework\%framework%\MSBuild.exe" "%src%GitVersion.sln"

rmdir /s /q "%tmp%GitVersion"
md "%tmp%GitVersion"

xcopy /E "%~dp0build\NuGetCommandLineBuild\tools" "%tmp%GitVersion"

"%tmp%GitVersion\GitVersion.exe" /l console /output buildserver /updateAssemblyInfo /proj "%src%GitVersion.sln"

rmdir /s /q "%tmp%GitVersion"

redpajama_set_name: RedPajamaGithub


text:
var Debug = require('debug'),
mdns = require('mdns'),
events = require('events'),
util = require('util'),
STDevice = require('./device');

var debug = Debug('deviceScanner');

if (!Array.prototype.removeAll) {
	Array.prototype.removeAll = function(key){
		var index = this.indexOf(key);
		if(index === -1) return;
		this.splice(index, 1);
		this.removeAll(key);
	}
}

function STDeviceScanner() {
	events.EventEmitter.call(this);
}
util.inherits(STDeviceScanner, events.EventEmitter);

STDeviceScanner.prototype.start = function start() {
	var _instance = this;
	var browser = mdns.createBrowser(mdns.tcp('soundtouch'));

	browser.on('serviceUp', function(service) {
		debug('found new device %s (%s)', service.name, service.addresses[0]);
		var newDevice = new STDevice(service.addresses[0]);
		_instance.emit('deviceFound', newDevice);
	});
	browser.on('serviceDown', function(service) {
		_instance.emit('deviceLost', service.addresses[0]);
	});
	debug('starting scanning');
	browser.start();
}

STDeviceScanner.prototype.stop = function stop() {
	debug('stopping scanning');
	browser.stop();
}
module.exports = STDeviceScanner;


text:
<?php get_header(); ?>

					<?php if(have_posts()) : ?>

<?php _e('Search Results for ', 'adaptive_framework'); ?><?php echo get_search_query();  ?>

						<?php while (have_posts()) : the_post();    ?>

									<?php get_template_part('content' , get_post_format( ));    ?>

						<?php endwhile; else:   ?>

<?php _e('No Results found matching your query', 'adaptive_framework');   ?>

						<?php endif; ?>

<?php next_posts_link(__('← Older Posts','adaptive_framework' )); ?>

<?php previous_posts_link(__(' Newer Posts →','adaptive_framework' )); ?>

						<?php get_sidebar( ); ?>

		<?php get_footer(); ?>


text:
<TITLE>Review for Deterrence (1999)</TITLE>
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/ramr.css">

Deterrence (1999)

reviewed by
Ross Anthony

The Bomb
Deterrence

By Ross Anthony

Unelected President Emerson (Kevin Pollak) and entourage are snowed into a
small town greasy spoon someplace in Colorado somewhere around the year 2008
and a few minutes after Hussein's son decides to blow away the handful of US
peacekeeping troops in Iraq and reinvade Kuwait.

With Timothy Hutton as the president's right hand adviser (and old college
buddy), and Sheryl Lee Ralph as military adviser; Pollak isn't interested in
playing games with this foreign aggression. Remembering Bush's little
escapade with that pesky older Hussein, Pollak cracks, "I'm not gonna just
drop a couple of Tomahawks on Iraq and say 'How do you like dem apples?'"

IBS (the CNN of the future) cut-always fill us (the audience) in on this
president's less than presidential appearance and demeanor at the
culmination of his election campaign. Perhaps motivated by a hidden agenda
or maybe because he's seeking to blow apart his "very second banana" aura,
Pollak plays tough and threatens to drop the big one on Baghdad.

>From there, the film plays like the 60's thriller "Fail Safe" where Henry
Fonda negotiates with the Russian president via telephone while one of our
accidentally launched warheads cruises toward Moscow. That, by the way, is a
pretty good film and similarly thought provoking.

"Deterrence" is a little rough in the launch. In fact, you might suspect the
whole invasion thing to be a hoax (a la, "Wag the Dog"), however, soon
enough the slack in the rope tightens, pulling you in as it holds you tense.
And even though the production never leaves that little diner, the strategic
political and military scenarios, personalities, ethics and personal beliefs
let fly like warheads from around the globe and entangle in a drama rich
enough to fill the screen. Will he really release the first nuke in 60 years
"wiping out a civilization where civilization began?" And if so will the
pilots of that unlucky B2 lose their nerve? "More men have walked the moon
than have done what we're about to do," they reveal to the president over an
unsecured phone-line into the diner, "I guess that's why we get the big
bucks."

Ironically the entertainment arc of this film follows that of a launched
missile. Discussing the ending would defuse the picture, let's just say that
I preferred the over all message of "Fail Safe" to my interpretation of
"Deterrence." But as writer/director Rod Lurie asserts, this is a film open
to many interpretations of which his and mine are only two.

Deterrence. Copyright © 2000.
Starring Kevin Pollak, Timothy Hutton, Sheryl Lee Ralph, Sean Astin, Bajda
Djola, Mark Thompson, Michael Mantell, Kathryn Morris, Clotilde Courau, and
Ryan Cutrona
Writer/Director Rod Lurie.
Produced by Marc Frydman and James Spies at Paramount Classics.

Grade..........................B

--
Copyright © 2000. Ross Anthony, currently based in Los Angeles, has scripted
and shot documentaries, music videos, and shorts in 35 countries across
North America, Europe, Africa and Asia. For more reviews visit:
http://RossAnthony.com

The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).

The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.

Please direct comments/criticisms of the review to relevant newsgroups.

Broken URLs inthe reviews are the responsibility of the author.

The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.

Related links: index of all rec.arts.movies.reviews reviews


text:
/*H**********************************************************************
* FILENAME :        cosim_types.h
*
* DESCRIPTION :
*       Types and defines
*                needed for co-simulation between CLaSH and a (Verilog) simulator
*
*
* AUTHOR  :    John Verheij        DATE :    August 14, 2016
*
*
*H*/

/* Guard */
#ifndef COSIM_TYPES_H_
#define COSIM_TYPES_H_

/* Include */
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include "../comm/cosim_comm.h"

struct coSimFiles
{
    char *fileName;
    struct coSimFiles *next;
};

/* Struct used for every co-simulation step */
struct coSimState {

    /* communication */
    struct CoSimComm *comm;

    /* for receiving messages from simulator */
    char strR[MAX_BUF+1];

    /* no of reset cycles often 0 or 1 */
    int reset;

    /* number of input and output ports */
    int noInput;
    int noOutput;

    /* bit-sizes */
    int *inputSizes;
    int *outputSizes;

    /* input and outputs */
    int **input;
    int **output;

    /* file-names */
    int noFiles;
    char **fileNames;
};

/* get number of input values */
int getInputLength(struct coSimState *state);

/* get number of output values */
int getOutputLength(struct coSimState *state);

/* get number of bit for every input value */
int* getInputSizes(struct coSimState *state);

/* get number of bit for every output value */
int* getOutputSizes(struct coSimState *state);

/* get pointer to input-values-array */
int** getInputPtr(struct coSimState *state);

/* get pointer to output-values-array */
int** getOutputPtr(struct coSimState *state);

struct coSimState *createCoSimState(void);

/* dispose an array of int-pointers */
void disposeIntPointers(int ***array, int length);

/* dispose an array of string-pointers */
void disposeStringPointers(char ***array, int length);

/* dispose an array of string-pointers */
void disposeStringPointers_(char ***array);

void disposeFileNames(struct coSimFiles **files);

/* dispose the struct "CoSim_State" */
void disposeCoSimState(struct coSimState **state);

#endif


text:
<?php
 $connect = mysqli_connect("localhost", "root", "admin") or
die("Please, check your server connection.");
 $query = "SELECT email_address, password, complete_name FROM customers
WHERE email_address like '" . $_POST['emailaddress'] . "' " .
 "AND password like (PASSWORD('" . $_POST['password'] . "'))";
 $result = mysqli_query($connect, $query) or die(mysql_error());
 if (mysqli_num_rows($result) == 1) {
 while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) {
 extract($row);
 echo "Welcome " . $complete_name . " to our Shopping Mall
";
 }
 }
 else {
?>
 Invalid Email address and/or Password

 Not registered?
 Click here to register.

 Want to Try again

 Click here to try login again.

 <?php
 }
?>


text:
@extends('dashboard')
@section('main')

<?php
$individual= User::find(Auth::user()->id);

//$individual=Individual::account()->find($account->id);
?>
<h1 class="page-title"User Account

Basic Information

<?php
//checking if link is comming from changing password route
if(isset($_GET['password'])){
?>

<?php
}
?>

Profile

Change Password

@if(Session::has('message'))

{{Session::get('message')}}

			@endif
<form id="edit-profile" method ="POST" enctype="multipart/form-data" action="{{URL::to('reception/profile/'. Auth::user()->id)}}">
<fieldset>

	@if($individual->profile_pic=="")
	{{HTML::image("http://placehold.it/120x100","", array('class'=>'img-rounded'))}}
	@else
	{{HTML::image("uploads/profiles/{$individual->profile_pic}","",array('class'=>'img-rounded thumbnail', 'style'=>'height:120px;width:100px'))}}
	@endif
	<?php echo "  " . $individual->username ?>

Username

<input type="text" class="input-xlarge" id="username" name= "username"value="{{ $individual->username }}" >

First Name

<input type="text" class="input-xlarge" id="firstname" name="firstname" value="{{ $individual->first_name }}">

Middle Name

<input type="text" class="input-xlarge" id="firstname" name ="middlename"value="{{ $individual->middle_name }}">

Last Name

<input type="text" class="input-xlarge" id="lastname" name = "lastname"value="{{ $individual->last_name }}">

	Image{{Form::file('img',array('class'=>'')) }}

<button type="submit" class="btn">Update</button>

</fieldset>
</form>

@if(Session::has('message'))

{{Session::get('message')}}

			@endif
<form class="form-horizontal" id="password_form" action="{{URL::to('reception/profile/password/'. Auth::user()->id)}}" method="POST">

Current Password*

<input type="password" class="input-xlarge" id="password1" name = "Old_password" value="">
@if($errors->has('Old_password'))
{{$errors->first('Old_password')}}
@endif

New Password*

<input type="password" class="input-xlarge" id="password1" name = "New_password" value="">
@if($errors->has('New_password'))
{{$errors->first('New_password')}}
@endif

Confirm Password*

<input type="password" class="input-xlarge" id="password2" name = "Confirm_password" value="">
@if($errors->has('Confirm_password'))
{{$errors->first('confirm_password')}}
@endif

<button type="reset" class="btn">Cancel</button>
<button type="submit" class="btn btn-primary">Reset</button>

</form>

@stop


text:
from BitTornado.CurrentRateMeasure import Measure
from BitTornado.bitfield import Bitfield
from random import shuffle
from BitTornado.clock import clock
try:
    True
except:
    True = 1
    False = 0

EXPIRE_TIME = 60 * 60

class PerIPStats:
    def __init__(self, ip):
        self.numgood = 0
        self.bad = {}
        self.numconnections = 0
        self.lastdownload = None
        self.peerid = None

class BadDataGuard:
    def __init__(self, download):
        self.download = download
        self.ip = download.ip
        self.downloader = download.downloader
        self.stats = self.downloader.perip[self.ip]
        self.lastindex = None

    def failed(self, index, bump = False):
        self.stats.bad.setdefault(index, 0)
        self.downloader.gotbaddata[self.ip] = 1
        self.stats.bad[index] += 1
        if len(self.stats.bad) > 1:
            if self.download is not None:
                self.downloader.try_kick(self.download)
            elif self.stats.numconnections == 1 and self.stats.lastdownload is not None:
                self.downloader.try_kick(self.stats.lastdownload)
        if len(self.stats.bad) >= 3 and len(self.stats.bad) > int(self.stats.numgood/30):
            self.downloader.try_ban(self.ip)
        elif bump:
            self.downloader.picker.bump(index)

    def good(self, index):
        # lastindex is a hack to only increase numgood by one for each good
        # piece, however many chunks come from the connection(s) from this IP
        if index != self.lastindex:
            self.stats.numgood += 1
            self.lastindex = index

class SingleDownload:
    def __init__(self, downloader, connection):
        self.downloader = downloader
        self.connection = connection
        self.choked = True
        self.interested = False
        self.active_requests = []
        self.measure = Measure(downloader.max_rate_period)
        self.peermeasure = Measure(downloader.max_rate_period)
        self.have = Bitfield(downloader.numpieces)
        self.last = -1000
        self.last2 = -1000
        self.example_interest = None
        self.backlog = 2
        self.ip = connection.get_ip()
        self.guard = BadDataGuard(self)

    def _backlog(self, just_unchoked):
        self.backlog = min(
            2+int(4*self.measure.get_rate()/self.downloader.chunksize),
            (2*just_unchoked)+self.downloader.queue_limit() )
        if self.backlog > 50:
            self.backlog = max(50, self.backlog * 0.075)
        return self.backlog

    def disconnected(self):
        self.downloader.lost_peer(self)
        if self.have.complete():
            self.downloader.picker.lost_seed()
        else:
            for i in xrange(len(self.have)):
                if self.have[i]:
                    self.downloader.picker.lost_have(i)
        if self.have.complete() and self.downloader.storage.is_endgame():
            self.downloader.add_disconnected_seed(self.connection.get_readable_id())
        self._letgo()
        self.guard.download = None

    def _letgo(self):
        if self.downloader.queued_out.has_key(self):
            del self.downloader.queued_out[self]
        if not self.active_requests:
            return
        if self.downloader.endgamemode:
            self.active_requests = []
            return
        lost = {}
        for index, begin, length in self.active_requests:
            self.downloader.storage.request_lost(index, begin, length)
            lost[index] = 1
        lost = lost.keys()
        self.active_requests = []
        if self.downloader.paused:
            return
        ds = [d for d in self.downloader.downloads if not d.choked]
        shuffle(ds)
        for d in ds:
            d._request_more()
        for d in self.downloader.downloads:
            if d.choked and not d.interested:
                for l in lost:
                    if d.have[l] and self.downloader.storage.do_I_have_requests(l):
                        d.send_interested()
                        break

    def got_choke(self):
        if not self.choked:
            self.choked = True
            self._letgo()

    def got_unchoke(self):
        if self.choked:
            self.choked = False
            if self.interested:
                self._request_more(new_unchoke = True)
            self.last2 = clock()

    def is_choked(self):
        return self.choked

    def is_interested(self):
        return self.interested

    def send_interested(self):
        if not self.interested:
            self.interested = True
            self.connection.send_interested()
            if not self.choked:
                self.last2 = clock()

    def send_not_interested(self):
        if self.interested:
            self.interested = False
            self.connection.send_not_interested()

    def got_piece(self, index, begin, piece):
        length = len(piece)
        try:
            self.active_requests.remove((index, begin, length))
        except ValueError:
            self.downloader.discarded += length
            return False
        if self.downloader.endgamemode:
            self.downloader.all_requests.remove((index, begin, length))
        self.last = clock()
        self.last2 = clock()
        self.measure.update_rate(length)
        self.downloader.measurefunc(length)
        if not self.downloader.storage.piece_came_in(index, begin, piece, self.guard):
            self.downloader.piece_flunked(index)
            return False
        if self.downloader.storage.do_I_have(index):
            self.downloader.picker.complete(index)
        if self.downloader.endgamemode:
            for d in self.downloader.downloads:
                if d is not self:
                  if d.interested:
                    if d.choked:
                        assert not d.active_requests
                        d.fix_download_endgame()
                    else:
                        try:
                            d.active_requests.remove((index, begin, length))
                        except ValueError:
                            continue
                        d.connection.send_cancel(index, begin, length)
                        d.fix_download_endgame()
                  else:
                      assert not d.active_requests
        self._request_more()
        self.downloader.check_complete(index)
        return self.downloader.storage.do_I_have(index)

    def _request_more(self, new_unchoke = False):
        assert not self.choked
        if self.downloader.endgamemode:
            self.fix_download_endgame(new_unchoke)
            return
        if self.downloader.paused:
            return
        if len(self.active_requests) >= self._backlog(new_unchoke):
            if not (self.active_requests or self.backlog):
                self.downloader.queued_out[self] = 1
            return
        lost_interests = []
        while len(self.active_requests) < self.backlog:
            interest = self.downloader.picker.next(self.have,
                               self.downloader.storage.do_I_have_requests,
                               self.downloader.too_many_partials())
            if interest is None:
                break
            self.example_interest = interest
            self.send_interested()
            loop = True
            while len(self.active_requests) < self.backlog and loop:
                begin, length = self.downloader.storage.new_request(interest)
                self.downloader.picker.requested(interest)
                self.active_requests.append((interest, begin, length))
                self.connection.send_request(interest, begin, length)
                self.downloader.chunk_requested(length)
                if not self.downloader.storage.do_I_have_requests(interest):
                    loop = False
                    lost_interests.append(interest)
        if not self.active_requests:
            self.send_not_interested()
        if lost_interests:
            for d in self.downloader.downloads:
                if d.active_requests or not d.interested:
                    continue
                if d.example_interest is not None and self.downloader.storage.do_I_have_requests(d.example_interest):
                    continue
                for lost in lost_interests:
                    if d.have[lost]:
                        break
                else:
                    continue
                interest = self.downloader.picker.next(d.have,
                                   self.downloader.storage.do_I_have_requests,
                                   self.downloader.too_many_partials())
                if interest is None:
                    d.send_not_interested()
                else:
                    d.example_interest = interest
        if self.downloader.storage.is_endgame():
            self.downloader.start_endgame()

    def fix_download_endgame(self, new_unchoke = False):
        if self.downloader.paused:
            return
        if len(self.active_requests) >= self._backlog(new_unchoke):
            if not (self.active_requests or self.backlog) and not self.choked:
                self.downloader.queued_out[self] = 1
            return
        want = [a for a in self.downloader.all_requests if self.have[a[0]] and a not in self.active_requests]
        if not (self.active_requests or want):
            self.send_not_interested()
            return
        if want:
            self.send_interested()
        if self.choked:
            return
        shuffle(want)
        del want[self.backlog - len(self.active_requests):]
        self.active_requests.extend(want)
        for piece, begin, length in want:
            self.connection.send_request(piece, begin, length)
            self.downloader.chunk_requested(length)

    def got_have(self, index):
        if index == self.downloader.numpieces-1:
            self.downloader.totalmeasure.update_rate(self.downloader.storage.total_length-(self.downloader.numpieces-1)*self.downloader.storage.piece_length)
            self.peermeasure.update_rate(self.downloader.storage.total_length-(self.downloader.numpieces-1)*self.downloader.storage.piece_length)
        else:
            self.downloader.totalmeasure.update_rate(self.downloader.storage.piece_length)
            self.peermeasure.update_rate(self.downloader.storage.piece_length)
        if not self.have[index]:
            self.have[index] = True
            self.downloader.picker.got_have(index)
            if self.have.complete():
                self.downloader.picker.became_seed()
                if self.downloader.storage.am_I_complete():
                    self.downloader.add_disconnected_seed(self.connection.get_readable_id())
                    self.connection.close()
            elif self.downloader.endgamemode:
                self.fix_download_endgame()
            elif ( not self.downloader.paused
                   and not self.downloader.picker.is_blocked(index)
                   and self.downloader.storage.do_I_have_requests(index) ):
                if not self.choked:
                    self._request_more()
                else:
                    self.send_interested()
        return self.have.complete()

    def _check_interests(self):
        if self.interested or self.downloader.paused:
            return
        for i in xrange(len(self.have)):
            if ( self.have[i] and not self.downloader.picker.is_blocked(i)
                 and ( self.downloader.endgamemode
                       or self.downloader.storage.do_I_have_requests(i) ) ):
                self.send_interested()
                return

    def got_have_bitfield(self, have):
        if self.downloader.storage.am_I_complete() and have.complete():
            if self.downloader.super_seeding:
                self.connection.send_bitfield(have.tostring()) # be nice, show you're a seed too
            self.connection.close()
            self.downloader.add_disconnected_seed(self.connection.get_readable_id())
            return False
        self.have = have
        if have.complete():
            self.downloader.picker.got_seed()
        else:
            for i in xrange(len(have)):
                if have[i]:
                    self.downloader.picker.got_have(i)
        if self.downloader.endgamemode and not self.downloader.paused:
            for piece, begin, length in self.downloader.all_requests:
                if self.have[piece]:
                    self.send_interested()
                    break
        else:
            self._check_interests()
        return have.complete()

    def get_rate(self):
        return self.measure.get_rate()

    def is_snubbed(self):
        if ( self.interested and not self.choked
             and clock() - self.last2 > self.downloader.snub_time ):
            for index, begin, length in self.active_requests:
                self.connection.send_cancel(index, begin, length)
            self.got_choke()    # treat it just like a choke
        return clock() - self.last > self.downloader.snub_time

class Downloader:
    def __init__(self, storage, picker, backlog, max_rate_period,
                 numpieces, chunksize, measurefunc, snub_time,
                 kickbans_ok, kickfunc, banfunc):
        self.storage = storage
        self.picker = picker
        self.backlog = backlog
        self.max_rate_period = max_rate_period
        self.measurefunc = measurefunc
        self.totalmeasure = Measure(max_rate_period*storage.piece_length/storage.request_size)
        self.numpieces = numpieces
        self.chunksize = chunksize
        self.snub_time = snub_time
        self.kickfunc = kickfunc
        self.banfunc = banfunc
        self.disconnectedseeds = {}
        self.downloads = []
        self.perip = {}
        self.gotbaddata = {}
        self.kicked = {}
        self.banned = {}
        self.kickbans_ok = kickbans_ok
        self.kickbans_halted = False
        self.super_seeding = False
        self.endgamemode = False
        self.endgame_queued_pieces = []
        self.all_requests = []
        self.discarded = 0L
#        self.download_rate = 25000  # 25K/s test rate
        self.download_rate = 0
        self.bytes_requested = 0
        self.last_time = clock()
        self.queued_out = {}
        self.requeueing = False
        self.paused = False

    def set_download_rate(self, rate):
        self.download_rate = rate * 1000
        self.bytes_requested = 0

    def queue_limit(self):
        if not self.download_rate:
            return 10e10    # that's a big queue!
        t = clock()
        self.bytes_requested -= (t - self.last_time) * self.download_rate
        self.last_time = t
        if not self.requeueing and self.queued_out and self.bytes_requested < 0:
            self.requeueing = True
            q = self.queued_out.keys()
            shuffle(q)
            self.queued_out = {}
            for d in q:
                d._request_more()
            self.requeueing = False
        if -self.bytes_requested > 5*self.download_rate:
            self.bytes_requested = -5*self.download_rate
        return max(int(-self.bytes_requested/self.chunksize),0)

    def chunk_requested(self, size):
        self.bytes_requested += size

    external_data_received = chunk_requested

    def make_download(self, connection):
        ip = connection.get_ip()
        if self.perip.has_key(ip):
            perip = self.perip[ip]
        else:
            perip = self.perip.setdefault(ip, PerIPStats(ip))
        perip.peerid = connection.get_readable_id()
        perip.numconnections += 1
        d = SingleDownload(self, connection)
        perip.lastdownload = d
        self.downloads.append(d)
        return d

    def piece_flunked(self, index):
        if self.paused:
            return
        if self.endgamemode:
            if self.downloads:
                while self.storage.do_I_have_requests(index):
                    nb, nl = self.storage.new_request(index)
                    self.all_requests.append((index, nb, nl))
                for d in self.downloads:
                    d.fix_download_endgame()
                return
            self._reset_endgame()
            return
        ds = [d for d in self.downloads if not d.choked]
        shuffle(ds)
        for d in ds:
            d._request_more()
        ds = [d for d in self.downloads if not d.interested and d.have[index]]
        for d in ds:
            d.example_interest = index
            d.send_interested()

    def has_downloaders(self):
        return len(self.downloads)

    def lost_peer(self, download):
        ip = download.ip
        self.perip[ip].numconnections -= 1
        if self.perip[ip].lastdownload == download:
            self.perip[ip].lastdownload = None
        self.downloads.remove(download)
        if self.endgamemode and not self.downloads: # all peers gone
            self._reset_endgame()

    def _reset_endgame(self):
        self.storage.reset_endgame(self.all_requests)
        self.endgamemode = False
        self.all_requests = []
        self.endgame_queued_pieces = []

    def add_disconnected_seed(self, id):
#        if not self.disconnectedseeds.has_key(id):
#            self.picker.seed_seen_recently()
        self.disconnectedseeds[id]=clock()

#	def expire_disconnected_seeds(self):

    def num_disconnected_seeds(self):
        # first expire old ones
        expired = []
        for id,t in self.disconnectedseeds.items():
            if clock() - t > EXPIRE_TIME:     #Expire old seeds after so long
                expired.append(id)
        for id in expired:
#            self.picker.seed_disappeared()
            del self.disconnectedseeds[id]
        return len(self.disconnectedseeds)
        # if this isn't called by a stats-gathering function
        # it should be scheduled to run every minute or two.

    def _check_kicks_ok(self):
        if len(self.gotbaddata) > 10:
            self.kickbans_ok = False
            self.kickbans_halted = True
        return self.kickbans_ok and len(self.downloads) > 2

    def try_kick(self, download):
        if self._check_kicks_ok():
            download.guard.download = None
            ip = download.ip
            id = download.connection.get_readable_id()
            self.kicked[ip] = id
            self.perip[ip].peerid = id
            self.kickfunc(download.connection)

    def try_ban(self, ip):
        if self._check_kicks_ok():
            self.banfunc(ip)
            self.banned[ip] = self.perip[ip].peerid
            if self.kicked.has_key(ip):
                del self.kicked[ip]

    def set_super_seed(self):
        self.super_seeding = True

    def check_complete(self, index):
        if self.endgamemode and not self.all_requests:
            self.endgamemode = False
        if self.endgame_queued_pieces and not self.endgamemode:
            self.requeue_piece_download()
        if self.storage.am_I_complete():
            assert not self.all_requests
            assert not self.endgamemode
            for d in [i for i in self.downloads if i.have.complete()]:
                d.connection.send_have(index)   # be nice, tell the other seed you completed
                self.add_disconnected_seed(d.connection.get_readable_id())
                d.connection.close()
            return True
        return False

    def too_many_partials(self):
        return len(self.storage.dirty) > (len(self.downloads)/2)

    def cancel_piece_download(self, pieces):
        if self.endgamemode:
            if self.endgame_queued_pieces:
                for piece in pieces:
                    try:
                        self.endgame_queued_pieces.remove(piece)
                    except:
                        pass
            new_all_requests = []
            for index, nb, nl in self.all_requests:
                if index in pieces:
                    self.storage.request_lost(index, nb, nl)
                else:
                    new_all_requests.append((index, nb, nl))
            self.all_requests = new_all_requests

        for d in self.downloads:
            hit = False
            for index, nb, nl in d.active_requests:
                if index in pieces:
                    hit = True
                    d.connection.send_cancel(index, nb, nl)
                    if not self.endgamemode:
                        self.storage.request_lost(index, nb, nl)
            if hit:
                d.active_requests = [ r for r in d.active_requests
                                      if r[0] not in pieces ]
                d._request_more()
            if not self.endgamemode and d.choked:
                d._check_interests()

    def requeue_piece_download(self, pieces = []):
        if self.endgame_queued_pieces:
            for piece in pieces:
                if not piece in self.endgame_queued_pieces:
                    self.endgame_queued_pieces.append(piece)
            pieces = self.endgame_queued_pieces
        if self.endgamemode:
            if self.all_requests:
                self.endgame_queued_pieces = pieces
                return
            self.endgamemode = False
            self.endgame_queued_pieces = None

        ds = [d for d in self.downloads]
        shuffle(ds)
        for d in ds:
            if d.choked:
                d._check_interests()
            else:
                d._request_more()

    def start_endgame(self):
        assert not self.endgamemode
        self.endgamemode = True
        assert not self.all_requests
        for d in self.downloads:
            if d.active_requests:
                assert d.interested and not d.choked
            for request in d.active_requests:
                assert not request in self.all_requests
                self.all_requests.append(request)
        for d in self.downloads:
            d.fix_download_endgame()

    def pause(self, flag):
        self.paused = flag
        if flag:
            for d in self.downloads:
                for index, begin, length in d.active_requests:
                    d.connection.send_cancel(index, begin, length)
                d._letgo()
                d.send_not_interested()
            if self.endgamemode:
                self._reset_endgame()
        else:
            shuffle(self.downloads)
            for d in self.downloads:
                d._check_interests()
                if d.interested and not d.choked:
                    d._request_more()


text:
ParentType = {

	name : "ParentType",

	public : {

		value : null,

		anotherValue : null

	},

	private : {

		valueChanged : function valueChanged(newValue) {
			// call the protected method
			this.protected.valueChanged(newValue);
		},

		anotherValueChanged : function valueChanged(newValue) {
			// call the protected method
			this.protected.anotherValueChanged(newValue);
		}
	},

	protected : {

		valueChanged : function valueChanged(newValue) {
			console.log("[protected] ParentType: value changed to " + newValue);
		},

		anotherValueChanged : function valueChanged(newValue) {
			//example of protected that is not implemented by the child type
			console.log("[protected implemented in ParentType]: value changed to " + newValue);
		},
	},

	init : function init() {
		console.log("ParentType init");
	},

	destroy : function destroy() {

	}
};


text:
"""
Test that classes for representing the adsws-api specific data structures
defined in core.py
"""
import json
import unittest
import requests
import os
from tempfile import NamedTemporaryFile

import ads.base
import ads.config
from ads.base import BaseQuery, APIResponse, RateLimits, _Singleton
from .mocks import MockApiResponse

@unittest.skip('deprecated by RateLimits class')
class TestApiResponse(unittest.TestCase):
    """
    test the base Api response class
    """
    def setUp(self):
        with MockApiResponse('http://api.unittest'):
            self.APIResponse = APIResponse()
            self.APIResponse.response = requests.get('http://api.unittest')

    def test_get_ratelimits(self):
        """
        the get_ratelimit method should return the X-RateLimit headers in
        a dictionary
        """
        limits = self.APIResponse.get_ratelimits()
        self.assertEqual(limits['limit'], '400')
        self.assertEqual(limits['remaining'], '397')
        self.assertEqual(limits['reset'], '1436313600')

class TestBaseQuery(unittest.TestCase):
    """
    Test the BaseQuery object
    """
    def test_token(self):
        """
        the token should be set in the following order:
        - (first in list) environmental variables defined in TOKEN_ENVIRON_VARS
        - (first in list) files on disk defined in TOKEN_FILES
        - ads.config.token
        """
        def reset_token():
            bq.token = None

        # In-place override of the config variables responsible for identifying
        # how to look for a token
        ads.base.TOKEN_ENVIRON_VARS = ['TOKEN_1', 'TOKEN_2']
        os.environ['TOKEN_1'] = "tok1"
        os.environ['TOKEN_2'] = "tok2"

        # Write temporary file and override the config variable with the
        # tempfile paths
        tf1, tf2 = NamedTemporaryFile(), NamedTemporaryFile()
        tf1.write('tok3\n'.encode("utf-8"))
        tf2.write(' tok4 '.encode("utf-8"))
        [f.flush() for f in [tf1, tf2]]
        [f.seek(0) for f in [tf1, tf2]]
        ads.base.TOKEN_FILES = [tf1.name, tf2.name]

        bq = BaseQuery()

        self.assertEqual(bq.token, 'tok1')
        reset_token()
        del os.environ['TOKEN_1']

        self.assertEqual(bq.token, 'tok2')
        reset_token()
        del os.environ['TOKEN_2']

        self.assertEqual(bq.token, 'tok3')
        reset_token()
        tf1.close()

        self.assertEqual(bq.token, 'tok4')
        reset_token()
        tf2.close()

        self.assertEqual(bq.token, None)

        ads.config.token = "tok5"
        self.assertEqual(BaseQuery().token, "tok5")

    def test_headers(self):
        """
        basequery's session object should have pre-defined headers
        """
        hdrs = BaseQuery().session.headers
        self.assertEqual(hdrs['Content-Type'], 'application/json')
        self.assertIn('ads-api-client', hdrs['User-Agent'])
        self.assertIn('Bearer', hdrs['Authorization'])

class TestRateLimits(unittest.TestCase):
    """
    Test rate limits
    """

    def setUp(self):
        class FakeResponse(APIResponse):
            def __init__(self, http_response):
                pass

        self.FakeResponse = FakeResponse
        _Singleton._instances = {}

        MockApiResponse.remaining = 398

    def test_get_ratelimits(self):
        """
        Test the two ways in which someone can access the rate limits via
        the RateLimit singleton class. Via an instantiation of the relevant
        query class, or the response object.
        """

        with MockApiResponse('http://api.unittest'):
            r1 = self.FakeResponse.load_http_response(
                requests.get('http://api.unittest')
            )

        # Via the singleton
        limits = RateLimits('FakeResponse').to_dict()
        self.assertEqual(limits['limit'], '400')
        self.assertEqual(limits['remaining'], '397')
        self.assertEqual(limits['reset'], '1436313600')

        # Via the response object
        limits = r1.get_ratelimits()
        self.assertEqual(limits['limit'], '400')
        self.assertEqual(limits['remaining'], '397')
        self.assertEqual(limits['reset'], '1436313600')

        with MockApiResponse('http://api.unittest'):
            r2 = self.FakeResponse.load_http_response(
                requests.get('http://api.unittest')
            )

        # Check all response objects get most up-to-date information
        limits = r1.get_ratelimits()
        self.assertEqual(limits['limit'], '400')
        self.assertEqual(limits['remaining'], '396')
        self.assertEqual(limits['reset'], '1436313600')

        self.assertEqual(
            r1.get_ratelimits(),
            r2.get_ratelimits()
        )

        self.assertEqual(
            r1.get_ratelimits(),
            RateLimits('FakeResponse').to_dict()
        )

    def test_singleton(self):
        """
        Test singleton behaves as expected
        """
        sq1 = RateLimits('SolrResponse')
        sq2 = RateLimits('SolrResponse')

        self.assertEqual(id(sq1), id(sq2))

        mq = RateLimits('MetricsResponse')
        self.assertNotEqual(id(sq1), id(mq))

    def test_pretty_print(self):
        """
        Test pretty print
        """
        RateLimits.response_to_query['FakeResponse'] = 'FakeQuery'

        with MockApiResponse('http://api.unittest'):
            self.FakeResponse.load_http_response(
                requests.get('http://api.unittest')
            )

        message = RateLimits.get_info()
        self.assertIn('FakeQuery', message)
        self.assertEqual(
            {"reset": "1436313600", "limit": "400", "remaining": "397"},
            json.loads(message.split('FakeQuery: ')[1])
        )

if __name__ == '__main__':
    unittest.main(verbosity=2)


text:
package org.ftccommunity.ftcxtensible.robot;

import org.jetbrains.annotations.NotNull;

import java.io.Serializable;

import static com.google.common.base.Preconditions.checkNotNull;

/**
 * A serializable class that describes key info in how a loop performs in operation
 *
 * @author David Sargent
 * @since 0.3.1
 */
public class PerformanceTuner implements Serializable {
    private static final long serialVersionUID = 0;
    private Integer[] times;
    private double[] z_indexes;
    private double average;
    private double stdDev;

    /**
     * Creates a new {@link PerformanceTuner}
     * @param times an array of loop times to use
     */
    public PerformanceTuner(@NotNull final Integer[] times) {
        this.times = checkNotNull(times).clone();
        average = 0;
        for (int time :
                times) {
            average = getAverage() + time;
        }
        average = getAverage() / times.length;

        stdDev = 0;
        for (int time :
                times) {
            stdDev += Math.pow(time - getAverage(), 2);
        }
        stdDev = getStdDev() / times.length;

        z_indexes = new double[times.length];
        for (int i = 0; i < times.length; i++) {
            z_indexes[i] = (times[i] - getAverage()) / stdDev;
        }
    }

    public Integer[] getTimes() {
        return times;
    }

    public double[] getZ_indexes() {
        return z_indexes;
    }

    public double getAverage() {
        return average;
    }

    public double getStdDev() {
        return stdDev;
    }
}


text:
/**
 * /extensions/extensions.js
 *
 * Place where extension options are registered.
 *
 */

WA.Extensions = {
  // Objects used to spotlight the current node.
  // Expected to expose the following interface:
  // obj.spotlight(node)
  nodeSpotlighters: new Array(),

  // Objects used to preprocess nodes when a page loads.
  // Expected to expose the following interface:
  // obj.preprocess(node)
  nodePreprocessors: new Array(),

  // Functions to be executed once at the load of each document.
  oncePerDocument: new Array(),

  // Functions to run when the nothing is playing.
  waitingForPauses: new Array(),

  // Functions that need to be called periodically.
  periodicFunctions: new Array(),

  // Functions that get called when a sound finishes.
  soundFinishers: new Array(),

  // List of all extensions.
  extensionList: new Array(),

  callPeriodics: function() {
    // Call the functions that are to be called periodically.
    var num = WA.Extensions.periodicFunctions.length;
    WA.Utils.log(num + "PERIODICS");
    for(var i=0; i<num; i++) {
      WA.Extensions.periodicFunctions[i].runPeriodic();
    }
  },

  // Are there actions waiting to be completed during pauses?
  actionsWaiting: function() {
    var num = this.waitingForPauses.length;
    for(var i=0; i<num; i++) {
      if(this.waitingForPauses[i].actionsWaiting()) {
      	return true;
      }
    }
    return false;
  },

  runActionsWaiting: function() {
    var num = this.waitingForPauses.length;
    for(var i=0; i<num; i++) {
      this.waitingForPauses[i].playNext();
    }
  },

  // Functions that specify what will be read next.
  readNext: new Array(),

  //
  actionsWaiting: function() {
    var num = this.waitingForPauses.length;
    for(var i=0; i<num; i++) {
      if(this.waitingForPauses[i].actionsWaiting()) {
        return true;
      }
    }
    return false;
  },

  /**
   * SpotlightNodes:
   * Applies spotlighters to the supplied node.
   * @param node Node to be spotlighted.
   */
  spotlightNode: function(node) {
    // Call the spotlight member function on each defined spotlighter extension.
    var num = this.nodeSpotlighters.length;
    for(var i=0; i<num; i++) {
    	this.nodeSpotlighters[i].spotlight(node);
    }
  },

  /**
   * runOncePerDocument:
   * Runs functions that are to be executed once per each document load.
   * @param doc DocumentElement that is to be processed.
   */
  runOncePerDocument: function(doc) {
    // Call the oncePerDocument member function on each defined object.
    var num = this.oncePerDocument.length;
    for(var i=0; i<num; i++) {
      this.oncePerDocument[i].oncePerDocument(doc);
    }
  },

  /**
   * preprocessNodes:
   * Pre-processes nodes upon page load.
   * @param node Node to be pre-processed.
   */
  preprocessNode: function(node) {
    // Call the spotlight member function on each defined spotlighter extension.
    var num = this.nodePreprocessors.length;
     //WA.Utils.log('Number of preprocessors '+num);
    for(var i=0; i<num; i++) {
      this.nodePreprocessors[i].preprocess(node);
    }
  },

  /**
   * Fired when sound finishes.
   * @param sound_id ID of the sound that just finished.
   * @param percent Percentage of sound down (0.0 to 1.0)
   */
  soundFinished: function(sid, percent) {
    // Call the soundFinished function on each defined soundFinished extensions.
    var num = this.soundFinishers.length;
    for(var i=0; i<num; i++) {
      this.soundFinishers[i].soundFinished(sid, percent);
    }
  },

  resetExtensions: function() {
  	var num = this.extensionList.length;
  	for(var i=0; i<num; i++) {
  	  if(this.extensionList[i].reset) {
        this.extensionList[i].reset();
  	  }
  	}
  },

  runWaitingForPause: function() {
    var num = this.waitingForPauses.length;
    for(var i=0; i<num; i++) {
      this.waitingForPauses[i].run();
    }
  }
}


text:
<?php
require_once('IPPIntuitEntity.php');

/**
 * @xmlNamespace http://schema.intuit.com/finance/v3
 * @xmlType IntuitEntity
 * @xmlName IPPPriceLevelPerItem
 * @var IPPPriceLevelPerItem
 * @xmlDefinition
				Product: QBW
				Description: A custom price or percentage change from the item's base price for a specific price level

 */
class IPPPriceLevelPerItem
	extends IPPIntuitEntity	{

		/**
		* Initializes this object, optionally with pre-defined property values
		*
		* Initializes this object and it's property members, using the dictionary
		* of key/value pairs passed as an optional argument.
		*
		* @param dictionary $keyValInitializers key/value pairs to be populated into object's properties
		* @param boolean $verbose specifies whether object should echo warnings
		*/
		public function __construct($keyValInitializers=array(), $verbose=FALSE)
		{
			foreach($keyValInitializers as $initPropName => $initPropVal)
			{
				if (property_exists('IPPPriceLevelPerItem',$initPropName))
				{
					$this->{$initPropName} = $initPropVal;
				}
				else
				{
					if ($verbose)
						echo "Property does not exist ($initPropName) in class (".get_class($this).")";
				}
			}
		}

	/**
	 * @xmlType element
	 * @xmlNamespace http://schema.intuit.com/finance/v3
	 * @xmlMinOccurs 0
	 * @xmlName ItemRef
	 * @var com\intuit\schema\finance\v3\IPPReferenceType
	 */
	public $ItemRef;
	/**
	 * @Definition
									Product: QBW
									Description: A specific price for the given item.

	 * @xmlType element
	 * @xmlNamespace http://schema.intuit.com/finance/v3
	 * @xmlMinOccurs 0
	 * @xmlName CustomPrice
	 * @var float
	 */
	public $CustomPrice;
	/**
	 * @Definition
									Product: QBW
									Description: Modifies the base selling price of the given item by the specified percentage.  A positive value increases the price, a negative value reduces the price.

	 * @xmlType element
	 * @xmlNamespace http://schema.intuit.com/finance/v3
	 * @xmlMinOccurs 0
	 * @xmlName CustomPricePercent
	 * @var float
	 */
	public $CustomPricePercent;
	/**
	 * @Definition Internal use only: extension place holder for PriceLevelPerItem
	 * @xmlType element
	 * @xmlNamespace http://schema.intuit.com/finance/v3
	 * @xmlMinOccurs 0
	 * @xmlName PriceLevelPerItemEx
	 * @var com\intuit\schema\finance\v3\IPPIntuitAnyType
	 */
	public $PriceLevelPerItemEx;

} // end class IPPPriceLevelPerItem


text:
<!doctype html>

		<meta charset="utf-8">

		<title>Daily Mobility Workout</title>

		<meta name="description" content="A few mobility excercises to do daily">
		<meta name="author" content="Gerald Bäck">

		<meta name="apple-mobile-web-app-capable" content="yes" />
		<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />

		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui">

		<link rel="stylesheet" href="css/reveal.css">
		<link rel="stylesheet" href="css/theme/white.css" id="theme">

		<link rel="stylesheet" href="lib/css/zenburn.css">

Daily Mobiltity Workout

This should be done daily, preferrably every morning.

Each of the following movements covers one joint. Most of them are "circles" and should be done both clockwise and counter-clockwise. 5-10 reps in each direction is sufficient, but it's helpful to add additional reps for troublesome joints.

Press to the edges of your ROM, but not enough to cause discomfort. This should be gentle. All repetitions should be at a medium to slow pace.

Once a week, you should perform a session for a number of reps equal to your age.

Source: http://phraktured.net/

3 Plane Neck Movement

Circle your head

Finger Flexion/Extension

Maximally open the hand, then make a fist

Wrist Circles

Make a fist and "draw a circle" with your pointer finger knuckle

Elbow Circles

Large Arm Circles

Circular Shrugs

Torso Twists

Keep the arms straight, palms facing upward

Side Bends

Forward/Back Bends

Keep the arms straight, palms facing upward

Bend forward losely, allowing the spine to round

Pelvic Tilts

Hula-hoop Hip Circles

Leg Rotations

High Knee Raises

Done in place

Kick Backs / Butt Kicks

Done in place

Ankle Circles

Point the toes and "draw a circle" with the big toe

Ankle Tilts

Without twisting the foot, tilt the ankle to the left and right

Toe Flexion/Extension

Lift toes up then curl them down


text:
id: 60b69a66b6ddb80858c51599
title: Step 35
challengeType: 0
dashedName: step-35
---

# --description--

Within your new `black-character` element, add three `div` elements with the following `id` values, in order: `black-hat`, `gray-mask`, `white-paper`.

# --hints--

You should have three `div` elements within your `#black-character` element.

```js
assert(document.querySelectorAll('#black-character > div')?.length === 3);
```

Your first new `div` element should have the `id` set to `black-hat`.

```js
assert(document.querySelectorAll('#black-character > div')?.[0]?.getAttribute('id') === 'black-hat');
```

Your second new `div` element should have the `id` set to `gray-mask`.

```js
assert(document.querySelectorAll('#black-character > div')?.[1]?.getAttribute('id') === 'gray-mask');
```

Your third new `div` element should have the `id` set to `white-paper`.

```js
assert(document.querySelectorAll('#black-character > div')?.[2]?.getAttribute('id') === 'white-paper');
```

# --seed--

## --seed-contents--

```html
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>freeCodeCamp Picasso Painting</title>
    <link rel="stylesheet" type="text/css" href="./styles.css" />
    <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.2/css/all.css">
  </head>
  <body>
    <div id="back-wall"></div>
        <div class="characters">
          <div id="offwhite-character">
            <div id="white-hat"></div>
            <div id="black-mask">
              <div class="eyes left"></div>
              <div class="eyes right"></div>
            </div>
            <div id="gray-instrument">
              <div class="black-dot"></div>
              <div class="black-dot"></div>
              <div class="black-dot"></div>
              <div class="black-dot"></div>
              <div class="black-dot"></div>
            </div>
            <div id="tan-table"></div>
          </div>
          <div id="black-character">
            --fcc-editable-region--

            --fcc-editable-region--
          </div>
        </div>
  </body>
</html>
```

```css
body {
  background-color: rgb(184, 132, 46);
}

#back-wall {
  background-color: #8B4513;
  width: 100%;
  height: 60%;
  position: absolute;
  top: 0;
  left: 0;
  z-index: -1;
}

#offwhite-character {
  width: 300px;
  height: 550px;
  background-color: GhostWhite;
  position: absolute;
  top: 20%;
  left: 17.5%;
}

#white-hat {
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 120px 140px 180px;
  border-top-color: transparent;
  border-right-color: transparent;
  border-bottom-color: GhostWhite;
  border-left-color: transparent;
  position: absolute;
  top: -140px;
  left: 0;
}

#black-mask {
  width: 100%;
  height: 50px;
  background-color: rgb(45, 31, 19);
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}

#gray-instrument {
  width: 15%;
  height: 40%;
  background-color: rgb(167, 162, 117);
  position: absolute;
  top: 50px;
  left: 125px;
  z-index: 1;
}

.black-dot {
  width: 10px;
  height: 10px;
  background-color: rgb(45, 31, 19);
  display: block;
  margin: auto;
  margin-top: 65%;
}

#tan-table {
  width: 450px;
  height: 140px;
  background-color: #D2691E;
  position: absolute;
  top: 275px;
  left: 15px;
  z-index: 1;
}
```


text:
"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

var _drawerr = _interopRequireDefault(require("./drawerr"));

var _drawerrMultilevel = _interopRequireDefault(require("./drawerrMultilevel"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

/**
 * We need this main function to correctly exports drawerr
 * see http://siawyoung.com/coding/javascript/exporting-es6-modules-as-single-scripts-with-webpack.html
 */
var _default = {
  Drawerr: _drawerr.default,
  DrawerrMultilevel: _drawerrMultilevel.default
};
exports.default = _default;
window.drawerr = _drawerr.default;
window.drawerrMultilevel = _drawerrMultilevel.default;
//# sourceMappingURL=index.js.map


text:
require 'fog/openstack/models/model'

module Fog
  module OpenStack
    class Baremetal
      class Node < Fog::OpenStack::Model
        identity :uuid

        attribute :instance_uuid
        attribute :maintenance
        attribute :power_state
        attribute :provision_state
        attribute :uuid

        # detailed
        attribute :created_at
        attribute :updated_at
        attribute :chassis_uuid
        attribute :console_enabled
        attribute :driver
        attribute :driver_info
        attribute :extra
        attribute :instance_info
        attribute :last_error
        attribute :maintenance_reason
        attribute :properties
        attribute :provision_updated_at
        attribute :reservation
        attribute :target_power_state
        attribute :target_provision_state

        def create
          requires :driver
          merge_attributes(service.create_node(attributes).body)
          self
        end

        def update(patch = nil)
          requires :uuid, :driver
          if patch
            merge_attributes(service.patch_node(uuid, patch).body)
          else
            # TODO: implement update_node method using PUT method and self.attributes
            # once it is supported by Ironic
            raise ArgumentError,
                  'You need to provide patch attribute. Ironic does not support update by hash yet, only by jsonpatch.'
          end
          self
        end

        def destroy
          requires :uuid
          service.delete_node(uuid)
          true
        end

        def chassis
          requires :uuid
          service.get_chassis(chassis_uuid).body
        end

        def ports
          requires :uuid
          service.list_ports_detailed(:node_uuid => uuid).body['ports']
        end

        def set_node_maintenance(parameters = nil)
          requires :uuid
          service.set_node_maintenance(uuid, parameters)
          true
        end

        def unset_node_maintenance(parameters = nil)
          requires :uuid
          service.unset_node_maintenance(uuid, parameters)
          true
        end

        def metadata
          requires :uuid
          service.get_node(uuid).headers
        end

        def set_power_state(power_state)
          requires :uuid
          service.set_node_power_state(uuid, power_state)
        end

        def set_provision_state(provision_state)
          requires :uuid
          service.set_node_provision_state(uuid, provision_state)
        end
      end
    end
  end
end


text:
"use strict";

import tl = require('azure-pipelines-task-lib/task');
import path = require('path');
import fs = require('fs');
import * as toolLib from 'azure-pipelines-tool-lib/tool';
import * as utils from './utils';
import * as os from "os";
import * as util from "util";
import * as semver from 'semver';
import minimatch = require('minimatch');
const uuidV4 = require('uuid/v4');
const helmToolName = "helm";
const helmAllReleasesUrl = "https://api.github.com/repos/helm/helm/releases";
const stableHelmVersion = "v3.1.2"

export async function getHelmVersion(): Promise<string> {
    var checkLatestHelmVersion = tl.getBoolInput('checkLatestHelmVersion', false);
    if (checkLatestHelmVersion) {
        return await getStableHelmVersion();
    }

    return utils.sanitizeVersionString(tl.getInput("helmVersion", true));
}

export async function downloadHelm(version: string): Promise<string> {
    var cachedToolpath = toolLib.findLocalTool(helmToolName, version);
    if (!cachedToolpath) {
        try {
            var helmDownloadPath = await toolLib.downloadTool(getHelmDownloadURL(version), helmToolName + "-" + version + "-" + uuidV4() + ".zip");
        } catch (exception) {
            throw new Error(tl.loc("HelmDownloadFailed", getHelmDownloadURL(version), exception));
        }

        var unzipedHelmPath = await toolLib.extractZip(helmDownloadPath);
        cachedToolpath = await toolLib.cacheDir(unzipedHelmPath, helmToolName, version);
    }

    var helmpath = findHelm(cachedToolpath);
    if (!helmpath) {
        throw new Error(tl.loc("HelmNotFoundInFolder", cachedToolpath))
    }

    fs.chmodSync(helmpath, "777");
    return helmpath;
}

function findHelm(rootFolder: string) {
    var helmPath = path.join(rootFolder, "*", helmToolName + getExecutableExtention());
    var allPaths = tl.find(rootFolder);
    var matchingResultsFiles = minimatch.match(allPaths, helmPath, rootFolder);
    return matchingResultsFiles[0];
}

function getHelmDownloadURL(version: string): string {
    switch (os.type()) {
        case 'Linux':
            return util.format("https://get.helm.sh/helm-%s-linux-amd64.zip", version);

        case 'Darwin':
            return util.format("https://get.helm.sh/helm-%s-darwin-amd64.zip", version);

        default:
        case 'Windows_NT':
            return util.format("https://get.helm.sh/helm-%s-windows-amd64.zip", version);

    }
}

async function getStableHelmVersion(): Promise<string> {
    try {
        const downloadPath = await toolLib.downloadTool(helmAllReleasesUrl);
        const responseArray = JSON.parse(fs.readFileSync(downloadPath, 'utf8').toString().trim());
        let latestHelmVersion = semver.clean(stableHelmVersion);
        responseArray.forEach(response => {
            if (response && response.tag_name) {
                let currentHelmVerison = semver.clean(response.tag_name.toString());
                if (currentHelmVerison) {
                    if (currentHelmVerison.toString().indexOf('rc') == -1 && semver.gt(currentHelmVerison, latestHelmVersion)) {
                        //If current helm version is not a pre release and is greater than latest helm version
                        latestHelmVersion = currentHelmVerison;
                    }
                }
            }
        });
        latestHelmVersion = "v" + latestHelmVersion;
        return latestHelmVersion;
    } catch (error) {
        let telemetry = {
            event: "HelmLatestNotKnown",
            url: helmAllReleasesUrl,
            error: error
        };
        console.log("##vso[telemetry.publish area=%s;feature=%s]%s",
            "TaskEndpointId",
            "HelmInstaller",
            JSON.stringify(telemetry));

        tl.warning(tl.loc("HelmLatestNotKnown", helmAllReleasesUrl, error, stableHelmVersion));
    }

    return stableHelmVersion;
}

function getExecutableExtention(): string {
    if (os.type().match(/^Win/)) {
        return ".exe";
    }

    return "";
}


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

<container xmlns="http://symfony.com/schema/dic/services"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">

    <services>
        <service id="knp_gaufrette.adapter.factory.in_memory" class="Knp\Bundle\GaufretteBundle\DependencyInjection\Factory\InMemoryAdapterFactory">
            <tag name="gaufrette.adapter.factory" />
        </service>
        <service id="knp_gaufrette.adapter.factory.service" class="Knp\Bundle\GaufretteBundle\DependencyInjection\Factory\ServiceAdapterFactory">
            <tag name="gaufrette.adapter.factory" />
        </service>
        <service id="knp_gaufrette.adapter.factory.local" class="Knp\Bundle\GaufretteBundle\DependencyInjection\Factory\LocalAdapterFactory">
            <tag name="gaufrette.adapter.factory" />
        </service>
        <service id="knp_gaufrette.adapter.factory.safe_local" class="Knp\Bundle\GaufretteBundle\DependencyInjection\Factory\SafeLocalAdapterFactory">
            <tag name="gaufrette.adapter.factory" />
        </service>
        <service id="knp_gaufrette.adapter.factory.amazon_s3" class="Knp\Bundle\GaufretteBundle\DependencyInjection\Factory\AmazonS3AdapterFactory">
            <tag name="gaufrette.adapter.factory" />
        </service>
        <service id="knp_gaufrette.adapter.factory.aws_s3" class="Knp\Bundle\GaufretteBundle\DependencyInjection\Factory\AwsS3AdapterFactory">
            <tag name="gaufrette.adapter.factory" />
        </service>
        <service id="knp_gaufrette.adapter.factory.acl_aware_amazon_s3" class="Knp\Bundle\GaufretteBundle\DependencyInjection\Factory\AclAwareAmazonS3AdapterFactory">
            <tag name="gaufrette.adapter.factory" />
        </service>
        <service id="knp_gaufrette.adapter.factory.doctrine_dbal" class="Knp\Bundle\GaufretteBundle\DependencyInjection\Factory\DoctrineDbalAdapterFactory">
            <tag name="gaufrette.adapter.factory" />
        </service>
        <service id="knp_gaufrette.adapter.factory.opencloud" class="Knp\Bundle\GaufretteBundle\DependencyInjection\Factory\OpenCloudAdapterFactory">
            <tag name="gaufrette.adapter.factory" />
        </service>
        <service id="knp_gaufrette.adapter.factory.azure_blob_storage" class="Knp\Bundle\GaufretteBundle\DependencyInjection\Factory\AzureBlobStorageAdapterFactory">
            <tag name="gaufrette.adapter.factory" />
        </service>
        <service id="knp_gaufrette.adapter.factory.gridfs" class="Knp\Bundle\GaufretteBundle\DependencyInjection\Factory\GridFSAdapterFactory">
            <tag name="gaufrette.adapter.factory" />
        </service>
        <service id="knp_gaufrette.adapter.factory.mogilefs" class="Knp\Bundle\GaufretteBundle\DependencyInjection\Factory\MogileFSAdapterFactory">
            <tag name="gaufrette.adapter.factory" />
        </service>
        <service id="knp_gaufrette.adapter.factory.ftp" class="Knp\Bundle\GaufretteBundle\DependencyInjection\Factory\FtpAdapterFactory">
            <tag name="gaufrette.adapter.factory" />
        </service>
        <service id="knp_gaufrette.adapter.factory.sftp" class="Knp\Bundle\GaufretteBundle\DependencyInjection\Factory\SftpAdapterFactory">
            <tag name="gaufrette.adapter.factory" />
        </service>
        <service id="knp_gaufrette.adapter.factory.apc" class="Knp\Bundle\GaufretteBundle\DependencyInjection\Factory\ApcAdapterFactory">
            <tag name="gaufrette.adapter.factory" />
        </service>
        <service id="knp_gaufrette.adapter.factory.cache" class="Knp\Bundle\GaufretteBundle\DependencyInjection\Factory\CacheAdapterFactory">
            <tag name="gaufrette.adapter.factory" />
        </service>
        <service id="knp_gaufrette.adapter.factory.dropbox" class="Knp\Bundle\GaufretteBundle\DependencyInjection\Factory\DropboxAdapterFactory">
            <tag name="gaufrette.adapter.factory" />
        </service>
    </services>

</container>


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

<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Macro BOOST_DLL_AUTO_ALIAS</title>
<link rel="stylesheet" href="../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="boost_dll/reference.html#header.boost.dll.alias_hpp" title="Header <boost/dll/alias.hpp>">
<link rel="prev" href="BOOST_DLL_ALIAS_SECTIONED.html" title="Macro BOOST_DLL_ALIAS_SECTIONED">
<link rel="next" href="boost/dll/library_info.html" title="Class library_info">

Home
Libraries
People
FAQ
More

Macro BOOST_DLL_AUTO_ALIAS

BOOST_DLL_AUTO_ALIAS — Exports variable or function with unmangled alias name.

Synopsis

// In header: <boost/dll/alias.hpp>

BOOST_DLL_AUTO_ALIAS(FunctionOrVar)

Description

This macro is useful in cases of long mangled C++ names. For example some `void boost::foo(std::sting)` function name will change to something like `N5boostN3foosE` after mangling. Importing function by `N5boostN3foosE` name does not looks user friendly, especially assuming the fact that different compilers have different mangling schemes.*

Must be used in scope where FunctionOrVar declared. FunctionOrVar must be a valid C name, which means that it must not contain `::`.

Functions or variables in global namespace must not have names same as FunctionOrVar.

Puts all the aliases into the "boostdll" read only section of the binary. Almost same as  BOOST_DLL_ALIAS(FunctionOrVar, FunctionOrVar).

Example:

 namespace foo {
   void bar(std::string&);
   BOOST_DLL_AUTO_ALIAS(bar)
 }

See:  BOOST_DLL_ALIAS for making an alias with different names.

<col align="left" valign="top">

Parameters:

<col align="left" valign="top">

FunctionOrVar

Function or variable for which an unmangled alias must be made.

Copyright © 2014 Renato Tegon Forti, Antony Polukhin
Copyright © 2015, 2016 Antony Polukhin

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


text:
If you want to access attribute metadata (label, disabled state, etc...) you must use the **attributes()** API, like the following:

#### Get a reference to the XEO Attribute
```java
	Demo demo = //load object
	XEOAttribute<String> name = demo.attributes().getName();
    XEOAttribute< Long > age = demo.attributes().getAge();
    XEOAttribute< BigDecimal > height = demo.attributes().getHeight();
    XEOAttribute< Boolean > playsSport = demo.attributes().playsSports();
    XEOAttribute< Date > dateBirth = demo.attributes().getDateBirth();
    XEOAttributeFile picture = demo.attributes().getPicture();
    XEOAttributeObject< Demo > bestFriend = demo.attributes().getBestFriend();
    XEOAttributeCollection< Demo > family = demo.attributes().getFamily();

```

Each type of attribute (String, Long, etc...) may have its own set of properties and methods, but they all the following:

#### Common attribute metadata (example with name attribute)
```java
	XEOAttribute<String> name = demo.attributes().getName();
    String label = name.getLabel(); //Returns the attribute label
    String attributeName = name.getName(); //Returns the attribute name (as defined in the .xeomodel)
    String value = name.getValue(); //Return the current value of the attribute, if the value was changed you get that value, see bellow for the value stored in the database
    String persistedValue = name.getPersistedValue(); //Return the value of the attribute as persisted in the database
    boolean required = name.isRequired() //Whether or not the attribute is required
    boolean disabled = name.isDisabled() //Whether or not the attribute is disabled
    boolean visible = name.isVisible() //Whether or not the attribute is visible
    boolean recommended = name.isRecommended() //Whether or not the attribute is recommended
    boolean valid = name.isValid() //whether the attribute is valid or not
    boolean validate = name.validate() //Validates the attribute and returns its valid state
    String invalidMessage = name.getInvalidMessage();

```

#### Dealing with value changes

You can check the current and the persisted value of an attribute as well as checking if the value was changed:

```java
	XEOAttribute<String> name = demo.attributes().getName();
    String currentValue = name.getValue(); //or demo.getName();
    String persistedValue = name.getPersistedValue(); //Get the value in the database
    boolean wasChanged = name.wasChanged();
```

#### Checking for the presence of value

You can also check if an attribute has a value or not, like the following:

```java
	XEOAttribute<String> name = demo.attributes().getName();
    if (name.isNull()){
    	//Name attribute value is null
    }

    if (name.isEmpty()){
    	//Name attribute value could be null or empty string
    }

```

**Notice that, most types of attributes don't have a notion of "empty". Only Strings can be empty.**

#### Metadata of specific types of attributes

In the following sections we show specific methods of certain types of attributes

##### XEOAttributeObject (relation with another object)
```java
	XEOAttributeObject<Demo> best = demo.attributes().getBestFriend();
    long boui = demo.getBoui();

```

##### XEOAttributeFile (binary data)

```java
	XEOAttributeFile picture = demo.attributes().getPicture();
    File file = new java.io.File("path/to/file.pdf");
    picture.setValue(file);

    //Reading the content
    InputStream is = picture.getInputStream();

```

##### XEOAttributeDecimal
```java
	XEOAttribute<BigDecimal> height = demo.attributes().getHeight();
    int minDecimals = height.getMinDecimals();
    int maxDecimals = height.getMaxDecimals();
```

##### XEOAttributeCollection Operations

######Getting the list total
```java
	XEOAttributeCollection<Demo> family = demo.attributes().getFamily();
    int recordCount = family.getRecordCount();

```
######Filtering the collection
If you want to the filter the collection using a given criteria do the following (similar to the java [FileFilter](http://docs.oracle.com/javase/8/docs/api/java/io/FileFilter.html))

```java
demo.attributes().getFamily().filter(
	new XEOCollectionFilter< Demo >() {

    @Override
	public boolean accept( Demo o ) {
		// Check for some condition
		return false;
	}
} );

```


text:
package gols

import (
	"errors"
	"fmt"
	"strconv"
	"strings"
)

// entry is one layer in a symbol table.
// Don't put lists in here -> runtime panic.
// Are nums allowed?  Can we limit the keys to strings?
type entry map[interface{}]interface{}

// lookup finds the value of a name in an entry.
func (e entry) lookup(name interface{}) (interface{}, bool) {
	if res, ok := e[name]; ok {
		return res, true
	}
	return nil, false
}

// table is a symbol table.
type table []entry

// lookup finds the value of a name in a table.
func (t table) lookup(name interface{}) (interface{}, bool) {
	for _, e := range t {
		if val, ok := e.lookup(name); ok {
			return val, true
		}
	}
	return nil, false
}

func quoteAction(list []interface{}, t table) (interface{}, error) {
	if len(list) != 2 {
		return nil, errors.New("quote must be a list with two elements")
	}
	return list[1], nil
}

func identifierAction(name string, t table) (interface{}, error) {
	if val, ok := t.lookup(name); !ok {
		return nil, fmt.Errorf("unrecognized identifier: %q", name)
	} else {
		return val, nil
	}
}

func lambdaAction(lambda []interface{}, t table) (interface{}, error) {
	if len(lambda) != 3 {
		return nil, errors.New("lambda requires a list with three elements")
	}
	return newLambda(t, lambda[1], lambda[2])
}

func condAction(cond []interface{}, t table) (interface{}, error) {
	lines := cond[1:] // skip "cond" keyword
	for _, line := range lines {
		if cline, ok := line.([]interface{}); !ok {
			return nil, errors.New("cond lines must be lists")
		} else if len(cline) != 2 {
			return nil, errors.New("cond lines must be lists with two elements")
		} else if cline[0] == "else" {
			return meaning(cline[1], t)
		} else {
			matches, err := meaning(cline[0], t)
			if err != nil {
				return nil, err
			}
			// Only place where booleans are significant in
			// the language?
			// Is it an error if the meaning isn't boolean?
			if matches == true {
				return meaning(cline[1], t)
			}
		}
		// do we want to validate the syntax of what comes after
		// a match?  eg, missing else, stuff after an else, etc
	}
	return nil, errors.New("cond must have an else line")
}

func applicationAction(list []interface{}, t table) (interface{}, error) {
	if len(list) == 0 {
		return nil, errors.New("application requires a non-empty list")
	}

	fMeaning, err := meaning(list[0], t)
	if err != nil {
		return nil, err
	}

	type function interface {
		meaning([]interface{}) (interface{}, error)
	}

	f, ok := fMeaning.(function)
	if !ok {
		return nil, fmt.Errorf("unsupported application type: %T", fMeaning)
	}

	args := list[1:]
	argVals := []interface{}{}
	for _, arg := range args {
		argVal, err := meaning(arg, t)
		if err != nil {
			return nil, err
		}
		argVals = append(argVals, argVal)
	}

	return f.meaning(argVals)
}

func meaning(sexp interface{}, t table) (interface{}, error) {
	if list, ok := sexp.([]interface{}); ok {
		if len(list) > 0 {
			if first, ok := list[0].(string); ok {
				switch first {
				case "quote":
					return quoteAction(list, t)
				case "lambda":
					return lambdaAction(list, t)
				case "cond":
					return condAction(list, t)
				}
			}
		}
		// applicationAction is going to have to do quite a
		// lot of error handling!
		return applicationAction(list, t)
	}
	if num, ok := sexp.(uint64); ok {
		return num, nil
	} else if b, ok := sexp.(bool); ok {
		return b, nil
	} else if str, ok := sexp.(string); ok {
		if primitive, ok := nameToPrimitive[str]; ok {
			return primitive, nil
		}
		return identifierAction(str, t)
	}
	return nil, errors.New("unsupported s-expression type")
}

func value(sexp interface{}) (interface{}, error) {
	return meaning(sexp, table([]entry{}))
}

// parsing implementation below copied from http://norvig.com/lispy.html

// tokenize tokenizes an s-expression where only unicode whitespace and
// ()s are considered significant.
func tokenize(src string) []string {
	src = strings.Replace(src, "(", " ( ", -1)
	src = strings.Replace(src, ")", " ) ", -1)
	return strings.Fields(src)
}

// readFromTokens builds an abstract syntax tree from a list of tokens.
// Atoms are either a bool, uint64, or string.  Lists are a []interface{}.
func readFromTokens(tokens []string) (interface{}, []string, error) {
	if len(tokens) == 0 {
		return nil, nil, errors.New("unexpected EOF")
	}

	token := tokens[0]
	tokens = tokens[1:]

	switch token {
	case "(":
		l := []interface{}{} // NB: empty list, not nil
		for len(tokens) > 0 && tokens[0] != ")" {
			sexp, remainder, err := readFromTokens(tokens)
			if err != nil {
				return nil, nil, err
			}
			tokens = remainder
			l = append(l, sexp)
		}
		if len(tokens) < 1 {
			return nil, nil, errors.New("unfinished list")
		}
		return l, tokens[1:], nil
	case ")":
		return nil, nil, errors.New("unexpected )")
	case "#t":
		return true, tokens, nil
	case "#f":
		return false, tokens, nil
	default:
		if num, err := strconv.ParseUint(token, 10, 64); err != nil {
			return token, tokens, nil
		} else {
			return num, tokens, nil
		}
	}
}

// parse tokenizes and builds a syntax tree from an s-expression.
func parse(src string) (interface{}, error) {
	tokens := tokenize(src)
	ast, remainder, err := readFromTokens(tokens)
	if err != nil {
		return nil, err
	}
	if len(remainder) > 0 {
		return nil, errors.New("unexpected trailing tokens")
	}
	return ast, nil
}


text:
class ExtraBulletRocket < Extra
  @@extras << self

  Requirement = 2000
  CatchArea = 35

  def initialize(game)
    super game, "extra_bullet_rocket.png"
  end

  def gain
    BulletRocket.upgrade
  end
end


text:
<?xml version="1.0" ?>
<container xmlns="http://symfony.com/schema/dic/services"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:framework="http://symfony.com/schema/dic/symfony"
    xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd
        http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd">

    <parameters>
        <parameter key="env(REDIS_URL)">redis://paas.com</parameter>
    </parameters>

    <framework:config http-method-override="false">
        <framework:lock>
            <framework:resource name="foo">semaphore</framework:resource>
            <framework:resource name="bar">flock</framework:resource>
            <framework:resource name="baz">semaphore</framework:resource>
            <framework:resource name="baz">flock</framework:resource>
            <framework:resource name="qux">%env(REDIS_URL)%</framework:resource>
        </framework:lock>
    </framework:config>
</container>


text:
//
// main.cpp
#include "stdafx.h"
#include <tchar.h>
#include <Windows.h>

#include "..\DuiLib\Utils\WinImplBase.h"
#include "MainFrame.h"

#if defined(WIN32) && !defined(UNDER_CE)
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPSTR /*lpCmdLine*/, int nCmdShow)
#else
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPTSTR lpCmdLine, int nCmdShow)
#endif
{

	CPaintManagerUI::SetInstance(hInstance);

#if defined(WIN32) && !defined(UNDER_CE)
	HRESULT Hr = ::CoInitialize(NULL);
#else
	HRESULT Hr = ::CoInitializeEx(NULL, COINIT_MULTITHREADED);
#endif
	if( FAILED(Hr) ) return 0;

	MainFrame* pFrame = new MainFrame();
	if( pFrame == NULL ) return 0;
#if defined(WIN32) && !defined(UNDER_CE)
	pFrame->Create(NULL, _T("PLApp"), UI_WNDSTYLE_DIALOG, NULL, 0, 0, 0, 0);
#else
	pFrame->Create(NULL, _T("PLApp"), UI_WNDSTYLE_DIALOG, WS_EX_TOPMOST, 0, 0, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN));
#endif
	HICON hIcon = ::LoadIcon(hInstance, MAKEINTRESOURCE(IDI_ICON1));
	::SendMessage(*pFrame, STM_SETICON, IMAGE_ICON, (LPARAM)(UINT)hIcon);

	pFrame->CenterWindow();
	::ShowWindow(*pFrame, SW_SHOW);
	CPaintManagerUI::MessageLoop();

	return 0;
}


text:
package com.illposed.osc;

import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.io.IOException;
import java.net.SocketException;

import com.illposed.osc.utility.OSCByteArrayToJavaConverter;
import com.illposed.osc.utility.OSCPacketDispatcher;

/**
 * OSCPortIn is the class that listens for OSC messages.
 *
 * An example based on com.illposed.osc.test.OSCPortTest::testReceiving() :
 * <pre>

	receiver = new OSCPortIn(OSCPort.DEFAULT_SC_OSC_PORT());
	OSCListener listener = new OSCListener() {
		public void acceptMessage(java.util.Date time, OSCMessage message) {
			System.out.println("Message received!");
		}
	};
	receiver.addListener("/message/receiving", listener);
	receiver.startListening();

 * </pre>
 *
 * Then, using a program such as SuperCollider or sendOSC, send a message
 * to this computer, port 57110 (DEFAULT_SC_OSC_PORT), with the address
 * /message/receiving
 *
 * @author Chandrasekhar Ramakrishnan
 */
public class OSCPortIn extends OSCPort implements Runnable {

	// state for listening
	private boolean listening;
	private OSCByteArrayToJavaConverter converter
			= new OSCByteArrayToJavaConverter();
	private OSCPacketDispatcher dispatcher = new OSCPacketDispatcher();

	/**
	 * Create an OSCPort that listens on the specified port.
	 * @param port UDP port to listen on.
	 * @throws SocketException
	 */
	public OSCPortIn(int port) throws SocketException {
		super(new DatagramSocket(port), port);
	}

	/**
	 * Buffers were 1500 bytes in size, but were
	 * increased to 1536, as this is a common MTU.
	 */
	private static final int BUFFER_SIZE = 1536;

	/**
	 * Run the loop that listens for OSC on a socket until
	 * @{link #isListening()} becomes false.
	 * @see java.lang.Runnable#run()
	 */
	public void run() {
		byte[] buffer = new byte[BUFFER_SIZE];
		DatagramPacket packet = new DatagramPacket(buffer, BUFFER_SIZE);
		DatagramSocket socket = getSocket();
		while (listening) {
			try {
				try {
					socket.receive(packet);
				} catch (SocketException ex) {
					if (listening) {
						throw ex;
					} else {
						// if we closed the socket while receiving data,
						// the exception is expected/normal, so we hide it
						continue;
					}
				}
				OSCPacket oscPacket = converter.convert(buffer,
						packet.getLength());
				dispatcher.dispatchPacket(oscPacket);
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
	}

	/**
	 * Start listening for incoming OSCPackets
	 */
	public void startListening() {
		listening = true;
		Thread thread = new Thread(this);
		thread.start();
	}

	/**
	 * Stop listening for incoming OSCPackets
	 */
	public void stopListening() {
		listening = false;
	}

	/**
	 * Am I listening for packets?
	 */
	public boolean isListening() {
		return listening;
	}

	/**
	 * Register the listener for incoming OSCPackets addressed to an Address
	 * @param anAddress  the address to listen for
	 * @param listener   the object to invoke when a message comes in
	 */
	public void addListener(String anAddress, OSCListener listener) {
		dispatcher.addListener(anAddress, listener);
	}
}


text:
package com.facebook.buck.features.project.intellij;

import com.facebook.buck.android.AndroidKotlinCoreArg;
import com.facebook.buck.android.AndroidLibraryDescription;
import com.facebook.buck.core.model.BuildTarget;
import com.facebook.buck.core.model.targetgraph.TargetGraph;
import com.facebook.buck.features.project.intellij.model.IjLibrary;
import com.facebook.buck.features.project.intellij.model.IjModule;
import com.facebook.buck.features.project.intellij.model.IjProjectConfig;
import com.facebook.buck.features.project.intellij.model.folders.IjFolder;
import com.facebook.buck.features.project.intellij.targetinfo.ModuleToTargetsBinaryFile;
import com.facebook.buck.features.project.intellij.targetinfo.TargetInfo;
import com.facebook.buck.features.project.intellij.targetinfo.TargetInfoBinaryFile;
import com.facebook.buck.io.filesystem.ProjectFilesystem;
import com.facebook.buck.util.json.ObjectMappers;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.type.TypeReference;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Maps;
import java.io.IOException;
import java.nio.file.Path;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.TreeMap;
import java.util.function.Function;
import java.util.stream.Collectors;

public class TargetInfoMapManager {
  static final String TARGET_INFO_MAP_FILENAME = "target-info.json";
  static final String TARGET_INFO_BINARY_FILENAME = "target-info.bin";
  static final String TARGET_INFO_MODULE_TO_TARGET_FILENAME = "target-info-modules.bin";

  static final String INTELLIJ_TYPE = "intellij.type";
  static final String INTELLIJ_NAME = "intellij.name";
  static final String INTELLIJ_FILE_PATH = "intellij.file_path";
  static final String GENERATED_SOURCES = "generated_sources";
  static final String MODULE_LANG = "module.lang";
  static final String MODULE_TYPE = "module";
  static final String BUCK_TYPE = "buck.type";
  static final String LIBRARY_TYPE = "library";
  static final String MODULE_LIBRARY_TYPE = "module_library";

  private final TargetGraph targetGraph;
  private final IjProjectConfig projectConfig;
  private final ProjectFilesystem outFilesystem;
  private final Path targetInfoMapPath;
  private final Map<String, Map<String, Object>> targetInfoMap;

  public TargetInfoMapManager(
      TargetGraph targetGraph,
      IjProjectConfig projectConfig,
      ProjectFilesystem outFilesystem,
      boolean isUpdate) {
    this.targetGraph = targetGraph;
    this.projectConfig = projectConfig;
    this.outFilesystem = outFilesystem;
    this.targetInfoMapPath =
        projectConfig.getProjectPaths().getIdeaConfigDir().resolve(TARGET_INFO_MAP_FILENAME);
    this.targetInfoMap = readTargetInfoMap(targetInfoMapPath, outFilesystem, isUpdate);
  }

  private static Map<String, Map<String, Object>> readTargetInfoMap(
      Path targetInfoMapPath, ProjectFilesystem outFilesystem, boolean isUpdate) {
    if (isUpdate && outFilesystem.exists(targetInfoMapPath)) {
      try {
        return ObjectMappers.createParser(outFilesystem.newFileInputStream(targetInfoMapPath))
            .readValueAs(new TypeReference<TreeMap<String, TreeMap<String, Object>>>() {});
      } catch (IOException ignored) {
      }
    }
    return Maps.newTreeMap();
  }

  public boolean isProjectLibrary(String name) {
    return targetInfoMap
        .getOrDefault(name, Collections.emptyMap())
        .getOrDefault(INTELLIJ_TYPE, "")
        .equals(LIBRARY_TYPE);
  }

  @VisibleForTesting
  String readTargetInfoMapAsString() throws IOException {
    return String.join(System.lineSeparator(), outFilesystem.readLines(targetInfoMapPath));
  }

  public void write(
      ImmutableSet<IjModule> modules,
      ImmutableSet<IjLibrary> libraries,
      BuckOutPathConverter buckOutPathConverter,
      IJProjectCleaner cleaner)
      throws IOException {
    writeModuleTargetInfo(modules, buckOutPathConverter);
    writeLibraryTargetInfo(libraries);
    try (JsonGenerator generator =
        ObjectMappers.createGenerator(outFilesystem.newFileOutputStream(targetInfoMapPath))
            .useDefaultPrettyPrinter()) {
      generator.writeObject(targetInfoMap);
      cleaner.doNotDelete(targetInfoMapPath);
    }
  }

  private TargetInfo convertToTargetInfo(Map<String, Object> data) {
    TargetInfo targetInfo = new TargetInfo();
    targetInfo.intellijFilePath = (String) data.get(INTELLIJ_FILE_PATH);
    targetInfo.intellijName = (String) data.get(INTELLIJ_NAME);
    targetInfo.moduleLanguage =
        data.get(MODULE_LANG) == null
            ? null
            : TargetInfo.ModuleLanguage.valueOf((String) data.get(MODULE_LANG));
    targetInfo.ruleType =
        data.get(BUCK_TYPE) == null
            ? null
            : TargetInfo.BuckType.valueOf((String) data.get(BUCK_TYPE));
    targetInfo.intellijType =
        data.get(INTELLIJ_TYPE) == null
            ? null
            : TargetInfo.IntelliJType.valueOf((String) data.get(INTELLIJ_TYPE));
    if (data.get(GENERATED_SOURCES) != null) {
      targetInfo.generatedSources =
          ((List<?>) data.get(GENERATED_SOURCES))
              .stream().map(o -> o.toString()).collect(Collectors.toList());
    }

    return targetInfo;
  }

  /** Write binary info. */
  public void writeBinaryInfo(
      ImmutableSet<IjModule> modules,
      ImmutableSet<IjLibrary> libraries,
      BuckOutPathConverter buckOutPathConverter,
      IJProjectCleaner cleaner)
      throws IOException {
    writeModuleTargetInfo(modules, buckOutPathConverter);
    writeLibraryTargetInfo(libraries);

    // TODO: use TargetInfo everywhere.
    Map<String, TargetInfo> converted = new HashMap<String, TargetInfo>();
    Map<String, Set<String>> modulesToTargets = new HashMap<>();
    for (Map.Entry<String, Map<String, Object>> entry : targetInfoMap.entrySet()) {
      String ruleName = entry.getKey();
      TargetInfo info = convertToTargetInfo(entry.getValue());
      converted.put(ruleName, info);

      Set<String> targets =
          modulesToTargets.computeIfAbsent(info.intellijName, k -> new HashSet<>());
      targets.add(ruleName);
    }

    Path binaryFilePath =
        projectConfig.getProjectPaths().getIdeaConfigDir().resolve(TARGET_INFO_BINARY_FILENAME);
    new TargetInfoBinaryFile(binaryFilePath).write(converted);
    cleaner.doNotDelete(binaryFilePath);

    // Write a mapping of module name -> set(targets)
    Path modulesToTargetsNamePath =
        projectConfig
            .getProjectPaths()
            .getIdeaConfigDir()
            .resolve(TARGET_INFO_MODULE_TO_TARGET_FILENAME);

    new ModuleToTargetsBinaryFile(modulesToTargetsNamePath).write(modulesToTargets);
    cleaner.doNotDelete(modulesToTargetsNamePath);
  }

  private void writeModuleTargetInfo(
      ImmutableSet<IjModule> modules, BuckOutPathConverter buckOutPathConverter) {
    modules.forEach(
        module -> {
          Map<BuildTarget, List<IjFolder>> targetsToGeneratedSourcesMap =
              module.getTargetsToGeneratedSourcesMap();
          module
              .getTargets()
              .forEach(
                  target -> {
                    Map<String, Object> targetInfo = Maps.newTreeMap();
                    targetInfo.put(INTELLIJ_TYPE, MODULE_TYPE);
                    targetInfo.put(INTELLIJ_NAME, module.getName());
                    targetInfo.put(
                        INTELLIJ_FILE_PATH,
                        projectConfig
                            .getProjectPaths()
                            .getModuleImlFilePath(module, projectConfig)
                            .toString());
                    targetInfo.put(BUCK_TYPE, getRuleNameForBuildTarget(target));
                    if (targetsToGeneratedSourcesMap.containsKey(target)) {
                      Function<IjFolder, Path> pathTransformer;
                      if (buckOutPathConverter.hasBuckOutPathForGeneratedProjectFiles()) {
                        pathTransformer = folder -> buckOutPathConverter.convert(folder.getPath());
                      } else {
                        pathTransformer = IjFolder::getPath;
                      }
                      targetInfo.put(
                          GENERATED_SOURCES,
                          ImmutableList.sortedCopyOf(
                              targetsToGeneratedSourcesMap.get(target).stream()
                                  .map(pathTransformer)
                                  .collect(Collectors.toList())));
                    }
                    getAndroidModuleLang(target)
                        .ifPresent(
                            moduleLang -> targetInfo.put(MODULE_LANG, moduleLang.toString()));
                    targetInfoMap.put(target.getFullyQualifiedName(), targetInfo);
                  });
        });
  }

  private void writeLibraryTargetInfo(ImmutableSet<IjLibrary> libraries) {
    libraries.forEach(
        library -> {
          library
              .getTargets()
              .forEach(
                  target -> {
                    Map<String, Object> targetInfo = Maps.newTreeMap();
                    targetInfo.put(
                        INTELLIJ_TYPE,
                        library.getLevel() == IjLibrary.Level.PROJECT
                            ? LIBRARY_TYPE
                            : MODULE_LIBRARY_TYPE);
                    targetInfo.put(INTELLIJ_NAME, library.getName());
                    targetInfo.put(
                        INTELLIJ_FILE_PATH,
                        projectConfig
                            .getProjectPaths()
                            .getLibraryXmlFilePath(library, projectConfig)
                            .toString());
                    targetInfo.put(BUCK_TYPE, getRuleNameForBuildTarget(target));
                    targetInfoMap.put(target.getFullyQualifiedName(), targetInfo);
                  });
        });
  }

  private String getRuleNameForBuildTarget(BuildTarget buildTarget) {
    return targetGraph.get(buildTarget).getRuleType().getName();
  }

  private Optional<AndroidLibraryDescription.JvmLanguage> getAndroidModuleLang(
      BuildTarget buildTarget) {
    return Optional.of(targetGraph.get(buildTarget).getConstructorArg())
        .filter(arg -> arg instanceof AndroidKotlinCoreArg)
        .map(AndroidKotlinCoreArg.class::cast)
        .flatMap(AndroidKotlinCoreArg::getLanguage);
  }
}


text:
function Controller() {
    function openPicker(e) {
        $.pickerView.picker.visible = true;
        clickedPrivacyLabel = e.source;
    }
    function fuckME() {
        $.lbl.text = $.txt.value;
    }
    require("alloy/controllers/BaseController").apply(this, Array.prototype.slice.call(arguments));
    this.__controllerPath = "editProfileWin1";
    arguments[0] ? arguments[0]["__parentSymbol"] : null;
    arguments[0] ? arguments[0]["$model"] : null;
    arguments[0] ? arguments[0]["__itemTemplate"] : null;
    var $ = this;
    var exports = {};
    var __defers = {};
    $.__views.win = Ti.UI.createWindow({
        backgroundColor: "white",
        id: "win",
        title: "Complete Your Profile"
    });
    $.__views.win && $.addTopLevelView($.__views.win);
    $.__views.__alloyId59 = Ti.UI.createView({
        height: "10%",
        top: "0",
        backgroundColor: "brown",
        id: "__alloyId59"
    });
    $.__views.win.add($.__views.__alloyId59);
    $.__views.__alloyId60 = Ti.UI.createButton({
        title: "Edit",
        left: "10",
        id: "__alloyId60"
    });
    $.__views.__alloyId59.add($.__views.__alloyId60);
    $.__views.lbl_completeProfile = Ti.UI.createLabel({
        height: "35",
        font: {
            fontSize: "14"
        },
        text: "Complete Your Profile",
        id: "lbl_completeProfile"
    });
    $.__views.__alloyId59.add($.__views.lbl_completeProfile);
    $.__views.__alloyId61 = Ti.UI.createButton({
        title: "Skip",
        right: "10",
        id: "__alloyId61"
    });
    $.__views.__alloyId59.add($.__views.__alloyId61);
    $.__views.__alloyId62 = Ti.UI.createTableViewRow({
        height: Ti.UI.SIZE,
        id: "__alloyId62"
    });
    var __alloyId63 = [];
    __alloyId63.push($.__views.__alloyId62);
    $.__views.__alloyId64 = Ti.UI.createView({
        width: "50%",
        layout: "vertical",
        left: "0",
        id: "__alloyId64"
    });
    $.__views.__alloyId62.add($.__views.__alloyId64);
    $.__views.img_user = Ti.UI.createImageView({
        top: "20",
        image: "/images/contact_photo.png",
        width: "80",
        heigth: "80",
        id: "img_user"
    });
    $.__views.__alloyId64.add($.__views.img_user);
    $.__views.lbl = Ti.UI.createLabel({
        height: "35",
        font: {
            fontSize: "14"
        },
        text: "Privacy",
        id: "lbl",
        bubbleParent: "true"
    });
    $.__views.__alloyId64.add($.__views.lbl);
    openPicker ? $.__views.lbl.addEventListener("click", openPicker) : __defers["$.__views.lbl!click!openPicker"] = true;
    $.__views.__alloyId65 = Ti.UI.createView({
        width: "50%",
        layout: "vertical",
        right: "0",
        backgroundColor: "brown",
        id: "__alloyId65"
    });
    $.__views.__alloyId62.add($.__views.__alloyId65);
    $.__views.__alloyId66 = Ti.UI.createTextField({
        height: "35",
        font: {
            fontSize: "14"
        },
        hintText: "KOSOM TITANIUM",
        id: "__alloyId66"
    });
    $.__views.__alloyId65.add($.__views.__alloyId66);
    fuckME ? $.__views.__alloyId66.addEventListener("change", fuckME) : __defers["$.__views.__alloyId66!change!fuckME"] = true;
    $.__views.table = Ti.UI.createTableView({
        height: Ti.UI.SIZE,
        top: "10%",
        data: __alloyId63,
        id: "table"
    });
    $.__views.win.add($.__views.table);
    $.__views.txt = Ti.UI.createTextField({
        height: "35",
        font: {
            fontSize: "14"
        },
        id: "txt",
        hintText: "titanium da bdan"
    });
    $.__views.win.add($.__views.txt);
    fuckME ? $.__views.txt.addEventListener("change", fuckME) : __defers["$.__views.txt!change!fuckME"] = true;
    $.__views.__alloyId67 = Ti.UI.createButton({
        font: {
            fontSize: "20",
            fontWeight: "bold"
        },
        height: "10%",
        width: "100%",
        backgroundColor: "#2279bc",
        color: "white",
        bottom: 0,
        title: "Continue",
        id: "__alloyId67"
    });
    $.__views.win.add($.__views.__alloyId67);
    $.__views.pickerView = Alloy.createController("privacyPicker", {
        id: "pickerView",
        __parentSymbol: $.__views.win
    });
    $.__views.pickerView.setParent($.__views.win);
    exports.destroy = function() {};
    _.extend($, $.__views);
    $.win.leftNavButton = Ti.UI.createButton({
        title: "Edit"
    });
    $.win.rightNavButton = Ti.UI.createButton({
        title: "Skip"
    });
    var clickedPrivacyLabel, clickedRow;
    $.pickerView.picker.addEventListener("click", function(e) {
        clickedPrivacyLabel.text = e.row.title;
        $.table.$.pickerView.picker.visible = false;
    });
    $.table.addEventListener("click", function(e) {
        e.cancelBubble = true;
        clickedRow = e.row;
    });
    $.win.addEventListener("click", function() {
        alert("zeby");
        $.pickerView.picker.visible = false;
    });
    __defers["$.__views.lbl!click!openPicker"] && $.__views.lbl.addEventListener("click", openPicker);
    __defers["$.__views.__alloyId66!change!fuckME"] && $.__views.__alloyId66.addEventListener("change", fuckME);
    __defers["$.__views.txt!change!fuckME"] && $.__views.txt.addEventListener("change", fuckME);
    _.extend($, exports);
}

var Alloy = require("alloy"), Backbone = Alloy.Backbone, _ = Alloy._;

module.exports = Controller;


text:
require 'yaml'
require 'mysql2psql/errors'

class Mysql2psql
  class ConfigBase
    attr_reader :config

    def initialize(yaml)
      @config = yaml
    end

    def [](key)
      send(key)
    end

    def method_missing(name, *args)
      token = name.to_s
      default = args.length > 0 ? args[0] : ''
      must_be_defined = default == :none
      case token
      when /mysql/i
        key = token.sub(/^mysql/, '')
        value = config['mysql'][key]
      when /dest/i
        key = token.sub(/^dest/, '')
        value = config['destination'][key]
      when /only_tables/i
        value = config['tables']
      else
        value = config[token]
      end
      value.nil? ? (must_be_defined ? (fail Mysql2psql::UninitializedValueError.new("no value and no default for #{name}")) : default) : value
    end
  end
end


text:
OneTwo
======

Post-compo version of One.