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

<title>R-Index</title>
<meta name="date" content="2016-02-01">
<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Letter

Next Letter

Frames

No Frames

All Classes

A C D E G H I L M O P Q R S T U Z

R

RapidAndroidParser - Class in com.unh.unhcfreg

RapidAndroidParser() - Constructor for class com.unh.unhcfreg.RapidAndroidParser

readBinary(long, long, String) - Method in class systemComponent.ComponentBuilder

read the binary code with certain length and certain offset.

readZipFile(String) - Method in class systemComponent.ZipDecompressor

read the content of a file

returnValueType - Variable in class dataComponent.MethodElement

The string of the returnValue type of a method
 No return value is represented by string 'void'.

A C D E G H I L M O P Q R S T U Z

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Letter

Next Letter

Frames

No Frames

All Classes


text:
<resources>

    <!-- Base application theme. -->
    <!--<style name="AppTheme" parent="android:Theme.Holo.Light">-->
        <!--<!– Customize your theme here. –>-->
    <!--</style>-->

    <style name="DefaultTheme" parent="Theme.AppCompat.Light.NoActionBar">
        <item name="searchViewStyle">@style/MySearchViewStyle</item>
        <item name="colorPrimary">@color/primary_4</item>
        <item name="colorPrimaryDark">@color/primary_dark_4</item>
        <item name="colorAccent">@color/accent_4</item>
        <item name="homeAsUpIndicator">@drawable/ic_arrow_back_white_24dp</item>
    </style>

    <style name="Theme1" parent="DefaultTheme">
        <item name="colorPrimary">@color/primary_1</item>
        <item name="colorPrimaryDark">@color/primary_dark_1</item>
        <item name="colorAccent">@color/accent_1</item>
    </style>

    <style name="Theme2" parent="DefaultTheme">
        <item name="colorPrimary">@color/primary_2</item>
        <item name="colorPrimaryDark">@color/primary_dark_2</item>
        <item name="colorAccent">@color/accent_2</item>
    </style>

    <style name="Theme3" parent="DefaultTheme">
        <item name="colorPrimary">@color/primary_3</item>
        <item name="colorPrimaryDark">@color/primary_dark_3</item>
        <item name="colorAccent">@color/accent_3</item>
    </style>

    <style name="Theme4" parent="DefaultTheme">
        <item name="colorPrimary">@color/primary_4</item>
        <item name="colorPrimaryDark">@color/primary_dark_4</item>
        <item name="colorAccent">@color/accent_4</item>
    </style>

    <style name="Theme5" parent="DefaultTheme">
        <item name="colorPrimary">@color/primary_5</item>
        <item name="colorPrimaryDark">@color/primary_dark_5</item>
        <item name="colorAccent">@color/accent_5</item>
    </style>

    <style name="Theme6" parent="DefaultTheme">
        <item name="colorPrimary">@color/primary_6</item>
        <item name="colorPrimaryDark">@color/primary_dark_6</item>
        <item name="colorAccent">@color/accent_6</item>
    </style>

    <style name="Theme7" parent="DefaultTheme">
        <item name="colorPrimary">@color/primary_7</item>
        <item name="colorPrimaryDark">@color/primary_dark_7</item>
        <item name="colorAccent">@color/accent_7</item>
    </style>

    <style name="Theme8" parent="DefaultTheme">
        <item name="colorPrimary">@color/primary_8</item>
        <item name="colorPrimaryDark">@color/primary_dark_8</item>
        <item name="colorAccent">@color/accent_8</item>
    </style>

    <style name="Theme9" parent="DefaultTheme">
        <item name="colorPrimary">@color/primary_9</item>
        <item name="colorPrimaryDark">@color/primary_dark_9</item>
        <item name="colorAccent">@color/accent_9</item>
    </style>

    <style name="Theme10" parent="DefaultTheme">
        <item name="colorPrimary">@color/primary_10</item>
        <item name="colorPrimaryDark">@color/primary_dark_10</item>
        <item name="colorAccent">@color/accent_10</item>
    </style>

    <style name="Theme11" parent="DefaultTheme">
        <item name="colorPrimary">@color/primary_11</item>
        <item name="colorPrimaryDark">@color/primary_dark_11</item>
        <item name="colorAccent">@color/accent_11</item>
    </style>

    <style name="Theme12" parent="DefaultTheme">
        <item name="colorPrimary">@color/primary_12</item>
        <item name="colorPrimaryDark">@color/primary_dark_12</item>
        <item name="colorAccent">@color/accent_12</item>
    </style>

    <style name="Theme13" parent="DefaultTheme">
        <item name="colorPrimary">@color/primary_13</item>
        <item name="colorPrimaryDark">@color/primary_dark_13</item>
        <item name="colorAccent">@color/accent_13</item>
    </style>

    <style name="Theme14" parent="DefaultTheme">
        <item name="colorPrimary">@color/primary_14</item>
        <item name="colorPrimaryDark">@color/primary_dark_14</item>
        <item name="colorAccent">@color/accent_14</item>
    </style>

    <style name="Theme15" parent="DefaultTheme">
        <item name="colorPrimary">@color/primary_15</item>
        <item name="colorPrimaryDark">@color/primary_dark_15</item>
        <item name="colorAccent">@color/accent_15</item>
    </style>

    <style name="Theme16" parent="DefaultTheme">
        <item name="colorPrimary">@color/primary_16</item>
        <item name="colorPrimaryDark">@color/primary_dark_16</item>
        <item name="colorAccent">@color/accent_16</item>
    </style>

    <style name="AppThemeWithNavDrawer" parent="DefaultTheme"/>
    <style name="AppThemeWithoutNavDrawer" parent="DefaultTheme"/>

    <style name="ToolbarTitle" parent="@style/TextAppearance.Widget.AppCompat.Toolbar.Title">
        <item name="android:textSize">19sp</item>
    </style>

    <style name="MySearchViewStyle" parent="Widget.AppCompat.SearchView">
        <item name="searchIcon">@drawable/ic_search_white_24dp</item>
        <item name="closeIcon">@drawable/ic_close_white_24dp</item>
    </style>

    <style name="MyOverflowMenu" parent="Base.Widget.AppCompat.ActionButton.Overflow">
        <item name="android:src">@drawable/abc_ic_menu_moreoverflow_mtrl_alpha</item>
    </style>

    <style name="card_list_view" parent="android:Widget.ListView.White">
        <item name="android:background">@color/card_list_view_background</item>
    </style>

    <style name="placeholder_image">
        <item name="android:layout_marginTop">@dimen/placeholder_image_margin_top</item>
        <item name="android:layout_marginBottom">@dimen/placeholder_image_margin_bottom</item>
        <item name="android:layout_height">@dimen/placeholder_image_height</item>
    </style>

    <style name="placeholder_text">
        <item name="android:textSize">@dimen/placeholder_text_text_size</item>
        <item name="android:gravity">center_horizontal</item>
        <item name="android:layout_marginLeft">@dimen/placeholder_text_margin_left</item>
        <item name="android:layout_marginRight">@dimen/placeholder_text_margin_right</item>
        <item name="android:layout_marginTop">@dimen/placeholder_text_margin_top</item>
    </style>

    <style name="about_title">
        <item name="android:layout_width">wrap_content</item>
        <item name="android:layout_height">wrap_content</item>
        <item name="android:layout_marginLeft">@dimen/about_title_margin_left</item>
        <item name="android:layout_marginTop">@dimen/about_title_margin_top</item>
    </style>

    <style name="TextAppearance.About.Title" parent="android:TextAppearance.DeviceDefault">
        <item name="android:textSize">@dimen/about_title_text_size</item>
        <item name="android:textIsSelectable">false</item>
        <item name="android:textStyle">bold</item>
    </style>

    <style name="about_description">
        <item name="android:layout_width">wrap_content</item>
        <item name="android:layout_height">wrap_content</item>
        <item name="android:layout_marginTop">@dimen/about_description_margin_top</item>
    </style>

    <style name="TextAppearance.About.Description" parent="android:TextAppearance.DeviceDefault">
        <item name="android:textSize">@dimen/about_description_text_size</item>
    </style>

</resources>

redpajama_set_name: RedPajamaGithub


text:
package org.rcgonzalezf.weather.common;

import java.util.List;
import org.rcgonzalezf.weather.common.models.converter.Data;
import org.rcgonzalezf.weather.common.network.ApiCallback;
import org.rcgonzalezf.weather.common.network.ApiError;
import org.rcgonzalezf.weather.common.network.ApiRequest;
import org.rcgonzalezf.weather.common.network.ApiResponse;
import org.rcgonzalezf.weather.common.network.RequestParameters;
import org.rcgonzalezf.weather.openweather.network.OpenWeatherApiRequestParameters;

public interface WeatherRepository<T extends RequestParameters, A extends ApiCallback<? extends ApiResponse, ? extends ApiError>> {
  List<Data> findWeather(T requestParameters);

  void findWeather(OpenWeatherApiRequestParameters requestParameters, A apiCallback);

  ApiRequest getApiRequest();
}


text:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
	package="com.commonsware.android.tilemode"
	android:versionCode="1"
	android:versionName="1.0">

	<uses-sdk
		android:minSdkVersion="14"
		android:targetSdkVersion="22"/>

	<application
		android:allowBackup="false"
		android:icon="@drawable/ic_launcher"
		android:label="@string/app_name"
		android:theme="@android:style/Theme.Holo.Light.DarkActionBar">
		<activity android:name="MainActivity">
			<intent-filter>
				<action android:name="android.intent.action.MAIN"/>

				<category android:name="android.intent.category.LAUNCHER"/>
			</intent-filter>
		</activity>
	</application>

</manifest>


text:
import { ITextDeleteMutation } from "automutate/lib/mutators/textDeleteMutator";

import { ILesshintComplaint } from "../lesshint";
import { IFileInfo, ISuggester } from "../suggester";

/**
 * Adds fix suggestions for the empty_rule rule.
 */
export class EmptyRuleSuggester implements ISuggester<void> {
    /**
     * Suggests a mutation to fix a complaint, if possible.
     *
     * @param complaint   Complaint result from running Lesshint.
     * @param fileInfo   Contents of the source file in various forms.
     * @returns Suggested mutation for the fix.
     */
    public suggestMutation(complaint: ILesshintComplaint, config: void, fileInfo: IFileInfo): ITextDeleteMutation {
        return {
            range: {
                begin: complaint.position,
                end: fileInfo.text.indexOf("}", complaint.position) + 1
            },
            type: "text-delete"
        };
    }
}


text:
.li-itemize{margin:1ex 0ex;}
.li-enumerate{margin:1ex 0ex;}
.dd-description{margin:0ex 0ex 1ex 4ex;}
.dt-description{margin:0ex;}
.thefootnotes{text-align:left;margin:0ex;}
.dt-thefootnotes{margin:0em;}
.dd-thefootnotes{margin:0em 0em 0em 2em;}
.footnoterule{margin:1em auto 1em 0px;width:50%;}
.caption{padding-left:2ex; padding-right:2ex; margin-left:auto; margin-right:auto}
.center{text-align:center;margin-left:auto;margin-right:auto;}
DIV TABLE{margin-left:inherit;margin-right:inherit;}
PRE{text-align:left;margin-left:0ex;margin-right:auto;}
BLOCKQUOTE{margin-left:4ex;margin-right:4ex;text-align:left;}
TD P{margin:0px;}
.hbar{border:none;height:2px;width:100%;background-color:black;}
.display{border-collapse:separate;border-spacing:2px;width:auto; border:none;}
.dcell{white-space:nowrap;padding:0px;width:auto; border:none;}
.dcenter{margin:0ex auto;}
.theorem{text-align:left;margin:1ex auto 1ex 0ex;}
a:link{color:black;}
p+p{margin-top:1em;margin-bottom:1em}
img{border:0px}


text:
(function(){
    this.subscribe('block/new', function(data) {
        var block_config = _.find(this.getState().config.blocks, function(block){
            return block.type == data.type
        })
        var blocks = {}
        if(block_config.setting.level_min == 3 && data.level == 0){
            var section_wrapper_id = this.newBlock(data.designer_id, 'section_wrapper', '');
            var row_id = this.newBlock(data.designer_id, 'row', section_wrapper_id);
            var column_id = this.newBlock(data.designer_id, 'column', row_id);
            data.target = column_id
        }
        var new_block_id = this.newBlock(data.designer_id, data.type, data.target)
        if(block_config.setting.child) {
            var new_child_block_id = this.newBlock(data.designer_id, block_config.setting.child, new_block_id);
            var block_child_config = _.find(this.getState().config.blocks, function(block){
                return block.type == block_config.setting.child
            })
            if(block_child_config.setting.child) {
                this.newBlock(data.designer_id, block_child_config.setting.child, new_child_block_id);
            }
        }
        this.dispatch('block/create/success', {block_id: new_block_id, type: data.type, designer_id: data.designer_id})
    }.bind(this));
    this.subscribe('block/remove', function(data) {

        var block_config = _.find(this.getState().config.blocks, function(block){
            return block.type == data.type
        })

        var blocks = this.getState().blocks

        var parent = blocks[data.designer_id][data.block_id].parent

        if(parent != ''){
            var block_config_parent = _.find(this.getState().config.blocks, function(block){
                return block.type == blocks[data.designer_id][parent].type
            })

            var childBlocks = this.getBlocks(data.designer_id, parent)

            if (block_config_parent.setting.child && _.size(childBlocks) == 1){
                data.block_id = parent
            }
        }

        this.removeBlock(data.designer_id, data.block_id)

        this.dispatch('block/remove/success')
        $('body').trigger('remove_block_success', {'title': block_config.title});
    }.bind(this));

    this.removeBlock = function(designer_id, block_id) {

        var blocks = this.getState().blocks

        blocks[designer_id] = _.pick(blocks[designer_id], function(value, key, object){
            return block_id != value.id
        })

        this.updateState({blocks: blocks})

        var childBlocks = this.getBlocks(designer_id, block_id)
        if(_.size(childBlocks) > 0) {
            for(var key in childBlocks){
                this.removeBlock(designer_id, childBlocks[key].id)
            }
        }
    }

    this.subscribe('block/move/start', function(data) {
        var blocks = JSON.parse(JSON.stringify(this.getState().blocks))
        blocks[data.designer_id][data.block_id].parent = null
        this.updateState({blocks: blocks})
    })

    this.subscribe('block/move', function(data){
        var block_info = this.getState().blocks[data.designer_id][data.block_id]
        if(block_info.parent != data.target) {
            var childBlocks = this.getBlocks(data.designer_id, data.target)
            var blocks = JSON.parse(JSON.stringify(this.getState().blocks))
            for(var key in childBlocks) {
                if(blocks[data.designer_id][childBlocks[key].id].sort_order >= data.sort_order)
                {
                    blocks[data.designer_id][childBlocks[key].id].sort_order += 1
                }
            }

            blocks[data.designer_id][data.block_id].parent = data.target
            blocks[data.designer_id][data.block_id].sort_order = data.sort_order
            this.updateState({blocks: blocks})

            if(data.start_under_id != ''){
                var block_config_parent = _.find(this.getState().config.blocks, function(block){
                    return block.type == blocks[data.designer_id][data.start_under_id].type
                })

                var childBlocks = this.getBlocks(data.designer_id, data.start_under_id)

                if (block_config_parent.setting.child && _.size(childBlocks) == 0){
                    data.block_id = data.start_under_id
                    this.removeBlock(data.designer_id, data.block_id)
                }
            }

        }
        if(data.success){
            data.success()
        }
        this.dispatch('block/move/success')
    })
    this.subscribe('block/layout/update', function(data){
        var block_config = _.find(this.getState().config.blocks, function(block){
            return block.type == data.type
        })
        var indexSize = 0
        var blocks = this.getState().blocks
        var childBlocks = this.getBlocks(data.designer_id, data.block_id)
        if(_.size(data.size) >= _.size(childBlocks)){
            for (var key in childBlocks) {
                blocks[data.designer_id][childBlocks[key].id].setting.global.size=data.size[indexSize]
                indexSize++;
            }
        }

        if(_.size(data.size) < _.size(childBlocks)){
            for (var key in childBlocks) {
                if(indexSize < _.size(data.size)){
                    blocks[data.designer_id][childBlocks[key].id].setting.global.size=data.size[indexSize]

                } else {
                    delete blocks[data.designer_id][childBlocks[key].id];
                }
                indexSize++;
            }
        }

        this.updateState({blocks: blocks})

        if(_.size(data.size) > _.size(childBlocks)){
            for(var i=indexSize; i< _.size(data.size); i++){
                this.newBlock(data.designer_id, block_config.setting.child, data.block_id, {size:data.size[i]});
            }
        }

        this.dispatch('block/layout/update/success')
    })
    /**
     * Full update block setting with Ajax Request
     */
    this.subscribe('block/setting/update', function(data){
        var block_info = this.getState().blocks[data.designer_id][data.block_id]
        var send_data = {
            setting: JSON.stringify(block_info.setting),
            type:block_info.type
        }
        var blocks = this.getState().blocks

        $.ajax({
            url: 'index.php?route=extension/d_visual_designer/designer/updateSetting&'+this.getState().config.url_token,
            type: 'post',
            dataType: 'json',
            data: send_data,
            context: this,
            success: function(json) {
                if(json['success']){
                    this.dispatch('block/setting/update/begin')
                    var blocks = this.getState().blocks

                    blocks[data.designer_id][data.block_id].setting = _.extend({}, json.setting)
                    this.updateState({blocks: blocks})
                    this.dispatch('history/backup', {block_id: data.block_id, designer_id: data.designer_id, fast: false})
                }
            },
            complete: function() {
                this.dispatch('block/setting/update/end', {designer_id: data.designer_id})
            }
        })
    })

    /**
     * Update setting without Ajax request
     */

    this.subscribe('block/setting/fastUpdate', function(data){
        var blocks = this.getState().blocks
        blocks[data.designer_id][data.block_id].setting = _.extend({}, data.setting)
        this.updateState({blocks: blocks})
        this.dispatch('history/backup', {block_id: data.block_id, designer_id: data.designer_id, fast: true})
    })
    /**
     * Clone target block
     */
    this.subscribe('block/clone', function(data){
        var block_info = this.getState().blocks[data.designer_id][data.target]
        var block_config = _.find(this.getState().config.blocks, function(block){
            return block.type == block_info.type
        })
        var block_id = this.newBlock(data.designer_id, block_info.type, block_info.parent, block_info.setting.global, block_info.setting.user, block_info.setting.edit)
        this.cloneBlocks(data.designer_id, block_info.id, block_id)
        this.dispatch('block/clone/success')
    })

    /**
     * Update param sort_order in child blocks for selected block
     */
    this.updateSortOrder = function(designer_id, block_id){
        var blocks = JSON.parse(JSON.stringify(this.getState().blocks))
        if(!_.isEmpty(block_id)){
            var container =$('#'+designer_id).find('[id='+block_id+']').children('.block-content')
        } else {
            var container = $('#'+designer_id).find('#sortable')
        }

        for (var i = 0; i < container.get(0).children.length; i++) {
            if(container.get(0).children[i].classList.contains('block-container')) {
                var index = container.get(0).children[i].id
                blocks[designer_id][index].sort_order = i
            }
        }

        this.updateState({blocks: blocks})
    }

    /**
     * Clone blocks by parent_id
     */
    this.cloneBlocks = function(designer_id, parent_id, new_parent_id){
        var blocks = this.getBlocks(designer_id, parent_id)
        if(_.size(blocks)){
            for (var key in blocks){
                var block_id = this.newBlock(designer_id, blocks[key].type, new_parent_id, blocks[key].setting.global, blocks[key].setting.user, blocks[key].setting.edit)
                this.cloneBlocks(designer_id, blocks[key].id, block_id)
            }
        }
    }

    /**
     * Create new Block
     */
    this.newBlock = function(designer_id, type, target, default_setting, user_setting, edit_setting){
        var default_setting = _.isUndefined(default_setting) ? null : default_setting
        var user_setting = _.isUndefined(user_setting) ? null : user_setting
        var edit_setting = _.isUndefined(edit_setting) ? null : edit_setting

        var block_config = _.find(this.getState().config.blocks, function(block){
            return block.type == type
        })
        var childBlocks = this.getBlocks(designer_id, target)
        if(!_.isEmpty(childBlocks)){
            var lastBlock = _.max(childBlocks, function(value){
                return value.sort_order
            })
        } else{
            var lastBlock = {}
        }

        var blocks = this.getState().blocks
        var block_id = type+'_'+Math.random().toString(36).substring(2, 9)
        blocks[designer_id][block_id] = {
            setting: JSON.parse(JSON.stringify(block_config.setting_default)),
            parent: target,
            id: block_id,
            type: type,
            sort_order: !_.isEmpty(lastBlock)? lastBlock.sort_order + 1 : 0
        }
        if(!_.isNull(default_setting)){
            blocks[designer_id][block_id].setting.global = _.extend({}, blocks[designer_id][block_id].setting.global, default_setting)
        }
        if(!_.isNull(edit_setting)){
            blocks[designer_id][block_id].setting.edit = _.extend({}, blocks[designer_id][block_id].setting.edit, edit_setting)
        }
        if(!_.isNull(user_setting)){
            blocks[designer_id][block_id].setting.user = _.extend({}, blocks[designer_id][block_id].setting.user, user_setting)
        }
        this.updateState({blocks: blocks})
        if(_.isNull(user_setting) || _.isNull(edit_setting)) {
            this.dispatch('block/setting/update', {designer_id, block_id})
        }
        return block_id
    }
}.bind(d_visual_designer))()


text:
/**
 * The Complete Event.
 *
 * @event SpinePluginEvents#COMPLETE
 * @since 3.19.0
 */
module.exports = 'complete';


text:
using namespace std;

int main()
{
    Month MyMonth;
    cout << "set month to dec\n";
    MyMonth.set_month(12);
    MyMonth.output_month(cout);

    cout << "get the next month\n";
    Month HelloMonth = MyMonth.get_next_month();
    HelloMonth.output_month(cout);

    return 0;
}


text:
					<img src="<?php echo base_url(); ?>uploads/spg/<?= $this->session->userdata('user_picture'); ?>" alt="<?= $this->session->userdata('user_fullname'); ?>" />

					<?= $this->session->userdata('user_fullname'); ?>

					<?=
						strtoupper($this->session->userdata('user_rules'));
					?>

,

Navigation

			<?php
				switch ($this->session->userdata('user_rules')) {
					case 'super_admin':
					    $main=$this->db->query("SELECT * FROM menu WHERE parent = 0 ORDER BY posisi ASC");
						break;

					case 'admin':
					    $main=$this->db->query("SELECT * FROM menu WHERE parent = 0 AND rules = 'admin'  ORDER BY posisi ASC");
						break;

					case 'spg':
				    $main=$this->db->query("SELECT * FROM menu WHERE parent = 0 AND rules = 'spg'  ORDER BY posisi ASC");
					break;

					case 'COA':
				    $main=$this->db->query("SELECT * FROM menu WHERE parent = 0 AND rules = 'COA'  ORDER BY posisi ASC");
					break;

					case 'CS':
				    $main=$this->db->query("SELECT * FROM menu WHERE parent = 0 AND rules = 'CS'  ORDER BY posisi ASC");
					break;

					case 'HRD':
				    $main=$this->db->query("SELECT * FROM menu WHERE parent = 0 AND rules = 'HRD'  ORDER BY posisi ASC");
					break;

					case 'customer':
				    $main=$this->db->query("SELECT * FROM menu WHERE parent = 0 AND rules = 'customer'  ORDER BY posisi ASC");
					break;

					default:
					    $main=$this->db->query("SELECT * FROM menu WHERE parent = 0 AND rules = 'registered_user'  ORDER BY posisi ASC");
						break;
				}
			    foreach ($main->result() as $m)
			    {
			        // chek ada submenu atau tidak
    				switch ($this->session->userdata('user_rules')) {
						case 'super_admin':
					        $sub=$this->db->get_where('menu',array('parent'=>$m->id));
							break;

						case 'admin':
						    $sub=$this->db->query("SELECT * FROM menu WHERE parent = $m->id AND rules = 'admin'  ORDER BY posisi ASC");
							break;

						case 'spg':
					   		$sub=$this->db->query("SELECT * FROM menu WHERE parent = $m->id AND rules = 'spg'  ORDER BY posisi ASC");
						break;

						case 'COA':
					   		$sub=$this->db->query("SELECT * FROM menu WHERE parent = $m->id AND rules = 'COA'  ORDER BY posisi ASC");
						break;

						case 'CS':
					   		$sub=$this->db->query("SELECT * FROM menu WHERE parent = $m->id AND rules = 'CS'  ORDER BY posisi ASC");
						break;

						case 'HRD':
					   		$sub=$this->db->query("SELECT * FROM menu WHERE parent = $m->id AND rules = 'HRD'  ORDER BY posisi ASC");
						break;

						case 'customer':
					   		$sub=$this->db->query("SELECT * FROM menu WHERE parent = $m->id AND rules = 'customer'  ORDER BY posisi ASC");
						break;

						default:
						    $sub=$this->db->query("SELECT * FROM menu WHERE parent = $m->id AND rules = 'registered_user'  ORDER BY posisi ASC");
							break;
					}
			        if($sub->num_rows() >0)
			        {
			            // buat menu + sub menu
			            echo "

								    icon\">
								    $m->nama_menu

";
			            foreach ($sub->result() as $s)
			            {
			                 echo '
'.anchor($s->link, $s->nama_menu).'
';
			            }
			            echo "
";
			            echo '
';
			        }
			        else
			        {
			            // single menu
			            echo '
'.anchor($m->link,'icon.' fa-lg">
			                   '.$m->nama_menu.'').'
';
			        }
			    }
			?>


text:
#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/skbuff.h>
#include <linux/netfilter.h>
#include <net/sock.h>

#include "nf_internals.h"

/* Sockopts only registered and called from user context, so
   net locking would be overkill.  Also, [gs]etsockopt calls may
   sleep. */
static DECLARE_MUTEX(nf_sockopt_mutex);
static LIST_HEAD(nf_sockopts);

/* Do exclusive ranges overlap? */
static inline int overlap(int min1, int max1, int min2, int max2)
{
	return max1 > min2 && min1 < max2;
}

/* Functions to register sockopt ranges (exclusive). */
int nf_register_sockopt(struct nf_sockopt_ops *reg)
{
	struct list_head *i;
	int ret = 0;

	if (down_interruptible(&nf_sockopt_mutex) != 0)
		return -EINTR;

	list_for_each(i, &nf_sockopts) {
		struct nf_sockopt_ops *ops = (struct nf_sockopt_ops *)i;
		if (ops->pf == reg->pf
		    && (overlap(ops->set_optmin, ops->set_optmax,
				reg->set_optmin, reg->set_optmax)
			|| overlap(ops->get_optmin, ops->get_optmax,
				   reg->get_optmin, reg->get_optmax))) {
			NFDEBUG("nf_sock overlap: %u-%u/%u-%u v %u-%u/%u-%u\n",
				ops->set_optmin, ops->set_optmax,
				ops->get_optmin, ops->get_optmax,
				reg->set_optmin, reg->set_optmax,
				reg->get_optmin, reg->get_optmax);
			ret = -EBUSY;
			goto out;
		}
	}

	list_add(&reg->list, &nf_sockopts);
out:
	up(&nf_sockopt_mutex);
	return ret;
}
EXPORT_SYMBOL(nf_register_sockopt);

void nf_unregister_sockopt(struct nf_sockopt_ops *reg)
{
	/* No point being interruptible: we're probably in cleanup_module() */
 restart:
	down(&nf_sockopt_mutex);
	if (reg->use != 0) {
		/* To be woken by nf_sockopt call... */
		/* FIXME: Stuart Young's name appears gratuitously. */
		set_current_state(TASK_UNINTERRUPTIBLE);
		reg->cleanup_task = current;
		up(&nf_sockopt_mutex);
		schedule();
		goto restart;
	}
	list_del(&reg->list);
	up(&nf_sockopt_mutex);
}
EXPORT_SYMBOL(nf_unregister_sockopt);

/* Call get/setsockopt() */
static int nf_sockopt(struct sock *sk, int pf, int val,
		      char __user *opt, int *len, int get)
{
	struct list_head *i;
	struct nf_sockopt_ops *ops;
	int ret;

	if (down_interruptible(&nf_sockopt_mutex) != 0)
		return -EINTR;

	list_for_each(i, &nf_sockopts) {
		ops = (struct nf_sockopt_ops *)i;
		if (ops->pf == pf) {
			if (get) {
				if (val >= ops->get_optmin
				    && val < ops->get_optmax) {
					ops->use++;
					up(&nf_sockopt_mutex);
					ret = ops->get(sk, val, opt, len);
					goto out;
				}
			} else {
				if (val >= ops->set_optmin
				    && val < ops->set_optmax) {
					ops->use++;
					up(&nf_sockopt_mutex);
					ret = ops->set(sk, val, opt, *len);
					goto out;
				}
			}
		}
	}
	up(&nf_sockopt_mutex);
	return -ENOPROTOOPT;

 out:
	down(&nf_sockopt_mutex);
	ops->use--;
	if (ops->cleanup_task)
		wake_up_process(ops->cleanup_task);
	up(&nf_sockopt_mutex);
	return ret;
}

int nf_setsockopt(struct sock *sk, int pf, int val, char __user *opt,
		  int len)
{
	return nf_sockopt(sk, pf, val, opt, &len, 0);
}
EXPORT_SYMBOL(nf_setsockopt);

int nf_getsockopt(struct sock *sk, int pf, int val, char __user *opt, int *len)
{
	return nf_sockopt(sk, pf, val, opt, len, 1);
}
EXPORT_SYMBOL(nf_getsockopt);


text:
<div
  flex
  layout-fill
  layout-align="center center"
  layout="row"
  style="margin-top: 20px;"
>
  <md-content
    class="Page-container max-content-width"
    layout-align="center center"
    flex
  >
    <div
      layout="column"
      layout-align="center center"
    >
      <h1
        class="md-headline"
        translate="Regestrieren Sie sich"
      ></h1>
      <div
        layout-fill
        flex
      >
        <register-form
          flex
          layout-fill
        ></register-form>
      </div>
    </div>

  </md-content>
</div>


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
                android:background="@android:color/white"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent">

    <RelativeLayout
            android:clickable="true"
            android:focusableInTouchMode="true"
            android:background="@drawable/home_bg"
            android:id="@+id/main_header_body"
            android:layout_width="fill_parent"
            android:layout_height="365dp">

        <com.tiyuzazhi.component.RoundedImageView
                android:id="@+id/header"
                android:layout_marginTop="70dp"
                android:layout_centerHorizontal="true"
                android:background="@drawable/header_bk"
                android:layout_width="102dp"
                android:layout_height="102dp"/>

        <LinearLayout
                android:id="@+id/search_bar"
                android:layout_alignParentBottom="true"
                android:layout_centerHorizontal="true"
                android:background="@drawable/home_search_bg"
                android:orientation="horizontal"
                android:layout_marginLeft="10dp"
                android:layout_marginRight="10dp"
                android:layout_marginBottom="20dp"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content">

            <ImageView
                    android:layout_marginLeft="10dp"
                    android:layout_gravity="center_vertical"
                    android:src="@drawable/search_icon"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"/>

            <EditText
                    android:textColorHint="@android:color/white"
                    android:hint="请输入文章名等进行搜索"
                    android:textColor="@android:color/white"
                    android:imeOptions="actionSearch"
                    android:background="@android:color/transparent"
                    android:layout_gravity="center_vertical"
                    android:id="@+id/search_editor"
                    android:inputType="text"
                    android:layout_marginLeft="10dp"
                    android:layout_marginRight="10dp"
                    android:layout_width="fill_parent"
                    android:textSize="18sp"
                    android:layout_height="wrap_content"/>
        </LinearLayout>

        <TextView
                android:id="@+id/user_name"
                android:textColor="@android:color/white"
                android:textSize="28sp"
                android:layout_marginTop="25dp"
                android:layout_below="@id/header"
                android:layout_centerHorizontal="true"
                android:layout_width="wrap_content"
                android:text="hello world"
                android:textStyle="bold"
                android:layout_height="wrap_content"/>
    </RelativeLayout>

    <ImageButton
            android:scaleType="centerInside"
            android:background="@android:color/transparent"
            android:id="@+id/slide_menu_button"
            android:layout_alignParentLeft="true"
            android:layout_alignParentTop="true"
            android:layout_marginLeft="10dp"
            android:layout_marginTop="25dp"
            android:src="@drawable/menu_icon"
            android:layout_width="40dp"
            android:layout_height="40dp"/>

    <LinearLayout
            android:background="@drawable/bottom_bk"
            android:paddingTop="10dp"
            android:layout_alignParentBottom="true"
            android:id="@+id/bottom_bar"
            android:layout_width="fill_parent"
            android:layout_height="82dp"
            android:weightSum="4">

        <LinearLayout
                android:id="@+id/author_center_btn"
                android:orientation="vertical"
                android:background="@android:color/background_light"
                android:clickable="true"
                android:layout_weight="1"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                >

            <TextView
                    android:id="@+id/author_center_no"
                    android:gravity="center_horizontal|bottom"
                    android:text="0"
                    android:textSize="35sp"
                    android:textStyle="bold"
                    android:textColor="#b8b8b8"
                    android:layout_gravity="center_horizontal"
                    android:layout_width="fill_parent"
                    android:layout_height="40dp"/>

            <TextView
                    android:gravity="center_horizontal|top"
                    android:text="作者中心"
                    android:textSize="12sp"
                    android:textStyle="bold"
                    android:textColor="#2d3538"
                    android:layout_gravity="center_horizontal"
                    android:layout_width="fill_parent"
                    android:layout_height="40dp"/>

        </LinearLayout>

        <LinearLayout
                android:id="@+id/refereeing_btn"
                android:orientation="vertical"
                android:background="@android:color/background_light"
                android:clickable="true"
                android:layout_weight="1"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content">

            <TextView
                    android:id="@+id/refereeing_no"
                    android:gravity="center_horizontal|bottom"
                    android:text="0"
                    android:textSize="35sp"
                    android:textStyle="bold"
                    android:textColor="#b8b8b8"
                    android:layout_gravity="center_horizontal"
                    android:layout_width="fill_parent"
                    android:layout_height="40dp"/>

            <TextView
                    android:gravity="center_horizontal|top"
                    android:text="审稿专家"
                    android:textSize="12sp"
                    android:textStyle="bold"
                    android:textColor="#2d3538"
                    android:layout_gravity="center_horizontal"
                    android:layout_width="fill_parent"
                    android:layout_height="40dp"/>

        </LinearLayout>

        <LinearLayout
                android:id="@+id/editor_center_btn"
                android:orientation="vertical"
                android:background="@android:color/background_light"
                android:clickable="true"
                android:layout_weight="1"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content">

            <TextView
                    android:id="@+id/editor_center_no"
                    android:gravity="center_horizontal|bottom"
                    android:text="0"
                    android:textSize="35sp"
                    android:textStyle="bold"
                    android:textColor="#b8b8b8"
                    android:layout_gravity="center_horizontal"
                    android:layout_width="fill_parent"
                    android:layout_height="40dp"/>

            <TextView
                    android:gravity="center_horizontal|top"
                    android:text="编辑办公"
                    android:textSize="12sp"
                    android:textStyle="bold"
                    android:textColor="#2d3538"
                    android:layout_gravity="center_horizontal"
                    android:layout_width="fill_parent"
                    android:layout_height="40dp"/>
        </LinearLayout>

        <LinearLayout
                android:id="@+id/chief_editor_btn"
                android:orientation="vertical"
                android:background="@android:color/background_light"
                android:clickable="true"
                android:layout_weight="1"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content">

            <TextView
                    android:id="@+id/chief_editor_no"
                    android:gravity="center_horizontal|bottom"
                    android:text="0"
                    android:textSize="35sp"
                    android:textStyle="bold"
                    android:textColor="#b8b8b8"
                    android:layout_gravity="center_horizontal"
                    android:layout_width="fill_parent"
                    android:layout_height="40dp"/>

            <TextView
                    android:gravity="center_horizontal|top"
                    android:text="主编办公"
                    android:textSize="12sp"
                    android:textStyle="bold"
                    android:textColor="#2d3538"
                    android:layout_gravity="center_horizontal"
                    android:layout_width="fill_parent"
                    android:layout_height="40dp"/>
        </LinearLayout>
    </LinearLayout>

    <ListView
            android:divider="@drawable/divide"
            android:layout_marginLeft="5dp"
            android:id="@+id/magazine_list"
            android:background="@android:color/white"
            android:layout_below="@id/main_header_body"
            android:layout_above="@id/bottom_bar"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent">

    </ListView>
</RelativeLayout>


text:
package es.unizar.sened.ontology;

import java.net.URI;

/**
 * @author gesteban@unizar.es
 */
public abstract class Resource {

	protected final URI URI;
	protected final String uriString;

	public Resource(String stringURI) {
		this.uriString = stringURI;
		this.URI = java.net.URI.create(stringURI.replace(" ", ","));
	}

	public Resource(URI URI) {
		this.URI = URI;
		this.uriString = URI.toASCIIString();
	}

	public String getURI() {
		return uriString;
	}

	public abstract String getName();

	@Override
	public boolean equals(Object obj) {
		if (obj == null) {
			return false;
		}
		if (getClass() != obj.getClass()) {
			return false;
		}
		final Resource other = (Resource) obj;
		if ((this.uriString == null) ? (other.uriString != null) : !this.uriString.equals(other.uriString)) {
			return false;
		}
		return true;
	}

	@Override
	public int hashCode() {
		int hash = 3;
		hash = 47 * hash + (this.uriString != null ? this.uriString.hashCode() : 0);
		return hash;
	}

	@Override
	public String toString() {
		return uriString;
	}

}


text:
create table headingved
(
  "offset" integer,
  position integer,
  absolute_tag integer,
  tag_number integer,
  browse_index integer,
  library integer,
  key integer,
  empty character(1)
);


text:
@class DBTEAMRevokeDeviceSessionArg;
@class DBTEAMRevokeDeviceSessionBatchArg;

NS_ASSUME_NONNULL_BEGIN

#pragma mark - API Object

///
/// The `RevokeDeviceSessionBatchArg` struct.
///
/// This class implements the `DBSerializable` protocol (serialize and
/// deserialize instance methods), which is required for all Obj-C SDK API route
/// objects.
///
@interface DBTEAMRevokeDeviceSessionBatchArg : NSObject <DBSerializable, NSCopying>

#pragma mark - Instance fields

/// (no description).
@property (nonatomic, readonly) NSArray<DBTEAMRevokeDeviceSessionArg *> *revokeDevices;

#pragma mark - Constructors

///
/// Full constructor for the struct (exposes all instance variables).
///
/// @param revokeDevices (no description).
///
/// @return An initialized instance.
///
- (instancetype)initWithRevokeDevices:(NSArray<DBTEAMRevokeDeviceSessionArg *> *)revokeDevices;

- (instancetype)init NS_UNAVAILABLE;

@end

#pragma mark - Serializer Object

///
/// The serialization class for the `RevokeDeviceSessionBatchArg` struct.
///
@interface DBTEAMRevokeDeviceSessionBatchArgSerializer : NSObject

///
/// Serializes `DBTEAMRevokeDeviceSessionBatchArg` instances.
///
/// @param instance An instance of the `DBTEAMRevokeDeviceSessionBatchArg` API
/// object.
///
/// @return A json-compatible dictionary representation of the
/// `DBTEAMRevokeDeviceSessionBatchArg` API object.
///
+ (nullable NSDictionary<NSString *, id> *)serialize:(DBTEAMRevokeDeviceSessionBatchArg *)instance;

///
/// Deserializes `DBTEAMRevokeDeviceSessionBatchArg` instances.
///
/// @param dict A json-compatible dictionary representation of the
/// `DBTEAMRevokeDeviceSessionBatchArg` API object.
///
/// @return An instantiation of the `DBTEAMRevokeDeviceSessionBatchArg` object.
///
+ (DBTEAMRevokeDeviceSessionBatchArg *)deserialize:(NSDictionary<NSString *, id> *)dict;

@end

NS_ASSUME_NONNULL_END


text:
class AC_PID {
public:

    /// Constructor for PID that saves its settings to EEPROM
    ///
    /// @note	PIDs must be named to avoid either multiple parameters with the
    ///			same name, or an overly complex constructor.
    ///
    /// @param  initial_p       Initial value for the P term.
    /// @param  initial_i       Initial value for the I term.
    /// @param  initial_d       Initial value for the D term.
    /// @param  initial_imax    Initial value for the imax term.4
    ///
    AC_PID(
        const float &   initial_p = 0.0,
        const float &   initial_i = 0.0,
        const float &   initial_d = 0.0,
        const int16_t & initial_imax = 0.0)
    {
		AP_Param::setup_object_defaults(this, var_info);

        _kp = initial_p;
        _ki = initial_i;
        _kd = initial_d;
        _imax = abs(initial_imax);

		// derivative is invalid on startup
		_last_derivative = NAN;
    }

    /// Iterate the PID, return the new control value
    ///
    /// Positive error produces positive output.
    ///
    /// @param error	The measured error value
    /// @param dt		The time delta in milliseconds (note
    ///					that update interval cannot be more
    ///					than 65.535 seconds due to limited range
    ///					of the data type).
    /// @param scaler	An arbitrary scale factor
    ///
    /// @returns		The updated control output.
    ///
    int32_t         get_pid(int32_t error, float dt);
    int32_t         get_pi(int32_t error, float dt);
    int32_t         get_p(int32_t error);
    int32_t         get_i(int32_t error, float dt);
    int32_t         get_d(int32_t error, float dt);
	int32_t 		get_leaky_i(int32_t error, float dt, float leak_rate);

    /// Reset the PID integrator
    ///
    void        reset_I();

    /// Load gain properties
    ///
    void        load_gains();

    /// Save gain properties
    ///
    void        save_gains();

    /// @name	parameter accessors
    //@{

    /// Overload the function call operator to permit relatively easy initialisation
    void operator        () (const float    p,
                             const float    i,
                             const float    d,
                             const int16_t  imaxval) {
        _kp = p; _ki = i; _kd = d; _imax = abs(imaxval);
    }

    float        kP() const {
        return _kp.get();
    }
    float        kI() const {
        return _ki.get();
    }
    float        kD() const {
        return _kd.get();
    }
    int16_t        imax() const {
        return _imax.get();
    }

    void        kP(const float v)               {
        _kp.set(v);
    }
    void        kI(const float v)               {
        _ki.set(v);
    }
    void        kD(const float v)               {
        _kd.set(v);
    }
    void        imax(const int16_t v)   {
        _imax.set(abs(v));
    }

    float        get_integrator() const {
        return _integrator;
    }
    void        set_integrator(float i) {
        _integrator = i;
    }

    static const struct AP_Param::GroupInfo        var_info[];

private:
    AP_Float        _kp;
    AP_Float        _ki;
    AP_Float        _kd;
    AP_Int16        _imax;

    float           _integrator;                                ///< integrator value
    int32_t         _last_input;                                ///< last input for derivative
    float           _last_derivative;                           ///< last derivative for low-pass filter

    /// Low pass filter cut frequency for derivative calculation.
    ///
    static const float  _filter;
};

#endif // __AC_PID_H__


text:
{{'DASHBOARD_TITLE' | translate}}

                  {{ 'DASHBOARD_CONFIRMED' | translate }}

                  {{ 'DASHBOARD_UNCONFIRMED' | translate }}
                    {{$ctrl._DataStore.account.transactions.unconfirmed.length}}

              <paginate ng-show="$ctrl.tabConfirmed" data="$ctrl._DataStore.account.transactions.confirmed" current-page="$ctrl.currentPage" page-size="$ctrl.pageSize"></paginate>
              <paginate ng-show="!$ctrl.tabConfirmed" data="$ctrl._DataStore.account.transactions.unconfirmed" current-page="$ctrl.currentPageUnc" page-size="$ctrl.pageSize"></paginate>

                  {{ 'GENERAL_ACCOUNT' | translate }}
                  {{ 'GENERAL_AMOUNT' | translate }}
                  {{ 'GENERAL_MESSAGE' | translate }}
                  {{ 'GENERAL_DATE' | translate }}

                    <tag-transaction d="tx" tooltip-position="'left'"></tag-transaction>

                    <tag-transaction d="tx" tooltip-position="'left'"></tag-transaction>

{{ 'GENERAL_NO_RESULTS' | translate }}

 {{ 'DASHBOARD_HARVEST_INCOME_TITLE' | translate }}

              <canvas width='793' height='200' id="bar" class="chart chart-bar" chart-data="$ctrl.valuesInFee" chart-labels="$ctrl.labels"></canvas>
              {{ 'DASHBOARD_HARVEST_INCOME_NOTE' | translate }}

{{ 'GENERAL_NO_RESULTS' | translate }}

{{ 'DASHBOARD_HARVEST_INCOME_MESSAGE' | translate }}

{{ 'DASHBOARD_HARVESTED_BLOCKS_TITLE' | translate }}

                  {{ 'GENERAL_BLOCK' | translate }}
                  {{ 'DASHBOARD_HARVESTED_BLOCKS_TH' | translate }}

                  {{block.height}}
                  {{block.totalFee/1000000}}

              <paginate data="$ctrl._DataStore.account.harvesting.blocks" current-page="$ctrl.currentPageHb" page-size="$ctrl.pageSize"></paginate>

{{ 'GENERAL_NO_RESULTS' | translate }}

{{ 'DASHBOARD_NOTICE_1' | translate }}

            {{ 'DASHBOARD_NOTICE_4' | translate }}

            {{ 'DASHBOARD_NOTICE_5' | translate }}

        <market-data></market-data>


text:
package edu.pdx.cs410J.family;

import org.junit.jupiter.api.Test;

import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.Date;

import static org.junit.jupiter.api.Assertions.fail;

/**
 * This is the abstract superclass that tests the conversion of a
 * {@link FamilyTree} from one form to another.  The test methods can
 * be shared by subclasses.  All the subclass has to do is override
 the {@link #getStringFor} and {@link #getFamilyTreeFor} methods.
 */
public abstract class FamilyTreeConversionTestCase
  extends FamilyTestCase {

  ////////  Helper methods

  /**
   * Converts a FamilyTree to a String
   */
  protected abstract String getStringFor(FamilyTree tree);

  /**
   * Converts a String to a FamilyTree
   */
  protected abstract FamilyTree getFamilyTreeFor(String string);

  ////////  Test methods

    @Test
  public void testConformingData() {
    Person father = new Person(1, Person.MALE);
    father.setDateOfBirth(new Date());
    father.setDateOfDeath(new Date());

    Person mother = new Person(2, Person.FEMALE);
    mother.setDateOfBirth(new Date());
    mother.setDateOfDeath(new Date());

    Person child = new Person(3, Person.FEMALE);
    child.setFather(father);
    child.setMother(mother);

    Marriage m = new Marriage(father, mother);
    m.setLocation("Here");
    m.setDate(new Date());

    father.addMarriage(m);
    mother.addMarriage(m);

    FamilyTree tree = new FamilyTree();
    tree.addPerson(father);
    tree.addPerson(mother);
    tree.addPerson(child);

    String string = getStringFor(tree);

    FamilyTree tree2 = null;

    try {
      tree2 = getFamilyTreeFor(string);

    } catch (FamilyTreeException ex) {
      StringWriter sw = new StringWriter();
      ex.printStackTrace(new PrintWriter(sw, true));
      fail(sw.toString());
    }

    assertEquals(tree, tree2);
  }

  public void _testFatherNotMale() {

  }

  public void _testMotherNotFemale() {

  }

  public void _testPersonNotMale() {
    // We expect the person to be male because he was previously
    // somebody's father
  }

  public void _testPersonNotFemale() {
    // We expect the person to be female because she was previously
    // somebody's mother
  }

}


text:
package mg.fishchicken.core.actions;

import groovy.lang.Binding;
import mg.fishchicken.core.GameState;
import mg.fishchicken.gamelogic.characters.GameCharacter;
import mg.fishchicken.gamelogic.characters.PlayerCharacter;

import com.badlogic.gdx.utils.Array;
import com.badlogic.gdx.utils.GdxRuntimeException;
import com.badlogic.gdx.utils.XmlReader.Element;

/**
 * Gives the specified amount of experience to the supplied
 * player character. If anything else is supplied,
 * the experience is instead given to the whole player
 * character group, equally divided among active characters.
 *

 * Example:
 *
 *

 * <giveExperience amount="50" targetObject="__pcAtDialogue" />
 *

 * @author ANNUN
 *
 */
public class GiveExperience extends Action {

	public static final String XML_AMOUNT = "amount";

	@Override
	protected void run(Object object, Binding parameters) {
		if (object instanceof PlayerCharacter) {
			((PlayerCharacter) object).stats().giveExperience(Integer.parseInt(getParameter(XML_AMOUNT)));
		} else {
			Array<GameCharacter> playerCharacters = GameState.getPlayerCharacterGroup().getPlayerCharacters();
			int playerCharacterCount = 0;
			for (GameCharacter character : playerCharacters) {
				if (character.isActive()) {
					++ playerCharacterCount;
				}
			}

			int expToAward = Integer.parseInt(getParameter(XML_AMOUNT)) / playerCharacterCount;

			for (GameCharacter character : playerCharacters) {
				if (character.isActive()) {
					character.stats().giveExperience(expToAward);
				}
			}
		}
	}

	@Override
	public void validateAndLoadFromXML(Element conditionElement) {
		if (conditionElement.get(XML_AMOUNT, null) == null) {
			throw new GdxRuntimeException(XML_AMOUNT+" must be set for action GiveExperience in element: \n\n"+conditionElement);
		}
	}

}


text:
package com.cordys.coe.ac.fileconnector.utils;

import com.eibus.xml.nom.Document;
import com.eibus.xml.nom.Find;
import com.eibus.xml.nom.Node;
import com.eibus.xml.nom.XMLException;

/**
 * An utility class to read and write XML structures.
 *
 * @author  mpoyhone
 */
public class XMLSerializer
{
    /**
     * Creates a new node or node structure.
     *
     * @param   iParentNode   The node under which the new node is created.
     * @param   sElementName  The new node name.
     *
     * @return  The new node.
     *
     * @throws  XMLException  Thrown if the creation failed.
     */
    public static int createNode(int iParentNode, String sElementName)
                          throws XMLException
    {
        int iRes = findNode(iParentNode, sElementName, true);

        if (iRes == 0)
        {
            throw new XMLException("Unable to create node " + sElementName);
        }

        return iRes;
    }

    /**
     * Returns a node under the parent node based on the search path.
     *
     * @param   iParentNode   The parent node under which the node is searched.
     * @param   sElementName  The search path.
     *
     * @return  The node found.
     *
     * @throws  XMLException  Thrown if the node could not be found.
     */
    public static int findNode(int iParentNode, String sElementName)
                        throws XMLException
    {
        int iRes = findNode(iParentNode, sElementName, false);

        if (iRes == 0)
        {
            throw new XMLException("Unable to find node " + sElementName);
        }

        return iRes;
    }

    /**
     * Returns a node under the parent node based on the search path.
     *
     * @param   iParentNode   The parent node under which the node is searched.
     * @param   sElementName  The search path.
     * @param   iDefaultNode  This node is returned if the requested node was not found.
     *
     * @return  The node found.
     *
     * @throws  XMLException  Thrown if the node could not be found.
     */
    public static int findNode(int iParentNode, String sElementName, int iDefaultNode)
                        throws XMLException
    {
        int iRes = findNode(iParentNode, sElementName, false);

        if (iRes == 0)
        {
            return iDefaultNode;
        }

        return iRes;
    }

    /**
     * Reads a boolean value from the node text.
     *
     * @param   iParentNode  Parent node.
     * @param   sName        Element name.
     *
     * @return  Element value.
     *
     * @throws  XMLException  Thrown if the value was not found.
     */
    public static boolean readBoolean(int iParentNode, String sName)
                               throws XMLException
    {
        String sValue = readString(iParentNode, sName, null);

        if (sValue == null)
        {
            throw new XMLException("Unable to find node " + sName);
        }

        return parseBoolean(sValue);
    }

    /**
     * Reads a boolean value from the node text.
     *
     * @param   iParentNode  Parent node.
     * @param   sName        Element name.
     * @param   bDefault     Default value.
     *
     * @return  Read value or the default one.
     *
     * @throws  XMLException  Thrown if the value was not found.
     */
    public static boolean readBoolean(int iParentNode, String sName, boolean bDefault)
                               throws XMLException
    {
        String sValue = readString(iParentNode, sName, null);

        return (sValue != null) ? parseBoolean(sValue) : bDefault;
    }

    /**
     * Reads an enumerated value from the node text.
     *
     * @param   iParentNode   Current node.
     * @param   sName         Element name.
     * @param   saEnumNames   Enum names.
     * @param   iaEnumValues  Enum values.
     *
     * @return  Enum value.
     *
     * @throws  XMLException  Thrown if the operation failed.
     */
    public static int readEnum(int iParentNode, String sName, String[] saEnumNames,
                               int[] iaEnumValues)
                        throws XMLException
    {
        if (saEnumNames.length != iaEnumValues.length)
        {
            throw new IllegalArgumentException("Enum names array is of different length than the values array.");
        }

        if (saEnumNames.length == 0)
        {
            throw new IllegalArgumentException("Enum names array is empty.");
        }

        String sValue = readString(iParentNode, sName);

        for (int i = 0; i < saEnumNames.length; i++)
        {
            String sEnumName = saEnumNames[i];

            if (sEnumName.equals(sValue))
            {
                return iaEnumValues[i];
            }
        }

        throw new XMLException("Illegal value '" + sValue + "' for element " + sName);
    }

    /**
     * Reads an enumerated value from the node text.
     *
     * @param   iParentNode    Current node.
     * @param   sName          Element name.
     * @param   saEnumNames    Enum names.
     * @param   iaEnumValues   Enum values.
     * @param   iDefaultValue  Default enum value.
     *
     * @return  Enum value.
     *
     * @throws  XMLException  Thrown if the operation failed.
     */
    public static int readEnum(int iParentNode, String sName, String[] saEnumNames,
                               int[] iaEnumValues, int iDefaultValue)
                        throws XMLException
    {
        if (saEnumNames.length != iaEnumValues.length)
        {
            throw new IllegalArgumentException("Enum names array is of different length than the values array.");
        }

        if (saEnumNames.length == 0)
        {
            throw new IllegalArgumentException("Enum names array is empty.");
        }

        String sValue = readString(iParentNode, sName, null);

        if (sValue == null)
        {
            return iDefaultValue;
        }

        for (int i = 0; i < saEnumNames.length; i++)
        {
            String sEnumName = saEnumNames[i];

            if (sEnumName.equals(sValue))
            {
                return iaEnumValues[i];
            }
        }

        throw new XMLException("Illegal value '" + sValue + "' for element " + sName);
    }

    /**
     * Reads an integer value from the node text.
     *
     * @param   iParentNode  Parent node.
     * @param   sName        Element name.
     * @param   iDefault     Default value.
     *
     * @return  Found value or the default one.
     *
     * @throws  XMLException  Thrown if the operation failed.
     */
    public static int readInt(int iParentNode, String sName, int iDefault)
                       throws XMLException
    {
        String sValue = readString(iParentNode, sName, null);

        if ((sValue == null) || sValue.equals(""))
        {
            return iDefault;
        }

        try
        {
            return Integer.parseInt(sValue);
        }
        catch (Exception e)
        {
            throw new XMLException("Invalid number '" + sValue + "' : " + e);
        }
    }

    /**
     * Reads a string value.
     *
     * @param   iParentNode  Parent node.
     * @param   sName        Element name.
     *
     * @return  Element value.
     *
     * @throws  XMLException  Thrown if the value was not found.
     */
    public static String readString(int iParentNode, String sName)
                             throws XMLException
    {
        String sValue = getValue(iParentNode, sName);

        if (sValue == null)
        {
            throw new XMLException("Unable to find node " + sName);
        }

        return sValue;
    }

    /**
     * Reads a string value.
     *
     * @param   iParentNode    Parent node.
     * @param   sName          Element name.
     * @param   sDefaultValue  Default value.
     *
     * @return  Found value or the default one.
     *
     * @throws  XMLException  Thrown if the operation failed.
     */
    public static String readString(int iParentNode, String sName, String sDefaultValue)
                             throws XMLException
    {
        String sValue = getValue(iParentNode, sName);

        return (sValue != null) ? sValue : sDefaultValue;
    }

    /**
     * Finds a node from the XML.
     *
     * @param   iParentNode   Parent node.
     * @param   sElementName  Element name.
     * @param   bCreate       If true and the node was not found, it is created.
     *
     * @return  Found or created node.
     *
     * @throws  XMLException  Throw if the operation failed.
     */
    protected static int findNode(int iParentNode, String sElementName, boolean bCreate)
                           throws XMLException
    {
        // Check the element name type.
        if (sElementName.startsWith("@"))
        {
            // This is an attribute, so return the node.
            return iParentNode;
        }

        // Element is a node, so we must find it under the current node.

        int nPos;
        String sSubName = null;

        // Check if this is a path expression.
        if ((nPos = sElementName.indexOf('/')) > 0)
        {
            // Yes it is, get the next subtree name and adjust the current element name.
            sSubName = sElementName.substring(nPos + 1);
            sElementName = sElementName.substring(0, nPos);
        }

        // Check for wildcards
        if (sElementName.equals("*"))
        {
            return (Node.getNumChildren(iParentNode) > 0) ? Node.getFirstChild(iParentNode) : 0;
        }

        int iSubNode;

        if (!sElementName.equals("."))
        {
            // Find the node corresponding to element name.
            iSubNode = Find.firstMatch(iParentNode,
                                       "<" + Node.getName(iParentNode) + "><" + sElementName + ">");
        }
        else
        {
            // The node is the current node.
            iSubNode = iParentNode;
        }

        // Check if it was already there.
        if (iSubNode == 0)
        {
            Document dDoc = Node.getDocument(iParentNode);

            // The sub-node was not found.
            if (!bCreate)
            {
                return 0;
            }

            // Create a new node.
            iSubNode = dDoc.createElement(sElementName, iParentNode);
        }

        // If we have subnodes to search, do it recursively
        if (sSubName != null)
        {
            return findNode(iSubNode, sSubName, bCreate);
        }

        // This is the last node to be found, so return it.
        return iSubNode;
    }

    /**
     * Parses a boolean value.
     *
     * @param   sValue  String value.
     *
     * @return  true or false boolean value.
     *
     * @throws  XMLException  Thrown if the value was not a valid boolean value.
     */
    protected static boolean parseBoolean(String sValue)
                                   throws XMLException
    {
        sValue = sValue.toLowerCase();

        if (sValue.equals("true") || sValue.equals("on") || sValue.equals("1"))
        {
            return true;
        }
        else if (sValue.equals("false") || sValue.equals("off") || sValue.equals("0"))
        {
            return false;
        }
        else
        {
            throw new XMLException("Invalud boolean value " + sValue);
        }
    }

    /**
     * Returns nodes value.
     *
     * @param   iParentNode  Parent node.
     * @param   sName        Element name.
     *
     * @return  Node's value.
     *
     * @throws  XMLException  Thrown if the operation failed.
     */
    protected static String getValue(int iParentNode, String sName)
                              throws XMLException
    {
        String sValue;
        int iElemNode = findNode(iParentNode, sName, false);
        int nPos;

        if (iElemNode == 0)
        {
            return null;
        }

        // If this is a path expression, get the last node name.
        if ((nPos = sName.indexOf('/')) > 0)
        {
            // Yes it is, get the next subtree name and adjust the current element name.
            sName = sName.substring(nPos + 1);
        }

        if (sName.startsWith("@"))
        {
            // Return the attirbute value.
            sName = sName.substring(1);
            sValue = Node.getAttribute(iElemNode, sName);
        }
        else
        {
            // This the node contents.
            sValue = Node.getData(iElemNode);
        }

/*        if ((sValue != null) && sValue.equals(""))
 *      {         return null;     }*/

        return sValue;
    }
}


text:
/**
 * @ingroup cache_mngt
 * @defgroup cache_mngr Manager
 * @brief Helps keeping caches up to date.
 *
 * The purpose of a cache manager is to keep track of caches and
 * automatically receive event notifications to keep the caches
 * up to date with the kernel state. Each manager has exactly one
 * netlink socket assigned which limits the scope of each manager
 * to exactly one netlink family. Therefore all caches committed
 * to a manager must be part of the same netlink family. Due to the
 * nature of a manager, it is not possible to have a cache maintain
 * two instances of the same cache type. The socket is subscribed
 * to the event notification group of each cache and also put into
 * non-blocking mode. Functions exist to poll() on the socket to
 * wait for new events to be received.
 *
 * @code
 * App       libnl                        Kernel
 *        |                            |
 *            +-----------------+        [ notification, link change ]
 *        |   |  Cache Manager  |      | [   (IFF_UP | IFF_RUNNING)  ]
 *            |                 |                |
 *        |   |   +------------+|      |         |  [ notification, new addr ]
 *    <-------|---| route/link |<-------(async)--+  [  10.0.1.1/32 dev eth1  ]
 *        |   |   +------------+|      |                      |
 *            |   +------------+|                             |
 *    <---|---|---| route/addr |<------|-(async)--------------+
 *            |   +------------+|
 *        |   |   +------------+|      |
 *    <-------|---| ...        ||
 *        |   |   +------------+|      |
 *            +-----------------+
 *        |                            |
 * @endcode
 *
 * @par 1) Creating a new cache manager
 * @code
 * struct nl_cache_mngr *mngr;
 *
 * // Allocate a new cache manager for RTNETLINK and automatically
 * // provide the caches added to the manager.
 * mngr = nl_cache_mngr_alloc(NETLINK_ROUTE, NL_AUTO_PROVIDE);
 * @endcode
 *
 * @par 2) Keep track of a cache
 * @code
 * struct nl_cache *cache;
 *
 * // Create a new cache for links/interfaces and ask the manager to
 * // keep it up to date for us. This will trigger a full dump request
 * // to initially fill the cache.
 * cache = nl_cache_mngr_add(mngr, "route/link");
 * @endcode
 *
 * @par 3) Make the manager receive updates
 * @code
 * // Give the manager the ability to receive updates, will call poll()
 * // with a timeout of 5 seconds.
 * if (nl_cache_mngr_poll(mngr, 5000) > 0) {
 *         // Manager received at least one update, dump cache?
 *         nl_cache_dump(cache, ...);
 * }
 * @endcode
 *
 * @par 4) Release cache manager
 * @code
 * nl_cache_mngr_free(mngr);
 * @endcode
 * @{
 */

#include <netlink-local.h>
#include <netlink/netlink.h>
#include <netlink/cache.h>
#include <netlink/utils.h>

static int include_cb(struct nl_object *obj, struct nl_parser_param *p)
{
	struct nl_cache_assoc *ca = p->pp_arg;

	NL_DBG(2, "Including object %p into cache %p\n", obj, ca->ca_cache);
#ifdef NL_DEBUG
	if (nl_debug >= 4)
		nl_object_dump(obj, &nl_debug_dp);
#endif
	return nl_cache_include(ca->ca_cache, obj, ca->ca_change);
}

static int event_input(struct nl_msg *msg, void *arg)
{
	struct nl_cache_mngr *mngr = arg;
	int protocol = nlmsg_get_proto(msg);
	int type = nlmsg_hdr(msg)->nlmsg_type;
	struct nl_cache_ops *ops;
	int i, n;
	struct nl_parser_param p = {
		.pp_cb = include_cb,
	};

	NL_DBG(2, "Cache manager %p, handling new message %p as event\n",
	       mngr, msg);
#ifdef NL_DEBUG
	if (nl_debug >= 4)
		nl_msg_dump(msg, stderr);
#endif

	if (mngr->cm_protocol != protocol)
		BUG();

	for (i = 0; i < mngr->cm_nassocs; i++) {
		if (mngr->cm_assocs[i].ca_cache) {
			ops = mngr->cm_assocs[i].ca_cache->c_ops;
			for (n = 0; ops->co_msgtypes[n].mt_id >= 0; n++)
				if (ops->co_msgtypes[n].mt_id == type)
					goto found;
		}
	}

	return NL_SKIP;

found:
	NL_DBG(2, "Associated message %p to cache %p\n",
	       msg, mngr->cm_assocs[i].ca_cache);
	p.pp_arg = &mngr->cm_assocs[i];

	return nl_cache_parse(ops, NULL, nlmsg_hdr(msg), &p);
}

/**
 * Allocate new cache manager
 * @arg sk		Netlink socket.
 * @arg protocol	Netlink Protocol this manager is used for
 * @arg flags		Flags
 *
 * @return Newly allocated cache manager or NULL on failure.
 */
int nl_cache_mngr_alloc(struct nl_sock *sk, int protocol, int flags,
			struct nl_cache_mngr **result)
{
	struct nl_cache_mngr *mngr;
	int err = -NLE_NOMEM;

	if (sk == NULL)
		BUG();

	mngr = calloc(1, sizeof(*mngr));
	if (!mngr)
		goto errout;

	mngr->cm_handle = sk;
	mngr->cm_nassocs = 32;
	mngr->cm_protocol = protocol;
	mngr->cm_flags = flags;
	mngr->cm_assocs = calloc(mngr->cm_nassocs,
				 sizeof(struct nl_cache_assoc));
	if (!mngr->cm_assocs)
		goto errout;

	nl_socket_modify_cb(mngr->cm_handle, NL_CB_VALID, NL_CB_CUSTOM,
			    event_input, mngr);

	/* Required to receive async event notifications */
	nl_socket_disable_seq_check(mngr->cm_handle);

	if ((err = nl_connect(mngr->cm_handle, protocol) < 0))
		goto errout;

	if ((err = nl_socket_set_nonblocking(mngr->cm_handle) < 0))
		goto errout;

	NL_DBG(1, "Allocated cache manager %p, protocol %d, %d caches\n",
	       mngr, protocol, mngr->cm_nassocs);

	*result = mngr;
	return 0;

errout:
	nl_cache_mngr_free(mngr);
	return err;
}

/**
 * Add cache responsibility to cache manager
 * @arg mngr		Cache manager.
 * @arg name		Name of cache to keep track of
 * @arg cb		Function to be called upon changes.
 * @arg result		Pointer to store added cache.
 *
 * Allocates a new cache of the specified type and adds it to the manager.
 * The operation will trigger a full dump request from the kernel to
 * initially fill the contents of the cache. The manager will subscribe
 * to the notification group of the cache to keep track of any further
 * changes.
 *
 * @return 0 on success or a negative error code.
 */
int nl_cache_mngr_add(struct nl_cache_mngr *mngr, const char *name,
		      change_func_t cb, struct nl_cache **result)
{
	struct nl_cache_ops *ops;
	struct nl_cache *cache;
	struct nl_af_group *grp;
	int err, i;

	ops = nl_cache_ops_lookup(name);
	if (!ops)
		return -NLE_NOCACHE;

	if (ops->co_protocol != mngr->cm_protocol)
		return -NLE_PROTO_MISMATCH;

	if (ops->co_groups == NULL)
		return -NLE_OPNOTSUPP;

	for (i = 0; i < mngr->cm_nassocs; i++)
		if (mngr->cm_assocs[i].ca_cache &&
		    mngr->cm_assocs[i].ca_cache->c_ops == ops)
			return -NLE_EXIST;

retry:
	for (i = 0; i < mngr->cm_nassocs; i++)
		if (!mngr->cm_assocs[i].ca_cache)
			break;

	if (i >= mngr->cm_nassocs) {
		mngr->cm_nassocs += 16;
		mngr->cm_assocs = realloc(mngr->cm_assocs,
					  mngr->cm_nassocs *
					  sizeof(struct nl_cache_assoc));
		if (mngr->cm_assocs == NULL)
			return -NLE_NOMEM;
		else {
			NL_DBG(1, "Increased capacity of cache manager %p " \
				  "to %d\n", mngr, mngr->cm_nassocs);
			goto retry;
		}
	}

	cache = nl_cache_alloc(ops);
	if (!cache)
		return -NLE_NOMEM;

	for (grp = ops->co_groups; grp->ag_group; grp++) {
		err = nl_socket_add_membership(mngr->cm_handle, grp->ag_group);
		if (err < 0)
			goto errout_free_cache;
	}

	err = nl_cache_refill(mngr->cm_handle, cache);
	if (err < 0)
		goto errout_drop_membership;

	mngr->cm_assocs[i].ca_cache = cache;
	mngr->cm_assocs[i].ca_change = cb;

	if (mngr->cm_flags & NL_AUTO_PROVIDE)
		nl_cache_mngt_provide(cache);

	NL_DBG(1, "Added cache %p <%s> to cache manager %p\n",
	       cache, nl_cache_name(cache), mngr);

	*result = cache;
	return 0;

errout_drop_membership:
	for (grp = ops->co_groups; grp->ag_group; grp++)
		nl_socket_drop_membership(mngr->cm_handle, grp->ag_group);
errout_free_cache:
	nl_cache_free(cache);

	return err;
}

/**
 * Get file descriptor
 * @arg mngr		Cache Manager
 *
 * Get the file descriptor of the socket associated to the manager.
 * This can be used to change socket options or monitor activity
 * using poll()/select().
 */
int nl_cache_mngr_get_fd(struct nl_cache_mngr *mngr)
{
	return nl_socket_get_fd(mngr->cm_handle);
}

/**
 * Check for event notifications
 * @arg mngr		Cache Manager
 * @arg timeout		Upper limit poll() will block, in milliseconds.
 *
 * Causes poll() to be called to check for new event notifications
 * being available. Automatically receives and handles available
 * notifications.
 *
 * This functionally is ideally called regularly during an idle
 * period.
 *
 * @return A positive value if at least one update was handled, 0
 *         for none, or a  negative error code.
 */
int nl_cache_mngr_poll(struct nl_cache_mngr *mngr, int timeout)
{
	int ret;
	struct pollfd fds = {
		.fd = nl_socket_get_fd(mngr->cm_handle),
		.events = POLLIN,
	};

	NL_DBG(3, "Cache manager %p, poll() fd %d\n", mngr, fds.fd);
	ret = poll(&fds, 1, timeout);
	NL_DBG(3, "Cache manager %p, poll() returned %d\n", mngr, ret);
	if (ret < 0)
		return -nl_syserr2nlerr(errno);

	if (ret == 0)
		return 0;

	return nl_cache_mngr_data_ready(mngr);
}

/**
 * Receive available event notifications
 * @arg mngr		Cache manager
 *
 * This function can be called if the socket associated to the manager
 * contains updates to be received. This function should not be used
 * if nl_cache_mngr_poll() is used.
 *
 * @return A positive value if at least one update was handled, 0
 *         for none, or a  negative error code.
 */
int nl_cache_mngr_data_ready(struct nl_cache_mngr *mngr)
{
	int err;

	err = nl_recvmsgs_default(mngr->cm_handle);
	if (err < 0)
		return err;

	return 1;
}

/**
 * Free cache manager and all caches.
 * @arg mngr		Cache manager.
 *
 * Release all resources after usage of a cache manager.
 */
void nl_cache_mngr_free(struct nl_cache_mngr *mngr)
{
	int i;

	if (!mngr)
		return;

	if (mngr->cm_handle)
		nl_close(mngr->cm_handle);

	for (i = 0; i < mngr->cm_nassocs; i++)
		if (mngr->cm_assocs[i].ca_cache)
			nl_cache_free(mngr->cm_assocs[i].ca_cache);

	free(mngr->cm_assocs);
	free(mngr);

	NL_DBG(1, "Cache manager %p freed\n", mngr);
}

/** @} */


text:
require 'test_helper'

class Providers::AtndTest < ActiveSupport::TestCase
  def setup
    @atnd = Providers::Atnd.new
  end

  def event_hash
    {
      'event_id' => '12345678',
      'title' => 'event title',
      'description' => 'event description',
      'catch' => 'event catch',
      'address' => 'event address',
      'event_url' => 'https://event.com/event/9876'
    }
  end

  test '#initialize' do
    assert_equal 'http://api.atnd.org', @atnd.instance_variable_get(:@endpoint)
    assert_equal 'events/', @atnd.instance_variable_get(:@path)
    assert_equal ({ start: 1, count: 25, format: :json }), @atnd.instance_variable_get(:@params)
  end

  test '#response' do
    params = {'events' => [{'event' => {}}, {'event' => {}}]}
    res = @atnd.send(:response, params)
    assert_instance_of Array, res
    assert_instance_of Event, res[0]
    assert_instance_of Event, res[1]
  end

  test '#build_event' do
    hash = event_hash
    event = @atnd.send(:build_event, hash)
    assert_instance_of Event, event
    attrs = event.attributes
    assert_equal 'atnd', attrs['provider']
    assert_equal hash['event_id'], attrs['event_id']
    assert_equal hash['title'], attrs['title']
    assert_equal hash['description'], attrs['description']
    assert_equal hash['catch'], attrs['catch']
    assert_equal hash['address'], attrs['address']
    assert_equal hash['event_url'], attrs['event_url']
  end
end


text:
import { Component } from '@angular/core';

@Component({
	selector: 'about-me',
	templateUrl: `./html/about-me.component.html`,
	styleUrls: [ './css/about-me.component.css' ]
})

export class AboutMe { }


text:
class OrdersController < ApplicationController
  before_filter :load_order, :only => [:show, :edit, :update, :destroy]
  before_filter :right_company, :only => [:show, :edit, :update, :destroy]
  filter_access_to :all

  def load_order
    @order = Order.find(params[:id])
    @order.delivery_address ||= Address.new
  end

  def right_company
    if @me.companies.include? @order.company
      @me.current_company = @order.company
      @me.save!
      return true
    end

    flash[:notice]='You can only manage your own orders. Go away.'
    redirect_to :action => "index"
    return false
  end

  # GET /orders
  # GET /orders.xml
  def index
    @orders = Order.find(@me.current_company.orders, :order => 'updated_at')
    respond_to do |format|
      format.html # index.html.erb
      format.xml  { render :xml => @orders }
    end
  end

  # GET /orders/1
  # GET /orders/1.xml
  def show
    respond_to do |format|
      format.html # show.html.erb
      format.xml  { render :xml => @order }
    end
  end

  # GET /orders/new
  # GET /orders/new.xml
  def new
    @order = Order.new
    @order.delivery_address = Address.new
    @products_all = (Account.find(@me.current_company.accounts, :include => [ :products ]
			          ).collect { |account| account.products}).flatten

    respond_to do |format|
      format.html # new.html.erb
      format.xml  { render :xml => @order }
    end
  end

  # GET /orders/1/edit
  def edit
    @products_all = (Account.find(@me.current_company.accounts, :include => [ :products ]
			          ).collect { |account| account.products}).flatten
  end

  # POST /orders
  # POST /orders.xml
  def create
    @order = Order.new(params[:order])
    @order.delivery_address = Address.new(params[:address])
    @order.company_id = @me.current_company.id
    respond_to do |format|
      Order.transaction do
        begin
          @order.save!
          @order.delivery_address.save!
          params[:products].each {
            |key, value|
	    item = OrderItem.new(value)
            if item.amount > 0
	      @order.order_items << item
              item.save!
            end
          }
          flash[:notice] = 'Order was successfully created.'
          format.html { redirect_to(@order) }
          format.xml  { render :xml => @order, :status => :created, :location => @order }
        rescue Exception => e
	  puts e.inspect
          format.html { render :action => "new" }
          format.xml  { render :xml => @order.errors, :status => :unprocessable_entity }
	  raise
        end
      end
    end
  end

  # PUT /orders/1
  # PUT /orders/1.xml
  def update
    respond_to do |format|
      Order.transaction do
        begin
          flash[:notice] = 'Save order.'
          @order.update_attributes(params[:order]) or raise ActiveRecord::Rollback
          @order.delivery_address.update_attributes(params[:address]) or raise ActiveRecord::Rollback

          params[:products].each {
            |key, value|
            value[:order_id] = @order.id
            if value[:id] != nil
              op = OrderItem.find(value[:id])
              if op.amount > 0
                flash[:notice] = 'Update item.'
                op.update_attributes(value) or raise ActiveRecord::Rollback
              else
                flash[:notice] = 'DESTROY THE UNBELIVERS!!!'
                op.destroy
              end
            else
              op = OrderItem.new(value)
              if op.amount > 0
                flash[:notice] = 'Save new item.'
                op.save or raise ActiveRecord::Rollback
              end
            end
          }

          flash[:notice] = 'Order was successfully updated.'
          format.html { redirect_to(@order) }
          format.xml  { head :ok }
        rescue ActiveRecord::Rollback
          format.html { render :action => "edit" }
          format.xml  { render :xml => @order.errors, :status => :unprocessable_entity }
        end
      end
    end
  end

  # DELETE /orders/1
  # DELETE /orders/1.xml
  def destroy
    @order.destroy

    respond_to do |format|
      format.html { redirect_to(orders_url) }
      format.xml  { head :ok }
    end
  end
end


text:
/*
* @Author: dmyang
* @Date:   2016-05-23 09:18:28
* @Last Modified by:   dmyang
* @Last Modified time: 2016-08-01 15:31:42
*/

'use strict'

import React from 'react'
import { render } from 'react-dom'

class App extends React.Component {
    constructor(props: Object, context: Object) {
        super(props, context)

        this.state = {}
    }

    render() {
        return
React app

    }
}

render(<App />, document.getElementById('app'))


text:
<?php
/**
 * UserVkontakteQuery.php
 * @author Revin Roman http://phptime.ru
 */

namespace resources\User\queries;

/**
 * Class UserVkontakteQuery
 * @package resources\User\queries
 */
class UserVkontakteQuery extends \yii\db\ActiveQuery implements AbstractSocialQueryInterface
{

    /**
     * @param integer|array $user_id
     * @return self
     */
    public function byUserId($user_id)
    {
        $this->andWhere(['user_id' => $user_id]);

        return $this;
    }

    /**
     * @param integer|array $social_id
     * @return self
     */
    public function bySocialId($social_id)
    {
        $this->andWhere(['social_id' => $social_id]);

        return $this;
    }
}


text:
package edu.mit.streamjit.test.apps.fft5;

import com.google.common.base.Supplier;
import com.google.common.base.Suppliers;
import com.jeffreybosboom.serviceproviderprocessor.ServiceProvider;
import edu.mit.streamjit.api.Filter;
import edu.mit.streamjit.api.Input;
import edu.mit.streamjit.api.Pipeline;
import edu.mit.streamjit.api.StreamCompiler;
import edu.mit.streamjit.impl.compiler2.Compiler2StreamCompiler;
import edu.mit.streamjit.impl.interp.DebugStreamCompiler;
import edu.mit.streamjit.test.SuppliedBenchmark;
import edu.mit.streamjit.test.Benchmark;
import edu.mit.streamjit.test.Datasets;
import edu.mit.streamjit.test.Benchmarker;
import java.nio.ByteOrder;
import java.nio.file.Paths;

/**
 * Rewritten StreamIt's asplos06 benchmarks. Refer
 * STREAMIT_HOME/apps/benchmarks/asplos06/fft/streamit/FFT5.str for original
 * implementations. Each StreamIt's language constructs (i.e., pipeline, filter
 * and splitjoin) are rewritten as classes in StreamJit.
 *
 * @author Sumanan sumanan@mit.edu
 * @since Mar 14, 2013
 */
public final class FFT5 {
	private FFT5() {}

	public static void main(String[] args) throws InterruptedException {
		StreamCompiler sc = new DebugStreamCompiler();
		Benchmarker.runBenchmark(new FFT5Benchmark(), sc).get(0).print(System.out);
	}

	@ServiceProvider(Benchmark.class)
	public static final class FFT5Benchmark extends SuppliedBenchmark {
		public FFT5Benchmark() {
			super("FFT5", FFT5Kernel.class, new Dataset("FFT5.in",
					(Input)Input.fromBinaryFile(Paths.get("data/FFT5.in"), Float.class, ByteOrder.LITTLE_ENDIAN)
//					, (Supplier)Suppliers.ofInstance((Input)Input.fromBinaryFile(Paths.get("/home/jbosboom/streamit/streams/apps/benchmarks/asplos06/fft/streamit/FFT5.out"), Float.class, ByteOrder.LITTLE_ENDIAN))
			));
		}
	}

	/**
	 * This represents "void->void pipeline FFT5()".
	 */
	public static final class FFT5Kernel extends Pipeline<Float, Float> {
		public FFT5Kernel() {
			this(256);
		}
		public FFT5Kernel(int ways) {
			add(new FFTReorder(ways));
			for (int j = 2; j <= ways; j *= 2) {
				add(new CombineDFT(j));
			}
		}
	}

	private static final class CombineDFT extends Filter<Float, Float> {
		private final float wn_r, wn_i;
		private final int n;
		private CombineDFT(int n) {
			super(2 * n, 2 * n, 2 * n);
			this.n = n;
			this.wn_r = (float) Math.cos(2 * 3.141592654 / n);
			this.wn_i = (float) Math.sin(2 * 3.141592654 / n);
		}
		public void work() {
			float w_r = 1;
			float w_i = 0;
			float[] results = new float[2 * n];

			for (int i = 0; i < n; i += 2) {
				// this is a temporary work-around since there seems to be
				// a bug in field prop that does not propagate nWay into the
				// array references. --BFT 9/10/02

				// int tempN = nWay;
				// Fixed --jasperln

				// removed nWay, just using n --sitij 9/26/03

				float y0_r = peek(i);
				float y0_i = peek(i + 1);

				float y1_r = peek(n + i);
				float y1_i = peek(n + i + 1);

				float y1w_r = y1_r * w_r - y1_i * w_i;
				float y1w_i = y1_r * w_i + y1_i * w_r;

				results[i] = y0_r + y1w_r;
				results[i + 1] = y0_i + y1w_i;

				results[n + i] = y0_r - y1w_r;
				results[n + i + 1] = y0_i - y1w_i;

				float w_r_next = w_r * wn_r - w_i * wn_i;
				float w_i_next = w_r * wn_i + w_i * wn_r;
				w_r = w_r_next;
				w_i = w_i_next;
			}

			for (int i = 0; i < 2 * n; i++) {
				pop();
				push(results[i]);
			}
		}

	}

	private static final class FFTReorderSimple extends Filter<Float, Float> {
		private final int totalData;
		private final int n;
		private FFTReorderSimple(int n) {
			super(2 * n, 2 * n, 2 * n);
			this.n = n;
			this.totalData = 2*n;
		}
		public void work() {
			for (int i = 0; i < totalData; i += 4) {
				push(peek(i));
				push(peek(i + 1));
			}

			for (int i = 2; i < totalData; i += 4) {
				push(peek(i));
				push(peek(i + 1));
			}

			for (int i = 0; i < n; i++) {
				pop();
				pop();
			}
		}
	}

	private static final class FFTReorder extends Pipeline<Float, Float> {
		private FFTReorder(int n) {
			for (int i = 1; i < (n / 2); i *= 2)
				add(new FFTReorderSimple(n / i));
		}
	}
}


text:
cask :v1 => 'cajviewer' do
  version :latest
  sha256 :no_check

  url 'http://cajviewer.cnki.net/download/CAJViewerMac.dmg'
  homepage 'http://cajviewer.cnki.net/download.html'
  license :unknown

  pkg 'CAJViewerMac.pkg'
  uninstall :pkgutil => 'com.TTKN.CAJViewerMac'
end


text:
[keyword switch] ([variable x]) {
  [keyword case] [number 10]: {
    [keyword return] [number 20];
  }
  [keyword default]: {
    [variable&callee printf]([string "foo %c"], [variable x]);
  }
}


text:
Способы оплаты

Qiwi кошелек

WMR, WMU, WMZ, WME

Яндекс деньги

Платежные карты

Загружаем курсы валют от minfin.com.ua


text:
<?xml version="1.0"?>
<monkeyml version="1.0">
    <io_devices/>
    <variables>
        <variable tag="index" full_name="index" default_value="0" scope="LOCAL" type="INTEGER" editable="NEVER" logging="WHEN_CHANGED" persistant="NO"/>
        <variable tag="reportVar" full_name="index" default_value="0" scope="GLOBAL" type="INTEGER" editable="NEVER" logging="WHEN_CHANGED" persistant="NO"/>
        <variable type="selection" tag="selectionVar" full_name="selectionVar" values="0,1,2,3,4" selection="sequential_descending" nsamples="5" sampling_method="samples"/>
    </variables>
    <sounds/>
    <stimuli/>
    <experiment tag="SelectionTest_06" full_name="SelectionTest_06" description="">
        <protocol tag="Protocol" full_name="Protocol" description="" interruptible="YES" selection="sequential_ascending" nsamples="1" sampling_method="cycles">
            <block tag="Block" full_name="Block" description="" interruptible="YES" selection="sequential_ascending" nsamples="1" sampling_method="cycles">
                <trial tag="Trial" full_name="fullname_1" description="" interruptible="YES" selection="sequential_ascending" nsamples="1" sampling_method="cycles">
                    <range_replicator tag="Range Replicator" full_name="fullname_5" from="1" to="8" step="1" variable="index">
                        <task_system tag="SelectionTask" full_name="fullname_2" description="" interruptible="YES">
                            <task_system_state tag="check accept or not" full_name="fullname_3" description="" interruptible="YES">
                                <action tag="If" type="if" condition="index == 5">
                                    <action tag="Report reset" type="report" message="resetting selectionVar"/>
                                    <action tag="Reset Selection_2" type="reset_selection" selection="selectionVar"/>
                                </action>
                                <action tag="assign report var" type="assignment" variable="reportVar" value="selectionVar"/>
                                <action tag="Report 1" type="report" message="Before get next selection reportVar = $reportVar"/>
                                <action tag="get next selectionVar" full_name="fullname_7" type="next_selection" selection="selectionVar"/>
                                <action tag="assign report var 2" type="assignment" variable="reportVar" value="selectionVar"/>
                                <action tag="Report 2" type="report" message="After get next selection reportVar = $reportVar"/>
                                <transition type="yield" tag="Yield_18" full_name="fullname_18"/>
                            </task_system_state>
                        </task_system>
                    </range_replicator>
                </trial>
            </block>
        </protocol>
    </experiment>
</monkeyml>


text:
<!Doctype html>

		<title>index</title>
		<link rel="stylesheet" type="text/css" href="resume.css">
		<link href='http://fonts.googleapis.com/css?family=Audiowide|Quicksand:300,400,700|Lato:100,300,400,700,900,100italic,300italic,400italic,700italic,900italic' rel='stylesheet' type='text/css'/>
    <link rel="stylesheet" type="text/css" href="stylesheets/reset.css">
    <link href='http://fonts.googleapis.com/css?family=Droid+Serif' rel='stylesheet' type='text/css'>

			    <video id="videohome" class="hidden-xs hidden-sm" autoplay="true" loop="" muted="" style="height: 697.5px; width: 1260px;">
				<source src="http://player.vimeo.com/external/90068336.hd.mp4?s=df933ea0ef031de9a80ddc2814f23d06" type="video/mp4">
				<source src="/static/vid/electrik-web-bw.webmhd.webm" type="video/webm">
				<source src="/static/vid/electrik-web-bw.oggtheora.ogv" type="ogv">
			</video>

Widny St. Louis

 Email: widny_stlouis1@gmail.com

 Mobile: 954-496-1832

 Linkedin

						About Me

						Professional Experience

						Education

						Technical Skills

						Personal Journal

						Other Projects

Aspiring Web Developer

 I am an aspiring full-stack programmer. With no previous programming experience, I taught myself HTML and CSS in less than a month. Determined to achieve my aspiration, I quit my job to focus on learning software development full time. I am lookng to join a company with a great culture and focus on user experience  where I can continue to learn front-end and back-end programming languages while working on their product.

Additionally, I have a business background and posseses pracitcal knowlege in customer experience, planning, analysis, and negotioations.

I am a self-starter, entpreneurial, have strong leadership skills, interpersonal skills, communication skills. Work well in a team environment. Posseses high attention to detail and operate with a strong sense of urgency while delivering quality product to customers.

Core compentencies include: Research/ Investigative skills, Market Analysis, Analytical Reporting, Strategic Planning, Customer Service/Relations, Negotiations.

Professional Experience

STATE FARM
Claims Representative - August 2011 to May 2014

Conducted thorough investigations in a fast paced setting and met tight deadlines.  Applied meticlous analytical skills to evaluate bodily injury claims, negotiate settlement agreements, and protect customers from multi-million dollar personal financial exposure. Identified key trends and informed management of insurance fraud thereby reducing company expenditure of more than $750,000.

EXAMWORKS
Reports Coordinator - September 2010 to August 2011

Supervised a panel of legal medical experts (i.e. Medical Doctors and Chiropractors) to provide record reviews and Independent Medical Examination reports to insurance companies and law firms in the state of Florida. Under my supervision, we created and implemented a rigorous quality assurance process  while also improving efficiency. As a result of both strategies, product quality increased and we were able to improve turnaround time by 25% within two months.

NARIAN TECHNOLOGIES
 Quality Assurance Internship - August 2009 to December 2009

 Conducted multiple tests on the company's moble application at different locations. Provided feedback to management regarding the application'sfunctionality and design.  Also, conducted marketing research in which we identified target market as well as the organization's internal and external objectives.

LUXEWORLD INTERNATIONAL
 Executive Assistant - August 2005 to May 2009

Planned and coordinated exclsuive events for the company. Maintained their multi-million dollar real estate property listings. Provided administrative assistance as the company produced a televsion series that was seen in 27 different countries.

Education

 Bachelors of Science in Entrepreneurship &amp Small Business

Palm Beach Atlantic University - 2009

Technical Skills

Proficient in Microsoft Office Suite: Word, Excel, Power Point, Outlook

Sublime Text 2

Git

Github

CSS

HTML

Wireframing

Recent Projects

					Click to see wireframe

Contact Me

Please contact me


text:
'use strict';

const assert = require('assert');
const { DeclarativeTest } = require('../..');

const namespace = {
  string: '__STRING__',
  regexp: new RegExp('regexp'),
};
const test = new DeclarativeTest(
  "target type 'value'",
  { namespace },
  {
    'namespace.string': [['__STRING__']],
    'namespace.regexp': [[new RegExp('regexp')]],
  }
);
test.on('done', () => {
  const [stringTargetResult, regexpTargetResult] = test.results;
  assert.strictEqual(regexpTargetResult.actual, '"regexp"');
  assert.strictEqual(stringTargetResult.actual, '"__STRING__"');
  assert.strictEqual(stringTargetResult.message, 'value namespace.string');
});


text:
<?php

/**
 * Abstract API2 class for customer
 *
 * @category   Mage
 * @package    Mage_Customer
 * @author     Magento Core Team <core@magentocommerce.com>
 */
abstract class Mage_Customer_Model_Api2_Customer_Rest extends Mage_Customer_Model_Api2_Customer
{
    /**
     * Create customer
     *
     * @param array $data
     * @return string
     */
    protected function _create(array $data)
    {
        /** @var $validator Mage_Api2_Model_Resource_Validator_Eav */
        $validator = Mage::getResourceModel('api2/validator_eav', array('resource' => $this));

        $data = $validator->filter($data);
        if (!$validator->isValidData($data)) {
            foreach ($validator->getErrors() as $error) {
                $this->_error($error, Mage_Api2_Model_Server::HTTP_BAD_REQUEST);
            }
            $this->_critical(self::RESOURCE_DATA_PRE_VALIDATION_ERROR);
        }

        /** @var $customer Mage_Customer_Model_Customer */
        $customer = Mage::getModel('customer/customer');
        $customer->setData($data);

        try {
            $customer->save();
        } catch (Mage_Core_Exception $e) {
            $this->_error($e->getMessage(), Mage_Api2_Model_Server::HTTP_INTERNAL_ERROR);
        } catch (Exception $e) {
            $this->_critical(self::RESOURCE_INTERNAL_ERROR);
        }

        return $this->_getLocation($customer);
    }

    /**
     * Retrieve information about customer
     *
     * @throws Mage_Api2_Exception
     * @return array
     */
    protected function _retrieve()
    {
        /** @var $customer Mage_Customer_Model_Customer */
        $customer = $this->_loadCustomerById($this->getRequest()->getParam('id'));
        return $customer->getData();
    }

    /**
     * Get customers list
     *
     * @return array
     */
    protected function _retrieveCollection()
    {
        $data = $this->_getCollectionForRetrieve()->load()->toArray();
        return isset($data['items']) ? $data['items'] : $data;
    }

    /**
     * Update customer
     *
     * @param array $data
     * @throws Mage_Api2_Exception
     */
    protected function _update(array $data)
    {
        /** @var $customer Mage_Customer_Model_Customer */
        $customer = $this->_loadCustomerById($this->getRequest()->getParam('id'));
        /** @var $validator Mage_Api2_Model_Resource_Validator_Eav */
        $validator = Mage::getResourceModel('api2/validator_eav', array('resource' => $this));

        $data = $validator->filter($data);

        unset($data['website_id']); // website is not allowed to change

        if (!$validator->isValidData($data, true)) {
            foreach ($validator->getErrors() as $error) {
                $this->_error($error, Mage_Api2_Model_Server::HTTP_BAD_REQUEST);
            }
            $this->_critical(self::RESOURCE_DATA_PRE_VALIDATION_ERROR);
        }

        $customer->addData($data);

        try {
            $customer->save();
        } catch (Mage_Core_Exception $e) {
            $this->_error($e->getMessage(), Mage_Api2_Model_Server::HTTP_INTERNAL_ERROR);
        } catch (Exception $e) {
            $this->_critical(self::RESOURCE_INTERNAL_ERROR);
        }
    }

    /**
     * Load customer by id
     *
     * @param int $id
     * @throws Mage_Api2_Exception
     * @return Mage_Customer_Model_Customer
     */
    protected function _loadCustomerById($id)
    {
        /** @var $customer Mage_Customer_Model_Customer */
        $customer = Mage::getModel('customer/customer')->load($id);
        if (!$customer->getId()) {
            $this->_critical(self::RESOURCE_NOT_FOUND);
        }
        return $customer;
    }

    /**
     * Retrieve collection instances
     *
     * @return Mage_Customer_Model_Resource_Customer_Collection
     */
    protected function _getCollectionForRetrieve()
    {
        /** @var $collection Mage_Customer_Model_Resource_Customer_Collection */
        $collection = Mage::getResourceModel('customer/customer_collection');
        $collection->addAttributeToSelect(array_keys(
            $this->getAvailableAttributes($this->getUserType(), Mage_Api2_Model_Resource::OPERATION_ATTRIBUTE_READ)
        ));

        $this->_applyCollectionModifiers($collection);
        return $collection;
    }
}


text: If you have docker installed then you can contemplate with the command $./zen.sh