text:
var Promise = require( 'wee-promise' );
var helper = require( 'shared/helper' );
var DomNodeFactory = require( 'domNode/domNodeFactory' );
var PodFactory = require( 'pod/podFactory' );
var Bean = require( 'pod/bean' );
var IteratorMOJO = require( 'pod/iteratorMOJO' );

module.exports = hxManager;

function hxManager( j ){
    var that = this;
    if (helper.instOf( j , hxManager )) {
        return j;
    }
    j.each(function( i ) {
        that[i] = DomNodeFactory( j[i] );
    });
    helper.defProp( that , 'length' , helper.descriptor(
        function() {
            return helper.length( j );
        }
    ));
    return that;
}

hxManager.prototype = $.extend(helper.create( $.prototype ), {
    animate: function( bundle ) {
        var that = this;
        return eachNode( that , function( $hx , node , i ) {
            var pod = PodFactory( node , 'animation' );
            helper.ensureArray( bundle ).forEach(function( seed ) {
                if (helper.isFunc( seed )) {
                    pod.addCallback(seed.bind( that ));
                }
                else {
                    var bean = new Bean( seed , node , i );
                    pod.addBean( bean );
                }
            });
            $hx.addPod( pod );
        });
    },
    iterate: function( bundle ) {
        var that = this;
        return eachNode( that , function( $hx , node , i ) {
            var pod = PodFactory( node , 'precision' );
            helper.ensureArray( bundle ).forEach(function( seed ) {
                if (helper.isFunc( seed )) {
                    pod.addCallback(seed.bind( that ));
                }
                else {
                    var bean = new Bean( seed , node , i );
                    var iterator = new IteratorMOJO( node , bean );
                    pod.addBean( iterator );
                }
            });
            $hx.addPod( pod );
        });
    },
    promise: function( func , method ) {
        method = method || 'all';
        var that = this;
        var pods = that.toArray().map(function( node ) {
            var $hx = node.$hx;
            var pod = PodFactory( node , 'promise' );
            $hx.addPod( pod );
            return pod;
        });
        Promise[ method ]( pods ).then(function() {
            new Promise(
                // create the macroPromise
                func.bind( that )
            )
            .then(function() {
                // if the macroPromise is resolved, resolve the pods
                pods.forEach(function( pod ) {
                    pod.resolvePod();
                });
            })
            .catch(function( err ) {
                // otherwise, clear the queue so we can start again
                that
                .clear()
                .trigger( 'hx.reject' , arguments );
                if (helper.instOf( err , Error )) {
                    $.hx.error( err );
                    $(document).trigger( 'hx.error' , err );
                }
            });
        });
        return that;
    },
    pause: function() {
        return this._precAction( 'pause' );
    },
    resume: function() {
        return this._precAction( 'resume' );
    },
    _precAction: function( method , attempts ) {
        attempts = attempts || 0;
        var that = this;
        var pods = that.toArray()
            .map(function( node ) {
                return node.$hx.getCurrentPod();
            })
            .filter(function( pod ) {
                return pod.type === 'precision';
            });
        if (helper.length( pods ) !== helper.length( that ) && attempts < 10) {
            var unsubscribe = $.hx.subscribe(function() {
                attempts++;
                unsubscribe();
                that._precAction( method , attempts );
            });
        }
        else {
            pods.forEach(function( pod ) {
                pod[ method ]();
            });
        }
        return that;
    },
    paint: function( type ) {
        return eachNode( this , function( $hx ) {
            $hx.paint( type );
        });
    },
    reset: function( type ) {
        return eachNode( this , function( $hx ) {
            $hx.resetComponents( type );
        });
    },
    then: function( func ) {
        return this.promise( func );
    },
    race: function( func ) {
        return this.promise( func , 'race' );
    },
    defer: function( time ) {
        return this.promise(function( resolve ) {
            if (time) {
                var unsubscribe = $.hx.subscribe(function( elapsed ) {
                    if (elapsed >= time) {
                        unsubscribe();
                        resolve();
                    }
                });
            }
        });
    },
    update: function( bundle ) {
        // update a node's components without applying the transition
        var that = this;
        helper.ensureArray( bundle ).forEach(function( seed ) {
            eachNode( that , function( $hx , node , i ) {
                var bean = new Bean( seed , node , i );
                $hx.updateComponent( bean );
            });
        });
        return that;
    },
    resolve: function( all ) {
        // all controls whether all pod types or only promise pods will be resolved
        all = (!helper.isUndef( all ) ? all : false);
        // force resolve the current pod in each queue
        return eachNode( this , function( $hx ) {
            var pod = $hx.getCurrentPod();
            if (pod && (all || (!all && pod.type === 'promise'))) {
                pod.resolvePod();
            }
        });
    },
    detach: function() {
        // detach callbacks from the subscriber module,
        // but still allow the pod to continue running
        return eachNode( this , function( $hx ) {
            var pod = $hx.getCurrentPod();
            if (pod) {
                pod.detach();
            }
        });
    },
    clear: function() {
        // clear all pods in each queue
        return eachNode( this , function( $hx ) {
            $hx.clearQueue();
        });
    },
    break: function() {
        var that = this;
        // clear all but the current pod in each queue
        eachNode( that , function( $hx ) {
            $hx.clearQueue( false );
        });
        // resolve any remaining promise pods
        return that.resolve();
    },
    zero: function( hxArgs ) {
        var that = this;
        // update the stored components
        that.update( hxArgs );
        // remove any stored transitions
        eachNode( that , function( $hx ) {
            $hx.resetTransition();
            $hx.applyTransition();
        });
        // run paint
        return that.paint();
    },
    done: function( func ) {
        var that = this;
        that.promise(function( resolve ) {
            (func || function() {}).call( that );
            resolve();
        });
    },
    get: function( find , pretty ) {
        return this.toArray().map(function( node ) {
            return node.$hx.getComponents( find , pretty );
        });
    },
    cleanup: function() {
        eachNode( this , function( $hx ) {
            $hx.cleanup();
        });
    }
});

function eachNode( hxm , callback ) {
    hxm.toArray().forEach(function( node , i ) {
        callback( node.$hx , node , i );
    });
    return hxm;
}


text:
package org.floric.runningdinner.main.ui;

import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.BorderPane;
import javafx.stage.DirectoryChooser;
import javafx.stage.Stage;
import org.floric.runningdinner.main.base.IObserver;
import org.floric.runningdinner.main.core.Core;

import java.io.File;
import java.net.URL;
import java.util.ResourceBundle;

/** Settings Controller
 *
 * Created by florian on 17.03.2016.
 */
public class SettingsController implements Initializable, IObserver {

    @FXML
    private BorderPane pane;

    @FXML
    private Button closeDialogButton;
    @FXML
    private Button changeSafePathButton;

    @FXML
    private Label pathLabel;

    @Override
    public void initialize(URL location, ResourceBundle resources) {
        Core.getInstance().addObserver(this);
        update();
    }

    @FXML
    private void closeDialog(MouseEvent ev) {
        Stage stage = (Stage) pane.getScene().getWindow();
        stage.close();
    }

    @FXML
    private void changeSettingsPath() {
        DirectoryChooser chooser = new DirectoryChooser();
        //chooser.getExtensionFilters().addAll(new FileChooser.ExtensionFilter("Running Dinner Safefile", "*." + Core.getInstance().SAFE_EXTENSION));
        chooser.setInitialDirectory(new File(Core.getInstance().getSafeDir()));

        File file = chooser.showDialog(pane.getScene().getWindow());

        if (file != null) {
            Core.getInstance().setSafeDir(file.getAbsolutePath());
        }

    }

    @Override
    public void update() {
        pathLabel.setText(Core.getInstance().getSafePath());
    }
}

redpajama_set_name: RedPajamaGithub


text:
const ReactReconciler = {
  mountComponent(internalInstance, container) {
    const markup = internalInstance.mountComponent(container);

    return markup;
  },
};

export default ReactReconciler;


text:
package o;

import java.lang.annotation.Annotation;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target({java.lang.annotation.ElementType.ANNOTATION_TYPE})
public @interface ԍ
{
}

/* Location:           /Users/vikas/Documents/Mhacks_Real_app/classes-dex2jar.jar
 * Qualified Name:     o.'ç
 * JD-Core Version:    0.6.2
 */


text:
'use strict';

const fs = require('hexo-fs');
const Promise = require('bluebird');

module.exports = ctx => {
  if (ctx._dbLoaded) return Promise.resolve();

  const db = ctx.database;
  const path = db.options.path;
  const log = ctx.log;

  return fs.exists(path).then(exist => {
    if (!exist) return;

    log.debug('Loading database.');
    return db.load();
  }).then(() => {
    ctx._dbLoaded = true;
  }).catch(() => {
    log.error('Database load failed. Deleting database.');
    return fs.unlink(path);
  });
};


text:
set -e

git clone https://bitfort:$MLP_GITHUB_KEY@github.com/tensorflow/staging.git --branch in_progress staging

PINNED_SHA="e418e34e3f82f1c99e55cd579db9f81c94d78b75"
pushd staging
echo "Pinning to: ${PINNED_SHA}"
git checkout ${PINNED_SHA}
popd


text:
if [ ! -f /etc/yum.repos.d/mongodb.repo ]; then
    echo "[script] MongoDB repository not found!"
    echo "[script] Creating new for 64-bit system"
    sudo sh -c 'echo "[mongodb]
name=MongoDB Repository
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64/
gpgcheck=0
enabled=1" > /etc/yum.repos.d/mongodb.repo'
else
    echo "[script] MongoDB repository already exists"
fi

echo "[script] Trying to update and install mongoDB"
sudo yum -y update

# install mongoDB
sudo yum -y install mongodb-org mongodb-org-server

# start mongoDB
echo "[script] Starting mongod service"
sudo systemctl start mongod

echo "[script] Enabling mongod on startup"
sudo systemctl enable mongod

echo "[script] By default mongoDB is running on port 27017"


text:
package com.github.i49.pulp.impl.service;

import static com.github.i49.pulp.impl.base.Preconditions.*;

import java.net.URI;

import com.github.i49.pulp.api.metadata.Metadata;
import com.github.i49.pulp.api.metadata.TermRegistry;
import com.github.i49.pulp.api.publication.EpubService;
import com.github.i49.pulp.api.publication.Publication;
import com.github.i49.pulp.api.publication.PublicationReaderFactory;
import com.github.i49.pulp.api.publication.PublicationResourceBuilderFactory;
import com.github.i49.pulp.api.publication.PublicationWriterFactory;
import com.github.i49.pulp.impl.io.readers.DefaultPublicationReaderFactory;
import com.github.i49.pulp.impl.io.writers.DefaultPublicationWriterFactory;
import com.github.i49.pulp.impl.metadata.DefaultMetadata;
import com.github.i49.pulp.impl.metadata.DefaultTermRegistry;
import com.github.i49.pulp.impl.publication.MediaTypeRegistry;
import com.github.i49.pulp.impl.publication.DefaultPublication;
import com.github.i49.pulp.impl.publication.DefaultPublicationResourceBuilderFactory;

/**
 * The default implementation of {@link EpubService} interface.
 */
class DefaultEpubService implements EpubService {

	private final MediaTypeRegistry typeRegistry = new MediaTypeRegistry();
	private final TermRegistry termRegistry = new DefaultTermRegistry();

	DefaultEpubService() {
	}

	@Override
	public Publication createPublication() {
		return new DefaultPublication(this::createMetadata);
	}

	@Override
	public PublicationReaderFactory createReaderFactory() {
		return new DefaultPublicationReaderFactory(this);
	}

	@Override
	public PublicationResourceBuilderFactory createResourceBuilderFactory(URI baseURI) {
		checkNotNull(baseURI, "baseURI");
		return new DefaultPublicationResourceBuilderFactory(baseURI, this.typeRegistry);
	}

	@Override
	public PublicationWriterFactory createWriterFactory() {
		return new DefaultPublicationWriterFactory();
	}

	@Override
	public TermRegistry getPropertyTermRegistry() {
		return termRegistry;
	}

	private Metadata createMetadata() {
		return new DefaultMetadata(this.termRegistry);
	}
}


text:
// @formatter:off

package com.microsoft.alm.teamfoundation.sourcecontrol.webapi;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.microsoft.alm.visualstudio.services.webapi.ReferenceLinks;

/**
 */
public class GitAsyncRefOperation {

    private ReferenceLinks _links;
    private GitAsyncRefOperationDetail detailedStatus;
    private GitAsyncRefOperationParameters parameters;
    private GitAsyncOperationStatus status;
    private String url;

    @JsonProperty("_links")
    public ReferenceLinks getLinks() {
        return _links;
    }

    @JsonProperty("_links")
    public void setLinks(final ReferenceLinks _links) {
        this._links = _links;
    }

    public GitAsyncRefOperationDetail getDetailedStatus() {
        return detailedStatus;
    }

    public void setDetailedStatus(final GitAsyncRefOperationDetail detailedStatus) {
        this.detailedStatus = detailedStatus;
    }

    public GitAsyncRefOperationParameters getParameters() {
        return parameters;
    }

    public void setParameters(final GitAsyncRefOperationParameters parameters) {
        this.parameters = parameters;
    }

    public GitAsyncOperationStatus getStatus() {
        return status;
    }

    public void setStatus(final GitAsyncOperationStatus status) {
        this.status = status;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(final String url) {
        this.url = url;
    }
}


text: java -cp target/classes net.cristcost.dada.multiply.MultiplyApp $1 $2


text:
layout: page
title: "Dianna Jean Lawyer-Brook"
comments: true
description: "blanks"
keywords: "Dianna Jean Lawyer-Brook,CU,Boulder"
---
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="https://dl.dropboxusercontent.com/s/pc42nxpaw1ea4o9/highcharts.js?dl=0"></script>
<!-- <script src="../assets/js/highcharts.js"></script> -->
<style type="text/css">@font-face {
	font-family: "Bebas Neue";
	src: url(https://www.filehosting.org/file/details/544349/BebasNeue Regular.otf) format("opentype");
	}
	h1.Bebas {
		font-family: "Bebas Neue", Verdana, Tahoma;
	}
</style>
</head>

#### TEACHING INFORMATION

**College**: School of Education

**Classes taught**: EDUC 5515

#### EDUC 5515: CURR/ASSESS SPEC LEARNER

**Terms taught**: Spring 2009

**Instructor rating**: 2.18

**Standard deviation in instructor rating**: 0.0

**Average grade** (4.0 scale): 3.96

**Standard deviation in grades** (4.0 scale): 0.0

**Average workload** (raw): 2.67

**Standard deviation in workload** (raw): 0.0


text:
import auth from './auth';
import comments from './comments';

// Reference to all API definitions
const api = {
  auth,
  comments
};

export default api;


text:
using Cormo.Injects;

namespace Cormo.Mixins
{
    public interface IMixinBinding : IAnnotation
    {
    }
}


text:
layout: post
title: "Adobe.com outages"
category: "Blog"
---
{% include JB/setup %}

Adobe and Macromedia websites have had some outages recently. I have been trying to get to MXNA all morning, and I have been presented with a ColdFusion error. From what I hear, they will have their web infastructure merged within the next few weeks. I guess I will have to be patient.


text:
Utility for determining object hash codes, based on Apache Commons [HashCodeBuilder](http://commons.apache.org/proper/commons-lang/apidocs/org/apache/commons/lang3/builder/HashCodeBuilder.html).

```objectivec
- (NSUInteger)hash {
    return [[[[[BRYHashCodeBuilder builderWithInitialValue:17 multiplier:37]
               appendObject:self.name]
              appendBool:self.isHidden]
             appendFloat:self.width]
            appendInteger:self.index].hashCode;
}
```

## License

Available for use under the MIT license: [http://bryan.mit-license.org](http://bryan.mit-license.org)


text:
package com.anup.woodstock.web.jsf.view;

import java.io.Serializable;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.ManagedProperty;
import javax.faces.bean.ViewScoped;

import com.anup.woodstock.web.jsf.model.URLModel;

@ManagedBean(name ="searchURLController")
@ViewScoped
public class SearchURLController implements Serializable {

	public static final long serialVersionUID = 1L;
	//private static Logger logger = Logger.getLogger(SearchUserController.class.getSimpleName());

	@ManagedProperty(value="#{urlModel}")
	private URLModel urlModel;

    public URLModel getURLModel() {
		return urlModel;
	}

	public void setURLModel(URLModel urlModel) {
		this.urlModel = urlModel;
	}

	public void searchUser() {
    	System.out.println("in searchUuser ..."+urlModel.toString());

    }
}


text:
def topic_classifier(title) :
    title = title.lower()

    # Ward Matters

    ## Residents

    tags = ['Ward Matters', 'Residents']

    if title.startswith('senior citizen sewer') :
        return tags + ['Senior citizen sewer refund']

    if title.startswith(('handicapped parking',
                         'handicapped permit')) :
        return tags + ['Routine', 'Handicapped Parking Permit']

    if title.startswith(('condominium claim',
                         'denial of condo',
                         'denials of condo',
                         'denials condo',
                         'denied condo',
                         'condominium refuse')) :
        return tags + ['Routine', 'Condo Refuse Claim']

    if title.startswith(('residential permit',
                         'residential parking',
                         'amendment of residential',
                         'buffer zone')) :
        return tags + ['Routine', 'Residential permit parking']

    ## Business Permits and Privileges

    tags = ["Ward Matters", "Business Permits and Privileges"]

    if title.startswith(('sidewalk cafe',)) :
        return tags + ['Routine', 'Sidewalk cafe']

    if title.startswith(('grant(s) of privilege',
                         'grant(s) of priviledge',
                         'grant of privilege',
                         'grants of privilege',
                         'grant of privlage',
                         'grant of priviege',
                         'amendment of grant(s) of privilege')) :
        return tags + ['Routine', 'Grant of privilege in public way']

    if title.startswith('awning(s)') :
        return tags + ['Routine', 'Awnings']

    if (any(s in title for s in ('issuance of permits for sign(s)/signboard(s)',
                      'install signs')) or title.startswith('sign(s)')) :
        return tags + ['Routine', 'Sign permits']

    if title.startswith('canopy(s)') :
        return tags + ['Routine', 'Canopy']

    if title.startswith(('exemption from', 'exemption for physical')) :
        return tags + ['Routine', 'Physical barrier exemption']

    if title.startswith(('conduct of sidewalk sale',
                         'sidewalk sale')) :
        return tags + ['Non-Routine', 'Sidewalk Sale']

    if title.startswith(('industrial permit parking',)) :
        return tags + ['Non-Routine', 'Industrial Permit Parking']

    ## Land Use

    tags = ["Ward Matters", "Land Use"]

    if '4-244-140' in title :
        return tags + ['Non-Routine', 'Restrict Peddling']

    if title.startswith('zoning reclassification') :
        return tags + ['Routine', 'Zoning Reclassification']

    if any(s in title for s in ('4-60-022', '4-60-023')):
        return tags + ['Non-Routine', 'Liquor and Package Store Restrictions']

    if any(s in title for s in ('pedestrian street', 'pedestrian retail street')):
        return tags + ['Non-Routine', 'Pedestrian Street']

    if title.startswith(('historical landmark designation',
                         'correction to chicago landmark designation')) :
        return tags + ['Non-Routine', 'Historical Landmark']

    if 'subdivision' in title or 'resubdivision' in title:
        return tags + ['Non-Routine', 'Subdivison']

    ## Economic Development

    tags = ["Ward Matters", "Economic Development"]

    if title.startswith(('support of class 6(b)',
                         'support of class l',
                         'class c',
                         'class l',
                         'designation of class 7',
                         'support of class c',
                         'expression of consent for class 7')) :
        return tags + ['Non-Routine', 'Tax Incentives']

    if 'tax increment' in title :
        return tags + ['Non-Routine', 'Tax Increment Financing']

    if 'redevelopment project area' in title :
        return tags + ['Non-Routine', 'Tax Increment Financing']

    if 'redevelopment plan' in title :
        return tags + ['Non-Routine', 'Tax Increment Financing']

    if ('transfer of tif funds' in title
        or ('allocation of' in title and 'tif funds' in title)):
        return tags + ['Non-Routine', 'Tax Increment Financing']

    if (title.startswith("tif ")
        or title.endswith( "tif")
        or " tif " in title) :
        return tags + ['Non-Routine', "Tax Increment Financing"]

    if 'tifworks' in title :
        return tags + ['Non-Routine', 'Tax Increment Financing']

    if ('neighborhood improvement program' in title.lower()
        or 'neighborhood investment program' in title.lower()
        or 'tif-nip' in title.lower() ) :
        return tags + ['Non-Routine', 'Tax Increment Financing']

    if title.startswith('amendment') and 'tif' in title and 'budget' in title  :
        return tags + ['Non-Routine', 'Tax Increment Financing']

    if any(s in title for s in ('s.s.a.',
                              ' ssa',
                              'special service no',
                              'special service area')):
        return tags + ['Non-Routine', 'Special Service Area']

#                         'Issue Special Event',
#                         'waiver of permit fees',

    ## Special Events

    if title.startswith(('permission to hold',
                         'permission to hold',
                         'issue special event',
                         'issuance of special event license')) :
        return tags + ['Non-Routine', 'Special Events']

    ## Free Permits

    tags = ["Ward Matters"]

    if title.startswith(('waiver of annual public assembly fee',
                         'wavier of special event tent',
                         'waiver of special event',
                         'waiver of annual fire pump',
                         'waiver street closure',
                         'waiver of street closure permit fee' )) :
        return tags + ['Non-Routine', 'Fee Waiver']

    if title.lower().startswith(('cancellation of warrants',)) :
        return tags + ['Non-Routine', 'Fee Waiver']

    if title.lower().startswith(('issuance of permit',
                                 'issuance of tent permit',
                                 'issuance of license')) :
        return tags + ['Non-Routine', 'Fee Waiver']

    if title.startswith(('waiver of special event raffle license',)) :
        return tags + ['Non-Routine', 'Fee Waiver']

    if title.startswith(('free permit',
                         'fee exemption',
                         'waiver of public way use permit fee',
                         'waiver of community identifier sign permit fee',
                         'waiver of fee',
                         'exemption of public way use',
                         'cancellation of public way use permit fee',
                         'waiver of permit fee',
                         'waiver of public use permit fee',
                         'license fee exemption')) :
        return tags + ['Non-Routine', 'Fee Waiver']

    if title.startswith(('historical landmark fee',
                         'landmark fee waiver')) :
        return tags + ['Non-Routine', 'Fee Waiver']

    ## Churches and Non Profits

    tags = ["Ward Matters", "Churches and Non-Profits"]

    if title.startswith(('not-for-profit fee exemption',
                         'sewer refund',
                         'refund of fee',
                         'cancellation of water',
                         'canecellation of warrants for water')) :
        return tags + ['Non-Routine', 'Free Water and Sewer for Non Profit Organizations']

    if title.startswith(('tag day',)) :
        return tags + ['Non-Routine', 'Tag Day Permits']

    ## Parking
    tags = ["Ward Matters", "Parking"]

    if title.startswith(('parking prohibit',
                         'amendment of parking',
                         'parking limit',
                         'parking restrict'
                         )) :
        return tags + ['Routine', 'Parking Restriction']

    if title.startswith(('parking meters',
                         'amendment of parking meters',
                         'installation and removal of parking meters',
                         'removal and relocation of parking meters')) :
        return tags + ['Non-Routine', 'Parking Meters']

    if title.startswith(('loading/standing/tow',
                         'amendment of loading',
                         'repeal loading',
                         'tow zone',
                         'traffic lane',
                         'loading zone')) :
        return tags + ['Routine', 'Loading/Standing/Tow Zone']

    if title.startswith(('removal of taxicab stand',
                         'repeal of taxicab stand',
                         'taxicab stand',
                         'amendment of taxicab',
                         'establish taxicab',
                         'establishment of taxicab')) :
        return tags + ['Non-Routine', 'Taxicab Stand']

    if 'pilot parking program' in title :
        return tags + ['Non-Routine', 'Pilot Parking Program']

    ## Traffic

    tags = ["Ward Matters", "Traffic"]

    if title.startswith(('traffic direction',
                         'single direction',
                         'one way traffic',
                         'one-way traffic',
                         'repeal one-way')) :
        return tags + ['Non-Routine', 'Traffic Direction']

    if title.startswith(('speed hump',)) :
        return tags + ['Non-Routine', 'Speed Hump']

    if title.startswith(('no cruising',)) :
        return tags + ['Non-Routine', 'No Cruising Zone']

    if title.startswith(('traffic sign',
                         'traffic warning sign',
                         'miscellaneous signs')) :
        return tags + ['Routine', 'Traffic signs and signals']

    if title.startswith(('limited local access')) :
        return tags + ['Non-Routine', 'Limited Local Access']

    if title.startswith(('speed limitation',)) :
        return tags + ['Non-Routine', 'Speed Limits']

    if title.startswith(('closed to',
                         'close to',
                         'closure to vehic',
                         'traffic closure')) :
        return tags + ['Non-Routine', 'Traffic Closure']

    if title.startswith(('vehicle weigh',
                         'weight limitation',
                         'weigh limitation')) :
        return tags + ['Non-Routine', 'Vehicle Weight Limitation']

    if title.startswith('construction of traffic circle') :
        return tags + ['Non-Routine', 'Traffic Circle']

    if title.startswith(('traffic regulations',
                         'failed to pass traffic regulation',
                         'various traffic regulations')) :
        return tags + ['Non-Routine', 'Traffic Regulation']

    if title.startswith(('service drive',)) :
        return tags + ['Non-Routine', 'Service Drive/Diagonal Parking']

    ## Wrigley Field

    tags = ["Ward Matters"]

    if title.startswith(('one time exception to wrigley field',
                         'amendment of wrigley field',
                         'amendment of night game',
                         'one time exception to night game',
                         'amendment of wrigley adjacent area')) :
        return tags + ['Non-Routine', 'Wrigley Field']

    # Small Claims

    tags = ["Small Claims"]

    if any(s in title for s in ('damage to vehicle', 'damage to vhicle')):
        return tags + ['Routine', 'Damage to vehicle claim']

    if 'damage to property claim' in title :
        return tags +['Routine', 'Damage to property claim']

    if title.startswith(('payment of',
                         'payments of',
                         'payment for various',
                         'denying payment',
                         'denied various claims',
                         'various small claims',
                         'small claims',
                         'adelman',
                         'denials of various',
                         'denial of various')) :
        return tags + ['Non-Routine', 'Settlement of Claims']

    if 'excessive water rate claim' in title :
        return tags + ['Routine', 'Excessive water rate claim']

    # Honorifics

    tags = ["Honorifics"]

    if title.startswith(('congratulation',
                         'congradulation',
                         'congraulations',
                         'proclamation',
                         'recognition',
                         'recoginition',
                         'commemoration of',
                         'tribute to',
                         'declaraton',
                         'posthumous gratitude',
                         'posthumous congratulations',
                         'commendations extended to',
                         'gratitude',
                         'grattitude',
                         'best wishes extended',
                         'condolences extended',
                         'expression of condolence',
                         'expression sympathy',
                         'honoring',
                         'welcome extended')) or 'declaration' in title  :
        return tags + ['Routine', 'Honorific Resolution']

    if 'commemorative' in title :
        return tags + ['Routine', 'Honorific Marker']

    if title.startswith(('honorary street designation',
                         'designation of "ed and betty gardner street"',
                         'dedication of',
                         'commermoration of dedication')) :
        return tags + ['Routine', 'Honorary street']

    # City

    tags = ["City Matters"]

    ## Settlement Agreements

    if title.startswith(('settlement agreement',
                         'sylwia marcincryk v.',
                         'setttlement order',
                         'settlement order',
                         'judgement and settlement',
                         'judgements or settlement',
                         'judgment and settlement',
                         'judgement or settlment',
                         'judgement or settlement')) :
        return tags + ['Non-Routine', 'Settlement Agreement']

    ## Appointments

    if 'standing committee' in title :
        return ['Council Matters', 'Non-Routine', 'Committe Appointments']

    if title.startswith(('appointment', 'reappointment')) :
        return tags + ['Non-Routine', 'Appointment']

    ## Airports

    if any(s in title for s in ("o'hare",
                              "midway international",
                              "terminal use",
                              "off airport",
                              "cargo facility",
                              "aviation services")):
        return tags + ["Non-Routine", "Airports"]

    ## Special Funds

    tags = ["City Matters", "Special Funds"]

    if 'human infrastructure fund' in title :
        return tags + ["Non-Routine", "Human Infrastructure Fund"]

    ## Open Space Impact Funds

    if title.startswith(('expenditure of open space',)) :
        return tags + ['Non-Routine', 'Open Space Impact Funds']

    ## Small Business Improvement Fund

    if 'small business improvement fund' in title :
        return tags + ['Non-Routine', 'Small Business Improvement Fund']

    # Motor Fuel Tax Fund

    if 'motor fuel tax funds' in title.lower() :
        return tags + ['Non-Routine', 'Motor Fuel Tax Funds']

    # Inspector General

    if title.startswith(('inspector general')) :
        return tags + ['Non-Routine', "Inspector General"]

    tags = ["City Matters"]

    ## Municipal Code

    if title.startswith(('amendment of section',
                         'amendment of subsection',
                         'amendment of title',
                         'amendment of various provisions of municipal',
                         'amendment of various sections of municipal code',
                         'amendment to various sections of municipal code',
                         'repeal of section',
                         'amendment of municipal code',
                         'amendment to municipal code',
                         'amendment of chapter')) :
        return tags + ['Non-Routine', 'Municipal Code']

    if title.startswith(('pay rate of hospital',
                         'payment of hospital and med')) :
        return tags + ['Routine', 'Police and Firefighter Medical Bills']

    if title.startswith(('independent police review',
                         'police review authority',
                         'police board')) :
        return tags + ['Non-Routine', 'Police Oversight']

    # Neighborhood Stabilization Program

    if 'neighborhood stabilization program' in title.lower() :
        return tags + ['Non-Routine', 'Neighborhood Stabilization Program']

    ## Oaths of Office

    if title.startswith(('oath',)) :
        return tags + ['Non-Routine', 'Oath of Office']

    ## Annual Appropriations

    if 'annual appropriation' in title :
        return tags + ['Non-Routine', 'Annual Appropriation']

    # Pensions

    if title.startswith(("laborers' and retirement board",
                         'retirement board')) :
        return tags + ['Non-Routine', 'Pensions']

    ## Affordable Housing

    if title.startswith(('affordable housing plan')) :
        return tags + ['Non-Routine', 'Affordable Housing']

    ## Labor Agreement

    if title.startswith(('collective bargaining')) or 'labor agreement' in title:
        return tags + ['Non-Routine', 'Labor Agreement']

    ## CDBG

    if 'cdbg' in title or 'community development block grant ordinance' in title:
        return tags + ['Non-Routine', 'Community Development Block Grant']

    # Elections

    if any(s in title for s in ('referenda',
                              'election return',
                              'submission of public question',
                              "aldermanic election")):
        return tags + ['Non-Routine', 'Elections']

    ## Finances

    tags = ["City Matters", "Finances"]

    if any(s in title for s in ('tax levy',
                              'tax levied',
                              'levy of real estate tax',
                              'tax levies')):
        return tags + ['Non-Routine', 'Taxes']

    if any(s in title for s in (' bonds',
                              ' bond issuance ',
                              ' bond proceeds ',
                              'general obligation note',
                              'general obligation tender notes',
                              'multi-family housing revenue note')):
        return tags + ['Non-Routine', 'Bonds']

    if 'commercial paper' in title :
        return tags

    if title.startswith(('city comptroller',
                         'city of chicago annual financial analysis',
                         'comprehensive annual financial report')) :
        return tags + ['Non-Routine', 'Financial Reports']

    ## City Business

    tags = ["City Matters", "City Business"]

    if title.startswith(('vacation',
                         'amendment of vacation')) :
        return tags + ['Non-Routine', 'Vacation of Public Street']

    if title.startswith(('sale of city-owned propert',
                         'amendment of acquisition of propert',
                         'conveyance of city',
                         'approval of land sale',
                         'acceptance of bid for property',
                         'land transfer',
                         'transfer of merchant park property',
                         'amendment to terms of previously authorized land transactions',
                         'transfer of parcels',
                         'transfer of property',
                         'acceptance of propert',
                         'conveyance of propert',
                         'amendment of land sale',
                         'conveyance of open space land',
                         'negotiated sale of city-owned property',
                         'acquisition')) :
        return tags + ['Non-Routine',
                       'Getting and Giving Land']

    if title.startswith(('lease agreement',
                         'lease ageement',
                         'sub-lease agreement',
                         'amendment of lease',
                         'amendment to lease')) :
        return tags + ['Non-Routine', 'Lease Agreement']

    if title.startswith(('donation', 'donate')) :
        return tags + ['Non-Routine', 'Donation of City Property']

    if 'easement' in title :
        return tags + ['Non-Routine', 'Easements']

    if title.startswith(('intergovernmental agreement',
                         'renewal of intergovernment',
                         'intergovernment agreement',
                         'amendment of intergovernmental agreement')) :
        return tags + ['Non-Routine', 'Intergovernmental Agreement']

    if title.startswith(('loan agreement',
                         'multi-family loan agreement',
                         'loan assumption',
                         'amendment of terms',
                         'loan modification',
                         'amendment of loan agreement',
                         'loan restructure')) :
        return tags + ['Non-Routine', 'Loan Agreement']

    # Council Matters

    tags = ["Council Matters"]

    if title.startswith(('fixed for next city council meeting',
                         'time fixed',
                         'time fixed for next city council meeting',
                         'amending city council meeting time')) :
        return tags + ['Routine', 'Next Meeting']

    if title.startswith(('correction of city council journal',
                         'correction of journal')) :
        return tags + ['Non-Routine', 'Correction of City Council Journal']

    if title.startswith(('call for hearing',)) :
        return tags + ['Non-Routine', 'Call for Hearing']

    if title.startswith(('transfer of funds to committee',
                         'transfer of funds within committee',
                         'transfer of funds within the city council committee',
                         'transfer of funds within city council committee',
                         'transfer of funds within the committee',
                         'transfer of year 2013 funds within committee',
                         'transfer of funds to committee')) :
        return tags + ['Non-Routine', 'Transfer of Committee Funds']

    if 'city council committee' in title and 'budget' in title :
        return tags + ['Non-Routine', 'Committee Budgets']

    if 'fail to pass all legislation' in title :
        return tags + ['Non-Routine', 'Fail to Pass All Legislation']

    if title.startswith(('call for',
                         'call upon',
                         'call to',
                         'expression of support',
                         'support of',
                         'expression of opposition',
                         'denouncement',
                         'condemnation of')) :
        return tags + ['Non-Routine', 'Call for Action']

    if (title.startswith(('city council rule',
                         'amendment of rule')) or
        'rules of order and procedure' in title):
        return tags + ['Non-Routine', 'City Council Rules']

    if any(s in title for s in ('elected vice-mayor', 'president pro tempore')):
        return tags + ['Non-Routine', 'City Council Positions']

    tags = []

    if title.startswith(('redevelopment agreement',
                         'amendment to previous redevelopment agreement',
                         'amendment of redevelopment agreement',
                         'first amendment to redevelopment agreement',
                         )) or 'associated redevelopment agreement' in title :
        return tags + ['Non-Routine', 'Redevelopment Agreement']

    if title.startswith(('system test', 'test')) :
        return tags + ['Routine', 'Test']

    if title == '':
        return tags + ['No Info']

    return ['Non-Routine', 'Unclassified']


text:
@implementation UIDevice (JPCategory)

+ (BOOL)isIOS7
{
    return __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_7_0;
}

+ (BOOL)isIphone5
{
    return ([[UIScreen mainScreen] bounds].size.height == 568);
}

+ (BOOL)isSimulator {
	static NSString *simulatorModel = @"iPhone Simulator";
	return [[[UIDevice currentDevice] model] isEqualToString:simulatorModel];
}
@end


text:
using System;
using System.Threading;

namespace TddEbook.TddToolkit.LockSpecificAssertions
{
  public class MonitorAssertions : LockAssertions
  {
    private readonly object _aLock;

    public MonitorAssertions(object aLock)
    {
      _aLock = aLock;
    }

    public void AssertUnlocked()
    {
      try
      {
        Monitor.Exit(_aLock);
        throw new Exception("Expected lock not being held, but it is!");
      }
      catch (SynchronizationLockException)
      {
      }
    }

    public void AssertLocked()
    {
      Monitor.Exit(_aLock);
      Monitor.Enter(_aLock);
    }
  }
}


text: package ograph


text:
import * as React from 'react'
import { StaticRouter, Route } from 'react-router-dom'

// This example renders a route within a StaticRouter and populates its staticContext,
// which it then prints out.
// In the real world you would use the StaticRouter for server-side rendering:
//
// import * as express from 'express'
// import { renderToString } from 'react-dom/server'
//
// const app = express()
//
// app.get('*', (req, res) => {
//     const staticContext = {}
//
//     const html = renderToString(
//         <StaticRouter location={req.url} context={staticContext}>
//             <App /> (includes the RouteStatus component below e.g. for 404 errors)
//         </StaticRouter>
//     )
//
//     res.status(staticContext.statusCode || 200).send(html)
// })
//
// app.listen(process.env.PORT || 3000)

const RouteStatus = (props) => (
    <Route
        render={({ staticContext }) => {
            // we have to check if staticContext exists
            // because it will be undefined if rendered through a BrowserRouter
            if (staticContext) {
                staticContext.statusCode = props.statusCode
            }

            return (

                    {props.children}

            )
        }}
    />
)

const PrintContext = (props) => (

        Static context: {JSON.stringify(props.staticContext)}

)

class StaticRouterExample extends React.Component {

    // This is the context object that we pass to the StaticRouter.
    // It can be modified by routes to provide additional information
    // for the server-side render
    staticContext : {}

    render() {
        return (
            <StaticRouter location="/foo" context={this.staticContext}>

                    <RouteStatus statusCode={404}>

Route with statusCode 404

                        <PrintContext staticContext={this.staticContext} />
                    </RouteStatus>

            </StaticRouter>
        )
    }
}

export default StaticRouterExample


text:
import argparse

import torch

from models.lenet import LeNet
import utils

# setup logger
logger = utils.get_logger("convert")

def get_args():
    parser = argparse.ArgumentParser()
    parser.add_argument("--pretrained", required=True, type=str)
    return parser.parse_args()

def train(args):
    pretrained = args.pretrained

    # check whether gpu is available
    device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")

    # setup network
    model = LeNet()
    model.load_state_dict(torch.load(pretrained))
    model.to(device)
    model.eval()

    print(model)
    # LeNet(
    #     (conv1): Conv2d(1, 6, kernel_size=(5, 5), stride=(1, 1), padding=(2, 2))
    #     (pool1): MaxPool2d(kernel_size=2, stride=2, padding=0, dilation=1, ceil_mode=False)
    #     (conv2): Conv2d(6, 16, kernel_size=(5, 5), stride=(1, 1))
    #     (pool2): MaxPool2d(kernel_size=2, stride=2, padding=0, dilation=1, ceil_mode=False)
    #     (flatten): Flatten(start_dim=1, end_dim=-1)
    #     (fc1): Linear(in_features=400, out_features=120, bias=True)
    #     (fc2): Linear(in_features=120, out_features=84, bias=True)
    #     (fc3): Linear(in_features=84, out_features=10, bias=True)
    # )

    logger.info("Start Conversion")

    batch = 1
    channel = 1
    height = 28
    width = 28
    dummy = torch.randn((batch, channel, height, width))
    torch.onnx.export(model, dummy.to(device), "lenet.onnx", verbose=True)

    logger.info("Finished Conversion")

if __name__ == '__main__':
    # parse args
    args = get_args()
    pretrained = args.pretrained

    logger.info("Arguments")
    logger.info("     pretrained: {}".format(pretrained))

    train(args)


text:
namespace mojo {

bool StructTraits<blink::mojom::ParsedFeaturePolicyDeclarationDataView,
                  blink::ParsedFeaturePolicyDeclaration>::
    Read(blink::mojom::ParsedFeaturePolicyDeclarationDataView in,
         blink::ParsedFeaturePolicyDeclaration* out) {
  out->fallback_value = in.fallback_value();
  out->opaque_value = in.opaque_value();
  return in.ReadFeature(&out->feature) &&
         in.ReadAllowedOrigins(&out->allowed_origins);
}

}  // namespace mojo


text:
export builddir_name ?= ./build/.
.PHONY: all
all:
	$(MAKE) myaddon


text:
// The MIT License (MIT)
//
// Copyright (c) 2017 Timothy D. Jones
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
package io.github.jonestimd.swing;

import java.awt.Component;

/**
 * This class saves status messages and the enabled state until a component is showing within a {@link StatusIndicator}.
 * Once the component is showing, messages and state changes are passed to its containing {@link StatusIndicator}.
 */
public class DeferredStatusIndicator implements StatusIndicator {
    private StatusIndicator delegate;
    private boolean disabled = false;
    private String statusMessage;

    public DeferredStatusIndicator(Component component) {
        VisibilityHandler.addCallback(component, this::onShowing);
    }

    private void onShowing(Component component) {
        delegate = ComponentTreeUtils.findAncestor(component, StatusIndicator.class);
        if (disabled) delegate.disableUI(statusMessage);
        else if (statusMessage != null) delegate.setStatusMessage(statusMessage);
    }

    @Override
    public void setStatusMessage(String message) {
        this.statusMessage = message;
        if (delegate != null) delegate.setStatusMessage(message);
        else LoggerStatusIndicator.INSTANCE.setStatusMessage(message);
    }

    @Override
    public void disableUI(String message) {
        this.disabled = true;
        this.statusMessage = message;
        if (delegate != null) delegate.disableUI(message);
        else LoggerStatusIndicator.INSTANCE.setStatusMessage(message);
    }

    @Override
    public void enableUI() {
        this.disabled = false;
        if (delegate != null) delegate.enableUI();
    }
}


text:
<?php

/* High5HospitalDoctorBundle:Default:login.html.twig */
class __TwigTemplate_6d8593ad89349ff4908fc9c9ab8d14f019939a4bcb1a3faa3892c7c474701c81 extends Twig_Template
{
    public function __construct(Twig_Environment $env)
    {
        parent::__construct($env);

        $this->parent = $this->env->loadTemplate("High5HospitalDoctorBundle:Default:base.html.twig");

        $this->blocks = array(
            'body' => array($this, 'block_body'),
            'content' => array($this, 'block_content'),
        );
    }

    protected function doGetParent(array $context)
    {
        return "High5HospitalDoctorBundle:Default:base.html.twig";
    }

    protected function doDisplay(array $context, array $blocks = array())
    {
        $this->parent->display($context, array_merge($this->blocks, $blocks));
    }

    // line 2
    public function block_body($context, array $blocks = array())
    {
        // line 3
        echo "

Login

                    ";
        // line 15
        $this->displayBlock('content', $context, $blocks);
        // line 20
        echo "

";
    }

    // line 15
    public function block_content($context, array $blocks = array())
    {
        // line 16
        echo "                        ";
        echo         $this->env->getExtension('form')->renderer->renderBlock((isset($context["login_form"]) ? $context["login_form"] : $this->getContext($context, "login_form")), 'form_start');
        echo "
                        ";
        // line 17
        echo $this->env->getExtension('form')->renderer->searchAndRenderBlock((isset($context["login_form"]) ? $context["login_form"] : $this->getContext($context, "login_form")), 'widget');
        echo "
                        ";
        // line 18
        echo         $this->env->getExtension('form')->renderer->renderBlock((isset($context["login_form"]) ? $context["login_form"] : $this->getContext($context, "login_form")), 'form_end');
        echo "
                    ";
    }

    public function getTemplateName()
    {
        return "High5HospitalDoctorBundle:Default:login.html.twig";
    }

    public function isTraitable()
    {
        return false;
    }

    public function getDebugInfo()
    {
        return array (  72 => 18,  68 => 17,  63 => 16,  60 => 15,  48 => 20,  46 => 15,  32 => 3,  29 => 2,);
    }
}


text: export default class Element {}


text:
<?php

// Require Rediska
require_once dirname(__FILE__) . '/../../../../Rediska.php';

/**
 * @see Zend_Cache_Backend
 */
require_once 'Zend/Cache/Backend.php';

/**
 * @see Zend_Cache_Backend_ExtendedInterface
 */
require_once 'Zend/Cache/Backend/ExtendedInterface.php';

/**
 * Redis adapter for Zend_Cache
 *
 * @author Ivan Shumkov
 * @package Rediska
 * @subpackage ZendFrameworkIntegration
 * @version @package_version@
 * @link http://rediska.geometria-lab.net
 * @license http://www.opensource.org/licenses/bsd-license.php
 */
class Rediska_Zend_Cache_Backend_Redis extends Zend_Cache_Backend implements Zend_Cache_Backend_ExtendedInterface
{
    /**
     * Defines the hash field name for the cached data.
     * @var string
     */
    const FIELD_DATA      = 'd';
    /**
     * Defines the hash field name for the cached data mtime.
     * @var string
     */
    const FIELD_MTIME     = 'm';
    /**
     * Defines the hash field name for the cached item tags.
     * @var string
     */
    const FIELD_TAGS      = 't';
    /**
     * Defines the hash field name for the infinite item.
     * @var string
     */
    const FIELD_INF       = 'i';

    /**
     * Redis backend limit
     * @var integer
     */
    const MAX_LIFETIME    = 2592000;
    /**
     * The options storage for this Backend
     * @var array
     */
    protected $_options = array(
        'storage' => array(
            'set_ids'         => 'zc:ids',
            'set_tags'        => 'zc:tags',
            'prefix_key'      => 'zc:k:',
            'prefix_tag_ids'  => 'zc:ti:',
        )
    );
    /**
     * Rediska instance
     *
     * @var Rediska
     */
    protected $_rediska = Rediska::DEFAULT_NAME;
    /**
     *
     * @var Rediska_Transaction
     */
    protected $_transaction;

    /**
     * Contruct Zend_Cache Redis backend
     *
     * Available options are :
     * 'storage`
     *     - set_ids        : the set name that all ids are storage
     *     - set_tags       : the set name that stores the tags
     *     - prefix_key     : the prefix value for all item keys
     *     - prefix_tag_ids : the key prefix value for all tag -to- id items
     *
     * @param mixed $rediska Rediska instance name, Rediska object or array of options
     */
    public function __construct($options = array())
    {
        if ($options instanceof Zend_Config) {
            $options = $options->toArray();
        }
        if (isset($options['rediska'])) {
            $this->setRediska($options['rediska']);
        }
        if(isset($options['storage'])){
            $this->setStorage($options['storage']);
        }
    }
    /**
     *
     * @param  array $options
     * @return Rediska_Zend_Cache_Backend_Redis
     * @throws Zend_Cache_Exception
     */
    public function setStorage($options)
    {
        foreach ($options as $name => $value) {
            if (!is_string($value)) {
                Zend_Cache::throwException(
                    sprintf(
                        'Incorrect value for option %s : `string` expected `%s` provided',
                        $name, gettype($value)
                    )
                );
            }
            $name = strtolower($name);
            if(isset($this->_options['storage'][$name]) ){
                $this->_options['storage'][$name] = $value;
            }
        }
        return $this;
    }
    /**
     *
     * @param  Rediska $rediska
     * @return Rediska_Zend_Cache_Backend_Redis
     */
    public function setRediska($rediska)
    {
        $this->_rediska = $rediska;
        return $this;
    }
    /**
     *
     * @return Rediska
     */
    public function getRediska()
    {
        if (!is_object($this->_rediska)) {
            $this->_rediska = Rediska_Options_RediskaInstance::getRediskaInstance(
                $this->_rediska, 'Zend_Cache_Exception', 'backend'
            );
        }

        return $this->_rediska;
    }
    /**
     *
     * @param  string $name
     * @return multitype:|boolean
     */
    public function getOption($name)
    {
        if (!is_string($name)) {
            Zend_Cache::throwException(
                sprintf(
                    'Incorrect option name %s provided, `string` expected `%s` provided',
                    $name, gettype($name)
                )
            );
        }
        $name = strtolower($name);
        if(isset($this->_options[$name])){
            return $this->_options[$name];
        }
        return false;
    }
    /**
     * Load value with given id from cache
     *
     * @param  string  $id                     Cache id
     * @param  boolean $doNotTestCacheValidity If set to true, the cache validity won't be tested
     * @return string|false cached datas
     */
    public function load($id, $doNotTestCacheValidity = false)
    {
        $id = (array) $id;
        foreach ($id as $key){
            $key = $this->_options['storage']['prefix_key'] . $key;
            $this->_getTransactionByKey($key)
                ->getFromHash(
                    $key,
                    self::FIELD_DATA
                );
        }
        $oldSerializaerAdapter = $this->getRediska()->getSerializer()->getAdapter();
        $this->getRediska()->setSerializerAdapter('toString');
        $result = $this->_execTransactions();
        $this->getRediska()->getSerializer()->setAdapter($oldSerializaerAdapter);
        if(count($result) == 1){
            if(null === ($result = array_shift($result))){
                return false;
            } else {
                return $result;
            }
        } else {
            return $result;
        }
    }

    /**
     * Test if a cache is available or not (for the given id)
     *
     * @param  string $id Cache id
     * @return mixed|false (a cache is not available) or "last modified" timestamp (int) of the available cache record
     */
    public function test($id)
    {
        $mtime = $this->getRediska()->getFromHash(
            $this->_options['storage']['prefix_key'].$id, self::FIELD_MTIME
        );
        return ($mtime ? $mtime : false);
    }

    /**
     * Save some string datas into a cache record
     *
     * Note : $data is always "string" (serialization is done by the
     * core not by the backend)
     *
     * @param  string  $data             Datas to cache
     * @param  string  $id               Cache id
     * @param  array   $tags             Array of strings, the cache record will be tagged by each string entry
     * @param  int     $specificLifetime If != false, set a specific lifetime for this cache record (null => infinite lifetime)
     * @return boolean True if no problem
     */
    public function save($data, $id, $tags = array(), $specificLifetime = false)
    {
        if(!is_array($tags)) $tags = array($tags);

        $lifetime = $this->getLifetime($specificLifetime);

        $oldTags = explode(
            ',', $this->getRediska()->getFromHash(
                $this->_options['storage']['prefix_key'].$id, self::FIELD_TAGS
            )
        );

        $this->_getTransactionByKey($this->_options['storage']['prefix_key'].$id)
            ->setToHash(
                $this->_options['storage']['prefix_key'].$id,  array(
                self::FIELD_DATA => $data,
                self::FIELD_TAGS => implode(',',$tags),
                self::FIELD_MTIME => time(),
                self::FIELD_INF => $lifetime ? 0 : 1)
            );
        $this->_getTransactionByKey($this->_options['storage']['prefix_key'].$id)
            ->expire($this->_options['storage']['prefix_key'].$id, $lifetime ? $lifetime : self::MAX_LIFETIME);
        if ($addTags = ($oldTags ? array_diff($tags, $oldTags) : $tags)) {
            foreach ($addTags as $add) {
                $this->_getTransactionByKey($this->_options['storage']['set_tags'])
                    ->addToSet($this->_options['storage']['set_tags'], $add);
            }
            foreach($addTags as $tag){
                $this->_getTransactionByKey($this->_options['storage']['prefix_tag_ids'] . $tag)
                    ->addToSet($this->_options['storage']['prefix_tag_ids'] . $tag, $id);
            }
        }
        if ($remTags = ($oldTags ? array_diff($oldTags, $tags) : false)){
            foreach($remTags as $tag){
                $this->_getTransactionByKey($this->_options['storage']['prefix_tag_ids'] . $tag)
                    ->deleteFromSet($this->_options['storage']['prefix_tag_ids'] . $tag, $id);
            }
        }
        $this->_getTransactionByKey($this->_options['storage']['set_ids'])
            ->addToSet($this->_options['storage']['set_ids'], $id);
        try {
            $this->_execTransactions();
            return true;
        } catch(Rediska_Transaction_Exception $e){
            $this->_log($e->getMessage(), Zend_Log::ERR);
            return false;
        }

    }

    /**
     * Remove a cache record
     *
     * @param  string $id Cache id
     * @return boolean True if no problem
     */
    public function remove($id)
    {
        $tags = explode(
            ',', $this->getRediska()->getFromHash(
                $this->_options['storage']['prefix_key'].$id, self::FIELD_TAGS
            )
        );

        $this->_getTransactionByKey($this->_options['storage']['prefix_key'].$id)
            ->delete($this->_options['storage']['prefix_key'].$id);
        $this->_getTransactionByKey($this->_options['storage']['set_ids'], $id)
            ->deleteFromSet( $this->_options['storage']['set_ids'], $id );
        foreach($tags as $tag) {
            $this->_getTransactionByKey($this->_options['storage']['prefix_tag_ids'] . $tag)
                ->deleteFromSet($this->_options['storage']['prefix_tag_ids'] . $tag, $id);
        }
        $result = $this->_execTransactions();
        if(count($result)){
            return array_shift($result);
        } else {
            return false;
        }
    }

    /**
     * Clean some cache records
     *
     * Available modes are :
     * 'all' (default)  => remove all cache entries ($tags is not used)
     * 'old'            => supported
     * 'matchingTag'    => supported
     * 'notMatchingTag' => supported
     * 'matchingAnyTag' => supported
     *
     * @param  string $mode Clean mode
     * @param  array  $tags Array of tags
     * @throws Zend_Cache_Exception
     * @return boolean True if no problem
     */
    public function clean($mode = Zend_Cache::CLEANING_MODE_ALL, $tags = array())
    {
        if( $tags && ! is_array($tags)) {
            $tags = array($tags);
        }
        $result = true;
        switch ($mode) {
            case Zend_Cache::CLEANING_MODE_ALL:
                $this->_removeIds($this->getIds());
                break;

            case Zend_Cache::CLEANING_MODE_OLD:
                break;

            case Zend_Cache::CLEANING_MODE_MATCHING_TAG:
                $this->_removeIdsByMatchingTags($tags);
                break;

            case Zend_Cache::CLEANING_MODE_NOT_MATCHING_TAG:
                $this->_removeIdsByNotMatchingTags($tags);
                break;

            case Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG:
                $this->_removeIdsByMatchingAnyTags($tags);
                break;

            default:
                Zend_Cache::throwException('Invalid mode for clean() method: '.$mode);
        }
        return $this->_collectGarbage();
    }
    /**
     *
     * @param  array $ids
     * @return boolean
     */
    protected function _removeIds($ids = array())
    {
        foreach($ids as $id){
            $this->_getTransactionByKey($this->_options['storage']['prefix_key']. $id)
                ->delete($this->_options['storage']['prefix_key']. $id);
            $this->_getTransactionByKey($this->_options['storage']['set_ids'])
                ->deleteFromSet( $this->_options['storage']['set_ids'], $id);
        }
        return (bool) $this->_execTransactions();
    }

    /**
     * @param array $tags
     */
    protected function _removeIdsByNotMatchingTags($tags)
    {
        $ids = $this->getIdsNotMatchingTags($tags);
        $this->_removeIds($ids);
    }
    /**
     * @param array $tags
     */
    protected function _removeIdsByMatchingTags($tags)
    {
        $ids = $this->getIdsMatchingTags($tags);
        $this->_removeIds($ids);
    }

    /**
     * @param array $tags
     */
    protected function _removeIdsByMatchingAnyTags($tags)
    {
        $ids = $this->getIdsMatchingAnyTags($tags);
        $this->_removeIds($ids);

        foreach ($this->_preprocessTagIds($tags) as $tag) {
            $this->_getTransactionByKey($tag)->delete($tag);
        }
        $this->_getTransactionByKey($this->_options['storage']['set_tags'])
            ->deleteFromSet( $this->_options['storage']['set_tags'], $tags);

        return (bool) $this->_execTransactions();
    }
    /**
     * Return true if the automatic cleaning is available for the backend
     *
     * @return boolean
     */
    public function isAutomaticCleaningAvailable()
    {
        return true;
    }

    /**
     * Set the frontend directives
     *
     * @param  array $directives Assoc of directives
     * @throws Zend_Cache_Exception
     * @return void
     */
    public function setDirectives($directives)
    {
        parent::setDirectives($directives);
        $lifetime = $this->getLifetime(false);
        if ($lifetime > self::MAX_LIFETIME) {
            $this->_log(
                'redis backend has a limit of 30 days (' . self::MAX_LIFETIME
                . ' seconds) for the lifetime'
            );
        }
    }

    /**
     * Return an array of stored cache ids
     *
     * @return array array of stored cache ids (string)
     */
    public function getIds()
    {
        return (array) $this->getRediska()->getSet($this->_options['storage']['set_ids']);
    }

    /**
     * Return an array of stored tags
     *
     * @return array array of stored tags (string)
     */
    public function getTags()
    {
        return $this->getRediska()->getSet($this->_options['storage']['set_tags']);
    }

    /**
     * Return an array of stored cache ids which match given tags
     *
     * In case of multiple tags, a logical AND is made between tags
     *
     * @param array $tags array of tags
     * @return array array of matching cache ids (string)
     */
    public function getIdsMatchingTags($tags = array())
    {
        return (array) $this->getRediska()->intersectSets(
            $this->_preprocessTagIds($tags)
        );
    }

    /**
     * Return an array of stored cache ids which don't match given tags
     *
     * In case of multiple tags, a logical OR is made between tags
     *
     * @param array $tags array of tags
     * @return array array of not matching cache ids (string)
     */
    public function getIdsNotMatchingTags($tags = array())
    {
            $sets = $this->_preprocessTagIds($tags);
            array_unshift($sets, $this->_options['storage']['set_ids']);
            $data = $this->getRediska()->diffSets($sets);
            return $data;
    }

    /**
     * Return an array of stored cache ids which match any given tags
     *
     * In case of multiple tags, a logical AND is made between tags
     *
     * @param array $tags array of tags
     * @return array array of any matching cache ids (string)
     */
    public function getIdsMatchingAnyTags($tags = array())
    {
        return (array) $this->getRediska()->unionSets($this->_preprocessTagIds($tags));
    }

    /**
     * Return the filling percentage of the backend storage
     *
     * @throws Zend_Cache_Exception
     * @return int integer between 0 and 100
     */
    public function getFillingPercentage()
    {
        $this->_log("Filling percentage not supported by the Redis backend");
        return 0;
    }

    /**
     * Return an array of metadatas for the given cache id
     *
     * The array must include these keys :
     * - expire : the expire timestamp
     * - tags : a string array of tags
     * - mtime : timestamp of last modification time
     *
     * @param string $id cache id
     * @return array array of metadatas (false if the cache id is not found)
     */
    public function getMetadatas($id)
    {
        $metaData = $this->getRediska()->getFromHash(
            $this->_options['storage']['prefix_key'].$id,
            array(self::FIELD_DATA, self::FIELD_TAGS, self::FIELD_MTIME, self::FIELD_INF)
        );
        if(!$metaData[self::FIELD_MTIME]) {
          return false;
        }
        $lifetime = $this->getRediska()
            ->getLifetime($this->_options['storage']['prefix_key'] . $id);
        $tags = explode(',', $metaData[self::FIELD_TAGS]);
        $expire = $metaData[self::FIELD_INF] === '1' ? false : time() + $lifetime;

        return array(
            'expire' => $expire,
            'tags'   => $tags,
            'mtime'  => $metaData[self::FIELD_MTIME],
        );
    }

    /**
     * Give (if possible) an extra lifetime to the given cache id
     *
     * @param string $id cache id
     * @param int $extraLifetime
     * @return boolean true if ok
     */
    public function touch($id, $extraLifetime)
    {
        $data = $this->getRediska()->getFromHash(
            $this->_options['storage']['prefix_key'].$id, array(self::FIELD_INF)
        );
        $lifetime = $this->getRediska()
            ->getLifetime($this->_options['storage']['prefix_key'] . $id);
        if ($data[self::FIELD_INF] === 0) {
            $expireAt = time() + $lifetime + $extraLifetime;
            return (bool) $this->getRediska()->expire(
                $this->_options['storage']['prefix_key'].$id, $expireAt, true
            );
        }
        return false;
    }

    /**
     * Return an associative array of capabilities (booleans) of the backend
     *
     * The array must include these keys :
     * - automatic_cleaning (is automating cleaning necessary)
     * - tags (are tags supported)
     * - expired_read (is it possible to read expired cache records
     *                 (for doNotTestCacheValidity option for example))
     * - priority does the backend deal with priority when saving
     * - infinite_lifetime (is infinite lifetime can work with this backend)
     * - get_list (is it possible to get the list of cache ids and the complete list of tags)
     *
     * @return array associative of with capabilities
     */
    public function getCapabilities()
    {
        return array(
            'automatic_cleaning' => true,
            'tags'               => true,
            'expired_read'       => true,
            'priority'           => false,
            'infinite_lifetime'  => true,
            'get_list'           => true
        );
    }
    /**
     * Cleans up expired keys and list members
     * @return boolean
     */
    protected function _collectGarbage()
    {
        $exists = array();
        $tags = $this->getTags();
        foreach($tags as $tag){
            $prefix_tag_ids = $this->_options['storage']['prefix_tag_ids'] . $tag;
            $tagMembers = $this->getRediska()->getSet($prefix_tag_ids);
            $this->_getTransactionByKey($prefix_tag_ids)->watch($prefix_tag_ids);
            $expired = array();
            if(count($tagMembers)) {
                foreach($tagMembers as $id) {
                    if( ! isset($exists[$id])) {
                        $exists[$id] = $this->getRediska()
                            ->exists($this->_options['storage']['prefix_key'].$id);
                    }
                    if(!$exists[$id]) {
                        $expired[] = $id;
                    }
                }
                if(!count($expired)) continue;
            }
            if(!count($tagMembers) || count($expired) == count($tagMembers)) {
                $this->_getTransactionByKey($this->_options['storage']['set_tags'])
                    ->deleteFromSet($this->_options['storage']['set_tags'], $tag);
                $this->_getTransactionByKey($this->_options['storage']['prefix_tag_ids'] . $tag)
                    ->delete($this->_options['storage']['prefix_tag_ids'] . $tag);
            } else {
                $this->_getTransactionByKey($this->_options['storage']['prefix_tag_ids'] . $tag)
                    ->deleteFromSet( $this->_options['storage']['prefix_tag_ids'] . $tag, $expired);
            }
            $this->_getTransactionByKey($this->_options['storage']['set_ids'])
                ->deleteFromSet( $this->_options['storage']['set_ids'], $expired);
        }
        try{
            return (bool) $this->_execTransactions();
        } catch (Rediska_Transaction_AbortedException $e ){
            $this->_log($e->getMessage(), Zend_Log::ERR);
            return false;
        }
    }
    /**
     * @param $item
     * @param $index
     * @param $prefix
     */
    protected function _preprocess(&$item, $index, $prefix)
    {
        $item = $prefix . $item;
    }

    /**
     * @param $ids
     * @return array
     */
    protected function _preprocessIds($ids)
    {
        array_walk($ids, array($this, '_preprocess'), $this->_options['storage']['prefix_key']);
        return $ids;
    }
    /**
     * @param $tags
     * @return array
     */
    protected function _preprocessTagIds($tags)
    {
        if($tags){
            array_walk($tags, array($this, '_preprocess'), $this->_options['storage']['prefix_tag_ids']);
        }
        return $tags;
    }

    /**
     * @param string $key
     *
     * @return Rediska_Transaction
     */
    protected function _getTransactionByKey($key)
    {
        $connection = $this->getRediska()->getConnectionByKeyName($key);
        if(!isset($this->_transaction[$connection->getAlias()])){
            $this->_transaction[$connection->getAlias()] = $this->getRediska()
                ->transaction($connection);
        }
        return $this->_transaction[$connection->getAlias()];
    }

    /**
     * @return array
     */
    protected function _execTransactions()
    {
        $result = array();
        /* @var Rediska_Transaction $transaction */
        if ($this->_transaction) {
            foreach ($this->_transaction as $transaction) {
                /*
                 * Do not execute empty transaction avoiding a false
                 * `Rediska_Transaction_AbortedException`
                 */
                $preamble = substr(
                    (string)$transaction, 0,
                    strlen(Rediska_Transaction::TRANSACTION_PREAMBLE)
                );
                if (Rediska_Transaction::TRANSACTION_PREAMBLE == $preamble){
                    $result = array_merge($result, $transaction->execute());
                } else {
                    $transaction->discard();
                }
            }
        }
        return $result;
    }
}


text:
An always on-top toast application for your current song, artist, time, and album art

# Why did I make this?
Some of the applications that are used for Spotify similar to this aren't updated to todays standards. So I figured, why not make my own.

# How to use
Simple! Just open the application, and it's ready to go as long as you have Spotify open!

You can also access the Options menu by clicking the version # in the bottom right, or double clicking the tray icon, or pressing CTRL-O while the app is active

If your settings somehow miraculously dissapear or mess up, just delete the config

How do you open the options menu via Toast Mode? Double click the purple icon in your task bar

# Imagery
* https://i.imgur.com/jLou2uB.png
* https://i.imgur.com/4tRrXGl.png
* https://i.imgur.com/DD6BoRM.gifv
* https://i.imgur.com/TABEjms.gifv

# Todo
* ~~Make an option for an actual toast to show up on screen when song changes~~ - done
* Make the app better looking in general
* ~~Make the app work on Linux~~ - done
* Fixing any [issues](https://github.com/Ashleyz4/Spotify-Toast/issues) that the application has

#
If you have an issue with this, please post in the [issues](https://github.com/Ashleyz4/Spotify-Toast/issues) tab

If you would like to download the latest exe, it can be found [in the downloads](https://github.com/Ashleyz4/Spotify-Toast/releases) section

### Interested in the source code?
I used SpotifyAPI-Net, you can find it [here](https://github.com/johnnycrazy/SpotifyAPI-NET)

You can also do whatever you want with my code, just give me credit, I'd appreciate it.

v1.1.7             |  v2.0
:-------------------------:|:-------------------------:
![image](https://i.imgur.com/VtcgmLB.png)  |  ![image](https://i.imgur.com/FVxOKXz.png)


text:
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using OrderSystem.Data;
using OrderSystem.Enums;
using OrderSystem.Models;

namespace OrderSystem.Views.Pages
{
    /// <summary>
    /// The credit page
    /// </summary>
    public partial class CreditPage : AppPage
    {
        private ObservableCollection<Credit> creditTable;
        private CreditModel creditModel;

        public CreditPage()
        {
        }

        public override void LoadView()
        {
            InitializeComponent();
            LoadedView = true;
        }

        public override void LoadResources()
        {
            LoadMembers();
            LoadCurrentCredit();
            LoadCredits();
            LoadedResources = true;
        }

        public override void ReloadResources()
        {
            LoadCurrentCredit();
            LoadCredits();
        }

        private void LoadMembers()
        {
            creditTable = new ObservableCollection<Credit>();
            dgCredit.DataContext = this;

            creditModel = (CreditModel) ModelRegistry.Get(ModelIdentifier.Credit);
        }

        private void LoadCurrentCredit()
        {
            lbCredit.Content = string.Format("€ {0,00}", creditModel.GetCurrentCredit(Session.Instance.CurrentUserId));
        }

        private void LoadCredits()
        {
            creditTable.Clear();

            foreach (Credit credit in creditModel.GetPendingCredits(Session.Instance.CurrentUserId))
            {
                creditTable.Add(credit);
            }
        }

        public ObservableCollection<Credit> CreditTable
        {
            get { return creditTable; }
        }

        private void OnChargeCredit(object sender, RoutedEventArgs e)
        {
            try
            {
                decimal price = duPrice.Value ?? 0;

                if (price <= 0)
                {
                    throw new Exception("Der Betrag muss größer als 0 sein.");
                }

                if (!creditModel.AddCredit(price, Session.Instance.CurrentUserId))
                {
                    throw new Exception("Guthaben konnte nicht erstellt werden.");
                }

                ReloadResources();
                duPrice.Value = 0;
                MessageBox.Show("Bitte bezahl das Geld bei einem Administrator, damit das Guthaben aufgeladen wird.");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }

        private void OnDeleteOrder(object sender, RoutedEventArgs e)
        {
            try
            {
                Credit row = ((FrameworkElement)sender).DataContext as Credit;
                if (row.Status == CreditStatus.Deleted)
                {
                    throw new Exception("Das Guthaben wurde bereits gelöscht.");
                }

                if (!creditModel.Delete(row.Id))
                {
                    throw new Exception("Das Guthaben konnte nicht gelöscht werden.");
                }

                ReloadResources();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
    }
}


text:
package org.elasticsearch.index.analysis;

import org.elasticsearch.Version;
import org.elasticsearch.cluster.metadata.IndexMetaData;
import org.elasticsearch.common.inject.Injector;
import org.elasticsearch.common.inject.ModulesBuilder;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.settings.SettingsModule;
import org.elasticsearch.env.Environment;
import org.elasticsearch.env.EnvironmentModule;
import org.elasticsearch.index.Index;
import org.elasticsearch.indices.analysis.AnalysisModule;
import org.elasticsearch.plugin.analysis.smartcn.AnalysisSmartChinesePlugin;
import org.elasticsearch.test.ESTestCase;
import org.elasticsearch.test.IndexSettingsModule;
import org.elasticsearch.test.InternalSettingsPlugin;
import org.hamcrest.MatcherAssert;

import java.io.IOException;

import static org.elasticsearch.common.settings.Settings.settingsBuilder;
import static org.hamcrest.Matchers.instanceOf;

/**
 */
public class SimpleSmartChineseAnalysisTests extends ESTestCase {
    public void testDefaultsIcuAnalysis() throws IOException {
        Index index = new Index("test", "_na_");
        Settings settings = settingsBuilder()
                .put(Environment.PATH_HOME_SETTING.getKey(), createTempDir())
                .put(IndexMetaData.SETTING_VERSION_CREATED, Version.CURRENT)
                .build();
        AnalysisModule analysisModule = new AnalysisModule(new Environment(settings));
        new AnalysisSmartChinesePlugin().onModule(analysisModule);
        SettingsModule settingsModule = new SettingsModule(settings);
        settingsModule.registerSetting(InternalSettingsPlugin.VERSION_CREATED);
        Injector parentInjector = new ModulesBuilder().add(settingsModule,
                new EnvironmentModule(new Environment(settings)), analysisModule)
                .createInjector();
        final AnalysisService analysisService = parentInjector.getInstance(AnalysisRegistry.class).build(IndexSettingsModule.newIndexSettings(index, settings));
        TokenizerFactory tokenizerFactory = analysisService.tokenizer("smartcn_tokenizer");
        MatcherAssert.assertThat(tokenizerFactory, instanceOf(SmartChineseTokenizerTokenizerFactory.class));
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using AsyncTests.Framework;
using AsyncTests.HttpClientTests.Test;
using MonoMac.Foundation;
using MonoMac.AppKit;

namespace MonoMac.CFNetwork.Test.Views {

	public partial class PreferencesController : MonoMac.AppKit.NSWindowController {
		#region Constructors

		// Called when created from unmanaged code
		public PreferencesController (IntPtr handle) : base (handle)
		{
			Initialize ();
		}

		// Called when created directly from a XIB file
		[Export ("initWithCoder:")]
		public PreferencesController (NSCoder coder) : base (coder)
		{
			Initialize ();
		}

		// Call to load from the XIB/NIB file
		public PreferencesController () : base ("Preferences")
		{
			Initialize ();
		}

		// Shared initialization code
		void Initialize ()
		{
		}

		#endregion

		public static PreferencesController Global {
			get { return ((AppDelegate)NSApplication.SharedApplication.Delegate).Settings; }
		}

		//strongly typed window accessor
		public new Preferences Window {
			get {
				return (Preferences)base.Window;
			}
		}

		bool autoRedirect;
		bool downloadWithoutLength;
		bool useRelativeURL;
		bool useAuthentication;
		bool usePersistentAuthentication;
		NSString localServerAddress;
		NSString relativeURL;
		NSString userName;
		NSString password;
		WebDavConfiguration webDav;
		const string kAutoRedirect = "AutoRedirect";
		const string kDownloadWithoutLength = "DownloadWithoutLength";
		const string kUseRelativeURL = "UseRelativeURL";
		const string kRelativeURL = "RelativeURL";
		const string kUseAuthentication = "UseAuthentication";
		const string kUsePersistentAuthentication = "UsePersistentAuthentication";
		const string kUserName = "UserName";
		const string kPassword = "Password";
		const string kLocalServerAddress = "LocalServerAddress";
		const string kEnableWebDavTests = "EnableWebDavTests";
		const string kWebDavServer = "WebDavServer";
		const string kWebDavUserName = "WebDavUserName";
		const string kWebDavPassword = "WebDavPassword";

		public void RegisterDefaults ()
		{
			var dict = new NSMutableDictionary ();
			dict [kAutoRedirect] = NSNumber.FromBoolean (true);
			dict [kDownloadWithoutLength] = NSNumber.FromBoolean (false);
			dict [kUseRelativeURL] = NSNumber.FromBoolean (false);
			dict [kUseAuthentication] = NSNumber.FromBoolean (false);
			dict [kUsePersistentAuthentication] = NSNumber.FromBoolean (false);
			dict [kUserName] = (NSString)"mono";
			dict [kPassword] = (NSString)"monkey";
			dict [kLocalServerAddress] = (NSString)"http://localhost:8088/";

			dict [kEnableWebDavTests] = NSNumber.FromBoolean (false);
			dict [kWebDavServer] = (NSString)"http://localhost/uploads/";
			dict [kWebDavUserName] = (NSString)"admin";
			dict [kWebDavPassword] = (NSString)"monkey";
			NSUserDefaults.StandardUserDefaults.RegisterDefaults (dict);
		}

		public void LoadDefaults ()
		{
			var defaults = NSUserDefaults.StandardUserDefaults;
			webDav = TestSuite.GetConfiguration<WebDavConfiguration> ();

			autoRedirect = ((NSNumber)defaults [kAutoRedirect]).BoolValue;
			downloadWithoutLength = ((NSNumber)defaults [kDownloadWithoutLength]).BoolValue;
			useRelativeURL = ((NSNumber)defaults [kUseRelativeURL]).BoolValue;
			useAuthentication = ((NSNumber)defaults [kUseAuthentication]).BoolValue;
			usePersistentAuthentication = ((NSNumber)defaults [kUsePersistentAuthentication]).BoolValue;
			userName = (NSString)defaults [kUserName];
			password = (NSString)defaults [kPassword];
			localServerAddress = (NSString)defaults [kLocalServerAddress];

			webDav.IsEnabled = ((NSNumber)defaults [kEnableWebDavTests]).BoolValue;
			webDav.Server = (NSString)defaults [kWebDavServer];
			webDav.UserName = (NSString)defaults [kWebDavUserName];
			webDav.Password = (NSString)defaults [kWebDavPassword];
		}

		public void SaveDefaults ()
		{
			var defaults = NSUserDefaults.StandardUserDefaults;
			defaults [kAutoRedirect] = NSNumber.FromBoolean (autoRedirect);
			defaults [kDownloadWithoutLength] = NSNumber.FromBoolean (downloadWithoutLength);
			defaults [kUseRelativeURL] = NSNumber.FromBoolean (useRelativeURL);
			defaults [kUseAuthentication] = NSNumber.FromBoolean (useAuthentication);
			defaults [kUsePersistentAuthentication] = NSNumber.FromBoolean (usePersistentAuthentication);
			defaults [kUserName] = userName;
			defaults [kPassword] = password;
			defaults [kLocalServerAddress] = localServerAddress;

			defaults [kEnableWebDavTests] = NSNumber.FromBoolean (webDav.IsEnabled);
			defaults [kWebDavServer] = (NSString)webDav.Server;
			defaults [kWebDavUserName] = (NSString)webDav.UserName;
			defaults [kWebDavPassword] = (NSString)webDav.Password;
		}

		[Export (kAutoRedirect)]
		public bool AutoRedirect {
			get {
				return autoRedirect;
			}
			set {
				WillChangeValue (kAutoRedirect);
				autoRedirect = value;
				DidChangeValue (kAutoRedirect);
			}
		}

		[Export (kDownloadWithoutLength)]
		public bool DownloadWithoutLength {
			get {
				return downloadWithoutLength;
			}
			set {
				WillChangeValue (kDownloadWithoutLength);
				downloadWithoutLength = value;
				DidChangeValue (kDownloadWithoutLength);
			}
		}

		[Export (kUseRelativeURL)]
		public bool UseRelativeURL {
			get {
				return useRelativeURL;
			}
			set {
				WillChangeValue (kUseRelativeURL);
				useRelativeURL = value;
				DidChangeValue (kUseRelativeURL);
			}
		}

		[Export (kRelativeURL)]
		public NSString RelativeURL {
			get {
				return relativeURL;
			}
			set {
				WillChangeValue (kUseRelativeURL);
				relativeURL = value;
				DidChangeValue (kUseRelativeURL);
			}
		}

		[Export (kUseAuthentication)]
		public bool UseAuthentication {
			get {
				return useAuthentication;
			}
			set {
				WillChangeValue (kUseAuthentication);
				useAuthentication = value;
				DidChangeValue (kUseAuthentication);
			}
		}

		[Export (kUsePersistentAuthentication)]
		public bool UsePersistentAuthentication {
			get {
				return usePersistentAuthentication;
			}
			set {
				WillChangeValue (kUsePersistentAuthentication);
				usePersistentAuthentication = value;
				DidChangeValue (kUsePersistentAuthentication);
			}
		}

		[Export (kUserName)]
		public NSString UserName {
			get {
				return userName;
			}
			set {
				WillChangeValue (kUserName);
				userName = value;
				DidChangeValue (kUserName);
			}
		}

		[Export (kPassword)]
		public NSString Password {
			get {
				return password;
			}
			set {
				WillChangeValue (kPassword);
				password = value;
				DidChangeValue (kPassword);
			}
		}

		[Export (kLocalServerAddress)]
		public NSString LocalServerAddress {
			get {
				return localServerAddress;
			}
			set {
				WillChangeValue (kLocalServerAddress);
				localServerAddress = value;
				DidChangeValue (kLocalServerAddress);
			}
		}

		[Export (kEnableWebDavTests)]
		public bool EnableWebDavTests {
			get {
				return webDav.IsEnabled;
			}
			set {
				WillChangeValue (kEnableWebDavTests);
				webDav.IsEnabled = value;
				DidChangeValue (kEnableWebDavTests);
			}
		}

		[Export (kWebDavServer)]
		public string WebDavServer {
			get {
				return webDav.Server;
			}
			set {
				WillChangeValue (kWebDavServer);
				webDav.Server = value;
				DidChangeValue (kWebDavServer);
			}
		}

		[Export (kWebDavUserName)]
		public string WebDavUserName {
			get {
				return webDav.UserName;
			}
			set {
				WillChangeValue (kWebDavUserName);
				webDav.UserName = value;
				DidChangeValue (kWebDavUserName);
			}
		}

		[Export (kWebDavPassword)]
		public string WebDavPassword {
			get {
				return webDav.Password;
			}
			set {
				WillChangeValue (kWebDavPassword);
				webDav.Password = value;
				DidChangeValue (kWebDavPassword);
			}
		}
	}
}