text:
$(function () {

    $(document).on('submit', '#direct-order-form', function (e) {
        e.preventDefault();
        var $directOrderForm = $(this);

        $.ajax({
            url: window.location.href,
            type: 'post',
            data: new FormData(this),
            processData: false,
            contentType: false,
            success: function (response) {
                $directOrderForm.replaceWith(response.view);
                if (response.result == 'success' && window.ga && window.yaCounter27048220) {
                    ga('send', 'event', 'order', 'contacts');
                    yaCounter27048220.reachGoal('contacts');
                }
            }
        });
    });

    // Show mobile navigation
    $(document).on('click', '.show-mobile-nav', function () {
        if (!$(this).hasClass('current-language')) {
            $('body').addClass('open-navigation open-main-nav');
        } else {
            $('body').addClass('open-navigation open-languages-nav');
        }
    });

    // Hide mobile navigation
    $(document).on('click', '.close-mobile-nav', function () {
        $('body').removeClass('open-navigation open-main-nav open-languages-nav');
    });
    $(window).on('resize', function () {
        if (window.matchMedia && window.matchMedia('(min-width: 800px)').matches) {
            $('body').removeClass('open-navigation open-main-nav open-languages-nav');
        }
    });

    //Show hire us
    $(document).on('click', '.hire_us', function () {
        $('body').addClass('open-hire_us');
    });

    //function resize margin position
    function resizePos() {
        return ((window.innerWidth - 915) / 2) - 49.5;
    };

    $(window).resize(function () {
        var windowWidth = resizePos();
        $('.search_button.js-icon-search').css({left: windowWidth, top: '76px'});
    });

    //Show search form
    $(document).on('click', '.search_button', function () {
        if ($(window).width() < 838) {
            $('.search-form-wrap').animate({
                display: 'block',
                width: '100%',
                'height': 'toggle',
                top: '0'
            }, 450, function () {
                $('#search_searchPhrase').focus();
            });
            $('.search_button').prop("disabled", true).css('cursor', 'default');
            var windowWidth = resizePos();
            $('.search_button').addClass('search_button-animate').animate({left: windowWidth, top: '76px'}, 500);
            $('body').addClass('open-search-form');
            setTimeout(function () {
                $('#search-form, #search-results').animate({opacity: '1'}, 500);
            }, 100)
        }
        else {
            $('.search-form-wrap').animate({width: 'toggle', 'height': 'toggle', top: '0'}, 450, function () {
                $('.search_button').toggle();
                $('#search_searchPhrase').focus();
            });
            $('.search_button').prop("disabled", true).css('cursor', 'default');
            var windowWidth = resizePos();
            $('.search_button').addClass('search_button-animate').animate({left: windowWidth, top: '76px'}, 500);
            setTimeout(function () {
                $('body').addClass('open-search-form');
                $('#search-form, #search-results').animate({opacity: '1'}, 500);
            }, 450)
        }

    });

    //Hide search form
    $(document).on('click', '.close-search-form', function () {
        if ($(window).width() < 838) {
            $('body').removeClass('open-search-form');
            $('.search-form-wrap').animate({width: '100%', 'height': 'toggle', top: '92px'}, 450);
            $('#search-form,#search-results').animate({opacity: '0'}, 100);
            $('.search_button').animate({left: '0px', top: '92px'}, 500, function () {
                $('.search_button').removeClass('search_button-animate');
                $('.search_button').prop("disabled", false).css('cursor', 'pointer');
            });
        }
        else {
            $('body').removeClass('open-search-form');
            $('.search_button').toggle();
            $('.search-form-wrap').animate({width: 'toggle', 'height': 'toggle', top: '92px'}, 450);
            $('#search-form,#search-results').animate({opacity: '0'}, 100);
            $('.search_button').animate({left: '0px', top: '92px'}, 500, function () {
                $('.search_button').removeClass('search_button-animate');
                $('.search_button').prop("disabled", false).css('cursor', 'pointer');
            });
        }
    });

    var yearsCnt = $('.years-count'),
        startPos;
    var yearList = $('.year-slider-wrapp li');

    function updateYear(value) {
        $('#view-year').html(value)
    }

    if ($('#year-slider').length) {
        $("#year-slider").slider({
            min: 0,
            max: yearList.length - 1,
            value: yearList.length - 1,
            step: 1,
            range: 'min',
            start: function (event, ui) {
                startPos = $(yearList[ui.value]).data('val');
            },
            change: function (event, ui) {
                counter(startPos, $(yearList[ui.value]).data('val'));
                updateYear($(yearList[ui.value]).data('text'));
            }
        });
        $('#year-slider').draggable(); // Enable toush dragging
    }

    function counter(start, end) {
        var i = start;
        var t = setInterval(function () {
            if (i == end) {
                clearInterval(t);
            } else if (i > end) {
                i--
            } else {
                i++
            }
            yearsCnt.html(i);
        }, 20);
    }

    var filter;
    var teamList = $('.avatar'),
        teamCnt = $('.team-list'),
        interestsList = $('.interests a');

    if ($('.team-list').length) {
        (function () {
            interestsList.click(function () {

                if ($(this).hasClass('active')) {
                    toDefaultState();
                } else {
                    teamCnt.addClass('active-filter');
                    interestsList.removeClass('active');
                    $(this).addClass('active');
                    filter = $(this).data('filter');

                    if (filter === "drinks") {
                        teamCnt.addClass('show-drinks');
                        showItems();
                    } else {
                        teamCnt.removeClass('show-drinks');
                        teamList.each(function (index, value) {
                            var el = $(value);
                            var interests = eval(el.data('interests'));

                            if (el.hasClass('disabled')) {
                                if ($.inArray(filter, interests) >= 0) {
                                    el.removeClass('disabled').animate({opacity: '1'}, 0);
                                } else {
                                    el.addClass('disabled').animate({opacity: '0.2'}, 0);
                                }
                            } else {
                                if ($.inArray(filter, interests) < 0) {
                                    el.addClass('disabled').animate({opacity: '0.2'}, 0);
                                } else {
                                    el.removeClass('disabled').animate({opacity: '1'}, 0);
                                }
                            }
                        });
                    }
                }
            });

            $(document).click(function (e) {
                if ($.inArray(e.target, interestsList) < 0) {
                    toDefaultState();
                }
            });

            function toDefaultState() {
                teamCnt.removeClass('show-drinks').removeClass('active-filter');
                showItems();
                interestsList.removeClass('active');
            }

            function showItems() {
                teamList.each(function (index, value) {
                    $(value).stop(true, true).animate({opacity: '1'}, 0);
                });
            }
        })();

    }
    ;

    var projectSlider = false,
        projectSliderCnt = $('.project-slider');

    if (projectSliderCnt.length) {
        projectSlider = new Sly(projectSliderCnt, {
            horizontal: 1,
            itemNav: 'basic',
            smart: 1,
            mouseDragging: 1,
            touchDragging: 1,
            releaseSwing: 0,
            activateOn: 'mousedown',
            sweengSpeed: 0.8,
            startAt: 0,
            scrollBy: 0,
            speed: 300,
            pagesBar: '.slider-pages',
            pageBuilder: function (index) {
                return '';
            },
            activatePageOn: 'click',

            // Buttons
            prev: '.prev-slide',
            next: '.next-slide'
        });

        projectSlider.init();

        $(window).load(function () {
            projectSliderCnt.height(projectSliderCnt.find('li.active img').height()).addClass('loaded');
        });

        if (projectSlider.items.length > 1) {
            $('.project-slider-cnt').removeClass('no-controls');
        }

        projectSlider.on('moveStart', function () {
            projectSliderCnt.addClass('moving');
        });

        projectSlider.on('load', function () {
            disableNavigation();
        });

        projectSlider.on('moveEnd', function () {
            projectSliderCnt.removeClass('moving');
            projectSlider.activate(projectSlider.rel.activePage);
            projectSliderCnt.height(projectSliderCnt.find('li.active img').height());

            // Hide navigation button
            disableNavigation();
        });

        projectSlider.on('change', function () {
            projectSliderCnt.height(projectSliderCnt.find('li.active img').height());
        });

        var $sliderWrapper = $('.project-slider-cnt');

        function disableNavigation() {
            $sliderWrapper.removeClass('hide-next-button hide-prev-button');
            if (projectSlider.rel.activePage == 0) {
                $sliderWrapper.addClass('hide-prev-button');
            } else if (projectSlider.rel.activePage == projectSlider.items.length - 1) {
                $sliderWrapper.addClass('hide-next-button');
            }
        }

        function resizeSliderItems(cnt) {
            sliderWidth = cnt.width();
            slides.each(function (index, value) {
                $(value).css({width: sliderWidth + 'px'});
                $('.project-slider').css({width: sliderWidth + 'px'});
            });
            projectSlider.reload();
        }

        var forSliderWidth = $('.project-info'),
            slides = projectSliderCnt.find('li');

        // reload project slider when mediaqueries breakpoint
        if (!$('html').hasClass('lt-ie10')) {
            (function () {
                var teamList = $('.team-list');
                enquire.register("screen and (max-width:840px)", {
                    match: function () {
                        var sliderWidth = $('.project-info').width();
                        resizeSliderItems(forSliderWidth);

                        $(window).bind('resize', function () {
                            resizeSliderItems(forSliderWidth);
                        });
                    },
                    unmatch: function () {
                        $(window).unbind('resize');
                        projectSliderCnt[0].style.width = '';
                        slides.each(function (idnex, value) {
                            value.style.width = '';
                        });
                    }
                }).register("screen and (max-width:620px)", {
                    match: function () {
                        $('.work-on-project h2').bind('click', function () {
                            teamList.slideToggle(100);
                        });
                        teamList.hide();
                    },
                    unmatch: function () {
                        $('.work-on-project h2').unbind('click');
                        teamList.show();
                    }
                });
                $(window).on("resize orientationchange", function () {
                    projectSlider.reload();
                });
            })();
        }
    }

    // Set fixed slider buttons
    var $sliderCnt = $('.project-slider-cnt');
    if ($sliderCnt.length) {
        var $scrollingCnt = ( navigator.userAgent.match(/(iPad|iPhone|iPod|Macintosh|Android)/g) ? $('body') : $('html') ),
            $fixedNav = $('.fixed-nav'),
            middleScreenPoint = $(window).height() / 2 - $sliderCnt.offset().top,
            leftSlideHeight;

        $(window).resize(function () {
            middleScreenPoint = $(window).height() / 2 - $('.project-slider-cnt').offset().top;
        });

        window.addEventListener("scroll", function (event) {
            setButtonsPosition();
        });

        $(document).on('click', '.fix-prev-slide', function () {
            $('.slider-nav .prev-slide').trigger('click');
            $scrollingCnt.animate({scrollTop: 0}, 300);
            //$scrollingCnt.scrollTop(0);
        });

        $(document).on('click', '.fix-next-slide', function () {
            $('.slider-nav .next-slide').trigger('click');
            $scrollingCnt.animate({scrollTop: 0}, 300);
        });

        function setButtonsPosition() {
            leftSlideHeight = $sliderCnt.height() - ($scrollingCnt.scrollTop() - $sliderCnt.offset().top) - middleScreenPoint;

            if ($scrollingCnt.scrollTop() >= $sliderCnt.offset().top) {
                $sliderCnt.addClass('show-fixed-nav');
            } else {
                $sliderCnt.removeClass('show-fixed-nav');
            }

            if (leftSlideHeight >= 280) {
                $fixedNav[0].style.top = $scrollingCnt.scrollTop() + middleScreenPoint + 'px';
            }
        };
        // Add navigation from keyboard
        $(window).on('keyup', function (e) {
            if (e.keyCode == 37) {
                $('.fix-prev-slide').trigger('click');
            } else if (e.keyCode == 39) {
                $('.fix-next-slide').trigger('click');
            }
        });
    }

    //enquire.register("screen and (max-width: 670px)", {
    //    match: function(){
    //        var promoBannerCnt = $('.promo-banner-wrapper');
    //        if(promoBannerCnt.length) {
    //            var bannerImg = promoBannerCnt.find('.img-wrapper');
    //            promoBannerCnt.append(bannerImg);
    //        }
    //    },
    //    unmatch: function(){
    //        var promoBannerCnt = $('.promo-banner-wrapper');
    //        if(promoBannerCnt.length) {
    //            var bannerImg = promoBannerCnt.find('.img-wrapper');
    //            promoBannerCnt.prepend(bannerImg);
    //        }
    //    }
    //});

    $(document).on("change", '.file-input input', function () {
        var fullPath = $(this).val();
        if (fullPath == '' || fullPath == ' ') {
            fullPath = ' ';
            $(this).closest('.file-input').find('.filesize').fadeIn(700);
        } else {
            $(this).closest('.file-input').find('.filesize').fadeOut(700);
        }
        ;
        var pathArray = fullPath.split(/[/\\]/);
        $(this).closest('.file-input').find('.filename').html(pathArray[pathArray.length - 1]);
    });

    /*Services page*/
    if ($(".link-more").length) {
        $(".link-more").click(function () {
            $(".detailed-text").toggle();
        });
    }

    if ($("#feedback-form").length) {

        $('a[href="#feedback-form"]').click(function () {
            var el = $(this).attr('href');
            $('html, body').animate({
                scrollTop: $(el).offset().top
            }, 1000);
            return false;
        });
    }

    if ($("#scroll").length) {

        $('a[href="#scroll"]').click(function () {
            var el = $(this).attr('href');
            $('html, body').animate({
                scrollTop: $(el).offset().top + 34
            }, 1000);
            return false;
        });
    }

    if ($("#web-dev").length) {
        $('a[href="#web-dev"]').click(function () {
            $(".detailed-text").show();
            var el = $(this).attr('href');
            $('html, body').animate({
                scrollTop: $(el).offset().top
            }, 1000);
            return false;
        });
    }

    if ($("#feedback-line").length) {
        $('a[href="#feedback-line"]').click(function () {
            var el = $(this).attr('href');
            $('html, body').animate({
                scrollTop: $(el).offset().top
            }, 1000);
            return false;
        });
    }

    if ($(".project-cell").length) {
        var a = $(".project-cell:eq(2)").height();
        $(".container_load").height(a);
        $(window).resize(function () {
            a = $(".project-cell:eq(2)").height();
            $(".container_load").height(a);
        });
    }

    /*
     * form animation
     */
    var formDelay = 3000;

    /*
     * form validation
     */
    if ($('#feedback-form').length) {
        $('#feedback-form').validate({
            rules: {
                'name': {
                    required: true,
                    minlength: 3
                },
                'email': {
                    required: true,
                    minlength: 3
                },
                'message': {
                    required: true,
                    minlength: 30
                }
            },
            messages: {
                'name': {
                    required: "Пожалуйста, введите ваше имя",
                    minlength: jQuery.validator.format("Введите имя не меньше 3 символов")
                },
                'email': {
                    required: "Пожалуйста, введите адрес вашей эл.почты",
                    email: "Ваша эл.адрес должен быть формата name@domain.com"
                },
                'message': {
                    required: "Пожалуйста, введите сообщение",
                    minlength: jQuery.validator.format("Введите сообщение не меньше 30 символов")
                }
            },
            errorPlacement: function (label, element) {
                label.addClass('error-pad');
                label.insertAfter(element);
            },
            wrapper: 'div',
            debug: true,
            submitHandler: function () {
                $('#feedback-form').find('.form-pad').animate({opacity: 0}, 300).delay(formDelay).animate({opacity: 1}, 300);
                $('#feedback-form').find('.form-success').fadeIn(300).delay(formDelay).fadeOut(300);
                return false;
            }
        });

        $.validator.addClassRules({
            name: {
                required: true,
                minlength: 3
            },
            email: {
                required: true,
                minlength: 3
            },
            messageText: {
                required: true,
                minlength: 30
            }
        });
    }

    $(function () {
        $(window).scroll(function () {
            if ($(this).scrollTop() > 200) {
                $('.scroll-to-top').fadeIn();
            } else {
                $('.scroll-to-top').fadeOut();
            }

            if ($(window).width() <= 320) {
                $('.scroll-to-top').hide();
                return false;
            }
        });
        $(".scroll-to-top").click(function () {
            $('body,html').animate({
                scrollTop: 0
            }, 800);
            return false;
        });
    });

    function fixedButtonUp() {
        if ($('.scroll-to-top').length) {
            if ($('.scroll-to-top').offset().top + $('.scroll-to-top').height() >= $('.footer').offset().top - 69) {
                $('.scroll-to-top').addClass('fixed-scroll-top');
            }

            if ($(document).scrollTop() + window.innerHeight < $('.footer').offset().top) {
                $('.scroll-to-top').removeClass('fixed-scroll-top');
            }
        }
    }

    function fixedHireUs() {
        if ($('#hire_us-js').length) {
            if ($('#hire_us-js').offset().top + $('.hire_us').height() >= $('.footer').offset().top - 186) {
                $('#hire_us-js').addClass('fixed-hire-us');
            }

            if ($(document).scrollTop() + window.innerHeight < $('.footer').offset().top) {
                $('#hire_us-js').removeClass('fixed-hire-us');
            }
        }
    }

    $(document).scroll(function () {
        fixedButtonUp();
        fixedHireUs();
    });

    function placeholderReplace() {
        if ($(window).width() < 540) {
            $("#subscribe_email").attr("placeholder", subscribeShortText);
        } else {
            $("#subscribe_email").attr("placeholder", subscribeFullText);
        }
    }

    placeholderReplace();
    $(window).resize(function () {
        placeholderReplace();
    });

    autosize(document.querySelectorAll('#order_promotion_message'));
});


text:
local assert = assert
local floor = math.floor
local max = math.max
local sub = string.sub
local type = type

-----------
-- Imports
-----------
local draw = love.graphics.draw
local RestoreFont = graphics.RestoreFont
local setFont = love.graphics.setFont
local SuperCons = class.SuperCons
local TypeName = loveclasses.TypeName

----------------------
-- Unique member keys
----------------------
local _object = {}

-------------------------
-- Font class definition
-------------------------
class.Define("Font", function(MT)
	-- Lookups are no-ops --
	MT.SetLookupKey = funcops.NoOp

	-- String draw function
	------------------------
	local function Draw (_, str, x, y)
		draw(str, x, y)
	end

	-- str: String to draw
	-- x, y: String position
	-- props: Optional draw properties
	-----------------------------------
	function MT:__call (str, x, y, props)
		local font = self[_object]

		if font then
			setFont(font)

			self:WithProperties(props or _object, Draw, str, x, y + font:getHeight())

			RestoreFont()
		end
	end

	-- i, j: Start and end of range
	-- pos: Position to find
	-- Returns: Position within string
	-----------------------------------
	local function FindInRange (font, str, i, j, pos)
		-- If the range has been narrowed enough, just iterate to find the final result.
		if j - i <= 5 then
			local len = font:getWidth(sub(str, 1, i - 1))

			while len < pos do
				i, len = i + 1, len + font:getWidth(sub(str, i, i))
			end

			return max(i - 2, 0)
		end

		-- Otherwise, figure out which half of the range the position is in and continue
		-- the search in that half.
		local mid = floor((i + j) / 2)
		local midlen = font:getWidth(sub(str, 1, mid))

		if pos >= midlen then
			i = mid
		else
			j = mid - 1
		end

		return FindInRange(font, str, i, j, pos)
	end

	-- str: Reference string
	-- pos: Position relative to string edge
	-- Returns: Relative position within string
	--------------------------------------------
	function MT:GetIndexAtOffset (str, pos)
		assert(type(str) == "string", "Invalid string")
		assert(type(pos) == "number", "Invalid position")

		-- Clamp the position to 0 if to the left of the string.
		local font = self[_object]

		if pos < 0 or not font then
			return 0

		-- Otherwise, measure within the string. Clamp to the string length if the position
		-- is to the right of the string.
		else
			local len = font:getWidth(str)

			if pos > len then
				return #str
			end

			return FindInRange(font, str, 1, #str, pos)
		end
	end

	-- F: Font handle
	-- with_padding: If true, include line padding
	-- Returns: String's height with the font
	-----------------------------------------------
	local function GetHeight (F, str, with_padding)
		assert(type(str) == "string", "Invalid string")

		local font, h = F[_object], 0

		if font then
			h = font:getHeight()

			if with_padding then
				h = h * font:getLineHeight()
			end
		end

		return h
	end

	-- F: Font handle
	-- Returns: String's width with the font
	-----------------------------------------
	local function GetWidth (F, str)
		assert(type(str) == "string", "Invalid string")

		local font = F[_object]

		return font and font:getWidth(str) or 0
	end

	-- Dimensions --
	MT.GetHeight, MT.GetWidth = GetHeight, GetWidth

	-- Adjusts coordinate for alignment
	-- dim: Box dimension
	-- sdim: String dimension
	-- how: How to align in this dimension
	-- Returns: Coordinate delta
	---------------------------------------
	local function Align (dim, sdim, how)
		if how == "center" then
			return (dim - sdim) / 2
		elseif how then
			return dim - sdim
		else
			return 0
		end
	end

	-- Gets a string's alignment-based offsets
	-- str: String to align
	-- w, h: Extents of alignment box
	-- halign, valign: Alignment options
	-- Returns: Coordinate deltas
	-------------------------------------------
	function MT:GetAlignmentOffsets (str, w, h, halign, valign)
		local dx = Align(w, GetWidth(self, str), halign ~= "left" and halign)
		local dy = Align(h, GetHeight(self, str), valign ~= "top" and valign)

		return dx, dy
	end

	-- Sets the font's object
	--------------------------
	function MT:SetObject (object)
		assert(object == nil or TypeName(object) == "Font", "Unsupported object type")

		self[_object] = object
	end
end,

-- Constructor
-- object: Object to set
-------------------------
function(F, object)
	SuperCons(F, "GraphicBase")

	F:SetObject(object)
end, { base = "GraphicBase" })

redpajama_set_name: RedPajamaGithub


text:
@class GTweet;

@interface GUser : GManagedObject

@property (nonatomic, retain) NSNumber * identifier;
@property (nonatomic, retain) NSString * text;
@property (nonatomic, retain) NSString * name;
@property (nonatomic, retain) NSString * screenName;
@property (nonatomic, retain) NSString * imageLink;
@property (nonatomic, retain) NSSet *tweets;
@property (nonatomic, retain) NSSet *retweets;
@end

@interface GUser (CoreDataGeneratedAccessors)

- (void)addTweetsObject:(GTweet *)value;
- (void)removeTweetsObject:(GTweet *)value;
- (void)addTweets:(NSSet *)values;
- (void)removeTweets:(NSSet *)values;

- (void)addRetweetsObject:(GTweet *)value;
- (void)removeRetweetsObject:(GTweet *)value;
- (void)addRetweets:(NSSet *)values;
- (void)removeRetweets:(NSSet *)values;

+ (NSFetchRequest *)fetchRequestForTwitterUserWithIdentifier:(NSNumber *)identifier;

+ (id)twitterUserWithIdentifier:(NSNumber *)identifier
         inManagedObjectContext:(NSManagedObjectContext *)context;

@end


text:
export function circle(ctx, {points, radius = 1, color = "#000"}) {
    // assert there is only one point?
    ctx.beginPath()
    ctx.arc(points[0].x, points[0].y, radius, 0, 2 * Math.PI)
    ctx.fillStyle = color
    ctx.fill()
}

export function line(ctx, {points, color = "#000"}) {
    // assert there are only two points?
    ctx.beginPath()
    ctx.moveTo(points[0].x, points[0].y)
    ctx.lineTo(points[1].x, points[1].y)
    ctx.strokeStyle = color
    ctx.stroke()
}


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

<title>Uses of Class au.com.scds.chats.dom.module.activity.Provider</title>
<meta name="date" content="2016-02-12">
<link rel="stylesheet" type="text/css" href="../../../../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Uses of Class
au.com.scds.chats.dom.module.activity.Provider

Packages that use Provider

Package
Description

au.com.scds.chats.dom.module.activity

Uses of Provider in au.com.scds.chats.dom.module.activity

Methods in au.com.scds.chats.dom.module.activity that return Provider

Modifier and Type
Method and Description

Provider
Providers.createProvider(java.lang.String name)

Provider
ActivityEvent.getProvider()

Provider
Activity.getProvider()

Methods in au.com.scds.chats.dom.module.activity that return types with arguments of type Provider

Modifier and Type
Method and Description

java.util.List<Provider>
Activity.choicesProvider()

java.util.List<Provider>
Providers.listAllProviders()

Methods in au.com.scds.chats.dom.module.activity with parameters of type Provider

Modifier and Type
Method and Description

void
Activity.setProvider(Provider provider)

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes


text:
// @COPYRIGHT@
// Licensed under MIT license (LICENSE.txt)

// clxx/unit.t.h

/** // doc: clxx/unit.t.h {{{
 * \file clxx/unit.t.h
 * \todo Write documentation
 */ // }}}
#ifndef CLXX_UNIT_T_H_INCLUDED
#define CLXX_UNIT_T_H_INCLUDED

#include <cxxtest/TestSuite.h>
#include <clxx/unit.hpp>

namespace clxx { class unit_test_suite; }

/** // doc: class clxx::unit_test_suite {{{
 * \todo Write documentation
 */ // }}}
class clxx::unit_test_suite : public CxxTest::TestSuite
{
public:
  /** // doc: test__foo() {{{
   * \todo Write documentation
   */ // }}}
  void test__foo( )
  {
    TS_ASSERT(true);
  }
};

#endif /* CLXX_UNIT_T_H_INCLUDED */
// vim: set expandtab tabstop=2 shiftwidth=2:
// vim: set foldmethod=marker foldcolumn=4:


text:
using System;
using System.Collections.Generic;
using System.Text;

using NUnit.Framework;

using ZXing.Aztec.Internal;
using ZXing.Common;

namespace ZXing.Aztec.Test
{
   /// <summary>
   /// Tests for the Detector
   /// @author Frank Yellin
   /// </summary>
   public class DetectorTest
   {
      private static readonly Encoding LATIN_1 = Encoding.GetEncoding("ISO-8859-1");

      [Test]
      public void testErrorInParameterLocatorZeroZero()
      {
         // Layers=1, CodeWords=1.  So the parameter info and its Reed-Solomon info
         // will be completely zero!
         testErrorInParameterLocator("X");
      }

      [Test]
      public void testErrorInParameterLocatorCompact()
      {
         testErrorInParameterLocator("This is an example Aztec symbol for Wikipedia.");
      }

      [Test]
      public void testErrorInParameterLocatorNotCompact()
      {
         const string alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYabcdefghijklmnopqrstuvwxyz";
         testErrorInParameterLocator(alphabet + alphabet + alphabet);
      }

      // Test that we can tolerate errors in the parameter locator bits
      private static void testErrorInParameterLocator(String data)
      {
         var aztec = Internal.Encoder.encode(LATIN_1.GetBytes(data), 25, Internal.Encoder.DEFAULT_AZTEC_LAYERS);
         var random = new Random(aztec.Matrix.GetHashCode()); // pseudo-random, but deterministic
         var layers = aztec.Layers;
         var compact = aztec.isCompact;
         var orientationPoints = getOrientationPoints(aztec);
         foreach (bool isMirror in new[] {false, true})
         {
            foreach (BitMatrix matrix in getRotations(aztec.Matrix))
            {
               // Systematically try every possible 1- and 2-bit error.
               for (int error1 = 0; error1 < orientationPoints.Count; error1++)
               {
                  for (int error2 = error1; error2 < orientationPoints.Count; error2++)
                  {
                     BitMatrix copy = isMirror ? transpose(matrix) : clone(matrix);
                     copy.flip(orientationPoints[error1].X, orientationPoints[error1].Y);
                     if (error2 > error1)
                     {
                        // if error2 == error1, we only test a single error
                        copy.flip(orientationPoints[error2].X, orientationPoints[error2].Y);
                     }
                     // The detector doesn't seem to work when matrix bits are only 1x1.  So magnify.
                     AztecDetectorResult r = new Detector(makeLarger(copy, 3)).detect(isMirror);
                     Assert.IsNotNull(r);
                     Assert.AreEqual(r.NbLayers, layers);
                     Assert.AreEqual(r.Compact, compact);
                     DecoderResult res = new Internal.Decoder().decode(r);
                     Assert.AreEqual(data, res.Text);
                  }
               }
               // Try a few random three-bit errors;
               for (int i = 0; i < 5; i++)
               {
                  BitMatrix copy = clone(matrix);
                  ISet<int> errors = new SortedSet<int>();
                  while (errors.Count < 3)
                  {
                     // Quick and dirty way of getting three distinct integers between 1 and n.
                     errors.Add(random.Next(orientationPoints.Count));
                  }
                  foreach (int error in errors)
                  {
                     copy.flip(orientationPoints[error].X, orientationPoints[error].Y);
                  }
                  var result = new Detector(makeLarger(copy, 3)).detect(false);
                  if (result != null)
                  {
                     Assert.Fail("Should not reach here");
                  }
               }
            }
         }
      }

      // Zooms a bit matrix so that each bit is factor x factor
      private static BitMatrix makeLarger(BitMatrix input, int factor)
      {
         var width = input.Width;
         var output = new BitMatrix(width*factor);
         for (var inputY = 0; inputY < width; inputY++)
         {
            for (var inputX = 0; inputX < width; inputX++)
            {
               if (input[inputX, inputY])
               {
                  output.setRegion(inputX*factor, inputY*factor, factor, factor);
               }
            }
         }
         return output;
      }

      // Returns a list of the four rotations of the BitMatrix.
      private static List<BitMatrix> getRotations(BitMatrix matrix0)
      {
         BitMatrix matrix90 = rotateRight(matrix0);
         BitMatrix matrix180 = rotateRight(matrix90);
         BitMatrix matrix270 = rotateRight(matrix180);
         return new List<BitMatrix> {matrix0, matrix90, matrix180, matrix270};
      }

      // Rotates a square BitMatrix to the right by 90 degrees
      private static BitMatrix rotateRight(BitMatrix input)
      {
         var width = input.Width;
         var result = new BitMatrix(width);
         for (var x = 0; x < width; x++)
         {
            for (var y = 0; y < width; y++)
            {
               if (input[x, y])
               {
                  result[y, width - x - 1] = true;
               }
            }
         }
         return result;
      }

      // Returns the transpose of a bit matrix, which is equivalent to rotating the
      // matrix to the right, and then flipping it left-to-right
      private static BitMatrix transpose(BitMatrix input)
      {
         var width = input.Width;
         var result = new BitMatrix(width);
         for (var x = 0; x < width; x++)
         {
            for (var y = 0; y < width; y++)
            {
               if (input[x, y])
               {
                  result[y, x] = true;
               }
            }
         }
         return result;
      }

      private static BitMatrix clone(BitMatrix input)
      {
         var width = input.Width;
         var result = new BitMatrix(width);
         for (var x = 0; x < width; x++)
         {
            for (var y = 0; y < width; y++)
            {
               if (input[x, y])
               {
                  result[x, y] = true;
               }
            }
         }
         return result;
      }

      private static List<Detector.Point> getOrientationPoints(AztecCode code)
      {
         var center = code.Matrix.Width/2;
         var offset = code.isCompact ? 5 : 7;
         var result = new List<Detector.Point>();
         for (var xSign = -1; xSign <= 1; xSign += 2)
         {
            for (var ySign = -1; ySign <= 1; ySign += 2)
            {
               result.Add(new Detector.Point(center + xSign*offset, center + ySign*offset));
               result.Add(new Detector.Point(center + xSign*(offset - 1), center + ySign*offset));
               result.Add(new Detector.Point(center + xSign*offset, center + ySign*(offset - 1)));
            }
         }
         return result;
      }

      public static void Shuffle<T>(IList<T> list, Random random)
      {
         int n = list.Count;
         while (n > 1)
         {
            n--;
            int k = random.Next(n + 1);
            T value = list[k];
            list[k] = list[n];
            list[n] = value;
         }
      }
   }
}


text:
Capybara::SpecHelper.spec '#choose' do
  before do
    @session.visit('/form')
  end

  it 'should choose a radio button by id' do
    @session.choose('gender_male')
    @session.click_button('awesome')
    expect(extract_results(@session)['gender']).to eq('male')
  end

  it 'ignores readonly attribute on radio buttons' do
    @session.choose('gender_both')
    @session.click_button('awesome')
    expect(extract_results(@session)['gender']).to eq('both')
  end

  it 'should choose a radio button by label' do
    @session.choose('Both')
    @session.click_button('awesome')
    expect(extract_results(@session)['gender']).to eq('both')
  end

  it 'should work without a locator string' do
    @session.choose(id: 'gender_male')
    @session.click_button('awesome')
    expect(extract_results(@session)['gender']).to eq('male')
  end

  it 'should be able to choose self when no locator string specified' do
    rb = @session.find(:id, 'gender_male')
    rb.choose
    @session.click_button('awesome')
    expect(extract_results(@session)['gender']).to eq('male')
  end

  it 'casts to string' do
    @session.choose('Both')
    @session.click_button(:awesome)
    expect(extract_results(@session)['gender']).to eq('both')
  end

  context "with a locator that doesn't exist" do
    it 'should raise an error' do
      msg = /Unable to find radio button "does not exist"/
      expect do
        @session.choose('does not exist')
      end.to raise_error(Capybara::ElementNotFound, msg)
    end
  end

  context 'with a disabled radio button' do
    it 'should raise an error' do
      expect do
        @session.choose('Disabled Radio')
      end.to raise_error(Capybara::ElementNotFound)
    end
  end

  context 'with :exact option' do
    it 'should accept partial matches when false' do
      @session.choose('Mal', exact: false)
      @session.click_button('awesome')
      expect(extract_results(@session)['gender']).to eq('male')
    end

    it 'should not accept partial matches when true' do
      expect do
        @session.choose('Mal', exact: true)
      end.to raise_error(Capybara::ElementNotFound)
    end
  end

  context 'with `option` option' do
    it 'can check radio buttons by their value' do
      @session.choose('form[gender]', option: 'male')
      @session.click_button('awesome')
      expect(extract_results(@session)['gender']).to eq('male')
    end

    it 'should alias `:with` option' do
      @session.choose('form[gender]', with: 'male')
      @session.click_button('awesome')
      expect(extract_results(@session)['gender']).to eq('male')
    end

    it 'should raise an error if option not found' do
      expect do
        @session.choose('form[gender]', option: 'hermaphrodite')
      end.to raise_error(Capybara::ElementNotFound)
    end
  end

  context 'with hidden radio buttons' do
    context 'with Capybara.automatic_label_click == true' do
      around do |spec|
        old_click_label, Capybara.automatic_label_click = Capybara.automatic_label_click, true
        spec.run
        Capybara.automatic_label_click = old_click_label
      end

      it 'should select by clicking the label if available' do
        @session.choose('party_democrat')
        @session.click_button('awesome')
        expect(extract_results(@session)['party']).to eq('democrat')
      end

      it 'should select self by clicking the label if no locator specified' do
        cb = @session.find(:id, 'party_democrat', visible: :hidden)
        cb.choose
        @session.click_button('awesome')
        expect(extract_results(@session)['party']).to eq('democrat')
      end

      it 'should raise error if not allowed to click label' do
        expect { @session.choose('party_democrat', allow_label_click: false) }.to raise_error(Capybara::ElementNotFound, /Unable to find visible radio button "party_democrat"/)
      end
    end
  end

  it 'should return the chosen radio button' do
    el = @session.find(:radio_button, 'gender_male')
    expect(@session.choose('gender_male')).to eq el
  end
end


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="shortcut icon" href="assets/ico/favicon.ico">

    <title>VisKo</title>

    <link href="dist/css/bootstrap.min.css" rel="stylesheet">

    <link href="dashboard.css" rel="stylesheet">

		<?php include "header.php" ?>

          <?php include 'nav.php'; ?>

FORGOT PASSWORD
<?php if(!isset($_SESSION))
            {
                session_start();
            } ; ?>

				<form role="form" method="post" action="emailForgot.php">

						Email Address
						<input type="email" class="form-control" id="email" name="email" placeholder="Enter email">
						Confirm Email Address
						<input type="email" class="form-control" id="confirmemail" name="confirmemail" placeholder="Confirm email">

					<button type="submit" class="btn btn-default">Submit</button>
				</form>


text:
package org.apache.openwhisk.standalone

import scala.util.control.NonFatal

case class DockerVersion(major: Int, minor: Int, patch: Int) extends Ordered[DockerVersion] {
  import scala.math.Ordered.orderingToOrdered
  def compare(that: DockerVersion): Int =
    (this.major, this.minor, this.patch) compare (that.major, that.minor, that.patch)

  override def toString = s"$major.$minor.$patch"
}

object DockerVersion {
  implicit val ord: Ordering[DockerVersion] = Ordering.by(unapply)
  private val pattern = ".*Docker version ([\\d.]+).*".r

  def apply(str: String): DockerVersion = {
    try {
      val parts = if (str != null && str.nonEmpty) str.split('.') else Array[String]()
      val major = if (parts.length >= 1) parts(0).toInt else 0
      val minor = if (parts.length >= 2) parts(1).toInt else 0
      val patch = if (parts.length >= 3) parts(2).toInt else 0
      DockerVersion(major, minor, patch)
    } catch {
      case NonFatal(_) => throw new IllegalArgumentException(s"bad docker version $str")
    }
  }

  def fromVersionCommand(str: String): DockerVersion = {
    val pattern(version) = str
    apply(version)
  }
}


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

<title>The C language interface to SQLite Version 2</title>

<meta http-equiv="content-type" content="text/html; charset=UTF-8">

Small. Fast. Reliable.
Choose any three.

    About
    Sitemap
    Documentation
    Download
    License
    News
    Developers
    Support

The C language interface to SQLite Version 2

The SQLite library is designed to be very easy to use from
a C or C++ program.  This document gives an overview of the C/C++
programming interface.

1.0 The Core API

The interface to the SQLite library consists of three core functions,
one opaque data structure, and some constants used as return values.
The core interface is as follows:

typedef struct sqlite sqlite;
#define SQLITE_OK           0   /* Successful result */

sqlite *sqlite_open(const char *dbname, int mode, char **errmsg);

void sqlite_close(sqlite *db);

int sqlite_exec(
  sqlite *db,
  char *sql,
  int (*xCallback)(void*,int,char**,char**),
  void *pArg,
  char **errmsg
);

The above is all you really need to know in order to use SQLite
in your C or C++ programs.  There are other interface functions
available (and described below) but we will begin by describing
the core functions shown above.

1.1 Opening a database

Use the sqlite_open function to open an existing SQLite
database or to create a new SQLite database.  The first argument
is the database name.  The second argument is intended to signal
whether the database is going to be used for reading and writing
or just for reading.  But in the current implementation, the
second argument to sqlite_open is ignored.
The third argument is a pointer to a string pointer.
If the third argument is not NULL and an error occurs
while trying to open the database, then an error message will be
written to memory obtained from malloc() and *errmsg will be made
to point to this error message.  The calling function is responsible
for freeing the memory when it has finished with it.

The name of an SQLite database is the name of a file that will
contain the database.  If the file does not exist, SQLite attempts
to create and initialize it.  If the file is read-only (due to
permission bits or because it is located on read-only media like
a CD-ROM) then SQLite opens the database for reading only.  The
entire SQL database is stored in a single file on the disk.  But
additional temporary files may be created during the execution of
an SQL command in order to store the database rollback journal or
temporary and intermediate results of a query.

The return value of the sqlite_open function is a
pointer to an opaque sqlite structure.  This pointer will
be the first argument to all subsequent SQLite function calls that
deal with the same database.  NULL is returned if the open fails
for any reason.

1.2 Closing the database

To close an SQLite database, call the sqlite_close
function passing it the sqlite structure pointer that was obtained
from a prior call to sqlite_open.
If a transaction is active when the database is closed, the transaction
is rolled back.

1.3 Executing SQL statements

The sqlite_exec function is used to process SQL statements
and queries.  This function requires 5 parameters as follows:

A pointer to the sqlite structure obtained from a prior call
       to sqlite_open.

A null-terminated string containing the text of one or more
       SQL statements and/or queries to be processed.

A pointer to a callback function which is invoked once for each
       row in the result of a query.  This argument may be NULL, in which
       case no callbacks will ever be invoked.

A pointer that is forwarded to become the first argument
       to the callback function.

A pointer to an error string.  Error messages are written to space
       obtained from malloc() and the error string is made to point to
       the malloced space.  The calling function is responsible for freeing
       this space when it has finished with it.
       This argument may be NULL, in which case error messages are not
       reported back to the calling function.

The callback function is used to receive the results of a query.  A
prototype for the callback function is as follows:

int Callback(void *pArg, int argc, char **argv, char **columnNames){
  return 0;
}

The first argument to the callback is just a copy of the fourth argument
to sqlite_exec  This parameter can be used to pass arbitrary
information through to the callback function from client code.
The second argument is the number of columns in the query result.
The third argument is an array of pointers to strings where each string
is a single column of the result for that record.  Note that the
callback function reports a NULL value in the database as a NULL pointer,
which is very different from an empty string.  If the i-th parameter
is an empty string, we will get:

argv[i][0] == 0

But if the i-th parameter is NULL we will get:

argv[i] == 0

The names of the columns are contained in first argc
entries of the fourth argument.
If the SHOW_DATATYPES pragma
is on (it is off by default) then
the second argc entries in the 4th argument are the datatypes
for the corresponding columns.

If the
EMPTY_RESULT_CALLBACKS pragma is set to ON and the result of
a query is an empty set, then the callback is invoked once with the
third parameter (argv) set to 0.  In other words

argv == 0

The second parameter (argc)
and the fourth parameter (columnNames) are still valid
and can be used to determine the number and names of the result
columns if there had been a result.
The default behavior is not to invoke the callback at all if the
result set is empty.

The callback function should normally return 0.  If the callback
function returns non-zero, the query is immediately aborted and
sqlite_exec will return SQLITE_ABORT.

1.4 Error Codes

The sqlite_exec function normally returns SQLITE_OK.  But
if something goes wrong it can return a different value to indicate
the type of error.  Here is a complete list of the return codes:

#define SQLITE_OK           0   /* Successful result */
#define SQLITE_ERROR        1   /* SQL error or missing database */
#define SQLITE_INTERNAL     2   /* An internal logic error in SQLite */
#define SQLITE_PERM         3   /* Access permission denied */
#define SQLITE_ABORT        4   /* Callback routine requested an abort */
#define SQLITE_BUSY         5   /* The database file is locked */
#define SQLITE_LOCKED       6   /* A table in the database is locked */
#define SQLITE_NOMEM        7   /* A malloc() failed */
#define SQLITE_READONLY     8   /* Attempt to write a readonly database */
#define SQLITE_INTERRUPT    9   /* Operation terminated by sqlite_interrupt() */
#define SQLITE_IOERR       10   /* Some kind of disk I/O error occurred */
#define SQLITE_CORRUPT     11   /* The database disk image is malformed */
#define SQLITE_NOTFOUND    12   /* (Internal Only) Table or record not found */
#define SQLITE_FULL        13   /* Insertion failed because database is full */
#define SQLITE_CANTOPEN    14   /* Unable to open the database file */
#define SQLITE_PROTOCOL    15   /* Database lock protocol error */
#define SQLITE_EMPTY       16   /* (Internal Only) Database table is empty */
#define SQLITE_SCHEMA      17   /* The database schema changed */
#define SQLITE_TOOBIG      18   /* Too much data for one row of a table */
#define SQLITE_CONSTRAINT  19   /* Abort due to contraint violation */
#define SQLITE_MISMATCH    20   /* Data type mismatch */
#define SQLITE_MISUSE      21   /* Library used incorrectly */
#define SQLITE_NOLFS       22   /* Uses OS features not supported on host */
#define SQLITE_AUTH        23   /* Authorization denied */
#define SQLITE_ROW         100  /* sqlite_step() has another row ready */
#define SQLITE_DONE        101  /* sqlite_step() has finished executing */

The meanings of these various return values are as follows:

SQLITE_OK

This value is returned if everything worked and there were no errors.

SQLITE_INTERNAL

This value indicates that an internal consistency check within
the SQLite library failed.  This can only happen if there is a bug in
the SQLite library.  If you ever get an SQLITE_INTERNAL reply from
an sqlite_exec call, please report the problem on the SQLite
mailing list.

SQLITE_ERROR

This return value indicates that there was an error in the SQL
that was passed into the sqlite_exec.

SQLITE_PERM

This return value says that the access permissions on the database
file are such that the file cannot be opened.

SQLITE_ABORT

This value is returned if the callback function returns non-zero.

SQLITE_BUSY

This return code indicates that another program or thread has
the database locked.  SQLite allows two or more threads to read the
database at the same time, but only one thread can have the database
open for writing at the same time.  Locking in SQLite is on the
entire database.

SQLITE_LOCKED

This return code is similar to SQLITE_BUSY in that it indicates
that the database is locked.  But the source of the lock is a recursive
call to sqlite_exec.  This return can only occur if you attempt
to invoke sqlite_exec from within a callback routine of a query
from a prior invocation of sqlite_exec.  Recursive calls to
sqlite_exec are allowed as long as they do
not attempt to write the same table.

SQLITE_NOMEM

This value is returned if a call to malloc fails.

SQLITE_READONLY

This return code indicates that an attempt was made to write to
a database file that is opened for reading only.

SQLITE_INTERRUPT

This value is returned if a call to sqlite_interrupt
interrupts a database operation in progress.

SQLITE_IOERR

This value is returned if the operating system informs SQLite
that it is unable to perform some disk I/O operation.  This could mean
that there is no more space left on the disk.

SQLITE_CORRUPT

This value is returned if SQLite detects that the database it is
working on has become corrupted.  Corruption might occur due to a rogue
process writing to the database file or it might happen due to an
perviously undetected logic error in of SQLite. This value is also
returned if a disk I/O error occurs in such a way that SQLite is forced
to leave the database file in a corrupted state.  The latter should only
happen due to a hardware or operating system malfunction.

SQLITE_FULL

This value is returned if an insertion failed because there is
no space left on the disk, or the database is too big to hold any
more information.  The latter case should only occur for databases
that are larger than 2GB in size.

SQLITE_CANTOPEN

This value is returned if the database file could not be opened
for some reason.

SQLITE_PROTOCOL

This value is returned if some other process is messing with
file locks and has violated the file locking protocol that SQLite uses
on its rollback journal files.

SQLITE_SCHEMA

When the database first opened, SQLite reads the database schema
into memory and uses that schema to parse new SQL statements.  If another
process changes the schema, the command currently being processed will
abort because the virtual machine code generated assumed the old
schema.  This is the return code for such cases.  Retrying the
command usually will clear the problem.

SQLITE_TOOBIG

SQLite will not store more than about 1 megabyte of data in a single
row of a single table.  If you attempt to store more than 1 megabyte
in a single row, this is the return code you get.

SQLITE_CONSTRAINT

This constant is returned if the SQL statement would have violated
a database constraint.

SQLITE_MISMATCH

This error occurs when there is an attempt to insert non-integer
data into a column labeled INTEGER PRIMARY KEY.  For most columns, SQLite
ignores the data type and allows any kind of data to be stored.  But
an INTEGER PRIMARY KEY column is only allowed to store integer data.

SQLITE_MISUSE

This error might occur if one or more of the SQLite API routines
is used incorrectly.  Examples of incorrect usage include calling
sqlite_exec after the database has been closed using
sqlite_close or
calling sqlite_exec with the same
database pointer simultaneously from two separate threads.

SQLITE_NOLFS

This error means that you have attempts to create or access a file
database file that is larger that 2GB on a legacy Unix machine that
lacks large file support.

SQLITE_AUTH

This error indicates that the authorizer callback
has disallowed the SQL you are attempting to execute.

SQLITE_ROW

This is one of the return codes from the
sqlite_step routine which is part of the non-callback API.
It indicates that another row of result data is available.

SQLITE_DONE

This is one of the return codes from the
sqlite_step routine which is part of the non-callback API.
It indicates that the SQL statement has been completely executed and
the sqlite_finalize routine is ready to be called.

2.0 Accessing Data Without Using A Callback Function

The sqlite_exec routine described above used to be the only
way to retrieve data from an SQLite database.  But many programmers found
it inconvenient to use a callback function to obtain results.  So beginning
with SQLite version 2.7.7, a second access interface is available that
does not use callbacks.

The new interface uses three separate functions to replace the single
sqlite_exec function.

typedef struct sqlite_vm sqlite_vm;

int sqlite_compile(
  sqlite *db,              /* The open database */
  const char *zSql,        /* SQL statement to be compiled */
  const char **pzTail,     /* OUT: uncompiled tail of zSql */
  sqlite_vm **ppVm,        /* OUT: the virtual machine to execute zSql */
  char **pzErrmsg          /* OUT: Error message. */
);

int sqlite_step(
  sqlite_vm *pVm,          /* The virtual machine to execute */
  int *pN,                 /* OUT: Number of columns in result */
  const char ***pazValue,  /* OUT: Column data */
  const char ***pazColName /* OUT: Column names and datatypes */
);

int sqlite_finalize(
  sqlite_vm *pVm,          /* The virtual machine to be finalized */
  char **pzErrMsg          /* OUT: Error message */
);

The strategy is to compile a single SQL statement using
sqlite_compile then invoke sqlite_step multiple times,
once for each row of output, and finally call sqlite_finalize
to clean up after the SQL has finished execution.

2.1 Compiling An SQL Statement Into A Virtual Machine

The sqlite_compile "compiles" a single SQL statement (specified
by the second parameter) and generates a virtual machine that is able
to execute that statement.
As with must interface routines, the first parameter must be a pointer
to an sqlite structure that was obtained from a prior call to
sqlite_open.

A pointer to the virtual machine is stored in a pointer which is passed
in as the 4th parameter.
Space to hold the virtual machine is dynamically allocated.  To avoid
a memory leak, the calling function must invoke
sqlite_finalize on the virtual machine after it has finished
with it.
The 4th parameter may be set to NULL if an error is encountered during
compilation.

If any errors are encountered during compilation, an error message is
written into memory obtained from malloc and the 5th parameter
is made to point to that memory.  If the 5th parameter is NULL, then
no error message is generated.  If the 5th parameter is not NULL, then
the calling function should dispose of the memory containing the error
message by calling sqlite_freemem.

If the 2nd parameter actually contains two or more statements of SQL,
only the first statement is compiled.  (This is different from the
behavior of sqlite_exec which executes all SQL statements
in its input string.)  The 3rd parameter to sqlite_compile
is made to point to the first character beyond the end of the first
statement of SQL in the input.  If the 2nd parameter contains only
a single SQL statement, then the 3rd parameter will be made to point
to the '\000' terminator at the end of the 2nd parameter.

On success, sqlite_compile returns SQLITE_OK.
Otherwise and error code is returned.

2.2 Step-By-Step Execution Of An SQL Statement

After a virtual machine has been generated using sqlite_compile
it is executed by one or more calls to sqlite_step.  Each
invocation of sqlite_step, except the last one,
returns a single row of the result.
The number of columns in  the result is stored in the integer that
the 2nd parameter points to.
The pointer specified by the 3rd parameter is made to point
to an array of pointers to column values.
The pointer in the 4th parameter is made to point to an array
of pointers to column names and datatypes.
The 2nd through 4th parameters to sqlite_step convey the
same information as the 2nd through 4th parameters of the
callback routine when using
the sqlite_exec interface.  Except, with sqlite_step
the column datatype information is always included in the in the
4th parameter regardless of whether or not the
SHOW_DATATYPES pragma
is on or off.

Each invocation of sqlite_step returns an integer code that
indicates what happened during that step.  This code may be
SQLITE_BUSY, SQLITE_ROW, SQLITE_DONE, SQLITE_ERROR, or
SQLITE_MISUSE.

If the virtual machine is unable to open the database file because
it is locked by another thread or process, sqlite_step
will return SQLITE_BUSY.  The calling function should do some other
activity, or sleep, for a short amount of time to give the lock a
chance to clear, then invoke sqlite_step again.  This can
be repeated as many times as desired.

Whenever another row of result data is available,
sqlite_step will return SQLITE_ROW.  The row data is
stored in an array of pointers to strings and the 2nd parameter
is made to point to this array.

When all processing is complete, sqlite_step will return
either SQLITE_DONE or SQLITE_ERROR.  SQLITE_DONE indicates that the
statement completed successfully and SQLITE_ERROR indicates that there
was a run-time error.  (The details of the error are obtained from
sqlite_finalize.)  It is a misuse of the library to attempt
to call sqlite_step again after it has returned SQLITE_DONE
or SQLITE_ERROR.

When sqlite_step returns SQLITE_DONE or SQLITE_ERROR,
the *pN and *pazColName values are set to the number of columns
in the result set and to the names of the columns, just as they
are for an SQLITE_ROW return.  This allows the calling code to
find the number of result columns and the column names and datatypes
even if the result set is empty.  The *pazValue parameter is always
set to NULL when the return codes is SQLITE_DONE or SQLITE_ERROR.
If the SQL being executed is a statement that does not
return a result (such as an INSERT or an UPDATE) then *pN will
be set to zero and *pazColName will be set to NULL.

If you abuse the library by trying to call sqlite_step
inappropriately it will attempt return SQLITE_MISUSE.
This can happen if you call sqlite_step() on the same virtual machine
at the same
time from two or more threads or if you call sqlite_step()
again after it returned SQLITE_DONE or SQLITE_ERROR or if you
pass in an invalid virtual machine pointer to sqlite_step().
You should not depend on the SQLITE_MISUSE return code to indicate
an error.  It is possible that a misuse of the interface will go
undetected and result in a program crash.  The SQLITE_MISUSE is
intended as a debugging aid only - to help you detect incorrect
usage prior to a mishap.  The misuse detection logic is not guaranteed
to work in every case.

2.3 Deleting A Virtual Machine

Every virtual machine that sqlite_compile creates should
eventually be handed to sqlite_finalize.  The sqlite_finalize()
procedure deallocates the memory and other resources that the virtual
machine uses.  Failure to call sqlite_finalize() will result in
resource leaks in your program.

The sqlite_finalize routine also returns the result code
that indicates success or failure of the SQL operation that the
virtual machine carried out.
The value returned by sqlite_finalize() will be the same as would
have been returned had the same SQL been executed by sqlite_exec.
The error message returned will also be the same.

It is acceptable to call sqlite_finalize on a virtual machine
before sqlite_step has returned SQLITE_DONE.  Doing so has
the effect of interrupting the operation in progress.  Partially completed
changes will be rolled back and the database will be restored to its
original state (unless an alternative recovery algorithm is selected using
an ON CONFLICT clause in the SQL being executed.)  The effect is the
same as if a callback function of sqlite_exec had returned
non-zero.

It is also acceptable to call sqlite_finalize on a virtual machine
that has never been passed to sqlite_step even once.

3.0 The Extended API

Only the three core routines described in section 1.0 are required to use
SQLite.  But there are many other functions that provide
useful interfaces.  These extended routines are as follows:

int sqlite_last_insert_rowid(sqlite*);

int sqlite_changes(sqlite*);

int sqlite_get_table(
  sqlite*,
  char *sql,
  char ***result,
  int *nrow,
  int *ncolumn,
  char **errmsg
);

void sqlite_free_table(char**);

void sqlite_interrupt(sqlite*);

int sqlite_complete(const char *sql);

void sqlite_busy_handler(sqlite*, int (*)(void*,const char*,int), void*);

void sqlite_busy_timeout(sqlite*, int ms);

const char sqlite_version[];

const char sqlite_encoding[];

int sqlite_exec_printf(
  sqlite*,
  char *sql,
  int (*)(void*,int,char**,char**),
  void*,
  char **errmsg,
  ...
);

int sqlite_exec_vprintf(
  sqlite*,
  char *sql,
  int (*)(void*,int,char**,char**),
  void*,
  char **errmsg,
  va_list
);

int sqlite_get_table_printf(
  sqlite*,
  char *sql,
  char ***result,
  int *nrow,
  int *ncolumn,
  char **errmsg,
  ...
);

int sqlite_get_table_vprintf(
  sqlite*,
  char *sql,
  char ***result,
  int *nrow,
  int *ncolumn,
  char **errmsg,
  va_list
);

char *sqlite_mprintf(const char *zFormat, ...);

char *sqlite_vmprintf(const char *zFormat, va_list);

void sqlite_freemem(char*);

void sqlite_progress_handler(sqlite*, int, int (*)(void*), void*);

All of the above definitions are included in the "sqlite.h"
header file that comes in the source tree.

3.1 The ROWID of the most recent insert

Every row of an SQLite table has a unique integer key.  If the
table has a column labeled INTEGER PRIMARY KEY, then that column
serves as the key.  If there is no INTEGER PRIMARY KEY column then
the key is a unique integer.  The key for a row can be accessed in
a SELECT statement or used in a WHERE or ORDER BY clause using any
of the names "ROWID", "OID", or "_ROWID_".

When you do an insert into a table that does not have an INTEGER PRIMARY
KEY column, or if the table does have an INTEGER PRIMARY KEY but the value
for that column is not specified in the VALUES clause of the insert, then
the key is automatically generated.  You can find the value of the key
for the most recent INSERT statement using the
sqlite_last_insert_rowid API function.

3.2 The number of rows that changed

The sqlite_changes API function returns the number of rows
that have been inserted, deleted, or modified since the database was
last quiescent.  A "quiescent" database is one in which there are
no outstanding calls to sqlite_exec and no VMs created by
sqlite_compile that have not been finalized by sqlite_finalize.
In common usage, sqlite_changes returns the number
of rows inserted, deleted, or modified by the most recent sqlite_exec
call or since the most recent sqlite_compile.  But if you have
nested calls to sqlite_exec (that is, if the callback routine
of one sqlite_exec invokes another sqlite_exec) or if
you invoke sqlite_compile to create a new VM while there is
still another VM in existance, then
the meaning of the number returned by sqlite_changes is more
complex.
The number reported includes any changes
that were later undone by a ROLLBACK or ABORT.  But rows that are
deleted because of a DROP TABLE are not counted.

SQLite implements the command "DELETE FROM table" (without
a WHERE clause) by dropping the table then recreating it.
This is much faster than deleting the elements of the table individually.
But it also means that the value returned from sqlite_changes
will be zero regardless of the number of elements that were originally
in the table.  If an accurate count of the number of elements deleted
is necessary, use "DELETE FROM table WHERE 1" instead.

3.3 Querying into memory obtained from malloc()

The sqlite_get_table function is a wrapper around
sqlite_exec that collects all the information from successive
callbacks and writes it into memory obtained from malloc().  This
is a convenience function that allows the application to get the
entire result of a database query with a single function call.

The main result from sqlite_get_table is an array of pointers
to strings.  There is one element in this array for each column of
each row in the result.  NULL results are represented by a NULL
pointer. In addition to the regular data, there is an added row at the
beginning of the array that contains the name of each column of the
result.

As an example, consider the following query:

SELECT employee_name, login, host FROM users WHERE login LIKE 'd%';

This query will return the name, login and host computer name
for every employee whose login begins with the letter "d".  If this
query is submitted to sqlite_get_table the result might
look like this:

nrow = 2

ncolumn = 3

result[0] = "employee_name"

result[1] = "login"

result[2] = "host"

result[3] = "dummy"

result[4] = "No such user"

result[5] = 0

result[6] = "D. Richard Hipp"

result[7] = "drh"

result[8] = "zadok"

Notice that the "host" value for the "dummy" record is NULL so
the result[] array contains a NULL pointer at that slot.

If the result set of a query is empty, then by default
sqlite_get_table will set nrow to 0 and leave its
result parameter is set to NULL.  But if the EMPTY_RESULT_CALLBACKS
pragma is ON then the result parameter is initialized to the names
of the columns only.  For example, consider this query which has
an empty result set:

SELECT employee_name, login, host FROM users WHERE employee_name IS NULL;

The default behavior gives this results:

nrow = 0

ncolumn = 0

result = 0

But if the EMPTY_RESULT_CALLBACKS pragma is ON, then the following
is returned:

nrow = 0

ncolumn = 3

result[0] = "employee_name"

result[1] = "login"

result[2] = "host"

Memory to hold the information returned by sqlite_get_table
is obtained from malloc().  But the calling function should not try
to free this information directly.  Instead, pass the complete table
to sqlite_free_table when the table is no longer needed.
It is safe to call sqlite_free_table with a NULL pointer such
as would be returned if the result set is empty.

The sqlite_get_table routine returns the same integer
result code as sqlite_exec.

3.4 Interrupting an SQLite operation

The sqlite_interrupt function can be called from a
different thread or from a signal handler to cause the current database
operation to exit at its first opportunity.  When this happens,
the sqlite_exec routine (or the equivalent) that started
the database operation will return SQLITE_INTERRUPT.

3.5 Testing for a complete SQL statement

The next interface routine to SQLite is a convenience function used
to test whether or not a string forms a complete SQL statement.
If the sqlite_complete function returns true when its input
is a string, then the argument forms a complete SQL statement.
There are no guarantees that the syntax of that statement is correct,
but we at least know the statement is complete.  If sqlite_complete
returns false, then more text is required to complete the SQL statement.

For the purpose of the sqlite_complete function, an SQL
statement is complete if it ends in a semicolon.

The sqlite command-line utility uses the sqlite_complete
function to know when it needs to call sqlite_exec.  After each
line of input is received, sqlite calls sqlite_complete
on all input in its buffer.  If sqlite_complete returns true,
then sqlite_exec is called and the input buffer is reset.  If
sqlite_complete returns false, then the prompt is changed to
the continuation prompt and another line of text is read and added to
the input buffer.

3.6 Library version string

The SQLite library exports the string constant named
sqlite_version which contains the version number of the
library.  The header file contains a macro SQLITE_VERSION
with the same information.  If desired, a program can compare
the SQLITE_VERSION macro against the sqlite_version
string constant to verify that the version number of the
header file and the library match.

3.7 Library character encoding

By default, SQLite assumes that all data uses a fixed-size
8-bit character (iso8859).  But if you give the --enable-utf8 option
to the configure script, then the library assumes UTF-8 variable
sized characters.  This makes a difference for the LIKE and GLOB
operators and the LENGTH() and SUBSTR() functions.  The static
string sqlite_encoding will be set to either "UTF-8" or
"iso8859" to indicate how the library was compiled.  In addition,
the sqlite.h header file will define one of the
macros SQLITE_UTF8 or SQLITE_ISO8859, as appropriate.

Note that the character encoding mechanism used by SQLite cannot
be changed at run-time.  This is a compile-time option only.  The
sqlite_encoding character string just tells you how the library
was compiled.

3.8 Changing the library's response to locked files

The sqlite_busy_handler procedure can be used to register
a busy callback with an open SQLite database.  The busy callback will
be invoked whenever SQLite tries to access a database that is locked.
The callback will typically do some other useful work, or perhaps sleep,
in order to give the lock a chance to clear.  If the callback returns
non-zero, then SQLite tries again to access the database and the cycle
repeats.  If the callback returns zero, then SQLite aborts the current
operation and returns SQLITE_BUSY.

The arguments to sqlite_busy_handler are the opaque
structure returned from sqlite_open, a pointer to the busy
callback function, and a generic pointer that will be passed as
the first argument to the busy callback.  When SQLite invokes the
busy callback, it sends it three arguments:  the generic pointer
that was passed in as the third argument to sqlite_busy_handler,
the name of the database table or index that the library is trying
to access, and the number of times that the library has attempted to
access the database table or index.

For the common case where we want the busy callback to sleep,
the SQLite library provides a convenience routine sqlite_busy_timeout.
The first argument to sqlite_busy_timeout is a pointer to
an open SQLite database and the second argument is a number of milliseconds.
After sqlite_busy_timeout has been executed, the SQLite library
will wait for the lock to clear for at least the number of milliseconds
specified before it returns SQLITE_BUSY.  Specifying zero milliseconds for
the timeout restores the default behavior.

3.9 Using the <tt>_printf()</tt> wrapper functions

The four utility functions

sqlite_exec_printf()

sqlite_exec_vprintf()

sqlite_get_table_printf()

sqlite_get_table_vprintf()

implement the same query functionality as sqlite_exec
and sqlite_get_table.  But instead of taking a complete
SQL statement as their second argument, the four _printf
routines take a printf-style format string.  The SQL statement to
be executed is generated from this format string and from whatever
additional arguments are attached to the end of the function call.

There are two advantages to using the SQLite printf
functions instead of sprintf.  First of all, with the
SQLite printf routines, there is never a danger of overflowing a
static buffer as there is with sprintf.  The SQLite
printf routines automatically allocate (and later frees)
as much memory as is
necessary to hold the SQL statements generated.

The second advantage the SQLite printf routines have over
sprintf are two new formatting options specifically designed
to support string literals in SQL.  Within the format string,
the %q formatting option works very much like %s in that it
reads a null-terminated string from the argument list and inserts
it into the result.  But %q translates the inserted string by
making two copies of every single-quote (') character in the
substituted string.  This has the effect of escaping the end-of-string
meaning of single-quote within a string literal. The %Q formatting
option works similar; it translates the single-quotes like %q and
additionally encloses the resulting string in single-quotes.
If the argument for the %Q formatting options is a NULL pointer,
the resulting string is NULL without single quotes.

Consider an example.  Suppose you are trying to insert a string
value into a database table where the string value was obtained from
user input.  Suppose the string to be inserted is stored in a variable
named zString.  The code to do the insertion might look like this:

sqlite_exec_printf(db,
  "INSERT INTO table1 VALUES('%s')",
  0, 0, 0, zString);

If the zString variable holds text like "Hello", then this statement
will work just fine.  But suppose the user enters a string like
"Hi y'all!".  The SQL statement generated reads as follows:

INSERT INTO table1 VALUES('Hi y'all')

This is not valid SQL because of the apostrophy in the word "y'all".
But if the %q formatting option is used instead of %s, like this:

sqlite_exec_printf(db,
  "INSERT INTO table1 VALUES('%q')",
  0, 0, 0, zString);

Then the generated SQL will look like the following:

INSERT INTO table1 VALUES('Hi y''all')

Here the apostrophy has been escaped and the SQL statement is well-formed.
When generating SQL on-the-fly from data that might contain a
single-quote character ('), it is always a good idea to use the
SQLite printf routines and the %q formatting option instead of sprintf.

If the %Q formatting option is used instead of %q, like this:

sqlite_exec_printf(db,
  "INSERT INTO table1 VALUES(%Q)",
  0, 0, 0, zString);

Then the generated SQL will look like the following:

INSERT INTO table1 VALUES('Hi y''all')

If the value of the zString variable is NULL, the generated SQL
will look like the following:

INSERT INTO table1 VALUES(NULL)

All of the _printf() routines above are built around the following
two functions:

char *sqlite_mprintf(const char *zFormat, ...);
char *sqlite_vmprintf(const char *zFormat, va_list);

The sqlite_mprintf() routine works like the the standard library
sprintf() except that it writes its results into memory obtained
from malloc() and returns a pointer to the malloced buffer.
sqlite_mprintf() also understands the %q and %Q extensions described
above.  The sqlite_vmprintf() is a varargs version of the same
routine.  The string pointer that these routines return should be freed
by passing it to sqlite_freemem().

3.10 Performing background jobs during large queries

The sqlite_progress_handler() routine can be used to register a
callback routine with an SQLite database to be invoked periodically during long
running calls to sqlite_exec(), sqlite_step() and the various
wrapper functions.

The callback is invoked every N virtual machine operations, where N is
supplied as the second argument to sqlite_progress_handler(). The third
and fourth arguments to sqlite_progress_handler() are a pointer to the
routine to be invoked and a void pointer to be passed as the first argument to
it.

The time taken to execute each virtual machine operation can vary based on
many factors.  A typical value for a 1 GHz PC is between half and three million
per second but may be much higher or lower, depending on the query.  As such it
is difficult to schedule background operations based on virtual machine
operations. Instead, it is recommended that a callback be scheduled relatively
frequently (say every 1000 instructions) and external timer routines used to
determine whether or not background jobs need to be run.

4.0 Adding New SQL Functions

Beginning with version 2.4.0, SQLite allows the SQL language to be
extended with new functions implemented as C code.  The following interface
is used:

typedef struct sqlite_func sqlite_func;

int sqlite_create_function(
  sqlite *db,
  const char *zName,
  int nArg,
  void (*xFunc)(sqlite_func*,int,const char**),
  void *pUserData
);
int sqlite_create_aggregate(
  sqlite *db,
  const char *zName,
  int nArg,
  void (*xStep)(sqlite_func*,int,const char**),
  void (*xFinalize)(sqlite_func*),
  void *pUserData
);

char *sqlite_set_result_string(sqlite_func*,const char*,int);
void sqlite_set_result_int(sqlite_func*,int);
void sqlite_set_result_double(sqlite_func*,double);
void sqlite_set_result_error(sqlite_func*,const char*,int);

void *sqlite_user_data(sqlite_func*);
void *sqlite_aggregate_context(sqlite_func*, int nBytes);
int sqlite_aggregate_count(sqlite_func*);

The sqlite_create_function() interface is used to create
regular functions and sqlite_create_aggregate() is used to
create new aggregate functions.  In both cases, the db
parameter is an open SQLite database on which the functions should
be registered, zName is the name of the new function,
nArg is the number of arguments, and pUserData is
a pointer which is passed through unchanged to the C implementation
of the function.  Both routines return 0 on success and non-zero
if there are any errors.

The length of a function name may not exceed 255 characters.
Any attempt to create a function whose name exceeds 255 characters
in length will result in an error.

For regular functions, the xFunc callback is invoked once
for each function call.  The implementation of xFunc should call
one of the sqlite_set_result_... interfaces to return its
result.  The sqlite_user_data() routine can be used to
retrieve the pUserData pointer that was passed in when the
function was registered.

For aggregate functions, the xStep callback is invoked once
for each row in the result and then xFinalize is invoked at the
end to compute a final answer.  The xStep routine can use the
sqlite_aggregate_context() interface to allocate memory that
will be unique to that particular instance of the SQL function.
This memory will be automatically deleted after xFinalize is called.
The sqlite_aggregate_count() routine can be used to find out
how many rows of data were passed to the aggregate.  The xFinalize
callback should invoke one of the sqlite_set_result_...
interfaces to set the final result of the aggregate.

SQLite now implements all of its built-in functions using this
interface.  For additional information and examples on how to create
new SQL functions, review the SQLite source code in the file
func.c.

5.0 Multi-Threading And SQLite

If SQLite is compiled with the THREADSAFE preprocessor macro set to 1,
then it is safe to use SQLite from two or more threads of the same process
at the same time.  But each thread should have its own sqlite*
pointer returned from sqlite_open.  It is never safe for two
or more threads to access the same sqlite* pointer at the same time.

In precompiled SQLite libraries available on the website, the Unix
versions are compiled with THREADSAFE turned off but the Windows
versions are compiled with THREADSAFE turned on.  If you need something
different that this you will have to recompile.

Under Unix, an sqlite* pointer should not be carried across a
fork() system call into the child process.  The child process
should open its own copy of the database after the fork().

6.0 Usage Examples

For examples of how the SQLite C/C++ interface can be used,
refer to the source code for the sqlite program in the
file src/shell.c of the source tree.
Additional information about sqlite is available at
sqlite.html.
See also the sources to the Tcl interface for SQLite in
the source file src/tclsqlite.c.

This page last modified 2008/11/01 13:26:49 UTC


text:
  Login.

<form novalidate (ngSubmit)="f.form.valid && login()" #f="ngForm" class="form-horizontal" name="form">

    Username

      <input required [(ngModel)]="model.username" #username="ngModel" id="app-login-username" class="form-control" type="email"
        name="username" value="">

Username is required

    Password

      <input required [(ngModel)]="model.password" #password="ngModel" id="app-login-password" class="form-control" type="password"
        name="password" value="">

Password is required

      <button class="btn btn-primary">Login</button>

</form>


text:
CKEDITOR.plugins.setLang( 'magicline', 'fr', {
	title: 'Insérez un paragraphe ici'
});


text:
package butterknife;

import android.view.View;
import androidx.annotation.IdRes;
import butterknife.internal.ListenerClass;
import butterknife.internal.ListenerMethod;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static android.widget.TextView.OnEditorActionListener;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
 * Bind a method to an {@link OnEditorActionListener OnEditorActionListener} on the view for each
 * ID specified.
 *

 * {@literal @}OnEditorAction(R.id.example) boolean onEditorAction(KeyEvent key) {
 *   Toast.makeText(this, "Pressed: " + key, Toast.LENGTH_SHORT).show();
 *   return true;
 * }
 *

 * Any number of parameters from
 * {@link OnEditorActionListener#onEditorAction(android.widget.TextView, int, android.view.KeyEvent)
 * onEditorAction} may be used on the method.
 *

 * If the return type of the method is {@code void}, true will be returned from the listener.
 *
 * @see OnEditorActionListener
 */
@Target(METHOD)
@Retention(RUNTIME)
@ListenerClass(
    targetType = "android.widget.TextView",
    setter = "setOnEditorActionListener",
    type = "android.widget.TextView.OnEditorActionListener",
    method = @ListenerMethod(
        name = "onEditorAction",
        parameters = {
            "android.widget.TextView",
            "int",
            "android.view.KeyEvent"
        },
        returnType = "boolean",
        defaultReturn = "true"
    )
)
public @interface OnEditorAction {
  /** View IDs to which the method will be bound. */
  @IdRes int[] value() default { View.NO_ID };
}


text:
<readable><title>483136916_16976f4902</title><content>
A beagle looking over his shoulder as he stand on a sandy slope .
A beagle stands in the sand and grass .
A dog stands in a field .
Brown , black and white dog standing on a sandy slope .
Dog standing in grassy sand dune .
</content></readable>


text:
require 'active_model'
require 'klarna/checkout/cart_item'

module Klarna
  module Checkout
    class Cart < Resource
      include ActiveModel::Validations

      attr_accessor :total_price_including_tax, :total_price_excluding_tax,
                    :total_tax_amount

      has_many :items, Klarna::Checkout::CartItem

      validate :items_validation

      def as_json
        json_sanitize({
          :items => @items.map(&:as_json)
        })
      end

      private

      def items_validation
        errors.add(:items, :invalid) unless items.all?(&:valid?)
      end
    end
  end
end


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

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="author" content="Xianwu Lin"/>
<title>{{Blog_title}}</title>
<link rel='shortcut icon' type='image/ico' href='/favicon.ico'>
<link href='http://fonts.googleapis.com/css?family=Underdog' rel='stylesheet' type='text/css'>
<link href='{{static_url('css/style.css')}}' rel='stylesheet' type='text/css'>
<link href='{{static_url('css/prettify.css')}}' rel='stylesheet' type='text/css'>
<link href='{{static_url('css/github2.css')}}' rel='stylesheet' type='text/css'>

Xianwu Lin

HOME
CATEGORIES
ABOUT

	{{ Blog_content }}

 {{ Blog_time }}

{{ tag }}

{{ p_blog }}

{{ n_blog }}

Copyright 2013 - 2013 by Xianwu Lin | {{ Last_date }}


text:
<?php

namespace AppBundle\Controller;

use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Component\HttpFoundation\JsonResponse;
use FOS\RestBundle\Controller\Annotations\View;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;

class DefaultController extends Controller
{
    /**
     * @Route("/app/example", name="homepage")
     */
    public function indexAction()
    {
        return $this->render('default/index.html.twig');
    }
    /**
     * @Route("/whoami", methods="GET")
     * @View
     */
    public function whoAmIAction()
    {

        return $this->getUser();
    }
}


text:
/****** Object:  StoredProcedure [GetG09_Region_ReChild] ******/
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[GetG09_Region_ReChild]') AND type in (N'P', N'PC'))
    DROP PROCEDURE [GetG09_Region_ReChild]
GO

CREATE PROCEDURE [GetG09_Region_ReChild]
    @Region_ID2 int
AS
    BEGIN

        SET NOCOUNT ON

        /* Get G09_Region_ReChild from table */
        SELECT
            [4_Regions_ReChild].[Region_Child_Name]
        FROM [4_Regions_ReChild]
        WHERE
            [4_Regions_ReChild].[Region_ID2] = @Region_ID2 AND
            [4_Regions_ReChild].[IsActive] = 'true'

    END
GO

/****** Object:  StoredProcedure [AddG09_Region_ReChild] ******/
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[AddG09_Region_ReChild]') AND type in (N'P', N'PC'))
    DROP PROCEDURE [AddG09_Region_ReChild]
GO

CREATE PROCEDURE [AddG09_Region_ReChild]
    @Region_ID2 int,
    @Region_Child_Name varchar(50)
AS
    BEGIN

        SET NOCOUNT ON

        /* Insert object into 4_Regions_ReChild */
        INSERT INTO [4_Regions_ReChild]
        (
            [Region_ID2],
            [Region_Child_Name]
        )
        VALUES
        (
            @Region_ID2,
            @Region_Child_Name
        )

    END
GO

/****** Object:  StoredProcedure [UpdateG09_Region_ReChild] ******/
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[UpdateG09_Region_ReChild]') AND type in (N'P', N'PC'))
    DROP PROCEDURE [UpdateG09_Region_ReChild]
GO

CREATE PROCEDURE [UpdateG09_Region_ReChild]
    @Region_ID2 int,
    @Region_Child_Name varchar(50)
AS
    BEGIN

        SET NOCOUNT ON

        /* Check for object existence */
        IF NOT EXISTS
        (
            SELECT [Region_ID2] FROM [4_Regions_ReChild]
            WHERE
                [Region_ID2] = @Region_ID2 AND
                [IsActive] = 'true'
        )
        BEGIN
            RAISERROR ('''G09_Region_ReChild'' object not found. It was probably removed by another user.', 16, 1)
            RETURN
        END

        /* Update object in 4_Regions_ReChild */
        UPDATE [4_Regions_ReChild]
        SET
            [Region_Child_Name] = @Region_Child_Name
        WHERE
            [Region_ID2] = @Region_ID2

    END
GO

/****** Object:  StoredProcedure [DeleteG09_Region_ReChild] ******/
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[DeleteG09_Region_ReChild]') AND type in (N'P', N'PC'))
    DROP PROCEDURE [DeleteG09_Region_ReChild]
GO

CREATE PROCEDURE [DeleteG09_Region_ReChild]
    @Region_ID2 int
AS
    BEGIN

        SET NOCOUNT ON

        /* Check for object existence */
        IF NOT EXISTS
        (
            SELECT [Region_ID2] FROM [4_Regions_ReChild]
            WHERE
                [Region_ID2] = @Region_ID2 AND
                [IsActive] = 'true'
        )
        BEGIN
            RAISERROR ('''G09_Region_ReChild'' object not found. It was probably removed by another user.', 16, 1)
            RETURN
        END

        /* Mark G09_Region_ReChild object as not active */
        UPDATE [4_Regions_ReChild]
        SET    [IsActive] = 'false'
        WHERE
            [4_Regions_ReChild].[Region_ID2] = @Region_ID2

    END
GO


text:
<?php

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

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

    <?php $form = ActiveForm::begin(); ?>

    <?= $form->field($model, 'title')->textInput(['maxlength' => true]) ?>

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

    <?= $form->field($model, 'filename')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'extension')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'type')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'size')->textInput(['maxlength' => true]) ?>

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

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

        <?= Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>

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


text:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.jayway.maven.plugins.android.tests"
  android:versionCode="2001005000" android:versionName="2.1.5.0-SNAPSHOT">
  <application
    android:name="TestApplication"
    android:icon="@drawable/icon"
    android:label="@string/app_name">
    <activity
      android:name=".BasicActivity"
      android:label="@string/basic_label">
      <intent-filter>
        <action
          android:name="android.intent.action.MAIN" />
        <category
          android:name="android.intent.category.DEFAULT" />
        <category
          android:name="android.intent.category.LAUNCHER" />
      </intent-filter>
    </activity>
  </application>
</manifest>


text:
var getMetaData = require('../data/meta'),
    hbs = require('express-hbs'),
    escapeExpression = hbs.handlebars.Utils.escapeExpression,
    SafeString = hbs.handlebars.SafeString,
    _ = require('lodash'),
    filters = require('../filters'),
    assetHelper = require('./asset'),
    config = require('../config'),
    Promise = require('bluebird'),
    labs = require('../utils/labs'),
    api = require('../api');

function getClient() {
    if (labs.isSet('publicAPI') === true) {
        return api.clients.read({slug: 'ghost-frontend'}).then(function (client) {
            client = client.clients[0];
            if (client.status === 'enabled') {
                return {
                    id: client.slug,
                    secret: client.secret
                };
            }
            return {};
        });
    }
    return Promise.resolve({});
}

function writeMetaTag(property, content, type) {
    type = type || property.substring(0, 7) === 'twitter' ? 'name' : 'property';
    return '<meta ' + type + '="' + property + '" content="' + content + '" />';
}

function finaliseStructuredData(metaData) {
    var head = [];
    _.each(metaData.structuredData, function (content, property) {
        if (property === 'article:tag') {
            _.each(metaData.keywords, function (keyword) {
                if (keyword !== '') {
                    keyword = escapeExpression(keyword);
                    head.push(writeMetaTag(property,
                        escapeExpression(keyword)));
                }
            });
            head.push('');
        } else if (content !== null && content !== undefined) {
            head.push(writeMetaTag(property,
                escapeExpression(content)));
        }
    });
    return head;
}

function getAjaxHelper(clientId, clientSecret) {
    return '<script type="text/javascript" src="' +
        assetHelper('shared/ghost-url.js', {hash: {minifyInProduction: true}}) + '"></script>\n' +
        '<script type="text/javascript">\n' +
        'ghost.init({\n' +
        '\tclientId: "' + clientId + '",\n' +
        '\tclientSecret: "' + clientSecret + '"\n' +
        '});\n' +
        '</script>';
}

function ghost_head(options) {
    // if error page do nothing
    if (this.statusCode >= 400) {
        return;
    }

    var metaData,
        client,
        head = [],
        context = this.context ? this.context : null,
        useStructuredData = !config.isPrivacyDisabled('useStructuredData'),
        safeVersion = this.safeVersion,
        referrerPolicy = config.referrerPolicy ? config.referrerPolicy : 'no-referrer-when-downgrade',
        fetch = {
            metaData: getMetaData(this, options.data.root),
            client: getClient()
        };

    return Promise.props(fetch).then(function (response) {
        client = response.client;
        metaData = response.metaData;

        if (context) {
            // head is our main array that holds our meta data
            head.push('<link rel="canonical" href="' +
                escapeExpression(metaData.canonicalUrl) + '" />');
            head.push('<meta name="referrer" content="' + referrerPolicy + '" />');

            // show amp link in post when 1. we are not on the amp page and 2. amp is enabled
            if (_.includes(context, 'post') && !_.includes(context, 'amp') && config.theme.amp) {
                head.push('<link rel="amphtml" href="' +
                    escapeExpression(metaData.ampUrl) + '" />');
            }

            if (metaData.previousUrl) {
                head.push('<link rel="prev" href="' +
                    escapeExpression(metaData.previousUrl) + '" />');
            }

            if (metaData.nextUrl) {
                head.push('<link rel="next" href="' +
                    escapeExpression(metaData.nextUrl) + '" />');
            }

            if (!_.includes(context, 'paged') && useStructuredData) {
                head.push('');
                head.push.apply(head, finaliseStructuredData(metaData));
                head.push('');

                if (metaData.schema) {
                    head.push('<script type="application/ld+json">\n' +
                        JSON.stringify(metaData.schema, null, '    ') +
                        '\n    </script>\n');
                }
            }

            if (client && client.id && client.secret && !_.includes(context, 'amp')) {
                head.push(getAjaxHelper(client.id, client.secret));
            }
        }

        head.push('<meta name="generator" content="Ghost ' +
            escapeExpression(safeVersion) + '" />');
        head.push('<link rel="alternate" type="application/rss+xml" title="' +
            escapeExpression(metaData.blog.title)  + '" href="' +
            escapeExpression(metaData.rssUrl) + '" />');

        return api.settings.read({key: 'ghost_head'});
    }).then(function (response) {
        // no code injection for amp context!!!
        if (!_.includes(context, 'amp')) {
            head.push(response.settings[0].value);
        }
        return filters.doFilter('ghost_head', head);
    }).then(function (head) {
        return new SafeString(head.join('\n    ').trim());
    });
}

module.exports = ghost_head;


text:
package DDG::Spice::MinecraftStatus;
# ABSTRACT: Returns the status of Minecraft

use strict;
use DDG::Spice;

triggers any => 'minecraft', 'mcstatus', 'mc', 'mine craft';

spice to => 'http://mcstatusraw.thedestruc7i0n.ca/';
spice wrap_jsonp_callback => 1;

spice is_cached => 1;
spice proxy_cache_valid => '200 5m';

handle remainder => sub {
    return $_ if /^(is\s*)?(system)?\s*(status|up|down)\?*$/i;
    return;
};

1;