text:
<!DOCTYPE html>

        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <title>PRIMEIROS PASSOS COM BRACKETS</title>
        <meta name="description" content="Um guia interativo de primeiros passos para Brackets.">
        <link rel="stylesheet" href="main.css">

PRIMEIROS PASSOS COM BRACKETS

Este é o seu guia!

    Bem-vindo a uma superprecoce pré-visualização de Brackets, um novo editor open-source para a próxima geração da web. Nós somos grandes fãs dos padrões e queremos construir melhores ferramentas para JavaScript, HTML e CSS
    e relacionadas tecnologias abertas da web. Este é o nosso humilde começo.

    Você está olhando para uma versão precoce de Brackets.
    De muitas maneiras, Brackets é um tipo diferente de editor. Uma diferença notável é que este editor é escrito em JavaScript. Assim, enquanto Brackets poderia não estar pronto para seu uso no dia-a-dia ainda, estamos usando-o todos os dias para criar Brackets.

Nós estamos tentando algumas coisas novas

Edição Rápida de CSS e JavaScript

    Ao editar HTML, use o atalho Cmd/Ctrl + E para abrir um editor rápido embutido que exibe todos os CSS relacionados. Faça um ajuste ao seu CSS, pressione ESC e você estará de volta editando HTML. Ou simplesmente deixe as regras CSS abertas e elas se tornarão parte de seu editor HTML.
    Se você pressionar ESC fora de um editor rápido, todos eles vão recolher. Sem mais comutação entre documentos perdendo seu contexto.

<samp>
    Quer vê-lo em ação? Coloque o cursor sobre o tag  acima e pressione Cmd/Ctrl + E. Você deverá ver um editor rápido de CSS aparecer acima. À direita, você verá uma lista de regras CSS que estão relacionadas com esta tag.Simplesmente role as regras com Alt + Up/Down para encontrar o que deseja editar.
</samp>

Visualizar as alterações CSS ao vivo no navegador

    Você sabe aquela "dança salvar/recarregar" que temos feito há anos? Aquela onde você faz mudanças no seu editor, clica em salvar, alterna para o navegador e então recarrega a pagina para finalmente ver o resultado Com Brackets, você não precisa fazer essa dança.

    Brackets vai abrir uma conexão ao vivo com o seu navegador local e vai empurrar atualizações CSS enquanto você digita! Você já deve estar fazendo alguma coisa como esta hoje com ferramentas baseadas em navegador, mas com Brackets
    não há necessidade de copiar e colar o CSS final de volta para o editor. Seu código é executado no navegador, mas vive em seu editor!

<samp>
    Se você tem o Google Chrome instalado, você pode tentar fazer isso sozinho. Clique no ícone em forma de raio no canto superior direito ou pressione Cmd/Ctrl + Alt + P. Quando a Visualização ao Vivo (Live Preview) é habilitada em um documento HTML, todos os documentos CSS vinculados podem ser editados em tempo real. O ícone vai mudar de cinza para ouro quando Brackets estabelecer uma conexão com o seu navegador.

    Agora, coloque o cursor sobre o tag  acima e use Cmd/Ctrl + E para abrir as regras CSS definidas. Tente mudar o tamanho da borda de 1px para 10px ou alterar a cor de fundo de "dimgray" para "hotpink". Se você tem Brackets e seu navegador rodando lado a lado, você vai ver as alterações refletidas instantaneamente no seu navegador. Legal, certo?
</samp>

    Atualmente, Brackets suporta Visualização ao Vivo (Live Preview) apenas para CSS. Iremos adicionar suporte à Visualização ao Vivo (Live Preview) para HTML e JavaScript em uma versão futura. Visualizações ao vivo atualmente só são possíveis com Google Chrome. Nós queremos trazer esta funcionalidade para todos os principais navegadores, e estamos ansiosos para trabalhar com os fornecedores.

Envolva-se

    Brackets é um projeto open-source. Desenvolvedores web de todo o mundo estão a contribuir para criar um editor de código melhor. Diga-nos o que você pensa, partilhe as suas ideias ou contribua diretamente para o projeto.

Brackets.io

Blog da Equipe Brackets

Brackets no GitHub

Brackets Wiki

Mailing List Desenvolvedores Brackets

@Brackets no Twitter

Fale com os desenvolvedores no canal IRC #brackets no Freenode


text:
require "spec_helper"

require "hamster/immutable"

describe Hamster::Immutable do

  class Fixture
    include Hamster::Immutable
  end

  [:dup, :clone].each do |method|

    describe "##{method}" do

      before do
        @original = Fixture.new
        @result = @original.send(method)
      end

      it "returns self" do
        @result.should equal(@original)
      end

    end

  end

end

redpajama_set_name: RedPajamaGithub


text:
import {Directive, Inject, Input, OnChanges, Optional, Output, Self, SimpleChanges, forwardRef} from '@angular/core';

import {EventEmitter} from '../../facade/async';
import {ListWrapper, StringMapWrapper} from '../../facade/collection';
import {isBlank} from '../../facade/lang';
import {FormArray, FormControl, FormGroup} from '../../model';
import {NG_ASYNC_VALIDATORS, NG_VALIDATORS, Validators} from '../../validators';
import {ControlContainer} from '../control_container';
import {Form} from '../form_interface';
import {ReactiveErrors} from '../reactive_errors';
import {cleanUpControl, composeAsyncValidators, composeValidators, setUpControl, setUpFormContainer} from '../shared';

import {FormControlName} from './form_control_name';
import {FormArrayName, FormGroupName} from './form_group_name';

export const formDirectiveProvider: any = {
  provide: ControlContainer,
  useExisting: forwardRef(() => FormGroupDirective)
};

/**
 * @whatItDoes Binds an existing {@link FormGroup} to a DOM element.
 *
 * @howToUse
 *
 * This directive accepts an existing {@link FormGroup} instance. It will then use this
 * {@link FormGroup} instance to match any child {@link FormControl}, {@link FormGroup},
 * and {@link FormArray} instances to child {@link FormControlName}, {@link FormGroupName},
 * and {@link FormArrayName} directives.
 *
 * **Set value**: You can set the form's initial value when instantiating the
 * {@link FormGroup}, or you can set it programmatically later using the {@link FormGroup}'s
 * {@link AbstractControl.setValue} or {@link AbstractControl.patchValue} methods.
 *
 * **Listen to value**: If you want to listen to changes in the value of the form, you can subscribe
 * to the {@link FormGroup}'s {@link AbstractControl.valueChanges} event.  You can also listen to
 * its {@link AbstractControl.statusChanges} event to be notified when the validation status is
 * re-calculated.
 *
 * ### Example
 *
 * In this example, we create form controls for first name and last name.
 *
 * {@example forms/ts/simpleFormGroup/simple_form_group_example.ts region='Component'}
 *
 * **npm package**: `@angular/forms`
 *
 * **NgModule**: {@link ReactiveFormsModule}
 *
 *  @stable
 */
@Directive({
  selector: '[formGroup]',
  providers: [formDirectiveProvider],
  host: {'(submit)': 'onSubmit()', '(reset)': 'onReset()'},
  exportAs: 'ngForm'
})
export class FormGroupDirective extends ControlContainer implements Form,
    OnChanges {
  private _submitted: boolean = false;
  private _oldForm: FormGroup;
  directives: FormControlName[] = [];

  @Input('formGroup') form: FormGroup = null;
  @Output() ngSubmit = new EventEmitter();

  constructor(
      @Optional() @Self() @Inject(NG_VALIDATORS) private _validators: any[],
      @Optional() @Self() @Inject(NG_ASYNC_VALIDATORS) private _asyncValidators: any[]) {
    super();
  }

  ngOnChanges(changes: SimpleChanges): void {
    this._checkFormPresent();
    if (StringMapWrapper.contains(changes, 'form')) {
      this._updateValidators();
      this._updateDomValue();
      this._updateRegistrations();
    }
  }

  get submitted(): boolean { return this._submitted; }

  get formDirective(): Form { return this; }

  get control(): FormGroup { return this.form; }

  get path(): string[] { return []; }

  addControl(dir: FormControlName): FormControl {
    const ctrl: any = this.form.get(dir.path);
    setUpControl(ctrl, dir);
    ctrl.updateValueAndValidity({emitEvent: false});
    this.directives.push(dir);
    return ctrl;
  }

  getControl(dir: FormControlName): FormControl { return <FormControl>this.form.get(dir.path); }

  removeControl(dir: FormControlName): void { ListWrapper.remove(this.directives, dir); }

  addFormGroup(dir: FormGroupName): void {
    var ctrl: any = this.form.get(dir.path);
    setUpFormContainer(ctrl, dir);
    ctrl.updateValueAndValidity({emitEvent: false});
  }

  removeFormGroup(dir: FormGroupName): void {}

  getFormGroup(dir: FormGroupName): FormGroup { return <FormGroup>this.form.get(dir.path); }

  addFormArray(dir: FormArrayName): void {
    var ctrl: any = this.form.get(dir.path);
    setUpFormContainer(ctrl, dir);
    ctrl.updateValueAndValidity({emitEvent: false});
  }

  removeFormArray(dir: FormArrayName): void {}

  getFormArray(dir: FormArrayName): FormArray { return <FormArray>this.form.get(dir.path); }

  updateModel(dir: FormControlName, value: any): void {
    var ctrl  = <FormControl>this.form.get(dir.path);
    ctrl.setValue(value);
  }

  onSubmit(): boolean {
    this._submitted = true;
    this.ngSubmit.emit(null);
    return false;
  }

  onReset(): void { this.resetForm(); }

  resetForm(value: any = undefined): void {
    this.form.reset(value);
    this._submitted = false;
  }

  /** @internal */
  _updateDomValue() {
    this.directives.forEach(dir => {
      const newCtrl: any = this.form.get(dir.path);
      if (dir._control !== newCtrl) {
        cleanUpControl(dir._control, dir);
        if (newCtrl) setUpControl(newCtrl, dir);
        dir._control = newCtrl;
      }
    });

    this.form._updateTreeValidity({emitEvent: false});
  }

  private _updateRegistrations() {
    this.form._registerOnCollectionChange(() => this._updateDomValue());
    if (this._oldForm) this._oldForm._registerOnCollectionChange(() => {});
    this._oldForm = this.form;
  }

  private _updateValidators() {
    const sync = composeValidators(this._validators);
    this.form.validator = Validators.compose([this.form.validator, sync]);

    const async = composeAsyncValidators(this._asyncValidators);
    this.form.asyncValidator = Validators.composeAsync([this.form.asyncValidator, async]);
  }

  private _checkFormPresent() {
    if (isBlank(this.form)) {
      ReactiveErrors.missingFormException();
    }
  }
}


text:
/* eslint {'import/no-named-as-default': 0, 'import/no-named-as-default-member': 0} */
import React from 'react';

import ButtonBack from '../ButtonBack/ButtonBack';
import ButtonFirst from '../ButtonFirst/ButtonFirst';
import ButtonLast from '../ButtonLast/ButtonLast';
import ButtonNext from '../ButtonNext/ButtonNext';
import ButtonPlay from '../ButtonPlay/ButtonPlay';
import CarouselProvider from '../CarouselProvider/CarouselProvider';
import Dot from '../Dot/Dot';
import DotGroup from '../DotGroup/DotGroup';
import Image from '../Image/Image';
import ImageWithZoom from '../ImageWithZoom/ImageWithZoom';
import Slide from '../Slide/Slide';
import Slider from '../Slider/Slider';
import Spinner from '../Spinner/Spinner';
import Store from '../Store/Store';

export default {
  ButtonBack: {
    component: ButtonBack,
    props: {
      children: 'hello',
      currentSlide: 1,
      step: 1,
      carouselStore: new Store({}),
      totalSlides: 3,
      visibleSlides: 2,
    },
  },
  ButtonFirst: {
    component: ButtonFirst,
    props: {
      children: 'hello',
      currentSlide: 1,
      carouselStore: new Store({
        currentSlide: 1,
        totalSlides: 7,
        visibleSlides: 1,
      }),
      totalSlides: 7,
    },
  },
  ButtonLast: {
    component: ButtonLast,
    props: {
      children: 'hello',
      currentSlide: 1,
      carouselStore: new Store({
        currentSlide: 1,
        totalSlides: 7,
        visibleSlides: 1,
      }),
      totalSlides: 7,
      visibleSlides: 1,
    },
  },
  ButtonNext: {
    component: ButtonNext,
    props: {
      children: 'hello',
      currentSlide: 1,
      step: 1,
      carouselStore: new Store({}),
      totalSlides: 3,
      visibleSlides: 2,
    },
  },
  ButtonPlay: {
    component: ButtonPlay,
    props: {
      carouselStore: new Store({
        isPlaying: false,
      }),
      children: Sup?,
      childrenPause: Play,
      childrenPlay: Pause,
      isPlaying: false,
    },
  },
  CarouselProvider: {
    component: CarouselProvider,
    props: {
      children: 'hello',
      naturalSlideHeight: 125,
      naturalSlideWidth: 100,
      totalSlides: 1,
    },
  },
  Dot: {
    component: Dot,
    props: {
      children: 'hello',
      currentSlide: 0,
      slide: 2,
      carouselStore: new Store({
        currentSlide: 0,
        totalSlides: 10,
        visibleSlides: 2,
      }),
      totalSlides: 10,
      visibleSlides: 2,
    },
  },
  DotGroup: {
    component: DotGroup,
    props: {
      currentSlide: 1,
      carouselStore: new Store({}),
      totalSlides: 3,
      visibleSlides: 2,
    },
  },
  Image: {
    component: Image,
    props: {
      hasMasterSpinner: false,
      orientation: 'horizontal',
      src: 'bob.jpg',
      carouselStore: new Store({}),
    },
  },
  ImageWithZoom: {
    component: ImageWithZoom,
    props: {
      carouselStore: new Store({}),
      src: 'bob.jpg',
    },
  },
  Slide: {
    component: Slide,
    props: {
      currentSlide: 1,
      index: 1,
      naturalSlideHeight: 400,
      naturalSlideWidth: 300,
      orientation: 'horizontal',
      slideSize: 25,
      totalSlides: 4,
      visibleSlides: 2,
    },
  },
  Slider: {
    component: Slider,
    props: {
      carouselStore: new Store({
        currentSlide: 0,
      }),
      children: 'hello',
      currentSlide: 0,
      disableAnimation: false,
      disableKeyboard: false,
      dragEnabled: true,
      hasMasterSpinner: false,
      interval: 5000,
      infinite: false,
      isPageScrollLocked: false,
      isPlaying: false,
      lockOnWindowScroll: false,
      masterSpinnerFinished: false,
      naturalSlideHeight: 100,
      naturalSlideWidth: 100,
      orientation: 'horizontal',
      playDirection: 'forward',
      slideSize: 50,
      slideTraySize: 250,
      step: 2,
      totalSlides: 5,
      touchEnabled: true,
      visibleSlides: 2,
    },
  },
  Spinner: {
    component: Spinner,
    props: {},
  },
};


text: declare function __bootstrap(): any;


text:
<?xml version="1.0" encoding="UTF-8"?><module codename="org.netbeans.modules.java.platform/1">
    <module_version install_time="1370464255366" last="true" origin="installer" specification_version="1.29.1">
        <file crc="3462883279" name="config/ModuleAutoDeps/org-netbeans-modules-java-platform.xml"/>
        <file crc="3178966345" name="config/Modules/org-netbeans-modules-java-platform.xml"/>
        <file crc="2594826013" name="modules/locale/org-netbeans-modules-java-platform_ja.jar"/>
        <file crc="2565872912" name="modules/locale/org-netbeans-modules-java-platform_pt_BR.jar"/>
        <file crc="560440936" name="modules/locale/org-netbeans-modules-java-platform_ru.jar"/>
        <file crc="1436791851" name="modules/locale/org-netbeans-modules-java-platform_zh_CN.jar"/>
        <file crc="1077904977" name="modules/org-netbeans-modules-java-platform.jar"/>
    </module_version>
</module>


text:
<?php

/* @var $this yii\web\View */
use yii\helpers\Html;
use yii\grid\GridView;
use common\models\Person;

$this->title = 'Sistema de gestión de usuarios';
?>

Control de usuarios

Plataforma para administrar la información de los empleados y clientes en Osmapigo Corp.

Administrar usuarios

Administrar los usuarios de la plataforma.

<?= Html::a('Administrar usuarios', ['../person/index'], ['class' => 'btn btn-success']) ?>

Administrar mi usuario

Administrar los datos de mi propio usuario en la plataforma.

<?= Html::a('Mi usuario', ['/person/view?id='. Person::findOne(['fk_user' => Yii::$app->user->identity->email])->id], ['class' => 'btn btn-success']) ?>


text:
train_file="../../../data/train.full"
valid_file="../../../data/valid.full"
test_file="../../../data/test.full"
neuron_type="LSTM" # RNN/LSTM
train_method="ALL"
projection_size=50
hidden_size=50
stack_size=1
learning_rate=0
minibatch_size=100
max_epoch=1000
save_model="model/full/pro"$projection_size".h"$hidden_size".mini"$minibatch_size".neuron"$neuron_type""
#load_model=""

# train
#python lm_v4.py --train $train_file --valid $valid_file --neuron-type $neuron_type --train-method $train_method --projection-size $projection_size --hidden-size $hidden_size --stack $stack_size --learning-rate $learning_rate --minibatch-size $minibatch_size --max-epoch $max_epoch --save-net $save_model --early-stop 0

# test
THEANO_FLAGS='floatX=float32,device=gpu0' python lm_v4.py --test $test_file --train-method $train_method --load-net $save_model


text:
#include <hydra/resources/resources.hpp>
#include <ntools/cmdline/cmdline.hpp>
#include <hydra/hydra_debug.hpp>
#include <hydra/engine/core_context.hpp>
#include <hydra/engine/engine.hpp>
#include <hydra/glfw/glfw.hpp>

#include "fs_watcher.hpp"
#include "packer_engine_module.hpp"
#include "packer_ui.hpp"

#include "options.hpp"

using namespace neam;

void make_index(const global_options& gbl_opt)
{
  hydra::core_context ctx;
  ctx.res.source_folder = gbl_opt.source_folder;
  ctx.io.set_prefix_directory(gbl_opt.build_folder);

  if (gbl_opt.force || !std::filesystem::exists(gbl_opt.index))
  {
    cr::out().log("Creating a new index...");

    std::filesystem::create_directory(gbl_opt.build_folder / "pack");
    ctx.res.make_self_boot(gbl_opt.index_key, gbl_opt.index.lexically_relative(gbl_opt.build_folder), { .prefix_path = "pack" });
    ctx.io._wait_for_submit_queries();
  }
}

// BENCHMARK: 4420 png images (w/ LZMA), 60k total files, hot fs cache
// ryzen 5600x: (filesystem access is negligeable as it's mostly a compression benchmark)
//           ~695s, single threaded
//           ~257s, 4 threads
//           ~150s, 8 threads

int main(int argc, char **argv)
{
  cr::out.min_severity = cr::logger::severity::message;
  cr::out.register_callback(cr::print_log_to_console, nullptr);

  // parse the commandline options:
  cmdline::parse cmd(argc, argv);
  bool success;
  global_options gbl_opt = cmd.process<global_options>(success, 2 /*index_key, data_folder*/);
  if (!success || gbl_opt.parameters.size() > 2 || gbl_opt.help)
  {
    // output the different options and exit:
    cr::out().warn("usage: {} [options] [index_key] [data_folder]", argv[0]);
    cr::out().log("possible options:");
    cmdline::arg_struct<global_options>::print_options();
    return 1;
  }

  // sanity checks:
  if (gbl_opt.thread_count < 1)
  {
    gbl_opt.thread_count = std::thread::hardware_concurrency();
    cr::out().log("Using {} threads", gbl_opt.thread_count);
  }
  if (gbl_opt.thread_count > 2 * std::thread::hardware_concurrency())
  {
    cr::out().warn("the requested thread-count is quite high ({}) compared to the current hardware capabilities ({} threads)",
                   gbl_opt.thread_count, std::thread::hardware_concurrency());
    cr::out().warn("This may lead to lower perfs.");
  }

  // thread_count now contains the number of thread to dispatch
//   gbl_opt.thread_count -= 1;

  // handle some of the options
  if (gbl_opt.verbose)
    cr::out.min_severity = cr::logger::severity::debug;
  if (gbl_opt.silent)
    cr::out.min_severity = cr::logger::severity::warning;

  // parse/setup parameters:
  if (gbl_opt.parameters.size() > 0)
    gbl_opt.index_key = string_id::_runtime_build_from_string(gbl_opt.parameters[0].data(), gbl_opt.parameters[0].size());
  if (gbl_opt.parameters.size() > 1)
    gbl_opt.data_folder = gbl_opt.parameters[1].data();

  if (!std::filesystem::exists(gbl_opt.data_folder))
  {
    cr::out().error("Specified data folder {} does not exist", gbl_opt.data_folder.c_str());
    return 2;
  }
  if (!std::filesystem::is_directory(gbl_opt.data_folder))
  {
    cr::out().error("Specified data folder {} is not a directory", gbl_opt.data_folder.c_str());
    return 2;
  }

  // filesystem setup:
  gbl_opt.source_folder = gbl_opt.data_folder / "source";
  gbl_opt.build_folder = gbl_opt.data_folder / "build";
  gbl_opt.index = gbl_opt.build_folder / "root.index";
  gbl_opt.ts_file = gbl_opt.build_folder / "last_build_ts";

  cr::out().debug("Data directory: {}", gbl_opt.data_folder.c_str());
  cr::out().debug("Source directory: {}", gbl_opt.source_folder.c_str());
  cr::out().debug("Build directory: {}", gbl_opt.build_folder.c_str());
  cr::out().debug("Index: {}", gbl_opt.index.c_str());

  if (!std::filesystem::exists(gbl_opt.source_folder) || !std::filesystem::is_directory(gbl_opt.source_folder))
  {
    cr::out().error("Source folder ({}) is not valid. Refusing to operate.", gbl_opt.source_folder.c_str());
    return 2;
  }
  if (!gbl_opt.force && !std::filesystem::exists(gbl_opt.index))
  {
    cr::out().log("Forcing a full rebuild: index does not exist");
    gbl_opt.force = true;
  }
  if (!gbl_opt.force && !std::filesystem::exists(gbl_opt.ts_file))
  {
    cr::out().log("Forcing a full rebuild: timestamp file does not exist");
    gbl_opt.force = true;
  }

  // just in case:
  std::filesystem::create_directory(gbl_opt.build_folder);

  make_index(gbl_opt);

  if (gbl_opt.ui)
      glfwInit();

  {
    neam::hydra::engine_t engine;
    neam::hydra::runtime_mode engine_mode = neam::hydra::runtime_mode::core;
    if (gbl_opt.ui)
      engine_mode = neam::hydra::runtime_mode::hydra_context;

    engine.boot(engine_mode, gbl_opt.index_key, gbl_opt.index);
    {
      hydra::core_context& cctx = engine.get_core_context();
      cctx.res.source_folder = gbl_opt.source_folder;

      auto* pck = engine.get_module<neam::hydra::packer_engine_module>("packer"_rid);
      pck->packer_options = gbl_opt;
    }

    // make the main thread participate in the task manager
    neam::hydra::core_context::thread_main(engine.get_core_context());
  }

  if (gbl_opt.ui)
    glfwTerminate();

  return 0;
}


text:
{% extends "base.html" %}

{% block titleblock %}
Forgot Password - Reset Successful
{% endblock %}

{% block body %}

{% load addclass %}

Password Reset

          {% if user.is_authenticated %}

You are already logged in!

          {% else %}

Your password has been successfully reset!

You may now log in using it here.

          {% endif %}

{% endblock %}


text:
require 'sinatra/base'
require 'sinatra/json'
require 'rack/contrib'

require 'playlist'
require 'notifications'
require 'current_user'

require 'deezer'

class Api < Sinatra::Base

  include CurrentUser

  use ::Rack::PostBodyContentTypeParser

  configure do
    set :root, APP_ROOT

    # Logging
    enable :logging
    file = File.new("#{settings.root}/log/#{settings.environment}.log", 'a+')
    file.sync = true
    use Rack::CommonLogger, file
  end

  # Error handling
  def error(code, msg = nil)
    status code
    json error: msg if msg
    halt
  end

  # Get nearest available playlists
  get '/playlists' do
    json Playlist.nearest([params[:lat], params[:lng]]).map { |res|
      {
        code: res[:playlist].code,
        name: res[:playlist].name,
        distance: res[:distance]
      }
    }
  end

  # Launch a new playlist
  post '/playlists' do
    playlist = Playlist.create(params[:name], [params[:lat], params[:lng]])
    error(422) unless playlist

    json playlist.snapshot(@user_id)
  end

  # Get a playlist's snapshot
  get '/playlists/:code' do
    playlist = Playlist.get(params[:code])
    error(404) unless playlist

    json playlist.snapshot(@user_id)
  end

  # Search for a track
  get '/playlists/:code/search' do
    playlist = Playlist.get(params[:code])
    error(404) unless playlist

    query = params[:query]
    error(404) unless query

    results = Deezer.new.search query

    json results
  end

  # Add a track, and vote for it
  post '/playlists/:code/tracks' do
    playlist = Playlist.get(params[:code])
    error(404) unless playlist

    track = playlist.add_track(params[:track])
    track.vote(@user_id)

    Notifications.publish(playlist.code)

    json playlist.snapshot(@user_id)
  end

  # Vote for a track
  post '/playlists/:code/tracks/:track_id' do
    playlist = Playlist.get(params[:code])
    error(404) unless playlist

    track = playlist.track(params[:track_id])
    error(404) unless track

    track.vote(@user_id)

    Notifications.publish(playlist.code)

    json playlist.snapshot(@user_id)
  end

  # Pop the top track from the playlist
  delete '/playlists/:code/tracks' do
    playlist = Playlist.get(params[:code])
    error(404) unless playlist

    track = playlist.pop_top_track!

    if track
      Notifications.publish(playlist.code)
      json track.snapshot(nil, true)
    else
      error(404)
    end

    # TODO ? : recommendations if no track

  end

end


text:
using System.Collections.Generic;
using Bridge.Test.NUnit;

namespace Bridge.ClientTest.Batch3.BridgeIssues
{
    public class Bridge634A<T>
    {
        public class Nested
        {
            public class SubNested
            {
            }

            public class SubNested<T1>
            {
            }
        }

        public class Nested<T1>
        {
            public class SubNested
            {
            }

            public class SubNested<T2>
            {
            }
        }
    }

    [Namespace("ClientTestLibraryCustom")]
    public class Bridge634B<T>
    {
        public class Nested
        {
            public class SubNested
            {
            }

            public class SubNested<T1>
            {
            }
        }

        public class Nested<T1>
        {
            public class SubNested
            {
            }

            public class SubNested<T2>
            {
            }
        }
    }

    public class Bridge634C
    {
        public class Nested
        {
            public class SubNested
            {
            }

            public class SubNested<T1>
            {
            }
        }

        public class Nested<T1>
        {
            public class SubNested
            {
            }

            public class SubNested<T2>
            {
            }
        }
    }

    [Namespace(false)]
    public class Bridge634D
    {
        public class Nested
        {
        }
    }

    // Bridge[#634]
    [Category(Constants.MODULE_ISSUES)]
    [TestFixture(TestNameFormat = "#634 - {0}")]
    public class Bridge634
    {
        [Test(ExpectedCount = 1)]
        public static void TestUseCase1()
        {
            var hashSet = new HashSet<string>();

            hashSet.Add("a");
            hashSet.Add("b");
            hashSet.Add("c");

            var text = "";

            foreach (string s in hashSet)
            {
                text += s;
            }

            Assert.AreEqual("abc", text, "Bridge634: foreach works for HashSet");
        }

        [Test(ExpectedCount = 21)]
        public static void TestUseCase2()
        {
            var a = new Bridge634A<string>();
            var a1 = new Bridge634A<string>.Nested();
            var a2 = new Bridge634A<string>.Nested<int>();
            var a3 = new Bridge634A<string>.Nested.SubNested();
            var a4 = new Bridge634A<string>.Nested.SubNested<int>();
            var a5 = new Bridge634A<string>.Nested<int>.SubNested();
            var a6 = new Bridge634A<string>.Nested<int>.SubNested<int>();

            Assert.AreEqual("Bridge.ClientTest.Batch3.BridgeIssues.Bridge634A`1[[System.String, mscorlib]]", a.GetType().FullName, "Bridge634 A a");
            Assert.AreEqual("Bridge.ClientTest.Batch3.BridgeIssues.Bridge634A`1+Nested[[System.String, mscorlib]]", a1.GetType().FullName, "Bridge634 A a1");
            Assert.AreEqual("Bridge.ClientTest.Batch3.BridgeIssues.Bridge634A`1+Nested`1[[System.String, mscorlib],[System.Int32, mscorlib]]", a2.GetType().FullName, "Bridge634 A a2");
            Assert.AreEqual("Bridge.ClientTest.Batch3.BridgeIssues.Bridge634A`1+Nested+SubNested[[System.String, mscorlib]]", a3.GetType().FullName, "Bridge634 A a3");
            Assert.AreEqual("Bridge.ClientTest.Batch3.BridgeIssues.Bridge634A`1+Nested+SubNested`1[[System.String, mscorlib],[System.Int32, mscorlib]]", a4.GetType().FullName, "Bridge634 A a4");
            Assert.AreEqual("Bridge.ClientTest.Batch3.BridgeIssues.Bridge634A`1+Nested`1+SubNested[[System.String, mscorlib],[System.Int32, mscorlib]]", a5.GetType().FullName, "Bridge634 A a5");
            Assert.AreEqual("Bridge.ClientTest.Batch3.BridgeIssues.Bridge634A`1+Nested`1+SubNested`1[[System.String, mscorlib],[System.Int32, mscorlib],[System.Int32, mscorlib]]", a6.GetType().FullName, "Bridge634 A a6");

            var b = new Bridge634B<string>();
            var b1 = new Bridge634B<string>.Nested();
            var b2 = new Bridge634B<string>.Nested<int>();
            var b3 = new Bridge634B<string>.Nested.SubNested();
            var b4 = new Bridge634B<string>.Nested.SubNested<int>();
            var b5 = new Bridge634B<string>.Nested<int>.SubNested();
            var b6 = new Bridge634B<string>.Nested<int>.SubNested<int>();

            Assert.AreEqual("ClientTestLibraryCustom.Bridge634B`1[[System.String, mscorlib]]", b.GetType().FullName, "Bridge634 B b");
            Assert.AreEqual("ClientTestLibraryCustom.Bridge634B`1+Nested[[System.String, mscorlib]]", b1.GetType().FullName, "Bridge634 B b1");
            Assert.AreEqual("ClientTestLibraryCustom.Bridge634B`1+Nested`1[[System.String, mscorlib],[System.Int32, mscorlib]]", b2.GetType().FullName, "Bridge634 B b2");
            Assert.AreEqual("ClientTestLibraryCustom.Bridge634B`1+Nested+SubNested[[System.String, mscorlib]]", b3.GetType().FullName, "Bridge634 B b3");
            Assert.AreEqual("ClientTestLibraryCustom.Bridge634B`1+Nested+SubNested`1[[System.String, mscorlib],[System.Int32, mscorlib]]", b4.GetType().FullName, "Bridge634 B b4");
            Assert.AreEqual("ClientTestLibraryCustom.Bridge634B`1+Nested`1+SubNested[[System.String, mscorlib],[System.Int32, mscorlib]]", b5.GetType().FullName, "Bridge634 B b5");
            Assert.AreEqual("ClientTestLibraryCustom.Bridge634B`1+Nested`1+SubNested`1[[System.String, mscorlib],[System.Int32, mscorlib],[System.Int32, mscorlib]]", b6.GetType().FullName, "Bridge634 B b6");

            var c = new Bridge634C();
            var c1 = new Bridge634C.Nested();
            var c2 = new Bridge634C.Nested<int>();
            var c3 = new Bridge634C.Nested.SubNested();
            var c4 = new Bridge634C.Nested.SubNested<int>();
            var c5 = new Bridge634C.Nested<int>.SubNested();
            var c6 = new Bridge634C.Nested<int>.SubNested<int>();

            Assert.AreEqual("Bridge.ClientTest.Batch3.BridgeIssues.Bridge634C", c.GetType().FullName, "Bridge634 C c");
            Assert.AreEqual("Bridge.ClientTest.Batch3.BridgeIssues.Bridge634C+Nested", c1.GetType().FullName, "Bridge634 C c1");
            Assert.AreEqual("Bridge.ClientTest.Batch3.BridgeIssues.Bridge634C+Nested`1[[System.Int32, mscorlib]]", c2.GetType().FullName, "Bridge634 C c2");
            Assert.AreEqual("Bridge.ClientTest.Batch3.BridgeIssues.Bridge634C+Nested+SubNested", c3.GetType().FullName, "Bridge634 C c3");
            Assert.AreEqual("Bridge.ClientTest.Batch3.BridgeIssues.Bridge634C+Nested+SubNested`1[[System.Int32, mscorlib]]", c4.GetType().FullName, "Bridge634 C c4");
            Assert.AreEqual("Bridge.ClientTest.Batch3.BridgeIssues.Bridge634C+Nested`1+SubNested[[System.Int32, mscorlib]]", c5.GetType().FullName, "Bridge634 C c5");
            Assert.AreEqual("Bridge.ClientTest.Batch3.BridgeIssues.Bridge634C+Nested`1+SubNested`1[[System.Int32, mscorlib],[System.Int32, mscorlib]]", c6.GetType().FullName, "Bridge634 C c6");
        }
    }
}


text:
package java.util;

import java.security.*;
import java.io.IOException;
import java.io.UnsupportedEncodingException;

/**
 * A class that represents an immutable universally unique identifier (UUID).
 * A UUID represents a 128-bit value.
 *
 *
 There exist different variants of these global identifiers.  The methods
 * of this class are for manipulating the Leach-Salz variant, although the
 * constructors allow the creation of any variant of UUID (described below).
 *
 *
 The layout of a variant 2 (Leach-Salz) UUID is as follows:
 *
 * The most significant long consists of the following unsigned fields:
 *

 * 0xFFFFFFFF00000000 time_low
 * 0x00000000FFFF0000 time_mid
 * 0x000000000000F000 version
 * 0x0000000000000FFF time_hi
 *

 * The least significant long consists of the following unsigned fields:
 *

 * 0xC000000000000000 variant
 * 0x3FFF000000000000 clock_seq
 * 0x0000FFFFFFFFFFFF node
 *

 *
 *
 The variant field contains a value which identifies the layout of the
 * {@code UUID}.  The bit layout described above is valid only for a {@code
 * UUID} with a variant value of 2, which indicates the Leach-Salz variant.
 *
 *
 The version field holds a value that describes the type of this {@code
 * UUID}.  There are four different basic types of UUIDs: time-based, DCE
 * security, name-based, and randomly generated UUIDs.  These types have a
 * version value of 1, 2, 3 and 4, respectively.
 *
 *
 For more information including algorithms used to create {@code UUID}s,
 * see  RFC 4122: A
 * Universally Unique IDentifier (UUID) URN Namespace, section 4.2
 * "Algorithms for Creating a Time-Based UUID".
 *
 * @since   1.5
 */
public final class UUID implements java.io.Serializable, Comparable<UUID> {

    /**
     * Explicit serialVersionUID for interoperability.
     */
    private static final long serialVersionUID = -4856846361193249489L;

    /*
     * The most significant 64 bits of this UUID.
     *
     * @serial
     */
    private final long mostSigBits;

    /*
     * The least significant 64 bits of this UUID.
     *
     * @serial
     */
    private final long leastSigBits;

    /*
     * The version number associated with this UUID. Computed on demand.
     */
    private transient int version = -1;

    /*
     * The variant number associated with this UUID. Computed on demand.
     */
    private transient int variant = -1;

    /*
     * The timestamp associated with this UUID. Computed on demand.
     */
    private transient volatile long timestamp = -1;

    /*
     * The clock sequence associated with this UUID. Computed on demand.
     */
    private transient int sequence = -1;

    /*
     * The node number associated with this UUID. Computed on demand.
     */
    private transient long node = -1;

    /*
     * The hashcode of this UUID. Computed on demand.
     */
    private transient int hashCode = -1;

    /*
     * The random number generator used by this class to create random
     * based UUIDs. In a holder class to defer initialization until needed.
     */
    private static class Holder {
        static final SecureRandom numberGenerator = new SecureRandom();
    }

    // Constructors and Factories

    /*
     * Private constructor which uses a byte array to construct the new UUID.
     */
    private UUID(byte[] data) {
        long msb = 0;
        long lsb = 0;
        assert data.length == 16;
        for (int i=0; i<8; i++)
            msb = (msb << 8) | (data[i] & 0xff);
        for (int i=8; i<16; i++)
            lsb = (lsb << 8) | (data[i] & 0xff);
        this.mostSigBits = msb;
        this.leastSigBits = lsb;
    }

    /**
     * Constructs a new {@code UUID} using the specified data.  {@code
     * mostSigBits} is used for the most significant 64 bits of the {@code
     * UUID} and {@code leastSigBits} becomes the least significant 64 bits of
     * the {@code UUID}.
     *
     * @param  mostSigBits
     *         The most significant bits of the {@code UUID}
     *
     * @param  leastSigBits
     *         The least significant bits of the {@code UUID}
     */
    public UUID(long mostSigBits, long leastSigBits) {
        this.mostSigBits = mostSigBits;
        this.leastSigBits = leastSigBits;
    }

    /**
     * Static factory to retrieve a type 4 (pseudo randomly generated) UUID.
     *
     * The {@code UUID} is generated using a cryptographically strong pseudo
     * random number generator.
     *
     * @return  A randomly generated {@code UUID}
     */
    public static UUID randomUUID() {
        SecureRandom ng = Holder.numberGenerator;

        byte[] randomBytes = new byte[16];
        ng.nextBytes(randomBytes);
        randomBytes[6]  &= 0x0f;  /* clear version        */
        randomBytes[6]  |= 0x40;  /* set to version 4     */
        randomBytes[8]  &= 0x3f;  /* clear variant        */
        randomBytes[8]  |= 0x80;  /* set to IETF variant  */
        return new UUID(randomBytes);
    }

    /**
     * Static factory to retrieve a type 3 (name based) {@code UUID} based on
     * the specified byte array.
     *
     * @param  name
     *         A byte array to be used to construct a {@code UUID}
     *
     * @return  A {@code UUID} generated from the specified array
     */
    public static UUID nameUUIDFromBytes(byte[] name) {
        MessageDigest md;
        try {
            md = MessageDigest.getInstance("MD5");
        } catch (NoSuchAlgorithmException nsae) {
            throw new InternalError("MD5 not supported");
        }
        byte[] md5Bytes = md.digest(name);
        md5Bytes[6]  &= 0x0f;  /* clear version        */
        md5Bytes[6]  |= 0x30;  /* set to version 3     */
        md5Bytes[8]  &= 0x3f;  /* clear variant        */
        md5Bytes[8]  |= 0x80;  /* set to IETF variant  */
        return new UUID(md5Bytes);
    }

    /**
     * Creates a {@code UUID} from the string standard representation as
     * described in the {@link #toString} method.
     *
     * @param  name
     *         A string that specifies a {@code UUID}
     *
     * @return  A {@code UUID} with the specified value
     *
     * @throws  IllegalArgumentException
     *          If name does not conform to the string representation as
     *          described in {@link #toString}
     *
     */
    public static UUID fromString(String name) {
        String[] components = name.split("-");
        if (components.length != 5)
            throw new IllegalArgumentException("Invalid UUID string: "+name);
        for (int i=0; i<5; i++)
            components[i] = "0x"+components[i];

        long mostSigBits = Long.decode(components[0]).longValue();
        mostSigBits <<= 16;
        mostSigBits |= Long.decode(components[1]).longValue();
        mostSigBits <<= 16;
        mostSigBits |= Long.decode(components[2]).longValue();

        long leastSigBits = Long.decode(components[3]).longValue();
        leastSigBits <<= 48;
        leastSigBits |= Long.decode(components[4]).longValue();

        return new UUID(mostSigBits, leastSigBits);
    }

    // Field Accessor Methods

    /**
     * Returns the least significant 64 bits of this UUID's 128 bit value.
     *
     * @return  The least significant 64 bits of this UUID's 128 bit value
     */
    public long getLeastSignificantBits() {
        return leastSigBits;
    }

    /**
     * Returns the most significant 64 bits of this UUID's 128 bit value.
     *
     * @return  The most significant 64 bits of this UUID's 128 bit value
     */
    public long getMostSignificantBits() {
        return mostSigBits;
    }

    /**
     * The version number associated with this {@code UUID}.  The version
     * number describes how this {@code UUID} was generated.
     *
     * The version number has the following meaning:
     *

     *
1    Time-based UUID
     *
2    DCE security UUID
     *
3    Name-based UUID
     *
4    Randomly generated UUID
     *

     *
     * @return  The version number of this {@code UUID}
     */
    public int version() {
        if (version < 0) {
            // Version is bits masked by 0x000000000000F000 in MS long
            version = (int)((mostSigBits >> 12) & 0x0f);
        }
        return version;
    }

    /**
     * The variant number associated with this {@code UUID}.  The variant
     * number describes the layout of the {@code UUID}.
     *
     * The variant number has the following meaning:
     *

     *
0    Reserved for NCS backward compatibility
     *
2 IETF RFC 4122
     * (Leach-Salz), used by this class
     *
6    Reserved, Microsoft Corporation backward compatibility
     *
7    Reserved for future definition
     *

     *
     * @return  The variant number of this {@code UUID}
     */
    public int variant() {
        if (variant < 0) {
            // This field is composed of a varying number of bits
            if ((leastSigBits >>> 63) == 0) {
                variant = 0;
            } else if ((leastSigBits >>> 62) == 2) {
                variant = 2;
            } else {
                variant = (int)(leastSigBits >>> 61);
            }
        }
        return variant;
    }

    /**
     * The timestamp value associated with this UUID.
     *
     *
 The 60 bit timestamp value is constructed from the time_low,
     * time_mid, and time_hi fields of this {@code UUID}.  The resulting
     * timestamp is measured in 100-nanosecond units since midnight,
     * October 15, 1582 UTC.
     *
     *
 The timestamp value is only meaningful in a time-based UUID, which
     * has version type 1.  If this {@code UUID} is not a time-based UUID then
     * this method throws UnsupportedOperationException.
     *
     * @throws UnsupportedOperationException
     *         If this UUID is not a version 1 UUID
     */
    public long timestamp() {
        if (version() != 1) {
            throw new UnsupportedOperationException("Not a time-based UUID");
        }
        long result = timestamp;
        if (result < 0) {
            result = (mostSigBits & 0x0000000000000FFFL) << 48;
            result |= ((mostSigBits >> 16) & 0xFFFFL) << 32;
            result |= mostSigBits >>> 32;
            timestamp = result;
        }
        return result;
    }

    /**
     * The clock sequence value associated with this UUID.
     *
     *
 The 14 bit clock sequence value is constructed from the clock
     * sequence field of this UUID.  The clock sequence field is used to
     * guarantee temporal uniqueness in a time-based UUID.
     *
     *
 The {@code clockSequence} value is only meaningful in a time-based
     * UUID, which has version type 1.  If this UUID is not a time-based UUID
     * then this method throws UnsupportedOperationException.
     *
     * @return  The clock sequence of this {@code UUID}
     *
     * @throws  UnsupportedOperationException
     *          If this UUID is not a version 1 UUID
     */
    public int clockSequence() {
        if (version() != 1) {
            throw new UnsupportedOperationException("Not a time-based UUID");
        }
        if (sequence < 0) {
            sequence = (int)((leastSigBits & 0x3FFF000000000000L) >>> 48);
        }
        return sequence;
    }

    /**
     * The node value associated with this UUID.
     *
     *
 The 48 bit node value is constructed from the node field of this
     * UUID.  This field is intended to hold the IEEE 802 address of the machine
     * that generated this UUID to guarantee spatial uniqueness.
     *
     *
 The node value is only meaningful in a time-based UUID, which has
     * version type 1.  If this UUID is not a time-based UUID then this method
     * throws UnsupportedOperationException.
     *
     * @return  The node value of this {@code UUID}
     *
     * @throws  UnsupportedOperationException
     *          If this UUID is not a version 1 UUID
     */
    public long node() {
        if (version() != 1) {
            throw new UnsupportedOperationException("Not a time-based UUID");
        }
        if (node < 0) {
            node = leastSigBits & 0x0000FFFFFFFFFFFFL;
        }
        return node;
    }

    // Object Inherited Methods

    /**
     * Returns a {@code String} object representing this {@code UUID}.
     *
     *
 The UUID string representation is as described by this BNF:
     *

     * {@code
     * UUID                   = <time_low> "-" <time_mid> "-"
     *                          <time_high_and_version> "-"
     *                          <variant_and_sequence> "-"
     *                          <node>
     * time_low               = 4*<hexOctet>
     * time_mid               = 2*<hexOctet>
     * time_high_and_version  = 2*<hexOctet>
     * variant_and_sequence   = 2*<hexOctet>
     * node                   = 6*<hexOctet>
     * hexOctet               = <hexDigit><hexDigit>
     * hexDigit               =
     *       "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9"
     *       | "a" | "b" | "c" | "d" | "e" | "f"
     *       | "A" | "B" | "C" | "D" | "E" | "F"
     * }

     *
     * @return  A string representation of this {@code UUID}
     */
    public String toString() {
        return (digits(mostSigBits >> 32, 8) + "-" +
                digits(mostSigBits >> 16, 4) + "-" +
                digits(mostSigBits, 4) + "-" +
                digits(leastSigBits >> 48, 4) + "-" +
                digits(leastSigBits, 12));
    }

    /** Returns val represented by the specified number of hex digits. */
    private static String digits(long val, int digits) {
        long hi = 1L << (digits * 4);
        return Long.toHexString(hi | (val & (hi - 1))).substring(1);
    }

    /**
     * Returns a hash code for this {@code UUID}.
     *
     * @return  A hash code value for this {@code UUID}
     */
    public int hashCode() {
        if (hashCode == -1) {
            hashCode = (int)((mostSigBits >> 32) ^
                             mostSigBits ^
                             (leastSigBits >> 32) ^
                             leastSigBits);
        }
        return hashCode;
    }

    /**
     * Compares this object to the specified object.  The result is {@code
     * true} if and only if the argument is not {@code null}, is a {@code UUID}
     * object, has the same variant, and contains the same value, bit for bit,
     * as this {@code UUID}.
     *
     * @param  obj
     *         The object to be compared
     *
     * @return  {@code true} if the objects are the same; {@code false}
     *          otherwise
     */
    public boolean equals(Object obj) {
        if (!(obj instanceof UUID))
            return false;
        if (((UUID)obj).variant() != this.variant())
            return false;
        UUID id = (UUID)obj;
        return (mostSigBits == id.mostSigBits &&
                leastSigBits == id.leastSigBits);
    }

    // Comparison Operations

    /**
     * Compares this UUID with the specified UUID.
     *
     *
 The first of two UUIDs is greater than the second if the most
     * significant field in which the UUIDs differ is greater for the first
     * UUID.
     *
     * @param  val
     *         {@code UUID} to which this {@code UUID} is to be compared
     *
     * @return  -1, 0 or 1 as this {@code UUID} is less than, equal to, or
     *          greater than {@code val}
     *
     */
    public int compareTo(UUID val) {
        // The ordering is intentionally set up so that the UUIDs
        // can simply be numerically compared as two numbers
        return (this.mostSigBits < val.mostSigBits ? -1 :
                (this.mostSigBits > val.mostSigBits ? 1 :
                 (this.leastSigBits < val.leastSigBits ? -1 :
                  (this.leastSigBits > val.leastSigBits ? 1 :
                   0))));
    }

    /**
     * Reconstitute the {@code UUID} instance from a stream (that is,
     * deserialize it).  This is necessary to set the transient fields to their
     * correct uninitialized value so they will be recomputed on demand.
     */
    private void readObject(java.io.ObjectInputStream in)
        throws java.io.IOException, ClassNotFoundException {

        in.defaultReadObject();

        // Set "cached computation" fields to their initial values
        version = -1;
        variant = -1;
        timestamp = -1;
        sequence = -1;
        node = -1;
        hashCode = -1;
    }
}


text:
package io.fabric8.openshift.client;

import io.fabric8.kubernetes.client.GenericKubernetesClient;
import io.fabric8.openshift.client.dsl.OpenShiftDSL;

import java.net.URL;

public interface OpenShiftClient extends
  OpenShiftDSL,
  GenericKubernetesClient<OpenShiftClient> {

  URL getOpenshiftUrl();

}


text:
package org.olat.modules.scorm.assessment;

/**
 *

 * Initial Date: 17 august 2009

 *
 * @author srosse
 */
public class CmiData {
	private String itemId;
	private String key;
	private String value;

	public CmiData() {
		//
	}

	public CmiData(final String itemId, final String key, final String value) {
		this.itemId = itemId;
		this.key = key;
		this.value = value;
	}

	public String getItemId() {
		return itemId;
	}

	public void setItemId(final String itemId) {
		this.itemId = itemId;
	}

	public String getKey() {
		return key;
	}

	public void setKey(final String key) {
		this.key = key;
	}

	public String getValue() {
		return value;
	}

	public void setValue(final String value) {
		this.value = value;
	}
}


text:
<?php

namespace Spb\RealityBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;

/**
 * Контроллер объектов недвижимости.
 *
 * @Route("/admin/{rtype}", requirements={"rtype" = "(room|flat|land|house|office|storehouse|building)"})
 */
class RealtyController extends Controller
{
    /**
     * Показать все объекты недвижимости определенного типа.
     *
     * @Route("/", name="admin_realty")
     */
    public function indexAction($rtype)
    {
        $realty_search = 'Spb\\RealityBundle\\Entity\\Search\\' . ucwords($rtype) . 'Search';
        $realty_search_type = 'Spb\\RealityBundle\\Form\\Search\\' . ucwords($rtype) . 'SearchType';

        $em = $this->getDoctrine()->getEntityManager();
        $repository = $em->getRepository('SpbRealityBundle:' . ucwords($rtype));
        $qb = $repository->createQueryBuilder('r');

        //Создаем доменный объект, в котором хранятся параметры поиска
        $rsearch = new $realty_search($qb);
        //Создаем форму поиска
        $search_form = $this->createForm(new $realty_search_type($this->getDoctrine()), $rsearch);
        $search_form->bindRequest($this->getRequest());

        //echo(var_dump($rsearch));

        $paginator = $this->get('knp_paginator');
        $pagination = $paginator->paginate(
            $rsearch->buildSearchQuery()->qb->getQuery(),
            $this->get('request')->query->get('page', 1), /*номер страницы*/
            $this->container->getParameter('rows_per_page') /*количество записей на странице*/
        );

        return $this->render('SpbRealityBundle:Realty:index_' . $rtype . '.html.twig', array('entities' => $pagination, 'search_form' => $search_form->createView(), 'mode'=> $this->get('request')->query->get('mode', 'simple')));
    }

    /**
     * Найти и отоброзить объект недвижимости
     *
     * @Route("/{id}/show", name="admin_realty_show")
     * @Template()
     */
    public function showAction($rtype, $id)
    {
        $em = $this->getDoctrine()->getEntityManager();

        $entity = $em->getRepository('SpbRealityBundle:' . ucwords($rtype))->find($id);

        if (!$entity) {
            throw $this->createNotFoundException('Объект недвижимости не найден.');
        }

        $deleteForm = $this->createDeleteForm($id);

        return $this->render('SpbRealityBundle:Realty:show_' . $rtype . '.html.twig', array(
            'entity'      => $entity,
            'delete_form' => $deleteForm->createView(),
            ));
    }

    /**
     * Форма по созданию нового объекта недвижимости.
     *
     * @Route("/new", name="admin_realty_new")
     * @Template()
     */
    public function newAction($rtype)
    {
        $realty = 'Spb\\RealityBundle\\Entity\\' . ucwords($rtype);
        $formType = 'Spb\\RealityBundle\\Form\\' . ucwords($rtype) . 'Type';

        $entity = new $realty($this->container->getParameter('yandex_map_key'));
        $form   = $this->createForm(new $formType, $entity);

        return array(
            'entity' => $entity,
            'form'   => $form->createView()
        );
    }

    /**
     * Создать новый объект недвижимости.
     *
     * @Route("/create", name="admin_realty_create")
     * @Method("post")
     * @Template("SpbRealityBundle:Realty:new.html.twig")
     */
    public function createAction($rtype)
    {
        $realty = 'Spb\\RealityBundle\\Entity\\' . ucwords($rtype);
        $formType = 'Spb\\RealityBundle\\Form\\' . ucwords($rtype) . 'Type';

        $entity = new $realty($this->container->getParameter('yandex_map_key'));
        $form   = $this->createForm(new $formType, $entity);

        $request = $this->getRequest();
        $form->bindRequest($request);

        if ($form->isValid()) {
            $em = $this->getDoctrine()->getEntityManager();
            $em->persist($entity);
            $em->flush();

            return $this->redirect($this->generateUrl('admin_realty_show', array('rtype' => $rtype, 'id' => $entity->getId())));

        }

        return array(
            'entity' => $entity,
            'form'   => $form->createView()
        );
    }

    /**
     * Отобразить форму редактирования объекта недвижимости.
     *
     * @Route("/{id}/edit", name="admin_realty_edit")
     * @Template()
     */
    public function editAction($rtype, $id)
    {
        $em = $this->getDoctrine()->getEntityManager();

        $entity = $em->getRepository('SpbRealityBundle:' . ucwords($rtype))->find($id);

        if (!$entity) {
            throw $this->createNotFoundException('Объект недвижимости не найден.');
        }

        $formType = 'Spb\\RealityBundle\\Form\\' . ucwords($rtype) . 'Type';

        $editForm   = $this->createForm(new $formType, $entity);

        return array(
            'entity'      => $entity,
            'edit_form'   => $editForm->createView(),
        );

    }

    /**
     * Редактировать объект недвижимости
     *
     * @Route("/{id}/update", name="admin_realty_update")
     * @Method("post")
     * @Template("SpbRealityBundle:Flat:edit.html.twig")
     */
    public function updateAction($rtype, $id)
    {
        $em = $this->getDoctrine()->getEntityManager();

        $entity = $em->getRepository('SpbRealityBundle:' . ucwords($rtype))->find($id);

        if (!$entity) {
            throw $this->createNotFoundException('Объект недвижимости не найден.');
        }

        $formType = 'Spb\\RealityBundle\\Form\\' . ucwords($rtype) . 'Type';
        $editForm   = $this->createForm(new $formType, $entity);

        $deleteForm = $this->createDeleteForm($id);
        $request = $this->getRequest();
        $editForm->bindRequest($request);

        if ($editForm->isValid()) {
            $em->persist($entity);
            $em->flush();

            return $this->redirect($this->generateUrl('admin_realty_edit', array('rtype' => $rtype, 'id' => $id)));
        }

        return array(
            'entity'      => $entity,
            'edit_form'   => $editForm->createView(),
            'delete_form' => $deleteForm->createView(),
        );
    }

    /**
     * Удаляет объект недвижимости.
     *
     * @Route("/{id}/delete", name="admin_realty_delete")
     * @Method("post")
     */
    public function deleteAction($rtype, $id)
    {
        $form = $this->createDeleteForm($id);
        $request = $this->getRequest();

        $form->bindRequest($request);

        if ($form->isValid()) {

            $em = $this->getDoctrine()->getEntityManager();

            $entity = $em->getRepository('SpbRealityBundle:' . ucwords($rtype))->find($id);

            if (!$entity) {
                throw $this->createNotFoundException('Объект недвижимости не найден.');
            }

            $em->remove($entity);
            $em->flush();
        }

        return $this->redirect($this->generateUrl('admin_realty', array('rtype' => $rtype)));
    }

    private function createDeleteForm($id)
    {
        return $this->createFormBuilder(array('id' => $id))
            ->add('id', 'hidden')
            ->getForm()
        ;
    }

}


text:
@class PBXTarget;

@interface Xcode3TargetBuildSettingsCoordinator : Xcode3TargetCoordinator
{
    PBXTarget *_pbxTarget;
}

@property(readonly, nonatomic) PBXTarget *pbxTarget; // @synthesize pbxTarget=_pbxTarget;
- (void).cxx_destruct;
- (id)stringsByEvaluatingPropertyString:(id)arg1 inAllConfigurationsForWorkspaceArenaSnapshot:(id)arg2;
- (id)valueForTargetAttributeKey:(id)arg1;
- (void)setValue:(id)arg1 forTargetAttributeKey:(id)arg2;
- (void)setValue:(id)arg1 forString:(id)arg2 deleteSettingIfValueIsNilOrEmpty:(BOOL)arg3;
- (void)setValue:(id)arg1 forString:(id)arg2;
- (id)expandedValueForString:(id)arg1;
- (id)initWithTarget:(id)arg1;

@end


text:
export default function perspective(z, focalLength = 300) {
    return focalLength / (focalLength + z);
}


text:
A-B testing framework and manager for Rails.  This gem allows the addition of experiments that change view code and assets
based on the results of a simple test proc.

This gem modifies ActionView::Base as well as the global assets environment to enable overrides in the experiments directory to
take effect.

## Installation

Add this line to your application's Gemfile:

    gem 'abtest'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install abtest

## Usage

Once the gem is installed in your Rails application, you can run the following command to set up an experiment:

    $ bundle exec rake abtest:add_experiment[experiment_name]

To delete an experiment, run the following command:

    $ bundle exec rake abtest:delete_experiment[experiment_name]

To remove all experiments, run the following command:

    $ bundle exec rake abtest:delete_experiments

Those commands will place a stub configuration with instructions in:

    config/initializers/abtest/<experiment_name>.rb

Once you've generated an experiment and configured when it should take effect, you can place your experiment files to overlay on rails in:

    abtest/experiments/<experiment_name>/

So for example:

    abtest/experiments/my_cool_experiment/views/some_controller/foo.html.erb

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request


text:
enum primitive_type {
    PRIMITIVE_INVALID = -1,
    PRIMITIVE_LINE = 0,
    PRIMITIVE_RECT,
    PRIMITVE_MAX,
};

enum primitive_batch_type {
    PRIMITIVE_BATCH_LINE = 0,
    PRIMITIVE_BATCH_TRIANGLE,
};

struct primitive_render_batch {
    enum primitive_batch_type type;
    int offset;
    union {
        int line_count;
        int triangle_count;
    } count;
};

struct primitive_render_state {
    GLuint program;
    struct attr_location loc;
};

struct primitive_render_context {
    GLuint vao;
    GLuint vbo;
    struct primitive_vertex* vertexes;

    struct primitive_render_batch batches[MAX_RENDER_BATCH];
    struct primitive_render_state state;
    struct primitive_render_batch* current_batch;

    int current_batch_index;
    int offset;
    int n_objects;
};

void primitive_render_func_init(struct render* R);
void primitive_render_func_start(struct render* R);
void primitive_render_func_flush(struct render* R);
void primitive_render_func_end(struct render* R);

void primitive_render_func_draw(struct render* R, enum primitive_type primitive_type, void* object);

#endif


text:
package org.scijava.io.event;

import static org.junit.Assert.assertEquals;

import java.io.File;
import java.io.IOException;

import org.junit.Test;

public class DataEventTest {

	@Test
	public void testDeprecatedMethods() throws IOException {
		File tmpFile = File.createTempFile("path", "txt");
		tmpFile.deleteOnExit();
		String localPath = tmpFile.getAbsolutePath();
		Object obj = null;
		DataOpenedEvent openedEvent = new DataOpenedEvent(localPath, obj);
		DataSavedEvent savedEvent = new DataSavedEvent(localPath, obj);
		assertEquals(localPath, openedEvent.getSource());
		assertEquals(localPath, savedEvent.getDestination());

//		String remotepath = "https://remote.org/path.txt";
//		openedEvent = new DataOpenedEvent(remotepath, obj);
//		savedEvent = new DataSavedEvent(remotepath, obj);
//		assertEquals(remotepath, openedEvent.getSource());
//		assertEquals(remotepath, savedEvent.getDestination());
	}

}


text:
<?php

namespace Projet\BlogBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Projet\BlogBundle\Entity\Article;
use Projet\BlogBundle\Entity\Image;
use Projet\BlogBundle\Form\ArticleType;

class BlogController extends Controller
{

  public function indexAction($page)
  {
    $articles = $this->getDoctrine()
                     ->getManager()
                     ->getRepository('ProjetBlogBundle:Article')
                     ->getArticles(3, $page); // 3 articles par page : c'est totalement arbitraire !

    // On ajoute ici les variables page et nb_page à la vue
    return $this->render('ProjetBlogBundle:Blog:index.html.twig', array(
      'articles'   => $articles,
      'page'       => $page,
      'nombrePage' => ceil(count($articles)/3)
    ));
  }

  public function voirAction(Article $article)
  {
    // À ce stade, la variable $article contient une instance de la classe Article
    // Avec l'id correspondant à l'id contenu dans la route !

    // On récupère ensuite les articleCompetence pour l'article $article
    // On doit le faire à la main pour l'instant, car la relation est unidirectionnelle
    // C'est-à-dire que $article->getArticleCompetences() n'existe pas !
    $listeArticleCompetence = $this->getDoctrine()
                                   ->getManager()
                                   ->getRepository('ProjetBlogBundle:ArticleCompetence')
                                   ->findByArticle($article->getId());

    return $this->render('ProjetBlogBundle:Blog:voir.html.twig', array(
      'article'                 => $article,
      'listeArticleCompetence'  => $listeArticleCompetence
    ));
  }

  public function ajouterAction()
  {
    $article = new Article;

    // On crée le formulaire grâce à l'ArticleType
    $form = $this->createForm(new ArticleType(), $article);

    // On récupère la requête
    $request = $this->getRequest();

    // On vérifie qu'elle est de type POST
    if ($request->getMethod() == 'POST') {
      // On fait le lien Requête <-> Formulaire
      $form->bind($request);

      // On vérifie que les valeurs entrées sont correctes
      // (Nous verrons la validation des objets en détail dans le prochain chapitre)
      if ($form->isValid()) {
        // On enregistre notre objet $article dans la base de données
        $em = $this->getDoctrine()->getManager();
        $em->persist($article);
        $em->flush();

        // On définit un message flash
        $this->get('session')->getFlashBag()->add('info', 'Article bien ajouté');

        // On redirige vers la page de visualisation de l'article nouvellement créé
        return $this->redirect($this->generateUrl('projetblog_voir', array('id' => $article->getId())));
      }
    }

    // À ce stade :
    // - Soit la requête est de type GET, donc le visiteur vient d'arriver sur la page et veut voir le formulaire
    // - Soit la requête est de type POST, mais le formulaire n'est pas valide, donc on l'affiche de nouveau

    return $this->render('ProjetBlogBundle:Blog:ajouter.html.twig', array(
      'form' => $form->createView(),
    ));
  }

public function modifierAction(Article $article)
  {
    // On utiliser le ArticleEditType
    $form = $this->createForm(new ArticleEditType(), $article);

    $request = $this->getRequest();

    if ($request->getMethod() == 'POST') {
      $form->bind($request);

      if ($form->isValid()) {
        // On enregistre l'article
        $em = $this->getDoctrine()->getManager();
        $em->persist($article);
        $em->flush();

        // On définit un message flash
        $this->get('session')->getFlashBag()->add('info', 'Article bien modifié');

        return $this->redirect($this->generateUrl('projetblog_voir', array('id' => $article->getId())));
      }
    }

    return $this->render('ProjetBlogBundle:Blog:modifier.html.twig', array(
      'form'    => $form->createView(),
      'article' => $article
    ));
  }

   public function supprimerAction(Article $article)
  {
    // On crée un formulaire vide, qui ne contiendra que le champ CSRF
    // Cela permet de protéger la suppression d'article contre cette faille
    $form = $this->createFormBuilder()->getForm();

    $request = $this->getRequest();
    if ($request->getMethod() == 'POST') {
      $form->bind($request);

      if ($form->isValid()) {
        // On supprime l'article
        $em = $this->getDoctrine()->getManager();
        $em->remove($article);
        $em->flush();

        // On définit un message flash
        $this->get('session')->getFlashBag()->add('info', 'Article bien supprimé');

        // Puis on redirige vers l'accueil
        return $this->redirect($this->generateUrl('projetblog_accueil'));
      }
    }

    // Si la requête est en GET, on affiche une page de confirmation avant de supprimer
    return $this->render('ProjetBlogBundle:Blog:supprimer.html.twig', array(
      'article' => $article,
      'form'    => $form->createView()
    ));
  }

  public function menuAction($nombre)
  {
    $liste = $this->getDoctrine()
                  ->getManager()
                  ->getRepository('ProjetBlogBundle:Article')
                  ->findBy(
                    array(),          // Pas de critère
                    array('date' => 'desc'), // On trie par date décroissante
                    $nombre,         // On sélectionne $nombre articles
                    0                // À partir du premier
                  );

    return $this->render('ProjetBlogBundle:Blog:menu.html.twig', array(
      'liste_articles' => $liste // C'est ici tout l'intérêt : le contrôleur passe les variables nécessaires au template !
    ));
  }
}


text:
<?php

namespace Teknoo\ReactPHPBundle\Bridge;

use Psr\Log\LoggerInterface;
use Psr\Http\Message\ServerRequestInterface;
use React\Http\Response as ReactResponse;
use Symfony\Bridge\PsrHttpMessage\Factory\DiactorosFactory;
use Symfony\Bridge\PsrHttpMessage\HttpFoundationFactoryInterface;
use Symfony\Component\HttpKernel\Exception\HttpException;
use Symfony\Component\HttpKernel\KernelInterface;
use Symfony\Component\HttpFoundation\Request as SymfonyRequest;
use Symfony\Component\HttpFoundation\Response as SymfonyResponse;
use Symfony\Component\HttpKernel\TerminableInterface;
use Teknoo\ReactPHPBundle\Service\DatesService;

/**
 * Class RequestBridge.
 *
 * @copyright   Copyright (c) 2009-2017 Richard Déloge (richarddeloge@gmail.com)
 *
 * @link        http://teknoo.software/symfony-react Project website
 *
 * @license     http://teknoo.software/license/mit         MIT License
 * @author      Richard Déloge <richarddeloge@gmail.com>
 */
class RequestBridge
{
    /**
     * Symfony Kernel to use to handle and execute HTTP Request.
     *
     * @var KernelInterface
     */
    protected $kernel;

    /**
     * To retriave \DateTime to use for log.
     *
     * @var DatesService
     */
    protected $datesService;

    /**
     * To convert PSR7 Request to Symfony Request.
     *
     * @var HttpFoundationFactoryInterface
     */
    protected $httpFoundationFcty;

    /**
     * To convert Symfony Response to PSR7 Response.
     *
     * @var DiactorosFactory
     */
    protected $diactorosFactory;

    /**
     * To log requests result, as Apache and errors.
     *
     * @var LoggerInterface
     */
    protected $logger;

    /**
     * RequestBridge constructor.
     *
     * @param KernelInterface                $kernel
     * @param DatesService                   $datesService
     * @param HttpFoundationFactoryInterface $foundationFactory
     * @param DiactorosFactory               $diactorosFactory
     */
    public function __construct(
        KernelInterface $kernel,
        DatesService $datesService,
        HttpFoundationFactoryInterface  $foundationFactory,
        DiactorosFactory $diactorosFactory
    ) {
        $this->kernel = $kernel;
        $this->datesService = $datesService;
        $this->httpFoundationFcty = $foundationFactory;
        $this->diactorosFactory = $diactorosFactory;
    }

    /**
     * To register a logger into the bridge to register request summary and errors.
     *
     * @param LoggerInterface $logger
     *
     * @return self
     */
    public function setLogger(LoggerInterface $logger): RequestBridge
    {
        $this->logger = $logger;

        return $this;
    }

    /**
     * If the Kernel support Terminate behavior, execute it.
     *
     * @param SymfonyRequest  $request
     * @param SymfonyResponse $response
     *
     * @return self
     */
    protected function terminate(SymfonyRequest $request, SymfonyResponse $response): RequestBridge
    {
        if ($this->kernel instanceof TerminableInterface) {
            $this->kernel->terminate($request, $response);
        }

        return $this;
    }

    /**
     * Magic method to clone the Symfony Kernel when this RequestBridge instance is cloned by the listener.
     */
    public function __clone()
    {
        $this->kernel = clone $this->kernel;
    }

    /**
     * To add in the log system the result of the request, following the log format defined for Apache HTTP.
     * If no logger has been defined, this operation is ignored.
     *
     * @param SymfonyRequest  $request
     * @param SymfonyResponse $response
     */
    protected function logRequest(SymfonyRequest $request, SymfonyResponse $response)
    {
        if (!$this->logger instanceof LoggerInterface) {
            return;
        }

        $date = $this->datesService->getNow();

        $message = \sprintf(
            '%s - [%s] "%s %s" %s %s',
            $request->getClientIp(),
            $date->format('d/M/Y H:i:s O'),
            $request->getRealMethod(),
            $request->getUri(),
            $response->getStatusCode(),
            \strlen($response->getContent())
        );

        $this->logger->info($message);
    }

    /**
     * To add in the log system an error durring the request.
     * If no logger has been defined, this operation is ignored.
     *
     * @param ServerRequestInterface $request
     * @param \Throwable             $error
     */
    protected function logError(ServerRequestInterface $request, \Throwable $error)
    {
        if (!$this->logger instanceof LoggerInterface) {
            return;
        }

        $date = $this->datesService->getNow();

        $server = $request->getServerParams();

        $message = \sprintf(
            '%s - [%] %s in %s (%s)',
            $server['REMOTE_ADDR'],
            $date->format('d/M/Y H:i:s O'),
            $error->getMessage(),
            $error->getFile(),
            $error->getLine()
        );

        $this->logger->error($message);
    }

    /**
     * Called by method run, when the Symfony Request is ready to execute it with the Symfony Kernel.
     * The response must be passed to ReactPHP Http via $resolve callable after be converted to PSR7 Response by
     * Diactoros factory.
     *
     *
     * @param SymfonyRequest $request
     * @param callable       $resolve
     *
     * @return RequestBridge
     */
    protected function executePreparedRequest(SymfonyRequest $request, callable $resolve): RequestBridge
    {
        $sfResponse = $this->kernel->handle($request);

        $resolve($this->diactorosFactory->createResponse($sfResponse));

        $this->terminate($request, $sfResponse);
        $this->logRequest($request, $sfResponse);

        return $this;
    }

    /**
     * Called by the RequestListener or when ReactPHP emit the data event to convert the ReactPHP Request to a Symfony
     * Request and execute it with Symfony before send result to ReactPHP.
     *
     * The method convert, thanks to Http Foundation factory all PSR7 request to Symfony request. Errors and exception
     * are catched by this method, to generate an Error response (40* ou 50* responses) from the exception instance.
     *
     * @param ServerRequestInterface $request
     * @param callable               $resolve
     *
     * @return RequestBridge
     */
    public function run(ServerRequestInterface $request, callable $resolve): RequestBridge
    {
        try {
            $sfRequest = $this->httpFoundationFcty->createRequest($request);

            return $this->executePreparedRequest($sfRequest, $resolve);
        } catch (HttpException $error) {
            $this->logError($request, $error);
            $resolve(new ReactResponse($error->getStatusCode(), $error->getHeaders(), $error->getMessage()));
        } catch (\Throwable $error) {
            $this->logError($request, $error);
            $resolve(new ReactResponse(500, [], $error->getMessage()));
        }

        return $this;
    }
}


text:
<?php
/**
 * Title: Footer template.
 *
 * Description: Defines footer content.
 *
 * Please do not edit this file. This file is part of the Cyber Chimps Framework and all modifications
 * should be made in a child theme.
 *
 * @category Cyber Chimps Framework
 * @package  Framework
 * @since    1.0
 * @author   CyberChimps
 * @license  http://www.opensource.org/licenses/gpl-license.php GPL v2.0 (or later)
 * @link     http://www.cyberchimps.com/
 */

if( cyberchimps_get_option( 'footer_show_toggle' ) == '1' ) {

	do_action( 'cyberchimps_before_footer_widgets' ); ?>

							<?php if( !dynamic_sidebar( 'cyberchimps-footer-widgets' ) ) : ?>

<?php _e( 'Pages', 'parallax' ); ?>

										<?php wp_list_pages( 'title_li=' ); ?>

<?php _e( 'Archives', 'parallax' ); ?>

										<?php wp_get_archives( 'type=monthly' ); ?>

<?php _e( 'Categories', 'parallax' ); ?>

										<?php wp_list_categories( 'show_count=1&title_li=' ); ?>

<?php _e( 'WordPress', 'parallax' ); ?>

										<?php wp_register(); ?>

<?php wp_loginout(); ?>

<a href="<?php echo esc_url( __( 'http://wordpress.org/', 'parallax' ) ); ?>" target="_blank"
										       title="<?php esc_attr_e( 'Powered by WordPress, state-of-the-art semantic personal publishing platform.', 'parallax' ); ?>"> <?php _e( 'WordPress', 'parallax' ); ?>

										<?php wp_meta(); ?>

							<?php endif; ?>

	<?php do_action( 'cyberchimps_after_footer_widgets' ); ?>

<?php } ?>

<?php do_action( 'cyberchimps_before_footer_container' ); ?>
<?php do_action( 'cyberchimps_footer' ); ?>
<?php do_action( 'cyberchimps_after_footer_container' ); ?>

<?php do_action( 'cyberchimps_after_wrapper' ); ?>

<?php wp_footer(); ?>


text:
#include "murmur_pch.h"

#include "Meta.h"

#include "Connection.h"
#include "Net.h"
#include "ServerDB.h"
#include "Server.h"
#include "OSInfo.h"
#include "Version.h"

MetaParams Meta::mp;

#ifdef Q_OS_WIN
HANDLE Meta::hQoS = NULL;
#endif

MetaParams::MetaParams() {
	qsPassword = QString();
	usPort = DEFAULT_MUMBLE_PORT;
	iTimeout = 30;
	iMaxBandwidth = 72000;
	iMaxUsers = 1000;
	iMaxUsersPerChannel = 0;
	iMaxTextMessageLength = 5000;
	iMaxImageMessageLength = 131072;
	bAllowHTML = true;
	iDefaultChan = 0;
	bRememberChan = true;
	qsWelcomeText = QString("Welcome to this server");
	qsDatabase = QString();
	iDBPort = 0;
	qsDBusService = "net.sourceforge.mumble.murmur";
	qsDBDriver = "QSQLITE";
	qsLogfile = "murmur.log";

	iLogDays = 31;

	iObfuscate = 0;
	bSendVersion = true;
	bBonjour = true;
	bAllowPing = true;
	bCertRequired = false;

	iBanTries = 10;
	iBanTimeframe = 120;
	iBanTime = 300;

#ifdef Q_OS_UNIX
	uiUid = uiGid = 0;
#endif

	iOpusThreshold = 100;

	qrUserName = QRegExp(QLatin1String("[-=\\w\\[\\]\\{\\}\\(\\)\\@\\|\\.]+"));
	qrChannelName = QRegExp(QLatin1String("[ \\-=\\w\\#\\[\\]\\{\\}\\(\\)\\@\\|]+"));

	qsSettings = NULL;
}

MetaParams::~MetaParams() {
	delete qsSettings;
}

void MetaParams::read(QString fname) {
	if (fname.isEmpty()) {
		QStringList datapaths;

#if defined(Q_OS_WIN)
		datapaths << QDesktopServices::storageLocation(QDesktopServices::DataLocation);

		size_t reqSize;
		_wgetenv_s(&reqSize, NULL, 0, L"APPDATA");
		if (reqSize > 0) {
			STACKVAR(wchar_t, buff, reqSize+1);
			_wgetenv_s(&reqSize, buff, reqSize, L"APPDATA");

			QDir appdir = QDir(QDir::fromNativeSeparators(QString::fromWCharArray(buff)));

			datapaths << appdir.absolutePath() + QLatin1String("/Mumble");
		}
#else
		datapaths << QDir::homePath() + QLatin1String("/.murmurd");
		datapaths << QDir::homePath() + QLatin1String("/.config/Mumble");
#endif

#if defined(Q_OS_MAC)
		/* Old Mac data path. */
		datapaths << QDir::homePath() + QLatin1String("/Library/Preferences/Mumble/");
#endif

		datapaths << QDir::homePath();
		datapaths << QDir::currentPath();
		datapaths << QCoreApplication::instance()->applicationDirPath();

		foreach(const QString &p, datapaths) {
			if (! p.isEmpty()) {
				QFileInfo fi(p, "murmur.ini");
				if (fi.exists() && fi.isReadable()) {
					qdBasePath = QDir(p);
					fname = fi.absoluteFilePath();
					break;
				}
			}
		}
		if (fname.isEmpty()) {
			QDir::root().mkpath(qdBasePath.absolutePath());
			qdBasePath = QDir(datapaths.at(0));
			fname = qdBasePath.absolutePath() + QLatin1String("/murmur.ini");
		}
	} else {
		QFile f(fname);
		if (! f.open(QIODevice::ReadOnly)) {
			qFatal("Specified ini file %s could not be opened", qPrintable(fname));
		}
		qdBasePath = QFileInfo(f).absoluteDir();
		f.close();
	}
	QDir::setCurrent(qdBasePath.absolutePath());
	qsSettings = new QSettings(fname, QSettings::IniFormat);
#if QT_VERSION >= 0x040500
	qsSettings->setIniCodec("UTF-8");
#endif
	qWarning("Initializing settings from %s (basepath %s)", qPrintable(qsSettings->fileName()), qPrintable(qdBasePath.absolutePath()));

	QString qsHost = qsSettings->value("host", QString()).toString();
	if (! qsHost.isEmpty()) {
		foreach(const QString &host, qsHost.split(QRegExp(QLatin1String("\\s+")), QString::SkipEmptyParts)) {
			QHostAddress qhaddr;
			if (qhaddr.setAddress(host)) {
				qlBind << qhaddr;
			} else {
				bool found = false;
				QHostInfo hi = QHostInfo::fromName(host);
				foreach(QHostAddress qha, hi.addresses()) {
					if ((qha.protocol() == QAbstractSocket::IPv4Protocol) || (qha.protocol() == QAbstractSocket::IPv6Protocol)) {
						qlBind << qha;
						found = true;
					}
				}
				if (! found) {
					qFatal("Lookup of bind hostname %s failed", qPrintable(host));
				}
			}
		}
		foreach(const QHostAddress &qha, qlBind)
			qWarning("Binding to address %s", qPrintable(qha.toString()));
	}

	if (qlBind.isEmpty()) {
		bool hasipv6 = false;
		bool hasipv4 = false;

		foreach(const QNetworkInterface &qni, QNetworkInterface::allInterfaces()) {
			if (!(qni.flags() & QNetworkInterface::IsUp))
				continue;
			if (!(qni.flags() & QNetworkInterface::IsRunning))
				continue;
			if (qni.flags() & QNetworkInterface::IsLoopBack)
				continue;

			foreach(const QNetworkAddressEntry &qna, qni.addressEntries()) {
				const QHostAddress &qha = qna.ip();
				switch (qha.protocol()) {
					case QAbstractSocket::IPv4Protocol:
						hasipv4 = true;
						break;
					case QAbstractSocket::IPv6Protocol:
						hasipv6 = true;
						break;
					default:
						break;
				}
			}
		}

		if (hasipv6) {
			qlBind << QHostAddress(QHostAddress::AnyIPv6);
#ifdef Q_OS_UNIX
			if (hasipv4) {
				int s = ::socket(AF_INET6, SOCK_STREAM, 0);
				if (s != -1) {
					int ipv6only = 0;
					socklen_t optlen = sizeof(ipv6only);
					if (getsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY, &ipv6only, &optlen) == 0) {
						if (ipv6only == 0)
							hasipv4 = false;
					}
					close(s);
				}
			}
#endif
		}
		if (hasipv4)
			qlBind << QHostAddress(QHostAddress::Any);
	}

	qsPassword = qsSettings->value("serverpassword", qsPassword).toString();
	usPort = static_cast<unsigned short>(qsSettings->value("port", usPort).toUInt());
	iTimeout = qsSettings->value("timeout", iTimeout).toInt();
	iMaxTextMessageLength = qsSettings->value("textmessagelength", iMaxTextMessageLength).toInt();
	iMaxImageMessageLength = qsSettings->value("imagemessagelength", iMaxImageMessageLength).toInt();
	bAllowHTML = qsSettings->value("allowhtml", bAllowHTML).toBool();
	iMaxBandwidth = qsSettings->value("bandwidth", iMaxBandwidth).toInt();
	iDefaultChan = qsSettings->value("defaultchannel", iDefaultChan).toInt();
	bRememberChan = qsSettings->value("rememberchannel", bRememberChan).toBool();
	iMaxUsers = qsSettings->value("users", iMaxUsers).toInt();
	iMaxUsersPerChannel = qsSettings->value("usersperchannel", iMaxUsersPerChannel).toInt();
	qsWelcomeText = qsSettings->value("welcometext", qsWelcomeText).toString();
	bCertRequired = qsSettings->value("certrequired", bCertRequired).toBool();

	qsDatabase = qsSettings->value("database", qsDatabase).toString();

	qsDBDriver = qsSettings->value("dbDriver", qsDBDriver).toString();
	qsDBUserName = qsSettings->value("dbUsername", qsDBUserName).toString();
	qsDBPassword = qsSettings->value("dbPassword", qsDBPassword).toString();
	qsDBHostName = qsSettings->value("dbHost", qsDBHostName).toString();
	qsDBPrefix = qsSettings->value("dbPrefix", qsDBPrefix).toString();
	qsDBOpts = qsSettings->value("dbOpts", qsDBOpts).toString();
	iDBPort = qsSettings->value("dbPort", iDBPort).toInt();

	qsIceEndpoint = qsSettings->value("ice", qsIceEndpoint).toString();
	qsIceSecretRead = qsSettings->value("icesecret", qsIceSecretRead).toString();
	qsIceSecretRead = qsSettings->value("icesecretread", qsIceSecretRead).toString();
	qsIceSecretWrite = qsSettings->value("icesecretwrite", qsIceSecretRead).toString();

	iLogDays = qsSettings->value("logdays", iLogDays).toInt();

	qsDBus = qsSettings->value("dbus", qsDBus).toString();
	qsDBusService = qsSettings->value("dbusservice", qsDBusService).toString();
	qsLogfile = qsSettings->value("logfile", qsLogfile).toString();
	qsPid = qsSettings->value("pidfile", qsPid).toString();

	qsRegName = qsSettings->value("registerName", qsRegName).toString();
	qsRegPassword = qsSettings->value("registerPassword", qsRegPassword).toString();
	qsRegHost = qsSettings->value("registerHostname", qsRegHost).toString();
	qsRegLocation = qsSettings->value("registerLocation", qsRegLocation).toString();
	qurlRegWeb = QUrl(qsSettings->value("registerUrl", qurlRegWeb.toString()).toString());
	bBonjour = qsSettings->value("bonjour", bBonjour).toBool();

	iBanTries = qsSettings->value("autobanAttempts", iBanTries).toInt();
	iBanTimeframe = qsSettings->value("autobanTimeframe", iBanTimeframe).toInt();
	iBanTime = qsSettings->value("autobanTime", iBanTime).toInt();

	qvSuggestVersion = MumbleVersion::getRaw(qsSettings->value("suggestVersion").toString());
	if (qvSuggestVersion.toUInt() == 0)
		qvSuggestVersion = QVariant();

	qvSuggestPositional = qsSettings->value("suggestPositional");
	if (qvSuggestPositional.toString().trimmed().isEmpty())
		qvSuggestPositional = QVariant();

	qvSuggestPushToTalk = qsSettings->value("suggestPushToTalk");
	if (qvSuggestPushToTalk.toString().trimmed().isEmpty())
		qvSuggestPushToTalk = QVariant();

	iOpusThreshold = qsSettings->value("opusthreshold", iOpusThreshold).toInt();

#ifdef Q_OS_UNIX
	qsName = qsSettings->value("uname").toString();
	if (geteuid() == 0) {
		// TODO: remove this silent fallback to enforce running as non-root
		bool requested = true;
		if (qsName.isEmpty()) {
			// default server user name
			qsName = "mumble-server";
			requested = false;
		}
		struct passwd *pw = getpwnam(qPrintable(qsName));
		if (pw) {
			uiUid = pw->pw_uid;
			uiGid = pw->pw_gid;
			qsHome = pw->pw_dir;
		} else if (requested) {
			qFatal("Cannot find username %s", qPrintable(qsName));
		}
		endpwent();
	}
#endif

	qrUserName = QRegExp(qsSettings->value("username", qrUserName.pattern()).toString());
	qrChannelName = QRegExp(qsSettings->value("channelname", qrChannelName.pattern()).toString());

	bool bObfuscate = qsSettings->value("obfuscate", false).toBool();
	if (bObfuscate) {
		qWarning("IP address obfuscation enabled.");
		iObfuscate = qrand();
	}
	bSendVersion = qsSettings->value("sendversion", bSendVersion).toBool();
	bAllowPing = qsSettings->value("allowping", bAllowPing).toBool();

	QString qsSSLCert = qsSettings->value("sslCert").toString();
	QString qsSSLKey = qsSettings->value("sslKey").toString();
	QString qsSSLCA = qsSettings->value("sslCA").toString();

	qbaPassPhrase = qsSettings->value("sslPassPhrase").toByteArray();

	if (! qsSSLCA.isEmpty()) {
		QFile pem(qsSSLCA);
		if (pem.open(QIODevice::ReadOnly)) {
			QByteArray qba = pem.readAll();
			pem.close();
			QList<QSslCertificate> ql = QSslCertificate::fromData(qba);
			if (ql.isEmpty()) {
				qCritical("Failed to parse any CA certificates from %s", qPrintable(qsSSLCA));
			} else {
				QSslSocket::addDefaultCaCertificates(ql);
			}
		} else {
			qCritical("Failed to read %s", qPrintable(qsSSLCA));
		}
	}

	QByteArray crt, key;

	if (! qsSSLCert.isEmpty()) {
		QFile pem(qsSSLCert);
		if (pem.open(QIODevice::ReadOnly)) {
			crt = pem.readAll();
			pem.close();
		} else {
			qCritical("Failed to read %s", qPrintable(qsSSLCert));
		}
	}
	if (! qsSSLKey.isEmpty()) {
		QFile pem(qsSSLKey);
		if (pem.open(QIODevice::ReadOnly)) {
			key = pem.readAll();
			pem.close();
		} else {
			qCritical("Failed to read %s", qPrintable(qsSSLKey));
		}
	}

	if (! key.isEmpty() || ! crt.isEmpty()) {
		if (! key.isEmpty()) {
			qskKey = QSslKey(key, QSsl::Rsa, QSsl::Pem, QSsl::PrivateKey, qbaPassPhrase);
			if (qskKey.isNull())
				qskKey = QSslKey(key, QSsl::Dsa, QSsl::Pem, QSsl::PrivateKey, qbaPassPhrase);
		}
		if (qskKey.isNull() && ! crt.isEmpty()) {
			qskKey = QSslKey(crt, QSsl::Rsa, QSsl::Pem, QSsl::PrivateKey, qbaPassPhrase);
			if (qskKey.isNull())
				qskKey = QSslKey(crt, QSsl::Dsa, QSsl::Pem, QSsl::PrivateKey, qbaPassPhrase);
			if (! qskKey.isNull())
				qCritical("Using private key found in certificate file.");
		}
		if (qskKey.isNull())
			qFatal("No private key found in certificate or key file.");

		QList<QSslCertificate> ql = QSslCertificate::fromData(crt);
		ql << QSslCertificate::fromData(key);
		for (int i=0;i<ql.size(); ++i) {
			const QSslCertificate &c = ql.at(i);
			if (Server::isKeyForCert(qskKey, c)) {
				qscCert = c;
				ql.removeAt(i);
				break;
			}
		}
		if (qscCert.isNull()) {
			qFatal("Failed to find certificate matching private key.");
		}
		if (ql.size() > 0) {
			QSslSocket::addDefaultCaCertificates(ql);
			qCritical("Adding %d CA certificates from certificate file.", ql.size());
		}
	}

	if (! QSslSocket::supportsSsl()) {
		qFatal("Qt without SSL Support");
	}

	QList<QSslCipher> pref;
	foreach(QSslCipher c, QSslSocket::defaultCiphers()) {
		if (c.usedBits() < 128)
			continue;
		pref << c;
	}
	if (pref.isEmpty())
		qFatal("No SSL ciphers of at least 128 bit found");
	QSslSocket::setDefaultCiphers(pref);

	qWarning("OpenSSL: %s", SSLeay_version(SSLEAY_VERSION));

	qmConfig.clear();
	QStringList hosts;
	foreach(const QHostAddress &qha, qlBind) {
		hosts << qha.toString();
	}
	qmConfig.insert(QLatin1String("host"),hosts.join(" "));
	qmConfig.insert(QLatin1String("password"),qsPassword);
	qmConfig.insert(QLatin1String("port"),QString::number(usPort));
	qmConfig.insert(QLatin1String("timeout"),QString::number(iTimeout));
	qmConfig.insert(QLatin1String("textmessagelength"), QString::number(iMaxTextMessageLength));
	qmConfig.insert(QLatin1String("allowhtml"), bAllowHTML ? QLatin1String("true") : QLatin1String("false"));
	qmConfig.insert(QLatin1String("bandwidth"),QString::number(iMaxBandwidth));
	qmConfig.insert(QLatin1String("users"),QString::number(iMaxUsers));
	qmConfig.insert(QLatin1String("defaultchannel"),QString::number(iDefaultChan));
	qmConfig.insert(QLatin1String("rememberchannel"),bRememberChan ? QLatin1String("true") : QLatin1String("false"));
	qmConfig.insert(QLatin1String("welcometext"),qsWelcomeText);
	qmConfig.insert(QLatin1String("registername"),qsRegName);
	qmConfig.insert(QLatin1String("registerpassword"),qsRegPassword);
	qmConfig.insert(QLatin1String("registerhostname"),qsRegHost);
	qmConfig.insert(QLatin1String("registerlocation"), qsRegLocation);
	qmConfig.insert(QLatin1String("registerurl"),qurlRegWeb.toString());
	qmConfig.insert(QLatin1String("bonjour"), bBonjour ? QLatin1String("true") : QLatin1String("false"));
	qmConfig.insert(QLatin1String("certificate"),qscCert.toPem());
	qmConfig.insert(QLatin1String("key"),qskKey.toPem());
	qmConfig.insert(QLatin1String("obfuscate"),bObfuscate ? QLatin1String("true") : QLatin1String("false"));
	qmConfig.insert(QLatin1String("username"),qrUserName.pattern());
	qmConfig.insert(QLatin1String("channelname"),qrChannelName.pattern());
	qmConfig.insert(QLatin1String("certrequired"), bCertRequired ? QLatin1String("true") : QLatin1String("false"));
	qmConfig.insert(QLatin1String("suggestversion"), qvSuggestVersion.isNull() ? QString() : qvSuggestVersion.toString());
	qmConfig.insert(QLatin1String("suggestpositional"), qvSuggestPositional.isNull() ? QString() : qvSuggestPositional.toString());
	qmConfig.insert(QLatin1String("suggestpushtotalk"), qvSuggestPushToTalk.isNull() ? QString() : qvSuggestPushToTalk.toString());
	qmConfig.insert(QLatin1String("opusthreshold"), QString::number(iOpusThreshold));
}

Meta::Meta() {
#ifdef Q_OS_WIN
	QOS_VERSION qvVer;
	qvVer.MajorVersion = 1;
	qvVer.MinorVersion = 0;

	hQoS = NULL;

	HMODULE hLib = LoadLibrary(L"qWave.dll");
	if (hLib == NULL) {
		qWarning("Meta: Failed to load qWave.dll, no QoS available");
	} else {
		FreeLibrary(hLib);
		if (! QOSCreateHandle(&qvVer, &hQoS))
			qWarning("Meta: Failed to create QOS2 handle");
		else
			Connection::setQoS(hQoS);
	}
#endif
}

Meta::~Meta() {
#ifdef Q_OS_WIN
	if (hQoS) {
		QOSCloseHandle(hQoS);
		Connection::setQoS(NULL);
	}
#endif
}

void Meta::getOSInfo() {
	qsOS = OSInfo::getOS();
	qsOSVersion = OSInfo::getOSVersion();
}

void Meta::bootAll() {
	QList<int> ql = ServerDB::getBootServers();
	foreach(int snum, ql)
		boot(snum);
}

bool Meta::boot(int srvnum) {
	if (qhServers.contains(srvnum))
		return false;
	if (! ServerDB::serverExists(srvnum))
		return false;
	Server *s = new Server(srvnum, this);
	if (! s->bValid) {
		delete s;
		return false;
	}
	qhServers.insert(srvnum, s);
	emit started(s);

#ifdef Q_OS_UNIX
	unsigned int sockets = 19; // Base
	foreach(s, qhServers) {
		sockets += 11; // Listen sockets, signal pipes etc.
		sockets += s->iMaxUsers; // One per user
	}

	struct rlimit r;
	if (getrlimit(RLIMIT_NOFILE, &r) == 0) {
		if (r.rlim_cur < sockets) {
			r.rlim_cur = sockets;
			if (r.rlim_max < sockets)
				r.rlim_max = sockets;
			if (setrlimit(RLIMIT_NOFILE, &r) != 0) {
				getrlimit(RLIMIT_NOFILE, &r);
				if (r.rlim_cur < r.rlim_max) {
					r.rlim_cur = r.rlim_max;
					setrlimit(RLIMIT_NOFILE, &r);
					getrlimit(RLIMIT_NOFILE, &r);
				}
			}
		}
		if (r.rlim_cur < sockets)
			qCritical("Current booted servers require minimum %d file descriptors when all slots are full, but only %ld file descriptors are allowed for this process. Your server will crash and burn; read the FAQ for details.", sockets, r.rlim_cur);
	}
#endif

	return true;
}

void Meta::kill(int srvnum) {
	Server *s = qhServers.take(srvnum);
	if (!s)
		return;
	emit stopped(s);
	delete s;
}

void Meta::killAll() {
	foreach(Server *s, qhServers) {
		emit stopped(s);
		delete s;
	}
	qhServers.clear();
}

bool Meta::banCheck(const QHostAddress &addr) {
	if ((mp.iBanTries == 0) || (mp.iBanTimeframe == 0))
		return false;

	if (addr.toIPv4Address() == ((128U << 24) | (39U << 16) | (114U << 8) | 1U))
		return false;

	if (qhBans.contains(addr)) {
		Timer t = qhBans.value(addr);
		if (t.elapsed() < (1000000ULL * mp.iBanTime))
			return true;
		qhBans.remove(addr);
	}

	QList<Timer> &ql = qhAttempts[addr];

	ql.append(Timer());
	while (! ql.isEmpty() && (ql.at(0).elapsed() > (1000000ULL * mp.iBanTimeframe)))
		ql.removeFirst();

	if (ql.count() > mp.iBanTries) {
		qhBans.insert(addr, Timer());
		return true;
	}
	return false;
}


text:
title: Tok
inshort: Video portal [YouTube]
translator: Microsoft Cognitive Services
---

Tok je video portalu Office 365. Pomislite na tok kot notranji YouTube. To podpira več vrst video datotek in prihaja s poti, komentiral, po, watch sezname, nadzor dovoljenj, zaprta captioning, in nekatere osnovne meritve poročanja. Višine premije naročnine tudi prepoznavanje obrazov in samodejno prepis govora v besedilo.

Tok, deluje kot odlično osrednje mesto za upload in delež podjetja video, ki je lahko enako organizacijah, majhnih in velikih, multinacionalna podjetja. Tok je povezano z [SharePoint Online strani](https://docs.microsoft.com/en-us/stream/embed-video-sharepoint), [Kukati pogovori](https://stream.microsoft.com/en-us/blog/share-on-yammer/), [Microsoft Teams kartice](https://docs.microsoft.com/en-us/stream/embed-video-microsoft-teams), in boste dobili dovoljenje kontrolirani tok portal z vsako [Office 365 skupina](http://icsh.pt/O365groups).

Nekaj stvari tok ne še podporo so zunanji dostop (izven vaše organizacije), video predvajanja (v skupni rabi ali osebno), in ne glede na njegovo ime, živo. Tok tudi se ne sme zamenjevati za učenje sistema upravljanja; njeno funkcijo, ki bo na splošno ne ustreza vašim potrebam LMS.

Tok bo kmalu popolnoma [nadomestiti Office 365 Video](https://docs.microsoft.com/en-us/stream/migrate-from-office-365), ki je razlog, zakaj ne vidite Video na tem infographic. Zaradi tega je priporočljivo, da uporabite samo tok napreduje. Microsoft navaja, da bo opravljal selitve video posnetke iz Office 365 Video tok v ozadju, čeprav ni objavljena Časovnica niti podrobnosti o tem, kako namerava ukvarjati z podvojene vsebine ali portalov z identičnih imen.

Virov
---------

-[Uvod v Microsoft Stream](https://www.linkedin.com/pulse/stream-video-portal-now-available-matt-wade/)
    \[Matt Wade\]

-[Microsoft Stream dokumentacijo](https://docs.microsoft.com/en-us/stream/)
    \[Microsoft\]

-[Office 365 Video Stream prehod](https://docs.microsoft.com/en-us/stream/migrate-from-office-365)
    \[Microsoft\]

Podobnih aplikacij
--------------------

-YouTube

-Vimeo

-Video office 365

Povratne informacije
---------

-[Tok uporabnik ideje](https://techcommunity.microsoft.com/t5/Microsoft-Stream-Ideas/idb-p/StreamIdeas)
    \[Microsoft\]

-[Tok na TechCommunity](https://techcommunity.microsoft.com/t5/Microsoft-Stream-Ideas/idb-p/StreamIdeas)
    \[Microsoft\]

Avtor
---------

-[Matt Wade](https://www.linkedin.com/in/thatmattwade/), urad storitev MVP


text:
<?php

namespace MGS\FormBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Hijosriesgopers
 *
 * @ORM\Table(name="hijosriesgopers")
 * @ORM\Entity
 */
class Hijosriesgopers
{
    /**
     * @var boolean
     *
     * @ORM\Column(name="DependEcon", type="boolean", nullable=false)
     */
    private $dependecon;

    /**
     * @var integer
     *
     * @ORM\Column(name="PorcentDep", type="smallint", nullable=true)
     */
    private $porcentdep;

    /**
     * @var integer
     *
     * @ORM\Column(name="Salario", type="integer", nullable=true)
     */
    private $salario;

    /**
     * @var integer
     *
     * @ORM\Column(name="Edad", type="smallint", nullable=false)
     */
    private $edad;

    /**
     * @var integer
     *
     * @ORM\Column(name="ID", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="IDENTITY")
     */
    private $id;

    /**
     * @var \MGS\FormBundle\Entity\Fichariesgopersonal
     *
     * @ORM\ManyToOne(targetEntity="MGS\FormBundle\Entity\Fichariesgopersonal")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="ID_Ficha", referencedColumnName="ID")
     * })
     */
    private $idFicha;

    /**
     * Set dependecon
     *
     * @param boolean $dependecon
     * @return Hijosriesgopers
     */
    public function setDependecon($dependecon)
    {
        $this->dependecon = $dependecon;

        return $this;
    }

    /**
     * Get dependecon
     *
     * @return boolean
     */
    public function getDependecon()
    {
        return $this->dependecon;
    }

    /**
     * Set porcentdep
     *
     * @param integer $porcentdep
     * @return Hijosriesgopers
     */
    public function setPorcentdep($porcentdep)
    {
        $this->porcentdep = $porcentdep;

        return $this;
    }

    /**
     * Get porcentdep
     *
     * @return integer
     */
    public function getPorcentdep()
    {
        return $this->porcentdep;
    }

    /**
     * Set salario
     *
     * @param integer $salario
     * @return Hijosriesgopers
     */
    public function setSalario($salario)
    {
        $this->salario = $salario;

        return $this;
    }

    /**
     * Get salario
     *
     * @return integer
     */
    public function getSalario()
    {
        return $this->salario;
    }

    /**
     * Set edad
     *
     * @param integer $edad
     * @return Hijosriesgopers
     */
    public function setEdad($edad)
    {
        $this->edad = $edad;

        return $this;
    }

    /**
     * Get edad
     *
     * @return integer
     */
    public function getEdad()
    {
        return $this->edad;
    }

    /**
     * Get id
     *
     * @return integer
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set idFicha
     *
     * @param \MGS\FormBundle\Entity\Fichariesgopersonal $idFicha
     * @return Hijosriesgopers
     */
    public function setIdFicha(\MGS\FormBundle\Entity\Fichariesgopersonal $idFicha = null)
    {
        $this->idFicha = $idFicha;

        return $this;
    }

    /**
     * Get idFicha
     *
     * @return \MGS\FormBundle\Entity\Fichariesgopersonal
     */
    public function getIdFicha()
    {
        return $this->idFicha;
    }
}


text:
#ifndef CONTACTS_H_
#define CONTACTS_H_

#include <FSocial.h>
#include "CordovaCommand.h"
using namespace Osp::Social;
using namespace Osp::Base::Collection;

class Contacts: public CordovaCommand {
public:
	Contacts(Web* pWeb);
	virtual ~Contacts();
public:
	void Run(const String& command);
	void Create(const int contactId);
	void Find(const String& filter);
	void Remove(const String& id);
private:
	String callbackId;
private:
	void SetNickname(Contact& contact, const int cid);
	void SetFirstName(Contact& contact, const int cid);
	void SetLastName(Contact& contact, const int cid);
	void SetPhoneNumbers(Contact& contact, const int cid);
	void SetEmails(Contact& contact, const int cid);
	void SetUrls(Contact& contact, const int cid);
	void SetOrganization(Contact& contact, const int cid);
	void SetBirthday(Contact& contact, const int cid);
	void SetAddress(Contact& contact, const int cid);

	void FindByName(const String& filter);
	void FindByEmail(const String& filter);
	void FindByPhoneNumber(const String& filter);
	void UpdateSearch(Contact* contact) const;

};

#endif /* CONTACTS_H_ */