text:
import urlparse # WARNING : The urlparse module is renamed to urllib.parse
import urllib
import os
import re
import datetime
import time
import socket
from xml.dom import minidom

# Import project libraries
from django.utils.timezone import now

import utils_log
import utils_unit
import utils_stream
import utils_http
import utils_messages
import utils_cas
import utils_collection
import stop_watch
import logging

# constant for authentication modes
AUTHENTICATION_MODE_NONE  = 'none'
AUTHENTICATION_MODE_BASIC = 'basic'
AUTHENTICATION_MODE_CAS   = 'cas'

# constant for date time string format
DATETIME_FORMAT = "%Y-%m-%d% %H:%M:%S"

# shared logger
log = None

def get_client_version():
    """Return the version (as a string) of this client.

    The value is automatically set by the maven processing build, so don't
    touch it unless you know what you are doing."""
    return '1.4.00-20170410143941999'

def get_client_artefact():
    """Return the artifact identifier (as a string) of this client.

    The value is automatically set by the maven processing build, so don't
    touch it unless you know what you are doing."""
    return 'motu-client-python'

def build_params(_options):
    """Function that builds the query string for Motu according to the given options"""
    temporal = ''
    geographic = ''
    vertical = ''
    other_opt = ''

    """
    Build the main url to connect to
    """
    query_options = utils_collection.ListMultimap()

    # describeProduct in XML format (sync) / productDownload (sync/async)
    if _options.describe:
        query_options.insert( action  = 'describeProduct',
                              service = _options.service_id,
                              product = _options.product_id
                            )
    elif _options.size:
        query_options.insert( action  = 'getSize',
                              service = _options.service_id,
                              product = _options.product_id
                            )
    else:
        # synchronous/asynchronous mode
        if _options.sync:
            log.info('Synchronous mode set')
            query_options.insert( action  = 'productdownload',
                                  scriptVersion = urllib.quote_plus(get_client_version()),
                                  mode = 'console',
                                  service = _options.service_id,
                                  product = _options.product_id
                                )
        else:
            log.info('Asynchronous mode set')
            query_options.insert( action  = 'productdownload',
                                  scriptVersion = urllib.quote_plus(get_client_version()),
                                  mode    = 'status',
                                  service = _options.service_id,
                                  product = _options.product_id
                                )

    # geographical parameters
    if _options.extraction_geographic:
        query_options.insert( x_lo = _options.longitude_min,
                              x_hi = _options.longitude_max,
                              y_lo = _options.latitude_min,
                              y_hi = _options.latitude_max
                            )

    if _options.extraction_vertical:
        query_options.insert( z_lo = _options.depth_min,
                              z_hi = _options.depth_max
                            )

    if _options.extraction_output:
        query_options.insert(output=_options.outputWritten)
    else:
        query_options.insert(output="netcdf")

    if _options.extraction_temporal:
        # date are strings, and they are send to Motu "as is". If not, we convert them into string
        if _options.date_min is not None or _options.date_min != None:
            date_min = _options.date_min
            if not isinstance(date_min, basestring):
               date_min = date_min.strftime(DATETIME_FORMAT)
            query_options.insert( t_lo = date_min )

        if _options.date_max is not None or _options.date_max != None:
            date_max = _options.date_max
            if not isinstance(date_max, basestring):
               date_max = date_max.strftime(DATETIME_FORMAT)
            query_options.insert( t_hi = date_max )

    variable = _options.variable
    if variable is not None:
        for i, opt in enumerate(variable):
            query_options.insert( variable = opt )

    if _options.console_mode or _options.out_dir.startswith("console") :
        query_options.insert(mode="console")

    return utils_http.encode(query_options)

def check_options(_options):
    """function that checks the given options for coherency."""

    # Check Mandatory Options
    if (_options.auth_mode != AUTHENTICATION_MODE_NONE and
        _options.auth_mode != AUTHENTICATION_MODE_BASIC and
        _options.auth_mode != AUTHENTICATION_MODE_CAS):
        raise Exception(utils_messages.get_external_messages()['motu-client.exception.option.invalid'] % ( _options.auth_mode, 'auth-mode', [AUTHENTICATION_MODE_NONE, AUTHENTICATION_MODE_BASIC, AUTHENTICATION_MODE_CAS]) )

    # if authentication mode is set we check both user & password presence
    if (_options.user == None and
        _options.auth_mode != AUTHENTICATION_MODE_NONE):
        raise Exception(utils_messages.get_external_messages()['motu-client.exception.option.mandatory.user'] % ('user',_options.auth_mode))

    # check that if a user is set, a password should be set also
    if (_options.pwd == None and
        _options.user != None):
        raise Exception(utils_messages.get_external_messages()['motu-client.exception.option.mandatory.password'] % ( 'pwd', _options.user ) )

    #check that if a user is set, an authentication mode should also be set
    if (_options.user != None and
        _options.auth_mode == AUTHENTICATION_MODE_NONE):
        raise Exception(utils_messages.get_external_messages()['motu-client.exception.option.mandatory.mode'] % ( AUTHENTICATION_MODE_NONE, 'auth-mode', _options.user ) )

    # those following parameters are required
    if _options.motu == None :
        raise Exception(utils_messages.get_external_messages()['motu-client.exception.option.mandatory'] % 'motu')

    if _options.service_id == None :
        raise Exception(utils_messages.get_external_messages()['motu-client.exception.option.mandatory'] % 'service-id')

    if _options.product_id == None :
        raise Exception(utils_messages.get_external_messages()['motu-client.exception.option.mandatory'] % 'product-id')

    if _options.out_dir == None :
        raise Exception(utils_messages.get_external_messages()['motu-client.exception.option.mandatory'] % 'out-dir')

    out_dir = _options.out_dir
    if not out_dir.startswith("console"):
        # check directory existence
        if not os.path.exists(out_dir):
            raise Exception(utils_messages.get_external_messages()['motu-client.exception.option.outdir-notexist'] % out_dir)
        # check whether directory is writable or not
        if not os.access(out_dir, os.W_OK):
            raise Exception(utils_messages.get_external_messages()['motu-client.exception.option.outdir-notwritable'] % out_dir)

        if _options.out_name == None :
            raise Exception(utils_messages.get_external_messages()['motu-client.exception.option.mandatory'] % 'out-name')

    # Check PROXY Options
    _options.proxy = False
    if (_options.proxy_server != None) and (len(_options.proxy_server) != 0):
        _options.proxy = True
        # check that proxy server is a valid url
        url = _options.proxy_server
        p = re.compile('^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?')
        m = p.match(url)

        if not m :
            raise Exception( utils_messages.get_external_messages()['motu-client.exception.option.not-url'] % ( 'proxy-server', url ) )
        # check that if proxy-user is defined then proxy-pwd shall be also, and reciprocally.
        if (_options.proxy_user != None) != ( _options.proxy_pwd != None ) :
            raise Exception( utils_messages.get_external_messages()['motu-client.exception.option.linked'] % ('proxy-user', 'proxy-name') )

    # Check VERTICAL Options
    _options.extraction_vertical = False
    if _options.depth_min != None or _options.depth_max != None :
        _options.extraction_vertical = True

    # Check TEMPORAL  Options
    _options.extraction_temporal = False
    if _options.date_min != None or _options.date_max != None :
         _options.extraction_temporal = True

    #Check OUTPUT Options
    _options.extraction_output = False
    if _options.outputWritten != None :
        _options.extraction_output = True

    # Check GEOGRAPHIC Options
    _options.extraction_geographic = False
    if _options.latitude_min != None or _options.latitude_max != None or _options.longitude_min != None or _options.longitude_max != None :
        _options.extraction_geographic = True
        if( _options.latitude_min == None ):
            raise Exception(utils_messages.get_external_messages()['motu-client.exception.option.geographic-box'] % 'latitude_min' )

        if( _options.latitude_max == None ):
            raise Exception(utils_messages.get_external_messages()['motu-client.exception.option.geographic-box'] % 'latitude_max' )

        if( _options.longitude_min == None ):
            raise Exception(utils_messages.get_external_messages()['motu-client.exception.option.geographic-box'] % 'longitude_min' )

        if( _options.longitude_max == None ):
            raise Exception(utils_messages.get_external_messages()['motu-client.exception.option.geographic-box'] % 'longitude_max' )

        tempvalue = float(_options.latitude_min)
        if tempvalue < -90 or tempvalue > 90 :
            raise Exception( utils_messages.get_external_messages()['motu-client.exception.option.out-of-range'] % ( 'latitude_min', str(tempvalue)) )
        tempvalue = float(_options.latitude_max)
        if tempvalue < -90 or tempvalue > 90 :
            raise Exception(utils_messages.get_external_messages()['motu-client.exception.option.out-of-range'] % ( 'latitude_max', str(tempvalue)))
        tempvalue = float(_options.longitude_min)
        tempvalue = normalize_longitude(tempvalue)
        if tempvalue < -180 or tempvalue > 180 :
            raise Exception(utils_messages.get_external_messages()['motu-client.exception.option.out-of-range'] % ( 'logitude_min', str(tempvalue)))
        tempvalue = float(_options.longitude_max)
        tempvalue = normalize_longitude(tempvalue)
        if tempvalue < -180 or tempvalue > 180 :
            raise Exception(utils_messages.get_external_messages()['motu-client.exception.option.out-of-range'] % ( 'longitude_max', str(tempvalue)))

def normalize_longitude(lon):
    if lon > 180:
        while lon > 180:
            lon -= 360
    elif lon < -180:
        while lon < -180:
            lon += 360
    return lon

def total_seconds(td):
    return total_milliseconds(td) / 10**3

def total_milliseconds(td):
    return (td.microseconds + (td.seconds + td.days * 24 * 3600) * 10**6) / 10**3

def get_url_config(_options, data = None):
    # prepare arguments
    kargs = {}
    # proxy
    if _options.proxy:
        #proxyUrl = _options.proxy_server.partition(':')
        proxyUrl = urlparse.urlparse(_options.proxy_server)
        kargs['proxy'] = { "scheme": proxyUrl.scheme,
                           "netloc": proxyUrl.netloc }
        if _options.proxy_user != None:
            kargs['proxy']['user']     = _options.proxy_user
            kargs['proxy']['password'] = _options.proxy_pwd
    # authentication
    if _options.auth_mode == AUTHENTICATION_MODE_BASIC:
        kargs['authentication'] = { 'mode'    : 'basic',
                                    'user'    : _options.user,
                                    'password': _options.pwd }
    # headers
    kargs['headers'] = {"X-Client-Id"     : get_client_artefact(),
                        "X-Client-Version": urllib.quote_plus(get_client_version())}
    # data
    if data != None:
        kargs['data'] = data

    return kargs

def get_requestUrl(dl_url, server, **options):
    """ Get the request url."""
    stopWatch = stop_watch.localThreadStopWatch()
    start_time = datetime.datetime.now()
    stopWatch.start('get_request')
    log.info( "Requesting file to download (this can take a while)..." )

    # Get request id
    m = utils_http.open_url(dl_url, **options)
    responseStr = m.read()
    dom = minidom.parseString(responseStr)
    node = dom.getElementsByTagName('statusModeResponse')[0]
    status = node.getAttribute('status')
    if status == "2":
        msg = node.getAttribute('msg')
        log.error(msg)
        get_req_url = None
    else:
        requestId = node.getAttribute('requestId')
        # Get request url
        get_req_url = server + '?action=getreqstatus&requestid=' + requestId

    stopWatch.stop('get_request')

    return get_req_url

def wait_till_finished(reqUrlCAS, **options):
    stopWatch = stop_watch.localThreadStopWatch()
    start_time = datetime.datetime.now()

class MotuRequestProgress:
    """"
    An object to report progress of requests to the Motu server
    """

    def __init__(self, size_total):
        self.finished_at = None
        self.started_at = now()
        self.size_total = size_total
        self.size_read = 0

    def update(self, size_read):
        self.size_read = size_read

    @property
    def percentage(self):
        return (self.size_read + 0.0) / self.size_total * 100

    @property
    def speed(self):
        # measured in Kbps

        try:
            return (self.size_read + 0.0) / ((self.finished_at if self.finished_at else now()) - self.started_at).total_seconds() / 1000
        except ZeroDivisionError:
            return None

    def __str__(self):
        return '%.1f%% (%d Kbps)' % (self.percentage, self.speed)

def dl_2_file(dl_url, fh, block_size = 65535, isADownloadRequest = None, **options):
    """ Download the file with the main url (of Motu) file.

    Motu can return an error message in the response stream without setting an
    appropriate http error code. So, in that case, the content-type response is
    checked, and if it is text/plain, we consider this as an error.

    dl_url: the complete download url of Motu
    fh: file handler to use to write the downstream"""

    stopWatch = stop_watch.localThreadStopWatch()
    start_time = datetime.datetime.now()
    log.info("Downloading file (this can take a while)..." )

    # download file
    temp = None
    if not fh.startswith("console"):
        temp = open(fh, 'w+b')

    try:
        stopWatch.start('processing')

        m = utils_http.open_url(dl_url, **options)
        try:
            # check the real url (after potential redirection) is not a CAS Url scheme
            match = re.search(utils_cas.CAS_URL_PATTERN, m.url)
            if match is not None:
                service, _, _ = dl_url.partition('?')
                redirection, _, _ = m.url.partition('?')
                raise Exception(utils_messages.get_external_messages()['motu-client.exception.authentication.redirected'] % (service, redirection) )

            # check that content type is not text/plain
            headers = m.info()
            if "Content-Type" in headers:
              if len(headers['Content-Type']) > 0:
                if isADownloadRequest:
                  if headers['Content-Type'].startswith('text') or headers['Content-Type'].find('html') != -1:
                    raise Exception( utils_messages.get_external_messages()['motu-client.exception.motu.error'] % m.read() )

            log.info( 'File type: %s' % headers['Content-Type'] )
            # check if a content length (size of the file) has been send
            size = -1
            if "Content-Length" in headers:
                try:
                    # it should be an integer
                    size = int(headers["Content-Length"])
                    log.info( 'File size: %s (%i B)' % ( utils_unit.convert_bytes(size), size )  )
                except Exception, e:
                    size = -1
                    log.warn( 'File size is not an integer: %s' % headers["Content-Length"] )
            elif temp is not None:
                log.warn( 'File size: %s' % 'unknown' )

            processing_time = datetime.datetime.now();
            stopWatch.stop('processing')
            stopWatch.start('downloading')

            # performs the download
            log.info( 'Downloading file %s' % os.path.abspath(fh) )

            # create a progress instance
            progress = MotuRequestProgress(size_total=size)

            def progress_function(sizeRead):
                progress.update(size_read=sizeRead)
                print '\r%s' % str(progress)

            def none_function(sizeRead):
                percent = 100
                log.info( "- %s (%.1f%%)", utils_unit.convert_bytes(size).rjust(8), percent)
                td = datetime.datetime.now()- start_time;

            if temp is not None:
                read = utils_stream.copy(m,temp,progress_function if size != -1 else none_function, block_size )
            else:
                if isADownloadRequest:
                    #Console mode, only display the NC file URL on stdout
                    read = len(m.url)
                    print (m.url)
                else:
                    import cStringIO
                    output = cStringIO.StringIO()
                    utils_stream.copy(m,output,progress_function if size != -1 else none_function, block_size )
                    read = len(output.getvalue())
                    print (output.getvalue())

            end_time = datetime.datetime.now()
            stopWatch.stop('downloading')

            log.info( "Processing  time : %s", str(processing_time - init_time) )
            log.info( "Downloading time : %s", str(end_time - processing_time) )
            log.info( "Total time       : %s", str(end_time - init_time) )
            log.info( "Download rate    : %s/s", utils_unit.convert_bytes((read / total_milliseconds(end_time - start_time)) * 10**3) )
        finally:
            m.close()
    finally:
        if temp is not None:
            temp.flush()
            temp.close()

    # raise exception if actual size does not match content-length header
    if temp is not None and size >= 0 and read < size:
        raise Exception(utils_messages.get_external_messages()['motu-client.exception.download.too-short'] % (read, size) )

def execute_request(_options):
    """
    the main function that submit a request to motu. Available options are:

    * Proxy configuration (with eventually user credentials)
      - proxy_server: 'http://my-proxy.site.com:8080'
      - proxy_user  : 'john'
      - proxy_pwd   :'doe'

    * Autorisation mode: 'cas', 'basic', 'none'
      - auth_mode: 'cas'

    * User credentials for authentication 'cas' or 'basic'
      - user: 'john'
      - pwd:  'doe'

    * Motu service URL
      - motu: 'http://atoll-dev.cls.fr:30080/mis-gateway-servlet/Motu'

    * Dataset identifier to download
      - product_id: 'dataset-duacs-global-nrt-madt-merged-h'

    * Service identifier to use for retrieving dataset
      - service_id: 'http://purl.org/myocean/ontology/service/database#yourduname'

    * Geographic extraction parameters
      - latitude_max :  10.0
      - latitude_min : -10.0
      - longitude_max: -0.333333333369
      - longitude_min:  0.0

    * Vertical extraction parameters
      - depth_max: 1000
      - depth_min: 0

    * Temporal extraction parameters, as a datetime instance or a string (format: '%Y-%m-%d %H:%M:%S')
      - date_max: 2010-04-25 12:05:36
      - date_min: 2010-04-25

    * Variable extraction
      - variable: ['variable1','variable2']

    * The file name and the directory of the downloaded dataset
      - out_dir : '.'
      - out_name: 'dataset'

    * The block size used to perform download
      - block_size: 12001

    * The socket timeout configuration
      - socket_timeout: 515

    * The user agent to use when performing http requests
      - user_agent: 'motu-api-client'

    """
    global log
    global init_time

    init_time = datetime.datetime.now()
    stopWatch = stop_watch.localThreadStopWatch()
    stopWatch.start()
    try:
        log = logging.getLogger("motu_api")

        # at first, we check given options are ok
        check_options(_options)

        # print some trace info about the options set
        log.log( utils_log.TRACE_LEVEL, '-'*60 )

        for option in dir(_options):
            if not option.startswith('_'):
                log.log(utils_log.TRACE_LEVEL, "%s=%s" % (option, getattr( _options, option ) ) )

        log.log( utils_log.TRACE_LEVEL, '-'*60 )

        # start of url to invoke
        url_service = _options.motu

        # parameters of the invoked service
        url_params  = build_params(_options)

        url_config = get_url_config(_options)

        # check if question mark is in the url
        questionMark = '?'
        if url_service.endswith(questionMark) :
            questionMark = ''
        url = url_service+questionMark+url_params

        if _options.describe == True or _options.size == True:
            _options.out_name = _options.out_name.replace('.nc','.xml')

        # set-up the socket timeout if any
        if _options.socket_timeout != None:
            log.debug("Setting timeout %s" % _options.socket_timeout)
            socket.setdefaulttimeout(_options.socket_timeout)

        if _options.auth_mode == AUTHENTICATION_MODE_CAS:
            stopWatch.start('authentication')
            # perform authentication before acceding service
            download_url = utils_cas.authenticate_CAS_for_URL(url,
                                                             _options.user,
                                                             _options.pwd,**url_config)
            url_service =  download_url.split("?")[0]
            stopWatch.stop('authentication')
        else:
            # if none, we do nothing more, in basic, we let the url requester doing the job
            download_url = url

        # create a file for storing downloaded stream
        fh = os.path.join(_options.out_dir,_options.out_name)
        if _options.console_mode:
            fh = "console"

        try:
            # Synchronous mode
            if _options.sync == True or _options.describe == True or _options.size == True:
                is_a_download_request=False
                if _options.describe == False and _options.size == False:
                    is_a_download_request=True
                dl_2_file(download_url, fh, _options.block_size, is_a_download_request, **url_config)
                log.info( "Done" )
            # Asynchronous mode
            else:
                stopWatch.start('wait_request')
                requestUrl = get_requestUrl(download_url, url_service, **url_config)

                if requestUrl != None:
                    # asynchronous mode
                    status = 0
                    dwurl = ""
                    msg = ""

                    while True:
                        if _options.auth_mode == AUTHENTICATION_MODE_CAS:
                            stopWatch.start('authentication')
                            # perform authentication before acceding service
                            requestUrlCas = utils_cas.authenticate_CAS_for_URL(requestUrl,
                                                                             _options.user,
                                                                             _options.pwd,**url_config)
                            stopWatch.stop('authentication')
                        else:
                            # if none, we do nothing more, in basic, we let the url requester doing the job
                            requestUrlCas = requestUrl

                        m = utils_http.open_url(requestUrlCas, **url_config)
                        motu_reply=m.read()
                        dom = minidom.parseString(motu_reply)

                        for node in dom.getElementsByTagName('statusModeResponse'):
                            status = node.getAttribute('status')
                            dwurl = node.getAttribute('remoteUri')
                            msg = node.getAttribute('msg')

                        # Check status
                        if status == "0" or status == "3": # in progress/pending
                            log.info('Product is not yet available (request in process)')
                            time.sleep(10)
                        else: # finished (error|success)
                            break

                    if status == "2":
                        log.error(msg)
                    if status == "1":
                        log.info('The product is ready for download')
                        if dwurl != "":
                            dl_2_file(dwurl, fh, _options.block_size, not (_options.describe or _options.size), **url_config)
                            log.info( "Done" )
                        else:
                            log.error("Couldn't retrieve file")

                stopWatch.stop('wait_request')

        except:
            try:
                if (os.path.isfile(fh)):
                    os.remove(fh)
            except:
                pass
            raise
    finally:
        stopWatch.stop()


text:
package com.alibaba.weex;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.graphics.PixelFormat;
import android.graphics.Rect;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.support.annotation.NonNull;
import android.support.v7.app.ActionBar;
import android.support.v7.widget.Toolbar;
import android.text.TextUtils;
import android.util.Log;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ProgressBar;
import android.widget.Toast;

import com.alibaba.weex.commons.WXAnalyzerDelegate;
import com.alibaba.weex.commons.util.ScreenUtil;
import com.alibaba.weex.constants.Constants;
import com.alibaba.weex.https.HotRefreshManager;
import com.alibaba.weex.https.WXHttpManager;
import com.alibaba.weex.https.WXHttpTask;
import com.alibaba.weex.https.WXRequestListener;
import com.taobao.weex.IWXRenderListener;
import com.taobao.weex.RenderContainer;
import com.taobao.weex.WXSDKEngine;
import com.taobao.weex.WXSDKInstance;
import com.taobao.weex.appfram.navigator.IActivityNavBarSetter;
import com.taobao.weex.common.IWXDebugProxy;
import com.taobao.weex.common.WXRenderStrategy;
import com.taobao.weex.ui.component.NestedContainer;
import com.taobao.weex.utils.WXFileUtils;
import com.taobao.weex.utils.WXLogUtils;

import java.io.File;
import java.io.UnsupportedEncodingException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.HashMap;

public class WXPageActivity extends WXBaseActivity implements IWXRenderListener, Handler.Callback, WXSDKInstance.NestedInstanceInterceptor {

  private static final String TAG = "WXPageActivity";
  public static final String WXPAGE = "wxpage";
  public static Activity wxPageActivityInstance;
  private ViewGroup mContainer;
  private ProgressBar mProgressBar;
  private WXSDKInstance mInstance;
  private Handler mWXHandler;
  private BroadcastReceiver mReceiver;
  private Uri mUri;
  private HashMap mConfigMap = new HashMap<String, Object>();

  @Override
  public void onCreateNestInstance(WXSDKInstance instance, NestedContainer container) {
    Log.d(TAG, "Nested Instance created.");
  }

  private WXAnalyzerDelegate mWxAnalyzerDelegate;

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_wxpage);
    setCurrentWxPageActivity(this);
    WXSDKEngine.setActivityNavBarSetter(new NavigatorAdapter());
    getWindow().setFormat(PixelFormat.TRANSLUCENT);
    mUri = getIntent().getData();
    Bundle bundle = getIntent().getExtras();
    if (mUri == null && bundle == null) {
      mUri = Uri.parse(Constants.BUNDLE_URL + Constants.WEEX_SAMPLES_KEY);
    }
    if (bundle != null) {
      String bundleUrl = bundle.getString("bundleUrl");
      Log.i(TAG, "bundleUrl==" + bundleUrl);

      if (bundleUrl != null) {
        mConfigMap.put("bundleUrl", bundleUrl + Constants.WEEX_SAMPLES_KEY);
        mUri = Uri.parse(bundleUrl + Constants.WEEX_SAMPLES_KEY);

      }
    } else {
      mConfigMap.put("bundleUrl", mUri.toString() + Constants.WEEX_SAMPLES_KEY);
      // mUri = Uri.parse(mUri.toString() + Constants.WEEX_SAMPLES_KEY)
    }

    if (mUri == null) {
      Toast.makeText(this, "the uri is empty!", Toast.LENGTH_SHORT).show();
      finish();
      return;
    }

    Log.e("TestScript_Guide mUri==", mUri.toString());
    initUIAndData();

    if(WXPAGE.equals(mUri.getScheme())) {
      mUri = mUri.buildUpon().scheme("http").build();
      loadWXfromService(mUri.toString());
      startHotRefresh();
    }else if (TextUtils.equals("http", mUri.getScheme()) || TextUtils.equals("https", mUri.getScheme())) {
      // if url has key "_wx_tpl" then get weex bundle js
      String weexTpl = mUri.getQueryParameter(Constants.WEEX_TPL_KEY);
      String url = TextUtils.isEmpty(weexTpl) ? mUri.toString() : weexTpl;
      loadWXfromService(url);
      startHotRefresh();
    } else {
      loadWXfromLocal(false);
    }
    mInstance.onActivityCreate();
    registerBroadcastReceiver();

    mWxAnalyzerDelegate = new WXAnalyzerDelegate(this);
    mWxAnalyzerDelegate.onCreate();
  }

  @Override
  protected void onStart() {
    super.onStart();
    if(mWxAnalyzerDelegate != null){
      mWxAnalyzerDelegate.onStart();
    }
  }

  private void loadWXfromLocal(boolean reload) {
    if (reload && mInstance != null) {
      mInstance.destroy();
      mInstance = null;
    }
    if (mInstance == null) {
      RenderContainer renderContainer = new RenderContainer(this);

      mInstance = new WXSDKInstance(this);
      mInstance.setRenderContainer(renderContainer);
      mInstance.registerRenderListener(this);
      mInstance.setNestedInstanceInterceptor(this);
      mInstance.setTrackComponent(true);
    }
    mContainer.post(new Runnable() {
      @Override
      public void run() {
        Activity ctx = WXPageActivity.this;
        Rect outRect = new Rect();
        ctx.getWindow().getDecorView().getWindowVisibleDisplayFrame(outRect);
        mConfigMap.put("bundleUrl", mUri.toString());
        String path = mUri.getScheme().equals("file") ? assembleFilePath(mUri) : mUri.toString();
        mInstance.render(TAG, WXFileUtils.loadAsset(path, WXPageActivity.this),
            mConfigMap, null,
            WXRenderStrategy.APPEND_ASYNC);
      }
    });
  }

  private String assembleFilePath(Uri uri) {
    if (uri != null && uri.getPath() != null) {
      return uri.getPath().replaceFirst("/", "");
    }
    return "";
  }

  private void initUIAndData() {

    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);

    ActionBar actionBar = getSupportActionBar();
    actionBar.setDisplayHomeAsUpEnabled(true);
    actionBar.setTitle(mUri.toString().substring(mUri.toString().lastIndexOf(File.separator) + 1));

    mContainer = (ViewGroup) findViewById(R.id.container);
    mProgressBar = (ProgressBar) findViewById(R.id.progress);
    mWXHandler = new Handler(this);
    HotRefreshManager.getInstance().setHandler(mWXHandler);
    addOnListener();
  }

  private void loadWXfromService(final String url) {
    mProgressBar.setVisibility(View.VISIBLE);

    if (mInstance != null) {
      mInstance.destroy();
    }

    RenderContainer renderContainer = new RenderContainer(this);
    mContainer.addView(renderContainer);

    mInstance = new WXSDKInstance(this);
    mInstance.setRenderContainer(renderContainer);
    mInstance.registerRenderListener(this);
    mInstance.setNestedInstanceInterceptor(this);
    mInstance.setBundleUrl(url);
    mInstance.setTrackComponent(true);

    WXHttpTask httpTask = new WXHttpTask();
    httpTask.url = url;
    httpTask.requestListener = new WXRequestListener() {

      @Override
      public void onSuccess(WXHttpTask task) {
        Log.i(TAG, "into--[http:onSuccess] url:" + url);
        try {
          mConfigMap.put("bundleUrl", url);
          mInstance.render(TAG, new String(task.response.data, "utf-8"), mConfigMap, null, ScreenUtil.getDisplayWidth(WXPageActivity.this), ScreenUtil.getDisplayHeight(WXPageActivity.this), WXRenderStrategy.APPEND_ASYNC);
        } catch (UnsupportedEncodingException e) {
          e.printStackTrace();
        }
      }

      @Override
      public void onError(WXHttpTask task) {
        Log.i(TAG, "into--[http:onError]");
        mProgressBar.setVisibility(View.GONE);
        Toast.makeText(getApplicationContext(), "network error!", Toast.LENGTH_SHORT).show();
      }
    };

    WXHttpManager.getInstance().sendRequest(httpTask);
  }

  /**
   * hot refresh
   */
  private void startHotRefresh() {
    try {
      String host = new URL(mUri.toString()).getHost();
      String wsUrl = "ws://" + host + ":8082";
      mWXHandler.obtainMessage(Constants.HOT_REFRESH_CONNECT, 0, 0, wsUrl).sendToTarget();
    } catch (MalformedURLException e) {
      e.printStackTrace();
    }
  }

  private void addOnListener() {

  }

  @Override
  protected void onDestroy() {
    super.onDestroy();
    if (mInstance != null) {
      mInstance.onActivityDestroy();
    }
    mContainer = null;
    // TopScrollHelper.getInstance(getApplicationContext()).onDestory();
    mWXHandler.obtainMessage(Constants.HOT_REFRESH_DISCONNECT).sendToTarget();
    unregisterBroadcastReceiver();

    if(wxPageActivityInstance == this){
      wxPageActivityInstance = null;
    }
    if(mWxAnalyzerDelegate != null){
      mWxAnalyzerDelegate.onDestroy();
    }
  }

  @Override
  public boolean onKeyUp(int keyCode, KeyEvent event) {
    return (mWxAnalyzerDelegate != null && mWxAnalyzerDelegate.onKeyUp(keyCode,event)) || super.onKeyUp(keyCode, event);
  }

  @Override
  protected void onResume() {
    super.onResume();
    if (mInstance != null) {
      mInstance.onActivityResume();
    }
    if(mWxAnalyzerDelegate != null){
      mWxAnalyzerDelegate.onResume();
    }
  }

  public static Activity getCurrentWxPageActivity() {
    return wxPageActivityInstance;
  }

  public static void setCurrentWxPageActivity(Activity activity) {
    wxPageActivityInstance = activity;
  }

  @Override
  public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
    super.onRequestPermissionsResult(requestCode, permissions, grantResults);
    if(mInstance!=null){
      mInstance.onRequestPermissionsResult(requestCode,permissions,grantResults);
    }
  }

  @Override
  protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if(mInstance!=null){
      mInstance.onActivityResult(requestCode,resultCode,data);
    }
  }

  @Override
  public boolean handleMessage(Message msg) {

    switch (msg.what) {
      case Constants.HOT_REFRESH_CONNECT:
        HotRefreshManager.getInstance().connect(msg.obj.toString());
        break;
      case Constants.HOT_REFRESH_DISCONNECT:
        HotRefreshManager.getInstance().disConnect();
        break;
      case Constants.HOT_REFRESH_REFRESH:
        loadWXfromService(mUri.toString());
        break;
      case Constants.HOT_REFRESH_CONNECT_ERROR:
        Toast.makeText(this, "hot refresh connect error!", Toast.LENGTH_SHORT).show();
        break;
      default:
        break;
    }

    return false;
  }

  @Override
  public void onViewCreated(WXSDKInstance instance, View view) {
    WXLogUtils.e("into--[onViewCreated]");
    View wrappedView = null;
    if(mWxAnalyzerDelegate != null){
      wrappedView = mWxAnalyzerDelegate.onWeexViewCreated(instance,view);
    }
    if(wrappedView != null){
      view = wrappedView;
    }

    if(view.getParent() == null) {
      mContainer.addView(view);
    }
    mContainer.requestLayout();
    Log.d("WARenderListener", "renderSuccess");
  }

  @Override
  public void onRenderSuccess(WXSDKInstance instance, int width, int height) {
    if(mWxAnalyzerDelegate  != null){
      mWxAnalyzerDelegate.onWeexRenderSuccess(instance);
    }
    mProgressBar.setVisibility(View.INVISIBLE);
  }

  @Override
  public void onRefreshSuccess(WXSDKInstance instance, int width, int height) {
    mProgressBar.setVisibility(View.GONE);
  }

  @Override
  public void onException(WXSDKInstance instance, String errCode,
                          String msg) {
    if(mWxAnalyzerDelegate != null){
      mWxAnalyzerDelegate.onException(instance,errCode,msg);
    }
    mProgressBar.setVisibility(View.GONE);
    if (!TextUtils.isEmpty(errCode) && errCode.contains("|")) {
      String[] errCodeList = errCode.split("\\|");
      String code = errCodeList[1];
      String codeType = errCode.substring(0, errCode.indexOf("|"));

      if (TextUtils.equals("1", codeType)) {
        String errMsg = "codeType:" + codeType + "\n" + " errCode:" + code + "\n" + " ErrorInfo:" + msg;
        degradeAlert(errMsg);
        return;
      } else {
        Toast.makeText(getApplicationContext(), "errCode:" + errCode + " Render ERROR:" + msg, Toast.LENGTH_SHORT).show();
      }
    }
  }

  private void degradeAlert(String errMsg) {
    new AlertDialog.Builder(this)
        .setTitle("Downgrade success")
        .setMessage(errMsg)
        .setPositiveButton("OK", null)
        .show();

  }

  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
    if (!TextUtils.equals("file", mUri.getScheme())) {
      getMenuInflater().inflate(R.menu.refresh, menu);
    }
    return true;
  }

  @Override
  public boolean onOptionsItemSelected(MenuItem item) {
    int id = item.getItemId();
    if (id == android.R.id.home) {
      finish();
      return true;
    } else if (id == R.id.action_refresh) {
      String scheme = mUri.getScheme();
      if (mUri.isHierarchical() && (TextUtils.equals(scheme, "http") || TextUtils.equals(scheme, "https"))) {
        String weexTpl = mUri.getQueryParameter(Constants.WEEX_TPL_KEY);
        String url = TextUtils.isEmpty(weexTpl) ? mUri.toString() : weexTpl;
        loadWXfromService(url);
        return true;
      }
    }
    return super.onOptionsItemSelected(item);
  }

  @Override
  protected void onPause() {
    super.onPause();
    if (mInstance != null) {
      mInstance.onActivityPause();
    }
    if(mWxAnalyzerDelegate != null){
      mWxAnalyzerDelegate.onPause();
    }
  }

  @Override
  protected void onStop() {
    super.onStop();
    if (mInstance != null) {
      mInstance.onActivityStop();
    }
    if(mWxAnalyzerDelegate != null){
      mWxAnalyzerDelegate.onStop();
    }
  }

  private void registerBroadcastReceiver() {
    mReceiver = new RefreshBroadcastReceiver();
    IntentFilter filter = new IntentFilter();
    filter.addAction(IWXDebugProxy.ACTION_DEBUG_INSTANCE_REFRESH);
    registerReceiver(mReceiver, filter);
  }

  private void unregisterBroadcastReceiver() {
    if (mReceiver != null) {
      unregisterReceiver(mReceiver);
    }
    mReceiver = null;
  }

  private static class NavigatorAdapter implements IActivityNavBarSetter {

    @Override
    public boolean push(String param) {
      return false;
    }

    @Override
    public boolean pop(String param) {
      return false;
    }

    @Override
    public boolean setNavBarRightItem(String param) {
      return false;
    }

    @Override
    public boolean clearNavBarRightItem(String param) {
      return false;
    }

    @Override
    public boolean setNavBarLeftItem(String param) {
      return false;
    }

    @Override
    public boolean clearNavBarLeftItem(String param) {
      return false;
    }

    @Override
    public boolean setNavBarMoreItem(String param) {
      return false;
    }

    @Override
    public boolean clearNavBarMoreItem(String param) {
      return false;
    }

    @Override
    public boolean setNavBarTitle(String param) {
      return false;
    }
  }

  public class RefreshBroadcastReceiver extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
      if (IWXDebugProxy.ACTION_DEBUG_INSTANCE_REFRESH.equals(intent.getAction())) {
        Log.v(TAG, "connect to debug server success");
        if (mUri != null) {
          if (TextUtils.equals(mUri.getScheme(), "http") || TextUtils.equals(mUri.getScheme(), "https")) {
            loadWXfromService(mUri.toString());
          } else {
            loadWXfromLocal(true);
          }
        }
      }
    }
  }
}

redpajama_set_name: RedPajamaGithub


text:
var tap = require("tap")
, rimraf = require("rimraf")
, path = require("path")

tap.test("remove fixtures", function (t) {
  rimraf(path.resolve(__dirname, "fixtures"), function (er) {
    t.ifError(er, "remove fixtures")
    t.end()
  })
})


text:
.class Lcom/mediatek/mmsdk/IEffectHal$Stub$Proxy;
.super Ljava/lang/Object;
.source "IEffectHal.java"

# interfaces
.implements Lcom/mediatek/mmsdk/IEffectHal;

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/mediatek/mmsdk/IEffectHal$Stub;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0xa
    name = "Proxy"
.end annotation

# instance fields
.field private mRemote:Landroid/os/IBinder;

# direct methods
.method constructor <init>(Landroid/os/IBinder;)V
    .locals 0
    .param p1, "remote"    # Landroid/os/IBinder;

    .prologue
    .line 224
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 225
    iput-object p1, p0, Lcom/mediatek/mmsdk/IEffectHal$Stub$Proxy;->mRemote:Landroid/os/IBinder;

    .line 226
    return-void
.end method

# virtual methods
.method public abort(Lcom/mediatek/mmsdk/BaseParameters;)I
    .locals 6
    .param p1, "effectParameter"    # Lcom/mediatek/mmsdk/BaseParameters;
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Landroid/os/RemoteException;
        }
    .end annotation

    .prologue
    .line 326
    invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;

    move-result-object v0

    .line 327
    .local v0, "_data":Landroid/os/Parcel;
    invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;

    move-result-object v1

    .line 330
    .local v1, "_reply":Landroid/os/Parcel;
    :try_start_0
    const-string v3, "com.mediatek.mmsdk.IEffectHal"

    invoke-virtual {v0, v3}, Landroid/os/Parcel;->writeInterfaceToken(Ljava/lang/String;)V

    .line 331
    if-eqz p1, :cond_0

    .line 332
    const/4 v3, 0x1

    invoke-virtual {v0, v3}, Landroid/os/Parcel;->writeInt(I)V

    .line 333
    const/4 v3, 0x0

    invoke-virtual {p1, v0, v3}, Lcom/mediatek/mmsdk/BaseParameters;->writeToParcel(Landroid/os/Parcel;I)V

    .line 338
    :goto_0
    iget-object v3, p0, Lcom/mediatek/mmsdk/IEffectHal$Stub$Proxy;->mRemote:Landroid/os/IBinder;

    const/4 v4, 0x6

    const/4 v5, 0x0

    invoke-interface {v3, v4, v0, v1, v5}, Landroid/os/IBinder;->transact(ILandroid/os/Parcel;Landroid/os/Parcel;I)Z

    .line 339
    invoke-virtual {v1}, Landroid/os/Parcel;->readException()V

    .line 340
    invoke-virtual {v1}, Landroid/os/Parcel;->readInt()I
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    move-result v2

    .line 343
    .local v2, "_result":I
    invoke-virtual {v1}, Landroid/os/Parcel;->recycle()V

    .line 344
    invoke-virtual {v0}, Landroid/os/Parcel;->recycle()V

    .line 346
    return v2

    .line 336
    .end local v2    # "_result":I
    :cond_0
    const/4 v3, 0x0

    :try_start_1
    invoke-virtual {v0, v3}, Landroid/os/Parcel;->writeInt(I)V
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    goto :goto_0

    .line 343
    :catchall_0
    move-exception v3

    invoke-virtual {v1}, Landroid/os/Parcel;->recycle()V

    .line 344
    invoke-virtual {v0}, Landroid/os/Parcel;->recycle()V

    throw v3
.end method

.method public addInputFrame(Landroid/view/GraphicBuffer;Lcom/mediatek/mmsdk/BaseParameters;)I
    .locals 6
    .param p1, "frame"    # Landroid/view/GraphicBuffer;
    .param p2, "parameter"    # Lcom/mediatek/mmsdk/BaseParameters;
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Landroid/os/RemoteException;
        }
    .end annotation

    .prologue
    .line 463
    invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;

    move-result-object v0

    .line 464
    .local v0, "_data":Landroid/os/Parcel;
    invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;

    move-result-object v1

    .line 467
    .local v1, "_reply":Landroid/os/Parcel;
    :try_start_0
    const-string v3, "com.mediatek.mmsdk.IEffectHal"

    invoke-virtual {v0, v3}, Landroid/os/Parcel;->writeInterfaceToken(Ljava/lang/String;)V

    .line 468
    if-eqz p1, :cond_0

    .line 469
    const/4 v3, 0x1

    invoke-virtual {v0, v3}, Landroid/os/Parcel;->writeInt(I)V

    .line 470
    const/4 v3, 0x0

    invoke-virtual {p1, v0, v3}, Landroid/view/GraphicBuffer;->writeToParcel(Landroid/os/Parcel;I)V

    .line 475
    :goto_0
    if-eqz p2, :cond_1

    .line 476
    const/4 v3, 0x1

    invoke-virtual {v0, v3}, Landroid/os/Parcel;->writeInt(I)V

    .line 477
    const/4 v3, 0x0

    invoke-virtual {p2, v0, v3}, Lcom/mediatek/mmsdk/BaseParameters;->writeToParcel(Landroid/os/Parcel;I)V

    .line 482
    :goto_1
    iget-object v3, p0, Lcom/mediatek/mmsdk/IEffectHal$Stub$Proxy;->mRemote:Landroid/os/IBinder;

    const/16 v4, 0xd

    const/4 v5, 0x0

    invoke-interface {v3, v4, v0, v1, v5}, Landroid/os/IBinder;->transact(ILandroid/os/Parcel;Landroid/os/Parcel;I)Z

    .line 483
    invoke-virtual {v1}, Landroid/os/Parcel;->readException()V

    .line 484
    invoke-virtual {v1}, Landroid/os/Parcel;->readInt()I
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    move-result v2

    .line 487
    .local v2, "_result":I
    invoke-virtual {v1}, Landroid/os/Parcel;->recycle()V

    .line 488
    invoke-virtual {v0}, Landroid/os/Parcel;->recycle()V

    .line 490
    return v2

    .line 473
    .end local v2    # "_result":I
    :cond_0
    const/4 v3, 0x0

    :try_start_1
    invoke-virtual {v0, v3}, Landroid/os/Parcel;->writeInt(I)V
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    goto :goto_0

    .line 487
    :catchall_0
    move-exception v3

    invoke-virtual {v1}, Landroid/os/Parcel;->recycle()V

    .line 488
    invoke-virtual {v0}, Landroid/os/Parcel;->recycle()V

    throw v3

    .line 480
    :cond_1
    const/4 v3, 0x0

    :try_start_2
    invoke-virtual {v0, v3}, Landroid/os/Parcel;->writeInt(I)V
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_0

    goto :goto_1
.end method

.method public addOutputFrame(Landroid/view/GraphicBuffer;Lcom/mediatek/mmsdk/BaseParameters;)I
    .locals 6
    .param p1, "frame"    # Landroid/view/GraphicBuffer;
    .param p2, "parameter"    # Lcom/mediatek/mmsdk/BaseParameters;
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Landroid/os/RemoteException;
        }
    .end annotation

    .prologue
    .line 494
    invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;

    move-result-object v0

    .line 495
    .local v0, "_data":Landroid/os/Parcel;
    invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;

    move-result-object v1

    .line 498
    .local v1, "_reply":Landroid/os/Parcel;
    :try_start_0
    const-string v3, "com.mediatek.mmsdk.IEffectHal"

    invoke-virtual {v0, v3}, Landroid/os/Parcel;->writeInterfaceToken(Ljava/lang/String;)V

    .line 499
    if-eqz p1, :cond_0

    .line 500
    const/4 v3, 0x1

    invoke-virtual {v0, v3}, Landroid/os/Parcel;->writeInt(I)V

    .line 501
    const/4 v3, 0x0

    invoke-virtual {p1, v0, v3}, Landroid/view/GraphicBuffer;->writeToParcel(Landroid/os/Parcel;I)V

    .line 506
    :goto_0
    if-eqz p2, :cond_1

    .line 507
    const/4 v3, 0x1

    invoke-virtual {v0, v3}, Landroid/os/Parcel;->writeInt(I)V

    .line 508
    const/4 v3, 0x0

    invoke-virtual {p2, v0, v3}, Lcom/mediatek/mmsdk/BaseParameters;->writeToParcel(Landroid/os/Parcel;I)V

    .line 513
    :goto_1
    iget-object v3, p0, Lcom/mediatek/mmsdk/IEffectHal$Stub$Proxy;->mRemote:Landroid/os/IBinder;

    const/16 v4, 0xe

    const/4 v5, 0x0

    invoke-interface {v3, v4, v0, v1, v5}, Landroid/os/IBinder;->transact(ILandroid/os/Parcel;Landroid/os/Parcel;I)Z

    .line 514
    invoke-virtual {v1}, Landroid/os/Parcel;->readException()V

    .line 515
    invoke-virtual {v1}, Landroid/os/Parcel;->readInt()I
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    move-result v2

    .line 518
    .local v2, "_result":I
    invoke-virtual {v1}, Landroid/os/Parcel;->recycle()V

    .line 519
    invoke-virtual {v0}, Landroid/os/Parcel;->recycle()V

    .line 521
    return v2

    .line 504
    .end local v2    # "_result":I
    :cond_0
    const/4 v3, 0x0

    :try_start_1
    invoke-virtual {v0, v3}, Landroid/os/Parcel;->writeInt(I)V
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    goto :goto_0

    .line 518
    :catchall_0
    move-exception v3

    invoke-virtual {v1}, Landroid/os/Parcel;->recycle()V

    .line 519
    invoke-virtual {v0}, Landroid/os/Parcel;->recycle()V

    throw v3

    .line 511
    :cond_1
    const/4 v3, 0x0

    :try_start_2
    invoke-virtual {v0, v3}, Landroid/os/Parcel;->writeInt(I)V
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_0

    goto :goto_1
.end method

.method public asBinder()Landroid/os/IBinder;
    .locals 1

    .prologue
    .line 229
    iget-object v0, p0, Lcom/mediatek/mmsdk/IEffectHal$Stub$Proxy;->mRemote:Landroid/os/IBinder;

    return-object v0
.end method

.method public configure()I
    .locals 6
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Landroid/os/RemoteException;
        }
    .end annotation

    .prologue
    .line 275
    invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;

    move-result-object v0

    .line 276
    .local v0, "_data":Landroid/os/Parcel;
    invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;

    move-result-object v1

    .line 279
    .local v1, "_reply":Landroid/os/Parcel;
    :try_start_0
    const-string v3, "com.mediatek.mmsdk.IEffectHal"

    invoke-virtual {v0, v3}, Landroid/os/Parcel;->writeInterfaceToken(Ljava/lang/String;)V

    .line 280
    iget-object v3, p0, Lcom/mediatek/mmsdk/IEffectHal$Stub$Proxy;->mRemote:Landroid/os/IBinder;

    const/4 v4, 0x3

    const/4 v5, 0x0

    invoke-interface {v3, v4, v0, v1, v5}, Landroid/os/IBinder;->transact(ILandroid/os/Parcel;Landroid/os/Parcel;I)Z

    .line 281
    invoke-virtual {v1}, Landroid/os/Parcel;->readException()V

    .line 282
    invoke-virtual {v1}, Landroid/os/Parcel;->readInt()I
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    move-result v2

    .line 285
    .local v2, "_result":I
    invoke-virtual {v1}, Landroid/os/Parcel;->recycle()V

    .line 286
    invoke-virtual {v0}, Landroid/os/Parcel;->recycle()V

    .line 288
    return v2

    .line 285
    .end local v2    # "_result":I
    :catchall_0
    move-exception v3

    invoke-virtual {v1}, Landroid/os/Parcel;->recycle()V

    .line 286
    invoke-virtual {v0}, Landroid/os/Parcel;->recycle()V

    throw v3
.end method

.method public getCaptureRequirement(Lcom/mediatek/mmsdk/BaseParameters;)I
    .locals 6
    .param p1, "requirement"    # Lcom/mediatek/mmsdk/BaseParameters;
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Landroid/os/RemoteException;
        }
    .end annotation

    .prologue
    .line 409
    invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;

    move-result-object v0

    .line 410
    .local v0, "_data":Landroid/os/Parcel;
    invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;

    move-result-object v1

    .line 413
    .local v1, "_reply":Landroid/os/Parcel;
    :try_start_0
    const-string v3, "com.mediatek.mmsdk.IEffectHal"

    invoke-virtual {v0, v3}, Landroid/os/Parcel;->writeInterfaceToken(Ljava/lang/String;)V

    .line 414
    iget-object v3, p0, Lcom/mediatek/mmsdk/IEffectHal$Stub$Proxy;->mRemote:Landroid/os/IBinder;

    const/16 v4, 0xa

    const/4 v5, 0x0

    invoke-interface {v3, v4, v0, v1, v5}, Landroid/os/IBinder;->transact(ILandroid/os/Parcel;Landroid/os/Parcel;I)Z

    .line 415
    invoke-virtual {v1}, Landroid/os/Parcel;->readException()V

    .line 416
    invoke-virtual {v1}, Landroid/os/Parcel;->readInt()I

    move-result v2

    .line 417
    .local v2, "_result":I
    invoke-virtual {v1}, Landroid/os/Parcel;->readInt()I

    move-result v3

    if-eqz v3, :cond_0

    .line 418
    invoke-virtual {p1, v1}, Lcom/mediatek/mmsdk/BaseParameters;->readFromParcel(Landroid/os/Parcel;)V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 422
    :cond_0
    invoke-virtual {v1}, Landroid/os/Parcel;->recycle()V

    .line 423
    invoke-virtual {v0}, Landroid/os/Parcel;->recycle()V

    .line 425
    return v2

    .line 422
    .end local v2    # "_result":I
    :catchall_0
    move-exception v3

    invoke-virtual {v1}, Landroid/os/Parcel;->recycle()V

    .line 423
    invoke-virtual {v0}, Landroid/os/Parcel;->recycle()V

    throw v3
.end method

.method public getInterfaceDescriptor()Ljava/lang/String;
    .locals 1

    .prologue
    .line 233
    const-string v0, "com.mediatek.mmsdk.IEffectHal"

    return-object v0
.end method

.method public getNameVersion(Lcom/mediatek/mmsdk/EffectHalVersion;)I
    .locals 6
    .param p1, "version"    # Lcom/mediatek/mmsdk/EffectHalVersion;
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Landroid/os/RemoteException;
        }
    .end annotation

    .prologue
    .line 350
    invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;

    move-result-object v0

    .line 351
    .local v0, "_data":Landroid/os/Parcel;
    invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;

    move-result-object v1

    .line 354
    .local v1, "_reply":Landroid/os/Parcel;
    :try_start_0
    const-string v3, "com.mediatek.mmsdk.IEffectHal"

    invoke-virtual {v0, v3}, Landroid/os/Parcel;->writeInterfaceToken(Ljava/lang/String;)V

    .line 355
    iget-object v3, p0, Lcom/mediatek/mmsdk/IEffectHal$Stub$Proxy;->mRemote:Landroid/os/IBinder;

    const/4 v4, 0x7

    const/4 v5, 0x0

    invoke-interface {v3, v4, v0, v1, v5}, Landroid/os/IBinder;->transact(ILandroid/os/Parcel;Landroid/os/Parcel;I)Z

    .line 356
    invoke-virtual {v1}, Landroid/os/Parcel;->readException()V

    .line 357
    invoke-virtual {v1}, Landroid/os/Parcel;->readInt()I

    move-result v2

    .line 358
    .local v2, "_result":I
    invoke-virtual {v1}, Landroid/os/Parcel;->readInt()I

    move-result v3

    if-eqz v3, :cond_0

    .line 359
    invoke-virtual {p1, v1}, Lcom/mediatek/mmsdk/EffectHalVersion;->readFromParcel(Landroid/os/Parcel;)V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 363
    :cond_0
    invoke-virtual {v1}, Landroid/os/Parcel;->recycle()V

    .line 364
    invoke-virtual {v0}, Landroid/os/Parcel;->recycle()V

    .line 366
    return v2

    .line 363
    .end local v2    # "_result":I
    :catchall_0
    move-exception v3

    invoke-virtual {v1}, Landroid/os/Parcel;->recycle()V

    .line 364
    invoke-virtual {v0}, Landroid/os/Parcel;->recycle()V

    throw v3
.end method

.method public init()I
    .locals 6
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Landroid/os/RemoteException;
        }
    .end annotation

    .prologue
    .line 241
    invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;

    move-result-object v0

    .line 242
    .local v0, "_data":Landroid/os/Parcel;
    invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;

    move-result-object v1

    .line 245
    .local v1, "_reply":Landroid/os/Parcel;
    :try_start_0
    const-string v3, "com.mediatek.mmsdk.IEffectHal"

    invoke-virtual {v0, v3}, Landroid/os/Parcel;->writeInterfaceToken(Ljava/lang/String;)V

    .line 246
    iget-object v3, p0, Lcom/mediatek/mmsdk/IEffectHal$Stub$Proxy;->mRemote:Landroid/os/IBinder;

    const/4 v4, 0x1

    const/4 v5, 0x0

    invoke-interface {v3, v4, v0, v1, v5}, Landroid/os/IBinder;->transact(ILandroid/os/Parcel;Landroid/os/Parcel;I)Z

    .line 247
    invoke-virtual {v1}, Landroid/os/Parcel;->readException()V

    .line 248
    invoke-virtual {v1}, Landroid/os/Parcel;->readInt()I
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    move-result v2

    .line 251
    .local v2, "_result":I
    invoke-virtual {v1}, Landroid/os/Parcel;->recycle()V

    .line 252
    invoke-virtual {v0}, Landroid/os/Parcel;->recycle()V

    .line 254
    return v2

    .line 251
    .end local v2    # "_result":I
    :catchall_0
    move-exception v3

    invoke-virtual {v1}, Landroid/os/Parcel;->recycle()V

    .line 252
    invoke-virtual {v0}, Landroid/os/Parcel;->recycle()V

    throw v3
.end method

.method public prepare()I
    .locals 6
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Landroid/os/RemoteException;
        }
    .end annotation

    .prologue
    .line 429
    invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;

    move-result-object v0

    .line 430
    .local v0, "_data":Landroid/os/Parcel;
    invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;

    move-result-object v1

    .line 433
    .local v1, "_reply":Landroid/os/Parcel;
    :try_start_0
    const-string v3, "com.mediatek.mmsdk.IEffectHal"

    invoke-virtual {v0, v3}, Landroid/os/Parcel;->writeInterfaceToken(Ljava/lang/String;)V

    .line 434
    iget-object v3, p0, Lcom/mediatek/mmsdk/IEffectHal$Stub$Proxy;->mRemote:Landroid/os/IBinder;

    const/16 v4, 0xb

    const/4 v5, 0x0

    invoke-interface {v3, v4, v0, v1, v5}, Landroid/os/IBinder;->transact(ILandroid/os/Parcel;Landroid/os/Parcel;I)Z

    .line 435
    invoke-virtual {v1}, Landroid/os/Parcel;->readException()V

    .line 436
    invoke-virtual {v1}, Landroid/os/Parcel;->readInt()I
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    move-result v2

    .line 439
    .local v2, "_result":I
    invoke-virtual {v1}, Landroid/os/Parcel;->recycle()V

    .line 440
    invoke-virtual {v0}, Landroid/os/Parcel;->recycle()V

    .line 442
    return v2

    .line 439
    .end local v2    # "_result":I
    :catchall_0
    move-exception v3

    invoke-virtual {v1}, Landroid/os/Parcel;->recycle()V

    .line 440
    invoke-virtual {v0}, Landroid/os/Parcel;->recycle()V

    throw v3
.end method

.method public release()I
    .locals 6
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Landroid/os/RemoteException;
        }
    .end annotation

    .prologue
    .line 446
    invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;

    move-result-object v0

    .line 447
    .local v0, "_data":Landroid/os/Parcel;
    invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;

    move-result-object v1

    .line 450
    .local v1, "_reply":Landroid/os/Parcel;
    :try_start_0
    const-string v3, "com.mediatek.mmsdk.IEffectHal"

    invoke-virtual {v0, v3}, Landroid/os/Parcel;->writeInterfaceToken(Ljava/lang/String;)V

    .line 451
    iget-object v3, p0, Lcom/mediatek/mmsdk/IEffectHal$Stub$Proxy;->mRemote:Landroid/os/IBinder;

    const/16 v4, 0xc

    const/4 v5, 0x0

    invoke-interface {v3, v4, v0, v1, v5}, Landroid/os/IBinder;->transact(ILandroid/os/Parcel;Landroid/os/Parcel;I)Z

    .line 452
    invoke-virtual {v1}, Landroid/os/Parcel;->readException()V

    .line 453
    invoke-virtual {v1}, Landroid/os/Parcel;->readInt()I
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    move-result v2

    .line 456
    .local v2, "_result":I
    invoke-virtual {v1}, Landroid/os/Parcel;->recycle()V

    .line 457
    invoke-virtual {v0}, Landroid/os/Parcel;->recycle()V

    .line 459
    return v2

    .line 456
    .end local v2    # "_result":I
    :catchall_0
    move-exception v3

    invoke-virtual {v1}, Landroid/os/Parcel;->recycle()V

    .line 457
    invoke-virtual {v0}, Landroid/os/Parcel;->recycle()V

    throw v3
.end method

.method public setEffectListener(Lcom/mediatek/mmsdk/IEffectListener;)I
    .locals 6
    .param p1, "listener"    # Lcom/mediatek/mmsdk/IEffectListener;
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Landroid/os/RemoteException;
        }
    .end annotation

    .prologue
    .line 370
    invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;

    move-result-object v0

    .line 371
    .local v0, "_data":Landroid/os/Parcel;
    invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;

    move-result-object v1

    .line 374
    .local v1, "_reply":Landroid/os/Parcel;
    :try_start_0
    const-string v3, "com.mediatek.mmsdk.IEffectHal"

    invoke-virtual {v0, v3}, Landroid/os/Parcel;->writeInterfaceToken(Ljava/lang/String;)V

    .line 375
    if-eqz p1, :cond_0

    invoke-interface {p1}, Lcom/mediatek/mmsdk/IEffectListener;->asBinder()Landroid/os/IBinder;

    move-result-object v3

    :goto_0
    invoke-virtual {v0, v3}, Landroid/os/Parcel;->writeStrongBinder(Landroid/os/IBinder;)V

    .line 376
    iget-object v3, p0, Lcom/mediatek/mmsdk/IEffectHal$Stub$Proxy;->mRemote:Landroid/os/IBinder;

    const/16 v4, 0x8

    const/4 v5, 0x0

    invoke-interface {v3, v4, v0, v1, v5}, Landroid/os/IBinder;->transact(ILandroid/os/Parcel;Landroid/os/Parcel;I)Z

    .line 377
    invoke-virtual {v1}, Landroid/os/Parcel;->readException()V

    .line 378
    invoke-virtual {v1}, Landroid/os/Parcel;->readInt()I
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    move-result v2

    .line 381
    .local v2, "_result":I
    invoke-virtual {v1}, Landroid/os/Parcel;->recycle()V

    .line 382
    invoke-virtual {v0}, Landroid/os/Parcel;->recycle()V

    .line 384
    return v2

    .line 375
    .end local v2    # "_result":I
    :cond_0
    const/4 v3, 0x0

    goto :goto_0

    .line 381
    :catchall_0
    move-exception v3

    invoke-virtual {v1}, Landroid/os/Parcel;->recycle()V

    .line 382
    invoke-virtual {v0}, Landroid/os/Parcel;->recycle()V

    throw v3
.end method

.method public setParameter(Ljava/lang/String;Ljava/lang/String;)I
    .locals 6
    .param p1, "key"    # Ljava/lang/String;
    .param p2, "value"    # Ljava/lang/String;
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Landroid/os/RemoteException;
        }
    .end annotation

    .prologue
    .line 388
    invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;

    move-result-object v0

    .line 389
    .local v0, "_data":Landroid/os/Parcel;
    invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;

    move-result-object v1

    .line 392
    .local v1, "_reply":Landroid/os/Parcel;
    :try_start_0
    const-string v3, "com.mediatek.mmsdk.IEffectHal"

    invoke-virtual {v0, v3}, Landroid/os/Parcel;->writeInterfaceToken(Ljava/lang/String;)V

    .line 393
    invoke-virtual {v0, p1}, Landroid/os/Parcel;->writeString(Ljava/lang/String;)V

    .line 394
    invoke-virtual {v0, p2}, Landroid/os/Parcel;->writeString(Ljava/lang/String;)V

    .line 395
    iget-object v3, p0, Lcom/mediatek/mmsdk/IEffectHal$Stub$Proxy;->mRemote:Landroid/os/IBinder;

    const/16 v4, 0x9

    const/4 v5, 0x0

    invoke-interface {v3, v4, v0, v1, v5}, Landroid/os/IBinder;->transact(ILandroid/os/Parcel;Landroid/os/Parcel;I)Z

    .line 396
    invoke-virtual {v1}, Landroid/os/Parcel;->readException()V

    .line 397
    invoke-virtual {v1}, Landroid/os/Parcel;->readInt()I
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    move-result v2

    .line 400
    .local v2, "_result":I
    invoke-virtual {v1}, Landroid/os/Parcel;->recycle()V

    .line 401
    invoke-virtual {v0}, Landroid/os/Parcel;->recycle()V

    .line 403
    return v2

    .line 400
    .end local v2    # "_result":I
    :catchall_0
    move-exception v3

    invoke-virtual {v1}, Landroid/os/Parcel;->recycle()V

    .line 401
    invoke-virtual {v0}, Landroid/os/Parcel;->recycle()V

    throw v3
.end method

.method public start()J
    .locals 7
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Landroid/os/RemoteException;
        }
    .end annotation

    .prologue
    .line 309
    invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;

    move-result-object v0

    .line 310
    .local v0, "_data":Landroid/os/Parcel;
    invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;

    move-result-object v1

    .line 313
    .local v1, "_reply":Landroid/os/Parcel;
    :try_start_0
    const-string v4, "com.mediatek.mmsdk.IEffectHal"

    invoke-virtual {v0, v4}, Landroid/os/Parcel;->writeInterfaceToken(Ljava/lang/String;)V

    .line 314
    iget-object v4, p0, Lcom/mediatek/mmsdk/IEffectHal$Stub$Proxy;->mRemote:Landroid/os/IBinder;

    const/4 v5, 0x5

    const/4 v6, 0x0

    invoke-interface {v4, v5, v0, v1, v6}, Landroid/os/IBinder;->transact(ILandroid/os/Parcel;Landroid/os/Parcel;I)Z

    .line 315
    invoke-virtual {v1}, Landroid/os/Parcel;->readException()V

    .line 316
    invoke-virtual {v1}, Landroid/os/Parcel;->readLong()J
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    move-result-wide v2

    .line 319
    .local v2, "_result":J
    invoke-virtual {v1}, Landroid/os/Parcel;->recycle()V

    .line 320
    invoke-virtual {v0}, Landroid/os/Parcel;->recycle()V

    .line 322
    return-wide v2

    .line 319
    .end local v2    # "_result":J
    :catchall_0
    move-exception v4

    invoke-virtual {v1}, Landroid/os/Parcel;->recycle()V

    .line 320
    invoke-virtual {v0}, Landroid/os/Parcel;->recycle()V

    throw v4
.end method

.method public unconfigure()I
    .locals 6
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Landroid/os/RemoteException;
        }
    .end annotation

    .prologue
    .line 292
    invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;

    move-result-object v0

    .line 293
    .local v0, "_data":Landroid/os/Parcel;
    invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;

    move-result-object v1

    .line 296
    .local v1, "_reply":Landroid/os/Parcel;
    :try_start_0
    const-string v3, "com.mediatek.mmsdk.IEffectHal"

    invoke-virtual {v0, v3}, Landroid/os/Parcel;->writeInterfaceToken(Ljava/lang/String;)V

    .line 297
    iget-object v3, p0, Lcom/mediatek/mmsdk/IEffectHal$Stub$Proxy;->mRemote:Landroid/os/IBinder;

    const/4 v4, 0x4

    const/4 v5, 0x0

    invoke-interface {v3, v4, v0, v1, v5}, Landroid/os/IBinder;->transact(ILandroid/os/Parcel;Landroid/os/Parcel;I)Z

    .line 298
    invoke-virtual {v1}, Landroid/os/Parcel;->readException()V

    .line 299
    invoke-virtual {v1}, Landroid/os/Parcel;->readInt()I
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    move-result v2

    .line 302
    .local v2, "_result":I
    invoke-virtual {v1}, Landroid/os/Parcel;->recycle()V

    .line 303
    invoke-virtual {v0}, Landroid/os/Parcel;->recycle()V

    .line 305
    return v2

    .line 302
    .end local v2    # "_result":I
    :catchall_0
    move-exception v3

    invoke-virtual {v1}, Landroid/os/Parcel;->recycle()V

    .line 303
    invoke-virtual {v0}, Landroid/os/Parcel;->recycle()V

    throw v3
.end method

.method public uninit()I
    .locals 6
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Landroid/os/RemoteException;
        }
    .end annotation

    .prologue
    .line 258
    invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;

    move-result-object v0

    .line 259
    .local v0, "_data":Landroid/os/Parcel;
    invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;

    move-result-object v1

    .line 262
    .local v1, "_reply":Landroid/os/Parcel;
    :try_start_0
    const-string v3, "com.mediatek.mmsdk.IEffectHal"

    invoke-virtual {v0, v3}, Landroid/os/Parcel;->writeInterfaceToken(Ljava/lang/String;)V

    .line 263
    iget-object v3, p0, Lcom/mediatek/mmsdk/IEffectHal$Stub$Proxy;->mRemote:Landroid/os/IBinder;

    const/4 v4, 0x2

    const/4 v5, 0x0

    invoke-interface {v3, v4, v0, v1, v5}, Landroid/os/IBinder;->transact(ILandroid/os/Parcel;Landroid/os/Parcel;I)Z

    .line 264
    invoke-virtual {v1}, Landroid/os/Parcel;->readException()V

    .line 265
    invoke-virtual {v1}, Landroid/os/Parcel;->readInt()I
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    move-result v2

    .line 268
    .local v2, "_result":I
    invoke-virtual {v1}, Landroid/os/Parcel;->recycle()V

    .line 269
    invoke-virtual {v0}, Landroid/os/Parcel;->recycle()V

    .line 271
    return v2

    .line 268
    .end local v2    # "_result":I
    :catchall_0
    move-exception v3

    invoke-virtual {v1}, Landroid/os/Parcel;->recycle()V

    .line 269
    invoke-virtual {v0}, Landroid/os/Parcel;->recycle()V

    throw v3
.end method


text:
package fr.adrienbrault.idea.symfony2plugin.codeInsight;

import org.jetbrains.annotations.NotNull;

/**
 * @author Daniel Espendiller <daniel@espendiller.net>
 */
public interface GotoCompletionProviderInterfaceEx extends GotoCompletionProviderInterface {
    /**
     * Extended lookup element implementation
     * allowing resultSet modification
     */
    default void getLookupElements(@NotNull GotoCompletionProviderLookupArguments arguments) {}
}


text:
from setuptools import setup

setup(
    name='flask-password',
    version='1.0.0',
    packages=['flask_password'],
    url='https://github.com/viniciuschiele/flask-password',
    license='Apache 2.0',
    author='Vinicius Chiele',
    author_email='vinicius.chiele@gmail.com',
    description='Password hashing for Python 3+',
    keywords=['flask', 'password', 'hash', 'hashing'],
    install_requires=['flask>=0.10.1'],
    classifiers=[
        'Development Status :: 5 - Production/Stable',
        'Intended Audience :: Developers',
        'Natural Language :: English',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.2',
        'Programming Language :: Python :: 3.3',
        'Programming Language :: Python :: 3.4',
        'Programming Language :: Python :: Implementation :: CPython'
    ]
)


text:
'use strict'

const test = require('ava')

const action = require('../../src/board/action')
const reducer = require('../../src/board/reducer')

const EXPECTED_INITIAL_STATE = {
  maskWithOutline: true,
  color: {
    fr4: '#666',
    cu: '#ccc',
    cf: '#c93',
    sm: 'rgba(0, 66, 0, 0.75)',
    ss: '#fff',
    sp: '#999',
    out: '#000'
  }
}

test('it should have the correct initial state', (t) => {
  t.deepEqual(reducer(undefined, {}), EXPECTED_INITIAL_STATE)
})

test('it should have the correct namespace', (t) => {
  t.is(reducer.NAME, 'board')
})

test('it should be able to handle a MASK_WITH_OUTLINE action', (t) => {
  const maskOff = {type: action.MASK_WITH_OUTLINE, mask: false}
  const maskOn = {type: action.MASK_WITH_OUTLINE, mask: true}
  let state = EXPECTED_INITIAL_STATE

  state = reducer(state, maskOff)
  t.deepEqual(state, {
    maskWithOutline: false,
    color: EXPECTED_INITIAL_STATE.color
  })

  state = reducer(state, maskOn)
  t.deepEqual(state, {
    maskWithOutline: true,
    color: EXPECTED_INITIAL_STATE.color
  })
})

test('should be able to handle a SET_COLOR action', (t) => {
  const setCopper = {type: action.SET_COLOR, target: 'cu', color: '#ddd'}
  const state = reducer(EXPECTED_INITIAL_STATE, setCopper)

  t.deepEqual(state, {
    maskWithOutline: EXPECTED_INITIAL_STATE.maskWithOutline,
    color: Object.assign({}, EXPECTED_INITIAL_STATE.color, {
      cu: '#ddd'
    })
  })

})


text:
application=$FCLAW_APPLICATIONS_BUILD_DIR/elliptic/heat/heat

# change to source dir for working directory
cd $FCLAW_APPLICATIONS_SRC_DIR/elliptic/heat/

# run programs, exit script with nonzero on failure (or else script will exit with value of last program run)
$FCLAW_MPIRUN $FCLAW_MPI_TEST_FLAGS $application -F regression.ini  || exit 1


text: Meu curriculo baseado no modelo do start bootstrap


text:
ENV["RAILS_ENV"] = "test"

require 'rspec'
require 'factory_girl'
require 'database_cleaner'
require File.expand_path("../dummy/config/environment.rb",  __FILE__)

FactoryGirl.find_definitions

Rails.backtrace_cleaner.remove_silencers!

# Run any available migration
ActiveRecord::Migrator.migrate File.expand_path("../dummy/db/migrate/", __FILE__)

RSpec.configure do |config|
	require 'rspec/expectations'
  config.include RSpec::Matchers
  config.expect_with :rspec do |c|
    c.syntax = [:should, :expect]
  end

  config.before(:suite) do
    DatabaseCleaner.strategy = :transaction
    DatabaseCleaner.clean_with(:truncation)
  end

  config.before(:each) do
    DatabaseCleaner.start
  end

  config.after(:each) do
    DatabaseCleaner.clean
  end

end


text:
package dbx.util.comparator;

import java.util.Comparator;

import dbx.util.Assert;

/**
 * A Comparator that will safely compare nulls to be lower or higher than
 * other objects. Can decorate a given Comparator or work on Comparables.
 *
 * @author Keith Donald
 * @author Juergen Hoeller
 * @since 1.2.2
 * @see Comparable
 */
public class NullSafeComparator<T> implements Comparator<T> {

	/**
	 * A shared default instance of this comparator, treating nulls lower
	 * than non-null objects.
	 * @see Comparators#nullsLow()
	 */
	@SuppressWarnings("rawtypes")
	public static final NullSafeComparator NULLS_LOW = new NullSafeComparator<>(true);

	/**
	 * A shared default instance of this comparator, treating nulls higher
	 * than non-null objects.
	 * @see Comparators#nullsHigh()
	 */
	@SuppressWarnings("rawtypes")
	public static final NullSafeComparator NULLS_HIGH = new NullSafeComparator<>(false);

	private final Comparator<T> nonNullComparator;

	private final boolean nullsLow;

	/**
	 * Create a NullSafeComparator that sorts {@code null} based on
	 * the provided flag, working on Comparables.
	 *
When comparing two non-null objects, their Comparable implementation
	 * will be used: this means that non-null elements (that this Comparator
	 * will be applied to) need to implement Comparable.
	 *
As a convenience, you can use the default shared instances:
	 * {@code NullSafeComparator.NULLS_LOW} and
	 * {@code NullSafeComparator.NULLS_HIGH}.
	 * @param nullsLow whether to treat nulls lower or higher than non-null objects
	 * @see Comparable
	 * @see #NULLS_LOW
	 * @see #NULLS_HIGH
	 */
	@SuppressWarnings("unchecked")
	private NullSafeComparator(boolean nullsLow) {
		this.nonNullComparator = ComparableComparator.INSTANCE;
		this.nullsLow = nullsLow;
	}

	/**
	 * Create a NullSafeComparator that sorts {@code null} based on the
	 * provided flag, decorating the given Comparator.
	 *
When comparing two non-null objects, the specified Comparator will be used.
	 * The given underlying Comparator must be able to handle the elements that this
	 * Comparator will be applied to.
	 * @param comparator the comparator to use when comparing two non-null objects
	 * @param nullsLow whether to treat nulls lower or higher than non-null objects
	 */
	public NullSafeComparator(Comparator<T> comparator, boolean nullsLow) {
		Assert.notNull(comparator, "Non-null Comparator is required");
		this.nonNullComparator = comparator;
		this.nullsLow = nullsLow;
	}

	@Override
	public int compare(T o1, T o2) {
		if (o1 == o2) {
			return 0;
		}
		if (o1 == null) {
			return (this.nullsLow ? -1 : 1);
		}
		if (o2 == null) {
			return (this.nullsLow ? 1 : -1);
		}
		return this.nonNullComparator.compare(o1, o2);
	}

	@Override
	@SuppressWarnings("unchecked")
	public boolean equals(Object obj) {
		if (this == obj) {
			return true;
		}
		if (!(obj instanceof NullSafeComparator)) {
			return false;
		}
		NullSafeComparator<T> other = (NullSafeComparator<T>) obj;
		return (this.nonNullComparator.equals(other.nonNullComparator) && this.nullsLow == other.nullsLow);
	}

	@Override
	public int hashCode() {
		return this.nonNullComparator.hashCode() * (this.nullsLow ? -1 : 1);
	}

	@Override
	public String toString() {
		return "NullSafeComparator: non-null comparator [" + this.nonNullComparator + "]; " +
				(this.nullsLow ? "nulls low" : "nulls high");
	}

}


text: module.exports = require("./lib/bag");


text:
title: The School for Good and Evil
written_by:
available: 'April 15th, 2014'
isbn: '9780062104908'
binding: Hardcover
link_to_buy_page:
image_path: 'https://images.booksense.com/images/908/104/9780062104908.jpg'
link:
---

The New York Times bestselling The School for Good and Evil, the first book in the series, is an epic journey into a dazzling new world, where the only way out of a fairy tale is to live through one. This paperback edition features an Extras section, giving readers a chance to see which school they'd be in and a Q&A with the author, Soman Chainani.

With her glass slippers and devotion to good deeds, Sophie knows she'll earn top marks at the School for Good and join the ranks of past students like Cinderella, Rapunzel, and Snow White. Meanwhile, Agatha, with her shapeless black frocks and wicked black cat, seems a natural fit for the villains in the School for Evil.

The two girls soon find their fortunes reversed--Sophie's dumped in the School for Evil to take Uglification, Death Curses, and Henchmen Training, while Agatha finds herself in the School for Good, thrust among handsome princes and fair maidens for classes in Princess Etiquette and Animal Communication.

But what if the mistake is actually the first clue to discovering who Sophie and Agatha really are?


text:
public class Bibliographie {
}


text:
"""
Tests for the copy operation
"""

import unittest

import dockerscript.operations

class TestCopyOperation(unittest.TestCase):
    """
    Tests for the CopyOperation class
    """

    def test_single_source(self):
        """
        Tests that a single source file is allowed
        """

        source = 'my_file.txt'
        destination = 'dest'

        operation = dockerscript.operations.CopyOperation(
            [source],
            destination,
        )

        self.assertEqual(
            f'COPY ["{source}", "{destination}"]',
            operation.build(),
            'Output for a single source file was correct',
        )

    def test_multiple_sources(self):
        """
        Tests that multiple source files are allowed
        """

        operation = dockerscript.operations.CopyOperation(
            ['file1', 'file2'],
            'dest',
        )

        self.assertEqual(
            'COPY ["file1", "file2", "dest"]',
            operation.build(),
            'Output for multiple source files was correct',
        )

class TestCopy(unittest.TestCase):
    """
    Tests for the copy function
    """

    def test_no_source(self):
        """
        Tests that we do not allow zero source files
        """

        image = dockerscript.Image()

        with self.assertRaises(ValueError):
            dockerscript.operations.copy(image)

    def test_no_destination(self):
        """
        Tests that we do not allow not specifying a destination
        """

        image = dockerscript.Image()

        with self.assertRaises(ValueError):
            dockerscript.operations.copy(image, 'file')

    def test_single_source(self):
        """
        Tests that a single source file is allowed
        """

        source = 'file1'
        destination = 'dest'
        image = dockerscript.Image()

        dockerscript.operations.copy(image, source, destination)

        self.assertListEqual(
            [
                dockerscript.operations.CopyOperation([source], destination),
            ],
            image.operations,
            'Copy operation for a single file was added correctly',
        )

    def test_multiple_sources(self):
        """
        Tests that multiple source files are allowed
        """

        sources = ['file1', 'file2']
        destination = 'dest'
        image = dockerscript.Image()

        dockerscript.operations.copy(image, *sources, destination)

        self.assertListEqual(
            [
                dockerscript.operations.CopyOperation(sources, destination),
            ],
            image.operations,
            'Copy operation for multiple source files was added correctly',
        )


text:
package com.gf.service;

import com.gf.entity.User;

public interface AuthService {

    String login( String username, String password );

}


text:
<plugin>
    <name>${project.name}</name>
    <version>${project.version}</version>
    <description>${project.description}</description>
    <author>Wolf Posdorfer</author>
    <homePage>http://www.jivesoftware.com</homePage>
    <email>9posdorf@informatik.uni-hamburg.de</email>
    <class>com.jivesoftware.spark.plugin.apple.ApplePlugin</class>
    <minSparkVersion>2.7.0</minSparkVersion>
	<os>Mac</os>
	<java>1.7.0</java>
</plugin>


text:
package com.github.misberner.jdtree.binary;

public class BDTNodePair<D> {

	public final BDTNode<D> node1;
	public final BDTNode<D> node2;

	public BDTNodePair(BDTNode<D> node1, BDTNode<D> node2) {
		this.node1 = node1;
		this.node2 = node2;
	}

}


text:
using Avalonia.Controls.Platform;
using Avalonia.Controls.Primitives;
using Avalonia.Controls.Templates;
using Avalonia.Input;
using Avalonia.Interactivity;
using Avalonia.Layout;

#nullable enable

namespace Avalonia.Controls
{
    /// <summary>
    /// A top-level menu control.
    /// </summary>
    public class Menu : MenuBase, IMainMenu
    {
        private static readonly ITemplate<IPanel> DefaultPanel =
            new FuncTemplate<IPanel>(() => new StackPanel { Orientation = Orientation.Horizontal });

        /// <summary>
        /// Initializes a new instance of the <see cref="Menu"/> class.
        /// </summary>
        public Menu()
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="Menu"/> class.
        /// </summary>
        /// <param name="interactionHandler">The menu interaction handler.</param>
        public Menu(IMenuInteractionHandler interactionHandler)
            : base(interactionHandler)
        {
        }

        static Menu()
        {
            ItemsPanelProperty.OverrideDefaultValue(typeof(Menu), DefaultPanel);
        }

        /// <inheritdoc/>
        public override void Close()
        {
            if (!IsOpen)
            {
                return;
            }

            foreach (var i in ((IMenu)this).SubItems)
            {
                i.Close();
            }

            IsOpen = false;
            SelectedIndex = -1;

            RaiseEvent(new RoutedEventArgs
            {
                RoutedEvent = MenuClosedEvent,
                Source = this,
            });
        }

        /// <inheritdoc/>
        public override void Open()
        {
            if (IsOpen)
            {
                return;
            }

            IsOpen = true;

            RaiseEvent(new RoutedEventArgs
            {
                RoutedEvent = MenuOpenedEvent,
                Source = this,
            });
        }

        /// <inheritdoc/>
        protected override void OnAttachedToVisualTree(VisualTreeAttachmentEventArgs e)
        {
            base.OnAttachedToVisualTree(e);

            var inputRoot = e.Root as IInputRoot;

            if (inputRoot?.AccessKeyHandler != null)
            {
                inputRoot.AccessKeyHandler.MainMenu = this;
            }
        }
    }
}


text:
<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <artifactId>tools</artifactId>
    <groupId>com.google.i18n.phonenumbers</groupId>
    <version>1.0-SNAPSHOT</version>
  </parent>
  <groupId>com.google.i18n.phonenumbers</groupId>
  <artifactId>data-tools</artifactId>
  <version>1.0-SNAPSHOT</version>
  <name>Libphonenumber Data tools</name>

  <properties>
    <gae.version>1.5.4</gae.version>
  </properties>

  <repositories>
    <repository>
      <id>mvnrepository</id>
      <url>http://mvnrepository.com/artifact/</url>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
    </repository>
  </repositories>

  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.8.1</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>servlet-api</artifactId>
      <version>2.5</version>
    </dependency>
  </dependencies>

  <build>
    <sourceDirectory>src</sourceDirectory>
    <testSourceDirectory>test</testSourceDirectory>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>2.3.2</version>
        <configuration>
          <source>1.6</source>
          <target>1.6</target>
        </configuration>
      </plugin>
      <plugin>
        <groupId>net.kindleit</groupId>
        <artifactId>maven-gae-plugin</artifactId>
        <version>0.9.1</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-assembly-plugin</artifactId>
        <version>2.2.1</version>
        <configuration>
          <descriptorRefs>
            <descriptorRef>jar-with-dependencies</descriptorRef>
          </descriptorRefs>
          <archive>
            <manifest>
              <addClasspath>true</addClasspath>
              <mainClass>com.google.i18n.phonenumbers.CombineGeoData</mainClass>
            </manifest>
          </archive>
        </configuration>
        <executions>
          <execution>
            <id>make-assembly</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <version>2.1.1</version>
        <configuration>
          <warSourceDirectory>webapp</warSourceDirectory>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.mortbay.jetty</groupId>
        <artifactId>maven-jetty-plugin</artifactId>
        <version>6.1.10</version>
        <configuration>
          <webAppSourceDirectory>webapp</webAppSourceDirectory>
          <scanIntervalSeconds>10</scanIntervalSeconds>
          <webAppConfig>
            <contextPath>/</contextPath>
          </webAppConfig>
          <connectors>
            <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
              <port>8080</port>
              <maxIdleTime>60000</maxIdleTime>
            </connector>
          </connectors>
        </configuration>
      </plugin>
    </plugins>
  </build>

</project>


text:
<?php

namespace PHPSQLParser\Test\Creator;
use PHPSQLParser\PHPSQLParser;
use PHPSQLParser\PHPSQLCreator;

class issue118Test extends \PHPUnit\Framework\TestCase {

    public function testIssue118() {
        $query = "select organism_name as reference from organisms group by reference";
        $parser = new PHPSQLParser();
        $p = $parser->parse($query);
        $creator = new PHPSQLCreator();
        $created = $creator->create($p);
        $expected = getExpectedValue(dirname(__FILE__), 'issue118.sql', false);
        $this->assertSame($expected, $created, 'alias within group by');

    }
}


text:
starterControllers
// A simple controller that fetches a list of data from a service
.controller('exerciseIndexController', function ($scope, exerciseService) {
    $scope.sideMenuController.right.isEnabled = false;
    $scope.sideMenuController.left.isEnabled = false;
    $scope.exercises = exerciseService.all();
});


text:
onClickTitle = function(e) {
  var title = $(this).html();
  var $todo = $(this).parents('.todo');
  $todo.data('title', title);
  $(this).remove();
  $todo.append('<input class="title-input" type="text"/>');
  $todo.attr('draggable', false);

  var $input = $todo.children('.title-input');
  $input.keydown(onKeydownTitle)
        .val(title)
        .focus()
        .focusout(submitTitle);

  // Move cursor to end of input
  var tmpStr = $input.val();
  $input.val('');
  $input.val(tmpStr);
};

onKeydownTitle = function(e) {

  // Press Enter
  if(e.which === 13 && $(this).val() === '') removeTodo.call(this, e);
  else if(e.which === 13) submitTitle.call(this, e);

  if(e.which === 27) {
    renderTitle($(this).parents('.todo'));
  }
};

onCheckChange = function(e) {
  e.preventDefault();
  console.log('test');

  var $todo = $(this).parents('.todo');
  var isDone = this.checked;
  var id = $todo.attr('id');

  if($todo.parents('.todos').hasClass('hide-done')) {
    $todo.fadeOut('300', function(e) {
      $(this).toggleClass('done').attr('style', '');
    });
  } else $todo.toggleClass('done');

  showUndo('Todo completed.', function() {
    updateTodo(id, { isDone: isDone }, function(res) { console.log(res); });
  }, function() {
    $todo.find('.check').attr('checked', !isDone);
    $todo.removeClass('done');
  });

  $todo.children('.title-input').focus();
};

reloadTodo = function(id) {
  $todo = $('#'+id);
  getTodo(id, function(res, success) {
    if(!success) console.log(res);
    $todo.replaceWith(res);
  });
}

showUndo = function(message, action, undoAction) {
  $('.notice').html('' + message + ' ' +
                    ' Undo ')
  $('.notice').fadeIn(0);

  // Could cause race conditions, etc.
  setTimeout(function() { $('.notice').fadeOut(2000); }, 3000);
  window.onbeforeunload = action;
  window.undo_timeout = setTimeout(function() {
    action();
    window.onbeforeunload = null;
  }, 5000);

  $('.undo').click(function(e) {
    e.preventDefault();
    window.onbeforeunload = null
    $('.notice').stop().fadeOut(0);
    clearTimeout(window.undo_timeout);
    undoAction();
  });
};

renderTitle = function($todo, title) {
  var title = title || $todo.data('title');
  $todo.data('title', '');
  $todo.children('.title-input').remove();
  $todo.append('' + title + '');
  $todo.children('.title').click(onClickTitle);
  $todo.attr('draggable', true);
};

removeTodo = function(e) {
  e.preventDefault();

  var $todo = $(this).parents('.todo');
  $todo.fadeOut('300');
  if($todo.children('.title-input').length > 0) renderTitle($todo);

  showUndo('Task deleted.', function() {
    $todo.remove();
    deleteTodo($todo.attr('id'), function(res) {
      console.log(res);
    });
  }, function() {
    $todo.show();
  });
};

submitTitle = function(e) {
  e.preventDefault();
  var $todo = $(this).parents('.todo');
  var title = $(this).val();
  renderTitle($todo, title);
  updateTodo($todo.attr('id'), { title: title }, function(res, success) {
    console.log('update title res: ', res);
  });
};

getTodo = function(id, callback) {
  var url = '/api/todo/' + id;
  $.get(url, callback);
};

renderTodo = function(id, callback) {
  var url = '/api/todo/' + id;
  $.get(url, { render: true }, callback);
};

renderNewTodo = function(todo, callback) {
  $.post('/api/todo', { data: JSON.stringify(todo), render: true }, callback);
};

updateTodo = function(id, todo, callback) {
  var url = '/api/todo/' + id;
  $.put(url, { data: JSON.stringify(todo) }, callback);
};

deleteTodo = function(id, callback) {
  var url = '/api/todo/' + id;
  $.delete(url, callback);
};

reorderTodos = function(ids, callback) {
  $.post('/api/todo/reorder', { data: JSON.stringify(ids) }, callback);
};

saveTodoOrder = function() {
  var ids = $.map($('.todo'), function(todo) { return $(todo).attr('id'); });
  reorderTodos(ids, function(res) { console.log(res); });
};

logout = function(callback) {
  return function(e) {
    e.preventDefault();
    var uid = getCookie('productivUid');
    $.post('http://accounts.productiv.me/api/logout', {
      uid: uid
    }, callback);
  };
};

sortTodosByDone = function(dir) {
  var first = (dir === 'asc') ? -1 : 1;
  var second = (dir === 'asc') ? 1 : -1;
  var items = $('.todo');
  items.sort(function(a, b) {
    if($(a).hasClass('done') && !$(b).hasClass('done'))      return first;
    else if(!$(a).hasClass('done') && $(b).hasClass('done')) return second;
    else return 0;
  });
  $('.todos').html(items);
  $('.sortable').sortable('reload');
};

sortTodosByIndex = function() {
  var items = $('.todo');
  items.sort(function(a, b) {
    return a.index - b.index;
  });
  $('.todos').html(items);
  $('.sortable').sortable('reload');
};

setShowDone = function() {
  if(getCookie('productivShowDone') === 'true') {
    $('.show-done-toggle').html('Done: Show');
    $('.todos').removeClass('hide-done');
    $('.show-done-toggle').attr('data-show', 'true');
  } else {
    $('.show-done-toggle').html('Done: Hidden');
    $('.todos').addClass('hide-done');
    $('.show-done-toggle').attr('data-show', 'false');
  }
};

$(function() {
  // Load settings from cookie
  setShowDone();

  $('.add-todo').keydown(function(e) {
    if(e.which !== 13) return;

    var title = $(this).val();
    var uid = getCookie('productivUid');

    renderNewTodo({ title: title, owner: uid }, function(res) {
      console.log('res: ', res);
      if(!res.success) console.log(res.message);
      else {
        $('.todos').prepend(res.data);
        $('.add-todo').val('');
        var $todo = $('.todos').children('.todo').first();
        console.log($todo);
        $todo.children('.title').click(onClickTitle);
        $todo.children('.remove').click(removeTodo);
        $todo.find('.check').change(onCheckChange);
        saveTodoOrder();
        $('.sortable').sortable('reload');
      }
    });
  });

  $('.todo .check').change(onCheckChange);

  $('.todo .title').click(onClickTitle);

  $('.sortable').sortable({
    forcePlaceholderSize: true,
    items: ':not(.disabled)'
  }).bind('sortupdate', saveTodoOrder);

  $('.logout').click(logout(function(res) {
    if(!res.success) console.log(res);
    else location.href = '/login';
  }));

  hoverShowDone = function(e) {
    if(getCookie('productivShowDone') === 'true')
      $('.show-done-toggle').html('Done: Hide');
    else
      $('.show-done-toggle').html('Done: Show');
  };

  $('.show-done-toggle').click(function(e) {
    var show = getCookie('productivShowDone');
    if(show === 'true') setCookie('productivShowDone', 'false');
    else setCookie('productivShowDone', 'true');
    setShowDone();
  }).hover(hoverShowDone, setShowDone);

  $('.todo .remove').click(removeTodo);

  $('.done-to-bottom').click(function(e) {
    sortTodosByDone('desc');
    saveTodoOrder();
  });

});


text:
import React from 'react';
import { storiesOf } from '@kadira/storybook';

import InputStep from '../InputStep';
import { step } from './data/step';

storiesOf('InputStep', module)
    .add('default', () => <Default />)
;

const style = { padding: 10 };

function Default() {
    return (
        <div style={style}>
            <InputStep node={step} />
        </div>
    );
}


text:
import React, { Component } from 'react';
import EditorList from '../components/editor_list';
import NewEditorWidget from '../components/new_editor_widget';

export default class App extends Component {
  render() {
    return (
      <div>
        <EditorList />
        <NewEditorWidget />
      </div>
    );
  }
}


text:
Much of the [gollum readme](https://github.com/gollum/gollum/blob/master/README.md) still holds true here.

kollum is only intended to be used for the Komodo docs, of course you are free to fork (as per the license) and use it for your own purposes, but that's not the explicit intend of this project.

The biggest differences between kollum and gollum are:

 * omnigollum built-in
 * integreated (and heavily modified) the [breadcrumbs PR](https://github.com/gollum/gollum/pull/902) by @aspyct
 * Templates completely overhauled, using Foundation CSS
   * They are very much biased towards Komodo. It will literally say "Komodo IDE" in there.

Todo:

 * Private routes
 * Separate the templates, css and views into their own repo
 * Built in versioning, ie. a dropdown letting users quickly access a previous version of a page (a version is not a commit, it's much more explicit than that)