text:
namespace viz {

// Version the protocol in case we ever want or need backwards compatibility
// support.
static const int kVizDebuggerVersion = 1;

std::atomic<bool> VizDebugger::enabled_;

VizDebugger::BufferInfo::BufferInfo() = default;
VizDebugger::BufferInfo::~BufferInfo() = default;
VizDebugger::BufferInfo::BufferInfo(const BufferInfo& a) = default;

VizDebugger* VizDebugger::GetInstance() {
  static VizDebugger g_debugger;
  return &g_debugger;
}

VizDebugger::FilterBlock::FilterBlock(const std::string file_str,
                                      const std::string func_str,
                                      const std::string anno_str,
                                      bool is_active,
                                      bool is_enabled)
    : file(std::move(file_str)),
      func(std::move(func_str)),
      anno(std::move(anno_str)),
      active(is_active),
      enabled(is_enabled) {}

VizDebugger::FilterBlock::~FilterBlock() = default;

VizDebugger::FilterBlock::FilterBlock(const FilterBlock& other) = default;

base::Value::Dict VizDebugger::CallSubmitCommon::GetDictionaryValue() const {
  base::Value::Dict option_dict;
  option_dict.Set("color", base::StringPrintf("#%02x%02x%02x", option.color_r,
                                              option.color_g, option.color_b));
  option_dict.Set("alpha", option.color_a);

  base::Value::Dict dict;
  dict.Set("drawindex", draw_index);
  dict.Set("source_index", source_index);
  dict.Set("thread_id", thread_id);
  dict.Set("option", std::move(option_dict));
  return dict;
}

VizDebugger::StaticSource::StaticSource(const char* anno_name,
                                        const char* file_name,
                                        int file_line,
                                        const char* func_name)
    : anno(anno_name), file(file_name), func(func_name), line(file_line) {
  VizDebugger::GetInstance()->RegisterSource(this);
}

VizDebugger::VizDebugger()
    : gpu_thread_task_runner_(base::SequencedTaskRunner::GetCurrentDefault()) {
  enabled_.store(false);
}

VizDebugger::~VizDebugger() = default;

void VizDebugger::SubmitBuffer(int buff_id, VizDebugger::BufferInfo&& buffer) {
  read_write_lock_.WriteLock();
  VizDebugger::Buffer buff;
  buff.id = buff_id;
  buff.buffer_info = std::move(buffer);
  buffers_.emplace_back(buff);
  read_write_lock_.WriteUnLock();
}

base::Value VizDebugger::FrameAsJson(const uint64_t counter,
                                     const gfx::Size& window_pix,
                                     base::TimeTicks time_ticks) {
  // TODO(petermcneeley): When we move to multithread we need to do something
  // like an atomic swap here. Currently all multithreading concerns are handled
  // by having a lock around the |json_frame_output_| object.
  submission_count_ = 0;

  base::Value::Dict global_dict;
  global_dict.Set("version", kVizDebuggerVersion);
  global_dict.Set("frame", base::NumberToString(counter));
  global_dict.Set("windowx", window_pix.width());
  global_dict.Set("windowy", window_pix.height());
  global_dict.Set(
      "time", base::NumberToString(time_ticks.since_origin().InMicroseconds()));

  base::Value::List new_sources;
  for (size_t i = last_sent_source_count_; i < sources_.size(); i++) {
    const StaticSource* each = sources_[i];

    base::Value::Dict dict;
    dict.Set("file", each->file);
    dict.Set("line", each->line);
    dict.Set("func", each->func);
    dict.Set("anno", each->anno);
    dict.Set("index", each->reg_index);
    new_sources.Append(std::move(dict));
  }

  // Remote connection will now have acknowledged all the new sources.
  last_sent_source_count_ = sources_.size();
  global_dict.Set("new_sources", std::move(new_sources));

  // We take the minimum between tail index and buffer size to make sure we
  // don't go out of bounds.
  size_t const max_rect_calls_index =
      std::min(static_cast<int>(draw_rect_calls_tail_idx_),
               static_cast<int>(draw_rect_calls_.size()));
  size_t const max_text_calls_index =
      std::min(static_cast<int>(draw_text_calls_tail_idx_),
               static_cast<int>(draw_text_calls_.size()));
  size_t const max_logs_index = std::min(static_cast<int>(logs_tail_idx_),
                                         static_cast<int>(logs_.size()));

  base::Value::List draw_calls;

  // Hash set to keep track of threads that have been registered already.
  base::flat_set<int> registered_threads;
  for (size_t i = 0; i < max_rect_calls_index; ++i) {
    base::Value::Dict dict = draw_rect_calls_[i].GetDictionaryValue();
    base::Value::Dict threads_dict;
    {
      base::Value::List list_xy;
      list_xy.Append(draw_rect_calls_[i].obj_size.width());
      list_xy.Append(draw_rect_calls_[i].obj_size.height());
      dict.Set("size", std::move(list_xy));
    }
    {
      base::Value::List list_xy;
      list_xy.Append(static_cast<double>(draw_rect_calls_[i].pos.x()));
      list_xy.Append(static_cast<double>(draw_rect_calls_[i].pos.y()));
      dict.Set("pos", std::move(list_xy));
    }
    if (draw_rect_calls_[i].uv != DEFAULT_UV) {
      {
        base::Value::List list_xy;
        list_xy.Append(static_cast<double>(draw_rect_calls_[i].uv.width()));
        list_xy.Append(static_cast<double>(draw_rect_calls_[i].uv.height()));
        dict.Set("uv_size", std::move(list_xy));
      }
      {
        base::Value::List list_xy;
        list_xy.Append(static_cast<double>(draw_rect_calls_[i].uv.x()));
        list_xy.Append(static_cast<double>(draw_rect_calls_[i].uv.y()));
        dict.Set("uv_pos", std::move(list_xy));
      }
    }
    dict.Set("buff_id", std::move(draw_rect_calls_[i].buff_id));
    registered_threads.insert(draw_rect_calls_[i].thread_id);
    draw_calls.Append(std::move(dict));
  }

  global_dict.Set("drawcalls", std::move(draw_calls));

  base::Value::Dict buff_map;

  for (auto&& each : buffers_) {
    base::Value::Dict dict;
    auto& pixmap = each.buffer_info.bitmap.pixmap();
    dict.Set("width", pixmap.width());
    dict.Set("height", pixmap.height());
    base::Value::List lst;

    for (int j = 0; j < pixmap.height(); j++) {
      for (int i = 0; i < pixmap.width(); i++) {
        auto color = *pixmap.addr32(i, j);
        lst.Append(static_cast<int>(SkColorGetR(color)));
        lst.Append(static_cast<int>(SkColorGetG(color)));
        lst.Append(static_cast<int>(SkColorGetB(color)));
        lst.Append(static_cast<int>(SkColorGetA(color)));
      }
    }

    dict.Set("buffer", std::move(lst));
    buff_map.Set(base::NumberToString(each.id), std::move(dict));
  }

  global_dict.Set("buff_map", std::move(buff_map));

  base::Value::List logs;
  for (size_t i = 0; i < max_logs_index; ++i) {
    base::Value::Dict dict = logs_[i].GetDictionaryValue();
    dict.Set("value", std::move(logs_[i].value));
    logs.Append(std::move(dict));
    registered_threads.insert(logs_[i].thread_id);
  }
  global_dict.Set("logs", std::move(logs));

  base::Value::List texts;
  for (size_t i = 0; i < max_text_calls_index; ++i) {
    base::Value::Dict dict = draw_text_calls_[i].GetDictionaryValue();
    {
      base::Value::List list_xy;
      list_xy.Append(static_cast<double>(draw_text_calls_[i].pos.x()));
      list_xy.Append(static_cast<double>(draw_text_calls_[i].pos.y()));
      dict.Set("pos", std::move(list_xy));
    }
    dict.Set("text", draw_text_calls_[i].text);
    texts.Append(std::move(dict));
    registered_threads.insert(draw_text_calls_[i].thread_id);
  }
  global_dict.Set("text", std::move(texts));

  // Gather thread name:id for all active threads this frame.
  base::Value::List new_threads;
  for (auto&& thread_id : registered_threads) {
    std::string cur_thread_name =
        base::ThreadIdNameManager::GetInstance()->GetName(thread_id);
    base::Value::Dict threads_dict;
    threads_dict.Set("thread_id", thread_id);
    threads_dict.Set("thread_name", cur_thread_name);
    new_threads.Append(std::move(threads_dict));
    registered_threads.insert(thread_id);
  }

  global_dict.Set("threads", std::move(new_threads));

  // Reset index counters for each buffer.
  buffers_.clear();
  draw_rect_calls_tail_idx_ = 0;
  draw_text_calls_tail_idx_ = 0;
  logs_tail_idx_ = 0;

  return base::Value(std::move(global_dict));
}

void VizDebugger::UpdateFilters() {
  if (apply_new_filters_next_frame_) {
    cached_filters_ = new_filters_;
    for (auto&& source : sources_) {
      ApplyFilters(source);
    }
    new_filters_.clear();
    apply_new_filters_next_frame_ = false;
  }
}

void VizDebugger::CompleteFrame(uint64_t counter,
                                const gfx::Size& window_pix,
                                base::TimeTicks time_ticks) {
  read_write_lock_.WriteLock();
  UpdateFilters();
  json_frame_output_ = FrameAsJson(counter, window_pix, time_ticks);
  gpu_thread_task_runner_->PostTask(
      FROM_HERE,
      base::BindOnce(&VizDebugger::AddFrame, base::Unretained(this)));
  read_write_lock_.WriteUnLock();
}

void VizDebugger::ApplyFilters(VizDebugger::StaticSource* src) {
  // In the case of no filters we disable this source.
  src->active = false;
  src->enabled = false;
  // TODO(petermcneeley): We should probably make this string filtering more
  // optimal. However, for the most part it the cost is only paid on the
  // application of new filters.
  auto simple_match = [](const char* source_str,
                         const std::string& filter_match) {
    if (filter_match.empty() || source_str == nullptr) {
      return true;
    }
    return std::strstr(source_str, filter_match.c_str()) != nullptr;
  };

  for (const auto& filter_block : cached_filters_) {
    if (simple_match(src->file, filter_block.file) &&
        simple_match(src->func, filter_block.func) &&
        simple_match(src->anno, filter_block.anno)) {
      src->active = filter_block.active;
      src->enabled = filter_block.enabled;
    }
  }
}

void VizDebugger::RegisterSource(StaticSource* src) {
  read_write_lock_.WriteLock();
  int index = sources_.size();
  src->reg_index = index;
  ApplyFilters(src);
  sources_.push_back(src);
  read_write_lock_.WriteUnLock();
}

void VizDebugger::Draw(const gfx::SizeF& obj_size,
                       const gfx::Vector2dF& pos,
                       const VizDebugger::StaticSource* dcs,
                       VizDebugger::DrawOption option,
                       int* id,
                       const gfx::RectF& uv) {
  Draw(gfx::Size(obj_size.width(), obj_size.height()), pos, dcs, option, id,
       uv);
}

void VizDebugger::Draw(const gfx::Size& obj_size,
                       const gfx::Vector2dF& pos,
                       const VizDebugger::StaticSource* dcs,
                       VizDebugger::DrawOption option,
                       int* id,
                       const gfx::RectF& uv) {
  DrawInternal(obj_size, pos, dcs, option, id, uv);
}

void VizDebugger::DrawInternal(const gfx::Size& obj_size,
                               const gfx::Vector2dF& pos,
                               const VizDebugger::StaticSource* dcs,
                               VizDebugger::DrawOption option,
                               int* id,
                               const gfx::RectF& uv) {
  int local_id_buffer = -1;
  if (id != nullptr) {
    local_id_buffer = buffer_id++;
    *id = local_id_buffer;
  }

  //  Store atomic insertion index in local variable to use to insert into
  //  buffer.
  int insertion_index;

  for (;;) {
    read_write_lock_.ReadLock();
    // Get call insertion index.
    insertion_index = draw_rect_calls_tail_idx_++;
    // If the insertion index is within bounds, insert call into buffer.
    if (static_cast<size_t>(insertion_index) < draw_rect_calls_.size()) {
      int cur_thread_id = base::PlatformThread::CurrentId();
      draw_rect_calls_[insertion_index] = DrawCall{submission_count_++,
                                                   dcs->reg_index,
                                                   cur_thread_id,
                                                   option,
                                                   obj_size,
                                                   pos,
                                                   local_id_buffer,
                                                   uv};
      // Return when call insertion is successful.
      read_write_lock_.ReadUnlock();
      return;
    }
    read_write_lock_.ReadUnlock();
    // Take write lock to resize and re-adjust buffer tail index after buffer
    // overflow.
    read_write_lock_.WriteLock();
    // If tail index is over buffer size, then resizing is definitely needed.
    // Also re-adjust tail index so it's at the start of the new buffer space.
    if (static_cast<size_t>(draw_rect_calls_tail_idx_) >=
        draw_rect_calls_.size()) {
      draw_rect_calls_tail_idx_ = draw_rect_calls_.size();
      draw_rect_calls_.resize(draw_rect_calls_.size() * 2);
    }
    read_write_lock_.WriteUnLock();
  }
}

void VizDebugger::DrawText(const gfx::PointF& pos,
                           const std::string& text,
                           const VizDebugger::StaticSource* dcs,
                           VizDebugger::DrawOption option) {
  DrawText(gfx::Vector2dF(pos.OffsetFromOrigin()), text, dcs, option);
}

void VizDebugger::DrawText(const gfx::Point& pos,
                           const std::string& text,
                           const VizDebugger::StaticSource* dcs,
                           VizDebugger::DrawOption option) {
  DrawText(gfx::Vector2dF(pos.x(), pos.y()), text, dcs, option);
}

void VizDebugger::DrawText(const gfx::Vector2dF& pos,
                           const std::string& text,
                           const VizDebugger::StaticSource* dcs,
                           VizDebugger::DrawOption option) {
  //  Store atomic insertion index in local variable to use to insert into
  //  buffer.
  int insertion_index;

  for (;;) {
    read_write_lock_.ReadLock();
    // Get call insertion index.
    insertion_index = draw_text_calls_tail_idx_++;
    // If the insertion index is within bounds, insert call into buffer.
    if (static_cast<size_t>(insertion_index) < draw_text_calls_.size()) {
      int cur_thread_id = base::PlatformThread::CurrentId();
      draw_text_calls_[insertion_index] = DrawTextCall{submission_count_++,
                                                       dcs->reg_index,
                                                       cur_thread_id,
                                                       option,
                                                       pos,
                                                       text};
      // Return when call insertion is successful.
      read_write_lock_.ReadUnlock();
      return;
    }
    read_write_lock_.ReadUnlock();
    // Take write lock to resize and re-adjust buffer tail index after buffer
    // overflow.
    read_write_lock_.WriteLock();
    // If tail index is over buffer size, then resizing is definitely needed.
    // Also re-adjust tail index so it's at the start of the new buffer space.
    if (static_cast<size_t>(draw_text_calls_tail_idx_) >=
        draw_text_calls_.size()) {
      draw_text_calls_tail_idx_ = draw_text_calls_.size();
      draw_text_calls_.resize(draw_text_calls_.size() * 2);
    }
    read_write_lock_.WriteUnLock();
  }
}

void VizDebugger::AddFrame() {
  // TODO(petermcneeley): This code has duel thread entry. One to launch the
  // task and one for the task to run. We should improve on this design in the
  // future and have a better multithreaded frame data aggregation system.
  read_write_lock_.WriteLock();
  DCHECK(gpu_thread_task_runner_->RunsTasksInCurrentSequence());
  if (debug_output_.is_bound()) {
    debug_output_->LogFrame(std::move(json_frame_output_));
  }
  read_write_lock_.WriteUnLock();
}

void VizDebugger::FilterDebugStream(base::Value json) {
  read_write_lock_.WriteLock();
  DCHECK(gpu_thread_task_runner_->RunsTasksInCurrentSequence());
  const base::Value* value = &(json);
  const base::Value* filterlist = value->FindPath("filters");

  if (!filterlist || !filterlist->is_list()) {
    LOG(ERROR) << "Missing filter list in json: " << json;
    return;
  }

  new_filters_.clear();

  for (const auto& filter : filterlist->GetList()) {
    const base::Value* file = filter.FindPath("selector.file");
    const base::Value* func = filter.FindPath("selector.func");
    const base::Value* anno = filter.FindPath("selector.anno");
    const base::Value* active = filter.FindPath("active");
    const base::Value* enabled = filter.FindPath("enabled");

    if (!active) {
      LOG(ERROR) << "Missing filter props in json: " << json;
      return;
    }

    if ((file && !file->is_string()) || (func && !func->is_string()) ||
        (anno && !anno->is_string()) || !active->is_bool()) {
      LOG(ERROR) << "Filter props wrong type in json: " << json;
      continue;
    }

    auto check_str = [](const base::Value* filter_str) {
      return (filter_str ? filter_str->GetString() : std::string());
    };

    new_filters_.emplace_back(
        check_str(file), check_str(func), check_str(anno), active->GetBool(),
        (enabled && enabled->is_bool()) ? enabled->GetBool() : true);
  }

  apply_new_filters_next_frame_ = true;
  read_write_lock_.WriteUnLock();
}

void VizDebugger::StartDebugStream(
    mojo::PendingRemote<mojom::VizDebugOutput> pending_debug_output) {
  read_write_lock_.WriteLock();
  DCHECK(gpu_thread_task_runner_->RunsTasksInCurrentSequence());
  debug_output_.Bind(std::move(pending_debug_output));
  debug_output_.reset_on_disconnect();
  last_sent_source_count_ = 0;

  // Reset our filters for our new connection. By default the client will send
  // along the new filters after establishing the connection.
  new_filters_.clear();
  apply_new_filters_next_frame_ = true;

  base::Value::Dict dict;
  dict.Set("connection", "ok");
  debug_output_->LogFrame(base::Value(std::move(dict)));

  enabled_.store(true);
  read_write_lock_.WriteUnLock();
}

void VizDebugger::StopDebugStream() {
  read_write_lock_.WriteLock();
  DCHECK(gpu_thread_task_runner_->RunsTasksInCurrentSequence());
  debug_output_.reset();
  enabled_.store(false);
  read_write_lock_.WriteUnLock();
}

void VizDebugger::AddLogMessage(std::string log,
                                const VizDebugger::StaticSource* dcs,
                                DrawOption option) {
  //  Store atomic insertion index in local variable to use to insert into
  //  buffer.
  int insertion_index;

  for (;;) {
    read_write_lock_.ReadLock();
    // Get call insertion index.
    insertion_index = logs_tail_idx_++;
    // If the insertion index is within bounds, insert call into buffer.
    if (static_cast<size_t>(insertion_index) < logs_.size()) {
      int cur_thread_id = base::PlatformThread::CurrentId();
      logs_[insertion_index] = LogCall{submission_count_++, dcs->reg_index,
                                       cur_thread_id, option, std::move(log)};
      // Return when call insertion is successful.
      read_write_lock_.ReadUnlock();
      return;
    }
    read_write_lock_.ReadUnlock();
    // Take write lock to resize and re-adjust buffer tail index after buffer
    // overflow.
    read_write_lock_.WriteLock();
    // If tail index is over buffer size, then resizing is definitely needed.
    // Also re-adjust tail index so it's at the start of the new buffer space.
    if (static_cast<size_t>(logs_tail_idx_) >= logs_.size()) {
      logs_tail_idx_ = logs_.size();
      logs_.resize(logs_.size() * 2);
    }
    read_write_lock_.WriteUnLock();
  }
}

}  // namespace viz
#else  // !VIZ_DEBUGGER_IS_ON()
namespace viz {
VizDebugger::BufferInfo::BufferInfo() = default;
VizDebugger::BufferInfo::~BufferInfo() = default;
VizDebugger::BufferInfo::BufferInfo(const BufferInfo& a) = default;
}  // namespace viz
#endif


text:
out_prefix=$(dirname "$0")/../test-results/valgrind.out
output=
count=0
total_count=0
missing_message=
new_line='
'

# start outputting the current valgrind error in $out_prefix.++$count,
# and the test case which failed in the corresponding .message file
start_output () {
	test -z "$output" || return

	# progress
	total_count=$(($total_count+1))
	test -t 2 && printf "\rFound %d errors" $total_count >&2

	count=$(($count+1))
	output=$out_prefix.$count
	: > $output

	echo "*** $1 ***" > $output.message
}

finish_output () {
	test ! -z "$output" || return
	output=

	# if a test case has more than one valgrind error, we need to
	# copy the last .message file to the previous errors
	test -z "$missing_message" || {
		while test $missing_message -lt $count
		do
			cp $out_prefix.$count.message \
				$out_prefix.$missing_message.message
			missing_message=$(($missing_message+1))
		done
		missing_message=
	}
}

# group the valgrind errors by backtrace
output_all () {
	last_line=
	j=0
	i=1
	while test $i -le $count
	do
		# output <number> <backtrace-in-one-line>
		echo "$i $(tr '\n' ' ' < $out_prefix.$i)"
		i=$(($i+1))
	done |
	sort -t ' ' -k 2 | # order by <backtrace-in-one-line>
	while read number line
	do
		# find duplicates, do not output backtrace twice
		if test "$line" != "$last_line"
		then
			last_line=$line
			j=$(($j+1))
			printf "\nValgrind error $j:\n\n"
			cat $out_prefix.$number
			printf "\nfound in:\n"
		fi
		# print the test case where this came from
		printf "\n"
		cat $out_prefix.$number.message
	done
}

handle_one () {
	OLDIFS=$IFS
	IFS="$new_line"
	while read line
	do
		case "$line" in
		# backtrace, possibly a new one
		==[0-9]*)

			# Does the current valgrind error have a message yet?
			case "$output" in
			*.message)
				test -z "$missing_message" &&
				missing_message=$count
				output=
			esac

			start_output $(basename $1)
			echo "$line" |
			sed 's/==[0-9]*==/==valgrind==/' >> $output
			;;
		# end of backtrace
		'}')
			test -z "$output" || {
				echo "$line" >> $output
				test $output = ${output%.message} &&
				output=$output.message
			}
			;;
		# end of test case
		'')
			finish_output
			;;
		# normal line; if $output is set, print the line
		*)
			test -z "$output" || echo "$line" >> $output
			;;
		esac
	done < $1
	IFS=$OLDIFS

	# just to be safe
	finish_output
}

for test_script in "$(dirname "$0")"/../test-results/*.out
do
	handle_one $test_script
done

output_all

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <android.support.v4.view.ViewPager
        android:id="@id/viewpager"
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>

    <me.relex.circleindicator.CircleIndicator
        android:id="@id/indicator"
        android:layout_width="match_parent"
        android:layout_height="48dp"
        android:layout_gravity="bottom"
        android:layout_marginBottom="48dp"/>

    <android.support.v7.widget.AppCompatButton
        android:id="@id/button"
        style="@style/DefaultButton"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal"
        android:text="@string/reset"/>

</FrameLayout>


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;
using System.Management;
using System.IO;
using Microsoft.Lync.Model;
using Microsoft.Lync.Model.Extensibility;
using Wox.Plugin;

namespace Wox.Plugin.Lync
{
    /// <summary>
    ///  Launcher class for axc files.
    /// </summary>
    public class Lync : IPlugin
    {
        /// <summary>
        ///  Process the query.
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        public List<Result> Query(Query query)
        {
            List<Result> results = new List<Result>();
            LyncManager lyncManager = new LyncManager();
            List<Contact> contacts;
            string searchName;
            AutomationModalities mode;

            // do not search when no parameters
            if (query.ActionParameters.Count == 0)
            {
                return results;
            }

            // check for action keywords
            if ("im".Equals(query.ActionParameters[0]))
            {
                // instant messaging
                mode = AutomationModalities.InstantMessage;
                query.ActionParameters[0] = "";
            }
            else if ("call".Equals(query.ActionParameters[0]))
            {
                // audio call
                mode = AutomationModalities.Audio;
                query.ActionParameters[0] = "";
            }
            else
            {
                // default
                mode = AutomationModalities.InstantMessage;
            }

            // concat search parameter
            searchName = String.Empty;
            foreach (string param in query.ActionParameters)
            {
                searchName += " " + param;
            }

            // search in lync for contacts
            lyncManager.SearchForGroupOrContact(searchName, 20);
            contacts = new List<Contact>(lyncManager._SearchResultSubscription.Contacts);

            // create results for contacts
            foreach (Contact contact in contacts)
            {
                results.Add(new Result()
                {
                    Title = contact.GetContactInformation(ContactInformationType.DisplayName).ToString()
                            + ", " + contact.GetContactInformation(ContactInformationType.Department).ToString(),
                    SubTitle = contact.GetContactInformation(ContactInformationType.Activity).ToString(),
                    IcoPath = "Images\\app.png",
                    Action = e =>
                    {
                        try
                        {
                            lyncManager.StartConversation(contact, mode);
                        }
                        catch
                        {
                            return false;
                        }
                        return true;
                    }
                });
            }
            return results;
        }

        /// <summary>
        ///
        /// </summary>
        /// <param name="context"></param>
        public void Init(PluginInitContext context)
        {
        }
    }
}


text:
title: Get Started with Nodejs
---
[Node.js](https://nodejs.org/) is a JavaScript runtime built on [Chrome's V8 JavaScript engine](https://developers.google.com/v8/ "Chrome's V8 Engine") enabling JavaScript to be used for server-side programming.

Node.js has become a key part of 'JavaScript Everywhere', encouraging web application development to unify around a single programming language, rather than rely on a different language for writing server side scripts.

### Tutorials:

*   NodeSchool.io interactive lessons
*   The Art of Node (an introduction to Node)
*   Node.js guide
*   Build a blog with Node.js, express and MongoDB

## Books

*   The Node Beginner Book
*   Mastering Node.js
*   Up and Running with Node.js
*   Node Web Development

## Courses

*   Real Time Web with Node.js
*   Essential Node.js from DevelopMentor
*   Introduction to MongoDB using the MEAN Stack
*   The Complete Node.js Developer Course (2nd Edition)

## Blogs

*   The Node.js blog
*   How To Node
*   DailyJS
*   Nodejitsu blog
*   js-deflate for gzipping of data to make it fit in URLs
*   Ryan Wilcox's Whitepaper
*   devthought

### More Information:
*   Stackoverflow.com: How do I get started with Node.js?
*   Node.js Official Website: How do I start with Node.js after I installed it?


text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="description" content="">
  <meta name="author" content="">

  <title>Contact Us - Doraemon Fan Club, Singapore</title>

  <link rel="shortcut icon" type="image/png" href="img/favicon.ico">

  <link href="css/bootstrap.min.css" rel="stylesheet">

  <link href="css/business-casual.css" rel="stylesheet">

Contact
          Doraemon Fan Club, Singapore

As a fan club that looks for every opportunity to improve, every feedback we received is
          important to us. There are various ways to contact us! You can send us an email, or simply fill in the form
          below!

Send us an email!

We will reply you within 7 working days* upon receiving your email.

For General enquiry,

          enquiry@doraemonfanclubsg.com

For Business enquiry,

          business@doraemonfanclubsg.com

For Sales enquiry,

          sales@doraemonfanclubsg.com

Facebook Online Hours*:

          No available hours

          Click here to enter our Facebook
          page!

*Refer to NOTICE FOR CEASE OF OPERATIONS


text:
type Resolver<T> = (value?: T) => void;

class QueueEntry<T> {
  data: T;
  next?: QueueEntry<T>

  constructor(data: T) {
    this.data = data;
  }
}

/**
 * A linked queue implementation.
 */
export class Queue<T> {
  head?: QueueEntry<T>;
  tail?: QueueEntry<T>;

  /**
   * Adds an item to the queue.
   * @param data
   */
  enqueue(data: T): void {
    const newNode = new QueueEntry<T>(data);
    if (this.tail) {
      this.tail.next = newNode;
    }
    this.tail = newNode;

    // Queue is empty. Initialise the head.
    if (!this.head) {
      this.head = this.tail;
    }
  }

  /**
   * Removes an item from the queue and returns it.
   * @returns {T} the removed item.
   * @throws an error if the list is empty.
   */
  dequeue(): T {
    if (this.isEmpty()) {
      throw new Error('Cannot dequeue. Queue is empty');
    }
    const node = this.head!.data;
    this.head = this.head!.next;
    return node;
  }

  /**
   * Checks if the Queues is empty
   * @returns {boolean} true if the Queue is empty.
   */
  isEmpty(): boolean {
    return this.head == null;
  }
}

/**
 * The AsyncBlockingQueue implements a queue with an asynchronous programming model. Items can
 * be added to the Queue as usual. When dequeing, a Promise is returned.
 *
 * The promise will resolve instantly if the Queue is not empty. If the Queue is empty, the Promise
 * will be resolved when a new item is added to the queue.
 */
export class AsyncBlockingQueue<T> {
  private promiseQueue: Queue<Promise<T>> = new Queue<Promise<T>>();
  private resolverQueue: Queue<Resolver<T>> = new Queue<Resolver<T>>();

  private add(): void {
    const promise = new Promise<T>(resolve => {
      this.resolverQueue.enqueue(resolve);
    });
    this.promiseQueue.enqueue(promise);
  }

  /**
   * Enqueues an item
   * @param data
   */
  enqueue(data: T): void {
    if (this.resolverQueue.isEmpty()) {
      this.add();
    }
    const resolve = this.resolverQueue.dequeue();
    resolve(data);
  }

  /**
   * Asynchronously dequeues an item. If the queue is empty, the returned Promise is resolved when
   * an item is added. Otherwise, it will return one o the existing items.
   * @returns {Promise<T>} that resolves to the data.
   */
  async dequeue(): Promise<T> {
    if (this.promiseQueue.isEmpty()) {
      this.add();
    }
    return this.promiseQueue.dequeue();
  }

  hasPendingPromises(): boolean {
    return !this.promiseQueue.isEmpty();
  }

  hasPendingResolvers(): boolean {
    return !this.resolverQueue.isEmpty();
  }
}


text:
CacheSetLRU::CacheSetLRU(
      CacheBase::cache_t cache_type,
      UInt32 associativity, UInt32 blocksize) :
   CacheSet(cache_type, associativity, blocksize)
{
   m_lru_bits = new UInt8[m_associativity];
   for (UInt32 i = 0; i < m_associativity; i++)
      m_lru_bits[i] = i;
}

CacheSetLRU::~CacheSetLRU()
{
   delete [] m_lru_bits;
}

UInt32
CacheSetLRU::getReplacementIndex()
{
   // Invalidations may mess up the LRU bits
   UInt32 index = m_associativity;
   for (UInt32 i = 0; i < m_associativity; i++)
   {
      if (!m_cache_block_info_array[i]->isValid())
         return i;
      else if (m_lru_bits[i] == (m_associativity-1))
         index = i;
   }
   LOG_ASSERT_ERROR(index < m_associativity, "Error Finding LRU bits");
   return index;
}

void
CacheSetLRU::updateReplacementIndex(UInt32 accessed_index)
{
   for (UInt32 i = 0; i < m_associativity; i++)
   {
      if (m_lru_bits[i] < m_lru_bits[accessed_index])
         m_lru_bits[i] ++;
   }
   m_lru_bits[accessed_index] = 0;
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="generator" content="rustdoc">
    <meta name="description" content="API documentation for the Rust `statvfs` struct in crate `libc`.">
    <meta name="keywords" content="rust, rustlang, rust-lang, statvfs">

    <title>libc::statvfs - Rust</title>

    <link rel="stylesheet" type="text/css" href="../normalize.css">
    <link rel="stylesheet" type="text/css" href="../rustdoc.css">
    <link rel="stylesheet" type="text/css" href="../main.css">

    <link rel="shortcut icon" href="https://doc.rust-lang.org/favicon.ico">

libc

        <form class="search-form js-only">

                <input class="search-input" name="search"
                       autocomplete="off"
                       placeholder="Click or press 'S' to search, '?' for more options…"
                       type="search">

        </form>

Struct libc::<wbr>statvfs

                       [−]

               [src]

#[repr(C)]

pub struct statvfs {
    pub f_bsize: c_ulong,
    pub f_frsize: c_ulong,
    pub f_blocks: fsblkcnt_t,
    pub f_bfree: fsblkcnt_t,
    pub f_bavail: fsblkcnt_t,
    pub f_files: fsfilcnt_t,
    pub f_ffree: fsfilcnt_t,
    pub f_favail: fsfilcnt_t,
    pub f_fsid: c_ulong,
    pub f_flag: c_ulong,
    pub f_namemax: c_ulong,
    // some fields omitted
}

Fields

                           f_bsize: c_ulong

                           f_frsize: c_ulong

                           f_blocks: fsblkcnt_t

                           f_bfree: fsblkcnt_t

                           f_bavail: fsblkcnt_t

                           f_files: fsfilcnt_t

                           f_ffree: fsfilcnt_t

                           f_favail: fsfilcnt_t

                           f_fsid: c_ulong

                           f_flag: c_ulong

                           f_namemax: c_ulong

Trait Implementations

impl Copy for statvfs

[src]

impl Clone for statvfs

[src]

fn clone(&self) -> statvfs

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more

Help

Keyboard Shortcuts

?

Show this help dialog

S

Focus the search field

⇤

Move up in search results

⇥

Move down in search results

⏎

Go to active search result

+

Collapse/expand all sections

Search Tricks

                    Prefix searches with a type followed by a colon (e.g.
                    fn:) to restrict the search to a given type.

                    Accepted types are: fn, mod,
                    struct, enum,
                    trait, type, macro,
                    and const.

                    Search functions by type signature (e.g.
                    vec -> usize or * -> vec)


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>First City Software</title>
    <meta name="viewport" content="width=device-width">
    <meta name="description" content="We're First City Software and we solve problems with code.">
    <link rel="canonical" href="http://localhost:4000/">

    <link rel="stylesheet" href="/style.css">

    <link rel="stylesheet" href="/css/font-awesome/css/font-awesome.min.css">
    <link href="https://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css">
    <link href='https://fonts.googleapis.com/css?family=Kaushan+Script' rel='stylesheet' type='text/css'>
    <link href="https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic" rel="stylesheet" type="text/css">
    <link href='https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
    <link href='https://fonts.googleapis.com/css?family=Roboto+Slab:400,100,300,700' rel='stylesheet' type='text/css'>

                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                    Toggle navigation

                </button>
                First City Software

                        Services

                        About

                        Team

                        Contact

Welcome To First City Software!

It's Nice To Meet You

                Tell Me More

Services

Have a problem? Here's a few ways we can solve it.

Custom App Design

We're Ruby evangelists and passionate members of the Rails faithful. Have an idea for an web app or a problem to solve? Let us build your solution.

Consulting

Have an app or other solution already deployed but it's not what it could be? We can help you get it there!

Support

Is your app problematic? Our fresh eyes can be just what the doctor ordered to nurse it back to health.

About

The First City Software 'Origin Story'

August 2016

Our Humble Beginnings

In IT for 14 years and closet coder since the age of 12, I started to do freelance work on Ruby on Rails projects with small companies and startups in the Savannah area.

February 2017

An Idea Takes Shape

Realizing that these small companies and startups presented a real need for custom-built applications, First City Software was born! It's mission is simple; help companies and startups solve problems with code.

Be Part

Of Our

Story!

Who We Are

The First City Software Team

Patrick Bentley

CEO/Cofounder

Randal Humphries

CTO/Cofounder

We're passionate, creative, and industrious. Let us solve your problem with code!

Contact Us

Have a problem? Let's chat about it!

                    <form name="sentMessage" id="contactForm" novalidate>

                                    <input type="text" class="form-control" placeholder="Your Name *" id="name" required data-validation-required-message="Please enter your name.">

                                    <input type="email" class="form-control" placeholder="Your Email *" id="email" required data-validation-required-message="Please enter your email address.">

                                    <input type="tel" class="form-control" placeholder="Your Phone *" id="phone" required data-validation-required-message="Please enter your phone number.">

                                    <textarea class="form-control" placeholder="Your Message *" id="message" required data-validation-required-message="Please enter a message."></textarea>

                                <button type="submit" class="btn btn-xl">Send Message</button>

                    </form>

                    Copyright © First City Software 2017

Privacy Policy

Terms of Use


text:
package com.vangent.hieos.xtest.framework;

import com.vangent.hieos.xutil.exception.XdsInternalException;
import com.vangent.hieos.xutil.metadata.structure.Metadata;
import com.vangent.hieos.xutil.metadata.structure.MetadataSupport;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import javax.xml.namespace.QName;

import org.apache.axiom.om.OMAttribute;
import org.apache.axiom.om.OMElement;

public abstract class IdAllocator {

    static final String mgmt_dir = TestConfig.testmgmt_dir;
    static final String assigning_authority_file = mgmt_dir + "assigning_authority.txt";
    static final String patient_id_base_file = mgmt_dir + "patientid_base.txt";
    static final String patient_id_incr_file = mgmt_dir + "patientid_incr.txt";
    protected static final String uniqueid_base_file = mgmt_dir + "uniqueid_base.txt";
    protected static final String uniqueid_index_file = mgmt_dir + "uniqueid_index.txt";
    static final String sourceId_file = mgmt_dir + "sourceId.txt";

    abstract String allocate() throws XdsInternalException;

    // object_type is ExtrinsicObject or RegistryPackage
    //
    // Although the variable names below imply uniqueId, they are use for patient ID also based on the sub-class
    // In reality, this is only used for uniqueIDs.  Patient IDs are handled in a new way
    //
    public String assign(Metadata metadata, String object_type, String external_identifier_uuid, HashMap<String, String> assignments, List<String> no_assign_uid_to)
            throws XdsInternalException {

        List<OMElement> eos = metadata.getMajorObjects(object_type);
        String new_value = null;
        for (int i = 0; i < eos.size(); i++) {
            OMElement eo = eos.get(i);
            String id = eo.getAttributeValue(MetadataSupport.id_qname);
            if (no_assign_uid_to != null && no_assign_uid_to.contains(id)) {
                continue;
            }
            //if (no_assign_uid_to != null) {
            //	if (id.equals(no_assign_uid_to))
            //		continue;
            //}
            // for all xxx.uniqueId
            List<OMElement> eis = metadata.getExternalIdentifiers(eo, external_identifier_uuid);
            for (int j = 0; j < eis.size(); j++) {
                OMElement ei = eis.get(j);
                OMAttribute uniqueid_value_att = ei.getAttribute(new QName("value"));
                String old_value = uniqueid_value_att.getAttributeValue();
                new_value = allocate();
                uniqueid_value_att.setAttributeValue(new_value);
                assignments.put(id, new_value);
            }
        }
        return new_value;
    }
}


text:
using Microsoft.Extensions.Configuration;

namespace Eurofurence.App.Server.Services.Abstractions.Lassie
{
    public class LassieConfiguration
    {
        public bool IsConfigured => !string.IsNullOrEmpty(ApiKey);
        public string BaseApiUrl { get; set; }
        public string ApiKey { get; set; }

        public static LassieConfiguration FromConfiguration(IConfiguration configuration)
             => new LassieConfiguration
             {
                 BaseApiUrl = configuration["lassie:baseApiUrl"],
                 ApiKey = configuration["lassie:apiKey"]
             };
    }
}


text:
<?php

namespace Tests\Integration;

use MessageBird\Common\ResponseError;
use MessageBird\Exceptions\MessageBirdException;

class ResponseErrorTest extends BaseTest
{
    public const EXCEPTION_MESSAGE = 'Got error response from the server: %s';

    public const SINGLE_ERROR_JSON = '{"errors":[{"code":25,"description":"foo"}]}';
    public const MULTIPLE_ERRORS_JSON = '{"errors":[{"code":9,"description":"foo"},{"code":25,"description":"bar"}]}';

    public function testSingleError(): void
    {
        self::assertEquals(
            sprintf(self::EXCEPTION_MESSAGE, 'foo'),
            $this->getExceptionMessageFromJson(self::SINGLE_ERROR_JSON)
        );
    }

    private function getExceptionMessageFromJson($json): string
    {
        try {
            new ResponseError(json_decode($json,null, 512, \JSON_THROW_ON_ERROR));
        } catch (MessageBirdException | \JsonException $e) {
            // Expected: we want the error message.
            return $e->getMessage();
        }

        self::fail('No exception thrown');
    }

    public function testMultipleErrors(): void
    {
        self::assertEquals(
            sprintf(self::EXCEPTION_MESSAGE, 'bar'),
            $this->getExceptionMessageFromJson(self::MULTIPLE_ERRORS_JSON)
        );
    }
}


text:
Running the S3Uploader Sample

This sample is a browser application that demonstrates how to make requests to Amazon S3 using the SDK.

For a more detailed description of the code, please visit this writeup.

Open the AWSiOSSDK/samples/S3Uploader/S3Uploader.xcodeproj project file in Xcode.

Configure the sample with your AWS security credentials:

Open the Constants.h file.

Modify the ACCESS_KEY and SECRET_KEY definitions with your AWS Credentials.

Run the project.


text:
<?php

include_once "Mage/Customer/controllers/AccountController.php";

class Interslice_Asirra_Customer_AccountController extends Mage_Customer_AccountController
{
    public function createPostAction()
    {
        /** @var Interslice_Asirra_Helper_Data $helper */
        $helper = Mage::helper('interslice_asirra');
        $request = $this->getRequest();
        $ticket = $request->getPost('Asirra_Ticket');
        if ($helper->validateAsirraChallenge($ticket)) {
            parent::createPostAction();
        } else {
            $session = $this->_getSession();
            $session->addError($this->__('Your Asirra entry is incorrect. Please try again.'));
            $session->setCustomerFormData($request->getPost());
            $this->_redirectReferer();
            return;
        }
    }
}


text:
#import "AWSModel.h"

@class NSString, NSArray;

@interface AWSSNSListPlatformApplicationsResponse : AWSModel {
	NSString* _nextToken;
	NSArray* _platformApplications;
}
@property(retain, nonatomic) NSString* nextToken;
@property(retain, nonatomic) NSArray* platformApplications;
+ (id)JSONKeyPathsByPropertyKey;
+ (id)platformApplicationsJSONTransformer;
- (void).cxx_destruct;
@end


text:
extern crate mpi;

use mpi::*;

// The way ompi fails will kill the current process, other tests cannot go in here.
#[test]
#[should_panic]
fn comm_null_rank() {
  init_null();
  let _ = comm::rank(comm::null());
  finalize();
}


text:
package org.apache.wicket.markup.resolver.inparent;

import org.apache.wicket.markup.resolver.inparent.base.BasePage;
import org.apache.wicket.mock.MockApplication;
import org.apache.wicket.protocol.http.WebApplication;
import org.apache.wicket.util.tester.WicketTestCase;
import org.junit.jupiter.api.Test;

/**
 * Test validating that an auto linked resource from the parent's page is properly resolved in the
 * child page
 */
class AutoLinkResolveInParentsMarkupTest extends WicketTestCase
{

	@Override
	protected WebApplication newApplication()
	{
		return new MockApplication()
		{

			@Override
			public Class<HomePage> getHomePage()
			{
				return HomePage.class;
			}

			@Override
			public void init()
			{
				super.init();

				getMarkupSettings().setAutomaticLinking(true);

				mountPage("/home", HomePage.class);
				mountPage("/base", BasePage.class);
			}
		};
	}

	/**
	 * https://issues.apache.org/jira/browse/WICKET-4141
	 *
	 * @throws Exception
	 */
	@Test
    void resolveResourceFromMarkupInParent() throws Exception
	{
		tester.startPage(HomePage.class);
		tester.assertContains("wicket/resource/org.apache.wicket.markup.resolver.inparent.base.BasePage/theme/logo.png");
	}

}


text:
package org.neo4j.graphdb.traversal;

import org.neo4j.graphdb.Path;
import org.neo4j.graphdb.PathExpander;
import org.neo4j.graphdb.RelationshipExpander;

/**
 * Represents a {@link Path position} and a {@link RelationshipExpander} with a
 * traversal context, for example parent and an iterator of relationships to go
 * next. It's a base to write a {@link BranchSelector} on top of.
 */
public interface TraversalBranch extends Path
{
    /**
     * The parent expansion source which created this {@link TraversalBranch}.
     * @return the parent of this expansion source.
     */
    TraversalBranch parent();

    /**
     * Returns the next expansion source from the expanded relationships
     * from the current node.
     *
     * @param expander an expander to decide which relationships to follow
     * @param metadata the context of the traversal
     * @return the next expansion source from this expansion source.
     */
    TraversalBranch next( PathExpander expander, TraversalContext metadata );

    /**
     * Returns the number of relationships this expansion source has expanded.
     * In this count isn't included the relationship which led to coming here
     * (since that could also be traversed, although skipped, when expanding
     * this source).
     *
     * @return the number of relationships this expansion source has expanded.
     */
    int expanded();

    /**
     * Explicitly tell this branch to be pruned so that consecutive calls to
     * {@link #next(PathExpander, TraversalContext)} is guaranteed to return
     * {@code null}.
     */
    void prune();

    /**
     * @return whether or not the traversal should continue further along this
     * branch.
     */
    boolean continues();

    /**
     * @return whether or not this branch (the {@link Path} representation of
     * this branch at least) should be included in the result of this
     * traversal, i.e. returned as one of the {@link Path}s from f.ex.
     * {@link TraversalDescription#traverse(org.neo4j.graphdb.Node...)}
     */
    boolean includes();

    /**
     * Can change evaluation outcome in a negative direction. For example
     * to force pruning.
     * @param eval the {@link Evaluation} to AND with the current evaluation.
     */
    void evaluation( Evaluation eval );

    /**
     * Initializes this {@link TraversalBranch}, the relationship iterator,
     * {@link Evaluation} etc.
     *
     * @param expander {@link RelationshipExpander} to use for getting relationships.
     * @param metadata {@link TraversalContext} to update on progress.
     */
    void initialize( PathExpander expander, TraversalContext metadata );

    /**
     * Returns the state associated with this branch.
     *
     * Why is this of type {@link Object}? The state object type only exists when
     * specifying the expander in the {@link TraversalDescription}, not anywhere
     * else. So in the internals of the traversal the state type is unknown and ignored.
     *
     * @return the state associated with this branch.
     */
    Object state();
}


text:
require 'rails_helper'

RSpec.describe "calendars/show", type: :view do
  before(:each) do
    @calendar = assign(:calendar, Calendar.create!(
      :type => "Type"
    ))
  end

  it "renders attributes in <p>" do
    render
    expect(rendered).to match(/Type/)
  end
end


text:
A library containing Bitcoin client-side functionality in JavaScript,
most notably ECDSA signing and verification.

# Status

This is currently pretty raw code. We're planning to clean it up,
convert everything into CommonJS modules and put a flexible build
system in place.

Prototype software, use at your own peril.

# License

This library is free and open-source software released under the MIT
license.

# Copyright

BitcoinJS (c) 2011-2012 Stefan Thomas
Released under MIT license
http://bitcoinjs.org/

JSBN (c) 2003-2005 Tom Wu
Released under BSD license
http://www-cs-students.stanford.edu/~tjw/jsbn/

CryptoJS (c) 2009–2012 by Jeff Mott
Released under New BSD license
http://code.google.com/p/crypto-js/


text:
package Controlador;

import java.util.ArrayList;

import Data.CatalogoJugador;
import Data.CatalogoPartida;
import Data.CatalogoPiezas;
import Entidades.Jugador;
import Entidades.Partida;
import Entidades.Pieza;

public class CtrlPartida {

	CatalogoJugador catJug = new CatalogoJugador();
	CatalogoPartida catPart = new CatalogoPartida();
	CatalogoPiezas catPie = new CatalogoPiezas();
	Partida p;
	Jugador j;
	ArrayList<Pieza> piezas;

	public Partida buscarPartida(String dni1, String dni2) {
		Jugador j1 = catJug.getByDni(dni1);
		Jugador j2 = catJug.getByDni(dni2);
		p = catPart.getByJugadores(j1, j2);
		p.setBlancas(catPie.getPiezas(p.getIdPartida(), "Blanca"));
		p.setNegras(catPie.getPiezas(p.getIdPartida(), "Negro"));
		return p;
	}

	public Jugador buscarJugador(String dni) {
		j = catJug.getByDni(dni);
		return j;
	}

	public ArrayList<Pieza> buscarPiezas(int idPartida, String color) {
		piezas = catPie.getPiezas(idPartida, color);
		return piezas;
	}

	public void guardarPartida(Partida p2, Jugador j1, Jugador j2) {
		if(catPart.getById(p2.getJ1(), p2.getJ2()) == null) {
			catPart.add(p2);
			piezas = p2.getBlancas();
			for (Pieza pieza : piezas) {
				catPie.add(pieza, p2);
			}
			piezas = p2.getNegras();
			for (Pieza pieza : piezas) {
				catPie.add(pieza, p2);
			}
		} else {
			catPart.delete(p2);
			catPart.add(p2);
			piezas = p2.getBlancas();
			for (Pieza pieza : piezas) {
				catPie.add(pieza, p2);
			}
			piezas = p2.getNegras();
			for (Pieza pieza : piezas) {
				catPie.add(pieza, p2);
			}
		}

	}

}


text:
import proto  # type: ignore

from google.ads.googleads.v10.enums.types import media_type
from google.ads.googleads.v10.enums.types import mime_type as gage_mime_type

__protobuf__ = proto.module(
    package="google.ads.googleads.v10.resources",
    marshal="google.ads.googleads.v10",
    manifest={
        "MediaFile",
        "MediaImage",
        "MediaBundle",
        "MediaAudio",
        "MediaVideo",
    },
)

class MediaFile(proto.Message):
    r"""A media file.

    This message has `oneof`_ fields (mutually exclusive fields).
    For each oneof, at most one member field can be set at the same time.
    Setting any member of the oneof automatically clears all other
    members.

    .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields

    Attributes:
        resource_name (str):
            Immutable. The resource name of the media file. Media file
            resource names have the form:

            ``customers/{customer_id}/mediaFiles/{media_file_id}``
        id (int):
            Output only. The ID of the media file.

            This field is a member of `oneof`_ ``_id``.
        type_ (google.ads.googleads.v10.enums.types.MediaTypeEnum.MediaType):
            Immutable. Type of the media file.
        mime_type (google.ads.googleads.v10.enums.types.MimeTypeEnum.MimeType):
            Output only. The mime type of the media file.
        source_url (str):
            Immutable. The URL of where the original
            media file was downloaded from (or a file name).
            Only used for media of type AUDIO and IMAGE.

            This field is a member of `oneof`_ ``_source_url``.
        name (str):
            Immutable. The name of the media file. The
            name can be used by clients to help identify
            previously uploaded media.

            This field is a member of `oneof`_ ``_name``.
        file_size (int):
            Output only. The size of the media file in
            bytes.

            This field is a member of `oneof`_ ``_file_size``.
        image (google.ads.googleads.v10.resources.types.MediaImage):
            Immutable. Encapsulates an Image.

            This field is a member of `oneof`_ ``mediatype``.
        media_bundle (google.ads.googleads.v10.resources.types.MediaBundle):
            Immutable. A ZIP archive media the content of
            which contains HTML5 assets.

            This field is a member of `oneof`_ ``mediatype``.
        audio (google.ads.googleads.v10.resources.types.MediaAudio):
            Output only. Encapsulates an Audio.

            This field is a member of `oneof`_ ``mediatype``.
        video (google.ads.googleads.v10.resources.types.MediaVideo):
            Immutable. Encapsulates a Video.

            This field is a member of `oneof`_ ``mediatype``.
    """

    resource_name = proto.Field(
        proto.STRING,
        number=1,
    )
    id = proto.Field(
        proto.INT64,
        number=12,
        optional=True,
    )
    type_ = proto.Field(
        proto.ENUM,
        number=5,
        enum=media_type.MediaTypeEnum.MediaType,
    )
    mime_type = proto.Field(
        proto.ENUM,
        number=6,
        enum=gage_mime_type.MimeTypeEnum.MimeType,
    )
    source_url = proto.Field(
        proto.STRING,
        number=13,
        optional=True,
    )
    name = proto.Field(
        proto.STRING,
        number=14,
        optional=True,
    )
    file_size = proto.Field(
        proto.INT64,
        number=15,
        optional=True,
    )
    image = proto.Field(
        proto.MESSAGE,
        number=3,
        oneof="mediatype",
        message="MediaImage",
    )
    media_bundle = proto.Field(
        proto.MESSAGE,
        number=4,
        oneof="mediatype",
        message="MediaBundle",
    )
    audio = proto.Field(
        proto.MESSAGE,
        number=10,
        oneof="mediatype",
        message="MediaAudio",
    )
    video = proto.Field(
        proto.MESSAGE,
        number=11,
        oneof="mediatype",
        message="MediaVideo",
    )

class MediaImage(proto.Message):
    r"""Encapsulates an Image.

    Attributes:
        data (bytes):
            Immutable. Raw image data.

            This field is a member of `oneof`_ ``_data``.
        full_size_image_url (str):
            Output only. The url to the full size version
            of the image.

            This field is a member of `oneof`_ ``_full_size_image_url``.
        preview_size_image_url (str):
            Output only. The url to the preview size
            version of the image.

            This field is a member of `oneof`_ ``_preview_size_image_url``.
    """

    data = proto.Field(
        proto.BYTES,
        number=4,
        optional=True,
    )
    full_size_image_url = proto.Field(
        proto.STRING,
        number=2,
        optional=True,
    )
    preview_size_image_url = proto.Field(
        proto.STRING,
        number=3,
        optional=True,
    )

class MediaBundle(proto.Message):
    r"""Represents a ZIP archive media the content of which contains
    HTML5 assets.

    Attributes:
        data (bytes):
            Immutable. Raw zipped data.

            This field is a member of `oneof`_ ``_data``.
        url (str):
            Output only. The url to access the uploaded
            zipped data. E.g.
            https://tpc.googlesyndication.com/simgad/123
            This field is read-only.

            This field is a member of `oneof`_ ``_url``.
    """

    data = proto.Field(
        proto.BYTES,
        number=3,
        optional=True,
    )
    url = proto.Field(
        proto.STRING,
        number=2,
        optional=True,
    )

class MediaAudio(proto.Message):
    r"""Encapsulates an Audio.

    Attributes:
        ad_duration_millis (int):
            Output only. The duration of the Audio in
            milliseconds.

            This field is a member of `oneof`_ ``_ad_duration_millis``.
    """

    ad_duration_millis = proto.Field(
        proto.INT64,
        number=2,
        optional=True,
    )

class MediaVideo(proto.Message):
    r"""Encapsulates a Video.

    Attributes:
        ad_duration_millis (int):
            Output only. The duration of the Video in
            milliseconds.

            This field is a member of `oneof`_ ``_ad_duration_millis``.
        youtube_video_id (str):
            Immutable. The YouTube video ID (as seen in
            YouTube URLs). Adding prefix
            "https://www.youtube.com/watch?v=" to this ID
            will get the YouTube streaming URL for this
            video.

            This field is a member of `oneof`_ ``_youtube_video_id``.
        advertising_id_code (str):
            Output only. The Advertising Digital
            Identification code for this video, as defined
            by the American Association of Advertising
            Agencies, used mainly for television
            commercials.

            This field is a member of `oneof`_ ``_advertising_id_code``.
        isci_code (str):
            Output only. The Industry Standard Commercial
            Identifier code for this video, used mainly for
            television commercials.

            This field is a member of `oneof`_ ``_isci_code``.
    """

    ad_duration_millis = proto.Field(
        proto.INT64,
        number=5,
        optional=True,
    )
    youtube_video_id = proto.Field(
        proto.STRING,
        number=6,
        optional=True,
    )
    advertising_id_code = proto.Field(
        proto.STRING,
        number=7,
        optional=True,
    )
    isci_code = proto.Field(
        proto.STRING,
        number=8,
        optional=True,
    )

__all__ = tuple(sorted(__protobuf__.manifest))


text:
package com.jivesoftware.os.routing.bird.health.checkers;

import com.jivesoftware.os.routing.bird.health.HealthCheckResponse;
import com.jivesoftware.os.routing.bird.health.HealthCheckResponseImpl;
import com.jivesoftware.os.routing.bird.health.api.HealthCheckUtil;
import com.jivesoftware.os.routing.bird.health.api.HealthChecker;
import com.jivesoftware.os.routing.bird.health.api.PercentileHealthCheckConfig;
import com.jivesoftware.os.routing.bird.health.api.ResettableHealthCheck;
import org.apache.commons.math.stat.descriptive.DescriptiveStatistics;

import java.util.concurrent.atomic.LongAdder;

/**
 * @author jonathan.colt
 */
public class PercentileHealthChecker implements HealthChecker<Double>, ResettableHealthCheck {

    private final PercentileHealthCheckConfig config;
    private final DescriptiveStatistics dstat;
    private final LongAdder total;

    public PercentileHealthChecker(PercentileHealthCheckConfig config) {
        this.config = config;
        this.dstat = new DescriptiveStatistics(config.getSampleWindowSize());
        this.total = new LongAdder();
    }

    @Override
    public void check(Double sample, String description, String resolution) {
        if (sample != null && sample >= 0) {
            dstat.addValue(sample);
            total.increment();
        }
    }

    @Override
    public HealthCheckResponse checkHealth() throws Exception {

        double health = 1.0f;
        if (total.longValue()> 0) {
            health = Math.min(health, HealthCheckUtil.zeroToOne(config.getMeanMax(), 0, dstat.getMean()));
            health = Math.min(health, HealthCheckUtil.zeroToOne(config.getVarianceMax(), 0, Math.abs(dstat.getVariance())));
            health = Math.min(health, HealthCheckUtil.zeroToOne(config.get50ThPecentileMax(), 0, dstat.getPercentile(50)));
            health = Math.min(health, HealthCheckUtil.zeroToOne(config.get75ThPecentileMax(), 0, dstat.getPercentile(75)));
            health = Math.min(health, HealthCheckUtil.zeroToOne(config.get90ThPecentileMax(), 0, dstat.getPercentile(90)));
            health = Math.min(health, HealthCheckUtil.zeroToOne(config.get95ThPecentileMax(), 0, dstat.getPercentile(95)));
            health = Math.min(health, HealthCheckUtil.zeroToOne(config.get99ThPecentileMax(), 0, dstat.getPercentile(99)));
        }
        return new HealthCheckResponseImpl(config.getName(),
            Math.max(health, 0f),
            status(dstat),
            config.getDescription(),
            config.getResolution(),
            System.currentTimeMillis());

    }

    @Override
    public void reset() {
        dstat.clear();
        total.reset();
    }

    private String status(DescriptiveStatistics dstats) {
        StringBuilder sb = new StringBuilder();
        sb.append(" samples:").append(total.longValue());
        if (total.longValue()> 0) {
            sb.append(" mean:").append(dstats.getMean());
            sb.append(" 50th:").append(dstats.getPercentile(50));
            sb.append(" 75th:").append(dstats.getPercentile(75));
            sb.append(" 90th:").append(dstats.getPercentile(90));
            sb.append(" 95th:").append(dstats.getPercentile(95));
            sb.append(" 99th:").append(dstats.getPercentile(99));
            sb.append(" max:").append(dstats.getMax());
        }
        return sb.toString();
    }

}


text:
ACCEPTED

#### According to
World Register of Marine Species

#### Published in
null

#### Original name
null

### Remarks
null


text:
package org.openxava.model.meta.xmlparse;

import java.util.*;

import org.openxava.util.*;
import org.openxava.util.xmlparse.*;
import org.w3c.dom.*;

/**
 * @author: Javier Paniza
 */
public class AspectsParser extends ParserBase {

	private static Collection allModels;
	private static Map models;
	private static Map exceptModels;
	private boolean applyParsing;

	public AspectsParser(String xmlFileURL, int language) {
		super(xmlFileURL, language);
	}

	public static void clear() {
		allModels = null;
		models = null;
		exceptModels = null;
	}

	public static void configureAspects() throws XavaException {
		AspectsParser enParser = new AspectsParser("aspects.xml", ENGLISH);
		AspectsParser esParser = new AspectsParser("aspectos.xml", ESPANOL);

		// apply of aspects
		enParser.setApplyParsing(true);
		enParser.parse();
		esParser.setApplyParsing(true);
		esParser.parse();

		// aspects definitions
		enParser.setApplyParsing(false);
		enParser.parse();
		esParser.setApplyParsing(false);
		esParser.parse();

		clear();
	}

	private void createAspect(Node n) throws XavaException {
		Element el = (Element) n;
		String name = el.getAttribute(xname[lang]);

		String models = getModelsForAspect(name);
		String exceptModels = getExceptModelsForAspect(name);
		if (Is.emptyStringAll(models, exceptModels) && !isAspectDefineForAllModels(name)) return;

		int scope = Aspects.ALL;
		if (!Is.emptyString(models)) scope = Aspects.FOR;
		else if (!Is.emptyString(exceptModels)) {
			scope = Aspects.EXCEPT_FOR;
			models = exceptModels;
		}
		NodeList l = el.getChildNodes();
		int c = l.getLength();
		for (int i = 0; i < c; i++) {
			if (!(l.item(i) instanceof Element)) continue;
			Element d = (Element) l.item(i);
			String type = d.getTagName();
			if (type.equals(xpostcreate_calculator[lang])) {
				Aspects.addMetaCalculatorPostCreate(models, scope, CalculatorParser.parseCalculator(d, lang));
			}
			else if (type.equals(xpostload_calculator[lang])) {
				Aspects.addMetaCalculatorPostLoad(models, scope, CalculatorParser.parseCalculator(d, lang));
			}
			else if (type.equals(xpostmodify_calculator[lang])) {
				Aspects.addMetaCalculatorPostModify(models, scope, CalculatorParser.parseCalculator(d, lang));
			}
			else if (type.equals(xpreremove_calculator[lang])) {
				Aspects.addMetaCalculatorPreRemove(models, scope, CalculatorParser.parseCalculator(d, lang));
			}
		}
	}

	private boolean isAspectDefineForAllModels(String name) {
		if (allModels == null) return false;
		return allModels.contains(name);
	}

	private String getExceptModelsForAspect(String name) {
		if (exceptModels == null) return "";
		String r = (String) exceptModels.get(name);
		return r==null?"":r;
	}

	private String getModelsForAspect(String name) {
		if (models == null) return "";
		String r = (String) models.get(name);
		return r==null?"":r;
	}

	private void createApply(Node n) throws XavaException {
		Element el = (Element) n;
		String aspect = el.getAttribute(xaspect[lang]);
		String forModels = el.getAttribute(xfor_models[lang]);
		String exceptForModels = el.getAttribute(xexcept_for_models[lang]);
		if (!Is.emptyString(forModels) && !Is.emptyString(exceptForModels)) {
			throw new XavaException("for_models_and_except_for_model_not_compatible");
		}
		if (Is.emptyStringAll(forModels, exceptForModels)) {
			if (allModels == null) allModels = new HashSet();
			allModels.add(aspect);
			return;
		}
		if (!Is.emptyString(forModels)) {
			if (models == null) models = new HashMap();
			models.put(aspect, forModels);
		}
		else {
			if (exceptModels == null) exceptModels = new HashMap();
			exceptModels.put(aspect, exceptForModels);
		}
	}

	protected void createApplys() throws XavaException {
		NodeList l = getRoot().getElementsByTagName(xapply[lang]);
		int c = l.getLength();
		for (int i = 0; i < c; i++) {
			createApply(l.item(i));
		}
	}

	protected void createAspects() throws XavaException {
		NodeList l = getRoot().getElementsByTagName(xaspect[lang]);
		int c = l.getLength();
		for (int i = 0; i < c; i++) {
			createAspect(l.item(i));
		}
	}

	protected void createObjects() throws XavaException {
		if (isApplyParsing()) createApplys();
		else createAspects();
	}

	public boolean isApplyParsing() {
		return applyParsing;
	}

	public void setApplyParsing(boolean aspectsParsing) {
		this.applyParsing = aspectsParsing;
	}

}


text:
Time triggers are used by the Task Scheduler to launch a task at a specific date and time.

# random delay of <time task trigger> : time interval

Returns a delay time that is randomly added to the start time of the specified time task trigger.


text:
package uk.binarycraft.binarycraft.blocks.solars;

import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.ResourceLocation;
import uk.binarycraft.binarycraft.core.GuiHelper;
import org.lwjgl.opengl.GL11;

import java.util.Arrays;

public class SolarPanelGui extends GuiContainer
{

    private static final ResourceLocation guiTexture = new ResourceLocation("binarycraft:textures/gui/solarpanel.png");
    private SolarPanelTileEntity solarPanelTileEntity;
    private EntityPlayer player;

	public SolarPanelGui(EntityPlayer player, SolarPanelTileEntity solarPanelTileEntity)
	{
        super(new SolarPanelContainer(player.inventory, solarPanelTileEntity, player));
		this.solarPanelTileEntity = solarPanelTileEntity;
        this.player = player;
	}

	@Override
	protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY)
	{
		GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
		this.mc.renderEngine.bindTexture(guiTexture);
		int guiX = (this.width - this.xSize) / 2;
		int guiY = (this.height - this.ySize) / 2;
		this.drawTexturedModalRect(guiX, guiY, 0, 0, this.xSize, this.ySize);

        float currentEnergy = solarPanelTileEntity.getEnergyStored(EnumFacing.DOWN);
        float maxEnergy = solarPanelTileEntity.getMaxEnergyStored(EnumFacing.DOWN);
        GuiHelper.drawVerticalBar(this, guiX + 163, guiY + 8, currentEnergy/maxEnergy);

        float currentGeneration = solarPanelTileEntity.getRfGeneratedAtCurrentTime();
        float maxGeneration = solarPanelTileEntity.getMaxRfGeneratedPerTick();
        GuiHelper.drawVerticalBar(this, guiX + 153, guiY + 8, currentGeneration/maxGeneration);

        if (this.isPointInRegion(162, 6, 7, 72, mouseX, mouseY))
            showTooltip(mouseX, mouseY, new String[] {"Power Stored", GuiHelper.getFormattedNumber((int) currentEnergy) + " RF"});

        if (this.isPointInRegion(152, 6, 7, 72, mouseX, mouseY))
            showTooltip(mouseX, mouseY, new String[] {"Power Generation", GuiHelper.getFormattedNumber((int) currentGeneration) + " RF/t"});
	}

    private void showTooltip(int mouseX, int mouseY, String[] text)    {
        String[] tooltip = text;
        drawHoveringText(Arrays.asList(tooltip), mouseX, mouseY);
    }

}


text:
FakeProfile::FakeProfile(const std::string& name)
    : name_(name) {
}

FakeProfile::FakeProfile(const std::string& name, const base::FilePath& path)
    : name_(name),
      path_(path) {
}

std::string FakeProfile::GetProfileName() {
  return name_;
}

base::FilePath FakeProfile::GetPath() const {
  return path_;
}

bool FakeProfile::IsOffTheRecord() const {
  return false;
}

content::DownloadManagerDelegate*
FakeProfile::GetDownloadManagerDelegate() {
  return NULL;
}

net::URLRequestContextGetter* FakeProfile::GetRequestContextForRenderProcess(
    int renderer_child_id) {
  return NULL;
}

net::URLRequestContextGetter* FakeProfile::GetMediaRequestContext() {
  return NULL;
}

net::URLRequestContextGetter*
FakeProfile::GetMediaRequestContextForRenderProcess(
    int renderer_child_id) {
  return NULL;
}

net::URLRequestContextGetter*
FakeProfile::GetMediaRequestContextForStoragePartition(
        const base::FilePath& partition_path,
        bool in_memory) {
  return NULL;
}

void FakeProfile::RequestMIDISysExPermission(
    int render_process_id,
    int render_view_id,
    int bridge_id,
    const GURL& requesting_frame,
    const MIDISysExPermissionCallback& callback) {
}

void FakeProfile::CancelMIDISysExPermissionRequest(
    int render_process_id,
    int render_view_id,
    int bridge_id,
    const GURL& requesting_frame) {
}

content::ResourceContext* FakeProfile::GetResourceContext() {
  return NULL;
}

content::GeolocationPermissionContext*
FakeProfile::GetGeolocationPermissionContext() {
  return NULL;
}

quota::SpecialStoragePolicy* FakeProfile::GetSpecialStoragePolicy() {
  return NULL;
}

scoped_refptr<base::SequencedTaskRunner>
FakeProfile::GetIOTaskRunner() {
  return scoped_refptr<base::SequencedTaskRunner>();
}

Profile* FakeProfile::GetOffTheRecordProfile() {
  return NULL;
}

void FakeProfile::DestroyOffTheRecordProfile() {}

bool FakeProfile::HasOffTheRecordProfile() {
  return false;
}

Profile* FakeProfile::GetOriginalProfile() {
  return this;
}

bool FakeProfile::IsManaged() {
  return false;
}

history::TopSites* FakeProfile::GetTopSites() {
  return NULL;
}

history::TopSites* FakeProfile::GetTopSitesWithoutCreating() {
  return NULL;
}

ExtensionService* FakeProfile::GetExtensionService() {
  return NULL;
}

ExtensionSpecialStoragePolicy* FakeProfile::GetExtensionSpecialStoragePolicy() {
  return NULL;
}

PrefService* FakeProfile::GetPrefs() {
  return NULL;
}

PrefService* FakeProfile::GetOffTheRecordPrefs() {
  return NULL;
}

net::URLRequestContextGetter* FakeProfile::GetRequestContext() {
  return NULL;
}

net::URLRequestContextGetter* FakeProfile::GetRequestContextForExtensions() {
  return NULL;
}

net::SSLConfigService* FakeProfile::GetSSLConfigService() {
  return NULL;
}

HostContentSettingsMap* FakeProfile::GetHostContentSettingsMap() {
  return NULL;
}

bool FakeProfile::IsSameProfile(Profile* profile) {
  return false;
}

base::Time FakeProfile::GetStartTime() const {
  return base::Time();
}

net::URLRequestContextGetter* FakeProfile::CreateRequestContext(
    content::ProtocolHandlerMap* protocol_handlers) {
  return NULL;
}

net::URLRequestContextGetter*
FakeProfile::CreateRequestContextForStoragePartition(
    const base::FilePath& partition_path,
    bool in_memory,
    content::ProtocolHandlerMap* protocol_handlers) {
  return NULL;
}

base::FilePath FakeProfile::last_selected_directory() {
  return base::FilePath();
}

void FakeProfile::set_last_selected_directory(const base::FilePath& path) {}

#if defined(OS_CHROMEOS)
void FakeProfile::ChangeAppLocale(
    const std::string& locale, AppLocaleChangedVia via) {}
void FakeProfile::OnLogin() {}
void FakeProfile::InitChromeOSPreferences() {}
#endif  // defined(OS_CHROMEOS)

PrefProxyConfigTracker* FakeProfile::GetProxyConfigTracker() {
  return NULL;
}

chrome_browser_net::Predictor* FakeProfile::GetNetworkPredictor() {
  return NULL;
}

void FakeProfile::ClearNetworkingHistorySince(base::Time time,
                                              const base::Closure& completion) {
}

GURL FakeProfile::GetHomePage() {
  return GURL();
}

bool FakeProfile::WasCreatedByVersionOrLater(const std::string& version) {
  return false;
}

void FakeProfile::SetExitType(ExitType exit_type) {
}

Profile::ExitType FakeProfile::GetLastSessionExitType() {
  return EXIT_NORMAL;
}


text:
<%#
 Copyright 2013-2018 the original author or authors from the JHipster project.

 This file is part of the JHipster project, see http://www.jhipster.tech/
 for more information.

 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.
-%>
import { Injectable } from '@angular/core';
import { Http, Response } from '@angular/http';
import { Observable } from 'rxjs/Observable';

import { Session } from './session.model';
import { SERVER_API_URL } from '../../app.constants';

@Injectable()
export class SessionsService {

    private resourceUrl = SERVER_API_URL + 'api/account/sessions/';
    constructor(private http: Http) { }

    findAll(): Observable<Session[]> {
        return this.http.get(this.resourceUrl).map((res: Response) => res.json());
    }

    delete(series: string): Observable<Response> {
        return this.http.delete(`${this.resourceUrl}${series}`);
    }
}


text:
Iphone icloud get information in node JS :-)
=========

Iphone icloud get information is a nodejs Application in HTML5 that let you access a icloud blocked *iPhone*.

With this, you can monitor and get all the information from your iPhone. So you will also be able to
- understand what information you give to others when you agree to fake the famous "albert.apple.com" in your hosts file either on mac or windows, as some people says that this will bypass the icloud lock
- understand how poor is the engineering behind people talking about doulci ...
- understand some basic of the exchange between itunes and your iphone

This application is dedicated to developper and is for *educational purpose only*, done on free time because I was fed up seeing people waiting for doulci.net ... and so many people -faking- and creating their own fake bypass service.

So I crappy writed this quickly ...

Version
----
0.5

Dependency
----
The app has been written completely in SailsJS.

Tech
-----------

Iphone Bypass Nodejs uses open source projects to work properly:

* [SailsJs, version 0.10.5] - awesome MVC framework

Features and roadmap
-----------
If anyone would like to participate to this, I would be glad including more people on this project :-)

All information are logged in the console from now in the future
- data will be displayed in the browser
- data will be stored in mongodb (using deployd)
- data will be browsable (we also will be able to search information)
- data and information of the iphone will be analyzed

How to use ?
-----------
This is up your plateform, but by the way :
- Macosx : modify your /etc/hosts and add "127.0.0.1 albert.apple.com"
- Windows : modify your hosts file and add "127.0.0.1 albert.apple.com"

Then you launch the app in a console after you installed sailjs.

Then you launch itunes and connect your iphone.

Installation & running
--------------

```sh
git clone [git-repo-url] iphoneBypassNodeJs
cd iphoneBypassNodeJs
sudo sails lift
```

License
----
MIT

[Waterzo]:http://www.digit-prime.com/


text:
package net.dougqh.jak.jvm.assembler;

import static net.dougqh.jak.matchers.Matchers.*;
import static org.junit.Assert.*;
import static net.dougqh.jak.Jak.*;

import org.junit.Test;

public final class FlagsTest {
	public final @Test void flags() {
		assertThat(
			final_().private_(),
			is( private_().final_() ) );

		assertThat(
			abstract_().protected_(),
			is( protected_().abstract_() ) );

		assertThat(
			native_().public_(),
			is( public_().native_() ) );

		assertThat(
			transient_().volatile_(),
			is( volatile_().transient_() ) );

		assertThat(
			varargs().strictfp_(),
			is( strictfp_().varargs() ) );

		assertThat(
			synchronized_().final_(),
			is( final_().synchronized_() ) );
	}
}


text:
<?php

final class CelerityResourceTransformer extends Phobject {

  private $minify;
  private $rawURIMap;
  private $celerityMap;
  private $translateURICallback;
  private $currentPath;
  private $postprocessorKey;
  private $variableMap;

  public function setPostprocessorKey($postprocessor_key) {
    $this->postprocessorKey = $postprocessor_key;
    return $this;
  }

  public function getPostprocessorKey() {
    return $this->postprocessorKey;
  }

  public function setTranslateURICallback($translate_uricallback) {
    $this->translateURICallback = $translate_uricallback;
    return $this;
  }

  public function setMinify($minify) {
    $this->minify = $minify;
    return $this;
  }

  public function setCelerityMap(CelerityResourceMap $celerity_map) {
    $this->celerityMap = $celerity_map;
    return $this;
  }

  public function setRawURIMap(array $raw_urimap) {
    $this->rawURIMap = $raw_urimap;
    return $this;
  }

  public function getRawURIMap() {
    return $this->rawURIMap;
  }

  /**
   * @phutil-external-symbol function jsShrink
   */
  public function transformResource($path, $data) {
    $type = self::getResourceType($path);

    switch ($type) {
      case 'css':
        $data = $this->replaceCSSPrintRules($path, $data);
        $data = $this->replaceCSSVariables($path, $data);
        $data = preg_replace_callback(
          '@url\s*\((\s*[\'"]?.*?)\)@s',
          nonempty(
            $this->translateURICallback,
            array($this, 'translateResourceURI')),
          $data);
        break;
    }

    if (!$this->minify) {
      return $data;
    }

    // Some resources won't survive minification (like Raphael.js), and are
    // marked so as not to be minified.
    if (strpos($data, '@'.'do-not-minify') !== false) {
      return $data;
    }

    switch ($type) {
      case 'css':
        // Remove comments.
        $data = preg_replace('@/\*.*?\*/@s', '', $data);
        // Remove whitespace around symbols.
        $data = preg_replace('@\s*([{}:;,])\s*@', '\1', $data);
        // Remove unnecessary semicolons.
        $data = preg_replace('@;}@', '}', $data);
        // Replace #rrggbb with #rgb when possible.
        $data = preg_replace(
          '@#([a-f0-9])\1([a-f0-9])\2([a-f0-9])\3@i',
          '#\1\2\3',
          $data);
        $data = trim($data);
        break;
      case 'js':

        // If `jsxmin` is available, use it. jsxmin is the Javelin minifier and
        // produces the smallest output, but is complicated to build.
        if (Filesystem::binaryExists('jsxmin')) {
          $future = new ExecFuture('jsxmin __DEV__:0');
          $future->write($data);
          list($err, $result) = $future->resolve();
          if (!$err) {
            $data = $result;
            break;
          }
        }

        // If `jsxmin` is not available, use `JsShrink`, which doesn't compress
        // quite as well but is always available.
        $root = dirname(phutil_get_library_root('phabricator'));
        require_once $root.'/externals/JsShrink/jsShrink.php';
        $data = jsShrink($data);

        break;
    }

    return $data;
  }

  public static function getResourceType($path) {
    return last(explode('.', $path));
  }

  public function translateResourceURI(array $matches) {
    $uri = trim($matches[1], "'\" \r\t\n");
    $tail = '';

    // If the resource URI has a query string or anchor, strip it off before
    // we go looking for the resource. We'll stitch it back on later. This
    // primarily affects FontAwesome.

    $parts = preg_split('/(?=[?#])/', $uri, 2);
    if (count($parts) == 2) {
      $uri = $parts[0];
      $tail = $parts[1];
    }

    $alternatives = array_unique(
      array(
        $uri,
        ltrim($uri, '/'),
      ));

    foreach ($alternatives as $alternative) {
      if ($this->rawURIMap !== null) {
        if (isset($this->rawURIMap[$alternative])) {
          $uri = $this->rawURIMap[$alternative];
          break;
        }
      }

      if ($this->celerityMap) {
        $resource_uri = $this->celerityMap->getURIForName($alternative);
        if ($resource_uri) {
          // Check if we can use a data URI for this resource. If not, just
          // use a normal Celerity URI.
          $data_uri = $this->generateDataURI($alternative);
          if ($data_uri) {
            $uri = $data_uri;
          } else {
            $uri = $resource_uri;
          }
          break;
        }
      }
    }

    return 'url('.$uri.$tail.')';
  }

  private function replaceCSSVariables($path, $data) {
    $this->currentPath = $path;
    return preg_replace_callback(
      '/{\$([^}]+)}/',
      array($this, 'replaceCSSVariable'),
      $data);
  }

  private function replaceCSSPrintRules($path, $data) {
    $this->currentPath = $path;
    return preg_replace_callback(
      '/!print\s+(.+?{.+?})/s',
      array($this, 'replaceCSSPrintRule'),
      $data);
  }

  public function getCSSVariableMap() {
    $postprocessor_key = $this->getPostprocessorKey();
    $postprocessor = CelerityPostprocessor::getPostprocessor(
      $postprocessor_key);

    if (!$postprocessor) {
      $postprocessor = CelerityPostprocessor::getPostprocessor(
        CelerityDefaultPostprocessor::POSTPROCESSOR_KEY);
    }

    return $postprocessor->getVariables();
  }

  public function replaceCSSVariable($matches) {
    if (!$this->variableMap) {
      $this->variableMap = $this->getCSSVariableMap();
    }

    $var_name = $matches[1];
    if (empty($this->variableMap[$var_name])) {
      $path = $this->currentPath;
      throw new Exception(
        pht(
          "CSS file '%s' has unknown variable '%s'.",
          $path,
          $var_name));
    }

    return $this->variableMap[$var_name];
  }

  public function replaceCSSPrintRule($matches) {
    $rule = $matches[1];

    $rules = array();
    $rules[] = '.printable '.$rule;
    $rules[] = "@media print {\n  ".str_replace("\n", "\n  ", $rule)."\n}\n";

    return implode("\n\n", $rules);
  }

  /**
   * Attempt to generate a data URI for a resource. We'll generate a data URI
   * if the resource is a valid resource of an appropriate type, and is
   * small enough. Otherwise, this method will return `null` and we'll end up
   * using a normal URI instead.
   *
   * @param string  Resource name to attempt to generate a data URI for.
   * @return string|null Data URI, or null if we declined to generate one.
   */
  private function generateDataURI($resource_name) {
    $ext = last(explode('.', $resource_name));
    switch ($ext) {
      case 'png':
        $type = 'image/png';
        break;
      case 'gif':
        $type = 'image/gif';
        break;
      case 'jpg':
        $type = 'image/jpeg';
        break;
      default:
        return null;
    }

    // In IE8, 32KB is the maximum supported URI length.
    $maximum_data_size = (1024 * 32);

    $data = $this->celerityMap->getResourceDataForName($resource_name);
    if (strlen($data) >= $maximum_data_size) {
      // If the data is already too large on its own, just bail before
      // encoding it.
      return null;
    }

    $uri = 'data:'.$type.';base64,'.base64_encode($data);
    if (strlen($uri) >= $maximum_data_size) {
      return null;
    }

    return $uri;
  }

}


text:
<?php

/**
 * Main class for Lydia, holds everything.
 *
 * @package LydiaCore
 */
class CLydia implements ISingleton
{
	private static $instance = null;
	public $config = array();
	public $request;
	public $data;
	public $db;
	public $views;
	public $session;
	public $timer = array();

	/**
	* Constructor
	*/
	protected function __construct()
	{
		session_start();
			// time page generation
		$this->timer['first'] = microtime(true);
		// include the site specific config.php and create a ref to $ly to be used by config.php
		$ly = &$this;
		require(LYDIA_SITE_PATH.'/config.php');

		// Start a named session
		session_name($this->config['session_name']);

		 $this->session = new CSession($this->config['session_key']);
		 $this->session->PopulateFromSession();

		// Set default date/time-zone
		date_default_timezone_set($this->config['timezone']);

		// Create a database object.
		if(isset($this->config['database'][0]['dsn']))
		{
			$this->db = new CDatabase($this->config['database'][0]['dsn']);
		}

		// Create a container for all views and theme data
		$this->views = new CViewContainer();

	}

	/**
	* Singleton pattern. Get the instance of the latest created object or create a new one.
	* @return CLydia The instance of this class.
	*/
	public static function Instance()
	{
		if(self::$instance == null)
		{
			self::$instance = new CLydia();
		}
		return self::$instance;
	}

	/**
	* Frontcontroller, check url and route to controllers.
	*/
	public function FrontControllerRoute()
	{
	    // Take current url and divide it in controller, method and parameters
	    $this->request = new CRequest($this->config['url_type']);
	    $this->request->Init($this->config['base_url']);
	    $controller = $this->request->controller;
	    $method     = $this->request->method;
	    $arguments  = $this->request->arguments;

	    // Is the controller enabled in config.php?
	    $controllerExists   = isset($this->config['controllers'][$controller]);
	    $controllerEnabled   = false;
	    $className          = false;
	    $classExists         = false;

	    if($controllerExists)
	    {
		      $controllerEnabled   = ($this->config['controllers'][$controller]['enabled'] == true);
		      $className          = $this->config['controllers'][$controller]['class'];
		      $classExists         = class_exists($className);
	    }

	    // Check if controller has a callable method in the controller class, if then call it
	    if($controllerExists && $controllerEnabled && $classExists)
	    {

		      $rc = new ReflectionClass($className);
		      if($rc->implementsInterface('IController'))
		      {
		      	      if($rc->hasMethod($method))
		      	      {
		      	      	      $controllerObj = $rc->newInstance();
		      	      	      $methodObj = $rc->getMethod($method);
		      	      	      if($methodObj->isPublic())
		      	      	      {
		      	      	      	      $methodObj->invokeArgs($controllerObj, $arguments);
		      	      	      }
		      	      	      else
		      	      	      {
		      	      	      	      die("404. " . get_class() . ' error: Controller method not public.');
		      	      	      }
		      	      }
		      	      else
		      	      {
		      	      	      die("404. " . get_class() . ' error: Controller does not contain method.');
		      	      }
		      }
		      else
		      {
		      	      die('404. ' . get_class() . ' error: Controller does not implement interface IController.');
		      }
	    }
	    else
	    {
	    	    die('404. Page is not found.');
	    }
	    $formattedMethod = str_replace(array('_', '-'), '', $method);

	}

	/**
	* ThemeEngineRender, renders the reply of the request to HTML or whatever.
	*/
	public function ThemeEngineRender()
	{
	    // Get the paths and settings for the theme
	    $themeName   = $this->config['theme']['name'];
	    $themePath   = LYDIA_INSTALL_PATH . "/themes/{$themeName}";
	    $themeUrl    = $this->request->base_url . "themes/{$themeName}";

	    // Add stylesheet path to the $ly->data array
	    $this->data['stylesheet'] = "{$themeUrl}/style.css";

	    // Include the global functions.php and the functions.php that are part of the theme
	    $ly = &$this;
	    include(LYDIA_INSTALL_PATH . '/themes/functions.php');
	    $functionsPath = "{$themePath}/functions.php";
	    if(is_file($functionsPath))
	    {
	    	    include $functionsPath;
	    }

	    // Extract $ly->data to own variables and handover to the template file
	    //extract($this->data);
	    //include("{$themePath}/default.tpl.php");
	    // Extract $ly->data and $ly->view->data to own variables and handover to the template file
	    extract($this->data);
	    extract($this->views->GetData());
	    include("{$themePath}/default.tpl.php");
	}

}


text:
cask :v1 => 'narodmon' do
  version '1.5.2'
  sha256 '25bdc9c9414ef2b6330553d3ad769642eee61d2dd564159663a63c96f2769d6d'

  # github.com is the official download host per the vendor homepage
  url "https://github.com/niki-timofe/NarodMonOSX/releases/download/#{version}/NarodMon.zip"
  appcast 'https://github.com/niki-timofe/NarodMonOSX/releases.atom'
  name 'NarodMon'
  homepage 'http://narodmon.ru/'
  license :mit

  app 'NarodMon.app'
end


text:
using System;
using System.Collections.Generic;
using System.Linq;
using Turbo.Plugins.Default;
// original idea by seadragon (glq)
namespace Turbo.Plugins.Jack.Game
{
    public class UberRunsPlugin : BasePlugin, IInGameWorldPainter, INewAreaHandler, IInGameTopPainter
    {
        public GroundLabelDecorator MarkerDecorator { get; set; }
        public IFont CompletedFont { get; set; }
        public IFont CompletedCounterFont { get; set; }

        public string CompletedLabel { get; set; }
        public string CompletedCounterLabel { get; set; }
        public string Portal1Label { get { return uberEncounterStates[areaSno1].Label; } set { uberEncounterStates[areaSno1].Label = value; } }
        public string Portal2Label { get { return uberEncounterStates[areaSno2].Label; } set { uberEncounterStates[areaSno2].Label = value; } }
        public string Portal3Label { get { return uberEncounterStates[areaSno3].Label; } set { uberEncounterStates[areaSno3].Label = value; } }
        public string Portal4Label { get { return uberEncounterStates[areaSno4].Label; } set { uberEncounterStates[areaSno4].Label = value; } }

        private Dictionary<uint, UberAreaDefinition> uberEncounterStates;
        private HashSet<ActorSnoEnum> uberPortalSnos;
        private int gameRunCompletedCounter;
        private bool gameRunCompleted;

        private const uint portalAreaSno = 257116;
        private const ActorSnoEnum portalSno1 = (ActorSnoEnum)258384;
        private const ActorSnoEnum portalSno2 = (ActorSnoEnum)258385;
        private const ActorSnoEnum portalSno3 = (ActorSnoEnum)258386;
        private const ActorSnoEnum portalSno4 = (ActorSnoEnum)366533;
        private const uint areaSno1 = 256767;
        private const uint areaSno2 = 256106;
        private const uint areaSno3 = 256742;
        private const uint areaSno4 = 374239;

        public UberRunsPlugin()
        {
            Enabled = true;
            uberEncounterStates = new Dictionary<uint, UberAreaDefinition>();
        }

        public override void Load(IController hud)
        {
            base.Load(hud);

            MarkerDecorator = new GroundLabelDecorator(Hud)
            {
                BackgroundBrush = Hud.Render.CreateBrush(255, 255, 0, 0, 0),
                BorderBrush = Hud.Render.CreateBrush(192, 255, 255, 255, 1),
                TextFont = Hud.Render.CreateFont("tahoma", 10f, 255, 255, 255, 255, true, false, false),
            };

            CompletedFont = Hud.Render.CreateFont("tahoma", 9, 255, 255, 0, 0, true, false, true);
            CompletedCounterFont = Hud.Render.CreateFont("tahoma", 8, 255, 239, 220, 129, false, false, true);

            CompletedLabel = "Uber game done!";
            CompletedCounterLabel = "Uber runs :";

            uberEncounterStates.Add(areaSno1, new UberAreaDefinition(areaSno1, portalSno1, "A1 done"));
            uberEncounterStates.Add(areaSno2, new UberAreaDefinition(areaSno2, portalSno2, "A2 done"));
            uberEncounterStates.Add(areaSno3, new UberAreaDefinition(areaSno3, portalSno3, "A3 done"));
            uberEncounterStates.Add(areaSno4, new UberAreaDefinition(areaSno4, portalSno4, "A4 done"));

            uberPortalSnos = new HashSet<ActorSnoEnum>(uberEncounterStates.Select(a => a.Value.PortalSno));
        }

        public void OnNewArea(bool newGame, ISnoArea area)
        {
            if (newGame)
            {
                foreach (var state in uberEncounterStates)
                {
                    state.Value.Visited = false;
                }
                gameRunCompleted = false;
            }
            else if (!gameRunCompleted)
            {
                if (uberEncounterStates.ContainsKey(area.Sno))
                {
                    uberEncounterStates[area.Sno].Visited = true;
                }

                if (uberEncounterStates.All(a => a.Value.Visited))
                {
                    gameRunCompletedCounter++;
                    gameRunCompleted = true;
                }
            }
        }

        public void PaintWorld(WorldLayer layer)
        {
            if (layer != WorldLayer.Ground) return;
            if (Hud.Game.Me.SnoArea.Sno != portalAreaSno) return;

            foreach (var portal in Hud.Game.Actors.Where(a => uberPortalSnos.Contains(a.SnoActor.Sno)))
            {
                var encounterState = uberEncounterStates.Where(a => a.Value.PortalSno == portal.SnoActor.Sno).Select(a => a.Value).FirstOrDefault();
                if (encounterState != null && encounterState.Visited)
                {
                    MarkerDecorator.Paint(portal, portal.FloorCoordinate.Offset(0, 0, 6f), encounterState.Label);
                }
            }
        }

        public void PaintTopInGame(ClipState clipState)
        {
            if (clipState != ClipState.BeforeClip) return;

            var ui = Hud.Render.MinimapUiElement.Rectangle;

            if (gameRunCompleted && !string.IsNullOrEmpty(CompletedLabel))
            {
                CompletedFont.DrawText(CompletedLabel, ui.Left, ui.Top);
            }

            if (gameRunCompletedCounter != 0 && !string.IsNullOrEmpty(CompletedCounterLabel))
            {
                CompletedCounterFont.DrawText(CompletedCounterLabel + gameRunCompletedCounter, ui.Left, ui.Top / 2f);
            }
        }

        private class UberAreaDefinition
        {
            public bool Visited { get; set; }
            public string Label { get; set; }
            public uint AreaSno { get; private set; }
            public ActorSnoEnum PortalSno { get; private set; }

            public UberAreaDefinition(uint areaSno, ActorSnoEnum portalSno, string label)
            {
                Label = label;
                AreaSno = areaSno;
                PortalSno = portalSno;
            }
        }
    }
}


text:
angular
    .module('momentum.actions')
    .directive('exampleFeed', exampleFeed);

function exampleFeed() {

  return {
    restrict: 'E',
    bindToController: true,
    controller : 'actionsCtrl as Feed',
    scope: {
      campaignId: "@",
      actionId: "@",
      action: "@",
    },
    link: link,
    template: '

'
  };

  function link(scope, element, attr, ctrl) {
    ctrl.url = '/directives/' + attr.action + '.feed.html';
    ctrl.newAction = {};
    ctrl.actions = [];
    ctrl.feed();

    // Listern for new actions and add to records
    scope.$on('newAction', function(event, data) {
      ctrl.actions.push(data);
    });
  }

}