text:
package de.otto.edison.registry.api;

import com.google.gson.Gson;
import de.otto.edison.registry.service.RegisteredService;
import de.otto.edison.registry.service.Registry;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.time.Duration;
import java.util.List;
import java.util.Optional;

import static de.otto.edison.registry.api.UrlHelper.baseUriOf;
import static java.util.stream.Collectors.toList;

/**
 * The RegistryController is responsible to handle the registry of microservices.
 *
 * @author Guido Steinacker
 * @since 05.09.15
 */
@RestController
public class RegistryController {

    @Autowired
    private Registry registry;

    /**
     * Get the representation of all known environments.
     *
     * @return representation document
     */
    @RequestMapping(
            value = "/environments",
            method = RequestMethod.GET,
            produces = {"application/json", "application/vnd.otto.edison.links+json"}
    )
    public EnvironmentsDocument getEnvironments(final HttpServletRequest request) {

        final List<RegisteredService> services = registry.findServices();
        final List<String> environments = services
                .stream()
                .map(RegisteredService::getEnvironment)
                .distinct()
                .collect(toList());
        final List<String> groups = services
                .stream()
                .flatMap(s->s.getGroups().stream())
                .distinct()
                .collect(toList());
        return environmentsDocOf(environments, groups, request);
    }

    /**
     * Get the representation of a single environment.
     *
     * @return representation document
     */
    @RequestMapping(
            value = "/environments/{env}",
            method = RequestMethod.GET,
            produces = {"application/json", "application/vnd.otto.edison.links+json"}
    )
    public EnvironmentDocument getEnvironment(final @PathVariable String env,
                                              final @RequestParam(required = false) List<String> groups,
                                              final HttpServletRequest request) {

        final List<RegisteredService> selected = registry.findServices()
                .stream()
                .filter(service -> service.getEnvironment().equals(env))
                .filter(service -> groups == null || intersects(groups, service.getGroups()))
                .collect(toList());
        return environmentDocOf(selected, env, request);
    }

    /**
     * Get the representation of a single service.
     *
     * @return representation document
     */
    @RequestMapping(
            value = "/environments/{env}/{service}",
            method = RequestMethod.GET,
            produces = {"application/json", "application/vnd.otto.edison.links+json"}
    )
    public ServiceDocument getService(final @PathVariable String env,
                                      final @PathVariable String service,
                                      final HttpServletRequest request,
                                      final HttpServletResponse response) throws IOException {

        final Optional<RegisteredService> selected = registry.findServices()
                .stream()
                .filter(s -> s.getEnvironment().equals(env))
                .filter(s -> s.getService().equals(service))
                .findAny();
        if (selected.isPresent()) {
            return serviceDocOf(selected.get(), request);
        } else {
            response.sendError(HttpServletResponse.SC_NOT_FOUND, "No such service");
            return null;
        }
    }

    /**
     * Get the representation of a single service.
     *
     * @return representation document
     */
    @RequestMapping(
            value = "/environments/{env}/{service}",
            method = RequestMethod.PUT,
            consumes = {"application/json", "application/vnd.otto.edison.links+json"},
            produces = {"application/json", "application/vnd.otto.edison.links+json"}
    )
    public ServiceDocument putService(final @PathVariable String env,
                           final @PathVariable String service,
                           final @RequestBody String jsonBody,
                           final HttpServletRequest request,
                           final HttpServletResponse response) throws IOException {
        final ServiceDocument document = new Gson().fromJson(jsonBody, ServiceDocument.class);
        final Optional<Link> serviceLink = document.getLinks()
                .stream()
                .filter(link -> link.rel.equals("http://github.com/otto-de/edison/link-relations/microservice"))
                .findAny();
        if (serviceLink.isPresent()) {
            final RegisteredService registeredService = new RegisteredService(
                    service,
                    serviceLink.get().href,
                    serviceLink.get().title,
                    Duration.ofMinutes(document.getExpire()),
                    env,
                    document.getGroups()
            );
            registry.putService(registeredService);
            return serviceDocOf(registeredService, request);
        } else {
            response.sendError(HttpServletResponse.SC_BAD_REQUEST);
            return null;
        }
    }

    /**
     * Get the representation of a single service.
     *
     * @return representation document
     */
    @RequestMapping(
            value = "/environments/{env}/{service}",
            method = RequestMethod.DELETE
    )
    public void deleteService(final @PathVariable String env,
                                         final @PathVariable String service,
                                         final HttpServletRequest request,
                                         final HttpServletResponse response) throws IOException {

        registry.deleteService(env, service);
        response.setStatus(HttpServletResponse.SC_NO_CONTENT);
    }

    private EnvironmentsDocument environmentsDocOf(final List<String> environments,
                                                   final List<String> groups,
                                                   final HttpServletRequest request) {
        return new EnvironmentsDocument(environments, groups, baseUriOf(request));
    }

    private EnvironmentDocument environmentDocOf(final List<RegisteredService> services,
                                                 final String env,
                                                 final HttpServletRequest request) {
        return new EnvironmentDocument(services, env, baseUriOf(request));
    }

    private ServiceDocument serviceDocOf(final RegisteredService registeredService,
                                         final HttpServletRequest request) {
        return new ServiceDocument(registeredService, baseUriOf(request));
    }

    private boolean intersects(final List<String> one, final List<String> other) {
        for (final String s : one) {
            if (other.contains(s)) return true;
        }
        return false;
    }

}


text:
package com.zfxf.douniu.view.chart.draw;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.RectF;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;

import com.zfxf.douniu.R;
import com.zfxf.douniu.view.chart.EntityImpl.CandleImpl;
import com.zfxf.douniu.view.chart.EntityImpl.KLineImpl;
import com.zfxf.douniu.view.chart.impl.IKChartView;
import com.zfxf.douniu.view.chart.utils.ViewUtil;

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

/**
 * 主图的实现类
 * Created by tifezh on 2016/6/14.
 */

public class MainDraw extends BaseDraw<CandleImpl> {

    private Paint mTextPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
    private Paint mSelectorPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
    /**
     * 构造方法
     *
     * @param context
     */
    public MainDraw(Context context) {
        super(context);
        mTextPaint.setColor(context.getResources().getColor(R.color.chart_text));
        mTextPaint.setTextSize(context.getResources().getDimension(R.dimen.chart_selector_text_size));
        mSelectorPaint.setColor(context.getResources().getColor(R.color.chart_selector));
        mSelectorPaint.setAlpha(200);
    }

    @Override
    public void drawTranslated(@Nullable CandleImpl lastPoint, @NonNull CandleImpl curPoint, float lastX, float curX, @NonNull Canvas canvas, @NonNull IKChartView view, int position) {
//        if(position == 1){
//            Log.d("----11--","curPoint="+curPoint.getClosePrice());
//            Log.d("----11--","lastX="+lastX);
//            Log.d("----11--","curX="+curX);
//            Log.d("----11--","lastPoint="+lastPoint.getClosePrice());
//        }
//        view.drawMainLine(canvas, ma5Paint, lastX, lastPoint.getOpenPrice(), curX, curPoint.getOpenPrice());
        drawCandle(view, canvas, curX, curPoint.getHighPrice(), curPoint.getLowPrice(), curPoint.getOpenPrice(), curPoint.getClosePrice());
        //画ma5
        if (lastPoint.getMA5Price() != 0) {
            view.drawMainLine(canvas, ma5Paint, lastX, lastPoint.getMA5Price(), curX, curPoint.getMA5Price());

        }
        //画ma10
        if (lastPoint.getMA10Price() != 0) {
            view.drawMainLine(canvas, ma10Paint, lastX, lastPoint.getMA10Price(), curX, curPoint.getMA10Price());
        }
        //画ma20
        if (lastPoint.getMA20Price() != 0) {
            view.drawMainLine(canvas, ma20Paint, lastX, lastPoint.getMA20Price(), curX, curPoint.getMA20Price());
        }
    }

    @Override
    public void drawText(@NonNull Canvas canvas, @NonNull IKChartView view, int position, float x, float y) {
        CandleImpl point = (KLineImpl) view.getItem(position);
        String text = "MA5:" + view.formatValue(point.getMA5Price()) + " ";
        canvas.drawText(text, x, y, ma5Paint);
        x += ma5Paint.measureText(text);
        text = "MA10:" + view.formatValue(point.getMA10Price()) + " ";
        canvas.drawText(text, x, y, ma10Paint);
        x += ma10Paint.measureText(text);
        text = "MA20:" + view.formatValue(point.getMA20Price()) + " ";
        canvas.drawText(text, x, y, ma20Paint);
        if (view.isLongPress()) {
            drawSelector(view, canvas);
        }
    }

    @Override
    public float getMaxValue(CandleImpl point) {
        return Math.max(point.getHighPrice(), point.getMA20Price());
    }

    @Override
    public float getMinValue(CandleImpl point) {
        return Math.min(point.getMA20Price(), point.getLowPrice());
    }
    @Override
    public float getMaxPrice(CandleImpl point) {
        return point.getHighPrice();
    }
    @Override
    public float getMinPrice(CandleImpl point) {
        return point.getLowPrice();
    }

    /**
     * 画Candle
     *
     * @param canvas
     * @param x      x轴坐标
     * @param high   最高价
     * @param low    最低价
     * @param open   开盘价
     * @param close  收盘价
     */
    private void drawCandle(IKChartView view, Canvas canvas, float x, float high, float low, float open, float close) {
        high = view.getMainY(high);
        low = view.getMainY(low);
        open = view.getMainY(open);
        close = view.getMainY(close);
        int r = mCandleWidth / 2;
        int lineR = mCandleLineWidth / 2;
        if (open > close) {
            //实心
            canvas.drawRect(x - r, close, x + r, open, redPaint);
            canvas.drawRect(x - lineR, high, x + lineR, low, redPaint);
        } else if (open < close) {
            canvas.drawRect(x - r, open, x + r, close, greenPaint);
            canvas.drawRect(x - lineR, high, x + lineR, low, greenPaint);
        } else {
            canvas.drawRect(x - r, open, x + r, close + 1, redPaint);
            canvas.drawRect(x - lineR, high, x + lineR, low, redPaint);
        }
    }

    /**
     * draw选择器
     *
     * @param view
     * @param canvas
     */
    private void drawSelector(IKChartView view, Canvas canvas) {
        Paint.FontMetrics metrics = mTextPaint.getFontMetrics();
        float textHeight = metrics.descent - metrics.ascent;

        int index = view.getSelectedIndex();
        float padding = ViewUtil.Dp2Px(getContext(), 5);
        float margin = ViewUtil.Dp2Px(getContext(), 5);
        float width = 0;
        float left;
        float top = margin;
        float height = padding * 8 + textHeight * 5;

        CandleImpl point = (CandleImpl) view.getItem(index);
        List<String> strings = new ArrayList<>();
        strings.add(view.formatDateTime(view.getAdapter().getDate(index)));
        strings.add("高:" + point.getHighPrice());
        strings.add("低:" + point.getLowPrice());
        strings.add("开:" + point.getOpenPrice());
        strings.add("收:" + point.getClosePrice());

        for (String s : strings) {
            width = Math.max(width, mTextPaint.measureText(s));
        }
        width += padding * 2;

        float x = view.translateXtoX(view.getX(index));
        if (x > view.getChartWidth() / 2) {
            left = margin;
        } else {
            left = view.getChartWidth() - width - margin;
        }

        RectF r = new RectF(left, top, left + width, top + height);
        canvas.drawRoundRect(r, padding, padding, mSelectorPaint);
        float y = top + padding * 2 + (textHeight - metrics.bottom - metrics.top) / 2;

        for (String s : strings) {
            canvas.drawText(s, left + padding, y, mTextPaint);
            y += textHeight + padding;
        }

    }
}

redpajama_set_name: RedPajamaGithub


text:
package org.springframework.jdbc.support.incrementer;

import javax.sql.DataSource;

/**
 * {@link DataFieldMaxValueIncrementer} that retrieves the next value of a given Oracle sequence.
 *
 * @author Dmitriy Kopylenko
 * @author Thomas Risberg
 * @author Juergen Hoeller
 */
public class OracleSequenceMaxValueIncrementer extends AbstractSequenceMaxValueIncrementer {

	/**
	 * Default constructor for bean property style usage.
	 * @see #setDataSource
	 * @see #setIncrementerName
	 */
	public OracleSequenceMaxValueIncrementer() {
	}

	/**
	 * Convenience constructor.
	 * @param dataSource the DataSource to use
	 * @param incrementerName the name of the sequence/table to use
	 */
	public OracleSequenceMaxValueIncrementer(DataSource dataSource, String incrementerName) {
		super(dataSource, incrementerName);
	}

	@Override
	protected String getSequenceQuery() {
		return "select " + getIncrementerName() + ".nextval from dual";
	}

}


text:
<TITLE>Review for Velocity of Gary, The (1998)</TITLE>
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/ramr.css">

Velocity of Gary, The (1998)

reviewed by
Harvey S. Karten

THE VELOCITY OF GARY (NOT HIS REAL NAME)

 Reviewed by Harvey Karten, Ph.D.
 Next Millennium Entertainment
 Director:  Dan Ireland
 Writer:  James Still
 Cast: Vincent D'Onofrio, Salma Hayek, Thomas Jane, Chad
Lindberg, Olivia d'Abo, Shawn Michael Howard, Khalil Kain,
Danny Arroyo, Ethan Hawke, Tzi Ma.

   There's more than one way to photograph the lower
depths of an urban nightmare.  Joel Schumacher chooses
the most lurid path by portraying the area of male hustlers,
porno merchants, and general sleazeballs of Los Angeles in
"8mm." There is no redemption for any of his characters
save, perhaps, the obsessed hero, Tom Welles, who
ultimately gets over the sordid grip of that sphere of squalor.
Snuff merchant Eddie Poole goes up in flames while Dino
Velvet and Machine get their comeuppance in the end.  In his
new film "The Velocity of Gary (Not His Real Name)," Dan
Ireland finds a poignant humanity residing in the shadier
areas of New York, quarters for groups of transsexuals,
porno movie houses, male hustlers and homeless people--the
sorts that most middle-class and suburban humanity would
look right through and never dream of getting involved with.
If director Ireland's view appears Panglossian to us, his
movie is filled with creative touches, merging past and
present in a roundelay of sequences to familiarize us with
some of these colorful personalities.  James Still, who bases
his screenplay on a true story, is nothing if not pro-family.
For Still, redemption comes when isolated individuals break
through their detachment from genuine human feelings and
extend their reach.  They find contentment and purpose and
hope for the future in the embrace of home and hearth.

   "The Velocity of Gary" centers on a triangular romance with
all the joys and jealousies that such an arrangement can
provide.  At one point, the female third of the group, Mary
Carmen (Salma Hayek), reveals some advice she once
received from her mother: "Be dumb enough to fall in love
and smart enough to know better."  "At least I got the first
part right," she murmurs, and the picture takes off from there.
Valentino (Vincent D'Onofrio), the love of her life, is a
bisexual currently starring in a pornographic movie in New
York's Times Square district (actually filmed in downtown
L.A.).  Valentino is involved as well with a handsome male
hustler, Gary (Thomas Jane), who has presumably been
thrown out of his house by a disapproving family and has
found an instant and powerful chemistry in Valentino's arms.
While the male bonding understandably leads to friction
between Gary and Mary Carmen, the two rivals for the porn
star's affection must patch up their differences when
Valentino becomes mortally ill with AIDS.  Pooling their funds,
they set up housekeeping and become for one another the
only real family each has known.

   While such a theme could easily copy the template for yet
other soap, Ireland does not flirt for a minute with the
conventional.  Opening his film with a striking portrayal of
Gary, who is washing up at a fire hydrant at about the time
that a deaf transsexual, Kid Joey (Chad Lindberg) is beaten
by punks, he explores both the humanity and the degradation
of this largely invisible sub-caste of New York.  Salma Hayek
looks younger than ever as the volatile waitress who cannot
hold even an undemanding job in a donut shop.  She spends
most of the film in perpetual motion, whether razzing a New
Jersey visitor who wants only a glazed doughnut and coffee
but gets more than he bargained for, or expressing her joie
de vivre in a series of ebullient dances in a local bar or on
the spur of the moment wherever she pleases.  Vincent
D'Onofrio, best known to moviegoers for his role in "Full
Metal Jacket" (for which he gained 70 pounds), was even
more impressive in the smaller "The Whole Wide World,"
about author Robert E. Howard---also directed by Dan
Ireland.  As with "The Whole Wide World," Ireland makes
good use of dream-vs.-reality sequences, highlighting the
talented D'Onofrio as yet another marginal character--one
who convinces us that bisexuality really does exist as
D'Onofrio exudes a magnetic relationship with both Hayek
and the more passive and well-cast Thomas Jane.

   Dan Ireland does not romanticize the lives he finds in New
York's lower depths, and in fact the off-the-wall transsexuals
played by Khalil Kain and Shawn Michael Howard are both
hackneyed and repellent.  We pretty much know what Ireland
and scripter James Still stand for when Valentino's dog
Roland (Bingo) strays from his happy home, becomes lost,
bewildered, and frightened as he paces the city streets
foraging for food, and recovers his animal joy when reunited
with his loving owner.  Though the film is not sentimental in
the Hollywood manipulation of the term, that scene alone can
evoke tears from a responsive audience.

Rated R.  Running Time: 100 minutes.  (C) 1999
Harvey Karten

The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).

The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.

Please direct comments/criticisms of the review to relevant newsgroups.

Broken URLs inthe reviews are the responsibility of the author.

The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.

Related links: index of all rec.arts.movies.reviews reviews


text:
#ifndef SkTextToPath_DEFINED
#define SkTextToPath_DEFINED

#include "SkDrawPath.h"
#include "SkMemberInfo.h"

class SkDrawPaint;
class SkDrawPath;
class SkText;

class SkTextToPath : public SkADrawable {
    DECLARE_MEMBER_INFO(TextToPath);
    SkTextToPath();
    virtual bool draw(SkAnimateMaker& ) SK_OVERRIDE;
    virtual void onEndElement(SkAnimateMaker& ) SK_OVERRIDE;
private:
    SkDrawPaint* paint;
    SkDrawPath* path;
    SkText* text;
};

#endif // SkTextToPath_DEFINED


text:
Rails.application.routes.draw do

  mount ThirdRail::Engine => "/third_rail"
end


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.7"/>
<title>App Engine PHP SDK: google\appengine\api\cloud_storage Namespace Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

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

App Engine PHP SDK
    v1 rev.445

The PHP runtime is available as an experimental Preview feature.

google

appengine

api

cloud_storage

Classes |
Functions

google\appengine\api\cloud_storage Namespace Reference

Classes

class  	CloudStorageException

class  	CloudStorageTools

class  	CloudStorageToolsTest

Functions

 	ini_get ($key)

Detailed Description

Copyright 2007 Google Inc.

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

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

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

Copyright 2007 Google Inc.

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

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

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

<address class="footer">
    Maintained by tzmartin
</address>


text:
"""
Wrapper over the functions as described in Chapter 32 of the
reference manual.

Routines for finding the minimum of a function of one variable.
Example: searching for pi using brent:

m = 2.0
a = 0.0
b = 6.0

def fn1(x, params):
    return cos(x) + 1.0

self.sys  = gsl_function(fn1, None)
minimizer = brent(self.sys)

minimizer.set(m, a, b)
t1 = fn1(a, None)
t2 = fn1(b, None)

print "Testing minimizer ", minimizer.name()
for iter in range(100):
    status = minimizer.iterate()
    a      = minimizer.x_lower()
    b      = minimizer.x_upper()
    m      = minimizer.minimum()
    status = minimize.test_interval(a, b, 0.001, 0)
    if status == 0:
        break

print "Minimum found at ", m

"""
import _callback

from gsl_function import gsl_function, gsl_function_fdf
from _generic_solver import _generic_solver

class _minsolver(_generic_solver):
    type = None
    _alloc   = _callback.gsl_min_fminimizer_alloc
    _free    = _callback.gsl_min_fminimizer_free
    _set     = _callback.gsl_min_fminimizer_set
    _name    = _callback.gsl_min_fminimizer_name
    _iterate = _callback.gsl_min_fminimizer_iterate

    def set(self, x, x_lower, x_upper):
        """
        This function sets, or resets, an existing minimizer S to use the
        function F and the initial search interval [X_LOWER, X_UPPER],
        with a guess for the location of the minimum X_MINIMUM.

        If the interval given does not contain a minimum, then the method
        raises an exception.

        input : x, x_lower, x_upper
            x        ... inital guess for x
            x_lower  ... the lower bound of the search interval
            x_upper  ... the upper bound of the search interval
        """
        f = self.system.get_ptr()
        _callback.gsl_min_fminimizer_set(self._ptr, f, x, x_lower, x_upper)
        self._isset = 1

    def set_with_values(self, x_m, x_lower, x_upper, f_m, f_lower, f_upper):
        """
        This method is equat to the set method but uses
        the values F_MINIMUM, F_LOWER and F_UPPER instead of computing
        them internaly.

        input : x, x_lower, x_upper, f_minimum, f_lower, f_upper
            x        ... inital guess for x
            x_lower  ... the lower bound of the search interval
            x_upper  ... the upper bound of the search interval
            f        ... f(x)
            f_lower  ... f(x_lower)
            f_upper  ... f(x_upper)

        """
        f = self.system.get_ptr()
        _callback.gsl_min_fminimizer_set_with_values(self._ptr, f,
                                                  x_m, x_lower, x_upper,
                                                  f_m, f_lower, f_upper)
        self._isset = 1

    def minimum(self):
        """
        Get the current estimation for the minimum
        """
        return _callback.gsl_min_fminimizer_minimum(self._ptr)

    def x_lower(self):
        """
        Get the lower bound
        """
        return _callback.gsl_min_fminimizer_x_lower(self._ptr)

    def x_upper(self):
        """
        Get the upper bound
        """
        return _callback.gsl_min_fminimizer_x_upper(self._ptr)

class brent(_minsolver):
    """
    The "Brent minimization algorithm" combines a parabolic
    interpolation with the golden section algorithm.  This produces a
    fast algorithm which is still robust.

    The outline of the algorithm can be summarized as follows: on each
    iteration Brent's method approximates the function using an
    interpolating parabola through three existing points.  The minimum
    of the parabola is taken as a guess for the minimum.  If it lies
    within the bounds of the current interval then the interpolating
    point is accepted, and used to generate a smaller interval.  If
    the interpolating point is not accepted then the algorithm falls
    back to an ordinary golden section step.  The full details of
    Brent's method include some additional checks to improve
    convergence.
    """

    type = _callback.cvar.gsl_min_fminimizer_brent

class goldensection(_minsolver):
    """
    The "golden section algorithm" is the simplest method of bracketing
    the minimum of a function.  It is the slowest algorithm provided
    by the library, with linear convergence.

    On each iteration, the algorithm first compares the subintervals
    from the endpoints to the current minimum.  The larger subinterval
    is divided in a golden section (using the famous ratio (3-\sqrt
    5)/2 = 0.3189660...) and the value of the function at this new
    point is calculated.  The new value is used with the constraint
    f(a') > f(x') < f(b') to a select new interval containing the
    minimum, by discarding the least useful point.  This procedure can
    be continued indefinitely until the interval is sufficiently
    small.  Choosing the golden section as the bisection ratio can be
    shown to provide the fastest convergence for this type of
    algorithm.

    """

    type = _callback.cvar.gsl_min_fminimizer_goldensection

def test_interval(x_lower, x_upper, epsabs, epsrel):
    """
    This function tests for the convergence of the interval [X_LOWER,
     X_UPPER] with absolute error EPSABS and relative error EPSREL.
     The test returns `GSL_SUCCESS' if the following condition is
     achieved,

          |a - b| < epsabs + epsrel min(|a|,|b|)

     when the interval x = [a,b] does not include the origin.  If the
     interval includes the origin then \min(|a|,|b|) is replaced by
     zero (which is the minimum value of |x| over the interval).  This
     ensures that the relative error is accurately estimated for minima
     close to the origin.

     This condition on the interval also implies that any estimate of
     the minimum x_m in the interval satisfies the same condition with
     respect to the true minimum x_m^*,

          |x_m - x_m^*| < epsabs + epsrel x_m^*

     assuming that the true minimum x_m^* is contained within the
     interval.

     input : x_lower, x_upper, eps_abs, eps_rel
     """
    return _callback.gsl_min_test_interval(x_lower, x_upper, epsabs, epsrel)


text:
namespace Ui { class AboutWindow; }

namespace appleseed {
namespace studio {

class AboutWindow
  : public QWidget
{
    Q_OBJECT

  public:
    explicit AboutWindow(QWidget* parent = 0);

    ~AboutWindow();

  private:
    // Not wrapped in std::auto_ptr<> to avoid pulling in the UI definition code.
    Ui::AboutWindow* m_ui;

    void set_version_string();
};

}       // namespace studio
}       // namespace appleseed

#endif  // !APPLESEED_STUDIO_HELP_ABOUT_ABOUTWINDOW_H


text:
package com.jdroid.android.usecase;

import com.jdroid.android.usecase.listener.DefaultUseCaseListener;
import com.jdroid.java.exception.AbstractException;

/**
 * Abstract use case that handles the calls to {@link DefaultUseCaseListener#onStartUseCase()},
 * {@link DefaultUseCaseListener#onFinishUseCase()} and
 * {@link DefaultUseCaseListener#onFinishFailedUseCase(AbstractException)} when executing.
 */
public abstract class DefaultAbstractUseCase extends AbstractUseCase<DefaultUseCaseListener> {

	private static final long serialVersionUID = -6915799187802671145L;

	/**
	 * @see com.jdroid.android.usecase.AbstractUseCase#notifyFailedUseCase(com.jdroid.java.exception.AbstractException,
	 *      java.lang.Object)
	 */
	@Override
	protected void notifyFailedUseCase(AbstractException e, DefaultUseCaseListener listener) {
		listener.onFinishFailedUseCase(e);
	}

	/**
	 * @see com.jdroid.android.usecase.AbstractUseCase#notifyFinishedUseCase(java.lang.Object)
	 */
	@Override
	protected void notifyFinishedUseCase(DefaultUseCaseListener listener) {
		listener.onFinishUseCase();
	}

	/**
	 * @see com.jdroid.android.usecase.AbstractUseCase#notifyUseCaseStart(java.lang.Object)
	 */
	@Override
	protected void notifyUseCaseStart(DefaultUseCaseListener listener) {
		listener.onStartUseCase();
	}
}


text:
@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
}

- (void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];
//    XCAuthor *author = [[XCAuthor alloc] init];
//    author.authorId = 41;
//    author.type = @"people";
//    author.name = @"LiJie";
//    author.age = 20;
//    author.gender = @"female";
//    author.links = @{@"self":[NSURL URLWithString:@"http://example.com/articles/1/relationships/author"]};
//    [author xc_insertOrUpdate];

//    XCArticle *article = [[XCArticle alloc] init];
//    article.articleId = 1;
//    article.title = @"JSON API paints my bikeshed!";
//    article.body = @"The shortest article. Ever.";
//    article.created = [NSDate date];
//    article.updated = [NSDate date];
//    article.authorId = author.authorId;
//    article.link = [NSURL URLWithString:@"http://example.com/articles/1"];
//    [article xc_saveOrUpdate];

//    [XCArticle xc_removeWithKeyValues:@{@"articleId":@(1)}];

//    [XCAuthor xc_updateWithKeyValues:@{@"age":@(40),@"gender":@"female"} whereKeyValues:@{@"authorId":@(42)}];

//    author = [XCAuthor xc_selectObjectWithColumns:nil whereKeyValues:@{@"authorId":@(42)}];
//    NSLog(@"%@", author);

//    NSArray *list = [XCAuthor xc_selectObjectListWithColumns:nil whereKeyValues:@{} groupBy:nil orderBy:@[@{@"age":@"desc"}] offset:1 limit:2];
//    NSLog(@"%@", list);
}

@end


text:
class Cmctl < Formula
  desc "Command-line tool to manage cert-manager"
  homepage "https://cert-manager.io"
  url "https://github.com/cert-manager/cert-manager.git",
      tag:      "v1.10.0",
      revision: "da3265115bfd8be5780801cc6105fa857ef71965"
  license "Apache-2.0"
  head "https://github.com/cert-manager/cert-manager.git", branch: "master"

  bottle do
    sha256 cellar: :any_skip_relocation, arm64_ventura:  "4b725d1aff09b603e8e8495e04032e380b77ce4b8fd49f31be6a32841bc8fde1"
    sha256 cellar: :any_skip_relocation, arm64_monterey: "6b519910c4e72958e8c7a84097c12fcf768f6bc06b2bbafd1c72132d61b14a3d"
    sha256 cellar: :any_skip_relocation, arm64_big_sur:  "e40efa142e148a54b12978dbbf5b1d0af1b0a2052ce6687d63c5d64c8609b0bf"
    sha256 cellar: :any_skip_relocation, monterey:       "349a8837c81769de0fe34b3bb5be12707b196b849380ebcea6f08c5a8b3df73e"
    sha256 cellar: :any_skip_relocation, big_sur:        "d9a71c53738f6a462a814b304fe4cfb71bc285daa2d9449b0fea87a3771db124"
    sha256 cellar: :any_skip_relocation, catalina:       "26ed49d536e494e164590003d9c5ed54327c5eab0d45babfb4b22b18dd00341f"
    sha256 cellar: :any_skip_relocation, x86_64_linux:   "e91a4bc3b20760db2c82d849a6d2a7a4f000f69be6eadf84b39d15c4b6bb241c"
  end

  depends_on "go" => :build

  def install
    ldflags = %W[
      -s -w
      -X github.com/cert-manager/cert-manager/cmd/ctl/pkg/build.name=cmctl
      -X github.com/cert-manager/cert-manager/cmd/ctl/pkg/build/commands.registerCompletion=true
      -X github.com/cert-manager/cert-manager/pkg/util.AppVersion=v#{version}
      -X github.com/cert-manager/cert-manager/pkg/util.AppGitCommit=#{Utils.git_head}
    ]
    system "go", "build", *std_go_args(ldflags: ldflags), "./cmd/ctl"
    generate_completions_from_executable(bin/"cmctl", "completion")
  end

  test do
    assert_match version.to_s, shell_output("#{bin}/cmctl version --client")
    # The binary name ("cmctl") is templated into the help text at build time, so we verify that it is
    assert_match "cmctl", shell_output("#{bin}/cmctl help")
    # We can't make a Kuberntes cluster in test, so we check that when we use a remote command
    # we find the error about connecting
    assert_match "connect: connection refused", shell_output("#{bin}/cmctl check api 2>&1", 1)
    # The convert command *can* be tested locally.
    (testpath/"cert.yaml").write <<~EOF
      apiVersion: cert-manager.io/v1beta1
      kind: Certificate
      metadata:
        name: test-certificate
      spec:
        secretName: test
        issuerRef:
          name: test-issuer
          kind: Issuer
        commonName: example.com
    EOF

    expected_output = <<~EOF
      apiVersion: cert-manager.io/v1
      kind: Certificate
      metadata:
        creationTimestamp: null
        name: test-certificate
      spec:
        commonName: example.com
        issuerRef:
          kind: Issuer
          name: test-issuer
        secretName: test
      status: {}
    EOF

    assert_equal expected_output, shell_output("#{bin}/cmctl convert -f cert.yaml")
  end
end


text:
package com.amazonaws.services.cloudfront.model.transform;

import javax.xml.stream.events.XMLEvent;
import javax.annotation.Generated;

import com.amazonaws.services.cloudfront.model.*;
import com.amazonaws.transform.Unmarshaller;

import com.amazonaws.transform.StaxUnmarshallerContext;
import com.amazonaws.transform.SimpleTypeStaxUnmarshallers.*;

/**
 * QueryArgProfile StAX Unmarshaller
 */

@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class QueryArgProfileStaxUnmarshaller implements Unmarshaller<QueryArgProfile, StaxUnmarshallerContext> {

    public QueryArgProfile unmarshall(StaxUnmarshallerContext context) throws Exception {
        QueryArgProfile queryArgProfile = new QueryArgProfile();
        int originalDepth = context.getCurrentDepth();
        int targetDepth = originalDepth + 1;

        if (context.isStartOfDocument())
            targetDepth += 1;

        while (true) {
            XMLEvent xmlEvent = context.nextEvent();
            if (xmlEvent.isEndDocument())
                return queryArgProfile;

            if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {

                if (context.testExpression("QueryArg", targetDepth)) {
                    queryArgProfile.setQueryArg(StringStaxUnmarshaller.getInstance().unmarshall(context));
                    continue;
                }

                if (context.testExpression("ProfileId", targetDepth)) {
                    queryArgProfile.setProfileId(StringStaxUnmarshaller.getInstance().unmarshall(context));
                    continue;
                }
            } else if (xmlEvent.isEndElement()) {
                if (context.getCurrentDepth() < originalDepth) {
                    return queryArgProfile;
                }
            }
        }
    }

    private static QueryArgProfileStaxUnmarshaller instance;

    public static QueryArgProfileStaxUnmarshaller getInstance() {
        if (instance == null)
            instance = new QueryArgProfileStaxUnmarshaller();
        return instance;
    }
}


text:
var express = require('express');
var router = express.Router();
var fs = require('fs');
var path = require('path');
var multer = require('multer');
var database = require('./../database');

var upload = multer({ dest: 'data/temp/' })
var repoDir = 'data/repo/';

function getFileList() {
  var promise = new Promise((resolve, reject) => {
    fs.readdir(repoDir, function(err, files) {
      if (err) {
        reject(err);
      }
      files = files.map(f => f.replace(/.enbx$/i, ''));
      resolve({ files: files });
    });
  });
  return promise;
}

router.get('/', function(req, res, next) {
  res.send({ version: '0.1.0' });
});

router.get('/list', function(req, res, next) {
  getFileList().then(res.send.bind(res)).catch(err => {
    throw err;
  })
});

router.post('/upload', upload.single('enbx'), function(req, res, next) {
  database.save(req.file.path, req.file.originalname).then(doc => {
    res.send(doc);
  }).catch(err => {
    throw err;
  });
});

// var database = {};
router.get('/file', function(req, res, next) {

  if (!req.query.name) {
    res.send({ err: 'give me a name!' })
    return;
  }

  var name = decodeURIComponent(req.query.name);
  database.load(name)
    .then(data => {
      res.send(data);
    })
    .catch(err => { throw err });
});

module.exports = router;


text:
class CreateExercises < ActiveRecord::Migration[5.0]
  def change
    create_table :exercises do |t|
      t.string :name

      t.timestamps
    end
  end
end


text:
<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;

/* @var $this yii\web\View */
/* @var $model backend\models\MaturityLevelK3lQuestionSearch */
/* @var $form yii\widgets\ActiveForm */
?>

    <?php $form = ActiveForm::begin([
        'action' => ['index'],
        'method' => 'get',
    ]); ?>

    <?= $form->field($model, 'id') ?>

    <?= $form->field($model, 'maturity_level_k3l_title_id') ?>

    <?= $form->field($model, 'q_action_plan') ?>

    <?= $form->field($model, 'q_criteria') ?>

    <?= $form->field($model, 'q_eviden') ?>

    <?php // echo $form->field($model, 'q_unit_code') ?>

    <?php // echo $form->field($model, 'q_weight') ?>

    <?php // echo $form->field($model, 'created_by') ?>

    <?php // echo $form->field($model, 'created_at') ?>

    <?php // echo $form->field($model, 'updated_by') ?>

    <?php // echo $form->field($model, 'updated_at') ?>

        <?= Html::submitButton('Search', ['class' => 'btn btn-primary']) ?>
        <?= Html::resetButton('Reset', ['class' => 'btn btn-default']) ?>

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


text:
```scss
// Initialisiere eine globale Variable auf Root-Level.
$variable: 'initial value';

// Erstelle ein Mixin das die globale Variable überschreibt.
@mixin global-variable-overriding {
  $variable: 'mixin value' !global;
}

.local-scope::before {
  // Erstelle eine lokale Variable die eine globale beschattet.
  $variable: 'local value';

  // Füg den Mixin ein: es überschreibt die globale Variable.
  @include global-variable-overriding;

  // Geb den Wert der Variable aus.
  // Es ist der **lokale**, da er die globale beschattet.
  content: $variable;
}

// Geb die Variable in einem anderen Selektor aus, welcher nicht beschattet.
// Es ist wie erwartet die **globale**.
.other-local-scope::before {
  content: $variable;
}
```

```sass
// Initialisiere eine globale Variable auf Root-Level.
$variable: 'initial value'

// Erstelle ein Mixin das die globale Variable überschreibt.
@mixin global-variable-overriding
  $variable: 'mixin value' !global

.local-scope::before
  // Erstelle eine lokale Variable die eine globale beschattet.
  $variable: 'local value'

  // Füg den Mixin ein: es überschreibt die globale Variable.
  +global-variable-overriding

  // Geb den Wert der Variable aus.
  // Es ist der **lokale**, da er die globale beschattet.
  content: $variable

// Geb die Variable in einem anderen Selektor aus, welcher nicht beschattet.
// Es ist wie erwartet die **globale**.
.other-local-scope::before
  content: $variable
```


text:
"""
Defines an interactive command line that wraps an SMTP session.

"""

from __future__ import print_function

import sys, os

from pycopia import getopt
from pycopia import CLI
from pycopia import UI
from pycopia import tty
from pycopia.inet import SMTP
from pycopia.aid import IF

PROMPT = "smtp> "

class EmailClientCLI(CLI.BaseCommands):
    def message(self, argv):
        """message
    Create a new message object, or edit the existing one. Enters message editing
    mode."""
        pass

    def initialize(self):
        self._client = None
        self._logfile = None

    def finalize(self):
        if self._client:
            self._client.quit()
            self._client = None

    def except_hook(self, ex, val, tb):
        self._print(ex, val)
        if ex is SMTP.SMTPException:
            try:
                self._client.quit()
            except:
                pass
            self._client = None
            self._setprompt(None)

    def _print_msg(self, rp):
        self._print("%s %s" % rp) # a reply tuple (code, msg)

    def _setprompt(self, host=None):
        if host:
            self._environ["PS1"] = "smtp [%s]> " % (host,)
        else:
            self._environ["PS1"] = PROMPT

    def connect(self, argv):
        """connect [-s <bindto>] <host> [<port>]
    Where <host> is the mailhost to connect to, <port> is the TCP port to use
    (defaults to 25), and <bindto> is the local IP address to source from."""
        bindto = None
        port = 25
        optlist, longopts, args = self.getopt(argv, "s:hp:")
        for opt, val in optlist:
            if opt == "-s":
                bindto = val
            elif opt == "-p":
                port = int(val)
        if len(args) < 1:
            self._print(self.connect.__doc__)
            return
        host = args[0]
        if len(args) > 1:
            port = int(args[1])
        if self._client:
            self._print("warning: closing existing connection.")
            self.quit()

        self._client = SMTP.get_mailer(logfile=self._logfile)

        try:
            code, msg = self._client.connect(host, port, bindto)
            self._print("%s %s" % (code, msg))
            self._setprompt(argv[1])
        except:
            self._client = None
            self._print("connect failed!")
            ex, val, tb = sys.exc_info()
            self._print(str(val))

    def quit(self, argv=None):
        """quit
    Quits the SMTP session."""
        if self._client is None:
            raise CLI.CommandQuit
        try:
            self._print_msg(self._client.quit())
        except SMTP.SMTPServerDisconnected:
            pass
        self._client = None
        self._setprompt(None)

    def helo(self, argv):
        """helo [<hostname>]"""
        if len(argv) > 1:
            name = argv[1]
        else:
            name = None
        self._print_msg(self._client.helo(name))

    def ehlo(self, argv):
        """ehlo [<hostname>]"""
        if len(argv) > 1:
            name = argv[1]
        else:
            name = None
        self._print_msg(self._client.ehlo(name))

    # name clashes with built-in help
    def smtphelp(self, argv):
        """smtphelp
    Print the help text from the server."""
        self._print_msg(self._client.help())

    def rset(self, argv):
        """rset
    Resets the SMTP server to default state."""
        self._print_msg(self._client.rset())

    def noop(self, argv):
        """noop
    Sends a NOOP SMTP command. Does nothing."""
        self._print_msg(self._client.noop())

    def mail(self, argv):
        """mail <from> [<options>]
    Begin a mail transfer session. Specify the FROM: (return) address."""
        frm = argv[1] ; options = argv[2:]
        self._print_msg(self._client.mail(frm, options))

    def rcpt(self, argv):
        """rcpt <to> [<options>]
    Specify a envelope TO: address."""
        to = argv[1] ; options = argv[2:]
        self._print_msg(self._client.rcpt(to, options))

    def data(self, argv):
        """data
    Specify message data to send. Enters input mode to enter data. End with ^D."""
        msg = self._ui.get_text("Enter data, end with ^D.")
        self._print_msg(self._client.data(msg))

    def vrfy(self, argv):
        """vrfy <name>
    Verify the given name  can be delivered (VRFY command)."""
        self._print_msg(self._client.vrfy(argv[1]))
    verify = vrfy # alias

    def expn(self, argv):
        """expn <address>
    Expand an address (if server permits it)."""
        self._print_msg(self._client.expn(argv[1]))

    def login(self, argv):
        """login <user> [<password>]
    Perform an authentication protocol with the given name and password.
    Perform this after `ehlo`."""
        user = argv[1]
        if len(argv) > 2:
            passwd = argv[2]
        else:
            passwd = tty.getpass("AUTH password: ")
        self._print_msg(self._client.login(user, passwd))

    # extra non-protocol methods
    def logfile(self, argv):
        """logfile <name>
    Sets the SMTP client log file. protocol messages are sent here. If the name
    is called "close" then any current log file is closed. The special name
    "stdout" may also be used. """
        if len(argv) <= 1:
            if self._logfile:
                self._print("Current logfile is %r." % (self._logfile.name,))
            if self._client:
                lf = self._client.logfile.name
                self._print("Current SMTP logfile is %r." % (lf,))
            return
        fname = argv[1]
        if fname == "close":
            self._logfile = None
            if self._client:
                fo = self._client.logfile
                if fo is not None:
                    self._client.set_logfile(None)
                    if fo is not sys.stdout:
                        fo.close()
            return
        elif fname == "stdout":
            fo = sys.stdout
        else:
            fo = open(fname, "w")
        self._logfile = fo
        if self._client:
            self._client.set_logfile(fo)

    def send(self, argv):
        """send <data>
    Sends arbitrary data to server."""
        self._client.send(" ".join(argv[1:]))

    def putcmd(self, argv):
        """putcmd <command> [args]
    Send any command to the server, with optional arguments."""
        self._client.putcmd(argv[1], " ".join(argv[2:]))
        self._print_msg(self._client.getreply())

    def has_extn(self, argv):
        """has_extn <name>
    Check that the connected server has the named extension."""
        if self._client.has_extn(argv[1]):
            self._print("client has extension.")
        else:
            self._print("client does NOT have extension.")

def smtpcli(argv):
    """smtpcli [-h] [-l <logfilename>] [-s <portname>] [host] [port]

Provides an interactive session at a protocol level to an SMTP server.
    """
    bindto = None
    port = 25
    sourcefile = None
    paged = False
    logname = None
    try:
        optlist, longopts, args = getopt.getopt(argv[1:], "b:hp:s:l:g")
    except getopt.GetoptError:
            print (smtpcli.__doc__)
            return
    for opt, val in optlist:
        if opt == "-b":
            bindto = val
        if opt == "-l":
            logname = val
        elif opt == "-s":
            sourcefile = val
        elif opt == "-g":
            paged = True
        elif opt == "-h":
            print (smtpcli.__doc__)
            return
        elif opt == "-p":
            try:
                port = int(val)
            except ValueError:
                print (smtpcli.__doc__)
                return

    theme = UI.DefaultTheme(PROMPT)
    parser = CLI.get_cli(EmailClientCLI, paged=paged, theme=theme)
    if len(args) > 0:
        if len(args) > 1:
            port = int(args[1])
        else:
            port = 25
        host = args[0]
    else:
        host = ""
    if logname:
        parser.commands.logfile(["logfile", logname])
    if host:
        parser.commands.connect(["connect"]+IF(bindto, ["-s", bindto], [])+[host, port])
    else:
        parser.commands._print("Be sure to run 'connect' before anything else.\n")

    if sourcefile:
        try:
            parser.parse(sourcefile)
        except CLI.CommandQuit:
            pass
    else:
        parser.interact()

if __name__ == "__main__":
    smtpcli(sys.argv)


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta property="fb:app_id" content="486603034805006">
    <title>making / learning / work</title>
    <meta name="description" content="Askii began first as a mobile application called "XpressMe", which originated from one of the ideas at the IdeaShop in May 2014.

">
    <meta name="keywords" content="">

	<meta name="twitter:title" content="Creating an SMS Learning System with Askii">
	<meta name="twitter:description" content="Askii began first as a mobile application called "XpressMe", which originated from one of the ideas at the IdeaShop in May 2014.

">
	<meta name="twitter:site" content="@medialab">
	<meta name="twitter:creator" content="@medialab">

	<meta name="twitter:card" content="summary">
	<meta name="twitter:image" content="http://learn.media.mit.edu/mlw/images/">

	<meta property="og:locale" content="Cambirdge MA USA">
	<meta property="og:type" content="article">
	<meta property="og:title" content="Creating an SMS Learning System with Askii">
	<meta property="og:description" content="Askii began first as a mobile application called "XpressMe", which originated from one of the ideas at the IdeaShop in May 2014.

">
	<meta property="og:url" content="http://learn.media.mit.edu/updates/askii/creating_askii.html">
	<meta property="og:site_name" content="making / learning / work">

    <link rel="canonical" href="http://learn.media.mit.edu/updates/askii/creating_askii.html">

    <link href="http://learn.media.mit.edu/mlw/atom.xml" type="application/atom+xml" rel="alternate" title="making / learning / work Atom Feed">
    <link href="http://learn.media.mit.edu/mlw/sitemap.xml" type="application/xml" rel="sitemap" title="Sitemap">
    <link href='http://fonts.googleapis.com/css?family=Roboto:900,300,400' rel='stylesheet' type='text/css'>

    <meta name="HandheldFriendly" content="True">
    <meta name="MobileOptimized" content="320">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="cleartype" content="on">

    <link rel="stylesheet" href="http://learn.media.mit.edu/mlw/css/main.css">

    making / learning / work

making / learning / work

Creating an SMS Learning System with Askii

 Making / Learning / Work was an adult learning innovation project hosted at the MIT Media Lab from September 2014 to May 2016. This site is an archive of the project documentation.

Askii began first as a mobile application called "XpressMe", which originated from one of the ideas at the IdeaShop in May 2014.

Initial Prototyping

In January 2015, we created a first prototype of XpressMe, which was a mobile app that would deliver basic numeracy content in small chunks of time that  a learner could utilize on their commute.

Re-Thinking the Concept

However, in February, we decided to re-think the idea after hearing from experts in the field that we might want to focus on a system that delivers certification content, not basic numeracy content, as it is more natural to read on the go than do math (makes logical sense).

When re-thinking "XpressMe", I was fortunate enough to have a conversation with Alison from Cell-Ed, where we talked about some of the technological barriers that learners may have to using an application such as "XpressMe". Alison explained Cell-Ed's rationale for using an SMS-based system, and gave me inspiration to think through what "XpressMe" would look like as a system that blended SMS and mobile website content.

Some of the advantages for creating an SMS-based system:

It would not limit the user group to only adult learners with smart phones, but would allow learners with feature phones to interact with the application as well.

Learners may feel like they are interacting with a real person

Fleshing out the Idea

I began to think about how we could deliver certification content on-the-go, and honed in on creating a combined SMS and web-based system for helping learners study for exams such as the CPT Exam while on their commutes. As initial test material, I chose the US Naturalization Exam because it is an exam with publicly available study guides.

My initial thought processes for what the system would behave like is shown below, with lots of arrows indicating a learner's discussion with the service via SMS and web.

Prototyping Again

From these system flow charts, I then translated them into a first prototype, which we have named "Askii". Askii is built on Twilio, which gives it the ability to interact via a mobile phone number. The logic of the application, which is running in the background as a external API that interfaces with a Twilio app, is written in Node.js with a Mongoose database of questions, answers, and content.

The prototype is up and running, and very soon there will be a demo video of the system on our site.

For now, here is a screen shot as a placeholder.

In the coming months, we will be fleshing out this prototype and focusing on improving the algorithms behind what the learner sees, with the hopes of beginning user testing this summer to better understand how learners could study certification content on-the-go.

Askii is meant to be a system that can be used for all sorts of certification content, so if you have more suggestions for content you would like to see put in the system or thoughts on potential collaborations, please feel free to leave a comment or reach out to us by email.

	 Share on Twitter

Updated <time datetime="2015-03-06T00:00:00Z" itemprop="datePublished">March 06, 2015</time>

 Questions, comments? We want to hear them.

A project of the Learning Initiative at the MIT Media Lab

	Supported by The Joyce Foundation

	All materials licensed under the Creative Commons Attribution 4.0 license unless otherwise noted.


text:
SYNONYM

#### According to
Index Fungorum

#### Published in
Synopsis Pl. crypt. 1: 9 (1785)

#### Original name
Lichen sphaeroides Dicks.

### Remarks
null


text:
class CreateCargos < ActiveRecord::Migration
  def change
    create_table :cargos do |t|
      t.string :descripcion, :limit => 60

      t.timestamps
    end
  end
end


text:
namespace content {
class RenderFrameHost;
}  // namespace content

namespace extensions {

class Extension;

void RegisterChromeServicesForFrame(content::RenderFrameHost* render_frame_host,
                                    const Extension* extension);

}  // namespace extensions

#endif  // CHROME_BROWSER_EXTENSIONS_CHROME_MOJO_SERVICE_REGISTRATION_H_


text:
%If you've noticed incorrect matches that somehow made it through the
%3DSIFT-RANSAC pipeline, you can remove them in this

keyM


text:
//
//  LPYGestureVertifyViewController.m
//  LPYFramework
//
//  Created by admin on 16/1/18.
//  Copyright © 2016年 liupuyan. All rights reserved.
//

#import "LPYGestureVertifyViewController.h"
#import "LPYCircleViewConst.h"
#import "LPYCircleView.h"
#import "LPYLockLabel.h"
#import "LPYGestureViewController.h"

@interface LPYGestureVertifyViewController () <LPYCircleViewDelegate>
/**
 *  文字提示Label
 */
@property (nonatomic, strong) LPYLockLabel *msgLabel;
@end

@implementation LPYGestureVertifyViewController
- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];

    [self.navigationController setNavigationBarHidden:NO animated:animated];
}

- (instancetype)init
{
    self = [super init];
    if (self) {
        [self.view setBackgroundColor:CircleViewBackgroundColor];
    }
    return self;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.

    self.title = @"验证手势解锁";

    LPYCircleView *lockView = [[LPYCircleView alloc] init];
    lockView.delegate = self;
    [lockView setType:LPYCircleViewTypeVerify];
    [self.view addSubview:lockView];

    LPYLockLabel *msgLabel = [[LPYLockLabel alloc] init];
    msgLabel.frame = CGRectMake(0, 0, kScreenW, 14);
    msgLabel.center = CGPointMake(kScreenW/2, CGRectGetMinY(lockView.frame) - 30);
    [msgLabel showNormalMsg:gestureTextOldGesture];
    self.msgLabel = msgLabel;
    [self.view addSubview:msgLabel];
}

#pragma mark - login or verify gesture
- (void)circleView:(LPYCircleView *)view type:(LPYCircleViewType)type didCompleteLoginGesture:(NSString *)gesture result:(BOOL)equal
{
    if (type == LPYCircleViewTypeVerify) {

        if (equal) {
            NSLog(@"验证成功");

            if (self.isToSetNewGesture) {
                LPYGestureViewController *gestureVc = [[LPYGestureViewController alloc] init];
                [gestureVc setType:LPYGestureViewControllerTypeSetting];
                [self.navigationController pushViewController:gestureVc animated:YES];
            } else {
                [self.navigationController popToRootViewControllerAnimated:YES];
            }

        } else {
            NSLog(@"密码错误!");
            [self.msgLabel showWarnMsgAndShake:gestureTextGestureVerifyError];
        }
    }
}
@end


text:
package com.baozi.admin.modules.sys.web;

import com.baozi.admin.common.BaseController;
import com.baozi.admin.common.utils.JsonResult;
import com.baozi.admin.common.utils.StringUtils;
import com.baozi.admin.common.utils.UserUtils;
import com.baozi.admin.modules.sys.entity.Role;
import com.baozi.admin.modules.sys.entity.User;
import com.baozi.admin.modules.sys.service.UserService;
import com.github.pagehelper.PageInfo;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
 * Created by baozi on 2017/6/11.
 */
@Controller
@RequestMapping("sys/user")
public class UserController extends BaseController {

    @Autowired
    private UserService userService;

    @ModelAttribute
    public User get(@RequestParam(required = false) String id) {
        if (StringUtils.isNotBlank(id)) {
            return UserUtils.get(id);
        } else {
            return new User();
        }
    }

    @RequiresPermissions("user")
    @RequestMapping("modifyPwdForm")
    public String modifyPwdForm(User user, ModelMap modelMap) {
        modelMap.addAttribute("user", user);
        return "sys/user/modifyPwd";
    }

    @RequiresPermissions("user")
    @RequestMapping(value = "modifyPwd", method = RequestMethod.POST)
    public @ResponseBody JsonResult modifyPwd(String oldPassword, String newPassword) {
        User user = UserUtils.getUser();
        if (StringUtils.isNotBlank(oldPassword) && StringUtils.isNotBlank(newPassword)) {
            if (UserUtils.validatePassword(oldPassword, user.getPassword())) {
                userService.updatePasswordById(user.getId(), user.getLoginName(), newPassword);
                return JsonResult.success(1, "修改密码成功", user);
            } else {
                return JsonResult.error(0, "修改密码失败,旧密码错误");
            }
        }
        return JsonResult.error(0, "参数错误");
    }

    @RequiresPermissions("user")
    @RequestMapping("modifyUserForm")
    public String modifyUserForm(User user, ModelMap modelMap) {
        modelMap.addAttribute("user", user);
        return "sys/user/modifyUser";
    }

    @RequiresPermissions("user")
    @RequestMapping(value = "modifyUser", method = RequestMethod.POST)
    public @ResponseBody JsonResult modifyUser(User user) {
        if (StringUtils.isNotBlank(user.getLoginName()) && StringUtils.isNotBlank(user.getNo()) &&
                StringUtils.isNotBlank(user.getName()) && user.getPage() != null) {
            userService.save(user);
            return JsonResult.success(1, "修改信息成功", user);
        }
        return JsonResult.error(0, "参数错误");
    }

    @RequiresPermissions("sys:user:view")
    @RequestMapping(value = {"", "userList"})
    public String userList(User user, ModelMap modelMap) {
        PageInfo<User> pageInfo = userService.findList(user);
        modelMap.addAttribute("user", user);
        modelMap.addAttribute("pageInfo", pageInfo);
        return "sys/user/userList";
    }

    @RequiresPermissions("sys:user:view")
    @RequestMapping("form")
    public String form(User user, ModelMap modelMap) {
        modelMap.addAttribute("user", user);
        modelMap.addAttribute("roleList", UserUtils.getRoleList(null));
        return "sys/user/userForm";
    }

    @RequiresPermissions("sys:user:edit")
    @RequestMapping(value = "save", method = RequestMethod.POST)
    public @ResponseBody JsonResult save(User user, String[] roleIds, ModelMap modelMap) {
        if (StringUtils.isNotBlank(user.getNewPassword())) {
            user.setPassword(UserUtils.entryptPassword(user.getNewPassword()));
        }
        if (!beanValidator(modelMap, user)) {
            return JsonResult.error(0, modelMap.get("message").toString());
        }
        if (user.isNewRecord() && StringUtils.isBlank(user.getPassword())) {
            return JsonResult.error(0, "添加用户必须输入初始密码");
        }
        if (roleIds == null || roleIds.length == 0) {
            return JsonResult.error(0, "用户必须选择一个角色");
        }
        User oldUser = userService.getByLoginName(user.getLoginName());
        if (user.isNewRecord() && oldUser != null) {
            return JsonResult.error(0, "登录名已存在");
        }
        // 角色数据有效性验证,过滤不在授权内的角色
        List<Role> roleList = new ArrayList<>();
        List<String> roleIdList = Arrays.asList(roleIds);
        roleList.addAll(UserUtils.getRoleList(user).stream().filter(role -> roleIdList.contains(role.getId())).collect(Collectors.toList()));
        user.setRoleList(roleList);
        userService.save(user);
        if (user.getLoginName().equals(UserUtils.getUser().getLoginName())) {
            UserUtils.clearCache(user);
        }
        return JsonResult.success(1, "添加/编辑用户成功", user);
    }

    @RequiresPermissions("sys:user:delete")
    @RequestMapping("delete")
    public @ResponseBody JsonResult delete(User user) {
        if (user.getId().equals(UserUtils.getUser().getId())) {
            return JsonResult.error(0, "删除失败,不能删除当前登录用户");
        }
        userService.delete(user);
        return JsonResult.success(1, "删除用户成功", null);
    }

    @RequiresPermissions("sys:user:delete")
    @RequestMapping("deleteIds")
    public @ResponseBody JsonResult deleteIds(String[] ids) {
        List<String> idList = Arrays.asList(ids);
        if (idList.contains(UserUtils.getUser().getId())) {
            return JsonResult.error(0, "删除失败,不能删除当前登录用户");
        }
        userService.deleteIds(idList);
        return JsonResult.success(1, "批量删除用户成功,数量:" + ids.length, null);
    }

    @RequiresPermissions("sys:user:edit")
    @RequestMapping("changeStatus")
    public @ResponseBody JsonResult changeStatus(User user) {
        if (user.isNewRecord()) {
            return JsonResult.error(0, "修改用户状态失败,用户不存在");
        }
        userService.updateStatus(user);
        return JsonResult.success(1, "修改用户状态成功", user);
    }
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>gobject-query</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.72.0">
<link rel="start" href="index.html" title="GObject Reference Manual">
<link rel="up" href="rn02.html" title="Tools Reference">
<link rel="prev" href="glib-genmarshal.html" title="glib-genmarshal">
<link rel="next" href="pt02.html" title="Part IV. Tutorial">
<meta name="generator" content="GTK-Doc V1.7 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="preface" href="pr01.html" title="Introduction">
<link rel="part" href="pt01.html" title="Part I. Concepts">
<link rel="chapter" href="ch01.html" title="Background">
<link rel="chapter" href="ch02.html" title="The Glib Dynamic Type System">
<link rel="chapter" href="chapter-gobject.html" title="The GObject base class">
<link rel="chapter" href="chapter-signal.html" title="The GObject messaging system">
<link rel="reference" href="rn01.html" title="API Reference">
<link rel="reference" href="rn02.html" title="Tools Reference">
<link rel="part" href="pt02.html" title="Part IV. Tutorial">
<link rel="chapter" href="howto-gobject.html" title="How To define and implement a new GObject?">
<link rel="chapter" href="howto-interface.html" title="How To define and implement Interfaces?">
<link rel="chapter" href="howto-signals.html" title="Howto create and use signals">
<link rel="part" href="pt03.html" title="Part V. Related Tools">
<link rel="chapter" href="tools-gob.html" title="GObject builder">
<link rel="chapter" href="tools-ginspector.html" title="Graphical inspection of Gobjects">
<link rel="chapter" href="tools-refdb.html" title="Debugging reference count problems">
<link rel="chapter" href="tools-gtkdoc.html" title="Writing API docs">
<link rel="index" href="ix01.html" title="Index">
<link rel="index" href="ix02.html" title="Index of deprecated symbols">
<link rel="index" href="ix03.html" title="Index of new symbols in 2.2">
<link rel="index" href="ix04.html" title="Index of new symbols in 2.4">
<link rel="index" href="ix05.html" title="Index of new symbols in 2.6">
<link rel="index" href="ix06.html" title="Index of new symbols in 2.8">
<link rel="index" href="ix07.html" title="Index of new symbols in 2.10">
<link rel="index" href="ix08.html" title="Index of new symbols in 2.12">

GObject Reference Manual

gobject-query

gobject-query — display a tree of types

Synopsis

gobject-query   froots  [options...]

gobject-query   tree  [options...]

Description

gobject-query is a small utility that draws a tree of
types.

Invocation

gobject-query takes a mandatory argument that specifies
whether it should iterate over the fundamental types or print a type tree.

Options

<col align="left" valign="top">

froots

iterate over fundamental roots

tree

print type tree

-r type

specify the root type

-n

don't descend type tree

-b string

specify indent string

-i string

specify incremental indent string

-s number

specify line spacing

-h, --help

Print brief help and exit.

-v, --version

Print version and exit.


text:
package com.android.inputmethod.keyboard;

import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.Rect;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.text.TextUtils;
import android.util.Xml;

import com.android.inputmethod.keyboard.internal.KeyStyles;
import com.android.inputmethod.keyboard.internal.KeyStyles.KeyStyle;
import com.android.inputmethod.keyboard.internal.KeyboardBuilder;
import com.android.inputmethod.keyboard.internal.KeyboardBuilder.ParseException;
import com.android.inputmethod.keyboard.internal.KeyboardIconsSet;
import com.android.inputmethod.keyboard.internal.KeyboardParams;
import com.android.inputmethod.keyboard.internal.MoreKeySpecParser;

import com.android.s16.inputmethod.R;

import org.xmlpull.v1.XmlPullParser;

import java.util.HashMap;
import java.util.Map;

/**
 * Class for describing the position and characteristics of a single key in the keyboard.
 */
public class Key {
    /**
     * The key code (unicode or custom code) that this key generates.
     */
    public final int mCode;

    /** Label to display */
    public final CharSequence mLabel;
    /** Hint label to display on the key in conjunction with the label */
    public final CharSequence mHintLabel;
    /** Option of the label */
    private final int mLabelOption;
    private static final int LABEL_OPTION_ALIGN_LEFT = 0x01;
    private static final int LABEL_OPTION_ALIGN_RIGHT = 0x02;
    private static final int LABEL_OPTION_ALIGN_LEFT_OF_CENTER = 0x08;
    private static final int LABEL_OPTION_LARGE_LETTER = 0x10;
    private static final int LABEL_OPTION_FONT_NORMAL = 0x20;
    private static final int LABEL_OPTION_FONT_MONO_SPACE = 0x40;
    private static final int LABEL_OPTION_FOLLOW_KEY_LETTER_RATIO = 0x80;
    private static final int LABEL_OPTION_FOLLOW_KEY_HINT_LABEL_RATIO = 0x100;
    private static final int LABEL_OPTION_HAS_POPUP_HINT = 0x200;
    private static final int LABEL_OPTION_HAS_UPPERCASE_LETTER = 0x400;
    private static final int LABEL_OPTION_HAS_HINT_LABEL = 0x800;
    private static final int LABEL_OPTION_WITH_ICON_LEFT = 0x1000;
    private static final int LABEL_OPTION_WITH_ICON_RIGHT = 0x2000;
    private static final int LABEL_OPTION_AUTO_X_SCALE = 0x4000;

    /** Icon to display instead of a label. Icon takes precedence over a label */
    private Drawable mIcon;
    /** Preview version of the icon, for the preview popup */
    private Drawable mPreviewIcon;

    /** Width of the key, not including the gap */
    public final int mWidth;
    /** Height of the key, not including the gap */
    public final int mHeight;
    /** The horizontal gap around this key */
    public final int mHorizontalGap;
    /** The vertical gap below this key */
    public final int mVerticalGap;
    /** The visual insets */
    public final int mVisualInsetsLeft;
    public final int mVisualInsetsRight;
    /** X coordinate of the key in the keyboard layout */
    public final int mX;
    /** Y coordinate of the key in the keyboard layout */
    public final int mY;
    /** Hit bounding box of the key */
    public final Rect mHitBox = new Rect();

    /** Text to output when pressed. This can be multiple characters, like ".com" */
    public final CharSequence mOutputText;
    /** More keys */
    public final CharSequence[] mMoreKeys;
    /** More keys maximum column number */
    public final int mMaxMoreKeysColumn;

    /** Background type that represents different key background visual than normal one. */
    public final int mBackgroundType;
    public static final int BACKGROUND_TYPE_NORMAL = 0;
    public static final int BACKGROUND_TYPE_FUNCTIONAL = 1;
    public static final int BACKGROUND_TYPE_ACTION = 2;
    public static final int BACKGROUND_TYPE_STICKY = 3;

    /** Whether this key repeats itself when held down */
    public final boolean mRepeatable;

    /** The current pressed state of this key */
    private boolean mPressed;
    /** If this is a sticky key, is its highlight on? */
    private boolean mHighlightOn;
    /** Key is enabled and responds on press */
    private boolean mEnabled = true;
    /** Whether this key needs to show the "..." popup hint for special purposes */
    private boolean mNeedsSpecialPopupHint;

    // RTL parenthesis character swapping map.
    private static final Map<Integer, Integer> sRtlParenthesisMap = new HashMap<Integer, Integer>();

    static {
        // The all letters need to be mirrored are found at
        // http://www.unicode.org/Public/6.0.0/ucd/extracted/DerivedBinaryProperties.txt
        addRtlParenthesisPair('(', ')');
        addRtlParenthesisPair('[', ']');
        addRtlParenthesisPair('{', '}');
        addRtlParenthesisPair('<', '>');
        // \u00ab: LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
        // \u00bb: RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
        addRtlParenthesisPair('\u00ab', '\u00bb');
        // \u2039: SINGLE LEFT-POINTING ANGLE QUOTATION MARK
        // \u203a: SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
        addRtlParenthesisPair('\u2039', '\u203a');
        // \u2264: LESS-THAN OR EQUAL TO
        // \u2265: GREATER-THAN OR EQUAL TO
        addRtlParenthesisPair('\u2264', '\u2265');
    }

    private static void addRtlParenthesisPair(int left, int right) {
        sRtlParenthesisMap.put(left, right);
        sRtlParenthesisMap.put(right, left);
    }

    public static int getRtlParenthesisCode(int code, boolean isRtl) {
        if (isRtl && sRtlParenthesisMap.containsKey(code)) {
            return sRtlParenthesisMap.get(code);
        } else {
            return code;
        }
    }

    private static int getCode(Resources res, KeyboardParams params, String moreKeySpec) {
        return getRtlParenthesisCode(
                MoreKeySpecParser.getCode(res, moreKeySpec), params.mIsRtlKeyboard);
    }

    private static Drawable getIcon(KeyboardParams params, String moreKeySpec) {
        return params.mIconsSet.getIcon(MoreKeySpecParser.getIconId(moreKeySpec));
    }

    /**
     * This constructor is being used only for key in more keys keyboard.
     */
    public Key(Resources res, KeyboardParams params, String moreKeySpec,
            int x, int y, int width, int height) {
        this(params, MoreKeySpecParser.getLabel(moreKeySpec), null, getIcon(params, moreKeySpec),
                getCode(res, params, moreKeySpec), MoreKeySpecParser.getOutputText(moreKeySpec),
                x, y, width, height);
    }

    /**
     * This constructor is being used only for key in popup suggestions pane.
     */
    public Key(KeyboardParams params, CharSequence label, CharSequence hintLabel, Drawable icon,
            int code, CharSequence outputText, int x, int y, int width, int height) {
        mHeight = height - params.mVerticalGap;
        mHorizontalGap = params.mHorizontalGap;
        mVerticalGap = params.mVerticalGap;
        mVisualInsetsLeft = mVisualInsetsRight = 0;
        mWidth = width - mHorizontalGap;
        mHintLabel = hintLabel;
        mLabelOption = 0;
        mBackgroundType = BACKGROUND_TYPE_NORMAL;
        mRepeatable = false;
        mMoreKeys = null;
        mMaxMoreKeysColumn = 0;
        mLabel = label;
        mOutputText = outputText;
        mCode = code;
        mIcon = icon;
        // Horizontal gap is divided equally to both sides of the key.
        mX = x + mHorizontalGap / 2;
        mY = y;
        mHitBox.set(x, y, x + width + 1, y + height);
    }

    /**
     * Create a key with the given top-left coordinate and extract its attributes from the XML
     * parser.
     * @param res resources associated with the caller's context
     * @param params the keyboard building parameters.
     * @param row the row that this key belongs to. row's x-coordinate will be the right edge of
     *        this key.
     * @param parser the XML parser containing the attributes for this key
     * @param keyStyles active key styles set
     */
    public Key(Resources res, KeyboardParams params, KeyboardBuilder.Row row,
            XmlPullParser parser, KeyStyles keyStyles) {
        final float horizontalGap = isSpacer() ? 0 : params.mHorizontalGap;
        final int keyHeight = row.mRowHeight;
        mVerticalGap = params.mVerticalGap;
        mHeight = keyHeight - mVerticalGap;

        final TypedArray keyAttr = res.obtainAttributes(Xml.asAttributeSet(parser),
                R.styleable.Keyboard_Key);

        final KeyStyle style;
        if (keyAttr.hasValue(R.styleable.Keyboard_Key_keyStyle)) {
            String styleName = keyAttr.getString(R.styleable.Keyboard_Key_keyStyle);
            style = keyStyles.getKeyStyle(styleName);
            if (style == null)
                throw new ParseException("Unknown key style: " + styleName, parser);
        } else {
            style = keyStyles.getEmptyKeyStyle();
        }

        final float keyXPos = row.getKeyX(keyAttr);
        final float keyWidth = row.getKeyWidth(keyAttr, keyXPos);
        final int keyYPos = row.getKeyY();

        // Horizontal gap is divided equally to both sides of the key.
        mX = (int) (keyXPos + horizontalGap / 2);
        mY = keyYPos;
        mWidth = (int) (keyWidth - horizontalGap);
        mHorizontalGap = (int) horizontalGap;
        mHitBox.set((int)keyXPos, keyYPos, (int)(keyXPos + keyWidth) + 1, keyYPos + keyHeight);
        // Update row to have current x coordinate.
        row.setXPos(keyXPos + keyWidth);

        final CharSequence[] moreKeys = style.getTextArray(keyAttr,
                R.styleable.Keyboard_Key_moreKeys);
        // In Arabic symbol layouts, we'd like to keep digits in more keys regardless of
        // config_digit_more_keys_enabled.
        if (params.mId.isAlphabetKeyboard()
                && !res.getBoolean(R.bool.config_digit_more_keys_enabled)) {
            mMoreKeys = MoreKeySpecParser.filterOut(res, moreKeys, MoreKeySpecParser.DIGIT_FILTER);
        } else {
            mMoreKeys = moreKeys;
        }
        mMaxMoreKeysColumn = style.getInt(keyAttr,
                R.styleable.Keyboard_Key_maxMoreKeysColumn, params.mMaxMiniKeyboardColumn);

        mBackgroundType = style.getInt(keyAttr,
                R.styleable.Keyboard_Key_backgroundType, BACKGROUND_TYPE_NORMAL);
        mRepeatable = style.getBoolean(keyAttr, R.styleable.Keyboard_Key_isRepeatable, false);
        mEnabled = style.getBoolean(keyAttr, R.styleable.Keyboard_Key_enabled, true);

        final KeyboardIconsSet iconsSet = params.mIconsSet;
        mVisualInsetsLeft = (int) KeyboardBuilder.getDimensionOrFraction(keyAttr,
                R.styleable.Keyboard_Key_visualInsetsLeft, params.mBaseWidth, 0);
        mVisualInsetsRight = (int) KeyboardBuilder.getDimensionOrFraction(keyAttr,
                R.styleable.Keyboard_Key_visualInsetsRight, params.mBaseWidth, 0);
        mPreviewIcon = iconsSet.getIcon(style.getInt(keyAttr,
                R.styleable.Keyboard_Key_keyIconPreview, KeyboardIconsSet.ICON_UNDEFINED));
        mIcon = iconsSet.getIcon(style.getInt(keyAttr, R.styleable.Keyboard_Key_keyIcon,
                KeyboardIconsSet.ICON_UNDEFINED));
        final int shiftedIconId = style.getInt(keyAttr, R.styleable.Keyboard_Key_keyIconShifted,
                KeyboardIconsSet.ICON_UNDEFINED);
        if (shiftedIconId != KeyboardIconsSet.ICON_UNDEFINED) {
            final Drawable shiftedIcon = iconsSet.getIcon(shiftedIconId);
            params.addShiftedIcon(this, shiftedIcon);
        }
        mHintLabel = style.getText(keyAttr, R.styleable.Keyboard_Key_keyHintLabel);

        mLabel = style.getText(keyAttr, R.styleable.Keyboard_Key_keyLabel);
        mLabelOption = style.getFlag(keyAttr, R.styleable.Keyboard_Key_keyLabelOption, 0);
        mOutputText = style.getText(keyAttr, R.styleable.Keyboard_Key_keyOutputText);
        // Choose the first letter of the label as primary code if not
        // specified.
        final int code = style.getInt(keyAttr, R.styleable.Keyboard_Key_code,
                Keyboard.CODE_UNSPECIFIED);
        if (code == Keyboard.CODE_UNSPECIFIED && !TextUtils.isEmpty(mLabel)) {
            final int firstChar = mLabel.charAt(0);
            mCode = getRtlParenthesisCode(firstChar, params.mIsRtlKeyboard);
        } else if (code != Keyboard.CODE_UNSPECIFIED) {
            mCode = code;
        } else {
            mCode = Keyboard.CODE_DUMMY;
        }

        keyAttr.recycle();
    }

    public void markAsLeftEdge(KeyboardParams params) {
        mHitBox.left = params.mHorizontalEdgesPadding;
    }

    public void markAsRightEdge(KeyboardParams params) {
        mHitBox.right = params.mOccupiedWidth - params.mHorizontalEdgesPadding;
    }

    public void markAsTopEdge(KeyboardParams params) {
        mHitBox.top = params.mTopPadding;
    }

    public void markAsBottomEdge(KeyboardParams params) {
        mHitBox.bottom = params.mOccupiedHeight + params.mBottomPadding;
    }

    public boolean isSticky() {
        return mBackgroundType == BACKGROUND_TYPE_STICKY;
    }

    public boolean isSpacer() {
        return false;
    }

    public Typeface selectTypeface(Typeface defaultTypeface) {
        // TODO: Handle "bold" here too?
        if ((mLabelOption & LABEL_OPTION_FONT_NORMAL) != 0) {
            return Typeface.DEFAULT;
        } else if ((mLabelOption & LABEL_OPTION_FONT_MONO_SPACE) != 0) {
            return Typeface.MONOSPACE;
        } else {
            return defaultTypeface;
        }
    }

    public int selectTextSize(int letter, int largeLetter, int label, int hintLabel) {
        if (mLabel.length() > 1
                && (mLabelOption & (LABEL_OPTION_FOLLOW_KEY_LETTER_RATIO
                        | LABEL_OPTION_FOLLOW_KEY_HINT_LABEL_RATIO)) == 0) {
            return label;
        } else if ((mLabelOption & LABEL_OPTION_FOLLOW_KEY_HINT_LABEL_RATIO) != 0) {
            return hintLabel;
        } else if ((mLabelOption & LABEL_OPTION_LARGE_LETTER) != 0) {
            return largeLetter;
        } else {
            return letter;
        }
    }

    public boolean isAlignLeft() {
        return (mLabelOption & LABEL_OPTION_ALIGN_LEFT) != 0;
    }

    public boolean isAlignRight() {
        return (mLabelOption & LABEL_OPTION_ALIGN_RIGHT) != 0;
    }

    public boolean isAlignLeftOfCenter() {
        return (mLabelOption & LABEL_OPTION_ALIGN_LEFT_OF_CENTER) != 0;
    }

    public boolean hasPopupHint() {
        return (mLabelOption & LABEL_OPTION_HAS_POPUP_HINT) != 0;
    }

    public void setNeedsSpecialPopupHint(boolean needsSpecialPopupHint) {
        mNeedsSpecialPopupHint = needsSpecialPopupHint;
    }

    public boolean needsSpecialPopupHint() {
        return mNeedsSpecialPopupHint;
    }

    public boolean hasUppercaseLetter() {
        return (mLabelOption & LABEL_OPTION_HAS_UPPERCASE_LETTER) != 0;
    }

    public boolean hasHintLabel() {
        return (mLabelOption & LABEL_OPTION_HAS_HINT_LABEL) != 0;
    }

    public boolean hasLabelWithIconLeft() {
        return (mLabelOption & LABEL_OPTION_WITH_ICON_LEFT) != 0;
    }

    public boolean hasLabelWithIconRight() {
        return (mLabelOption & LABEL_OPTION_WITH_ICON_RIGHT) != 0;
    }

    public boolean needsXScale() {
        return (mLabelOption & LABEL_OPTION_AUTO_X_SCALE) != 0;
    }

    public Drawable getIcon() {
        return mIcon;
    }

    public Drawable getPreviewIcon() {
        return mPreviewIcon;
    }

    public void setIcon(Drawable icon) {
        mIcon = icon;
    }

    public void setPreviewIcon(Drawable icon) {
        mPreviewIcon = icon;
    }

    /**
     * Informs the key that it has been pressed, in case it needs to change its appearance or
     * state.
     * @see #onReleased()
     */
    public void onPressed() {
        mPressed = true;
    }

    /**
     * Informs the key that it has been released, in case it needs to change its appearance or
     * state.
     * @see #onPressed()
     */
    public void onReleased() {
        mPressed = false;
    }

    public void setHighlightOn(boolean highlightOn) {
        mHighlightOn = highlightOn;
    }

    public boolean isEnabled() {
        return mEnabled;
    }

    public void setEnabled(boolean enabled) {
        mEnabled = enabled;
    }

    /**
     * Detects if a point falls on this key.
     * @param x the x-coordinate of the point
     * @param y the y-coordinate of the point
     * @return whether or not the point falls on the key. If the key is attached to an edge, it will
     * assume that all points between the key and the edge are considered to be on the key.
     * @see {@link #markAsLeftEdge(KeyboardParams)} etc.
     */
    public boolean isOnKey(int x, int y) {
        return mHitBox.contains(x, y);
    }

    /**
     * Returns the square of the distance to the nearest edge of the key and the given point.
     * @param x the x-coordinate of the point
     * @param y the y-coordinate of the point
     * @return the square of the distance of the point from the nearest edge of the key
     */
    public int squaredDistanceToEdge(int x, int y) {
        final int left = mX;
        final int right = left + mWidth;
        final int top = mY;
        final int bottom = top + mHeight;
        final int edgeX = x < left ? left : (x > right ? right : x);
        final int edgeY = y < top ? top : (y > bottom ? bottom : y);
        final int dx = x - edgeX;
        final int dy = y - edgeY;
        return dx * dx + dy * dy;
    }

    private final static int[] KEY_STATE_NORMAL_HIGHLIGHT_ON = {
        android.R.attr.state_checkable,
        android.R.attr.state_checked
    };

    private final static int[] KEY_STATE_PRESSED_HIGHLIGHT_ON = {
        android.R.attr.state_pressed,
        android.R.attr.state_checkable,
        android.R.attr.state_checked
    };

    private final static int[] KEY_STATE_NORMAL_HIGHLIGHT_OFF = {
        android.R.attr.state_checkable
    };

    private final static int[] KEY_STATE_PRESSED_HIGHLIGHT_OFF = {
        android.R.attr.state_pressed,
        android.R.attr.state_checkable
    };

    private final static int[] KEY_STATE_NORMAL = {
    };

    private final static int[] KEY_STATE_PRESSED = {
        android.R.attr.state_pressed
    };

    // functional normal state (with properties)
    private static final int[] KEY_STATE_FUNCTIONAL_NORMAL = {
            android.R.attr.state_single
    };

    // functional pressed state (with properties)
    private static final int[] KEY_STATE_FUNCTIONAL_PRESSED = {
            android.R.attr.state_single,
            android.R.attr.state_pressed
    };

    // action normal state (with properties)
    private static final int[] KEY_STATE_ACTIVE_NORMAL = {
            android.R.attr.state_active
    };

    // action pressed state (with properties)
    private static final int[] KEY_STATE_ACTIVE_PRESSED = {
            android.R.attr.state_active,
            android.R.attr.state_pressed
    };

    /**
     * Returns the drawable state for the key, based on the current state and type of the key.
     * @return the drawable state of the key.
     * @see android.graphics.drawable.StateListDrawable#setState(int[])
     */
    public int[] getCurrentDrawableState() {
        final boolean pressed = mPressed;

        switch (mBackgroundType) {
        case BACKGROUND_TYPE_FUNCTIONAL:
            return pressed ? KEY_STATE_FUNCTIONAL_PRESSED : KEY_STATE_FUNCTIONAL_NORMAL;
        case BACKGROUND_TYPE_ACTION:
            return pressed ? KEY_STATE_ACTIVE_PRESSED : KEY_STATE_ACTIVE_NORMAL;
        case BACKGROUND_TYPE_STICKY:
            if (mHighlightOn) {
                return pressed ? KEY_STATE_PRESSED_HIGHLIGHT_ON : KEY_STATE_NORMAL_HIGHLIGHT_ON;
            } else {
                return pressed ? KEY_STATE_PRESSED_HIGHLIGHT_OFF : KEY_STATE_NORMAL_HIGHLIGHT_OFF;
            }
        default: /* BACKGROUND_TYPE_NORMAL */
            return pressed ? KEY_STATE_PRESSED : KEY_STATE_NORMAL;
        }
    }

    public static class Spacer extends Key {
        public Spacer(Resources res, KeyboardParams params, KeyboardBuilder.Row row,
                XmlPullParser parser, KeyStyles keyStyles) {
            super(res, params, row, parser, keyStyles);
        }

        /**
         * This constructor is being used only for divider in more keys keyboard.
         */
        public Spacer(KeyboardParams params, Drawable icon, int x, int y, int width, int height) {
            super(params, null, null, icon, Keyboard.CODE_DUMMY, null, x, y, width, height);
        }

        @Override
        public boolean isSpacer() {
            return true;
        }
    }
}


text:
package com.cloudera.util;

import java.util.Properties;

/**
 * OS-specific utility classes
 */
public class OSUtils {

  /*
   * Based on strings form here: http://lopica.sourceforge.net/os.html
   */
  public static boolean isWindowsOS() {
    Properties props = System.getProperties();
    String os = props.get("os.name").toString();
    return os.contains("Windows");
  }
}


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>

	<groupId>com.example</groupId>
	<artifactId>bval10spike01</artifactId>
	<version>0.0.1-SNAPSHOT</version>

	<dependencies>
		<dependency>
			<!-- bval.apache.org/downloads.html -->
			<groupId>org.apache.geronimo.specs</groupId>
			<artifactId>geronimo-validation_1.0_spec</artifactId>
			<version>1.0</version>
		</dependency>
		<dependency>
			<!-- http://beanvalidation.org/1.0/certified/ -->
			<!-- apache bval 0.5 -->
			<groupId>org.apache.bval</groupId>
			<artifactId>org.apache.bval.bundle</artifactId>
			<version>0.5</version>
		</dependency>
		<!-- scope test -->
		<dependency>
			<!-- http://junit.org/ -->
			<!-- Use with Maven -->
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.12</version>
			<scope>test</scope>
		</dependency>
	</dependencies>
</project>