text:
<<<<<<< HEAD
<<<<<<< HEAD
registration.tests package
==========================

Submodules
----------

registration.tests.default_backend module
-----------------------------------------

.. automodule:: registration.tests.default_backend
    :members:
    :undoc-members:
    :show-inheritance:

registration.tests.forms module
-------------------------------

.. automodule:: registration.tests.forms
    :members:
    :undoc-members:
    :show-inheritance:

registration.tests.models module
--------------------------------

.. automodule:: registration.tests.models
    :members:
    :undoc-members:
    :show-inheritance:

registration.tests.simple_backend module
----------------------------------------

.. automodule:: registration.tests.simple_backend
    :members:
    :undoc-members:
    :show-inheritance:

registration.tests.urls module
------------------------------

.. automodule:: registration.tests.urls
    :members:
    :undoc-members:
    :show-inheritance:

Module contents
---------------

.. automodule:: registration.tests
    :members:
    :undoc-members:
    :show-inheritance:
=======
registration.tests package
==========================

Submodules
----------

registration.tests.default_backend module
-----------------------------------------

.. automodule:: registration.tests.default_backend
    :members:
    :undoc-members:
    :show-inheritance:

registration.tests.forms module
-------------------------------

.. automodule:: registration.tests.forms
    :members:
    :undoc-members:
    :show-inheritance:

registration.tests.models module
--------------------------------

.. automodule:: registration.tests.models
    :members:
    :undoc-members:
    :show-inheritance:

registration.tests.simple_backend module
----------------------------------------

.. automodule:: registration.tests.simple_backend
    :members:
    :undoc-members:
    :show-inheritance:

registration.tests.urls module
------------------------------

.. automodule:: registration.tests.urls
    :members:
    :undoc-members:
    :show-inheritance:

Module contents
---------------

.. automodule:: registration.tests
    :members:
    :undoc-members:
    :show-inheritance:
>>>>>>> b875702c9c06ab5012e52ff4337439b03918f453
=======
registration.tests package
==========================

Submodules
----------

registration.tests.default_backend module
-----------------------------------------

.. automodule:: registration.tests.default_backend
    :members:
    :undoc-members:
    :show-inheritance:

registration.tests.forms module
-------------------------------

.. automodule:: registration.tests.forms
    :members:
    :undoc-members:
    :show-inheritance:

registration.tests.models module
--------------------------------

.. automodule:: registration.tests.models
    :members:
    :undoc-members:
    :show-inheritance:

registration.tests.simple_backend module
----------------------------------------

.. automodule:: registration.tests.simple_backend
    :members:
    :undoc-members:
    :show-inheritance:

registration.tests.urls module
------------------------------

.. automodule:: registration.tests.urls
    :members:
    :undoc-members:
    :show-inheritance:

Module contents
---------------

.. automodule:: registration.tests
    :members:
    :undoc-members:
    :show-inheritance:
>>>>>>> b875702c9c06ab5012e52ff4337439b03918f453


text:
import httplib2
import os
import sys

from apiclient.discovery import build_from_document
from apiclient.errors import HttpError
from oauth2client.client import flow_from_clientsecrets
from oauth2client.file import Storage
from oauth2client.tools import run_flow

video_id = "IrPwZ7ejsw8"
channel_id = "UC5aFBZOvtseFQWib1kILbpA"

# The CLIENT_SECRETS_FILE variable specifies the name of a file that contains

# the OAuth 2.0 information for this application, including its client_id and
# client_secret. You can acquire an OAuth 2.0 client ID and client secret from
# the {{ Google Cloud Console }} at
# {{ https://cloud.google.com/console }}.
# Please ensure that you have enabled the YouTube Data API for your project.
# For more information about using OAuth2 to access the YouTube Data API, see:
#   https://developers.google.com/youtube/v3/guides/authentication
# For more information about the client_secrets.json file format, see:
#   https://developers.google.com/api-client-library/python/guide/aaa_client_secrets
CLIENT_SECRETS_FILE = "client_secrets.json"

# This OAuth 2.0 access scope allows for full read/write access to the
# authenticated user's account and requires requests to use an SSL connection.
YOUTUBE_READ_WRITE_SSL_SCOPE = "https://www.googleapis.com/auth/youtube.force-ssl"
YOUTUBE_API_SERVICE_NAME = "youtube"
YOUTUBE_API_VERSION = "v3"

# This variable defines a message to display if the CLIENT_SECRETS_FILE is
# missing.
MISSING_CLIENT_SECRETS_MESSAGE = """
WARNING: Please configure OAuth 2.0

To make this sample run you will need to populate the client_secrets.json file
found at:
   %s
with information from the APIs Console
https://console.developers.google.com

For more information about the client_secrets.json file format, please visit:
https://developers.google.com/api-client-library/python/guide/aaa_client_secrets
""" % os.path.abspath(os.path.join(os.path.dirname(__file__),
                                   CLIENT_SECRETS_FILE))

# Authorize the request and store authorization credentials.
def get_authenticated_service():
  flow = flow_from_clientsecrets(CLIENT_SECRETS_FILE, scope=YOUTUBE_READ_WRITE_SSL_SCOPE,
    message=MISSING_CLIENT_SECRETS_MESSAGE)

  storage = Storage("%s-oauth2.json" % sys.argv[0])
  credentials = storage.get()

  if credentials is None or credentials.invalid:
    credentials = run_flow(flow, storage)

  # Trusted testers can download this discovery document from the developers page
  # and it should be in the same directory with the code.
  with open("youtube-v3-api-captions.json", "r", encoding='utf8') as f:
    doc = f.read()
    return build_from_document(doc, http=credentials.authorize(httplib2.Http()))

def get_upload_playlist_id(youtube, channel_id):
    results = youtube.channels().list(
      id=channel_id,
      part="contentDetails"
    ).execute()
    upload_playlist_id = results["items"][0]["contentDetails"]["relatedPlaylists"]["uploads"]
    # print(upload_playlist_id)
    return upload_playlist_id

def get_playlist_video_id(youtube, playlist_id, **kwargs):
  results = youtube.playlistItems().list(
    part='contentDetails',
    playlistId = upload_playlist_id,
    **kwargs
  ).execute()
  #next_page_token = results["nextPageToken"]

  return results

def collect_all_pages():
    playlist_videos = get_playlist_video_id(youtube, upload_playlist_id)
    # print(playlist_videos["nextPageToken"])
    next_page_token =  playlist_videos["nextPageToken"]

    while ('nextPageToken' in playlist_videos):
        # print(next_page_token)
        next_page = get_playlist_video_id(youtube, upload_playlist_id, pageToken=next_page_token)
        playlist_videos['items'] = playlist_videos['items'] + next_page['items']
        if 'nextPageToken' not in next_page:
            playlist_videos.pop('nextPageToken', None)
        else:
            next_page_token = next_page['nextPageToken']
    # for i in playlist_videos["items"]:
        # print(i["contentDetails"]["videoId"])
    return playlist_videos

# Call the API's captions.list method to list the existing caption tracks.
def get_caption_id(youtube, video_id):

    results = youtube.captions().list(
        part="snippet",
        videoId=video_id
    ).execute()
    try:
        caption_id = results["items"][0]["id"]
        # print(caption_id)
        return caption_id
    except:
        print("IndexError %s" % video_id)
        pass
    #   print(caption_id)
    #   return caption_id

# Call the API's captions.download method to download an existing caption track.
def download_caption(youtube, caption_id, tfmt):

    if caption_id is not None:

        subtitle = youtube.captions().download(
            id=caption_id,
            tfmt=tfmt
          ).execute()
  #print(subtitle.decode("utf-8"))
        return subtitle

def write_caption(path_name, object):
    if not os.path.exists(path_name):
        with open(path_name, "wb") as f:
            f.write(object)

if __name__ == "__main__":
    youtube = get_authenticated_service()
    try:
        upload_playlist_id = get_upload_playlist_id(youtube, channel_id)
        pages = collect_all_pages()
        for i in pages["items"]:
            # print(i["contentDetails"]["videoId"])
            video_id = i["contentDetails"]["videoId"]
            transcript = download_caption(youtube, get_caption_id(youtube, video_id), 'ttml')
            write_caption("./transcripts/%s.xml" % video_id, transcript)
    except TypeError:
        print("error")
        pass

    #playlist_videos = get_playlist_video_id(youtube, upload_playlist_id)

    #transcript = download_caption(youtube, get_caption_id(youtube, video_id), 'ttml')

    #write_caption("scraped_file1", transcript)
    # download_caption(youtube, args.captionid, 'ttml') # sbv (plaintext) or ttml (xml)
      # use ttml (xml): parse it and get text + time start/end for each line
    except HttpError as e:
        print("An HTTP error %d occurred:\n%s" % (e.resp.status, e.content))
    else:
        print("done")

redpajama_set_name: RedPajamaGithub


text:
package com.yidumen.dao.impl;

import com.yidumen.dao.TaoDAO;
import com.yidumen.dao.entity.Tag;
import java.util.List;
import javax.inject.Inject;
import org.hibernate.SessionFactory;
import org.springframework.transaction.annotation.Transactional;

/**
 *
 * @author 蔡迪旻 <yidumen.com>
 */
public class TagSHImpl extends AbstractSHImpl<Tag> implements TaoDAO {

    @Inject
    private SessionFactory sessionFactory;

    public TagSHImpl() {
        super(Tag.class);
    }

    @Transactional(value = "transactionManager", readOnly = true)
    @Override
    public List<Tag> findTags(int limit) {
        return sessionFactory.getCurrentSession().getNamedQuery("Tag.OrderByHints")
                .setMaxResults(limit)
                .list();
    }

    @Override
    public Tag find(String tagName) {
        return (Tag) sessionFactory.getCurrentSession().getNamedQuery("Tag.findByname")
                .setString("tagname", tagName)
                .uniqueResult();
    }

    @Override
    protected SessionFactory getSessionFactory() {
        return sessionFactory;
    }

    @Override
    protected Tag initalizeLazy(Tag entity) {
        return entity;
    }
}


text:
tr
	{mso-height-source:auto;
	mso-ruby-visibility:none;}
col
	{mso-width-source:auto;
	mso-ruby-visibility:none;}
br
	{mso-data-placement:same-cell;}
ruby
	{ruby-align:left;}
.style0
	{mso-number-format:General;
	text-align:general;
	vertical-align:middle;
	white-space:nowrap;
	mso-rotate:0;
	mso-background-source:auto;
	mso-pattern:auto;
	color:black;
	font-size:11.0pt;
	font-weight:400;
	font-style:normal;
	text-decoration:none;
	font-family:"MS Pゴシック", monospace;
	mso-font-charset:128;
	border:none;
	mso-protection:locked visible;
	mso-style-name:標準;
	mso-style-id:0;}
td
	{mso-style-parent:style0;
	padding-top:1px;
	padding-right:1px;
	padding-left:1px;
	mso-ignore:padding;
	color:black;
	font-size:11.0pt;
	font-weight:400;
	font-style:normal;
	text-decoration:none;
	font-family:"MS Pゴシック", monospace;
	mso-font-charset:128;
	mso-number-format:General;
	text-align:general;
	vertical-align:middle;
	border:none;
	mso-background-source:auto;
	mso-pattern:auto;
	mso-protection:locked visible;
	white-space:nowrap;
	mso-rotate:0;}
.xl65
	{mso-style-parent:style0;
	border:.5pt solid windowtext;}
.xl66
	{mso-style-parent:style0;
	border:.5pt solid windowtext;
	background:#DDEBF7;
	mso-pattern:black none;}
.xl67
	{mso-style-parent:style0;
	color:windowtext;}
.xl68
	{mso-style-parent:style0;
	color:windowtext;
	border:.5pt solid windowtext;
	background:#DDEBF7;
	mso-pattern:black none;}
.xl69
	{mso-style-parent:style0;
	color:windowtext;
	border:.5pt solid windowtext;}
.xl70
	{mso-style-parent:style0;
	color:windowtext;
	border:.5pt solid windowtext;
	white-space:normal;}
.xl71
	{mso-style-parent:style0;
	color:windowtext;
	border:.5pt solid windowtext;}
.xl72
	{mso-style-parent:style0;
	color:windowtext;
	border:.5pt solid windowtext;
	background:#BDD7EE;
	mso-pattern:black none;
	white-space:normal;}
.xl73
	{mso-style-parent:style0;
	color:windowtext;
	white-space:normal;}
.xl74
	{mso-style-parent:style0;
	color:windowtext;
	border-top:none;
	border-right:.5pt solid windowtext;
	border-bottom:none;
	border-left:.5pt solid windowtext;
	white-space:normal;}
.xl75
	{mso-style-parent:style0;
	border:.5pt solid windowtext;
	background:#DDEBF7;
	mso-pattern:black none;
	white-space:normal;}
.xl76
	{mso-style-parent:style0;
	border:.5pt solid windowtext;
	white-space:normal;}
.xl77
	{mso-style-parent:style0;
	white-space:normal;}
.xl78
	{mso-style-parent:style0;
	color:windowtext;
	border:.5pt solid windowtext;
	background:#DDEBF7;
	mso-pattern:black none;
	white-space:normal;}
.xl79
	{mso-style-parent:style0;
	color:#555555;
	font-family:Arial, sans-serif;
	mso-font-charset:0;
	white-space:normal;}
.xl80
	{mso-style-parent:style0;
	color:windowtext;
	text-align:left;
	border-top:.5pt solid windowtext;
	border-right:.5pt solid windowtext;
	border-bottom:none;
	border-left:.5pt solid windowtext;
	white-space:normal;}
.xl81
	{mso-style-parent:style0;
	color:windowtext;
	text-align:left;
	border-top:none;
	border-right:.5pt solid windowtext;
	border-bottom:none;
	border-left:.5pt solid windowtext;
	white-space:normal;}
.xl82
	{mso-style-parent:style0;
	color:windowtext;
	text-align:left;
	border-top:none;
	border-right:.5pt solid windowtext;
	border-bottom:.5pt solid windowtext;
	border-left:.5pt solid windowtext;
	white-space:normal;}


text:
var OS = require('os');

var ShellJS = require("shelljs");

var Download01Org = require("../src/util/Download01Org");
var Util = require("../test-util/Util.js");

var _output = require("../src/TerminalOutput").getInstance();

exports.tests = {

    fetchVersions: function(test) {

        test.expect(2);

        var app = Util.createTmpApplication("com.example.foo");
        var deps = new Download01Org(app, "android", "stable");
        deps.fetchVersions(function(versions, errormsg) {

            if (errormsg)
                _output.info(errormsg);

            test.equal(versions instanceof Array, true);
            test.equal(versions.length > 0, true);
            Util.deleteTmpApplication(app);
            test.done();
        });
    },

    download: function(test) {

        test.expect(2);

        var app = Util.createTmpApplication("com.example.foo");
        var deps = new Download01Org(app, "android", "stable");
        var tmpDir = Util.createTmpDir();
        deps.download("9.38.208.10", tmpDir, function(filename, errormsg) {

            if (errormsg)
                _output.info(errormsg);

            test.equal(typeof filename === "string", true);
            test.equal(filename.length > 0, true);
            ShellJS.rm("-rf", tmpDir);
            Util.deleteTmpApplication(app);
            test.done();
        });
    },

    stableLatest: function(test) {

        test.expect(1);

        var application = Util.createTmpApplication("com.example.foo");
        var deps = new Download01Org(application, "android", "stable");
        deps.findCrosswalkVersion(null, "stable",
                                     function(version, channel, errormsg) {

            test.equal(typeof version, "string");

            Util.deleteTmpApplication(application);
            test.done();
        });
    },

    beta: function(test) {

        test.expect(2);

        var application = Util.createTmpApplication("com.example.foo");
        var versionSought = "12.41.296.4";
        var channelSought = "beta";
        var deps = new Download01Org(application, "android", channelSought);
        deps.findCrosswalkVersion(versionSought, null,
                                     function(version, channel, errormsg) {

            test.equal(version, versionSought);
            test.equal(channel, channelSought);

            Util.deleteTmpApplication(application);
            test.done();
        });
    },

    canaryLatest: function(test) {

        test.expect(1);

        var application = Util.createTmpApplication("com.example.foo");
        var deps = new Download01Org(application, "android", "canary");
        deps.findCrosswalkVersion(null, "canary",
                                  function(version, channel, errormsg) {

            test.equal(typeof version, "string");

            Util.deleteTmpApplication(application);
            test.done();
        });
    },

    canary64latest: function(test) {

        test.expect(1);

        var application = Util.createTmpApplication("com.example.foo");
        var deps = new Download01Org(application, "android", "canary");
        deps.androidWordSize = 64;
        deps.findCrosswalkVersion(null, "canary",
                                  function(version, channel, errormsg) {

            test.equal(typeof version, "string");

            Util.deleteTmpApplication(application);
            test.done();
        });
    },

    lite: function(test) {

        test.expect(1);

        var application = Util.createTmpApplication("com.example.foo");
        var deps = new Download01Org(application, "android", "stable");
        deps.androidFlavor = "crosswalk-lite";
        deps.findCrosswalkVersion(null, null,
                                  function(version, channel, errormsg) {

            test.equal(typeof version, "string");

            Util.deleteTmpApplication(application);
            test.done();
        });
    },

    invalid: function(test) {

        test.expect(2);

        var application = Util.createTmpApplication("com.example.foo");
        var deps = new Download01Org(application, "android", "stable");
        deps.findCrosswalkVersion("0.0.0.0", null,
                                     function(version, channel, errormsg) {

            test.equal(version, null);
            test.equal(channel, null);

            Util.deleteTmpApplication(application);
            test.done();
        });
    }
};


text:
<?xml version="1.0"?>

<doc>
  <assembly>
    <name>Microsoft.Graphics.Canvas</name>
  </assembly>
  <members>

    <member name="N:Microsoft.Graphics.Canvas">
      This namespace defines the main Win2D API for drawing 2D graphics.
    </member>

    <member name="N:Microsoft.Graphics.Canvas.Brushes">
      This namespace defines the various brushes that can be used with Win2D.
    </member>

    <member name="N:Microsoft.Graphics.Canvas.Geometry">
      This namespace defines the API for drawing geometry (lines, filled shapes etc.) with Win2D.
    </member>

    <member name="N:Microsoft.Graphics.Canvas.Text">
      This namespace defines the API for drawing text with Win2D.
    </member>

    <member name="N:Microsoft.Graphics.Canvas.UI">
      This namespace defines common types for using Win2D with UI frameworks.
    </member>

    <member name="N:Microsoft.Graphics.Canvas.UI.Xaml">
      This namespace provides Win2D-enabled XAML controls.
    </member>

    <member name="N:Microsoft.Graphics.Canvas.Effects">

This namespace provides image manipulation effects such as blur and saturation.

Effects are a type of <see cref="T:Microsoft.Graphics.Canvas.ICanvasImage"/>, so they can be displayed
           using <see cref="M:Microsoft.Graphics.Canvas.CanvasDrawingSession.DrawImage(Microsoft.Graphics.Canvas.ICanvasImage)"/> or
           <see cref="T:Microsoft.Graphics.Canvas.Brushes.CanvasImageBrush"/>. The source data fed into an effect
           is also of type ICanvasImage, which allows you to connect either a bitmap or another effect.
           Complex image processing graphs can be constructed by chaining many effects together.

    </member>

    <member name="N:Microsoft.Graphics.Canvas.DirectX">
      This namespace defines DirectX types used for interop with other components.
      <remarks>
        When targeting the Universal Windows Platform,
        this namespace is renamed to Windows.Graphics.DirectX.
      </remarks>
    </member>

    <member name="N:Microsoft.Graphics.Canvas.DirectX.Direct3D11">
      This namespace defines Direct3D11 types used for interop with other components.
      <remarks>
        When targeting the Universal Windows Platform,
        this namespace is renamed to Windows.Graphics.DirectX.Direct3D11.
      </remarks>
    </member>

    <member name="N:Microsoft.Graphics.Canvas.Numerics">
      This namespace defines Windows Runtime vector and matrix types. These are only used
               for data exchange, and do not include any methods for doing math with the values.
               For more complete functionality, see the .NET <see cref="N:System.Numerics"/> and
               C++ Windows.Foundation.Numerics namespaces.
      <remarks>

          When targeting the Universal Windows Platform,
          this namespace is renamed to Windows.Foundation.Numerics.

          See <conceptualLink target="UAP"/> for more information about the numerics types on Windows 10.

      </remarks>
    </member>

  </members>
</doc>


text:
  # splits the speicifed path into its directories and files
  # e.g. c:/dir1/dir2/file.ext -> ['c:','dir1','dir2','file.ext']
  function(path_split path)
    if("_${path}" MATCHES "^_[\\/]")
      string_substring("${path}" 1)
      ans(path)
    endif()
    string_split("${path}" "[/]")
    ans(parts)

    return_ref(parts)
  endfunction()


text:
```shell
npm run start
npm run webpack
```

### ENOSPC?
```shell
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
```


text:
// to isolate the scope of this plugin
(function () {

    $(document).ready(function () {

        // add the plugin to the interface plugin area
        $axure.player.createPluginHost({
            id: 'feedbackContainer',
            context: 'interface',
            title: 'FeedbAxure'
        });

        // load when feedback loads
        $axure.page.bind('load.feedback', function () {
            loadEntries();
        });

        $('

').appendTo('#feedbackContainer');
        var newEntryControl = getNewEntryControl();
        newEntryControl.appendTo('#feedbackNewEntries');

    });

    //------------------------------------------------------------------------------------
    // This loads the entries for the current page in the plugin.
    // The callback of this function is the listCompleted function which processes the result
    //------------------------------------------------------------------------------------
    var loadEntries = function () {
        var savedEntriesDiv = $('#feedbackSavedEntries');
        savedEntriesDiv.html('');
        $.ajax({
            type: 'GET',
            url: $axure.player.settings.feedbackServiceUrl + '/list',
            data: {
                collectionName: $axure.player.settings.projectId,
                subsetName: $axure.page.id
            },
            success: function (response) {
                var sortedComments = fixCommentDatesAndSort(response.data.comments);
                var threads = collapseCommentsToThreads(sortedComments);
                var threadQuery = getThreadsControl(threads);
                savedEntriesDiv.append(threadQuery);
            },
            dataType: 'jsonp'
        });

    };

    //------------------------------------------------------------------------------------
    // Fixes comment date fields
    //      Returns an array of the sorted comments with the dates fixed
    //------------------------------------------------------------------------------------
    var fixCommentDatesAndSort = function (comments, sortFn) {
        var items = comments;
        if (!comments.length) {
            items = [comments];
        } else {
            items = comments.slice();
        }
        $.each(items, function (index, item) {
            var dateStr = item.commentDate;
            item.commentDate = new Date(Number(dateStr.substring(6, dateStr.length - 2)));
        });

        if (!sortFn) {
            sortFn = function (x, y) {
                var a = x.commentDate;
                var b = y.commentDate;

                if (a === b) return 0;
                else if (a < b) return -1;
                else return 1;
            };
        }
        items.sort(sortFn);
        return items;
    };

    //------------------------------------------------------------------------------------
    // Collapses comments by thread into a list of thread objects which each contain a
    // list of comments.
    //      Thread objects properties:
    //          threadId: the thread id of the comment. Ususally the same as the id of the
    //              first comment in a thread.
    //          comments: a list of the comments
    //------------------------------------------------------------------------------------
    var collapseCommentsToThreads = function (comments) {
        var threadHash = {};
        var threadList = [];

        $.each(comments, function (index, comment) {
            var thread = threadHash[comment.threadId];
            if (!thread) {
                thread = {
                    threadId: comment.threadId,
                    comments: [comment]
                };
                threadHash[comment.threadId] = thread;
                threadList.push(thread);
            } else {
                thread.comments.push(comment);
            }
        });
        return threadList;
    }

    //------------------------------------------------------------------------------------
    // Creats the html for threads, creates a jquery object for them, and attaches the
    // necessary events.
    //------------------------------------------------------------------------------------
    var getThreadsControl = function (threads) {
        var dom = $(getHtmlForThreads(threads));
        dom.find('a.feedbackThreadReplyLink')
            .click(threadReplyLink_click);
        attachCommentControlEvents(dom);
        return dom;
    };

    //------------------------------------------------------------------------------------
    // Returns the html for single thread or a list of threads
    //      A thread object is assumed to have the following properties:
    //          threadId - the thread id (a guid)
    //          comments - the list of comments in a thread
    //------------------------------------------------------------------------------------
    var getHtmlForThreads = function (threads) {
        var items = threads;
        if (!threads.length) {
            threads = [comments];
        }

        var listHtml = [];
        $.each(items, function (index, thread) {
            listHtml.push(
                '
',
                getHtmlForComments(thread.comments),
                '
reply
',
                '
');
        });

        var html = listHtml.join('');
        return html;
    };

    //------------------------------------------------------------------------------------
    // Gerates the html for a list (or list-like) list of comments.
    //------------------------------------------------------------------------------------
    var getHtmlForComments = function (comments) {
        var items = comments;
        if (!comments.length) {
            items = [comments];
        }
        var listHtml = [];
        $.each(items, function (index, item) {
            listHtml.push(
                '
',
                '
',
                '
', item.commenter, '
',
                '
', $axure.utils.formatDate(item.commentDate), '
',
                '
',
                '
', item.commentText, '
',
                '
',
                '       editdelete',
                '
',
                '
');
        });
        var html = listHtml.join('');
        return html;
        //$('#feedbackSavedEntries').html(html);
    };

    //------------------------------------------------------------------------------------
    // Generates the html for a list of comments (or a single comment), creates a jquery object
    // and attaches the necessary events. The comments should all belong to the same thread
    // and will be created without the div for the surrounding thread
    //------------------------------------------------------------------------------------
    var getCommentsControl = function (comments) {
        var returnVal = $(getHtmlForComments(comments));
        attachCommentControlEvents(returnVal);
        return returnVal;
    }

    //------------------------------------------------------------------------------------
    // Takes a jquery object with a bunch of comment nodes in it and attaches the necessary
    // events.  This is usually used by getCommentsControl and getThreadsControl
    //------------------------------------------------------------------------------------
    var attachCommentControlEvents = function (query) {
        query.find('a.feedbackItemEditLink').click(
            editCommentLink_click);
        query.find('a.feedbackItemDeleteLink').click(
            deleteCommentLink_click);
    }

    //------------------------------------------------------------------------------------
    //
    //------------------------------------------------------------------------------------
    var getNewEntryControl = function (threadId) {
        // add the area for new entries
        var newEntryQuery = $(getNewEntriesHtml(threadId));
        // find the submit link and attach the click event
        newEntryQuery.find('.feedbackNewItemSave').click(feedbackNewEntrySaveButton_click);
        newEntryQuery.find('.feedbackNewItemCancel').click(feedbackNewEntryCancelButton_click);

        return newEntryQuery;
    };

    var getNewEntriesHtml = function (threadId) {
        var thread = threadId ? threadId : "";
        cancelButtonText = threadId ? 'cancel' : 'clear';
        return [
            '
',
            '
<input type="text" class="feedbackNewEntryTextBox" />
',
            '
',
            '       ', cancelButtonText, '',
            '       save',
            '
',
            '
'].join("");
    };

    var saveError = function (result) {
        alert("error: " + result);
    };

    var finishAddOrUpdate = function (tagVal, data) {
        var newFeedbackDiv = $('#feedbackNew_' + tagVal);
        //var loadingDiv = $('#loading_' + tagVal);
        var existingComment = $('#comment_' + data.comment.id);
        if (existingComment.length > 0) {
        } else {
            var threadDivQuery = $('#thread_' + data.comment.threadId);
            if (threadDivQuery.length > 0) {
                var comments = fixCommentDatesAndSort(data.comment);
                //var html = getHtmlForComments(comments[0]);
                var commentQuery = getCommentsControl(comments);
                newFeedbackDiv.after(commentQuery);
                newFeedbackDiv.detach();
            } else {
                var comments = fixCommentDatesAndSort(data.comment);
                var thread = collapseCommentsToThreads(comments);
                var threadQuery = getThreadsControl(thread);

                newFeedbackDiv.after(threadQuery);
                newFeedbackDiv.detach();
            }
        }

    };

    var MAX_RETRIES = 10;
    var getResponse = function (tagVal, retryNum, onFinished) {
        $.ajax({
            type: 'GET',
            url: $axure.player.settings.feedbackServiceUrl + '/getResponse',
            data: {
                tag: tagVal
            },
            success: function (response) {
                if (response && response.success && response.data.comment) {
                    onFinished(tagVal, response.data);
                } else if (response.success) { // if the response succeeded but we didn't get a comment, then we're waiting
                    if (retryNum < MAX_RETRIES) {
                        setTimeout(function () {
                            getResponse(tagVal, retryNum + 1, onFinished);
                        }, 3000);
                    }
                }
            },
            dataType: 'jsonp'
        });
    }

    var getResponseOrFinish = function (data, tagVal, onFinished) {
        if (!data) {
            getResponse(tagVal, 0, onFinished);
        } else {
            onFinished(tagVal, data);
        }
    }

    var feedbackNewEntryCancelButton_click = function () {
        var parent = $(this).parents('.feedbackNewItem');
        var newEntries = parent.parents('#feedbackNewEntries');
        var isReply = (newEntries.length == 0);
        if (isReply) {
            parent.parents('.feedbackThread').find('.editThreadLinks').show();
            parent.detach();
        } else {
            parent.find('input[type=text]').val('');
        }
        return false;
    }

    var feedbackNewEntrySaveButton_click = function () {
        var parent = $(this).parents('.feedbackNewItem');
        var threadId = parent.attr('threadId');

        // we want to add a new control to add a comment if this is NOT a thread reply
        if (!threadId) {
            var newEntryControl = getNewEntryControl();
            newEntryControl.appendTo('#feedbackNewEntries');
        } else {
            // we mant to re-enable the reply link
            parent.find('.editThreadLinks').show();
        }

        var input = parent.find('input[type=text]');

        var text = input.val();
        parent.find('input').attr('disabled', 'disabled');
        parent.find('a').attr('disabled', 'disabled').addClass('disabled');

        var tagVal = parent.attr('id').replace('feedbackNew_', '');

        $.ajax({
            type: 'POST',
            url: $axure.player.settings.feedbackServiceUrl + '/add',
            data: {
                tag: tagVal,
                threadId: threadId,
                collectionName: $axure.player.settings.projectId,
                subsetName: $axure.page.id,
                commenter: 'Martin',
                commentText: text,
                success: function (data) {
                    getResponseOrFinish(data, tagVal, finishAddOrUpdate);
                }
            }
        });

        return false;
    };

    var threadReplyLink_click = function () {
        var thisQuery = $(this);
        var threadParent = thisQuery.parents('div[id^=thread_]');
        var threadId = threadParent.attr('id').replace('thread_', '');

        thisQuery.parents('.editThreadLinks')
            .before(getNewEntryControl(threadId));

        // hide the reply link
        threadParent.find('.editThreadLinks').hide();

        return false;
    };

    var editCommentLink_click = function () {
        alert('edit');
        return false;
    }

    var deleteCommentLink_click = function () {
        alert('delete');
        return false;
    }

})();


text:
import User from '../model';
import Boom from 'boom';

export default function handler(request, reply) {
  if (request.auth.credentials.id !== request.params.userId) {
    throw Boom.unauthorized('You cannot delete others. LOL. Santa dislikes you.');
  }

  return User.Model
    .forge()
    .fetch({ id: request.params.userId })
    .then(user => user.destroy())
    .then(() => {
      request.auth.session.clear();
      return reply('Deleted successfully').code(200);
    });
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <artifactId>tsf</artifactId>
        <groupId>org.n52.tsf</groupId>
        <version>1.0-SNAPSHOT</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>tsf-modules</artifactId>
    <packaging>pom</packaging>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.6.0</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <modules>
        <module>io</module>
    </modules>

</project>


text:
body {
  margin: 10px 10px 0;
<if expr="not pp_ifdef('android')">
  min-width: 47em;
</if>
  /* Should match needs-restart.height + 5 */
  padding-bottom: 75px;
}

a {
  color: blue;
  font-size: 103%;
}

.permalink {
  color: #A0A0A0;
}

#header {
  -webkit-padding-start: 75px;
  background: -webkit-image-set(
      url('../../app/theme/default_100_percent/flags_section.png') 1x,
      url('../../app/theme/default_200_percent/flags_section.png') 2x)
      no-repeat left center;
  box-sizing: border-box;
  display: table;
  margin-bottom: 1.05em;
  /* 67px is the height of the header's image. */
  min-height: 67px;
  overflow: hidden;
  position: relative;
}

#title-spacer {
  display: table-cell;
  vertical-align: middle;
}

html[dir=rtl] #header {
  background-position: right center;
}

h1 {
  font-size: 156%;
  font-weight: bold;
  margin: 0;
  padding: 0;
}

.blurb-container {
  font-size: 120%;
  padding-bottom: 1.5em;
}

#blurb-warning {
  color: red;
  font-weight: bold;
}

div.content {
  font-size: 88%;
  margin: 5px auto 10px;
}

div.content:last-of-type {
  margin-bottom: 0;
}

.section-header {
  background: rgb(235, 239, 249);
  border-top: 1px solid rgb(181, 199, 222);
  font-size: 99%;
  padding: 2px 5px 3px;
  width: 100%;
}

.section-header > table tr td:first-child {
  width: 100%;
}

.section-header > table {
  width: 100%;
}

.section-header-title {
  font-weight: bold;
  line-height: 200%;
}

#experiment-reset-all {
  float: right;
}

html[dir=rtl] #experiment-reset-all {
  float: left;
}

.vbox-container {
  -webkit-box-orient: vertical;
  display: -webkit-box;
}

.wbox {
  -webkit-box-align: stretch;
  -webkit-box-flex: 1;
  display: -webkit-box;
}

#top {
  -webkit-padding-end: 5px;
}

/* Disabled and unsupported experiments display grey text on a grey background.
   The title, however, should remain legible. */

.experiment-unsupported > td,
.experiment-disabled > td {
  background: #F0F0F0;
  color: #A0A0A0;
}

.experiment-unsupported .experiment-name,
.experiment-disabled .experiment-name {
  color: #000;
}

.experiment {
  border-bottom: 1px solid #cdcdcd;
}

.experiment td {
  padding-bottom: 4px;
  padding-top: 5px;
}

/* Indent the text related to each experiment. */
.experiment-text {
  -webkit-padding-start: 5px;
}

.experiment-name {
  font-weight: bold;
}

.referenced .experiment-name {
  background-color: rgb(255, 255, 0);
}

.no-experiments {
  font-size: 1.2em;
  margin: 6em 0;
  text-align: center;
}

/* Match the indentation of .experiment-text. */
.experiment-actions {
  -webkit-padding-start: 5px;
  margin-bottom: 0.2em;
  margin-top: 0.2em;
}

div.needs-restart {
  background: #FFF;
  border-top: 1px solid rgb(181, 199, 222);
  bottom: 0;
  box-sizing: border-box;
  /* If you change this, update body.padding-bottom */
  height: 70px;
  left: 0;
  padding-bottom: 25px;
  padding-left: 15px;
  padding-right: 15px;
  padding-top: 15px;
  position: fixed;
  width: 100%;
}

button {
  font-size: 104%;
}


text:
<?php
/* @var $this DocumentosController */
/* @var $data Documentos */
?>

	<?php echo CHtml::encode($data->getAttributeLabel('doc_id')); ?>:
	<?php echo CHtml::link(CHtml::encode($data->doc_id), array('view', 'id'=>$data->doc_id)); ?>

	<?php echo CHtml::encode($data->getAttributeLabel('cu_id')); ?>:
	<?php echo CHtml::encode($data->cu_id); ?>

	<?php echo CHtml::encode($data->getAttributeLabel('doc_fecha')); ?>:
	<?php echo CHtml::encode($data->doc_fecha); ?>

	<?php echo CHtml::encode($data->getAttributeLabel('doc_nombre')); ?>:
	<?php echo CHtml::encode($data->doc_nombre); ?>

	<?php echo CHtml::encode($data->getAttributeLabel('doc_tipo')); ?>:
	<?php echo CHtml::encode($data->doc_tipo); ?>

	<?php echo CHtml::encode($data->getAttributeLabel('doc_link')); ?>:
	<?php echo CHtml::encode($data->doc_link); ?>


text:
from __future__ import unicode_literals

from django.db import migrations, models

class Migration(migrations.Migration):

    dependencies = [
        ('zerver', '0136_remove_userprofile_quota'),
    ]

    operations = [
        migrations.AddField(
            model_name='realm',
            name='upload_quota_gb',
            field=models.IntegerField(null=True),
        ),
    ]


text:
#include "cpu/thread_context.hh"
#include "mem/page_table.hh"
#include "sim/faults.hh"
#include "sim/process.hh"
#include "sim/tlb.hh"

Fault
GenericTLB::translateAtomic(RequestPtr req, ThreadContext *tc, Mode)
{
#if FULL_SYSTEM
        panic("Generic translation shouldn't be used in full system mode.\n");
#else
        Process * p = tc->getProcessPtr();

        Fault fault = p->pTable->translate(req);
        if(fault != NoFault)
            return fault;

        return NoFault;
#endif
}

void
GenericTLB::translateTiming(RequestPtr req, ThreadContext *tc,
        Translation *translation, Mode mode)
{
    assert(translation);
    translation->finish(translateAtomic(req, tc, mode), req, tc, mode);
}

void
GenericTLB::demapPage(Addr vaddr, uint64_t asn)
{
    warn("Demapping pages in the generic TLB is unnecessary.\n");
}


text:
<?php

/*
 *
 * This file is part of Apostrophe
 * (c) 2009 P'unk Avenue LLC, www.punkave.com
 */

/**
 * @package    apostrophePlugin
 * @subpackage Tasks
 * @author     Dan Ordille <dan@punkave.com>
 */
class aBlogImportTask extends sfBaseTask
{

  protected function configure()
  {
    $this->addOptions(array(
      new sfCommandOption('env', null, sfCommandOption::PARAMETER_REQUIRED, 'The environment', 'dev'),
      new sfCommandOption('application', null, sfCommandOption::PARAMETER_REQUIRED, 'The application', 'frontend'),
      new sfCommandOption('connection', null, sfCommandOption::PARAMETER_REQUIRED, 'The connection name', 'doctrine'),
      new sfCommandOption('events', null, sfCommandOption::PARAMETER_REQUIRED, 'XML of events', null),
      new sfCommandOption('posts', null, sfCommandOption::PARAMETER_REQUIRED, 'XML of posts', null),
      new sfCommandOption('clear', null, sfCommandOption::PARAMETER_NONE, 'Remove existing posts and/or events', null),
      new sfCommandOption('authors', null, sfCommandOption::PARAMETER_REQUIRED, 'XML author username mapping', null),
      new sfCommandOption('defaultUsername', null, sfCommandOption::PARAMETER_REQUIRED, 'Default author of posts', 'admin'),
      new sfCommandOption('tag-to-entity', null, sfCommandOption::PARAMETER_NONE, 'Link to existing entities instead if tag name matches', null),
      new sfCommandOption('skip-confirmation', null, sfCommandOption::PARAMETER_NONE, 'Skip confirmation prompt', null),
      new sfCommandOption('imagesDir', null, sfCommandOption::PARAMETER_REQUIRED, 'Directory path or URL prefix to resolve image URLs beginning with / (http://example.com)', null)
      // add your own options here
    ));

    $this->namespace = 'apostrophe';
    $this->name = 'import-blog';
    $this->briefDescription = 'Imports a blog from an XML file';
    $this->detailedDescription = <<<EOF
Usage:

php symfony apostrophe:import-blog

Separate files should be specified with the --events and --posts options.
Most actual blogs only have posts.

If your xml file specifies a disqus_thread_identifier attribute for a post
element, Apostrophe will point to that existing disqus thread rather than
creating a new thread identifier for the post. To use that feature you
must install the apostropheImportersPlugin in your project and run
apostrophe:migrate to add the disqus_thread_identifier column. This is
only worth the trouble if you have existing disqus threads for your
imported blog posts.

You can specify an authors file which maps old usernames to new usernames.
The task first looks for a match in the authors file (if any), then for a match
among the usernames on the new site, and as a last resort assigns the
article's authorship to the "admin" user.

If the --tag-to-entity option is present, tags associated with
articles and events are first compared to the names of entities,
and linked to those entities instead if they exist. Otherwise a
tag is applied in the normal way. Requires apostropheEntitiesPlugin.

See trac.apostrophe.org for documentation of the XML format required.
EOF;
  }

  protected function execute($args = array(), $options = array())
  {
    aTaskTools::signinAsTaskUser($this->configuration, $options['connection']);
    $databaseManager = new sfDatabaseManager($this->configuration);
    $connection = $databaseManager->getDatabase($options['connection'])->getDoctrineConnection();

    if (is_null($options['posts']) && is_null($options['events']))
    {
      die("You must specify at least one of the posts and events options with a path to the xml file.\n");
    }
    if (!$options['skip-confirmation'])
    {
      if (!$this->askConfirmation("Importing the same content twice will result in duplicate content, are you sure? [y/N]", 'QUESTION_LARGE', false))
      {
        die("Import CANCELLED.  No changes made.\n");
      }
    }
    $rootDir = $this->configuration->getRootDir();

    $importer = new aBlogImporter($connection, $options);
    if (!is_null($options['events']))
    {
      $importer->import('events');
    }
    if (!is_null($options['posts']))
    {
      $importer->import('posts');
    }
  }

}


text:
using System;

namespace DbTransmogrifier.Logging
{
    public interface ILog
    {
        void Debug(string message);
        void DebugFormat(string message, params object[] args);
        void Info(string message);
        void InfoFormat(string message, params object[] args);
        void Error(string message);
        void ErrorFormat(string message, params object[] args);
        void Fault(Exception ex);
    }
}


text:
using DbHidrator;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Client
{
    public partial class MainForm : Form
    {
        DbHidratorClient client;
        SynchronizationContext syncContext;
        public MainForm()
        {
            InitializeComponent();
            syncContext = SynchronizationContext.Current;
            cmbDbProvider.SelectedIndex = 0;
        }

        private async void btnGetTables_Click(object sender, EventArgs e)
        {
            var conn = txtConnStr.Text;
            var provider = cmbDbProvider.SelectedItem.ToString();
            string[] tablesList = await GetTablesList(conn, provider);
            lstchkTables.Items.AddRange(tablesList);
        }

        private Task<string[]> GetTablesList(string connStr, string providerStr)
        {
            return Task<string[]>.Run(() =>
            {
                client = new DbHidratorClient(connStr, providerStr);
                client.GenerateSchema();
                var tablesList = client.GetTablesNames();
                return tablesList;
            });
        }

        private async void btnStart_Click(object sender, EventArgs e)
        {
            var conn = txtConnStr.Text;
            var provider = cmbDbProvider.SelectedItem.ToString();
            var info = lstchkTables.CheckedItems.Cast<String>().ToArray();
            if (rdbtnAll.Checked)
            {
                await GenerateNRows(conn, provider, (int)numRows.Value, info);
            }
            else
            {
                await SimulateRandomInserts(conn, provider,(int)numRows.Value, info);
            }
        }

        private Task SimulateRandomInserts(string conn, string provider,int numberOfRows, string[] tables)
        {
            return Task.Run(() =>
            {
                client.GenerateRowsInRandomTimes(numberOfRows,tables);
                Report(new Tuple<int, int>(100, 100));
            });
        }

        private Task<bool> GenerateNRows(string connStr, string providerStr,int numberOfRows,string[] tables)
        {
            return Task<bool>.Run(() =>
            {
                client.GenerateNRows(numberOfRows, tables);
                Report(new Tuple<int, int>(100, 100));
                return true;
            });
        }

        public void Report(Tuple<int, int> value)
        {
            syncContext.Post((data) => {
                Tuple<int, int> rangeProgress =(Tuple<int,int>) data;
                progress.Maximum = rangeProgress.Item1;
                progress.Value = rangeProgress.Item2;
            }, value);

        }
    }
}


text:
package cors

import (
	"github.com/asaskevich/govalidator"
	"github.com/hellofresh/janus/pkg/plugin"
	"github.com/hellofresh/janus/pkg/proxy"
	"github.com/rs/cors"
)

// Config represents the CORS configuration
type Config struct {
	AllowedOrigins     []string `json:"domains"`
	AllowedMethods     []string `json:"methods"`
	AllowedHeaders     []string `json:"request_headers"`
	ExposedHeaders     []string `json:"exposed_headers"`
	OptionsPassthrough bool     `json:"options_passthrough"`
}

func init() {
	plugin.RegisterPlugin("cors", plugin.Plugin{
		Action:   setupCors,
		Validate: validateConfig,
	})
}

func setupCors(def *proxy.RouterDefinition, rawConfig plugin.Config) error {
	var config Config

	err := plugin.Decode(rawConfig, &config)
	if err != nil {
		return err
	}

	mw := cors.New(cors.Options{
		AllowedOrigins:     config.AllowedOrigins,
		AllowedMethods:     config.AllowedMethods,
		AllowedHeaders:     config.AllowedHeaders,
		ExposedHeaders:     config.ExposedHeaders,
		OptionsPassthrough: config.OptionsPassthrough,
		AllowCredentials:   true,
	})

	def.AddMiddleware(mw.Handler)
	return nil
}

func validateConfig(rawConfig plugin.Config) (bool, error) {
	var config Config
	err := plugin.Decode(rawConfig, &config)
	if err != nil {
		return false, err
	}

	return govalidator.ValidateStruct(config)
}


text:
package v1

import (
	"errors"
	"fmt"
	vvc "k8s.io/api/core/v1"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	types "k8s.io/apimachinery/pkg/types"
	"k8s.io/client-go/kubernetes/typed/core/v1"
)

/*autogenerated contract adapter*/

//ConfigMapCreateRequest represents request
type ConfigMapCreateRequest struct {
	service_ v1.ConfigMapInterface
	*vvc.ConfigMap
}

//ConfigMapUpdateRequest represents request
type ConfigMapUpdateRequest struct {
	service_ v1.ConfigMapInterface
	*vvc.ConfigMap
}

//ConfigMapDeleteRequest represents request
type ConfigMapDeleteRequest struct {
	service_ v1.ConfigMapInterface
	Name     string
	*metav1.DeleteOptions
}

//ConfigMapDeleteCollectionRequest represents request
type ConfigMapDeleteCollectionRequest struct {
	service_ v1.ConfigMapInterface
	*metav1.DeleteOptions
	ListOptions metav1.ListOptions
}

//ConfigMapGetRequest represents request
type ConfigMapGetRequest struct {
	service_ v1.ConfigMapInterface
	Name     string
	metav1.GetOptions
}

//ConfigMapListRequest represents request
type ConfigMapListRequest struct {
	service_ v1.ConfigMapInterface
	metav1.ListOptions
}

//ConfigMapWatchRequest represents request
type ConfigMapWatchRequest struct {
	service_ v1.ConfigMapInterface
	metav1.ListOptions
}

//ConfigMapPatchRequest represents request
type ConfigMapPatchRequest struct {
	service_     v1.ConfigMapInterface
	Name         string
	Pt           types.PatchType
	Data         []byte
	Subresources []string
}

func init() {
	register(&ConfigMapCreateRequest{})
	register(&ConfigMapUpdateRequest{})
	register(&ConfigMapDeleteRequest{})
	register(&ConfigMapDeleteCollectionRequest{})
	register(&ConfigMapGetRequest{})
	register(&ConfigMapListRequest{})
	register(&ConfigMapWatchRequest{})
	register(&ConfigMapPatchRequest{})
}

func (r *ConfigMapCreateRequest) SetService(service interface{}) error {
	var ok bool
	if r.service_, ok = service.(v1.ConfigMapInterface); !ok {
		return fmt.Errorf("invalid service type: %T, expected: v1.ConfigMapInterface", service)
	}
	return nil
}

func (r *ConfigMapCreateRequest) Call() (result interface{}, err error) {
	if r.service_ == nil {
		return nil, errors.New("service was empty")
	}
	result, err = r.service_.Create(r.ConfigMap)
	return result, err
}

func (r *ConfigMapCreateRequest) GetId() string {
	return "v1.ConfigMap.Create"
}

func (r *ConfigMapUpdateRequest) SetService(service interface{}) error {
	var ok bool
	if r.service_, ok = service.(v1.ConfigMapInterface); !ok {
		return fmt.Errorf("invalid service type: %T, expected: v1.ConfigMapInterface", service)
	}
	return nil
}

func (r *ConfigMapUpdateRequest) Call() (result interface{}, err error) {
	if r.service_ == nil {
		return nil, errors.New("service was empty")
	}
	result, err = r.service_.Update(r.ConfigMap)
	return result, err
}

func (r *ConfigMapUpdateRequest) GetId() string {
	return "v1.ConfigMap.Update"
}

func (r *ConfigMapDeleteRequest) SetService(service interface{}) error {
	var ok bool
	if r.service_, ok = service.(v1.ConfigMapInterface); !ok {
		return fmt.Errorf("invalid service type: %T, expected: v1.ConfigMapInterface", service)
	}
	return nil
}

func (r *ConfigMapDeleteRequest) Call() (result interface{}, err error) {
	if r.service_ == nil {
		return nil, errors.New("service was empty")
	}
	err = r.service_.Delete(r.Name, r.DeleteOptions)
	return result, err
}

func (r *ConfigMapDeleteRequest) GetId() string {
	return "v1.ConfigMap.Delete"
}

func (r *ConfigMapDeleteCollectionRequest) SetService(service interface{}) error {
	var ok bool
	if r.service_, ok = service.(v1.ConfigMapInterface); !ok {
		return fmt.Errorf("invalid service type: %T, expected: v1.ConfigMapInterface", service)
	}
	return nil
}

func (r *ConfigMapDeleteCollectionRequest) Call() (result interface{}, err error) {
	if r.service_ == nil {
		return nil, errors.New("service was empty")
	}
	err = r.service_.DeleteCollection(r.DeleteOptions, r.ListOptions)
	return result, err
}

func (r *ConfigMapDeleteCollectionRequest) GetId() string {
	return "v1.ConfigMap.DeleteCollection"
}

func (r *ConfigMapGetRequest) SetService(service interface{}) error {
	var ok bool
	if r.service_, ok = service.(v1.ConfigMapInterface); !ok {
		return fmt.Errorf("invalid service type: %T, expected: v1.ConfigMapInterface", service)
	}
	return nil
}

func (r *ConfigMapGetRequest) Call() (result interface{}, err error) {
	if r.service_ == nil {
		return nil, errors.New("service was empty")
	}
	result, err = r.service_.Get(r.Name, r.GetOptions)
	return result, err
}

func (r *ConfigMapGetRequest) GetId() string {
	return "v1.ConfigMap.Get"
}

func (r *ConfigMapListRequest) SetService(service interface{}) error {
	var ok bool
	if r.service_, ok = service.(v1.ConfigMapInterface); !ok {
		return fmt.Errorf("invalid service type: %T, expected: v1.ConfigMapInterface", service)
	}
	return nil
}

func (r *ConfigMapListRequest) Call() (result interface{}, err error) {
	if r.service_ == nil {
		return nil, errors.New("service was empty")
	}
	result, err = r.service_.List(r.ListOptions)
	return result, err
}

func (r *ConfigMapListRequest) GetId() string {
	return "v1.ConfigMap.List"
}

func (r *ConfigMapWatchRequest) SetService(service interface{}) error {
	var ok bool
	if r.service_, ok = service.(v1.ConfigMapInterface); !ok {
		return fmt.Errorf("invalid service type: %T, expected: v1.ConfigMapInterface", service)
	}
	return nil
}

func (r *ConfigMapWatchRequest) Call() (result interface{}, err error) {
	if r.service_ == nil {
		return nil, errors.New("service was empty")
	}
	result, err = r.service_.Watch(r.ListOptions)
	return result, err
}

func (r *ConfigMapWatchRequest) GetId() string {
	return "v1.ConfigMap.Watch"
}

func (r *ConfigMapPatchRequest) SetService(service interface{}) error {
	var ok bool
	if r.service_, ok = service.(v1.ConfigMapInterface); !ok {
		return fmt.Errorf("invalid service type: %T, expected: v1.ConfigMapInterface", service)
	}
	return nil
}

func (r *ConfigMapPatchRequest) Call() (result interface{}, err error) {
	if r.service_ == nil {
		return nil, errors.New("service was empty")
	}
	result, err = r.service_.Patch(r.Name, r.Pt, r.Data, r.Subresources...)
	return result, err
}

func (r *ConfigMapPatchRequest) GetId() string {
	return "v1.ConfigMap.Patch"
}


text:
using UnityEngine;
using System.Collections;

public class Popup : MonoBehaviour {

	public TextHelper popupText;
	Animator popupAnim;
	bool lockPopup = false;

	// Use this for initialization
	void Start () {

		popupAnim = GetComponent<Animator>();
		transform.localScale = new Vector3(0, 0, 0);

	}

	// Update is called once per frame
	void Update () {

	}

	public void doPopup(string inText) {

		transform.localScale = new Vector3(1, 1, 1);
		popupText.setNewText (inText);
		lockPopup = true;
		popupAnim.Play ("PopupAnim");

	}

	public void doPopdown() {

		if (!lockPopup) {
			popupText.stopTyping ();
			popupAnim.Play ("PopdownAnim");
		}

	}

	public void startTyping() {

		lockPopup = false;
		popupText.startTyping ();

	}

	public void killPopup() {

		transform.localScale = new Vector3(0, 0, 0);

	}

}


text:
// Provides class sap.ui.dt.plugin.DragDrop.
sap.ui.define([
	'sap/ui/dt/Plugin',
	'sap/ui/dt/DOMUtil'
],
function(Plugin, DOMUtil) {
	"use strict";

	/**
	 * Constructor for a new DragDrop.
	 *
	 * @param {string} [sId] id for the new object, generated automatically if no id is given
	 * @param {object} [mSettings] initial settings for the new object
	 *
	 * @class
	 * The DragDrop plugin is an abstract plugin to enable drag and drop functionallity of the Overlays
	 * This Plugin should be overriden by the D&D plugin implementations, the abstract functions should be ussed to performe actions
	 * @extends sap.ui.dt.plugin.Plugin
	 *
	 * @author SAP SE
	 * @version 1.32.10
	 *
	 * @constructor
	 * @private
	 * @since 1.30
	 * @alias sap.ui.dt.plugin.DragDrop
	 * @experimental Since 1.30. This class is experimental and provides only limited functionality. Also the API might be changed in future.
	 */
	var DragDrop = Plugin.extend("sap.ui.dt.plugin.DragDrop", /** @lends sap.ui.dt.plugin.DragDrop.prototype */ {
		metadata : {
			"abstract" : true,
			// ---- object ----

			// ---- control specific ----
			library : "sap.ui.dt",
			properties : {
			},
			associations : {
			},
			events : {
			}
		}
	});

	/*
	 * @private
	 */
	DragDrop.prototype.init = function() {
		Plugin.prototype.init.apply(this, arguments);

		this._oOverlayDelegate = {
			"onAfterRendering" : this._checkDraggable
		};
	};

	/**
	 * @override
	 * @param {sap.ui.dt.Overlay} an Overlay which should be registered
	 */
	DragDrop.prototype.registerOverlay = function(oOverlay) {
		oOverlay.addEventDelegate(this._oOverlayDelegate, this);

		oOverlay.attachEvent("draggableChange", this._onDraggableChange, this);

		if (oOverlay.isDraggable()) {
			this._attachDragEvents(oOverlay);
		}

		oOverlay.attachBrowserEvent("dragover", this._onDragOver, this);
		oOverlay.attachBrowserEvent("dragenter", this._onDragEnter, this);
	};

	/**
	 * @override
	 */
	DragDrop.prototype.registerAggregationOverlay = function(oAggregationOverlay) {
		oAggregationOverlay.attachDroppableChange(this._onAggregationDroppableChange, this);
	};

	/**
	 * @override
	 */
	DragDrop.prototype.deregisterOverlay = function(oOverlay) {
		oOverlay.removeEventDelegate(this._oOverlayDelegate, this);

		oOverlay.detachEvent("draggableChange", this._onDraggableChange, this);

		this._detachDragEvents(oOverlay);

		oOverlay.detachBrowserEvent("dragover", this._onDragOver, this);
		oOverlay.detachBrowserEvent("dragenter", this._onDragEnter, this);

	};

	/**
	 * @override
	 */
	DragDrop.prototype.deregisterAggregationOverlay = function(oAggregationOverlay) {
		oAggregationOverlay.detachDroppableChange(this._onAggregationDroppableChange, this);
	};

	/**
	 * @private
	 * @param {sap.ui.dt.Overlay} an Overlay to attach events to
	 */
	DragDrop.prototype._attachDragEvents = function(oOverlay) {
		oOverlay.attachBrowserEvent("dragstart", this._onDragStart, this);
		oOverlay.attachBrowserEvent("drag", this._onDrag, this);
		oOverlay.attachBrowserEvent("dragend", this._onDragEnd, this);
	};

	/**
	 * @private
	 * @param {sap.ui.dt.Overlay} an Overlay to detach events from
	 */
	DragDrop.prototype._detachDragEvents = function(oOverlay) {
		oOverlay.detachBrowserEvent("dragstart", this._onDragStart, this);
		oOverlay.detachBrowserEvent("dragend", this._onDragEnd, this);
		oOverlay.detachBrowserEvent("drag", this._onDrag, this);
	};

	/**
	 * @protected
	 */
	DragDrop.prototype.onDraggableChange = function(oEvent) { };

	/**
	 * @protected
	 */
	DragDrop.prototype.onDragStart = function(oDraggedOverlay, oEvent) { };

	/**
	 * @protected
	 */
	DragDrop.prototype.onDragEnd = function(oDraggedOverlay, oEvent) { };

	/**
	 * @protected
	 */
	DragDrop.prototype.onDrag = function(oDraggedOverlay, oEvent) { };

	/**
	 * @return {boolean} return true to omit event.preventDefault
	 * @protected
	 */
	DragDrop.prototype.onDragEnter = function(oOverlay, oEvent) { };

	/**
	 * @return {boolean} return true to omit event.preventDefault
	 * @protected
	 */
	DragDrop.prototype.onDragOver = function(oOverlay, oEvent) { };

	/**
	 * @protected
	 */
	DragDrop.prototype.onAggregationDragEnter = function(oAggregationOverlay, oEvent) { };

	/**
	 * @protected
	 */
	DragDrop.prototype.onAggregationDragOver = function(oAggregationOverlay, oEvent) { };

	/**
	 * @protected
	 */
	DragDrop.prototype.onAggregationDragLeave = function(oAggregationOverlay, oEvent) { };

	/**
	 * @protected
	 */
	DragDrop.prototype.onAggregationDrop = function(oAggregationOverlay, oEvent) { };

	/**
	 * @private
	 */
	DragDrop.prototype._checkDraggable = function(oEvent) {
		var oOverlay = oEvent.srcControl;
		if (oOverlay.isDraggable()) {
			DOMUtil.setDraggable(oOverlay.$(), true);
		}
	};

	/**
	 * @private
	 */
	DragDrop.prototype._onDraggableChange = function(oEvent) {
		var oOverlay = oEvent.getSource();
		if (oOverlay.isDraggable()) {
			this._attachDragEvents(oOverlay);
		} else {
			this._detachDragEvents(oOverlay);
		}

		this.onDraggableChange(oOverlay, oEvent);
	};
	/**
	 * @private
	 */
	DragDrop.prototype._onDragStart = function(oEvent) {
		var oOverlay = sap.ui.getCore().byId(oEvent.currentTarget.id);
		this._oDraggedOverlay = oOverlay;

		oEvent.stopPropagation();

		// Fix for Firfox - Firefox only fires drag events when data is set
		if (sap.ui.Device.browser.firefox && oEvent && oEvent.originalEvent && oEvent.originalEvent.dataTransfer && oEvent.originalEvent.dataTransfer.setData) {
			oEvent.originalEvent.dataTransfer.setData('text/plain', '');
		}

		this.showGhost(oOverlay, oEvent);
		this.onDragStart(oOverlay, oEvent);
	};

	/**
	 * @protected
	 */
	DragDrop.prototype.showGhost = function(oOverlay, oEvent) {
		var that = this;

		// not supported in IE10+
		if (oEvent && oEvent.originalEvent && oEvent.originalEvent.dataTransfer && oEvent.originalEvent.dataTransfer.setDragImage) {
			this._$ghost = this.createGhost(oOverlay, oEvent);

			// ghost should be visible to set it as dragImage
			this._$ghost.appendTo("body");
			// if ghost will be removed without timeout, setDragImage won't work
			setTimeout(function() {
				that._removeGhost();
			}, 0);
			oEvent.originalEvent.dataTransfer.setDragImage(
				this._$ghost.get(0),
				oEvent.originalEvent.pageX - this.getDraggedOverlay().$().offset().left,
				oEvent.originalEvent.pageY - this.getDraggedOverlay().$().offset().top
			);
		}
	};

	/**
	 * @private
	 */
	DragDrop.prototype._removeGhost = function() {
		this.removeGhost();
		delete this._$ghost;
	};

	/**
	 * @protected
	 */
	DragDrop.prototype.removeGhost = function() {
		var $ghost = this.getGhost();
		if ($ghost) {
			$ghost.remove();
		}
	};

	/**
	 * @protected
	 */
	DragDrop.prototype.createGhost = function(oOverlay) {
		var oGhostDom = oOverlay.getAssociatedDomRef();
		var $ghost;
		if (!oGhostDom) {
			oGhostDom = this._getAssociatedDomCopy(oOverlay);
			$ghost = jQuery(oGhostDom);
		} else {
			$ghost = jQuery("

");
			DOMUtil.cloneDOMAndStyles(oGhostDom, $ghost);
		}

		var $ghostWrapper = jQuery("

").addClass("sapUiDtDragGhostWrapper");
		return $ghostWrapper.append($ghost.addClass("sapUiDtDragGhost"));
	};

	/**
	 * @private
	 */
	DragDrop.prototype._getAssociatedDomCopy = function(oOverlay) {
		var that = this;

		var $DomCopy = jQuery("

");

		oOverlay.getAggregationOverlays().forEach(function(oAggregationOverlay) {
			oAggregationOverlay.getChildren().forEach(function(oChildOverlay) {
				var oChildDom = oChildOverlay.getAssociatedDomRef();
				if (oChildDom) {
					DOMUtil.cloneDOMAndStyles(oChildDom, $DomCopy);
				} else {
					DOMUtil.cloneDOMAndStyles(that._getAssociatedDomCopy(oChildOverlay), $DomCopy);
				}
			});
		});

		return $DomCopy.get(0);
	};

	/**
	 * @protected
	 * @return {jQuery} jQuery object drag ghost
	 */
	DragDrop.prototype.getGhost = function() {
		return this._$ghost;
	};

	/**
	 * returns the dragged overlay (only during drag&drop)
	 * @public
	 * @return {sap.ui.dt.Overlay} overlays which is dragged
	 */
	DragDrop.prototype.getDraggedOverlay = function() {
		return this._oDraggedOverlay;
	};

	/**
	 * @private
	 */
	DragDrop.prototype._onDragEnd = function(oEvent) {
		var oOverlay = sap.ui.getCore().byId(oEvent.currentTarget.id);
		this._removeGhost();

		this.onDragEnd(oOverlay, oEvent);

		delete this._oDraggedOverlay;
		oEvent.stopPropagation();
	};

	/**
	 * @private
	 */
	DragDrop.prototype._onDrag = function(oEvent) {
		var oOverlay = sap.ui.getCore().byId(oEvent.currentTarget.id);

		this.onDrag(oOverlay, oEvent);

		oEvent.stopPropagation();
	};

	/**
	 * @private
	 */
	DragDrop.prototype._onDragEnter = function(oEvent) {
		var oOverlay = sap.ui.getCore().byId(oEvent.currentTarget.id);
		var oAggregationOverlay = oOverlay.getParent();
		var bInDroppableAggregation = oAggregationOverlay && oAggregationOverlay.isDroppable && oAggregationOverlay.isDroppable();
		if (bInDroppableAggregation) {
			//if "true" returned, propagation won't be canceled
			if (!this.onDragEnter(oOverlay, oEvent)) {
				oEvent.stopPropagation();
			}
		}

		oEvent.preventDefault();
	};

	/**
	 * @private
	 */
	DragDrop.prototype._onDragOver = function(oEvent) {
		var oOverlay = sap.ui.getCore().byId(oEvent.currentTarget.id);
		var oAggregationOverlay = oOverlay.getParent();
		var bInDroppableAggregation = oAggregationOverlay && oAggregationOverlay.isDroppable && oAggregationOverlay.isDroppable();
		if (bInDroppableAggregation) {
			//if "true" returned, propagation won't be canceled
			if (!this.onDragOver(oOverlay, oEvent)) {
				oEvent.stopPropagation();
			}
		}

		oEvent.preventDefault();
	};

	/**
	 * @private
	 */
	DragDrop.prototype._onAggregationDroppableChange = function(oEvent) {
		var oAggregationOverlay = oEvent.getSource();
		var bDroppable = oEvent.getParameter("droppable");

		if (bDroppable) {
			this._attachAggregationOverlayEvents(oAggregationOverlay);
		} else {
			this._detachAggregationOverlayEvents(oAggregationOverlay);
		}

	};

	/**
	 * @private
	 */
	DragDrop.prototype._attachAggregationOverlayEvents = function(oAggregationOverlay) {

		oAggregationOverlay.attachBrowserEvent("dragenter", this._onAggregationDragEnter, this);
		oAggregationOverlay.attachBrowserEvent("dragover", this._onAggregationDragOver, this);
		oAggregationOverlay.attachBrowserEvent("dragleave", this._onAggregationDragLeave, this);
		oAggregationOverlay.attachBrowserEvent("drop", this._onAggregationDrop, this);
	};

	/**
	 * @private
	 */
	DragDrop.prototype._detachAggregationOverlayEvents = function(oAggregationOverlay) {
		oAggregationOverlay.detachBrowserEvent("dragenter", this._onAggregationDragEnter, this);
		oAggregationOverlay.detachBrowserEvent("dragover", this._onAggregationDragOver, this);
		oAggregationOverlay.detachBrowserEvent("dragleave", this._onAggregationDragLeave, this);
		oAggregationOverlay.detachBrowserEvent("drop", this._onAggregationDrop, this);
	};

	/**
	 * @private
	 */
	DragDrop.prototype._onAggregationDragEnter = function(oEvent) {
		var oAggregationOverlay = sap.ui.getCore().byId(oEvent.currentTarget.id);
		this.onAggregationDragEnter(oAggregationOverlay, oEvent);

		oEvent.preventDefault();
		oEvent.stopPropagation();
	};

	/**
	 * @private
	 */
	DragDrop.prototype._onAggregationDragOver = function(oEvent) {
		var oAggregationOverlay = sap.ui.getCore().byId(oEvent.currentTarget.id);
		this.onAggregationDragOver(oAggregationOverlay, oEvent);

		oEvent.preventDefault();
		oEvent.stopPropagation();
	};

	/**
	 * @private
	 */
	DragDrop.prototype._onAggregationDragLeave = function(oEvent) {
		var oAggregationOverlay = sap.ui.getCore().byId(oEvent.currentTarget.id);
		this.onAggregationDragLeave(oAggregationOverlay, oEvent);

		oEvent.preventDefault();
		oEvent.stopPropagation();
	};

	/**
	 * @private
	 */
	DragDrop.prototype._onAggregationDrop = function(oEvent) {
		var oAggregationOverlay = sap.ui.getCore().byId(oEvent.currentTarget.id);
		this.onAggregationDrop(oAggregationOverlay, oEvent);

		oEvent.stopPropagation();
	};

	return DragDrop;
}, /* bExport= */ true);


text:
<?php

namespace Consoles;

use Zend\Filter\StaticFilter;

/**
 * Class Consoles
 * @package Consoles
 */
class Consoles
{
    /**
     * @var int
     */
    protected $consoleId;

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

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

    /**
     * @var
     */
    protected $image;

    /**
     * @var int
     */
    protected $gameCount = 0;

    /**
     * @param array $data
     */
    public function __construct(array $data = [])
    {
        if (!empty($data)) {
            $this->exchangeArray($data);
        }
    }

    /**
     * @param array $data
     */
    public function exchangeArray($data)
    {
        $defaults = [
            'console_id'   => null,
            'account_id'   => null,
            'console_name' => null,
            'image' => null,
            'game_count'   => 0
        ];

        $data = array_merge($defaults, $data);

        foreach ($data as $key => $value) {
            $method = 'set' . ucfirst(StaticFilter::execute($key, 'Word\UnderscoreToCamelCase'));
            if (method_exists($this, $method)) {
                $this->{$method}($value);
            }
        }
    }

    /**
     * @return array
     */
    public function getArrayCopy()
    {
        return [
            'console_id'   => (string) $this->getConsoleId(),
            'account_id'   => $this->getAccountId(),
            'console_name' => $this->getConsoleName(),
            'image'        => $this->getImage(),
            'game_count'   => $this->getGameCount()
        ];
    }

    /**
     * @return string
     */
    public function getConsoleId()
    {
        return $this->consoleId;
    }

    /**
     * @param string $consoleId
     * @return $this
     */
    public function setConsoleId($consoleId = null)
    {
        if ($this->consoleId === null) {
            $this->consoleId = $consoleId;
        }

        return $this;
    }

    /**
     * @return mixed
     */
    public function getAccountId()
    {
        return $this->accountId;
    }

    /**
     * @param $accountData
     */
    public function setAccountId($accountData)
    {
        $this->accountId = $accountData;
    }

    /**
     * @return mixed
     */
    public function getConsoleName()
    {
        return $this->consoleName;
    }

    /**
     * @param mixed $consoleName
     */
    public function setConsoleName($consoleName)
    {
        $this->consoleName = $consoleName;
    }

    /**
     * @return mixed
     */
    public function getImage()
    {
        return $this->image;
    }

    /**
     * @param mixed $image
     */
    public function setImage($image)
    {
        $this->image = $image;
    }

    /**
     * @return boolean
     */
    public function isActive()
    {
        return $this->isActive;
    }

    /**
     * @param boolean $isActive
     */
    public function setIsActive($isActive)
    {
        $this->isActive = $isActive;
    }

    /**
     * @return int
     */
    public function getGameCount()
    {
        return $this->gameCount;
    }

    /**
     * @param int $gameCount
     */
    public function setGameCount($gameCount)
    {
        $this->gameCount = $gameCount;
    }
}


text:
#include "libbtc-config.h"

#include <btc/chainparams.h>
#include <btc/ecc.h>
#include <btc/net.h>
#include <btc/netspv.h>
#include <btc/protocol.h>
#include <btc/random.h>
#include <btc/serialize.h>
#include <btc/tool.h>
#include <btc/tx.h>
#include <btc/utils.h>
#include <btc/wallet.h>

#include <assert.h>
#include <getopt.h>
#include <inttypes.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>

static struct option long_options[] =
    {
        {"testnet", no_argument, NULL, 't'},
        {"regtest", no_argument, NULL, 'r'},
        {"ips", no_argument, NULL, 'i'},
        {"debug", no_argument, NULL, 'd'},
        {"maxnodes", no_argument, NULL, 'm'},
        {"dbfile", no_argument, NULL, 'f'},
        {"continuous", no_argument, NULL, 'c'},
        {NULL, 0, NULL, 0}};

static void print_version()
{
    printf("Version: %s %s\n", PACKAGE_NAME, PACKAGE_VERSION);
}

static void print_usage()
{
    print_version();
    printf("Usage: bitcoin-spv (-c|continuous) (-i|-ips <ip,ip,...]>) (-m[--maxpeers] <int>) (-t[--testnet]) (-f <headersfile|0 for in mem only>) (-r[--regtest]) (-d[--debug]) (-s[--timeout] <secs>) <command>\n");
    printf("Supported commands:\n");
    printf("        scan      (scan blocks up to the tip, creates header.db file)\n");
    printf("\nExamples: \n");
    printf("Sync up to the chain tip and stores all headers in headers.db (quit once synced):\n");
    printf("> bitcoin-spv scan\n\n");
    printf("Sync up to the chain tip and give some debug output during that process:\n");
    printf("> bitcoin-spv -d scan\n\n");
    printf("Sync up, show debug info, don't store headers in file (only in memory), wait for new blocks:\n");
    printf("> bitcoin-spv -d -f 0 -c scan\n\n");
}

static bool showError(const char* er)
{
    printf("Error: %s\n", er);
    return 1;
}

btc_bool spv_header_message_processed(struct btc_spv_client_ *client, btc_node *node, btc_blockindex *newtip) {
    UNUSED(client);
    UNUSED(node);
    if (newtip) {
        printf("New headers tip height %d\n", newtip->height);
    }
    return true;
}

static btc_bool quit_when_synced = true;
void spv_sync_completed(btc_spv_client* client) {
    printf("Sync completed, at height %d\n", client->headers_db->getchaintip(client->headers_db_ctx)->height);
    if (quit_when_synced) {
        btc_node_group_shutdown(client->nodegroup);
    }
    else {
        printf("Waiting for new blocks or relevant transactions...\n");
    }
}

int main(int argc, char* argv[])
{
    int ret = 0;
    int long_index = 0;
    int opt = 0;
    char* data = 0;
    char* ips = 0;
    btc_bool debug = false;
    int timeout = 15;
    int maxnodes = 10;
    char* dbfile = 0;
    const btc_chainparams* chain = &btc_chainparams_main;

    if (argc <= 1 || strlen(argv[argc - 1]) == 0 || argv[argc - 1][0] == '-') {
        /* exit if no command was provided */
        print_usage();
        exit(EXIT_FAILURE);
    }
    data = argv[argc - 1];

    /* get arguments */
    while ((opt = getopt_long_only(argc, argv, "i:ctrds:m:f:", long_options, &long_index)) != -1) {
        switch (opt) {
        case 'c':
            quit_when_synced = false;
            break;
        case 't':
            chain = &btc_chainparams_test;
            break;
        case 'r':
            chain = &btc_chainparams_regtest;
            break;
        case 'd':
            debug = true;
            break;
        case 's':
            timeout = (int)strtol(optarg, (char**)NULL, 10);
            break;
        case 'i':
            ips = optarg;
            break;
        case 'm':
            maxnodes = (int)strtol(optarg, (char**)NULL, 10);
            break;
        case 'f':
            dbfile = optarg;
            break;
        case 'v':
            print_version();
            exit(EXIT_SUCCESS);
            break;
        default:
            print_usage();
            exit(EXIT_FAILURE);
        }
    }

    if (strcmp(data, "scan") == 0) {
        btc_ecc_start();
        btc_wallet *wallet = btc_wallet_new(chain);
        int error;
        btc_bool created;
        int res = btc_wallet_load(wallet, "wallet.db", &error, &created);
        if (!res) {
            fprintf(stdout, "Loading wallet failed\n");
            exit(EXIT_FAILURE);
        }
        if (created) {
            // create a new key

            btc_hdnode node;
            uint8_t seed[32];
            assert(btc_random_bytes(seed, sizeof(seed), true));
            btc_hdnode_from_seed(seed, sizeof(seed), &node);
            btc_wallet_set_master_key_copy(wallet, &node);
        }
        else {
            // ensure we have a key
            // TODO
        }

        btc_wallet_hdnode* node = btc_wallet_next_key(wallet);
        size_t strsize = 128;
        char str[strsize];
        btc_hdnode_get_p2pkh_address(node->hdnode, chain, str, strsize);
        printf("Wallet addr: %s (child %d)\n", str, node->hdnode->child_num);

        vector *addrs = vector_new(1, free);
        btc_wallet_get_addresses(wallet, addrs);
        for (unsigned int i = 0; i < addrs->len; i++) {
            char* addr= vector_idx(addrs, i);
            printf("Addr: %s\n", addr);
        }
        vector_free(addrs, true);
        btc_spv_client* client = btc_spv_client_new(chain, debug, (dbfile && (dbfile[0] == '0' || (strlen(dbfile) > 1 && dbfile[0] == 'n' && dbfile[0] == 'o'))) ? true : false);
        client->header_message_processed = spv_header_message_processed;
        client->sync_completed = spv_sync_completed;
        client->sync_transaction = btc_wallet_check_transaction;
        client->sync_transaction_ctx = wallet;
        if (!btc_spv_client_load(client, (dbfile ? dbfile : "headers.db"))) {
            printf("Could not load or create headers database...aborting\n");
            ret = EXIT_FAILURE;
        }
        else {
            printf("Discover peers...");
            btc_spv_client_discover_peers(client, ips);
            printf("done\n");
            printf("Connecting to the p2p network...\n");
            btc_spv_client_runloop(client);
            btc_spv_client_free(client);
            ret = EXIT_SUCCESS;
        }
        btc_ecc_stop();
    }
    else {
        printf("Invalid command (use -?)\n");
        ret = EXIT_FAILURE;
    }
    return ret;
}


text:
require "gesund"
require "gesund/mongoid/version"
require "gesund/checks/mongoid_connection"

module Gesund
  module Mongoid
    # Your code goes here...
  end
end


text:
S V U I   By: Munglunch
##############################################################################
--]]
--[[ GLOBALS ]]--
local _G = _G;
local unpack  = _G.unpack;
local select  = _G.select;
--[[ ADDON ]]--
local SV = _G['SVUI'];
local L = SV.L;
local MOD = SV.Skins;
local Schema = MOD.Schema;
--[[
##########################################################
BATTLEFIELD MODR
##########################################################
]]--
local function BattlefieldStyle()
	if SV.db.Skins.blizzard.enable~=true or SV.db.Skins.blizzard.bgmap~=true then return end
	BattlefieldMinimap:SetClampedToScreen(true)
	BattlefieldMinimapCorner:Die()
	BattlefieldMinimapBackground:Die()
	BattlefieldMinimapTab:Die()
	BattlefieldMinimapTabLeft:Die()
	BattlefieldMinimapTabMiddle:Die()
	BattlefieldMinimapTabRight:Die()
	BattlefieldMinimap:SetStyle("!_Frame", "Transparent")
	BattlefieldMinimap.Panel:SetPoint("BOTTOMRIGHT", -4, 2)
	BattlefieldMinimap:SetFrameStrata("LOW")
	BattlefieldMinimapCloseButton:ClearAllPoints()
	BattlefieldMinimapCloseButton:SetPoint("TOPRIGHT", -4, 0)
	SV.API:Set("CloseButton", BattlefieldMinimapCloseButton)
	BattlefieldMinimapCloseButton:SetFrameStrata("MEDIUM")
	BattlefieldMinimap:EnableMouse(true)
	BattlefieldMinimap:SetMovable(true)
	BattlefieldMinimap:SetScript("OnMouseUp", function(f, g)
		if g == "LeftButton"then
			BattlefieldMinimapTab:StopMovingOrSizing()BattlefieldMinimapTab:SetUserPlaced(true)
			if OpacityFrame:IsShown()then
				OpacityFrame:Hide()
			end
		elseif g == "RightButton"then
			ToggleDropDownMenu(1, nil, BattlefieldMinimapTabDropDown, f:GetName(), 0, -4)
			if OpacityFrame:IsShown()then
				OpacityFrame:Hide()
			end
		end
	end)
	BattlefieldMinimap:SetScript("OnMouseDown", function(f, g)
		if g == "LeftButton"then
			if BattlefieldMinimapOptions and BattlefieldMinimapOptions.locked then
				return
			else
				BattlefieldMinimapTab:StartMoving()
			end
		end
	end)
	hooksecurefunc("BattlefieldMinimap_UpdateOpacity", function(opacity)
		local h = 1.0-BattlefieldMinimapOptions.opacity or 0;
		BattlefieldMinimap.Panel:SetAlpha(h)
	end)
	local i;
	BattlefieldMinimap:HookScript("OnEnter", function()
		i = BattlefieldMinimapOptions.opacity or 0;
		BattlefieldMinimap_UpdateOpacity(0)
	end)
	BattlefieldMinimap:HookScript("OnLeave", function()
		if i then
			BattlefieldMinimap_UpdateOpacity(i)i = nil
		end
	end)
	BattlefieldMinimapCloseButton:HookScript("OnEnter", function()
		i = BattlefieldMinimapOptions.opacity or 0;
		BattlefieldMinimap_UpdateOpacity(0)
	end)
	BattlefieldMinimapCloseButton:HookScript("OnLeave", function()
		if i then
			BattlefieldMinimap_UpdateOpacity(i)i = nil
		end
	end)
end
--[[
##########################################################
MOD LOADING
##########################################################
]]--
MOD:SaveBlizzardStyle("Blizzard_BattlefieldMinimap",BattlefieldStyle)


text:
package com.github.btrekkie.graph.ec;

import com.github.btrekkie.graph.Vertex;

/**
 * A crossing added between two edges in a planar graph.  This is for the crossing vertices added in
 * PlanarEmbeddingWithCrossings.graph.
 */
class Crossing {
    /**
     * The vertex adjacent to the crossing vertex that is distinct from "start2" and "end2" and "across" from "end1",
     * i.e. that resides on a path corresponding to an edge in the input graph that contains "end1".
     */
    public Vertex start1;

    /**
     * The vertex adjacent to the crossing vertex that is distinct from "start2" and "end2" and "across" from "start1",
     * i.e. that resides on a path corresponding to an edge in the input graph that contains "start1".
     */
    public Vertex end1;

    /**
     * The vertex adjacent to the crossing vertex that is distinct from "start1" and "end1" and "across" from "end2",
     * i.e. that resides on a path corresponding to an edge in the input graph that contains "end2".
     */
    public Vertex start2;

    /**
     * The vertex adjacent to the crossing vertex that is distinct from "start1" and "end1" and "across" from "start2",
     * i.e. that resides on a path corresponding to an edge in the input graph that contains "start2".
     */
    public Vertex end2;

    public Crossing(Vertex start1, Vertex end1, Vertex start2, Vertex end2) {
        this.start1 = start1;
        this.end1 = end1;
        this.start2 = start2;
        this.end2 = end2;
    }
}


text:
package com.uphold.uphold_android_sdk.test.unit.util;

import com.uphold.uphold_android_sdk.util.Header;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;

import android.util.Base64;

/**
 * Header unit tests.
 */

@RunWith(PowerMockRunner.class)
@PrepareForTest(Base64.class)
public class HeaderTest {

    @Test
    public void encodeCredentialsForBasicAuthorizationShouldCallEncodeToString() {
        final String user = "foo@bar.org";
        final String password = "foobar";
        final String userAndPassword = user + ":" + password;

        PowerMockito.mockStatic(Base64.class);

        Header.encodeCredentialsForBasicAuthorization(user, password);

        PowerMockito.verifyStatic();
        Base64.encodeToString(userAndPassword.getBytes(), Base64.NO_WRAP);
    }

}


text:
mod foo {} //~ ERROR only functions may be used as tests

fn main() {}


text:
using System;
using System.Linq;

namespace Microsoft.WindowsAzure.Management.Storage.Models
{
    /// <summary>
    /// Specifies whether the account supports locally-redundant storage,
    /// geo-redundant storage, zone-redundant storage, or read access
    /// geo-redundant storage. Possible values are:'Standard_LRS',
    /// 'Standard_ZRS', 'Standard_GRS', and 'Standard_RAGRS'.
    /// </summary>
    public static partial class StorageAccountTypes
    {
        public const string StandardLRS = "Standard_LRS";

        public const string StandardZRS = "Standard_ZRS";

        public const string StandardGRS = "Standard_GRS";

        public const string StandardRAGRS = "Standard_RAGRS";
    }
}


text:
$(function() {

    if (Cookies.get('popup') === undefined && (/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent) == false) && $( window ).width() > 768) {
        Cookies.set('popup', 'true');
        $('#modalwelcome').modal('show');
    }
});


text:
<?php

namespace HippoPHP\Tokenizer;

use Countable;
use HippoPHP\Tokenizer\Exception\InvalidArgumentException;
use HippoPHP\Tokenizer\Exception\OutOfBoundsException;
use SeekableIterator;

class TokenListIterator implements SeekableIterator, Countable
{
    const DIR_FORWARD = 0;
    const DIR_BACKWARD = 1;

    /**
     * @var int
     */
    private $position = 0;

    /**
     * @var null|\HippoPHP\Tokenizer\Token[]
     */
    private $tokens = null;

    /**
     * @param \HippoPHP\Tokenizer\Token[] $tokenList
     */
    public function __construct(array $tokens = [])
    {
        $this->tokens = $tokens;
    }

    /**
     * Tries to go to a position in the stack.
     *
     * @param int $position
     *
     * @return void
     */
    public function seek($position)
    {
        if (!isset($this->tokens[$position])) {
            throw $this->getOutOfBoundsException($position);
        }

        $this->position = $position;
    }

    /**
     * @param \HippoPHP\Tokenizer\Token[] $tokens
     */
    public function setTokens(array $tokens)
    {
        $this->tokens = $tokens;
    }

    /**
     * @return \HippoPHP\Tokenizer\Token[] $tokens
     */
    public function getTokens()
    {
        return $this->tokens;
    }

    /**
     * @param mixed $tokenTypes
     * @param int   $direction  DIR_BACKWARD or DIR_FORWARD
     *
     * @return mixed
     */
    public function seekToType($tokenTypes, $direction = self::DIR_FORWARD)
    {
        return $this->safeMove(function () use ($tokenTypes, $direction) {
            $this->move($direction);

            $this->moveWithCondition(function () use ($tokenTypes) {
                return !$this->current()->isType($tokenTypes);
            }, $direction);

            return $this;
        });
    }

    /**
     * Traverse the token tree passing any ignored types.
     *
     * @param array $tokenTypes
     * @param int   $direction
     *
     * @return mixed
     */
    public function skipTypes($tokenTypes, $direction = self::DIR_FORWARD)
    {
        return $this->safeMove(function () use ($tokenTypes, $direction) {
            $this->moveWithCondition(function () use ($tokenTypes) {
                return in_array($this->current()->getType(), $tokenTypes);
            }, $direction);

            return $this;
        });
    }

    /**
     * Skips to the next non-whitespace token.
     *
     * @param int $direction
     *
     * @return mixed
     */
    public function skipToNextNonWhitespace($direction = self::DIR_FORWARD)
    {
        return $this->safeMove(function () use ($direction) {
            $this->moveWithCondition(function () {
                return $this->current()->getType() !== T_WHITESPACE;
            }, $direction);

            return $this;
        })->next();
    }

    /**
     * Returns the current position.
     *
     * @return int
     */
    public function key()
    {
        return $this->position;
    }

    /**
     * Sets the next position.
     *
     * @param int $places
     *
     * @return TokenListIterator
     */
    public function &next($places = 1)
    {
        $this->position += max(0, $places);

        return $this;
    }

    /**
     * Goes back a position.
     *
     * @param int $places
     *
     * @return TokenListIterator
     */
    public function &prev($places = 1)
    {
        $this->position -= max(0, $places);

        return $this;
    }

    /**
     * Returns the current token in the stack.
     *
     * @return \HippoPHP\Tokenizer\Token
     */
    public function current()
    {
        if (!isset($this->tokens[$this->position])) {
            throw $this->getOutOfBoundsException();
        }

        return $this->tokens[$this->position];
    }

    /**
     * Resets the position of the token stack.
     *
     * @return TokenListIterator
     */
    public function &rewind()
    {
        $this->position = 0;

        return $this;
    }

    /**
     * Moves to the last token.
     *
     * @return TokenListIterator
     */
    public function &end()
    {
        $this->position = count($this->tokens) - 1;

        return $this;
    }

    /**
     * Checks that the token we're looking for does exist.
     *
     * @return bool
     */
    public function valid()
    {
        return $this->validAtPosition($this->position);
    }

    /**
     * How many tokens do we have?
     *
     * @return int
     */
    public function count()
    {
        return count($this->tokens);
    }

    /**
     * Checks that a position is valid at a given point.
     *
     * @param int $positon
     *
     * @return bool
     */
    private function validAtPosition($positon)
    {
        return isset($this->tokens[$positon]);
    }

    /**
     * Moves the positon based on a direction, until the given condition is fulfilled.
     *
     * @param callable $condition
     * @param int      $direction
     *
     * @return void
     */
    private function moveWithCondition(callable $condition, $direction = self::DIR_FORWARD)
    {
        while ($condition()) {
            $this->move($direction);

            if (!$this->valid()) {
                throw $this->getOutOfBoundsException();
            }
        }

        return $this;
    }

    /**
     * Moves the positon based on a direction.
     *
     * @param int $direction
     *
     * @return void
     */
    public function move($direction)
    {
        if ($direction === self::DIR_FORWARD) {
            return $this->next();
        } elseif ($direction === self::DIR_BACKWARD) {
            return $this->prev();
        }

        throw new InvalidArgumentException(sprintf('Unknown direction %s', $direction));
    }

    /**
     * Returns OutOfBoundsException based on current position within the iterator.
     *
     * @param int|null $position
     *
     * @return \HippoPHP\Tokenizer\Exception\OutOfBoundsException
     */
    private function getOutOfBoundsException($position = null)
    {
        return new OutOfBoundsException(
            sprintf('Invalid token position (%d)', $position !== null ? $position : $this->position)
        );
    }

    /**
     * Restores previous position if OutOfBounds error occurs.
     *
     * @param callable $moveAction
     *
     * @return mixed
     */
    private function safeMove(callable $moveAction)
    {
        $oldPosition = $this->position;

        try {
            return $moveAction();
        } catch (OutOfBoundsException $e) {
            $this->position = $oldPosition;

            throw $e;
        }
    }
}


text:
 *
 *  BlueZ - Bluetooth protocol stack for Linux
 *
 *  Copyright (C) 2011  Nokia Corporation
 *
 *