text:
/**
 *  @file logicFE.h
 *
 *  @date Jul 16, 2017
 *  @author Yuval Hamberg
 *
 *  @brief handle the logic and decision making for the Front End (client side) of whatDown char app.
 */

#ifndef LOGICFE_H_
#define LOGICFE_H_

#include "defines.h"
#include "tcp_client.h"

/* ~~~ Defines ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */

/* ~~~ Globals ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */

/* ~~~ Struct ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
typedef struct Logic_FE Logic_FE_t;

/* ~~~ API function ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */

/**
 * @brief create and setup
 * @param netClient a pointer to the TCP net for client connection
 * @return the pointer to the struct
 */
Logic_FE_t* LogicFE_Create(TCP_C_t* netClient);

/**
 * @brief cleans up after the processing
 * @param _logic
 */
void LogicFE_Destroy(Logic_FE_t* _logic);

/**
 * @brief Handle the send and receive of Signup request and answer to the server.
 * @param _logic the pointer to the module struct.
 * @param _username char* msg
 * @param _password char* msg
 * @return TRUE for success. FALSE for fail
 */
int LogicFE_Signup(Logic_FE_t* _logic, const char* _username, const char* _password);

/**
 * @brief Handle the send and receive of login request and answer to the server.
 * @param _logic the pointer to the module struct.
 * @param _username char* msg
 * @param _password char* msg
 * @return TRUE for success. FALSE for fail
 */
bool LogicFE_Login(Logic_FE_t* _logic, const char* _username, const char* _password);

/**
 * @brief Handle the send and receive of login request and answer to the server.
 * @param _logic the pointer to the module struct.
 * @param _groupName char* the group name to be created.
 * @return TRUE for success. FALSE for fail
 */
int LogicFE_CreateGroup(Logic_FE_t* _logic, const char* _groupName);

/**
 * @brief Handle the send and receive of join an existing group request and answer to the server.
 * @param _logic the pointer to the module struct.
 * @param _groupName char* the group name to be created.
 * @return TRUE for success. FALSE for fail
 */
int LogicFE_JoinGroup(Logic_FE_t* _logic, const char* _groupName);

/**
 * @brief Handle the send and receive of join an existing group request and answer to the server.
 * @param _logic  the pointer to the module struct.
 * @param _GroupsName_out a string with all the groups name. divided by delimiter
 * @param _numOfGroups_out how many group have been read.
 * @param _bufferSize the max size of buffer to be copied to.
 * @return
 */
int LogicFE_GetAllGroupsName(Logic_FE_t* _logic, char* _GroupsName_out, uint* _numOfGroups_out, uint _bufferSize);

/* more function to come */

#endif /* LOGICFE_H_ */


text:
class Course::Assessment::Answer::ForumPostResponse < ApplicationRecord
  acts_as :answer, class_name: Course::Assessment::Answer.name

  # A post pack is a group of 4 objects:
  #  - The core forum post
  #  - The parent post that the core post is replying to, if it exists
  #  - The forum that the post is under
  #  - The topic that the post is under
  #
  # This is mainly to facilitate the passing of related information around, especially
  # for rendering on the client side.
  has_many :post_packs, class_name: Course::Assessment::Answer::ForumPost.name,
                        dependent: :destroy, foreign_key: :answer_id, inverse_of: :answer

  def assign_params(params)
    acting_as.assign_params(params)
    self.answer_text = params[:answer_text] if params[:answer_text]

    return unless params[:selected_post_packs]

    destroy_previous_selection

    params[:selected_post_packs].each do |selected_post_pack|
      create_post_pack selected_post_pack
    end
  end

  def compute_post_packs
    post_packs.each do |selected_post|
      compute_post(selected_post)
      compute_topic(selected_post)
      compute_creator(selected_post)
      compute_parent(selected_post)
    end
  end

  def compare_answer(other_answer)
    return false unless other_answer.is_a?(Course::Assessment::Answer::ForumPostResponse)

    same_text = answer_text == other_answer.answer_text
    same_post_packs_length = post_packs.length == other_answer.post_packs.length

    post_packs = self.post_packs.map { |elem| elem.attributes.except('id', 'answer_id').values.join('_') }
    other_post_packs = other_answer.post_packs.map { |elem| elem.attributes.except('id', 'answer_id').values.join('_') }

    same_post_packs = Set.new(post_packs) == Set.new(other_post_packs)
    same_text && same_post_packs_length && same_post_packs
  end

  def csv_download
    stripped_answer_to_array.to_json
  end

  def download(dir)
    return if post_packs.empty?

    answer_json_path = File.join(dir, 'answer.json')
    File.open(answer_json_path, 'w') do |file|
      json = JSON.pretty_generate(stripped_answer_to_array)
      file.write(json)
    end
  end

  private

  def stripped_answer_to_array
    post_packs.map do |post|
      {
        selectedPost: readable_string_of(post.post_text),
        parentPost: readable_string_of(post.parent_text),
        textAnswer: readable_string_of(answer_text)
      }.compact
    end
  end

  def readable_string_of(text)
    return nil unless text

    cleaned_text = text.gsub('
', "
\n").gsub('
', "
\n").squish
    ActionController::Base.helpers.strip_tags(cleaned_text)
  end

  def destroy_previous_selection
    post_packs.destroy_all
  end

  def create_post_pack(selected_post_pack)
    post_pack = post_packs.new

    post_pack.forum_topic_id = selected_post_pack[:topic][:id]

    post_pack.post_id = selected_post_pack[:corePost][:id]
    post_pack.post_text = selected_post_pack[:corePost][:text]
    post_pack.post_creator_id = selected_post_pack[:corePost][:creatorId]
    post_pack.post_updated_at = selected_post_pack[:corePost][:updatedAt]

    if selected_post_pack[:parentPost]
      post_pack.parent_id = selected_post_pack[:parentPost][:id]
      post_pack.parent_text = selected_post_pack[:parentPost][:text]
      post_pack.parent_creator_id = selected_post_pack[:parentPost][:creatorId]
      post_pack.parent_updated_at = selected_post_pack[:parentPost][:updatedAt]
    end

    post_pack.save!
  end

  def compute_topic(selected_post)
    topic = Course::Forum::Topic.find_by(id: selected_post.forum_topic_id)
    selected_post.is_topic_deleted = topic.nil?
    if topic
      selected_post.topic_title = topic.title
      selected_post.forum_id = topic.forum.id
      selected_post.forum_name = topic.forum.name
    else
      selected_post.topic_title = nil
      selected_post.forum_id = nil
      selected_post.forum_name = nil
    end
  end

  def compute_post(selected_post)
    post = Course::Discussion::Post.find_by(id: selected_post.post_id)
    selected_post.is_post_deleted = post.nil?
    # a deleted post will have is_post_updated = nil
    selected_post.is_post_updated = post ? later?(post.updated_at, selected_post.post_updated_at) : nil
  end

  def compute_creator(selected_post)
    selected_post.post_creator = User.find_by(id: selected_post.post_creator_id)
  end

  def compute_parent(selected_post)
    return unless selected_post.parent_id

    parent = Course::Discussion::Post.find_by(id: selected_post.parent_id)
    selected_post.is_parent_deleted = parent.nil?
    # a post with a deleted parent will have is_parent_updated = nil
    selected_post.is_parent_updated = parent ? later?(parent.updated_at, selected_post.parent_updated_at) : nil
    selected_post.parent_creator = User.find_by(id: selected_post.parent_creator_id)
  end

  # returns true if target_time is later than ref_time by > 0.01s
  # allowing a delta of 0.01s to account for possible truncations in datetime data
  def later?(target_time, ref_time)
    target_time.to_f - ref_time.to_f > 0.01
  end
end

redpajama_set_name: RedPajamaGithub


text:
namespace Bungie.Models
{
    public class CardBrief
    {
        public int CardId { get; set; }
        public int Points { get; set; }
        public int TotalPoints { get; set; }
    }
}


text:
<?xml version="1.0" encoding="UTF-8" ?>
<class name="GLTFAccessor" inherits="Resource" version="4.0">
	<brief_description>
	</brief_description>
	<description>
	</description>
	<tutorials>
	</tutorials>
	<members>
		<member name="buffer_view" type="int" setter="set_buffer_view" getter="get_buffer_view" default="0">
		</member>
		<member name="byte_offset" type="int" setter="set_byte_offset" getter="get_byte_offset" default="0">
		</member>
		<member name="component_type" type="int" setter="set_component_type" getter="get_component_type" default="0">
		</member>
		<member name="count" type="int" setter="set_count" getter="get_count" default="0">
		</member>
		<member name="max" type="PackedFloat64Array" setter="set_max" getter="get_max" default="PackedFloat64Array()">
		</member>
		<member name="min" type="PackedFloat64Array" setter="set_min" getter="get_min" default="PackedFloat64Array()">
		</member>
		<member name="normalized" type="bool" setter="set_normalized" getter="get_normalized" default="false">
		</member>
		<member name="sparse_count" type="int" setter="set_sparse_count" getter="get_sparse_count" default="0">
		</member>
		<member name="sparse_indices_buffer_view" type="int" setter="set_sparse_indices_buffer_view" getter="get_sparse_indices_buffer_view" default="0">
		</member>
		<member name="sparse_indices_byte_offset" type="int" setter="set_sparse_indices_byte_offset" getter="get_sparse_indices_byte_offset" default="0">
		</member>
		<member name="sparse_indices_component_type" type="int" setter="set_sparse_indices_component_type" getter="get_sparse_indices_component_type" default="0">
		</member>
		<member name="sparse_values_buffer_view" type="int" setter="set_sparse_values_buffer_view" getter="get_sparse_values_buffer_view" default="0">
		</member>
		<member name="sparse_values_byte_offset" type="int" setter="set_sparse_values_byte_offset" getter="get_sparse_values_byte_offset" default="0">
		</member>
		<member name="type" type="int" setter="set_type" getter="get_type" default="0">
		</member>
	</members>
</class>


text:
require 'glassfrog/rest/request'

module Glassfrog
  module REST
      #
      # Encapsulates all DELETE requests.
      #
    module Delete
      #
      # Sends a DELETE request.
      # @param client [Glassfrog::Client] Client that will send the request.
      # @param path [String] Path to send request to.
      # @param options [Hash] Options being sent in the request.
      #
      # @return [Boolean] Whether request was successful.
      def self.delete(client, path, options)
        Glassfrog::REST::Request.new(client, :delete, path, options).perform
      end
    end
  end
end


text:
  <form wicket:id="form" id="form1" method="post" action="?wicket:interface=:0:form::IFormSubmitListener::">
<input type="hidden" name="form1_hf_0" id="form1_hf_0" />

    <wicket:enclosure child="label">

    </wicket:enclosure>
  </form>


text:
import { Map } from 'immutable';
import { loop, Effects } from 'redux-loop-symbol-ponyfill';
import {GetMessages,ReadUserMessage, DeleteMessage, SearchMessages, LoadMoreMessages, MarkUserMessage} from './../../services/messageCenterServices';

// Initial state
const initialState = Map({
  value: [],
  loadMore: true
});

// Actions

const REQUEST_GET_MESSAGES = 'DraftState/REQUEST_GET_MESSAGES';
const RESPONSE_GET_MESSAGES = 'DraftState/RESPONSE_GET_MESSAGES';
const REQUEST_READ_USER_MESSAGE = 'DraftState/REQUEST_READ_USER_MESSAGE';
const REQUEST_DELETE_MESSAGE = 'DraftState/REQUEST_DELETE_MESSAGE';
const REQUEST_SEARCH_MESSAGES = 'DraftState/REQUEST_SEARCH_MESSAGES';
const RESPONSE_SEARCH_MESSAGES = 'DraftState/RESPONSE_SEARCH_MESSAGES';
const REQUEST_LOAD_MORE_MESSAGES = 'DraftState/REQUEST_LOAD_MORE_MESSAGES';
const RESPONSE_LOAD_MORE_MESSAGES = 'DraftState/RESPONSE_LOAD_MORE_MESSAGES';
const REQUEST_MARK_MESSAGE='DraftState/REQUEST_MARK_MESSAGE';

// Action creators
export function getMessages(userId, draftType) {
  return {
    type: REQUEST_GET_MESSAGES,
    payload: {
      userId,
      draftType
    }
  };
}

export function readMessage(userMessage,criteriaCollection) {
  return {
    type: REQUEST_READ_USER_MESSAGE,
    payload: {userMessage,criteriaCollection}
  }
}

export function deleteMessage(message,criteriaCollection) {
  return {
    type: REQUEST_DELETE_MESSAGE,
    payload: {message,criteriaCollection}
  };
}

export function searchMessage(criteriaCollection) {
  return {
    type: REQUEST_SEARCH_MESSAGES,
    payload: criteriaCollection
  }
}

export function loadMoreMessages(userMessage) {
  return {
    type: REQUEST_LOAD_MORE_MESSAGES,
    payload: userMessage
  };
}

export function markMessage(userMessage,criteriaCollection){
  userMessage.Mark==='Marked'?userMessage.Mark='UnMark':userMessage.Mark='Marked';
  return{
    type:REQUEST_MARK_MESSAGE,
    payload:{userMessage,criteriaCollection}
  }
}

export async function requestGetMessages(userId, draftType) {
  try {
    const result = await GetMessages(userId, draftType);
    return { type: RESPONSE_GET_MESSAGES, payload: result };
  } catch (err) {
    return { type: RESPONSE_GET_MESSAGES, payload: [] };
  }
}

export async function requestReadUserMessage(userMessage,criteriaCollection) {
  try {
    const result = await ReadUserMessage(userMessage)
    return {
      type: REQUEST_SEARCH_MESSAGES,
      payload: criteriaCollection
    }
  } catch (err) {
    return { type: RESPONSE_GET_MESSAGES, payload: [] }
  }
}

export async function requestDeleteMessage(message,criteriaCollection) {
  try {
    const result = await DeleteMessage(message);
    return {
      type: REQUEST_SEARCH_MESSAGES,
      payload:criteriaCollection
    };
  } catch (error) {
    console.log(error);

  }
}

export async function requestSearchMessage(criteriaCollection) {
  try {
    const result = await SearchMessages(criteriaCollection)
    return {
      type: RESPONSE_SEARCH_MESSAGES,
      payload: result
    }
  } catch (err) {
    return { type: RESPONSE_GET_MESSAGES, payload: [] }
  }
}

export async function requestLoadMoreMessage(userMessage) {
  try {
    const result = await LoadMoreMessages(userMessage)
    return {
      type: RESPONSE_LOAD_MORE_MESSAGES,
      payload: result
    }
  } catch (err) {
    return { type: RESPONSE_GET_MESSAGES, payload: [] }
  }
}

export async function requestMarkUserMessage(userMessage,criteriaCollection){
  try{
    const result=await MarkUserMessage(userMessage)
    return {
      type: REQUEST_SEARCH_MESSAGES,
      payload: criteriaCollection
    }
  }catch(err){
    return {type: RESPONSE_GET_MESSAGES, payload: []}
  }
}

// Reducer
export default function SentStateReducer(state = initialState, action = {}) {
  switch (action.type) {

    case REQUEST_GET_MESSAGES:
      return loop(state, Effects.promise(requestGetMessages, action.payload.userId, action.payload.draftType));

    case RESPONSE_GET_MESSAGES:
      if (action.payload.ModelObject.length == 10) {
        return state.set('loadMore', true).set('value', action.payload.ModelObject);
      } else {
        return state.set('loadMore', false).set('value', action.payload.ModelObject);
      }

    case REQUEST_READ_USER_MESSAGE:
      return loop(state, Effects.promise(requestReadUserMessage, action.payload.userMessage,action.payload.criteriaCollection));

    case REQUEST_DELETE_MESSAGE:
      return loop(state, Effects.promise(requestDeleteMessage, action.payload.message,action.payload.criteriaCollection));

    case REQUEST_SEARCH_MESSAGES:
      return loop(state, Effects.promise(requestSearchMessage, action.payload));

    case RESPONSE_SEARCH_MESSAGES:
      if (action.payload.ModelObject.length == 10) {
        return state.set('value', [...(action.payload.ModelObject || [])]);
      } else {
        return state.set('loadMore', false).set('value', [...(action.payload.ModelObject || [])]);
      }

    case REQUEST_LOAD_MORE_MESSAGES:
      return loop(state, Effects.promise(requestLoadMoreMessage, action.payload));

    case RESPONSE_LOAD_MORE_MESSAGES:
      let oldData = state.get('value');
      let newData = [];
      newData = oldData.concat(action.payload.ModelObject);
      if (action.payload.ModelObject.length == 10) {
        return state.set('loadMore', true).set('value', [...(newData || [])]);

      } else {
        return state.set('loadMore', false).set('value', [...(newData || [])]);
      }

    case REQUEST_MARK_MESSAGE:
      return loop(state,Effects.promise(requestMarkUserMessage,action.payload.userMessage,action.payload.criteriaCollection))

    default:
      return state;
  }
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<title>Friends - 10.10 - The One Where Chandler Gets Caught</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />

Friends

  1010 - The One Where Chandler Gets Caught

Written by: Doty Abrams

  Produced by: Wendy Knoller

  Transcribed by: Coffee Mug, Eleonora, Sebastiano & Vanessa

  Flashback clips transcribed by: Guineapig, Dan Silverstein, Ruth Curran, Eric Aasen and Mindy Mattingly Phillips, and compiled by Eleonora.

  Final check by Kim

[Scene: Central Perk. Everybody's sitting on the couch and Monica is eating a chunk of cake.]

  Monica: (really excited) Mmh... this cake is amazing!

Rachel: My God, get a room!

Monica: I would get a room with this cake. I think I could show this cake a good time!

Phoebe: If you had to, what would you give up, food or sex?

Monica: (with no hesitation) Sex!

Chandler: (looking at her) Seriously, answer faster!

Monica: Oh, I'm sorry honey, you know, but when she said "sex" I wasn't thinking about "sex with you"!

Chandler: (to Phoebe) It's like a giant hug.

Phoebe: Ross, how about you. What would you give up, sex or food?

Ross: Food.

Phoebe: Ok, how about... uhm... sex or dinosaurs?

Ross: Oh my God. It's like Sophie's Choice.

Rachel: Oh God. What about you, Joe? What would you give up, sex or food?

Joey: Uhm... oh... I don't know, it's too hard.

Rachel: No, you gotta pick one!

Joey: Oh... food. No, sex. Food! Sex! Food! Se-I don't know! Good God, I don't know, I want girls on bread!

  OPENING CREDITS

[Scene: Central Perk. Rachel and Phoebe are looking at some photos and they're sitting next to the window.]

Rachel: You gotta see these latest pictures of Emma.

Phoebe: Oh, how cute!

Rachel: Yeah.

Phoebe: Oh, she looks just like a little doll!

Rachel: Oh, no, no. That is a doll.

Phoebe: Oh, thank God, 'cause that thing's really creepy! (looking outside the window) Look, there's Chandler. (he's on the street, talking to a woman)

Rachel: Oh. Who is the blonde, she's pretty.

Phoebe: OH! He's having an affair.

Rachel: He's not having an affair!

Phoebe: You know, I'm always right about these things.

Rachel: No, you're not! Last week you thought Ross was trying to kill you!

Phoebe: Well, I'm sorry but it's hard to believe that anyone would tell a story that dull just to tell it! (looking outside) See, there's something going on with them. Look, he's getting into the car with her!

Rachel: Oh, that doesn't mean anything.

Phoebe: Oh yeah? Well, let's see. (she takes her mobile phone) Ok, duck down. (they both get down to hide themselves. Phoebe calls Chandler)

Chandler: (picking up the phone) Hello.

Phoebe: Oh, hi Chandler. It's Phoebe. Uhm... I know that Monica is working today so...(back to Central Perk) ...I was wondering if you want to come to the movies with me and Rachel.

Chandler: Oh, uhm... I have to work too. Yeah, I'm stuck at the office all day.

Phoebe: (shocked) Oh, well, it's a shame that you-that you miss the movie 'cause we were gonna see, you know, either "Liar, Liar" or "Betrayal", or... "An Affair To Remember".

Chandler: Those are all really old!

Phoebe: Ok, then maybe it'll be, uhm...

Rachel: (whispering) "Dude, Where's My Car?"

Phoebe: (glancing at her) What?

Rachel: They're in a caaar...

Phoebe: (to Chandler at the phone) Okay, we-we'll talk to you later. Okay, bye.

Rachel: Geez!

Phoebe: Ok. Quick. We gotta find a cab and follow them.

Rachel: Oh, yeah, ok. Let me just grab my night vision goggles and my stun gun.

Phoebe: (patting her bag) I got them!

[Scene: Monica’s apartment. Chandler enters the door.]

Chandler: Hi!

Monica: Hey! You smell like perfume and cigarettes.

Chandler: I was in the car with Nancy all day.

Monica: Nancy doesn’t smoke!

Chandler: Well, at least the perfume is not mine, be thankful for that!

Monica: So? What do you think of the house?

Chandler: It’s perfect. It’s everything we’ve been looking for.

Monica: Isn’t it? Then what about the amazing wainscotting and the crown molding and the dormer windows in the attic?

Chandler: And the wiggle wharms and the zip zorps? (pause) What were the things you said?

Monica: Don’t you love the huge yard?

Chandler: And the fireplace in the bedroom.

Monica: And Nancy said that it's really under price, because the guy lost his job and has to move in with his parents!

Chandler: This is bringing out a lovely color in you!

Monica: So? Do you think we should get it?

Chandler: I don’t know. What do you think?

Monica: I think we should.

Chandler: I do too.

Monica: This is huge!

Chandler: I know.

Monica: How bad you wanna smoke, right now.

Chandler: I don’t know what you mean, giant talking cigarette! Oh, by the way, Phoebe called just as I was getting into Nancy’s car, so if she asks you, I was at work all day.

Monica: Gotcha. When do we tell them about this?

Chandler: We don’t. Not until it's a hundred percent. I mean, why upset everybody over nothing.

Monica: Okay. Right. Oh my God that is gonna be so hard.

Chandler: I know. Gooooood luck with it.

[Scene: Joey’s apartment. Everybody except Monica and Chandler is there.]

Ross: I just can’t see Chandler cheating!

Rachel: I’m telling you guys, we followed them out to a house in Westchester, the went in for like forty-five minutes and then they came out looking pretty happy!

Joey: Chandler? Forty-five minutes? Well, something is not right. I just can’t believe he would do this to Monica!

Ross: I know, and with the baby coming?

Phoebe: So, should we tell her?

Ross: I don’t know. Phoebe, if one of us saw Mike with another woman would you want us to tell you?

Phoebe: Why? Who’d you seen him with?

Ross: No one, I’m just saying if... (Phoebe starts pinching him in his neck)

Phoebe: TELL ME WHAT YOU KNOW!

Ross: (yelling in pain) I know nothing! Mike’s a great guy, it was hypothetical!

Phoebe: All right. (she releases him). He is a good guy. You’re right, he wouldn’t cheat.

Ross: Believe me, if I did see with someone, there’s no way I... (Phoebe starts pinching him again)

Phoebe : WHO DID YOU SEE HIM WITH?

[Scene: Monica’s apartment. Monica is cleaning with a vacuum and then she cleans it with a dust buster. The guys enter the room.]

Rachel: Oh, look at her, so happy!

Monica: If only there were a smaller one to clean this one!

Joey: Hey, is uhm... is Chandler here?

Monica: No, he’s picking up dinner, why, what’s up?

Phoebe: Well, look, whatever happens, we’re here for you and we love you.

Monica (puzzled): All right...

Ross: We think Chandler might be having an affair.

Monica: What?

Rachel: Phoebe and I saw Chandler with a blonde woman today outside on the street and then we followed them to a house in Westchester.

Phoebe: They went in together. So sorry.

Monica: Oh my God! Oh my God that’s awful! What did you think of the house?

(they all look confused and sorry for her)

Phoebe: What?

Joey: (walking towards her to hold her and support her) Monica, you understand what we are saying, right?

Monica: Yeah, sure... uhm, I'm devastated, obviously... (to the rest) Did you think the neighborhood was homey? (Chandler enters)

Chandler: Hey!

Joey: (to Chandler) You son of a bitch!

Chandler: Is it me, or have the greetings gone downhill around here?

Monica: (goes to Chandler) Phoebe and Rachel saw you with Nancy today and... em... they think you're having an affair.

Rachel: Who's Nancy?

Ross: What's going on?

Monica: (turns to them) Ok, alright, you guys, you'd better sit down, this is pretty big.

Chandler: Yeah (motions them to sit and they do) I'm not having an affair. Nancy is our realtor.

Joey: I knew he couldn't be with a woman for 45 minutes!!

Phoebe: Why do you have a realtor?

Monica: Uhm, she has been showing us houses outside of the city.

Joey: (clearly shocked) What?

Rachel: Are you serious?

Monica: When we found out that we're gonna get this baby, Chandler and I started talking and we decided that we didn't want to raise a kid in the city.

Phoebe: So you're gonna move?

Ross: Oh my God.

Joey: Shouldn't we all vote on stuff like this?!

Rachel: What is wrong with raising a kid in the city? I'm doing it, Ross is doing it, Sarah Jessica Parker is doing it!

Monica: And that's great for you guys, but we want a lawn and a swingset...

Chandler: ...and a street where our kids can ride their bikes and maybe an ice-cream truck can go by.

Ross: (sarcastic) So you wanna buy a house in the 50's?

Phoebe: Have you thought about what you would be giving up? You can't move out of the city, what if you want Chinese food at 5am? Or a fake Rolex that breaks as soon as it rains or an Asian hooker sent right to your door?

Ross: You know what, if you wanna look for a house, that's okay.

Joey: No, no, it's not, don't listen to him! (to Ross) I'm gonna thump you! (points his fist at him)

Ross: (to Joey) It's ok, because they have to get it out of their system, okay (back to Mon and Chan), but you're going to realize, this is the only place, you wanna be.

(pause before Monica and Chandler speak, they look like they are looking for the right words)

Chandler: Actually, we already found a house we love.

Ross: What?

Monica: And about an hour ago, we made an offer.

(All the friends looked shocked and confused. There is a long silence.)

Chandler: Bet you wish I was having an affair now, huh?

TIME LAPSE

Ross: You put an offer on a house?

Monica: (smiling) It's so sweet. It really is. It has this big yard that leads down to this stream and then there's these old maple trees... (gets cut off)

Phoebe: Wha..? Again with the nature, what are you? Beavers?

Chandler: I know this is really hard and we're really sorry.

Joey: Is this because I come over here without knocking and eat your food? (Walks towards the fridge) Because I can stop doing that, (looks at the fridge) I really, really think I can!

Chandler: (goes towards Joey) You know that's not the reason Joe. (Joey hugs him and after, he takes something from the fridge and puts it in his mouth. He goes back to where he was standing before)

Monica: We think if you saw it, you'd understand. I mean you guys were there. (Points to Rachel and Phoebe) It is beautiful, isn't it?

Rachel: Yeah it is.

Joey: What the hell are you doin'?

Rachel: Well, it is, all right? When we were out there today, all I kept thinking was: I can't believe Chandler is screwing this woman, but MAN this would be a nice place to live!

Phoebe: Yeah, but so is this.

Ross: Yeah, I mean, if you moved there, you have to leave here. I mean, how can you leave this place?

[We fade to some flashback scenes.]

(from 1.01 - "The One Where Monica Gets a New Roommate - The Pilot")

Rachel: (talking on the phone) C'mon Daddy, listen to me! All of my life, everyone has always told me, 'You're a shoe! You're a shoe, you're a shoe, you're a shoe!'. And today I just stopped and I said, 'What if I don't wanna be a shoe? What if I wanna be a- a purse, y'know? Or a- or a hat! No, I don't want you to buy me a hat, I'm saying that I am a ha- It's a metaphor, Daddy!

Ross: You can see where he'd have trouble.

Rachel: Well maybe I'll just stay here with Monica.

Monica: Well, I guess we've established who's staying here with Monica...

(from 1.18 - "The One With All the Poker")

Ross: That money is mine, Green!

Rachel: You're fly is open, Geller!

Phoebe: You guys, you know what I just realized? 'Joker' is 'poker' with a 'J.' Coincidence?

Chandler: Hey, that's...'joincidence' with a 'C'!

(from 1.07 - "The One With The Blackout")

Phoebe: [looking outside the window] Eww, look. Ugly Naked Guy lit a bunch of candles.

[They all look at the window, grossed out, then flinch in pain.]

Rachel: Ow, that had to hurt!

(from 3.09 - "The One With All the Football")

Phoebe: Hey, it’s your Thanksgiving too, y'know, instead of watching football, you could help.

The Guys: We will. (they don’t move)

Monica: Okay, Rachel, you wanna put the marshmallows in concentric circles.

Rachel: No Mon, you want to put them in concentric circles. I want to do this.

(Rachel sticks a marshmallow into Monica’s nose. Monica takes it out of her nose by closing one nostril, and blowing.)

Monica: Every year.

(from 5.08 - "The One With the Thanksgiving Flashbacks")

Joey: (he has a turkey on his head) It's stuck!!!

Phoebe: (walks him to the kitchen) Easy. Step. How did it get on?

Joey: I put it on to scare Chandler!

Phoebe: Oh my God! Monica's gonna totally freak out!

Joey: It smells really bad in here.

Phoebe: Well, of course it smells really bad. You have your head inside a turkey's ass!

(They hear Monica trying to unlock the door. So Phoebe quickly pushes his head down onto the table to make it look like the turkey is just sitting on a platter and not stuck on Joey's head.)

Monica: Hey, did you get the turkey bast-Oh my God! Oh my God! (She sees someone is stuck in the turkey.) Who is that?

Joey: It's Joey.

(from 4.12 - "The one With the Embryos")

Monica: I got it! How about, if we win, they have to get rid of the rooster?

Rachel: Oooohh that’s interesting.

Chandler: If you win, we give up the birds.

Joey: (shocked) Dah!! (Chandler motions for him to calm down.)

Chandler: But if we win, we get your apartment.

Joey: Oooooh!

Monica: Deal!

TIME LAPSE

Ross: What was Monica’s nickname when she was a field hockey goalie?

Joey: Big fat goalie.

Ross: Correct. Rachel claims this is her favorite movie…

Chandler: Dangerous Liaisons.

Ross: Correct. Her actual favorite movie is...

Joey: Weekend at Bernie’s.

Ross: Monica categorizes her towels. How many categories are there?

(They both confer)

Joey: Everyday use.

Chandler: Fancy.

Joey: Guest.

Chandler: Fancy guest.

Ross: Two seconds...

Joey: Uhh, 11!

Ross: 11, unbelievable, 11 is correct. (The guys celebrate.)

Ross: (to the girls) Chandler was how old when he first touched a girl’s breast?

Rachel: 14?

Ross: No, 19.

Chandler: Thanks man.

Ross: Joey had an imaginary childhood friend. His name was?

Monica: Maurice.

Ross: Correct, his profession was?

Rachel: Space cowboy!

Ross: Correct! What is Chandler Bing’s job?

(The girls are stumped)

Rachel: Ow...Oh Gosh!

Ross: 10 seconds, you need this or you lose the game.

Monica: It’s umm, it has something to do with transponding.

Rachel: Oh-oh-oh, he’s a transponce—transpondster!

Monica: That’s not even a word!

(Ross stops the clock, signifying the end of the lightning round.)

Monica: NOOOOOOOOO!!!!!

TIME LAPSE

(The door opens and Joey and Chandler ride in on the big, fake dog in triumph)

Rachel: Y’know what, you are mean boys, who are just being mean!

Joey: Hey, don’t get mad at us! No one forced you to raise the stakes!

Rachel: That is not true. She did! She forced me!

Monica: Hey, we would still be living here if hadn’t gotten the question wrong!

Rachel: Well it stupid, unfair question!

Ross: Don’t blame the questions!

Chandler: Would you all stop yelling in our apartment! You are ruining moving day for us!

(from 5.15 - "The One With The Girl Who Hits Joey")

Ross: Chandler!!! Chandler!!! (He opens the door to the apartment but is stopped by the chain; Chandler and Monica quickly stop making out and try to get dressed.) Chandler, I saw what you were doing through the window! Chandler, I saw what you were doing to my sister! Now get out here!

Chandler: (To Monica) Wow! Listen, we had a good run. You know, what was it? Four? Five months? I mean, that's more than most people have in a lifetime! So, good-bye, take care, bye-bye then! (He kisses her and starts to climb out the balcony window)

Monica: (She opens the door.) Hey Ross. What's up bro?

(Ross spots Chandler and starts chasing him around the kitchen table. Chandler runs and hides behind Monica.)

Ross: What the hell are doing?!!

Rachel: (running from the guy's apartment with Joey in tow) Hey, what's-what's going on?!

Chandler: Well, I think, I think Ross knows about me and Monica.

Joey: (panicking) Dude! He's right there!

Ross: (To Chandler) I thought you were my best friend, this is my sister! My best friend and my sister! I-I cannot believe this!

Chandler: Look, we're not just messing around! I love her. Okay, I'm in love with her.

Monica: I'm so sorry that you had to find out this way. I'm sorry, but iit-t's true, I love him too.

(There's a brief pause.)

Ross: (happily) My best friend and my sister! I cannot believe this. (He hugs them both.)

(from 6.06 - "The One On The Last Night")

Monica: Well, this is the last box of your clothes. I’m just gonna label it, "What were you thinking?"

Rachel: Funny, because I was just gonna go across the hall and write that on Chandler.

Phoebe: Ok, you guys, I don’t mean to make things worse, but umm, I don’t want to live with Rachel anymore.

Monica and Rachel: What?!

Phoebe: You’re just so mean to each other! And I don’t want to end up like that with Rachel. I still like you!

Rachel: Well, Phoebe that’s fine because I’m not moving.

Monica: Whoa-whoa-whoa, Phoebe you gotta take her! Y’know, I-I-I said some really bad stuff about her, but y’know Rachel has some good qualities that make her a good roommate. She gets tons of catalogs and umm, she’ll fold down the pages of the things she thinks that I’d like.

Phoebe: What else?

Monica: When I take a shower, she leaves me little notes on the mirror.

Rachel: Yeah, I do. I-I do, do that.

Phoebe: That’s nice. I like having things to read in the bathroom.

Monica: When I fall asleep on the couch after reading, she covers me over with a blanket.

Rachel: Well y’know, I don’t want you to be cold.

Monica: And when I told her that I was gonna be moving in with Chandler, she was really supportive. (To Rachel) (Starts to cry) You were so great. You made it so easy. And now you have to leave. And I have to live with a boy!! (They both break down in tears.)

TIME LAPSE

(Monica closes the door and slowly walks into Rachel’s old and now empty room.)

Chandler: (entering) Hey.

Monica: She really left.

Chandler: I know. (He kisses her.)

Monica: Thank you.

Chandler: No problem roomie. (She turns around and hugs him.)

Monica: Can I ask you a question?

Chandler: Sure!

Monica: What the hell is that dog doing here?! (She notices the dog sitting in the living room.)

(from 1.09 - "The One Where Underdog Gets Away")

Chandler: Little toast here. I know this isn't exactly the kind of Thanksgiving that all of you all planned, but for me, this has been really great, you know, I think because it didn't involve divorce or projectile vomiting. Anyway, I was just thinking, I mean, if you'd gone to Vail, and if you guys'd been with your family, if you didn't have syphilis and stuff, we wouldn't be all together, you know? So I guess what I'm trying to say is that I'm very thankful that all of your Thanksgivings sucked.

All: That's so sweet.

Ross: And hey, here's to a lousy Christmas.

Rachel: And a crappy New Year.

Chandler: Here, here!

[Scene: We're back to the present. Chandler and Monica's. They're all still at the kitchen table.]

Rachel: You can't move. You just... you just can't.

Joey: Rachel's right. This is where you guys belong.

Phoebe: Yeah, you don't wanna live in Westchester. That's like the worst of the Chesters.

Ross: You know, sometimes when I'm alone in my apartment, I look over here and you guys... are just having dinner or... watching TV or something, but... it makes me feel better. And now when I look over, who am I gonna see? The Gottliebs, the Yangs? They don't make me feel so good. (Joey pats Ross on his back)

Rachel: Yeah. So don't move, okay? Just stay here and... (nods towards Ross) maybe close your blinds at night.

(The phone rings and Chandler goes to get it)

Chandler: Hello? It's Nancy, they responded to our offer.

Monica: And?

(Chandler listens to what Nancy says)

Chandler: (to Nancy) Okay, thanks... (to Monica) They passed. They said they wouldn't go a penny under the asking price.

Monica: We can't afford that.

Chandler: I know.

Monica: Well, there you go.

(Chandler and Monica hug)

Joey: I'm really sorry you guys.

Ross: Yeah. I'm sorry too. I'm even more sorry that that phone call didn't come before I told you about looking through the window.

Rachel: Yeah, we're gonna let you be alone.

Phoebe: (to Monica) You're gonna be okay?

Monica: Yeah, we'll be okay.

Ross: Love you guys. (he kisses Monica, he, Rachel and Phoebe leave.)

Joey: You know, I'm really sorry I wasn't more supportive before.

Chandler: That's okay, we understand.

Joey: And about this Nancy thing... If you're not sleeping with her, should I?

(Chandler gives Joey her business card, which he eagerly grabs and he leaves.)

Monica: I know there'll be other houses, but it's just so... I love that one so much.

Chandler: Yeah... Well, it's a good thing we got it then.

Monica: What?

Chandler: We got the house.

Monica: Oh my God!

Chandler: I just didn't want to tell you in front of them.

Monica: Oh my God! My God! We've got the house !?

Chandler: We're getting the house. (they hug) We're getting the house.

Monica: And a baby...

Chandler: We're growing up.

Monica: We sure are.

Chandler: So who's gonna tell them?

Monica: (quickly) Not it!

Chandler: Not it! Damn it!

COMMERCIAL BREAK

[Scene: Central Perk. The entire gang is there, and Chandler and Monica are handing out presents.]

Monica: Rachel, this is yours.

Rachel: Aah! Why? What are these for?

Chandler: You'll see.

Monica: All right, everybody open them!

(they all tear off the wrapping paper)

Rachel: Ooh! Oh wow this is so beautiful. (she got a scarf)

Phoebe: Oh! These are the ones I was looking at in the store. (she got earrings)

Monica: I know.

Ross: I love this. (he got a sweater)

Joey: A meatball Sub? Thanks! (he got a meatball sandwich)

Ross: Seriously you guys, what's going on? What are these for?

Chandler: Well, I didn't know how to tell you before, but... We got the house.

Monica: Enjoy!

(they both run off, leaving Ross, Phoebe and Rachel stunned.)

Joey: (speaking with his mouth full, enjoying his sandwich) What did they say?

THE END


text:
"use strict";

var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { "default": obj }; };

var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };

var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } };

var TraversalPath = _interopRequire(require("./path"));

var flatten = _interopRequire(require("lodash/array/flatten"));

var compact = _interopRequire(require("lodash/array/compact"));

var t = _interopRequireWildcard(require("../types"));

var TraversalContext = (function () {
  function TraversalContext(scope, opts, state, parentPath) {
    _classCallCheck(this, TraversalContext);

    this.shouldFlatten = false;
    this.parentPath = parentPath;
    this.scope = scope;
    this.state = state;
    this.opts = opts;
  }

  TraversalContext.prototype.flatten = function flatten() {
    this.shouldFlatten = true;
  };

  TraversalContext.prototype.visitNode = function visitNode(node, obj, key) {
    var iteration = TraversalPath.get(this.parentPath, this, node, obj, key);
    return iteration.visit();
  };

  TraversalContext.prototype.visit = function visit(node, key) {
    var nodes = node[key];
    if (!nodes) return;

    if (!Array.isArray(nodes)) {
      return this.visitNode(node, node, key);
    }

    // nothing to traverse!
    if (nodes.length === 0) {
      return;
    }

    for (var i = 0; i < nodes.length; i++) {
      if (nodes[i] && this.visitNode(node, nodes, i)) {
        return true;
      }
    }

    if (this.shouldFlatten) {
      node[key] = flatten(node[key]);

      if (t.FLATTENABLE_KEYS.indexOf(key) >= 0) {
        // we can safely compact this
        node[key] = compact(node[key]);
      }
    }
  };

  return TraversalContext;
})();

module.exports = TraversalContext;


text:
public static class Program {
    public static void Main() {
        var x = MFunc(); // [x: 0]
    }

    public static int MFunc() {
        return 0;
    } // [return: 0]
}


text:
import User from './User';
import Login from './Login';
import Sign from './Sign';

export {
		User,
		Login,
		Sign,
};


text:
#include <Python.h>

#include "mesh.h"
#include "_algorithm.h"
#include "_algorithm_src.h"

#undef NDIM
#define NDIM 2
#undef NEQ
#define NEQ 3
#include "sc_bulk_process_dB.c_body"
#undef NDIM
#define NDIM 3
#undef NEQ
#define NEQ 4
#include "sc_bulk_process_dB.c_body"

// vim: set ts=4 et:


text:
layout: page
title:  "Show me your research!"
---


text:
package bucketdev.laboratorio.instalaciones.view.column;

import java.text.SimpleDateFormat;
import java.util.Calendar;

import bucketdev.laboratorio.BDev;
import bucketdev.laboratorio.BDevMain;
import bucketdev.laboratorio.bean.InstalacionBean;
import bucketdev.laboratorio.type.BDevTipoMensaje;
import javafx.geometry.Pos;
import javafx.scene.control.TableCell;
import javafx.scene.control.TableColumn;
import javafx.util.Callback;

public class InstalacionFechaCaducidadColumn extends TableColumn<InstalacionBean, Integer> {

	private final long DIAS_MILISEGUNDOS = 1000 * 60 * 60 * 24;

	public InstalacionFechaCaducidadColumn() {
		this("");
	}

	public InstalacionFechaCaducidadColumn(String _header) {
		setText(_header);
		setCellFactory(new Callback<TableColumn<InstalacionBean, Integer>, TableCell<InstalacionBean, Integer>>() {

			@Override
			public TableCell<InstalacionBean, Integer> call(TableColumn<InstalacionBean, Integer> param) {
				return new TableCell<InstalacionBean, Integer>() {
					/*
					 * @see javafx.scene.control.Cell#updateItem(java.lang.
					 * Object, boolean)
					 */
					@Override
					protected void updateItem(Integer item, boolean empty) {
						super.updateItem(item, empty);
						if (!empty && item != null) {
							try {
								InstalacionBean instalacionBean = getTableView().getItems().get(getIndex());
								Calendar calendarCaducidad = Calendar.getInstance();
								Calendar calendar = Calendar.getInstance();
								SimpleDateFormat format = new SimpleDateFormat("dd 'de' MMMMM, yyyy");

								calendarCaducidad.setTime(instalacionBean.getFechaCaducidad());
								calendarCaducidad.add(Calendar.DATE, instalacionBean.getCaducidad());

								long diasRestantes = Math.floorDiv(
										calendarCaducidad.getTimeInMillis() - calendar.getTimeInMillis(),
										DIAS_MILISEGUNDOS) + 1;
								boolean isPorCaducar = diasRestantes <= item;

								if (getStyleClass().size() > 4) {
									getStyleClass().remove(4, getStyleClass().size());
								}
								getStyleClass().add(isPorCaducar ? "danger" : "success");
								setAlignment(Pos.BASELINE_LEFT);
								setText(format.format(calendarCaducidad.getTime()));
								setGraphic(isPorCaducar ? BDev.creaImagen("status.img.caducado")
										: BDev.creaImagen("status.img.vigente"));
							} catch (Exception e) {
								setGraphic(null);
								setText(null);
								BDev.getLogger().error(BDev.getMensaje("instalaciones.formato.caducidad.error"), e);
								BDevMain.mostrarMensaje(BDev.getMensaje("instalaciones.formato.caducidad.error"),
										BDevTipoMensaje.ERROR);
							}
						} else {
							if (getStyleClass().size() > 4) {
								getStyleClass().remove(4, getStyleClass().size());
							}
							setGraphic(null);
							setText(null);
						}
					}
				};
			}
		});
	}

}


text:
%% Copyright (C) 2009-2012, Gostai S.A.S.
%%
%% This software is provided "as is" without warranty of any kind,
%% either expressed or implied, including but not limited to the
%% implied warranties of fitness for a particular purpose.
%%
%% See the LICENSE file for more information.

\section{System.PackageInfo}
Information about \usdk and its components.

\subsection{Prototypes}
\begin{refObjects}
\item[Object]
\end{refObjects}

\subsection{Slots}
\begin{urbiscriptapi}
\item[bugReport] The address where to send bug reports.
\begin{urbiassert}
System.PackageInfo.components["Urbi"].bugReport
  == "kernel-bugs@lists.gostai.com";
\end{urbiassert}

\item[components] A Dictionary of the components loaded in the package.  The
  component \lstinline|"Urbi SDK"| duplicates the component
  \lstinline|"Urbi"| for backward compatibility: prefer the latter.
\begin{urbiassert}
System.PackageInfo.components.keys
  == ["Libport", "Urbi", "Urbi SDK"];
System.PackageInfo.components["Urbi SDK"]
  == System.PackageInfo.components["Urbi"];
\end{urbiassert}

\item[copyrightHolder] Who owns the copyright of the package.
\begin{urbiassert}
System.PackageInfo.components["Urbi"].copyrightHolder
  == "Gostai S.A.S.";
\end{urbiassert}

\item[copyrightYears] The years that the copyright covers.
\begin{urbiassert}
System.PackageInfo.components["Urbi"].copyrightYears
  == "2004-2012";
\end{urbiassert}

\item[date] A string corresponding to the source date (day and time).
\begin{urbiassert}
System.PackageInfo.components["Urbi"].date.isA(String);
\end{urbiassert}

\item[day] The day part of the date string.
\begin{urbiassert}
System.PackageInfo.components["Urbi"].day.isA(String);
\end{urbiassert}

\item[description] The complete description string, with slashes.
\begin{urbiassert}
System.PackageInfo.components["Urbi"].description.isA(String);
\end{urbiassert}

\item[id] The identification string.
\begin{urbiassert}
System.PackageInfo.components["Urbi"].id.isA(String);
\end{urbiassert}

\item[major] The major version component (see \refSlot{version}), for
  instance \lstinline|2|.
\begin{urbiassert}
System.PackageInfo.components["Urbi"].major.isA(Float);
\end{urbiassert}

\item[minor] The minor version component (see \refSlot{version}), for
  instance \lstinline|7|.
\begin{urbiassert}
System.PackageInfo.components["Urbi"].minor.isA(Float);
\end{urbiassert}

\item[name] The name of the package as a String.
\begin{urbiassert}
System.PackageInfo.components["Urbi"].name
  == "Urbi";
\end{urbiassert}

\item[patch] The number of changes since the \refSlot{version}.
\begin{urbiassert}
System.PackageInfo.components["Urbi"].patch.isA(Float);
\end{urbiassert}

\item[revision] The revision string.
\begin{urbiassert}
System.PackageInfo.components["Urbi"].revision.isA(String);
\end{urbiassert}

\item[string] Name and version concatenated, for instance
  \lstinline|"Urbi 3.0.0"|.
\begin{urbiassert}
System.PackageInfo.components["Urbi"].string.isA(String);
\end{urbiassert}

\item[subMinor] The sub-minor version component (see \refSlot{version}), for
  instance \lstinline|4| for \usdk 2.7.4.
\begin{urbiassert}
System.PackageInfo.components["Urbi"].subMinor.isA(Float);
\end{urbiassert}

\item[tarballVersion] The complete version string, with dashes.
\begin{urbiassert}
System.PackageInfo.components["Urbi"].tarballVersion.isA(String);
\end{urbiassert}

\item[tarname] Name of the tarball.
\begin{urbiassert}
System.PackageInfo.components["Urbi"].tarname
  == "urbi-sdk";
\end{urbiassert}

\item[version] The version string, such as \lstinline|"2.7"| or
  \lstinline|"2.7.4"|.
\begin{urbiscript}
do (System.PackageInfo.components["Urbi"])
{
  assert
  {
    version ==
      {
        if (subMinor)
          "%s.%s.%s" % [major, minor, subMinor]
        else
          "%s.%s" % [major, minor]
      };
  };
}|;
\end{urbiscript}

\item[versionRev] Version and revision together.
\begin{urbiscript}
do (System.PackageInfo.components["Urbi"])
{
  assert
  {
    versionRev
    == "version %s patch %s revision %s"
       % [version, patch, revision];
  };
}|;
\end{urbiscript}

\item[versionValue] The version as an integer, for instance 2007004 for
  2.7.4.
\begin{urbiscript}
do (System.PackageInfo.components["Urbi"])
{
  assert
  {
    versionValue == (major * 1e6 + minor * 1e3 + subMinor);
  };
}|;
\end{urbiscript}
\end{urbiscriptapi}

%%% Local Variables:
%%% coding: utf-8
%%% mode: latex
%%% TeX-master: "../../urbi-sdk"
%%% ispell-dictionary: "american"
%%% ispell-personal-dictionary: "../../urbi.dict"
%%% fill-column: 76
%%% End:


text:
package me.pheynix.pictures.utils;

import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.res.Resources;
import android.graphics.Point;
import android.os.Environment;
import android.util.TypedValue;
import android.view.WindowManager;

import java.io.File;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

/**
 * utilities
 * Created by pheynix on 4/2/16.
 */
public class AndroidUtil {

    private AndroidUtil() {
        throw new UnsupportedOperationException();
    }

    public static int getScreenWidthInPixel() {
        Point point = new Point();
        getScreenSizeInPixel(point);
        return point.x;
    }

    public static int getScreenHeightInPixel() {
        Point point = new Point();
        getScreenSizeInPixel(point);
        return point.y;
    }

    public static void getScreenSizeInPixel(Point point) {
        WindowManager windowManager = (WindowManager) ApplicationLoader.applicationContext.getSystemService(Context.WINDOW_SERVICE);
        windowManager.getDefaultDisplay().getSize(point);
    }

    public static int dpToPx(int dp) {
        Resources resources = ApplicationLoader.applicationContext.getResources();
        return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, resources.getDisplayMetrics());
    }

    public static File getCacheDir(String type) {
        File cacheDir = null;
        if (Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState()) || !Environment.isExternalStorageRemovable()) {
            cacheDir = ApplicationLoader.applicationContext.getExternalCacheDir();
        } else {
            cacheDir = ApplicationLoader.applicationContext.getCacheDir();
        }

        cacheDir = new File(cacheDir.getPath() + File.separator + type);
        if (!cacheDir.exists()) {
            cacheDir.mkdir();
        }

        return cacheDir;
    }

    public static int getAppVersion() {
        int versionCode = 1;
        try {
            PackageInfo packageInfo = ApplicationLoader.applicationContext.getPackageManager().getPackageInfo(ApplicationLoader.applicationContext.getPackageName(), 0);
            versionCode = packageInfo.versionCode;
        } catch (PackageManager.NameNotFoundException e) {
            e.printStackTrace();
        }
        return versionCode;
    }

    public static String getKey(String url) {
        try {
            MessageDigest md = MessageDigest.getInstance("MD5");
            md.update(url.getBytes());
            byte[] bytes = md.digest();
            StringBuilder stringBuilder = new StringBuilder();

            for (byte aByte : bytes) {
                stringBuilder.append(String.format("%02x", aByte));
            }
            return stringBuilder.toString();
        } catch (NoSuchAlgorithmException e) {
            e.printStackTrace();
        }
        return String.valueOf(url.hashCode());
    }
}


text:
package com.github.maven_nar.cpptasks.platforms;

import java.io.BufferedWriter;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStreamWriter;
import java.io.Writer;

import com.github.maven_nar.cpptasks.CUtil;
import com.github.maven_nar.cpptasks.TargetMatcher;
import com.github.maven_nar.cpptasks.VersionInfo;
import com.github.maven_nar.cpptasks.compiler.LinkType;

/**
 * Platform specific behavior for Microsoft Windows.
 *
 * @author Curt Arnold
 */
public final class WindowsPlatform {

  /**
   * Constructor.
   */
  private WindowsPlatform() {
  }
  /**
   * Adds source or object files to the bidded fileset to
   * support version information.
   *
   * @param versionInfo version information
   * @param linkType link type
   * @param isDebug true if debug build
   * @param outputFile name of generated executable
   * @param objDir directory for generated files
   * @param matcher bidded fileset
   * @throws IOException if unable to write version resource
   */
  public static void addVersionFiles(final VersionInfo versionInfo,
                                     final LinkType linkType,
                                     final File outputFile,
                                     final boolean isDebug,
                                     final File objDir,
                                     final TargetMatcher matcher)
      throws IOException {
    if (versionInfo == null) {
      throw new NullPointerException("versionInfo");
    }
    if (linkType == null) {
      throw new NullPointerException("linkType");
    }
    if (outputFile == null) {
      throw new NullPointerException("outputFile");
    }
    if (objDir == null) {
      throw new NullPointerException("objDir");
    }

    /**
     * Fully resolve version info
     */
    VersionInfo mergedInfo = versionInfo.merge();

    File versionResource = new File(objDir, "versioninfo.rc");

    boolean notChanged = false;
    //
    //   if the resource exists
    //
    if (versionResource.exists()) {
      ByteArrayOutputStream memStream = new ByteArrayOutputStream();
      Writer writer = new BufferedWriter(new OutputStreamWriter(memStream));
      writeResource(writer, mergedInfo, outputFile, isDebug, linkType);
      writer.close();
      ByteArrayInputStream proposedResource = new ByteArrayInputStream(
          memStream.toByteArray());

      InputStream existingResource = new FileInputStream(versionResource);
      //
      //
      //
      notChanged = hasSameContent(proposedResource, existingResource);
      existingResource.close();
    }

    //
    //   if the resource file did not exist or will be changed then
    //       write the file
    //
    if (!notChanged) {
      Writer writer = new BufferedWriter(
          new OutputStreamWriter(
          new FileOutputStream(versionResource)));
      writeResource(writer, mergedInfo, outputFile, isDebug, linkType);
      writer.close();
    }
    if (matcher != null) {
      matcher.visit(new File(versionResource.getParent()),
                    versionResource.getName());
    }

  }

  /**
   * Compare two input streams for duplicate content
   *
   * Naive implementation, but should not be performance issue.
   * @param stream1 stream
   * @param stream2 stream
   * @return true if streams are identical in content
   * @throws IOException if error reading streams
   */
  private static boolean hasSameContent(final InputStream stream1,
                                        final InputStream stream2)
      throws IOException {
    int byte1 = -1;
    int byte2 = -1;
    do {
      byte1 = stream1.read();
      byte2 = stream2.read();

    }
    while (byte1 == byte2 && byte1 != -1);
    return (byte1 == byte2);
  }

  /**
   * Parse version string into array of four short values.
   * @param version String version
   * @return short[] four element array
   */
  public static short[] parseVersion(final String version) {
    short[] values = new short[] {
        0, 0, 0, 0};
    if (version != null) {
      StringBuffer buf = new StringBuffer(version);
      int start = 0;
      for (int i = 0; i < 4; i++) {
        int end = version.indexOf('.', start);
        if (end <= 0) {
          end = version.length();
          for (int j = end; j > start; j--) {
            String part = buf.substring(start, end);
            try {
              values[i] = Short.parseShort(part);
              break;
            } catch (NumberFormatException ex) {
              values[i] = 0;
            }
          }
          break;
        } else {
          String part = buf.substring(start, end);
          try {
            values[i] = Short.parseShort(part);
            start = end + 1;
          } catch (NumberFormatException ex) {
            break;
          }
        }
      }
    }
    return values;
  }

  /**
   * Converts parsed version information into a string representation.
   *
   * @param buf StringBuffer string buffer to receive version number
   * @param version short[] four-element array
   */
  private static void encodeVersion(final StringBuffer buf,
                                    final short[] version) {
    for (int i = 0; i < 3; i++) {
      buf.append(Short.toString(version[i]));
      buf.append(',');
    }
    buf.append(Short.toString(version[3]));
  }

  /**
   * Writes windows resource.
   * @param writer writer, may not be nul
   * @param versionInfo version information
   * @param outputFile executable file
   * @param isDebug true if debug
   * @param linkType link type
   * @throws IOException if error writing resource file
   */
  public static void writeResource(final Writer writer,
                                   final VersionInfo versionInfo,
                                   final File outputFile,
                                   final boolean isDebug,
                                   final LinkType linkType) throws IOException {

    //writer.write("#include \"windows.h\"\n");

    writer.write("VS_VERSION_INFO VERSIONINFO\n");
    StringBuffer buf = new StringBuffer("FILEVERSION ");
    encodeVersion(buf, parseVersion(versionInfo.getFileversion()));
    buf.append("\nPRODUCTVERSION ");
    encodeVersion(buf, parseVersion(versionInfo.getProductversion()));
    buf.append("\n");
    writer.write(buf.toString());
    buf.setLength(0);
    buf.append("FILEFLAGSMASK 0x1L /* VS_FF_DEBUG */");
    Boolean patched = versionInfo.getPatched();
    Boolean prerelease = versionInfo.getPrerelease();
    if (patched != null) {
      buf.append(" | 0x4L /* VS_FF_PATCHED */");
    }
    if (prerelease != null) {
      buf.append(" | 0x2L /* VS_FF_PRERELEASE */");
    }
    if (versionInfo.getPrivatebuild() != null) {
      buf.append(" | 0x8L /* VS_FF_PRIVATEBUILD */");
    }
    if (versionInfo.getSpecialbuild() != null) {
      buf.append(" | 0x20L /* VS_FF_SPECIALBUILD */");
    }
    buf.append('\n');
    writer.write(buf.toString());
    buf.setLength(0);
    buf.append("FILEFLAGS ");

    if (isDebug) {
      buf.append("0x1L /* VS_FF_DEBUG */ | ");
    }
    if (Boolean.TRUE.equals(patched)) {
      buf.append("0x4L /* VS_FF_PATCHED */ | ");
    }
    if (Boolean.TRUE.equals(prerelease)) {
      buf.append("0x2L /* VS_FF_PRERELEASE */ | ");
    }
    if (Boolean.TRUE.equals(versionInfo.getPrivatebuild())) {
      buf.append("0x8L /* VS_FF_PRIVATEBUILD */ | ");
    }
    if (Boolean.TRUE.equals(versionInfo.getSpecialbuild())) {
      buf.append("0x20L /* VS_FF_SPECIALBUILD */ | ");
    }
    if (buf.length() > 10) {
      buf.setLength(buf.length() - 3);
      buf.append('\n');
    } else {
      buf.append("0\n");
    }
    writer.write(buf.toString());
    buf.setLength(0);

    writer.write("FILEOS 0x40004 /* VOS_NT_WINDOWS32 */\nFILETYPE ");
    if (linkType.isExecutable()) {
      writer.write("0x1L /* VFT_APP */\n");
    } else {
      if (linkType.isSharedLibrary()) {
        writer.write("0x2L /* VFT_DLL */\n");
      } else if (linkType.isStaticLibrary()) {
        writer.write("0x7L /* VFT_STATIC_LIB */\n");
      } else {
        writer.write("0x0L /* VFT_UNKNOWN */\n");
      }
    }
    writer.write("FILESUBTYPE 0x0L\n");
    writer.write("BEGIN\n");
    writer.write("BLOCK \"StringFileInfo\"\n");
    writer.write("   BEGIN\n#ifdef UNICODE\nBLOCK \"040904B0\"\n");
    writer.write("#else\nBLOCK \"040904E4\"\n#endif\n");
    writer.write("BEGIN\n");
    if (versionInfo.getFilecomments() != null) {
      writer.write("VALUE \"Comments\", \"");
      writer.write(versionInfo.getFilecomments());
      writer.write("\\0\"\n");
    }
    if (versionInfo.getCompanyname() != null) {
      writer.write("VALUE \"CompanyName\", \"");
      writer.write(versionInfo.getCompanyname());
      writer.write("\\0\"\n");
    }
    if (versionInfo.getFiledescription() != null) {
      writer.write("VALUE \"FileDescription\", \"");
      writer.write(versionInfo.getFiledescription());
      writer.write("\\0\"\n");
    }
    if (versionInfo.getFileversion() != null) {
      writer.write("VALUE \"FileVersion\", \"");
      writer.write(versionInfo.getFileversion());
      writer.write("\\0\"\n");
    }
    String baseName = CUtil.getBasename(outputFile);
    String internalName = versionInfo.getInternalname();
    if (internalName == null) {
      internalName = baseName;
    }
    writer.write("VALUE \"InternalName\", \"");
    writer.write(internalName);
    writer.write("\\0\"\n");
    if (versionInfo.getLegalcopyright() != null) {
      writer.write("VALUE \"LegalCopyright\", \"");
      writer.write(versionInfo.getLegalcopyright());
      writer.write("\\0\"\n");
    }
    if (versionInfo.getLegaltrademarks() != null) {
      writer.write("VALUE \"LegalTrademarks\", \"");
      writer.write(versionInfo.getLegaltrademarks());
      writer.write("\\0\"\n");
    }
    writer.write("VALUE \"OriginalFilename\", \"");
    writer.write(baseName);
    writer.write("\\0\"\n");
    if (versionInfo.getPrivatebuild() != null) {
      writer.write("VALUE \"PrivateBuild\", \"");
      writer.write(versionInfo.getPrivatebuild());
      writer.write("\\0\"\n");
    }
    if (versionInfo.getProductname() != null) {
      writer.write("VALUE \"ProductName\", \"");
      writer.write(versionInfo.getProductname());
      writer.write("\\0\"\n");
    }
    if (versionInfo.getProductversion() != null) {
      writer.write("VALUE \"ProductVersion\", \"");
      writer.write(versionInfo.getProductversion());
      writer.write("\\0\"\n");
    }
    if (versionInfo.getSpecialbuild() != null) {
      writer.write("VALUE \"SpecialBuild\", \"");
      writer.write(versionInfo.getSpecialbuild());
      writer.write("\\0\"\n");
    }
    writer.write("END\n");
    writer.write("END\n");

    writer.write("BLOCK \"VarFileInfo\"\n");
    writer.write("BEGIN\n#ifdef UNICODE\n");
    writer.write("VALUE \"Translation\", 0x409, 1200\n");
    writer.write("#else\n");
    writer.write("VALUE \"Translation\", 0x409, 1252\n");
    writer.write("#endif\n");
    writer.write("END\n");
    writer.write("END\n");
  }

}


text:
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 297028 $ -->
<refentry xml:id="function.imap-savebody" xmlns="http://docbook.org/ns/docbook">
 <refnamediv>
  <refname>imap_savebody</refname>
  <refpurpose>Save a specific body section to a file</refpurpose>
 </refnamediv>
 <refsect1 role="description">
  &reftitle.description;
  <methodsynopsis>
   <type>bool</type><methodname>imap_savebody</methodname>
   <methodparam><type>resource</type><parameter>imap_stream</parameter></methodparam>
   <methodparam><type>mixed</type><parameter>file</parameter></methodparam>
   <methodparam><type>int</type><parameter>msg_number</parameter></methodparam>
   <methodparam choice="opt"><type>string</type><parameter>part_number</parameter><initializer>""</initializer></methodparam>
   <methodparam choice="opt"><type>int</type><parameter>options</parameter><initializer>0</initializer></methodparam>
  </methodsynopsis>
  <para>
   Saves a part or the whole body of the specified message.
  </para>
 </refsect1>
 <refsect1 role="parameters">
  &reftitle.parameters;
  <para>
   <variablelist>
    &imap.imap-stream.description;
    <varlistentry>
     <term><parameter>file</parameter></term>
     <listitem>
      <para>
       The path to the saved file as a string, or a valid file descriptor
       returned by <function>fopen</function>.
      </para>
     </listitem>
    </varlistentry>
    <varlistentry>
     <term><parameter>msg_number</parameter></term>
     <listitem>
      <para>
       The message number
      </para>
     </listitem>
    </varlistentry>
    <varlistentry>
     <term><parameter>part_number</parameter></term>
     <listitem>
      <para>
       The part number. It is a string of integers delimited by period which
       index into a body part list as per the IMAP4 specification
      </para>
     </listitem>
    </varlistentry>
    <varlistentry>
     <term><parameter>options</parameter></term>
     <listitem>
      <para>
       A bitmask with one or more of the following:
       <itemizedlist>
        <listitem>
         <simpara>
          <constant>FT_UID</constant> - The <parameter>msg_number</parameter> is a UID
         </simpara>
        </listitem>
        <listitem>
         <simpara>
          <constant>FT_PEEK</constant> - Do not set the \Seen flag if
          not already set
         </simpara>
        </listitem>
        <listitem>
         <simpara>
          <constant>FT_INTERNAL</constant> - The return string is in
          internal format, will not canonicalize to CRLF.
         </simpara>
        </listitem>
       </itemizedlist>
      </para>
     </listitem>
    </varlistentry>
   </variablelist>
  </para>
 </refsect1>
 <refsect1 role="returnvalues">
  &reftitle.returnvalues;
  <para>
   &return.success;
  </para>
 </refsect1>
 <refsect1 role="seealso">
  &reftitle.seealso;
  <para>
   <simplelist>
    <member><function>imap_fetchbody</function></member>
   </simplelist>
  </para>
 </refsect1>
</refentry>

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->


text:
package io.airlift.jaxrs;

import com.google.inject.Binder;
import com.google.inject.Key;
import com.google.inject.TypeLiteral;
import com.google.inject.multibindings.Multibinder;

import static com.google.inject.Scopes.SINGLETON;
import static com.google.inject.multibindings.Multibinder.newSetBinder;

public class JaxrsBinder
{
    private final Multibinder<Object> resourceBinder;
    private final Multibinder<JaxrsBinding> keyBinder;
    private final Binder binder;

    private JaxrsBinder(Binder binder)
    {
        this.binder = binder;
        this.resourceBinder = newSetBinder(binder, Object.class, JaxrsResource.class).permitDuplicates();
        this.keyBinder = newSetBinder(binder, JaxrsBinding.class, JaxrsResource.class).permitDuplicates();
    }

    public static JaxrsBinder jaxrsBinder(Binder binder)
    {
        return new JaxrsBinder(binder);
    }

    public void bind(Class<?> implementation)
    {
        binder.bind(implementation).in(SINGLETON);
        resourceBinder.addBinding().to(implementation).in(SINGLETON);
        keyBinder.addBinding().toInstance(new JaxrsBinding(Key.get(implementation)));
    }

    public void bind(TypeLiteral<?> implementation)
    {
        binder.bind(implementation).in(SINGLETON);
        resourceBinder.addBinding().to(implementation).in(SINGLETON);
        registerJaxRsBinding(Key.get(implementation));
    }

    public void bind(Key<?> targetKey)
    {
        binder.bind(targetKey).in(SINGLETON);
        resourceBinder.addBinding().to(targetKey).in(SINGLETON);
        registerJaxRsBinding(targetKey);
    }

    public void bindInstance(Object instance)
    {
        resourceBinder.addBinding().toInstance(instance);
    }

    public void registerJaxRsBinding(Key<?> key)
    {
        keyBinder.addBinding().toInstance(new JaxrsBinding(key));
    }
}


text:
import { Component, OnInit } from '@angular/core';
import { Location } from '@angular/common';
import { MatDialog } from '@angular/material';
import { AgregarAlumnoEquipoComponent } from '../agregar-alumno-equipo/agregar-alumno-equipo.component';
import { MoverAlumnoComponent } from './mover-alumno/mover-alumno.component';
import { ResponseContentType, Http } from '@angular/http';

// Clases
import { Equipo, Alumno, AsignacionEquipo } from '../../../clases/index';

// Servicios
import { SesionService, PeticionesAPIService, CalculosService } from '../../../servicios/index';
import * as URL from '../../../URLs/urls';
import Swal from 'sweetalert2';

@Component({
  selector: 'app-editar-equipo',
  templateUrl: './editar-equipo.component.html',
  styleUrls: ['./editar-equipo.component.scss']
})
export class EditarEquipoComponent implements OnInit {

  // PONEMOS LAS COLUMNAS DE LA TABLA Y LA LISTA QUE TENDRÁ LA INFORMACIÓN QUE QUEREMOS MOSTRAR
  displayedColumns: string[] = ['nombreAlumno', 'primerApellido', 'segundoApellido', 'alumnoId', ' '];

  equipo: Equipo;
  alumnosEquipo: Alumno[];

  // NOS DEVUELVE LA RELACIÓN ENTRE UN ALUMNO Y UN EQUIPO
  asginacionEquipo: AsignacionEquipo[];

  // Recuperamos los alumnos del grupo
  alumnosGrupo: Alumno[];

  // Alumnos que ya estan asignados a un equipo. Debemos iniciarlo vacio para que vaya el push
  alumnosConEquipo: Alumno[] = [];

  // Lista con los alumnos del grupo que todavida no tienen equipo. Debemos iniciarlo vacio para que vaya el push
  alumnosSinEquipo: Alumno[] = [];

  // imagen
  imagenLogo: string;

  file: File;
  nombreLogo: string;
  nombreEquipo: string;

  // tslint:disable-next-line:ban-types
  logoCambiado: Boolean = false;

  constructor(
                public dialog: MatDialog,
                private location: Location,
                private sesion: SesionService,
                private calculos: CalculosService,
                private peticionesAPI: PeticionesAPIService,
                private http: Http ) { }

  ngOnInit() {
    this.equipo = this.sesion.DameEquipo();
    this.imagenLogo = this.equipo.FotoEquipo;
    this.nombreEquipo = this.equipo.Nombre;
    this.alumnosEquipo = this.sesion.DameAlumnosEquipo();
    this.alumnosGrupo = this.sesion.DameAlumnosGrupo();
    console.log ('ya tengo equipo');
    console.log (this.equipo);

    // Cargo el logo
    //this.GET_Logo();
    // Pedimos las listas de alumnos con y sin equipo
    this.calculos.DameListasAlumnosConYSinEquipo (this.equipo, this.alumnosGrupo)
    .subscribe (res => {
                          this.alumnosConEquipo = res.con;
                          this.alumnosSinEquipo = res.sin;
    });
  }

  // // Busca el logo que tiene el nombre del equipo.FotoEquipo y lo carga en imagenLogo
  // GET_Logo() {

  //   if (this.equipo.FotoEquipo !== undefined ) {
  //     this.peticionesAPI.DameLogoEquipo (this.equipo.FotoEquipo)
  //     .subscribe(response => {

  //       const blob = new Blob([response.blob()], { type: 'image/jpg'});

  //       const reader = new FileReader();
  //       reader.addEventListener('load', () => {
  //         this.imagenLogo = reader.result.toString();
  //         // La necesitaremos al regresar para actualizar el logo en la lista que ve el usuario
  //         this.sesion.TomaImagenLogoEquipo (this.imagenLogo);
  //       }, false);

  //       if (blob) {
  //         reader.readAsDataURL(blob);
  //       }
  //     });
  //   }

  // }

// LE PASAMOS EL IDENTIFICADOR DEL EQUIPO Y BUSCAMOS LOS ALUMNOS QUE TIENE. LA UTILIZAMOS PARA ACTUALIZAR LA TABLA
  AlumnosDelEquipo(equipoId: number) {

    this.peticionesAPI.DameAlumnosEquipo(equipoId)
    .subscribe(res => {
    if (res[0] !== undefined) {
      this.alumnosEquipo = res;
    } else {
      // Mensaje al usuario
      console.log('No hay alumnos en este grupo');
      this.alumnosEquipo = undefined;
      }
    });
  }

  BorrarAlumnoEquipo(alumno: Alumno) {
    console.log('voy a borrar a ' + alumno.id);
    // PRIMERO BUSCO LA ASIGNACIÓN QUE VINCULA EL ALUMNO CON ID QUE PASO COMO PARÁMETRO Y EL EQUIPO EN EL QUE ESTOY
    this.peticionesAPI.DameAsignacionEquipoAlumno (alumno.id, this.equipo.id, this.equipo.grupoId)
    .subscribe(asignacion => {
      console.log(asignacion);

      // UNA VEZ LO TENGO, BORRO ESA ASIGNACIÓN Y, POR TANTO, EL VÍNCULO ENTRE ALUMNO Y EQUIPO
      if (asignacion[0] !== undefined) {
        this.peticionesAPI.BorraAlumnoEquipo(asignacion[0]).subscribe(res => {
          console.log(res);
          // SI SE BORRA CORRECTAMENTE NOS DEVUELVE NULL
          if (res === null) {
            console.log('eliminado correctamente');
            this.AlumnosDelEquipo(this.equipo.id); // Actualizados los alumnos del equipo
            // Actualizamos las listas de alumnos del grupo con y sin equipo
            this.alumnosConEquipo = this.alumnosConEquipo.filter(result => result.id !== alumno.id);
            this.alumnosSinEquipo.push(alumno);
          } else {
            console.log('No se ha podido eliminar');
          }
        });
      } else {
        console.log('no se ha encontrado la asignación');
        }
      });
  }

  // SE ABRE EL DIÁLOGO PARA AÑADIR ALUMNOS AL EQUIPO
  AbrirDialogoAgregarAlumnosEquipo(): void {

    const dialogRef = this.dialog.open(AgregarAlumnoEquipoComponent, {
      height: '95%',

      // LE ENVIAMOS LOS ALUMNOS QUE TIENE ACTUALMENTE EL EQUIPO Y LOS QUE PODEMOS AÑADIR, ADEMÁS DEL EQUIPO QUE NOS SERÁ
      // ÚTIL PARA SABER SU ID Y EL ID DEL GRUPO AL QUE PERTENCE
      data: {
        alumnosEquipo: this.alumnosEquipo,
        alumnosSinEquipo: this.alumnosSinEquipo,
        equipo: this.equipo
      }
    });

    // RECUPERAREMOS LA NUEVA LISTA DE LOS ALUMNOS ASIGNABLES Y VOLVEREMOS A BUSCAR LOS ALUMNOS QUE TIENE EL EQUIPO
    dialogRef.afterClosed().subscribe(alumnosEquipo => {

      // Si el usuario clica a aceptar para cerrar el dialogo, se enviarán los alumnos del equipo
      if (alumnosEquipo !== undefined) {
        this.alumnosEquipo = alumnosEquipo;

        // Si clica fuera del diálogo para cerrarlo, recuperaremos la lista de la base de datos
      } else {
        this.AlumnosDelEquipo(this.equipo.id);
      }

      // Limpiamos las listas que teniamos antes
      this.alumnosConEquipo = [];
      this.alumnosSinEquipo = [];

      // Pedimos las listas de alumnos con y sin equipo
      this.calculos.DameListasAlumnosConYSinEquipo (this.equipo, this.alumnosGrupo)
      .subscribe (res => {
                            this.alumnosConEquipo = res.con;
                            this.alumnosSinEquipo = res.sin;
      });

    });
 }

//  AbrirDialogoAgregarAlumnosEquipo(): void {

//   const dialogRef = this.dialog.open(AgregarAlumnoEquipoComponent, {
//     height: '95%',

//     // LE ENVIAMOS LOS ALUMNOS QUE TIENE ACTUALMENTE EL EQUIPO Y LOS QUE PODEMOS AÑADIR, ADEMÁS DEL EQUIPO QUE NOS SERÁ
//     // ÚTIL PARA SABER SU ID Y EL ID DEL GRUPO AL QUE PERTENCE
//     data: {
//       alumnosEquipo: this.alumnosEquipoCreado,
//       alumnosSinEquipo: this.alumnosSinEquipo,
//       equipo: this.equipoCreado
//     }
//   });

//   // RECUPERAREMOS LA NUEVA LISTA DE LOS ALUMNOS ASIGNABLES Y VOLVEREMOS A BUSCAR LOS ALUMNOS QUE TIENE EL EQUIPO
//   dialogRef.afterClosed().subscribe(alumnosEquipo => {

//     // Si el usuario clica a aceptar para cerrar el dialogo, se enviarán los alumnos del equipo
//     if (alumnosEquipo !== undefined) {
//       this.alumnosEquipoCreado = alumnosEquipo;

//       // Si clica fuera del diálogo para cerrarlo, recuperaremos la lista de la base de datos
//     } else {
//       this.AlumnosEquipoCreado();
//     }

//     // Limpiamos las listas que teniamos antes
//     this.alumnosConEquipo = [];
//     this.alumnosSinEquipo = [];

//     // Pedimos las listas de alumnos con y sin equipo
//     this.calculos.DameListasAlumnosConYSinEquipo (this.equipoCreado, this.alumnosGrupo)
//     .subscribe (res => {
//                           this.alumnosConEquipo = res.con;
//                           this.alumnosSinEquipo = res.sin;
//     });

//   });
// }

  // NOS PERMITE MODIFICAR EL NOMBRE Y EL LOGO DEL EQUIPO
  EditarEquipo() {
    if (this.logoCambiado) {
      if (this.equipo.FotoEquipo !== undefined) {
        // hay que eliminar el fichero con el logo actual
        const url = this.equipo.FotoEquipo.split ('/');
        const imagen = url[url.length - 1];
        this.peticionesAPI.BorraLogoEquipo (imagen).subscribe ();
      }
      if (this.imagenLogo !== undefined) {
        this.equipo.FotoEquipo = URL.LogosEquipos + this.nombreLogo;
      } else {
        this.equipo.FotoEquipo = undefined;
      }
    } else {
      this.nombreLogo = this.equipo.FotoEquipo;
    }
    this.equipo.Nombre = this.nombreEquipo;
    this.peticionesAPI.ModificaEquipo(this.equipo)
    .subscribe((res) => {
      if (res != null) {

        this.equipo = res;

        if (this.logoCambiado === true) {
          // HACEMOS EL POST DE LA NUEVA IMAGEN EN LA BASE DE DATOS
          const formData: FormData = new FormData();
          formData.append(this.nombreLogo, this.file);
          this.peticionesAPI.PonLogoEquipo(formData)
          .subscribe(() => console.log('Logo cargado'));
        }

      } else {
        console.log('fallo editando');
      }
    });
    this.location.back();
  }

  // AL CLICAR EN AGREGAR LOGO NOS ACTIVARÁ LA FUNCIÓN MOSTRAR DE ABAJO
  ActivarInput() {
    console.log('Activar input');
    document.getElementById('input').click();
  }

   // Seleccionamos una foto y guarda el nombre de la foto en la variable logo
  Mostrar($event) {
    this.file = $event.target.files[0];
    console.log('fichero ' + this.file.name);
    this.nombreLogo = this.file.name;

    const reader = new FileReader();
    reader.readAsDataURL(this.file);
    reader.onload = () => {
      console.log('ya');
      this.logoCambiado = true;
      this.imagenLogo = reader.result.toString();
    };
  }

  // MOVER ALUMNO
  // SE ABRE EL DIÁLOGO PARA AÑADIR ALUMNOS AL EQUIPO
  AbrirDialogoMoverAlumno(): void {

    const dialogRef = this.dialog.open(MoverAlumnoComponent, {
      maxHeight: '95%',
      maxWidth: '50vw',

      // LE ENVIAMOS LOS ALUMNOS QUE TIENE ACTUALMENTE EL EQUIPO Y LOS QUE PODEMOS AÑADIR, ADEMÁS DEL EQUIPO QUE NOS SERÁ
      // ÚTIL PARA SABER SU ID Y EL ID DEL GRUPO AL QUE PERTENCE
      data: {
        alumnosEquipo: this.alumnosEquipo,
        equipo: this.equipo
      }
    });

    // RECUPERAREMOS LA NUEVA LISTA DE LOS ALUMNOS ASIGNABLES Y VOLVEREMOS A BUSCAR LOS ALUMNOS QUE TIENE EL EQUIPO
    dialogRef.afterClosed().subscribe(alumnosEquipo => {

      // Si el usuario clica a aceptar para cerrar el dialogo, se enviarán los alumnos del equipo
      if (alumnosEquipo !== undefined) {
        this.alumnosEquipo = alumnosEquipo;

        // Si clica fuera del diálogo para cerrarlo, recuperaremos la lista de la base de datos
      } else {
        this.AlumnosDelEquipo(this.equipo.id);
      }

      // Limpiamos las listas que teniamos antes
      this.alumnosConEquipo = [];
      this.alumnosSinEquipo = [];
      // Pedimos las listas de alumnos con y sin equipo
      this.calculos.DameListasAlumnosConYSinEquipo (this.equipo, this.alumnosGrupo)
      .subscribe (res => {
                            this.alumnosConEquipo = res.con;
                            this.alumnosSinEquipo = res.sin;
      });
    });
  }

  QuitarLogo() {
    if (!this.logoCambiado) {
      console.log ('vamos a quitar el logo');
      console.log (this.equipo);
      const url = this.equipo.FotoEquipo.split ('/');
      const imagen = url[url.length - 1];

      this.peticionesAPI.BorraLogoEquipo (imagen).subscribe ();
      this.imagenLogo = undefined;
      this.logoCambiado = true;
    } else {
      this.peticionesAPI.BorraLogoEquipo (this.nombreLogo).subscribe ();
      this.imagenLogo = undefined;

    }
    // this.peticionesAPI.ModificaEquipo(this.equipo)
    // .subscribe(e => console.log (e));

  }

  // NOS DEVOLVERÁ A LA DE LA QUE VENIMOS
  goBack() {
    if (this.logoCambiado || this.nombreEquipo !== this.equipo.Nombre) {

      Swal.fire({
        title: '¿Seguro que quieres salir?',
        text: 'Has hecho cambios que no has aceptado',
        icon: 'warning',
        showCancelButton: true,
        confirmButtonColor: '#3085d6',
        cancelButtonColor: '#d33',
        confirmButtonText: 'Si, estoy seguro'
      }).then((result) => {
        if (result.value) {
          this.location.back();
        }
      });
    } else {
      this.location.back();
    }

  }
}


text:
package org.pentaho.di.job.entries.checkdbconnection;

import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;

import org.junit.ClassRule;
import org.pentaho.di.core.database.DatabaseMeta;
import org.pentaho.di.job.entry.loadSave.JobEntryLoadSaveTestSupport;
import org.pentaho.di.junit.rules.RestorePDIEngineEnvironment;
import org.pentaho.di.trans.steps.loadsave.validator.ArrayLoadSaveValidator;
import org.pentaho.di.trans.steps.loadsave.validator.DatabaseMetaLoadSaveValidator;
import org.pentaho.di.trans.steps.loadsave.validator.FieldLoadSaveValidator;
import org.pentaho.di.trans.steps.loadsave.validator.IntLoadSaveValidator;
import org.pentaho.di.trans.steps.loadsave.validator.PrimitiveIntArrayLoadSaveValidator;
import org.pentaho.di.trans.steps.loadsave.validator.StringLoadSaveValidator;

public class JobEntryCheckDbConnectionsLoadSaveTest extends JobEntryLoadSaveTestSupport<JobEntryCheckDbConnections> {
  @ClassRule public static RestorePDIEngineEnvironment env = new RestorePDIEngineEnvironment();

  @Override
  protected Class<JobEntryCheckDbConnections> getJobEntryClass() {
    return JobEntryCheckDbConnections.class;
  }

  @Override
  protected List<String> listCommonAttributes() {
    return Arrays.asList( new String[] { "connections", "waitfors", "waittimes" } );
  }

  @Override
  protected Map<String, FieldLoadSaveValidator<?>> createAttributeValidatorsMap() {
    Map<String, FieldLoadSaveValidator<?>> validators = new HashMap<String, FieldLoadSaveValidator<?>>();
    int entries = new Random().nextInt( 10 ) + 1;
    validators.put( "connections", new ArrayLoadSaveValidator<DatabaseMeta>(
      new DatabaseMetaLoadSaveValidator(), entries ) );
    validators.put( "waitfors", new ArrayLoadSaveValidator<String>(
      new StringLoadSaveValidator(), entries ) );
    validators.put( "waittimes", new PrimitiveIntArrayLoadSaveValidator(
      new IntLoadSaveValidator( JobEntryCheckDbConnections.unitTimeCode.length ), entries ) );
    return validators;
  }
}