text:
<!DOCTYPE html>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta content="IE=edge" http-equiv="X-UA-Compatible">

<link rel="shortcut icon" type="image/x-icon" href="../../../../favicon.ico" />
<title>JobInfo.Builder - Android SDK | Android Developers</title>

<link rel="stylesheet"
href="http://fonts.googleapis.com/css?family=Roboto+Condensed">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:light,regular,medium,thin,italic,mediumitalic,bold"
  title="roboto">

<link href="../../../../assets/css/default.css?v=7" rel="stylesheet" type="text/css">

<link href="../../../../assets/css/fullscreen.css" rel="stylesheet" class="fullscreen"
type="text/css">

           Developers

JobInfo.Builder - Android SDK

      <form class="dac-header-search-form" onsubmit="return submit_search()">
        <input id="search_autocomplete" type="text" value="" autocomplete="off" name="q"
          onfocus="search_focus_changed(this, true)" onblur="search_focus_changed(this, false)"
          onkeydown="return search_changed(event, true, '../../../../')"
          onkeyup="return search_changed(event, false, '../../../../')"
          class="dac-header-search-input" placeholder="Search" />
          close
      </form>

          Developer
          Console

Results

Loading...

           Developers

        Home

            Android

            Wear

            TV

            Auto

        Design

        Develop

            Training

            API Guides

            Reference

            Tools

            Google Services

            Preview

        Distribute

            Google Play

            Essentials

            Get Users

            Engage & Retain

            Earn

            Analyze

            Stories

          API level:

            <select id="apiLevelSelector">

            </select>

Android APIs

  android

  android.accessibilityservice

  android.accounts

  android.animation

  android.annotation

  android.app

  android.app.admin

  android.app.assist

  android.app.backup

  android.app.job

  android.app.usage

  android.appwidget

  android.bluetooth

  android.bluetooth.le

  android.content

  android.content.pm

  android.content.res

  android.database

  android.database.sqlite

  android.databinding

  android.drm

  android.gesture

  android.graphics

  android.graphics.drawable

  android.graphics.drawable.shapes

  android.graphics.pdf

  android.hardware

  android.hardware.camera2

  android.hardware.camera2.params

  android.hardware.display

  android.hardware.fingerprint

  android.hardware.input

  android.hardware.usb

  android.inputmethodservice

  android.location

  android.media

  android.media.audiofx

  android.media.browse

  android.media.effect

  android.media.midi

  android.media.projection

  android.media.session

  android.media.tv

  android.mtp

  android.net

  android.net.http

  android.net.nsd

  android.net.rtp

  android.net.sip

  android.net.wifi

  android.net.wifi.p2p

  android.net.wifi.p2p.nsd

  android.nfc

  android.nfc.cardemulation

  android.nfc.tech

  android.opengl

  android.os

  android.os.storage

  android.preference

  android.print

  android.print.pdf

  android.printservice

  android.provider

  android.renderscript

  android.sax

  android.security

  android.security.keystore

  android.service.carrier

  android.service.chooser

  android.service.dreams

  android.service.media

  android.service.notification

  android.service.restrictions

  android.service.textservice

  android.service.voice

  android.service.wallpaper

  android.speech

  android.speech.tts

  android.support.annotation

  android.support.app.recommendation

  android.support.customtabs

  android.support.design

  android.support.design.widget

  android.support.multidex

  android.support.percent

  android.support.v13.app

  android.support.v14.preference

  android.support.v17.leanback

  android.support.v17.leanback.app

  android.support.v17.leanback.database

  android.support.v17.leanback.graphics

  android.support.v17.leanback.system

  android.support.v17.leanback.widget

  android.support.v17.preference

  android.support.v4.accessibilityservice

  android.support.v4.animation

  android.support.v4.app

  android.support.v4.content

  android.support.v4.content.pm

  android.support.v4.content.res

  android.support.v4.database

  android.support.v4.graphics

  android.support.v4.graphics.drawable

  android.support.v4.hardware.display

  android.support.v4.hardware.fingerprint

  android.support.v4.media

  android.support.v4.media.session

  android.support.v4.net

  android.support.v4.os

  android.support.v4.print

  android.support.v4.provider

  android.support.v4.text

  android.support.v4.util

  android.support.v4.view

  android.support.v4.view.accessibility

  android.support.v4.view.animation

  android.support.v4.widget

  android.support.v7.app

  android.support.v7.appcompat

  android.support.v7.cardview

  android.support.v7.graphics

  android.support.v7.graphics.drawable

  android.support.v7.gridlayout

  android.support.v7.media

  android.support.v7.mediarouter

  android.support.v7.preference

  android.support.v7.recyclerview

  android.support.v7.util

  android.support.v7.view

  android.support.v7.widget

  android.support.v7.widget.helper

  android.support.v7.widget.util

  android.support.v8.renderscript

  android.system

  android.telecom

  android.telephony

  android.telephony.cdma

  android.telephony.gsm

  android.test

  android.test.mock

  android.test.suitebuilder

  android.test.suitebuilder.annotation

  android.text

  android.text.format

  android.text.method

  android.text.style

  android.text.util

  android.transition

  android.util

  android.view

  android.view.accessibility

  android.view.animation

  android.view.inputmethod

  android.view.textservice

  android.webkit

  android.widget

  com.android.internal.backup

  com.android.internal.logging

  com.android.internal.os

  com.android.internal.statusbar

  com.android.internal.widget

  com.android.test.runner

  dalvik.annotation

  dalvik.bytecode

  dalvik.system

  java.awt.font

  java.beans

  java.io

  java.lang

  java.lang.annotation

  java.lang.ref

  java.lang.reflect

  java.math

  java.net

  java.nio

  java.nio.channels

  java.nio.channels.spi

  java.nio.charset

  java.nio.charset.spi

  java.security

  java.security.acl

  java.security.cert

  java.security.interfaces

  java.security.spec

  java.sql

  java.text

  java.util

  java.util.concurrent

  java.util.concurrent.atomic

  java.util.concurrent.locks

  java.util.jar

  java.util.logging

  java.util.prefs

  java.util.regex

  java.util.zip

  javax.crypto

  javax.crypto.interfaces

  javax.crypto.spec

  javax.microedition.khronos.egl

  javax.microedition.khronos.opengles

  javax.net

  javax.net.ssl

  javax.security.auth

  javax.security.auth.callback

  javax.security.auth.login

  javax.security.auth.x500

  javax.security.cert

  javax.sql

  javax.xml

  javax.xml.datatype

  javax.xml.namespace

  javax.xml.parsers

  javax.xml.transform

  javax.xml.transform.dom

  javax.xml.transform.sax

  javax.xml.transform.stream

  javax.xml.validation

  javax.xml.xpath

  junit.framework

  junit.runner

  org.apache.http.conn

  org.apache.http.conn.scheme

  org.apache.http.conn.ssl

  org.apache.http.params

  org.json

  org.w3c.dom

  org.w3c.dom.ls

  org.xml.sax

  org.xml.sax.ext

  org.xml.sax.helpers

  org.xmlpull.v1

  org.xmlpull.v1.sax2

Classes

JobInfo

JobInfo.Builder

JobParameters

JobScheduler

JobService

      fullscreen
      Use Tree NavigationUse Panel Navigation

Summary:

  Ctors

  | Methods

  | Inherited Methods

| [Expand All]

  Added in API level 21

    public
    static
    final

    class

JobInfo.Builder

    extends Object

        java.lang.Object

               ↳

        android.app.job.JobInfo.Builder

Class Overview

Builder class for constructing JobInfo objects.

Summary

Public Constructors

        <nobr>

            </nobr>

        <nobr>
        JobInfo.Builder(int jobId, ComponentName jobService)</nobr>

Public Methods

        <nobr>

            JobInfo</nobr>

        <nobr>
        build()</nobr>

        <nobr>

            JobInfo.Builder</nobr>

        <nobr>
        setBackoffCriteria(long initialBackoffMillis, int backoffPolicy)</nobr>

          Set up the back-off/retry policy.

        <nobr>

            JobInfo.Builder</nobr>

        <nobr>
        setExtras(PersistableBundle extras)</nobr>

          Set optional extras.

        <nobr>

            JobInfo.Builder</nobr>

        <nobr>
        setMinimumLatency(long minLatencyMillis)</nobr>

          Specify that this job should be delayed by the provided amount of time.

        <nobr>

            JobInfo.Builder</nobr>

        <nobr>
        setOverrideDeadline(long maxExecutionDelayMillis)</nobr>

          Set deadline which is the maximum scheduling latency.

        <nobr>

            JobInfo.Builder</nobr>

        <nobr>
        setPeriodic(long intervalMillis)</nobr>

          Specify that this job should recur with the provided interval, not more than once per
 period.

        <nobr>

            JobInfo.Builder</nobr>

        <nobr>
        setPersisted(boolean isPersisted)</nobr>

          Set whether or not to persist this job across device reboots.

        <nobr>

            JobInfo.Builder</nobr>

        <nobr>
        setRequiredNetworkType(int networkType)</nobr>

          Set some description of the kind of network type your job needs to have.

        <nobr>

            JobInfo.Builder</nobr>

        <nobr>
        setRequiresCharging(boolean requiresCharging)</nobr>

          Specify that to run this job, the device needs to be plugged in.

        <nobr>

            JobInfo.Builder</nobr>

        <nobr>
        setRequiresDeviceIdle(boolean requiresDeviceIdle)</nobr>

          Specify that to run, the job needs the device to be in idle mode.

  [Expand]

Inherited Methods

From class

  java.lang.Object

        <nobr>

            Object</nobr>

        <nobr>
        clone()</nobr>

          Creates and returns a copy of this Object.

        <nobr>

            boolean</nobr>

        <nobr>
        equals(Object o)</nobr>

          Compares this instance with the specified object and indicates if they
 are equal.

        <nobr>

            void</nobr>

        <nobr>
        finalize()</nobr>

          Invoked when the garbage collector has detected that this instance is no longer reachable.

        <nobr>

            final

            Class<?></nobr>

        <nobr>
        getClass()</nobr>

          Returns the unique instance of Class that represents this
 object's class.

        <nobr>

            int</nobr>

        <nobr>
        hashCode()</nobr>

          Returns an integer hash code for this object.

        <nobr>

            final

            void</nobr>

        <nobr>
        notify()</nobr>

          Causes a thread which is waiting on this object's monitor (by means of
 calling one of the wait() methods) to be woken up.

        <nobr>

            final

            void</nobr>

        <nobr>
        notifyAll()</nobr>

          Causes all threads which are waiting on this object's monitor (by means
 of calling one of the wait() methods) to be woken up.

        <nobr>

            String</nobr>

        <nobr>
        toString()</nobr>

          Returns a string containing a concise, human-readable description of this
 object.

        <nobr>

            final

            void</nobr>

        <nobr>
        wait()</nobr>

          Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object.

        <nobr>

            final

            void</nobr>

        <nobr>
        wait(long millis, int nanos)</nobr>

          Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
 specified timeout expires.

        <nobr>

            final

            void</nobr>

        <nobr>
        wait(long millis)</nobr>

          Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
 specified timeout expires.

Public Constructors

        public

      JobInfo.Builder
      (int jobId, ComponentName jobService)

  Added in API level 21

Parameters

          jobId
          Application-provided id for this job. Subsequent calls to cancel, or
               jobs created with the same jobId, will update the pre-existing job with
               the same id.

          jobService
          The endpoint that you implement that will receive the callback from the
            JobScheduler.

Public Methods

        public

        JobInfo

      build
      ()

  Added in API level 21

Returns

The job object to hand to the JobScheduler. This object is immutable.

        public

        JobInfo.Builder

      setBackoffCriteria
      (long initialBackoffMillis, int backoffPolicy)

  Added in API level 21

Set up the back-off/retry policy.
 This defaults to some respectable values: {30 seconds, Exponential}. We cap back-off at
 5hrs.
 Note that trying to set a backoff criteria for a job with
 setRequiresDeviceIdle(boolean) will throw an exception when you call build().
 This is because back-off typically does not make sense for these types of jobs. See
 jobFinished(android.app.job.JobParameters, boolean)
 for more description of the return value for the case of a job executing while in idle
 mode.

Parameters

          initialBackoffMillis
          Millisecond time interval to wait initially when job has
                             failed.

          backoffPolicy
          is one of BACKOFF_POLICY_LINEAR or
 BACKOFF_POLICY_EXPONENTIAL

        public

        JobInfo.Builder

      setExtras
      (PersistableBundle extras)

  Added in API level 21

Set optional extras. This is persisted, so we only allow primitive types.

Parameters

          extras
          Bundle containing extras you want the scheduler to hold on to for you.

        public

        JobInfo.Builder

      setMinimumLatency
      (long minLatencyMillis)

  Added in API level 21

Specify that this job should be delayed by the provided amount of time.
 Because it doesn't make sense setting this property on a periodic job, doing so will
 throw an IllegalArgumentException when
 build() is called.

Parameters

          minLatencyMillis
          Milliseconds before which this job will not be considered for
                         execution.

        public

        JobInfo.Builder

      setOverrideDeadline
      (long maxExecutionDelayMillis)

  Added in API level 21

Set deadline which is the maximum scheduling latency. The job will be run by this
 deadline even if other requirements are not met. Because it doesn't make sense setting
 this property on a periodic job, doing so will throw an
 IllegalArgumentException when
 build() is called.

        public

        JobInfo.Builder

      setPeriodic
      (long intervalMillis)

  Added in API level 21

Specify that this job should recur with the provided interval, not more than once per
 period. You have no control over when within this interval this job will be executed,
 only the guarantee that it will be executed at most once within this interval.
 Setting this function on the builder with setMinimumLatency(long) or
 setOverrideDeadline(long) will result in an error.

Parameters

          intervalMillis
          Millisecond interval for which this job will repeat.

        public

        JobInfo.Builder

      setPersisted
      (boolean isPersisted)

  Added in API level 21

Set whether or not to persist this job across device reboots. This will only have an
 effect if your application holds the permission
 RECEIVE_BOOT_COMPLETED. Otherwise an exception will
 be thrown.

Parameters

          isPersisted
          True to indicate that the job will be written to disk and loaded at
                    boot.

        public

        JobInfo.Builder

      setRequiredNetworkType
      (int networkType)

  Added in API level 21

Set some description of the kind of network type your job needs to have.
 Not calling this function means the network is not necessary, as the default is
 NETWORK_TYPE_NONE.
 Bear in mind that calling this function defines network as a strict requirement for your
 job. If the network requested is not available your job will never run. See
 setOverrideDeadline(long) to change this behaviour.

        public

        JobInfo.Builder

      setRequiresCharging
      (boolean requiresCharging)

  Added in API level 21

Specify that to run this job, the device needs to be plugged in. This defaults to
 false.

Parameters

          requiresCharging
          Whether or not the device is plugged in.

        public

        JobInfo.Builder

      setRequiresDeviceIdle
      (boolean requiresDeviceIdle)

  Added in API level 21

Specify that to run, the job needs the device to be in idle mode. This defaults to
 false.

Idle mode is a loose definition provided by the system, which means that the device
 is not in use, and has not been in use for some time. As such, it is a good time to
 perform resource heavy jobs. Bear in mind that battery usage will still be attributed
 to your application, and surfaced to the user in battery stats.

Parameters

          requiresDeviceIdle
          Whether or not the device need be within an idle maintenance
                           window.

        Get news & tips

          Blog
          Support

  Except as noted, this content is licensed under Apache 2.0.
  For details and restrictions, see the
  Content License.

    Android 6.0 r1 —

      About Android
      Auto
      TV
      Wear
      Legal

        <select name="language" onchange="changeLangPref(this.value, true)">
          <option value="en" selected="selected">English</option>
          <option value="es">Español</option>
          <option value="ja">日本語</option>
          <option value="ko">한국어</option>
          <option value="pt-br">Português Brasileiro</option>
          <option value="ru">Русский</option>
          <option value="zh-cn">中文(简体)</option>
          <option value="zh-tw">中文(繁體)</option>
        </select>

        <button class="dac-modal-header-close" data-modal-toggle></button>

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

          <form action="https://docs.google.com/forms/d/1QgnkzbEJIDu9lMEea0mxqWrXUJu0oBCLD7ar23V0Yys/formResponse" class="dac-form" method="post" target="dac-newsletter-iframe">

              <fieldset class="dac-form-fieldset">

                      Full name
                      <input type="text" class="dac-form-input" name="entry.1357890476" id="newsletter-full-name" required>
                      *

                      Email address
                      <input type="email" class="dac-form-input" name="entry.472100832" id="newsletter-email" required>
                      *

                      Company / developer name
                      <input type="text" class="dac-form-input" name="entry.1664780309" id="newsletter-company">

                      One of your Play Store app URLs
                      <input type="url" class="dac-form-input" name="entry.47013838" id="newsletter-play-store" required>
                      *

              </fieldset>
              <fieldset class="dac-form-fieldset">

                    <legend class="dac-form-legend">Which best describes your business:*
                    </legend>

                      <input type="radio" value="Apps" class="dac-form-radio" name="entry.1796324055" id="newsletter-business-type-app" required>

                      Apps

                      <input type="radio" value="Games" class="dac-form-radio" name="entry.1796324055" id="newsletter-business-type-games" required>

                      Games

                      <input type="radio" value="Apps and Games" class="dac-form-radio" name="entry.1796324055" id="newsletter-business-type-appsgames" required>

                      Apps & Games

                          <input type="checkbox" class="dac-form-checkbox" name="entry.732309842" id="newsletter-add" required value="Add me to the mailing list for the monthly newsletter and occasional emails about development and Google Play opportunities.">

                          Add me to the mailing list for the monthly newsletter and occasional emails about development and Google Play opportunities.*

                          <input type="checkbox" class="dac-form-checkbox" name="entry.2045036090" id="newsletter-terms" required value="I acknowledge that the information provided in this form will be subject to Google's privacy policy (https://www.google.com/policies/privacy/).">

                          I acknowledge that the information provided in this form will be subject to Google's privacy policy.*

              </fieldset>

              <button type="submit" value="Submit" class="dac-fab dac-primary dac-large dac-modal-action"></button>

          </form>

              You have successfully signed up for the latest Android developer news and tips.


text:
package it.gualtierotesta.testsolutions.mockito1withpowermock.abstractclasses;

/**
 * Case 1 : method without dependencies
 *
 * @author Gualtiero Testa www.gualtierotesta.it
 */
public abstract class AbstractCase1 {

    public abstract int myAbstractMethod();

    public String methodToBeTested() {
        return "CASE-1";
    }

    public AbstractCase1() {
        System.out.println("Constructor");
    }

}

redpajama_set_name: RedPajamaGithub


text:
package org.dotwebstack.framework.core.backend.query;

public interface ScalarFieldMapper<T> extends FieldMapper<T, Object> {

  String getAlias();
}


text:
import os

import mock

from nova.compute import arch
from nova import exception
from nova import test

class ArchTest(test.NoDBTestCase):

    @mock.patch.object(os, "uname")
    def test_host(self, mock_uname):
        os.uname.return_value = (
            'Linux',
            'localhost.localdomain',
            '3.14.8-200.fc20.x86_64',
            '#1 SMP Mon Jun 16 21:57:53 UTC 2014',
            'i686'
        )

        self.assertEqual(arch.I686, arch.from_host())

    def test_valid_string(self):
        self.assertTrue(arch.is_valid("x86_64"))

    def test_valid_constant(self):
        self.assertTrue(arch.is_valid(arch.X86_64))

    def test_valid_bogus(self):
        self.assertFalse(arch.is_valid("x86_64wibble"))

    def test_canonicalize_i386(self):
        self.assertEqual(arch.I686, arch.canonicalize("i386"))

    def test_canonicalize_amd64(self):
        self.assertEqual(arch.X86_64, arch.canonicalize("amd64"))

    def test_canonicalize_case(self):
        self.assertEqual(arch.X86_64, arch.canonicalize("X86_64"))

    def test_canonicalize_compat_xen1(self):
        self.assertEqual(arch.I686, arch.canonicalize("x86_32"))

    def test_canonicalize_compat_xen2(self):
        self.assertEqual(arch.I686, arch.canonicalize("x86_32p"))

    def test_canonicalize_bogus(self):
        self.assertRaises(exception.InvalidArchitectureName,
                          arch.canonicalize,
                          "x86_64wibble")


text:
module Caloris

  module Authorization

    # True if the page is allowed to be shown
    def can_show?(page)
      page.published?
    end

    # True if the page is allowed to edit the page
    def can_update?(page)
      true
    end

    # True if query params are permitted to override the default git reference
    def can_set_ref?
      true
    end

  end

end


text:
using Data;
using Metier;
using Modeles;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using ViewModels;

namespace GUIApp
{
    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App : Application
    {
        private DAO dao;

        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);
            dao = new DAO(ConfigurationManager.ConnectionStrings["bdd"].ConnectionString);

            MainVM vm = new MainVM(dao);
            MainWindow w = new MainWindow();
            w.Closed += MainWindow_Closed;

            w.Show();
            w.DataContext = vm;
            vm.LoadAsync();
        }

        void MainWindow_Closed(object sender, EventArgs e)
        {
            dao.Dispose();
        }

        private void Grid_Loaded(object sender, RoutedEventArgs e)
        {
            ((ContentPresenter)((Grid)sender).TemplatedParent).HorizontalAlignment = HorizontalAlignment.Stretch;
        }
    }
}


text:
/*
//     Intel(R) Integrated Performance Primitives. Cryptography Primitives.
//     EC over GF(p^m) definitinons
//
//     Context:
//        ippsGFpECBindGxyTblStd256r1()
//
*/

#include "owndefs.h"
#include "owncp.h"
#include "pcpgfpecstuff.h"
#include "pcpeccp.h"

static IppStatus cpGFpECBindGxyTbl(const BNU_CHUNK_T* pPrime,
                                   const cpPrecompAP* preComp,
                                   IppsGFpECState* pEC)
{
   IPP_BAD_PTR1_RET(pEC);
   IPP_BADARG_RET(!VALID_ECP_ID(pEC), ippStsContextMatchErr);

   {
      IppsGFpState* pGF = ECP_GFP(pEC);
      gsModEngine* pGFE = GFP_PMA(pGF);
      Ipp32u elemLen = (Ipp32u)GFP_FELEN(pGFE);

      /* test if GF is prime GF */
      IPP_BADARG_RET(!GFP_IS_BASIC(pGFE), ippStsBadArgErr);
      /* test underlying prime value*/
      IPP_BADARG_RET(cpCmp_BNU(pPrime, (cpSize)elemLen, GFP_MODULUS(pGFE), (cpSize)elemLen), ippStsBadArgErr);

      {
         BNU_CHUNK_T* pbp_ec = ECP_G(pEC);
         int cmpFlag;
         BNU_CHUNK_T* pbp_tbl = cpEcGFpGetPool(1, pEC);

         selectAP select_affine_point = preComp->select_affine_point;
         const BNU_CHUNK_T* pTbl = preComp->pTbl;
         select_affine_point(pbp_tbl, pTbl, 1);

         /* check if EC's and G-table's Base Point is the same */
         cmpFlag = cpCmp_BNU(pbp_ec, (cpSize)elemLen*2, pbp_tbl, (cpSize)elemLen*2);

         cpEcGFpReleasePool(1, pEC);

         return cmpFlag? ippStsBadArgErr : ippStsNoErr;
      }
   }
}

/*F*
// Name: ippsGFpECBindGxyTblStd256r1
//
// Purpose: Enables the use of base point-based pre-computed tables of EC256r1
//
// Returns:                   Reason:
//    ippStsNullPtrErr              NULL == pEC
//
//    ippStsContextMatchErr         invalid pEC->idCtx
//
//    ippStsBadArgErr               pEC is not EC256r1
//
//    ippStsNoErr                   no error
//
// Parameters:
//    pEC        Pointer to the context of the elliptic curve
//
*F*/

IPPFUN(IppStatus, ippsGFpECBindGxyTblStd256r1,(IppsGFpECState* pEC))
{
   IppStatus sts = cpGFpECBindGxyTbl(secp256r1_p, gfpec_precom_nistP256r1_fun(), pEC);

   /* setup pre-computed g-table and point access function */
   if(ippStsNoErr==sts)
      ECP_PREMULBP(pEC) = gfpec_precom_nistP256r1_fun();

   return sts;
}


text:
#pragma checksum "D:\Side Projects\Novella\Novella\Novella.WindowsPhone\About.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "9284863D5EFE1FE3037FCE3AE7A8B5F9"
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace Novella
{
    partial class About : global::Windows.UI.Xaml.Controls.Page, global::Windows.UI.Xaml.Markup.IComponentConnector
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Windows.UI.Xaml.Build.Tasks"," 4.0.0.0")]
        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]

        public void Connect(int connectionId, object target)
        {
            switch(connectionId)
            {
            case 1:
                #line 15 "..\..\About.xaml"
                ((global::Windows.UI.Xaml.Controls.Primitives.ButtonBase)(target)).Click += this.Contact_Click;
                 #line default
                 #line hidden
                break;
            case 2:
                #line 16 "..\..\About.xaml"
                ((global::Windows.UI.Xaml.Controls.Primitives.ButtonBase)(target)).Click += this.Rate_Click;
                 #line default
                 #line hidden
                break;
            }
            this._contentLoaded = true;
        }
    }
}


text:
using namespace std;

inline
void use_io_optimizations()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
}

int main()
{
    use_io_optimizations();

    unsigned int rocks;
    cin >> rocks;

    vector<unsigned int> occurances(26);

    for (unsigned int i {0}; i < rocks; ++i)
    {
        string composition;
        cin >> composition;

        for (auto element : set<char>(composition.cbegin(), composition.cend()))
        {
            ++occurances[element - 'a'];
        }
    }

    cout << count(occurances.cbegin(), occurances.cend(), rocks) << '\n';

    return 0;
}


text:
import { trim } from './../utils';
import { FsRequestHeaders } from './../types';

const ignoreDuplicates = [
  'expires',
  'from',
  'host',
  'if-modified-since',
  'if-unmodified-since',
  'age',
  'authorization',
  'content-length',
  'content-type',
  'etag',
  'last-modified',
  'location',
  'max-forwards',
  'proxy-authorization',
  'referer',
  'retry-after',
  'user-agent',
];

/**
 * Parse response raw header (xhr)
 *
 * @param {string} headers - raw headers string
 */
export const parse = headers => {
  let parsed = {};
  let key;
  let val;
  let i;

  if (!headers) {
    return parsed;
  }

  headers.split('\n').forEach(line => {
    i = line.indexOf(':');
    key = trim(line.substr(0, i)).toLowerCase();
    val = trim(line.substr(i + 1));

    if (!key) {
      return;
    }

    if (parsed[key] && ignoreDuplicates.indexOf(key) >= 0) {
      return;
    }

    if (key === 'set-cookie') {
      parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);
    } else {
      parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
    }
  });

  return parsed;
};

/**
 * Normalize input headers
 *
 * @param headers
 */
export const normalizeHeaders = (headers: FsRequestHeaders): FsRequestHeaders => {
  if (!headers) {
    return {};
  }

  const toReturn = {};

  for (let i in headers) {
    toReturn[normalizeName(i)] =  headers[i];
  }

  return toReturn;
};

// expect(set({}, 'set-cookies', 'value')).toEqual({ 'Set-Cookies': 'value' });
/**
 * Set request headers
 *
 * @param headers - object containing headers
 * @param name - header name
 * @param value - header value
 * @param setIFExists - determine if we should change header value if exists
 */
export const set = (headers: FsRequestHeaders, name: string, value: string, setIFExists = false) => {
  const normalizedName = normalizeName(name);

  if (!headers) {
    headers = {};
  }

  // cleanup headers from undefined vals
  headers = JSON.parse(JSON.stringify(headers));
  if (headers[name] === undefined && headers[normalizedName] === undefined) {
    headers[normalizedName] = value;
  } else if (setIFExists) {
    delete headers[name];
    headers[normalizedName] = value;
  }

  return headers;
};

/**
 * Normalize header names according to rfc spec
 *
 * @param {string} name - header name
 */
export const normalizeName = (name: string) => {
  // the exceptions
  let result = {
    'content-md5': 'Content-MD5',
    dnt: 'DNT',
    etag: 'ETag',
    'last-event-id': 'Last-Event-ID',
    tcn: 'TCN',
    te: 'TE',
    'www-authenticate': 'WWW-Authenticate',
    'x-dnsprefetch-control': 'X-DNSPrefetch-Control',
  }[name.toLowerCase()];

  if (result) {
    return result;
  }

  // the default
  return name
    .split('-')
    .map(function(text) {
      return text.charAt(0).toUpperCase() + text.substr(1).toLowerCase();
    })
    .join('-');
};


text:
@implementation DKFaker

- (NSString*) name{
    return MBFakerName.name;
}

- (NSNumber*) number{
    return @(arc4random_uniform(100));
}

- (NSString*)address{
    return MBFakerAddress.streetAddress;
}

- (NSString*)company{
    return str(@"%@ %@",MBFakerCompany.name, MBFakerCompany.suffix);
}

- (NSString*)email{
    return MBFakerInternet.email;
}

- (NSString*)ipv4{
    return MBFakerInternet.ipV4Address;
}

- (NSString*)ipv6{
    return MBFakerInternet.ipV6Address;
}

- (NSString*)url{
    return MBFakerInternet.url;
}

- (NSString*)username{
    return MBFakerInternet.userName;
}

- (NSString*)word{
    return MBFakerLorem.word;
}

- (NSString*)sentence{
    return MBFakerLorem.sentence;
}

- (NSString*)paragraph{
    return MBFakerLorem.paragraph;
}

@end


text:
<?php
/**
 * @package sfLucenePlugin
 * @subpackage Module
 * @author Carl Vondrick <carl@carlsoft.net>
 * @version SVN: $Id$
 */
?>

<?php if ($show): ?>
  <?php echo select_tag('category', options_for_select($categories, $selected), array('multiple' => $multiple, 'id' => 'sfl_category')) ?>
<?php endif ?>


text: A rails app to help keep track of expenses


text:
using System.Collections.ObjectModel;
using System;
using System.Data.Entity;
using Core.DomainModel.Frontpage;

namespace Infrastructure.Data
{
    public class SampleSeedInitializer : CreateDatabaseIfNotExists<SampleContext>
    {
        protected override void Seed(SampleContext context)
        {
            var samplePostRevision = new PostRevision {
                Header = "Android first",
                ModifiedOn = DateTime.UtcNow,
                Text = "
This is the beautiful Android icon  Representing the far superior mobile OS in the world
"
            };

            var samplePost = new Post {
                Active = true,
                CreatedOn = DateTime.UtcNow,
                Priority = Priority.High,
                Revisions = new Collection<PostRevision>
                {
                    samplePostRevision
                }
            };

            var anotherSamplePostRevision = new PostRevision {
                Header = "iPhone last",
                ModifiedOn = DateTime.UtcNow,
                Text = "
This is the awful iPhone icon  Representing the worst mobile OS in the world
"
            };

            var anotherSamplePost = new Post {
                Active = true,
                CreatedOn = DateTime.UtcNow,
                Priority = Priority.Locked,
                Revisions = new Collection<PostRevision>
                {
                    anotherSamplePostRevision
                }
            };

            context.Posts.Add(samplePost);
            context.Posts.Add(anotherSamplePost);
            context.SaveChanges();
        }
    }
}


text:
package com.mapswithme.maps;

import android.annotation.SuppressLint;
import android.content.ContentResolver;
import android.content.Intent;
import android.graphics.Color;
import android.location.Location;
import android.net.Uri;
import android.os.Bundle;
import android.support.annotation.StringRes;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;

import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.List;

import com.mapswithme.maps.MwmActivity.MapTask;
import com.mapswithme.maps.MwmActivity.OpenUrlTask;
import com.mapswithme.maps.api.Const;
import com.mapswithme.maps.api.ParsedMwmRequest;
import com.mapswithme.maps.base.BaseMwmFragmentActivity;
import com.mapswithme.maps.bookmarks.data.BookmarkManager;
import com.mapswithme.maps.downloader.CountryItem;
import com.mapswithme.maps.downloader.MapManager;
import com.mapswithme.maps.location.LocationHelper;
import com.mapswithme.maps.search.SearchEngine;
import com.mapswithme.util.ConnectionState;
import com.mapswithme.util.Constants;
import com.mapswithme.util.StringUtils;
import com.mapswithme.util.UiUtils;
import com.mapswithme.util.Utils;
import com.mapswithme.util.Yota;
import com.mapswithme.util.concurrency.ThreadPool;
import com.mapswithme.util.statistics.Statistics;

@SuppressLint("StringFormatMatches")
public class DownloadResourcesActivity extends BaseMwmFragmentActivity
{
  private static final String TAG = DownloadResourcesActivity.class.getName();

  static final String EXTRA_COUNTRY = "country";
  static final String EXTRA_AUTODOWNLOAD = "autodownload";

  // Error codes, should match the same codes in JNI
  private static final int ERR_DOWNLOAD_SUCCESS = 0;
  private static final int ERR_NOT_ENOUGH_MEMORY = -1;
  private static final int ERR_NOT_ENOUGH_FREE_SPACE = -2;
  private static final int ERR_STORAGE_DISCONNECTED = -3;
  private static final int ERR_DOWNLOAD_ERROR = -4;
  private static final int ERR_NO_MORE_FILES = -5;
  private static final int ERR_FILE_IN_PROGRESS = -6;

  private TextView mTvMessage;
  private TextView mTvLocation;
  private ProgressBar mProgress;
  private Button mBtnDownload;
  private CheckBox mChbDownloadCountry;

  private String mCurrentCountry;
  private MapTask mMapTaskToForward;

  private boolean mIsReadingAttachment;
  private boolean mAreResourcesDownloaded;

  private static final int DOWNLOAD = 0;
  private static final int PAUSE = 1;
  private static final int RESUME = 2;
  private static final int TRY_AGAIN = 3;
  private static final int PROCEED_TO_MAP = 4;
  private static final int BTN_COUNT = 5;

  private View.OnClickListener mBtnListeners[];
  private String mBtnNames[];

  private int mCountryDownloadListenerSlot;

  @SuppressWarnings("unused")
  private interface Listener
  {
    void onProgress(int percent);
    void onFinish(int errorCode);
  }

  private final IntentProcessor[] mIntentProcessors = {
      new GeoIntentProcessor(),
      new HttpGe0IntentProcessor(),
      new Ge0IntentProcessor(),
      new MapsWithMeIntentProcessor(),
      new GoogleMapsIntentProcessor(),
      new OpenCountryTaskProcessor(),
      new KmzKmlProcessor()
  };

  private final LocationHelper.LocationListener mLocationListener = new LocationHelper.SimpleLocationListener()
  {
    @Override
    public void onLocationUpdated(Location l)
    {
      if (mCurrentCountry != null)
        return;

      final double lat = l.getLatitude();
      final double lon = l.getLongitude();
      mCurrentCountry = MapManager.nativeFindCountry(lat, lon);
      if (TextUtils.isEmpty(mCurrentCountry))
      {
        mCurrentCountry = null;
        return;
      }

      int status = MapManager.nativeGetStatus(mCurrentCountry);
      String name = MapManager.nativeGetName(mCurrentCountry);

      UiUtils.show(mTvLocation);

      if (status == CountryItem.STATUS_DONE)
        mTvLocation.setText(String.format(getString(R.string.download_location_map_up_to_date), name));
      else
      {
        final CheckBox checkBox = (CheckBox) findViewById(R.id.chb__download_country);
        UiUtils.show(checkBox);

        String locationText;
        String checkBoxText;

        if (status == CountryItem.STATUS_UPDATABLE)
        {
          locationText = getString(R.string.download_location_update_map_proposal);
          checkBoxText = String.format(getString(R.string.update_country_ask), name);
        }
        else
        {
          locationText = getString(R.string.download_location_map_proposal);
          checkBoxText = String.format(getString(R.string.download_country_ask), name);
        }

        mTvLocation.setText(locationText);
        checkBox.setText(checkBoxText);
      }

      LocationHelper.INSTANCE.removeLocationListener(this);
    }
  };

  private final Listener mResourcesDownloadListener = new Listener()
  {
    @Override
    public void onProgress(final int percent)
    {
      if (!isFinishing())
        mProgress.setProgress(percent);
    }

    @Override
    public void onFinish(final int errorCode)
    {
      if (isFinishing())
        return;

      if (errorCode == ERR_DOWNLOAD_SUCCESS)
      {
        final int res = nativeStartNextFileDownload(mResourcesDownloadListener);
        if (res == ERR_NO_MORE_FILES)
          finishFilesDownload(res);
      }
      else
        finishFilesDownload(errorCode);
    }
  };

  private final MapManager.StorageCallback mCountryDownloadListener = new MapManager.StorageCallback()
  {
    @Override
    public void onStatusChanged(List<MapManager.StorageCallbackData> data)
    {
      for (MapManager.StorageCallbackData item : data)
      {
        if (!item.isLeafNode)
          continue;

        switch (item.newStatus)
        {
        case CountryItem.STATUS_DONE:
          mAreResourcesDownloaded = true;
          showMap();
          return;

        case CountryItem.STATUS_FAILED:
          MapManager.showError(DownloadResourcesActivity.this, item, null);
          return;
        }
      }
    }

    @Override
    public void onProgress(String countryId, long localSize, long remoteSize)
    {
      mProgress.setProgress((int)localSize);
    }
  };

  @Override
  protected void onCreate(Bundle savedInstanceState)
  {
    super.onCreate(savedInstanceState);

    Utils.keepScreenOn(true, getWindow());
    suggestRemoveLiteOrSamsung();
    dispatchIntent();
    setContentView(R.layout.activity_download_resources);
    initViewsAndListeners();

    if (prepareFilesDownload())
    {
      setAction(DOWNLOAD);

      if (ConnectionState.isWifiConnected())
        onDownloadClicked();
    }
  }

  @Override
  protected void onDestroy()
  {
    super.onDestroy();
    if (mCountryDownloadListenerSlot != 0)
    {
      MapManager.nativeUnsubscribe(mCountryDownloadListenerSlot);
      mCountryDownloadListenerSlot = 0;
    }
  }

  @Override
  protected void onResume()
  {
    super.onResume();
    LocationHelper.INSTANCE.addLocationListener(mLocationListener, true);
  }

  @Override
  protected void onPause()
  {
    super.onPause();
    LocationHelper.INSTANCE.removeLocationListener(mLocationListener);
  }

  private void suggestRemoveLiteOrSamsung()
  {
    if (!Yota.isFirstYota() &&
        (Utils.isPackageInstalled(Constants.Package.MWM_LITE_PACKAGE) || Utils.isPackageInstalled(Constants.Package.MWM_SAMSUNG_PACKAGE)))
      Toast.makeText(this, R.string.suggest_uninstall_lite, Toast.LENGTH_LONG).show();
  }

  private void setDownloadMessage(int bytesToDownload)
  {
    mTvMessage.setText(getString(R.string.download_resources, StringUtils.getFileSizeString(bytesToDownload)));
  }

  private boolean prepareFilesDownload()
  {
    final int bytes = nativeGetBytesToDownload();

    if (bytes == 0)
    {
      mAreResourcesDownloaded = true;
      showMap();
      return false;
    }

    if (bytes > 0)
    {
      setDownloadMessage(bytes);

      mProgress.setMax(bytes);
      mProgress.setProgress(0);
    }
    else
      finishFilesDownload(bytes);

    return true;
  }

  private void initViewsAndListeners()
  {
    mTvMessage = (TextView) findViewById(R.id.tv__download_message);
    mProgress = (ProgressBar) findViewById(R.id.pb__download_resources);
    mBtnDownload = (Button) findViewById(R.id.btn__download_resources);
    mChbDownloadCountry = (CheckBox) findViewById(R.id.chb__download_country);
    mTvLocation = (TextView) findViewById(R.id.tv__location);

    mBtnListeners = new View.OnClickListener[BTN_COUNT];
    mBtnNames = new String[BTN_COUNT];

    mBtnListeners[DOWNLOAD] = new View.OnClickListener()
    {
      @Override
      public void onClick(View v)
      {
        onDownloadClicked();
      }
    };
    mBtnNames[DOWNLOAD] = getString(R.string.download);

    mBtnListeners[PAUSE] = new View.OnClickListener()
    {
      @Override
      public void onClick(View v)
      {
        onPauseClicked();
      }
    };
    mBtnNames[PAUSE] = getString(R.string.pause);

    mBtnListeners[RESUME] = new View.OnClickListener()
    {
      @Override
      public void onClick(View v)
      {
        onResumeClicked();
      }
    };
    mBtnNames[RESUME] = getString(R.string.continue_download);

    mBtnListeners[TRY_AGAIN] = new View.OnClickListener()
    {
      @Override
      public void onClick(View v)
      {
        onTryAgainClicked();
      }
    };
    mBtnNames[TRY_AGAIN] = getString(R.string.try_again);

    mBtnListeners[PROCEED_TO_MAP] = new View.OnClickListener()
    {
      @Override
      public void onClick(View v)
      {
        onProceedToMapClicked();
      }
    };
    mBtnNames[PROCEED_TO_MAP] = getString(R.string.download_resources_continue);
  }

  private void setAction(int action)
  {
    mBtnDownload.setOnClickListener(mBtnListeners[action]);
    mBtnDownload.setText(mBtnNames[action]);
  }

  private void doDownload()
  {
    if (nativeStartNextFileDownload(mResourcesDownloadListener) == ERR_NO_MORE_FILES)
      finishFilesDownload(ERR_NO_MORE_FILES);
  }

  private void onDownloadClicked()
  {
    setAction(PAUSE);
    doDownload();
  }

  private void onPauseClicked()
  {
    setAction(RESUME);
    nativeCancelCurrentFile();
  }

  private void onResumeClicked()
  {
    setAction(PAUSE);
    doDownload();
  }

  private void onTryAgainClicked()
  {
    if (prepareFilesDownload())
    {
      setAction(PAUSE);
      doDownload();
    }
  }

  private void onProceedToMapClicked()
  {
    mAreResourcesDownloaded = true;
    showMap();
  }

  private static @StringRes int getErrorMessage(int res)
  {
    switch (res)
    {
    case ERR_NOT_ENOUGH_FREE_SPACE:
      return R.string.not_enough_free_space_on_sdcard;

    case ERR_STORAGE_DISCONNECTED:
      return R.string.disconnect_usb_cable;

    case ERR_DOWNLOAD_ERROR:
      return (ConnectionState.isConnected() ? R.string.download_has_failed
                                            : R.string.common_check_internet_connection_dialog);
    default:
      return R.string.not_enough_memory;
    }
  }

  private void showMap()
  {
    if (mIsReadingAttachment || !mAreResourcesDownloaded)
      return;

    final Intent intent = new Intent(this, MwmActivity.class);

    // Disable animation because MwmActivity should appear exactly over this one
    intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION | Intent.FLAG_ACTIVITY_CLEAR_TOP);

    // Add saved task to forward to map activity.
    if (mMapTaskToForward != null)
    {
      intent.putExtra(MwmActivity.EXTRA_TASK, mMapTaskToForward);
      mMapTaskToForward = null;
    }

    startActivity(intent);

    finish();
  }

  private void finishFilesDownload(int result)
  {
    if (result == ERR_NO_MORE_FILES)
    {
      // World and WorldCoasts has been downloaded, we should register maps again to correctly add them to the model and generate indexes etc.
      // TODO fix the hack when separate download of World-s will be removed or refactored
      Framework.nativeDeregisterMaps();
      Framework.nativeRegisterMaps();
      if (mCurrentCountry != null && mChbDownloadCountry.isChecked())
      {
        CountryItem item = CountryItem.fill(mCurrentCountry);

        UiUtils.hide(mChbDownloadCountry, mTvLocation);
        mTvMessage.setText(getString(R.string.downloading_country_can_proceed, item.name));
        mProgress.setMax((int)item.totalSize);
        mProgress.setProgress(0);

        mCountryDownloadListenerSlot = MapManager.nativeSubscribe(mCountryDownloadListener);
        MapManager.nativeDownload(mCurrentCountry);
        setAction(PROCEED_TO_MAP);
      }
      else
      {
        mAreResourcesDownloaded = true;
        showMap();
      }
    }
    else
    {
      mTvMessage.setText(getErrorMessage(result));
      mTvMessage.setTextColor(Color.RED);
      setAction(TRY_AGAIN);
    }
  }

  private boolean dispatchIntent()
  {
    final Intent intent = getIntent();
    if (intent == null)
      return false;

    for (final IntentProcessor ip : mIntentProcessors)
      if (ip.isSupported(intent))
      {
        ip.process(intent);
        return true;
      }

    return false;
  }

  private class GeoIntentProcessor implements IntentProcessor
  {
    @Override
    public boolean isSupported(Intent intent)
    {
      return (intent.getData() != null && "geo".equals(intent.getScheme()));
    }

    @Override
    public boolean process(Intent intent)
    {
      final String url = intent.getData().toString();
      Log.i(TAG, "Query = " + url);
      mMapTaskToForward = new OpenUrlTask(url);
      org.alohalytics.Statistics.logEvent("GeoIntentProcessor::process", url);
      return true;
    }
  }

  private class Ge0IntentProcessor implements IntentProcessor
  {
    @Override
    public boolean isSupported(Intent intent)
    {
      return (intent.getData() != null && "ge0".equals(intent.getScheme()));
    }

    @Override
    public boolean process(Intent intent)
    {
      final String url = intent.getData().toString();
      Log.i(TAG, "URL = " + url);
      mMapTaskToForward = new OpenUrlTask(url);
      org.alohalytics.Statistics.logEvent("Ge0IntentProcessor::process", url);
      return true;
    }
  }

  private class HttpGe0IntentProcessor implements IntentProcessor
  {
    @Override
    public boolean isSupported(Intent intent)
    {
      if ("http".equalsIgnoreCase(intent.getScheme()))
      {
        final Uri data = intent.getData();
        if (data != null)
          return "ge0.me".equals(data.getHost());
      }

      return false;
    }

    @Override
    public boolean process(Intent intent)
    {
      final Uri data = intent.getData();
      Log.i(TAG, "URL = " + data.toString());

      final String ge0Url = "ge0:/" + data.getPath();
      mMapTaskToForward = new OpenUrlTask(ge0Url);
      org.alohalytics.Statistics.logEvent("HttpGe0IntentProcessor::process", ge0Url);
      return true;
    }
  }

  /**
   * Use this to invoke API task.
   */
  private class MapsWithMeIntentProcessor implements IntentProcessor
  {
    @Override
    public boolean isSupported(Intent intent)
    {
      return Const.ACTION_MWM_REQUEST.equals(intent.getAction());
    }

    @Override
    public boolean process(final Intent intent)
    {
      final String apiUrl = intent.getStringExtra(Const.EXTRA_URL);
      org.alohalytics.Statistics.logEvent("MapsWithMeIntentProcessor::process", apiUrl == null ? "null" : apiUrl);
      if (apiUrl != null)
      {
        SearchEngine.nativeCancelInteractiveSearch();

        final ParsedMwmRequest request = ParsedMwmRequest.extractFromIntent(intent);
        ParsedMwmRequest.setCurrentRequest(request);
        Statistics.INSTANCE.trackApiCall(request);

        if (!ParsedMwmRequest.isPickPointMode())
          mMapTaskToForward = new OpenUrlTask(apiUrl);
        return true;
      }

      return false;
    }
  }

  private class GoogleMapsIntentProcessor implements IntentProcessor
  {
    @Override
    public boolean isSupported(Intent intent)
    {
      final Uri data = intent.getData();
      return (data != null && "maps.google.com".equals(data.getHost()));
    }

    @Override
    public boolean process(Intent intent)
    {
      final String url = intent.getData().toString();
      Log.i(TAG, "URL = " + url);
      mMapTaskToForward = new OpenUrlTask(url);
      org.alohalytics.Statistics.logEvent("GoogleMapsIntentProcessor::process", url);
      return true;
    }
  }

  private class OpenCountryTaskProcessor implements IntentProcessor
  {
    @Override
    public boolean isSupported(Intent intent)
    {
      return intent.hasExtra(EXTRA_COUNTRY);
    }

    @Override
    public boolean process(Intent intent)
    {
      String countryId = intent.getStringExtra(EXTRA_COUNTRY);
      final boolean autoDownload = intent.getBooleanExtra(EXTRA_AUTODOWNLOAD, false);
      if (autoDownload)
        Statistics.INSTANCE.trackEvent(Statistics.EventName.DOWNLOAD_COUNTRY_NOTIFICATION_CLICKED);

      mMapTaskToForward = new MwmActivity.ShowCountryTask(countryId, autoDownload);
      org.alohalytics.Statistics.logEvent("OpenCountryTaskProcessor::process",
                                          new String[] { "autoDownload", String.valueOf(autoDownload) },
                                          LocationHelper.INSTANCE.getSavedLocation());
      return true;
    }
  }

  private class KmzKmlProcessor implements IntentProcessor
  {
    private Uri mData;

    @Override
    public boolean isSupported(Intent intent)
    {
      mData = intent.getData();
      return mData != null;
    }

    @Override
    public boolean process(Intent intent)
    {
      mIsReadingAttachment = true;
      ThreadPool.getStorage().execute(new Runnable()
      {
        @Override
        public void run()
        {
          final boolean result = readKmzFromIntent();
          runOnUiThread(new Runnable()
          {
            @Override
            public void run()
            {
              Utils.toastShortcut(DownloadResourcesActivity.this, result ? R.string.load_kmz_successful : R.string.load_kmz_failed);
              mIsReadingAttachment = false;
              showMap();
            }
          });
        }
      });
      return true;
    }

    private boolean readKmzFromIntent()
    {
      String path = null;
      File tmpFile = null;
      final String scheme = mData.getScheme();
      if (scheme != null && !scheme.equalsIgnoreCase(ContentResolver.SCHEME_FILE))
      {
        // scheme is "content" or "http" - need to download or read file first
        InputStream input = null;
        OutputStream output = null;

        try
        {
          final ContentResolver resolver = getContentResolver();
          final String ext = getExtensionFromMime(resolver.getType(mData));
          if (ext != null)
          {
            final String filePath = MwmApplication.get().getTempPath() + "Attachment" + ext;

            tmpFile = new File(filePath);
            output = new FileOutputStream(tmpFile);
            input = resolver.openInputStream(mData);

            final byte buffer[] = new byte[Constants.MB / 2];
            int read;
            while ((read = input.read(buffer)) != -1)
              output.write(buffer, 0, read);
            output.flush();

            path = filePath;
          }
        } catch (final Exception ex)
        {
          Log.w(TAG, "Attachment not found or io error: " + ex);
        } finally
        {
          Utils.closeStream(input);
          Utils.closeStream(output);
        }
      }
      else
        path = mData.getPath();

      boolean result = false;
      if (path != null)
      {
        Log.d(TAG, "Loading bookmarks file from: " + path);
        result = BookmarkManager.nativeLoadKmzFile(path);
      }
      else
        Log.w(TAG, "Can't get bookmarks file from URI: " + mData);

      if (tmpFile != null)
        //noinspection ResultOfMethodCallIgnored
        tmpFile.delete();

      return result;
    }

    private String getExtensionFromMime(String mime)
    {
      final int i = mime.lastIndexOf('.');
      if (i == -1)
        return null;

      mime = mime.substring(i + 1);
      if (mime.equalsIgnoreCase("kmz"))
        return ".kmz";
      else if (mime.equalsIgnoreCase("kml+xml"))
        return ".kml";
      else
        return null;
    }
  }

  private static native int nativeGetBytesToDownload();
  private static native int nativeStartNextFileDownload(Listener listener);
  private static native void nativeCancelCurrentFile();
}


text:
package com.topview.controller.course;

import com.topview.common.CommonResult;
import com.topview.po.course.CourseTeacher;
import com.topview.service.course.CourseService;
import com.topview.service.course.CourseTeacherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/courseTeacher")
public class CourseTeacherController {

    private CourseTeacherService courseTeacherService;

    private CourseService courseService;

    @Autowired
    public void setCourseTeacherService(CourseTeacherService courseTeacherService) {
        this.courseTeacherService = courseTeacherService;
    }

    @Autowired
    public void setCourseService(CourseService courseService) {
        this.courseService = courseService;
    }

    @ResponseBody
    @RequestMapping("/addTeacher")
    public CommonResult addTeacher(CourseTeacher courseTeacher, String courseName) {
        if (courseTeacher == null || courseName == null) {
            return new CommonResult("操作无效", false);
        }

        if (!courseService.isCourseExist(courseName)) {
            return new CommonResult("课程不存在", false);
        }

        courseTeacher = changeCourseNameIntoCourseId(courseTeacher, courseName);
        int effect = courseTeacherService.insert(courseTeacher);
        if (effect > 0) {
            return new CommonResult("添加教师成功", true);
        } else {
            return new CommonResult("添加教师失败", false);
        }
    }

    @ResponseBody
    @RequestMapping("/deleteTeacher")
    public CommonResult deleteTeacher(Long teacherId) {
        if (teacherId == null) {
            return new CommonResult("操作无效", false);
        }
        int effect = courseTeacherService.deleteById(teacherId);
        if (effect > 0) {
            return new CommonResult("删除教师成功", true);
        } else {
            return new CommonResult("删除教师失败", false);
        }
    }

    @ResponseBody
    @RequestMapping("/updateTeacher")
    public CommonResult updateTeacher(CourseTeacher courseTeacher) {
        if (courseTeacher == null) {
            return new CommonResult("操作无效", false);
        }
        int effect = courseTeacherService.update(courseTeacher);
        if (effect > 0) {
            return new CommonResult("更新教师成功", true);
        } else {
            return new CommonResult("更新教师失败", false);
        }
    }

    @ResponseBody
    @RequestMapping("/showTeacher")
    public CommonResult showTeacher(Long teacherId) {
        if (teacherId == null) {
            return new CommonResult("操作无效", false);
        }
        CourseTeacher courseTeacher = courseTeacherService.selectOneById(teacherId);
        if (courseTeacher == null) {
            return new CommonResult("教师不存在", false);
        } else {
            return new CommonResult<>(true, "教师存在", courseTeacher);
        }
    }

    @ResponseBody
    @RequestMapping("/showTeachers")
    public CommonResult showTeachers(Long courseId) {
        if (courseId == null) {
            return new CommonResult("操作无效", false);
        }
        List<CourseTeacher> teachers = courseTeacherService.select(new CourseTeacher(courseId));
        return new CommonResult<>(true, "获取成功", teachers);
    }

    @ResponseBody
    @RequestMapping("/showTeachersByCourseName")
    public CommonResult showTeacherByCourseName(String courseName) {
        if (courseName == null) {
            return new CommonResult("操作无效", false);
        }
        if (!courseService.isCourseExist(courseName)) {
            return new CommonResult("课程不存在", false);
        }
        CourseTeacher courseTeacher = new CourseTeacher();
        courseTeacher = changeCourseNameIntoCourseId(courseTeacher, courseName);
        List<CourseTeacher> teachers = courseTeacherService.select(courseTeacher);
        return new CommonResult<>(true, "获取成功", teachers);
    }

    private CourseTeacher changeCourseNameIntoCourseId(CourseTeacher courseTeacher, String courseName) {
        Long courseId = courseService.selectIdByName(courseName);
        courseTeacher.setCourseId(courseId);
        return courseTeacher;
    }
}


text:
require 'test_helper'

class PagesControllerTest < ActionController::TestCase
  setup do
    @page = pages(:one)
  end

  test "should get index" do
    get :index
    assert_response :success
    assert_not_nil assigns(:pages)
    assert_not_nil assigns(:recent_pages)
  end

  test "should get new" do
    get :new
    assert_response :success
    assert_not_nil assigns(:recent_pages)
  end

  test "should create page" do
    assert_difference('Page.count') do
      post :create, page: @page.attributes
    end

    assert_redirected_to page_path(assigns(:page))
  end

  test "should show page" do
    get :show, id: @page
    assert_response :success

    assert_not_nil assigns(:recent_pages)
  end

  test "should get edit" do
    get :edit, id: @page
    assert_response :success

    assert_not_nil assigns(:recent_pages)
  end

  test "should update page" do
    put :update, id: @page, page: @page.attributes
    assert_redirected_to page_path(assigns(:page))
  end

  test "should destroy page" do
    assert_difference('Page.count', -1) do
      delete :destroy, id: @page
    end

    assert_redirected_to pages_path
  end
end


text:
Horizon._registerPlugin(function(horizon) {
	horizon.isGyroscopeSupported = function() {
		return 'DeviceOrientationEvent' in window;
	};
});

// Register gyroscope input
Horizon._registerInput('gyroscope', {
	constructor: function(horizon, options) {
		// Handle gyroscope things
		var interval, direction;
		function gyroscope(x, y, z) {
			var real_x = x,
				real_y = y;
			if('orientation' in window) {
				switch(window.orientation) {
					case 90:
						real_x = y;
						real_y = -x;
						break;
					case 180:
						real_x = -x;
						real_y = -y;
						break;
					case -90:
						real_x = -y;
						real_y = x;
						break;
				}
			}
			if(x != null && y != null && z != null) {
				horizon.render({
					trigger: 'gyroscope',
					caller: 'gyroscope',
					context: 'relative',
					x: real_x,
					y: real_y,
					duration: 500
				});
				horizon.render({
					trigger: 'gyroscope',
					caller: 'gyroscope',
					context: 'absolute',
					z: z,
					duration: 500
				});
			}
		}
		// Listen to gyroscope
		if(horizon.isGyroscopeSupported()) {
			window.addEventListener('deviceorientation', function (event) {
				gyroscope(event.gamma, event.beta, event.alpha);
			}, false);
		}
	},
	setter: function(horizon, coords) {}
});