text:
import * as ts from "../../_namespaces/ts";
import {
    appendText,
    compilerOptionsToConfigJson,
    loadProjectFromFiles,
    noChangeRun,
    noChangeWithExportsDiscrepancyRun,
    replaceText,
    TestTscEdit,
    verifyTscWithEdits,
} from "../tsc/helpers";

describe("unittests:: tsbuild:: commandLine::", () => {
    describe("different options::", () => {
        function withOptionChange(subScenario: string, ...options: readonly string[]): TestTscEdit {
            return {
                subScenario,
                modifyFs: ts.noop,
                commandLineArgs: ["--b", "/src/project", "--verbose", ...options]
            };
        }
        function noChangeWithSubscenario(subScenario: string): TestTscEdit {
            return { ...noChangeRun, subScenario };
        }
        function withOptionChangeAndDiscrepancyExplanation(subScenario: string, option: string): TestTscEdit {
            return {
                ...withOptionChange(subScenario, option),
                discrepancyExplanation: () => [
                    `Clean build tsbuildinfo will have compilerOptions with composite and ${option.replace(/\-/g, "")}`,
                    `Incremental build will detect that it doesnt need to rebuild so tsbuild info is from before which has option composite only`,
                ]
            };
        }
        function withEmitDeclarationOnlyChangeAndDiscrepancyExplanation(subScenario: string): TestTscEdit {
            const edit = withOptionChangeAndDiscrepancyExplanation(subScenario, "--emitDeclarationOnly");
            const discrepancyExplanation = edit.discrepancyExplanation!;
            edit.discrepancyExplanation = () => [
                ...discrepancyExplanation(),
                `Clean build info does not have js section because its fresh build`,
                `Incremental build info has js section from old build`
            ];
            return edit;
        }
        function withOptionChangeAndExportExplanation(subScenario: string, ...options: readonly string[]): TestTscEdit {
            return {
                ...withOptionChange(subScenario, ...options),
                discrepancyExplanation: noChangeWithExportsDiscrepancyRun.discrepancyExplanation,
            };
        }
        function nochangeWithIncrementalDeclarationFromBeforeExplaination(): TestTscEdit {
            return {
                ...noChangeRun,
                discrepancyExplanation: () => [
                    `Clean build tsbuildinfo will have compilerOptions {}`,
                    `Incremental build will detect that it doesnt need to rebuild so tsbuild info is from before which has option declaration and declarationMap`,
                ],
            };
        }
        function nochangeWithIncrementalOutDeclarationFromBeforeExplaination(): TestTscEdit {
            const edit = nochangeWithIncrementalDeclarationFromBeforeExplaination();
            const discrepancyExplanation = edit.discrepancyExplanation!;
            edit.discrepancyExplanation = () => [
                ...discrepancyExplanation(),
                `Clean build does not have dts bundle section`,
                `Incremental build contains the dts build section from before`,
            ];
            return edit;
        }
        function localChange(): TestTscEdit {
            return {
                subScenario: "local change",
                modifyFs: fs => replaceText(fs, "/src/project/a.ts", "Local = 1", "Local = 10"),
            };
        }
        function fs(options: ts.CompilerOptions) {
            return loadProjectFromFiles({
                "/src/project/tsconfig.json": JSON.stringify({ compilerOptions: compilerOptionsToConfigJson(options) }),
                "/src/project/a.ts": `export const a = 10;const aLocal = 10;`,
                "/src/project/b.ts": `export const b = 10;const bLocal = 10;`,
                "/src/project/c.ts": `import { a } from "./a";export const c = a;`,
                "/src/project/d.ts": `import { b } from "./b";export const d = b;`,
            });
        }
        verifyTscWithEdits({
            scenario: "commandLine",
            subScenario: "different options",
            fs: () => fs({ composite: true }),
            commandLineArgs: ["--b", "/src/project", "--verbose"],
            edits: [
                withOptionChange("with sourceMap", "--sourceMap"),
                noChangeWithSubscenario("should re-emit only js so they dont contain sourcemap"),
                withOptionChangeAndDiscrepancyExplanation("with declaration should not emit anything", "--declaration"),
                noChangeRun,
                withOptionChange("with declaration and declarationMap", "--declaration", "--declarationMap"),
                noChangeWithSubscenario("should re-emit only dts so they dont contain sourcemap"),
                withOptionChangeAndDiscrepancyExplanation("with emitDeclarationOnly should not emit anything", "--emitDeclarationOnly"),
                noChangeRun,
                localChange(),
                withOptionChangeAndDiscrepancyExplanation("with declaration should not emit anything", "--declaration"),
                withOptionChange("with inlineSourceMap", "--inlineSourceMap"),
                withOptionChange("with sourceMap", "--sourceMap"),
            ],
            baselinePrograms: true,
        });
        verifyTscWithEdits({
            scenario: "commandLine",
            subScenario: "different options with outFile",
            fs: () => fs({ composite: true, outFile: "../outFile.js", module: ts.ModuleKind.AMD }),
            commandLineArgs: ["--b", "/src/project", "--verbose"],
            edits: [
                withOptionChange("with sourceMap", "--sourceMap"),
                noChangeWithSubscenario("should re-emit only js so they dont contain sourcemap"),
                withOptionChangeAndDiscrepancyExplanation("with declaration should not emit anything", "--declaration"),
                noChangeRun,
                withOptionChange("with declaration and declarationMap", "--declaration", "--declarationMap"),
                noChangeWithSubscenario("should re-emit only dts so they dont contain sourcemap"),
                withEmitDeclarationOnlyChangeAndDiscrepancyExplanation("with emitDeclarationOnly should not emit anything"),
                noChangeRun,
                localChange(),
                withOptionChangeAndDiscrepancyExplanation("with declaration should not emit anything", "--declaration"),
                withOptionChange("with inlineSourceMap", "--inlineSourceMap"),
                withOptionChange("with sourceMap", "--sourceMap"),
            ],
            baselinePrograms: true,
        });
        verifyTscWithEdits({
            scenario: "commandLine",
            subScenario: "different options with incremental",
            fs: () => fs({ incremental: true }),
            commandLineArgs: ["--b", "/src/project", "--verbose"],
            edits: [
                withOptionChangeAndExportExplanation("with sourceMap", "--sourceMap"),
                withOptionChangeAndExportExplanation("should re-emit only js so they dont contain sourcemap"),
                withOptionChange("with declaration, emit Dts and should not emit js", "--declaration"),
                withOptionChange("with declaration and declarationMap", "--declaration", "--declarationMap"),
                nochangeWithIncrementalDeclarationFromBeforeExplaination(),
                localChange(),
                withOptionChange("with declaration and declarationMap", "--declaration", "--declarationMap"),
                nochangeWithIncrementalDeclarationFromBeforeExplaination(),
                withOptionChange("with inlineSourceMap", "--inlineSourceMap"),
                withOptionChange("with sourceMap", "--sourceMap"),
                noChangeWithSubscenario("emit js files"),
                withOptionChange("with declaration and declarationMap", "--declaration", "--declarationMap"),
                withOptionChange("with declaration and declarationMap, should not re-emit", "--declaration", "--declarationMap"),
            ],
            baselinePrograms: true,
        });
        verifyTscWithEdits({
            scenario: "commandLine",
            subScenario: "different options with incremental with outFile",
            fs: () => fs({ incremental: true, outFile: "../outFile.js", module: ts.ModuleKind.AMD }),
            commandLineArgs: ["--b", "/src/project", "--verbose"],
            edits: [
                withOptionChange("with sourceMap", "--sourceMap"),
                noChangeWithSubscenario("should re-emit only js so they dont contain sourcemap"),
                withOptionChange("with declaration, emit Dts and should not emit js", "--declaration"),
                withOptionChange("with declaration and declarationMap", "--declaration", "--declarationMap"),
                nochangeWithIncrementalOutDeclarationFromBeforeExplaination(),
                localChange(),
                withOptionChange("with declaration and declarationMap", "--declaration", "--declarationMap"),
                nochangeWithIncrementalOutDeclarationFromBeforeExplaination(),
                withOptionChange("with inlineSourceMap", "--inlineSourceMap"),
                withOptionChange("with sourceMap", "--sourceMap"),
                noChangeWithSubscenario("emit js files"),
                withOptionChange("with declaration and declarationMap", "--declaration", "--declarationMap"),
                withOptionChange("with declaration and declarationMap, should not re-emit", "--declaration", "--declarationMap"),
            ],
            baselinePrograms: true,
        });
    });
    describe("emitDeclarationOnly::", () => {
        function fs(options: ts.CompilerOptions) {
            return loadProjectFromFiles({
                "/src/project1/src/tsconfig.json": JSON.stringify({
                    compilerOptions: compilerOptionsToConfigJson(options),
                }),
                "/src/project1/src/a.ts": `export const a = 10;const aLocal = 10;`,
                "/src/project1/src/b.ts": `export const b = 10;const bLocal = 10;`,
                "/src/project1/src/c.ts": `import { a } from "./a";export const c = a;`,
                "/src/project1/src/d.ts": `import { b } from "./b";export const d = b;`,
                "/src/project2/src/tsconfig.json": JSON.stringify({
                    compilerOptions: compilerOptionsToConfigJson(options),
                    references: [{ path: "../../project1/src" }],
                }),
                "/src/project2/src/e.ts": `export const e = 10;`,
                "/src/project2/src/f.ts": `import { a } from "${options.outFile ? "a" : "../../project1/src/a"}"; export const f = a;`,
                "/src/project2/src/g.ts": `import { b } from "${options.outFile ? "b" : "../../project1/src/b"}"; export const g = b;`,
            });
        }
        function verifyWithIncremental(options: ts.CompilerOptions) {
            verifyTscWithEdits({
                scenario: "commandLine",
                subScenario: subScenario("emitDeclarationOnly on commandline"),
                fs: () => fs(options),
                commandLineArgs: ["--b", "/src/project2/src", "--verbose", "--emitDeclarationOnly"],
                edits: [
                    noChangeRun,
                    {
                        subScenario: "local change",
                        modifyFs: fs => appendText(fs, "/src/project1/src/a.ts", "const aa = 10;"),
                    },
                    {
                        subScenario: "non local change",
                        modifyFs: fs => appendText(fs, "/src/project1/src/a.ts", "export const aaa = 10;"),
                    },
                    {
                        subScenario: "emit js files",
                        modifyFs: ts.noop,
                        commandLineArgs: ["--b", "/src/project2/src", "--verbose"],
                    },
                    {
                        ...noChangeRun,
                        discrepancyExplanation: () => [
                            `Clean build tsbuildinfo for both projects will have compilerOptions with composite and emitDeclarationOnly`,
                            `Incremental build will detect that it doesnt need to rebuild so tsbuild info for projects is from before which has option composite only`,
                        ]
                    },
                    {
                        subScenario: "js emit with change without emitDeclarationOnly",
                        modifyFs: fs => appendText(fs, "/src/project1/src/b.ts", "const alocal = 10;"),
                        commandLineArgs: ["--b", "/src/project2/src", "--verbose"],
                    },
                    {
                        subScenario: "local change",
                        modifyFs: fs => appendText(fs, "/src/project1/src/b.ts", "const aaaa = 10;"),
                        // --out without composite doesnt emit buildInfo without emitting program so it wouldnt have project2 tsbuildInfo so no mismatch
                        discrepancyExplanation: options.incremental && options.outFile ? undefined : () => [
                            `Clean build tsbuildinfo for project2 will have compilerOptions with composite and emitDeclarationOnly`,
                            `Incremental build will detect that it doesnt need to rebuild project2 so tsbuildinfo for it is from before which has option composite only`,
                        ],
                    },
                    {
                        subScenario: "non local change",
                        modifyFs: fs => appendText(fs, "/src/project1/src/b.ts", "export const aaaaa = 10;"),
                    },
                    {
                        subScenario: "js emit with change without emitDeclarationOnly",
                        modifyFs: fs => appendText(fs, "/src/project1/src/b.ts", "export const a2 = 10;"),
                        commandLineArgs: ["--b", "/src/project2/src", "--verbose"],
                    },
                ],
                baselinePrograms: true,
            });
            verifyTscWithEdits({
                scenario: "commandLine",
                subScenario: subScenario("emitDeclarationOnly false on commandline"),
                fs: () => fs({ ...options, emitDeclarationOnly: true }),
                commandLineArgs: ["--b", "/src/project2/src", "--verbose"],
                edits: [
                    noChangeRun,
                    {
                        subScenario: "change",
                        modifyFs: fs => appendText(fs, "/src/project1/src/a.ts", "const aa = 10;"),
                    },
                    {
                        subScenario: "emit js files",
                        modifyFs: ts.noop,
                        commandLineArgs: ["--b", "/src/project2/src", "--verbose", "--emitDeclarationOnly", "false"],
                    },
                    {
                        ...noChangeRun,
                        discrepancyExplanation: () => [
                            `Clean build tsbuildinfo for both projects will have compilerOptions with composite and emitDeclarationOnly`,
                            `Incremental build will detect that it doesnt need to rebuild so tsbuild info for projects is from before which has option composite as true but emitDeclrationOnly as false`,
                        ]
                    },
                    {
                        subScenario: "no change run with js emit",
                        modifyFs: ts.noop,
                        commandLineArgs: ["--b", "/src/project2/src", "--verbose", "--emitDeclarationOnly", "false"],
                    },
                    {
                        subScenario: "js emit with change",
                        modifyFs: fs => appendText(fs, "/src/project1/src/b.ts", "const blocal = 10;"),
                        commandLineArgs: ["--b", "/src/project2/src", "--verbose", "--emitDeclarationOnly", "false"],
                    },
                ],
                baselinePrograms: true,
            });
            function subScenario(text: string) {
                return `${text}${options.composite ? "" : " with declaration and incremental"}${options.outFile ? " with outFile" : ""}`;
            }
        }
        verifyWithIncremental({ composite: true });
        verifyWithIncremental({ incremental: true, declaration: true });
        verifyWithIncremental({ composite: true, outFile: "../outFile.js", module: ts.ModuleKind.AMD });
        verifyWithIncremental({ incremental: true, declaration: true, outFile: "../outFile.js", module: ts.ModuleKind.AMD });

        verifyTscWithEdits({
            scenario: "commandLine",
            subScenario: "emitDeclarationOnly on commandline with declaration",
            fs: () => fs({ declaration: true }),
            commandLineArgs: ["--b", "/src/project2/src", "--verbose", "--emitDeclarationOnly"],
            edits: [
                noChangeRun,
                {
                    subScenario: "local change",
                    modifyFs: fs => appendText(fs, "/src/project1/src/a.ts", "const aa = 10;"),
                },
                {
                    subScenario: "non local change",
                    modifyFs: fs => appendText(fs, "/src/project1/src/a.ts", "export const aaa = 10;"),
                },
                {
                    subScenario: "emit js files",
                    modifyFs: ts.noop,
                    commandLineArgs: ["--b", "/src/project2/src", "--verbose"],
                },
                noChangeRun,
                {
                    subScenario: "js emit with change without emitDeclarationOnly",
                    modifyFs: fs => appendText(fs, "/src/project1/src/b.ts", "const alocal = 10;"),
                    commandLineArgs: ["--b", "/src/project2/src", "--verbose"],
                },
                {
                    subScenario: "local change",
                    modifyFs: fs => appendText(fs, "/src/project1/src/b.ts", "const aaaa = 10;"),
                },
                {
                    subScenario: "non local change",
                    modifyFs: fs => appendText(fs, "/src/project1/src/b.ts", "export const aaaaa = 10;"),
                },
                {
                    subScenario: "js emit with change without emitDeclarationOnly",
                    modifyFs: fs => appendText(fs, "/src/project1/src/b.ts", "export const a2 = 10;"),
                    commandLineArgs: ["--b", "/src/project2/src", "--verbose"],
                },
            ],
            baselinePrograms: true,
        });

        verifyTscWithEdits({
            scenario: "commandLine",
            subScenario: "emitDeclarationOnly false on commandline with declaration",
            fs: () => fs({ declaration: true, emitDeclarationOnly: true }),
            commandLineArgs: ["--b", "/src/project2/src", "--verbose"],
            edits: [
                noChangeRun,
                {
                    subScenario: "change",
                    modifyFs: fs => appendText(fs, "/src/project1/src/a.ts", "const aa = 10;"),
                },
                {
                    subScenario: "emit js files",
                    modifyFs: ts.noop,
                    commandLineArgs: ["--b", "/src/project2/src", "--verbose", "--emitDeclarationOnly", "false"],
                },
                noChangeRun,
                {
                    subScenario: "no change run with js emit",
                    modifyFs: ts.noop,
                    commandLineArgs: ["--b", "/src/project2/src", "--verbose", "--emitDeclarationOnly", "false"],
                },
                {
                    subScenario: "js emit with change",
                    modifyFs: fs => appendText(fs, "/src/project1/src/b.ts", "const blocal = 10;"),
                    commandLineArgs: ["--b", "/src/project2/src", "--verbose", "--emitDeclarationOnly", "false"],
                },
            ],
            baselinePrograms: true,
        });

        verifyTscWithEdits({
            scenario: "commandLine",
            subScenario: "emitDeclarationOnly on commandline with declaration with outFile",
            fs: () => fs({ declaration: true, outFile: "../outFile.js", module: ts.ModuleKind.AMD }),
            commandLineArgs: ["--b", "/src/project2/src", "--verbose", "--emitDeclarationOnly"],
            edits: [
                noChangeRun,
                {
                    subScenario: "local change",
                    modifyFs: fs => appendText(fs, "/src/project1/src/a.ts", "const aa = 10;"),
                },
                {
                    subScenario: "non local change",
                    modifyFs: fs => appendText(fs, "/src/project1/src/a.ts", "export const aaa = 10;"),
                },
                {
                    subScenario: "emit js files",
                    modifyFs: ts.noop,
                    commandLineArgs: ["--b", "/src/project2/src", "--verbose"],
                },
                noChangeRun,
                {
                    subScenario: "js emit with change without emitDeclarationOnly",
                    modifyFs: fs => appendText(fs, "/src/project1/src/b.ts", "const alocal = 10;"),
                    commandLineArgs: ["--b", "/src/project2/src", "--verbose"],
                },
                {
                    subScenario: "local change",
                    modifyFs: fs => appendText(fs, "/src/project1/src/b.ts", "const aaaa = 10;"),
                },
                {
                    subScenario: "non local change",
                    modifyFs: fs => appendText(fs, "/src/project1/src/b.ts", "export const aaaaa = 10;"),
                },
                {
                    subScenario: "js emit with change without emitDeclarationOnly",
                    modifyFs: fs => appendText(fs, "/src/project1/src/b.ts", "export const a2 = 10;"),
                    commandLineArgs: ["--b", "/src/project2/src", "--verbose"],
                },
            ],
            baselinePrograms: true,
        });

        verifyTscWithEdits({
            scenario: "commandLine",
            subScenario: "emitDeclarationOnly false on commandline with declaration with outFile",
            fs: () => fs({ declaration: true, emitDeclarationOnly: true, outFile: "../outFile.js", module: ts.ModuleKind.AMD }),
            commandLineArgs: ["--b", "/src/project2/src", "--verbose"],
            edits: [
                noChangeRun,
                {
                    subScenario: "change",
                    modifyFs: fs => appendText(fs, "/src/project1/src/a.ts", "const aa = 10;"),
                },
                {
                    subScenario: "emit js files",
                    modifyFs: ts.noop,
                    commandLineArgs: ["--b", "/src/project2/src", "--verbose", "--emitDeclarationOnly", "false"],
                },
                noChangeRun,
                {
                    subScenario: "no change run with js emit",
                    modifyFs: ts.noop,
                    commandLineArgs: ["--b", "/src/project2/src", "--verbose", "--emitDeclarationOnly", "false"],
                },
                {
                    subScenario: "js emit with change",
                    modifyFs: fs => appendText(fs, "/src/project1/src/b.ts", "const blocal = 10;"),
                    commandLineArgs: ["--b", "/src/project2/src", "--verbose", "--emitDeclarationOnly", "false"],
                },
            ],
            baselinePrograms: true,
        });
    });
});


text:
<?php

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

class Login_model extends CI_Model {

    public function __construct() {
        parent::__construct();
    }

    /* Esta funcion ses utilizada para validad
      la existencia del usuario introducido en el login
      y es usada desde JS ajax */

    public function verifyUsername($username) {
        $this->db->where('username', $username);
        $consulta = $this->db->get('user');
        if ($consulta->num_rows() == 0):
            return 0;
        else:
            return 1;
        endif;
    }

    /* Retorna cero o uno dependiendo si existe el usuario y clave son correctas */

    function validateUserModel($user_name, $password) {
        $this->db->where('username', $user_name);
        $this->db->where('password', $password);
        $this->db->where('mca_inh', 'N');

        $query = $this->db->get('user');
        if ($query->num_rows() == 0) :
            //usuario no existe
            return 0;
        else :
            //Usuario y contraseña correcta
            return 1;
        endif;
    }

}

redpajama_set_name: RedPajamaGithub


text:
layout: post
title: docker links
permalink: :year/:month/:day
---

# docker-compose can link containers

Docker is a virtualization tool that abstracts the underlying hardware and operating system while also being amazing fast at the same time. Who says free lunch doesn't exist. It does exist, it comes along from the ingenuity and hard work of some smart men.

docker-compose is a tool to orchestrate many containers working together. So, if you wish to centralize your logs using the ELK stack say, you might go for one container per app. Then, docker-compose can be used to link them together.

Example docker-compose.yml for the ELK stack:

```python
elasticsearch:
  image: elasticsearch:latest
  command: elasticsearch -Des.network.host=0.0.0.0
  ports:
    - "9200:9200"
    - "9300:9300"

logstash:
  build: logstash/
  command: logstash -f /etc/logstash/conf.d/logstash.conf
  volumes:
    - ./logstash/config:/etc/logstash/conf.d
  ports:
    - "5000:5000"
  links:
    - elasticsearch
kibana:
  build: kibana/
  volumes:
    - ./kibana/config/:/opt/kibana/config/
  ports:
    - "5601:5601"
  links:
    - elasticsearch
```

Here, see how kibana is linked to elasticsearch. this is because kibana needs to connect to elasticsearch to query it's data  and not the other way round.
Similarly for logstash; it needs to connect to elasticsearch to send it data.


text:
#include "editorViewMVIface.h"

#include <qrkernel/definitions.h>

#include "editor/editorView.h"
#include "editor/editorViewScene.h"
#include "editor/element.h"
#include "plugins/pluginManager/editorManagerInterface.h"

using namespace qReal;

EditorViewMViface::EditorViewMViface(EditorView *view, EditorViewScene *scene)
	: QAbstractItemView(0)
	, mScene(scene)
	, mView(view)
	, mGraphicalAssistApi(nullptr)
	, mLogicalAssistApi(nullptr)
	, mExploser(nullptr)
{
	connect(this, &EditorViewMViface::rootElementRemoved, mView, &EditorView::rootElementRemoved);
}

EditorViewMViface::~EditorViewMViface()
{
	clearItems();
}

QRect EditorViewMViface::visualRect(const QModelIndex &) const
{
	return QRect();
}

void EditorViewMViface::scrollTo(const QModelIndex &, ScrollHint)
{
}

QModelIndex EditorViewMViface::indexAt(const QPoint &) const
{
	return QModelIndex();
}

bool EditorViewMViface::isDescendentOf(const QModelIndex &descendent, const QModelIndex &ancestor)
{
	QModelIndex prev;
	QModelIndex curr = descendent;
	do {
		if (curr.parent() == ancestor) {
			return true;
		}
		prev = curr;
		curr = curr.parent();
	} while (curr != prev);
	return false;
}

QModelIndex EditorViewMViface::moveCursor(QAbstractItemView::CursorAction
		, Qt::KeyboardModifiers)
{
	return QModelIndex();
}

int EditorViewMViface::horizontalOffset() const
{
	return 0;
}

int EditorViewMViface::verticalOffset() const
{
	return 0;
}

bool EditorViewMViface::isIndexHidden(const QModelIndex &) const
{
	return false;
}

void EditorViewMViface::setSelection(const QRect&, QItemSelectionModel::SelectionFlags )
{
}

QRegion EditorViewMViface::visualRegionForSelection(const QItemSelection &) const
{
	return QRegion();
}

void EditorViewMViface::reset()
{
	mScene->clearScene();
	clearItems();

	if (model() && model()->rowCount(QModelIndex()) == 0) {
		mScene->setEnabled(false);
	}

	// Our diagram would be nicer
	QGraphicsRectItem *rect = mScene->addRect(QRect(-1000, -1000, 2000, 2000));
	mScene->removeItem(rect);
	delete rect;

	if (model()) {
		if (rootIndex().isValid()) {
			rowsInserted(rootIndex(), 0, model()->rowCount(rootIndex()) - 1);
		} else {
			mScene->setEnabled(true);
		}
	}
}

void EditorViewMViface::setRootIndex(const QModelIndex &index)
{
	if (index == rootIndex()) {
		return;
	}
	QAbstractItemView::setRootIndex(index);
	reset();
}

Id EditorViewMViface::rootId() const
{
	return mGraphicalAssistApi ? mGraphicalAssistApi->idByIndex(rootIndex()) : Id();
}

void EditorViewMViface::rowsInserted(const QModelIndex &parent, int start, int end)
{
	for (int row = start; row <= end; ++row) {
		mScene->setEnabled(true);

		QPersistentModelIndex current = model()->index(row, 0, parent);
		if (!isDescendentOf(current, rootIndex())) {
			continue;
		}
		Id currentId = current.data(roles::idRole).value<Id>();
		if (currentId == Id::rootId()) {
			continue;
		}
		Id parentUuid;
		if (parent != rootIndex()) {
			parentUuid = parent.data(roles::idRole).value<Id>();
		}
		if (!parent.isValid()) {
			setRootIndex(current);
			continue;
		}

		ElementImpl * const elementImpl = mLogicalAssistApi->editorManagerInterface().elementImpl(currentId);
		Element *elem = elementImpl->isNode()
				? dynamic_cast<Element *>(
						new NodeElement(elementImpl, currentId, *mGraphicalAssistApi, *mLogicalAssistApi, *mExploser)
						)
				: dynamic_cast<Element *>(
						new EdgeElement(elementImpl, currentId, *mGraphicalAssistApi, *mLogicalAssistApi)
						);

		elem->setController(&mScene->controller());

		QPointF ePos = model()->data(current, roles::positionRole).toPointF();
		bool needToProcessChildren = true;

		// TODO: It is impossible for elem to be nullptr here.
		if (elem) {
			// setting position before parent definition 'itemChange' to work correctly
			elem->setPos(ePos);

			NodeElement *node = dynamic_cast<NodeElement *>(elem);
			if (node) {
				node->setGeometry(mGraphicalAssistApi->configuration(elem->id()).boundingRect());
			}

			if (item(parent)) {
				elem->setParentItem(item(parent));
				QModelIndex next = current.sibling(current.row() + 1, 0);
				if(next.isValid() && item(next) != nullptr) {
					elem->stackBefore(item(next));
				}
			} else {
				mScene->addItem(elem);
			}

			setItem(current, elem);
			elem->updateData();
			elem->connectToPort();
			elem->checkConnectionsToPort();
			elem->initPossibleEdges();
			elem->initTitles();
			mView->setFocus();
			// TODO: brush up init~()

			bool isEdgeFromEmbeddedLinker = false;
			QList<QGraphicsItem*> selectedItems = mScene->selectedItems();
			if (selectedItems.size() == 1) {
				NodeElement* master = dynamic_cast<NodeElement*>(selectedItems.at(0));
				if (master && master->connectionInProgress()) {
					isEdgeFromEmbeddedLinker = true;
				}
			}

			if (!isEdgeFromEmbeddedLinker) {
				for (QGraphicsItem *item : scene()->items()) {
					Element* element = dynamic_cast<Element*>(item);
					if (element) {
						element->setSelectionState(false);
						element->select(false);
					}
				}

				elem->select(true);
			}

			NodeElement* nodeElem = dynamic_cast<NodeElement*>(elem);
			if (nodeElem && currentId.element() == "Class" &&
				mGraphicalAssistApi->children(currentId).empty())
			{
				needToProcessChildren = false;
				for (int i = 0; i < 2; i++) {
					QString curChildElementType = (i == 0) ? "MethodsContainer" : "FieldsContainer";
					Id newUuid = Id("Kernel_metamodel", "Kernel", curChildElementType, QUuid::createUuid().toString());
					mGraphicalAssistApi->createElement(currentId, newUuid
							, false,  "(anonymous something)", QPointF(0, 0));
				}
			}

			EdgeElement * const edgeElem = dynamic_cast<EdgeElement *>(elem);
			if (edgeElem) {
				edgeElem->layOut();
			}
		}

		if (needToProcessChildren && model()->hasChildren(current)) {
			rowsInserted(current, 0, model()->rowCount(current) - 1);
		}

		NodeElement * nodeElement = dynamic_cast<NodeElement*>(elem);
		if (nodeElement) {
			nodeElement->alignToGrid();
		}
	}

	foreach (QGraphicsItem *item, mScene->items()) {
		NodeElement* node = dynamic_cast<NodeElement*>(item);
		if (node) {
			node->adjustLinks();
		}
	}

	QAbstractItemView::rowsInserted(parent, start, end);
}

void EditorViewMViface::rowsAboutToBeRemoved(QModelIndex  const &parent, int start, int end)
{
	for (int row = start; row <= end; ++row) {
		QModelIndex curr = model()->index(row, 0, parent);
		if (curr == rootIndex()) {
			// Root id was removed, time to close current tab.
			emit rootElementRemoved(curr);
			// Now we will be deletted, nipping off...
			return;
		}

		if (Element *element = item(curr)) {
			mScene->onElementDeleted(element);
			mScene->removeItem(element);
			delete element;
		}

		removeItem(curr);
	}

	// elements from model are deleted after GUI ones
	if (parent == QModelIndex() && model()->rowCount(parent) == start - end + 1) {
		mScene->setEnabled(false);
	}

	QAbstractItemView::rowsAboutToBeRemoved(parent, start, end);
}

void EditorViewMViface::rowsAboutToBeMoved(const QModelIndex &sourceParent, int sourceStart, int sourceEnd
		, const QModelIndex &destinationParent, int destinationRow)
{
	Q_UNUSED(sourceEnd);
	Q_ASSERT(sourceStart == sourceEnd);  // only one element is permitted to be moved
	QPersistentModelIndex movedElementIndex = sourceParent.child(sourceStart, 0);
	QPersistentModelIndex newSiblingIndex = destinationParent.child(destinationRow, 0);

	Element *movedElement = item(movedElementIndex);
	Element *sibling = item(newSiblingIndex);
	if (!movedElement) {
		// there's no such element on the scene already
		// TODO: add element on the scene if there's no such element here, but there's in the model
		// ignoring there cases now
		qDebug() << "Trying to move element that already does not exist on a current scene, that's strange";
		return;
	}

	Element *newParent = item(destinationParent);
	if (newParent == nullptr) {
		// no parent element on the scene, so it should be root element
		movedElement->setParentItem(nullptr);
		return;
	}

	movedElement->setParentItem(newParent);
	if (sibling != nullptr) {
		movedElement->stackBefore(sibling);
	}
}

void EditorViewMViface::rowsMoved(const QModelIndex &sourceParent, int sourceStart, int sourceEnd
		, const QModelIndex &destinationParent, int destinationRow)
{
	Q_UNUSED(sourceParent);
	Q_UNUSED(sourceStart);
	Q_UNUSED(sourceEnd);
	Q_ASSERT(sourceStart == sourceEnd);
	QPersistentModelIndex movedElementIndex = destinationParent.child(destinationRow, 0);

	Q_ASSERT(movedElementIndex.isValid());
	Element *movedElement = item(movedElementIndex);

	if (movedElement == nullptr) {
		// no element on the scene, forget about it
		return;
	}

	movedElement->updateData();
}

void EditorViewMViface::dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight)
{
	for (int row = topLeft.row(); row <= bottomRight.row(); ++row) {
		const QModelIndex curr = topLeft.sibling(row, 0);
		Element *element = item(curr);
		if (element) {
			element->updateData();
		}
	}
}

EditorViewScene *EditorViewMViface::scene() const
{
	return mScene;
}

models::GraphicalModelAssistApi *EditorViewMViface::graphicalAssistApi() const
{
	return mGraphicalAssistApi;
}

models::LogicalModelAssistApi *EditorViewMViface::logicalAssistApi() const
{
	return mLogicalAssistApi;
}

void EditorViewMViface::clearItems()
{
	QList<QGraphicsItem *> toRemove;
	foreach (const IndexElementPair &pair, mItems) {
		if (!pair.second->parentItem()) {
			toRemove.append(pair.second);
		}
	}

	foreach (QGraphicsItem * const item, toRemove) {
		delete item;
	}

	mItems.clear();
}

Element *EditorViewMViface::item(const QPersistentModelIndex &index) const
{
	foreach (const IndexElementPair &pair, mItems) {
		if (pair.first == index) {
			return pair.second;
		}
	}
	return nullptr;
}

void EditorViewMViface::setItem(const QPersistentModelIndex &index, Element *item)
{
	IndexElementPair pair(index, item);
	if (!mItems.contains(pair)) {
		mItems.insert(pair);
	}
}

void EditorViewMViface::removeItem(const QPersistentModelIndex &index)
{
	foreach (const IndexElementPair &pair, mItems) {
		if (pair.first == index) {
			mItems.remove(pair);
		}
	}
}

void EditorViewMViface::configure(models::GraphicalModelAssistApi &graphicalAssistApi
		, models::LogicalModelAssistApi &logicalAssistApi
		, models::Exploser &exploser)
{
	mGraphicalAssistApi = &graphicalAssistApi;
	mLogicalAssistApi = &logicalAssistApi;
	mExploser = &exploser;
}

/// @todo: set logical model in constructor
void EditorViewMViface::setLogicalModel(QAbstractItemModel * const logicalModel)
{
	connect(logicalModel, SIGNAL(dataChanged(QModelIndex, QModelIndex))
			, this, SLOT(logicalDataChanged(QModelIndex, QModelIndex)));
}

void EditorViewMViface::logicalDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight)
{
	for (int row = topLeft.row(); row <= bottomRight.row(); ++row) {
		const QModelIndex curr = topLeft.sibling(row, 0);
		const Id logicalId = curr.data(roles::idRole).value<Id>();
		const IdList graphicalIds = mGraphicalAssistApi->graphicalIdsByLogicalId(logicalId);
		foreach (const Id &graphicalId, graphicalIds) {
			const QModelIndex graphicalIndex = mGraphicalAssistApi->indexById(graphicalId);
			Element *graphicalItem = item(graphicalIndex);
			if (graphicalItem) {
				graphicalItem->updateData();
			}
		}
	}
}

void EditorViewMViface::invalidateImagesZoomCache(qreal zoomFactor)
{
	for (const IndexElementPair & item : mItems) {
		auto node = dynamic_cast<NodeElement *>(item.second);
		if (node) {
			node->invalidateImagesZoomCache(zoomFactor);
		}
	}
}


text:
SYNONYM

#### According to
Index Fungorum

#### Published in
null

#### Original name
Taeniolella boppi Borelli

### Remarks
null


text:
import requests

from flask import Flask, request

app = Flask(__name__)

@app.route("/taint_test") # $ routeSetup="/taint_test"
def test_taint(): # $ requestHandler
    url = request.args['untrusted_input']

    # response from a request to a user-controlled URL should be considered
    # user-controlled as well.
    resp = requests.get(url) # $ clientRequestUrlPart=url

    requests.Response
    requests.models.Response

    ensure_tainted(
        url, # $ tainted
        # see https://docs.python-requests.org/en/latest/api/#requests.Response
        resp, # $ tainted
        resp.text, # $ tainted
        resp.content, # $ tainted
        resp.json(), # $ tainted

        # file-like
        resp.raw, # $ tainted
        resp.raw.read(), # $ tainted

        resp.links, # $ tainted
        resp.links['key'], # $ tainted
        resp.links.get('key'), # $ tainted

        resp.cookies, # $ tainted
        resp.cookies['key'], # $ tainted
        resp.cookies.get('key'), # $ tainted

        resp.headers, # $ tainted
        resp.headers['key'], # $ tainted
        resp.headers.get('key'), # $ tainted
    )

    for content_chunk in resp.iter_content():
        ensure_tainted(content_chunk)  # $ tainted

    for line in resp.iter_lines():
        ensure_tainted(line)  # $ tainted

    # for now, we don't assume that the response to ANY outgoing request is a remote
    # flow source, since this could lead to FPs.
    # TODO: investigate whether we should consider this a remote flow source.
    trusted_url = "https://internal-api-that-i-trust.com"
    resp = requests.get(trusted_url) # $ clientRequestUrlPart=trusted_url
    ensure__not_tainted(resp)


text:
package com.querydsl.example.dao;

import com.querydsl.example.config.TestConfiguration;
import com.querydsl.example.config.TestDataService;
import org.junit.Before;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.transaction.TransactionConfiguration;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = {TestConfiguration.class})
@TransactionConfiguration(defaultRollback = true)
@Transactional
public abstract class AbstractDaoTest {

    @Resource TestDataService testDataService;

    @Before
    public void setUp() {
        testDataService.addTestData();
    }

}


text:
from __future__ import unicode_literals
from django.db import models
from django.utils import timezone
from archon import modelview

#===============================================================================
# Create your models here.
#===============================================================================

class Domain(models.Model):
    name = models.CharField(max_length=64)
    controllers = models.CharField(max_length=64)
    user = models.CharField(max_length=32)
    password = models.CharField(max_length=32)
    created_date = models.DateTimeField(default=timezone.now)

modelview(Domain)

class EPTracker(models.Model):
    mac = models.CharField(max_length=18)
    ip = models.CharField(max_length=16)
    domain = models.CharField(max_length=64)
    tenant = models.CharField(max_length=100)
    app = models.CharField(max_length=100)
    epg = models.CharField(max_length=100)
    dn = models.CharField(max_length=2048)
    intf = models.CharField(max_length=2048)
    start = models.CharField(max_length=24)
    stop = models.CharField(max_length=24)

modelview(EPTracker)

class FaultMessage(models.Model):
    code = models.CharField(max_length=8)
    title = models.CharField(max_length=512)
    syslog = models.TextField()
    explan = models.TextField()
    actions = models.TextField()

modelview(FaultMessage)


text:
module Gitlab
  class RequestContext
    class << self
      def client_ip
        Gitlab::SafeRequestStore[:client_ip]
      end
    end

    def initialize(app)
      @app = app
    end

    def call(env)
      req = Rack::Request.new(env)

      Gitlab::SafeRequestStore[:client_ip] = req.ip

      @app.call(env)
    end
  end
end


text:
package org.apache.camel.processor.idempotent.jdbc;

import java.util.List;

import javax.sql.DataSource;

import org.apache.camel.EndpointInject;
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.apache.camel.builder.AdviceWith;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.model.RouteDefinition;
import org.apache.camel.test.spring.junit5.CamelSpringTestSupport;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.jdbc.core.JdbcTemplate;

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

public class JdbcMessageIdRepositoryTest extends CamelSpringTestSupport {

    protected static final String SELECT_ALL_STRING = "SELECT messageId FROM CAMEL_MESSAGEPROCESSED WHERE processorName = ?";
    protected static final String CLEAR_STRING = "DELETE FROM CAMEL_MESSAGEPROCESSED WHERE processorName = ?";
    protected static final String PROCESSOR_NAME = "myProcessorName";

    protected JdbcTemplate jdbcTemplate;
    protected DataSource dataSource;

    @EndpointInject("mock:result")
    protected MockEndpoint resultEndpoint;

    @EndpointInject("mock:error")
    protected MockEndpoint errorEndpoint;

    @Override
    @BeforeEach
    public void setUp() throws Exception {
        super.setUp();

        dataSource = context.getRegistry().lookupByNameAndType("dataSource", DataSource.class);
        jdbcTemplate = new JdbcTemplate(dataSource);
        jdbcTemplate.afterPropertiesSet();
    }

    @Test
    public void testDuplicateMessagesAreFilteredOut() throws Exception {
        resultEndpoint.expectedBodiesReceived("one", "two", "three");
        errorEndpoint.expectedMessageCount(0);

        template.sendBodyAndHeader("direct:start", "one", "messageId", "1");
        template.sendBodyAndHeader("direct:start", "two", "messageId", "2");
        template.sendBodyAndHeader("direct:start", "one", "messageId", "1");
        template.sendBodyAndHeader("direct:start", "two", "messageId", "2");
        template.sendBodyAndHeader("direct:start", "one", "messageId", "1");
        template.sendBodyAndHeader("direct:start", "three", "messageId", "3");

        assertMockEndpointsSatisfied();

        // all 3 messages should be in jdbc repo
        List<String> receivedMessageIds = jdbcTemplate.queryForList(SELECT_ALL_STRING, String.class, PROCESSOR_NAME);

        assertEquals(3, receivedMessageIds.size());
        assertTrue(receivedMessageIds.contains("1"));
        assertTrue(receivedMessageIds.contains("2"));
        assertTrue(receivedMessageIds.contains("3"));
    }

    @Test
    public void testFailedExchangesNotAdded() throws Exception {
        RouteBuilder interceptor = new RouteBuilder(context) {
            @Override
            public void configure() {
                interceptSendToEndpoint("mock:result")
                        .process(new Processor() {
                            public void process(Exchange exchange) {
                                String id = exchange.getIn().getHeader("messageId", String.class);
                                if (id.equals("2")) {
                                    throw new IllegalArgumentException("Damn I cannot handle id 2");
                                }
                            }
                        });
            }
        };
        RouteDefinition routeDefinition = context.getRouteDefinition("JdbcMessageIdRepositoryTest");
        AdviceWith.adviceWith(routeDefinition, context, interceptor);

        // we send in 2 messages with id 2 that fails
        errorEndpoint.expectedMessageCount(2);
        resultEndpoint.expectedBodiesReceived("one", "three");

        template.sendBodyAndHeader("direct:start", "one", "messageId", "1");
        template.sendBodyAndHeader("direct:start", "two", "messageId", "2");
        template.sendBodyAndHeader("direct:start", "one", "messageId", "1");
        template.sendBodyAndHeader("direct:start", "two", "messageId", "2");
        template.sendBodyAndHeader("direct:start", "one", "messageId", "1");
        template.sendBodyAndHeader("direct:start", "three", "messageId", "3");

        assertMockEndpointsSatisfied();

        jdbcTemplate.update(CLEAR_STRING, PROCESSOR_NAME);

        // only message 1 and 3 should be in jdbc repo
        List<String> receivedMessageIds = jdbcTemplate.queryForList(SELECT_ALL_STRING, String.class, PROCESSOR_NAME);

        assertEquals(0, receivedMessageIds.size());
        assertFalse(receivedMessageIds.contains("1"), "Should not contain message 1");
        assertFalse(receivedMessageIds.contains("3"), "Should not contain message 3");
    }

    @Override
    protected AbstractApplicationContext createApplicationContext() {
        return new ClassPathXmlApplicationContext("org/apache/camel/processor/idempotent/jdbc/spring.xml");
    }
}


text:
require 'whois/record/parser/base'

module Whois
  class Record
    class Parser

      # Parser for the whois.register.si server.
      #
      # @note This parser is just a stub and provides only a few basic methods
      #   to check for domain availability and get domain status.
      #   Please consider to contribute implementing missing methods.
      #
      # @see Whois::Record::Parser::Example
      #   The Example parser for the list of all available methods.
      #
      class WhoisRegisterSi < Base

        property_supported :status do
          if content_for_scanner =~ /status:\s+(.+)\n/
            statuses = $1.downcase.split(",").map(&:strip)
            if statuses.include?("server_update_prohibited")
              :registered
            else
              Whois.bug!(ParserError, "Unknown status `#{$1}'.")
            end
          else
            :available
          end
        end

        property_supported :available? do
          !!(content_for_scanner =~ /% No entries found/)
        end

        property_supported :registered? do
          !available?
        end

        property_supported :created_on do
          if content_for_scanner =~ /created:\s+(.*)\n/
            Time.parse($1)
          end
        end

        property_not_supported :updated_on

        property_supported :expires_on do
          if content_for_scanner =~ /expire:\s+(.*)\n/
            Time.parse($1)
          end
        end

        property_supported :nameservers do
          content_for_scanner.scan(/nameserver:\s+(.+)\n/).flatten.map do |name|
            Record::Nameserver.new(name: name.strip)
          end
        end

      end

    end
  end
end


text:
<?php

namespace BoomCMS\Tests;

use Illuminate\Support\Facades\App;
use PDO;

class MigrationsTest extends AbstractTestCase
{
    public function testMigrationsComplete()
    {
        $pdo = new PDO(env('DB_DRIVER').':host='.env('DB_HOST'), env('DB_USERNAME'), env('DB_PASSWORD'));
        $pdo->exec('drop database if exists '.env('DB_DATABASE'));
        $pdo->exec('create database '.env('DB_DATABASE'));
        $pdo->exec('set global innodb_large_prefix = "On"');

        $app = App::getFacadeRoot();
        $app['migration.repository']->createRepository();
        $app['migrator']->run(realpath(__DIR__.'/../src/database/migrations'));

        $pdo->exec('drop database '.env('DB_DATABASE'));
    }
}


text:
Developed to facilitate integration on Android ( Designers can thanks me :D )

![logo](https://raw.githubusercontent.com/florent37/Carpaccio/master/screenshot/carpaccio_small.png)

**Data Mapping & Smarter Views framework for android**

With Carpaccio, your views became smarter, instead of calling functions on views, now your views can call functions !
You no longer need to extend a view to set a custom behavior

Carpaccio also come with a beautiful mapping engine !

#This is kind of magic !

You can preview custom fonts & image loaded from url directly from Android Studio Preview !

![font](https://raw.githubusercontent.com/florent37/Carpaccio/master/screenshot/custom_ttf_small.png)
![url](https://raw.githubusercontent.com/florent37/Carpaccio/master/screenshot/preview_image_url_small.png)

#Usage

```xml
<com.github.florent37.carpaccio.Carpaccio
        android:id="@+id/carpaccio"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:register="
            com.github.florent37.carpacciocontrollers.ImageViewController;
            com.github.florent37.carpacciocontrollers.TextViewController
        ">

        <ImageView
               android:layout_width="match_parent"
               android:layout_height="150dp"
               android:scaleType="centerCrop"
               android:tag="url(http://i.imgur.com/DSjXNox.jpg)" />

        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:textSize="20sp"
            android:tag="
                font(Roboto-Thin.ttf);
                setText($user.name);"/>

</com.github.florent37.carpaccio.Carpaccio>
```

![url](https://raw.githubusercontent.com/florent37/Carpaccio/master/screenshot/sample_crop.png)

#Download

Add into your **build.gradle**

[![Download](https://api.bintray.com/packages/florent37/maven/Carpaccio/images/download.svg)](https://bintray.com/florent37/maven/Carpaccio/_latestVersion)
[![Download](https://api.bintray.com/packages/florent37/maven/CarpaccioControllers/images/download.svg)](https://bintray.com/florent37/maven/CarpaccioControllers/_latestVersion)

```groovy
compile ('com.github.florent37:carpaccio:1.0.0'){
    transitive=true
}
compile ('com.github.florent37:carpacciocontrollers:1.0.0'){
    transitive=true
}
```

------------

#DataBinding

```xml
<TextView
       android:tag="
            setText($user)
       "/>
```
( Which will call user.toString )

In your activity / fragment :

```java
Carpaccio carpaccio = (Carpaccio)findViewById("R.id.carpaccio");
carpaccio.mapObject("user",new User("florent"));
```

![set_text](https://raw.githubusercontent.com/florent37/Carpaccio/master/screenshot/set_text.png)

You can also specify a method (must return a String)

```xml
<TextView
       android:tag="
            setText($user.getName())
       "/>
```

And simplify the method name

```xml
<TextView
       android:tag="
            setText($user.name)
       "/>
```

------------

##RecyclerView Mapping

You dreamed it, Carpaccio did it ! You can now bind a List with a RecyclerView !

![recycler](https://raw.githubusercontent.com/florent37/Carpaccio/master/screenshot/recycler_small.png)

R.layout.activity_main_recyclerview_mapping
```xml
<com.github.florent37.carpaccio.Carpaccio
        android:id="@+id/carpaccio"
        app:register="
            com.github.florent37.carpacciocontrollers.CommonViewController;
            com.github.florent37.carpacciocontrollers.ImageViewController;
            com.github.florent37.carpacciocontrollers.TextViewController;
        ">

        <android.support.v7.widget.RecyclerView
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"

                    android:tag="
                        adapter(user,R.layout.cell_user)
                    "
                    />

</com.github.florent37.carpaccio.Carpaccio>
```

R.layout.cell_user
```xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="100dp"
    android:gravity="center_vertical"
    android:orientation="horizontal">

    <ImageView
        android:layout_width="100dp"
        android:layout_height="match_parent"
        android:tag="url($user.image);"
        android:layout_marginRight="20dp" />

    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:tag="setText($user.name)" />

</LinearLayout>
```

Finally, in your activiy/fragment you just have to indicate the List to map !

```java
setContentView(R.layout.activity_main_recyclerview_mapping);
Carpaccio carpaccio = (Carpaccio)findViewById("R.id.carpaccio");
carpaccio.mapList("user", this.users);
```

[![Video](http://share.gifyoutube.com/yAp6Lw.gif)](https://youtu.be/alE3Pewmulo)

------------

#Customize

You can add you own functions to Carpaccio, simply create a custom ViewControllers,
for example **MyViewController**

```java
public class MyViewController{

    public void myFunction(View view, String argument1){
        //your usage
    }

}
```

Then you can use it into your layout

```xml
<com.github.florent37.carpaccio.Carpaccio
        app:register="
            com.mypackage.MyViewController
        ">

        <View
            android:tag="
               myFunction(theValueOfMyArgument)
            "/>

</com.github.florent37.carpaccio.Carpaccio>
```

------------

#ViewControllers

Carpaccio provide some awesome ViewControllers, you can import them directly into your project

Add into your **build.gradle**

```groovy
compile ('com.github.florent37:carpacciocontrollers:1.0.0'){
    transitive=true
}
```

------------

##TextViewController

TextViewController can set a custom font (from assets/fonts/) to a TextView

**WORKS WITH ANDROID STUDIO PREVIEW !!!**

![font](https://raw.githubusercontent.com/florent37/Carpaccio/master/screenshot/custom_font_small.png)

Usage : **font(fontName)**

```xml
<com.github.florent37.carpaccio.Carpaccio
        app:register="
            com.github.florent37.carpacciocontrollers.TextViewController;
        ">

        <TextView
             android:tag="
                 font(Roboto-Light.ttf)
             "/>
</com.github.florent37.carpaccio.Carpaccio>
```

And provides a data binding setText

Usage : **setText($variable)** or **setText($variable.function())**

```xml
<TextView
     android:tag="
         setText($user)
     "/>
```

Or directly on the android:text

Usage : **android:text="$variable"**

```xml
<TextView
     android:text="$user"/>
```

------------

##ImageViewController

###Url

ImageViewController can directly set an image source from an url

Usage : **url(imageUrl)**

```xml
<com.github.florent37.carpaccio.Carpaccio
        app:register="
            com.github.florent37.carpacciocontrollers.ImageViewController;
        ">

        <ImageView
             android:tag="
                 url(http://i.imgur.com/DvpvklR.png)
             " />
</com.github.florent37.carpaccio.Carpaccio>
```

![url](https://raw.githubusercontent.com/florent37/Carpaccio/master/screenshot/url_small.png)

**WORKS WITH ANDROID STUDIO PREVIEW !!!**

Preview an url image

Usage : **enablePreview();url(imageUrl);**

```xml
<com.github.florent37.carpaccio.Carpaccio
        app:register="
            com.github.florent37.carpacciocontrollers.ImageViewController;
        ">

        <ImageView
             android:tag="
                enablePreview();
                 url(http://i.imgur.com/DvpvklR.png);
             " />
</com.github.florent37.carpaccio.Carpaccio>
```

![url](https://raw.githubusercontent.com/florent37/Carpaccio/master/screenshot/preview_image_url_small.png)

Usage : **kenburns()**

```xml
<ImageView
      android:tag="
           kenburns();
           url(http://i.imgur.com/DvpvklR.png);
      " />
```

[![Video](http://share.gifyoutube.com/vpMYjp.gif)](https://youtu.be/4b84gswKGkA)

###Blur
You can blur an ImageView

Usage :
* **willBlur()** if use url(www...)
* **blur()** else

```xml
<ImageView
      android:tag="
           willBlur();
           url(http://i.imgur.com/DvpvklR.png);
      " />

<ImageView
      android:src="@drawable/my_image"
      android:tag="
           blur()
      " />
```

![blur](https://raw.githubusercontent.com/florent37/Carpaccio/master/screenshot/blur_small.png)

###GreyScale

Usage :
* **willGreyScale()** if use url(www...)
* **greyScale()** else

```xml
<ImageView
      android:tag="
           willGreyScale();
           url(http://i.imgur.com/DvpvklR.png);
      " />

<ImageView
      android:src="@drawable/my_image"
      android:tag="
           greyScale()
      " />
```

![greyscale](https://raw.githubusercontent.com/florent37/Carpaccio/master/screenshot/greyscale_small.png)

###AnimateMaterial

Display your image with a material animation
Usage : **animateMaterial(duration)**

```xml
<ImageView
      android:tag="
           animateMaterial(6000);
           url(http://i.imgur.com/DvpvklR.png);
      " />
```

[![Video](http://share.gifyoutube.com/mGz9OZ.gif)](https://youtu.be/A0eyvpNh5wM)

------------

##ParallaxViewController

ParallaxViewController can add a parallax effect on ScrollView childs

Usage :

* ScrollView : **registerParallax()**
* ScrollView childs : **parallaxY(float)**

```xml
<com.github.florent37.carpaccio.Carpaccio
        app:register="
            com.github.florent37.carpacciocontrollers.ParallaxViewController;
        ">

        <ScrollView
                    android:tag="registerParallax()">

              <View
                    android:tag="
                        parallaxY(0.5);
                    " />

              <View
                    android:tag="
                        parallaxY(1.5);
                    " />

        </ScrollView

</com.github.florent37.carpaccio.Carpaccio>
```

[![Video](http://share.gifyoutube.com/mLOpk7.gif)](https://youtu.be/DB_aHUGNwLQ)

------------

##CommonViewController

Bind a RecyclerView (see DataBinding)

Usage :

* **adapter(listMappedName,cellLayoutName)**

```xml
<android.support.v7.widget.RecyclerView
     android:layout_width="match_parent"
     android:layout_height="match_parent"

     android:tag="
         adapter(user,R.layout.cell_user)
     "
     />
```

Open an activity onClick

* **clickStartActivity(activityName) **

```xml
<Button
      android:tag="clickStartActivity(.MainActivitySample)"
      />

<Button
      android:tag="clickStartActivity(com.github.florent37.carpaccio.sample.MainActivitySample)"
      />

<Button
      android:tag="clickStartActivity($activity1)"
      />
```

Replace by another View class

```xml
<ScrollView
      android:layout_width="match_parent"
      android:layout_height="match_parent"

      android:tag="
          replace(com.github.ksoichiro.android.observablescrollview.ObservableScrollView);
      "
      />
```

* **margin(top,right,bottom,left)** & **padding(top,right,bottom,left)**

```xml
<View
      android:layout_width="match_parent"
      android:layout_height="match_parent"

      android:tag="
          margin(0,10,0,0);
          padding(5,0,5,0);
      "
      />
```

------------

##AnimationViewController

Easings :
* easeIn : accelerate
* easeOut : descelerate
* easeInOut : accelerate then descelerate

Functions :
* **animateAphaIn(duration,easing)**
* **animateScaleUp(duration,easing)**
* **animateEnterY(translationY,duration,easing)**
* **animateEnterX(translationX,duration,easing)**
* **animateEnter(translationX,translationY,duration,easing)**


text:
Write-Output Creating group docker
net localgroup docker /add
$username = $env:USERNAME
Write-Output Adding user $username to group docker
net localgroup docker $username /add


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"/>
<title>sfImagePoolPlugin: Data Fields - Functions</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>

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

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

sfImagePoolPlugin

Main Page

Related Pages

Namespaces

Data Structures

Files

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

Data Structures

Data Structure Index

Class Hierarchy

Data Fields

All

Functions

Variables

_

a

c

d

e

f

g

h

i

l

m

p

r

s

u

- _ -

__construct()
: sfImagePoolCache
, sfImagePoolCacheInterface
, sfImagePoolResizer
, ImageTransform

__destruct()
: ImageTransform

__toString()
: PluginsfImagePoolImage

- a -

addImage()
: sfImagePoolable

addImageChooser()
: sfImagePoolUtil

addImageField()
: sfImagePoolUtil

addImagePoolMooEditable()
: sfImagePoolUtil

addMultipleUploadFields()
: sfImagePoolableBaseForm

addStripes()
: ImageTransform

addTagColumnQuery()
: PluginsfImagePoolImageFormFilter

allowSelectMultiple()
: sfImagePoolable

applyTags()
: PluginsfImagePoolImageForm

- c -

checkMethod()
: sfImagePoolResizer

checkTaggingField()
: sfImagePoolAdminGeneratorConfiguration

commit()
: sfImagePoolFilesystemCache
, sfImagePoolRackCloudCache
, sfImagePoolCacheInterface

configure()
: sfDoctrineTaggableInput
, sfValidatorImageFile
, sfWidgetFormImagePoolChooser
, dummydataTask

createImageFromUpload()
: sfImagePoolUtil

createWorkingImageResource()
: ImageTransform

crop()
: ImageTransform

- d -

deleteCached()
: PluginsfImagePoolImageForm

deleteImageFile()
: sfImagePoolUtil

doClean()
: sfValidatorImageFile

doUpdateObject()
: PluginsfImagePoolImageForm
, sfImagePoolableBaseForm

- e -

execute()
: dummydataTask

executeChooser()
: sfImagePoolAdminActions

executeDelete()
: sfImagePoolAdminActions

executeDeleteUsed()
: sfImagePoolAdminActions

executeEdit()
: sfImagePoolAdminActions

executeImage()
: BasesfImagePoolActions

executeUpload()
: sfImagePoolAdminActions

executeUploadCrop()
: sfImagePoolAdminActions

- f -

fit()
: ImageTransform

fitToLongestEdge()
: ImageTransform

- g -

generateImages()
: dummydataTask

getBaseDir()
: sfImagePoolPluginConfiguration

getBaseUrl()
: sfImagePoolPluginConfiguration

getByIds()
: PluginsfImagePoolImageTable

getByIdsQuery()
: PluginsfImagePoolImageTable

getDefaultImage()
: PluginsfImagePoolImage

getDefaultPoolImageUrl()
: sfImagePoolable

getDestination()
: sfImagePoolCacheInterface
, sfImagePoolFilesystemCache
, sfImagePoolRackCloudCache

getEditDisplay()
: sfImagePoolAdminGeneratorConfiguration

getFeatured()
: sfImagePoolImageCollection

getFeaturedImage()
: sfImagePoolable
, sfImagePoolImageCollection

getFilterDisplay()
: sfImagePoolAdminGeneratorConfiguration

getHeight()
: PluginsfImagePoolImage

getImagePoolQuery()
: sfImagePoolable

getInstance()
: PluginsfImagePoolCropTable
, PluginsfImagePoolImageTable
, PluginsfImagePoolLookupTable
, sfImagePoolable

getJavaScripts()
: sfWidgetFormImagePoolChooser

getLifetime()
: sfImagePoolCache

getNbPoolImages()
: sfImagePoolable

getNewDisplay()
: sfImagePoolAdminGeneratorConfiguration

getNewImagePath()
: sfImagePoolResizer

getPager()
: PluginsfImagePoolImageTable

getParams()
: sfImagePoolResizer

getPathToOriginalFile()
: PluginsfImagePoolImage

getPathToUpload()
: PluginsfImagePoolCropForm

getPoolImage()
: sfImagePoolable

getPoolImages()
: sfImagePoolable

getRandomModelId()
: dummydataTask

getStylesheets()
: sfWidgetFormImagePoolChooser

getTagFields()
: PluginsfImagePoolImageForm

getTagInputName()
: PluginsfImagePoolImageForm

getTagRestriction()
: sfImagePoolable

getTags()
: PluginsfImagePoolImageForm

getUnfeatured()
: sfImagePoolImageCollection

getUploadDir()
: PluginsfImagePoolImageForm

getUploadErrors()
: sfImagePoolUtil

getUrl()
: PluginsfImagePoolImage

getValidatorMessages()
: sfImagePoolUtil

getValidatorOptions()
: sfImagePoolUtil

getWidth()
: PluginsfImagePoolImage

getWorkingImageHeight()
: ImageTransform

getWorkingImageResource()
: ImageTransform

getWorkingImageWidth()
: ImageTransform

- h -

hasImage()
: sfImagePoolable

hasImages()
: sfImagePoolable

- i -

initialize()
: sfImagePoolPluginConfiguration

invertColour()
: ImageTransform

isUsed()
: PluginsfImagePoolImage

- l -

linkToDelete()
: sfImagePoolAdminGeneratorHelper

linkToEdit()
: sfImagePoolAdminGeneratorHelper

- m -

makeGreyscale()
: ImageTransform

multiplyColour()
: ImageTransform

- p -

postDelete()
: PluginsfImagePoolImage

postSave()
: sfImagePoolableListener

preDelete()
: sfImagePoolableListener

processImageField()
: sfImagePoolUtil

- r -

removeImages()
: PluginsfImagePoolLookupTable

render()
: sfDoctrineTaggableInput
, sfWidgetFormImagePoolChooser

resize()
: ImageTransform

- s -

save()
: ImagePoolImageMagickAdapter
, ImageTransform
, sfImagePoolImageCollection
, sfImagePoolResizer

sendCachingHttpHeaders()
: sfImagePoolCache
, sfImagePoolCacheInterface

setFeaturedImage()
: sfImagePoolImageCollection
, sfImagePoolable

setImageIds()
: sfImagePoolable

setImages()
: sfImagePoolable

setTableDefinition()
: sfImagePoolable

setTagWidget()
: PluginsfImagePoolImageForm

setup()
: PluginsfImagePoolCropForm
, PluginsfImagePoolImageForm
, PluginsfImagePoolImage
, PluginsfImagePoolImageFormFilter

setWorkingImageResource()
: ImageTransform

sharedImages()
: sfImagePoolable

sharpen()
: ImageTransform

- u -

updateObject()
: PluginsfImagePoolCropForm
, PluginsfImagePoolImageForm

Generated on Wed Jul 6 2011 15:15:56 for sfImagePoolPlugin by

 1.7.4

 All Data Structures Namespaces Files Functions Variables


text:
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

#nullable disable

namespace StyleCop.Analyzers.Test.Verifiers
{
    using System;
    using System.Collections.Immutable;
    using System.IO;
    using System.Threading;
    using System.Threading.Tasks;
    using Microsoft.CodeAnalysis;
    using Microsoft.CodeAnalysis.Host.Mef;
    using Microsoft.CodeAnalysis.Testing;
    using Microsoft.VisualStudio.Composition;

    internal static class GenericAnalyzerTest
    {
        internal static readonly ReferenceAssemblies ReferenceAssemblies;

        internal static readonly ReferenceAssemblies ReferenceAssembliesNet50;

        internal static readonly ReferenceAssemblies ReferenceAssembliesNet60;

        private static readonly Lazy<IExportProviderFactory> ExportProviderFactory;

        static GenericAnalyzerTest()
        {
            string codeAnalysisTestVersion =
                typeof(Compilation).Assembly.GetName().Version.Major switch
                {
                    1 => "1.2.1",
                    2 => "2.8.2",
                    3 => "3.6.0",
                    4 => "4.0.1",
                    _ => throw new InvalidOperationException("Unknown version."),
                };

            ReferenceAssemblies = ReferenceAssemblies.Default.AddPackages(ImmutableArray.Create(
                new PackageIdentity("Microsoft.CodeAnalysis.CSharp", codeAnalysisTestVersion),
                new PackageIdentity("System.ValueTuple", "4.5.0")));

            ReferenceAssembliesNet50 = ReferenceAssemblies.Net.Net50.AddPackages(ImmutableArray.Create(
                new PackageIdentity("Microsoft.CodeAnalysis.CSharp", codeAnalysisTestVersion)));

            ReferenceAssembliesNet60 =
                new ReferenceAssemblies(
                    "net6.0",
                    new PackageIdentity(
                        "Microsoft.NETCore.App.Ref",
                        "6.0.0"),
                    Path.Combine("ref", "net6.0"))
                .AddPackages(ImmutableArray.Create(
                    new PackageIdentity("Microsoft.CodeAnalysis.CSharp", codeAnalysisTestVersion)));

            ExportProviderFactory = new Lazy<IExportProviderFactory>(
                () =>
                {
                    var discovery = new AttributedPartDiscovery(Resolver.DefaultInstance, isNonPublicSupported: true);
                    var parts = Task.Run(() => discovery.CreatePartsAsync(MefHostServices.DefaultAssemblies)).GetAwaiter().GetResult();
                    var catalog = ComposableCatalog.Create(Resolver.DefaultInstance).AddParts(parts);

                    var configuration = CompositionConfiguration.Create(catalog);
                    var runtimeComposition = RuntimeComposition.CreateRuntimeComposition(configuration);
                    return runtimeComposition.CreateExportProviderFactory();
                },
                LazyThreadSafetyMode.ExecutionAndPublication);
        }

        internal static AdhocWorkspace CreateWorkspace()
        {
            var exportProvider = ExportProviderFactory.Value.CreateExportProvider();
            var host = MefV1HostServices.Create(exportProvider.AsExportProvider());
            return new AdhocWorkspace(host);
        }
    }
}


text:
<?php

namespace Instance\Factory;

use Doctrine\ORM\EntityManager;
use DoctrineModule\Service\AbstractFactory;
use Instance\Manager\InstanceAwareEntityManager;
use Zend\ServiceManager\ServiceLocatorInterface;

class InstanceAwareEntityManagerFactory extends AbstractFactory
{

    /**
     * {@inheritDoc}
     * @return EntityManager
     */
    public function createService(ServiceLocatorInterface $sl)
    {
        /* @var $options \DoctrineORMModule\Options\EntityManager */
        $options    = $this->getOptions($sl, 'entitymanager');
        $connection = $sl->get($options->getConnection());
        $config     = $sl->get($options->getConfiguration());

        // initializing the resolver
        // @todo should actually attach it to a fetched event manager here, and not
        //       rely on its factory code
        $sl->get($options->getEntityResolver());

        return InstanceAwareEntityManager::create($connection, $config);
    }

    /**
     * {@inheritDoc}
     */
    public function getOptionsClass()
    {
        return 'DoctrineORMModule\Options\EntityManager';
    }
}


text:
const cwd = require('cwd');

module.exports = function(gulp, plugins, cfg) {
  gulp.task('eslint-server', eslintServer);

  function eslintServer() {
    const customGulpFormatter = require(cwd('build/eslint/customGulpFormatter'));

    return gulp.src(cfg.js.server.src)
      .pipe(plugins.eslint())
      .pipe(plugins.eslint.format(customGulpFormatter))
      .pipe(plugins.eslint.failAfterError())
      ;
  }
};


text:
//============================================================================
//
// Copyright (C) 2006-2022 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
//============================================================================
package org.talend.components.marklogic.runtime;

import org.talend.components.api.component.runtime.ComponentDriverInitialization;
import org.talend.components.api.container.RuntimeContainer;
import org.talend.components.marklogic.connection.MarkLogicConnection;
import org.talend.components.marklogic.tmarklogicconnection.MarkLogicConnectionProperties;
import org.talend.daikon.properties.ValidationResult;

/**
 * Implementation of runtime part for tMarkLogicConnection component.
 *
 */
public class TMarkLogicConnectionStandalone extends MarkLogicConnection
        implements ComponentDriverInitialization<MarkLogicConnectionProperties> {

    private static final long serialVersionUID = -40535886003777462L;

    private MarkLogicConnectionProperties properties;

    @Override
    public void runAtDriver(RuntimeContainer container) {
        connect(container);
    }

    @Override
    public ValidationResult initialize(RuntimeContainer container, MarkLogicConnectionProperties properties) {
        this.properties = properties;
        return ValidationResult.OK;
    }

    @Override
    protected MarkLogicConnectionProperties getMarkLogicConnectionProperties() {
        return properties;
    }
}


text:
<?php
namespace Neos\Flow\Tests\Functional\Mvc\Fixtures\Controller;

use Neos\Flow\Annotations as Flow;

/**
 * An object argument with validation
 */
class TestObjectArgument
{
    /**
     * @var string
     * @Flow\Validate(type="NotEmpty")
     */
    protected $name;

    /**
     * @var string
     * @Flow\Validate(type="EmailAddress",validationGroups={"Controller","Default","validatedGroup"})
     */
    protected $emailAddress;

    /**
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * @param string $name
     */
    public function setName($name)
    {
        $this->name = $name;
    }

    /**
     * @return string
     */
    public function getEmailAddress()
    {
        return $this->emailAddress;
    }

    /**
     * @param string $emailAddress
     */
    public function setEmailAddress($emailAddress)
    {
        $this->emailAddress = $emailAddress;
    }
}


text:
<!DOCTYPE html>

	<title>

            LinkAge Photo -

    Complete profile - Canadian Company Capabilities - Industries and Business - Industry Canada
  </title>

<meta charset="utf-8" />
<meta name="dcterms.language" title="ISO639-2" content="eng" />
<meta name="dcterms.title" content="" />
<meta name="description" content="" />
<meta name="dcterms.description" content="" />
<meta name="dcterms.type" content="report, data set" />
<meta name="dcterms.subject" content="businesses, industry" />
<meta name="dcterms.subject" content="businesses, industry" />
<meta name="dcterms.issued" title="W3CDTF" content="" />
<meta name="dcterms.modified" title="W3CDTF" content="" />
<meta name="keywords" content="" />

<meta name="dcterms.creator" content="" />
<meta name="author" content="" />
<meta name="dcterms.created" title="W3CDTF" content="" />
<meta name="dcterms.publisher" content="" />
<meta name="dcterms.audience" title="icaudience" content="" />
<meta name="dcterms.spatial" title="ISO3166-1" content="" />
<meta name="dcterms.spatial" title="gcgeonames" content="" />
<meta name="dcterms.format" content="HTML" />
<meta name="dcterms.identifier" title="ICsiteProduct" content="536" />

<meta http-equiv="X-UA-Compatible" content="IE=edge">

<meta content="width=device-width,initial-scale=1" name="viewport">

<meta name = "format-detection" content = "telephone=no">

<meta name="robots" content="noarchive">

<link href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/assets/favicon.ico" rel="icon" type="image/x-icon">
<link rel="stylesheet" href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/css/wet-boew.min.css">

<link rel="stylesheet" href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/css/theme.min.css">

<link rel="stylesheet" href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/css/noscript.min.css" />

<link rel="stylesheet" href="/eic/home.nsf/css/add_WET_4-0_Canada_Apps.css">

  	<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
  	<link href="/app/ccc/srch/css/print.css" media="print" rel="stylesheet" type="text/css" />

<meta property="legalName" content="Department_of_Industry">

Skip to main content

Skip to "About this site"

Language selection

Français

<object type="image/svg+xml" tabindex="-1" data="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/assets/sig-blk-en.svg"></object> Government of Canada

Search and menus

Search and menus

Topics menu

Jobs

Immigration

Travel

Business

Benefits

Health

Taxes

More services

You are here:

Home

Industries and Business

Canadian Company Capabilities

<input id="showMore" type="hidden" value='more'/>
<input id="showLess" type="hidden" value='less'/>

 Company profile - Canadian Company Capabilities

New Search |

<form name="searchForm" method="post" action="/app/ccc/srch/bscSrch.do">

          <input type="hidden" name="lang" value="eng" />
          <input type="hidden" name="profileId" value="" />
          <input type="hidden" name="prtl" value="1" />
          <input type="hidden" name="searchPage" value="%2Fapp%2Fccc%2Fsrch%2FcccBscSrch.do%3Flang%3Deng%26amp%3Bprtl%3D1%26amp%3Btagid%3D"  />

          <input type="hidden" name="V_SEARCH.scopeCategory" value="CCC.Root" />

          <input type="hidden" name="V_SEARCH.depth" value="1" />
          <input type="hidden" name="V_SEARCH.showStricts" value="false" />
          <input id="repeatSearchBtn" class="btn btn-link" type="submit" value="Return to search results" />

  </form>

| Previous Company

| Next Company

      Third-Party Information Liability Disclaimer

Some of the information on this Web page has been provided by external sources. The Government of Canada is not responsible for the accuracy, reliability or currency of the information supplied by external sources. Users wishing to rely upon this information should consult directly with the source of the information. Content provided by external sources is not subject to official languages, privacy and accessibility requirements.

      LinkAge Photo

Legal/Operating Name:

LinkAge Photo

https://www.linkagephoto.com/

jkb@linkagephoto.com

Mailing Address:

              	<address class="mrgn-bttm-md">

                   9103 Canyon View Rd

                    SUMMERLAND,

                    British Columbia

                  V0H 1Z2

                </address>

Location Address:

              	         <address class="mrgn-bttm-md">

                   9103 Canyon View Rd

                    SUMMERLAND,

                    British Columbia

                  V0H 1Z2

                         </address>

Tel.:
		      (250) 494-1789

Tel.:
			      (866) 494-1789

Fax:
		      (250) 494-1788

Logo

Company Profile

            Panoramic, Landscape and Commercial Photography by JK Barber. Buy Prints | Virtual Tours | Web Design Coaching | Insurance Photography | Photo Restoration. Professional Photographer based in the Okanagan Valley, BC.

				Full profile

				Full profile

				Contact information

                John
                Barber

	                  Title:

  						Owner

                  Telephone:

                (250) 494-1789

                    Email:

                  info@okdigital.ca

  top of page

				Company description

            Country of Ownership:

              Canada

            Exporting:

              Yes

                Primary Industry (NAICS):

				541920 - Photographic Services

            Primary Business Activity:

            Services

				Product / Service / Licensing

                              Service Name:

                            Digital Photography Business License

                            We are a registered business in British Columbia, and currently hold business licenses in Summerland and Penticton, B.C.

  top of page

					Technology profile

            Open Source Content Management Systems/Joomla, Adobe Photoshop

					Sector information

                Key / Major clients:

              Valley First Insurance Services, Penticton, BC

Interior Savings Insurance Services, Kamloops, BC

Summerland Motel, Summerland, BC

Rosedale Motel, Summerland, BC

Giants Head Realty, Summerland, BC

                Success stories:

              Following the Okanagan Mountain Park wildfire in 2003, I was contracted by Valley First Insurance Services of Penticton, BC to photograph exteriors of over 3500 properties throughout the Okanagan and Similkameen regions. In 2011, I was subsequently contracted by Interior Savings Insurance services of Kamloops, BC  to photograph exteriors of over 12,000 properties throughout the Okanagan, Thompson, Cariboo and Similkameen regions. As of February, 2016, this project is ongoing.

                Testimonial:

              "From March 2008 through November 2009, Valley First Insurance has been working with John Barber of Okanagan Digital Photography. We have utilized John's professional photographic services for coordination of a sizable project to assist us in updating our files. Throughout the course of the project John was required to take clear photographs of over 3500 properties that we insure. This project required that John be prepared to travel throughout our market area which includes the Okanagan and Similkameen region. This was the first time we embarked on such a project and we worked hand in hand with John to establish practical processes, with John providing suggestions and feedback for possible improvements."

"Due to the nature of this project it was essential to Valley First Insurance that we establish a relationship with a vendor we trusted to maintain professionalism and confidentiality at all times. John Barber has consistently exceeded our expectations; he has been organized, efficient and thorough."

"We would not hesitate to work with John and Okanagan Digital Photography again in the future should we require such services."

Wendy Lamond, Valley First Insurance Services, Penticton, BC

					Third-Party Information Liability Disclaimer

					Some of the information on this Web page has been provided by external sources. The Government of Canada is not responsible for the accuracy, reliability or currency of the information supplied by external sources. Users wishing to rely upon this information should consult directly with the source of the information. Content provided by external sources is not subject to official languages, privacy and accessibility requirements.

				Contacts

				Contact information

                John
                Barber

	                  Title:

  						Owner

                  Telephone:

                (250) 494-1789

                    Email:

                  info@okdigital.ca

				Description

				Company description

            Country of Ownership:

              Canada

            Exporting:

              Yes

                Primary Industry (NAICS):

				541920 - Photographic Services

            Primary Business Activity:

            Services

				Products, services and licensing

				Product / Service / Licensing

                              Service Name:

                            Digital Photography Business License

                            We are a registered business in British Columbia, and currently hold business licenses in Summerland and Penticton, B.C.

							Technology

							Technology profile

            Open Source Content Management Systems/Joomla, Adobe Photoshop

					Sector

					Sector information

                Key / Major clients:

              Valley First Insurance Services, Penticton, BC

Interior Savings Insurance Services, Kamloops, BC

Summerland Motel, Summerland, BC

Rosedale Motel, Summerland, BC

Giants Head Realty, Summerland, BC

                Success stories:

              Following the Okanagan Mountain Park wildfire in 2003, I was contracted by Valley First Insurance Services of Penticton, BC to photograph exteriors of over 3500 properties throughout the Okanagan and Similkameen regions. In 2011, I was subsequently contracted by Interior Savings Insurance services of Kamloops, BC  to photograph exteriors of over 12,000 properties throughout the Okanagan, Thompson, Cariboo and Similkameen regions. As of February, 2016, this project is ongoing.

                Testimonial:

              "From March 2008 through November 2009, Valley First Insurance has been working with John Barber of Okanagan Digital Photography. We have utilized John's professional photographic services for coordination of a sizable project to assist us in updating our files. Throughout the course of the project John was required to take clear photographs of over 3500 properties that we insure. This project required that John be prepared to travel throughout our market area which includes the Okanagan and Similkameen region. This was the first time we embarked on such a project and we worked hand in hand with John to establish practical processes, with John providing suggestions and feedback for possible improvements."

"Due to the nature of this project it was essential to Valley First Insurance that we establish a relationship with a vendor we trusted to maintain professionalism and confidentiality at all times. John Barber has consistently exceeded our expectations; he has been organized, efficient and thorough."

"We would not hesitate to work with John and Okanagan Digital Photography again in the future should we require such services."

Wendy Lamond, Valley First Insurance Services, Penticton, BC

    Last Update Date 2016-02-16

Date Modified:

      <time>2017-03-02</time>

About government

Contact us

Departments and agencies

Public service and military

News

Treaties, laws and regulations

Government-wide reporting

Prime Minister

How government works

Open government

About this site

Social media

Mobile applications

About Canada.ca

Terms and conditions

Privacy

Top of Page

<object type="image/svg+xml" tabindex="-1" role="img" data="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/assets/wmms-blk.svg" aria-label="Symbol of the Government of Canada"></object>


text:
package io.github.ineedcode.Consumer;

import org.apache.kafka.common.*;
import org.apache.kafka.clients.consumer.*;

import java.util.*;

public class ConsumerApp {
    public static void main(String[] args){

        // Create the Properties class to instantiate the Consumer with the desired settings:
        Properties props = new Properties();
        props.put("bootstrap.servers", "kafka-1:9092, kafka-2:9092");
        props.put("key.deserializer", "org.apache.kafka.common.serialization.StringDeserializer");
        props.put("value.deserializer", "org.apache.kafka.common.serialization.StringDeserializer");
        props.put("fetch.min.bytes", 1);
        props.put("group.id", "java-consumer-app");
        props.put("heartbeat.interval.ms", 3000);
        props.put("max.partition.fetch.bytes", 1048576);
        props.put("session.timeout.ms", 30000);
        props.put("auto.offset.reset", "latest");
        props.put("connections.max.idle.ms", 540000);
        props.put("enable.auto.commit", true);
        props.put("exclude.internal.topics", true);
        props.put("max.poll.records", 2147483647);
        props.put("partition.assignment.strategy", "org.apache.kafka.clients.consumer.RangeAssignor");
        props.put("request.timeout.ms", 40000);
        props.put("auto.commit.interval.ms", 5000);
        props.put("fetch.max.wait.ms", 500);
        props.put("metadata.max.age.ms", 300000);
        props.put("reconnect.backoff.ms", 50);
        props.put("retry.backoff.ms", 100);
        props.put("client.id", "java-consumer-app");

        // Create a KafkaConsumer instance and configure it with properties.
        KafkaConsumer<String, String> myConsumer = new KafkaConsumer<String, String>(props);

        // Create a topic subscription list:
        ArrayList<TopicPartition> partitions = new ArrayList<TopicPartition>();
        partitions.add(new TopicPartition("akhlaq", 0)); // Adds a TopicPartition instance representing a topic and a partition.
        partitions.add(new TopicPartition("akhlaq", 1)); // Adds a TopicPartition instance representing a topic and a partition.
        partitions.add(new TopicPartition("akhlaq", 2)); // Adds an additional TopicPartition instance representing a different partition within the topic. Change as desired.
        // Assign partitions to the Consumer:
        myConsumer.assign(partitions);

        // Retrieves the topic subscription list from the SubscriptionState internal object:
        Set<TopicPartition> assignedPartitions = myConsumer.assignment();

        // Print the partition assignments:
        printSet(assignedPartitions);

        // Start polling for messages:
        try {
            while (true){
                ConsumerRecords records = myConsumer.poll(1000);
                printRecords(records);
            }
        } finally {
            myConsumer.close();
        }

    }

    private static void printSet(Set<TopicPartition> collection){
        if (collection.isEmpty()) {
            System.out.println("I do not have any partitions assigned yet...");
        }
        else {
            System.out.println("I am assigned to following partitions:");
            for (TopicPartition partition: collection){
                System.out.println(String.format("Partition: %s in Topic: %s", Integer.toString(partition.partition()), partition.topic()));
            }
        }
    }

    private static void printRecords(ConsumerRecords<String, String> records)
    {
        for (ConsumerRecord<String, String> record : records) {
            System.out.println(String.format("Topic: %s, Partition: %d, Offset: %d, Key: %s, Value: %s", record.topic(), record.partition(), record.offset(), record.key(), record.value()));
        }
    }
}


text:
Create Event

				<form id="create-event" #createEventForm="ngForm" class="form-horizontal" name="create-event" (submit)="createEvent();" novalidate>

						Event Name *

							<input type="text" class="form-control" id="eventName" name="eventName" maxlength="32" required [(ngModel)]="event.eventName"
									 placeholder="Name of Event" #eventName="ngModel"/>

								Event DateTime*

									<input type="date" class="form-control" id="eventDate" name="eventDate"
											 placeholder="Date and Time of Event">

									Event Contact*

                                        <input type="text" class="form-control" id="eventContact" name="eventContact" maxlength="32" required [(ngModel)]="event.eventContact"
                                               placeholder="Contact for event" #eventContact="ngModel"/>

										Event Content *

                                            <input type="text" class="form-control" id="eventContent" name="eventContent" maxlength="32" required [(ngModel)]="event.eventContent"
                                                   placeholder="Event Info" #eventContent="ngModel"/>

                                       <button class="btn btn-success" type="submit" [disabled]="createEventForm.invalid"> Submit</button>
                                        <button class="btn btn-warning" type="reset"> Reset</button>

                </form>


text:
#import <UIKit/UIKit.h>

@interface PushNotificationViewController : UITableViewController

@end


text:
import { TreeOption } from '../../models/tree-option';
import { Component, OnInit } from '@angular/core';
import { OptionsService } from '../../../services/options.service';

@Component({
  selector: 'rcos-sidenav-option-list',
  templateUrl: './sidenav-option-list.component.html',
  styleUrls: ['./sidenav-option-list.component.css']
})
export class SidenavOptionListComponent implements OnInit {

  constructor(private optionservice: OptionsService) { }

  ngOnInit() {
  }

  onExpand(option: TreeOption) {
    option.isexpanded = true;
    console.log('expand hit');
  }

   onCollapse(option: TreeOption) {
    option.isexpanded = false;
    console.log('collapse hit..');
  }
}


text:
<!DOCTYPE html>
<html>
  <head>
    <!-- // [TEMPLATE header_full] -->

    <!-- // [START ms-specific] -->
    <!-- IE Specific to remove tap highlight -->
    <meta name="msapplication-tap-highlight" content="no" />
    <!-- // [END ms-specific] -->

    <title>Web Essential: States Example</title>

    <link href='http://fonts.googleapis.com/css?family=Roboto:400,300' rel='stylesheet' type='text/css'>

    <style>
      body {
        background-color: #d3e2fc;

        margin: 32px;

        font-family: 'Roboto', sans-serif;
        color: #ecf0f1;
      }

      a {
        color: #ecf0f1;
      }

      button {
        display: block;

        width: 100%;
        max-width: 400px;

        padding: 16px;
        margin: 0 auto 16px auto;

        box-sizing: border-box;

        border-style: none;
        border-radius: 6px;

        color: inherit;
        font-family: inherit;
        font-size: inherit;
        text-align:center;
        text-decoration: none;

        -moz-user-select: none;
        -webkit-user-select: none;
        -ms-user-select: none;
        user-select: none;
      }
      /* // [START btnstates] */
      .btn {
        background-color: #4285f4;
      }

      .btn:hover {
        background-color: #296CDB;
      }

      .btn:focus {
        background-color: #0F52C1;

        /* The outline parameter surpresses the border
        color / outline when focused */
        outline: 0;
      }

      .btn:active {
        background-color: #0039A8;
      }
      /* // [END btnstates] */

      /* // [START webkit-specific] */
      /* Webkit / Chrome Specific CSS to remove tap
      highlight color */
      .btn {
        -webkit-tap-highlight-color: transparent;
      }
      /* // [END webkit-specific] */

      /* // [START ff-specific] */
      /* Firefox Specific CSS to remove button
      differences and focus ring */
      .btn {
        background-image: none;
      }

      .btn::-moz-focus-inner {
        border: 0;
      }
      /* // [END ff-specific] */
    </style>
  </head>

  <body>
    <button class="btn" tabindex="1">Button 1</button>

    <button class="btn hover" tabindex="2">Button 2</button>

    <button class="btn active" tabindex="3">Button 3</button>

    <button class="btn focus" tabindex="4">Button 4</button>

    <!-- // [TEMPLATE footer] -->
  </body>
</html>


text:
export KEYSTONE_XORG=1

# TODO: Export a default login manager.

_window_manager__chroot() {
    # Install the required packages.
    _install 'awesome'

    # Setup initial configuration for awesome.
    mkdir -p /home/$KEYSTONE_USERNAME/.config/awesome/
    cp /etc/xdg/awesome/rc.lua /home/$KEYSTONE_USERNAME/.config/awesome/
}


text:
package repetition.exercises.solutions.array;

import java.util.ArrayList;
import java.util.Arrays;

public class Exercise21 {
	public static void main(String[] args) {
		ArrayList<String> list = new ArrayList<String>();

		list.add("Python");
		list.add("Java");
		list.add("PHP");
		list.add("C#");
		list.add("C++");
		list.add("Perl");

		String[] myArray = new String[list.size()];

		list.toArray(myArray);

		for (String string : myArray) {
			System.out.println(string);
		}
	}
}


text:
<?php

namespace Pimcore\Model\Document\Tag;

use Pimcore\Model;

class Checkbox extends Model\Document\Tag {

    /**
     * Contains the checkbox value
     *
     * @var boolean
     */
    public $value = false;

    /**
     * @see Document\Tag\TagInterface::getType
     * @return string
     */
    public function getType() {
        return "checkbox";
    }

    /**
     * @see Document\Tag\TagInterface::getData
     * @return mixed
     */
    public function getData() {
        return $this->value;
    }

    /**
     * @see Document\Tag\TagInterface::frontend
     * @return string
     */
    public function frontend() {
        return $this->value;
    }

    /**
     * @see Document\Tag\TagInterface::setDataFromResource
     * @param mixed $data
     * @return void
     */
    public function setDataFromResource($data) {
        $this->value = $data;
        return $this;
    }

    /**
     * @see Document\Tag\TagInterface::setDataFromEditmode
     * @param mixed $data
     * @return void
     */
    public function setDataFromEditmode($data) {
        $this->value = $data;
        return $this;
    }

    /**
     * @return boolean
     */
    public function isEmpty() {
        return $this->value;
    }

    /**
     * @return boolean
     */
    public function isChecked() {
        return $this->isEmpty();
    }

    /**
     * @param Model\Document\Webservice\Data\Document\Element $wsElement
     * @param null $idMapper
     * @throws \Exception
     */
    public function getFromWebserviceImport($wsElement, $idMapper = null){
       $data = $wsElement->value;
       if($data->bool === null or is_bool($data)){
            $this->value = (bool) $data->value;
       } else {
           throw new \Exception("cannot get values from web service import - invalid data");
       }
    }
}