text:
from __future__ import unicode_literals

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion

class Migration(migrations.Migration):

    dependencies = [
        ('gitcentral', '0003_auto_20160226_0223'),
    ]

    operations = [
        migrations.AddField(
            model_name='repo',
            name='parent',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='gitcentral.Repo'),
        ),
        migrations.AlterField(
            model_name='repopermission',
            name='owner',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='User'),
        ),
        migrations.AlterField(
            model_name='repopermission',
            name='permission',
            field=models.IntegerField(choices=[(0, 'Read-only'), (1, 'Read-Write'), (2, 'Admin')], default=0),
        ),
    ]

redpajama_set_name: RedPajamaGithub


text:
layout: blog
title: Blog Will Arevalo
---

Blog

    {% for post in site.posts %}

{{ post.title | capitalize }}

                {{ post.category }}

                {{ post.date | date: '%B %d, %Y' }}

        {{ post.excerpt }}

    {% endfor %}


text:
layout: default
---

 Visual Domain Adaptation Challenge

[News]
[Overview]
[Winners]
[Browse Data]
[Download]
[Evaluation]
[Rules]
[FAQ]
[TASK-CV Workshop]
[Organizers]
[Sponsors]

 </nr>

 News

	The 2018 VisDA challenge is live and open for registration! It features a larger, more diverse dataset and two new competition tracks--open-set object classification and object detection. Vist the challenge website for more details and to register! In the meantime, the 2017 test server is still up and running if you wish to submit to it.

November 1 TASK-CV workshop presentations available.

October 10 Winners announcement!

September 30 Thank you to all who participated in the challenge! Stay tuned for the winners announcement.

September 10 Prizes announced! See here for details.

September 8 Testing data released

July 13 Our competition is featured on  CodaLab!

June 23 Evaluation servers are open for submission

June 22 The deadline for abstract submission to the TASK-CV workshop has been extended

June 19 Training data, validation data and DevKits released

 Winners of VisDA-2017 challenge

 Classification   [full leaderboard]

    #
    Team Name
    Affiliation
    Score

     1
    GF_ColourLab_UEA
	  University of East Anglia, Colour Lab [arxiv]
		   [code]
    92.8

     2
    NLE_DA
    NAVER LABS Europe
    87.7

     3
    BUPT_OVERFIT
    Beijing University of Posts and Telecommunications
    85.4

 Segmentation   [full leaderboard]

    #
    Team Name
    Affiliation
    Score

     1
    RTZH [pdf]
    Microsoft Research Asia
    47.5

     2
     _piotr_
    University of Oxford, Active Vision Laboratory
    44.7

     3
     whung
    University of California, Merced, Vision and Learning Lab
    42.4

Thank you to those who attended TASK-CV and made it a success! Below please find the VisDA challenge presentations from workshop organizers and from the top performing teams in each track.

VisDA organizers presentation

Classification track runner-up presentation

Classification track winner presentation

Segmentation track honorable mention presentation

Segmentation track winner presentation

 Overview

 We are pleased to announce the 2017 Visual Domain Adaptation (VisDA2017) Challenge! It is well known that the success of machine learning methods on visual recognition tasks is highly dependent on access to large labeled datasets. Unfortunately, performance often drops significantly when the model is presented with data from a new deployment domain which it did not see in training, a problem known as dataset shift. The VisDA challenge aims to test domain adaptation methods' ability to transfer source knowledge and adapt it to novel target domains.

Caption: An example of a deep learning model failing to properly segment the scene into semantic categories such as road (green), building (gray), etc., because the input image looks different from its training data. Unsupervised Domain Adaptation methods aim to use labeled samples from the train domain and large volumes of unlabeled samples from the test domain to reduce a prediction error on the test domain. [1]

 The competition will take place during the months of June -- September 2017, and the top performing teams will be invited to present their results at the TASK-CV workshop at ICCV 2017 in Venice, Italy. This year's challenge focuses on  synthetic-to-real visual domain shifts and includes two tracks:

image classification

image segmentation

 Participants are welcome to enter in one or both tracks.

 Classification Track

 In this challenge, the goal is to develop a method of unsupervised domain adaptation for image classification. Participants will be given three datasets, each containing the same object categories:

  training domain (source): synthetic 2D renderings of 3D models generated from different angles and with different lighting conditions

  validation domain (target): a photo-realistic or real-image validation domain that participants can use to evaluate performance of their domain adaptation methods

  test domain (target): a new real-image test domain,  different from the validation domain and without labels . The test set will be released shortly before the end of the competition

 The reason for using different target domains for validation and test is to evaluate the performance of proposed models as an out-of-the-box domain adaptation tool. This setting more closely mimics realistic deployment scenarios where the target domain is unknown at training time and discourages algorithms that are designed to handle a particular target domain.

 Segmentation Track

 In this challenge, the goal is to develop an algorithm that can adapt between synthetic dashcam views and real dashcam footage for the semantic image segmentation task. The training data will include pixel-level semantic annotations for 19 classes. We will also provide validation and testing data, following same protocol:

 training domain (source): synthetic dashcam renderings along with semantic segmentation labels for 19 classes

 validation domain (target): a real world collection of dashcam images along with semantic segmentation labels for the corresponding 19 classes to be used for validating the unsupervised semantic segmentation performance

 test domain (target): a collection of real world dashcam images, different from the validation domain and without labels. The test set will be released shortly before the end of the competition

 Prizes

 We are excited to announce prizes for the top performing teams! The winners in both the classification and segmentation tracks will receive:

 1st place: $2,000

 2nd place: $500

 3rd place: $250

 Browse Data

 If you would like to browse sample images from each of the datasets currently available please use the links below:

 Classification challenge:

training domain

validation domain

 Segmentation challenge:

training domain

validation domain

 Download

Please follow the instructions outlined in the VisDA GitHub repository to download data and development kits for the classification and segmentation tracks. Training, validation and testing data are now available to download. We have also included baseline models and instructions on training several existing domain adaptation methods.

The DevKits are currently in beta-release. If you find any bugs, please open an issue in our GitHub repo rather than emailing the organizers directly.

 You can get the tech report describing dataset and baseline experiments from
	arxiv. If you use data, code or its derivatives, please consider citing:

@misc{visda2017,
    Author = {Xingchao Peng and Ben Usman and Neela Kaushik and Judy Hoffman and Dequan Wang and Kate Saenko},
    Title = {VisDA: The Visual Domain Adaptation Challenge},
    Year = {2017},
    Eprint = {arXiv:1710.06924},
}

 Evaluation

 We will use CodaLab to evaluate submissions and maintain a leaderboard. To register for the evaluation server, please create an account on CodaLab and and enter as a participant in one of the following competitions:

Classification Challenge

Segmentation Challenge

If you are working as a team, please register using one account for your team and indicate the names of all of the members on your team. This can be modified in the "User Settings" tab. See the challenge rules for more details.

Please refer to the instructions in the DevKit ReadMe file for specific details on submission formatting and evaluation for the classification and segmentation challenges.

 Rules

The VisDA challenge tests adaptation and model transfer, so the rules are different than most challenges. Please read them carefully.

Supervised Training: Teams may only submit test results of models trained on the source domain data and optionally pre-trained on ImageNet. Training on the validation dataset is not allowed for test submissions. Note, this may be different from other challenges. In this year's VisDA challenge,  the goal is to test how well models can adapt from synthetic to real data. Therefore, training on the validation domain is not allowed. To ensure equal comparison, we also do not allow any other external training data, modifying the provided training dataset, or any form of manual data labeling.

Pretraining on ImageNet: If pre-training on the ImageNet ILSVRC classification training data, only the weights can be transferred, not the actual classifiers for specific objects, i.e. participants should not manually exploit correspondences between ImageNet output labels and labels in the data. Please indicate in your method description which pre-trained weights were used for initialization of the model. Teams who place in the top of the "no ImageNet pretraining" track will receive special recognition.

Unsupervised training: Models can be adapted (trained) on the test data in an unsupervised way, i.e. without labels. Adaptation, even unsupervised, on the validation data is not allowed for test submissions.  Note, we have released the validation labels to facilitate algorithm development.

Source Models: The performance of a domain adaptation algorithm greatly depends on the baseline performance of the model trained only on source data. We ask that teams submit two sets of results: 1) predictions obtained only with the source-trained model, and 2) predictions obtained with the adapted model. See the development kit for submission formatting details.

Leaderboard:The main leaderboard for each competition track will show results of adapted models and will be used to determine the final team ranks. The expanded leaderboard will additionally show the team's source-only models, i.e. those trained only on the source domain without any adaptation. These results are useful for estimating how much the method improves upon its source-only model, but will not be used to determine team ranks.

 FAQ

Can we train models on data other than the source domain?

 Participants may elect to pre-train their models only on ImageNet. Please refer to the challenge evaluation instructions found in the DevKit for more details.

Do we have to use the provided baseline models?

No, these are provided for your convenience and are optional.

How many submissions can each team submit per competition track?

For the validation domain, the number of submissions per team is limited to 20 upload per day and there are no restrictions on total number of submissions. For the test domain, the number of submissions per team is limited to 1 upload per day and 20 uploads in total. Only one account per team must be used to submit results. Do not create multiple accounts for a single project to circumvent this limit, as this will result in disqualification.

Can multiple teams enter from the same research group?

Yes, so long as each team is comprised of different members.

Can external data be used?

The allowed training data consists of the VisDA 2017 Training set. The VisDA 2017 Validation set can be used to test adaptation to a target domain offline, but cannot be used to train the final submitted model (with or without labels). Optional initialization of models with weights pre-trained on ImageNet is allowed and must be declared in the submission. Please see the challenge rules for more details.

Are challenge participants required to reveal all details of their methods?

Participants are encouraged to include a brief write-up regarding their methods when submitting their results. However, this is not mandatory.

Do participants need to adhere to TASK-CV abstract submission deadlines to participate in the challenge?

Submission of a TASK-CV workshop abstract is not required to participate in the challenge. The top-performing teams will be invited to present their approaches at the workshop, even if they did not submit an abstract.

When is the final submission deadline?

All results must be submitted by September 29th at 11:59pm ET. On CodaLab, this is equivalent to September 30th at 3:59am UTC.

 Workshop

The challenge is associated with the 4th annual TASK-CV workshop, being held at ICCV 2017 in Venice, Italy. Challenge participants are invited to submit abstracts to the workshop, but this is not required for challenge participation. If you wish to submit an abstract, please see the TASK-CV website for deadlines. The top performing teams will be invited to give a talk about their results at the workshop during a special session.

 Organizers

Kate Saenko (Boston University),
Ben Usman (Boston University),
Xingchao Peng (Boston University),
Neela Kaushik (Boston University),
Judy Hoffman (Stanford University),
Dequan Wang (UC Berkeley)

 Sponsors

 References

[1] FCNs in the Wild: Pixel-level Adversarial and Constraint-based Adaptation, Judy Hoffman, Dequan Wang, Fisher Yu, Trevor Darrell


text:
maria.Model.subclass(coupler, "ErrorModel", {
  properties: {
    getSubject: function() {
      return this._subject;
    },
    setSubject: function(subject) {
      this._subject = subject;
    },
    getMessage: function() {
      return this._message;
    },
    setMessage: function(message) {
      this._message = message;
    }
  }
});


text:
package com.huawei.esdk.fusionmanager.local.resources.user;

import com.huawei.esdk.fusionmanager.local.model.user.AddMemberReq;
import com.huawei.esdk.fusionmanager.local.model.user.AddMemberResp;
import com.huawei.esdk.fusionmanager.local.model.user.ListBasicVdcReqEx;
import com.huawei.esdk.fusionmanager.local.model.user.ListBasicVdcResp;
import com.huawei.esdk.fusionmanager.local.model.user.ModifyUserLoginVdcResp;
import com.huawei.esdk.fusionmanager.local.model.user.RemoveMemberResp;

/**
 *
 * 用户与VDC关系。
 *
代码示例:

 *     ClientProviderBean bean = new ClientProviderBean();

 *     //设置FM所在的IP

 *     bean.setServerIp("188.188.40.43");

 *     //设置FM的端口

 *     bean.setServerPort("643");

 *     //设置FM用户名,跟登录用户名保持一致

 *     bean.setUserName("FM01");

 *     //获取UserVdcRelationResource接口的实现

 *     UserVdcRelationResource instance = (UserVdcRelationResource)ServiceFactory.getService(UserVdcRelationResource.class,bean);

 *

 * @since eSDK Cloud V100R003C30
 */
public interface UserVdcRelationResource
{
    /**
     *
     * 用户加入VDC。
     *
代码示例:

     *     AddMemberReq req = new AddMemberReq();

     *     AddMemberParameter r = new AddMemberParameter();

     *     List<MemberInfo> userInfos = new ArrayList<MemberInfo>();

     *     MemberInfo m1 = new MemberInfo();

     *     m1.setId("18");

     *     List<String> roleIds = new ArrayList<String>();

     *     roleIds.add("6");

     *     roleIds.add("5");

     *     m1.setRoleIds(roleIds);

     *     userInfos.add(m1);

     *     r.setUserInfos(userInfos);

     *     req.setAddMember(r);

     *     AddMemberResp resp = instance.create(req, "4");
     *

     * @param req 【必选】用户加入VDC请求信息。
     * @param vdcId 【必选】用户准备加入的VDC ID。
     * @return {@code AddMemberResp} 用户加入VDC返回信息。
     * @since eSDK Cloud V100R003C30
     */
    public AddMemberResp create(AddMemberReq req, String vdcId);

    /**
     *
     * 从VDC中移除用户。
     *
代码示例:

     *     RemoveMemberResp resp = instance.remove("4", "6");
     *

     * @param vdcId 【必选】用户所在的VDC ID。
     * @param userId 【必选】待删除的用户ID。
     * @return {@code RemoveMemberResp} 从VDC中移除用户返回信息。
     * @since eSDK Cloud V100R003C30
     */
    public RemoveMemberResp remove(String vdcId, String userId);

    /**
     *
     * 查看用户加入的VDC。
     *
代码示例:

     *     ListBasicVdcReqEx reqEx = new ListBasicVdcReqEx();

     *     reqEx.setUserId("21");

     *     reqEx.setStart(0);

     *     reqEx.setLimit(30);

     *     ListBasicVdcResp resp = instance.list(reqEx);
     *

     * @param reqEx 【必选】查看用户加入的VDC请求信息。
     * @return {@code ListBasicVdcResp} 查看用户加入的VDC返回信息。
     * @since eSDK Cloud V100R003C30
     */
    public ListBasicVdcResp list(ListBasicVdcReqEx reqEx);

    /**
     *
     * 更新用户当前登录VDC。
     *
代码示例:

     *     ModifyUserLoginVdcResp resp = instance.modify("11","6");
     *

     * @param userId 【必选】用户ID。
     * @param vdcId 【必选】VDC ID。
     * @return {@code ModifyUserLoginVdcResp} 更新用户当前登录VDC返回信息。
     * @since eSDK Cloud V100R003C30
     */
    public ModifyUserLoginVdcResp modify(String userId, String vdcId);

}


text:
class Message < ApplicationRecord
  belongs_to :talk
  belongs_to :user

  validates_presence_of :talk, :body, :user
end


text:
ObstacleBehaviour::ObstacleBehaviour() { }

ObstacleBehaviour::~ObstacleBehaviour() { }

void ObstacleBehaviour::update()
{
	checkDelete();
}

void ObstacleBehaviour::checkDelete()
{
	Rect geometry = _gameObject->spritePosition();

	// Delete if we're above the camera.
	if(geometry.y + geometry.h < Game::instance()->camera()->geometry().y)
		_gameObject->setDeleteFlag(true);
}


text:
package net.wouto.modelsync.postgresql;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;

public class PostgreSQLConnection {

    private Connection dbConnection;
    private String host;
    private String database;
    private String username;
    private String password;
    private int port;

    public PostgreSQLConnection(String host, int port) {
        this.host = host;
        this.port = port;
        this.dbConnection = null;
    }

    public PostgreSQLConnection(String host, int port, String database) {
        this(host, port);
        this.database = database;
    }

    public void setAuthentication(String username, String password) {
        this.username = username;
        this.password = password;
    }

    public void setPort(int port) {
        this.port = port;
    }

    public int getPort() {
        return this.port;
    }

    public void connect() {
        try {
            String conStr = "jdbc:postgresql://" + host + ":" + port + "/" + (database == null ? "" : database);

            Class.forName("org.postgresql.Driver");
            String username = (this.username == null ? "" : this.username);
            String password = (this.password == null ? "" : this.password);
            dbConnection = DriverManager.getConnection(conStr, username, password);
        } catch (ClassNotFoundException | SQLException ex) {
            dbConnection = null;
            Logger.getLogger(PostgreSQLConnection.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    public void disconnect() {
        if (this.dbConnection != null) {
            try {
                this.dbConnection.close();
            } catch (SQLException ex) {
                Logger.getLogger(PostgreSQLConnection.class.getName()).log(Level.SEVERE, null, ex);
            }
            this.dbConnection = null;
        }
    }

    public boolean isConnected() {
        if (this.dbConnection == null) {
            return false;
        }
        try {
            if (this.dbConnection.isClosed()) {
                return false;
            }
        } catch (SQLException ex) {
            Logger.getLogger(PostgreSQLConnection.class.getName()).log(Level.SEVERE, null, ex);
        }
        try {
            return this.dbConnection.isValid(1);
        } catch (SQLException ex) {
            Logger.getLogger(PostgreSQLConnection.class.getName()).log(Level.SEVERE, null, ex);
        }
        return false;
    }

    public Connection getConnection() {
        return this.dbConnection;
    }

}


text:
module.exports = exports = function (app) {
    var request = app.utils.request;
    var log = app.utils.log;
    var formatPeriod = app.utils.formatPeriod;
    var b = app.bold;
    var f = app.format;
    function redditSearch(opt, callback) {
        var sortpat = new RegExp("sort:([A-Za-z]+)")
        var sort = 'relevance';
        if (sortpat.test(opt.cmd.join(' '))) {
            opt.cmd.join(' ').replace(sortpat, function (a, b) {
                opt.cmd.splice(opt.cmd.indexOf(a), 1);
                sort = b;
                return '';
            })
        }
        request({
            uri: "http://www.reddit.com/search.json?limit=1&sort="+sort+"&q="+encodeURI(opt.cmd.join('+')),
        }, function(error, response, body) {
            if (!error && response.statusCode == 200) {
                var res = JSON.parse(body);
                if (!res.data) {return;}
                if (res.data.children.length > 0) {
                  var item = res.data.children[0].data;
                  callback(opt.to, "http://redd.it/"+item.id+" /r/"+item.subreddit+" "+b(item.title));
                }
            }
        });
    }
    app.cmdRegister('reddit', { "f": redditSearch,
        "h": "Searches reddit and returns the first result.",
    });
    function redditPreview(link, opt, callback) {
        var url;
        var type = "none";
        var subredditpat = new RegExp("reddit.com/r/([A-Za-z0-9]+)/?$");
        if (subredditpat.test(link)) { url = "http://www.reddit.com/r/"+link.match(subredditpat)[1]+"/about.json"; type = "subreddit";}
        var commentspat = new RegExp("reddit.com/r/([A-Za-z0-9]+)/comments/([^/]+)/?.*");
        if (commentspat.test(link)) { url = link+(link.slice(-1)=="/"?"":"/")+"about.json"; type = "comments";}
        var userpat = new RegExp("reddit.com/u(ser)?/([A-Za-z0-9]+)/?$");
        if (userpat.test(link)) { url = link+(link.slice(-1)=="/"?"":"/")+"about.json"; type = "user";}
        request({
          uri: url,
        }, function(error, response, body) {
            if (!error && response.statusCode == 200) {
                var res = JSON.parse(body);
                var title;
                if(type == "subreddit") {
                    var data = res.data;
                    title = data.title;
                    var nsfw = data.over18;
                    var des = data.public_description;
                    var subscribers = data.subscribers;
                    var created = new Date().getTime() - data.created*1000;
                    callback(opt.to, "[Subreddit] "+title+" | "+(nsfw?f("light_red","NSFW "):"")+subscribers+" subscribers | "+des+" | subreddit for "+formatPeriod(created));
                }
                else if(type == "comments") {
                    var data = res[0].data.children[0].data;
                    title = data.title;
                    var nsfw = data.over_18;
                    var author = data.author;
                    var created = new Date().getTime() - data.created*1000;
                    callback(opt.to, "[reddit] "+title+" | "
                        +(nsfw?f("light_red","NSFW "):"")
                        +"/u/"+author+" | ↑"
                        +data.ups+" ("+data.upvote_ratio*100+"%)"
                        +" | submitted "+formatPeriod(created)+" ago");
                }
                else if(type == "user") {
                    var data = res.data;
                    var name = data.name;
                    var created = new Date().getTime() - data.created*1000;
                    title = name;
                    callback(opt.to, "[reddit] /u/"+name+" ("+data.link_karma+"|"+data.comment_karma+") redditor for "+formatPeriod(created));
                }
                opt.col.insert({link: link, title: (title?title:undefined), from: opt.from, time: new Date()});
                opt.col.save();
            }
            else { opt.genericPreview(link, opt, callback); };
        });
    }
    app.plugins('link-preview', {
        re: new RegExp("reddit.com"),
        f: redditPreview
    })
}


text:
package com.seaglasslookandfeel.component;

import java.awt.Dimension;
import java.awt.Graphics;

import javax.swing.AbstractButton;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JComponent;
import javax.swing.SwingConstants;
import javax.swing.plaf.UIResource;

import com.seaglasslookandfeel.SeaGlassContext;
import com.seaglasslookandfeel.SeaGlassStyle;
import com.seaglasslookandfeel.ui.SeaGlassButtonUI;

/**
 * JButton object that draws a scaled Arrow in one of the cardinal directions.
 *
 *
Based on SynthArrowButton by Scott Violet.

 *
 * @see javax.swing.plaf.synth.SynthArrowButton
 */
public class SeaGlassArrowButton extends JButton implements SwingConstants, UIResource {
    private static final long serialVersionUID = 2673388860074501956L;
    private int               direction;

    /**
     * Creates a new SeaGlassArrowButton object.
     *
     * @param direction the direction to point the arrow. This will be one of
     *                  the SwingConstants {@code NORTH}, {@code WEST},
     *                  {@code SOUTH}, or {@code EAST}.
     */
    public SeaGlassArrowButton(int direction) {
        super();
        super.setFocusable(false);
        setDirection(direction);
        setDefaultCapable(false);
    }

    /**
     * @see javax.swing.JButton#getUIClassID()
     */
    public String getUIClassID() {
        return "ArrowButtonUI";
    }

    /**
     * @see javax.swing.JButton#updateUI()
     */
    public void updateUI() {
        setUI(new SeaGlassArrowButtonUI());
    }

    /**
     * Set the arrow's direction.
     *
     * @param dir the direction to point the arrow. This will be one of the
     *            SwingConstants {@code NORTH}, {@code WEST}, {@code SOUTH}, or
     *            {@code EAST}.
     */
    public void setDirection(int dir) {
        direction = dir;
        putClientProperty("__arrow_direction__", new Integer(dir));
        repaint();
    }

    /**
     * Get the direction of the arrow.
     *
     * @return the direction the arrow points. This will be one of the
     *         SwingConstants {@code NORTH}, {@code WEST}, {@code SOUTH}, or
     *         {@code EAST}.
     */
    public int getDirection() {
        return direction;
    }

    /**
     * @see java.awt.Component#setFocusable(boolean)
     */
    public void setFocusable(boolean focusable) {
    }

    /**
     * The UI delegate for the arrow button.
     */
    private static class SeaGlassArrowButtonUI extends SeaGlassButtonUI {

        /**
         * @see com.seaglasslookandfeel.ui.SeaGlassButtonUI#installDefaults(javax.swing.AbstractButton)
         */
        protected void installDefaults(AbstractButton b) {
            super.installDefaults(b);
            updateStyle(b);
        }

        /**
         * @see com.seaglasslookandfeel.ui.SeaGlassButtonUI#paint(com.seaglasslookandfeel.SeaGlassContext,
         *      java.awt.Graphics)
         */
        protected void paint(SeaGlassContext context, Graphics g) {
            SeaGlassArrowButton button = (SeaGlassArrowButton) context.getComponent();

            Double scale = (Double)button.getClientProperty("__arrow_scale__");
            if (scale == null) {
                scale = 1.0;
            }
            int width = (int) (button.getWidth()*scale);
            int height = (int) (button.getHeight()*scale);
            int x = (button.getWidth()-width)/2 * (button.getDirection() == SwingConstants.EAST?-1:1);
            int y = (button.getHeight()-height)/2 * (button.getDirection() == SwingConstants.SOUTH ?-1:1);

            context.getPainter().paintArrowButtonForeground(context, g, x, y, width, height,
                                                            button.getDirection());
        }

        /**
         * Paint the arrow background.
         *
         * @param context the SynthContext.
         * @param g       the Graphics context.
         * @param c       the arrow component.
         */
        @SuppressWarnings("all")
        void paintBackground(SeaGlassContext context, Graphics g, JComponent c) {
            context.getPainter().paintArrowButtonBackground(context, g, 0, 0, c.getWidth(), c.getHeight());
        }

        /**
         * Paint the arrow border.
         *
         * @param context the SynthContext.
         * @param g       the Graphics context.
         * @param x       the x coordinate corresponding to the upper-left
         *                corner to paint.
         * @param y       the y coordinate corresponding to the upper-left
         *                corner to paint.
         * @param w       the width to paint.
         * @param h       the height to paint.
         */
        @SuppressWarnings("unused")
        public void paintBorder(SeaGlassContext context, Graphics g, int x, int y, int w, int h) {
            context.getPainter().paintArrowButtonBorder(context, g, x, y, w, h);
        }

        /**
         * Get the minimum size for the arrow.
         *
         * @return the minimum size.
         */
        @SuppressWarnings("unused")
        public Dimension getMinimumSize() {
            return new Dimension(5, 5);
        }

        /**
         * Get the maximum size for the arrow.
         *
         * @return the maximum size.
         */
        @SuppressWarnings("unused")
        public Dimension getMaximumSize() {
            return new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE);
        }

        /**
         * @see com.seaglasslookandfeel.ui.SeaGlassButtonUI#getPreferredSize(javax.swing.JComponent)
         */
        public Dimension getPreferredSize(JComponent c) {
            SeaGlassContext context = getContext(c);
            Dimension       dim     = null;

            if (context.getComponent().getName() == "ScrollBar.button") {

                // ScrollBar arrow buttons can be non-square when
                // the ScrollBar.squareButtons property is set to FALSE
                // and the ScrollBar.buttonSize property is non-null
                dim = (Dimension) context.getStyle().get(context, "ScrollBar.buttonSize");
            }

            if (dim == null) {

                // For all other cases (including Spinner, ComboBox), we will
                // fall back on the single ArrowButton.size value to create
                // a square return value
                int size = context.getStyle().getInt(context, "ArrowButton.size", 16);

                dim = new Dimension(size, size);
            }

            // handle scaling for sizeVarients for special case components. The
            // key "JComponent.sizeVariant" scales for large/small/mini
            // components are based on Apples LAF
            JComponent parent = (JComponent) context.getComponent().getParent();

            if (parent != null && !(parent instanceof JComboBox)) {
                String scaleKey = SeaGlassStyle.getSizeVariant(parent);
                if (scaleKey != null) {
                    if (SeaGlassStyle.LARGE_KEY.equals(scaleKey)) {
                        dim = new Dimension((int) (dim.width * 1.15), (int) (dim.height * 1.15));
                    } else if (SeaGlassStyle.SMALL_KEY.equals(scaleKey)) {
                        dim = new Dimension((int) (dim.width * 0.857), (int) (dim.height * 0.857));
                    } else if (SeaGlassStyle.MINI_KEY.equals(scaleKey)) {
                        dim = new Dimension((int) (dim.width * 0.714), (int) (dim.height * 0.714));
                    }
                }
            }

            context.dispose();

            return dim;
        }
    }
}


text:
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>{{ site.shortTitle }}{% if page.title %} | {{ page.title }}{% endif %}</title>
    <meta name="viewport" content="width=device-width">
    <meta name="description" content="{{ site.description }}">
    <link rel="canonical" href="{{ page.url | replace:'index.html','' | prepend: site.baseurl | prepend: site.url }}">
    <link href="//cdn-images.mailchimp.com/embedcode/slim-081711.css" rel="stylesheet" type="text/css">
    <meta property="og:locale" content="en_US" />
    <meta property="og:type" content="website" />
    <meta property="og:title" content="{{ site.description }}" />
    <meta property="og:url" content="{{ site.url }}" />
    <meta property="og:site_name" content="{{ site.title }}" />
    <meta property="fb:admins" content="" />
    <meta property="og:image" content="{{ site.baseurl }}/{{ site.favicon }}" />
    <meta name="twitter:card" content="{{ site.description }}" />
    <meta name="twitter:site" content="@{{ site.twitter-username }}" />
    <meta name="twitter:domain" content="{{ site.title }}" />
    <meta name="twitter:creator" content="@{{ site.twitter-username }}" />

    <link rel="shortcut icon" href="{{ site.baseurl }}{{ site.favicon }}">

    {% include structure/ie.html %}

    <!-- css -->
    <link rel="stylesheet" href="{{ site.baseurl }}/assets/vendors/bootstrap/dist/css/bootstrap.min.css">
    <link rel="stylesheet" href="{{ site.baseurl }}/assets/vendors/fontawesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="{{ site.baseurl }}/assets/css/custom.min.css"> {% if page.searchable == 'true' %}
    <link rel="stylesheet" href="{{ site.baseurl }}/assets/css/video.min.css"> {% endif %}
</head>


text:
class Tag
  include DataMapper::Resource

  property  :id,          Serial
  property  :name,        String, length: 255,
    required: true,
    messages: {
      presence: 'You must provide a name for the tag!'
    }

  property  :created_at,  DateTime, default: lambda { |*_| DateTime.now }

  belongs_to  :user, required: true

  has n, :tasks, :through => Resource, :constraint => :skip

  validates_uniqueness_of :name, :scope => [ :user_id ],
    message: 'You already have such a tag!'

  before :destroy do
    TagTask.all({ tag_id: self.id }).destroy
  end

  def time_spent
    duration = 0
    self.tasks.each do |t|
      duration += t.time_spent
    end
    duration
  end
end


text:
                    Current Taskers

                        {{ currentTaskers.status }}

                <button ng-click="currentTaskers.changeStatus('accepted')" class="btn btn-xs btn-success" ng-class="{ active: (currentTaskers.isActiveStatus('ACCEPTED')) }">Accepted </button>
                <button ng-click="currentTaskers.changeStatus('pending')" class="btn btn-xs btn-warning" ng-class="{ active: (currentTaskers.isActiveStatus('PENDING')) }">Pending </button>
                <button ng-click="currentTaskers.changeStatus('rejected')" class="btn btn-xs btn-danger" ng-class="{ active: (currentTaskers.isActiveStatus('REJECTED')) }">Rejected </button>

        <tf-empty tf-message="'No ' + currentTaskers.status + ' taskers were found'" tf-show="currentTaskers.showEmpty"></tf-empty>

{{ item.job.name }}

{{ item.tasker.firstName }} {{ item.tasker.lastName }}

{{ item.tasker.metadata.profession }}

{{ item.job.metadata.payment.value }} {{ item.job.metadata.payment.currency.name }} / Hour

                Start Date:
                <tf-date tf-date-expression="item.job.startDate"></tf-date>
                End Date:
                <tf-date tf-date-expression="item.job.finishDate"></tf-date>

            <button ng-click="currentTaskers.viewProfile(item.tasker.id)" class="btn btn-block btn-sm btn-primary">View Profile</button>

        <tf-paginator tf-current="currentTaskers.currentPage" tf-max-page="currentTaskers.pages" tf-on-change="currentTaskers.onPageChange"></tf-paginator>


text:
var fs = require('fs');
var shell = require('shelljs');
var yaml = require('yaml-js');
var grunt = require('grunt');
var spawn = require('child_process').spawn;

module.exports = {

  init: function() {
    shell.exec('npm install');
  },

  getVersion: function(){
    var versionYaml = yaml.load(fs.readFileSync('version.yaml', 'UTF-8'));
    var match = versionYaml.version.match(/^([^\-]*)(-snapshot)?$/);
    var semver = match[1].split('.');
    var hash = shell.exec('git rev-parse --short HEAD', {silent: true}).output.replace('\n', '');

    var version = {
      full: (match[1] + (match[2] ? '-' + hash : '')),
      major: semver[0],
      minor: semver[1],
      dot: semver[2],
      codename: versionYaml.codename,
      stable: versionYaml.stable
    };

    return version;
  },

  startKarma: function(config, singleRun, done){
    var browsers = grunt.option('browsers');
    var reporters = grunt.option('reporters');
    var noColor = grunt.option('no-colors');
    var p = spawn('node', ['node_modules/karma/bin/karma', 'start', config,
      singleRun ? '--single-run=true' : '',
      reporters ? '--reporters=' + reporters : '',
      browsers ? '--browsers=' + browsers : '',
      noColor ? '--no-colors' : ''
    ]);
    p.stdout.pipe(process.stdout);
    p.stderr.pipe(process.stderr);
    p.on('exit', function(code){
      if(code !== 0) grunt.fail.warn("Test(s) failed");
      done();
    });
  },

  wrap: function(src, name){
    src.unshift('src/' + name + '.prefix');
    src.push('src/' + name + '.suffix');
    return src;
  },

  addStyle: function(src, styles, minify){
    styles = styles.map(processCSS.bind(this)).join('\n');
    src += styles;
    return src;

    function processCSS(file){
      var css = fs.readFileSync(file).toString();
      if(minify){
        css = css
          .replace(/\n/g, '')
          .replace(/\/\*.*?\*\//g, '')
          .replace(/:\s+/g, ':')
          .replace(/\s*\{\s*/g, '{')
          .replace(/\s*\}\s*/g, '}')
          .replace(/\s*\,\s*/g, ',')
          .replace(/\s*\;\s*/g, ';');
      }
      //espace for js
      css = css
        .replace(/\\/g, '\\\\')
        .replace(/'/g, "\\'")
        .replace(/\n/g, '\\n');
      return "angular.element(document).find('head').append('<style type=\"text/css\">" + css + "</style>');";
    }
  },

  process: function(src, NG_VERSION, strict){
    var processed = src
      .replace(/"NG_VERSION_FULL"/g, NG_VERSION.full)
      .replace(/"NG_VERSION_MAJOR"/, NG_VERSION.major)
      .replace(/"NG_VERSION_MINOR"/, NG_VERSION.minor)
      .replace(/"NG_VERSION_DOT"/, NG_VERSION.dot)
      .replace(/"NG_VERSION_STABLE"/, NG_VERSION.stable)
      .replace(/"NG_VERSION_CODENAME"/, NG_VERSION.codename);
    if (strict !== false) processed = this.singleStrict(processed, '\n\n', true);
    return processed;
  },

  build: function(config, fn){
    var files = grunt.file.expand(config.src);
    var styles = config.styles;
    //concat
    var src = files.map(function(filepath){
      return grunt.file.read(filepath);
    }).join(grunt.util.normalizelf('\n'));
    //process
    var processed = this.process(src, grunt.config('NG_VERSION'), config.strict);
    if (styles) processed = this.addStyle(processed, styles.css, styles.minify);
    //write
    grunt.file.write(config.dest, processed);
    grunt.log.ok('File ' + config.dest + ' created.');
    fn();
  },

  singleStrict: function(src, insert, newline){
    var useStrict = newline ? "$1\n'use strict';" : "$1'use strict';";
    return src
      .replace(/\s*("|')use strict("|');\s*/g, insert) // remove all file-specific strict mode flags
      .replace(/(\(function\([^)]*\)\s*\{)/, useStrict); // add single strict mode flag
  },

  min: function(file, done) {
    var minFile = file.replace(/\.js$/, '.min.js');
    shell.exec(
        'java ' +
            this.java32flags() + ' ' +
            '-jar lib/closure-compiler/compiler.jar ' +
            '--compilation_level SIMPLE_OPTIMIZATIONS ' +
            '--language_in ECMASCRIPT5_STRICT ' +
            '--js ' + file + ' ' +
            '--js_output_file ' + minFile,
      function(code) {
        if (code !== 0) grunt.fail.warn('Error minifying ' + file);
        grunt.file.write(minFile, this.singleStrict(grunt.file.read(minFile), '\n'));
        grunt.log.ok(file + ' minified into ' + minFile);
        done();
    }.bind(this));
  },

  //returns the 32-bit mode force flags for java compiler if supported, this makes the build much faster
  java32flags: function(){
    if (process.platform === "win32") return '';
    if (shell.exec('java -version -d32 2>&1', {silent: true}).code !== 0) return '';
    return ' -d32 -client';
  },

  //csp connect middleware
  csp: function(){
    return function(req, res, next){
      res.setHeader("X-WebKit-CSP", "default-src 'self';");
      res.setHeader("X-Content-Security-Policy", "default-src 'self'");
      next();
    };
  },

  //rewrite connect middleware
  rewrite: function(){
    return function(req, res, next){
      var REWRITE = /\/(guide|api|cookbook|misc|tutorial).*$/,
          IGNORED = /(\.(css|js|png|jpg)$|partials\/.*\.html$)/,
          match;

      if (!IGNORED.test(req.url) && (match = req.url.match(REWRITE))) {
        console.log('rewriting', req.url);
        req.url = req.url.replace(match[0], '/index.html');
      }
      next();
    };
  }
};


text:
from django.dispatch import Signal

user_accept_consent = Signal(providing_args=['user', 'client', 'scope'])
user_decline_consent = Signal(providing_args=['user', 'client', 'scope'])


text:
package main

import (
	"sample"
	"fmt"
)

const (
	NSTitledWindowMask = 1 << 0
	NSBackingStoreBuffered = 2
)

func main() {
    app := sample.NSApplication_sharedApplication()
    //app.SetActivationPolicy(sample.NSApplicationActivationPolicyRegular)
	win := sample.NSWindow_initWithContentRectStyleMaskBackingDefer(sample.NSRect{0,0, 200,200}, NSTitledWindowMask, NSBackingStoreBuffered, false)
    win.CascadeTopLeftFromPoint(sample.NSPoint{20,20})
    win.SetTitle(sample.NSString_initWithUTF8String("SomeApp"))
    win.MakeKeyAndOrderFront(nil)
    app.ActivateIgnoringOtherApps(true)

	fmt.Println(app, win)
	fmt.Println(app.GetClassName(), win.GetClassName())

	app.Run();
}


text:
export interface Schema {
  project: string;
}


text:
"""Ganeti exception handling.

"""

from ganeti import constants

ECODE_RESOLVER = constants.ERRORS_ECODE_RESOLVER
ECODE_NORES = constants.ERRORS_ECODE_NORES
ECODE_TEMP_NORES = constants.ERRORS_ECODE_TEMP_NORES
ECODE_INVAL = constants.ERRORS_ECODE_INVAL
ECODE_STATE = constants.ERRORS_ECODE_STATE
ECODE_NOENT = constants.ERRORS_ECODE_NOENT
ECODE_EXISTS = constants.ERRORS_ECODE_EXISTS
ECODE_NOTUNIQUE = constants.ERRORS_ECODE_NOTUNIQUE
ECODE_FAULT = constants.ERRORS_ECODE_FAULT
ECODE_ENVIRON = constants.ERRORS_ECODE_ENVIRON
ECODE_ALL = constants.ERRORS_ECODE_ALL

class GenericError(Exception):
  """Base exception for Ganeti.

  """

class LockError(GenericError):
  """Lock error exception.

  This signifies problems in the locking subsystem.

  """

class PidFileLockError(LockError):
  """PID file is already locked by another process.

  """

class HypervisorError(GenericError):
  """Hypervisor-related exception.

  This is raised in case we can't communicate with the hypervisor
  properly.

  """

class HotplugError(HypervisorError):
  """Hotplug-related exception.

  This is raised in case a hotplug action fails or is not supported.
  It is currently used only by KVM hypervisor.

  """

class ProgrammerError(GenericError):
  """Programming-related error.

  This is raised in cases we determine that the calling conventions
  have been violated, meaning we got some desynchronisation between
  parts of our code. It signifies a real programming bug.

  """

class BlockDeviceError(GenericError):
  """Block-device related exception.

  This is raised in case we can't setup the instance's block devices
  properly.

  """

class ConfigurationError(GenericError):
  """Configuration related exception.

  Things like having an instance with a primary node that doesn't
  exist in the config or such raise this exception.

  """

class ConfigVersionMismatch(ConfigurationError):
  """Version mismatch in the configuration file.

  The error has two arguments: the expected and the actual found
  version.

  """

class ConfigVerifyError(ConfigurationError):
  """Error reported by configuration verification

  The error has two arguments: the main error message and a list of errors
  found.

  """

class AddressPoolError(GenericError):
  """Errors related to IP address pools.

  """

class ReservationError(GenericError):
  """Errors reserving a resource.

  """

class RemoteError(GenericError):
  """Programming-related error on remote call.

  This is raised when an unhandled error occurs in a call to a
  remote node.  It usually signifies a real programming bug.

  """

class SignatureError(GenericError):
  """Error authenticating a remote message.

  This is raised when the hmac signature on a message doesn't verify correctly
  to the message itself. It can happen because of network unreliability or
  because of spurious traffic.

  """

class ParameterError(GenericError):
  """A passed parameter to a command is invalid.

  This is raised when the parameter passed to a request function is
  invalid. Correct code should have verified this before passing the
  request structure.

  The argument to this exception should be the parameter name.

  """

class ResultValidationError(GenericError):
  """The iallocation results fails validation.

  """

class OpPrereqError(GenericError):
  """Prerequisites for the OpCode are not fulfilled.

  This exception has two arguments: an error message, and one of the
  ECODE_* codes.

  """

class OpExecError(GenericError):
  """Error during OpCode execution.

  """

class OpResultError(GenericError):
  """Issue with OpCode result.

  """

class OpRetryNotSupportedError(GenericError):
  """This opcode does not support retries

  """

class DeviceCreationError(GenericError):
  """Error during the creation of a device.

  This exception should contain the list of the devices actually created
  up to now, in the form of pairs (node, device)

  """
  def __init__(self, message, created_devices):
    GenericError.__init__(self)
    self.message = message
    self.created_devices = created_devices

  def __str__(self):
    return self.message

class OpCodeUnknown(GenericError):
  """Unknown opcode submitted.

  This signifies a mismatch between the definitions on the client and
  server side.

  """

class JobLost(GenericError):
  """Submitted job lost.

  The job was submitted but it cannot be found in the current job
  list.

  """

class JobCanceled(GenericError):
  """Submitted job was canceled.

  The job that was submitted has transitioned to a canceling or canceled
  state.

  """

class JobFileCorrupted(GenericError):
  """Job file could not be properly decoded/restored.

  """

class ResolverError(GenericError):
  """Host name cannot be resolved.

  This is not a normal situation for Ganeti, as we rely on having a
  working resolver.

  The non-resolvable hostname is available as the first element of the
  args tuple; the other two elements of the tuple are the first two
  args of the socket.gaierror exception (error code and description).

  """

class HooksFailure(GenericError):
  """A generic hook failure.

  This signifies usually a setup misconfiguration.

  """

class HooksAbort(HooksFailure):
  """A required hook has failed.

  This caused an abort of the operation in the initial phase. This
  exception always has an attribute args which is a list of tuples of:
    - node: the source node on which this hooks has failed
    - script: the name of the script which aborted the run

  """

class UnitParseError(GenericError):
  """Unable to parse size unit.

  """

class ParseError(GenericError):
  """Generic parse error.

  Raised when unable to parse user input.

  """

class TypeEnforcementError(GenericError):
  """Unable to enforce data type.

  """

class X509CertError(GenericError):
  """Invalid X509 certificate.

  This error has two arguments: the certificate filename and the error cause.

  """

class TagError(GenericError):
  """Generic tag error.

  The argument to this exception will show the exact error.

  """

class CommandError(GenericError):
  """External command error.

  """

class StorageError(GenericError):
  """Storage-related exception.

  """

class InotifyError(GenericError):
  """Error raised when there is a failure setting up an inotify watcher.

  """

class QuitGanetiException(Exception):
  """Signal Ganeti that it must quit.

  This is not necessarily an error (and thus not a subclass of
  GenericError), but it's an exceptional circumstance and it is thus
  treated. This exception should be instantiated with two values. The
  first one will specify the return code to the caller, and the second
  one will be the returned result (either as an error or as a normal
  result). Usually only the leave cluster rpc call should return
  status True (as there it's expected we quit), every other call will
  return status False (as a critical error was encountered).

  Examples::

    # Return a result of "True" to the caller, but quit ganeti afterwards
    raise QuitGanetiException(True, None)
    # Send an error to the caller, and quit ganeti
    raise QuitGanetiException(False, "Fatal safety violation, shutting down")

  """

class JobQueueError(GenericError):
  """Job queue error.

  """

class JobQueueDrainError(JobQueueError):
  """Job queue is marked for drain error.

  This is raised when a job submission attempt is made but the queue
  is marked for drain.

  """

class JobQueueFull(JobQueueError):
  """Job queue full error.

  Raised when job queue size reached its hard limit.

  """

class ConfdMagicError(GenericError):
  """A magic fourcc error in Ganeti confd.

  Errors processing the fourcc in ganeti confd datagrams.

  """

class ConfdClientError(GenericError):
  """A magic fourcc error in Ganeti confd.

  Errors in the confd client library.

  """

class UdpDataSizeError(GenericError):
  """UDP payload too big.

  """

class NoCtypesError(GenericError):
  """python ctypes module is not found in the system.

  """

class IPAddressError(GenericError):
  """Generic IP address error.

  """

class LuxiError(GenericError):
  """LUXI error.

  """

class QueryFilterParseError(ParseError):
  """Error while parsing query filter.

  This exception must be instantiated with two values. The first one is a
  string with an error description, the second one is an instance of a subclass
  of C{pyparsing.ParseBaseException} (used to display the exact error
  location).

  """
  def GetDetails(self):
    """Returns a list of strings with details about the error.

    """
    try:
      (_, inner) = self.args
    except IndexError:
      return None

    return [str(inner.line),
            (" " * (inner.column - 1)) + "^",
            str(inner)]

class RapiTestResult(GenericError):
  """Exception containing results from RAPI test utilities.

  """

class FileStoragePathError(GenericError):
  """Error from file storage path validation.

  """

class SshUpdateError(GenericError):
  """Error from updating the SSH setup.

  """

class PamRapiAuthError(GenericError):
  """Error in PAM remote API authenticator initialization.

  """

class JobSubmittedException(Exception):
  """Job was submitted, client should exit.

  This exception has one argument, the ID of the job that was
  submitted. The handler should print this ID.

  This is not an error, just a structured way to exit from clients.
  """

# errors should be added above

def GetErrorClass(name):
  """Return the class of an exception.

  Given the class name, return the class itself.

  @type name: str
  @param name: the exception name
  @rtype: class
  @return: the actual class, or None if not found

  """
  item = globals().get(name, None)
  if item is not None:
    if not (isinstance(item, type(Exception)) and
            issubclass(item, GenericError)):
      item = None
  return item

def EncodeException(err):
  """Encodes an exception into a format that L{MaybeRaise} will recognise.

  The passed L{err} argument will be formatted as a tuple (exception
  name, arguments) that the MaybeRaise function will recognise.

  @type err: GenericError child
  @param err: usually a child of GenericError (but any exception
      will be accepted)
  @rtype: tuple
  @return: tuple of (exception name, exception arguments)

  """
  return (err.__class__.__name__, err.args)

def GetEncodedError(result):
  """If this looks like an encoded Ganeti exception, return it.

  This function tries to parse the passed argument and if it looks
  like an encoding done by EncodeException, it will return the class
  object and arguments.

  """
  tlt = (tuple, list)
  if (isinstance(result, tlt) and len(result) == 2 and
      isinstance(result[1], tlt)):
    # custom ganeti errors
    errcls = GetErrorClass(result[0])
    if errcls:
      return (errcls, tuple(result[1]))

  return None

def MaybeRaise(result):
  """If this looks like an encoded Ganeti exception, raise it.

  This function tries to parse the passed argument and if it looks
  like an encoding done by EncodeException, it will re-raise it.

  """
  error = GetEncodedError(result)
  if error:
    (errcls, args) = error
    raise errcls(*args)


text:
<link href="<?php echo base_url('assets/css/multiple_image_upload.css')?>" rel="stylesheet">

<form action="#" id="form" class="form-horizontal">

Formulario de Ventas

                <input type="hidden" value="" name="id"/>

                        Cliente

                            <select id="cliente" name="cliente" class="form-control" data-bind="value:cliente">

                            </select>

                        Vendedor

                            <select id="vendedor" name="vendedor" class="form-control" data-bind="value:vendedor">

                            </select>

                        Lista

                            <select id="lista" name="lista" class="form-control" data-bind="value:lista">

                            <option value="1">AL COSTO</option>

                            <option value="2">REVENTA</option>

                            <option value="3" selected="selected">PUBLICO</option>

                            <option value="4">ML</option>

                            </select>

                        Metodo de pago

                            <select id="metodo" name="metodo" class="form-control" data-bind="value:metodo">

                            <option value="efectivo">EFECTIVO</option>

                            <option value="efectivo">MOTO</option>

                            <option value="efectivo">CUENTA CORRIENTE</option>

                            <option value="efectivo">MERCADO PAGO</option>

                            <option value="efectivo">BANCO</option>

                            </select>

                            <input  placeholder="Producto" data-bind="value:$root.newProductoNombre" id="newProductoNombre" class=" col-lg-4 col-lg-offset-1 ui-autocomplete-input form-control" autocomplete="off">
                            <select id="newProducto" name="marca" class="form-control stacked" data-bind="options: $root.productos,value:$root.newProducto,optionsText: 'nombre',optionsValue: 'id'">

                            </select>

                            <select id="newColor" name="marca" class="form-control" data-bind="options: $root.colores,value:$root.newColor,optionsText: 'name'">

                            </select>

                            <input type="button" value="Agregar renglon" class="btn-success" data-bind="enable:($root.productos().length>0), click:$root.createRenglon">

                            Producto

                            <input name="" data-bind="value: cantidad" class="inputCantidad">

                            <input name="" data-bind="value: precio" class="inputCantidad">

		    <button type="button" id="btnSave" onclick="save()" class="btn btn-primary">Guardar</button>

            <button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>

</form>


text:
package org.apache.ignite.mxbean;

import java.util.Map;
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.transactions.TransactionMetrics;

/**
 * Transactions MXBean interface.
 */
@MXBeanDescription("MBean that provides access to Ignite transactions.")
public interface TransactionMetricsMxBean extends TransactionMetrics {
    /**
     * All near transactions
     *
     * @return near transactions.
     */
    @MXBeanDescription("All near transactions.")
    @Override public Map<String, String> getAllOwnerTransactions();

    /**
     * Long running near transactions
     *
     * @return near transactions.
     */
    @MXBeanDescription("Long running near transactions.")
    @MXBeanParametersNames("duration")
    @MXBeanParametersDescriptions("Duration, at least (ms).")
    @Override public Map<String, String> getLongRunningOwnerTransactions(int duration);

    /**
     * The number of transactions which were committed.
     *
     * @return number of transactions which were committed.
     */
    @MXBeanDescription("The number of transactions which were committed.")
    @Override public long getTransactionsCommittedNumber();

    /**
     * The number of transactions which were rollback.
     *
     * @return number of transactions which were rollback.
     */
    @MXBeanDescription("The number of transactions which were rollback.")
    @Override public long getTransactionsRolledBackNumber();

    /**
     * The number of active transactions holding at least one key lock.
     *
     * @return number of active transactions holding at least one key lock.
     */
    @MXBeanDescription("The number of active transactions holding at least one key lock.")
    @Override public long getTransactionsHoldingLockNumber();

    /**
     *  The number of keys locked on the node.
     *
     * @return number of keys locked on the node.
     */
    @MXBeanDescription("The number of keys locked on the node.")
    @Override public long getLockedKeysNumber();

    /**
     * The number of active transactions for which this node is the initiator.
     *
     * @return number of active transactions for which this node is the initiator.
     */
    @MXBeanDescription("The number of active transactions for which this node is the initiator.")
    @Override public long getOwnerTransactionsNumber();
}


text:
cask 'umsatz' do
  version '8.1.1'
  sha256 '83d2e8d7283c9e41f5b31807b73e363d3b56f6949b2e1188a9fdefbe19b56de4'

  # moapp.software was verified as official when first introduced to the cask
  url 'https://download.moapp.software/Umsatz.zip'
  appcast 'https://sparkle.moapp.software/umsatz.xml'
  name 'Umsatz'
  homepage 'https://umsatz-programm.de/'

  app 'Umsatz.app'
end


text:
package org.springframework.cloud.dataflow.server.rest.documentation;

import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.notNullValue;
import static org.springframework.restdocs.headers.HeaderDocumentation.headerWithName;
import static org.springframework.restdocs.headers.HeaderDocumentation.responseHeaders;
import static org.springframework.restdocs.hypermedia.HypermediaDocumentation.linkWithRel;
import static org.springframework.restdocs.hypermedia.HypermediaDocumentation.links;
import static org.springframework.restdocs.payload.PayloadDocumentation.fieldWithPath;
import static org.springframework.restdocs.payload.PayloadDocumentation.responseFields;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;

import javax.servlet.RequestDispatcher;

import org.junit.Test;

import org.springframework.cloud.dataflow.rest.Version;

/**
 * @author Gunnar Hillert
 */
public class ApiDocumentation extends BaseDocumentation {

	@Test
	public void headers() throws Exception {
		this.mockMvc
			.perform(get("/"))
			.andExpect(status().isOk())
			.andDo(this.documentationHandler.document(
				responseHeaders(
					headerWithName("Content-Type").description("The Content-Type of the payload, e.g. `application/hal+json`"))));
	}

	@Test
	public void errors() throws Exception {
		this.mockMvc
			.perform(get("/error")
				.requestAttr(RequestDispatcher.ERROR_STATUS_CODE, 400)
				.requestAttr(RequestDispatcher.ERROR_REQUEST_URI, "/apps")
				.requestAttr(RequestDispatcher.ERROR_MESSAGE, "The app 'http://localhost:8080/apps/123' does not exist"))
			.andExpect(status().isBadRequest())
			.andExpect(jsonPath("error", is("Bad Request")))
			.andExpect(jsonPath("timestamp", is(notNullValue())))
			.andExpect(jsonPath("status", is(400)))
			.andExpect(jsonPath("path", is(notNullValue())))
			.andDo(this.documentationHandler.document(
				responseFields(
					fieldWithPath("error").description("The HTTP error that occurred, e.g. `Bad Request`"),
					fieldWithPath("message").description("A description of the cause of the error"),
					fieldWithPath("path").description("The path to which the request was made"),
					fieldWithPath("status").description("The HTTP status code, e.g. `400`"),
					fieldWithPath("timestamp").description("The time, in milliseconds, at which the error occurred"))));
	}

	@Test
	public void index() throws Exception {
		this.mockMvc.perform(get("/"))
			.andExpect(status().isOk())
			.andDo(this.documentationHandler.document(
				links(
					linkWithRel("about").description("Access meta information, including enabled features, security info, version information"),
					linkWithRel("dashboard").description("Access the dashboard UI"),
					linkWithRel("apps").description("Handle registered applications"),
					linkWithRel("completions/stream").description("Exposes the DSL completion features for Stream"),
					linkWithRel("completions/task").description("Exposes the DSL completion features for Task"),
					linkWithRel("metrics/streams").description("Exposes metrics for the stream applications"),
					linkWithRel("jobs/executions").description("Provides the JobExecution resource"),
					linkWithRel("jobs/executions/execution").description("Provides details for a specific JobExecution"),
					linkWithRel("jobs/executions/execution/steps").description("Provides the steps for a JobExecution"),
					linkWithRel("jobs/executions/execution/steps/step").description("Returns the details for a specific step"),
					linkWithRel("jobs/executions/execution/steps/step/progress").description("Provides progress information for a specific step"),
					linkWithRel("jobs/executions/name").description("Retrieve Job Executions by Job name"),
					linkWithRel("jobs/instances/instance").description("Provides the job instance resource for a specific job instance"),
					linkWithRel("jobs/instances/name").description("Provides the Job instance resource for a specific job name"),
					linkWithRel("runtime/apps").description("Provides the runtime application resource"),
					linkWithRel("runtime/apps/app").description("Exposes the runtime status for a specific app"),
					linkWithRel("runtime/apps/instances").description("Provides the status for app instances"),
					linkWithRel("tasks/definitions").description("Provides the task definition resource"),
					linkWithRel("tasks/definitions/definition").description("Provides details for a specific task definition"),
					linkWithRel("tasks/executions").description("Returns Task executions and allows lanching of tasks"),
					linkWithRel("tasks/executions/name").description("Returns all task executions for a given Task name"),
					linkWithRel("tasks/executions/execution").description("Provides details for a specific task execution"),
					linkWithRel("streams/definitions").description("Exposes the Streams resource"),
					linkWithRel("streams/definitions/definition").description("Handle a specific Stream definition"),
					linkWithRel("streams/deployments").description("Provides Stream deployment operations"),
					linkWithRel("streams/deployments/deployment").description("Request (un-)deployment of an existing stream definition"),
					linkWithRel("counters").description("Exposes the resource for dealing with Counters"),
					linkWithRel("counters/counter").description("Handle a specific counter"),
					linkWithRel("aggregate-counters").description("Provides the resource for dealing with aggregate counters"),
					linkWithRel("aggregate-counters/counter").description("Handle a specific aggregate counter"),
					linkWithRel("field-value-counters").description("Provides the resource for dealing with field-value-counters"),
					linkWithRel("field-value-counters/counter").description("Handle a specific field-value-counter"),
					linkWithRel("tools/parseTaskTextToGraph").description("Parse a task definition into a graph structure"),
					linkWithRel("tools/convertTaskGraphToText").description("Convert a graph format into DSL text format")),
				responseFields(
					fieldWithPath("_links").description("Links to other resources"),
					fieldWithPath("['"+Version.REVISION_KEY+"']").description("Incremented each time a change is implemented in this REST API")

				)
			));
	}
}


text:
class SuggestionsInternalsUI : public content::WebUIController {
 public:
  explicit SuggestionsInternalsUI(content::WebUI* contents);
  virtual ~SuggestionsInternalsUI();

 private:
  DISALLOW_COPY_AND_ASSIGN(SuggestionsInternalsUI);
};

#endif  // CHROME_BROWSER_UI_WEBUI_SUGGESTIONS_INTERNALS_SUGGESTIONS_INTERNALS_UI_H_


text:
using System;

namespace MEP
{
    class EppTestDirector
    {
        public void Construct(EppMessageBuilder builder)
        {
            builder.BuildHeader();
            builder.BuildId();
            builder.BuildDataLenght();
            builder.BuildData();
            builder.BuildChecksum();
        }
    }
}


text:
require File.expand_path(File.dirname(__FILE__) + '../../../spec_helper')

describe "helpers" do

  include Rack::Test::Methods

  def app
    Mercury
  end

  before(:all) do
    app.extend(Sinatra::MercuryHelpers)
  end

  it "should return js file" do
    app.render_script("Hello World", "javascript").should == "<script type='text/javascript'>\nHello World\n</script>\n"
  end

  it "should return style for all media" do
    app.render_style("Hello World").should == "<style type='text/css' media='all' >\nHello World\n</style>\n"
  end

end


text:
import urllib
import os
f = open('data/imgur_image_list.txt')
imageList = f.readlines()
f.close()
dir = "testImages/"
if not os.path.exists(dir):
    os.makedirs(dir)
for image in imageList:
	image = image.strip()
	slash = image.rfind('/')
	print image
	saveName = image[slash + 1:]
	print saveName
	urllib.urlretrieve(image, dir + saveName)


text:
#!/usr/bin/env node

import {init as logsinkInit} from './logsink'; // this import needs to come first since it sets up global npmlog
import logger from './logger'; // logger needs to remain second
// @ts-ignore
import {routeConfiguringFunction as makeRouter, server as baseServer} from '@appium/base-driver';
import {logger as logFactory, util, env} from '@appium/support';
import {asyncify} from 'asyncbox';
import _ from 'lodash';
import {AppiumDriver} from './appium';
import {runExtensionCommand} from './cli/extension';
import {getParser} from './cli/parser';
import {
  APPIUM_VER,
  checkNodeOk,
  getGitRev,
  getNonDefaultServerArgs,
  showConfig,
  showBuildInfo,
  validateTmpDir,
  warnNodeDeprecations,
  checkNpmOk,
} from './config';
import {readConfigFile} from './config-file';
import {loadExtensions, getActivePlugins, getActiveDrivers} from './extension';
import {DRIVER_TYPE, PLUGIN_TYPE, SERVER_SUBCOMMAND} from './constants';
import registerNode from './grid-register';
import {getDefaultsForSchema, validate} from './schema/schema';
import {inspect, adjustNodePath} from './utils';

const {resolveAppiumHome} = env;

/**
 *
 * @param {ParsedArgs} args
 * @param {boolean} [throwInsteadOfExit]
 */
async function preflightChecks(args, throwInsteadOfExit = false) {
  try {
    checkNodeOk();
    await checkNpmOk();
    if (args.longStacktrace) {
      require('longjohn').async_trace_limit = -1;
    }
    if (args.showBuildInfo) {
      await showBuildInfo();
      process.exit(0);
    }
    warnNodeDeprecations();

    validate(args);

    if (args.tmpDir) {
      await validateTmpDir(args.tmpDir);
    }
  } catch (err) {
    logger.error(err.message.red);
    if (throwInsteadOfExit) {
      throw err;
    }

    process.exit(1);
  }
}

/**
 * @param {Args} args
 */
function logNonDefaultArgsWarning(args) {
  logger.info('Non-default server args:');
  inspect(args);
}

/**
 * @param {Args['defaultCapabilities']} caps
 */
function logDefaultCapabilitiesWarning(caps) {
  logger.info(
    'Default capabilities, which will be added to each request ' +
      'unless overridden by desired capabilities:'
  );
  inspect(caps);
}

/**
 * @param {ParsedArgs} args
 */
async function logStartupInfo(args) {
  let welcome = `Welcome to Appium v${APPIUM_VER}`;
  let appiumRev = await getGitRev();
  if (appiumRev) {
    welcome += ` (REV ${appiumRev})`;
  }
  logger.info(welcome);

  let showArgs = getNonDefaultServerArgs(args);
  if (_.size(showArgs)) {
    logNonDefaultArgsWarning(showArgs);
  }
  if (!_.isEmpty(args.defaultCapabilities)) {
    logDefaultCapabilitiesWarning(args.defaultCapabilities);
  }
  // TODO: bring back loglevel reporting below once logger is flushed out
  // logger.info('Console LogLevel: ' + logger.transports.console.level);
  // if (logger.transports.file) {
  //   logger.info('File LogLevel: ' + logger.transports.file.level);
  // }
}

/**
 * Logs the address and port the server is listening on
 * @param {string} address - Address
 * @param {number} port - Port
 * @returns {void}
 */
function logServerPort(address, port) {
  let logMessage = `Appium REST http interface listener started on ` + `${address}:${port}`;
  logger.info(logMessage);
}

/**
 * Gets a list of `updateServer` functions from all extensions
 * @param {DriverNameMap} driverClasses
 * @param {PluginNameMap} pluginClasses
 * @returns {import('@appium/types').UpdateServerCallback[]}
 */
function getServerUpdaters(driverClasses, pluginClasses) {
  return _.compact(_.map([...driverClasses.keys(), ...pluginClasses.keys()], 'updateServer'));
}

/**
 * Makes a big `MethodMap` from all the little `MethodMap`s in the extensions
 * @param {DriverNameMap} driverClasses
 * @param {PluginNameMap} pluginClasses
 * @returns {import('@appium/types').MethodMap}
 */
function getExtraMethodMap(driverClasses, pluginClasses) {
  return [...driverClasses.keys(), ...pluginClasses.keys()].reduce(
    (map, klass) => ({
      ...map,
      ...(klass.newMethodMap ?? {}),
    }),
    {}
  );
}

/**
 * @template [T=WithServerSubcommand]
 * @param {Args<T>} args
 * @returns {args is Args<WithServerSubcommand>}
 */
function areServerCommandArgs(args) {
  return args.subcommand === SERVER_SUBCOMMAND;
}

/**
 * Initializes Appium, but does not start the server.
 *
 * Use this to get at the configuration schema.
 *
 * If `args` contains a non-empty `subcommand` which is not `server`, this function will return an empty object.
 *
 * @template [T=WithServerSubcommand]
 * @param {Args<T>} [args] - Partial args (progammatic usage only)
 * @returns {Promise<ServerInitResult | ExtCommandInitResult>}
 * @example
 * import {init, getSchema} from 'appium';
 * const options = {}; // config object
 * await init(options);
 * const schema = getSchema(); // entire config schema including plugins and drivers
 */
async function init(args) {
  const appiumHome = args?.appiumHome ?? (await resolveAppiumHome());

  adjustNodePath();

  const {driverConfig, pluginConfig} = await loadExtensions(appiumHome);

  const parser = getParser();
  let throwInsteadOfExit = false;
  /** @type {Args<T>} */
  let preConfigArgs;

  if (args) {
    // if we have a containing package instead of running as a CLI process,
    // that package might not appreciate us calling 'process.exit' willy-
    // nilly, so give it the option to have us throw instead of exit
    if (args.throwInsteadOfExit) {
      throwInsteadOfExit = true;
      // but remove it since it's not a real server arg per se
      delete args.throwInsteadOfExit;
    }
    preConfigArgs = {...args, subcommand: args.subcommand ?? SERVER_SUBCOMMAND};
  } else {
    // otherwise parse from CLI
    preConfigArgs = /** @type {Args<T>} */ (parser.parseArgs());
  }

  const configResult = await readConfigFile(preConfigArgs.configFile);

  if (!_.isEmpty(configResult.errors)) {
    throw new Error(
      `Errors in config file ${configResult.filepath}:\n ${
        configResult.reason ?? configResult.errors
      }`
    );
  }

  // merge config and apply defaults.
  // the order of precendece is:
  // 1. command line args
  // 2. config file
  // 3. defaults from config file.
  if (areServerCommandArgs(preConfigArgs)) {
    const defaults = getDefaultsForSchema(false);

    /** @type {ParsedArgs} */
    const serverArgs = _.defaultsDeep(preConfigArgs, configResult.config?.server, defaults);

    if (preConfigArgs.showConfig) {
      showConfig(getNonDefaultServerArgs(preConfigArgs), configResult, defaults, serverArgs);
      return {};
    }

    await logsinkInit(serverArgs);

    if (serverArgs.logFilters) {
      const {issues, rules} = await logFactory.loadSecureValuesPreprocessingRules(
        serverArgs.logFilters
      );
      if (!_.isEmpty(issues)) {
        throw new Error(
          `The log filtering rules config '${serverArgs.logFilters}' has issues: ` +
            JSON.stringify(issues, null, 2)
        );
      }
      if (_.isEmpty(rules)) {
        logger.warn(
          `Found no log filtering rules in '${serverArgs.logFilters}'. Is that expected?`
        );
      } else {
        logger.info(
          `Loaded ${util.pluralize('filtering rule', rules.length, true)} from '${
            serverArgs.logFilters
          }'`
        );
      }
    }

    const appiumDriver = new AppiumDriver(serverArgs);
    // set the config on the umbrella driver so it can match drivers to caps
    appiumDriver.driverConfig = driverConfig;
    await preflightChecks(serverArgs, throwInsteadOfExit);

    return /** @type {ServerInitResult} */ ({
      appiumDriver,
      parsedArgs: serverArgs,
      driverConfig,
      pluginConfig,
    });
  } else {
    const extensionCommandArgs = /** @type {Args<import('appium/types').WithExtSubcommand>} */ (
      preConfigArgs
    );
    // if the user has requested the 'driver' CLI, don't run the normal server,
    // but instead pass control to the driver CLI
    if (preConfigArgs.subcommand === DRIVER_TYPE) {
      await runExtensionCommand(extensionCommandArgs, driverConfig);
      return {};
    }
    if (preConfigArgs.subcommand === PLUGIN_TYPE) {
      await runExtensionCommand(extensionCommandArgs, pluginConfig);
      return {};
    }
    /* istanbul ignore next */
    return {}; // should never happen
  }
}

/**
 * Initializes Appium's config.  Starts server if appropriate and resolves the
 * server instance if so; otherwise resolves w/ `undefined`.
 * @template [T=WithServerSubcommand]
 * @param {Args<T>} [args] - Arguments from CLI or otherwise
 * @returns {Promise<import('@appium/types').AppiumServer|undefined>}
 */
async function main(args) {
  const {appiumDriver, parsedArgs, pluginConfig, driverConfig} = /** @type {ServerInitResult} */ (
    await init(args)
  );

  if (!appiumDriver || !parsedArgs || !pluginConfig || !driverConfig) {
    // if this branch is taken, we've run a different subcommand, so there's nothing
    // left to do here.
    return;
  }

  const pluginClasses = getActivePlugins(pluginConfig, parsedArgs.usePlugins);
  // set the active plugins on the umbrella driver so it can use them for commands
  appiumDriver.pluginClasses = pluginClasses;

  await logStartupInfo(parsedArgs);
  let routeConfiguringFunction = makeRouter(appiumDriver);

  const driverClasses = getActiveDrivers(driverConfig, parsedArgs.useDrivers);
  const serverUpdaters = getServerUpdaters(driverClasses, pluginClasses);
  const extraMethodMap = getExtraMethodMap(driverClasses, pluginClasses);

  /** @type {import('@appium/base-driver').ServerOpts} */
  const serverOpts = {
    routeConfiguringFunction,
    port: parsedArgs.port,
    hostname: parsedArgs.address,
    allowCors: parsedArgs.allowCors,
    basePath: parsedArgs.basePath,
    serverUpdaters,
    extraMethodMap,
    cliArgs: parsedArgs,
  };
  if (parsedArgs.keepAliveTimeout) {
    serverOpts.keepAliveTimeout = parsedArgs.keepAliveTimeout * 1000;
  }
  let server;
  try {
    server = await baseServer(serverOpts);
  } catch (err) {
    logger.error(
      `Could not configure Appium server. It's possible that a driver or plugin tried ` +
        `to update the server and failed. Original error: ${err.message}`
    );
    logger.debug(err.stack);
    return process.exit(1);
  }

  if (parsedArgs.allowCors) {
    logger.warn(
      'You have enabled CORS requests from any host. Be careful not ' +
        'to visit sites which could maliciously try to start Appium ' +
        'sessions on your machine'
    );
  }
  appiumDriver.server = server;
  try {
    // configure as node on grid, if necessary
    // falsy values should not cause this to run
    if (parsedArgs.nodeconfig) {
      await registerNode(
        parsedArgs.nodeconfig,
        parsedArgs.address,
        parsedArgs.port,
        parsedArgs.basePath
      );
    }
  } catch (err) {
    await server.close();
    throw err;
  }

  for (const signal of ['SIGINT', 'SIGTERM']) {
    process.once(signal, async function onSignal() {
      logger.info(`Received ${signal} - shutting down`);
      try {
        await appiumDriver.deleteAllSessions({
          force: true,
          reason: `The process has received ${signal} signal`,
        });
        await server.close();
        process.exit(0);
      } catch (e) {
        logger.warn(e);
        process.exit(1);
      }
    });
  }

  logServerPort(parsedArgs.address, parsedArgs.port);
  driverConfig.print();
  pluginConfig.print([...pluginClasses.values()]);

  return server;
}

// NOTE: this is here for backwards compat for any scripts referencing `main.js` directly
// (more specifically, `build/lib/main.js`)
// the executable is now `../index.js`, so that module will typically be `require.main`.
if (require.main === module) {
  asyncify(main);
}

// everything below here is intended to be a public API.
export {readConfigFile} from './config-file';
export {finalizeSchema, getSchema, validate} from './schema/schema';
export {main, init, resolveAppiumHome};

/**
 * @typedef {import('@appium/types').DriverType} DriverType
 * @typedef {import('@appium/types').PluginType} PluginType
 * @typedef {import('@appium/types').DriverClass} DriverClass
 * @typedef {import('@appium/types').PluginClass} PluginClass
 * @typedef {import('appium/types').WithServerSubcommand} WithServerSubcommand
 * @typedef {import('./extension').DriverNameMap} DriverNameMap
 * @typedef {import('./extension').PluginNameMap} PluginNameMap
 */

/**
 * Literally an empty object
 * @typedef { {} } ExtCommandInitResult
 */

/**
 * @typedef ServerInitData
 * @property {import('./appium').AppiumDriver} appiumDriver - The Appium driver
 * @property {import('appium/types').ParsedArgs} parsedArgs - The parsed arguments
 */

/**
 * @typedef {ServerInitData & import('./extension').ExtensionConfigs} ServerInitResult
 */

/**
 * @template [T=WithServerSubcommand]
 * @typedef {import('appium/types').Args<T>} Args
 */

/**
 * @template [T=WithServerSubcommand]
 * @typedef {import('appium/types').ParsedArgs<T>} ParsedArgs
 */


text:
( function(Dataflow) {

  // Dependencies
  var Base = Dataflow.prototype.node("base");
  var DataflowOutput = Dataflow.prototype.node("dataflow-output");

  DataflowOutput.Model = Base.Model.extend({
    defaults: {
      label: "",
      type: "dataflow-output",
      x: 200,
      y: 100,
      "output-type": "all"
    },
    initialize: function(){
      if (this.get("label")===""){
        this.set({label:"output"+this.id});
      }
      // super
      Base.Model.prototype.initialize.call(this);
    },
    inputdata: function (data) {
      // Forward data to parent graph
      this.get("parentNode").send(this.id, data);
    },
    toJSON: function(){
      var json = Base.Model.prototype.toJSON.call(this);
      json["output-type"] = this.get("output-type");
      return json;
    },
    inputs:[
      {
        id: "data",
        type: "all"
      }
    ],
    outputs:[
      // {
      //   id: "data",
      //   type: "all"
      // }
    ]
  });

  // DataflowOutput.View = Base.View.extend({
  // });

}(Dataflow) );


text:
namespace extensions {

// UDPSocketUnitTest exists solely to make it easier to pass a specific
// gtest_filter argument during development.
class UDPSocketUnitTest : public BrowserWithTestWindowTest {
};

static void OnConnected(int result) {
  EXPECT_EQ(0, result);
}

static void OnCompleted(int bytes_read,
                        scoped_refptr<net::IOBuffer> io_buffer,
                        const std::string& address,
                        uint16_t port) {
  // Do nothing; don't care.
}

static const char test_message[] = "$$TESTMESSAGETESTMESSAGETESTMESSAGETEST$$";
static const int test_message_length = arraysize(test_message);

net::AddressList CreateAddressList(const char* address_string, int port) {
  net::IPAddress ip;
  EXPECT_TRUE(ip.AssignFromIPLiteral(address_string));
  return net::AddressList::CreateFromIPAddress(ip, port);
}

static void OnSendCompleted(int result) {
  EXPECT_EQ(test_message_length, result);
}

TEST(UDPSocketUnitTest, TestUDPSocketRecvFrom) {
  base::MessageLoopForIO io_loop;  // For RecvFrom to do its threaded work.
  UDPSocket socket("abcdefghijklmnopqrst");

  // Confirm that we can call two RecvFroms in quick succession without
  // triggering crbug.com/146606.
  socket.Connect(CreateAddressList("127.0.0.1", 40000),
                 base::Bind(&OnConnected));
  socket.RecvFrom(4096, base::Bind(&OnCompleted));
  socket.RecvFrom(4096, base::Bind(&OnCompleted));
}

TEST(UDPSocketUnitTest, TestUDPMulticastJoinGroup) {
  const char kGroup[] = "237.132.100.17";
  UDPSocket src("abcdefghijklmnopqrst");
  UDPSocket dest("abcdefghijklmnopqrst");

  EXPECT_EQ(0, dest.Bind("0.0.0.0", 13333));
  EXPECT_EQ(0, dest.JoinGroup(kGroup));
  std::vector<std::string> groups = dest.GetJoinedGroups();
  EXPECT_EQ(static_cast<size_t>(1), groups.size());
  EXPECT_EQ(kGroup, *groups.begin());
  EXPECT_NE(0, dest.LeaveGroup("237.132.100.13"));
  EXPECT_EQ(0, dest.LeaveGroup(kGroup));
  groups = dest.GetJoinedGroups();
  EXPECT_EQ(static_cast<size_t>(0), groups.size());
}

TEST(UDPSocketUnitTest, TestUDPMulticastTimeToLive) {
  const char kGroup[] = "237.132.100.17";
  UDPSocket socket("abcdefghijklmnopqrst");
  EXPECT_NE(0, socket.SetMulticastTimeToLive(-1));  // Negative TTL shall fail.
  EXPECT_EQ(0, socket.SetMulticastTimeToLive(3));
  socket.Connect(CreateAddressList(kGroup, 13333), base::Bind(&OnConnected));
}

TEST(UDPSocketUnitTest, TestUDPMulticastLoopbackMode) {
  const char kGroup[] = "237.132.100.17";
  UDPSocket socket("abcdefghijklmnopqrst");
  EXPECT_EQ(0, socket.SetMulticastLoopbackMode(false));
  socket.Connect(CreateAddressList(kGroup, 13333), base::Bind(&OnConnected));
}

static void QuitMessageLoop() {
  base::MessageLoopForIO::current()->QuitNow();
}

// Send a test multicast packet every second.
// Once the target socket received the packet, the message loop will exit.
static void SendMulticastPacket(UDPSocket* src, int result) {
  if (result == 0) {
    scoped_refptr<net::IOBuffer> data = new net::WrappedIOBuffer(test_message);
    src->Write(data, test_message_length, base::Bind(&OnSendCompleted));
    base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
        FROM_HERE, base::Bind(&SendMulticastPacket, src, result),
        base::TimeDelta::FromSeconds(1));
  } else {
    QuitMessageLoop();
    FAIL() << "Failed to connect to multicast address. Error code: " << result;
  }
}

static void OnMulticastReadCompleted(bool *packet_received,
                                     int count,
                                     scoped_refptr<net::IOBuffer> io_buffer) {
  EXPECT_EQ(test_message_length, count);
  EXPECT_EQ(0, strncmp(io_buffer->data(), test_message, test_message_length));
  *packet_received = true;
  QuitMessageLoop();
}

TEST(UDPSocketUnitTest, TestUDPMulticastRecv) {
  const int kPort = 9999;
  const char kGroup[] = "237.132.100.17";
  bool packet_received = false;
  base::MessageLoopForIO io_loop;  // For Read to do its threaded work.
  UDPSocket dest("abcdefghijklmnopqrst");
  UDPSocket src("abcdefghijklmnopqrst");

  // Receiver
  EXPECT_EQ(0, dest.Bind("0.0.0.0", kPort));
  EXPECT_EQ(0, dest.JoinGroup(kGroup));
  dest.Read(1024, base::Bind(&OnMulticastReadCompleted, &packet_received));

  // Sender
  EXPECT_EQ(0, src.SetMulticastTimeToLive(0));
  src.Connect(CreateAddressList(kGroup, kPort),
              base::Bind(&SendMulticastPacket, &src));

  // If not received within the test action timeout, quit the message loop.
  io_loop.task_runner()->PostDelayedTask(
      FROM_HERE, base::Bind(&QuitMessageLoop), TestTimeouts::action_timeout());

  io_loop.Run();

  EXPECT_TRUE(packet_received) << "Failed to receive from multicast address";
}

}  // namespace extensions


text:
<!DOCTYPE html>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
    <meta id="viewport_meta" name="viewport" content="" />

    <meta name="author" content="Xinchao He">
    <link rel="stylesheet" href="css/annex.css"/>

 i


text:
package st.zudamue.support.android.sql;

/**
 * Created by xdaniel on 1/7/17.
 *
 * @author Daniel Costa <costa.xdaniel@gmail.com>
 */

public interface Insert {

    ResultInsertInto insertInto( CharSequence table );

    interface ResultInsertInto extends Values, Columns, As, CharSequence, SQL {
    }

    interface ResultColumn extends SQL {
    }

    interface As {
        Select as();
    }

    interface ResultColumns extends Values, SQL {
    }

    interface Columns {
        ResultColumns columns( CharSequence  ... columns );
    }

    interface Values {
        SQL values(Object ... values);
    }

}


text:
using System.Collections.Generic;

namespace Moosetrail.LaTeX.Elements
{
    /// <summary>
    /// Interface for all Content Contexts such as chapter, section and so on
    /// </summary>
    public interface ContentContext : LaTeXElement
    {
        /// <summary>
        /// Get/Set the name of the chapter
        /// </summary>
        string Name { get; set; }

        /// <summary>
        /// Get/Set the elements of the chapter
        /// </summary>
        List<LaTeXElement> Elements { get; set; }
    }
}