text:
<?php
namespace App\Http\Controllers;

use Illuminate\Http\Request;

class DashboardController extends Controller
{

    public function __construct()
    {
        parent::__construct();
    }

    public function index()
    {
        $data = [
            'channel' => $this->twitch->getChannel($this->streamer->channel_id),
            'community' => $this->twitch->getChannelCommunity($this->streamer->channel_id)
        ];

        return $this->view('dashboard.index', $data);
    }

    public function updateStreamMeta(Request $request)
    {
        $this->twitch->updateChannel(
            $this->streamer->channel_id,
            null,
            $request->input('status'),
            $request->input('game')
        );

        $this->twitch->setChannelCommunity(
            $this->streamer->channel_id,
            $request->input('community_id'),
            $this->config->userpass
        );
    }

}


text:
  <title>Reddit style message board</title>
  <link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap.min.css" rel="stylesheet">

    <alert ng-repeat="alert in alerts" type="alert.type" close="closeAlert($index)">{{alert.msg}}</alert>

Message board

  <form name="myForm" ng-controller="NewCtrl">

      Name
      <input type="text" name="name" ng-model="item.name" required>
      Required

    Message
    <textarea name="message" ng-model="item.message" required></textarea>
    Required

    <button ng-click="saveNewItem(item)" ng-disabled="myForm.$invalid" class="btn btn-primary">Save</button>
  </form>

      <button id="add-btn" class="btn btn-success" ng-click="UpVote(item)" ng-disabled="Voted(item)">+</button>
      <input type="text" ng-model="item.karma" ng-change="updateKarma(item)" style="height: 30px; width:30px" />
      <button id="add-btn" class="btn btn-danger" ng-click="DownVote(item)" ng-disabled="Voted(item)">-</button>
      {{item.message}}

{{item.name}}

redpajama_set_name: RedPajamaGithub


text:
ZendSkeletonApplication
=======================

Introduction
------------
This is a simple, skeleton application using the ZF2 MVC layer and module
systems. This application is meant to be used as a starting place for those
looking to get their feet wet with ZF2.

Installation using Composer
---------------------------

The easiest way to create a new ZF2 project is to use [Composer](https://getcomposer.org/). If you don't have it already installed, then please install as per the [documentation](https://getcomposer.org/doc/00-intro.md).

Create your new ZF2 project:

    composer create-project -n -sdev zendframework/skeleton-application path/to/install

### Installation using a tarball with a local composer

If you don't have composer installed globally then another way to create a new ZF2 project is to download the tarball and install it:

1. Download the [tarball](https://github.com/zendframework/ZendSkeletonApplication/tarball/master), extract it and then install the dependencies with a locally installed Composer:

        cd my/project/dir
        curl -#L https://github.com/zendframework/ZendSkeletonApplication/tarball/master | tar xz --strip-components=1

2. Download composer into your proejct directory and install the dependencies:

        curl -s https://getcomposer.org/installer | php
        php composer.phar install

If you don't have access to curl, then install Composer into your project as per the [documentation](https://getcomposer.org/doc/00-intro.md).

Web Server Setup
----------------

### PHP CLI Server

The simplest way to get started if you are using PHP 5.4 or above is to start the internal PHP cli-server in the root
directory:

    php -S 0.0.0.0:8080 -t public/ public/index.php

This will start the cli-server on port 8080, and bind it to all network
interfaces.

**Note:** The built-in CLI server is *for development only*.

### Apache Setup

To setup apache, setup a virtual host to point to the public/ directory of the
project and you should be ready to go! It should look something like below:

    <VirtualHost *:80>
        ServerName zf2-tutorial.localhost
        DocumentRoot /path/to/zf2-tutorial/public
        <Directory /path/to/zf2-tutorial/public>
            DirectoryIndex index.php
            AllowOverride All
            Order allow,deny
            Allow from all
            <IfModule mod_authz_core.c>
            Require all granted
            </IfModule>
        </Directory>
    </VirtualHost># construccion


text:
@implementation NSString (Extension)

- (CGSize)sizeWithFont:(UIFont *)font {
    return [self sizeWithFont:font maxWidth:MAXFLOAT];
}

- (CGSize)sizeWithFont:(UIFont *)font maxWidth:(CGFloat)maxW {
    NSMutableDictionary *attrs = [NSMutableDictionary dictionary];
    attrs[NSFontAttributeName] = font;
    CGSize maxSize = CGSizeMake(maxW, MAXFLOAT);
    return [self boundingRectWithSize:maxSize options:NSStringDrawingUsesLineFragmentOrigin attributes:attrs context:nil].size;
}

- (CGSize)sizeWithFont:(UIFont *)font maxHeight:(CGFloat)maxH {
    NSMutableDictionary *attrs = [NSMutableDictionary dictionary];
    attrs[NSFontAttributeName] = font;
    CGSize maxSize = CGSizeMake(MAXFLOAT, maxH);
    return [self boundingRectWithSize:maxSize options:NSStringDrawingUsesLineFragmentOrigin attributes:attrs context:nil].size;
}

@end


text:
/**
 * @description: Poll interface functions
 * @author Lukas Larsson
 *
 * The functions in the header are used to interact with the poll
 * implementation. Iff the kernel-poll implementation needs a fallback
 * pollset, then all functions are exported twice. Once with a _flbk
 * suffix and once without any suffix. If no fallback is needed, then
 * only the non-suffix version is exported.
 */

/**
 * Initialize the poll implementation. Has to be called before any other function.
 * @param[out] concurrent_waiters if not NULL, set to 1 if more then one thread
 * is allowed to wait in the pollsets at the same time.
 */
void ERTS_POLL_EXPORT(erts_poll_init)(int *concurrent_waiters);
/**
 * @brief Create a new pollset.
 * @param id The unique debug id of this pollset.
 */
ErtsPollSet *ERTS_POLL_EXPORT(erts_poll_create_pollset)(int id);

/**
 * Modify the contents of a pollset. This function can be called while one
 * (or possibly more) thread is waiting in the pollset.
 *
 * @param ps the pollset to modify
 * @param fd the file descriptor to modify
 * @param op the type of operation to do. Normal usage is ADD,MOD...MOD,DEL.
 * @param evts the events that we are changing interest to. Ignored if op is DEL.
 * @param[in] wake_poller if set to 1 any thread waiting in the pollset will be woken.
 *   This parameter is ignored if the pollset supports concurrent waiters.
 * @param[out] wake_poller set to 1 if the waiting thread was woken.
 * @return The events set, or ERTS_POLL_EV_NVAL if it was not possible to add the
 * fd to the pollset.
 */
ErtsPollEvents ERTS_POLL_EXPORT(erts_poll_control)(ErtsPollSet *ps,
                                                   ErtsSysFdType fd,
                                                   ErtsPollOp op,
                                                   ErtsPollEvents evts,
                                                   int *wake_poller);

/**
 * Wait for events to be ready in the pollset. If the erts_poll_init call
 * set concurrent_waiters to 1, then multiple threads are allowed to call
 * this function at the same time.
 *
 * When an event has been triggered on a fd, that event is disabled. To
 * re-enable it the implementation has to call erts_poll_control again.
 *
 * @param ps the pollset to wait for events in
 * @param res an array of fd results that the ready fds are put in.
 * @param[in] length the length of the res array
 * @param[out] length the number of ready events returned in res
 * @return 0 on success, else the ERRNO of the error that happened.
 */
int ERTS_POLL_EXPORT(erts_poll_wait)(ErtsPollSet *ps,
                                     ErtsPollResFd res[],
                                     int *length);
/**
 * Interrupt the thread waiting in the pollset. This function should be called
 * with set = 0 before any thread calls erts_poll_wait in order to clear any
 * interrupts that have happened while the thread was awake.
 *
 * This function has no effect on pollsets that support concurrent waiters.
 *
 * @param ps the pollset to wake
 * @param set if 1, interrupt the pollset, if 0 clear the interrupt flag.
 */
void ERTS_POLL_EXPORT(erts_poll_interrupt)(ErtsPollSet *ps, int set);

/* Debug functions */

/**
 * Get the maximum number of fds supported by the pollset
 */
int ERTS_POLL_EXPORT(erts_poll_max_fds)(void);
/**
 * Get information about the given pollset
 */
void ERTS_POLL_EXPORT(erts_poll_info)(ErtsPollSet *ps,
                                      ErtsPollInfo *info);
/**
 * Get information about which events are currently selected.
 *
 * The unix fd is used to index into the array, so naturally this function does
 * not work on windows. If the pollset cannot figure out what the selected
 * events for a given fd is, it is set to ERTS_POLL_EV_NONE.
 *
 * @param ps the pollset to get events from
 * @param evts an array of which events are selected on.
 */
void ERTS_POLL_EXPORT(erts_poll_get_selected_events)(ErtsPollSet *ps,
                                                     ErtsPollEvents evts[],
                                                     int length);

#ifdef ERTS_ENABLE_LOCK_COUNT
/**
 * Enable lock counting of any locks within the pollset.
 */
void ERTS_POLL_EXPORT(erts_lcnt_enable_pollset_lock_count)(ErtsPollSet *, int enable);
#endif


text:
<?php get_header() ?>

                <?php while (have_posts()) : the_post() ?>
                    <article id="post-<?php the_ID() ?>" <?php post_class('entry') ?>>

<?php the_title() ?>

                                A.P.E.R. FECT solution for controlling kidney disease, prolonging health and life. A.P.E.R. is a simple four-phase program, the promotion of which will inevitably improve therapies and remedies, and will prevent medical precursors from developing into renal disease.

Awareness

Inform people about the warning signs of renal disease.

                                    What should they look for?

                                    What tests are available?

Prevention

                                Show individuals how to reduce the risk of getting
                                renal disease from one of its precursors.

Education

                                Give people the information they need. They will
                                share it with other members of the community. When
                                they know what to look for, the likelihood of actually
                                developing renal disease decreases.

Research

                                Support and fund genetic research. Please volunteer
                                and be a part of clinical or medical studies if you suffer
                                from renal disease. Ask for government funding for research
                                projects.

                <?php endwhile ?>

<?php get_footer() ?>


text:
Swap Episodes from {{ $channel->channel_name }} to:

            <form class="col s12" id="swap_episodes" action="#" method="POST">
                <input type="hidden" id="token" name="_token" value="{{ csrf_token() }}">
                <input type="hidden" value="{{ $channel->id }}" name="channel_id" id="channel_id">

                        <select name="new_channel_id" class="spacer" id="new_channel_id">
                            @foreach($channels as $ch)
                            <option value="{{$ch->id}}">{{$ch->channel_name}}</option>
                            @endforeach
                        </select>

                <input type="submit"  value ="swap" class="btn-large" />
            </form>


text:
namespace Wires.Sample.ViewModel
{
	using System.Collections.Generic;
	using Newtonsoft.Json;

	public class PostsData
	{
		[JsonProperty("children")]
		public IEnumerable<PostData> Children { get; set; }
	}
}


text:
package org.crazynut.harmony.minjre.anttask;

import java.util.Vector;
import java.io.File;

import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Task;
import org.apache.tools.ant.taskdefs.Ant.Reference;
import org.apache.tools.ant.types.Path;
import org.crazynut.harmony.minjre.StaticDependencyAnalyzer;

/**
 * The ant task that can analyze static dependency of a set of classes.
 *
 * @author  Ling-Hui Gong
 *
 */
public class AnalyzeDependencyTask extends Task{

	private File aim = null;

	private File jrelib = null;

	private Path path = null;

	public void execute() {
		if (null == aim || null == jrelib || 0 == path.size()) {
			log("Incorrect use of this task.\n");
			throw new BuildException();
		}

		String[] list = path.list();
		for (int i = 0; i < list.length; i++) {
			File file = new File(list[i]);
			if (file.isFile() && (!file.getName().endsWith(".jar") || !file.getName().endsWith(".class"))) {
				throw new BuildException(list[i]
				        + " is not a valid classpath.");
			}
		}
		log("Start to analyze static dependency.\n");
		log("Analyzing ...\n");
		StaticDependencyAnalyzer ana = new StaticDependencyAnalyzer();
		ana.setJreLibPath(jrelib.getAbsolutePath());
		for (int i = 0; i < list.length; i++) {
			ana.addClassPath(list[i]);
		}
		ana.getDependentClasses(aim.getAbsolutePath());
		log("Analyzing complete.\n");
	}

	public void setAim(File aim) {
		if (aim.isFile() || aim.getName().endsWith(".cns")) {
			this.aim = aim;
		} else {
			throw new BuildException(aim.getAbsolutePath()
					+ " is not a valid cns file.");
		}
	}

	public void setJrelib(File jrelib) {
		if (jrelib.isDirectory()) {
			this.jrelib = jrelib;
		} else {
			throw new BuildException(jrelib.getAbsolutePath()
					+ " is not a valid directory.");
		}
	}

	public Path createClasspath() {
        if (path == null) {
            path = new Path(getProject());
        }
        return path.createPath();
	}

}


text:
// Copyright 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

package org.chromium.base.annotations;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * @CalledByNative is used by the JNI generator to create the necessary JNI
 * bindings and expose this method to native code.
 */
@Target({ElementType.CONSTRUCTOR, ElementType.METHOD})
@Retention(RetentionPolicy.CLASS)
public @interface CalledByNative {
    /*
     *  If present, tells which inner class the method belongs to.
     */
    public String value() default "";
}


text:
<?php

/*
 * This file is part of PHP CS Fixer.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *     Dariusz Rumiński <dariusz.ruminski@gmail.com>
 *
 * This source file is subject to the MIT license that is bundled
 * with this source code in the file LICENSE.
 */

namespace PhpCsFixer\Fixer\Operator;

use PhpCsFixer\AbstractFixer;
use PhpCsFixer\Tokenizer\Tokens;

/**
 * @author Fabien Potencier <fabien@symfony.com>
 * @author Dariusz Rumiński <dariusz.ruminski@gmail.com>
 */
final class ObjectOperatorWithoutWhitespaceFixer extends AbstractFixer
{
    /**
     * {@inheritdoc}
     */
    public function isCandidate(Tokens $tokens)
    {
        return $tokens->isTokenKindFound(T_OBJECT_OPERATOR);
    }

    /**
     * {@inheritdoc}
     */
    public function fix(\SplFileInfo $file, Tokens $tokens)
    {
        // [Structure] there should not be space before or after T_OBJECT_OPERATOR
        foreach ($tokens as $index => $token) {
            if (!$token->isGivenKind(T_OBJECT_OPERATOR)) {
                continue;
            }

            // clear whitespace before ->
            if ($tokens[$index - 1]->isWhitespace(" \t") && !$tokens[$index - 2]->isComment()) {
                $tokens[$index - 1]->clear();
            }

            // clear whitespace after ->
            if ($tokens[$index + 1]->isWhitespace(" \t") && !$tokens[$index + 2]->isComment()) {
                $tokens[$index + 1]->clear();
            }
        }
    }

    /**
     * {@inheritdoc}
     */
    protected function getDescription()
    {
        return 'There should not be space before or after object T_OBJECT_OPERATOR.';
    }
}


text:
var windowLoadWidth;

$(window).on({

    load:function(){
        var menuBtn = $('.show-mobile-menu'),
            menu = $('.site__menu'),
            page = new Page(),
            menuShow = new MenuShow(menuBtn,menu);

        var heshPage = window.location.hash.replace("#","");

        $('.main-menu a ').each( function(){

            var curLink = $(this);

            if( curLink.text() == heshPage){

                curLink.trigger('click');

                window.location.hash="";

            }

        });

        var iOS = ( navigator.userAgent.match(/(iPad)/g) ? true : false );

        if(iOS){
            $('.videoBlock iframe').css({
                'width':'80%',
                'margin': '0 auto',
                'display':'block'
            })
            $('.videoBlock').css({
                'background':'#000'
            })
        }

    }

});
$( function(){

    windowLoadWidth = $(window).width();

    $(window).on('resize', function(){

        var curWidth = $(window).width();

        //if (curWidth != windowLoadWidth) { //http://stackoverflow.com/questions/9361968/javascript-resize-event-on-scroll-mobile

           if(!(device.mobile() || device.tablet())) { // Infinite reloads

            if( ( windowLoadWidth > 1000  && curWidth < 1000) || (windowLoadWidth < 1000 && curWidth > 1000 ) ){
                location.reload();
            }
            windowLoadWidth = curWidth;

        }

    });

    var iOS = ( navigator.userAgent.match(/(iPad)/g) ? true : false );

    if(!device.tablet()){

        $("meta[name='viewport']").attr('content','width=device-width, initial-scale=1.0, maximum-scale=1.0 , user-scalable=no');

    }else{

        document.ontouchmove = function(e){
            e.preventDefault();
        }
    }

    $('.download-btn a').on('mouseover', function(){

        $(this).parents('.download-btn ').addClass('download-btn__hover');

    });

    $('.download-btn a').on('mouseout', function(){

        $(this).parents('.download-btn ').removeClass('download-btn__hover');

    });

} );
var Page = function(){
    this.items = $('.site__page');
    this.window = $(window);
    this.minHeight = 600;
    this.contents = $('.site__center');
    this.timer = setTimeout(function(){}, 0);
    this.timer2 = setTimeout(function(){}, 0);
    this.scroll = false;
    this.scrollMouse = false;
    this.menu = $('.site__menu');
    this.windowWidth = $(window).width();
    this.windowHeight = $(window).height();
    this.videoBtn =  $('.video-call');
    this.pageContents =  $('.site__content');
    this.videoContainer =  $('.videoBlock');
    this.nextPageBtn = $('.down-btn');
    this.prevPageBtn = $('.up-btn');
    this.menuLnk = $( '.main-menu a' );
    this.videoCloseBtn =  $('.videoBlock__close');
    this.activeIndex = 0;
    this.action = false;
    this.activePage = $('.site__page.active');
    this.animationArrDown = [
      4200, 1100, 2800, 1400, 1100
    ];
    this.siteMenuLogo = $( '.site__menu__logo' );
    this.animationArrUp = [
        1500, 1100, 800, 1600, 1100
    ];

    this.init();
};
Page.prototype = {
    init: function(){
        var self = this;

        self.core = self.core();
        self.core.build();
    },
    core: function(){
        var self = this;

        return {
            build: function(){
                self.core.setSize();
                self.core.controls();
                self.core.startPage();
                self.core.mobilileHeight();
                self.core.resize();
            },
            setSize: function (){
                self.contents.each(function(){
                    var curItem = $( this );

                    curItem.height( '100%' );

                    var newH = curItem.parents( '.site__page' ).height();

                    if ( newH < self.minHeight ){
                        newH=self.minHeight;
                    }

                    curItem.height( newH );
                })
            },
            mobilileHeight:function(){

                if($(window).width()<1000){

                    $('header.site__page.active').height($(window).height());

                    $('header.site__page.active .site__center').css({
                        'height': $(window).height(),
                        'min-height':  $(window).height()
                    });

                    $('header.site__page.active .site__content').eq(0).css({
                        'height': $(window).height()
                    });

                }

            },
            startPage: function(){

                self.downBtn = $('.down-btn');
                self.bigLogo = $('.logo');

                self.bigLogo.fadeIn(1000, function(){
                    self.downBtn.fadeIn(1000);
                });

            },
            downToPage1: function(){
                var pageContentCur = self.items.eq( 0 ),
                    pageContentNext = self.items.eq( 1 ),
                    textBlock = pageContentNext.find('.colored-text'),
                    videoBlokc = pageContentNext.find('.colored-video'),
                    textShow = pageContentNext.find('.colored-text__show'),
                    windW = 0;

                self.bigLogo.animate( {
                    top: -self.bigLogo.height()
                }, {
                    easing: 'easeInOutQuad',
                    duration: 500,
                    complete: function(){
                        pageContentCur.find( '.down-btn').fadeOut( 300, function(){
                            pageContentCur.removeClass( 'active' );
                            pageContentNext.addClass( 'active' );
                            pageContentCur.scrollTop( 0 );

                            windW = pageContentNext.find( '.site__content' ).width();

                            textBlock.css({
                                left: -windW/2
                            });

                            videoBlokc.css({
                                right: -windW/2
                            });

                            self.menu.animate({
                                top: 0
                            }, {
                                duration: 300,
                                easing: 'easeOutQuad',
                                complete: function(){
                                    videoBlokc.animate({
                                        right: 0
                                    }, {
                                        duration: 500,
                                        easing: 'easeOutQuad'
                                    } );
                                    textBlock.css( {
                                        display:'block'
                                    } );
                                    textBlock.animate({
                                        left: 0
                                    },{
                                        complete: function(){
                                            textBlock.css( {
                                                display:'table'
                                            } );
                                            textShow.fadeTo(500, 1);
                                            self.action = false;
                                        },
                                        duration: 500,
                                        easing: 'easeOutQuad'
                                    });
                                }
                            });

                        } );
                    }
                } );
            },
            downToPage2: function(){

                var pageContentCur = self.items.eq( 1 ),
                    pageContentNext = self.items.eq( 2 ),
                    textBlock = pageContentCur.find('.colored-text'),
                    textShow = pageContentCur.find('.colored-text__show'),
                    firstBlock = pageContentNext.find('.instruction-back'),
                    secondBlock = pageContentNext.find('.about-text__wrap'),
                    windW = pageContentCur.find( '.site__content' ).width();

                $( 'body' ).css( {
                    background: '#2d333d'
                } );
                textShow.fadeTo( 300, 0, function(){
                    textBlock.css( {
                        display:'block'
                    } );
                    textBlock.animate( {
                        left: windW/2
                    }, {
                        duration: 500,
                        easing: 'easeInOutQuad',
                        complete: function(){
                            pageContentCur.removeClass( 'active' );
                            pageContentNext.addClass( 'active' );
                            pageContentCur.scrollTop( 0 );

                            textBlock.css( {
                                display:'table'
                            } );

                            firstBlock.css( { display: 'none' } );
                            secondBlock.css( { display: 'none' } );

                            firstBlock.fadeIn( 300 );
                            secondBlock.fadeIn( 300, function (){
                                self.action = false;
                            } );
                        }
                    } );
                } );
            },
            downToPage3: function(){
                var pageContentCur = self.items.eq( 2 ),
                    pageContentNext = self.items.eq( 3 ),
                    firstBlock = pageContentNext.find('.instruction-back'),
                    secondBlock = pageContentNext.find('.about-text'),
                    squeres = pageContentNext.find('.squeres'),
                    pageText = pageContentNext.find('.download-page__text'),
                    items = pageContentNext.find('.download-page__text li');

                pageContentNext.addClass( 'active' );
                pageContentNext.css( { top: self.window.height() } );
                pageContentCur.css( { height: self.window.height() - 115 } );
                pageContentNext.css( { height: self.window.height() - 115 } );
                squeres.css( { display: 'none' } );
                pageText.css( { display: 'none' } );
                items.css( { opacity: 0 } );

                pageContentCur.animate( {
                    top: -(self.window.height()-( 115 * 2 ) )
                },{
                    duration: 500,
                    easing: 'easeInOutQuad'
                } );
                pageContentNext.animate( {
                    top: 115
                },{
                    easing: 'easeInOutQuad',
                    duration: 500,
                    complete: function(){
                        pageContentCur.removeClass( 'active' );
                        pageContentCur.removeAttr( 'style' );
                        pageContentCur.scrollTop( 0 );
                        pageContentNext.removeAttr( 'style' );

                        squeres.fadeIn( 500, function(){
                            pageText.fadeIn( 300, function(){
                                items.each( function( i ){
                                    showItems( $( this ), i );
                                } );
                            } );
                        } );
                    }
                } );

                function showItems( item, i ){
                    item.css( { top: 50} );
                    setTimeout( function(){
                        item.animate({
                            top: 0,
                            opacity: 1
                        },{
                            specialEasing: {
                                top: 'easeOutBounce',
                                opacity: 'easeInOutQuad'
                            },
                            duration: 500,
                            complete: function(){
                                $( this ).removeAttr( 'style' );

                                if(i == 3 ){
                                    self.action = false;
                                }
                            }
                        } );
                    }, i * 300 );
                }
            },
            downToPage4: function(){

                var pageContentCur = self.items.eq( 3 ),
                    pageContentNext = self.items.eq( 4 ),
                    squeres = pageContentCur.find('.squeres'),
                    text = $('.resources'),
                    pageText = pageContentCur.find('.download-page__text h2,.download-page__text p'),
                    items = pageContentCur.find('.download-page__text');

                text.css({
                    'display':'none'
                });
                $( 'body' ).css( { background: '#353c4c' } );
                pageContentNext.css( { background: '#353c4c' } );

                pageText.fadeTo( 300, 0, function(){
                    squeres.fadeOut( 300 );
                    items.animate( {
                        top: -107
                    }, {
                        duration: 500,
                        easing: 'easeInOutQuad',
                        complete: function(){
                            pageContentCur.removeClass( 'active' );
                            pageContentCur.removeAttr( 'style' );
                            pageContentNext.addClass( 'active' );

                            setTimeout( function(){
                                pageContentNext.addClass( 'active-shtorka' );
                            },50 );

                            setTimeout( function(){
                                pageContentCur.scrollTop(0);
                                text.fadeIn();
                                    self.action = false;
                            }, 600 );
                        }
                    } );
                } );

            },
            downToPage5: function(){

                var pageContentCur = self.items.eq( 4 ),
                    pageContentNext = self.items.eq( 5 ),
                    backImg = pageContentNext.find('.contacts__back'),
                    conatctsText = pageContentNext.find('.contacts > div:first-child');

                $( 'body' ).css( { background: '#d05f6b' } );

                pageContentNext.find( 'site__content' ).css( { position: 'static' } );

                pageContentNext.addClass( 'active' );
                pageContentNext.css( { top: self.window.height() } );
                pageContentCur.css( { height: self.window.height() - 115 } );
                pageContentNext.css( { height: self.window.height() - 115 } );
                backImg.css( { display: 'none' } );
                conatctsText.css( { opacity: 0 } );

                pageContentCur.animate( {
                    top: -(self.window.height()-( 115 * 2 ) )
                },{
                    duration: 500,
                    easing: 'easeInOutQuad'
                } );
                pageContentNext.animate( {
                    top: 115
                },{
                    easing: 'easeInOutQuad',
                    duration: 500,
                    complete: function(){
                        pageContentNext.removeAttr( 'style' );
                        pageContentCur.removeClass( 'active' );
                        pageContentCur.removeAttr( 'style' );

                        pageContentCur.css( { background: '#353c4c' } );
                        backImg.fadeIn( 300, function(){
                            conatctsText.fadeTo( 300, 1, function(){
                                self.action = false;
                            } );
                        } );
                    }
                } );
            },
            moveUp: function (newIndex){
                var total = 0,
                    i;

                for( i = self.activeIndex-1; i != (newIndex-1); i-- ){

                    toNextPage (total);
                    total += self.animationArrUp[ i ] + 100;
                }
                function toNextPage (duration){
                    setTimeout( function(){
                        self.core.prevPage();
                    },duration );
                }
            },
            moveDown: function(newIndex){
                var total = 0;

                for( i = self.activeIndex; i != newIndex; i++ ){

                    toNextPage (total);
                    total += self.animationArrDown[ i ] + 100
                }

                function toNextPage (duration){
                    setTimeout( function(){

                        self.core.nextPage();
                    },duration );
                }
            },
            resize: function(){
                var curContent;

                self.pageContents.each( function(i){
                    curContent = $( this );
                    if( i == 1 ){
                        var firstBlock = curContent.find( '.colored-text' ),
                            secondBlock = curContent.find( '.colored-video'),
                            newH = 0;

                        firstBlock.height( 'auto' );
                        secondBlock.height( 'auto' );
                        curContent.height( 'auto' );

                        if( firstBlock.outerHeight() > 463 ){
                            newH = firstBlock.outerHeight();
                        } else {
                            newH = 463;
                        }

                        if( newH <  ( self.window.height() - 115 ) ) {
                            newH = ( self.window.height() - 115 );
                        }

                        firstBlock.height(newH);
                        secondBlock.outerHeight(newH);
                        curContent.outerHeight(newH);
                    } else if( i == 2 ){
                        var firstBlock = curContent.find( '.instruction-back' ),
                            firstBlockTable = curContent.find( '.instruction-back__tabel'),
                            firstBlockTableCell = curContent.find( '.instruction-back__tabel-cell'),
                            secondBlock = curContent.find( '.about-text'),
                            newH = 0;

                        firstBlock.height( 'auto' );
                        secondBlock.height( 'auto' );
                        curContent.height( 'auto' );
                        firstBlockTable.height( 'auto' );
                        //curContent.height( 'auto' );

                        if( firstBlock.outerHeight() > secondBlock.outerHeight() ){
                            newH = firstBlock.outerHeight();
                        } else {
                            newH = secondBlock.outerHeight();
                        }

                        if( newH < ( self.window.height() - 115 ) ) {
                            newH = ( self.window.height() - 115 );
                        }

                            firstBlock.height(newH);
                            firstBlockTable.height(newH);
//                            firstBlockTableCell.outerHeight(newH);
                            secondBlock.height(newH);
                            curContent.height(newH);
                    } else if( i == 3 ){
                        var firstBlock = curContent.find( '.download-page' ),
                            newH = 550;

                        firstBlock.height( newH );

                        if( newH <  ( self.window.height() - 115 ) ) {
                            newH = ( self.window.height() - 115 );
                        }

                        firstBlock.outerHeight(newH);
                        curContent.outerHeight(newH);
                    } else if( i == 4 ){
                        var firstBlock = curContent.find( '.resources' ),
                            newH = 506;

                        if( newH <  ( self.window.height() - 115 ) ) {
                            newH = ( self.window.height() - 115 );
                        }

                        curContent.outerHeight(newH);
                        curContent.css( {
                            overflow: 'hidden',
                            position: 'relative'
                        } );
                    } else if( i == 5 ){
                        var newH = 500;

                        if( newH <  ( self.window.height() - 115 ) ) {
                            newH = ( self.window.height() - 115 );
                        }

                        curContent.outerHeight(newH);
                    }
                } );
            },
            upToPage0: function(){

                var pageContentCur = self.items.eq( 0 ),
                    pageContentNext = self.items.eq( 1 ),
                    textBlock = pageContentNext.find('.colored-text'),
                    videoBlokc = pageContentNext.find('.colored-video'),
                    textShow = pageContentNext.find('.colored-text__show'),
                    windW = pageContentNext.find( '.site__content' ).width();

                textShow.fadeTo(500, 0, function(){
                    videoBlokc.animate({
                        right: -windW/2
                    }, {
                        duration: 500,
                        easing: 'easeOutQuad'
                    } );

                    self.menu.animate({
                        top: -115
                    }, {
                        duration: 300,
                        easing: 'easeOutQuad'
                    } );

                    textBlock.css( {
                        display:'block'
                    } );

                    textBlock.animate({
                        left: -windW/2
                    },{
                        complete: function(){
                            textBlock.css( {
                                display:'table'
                            } );
                            pageContentCur.addClass( 'active' );
                            pageContentNext.removeClass( 'active' );

                            self.bigLogo.animate( {
                                top: '50%'
                            }, {
                                easing: 'easeInOutQuad',
                                duration: 500,
                                complete: function(){
                                    self.action = false;
                                }
                            });
                            pageContentCur.find( '.down-btn').fadeIn( 500 );
                        },
                        duration: 500,
                        easing: 'easeOutQuad'
                    });
                });
            },
            upToPage1: function(){

                var pageContentCur = self.items.eq( 1 ),
                    pageContentNext = self.items.eq( 2 ),
                    textBlock = pageContentCur.find('.colored-text'),
                    textShow = pageContentCur.find('.colored-text__show'),
                    firstBlock = pageContentNext.find('.instruction-back'),
                    secondBlock = pageContentNext.find('.about-text__wrap');

                firstBlock.fadeOut( 300 );
                secondBlock.fadeOut( 300, function(){
                    pageContentCur.addClass( 'active' );
                    pageContentNext.removeClass( 'active' );

                    firstBlock.css( { display: 'block' } );
                    secondBlock.css( { display: 'block' } );

                    textBlock.css( {
                        display:'block'
                    } );
                    textBlock.animate( {
                        left: 0
                    }, {
                        duration: 500,
                        easing: 'easeInOutQuad',
                        complete: function(){
                            textBlock.css( {
                                display:'table'
                            } );
                            textShow.fadeTo( 300, 1, function(){
                                $( 'body' ).css( {
                                    background: '#fff'
                                } );
                                self.action = false;
                            } );
                        }
                    });
                } );

            },
            upToPage2: function(){
                var pageContentCur = self.items.eq( 2 ),
                    pageContentNext = self.items.eq( 3 ),
                    firstBlock = pageContentNext.find('.instruction-back'),
                    secondBlock = pageContentNext.find('.about-text'),
                    squeres = pageContentNext.find('.squeres'),
                    pageText = pageContentNext.find('.download-page__text');

                pageText.fadeOut( 300 );
                squeres.fadeOut( 300, function(){
                    pageContentCur.addClass('active');
                    pageContentCur.css( {
                        height: self.window.height() - 115,
                        top: -(self.window.height()-( 115 * 2 ) )
                    } );

                    pageContentNext.animate( {
                        top: '100%'
                    }, {
                        duration: 500,
                        easing: 'easeInOutQuad'
                    } );
                    pageContentCur.animate( {
                        top: 115
                    }, {
                        duration: 500,
                        easing: 'easeInOutQuad',
                        complete: function(){
                            pageContentNext.removeAttr( 'style' );
                            pageContentNext.removeClass( 'active' );
                            pageContentCur.removeAttr( 'style' );
                            self.action = false;
                        }
                    } );
                } );

            },
            upToPage3: function(){

                var pageContentCur = self.items.eq( 3 ),
                    pageContentNext = self.items.eq( 4 ),
                    squeres = pageContentCur.find('.squeres'),
                    pageText = pageContentCur.find('.download-page__text h2,.download-page__text p'),
                    items = pageContentCur.find('.download-page__text');

                pageContentNext.removeClass( 'active-shtorka' );

                setTimeout( function(){

                    pageContentCur.addClass( 'active' );
                    pageContentNext.removeClass( 'active' );

                    squeres.fadeIn( 300, function(){
                        items.animate( {
                            top: '50%'
                        }, {
                            duration: 500,
                            easing: 'easeInOutQuad',
                            complete: function() {
                                pageText.fadeTo( 300, 1, function(){
                                    $( 'body' ).css( { background: '#fff' } );
                                    self.action = false;
                                } )
                            }
                        } );
                    } );

                }, 500 );

            },
            upToPage4:function(){

                var pageContentCur = self.items.eq( 4 ),
                    pageContentNext = self.items.eq( 5 ),
                    backImg = pageContentNext.find('.contacts__back'),
                    conatctsText = pageContentNext.find('.contacts > div:first-child');

                pageContentCur.css( { background: '#353c4c' } );

                conatctsText.fadeTo( 300,0, function(){
                    backImg.fadeOut( 300, function(){
                        pageContentCur.addClass('active');
                        pageContentCur.css( {
                            height: self.window.height() - 115,
                            top: -(self.window.height()-( 115 * 2 ) )
                        } );

                        pageContentNext.animate( {
                            top: '100%'
                        }, {
                            duration: 500,
                            easing: 'easeInOutQuad'
                        } );
                        pageContentCur.animate( {
                            top: 115
                        }, {
                            duration: 500,
                            easing: 'easeInOutQuad',
                            complete: function(){
                                pageContentNext.removeAttr( 'style' );
                                pageContentNext.removeClass( 'active' );
                                pageContentCur.removeAttr( 'style' );

                                $( 'body' ).css( { background: '#353c4c' } );
                                pageContentCur.css( { background: '#353c4c' } );

                                self.action = false;
                            }
                        } );
                    } );
                } );
            },
            controls: function(){

                $('.colored-download').on('click', function(){

                    $('.main-menu a').eq(1).trigger('click');
                    return false;

                });

                self.videoBtn.on('click', function(){

                    var curElem = $(this);

                    self.core.videOpen(curElem)

                    return false;

                });

                var iOSPh = ( navigator.userAgent.match(/(iPhone)/g) ? true : false );
                if(iOSPh){

                   $('.down-btn').bind('touchstart', function(){

                       self.core.nextPage();

                       return false;

                   });

                    self.videoCloseBtn.bind('touchend', function(e){

                        var curElem = $(this);

                        self.core.videoHide(curElem);

                        return false;

                    });

                    var move = false;

                    self.videoBtn.on('touchmove', function(){

                        move = true;

                    });

                    self.videoBtn.bind('touchend', function(e){

                        if(move == false){

                            var curElem = $(this);

                            self.core.videOpen(curElem);

                        }
                        move = false;

                        return false;

                    });

                };

                var iOS = ( navigator.userAgent.match(/(iPad)/g) ? true : false );

                if(device.mobile()){

                    $('.up-btn').on('click', function(){

                        $('body').animate({
                            scrollTop: 0
                        });

                        return false;
                    });

                    $('.down-btn').on('click', function(){

                        $('body').animate({
                            scrollTop: $('.colored-video').offset().top
                        });

                        return false;
                    });

                    $('.down-btn').on('touchstart', function(){

                        $('body').animate({
                            scrollTop: $('.colored-video').offset().top
                        });

                        return false;
                    });

                    $('.up-btn').bind('touchstart', function(e){

                        $('body').animate({
                            scrollTop: 0
                        });

                        return false;

                    });

                }
                if(device.tablet()){

                    $$('body').swipeDown(function(){

                        self.core.prevPage();

                    });

                    $$('body').swipeUp(function(){
                        self.core.nextPage();

                    });

                    self.videoCloseBtn.bind('touchstart', function(e){

                        var curElem = $(this);

                        self.core.videoHide(curElem);

                        return false;

                    });

                    $$('.video-call').tap( function(e){

                        var curElem = $(this);

                        self.core.videOpen(curElem);

                        return false;

                    });

                    self.menuLnk.bind('touchstart', function(e){

                        var curItem = $( this),
                            newindex;

                        self.menuLnk.removeClass( 'active' );

                        curItem.addClass('active');

                        newindex = self.menuLnk.index( curItem ) + 2;

                        if( newindex > self.activeIndex ){
                            self.core.moveDown( self.menuLnk.index( curItem ) + 2 );
                        } else if ( newindex < self.activeIndex ) {
                            self.core.moveUp( self.menuLnk.index( curItem ) + 2 );
                        }

                        return false;

                    });

                };

                self.prevPageBtn.on('click', function(){

                    self.core.prevPage();

                    return false;

                });

                self.nextPageBtn.on('click', function(){

                    self.core.nextPage();

                    return false;

                });

                self.siteMenuLogo.on( {
                    click: function(){
                        self.core.moveUp( 0 );

                        return false;
                    }
                } );

                self.menuLnk.on( {
                    'click': function(){
                        var curItem = $( this),
                            newindex;

                        self.menuLnk.removeClass( 'active' );

                        curItem.addClass('active');

                        newindex = self.menuLnk.index( curItem ) + 2;

                        if( newindex > self.activeIndex ){
                            self.core.moveDown( self.menuLnk.index( curItem ) + 2 );
                        } else if ( newindex < self.activeIndex ) {
                            self.core.moveUp( self.menuLnk.index( curItem ) + 2 );
                        }

                        return false;
                    }
                } );

                $('body').on( {
                    keydown: function(e){

                        if(e.which == 27){

                            self.core.videoHide();

                        }
                    },
                    mousemove : function(e){
                        var x = e.pageX,
                            y = e.pageY;

                        $( '.contacts__back' ).css({
                            'left': -500 - ( (x-self.windowWidth)*0.03 ),
                            'top':  -500 - ( (y-self.windowHeight)*0.03 )
                        });

                        var curW = self.window.width(),
                            curH = self.window.height(),
                            degY = (( ( ( x - curW / 2 ) / ( curW / 2 ) ) * 30 ) * Math.PI)/180,
                            degX = (( ( ( y - curH / 2 ) / ( curH / 2 ) ) * 30 ) * Math.PI)/180;

                        var xMatrix = mat4.create(),
                            yMatrix = mat4.create(),
                            rezultMatrix = mat4.create();

                        mat4.rotateY(yMatrix, yMatrix, degY);
                        mat4.rotateX(xMatrix, xMatrix, degX);
                        mat4.multiply(rezultMatrix, xMatrix, yMatrix);

                        $( '.squeres' ).find('>div').css({
                            transform: 'matrix3d' + mat4.str(rezultMatrix).replace( 'mat4', '' ) + ''
                        });
                    }
                } );

                self.videoCloseBtn.on('click', function(){

                    var curElem = $(this);

                    self.core.videoHide(curElem);

                });

                self.window.on({
                    'resize':function(){
                        self.core.setSize();
                        self.core.resize();
                    },
                    'DOMMouseScroll':function( e ){
                        clearTimeout(self.timer2);

                        self.scrollMouse = true;

                        self.timer2=setTimeout(function(){

                            if( !self.scroll ) {
                                var direction = ( e.originalEvent.detail > 0 ) ? -1 : 1;
                                if(direction==1){
                                    self.core.prevPage();
                                }else{
                                    self.core.nextPage();
                                }
                            }

                            self.scroll = false;
                        },50);

                    },
                    'mousewheel': function( e ){

                        clearTimeout(self.timer2);

                        self.scrollMouse = true;

                        self.timer2=setTimeout(function(){

                            if( !self.scroll ) {
                                var direction = ( e.originalEvent.wheelDelta > 0 ) ? 1 : -1;
                                if(direction<0){
                                    self.core.nextPage();
                                }else{
                                    self.core.prevPage() ;
                                }
                            }

                            self.scroll = false;
                        },50);

                    }
                });

                self.items.on({
                    'scroll':function( e ){
                        if( self.scrollMouse ) {
                            self.scroll = true;
                        }
                        self.scrollMouse = false;
                        clearTimeout(self.timer2);
                    }
                });

            },
            videOpen: function(curElem){

                self.videoContainer.find('iframe').attr('src', curElem.attr('href')+"?wmode=transparent&autoplay=1");
                self.action = true;

                setTimeout(function(){

                    self.videoContainer.fadeIn();

                },300)

            },
            videoHide: function(){

                self.videoContainer.fadeOut(300);
                self.videoContainer.find('iframe').attr('src','');
                self.action = false;

            },
            menuActive: function(elem){

                if(elem == 2){
                    self.menuLnk.removeClass('active');

                }
                else{
                    self.menuLnk.removeClass('active');

                    self.menuLnk.eq(elem-3).addClass('active');

                }

            },
            nextPage:function(){
                self.timer=setTimeout(function(){

                    if(self.windowWidth > 1000){
                        if( !self.action && self.activeIndex<5){

                            self.action = true;

                            self.activeIndex++;

                            if( self.activeIndex == 1 ){

                                self.core.downToPage1();

                            } else if( self.activeIndex == 2){
                                self.core.menuActive(3)

                                self.core.downToPage2();

                            } else if( self.activeIndex == 3){

                                self.core.menuActive(4)

                                self.core.downToPage3();
                            }
                            else if( self.activeIndex == 4){
                                self.core.menuActive(5)

                                self.core.downToPage4();
                            }
                            else if( self.activeIndex == 5){
                                self.core.menuActive(6)

                                self.core.downToPage5();
                            }

                        }
                    }
                },50)
            },
            prevPage:function(){
                self.timer=setTimeout(function(){

                    if(self.windowWidth > 1000){
                        if(!self.action && self.activeIndex>=1){

                            self.action = true;
                            self.activeIndex--;
                            if( self.activeIndex == 0 ){

                                self.core.upToPage0();

                            } else if( self.activeIndex == 1){
                                self.core.menuActive(2)

                                self.core.upToPage1();

                            } else if( self.activeIndex == 2){

                                self.core.upToPage2();
                                self.core.menuActive(3)

                            }else if( self.activeIndex == 3){

                                self.core.menuActive(4)

                                self.core.upToPage3();

                            }else if( self.activeIndex == 4){
                                self.core.menuActive(5)

                                self.core.upToPage4();

                            }
                        }
                    }

                },50)
            },
            hidePageNext: function(){

                self.activePage.fadeOut();
                self.activePage.removeClass('active');
                self.activePage = self.activePage.next().addClass('active');

            },
            hidePagePrev: function(){

                self.activePage.fadeOut();
                self.activePage.removeClass('active');
                self.activePage  = self.activePage.prev().addClass('active');

            }
        };
    }
};

var MenuShow = function(menuBtn, menu){
    this.btn = menuBtn;
    this.menu = menu;
    this.menuItem = menu.find('a');
    this.windowWidth = $(window).width();

    this.init();
};
MenuShow.prototype = {
    init: function(){
        var self = this;

        self.core = self.core();
        self.core.build();
    },
    core: function(){
        var self = this;

        return {
            build: function(){
                self.core.controls();
            },
            controls: function(){

                self.btn.on('click', function(){

                    var curElem = $(this);

                    self.core.activeAdd(curElem);
                    self.core.menuShow(curElem);

                    return false;
                });

                if (self.windowWidth < 1000){

                    self.menuItem.on('click', function(e){

                        self.btn.removeClass('active');
                        self.menu.removeClass('show');

                        var anchor = $(this);
                        $('html, body').stop().animate({
                            scrollTop: $(anchor.attr('href')).offset().top
                        }, 1000);
                        e.preventDefault();

                        return false;

                    });

                }

            },
            activeAdd: function(e){

                if(e.hasClass('active')){

                    e.removeClass('active');

                }
                else{

                    e.addClass('active');

                }
            },
            menuShow: function(e){

                if(e.hasClass('active')){

                    self.menu.addClass('show');

                }
                else{

                    self.menu.removeClass('show');

                }

            }
        };
    }
};


text:
<?php

namespace Cpt\EventBundle\Form\Type;

use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Intl\Intl;

class CountryType extends AbstractType
{
    /**
     * {@inheritdoc}
     */
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $countries = Intl::getRegionBundle()->getCountryNames();

        $builder->add('country', 'country', array(
                'choices' => $countries,
                'preferred_choices' => array(
                    'FR', // France
                    'UK', // UK
                    'ES', // Spain
                    'DE', // Germany
                    'BE', // Belgium
                    'DK', // Denmark
                    'EL', // Greece
                    'IT', // Greece
                    'NL', // Netherlands
                    'US', // USA

                ),
            ));
    }

    /**
     * {@inheritdoc}
     */
    public function getName()
    {
        return 'cpt_country';
    }

    public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        $resolver->setDefaults(array(
            'data_class' => 'Cpt\EventBundle\Entity\Country',
        ));
    }

}


text:
package com.angkorteam.fintech.pages.client.common;

import java.util.Date;
import java.util.List;
import java.util.Map;

import org.apache.wicket.WicketRuntimeException;
import org.apache.wicket.authroles.authorization.strategies.role.annotations.AuthorizeInstantiation;
import org.apache.wicket.markup.html.form.TextArea;
import org.apache.wicket.markup.html.form.TextField;
import org.apache.wicket.markup.html.link.BookmarkablePageLink;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.Model;
import org.apache.wicket.model.PropertyModel;
import org.apache.wicket.request.mapper.parameter.PageParameters;
import org.joda.time.DateTime;

import com.angkorteam.fintech.Page;
import com.angkorteam.fintech.Session;
import com.angkorteam.fintech.ddl.MClient;
import com.angkorteam.fintech.ddl.MGroup;
import com.angkorteam.fintech.ddl.MLoan;
import com.angkorteam.fintech.dto.ClientEnum;
import com.angkorteam.fintech.dto.Function;
import com.angkorteam.fintech.dto.builder.loan.DisburseSavingBuilder;
import com.angkorteam.fintech.helper.ClientHelper;
import com.angkorteam.fintech.layout.Size;
import com.angkorteam.fintech.layout.UIBlock;
import com.angkorteam.fintech.layout.UIContainer;
import com.angkorteam.fintech.layout.UIRow;
import com.angkorteam.fintech.pages.client.center.CenterBrowsePage;
import com.angkorteam.fintech.pages.client.center.CenterPreviewPage;
import com.angkorteam.fintech.pages.client.client.ClientBrowsePage;
import com.angkorteam.fintech.pages.client.client.ClientPreviewPage;
import com.angkorteam.fintech.pages.client.group.GroupBrowsePage;
import com.angkorteam.fintech.pages.client.group.GroupPreviewPage;
import com.angkorteam.framework.SpringBean;
import com.angkorteam.framework.jdbc.SelectQuery;
import com.angkorteam.framework.models.PageBreadcrumb;
import com.angkorteam.framework.spring.JdbcNamed;
import com.angkorteam.framework.wicket.markup.html.form.Button;
import com.angkorteam.framework.wicket.markup.html.form.DateTextField;
import com.angkorteam.framework.wicket.markup.html.form.Form;
import com.google.common.collect.Lists;

import io.github.openunirest.http.JsonNode;

@AuthorizeInstantiation(Function.ALL_FUNCTION)
public class LoanAccountDisburseSavingPage extends Page {

    protected ClientEnum client;

    protected String clientId;
    protected String groupId;
    protected String centerId;

    protected String clientDisplayName;
    protected String groupDisplayName;
    protected String centerDisplayName;
    protected String loanAccountNo;

    protected String loanId;

    protected Form<Void> form;
    protected Button saveButton;
    protected BookmarkablePageLink<Void> closeLink;

    protected UIRow row1;

    protected UIBlock disbursedOnBlock;
    protected UIContainer disbursedOnIContainer;
    protected Date disbursedOnValue;
    protected DateTextField disbursedOnField;

    protected UIBlock row1Block1;

    protected UIRow row2;

    protected UIBlock transactionAmountBlock;
    protected UIContainer transactionAmountIContainer;
    protected Double transactionAmountValue;
    protected TextField<Double> transactionAmountField;

    protected UIBlock row2Block1;

    protected UIRow row3;

    protected UIBlock noteBlock;
    protected UIContainer noteIContainer;
    protected String noteValue;
    protected TextArea<String> noteField;

    protected UIBlock row3Block1;

    @Override
    protected void initComponent() {
        this.form = new Form<>("form");
        add(this.form);

        this.saveButton = new Button("saveButton");
        this.saveButton.setOnSubmit(this::saveButtonSubmit);
        this.form.add(this.saveButton);

        PageParameters parameters = new PageParameters();
        parameters.add("client", this.client.name());
        parameters.add("loanId", this.loanId);
        if (this.client == ClientEnum.Client) {
            parameters.add("clientId", this.clientId);
        } else if (this.client == ClientEnum.Center) {
            parameters.add("centerId", this.centerId);
        } else if (this.client == ClientEnum.Group) {
            parameters.add("groupId", this.groupId);
        } else {
            throw new WicketRuntimeException("Unknown " + this.client);
        }

        this.closeLink = new BookmarkablePageLink<>("closeLink", LoanAccountPreviewPage.class, parameters);
        this.form.add(this.closeLink);

        this.row1 = UIRow.newUIRow("row1", this.form);

        this.transactionAmountBlock = this.row1.newUIBlock("transactionAmountBlock", Size.Six_6);
        this.transactionAmountIContainer = this.transactionAmountBlock.newUIContainer("transactionAmountIContainer");
        this.transactionAmountField = new TextField<>("transactionAmountField", new PropertyModel<>(this, "transactionAmountValue"));
        this.transactionAmountIContainer.add(this.transactionAmountField);
        this.transactionAmountIContainer.newFeedback("transactionAmountFeedback", this.transactionAmountField);

        this.row1Block1 = this.row1.newUIBlock("row1Block1", Size.Six_6);

        this.row2 = UIRow.newUIRow("row2", this.form);

        this.disbursedOnBlock = this.row2.newUIBlock("disbursedOnBlock", Size.Six_6);
        this.disbursedOnIContainer = this.disbursedOnBlock.newUIContainer("disbursedOnIContainer");
        this.disbursedOnField = new DateTextField("disbursedOnField", new PropertyModel<>(this, "disbursedOnValue"));
        this.disbursedOnIContainer.add(this.disbursedOnField);
        this.disbursedOnIContainer.newFeedback("disbursedOnFeedback", this.disbursedOnField);

        this.row2Block1 = this.row2.newUIBlock("row2Block1", Size.Six_6);

        this.row3 = UIRow.newUIRow("row3", this.form);

        this.noteBlock = this.row3.newUIBlock("noteBlock", Size.Six_6);
        this.noteIContainer = this.noteBlock.newUIContainer("noteIContainer");
        this.noteField = new TextArea<>("noteField", new PropertyModel<>(this, "noteValue"));
        this.noteIContainer.add(this.noteField);
        this.noteIContainer.newFeedback("noteFeedback", this.noteField);

        this.row3Block1 = this.row3.newUIBlock("row3Block1", Size.Six_6);
    }

    @Override
    protected void configureMetaData() {
        this.noteField.setLabel(Model.of("Note"));
        this.disbursedOnField.setLabel(Model.of("Disbursed On"));
        this.transactionAmountField.setLabel(Model.of("Transaction Amount"));
    }

    @Override
    protected void initData() {
        this.client = ClientEnum.valueOf(getPageParameters().get("client").toString());

        this.clientId = getPageParameters().get("clientId").toString();
        this.groupId = getPageParameters().get("groupId").toString();
        this.centerId = getPageParameters().get("centerId").toString();

        this.loanId = getPageParameters().get("loanId").toString();
        this.disbursedOnValue = DateTime.now().toDate();

        JdbcNamed named = SpringBean.getBean(JdbcNamed.class);

        SelectQuery selectQuery = null;
        selectQuery = new SelectQuery(MLoan.NAME);
        selectQuery.addWhere(MLoan.Field.ID + " = '" + this.loanId + "'");
        selectQuery.addField(MLoan.Field.ACCOUNT_NO);
        selectQuery.addField(MLoan.Field.PRINCIPAL_AMOUNT);
        selectQuery.addField(MLoan.Field.LOAN_OFFICER_ID);
        Map<String, Object> loanObject = named.queryForMap(selectQuery.toSQL(), selectQuery.getParam());
        this.loanAccountNo = (String) loanObject.get("account_no");

        if (this.client == ClientEnum.Client) {
            selectQuery = new SelectQuery(MClient.NAME);
            selectQuery.addField(MClient.Field.OFFICE_ID);
            selectQuery.addField(MClient.Field.DISPLAY_NAME);
            selectQuery.addWhere(MClient.Field.ID + " = :" + MClient.Field.ID, this.clientId);
            Map<String, Object> clientObject = named.queryForMap(selectQuery.toSQL(), selectQuery.getParam());
            this.clientDisplayName = (String) clientObject.get("display_name");
        } else if (this.client == ClientEnum.Group) {
            selectQuery = new SelectQuery(MGroup.NAME);
            selectQuery.addField(MGroup.Field.OFFICE_ID);
            selectQuery.addField(MGroup.Field.DISPLAY_NAME);
            selectQuery.addWhere(MGroup.Field.ID + " = :" + MGroup.Field.ID, this.groupId);
            Map<String, Object> groupObject = named.queryForMap(selectQuery.toSQL(), selectQuery.getParam());
            this.groupDisplayName = (String) groupObject.get("display_name");
        } else if (this.client == ClientEnum.Center) {
            selectQuery = new SelectQuery(MGroup.NAME);
            selectQuery.addField(MGroup.Field.OFFICE_ID);
            selectQuery.addField(MGroup.Field.DISPLAY_NAME);
            selectQuery.addWhere(MGroup.Field.ID + " = :" + MGroup.Field.ID, this.centerId);
            Map<String, Object> centerObject = named.queryForMap(selectQuery.toSQL(), selectQuery.getParam());
            this.centerDisplayName = (String) centerObject.get("display_name");
        }

        this.transactionAmountValue = (Double) loanObject.get("principal_amount");
    }

    @Override
    public IModel<List<PageBreadcrumb>> buildPageBreadcrumb() {
        List<PageBreadcrumb> BREADCRUMB = Lists.newArrayList();
        {
            PageBreadcrumb breadcrumb = new PageBreadcrumb();
            if (this.client == ClientEnum.Client) {
                breadcrumb.setLabel("Clients");
            } else if (this.client == ClientEnum.Group) {
                breadcrumb.setLabel("Groups");
            } else if (this.client == ClientEnum.Center) {
                breadcrumb.setLabel("Centers");
            }
            BREADCRUMB.add(breadcrumb);
        }
        {
            PageBreadcrumb breadcrumb = new PageBreadcrumb();
            if (this.client == ClientEnum.Client) {
                breadcrumb.setLabel("Clients");
                breadcrumb.setPage(ClientBrowsePage.class);
            } else if (this.client == ClientEnum.Group) {
                breadcrumb.setLabel("Groups");
                breadcrumb.setPage(GroupBrowsePage.class);
            } else if (this.client == ClientEnum.Center) {
                breadcrumb.setLabel("Centers");
                breadcrumb.setPage(CenterBrowsePage.class);
            }
            BREADCRUMB.add(breadcrumb);
        }
        {
            PageBreadcrumb breadcrumb = new PageBreadcrumb();
            PageParameters parameters = new PageParameters();
            if (this.client == ClientEnum.Client) {
                parameters.add("clientId", this.clientId);
                breadcrumb.setLabel(this.clientDisplayName);
                breadcrumb.setPage(ClientPreviewPage.class);
            } else if (this.client == ClientEnum.Group) {
                parameters.add("groupId", this.groupId);
                breadcrumb.setLabel(this.groupDisplayName);
                breadcrumb.setPage(GroupPreviewPage.class);
            } else if (this.client == ClientEnum.Center) {
                parameters.add("centerId", this.centerId);
                breadcrumb.setLabel(this.centerDisplayName);
                breadcrumb.setPage(CenterPreviewPage.class);
            }
            breadcrumb.setParameters(parameters);
            BREADCRUMB.add(breadcrumb);
        }
        {
            PageBreadcrumb breadcrumb = new PageBreadcrumb();
            PageParameters parameters = new PageParameters();
            parameters.add("client", this.client.name());
            parameters.add("loanId", this.loanId);
            if (this.client == ClientEnum.Client) {
                parameters.add("clientId", this.clientId);
            } else if (this.client == ClientEnum.Group) {
                parameters.add("groupId", this.groupId);
            } else if (this.client == ClientEnum.Center) {
                parameters.add("centerId", this.centerId);
            }
            breadcrumb.setParameters(parameters);
            breadcrumb.setLabel(this.loanAccountNo);
            breadcrumb.setPage(LoanAccountPreviewPage.class);
            BREADCRUMB.add(breadcrumb);
        }
        {
            PageBreadcrumb breadcrumb = new PageBreadcrumb();
            breadcrumb.setLabel("Disburse To Saving Account");
            BREADCRUMB.add(breadcrumb);
        }
        return Model.ofList(BREADCRUMB);
    }

    protected void saveButtonSubmit(Button button) {
        DisburseSavingBuilder builder = new DisburseSavingBuilder();
        builder.withId(this.loanId);
        builder.withNote(this.noteValue);
        builder.withActualDisbursementDate(this.disbursedOnValue);
        builder.withTransactionAmount(this.transactionAmountValue);

        JsonNode node = ClientHelper.disburseToSavingLoanAccount((Session) getSession(), builder.build());

        if (reportError(node)) {
            return;
        }

        PageParameters parameters = new PageParameters();
        parameters.add("client", this.client.name());
        parameters.add("loanId", this.loanId);
        if (this.client == ClientEnum.Client) {
            parameters.add("clientId", this.clientId);
        } else if (this.client == ClientEnum.Center) {
            parameters.add("centerId", this.centerId);
        } else if (this.client == ClientEnum.Group) {
            parameters.add("groupId", this.groupId);
        } else {
            throw new WicketRuntimeException("Unknown " + this.client);
        }
        setResponsePage(LoanAccountPreviewPage.class, parameters);
    }

}


text:
package tmp

import (
	"testing"
)

type UselessStruct struct {
	ImportantField string
	T              *testing.T
}

var testFunc = func(t *testing.T, arg *string) {}

func assertEqual(t *testing.T, arg1, arg2 interface{}) {
	if arg1 != arg2 {
		t.Fail()
	}
}

func TestSomethingImportant(t *testing.T) {
	whatever := &UselessStruct{
		T:              t,
		ImportantField: "SECRET_PASSWORD",
	}
	something := &UselessStruct{ImportantField: "string value"}
	assertEqual(t, whatever.ImportantField, "SECRET_PASSWORD")
	assertEqual(t, something.ImportantField, "string value")

	var foo = func(t *testing.T) {}
	foo(t)

	strp := "something"
	testFunc(t, &strp)
	t.Fail()
}

func Test3Things(t *testing.T) {
	if 3 != 3 {
		t.Fail()
	}
}


text:
namespace nano
{
        ///
        /// \brief implements the factory pattern: create objects of similar type.
        ///
        template <typename tobject, typename... targs>
        class factory_t
	{
        public:
                using trobject = std::unique_ptr<tobject>;
                using tmaker = std::function<trobject(targs&&...)>;

                ///
                /// \brief register a new object with the given ID.
                ///
                template <typename tobject_impl>
                bool add(const string_t& id, const string_t& description);

                ///
                /// \brief check if an object was registered with the given ID.
                ///
                bool has(const string_t& id) const;

                ///
                /// \brief retrieve the object with the given ID.
                ///
                trobject get(const string_t& id, targs&&...) const;

                ///
                /// \brief get the IDs of the registered objects matching the ID regex.
                ///
                strings_t ids(const std::regex& id_regex = std::regex(".+")) const;

                ///
                /// \brief returns the number of registered objects.
                ///
                size_t size() const { return m_protos.size(); }

                ///
                /// \brief get the description of the object with the given ID.
                ///
                string_t description(const string_t& id) const;

	private:

                struct proto_t
                {
                        tmaker          m_maker;
                        string_t        m_description;
                };
                using protos_t = std::map<string_t, proto_t>;

                // attributes
                protos_t                m_protos;       ///< registered object instances
        };

        template <typename tobject, typename... targs> template <typename tobject_impl>
        bool factory_t<tobject, targs...>::add(const string_t& id, const string_t& description)
        {
                static_assert(std::is_base_of<tobject, tobject_impl>::value, "");
                const auto maker = [] (targs&&... args)
                {
                        return std::make_unique<tobject_impl>(std::forward<targs>(args)...);
                };
                return m_protos.emplace(id, proto_t{maker, description}).second;
        }

        template <typename tobject, typename... targs>
        bool factory_t<tobject, targs...>::has(const string_t& id) const
        {
                return m_protos.find(id) != m_protos.end();
        }

        template <typename tobject, typename... targs>
        typename factory_t<tobject, targs...>::trobject factory_t<tobject, targs...>::get(const string_t& id, targs&&... args) const
        {
                const auto it = m_protos.find(id);
                return (it == m_protos.end()) ? nullptr : it->second.m_maker(std::forward<targs>(args)...);
        }

        template <typename tobject, typename... targs>
        strings_t factory_t<tobject, targs...>::ids(const std::regex& id_regex) const
        {
                strings_t ret;
                for (const auto& proto : m_protos)
                {
                        if (std::regex_match(proto.first, id_regex))
                        {
                                ret.push_back(proto.first);
                        }
                }
                return ret;
        }

        template <typename tobject, typename... targs>
        string_t factory_t<tobject, targs...>::description(const string_t& id) const
        {
                const auto it = m_protos.find(id);
                return (it == m_protos.end()) ? string_t() : m_protos.at(id).m_description;
        }
}


text:
#include <Windows.h>
#include <iomanip>
#include "include/cef_base.h"
#include "include/cef_sandbox_win.h"
#include "helper_win.h"
#include "application_win.h"
#include "humblelogging/api.h"

#ifdef _DEBUG
#define DEFAULT_LOG_LEVEL humble::logging::LogLevel::All
#else
#define DEFAULT_LOG_LEVEL humble::logging::LogLevel::Error
#endif

// Set to 0 to disable sandbox support.
#define CEF_ENABLE_SANDBOX 0

#if CEF_ENABLE_SANDBOX
// The cef_sandbox.lib static library is currently built with VS2010. It may not
// link successfully with other VS versions.
#pragma comment(lib, "cef_sandbox.lib")
#endif

HUMBLE_LOGGER(logger, "WinMain");

int APIENTRY wWinMain(HINSTANCE hInstance,
                      HINSTANCE hPrevInstance,
                      LPTSTR    lpCmdLine,
                      int       nCmdShow)
{
  UNREFERENCED_PARAMETER(hPrevInstance);
  UNREFERENCED_PARAMETER(lpCmdLine);

#ifdef _DEBUG
  // DebugBreak();
#endif // _DEBUG

  // create the path manager
  std::shared_ptr<Helper::PathManager> pathManager =  std::make_shared<Helper::Paths_Win>();

  // init logging
  // init logging
  humble::logging::Factory& fac = humble::logging::Factory::getInstance();

  // Change the default LogLevel, which every NEW Logger will have.
  fac.setConfiguration(new humble::logging::SimpleConfiguration(DEFAULT_LOG_LEVEL));
  // Change the default Formatter (optional).
  fac.setDefaultFormatter(new humble::logging::PatternFormatter("[%date] [pid=%pid] [tid=%tid] [%lls] [line=%line] [file=%filename] %m\n"));
  // Add Appender which logs to file (rolling).
  Helper::Path logfile = pathManager->getAppDataDir() + "logging.log";
  humble::logging::RollingFileAppender* rfileAppender = new humble::logging::RollingFileAppender(logfile.filePath(), true, 5, 1024LL * 1024LL);
  fac.registerAppender(rfileAppender);

  std::stringstream ss;
  ss << "hPrvInstance=" << "0x" << std::hex << std::setfill('0') << std::setw(8) << hPrevInstance
     << ",hInstance="   << "0x" << std::hex << std::setfill('0') << std::setw(8) << hInstance;
  HL_DEBUG(logger, ss.str());

  void* sandbox_info = NULL;

#if CEF_ENABLE_SANDBOX
  // Manage the life span of the sandbox information object. This is necessary
  // for sandbox support on Windows. See cef_sandbox_win.h for complete details.
  CefScopedSandboxInfo scoped_sandbox;
  sandbox_info = scoped_sandbox.sandbox_info();
#endif

  // passing command-line
  CefMainArgs main_args(hInstance);

  // create app
  CefRefPtr<Application_Win> app = new Application_Win(hInstance, pathManager);

  // CEF applications have multiple sub-processes (render, plugin, GPU, etc)
  // that share the same executable. This function checks the command-line and,
  // if this is a sub-process, executes the appropriate logic.
  int exit_code = CefExecuteProcess(main_args, app.get(), sandbox_info);
  if (exit_code >= 0)
  {
    // The sub-process has completed so return here.
    return exit_code;
  }

  //TODO: move the settings into config.xml
  // Populate this structure to customize CEF behavior.
  // TODO: move to config.xml
  CefSettings appsettings;

#if !CEF_ENABLE_SANDBOX
  appsettings.no_sandbox = true;
#endif

  appsettings.remote_debugging_port = 9999;
  // TODO: get locale from system language
  CefString(&appsettings.locale) = "de_DE";
  CefString(&appsettings.cache_path) = app->pathManager()->getAppDataDir().filePath();

#ifdef _DEBUG
  // use single process for now.
  //appsettings.single_process = true;
#endif
  //appsettings.windowless_rendering_enabled = true;

  //bool offscreenrendering = false;

  //Application* myApp = static_cast<Application*>(app.get());
  //app->config()->getBoolPreference("OffScreenRendering", offscreenrendering);
  //appsettings.windowless_rendering_enabled = offscreenrendering;

  // Initialize CEF in the main process.
  CefInitialize(main_args, appsettings, app.get(), sandbox_info);

  // create the main window
  app->createMainWindow();

  // Run the CEF message loop. This will block until CefQuitMessageLoop() is called.
  CefRunMessageLoop();

  // Shut down CEF.
  CefShutdown();
  return 0;
}


text:
namespace Mairegger.Printing.Tests.Definition
{
    using Mairegger.Printing.Definition;
    using NUnit.Framework;

    [TestFixture]
    public class PrintOnPageTests
    {
        [Test]
        public void Ctor()
        {
            var attribute = new PrintOnPageAttribute(PrintAppendixes.All, new PageRange(2, 5));

            Assert.That(attribute.GetPrintDefinition(1), Is.EqualTo(PrintPartStatus.NotDefined));
            Assert.That(attribute.GetPrintDefinition(2), Is.EqualTo(PrintPartStatus.Include));
            Assert.That(attribute.GetPrintDefinition(3), Is.EqualTo(PrintPartStatus.Include));
            Assert.That(attribute.GetPrintDefinition(4), Is.EqualTo(PrintPartStatus.Include));
            Assert.That(attribute.GetPrintDefinition(5), Is.EqualTo(PrintPartStatus.Include));
            Assert.That(attribute.GetPrintDefinition(6), Is.EqualTo(PrintPartStatus.NotDefined));
        }

        [Test]
        public void Ctor1()
        {
            var attribute = new PrintOnPageAttribute(PrintAppendixes.All, 1, 3, 5);

            Assert.That(attribute.GetPrintDefinition(1), Is.EqualTo(PrintPartStatus.Include));
            Assert.That(attribute.GetPrintDefinition(2), Is.EqualTo(PrintPartStatus.NotDefined));
            Assert.That(attribute.GetPrintDefinition(3), Is.EqualTo(PrintPartStatus.Include));
            Assert.That(attribute.GetPrintDefinition(4), Is.EqualTo(PrintPartStatus.NotDefined));
            Assert.That(attribute.GetPrintDefinition(5), Is.EqualTo(PrintPartStatus.Include));
        }

        [Test]
        public void Ctor2()
        {
            var attribute = new PrintOnPageAttribute(PrintAppendixes.All, 3);

            Assert.That(attribute.GetPrintDefinition(1), Is.EqualTo(PrintPartStatus.NotDefined));
            Assert.That(attribute.GetPrintDefinition(2), Is.EqualTo(PrintPartStatus.NotDefined));
            Assert.That(attribute.GetPrintDefinition(3), Is.EqualTo(PrintPartStatus.Include));
            Assert.That(attribute.GetPrintDefinition(4), Is.EqualTo(PrintPartStatus.NotDefined));
            Assert.That(attribute.GetPrintDefinition(5), Is.EqualTo(PrintPartStatus.NotDefined));
        }
    }
}