text:
package HaskellFun.editor;

/*Generated by MPS */

import jetbrains.mps.nodeEditor.DefaultNodeEditor;
import jetbrains.mps.openapi.editor.cells.EditorCell;
import jetbrains.mps.openapi.editor.EditorContext;
import org.jetbrains.mps.openapi.model.SNode;
import jetbrains.mps.nodeEditor.cells.EditorCell_Collection;
import jetbrains.mps.nodeEditor.cellProviders.CellProviderWithRole;
import jetbrains.mps.lang.editor.cellProviders.PropertyCellProvider;
import jetbrains.mps.nodeEditor.EditorManager;
import jetbrains.mps.nodeEditor.cells.EditorCell_Constant;
import jetbrains.mps.lang.editor.cellProviders.RefNodeCellProvider;

public class RecordEntry_Editor extends DefaultNodeEditor {
  public EditorCell createEditorCell(EditorContext editorContext, SNode node) {
    return this.createCollection_pb870l_a(editorContext, node);
  }
  private EditorCell createCollection_pb870l_a(EditorContext editorContext, SNode node) {
    EditorCell_Collection editorCell = EditorCell_Collection.createIndent2(editorContext, node);
    editorCell.setCellId("Collection_pb870l_a");
    editorCell.setBig(true);
    editorCell.addEditorCell(this.createProperty_pb870l_a0(editorContext, node));
    editorCell.addEditorCell(this.createConstant_pb870l_b0(editorContext, node));
    editorCell.addEditorCell(this.createRefNode_pb870l_c0(editorContext, node));
    return editorCell;
  }
  private EditorCell createProperty_pb870l_a0(EditorContext editorContext, SNode node) {
    CellProviderWithRole provider = new PropertyCellProvider(node, editorContext);
    provider.setRole("name");
    provider.setNoTargetText("<no name>");
    EditorCell editorCell;
    editorCell = provider.createEditorCell(editorContext);
    editorCell.setCellId("property_name");
    editorCell.setSubstituteInfo(provider.createDefaultSubstituteInfo());
    SNode attributeConcept = provider.getRoleAttribute();
    Class attributeKind = provider.getRoleAttributeClass();
    if (attributeConcept != null) {
      EditorManager manager = EditorManager.getInstanceFromContext(editorContext);
      return manager.createNodeRoleAttributeCell(editorContext, attributeConcept, attributeKind, editorCell);
    } else
    return editorCell;
  }
  private EditorCell createConstant_pb870l_b0(EditorContext editorContext, SNode node) {
    EditorCell_Constant editorCell = new EditorCell_Constant(editorContext, node, "::");
    editorCell.setCellId("Constant_pb870l_b0");
    editorCell.setDefaultText("");
    return editorCell;
  }
  private EditorCell createRefNode_pb870l_c0(EditorContext editorContext, SNode node) {
    CellProviderWithRole provider = new RefNodeCellProvider(node, editorContext);
    provider.setRole("type");
    provider.setNoTargetText("<no type>");
    EditorCell editorCell;
    editorCell = provider.createEditorCell(editorContext);
    if (editorCell.getRole() == null) {
      editorCell.setRole("type");
    }
    editorCell.setSubstituteInfo(provider.createDefaultSubstituteInfo());
    SNode attributeConcept = provider.getRoleAttribute();
    Class attributeKind = provider.getRoleAttributeClass();
    if (attributeConcept != null) {
      EditorManager manager = EditorManager.getInstanceFromContext(editorContext);
      return manager.createNodeRoleAttributeCell(editorContext, attributeConcept, attributeKind, editorCell);
    } else
    return editorCell;
  }
}


text:
io-shinken-checks-linux
=======================

Specifics checks for linux based on pure ssh polling, with nothing to install on the target

Dependencies
======================
 * python
 * python-paramiko

Connexion
======================
This check is for checking the SSH connexion to the distant server.

  $ check_ssh_connexion.py -H localhost -u shinken

Memory
======================
The Memory check is done by the check_memory_by_ssh.py script.

  $ check_memory_by_ssh.py -H localhost -u shinken -w "75%" -c "90%"

Uptime
======================
The Uptime check is done by the check_uptime_by_ssh.py script. It only take a -c option, the number of second : below it's critical, higher it's ok. By default it's 3600s.

  $ check_uptime_by_ssh.py -H localhost -u shinken -c 3600

NTP Sync
======================
The NTP sync check is done by the check_ntp_sync_by_ssh.py script. It will go in warning if no ntp server is the reference, and -w/-c options will set the maximum delay values.

  $ check_ntp_sync_by_ssh.py -H localhost -u shinken -w 10 -c 60

Processes (Memory)
=====================
Look at the memory of a process, or a pack of processes. It's done by the check_processes_by_ssh script

  Look that the sum of all *chrome* processes are not over 700 or 800MB
  $check_processes_by_ssh.py -H localhost -u shinken -C chrome -w 700 -c 800 -S

  Look for each *chrome* processe if they are not over 100 or 200MB
  $check_processes_by_ssh.py -H localhost -u shinken -C chrome -w 100 -c 200

  Look for all process, and warn if one is over 100/200MB
  $check_processes_by_ssh.py -H localhost -u shinken -w 100 -c 200

Disks
======================
The Disks check is done by the check_disks_by_ssh.py script.

  $ check_disks_by_ssh.py -H localhost -u shinken -w "75%" -c "90%"

Load average
=====================
The load average values are checks with the check_load_average_by_ssh script.
There are two modes : strict values, and cpu based values. 'default : strict)

  Will warn if the load average is highen than 1 or 2
  $ check_load_average_by_ssh.py -H localhost -u shinken -w 1,1,1 -c 2,2,2

  Will warn if the load average is highen than 1*nb_cpus or 2*nb_cpus
  $ check_load_average_by_ssh.py -H localhost -u shinken -w 1,1,1 -c 2,2,2 -C

CPU activities
====================
The cpu states are checks by the check_cpu_stats.py script. There is no warning or critical values need here.

  $ check_cpu_stats.py -H localhost -u shinken

DISKS activities
===================
The disks I/O are checked by the check_disks_stats_by_ssh.py. No warning nor critical values need.

  $ check_disks_stats_by_ssh.py -H localhost -u shinken

TCP states
==================
The TCP states are checked by the check_tcp_states_by_ssh.py plugin. No warning nor critical values need.

  $ check_tcp_states_by_ssh.py - H localhost -u shinken

KERNEL stats
==================
The KERNEL states are checked by the check_kernel_stats_by_ssh.py plugin. No warning nor critical values need.

  $ check_kernel_stats_by_ssh.py - H localhost -u shinken

NFS stats
==================
The NFS states are checked by the check_nfs_stats_by_ssh.py plugin. No warning nor critical values need.

  $ check_nfs_stats_by_ssh.py - H localhost -u shinken

Interface activities
=================
The network activity is checked by the check_net_stats_by_ssh.py plugin. No need for warning nor critical.

  $ check_net_stats_by_ssh.py - H localhost -u shinken

Read Only file systems
==================
The file system mount are checks. If a FS is in read only, it will raise a critical error.

  $ check_ro_filesystem_by_ssh.py - H localhost -u shinken

redpajama_set_name: RedPajamaGithub


text:
declare module '@salesforce/design-system-react/components/utilities/pill' {
	import React from 'react';
	type Props = {
		/**
		 * Pill is the actively focused pill within a pill container. This will request focus on the DOM node.
		 */
		active?: boolean;
		/**
		 * **Assistive text for accessibility**
		 * This object is merged with the default props object on every render.
		 * * `pressDeleteOrBackspace`: Informs user of keyboard keys to press in order to remove a pill
		 */
		assistiveText?: Partial<{
			remove?: string;
		}>;
		/**
		 * SLDSAvatar component to show on the left of the pill.
		 * _Tested with Mocha framework._
		 */
		avatar?: React.ReactElement;
		/**
		 * Applies the bare style to the component.
		 * _Tested with Mocha framework._
		 */
		bare?: boolean;
		/*
		 * Pills are often used for selection of a type of entity such as days in a daypicker. This prop allows you to pass in data that will be passed back to the event handler.
		 */
		eventData?: Record<string, any>;
		/*
		 * Callbacks for various pill events such as click, focus, etc
		 */
		events?: Partial<{
			onClick?: (v: any) => any;
			onFocus?: (v: any) => any;
			onRequestFocus: (v: any) => any /*.isRequired*/;
			onRequestFocusOnNextPill: (v: any) => any /*.isRequired*/;
			onRequestFocusOnPreviousPill: (v: any) => any /*.isRequired*/;
			onRequestRemove: (v: any) => any /*.isRequired*/;
		}>;
		/**
		 * Applies the error style to the component.
		 * _Tested with Mocha framework._
		 */
		hasError?: boolean;
		/*
		 * The icon next to the pill label.
		 */
		icon?: React.ReactElement;
		/*
		 * Pill Label
		 */
		labels?: Partial<{
			label: string /*.isRequired*/;
			removeTitle?: string;
		}>;
		/*
		 * If true and is active pill in listbox, will trigger `events.onRequestFocus`
		 */
		requestFocus?: boolean;
		/*
		 * Pill Title
		 */
		title?: string;
		/*
		 * Allows the user to tab to the node
		 */
		tabIndex?: number;
	};

	function Component(props: Props): JSX.Element;
	export default Component;
}


text:
<?php
/**
 * Custom Recent Posts widget class
 * Customized
 *
 * @since 2.8.0
 */

class WP_Custom_Widget_Recent_Posts extends WP_Widget {

	public function __construct() {
		$widget_ops = array('classname' => 'widget_recent_entries', 'description' => __( "Senaste recepten för nuvarande kategori.") );
		parent::__construct('custom-recent-posts', __('Senaste recepten'), $widget_ops);
		$this->alt_option_name = 'widget_recent_entries';

		add_action( 'save_post', array($this, 'flush_widget_cache') );
		add_action( 'deleted_post', array($this, 'flush_widget_cache') );
		add_action( 'switch_theme', array($this, 'flush_widget_cache') );
	}

	public function widget($args, $instance) {
		global $post;
		$cache = array();
		if ( ! $this->is_preview() ) {
			$cache = wp_cache_get( 'widget_recent_posts', 'widget' );
		}

		if ( ! is_array( $cache ) ) {
			$cache = array();
		}

		if ( ! isset( $args['widget_id'] ) ) {
			$args['widget_id'] = $this->id;
		}

		if ( isset( $cache[ $args['widget_id'] ] ) ) {
			echo $cache[ $args['widget_id'] ];
			return;
		}

		ob_start();

		$title = ( ! empty( $instance['title'] ) ) ? $instance['title'] : __( 'Senaste recepten' );

		/** This filter is documented in wp-includes/default-widgets.php */
		$title = apply_filters( 'widget_title', $title, $instance, $this->id_base );

		$number = ( ! empty( $instance['number'] ) ) ? absint( $instance['number'] ) : 5;
		if ( ! $number )
			$number = 5;
		$show_date = isset( $instance['show_date'] ) ? $instance['show_date'] : false;

		// Grab the pages and posts with current category id
		$pages_by_category = WP_Content_By_Category::get_posts_and_pages();

		// Filter the current post's parent
		$exclude_id = WP_Content_By_Category::get_top_category_page()->ID;

		// Current post id
		$current_post_id = $post->ID;

		// Current category id
		$category_id = WP_Content_By_Category::get_current_category();

		// $categories = WP_Content_By_Category::get_current_categories();
		// $category_ids = array();
		// foreach ($categories as $category) {
		// 	$category_ids[] = $category->cat_ID;
		// }

		/**
		 * Filter the arguments for the Recent Posts widget.
		 *
		 * @since 3.4.0
		 *
		 * @see WP_Query::get_posts()
		 *
		 * @param array $args An array of arguments used to retrieve the recent posts.
		 */
		$r = new WP_Query( apply_filters( 'widget_posts_args', array(
			'posts_per_page'      => $number,
			'no_found_rows'       => true,
			'post_status'         => 'publish',
			'ignore_sticky_posts' => true,
			'cat'				  => WP_Content_By_Category::get_current_category(),
			'post__not_in'		  => array($exclude_id),
			'post_type'			  => 'recipe'
		) ) );

		if ($r->have_posts() && !empty($category_id)) :
?>
		<?php echo $args['before_widget']; ?>
		<?php if ( $title ) {
			echo $args['before_title'] . $title . $args['after_title'];
		} ?>

		<?php while ( $r->have_posts() ) : $r->the_post(); ?>
			<?php if(get_page($categorizedPage->ID)->post_type != "page"): ?>

					<?php if($current_post_id == get_the_id()): ?>
						<a href="<?php the_permalink(); ?>" class="active-recent-post"><?php get_the_title() ? the_title() : the_ID(); ?>
					<?php else: ?>
						<a href="<?php the_permalink(); ?>"><?php get_the_title() ? the_title() : the_ID(); ?>
					<?php endif; ?>

					<?php if ( $show_date ) : ?>
						<?php echo get_the_date(); ?>
					<?php endif; ?>

			<?php endif; ?>
		<?php endwhile; ?>

		<?php echo $args['after_widget']; ?>
<?php
		// Reset the global $the_post as this query will have stomped on it
		wp_reset_postdata();

		endif;

		if ( ! $this->is_preview() ) {
			$cache[ $args['widget_id'] ] = ob_get_flush();
			wp_cache_set( 'widget_recent_posts', $cache, 'widget' );
		} else {
			ob_end_flush();
		}
	}

	public function update( $new_instance, $old_instance ) {
		$instance = $old_instance;
		$instance['title'] = strip_tags($new_instance['title']);
		$instance['number'] = (int) $new_instance['number'];
		$instance['show_date'] = isset( $new_instance['show_date'] ) ? (bool) $new_instance['show_date'] : false;
		$this->flush_widget_cache();

		$alloptions = wp_cache_get( 'alloptions', 'options' );
		if ( isset($alloptions['widget_recent_entries']) )
			delete_option('widget_recent_entries');

		return $instance;
	}

	public function flush_widget_cache() {
		wp_cache_delete('widget_recent_posts', 'widget');
	}

	public function form( $instance ) {
		$title     = isset( $instance['title'] ) ? esc_attr( $instance['title'] ) : '';
		$number    = isset( $instance['number'] ) ? absint( $instance['number'] ) : 5;
		$show_date = isset( $instance['show_date'] ) ? (bool) $instance['show_date'] : false;
?>

<label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?>
		<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo $title; ?>" />

<label for="<?php echo $this->get_field_id( 'number' ); ?>"><?php _e( 'Number of posts to show:' ); ?>
		<input id="<?php echo $this->get_field_id( 'number' ); ?>" name="<?php echo $this->get_field_name( 'number' ); ?>" type="text" value="<?php echo $number; ?>" size="3" />

<input class="checkbox" type="checkbox" <?php checked( $show_date ); ?> id="<?php echo $this->get_field_id( 'show_date' ); ?>" name="<?php echo $this->get_field_name( 'show_date' ); ?>" />
		<label for="<?php echo $this->get_field_id( 'show_date' ); ?>"><?php _e( 'Display post date?' ); ?>

<?php
	}
}


text:
package youtube;

import activity.AWeb.Video;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.net.Uri;
import android.preference.PreferenceManager;
import android.util.Log;
import org.apache.http.HttpResponse;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import javax.xml.parsers.FactoryConfigurationError;
import java.io.*;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLDecoder;
import java.net.URLEncoder;
import java.util.*;

public class YouTubeUtility {

    /**
     * Retrieve the latest video in the specified playlist.
     *
     * @param pPlaylistId the id of the playlist for which to retrieve the latest video id
     * @return the video id of the latest video, null if something goes wrong
     * @throws java.io.IOException
     * @throws org.apache.http.client.ClientProtocolException
     * @throws javax.xml.parsers.FactoryConfigurationError
     */
    public static String queryLatestPlaylistVideo(PlaylistId pPlaylistId)
            throws IOException, ClientProtocolException,
            FactoryConfigurationError {

        String lVideoId = null;

        HttpClient lClient = new DefaultHttpClient();

        HttpGet lGetMethod = new HttpGet(YoutubeUrlIDs.YOUTUBE_PLAYLIST_ATOM_FEED_URL +
                pPlaylistId.getId() + "?v=2&max-results=50&alt=json");

        HttpResponse lResp = null;

        lResp = lClient.execute(lGetMethod);

        ByteArrayOutputStream lBOS = new ByteArrayOutputStream();
        String lInfoStr = null;
        JSONObject lYouTubeResponse = null;

        try {

            lResp.getEntity().writeTo(lBOS);
            lInfoStr = lBOS.toString("UTF-8");
            lYouTubeResponse = new JSONObject(lInfoStr);

            JSONArray lEntryArr = lYouTubeResponse.getJSONObject("feed").getJSONArray("entry");
            JSONArray lLinkArr = lEntryArr.getJSONObject(lEntryArr.length() - 1).getJSONArray("link");
            for (int i = 0; i < lLinkArr.length(); i++) {
                JSONObject lLinkObj = lLinkArr.getJSONObject(i);
                ;
                String lRelVal = lLinkObj.optString("rel", null);
                if (lRelVal != null && lRelVal.equals("alternate")) {

                    String lUriStr = lLinkObj.optString("href", null);
                    Uri lVideoUri = Uri.parse(lUriStr);
                    lVideoId = lVideoUri.getQueryParameter("v");
                    break;
                }
            }
        } catch (IllegalStateException e) {
            Log.i(YouTubeUtility.class.getSimpleName(), "Error retrieving content from YouTube", e);
        } catch (IOException e) {
            Log.i(YouTubeUtility.class.getSimpleName(), "Error retrieving content from YouTube", e);
        } catch (JSONException e) {
            Log.i(YouTubeUtility.class.getSimpleName(), "Error retrieving content from YouTube", e);
        }

        return lVideoId;
    }

    /**
     * Get the string info for parse the video.
     */
    public static String getInfoString(String id) throws IOException {
        HttpClient lClient = new DefaultHttpClient();

        HttpGet lGetMethod = new HttpGet(YoutubeUrlIDs.YOUTUBE_VIDEO_INFORMATION_URL + id + "&el=embedded&gl=US&hl=en&eurl=" + URLEncoder.encode("https://youtube.googleapis.com/v/" + id, "UTF-8") + "&asv=3&sts=1588");

        HttpResponse lResp = null;

        lResp = lClient.execute(lGetMethod);

        ByteArrayOutputStream lBOS = new ByteArrayOutputStream();
        String lInfoStr = null;

        lResp.getEntity().writeTo(lBOS);
        lInfoStr = new String(lBOS.toString("UTF-8"));

        return lInfoStr;
    }

    /**
     * Get the websource of a youtube video.
     */
    public static String getUrlSource(String id) throws IOException {
        URL yahoo = new URL(YoutubeUrlIDs.YOUTUBE_VIDEO_INFORMATION_URL + id);
        URLConnection yc = yahoo.openConnection();
        BufferedReader in = new BufferedReader(new InputStreamReader(
                yc.getInputStream(), "UTF-8"));
        String inputLine;
        StringBuilder a = new StringBuilder();
        while ((inputLine = in.readLine()) != null)
            a.append(inputLine);

        in.close();
        return a.toString();
    }

    /**
     * Parsing videos from youtube.
     * Script#1.
     */
    public static ArrayList<Video> func_get_video_script1(String web_source) throws Exception {
        ArrayList<Video> video_list = new ArrayList<Video>();

        String[] lArgs = web_source.split("&");
        Map<String, String> lArgMap = new HashMap<String, String>();
        for (int i = 0; i < lArgs.length; i++) {
            String[] lArgValStrArr = lArgs[i].split("=");
            if (lArgValStrArr != null) {
                if (lArgValStrArr.length >= 2) {
                    lArgMap.put(lArgValStrArr[0], URLDecoder.decode(lArgValStrArr[1]));
                }
            }
        }

        //Find out the URI string from the parameters

        //Populate the list of formats for the video
        String lFmtList = URLDecoder.decode(lArgMap.get("fmt_list"));
        ArrayList<Format> lFormats = new ArrayList<Format>();
        if (null != lFmtList) {
            String lFormatStrs[] = lFmtList.split(",");

            for (String lFormatStr : lFormatStrs) {
                Format lFormat = new Format(lFormatStr);
                lFormats.add(lFormat);
            }
        }

        //Populate the list of streams for the video
        String lStreamList = lArgMap.get("url_encoded_fmt_stream_map");
        if (null != lStreamList) {
            String lStreamStrs[] = lStreamList.split(",");
            ArrayList<VideoStream> lStreams = new ArrayList<VideoStream>();
            for (String lStreamStr : lStreamStrs) {
                VideoStream lStream = new VideoStream(lStreamStr);
                lStreams.add(lStream);
            }

            //-----------------------------------------------------
            //----
            HashMap<Integer, String> typeMap = new HashMap<Integer, String>();

            typeMap.put(13, "Low : 176x144 | 3GP");
            typeMap.put(17, "Low : 176x144 | 3GP");
            typeMap.put(36, "Medium : 320x240 | 3GP");

            typeMap.put(5, "Medium : 640x360 | FLV");
            typeMap.put(6, "Medium : 640x360 | FLV");

            typeMap.put(34, "Medium : 640x360 | FLV");
            typeMap.put(35, "High : 854x480 | FLV");

            typeMap.put(43, "Medium : 640x360 | WEBM");
            typeMap.put(44, "High : 854x480 | WEBM");
            typeMap.put(45, "HD : 1280x720 | WEBM");
            typeMap.put(46, "Full HD 3D : 1920x1020 | WEBM");

            typeMap.put(18, "Medium :  480x360 | MP4");
            typeMap.put(22, "HD :  1280x720 | MP4");

            typeMap.put(37, "Full HD : 1920x1080 | MP4");
            typeMap.put(38, "Full HD 3D : 3072x1080 | MP4");
            typeMap.put(33, "4K : 4096x230 | MP4");

            for (Format lformat : lFormats) {
                Video lvid = new Video();
                int lIndex = lFormats.indexOf(lformat);
                int id = lformat.getId();
                //get video quality type string..
                String ltype = typeMap.get(id);

                if (lIndex >= 0) {
                    VideoStream lSearchStream = lStreams.get(lIndex);

                    String lUriString = Uri.decode(Uri.parse(lSearchStream.getUrl()).toString());

                    lvid.type = ltype;
                    lvid.url = lUriString;
                    if (lvid.type != null && lvid.url != null) {
                        video_list.add(lvid);
                    }
                }
            }
        }

        return video_list;
    }

    /**
     * Parsing videos from youtube.
     * This is : Script#2
     */
    public static ArrayList<Video> func_get_video_script2(String pYouTubeVideoId) throws IOException,
            ClientProtocolException, UnsupportedEncodingException {

        ArrayList<Video> lVideoList = new ArrayList<Video>();

        HttpClient lClient = new DefaultHttpClient();

        HttpGet lGetMethod = new HttpGet(YoutubeUrlIDs.YOUTUBE_VIDEO_INFORMATION_URL + pYouTubeVideoId + "&el=embedded&gl=US&hl=en&eurl=" + URLEncoder.encode("https://youtube.googleapis.com/v/" + pYouTubeVideoId, "UTF-8") + "&asv=3&sts=1588");

        HttpResponse lResp = null;

        lResp = lClient.execute(lGetMethod);

        ByteArrayOutputStream lBOS = new ByteArrayOutputStream();
        String lInfoStr = null;

        lResp.getEntity().writeTo(lBOS);
        lInfoStr = new String(lBOS.toString("UTF-8"));

        String[] lArgs = lInfoStr.split("&");
        Map<String, String> lArgMap = new HashMap<String, String>();
        for (int i = 0; i < lArgs.length; i++) {
            String[] lArgValStrArr = lArgs[i].split("=");
            if (lArgValStrArr != null) {
                if (lArgValStrArr.length >= 2) {
                    lArgMap.put(lArgValStrArr[0], URLDecoder.decode(lArgValStrArr[1]));
                }
            }
        }

        //Find out the URI string from the parameters

        //Populate the list of formats for the video
        String lFmtList = URLDecoder.decode(lArgMap.get("fmt_list"));
        ArrayList<Format> lFormats = new ArrayList<Format>();
        if (null != lFmtList) {
            String lFormatStrs[] = lFmtList.split(",");

            for (String lFormatStr : lFormatStrs) {
                Format lFormat = new Format(lFormatStr);
                lFormats.add(lFormat);
            }
        }

        //Populate the list of streams for the video
        String lStreamList = lArgMap.get("url_encoded_fmt_stream_map");
        if (null != lStreamList) {
            String lStreamStrs[] = lStreamList.split(",");
            ArrayList<VideoStream> lStreams = new ArrayList<VideoStream>();
            for (String lStreamStr : lStreamStrs) {
                VideoStream lStream = new VideoStream(lStreamStr);
                lStreams.add(lStream);
            }

            //-----------------------------------------------------
            //----
            HashMap<Integer, String> typeMap = new HashMap<Integer, String>();

            typeMap.put(13, "Low : 176x144 | 3GP");
            typeMap.put(17, "Low : 176x144 | 3GP");
            typeMap.put(36, "Medium : 320x240 | 3GP");

            typeMap.put(5, "Medium : 640x360 | FLV");
            typeMap.put(6, "Medium : 640x360 | FLV");

            typeMap.put(34, "Medium : 640x360 | FLV");
            typeMap.put(35, "High : 854x480 | FLV");

            typeMap.put(43, "Medium : 640x360 | WEBM");
            typeMap.put(44, "High : 854x480 | WEBM");
            typeMap.put(45, "HD : 1280x720 | WEBM");
            typeMap.put(46, "Full HD 3D : 1920x1020 | WEBM");

            typeMap.put(18, "Medium :  480x360 | MP4");
            typeMap.put(22, "HD :  1280x720 | MP4");

            typeMap.put(37, "Full HD : 1920x1080 | MP4");
            typeMap.put(38, "Full HD 3D : 3072x1080 | MP4");
            typeMap.put(33, "4K : 4096x230 | MP4");

            for (Format lformat : lFormats) {
                Video lvid = new Video();
                int lIndex = lFormats.indexOf(lformat);
                int id = lformat.getId();
                //get video quality type string..
                String ltype = typeMap.get(id);

                if (lIndex >= 0) {
                    VideoStream lSearchStream = lStreams.get(lIndex);

                    String lUriString = Uri.decode(Uri.parse(lSearchStream.getUrl()).toString());

                    lvid.type = ltype;
                    lvid.url = lUriString;
                    if (lvid.type != null && lvid.url != null) {
                        lVideoList.add(lvid);
                    }
                }
            }
        }

        return lVideoList;
    }

    public static String calculateYouTubeUrl(String pYouTubeFmtQuality, boolean pFallback, String pYouTubeVideoId) throws IOException,
            ClientProtocolException, UnsupportedEncodingException {

        String lUriStr = null;
        HttpClient lClient = new DefaultHttpClient();

        HttpGet lGetMethod = new HttpGet(YoutubeUrlIDs.YOUTUBE_VIDEO_INFORMATION_URL +
                pYouTubeVideoId);

        HttpResponse lResp = null;

        lResp = lClient.execute(lGetMethod);

        ByteArrayOutputStream lBOS = new ByteArrayOutputStream();
        String lInfoStr = null;

        lResp.getEntity().writeTo(lBOS);
        lInfoStr = new String(lBOS.toString("UTF-8"));

        String[] lArgs = lInfoStr.split("&");
        Map<String, String> lArgMap = new HashMap<String, String>();
        for (int i = 0; i < lArgs.length; i++) {
            String[] lArgValStrArr = lArgs[i].split("=");
            if (lArgValStrArr != null) {
                if (lArgValStrArr.length >= 2) {
                    lArgMap.put(lArgValStrArr[0], URLDecoder.decode(lArgValStrArr[1]));
                }
            }
        }

        //Find out the URI string from the parameters

        //Populate the list of formats for the video
        String lFmtList = URLDecoder.decode(lArgMap.get("fmt_list"));
        ArrayList<Format> lFormats = new ArrayList<Format>();
        if (null != lFmtList) {
            String lFormatStrs[] = lFmtList.split(",");

            for (String lFormatStr : lFormatStrs) {
                Format lFormat = new Format(lFormatStr);
                lFormats.add(lFormat);
            }
        }

        //Populate the list of streams for the video
        String lStreamList = lArgMap.get("url_encoded_fmt_stream_map");
        if (null != lStreamList) {
            String lStreamStrs[] = lStreamList.split(",");
            ArrayList<VideoStream> lStreams = new ArrayList<VideoStream>();
            for (String lStreamStr : lStreamStrs) {
                VideoStream lStream = new VideoStream(lStreamStr);
                lStreams.add(lStream);
            }

            //Search for the given format in the list of video formats
            // if it is there, select the corresponding stream
            // otherwise if fallback is requested, check for next lower format
            int lFormatId = Integer.parseInt(pYouTubeFmtQuality);

            Format lSearchFormat = new Format(lFormatId);
            while (!lFormats.contains(lSearchFormat) && pFallback) {
                int lOldId = lSearchFormat.getId();
                int lNewId = getSupportedFallbackId(lOldId);

                if (lOldId == lNewId) {
                    break;
                }
                lSearchFormat = new Format(lNewId);
            }

            int lIndex = lFormats.indexOf(lSearchFormat);
            if (lIndex >= 0) {
                VideoStream lSearchStream = lStreams.get(lIndex);
                lUriStr = lSearchStream.getUrl();
            }

        }
        //Return the URI string. It may be null if the format (or a fallback format if enabled)
        // is not found in the list of formats for the video
        return lUriStr;
    }

    public static boolean hasVideoBeenViewed(Context pCtxt, String pVideoId) {
        SharedPreferences lPrefs = PreferenceManager.getDefaultSharedPreferences(pCtxt);

        String lViewedVideoIds = lPrefs.getString("com.keyes.screebl.lastViewedVideoIds", null);

        if (lViewedVideoIds == null) {
            return false;
        }

        String[] lSplitIds = lViewedVideoIds.split(";");
        if (lSplitIds == null || lSplitIds.length == 0) {
            return false;
        }

        for (int i = 0; i < lSplitIds.length; i++) {
            if (lSplitIds[i] != null && lSplitIds[i].equals(pVideoId)) {
                return true;
            }
        }

        return false;

    }

    public static void markVideoAsViewed(Context pCtxt, String pVideoId) {

        SharedPreferences lPrefs = PreferenceManager.getDefaultSharedPreferences(pCtxt);

        if (pVideoId == null) {
            return;
        }

        String lViewedVideoIds = lPrefs.getString("com.keyes.screebl.lastViewedVideoIds", null);

        if (lViewedVideoIds == null) {
            lViewedVideoIds = "";
        }

        String[] lSplitIds = lViewedVideoIds.split(";");
        if (lSplitIds == null) {
            lSplitIds = new String[]{};
        }

        // make a hash table of the ids to deal with duplicates
        Map<String, String> lMap = new HashMap<String, String>();
        for (int i = 0; i < lSplitIds.length; i++) {
            lMap.put(lSplitIds[i], lSplitIds[i]);
        }

        // recreate the viewed list
        String lNewIdList = "";
        Set<String> lKeys = lMap.keySet();
        Iterator<String> lIter = lKeys.iterator();
        while (lIter.hasNext()) {
            String lId = lIter.next();
            if (!lId.trim().equals("")) {
                lNewIdList += lId + ";";
            }
        }

        // add the new video id
        lNewIdList += pVideoId + ";";

        Editor lPrefEdit = lPrefs.edit();
        lPrefEdit.putString("com.keyes.screebl.lastViewedVideoIds", lNewIdList);
        lPrefEdit.commit();

    }

    public static int getSupportedFallbackId(int pOldId) {
        final int lSupportedFormatIds[] = {13,  //3GPP (MPEG-4 encoded) Low quality
                17,  //3GPP (MPEG-4 encoded) Medium quality
                18,  //MP4  (H.264 encoded) Normal quality
                22,  //MP4  (H.264 encoded) High quality
                37   //MP4  (H.264 encoded) High quality
        };
        int lFallbackId = pOldId;
        for (int i = lSupportedFormatIds.length - 1; i >= 0; i--) {
            if (pOldId == lSupportedFormatIds[i] && i > 0) {
                lFallbackId = lSupportedFormatIds[i - 1];
            }
        }
        return lFallbackId;
    }
}


text:
// Package dummy is an example importer for development purposes.
package dummy

import (
	"fmt"
	"log"
	"time"

	"camlistore.org/pkg/importer"
	"camlistore.org/pkg/jsonconfig"
)

func init() {
	importer.Register("dummy", newFromConfig)
}

func newFromConfig(cfg jsonconfig.Obj) (importer.Importer, error) {
	im := &imp{
		url:       cfg.RequiredString("url"),
		username:  cfg.RequiredString("username"),
		authToken: cfg.RequiredString("authToken"),
	}
	if err := cfg.Validate(); err != nil {
		return nil, err
	}
	return im, nil
}

type imp struct {
	url       string
	username  string
	authToken string
}

func (im *imp) CanHandleURL(url string) bool { return false }
func (im *imp) ImportURL(url string) error   { panic("unused") }

func (im *imp) Prefix() string {
	return fmt.Sprintf("dummy:%s", im.username)
}

func (im *imp) Run(h *importer.Host, intr importer.Interrupt) error {
	log.Printf("running dummy importer")
	select {
	case <-time.After(5 * time.Second):
	case <-intr:
		log.Printf("dummy importer interrupted")
	}
	return nil
}


text:
<resources>
    <string name="app_name">ReactNativeStorageAndroid</string>
</resources>


text:
using System;
using System.Globalization;
using System.IO;
using System.IO.Compression;

namespace FileBackupUtility.FileController
{
    public abstract class FileItem
    {
        public int Size { get; protected set; }
        abstract public string Folder { get; }
        abstract public string Name { get; }
        abstract public string Extension { get; }
        abstract public DateTime? Created { get; }
        abstract public DateTime? Modified { get; }
        abstract public string ToBase64String();
        abstract public string ToMD5HashString();
    }

    public sealed class PhysicalFileItem : FileItem
    {
        private readonly FileInfo fileInfo;

        public override string Folder { get { return this.fileInfo.DirectoryName; } }
        public override string Name { get { return this.fileInfo.Name; } }
        public override string Extension { get { return this.fileInfo.Extension.Replace(".", string.Empty).ToUpper(CultureInfo.InvariantCulture); } }
        public override DateTime? Created { get { return this.fileInfo.CreationTime; } }
        public override DateTime? Modified { get { return this.fileInfo.LastWriteTime; } }

        public PhysicalFileItem(string filePath)
        {
            this.fileInfo = new FileInfo(filePath);
            this.Size = (int)this.fileInfo.Length;
        }

        public override string ToBase64String()
        {
            return Convert.ToBase64String(File.ReadAllBytes(this.fileInfo.FullName));
        }

        public override string ToMD5HashString()
        {
            using (var md5 = System.Security.Cryptography.MD5.Create())
            using (var fileStream = File.OpenRead(this.fileInfo.FullName))
                return BitConverter.ToString(md5.ComputeHash(fileStream)).Replace("-", string.Empty);
        }
    }

    public sealed class ArchiveFileItem : FileItem
    {
        private readonly ZipArchiveEntry fileZipEntry;
        private readonly string folder;

        public override string Folder { get { return this.folder; } }
        public override string Name { get { return this.fileZipEntry.Name; } }
        public override string Extension { get { return Path.GetExtension(this.fileZipEntry.Name).Replace(".", string.Empty).ToUpper(CultureInfo.InvariantCulture); } }
        public override DateTime? Created { get { return null; } }
        public override DateTime? Modified { get { return this.fileZipEntry.LastWriteTime.DateTime; } }

        public ArchiveFileItem(ZipArchiveEntry fileZipEntry, string zipPath)
        {
            this.fileZipEntry = fileZipEntry;
            this.Size = (int)this.fileZipEntry.Length;
            if (fileZipEntry.FullName != fileZipEntry.Name)
                this.folder = Path.Combine(zipPath, fileZipEntry.FullName.Replace("/", "\\").Substring(0, fileZipEntry.FullName.Length - fileZipEntry.Name.Length - 1));
            else
                this.folder = zipPath;
        }

       [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2202:Do not dispose objects multiple times")]
       public override string ToBase64String()
        {
            byte[] fileData;
            using (var zipStream = this.fileZipEntry.Open())
            using (var reader = new BinaryReader(zipStream))
                fileData = reader.ReadBytes(this.Size);

            return Convert.ToBase64String(fileData);
        }

        public override string ToMD5HashString()
        {
            using (var md5 = System.Security.Cryptography.MD5.Create())
            using (var zipStream = this.fileZipEntry.Open())
                return BitConverter.ToString(md5.ComputeHash(zipStream)).Replace("-", string.Empty);
        }
    }
}


text:
/*
FUNCTION
<<mbtowc>>---minimal multibyte to wide char converter

INDEX
	mbtowc

ANSI_SYNOPSIS
	#include <stdlib.h>
	int mbtowc(wchar_t *<[pwc]>, const char *<[s]>, size_t <[n]>);

TRAD_SYNOPSIS
	#include <stdlib.h>
	int mbtowc(<[pwc]>, <[s]>, <[n]>)
	wchar_t *<[pwc]>;
	const char *<[s]>;
	size_t <[n]>;

DESCRIPTION
When MB_CAPABLE is not defined, this is a minimal ANSI-conforming
implementation of <<mbtowc>>.  In this case,
only ``multi-byte character sequences'' recognized are single bytes,
and they are ``converted'' to themselves.
Each call to <<mbtowc>> copies one character from <<*<[s]>>> to
<<*<[pwc]>>>, unless <[s]> is a null pointer.  The argument n
is ignored.

When MB_CAPABLE is defined, this routine calls <<_mbtowc_r>> to perform
the conversion, passing a state variable to allow state dependent
decoding.  The result is based on the locale setting which may
be restricted to a defined set of locales.

RETURNS
This implementation of <<mbtowc>> returns <<0>> if
<[s]> is <<NULL>> or is the empty string;
it returns <<1>> if not MB_CAPABLE or
the character is a single-byte character; it returns <<-1>>
if n is <<0>> or the multi-byte character is invalid;
otherwise it returns the number of bytes in the multibyte character.
If the return value is -1, no changes are made to the <<pwc>>
output string.  If the input is the empty string, a wchar_t nul
is placed in the output string and 0 is returned.  If the input
has a length of 0, no changes are made to the <<pwc>> output string.

PORTABILITY
<<mbtowc>> is required in the ANSI C standard.  However, the precise
effects vary with the locale.

<<mbtowc>> requires no supporting OS subroutines.
*/

#ifndef _REENT_ONLY

#include <stdlib.h>

int
_DEFUN (mbtowc, (pwc, s, n),
        wchar_t *pwc _AND
        const char *s _AND
        size_t n)
{
#ifdef MB_CAPABLE
        static int state;

        return _mbtowc_r (_REENT, pwc, s, n, &state);
#else /* not MB_CAPABLE */
        if (s == NULL)
                return 0;
        if (n == 0)
                return -1;
        if (pwc)
                *pwc = (wchar_t) *s;
        return (*s != '\0');
#endif /* not MB_CAPABLE */
}

#endif /* !_REENT_ONLY */


text:
from django.db import models

from account.models import User

class Job(models.Model):
    """
    问卷 Model
    """
    name = models.SlugField(verbose_name="网址", max_length=40, unique=True)
    title = models.CharField(verbose_name="标题", max_length=128)
    questions = models.ManyToManyField(verbose_name="问题", to="Question", blank=True)
    time_start = models.DateTimeField(verbose_name="开始时间", blank=True, null=True)
    # 问卷开始时间  过期时间
    time_expired = models.DateTimeField(verbose_name="过期时间", blank=True, null=True)
    description = models.CharField(verbose_name="描述", max_length=512)
    time_added = models.DateTimeField(verbose_name="添加时间", auto_now_add=True, blank=True)
    is_active = models.BooleanField(verbose_name="启用", blank=True, default=True)
    # 有些问卷是需要用户登录才可以回答的
    is_authenticated = models.BooleanField(verbose_name="需要用户登录", blank=True, default=True)
    # 添加个帮助链接
    help_title = models.CharField(verbose_name="帮助标题", max_length=128, blank=True, null=True)
    help_url = models.URLField(verbose_name="帮助链接", blank=True, null=True)

    def __str__(self):
        return self.title

    class Meta:
        verbose_name = "问卷:Job"
        verbose_name_plural = verbose_name

class Question(models.Model):
    """
    问题 Model
    """
    CATEGORY_CHOICES = (
        ("text", "文本"),
        ("radio", "单选"),
        ("checkbox", "多选")
    )

    title = models.CharField(verbose_name="问题", max_length=128)
    description = models.CharField(verbose_name="描述", max_length=512, blank=True)
    category = models.CharField(verbose_name="类型", choices=CATEGORY_CHOICES, max_length=10,
                                default="text", blank=True)
    # 回答的唯一性,通过在提交的时候做检验
    is_unique = models.BooleanField(verbose_name="回答需要唯一", blank=True, default=False)
    # 每一份问卷的问题,需要个先后顺序,如果不加会按照ID排序
    order = models.IntegerField(verbose_name="排序", blank=True, default=1)

    def __str__(self):
        return self.title

    class Meta:
        verbose_name = "问题:Question"
        verbose_name_plural = verbose_name
        ordering = ("order", "id")

class Choice(models.Model):
    """
    答案选项Choice
    """
    question = models.ForeignKey(to="question", verbose_name="问题", related_name="choices", on_delete=models.CASCADE)
    option = models.CharField(verbose_name="选项", max_length=1)
    value = models.CharField(verbose_name="选项值", max_length=128)
    order = models.IntegerField(verbose_name="排序", blank=True, default=1)

    def __str__(self):
        return "{}:{}".format(self.question, self.value)

    class Meta:
        verbose_name = "问题答案选项:Question Choices"
        verbose_name_plural = verbose_name
        ordering = ("order", "id")

class Answer(models.Model):
    """
    回答Model
    """
    question = models.ForeignKey(to="question", verbose_name="问题", on_delete=models.CASCADE)
    option = models.CharField(verbose_name="回答选项", blank=True, max_length=1, null=True)
    answer = models.CharField(verbose_name="回答", max_length=128)

    def __str__(self):
        return "问题:(ID:{}):Answer:{}".format(self.question_id, self.answer)

    class Meta:
        verbose_name = "问题回答:Report Question Answer"
        verbose_name_plural = verbose_name

class Report(models.Model):
    """
    问卷回答 Model
    """
    job = models.ForeignKey(to="job", verbose_name="问卷", on_delete=models.CASCADE)
    user = models.ForeignKey(to=User, verbose_name="用户", blank=True, null=True, on_delete=models.SET_NULL)
    ip = models.GenericIPAddressField(verbose_name="回答者IP", blank=True, null=True)
    time_added = models.DateTimeField(verbose_name="添加时间", blank=True, auto_now_add=True)
    answers = models.ManyToManyField(verbose_name="问卷回答", to="answer", blank=True)
    # 是否删除
    is_deleted = models.BooleanField(verbose_name="删除", blank=True, default=False)

    def __str__(self):
        return "Report:{}".format(self.pk)

    def __delete__(self, instance):
        if not self.is_deleted:
            self.is_deleted = True
            self.save()
        else:
            return True

    class Meta:
        verbose_name = "问卷回答:Report"
        verbose_name_plural = verbose_name


text:
<?xml version="1.0" encoding="UTF-8"?>
<resourceInfo xmlns="http://www.ilsp.gr/META-XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.ilsp.gr/META-XMLSchema http://metashare.ilsp.gr/META-XMLSchema/v3.0/META-SHARE-Resource.xsd">
   <identificationInfo>
      <resourceName>Corpus92 Corpus</resourceName>
      <description>The corpus consists of a number of texts corresponding to Access to University examinations held on June 1992 in several Spanish universities. It contains about 350,000 words in 3 documents.</description>
      <resourceShortName>Corpus92</resourceShortName>
      <url>http://www.uila.upf.edu</url>
      <metaShareId>
				NOT_DEFINED_FOR_V2
	  		</metaShareId>
      <identifier>identifier</identifier>
   </identificationInfo>
   <distributionInfo>
      <availability>available-unrestrictedUse</availability>
      <licenceInfo>
         <licence>AGPL</licence>
         <restrictionsOfUse>academic-nonCommercialUse</restrictionsOfUse>
         <distributionAccessMedium>downloadable</distributionAccessMedium>
         <distributionRightsHolder>
              <organizationInfo>
                <organizationName>Institut Universitari Lingüística Aplicada - UPF</organizationName>
                <organizationShortName>IULA - UPF</organizationShortName>
                <departmentName>Institut Universitari Lingüística Aplicada (UPF)</departmentName>
                  <communicationInfo>
                  <email>sergi.torner@upf.edu</email>
                  <url>http://www.iula.upf.edu/</url>
                  <address>Roc Boronat, 138</address>
                  <zipCode>08018</zipCode>
                  <city>Barcelona</city>
                  <country>Spain</country>
                  <telephoneNumber>+34 93 5422369</telephoneNumber>
                  <faxNumber>+34 93 5422321</faxNumber>
               </communicationInfo>
              </organizationInfo>
          </distributionRightsHolder>
      </licenceInfo>
      <iprHolder>
          <organizationInfo>
            <organizationName>Institut Universitari Lingüística Aplicada - UPF</organizationName>
            <organizationShortName>IULA - UPF</organizationShortName>
            <departmentName>Institut Universitari Lingüística Aplicada (UPF)</departmentName>
              <communicationInfo>
               <email>jorge.vivaldi@upf.edu</email>
               <url>http://www.iula.upf.edu/</url>
               <address>Roc Boronat, 138</address>
               <zipCode>08018</zipCode>
               <city>Barcelona</city>
               <country>Spain</country>
               <telephoneNumber>+34 93 5421207</telephoneNumber>
               <faxNumber>+34 93 5422321</faxNumber>
            </communicationInfo>
          </organizationInfo>
      </iprHolder>
   </distributionInfo>
   <contactPerson>
      <surname>Torner</surname>
      <givenName>Sergi</givenName>
      <communicationInfo>
         <email>sergi.torner@upf.edu</email>
         <address>Roc Boronat, 138</address>
         <zipCode>08018</zipCode>
         <city>Barcelona</city>
         <country>Spain</country>
      </communicationInfo>
      <affiliation>
         <organizationName>Institut Universitari Lingüística Aplicada (Universitat Pompeu Fabra)</organizationName>
         <organizationShortName>IULA UPF</organizationShortName>
         <departmentName>Institut Universitari Lingüística Aplicada</departmentName>
         <communicationInfo>
            <email>jorge.vivaldi@upf.edu</email>
            <url>http://www.iula.upf.edu/</url>
            <address>Roc Boronat, 138</address>
            <zipCode>08018</zipCode>
            <city>Barcelona</city>
            <country>Spain</country>
            <telephoneNumber>+34 93 5422332</telephoneNumber>
            <faxNumber>+34 93 5422321</faxNumber>
         </communicationInfo>

      </affiliation>
   </contactPerson>
   <metadataInfo>
      <metadataCreationDate>2011-10-10</metadataCreationDate>
      <metadataCreator>
         <surname>Vivaldi</surname>
         <givenName>Jorge</givenName>
         <communicationInfo>
            <email>jorge.vivaldi@upf.edu</email>
            <url>http://www.iula.upf.edu/</url>
            <address>Roc Boronat, 138</address>
            <zipCode>08018</zipCode>
            <city>Barcelona</city>
            <country>Spain</country>
            <telephoneNumber>+34 93 5422332</telephoneNumber>
            <faxNumber>+34 93 5422321</faxNumber>
         </communicationInfo>
         <affiliation>
            <organizationName>Institut Universitari Lingüística Aplicada (Universitat Pompeu Fabra)</organizationName>
            <organizationShortName>IULA UPF</organizationShortName>
            <departmentName>Institut Universitari Lingüística Aplicada</departmentName>
            <communicationInfo>
               <email>jorge.vivaldi@upf.edu</email>
               <url>http://www.iula.upf.edu/</url>
               <address>Roc Boronat, 138</address>
               <zipCode>08018</zipCode>
               <city>Barcelona</city>
               <country>Spain</country>
               <telephoneNumber>+34 93 5421207</telephoneNumber>
               <faxNumber>+34 93 5422321</faxNumber>
            </communicationInfo>

          </affiliation>
      </metadataCreator>
      <source>METASHARE</source>
      <originalMetadataSchema>v1.1</originalMetadataSchema>
      <metadataLanguageId>en-US</metadataLanguageId>
      <metadataLastDateUpdated>2011-10-30</metadataLastDateUpdated>
   </metadataInfo>
   <versionInfo>
      <version>version1</version>
      <lastDateUpdated>2011-10-30</lastDateUpdated>

  </versionInfo>
   <validationInfo>
      <validated>true</validated>
      <validationType>formal</validationType>
      <validationMode>automatic</validationMode>
      <validationModeDetails>The documents validates against the GrAF DTD v.1.0.4</validationModeDetails>
   </validationInfo>
   <resourceDocumentationInfo>
      <documentation>
         <documentUnstructured>Vivaldi Palatresi, Jorge (2009). "Corpus and exploitation tool: IULACT and</documentUnstructured>
      </documentation>
      <documentation>
         <documentUnstructured>            bwanaNet" in Cantos Gómez, Pascual; Sánchez Pérez, Aquilino (ed.) A survey on</documentUnstructured>
      </documentation>
      <documentation>
         <documentUnstructured>            corpus-based research = Panorama de investigaciones basadas en corpus [Proceedings of</documentUnstructured>
      </documentation>
      <documentation>
         <documentUnstructured>            the I Congreso Internacional de Lingüística de Corpus (CICL-09), 7-9 May 2009]. Murcia:</documentUnstructured>
      </documentation>
      <documentation>
         <documentUnstructured>            Asociación Española de Lingüística del Corpus. Pp. 224-239.</documentUnstructured>
      </documentation>
      <documentation>
         <documentUnstructured>Cabré, M. T.; Bach, C.; Vivaldi, J. (2006). 10 anys del Corpus de l'IULA.</documentUnstructured>
      </documentation>
      <documentation>
         <documentUnstructured>            Barcelona: Institut Universitari de Lingüística Aplicada. Universitat Pompeu</documentUnstructured>
      </documentation>
      <documentation>
         <documentUnstructured>            Fabra</documentUnstructured>
      </documentation>
      <documentation>
         <documentUnstructured>Cabré, M. Teresa; Bach, Carme (2004). "El corpus tècnic del IULA: corpus</documentUnstructured>
      </documentation>
      <documentation>
         <documentUnstructured>            textual especializado plurilingüe" in Panace@ - Boletín de Medicina y Traducción 5(16).</documentUnstructured>
      </documentation>
      <documentation>
         <documentUnstructured>            [s.l]: MedTrad. Pp. 173-176.</documentUnstructured>
      </documentation>
      <documentation>
         <documentUnstructured>Morel, J.; Torner, S.; Vivaldi, J., de Yzaguirre, L.; Cabré, M.T. (1998). "El</documentUnstructured>
      </documentation>
      <documentation>
         <documentUnstructured>            corpus de l'IULA: etiquetaris". Papers de l'IULA, Sèrie Informes n. 18. Barcelona:</documentUnstructured>
      </documentation>
      <documentation>
         <documentUnstructured>            Institut Universitari de Lingüística Aplicada. Universitat Pompeu Fabra.</documentUnstructured>
      </documentation>
   </resourceDocumentationInfo>
   <resourceCreationInfo>
      <resourceCreator>
          <organizationInfo>
            <organizationName>Institut Universitari Lingüística Aplicada - UPF</organizationName>
            <organizationShortName>IULA - UPF</organizationShortName>
            <departmentName>Institut Universitari Lingüística Aplicada (UPF)</departmentName>
              <communicationInfo>
               <email>jorge.vivaldi@upf.edu</email>
               <url>http://www.iula.upf.edu/</url>
               <address>Roc Boronat, 138</address>
               <zipCode>08018</zipCode>
               <city>Barcelona</city>
               <country>Spain</country>
               <telephoneNumber>+34 93 5421207</telephoneNumber>
               <faxNumber>+34 93 5422321</faxNumber>
            </communicationInfo>
          </organizationInfo>
      </resourceCreator>
      <fundingProject>
         <projectName>METANET4U</projectName>
         <projectShortName>METANET4U</projectShortName>
         <url>http://metanet4u.eu/</url>
         <fundingType>ownFunds</fundingType>
         <fundingType>euFunds</fundingType>
         <funder>UPF</funder>
         <funder>EU</funder>
         <fundingCountry>Spain</fundingCountry>
      </fundingProject>
      <creationStartDate>2011-10-10</creationStartDate>
      <creationEndDate>2011-10-30</creationEndDate>
   </resourceCreationInfo>
   <resourceComponentType>
      <corpusInfo>
         <resourceType>corpus</resourceType>
         <corpusMediaType>
            <corpusTextInfo>
               <mediaType>text</mediaType>
               <lingualityInfo>
                  <lingualityType>monolingual</lingualityType>
               </lingualityInfo>
               <languageInfo>
                  <languageId>N/A</languageId>
                  <languageName>Spanish</languageName>
                  <sizePerLanguage>
                     <size>350000</size>

                     <sizeUnit>tokens</sizeUnit>
                  </sizePerLanguage>
               </languageInfo>
               <sizeInfo>
                  <size>350000</size>

                  <sizeUnit>tokens</sizeUnit>
               </sizeInfo>
               <textFormatInfo>
                  <mimeType>text/xml</mimeType>
               </textFormatInfo>
               <characterEncodingInfo>
                  <characterEncoding>UTF-8</characterEncoding>
               </characterEncodingInfo>
               <annotationInfo>
                  <annotationType>morphosyntacticAnnotation-posTagging</annotationType>
                  <annotationStandoff>true</annotationStandoff>
                  <segmentationLevel>word</segmentationLevel>
                  <annotationFormat>text/xml</annotationFormat>
                  <tagset>MULTEX/PAROLE</tagset>
                  <conformanceToStandardsBestPractices>other</conformanceToStandardsBestPractices>
                  <annotationMode>automatic</annotationMode>
                  <annotationTool>
                     <targetResourceNameURI>TreeTagger</targetResourceNameURI>
                  </annotationTool>
                  <annotationStartDate>2011-11-30</annotationStartDate>
                  <annotationEndDate>2011-11-30</annotationEndDate>
               </annotationInfo>
               <domainInfo>
                  <domain>education</domain>
               </domainInfo>
               <textClassificationInfo>
                  <textType>examinations</textType>
                  <register>formal</register>
               </textClassificationInfo>
               <creationInfo>
                  <originalSource>
                     <targetResourceNameURI>IULACT CORPUS92</targetResourceNameURI>
                  </originalSource>
                  <creationMode>automatic</creationMode>
               </creationInfo>
            </corpusTextInfo>
         </corpusMediaType>
      </corpusInfo>
   </resourceComponentType>
</resourceInfo>


text:
'use strict';

// modules
var browserify = require('browserify');
var browserSync = require('browser-sync');
var collate = require('./tasks/collate');
var compile = require('./tasks/compile');
var concat = require('gulp-concat');
var csso = require('gulp-csso');
var del = require('del');
var gulp = require('gulp');
var gutil = require('gulp-util');
var gulpif = require('gulp-if');
var imagemin = require('gulp-imagemin');
var prefix = require('gulp-autoprefixer');
var Q = require('q');
var rename = require('gulp-rename');
var reload = browserSync.reload;
var runSequence = require('run-sequence');
var sass = require('gulp-sass');
var source = require('vinyl-source-stream');
var streamify = require('gulp-streamify');
var uglify = require('gulp-uglify');

// configuration
var config = {
	dev: gutil.env.dev,
	src: {
		scripts: {
			fabricator: [
				'./src/fabricator/scripts/prism.js',
				'./src/fabricator/scripts/fabricator.js'
			],
			toolkit: './src/toolkit/assets/scripts/toolkit.js'
		},
		styles: {
			fabricator: './src/fabricator/styles/fabricator.scss',
			toolkit: './src/toolkit/assets/styles/toolkit.scss'
		},
		images: 'src/toolkit/assets/images/**/*',
		views: './src/toolkit/views/*.html',
		materials: [
			'components',
			'structures',
			'templates',
			'documentation'
		]
	},
	dest: './dist'
};

// clean
gulp.task('clean', function (cb) {
	del([config.dest], cb);
});

// styles
gulp.task('styles:fabricator', function () {
	return gulp.src(config.src.styles.fabricator)
		.pipe(sass({
			errLogToConsole: true
		}))
		.pipe(prefix('last 1 version'))
		.pipe(gulpif(!config.dev, csso()))
		.pipe(rename('f.css'))
		.pipe(gulp.dest(config.dest + '/fabricator/styles'))
		.pipe(gulpif(config.dev, reload({stream:true})));
});

gulp.task('styles:toolkit', function () {
	return gulp.src(config.src.styles.toolkit)
		.pipe(sass({
			errLogToConsole: false,
			onError: function(err) {
		        gutil.log('[gulp-sass] ' + err.message + ' on line ' + err.line + ' in ' + err.file);
		    }
		}))
		.pipe(prefix('last 1 version'))
		.pipe(gulpif(!config.dev, csso()))
		.pipe(gulp.dest(config.dest + '/toolkit/styles'))
		.pipe(gulpif(config.dev, reload({stream:true})));
});

gulp.task('styles', ['styles:fabricator', 'styles:toolkit']);

// scripts
gulp.task('scripts:fabricator', function () {
	return gulp.src(config.src.scripts.fabricator)
		.pipe(concat('f.js'))
		.pipe(gulpif(!config.dev, uglify()))
		.pipe(gulp.dest(config.dest + '/fabricator/scripts'));
});

gulp.task('scripts:toolkit', function () {
	return browserify(config.src.scripts.toolkit)
		.bundle()
		.on('error', function (error) {
			gutil.log(gutil.colors.red(error));
			this.emit('end');
		})
		.pipe(source('toolkit.js'))
		.pipe(gulpif(!config.dev, streamify(uglify())))
		.pipe(gulp.dest(config.dest + '/toolkit/scripts'));
});

gulp.task('scripts', ['scripts:fabricator', 'scripts:toolkit']);

// images
gulp.task('images', ['favicon'], function () {
	return gulp.src(config.src.images)
		.pipe(imagemin())
		.pipe(gulp.dest(config.dest + '/toolkit/images'));
});

gulp.task('favicon', function () {
	return gulp.src('./src/favicon.ico')
		.pipe(gulp.dest(config.dest));
});

// collate
gulp.task('collate', function () {

	// 'collate' is a little different -
	// it returns a promise instead of a stream

	var deferred = Q.defer();

	var opts = {
		materials: config.src.materials,
		dest: config.dest + '/fabricator/data/data.json'
	};

	// run the collate task; resolve deferred when complete
	collate(opts, deferred.resolve);

	return deferred.promise;

});

// assembly
gulp.task('assemble:fabricator', function () {
	var opts = {
		data: config.dest + '/fabricator/data/data.json',
		template: false
	};

	return gulp.src(config.src.views)
		.pipe(compile(opts))
		.pipe(gulp.dest(config.dest));
});

gulp.task('assemble:templates', function () {
	var opts = {
		data: config.dest + '/fabricator/data/data.json',
		template: true
	};
	return gulp.src('./src/toolkit/templates/*.html')
		.pipe(compile(opts))
		.pipe(rename({
			prefix: 'template-'
		}))
		.pipe(gulp.dest(config.dest));
});

gulp.task('assemble', ['collate'], function () {
	gulp.start('assemble:fabricator', 'assemble:templates');
});

// server
gulp.task('browser-sync', function () {
	browserSync({
		server: {
			baseDir: config.dest
		},
		notify: false,
		logPrefix: 'FABRICATOR'
	});
});

// watch
gulp.task('watch', ['browser-sync'], function () {
	gulp.watch('src/toolkit/{components,structures,templates,documentation,views}/**/*.{html,md}', ['assemble', browserSync.reload]);
	gulp.watch('src/fabricator/styles/**/*.scss', ['styles:fabricator']);
	gulp.watch('src/toolkit/assets/styles/**/*.scss', ['styles:toolkit']);
	gulp.watch('src/fabricator/scripts/**/*.js', ['scripts:fabricator', browserSync.reload]);
	gulp.watch('src/toolkit/assets/scripts/**/*.js', ['scripts:toolkit', browserSync.reload]);
	gulp.watch(config.src.images, ['images', browserSync.reload]);
});

// default build task
gulp.task('default', ['clean'], function () {

	// define build tasks
	var tasks = [
		'styles',
		'scripts',
		'images',
		'assemble'
	];

	// run build
	runSequence(tasks, function () {
		if (config.dev) {
			gulp.start('watch');
		}
	});

});


text:
package lb

type Lbmonbindingsservicegroupbinding struct {
	Boundservicegroupsvrstate string `json:"boundservicegroupsvrstate,omitempty"`
	Monitorname               string `json:"monitorname,omitempty"`
	Monstate                  string `json:"monstate,omitempty"`
	Servicegroupname          string `json:"servicegroupname,omitempty"`
	Servicetype               string `json:"servicetype,omitempty"`
}


text:
NSString *const LFEraserBrushImageColor = @"LFEraserBrushImageColor";

NSString *const LFEraserBrushImageLayers = @"LFEraserBrushImageLayers";

@interface LFEraserBrush ()

@end

@implementation LFEraserBrush

@synthesize lineColor = _lineColor;

- (instancetype)init
{
    self = [super init];
    if (self) {
        self->_lineColor = nil;
        self.lineWidth += 4;
    }
    return self;
}

- (void)setLineColor:(UIColor *)lineColor
{
    NSAssert(NO, @"LFEraserBrush cann't set line color.");
}

- (UIColor *)lineColor
{
    UIColor *color = [[LFBrushCache share] objectForKey:LFEraserBrushImageColor];

    NSAssert(color!=nil, @"call LFEraserBrush loadBrushImage:radius:canvasSize:useCache:complete: method.");

    return color;
}

- (CALayer *)createDrawLayerWithPoint:(CGPoint)point
{
    CALayer *layer = [super createDrawLayerWithPoint:point];
    if (layer) {

        NSHashTable *layers = [[LFBrushCache share] objectForKey:LFEraserBrushImageLayers];
        [layers addObject:layer];
    }
    return layer;
}

+ (CALayer *__nullable)drawLayerWithTrackDict:(NSDictionary *)trackDict
{
    UIColor *lineColor = trackDict[LFPaintBrushLineColor];
    if (lineColor) {
        [[LFBrushCache share] setForceObject:lineColor forKey:LFEraserBrushImageColor];
    }
    CALayer *layer = [super drawLayerWithTrackDict:trackDict];
    if (layer) {
        NSHashTable *layers = [[LFBrushCache share] objectForKey:LFEraserBrushImageLayers];
        [layers addObject:layer];
    }
    return layer;
}

+ (void)loadEraserImage:(UIImage *)image canvasSize:(CGSize)canvasSize useCache:(BOOL)useCache complete:(void (^ _Nullable )(BOOL success))complete
{

    NSHashTable *layers = [[LFBrushCache share] objectForKey:LFEraserBrushImageLayers];
    if (layers == nil) {
        layers = [NSHashTable hashTableWithOptions:NSPointerFunctionsWeakMemory];
        [[LFBrushCache share] setForceObject:layers forKey:LFEraserBrushImageLayers];
    }

    if (!useCache) {
        [[LFBrushCache share] removeObjectForKey:LFEraserBrushImageColor];
    }
    UIColor *color = [[LFBrushCache share] objectForKey:LFEraserBrushImageColor];
    if (color) {
        if (complete) {
            complete(YES);
        }
        return;
    }
    if (image) {
        //                NSTimeInterval time = [[NSDate date] timeIntervalSince1970];
        dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0), ^{

            UIColor *patternColor = [image LFBB_patternGaussianColorWithSize:canvasSize filterHandler:nil];
            dispatch_async(dispatch_get_main_queue(), ^{
                //                        NSLog(@"used time : %fs", ([[NSDate date] timeIntervalSince1970] - time));
                if (patternColor) {
                    [[LFBrushCache share] setForceObject:patternColor forKey:LFEraserBrushImageColor];
                }
                for (CAShapeLayer *layer in layers) {
                    layer.strokeColor = patternColor.CGColor;
                }

                if (complete) {
                    complete((BOOL)patternColor);
                }
            });
        });
    } else {
        if (complete) {
            complete(NO);
        }
    }
}

+ (BOOL)eraserBrushCache
{
    UIColor *color = [[LFBrushCache share] objectForKey:LFEraserBrushImageColor];
    return (BOOL)color;
}

@end


text:
layout: page-fullwidth
title: Use OpenShift to deploy Fuse
subheadline: "fuse"
teaser: "Let's use OpenShift source 2 image builders to deploy our Fuse application"
breadcrumb: true
image:
    homepage: openshift_story.jpg
categories:
    - fuse
---

From the command line, let's create our project using s2i (source 2 image) builders. Recall from the previous labs,
s2i allows us to build our projects directly from source without have to know how to build the docker images and
start/stop containers, etc.

    oc new-app --strategy=source fabric8/s2i-karaf:1.1.5~https://github.com/<YOUR-REPO>/camel-hello-world

Now, we can create a new app with the command-line, or the web console. For this lab, let's use the webconsole.

Navigate to the console, and login (the URL will be provided for the in-person workshop, otherwise if you have it running locally on your laptop it will be `https://vagrant.f8:8443` if you've set up the [fabric8.io](http://fabric8.io) vagrant image.

Off to the left, find the "Browse" icon and click it. You should see a list of services running including the new build that's running inside of a Kubernetes pod.

![insta-app]({{ site.url }}/images/fuse/buildrunning.png)

To see the current status of the build, and view it's logs to verify it's coming along, let's go back to the command line and type the following:

    [vagrant@vagrant ~]$ oc get build
    NAME                   TYPE      STATUS     POD
    camel-hello-world-1    Source    Running    camel-hello-world-1-build

We should see that the build is currently running. What is it doing? Let's peak inside:

    [vagrant@vagrant ~]$ oc build-logs camel-hello-world-1

You should see the maven build proceeding and ultimately pushing a docker image to the internal docker registry. You should see something like this when the build is completed:

    I0915 14:26:35.280102       1 sti.go:153] Successfully pushed 172.30.20.184:5000/default/camel-hello-world:latest

Now, let's verify that our camel-hello-world pod is correctly running:

    [vagrant@vagrant ~]$ oc get pod
    NAME                                 READY     STATUS       RESTARTS   AGE
    camel-hello-world-1-build            0/1       ExitCode:0   0          8m
    camel-hello-world-1-doxgd            1/1       Running      0          26s

The build completed and has exited and now there is a running instance of the pod named `camel-hello-world-1-doxgd` is running. You can try some of the previous steps like killing the pod `oc delete pod camel-hello-world-1-doxgd` and watch the Replication Controller bring back the pod. Let's take a look at what that pod is doing:

    oc logs camel-hello-world-1-doxgd

    2015-09-15 14:28:11,756 | INFO  | #0 - timer://foo | log-route                        | 21 - org.apache.camel.camel-core - 2.15.2 | >>> Hello from Fabric based Camel route! :
    2015-09-15 14:28:16,756 | INFO  | #0 - timer://foo | log-route                        | 21 - org.apache.camel.camel-core - 2.15.2 | >>> Hello from Fabric based Camel route! :
    2015-09-15 14:28:21,767 | INFO  | #0 - timer://foo | log-route                        | 21 - org.apache.camel.camel-core - 2.15.2 | >>> Hello from Fabric based Camel route! :
    2015-09-15 14:28:26,761 | INFO  | #0 - timer://foo | log-route                        | 21 - org.apache.camel.camel-core - 2.15.2 | >>> Hello from Fabric based Camel route! :
    2015-09-15 14:28:31,761 | INFO  | #0 - timer://foo | log-route                        | 21 - org.apache.camel.camel-core - 2.15.2 | >>> Hello from Fabric based Camel route! :
    2015-09-15 14:28:36,762 | INFO  | #0 - timer://foo | log-route                        | 21 - org.apache.camel.camel-core - 2.15.2 | >>> Hello from Fabric based Camel route! :
    2015-09-15 14:28:41,762 | INFO  | #0 - timer://foo | log-route                        | 21 - org.apache.camel.camel-core - 2.15.2 | >>> Hello from Fabric based Camel route! :
    2015-09-15 14:28:46,762 | INFO  | #0 - timer://foo | log-route                        | 21 - org.apache.camel.camel-core - 2.15.2 | >>> Hello from Fabric based Camel route! :
    2015-09-15 14:28:51,762 | INFO  | #0 - timer://foo | log-route                        | 21 - org.apache.camel.camel-core - 2.15.2 | >>> Hello from Fabric based Camel route! :

Yay! the camel route is deployed and logging correctly!

This lab illustrated a few points:

* How to deploy using an OpenShift template / instant app builder
* How to deploy with the webconsole
* How to navigate the currently running builds and pods with the command line


text:
const VertexTypeDescription VertexTypes::VertexPositionColor::Description = {
	VertexAttribute{ "Position", 3U, ElementTypeEnum::Float },
	VertexAttribute{ "Color", 4U, ElementTypeEnum::Float }
};

const VertexTypeDescription VertexTypes::VertexBasic::Description = {
	VertexAttribute{ "Position", 3U, ElementTypeEnum::Float },
};

const VertexTypeDescription VertexTypes::VertexPostionTexture::Description = {
	VertexAttribute{ "Position", 3U, ElementTypeEnum::Float },
	VertexAttribute{ "TextureCoordinate", 2U, ElementTypeEnum::Float }
};

const VertexTypeDescription VertexTypes::VertexPostionNormal::Description = {
	VertexAttribute{ "Position", 3U, ElementTypeEnum::Float },
	VertexAttribute{ "Normal", 3U, ElementTypeEnum::Float },
};

const VertexTypeDescription VertexTypes::VertexPostionNormalTexture::Description = {
	VertexAttribute{ "Position", 3U, ElementTypeEnum::Float },
	VertexAttribute{ "Normal", 3U, ElementTypeEnum::Float },
	VertexAttribute{ "TextureCoordinate", 2U, ElementTypeEnum::Float }
};

const VertexTypeDescription VertexTypes::VertexPositionNormalColor::Description = {
	VertexAttribute{ "Position", 3U, ElementTypeEnum::Float },
	VertexAttribute{ "Normal", 3U, ElementTypeEnum::Float },
	VertexAttribute{ "Color", 4U, ElementTypeEnum::Float }
};


text:
// To run the e2e tests against one or more hosts on gce: $ go run run_e2e.go --hosts <comma separated hosts>
// Requires gcloud compute ssh access to the hosts
package main

import (
	"bufio"
	"flag"
	"fmt"
	"os"
	"os/exec"
	"strings"
	"sync"
	"time"

	"runtime"

	"github.com/golang/glog"
	"k8s.io/kubernetes/test/e2e_node/gcloud"
	"path/filepath"
)

type RunFunc func(host string, port string) ([]byte, error)

type Result struct {
	host   string
	output []byte
	err    error
}

const gray = "\033[1;30m"
const blue = "\033[0;34m"
const noColour = "\033[0m"

var u = sync.WaitGroup{}
var zone = flag.String("zone", "", "gce zone the hosts live in")
var hosts = flag.String("hosts", "", "hosts to test")
var wait = flag.Bool("wait", false, "if true, wait for input before running tests")
var kubeOutputRelPath = flag.String("k8s-build-output", "_output/local/bin/linux/amd64", "Where k8s binary files are written")

var kubeRoot = ""

const buildScriptRelPath = "hack/build-go.sh"
const ginkgoTestRelPath = "test/e2e_node"
const healthyTimeoutDuration = time.Minute * 3

func main() {
	flag.Parse()
	if *hosts == "" {
		glog.Fatalf("Must specific --hosts flag")
	}

	// Figure out the kube root
	_, path, _, _ := runtime.Caller(0)
	kubeRoot, _ = filepath.Split(path)
	kubeRoot = strings.Split(kubeRoot, "/test/e2e_node")[0]

	// Build the go code
	out, err := exec.Command(filepath.Join(kubeRoot, buildScriptRelPath)).CombinedOutput()
	if err != nil {
		glog.Fatalf("Failed to build go packages %s: %v", out, err)
	}

	// Copy kubelet to each host and run test
	if *wait {
		u.Add(1)
	}

	results := make(chan *TestResult)
	hs := strings.Split(*hosts, ",")
	for _, h := range hs {
		go func(host string) { results <- runTests(host) }(h)
	}

	// Maybe wait for user input before running tests
	if *wait {
		WaitForUser()
	}

	// Wait for all tests to complete and emit the results
	errCount := 0
	for i := 0; i < len(hs); i++ {
		tr := <-results
		host := tr.fullhost
		if tr.err != nil {
			errCount++
			glog.Infof("%s================================================================%s", blue, noColour)
			glog.Infof("Failure Finished Host %s Test Suite %s %v", host, tr.testCombinedOutput, tr.err)
			glog.V(2).Infof("----------------------------------------------------------------")
			glog.V(5).Infof("Host %s Etcd Logs\n%s%s%s", host, gray, tr.etcdCombinedOutput, noColour)
			glog.V(5).Infof("----------------------------------------------------------------")
			glog.V(5).Infof("Host %s Apiserver Logs\n%s%s%s", host, gray, tr.apiServerCombinedOutput, noColour)
			glog.V(5).Infof("----------------------------------------------------------------")
			glog.V(2).Infof("Host %s Kubelet Logs\n%s%s%s", host, gray, tr.kubeletCombinedOutput, noColour)
			glog.Infof("%s================================================================%s", blue, noColour)
		} else {
			glog.Infof("================================================================")
			glog.Infof("Success Finished Host %s Test Suite %s", host, tr.testCombinedOutput)
			glog.Infof("================================================================")
		}
	}

	// Set the exit code if there were failures
	if errCount > 0 {
		glog.Errorf("Failure: %d errors encountered.", errCount)
		os.Exit(1)
	}
}

func WaitForUser() {
	scanner := bufio.NewScanner(os.Stdin)
	fmt.Printf("Enter \"y\" to run tests\n")
	for scanner.Scan() {
		if strings.ToUpper(scanner.Text()) != "Y\n" {
			break
		}
		fmt.Printf("Enter \"y\" to run tests\n")
	}
	u.Done()
}

type TestResult struct {
	fullhost                string
	err                     error
	testCombinedOutput      string
	etcdCombinedOutput      string
	apiServerCombinedOutput string
	kubeletCombinedOutput   string
}

func runTests(fullhost string) *TestResult {
	result := &TestResult{fullhost: fullhost}

	host := strings.Split(fullhost, ".")[0]
	c := gcloud.NewGCloudClient(host, *zone)
	// TODO(pwittrock): Come up with something better for bootstrapping the environment.
	eh, err := c.RunAndWaitTillHealthy(
		false, false, "4001", healthyTimeoutDuration, "v2/keys/", "etcd", "--data-dir", "./", "--name", "e2e-node")
	defer func() {
		eh.TearDown()
		result.etcdCombinedOutput = fmt.Sprintf("%s", eh.CombinedOutput.Bytes())
	}()
	if err != nil {
		result.err = fmt.Errorf("Host %s failed to run command %v", host, err)
		return result
	}

	apiBin := filepath.Join(kubeRoot, *kubeOutputRelPath, "kube-apiserver")
	ah, err := c.RunAndWaitTillHealthy(
		true, true, "8080", healthyTimeoutDuration, "healthz", apiBin, "--service-cluster-ip-range",
		"10.0.0.1/24", "--insecure-bind-address", "0.0.0.0", "--etcd-servers", "http://127.0.0.1:4001",
		"--v", "2", "--alsologtostderr", "--kubelet-port", "10250")
	defer func() {
		ah.TearDown()
		result.apiServerCombinedOutput = fmt.Sprintf("%s", ah.CombinedOutput.Bytes())
	}()
	if err != nil {
		result.err = fmt.Errorf("Host %s failed to run command %v", host, err)
		return result
	}

	kubeletBin := filepath.Join(kubeRoot, *kubeOutputRelPath, "kubelet")
	// TODO: Used --v 4 or higher and upload to gcs instead of printing to the console
	// TODO: Copy /var/log/messages and upload to GCS for failed tests
	kh, err := c.RunAndWaitTillHealthy(
		true, true, "10255", healthyTimeoutDuration, "healthz", kubeletBin, "--api-servers", "http://127.0.0.1:8080",
		"--v", "2", "--alsologtostderr", "--address", "0.0.0.0", "--port", "10250")
	defer func() {
		kh.TearDown()
		result.kubeletCombinedOutput = fmt.Sprintf("%s", kh.CombinedOutput.Bytes())
	}()
	if err != nil {
		result.err = fmt.Errorf("Host %s failed to run command %v", host, err)
	}

	// Run the tests
	glog.Infof("Kubelet healthy on host %s", host)
	glog.Infof("Kubelet host %s tunnel running on port %s", host, ah.LPort)
	u.Wait()
	glog.Infof("Running ginkgo tests against host %s", host)
	ginkgoTests := filepath.Join(kubeRoot, ginkgoTestRelPath)
	out, err := exec.Command(
		"ginkgo", ginkgoTests, "--",
		"--kubelet-address", fmt.Sprintf("http://127.0.0.1:%s", kh.LPort),
		"--api-server-address", fmt.Sprintf("http://127.0.0.1:%s", ah.LPort),
		"--node-name", fullhost,
		"--v", "2", "--alsologtostderr").CombinedOutput()

	result.err = err
	result.testCombinedOutput = fmt.Sprintf("%s", out)
	return result
}


text:
using Android.Graphics.Drawables;
using Android.Support.V7.Widget;
using Android.Widget;
using Plugin.Xablu.Walkthrough.Abstractions.Controls;
using Plugin.Xablu.Walkthrough.Indicator;
using System.Drawing;
using Splat;
using Android.Graphics.Drawables.Shapes;
using Android.Views;

namespace Plugin.Xablu.Walkthrough.Extensions
{
    public static class AndroidViewExtensions
    {
        public static void SetBaseControl(this View view, BaseControl control)
        {
            if (view == null)
                return;

            view.Visibility = (control?.Hidden ?? false || control == null) ? ViewStates.Gone : ViewStates.Visible;
        }

        public static void SetControl(this TextView textview, TextControl control)
        {
            textview.SetBaseControl(control);

            if (control == null)
                return;

            textview.Text = control.Text;
            textview.TextSize = control.TextSize;
            textview.SetTextColor(control.TextColor.ToNative());

            switch (control.TextStyle)
            {
                case 1:
                    textview.SetTypeface(textview.Typeface, Android.Graphics.TypefaceStyle.Bold);
                    break;
                case 2:
                    textview.SetTypeface(textview.Typeface, Android.Graphics.TypefaceStyle.Italic);
                    break;
            }
        }

        public static void SetControl(this Button button, ButtonControl control)
        {
            button.SetBaseControl(control);

            if (control == null)
                return;

            SetControl(button as TextView, control);

            if (control.ClickAction != null)
                button.Click += (sender, e) => control.ClickAction();

            button.SetBackgroundColor(control.BackgroundColor.ToNative());
        }

        public static void SetControl(this AppCompatImageButton imageView, ImageButtonControl control)
        {
            imageView.SetBaseControl(control);

            if (control == null)
                return;

            if (control.Image != null)
                imageView.SetImageDrawable(GetImage(control.Image));

            if (control.ClickAction != null)
                imageView.Click += (sender, e) => control.ClickAction();
        }

        public static void SetControl(this ImageView imageView, ImageControl control)
        {
            imageView.SetBaseControl(control);

            if (control == null)
                return;

            if (control.Image != null)
                imageView.SetImageDrawable(GetImage(control.Image));
        }

        public static void SetControl(this CircleIndicator circleIndicator, PageControl control)
        {
            circleIndicator.SetBaseControl(control);

            if (control == null)
                return;

            circleIndicator.SelectedDrawable = createRoundedIndicator(control.SelectedPageColor);
            circleIndicator.UnselectedDrawable = createRoundedIndicator(control.UnSelectedPageColor);
        }

        private static ShapeDrawable createRoundedIndicator(Color color)
        {
            var drawable = new ShapeDrawable(new OvalShape());
            drawable.Paint.Color = color.ToNative();
            return drawable;
        }

        private static Drawable GetImage(string resource)
        {
            return BitmapLoader.Current.LoadFromResource(resource, null, null).Result.ToNative();
        }
    }
}


text:
/**************************************************
 * Source Code for the Original Compiler for the
 * Programming Language Wake
 *
 * Exists.h
 *
 * Licensed under the MIT license
 * See LICENSE.TXT for details
 *
 * Author: Michael Fairhurst
 * Revised By:
 *
 **************************************************/

#ifndef HEADER_AST_EXISTS
#define HEADER_AST_EXISTS

#include "ast/StatementNode.h"
#include "ast/ExpressionNode.h"
#include "ScopeSymbolTable.h"
#include "ErrorTracker.h"
#include <memory>

namespace wake {

	namespace ast {

		class Exists : public StatementNode {

			public:
				Exists(ExpressionNode* existable, StatementNode* block, StatementNode* otherwise, Node* node, ScopeSymbolTable* scopesymtable, ErrorTracker* errors)
					: existable(existable), block(block), otherwise(otherwise), node(node), scopesymtable(scopesymtable), errors(errors) {};

				void typeCheck();

				bool exhaustiveReturns();

				~Exists() {};

			private:
				std::auto_ptr<ExpressionNode> existable;
				std::auto_ptr<StatementNode> block;
				std::auto_ptr<StatementNode> otherwise;
				Node* node;
				ScopeSymbolTable* scopesymtable;
				ErrorTracker* errors;

		};

	}

}

#endif


text:
/* -*- Mode: C; c-basic-offset:4 ; -*- */

/*
 *  (C) 2001 by Argonne National Laboratory.
 *      See COPYRIGHT in top-level directory.
 */

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>

#include "dataloop.h"
#include "veccpy.h"

/* NOTE: bufp values are unused, ripe for removal */

int PREPEND_PREFIX(Segment_contig_m2m)(DLOOP_Offset *blocks_p,
				       DLOOP_Type el_type,
				       DLOOP_Offset rel_off,
				       void *bufp,
				       void *v_paramp);
int PREPEND_PREFIX(Segment_vector_m2m)(DLOOP_Offset *blocks_p,
				       DLOOP_Count count,
				       DLOOP_Count blksz,
				       DLOOP_Offset stride,
				       DLOOP_Type el_type,
				       DLOOP_Offset rel_off,
				       void *bufp,
				       void *v_paramp);
int PREPEND_PREFIX(Segment_blkidx_m2m)(DLOOP_Offset *blocks_p,
				       DLOOP_Count count,
				       DLOOP_Count blocklen,
				       DLOOP_Offset *offsetarray,
				       DLOOP_Type el_type,
				       DLOOP_Offset rel_off,
				       void *bufp,
				       void *v_paramp);
int PREPEND_PREFIX(Segment_index_m2m)(DLOOP_Offset *blocks_p,
				      DLOOP_Count count,
				      DLOOP_Count *blockarray,
				      DLOOP_Offset *offsetarray,
				      DLOOP_Type el_type,
				      DLOOP_Offset rel_off,
				      void *bufp,
				      void *v_paramp);

void PREPEND_PREFIX(Segment_pack)(DLOOP_Segment *segp,
				  DLOOP_Offset   first,
				  DLOOP_Offset  *lastp,
				  void *streambuf)
{
    struct PREPEND_PREFIX(m2m_params) params; /* defined in dataloop_parts.h */

    /* experimenting with discarding buf value in the segment, keeping in
     * per-use structure instead. would require moving the parameters around a
     * bit.
     */
    params.userbuf   = segp->ptr;
    params.streambuf = streambuf;
    params.direction = DLOOP_M2M_FROM_USERBUF;

    PREPEND_PREFIX(Segment_manipulate)(segp, first, lastp,
				       PREPEND_PREFIX(Segment_contig_m2m),
				       PREPEND_PREFIX(Segment_vector_m2m),
				       PREPEND_PREFIX(Segment_blkidx_m2m),
				       PREPEND_PREFIX(Segment_index_m2m),
				       NULL, /* size fn */
				       &params);
    return;
}

void PREPEND_PREFIX(Segment_unpack)(DLOOP_Segment *segp,
				    DLOOP_Offset   first,
				    DLOOP_Offset  *lastp,
				    void *streambuf)
{
    struct PREPEND_PREFIX(m2m_params) params;

    /* experimenting with discarding buf value in the segment, keeping in
     * per-use structure instead. would require moving the parameters around a
     * bit.
     */
    params.userbuf   = segp->ptr;
    params.streambuf = streambuf;
    params.direction = DLOOP_M2M_TO_USERBUF;

    PREPEND_PREFIX(Segment_manipulate)(segp, first, lastp,
				       PREPEND_PREFIX(Segment_contig_m2m),
				       PREPEND_PREFIX(Segment_vector_m2m),
				       PREPEND_PREFIX(Segment_blkidx_m2m),
				       PREPEND_PREFIX(Segment_index_m2m),
				       NULL, /* size fn */
				       &params);
    return;
}

/* PIECE FUNCTIONS BELOW */

int PREPEND_PREFIX(Segment_contig_m2m)(DLOOP_Offset *blocks_p,
				       DLOOP_Type el_type,
				       DLOOP_Offset rel_off,
				       void *bufp ATTRIBUTE((unused)),
				       void *v_paramp)
{
    DLOOP_Offset el_size; /* DLOOP_Count? */
    DLOOP_Offset size;
    struct PREPEND_PREFIX(m2m_params) *paramp = v_paramp;

    DLOOP_Handle_get_size_macro(el_type, el_size);
    size = *blocks_p * el_size;

#ifdef MPID_SU_VERBOSE
    dbg_printf("\t[contig unpack: do=" DLOOP_OFFSET_FMT_DEC_SPEC ", dp=%x, bp=%x, sz=" DLOOP_OFFSET_FMT_DEC_SPEC ", blksz=" DLOOP_OFFSET_FMT_DEC_SPEC "]\n",
	       rel_off,
	       (unsigned) bufp,
	       (unsigned) paramp->u.unpack.unpack_buffer,
	       el_size,
	       *blocks_p);
#endif

    if (paramp->direction == DLOOP_M2M_TO_USERBUF) {
	/* Ensure that pointer increment fits in a pointer */
	/* userbuf is a pointer (not a displacement) since it is being
	 * used on a memcpy */
	DLOOP_Ensure_Offset_fits_in_pointer((DLOOP_VOID_PTR_CAST_TO_OFFSET (paramp->userbuf)) + rel_off);
	DLOOP_Memcpy((char *) paramp->userbuf + rel_off, paramp->streambuf, size);
    }
    else {
	/* Ensure that pointer increment fits in a pointer */
	/* userbuf is a pointer (not a displacement) since it is being used on a memcpy */
	DLOOP_Ensure_Offset_fits_in_pointer((DLOOP_VOID_PTR_CAST_TO_OFFSET (paramp->userbuf)) + rel_off);
	DLOOP_Memcpy(paramp->streambuf, (char *) paramp->userbuf + rel_off, size);
    }
    /* Ensure that pointer increment fits in a pointer */
    /* streambuf is a pointer (not a displacement) since it was used on a memcpy */
    DLOOP_Ensure_Offset_fits_in_pointer((DLOOP_VOID_PTR_CAST_TO_OFFSET (paramp->streambuf)) + size);
    paramp->streambuf += size;
    return 0;
}

/* Segment_vector_m2m
 *
 * Note: this combines both packing and unpacking functionality.
 *
 * Note: this is only called when the starting position is at the beginning
 * of a whole block in a vector type.
 */
int PREPEND_PREFIX(Segment_vector_m2m)(DLOOP_Offset *blocks_p,
				       DLOOP_Count count ATTRIBUTE((unused)),
				       DLOOP_Count blksz,
				       DLOOP_Offset stride,
				       DLOOP_Type el_type,
				       DLOOP_Offset rel_off, /* offset into buffer */
				       void *bufp ATTRIBUTE((unused)),
				       void *v_paramp)
{
    DLOOP_Count i, blocks_left, whole_count;
    DLOOP_Offset el_size;
    struct PREPEND_PREFIX(m2m_params) *paramp = v_paramp;
    char *cbufp;

    /* Ensure that pointer increment fits in a pointer */
    /* userbuf is a pointer (not a displacement) since it is being used for a memory copy */
    DLOOP_Ensure_Offset_fits_in_pointer((DLOOP_VOID_PTR_CAST_TO_OFFSET (paramp->userbuf)) + rel_off);
    cbufp = (char*) paramp->userbuf + rel_off;
    DLOOP_Handle_get_size_macro(el_type, el_size);

    whole_count = (blksz > 0) ? (*blocks_p / (DLOOP_Offset) blksz) : 0;
    blocks_left = (blksz > 0) ? (*blocks_p % (DLOOP_Offset) blksz) : 0;

    if (paramp->direction == DLOOP_M2M_TO_USERBUF) {
	if (el_size == 8
	    MPIR_ALIGN8_TEST(paramp->streambuf,cbufp))
	{
	    MPIDI_COPY_TO_VEC(paramp->streambuf, cbufp, stride,
			      int64_t, blksz, whole_count);
	    MPIDI_COPY_TO_VEC(paramp->streambuf, cbufp, 0,
			      int64_t, blocks_left, 1);
	}
	else if (el_size == 4
		 MPIR_ALIGN4_TEST(paramp->streambuf,cbufp))
	{
	    MPIDI_COPY_TO_VEC((paramp->streambuf), cbufp, stride,
			      int32_t, blksz, whole_count);
	    MPIDI_COPY_TO_VEC(paramp->streambuf, cbufp, 0,
			      int32_t, blocks_left, 1);
	}
	else if (el_size == 2) {
	    MPIDI_COPY_TO_VEC(paramp->streambuf, cbufp, stride,
			      int16_t, blksz, whole_count);
	    MPIDI_COPY_TO_VEC(paramp->streambuf, cbufp, 0,
			      int16_t, blocks_left, 1);
	}
	else {
	    for (i=0; i < whole_count; i++) {
		DLOOP_Memcpy(cbufp, paramp->streambuf, ((DLOOP_Offset) blksz) * el_size);
		/* Ensure that pointer increment fits in a pointer */
		/* streambuf is a pointer (not a displacement) since it is being used for a memory copy */
		DLOOP_Ensure_Offset_fits_in_pointer((DLOOP_VOID_PTR_CAST_TO_OFFSET (paramp->streambuf)) +
						 ((DLOOP_Offset) blksz) * el_size);
		paramp->streambuf += ((DLOOP_Offset) blksz) * el_size;

		DLOOP_Ensure_Offset_fits_in_pointer((DLOOP_VOID_PTR_CAST_TO_OFFSET (cbufp)) + stride);
		cbufp += stride;
	    }
	    if (blocks_left) {
		DLOOP_Memcpy(cbufp, paramp->streambuf, ((DLOOP_Offset) blocks_left) * el_size);
		/* Ensure that pointer increment fits in a pointer */
		/* streambuf is a pointer (not a displacement) since
		 * it is being used for a memory copy */
		DLOOP_Ensure_Offset_fits_in_pointer((DLOOP_VOID_PTR_CAST_TO_OFFSET (paramp->streambuf)) +
						 ((DLOOP_Offset) blocks_left) * el_size);
		paramp->streambuf += ((DLOOP_Offset) blocks_left) * el_size;
	    }
	}
    }
    else /* M2M_FROM_USERBUF */ {
	if (el_size == 8
	    MPIR_ALIGN8_TEST(cbufp,paramp->streambuf))
	{
	    MPIDI_COPY_FROM_VEC(cbufp, paramp->streambuf, stride,
				int64_t, blksz, whole_count);
	    MPIDI_COPY_FROM_VEC(cbufp, paramp->streambuf, 0,
				int64_t, blocks_left, 1);
	}
	else if (el_size == 4
		 MPIR_ALIGN4_TEST(cbufp,paramp->streambuf))
	{
	    MPIDI_COPY_FROM_VEC(cbufp, paramp->streambuf, stride,
				int32_t, blksz, whole_count);
	    MPIDI_COPY_FROM_VEC(cbufp, paramp->streambuf, 0,
				int32_t, blocks_left, 1);
	}
	else if (el_size == 2) {
	    MPIDI_COPY_FROM_VEC(cbufp, paramp->streambuf, stride,
				int16_t, blksz, whole_count);
	    MPIDI_COPY_FROM_VEC(cbufp, paramp->streambuf, 0,
				int16_t, blocks_left, 1);
	}
	else {
	    for (i=0; i < whole_count; i++) {
		DLOOP_Memcpy(paramp->streambuf, cbufp, (DLOOP_Offset) blksz * el_size);
		/* Ensure that pointer increment fits in a pointer */
		/* streambuf is a pointer (not a displacement) since
		 * it is being used for a memory copy */
		DLOOP_Ensure_Offset_fits_in_pointer((DLOOP_VOID_PTR_CAST_TO_OFFSET (paramp->streambuf)) +
						 (DLOOP_Offset) blksz * el_size);
		paramp->streambuf += (DLOOP_Offset) blksz * el_size;
		cbufp += stride;
	    }
	    if (blocks_left) {
		DLOOP_Memcpy(paramp->streambuf, cbufp, (DLOOP_Offset) blocks_left * el_size);
		/* Ensure that pointer increment fits in a pointer */
		/* streambuf is a pointer (not a displacement) since
		 * it is being used for a memory copy */
		DLOOP_Ensure_Offset_fits_in_pointer((DLOOP_VOID_PTR_CAST_TO_OFFSET (paramp->streambuf)) +
						 (DLOOP_Offset) blocks_left * el_size);
		paramp->streambuf += (DLOOP_Offset) blocks_left * el_size;
	    }
	}
    }

    return 0;
}

/* MPID_Segment_blkidx_m2m
 */
int PREPEND_PREFIX(Segment_blkidx_m2m)(DLOOP_Offset *blocks_p,
				       DLOOP_Count count,
				       DLOOP_Count blocklen,
				       DLOOP_Offset *offsetarray,
				       DLOOP_Type el_type,
				       DLOOP_Offset rel_off,
				       void *bufp ATTRIBUTE((unused)),
				       void *v_paramp)
{
    DLOOP_Count curblock = 0;
    DLOOP_Offset el_size;
    DLOOP_Offset blocks_left = *blocks_p;
    char *cbufp;
    struct PREPEND_PREFIX(m2m_params) *paramp = v_paramp;

    DLOOP_Handle_get_size_macro(el_type, el_size);

    while (blocks_left) {
	char *src, *dest;

	DLOOP_Assert(curblock < count);

	/* Ensure that pointer increment fits in a pointer */
	/* userbuf is a pointer (not a displacement) since it is being
	 * used for a memory copy */
	DLOOP_Ensure_Offset_fits_in_pointer((DLOOP_VOID_PTR_CAST_TO_OFFSET (paramp->userbuf)) +
					 rel_off + offsetarray[curblock]);
	cbufp = (char*) paramp->userbuf + rel_off + offsetarray[curblock];

	if (blocklen > blocks_left) blocklen = blocks_left;

	if (paramp->direction == DLOOP_M2M_TO_USERBUF) {
	    src  = paramp->streambuf;
	    dest = cbufp;
	}
	else {
	    src  = cbufp;
	    dest = paramp->streambuf;
	}

	/* note: macro modifies dest buffer ptr, so we must reset */
	if (el_size == 8
	    MPIR_ALIGN8_TEST(src, dest))
	{
	    MPIDI_COPY_FROM_VEC(src, dest, 0, int64_t, blocklen, 1);
	}
	else if (el_size == 4
		 MPIR_ALIGN4_TEST(src,dest))
	{
	    MPIDI_COPY_FROM_VEC(src, dest, 0, int32_t, blocklen, 1);
	}
	else if (el_size == 2) {
	    MPIDI_COPY_FROM_VEC(src, dest, 0, int16_t, blocklen, 1);
	}
	else {
	    DLOOP_Memcpy(dest, src, (DLOOP_Offset) blocklen * el_size);
	}

	/* Ensure that pointer increment fits in a pointer */
	/* streambuf is a pointer (not a displacement) since it is
	 * being used for a memory copy */
	DLOOP_Ensure_Offset_fits_in_pointer((DLOOP_VOID_PTR_CAST_TO_OFFSET (paramp->streambuf)) +
					 (DLOOP_Offset) blocklen * el_size);
	paramp->streambuf += (DLOOP_Offset) blocklen * el_size;
	blocks_left -= blocklen;
	curblock++;
    }

    return 0;
}

/* MPID_Segment_index_m2m
 */
int PREPEND_PREFIX(Segment_index_m2m)(DLOOP_Offset *blocks_p,
				      DLOOP_Count count,
				      DLOOP_Count *blockarray,
				      DLOOP_Offset *offsetarray,
				      DLOOP_Type el_type,
				      DLOOP_Offset rel_off,
				      void *bufp ATTRIBUTE((unused)),
				      void *v_paramp)
{
    int curblock = 0;
    DLOOP_Offset el_size;
    DLOOP_Offset cur_block_sz, blocks_left = *blocks_p;
    char *cbufp;
    struct PREPEND_PREFIX(m2m_params) *paramp = v_paramp;

    DLOOP_Handle_get_size_macro(el_type, el_size);

    while (blocks_left) {
	char *src, *dest;

	DLOOP_Assert(curblock < count);
	cur_block_sz = blockarray[curblock];

	/* Ensure that pointer increment fits in a pointer */
	/* userbuf is a pointer (not a displacement) since it is being
	 * used for a memory copy */
	DLOOP_Ensure_Offset_fits_in_pointer((DLOOP_VOID_PTR_CAST_TO_OFFSET (paramp->userbuf)) +
					 rel_off + offsetarray[curblock]);
	cbufp = (char*) paramp->userbuf + rel_off + offsetarray[curblock];

	if (cur_block_sz > blocks_left) cur_block_sz = blocks_left;

	if (paramp->direction == DLOOP_M2M_TO_USERBUF) {
	    src  = paramp->streambuf;
	    dest = cbufp;
	}
	else {
	    src  = cbufp;
	    dest = paramp->streambuf;
	}

	/* note: macro modifies dest buffer ptr, so we must reset */
	if (el_size == 8
	    MPIR_ALIGN8_TEST(src, dest))
	{
	    MPIDI_COPY_FROM_VEC(src, dest, 0, int64_t, cur_block_sz, 1);
	}
	else if (el_size == 4
		 MPIR_ALIGN4_TEST(src,dest))
	{
	    MPIDI_COPY_FROM_VEC(src, dest, 0, int32_t, cur_block_sz, 1);
	}
	else if (el_size == 2) {
	    MPIDI_COPY_FROM_VEC(src, dest, 0, int16_t, cur_block_sz, 1);
	}
	else {
	    DLOOP_Memcpy(dest, src, cur_block_sz * el_size);
	}

	/* Ensure that pointer increment fits in a pointer */
	/* streambuf is a pointer (not a displacement) since it is
	 * being used for a memory copy */
	DLOOP_Ensure_Offset_fits_in_pointer((DLOOP_VOID_PTR_CAST_TO_OFFSET (paramp->streambuf)) +
					 cur_block_sz * el_size);
	paramp->streambuf += cur_block_sz * el_size;
	blocks_left -= cur_block_sz;
	curblock++;
    }

    return 0;
}

/*
 * Local variables:
 * c-indent-tabs-mode: nil
 * End:
 */


text:
+++
Title = "Banjo Obayomi"
Twitter = "banjtheman"
image = "banjo-obayomi.png"
type = "speaker"
linktitle = "banjo-obayomi"

+++

Banjo is a Senior Research Engineer at Two Six Labs, where he develops platform solutions for productizing various researched based projects.

Banjo received his B.S in Computer Science from University of Maryland College Park in 2011, and his M.S in Computer Science from Loyola University Maryland in 2015. Banjo also is an AWS Certified Solutions Architect – Associate and AWS Certified Big Data Engineer.


text:
module LevelUp
  class Task

    attr_accessor :job, :allow_transition, :allow_retry

    def initialize(job, allow_transition, allow_retry)
      self.job = job
      self.allow_transition = allow_transition
      self.allow_retry = allow_retry
    end

    def execute(receiver, method_name)
      task_name = retry_params = task_description = nil
      ActiveRecord::Base.transaction do
        task_name = catch(:move_to) do
          retry_params = catch(:retry_in) do
            task_description = catch(:manual_task) do
              receiver.send(method_name)
              nil
            end
            nil
          end
          nil
        end
      end

      if self.allow_transition
        self.job.next_task = task_name
      end

      if retry_params and self.allow_retry
        self.job.retry_at = retry_params[:delay].from_now
      end

      if task_description
        self.job.manual_task = true
        self.job.manual_task_description = task_description
      end
    end

    def move_to!(task_name)
      self.job.move_to!(task_name)
    end

    def retry_in!(delay, error=nil)
      self.job.retry_in!(delay, error)
    end

    def manual_task!(description)
      self.job.manual_task!(description)
    end
  end
end