text:
// HSV.cs
//
// Author:
//       Ricky Curtice <ricky@rwcproductions.com>
//
// Copyright (c) 2017 Richard Curtice
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

using System;
using System.Drawing;

namespace Anaximander {
	/// <summary>
	/// Hue, Saturation, Value; used for color-interpolation
	/// </summary>
	public struct HSV : IEquatable<HSV> {
		private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);

		private float h;
		private float s;
		private float v;

		public HSV(float h, float s, float v) {
			this.h = h;
			this.s = s;
			this.v = v;
		}

		// (for info about algorithm, see http://en.wikipedia.org/wiki/HSL_and_HSV)
		public HSV(Color c) {
			var r = c.R / 255f;
			var g = c.G / 255f;
			var b = c.B / 255f;
			var max = Math.Max(Math.Max(r, g), b);
			var min = Math.Min(Math.Min(r, g), b);
			var diff = max - min;

			if (Math.Abs(max - min) < 0.001) {
				h = 0f;
			}
			else if (Math.Abs(max - r) < 0.001) {
				h = (g - b) / diff * 60f;
			}
			else if (Math.Abs(max - g) < 0.001) {
				h = (b - r) / diff * 60f + 120f;
			}
			else {
				h = (r - g) / diff * 60f + 240f;
			}

			if (h < 0f) {
				h += 360f;
			}

			if (Math.Abs(max) <= 0.001f) {
				s = 0f;
			}
			else {
				s = diff / max;
			}

			v = max;
		}

		// (for info about algorithm, see http://en.wikipedia.org/wiki/HSL_and_HSV)
		public Color ToColor() {
			if (s < 0f) {
				LOG.Debug("S < 0: " + s);
			}
			else if (s > 1f) {
				LOG.Debug("S > 1: " + s);
			}

			if (v < 0f) {
				LOG.Debug("V < 0: " + v);
			}
			else if (v > 1f) {
				LOG.Debug("V > 1: " + v);
			}

			var f = h / 60f;
			var sector = (int)f % 6;
			f = f - (int)f;
			var pi = Math.Max(0, Math.Min(255, (int)(v * (1f - s) * 255f)));
			var qi = Math.Max(0, Math.Min(255, (int)(v * (1f - s * f) * 255f)));
			var ti = Math.Max(0, Math.Min(255, (int)(v * (1f - (1f - f) * s) * 255f)));
			var vi = Math.Max(0, Math.Min(255, (int)(v * 255f)));

			switch (sector) {
				case 0:
					return Color.FromArgb(vi, ti, pi);
				case 1:
					return Color.FromArgb(qi, vi, pi);
				case 2:
					return Color.FromArgb(pi, vi, ti);
				case 3:
					return Color.FromArgb(pi, qi, vi);
				case 4:
					return Color.FromArgb(ti, pi, vi);
				default:
					return Color.FromArgb(vi, pi, qi);
			}
		}

		// interpolate two colors in HSV space and return the resulting color
		public HSV InterpolateHSV(ref HSV c2, float ratio) {
			if (ratio <= 0f) {
				return this;
			}
			if (ratio >= 1f) {
				return c2;
			}

			// make sure we are on the same side on the hue-circle for interpolation
			// We change the hue of the parameters here, but we don't change the color
			// represented by that value
			if (h - c2.h > 180f) {
				h -= 360f;
			}
			else if (c2.h - h > 180f) {
				h += 360f;
			}

			return new HSV(h * (1f - ratio) + c2.h * ratio,
				s * (1f - ratio) + c2.s * ratio,
				v * (1f - ratio) + c2.v * ratio);
		}

		#region IEquatable

		bool IEquatable<HSV>.Equals(HSV other) {
			return
				Math.Abs(h - other.h) < .000001
				&& Math.Abs(s - other.s) < .000001
				&& Math.Abs(v - other.v) < .000001
			;
		}

		#endregion
	}
}


text:
<?php

final class PhabricatorProfileMenuItemConfigurationQuery
  extends PhabricatorCursorPagedPolicyAwareQuery {

  private $ids;
  private $phids;
  private $profilePHIDs;
  private $customPHIDs;
  private $includeGlobal;
  private $affectedObjectPHIDs;

  public function withIDs(array $ids) {
    $this->ids = $ids;
    return $this;
  }

  public function withPHIDs(array $phids) {
    $this->phids = $phids;
    return $this;
  }

  public function withProfilePHIDs(array $phids) {
    $this->profilePHIDs = $phids;
    return $this;
  }

  public function withCustomPHIDs(array $phids, $include_global = false) {
    $this->customPHIDs = $phids;
    $this->includeGlobal = $include_global;
    return $this;
  }

  public function withAffectedObjectPHIDs(array $phids) {
    $this->affectedObjectPHIDs = $phids;
    return $this;
  }

  public function newResultObject() {
    return new PhabricatorProfileMenuItemConfiguration();
  }

  protected function buildWhereClauseParts(AphrontDatabaseConnection $conn) {
    $where = parent::buildWhereClauseParts($conn);

    if ($this->ids !== null) {
      $where[] = qsprintf(
        $conn,
        'config.id IN (%Ld)',
        $this->ids);
    }

    if ($this->phids !== null) {
      $where[] = qsprintf(
        $conn,
        'config.phid IN (%Ls)',
        $this->phids);
    }

    if ($this->profilePHIDs !== null) {
      $where[] = qsprintf(
        $conn,
        'config.profilePHID IN (%Ls)',
        $this->profilePHIDs);
    }

    if ($this->customPHIDs !== null) {
      if ($this->customPHIDs && $this->includeGlobal) {
        $where[] = qsprintf(
          $conn,
          'config.customPHID IN (%Ls) OR config.customPHID IS NULL',
          $this->customPHIDs);
      } else if ($this->customPHIDs) {
        $where[] = qsprintf(
          $conn,
          'config.customPHID IN (%Ls)',
          $this->customPHIDs);
      } else {
        $where[] = qsprintf(
          $conn,
          'config.customPHID IS NULL');
      }
    }

    if ($this->affectedObjectPHIDs !== null) {
      $where[] = qsprintf(
        $conn,
        'affected.dst IN (%Ls)',
        $this->affectedObjectPHIDs);
    }

    return $where;
  }

  protected function buildJoinClauseParts(AphrontDatabaseConnection $conn) {
    $joins = parent::buildJoinClauseParts($conn);

    if ($this->affectedObjectPHIDs !== null) {
      $joins[] = qsprintf(
        $conn,
        'JOIN %T affected ON affected.src = config.phid
          AND affected.type = %d',
        PhabricatorEdgeConfig::TABLE_NAME_EDGE,
        PhabricatorProfileMenuItemAffectsObjectEdgeType::EDGECONST);
    }

    return $joins;
  }

  protected function willFilterPage(array $page) {
    $items = PhabricatorProfileMenuItem::getAllMenuItems();
    foreach ($page as $key => $item) {
      $item_type = idx($items, $item->getMenuItemKey());
      if (!$item_type) {
        $this->didRejectResult($item);
        unset($page[$key]);
        continue;
      }
      $item_type = clone $item_type;
      $item_type->setViewer($this->getViewer());
      $item->attachMenuItem($item_type);
    }

    if (!$page) {
      return array();
    }

    $profile_phids = mpull($page, 'getProfilePHID');

    $profiles = id(new PhabricatorObjectQuery())
      ->setViewer($this->getViewer())
      ->setParentQuery($this)
      ->withPHIDs($profile_phids)
      ->execute();
    $profiles = mpull($profiles, null, 'getPHID');

    foreach ($page as $key => $item) {
      $profile = idx($profiles, $item->getProfilePHID());
      if (!$profile) {
        $this->didRejectResult($item);
        unset($page[$key]);
        continue;
      }

      $item->attachProfileObject($profile);
    }

    return $page;
  }

  public function getQueryApplicationClass() {
    return 'PhabricatorSearchApplication';
  }

  protected function getPrimaryTableAlias() {
    return 'config';
  }

}

redpajama_set_name: RedPajamaGithub


text:
package com.ruikk.demo.filetools.task.file;

import com.ruikk.demo.filetools.task.file.*;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * Created by SABER on 2016/8/3.
 */
public class FileGroupTask implements com.ruikk.demo.filetools.task.file.FileTask {
    private List<com.ruikk.demo.filetools.task.file.FileTask> taskList = null;

    public FileGroupTask() {
        this(new ArrayList<com.ruikk.demo.filetools.task.file.FileTask>());
    }

    public FileGroupTask(List<com.ruikk.demo.filetools.task.file.FileTask> taskList) {
        this.taskList = taskList;
    }

    public void push(com.ruikk.demo.filetools.task.file.FileTask task) {
        taskList.add(task);
    }

    public void push(com.ruikk.demo.filetools.task.file.FileTask[] tasks) {
        taskList.addAll(Arrays.asList(tasks));
    }

    @Override
    public void onFileTask(File file) throws IOException {
        for (com.ruikk.demo.filetools.task.file.FileTask fileTask : taskList) {
            fileTask.onFileTask(file);
        }
    }
}


text:
package org.plovr;

import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.net.URI;
import java.net.URISyntaxException;

import com.google.common.io.Resources;
import com.google.template.soy.SoyFileSet;
import com.google.template.soy.data.SoyMapData;
import com.google.template.soy.tofu.SoyTofu;
import com.sun.net.httpserver.Headers;
import com.sun.net.httpserver.HttpExchange;

public final class HttpUtil {

  private static final SoyTofu TOFU;

  static {
    SoyFileSet.Builder builder = new SoyFileSet.Builder();
    builder.add(Resources.getResource(InputFileHandler.class, "400.soy"));
    SoyFileSet fileSet = builder.build();
    TOFU = fileSet.compileToTofu();
  }

  private HttpUtil() {}

  public static URI getReferrer(HttpExchange exchange) {
    Headers headers = exchange.getRequestHeaders();
    String referrer = headers.getFirst("Referer");
    if (referrer != null) {
      try {
        return new URI(referrer);
      } catch (URISyntaxException e) {
        // OK
      }
    }
    return null;
  }

  /**
   * Returns a 400 with no message.
   */
  public static void writeNullResponse(HttpExchange exchange) throws IOException {
    writeErrorMessageResponse(exchange, "");
  }

  public static void writeNotFound(HttpExchange exchange) throws IOException {
    writeHtmlErrorMessageResponse(exchange, "
Not Found
", 404);
  }

  /**
   * Returns a 400 with the specified message.
   */
  public static void writeErrorMessageResponse(HttpExchange exchange,
      String message) throws IOException {
    Headers responseHeaders = exchange.getResponseHeaders();
    responseHeaders.set("Content-Type", "text/plain");
    exchange.sendResponseHeaders(400, message.length());

    Writer responseBody = new OutputStreamWriter(exchange.getResponseBody());
    responseBody.write(message);
    responseBody.close();
  }

  public static void return404(HttpExchange exchange) throws IOException {
    HttpUtil.writeHtmlErrorMessageResponse(
        exchange, "File Not Found", 404);
  }

  public static void writeHtmlErrorMessageResponse(HttpExchange exchange,
      String htmlMessage, int errorCode) throws IOException {
    Headers responseHeaders = exchange.getResponseHeaders();
    responseHeaders.set("Content-Type", "text/html");

    SoyMapData mapData = new SoyMapData("htmlMessage", htmlMessage);
    String message = TOFU.newRenderer("org.plovr.errorPage").
        setData(mapData).render();

    exchange.sendResponseHeaders(errorCode, message.length());
    Writer responseBody = new OutputStreamWriter(exchange.getResponseBody());
    responseBody.write(message);
    responseBody.close();
  };

  /**
   * Returns a 400 with the specified HTML message.
   */
  public static void writeHtmlErrorMessageResponse(HttpExchange exchange,
      String htmlMessage) throws IOException {
    writeHtmlErrorMessageResponse(exchange, htmlMessage, 400);
  }
}


text:
@interface JHUD ()

@property (nonatomic) JHUDLoadingType hudType;

@property (nonatomic,strong) JHUDAnimationView  *loadingView;

@property (nonatomic,strong) UIImageView  *imageView;

@end

@implementation JHUD

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self configureBaseInfo];
        [self configureSubViews];
    }
    return self;
}

-(void)configureBaseInfo
{
    self.backgroundColor = [UIColor groupTableViewBackgroundColor];
    self.indicatorViewSize = CGSizeMake(100, 100);
}

-(void)configureSubViews
{
    [self addSubview:self.indicatorView];

    [self addSubview:self.messageLabel];

    [self addSubview:self.refreshButton];

    [self.indicatorView addSubview:self.loadingView];
    [self.indicatorView addSubview:self.imageView];
}

#pragma mark - show method

-(void)showAtView:(UIView *)view hudType:(JHUDLoadingType)hudType
{
    NSAssert(![self isEmptySize], @"啊! JHUD 的 size 没有设置正确 !self.frame not be nil(JHUD)");

    self.hudType = hudType;

    [self hide];

    [self setupSubViewsWithHudType:hudType];

    [self dispatchMainQueue:^{

        view ? [view addSubview:self]:[KLastWindow addSubview:self];
        [self.superview bringSubviewToFront:self];
    }];
}

+(void)showAtView:(UIView *)view message:(NSString *)message
{
    [self showAtView:view message:message hudType:JHUDLoadingTypeCircle];
}

+(void)showAtView:(UIView *)view message:(NSString *)message hudType:(JHUDLoadingType)hudType
{
    JHUD * hud = [[self alloc]initWithFrame:view.bounds];
    hud.messageLabel.text = message;

    [hud showAtView:view hudType:hudType];
}

+(void)hideForView:(UIView *)view
{
    NSEnumerator *subviewsEnum = [view.subviews reverseObjectEnumerator];
    for (UIView *subview in subviewsEnum) {
        if ([subview isKindOfClass:self]) {
            JHUD * hud = (JHUD *)subview;
            [hud hide];
        }
    }
}

-(void)hide
{
    [self dispatchMainQueue:^{
        if (self.superview) {
            [self removeFromSuperview];
            [self.loadingView removeSubLayer];
        }
    }];
}

-(void)hideAfterDelay:(NSTimeInterval)afterDelay
{
    [self performSelector:@selector(hide) withObject:nil afterDelay:afterDelay];
}

-(void)setGifImageData:(NSData *)gifImageData
{
    _gifImageData = gifImageData;

    UIImage * image = [UIImage jHUDImageWithSmallGIFData:gifImageData scale:1];
    self.imageView.image = image;
}

-(void)setindicatorViewSize:(CGSize)indicatorViewSize
{
    _indicatorViewSize = indicatorViewSize;

    [self setNeedsUpdateConstraints];
}

-(void)setCustomAnimationImages:(NSArray *)customAnimationImages
{
    _customAnimationImages = customAnimationImages;

    if (customAnimationImages.count>1) {
        self.imageView.animationImages = _customAnimationImages;
        [self.imageView startAnimating];
    }
    [self setNeedsUpdateConstraints];
}

-(void)setCustomImage:(UIImage *)customImage
{
    _customImage = customImage;

    [self.imageView stopAnimating];

    self.imageView.image = customImage;
}

-(void)setIndicatorBackGroundColor:(UIColor *)indicatorBackGroundColor
{
    _indicatorBackGroundColor = indicatorBackGroundColor;

    self.loadingView.defaultBackGroundColor = _indicatorBackGroundColor;
}

-(void)setIndicatorForegroundColor:(UIColor *)indicatorForegroundColor
{
    _indicatorForegroundColor = indicatorForegroundColor;

    self.loadingView.foregroundColor = _indicatorForegroundColor;
}

+(BOOL)requiresConstraintBasedLayout
{
    return YES;
}

- (void)setupSubViewsWithHudType:(JHUDLoadingType)hudType
{
    hudType == JHUDLoadingTypeFailure ? [self isShowRefreshButton:YES]:
                                        [self isShowRefreshButton:NO];

    if ( hudType >2 ) {
        self.imageView.hidden = NO;
        [self.loadingView removeFromSuperview];

    }else
    {
        self.imageView.hidden = YES;

        //The size of the fixed loadingView .
        self.indicatorViewSize = CGSizeMake(100, 100);

        if (!self.loadingView.superview) {
            [self.indicatorView addSubview:self.loadingView];
        }
    }

    switch (hudType) {
        case JHUDLoadingTypeCircle:
            [self.loadingView showAnimationAtView:self animationType:JHUDAnimationTypeCircle];
            break;
        case JHUDLoadingTypeCircleJoin:
            [self.loadingView showAnimationAtView:self animationType:JHUDAnimationTypeCircleJoin];
            break;
        case JHUDLoadingTypeDot:
            [self.loadingView showAnimationAtView:self animationType:JHUDAnimationTypeDot];
            break;
        case JHUDLoadingTypeCustomAnimations:
            break;
        case JHUDLoadingTypeGifImage:
            break;
        case JHUDLoadingTypeFailure:
            break;

        default:
            break;
    }

}

#pragma mark  --  Lazy method

-(JHUDAnimationView *)loadingView
{
    if (_loadingView) {
        return _loadingView;
    }
    self.loadingView = [[JHUDAnimationView alloc]init];
    self.loadingView.translatesAutoresizingMaskIntoConstraints = NO;
    self.loadingView.backgroundColor = [UIColor clearColor];

    return self.loadingView;
}

-(UIView *)indicatorView
{
    if (_indicatorView) {
        return _indicatorView;
    }
    self.indicatorView = [[UIView alloc]init];
    self.indicatorView.translatesAutoresizingMaskIntoConstraints = NO;
    self.indicatorView.backgroundColor = [UIColor clearColor];

    return self.indicatorView;
}

-(UIImageView *)imageView
{
    if (_imageView) {
        return _imageView;
    }
    self.imageView = [[UIImageView alloc]init];
    self.imageView.translatesAutoresizingMaskIntoConstraints = NO ;
    self.imageView.animationDuration = 1;
    self.imageView.animationRepeatCount = 0;

    return self.imageView;
}

-(UILabel *)messageLabel
{
    if (_messageLabel) {
        return _messageLabel;
    }
    self.messageLabel = [UILabel new];
    self.messageLabel.translatesAutoresizingMaskIntoConstraints = NO;
    self.messageLabel.textAlignment = NSTextAlignmentCenter ;
    self.messageLabel.text = @"Please wait ...";
    self.messageLabel.textColor = [UIColor lightGrayColor];
    self.messageLabel.font = [UIFont systemFontOfSize:16];
    self.messageLabel.backgroundColor = [UIColor clearColor];
    self.messageLabel.numberOfLines = 0;

    return self.messageLabel;
}

-(UIButton *)refreshButton
{
    if (_refreshButton) {
        return _refreshButton;
    }
    self.refreshButton = [UIButton buttonWithType:UIButtonTypeCustom];
    self.refreshButton.translatesAutoresizingMaskIntoConstraints = NO;
    [self.refreshButton setTitleColor:[UIColor darkGrayColor] forState:UIControlStateNormal];
    [self.refreshButton setTitleColor:[UIColor blackColor] forState:UIControlStateHighlighted];
    self.refreshButton.titleLabel.textAlignment = NSTextAlignmentCenter;
    self.refreshButton.titleLabel.font = [UIFont systemFontOfSize:18];
    [self.refreshButton setTitle:@"Refresh" forState:UIControlStateNormal];
    self.refreshButton.layer.borderColor = [UIColor lightGrayColor].CGColor;
    self.refreshButton.layer.borderWidth = 0.5;
    [self.refreshButton addTarget:self action:@selector(refreshButtonClick) forControlEvents:UIControlEventTouchUpInside];

    return self.refreshButton;
}

#pragma mark  --  updateConstraints

-(void)updateConstraints
{
    [self removeAllConstraints];

    [self.refreshButton removeAllConstraints];
    [self.messageLabel removeConstraintWithAttribte:NSLayoutAttributeWidth];
    [self.indicatorView removeAllConstraints];
    [self.loadingView removeAllConstraints];
    [self.imageView removeAllConstraints];

    // messageLabel.constraint
    [self addConstraintCenterXToView:self.messageLabel centerYToView:self.messageLabel];
    [self.messageLabel addConstraintWidth:250 height:0];

    // indicatorView.constraint
    [self addConstraintCenterXToView:self.indicatorView centerYToView:nil];
    [self addConstarintWithTopView:self.indicatorView toBottomView:self.messageLabel constarint:10];
    [self.indicatorView addConstraintWidth:self.indicatorViewSize.width height:self.indicatorViewSize.height];

    // imageView.constraint
    [self.indicatorView addConstraintCenterXToView:self.imageView centerYToView:self.imageView];
    [self.imageView addConstraintWidth:self.indicatorViewSize.width height:self.indicatorViewSize.height];

    // loadingView.constraint
    if (self.loadingView.superview) {
        [self.indicatorView addConstraintCenterXToView:self.loadingView centerYToView:self.loadingView];
        [self.loadingView addConstraintWidth:self.indicatorViewSize.width height:self.indicatorViewSize.height];

    }
    // refreshButton..constraint
    [self addConstraintCenterXToView:self.refreshButton centerYToView:nil];
    [self addConstarintWithTopView:self.messageLabel toBottomView:self.refreshButton constarint:10];
    [self.refreshButton addConstraintWidth:100 height:35];

    //    NSLog(@"self.constraint.count %lu ",self.constraints.count);

    [super updateConstraints];
}

-(void)layoutSubviews
{
    [super layoutSubviews];
}

#pragma mark - other method

-(void)isShowRefreshButton:(BOOL)isShowRefreshButton
{
    if (isShowRefreshButton) {

        self.refreshButton.hidden = NO;
    } else {
        self.refreshButton.hidden = YES;
    }
}

// When JHUDLoadingType >2, there will be a "refresh" button, and the method.
-(void)refreshButtonClick
{
    [self.loadingView removeSubLayer];

    if (self.JHUDReloadButtonClickedBlock) {
        self.JHUDReloadButtonClickedBlock();
    }
}

-(BOOL)isEmptySize
{
    if (self.frame.size.width>0 && self.frame.size.height >0) {
        return NO;
    }
    return YES;
}

@end

#pragma mark - UIView (MainQueue)

@implementation UIView (MainQueue)

-(void)dispatchMainQueue:(dispatch_block_t)block
{
    dispatch_async(dispatch_get_main_queue(), ^{
        block();
    });
}

@end


text:
/* //////////////////////////////////////////////////////////////////////////////////////
 * trace
 */
#define TB_TRACE_MODULE_NAME            "coroutine"
#define TB_TRACE_MODULE_DEBUG           (0)

/* //////////////////////////////////////////////////////////////////////////////////////
 * includes
 */
#include "coroutine.h"
#include "scheduler.h"
#include "../impl/impl.h"

/* //////////////////////////////////////////////////////////////////////////////////////
 * private implementation
 */
tb_lo_coroutine_t* tb_lo_coroutine_init(tb_lo_scheduler_ref_t scheduler, tb_lo_coroutine_func_t func, tb_cpointer_t priv, tb_lo_coroutine_free_t free)
{
    // check
    tb_assert_and_check_return_val(scheduler && func, tb_null);

    // done
    tb_bool_t           ok = tb_false;
    tb_lo_coroutine_t*  coroutine = tb_null;
    do
    {
        // make coroutine
        coroutine = tb_malloc0_type(tb_lo_coroutine_t);
        tb_assert_and_check_break(coroutine);

        // init core
        tb_lo_core_init(&coroutine->core);

        // save scheduler
        coroutine->scheduler = scheduler;

        // init function and user private data
        coroutine->func = func;
        coroutine->priv = priv;
        coroutine->free = free;

        // ok
        ok = tb_true;

    } while (0);

    // failed?
    if (!ok)
    {
        // exit it
        if (coroutine) tb_lo_coroutine_exit(coroutine);
        coroutine = tb_null;
    }

    // trace
    tb_trace_d("init %p", coroutine);

    // ok?
    return coroutine;
}
tb_bool_t tb_lo_coroutine_reinit(tb_lo_coroutine_t* coroutine, tb_lo_coroutine_func_t func, tb_cpointer_t priv, tb_lo_coroutine_free_t free)
{
    // check
    tb_assert_and_check_return_val(coroutine && func, tb_false);
    tb_assert_and_check_return_val(coroutine->scheduler && tb_lo_core_state(coroutine) == TB_STATE_END, tb_false);

    // init core
    tb_lo_core_init(&coroutine->core);

    // init function and user private data
    coroutine->func = func;
    coroutine->priv = priv;
    coroutine->free = free;

    // init rs data
    tb_memset(&coroutine->rs, 0, sizeof(coroutine->rs));

    // ok
    return tb_true;
}
tb_void_t tb_lo_coroutine_exit(tb_lo_coroutine_t* coroutine)
{
    // check
    tb_assert_and_check_return(coroutine && tb_lo_core_state(coroutine) == TB_STATE_END);

    // trace
    tb_trace_d("exit: %p", coroutine);

    // exit it
    tb_free(coroutine);
}
tb_lo_scheduler_ref_t tb_lo_coroutine_scheduler_(tb_lo_coroutine_ref_t self)
{
    // check
    tb_lo_coroutine_t* coroutine = (tb_lo_coroutine_t*)self;
    tb_assert(coroutine);

    // get scheduler
    return coroutine->scheduler;
}
tb_void_t tb_lo_coroutine_sleep_(tb_lo_coroutine_ref_t self, tb_long_t interval)
{
    // check
    tb_lo_coroutine_t* coroutine = (tb_lo_coroutine_t*)self;
    tb_assert(coroutine);

    // get scheduler
    tb_lo_scheduler_t* scheduler = (tb_lo_scheduler_t*)coroutine->scheduler;
    tb_assert(scheduler);

    // init io scheduler first
    if (!tb_lo_scheduler_io_need(scheduler)) return ;

    // sleep it
    tb_lo_scheduler_io_sleep(scheduler->scheduler_io, interval);
}
tb_bool_t tb_lo_coroutine_waitio_(tb_lo_coroutine_ref_t self, tb_poller_object_ref_t object, tb_size_t events, tb_long_t timeout)
{
    // check
    tb_lo_coroutine_t* coroutine = (tb_lo_coroutine_t*)self;
    tb_assert(coroutine);

    // get scheduler
    tb_lo_scheduler_t* scheduler = (tb_lo_scheduler_t*)coroutine->scheduler;
    tb_assert(scheduler);

    // init io scheduler first
    if (!tb_lo_scheduler_io_need(scheduler)) return tb_false;

    // wait it
    return tb_lo_scheduler_io_wait(scheduler->scheduler_io, object, events, timeout);
}
#ifndef TB_CONFIG_MICRO_ENABLE
tb_bool_t tb_lo_coroutine_waitproc_(tb_lo_coroutine_ref_t self, tb_poller_object_ref_t object, tb_long_t timeout)
{
    // check
    tb_lo_coroutine_t* coroutine = (tb_lo_coroutine_t*)self;
    tb_assert(coroutine);

    // get scheduler
    tb_lo_scheduler_t* scheduler = (tb_lo_scheduler_t*)coroutine->scheduler;
    tb_assert(scheduler);

    // init io scheduler first
    if (!tb_lo_scheduler_io_need(scheduler)) return tb_false;

    // wait it
    return tb_lo_scheduler_io_wait_proc(scheduler->scheduler_io, object, timeout);
}
tb_long_t tb_lo_coroutine_proc_status_(tb_lo_coroutine_ref_t self)
{
    // check
    tb_lo_coroutine_t* coroutine = (tb_lo_coroutine_t*)self;
    tb_assert(coroutine);

    // get process status
    return coroutine->rs.wait.object_event;
}
#endif
tb_long_t tb_lo_coroutine_waitret_(tb_lo_coroutine_ref_t self)
{
    // check
    tb_lo_coroutine_t* coroutine = (tb_lo_coroutine_t*)self;
    tb_assert(coroutine);

    // get wait result
    return coroutine->rs.wait.result;
}
tb_void_t tb_lo_coroutine_pass_free_(tb_cpointer_t priv)
{
    if (priv) tb_free(priv);
}
tb_pointer_t tb_lo_coroutine_pass1_make_(tb_size_t type_size, tb_cpointer_t value, tb_size_t offset, tb_size_t size)
{
    // check
    tb_assert(type_size && value && offset + size <= type_size);

    // make data
    tb_byte_t* data = tb_malloc0_bytes(type_size);
    if (data) tb_memcpy(data + offset, value, size);

    // ok?
    return data;
}

/* //////////////////////////////////////////////////////////////////////////////////////
 * public implementation
 */
tb_bool_t tb_lo_coroutine_start(tb_lo_scheduler_ref_t self, tb_lo_coroutine_func_t func, tb_cpointer_t priv, tb_lo_coroutine_free_t free)
{
    return tb_lo_scheduler_start((tb_lo_scheduler_t*)self, func, priv, free);
}
tb_void_t tb_lo_coroutine_resume(tb_lo_coroutine_ref_t self)
{
    tb_lo_scheduler_resume((tb_lo_scheduler_t*)tb_lo_coroutine_scheduler_(self), (tb_lo_coroutine_t*)self);
}


text:
<?php

namespace BitcoinVietnam\BitcoinVietnam\Request;

/**
 * Class Factory
 * @package BitcoinVietnam\BitcoinVietnam\Request
 */
class Factory
{
    /**
     * @return Account\Factory
     */
    public function account()
    {
        return new Account\Factory();
    }

    /**
     * @return Constants\Factory
     */
    public function constants()
    {
        return new Constants\Factory();
    }

    /**
     * @return Order\Factory
     */
    public function order()
    {
        return new Order\Factory();
    }

    /**
     * @return Prices\Factory
     */
    public function prices()
    {
        return new Prices\Factory();
    }

    /**
     * @return Withdrawal\Factory
     */
    public function withdrawal()
    {
        return new Withdrawal\Factory();
    }
}


text:
package it.polimi.modaclouds.cpimlibrary.entitymng.statements.utils;

/**
 * @author Fabio Arcidiacono.
 */
public enum CompareOperator {
    EQUAL("="),
    LOWER_THAN("<"),
    GREATER_THAN(">"),
    LOWER_THAN_OR_EQUAL("<="),
    GREATER_THAN_OR_EQUAL(">="),
    NOT_EQUAL("<>");

    private String string;

    private CompareOperator(String string) {
        this.string = string;
    }

    @Override
    public String toString() {
        return this.string;
    }

    public static CompareOperator fromString(String string) {
        for (CompareOperator o : values()) {
            if (o.toString().equalsIgnoreCase(string)) {
                return o;
            }
        }
        throw new IllegalArgumentException();
    }
}


text:
package com.nokia.springboot.training.d01.s03;

import com.nokia.springboot.training.d01.s03.service.ProductService;
import com.nokia.springboot.training.d01.s03.config.BeanAttributesConfig;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * A simple demo for the usage of a Spring {@link org.springframework.context.annotation.Bean} with configured
 * initialization attributes
 *
 * @author bogdan.solga
 */
public class BeanAttributesDemo {

    public static void main(String[] args) {
        final ApplicationContext applicationContext = new AnnotationConfigApplicationContext(BeanAttributesConfig.class);

        final ProductService productService = applicationContext.getBean(ProductService.class);
        productService.displayProducts();

        System.out.println();

        // retrieving and using the lazy initialized product service
        final ProductService theLazyProductService = applicationContext.getBean("lazyProductService", ProductService.class);
        theLazyProductService.displayProducts();

        /*
         * Study:
         *      - what happens when we comment the @Primary annotation
         *      - how to retrieve and use the non-primary bean
         *      - the initialization of the @Lazy annotated bean, by retrieving the @Lazy ProductService
         */
    }
}


text:
This boilerplate for **webpack 4** is designed to work with _preact_.
However, you can modify this boilerplate as you want _(e.g. to use it with Vue )_

## Javascript :

All the **javascript** files are transpiled with babel and use sourcemaps (in developpment) for a better and easier debugging _(what you see in the devtools is the original file and not the transpiled one)_

In case you want more informations about **devtools** : https://webpack.js.org/configuration/devtool/

Feel free to use your owns in the _config.js_ file.

## Styles :

You can work with **.scss** files.
_dev_ : css is automatically inlined in the **index.html**.
_prod_ : css is extracted in its own **.css** file.

### Config :

```
module.exports = {
    port: {
        front: 3000, // port for devServer
    },
    entry: {
        front: [path.resolve(__dirname, 'front/static/js/components/app.js')], // entrypoint for front js file
    },
    devtool: production ? false : 'eval-cheap-module-source-map',
    componentsPath: path.resolve(__dirname, 'src/components'), // path for components (aliases)
    routesPath: path.resolve(__dirname, 'src/routes'),
    staticPath: path.resolve(__dirname, 'src'), // path for static files (aliases)
    template: './src/index.html' // path of template
}
```

### Plugins :

`ExtractTextPlugin` : Extract the css in its own file.

`HotModuleReplacementPlugin` : Update on the fly the modules that have changed and live reload it (if you authorize with `module.hot.accept()`).

`HtmlWebpackPlugin` : Generate an html files with js and css built-in.

### Eslint and Editorconfig :

Eslint lints your code, to help you having a consistant code.
Editorconfig keeps a consistant configuration between your text editor.

### Usage :

##### Installation :
- Note : you can also use `npm install`.

```
yarn
```

##### Dev :
Launch the `webpack-dev-server`

```
yarn start
```

##### Build :
Generate the `assets` _(css, js,...)_ in **dist** folder.

```
yarn build
```

(1) https://github.com/webpack/docs/wiki/list-of-plugins

### Caveat :
- By default, only js files in `src` are transpiled as recommended by https://webpack.js.org/guides/build-performance/

### TODO
[ ] autoprefixer with postcss


text:
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ventanas;

/**
 *
 * @author Kaze
 */
public class DialogoEspera extends javax.swing.JDialog {

    /**
     * Creates new form DialogoEspera
     */
    public DialogoEspera(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        initComponents();
        this.setLocationRelativeTo(null);
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Procesando");
        setResizable(false);

        jLabel1.setText("Un momento, por favor...");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(96, 96, 96)
                .addComponent(jLabel1)
                .addContainerGap(97, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(DialogoEspera.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(DialogoEspera.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(DialogoEspera.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(DialogoEspera.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the dialog */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                DialogoEspera dialog = new DialogoEspera(new javax.swing.JFrame(), true);
                dialog.addWindowListener(new java.awt.event.WindowAdapter() {
                    @Override
                    public void windowClosing(java.awt.event.WindowEvent e) {
                        System.exit(0);
                    }
                });
                dialog.setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel jLabel1;
    // End of variables declaration//GEN-END:variables
}


text:
import java.lang.Thread;

public class gcdemo {
    public static void main(String[] args) throws Exception {
	generateGarbage();
	System.out.println("第一次gc,找出垃圾对象DemoClass!");
	System.gc();
	Thread.sleep(1000);

	System.out.println("第二次gc,调用完finalize之后回收垃圾!");
	System.gc();
	Thread.sleep(1000);

	System.out.println("第三次gc!");
	System.gc();
	Thread.sleep(1000);
    }

    public static void generateGarbage() {
	DemoClass g = new DemoClass();
	g.X = 123;
	g.testMethod();
    }
}

class DemoClass {
    public int X;

    public void testMethod() {
	System.out.println("X: " + new Integer(X).toString());
    }

    @Override
    protected void finalize () throws Throwable {
	System.out.println("finalize函数被调用了!");
	// 实现自定义的资源清除逻辑!
	super.finalize();
    }
}


text:
<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

use App\Services\Pagination;
use App\Repositories\News\NewsInterface;
use App\Repositories\News\NewsRepository as News;

/**
 * Class NewsController.
 *
 * @author Phillip Madsen <contact@affordableprogrammer.com>
 */
class NewsController extends Controller
{
    /**
     * @var NewsInterface
     */
    protected $news;

    protected $perPage;

    /**
     * @param NewsInterface $news
     */
    public function __construct(NewsInterface $news)
    {
        $this->news = $news;
        $this->perPage = config('grace.modules.news.per_page');
    }

    /**
     * Display a listing of the resource.
     * @param Request $request
     * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
     */
    public function index(Request $request)
    {
        $pagiData = $this->news->paginate($request->get('page', 1), $this->perPage, false);
        $news = Pagination::makeLengthAware($pagiData->items, $pagiData->totalItems, $this->perPage);

        return view('frontend.news.index', compact('news'));
    }

    /**
     * @param $slug
     * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
     */
    public function show($slug)
    {
        $news = $this->news->getBySlug($slug);

        if ($news == null) {
            return Response::view('errors.missing', [], 404);
        }

        return view('frontend.news.show', compact('news'));
    }
}


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>emr.colour</groupId>
  <artifactId>colour</artifactId>
  <packaging>jar</packaging>
  <version>1.0-SNAPSHOT</version>
  <name>colour</name>
  <url>http://maven.apache.org</url>
  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
	<dependency>
		<groupId>emr.stuff</groupId>
		<artifactId>stuff</artifactId>
		<version>1.0-SNAPSHOT</version>
	</dependency>
  </dependencies>
  <properties>
	<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>
  <build>
	<plugins>
		<plugin>
			<groupId>org.apache.maven.plugins</groupId>
			<artifactId>maven-compiler-plugin</artifactId>
			<version>3.2</version>
			<configuration>
				<source>1.8</source>
				<target>1.8</target>
			</configuration>
		</plugin>
    </plugins>
  </build>
</project>


text:
echo ""
echo "Some parts of the update may need root privileges. These parts are run using sudo."
echo "Testing permission to use sudo..."
if [ "$(sudo whoami)" != 'root' ]; then echo 'You need sudo rights to run the update script, aborting.';
exit 1; fi
echo "Sudo ok"
echo ""

# Update file web location and name
UPDATE_URL_PREFIX=http://bio.nic.funet.fi/pub/sci/molbio/chipster/dist/virtual_machines/updates
MAIN_UPDATE_FILE=update-exec-3.11.0.sh

MAIN_UPDATE_FILE_URL=$UPDATE_URL_PREFIX/$MAIN_UPDATE_FILE

# Remove old update file, if exists
if [ -e $MAIN_UPDATE_FILE ]; then
  sudo rm $MAIN_UPDATE_FILE
fi

# Download latest update file
sudo wget -q $MAIN_UPDATE_FILE_URL

# Check if download was ok
if [ -e $MAIN_UPDATE_FILE ]; then

	# Run update
	sudo chmod a+x $MAIN_UPDATE_FILE
	sudo -u ubuntu ./$MAIN_UPDATE_FILE

	# Clean up
	sudo rm $MAIN_UPDATE_FILE
	exit 0

else

	echo Failed to download latest update file from $MAIN_UPDATE_FILE_URL
	exit 1
fi


text:
package org.thingsboard.server.dao.cassandra.guava;

import com.datastax.oss.driver.api.core.session.Session;
import com.datastax.oss.driver.internal.core.session.SessionWrapper;

public class DefaultGuavaSession extends SessionWrapper implements GuavaSession {

    public DefaultGuavaSession(Session delegate) {
        super(delegate);
    }
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>TESSERAKT Software Appliance (TG/LCR) Registration</title>

        <link rel="stylesheet" type="text/css" href="/media/lcr.inc.css" />
	<link rel="stylesheet" type="text/css" href="/media/lcr.{{ p.id }}.inc.css" />
	<link type="text/css" href="/media/css/ui-lightness/jquery-ui-1.8.1.custom.css" rel="Stylesheet" />

Tesserakt VoIP Appliance Registration

{% block lcrContent %}
{% endblock %}


text:
using System;
using Haven.Resources;
using SharpHaven.Client;
using SharpHaven.Graphics;

namespace SharpHaven.Resources
{
	public class TilesetFactory : IObjectFactory<Tileset>
	{
		private readonly Lazy<TextureAtlas> tileAtlas;

		public TilesetFactory()
		{
			tileAtlas = new Lazy<TextureAtlas>(() => new TextureAtlas(2048, 2048));
		}

		public Tileset Create(string resName, Resource res)
		{
			var data = res.GetLayer<TilesetLayer>();
			var tileset = new Tileset(data);
			foreach (var tile in res.GetLayers<TileLayer>())
			{
				var image = tileAtlas.Value.Add(tile.ImageData);
				tileset.AddTile(tile.Id, tile.Type, tile.Weight, new Picture(image, null));
			}
			return tileset;
		}
	}
}


text:
#include <stdlib.h>
#include <stdarg.h>
#include "device.h"
#include "compiler-polyfill/attributes.h"
#include "mbed-drivers/mbed_error.h"
#if DEVICE_STDIO_MESSAGES
#include <stdio.h>
#endif

__weak void error(const char* format, ...) {
#if DEVICE_STDIO_MESSAGES
    va_list arg;
    va_start(arg, format);
    vfprintf(stderr, format, arg);
    va_end(arg);
#endif
    exit(1);
}


text:
package com.ubuntu.stormcharmconnector;

public class NoConnectionsException extends Exception {

	public NoConnectionsException(String string, Exception e) {
		super(string,e);
	}

	/**
	 *
	 */
	private static final long serialVersionUID = -3234348089362775593L;

}


text:
@interface HTLSettingsDataSource : HTLDataSource

- (BOOL)resetContent;

- (BOOL)resetDefaults;

- (NSString *)exportDataToCSV;

@end


text:
angular.module('Angello.Dashboard')
    .controller('DashboardCtrl',
    function (StoriesModel, STORY_STATUSES, STORY_TYPES) {
        var dashboard = this;
        dashboard.types = STORY_TYPES;
        dashboard.statuses = STORY_STATUSES;
        dashboard.stories = [];

        StoriesModel.all()
            .then(function (stories) {
                var arr = [];
                for (var key in stories) {
                    arr.push(stories[key]);
                }
                dashboard.stories = arr;
            });
    });


text:
<?php
namespace Success\EventBundle\Admin;

use Sonata\AdminBundle\Admin\Admin;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Form\FormMapper;

/**
 * Description of EventTypeAdmin
 *
 * @author develop1
 */
class EventTypeAdmin extends Admin {

    protected function configureFormFields(FormMapper $formMapper)
    {
        $formMapper
            ->add('name', 'text', array('label' => 'Event Name'))
        ;
    }

    protected function configureDatagridFilters(DatagridMapper $datagridMapper)
    {
        $datagridMapper
            ->add('name')
        ;
    }

    protected function configureListFields(ListMapper $listMapper)
    {
        $listMapper
            ->addIdentifier('name')
        ;
    }
}


text:
package org.araneaframework.uilib.form.reader;

import java.util.LinkedList;
import java.util.List;
import org.araneaframework.uilib.form.FormWidget;
import org.araneaframework.uilib.form.formlist.BaseFormListWidget;
import org.araneaframework.uilib.form.formlist.BeanFormListWidget;
import org.araneaframework.uilib.form.formlist.FormRow;

/**
 * This class allows one to read List s from
 * {@link org.araneaframework.uilib.form.formlist.FormListWidget}s.
 *
 * @author Jevgeni Kabanov (ekabanov@araneaframework.org)
 */
public class ListFormReader<K, V> {

  protected BaseFormListWidget<K, V> formList;

  protected Class<V> beanClass;

  /**
   * Creates the class, initializing the composite element to read from.
   *
   * @param formList The composite element to read from.
   */
  public ListFormReader(BaseFormListWidget<K, V> formList) {
    this.formList = formList;
    if (formList instanceof BeanFormListWidget<?, ?>) {
      this.beanClass = ((BeanFormListWidget<K, V>) formList).getBeanClass();
    }
  }

  /**
   * Provides a List> of values read from the list rows forms. The values are retrieved as beans of the
   * class that was defined in the constructor. If the bean class was not defined in the constructor, the values are
   * stored as map entries.
   *
   * @return List> with values (beans or maps) read from the form list rows forms.
   */
  public List<Object> getList() {
    List<Object> result = new LinkedList<Object>();

    for (FormRow<K, V> formRow : this.formList.getFormRows().values()) {
      FormWidget form = formRow.getForm();
      if (this.beanClass != null) {
        BeanFormReader subReader = new BeanFormReader(form);
        result.add(subReader.getBean(beanClass));
      } else {
        MapFormReader subReader = new MapFormReader(form);
        result.add(subReader.getMap());
      }
    }

    return result;
  }
}


text:
FROM ubuntu:14.04

MAINTAINER Brandon Grantham <brandon.grantham@gmail.com>
#updated from mesoscloud repo
#changes: RUN Command has been optimized and base pushed online

RUN apt-key adv --keyserver keyserver.ubuntu.com --recv E56151BF && \
echo deb http://repos.mesosphere.io/ubuntu trusty main > /etc/apt/sources.list.d/mesosphere.list && \
apt-get update && \
apt-get -y install mesos=0.24.1-0.2.35.ubuntu1404 && curl -fLsS https://get.docker.com/ | sh

ENV MESOS_WORK_DIR /tmp/mesos

VOLUME /tmp/mesos

COPY entrypoint.sh /

ENTRYPOINT ["./entrypoint.sh"]