text:
extern crate rand;

use std::io;
use std::cmp::Ordering;
use rand::Rng;

fn main() {
	println!("Guess the number!");

	let secret_number = rand::thread_rng().gen_range(1, 101);

	// println!("The secret number is: {}", secret_number);

	println!("Please input your guess.");
	loop {

		let mut guess = String::new();

		io::stdin().read_line(&mut guess)
			.expect("Failed to read line");

		let guess: u32 = match guess.trim().parse() {
			Ok(num) => num,
			Err(_) => {
				println!("Please input a number");
				continue;
			}
		};

		println!("You guessed: {}", guess);

		match guess.cmp(&secret_number) {
			Ordering::Less		=> println!("Too small!"),
			Ordering::Greater	=> println!("Too big!"),
			Ordering::Equal		=> {
				println!("you win!");
				break;
			}
		}
	}

}


text:
<form name="bookForm" class="form-horizontal" role="form" ng-submit="addBook(bookForm.$valid)" novalidate>

    <div ng-include="'templates/books/partial-book-form.html'">

    </div>
</form>

redpajama_set_name: RedPajamaGithub


text:
#import "FBSimulatorTerminationStrategy.h"

#import <CoreSimulator/SimDevice.h>
#import <CoreSimulator/SimDeviceSet.h>
#import <CoreSimulator/SimDeviceType.h>
#import <CoreSimulator/SimRuntime.h>

#import <FBControlCore/FBControlCoreLogger.h>

#import <XCTestBootstrap/FBTestManager.h>

#import "FBCoreSimulatorNotifier.h"
#import "FBSimulator+Helpers.h"
#import "FBSimulator+Connection.h"
#import "FBSimulator+Private.h"
#import "FBSimulatorConnection.h"
#import "FBSimulatorConfiguration+CoreSimulator.h"
#import "FBSimulatorConfiguration.h"
#import "FBSimulatorControl.h"
#import "FBSimulatorControlConfiguration.h"
#import "FBSimulatorError.h"
#import "FBSimulatorPredicates.h"
#import "FBSimulatorShutdownStrategy.h"
#import "FBSimulatorProcessFetcher.h"
#import "FBSimulatorSet.h"

@interface FBSimulatorTerminationStrategy ()

@property (nonatomic, weak, readonly) FBSimulatorSet *set;
@property (nonatomic, copy, readonly) FBSimulatorControlConfiguration *configuration;
@property (nonatomic, strong, readonly) FBSimulatorProcessFetcher *processFetcher;
@property (nonatomic, strong, nullable, readonly) id<FBControlCoreLogger> logger;
@property (nonatomic, strong, readonly) FBProcessTerminationStrategy *processTerminationStrategy;

@end

@implementation FBSimulatorTerminationStrategy

#pragma mark Initialization

+ (instancetype)strategyForSet:(FBSimulatorSet *)set
{
  FBProcessTerminationStrategy *processTerminationStrategy = [FBProcessTerminationStrategy strategyWithProcessFetcher:set.processFetcher.processFetcher logger:set.logger];
  return [[self alloc] initWithSet:set configuration:set.configuration processFetcher:set.processFetcher processTerminationStrategy:processTerminationStrategy logger:set.logger];
}

- (instancetype)initWithSet:(FBSimulatorSet *)set configuration:(FBSimulatorControlConfiguration *)configuration processFetcher:(FBSimulatorProcessFetcher *)processFetcher processTerminationStrategy:(FBProcessTerminationStrategy *)processTerminationStrategy logger:(id<FBControlCoreLogger>)logger
{
  NSParameterAssert(processFetcher);
  NSParameterAssert(configuration);
  NSParameterAssert(processTerminationStrategy);

  self = [super init];
  if (!self) {
    return nil;
  }

  _set = set;
  _configuration = configuration;
  _processFetcher = processFetcher;
  _logger = logger;
  _processTerminationStrategy = processTerminationStrategy;

  return self;
}

#pragma mark Public Methods

- (nullable NSArray<FBSimulator *> *)killSimulators:(NSArray<FBSimulator *> *)simulators error:(NSError **)error;
{
  // Confirm that the Simulators belong to the set
  for (FBSimulator *simulator in simulators) {
    if (simulator.set != self.set) {
      return [[[FBSimulatorError
        describeFormat:@"Simulator's set %@ is not %@, cannot delete", simulator.set, self]
        inSimulator:simulator]
        fail:error];
    }
  }

  // It looks like there is a bug with El Capitan, where terminating multiple Applications quickly
  // can result in the dock getting into an inconsistent state displaying icons for terminated Applications.
  //
  // This happens regardless of how the Application was terminated.
  // The process backing the terminated Application is definitely gone, but the dock icon isn't.
  // The Application appears in the Force Quit menu, but cannot ever be quit by conventional means.
  // Attempting to shutdown the Mac will result in hanging (probably because it can't terminate the App).
  //
  // The only remedy is to quit 'launchservicesd' followed by 'Dock.app'.
  // This will clear up the stale state that must exist in the Dock/launchservicesd.
  // Waiting after killing of processes by a short period of time is sufficient to mitigate this issue.
  // Since `-[FBSimDeviceWrapper shutdownWithError:]` will spin the run loop until CoreSimulator confirms that the device is shutdown,
  // this will give a sufficient amount of time between killing Applications.

  [self.logger.debug logFormat:@"Killing %@", [FBCollectionInformation oneLineDescriptionFromArray:simulators atKeyPath:@"shortDescription"]];
  for (FBSimulator *simulator in simulators) {
    // Get some preconditions
    NSError *innerError = nil;
    FBProcessInfo *launchdProcess = simulator.launchdProcess ?: [self.processFetcher launchdProcessForSimDevice:simulator.device];

    // The Simulator Connection for this process should be tidied up first.
    if (![simulator disconnectWithTimeout:FBControlCoreGlobalConfiguration.regularTimeout logger:self.logger error:&innerError]) {
      return [[[[[FBSimulatorError
        describe:@"Could disconnect from Simulator"]
        inSimulator:simulator]
        causedBy:innerError]
        logger:self.logger]
        fail:error];
    }

    // Disconnect any Test Managers connected to the Simulator.
    // If a TestManager Deallocates during the shutdown of a Simulator, the calling thread can deadlock.
    for (FBTestManager *testManager in simulator.resourceSink.testManagers) {
      [testManager disconnect];
      [simulator.eventSink testmanagerDidDisconnect:testManager];
    }

    // Kill the Simulator.app Process first, see documentation in `-[FBSimDeviceWrapper shutdownWithError:]`.
    // This prevents 'Zombie' Simulator.app from existing.
    FBProcessInfo *simulatorProcess = simulator.containerApplication ?: [self.processFetcher simulatorApplicationProcessForSimDevice:simulator.device];
    if (simulatorProcess) {
      [self.logger.debug logFormat:@"Simulator %@ has a Simulator.app Process %@, terminating it now", simulator.shortDescription, simulatorProcess];
      if (![self.processTerminationStrategy killProcess:simulatorProcess error:&innerError]) {
        return [[[[[FBSimulatorError
          describeFormat:@"Could not kill simulator process %@", simulatorProcess]
          inSimulator:simulator]
          causedBy:innerError]
          logger:self.logger]
          fail:error];
      }
      [simulator.eventSink containerApplicationDidTerminate:simulatorProcess expected:YES];
    } else {
      [self.logger.debug logFormat:@"Simulator %@ does not have a running Simulator.app Process", simulator.shortDescription];
    }

    // Shutdown will:
    // 1) Wait for a Simulator launched via Simulator.app to be in a consistent 'Shutdown' state.
    // 2) Shutdown a SimDevice that has been launched directly via. `-[SimDevice bootWithOptions:error]`.
    if (![[FBSimulatorShutdownStrategy strategyWithSimulator:simulator] shutdownWithError:&innerError]) {
      return [[[[[FBSimulatorError
        describe:@"Could not shut down simulator after termination"]
        inSimulator:simulator]
        causedBy:innerError]
        logger:self.logger]
        fail:error];
    }
    if (launchdProcess) {
      [simulator.eventSink simulatorDidTerminate:launchdProcess expected:YES];
    }
  }
  return simulators;
}

- (BOOL)killSpuriousSimulatorsWithError:(NSError **)error
{
  NSPredicate *predicate = [NSCompoundPredicate notPredicateWithSubpredicate:
    [NSCompoundPredicate andPredicateWithSubpredicates:@[
      [FBSimulatorProcessFetcher simulatorsProcessesLaunchedUnderConfiguration:self.configuration],
      [FBSimulatorProcessFetcher simulatorApplicationProcessesLaunchedBySimulatorControl]
    ]
  ]];

  NSError *innerError = nil;
  if (![self killSimulatorProcessesMatchingPredicate:predicate error:&innerError]) {
    return [[[[FBSimulatorError
      describe:@"Could not kill spurious simulators"]
      causedBy:innerError]
      logger:self.logger]
      failBool:error];
  }

  return YES;
}

#pragma mark Private

- (BOOL)killSimulatorProcessesMatchingPredicate:(NSPredicate *)predicate error:(NSError **)error
{
  NSArray *processes = [self.processFetcher.simulatorApplicationProcesses filteredArrayUsingPredicate:predicate];
  for (FBProcessInfo *process in processes) {
    NSParameterAssert(process.processIdentifier > 1);
    if (![self.processTerminationStrategy killProcess:process error:error]) {
      return NO;
    }
    // See comment in `killSimulators:withError:`
    sleep(1);
  }
  return YES;
}

@end


text:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.aqib.icrave" >

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name="com.aqib.icrave.controller.MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name="com.aqib.icrave.controller.ImageActivity"
            android:label="@string/app_name" />
        <activity
            android:name="com.aqib.icrave.controller.RootActivity"
            android:label="@string/app_name" />
        <activity
            android:name="com.aqib.icrave.controller.ResultActivity"
            android:label="@string/app_name"
            android:parentActivityName="com.aqib.icrave.controller.RootActivity" >
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value="RootActivity" />
        </activity>
        <activity
            android:name="com.aqib.icrave.controller.ConsentActivity"
            android:label="@string/title_activity_consent" />
        <activity
            android:name="com.aqib.icrave.controller.PortionSizesActivity"
            android:label="@string/title_activity_portion_sizes" />
        <activity
            android:name="com.aqib.icrave.controller.ICraveOptionsActivity"
            android:label="@string/title_activity_icrave_options"
            android:parentActivityName="com.aqib.icrave.controller.MainActivity" >
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value="RootActivity" />
        </activity>
        <activity
            android:name="com.aqib.icrave.controller.LoginActivity"
            android:label="@string/title_activity_login" >
        </activity>
    </application>

    <uses-permission android:name="android.permission.INTERNET" />

</manifest>


text:
layout: post
title:  "angular-scalable-project - Atualizações"
date:   2015-09-13 10:18:00
permalink: angular-scalable-project-atualizacoes
category: Front-end
---
Tenho recebido algumas sugestões a respeito do [projeto](http://github.com/dsalvagni/angular-scalable-project) que divulguei recentemente. Algumas sugestões de melhoria eu compartilho como necessárias, outras nem tanto. Acabei de fazer uma atualização no projeto e vou listar o que recebi de sugestão e o que foi implementado - pouco, por enquanto.

## Algumas sugestões recebidas:

### Pré-processador de HTML JADE

É simples de implementar, mas não deve ser o padrão. A ideia do projeto é ser um _skeleton_ de uma estrutura de _single-page application_ simples. A opção de utilizar JADE ou outro deve ser definida no projeto em que essa estrutura for aplicada. **Não pretendo implementar**

### ES6 com BabelJS

MS Edge has more #ES6 support than Chrome and Firefox. https://t.co/OKVjRHTTsc
— Daniel Salvagni (@danielsalvagni) 27 agosto 2015

Assim como o caso do JADE, acredito que o uso do ES6 com o BabelJS deve ser decidido por projeto. **Não pretendo implementar**

### Substituir o GRUNT pelo GULP

Por mais que o Gulp tenha uma performance melhor, acredito que essa seja uma questão de afinidade com a tecnologia. Se alguém substituir as tasks do Grunt pelo Gulp e quiser compartilhar, posso disponibilizar no projeto.

### Adicionar o Bower

O Bower é fundamental para gerenciar as dependências. Era uma pendência que eu tinha desde que publiquei o projeto e hoje decidi atualizar para que as dependências já sejam gerenciadas pelo bower. Isso gerou alguns novos passos no fluxo de desenvolvimento. Agora, após clonar o projeto, é preciso rodar o [plain]bower install[/plain]. Em seguida, é preciso adicionar as dependências ao arquivo de configuração do requireJS (main.js). Para isso, basta rodar a task do grunt [plain]grunt bowerRequirejs[/plain]. Lembrando que o _test-main.js_ deve ser mantido manualmente para rodar sem problemas no karma.

### Suporte ao $templateCache

O AngularJS já faz cache das _views_ depois de acessadas pela primeira vez. A ideia do uso do $templateCache é que, no caso de a aplicação ter diversas _partials_, a requisição das mesmas pela primeira vez pode gerar um certo transtorno (muitas requisições).

#### O que foi feito nessa atualização?

Adicionei uma task no Grunt que usa o [grunt-angular-templates](https://www.npmjs.com/package/grunt-angular-templates) para concatenar todas as _views_ em um único arquivo de _resource_. Essa é uma solução opcional e não altera em nada o modo em que se desenvolve a aplicação usando o projeto. A diferença é que usando o $templateCache, nenhuma _view_ é gerada na versão de distribuição Para gerar uma versão de distribuição com o $templateCache, basta usar a flag _--templateCache_:

> grunt dist --templateCache

Para gerar usar em desenvolvimento, basta usar:

> grunt ngtemplates

* * *

Por enquanto essas são as novidades do projeto. Pretendo disponibilizar em breve uma versão em que os módulos são carregados de forma assíncrona, baseando-se pelas rotas da aplicação.


text:
package org.compass.core.test.analyzer;

import org.compass.core.CompassHits;
import org.compass.core.CompassQuery;
import org.compass.core.CompassSession;
import org.compass.core.CompassToken;
import org.compass.core.CompassTransaction;
import org.compass.core.Resource;
import org.compass.core.engine.SearchEngineException;

/**
 * @author kimchy
 */
public class ResourceAnalyzerTests extends AbstractAnalyzerTests {

    protected String[] getMappings() {
        return new String[]{"analyzer/resource.cpm.xml"};
    }

    public void testResourceNoAnalyzer() {
        CompassSession session = openSession();
        CompassTransaction tr = session.beginTransaction();

        Long id = (long) 1;
        Resource r = getCompass().getResourceFactory().createResource("a");
        r.addProperty("id", id);
        r.addProperty("value", TEXT);
        session.save(r);

        CompassHits hits = session.find("a.value:the");
        assertEquals(0, hits.getLength());
        // test for the all property as well
        hits = session.find("the");
        assertEquals(0, hits.getLength());

        // this one will use the simple analyzer
        CompassToken[] tokens = session.analyzerHelper().setAnalyzer("simple").analyze(r.getValue("value"));
        assertEquals(9, tokens.length);
        assertEquals("the", tokens[0].getTermText());
        assertEquals("quick", tokens[1].getTermText());
        assertEquals("brown", tokens[2].getTermText());
        assertEquals("fox", tokens[3].getTermText());

        // this one will use the default analyzer
        tokens = session.analyzerHelper().setAnalyzerByAlias("a").analyze(r.getValue("value"));
        assertEquals(7, tokens.length);
        assertEquals("quick", tokens[0].getTermText());
        assertEquals("brown", tokens[1].getTermText());
        assertEquals("fox", tokens[2].getTermText());

        tr.commit();

    }

    public void testResourceAnalyzerSetForResource() {
        CompassSession session = openSession();
        CompassTransaction tr = session.beginTransaction();

        Long id = (long) 1;
        Resource r = getCompass().getResourceFactory().createResource("b");
        r.addProperty("id", id);
        r.addProperty("value", TEXT);
        session.save(r);

        CompassHits hits = session.find("b.value:the");
        assertEquals(1, hits.getLength());
        // test for the all property as well
        hits = session.find("the");
        assertEquals(1, hits.getLength());

        tr.commit();
    }

    public void testResourceAnalyzerSetForResourceWithCompassQuery() {
        CompassSession session = openSession();
        CompassTransaction tr = session.beginTransaction();

        Long id = (long) 1;
        Resource r = getCompass().getResourceFactory().createResource("b");
        r.addProperty("id", id);
        r.addProperty("value", TEXT);
        session.save(r);

        CompassHits hits = session.find("b.value:the");
        assertEquals(1, hits.getLength());
        // test for the all property as well
        hits = session.find("the");
        assertEquals(1, hits.length());

        // this won't take into account without forcing the analyzer
        CompassQuery query = session.queryBuilder().queryString("b.value:the").setAnalyzer("default").toQuery();
        assertEquals(1, query.hits().getLength());

        query = session.queryBuilder().queryString("b.value:the").setAnalyzer("default").forceAnalyzer().toQuery();
        assertEquals(0, query.hits().getLength());

        query = session.queryBuilder().queryString("b.value:the").setAnalyzer("simple").forceAnalyzer().toQuery();
        assertEquals(1, query.hits().length());

        tr.commit();
    }

    public void testResourceAnalyzerSetForProperty() {
        CompassSession session = openSession();
        CompassTransaction tr = session.beginTransaction();

        Long id = (long) 1;
        Resource r = getCompass().getResourceFactory().createResource("d");
        r.addProperty("id", id);
        r.addProperty("value", TEXT);
        r.addProperty("value2", TEXT);
        session.save(r);

        CompassHits hits = session.find("d.value:the");
        assertEquals(1, hits.getLength());
        hits = session.find("d.value2:the");
        assertEquals(0, hits.getLength());
        // test for the all property as well
        hits = session.find("the");
        assertEquals(1, hits.getLength());

        tr.commit();
    }

    public void testResourceAnalyzerSetForResourceAndProperty() {
        CompassSession session = openSession();
        CompassTransaction tr = session.beginTransaction();

        Long id = (long) 1;
        Resource r = getCompass().getResourceFactory().createResource("e");
        r.addProperty("id", id);
        r.addProperty("value", TEXT);
        r.addProperty("value2", TEXT);
        session.save(r);

        CompassHits hits = session.find("e.value:the");
        assertEquals(0, hits.getLength());
        hits = session.find("e.value2:the");
        assertEquals(1, hits.getLength());

        tr.commit();
    }

    public void testResourceAnalyzerController() {
        CompassSession session = openSession();
        CompassTransaction tr = session.beginTransaction();

        Long id = (long) 1;
        Resource r = getCompass().getResourceFactory().createResource("g");
        r.addProperty("id", id);
        r.addProperty("value", TEXT);
        r.addProperty("analyzer", "simple");
        session.save(r);

        CompassHits hits = session.find("g.value:the");
        assertEquals(1, hits.getLength());

        r = getCompass().getResourceFactory().createResource("g");
        r.addProperty("id", id);
        r.addProperty("value", TEXT);
        try {
            session.save(r);
            tr.commit();
            fail();
        } catch (SearchEngineException e) {
            tr.rollback();
        }

        session.close();
    }

    public void testResourceAnalyzerControllerWithNullAnalyzer() {
        CompassSession session = openSession();
        CompassTransaction tr = session.beginTransaction();

        Long id = (long) 1;
        Resource r = getCompass().getResourceFactory().createResource("g");
        r.addProperty("id", id);
        r.addProperty("value", TEXT);
        r.addProperty("analyzer", "simple");
        session.save(r);

        CompassHits hits = session.find("g.value:the");
        assertEquals(1, hits.getLength());

        r = getCompass().getResourceFactory().createResource("h");
        r.addProperty("id", id);
        r.addProperty("value", TEXT);
        session.save(r);

        // analyzer controller can't affect query string (since we don't have the resource), just for simple and
        // check that both h and i were saved
        hits = session.queryBuilder().queryString("value:the").setAnalyzer("simple").forceAnalyzer().toQuery().hits();
        assertEquals(2, hits.getLength());

        tr.commit();
    }

    public void testResourceAnalyzerControllerWithNullAnalyzerAndPropertyAnalyzer() {
        CompassSession session = openSession();
        CompassTransaction tr = session.beginTransaction();

        Long id = (long) 1;
        Resource r = getCompass().getResourceFactory().createResource("i");
        r.addProperty("id", id);
        r.addProperty("value", TEXT);
        r.addProperty("analyzer", "simple");
        session.save(r);

        CompassHits hits = session.queryBuilder().queryString("value:the").setAnalyzer("simple").forceAnalyzer().toQuery().hits();
        assertEquals(0, hits.getLength());

        tr.commit();
    }
}


text:
module Rackbl
  class Server
    def call(env)
      req = Rack::Request.new(env)

      article = ArticlesController.new(parse(req.path))

      if article.exists?
        renderer = Rackbl::Renderer.new(article.render)
        [200, {"Content-Type" => "text/html"}, [renderer.render]]
      else
        [400, {"Content-Type" => "text/html"}, ["Oops, are you lost? Try going here"]]
      end
    end

    def parse(path)
      path = path.split("/")
      if path.size > 1
        filename = path[1,path.size].join("-")
      else
        file_path = ""
      end
    end
  end
end


text:
using namespace cv;
using namespace std;

Mat frame; //current frame
Mat fgMaskMOG2; //fg mask fg mask generated by MOG2 method
Mat fgMaskMOG; //fg mask fg mask generated by MOG method

Ptr<BackgroundSubtractor> pMOG2; //MOG2 Background subtractor
Ptr<BackgroundSubtractor> pMOG; //MOG Background subtractor

int keyboard; //input from keyboard

void processVideo(char* videoFilename);
Mat backgroundSubtract(Mat frame);

static void help()
{
    cout << "\nThis program demonstrates line finding with the Hough transform.\n"
            "Usage:\n"
            "./houghlines <image_name>, Default is ../data/pic1.png\n" << endl;
}

int main(int argc, char** argv)
{
    help();
    pMOG = bgsegm::createBackgroundSubtractorMOG(500,5,.925,2);
    pMOG2 = createBackgroundSubtractorMOG2(500,8,false);

    if(argc != 2){
        cerr <<"Incorrect input list" << endl;
        cerr <<"exiting..." << endl;
        return EXIT_FAILURE;
    }
	processVideo(argv[1]);

    return 0;
}

Mat backgroundSubtract(Mat frameIn){
    Mat gauss, mask, cdst;
    pMOG2->apply(frameIn, fgMaskMOG2);

    //blurs the image uses the MOG2 background subtraction
    GaussianBlur(fgMaskMOG2, gauss, Size(5,5), 0,0);
    imshow("Blur", gauss);
    // Define the structuring elements to be used in eroding and dilating the image
    Mat se1 = getStructuringElement(MORPH_RECT, Size(5, 5));
    Mat se2 = getStructuringElement(MORPH_RECT, Size(5, 5));

    // Perform dialting and eroding helps to elminate background noise
    morphologyEx(gauss, mask, MORPH_CLOSE, se1);
    morphologyEx(mask, mask, MORPH_OPEN, se2);

    // transforms mask into a binary image
    threshold(mask, mask, 100, 255, CV_THRESH_BINARY);

    return mask;
}

void processVideo(char* videoFilename) {
	Mat dst, cdst, gauss, mask;
	VideoCapture capture;
    if(strcmp(videoFilename, "cam") == 0){
       capture.open(0);
    }
    else{
        capture.open(videoFilename);
    }

    if(!capture.isOpened()){
        //error in opening the video input
        cerr << "Unable to open video file: " << videoFilename << endl;
        exit(EXIT_FAILURE);
    }

	//read input data. ESC or 'q' for quitting
    while( (char)keyboard != 'q' && (char)keyboard != 27 ){

        //read the current frame
        if(!capture.read(frame)) {
            cerr << "Unable to read next frame." << endl;
            cerr << "Exiting..." << endl;
            exit(EXIT_FAILURE);
        }

        mask = backgroundSubtract(frame);
        Canny(mask, dst, 50, 200, 7);
        imshow("Canny", dst);

        cvtColor(dst, cdst, COLOR_GRAY2BGR);
        imshow("FG Mask MOG 2", fgMaskMOG2);

        #if 0
        vector<Vec2f> lines;
            HoughLines(dst, lines, 1, CV_PI/180, 100, 0, 0 );

            for( size_t i = 0; i < lines.size(); i++ )
            {
                float rho = lines[i][0], theta = lines[i][1];
                Point pt1, pt2;
                double a = cos(theta), b = sin(theta);
                double x0 = a*rho, y0 = b*rho;
                pt1.x = cvRound(x0 + 1000*(-b));
                pt1.y = cvRound(y0 + 1000*(a));
                pt2.x = cvRound(x0 - 1000*(-b));
                pt2.y = cvRound(y0 - 1000*(a));
                line( fgMaskMOG2, pt1, pt2, Scalar(0,0,255), 3, CV_AA);
            }
        #else
            vector<Vec4i> lines;
            HoughLinesP(dst, lines, 1, CV_PI/180, 25, 25, 5 );
            cout << lines.size() << endl;
            for( size_t i = 0; i < lines.size(); i++ )
            {
                Vec4i l = lines[i];
                line( frame, Point(l[0], l[1]), Point(l[2], l[3]), Scalar(0,0,255), 3, LINE_AA);
            }
        #endif
            imshow("source", frame);
            imshow("detected lines", frame);

        keyboard = waitKey(30);
        }
}


text:
<div class="banner" style="background-image:url(<?=base_url()?>/plantillas/images/slider/traumatologos.png);">

                La Empresa CDS Traumatólogos Asociados, se fundó el 14 de Febrero de 1980, con la participación de tres socios médicos traumatólogos: José Castillo Ramírez, Darío Delgado Álvarez y Antonio Silva Castellano, socios de gran prestigio, con 70 años de edad en promedio y 35 años en la especialidad, siendo el objeto de la sociedad, la actividad profesional en el ramo de la medicina, en la especialización de Traumatología, pudiendo dedicarse también a otras actividades paramédicas; así como cualquier otro servicio médico complementario.

                Con el transcurso del tiempo se incorporaron médicos asociados a CDS para cubrir la demanda creciente. La empresa originalmente funcionó en el décimo piso de la torre de consultorios de la CRP; luego adquiere una propiedad ubicada detrás de la CRP. Los servicios de hospitalización, cirugía, emergencia y servicios auxiliares son suministrados por la CRP. El Instituto de Ortopedia y Traumatología – Clínica Ricardo Palma, es fundado el 16 de Mayo del 2006, como una evolución necesaria de la fusión de los Servicios de Ortopedia y Traumatología de los tres mencionados doctores.

            <img src="<?=base_url()?>/plantillas/images/instituto/antiguo.png" alt="" />

            <img src="<?=base_url()?>/plantillas/images/instituto/nuevo.png" alt="" />

                El Instituto de Ortopedia y Traumatología – Clínica Ricardo Palma no solo brinda atención médica especializada, tiene también una importante preocupación por la Educación Médica Continua, tanto de sus profesionales médicos y personal asistencial, así como del país en su conjunto, por lo que está en permanente búsqueda de alianzas estratégicas para llevar adelante este programa.


text:
package com.iluwatar.doubledispatch;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;

import org.junit.jupiter.api.Test;

/**
 * Date: 12/10/15 - 11:31 PM
 *
 * @author Jeroen Meulemeester
 */
public class MeteoroidTest extends CollisionTest<Meteoroid> {

  @Override
  final Meteoroid getTestedObject() {
    return new Meteoroid(1, 2, 3, 4);
  }

  /**
   * Test the constructor parameters
   */
  @Test
  public void testConstructor() {
    final var meteoroid = new Meteoroid(1, 2, 3, 4);
    assertEquals(1, meteoroid.getLeft());
    assertEquals(2, meteoroid.getTop());
    assertEquals(3, meteoroid.getRight());
    assertEquals(4, meteoroid.getBottom());
    assertFalse(meteoroid.isOnFire());
    assertFalse(meteoroid.isDamaged());
    assertEquals("Meteoroid at [1,2,3,4] damaged=false onFire=false", meteoroid.toString());
  }

  /**
   * Test what happens we collide with an asteroid
   */
  @Test
  public void testCollideFlamingAsteroid() {
    testCollision(
        new FlamingAsteroid(1, 1, 3, 4),
        false, true,
        false, false
    );
  }

  /**
   * Test what happens we collide with an meteoroid
   */
  @Test
  public void testCollideMeteoroid() {
    testCollision(
        new Meteoroid(1, 1, 3, 4),
        false, false,
        false, false
    );
  }

  /**
   * Test what happens we collide with ISS
   */
  @Test
  public void testCollideSpaceStationIss() {
    testCollision(
        new SpaceStationIss(1, 1, 3, 4),
        true, false,
        false, false
    );
  }

  /**
   * Test what happens we collide with MIR
   */
  @Test
  public void testCollideSpaceStationMir() {
    testCollision(
        new SpaceStationMir(1, 1, 3, 4),
        true, false,
        false, false
    );
  }

}


text:
using System;

internal class ShopOrderResponse : BasicResponse
{
    public int gold = 0;
    public string httpStr = null;
    public string notifyUrl = null;
    public string orderId = null;
    public int totalFee = 0;
}


text:
<link type="text/css" rel="stylesheet" href="styles.css" />
<form class="login_form" method="post" action="main.php">

Username: <input type="text" name="username" />

Password: <input type="password" name="password" />

<input type="submit" value="Login" name="Login" />

</form>


text:
layout: base
title:  'Statistics of Emphatic in UD_Polish-LFG'
udver: '2'
---

## Treebank Statistics: UD_Polish-LFG: Features: `Emphatic`

This feature is language-specific.
It occurs with 1 different values: `Yes`.

33 tokens (0%) have a non-empty value of `Emphatic`.
15 types (0%) occur at least once with a non-empty value of `Emphatic`.
9 lemmas (0%) occur at least once with a non-empty value of `Emphatic`.
The feature is used with 4 part-of-speech tags: <tt>PRON</tt> (19; 0% instances), <tt>ADV</tt> (8; 0% instances), <tt>DET</tt> (4; 0% instances), <tt>PART</tt> (2; 0% instances).

### `PRON`

19 <tt>PRON</tt> tokens (0% of all `PRON` tokens) have a non-empty value of `Emphatic`.

The most frequent other feature values with which `PRON` and `Emphatic` co-occurred: <tt>Number</tt><tt>=Sing</tt> (19; 100%), <tt>Person</tt><tt>=EMPTY</tt> (19; 100%), <tt>PrepCase</tt><tt>=EMPTY</tt> (19; 100%), <tt>PronType</tt><tt>=Int</tt> (19; 100%), <tt>Reflex</tt><tt>=EMPTY</tt> (19; 100%), <tt>Variant</tt><tt>=EMPTY</tt> (19; 100%), <tt>Gender</tt><tt>=Neut</tt> (13; 68%), <tt>SubGender</tt><tt>=EMPTY</tt> (13; 68%), <tt>Case</tt><tt>=Acc</tt> (10; 53%).

`PRON` tokens may have the following values of `Emphatic`:

* `Yes` (19; 100% of non-empty `Emphatic`): cóż, któż, Kimże, Kogóż, czymże, kogoż

### `ADV`

8 <tt>ADV</tt> tokens (0% of all `ADV` tokens) have a non-empty value of `Emphatic`.

The most frequent other feature values with which `ADV` and `Emphatic` co-occurred: <tt>Degree</tt><tt>=EMPTY</tt> (8; 100%), <tt>PronType</tt><tt>=Int</tt> (8; 100%).

`ADV` tokens may have the following values of `Emphatic`:

* `Yes` (8; 100% of non-empty `Emphatic`): Jakże, Gdzież

### `DET`

4 <tt>DET</tt> tokens (0% of all `DET` tokens) have a non-empty value of `Emphatic`.

The most frequent other feature values with which `DET` and `Emphatic` co-occurred: <tt>Number[psor]</tt><tt>=EMPTY</tt> (4; 100%), <tt>Person</tt><tt>=EMPTY</tt> (4; 100%), <tt>Poss</tt><tt>=EMPTY</tt> (4; 100%), <tt>PronType</tt><tt>=Int</tt> (3; 75%), <tt>SubGender</tt><tt>=EMPTY</tt> (3; 75%).

`DET` tokens may have the following values of `Emphatic`:

* `Yes` (4; 100% of non-empty `Emphatic`): Jakiż, ileż, iluż, takąż

### `PART`

2 <tt>PART</tt> tokens (0% of all `PART` tokens) have a non-empty value of `Emphatic`.

The most frequent other feature values with which `PART` and `Emphatic` co-occurred: <tt>Polarity</tt><tt>=EMPTY</tt> (2; 100%).

`PART` tokens may have the following values of `Emphatic`:

* `Yes` (2; 100% of non-empty `Emphatic`): Czyż


text:
from django.conf.urls import patterns
from django.conf.urls import url

from openstack_dashboard.dashboards.admin.aggregates.compute import views

urlpatterns = patterns(
    'openstack_dashboard.dashboards.admin.aggregates.compute.views',
    url(r'^(?P<compute_host>[^/]+)/evacuate_host$',
        views.EvacuateHostView.as_view(),
        name='evacuate_host'),
    url(r'^addhost$', views.AddComputeHost.as_view(), name='addhost')
)


text:
<?php

namespace Brasa\RecursoHumanoBundle\Repository;

use Doctrine\ORM\EntityRepository;

/**
 *
 * This class was generated by the Doctrine ORM. Add your own custom
 * repository methods below.
 */
class RhuIngresoBaseRepository extends EntityRepository {

    public function devuelveIbpFecha($codigoEmpleado, $fechaDesde, $fechaHasta, $codigoContrato) {
            $em = $this->getEntityManager();
            $dql   = "SELECT SUM(ib.vrIngresoBasePrestacion) as vrIngresoBasePrestacion FROM BrasaRecursoHumanoBundle:RhuIngresoBase ib "
                    . "WHERE ib.codigoEmpleadoFk = " . $codigoEmpleado . " "
                    . "AND ib.codigoContratoFk = " . $codigoContrato . " "
                    . "AND ib.fechaDesde >= '" . $fechaDesde . "' AND ib.fechaHasta <= '" . $fechaHasta . "'";
            $query = $em->createQuery($dql);
            $floIbp = $query->getSingleScalarResult();
            if(!$floIbp) {
                $floIbp = 0;
            }
            return $floIbp;
        }

    public function listaDqlCostosIbc($strContrato = "", $strIdentificacion = "", $strDesde = "", $strHasta = "") {
        $em = $this->getEntityManager();
        $dql   = "SELECT i, e FROM BrasaRecursoHumanoBundle:RhuIbc i JOIN i.empleadoRel e WHERE i.codigoIbcPk <> 0";
        if($strContrato != "") {
            $dql .= " AND i.codigoContratoFk = " . $strContrato;
        }
        if($strIdentificacion != "" ) {
            $dql .= " AND e.numeroIdentificacion = '" . $strIdentificacion . "'";
        }
        if ($strDesde != ""){
            $dql .= " AND i.fechaDesde >='" . date_format($strDesde, ('Y-m-d')). "'";
        }
        if($strHasta != "") {
            $dql .= " AND i.fechaHasta <='" . date_format($strHasta, ('Y-m-d')) . "'";
        }
        //$dql .= " ORDER BY p.empleadoRel.nombreCorto";
        return $dql;
    }

    public function listaDql($strContrato = "", $strIdentificacion = "", $strDesde = "", $strHasta = "") {
        $em = $this->getEntityManager();
        $dql   = "SELECT ib, e FROM BrasaRecursoHumanoBundle:RhuIngresoBase ib JOIN ib.empleadoRel e WHERE ib.codigoIngresoBasePk <> 0";
        if($strContrato != "") {
            $dql .= " AND ib.codigoContratoFk = " . $strContrato;
        }
        if($strIdentificacion != "" ) {
            $dql .= " AND e.numeroIdentificacion = '" . $strIdentificacion . "'";
        }
        if ($strDesde != ""){
            //$strDesde = new \DateTime($strDesde);
            $dql .= " AND ib.fechaDesde >='" . $strDesde . "'";
        }
        if($strHasta != "") {
            //$strHasta = new \DateTime($strHasta);
            $dql .= " AND ib.fechaHasta <='" .  $strHasta . "'";
        }
        //$dql .= " ORDER BY p.empleadoRel.nombreCorto";
        return $dql;
    }

}


text:
/**
 * tag mini generator
 */
'use strict';

const BaseClass = require('../../lib');
const join = require('path').join;

module.exports = class extends BaseClass {

  constructor(args, opts) {
    super(args, opts);
    this.ext = 'tag';
    // this._loadLangFile(this.config.get('lang'));

        // Get the tag name
    if (args[0]) {
      this.tagName = args[0];
      this.isStateless = opts.stateless !== undefined;
            // Get if there is a c / component flag
      this._checkComponent(opts);
    } else {
      throw this.langObj.ERR_MISSING_TAG_NAME;
    }
  }
  /**
   * Create the tag file
   */
  _writeTagFile() {
    const tagName = this._camelToDash(this.tagName);
    const fileName = [tagName, this.ext].join('.');

    const filePath = (this.componentDir) ? join(this.componentDir, fileName) : join(this.tagPath, tagName, fileName);
    const params = {
      tagName: tagName,
      isStateless: this.isStateless
    };
    this._copyTpl('tag.txt', filePath, params);
  }
  /**
   * Generate the test file based on the template
   */
  _writeTagTestFile() {
    const tagName = this._camelToDash(this.tagName);
    const fileName = [tagName, 'test', 'js'].join('.');
    const filePath = (this.componentTestDir) ? join(this.componentTestDir, 'tags', fileName) : join(this.testPath, 'tags', fileName);
    const params = {
      tagName: tagName,
      tagNameVar: this._toClassName(tagName),
      isStateless: this.isStateless,
      tagFilePath: filePath
    };
    this._copyTpl('tag-test.txt', filePath, params);
  }

  /**
   * Finally execute the write file
   */
  writing() {
    this._writeTagFile();
    this._writeTagTestFile();
      // @TODO search for the existing top level component by name
      // then inject the import statement into that file
  }

};


text:
"use strict";

function foo(a, b, c) {
  return b;
}

var desc = Object.getOwnPropertyDescriptor(foo, 'length');
assertEquals(3, desc.value);
assertFalse(desc.writable);
assertFalse(desc.enumerable);
assertFalse(desc.configurable);
assertThrows(function() { foo.length = 2; }, TypeError);


text:
import type { Config, Printer, Refs } from '../../types';
export declare const printProps: (keys: Array<string>, props: Record<string, unknown>, config: Config, indentation: string, depth: number, refs: Refs, printer: Printer) => string;
export declare const printChildren: (children: Array<unknown>, config: Config, indentation: string, depth: number, refs: Refs, printer: Printer) => string;
export declare const printText: (text: string, config: Config) => string;
export declare const printComment: (comment: string, config: Config) => string;
export declare const printElement: (type: string, printedProps: string, printedChildren: string, config: Config, indentation: string) => string;
export declare const printElementAsLeaf: (type: string, config: Config) => string;


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

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<title>DMA Friends: DMA\Friends\Classes\Notifications\IncomingMessage Class Reference</title>

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

<link href="../../search/search.css" rel="stylesheet" type="text/css"/>

<link href="../../doxygen.css" rel="stylesheet" type="text/css" />

DMA Friends
    2.0

Main Page

Related Pages

Namespaces

Classes

          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)"
               onblur="searchBox.OnSearchFieldFocus(false)"
               onkeyup="searchBox.OnSearchFieldChange(event)"/>

Class List

Class Index

Class Hierarchy

Class Members

DMA

Friends

Classes

Notifications

IncomingMessage

Public Member Functions |
Protected Attributes |
List of all members

DMA\Friends\Classes\Notifications\IncomingMessage Class Reference

Public Member Functions

 	__construct ($channelKey)

 	from ($user, $name='')

 	getFrom ()

 	setContent ($message)

 	getRawContent ()

 	getContent ()

 	setMatches (array $matches)

 	getMatches ()

 	addData (array $data)

 	getData ()

 	getChannelKey ()

Protected Attributes

 	$data = []

Detailed Description

Generic Incoming Messages

Author

Carlos Arroyo

Member Function Documentation

          DMA\Friends\Classes\Notifications\IncomingMessage::addData
          (
          array
          $data	)

Add extra data to the notification. This variables are accesable within the template.

Parameters

array	$data

  103                                         {

  104         $this->data = array_merge($this->data, $data);

  105     }

          DMA\Friends\Classes\Notifications\IncomingMessage::from
          (

          $user,

          $name = ''

          )

Set origin of the message

Parameters

mixed	$user

string	$name	Optional parameter to give a friendly name to the user

   24     {

   25         $this->data['fromUser'] = $user;

   26         $this->data['fromUserName'] = $name;

   27     }

          DMA\Friends\Classes\Notifications\IncomingMessage::getChannelKey
          (
          	)

Get channel key of the Channel which this message was recived

Returns

string $channelCode

  122     {

  123         return @$this->data['channelKey'];

  124     }

          DMA\Friends\Classes\Notifications\IncomingMessage::getContent
          (
          	)

Return a normalize content with no leading or tailing spaces and clean uniform whitespaces. Useful to do lookups in the database with the content of the message.

Returns

$string

   65     {

   66         $content = $this->getRawContent();

   67

   68         // Remove leading and ending white spaces

   69         $content = trim($content);

   70

   71         // Normalize white spaces

   72         $content = preg_replace('/[ ]{2,}/i', ' ', $content);

   73         return $content;

   74     }

DMA\Friends\Classes\Notifications\IncomingMessage\getRawContent

getRawContent()

Definition: IncomingMessage.php:52

          DMA\Friends\Classes\Notifications\IncomingMessage::getData
          (
          	)

array

  111     {

  112         return $this->data;

  113     }

          DMA\Friends\Classes\Notifications\IncomingMessage::getFrom
          (
          	)

Return origin of the message

Returns

mixed

   34     {

   35         return @$this->data['fromUser'];

   36     }

          DMA\Friends\Classes\Notifications\IncomingMessage::getMatches
          (
          	)

Return string matches in the content of the message. This is use manly for input with regex expressions.

Returns

array

   94     {

   95         return @$this->data['matches'];

   96     }

          DMA\Friends\Classes\Notifications\IncomingMessage::getRawContent
          (
          	)

Returns raw incomming message content

Returns

string

   53     {

   54         $content = @$this->data['content'];

   55         return (!is_null($content))?$content:'';

   56     }

          DMA\Friends\Classes\Notifications\IncomingMessage::setContent
          (

          $message	)

Set content of the message

Parameters

string	message

   43     {

   44         $this->data['content'] = $message;

   45     }

          DMA\Friends\Classes\Notifications\IncomingMessage::setMatches
          (
          array
          $matches	)

Add array of match string found in the content. This is use manly por input regex expressions

Parameters

array	$matches

   83     {

   84         $this->data['matches'] = $matches;

   85     }

The documentation for this class was generated from the following file:

classes/notifications/IncomingMessage.php

<address class="footer">
Generated on Tue Aug 11 2015 18:30:26 for DMA Friends by

 1.8.9.1
</address>


text:
<?xml version="1.0"?>
<!--

-->
<include xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_include.xsd">
    <group id="adyen_advanced_settings" translate="label" type="text" sortOrder="120" showInDefault="1"
           showInWebsite="1"
           showInStore="1">
        <label><![CDATA[Advanced settings]]></label>
        <frontend_model>Magento\Config\Block\System\Config\Form\Fieldset</frontend_model>
        <include path="Adyen_Payment::system/adyen_order_processing.xml"/>
        <include path="Adyen_Payment::system/adyen_checkout_experience.xml"/>
        <include path="Adyen_Payment::system/adyen_manual_review.xml"/>
        <include path="Adyen_Payment::system/adyen_refunds.xml"/>
        <include path="Adyen_Payment::system/adyen_pwa.xml"/>
        <include path="Adyen_Payment::system/adyen_additional_payment_settings.xml"/>
        <include path="Adyen_Payment::system/adyen_security.xml"/>
    </group>
</include>


text:
SYNONYM

#### According to
Index Fungorum

#### Published in
Annls mycol. 20(3/4): 124 (1922)

#### Original name
Haplotelium Syd.

### Remarks
null