text:
import { AUTH_LOGIN, AUTH_LOGOUT, AUTH_ERROR, AUTH_CHECK } from 'react-admin';

export default (type, params) => {
    // called when the user attempts to log in
    if (type === AUTH_LOGIN) {
        const { username } = params;
        localStorage.setItem('username', username);
        // accept all username/password combinations
        return Promise.resolve();
    }
    // called when the user clicks on the logout button
    if (type === AUTH_LOGOUT) {
        localStorage.removeItem('username');
        return Promise.resolve();
    }
    // called when the API returns an error
    if (type === AUTH_ERROR) {
        const { status } = params;
        if (status === 401 || status === 403) {
            localStorage.removeItem('username');
            return Promise.reject();
        }
        return Promise.resolve();
    }
    // called when the user navigates to a new location
    if (type === AUTH_CHECK) {
        return localStorage.getItem('username')
               ? Promise.resolve()
               : Promise.reject();
    }
    return Promise.reject('Unknown method');
};


text: Objective: Revise essential algorithms in Java, C++ and Python

redpajama_set_name: RedPajamaGithub


text:
package co.chappuis.dayfocus;

import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.SharedPreferences;
import android.graphics.BitmapFactory;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.support.v7.app.NotificationCompat;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;

import java.util.Calendar;

public class MainActivity extends ActionBarActivity {
    private String tag = "DayFocus";

    //UI elements
    private TextView dailyGreeting;
    private EditText editFocus;
    private Button submitButton;
    private String dailyFocus;

    //SP to store focuse(s)
    private SharedPreferences sharedPref;
    private SharedPreferences.Editor editor;
    //Date to compare to keys in SP
    private Calendar cal;
    private String today;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        //Set up UI elements
        setContentView(R.layout.activity_main);
        dailyGreeting = (TextView) findViewById(R.id.greeting);
        editFocus = (EditText) findViewById(R.id.edit_focus);
        submitButton = (Button) findViewById(R.id.submit_button);
        //Set up focus storage bits
        sharedPref = this.getPreferences(Context.MODE_PRIVATE);
        cal = Calendar.getInstance();
        today = ""+cal.get(Calendar.DATE);
        //Set dailyGreeting to focus if there is one, or to a greeting
            dailyGreeting.setText(sharedPref.getString(today, getString(R.string.greeting_text)));
        if(sharedPref.contains(today)) {
            editFocus.setVisibility(View.INVISIBLE);
            submitButton.setVisibility(View.INVISIBLE);
        } else {
            submitButton.setVisibility(View.VISIBLE);
            editFocus.setVisibility(View.VISIBLE);
            //Clears any previous focuses
            editor = sharedPref.edit();
            editor.clear();
            editor.apply();
        }

    }

    @Override
    protected void onResume() {
        super.onResume();
        today = ""+cal.get(Calendar.DATE);
        //Set dailyGreeting to focus if there is one, or to a greeting
        dailyGreeting.setText(sharedPref.getString(today, getString(R.string.greeting_text)));
        if(sharedPref.contains(today)) {
            editFocus.setVisibility(View.INVISIBLE);
            submitButton.setVisibility(View.INVISIBLE);
        } else {
            submitButton.setVisibility(View.VISIBLE);
            editFocus.setVisibility(View.VISIBLE);
            //Clears any previous focuses
            editor = sharedPref.edit();
            editor.clear();
            editor.apply();
        }
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.menu_main, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();

        //noinspection SimplifiableIfStatement
        if (id == R.id.action_settings) {
            return true;
        }

        return super.onOptionsItemSelected(item);
    }

    public void setFocus(View view) {
        String enteredFocus = editFocus.getText().toString().toUpperCase();
        if (enteredFocus.equals("")) {
            //Display a toast telling the user that they entered an empty focus
            Context context = getApplicationContext();
            CharSequence text = "You can't have no focus!";
            Toast toast = Toast.makeText(context, text, Toast.LENGTH_SHORT);
            toast.show();
            //Log.d(tag, "Entered focus is empty");
        } else {
            //Stores the focus until next day
            editor = sharedPref.edit();
            editor.putString(today, enteredFocus);
            editor.apply();
            //TODO Start persistent notification
            //For debugging purposes only
            dailyGreeting.setText(enteredFocus);
            //Log.d(tag, "Entered focus is " + enteredFocus);

            //Hide button and EditText until next day
            submitButton.setVisibility(View.INVISIBLE);
            editFocus.setVisibility(View.INVISIBLE);

            createNotification(enteredFocus);
        }
    }

    private void createNotification(String contentTitle) {
        //Create notification
        NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this);
        mBuilder.setLargeIcon(BitmapFactory.decodeResource(getResources(), R.mipmap.icon));
        mBuilder.setSmallIcon(android.R.color.transparent);
        mBuilder.setContentTitle(contentTitle);
        mBuilder.setContentText("Have you stayed focused today?");
        //Make it persistent
        mBuilder.setOngoing(true);
        //Make sure priority is default
        mBuilder.setPriority(NotificationCompat.PRIORITY_DEFAULT);

        // Sets an ID for the notification
        int mNotificationId = 001;
        // Gets an instance of the NotificationManager service
        NotificationManager mNotifyMgr = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
        // Builds the notification and issues it.
        mNotifyMgr.notify(mNotificationId, mBuilder.build());
    }

}


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

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<title>MNE-CPP: Ui::AveragingSetupWidgetClass Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

<link href="search/search.css" rel="stylesheet" type="text/css"/>

<link href="doxygen.css" rel="stylesheet" type="text/css" />

MNE-CPP
    beta 1.0

Main Page

Related Pages

Modules

Classes

Files

          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)"
               onblur="searchBox.OnSearchFieldFocus(false)"
               onkeyup="searchBox.OnSearchFieldChange(event)"/>

Class List

Class Index

Class Hierarchy

Class Members

Ui

AveragingSetupWidgetClass

List of all members

Ui::AveragingSetupWidgetClass Class Reference

Inheritance diagram for Ui::AveragingSetupWidgetClass:

  <map id="Ui::AveragingSetupWidgetClass_map" name="Ui::AveragingSetupWidgetClass_map">
<area href="class_ui___averaging_setup_widget_class.html" alt="Ui_AveragingSetupWidgetClass" shape="rect" coords="0,0,190,24"/>
</map>

Additional Inherited Members

 Public Member Functions inherited from Ui_AveragingSetupWidgetClass

void 	setupUi (QWidget *AveragingSetupWidgetClass)

void 	retranslateUi (QWidget *AveragingSetupWidgetClass)

 Public Attributes inherited from Ui_AveragingSetupWidgetClass

QVBoxLayout * 	verticalLayout

QGridLayout * 	m_qGridLayout_main

QSpacerItem * 	m_qVerticalSpacer_LeftRow

QPushButton * 	m_qPushButton_About

QSpacerItem * 	m_qHorizontalSpacer_About

QLabel * 	m_qLabelAveragingImage

Detailed Description

Definition at line 87 of file ui_averagingsetup.h.

The documentation for this class was generated from the following file:

D:/Users/Christoph/GitHub/mne-cpp/applications/mne_x/plugins/averaging/ui_averagingsetup.h

<address class="footer">
Generated on Fri Mar 27 2015 22:54:43 for MNE-CPP by

 1.8.9.1
</address>


text:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <title>3 Columns With Gutters</title>
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <meta name="description" content="" />
    <meta name="robots" content="index, follow" />

    <link rel="stylesheet" type="text/css" href="css/r-c-min.css" />

    <link rel="stylesheet" type="text/css" href="css/column-styles.css" />

<r-c>
    <c1-1>

← Layout index

3 Columns With Gutters

    </c1-1>
</r-c>

<r-c>
    <c1-1 sm1-3>

First column. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque iaculis lectus vel metus pellentesque, eu venenatis est euismod.

    </c1-1>
    <c1-1 sm1-3>

Second column. Nulla eget ligula quis purus molestie malesuada non at nibh. Proin a magna ac velit iaculis pretium. Fusce vitae sollicitudin sapien.

    </c1-1>
    <c1-1 sm1-3>

Third column. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque iaculis lectus vel metus pellentesque, eu venenatis est euismod.

    </c1-1>
</r-c>


text:
import yaml
import webapp2

from google.appengine.api import users

import github_auth
import view_base
import view_build
import view_logs
import view_pr
import secrets

hostname = secrets.get_hostname()

def get_app_config():
    with open('config.yaml') as config_file:
        return yaml.load(config_file)

config = {
    'webapp2_extras.sessions': {
        'secret_key': None,  # filled in on the first request
        'cookie_args': {
            # we don't have SSL For local development
            'secure': hostname and 'appspot.com' in hostname,
            'httponly': True,
        },
    },
    'github_client': None,  # filled in the first time auth is needed
}

config.update(get_app_config())

class Warmup(webapp2.RequestHandler):
    """Warms up gubernator."""
    def get(self):
        """Receives the warmup request."""
        try:
            self.app.config['github_client'] = secrets.get('github_client')
        except KeyError:
            pass  # dev server, generally

        self.response.headers['Content-Type'] = 'text/plain'
        self.response.write('Warmup successful')

class ConfigHandler(view_base.BaseHandler):
    """Handles admin config of gubernator."""
    def get(self):
        self.render('config.html', {'hostname': hostname})

    def post(self):
        self.check_csrf()
        if users.is_current_user_admin():
            oauth_set = False
            webhook_set = False
            token_set = False

            github_id = self.request.get('github_id')
            github_secret = self.request.get('github_secret')
            github_token = self.request.get('github_token')
            if github_id and github_secret:
                value = {'id': github_id, 'secret': github_secret}
                secrets.put('github_client', value)
                app.config['github_client'] = value
                oauth_set = True
            github_webhook_secret = self.request.get('github_webhook_secret')
            if github_webhook_secret:
                secrets.put('github_webhook_secret',
                            github_webhook_secret,
                            per_host=False)
                webhook_set = True
            if github_token:
                secrets.put('github_token', github_token, per_host=False)
                token_set = True
            self.render('config.html',
                        dict(hostname=hostname,
                             oauth_set=oauth_set,
                             webhook_set=webhook_set,
                             token_set=token_set))
        else:
            self.abort(403)

app = webapp2.WSGIApplication([
    ('/_ah/warmup', Warmup),
    (r'/', view_base.IndexHandler),
    (r'/jobs/(.*)$', view_build.JobListHandler),
    (r'/builds/(.*)/([^/]+)/?', view_build.BuildListHandler),
    (r'/build/(.*)/([^/]+)/([-\da-f_:.]+)/?', view_build.BuildHandler),
    (r'/build/(.*)/([^/]+)/([-\da-f_:.]+)/nodelog*', view_logs.NodeLogHandler),
    (r'/pr((?:/[^/]+){0,2})/(\d+|batch)', view_pr.PRHandler),
    (r'/pr/?', view_pr.PRDashboard),
    (r'/pr/([-\w]+)', view_pr.PRDashboard),
    (r'/pr/(.*/build-log.txt)', view_pr.PRBuildLogHandler),
    (r'/github_auth(.*)', github_auth.Endpoint),
    (r'/config', ConfigHandler),
    (r'/gcsproxy', view_build.GcsProxyHandler)
], debug=True, config=config)


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Lophiostoma vagabundum Sacc., 1875

### Remarks
null


text:
package org.apache.cassandra.cql3;

import java.nio.ByteBuffer;
import java.util.*;

import com.googlecode.concurrentlinkedhashmap.ConcurrentLinkedHashMap;
import org.antlr.runtime.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import org.apache.cassandra.cql3.statements.*;
import org.apache.cassandra.transport.messages.ResultMessage;
import org.apache.cassandra.config.*;
import org.apache.cassandra.db.*;
import org.apache.cassandra.db.filter.*;
import org.apache.cassandra.exceptions.*;
import org.apache.cassandra.service.ClientState;
import org.apache.cassandra.service.QueryState;
import org.apache.cassandra.tracing.Tracing;
import org.apache.cassandra.utils.FBUtilities;
import org.apache.cassandra.utils.MD5Digest;
import org.apache.cassandra.utils.SemanticVersion;

public class QueryProcessor
{
    public static final SemanticVersion CQL_VERSION = new SemanticVersion("3.0.1");

    private static final Logger logger = LoggerFactory.getLogger(QueryProcessor.class);

    public static final int MAX_CACHE_PREPARED = 100000; // Enough to keep buggy clients from OOM'ing us
    private static final Map<MD5Digest, CQLStatement> preparedStatements = new ConcurrentLinkedHashMap.Builder<MD5Digest, CQLStatement>()
                                                                               .maximumWeightedCapacity(MAX_CACHE_PREPARED)
                                                                               .build();

    private static final Map<Integer, CQLStatement> thriftPreparedStatements = new ConcurrentLinkedHashMap.Builder<Integer, CQLStatement>()
                                                                                .maximumWeightedCapacity(MAX_CACHE_PREPARED)
                                                                                .build();

    public static CQLStatement getPrepared(MD5Digest id)
    {
        return preparedStatements.get(id);
    }

    public static CQLStatement getPrepared(Integer id)
    {
        return thriftPreparedStatements.get(id);
    }

    public static void validateKey(ByteBuffer key) throws InvalidRequestException
    {
        if (key == null || key.remaining() == 0)
        {
            throw new InvalidRequestException("Key may not be empty");
        }

        // check that key can be handled by FBUtilities.writeShortByteArray
        if (key.remaining() > FBUtilities.MAX_UNSIGNED_SHORT)
        {
            throw new InvalidRequestException("Key length of " + key.remaining() +
                                              " is longer than maximum of " + FBUtilities.MAX_UNSIGNED_SHORT);
        }
    }

    public static void validateColumnNames(Iterable<ByteBuffer> columns)
    throws InvalidRequestException
    {
        for (ByteBuffer name : columns)
        {
            if (name.remaining() > Column.MAX_NAME_LENGTH)
                throw new InvalidRequestException(String.format("column name is too long (%s > %s)",
                                                                name.remaining(),
                                                                Column.MAX_NAME_LENGTH));
            if (name.remaining() == 0)
                throw new InvalidRequestException("zero-length column name");
        }
    }

    public static void validateColumnName(ByteBuffer column)
    throws InvalidRequestException
    {
        validateColumnNames(Collections.singletonList(column));
    }

    public static void validateFilter(CFMetaData metadata, IDiskAtomFilter filter)
    throws InvalidRequestException
    {
        if (filter instanceof SliceQueryFilter)
            validateSliceFilter(metadata, (SliceQueryFilter)filter);
        else
            validateColumnNames(((NamesQueryFilter)filter).columns);
    }

    public static void validateSliceFilter(CFMetaData metadata, SliceQueryFilter range)
    throws InvalidRequestException
    {
        try
        {
            ColumnSlice.validate(range.slices, metadata.comparator, range.reversed);
        }
        catch (IllegalArgumentException e)
        {
            throw new InvalidRequestException(e.getMessage());
        }
    }

    private static ResultMessage processStatement(CQLStatement statement, ConsistencyLevel cl, QueryState queryState, List<ByteBuffer> variables)
    throws RequestExecutionException, RequestValidationException
    {
        ClientState clientState = queryState.getClientState();
        statement.validate(clientState);
        statement.checkAccess(clientState);
        ResultMessage result = statement.execute(cl, queryState, variables);
        return result == null ? new ResultMessage.Void() : result;
    }

    public static ResultMessage process(String queryString, ConsistencyLevel cl, QueryState queryState)
    throws RequestExecutionException, RequestValidationException
    {
        logger.trace("CQL QUERY: {}", queryString);
        CQLStatement prepared = getStatement(queryString, queryState.getClientState()).statement;
        if (prepared.getBoundsTerms() > 0)
            throw new InvalidRequestException("Cannot execute query with bind variables");
        return processStatement(prepared, cl, queryState, Collections.<ByteBuffer>emptyList());
    }

    public static UntypedResultSet process(String query, ConsistencyLevel cl) throws RequestExecutionException
    {
        try
        {
            QueryState state = new QueryState(new ClientState(true));
            ResultMessage result = process(query, cl, state);
            if (result instanceof ResultMessage.Rows)
                return new UntypedResultSet(((ResultMessage.Rows)result).result);
            else
                return null;
        }
        catch (RequestValidationException e)
        {
            throw new RuntimeException(e);
        }
    }

    public static UntypedResultSet processInternal(String query)
    {
        try
        {
            ClientState state = new ClientState(true);
            QueryState qState = new QueryState(state);
            state.setKeyspace(Table.SYSTEM_KS);
            CQLStatement statement = getStatement(query, state).statement;
            statement.validate(state);
            ResultMessage result = statement.executeInternal(qState);
            if (result instanceof ResultMessage.Rows)
                return new UntypedResultSet(((ResultMessage.Rows)result).result);
            else
                return null;
        }
        catch (RequestExecutionException e)
        {
            throw new RuntimeException(e);
        }
        catch (RequestValidationException e)
        {
            throw new RuntimeException("Error validating " + query, e);
        }
    }

    public static UntypedResultSet resultify(String query, Row row)
    {
        try
        {
            SelectStatement ss = (SelectStatement) getStatement(query, null).statement;
            ResultSet cqlRows = ss.process(Collections.singletonList(row));
            return new UntypedResultSet(cqlRows);
        }
        catch (RequestValidationException e)
        {
            throw new AssertionError(e);
        }
    }

    public static ResultMessage.Prepared prepare(String queryString, ClientState clientState, boolean forThrift)
    throws RequestValidationException
    {
        logger.trace("CQL QUERY: {}", queryString);

        ParsedStatement.Prepared prepared = getStatement(queryString, clientState);
        ResultMessage.Prepared msg = storePreparedStatement(queryString, clientState.getKeyspace(), prepared, forThrift);

        assert prepared.statement.getBoundsTerms() == prepared.boundNames.size();
        return msg;
    }

    private static ResultMessage.Prepared storePreparedStatement(String queryString, String keyspace, ParsedStatement.Prepared prepared, boolean forThrift)
    {
        // Concatenate the current keyspace so we don't mix prepared statements between keyspace (#5352).
        // (if the keyspace is null, queryString has to have a fully-qualified keyspace so it's fine.
        String toHash = keyspace == null ? queryString : keyspace + queryString;
        if (forThrift)
        {
            int statementId = toHash.hashCode();
            thriftPreparedStatements.put(statementId, prepared.statement);
            logger.trace(String.format("Stored prepared statement #%d with %d bind markers",
                                       statementId,
                                       prepared.statement.getBoundsTerms()));
            return ResultMessage.Prepared.forThrift(statementId, prepared.boundNames);
        }
        else
        {
            MD5Digest statementId = MD5Digest.compute(toHash);
            logger.trace(String.format("Stored prepared statement %s with %d bind markers",
                                       statementId,
                                       prepared.statement.getBoundsTerms()));
            preparedStatements.put(statementId, prepared.statement);
            return new ResultMessage.Prepared(statementId, prepared.boundNames);
        }
    }

    public static ResultMessage processPrepared(CQLStatement statement, ConsistencyLevel cl, QueryState queryState, List<ByteBuffer> variables)
    throws RequestExecutionException, RequestValidationException
    {
        // Check to see if there are any bound variables to verify
        if (!(variables.isEmpty() && (statement.getBoundsTerms() == 0)))
        {
            if (variables.size() != statement.getBoundsTerms())
                throw new InvalidRequestException(String.format("there were %d markers(?) in CQL but %d bound variables",
                                                                statement.getBoundsTerms(),
                                                                variables.size()));

            // at this point there is a match in count between markers and variables that is non-zero

            if (logger.isTraceEnabled())
                for (int i = 0; i < variables.size(); i++)
                    logger.trace("[{}] '{}'", i+1, variables.get(i));
        }

        return processStatement(statement, cl, queryState, variables);
    }

    private static ParsedStatement.Prepared getStatement(String queryStr, ClientState clientState)
    throws RequestValidationException
    {
        Tracing.trace("Parsing statement");
        ParsedStatement statement = parseStatement(queryStr);

        // Set keyspace for statement that require login
        if (statement instanceof CFStatement)
            ((CFStatement)statement).prepareKeyspace(clientState);

        Tracing.trace("Peparing statement");
        return statement.prepare();
    }

    public static ParsedStatement parseStatement(String queryStr) throws SyntaxException
    {
        try
        {
            // Lexer and parser
            CharStream stream = new ANTLRStringStream(queryStr);
            CqlLexer lexer = new CqlLexer(stream);
            TokenStream tokenStream = new CommonTokenStream(lexer);
            CqlParser parser = new CqlParser(tokenStream);

            // Parse the query string to a statement instance
            ParsedStatement statement = parser.query();

            // The lexer and parser queue up any errors they may have encountered
            // along the way, if necessary, we turn them into exceptions here.
            lexer.throwLastRecognitionError();
            parser.throwLastRecognitionError();

            return statement;
        }
        catch (RuntimeException re)
        {
            SyntaxException ire = new SyntaxException("Failed parsing statement: [" + queryStr + "] reason: " + re.getClass().getSimpleName() + " " + re.getMessage());
            throw ire;
        }
        catch (RecognitionException e)
        {
            SyntaxException ire = new SyntaxException("Invalid or malformed CQL query string: " + e.getMessage());
            throw ire;
        }
    }
}


text:
/**
 * Utilities for working with {@link java.util.UUID} objects.
 */
package edu.jhu.hlt.utilt.uuid;


text:
import { TestBed, inject } from '@angular/core/testing';

import { UserService } from './user.service';
import { HttpClientModule } from '@angular/common/http';

describe('UserService', () => {
  beforeEach(() => {
    TestBed.configureTestingModule({
      providers: [UserService],
      imports: [HttpClientModule]
    });
  });

  it('should be created', inject([UserService], (service: UserService) => {
    expect(service).toBeTruthy();
  }));
});


text:
package cn.jingzhuan.lib.chart2.widget;

import android.content.Context;
import android.os.Build;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
import android.util.AttributeSet;
import cn.jingzhuan.lib.chart.data.CandlestickDataSet;
import cn.jingzhuan.lib.chart2.base.BaseChart;
import cn.jingzhuan.lib.chart2.renderer.CandlestickChartRenderer;

/**
 * K线图
 * Created by donglua on 8/29/17.
 */

public class CandlestickChart extends BaseChart {

  public CandlestickChart(Context context) {
    super(context);
  }

  public CandlestickChart(Context context, @Nullable AttributeSet attrs) {
    super(context, attrs);
  }

  public CandlestickChart(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
    super(context, attrs, defStyleAttr);
  }

  @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
  public CandlestickChart(Context context, @Nullable AttributeSet attrs, int defStyleAttr,
      int defStyleRes) {
    super(context, attrs, defStyleAttr, defStyleRes);
  }

  @Override public void initChart() {
    super.initChart();

    mRenderer = new CandlestickChartRenderer(this);
  }

  public void addDataSet(CandlestickDataSet candlestickDataSet) {

    mRenderer.addDataSet(candlestickDataSet);
  }

  public void setDataSet(CandlestickDataSet candlestickDataSet) {
    mRenderer.clearDataSet();
    addDataSet(candlestickDataSet);
  }
}


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>de.jpaw</groupId>
        <artifactId>bonaparte-base</artifactId>
        <version>5.0.5</version>
    </parent>

    <artifactId>bonaparte-demorqrs</artifactId>
    <packaging>jar</packaging>

    <description>BONAPARTE demo request/response for communication tests</description>

    <dependencies>
        <dependency>
            <groupId>de.jpaw</groupId>
            <artifactId>bonaparte-core</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
            <version>${slf4j.version}</version>
            <scope>runtime</scope>
        </dependency>
    </dependencies>

    <build>
        <resources>
            <resource>
                <directory>src/main/bon</directory>
                <filtering>false</filtering>
            </resource>
            <resource>
                <directory>src/generated/resources</directory>
                <filtering>false</filtering>
            </resource>
        </resources>

        <plugins>
            <plugin>
                <groupId>org.eclipse.xtext</groupId>
                <artifactId>xtext-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <artifactId>maven-clean-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

</project>


text:
package dashboard_graph

import (
	"fmt"
	"regexp"

	m "github.com/Cepave/open-falcon-backend/modules/f2e-api/app/model/dashboard"
)

type GraphObj struct {
	Title        string
	Endpoints    []string
	Counters     []string
	TimeSpan     int64
	GraphType    string
	Method       string
	Position     int64
	FalconTags   string
	TimeRange    string
	YScale       string
	SortBy       string
	SampleMethod string
}

func (mine GraphObj) CustomCheck() (err error) {

	if mine.Method != "" && mine.Method != "NULL" && mine.Method != "sum" {
		err = fmt.Errorf("method not vaild: %v, only accept 'sum' or 'NULL'", mine.Method)
		return
	}

	if mine.GraphType != "h" && mine.GraphType != "k" && mine.GraphType != "a" {
		err = fmt.Errorf("value of graph_type only accept 'k' or 'h' or 'a', you typed: %v", mine.GraphType)
		return
	}

	if mine.SortBy != "" && mine.SortBy != "a-z" && mine.SortBy != "z-a" {
		err = fmt.Errorf("sort_by only accept 'a-z' or 'z-a', you typed: %v", mine.GraphType)
		return
	}

	// only accpet
	// ex. 1495508389,1496372791
	// ex. 3d
	if mine.TimeRange != "" {
		if match, _ := regexp.MatchString("^((\\d{8}\\d{1,5},\\d{8}\\d{1,5})|(\\d+(h|d|w|m|y)))$", mine.TimeRange); !match {
			err = fmt.Errorf(`you typed: %v, time_range only accept ex. "1495508389,1496372791" or "3d" [h,d,w,m,y]`, mine.TimeRange)
			return
		}
	}

	if mine.YScale != "" {
		// [\d\.]+
		// k m g t
		if match, _ := regexp.MatchString("^(\\d+(k|m|g|t)|[\\d\\.]+)(,(\\d+(k|m|g|t)|[\\d\\.]+))?$", mine.YScale); !match {
			err = fmt.Errorf(`y_scale value: '%v' not vaild, please check api document`, mine.YScale)
			return
		}
	}

	if mine.SampleMethod != "" {
		flag := false
		slist := []string{"AVERAGE", "MAX", "MIN"}
		for _, s := range slist {
			flag = mine.SampleMethod == s
			if flag {
				break
			}
		}
		if !flag {
			err = fmt.Errorf(`sample_method value: '%v' not vaild, only accept: "AVERAGE" or "MAX" or "MIN"`, mine.SampleMethod)
			return
		}
	}
	return
}

// Inputs struct for GraphCreateReqDataWithNewScreen
type APIGraphCreateReqDataWithNewScreenInputs struct {
	ScreenName   string   `json:"screen_name" form:"screen_name" binding:"required"`
	Title        string   `json:"title" form:"title" binding:"required"`
	Endpoints    []string `json:"endpoints" form:"endpoints" binding:"required"`
	Counters     []string `json:"counters" form:"counters" binding:"required"`
	TimeSpan     int64    `json:"timespan" form:"timespan"`
	GraphType    string   `json:"graph_type" form:"graph_type" binding:"required"`
	Method       string   `json:"method" form:"method"`
	Position     int64    `json:"position" form:"position"`
	FalconTags   string   `json:"falcon_tags" form:"falcon_tags"`
	TimeRange    string   `json:"time_range" form:"time_range"`
	YScale       string   `json:"y_scale" form:"y_scale"`
	SortBy       string   `json:"sort_by" form:"sort_by"`
	SampleMethod string   `json:"sample_method" form:"sample_method"`
}

func (mine APIGraphCreateReqDataWithNewScreenInputs) Check() (err error) {
	sc := m.DashboardScreen{Name: mine.ScreenName}
	// check screen_id
	if sc.ExistName() {
		err = fmt.Errorf("screen name:%v already existing", mine.ScreenName)
		return
	}

	graphobj := GraphObj{
		GraphType:    mine.GraphType,
		SortBy:       mine.SortBy,
		TimeRange:    mine.TimeRange,
		YScale:       mine.YScale,
		SampleMethod: mine.SampleMethod,
		Method:       mine.Method,
	}
	err = graphobj.CustomCheck()
	return
}

// Inputs struct for DashboardGraphCreate
type APIGraphCreateReqData struct {
	ScreenId     int64    `json:"screen_id" form:"screen_id" binding:"required"`
	Title        string   `json:"title" form:"title" binding:"required"`
	Endpoints    []string `json:"endpoints" form:"endpoints" binding:"required"`
	Counters     []string `json:"counters" form:"counters" binding:"required"`
	TimeSpan     int64    `json:"timespan" form:"timespan"`
	GraphType    string   `json:"graph_type" form:"graph_type" binding:"required"`
	Method       string   `json:"method" form:"method"`
	Position     int64    `json:"position" form:"position"`
	FalconTags   string   `json:"falcon_tags" form:"falcon_tags"`
	TimeRange    string   `json:"time_range" form:"time_range" binding:"required"`
	YScale       string   `json:"y_scale" form:"y_scale"`
	SortBy       string   `json:"sort_by" form:"sort_by"`
	SampleMethod string   `json:"sample_method" form:"sample_method"`
}

func (mine APIGraphCreateReqData) Check() (err error) {
	sc := m.DashboardScreen{ID: mine.ScreenId}
	// check screen_id
	if !sc.Exist() {
		err = fmt.Errorf("screen id:%v is not existing", mine.ScreenId)
		return
	}

	graphobj := GraphObj{
		TimeSpan:     mine.TimeSpan,
		GraphType:    mine.GraphType,
		SortBy:       mine.SortBy,
		TimeRange:    mine.TimeRange,
		YScale:       mine.YScale,
		SampleMethod: mine.SampleMethod,
	}
	err = graphobj.CustomCheck()
	return
}

// Inputs struct for DashboardGraphUpdate
type APIGraphUpdateReqData struct {
	ID           int64    `json:"id" form:"id" binding:"required"`
	ScreenId     int64    `json:"screen_id" form:"screen_id"`
	Title        string   `json:"title" form:"title"`
	Endpoints    []string `json:"endpoints" form:"endpoints"`
	Counters     []string `json:"counters" form:"counters"`
	TimeSpan     int64    `json:"timespan" form:"timespan"`
	GraphType    string   `json:"graph_type" form:"graph_type"`
	Method       string   `json:"method" form:"method"`
	Position     int64    `json:"position" form:"position"`
	FalconTags   string   `json:"falcon_tags" form:"falcon_tags"`
	TimeRange    string   `json:"time_range" form:"time_range"`
	YScale       string   `json:"y_scale" form:"y_scale"`
	SortBy       string   `json:"sort_by" form:"sort_by"`
	SampleMethod string   `json:"sample_method" form:"sample_method"`
}

func (mine APIGraphUpdateReqData) Check() (err error) {
	sc := m.DashboardScreen{ID: mine.ScreenId}
	// check screen_id
	if mine.ScreenId != 0 && !sc.Exist() {
		err = fmt.Errorf("screen id:%v is not existing", mine.ScreenId)
		return
	}

	graphobj := GraphObj{
		TimeSpan:     mine.TimeSpan,
		GraphType:    mine.GraphType,
		SortBy:       mine.SortBy,
		TimeRange:    mine.TimeRange,
		YScale:       mine.YScale,
		SampleMethod: mine.SampleMethod,
	}
	err = graphobj.CustomCheck()
	return
}


text:
package retrofit;

import java.io.IOException;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.lang.reflect.Type;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.concurrent.Executor;
import java.util.concurrent.TimeUnit;
import retrofit.Profiler.RequestInformation;
import retrofit.client.Client;
import retrofit.client.Header;
import retrofit.client.Request;
import retrofit.client.Response;
import retrofit.converter.ConversionException;
import retrofit.converter.Converter;
import retrofit.mime.MimeUtil;
import retrofit.mime.TypedByteArray;
import retrofit.mime.TypedInput;
import retrofit.mime.TypedOutput;

/**
 * Adapts a Java interface to a REST API.
 *

 * API endpoints are defined as methods on an interface with annotations providing metadata about
 * the form in which the HTTP call should be made.
 *

 * The relative path for a given method is obtained from an annotation on the method describing
 * the request type. The built-in methods are {@link retrofit.http.GET GET},
 * {@link retrofit.http.PUT PUT}, {@link retrofit.http.POST POST}, {@link retrofit.http.HEAD HEAD},
 * and {@link retrofit.http.DELETE DELETE}. You can define your own HTTP method by creating an
 * annotation that takes a {code String} value and itself is annotated with
 * {@link retrofit.http.RestMethod @RestMethod}.
 *

 * Method parameters can be used to replace parts of the URL by annotating them with
 * {@link retrofit.http.Path @Path}. Replacement sections are denoted by an identifier surrounded
 * by curly braces (e.g., "{foo}"). To add items to the query string of a URL use
 * {@link retrofit.http.Query @Query}. If the path or query element has already been URI encoded
 * use {@link retrofit.http.EncodedPath @EncodedPath} or
 * {@link retrofit.http.EncodedQuery @EncodedQuery} to prevent repeated encoding.
 *

 * HTTP requests happen in one of two ways:
 *

 *
On the provided HTTP {@link Executor} with callbacks marshaled to the callback
 * {@link Executor}. The last method parameter should be of type {@link Callback}. The HTTP
 * response will be converted to the callback's parameter type using the specified
 * {@link retrofit.converter.Converter Converter}. If the callback parameter type uses a wildcard,
 * the lower bound will be used as the conversion type.
 *
On the current thread returning the response or throwing a {@link RetrofitError}. The HTTP
 * response will be converted to the method's return type using the specified
 * {@link retrofit.converter.Converter Converter}.
 *

 *

 * The body of a request is denoted by the {@link retrofit.http.Body @Body} annotation. The object
 * will be converted to request representation by a call to
 * {@link retrofit.converter.Converter#toBody(Object) toBody} on the supplied
 * {@link retrofit.converter.Converter Converter} for this instance. The body can also be a
 * {@link TypedOutput} where it will be used directly.
 *

 * Alternative request body formats are supported by method annotations and corresponding parameter
 * annotations:
 *

 *
{@link retrofit.http.FormUrlEncoded @FormUrlEncoded} - Form-encoded data with key-value
 * pairs specified by the {@link retrofit.http.Field @Field} parameter annotation.
 *
{@link retrofit.http.Multipart @Multipart} - RFC 2387-compliant multi-part data with parts
 * specified by the {@link retrofit.http.Part @Part} parameter annotation.
 *

 *

 * Additional static headers can be added for an endpoint using the
 * {@link retrofit.http.Headers @Headers} method annotation. For per-request control over a header
 * annotate a parameter with {@link Header @Header}.
 *

 * For example:
 *

 * public interface MyApi {
 *   @POST("/category/{cat}") // Asynchronous execution.
 *   void categoryList(@Path("cat") String a, @Query("page") int b,
 *                     Callback<List<Item>> cb);
 *   @POST("/category/{cat}") // Synchronous execution.
 *   List<Item> categoryList(@Path("cat") String a, @Query("page") int b);
 * }
 *

 *

 * Calling {@link #create(Class)} with {@code MyApi.class} will validate and create a new
 * implementation of the API.
 *
 * @author Bob Lee (bob@squareup.com)
 * @author Jake Wharton (jw@squareup.com)
 */
public class RestAdapter {
  static final String THREAD_PREFIX = "Retrofit-";
  static final String IDLE_THREAD_NAME = THREAD_PREFIX + "Idle";

  /** Simple logging abstraction for debug messages. */
  public interface Log {
    /** Log a debug message to the appropriate console. */
    void log(String message);

    /** A {@link Log} implementation which does not log anything. */
    Log NONE = new Log() {
      @Override public void log(String message) {
      }
    };
  }

  /** Controls the level of logging. */
  public enum LogLevel {
    /** No logging. */
    NONE,
    /** Log only the request method and URL and the response status code and execution time. */
    BASIC,
    /** Log the basic information along with request and response headers. */
    HEADERS,
    /**
     * Log the headers, body, and metadata for both requests and responses.
     *

     * Note: This requires that the entire request and response body be buffered in memory!
     */
    FULL;

    public boolean log() {
      return this != NONE;
    }
  }

  private final Map<Class<?>, Map<Method, RestMethodInfo>> serviceMethodInfoCache =
      new LinkedHashMap<Class<?>, Map<Method, RestMethodInfo>>();

  final Endpoint server;
  final Executor httpExecutor;
  final Executor callbackExecutor;
  final RequestInterceptor requestInterceptor;
  final Converter converter;
  final Log log;
  final ErrorHandler errorHandler;

  private final Client.Provider clientProvider;
  private final Profiler profiler;
  private RxSupport rxSupport;

  volatile LogLevel logLevel;

  private RestAdapter(Endpoint server, Client.Provider clientProvider, Executor httpExecutor,
      Executor callbackExecutor, RequestInterceptor requestInterceptor, Converter converter,
      Profiler profiler, ErrorHandler errorHandler, Log log, LogLevel logLevel) {
    this.server = server;
    this.clientProvider = clientProvider;
    this.httpExecutor = httpExecutor;
    this.callbackExecutor = callbackExecutor;
    this.requestInterceptor = requestInterceptor;
    this.converter = converter;
    this.profiler = profiler;
    this.errorHandler = errorHandler;
    this.log = log;
    this.logLevel = logLevel;
  }

  /** Change the level of logging. */
  public void setLogLevel(LogLevel loglevel) {
    if (logLevel == null) {
      throw new NullPointerException("Log level may not be null.");
    }
    this.logLevel = loglevel;
  }

  /** The current logging level. */
  public LogLevel getLogLevel() {
    return logLevel;
  }

  /** Create an implementation of the API defined by the specified {@code service} interface. */
  @SuppressWarnings("unchecked")
  public <T> T create(Class<T> service) {
    Utils.validateServiceClass(service);
    return (T) Proxy.newProxyInstance(service.getClassLoader(), new Class<?>[] { service },
        new RestHandler(getMethodInfoCache(service)));
  }

  Map<Method, RestMethodInfo> getMethodInfoCache(Class<?> service) {
    synchronized (serviceMethodInfoCache) {
      Map<Method, RestMethodInfo> methodInfoCache = serviceMethodInfoCache.get(service);
      if (methodInfoCache == null) {
        methodInfoCache = new LinkedHashMap<Method, RestMethodInfo>();
        serviceMethodInfoCache.put(service, methodInfoCache);
      }
      return methodInfoCache;
    }
  }

  static RestMethodInfo getMethodInfo(Map<Method, RestMethodInfo> cache, Method method) {
    synchronized (cache) {
      RestMethodInfo methodInfo = cache.get(method);
      if (methodInfo == null) {
        methodInfo = new RestMethodInfo(method);
        cache.put(method, methodInfo);
      }
      return methodInfo;
    }
  }

  private class RestHandler implements InvocationHandler {
    private final Map<Method, RestMethodInfo> methodDetailsCache;

    RestHandler(Map<Method, RestMethodInfo> methodDetailsCache) {
      this.methodDetailsCache = methodDetailsCache;
    }

    @SuppressWarnings("unchecked") //
    @Override public Object invoke(Object proxy, Method method, final Object[] args)
        throws Throwable {
      // If the method is a method from Object then defer to normal invocation.
      if (method.getDeclaringClass() == Object.class) {
        return method.invoke(this, args);
      }

      // Load or create the details cache for the current method.
      final RestMethodInfo methodInfo = getMethodInfo(methodDetailsCache, method);

      if (methodInfo.isSynchronous) {
        try {
          return invokeRequest(requestInterceptor, methodInfo, args);
        } catch (RetrofitError error) {
          Throwable newError = errorHandler.handleError(error);
          if (newError == null) {
            throw new IllegalStateException("Error handler returned null for wrapped exception.",
                error);
          }
          throw newError;
        }
      }

      if (httpExecutor == null || callbackExecutor == null) {
        throw new IllegalStateException("Asynchronous invocation requires calling setExecutors.");
      }

      if (methodInfo.isObservable) {
        if (rxSupport == null) {
          if (Platform.HAS_RX_JAVA) {
            rxSupport = new RxSupport(httpExecutor, errorHandler, requestInterceptor);
          } else {
            throw new IllegalStateException("Observable method found but no RxJava on classpath.");
          }
        }
        return rxSupport.createRequestObservable(new RxSupport.Invoker() {
          @Override public ResponseWrapper invoke(RequestInterceptor requestInterceptor) {
            return (ResponseWrapper) invokeRequest(requestInterceptor, methodInfo, args);
          }
        });
      }

      // Apply the interceptor synchronously, recording the interception so we can replay it later.
      // This way we still defer argument serialization to the background thread.
      final RequestInterceptorTape interceptorTape = new RequestInterceptorTape();
      requestInterceptor.intercept(interceptorTape);

      Callback<?> callback = (Callback<?>) args[args.length - 1];
      httpExecutor.execute(new CallbackRunnable(callback, callbackExecutor, errorHandler) {
        @Override public ResponseWrapper obtainResponse() {
          return (ResponseWrapper) invokeRequest(interceptorTape, methodInfo, args);
        }
      });
      return null; // Asynchronous methods should have return type of void.
    }

    /**
     * Execute an HTTP request.
     *
     * @return HTTP response object of specified {@code type} or {@code null}.
     * @throws RetrofitError if any error occurs during the HTTP request.
     */
    private Object invokeRequest(RequestInterceptor requestInterceptor, RestMethodInfo methodInfo,
        Object[] args) {
      String url = null;
      try {
        methodInfo.init(); // Ensure all relevant method information has been loaded.

        String serverUrl = server.getUrl();
        RequestBuilder requestBuilder = new RequestBuilder(serverUrl, methodInfo, converter);
        requestBuilder.setArguments(args);

        requestInterceptor.intercept(requestBuilder);

        Request request = requestBuilder.build();
        url = request.getUrl();

        if (!methodInfo.isSynchronous) {
          // If we are executing asynchronously then update the current thread with a useful name.
          Thread.currentThread().setName(THREAD_PREFIX + url.substring(serverUrl.length()));
        }

        if (logLevel.log()) {
          // Log the request data.
          request = logAndReplaceRequest("HTTP", request);
        }

        Object profilerObject = null;
        if (profiler != null) {
          profilerObject = profiler.beforeCall();
        }

        long start = System.nanoTime();
        Response response = clientProvider.get().execute(request);
        long elapsedTime = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - start);

        int statusCode = response.getStatus();
        if (profiler != null) {
          RequestInformation requestInfo = getRequestInfo(serverUrl, methodInfo, request);
          //noinspection unchecked
          profiler.afterCall(requestInfo, elapsedTime, statusCode, profilerObject);
        }

        if (logLevel.log()) {
          // Log the response data.
          response = logAndReplaceResponse(url, response, elapsedTime);
        }

        Type type = methodInfo.responseObjectType;

        if (statusCode >= 200 && statusCode < 300) { // 2XX == successful request
          // Caller requested the raw Response object directly.
          if (type.equals(Response.class)) {
            if (!methodInfo.isStreaming) {
              // Read the entire stream and replace with one backed by a byte[].
              response = Utils.readBodyToBytesIfNecessary(response);
            }

            if (methodInfo.isSynchronous) {
              return response;
            }
            return new ResponseWrapper(response, response);
          }

          TypedInput body = response.getBody();
          if (body == null) {
            if (methodInfo.isSynchronous) {
              return null;
            }
            return new ResponseWrapper(response, null);
          }

          ExceptionCatchingTypedInput wrapped = new ExceptionCatchingTypedInput(body);
          try {
            Object convert = converter.fromBody(wrapped, type);
            if (methodInfo.isSynchronous) {
              return convert;
            }
            return new ResponseWrapper(response, convert);
          } catch (ConversionException e) {
            // If the underlying input stream threw an exception, propagate that rather than
            // indicating that it was a conversion exception.
            if (wrapped.threwException()) {
              throw wrapped.getThrownException();
            }

            // The response body was partially read by the converter. Replace it with null.
            response = Utils.replaceResponseBody(response, null);

            throw RetrofitError.conversionError(url, response, converter, type, e);
          }
        }

        response = Utils.readBodyToBytesIfNecessary(response);
        throw RetrofitError.httpError(url, response, converter, type);
      } catch (RetrofitError e) {
        throw e; // Pass through our own errors.
      } catch (IOException e) {
        if (logLevel.log()) {
          logException(e, url);
        }
        throw RetrofitError.networkError(url, e);
      } catch (Throwable t) {
        if (logLevel.log()) {
          logException(t, url);
        }
        throw RetrofitError.unexpectedError(url, t);
      } finally {
        if (!methodInfo.isSynchronous) {
          Thread.currentThread().setName(IDLE_THREAD_NAME);
        }
      }
    }
  }

  /** Log request headers and body. Consumes request body and returns identical replacement. */
  Request logAndReplaceRequest(String name, Request request) throws IOException {
    log.log(String.format("---> %s %s %s", name, request.getMethod(), request.getUrl()));

    if (logLevel.ordinal() >= LogLevel.HEADERS.ordinal()) {
      for (Header header : request.getHeaders()) {
        log.log(header.toString());
      }

      String bodySize = "no";
      TypedOutput body = request.getBody();
      if (body != null) {
        String bodyMime = body.mimeType();
        if (bodyMime != null) {
          log.log("Content-Type: " + bodyMime);
        }

        long bodyLength = body.length();
        bodySize = bodyLength + "-byte";
        if (bodyLength != -1) {
          log.log("Content-Length: " + bodyLength);
        }

        if (logLevel.ordinal() >= LogLevel.FULL.ordinal()) {
          if (!request.getHeaders().isEmpty()) {
            log.log("");
          }
          if (!(body instanceof TypedByteArray)) {
            // Read the entire response body to we can log it and replace the original response
            request = Utils.readBodyToBytesIfNecessary(request);
            body = request.getBody();
          }

          byte[] bodyBytes = ((TypedByteArray) body).getBytes();
          String bodyCharset = MimeUtil.parseCharset(body.mimeType());
          log.log(new String(bodyBytes, bodyCharset));
        }
      }

      log.log(String.format("---> END %s (%s body)", name, bodySize));
    }

    return request;
  }

  /** Log response headers and body. Consumes response body and returns identical replacement. */
  private Response logAndReplaceResponse(String url, Response response, long elapsedTime)
      throws IOException {
    log.log(String.format("<--- HTTP %s %s (%sms)", response.getStatus(), url, elapsedTime));

    if (logLevel.ordinal() >= LogLevel.HEADERS.ordinal()) {
      for (Header header : response.getHeaders()) {
        log.log(header.toString());
      }

      long bodySize = 0;
      TypedInput body = response.getBody();
      if (body != null) {
        bodySize = body.length();

        if (logLevel.ordinal() >= LogLevel.FULL.ordinal()) {
          if (!response.getHeaders().isEmpty()) {
            log.log("");
          }

          if (!(body instanceof TypedByteArray)) {
            // Read the entire response body so we can log it and replace the original response
            response = Utils.readBodyToBytesIfNecessary(response);
            body = response.getBody();
          }

          byte[] bodyBytes = ((TypedByteArray) body).getBytes();
          bodySize = bodyBytes.length;
          String bodyMime = body.mimeType();
          String bodyCharset = MimeUtil.parseCharset(bodyMime);
          log.log(new String(bodyBytes, bodyCharset));
        }
      }

      log.log(String.format("<--- END HTTP (%s-byte body)", bodySize));
    }

    return response;
  }

  /** Log an exception that occurred during the processing of a request or response. */
  void logException(Throwable t, String url) {
    log.log(String.format("---- ERROR %s", url != null ? url : ""));
    StringWriter sw = new StringWriter();
    t.printStackTrace(new PrintWriter(sw));
    log.log(sw.toString());
    log.log("---- END ERROR");
  }

  private static Profiler.RequestInformation getRequestInfo(String serverUrl,
      RestMethodInfo methodDetails, Request request) {
    long contentLength = 0;
    String contentType = null;

    TypedOutput body = request.getBody();
    if (body != null) {
      contentLength = body.length();
      contentType = body.mimeType();
    }

    return new Profiler.RequestInformation(methodDetails.requestMethod, serverUrl,
        methodDetails.requestUrl, contentLength, contentType);
  }

  /**
   * Build a new {@link RestAdapter}.
   *

   * Calling the following methods is required before calling {@link #build()}:
   *

   *
{@link #setEndpoint(Endpoint)}

   *
{@link #setClient(Client.Provider)}

   *
{@link #setConverter(Converter)}

   *

   *

   * If you are using asynchronous execution (i.e., with {@link Callback Callbacks}) the following
   * is also required:
   *

   *
{@link #setExecutors(java.util.concurrent.Executor, java.util.concurrent.Executor)}

   *

   */
  public static class Builder {
    private Endpoint endpoint;
    private Client.Provider clientProvider;
    private Executor httpExecutor;
    private Executor callbackExecutor;
    private RequestInterceptor requestInterceptor;
    private Converter converter;
    private Profiler profiler;
    private ErrorHandler errorHandler;
    private Log log;
    private LogLevel logLevel = LogLevel.NONE;

    /** API endpoint URL. */
    public Builder setEndpoint(String endpoint) {
      if (endpoint == null || endpoint.trim().length() == 0) {
        throw new NullPointerException("Endpoint may not be blank.");
      }
      this.endpoint = Endpoints.newFixedEndpoint(endpoint);
      return this;
    }

    /** API endpoint. */
    public Builder setEndpoint(Endpoint endpoint) {
      if (endpoint == null) {
        throw new NullPointerException("Endpoint may not be null.");
      }
      this.endpoint = endpoint;
      return this;
    }

    /** The HTTP client used for requests. */
    public Builder setClient(final Client client) {
      if (client == null) {
        throw new NullPointerException("Client may not be null.");
      }
      return setClient(new Client.Provider() {
        @Override public Client get() {
          return client;
        }
      });
    }

    /** The HTTP client used for requests. */
    public Builder setClient(Client.Provider clientProvider) {
      if (clientProvider == null) {
        throw new NullPointerException("Client provider may not be null.");
      }
      this.clientProvider = clientProvider;
      return this;
    }

    /**
     * Executors used for asynchronous HTTP client downloads and callbacks.
     *
     * @param httpExecutor Executor on which HTTP client calls will be made.
     * @param callbackExecutor Executor on which any {@link Callback} methods will be invoked. If
     * this argument is {@code null} then callback methods will be run on the same thread as the
     * HTTP client.
     */
    public Builder setExecutors(Executor httpExecutor, Executor callbackExecutor) {
      if (httpExecutor == null) {
        throw new NullPointerException("HTTP executor may not be null.");
      }
      if (callbackExecutor == null) {
        callbackExecutor = new Utils.SynchronousExecutor();
      }
      this.httpExecutor = httpExecutor;
      this.callbackExecutor = callbackExecutor;
      return this;
    }

    /** A request interceptor for adding data to every request. */
    public Builder setRequestInterceptor(RequestInterceptor requestInterceptor) {
      if (requestInterceptor == null) {
        throw new NullPointerException("Request interceptor may not be null.");
      }
      this.requestInterceptor = requestInterceptor;
      return this;
    }

    /** The converter used for serialization and deserialization of objects. */
    public Builder setConverter(Converter converter) {
      if (converter == null) {
        throw new NullPointerException("Converter may not be null.");
      }
      this.converter = converter;
      return this;
    }

    /** Set the profiler used to measure requests. */
    public Builder setProfiler(Profiler profiler) {
      if (profiler == null) {
        throw new NullPointerException("Profiler may not be null.");
      }
      this.profiler = profiler;
      return this;
    }

    /**
     * The error handler allows you to customize the type of exception thrown for errors on
     * synchronous requests.
     */
    public Builder setErrorHandler(ErrorHandler errorHandler) {
      if (errorHandler == null) {
        throw new NullPointerException("Error handler may not be null.");
      }
      this.errorHandler = errorHandler;
      return this;
    }

    /** Configure debug logging mechanism. */
    public Builder setLog(Log log) {
      if (log == null) {
        throw new NullPointerException("Log may not be null.");
      }
      this.log = log;
      return this;
    }

    /** Change the level of logging. */
    public Builder setLogLevel(LogLevel logLevel) {
      if (logLevel == null) {
        throw new NullPointerException("Log level may not be null.");
      }
      this.logLevel = logLevel;
      return this;
    }

    /** Create the {@link RestAdapter} instances. */
    public RestAdapter build() {
      if (endpoint == null) {
        throw new IllegalArgumentException("Endpoint may not be null.");
      }
      ensureSaneDefaults();
      return new RestAdapter(endpoint, clientProvider, httpExecutor, callbackExecutor,
          requestInterceptor, converter, profiler, errorHandler, log, logLevel);
    }

    private void ensureSaneDefaults() {
      if (converter == null) {
        converter = Platform.get().defaultConverter();
      }
      if (clientProvider == null) {
        clientProvider = Platform.get().defaultClient();
      }
      if (httpExecutor == null) {
        httpExecutor = Platform.get().defaultHttpExecutor();
      }
      if (callbackExecutor == null) {
        callbackExecutor = Platform.get().defaultCallbackExecutor();
      }
      if (errorHandler == null) {
        errorHandler = ErrorHandler.DEFAULT;
      }
      if (log == null) {
        log = Platform.get().defaultLog();
      }
      if (requestInterceptor == null) {
        requestInterceptor = RequestInterceptor.NONE;
      }
    }
  }
}


text:
from django.shortcuts import render
from django.core.urlresolvers import reverse_lazy
from django.views import generic as django_generic
from django.http import HttpResponse
from django.contrib import messages

# 3rd Party Package imports
from braces.views import LoginRequiredMixin

#Lackawanna Specific imports
from .models import Collection
from .forms import CollectionCreationForm
from datapoint.models import Datapoint

# REST API related imports
from rest_framework import generics as rest_generics, permissions, filters
from collection.serializers import CollectionSerializer

class CollectionList(rest_generics.ListAPIView):
    queryset = Collection.objects.all()
    serializer_class = CollectionSerializer
    filter_fields = ('project', 'owner')

class CollectionReadUpdateDeleteView(rest_generics.RetrieveUpdateDestroyAPIView):
    queryset = Collection.objects.all()
    serializer_class = CollectionSerializer

class CollectionListView(LoginRequiredMixin, django_generic.ListView):
    model = Collection

class CollectionCreateView(LoginRequiredMixin, django_generic.CreateView):
    form_class = CollectionCreationForm
    template_name = 'collection/collection_create.html'
    success_message = "Collection created. Start adding datapoints to it using the 'Add to Collection' button in the datapoint viewer."

    def form_valid(self, form):
        form.instance.owner = self.request.user
        messages.success(self.request, self.success_message)
        return super(CollectionCreateView, self).form_valid(form)

    def get_success_url(self):
        return reverse_lazy('project:detail', kwargs={'slug': self.object.project.slug})

class CollectionUpdateView(LoginRequiredMixin, django_generic.UpdateView):
    model = Collection
    fields = ('owner', 'project', 'name', 'description',)
    success_url = reverse_lazy('collection:list')

class CollectionDeleteView(LoginRequiredMixin, django_generic.DeleteView):
    model = Collection
    success_message = "Collection deleted successfully"

    def delete(self, request, *args, **kwargs):
        messages.success(self.request, self.success_message)
        return super(CollectionDeleteView, self).delete(request, *args, **kwargs)

    def get_success_url(self):
        return reverse_lazy('project:detail', kwargs={'slug': self.object.project.slug})

class CollectionDetailView(LoginRequiredMixin, django_generic.DetailView):
    template_name = 'collection/collection_detail.html'
    model = Collection

    def get_context_data(self, **kwargs):
        context = super(CollectionDetailView, self).get_context_data(**kwargs)
        context['datapoints'] = Datapoint.objects.filter(collections=self.get_object())
        return context

class CollectionSettingsView(LoginRequiredMixin, django_generic.View):
    template_name = 'collection/collection_settings.html'
    model = Collection

    def get_context_data(self, **kwargs):
        context = super(CollectionSettingsView, self).get_context_data(**kwargs)
        return context


text:
'use strict';

/**
 * @ngdoc overview
 * @name projectHomeGeneratorUiApp
 * @description
 * # projectHomeGeneratorUiApp
 *
 * Main module of the application.
 */
angular
  .module('projectHomeGeneratorUiApp', [
    'ngAnimate',
    'ngCookies',
    'ngResource',
    'ngRoute',
    'ngSanitize',
    'ngTouch',
    'toaster',
    'ngProgress'
  ])
  .config(function ($routeProvider) {
    $routeProvider
      .when('/home', {
        templateUrl: 'views/main.html',
        controller: 'MainCtrl',
        controllerAs: 'main'
      })
      .when('/about', {
        templateUrl: 'views/about.html',
        controller: 'AboutCtrl',
        controllerAs: 'about'
      })
      .when('/project-list', {
        templateUrl: 'views/project-list.html',
        controller: 'ProjectListCtrl',
        controllerAs: 'projectList'
      })
      .when('/project-create', {
        templateUrl: 'views/project-create.html',
        controller: 'ProjectCreateCtrl',
        controllerAs: 'projectCreate'
      })
      .when('/project-edit/:projectId', {
        templateUrl: 'views/project-edit.html',
        controller: 'ProjectEditCtrl',
        controllerAs: 'projectEdit'
      })
      .when('/project-generate/:projectId', {
        templateUrl: 'views/project-generate.html',
        controller: 'ProjectGenerateCtrl',
        controllerAs: 'projectGenerate'
      })
      .otherwise({
        redirectTo: '/home'
      });
  });

angular.module('projectHomeGeneratorUiApp')
  .factory('globalHttpInterceptor', function ($rootScope, $q) {
    return {
      'request': function(config) {
        config.timeout = 3000;
        $rootScope.currentActions++;
        $rootScope.progressInstance.start();
        $rootScope.showOverlay = true;
        return config;
      },
      'response': function(response) {
        $rootScope.currentActions--;
        if($rootScope.currentActions === 0) {
          $rootScope.progressInstance.complete();
          $rootScope.showOverlay = false;
        }
        return response;
      },
      'responseError': function(rejection) {
        $rootScope.currentActions--;
        if($rootScope.currentActions === 0) {
          $rootScope.progressInstance.complete();
          $rootScope.showOverlay = false;
        }
        return $q.reject(rejection);
      }
    };
 });

angular
  .module('projectHomeGeneratorUiApp')
  .config(function($httpProvider){
    $httpProvider.interceptors.push('globalHttpInterceptor');
  });

angular
  .module('projectHomeGeneratorUiApp')
  .config(function( $compileProvider ) {
    //allow blob as valid href
    $compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|ftp|mailto|blob):/);
  });


text:
title: WAI-ARIA Support
page_title: WAI-ARIA Support | RadPivotGrid for ASP.NET AJAX Documentation
description: WAI-ARIA Support
slug: pivotgrid/accessibility-and-internationalization/wai-aria-support
tags: wai-aria,support
published: True
position: 2
---

# WAI-ARIA Support

##

The **RadPivotGrid** control offers **WAI-ARIA** support which can be easily enabled by setting the **EnableAriaSupport** server property to **true**.

RadPivotGrid ARIA attributes are **lower case**. They are shown in the table below.

>caption

|  **Control**  |  **Attributes**  |
| ------ | ------ |
| **RadPivotGrid** |Aria-readonlyAria-atomicAria-labelRole:gridRole:presentation – on different pivot zonesRole:button – on pager and filter buttonsaria-grabbedaria-dropeffectrole:scrollbar – on the div scrollbarsrole:rowrole:gridcellrole:rowheaderrole:columnheaderaria-expandedaria-sortEnabled ARIA for inner controls – where it is supported|

>note An issue with the use of WAI-ARIA in HTML documents is that they don't validate. When you run a HTML document containing ARIA attributes through the W3C Validator it shows errors in the results for any ARIA attributes. The DOCTYPE declarations do not include any information about the WAI ARIA attributes and you cannot have a valid document which includes elements, attributes, and attribute values, not detailed in its DTD's.
>

# See Also

 * [WAI-ARIA basic information](http://www.w3.org/WAI/intro/aria)


text:
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use home\assets\AppAsset;
use home\widgets\Alert;
use dektrium\user\models\LoginForm;
use yii\helpers\Url;
use yii\widgets\Breadcrumbs;
use star\member\models\Wishlist;
use himiklab\thumbnail\EasyThumbnailImage;
/* @var $this \yii\web\View */
/* @var $content string */

AppAsset::register($this);
?>
<?php $this->beginPage() ?>
<!DOCTYPE html>
<html lang="<?= Yii::$app->language ?>">

    <meta charset="<?= Yii::$app->charset ?>">

    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">

    <?= Html::csrfMetaTags() ?>
    <title><?= Html::encode($this->title) ?></title>
    <?php
    $this->head();
    list($path, $link) = $this->getAssetManager()->publish('@theme/home/default/assets');
    $this->registerCssFile($link . '/css/camera.css', ['depends' => [\yii\web\JqueryAsset::className()]]);
    $this->registerCssFile($link . '/css/owl.carousel.css', ['depends' => [\yii\web\JqueryAsset::className()]]);
    $this->registerCssFile($link . '/css/owl.transitions.css', ['depends' => [\yii\web\JqueryAsset::className()]]);
    $this->registerCssFile($link . '/css/jquery.custom-scrollbar.css', ['depends' => [\yii\web\JqueryAsset::className()]]);
    $this->registerCssFile($link . '/css/style.css', ['depends' => [\yii\web\JqueryAsset::className()]]);
    $this->registerCssFile($link . '/css/font-awesome.min.css', ['depends' => [\yii\web\JqueryAsset::className()]]);

    $this->registerJsFile($link . '/js/modernizr.js', ['depends' => [\yii\web\JqueryAsset::className()]]);
    ?>

<?php $this->beginBody() ?>

        <button class="bg_tr color_dark tr_all_hover text_cs_hover close f_size_large">
        </button>

登陆

        <?php $form = ActiveForm::begin([
            'id' => 'login-form',
            'enableAjaxValidation' => true,
            'enableClientValidation' => false,
            'validateOnBlur' => false,
            'validateOnType' => false,
            'validateOnChange' => false,
            'action' => Url::to(['/user/security/login']),
        ]);
        /** @var dektrium\user\models\LoginForm $model */
        $model = \Yii::createObject(LoginForm::className());;

        ?>

                <?= $form->field($model, 'login', ['inputOptions' => ['autofocus' => 'autofocus', 'class' => 'r_corners full_width', 'tabindex' => '1']])->textInput()->label('用户名', ['class' => 'm_bottom_5 d_inline_b']) ?>

                <?= $form->field($model, 'password', ['inputOptions' => ['class' => 'r_corners full_width', 'tabindex' => '2']])->passwordInput()->label(Yii::t('user', 'Password')) ?>

                <?= $form->field($model, 'rememberMe')->checkbox(['tabindex' => '4', 'class' => 'd_none']) ?>

                <?= Html::submitButton(Yii::t('user', 'Sign in'), ['class' => 'button_type_4 tr_all_hover r_corners f_left bg_scheme_color color_light f_mxs_none m_mxs_bottom_15']) ?>

                    <a href="<?= Url::to(['/user/security/login']) ?>" class="color_dark">忘记密码?

        <?php ActiveForm::end(); ?>

新用户?

            <a href="<?= Url::to(['/user/registration/register']) ?>" role="button"
               class="tr_all_hover r_corners button_type_4 bg_dark_color bg_cs_hover color_light d_inline_middle m_mxs_left_0">创建账号

                <?php
                if (Yii::$app->user->isGuest) {
                    ?>

欢迎,您可以 登陆 或者
                        <a href="<?= Url::to(['/user/registration/register']) ?>">创建账号

                <?php } ?>

Call us toll free: (0547) 800-820-8820

                <?php
                if (!Yii::$app->user->isGuest) {
                $countWishlist = count(Wishlist::findAll(['user_id' => Yii::$app->user->id]));
                ?>

<a href="<?= Url::to(['/member']) ?>" class="default_t_color">我的的账号

<a href="<?= Url::to(['/order/home/order/list'])?>" class="default_t_color">订单列表

<a href="<?= Url::to(['/member/wishlist/get-wishlist'])?>" class="default_t_color">愿望清单

<a href="<?= Url::to(['/cart/cart/index']) ?>" class="default_t_color">购物车

<a href="<?= Url::to(['/user/security/logout']) ?>" class="default_t_color" data-method='post'>登出

            <?php } ?>

            <a href="<?= Url::to(['/']) ?>" class="logo m_xs_bottom_15 d_xs_inline_b">
                <img src="<?= $link ?>/images/logo.png" alt="">

                    <a role="button" href="<?= Url::to(['/member/wishlist/get-wishlist'])?>"
                       class="button_type_1 color_dark d_block bg_light_color_1 r_corners tr_delay_hover box_s_none"><?= Yii::$app->user->isGuest ? 0 : $countWishlist ?>

                    0

                    <img class="d_inline_middle m_right_10 m_mxs_right_0"
                                             src="<?= $link ?>/images/flag_en.jpg" alt="">English

<img class="d_inline_middle"
                                                                                src="<?= $link ?>/images/flag_en.jpg"
                                                                                alt="">English

<img class="d_inline_middle"
                                                                                src="<?= $link ?>/images/flag_fr.jpg"
                                                                                alt="">French

<img class="d_inline_middle"
                                                                                src="<?= $link ?>/images/flag_g.jpg"
                                                                                alt="">German

<img class="d_inline_middle"
                                                                                src="<?= $link ?>/images/flag_i.jpg"
                                                                                alt="">Italian

<img class="d_inline_middle"
                                                                                src="<?= $link ?>/images/flag_s.jpg"
                                                                                alt="">Spanish

                    $ US Dollar

$ US Dollar

€
                                Euro

£
                                Pound

											<?php
                                                $shoppingCartModel = new \star\cart\models\ShoppingCart();

                                                echo $shoppingCartModel->getTotalQty();
                                                ?>

                        $<?= $shoppingCartModel->getTotal() ?>

最近添加的商品

                            <?php
                            $cartItems = $shoppingCartModel->cartItems;
                            foreach ($cartItems as $cartItem) {
                                /**@var star\catalog\models\Item $item * */
                                $sku = $cartItem->sku;
                                $item = $sku->item;
                            ?>

                                        <?= EasyThumbnailImage::thumbnailImg(
                                            '@image/'.$item->getMainImage(),
                                            30,
                                            30,
                                            EasyThumbnailImage::THUMBNAIL_OUTBOUND,
                                            ['class'=>"f_left m_right_10"]
                                        )?>

                                            <a href="<?= Url::to(['/catalog/home/item/view','id' => $item->item_id])?>" class="color_dark m_bottom_5 d_block"><?= $item->title?>

                                                <?=  $cartItem->qty ?> x ¥<?= $sku->price?>

                            <?php  } ?>

运费: ¥<?=  $shoppingCartModel->getShippingFee() ?>

总价: ¥<?=  $shoppingCartModel->getTotal() ?>

                            <a href="<?= Url::to(['/cart/cart/index'])?>" role="button"
                               class="button_type_4 d_inline_middle bg_light_color_2 r_corners color_dark t_align_c tr_all_hover m_mxs_bottom_5">查看购物车
                            <a href="<?= Url::to(['/order/home/order/checkout'])?>" role="button"
                               class="button_type_4 bg_scheme_color d_inline_middle r_corners tr_all_hover color_light">下单

        <button id="menu_button" class="r_corners centered_db d_none tr_all_hover d_xs_block m_bottom_10">

        </button>

                <li class="<?= Yii::$app->request->get('catalog') || Yii::$app->request->get('tab') ? '' : 'current'?> relative f_xs_none m_xs_bottom_5">
                    <a href="<?= Url::to(['/'])?>" class="tr_delay_hover color_light tt_uppercase">首页

                <?php
                $root = \star\system\models\Tree::find()->where(['name' => '商品分类'])->one();
                if ($root) {
                    $categories = $root->children(1)->indexBy('id')->limit(5)->all();
                    if($categories) {
                        foreach($categories as $category) {
                ?>
                <li class="<?= Yii::$app->request->get('catalog') == $category->id ? 'current' : ''?> relative f_xs_none m_xs_bottom_5">
                    <a href="<?= Url::to(['/catalog/home/item/list','catalog' => $category->id])?>" class="tr_delay_hover color_light tt_uppercase"><?= $category->name?>
                    <?php
                    $children = $category->children(1)->indexBy('id')->all();
                    if($children){
                    ?>

                            <?php  foreach($children as $child){?>

<a class="color_dark tr_delay_hover" href="<?= Url::to(['/catalog/home/item/list','catalog' => $child->id])?>"><?= $child->name?>

                            <?php } ?>

                    <?php } ?>

                <?php } } } ?>
                <li class="<?= Yii::$app->request->get('tab') ? 'current' : ''?> relative f_xs_none m_xs_bottom_5">
                    <a href="<?= Url::to(['/blog/home/default','tab' =>'blog'])?>" class="tr_delay_hover color_light tt_uppercase">Blog

        <button class="f_right search_button tr_all_hover f_xs_none d_xs_none">

        </button>

            <form role="search" class="d_inline_middle full_width">
                <input type="text" name="search" placeholder="Type text and hit enter" class="f_size_large">
            </form>
            <button class="close_search_form tr_all_hover d_xs_none color_dark">

            </button>

        <?=
        Breadcrumbs::widget([
            'itemTemplate' => '
{link}
',
            'options' => ['class' => 'horizontal_list clearfix bc_list f_size_medium'],
            'homeLink' => [
                'label' => Yii::t('app', 'Home'),
                'url' => Yii::$app->homeUrl,
            ],
            'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [],
        ]);
        ?>

<?= $content ?>;

About

Ut pharetra augue nec augue. Nam elit agna, endrerit sit amet, tincidunt ac,
                        viverra sed, nulla. Donec porta diam eu massa. Quisque diam lorem, interdum vitae, dapibus ac,
                        scelerisque.

                            Facebook

                            Twitter

                            Google Plus

                            Rss

                            Pinterest

                            Instagram

                            LinkedIn

                            Vimeo

                            Youtube

                            Flickr

                            Contact Us

The Service

My account

Order history

Wishlist

Vendor contact

Front page

Virtuemart categories

Information

About us

New collection

Best sellers

Manufacturers

Privacy policy

Terms & condition

Newsletter

Sign up to our newsletter and get exclusive deals you wont find
                        anywhere else straight to your inbox!

                    <form id="newsletter">
                        <input type="email" placeholder="Your email address"
                               class="m_bottom_20 r_corners f_size_medium full_width" name="newsletter-email">
                        <button type="submit" class="button_type_8 r_corners bg_scheme_color color_light tr_all_hover">
                            Subscribe
                        </button>
                    </form>

© 2014 Flatastic. All
                Rights Reserved.

<img src="<?= $link ?>/images/payment_img_1.png" alt="">

<img src="<?= $link ?>/images/payment_img_2.png" alt="">

<img src="<?= $link ?>/images/payment_img_3.png" alt="">

<img src="<?= $link ?>/images/payment_img_4.png" alt="">

<img src="<?= $link ?>/images/payment_img_5.png" alt="">

        <button class="sw_button t_align_c facebook"></button>

Join Us on Facebook

        <button class="sw_button t_align_c twitter"></button>

Latest Tweets

            Follow on Twitter

        <button class="sw_button t_align_c contact"></button>

Contact Us

Lorem ipsum dolor sit amet, consectetuer adipis mauris

            <form id="contactform" class="mini">
                <input class="f_size_medium m_bottom_10 r_corners full_width" type="text" name="cf_name"
                       placeholder="Your name">
                <input class="f_size_medium m_bottom_10 r_corners full_width" type="email" name="cf_email"
                       placeholder="Email">
                <textarea class="f_size_medium r_corners full_width m_bottom_20" placeholder="Message"
                          name="cf_message"></textarea>
                <button type="submit" class="button_type_4 r_corners mw_0 tr_all_hover color_dark bg_light_color_2">
                    Send
                </button>
            </form>

        <button class="sw_button t_align_c googlemap"></button>

Store Location

8901 Marmora Road,
 Glasgow, D04 89GR.

800-559-65-80

                        info@companyname.com

Monday - Friday: 08.00-20.00
Saturday: 09.00-15.00
 Sunday: closed

<button class="t_align_c r_corners tr_all_hover animate_ftl" id="go_to_top"></button>
<?php
$tmpJs = ["js/jquery-2.1.0.min.js", "js/jquery-ui.min.js", "js/jquery-migrate-1.2.1.min.js", "js/retina.js", "js/camera.min.js",   "js/elevatezoom.min.js", "js/jquery.fancybox-1.3.4.js",
    "js/waypoints.min.js", "js/jquery.isotope.min.js", "js/owl.carousel.min.js", "js/jquery.tweet.min.js", "js/jquery.custom-scrollbar.js", "js/scripts.js",'js/bootstrap.min.js',
];
foreach ($tmpJs as $v) {
    $this->registerJsFile($link . '/' . $v);
}
?>

<?php $this->endBody() ?>

<?php $this->endPage() ?>


text:
namespace blink {

struct WebPushSubscriptionOptions {
    WebPushSubscriptionOptions()
        : userVisibleOnly(false)
    {
    }

    // Indicates that the subscription will only be used for push messages
    // that result in UI visible to the user.
    bool userVisibleOnly;
};

} // namespace blink

#endif // WebPushSubscriptionOptions_h


text:
require 'aruba/cucumber'
require 'aruba/in_process'
require 'aruba/spawn_process'
require 'cucumber/cli/main'

Before('@spawn') do
  Aruba.process = Aruba::SpawnProcess
end

Before('not @spawn') do
  Aruba::InProcess.main_class = Cucumber::Cli::Main
  Aruba.process = Aruba::InProcess
end

Before do
  # Make sure bin/cucumber runs with SimpleCov enabled
  # set_env('SIMPLECOV', 'true')

  # Set a longer timeout for aruba, and a really long one if running on JRuby
  @aruba_timeout_seconds = Cucumber::JRUBY ? 60 : 15
end


text:
#pragma once

/**
 *  @file QueueSemaphore.h
 *  @date December 29, 2015
 *  @author Jeremiah
 *
 *  @brief A QueueSemaphore is used to synchronize command buffer execution
 *  between multiple queues. A queue semaphore itself does not have any functionality.
 *  It is only used by the command queues to synchronize operations.
 */

#include "../EngineDefines.h"

namespace Graphics
{
    class ENGINE_DLL QueueSemaphore
    {
    public:

        /**
         * Needs to at least have a virtual destructor to make this type polymorphic.
         */
        virtual ~QueueSemaphore()
        {}

    };
}


text:
@interface StylesViewController () <LMReportViewDatasource>

@property (nonatomic, strong) LMReportView *reportView;
@property (nonatomic, assign) LMRStyleType currentStyle;

@end

@implementation StylesViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    self.title = @"风格样式";

    LMRStyle *style = [LMRStyle blueStyle];

    self.reportView = [[LMReportView alloc] init];
    self.reportView.datasource = self;
    self.reportView.style = style;
    [self.view addSubview:self.reportView];

    self.currentStyle = LMRStyleTypeBlue;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)viewDidLayoutSubviews {
    [super viewDidLayoutSubviews];

    CGRect rect = self.view.bounds;
    rect = CGRectInset(rect, 16, 16);
    rect.origin.y += 60;
    rect.size.height -= 64;
    self.reportView.frame = rect;
}

- (IBAction)changeStyle:(id)sender {
    UIAlertAction *actionBlue = [UIAlertAction actionWithTitle:@"蓝色" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
        [self setStyle:LMRStyleTypeBlue];
    }];
    UIAlertAction *actionGreen = [UIAlertAction actionWithTitle:@"绿色" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
        [self setStyle:LMRStyleTypeGreen];
    }];

    UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"切换样式" message:nil preferredStyle:UIAlertControllerStyleActionSheet];
    [alert addAction:actionBlue];
    [alert addAction:actionGreen];
    [self.navigationController presentViewController:alert animated:YES completion:nil];
}

- (void)setStyle:(LMRStyleType)style {
    if (self.currentStyle == style) {
        return;
    }
    self.reportView.style = style == LMRStyleTypeBlue ? [LMRStyle blueStyle] : [LMRStyle greenStyle];
    self.currentStyle = style;
    [UIView animateWithDuration:0.5 animations:^{
        [self.reportView reloadData];
    }];
}

#pragma mark - <LMReportViewDatasource>

- (NSInteger)numberOfRowsInReportView:(LMReportView *)reportView {
    return 20;
}

- (NSInteger)numberOfColsInReportView:(LMReportView *)reportView {
    return 10;
}

- (LMRGrid *)reportView:(LMReportView *)reportView gridAtIndexPath:(NSIndexPath *)indexPath {
    LMRGrid *grid = [[LMRGrid alloc] init];
    grid.text = [NSString stringWithFormat:@"%ld-%ld", indexPath.row, indexPath.col];
    return grid;
}

@end


text:
package com.jiangjg.lib.EffectiveJava.Th13;

import java.util.ArrayList;
import java.util.List;

public class InfiniteRecursion {

	public String toString(){
		return "InfiniteRecursion " + super.toString() + "\n";
	}
	public static void main(String[] args) {
		List<InfiniteRecursion> v = new ArrayList<InfiniteRecursion>();
		for(int i=0; i<10; i++){
			v.add(new InfiniteRecursion());
		}
		System.out.println(v);
	}

}


text:
Serializer component
====================

This component provides a wrapper for serializing data. It support `JSON` and native PHP serializers. For details, please refer to its documentation.


text:
@interface UIView (OGDebuggingToolsPrivate)

+ (NSString *)logStringForSubviewsOfView:(UIView *)view depth:(NSInteger)depth;
+ (NSString *)logDescriptionOfView:(UIView *)view;
+ (NSString *)string:(NSString *)string repeated:(NSInteger)repeated;

@end
@implementation UIView (OGDebuggingTools)

#pragma mark - Public

+ (void)logViewHierarchy
{
	NSMutableString* string = [NSMutableString string];

	for (UIWindow* window in [UIApplication sharedApplication].windows) {

		[string appendString:[self logDescriptionOfView:window]];
		[string appendString:[self logStringForSubviewsOfView:window depth:1]];
	}

	NSLog(@"\n%@\n", string);
}

- (void)logSubviewHierarchy
{
	NSMutableString* string = [NSMutableString string];

	[string appendString:[self.class logDescriptionOfView:self]];
	[string appendString:[self.class logStringForSubviewsOfView:self depth:1]];

	NSLog(@"\n%@\n", string);
}

#pragma mark - Helpers

+ (NSString *)logStringForSubviewsOfView:(UIView *)view depth:(NSInteger)depth
{
	NSMutableString* string = [NSMutableString stringWithFormat:@"%@%@\n", [self string:@"	" repeated:depth], [self logDescriptionOfView:view]];

	for (UIView* subview in view.subviews)
		[string appendString:[self logStringForSubviewsOfView:subview depth:depth+1]];

	return string;
}

+ (NSString *)logDescriptionOfView:(UIView *)view
{
	return [NSString stringWithFormat:@"%@", view];
}

+ (NSString *)string:(NSString *)string repeated:(NSInteger)repeated
{
	if (repeated < 1)
		return @"";

	NSMutableString* repeatedString = [NSMutableString string];

	for (NSInteger i = 0; i < repeated; i++)
		[repeatedString appendString:string];

	return [NSString stringWithString:repeatedString];
}

@end


text:
#region BSD License

#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Xunit;
using System.IO;

namespace NetFx.System
{
	///	<nuget id="netfx-System.ISerializer.Tests.xUnit" />
	public abstract partial class SerializerSpec
	{
		internal abstract ISerializer CreateSerializer();

		[Fact]
		public void WhenSerializing_ThenCanRoundTrip()
		{
			var serializer = CreateSerializer();
			var stream = new MemoryStream();

			var graph = new User
			{
				Id = 5,
				Products= new List<Product>
				{
					new Product { Id = 1 },
					new Product { Id = 2 },
				}
			};

			serializer.Serialize(stream, graph);

			stream.Position = 0;

			var deserialized = serializer.Deserialize<User>(stream);

			Assert.Equal(graph.Id, deserialized.Id);
			Assert.Equal(graph.Products.Count(), deserialized.Products.Count());
			Assert.Equal(graph.Products.First().Id, deserialized.Products.First().Id);
		}

		[Fact]
		public void WhenSerializingNullGraph_ThenThrowsArgumentNullException()
		{
			var serializer = CreateSerializer();
			var stream = new MemoryStream();

			Assert.Throws<ArgumentNullException>(() => serializer.Serialize(stream, default(User)));
		}

		[Fact]
		public void WhenSerializingToNullStream_ThenThrowsArgumentNullException()
		{
			var serializer = CreateSerializer();

			Assert.Throws<ArgumentNullException>(() => serializer.Serialize(null, new User()));
		}

		[Fact]
		public void WhenDeserializingFromNullStream_ThenThrowsArgumentNullException()
		{
			var serializer = CreateSerializer();

			Assert.Throws<ArgumentNullException>(() => serializer.Deserialize<User>(null));
		}

		public partial class User
		{
			public int Id { get; set; }
			public List<Product> Products { get; set; }
		}

		public partial class Product
		{
			public int Id { get; set; }
		}
	}
}


text:
<?php

declare(strict_types=1);

namespace Genius\Resources;

use stdClass;

/**
 * @see https://docs.genius.com/#search-h2
 */
final class SearchResource extends AbstractResource
{
    public function get(string $query): stdClass
    {
        return $this->requester->get(
            'search',
            ['q' => $query]
        );
    }
}


text:
<!doctype html>
<html lang="en">
<head>
    <meta charset="utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <title>Poseidon</title>
    <meta name="description" content=""/>
    <meta name="viewport" content="width=device-width"/>
    <base href="/"/>
</head>
<h1>Here is the index of Poseidon . </h1>

</html>


text:
exports.tokenize = tokenizeAtxHeading
exports.resolve = resolveAtxHeading

var assert = require('assert')
var codes = require('../character/codes')
var markdownLineEnding = require('../character/markdown-line-ending')
var markdownLineEndingOrSpace = require('../character/markdown-line-ending-or-space')
var markdownSpace = require('../character/markdown-space')
var constants = require('../constant/constants')
var types = require('../constant/types')
var chunkedSplice = require('../util/chunked-splice')
var createSpace = require('./factory-space')

function resolveAtxHeading(events, context) {
  var contentEnd = events.length - 2
  var contentStart = 3
  var content
  var text

  // Prefix whitespace, part of the opening.
  if (events[contentStart][1].type === types.whitespace) {
    contentStart += 2
  }

  // Suffix whitespace, part of the closing.
  if (
    contentEnd - 2 > contentStart &&
    events[contentEnd][1].type === types.whitespace
  ) {
    contentEnd -= 2
  }

  if (
    events[contentEnd][1].type === types.atxHeadingSequence &&
    (contentStart === contentEnd - 1 ||
      (contentEnd - 4 > contentStart &&
        events[contentEnd - 2][1].type === types.whitespace))
  ) {
    contentEnd -= contentStart + 1 === contentEnd ? 2 : 4
  }

  if (contentEnd > contentStart) {
    content = {
      type: types.atxHeadingText,
      start: events[contentStart][1].start,
      end: events[contentEnd][1].end
    }
    text = {
      type: types.chunkText,
      start: events[contentStart][1].start,
      end: events[contentEnd][1].end,
      contentType: constants.contentTypeText
    }

    chunkedSplice(events, contentStart, contentEnd - contentStart + 1, [
      ['enter', content, context],
      ['enter', text, context],
      ['exit', text, context],
      ['exit', content, context]
    ])
  }

  return events
}

function tokenizeAtxHeading(effects, ok, nok) {
  var self = this
  var size = 0

  return start

  function start(code) {
    assert(code === codes.numberSign, 'expected `#`')
    effects.enter(types.atxHeading)
    effects.enter(types.atxHeadingSequence)
    return fenceOpenInside(code)
  }

  function fenceOpenInside(code) {
    if (
      code === codes.numberSign &&
      size++ < constants.atxHeadingOpeningFenceSizeMax
    ) {
      effects.consume(code)
      return fenceOpenInside
    }

    if (code === codes.eof || markdownLineEndingOrSpace(code)) {
      effects.exit(types.atxHeadingSequence)
      return self.interrupt ? ok(code) : headingBreak(code)
    }

    return nok(code)
  }

  function headingBreak(code) {
    if (code === codes.numberSign) {
      effects.enter(types.atxHeadingSequence)
      return sequence(code)
    }

    if (code === codes.eof || markdownLineEnding(code)) {
      effects.exit(types.atxHeading)
      return ok(code)
    }

    if (markdownSpace(code)) {
      return createSpace(effects, headingBreak, types.whitespace)(code)
    }

    effects.enter(types.atxHeadingText)
    return data(code)
  }

  function sequence(code) {
    if (code === codes.numberSign) {
      effects.consume(code)
      return sequence
    }

    effects.exit(types.atxHeadingSequence)
    return headingBreak(code)
  }

  function data(code) {
    if (
      code === codes.eof ||
      code === codes.numberSign ||
      markdownLineEndingOrSpace(code)
    ) {
      effects.exit(types.atxHeadingText)
      return headingBreak(code)
    }

    effects.consume(code)
    return data
  }
}