text:
/*
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */

package com.github.mysql.protocol.deserializer;

import java.io.EOFException;

import com.github.mysql.io.MysqlBinlogByteArrayInputStream;
import com.github.mysql.protocol.model.RawMysqlPacket;
import com.github.mysql.protocol.model.ResponsePacket;

public class RawResponsePacketDeserializer implements ResponsePacketDeserializer {

    @Override
    public ResponsePacket deserialize(MysqlBinlogByteArrayInputStream is) {

        try {
            RawMysqlPacket packet = new RawMysqlPacket();

            int value = is.readInt(3, true);
            if (value < 0) {
            	throw new EOFException();
            }
            packet.setLength(value);

            value = is.readInt(1, true);
            if (value < 0) {
            	throw new EOFException();
            }
            packet.setSequence(value);

            int total = 0;
            final byte[] body = new byte[packet.getLength()];
            while (total < body.length) {
            	value = is.read(body, total, body.length - total);
                if (value < 0) {
                	throw new EOFException();
                }

                total += value;
            }
            packet.setRawBody(body);

            return packet;
        } catch (Exception ex) {
            throw new RuntimeException(ex);
        }
    }

}


text:
require_relative '../spec_helper'

describe "Addrinfo#socktype" do
  it 'returns 0 by default' do
    Addrinfo.ip('127.0.0.1').socktype.should == 0
  end

  it 'returns the socket type when given' do
    Addrinfo.tcp('127.0.0.1', 80).socktype.should == Socket::SOCK_STREAM
  end

  with_feature :unix_socket do
    describe "for a unix socket" do
      before :each do
        @addrinfo = Addrinfo.unix("/tmp/sock")
      end

      it "returns Socket::SOCK_STREAM" do
        @addrinfo.socktype.should == Socket::SOCK_STREAM
      end
    end
  end
end

redpajama_set_name: RedPajamaGithub


text:
<?php
namespace app\admin\model;

use think\Model;

class BookType extends Model
{
    protected $autoWriteTimestamp = false;
}


text:
Simple DSL for use in classes to motivate a user towards a goal.  An example
goal might be "Complete Profile", or "Setup Project".

This was heavily inspired by [progression](https://github.com/mguterl/progression).

I switched primarily because I wanted to use specific classes rather than inject into
an existing model namespace, and extend the DSL some.

## Installation

Add this line to your application's Gemfile:

    gem 'motivation'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install motivation

## Usage

Create a motivational class and `include Motivation`.

```ruby
require "motivation"

Profile = Struct.new(:twitter_name, :age, :tweets) do
  attr_accessor :cached_tweets_count
end

class ProfileMotivation
  include Motivation

  # Aliases profile to subject for clarity in steps
  subject :profile

  # Provides an #applies? check.  use this block to
  # house logic if you want to selectively apply the
  # motivation.  Note this doesn't impact checks at
  # all, it's so you have a central place for checking
  # if you wish.  true by default
  applies { profile.age <= 14 }

  # Create a simple check.  This defines the predicate `#setup_twitter?`
  check(:setup_twitter) { profile.twitter_name.to_s.length > 0 }

  # Define a step by name then create a check
  step :enter_age
  check { profile.age.to_i > 0 }

  # Define a completetion block.  This is useful if you your
  # check is heavy and you want to use a cached result.  This
  # will define a method `#complete_tweets_added
  step :tweets_added
  check { profile.cached_tweets_count.to_i > 0 || profile.tweets.length > 0 }
  complete { profile.cached_tweets_count = profile.tweets.length.to_i }
end

profile = Profile.new(nil, 42, [1,2,3])
motivation = ProfileMotivation.new(profile)
motivation.setup_twitter? #=> false
profile.twitter_name = "JohnDoe"
motivation.setup_twitter? #=> true

motivation.complete_tweets_added
```

Note that the `check` and `complete` blocks will not tolerate early returns, you
will get a `LocalJumpError`.  If you want to simplify your DSL definitions, you can
just call methods, including privates, in your ProfileMotivation class itself.

You can also iterate over checks for a motivation instance:

```ruby
motivation.each_check do |check|
  puts check.name
  puts check.completed?
end
```

You can get the next incomplete check, this is useful if you want to render
a message in a header, for instance.

```ruby
motivation.next_check
```

Motivation checks are wrapped to provide a tranlation key suitable for use with i18n.
Note it currently does not include i18n, you can pass the generated keys straight to
your helper (such as `t` in Rails views).

```
motivation.next_check.translation_key #=> "motivations.profile.setup_twitter.default"
```

The key format is `motivations.motivation_subject.step_name.[default|complete]`.  Note you can
call `default_translation_key` as a shortcut to always grab the default translation key.  This is
useful if you want to always have the same messaging regardless of completion status.  If you
wish to provide alternate messaging based on completion, fill our your local data with both `default`
and `complete` keys.

Here's an example locale that would match the motivation key structure:

```yaml
en:
  motivations:
    project:
      name:
        default: "Add a project name"
        complete: "Your project is named!"
      support_email:
        default: "Setup a support email address"
        complete: "Your support email is ready to go"
      users_added:
        default: "Now go sign up some users"
        complete: "Awesome, you've got users!"
```

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Added some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request


text:
package org.projectomakase.omakase.pipeline.stage;

import org.projectomakase.omakase.callback.CallbackEvent;

/**
 * Pipeline Stage interface. Implementations of this interface represent a stage in the pipeline.
 *
 * @author Richard Lucas
 */
public interface PipelineStage {

    /**
     * Executes prepare on the pipeline for the current stage.
     *

     * Prepare can be used to either complete the current pipeline stage if no long running actions need to be performed or it can be used to delegate the action to a background process for
     * asynchronous processing.
     *

     *

     * Prepare returns a {@link PipelineStageResult} that contains the pipeline stage's status, any properties that need to be added to the pipeline and any messages returned by the stage.
     *

     *
     * @param pipelineContext
     *         the pipeline context
     * @return a {@link PipelineStageResult} containing the updated pipeline and any messages generated by the pipeline stage.
     */
    PipelineStageResult prepare(PipelineContext pipelineContext);

    /**
     * Handles callback events, sent during asynchronous processing of the pipeline, for the current stage in the pipeline pipeline.
     *

     * OnCallback can be used to handle both intermediate callback events that provide status updates and terminating callback events that provide the final status.
     *

     *

     * OnCallback returns a {@link PipelineStageResult} that contains the pipeline stage's status, any properties that need to be added to the pipeline and any messages returned by the stage.
     *

     *
     * @param pipelineContext
     *         the pipeline context
     * @param callbackEvent
     *         the callback event
     * @return a {@link PipelineStageResult} containing the updated pipeline and any messages generated by the pipeline stage.
     */
    PipelineStageResult onCallback(PipelineContext pipelineContext, CallbackEvent callbackEvent);
}


text:
    <meta http-equiv="Content-Type" content="text/html; charset=Windows-1252" />
    <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5" />
    <title>IBasicRepositoryConfigurator.Configure Method (IAppender[])</title>
    <xml>
    </xml>
    <link rel="stylesheet" type="text/css" href="MSDN.css" />

            log4net SDK Documentation - Microsoft .NET Framework 4.0

IBasicRepositoryConfigurator.Configure Method (IAppender[])

 Initialize the repository using the specified appenders

        [Visual Basic]

Sub Configure( _
   ParamArray appenders As IAppender() _
)

        [C#]

        void Configure(
   params IAppender[] appenders
);

Parameters

          appenders

the appenders to use to log all logging events

Remarks

 Configure the repository to route all logging events to the specified appenders.

See Also

IBasicRepositoryConfigurator Interface | log4net.Repository Namespace | IBasicRepositoryConfigurator.Configure Overload List
<object type="application/x-oleobject" classid="clsid:1e2a7bd0-dab9-11d0-b93a-00c04fc99f9e" viewastext="true" style="display: none;"><param name="Keyword" value="Configure method"></param><param name="Keyword" value="Configure method, IBasicRepositoryConfigurator interface"></param><param name="Keyword" value="IBasicRepositoryConfigurator.Configure method"></param></object>

Copyright 2004-2011 The Apache Software Foundation.


text:
/// Copyright (c) 2012 Ecma International.  All rights reserved.
/// Ecma International makes this code available under the terms and conditions set
/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
/// "Use Terms").   Any redistribution of this code must retain the above
/// copyright and this notice and otherwise comply with the Use Terms.
/**
 * @path ch15/15.4/15.4.4/15.4.4.21/15.4.4.21-1-6.js
 * @description Array.prototype.reduce applied to Number object
 */

function testcase() {
        function callbackfn(prevVal, curVal, idx, obj) {
            return obj instanceof Number;
        }

        var obj = new Number(-128);
        obj.length = 2;
        obj[0] = 11;
        obj[1] = 12;
        return Array.prototype.reduce.call(obj, callbackfn, 1);
    }
runTestCase(testcase);


text:
<?php

namespace Spatie\Payment;

use Illuminate\Support\ServiceProvider;
use Spatie\Payment\Gateways\Europabank\PaymentGateway as EuropabankPaymentGateway;

class PaymentServiceProvider extends ServiceProvider
{
    public function boot()
    {
	$this->mergeConfigFrom(__DIR__.'/../config/payment.php', 'payment');

        $this->loadTranslationsFrom(__DIR__.'/../resources/lang', 'payment');

	$this->publishes([
		__DIR__.'/../resources/lang' => base_path('resources/lang/vendor/payment'),
	], 'lang');

	$this->publishes([
		__DIR__.'/../config/payment.php' => base_path('config/payment.php'),
	], 'config');
    }

    public function register()
    {
        $this->app->bind(PaymentGateway::class, EuropabankPaymentGateway::class);
    }
}


text:
<configuration>
  <property>
    <name>mapred.job.tracker</name>
    <value><HOST>:<PORT2></value>
  </property>
  <property>
	<name>mapred.tasktracker.map.tasks.maximum</name>
	<value><MAX-MAP-TASKS></value>
  </property>
  <property>
	<name>mapred.tasktracker.reduce.tasks.maximum</name>
	<value><MAX-REDUCE-TASKS></value>
  </property>
  <property>
	<name>mapred.task.timeout</name>
	<value>0</value>
  </property>
</configuration>


text:
package net.sourceforge.stripes.config;

/**
 * Interface which is extended by all the major configurable chunks of Stripes.  Allows a
 * Configuration to instantiate and pass configuration to each of the main components in a
 * standardized manner.  It is expected that all ConfigurableComponents will have a public
 * no-arg constructor.
 *
 * @author Tim Fennell
 */
public interface ConfigurableComponent {

    /**
     * Invoked directly after instantiation to allow the configured component to perform
     * one time initialization.  Components are expected to fail loudly if they are not
     * going to be in a valid state after initialization.
     *
     * @param configuration the Configuration object being used by Stripes
     * @throws Exception should be thrown if the component cannot be configured well enough to use.
     */
    void init(Configuration configuration) throws Exception;
}


text:
package com.angkorteam.fintech.dto.builder.client.client;

import java.io.Serializable;
import java.util.Date;

import org.apache.commons.lang3.time.DateFormatUtils;
import org.json.JSONObject;

import io.github.openunirest.http.JsonNode;

public class SavingAccountUnassignOfficerBuilder implements Serializable {

    private String id;
    private boolean hasId;

    public SavingAccountUnassignOfficerBuilder withId(String id) {
        this.id = id;
        this.hasId = true;
        return this;
    }

    private Date unassignedDate;
    private boolean hasunassignedDate;

    public SavingAccountUnassignOfficerBuilder withUnassignedDate(Date unassignedDate) {
        this.unassignedDate = unassignedDate;
        this.hasunassignedDate = true;
        return this;
    }

    private String locale = "en";
    private boolean hasLocale = true;

    public SavingAccountUnassignOfficerBuilder withLocale(String locale) {
        this.locale = locale;
        this.hasLocale = true;
        return this;
    }

    private String dateFormat = "yyyy-MM-dd";
    private boolean hasDateFormat = true;

    public SavingAccountUnassignOfficerBuilder withDateFormat(String dateFormat) {
        this.dateFormat = dateFormat;
        this.hasDateFormat = true;
        return this;
    }

    public JsonNode build() {
        JsonNode object = new com.angkorteam.fintech.dto.JsonNode(new JSONObject());

        if (this.hasId) {
            object.getObject().put("id", this.id);
        }

        if (this.hasLocale) {
            object.getObject().put("locale", this.locale);
        }
        if (this.hasDateFormat) {
            object.getObject().put("dateFormat", this.dateFormat);
        }
        if (this.hasunassignedDate) {
            if (this.unassignedDate != null) {
                object.getObject().put("unassignedDate", DateFormatUtils.format(this.unassignedDate, this.dateFormat));
            } else {
                object.getObject().put("unassignedDate", (String) null);
            }
        }

        return object;
    }

}


text:
import {NavController, Page, SearchBar} from 'ionic/ionic';
import {DataService} from '../service/data';
import {SoundcloudComponent} from './components/soundcloud';
// import {InAppBrowser} from '/../../plugins/cordova-plugin-inappbrowser/src/browser';
import './media.scss';

@Page({
  templateUrl: 'app/media/media.html',
  directives: [SearchBar, SoundcloudComponent]
})
export class Learn {
  constructor(nav: NavController, dataService: DataService) {
    this.nav = nav;
    this.dataService = dataService;
    this.media = null;
    this.soundcloud = null;
  }

  //////////// MEDIA PLAYER START /////////////////
  onInit() {
    this.soundcloud = this.dataService.getSoundcloud();
  }

  playMedia(object) {
    console.log("Logging this", object);

    // Sets the Cordova InAppBrowser Options
    let options = 'toolbar=1,clearcache=1,location=0,closebuttoncaption=done, hardwarebackbutton=1';

    let url = object.source;
    window.open(url,'_blank', options);

  };

  //////////// MEDIA PLAYER END /////////////////

}


text:
layout: post
title:      "Combine Reduce Function w/ an example"
date:       2018-01-10 22:21:58 -0500
permalink:  combine_reduce_function_w_an_example
---

I wanted to write out how the combine reduce function works for the sole purpose of understanding it better myself. Rubber ducking post.

Okay, so Redux offers a Combine Reduce function which combines all of your reducers.

Reducers generally look something like this (please excuse the verbose names):
```
export function booksReducerFunction(state = { books: [] }, action){
  switch (action.type) {
  case "ADD_BOOK":
    return [].concat(state, action.payload)
  case "REMOVE_BOOK":
    let idx = state.indexOf(action.payload)
    return [].concat(state.slice(0, idx), state.slice(idx + 1, state.length))
  default:
    return state
  }
}

export function recommendedBooksReducerFunction(state = { recommendedBooks: [] }, action){
  switch (action.type) {
  case "ADD_RECOMMENDED_BOOK":
    return [].concat(state, action.payload)
  case "REMOVE_RECOMMENDED_BOOK":
    let idx = state.indexOf(action.payload)
    return [].concat(state.slice(0, idx), state.slice(idx + 1, state.length))
  default:
    return state
  }
}
```

As you can see, they take in state and action objects as parameters and based on the action type, they make changes to the state and return the modified state. Notice that the initial default value for the state is an object with an empty array. The final combined state will be a single object with one or more arrays that represent the state for each reducer:
```
state = { books: [], recommendedBooks: [] }
```

Okay, so Redux allows you pass reducers into the combineReducers function to receive a single reducer that does the job of all the reducers you passed in. Let's define a single reducer object with all of our reducers:

```
singleReducerObject = { books: booksReducerFunction, recommendedBooks: recommendedBooksReducerFunction }
```

Okay, now we can receive our single reducer function by simply typing:
`singlerReducerFunction = combineReducers(singleReducerObject)`

Note: you may need to import this by including `import { combineReducers } from 'redux' `at the top of your file.

The combineReducers function looks like this under the hood:
```
export function combineReducers(reducers){
  return (state = {}, action) => {
    return Object.keys(reducers).reduce(
      (nextState, key)=>{
        nextState[key] = reducers[key](state[key], action);
        return nextState
      }, {}
    )
  }
}
```

So let's break this down: what's happening here?

Well, you can notice that we're returning a function that takes in two arguments, `state` (defaulted to an empty object, {})  and `action`, and returns a single final `nextState` object. The function returns a state object by calling a reduce function on the array of the individual reducers:
```
Object.keys(reducers).reduce(
  (nextState, key)=>{
    nextState[key] = reducers[key](state[key], action);
    return nextState
  }, {})
```

In other words, here's the array we're performing the reduce method on:
```
[books, recommendedBooks]
```

Remember, a reduce method simply takes an array and returns a single value by combining them in some way. The arguments to a reduce function are 1) the function that combines the values of the array and 2) a starting value (in this case, an empty array (`{}`) (since we don't want to mutate anything in functional programming).

On the first iteration of the reduce method, we're updating the recommended books portion of the state and adding that to an empty object: When we're done, we'll return a state object as follows, and use that as a starting point for our next iteration:
```
state = { recommendedBooks: recommendedBooks(state.recommendedBooks, action) }
```

For example, if the action type was to add a recommended book, this might evaluvate to something like:
```
state = { recommendedBooks: [ { name: "Gödel, Escher, Bach: an Eternal Golden Braid", datePrinted: 1979 }  ]  }
```

Moving on, for the second iteration of reduce, we're still updating the state object but now we're doing the books portion of it:
```
state.books =  books(state.books, action)
```

Finally we return the state object w/ the updated settings
```
state = { recommendedBooks: recommendedBooks(state.recommendedBooks, action),
books: books(state.books, action) }
```

This also explains why if an action type exists in multiple reducers, it will run through all of those changes (e.g. for example, let's say both the *books* and *recommendedBooks* reducers have an 'ADD_BOOK' action type defined in their case statements: then we would add books to both arrays in the state object. The end!


text:
namespace proximity_auth {

MockProximityAuthClient::MockProximityAuthClient() {}

MockProximityAuthClient::~MockProximityAuthClient() {}

std::unique_ptr<cryptauth::SecureMessageDelegate>
MockProximityAuthClient::CreateSecureMessageDelegate() {
  return base::WrapUnique(CreateSecureMessageDelegatePtr());
}

std::unique_ptr<cryptauth::CryptAuthClientFactory>
MockProximityAuthClient::CreateCryptAuthClientFactory() {
  return base::WrapUnique(CreateCryptAuthClientFactoryPtr());
}

}  // proximity_auth


text:
package buckettree

import (
	"fmt"

	"github.com/golang/protobuf/proto"
	openchainUtil "github.com/hyperledger/fabric/core/util"
)

type bucketNode struct {
	bucketKey          *bucketKey
	childrenCryptoHash [][]byte
	childrenUpdated    []bool
	markedForDeletion  bool
}

func newBucketNode(bucketKey *bucketKey) *bucketNode {
	maxChildren := conf.getMaxGroupingAtEachLevel()
	return &bucketNode{bucketKey, make([][]byte, maxChildren), make([]bool, maxChildren), false}
}

func unmarshalBucketNode(bucketKey *bucketKey, serializedBytes []byte) *bucketNode {
	bucketNode := newBucketNode(bucketKey)
	buffer := proto.NewBuffer(serializedBytes)
	for i := 0; i < conf.getMaxGroupingAtEachLevel(); i++ {
		childCryptoHash, err := buffer.DecodeRawBytes(false)
		if err != nil {
			panic(fmt.Errorf("this error should not occur: %s", err))
		}
		//protobuf's buffer.EncodeRawBytes/buffer.DecodeRawBytes convert a nil into a zero length byte-array, so nil check would not work
		if len(childCryptoHash) != 0 {
			bucketNode.childrenCryptoHash[i] = childCryptoHash
		}
	}
	return bucketNode
}

func (bucketNode *bucketNode) marshal() []byte {
	buffer := proto.NewBuffer([]byte{})
	for i := 0; i < conf.getMaxGroupingAtEachLevel(); i++ {
		buffer.EncodeRawBytes(bucketNode.childrenCryptoHash[i])
	}
	return buffer.Bytes()
}

func (bucketNode *bucketNode) setChildCryptoHash(childKey *bucketKey, cryptoHash []byte) {
	i := bucketNode.bucketKey.getChildIndex(childKey)
	bucketNode.childrenCryptoHash[i] = cryptoHash
	bucketNode.childrenUpdated[i] = true
}

func (bucketNode *bucketNode) mergeBucketNode(anotherBucketNode *bucketNode) {
	if !bucketNode.bucketKey.equals(anotherBucketNode.bucketKey) {
		panic(fmt.Errorf("Nodes with different keys can not be merged. BaseKey=[%#v], MergeKey=[%#v]", bucketNode.bucketKey, anotherBucketNode.bucketKey))
	}
	for i, childCryptoHash := range anotherBucketNode.childrenCryptoHash {
		if !bucketNode.childrenUpdated[i] {
			bucketNode.childrenCryptoHash[i] = childCryptoHash
		}
	}
}

func (bucketNode *bucketNode) computeCryptoHash() []byte {
	cryptoHashContent := []byte{}
	numChildren := 0
	for i, childCryptoHash := range bucketNode.childrenCryptoHash {
		if childCryptoHash != nil {
			numChildren++
			logger.Debugf("Appending crypto-hash for child bucket = [%s]", bucketNode.bucketKey.getChildKey(i))
			cryptoHashContent = append(cryptoHashContent, childCryptoHash...)
		}
	}
	if numChildren == 0 {
		logger.Debugf("Returning <nil> crypto-hash of bucket = [%s] - because, it has not children", bucketNode.bucketKey)
		bucketNode.markedForDeletion = true
		return nil
	}
	if numChildren == 1 {
		logger.Debugf("Propagating crypto-hash of single child node for bucket = [%s]", bucketNode.bucketKey)
		return cryptoHashContent
	}
	logger.Debugf("Computing crypto-hash for bucket [%s] by merging [%d] children", bucketNode.bucketKey, numChildren)
	return openchainUtil.ComputeCryptoHash(cryptoHashContent)
}

func (bucketNode *bucketNode) String() string {
	numChildren := 0
	for i := range bucketNode.childrenCryptoHash {
		if bucketNode.childrenCryptoHash[i] != nil {
			numChildren++
		}
	}
	str := fmt.Sprintf("bucketKey={%s}\n NumChildren={%d}\n", bucketNode.bucketKey, numChildren)
	if numChildren == 0 {
		return str
	}

	str = str + "Childern crypto-hashes:\n"
	for i := range bucketNode.childrenCryptoHash {
		childCryptoHash := bucketNode.childrenCryptoHash[i]
		if childCryptoHash != nil {
			str = str + fmt.Sprintf("childNumber={%d}, cryptoHash={%x}\n", i, childCryptoHash)
		}
	}
	return str
}


text:
package example;

import info.guardianproject.database.sqlcipher.SQLiteDatabase;
import info.guardianproject.database.sqlcipher.SQLiteOpenHelper;
import android.content.Context;
import android.provider.BaseColumns;
import android.util.Log;

/** Helper to the database, manages versions and creation */
public class EventDataSQLHelper extends SQLiteOpenHelper {
	private static final String DATABASE_NAME = "events.db";
	private static final int DATABASE_VERSION = 1;

	// Table name
	public static final String TABLE = "events";

	// Columns
	public static final String TIME = "time";
	public static final String TITLE = "title";

	public EventDataSQLHelper(Context context) {
		super(context, DATABASE_NAME, null, DATABASE_VERSION);
	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		String sql = "create table " + TABLE + "( " + BaseColumns._ID
				+ " integer primary key autoincrement, " + TIME + " integer, "
				+ TITLE + " text not null);";
		Log.d("EventsData", "onCreate: " + sql);
		db.execSQL(sql);
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		if (oldVersion >= newVersion)
			return;

		String sql = null;
		if (oldVersion == 1)
			sql = "alter table " + TABLE + " add note text;";
		if (oldVersion == 2)
			sql = "";

		Log.d("EventsData", "onUpgrade	: " + sql);
		if (sql != null)
			db.execSQL(sql);
	}

}


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Mycotaxon 87: 402 (2003)

#### Original name
Paraparmelia xerica Elix

### Remarks
null


text:
package com.localmedia;

import java.util.TimerTask;
import com.ctrl.XImageBtn;
import com.manniu.manniu.R;
import com.utils.ExceptionsOperator;
import com.utils.LogUtil;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.res.Configuration;
import android.graphics.PixelFormat;
import android.media.AudioManager;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.KeyEvent;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.FrameLayout;
import android.widget.RelativeLayout;
import android.widget.SeekBar;
import android.widget.TextView;
import android.widget.Toast;
import android.widget.SeekBar.OnSeekBarChangeListener;
import org.videolan.libvlc.EventHandler;
import org.videolan.libvlc.IVideoPlayer;
import org.videolan.libvlc.LibVLC;
import org.videolan.libvlc.LibVlcException;
import org.videolan.vlc.util.VLCInstance;

/**
 * @author: li_jianhua Date: 2015-9-1 上午10:26:49
 * To change this template use File | Settings | File Templates.
 * Description:回放--VLC实现可以实现慢放
 */
@SuppressLint("HandlerLeak")
public class Fun_RecordplayActivity extends Activity implements SurfaceHolder.Callback, IVideoPlayer,OnClickListener{

	private final static String TAG = "[Fun_RecordplayActivity]";

	private SurfaceView mSurfaceView;
	private LibVLC mMediaPlayer;
	private SurfaceHolder mSurfaceHolder;

    //private View mLoadingView;

	private int mVideoHeight;
	private int mVideoWidth;
	private int mVideoVisibleHeight;
	private int mVideoVisibleWidth;
	private int mSarNum;
	private int mSarDen;

	private String fileName = "";//文件名
	TextView _title;

	private static long position; //当前进度数
	private long duration; // 总进度数
	// 是否手动拖动播放条标志位
	private boolean isChanging = false;
	private SeekBar seekbar;// 进度条
	private XImageBtn _btnpause,_btnstop,_btnSlow,_btnFast;
	private Button _back;//_upload
	FrameLayout _hreadframeLayout;
	RelativeLayout _layout;
	Handler handler = new Handler();

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.fun_recordplay);

		mSurfaceView = (SurfaceView) findViewById(R.id.record_video);
		mSurfaceView.setOnClickListener(this);
       // mLoadingView = findViewById(R.id.video_loading);
		try {
			mMediaPlayer = VLCInstance.getLibVlcInstance();
		} catch (LibVlcException e) {
			e.printStackTrace();
		}
		fileName = getIntent().getExtras().getString("fileName");
		_title = (TextView) this.findViewById(R.id.dev_name);
		setFileName(fileName);
		_back = (Button) this.findViewById(R.id.btn_back_video);
		_back.setOnClickListener(this);
		//_upload = (Button) this.findViewById(R.id.btn_upload_video);
		//_upload.setOnClickListener(this);
		_hreadframeLayout = (FrameLayout) this.findViewById(R.id.record_frmheader);
		_layout = (RelativeLayout) this.findViewById(R.id.record_footer);
		_btnstop = (XImageBtn) this.findViewById(R.id.btnStopVideo);
		_btnpause = (XImageBtn) this.findViewById(R.id.btn_play);
//		_btnSlow = (XImageBtn) this.findViewById(R.id.btn_slow);
//		_btnFast = (XImageBtn) this.findViewById(R.id.btn_fast);
		_btnstop.setOnClickListener(this);
		_btnSlow.setOnClickListener(this);
		_btnpause.setOnClickListener(this);
		_btnFast.setOnClickListener(this);

		mSurfaceHolder = mSurfaceView.getHolder();
		mSurfaceHolder.setFormat(PixelFormat.RGBX_8888);
		mSurfaceHolder.addCallback(this);
		mMediaPlayer.eventVideoPlayerActivityCreated(true);

		EventHandler em = EventHandler.getInstance();
		em.addHandler(mVlcHandler);

		this.setVolumeControlStream(AudioManager.STREAM_MUSIC);
		mSurfaceView.setKeepScreenOn(true);
		mMediaPlayer.setMediaList();
		fileName = "file:///" + fileName;
		XVideoAdapter._isOpen = true;//点击状态置true

		seekbar = (SeekBar) findViewById(R.id.seekBar1);
		seekbar.setEnabled(false);
		seekbar.setOnSeekBarChangeListener(new OnSeekBarChangeListener() {
			@Override
			public void onStopTrackingTouch(SeekBar seekBar) {
				isChanging = false;
			}
			@Override
			public void onStartTrackingTouch(SeekBar seekBar) {
				isChanging = true;
			}
			@Override
			public void onProgressChanged(SeekBar seekBar, int progress,
					boolean fromUser) {
				if (fromUser == true) {
					mMediaPlayer.setTime(progress);
				}
			}
		});
		show(_layout);
	}

	private void show(View v){
		if(!v.isShown()){
			v.setVisibility(View.VISIBLE);
			handler.postDelayed(dis, 3000);
		}
	}
	/**
	 * 隐藏
	 */
	Runnable dis = new Runnable(){
		@Override
		public void run() {
			showOrHide(_layout);
		}
	};
	/**
	 * 显示、隐藏
	 * @param v
	 */
	private void showOrHide(View v){
		if(v.isShown()){
			v.setVisibility(View.INVISIBLE);
			handler.removeCallbacks(dis);
		}else{
			v.setVisibility(View.VISIBLE);
		}
	}

	private void setFileName(String path){
		try {
			String name = "";
			if(path == null || path == ""){
				return;
			}
			int pathInex = path.lastIndexOf('/');
			if(pathInex == -1){
				return;
			}
			name = path.substring(pathInex + 1);
			int nameLen = name.length();
			_title.setText(name.substring(14, nameLen - 4));
		} catch (Exception e) {
		}
	}

	@Override
	public void onPause() {
		super.onPause();
		try {
			// 先判断是否正在播放
			if (mMediaPlayer != null && mMediaPlayer.isPlaying()) {
				// 如果正在播放我们就先保存这个播放位置
				position = mMediaPlayer.getTime();
				//mMediaPlayer.stop();
			}
		} catch (Exception e) {
		}
	}

	@Override
	protected void onDestroy() {
		super.onDestroy();
		if (mMediaPlayer != null) {
			mMediaPlayer.eventVideoPlayerActivityCreated(false);
			EventHandler em = EventHandler.getInstance();
			em.removeHandler(mVlcHandler);
			//mMediaPlayer.destroy();
			mMediaPlayer = null;
		}
	}

	@Override
	public void onConfigurationChanged(Configuration newConfig) {
		setSurfaceSize(mVideoWidth, mVideoHeight, mVideoVisibleWidth, mVideoVisibleHeight, mSarNum, mSarDen);
		super.onConfigurationChanged(newConfig);
	}

	@Override
	public void surfaceCreated(SurfaceHolder holder) {
		if (mMediaPlayer != null) {
			mSurfaceHolder = holder;
			mMediaPlayer.attachSurface(holder.getSurface(), this);
			if (position>0) {
	            try {
	                //开始播放
	            	mHandler.sendEmptyMessage(HANDLER_BUFFER_END);
	                //并直接从指定位置开始播放
	                mMediaPlayer.setTime(position);
	                position=0;
	            } catch (Exception e) {
	            }
	        }else{
	        	//开始播放
	            play();
	        }
		}
	}
	private void play() {
		try {
			System.out.println("fileName:"+fileName);
//			mMediaPlayer.getMediaList().add(new Media(mMediaPlayer, fileName), false);
//			mMediaPlayer.playIndex(0);

			mMediaPlayer.playMRL(fileName);

		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	public static java.util.Timer _timer = null;
	public void startTimer() {
		try {
			Thread.sleep(100);
			if (_timer != null) {
				_timer.cancel();
				_timer = null;
			}
			if (_timer == null) {
				_timer = new java.util.Timer();
			}
			_timer.schedule(new TimerTask() {
				@Override
				public void run() {
					try {
						if (isChanging == true) {
							return;
						}
						if(mMediaPlayer.getTime() < duration && mMediaPlayer.getTime() != -1)
							seekbar.setProgress((int) mMediaPlayer.getTime());
					} catch (Exception e) {
					}
				}
			}, 0, 10);
		} catch (Exception e) {
			LogUtil.e(TAG, ExceptionsOperator.getExceptionInfo(e));
		}
	}

	void stopTimer() {
		if (_timer != null) {
			_timer.cancel();
			_timer = null;
		}
	}

	@Override
	public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
//		mSurfaceHolder = holder;
//		if (mMediaPlayer != null) {
//			mMediaPlayer.attachSurface(holder.getSurface(), this);//, width, height
//		}
		if (width > 0) {
			mVideoHeight = height;
			mVideoWidth = width;
		}
	}

	@Override
	public void surfaceDestroyed(SurfaceHolder holder) {
		if (mMediaPlayer != null) {
			mMediaPlayer.detachSurface();
		}
	}

	@Override
	public void setSurfaceSize(int width, int height, int visible_width, int visible_height, int sar_num, int sar_den) {
		mVideoHeight = height;
		mVideoWidth = width;
		mVideoVisibleHeight = visible_height;
		mVideoVisibleWidth = visible_width;
		mSarNum = sar_num;
		mSarDen = sar_den;
		mHandler.removeMessages(HANDLER_SURFACE_SIZE);
		mHandler.sendEmptyMessage(HANDLER_SURFACE_SIZE);
	}

	private static final int HANDLER_BUFFER_START = 1;
	private static final int HANDLER_BUFFER_END = 2;
	private static final int HANDLER_SURFACE_SIZE = 3;

	private static final int SURFACE_BEST_FIT = 0;
	private static final int SURFACE_FIT_HORIZONTAL = 1;
	private static final int SURFACE_FIT_VERTICAL = 2;
	private static final int SURFACE_FILL = 3;
	private static final int SURFACE_16_9 = 4;
	private static final int SURFACE_4_3 = 5;
	private static final int SURFACE_ORIGINAL = 6;
	private static final int SURFACE_VERTICAL = 7;
	private int mCurrentSize = SURFACE_BEST_FIT;

	private Handler mVlcHandler = new Handler() {
		@Override
		public void handleMessage(Message msg) {
			if (msg == null || msg.getData() == null)
				return;

			switch (msg.getData().getInt("event")) {
			case EventHandler.MediaPlayerTimeChanged:
				break;
			case EventHandler.MediaPlayerPositionChanged:
				break;
			case EventHandler.MediaPlayerPlaying:
				mHandler.removeMessages(HANDLER_BUFFER_END);
				mHandler.sendEmptyMessage(HANDLER_BUFFER_END);
				break;
			case EventHandler.MediaPlayerBuffering:
				break;
			case EventHandler.MediaPlayerLengthChanged:
				break;
			case EventHandler.MediaPlayerEndReached:
				//播放完成
				onClick(_btnstop);
				break;
			case EventHandler.MediaPlayerStopped:
//				Toast.makeText(getApplicationContext(), "stream stop or stream offline", Toast.LENGTH_SHORT).show();
//				mMediaPlayer.stop();
//				finish();
				break;
			case EventHandler.MediaPlayerEncounteredError:
				Toast.makeText(getApplicationContext(), "MediaPlayer error", Toast.LENGTH_SHORT).show();
				mMediaPlayer.stop();
				finish();
				break;
			}
		}
	};

	private Handler mHandler = new Handler() {
		@Override
		public void handleMessage(Message msg) {
			switch (msg.what) {
			case HANDLER_BUFFER_START:
               // showLoading();
				break;
			case HANDLER_BUFFER_END:
               // hideLoading();
				duration = mMediaPlayer.getLength();
				seekbar.setMax((int) duration);
    			seekbar.setEnabled(true);
    			startTimer();
				break;
			case HANDLER_SURFACE_SIZE:
				changeSurfaceSize();
				break;
//			case EventHandler.MediaPlayerPaused:
//				_btnpause.SetImages(R.drawable.pause, R.drawable.pause);
//				break;
//			case EventHandler.MediaPlayerPlaying:
//				_btnpause.SetImages(R.drawable.play, R.drawable.play);
//				break;
			}
		}
	};

//	private void showLoading() {
//        mLoadingView.setVisibility(View.VISIBLE);
//	}
//
//	private void hideLoading() {
//        mLoadingView.setVisibility(View.GONE);
//	}

	//判断横竖屏
	@SuppressWarnings("static-access")
	public boolean isScreenChange() {
		Configuration cf = this.getResources().getConfiguration(); //获取设置的配置信息
		int ori = cf.orientation ; //获取屏幕方向
		if(ori == cf.ORIENTATION_LANDSCAPE){//横屏
			_hreadframeLayout.setVisibility(View.GONE);
			return true;
		}else if(ori == cf.ORIENTATION_PORTRAIT){//竖屏
			_hreadframeLayout.setVisibility(View.VISIBLE);
			return false;
		}
		return false;
	}

	@SuppressWarnings("deprecation")
	private void changeSurfaceSize() {
		try {
			// get screen size
			int dw = getWindowManager().getDefaultDisplay().getWidth();
			int dh = getWindowManager().getDefaultDisplay().getHeight();

			// calculate aspect ratio
			double ar = (double) mVideoWidth / (double) mVideoHeight;
			// calculate display aspect ratio
			double dar = (double) dw / (double) dh;

			if(isScreenChange()){//横
				mCurrentSize = SURFACE_FILL;
			}else{
				mCurrentSize = SURFACE_VERTICAL;
			}

			switch (mCurrentSize) {
			case SURFACE_BEST_FIT:
				if (dar < ar)
					dh = (int) (dw / ar);
				else
					dw = (int) (dh * ar);
				break;
			case SURFACE_FIT_HORIZONTAL:
				dh = (int) (dw / ar);
				break;
			case SURFACE_FIT_VERTICAL:
				dw = (int) (dh * ar);
				break;
			case SURFACE_FILL:
				break;
			case SURFACE_16_9:
				ar = 16.0 / 9.0;
				if (dar < ar)
					dh = (int) (dw / ar);
				else
					dw = (int) (dh * ar);
				break;
			case SURFACE_4_3:
				ar = 4.0 / 3.0;
				if (dar < ar)
					dh = (int) (dw / ar);
				else
					dw = (int) (dh * ar);
				break;
			case SURFACE_ORIGINAL:
				dh = mVideoHeight;
				dw = mVideoWidth;
				break;
			case SURFACE_VERTICAL:
				dh=dh/2;
				break;
			}

			mSurfaceHolder.setFixedSize(mVideoWidth, mVideoHeight);
			ViewGroup.LayoutParams lp = mSurfaceView.getLayoutParams();
			lp.width = dw;
			lp.height = dh;
			mSurfaceView.setLayoutParams(lp);
			mSurfaceView.invalidate();
		} catch (Exception e) {
			LogUtil.e(TAG, ExceptionsOperator.getExceptionInfo(e));
		}
	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.btn_play:
			if (mMediaPlayer.isPlaying()) {
				mMediaPlayer.pause();
				//isPause = true;
				//mVlcHandler.sendEmptyMessage(EventHandler.MediaPlayerPaused);
			} else {
				//isPause = false;
				//mVlcHandler.sendEmptyMessage(EventHandler.MediaPlayerPlaying);
				mMediaPlayer.play();
			}
			mSurfaceView.setKeepScreenOn(false);
			OnSelectChange();
			break;

		case R.id.btnStopVideo:
			try {
				stopTimer();
				if (mMediaPlayer.isPlaying()) {
					//stop();
					mMediaPlayer.stop();
				}
				seekbar.setProgress(0);
				Fun_RecordplayActivity.this.finish();
			} catch (Exception e) {
				LogUtil.e(TAG, ExceptionsOperator.getExceptionInfo(e));
			}
			break;
		case R.id.btn_back_video:
			onClick(_btnstop);
			break;
//		case R.id.btn_slow:
//			float slow = mMediaPlayer.getRate();
//        	mMediaPlayer.setRate(slow/2);
//			break;
//		case R.id.btn_fast:
//			float fast = mMediaPlayer.getRate();
//        	mMediaPlayer.setRate(fast*2);
//			break;
		case R.id.record_video:
			show(_layout);
			break;
//		case R.id.btn_upload_video:
//			if(fileName != null){
//				SDK.StartupLoadLocalMedia();
//				FileUtil.readFile(fileName.substring(8, fileName.length()));
//			}
//			break;
		default:
			break;
		}
	}

	// 状态更新
	void OnSelectChange() {
		if (mMediaPlayer.isPlaying() == false) {
			_btnpause.SetImages(R.drawable.pause, R.drawable.pause);
		}else{
			_btnpause.SetImages(R.drawable.play, R.drawable.play);
		}
	}

	@Override
	public boolean onKeyDown(int keyCode, KeyEvent event) {
		if (keyCode == KeyEvent.KEYCODE_BACK) { // 处理返回按键
			onClick(_btnstop);
		}
		return true;
	}

}


text:
"""BiBTeX helpers
"""
import re

import bibtexparser

from bibtexparser.bparser import BibTexParser
from bibtexparser.customization import convert_to_unicode

def load_bib(bib, titles):
    """Returns dict {'BibTeX ID': {record}}
    """
    with open(bib) as bibtex_file:
        parser = BibTexParser()
        parser.customization = convert_to_unicode
        # Find the url field of a misc entry
        # https://github.com/sciunto-org/python-bibtexparser/issues/93
        parser.homogenise_fields = False
        bib = bibtexparser.load(bibtex_file, parser=parser)

    with open(titles) as titles_file:
        parser = BibTexParser()
        parser.customization = convert_to_unicode
        titles = bibtexparser.load(titles_file, parser=parser)

    res = {}
    for entry in bib.entries:
        if 'journal' in entry and entry['journal'].lower() in titles.strings:
            entry['journal'] = titles.strings[entry['journal'].lower()]
        if 'author' in entry:
            # Fuck me
            entry['author'] = entry['author'].replace('{́i}', 'í')
        res[entry['id'].strip()] = entry
    return res

def format_authors(authors, key_author, up_to=6):
    """Given a bibtex-formatted string of authors, returns a string of authors
    in form 'Initials Surname, ' of up to and including the first 'up_to'
    authors.
    """
    def format_author(author):
        try:
            surname, forenames = re.split(r',\s*', author)
        except ValueError:
            return author
        else:
            initials = ''.join(n[0].upper() for n in re.findall("\w+", forenames))
            return '{0} {1}'.format(initials, surname)

    authors = [format_author(author) for author in re.split(r'\s+and\s+', authors)]

    et_al = '\\textit{et al}.'
    index = authors.index(key_author)
    if index >= up_to:
        if index < (len(authors) - 1):
            # A, B, C, et al, key_author, et al
            authors = authors[:(up_to - 1)] + [et_al, authors[index], et_al]
        else:
            # A, B, C, et al, key_author
            authors = authors[:(up_to - 1)] + [et_al, authors[index]]
    else:
        if up_to < len(authors):
            # A, B, C, key_author, et al
            authors = authors[:up_to] + [et_al]
        else:
            # A, B, C, key_author
            authors = authors[:up_to]

    authors = ', '.join(authors)

    # End with a full stop
    if not authors.endswith('.'):
        authors = '{0}.'.format(authors)

    # Fix commas before and after 'et al.' and put key author in bold
    return authors.replace(
        ', {0},'.format(et_al), ' {0}'.format(et_al)
    ).replace(
        ', {0}'.format(et_al), ' {0}'.format(et_al)
    ).replace(
        key_author, '\\textbf{{{0}}}'.format(key_author)
    )


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

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:padding="10dp">

    <RelativeLayout android:layout_width="fill_parent" android:layout_height="fill_parent"
                    android:layout_marginLeft="10dp">
        <TextView
                android:id="@+id/txtSender"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentTop="true"
                android:text=""
                android:textSize="16sp"
                android:singleLine="true"
                android:layout_alignParentRight="true"
                android:paddingRight="10dp"
                android:paddingBottom="6dp"
                android:textColor="@android:color/black" android:textStyle="bold"/>

        <TextView
                android:id="@+id/txtDate"
                android:layout_alignParentLeft="true"
                android:textColor="@color/sinch_purple"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:paddingLeft="2dp"
                android:paddingBottom="6dp"
                android:textSize="12sp"
                android:text=""
                android:layout_alignBottom="@+id/txtSender"
                />

        <RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@+id/txtSender"
                android:layout_alignParentRight="true"
                android:padding="12dp"
                android:background="@drawable/yellow_ucf_2"
                >

            <TextView
                    android:id="@+id/txtMessage"
                    android:paddingRight="12dp"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_alignParentRight="true"
                    android:textColor="@android:color/black"
                    android:textSize="14sp"
                    android:text="Hello"
                    />

        </RelativeLayout>
    </RelativeLayout>
</RelativeLayout>


text:
@interface UIView (unityStub)
@property UILayoutGuide *safeAreaLayoutGuide;
@end

BOOL GADUIsOperatingSystemAtLeastVersion(NSInteger majorVersion) {
  NSProcessInfo *processInfo = NSProcessInfo.processInfo;
  if ([processInfo respondsToSelector:@selector(isOperatingSystemAtLeastVersion:)]) {
    // iOS 8+.
    NSOperatingSystemVersion version = {majorVersion};
    return [processInfo isOperatingSystemAtLeastVersion:version];
  } else {
    // pre-iOS 8. App supports iOS 7+, so this process must be running on iOS 7.
    return majorVersion >= 7;
  }
}

static CGFloat GADUSafeWidthLandscape(void) {
  CGRect screenBounds = [UIScreen mainScreen].bounds;
  if (GADUIsOperatingSystemAtLeastVersion(11)) {
    CGRect safeFrame = [UIApplication sharedApplication].keyWindow.safeAreaLayoutGuide.layoutFrame;
    if (!CGSizeEqualToSize(safeFrame.size, CGSizeZero)) {
      screenBounds = safeFrame;
    }
  }
  return MAX(CGRectGetWidth(screenBounds), CGRectGetHeight(screenBounds));
}

@implementation GADUPluginUtil

static BOOL _pauseOnBackground = NO;

+ (BOOL)pauseOnBackground {
  return _pauseOnBackground;
}

+ (void)setPauseOnBackground:(BOOL)pause {
  _pauseOnBackground = pause;
}

+ (NSString *)GADUStringFromUTF8String:(const char *)bytes {
  return bytes ? @(bytes) : nil;
}

+ (GADAdSize)safeAdSizeForAdSize:(GADAdSize)adSize {
  if (GADUIsOperatingSystemAtLeastVersion(11) &&
      GADAdSizeEqualToSize(kGADAdSizeSmartBannerLandscape, adSize)) {
    CGSize usualSize = CGSizeFromGADAdSize(kGADAdSizeSmartBannerLandscape);
    CGSize bannerSize = CGSizeMake(GADUSafeWidthLandscape(), usualSize.height);
    return GADAdSizeFromCGSize(bannerSize);
  } else {
    return adSize;
  }
}

+ (UIViewController *)unityGLViewController {
  return ((UnityAppController *)[UIApplication sharedApplication].delegate).rootViewController;
}

+ (void)positionView:(UIView *)view
        inParentView:(UIView *)parentView
          adPosition:(GADAdPosition)adPosition {
  CGRect parentBounds = parentView.bounds;
  if (GADUIsOperatingSystemAtLeastVersion(11)) {
    CGRect safeAreaFrame = parentView.safeAreaLayoutGuide.layoutFrame;
    if (!CGSizeEqualToSize(CGSizeZero, safeAreaFrame.size)) {
      parentBounds = safeAreaFrame;
    }
  }
  CGFloat top = CGRectGetMinY(parentBounds) + CGRectGetMidY(view.bounds);
  CGFloat left = CGRectGetMinX(parentBounds) + CGRectGetMidX(view.bounds);

  CGFloat bottom = CGRectGetMaxY(parentBounds) - CGRectGetMidY(view.bounds);
  CGFloat right = CGRectGetMaxX(parentBounds) - CGRectGetMidX(view.bounds);
  CGFloat centerX = CGRectGetMidX(parentBounds);
  CGFloat centerY = CGRectGetMidY(parentBounds);

  // If this view is of greater or equal width to the parent view, do not offset
  // to edge of safe area. Eg for smart banners that are still full screen
  // width.
  if (CGRectGetWidth(view.bounds) >= CGRectGetWidth(parentView.bounds)) {
    left = CGRectGetMidX(parentView.bounds);
  }

  // Similarly for height, if view is of custom size which is full screen
  // height, do not offset.
  if (CGRectGetHeight(view.bounds) >= CGRectGetHeight(parentView.bounds)) {
    top = CGRectGetMidY(parentView.bounds);
  }

  CGPoint center = CGPointMake(centerX, top);
  switch (adPosition) {
    case kGADAdPositionTopOfScreen:
      center = CGPointMake(centerX, top);
      break;
    case kGADAdPositionBottomOfScreen:
      center = CGPointMake(centerX, bottom);
      break;
    case kGADAdPositionTopLeftOfScreen:
      center = CGPointMake(left, top);
      break;
    case kGADAdPositionTopRightOfScreen:
      center = CGPointMake(right, top);
      break;
    case kGADAdPositionBottomLeftOfScreen:
      center = CGPointMake(left, bottom);
      break;
    case kGADAdPositionBottomRightOfScreen:
      center = CGPointMake(right, bottom);
      break;
    case kGADAdPositionCenterOfScreen:
      center = CGPointMake(centerX, centerY);
      break;
    default:
      break;
  }
  view.center = center;
}

+ (void)positionView:(UIView *)view
        inParentView:(UIView *)parentView
      customPosition:(CGPoint)adPosition {
  CGPoint origin = parentView.bounds.origin;
  if (GADUIsOperatingSystemAtLeastVersion(11)) {
    CGRect safeAreaFrame = parentView.safeAreaLayoutGuide.layoutFrame;
    if (!CGSizeEqualToSize(CGSizeZero, safeAreaFrame.size)) {
      origin = safeAreaFrame.origin;
    }
  }

  CGPoint center = CGPointMake(origin.x + adPosition.x + CGRectGetMidX(view.bounds),
                               origin.y + adPosition.y + CGRectGetMidY(view.bounds));
  view.center = center;
}

+ (GADAdSize)adSizeForWidth:(CGFloat)width height:(CGFloat)height {
  UIInterfaceOrientation currentOrientation =
      [UIApplication sharedApplication].statusBarOrientation;

  if (width == kGADUAdSizeUseFullWidth && UIInterfaceOrientationIsPortrait(currentOrientation)) {
    return GADAdSizeFullWidthPortraitWithHeight(height);
  } else if ((width == kGADUAdSizeUseFullWidth &&
              UIInterfaceOrientationIsLandscape(currentOrientation))) {
    return GADAdSizeFromCGSize(CGSizeMake(GADUSafeWidthLandscape(), height));
  }
  return GADAdSizeFromCGSize(CGSizeMake(width, height));
}

+ (GADAdSize)adaptiveAdSizeForWidth:(CGFloat)width orientation:(GADUBannerOrientation)orientation {
  switch (orientation) {
    case kGADUBannerOrientationCurrent:
      return GADCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth(width);
    case kGADUBannerOrientationLandscape:
      return GADLandscapeAnchoredAdaptiveBannerAdSizeWithWidth(width);
    case kGADUBannerOrientationPortrait:
      return GADPortraitAnchoredAdaptiveBannerAdSizeWithWidth(width);
  }
}

@end


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
软件包 com.conlect.oatos.dto.autobean.admin 的使用
</TITLE>

<META NAME="date" CONTENT="2013-05-13">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../stylesheet.css" TITLE="Style">

      概述
      软件包
      类
    使用
      树
      索引
      帮助

 上一个
 下一个

  框架
 无框架

  所有类

软件包 com.conlect.oatos.dto.autobean.admin
的使用

使用 com.conlect.oatos.dto.autobean.admin 的软件包

com.conlect.oatos.dto.autobean

com.conlect.oatos.dto.autobean.admin

com.conlect.oatos.dto.autobean 使用的 com.conlect.oatos.dto.autobean.admin 中的类

IAdminDataDTO

IAdminDepartmentDTO

IAdminDTO

IAdminFolderDTO

IAdminsDTO

com.conlect.oatos.dto.autobean.admin 使用的 com.conlect.oatos.dto.autobean.admin 中的类

IAdminDepartmentDTO

IAdminDTO

IAdminFolderDTO

      概述
      软件包
      类
    使用
      树
      索引
      帮助

 上一个
 下一个

  框架
 无框架

  所有类


text:
/**
 * Module dependencies.
 */

var express = require('express');
var engine = require('ejs-locals');
var routes = require('./routes');
var login = require('./routes/login');
var admin = require('./routes/admin');
var data = require('./routes/data');
var app = express();
var redis = require('redis');
var http = require('http');
var path = require('path');
var hash = require('./pass').hash;

redis.client = redis.createClient(10210, 'pub-redis-10210.us-east-1-4.1.ec2.garantiadata.com');
redis.client.auth("hackdayGuestbook", function() {console.log("Connected!");});
redis.client.on("error", function (err) {
	console.log("error event - " + client.host + ":" + client.port + " - " + err);
});

// use ejs-locals for all ejs templates:
app.engine('ejs', engine);

// all environments
app.set('port', process.env.PORT || 3000);
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'ejs');
app.use(express.favicon());
app.use(express.logger('dev'));
app.use(express.json());
app.use(express.urlencoded());
app.use(express.methodOverride());
app.use(express.bodyParser());
app.use(express.cookieParser('your secret here'));
app.use(express.session());

// redis stuff
var client = redis.createClient(10210, 'pub-redis-10210.us-east-1-4.1.ec2.garantiadata.com');
client.auth("hackdayGuestbook", function() {console.log("Connected!");});

// session-persisted message middleware
app.use(function(req, res, next){
  var err = req.session.error
    , msg = req.session.success;
  delete req.session.error;
  delete req.session.success;
  res.locals.message = '';
  if (err) res.locals.message = '
' + err + '
';
  if (msg) res.locals.message = '
' + msg + '
';
  next();
});

// dummy user database
var users = {
  admin: { name: 'admin', pass: 'admin' }
};

// when you create a user, generate a salt
// and hash the password ('foobar' is the pass here)
hash('foobar', function(err, salt, hash) {
  if (err) throw err;
  // store the salt & hash in the "db"
  users.admin.salt = salt;
  users.admin.hash = hash;
});

// Authenticate using our plain-object database of doom!
function authenticate(name, pass, fn) {
  if (!module.parent) console.log('authenticating %s:%s', name, pass);
  var user = users[name];
  // query the db for the given username
  if (!user) return fn(new Error('cannot find user'));
  if (pass == user.pass) return fn(null, user);
  fn(new Error('invalid password'));
}

// used to restrict pages
function restrict(req, res, next) {
  if (req.session.user) {
    next();
  } else {
    req.session.error = 'Access denied!';
    res.redirect('/login');
  }
}

app.use(app.router);
app.use(express.static(path.join(__dirname, 'public')));

// development only
if ('development' == app.get('env')) {
  app.use(express.errorHandler());
}

// actions
app.get('/', routes.index);
app.get('/login', login.login);
app.post('/login', function(req, res) {
  authenticate(req.body.username, req.body.password, function(err, user){
    if (user) {
      // Regenerate session when signing in
      // to prevent fixation
      req.session.regenerate(function(){
        // Store the user's primary key
        // in the session store to be retrieved,
        // or in this case the entire user object
        req.session.user = user;
        req.session.successMessage = 'Authenticated as ' + user.name
          + ' click to logout. '
          + ' You may now access /restricted.';
        res.redirect('admin');
      });
    } else {
      req.session.errorMessage = 'Authentication failed, please check your '
        + ' username and password.'
        + ' (use "admin" and "admin")';
      res.redirect('login');
    }
  });
});
app.get('/admin', restrict, admin.admin);
app.post('/savePost', data.savePost);
app.post('/approve', restrict, admin.approve);
app.post('/unapprove', restrict, admin.unapprove);

http.createServer(app).listen(app.get('port'), function(){
  console.log('Express server listening on port ' + app.get('port'));
});


text:
<?php

namespace matuck\LibraryBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
use matuck\LibraryBundle\Entity\Rating;
use matuck\LibraryBundle\Entity\Book;
use matuck\LibraryBundle\Form\BookType;
use Ivory\LuceneSearchBundle\Model\Document;
use Ivory\LuceneSearchBundle\Model\Field;

class BookController extends Controller
{
    public function indexAction()
    {
        $em = $this->getDoctrine()->getManager();
        $books = $em->getRepository('matuckLibraryBundle:Book')->findAll();

        $response = $this->render('matuckLibraryBundle:Book:index.html.twig', array('books' => $books));
        $response->setPublic();
        $response->setSharedMaxAge($this->container->getParameter('cache_time'));
        return $response;

    }

    public function showAction($id)
    {
        $em = $this->getDoctrine()->getManager();
        if(!$book = $em->getRepository('matuckLibraryBundle:Book')->find($id))
        {
            throw $this->createNotFoundException("The book you requested could not be found");
        }
        if(!$book->getIsPublic())
        {
            $response =  $this->render('matuckLibraryBundle:Pages:dmca.html.twig');
            $response->setPublic();
            $response->setSharedMaxAge($this->container->getParameter('cache_time'));
            return $response;
        }
        $searchTerm= $book->getAuthor()->getName()." ".$book->getTitle();
        $searchTerm=preg_replace('/,/','',$searchTerm);
        $author = $book->getAuthor()->getName();
        $title = $book->getTitle();
        $amazonUrl="http://www.bookspook.com/search?group=".urlencode($author)."&title=".urlencode($title)."&feelinglucky=1";
        $audibleUrl="http://www.qksrv.net/click-5758986-10273919?url=http://www.audible.com/search?advsearchKeywords=".urlencode($searchTerm)."&source_code=COMA0213WS031709";

        $tagManager = $this->get('fpn_tag.tag_manager');
        $tagManager->loadTagging($book);

        $form = $this->buildtagform($book);
        $response =  $this->render('matuckLibraryBundle:Book:show.html.twig', array('book' => $book, 'tagform' => $form->getForm()->createView(), 'amazonUrl' => $amazonUrl, 'audibleUrl' => $audibleUrl));
        $response->setPublic();
        $response->setSharedMaxAge($this->container->getParameter('cache_time'));
        return $response;
    }

    private function buildtagform(Book $book)
    {
        $form = $this->createFormBuilder();
        $form->add('book_id', 'hidden', array('data' => $book->getId()));
        if($this->get('security.context')->isGranted('ROLE_ADMIN'))
        {
            $choices = array();
            foreach($book->getTags() as $tag)
            {
                $choices[$tag->getId()] = $tag->getName();
            }
            $form->add('removetags', 'choice', array('choices' => $choices, 'multiple' => true, 'expanded' => true,'required' => false));
        }
        $form->add('tags', 'text', array('required' => false));
        if($this->container->getParameter('matuck_library_usecaptchas'))
        {
            $form->add('captcha', 'captcha');
        }
        return $form;
    }
    public function tagaddAction()
    {
        $formdata = $this->getRequest()->get('form');
        print_r($formdata);
        $em = $this->getDoctrine()->getEntityManager();
        $tagManager = $this->get('fpn_tag.tag_manager');
        /* @var $tagManager \FPN\TagBundle\Entity\TagManager */

        if(!$book = $em->getRepository('matuckLibraryBundle:Book')->find($formdata['book_id']))
        {
            throw new \Doctrine\ORM\EntityNotFoundException();
        }

        $indexer = $this->get('matuck_library.searchindexer');
        /* @var $indexer \matuck\LibraryBundle\Lib\Indexer */

        $indexer->deleteBook($book);

        $tagManager->loadTagging($book);
        /* @var $book Book */
        if($formdata['tags'] != NULL && $formdata['tags'] != '')
        {
            $tags = str_getcsv($formdata['tags'],',');
            $tags = array_map('trim', $tags);
            $tags = $tagManager->loadOrCreateTags($tags);
            $tagManager->addTags($tags, $book);
        }
        $tagrepo = $em->getRepository('matuckLibraryBundle:Tag');

        if(isset($formdata['removetags']))
        {
            $removetags = array();
            foreach($formdata['removetags'] as $tag)
            {
                $tag2 = $tagrepo->find($tag);
                $tagManager->removeTag($tag2, $book);
            }
        }

        $tagManager->saveTagging($book);
        $indexer->indexBook($book);
        return $this->redirect($this->generateUrl('matuck_library_book_show', array('id' => $formdata['book_id'])));
    }

    public function editAction($id)
    {
        $em = $this->getDoctrine()->getManager();
        if(!$book = $em->getRepository('matuckLibraryBundle:Book')->find($id))
        {
            throw $this->createNotFoundException("The book you requested could not be found");
        }
        $form   = $this->createForm(new BookType(), $book);
        $form->remove('tags');
        $form->add('newcover', 'file', array("required" => false, "mapped" => false, 'label' => 'Replacement Cover'));
        $form->add('newfile', 'file', array("required" => false, "mapped" => false, 'label' => 'Replacement Epub'));
        if($this->container->getParameter('matuck_library_usecaptchas'))
        {
            $form->add('captcha', 'captcha');
        }
        return $this->render('matuckLibraryBundle:Book:edit.html.twig', array(
            'book' => $book,
            'form'   => $form->createView(),
        ));
    }

    public function updateAction($id)
    {
        $em = $this->getDoctrine()->getManager();

        if($this->getRequest()->getMethod() != 'POST')
        {
            throw $this->createNotFoundException("The pages does not exist in this context");
        }
        if(!$book = $em->getRepository('matuckLibraryBundle:Book')->find($id))
        {
            throw $this->createNotFoundException("The book you requested could not be found");
        }
        $title = $book->getTitle();
        $author = $book->getAuthor()->getName();

        $indexer = $this->get('matuck_library.searchindexer');
        /* @var $indexer \matuck\LibraryBundle\Lib\Indexer */
        $indexer->deleteBook($book);
        $form = $this->createForm(new BookType(), $book);
        $form->remove('tags');
        $form->add('newcover', 'file', array("required" => false,"mapped" => false, 'label' => 'Replacement Cover'));
        $form->add('newfile', 'file', array("required" => false, "mapped" => false, 'label' => 'Replacement Epub'));
        if($this->container->getParameter('matuck_library_usecaptchas'))
        {
            $form->add('captcha', 'captcha');
        }
        $form->bind($this->getRequest());
        if($form->isValid())
        {
            $em->persist($book);
            $em->flush();

            $fh = $this->get('matuck_library.filehandler');
            $tmpuploads = $this->container->getParameter('matuck_library_tempuploads');
            $tmpid = uniqid();
            /* @var $fh \matuck\LibraryBundle\Lib\Filehandler\Filehandler */
            if($newcover = $this->getRequest()->files->get('matuck_librarybundle_booktype')['newcover'])
            {
                /* @var $newcover \Symfony\Component\HttpFoundation\File\UploadedFile */
                $newcover->move($tmpuploads, $tmpid.'.cover');
                $fh->moveCover($tmpid.'.cover', $book->getId());
            }

            if($newfile = $this->getRequest()->files->get('matuck_librarybundle_booktype')['newfile'])
            {
                /* @var $newfile \Symfony\Component\HttpFoundation\File\UploadedFile */
                $newfile->move($tmpuploads, $tmpid);
                $fh->moveBook($tmpid, $book->getId());
            }
            $indexer->deleteBook($book);
            return $this->redirect($this->generateUrl('matuck_library_book_show', array('id' => $id)));
        }

        $indexer->indexBook($book);
        return $this->render('matuckLibraryBundle:Book:edit.html.twig', array(
            'book' => $book,
            'form'   => $form->createView(),
        ));
    }

    public function deleteAction($id)
    {
        $em = $this->getDoctrine()->getEntityManager();

        if(!$book = $em->getRepository('matuckLibraryBundle:Book')->find($id))
        {
            throw $this->createNotFoundException("The book you requested could not be found");
        }
        $title = $book->getTitle();
        $author = $book->getAuthor()->getName();

        $ratings = $em->getRepository('matuckLibraryBundle:Rating')->findByBook($book);

        foreach($ratings as $rating)
        {
            echo $rating->getRating();
            $em->remove($rating);
        }
        $em->flush();
        $tagManager = $this->get('fpn_tag.tag_manager');
        /* @var $tagManager \FPN\TagBundle\Entity\TagManager */
        $tagManager->deleteTagging($book);

        $indexer = $this->get('matuck_library.searchindexer');
        /* @var $indexer \matuck\LibraryBundle\Lib\Indexer */
        $indexer->deleteBook($book);

        $em->remove($book);
        ////delete book files
        $fh = $this->get('matuck_library.filehandler');
        /* @var $fh \matuck\LibraryBundle\Lib\Filehandler\Filehandler */
        $fh->deleteBook($book->getId());
        $fh->deleteCover($book->getId());

        $em->flush();
        return $this->redirect($this->generateUrl('matuck_library_homepage'));
    }

    public function ratingAction($id, $rating)
    {
        $iphash = $this->get('matuck_library.iphash')->get();
        $em = $this->getDoctrine()->getManager();
        $oldrate = $em->getRepository('matuckLibraryBundle:Rating')->findByBookandIpHash($id, $iphash);
        //delete old rating
        if($oldrate)
        {
            $em->remove($oldrate);
            $em->flush();
        }
        $book = $em->getRepository('matuckLibraryBundle:Book')->find($id);
        $bookrate = new Rating();
        $bookrate->setBookid($book);
        $bookrate->setIphash($iphash);
        $bookrate->setRating($rating);
        try
        {
          //save new rating
          $em->persist($bookrate);
          $em->flush();
          $bookratings = $em->getRepository('matuckLibraryBundle:Rating')->findByBook($book);
          $ratingcount = count($bookratings);
          $totalrate = 0;
          foreach ($bookratings as $rate)
          {
            $totalrate = $totalrate + $rate->getRating();
          }
          if($ratingcount > 0)
          {
            $book->setRated(round($totalrate / $ratingcount));
            //save book with new rating calculated
            $em->persist($book);
            $em->flush();
            $this->get('session')->getFlashBag()->add('notice', 'You have successfully rated this book.');
            return $this->redirect($this->generateUrl('matuck_library_book_show', array('id' => $id)));
          }
          else
          {
            $this->rate = 0;
            $this->get('session')->getFlashBag()->add('error', 'Failed to save your rating!');
            return $this->redirect($this->generateUrl('matuck_library_book_show', array('id' => $id)));
          }
        }
        catch (Exception $e)
        {
            $this->get('session')->getFlashBag()->add('error', 'Failed to save your rating!');
            return $this->redirect($this->generateUrl('matuck_library_book_show', array('id' => $id)));
        }
    }

    public function newbooksAction()
    {
        $em = $this->getDoctrine()->getManager();
        $pager = $em->getRepository('matuckLibraryBundle:Book')->newestbooks();
        if($this->getRequest()->get('page'))
        {
            $pager->setCurrentPage($this->getRequest()->get('page'));
        }
        else
        {
            $pager->setCurrentPage(1);
        }
        $response = $this->render('matuckLibraryBundle:Book:newbook.html.twig', array('pager' => $pager));
        $response->setPublic();
        $response->setSharedMaxAge($this->container->getParameter('cache_time'));
        return $response;
    }

    public function popularAction()
    {
        $em = $this->getDoctrine()->getManager();
        $pager = $em->getRepository('matuckLibraryBundle:Book')->popularbooks();
        if($this->getRequest()->get('page'))
        {
            $pager->setCurrentPage($this->getRequest()->get('page'));
        }
        else
        {
            $pager->setCurrentPage(1);
        }
        $response = $this->render('matuckLibraryBundle:Book:popular.html.twig', array('pager' => $pager));
        $response->setPublic();
        $response->setSharedMaxAge($this->container->getParameter('cache_time'));
        return $response;
    }
}


text:
@interface IDEFileBreakpointWrapper : IDEBreakpointWrapper
{
}

- (void)setLineNumber:(long long)arg1;
- (long long)lineNumber;
- (void)setFileReference:(id)arg1;
- (id)fileReference;

@end


text:
package org.duracloud.mill.ltp;

import java.util.Date;
import java.util.LinkedHashSet;

import org.apache.commons.lang3.builder.ToStringBuilder;

/**
 * Represents the persistent state of the LoopingTaskProducer.
 *
 * @author Daniel Bernstein
 * Date: Nov 6, 2013
 */
public class State<T> {

    private LinkedHashSet<T> morsels = new LinkedHashSet<>();
    private Date currentRunStartDate = null;
    private Date nextRunStartDate = null;

    /**
     * @return the morsels
     */
    public LinkedHashSet<T> getMorsels() {
        return morsels;
    }

    /**
     * @param morsels the morsels to set
     */
    public void setMorsels(LinkedHashSet<T> morsels) {
        this.morsels = morsels;
    }

    /**
     * @return
     */
    public Date getCurrentRunStartDate() {
        return this.currentRunStartDate;
    }

    /**
     * @param time
     */
    public void setCurrentRunStartDate(Date time) {
        this.currentRunStartDate = time;
    }

    /**
     * @return
     */
    public Date getNextRunStartDate() {
        return this.nextRunStartDate;
    }

    /**
     * @param time
     */
    public void setNextRunStartDate(Date time) {
        this.nextRunStartDate = time;
    }

    /* (non-Javadoc)
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this);
    }

}


text:
package net.runelite.asm.attributes.code.instructions;

import net.runelite.asm.Type;
import net.runelite.asm.attributes.code.Instruction;
import net.runelite.asm.attributes.code.InstructionType;
import net.runelite.asm.attributes.code.Instructions;
import net.runelite.asm.attributes.code.instruction.types.ConversionInstruction;
import net.runelite.asm.execution.Frame;
import net.runelite.asm.execution.InstructionContext;
import net.runelite.asm.execution.Stack;
import net.runelite.asm.execution.StackContext;

public class I2D extends Instruction implements ConversionInstruction
{
	public I2D(Instructions instructions, InstructionType type)
	{
		super(instructions, type);
	}

	@Override
	public InstructionContext execute(Frame frame)
	{
		InstructionContext ins = new InstructionContext(this, frame);
		Stack stack = frame.getStack();

		StackContext object = stack.pop();
		ins.pop(object);

		StackContext ctx = new StackContext(ins, Type.DOUBLE, object.getValue().cast(double.class));
		stack.push(ctx);

		ins.push(ctx);

		return ins;
	}
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Index (SBT Compiler Maven Plugin 1.0.0-beta9 API)</title>
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

A C D E F G I J L M P R S T W _

A

AbstractSBTCompileMojo - Class in com.google.code.sbt.compiler.plugin

Abstract base class for SBT compilation mojos.

AbstractSBTCompileMojo() - Constructor for class com.google.code.sbt.compiler.plugin.AbstractSBTCompileMojo

C

com.google.code.sbt.compiler.plugin - package com.google.code.sbt.compiler.plugin

D

debug(String) - Method in class com.google.code.sbt.compiler.plugin.MavenCompilerLogger

Sends a message in debug log level.

debug(Throwable) - Method in class com.google.code.sbt.compiler.plugin.MavenCompilerLogger

Sends a throwable in the debug log level.

defaultAnalysisCacheFile(MavenProject) - Method in class com.google.code.sbt.compiler.plugin.AbstractSBTCompileMojo

Returns SBT incremental main compilation analysis cache file location for a project.

defaultTestAnalysisCacheFile(MavenProject) - Method in class com.google.code.sbt.compiler.plugin.AbstractSBTCompileMojo

Returns SBT incremental test compilation analysis cache file location for a project.

E

error(String) - Method in class com.google.code.sbt.compiler.plugin.MavenCompilerLogger

Sends a message in the error log level.

excludes - Variable in class com.google.code.sbt.compiler.plugin.SBTCompileMojo

Source exclusion filters for the compiler.

execute() - Method in class com.google.code.sbt.compiler.plugin.AbstractSBTCompileMojo

Performs compilation.

execute() - Method in class com.google.code.sbt.compiler.plugin.SBTAddManagedSourcesMojo

Adds default SBT managed sources location to Maven project.

execute() - Method in class com.google.code.sbt.compiler.plugin.SBTAddScalaSourcesMojo

Adds default Scala sources locations to Maven project.

F

factory - Variable in class com.google.code.sbt.compiler.plugin.AbstractSBTCompileMojo

Artifact factory used to look up artifacts in the remote repository.

G

getAnalysisCacheFile() - Method in class com.google.code.sbt.compiler.plugin.AbstractSBTCompileMojo

Returns SBT incremental compilation analysis cache file location for this project.

getAnalysisCacheFile() - Method in class com.google.code.sbt.compiler.plugin.SBTCompileMojo

Returns SBT incremental compilation analysis cache file location for this project.

getAnalysisCacheFile() - Method in class com.google.code.sbt.compiler.plugin.SBTTestCompileMojo

Returns SBT incremental compilation analysis cache file location for this project.

getAnalysisCacheMap() - Method in class com.google.code.sbt.compiler.plugin.AbstractSBTCompileMojo

Returns SBT incremental compilation analysis cache file locations map for all reactor projects.

getAnalysisCacheMap() - Method in class com.google.code.sbt.compiler.plugin.SBTCompileMojo

Returns SBT incremental compilation analysis cache file locations map for all reactor projects.

getAnalysisCacheMap() - Method in class com.google.code.sbt.compiler.plugin.SBTTestCompileMojo

Returns SBT incremental compilation analysis cache file locations map for all reactor projects.

getClasspathElements() - Method in class com.google.code.sbt.compiler.plugin.AbstractSBTCompileMojo

Returns compilation classpath elements.

getClasspathElements() - Method in class com.google.code.sbt.compiler.plugin.SBTCompileMojo

Returns compilation classpath elements.

getClasspathElements() - Method in class com.google.code.sbt.compiler.plugin.SBTTestCompileMojo

Returns compilation classpath elements.

getCompileSourceRoots() - Method in class com.google.code.sbt.compiler.plugin.AbstractSBTCompileMojo

Returns compilation source roots.

getCompileSourceRoots() - Method in class com.google.code.sbt.compiler.plugin.SBTCompileMojo

Returns compilation source roots.

getCompileSourceRoots() - Method in class com.google.code.sbt.compiler.plugin.SBTTestCompileMojo

Returns compilation source roots.

getOutputDirectory() - Method in class com.google.code.sbt.compiler.plugin.AbstractSBTCompileMojo

Returns output directory.

getOutputDirectory() - Method in class com.google.code.sbt.compiler.plugin.SBTCompileMojo

Returns output directory.

getOutputDirectory() - Method in class com.google.code.sbt.compiler.plugin.SBTTestCompileMojo

Returns output directory.

getSourceExcludes() - Method in class com.google.code.sbt.compiler.plugin.AbstractSBTCompileMojo

Returns source exclusion filters for the compiler.

getSourceExcludes() - Method in class com.google.code.sbt.compiler.plugin.SBTCompileMojo

Returns source exclusion filters for the compiler.

getSourceExcludes() - Method in class com.google.code.sbt.compiler.plugin.SBTTestCompileMojo

Returns source exclusion filters for the compiler.

getSourceIncludes() - Method in class com.google.code.sbt.compiler.plugin.AbstractSBTCompileMojo

Returns source inclusion filters for the compiler.

getSourceIncludes() - Method in class com.google.code.sbt.compiler.plugin.SBTCompileMojo

Returns source inclusion filters for the compiler.

getSourceIncludes() - Method in class com.google.code.sbt.compiler.plugin.SBTTestCompileMojo

Returns source inclusion filters for the compiler.

I

includes - Variable in class com.google.code.sbt.compiler.plugin.SBTCompileMojo

Source inclusion filters for the compiler.

info(String) - Method in class com.google.code.sbt.compiler.plugin.MavenCompilerLogger

Sends a message in info log level.

internalExecute() - Method in class com.google.code.sbt.compiler.plugin.AbstractSBTCompileMojo

Performs compilation.

internalExecute() - Method in class com.google.code.sbt.compiler.plugin.SBTCompileMojo

Performs compilation.

internalExecute() - Method in class com.google.code.sbt.compiler.plugin.SBTTestCompileMojo

Performs compilation.

isDebugEnabled() - Method in class com.google.code.sbt.compiler.plugin.MavenCompilerLogger

Returns true if debug log level is enabled.

isErrorEnabled() - Method in class com.google.code.sbt.compiler.plugin.MavenCompilerLogger

Returns true if error log level is enabled.

isInfoEnabled() - Method in class com.google.code.sbt.compiler.plugin.MavenCompilerLogger

Returns true if info log level is enabled.

isWarnEnabled() - Method in class com.google.code.sbt.compiler.plugin.MavenCompilerLogger

Returns true if warn log level is enabled.

J

javacOptions - Variable in class com.google.code.sbt.compiler.plugin.AbstractSBTCompileMojo

Additional parameters for Java compiler.

L

localRepo - Variable in class com.google.code.sbt.compiler.plugin.AbstractSBTCompileMojo

Location of the local repository.

M

map(SourcePosition) - Method in class com.google.code.sbt.compiler.plugin.SourcePositionMapperCollection

Performs mapping from the position in generated source file to the position in original source file it was
 generated from.

MavenCompilerLogger - Class in com.google.code.sbt.compiler.plugin

Maven Log wrapper implementing CompilerLogger interface.

MavenCompilerLogger(Log) - Constructor for class com.google.code.sbt.compiler.plugin.MavenCompilerLogger

Creates CompilerLogger wrapper around Maven Log delegate.

metadataSource - Variable in class com.google.code.sbt.compiler.plugin.AbstractSBTCompileMojo

For retrieval of artifact's metadata.

P

playVersion - Variable in class com.google.code.sbt.compiler.plugin.AbstractSBTCompileMojo

Forced Play! Framework version.

project - Variable in class com.google.code.sbt.compiler.plugin.AbstractSBTCompileMojo

Maven project to interact with.

project - Variable in class com.google.code.sbt.compiler.plugin.SBTAddManagedSourcesMojo

Maven project to interact with.

project - Variable in class com.google.code.sbt.compiler.plugin.SBTAddScalaSourcesMojo

Maven project to interact with.

R

reactorProjects - Variable in class com.google.code.sbt.compiler.plugin.AbstractSBTCompileMojo

All Maven projects in the reactor.

remoteRepos - Variable in class com.google.code.sbt.compiler.plugin.AbstractSBTCompileMojo

Remote repositories used by the resolver

resolver - Variable in class com.google.code.sbt.compiler.plugin.AbstractSBTCompileMojo

Artifact resolver used to resolve artifacts.

S

SBTAddManagedSourcesMojo - Class in com.google.code.sbt.compiler.plugin

Add managed source root, if it is not already added.

SBTAddManagedSourcesMojo() - Constructor for class com.google.code.sbt.compiler.plugin.SBTAddManagedSourcesMojo

SBTAddScalaSourcesMojo - Class in com.google.code.sbt.compiler.plugin

Add default Scala source roots, if they exist and are not already added.

SBTAddScalaSourcesMojo() - Constructor for class com.google.code.sbt.compiler.plugin.SBTAddScalaSourcesMojo

SBTCompileMojo - Class in com.google.code.sbt.compiler.plugin

Compile Scala and Java main sources.

SBTCompileMojo() - Constructor for class com.google.code.sbt.compiler.plugin.SBTCompileMojo

SBTTestCompileMojo - Class in com.google.code.sbt.compiler.plugin

Compile Scala and Java test sources.

SBTTestCompileMojo() - Constructor for class com.google.code.sbt.compiler.plugin.SBTTestCompileMojo

sbtVersion - Variable in class com.google.code.sbt.compiler.plugin.AbstractSBTCompileMojo

Forced SBT version.

scalacOptions - Variable in class com.google.code.sbt.compiler.plugin.AbstractSBTCompileMojo

Additional parameters for Scala compiler.

scalacPlugins - Variable in class com.google.code.sbt.compiler.plugin.AbstractSBTCompileMojo

Scala compiler plugins.

scalaVersion - Variable in class com.google.code.sbt.compiler.plugin.AbstractSBTCompileMojo

Forced Scala version.

setCharsetName(String) - Method in class com.google.code.sbt.compiler.plugin.SourcePositionMapperCollection

Sets source files character set name (encoding).

skipMain - Variable in class com.google.code.sbt.compiler.plugin.SBTCompileMojo

Set this to true to bypass compilation of main sources.

skipTest - Variable in class com.google.code.sbt.compiler.plugin.SBTTestCompileMojo

Set this to true to bypass compilation of test sources.

sourceEncoding - Variable in class com.google.code.sbt.compiler.plugin.AbstractSBTCompileMojo

Scala and Java source files encoding.

SourcePositionMapperCollection - Class in com.google.code.sbt.compiler.plugin

Wwrapper for a collection of source position mappers.

SourcePositionMapperCollection(Collection<SourcePositionMapper>) - Constructor for class com.google.code.sbt.compiler.plugin.SourcePositionMapperCollection

Creates source position mappers collection.

sourcePositionMappers - Variable in class com.google.code.sbt.compiler.plugin.AbstractSBTCompileMojo

Source position mappers.

T

testExcludes - Variable in class com.google.code.sbt.compiler.plugin.SBTTestCompileMojo

Test source exclusion filters for the compiler.

testIncludes - Variable in class com.google.code.sbt.compiler.plugin.SBTTestCompileMojo

Test source inclusion filters for the compiler.

W

warn(String) - Method in class com.google.code.sbt.compiler.plugin.MavenCompilerLogger

Sends a message in warn log level.

_

_scalacOptions - Variable in class com.google.code.sbt.compiler.plugin.AbstractSBTCompileMojo

Additional parameters for Scala compiler.

_scalacPlugins - Variable in class com.google.code.sbt.compiler.plugin.AbstractSBTCompileMojo

Scala compiler plugins.

_sourcePositionMappers - Variable in class com.google.code.sbt.compiler.plugin.AbstractSBTCompileMojo

Source position mappers.

A C D E F G I J L M P R S T W _

Skip navigation links

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Copyright © 2013–2016. All rights reserved.


text:
FILE(REMOVE_RECURSE
  "CMakeFiles/_run_tests_robot_pose_ekf"
)

# Per-language clean rules from dependency scanning.
FOREACH(lang)
  INCLUDE(CMakeFiles/_run_tests_robot_pose_ekf.dir/cmake_clean_${lang}.cmake OPTIONAL)
ENDFOREACH(lang)


text:
(function($){
    "use strict";

    $.support.xhrFileUpload = !!(window.FileReader && window.ProgressEvent);
    $.support.xhrFormData = !!window.FormData;

    if(!$.support.xhrFileUpload || !$.support.xhrFormData){
        // skip decorating form
        return;
    }

    var template = '
\

\

\

\
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">×</button>\

Uploading
\

\

\

\

\

\
            0%\

\

\

\

\
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>\

\

\

\

';

    var Uploadprogress = function(element, options){
        this.options = options;
        this.$element = $(element);
    };

    Uploadprogress.prototype = {

        constructor: function() {
            this.$form = this.$element;
            this.$form.on('submit', $.proxy(this.submit, this));
            this.$modal = $(this.options.template);
            this.$modal_message = this.$modal.find('.modal-message');
            this.$modal_title = this.$modal.find('.modal-title');
            this.$modal_footer = this.$modal.find('.modal-footer');
            this.$modal_bar = this.$modal.find('.progress-bar');
            this.options.finished_percent = this.options.finished_percent || 100;

            this.$modal.on('hidden.bs.modal', $.proxy(this.reset, this));
        },

        reset: function(){
            this.$modal_title = this.$modal_title.text('Uploading');
            this.$modal_footer.hide();
            this.$modal_bar.addClass('progress-bar-success');
            this.$modal_bar.removeClass('progress-bar-danger');
            if(this.xhr){
                this.xhr.abort();
            }
        },

        submit: function(e) {
            e.preventDefault();

            this.$modal.modal({
                backdrop: 'static',
                keyboard: false
            });

            // We need the native XMLHttpRequest for the progress event
            var xhr = new XMLHttpRequest();
            this.xhr = xhr;

            xhr.addEventListener('load', $.proxy(this.success, this, xhr));
            xhr.addEventListener('error', $.proxy(this.error, this, xhr));
            //xhr.addEventListener('abort', function(){});

            xhr.upload.addEventListener('progress', $.proxy(this.progress, this));

            var form = this.$form;

            xhr.open(form.attr('method'), window.location.href);
            xhr.setRequestHeader('X-REQUESTED-WITH', 'XMLHttpRequest');

            var data = new FormData(form.get(0));
            xhr.send(data);
        },

        success: function(xhr) {
            if(xhr.status == 0 || xhr.status >= 400){
                // HTTP 500 ends up here!?!
                return this.error(xhr);
            }
            this.set_progress(100);

            var url;
            var content_type = xhr.getResponseHeader('Content-Type');

            // make it possible to return the redirect URL in
            // a JSON response
            if(content_type.indexOf('application/json') !== -1){
                var response = $.parseJSON(xhr.responseText);
                url = response.location;
            }
            else{
                url = this.options.redirect_url;
            }
            window.location.href = url;
        },

        // handle form error
        // we replace the form with the returned one
        error: function(xhr){
            this.$modal_title.text('Upload failed');

            this.$modal_bar.removeClass('progress-bar-success');
            this.$modal_bar.addClass('progress-bar-danger');
            this.$modal_footer.show();

            var content_type = xhr.getResponseHeader('Content-Type');

            // Replace the contents of the form, with the returned html
            if(xhr.status === 422){
                console.log(xhr);
                var new_html = $.parseHTML(xhr.responseText);
                this.replace_form(new_html);
                this.$modal.modal('hide');
            }
            // Write the error response to the document.
            else{
                var response_text = xhr.responseText;
                if(content_type.indexOf('text/plain') !== -1){
                    response_text = '
' + response_text + '
';
                }
                document.write(xhr.responseText);
            }
        },

        set_progress: function(percent){
            this.$modal_bar.attr('aria-valuenow', percent);
            this.$modal_bar.text(percent + '%');
            this.$modal_bar.css('width', percent + '%');
        },

        progress: function(/*ProgressEvent*/e){
            var percent = (e.loaded / e.total) * 100;
            this.set_progress(Math.round(percent * (this.options.finished_percent / 100)));

            // fake progress representing upload from server to S3
            if (this.options.finished_percent < 100 && percent >= 100) {
                var increment = Math.round((100 - this.options.finished_percent) / this.options.additional_seconds);
                var fake_progress = this.options.finished_percent;
                var last_progress = setInterval(function() {
                    fake_progress += increment;
                    if (fake_progress >= 100) {
                        clearInterval(last_progress);
                        this.set_progress(100);
                    } else {
                        this.set_progress(fake_progress);
                    }
                }.bind(this), 1000);
            }
        },

        // replace_form replaces the contents of the current form
        // with the form in the html argument.
        // We use the id of the current form to find the new form in the html
        replace_form: function(html){
            var new_form;
            var form_id = this.$form.attr('id');
            if(form_id !== undefined){
                new_form = $(html).find('#' + form_id);
            }
            else{
                new_form = $(html).find('form');
            }

            // add the filestyle again
            new_form.find(':file').filestyle({buttonBefore: true});
            this.$form.html(new_form.children());
        }
    };

    $.fn.uploadprogress = function(options, value){
        return this.each(function(){
            var _options = $.extend({}, $.fn.uploadprogress.defaults, options);
            var file_progress = new Uploadprogress(this, _options);
            file_progress.constructor();
        });
    };

    $.fn.uploadprogress.defaults = {
        template: template,
        finished_percent: 80,
        additional_seconds: 5
        //redirect_url: ...

        // need to customize stuff? Add here, and change code accordingly.
    };

})(window.jQuery);


text:
-- --------------------------------------------------------
-- Host:                         127.0.0.1
-- Server version:               5.6.15-log - MySQL Community Server (GPL)
-- Server OS:                    Win32
-- HeidiSQL Version:             8.3.0.4695
-- --------------------------------------------------------

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET NAMES utf8 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;

-- Dumping database structure for wf
CREATE DATABASE IF NOT EXISTS `wf` /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci */;
USE `wf`;

-- Dumping structure for table wf.fun_short_url
CREATE TABLE IF NOT EXISTS `fun_short_url` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `hash_id` varchar(15) COLLATE utf8_unicode_ci NOT NULL,
  `url` varchar(300) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `flag` (`hash_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- Data exporting was unselected.

-- Dumping structure for table wf.res_file
CREATE TABLE IF NOT EXISTS `res_file` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `hash_id` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
  `user_id` int(11) unsigned NOT NULL,
  `path` varchar(150) COLLATE utf8_unicode_ci NOT NULL,
  `type` varchar(30) COLLATE utf8_unicode_ci NOT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `hash_id` (`hash_id`),
  KEY `user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- Data exporting was unselected.

-- Dumping structure for table wf.res_image
CREATE TABLE IF NOT EXISTS `res_image` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `hash_id` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
  `user_id` int(11) unsigned NOT NULL,
  `path` varchar(150) COLLATE utf8_unicode_ci NOT NULL,
  `thumbnail_path` varchar(150) COLLATE utf8_unicode_ci NOT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `hash_id` (`hash_id`),
  KEY `user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- Data exporting was unselected.

-- Dumping structure for table wf.res_text
CREATE TABLE IF NOT EXISTS `res_text` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `hash_id` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
  `user_id` int(11) unsigned NOT NULL,
  `content` text COLLATE utf8_unicode_ci NOT NULL,
  `format_type` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
  `tags` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `hash_id` (`hash_id`),
  KEY `user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- Data exporting was unselected.

-- Dumping structure for table wf.shortcut
CREATE TABLE IF NOT EXISTS `shortcut` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `hash_id` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
  `user_id` int(10) unsigned NOT NULL,
  `name` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
  `path` varchar(150) COLLATE utf8_unicode_ci NOT NULL,
  `icon` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
  `created_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `updated_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  PRIMARY KEY (`id`),
  UNIQUE KEY `hash_id` (`hash_id`),
  KEY `user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- Data exporting was unselected.

-- Dumping structure for table wf.user
CREATE TABLE IF NOT EXISTS `user` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `username` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `auth_key` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
  `password_hash` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `password_reset_token` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `email` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `role` smallint(6) unsigned NOT NULL DEFAULT '10',
  `state` tinyint(3) unsigned NOT NULL DEFAULT '10',
  `created_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  PRIMARY KEY (`id`),
  KEY `status` (`state`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- Data exporting was unselected.

-- Dumping structure for table wf.user_active
CREATE TABLE IF NOT EXISTS `user_active` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(10) unsigned NOT NULL,
  `type` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
  `created_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- Data exporting was unselected.

-- Dumping structure for table wf.user_message
CREATE TABLE IF NOT EXISTS `user_message` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(11) unsigned NOT NULL,
  `type` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `message` varchar(300) COLLATE utf8_unicode_ci NOT NULL,
  `created_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- Data exporting was unselected.

-- Dumping structure for table wf.user_oauth
CREATE TABLE IF NOT EXISTS `user_oauth` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(10) unsigned NOT NULL,
  `app` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `access_token` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
  `expired_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `created_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `updated_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- Data exporting was unselected.

-- Dumping structure for table wf.workflow
CREATE TABLE IF NOT EXISTS `workflow` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `hash_id` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
  `user_id` int(11) unsigned NOT NULL,
  `title` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
  `code_snippets` varchar(5000) COLLATE utf8_unicode_ci NOT NULL,
  `enabled` smallint(6) NOT NULL DEFAULT '1',
  `state` smallint(6) unsigned NOT NULL DEFAULT '1',
  `created_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  PRIMARY KEY (`id`),
  UNIQUE KEY `hash` (`hash_id`),
  KEY `user_id` (`user_id`),
  KEY `status` (`state`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- Data exporting was unselected.

-- Dumping structure for table wf.workflow_log
CREATE TABLE IF NOT EXISTS `workflow_log` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `wf_id` int(11) unsigned NOT NULL,
  `level` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
  `content` text COLLATE utf8_unicode_ci NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  PRIMARY KEY (`id`),
  KEY `wf_id` (`wf_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- Data exporting was unselected.

-- Dumping structure for table wf.workflow_result
CREATE TABLE IF NOT EXISTS `workflow_result` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `wf_id` int(11) unsigned NOT NULL,
  `component` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
  `content` text COLLATE utf8_unicode_ci NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  PRIMARY KEY (`id`),
  KEY `wf_id` (`wf_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- Data exporting was unselected.

-- Dumping structure for table wf.workflow_var
CREATE TABLE IF NOT EXISTS `workflow_var` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `wf_id` int(10) unsigned NOT NULL,
  `name` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
  `value` text COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `wf_id` (`wf_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- Data exporting was unselected.
/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;
/*!40014 SET FOREIGN_KEY_CHECKS=IF(@OLD_FOREIGN_KEY_CHECKS IS NULL, 1, @OLD_FOREIGN_KEY_CHECKS) */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;