text:
//C-  -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.
//C- Copyright (c) 2001  AT&T
//C-
//C- This software is subject to, and may be distributed under, the
//C- GNU General Public License, either Version 2 of the license,
//C- or (at your option) any later version. The license should have
//C- accompanied the software or you may obtain a copy of the license
//C- from the Free Software Foundation at http://www.fsf.org .
//C-
//C- This program is distributed in the hope that it will be useful,
//C- but WITHOUT ANY WARRANTY; without even the implied warranty of
//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//C- GNU General Public License for more details.
//C-
//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
//C- Lizardtech Software.  Lizardtech Software has authorized us to
//C- replace the original DjVu(r) Reference Library notice by the following
//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
//C-
//C-  ------------------------------------------------------------------
//C- | DjVu (r) Reference Library (v. 3.5)
//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.
//C- | The DjVu Reference Library is protected by U.S. Pat. No.
//C- | 6,058,214 and patents pending.
//C- |
//C- | This software is subject to, and may be distributed under, the
//C- | GNU General Public License, either Version 2 of the license,
//C- | or (at your option) any later version. The license should have
//C- | accompanied the software or you may obtain a copy of the license
//C- | from the Free Software Foundation at http://www.fsf.org .
//C- |
//C- | The computer code originally released by LizardTech under this
//C- | license and unmodified by other parties is deemed "the LIZARDTECH
//C- | ORIGINAL CODE."  Subject to any third party intellectual property
//C- | claims, LizardTech grants recipient a worldwide, royalty-free,
//C- | non-exclusive license to make, use, sell, or otherwise dispose of
//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the
//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU
//C- | General Public License.   This grant only confers the right to
//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to
//C- | the extent such infringement is reasonably necessary to enable
//C- | recipient to make, have made, practice, sell, or otherwise dispose
//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to
//C- | any greater extent that may be necessary to utilize further
//C- | modifications or combinations.
//C- |
//C- | The LIZARDTECH ORIGINAL CODE is provided "AS IS" WITHOUT WARRANTY
//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF
//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
//C- +------------------------------------------------------------------

#ifndef _DJVUERRORLIST_H
#define _DJVUERRORLIST_H
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#if NEED_GNUG_PRAGMAS
# pragma interface
#endif

#include "DjVuPort.h"

#ifdef HAVE_NAMESPACES
namespace DJVU {
# ifdef NOT_DEFINED // Just to fool emacs c++ mode
}
#endif
#endif

class ByteStream;

/** @name DjVuErrorList.h
    This file implements a very simple class for redirecting port caster
    messages that would normally end up on stderr to a double linked list.

    @memo DjVuErrorList class.
    @author Bill C Riemers <docbill@sourceforge.net>
*/

//@{

/** #DjVuErrorList# provides a convenient way to redirect error messages
    from classes derived from DjVuPort to a list that can be accessed at
    any time. */

class DjVuErrorList : public DjVuSimplePort
{
protected:
     /// The normal port caster constructor.
  DjVuErrorList(void);
public:
  static GP<DjVuErrorList> create(void) {return new DjVuErrorList();}

     /// This constructor allows the user to specify the ByteStream.
  GURL set_stream(GP<ByteStream>);

     /// Append all error messages to the list
  virtual bool notify_error(const DjVuPort * source, const GUTF8String & msg);

     /// Append all status messages to the list
  virtual bool notify_status(const DjVuPort * source, const GUTF8String & msg);

     /// Add a new class to have its messages redirected here.
  inline void connect( const DjVuPort &port);

     /// Get the listing of errors, and clear the list.
  inline GList<GUTF8String> GetErrorList(void);

     /// Just clear the list.
  inline void ClearError(void);

     /// Get one error message and clear that message from the list.
  GUTF8String GetError(void);

     /// Check if there are anymore error messages.
  inline bool HasError(void) const;

     /// Get the listing of status messages, and clear the list.
  inline GList<GUTF8String> GetStatusList(void);

     /// Just clear the list.
  inline void ClearStatus(void);

     /// Get one status message and clear that message from the list.
  GUTF8String GetStatus(void);

     /// Check if there are any more status messages.
  inline bool HasStatus(void) const;

     /** This gets the data.  We can't use the simple port's request
       data since we want to allow the user to specify the ByteStream. */
  virtual GP<DataPool> request_data (
    const DjVuPort * source, const GURL & url );

private:
  GURL pool_url;
  GP<DataPool> pool;
  GList<GUTF8String> Errors;
  GList<GUTF8String> Status;
private: //dummy stuff
  static GURL set_stream(ByteStream *);
};

inline void
DjVuErrorList::connect( const DjVuPort &port )
{ get_portcaster()->add_route(&port, this); }

inline GList<GUTF8String>
DjVuErrorList::GetErrorList(void)
{
  GList<GUTF8String> retval=(const GList<GUTF8String>)Errors;
  Errors.empty();
  return retval;
}

inline void
DjVuErrorList::ClearError(void)
{ Errors.empty(); }

inline GList<GUTF8String>
DjVuErrorList::GetStatusList(void)
{
  GList<GUTF8String> retval=(const GList<GUTF8String>)Status;
  Status.empty();
  return retval;
}

inline void
DjVuErrorList::ClearStatus(void)
{ Status.empty(); }

inline bool
DjVuErrorList::HasError(void) const
{ return !Errors.isempty(); }

inline bool
DjVuErrorList::HasStatus(void) const
{ return !Status.isempty(); }

#ifdef HAVE_NAMESPACES
}
# ifndef NOT_USING_DJVU_NAMESPACE
using namespace DJVU;
# endif
#endif
#endif


text:
require 'rubygems'
require 'rails'

if Rails::VERSION::MAJOR.to_i >= 3
  require 'rails/all'
  require 'test/unit'

  require 'active_support'
  require 'active_support/railtie'
  require 'active_support/core_ext'
  require 'active_support/test_case'

  require 'action_controller'
  require 'action_controller/caching'
  require 'active_record'
  require 'active_record/base'

  require 'rails'
  require 'rails/application'

  require 'rails/railtie'

  #We need to load the whole Rails application to properly initialize Rails.cache and other constants.  Oh boy.
  #We're going to parse it out of RAILS_PATH/config.ru using a little metaprogramming magic.
  require ::File.expand_path('../../../../../config/environment',  __FILE__)
  lines = File.open(::File.expand_path('../../../../../config.ru',  __FILE__)).readlines.select {|a| a =~ /::Application/}
  application_name = lines.first[/[^ ]*::/].gsub(":", "")
  Kernel.const_get(application_name).const_get("Application").initialize!
else
  #Rails 2 testing
  require 'active_support'
  require 'active_support/test_case'
end

redpajama_set_name: RedPajamaGithub


text:
<?php
      include_once 'header.php';
 ?>

Sign up yeah

        <form class="signup-form" action="includes/signup.inc.php" method="POST">
            <input type="text" name="first" placeholder="Firstname">
            <input type="text" name="last" placeholder="Lastname">
            <input type="text" name="email" placeholder="E-mail">
            <input type="text" name="uid" placeholder="Username">
            <input type="password" name="pwd" placeholder="Password">
            <button type="submit" name="submit">Sign up</button>
        </form>

  <?php
        include_once 'footer.php';
   ?>


text:
metjs
=====

Javascript framework for weather data processing.


text:
package io.github.hamsters.jvm

import scala.concurrent.{ExecutionContext, Future, blocking}

object Retry {

  /**
    * Retry a function several times
    *
    * @param maxTries           number of retries
    * @param waitInMilliSeconds number of milliseconds to wait before retrying
    * @param errorFn            the function to run if it fails, to handle the error message
    * @param fn                 the function to run
    * @tparam T
    * @return Future result
    */
  def withWait[T](maxTries: Int, waitInMilliSeconds: Int, errorFn: String => Unit = _ => Unit)(fn: => T)
                 (implicit executionContext: ExecutionContext): Future[T] = {
    def retry(remainingTries: Int, waitInMilliSeconds: Int, errorFn: String => Unit)(fn: => T): Future[T] = {
      Future {
        if (remainingTries < maxTries) blocking(Thread.sleep(waitInMilliSeconds))
        fn
      }.recoverWith {
        case _ if remainingTries > 1 =>
          retry(remainingTries - 1, waitInMilliSeconds, errorFn)(fn)
        case failure =>
          errorFn(s"Tried $maxTries times, still not enough : ${failure.getMessage}")
          Future.failed(failure)
      }
    }

    retry(maxTries, waitInMilliSeconds, errorFn)(fn)
  }

}


text:
public interface ITabConfigurationListener
{
    void createTab(String tabName, double normalizationOffset);
}


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

    JBoss, Home of Professional Open Source.
    Copyright 2014-2022 Red Hat, Inc., and individual contributors
    as indicated by the @author tags.

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

-->
<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">

  <modelVersion>4.0.0</modelVersion>

  <parent>
    <artifactId>parent</artifactId>
    <groupId>org.jboss.pnc</groupId>
    <version>2.3.2-SNAPSHOT</version>
  </parent>

  <artifactId>spi</artifactId>
  <packaging>jar</packaging>

  <description>Contains all SPI interfaces the orchestrator will use to coordinate its sub-services for provisioning environments and repositories, triggering builds, storing domain objects. It is meant to be used in conjunction with model.</description>

  <dependencies>
    <dependency>
      <groupId>org.jboss.pnc</groupId>
      <artifactId>model</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jboss.pnc</groupId>
      <artifactId>dto</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jboss.pnc.build-agent</groupId>
      <artifactId>api</artifactId>
    </dependency>

    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>jakarta.persistence</groupId>
      <artifactId>jakarta.persistence-api</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>jakarta.enterprise</groupId>
      <artifactId>jakarta.enterprise.cdi-api</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.projectlombok</groupId>
      <artifactId>lombok</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-databind</artifactId>
    </dependency>
    <dependency>
      <groupId>com.sun.activation</groupId>
      <artifactId>jakarta.activation</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.jboss.pnc</groupId>
      <artifactId>test-common</artifactId>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.datatype</groupId>
      <artifactId>jackson-datatype-jdk8</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.datatype</groupId>
      <artifactId>jackson-datatype-jsr310</artifactId>
      <scope>test</scope>
    </dependency>

    <!-- TODO only here as lombok is too eager to do everything-->
    <dependency>
      <groupId>org.hibernate</groupId>
      <artifactId>hibernate-core</artifactId>
      <scope>provided</scope>
    </dependency>
  </dependencies>
</project>


text:
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.jdisc.http.server.jetty;

import com.yahoo.jdisc.Request;
import com.yahoo.jdisc.ResourceReference;
import com.yahoo.jdisc.Response;
import com.yahoo.jdisc.SharedResource;
import com.yahoo.jdisc.handler.CompletionHandler;
import com.yahoo.jdisc.handler.ContentChannel;
import com.yahoo.jdisc.handler.DelegatedRequestHandler;
import com.yahoo.jdisc.handler.NullContent;
import com.yahoo.jdisc.handler.RequestHandler;
import com.yahoo.jdisc.handler.ResponseHandler;

import java.nio.ByteBuffer;
import java.util.Objects;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 * This class wraps a request handler and does reference counting on the request for every object that depends on the
 * request, such as the response handler, content channels and completion handlers. This ensures that requests (and
 * hence the current container) will be referenced until the end of the request handling - even with async handling in
 * non-framework threads - without requiring the application to handle this tedious work.
 *
 * @author bakksjo
 */
@SuppressWarnings("try")
class ReferenceCountingRequestHandler implements DelegatedRequestHandler {

    private static final Logger log = Logger.getLogger(ReferenceCountingRequestHandler.class.getName());

    final RequestHandler delegate;

    ReferenceCountingRequestHandler(RequestHandler delegate) {
        Objects.requireNonNull(delegate, "delegate");
        this.delegate = delegate;
    }

    @Override
    public ContentChannel handleRequest(Request request, ResponseHandler responseHandler) {
        try (final ResourceReference requestReference = request.refer(this)) {
            ContentChannel contentChannel;
            final ReferenceCountingResponseHandler referenceCountingResponseHandler
                    = new ReferenceCountingResponseHandler(request, new NullContentResponseHandler(responseHandler));
            try {
                contentChannel = delegate.handleRequest(request, referenceCountingResponseHandler);
                Objects.requireNonNull(contentChannel, "contentChannel");
            } catch (Throwable t) {
                try {
                    // The response handler might never be invoked, due to the exception thrown from handleRequest().
                    referenceCountingResponseHandler.unrefer();
                } catch (Throwable thrownFromUnrefer) {
                    log.log(Level.WARNING, "Unexpected problem", thrownFromUnrefer);
                }
                throw t;
            }
            return new ReferenceCountingContentChannel(request, contentChannel);
        }
    }

    @Override
    public void handleTimeout(Request request, ResponseHandler responseHandler) {
        delegate.handleTimeout(request, new NullContentResponseHandler(responseHandler));
    }

    @Override
    public ResourceReference refer() {
        return delegate.refer();
    }

    @Override
    public ResourceReference refer(Object context) {
        return delegate.refer(context);
    }

    @Override
    public void release() {
        delegate.release();
    }

    @Override
    public String toString() {
        return delegate.toString();
    }

    @Override
    public RequestHandler getDelegate() {
        return delegate;
    }

    private static class ReferenceCountingResponseHandler implements ResponseHandler {

        final SharedResource request;
        final ResourceReference requestReference;
        final ResponseHandler delegate;
        final AtomicBoolean closed = new AtomicBoolean(false);

        ReferenceCountingResponseHandler(SharedResource request, ResponseHandler delegate) {
            Objects.requireNonNull(request, "request");
            Objects.requireNonNull(delegate, "delegate");
            this.request = request;
            this.delegate = delegate;
            this.requestReference = request.refer(this);
        }

        @Override
        public ContentChannel handleResponse(Response response) {
            if (closed.getAndSet(true)) {
                throw new IllegalStateException(delegate + " is already called.");
            }
            try (final ResourceReference ref = requestReference) {
                ContentChannel contentChannel = delegate.handleResponse(response);
                Objects.requireNonNull(contentChannel, "contentChannel");
                return new ReferenceCountingContentChannel(request, contentChannel);
            }
        }

        @Override
        public String toString() {
            return delegate.toString();
        }

        /**
         * Close the reference that is normally closed by {@link #handleResponse(Response)}.
         *
         * This is to be used in error situations, where handleResponse() may not be invoked.
         */
        public void unrefer() {
            if (closed.getAndSet(true)) {
                // This simply means that handleResponse() has been run, in which case we are
                // guaranteed that the reference is closed.
                return;
            }
            requestReference.close();
        }
    }

    private static class ReferenceCountingContentChannel implements ContentChannel {

        final SharedResource request;
        final ResourceReference requestReference;
        final ContentChannel delegate;

        ReferenceCountingContentChannel(SharedResource request, ContentChannel delegate) {
            Objects.requireNonNull(request, "request");
            Objects.requireNonNull(delegate, "delegate");
            this.request = request;
            this.delegate = delegate;
            this.requestReference = request.refer(this);
        }

        @Override
        public void write(ByteBuffer buf, CompletionHandler completionHandler) {
            final CompletionHandler referenceCountingCompletionHandler
                    = new ReferenceCountingCompletionHandler(request, completionHandler);
            try {
                delegate.write(buf, referenceCountingCompletionHandler);
            } catch (Throwable t) {
                try {
                    referenceCountingCompletionHandler.failed(t);
                } catch (AlreadyCompletedException ignored) {
                } catch (Throwable failFailure) {
                    log.log(Level.WARNING, "Failure during call to CompletionHandler.failed()", failFailure);
                }
                throw t;
            }
        }

        @Override
        public void close(CompletionHandler completionHandler) {
            final CompletionHandler referenceCountingCompletionHandler
                    = new ReferenceCountingCompletionHandler(request, completionHandler);
            try (final ResourceReference ref = requestReference) {
                delegate.close(referenceCountingCompletionHandler);
            } catch (Throwable t) {
                try {
                    referenceCountingCompletionHandler.failed(t);
                } catch (AlreadyCompletedException ignored) {
                } catch (Throwable failFailure) {
                    log.log(Level.WARNING, "Failure during call to CompletionHandler.failed()", failFailure);
                }
                throw t;
            }
        }

        @Override
        public String toString() {
            return delegate.toString();
        }
    }

    private static class AlreadyCompletedException extends IllegalStateException {
        public AlreadyCompletedException(final CompletionHandler completionHandler) {
            super(completionHandler + " is already called.");
        }
    }

    private static class ReferenceCountingCompletionHandler implements CompletionHandler {

        final ResourceReference requestReference;
        final CompletionHandler delegate;
        final AtomicBoolean closed = new AtomicBoolean(false);

        public ReferenceCountingCompletionHandler(SharedResource request, CompletionHandler delegate) {
            this.delegate = delegate;
            this.requestReference = request.refer(this);
        }

        @Override
        public void completed() {
            if (closed.getAndSet(true)) {
                throw new AlreadyCompletedException(delegate);
            }
            try {
                if (delegate != null) {
                    delegate.completed();
                }
            } finally {
                requestReference.close();
            }
        }

        @Override
        public void failed(Throwable t) {
            if (closed.getAndSet(true)) {
                throw new AlreadyCompletedException(delegate);
            }
            try (final ResourceReference ref = requestReference) {
                if (delegate != null) {
                    delegate.failed(t);
                } else {
                    log.log(Level.WARNING, "Uncaught completion failure.", t);
                }
            }
        }

        @Override
        public String toString() {
            return String.valueOf(delegate);
        }
    }

    private static class NullContentResponseHandler implements ResponseHandler {

        final ResponseHandler delegate;

        NullContentResponseHandler(ResponseHandler delegate) {
            Objects.requireNonNull(delegate, "delegate");
            this.delegate = delegate;
        }

        @Override
        public ContentChannel handleResponse(Response response) {
            ContentChannel contentChannel = delegate.handleResponse(response);
            if (contentChannel == null) {
                contentChannel = NullContent.INSTANCE;
            }
            return contentChannel;
        }

        @Override
        public String toString() {
            return delegate.toString();
        }
    }
}


text:
"""Intialize Database file."""

import os
import random
import sys
import transaction

from pyramid.paster import (
    get_appsettings,
    setup_logging,
)

from pyramid.scripts.common import parse_vars

from ..models.meta import Base
from ..models import (
    get_engine,
    get_session_factory,
    get_tm_session,
)
from mood_bot.models import User
from mood_bot.models.mymodel import Sentiments
# from faker import Faker
from passlib.apps import custom_app_context as context

# fake_data = Faker()
# FAKE_DATA = [{'body': fake_data.text(), 'negative_sentiment': fake_data.random.random(), 'positive_sentiment': fake_data.random.random(), 'user_id': random.randint(1, 3)} for i in range(20)]

# FAKE_USER =[{'username': 'turbo', 'password': context.hash('maple')},
#             {'username': 'kitties', 'password': context.hash('fluff')},
#             {'username': 'tree', 'password': context.hash('leafy')}]

def usage(argv):
    """."""
    cmd = os.path.basename(argv[0])
    print('usage: %s <config_uri> [var=value]\n'
          '(exMample: "%s development.ini")' % (cmd, cmd))
    sys.exit(1)

def main(argv=sys.argv):
    """."""
    if len(argv) < 2:
        usage(argv)
    config_uri = argv[1]
    options = parse_vars(argv[2:])
    setup_logging(config_uri)
    settings = get_appsettings(config_uri, options=options)

    settings["sqlalchemy.url"] = os.environ["DATABASE_URL"]
    engine = get_engine(settings)
    Base.metadata.drop_all(engine)
    Base.metadata.create_all(engine)

    session_factory = get_session_factory(engine)

    # with transaction.manager:
    #     dbsession = get_tm_session(session_factory, transaction.manager)

    #     faker_user = []
    #     for fake in FAKE_USER:
    #         even_newer_result = User(
    #             username=fake['username'],
    #             password=fake['password']
    #         )
    #         faker_user.append(even_newer_result)
    #     dbsession.add_all(faker_user)

    #     faker_models = []
    #     for fake in FAKE_DATA:
    #         newer_result = Sentiments(
    #             body=fake['body'],
    #             negative_sentiment=fake['negative_sentiment'],
    #             positive_sentiment=fake['positive_sentiment'],
    #             user_id=fake['user_id']
    #         )
    #         faker_models.append(newer_result)
    #     dbsession.add_all(faker_models)


text:
package com.dtflys.test.http;

import com.dtflys.forest.backend.HttpBackend;
import com.dtflys.forest.config.ForestConfiguration;
import com.dtflys.test.mock.GetMockServer;
import com.dtflys.forest.backend.HttpBackend;
import com.dtflys.forest.config.ForestConfiguration;
import com.dtflys.test.http.client.BaseURLClient;
import com.dtflys.test.http.client.BaseURLVarClient;
import com.dtflys.test.mock.GetMockServer;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Rule;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import static junit.framework.Assert.assertEquals;

/**
 * @author gongjun[jun.gong@thebeastshop.com]
 * @since 2017-05-17 16:12
 */
public class TestBaseURLClient extends BaseClientTest {

    private final static Logger log = LoggerFactory.getLogger(TestGetClient.class);

    @Rule
    public GetMockServer server = new GetMockServer(this);

    private static ForestConfiguration configuration;

    private static BaseURLClient baseURLClient;

    private static BaseURLVarClient baseURLVarClient;

    @BeforeClass
    public static void prepareClient() {
        configuration = ForestConfiguration.configuration();
        configuration.setVariableValue("baseURL", "http://localhost:" + GetMockServer.port);
        configuration.setVariableValue("port", GetMockServer.port);
    }

    public TestBaseURLClient(HttpBackend backend) {
        super(backend, configuration);
        baseURLClient = configuration.createInstance(BaseURLClient.class);
        baseURLVarClient = configuration.createInstance(BaseURLVarClient.class);

    }

    @Before
    public void prepareMockServer() {
        server.initServer();
    }

    @Test
    public void testBaseURL() {
        String result = baseURLClient.simpleGet();
        assertEquals(GetMockServer.EXPECTED, result);
    }

    @Test
    public void testBaseURLVar() {
        String result = baseURLVarClient.simpleGet();
        assertEquals(GetMockServer.EXPECTED, result);
    }

}


text:
<?php

require_once 'include.php';
$title = "Preferences";
$pref_on = 'settings-on';

// verify if we're logged in or not
check_auth(IDP, $page_uri);

$ret = '';
$ret .= "
\n";

if (webid_is_local($_SESSION['webid'])) {
    if ($_REQUEST['action'] == 'deleteacc') {
        $path = webid_get_local_path($_SESSION['webid']);
        $ok_del = false;
        // delete profile

        if (($_SESSION['myprofile']->delete_account()) && (rrmdir($path)))
            $ok_del = true;

        // display confirmation
        if ($ok_del) {
            $ret .= success('Your profile has been deleted.');
            $ret .= "

Attention: do not forget to delete the corresponding certificate from your browser, since it is useless now.
\n";
        } else {
            $ret .= error('Could not remove your profile!');
        }

        // log user out and clear WebID session
        if ($_SESSION['webid'])
            $auth->logout;

        // clear local session
        $_SESSION = array();
        session_destroy();

        include 'header.php';
        echo $ret;
        include 'footer.php';
        exit;
    }

    if (isset($_REQUEST['recovery_email'])) {
        $ret .= $_SESSION['myprofile']->set_recovery_email($_REQUEST['recovery_email']);
    }
}

// generate PIN for browser pairing
if (isset($_REQUEST['generate_pin'])) {
    $recovery = new Recovery();
    $pin = $recovery->set_pin($_SESSION['webid']);
}

// subscribe or unsubscribe
if (isset($_REQUEST['subscribe'])) {
    $ret .= $_SESSION['myprofile']->subscribe();
    $_SESSION['feed_hash'] = $_SESSION['myprofile']->get_feed();
    $_SESSION['user_hash'] = $_SESSION['myprofile']->get_hash();
} else if (isset($_REQUEST['submit'])) {
    // Unsubscribed if the user ticked off the checkbox
    if ((!isset($_REQUEST['subscription'])) || ($_REQUEST['subscription'] == 'off')) {
        $_SESSION['user_hash'] = null;
        $_SESSION['feed_hash'] = null;
        $ret .= $_SESSION['myprofile']->unsubscribe();
    }
    // Unsubscribe from receiving email notifications
    if ((isset($_REQUEST['email'])) || ($_REQUEST['email'] == 'on')) {
        $ret .= $_SESSION['myprofile']->subscribe_email();
    } else if ((!isset($_REQUEST['email'])) || ($_REQUEST['email'] == 'off')) {
        $ret .= $_SESSION['myprofile']->unsubscribe_email();
    }
}

// display form if we are not registered
if (!is_subscribed($_SESSION['webid'])) {
    $ret .= "
Manage notifications
\n";
    $ret .= "<form name=\"manage\" method=\"post\">\n";
    $ret .= "<input type=\"hidden\" name=\"subscribe\" value=\"1\">\n";
    $ret .= "
\n";
    $ret .= "
Would you like to register in order to receive notifications?
\n";
    $ret .= "

<input class=\"btn btn-primary\" type=\"submit\" name=\"submit\" value=\"Register\">
\n";
    $ret .= "
\n";
    $ret .= "</form>\n";
}
// prompt the user
else {
    $ret .= "
The URI for your Wall is " . $base_uri . "/wall?user=" . $_SESSION['user_hash'] . "
\n";

    $check_email = '';
    if (is_subscribed_email($_SESSION['webid']) == true)
        $check_email = 'checked';
    $check_subscription = 'checked';

    $ret .= "
Manage notifications
\n";
    $ret .= "<form method=\"post\">\n";
    $ret .= "
\n";
    $ret .= "
<input type=\"checkbox\" name=\"subscription\" ".$check_subscription." /> Receive notifcations. (Warning! Unsubscribing removes all exisiting messages and wall posts!)
\n";
    $ret .= "
<input type=\"checkbox\" name=\"email\" ".$check_email." /> Receive notifications through email.
\n";
    $ret .= "

<input class=\"btn margin-5\" type=\"submit\" name=\"submit\" value=\" Modify \">
\n";
    $ret .= "
\n";
    $ret .= "</form>\n";
}

if (isset($_REQUEST['recovery_email']))
    $email = $_REQUEST['recovery_email'];
else
    $email = $_SESSION['myprofile']->get_recovery_email();
$ret .= "

\n";
$ret .= "
Pairing with a different browser
\n";
$ret .= "
This feature allows you to reuse your current WebID in order to login using a different browser!
";

$ret .= "
\n";
if (isset($pin)) {
    $ret .= "
\n";
    $ret .= "
".$pin."
\n";
    $ret .= "
\n";
}
$ret .= "
\n";
$ret .= "<form method=\"post\">\n";
$ret .= "<input class=\"btn margin-5\" type=\"submit\" name=\"generate_pin\" value=\"Generate a new PIN\">\n";
$ret .= "</form> \n";
$ret .= "
\n";
$ret .= "
\n";
$ret .= "
Note! This pin number will only be valid for 1 minute!
";

// display options for local users only
if (webid_is_local($_SESSION['webid'])) {
    if (isset($_REQUEST['recovery_email']))
        $email = $_REQUEST['recovery_email'];
    else
        $email = $_SESSION['myprofile']->get_recovery_email();
    $ret .= "

\n";
    $ret .= "
Recovery Email
\n";

    $ret .= "

\n";
    $ret .= "\n";
    $ret .= "<form method=\"post\">\n";
    $ret .= "<input type=\"text\" class=\"recovery\" name=\"recovery_email\" value=\"".$email."\" />\n";
    $ret .= "<input class=\"btn margin-5\" type=\"submit\" name=\"update_recovery\" value=\"Update\">\n";
    $ret .= "</form> \n";
    $ret .= "	\n";
    $ret .= "

\n";
    $ret .= "Note! This email address is private and will not be share with anyone else!";

    if (!isset($_REQUEST['action'])) {
        $ret .= "

\n";
        $ret .= "
Manage profile
\n";

        $ret .= "

\n";
        $ret .= "\n";
        $ret .= "<form action=\"profile.php\" method=\"get\">\n";
        $ret .= "<input type=\"hidden\" name=\"action\" value=\"edit\" />\n";
        $ret .= "<input class=\"btn margin-5\" type=\"submit\" name=\"submit\" value=\"Edit profile\">\n";
        $ret .= "</form> \n";
        $ret .= "	\n";
        $ret .= "<form method=\"post\" onsubmit=\"return confirm('Are you sure you want to delete your account?')\">\n";
        $ret .= "<input type=\"hidden\" name=\"action\" value=\"deleteacc\" />\n";
        $ret .= "<input class=\"btn btn-danger margin-5\" type=\"submit\" name=\"delete\" value=\"Delete profile\">\n";
        $ret .= "</form>\n";
        $ret .= "	\n";
        $ret .= "

\n";
        $ret .= "Warning! Deleting a profile cannot be undone. All your local data will be removed (profile, wall posts, messages, etc.).";
        $ret .= "

\n";
    }
}

$ret .= "
\n";

include 'header.php';
echo $ret;
include 'footer.php';
?>


text:
package com.jetlag.jcreator.activity.uploading;

import com.jetlag.jcreator.pictures.DevicePicture;

import java.util.ArrayList;

/**
 * Created by vince on 26/02/17.
 */

interface UploadingDisplay {

    void displayPictures(ArrayList<DevicePicture> pictures);

    void displayLoadingProgress(int percentage);
}


text:
from typing import Type, Dict, Callable, Optional
import logging

from .base import MissionGenerator
from ..mission import Mission
from ..system import System
from ..state import State
from ..environment import Environment
from ..configuration import Configuration
from ..command import Command

logger = logging.getLogger(__name__)   # type: logging.Logger
logger.setLevel(logging.DEBUG)

class RandomMissionGenerator(MissionGenerator):
    def __init__(self,
                 system: Type[System],
                 initial_state: State,
                 env: Environment,
                 config: Configuration,
                 threads: int = 1,
                 command_generators: Optional[Dict[str, Callable]] = None,
                 max_num_commands: int = 10
                 ) -> None:
        super().__init__(system, threads, command_generators, max_num_commands)
        self.__initial_state = initial_state
        self.__env = env
        self.__configuration = config

    @property
    def initial_state(self):
        """
        The initial state used by all missions produced by this generator.
        """
        return self.__initial_state

    @property
    def env(self):
        """
        The environment used by all missions produced by this generator.
        """
        return self.__env

    def generate_command(self, command_class: Type[Command]) -> Command:
        generator = self.command_generator(command_class)
        if generator is None:
            return command_class.generate(self.rng)
        # g = generator.generate_action_without_state
        # return g(self.system, self.__env, self.rng)
        return g(self.rng)

    def generate_mission(self):
        command_classes = list(self.system.commands.values())
        takeoff = None
        for c in command_classes:
            if "MAV_CMD_NAV_TAKEOFF" in c.uid:
                takeoff = c
                break
        if not takeoff:
            raise Exception("No TAKEOFF command found")
        commands = [self.generate_command(takeoff)]
        cmds_len = self.max_num_commands
        for i in range(1, cmds_len):
            next_allowed = commands[i - 1].__class__.get_next_allowed(self.system)  # noqa: pycodestyle
            if next_allowed:
                command_class = self.rng.choice(next_allowed)
                commands.append(self.generate_command(command_class))
            else:
                break
        return Mission(self.__configuration,
                       self.__env,
                       self.__initial_state,
                       commands,
                       self.system)


text:
#ifndef INCLUDE_CYBER_COMMON_ASYNC_LOGGER_H_
#define INCLUDE_CYBER_COMMON_ASYNC_LOGGER_H_

#include <atomic>
#include <condition_variable>
#include <cstdint>
#include <ctime>
#include <iostream>
#include <memory>
#include <mutex>
#include <string>
#include <thread>
#include <utility>
#include <vector>

#include "cyber/common/macros.h"
#include "glog/logging.h"

namespace apollo {
namespace cyber {
namespace logger {

// Wrapper for a glog Logger which asynchronously writes log messages.
// This class starts a new thread responsible for forwarding the messages
// to the logger, and performs double buffering. Writers append to the
// current buffer and then wake up the logger thread. The logger swaps in
// a new buffer and writes any accumulated messages to the wrapped
// Logger.
//
// This double-buffering design dramatically improves performance, especially
// for logging messages which require flushing the underlying file (i.e WARNING
// and above for default). The flush can take a couple of milliseconds, and in
// some cases can even block for hundreds of milliseconds or more. With the
// double-buffered approach, threads can proceed with useful work while the IO
// thread blocks.
//
// The semantics provided by this wrapper are slightly weaker than the default
// glog semantics. By default, glog will immediately (synchronously) flush
// WARNING
// and above to the underlying file, whereas here we are deferring that flush to
// a separate thread. This means that a crash just after a 'LOG_WARN' would
// may be missing the message in the logs, but the perf benefit is probably
// worth it. We do take care that a glog FATAL message flushes all buffered log
// messages before exiting.
//
// NOTE: the logger limits the total amount of buffer space, so if the
// underlying
// log blocks for too long, eventually the threads generating the log messages
// will block as well. This prevents runaway memory usage.
class AsyncLogger : public google::base::Logger {
 public:
  explicit AsyncLogger(google::base::Logger* wrapped, int max_buffer_bytes);

  ~AsyncLogger();

  void Start();

  // Stop the thread. Flush() and Write() must not be called after this.
  //
  // NOTE: this is currently only used in tests: in real life, we enable async
  // logging once when the program starts and then never disable it.
  //
  // REQUIRES: Start() must have been called.
  void Stop();

  // Write a message to the log.
  //
  // 'force_flush' is set by the GLog library based on the configured
  // '--logbuflevel' flag.
  // Any messages logged at the configured level or higher result in
  // 'force_flush'
  // being set to true, indicating that the message should be immediately
  // written to the
  // log rather than buffered in memory. See the class-level docs above for more
  // details about the implementation provided here.
  //
  // REQUIRES: Start() must have been called.
  void Write(bool force_flush, time_t timestamp, const char* message,
             int message_len) override;

  // Flush any buffered messages.
  void Flush() override;

  // Get the current LOG file size.
  // The return value is an approximate value since some
  // logged data may not have been flushed to disk yet.
  uint32_t LogSize() override;

  const std::thread* LogThread() const { return &thread_; }

 private:
  // A buffered message.
  //
  // TODO(todd): using std::string for buffered messages is convenient but not
  // as efficient as it could be. It's better to make the buffers just be
  // Arenas and allocate both the message data and Msg struct from them, forming
  // a linked list.
  struct Msg {
    time_t ts;
    std::string message;
    int32_t level;

    Msg(time_t ts, std::string&& message, int32_t level)
        : ts(ts), message(std::move(message)), level(level) {}
  };

  // A buffer of messages waiting to be flushed.
  struct Buffer {
    std::vector<Msg> messages;

    // Estimate of the size of 'messages'.
    std::atomic<int> size = {0};

    // Whether this buffer needs an explicit flush of the
    // underlying logger.
    bool flush = false;

    Buffer() {}

    inline void clear() {
      messages.clear();
      size = 0;
      flush = false;
    }

    inline void add(Msg&& msg, bool force_flush) {
      size +=
          static_cast<int>(sizeof(msg)) + static_cast<int>(msg.message.size());
      messages.emplace_back(std::move(msg));
      flush |= force_flush;
    }

    inline bool needs_flush_or_write() const {
      return flush || !messages.empty();
    }

   private:
    DISALLOW_COPY_AND_ASSIGN(Buffer);
  };

  bool BufferFull(const Buffer& buf) const;
  void RunThread();

  // The maximum number of bytes used by the entire class.
  int max_buffer_bytes_;

  google::base::Logger* const wrapped_;
  std::thread thread_;

  // Count of how many times the writer thread has flushed the buffers.
  // 64 bits should be enough to never worry about overflow.
  uint64_t flush_count_ = 0;

  // Count of how many times the writer thread has dropped the log messages.
  // 64 bits should be enough to never worry about overflow.
  uint64_t drop_count_ = 0;

  // Protects buffers as well as 'state_'.
  std::mutex mutex_;

  // Signaled by app threads to wake up the flusher, either for new
  // data or because 'state_' changed.
  std::condition_variable wake_flusher_cv_;

  // Signaled by the flusher thread when the flusher has swapped in
  // a free buffer to write to.
  // std::condition_variable free_buffer_cv_;

  // Signaled by the flusher thread when it has completed flushing
  // the current buffer.
  std::condition_variable flush_complete_cv_;

  // The buffer to which application threads append new log messages.
  std::unique_ptr<Buffer> active_buf_;

  // The buffer currently being flushed by the logger thread, cleared
  // after a successful flush.
  std::unique_ptr<Buffer> flushing_buf_;

  // Trigger for the logger thread to stop.
  enum State { INITTED, RUNNING, STOPPED };
  State state_ = INITTED;

  DISALLOW_COPY_AND_ASSIGN(AsyncLogger);
};

}  // namespace logger
}  // namespace cyber
}  // namespace apollo

#endif  // CYBER_COMMON_ASYNC_LOGGER_H_


text:
#ifndef LIBMINIFI_SRC_CAPI_CSTRUCTS_H_
#define LIBMINIFI_SRC_CAPI_CSTRUCTS_H_

#include <stddef.h>
#include <stdint.h>

#ifdef _WIN32
#define NOMINMAX
#include <winsock2.h>
#endif
#ifndef DEPRECATED
#ifdef _MSC_VER
#define DEPRECATED(v,ev) __declspec(deprecated)
#elif defined(__GNUC__) | defined(__clang__)
#define DEPRECATED(v,ev) __attribute__((__deprecated__))
#else
#define DEPRECATED(v,ev)
#endif
#endif

/**
 * NiFi Port struct
 */
typedef struct {
  char *port_id;
} nifi_port;

/**
 * Nifi instance struct
 */
typedef struct {

  void *instance_ptr;

  nifi_port port;

} nifi_instance;

/****
 * ##################################################################
 *  C2 OPERATIONS
 * ##################################################################
 */

enum C2_Server_Type {
  REST,
  MQTT
};

typedef struct {
  char *url;
  char *ack_url;
  char *identifier;
  char *topic;
  enum C2_Server_Type type;
} C2_Server;

/****
 * ##################################################################
 *  Processor OPERATIONS
 * ##################################################################
 */

typedef struct processor processor;

typedef struct standalone_processor standalone_processor;

typedef struct processor_session processor_session;

typedef struct processor_context processor_context;

/****
 * ##################################################################
 *  FLOWFILE OPERATIONS
 * ##################################################################
 */

typedef struct {
  const char *key;
  void *value;
  size_t value_size;
} attribute;

typedef struct {
  attribute * attributes;
  size_t size;
} attribute_set;

/**
 * State of a flow file
 *
 */
typedef struct {
  uint64_t size; /**< Size in bytes of the data corresponding to this flow file */

  void * in;

  void * crp;

  char * contentLocation; /**< Filesystem location of this object */

  void *attributes; /**< Hash map of attributes */

  void *ffp;

  uint8_t keepContent;

} flow_file_record;

typedef struct flow flow;

typedef enum FS {
  AS_IS,
  ROLLBACK
} FailureStrategy;

typedef void (ontrigger_callback)(processor_session*, processor_context *);
typedef void (onschedule_callback)(processor_context *);

typedef ontrigger_callback processor_logic;

typedef struct file_buffer {
  uint8_t * buffer;
  uint64_t file_len;
} file_buffer;

#ifndef _WIN32
typedef int SOCKET;
#endif

typedef struct cstream {
  SOCKET socket_;
} cstream;

/****
 * ##################################################################
 *  STRING OPERATIONS
 * ##################################################################
 */

typedef struct tokens {
    char ** str_list;
    uint64_t num_strings;
    uint64_t total_bytes;
} tokens;
#endif /* LIBMINIFI_SRC_CAPI_CSTRUCTS_H_ */


text:
FROM rdpro-ubuntu1604-util:latest

ENV USERNAME=rundeck \
    USER=rundeck \
    HOME=/home/rundeck \
    LOGNAME=$USERNAME \
    TERM=xterm-256color

COPY --chown=rundeck:root entry.sh /entry.sh
RUN chmod +x /entry.sh
VOLUME $HOME/rundeck
WORKDIR $HOME/rundeck

USER root

EXPOSE 4440
ENTRYPOINT ["/entry.sh"]


text:
<!doctype html>

    <meta charset="utf-8">
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>CharMap</title>

    <link id="linkedcss" rel="stylesheet" href="css/slate.css">
    <link rel="stylesheet" href="css/main.css">

CharMap

WinJS App

This is a WinJS App. Lobsters are mermaids to scorpions.

          Launch

Knockout App

This is a Knockout App. It's weird that we cook bacon and bake cookies.

          Launch

Angular App

This is an Angular App. Your stomach thinks all potatoes are mashed.

          Launch

React App

This is a React App. Cookie dough is the sushi of desserts.

          Launch

Try it yourself

          To try out CharMap, first clone the repository:

>git clone https://github.com/InternetExplorer/CharMap.git

          Then just run gulp:

>cd CharMap

>gulp

        <select id="theme-select">
          <option value="slate.css">Slate</option>
          <option value="bootstrap-winjs.css">WinJS</option>
        </select>

//build 2015


text:
<!---
    Licensed to the Apache Software Foundation (ASF) under one
    or more contributor license agreements.  See the NOTICE file
    distributed with this work for additional information
    regarding copyright ownership.  The ASF licenses this file
    to you under the Apache License, Version 2.0 (the
    "License"); you may not use this file except in compliance
    with the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing,
    software distributed under the License is distributed on an
    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    KIND, either express or implied.  See the License for the
    specific language governing permissions and limitations
    under the License.
-->

# org.apache.cordova.splashscreen

Ce plugin affiche et masque un écran de démarrage lors du lancement de l'application.

## Installation

    cordova plugin add org.apache.cordova.splashscreen

## Plates-formes prises en charge

*   Amazon Fire OS
*   Android
*   BlackBerry 10
*   iOS
*   Windows Phone 7 et 8
*   Windows 8

## Méthodes

*   splashscreen.Show
*   splashscreen.Hide

### Quirks Android

Dans votre fichier config.xml, vous devez ajouter la préférence suivante

`<preference name="splashscreen" value="foo" />`

Où foo est le nom du fichier splashscreen. Préférence un fichier de 9 correctif. Assurez-vous d'ajouter vos fichiers splashcreen dans votre répertoire res/xml dans les dossiers appropriés.

Pour Android, vous devez également modifier votre fichier java principal de projets. Vous devez ajouter un deuxième paramètre, ce qui représente un temps de retard à votre super.loadUrl.

`super.loadUrl(Config.getStartUrl(), 10000);`

## splashscreen.Hide

Fait disparaître l'écran de démarrage.

    navigator.splashscreen.hide();

### BlackBerry 10 Quirk

La `config.xml` du fichier `AutoHideSplashScreen` doit être`false`.

### iOS Quirk

Le paramètre `AutoHideSplashScreen</code du fichier <code>config.xml` doit être réglé à `false` . Pour retarder la disparition de l'écran de démarrage de deux secondes, ajoute un minuteur comme ci-dessous dans le gestionnaire d'événements `deviceready` :

        setTimeout(function() {
            navigator.splashscreen.hide();
        }, 2000);

## splashscreen.Show

Affiche l'écran de démarrage.

    navigator.splashscreen.show();

Votre application ne peut pas appeler `navigator.splashscreen.show()` jusqu'à ce que l'application a commencé et le `deviceready` événement a été déclenché. Mais puisqu'en général, l'écran de démarrage est destiné à être visible avant que votre application a commencé, qui semblerait à l'encontre des objectifs de l'écran de démarrage. Fournir une configuration en `config.xml` sera automatiquement `show` l'écran de démarrage immédiatement après votre lancement de l'app et avant qu'il a complètement démarré et a reçu le `deviceready` événement. Voir les [icônes et les écrans de démarrage][1] pour plus d'informations sur la conduite de cette configuration. Pour cette raison, il est peu probable que vous devez appeler `navigator.splashscreen.show()` pour rendre l'écran de démarrage visible pour le démarrage de l'application.

 [1]: http://cordova.apache.org/docs/en/edge/config_ref_images.md.html


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd">

<meta name="generator" content="JDiff v1.0.9">

<meta name="description" content="JDiff is a Javadoc doclet which generates an HTML report of all the packages, classes, constructors, methods, and fields which have been removed, added or changed in any way, including their documentation, when two APIs are compared.">
<meta name="keywords" content="diff, jdiff, javadiff, java diff, java difference, API difference, difference between two APIs, API diff, Javadoc, doclet">
<TITLE>
org.apache.hadoop.io.WritableUtils
</TITLE>
<LINK REL="stylesheet" TYPE="text/css" HREF="../stylesheet-jdiff.css" TITLE="Style">

       <tt>hadoop 0.20.1-dev</tt>
       Overview
       Package
        Class
       Statistics
       Help

  Generated by
JDiff

 PREV CLASS
 NEXT CLASS

  FRAMES
   NO FRAMES
   DETAIL:
CONSTRUCTORS |
METHODS |
FIELDS

Class org.apache.hadoop.io.<tt>WritableUtils</tt>

  Changed Methods

  <nobr>Writable <tt>clone</tt>(Writable,</nobr> Configuration<nobr><nobr>)  </nobr>

Change in return type from (T, extends, Writable) to Writable.

 Change in signature from (T, extends, Writable, Configuration) to (Writable, Configuration).

  Make a copy of a writable object using serialization to a buffer.

  <nobr>void <tt>cloneInto</tt>(Writable,</nobr> Writable<nobr><nobr>)  </nobr>

Now deprecated.

  use ReflectionUtils.cloneInto instead.

  <nobr>Enum <tt>readEnum</tt>(DataInput,</nobr> Class<nobr><nobr>)  </nobr>

Change in return type from (T, extends, Enum<T>) to Enum.

 Change in signature from (DataInput, Class<T>) to (DataInput, Class).

  Read an Enum value from DataInput Enums are read and written using String values.

  <nobr>void <tt>writeEnum</tt>(DataOutput,</nobr> Enum<nobr><nobr>)  </nobr>

Change in signature from (DataOutput, Enum<?>) to (DataOutput, Enum).

  writes String value of enum to DataOutput.

       <tt>hadoop 0.20.1-dev</tt>
       Overview
       Package
        Class
       Statistics
       Help

 PREV CLASS
 NEXT CLASS

  FRAMES
   NO FRAMES


text:
<?php

namespace tahua\SiteBundle\Entity;

use Doctrine\ORM\EntityRepository;

/**
 * CmsPageRepository
 *
 * This class was generated by the Doctrine ORM. Add your own custom
 * repository methods below.
 */
class CmsPageRepository extends EntityRepository
{

    public function findPageWithContent($page_name, $lang){
        $query_builder = $this->createQueryBuilder("p");
        $query_builder->select("p, c, ct")
                      ->leftJoin("p.cms_contents", "c")
                      ->leftJoin("c.translations", "ct")
//                      ->where("p.nom = :page_name")
                      ->andWhere("ct.lang = :lang")
                      ->andWhere("c.actif = 1")
                      ->setParameter("lang", $lang)
//                      ->setParameter("page_name", $page_name)
                      ;
        $page = $query_builder->getQuery()->getOneOrNullResult();
        $page = (!is_null($page))? $page: new Page();

        return $page;
    }

}


text:
<?php

namespace Lucid\Template\Resource;

/**
 * @class FileResource
 *
 * @package Lucid\Template
 * @version $Id$
 * @author iwyg <mail@thomas-appel.com>
 */
class FileResource extends AbstractResource
{
    /**
     * resource
     *
     * @var string
     */
    private $file;

    /**
     * Constructor.
     *
     * @param string $file
     */
    public function __construct($file)
    {
        $this->file = $file;
    }

    /**
     * {@inheritdoc}
     */
    public function getResource()
    {
        return $this->file;
    }

    /**
     * {@inheritdoc}
     */
    public function getContents()
    {
        return file_get_contents($this->file);
    }
}


text:
"""Provide commands for working with Cloud SQL instance operations."""

from googlecloudsdk.calliope import base
from googlecloudsdk.calliope import exceptions

@base.ReleaseTracks(base.ReleaseTrack.GA)
class Operations(base.Group):
  """Provide commands for working with Cloud SQL instance operations.

  Provide commands for working with Cloud SQL instance operations, including
  listing and getting information about instance operations of a Cloud SQL
  instance.
  """

@base.ReleaseTracks(base.ReleaseTrack.BETA)
class OperationsBeta(base.Group):
  """Provide commands for working with Cloud SQL instance operations.

  Provide commands for working with Cloud SQL instance operations, including
  listing and getting information about instance operations of a Cloud SQL
  instance.
  """
  pass


text: g++ evtest.c -I/usr/include/libevdev-1.0/libevdev -levdev -o evtest


text:
<?php
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of Welcome
 *
 * @author Alexander
 */
class Welcome extends Action{
    //put your code here
}
?>


text:
var path = require('path');
var HtmlWebpackPlugin = require('../..');
var webpackMajorVersion = require('webpack/package.json').version.split('.')[0];
module.exports = {
  entry: './example.js',
  output: {
    path: path.join(__dirname, 'dist/webpack-' + webpackMajorVersion),
    publicPath: '',
    filename: 'bundle.js'
  },
  module: {
    loaders: [
      { test: /\.css$/, loader: 'style-loader!css-loader' },
      { test: /\.png$/, loader: 'file-loader' }
    ]
  },
  plugins: [
    new HtmlWebpackPlugin()
  ]
};


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Pixel RNN - predicts the pixels in an image</title>
    <link rel="stylesheet" href="//fonts.googleapis.com/css?family=Source+Sans+Pro:300,300i,600">
    <link href="/gh-pages/resources/font-awesome/css/font-awesome.min.css" rel="stylesheet">
    <link rel="stylesheet" href="/gh-pages/style.css">
    <link rel="alternate" type="application/rss+xml" title="RSS Feed for CHI MAN WONG" href="/gh-pages/feed.xml" />

CHI MAN WONG

A passionate CS master student in deep learning

    Home  /
    About  /

Pixel RNN - predicts the pixels in an image

    <time>28 Mar 2017</time>

Problem

To predict the pixels in an image. For example, if an image is occluded, PixelRNN will recover the occulded part within the image, as shown in the following:

Proposed Method

Using two LSTMs for modeling two directions respectively: row and diagonal, as shown in the following:

Advantages

model full dependencies between the collor channels.

model both spatially local and long-range correlations

produce sharp and coherent recovery

Result

Reference

Oord, A. V. D., Kalchbrenner, N., & Kavukcuoglu, K. (2016). Pixel recurrent neural networks. arXiv preprint arXiv:1601.06759.

Related Posts

29 Mar 2017 »Structural RNN - Modeling Spatio-Temporal Graphs

20 Dec 2016 »Dual Learning Mechanism - train your translation model without any human labelling

15 Dec 2016 »Light RNN - compress your RNN model from 80GB to 50MB


text:
var g = newGlobal('new-compartment');
function test(code, val) {
    g.eval("function f() { " + code + " }");
    var dbg = new Debugger(g);
    dbg.onDebuggerStatement = function (frame) {
        frame.environment.setVariable("a", val);
    };
    assertEq(g.f(), val);
}

test("let a = 1; debugger; return a;", "xyzzy");
test("{ let a = 1; debugger; return a; }", "plugh");
test("let (a = 1) { debugger; return a; }", "wcgr");


text: node bin/coding-soccer


text: define("dojox/editor/plugins/nls/tr/Save",({"save":"Kaydet"}));


text:
import java.util.*;

class T6638712a {

    <T> Comparator<T> compound(Iterable<? extends Comparator<? super T>> it) { return null; }

    public void test(List<Comparator<?>> x) {
        Comparator<String> c3 = compound(x);
    }
}


text:
@interface CRWFakeWebStateDelegate : NSObject <CRWWebStateDelegate>

// web::WebState::OpenURLParams in |webState:openURLWithParams:| call.
@property(nonatomic, readonly)
    const web::WebState::OpenURLParams* openURLParams;
// web::WebState received in delegate method calls.
@property(nonatomic, readonly) web::WebState* webState;
// Whether |webState:createNewWebStateForURL:openerURL:initiatedByUser:| has
// been called or not.
@property(nonatomic, readonly) BOOL webStateCreationRequested;
// Whether |closeWebState:| has been called or not.
@property(nonatomic, readonly) BOOL webStateClosingRequested;
// Whether |webState:runRepostFormDialogWithCompletionHandler:| has been called
// or not.
@property(nonatomic, readonly) BOOL repostFormWarningRequested;
// Whether |javaScriptDialogPresenterForWebState:| has been called or not.
@property(nonatomic, readonly) BOOL javaScriptDialogPresenterRequested;
// Whether |webState:didRequestHTTPAuthForProtectionSpace:...| has been called
// or not.
@property(nonatomic, readonly) BOOL authenticationRequested;
// Specifies the return value of |isAppLaunchingAllowedForWebState:|.
@property(nonatomic) BOOL isAppLaunchingAllowedForWebStateReturnValue;

@end

#endif  // IOS_WEB_PUBLIC_TEST_CRW_FAKE_WEB_STATE_DELEGATE_H_


text:
package mdl.sinlov.android.websokcet;

import android.app.Application;
import android.test.ApplicationTestCase;

/**
 * Testing Fundamentals
 */
public class ApplicationTest extends ApplicationTestCase<Application> {
    public ApplicationTest() {
        super(Application.class);
    }
}


text: from .loginDialog import LoginDialog


text:
package logging

import (
	"fmt"
	"log/syslog"
)

type SyslogLogger struct {
	out *syslog.Writer
}

func (p *SyslogLogger) Debug(format string, args ...interface{}) {
	p.out.Debug(fmt.Sprintf(format, args...))
}

func (p *SyslogLogger) Warn(format string, args ...interface{}) {
	p.out.Warning(fmt.Sprintf(format, args...))
}

func (p *SyslogLogger) Info(format string, args ...interface{}) {
	p.out.Info(fmt.Sprintf(format, args...))
}

func (p *SyslogLogger) Error(format string, args ...interface{}) {
	p.out.Err(fmt.Sprintf(format, args...))
}

func (p *SyslogLogger) Close() {
	p.out.Close()
}

//==============================================================================

func NewSyslogLogger(tag string, level int) (Logger, error) {
	var lvl syslog.Priority
	switch level {
	case DEBUG:
		lvl = syslog.LOG_DEBUG
	case INFO:
		lvl = syslog.LOG_INFO
	case WARN:
		lvl = syslog.LOG_WARNING
	case ERROR:
		lvl = syslog.LOG_ERR
	default:
		lvl = syslog.LOG_DEBUG
	}

	wrt, err := syslog.New(lvl, tag)
	if err != nil {
		return nil, err
	}
	return &SyslogLogger{out: wrt}, nil
}


text:
redis-server /redis/redis.conf
redis-server /redis/redis-secure.conf

# Sentinel
redis-server /redis/sentinel.conf --sentinel
redis-server /redis/sentinel-secure.conf --sentinel

sleep infinity
wait -n


text:
class Sink < Plan::RoomObject
  object 'room-object-sink'.freeze
  css 'sink'.freeze
end

class SinkPlugin < Plan::RoomPlugin
  register sink: Sink
  svg 'sink.xml'
  css 'sink.css'
end


text:
#include <assert.h>
#include <time.h>

#include <config.h>

#include <mosquitto_broker.h>
#include <memory_mosq.h>
#include <time_mosq.h>

#include "uthash.h"

struct mosquitto *mqtt3_context_init(struct mosquitto_db *db, mosq_sock_t sock)
{
	struct mosquitto *context;
	char address[1024];

	context = _mosquitto_calloc(1, sizeof(struct mosquitto));
	if(!context) return NULL;

	context->state = mosq_cs_new;
	context->sock = sock;
	context->last_msg_in = mosquitto_time();
	context->next_msg_out = mosquitto_time() + 60;
	context->keepalive = 60; /* Default to 60s */
	context->clean_session = true;
	context->disconnect_t = 0;
	context->id = NULL;
	context->last_mid = 0;
	context->will = NULL;
	context->username = NULL;
	context->password = NULL;
	context->listener = NULL;
	context->acl_list = NULL;
	/* is_bridge records whether this client is a bridge or not. This could be
	 * done by looking at context->bridge for bridges that we create ourself,
	 * but incoming bridges need some other way of being recorded. */
	context->is_bridge = false;

	context->in_packet.payload = NULL;
	_mosquitto_packet_cleanup(&context->in_packet);
	context->out_packet = NULL;
	context->current_out_packet = NULL;

	context->address = NULL;
	if((int)sock >= 0){
		if(!_mosquitto_socket_get_address(sock, address, 1024)){
			context->address = _mosquitto_strdup(address);
		}
		if(!context->address){
			/* getpeername and inet_ntop failed and not a bridge */
			_mosquitto_free(context);
			return NULL;
		}
	}
	context->bridge = NULL;
	context->msgs = NULL;
	context->last_msg = NULL;
	context->msg_count = 0;
	context->msg_count12 = 0;
#ifdef WITH_TLS
	context->ssl = NULL;
#endif

	if((int)context->sock >= 0){
		HASH_ADD(hh_sock, db->contexts_by_sock, sock, sizeof(context->sock), context);
	}
	return context;
}

/*
 * This will result in any outgoing packets going unsent. If we're disconnected
 * forcefully then it is usually an error condition and shouldn't be a problem,
 * but it will mean that CONNACK messages will never get sent for bad protocol
 * versions for example.
 */
void mqtt3_context_cleanup(struct mosquitto_db *db, struct mosquitto *context, bool do_free)
{
	struct _mosquitto_packet *packet;
	struct mosquitto_client_msg *msg, *next;
	int i;

	if(!context) return;

	if(context->username){
		_mosquitto_free(context->username);
		context->username = NULL;
	}
	if(context->password){
		_mosquitto_free(context->password);
		context->password = NULL;
	}
#ifdef WITH_BRIDGE
	if(context->bridge){
		for(i=0; i<db->bridge_count; i++){
			if(db->bridges[i] == context){
				db->bridges[i] = NULL;
			}
		}
		if(context->bridge->local_clientid){
			_mosquitto_free(context->bridge->local_clientid);
			context->bridge->local_clientid = NULL;
		}
		if(context->bridge->remote_username){
			context->bridge->remote_username = NULL;
		}
		if(context->bridge->remote_password){
			context->bridge->remote_password = NULL;
		}
		if(context->bridge->local_username){
			context->bridge->local_username = NULL;
		}
		if(context->bridge->local_password){
			context->bridge->local_password = NULL;
		}
		if(context->bridge->local_clientid){
			context->bridge->local_clientid = NULL;
		}
	}
#endif
	_mosquitto_socket_close(db, context);
	if((do_free || context->clean_session) && db){
		mqtt3_subs_clean_session(db, context);
		mqtt3_db_messages_delete(db, context);
	}
	if(context->address){
		_mosquitto_free(context->address);
		context->address = NULL;
	}

	if(context->id){
		assert(db); /* db can only be NULL here if the client hasn't sent a
					   CONNECT and hence wouldn't have an id. */

		HASH_DELETE(hh_id, db->contexts_by_id, context);
		_mosquitto_free(context->id);
		context->id = NULL;
	}
	_mosquitto_packet_cleanup(&(context->in_packet));
	if(context->current_out_packet){
		_mosquitto_packet_cleanup(context->current_out_packet);
		_mosquitto_free(context->current_out_packet);
		context->current_out_packet = NULL;
	}
	while(context->out_packet){
		_mosquitto_packet_cleanup(context->out_packet);
		packet = context->out_packet;
		context->out_packet = context->out_packet->next;
		_mosquitto_free(packet);
	}
	if(context->will){
		if(context->will->topic) _mosquitto_free(context->will->topic);
		if(context->will->payload) _mosquitto_free(context->will->payload);
		_mosquitto_free(context->will);
		context->will = NULL;
	}
	if(do_free || context->clean_session){
		msg = context->msgs;
		while(msg){
			next = msg->next;
			mosquitto__db_msg_store_deref(db, &msg->store);
			_mosquitto_free(msg);
			msg = next;
		}
		context->msgs = NULL;
		context->last_msg = NULL;
	}
	if(do_free){
		_mosquitto_free(context);
	}
}

void mqtt3_context_disconnect(struct mosquitto_db *db, struct mosquitto *ctxt)
{
	if(ctxt->state != mosq_cs_disconnecting && ctxt->will){
		if(mosquitto_acl_check(db, ctxt, ctxt->will->topic, MOSQ_ACL_WRITE) == MOSQ_ERR_SUCCESS){
			/* Unexpected disconnect, queue the client will. */
			mqtt3_db_messages_easy_queue(db, ctxt, ctxt->will->topic, ctxt->will->qos, ctxt->will->payloadlen, ctxt->will->payload, ctxt->will->retain);
		}
	}
	if(ctxt->will){
		if(ctxt->will->topic) _mosquitto_free(ctxt->will->topic);
		if(ctxt->will->payload) _mosquitto_free(ctxt->will->payload);
		_mosquitto_free(ctxt->will);
		ctxt->will = NULL;
	}
	ctxt->disconnect_t = time(NULL);
	_mosquitto_socket_close(db, ctxt);
}

void mosquitto__add_context_to_disused(struct mosquitto_db *db, struct mosquitto *context)
{
	if(db->ll_for_free){
		context->for_free_next = db->ll_for_free;
		db->ll_for_free = context;
	}else{
		db->ll_for_free = context;
	}
}

void mosquitto__free_disused_contexts(struct mosquitto_db *db)
{
	struct mosquitto *context, *next;
	assert(db);

	context = db->ll_for_free;
	while(context){
		next = context->for_free_next;
		mqtt3_context_cleanup(db, context, true);
		context = next;
	}
	db->ll_for_free = NULL;
}


text:
              Lista de Formularios

            <back-button></back-button>
            <button type="button" class="btn btn-primary" ng-click="createNew()"> Crear Nuevo</button>

		<list clase="wsForm" fields="fields" showid="false" search-fields="search" list="list"></list>


text:
#include "modules/audio_coding/audio_network_adaptor/debug_dump_writer.h"

#include "rtc_base/checks.h"
#include "rtc_base/ignore_wundef.h"
#include "rtc_base/numerics/safe_conversions.h"
#include "rtc_base/protobuf_utils.h"

#if WEBRTC_ENABLE_PROTOBUF
RTC_PUSH_IGNORING_WUNDEF()
#ifdef WEBRTC_ANDROID_PLATFORM_BUILD
#include "external/webrtc/webrtc/modules/audio_coding/audio_network_adaptor/debug_dump.pb.h"
#else
#include "modules/audio_coding/audio_network_adaptor/debug_dump.pb.h"
#endif
RTC_POP_IGNORING_WUNDEF()
#endif

namespace webrtc {

#if WEBRTC_ENABLE_PROTOBUF
namespace {

using audio_network_adaptor::debug_dump::Event;
using audio_network_adaptor::debug_dump::NetworkMetrics;
using audio_network_adaptor::debug_dump::EncoderRuntimeConfig;

void DumpEventToFile(const Event& event, FileWrapper* dump_file) {
  RTC_CHECK(dump_file->is_open());
  ProtoString dump_data;
  event.SerializeToString(&dump_data);
  int32_t size = rtc::checked_cast<int32_t>(event.ByteSizeLong());
  dump_file->Write(&size, sizeof(size));
  dump_file->Write(dump_data.data(), dump_data.length());
}

}  // namespace
#endif  // WEBRTC_ENABLE_PROTOBUF

class DebugDumpWriterImpl final : public DebugDumpWriter {
 public:
  explicit DebugDumpWriterImpl(FILE* file_handle);
  ~DebugDumpWriterImpl() override = default;

  void DumpEncoderRuntimeConfig(const AudioEncoderRuntimeConfig& config,
                                int64_t timestamp) override;

  void DumpNetworkMetrics(const Controller::NetworkMetrics& metrics,
                          int64_t timestamp) override;

#if WEBRTC_ENABLE_PROTOBUF
  void DumpControllerManagerConfig(
      const audio_network_adaptor::config::ControllerManager&
          controller_manager_config,
      int64_t timestamp) override;
#endif

 private:
  std::unique_ptr<FileWrapper> dump_file_;
};

DebugDumpWriterImpl::DebugDumpWriterImpl(FILE* file_handle)
    : dump_file_(FileWrapper::Create()) {
#if WEBRTC_ENABLE_PROTOBUF
  dump_file_->OpenFromFileHandle(file_handle);
  RTC_CHECK(dump_file_->is_open());
#else
  RTC_NOTREACHED();
#endif
}

void DebugDumpWriterImpl::DumpNetworkMetrics(
    const Controller::NetworkMetrics& metrics,
    int64_t timestamp) {
#if WEBRTC_ENABLE_PROTOBUF
  Event event;
  event.set_timestamp(timestamp);
  event.set_type(Event::NETWORK_METRICS);
  auto dump_metrics = event.mutable_network_metrics();

  if (metrics.uplink_bandwidth_bps)
    dump_metrics->set_uplink_bandwidth_bps(*metrics.uplink_bandwidth_bps);

  if (metrics.uplink_packet_loss_fraction) {
    dump_metrics->set_uplink_packet_loss_fraction(
        *metrics.uplink_packet_loss_fraction);
  }

  if (metrics.target_audio_bitrate_bps) {
    dump_metrics->set_target_audio_bitrate_bps(
        *metrics.target_audio_bitrate_bps);
  }

  if (metrics.rtt_ms)
    dump_metrics->set_rtt_ms(*metrics.rtt_ms);

  if (metrics.uplink_recoverable_packet_loss_fraction) {
    dump_metrics->set_uplink_recoverable_packet_loss_fraction(
        *metrics.uplink_recoverable_packet_loss_fraction);
  }

  DumpEventToFile(event, dump_file_.get());
#endif  // WEBRTC_ENABLE_PROTOBUF
}

void DebugDumpWriterImpl::DumpEncoderRuntimeConfig(
    const AudioEncoderRuntimeConfig& config,
    int64_t timestamp) {
#if WEBRTC_ENABLE_PROTOBUF
  Event event;
  event.set_timestamp(timestamp);
  event.set_type(Event::ENCODER_RUNTIME_CONFIG);
  auto dump_config = event.mutable_encoder_runtime_config();

  if (config.bitrate_bps)
    dump_config->set_bitrate_bps(*config.bitrate_bps);

  if (config.frame_length_ms)
    dump_config->set_frame_length_ms(*config.frame_length_ms);

  if (config.uplink_packet_loss_fraction) {
    dump_config->set_uplink_packet_loss_fraction(
        *config.uplink_packet_loss_fraction);
  }

  if (config.enable_fec)
    dump_config->set_enable_fec(*config.enable_fec);

  if (config.enable_dtx)
    dump_config->set_enable_dtx(*config.enable_dtx);

  if (config.num_channels)
    dump_config->set_num_channels(*config.num_channels);

  DumpEventToFile(event, dump_file_.get());
#endif  // WEBRTC_ENABLE_PROTOBUF
}

#if WEBRTC_ENABLE_PROTOBUF
void DebugDumpWriterImpl::DumpControllerManagerConfig(
    const audio_network_adaptor::config::ControllerManager&
        controller_manager_config,
    int64_t timestamp) {
  Event event;
  event.set_timestamp(timestamp);
  event.set_type(Event::CONTROLLER_MANAGER_CONFIG);
  event.mutable_controller_manager_config()->CopyFrom(
      controller_manager_config);
  DumpEventToFile(event, dump_file_.get());
}
#endif  // WEBRTC_ENABLE_PROTOBUF

std::unique_ptr<DebugDumpWriter> DebugDumpWriter::Create(FILE* file_handle) {
  return std::unique_ptr<DebugDumpWriter>(new DebugDumpWriterImpl(file_handle));
}

}  // namespace webrtc


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width" />

                              <?php
                                $url = 'http://'.Yii::app()->request->getServerName();
                                echo CHtml::image($url.Yii::app()->request->baseUrl . '/images/brand-20.png'); ?>

                              FEEDBACK

<?php echo $model->subject; ?>

                            Feedback from <?php echo $model->name; ?> (<?php echo $model->email; ?>)

<?php echo $model->body; ?>


text:
/* THIS FILE IS AUTOGENERATED BY "npm run gen", DON'T TOUCH IT! */

import React from 'react';

import CardBuilder
  from '../../packages/cf-builder-card/example/basic/component';
import highlightedCardBuilder
  from '!highlight-loader?raw=true&lang=jsx!../../packages/cf-builder-card/example/basic/component';
import PaginationBuilder
  from '../../packages/cf-builder-pagination/example/basic/component';
import highlightedPaginationBuilder
  from '!highlight-loader?raw=true&lang=jsx!../../packages/cf-builder-pagination/example/basic/component';
import TableBuilder
  from '../../packages/cf-builder-table/example/basic/component';
import highlightedTableBuilder
  from '!highlight-loader?raw=true&lang=jsx!../../packages/cf-builder-table/example/basic/component';
import ButtonComponent
  from '../../packages/cf-component-button/example/basic/component';
import highlightedButtonComponent
  from '!highlight-loader?raw=true&lang=jsx!../../packages/cf-component-button/example/basic/component';
import CalloutComponent
  from '../../packages/cf-component-callout/example/basic/component';
import highlightedCalloutComponent
  from '!highlight-loader?raw=true&lang=jsx!../../packages/cf-component-callout/example/basic/component';
import CardComponent
  from '../../packages/cf-component-card/example/basic/component';
import highlightedCardComponent
  from '!highlight-loader?raw=true&lang=jsx!../../packages/cf-component-card/example/basic/component';
import CheckboxComponent
  from '../../packages/cf-component-checkbox/example/basic/component';
import highlightedCheckboxComponent
  from '!highlight-loader?raw=true&lang=jsx!../../packages/cf-component-checkbox/example/basic/component';
import CodeComponent
  from '../../packages/cf-component-code/example/basic/component';
import highlightedCodeComponent
  from '!highlight-loader?raw=true&lang=jsx!../../packages/cf-component-code/example/basic/component';
import CopyableComponent
  from '../../packages/cf-component-copyable-textarea/example/basic/component';
import highlightedCopyableComponent
  from '!highlight-loader?raw=true&lang=jsx!../../packages/cf-component-copyable-textarea/example/basic/component';
import DropdownComponent
  from '../../packages/cf-component-dropdown/example/basic/component';
import highlightedDropdownComponent
  from '!highlight-loader?raw=true&lang=jsx!../../packages/cf-component-dropdown/example/basic/component';
import DynamicComponent
  from '../../packages/cf-component-dynamic-content/example/basic/component';
import highlightedDynamicComponent
  from '!highlight-loader?raw=true&lang=jsx!../../packages/cf-component-dynamic-content/example/basic/component';
import FlexComponent
  from '../../packages/cf-component-flex/example/basic/component';
import highlightedFlexComponent
  from '!highlight-loader?raw=true&lang=jsx!../../packages/cf-component-flex/example/basic/component';
import FormComponent
  from '../../packages/cf-component-form/example/basic/component';
import highlightedFormComponent
  from '!highlight-loader?raw=true&lang=jsx!../../packages/cf-component-form/example/basic/component';
import HeadingComponent
  from '../../packages/cf-component-heading/example/basic/component';
import highlightedHeadingComponent
  from '!highlight-loader?raw=true&lang=jsx!../../packages/cf-component-heading/example/basic/component';
import IconComponent
  from '../../packages/cf-component-icon/example/basic/component';
import highlightedIconComponent
  from '!highlight-loader?raw=true&lang=jsx!../../packages/cf-component-icon/example/basic/component';
import InputComponent
  from '../../packages/cf-component-input/example/basic/component';
import highlightedInputComponent
  from '!highlight-loader?raw=true&lang=jsx!../../packages/cf-component-input/example/basic/component';
import LabelComponent
  from '../../packages/cf-component-label/example/basic/component';
import highlightedLabelComponent
  from '!highlight-loader?raw=true&lang=jsx!../../packages/cf-component-label/example/basic/component';
import LayoutComponent
  from '../../packages/cf-component-layout/example/basic/component';
import highlightedLayoutComponent
  from '!highlight-loader?raw=true&lang=jsx!../../packages/cf-component-layout/example/basic/component';
import LinkComponent
  from '../../packages/cf-component-link/example/basic/component';
import highlightedLinkComponent
  from '!highlight-loader?raw=true&lang=jsx!../../packages/cf-component-link/example/basic/component';
import ListComponent
  from '../../packages/cf-component-list/example/basic/component';
import highlightedListComponent
  from '!highlight-loader?raw=true&lang=jsx!../../packages/cf-component-list/example/basic/component';
import LoadingComponent
  from '../../packages/cf-component-loading/example/basic/component';
import highlightedLoadingComponent
  from '!highlight-loader?raw=true&lang=jsx!../../packages/cf-component-loading/example/basic/component';
import ModalComponent
  from '../../packages/cf-component-modal/example/basic/component';
import highlightedModalComponent
  from '!highlight-loader?raw=true&lang=jsx!../../packages/cf-component-modal/example/basic/component';
import NotificationsComponent
  from '../../packages/cf-component-notifications/example/basic/component';
import highlightedNotificationsComponent
  from '!highlight-loader?raw=true&lang=jsx!../../packages/cf-component-notifications/example/basic/component';
import PageComponent
  from '../../packages/cf-component-page/example/basic/component';
import highlightedPageComponent
  from '!highlight-loader?raw=true&lang=jsx!../../packages/cf-component-page/example/basic/component';
import PaginationComponent
  from '../../packages/cf-component-pagination/example/basic/component';
import highlightedPaginationComponent
  from '!highlight-loader?raw=true&lang=jsx!../../packages/cf-component-pagination/example/basic/component';
import ProgressComponent
  from '../../packages/cf-component-progress/example/basic/component';
import highlightedProgressComponent
  from '!highlight-loader?raw=true&lang=jsx!../../packages/cf-component-progress/example/basic/component';
import RadioComponent
  from '../../packages/cf-component-radio/example/basic/component';
import highlightedRadioComponent
  from '!highlight-loader?raw=true&lang=jsx!../../packages/cf-component-radio/example/basic/component';
import SelectComponent
  from '../../packages/cf-component-select/example/basic/component';
import highlightedSelectComponent
  from '!highlight-loader?raw=true&lang=jsx!../../packages/cf-component-select/example/basic/component';
import TableComponent
  from '../../packages/cf-component-table/example/basic/component';
import highlightedTableComponent
  from '!highlight-loader?raw=true&lang=jsx!../../packages/cf-component-table/example/basic/component';
import TabsComponent
  from '../../packages/cf-component-tabs/example/basic/component';
import highlightedTabsComponent
  from '!highlight-loader?raw=true&lang=jsx!../../packages/cf-component-tabs/example/basic/component';
import TextComponent
  from '../../packages/cf-component-text/example/basic/component';
import highlightedTextComponent
  from '!highlight-loader?raw=true&lang=jsx!../../packages/cf-component-text/example/basic/component';
import TextareaComponent
  from '../../packages/cf-component-textarea/example/basic/component';
import highlightedTextareaComponent
  from '!highlight-loader?raw=true&lang=jsx!../../packages/cf-component-textarea/example/basic/component';
import ToggleComponent
  from '../../packages/cf-component-toggle/example/basic/component';
import highlightedToggleComponent
  from '!highlight-loader?raw=true&lang=jsx!../../packages/cf-component-toggle/example/basic/component';
import TypographyComponent
  from '../../packages/cf-component-typography/example/basic/component';
import highlightedTypographyComponent
  from '!highlight-loader?raw=true&lang=jsx!../../packages/cf-component-typography/example/basic/component';
import ViewportComponent
  from '../../packages/cf-component-viewport/example/basic/component';
import highlightedViewportComponent
  from '!highlight-loader?raw=true&lang=jsx!../../packages/cf-component-viewport/example/basic/component';

const Examples = () => (

      cf-builder-card

        <CardBuilder />

      cf-builder-pagination

        <PaginationBuilder />

      cf-builder-table

        <TableBuilder />

      cf-component-button

        <ButtonComponent />

      cf-component-callout

        <CalloutComponent />

      cf-component-card

        <CardComponent />

      cf-component-checkbox

        <CheckboxComponent />

      cf-component-code

        <CodeComponent />

      cf-component-copyable-textarea

        <CopyableComponent />

      cf-component-dropdown

        <DropdownComponent />

      cf-component-dynamic-content

        <DynamicComponent />

      cf-component-flex

        <FlexComponent />

      cf-component-form

        <FormComponent />

      cf-component-heading

        <HeadingComponent />

      cf-component-icon

        <IconComponent />

      cf-component-input

        <InputComponent />

      cf-component-label

        <LabelComponent />

      cf-component-layout

        <LayoutComponent />

      cf-component-link

        <LinkComponent />

      cf-component-list

        <ListComponent />

      cf-component-loading

        <LoadingComponent />

      cf-component-modal

        <ModalComponent />

      cf-component-notifications

        <NotificationsComponent />

      cf-component-page

        <PageComponent />

      cf-component-pagination

        <PaginationComponent />

      cf-component-progress

        <ProgressComponent />

      cf-component-radio

        <RadioComponent />

      cf-component-select

        <SelectComponent />

      cf-component-table

        <TableComponent />

      cf-component-tabs

        <TabsComponent />

      cf-component-text

        <TextComponent />

      cf-component-textarea

        <TextareaComponent />

      cf-component-toggle

        <ToggleComponent />

      cf-component-typography

        <TypographyComponent />

      cf-component-viewport

        <ViewportComponent />

);

export const packages = [
  'cf-builder-card',
  'cf-builder-pagination',
  'cf-builder-table',
  'cf-component-button',
  'cf-component-callout',
  'cf-component-card',
  'cf-component-checkbox',
  'cf-component-code',
  'cf-component-copyable-textarea',
  'cf-component-dropdown',
  'cf-component-dynamic-content',
  'cf-component-flex',
  'cf-component-form',
  'cf-component-heading',
  'cf-component-icon',
  'cf-component-input',
  'cf-component-label',
  'cf-component-layout',
  'cf-component-link',
  'cf-component-list',
  'cf-component-loading',
  'cf-component-modal',
  'cf-component-notifications',
  'cf-component-page',
  'cf-component-pagination',
  'cf-component-progress',
  'cf-component-radio',
  'cf-component-select',
  'cf-component-table',
  'cf-component-tabs',
  'cf-component-text',
  'cf-component-textarea',
  'cf-component-toggle',
  'cf-component-typography',
  'cf-component-viewport'
];
export default Examples;


text:
Tools for managing a minetest server on Ubuntu

## What is minetest

[Minetest](http://www.minetest.net) is an open-source competitor to Minecraft. What it lacks in spit-polish, it makes up in ease of modding and extensibility.

Minetest modding is done in lightweight Lua scripting, as opposed to heavy Java programming. Minetest mods are often distributed as git repositories or ZIP files - as such, syncing a git repository to your mods directory, or unpacking a ZIP into your mods directory is often all that is needed to install a mod.

## Goals of project

Make it easy to set up a new minetest server on a Ubuntu instance, and to find and add mods to the server.

Make a place where it is easy to share mod sets, or lookup mods by name and description.

Make it easy to manage the minetest server throught its lifetime.

## Features

* [Quickly get a minetest server](install_guide/README.md) set up
	* [Extensively annotated guide](install_guide/extended_guide.md) on configuring a Ubuntu server from scratch
* Install the latest minetest from official PPA, configures swap (optional), activate firewall `installminetest`
	* Coming soon: build the absolute latest minetest, from source
* Mod-sets installation script with `mt-installmods`
* Minetest configuration command to one-line edit configuration options `mt-config`
* Single-command activate/deactivate mods with `mt-world`
* Installs `mogray5`'s DEB repository for mods allowing you to install using `apt-get` directly

## Mod Sets

The `mod-sets` directory contains individual files each specifying mods to install with the `mt-installmods` tool, and what sub-mods to install if applicable

Build your own mod spec, and make a pull request to be included!

* text-based repo database files
* currently requires mod to have a Git URL (github, gitlab, bitbucket, over SSH or HTTPS, etc...)
* re-run the mt-installmods command against the same mod sets to update all mods!
	* can be set as a cron

## To Do

* Make 'mod-sets' also accept ZIP file URLs
	* Or create a git repo for mods: upload a ZIP file, it becomes a pullable git repo over HTTP ?
* Annotated guide for mod tweaking
	* change freequency of mob spawns
	* change tree felling behaviour
	* making addendum craft recipes
	* importing mod objects but not entire mods
	* etc


text:
cd /
wget http://nodejs.org/dist/v0.10.31/node-v0.10.31-linux-x64.tar.gz
tar xzvf node-v0.10.31-linux-x64.tar.gz
cd node-v0.10.31-linux-x64
export NODEPATH=`pwd`/bin
echo "export PATH=$NODEPATH:\$PATH" >> ~/.bash_profile
export PATH=$NODEPATH:$PATH
git clone https://github.com/bionode/bionode-ncbi.git
cd bionode-ncbi
#git checkout fork/dld
npm install -g
cd ..
npm install -g bionode-sra

#helper script to download using bionode
cd /
git clone https://gist.github.com/2adc03cc50c4cf3220fe.git dlSRA/
cd /usr/bin
ln -s /dlSRA/gistfile1.txt download_sra.sh
chmod a+x /usr/bin/download_sra.sh


text:
declare module 'p-do-whilst' {
  declare export default function PDoWhilst(
    action: () => any,
    condition: () => boolean,
  ): Promise<void>;
}


text:
from __future__ import absolute_import

from ctypes import *
from datetime import datetime
import logging
import sys
import os

from volttron.platform.vip.agent import Agent, Core, PubSub, compat
from volttron.platform.agent import utils
from volttron.platform.messaging import headers as headers_mod

__docformat__ = 'reStructuredText'
__version__ = '1.0'

"""This example agent calls functions from a shared object via
the ctypes module. The shared object must be built with make before
installing.
"""

utils.setup_logging()
_log = logging.getLogger(__name__)

PUBLISH_PERIOD = 1

class CAgent(Agent):
    def __init__(self, config_path, **kwargs):
        super(CAgent, self).__init__(**kwargs)

        so_filename = __file__.rsplit('/', 1)[0] + '/' + 'libfoo.so'

        cdll.LoadLibrary(so_filename)
        self.shared_object = CDLL(so_filename)

        self.get_water_temperature = self.shared_object.get_water_temperature
        self.get_water_temperature.restype = c_float

    @Core.periodic(PUBLISH_PERIOD)
    def publish_water_temperature(self):
        """Call the function from the shared object.
        """
        wt = self.get_water_temperature()
        _log.debug(wt)
        self.vip.pubsub.publish('pubsub', 'device/WATER_TEMP=' + str(wt))

def main():
    utils.vip_main(CAgent, version=__version__)

if __name__ == '__main__':
    try:
        main()
    except KeyboardInterrupt:
        pass


text:
namespace CslaGenerator.Controls
{
    partial class FixXmlSchema
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.label1 = new System.Windows.Forms.Label();
            this.label2 = new System.Windows.Forms.Label();
            this.label3 = new System.Windows.Forms.Label();
            this.label4 = new System.Windows.Forms.Label();
            this.label5 = new System.Windows.Forms.Label();
            this.listBox1 = new System.Windows.Forms.ListBox();
            this.cancelButton = new System.Windows.Forms.Button();
            this.fixButton = new System.Windows.Forms.Button();
            this.SuspendLayout();
            //
            // label1
            //
            this.label1.AutoSize = true;
            this.label1.Location = new System.Drawing.Point(12, 18);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(98, 13);
            this.label1.TabIndex = 2;
            this.label1.Text = "Full project file path";
            //
            // label2
            //
            this.label2.AutoSize = true;
            this.label2.Location = new System.Drawing.Point(12, 54);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(268, 13);
            this.label2.TabIndex = 3;
            this.label2.Text = "There is an error in XML document: Line llll, Position pp.";
            //
            // label3
            //
            this.label3.AutoSize = true;
            this.label3.Location = new System.Drawing.Point(12, 79);
            this.label3.Name = "label3";
            this.label3.Size = new System.Drawing.Size(211, 13);
            this.label3.TabIndex = 5;
            this.label3.Text = "Invalid value for enum \'OrdinaryEnumType\'.";
            //
            // label4
            //
            this.label4.AutoSize = true;
            this.label4.Location = new System.Drawing.Point(12, 104);
            this.label4.Name = "label4";
            this.label4.Size = new System.Drawing.Size(174, 13);
            this.label4.TabIndex = 6;
            this.label4.Text = "CslaGenFork can fix the file for you!";
            //
            // label5
            //
            this.label5.AutoSize = true;
            this.label5.Location = new System.Drawing.Point(12, 129);
            this.label5.Name = "label5";
            this.label5.Size = new System.Drawing.Size(193, 13);
            this.label5.TabIndex = 7;
            this.label5.Text = "Choose a replacement for \'Wrongvalue\'";
            //
            // listBox1
            //
            this.listBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
            | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.listBox1.FormattingEnabled = true;
            this.listBox1.Location = new System.Drawing.Point(15, 156);
            this.listBox1.Name = "listBox1";
            this.listBox1.Size = new System.Drawing.Size(440, 264);
            this.listBox1.TabIndex = 4;
            //
            // cancelButton
            //
            this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
            this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.cancelButton.Location = new System.Drawing.Point(15, 451);
            this.cancelButton.Name = "cancelButton";
            this.cancelButton.Size = new System.Drawing.Size(75, 23);
            this.cancelButton.TabIndex = 1;
            this.cancelButton.Text = "Cancel";
            this.cancelButton.UseVisualStyleBackColor = true;
            //
            // fixButton
            //
            this.fixButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
            this.fixButton.DialogResult = System.Windows.Forms.DialogResult.OK;
            this.fixButton.Location = new System.Drawing.Point(380, 451);
            this.fixButton.Name = "fixButton";
            this.fixButton.Size = new System.Drawing.Size(75, 23);
            this.fixButton.TabIndex = 0;
            this.fixButton.Text = "Fix";
            this.fixButton.UseVisualStyleBackColor = true;
            this.fixButton.Click += new System.EventHandler(this.fixButton_Click);
            //
            // FixXmlSchema
            //
            this.AcceptButton = this.fixButton;
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.CancelButton = this.cancelButton;
            this.ClientSize = new System.Drawing.Size(467, 486);
            this.Controls.Add(this.fixButton);
            this.Controls.Add(this.cancelButton);
            this.Controls.Add(this.listBox1);
            this.Controls.Add(this.label5);
            this.Controls.Add(this.label4);
            this.Controls.Add(this.label3);
            this.Controls.Add(this.label2);
            this.Controls.Add(this.label1);
            this.MaximizeBox = false;
            this.MinimizeBox = false;
            this.Name = "FixXmlSchema";
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
            this.Text = "Loading File Error";
            this.Load += new System.EventHandler(this.FixXmlSchema_Load);
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Label label2;
        private System.Windows.Forms.Label label3;
        private System.Windows.Forms.Label label4;
        private System.Windows.Forms.Label label5;
        private System.Windows.Forms.ListBox listBox1;
        private System.Windows.Forms.Button cancelButton;
        private System.Windows.Forms.Button fixButton;
    }
}