text:
'use strict'

var fs = require('fs')
var path = require('path')
var glob = require('glob')
var hapi = require('hapi')
var inert = require('inert')
var async = require('async')
var partial = require('lodash.partial')
var template = require('lodash.template')
var groupBy = require('lodash.groupby')

var gerberToSvg = require('../lib/gerber-to-svg')

var PORT = 4242
var GERBER_DIR = 'gerber'
var EXPECTED_DIR = 'expected'
var TEMPLATE = 'index.html.template'

var compiledTemplate = template(fs.readFileSync(path.join(__dirname, TEMPLATE)))
var server = new hapi.Server()

var readGerber = function(gerberFile, done) {
  fs.readFile(gerberFile, 'utf8', done)
}

var renderGerber = function(gerberFile, done) {
  var renderOptions = {
    id: path.basename(gerberFile),
    optimizePaths: true
  }

  gerberToSvg(fs.createReadStream(gerberFile), renderOptions, done)
}

var getExpected = function(dirname, basename, done) {
  var dir = dirname.replace(GERBER_DIR + '/', EXPECTED_DIR + '/')
  var expected = path.join(__dirname, dir, basename + '.svg')

  fs.readFile(expected, 'utf8', done)
}

var renderTestFiles = function(done) {
  glob('**/*.@(gbr|drl)', {cwd: __dirname}, function(error, files) {
    if (error) {
      return done(error)
    }

    async.map(files, function(file, next) {
      var dir = path.dirname(file)
      var category = path.basename(dir).split('-').join(' ')
      var ext = path.extname(file)
      var base = path.basename(file, ext)
      var name = base.split('-').join(' ')

      file = path.join(__dirname, file)

      async.parallel({
        gerber: partial(readGerber, file),
        render: partial(renderGerber, file),
        expected: partial(getExpected, dir, base)
      }, function(error, results) {
        if (error) {
          console.error('Error with ' + file + ' : ' + error.message)
          results = {gerber: '', render: '', expected: ''}
        }

        results.name = name
        results.category = category
        next(null, results)
      })
    },
    function(error, results) {
      if (error) {
        return done(error)
      }

      done(null, groupBy(results, 'category'))
    })
  })
}

server.connection({
  port: PORT
})

server.register(inert, function(error) {
  if (error) {
    throw error
  }

  server.route({
    method: 'GET',
    path: '/',
    handler: function(request, reply) {
      renderTestFiles(function(error, suite) {
        if (error) {
          return reply(error)
        }
        reply(compiledTemplate({suite: suite}))
      })
    }
  })

  server.route({
    method: 'GET',
    path: '/style.css',
    handler: {
      file: path.join(__dirname, 'style.css')
    }
  })

  server.start(function() {
    console.log('visual test server running at:', server.info.uri)
  })
})


text:
namespace NorthwindEntities.DB
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel.DataAnnotations;
    using System.ComponentModel.DataAnnotations.Schema;
    using System.Data.Entity.Spatial;

    [Table("Product Sales for 1997")]
    public partial class Product_Sales_for_1997
    {
        [Key]
        [Column(Order = 0)]
        [StringLength(15)]
        public string CategoryName { get; set; }

        [Key]
        [Column(Order = 1)]
        [StringLength(40)]
        public string ProductName { get; set; }

        [Column(TypeName = "money")]
        public decimal? ProductSales { get; set; }
    }
}

redpajama_set_name: RedPajamaGithub


text:
<?php if(!isset($RUN)) { exit(); } ?>
<?php
    if(!access::menu("old_assignments", false) && !access::has("view_local_user_quizzes") && !access::has("view_imp_user_quizzes") && !access::has("view_fb_user_quizzes") && !access::has("view_ldap_user_quizzes"))
    {
        util::redirect("login.php");
        exit();
    }

    $user_mode = 2;
    if(access::has("view_local_user_quizzes") || access::has("view_imp_user_quizzes") || access::has("view_fb_user_quizzes") || access::has("view_ldap_user_quizzes")) $user_mode=1;

    require "extgrid.php";
    require "db/asg_db.php";

    $user_id = access::UserInfo()->user_id;

    if($user_mode==1 && isset($_GET['id']))
    {
	$user_id= util::GetID("?module=assignments");
    }

    $columns_quiz = array("assignment_name"=>"text", "added_date"=>"text","finish_date"=>"text","is_success"=>"text","pass_score"=>"text","total_point"=>"text","level_name"=>"text", "allow_review"=>"test","cert_enabled"=>"text");
    $headers_quiz = array(QUIZ_SURV_NAME,START_DATE,FINISH_DATE,SUCCESS,PASS_SCORE,TOTAL_POINT,LEVEL,VIEW_DETAILS,CERTIFICATE);

    $exp_hedaers = array(QUIZ_SURV_NAME,START_DATE,FINISH_DATE,SUCCESS,PASS_SCORE,TOTAL_POINT,LEVEL,VIEW_DETAILS);
    $exp_columns = array("assignment_name"=>"text", "added_date"=>"text","finish_date"=>"text","is_success"=>"text","pass_score"=>"text","total_point"=>"text","level_name"=>"text", "allow_review"=>"text");

    $query = asgDB::GetOldAssignmentsQuery($user_id,1);

    $grd_quiz = new extgrid($headers_quiz,$columns_quiz, "index.php?module=old_assignments");
    $grd_quiz->exp_headers = $exp_hedaers;
    $grd_quiz->exp_columns = $exp_columns;
    $grd_quiz->grid_control_name="div_grid";
    $grd_quiz->edit=false;
    $grd_quiz->delete=false;
    $grd_quiz->chk_class="chkquiz";
    $grd_quiz->column_override=array("finish_date"=>"finish_date_override","added_date"=>"added_date_override","is_success"=>"success_override", "allow_review"=>"review_override", "cert_enabled"=>"cert_enabled_override","assignment_name"=>"assignment_name_override");

    function added_date_override($row)
    {
        return date('d-m-Y H:i:s', strtotime($row['added_date']));
    }

    function finish_date_override($row)
    {
        return date('d-m-Y H:i:s', strtotime($row['finish_date']));
    }

    function assignment_name_override($row)
    {
        global $user_mode;
        $assignment_name=$row['assignment_name'];
      //  $img_src = $row['asg_image'];
       // if($img_src=="") $img_src = "no.jpg";
        $share_link = "";
        $user_quiz_id=$row['user_quiz_id'];

        if($user_mode==2 && $row['fb_share']!=0 && $row['finish_date']!="") //access::UserInfo()->imported==2 &&
        {
            $share_link = "".util::get_fb_button()."";
        }

        if(isset($_GET['expgrid'])) return $assignment_name;

        $html = "$assignment_name $share_link";
        return $html;
    }

    function success_override($row)
    {
        global $YES_NO;
        return $YES_NO[$row['is_success']];
    }

    function cert_enabled_override($row)
    {
        if($row['cert_enabled']=="0" || $row['success']=="0") return "";

        return "".DOWNLOAD_CERTIFICATE."";
    }

    function review_override($row)
    {
        global $user_mode;
        if(($row['allow_review']=="1" && $row['uq_status']!="1" && $row['uq_status']!="0" ) || $user_mode==1)
        {
            return "".VIEW_DETAILS."";
        }
        else
        {
            return NOT_ENABLED;
        }
    }

    $grd_quiz->DrowTable($query);
    $grid_quiz_html = $grd_quiz->table;

    $columns_surv = array("quiz_name"=>"text", "added_date"=>"text","finish_date"=>"text","allow_review"=>"test");
    $headers_surv = array(QUIZ_SURV_NAME,START_DATE,FINISH_DATE,VIEW_DETAILS);

    $exp_hedaers = array(QUIZ_SURV_NAME,START_DATE,FINISH_DATE,VIEW_DETAILS);

    $query = asgDB::GetOldAssignmentsQuery($user_id,2);
    $grd_surv = new extgrid($headers_surv,$columns_surv, "index.php?module=old_assignments");
    $grd_surv->exp_headers = $exp_hedaers;
    $grd_surv->exp_columns = $columns_surv;
    $grd_surv->grid_control_name="div_surv";
    $grd_surv->edit=false;
    $grd_surv->delete=false;
    $grd_surv->chk_class="chksurvey";
    $grd_surv->column_override=array("finish_date"=>"finish_date_override","added_date"=>"added_date_override","allow_review"=>"review_override");
    $grd_surv->DrowTable($query);
    $grid_surv_html = $grd_surv->table;

    if(isset($_POST['ajax']))
    {
        if($_POST['control_name']=="div_surv")
        {
            echo $grd_surv->table;
        }
        else
        {
            echo $grd_quiz->table;
        }
    }
    if(isset($_GET["expgrid"]))
    {
        if($_GET['cn']==$grd_quiz->grid_control_name) echo $grd_quiz->Export();
        else echo $grd_surv->Export();
    }

    function desc_func()
    {
        return OLD_ASSIGNMENTS;
    }
?>


text:
// Copyright 2017 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//    http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package codeu.chat.client.core;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Iterator;

import codeu.chat.common.BasicController;
import codeu.chat.common.BasicView;
import codeu.chat.common.ConversationHeader;
import codeu.chat.common.ConversationPayload;
import codeu.chat.common.Message;
import codeu.chat.common.User;
import codeu.chat.common.UserType;
import codeu.chat.util.Uuid;

public final class ConversationContext {

  public final User user;
  public final ConversationHeader conversation;

  private final BasicView view;
  private final BasicController controller;

  public ConversationContext(User user,
                             ConversationHeader conversation,
                             BasicView view,
                             BasicController controller) {

    this.user = user;
    this.conversation = conversation;
    this.view = view;
    this.controller = controller;
  }

  public MessageContext add(String messageBody) {

    final Message message = controller.newMessage(user.id,
                                                  conversation.id,
                                                  messageBody);

    return message == null ?
        null :
        new MessageContext(message, view);
  }

  public MessageContext firstMessage() {

    // As it is possible for the conversation to have been updated, so fetch
    // a new copy.
    final ConversationPayload updated = getUpdated();

    return updated == null ?
        null :
        getMessage(updated.firstMessage);
  }

  public int getMessageCount() {
	  MessageContext currentMessage = firstMessage();
	  if (currentMessage == null) {
		  return 0;
	  }
	  int count = 1; // start with first message
	  while(currentMessage != null && currentMessage.next() != null) {
		  currentMessage = currentMessage.next();
		  count++;
	  }
	  return count;
  }

  public MessageContext lastMessage() {

    // As it is possible for the conversation to have been updated, so fetch
    // a new copy.
    final ConversationPayload updated = getUpdated();

    return updated == null ?
        null :
        getMessage(updated.lastMessage);
  }

  // sets access control level of user with given username to UserType type
  // returns true if it was successful
  public boolean setAccessOf(String username, UserType type) {
	  Uuid idOfUser = controller.changeAccessControl(this.user.id, this.conversation.id, username, type);
	  // null if user name is invalid
	  if (idOfUser == null) {
		  return false;
	  }
	  this.conversation.setAccessOf(idOfUser, type);
	  return true;
  }

  private ConversationPayload getUpdated() {
    final Collection<Uuid> ids = Arrays.asList(conversation.id);
    final Iterator<ConversationPayload> payloads = view.getConversationPayloads(ids).iterator();
    return payloads.hasNext() ? payloads.next() : null;
  }

  private MessageContext getMessage(Uuid id) {
    final Iterator<Message> messages = view.getMessages(Arrays.asList(id)).iterator();
    return messages.hasNext() ? new MessageContext(messages.next(), view) : null;
  }

  /**
   * Adds a bot the conversationHeader associated with this context
   * @param botName name of the bot being added
   * @return
   */
  public boolean addBot(String botName) {
	if (controller.addBot(this.conversation.id, botName)) {
	  return true;
	}
	return false;
  }

  /**
   * removes bot from conversationheader associated with this context
   * @param botName name of bot being removed
   * @return
   */
  public boolean removeBot(String botName) {
	if (controller.removeBot(this.conversation.id, botName)) {
		return true;
	}
	return false;
  }

	public Iterable<String> listBots(){
		final Collection<String> allBots = new ArrayList<>(view.getBots());
	    return allBots;
	  }
}


text:
'use strict';

/**
 * @ngdoc service
 * @name angApp.Log
 * @description
 * # Log
 * Service in the angApp.
 */
angular.module('angApp')
        .service('Log', ['$resource', "config", function ($resource, config) {
                var LogModel = $resource(config.itnApiUrl + 'logs', {}, {
                    save: {
                        method: 'POST',
                        headers: {
                            Authorization: true,
                        },
                    }
                }
                );

                this.addLog = function (id) {
                    var newLog = new LogModel({event_id: id});
                    newLog.$save();
                    return true;
                }
            }]);


text:
//
//  NWSTestDialogue.h
//  Spaghetti
//
//  Copyright (c) 2012 noodlewerk. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "NWSDialogue.h"

/**
 * Dialogue stub for testing.
 * @see NWSTestEndpoint
 * @see NWSTestCall
 */
@interface NWSTestDialogue : NWSDialogue

@property (nonatomic, copy) NSString *response;

@end


text:
<!DOCTYPE HTML>

		<meta http-equiv="Content-Type" content="html/html; charset=utf-8" />
		<title>UMSocialControllerServiceComment Class Reference</title>
		<meta id="xcode-display" name="xcode-display" content="render"/>
		<meta name="viewport" content="width=550" />
		<link rel="stylesheet" type="text/css" href="../css/styles.css" media="all" />
		<link rel="stylesheet" type="text/css" media="print" href="../css/stylesPrint.css" />
		<meta name="generator" content="appledoc 2.1 (build 840)" />

UMSocial_SDK

				umeng

UMSocialControllerServiceComment Class Reference

					<button aria-label="Show Table of Contents" role="checkbox" class="open" id="table_of_contents">Table of Contents</button>

					<select id="jumpTo">
	<option value="top">Jump To…</option>

	<option value="overview">Overview</option>

	<option value="tasks">Tasks</option>

	<option value="class_methods">Class Methods</option>

	<option value="//api/name/defaultControllerService">    + defaultControllerService</option>

	<option value="instance_methods">Instance Methods</option>

	<option value="//api/name/getSocialCommentListController">    - getSocialCommentListController</option>

	<option value="//api/name/getSocialViewController:withSnsType:">    - getSocialViewController:withSnsType:</option>

	<option value="//api/name/initWithUMSocialData:">    - initWithUMSocialData:</option>

</select>

Overview

Tasks

Class Methods

defaultControllerService

Instance Methods

getSocialCommentListController

getSocialViewController:withSnsType:

initWithUMSocialData:

Index

Hierarchy

UMSocialControllerServiceComment Class Reference

	Inherits from
	UMSocialControllerService : NSObject

	Declared in
	UMSocialControllerServiceComment.h
UMSocialControllerServiceComment.m

Overview

用此类的方法可以得到分享的有关UI对象,例如分享列表、评论列表、分享编辑页、分享授权页、个人中心页面等。返回都是UINavigationController对象,建议把这个对象present到你要添加到的UIViewController上

Tasks

		+ defaultControllerService

返回一个以[UMSocialData defaultData]来做初始化参数的UMSocialControllerServiceComment对象

		– initWithUMSocialData:

初始化一个UMSocialControllerService对象

		– getSocialCommentListController

评论列表页面,评论列表页面包括各评论详情、评论编辑

		– getSocialViewController:withSnsType:

获取各种页面的UIViewController对象

Class Methods

defaultControllerService

返回一个以[UMSocialData defaultData]来做初始化参数的UMSocialControllerServiceComment对象

+ (UMSocialControllerServiceComment *)defaultControllerService

Return Value

UMSocialControllerServiceComment的默认初始化对象

Declared In

		UMSocialControllerServiceComment.h

Instance Methods

getSocialCommentListController

评论列表页面,评论列表页面包括各评论详情、评论编辑

- (UINavigationController *)getSocialCommentListController

Return Value

UINavigationController对象

Declared In

		UMSocialControllerServiceComment.h

getSocialViewController:withSnsType:

获取各种页面的UIViewController对象

- (UIViewController *)getSocialViewController:(UMSViewControllerType)viewControllerType withSnsType:(NSString *)snsName

Parameters

viewControllerType

页面类型

snsName

编辑页面、授权页面等需要的平台名

Return Value

页面的UIViewController对象

Declared In

		UMSocialControllerService.h

initWithUMSocialData:

初始化一个UMSocialControllerService对象

- (id)initWithUMSocialData:(UMSocialData *)socialData

Parameters

socialData

UMSocialData对象

Return Value

初始化对象

Declared In

		UMSocialControllerService.h

Index

Hierarchy

© 2014 umeng. All rights reserved. (Last updated: 2014-02-08)

						Generated by appledoc 2.1 (build 840).


text:
//THIS IS THE BASIC SHELL TEMPLATE OR INTERFACE FOR ANY FLUX STORE
//THIS HELPS UNDERSTAND THE BASICS OF ACTIONS, DISPATCHERS, and STORES

"use strict";

var Dispatcher = require('../dispatcher/appDispatcher');
var ActionTypes = require('../constants/actionTypes');
var EventEmitter = require('events').EventEmitter;
var assign = require('object-assign');  //Ponyfill for ES5 that is part of ES6
var CHANGE_EVENT = 'change';

//EventEmitter.prototype here is like a base class
var AuthorStore = assign({}, EventEmitter.prototype, {
    //store helper functions
    addChangeListener: function(callback) {
        this.on(CHANGE_EVENT, callback);
    },

    removeChangeListener: function(callback) {
        this.removeChangeListener(CHANGE_EVENT, callback);
    },

    emitChange: function() {
        this.emit(CHANGE_EVENT);
    }

});

//concern private to the store where this implementation detail
//that just registers the store with the dispatcher
Dispatcher.register(function(action) {
    //switch (action.actionType) {
    //case true:

    //default:
    //}
});

module.exports = AuthorStore;


text:
package net.jackofalltrades.workflow.model.xml;

import com.intellij.psi.PsiClass;
import com.intellij.util.xml.DomElement;
import com.intellij.util.xml.GenericAttributeValue;
import com.intellij.util.xml.Required;

/**
 * Defines the structure of the "validator" element.
 *
 * @author bhandy
 */
public interface Validator extends DomElement, ArgumentHolder {

    GenericAttributeValue<String> getId();

    @Required
    GenericAttributeValue<PsiClass> getType();

    GenericAttributeValue<String> getName();

}


text:
<?php

namespace YellowCube\Util;

class YellowCubeException extends \InvalidArgumentException
{

    public function __construct($message = "", $code = 0, \Exception $previous = null)
    {
        parent::__construct($message, $code, $previous);
    }
}


text:
"""
Fast checking to see if graphs are not isomorphic.

This isn't a graph isomorphism checker.
"""
__author__ = """Pieter Swart (swart@lanl.gov)\nDan Schult (dschult@colgate.edu)"""
#    Copyright (C) 2004-2008 by
#    Aric Hagberg <hagberg@lanl.gov>
#    Dan Schult <dschult@colgate.edu>
#    Pieter Swart <swart@lanl.gov>
#    All rights reserved.
#    BSD license.

import networkx as nx
from networkx.exception import NetworkXException, NetworkXError

__all__ = ['could_be_isomorphic',
           'fast_could_be_isomorphic',
           'faster_could_be_isomorphic',
           'is_isomorphic']

def could_be_isomorphic(G1,G2):
    """Returns False if graphs are definitely not isomorphic.
    True does NOT guarantee isomorphism.

    Parameters
    ----------
    G1, G2 : NetworkX graph instances
       The two graphs G1 and G2 must be the same type.

    Notes
    -----
    Checks for matching degree, triangle, and number of cliques sequences.
    """

    # Check global properties
    if G1.order() != G2.order(): return False

    # Check local properties
    d1=G1.degree()
    t1=nx.triangles(G1)
    c1=nx.number_of_cliques(G1)
    props1=[ [d1[v], t1[v], c1[v]] for v in d1 ]
    props1.sort()

    d2=G2.degree()
    t2=nx.triangles(G2)
    c2=nx.number_of_cliques(G2)
    props2=[ [d2[v], t2[v], c2[v]] for v in d2 ]
    props2.sort()

    if props1 != props2:
#        print props1
#        print props2
        return False

    # OK...
    return True

graph_could_be_isomorphic=could_be_isomorphic

def fast_could_be_isomorphic(G1,G2):
    """Returns False if graphs are definitely not isomorphic.
    True does NOT guarantee isomorphism.

    Parameters
    ----------
    G1, G2 : NetworkX graph instances
       The two graphs G1 and G2 must be the same type.

    Notes
    -----
    Checks for matching degree and triangle sequences.
    """

    # Check global properties
    if G1.order() != G2.order(): return False

    # Check local properties
    d1=G1.degree()
    t1=nx.triangles(G1)
    props1=[ [d1[v], t1[v]] for v in d1 ]
    props1.sort()

    d2=G2.degree()
    t2=nx.triangles(G2)
    props2=[ [d2[v], t2[v]] for v in d2 ]
    props2.sort()

    if props1 != props2: return False

    # OK...
    return True

fast_graph_could_be_isomorphic=fast_could_be_isomorphic

def faster_could_be_isomorphic(G1,G2):
    """Returns False if graphs are definitely not isomorphic.
    True does NOT guarantee isomorphism.

    Parameters
    ----------
    G1, G2 : NetworkX graph instances
       The two graphs G1 and G2 must be the same type.

    Notes
    -----
    Checks for matching degree sequences.
    """

    # Check global properties
    if G1.order() != G2.order(): return False

    # Check local properties
    d1=list(G1.degree().values())
    d1.sort()
    d2=list(G2.degree().values())
    d2.sort()

    if d1 != d2: return False

    # OK...
    return True

faster_graph_could_be_isomorphic=faster_could_be_isomorphic

def is_isomorphic(G1,G2,weighted=False,rtol=1e-6,atol=1e-9):
    """Returns True if the graphs G1 and G2 are isomorphic and False otherwise.

    Parameters
    ----------
    G1, G2: NetworkX graph instances
       The two graphs G1 and G2 must be the same type.

    weighted: bool, optional
       Optionally check isomorphism for weighted graphs.
       G1 and G2 must be valid weighted graphs.

    rtol: float, optional
        The relative error tolerance when checking weighted edges

    atol: float, optional
        The absolute error tolerance when checking weighted edges

    Notes
    -----
    Uses the vf2 algorithm.
    Works for Graph, DiGraph, MultiGraph, and MultiDiGraph

    See Also
    --------
    isomorphvf2()

    """
    gm=None
    if weighted==True:
#        assert(G1.weighted and G2.weighted)
        if not G1.is_directed() and not G1.is_multigraph():
            assert(not G2.is_directed() and not G2.is_multigraph())
            gm = nx.WeightedGraphMatcher(G1,G2,rtol,atol)
        elif not G1.is_directed() and G1.is_multigraph():
            assert(not G2.is_directed() and G2.is_multigraph())
            gm = nx.WeightedMultiGraphMatcher(G1,G2,rtol,atol)
        elif G1.is_directed() and not G1.is_multigraph():
            assert(G2.is_directed() and not G2.is_multigraph())
            gm = nx.WeightedDiGraphMatcher(G1,G2,rtol,atol)
        else:
            assert(G2.is_directed() and G2.is_multigraph())
            gm = nx.WeightedMultiDiGraphMatcher(G1,G2,rtol,atol)
    else:
        if G1.is_directed() and G2.is_directed():
            gm=  nx.DiGraphMatcher(G1,G2)
        elif not (G1.is_directed() and G2.is_directed()):
            gm = nx.GraphMatcher(G1,G2)
    if gm==None:
        # Graphs are of mixed type. We could just return False,
        # but then there is the case of completely disconnected graphs...
        # which could be isomorphic.
        raise NetworkXError("Graphs G1 and G2 are not of the same type.")

    return gm.is_isomorphic()


text:
package org.nocket.component.table;

import gengui.annotations.Prompt;
import gengui.domain.DomainClassReference;
import gengui.domain.DomainObjectReference;
import gengui.guibuilder.DomainClassDecoration;
import gengui.util.AnnotationHelper;

import java.io.Serializable;
import java.lang.reflect.Method;
import java.text.MessageFormat;
import java.util.List;

import org.apache.commons.lang.StringUtils;
import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.ResourceModel;
import org.nocket.gen.domain.element.MultivalueColumnElement;
import org.nocket.gen.i18n.I18NLabelModel;
import org.nocket.gen.page.element.FormElement;
import org.nocket.gen.page.element.TableElement;
import org.nocket.gen.page.element.synchronizer.TableButtonCallback;
import org.nocket.gen.page.element.synchronizer.TableDownloadCallback;
import org.nocket.gen.page.visitor.bind.builder.components.TableExampleStructureAdopter;

// TODO: Auto-generated Javadoc
/**
 * The Class GeneratedGenericDataTableColumnConfigurator.
 *
 * @param <T> the generic type
 */
public class GeneratedGenericDataTableColumnConfigurator<T extends Serializable> extends
GenericDataTableColumnConfigurator<T> {

    /** The Constant serialVersionUID. */
    private static final long serialVersionUID = 1L;

    /** The Constant ICON_ENABLED. */
    public static final String ICON_ENABLED = "{0}.icon.enabled";

    /** The Constant ICON_DISABLED. */
    public static final String ICON_DISABLED = "{0}.icon.disabled";

    /** The Constant GG_TABLE_HEADER. */
    public static final String GG_TABLE_HEADER = "{0}.table.header";

    /** The table buttons. */
    protected final List<TableButtonCallback> tableButtons;

    /** The download columns. */
    protected final List<TableDownloadCallback> downloadColumns;

    /** The form. */
    protected final Form<?> form;

    /** The e. */
    protected transient TableElement e;

    /**
     * Instantiates a new generated generic data table column configurator.
     *
     * @param columns the columns
     * @param sortableColumns the sortable columns
     * @param downloadColumns the download columns
     * @param tableButtons the table buttons
     * @param form the form
     * @param e the e
     */
    public GeneratedGenericDataTableColumnConfigurator(List<String> columns, List<String> sortableColumns,
	    List<TableDownloadCallback> downloadColumns, List<TableButtonCallback> tableButtons, Form<?> form,
	    TableElement e) {
	super(columns, sortableColumns);
	this.tableButtons = tableButtons;
	this.downloadColumns = downloadColumns;
	this.form = form;
	this.e = e;
    }

    /**
     * Instantiates a new generated generic data table column configurator.
     *
     * @param e the e
     */
    public GeneratedGenericDataTableColumnConfigurator(TableElement e) {
	this(e.getDomainElement().getPropertyColumnNames(), e.getDomainElement().getPropertyColumnNames(), e
		.getDownloadCallbacks(), e.getButtonCallbacks(), (Form<?>) e.getContext().getComponentRegistry()
		.getComponent(FormElement.DEFAULT_WICKET_ID), e);
    }

    /* (non-Javadoc)
     * @see org.nocket.component.table.GenericDataTableColumnConfigurator#newDataColumns(java.util.List)
     */
    @Override
    protected void newDataColumns(List<IColumn<T, String>> colDefs) {
	TableExampleStructureAdopter tableStructureAdopter = new TableExampleStructureAdopter(e);
	for (String column : this.columns) {
	    String sort = null;
	    if (sortable == null || sortable.contains(column)) {
		sort = column;
	    }
	    GenericDataTablePanelPropertyColumn<T> col = (GenericDataTablePanelPropertyColumn<T>) createPropertyColumn(
		    column, sort);
	    col.setColumnStyle(tableStructureAdopter.findStyleForColumn(column));
	    colDefs.add(col);
	}
    }

    /* (non-Javadoc)
     * @see org.nocket.component.table.GenericDataTableColumnConfigurator#newActionColumns(java.util.List)
     */
    @Override
    protected void newActionColumns(List<IColumn<T, String>> colDefs) {
	addDownloadColumns(colDefs);
	addTableButtonCallbacks(colDefs);
    }

    /**
     * Adds the download columns.
     *
     * @param colDefs the col defs
     */
    protected void addDownloadColumns(List<IColumn<T, String>> colDefs) {
	if (downloadColumns == null)
	    return;
	TableExampleStructureAdopter tableStructureAdopter = new TableExampleStructureAdopter(e);
	for (TableDownloadCallback downloadColumn : downloadColumns) {
	    final IModel<String> header = getDownloadColumnNameModel(downloadColumn);
	    final String enabledIconResource = MessageFormat.format(ICON_ENABLED, downloadColumn.getWicketId());
	    final String disabledIconResource = MessageFormat.format(ICON_DISABLED, downloadColumn.getWicketId());

	    GeneratedDownloadByPropertyIconColumn<T> column = new GeneratedDownloadByPropertyIconColumn<T>(header,
		    downloadColumn, enabledIconResource,
		    disabledIconResource);
	    column.setColumnStyle(tableStructureAdopter.findStyleForColumn(downloadColumn.getPropertyName()));
	    colDefs.add(column);
	}
    }

    /**
     * Adds the table button callbacks.
     *
     * @param colDefs the col defs
     */
    protected void addTableButtonCallbacks(List<IColumn<T, String>> colDefs) {
	if (tableButtons == null)
	    return;
	TableExampleStructureAdopter tableStructureAdopter = new TableExampleStructureAdopter(e);
	for (final TableButtonCallback tableButton : tableButtons) {
	    final IModel<String> header = getButtonColumnNameModel(tableButton);
	    final String enabledIconResource = MessageFormat.format(ICON_ENABLED, tableButton.getWicketId());
	    final String disabledIconResource = MessageFormat.format(ICON_DISABLED, tableButton.getWicketId());

	    if (tableButton.isDownloadMethod()) {
		GeneratedDownloadByMethodIconColumn<T> column = new GeneratedDownloadByMethodIconColumn<T>(
			header, enabledIconResource, disabledIconResource, tableButton);
		column.setColumnStyle(tableStructureAdopter.findStyleForColumn(tableButton.getName()));
		colDefs.add(column);
	    } else {
		GeneratedAjaxSubmitActionIconColumn<T> column = new GeneratedAjaxSubmitActionIconColumn<T>(
			header, form, enabledIconResource, disabledIconResource, tableButton);
		column.setColumnStyle(tableStructureAdopter.findStyleForColumn(tableButton.getName()));
		colDefs.add(column);
	    }
	}
    }

    /**
     * Returns name of the column with button. Depends on localization mode.
     *
     * @param button the button
     * @return the button column name model
     */
    protected IModel<String> getButtonColumnNameModel(TableButtonCallback button) {
	if (e.getContext().getConfiguration().isLocalizationWicket()) {
	    return new ResourceModel(button.getWicketId(), button.getPrompt());
	} else {
	    String prompt = getPromptForColumn(e.getDomainElement().getColumnAccessor().getClassRef(),
		    button.getMethod(), button.getPrompt());
	    if (prompt != null) {
		return new I18NLabelModel(getDomainClassReferenceForTable().getDomainClass(), prompt, button
			.getPrompt());
	    }
	    return new I18NLabelModel(getDomainClassReferenceForTable().getDomainClass(),
		    MessageFormat.format(GG_TABLE_HEADER, button.getMethod().getName()), button.getPrompt());
	}
    }

    /**
     * Gets the download column name model.
     *
     * @param download the download
     * @return the download column name model
     */
    protected IModel<String> getDownloadColumnNameModel(TableDownloadCallback download) {
	if (e.getContext().getConfiguration().isLocalizationWicket()) {
	    return new ResourceModel(download.getPropertiesWicketId(), download.getPrompt());
	} else {
	    String prompt = getPromptForColumn(e.getDomainElement().getColumnAccessor().getClassRef(),
		    download.getMethod(), download.getPrompt());
	    if (prompt != null) {
		return new I18NLabelModel(getDomainClassReferenceForTable().getDomainClass(), prompt, download
			.getPrompt());
	    }
	    return new I18NLabelModel(getDomainClassReferenceForTable().getDomainClass(),
		    MessageFormat.format(GG_TABLE_HEADER, download.getPropertyName()), download.getPrompt());
	}
    }

    /**
     * Returns name of the column with normal property. Depends on localization
     * mode.
     *
     * @param property the property
     * @return the column name model
     */
    @Override
    protected IModel<String> getColumnNameModel(String property) {
	if (e.getContext().getConfiguration().isLocalizationWicket()) {
	    return new UpperAndLowerCaseResourceModel(getTable().getId() + ".columns.", property);
	} else {
	    MultivalueColumnElement<DomainObjectReference> columnElement = getColumnElementForProperty(property);
	    String prompt = getPromptForColumn(e.getDomainElement().getColumnAccessor().getClassRef(),
		    columnElement.getMethod(), columnElement.getPrompt());
	    if (prompt != null) {
		return new I18NLabelModel(getDomainClassReferenceForTable().getDomainClass(),
			getTableHeaderKey(prompt), columnElement.getPrompt());
	    }
	    return new I18NLabelModel(getDomainClassReferenceForTable().getDomainClass(),
		    getTableHeaderKey(StringUtils.capitalize(property)), columnElement.getPrompt());
	}
    }

    /**
     * Gets the domain class reference for table.
     *
     * @return the domain class reference for table
     */
    protected DomainClassReference getDomainClassReferenceForTable() {
	return e.getDomainElement().getColumnAccessor().getClassRef();
    }

    /**
     * Gets the column element for property.
     *
     * @param property the property
     * @return the column element for property
     */
    protected MultivalueColumnElement<DomainObjectReference> getColumnElementForProperty(String property) {
	property = StringUtils.capitalize(property);
	List<MultivalueColumnElement<DomainObjectReference>> columns = e.getDomainElement().getColumns();
	for (MultivalueColumnElement<DomainObjectReference> column : columns) {
	    if (column.getPropertyName().equals(property)) {
		return column;
	    }
	}
	return null;
    }

    /**
     * Gets the prompt for column.
     *
     * @param classRef the class ref
     * @param method the method
     * @param defaultBase the default base
     * @return the prompt for column
     */
    public String getPromptForColumn(DomainClassReference classRef, Method method, String defaultBase) {
	DomainClassDecoration interception = classRef.getDecorations(defaultBase);
	method = interception.getTarget(method.getName(), method);
	Prompt prompt = new AnnotationHelper(method).getAnnotation(Prompt.class);
	if (prompt != null)
	    return prompt.value();
	return null;
    }

    /**
     * Gets the table header key.
     *
     * @param key the key
     * @return the table header key
     */
    private String getTableHeaderKey(String key) {
	return MessageFormat.format(GG_TABLE_HEADER, key);
    }
}


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package sferenetsfsextension;

import com.smartfoxserver.v2.core.ISFSEvent;
import com.smartfoxserver.v2.core.SFSEventParam;
import com.smartfoxserver.v2.entities.Room;
import com.smartfoxserver.v2.entities.SFSRoomRemoveMode;
import com.smartfoxserver.v2.entities.User;
import com.smartfoxserver.v2.entities.data.ISFSObject;
import com.smartfoxserver.v2.entities.data.SFSObject;
import com.smartfoxserver.v2.entities.variables.SFSRoomVariable;
import com.smartfoxserver.v2.exceptions.SFSException;
import com.smartfoxserver.v2.extensions.BaseClientRequestHandler;
import com.smartfoxserver.v2.extensions.BaseServerEventHandler;
import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author Ninfea
 */
public class OnUserGoneHandler extends BaseServerEventHandler{

    @Override
    public void handleServerEvent(ISFSEvent event) throws SFSException {
        User user = (User) event.getParameter(SFSEventParam.USER);
        Room room=(Room) event.getParameter(SFSEventParam.ROOM);

       SfereNetSfsExtension ext = (SfereNetSfsExtension) this.getParentExtension();
        Mondo mondo=ext.world;

        if(user==mondo.utenteOwner)     {

           send("ownOut", new SFSObject(),room.getUserList());
            trace("owner Uscito");
        }
        Player player=mondo.dizionarioUtentiPlayer.get(user);
        if(player!=null)  {
            if ( player.SalvaDati(ext)){
                trace("dati player salvati");
            }else
                trace("dati player non salvati");
            int numeroSpawnLibero=player.numeroSpawn;
            mondo.listaSpawnPointLiberi.add(numeroSpawnLibero);
            mondo.RiordinaListaSpawnPoint();
             if(mondo.listaUtentiPronti.contains(user.getId())){
                 mondo.numeroUtentiPronti--;
                 player.pronto=false;
               mondo.listaUtentiPronti.remove(user);

            }
            mondo.dizionarioUtentiPlayer.remove(user);

            trace("l'utente: "+user+" è stato rimosso dal dizionario utenti/player perchè non è più in gioco.");

        }
    }

    }


text:
namespace Recommendations
{
    using System;
    using System.IO;
    using System.Net.Http;
    using Newtonsoft.Json;
    using System.Net.Http.Formatting;
    using System.Linq;
    using System.Threading;

    /// <summary>
    /// A wrapper class to invoke Recommendations REST APIs
    /// </summary>
    public class RecommendationsApiWrapper
    {
        private readonly HttpClient _httpClient;
        public string BaseUri;

        /// <summary>
        /// Constructor that initializes the Http Client.
        /// </summary>
        /// <param name="accountKey">The account key</param>
        public RecommendationsApiWrapper(string accountKey, string baseUri)
        {
            BaseUri = baseUri;

            _httpClient = new HttpClient
            {
                BaseAddress = new Uri(BaseUri),
                Timeout = TimeSpan.FromMinutes(5),
                DefaultRequestHeaders =
                {
                    {"Ocp-Apim-Subscription-Key", accountKey}
                }
            };
        }

        /// <summary>
        /// Creates a new model.
        /// </summary>
        /// <param name="modelName">Name for the model</param>
        /// <param name="description">Description for the model</param>
        /// <returns>Model Information.</returns>
        public ModelInfo CreateModel(string modelName, string description = null)
        {
            var uri = BaseUri + "/models/";
            var modelRequestInfo = new ModelRequestInfo { ModelName = modelName, Description = description };
            var response = _httpClient.PostAsJsonAsync(uri, modelRequestInfo).Result;

            if (!response.IsSuccessStatusCode)
            {
                throw new Exception(String.Format("Error {0}: Failed to create model {1}, \n reason {2}",
                    response.StatusCode, modelName, ExtractErrorInfo(response)));
            }

            var jsonString = ExtractReponse(response);
            var modelInfo = JsonConvert.DeserializeObject<ModelInfo>(jsonString);
            return modelInfo;
        }

        /// <summary>
        /// Upload catalog items to a model.
        /// </summary>
        /// <param name="modelId">Unique identifier of the model</param>
        /// <param name="catalogFilePath">Catalog file path</param>
        /// <param name="catalogDisplayName">Name for the catalog</param>
        /// <returns>Statistics about the catalog import operation.</returns>
        public CatalogImportStats UploadCatalog(string modelId, string catalogFilePath, string catalogDisplayName)
        {
            Console.WriteLine("Uploading " + catalogDisplayName + " ...");
            string uri = BaseUri + "/models/" + modelId + "/catalog?catalogDisplayName=" + catalogDisplayName;
            using (var filestream = new FileStream(catalogFilePath, FileMode.Open, FileAccess.Read))
            {
                var response = _httpClient.PostAsync(uri, new StreamContent(filestream)).Result;

                if (!response.IsSuccessStatusCode)
                {
                    throw new Exception(
                        String.Format("Error {0}: Failed to import catalog items {1}, for model {2} \n reason {3}",
                            response.StatusCode, catalogFilePath, modelId, ExtractErrorInfo(response)));
                }

                var jsonString = ExtractReponse(response);
                var catalogImportStats = JsonConvert.DeserializeObject<CatalogImportStats>(jsonString);
                return catalogImportStats;
            }
        }

        /// <summary>
        /// Upload usage data to a model.
        /// Usage files must be less than 200 MB.
        /// If you need to upload more than 200 MB, you may call this function multiple times.
        /// </summary>
        /// <param name="modelId">Unique identifier of the model</param>
        /// <param name="usageFilePath">Usage file path</param>
        /// <param name="usageDisplayName">Name for the usage data being uploaded</param>
        /// <returns>Statistics about the usage upload operation.</returns>
        public UsageImportStats UploadUsage(string modelId, string usageFilePath, string usageDisplayName)
        {
            Console.WriteLine("Uploading " + usageDisplayName + " ...");

            string uri = BaseUri + "/models/" + modelId + "/usage?usageDisplayName=" + usageDisplayName;

            using (var filestream = new FileStream(usageFilePath, FileMode.Open, FileAccess.Read))
            {
                var response = _httpClient.PostAsync(uri, new StreamContent(filestream)).Result;
                if (!response.IsSuccessStatusCode)
                {
                    throw new Exception(
                        String.Format("Error {0}: Failed to import usage data {1}, for model {2} \n reason {3}",
                            response.StatusCode, usageFilePath, modelId, ExtractErrorInfo(response)));
                }

                var jsonString = ExtractReponse(response);
                var usageImportStats = JsonConvert.DeserializeObject<UsageImportStats>(jsonString);
                return usageImportStats;
            }
        }

        /// <summary>
        /// Submit a model build, with passed build parameters.
        /// </summary>
        /// <param name="modelId">Unique identifier of the model</param>
        /// <param name="buildRequestInfo">Build parameters</param>
        /// <param name="operationLocationHeader">Build operation location</param>
        /// <returns>The build id.</returns>
        public long BuildModel(string modelId, BuildRequestInfo buildRequestInfo, out string operationLocationHeader)
        {
            string uri = BaseUri + "/models/" + modelId + "/builds";
            var response = _httpClient.PostAsJsonAsync(uri, buildRequestInfo).Result;
            var jsonString = response.Content.ReadAsStringAsync().Result;

            if (!response.IsSuccessStatusCode)
            {
                throw new Exception(String.Format("Error {0}: Failed to start build for model {1}, \n reason {2}",
                    response.StatusCode, modelId, ExtractErrorInfo(response)));
            }

            operationLocationHeader = response.Headers.GetValues("Operation-Location").FirstOrDefault();
            var buildModelResponse = JsonConvert.DeserializeObject<BuildModelResponse>(jsonString);
            return buildModelResponse.BuildId;
        }

        /// <summary>
        /// Delete a certain build of a model.
        /// </summary>
        /// <param name="modelId">Unique identifier of the model</param>
        /// <param name="buildId">Unique identifier of the build</param>
        public void DeleteBuild(string modelId, long buildId)
        {
            string uri = BaseUri + "/models/" + modelId + "/builds/" + buildId;
            var response = _httpClient.DeleteAsync(uri).Result;
            if (!response.IsSuccessStatusCode)
            {
                throw new Exception(
                    String.Format("Error {0}: Failed to delete buildId {1} for modelId {2}, \n reason {3}",
                        response.StatusCode, buildId, modelId, ExtractErrorInfo(response)));
            }
        }

        /// <summary>
        /// Delete a model, also the associated catalog/usage data and any builds.
        /// </summary>
        /// <param name="modelId">Unique identifier of the model</param>
        public void DeleteModel(string modelId)
        {
            string uri = BaseUri + "/models/" + modelId;
            var response = _httpClient.DeleteAsync(uri).Result;
            if (!response.IsSuccessStatusCode)
            {
                throw new Exception(
                    String.Format("Error {0}: Failed to delete modelId {1}, \n reason {2}",
                        response.StatusCode, modelId, ExtractErrorInfo(response)));
            }
        }

        /// <summary>
        /// Trigger a recommendation build for the given model.
        /// Note: unless configured otherwise the u2i (user to item/user based) recommendations are enabled too.
        /// </summary>
        /// <param name="modelId">the model id</param>
        /// <param name="buildDescription">a description for the build</param>
        /// <param name="enableModelInsights"> true to enable modeling insights, selects "LastEventSplitter" as the splitting strategy by default. </param>
        /// <param name="operationLocationHeader">operation location header, can be used to cancel the build operation and to get status.</param>
        /// <returns>Unique indentifier of the build initiated.</returns>
        public long CreateRecommendationsBuild(string modelId,
                                               string buildDescription,
                                               bool enableModelInsights,
                                               out string operationLocationHeader)
        {
            // only used if splitter strategy is set to RandomSplitter
            var randomSplitterParameters = new RandomSplitterParameters()
            {
                RandomSeed = 0,
                TestPercent = 10
            };

            var parameters = new RecommendationBuildParameters()
            {
                NumberOfModelIterations = 10,
                NumberOfModelDimensions = 20,
                ItemCutOffLowerBound = 1,
                EnableModelingInsights = enableModelInsights,
                SplitterStrategy = SplitterStrategy.LastEventSplitter,
                RandomSplitterParameters = randomSplitterParameters,
                EnableU2I = true,
                UseFeaturesInModel = false,
                AllowColdItemPlacement = false,
            };

            var requestInfo = new BuildRequestInfo()
            {
                BuildType = BuildType.Recommendation,
                BuildParameters = new BuildParameters()
                {
                    Recommendation = parameters
                },
                Description = buildDescription
            };

            return BuildModel(modelId, requestInfo, out operationLocationHeader);
        }

        /// <summary>
        /// Trigger a recommendation build for the given model.
        /// Note: unless configured otherwise the u2i (user to item/user based) recommendations are enabled too.
        /// </summary>
        /// <param name="modelId">the model id</param>
        /// <param name="buildDescription">a description for the build</param>
        /// <param name="operationLocationHeader">operation location header, can be used to cancel the build operation and to get status.</param>
        /// <returns>Unique indentifier of the build initiated.</returns>
        public long CreateFbtBuild(string modelId, string buildDescription, bool enableModelInsights, out string operationLocationHeader)
        {

            // only used if splitter strategy is set to RandomSplitter
            var randomSplitterParameters = new RandomSplitterParameters()
            {
                RandomSeed = 0,
                TestPercent = 10
            };

            var parameters = new FbtBuildParameters()
            {
                MinimalScore = 0,
                SimilarityFunction = FbtSimilarityFunction.Lift,
                SupportThreshold = 3,
                MaxItemSetSize = 2,
                EnableModelingInsights = enableModelInsights,
                SplitterStrategy = SplitterStrategy.LastEventSplitter,
                RandomSplitterParameters = randomSplitterParameters,
            };

            var requestInfo = new BuildRequestInfo()
            {
                BuildType = BuildType.Fbt,
                BuildParameters = new BuildParameters()
                {
                    Fbt = parameters,
                },
                Description = buildDescription
            };

            return BuildModel(modelId, requestInfo, out operationLocationHeader);
        }

        /// <summary>
        /// Monitor build operation status and wait for completion.
        /// </summary>
        /// <param name="locationHeader">The operation location header.</param>
        /// <returns>Build status</returns>
        public OperationInfo<BuildInfo> WaitForBuildCompletion(string locationHeader)
        {
            OperationInfo<BuildInfo> operationInfo;
            while (true)
            {
                var response = _httpClient.GetAsync(locationHeader).Result;
                var jsonString = response.Content.ReadAsStringAsync().Result;
                operationInfo = JsonConvert.DeserializeObject<OperationInfo<BuildInfo>>(jsonString);

                // BuildStatus{Queued,Building,Cancelling,Cancelled,Succeded,Failed}
                Console.WriteLine(" Build Status: {1}. \t Will check again in 10 seconds.", operationInfo.PercentComplete, operationInfo.Status);

                if (operationInfo.Status.Equals("Succeeded") ||
                    operationInfo.Status.Equals("Failed") ||
                    operationInfo.Status.Equals("Cancelled"))
                {
                    break;
                }

                Thread.Sleep(TimeSpan.FromSeconds(10));
            }
            return operationInfo;
        }

        /// <summary>
        /// Set an active build for the model.
        /// </summary>
        /// <param name="modelId">Unique idenfier of the model</param>
        /// <param name="updateActiveBuildInfo"></param>
        public void SetActiveBuild(string modelId, UpdateActiveBuildInfo updateActiveBuildInfo)
        {
            string uri = BaseUri + "/models/" + modelId;
            var content = new ObjectContent<UpdateActiveBuildInfo>(updateActiveBuildInfo, new JsonMediaTypeFormatter());
            var request = new HttpRequestMessage(new HttpMethod("PATCH"), uri) { Content = content };
            var response = _httpClient.SendAsync(request).Result;
            if (!response.IsSuccessStatusCode)
            {
                throw new Exception("Error HTTP Status Code");
            }
        }

        /// <summary>
        /// Get Item to Item (I2I) Recommendations or Frequently-Bought-Together (FBT) recommendations
        /// </summary>
        /// <param name="modelId">The model identifier.</param>
        /// <param name="buildId">The build identifier.</param>
        /// <param name="itemIds"></param>
        /// <param name="numberOfResults"></param>
        /// <returns>
        /// The recommendation sets. Note that I2I builds will only return one item per set.
        /// FBT builds will return more than one item per set.
        /// </returns>
        public RecommendedItemSetInfoList GetRecommendations(string modelId, long buildId, string itemIds, int numberOfResults)
        {
            string uri = BaseUri + "/models/" + modelId + "/recommend/item?itemIds=" + itemIds + "&numberOfResults=" + numberOfResults + "&minimalScore=0";
            var response = _httpClient.GetAsync(uri).Result;

            if (!response.IsSuccessStatusCode)
            {
                throw new Exception(
                    String.Format("Error {0}: Failed to get recommendations for modelId {1}, buildId {2}, Reason: {3}",
                    response.StatusCode, modelId, buildId, ExtractErrorInfo(response)));
            }

            var jsonString = response.Content.ReadAsStringAsync().Result;
            var recommendedItemSetInfoList = JsonConvert.DeserializeObject<RecommendedItemSetInfoList>(jsonString);
            return recommendedItemSetInfoList;
        }

        /// <summary>
        /// Use historical transaction data to provide personalized recommendations for a user.
        /// The user history is extracted from the usage files used to train the model.
        /// </summary>
        /// <param name="modelId">The model identifier.</param>
        /// <param name="buildId">The build identifier.</param>
        /// <param name="userId">The user identifier.</param>
        /// <param name="numberOfResults">Desired number of recommendation results.</param>
        /// <returns>The recommendations for the user.</returns>
        public RecommendedItemSetInfoList GetUserRecommendations(string modelId, long buildId, string userId, int numberOfResults)
        {
            string uri = BaseUri + "/models/" + modelId + "/recommend/user?userId=" + userId + "&numberOfResults=" + numberOfResults;
            var response = _httpClient.GetAsync(uri).Result;

            if (!response.IsSuccessStatusCode)
            {
                throw new Exception(
                    String.Format("Error {0}: Failed to get user recommendations for modelId {1}, buildId {2}, Reason: {3}",
                    response.StatusCode, modelId, buildId, ExtractErrorInfo(response)));
            }

            var jsonString = response.Content.ReadAsStringAsync().Result;
            var recommendedItemSetInfoList = JsonConvert.DeserializeObject<RecommendedItemSetInfoList>(jsonString);
            return recommendedItemSetInfoList;
        }

        /// <summary>
        /// Update model information
        /// </summary>
        /// <param name="modelId">the id of the model</param>
        /// <param name="description">the model description (optional)</param>
        /// <param name="activeBuildId">the id of the build to be active (optional)</param>
        public void SetActiveBuild(string modelId, long activeBuildId)
        {
            var info = new UpdateActiveBuildInfo()
            {
                ActiveBuildId = activeBuildId
            };

            SetActiveBuild(modelId, info);
        }

        /// <summary>
        /// Extract error message from the httpResponse, (reason phrase + body)
        /// </summary>
        /// <param name="response"></param>
        /// <returns></returns>
        private static string ExtractErrorInfo(HttpResponseMessage response)
        {
            string detailedReason = null;
            if (response.Content != null)
            {
                detailedReason = response.Content.ReadAsStringAsync().Result;
            }
            var errorMsg = detailedReason == null ? response.ReasonPhrase : response.ReasonPhrase + "->" + detailedReason;
            return errorMsg;

        }

        /// <summary>
        /// Extract error information from HTTP response message.
        /// </summary>
        /// <param name="response"></param>
        /// <returns></returns>
        internal static string ExtractReponse(HttpResponseMessage response)
        {
            if (response.IsSuccessStatusCode)
            {
                return response.Content.ReadAsStringAsync().Result;
            }
            string detailedReason = null;
            if (response.Content != null)
            {
                detailedReason = response.Content.ReadAsStringAsync().Result;
            }
            var errorMsg = detailedReason == null ? response.ReasonPhrase : response.ReasonPhrase + "->" + detailedReason;

            string error = String.Format("Status code: {0}\nDetail information: {1}", (int)response.StatusCode, errorMsg);
            throw new Exception("Response: " + error);
        }
    }

    /// <summary>
    /// Utility class holding the result of import operation
    /// </summary>
    internal class ImportReport
    {
        public string Info { get; set; }
        public int ErrorCount { get; set; }
        public int LineCount { get; set; }

        public override string ToString()
        {
            return string.Format("successfully imported {0}/{1} lines for {2}", LineCount - ErrorCount, LineCount,
                Info);
        }
    }
}


text:
<?php

namespace AppBundle\Form;

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

class EspecialidadType extends AbstractType
{
    /**
     * {@inheritdoc}
     */
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder->add('nombre')        ;
    }

    /**
     * {@inheritdoc}
     */
    public function configureOptions(OptionsResolver $resolver)
    {
        $resolver->setDefaults(array(
            'data_class' => 'AppBundle\Entity\Especialidad'
        ));
    }

    /**
     * {@inheritdoc}
     */
    public function getBlockPrefix()
    {
        return 'appbundle_especialidad';
    }

}