text:
#formBox{
    display:block;
    width:100%;
    height:100%;
}
#formContainer{
    width:100%;
}
.padded-10{
    padding:15px 25px;
}
#formFoot{
    bottom:0px;
    height:52px;
}
.form-page{
    width:100%;
    position:absolute;
}
.form-page-head{
    background:url(../img/form-page-head-bg.jpg) repeat-x;
    height:61px;
    display:block;
    border-bottom:1px solid #e2e2e2;
}
.form-page-head h1{
    padding:19px 32px;
    font-size:24px;
    text-shadow:#FFF 0px 1px;
}
.form-page-body{
    padding:0px 0px 0px;
}
.form-page-body h2{
    color:#1d3854;
    font-size:14px;
    font-weight:bold;
}
.rate-title{
}
.rate-title-container{
    float:left;
    margin-right:10px;
}
.dynamic-stars-container{

}
.review-rating-stars .dynamic-stars{
    width:120px;
    margin-left:0px;
    left:0;
}
.dynamic-stars{
    width:120px;
    /*margin-left:-60px;
    left:50%;*/
}
.form-left-side{
    width:60%;
    float:left;
}
.form-right-side{
    width:40%;
    float:left;
}
.pad-right{
    margin-right:15px;
}
/* star ratings styles! yeah baby! */
.star-ratings{
    display:block;
    margin-top:5px;
    margin-bottom:10px;
}
.star-ratings .star-container{
    width:120px;
    float:left;
}
/*.star-ratings .star-container .star{
    float:left;
    width:24px;
    height:24px;
    background:url(../img/star-ratings.png);
    background-repeat:no-repeat;
    background-position:bottom;
    cursor:pointer;
}*/
.star-text{
    padding-top:6px;
    margin-left:130px;
    font-size:14px;
    font-weight:bold;
}
.form-custom-fields{
    margin-top:15px;
}
.form-feedback-title{
    margin-top:20px;
}
.form-field-block,.form-feedback-textbox{
    margin-bottom:15px;
    margin-top:5px;
}
.regular-custom-field{
    width:92%;
    padding:4% 4%;
    font-size:14px;
    font-weight:normal;
    color:#000;
    border:1px solid #e0e0e0;
    background:#fbfbfb;
    margin:0px;
}
select.regular-custom-field{
    width:92%;
}
.radio-container,.checkbox-container,.form-field-block .title,.form-recommendation-text .title{
    padding:4px 0px;
    font-size:12px;
    font-weight:bold;
    color:#19395b;
    margin:0px;
    display:inline-block;
}
.form-field-block .title{
    margin-bottom:5px;
}
.radio-container .title{
    font-weight:bold;
    margin-bottom:5px;
}
.checkbox-container .title{
    display:block;
    font-weight:bold;
    margin-bottom:5px;
}
.radio-container .inputs{
    margin-top:-3px;
    vertical-align:middle;
    font-weight:normal;
    color:#262626;
}
.radio-container .inputs input,.checkbox-container .inputs input,.form-recommendation-text .inputs input{
    width: 13px;
    height: 13px;
    padding: 0;
    margin:0;
    vertical-align: bottom;
    position: relative;
    top: 0px;
    *overflow: hidden;
}
.radio-container .inputs label{
    display: inline-block;
    padding-right: 5px;
    margin-left:0px;
}
.checkbox-container .inputs{
}
.checkbox-container .inputs label{
    display: inline-block;
    padding-left: 15px;
    text-indent: -15px;
    margin-right:5px;
    font-weight:normal;
    color:#262626;
}
.checkbox-container .inputs input:first-child{
    margin-left:0px;
}
.checkbox-container .inputs input{
    width: 13px;
    height: 13px;
    padding: 0;
    margin:0;
    vertical-align: bottom;
    position: relative;
    *overflow: hidden;
}
.form-image-upload-input{
    margin-top:10px;
}
.regular-file{
    font-size:11px;
    margin:0px;
}
.feedback-textarea{
    width:92%;
    padding:4%;
    font-size:14px;
    font-weight:normal;
    color:#000;
    border:1px solid #e0e0e0;
    background:#fbfbfb;
    height:140px;
    margin:0px;
    font-family:Arial, Helvetica, sans-serif;
    line-height:22px;
    max-width:92%;
    max-height:140px;
}

.form-green-thumbs{
    float:left;
    color:#529a42;
    font-size:12px;
    font-weight:bold;
    background:url(../img/green-thumb.png);
    background-repeat:no-repeat;
    background-position:left center;
    padding:4px 0px 3px 25px;
    margin-right:5px;
}
.form-recommendation-text{
    margin-top:15px;
    padding-bottom:7px;
}

.form-recommend-checkbox{
    margin-top:2px;
    float:left;
    width:17px;
    height:17px;
    background:url(../img/custom-checkbox.png);
    background-repeat:no-repeat;
    background-position:top left;
    cursor:pointer;
    text-align:right;
}
.form-recommend-checkbox span{
    position:absolute;left:20px;top:2px;
    color:#529a42;
    font-size:12px;
    font-weight:bold;
}
.form-recommend-checkbox.checked{
    background-position:bottom center;
}
.form-add-image,.form-add-video{
    margin:8px 0px 8px 1px;
}
.form-video-url{
    margin-top:5px;
}
.form-video-url label{
    font-size:11px;
}
.form-video-url .regular-text{
    color:#000;
    border:1px solid #e0e0e0;
    background:#f5f5f5;
    margin:0px;
    padding:3px 5px;
    width:200px;
}
.image-icon{
    background:url(../img/image-icon.png);
    background-repeat:no-repeat;
    background-position:left center;
    padding:1px 0px;
    padding-left:20px;
    color:#227aa8;
    text-decoration:underline;
}
.video-icon{
    background:url(../img/video-icon.png);
    background-repeat:no-repeat;
    background-position:left center;
    padding:1px 0px;
    padding-left:20px;
    text-decoration:underline;
}
.form-video-thumbs{
    margin-top:0px;
}
.form-video-thumbs,.form-image-thumbs{
    overflow:hidden;
    max-height:78px;
}
.form-image-thumbs{
    padding-bottom:5px;
    padding-top:8px;
}
.form-image-thumbs .image-thumb{
    float:left;
    width:124px;
    margin-right:5px;
    background:#fbfbfb;
    padding:4px 6px;
    -webkit-border-radius:2px;
    -moz-border-radius:2px;
    border-radius:2px;
    border:1px solid #e0e0e0;
}
.image-thumb .thumb-container{
    width:22px;
    height:16px;
    overflow:hidden;
    float:left;
}
.image-thumb .thumb-name{
    margin-left:25px;
    padding-top:3px;
    overflow:hidden;
    font-size:10px;
    color:#616161;
}
.thumb-img-close {
    width: 11px;
    height: 12px;
    background: url(../img/close-button.jpg);
    background-repeat: none;
    background-position: top;
    position: absolute;
    right: 2px;
    top: 6px;
    z-index:1;
}
.form-video-meta{
    overflow:hidden;
    max-height:68px;
}
.form-video-thumbs .video-thumb{
    margin-right: 10px;
    float:left;
    width:80px;
    overflow:hidden;
    height:54px;
}
.form-video-thumbs .video-thumb img{
    margin-top:-4px;
}
.form-video-thumbs .video-container{
    margin-top:0px;
}
.video-container{
    max-height:78px;
    background:#fbfbfb;
    padding:4px 6px;
    -webkit-border-radius:2px;
    -moz-border-radius:2px;
    border-radius:2px;
    border:1px solid #e0e0e0;
}
.form-video-thumbs .video-thumb img,.form-image-thumbs .image-thumb img{

}
.form-video-thumbs .video-details{
    margin-left: 0px;
    /*margin-left:90px;*/
    margin-top:4px;
}
.form-video-thumbs .video-details h3{
    font-weight:bold;
    margin-bottom:5px;
    color:#616177;
    font-size:11px;
}
.form-video-thumbs .video-details p{
    font-size:10px;
    color:#616177;
}
/*
.form-button{
    width:63px;
    background:url(../img/form-button.png);
    background-repeat:no-repeat;
    background-position:top center;
    display:block;
    padding:9px 10px;
    text-align:center;
    color:#000;
    text-shadow:#FFF 0px 1px;
    font-weight:bold;
}
.form-button:hover{
    background-position:center center;
    color:#111;
}
.form-button:active{
    background-position:bottom center;
    color:#111;
}
*/
.form-button{
    width:104px;
    background:#50709a;
    display:block;
    padding:12px 10px;
    text-align:center;
    color:#FFF;
    font-weight:normal;
    border:1px solid #3a679f;
    -webkit-border-radius:2px;
    -moz-border-radius:2px;
    border-radius:2px;
    font-size:14px;
}
.form-button:hover{
    background:#5779a5;
    color:#FFF;
}
.form-buttons{
    display:block;
}
.form-button-left{
    float:left;
}
.form-button-right{
    float:right;
}
.thumb-vid-close{
    width:11px;
    height:12px;
    background:url(../img/close-button.jpg);
    background-repeat:none;
    background-position:top;
    position:absolute;right:4px;
    top:4px;
    z-index:1;
}
.thumb-img-close:hover,.thumb-vid-close:hover{
    background-position:bottom;
    cursor:pointer;
}
.loading-box{
    display:none;
    font-weight:bold;
    width:120px;
    position:absolute;
    left:50%;
    margin-left:-60px;
    text-align:center;
    padding:7px 0px;
    -webkit-border-radius:2px;
    -moz-border-radius:2px;
    border-radius:2px;
    color:#666;
    bottom:-26px;
}
.registration-form{
    margin-top:15px;
}
.social-buttons{
    margin-bottom:15px;
}
.social-buttons .button-container{
    float:left;
    margin-right:10px;
}
.registration-form{

}
.one-clm-in,.two-clm-in{
    display:block;
    margin-bottom:12px;
}
.two-clm-in .clm{
    float:left;
    width:50%;
}
.one-clm-in .clm .registration-input{
    width:85%;
    padding:2.5% 7.5% 2.5% 2.5%;
}
.clm .registration-input{
    width:80%;
    font-size:14px;
    font-weight:normal;
    color:#000;
    border:1px solid #e0e0e0;
    background:#fbfbfb;
    margin:0px;
    padding:5%;
}
.clm select.registration-input{
    width:91%;
    padding:5%;
}
.one-clm-in .registration-input{

}
.profile-avatar-container{
    margin-top:67px;
}
.registration-avatar{
    float:left;
}
.registration-avatar-inst{
    margin-left:120px;
    padding-top:0px;
}
.registration-avatar-inst p{
    margin:12px 0px 11px 2px;
}
.registration-avatar-inst input{
    font-size:11px;
    margin:0px;
}
h2.h2-fix{
    font-size:13px;
    font-weight:bold;
    border-top:#d6d6d6 1px solid;
    margin-top:30px;
    padding-top:25px;
}
.permission{
    margin-top:7px;
}
.permission span{
    display:inline-block;
    padding-top:5px;
    margin-left:5px;
}
.permission-checkbox{
    margin-top:2px;
    float:left;
    width:17px;
    height:17px;
    background:url(../img/custom-checkbox.png);
    background-repeat:no-repeat;
    background-position:top center;
    cursor:pointer;
}
.permission-checkbox.checked{
    background-position:bottom center;
}
.profile-review-block{
    margin-top:10px;
}
.profile-review-block .user-avatar{
    width:100px;
    float:left;
}
.profile-review-block .user-details{
    margin-left:110px;
    padding-top:10px;
}

.user-name{
    color:#1d3854;
    font-size:18px;
    font-weight:bold;
    margin-bottom:6px;
}
.user-position{
    color:#262626;
    font-weight:bold;
    font-size:14px;
    margin-bottom:6px;
}
.user-website{
    color:#5e5e6e;
    font-size:10px;
    margin-bottom:4px;
}
.user-location,.user-date{
    color:#3e3e3e;
    font-size:12px;
    margin-bottom:4px;
}
.user-date{
    color:#808080;

}
.review-page-spacer{
    margin-top:20px;
}
.feedback-details{
    margin-top:10px;
}
.feedback-text{
    margin-bottom:10px;
    /*border:1px solid #e0e0e0;
    background:#fbfbfb;*/
    /* from dashbaord.css */
    color:#3e3e3e;
    font-size:13px;
    margin:5px 0px 10px;
    line-height:1.4em;
}
.feedback-edit{
    /*padding:0px 10px 10px;*/
    position:absolute;
    top:10px;
    right:10px;
}
.review-feedback-title-text{

}
.feedback-title-box{
    overflow:hidden;
    overflow-y:auto;
    margin:10px;
    line-height:1.6em;
    text-shadow:#FFF 0px 1px;
}
.feedback-box{
    overflow:hidden;
    overflow-y:auto;
    margin:10px;
    height:180px;
    line-height:1.6em;
    text-shadow:#FFF 0px 1px;
}
#review-location{
    float:left;
}
.user-location{
    display:block;
    height:14px;
}
.review-permission{
    margin-bottom:5px;
}
.edit-text{
    text-decoration:underline;
    font-size:11px;
    margin-right:5px;
    color:#666;
}

#static-stars .star-ratings{
    margin-bottom:10px;
}
#lightbox{
    position:absolute;
    width:290px;
    background:url(../img/faded-black.png);
    z-index:1000;
    -webkit-border-radius:5px;
    -moz-border-radius:5px;
    border-radius:5px;
    top:30%;
    left:50%;
    margin-left:-145px;
    display:none;
}
#lightbox-text-editor-container{
    position:absolute;
    width:390px;
    background:url(../img/faded-black.png);
    z-index:990;
    -webkit-border-radius:5px;
    -moz-border-radius:5px;
    border-radius:5px;
    top:20px;
    left:50%;
    margin-left:-195px;
    display:none;
}
#editor-white-area{
    margin:5px;
    background:#FFF;
    -webkit-border-radius:3px;
    -moz-border-radius:3px;
    border-radius:3px;
}
.text-editor-title{
    padding:5px;
}
#facebookForm{
    margin-left:-32px;
    margin-top:-25px;
    background:#f2f2f2;
    border-top:1px solid #FFF;
    border-bottom:1px solid #cccccc;
    width:448px;
    display:none;
}
.prefill-text{
    margin:15px 35px;
    font-size:11px;
    color:#80807e;
    line-height:15px;
}
.prefill-facebook-icon{
    background:url(../img/facebook-prefill-icon.jpg) no-repeat;
    background-position:left top;
    padding-left:20px;
}
#regularForm{
}
#lightbox-upload-photo-container{
    position:absolute;
    width:100%;
    background:url(../img/faded-black.png);
    z-index:990;
    -webkit-border-radius:5px;
    -moz-border-radius:5px;
    border-radius:5px;
    top:0px;
    left:50%;
    margin-left:-50%;
    display:none;
}
#lightbox-upload-photo-container input{
    font-size:11px;
    width:155px;
}
#lightbox-upload-photo-close{
    background:#16658F;
    color:#FFF;
    position:absolute;
    z-index:1000;
    right:5px;
    top:-14px;
    font-size:10px;
    padding:2px;
    cursor:pointer;
}
#upload-white-area{
    background:#EEE;
    margin:5px;
    -webkit-border-radius:4px;
    -moz-border-radius:4px;
    border-radius:4px;
    overflow:hidden;
    text-shadow:#FFF 0px 1px;
}
#drag-and-drop-area{
    border:5px dashed #CCC;
    height:300px;
    text-align:center;
    margin:5px;
    color:#777;
}
#upload-status-area{
    margin:5px;
}
#drag-and-drop-area h2{
    margin-top:120px;
    font-size:17px;
    font-weight:bold;
}
#lightbox-s,#lightbox-upload-s,#lightbox-editor-s{
    background:url(../img/faded-white.png);
    z-index:980;
    height:100%;
    width:100%;
    top:0px;
    left:0px;
    right:0px;
    bottom:0px;
    position:absolute;
    display:none;
}
.lightbox-pandora{
    background:#FFF;
    margin:5px;
    -webkit-border-radius:4px;
    -moz-border-radius:4px;
    border-radius:4px;
    overflow:hidden;
}
.lightbox-header{
    padding:10px 15px;
    color:#000;
    font-size:15px;
    font-weight:bold;
    border-bottom:1px solid #cccccc;
    background:#e8e8e8;
    -webkit-border-top-right-radius:4px;
    -moz-border-top-right-radius:4px;
    border-top-right-radius:4px;
    -webkit-border-top-left-radius:4px;
    -moz-border-top-left-radius:4px;
    border-top-left-radius:4px;
}
.lightbox-message{
    padding:10px 15px;
}
.lightbox-message.error{
    color:#960505;
    font-weight:bold;
}
.lightbox-message ul{
    list-style:none;
}
.lightbox-message ul li{
    margin:3px 0px;
}
.lightbox-buttons{
    text-align:center;
    padding:5px 0px;
}
.lightbox-button{
    width:63px;
    background:url(../img/form-button.png);
    background-repeat:no-repeat;
    background-position:top center;
    display:inline-block;
    padding:9px 10px;
    text-align:center;
    color:#000;
    text-shadow:#FFF 0px 1px;
    font-weight:bold;
}
.lightbox-button:hover{
    background-position:center center;
    color:#111;
}
.lightbox-button:active{
    background-position:bottom center;
    color:#111;
}

.clm .default-text,.default-text{
    color:#999;
    text-shadow:#FFF 0px 1px;
}
/* */
.progress-container{ width: 100px; }
.progress-shade{ width: 0%; height: 15px; background:url(../img/load-bg.jpg) repeat-x;}
.upload-preview{display:none;}
.upload-preview span{position:absolute;left:5px;top:2px;color:#FFF;z-index:10;font-size:10px;text-shadow:none;}
#review-feedback-text-container:hover .fullscreen-icon{
    display:block;
}
.form-feedback-textbox:hover .fullscreen-icon{

}
.fullscreen-icon{
    background:url(../img/ico-fullscreen.png) no-repeat;
    width:14px;
    height:14px;
    position:absolute;
    right:10px;
    top:5px;
    display:none;
    cursor:pointer;
    z-index:20;
}
.small{
    font-size:12px;
}
.editor-buttons{
    text-align:center;
    padding:10px 0px 7px;
}
.editor-container-box{
    margin:0px 5px;
}
#share-boxes{
    margin-top:10px;
    z-index: 10;
}
.facebook-share-bar{
    /*float:left;
    width:190px;*/
}
.twitter-share-bar{
    /*margin-left:200px;*/
}
#like-boxes{
    margin-top:10px;
}
#like-boxes h2.like-us-title{
    margin-bottom:10px;
}
.all-done-feedback-box{
    max-height:180px;
    height:180px;
    border:1px solid #FFF;
    background:#fbfbfb;
    color:#545454;
    padding:15px 20px;
    box-shadow:#999 0px 0px 5px;
    overflow-y: auto;
}
.all-done-feedback-box h1{
    margin-bottom:10px;
    font-size:16px;
    font-weight:bold;
    color:#4f4f4f;
}

#review-feedback-title-container,
#review-feedback-text-container{
    border: 1px solid #e0e0e0;
    background: #fbfbfb;
}
#review-feedback-text{
    margin: 18px 15px;
}
#review-feedback-text-container .feedback-edit{
    top: 1px;
}

#hostedFormCloseBtn{
    width:24px;
    height:24px;
    background:url(/img/form-close-btn.png);
    position:absolute;
    right:10px;
    top:10px;
    cursor:pointer;
    z-index:1;
}
#hostedFormCloseBtn:hover{
 background-position:bottom;
}


text:
import tornado.ioloop
import tornado.web

class MainHandler(tornado.web.RequestHandler):
    def get(self):
        #self.write("Hello, world")
        for line in open('list.txt'):
            self.write(line)
            #self.write("
"+line.split()[0]+"	"+""+line.split()[1]+"	"+""+line.split()[2]+"	"+""+line.split()[3]+"
")
            #self.write(line.split())
            #self.write(" ")
            #self.write(line.split()[1])
            #self.write(" ")
            #self.write(line.split()[2])
            #self.write(" ")
            #self.write(line.split()[3])

application = tornado.web.Application([
    (r"/", MainHandler),
])

if __name__ == "__main__":
    application.listen(8888)
    tornado.ioloop.IOLoop.current().start()

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html>

  <meta charset="utf-8">

  <link rel="stylesheet" href="../bower_components/mocha/mocha.css" />


text:
var Fifteen = Fifteen || {};

Fifteen.Solver = function()
{
    var state_manager;
    // var state;

    var attempt_size, advancement_size;
    var advancement_range, alternative_size;
    var max_repeat_discard;

    var init = function(i_state_manager) {
        state_manager = i_state_manager.clone();
    };

    /*
    * each attempt is one end-to-end attempt to
    * solve the puzzle. it has a series of "advancements"
    * each advancement is chosen by trying out different alternatives
    */
    var make_attempt = function(state_manager) {
        var prev_entropy = state_manager.get_entropy();
        var path = [];
        for(var i = 0; i < advancement_size; i++) {
            result = try_alternatives(state_manager);
            if(result.entropy < prev_entropy) { // choose this advancement
                state_manager = result.state_manager;
                prev_entropy = result.entropy;
                path = path.concat(result.path);
                // console.log("advancement", i, "selected", path);
            }
            if(result.entropy == state_manager.min_entropy) {
                // console.log(i, "advancement", i, "skipped");
                break;
            }
        }
        return {
            path: path,
            entropy: prev_entropy
        };
    };

    /*
    * try n different alternatives and returns the best one
    * each alternative is an "advancement" - series of steps
    */
    var try_alternatives = function(state_manager) {
        var min_entropy = state_manager.max_entropy;
        for(var i = 0; i < alternative_size; i++) {
            state_manager_copy = state_manager.clone();
            path = make_advancement(state_manager_copy);
            entropy = state_manager_copy.get_entropy();
            // console.log("alternative", i, path, entropy);
            if(entropy < min_entropy) {
                min_path = path;
                min_entropy = entropy;
                min_state_manager = state_manager_copy;
            }
            if(entropy == 0) break;
        }
        // console.log("alternative selected", min_path);
        return {
            path: min_path,
            entropy: min_entropy,
            state_manager: min_state_manager
        };
    };

    /*
    * Take n number of random steps,
    * where n itself is a random size within advancement_range
    */
    var make_advancement = function(state_manager) {
        step_size = Fifteen.Manager.random_int(advancement_range.min, advancement_range.max + 1);
        path = [];
        for(var i = 0; i < step_size; i++) {
            action = take_random_step(state_manager);
            path.push(action);
            entropy = state_manager.get_entropy();
            if(entropy == state_manager.min_entropy) {
                break;
            }
        }
        return path;
    };

    var take_random_step = function(state_manager) {
        actions = state_manager.get_allowed_actions();
        a_index = Fifteen.Manager.random_int(0, actions.length);
        action = actions[a_index];
        state_manager.apply_action(action);
        return action;
    };

    /*
    * solution is best out of multiple attempts
    */
    var get_solution = function() {
        attempt_size = 10;
        advancement_size = 50;
        advancement_range = { min: 1, max: 10 };
        alternative_size = 10;
        max_repeat_discard = 10;

        best_attempt = { entropy: state_manager.max_entropy };
        if(state_manager.get_entropy() == state_manager.min_entropy) {
            return { entropy: 0, path: [] };
        }

        for(var i = 0; i < attempt_size; i++) {
            state_manager_copy = state_manager.clone();
            result = make_attempt(state_manager_copy);
            if(result.entropy < best_attempt.entropy) {
                best_attempt = result;
            }
            if(best_attempt.entropy == state_manager.min_entropy) break;
        }
        return best_attempt;
    };

    return {
        init: init,
        get_solution, get_solution,
        take_random_step: take_random_step
    };

}();


text: Initial release of test_template


text:
<?php

namespace Twifty\FormBundle\Form\Type;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\FormType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\Form\FormView;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Twifty\GeoLocationBundle\Location\Locator;
use Twifty\TerritoryBundle\Manager\TerritoryManager;

/**
 * Description of CountryType.
 *
 * When multiple is specified it should render multiple select controls
 *
 * @author Owen Parry <waldermort@gmail.com>
 */
class CountryType extends AbstractType
{
    const COUNTRIES = 'countries';
    const REGIONS = 'regions';
    const CONTINENTS = 'continents';

    /**
     * @var TerritoryManager
     */
    protected $territories;

    /**
     * @var string
     */
    protected $locale;

    /**
     * @var Locator
     */
    protected $locator;

    public function __construct(TerritoryManager $territories, $locale, Locator $locator = null)
    {
        $this->territories = $territories;
        $this->locale = $locale;
        $this->locator = $locator;

//        parent::__construct();
    }

    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('world', FormType::class)
            ->add('continents', FormType::class)
            ->add('regions', FormType::class)
            ->add('countries', FormType::class)
        ;

        /*
         * The group_by option states how many child forms are required.
         */
        switch ($options['group_by']) {
            case self::CONTINENTS:
                $this->addContinents($builder, $options['locale']);
                break;

            case self::REGIONS:
                $this->addRegions($builder, $options['locale']);
                break;

            case self::COUNTRIES:
                $this->addCountries($builder, $options['locale']);
                break;

            default:
                throw new \InvalidArgumentException(sprintf(
                    'The option "group_by" with value "%s" is expected to be one'
                    . ' of "continents|regions|countries".',
                    $options['group_by']));
        }
    }

    /**
     * {@inheritdoc}
     */
    public function configureOptions(OptionsResolver $resolver)
    {
        parent::configureOptions($resolver);

        if (null !== $this->locator) {
            if ($location = $this->locator->getLocation('209.58.130.174')) {
//                $resolver->setDefault('data', $location->getCountryCode());
            }
        }

        $resolver->setDefault('locale', $this->locale);
        $resolver->setDefault('group_by', self::CONTINENTS);
    }

    /**
     * {@inheritdoc}
     */
    public function buildView(FormView $view, FormInterface $form, array $options)
    {
        $options['group_by'] = null;

        parent::buildView($view, $form, $options);
    }

    /**
     * {@inheritdoc}
     */
    public function getBlockPrefix()
    {
        return 'twifty_country';
    }

    private function addContinents(FormBuilderInterface $builder, $locale)
    {
        $continents = array();
        $hierarchy = $this->territories->getTerritoryMap(null, TerritoryManager::GROUPBY_CONTINENT | TerritoryManager::GROUPBY_REGION);

        foreach ($hierarchy as $continentCode => $regions) {
            $continents[$continentCode] = $this->territories->getTerritoryName($continentCode, $locale);
            $this->addRegions($builder, $locale, $continentCode, $regions);
        }

        $builder->get('continents')->add('continents', SelectType::class, array(
            'choices' => array_flip($continents),
        ));
    }

    private function addRegions(FormBuilderInterface $builder, $locale, $continentCode = null, array $continents = array())
    {
        if (!$continents) {
            $continents = $this->territories->getTerritoryMap(null, TerritoryManager::GROUPBY_REGION);
            $childName = 'regions';
        } else {
            $childName = strtolower(str_replace(' ', '_', $this->territories->getTerritoryName($continentCode, 'en')));
        }

        $regions = array();

        foreach ($continents as $regionCode => $countries) {
            $regions[$regionCode] = $this->territories->getTerritoryName($regionCode, $locale);
            $this->addCountries($builder, $locale, $regionCode, $countries);
        }

        $builder->get('regions')->add($childName, SelectType::class, array(
            'choices' => array_flip($regions),
        ));
    }

    private function addCountries(FormBuilderInterface $builder, $locale, $regionCode = null, array $countries = array())
    {
        if (!$countries) {
            $countries = $this->territories->getCountryNames($locale);
            $childName = 'countries';
        } else {
            $countries = $this->territories->getCountryName($countries, $locale);
            $childName = strtolower(str_replace(' ', '_', $this->territories->getTerritoryName($regionCode, 'en')));
        }

        $builder->get('countries')->add($childName, SelectType::class, array(
            'choices' => array_flip($countries),
        ));
    }
}


text:
import ast

from labelannotator import *
import re

def GrididExists(row_dict):
  if row_dict['gridid']:
    return True
  else:
    return False

def BackgroundColor(row_dict):
  if row_dict['cost']:
    return {'bg_color': '#FFC0C0'}
  return {'bg_color': '#FFFFFF'}

def ColoredPackage(row_dict):
  if not row_dict['parametrics']:
    return {'diptitle': '', 'packtitle': row_dict['title']}

  parametrics = ast.literal_eval(row_dict['parametrics'])
  if (('Mounting Type' in parametrics and parametrics['Mounting Type'].find('Through Hole') >= 0) or
      (re.match(".*DIP$", row_dict['package'])) or
  (re.match("Axial", row_dict['package']))):
    return {'diptitle': row_dict['title'], 'pack': ''}
  else:
    return {'diptitle': '', 'packtitle': row_dict['title']}

def CostPrefix(row_dict):
  if row_dict['cost']:
    return {'pcost': ' ' + row_dict['cost']}
  else:
    return {'pcost': ''}

load() \
    .filter(GrididExists) \
    .map_append(PriorityMap(['manual_title', 'dist_title'], 'title')) \
    .map_append(PriorityMap(['manual_package', 'dist_package'], 'package')) \
    .map_append(PriorityMap(['manual_quickdesc', 'dist_quickdesc'], 'quickdesc')) \
    .map_append(PriorityMap(['manual_mfrpn', 'dist_mfrpn'], 'mfrpn')) \
    .map_append(PriorityMap(['manual_desc', 'dist_desc'], 'desc')) \
    .map_append(BackgroundColor) \
    .map_append(ColoredPackage) \
    .map_append(CostPrefix) \
    .write()


text:
java_import java.util.concurrent.atomic.AtomicInteger
java_import java.util.concurrent.atomic.AtomicBoolean

def onInit
    # Variables for assertions only
    $sponge.setVariable("receivedEventA", AtomicBoolean.new(false))
    $sponge.setVariable("receivedEventBCount", AtomicInteger.new(0))
end

def onLoad
    $sponge.enable(TriggerBuilder.new("TriggerA").withEvent("a").withOnRun {|trigger, event|
        trigger.logger.debug("Received event: {}", event.name)
        $sponge.getVariable("receivedEventA").set(true)
    })

    $sponge.enable(TriggerBuilder.new("TriggerB").withEvent("b").withOnRun {|trigger, event|
        trigger.logger.debug("Received event: {}", event.name)
        if $sponge.getVariable("receivedEventBCount").get() == 0
            trigger.logger.debug("Statistics: {}", $sponge.statisticsSummary)
        end
        $sponge.getVariable("receivedEventBCount").incrementAndGet
    })
end

def onStartup
    $sponge.logger.debug("Startup {}, triggers: {}", $sponge.info, $sponge.engine.triggers)
    $sponge.logger.debug("Knowledge base name: {}", $sponge.kb.name)
    $sponge.event("a").send()
    $sponge.event("b").sendAfter(200, 200)
end


text:
using System;
using Cairo;
using Gtk;
using Pinta.Core;
using Mono.Unix;
using ClipperLibrary;
using System.Collections.Generic;
using System.Linq;

namespace Pinta.Tools
{
	public class LassoSelectTool : BaseTool
	{
		private bool is_drawing = false;
		private CombineMode combine_mode;
		private SelectionHistoryItem hist;

		private Path path;
		private List<IntPoint> lasso_polygon = new List<IntPoint>();

		public LassoSelectTool ()
		{
		}

		#region Properties
		public override string Name { get { return Catalog.GetString ("Lasso Select"); } }
		public override string Icon { get { return "Tools.LassoSelect.png"; } }
		public override string StatusBarText { get { return Catalog.GetString ("Click and drag to draw the outline for a selection area."); } }
        public override Gdk.Cursor DefaultCursor { get { return new Gdk.Cursor (Gdk.Display.Default, PintaCore.Resources.GetIcon ("Cursor.LassoSelect.png"), 9, 18); } }
		public override int Priority { get { return 9; } }
		#endregion

		protected override void OnBuildToolBar (Toolbar tb)
		{
			base.OnBuildToolBar (tb);
			PintaCore.Workspace.SelectionHandler.BuildToolbar (tb);
		}

		#region Mouse Handlers
		protected override void OnMouseDown (Gtk.DrawingArea canvas, Gtk.ButtonPressEventArgs args, Cairo.PointD point)
		{
			if (is_drawing)
				return;

			hist = new SelectionHistoryItem (Icon, Name);
			hist.TakeSnapshot ();

			combine_mode = PintaCore.Workspace.SelectionHandler.DetermineCombineMode (args);
			path = null;
			is_drawing = true;

			var doc = PintaCore.Workspace.ActiveDocument;
			doc.PreviousSelection.Dispose ();
			doc.PreviousSelection = doc.Selection.Clone();
		}

		protected override void OnMouseMove (object o, Gtk.MotionNotifyEventArgs args, Cairo.PointD point)
		{
			Document doc = PintaCore.Workspace.ActiveDocument;

			if (!is_drawing)
				return;

			double x = Utility.Clamp (point.X, 0, doc.ImageSize.Width - 1);
			double y = Utility.Clamp (point.Y, 0, doc.ImageSize.Height - 1);

			doc.ShowSelection = true;

			ImageSurface surf = doc.SelectionLayer.Surface;

			using (Context g = new Context (surf)) {
				g.Antialias = Antialias.Subpixel;

				if (path != null) {
					g.AppendPath (path);
					(path as IDisposable).Dispose ();
				} else {
					g.MoveTo (x, y);
				}

				g.LineTo (x, y);
				lasso_polygon.Add(new IntPoint((long)x, (long)y));

				path = g.CopyPath ();

				g.FillRule = FillRule.EvenOdd;
				g.ClosePath ();
			}

			doc.Selection.SelectionPolygons.Clear ();
			doc.Selection.SelectionPolygons.Add (lasso_polygon.ToList ());
		    SelectionModeHandler.PerformSelectionMode (combine_mode, doc.Selection.SelectionPolygons);
			doc.Workspace.Invalidate ();
		}

		protected override void OnMouseUp (Gtk.DrawingArea canvas, Gtk.ButtonReleaseEventArgs args, Cairo.PointD point)
		{
			Document doc = PintaCore.Workspace.ActiveDocument;

			ImageSurface surf = doc.SelectionLayer.Surface;

			using (Context g = new Context (surf)) {
				if (path != null) {
					g.AppendPath (path);
					(path as IDisposable).Dispose ();
					path = null;
				}

				g.FillRule = FillRule.EvenOdd;
				g.ClosePath ();
			}

			doc.Selection.SelectionPolygons.Clear ();
			doc.Selection.SelectionPolygons.Add(lasso_polygon.ToList());
		    SelectionModeHandler.PerformSelectionMode (combine_mode, doc.Selection.SelectionPolygons);
			doc.Workspace.Invalidate ();

			if (hist != null)
			{
				doc.History.PushNewItem (hist);
				hist = null;
			}

			lasso_polygon.Clear();
			is_drawing = false;
		}
		#endregion
	}
}


text:
using System;
using System.Xml.XPath;
using System.Globalization;

namespace Microsoft.Ddue.Tools {
    /// <summary>
    /// Generates syntax that corresponds to JavaScript that Script# generates.
    /// </summary>
    public class ScriptSharpDeclarationSyntaxGenerator : SyntaxGeneratorTemplate {
        private static readonly XPathExpression typeIsRecordExpression = XPathExpression.Compile("boolean(apidata/@record)");

        private static readonly XPathExpression memberIsGlobalExpression = XPathExpression.Compile("boolean(apidata/@global)");

        /// <summary>
        /// Initializes a new instance of the <c>ScriptSharpDeclarationSyntaxGenerator</c> class.
        /// </summary>
        /// <param name="configuration"></param>
        public ScriptSharpDeclarationSyntaxGenerator(XPathNavigator configuration) : base(configuration) {
		    if (String.IsNullOrEmpty(Language)) Language = "JavaScript";
        }

        /// <summary>
        /// Determines whether the feature is unsupported by this language.
        /// </summary>
        /// <param name="reflection"></param>
        /// <param name="writer"></param>
        /// <returns></returns>
        private bool IsUnsupported(XPathNavigator reflection, SyntaxWriter writer) {
            if (IsUnsupportedGeneric(reflection, writer)) {
                return true;
            }

            if (IsUnsupportedExplicit(reflection, writer)) {
                return true;
            }

            if (IsUnsupportedUnsafe(reflection, writer)) {
                return true;
            }

            if (HasAttribute(reflection, "System.NonScriptableAttribute")) {
                writer.WriteMessage("UnsupportedType_ScriptSharp");
                return true;
            }

            return false;
        }

        private string ReadNamespaceName(XPathNavigator reflection) {
            return (string)reflection.Evaluate(apiContainingNamespaceNameExpression);
        }

        private string ReadTypeName(XPathNavigator reflection) {
            return (string)reflection.Evaluate(apiNameExpression);
        }

        private string ReadContainingTypeName(XPathNavigator reflection) {
            return (string)reflection.Evaluate(apiContainingTypeNameExpression);
        }

        private string ReadFullTypeName(XPathNavigator reflection) {
            string namespaceName = ReadNamespaceName(reflection);

            string typeName = ReadTypeName(reflection);

            if (String.IsNullOrEmpty(namespaceName) || HasAttribute(reflection, "System.IgnoreNamespaceAttribute")) {
                return typeName;
            }
            else {
                return String.Format("{0}.{1}", namespaceName, typeName);
            }
        }

        private string ReadFullContainingTypeName(XPathNavigator reflection) {
            string namespaceName = ReadNamespaceName(reflection);

            string typeName = ReadContainingTypeName(reflection);

            if (String.IsNullOrEmpty(namespaceName) || HasAttribute(reflection, "System.IgnoreNamespaceAttribute")) {
                return typeName;
            }
            else {
                return String.Format("{0}.{1}", namespaceName, typeName);
            }
        }

        private string ReadMemberName(XPathNavigator reflection) {
            string identifier = (string)reflection.Evaluate(apiNameExpression);

            if (!HasAttribute(reflection, "System.PreserveCaseAttribute")) {
                identifier = CreateCamelCaseName(identifier);
            }

            return identifier;
        }

        private bool HasAttribute(XPathNavigator reflection, string attributeName) {
            attributeName = "T:" + attributeName;

            XPathNodeIterator iterator = (XPathNodeIterator)reflection.Evaluate(apiAttributesExpression);
            foreach (XPathNavigator navigator in iterator) {
                XPathNavigator reference = navigator.SelectSingleNode(attributeTypeExpression);
                if (reference.GetAttribute("api", string.Empty) == attributeName) {
                    return true;
                }
            }

            return false;
        }

        public static string CreateCamelCaseName(string name) {

            if (String.IsNullOrEmpty(name)) {
                return name;
            }

            // Some exceptions that simply need to be special cased
            if (name.Equals("ID", StringComparison.Ordinal)) {
                return "id";
            }

            bool hasLowerCase = false;
            int conversionLength = 0;

            for (int i = 0; i < name.Length; i++) {
                if (Char.IsUpper(name, i)) {
                    conversionLength++;
                } else {
                    hasLowerCase = true;
                    break;
                }
            }

            if (((hasLowerCase == false) && (name.Length != 1)) || (conversionLength == 0)) {
                // Name is all upper case, or all lower case; leave it as-is.
                return name;
            }

            if (conversionLength > 1) {
                // Convert the leading uppercase segment, except the last character
                // which is assumed to be the first letter of the next word
                return name.Substring(0, conversionLength - 1).ToLower(CultureInfo.InvariantCulture) + name.Substring(conversionLength - 1);
            }

            else if (name.Length == 1) {
                return name.ToLower(CultureInfo.InvariantCulture);
            }

            else {
                // Convert the leading upper case character to lower case
                return Char.ToLower(name[0], CultureInfo.InvariantCulture) + name.Substring(1);
            }
        }

        private void WriteIndentedNewLine(SyntaxWriter writer) {
            writer.WriteString(",");
            writer.WriteLine();
            writer.WriteString("\t");
        }

        private void WriteParameterList(XPathNavigator reflection, SyntaxWriter writer) {
            XPathNodeIterator parameters = reflection.Select(apiParametersExpression);
            writer.WriteString("(");

            while (parameters.MoveNext()) {
                XPathNavigator parameter = parameters.Current;

                WriteParameter(parameter, writer);
                if (parameters.CurrentPosition < parameters.Count) {
                    writer.WriteString(", ");
                }
            }
            writer.WriteString(")");
        }

        private void WriteParameter(XPathNavigator parameter, SyntaxWriter writer) {
            string text = (string)parameter.Evaluate(parameterNameExpression);
            XPathNavigator reference = parameter.SelectSingleNode(parameterTypeExpression);
            if ((bool)parameter.Evaluate(parameterIsParamArrayExpression)) {
                writer.WriteString("... ");
            }
            writer.WriteParameter(text);
        }

        private void WriteTypeReference(XPathNavigator reference, SyntaxWriter writer)
        {
            switch (reference.LocalName)
            {
                case "arrayOf":
                        int rank = Convert.ToInt32(reference.GetAttribute("rank", string.Empty));
                        XPathNavigator navigator = reference.SelectSingleNode(typeExpression);
                        WriteTypeReference(navigator, writer);
                        writer.WriteString("[");
                        for (int i = 1; i < rank; i++) { writer.WriteString(","); }
                        writer.WriteString("]");
                        break;
                case "type":
                        string id = reference.GetAttribute("api", string.Empty);
                        WriteNormalTypeReference(id, writer);
                        break;
                case "pointerTo":
                case "referenceTo":
                case "template":
                case "specialization":
                        // Not supported
                        break;
            }
        }

        private void WriteNormalTypeReference(string api, SyntaxWriter writer) {
            switch (api) {
                case "T:System.Byte":
                    writer.WriteReferenceLink(api, "Byte");
                    return;

                case "T:System.SByte":
                    writer.WriteReferenceLink(api, "SByte");
                    return;

                case "T:System.Char":
                    writer.WriteReferenceLink(api, "Char");
                    return;

                case "T:System.Int16":
                    writer.WriteReferenceLink(api, "Int16");
                    return;

                case "T:System.Int32":
                    writer.WriteReferenceLink(api, "Int32");
                    return;

                case "T:System.Int64":
                    writer.WriteReferenceLink(api, "Int64");
                    return;

                case "T:System.UInt16":
                    writer.WriteReferenceLink(api, "UInt16");
                    return;

                case "T:System.UInt32":
                    writer.WriteReferenceLink(api, "UInt32");
                    return;

                case "T:System.UInt64":
                    writer.WriteReferenceLink(api, "UInt64");
                    return;

                case "T:System.Single":
                    writer.WriteReferenceLink(api, "Single");
                    return;

                case "T:System.Double":
                    writer.WriteReferenceLink(api, "Double");
                    return;

                case "T:System.Decimal":
                    writer.WriteReferenceLink(api, "Decimal");
                    return;

                case "T:System.Boolean":
                    writer.WriteReferenceLink(api, "Boolean");
                    return;
            }

            // Remove 'T:'
            string name = api.Substring(2);

            // Strip System namespaces
            if (name.StartsWith("System.")) {
                int idx = name.LastIndexOf('.');
                name = name.Substring(idx + 1);
            }

            writer.WriteReferenceLink(api, name);
        }

        private void WriteRecordSyntax(XPathNavigator reflection, SyntaxWriter writer) {
            string namespaceName = ReadNamespaceName(reflection);

            string typeName = ReadTypeName(reflection);

            writer.WriteString(namespaceName);
            writer.WriteString(".$create_");
            writer.WriteString(typeName);
            writer.WriteString(" = ");
            writer.WriteKeyword("function");
            writer.WriteString("();");
        }

        private void WriteRecordConstructorSyntax(XPathNavigator reflection, SyntaxWriter writer) {
            string namespaceName = ReadNamespaceName(reflection);

            string typeName = ReadContainingTypeName(reflection);

            writer.WriteString(namespaceName);
            writer.WriteString(".$create_");
            writer.WriteString(typeName);
            writer.WriteString(" = ");
            writer.WriteKeyword("function");
            WriteParameterList(reflection, writer);
            writer.WriteString(";");
        }

        public override void WriteClassSyntax(XPathNavigator reflection, SyntaxWriter writer) {
            if (IsUnsupported(reflection, writer)) return;

            if (HasAttribute(reflection, "System.RecordAttribute")) {
                WriteRecordSyntax(reflection, writer);
                return;
            }

            string typeName = ReadFullTypeName(reflection);

            writer.WriteIdentifier(typeName);
            writer.WriteString(" = ");
            writer.WriteKeyword("function");
            writer.WriteString("();");

            writer.WriteLine();
            writer.WriteLine();

            writer.WriteIdentifier("Type");
            writer.WriteString(".createClass(");
            writer.WriteLine();
            writer.WriteString("\t'");
            writer.WriteString(typeName);
            writer.WriteString("'");

            bool hasBaseClass = false;

            // Write the base class.
            XPathNavigator reference = reflection.SelectSingleNode(apiBaseClassExpression);
            if (!((reference == null) || ((bool)reference.Evaluate(typeIsObjectExpression)))) {
                WriteIndentedNewLine(writer);
                WriteTypeReference(reference, writer);
                hasBaseClass = true;
            }

            // Write the interfaces.
            XPathNodeIterator iterator = reflection.Select(apiImplementedInterfacesExpression);
            if (iterator.Count != 0) {
                if (!hasBaseClass) {
                    WriteIndentedNewLine(writer);
                    writer.WriteString("null");
                }

                WriteIndentedNewLine(writer);

                while (iterator.MoveNext()) {
                    XPathNavigator interfaceRef = iterator.Current;
                    WriteTypeReference(interfaceRef, writer);
                    if (iterator.CurrentPosition < iterator.Count) {
                        WriteIndentedNewLine(writer);
                    }
                }
            }

            writer.WriteString(");");
        }

        public override void WriteConstructorSyntax(XPathNavigator reflection, SyntaxWriter writer) {
            if (IsUnsupported(reflection, writer)) {
                return;
            }

            bool isRecord = (bool)reflection.Evaluate(typeIsRecordExpression);

            if (isRecord) {
                WriteRecordConstructorSyntax(reflection, writer);
                return;
            }

            string typeName = ReadFullContainingTypeName(reflection);

            writer.WriteIdentifier(typeName);
            writer.WriteString(" = ");
            writer.WriteKeyword("function");
            WriteParameterList(reflection, writer);
            writer.WriteString(";");
        }

        public override void WriteNormalMethodSyntax(XPathNavigator reflection, SyntaxWriter writer) {
            if (IsUnsupported(reflection, writer)) return;

            if (HasAttribute(reflection, "System.AttachedPropertyAttribute")) {
                WriteAttachedPropertySyntax(reflection, writer);
                return;
            }

            string memberName = ReadMemberName(reflection);

            bool isStatic = (bool)reflection.Evaluate(apiIsStaticExpression);
            bool isGlobal = (bool)reflection.Evaluate(memberIsGlobalExpression);

            if (isStatic && !isGlobal) {
                writer.WriteIdentifier(ReadFullContainingTypeName(reflection));
                writer.WriteString(".");
                writer.WriteIdentifier(memberName);
                writer.WriteString(" = ");
                writer.WriteKeyword("function");
            }
            else {
                writer.WriteKeyword("function");
                writer.WriteString(" ");
                writer.WriteIdentifier(memberName);
            }

            WriteParameterList(reflection, writer);
            writer.WriteString(";");
        }

        public override void WriteDelegateSyntax(XPathNavigator reflection, SyntaxWriter writer) {
            writer.WriteKeyword("function");
            WriteParameterList(reflection, writer);
            writer.WriteString(";");
        }

        public override void WriteEnumerationSyntax(XPathNavigator reflection, SyntaxWriter writer) {
            string typeName = ReadFullTypeName(reflection);

            writer.WriteIdentifier(typeName);
            writer.WriteString(" = ");
            writer.WriteKeyword("function");
            writer.WriteString("();");

            writer.WriteLine();

            writer.WriteIdentifier(typeName);
            writer.WriteString(".createEnum('");
            writer.WriteIdentifier(typeName);
            writer.WriteString("', ");
            writer.WriteString(HasAttribute(reflection, "System.FlagsAttribute") ? "true" : "false");
            writer.WriteString(");");
        }

        public override void WriteEventSyntax(XPathNavigator reflection, SyntaxWriter writer) {
            if (IsUnsupported(reflection, writer)) return;

            if (reflection.Select(apiParametersExpression).Count > 0) {
                writer.WriteMessage("UnsupportedIndex_" + Language);
                return;
            }

            string memberName = ReadMemberName(reflection);

            writer.WriteKeyword("function");
            writer.WriteString(" add_");
            writer.WriteIdentifier(memberName);
            writer.WriteString("(");
            writer.WriteParameter("value");
            writer.WriteString(");");

            writer.WriteLine();

            writer.WriteKeyword("function");
            writer.WriteString(" remove_");
            writer.WriteIdentifier(memberName);
            writer.WriteString("(");
            writer.WriteParameter("value");
            writer.WriteString(");");
        }

        public override void WriteFieldSyntax(XPathNavigator reflection, SyntaxWriter writer)
        {
            if (IsUnsupported(reflection, writer)) {
                return;
            }

            string memberName = ReadMemberName(reflection);

            bool isStatic = (bool)reflection.Evaluate(apiIsStaticExpression);
            if (isStatic) {
                string typeName = ReadFullContainingTypeName(reflection);

                writer.WriteIdentifier(typeName);
                writer.WriteString(".");
            }

            writer.WriteIdentifier(memberName);
        }

        public override void WriteInterfaceSyntax(XPathNavigator reflection, SyntaxWriter writer) {
            if (IsUnsupported(reflection, writer)) return;

            string typeName = ReadFullTypeName(reflection);

            writer.WriteIdentifier(typeName);
            writer.WriteString(" = ");
            writer.WriteKeyword("function");
            writer.WriteString("();");

            writer.WriteLine();

            writer.WriteIdentifier(typeName);
            writer.WriteString(".createInterface('");
            writer.WriteIdentifier(typeName);
            writer.WriteString("');");
        }

        public override void WriteAttachedEventSyntax(XPathNavigator reflection, SyntaxWriter writer) {
            // Not supported
        }

        public override void WriteAttachedPropertySyntax(XPathNavigator reflection, SyntaxWriter writer) {
            string typeName = ReadContainingTypeName(reflection);

            string methodName = ReadMemberName(reflection);

            string propertyName = String.Format("{0}.{1}", typeName, methodName.Substring(3));

            if (methodName.StartsWith("Get", StringComparison.OrdinalIgnoreCase)) {
                writer.WriteKeyword("var");
                writer.WriteString(" value = obj['");
                writer.WriteString(propertyName);
                writer.WriteString("'];");
            }
            else if (methodName.StartsWith("Set", StringComparison.OrdinalIgnoreCase)) {
                writer.WriteString("obj['");
                writer.WriteString(propertyName);
                writer.WriteString("'] = value;");
            }
        }

        public override void WriteOperatorSyntax(XPathNavigator reflection, SyntaxWriter writer) {
            writer.WriteMessage("UnsupportedOperator_" + Language);
        }

        public override void WriteCastSyntax(XPathNavigator reflection, SyntaxWriter writer) {
            writer.WriteMessage("UnsupportedCast_" + Language);
        }

        public override void WriteNamespaceSyntax(XPathNavigator reflection, SyntaxWriter writer) {
            string name = reflection.Evaluate(apiNameExpression).ToString();

            writer.WriteString("Type.createNamespace('");
            writer.WriteIdentifier(name);
            writer.WriteString("');");
        }

        public override void WritePropertySyntax(XPathNavigator reflection, SyntaxWriter writer) {
            if (IsUnsupported(reflection, writer)) return;

            if (HasAttribute(reflection, "System.IntrinsicPropertyAttribute")) {
                WriteFieldSyntax(reflection, writer);
                return;
            }

            string memberName = ReadMemberName(reflection);

            bool isStatic = (bool)reflection.Evaluate(apiIsStaticExpression);

            bool isGetter = (bool)reflection.Evaluate(apiIsReadPropertyExpression);
            bool isSetter = (bool)reflection.Evaluate(apiIsWritePropertyExpression);

            XPathNavigator reference = reflection.SelectSingleNode(apiReturnTypeExpression);

            if (isGetter) {
                if (isStatic) {
                    writer.WriteIdentifier(ReadFullContainingTypeName(reflection));
                    writer.WriteString(".");

                    writer.WriteString("get_");
                    writer.WriteIdentifier(memberName);
                    writer.WriteString(" = ");
                    writer.WriteKeyword("function");
                }
                else {
                    writer.WriteKeyword("function");
                    writer.WriteString(" ");

                    writer.WriteString("get_");
                    writer.WriteIdentifier(memberName);
                }

                WriteParameterList(reflection, writer);
                writer.WriteString(";");
                writer.WriteLine();
            }

            if (isSetter) {
                if (isStatic) {
                    writer.WriteIdentifier(ReadFullContainingTypeName(reflection));
                    writer.WriteString(".");

                    writer.WriteString("set_");
                    writer.WriteIdentifier(memberName);
                    writer.WriteString(" = ");
                    writer.WriteKeyword("function");
                }
                else {
                    writer.WriteKeyword("function");
                    writer.WriteString(" ");

                    writer.WriteString("set_");
                    writer.WriteIdentifier(memberName);
                }

                writer.WriteString("(");
                writer.WriteParameter("value");
                writer.WriteString(");");
            }
        }

        public override void WriteStructureSyntax(XPathNavigator reflection, SyntaxWriter writer) {
            if (IsUnsupported(reflection, writer)) return;
            writer.WriteMessage("UnsupportedStructure_" + Language);
        }
   }
}


text:
from __future__ import unicode_literals

from django.db import models, migrations

class Migration(migrations.Migration):

    dependencies = [
        ('stories', '0007_auto_20150223_1115'),
    ]

    operations = [
        migrations.AddField(
            model_name='story',
            name='user_type',
            field=models.ForeignKey(blank=True, to='stories.UserType', null=True),
            preserve_default=True,
        ),
    ]


text:
/* eslint-disable no-unused-expressions */

'use strict';

const chai = require('chai');
const chaiHttp = require('chai-http');
const app = require('../../app');
const chaiJson = require('chai-json-schema');
const lanternStationSchemas = require('./schemas/lanternStations');
const errorSchemas = require('./schemas/errors');
const lanternStationData = require('./testData/lanternStations');
const tokens = require('./testData/tokens');

chai.should();
chai.use(chaiHttp);
chai.use(chaiJson);

describe('LanternStations', () => {
  describe('Create lantern station', () => {
    it('Should NOT create lantern station with incorrect authorization on /api/lanternStations POST', (done) => {
      chai
        .request(app)
        .post('/api/lanternStations')
        .send({ data: { station: lanternStationData.lanternStationToCreate } })
        .set('Authorization', tokens.incorrectJwt)
        .end((error, response) => {
          response.should.have.status(401);
          response.should.be.json;
          response.body.should.be.jsonSchema(errorSchemas.error);

          done();
        });
    });

    it('Should create lantern station on /api/lanternStations POST', (done) => {
      chai
        .request(app)
        .post('/api/lanternStations/')
        .send({ data: { station: lanternStationData.lanternStationToCreate } })
        .set('Authorization', tokens.adminUser)
        .end((error, response) => {
          response.should.have.status(200);
          response.should.be.json;
          response.body.should.be.jsonSchema(lanternStationSchemas.lanternStation);

          done();
        });
    });

    it('Should NOT create existing lantern station on /api/lanternStations POST', (done) => {
      chai
        .request(app)
        .post('/api/lanternStations/')
        .send({ data: { station: lanternStationData.lanternStationToCreate } })
        .set('Authorization', tokens.adminUser)
        .end((error, response) => {
          response.should.have.status(403);
          response.should.be.json;
          response.body.should.be.jsonSchema(errorSchemas.error);

          done();
        });
    });
  });

  describe('Get lantern stations', () => {
    it('Should NOT get lantern stations with incorrect authorization on /api/lanternStations GET', (done) => {
      chai
        .request(app)
        .get('/api/lanternStations')
        .set('Authorization', tokens.incorrectJwt)
        .end((error, response) => {
          response.should.have.status(401);
          response.should.be.json;
          response.body.should.be.jsonSchema(errorSchemas.error);

          done();
        });
    });

    it('Should get lantern stations on /api/lanternStations GET', (done) => {
      chai
        .request(app)
        .get('/api/lanternStations')
        .set('Authorization', tokens.adminUser)
        .end((error, response) => {
          response.should.have.status(200);
          response.should.be.json;
          response.body.should.be.jsonSchema(lanternStationSchemas.lanternStations);

          done();
        });
    });
  });

  describe('Get lantern station', () => {
    before('Create lantern station on /api/lanternStations POST', (done) => {
      chai
        .request(app)
        .post('/api/lanternStations/')
        .send({ data: { station: lanternStationData.lanternStationToGet } })
        .set('Authorization', tokens.adminUser)
        .end((error, response) => {
          response.should.have.status(200);
          response.should.be.json;
          response.body.should.be.jsonSchema(lanternStationSchemas.lanternStation);

          done();
        });
    });

    it('Should NOT get lantern station with incorrect authorization on /api/lanternStations/:stationId GET', (done) => {
      chai
        .request(app)
        .get(`/api/lanternStations/${lanternStationData.lanternStationToGet.stationId}`)
        .set('Authorization', tokens.incorrectJwt)
        .end((error, response) => {
          response.should.have.status(401);
          response.should.be.json;
          response.body.should.be.jsonSchema(errorSchemas.error);

          done();
        });
    });

    it('Should get lantern stations on /api/lanternStations/:stationId GET', (done) => {
      chai
        .request(app)
        .get(`/api/lanternStations/${lanternStationData.lanternStationToGet.stationId}`)
        .set('Authorization', tokens.adminUser)
        .end((error, response) => {
          response.should.have.status(200);
          response.should.be.json;
          response.body.should.be.jsonSchema(lanternStationSchemas.lanternStation);

          done();
        });
    });
  });

  describe('Update lantern station', () => {
    before('Create lantern station on /api/lanternStations POST', (done) => {
      chai
        .request(app)
        .post('/api/lanternStations/')
        .send({ data: { station: lanternStationData.lanternStationToCreateAndModify } })
        .set('Authorization', tokens.adminUser)
        .end((error, response) => {
          response.should.have.status(200);
          response.should.be.json;
          response.body.should.be.jsonSchema(lanternStationSchemas.lanternStation);

          done();
        });
    });

    it('Should NOT update lantern station with incorrect authorization on /api/lanternStations/:id POST', (done) => {
      chai
        .request(app)
        .post(`/api/lanternStations/${lanternStationData.lanternStationToCreateAndModify.stationId}`)
        .send({ data: { station: lanternStationData.lanternStationWithNewOwner } })
        .set('Authorization', tokens.incorrectJwt)
        .end((error, response) => {
          response.should.have.status(401);
          response.should.be.json;
          response.body.should.be.jsonSchema(errorSchemas.error);

          done();
        });
    });

    it('Should update owner on lantern station on /api/lanternStations/:id POST', (done) => {
      chai
        .request(app)
        .post(`/api/lanternStations/${lanternStationData.lanternStationToCreateAndModify.stationId}`)
        .send({ data: { station: lanternStationData.lanternStationWithNewOwner } })
        .set('Authorization', tokens.adminUser)
        .end((error, response) => {
          response.should.have.status(200);
          response.should.be.json;
          response.body.should.be.jsonSchema(lanternStationSchemas.lanternStation);

          done();
        });
    });

    it('Should update attacker on lantern station on /api/lanternStations/:id POST', (done) => {
      chai
        .request(app)
        .post(`/api/lanternStations/${lanternStationData.lanternStationToCreateAndModify.stationId}`)
        .send({ data: { station: lanternStationData.lanternStationUnderAttack } })
        .set('Authorization', tokens.adminUser)
        .end((error, response) => {
          response.should.have.status(200);
          response.should.be.json;
          response.body.should.be.jsonSchema(lanternStationSchemas.lanternStation);

          done();
        });
    });

    it('Should NOT update non-existing lantern station on /api/lanternStations/:id POST', (done) => {
      chai
        .request(app)
        .post(`/api/lanternStations/${lanternStationData.lanternStationThatDoesNotExist.stationId}`)
        .send({ data: { station: lanternStationData.lanternStationWithNewOwner } })
        .set('Authorization', tokens.adminUser)
        .end((error, response) => {
          response.should.have.status(404);
          response.should.be.json;
          response.body.should.be.jsonSchema(errorSchemas.error);

          done();
        });
    });
  });
});


text:
<?php
defined('C5_EXECUTE') or die("Access Denied.");
$form = Loader::helper("form");
$tp = new TaskPermission();
$dt = Loader::helper('form/date_time');
if (!$tp->canAccessUserSearch() && !$tp->canAccessGroupSearch()) {
	die(t("Access Denied."));
}

if ($_REQUEST['peID']) {
	$pae = PermissionAccessEntity::getByID($_REQUEST['peID']);
} else {
	$pae = false;
}

if ($_REQUEST['pdID']) {
	$pd = PermissionDuration::getByID($_REQUEST['pdID']);
} else {
	$pd = false;
}

if ($_POST['task'] == 'save_permissions') {
	$js = Loader::helper('json');
	$r = new stdClass;

	if (is_object($pae)) {
		$pd = PermissionDuration::translateFromRequest();
	} else {
		$r->error = true;
		$r->message = t('You must choose who this permission is for.');
	}

	if (!$r->error) {
		$r->peID = $pae->getAccessEntityID();
		if (is_object($pd)) {
			$r->pdID = $pd->getPermissionDurationID();
		} else {
			$r->pdID = 0;
		}
	}

	print $js->encode($r);
	exit;
}

?>

<form id="ccm-permissions-access-entity-form" method="post" action="<?php echo REL_DIR_FILES_TOOLS_REQUIRED?>/permissions/access_entity">
<input type="hidden" name="task" value="save_permissions" />
<?php echo $form->hidden('accessType');?>
<?php echo $form->hidden('peID');?>
<?php echo $form->hidden('pdID');?>

<?php echo t('Access')?>

<?php echo t('Who gets access to this permission?')?>

<?php  if (is_object($pae)) { ?>
<?php echo $pae->getAccessEntityLabel()?>
<?php  } else { ?>
<?php echo t('None Selected')?>
<?php  } ?>

<?php  if (!is_object($pae)) { ?>

	 <?php echo t('Select')?>

	<?php
	$category = PermissionKeyCategory::getByHandle($_REQUEST['pkCategoryHandle']);
	$entitytypes = PermissionAccessEntityType::getList($category);
	foreach($entitytypes as $type) { ?>

<?php echo $type->getAccessEntityTypeLinkHTML()?>

	<?php  } ?>

<?php  foreach($entitytypes as $type) { ?>

<?php  if ($type->getPackageID() > 0) { ?>
	<?php  Loader::packageElement('permission/access/entity/types/' . $type->getAccessEntityTypeHandle(), $type->getPackageHandle(), array('type' => $type)); ?>
<?php  } else { ?>
	<?php  Loader::element('permission/access/entity/types/' . $type->getAccessEntityTypeHandle(), array('type' => $type)); ?>
<?php  } ?>

<?php  } ?>

<?php  } ?>

<?php  if (!isset($_REQUEST['disableDuration'])) { ?>

<?php echo t('Time Settings')?>

<?php echo t('How long will this permission be valid for?')?>

<?php echo Loader::element('permission/duration', array('pd' => $pd)); ?>

<?php  } ?>

	<input type="button" onclick="jQuery.fn.dialog.closeTop()" value="<?php echo t('Cancel')?>" class="btn" />
	<input type="submit" onclick="$('#ccm-permissions-access-entity-form').submit()" value="<?php echo t('Save')?>" class="btn primary ccm-button-right" />

</form>


text: Start an API server backed by NEDB


text:
package jp.sourceforge.ea2ddl.dao.cbean.cq.bs;

import java.util.Map;

import org.seasar.dbflute.cbean.*;
import org.seasar.dbflute.cbean.cvalue.ConditionValue;
import org.seasar.dbflute.cbean.sqlclause.SqlClause;
import jp.sourceforge.ea2ddl.dao.cbean.cq.ciq.*;
import jp.sourceforge.ea2ddl.dao.cbean.*;
import jp.sourceforge.ea2ddl.dao.cbean.cq.*;

/**
 * The base condition-query of t_operationparams.
 * @author DBFlute(AutoGenerator)
 */
public class BsTOperationparamsCQ extends AbstractBsTOperationparamsCQ {

    // ===================================================================================
    //                                                                           Attribute
    //                                                                           =========
    protected TOperationparamsCIQ _inlineQuery;

    // ===================================================================================
    //                                                                         Constructor
    //                                                                         ===========
    public BsTOperationparamsCQ(ConditionQuery childQuery, SqlClause sqlClause, String aliasName, int nestLevel) {
        super(childQuery, sqlClause, aliasName, nestLevel);
    }

    // ===================================================================================
    //                                                                              Inline
    //                                                                              ======
    /**
     * Prepare inline query.

     * {select ... from ... left outer join (select * from t_operationparams) where abc = [abc] ...}
     * @return Inline query. (NotNull)
     */
    public TOperationparamsCIQ inline() {
        if (_inlineQuery == null) {
            _inlineQuery = new TOperationparamsCIQ(getChildQuery(), getSqlClause(), getAliasName(), getNestLevel(), this);
        }
        _inlineQuery.xsetOnClauseInline(false); return _inlineQuery;
    }

    /**
     * Prepare on-clause query.

     * {select ... from ... left outer join t_operationparams on ... and abc = [abc] ...}
     * @return On-clause query. (NotNull)
     */
    public TOperationparamsCIQ on() {
        if (isBaseQuery(this)) { throw new UnsupportedOperationException("Unsupported on-clause for local table!"); }
        TOperationparamsCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); return inlineQuery;
    }

    // ===================================================================================
    //                                                                               Query
    //                                                                               =====

    protected ConditionValue _operationid;
    public ConditionValue getOperationid() {
        if (_operationid == null) { _operationid = new ConditionValue(); }
        return _operationid;
    }
    protected ConditionValue getCValueOperationid() { return getOperationid(); }

    protected Map<String, TOperationCQ> _operationid_InScopeSubQuery_TOperationMap;
    public Map<String, TOperationCQ> getOperationid_InScopeSubQuery_TOperation() { return _operationid_InScopeSubQuery_TOperationMap; }
    public String keepOperationid_InScopeSubQuery_TOperation(TOperationCQ subQuery) {
        if (_operationid_InScopeSubQuery_TOperationMap == null) { _operationid_InScopeSubQuery_TOperationMap = newLinkedHashMap(); }
        String key = "subQueryMapKey" + (_operationid_InScopeSubQuery_TOperationMap.size() + 1);
        _operationid_InScopeSubQuery_TOperationMap.put(key, subQuery); return "operationid_InScopeSubQuery_TOperation." + key;
    }

    public BsTOperationparamsCQ addOrderBy_Operationid_Asc() { regOBA("OperationID"); return this; }
    public BsTOperationparamsCQ addOrderBy_Operationid_Desc() { regOBD("OperationID"); return this; }

    protected ConditionValue _name;
    public ConditionValue getName() {
        if (_name == null) { _name = new ConditionValue(); }
        return _name;
    }
    protected ConditionValue getCValueName() { return getName(); }

    public BsTOperationparamsCQ addOrderBy_Name_Asc() { regOBA("Name"); return this; }
    public BsTOperationparamsCQ addOrderBy_Name_Desc() { regOBD("Name"); return this; }

    protected ConditionValue _type;
    public ConditionValue getType() {
        if (_type == null) { _type = new ConditionValue(); }
        return _type;
    }
    protected ConditionValue getCValueType() { return getType(); }

    public BsTOperationparamsCQ addOrderBy_Type_Asc() { regOBA("Type"); return this; }
    public BsTOperationparamsCQ addOrderBy_Type_Desc() { regOBD("Type"); return this; }

    protected ConditionValue _notes;
    public ConditionValue getNotes() {
        if (_notes == null) { _notes = new ConditionValue(); }
        return _notes;
    }
    protected ConditionValue getCValueNotes() { return getNotes(); }

    public BsTOperationparamsCQ addOrderBy_Notes_Asc() { regOBA("Notes"); return this; }
    public BsTOperationparamsCQ addOrderBy_Notes_Desc() { regOBD("Notes"); return this; }

    protected ConditionValue _pos;
    public ConditionValue getPos() {
        if (_pos == null) { _pos = new ConditionValue(); }
        return _pos;
    }
    protected ConditionValue getCValuePos() { return getPos(); }

    public BsTOperationparamsCQ addOrderBy_Pos_Asc() { regOBA("Pos"); return this; }
    public BsTOperationparamsCQ addOrderBy_Pos_Desc() { regOBD("Pos"); return this; }

    protected ConditionValue _style;
    public ConditionValue getStyle() {
        if (_style == null) { _style = new ConditionValue(); }
        return _style;
    }
    protected ConditionValue getCValueStyle() { return getStyle(); }

    public BsTOperationparamsCQ addOrderBy_Style_Asc() { regOBA("Style"); return this; }
    public BsTOperationparamsCQ addOrderBy_Style_Desc() { regOBD("Style"); return this; }

    protected ConditionValue _kind;
    public ConditionValue getKind() {
        if (_kind == null) { _kind = new ConditionValue(); }
        return _kind;
    }
    protected ConditionValue getCValueKind() { return getKind(); }

    public BsTOperationparamsCQ addOrderBy_Kind_Asc() { regOBA("Kind"); return this; }
    public BsTOperationparamsCQ addOrderBy_Kind_Desc() { regOBD("Kind"); return this; }

    protected ConditionValue _classifier;
    public ConditionValue getClassifier() {
        if (_classifier == null) { _classifier = new ConditionValue(); }
        return _classifier;
    }
    protected ConditionValue getCValueClassifier() { return getClassifier(); }

    public BsTOperationparamsCQ addOrderBy_Classifier_Asc() { regOBA("Classifier"); return this; }
    public BsTOperationparamsCQ addOrderBy_Classifier_Desc() { regOBD("Classifier"); return this; }

    protected ConditionValue _eaGuid;
    public ConditionValue getEaGuid() {
        if (_eaGuid == null) { _eaGuid = new ConditionValue(); }
        return _eaGuid;
    }
    protected ConditionValue getCValueEaGuid() { return getEaGuid(); }

    public BsTOperationparamsCQ addOrderBy_EaGuid_Asc() { regOBA("ea_guid"); return this; }
    public BsTOperationparamsCQ addOrderBy_EaGuid_Desc() { regOBD("ea_guid"); return this; }

    protected ConditionValue _styleex;
    public ConditionValue getStyleex() {
        if (_styleex == null) { _styleex = new ConditionValue(); }
        return _styleex;
    }
    protected ConditionValue getCValueStyleex() { return getStyleex(); }

    public BsTOperationparamsCQ addOrderBy_Styleex_Asc() { regOBA("StyleEx"); return this; }
    public BsTOperationparamsCQ addOrderBy_Styleex_Desc() { regOBD("StyleEx"); return this; }

    // ===================================================================================
    //                                                           Specified Derived OrderBy
    //                                                           =========================
    public BsTOperationparamsCQ addSpecifiedDerivedOrderBy_Asc(String aliasName) { registerSpecifiedDerivedOrderBy_Asc(aliasName); return this; }
    public BsTOperationparamsCQ addSpecifiedDerivedOrderBy_Desc(String aliasName) { registerSpecifiedDerivedOrderBy_Desc(aliasName); return this; }

    // ===================================================================================
    //                                                                         Union Query
    //                                                                         ===========
    protected void reflectRelationOnUnionQuery(ConditionQuery baseQueryAsSuper, ConditionQuery unionQueryAsSuper) {
        TOperationparamsCQ baseQuery = (TOperationparamsCQ)baseQueryAsSuper;
        TOperationparamsCQ unionQuery = (TOperationparamsCQ)unionQueryAsSuper;
        if (baseQuery.hasConditionQueryTOperation()) {
            unionQuery.queryTOperation().reflectRelationOnUnionQuery(baseQuery.queryTOperation(), unionQuery.queryTOperation());
        }
    }

    // ===================================================================================
    //                                                                       Foreign Query
    //                                                                       =============
    public TOperationCQ queryTOperation() {
        return getConditionQueryTOperation();
    }
    protected TOperationCQ _conditionQueryTOperation;
    public TOperationCQ getConditionQueryTOperation() {
        if (_conditionQueryTOperation == null) {
            _conditionQueryTOperation = xcreateQueryTOperation();
            xsetupOuterJoinTOperation();
        }
        return _conditionQueryTOperation;
    }
    protected TOperationCQ xcreateQueryTOperation() {
        String nrp = resolveNextRelationPath("t_operationparams", "tOperation");
        String jan = resolveJoinAliasName(nrp, getNextNestLevel());
        TOperationCQ cq = new TOperationCQ(this, getSqlClause(), jan, getNextNestLevel());
        cq.xsetForeignPropertyName("tOperation"); cq.xsetRelationPath(nrp); return cq;
    }
    protected void xsetupOuterJoinTOperation() {
        TOperationCQ cq = getConditionQueryTOperation();
        Map<String, String> joinOnMap = newLinkedHashMap();
        joinOnMap.put(getRealColumnName("OperationID"), cq.getRealColumnName("OperationID"));
        registerOuterJoin(cq, joinOnMap);
    }
    public boolean hasConditionQueryTOperation() {
        return _conditionQueryTOperation != null;
    }

    // ===================================================================================
    //                                                                       Very Internal
    //                                                                       =============
    // Very Internal (for Suppressing Warn about 'Not Use Import')
    String xCB() { return TOperationparamsCB.class.getName(); }
    String xCQ() { return TOperationparamsCQ.class.getName(); }
    String xMap() { return Map.class.getName(); }
}


text:
namespace Lazybank.Data.Models
{
    public class LocalPayment : Payment
    {
        public string BeneficiaryBank { get; set; }
    }
}


text:
package io.reflectoring.modules.rest;

import io.reflectoring.modules.github.GitHubModuleMock;
import io.reflectoring.modules.mail.EmailModuleMock;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
import org.springframework.context.annotation.Import;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.web.servlet.MockMvc;

import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;

@WebMvcTest
@TestPropertySource(properties = "mail.enabled=false")
@Import({
        GitHubModuleMock.class,
        EmailModuleMock.class
})
class RepositoryControllerTest {

    @Autowired
    private MockMvc mockMvc;

    @Autowired
    private EmailModuleMock emailModuleMock;

    @Autowired
    private GitHubModuleMock gitHubModuleMock;

    @Test
    void givenRepositoryDoesNotExist_thenRepositoryIsCreatedSuccessfully() throws Exception {

        String repositoryUrl = "https://github.com/reflectoring/reflectoring.github.io";

        gitHubModuleMock.givenDefaultState(repositoryUrl);
        emailModuleMock.givenSendMailSucceeds();

        mockMvc.perform(post("/github/repository")
                .param("token", "123")
                .param("repositoryName", "foo")
                .param("organizationName", "bar"))
                .andExpect(status().is(200));

        emailModuleMock.assertSentMailContains(repositoryUrl);
        gitHubModuleMock.assertRepositoryCreated();
    }

    @Test
    void givenRepositoryExists_thenReturnsBadRequest() throws Exception {

        String repositoryUrl = "https://github.com/reflectoring/reflectoring.github.io";

        gitHubModuleMock.givenDefaultState(repositoryUrl);
        gitHubModuleMock.givenRepositoryExists();
        emailModuleMock.givenSendMailSucceeds();

        mockMvc.perform(post("/github/repository")
                .param("token", "123")
                .param("repositoryName", "foo")
                .param("organizationName", "bar"))
                .andExpect(status().is(400));

        emailModuleMock.assertNoMailSent();
        gitHubModuleMock.assertRepositoryNotCreated();
    }

}


text:
var vm = require('vm');
var should = require('should');
var handlebars = require('../../lib/preprocessors/handlebars.js');

describe( 'preprocessor - handlebars', function(){

	it( 'converts a handlebars string into javascript', function( cb ){

		var file = {
			path: 'test.jst',
			contents: '<div>{{text}}</div>'
		};
		var config = {
			jst_namespace: 'JST'
		};
		handlebars( file, config, function( processed ){

			var context = {};
			vm.runInNewContext( processed, context );

			context.should.have.property('JST').with.have.property('test');
			cb();

		});

	});

});


text:
#ifndef _RLEEXTRACTLOADANDACCESS_H_
#define _RLEEXTRACTLOADANDACCESS_H_

#include "../common/Interfaces.h"
#include "../AM/AM.h"
#include "../Operators/ColumnExtracter.h"
#include "../Writers/RLEWriter.h"
#include "../Wrappers/Encoder/RLEEncoder.h"
#include "../AM/PageWriter.h"
#include "../common/Constants.h"
#include "../common/Util.h"
#include "../Wrappers/CodingException.h"
#include "../Wrappers/Decoder/RLEDecoder.h"
#include "../Wrappers/RLEDataSource.h"
#include "../Paths.h"
#include "../AM/PagePlacer.h"
#include "UnitTest.h"
#include "../Wrappers/PosRLEBlock.h"
#include "../Operators/TestDataSrc.h"

class RLEExtractLoadAndAccess : public UnitTest
{
public:
	RLEExtractLoadAndAccess();
	virtual ~RLEExtractLoadAndAccess();
	bool run(Globals* g, const vector<string>&);
	bool test(char* msg_, int retBool_, int val_, int exp_);
};

#endif //_RLEEXTRACTLOADANDACCESS_H_


text:
package guru.nidi.codeassert.checkstyle;

import com.puppycrawl.tools.checkstyle.api.AuditEvent;
import guru.nidi.codeassert.Analyzer;
import guru.nidi.codeassert.AnalyzerResult;

import java.util.List;

public class CheckstyleResult extends AnalyzerResult<List<AuditEvent>> {
    CheckstyleResult(Analyzer<List<AuditEvent>> analyzer,
                     List<AuditEvent> findings, List<String> unusedActions) {
        super(analyzer, findings, unusedActions);
    }
}


text:
package fr.vsct.dt.maze.topology

import com.github.dockerjava.api.command.CreateContainerCmd

abstract class SingleContainerClusterNode extends MultipleContainerClusterNode {

  override final def dataContainers: Seq[CreateContainerCmd] = Seq()

}


text:
namespace google {
namespace cloud {
namespace spanner_testing {
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN

class MockSpannerStub : public google::cloud::spanner_internal::SpannerStub {
 public:
  MOCK_METHOD(StatusOr<google::spanner::v1::Session>, CreateSession,
              (grpc::ClientContext&,
               google::spanner::v1::CreateSessionRequest const&),
              (override));

  MOCK_METHOD(StatusOr<google::spanner::v1::BatchCreateSessionsResponse>,
              BatchCreateSessions,
              (grpc::ClientContext&,
               google::spanner::v1::BatchCreateSessionsRequest const&),
              (override));

  MOCK_METHOD(
      future<StatusOr<google::spanner::v1::BatchCreateSessionsResponse>>,
      AsyncBatchCreateSessions,
      (CompletionQueue & cq, std::unique_ptr<grpc::ClientContext> context,
       google::spanner::v1::BatchCreateSessionsRequest const& request),
      (override));

  MOCK_METHOD(StatusOr<google::spanner::v1::Session>, GetSession,
              (grpc::ClientContext&,
               google::spanner::v1::GetSessionRequest const&),
              (override));

  MOCK_METHOD(StatusOr<google::spanner::v1::ListSessionsResponse>, ListSessions,
              (grpc::ClientContext&,
               google::spanner::v1::ListSessionsRequest const&),
              (override));

  MOCK_METHOD(Status, DeleteSession,
              (grpc::ClientContext&,
               google::spanner::v1::DeleteSessionRequest const&),
              (override));

  MOCK_METHOD(future<Status>, AsyncDeleteSession,
              (CompletionQueue&, std::unique_ptr<grpc::ClientContext>,
               google::spanner::v1::DeleteSessionRequest const&),
              (override));

  MOCK_METHOD(StatusOr<google::spanner::v1::ResultSet>, ExecuteSql,
              (grpc::ClientContext&,
               google::spanner::v1::ExecuteSqlRequest const&),
              (override));

  MOCK_METHOD(future<StatusOr<google::spanner::v1::ResultSet>>, AsyncExecuteSql,
              (CompletionQueue&, std::unique_ptr<grpc::ClientContext>,
               google::spanner::v1::ExecuteSqlRequest const&),
              (override));

  MOCK_METHOD(
      std::unique_ptr<
          grpc::ClientReaderInterface<google::spanner::v1::PartialResultSet>>,
      ExecuteStreamingSql,
      (grpc::ClientContext&, google::spanner::v1::ExecuteSqlRequest const&),
      (override));

  MOCK_METHOD(StatusOr<google::spanner::v1::ExecuteBatchDmlResponse>,
              ExecuteBatchDml,
              (grpc::ClientContext&,
               google::spanner::v1::ExecuteBatchDmlRequest const&),
              (override));

  MOCK_METHOD(StatusOr<google::spanner::v1::ResultSet>, Read,
              (grpc::ClientContext&, google::spanner::v1::ReadRequest const&));

  MOCK_METHOD(
      std::unique_ptr<
          grpc::ClientReaderInterface<google::spanner::v1::PartialResultSet>>,
      StreamingRead,
      (grpc::ClientContext&, google::spanner::v1::ReadRequest const&),
      (override));

  MOCK_METHOD(StatusOr<google::spanner::v1::Transaction>, BeginTransaction,
              (grpc::ClientContext&,
               google::spanner::v1::BeginTransactionRequest const&),
              (override));

  MOCK_METHOD(StatusOr<google::spanner::v1::CommitResponse>, Commit,
              (grpc::ClientContext&, google::spanner::v1::CommitRequest const&),
              (override));

  MOCK_METHOD(Status, Rollback,
              (grpc::ClientContext&,
               google::spanner::v1::RollbackRequest const&),
              (override));

  MOCK_METHOD(StatusOr<google::spanner::v1::PartitionResponse>, PartitionQuery,
              (grpc::ClientContext&,
               google::spanner::v1::PartitionQueryRequest const&),
              (override));

  MOCK_METHOD(StatusOr<google::spanner::v1::PartitionResponse>, PartitionRead,
              (grpc::ClientContext&,
               google::spanner::v1::PartitionReadRequest const&),
              (override));
};

GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
}  // namespace spanner_testing
}  // namespace cloud
}  // namespace google

#endif  // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_TESTING_MOCK_SPANNER_STUB_H


text:
<!DOCTYPE html>

  <title>Editing: spellcheck attribute test</title>
  <link rel="author" title="Baidu" href="mailto: guopengcheng@baidu.com"/>
  <link rel="help" href="https://html.spec.whatwg.org/multipage/#spelling-and-grammar-checking"/>

  <textarea id="testText1" spellcheck="true">Test textarea with spellcheck is true</textarea>
  <textarea id="testText2" spellcheck="false">Test textarea with spellcheck is false</textarea>


text:
module Regexp::Expression

  module Conditional
    class TooManyBranches < StandardError
      def initialize
        super('The conditional expression has more than 2 branches')
      end
    end

    class Condition < Regexp::Expression::Base; end
    class Branch    < Regexp::Expression::Sequence; end

    class Expression < Regexp::Expression::Subexpression
      def initialize(token)
        super(token)

        @condition = nil
        @branches  = []
      end

      def condition(exp = nil)
        return @condition unless exp
        @condition = exp
        @expressions << exp
      end

      def <<(exp)
        @expressions.last << exp
      end

      def branch(exp = nil)
        raise TooManyBranches.new if @branches.length == 2

        sequence = Branch.new(level, set_level, conditional_level + 1)

        @expressions << sequence
        @branches << @expressions.last
      end

      def branches
        @branches
      end

      def quantify(token, text, min = nil, max = nil, mode = :greedy)
        branches.last.last.quantify(token, text, min, max, mode)
      end

      def to_s
        s = @text.dup
        s << @condition.text
        s << branches.map{|e| e.to_s}.join('|')
        s << ')'
      end
    end
  end

end


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

package org.chromium.chrome.browser.util;

import android.content.Intent;
import android.os.Binder;
import android.os.Bundle;
import android.os.IBinder;
import android.os.Parcel;
import android.os.Parcelable;
import android.os.TransactionTooLargeException;
import android.support.v4.app.BundleCompat;

import org.chromium.base.Log;
import org.chromium.base.VisibleForTesting;

import java.util.ArrayList;

/**
 * Utilities dealing with extracting information from intents.
 */
public class IntentUtils {
    private static final String TAG = "IntentUtils";

    /** See {@link #isIntentTooLarge(Intent)}. */
    private static final int MAX_INTENT_SIZE_THRESHOLD = 750000;

    /**
     * Just like {@link Intent#hasExtra(String)} but doesn't throw exceptions.
     */
    public static boolean safeHasExtra(Intent intent, String name) {
        try {
            return intent.hasExtra(name);
        } catch (Throwable t) {
            // Catches un-parceling exceptions.
            Log.e(TAG, "hasExtra failed on intent " + intent);
            return false;
        }
    }

    /**
     * Just like {@link Intent#getBooleanExtra(String, boolean)} but doesn't throw exceptions.
     */
    public static boolean safeGetBooleanExtra(Intent intent, String name, boolean defaultValue) {
        try {
            return intent.getBooleanExtra(name, defaultValue);
        } catch (Throwable t) {
            // Catches un-parceling exceptions.
            Log.e(TAG, "getBooleanExtra failed on intent " + intent);
            return defaultValue;
        }
    }

    /**
     * Just like {@link Intent#getIntExtra(String, int)} but doesn't throw exceptions.
     */
    public static int safeGetIntExtra(Intent intent, String name, int defaultValue) {
        try {
            return intent.getIntExtra(name, defaultValue);
        } catch (Throwable t) {
            // Catches un-parceling exceptions.
            Log.e(TAG, "getIntExtra failed on intent " + intent);
            return defaultValue;
        }
    }

    /**
     * Just like {@link Bundle#getInt(String, int)} but doesn't throw exceptions.
     */
    public static int safeGetInt(Bundle bundle, String name, int defaultValue) {
        try {
            return bundle.getInt(name, defaultValue);
        } catch (Throwable t) {
            // Catches un-parceling exceptions.
            Log.e(TAG, "getInt failed on bundle " + bundle);
            return defaultValue;
        }
    }

    /**
     * Just like {@link Intent#getIntArrayExtra(String)} but doesn't throw exceptions.
     */
    public static int[] safeGetIntArrayExtra(Intent intent, String name) {
        try {
            return intent.getIntArrayExtra(name);
        } catch (Throwable t) {
            // Catches un-parceling exceptions.
            Log.e(TAG, "getIntArrayExtra failed on intent " + intent);
            return null;
        }
    }

    /**
     * Just like {@link Bundle#getIntArray(String)} but doesn't throw exceptions.
     */
    public static int[] safeGetIntArray(Bundle bundle, String name) {
        try {
            return bundle.getIntArray(name);
        } catch (Throwable t) {
            // Catches un-parceling exceptions.
            Log.e(TAG, "getIntArray failed on bundle " + bundle);
            return null;
        }
    }

    /**
     * Just like {@link Intent#getLongExtra(String, long)} but doesn't throw exceptions.
     */
    public static long safeGetLongExtra(Intent intent, String name, long defaultValue) {
        try {
            return intent.getLongExtra(name, defaultValue);
        } catch (Throwable t) {
            // Catches un-parceling exceptions.
            Log.e(TAG, "getLongExtra failed on intent " + intent);
            return defaultValue;
        }
    }

    /**
     * Just like {@link Intent#getStringExtra(String)} but doesn't throw exceptions.
     */
    public static String safeGetStringExtra(Intent intent, String name) {
        try {
            return intent.getStringExtra(name);
        } catch (Throwable t) {
            // Catches un-parceling exceptions.
            Log.e(TAG, "getStringExtra failed on intent " + intent);
            return null;
        }
    }

    /**
     * Just like {@link Bundle#getString(String)} but doesn't throw exceptions.
     */
    public static String safeGetString(Bundle bundle, String name) {
        try {
            return bundle.getString(name);
        } catch (Throwable t) {
            // Catches un-parceling exceptions.
            Log.e(TAG, "getString failed on bundle " + bundle);
            return null;
        }
    }

    /**
     * Just like {@link Intent#getBundleExtra(String)} but doesn't throw exceptions.
     */
    public static Bundle safeGetBundleExtra(Intent intent, String name) {
        try {
            return intent.getBundleExtra(name);
        } catch (Throwable t) {
            // Catches un-parceling exceptions.
            Log.e(TAG, "getBundleExtra failed on intent " + intent);
            return null;
        }
    }

    /**
     * Just like {@link Bundle#getBundle(String)} but doesn't throw exceptions.
     */
    public static Bundle safeGetBundle(Bundle bundle, String name) {
        try {
            return bundle.getBundle(name);
        } catch (Throwable t) {
            // Catches un-parceling exceptions.
            Log.e(TAG, "getBundle failed on bundle " + bundle);
            return null;
        }
    }

    /**
     * Just like {@link Bundle#getParcelable(String)} but doesn't throw exceptions.
     */
    public static <T extends Parcelable> T safeGetParcelable(Bundle bundle, String name) {
        try {
            return bundle.getParcelable(name);
        } catch (Throwable t) {
            // Catches un-parceling exceptions.
            Log.e(TAG, "getParcelable failed on bundle " + bundle);
            return null;
        }
    }

    /**
     * Just like {@link Intent#getParcelableExtra(String)} but doesn't throw exceptions.
     */
    public static <T extends Parcelable> T safeGetParcelableExtra(Intent intent, String name) {
        try {
            return intent.getParcelableExtra(name);
        } catch (Throwable t) {
            // Catches un-parceling exceptions.
            Log.e(TAG, "getParcelableExtra failed on intent " + intent);
            return null;
        }
    }

    /**
     * Just link {@link Intent#getParcelableArrayListExtra(String)} but doesn't throw exceptions.
     */
    public static <T extends Parcelable> ArrayList<T> getParcelableArrayListExtra(
            Intent intent, String name) {
        try {
            return intent.getParcelableArrayListExtra(name);
        } catch (Throwable t) {
            // Catches un-parceling exceptions.
            Log.e(TAG, "getParcelableArrayListExtra failed on intent " + intent);
            return null;
        }
    }

    /**
     * Just like {@link Intent#getStringArrayListExtra(String)} but doesn't throw exceptions.
     */
    public static ArrayList<String> safeGetStringArrayListExtra(Intent intent, String name) {
        try {
            return intent.getStringArrayListExtra(name);
        } catch (Throwable t) {
            // Catches un-parceling exceptions.
            Log.e(TAG, "getStringArrayListExtra failed on intent " + intent);
            return null;
        }
    }

    /**
     * Just like {@link Intent#getByteArrayExtra(String)} but doesn't throw exceptions.
     */
    public static byte[] safeGetByteArrayExtra(Intent intent, String name) {
        try {
            return intent.getByteArrayExtra(name);
        } catch (Throwable t) {
            // Catches un-parceling exceptions.
            Log.e(TAG, "getByteArrayExtra failed on intent " + intent);
            return null;
        }
    }

    /**
     * Just like {@link BundleCompat#getBinder()}, but doesn't throw exceptions.
     */
    public static IBinder safeGetBinder(Bundle bundle, String name) {
        if (bundle == null) return null;
        try {
            return BundleCompat.getBinder(bundle, name);
        } catch (Throwable t) {
            // Catches un-parceling exceptions.
            Log.e(TAG, "getBinder failed on bundle " + bundle);
            return null;
        }
    }

    /**
     * @return a Binder from an Intent, or null.
     *
     * Creates a temporary copy of the extra Bundle, which is required as
     * Intent#getBinderExtra() doesn't exist, but Bundle.getBinder() does.
     */
    @VisibleForTesting
    public static IBinder safeGetBinderExtra(Intent intent, String name) {
        if (!intent.hasExtra(name)) return null;
        Bundle extras = intent.getExtras();
        return safeGetBinder(extras, name);
    }

    /**
     * Inserts a {@link Binder} value into an Intent as an extra.
     *
     * Uses {@link BundleCompat#putBinder()}, but doesn't throw exceptions.
     *
     * @param intent Intent to put the binder into.
     * @param name Key.
     * @param binder Binder object.
     */
    @VisibleForTesting
    public static void safePutBinderExtra(Intent intent, String name, IBinder binder) {
        if (intent == null) return;
        Bundle bundle = new Bundle();
        try {
            BundleCompat.putBinder(bundle, name, binder);
        } catch (Throwable t) {
            // Catches parceling exceptions.
            Log.e(TAG, "putBinder failed on bundle " + bundle);
        }
        intent.putExtras(bundle);
    }

    /**
     * Returns how large the Intent will be in Parcel form, which is helpful for gauging whether
     * Android will deliver the Intent instead of throwing a TransactionTooLargeException.
     *
     * @param intent Intent to get the size of.
     * @return Number of bytes required to parcel the Intent.
     */
    public static int getParceledIntentSize(Intent intent) {
        Parcel parcel = Parcel.obtain();
        intent.writeToParcel(parcel, 0);
        return parcel.dataSize();
    }

    /**
     * Determines if an Intent's size is bigger than a reasonable threshold.  Having too many large
     * transactions in flight simultaneously (including Intents) causes Android to throw a
     * {@link TransactionTooLargeException}.  According to that class, the limit across all
     * transactions combined is one megabyte.  Best practice is to keep each individual Intent well
     * under the limit to avoid this situation.
     */
    public static boolean isIntentTooLarge(Intent intent) {
        return getParceledIntentSize(intent) > MAX_INTENT_SIZE_THRESHOLD;
    }
}