text:
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;

namespace ytd.PlayList
{
    internal class PlayListManager
    {
        private List<VideoItem> _playList;

        internal IList<VideoItem> PlayList
        {
            get { return _playList; }
        }

        public PlayListManager()
        {
            _playList = new List<VideoItem>();
        }

        /// <summary>
        ///  Regular expression built for C# on: lun, apr 29, 2013, 05:52:28
        ///  Using Expresso Version: 3.0.3634, http://www.ultrapico.com
        ///
        ///  A description of the regular expression:
        ///
        ///  Match expression but don't capture it. [http://www.youtube.com/playlist\?&?list=]
        ///      http://www.youtube.com/playlist\?&?list=
        ///          http://www
        ///          Any character
        ///          youtube
        ///          Any character
        ///          com/playlist
        ///          Literal ?
        ///          &, zero or one repetitionslist=
        ///  [Pid]: A named capture group. [.+]
        ///      Any character, one or more repetitions
        ///  &, zero or one repetitions
        ///
        ///
        /// </summary>
        private static Regex regexPlayList = new Regex(
              "(?:http://www.youtube.com/playlist\\?&?list=)(?<Pid>.+)&?",
            RegexOptions.CultureInvariant
            | RegexOptions.Compiled
            );

        public void Fetch(string url)
        {
            _playList.Clear();

            Match m = regexPlayList.Match(url);
            if ( m.Success && m.Groups[1].Success )
            {
                string feedUrl = string.Concat("http://gdata.youtube.com/feeds/api/playlists/", m.Groups[1].Value);
                RssManager rm = new RssManager(feedUrl);
                _playList.AddRange(rm.GetFeed());
            }
        }

        public void Save(string fileName, bool full = true)
        {
            using ( StreamWriter sw = new StreamWriter(fileName, false, Encoding.UTF8) )
            {
                foreach ( var video in _playList )
                {
                    if ( full )
                    {
                        sw.WriteLine("Title: {0}", video.Title);
                        sw.WriteLine("Description: {0}", video.Description);
                        sw.WriteLine("Author: {0}", video.Author);
                        sw.WriteLine("Date: {0}", video.Date);
                        sw.WriteLine("Link: {0}", video.Link);
                        sw.WriteLine();
                    }
                    else
                    {
                        sw.WriteLine(video.Link);
                    }
                }
            }
        }
    }
}


text:
<!-- Copyright (C) 2010 Julien SMADJA <julien dot smadja at gmail dot com>
	- Arnaud LEMAIRE <alemaire at norad dot fr> Licensed under the Apache License,
	Version 2.0 (the "License"); you may not use this file except in compliance
	with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
	Unless required by applicable law or agreed to in writing, software distributed
	under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
	OR CONDITIONS OF ANY KIND, either express or implied. See the License for
	the specific language governing permissions and limitations under the License. -->

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>

	<groupId>net.awired.visuwall</groupId>
	<artifactId>visuwall-hudsonclient</artifactId>
	<name>Visuwall - Hudson Client</name>

	<parent>
		<groupId>net.awired.visuwall</groupId>
		<artifactId>visuwall</artifactId>
		<version>0.0.1-SNAPSHOT</version>
		<relativePath>../</relativePath>
	</parent>

	<dependencies>
		<dependency>
			<groupId>net.awired.visuwall</groupId>
			<artifactId>visuwall-api</artifactId>
		</dependency>

		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.8.1</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>com.google.guava</groupId>
			<artifactId>guava</artifactId>
			<version>r07</version>
		</dependency>
		<dependency>
			<groupId>com.sun.jersey</groupId>
			<artifactId>jersey-client</artifactId>
			<version>1.4</version>
		</dependency>
		<dependency>
			<groupId>ch.qos.logback</groupId>
			<artifactId>logback-classic</artifactId>
			<version>0.9.26</version>
		</dependency>
<!--		<dependency>-->
<!--			<groupId>org.slf4j</groupId>-->
<!--			<artifactId>slf4j-api</artifactId>-->
<!--			<version>1.6.1</version>-->
<!--		</dependency>-->
		<dependency>
			<groupId>joda-time</groupId>
			<artifactId>joda-time</artifactId>
			<version>1.6.2</version>
		</dependency>
		<dependency>
			<groupId>xerces</groupId>
			<artifactId>xercesImpl</artifactId>
			<version>2.9.1</version>
		</dependency>
		<dependency>
			<groupId>net.sf.ehcache</groupId>
            <artifactId>ehcache-core</artifactId>
			<version>2.3.1</version>
		</dependency>
	</dependencies>

	<build>
		<plugins>
			<!--
			<plugin>
				<groupId>com.mycila.maven-license-plugin</groupId>
				<artifactId>maven-license-plugin</artifactId>
				<version>1.8.0</version>
				<configuration>
					<header>src/main/licence.txt</header>
					<strictCheck>true</strictCheck>
					<useDefaultExcludes>false</useDefaultExcludes>
					<excludes>
						<exclude>.gitignore</exclude>
						<exclude>.git/**</exclude>
						<exclude>target/**</exclude>
						<exclude>.settings/**</exclude>
						<exclude>.project</exclude>
						<exclude>.classpath</exclude>
						<exclude>LICENCE</exclude>
						<exclude>README</exclude>
						<exclude>**/MANIFEST.MF</exclude>
						<exclude>.externalToolBuilders/**</exclude>
						<exclude>.pmd/**</exclude>
						<exclude>src/test/resources/**</exclude>
						<exclude>src/main/xsd/**</exclude>
						<exclude>src/main/java/com/jsmadja/wall/hudsonclient/generated/**</exclude>
					</excludes>
					<executions>
						<execution>
							<goals>
								<goal>check</goal>
							</goals>
						</execution>
					</executions>
				</configuration>
			</plugin> -->
		</plugins>
	</build>

</project>

redpajama_set_name: RedPajamaGithub


text:
<Module>
	<Texture>LaserCannonRed_1x6</Texture>
	<SizeX>1</SizeX>
	<SizeY>6</SizeY>

	<ProductionCost>6</ProductionCost>
	<AlloyCost>6</AlloyCost>

	<Health>840</Health>
	<Mass>6</Mass>
	<Power>15</Power>
	<PowerStorage>246</PowerStorage>
	<RequiredCrew>15</RequiredCrew>

	<Weapon>LaserCannonRed4</Weapon>
</Module>


text:
""" Unit tests cases.

	Copyright (c) 2004 Colin Stewart (http://www.owlfish.com/)
	All rights reserved.

	Redistribution and use in source and binary forms, with or without
	modification, are permitted provided that the following conditions
	are met:
	1. Redistributions of source code must retain the above copyright
	   notice, this list of conditions and the following disclaimer.
	2. Redistributions in binary form must reproduce the above copyright
	   notice, this list of conditions and the following disclaimer in the
	   documentation and/or other materials provided with the distribution.
	3. The name of the author may not be used to endorse or promote products
	   derived from this software without specific prior written permission.

	THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
	IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
	OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
	IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
	INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
	NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
	DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
	THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
	(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
	THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

	If you make any bug fixes or feature enhancements please let me know!

"""

try:
	import logging
except:
	from simpletal import DummyLogger as logging

from pubtal import SiteUtils
import updateSite

import unittest, copy, os.path

if __name__ == '__main__':
	logging.basicConfig()

root = logging.getLogger()
root.setLevel (logging.WARN)

TEMPLATE1 = '

'
CONTENT1 = """title: Test1

This is the first test.  It has spaces.

And a paragraph.

1
2
3

So there, jimmy lad!"""
CONFIG1 = ""
RESULT1 = {'index.html': """
Test1

This is the first test.  It has spaces.

And a paragraph.

1

2

3

So there, jimmy lad!

"""}

# Test 2
CONFIG2 = """<Content>
preserve-html-spaces 0
</Content>"""

RESULT2 = {'index.html': """
Test1

This is the first test.  It has spaces.

And a paragraph.

1

2

3

So there, jimmy lad!

"""}

# XHTML version
CONFIG3 = """<Template>
output-type XHTML
</Template>"""

RESULT3 = {'index.html': """<?xml version="1.0" encoding="iso-8859-15"?>

Test1

This is the first test.  It has spaces.

And a paragraph.

1

2

3

So there, jimmy lad!

"""}

class PreserveSpacesTests (unittest.TestCase):
	def setUp (self):
		self.site = SiteUtils.SiteBuilder()
		self.site.buildDirs()

	def tearDown (self):
		self.site.destroySite()
		pass

	def _runTest_ (self, expectedResult, configFile=None):
		if (configFile is None):
			conf = os.path.join (self.site.getSiteDir(), "test.config")
		else:
			conf = configFile
		update = updateSite.UpdateSite (conf, None, ui=SiteUtils.SilentUI())
		update.buildSite()
		comp = SiteUtils.DirCompare()
		res = comp.compare (self.site.getDestDir(), expectedResult)
		self.failUnless (res is None, res)

	def testDefaultConfiguration (self):
		self.site.createTemplate ('template.html', TEMPLATE1)
		self.site.createContent ('index.txt', CONTENT1)
		self.site.createConfigFile ('test.config', CONFIG1)
		self._runTest_ (RESULT1)

	def testNotPreserveSpaces (self):
		self.site.createTemplate ('template.html', TEMPLATE1)
		self.site.createContent ('index.txt', CONTENT1)
		self.site.createConfigFile ('test.config', CONFIG2)
		self._runTest_ (RESULT2)

	def testPreserveSpacesXHTML (self):
		self.site.createTemplate ('template.html', TEMPLATE1)
		self.site.createContent ('index.txt', CONTENT1)
		self.site.createConfigFile ('test.config', CONFIG3)
		self._runTest_ (RESULT3)

if __name__ == '__main__':
	unittest.main()


text:
package org.apache.derbyTesting.functionTests.tests.jdbcapi;

import java.io.File;
import java.io.UnsupportedEncodingException;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.ArrayList;
import javax.sql.ConnectionPoolDataSource;
import javax.sql.PooledConnection;
import javax.sql.XAConnection;
import javax.sql.XADataSource;

import junit.framework.Test;

import org.apache.derbyTesting.junit.BaseJDBCTestCase;
import org.apache.derbyTesting.junit.J2EEDataSource;
import org.apache.derbyTesting.junit.TestConfiguration;

public class InternationalConnectTest extends BaseJDBCTestCase {

    /**
     * Test connecting with multibyte characters in:
     * - Database name
     * - User
     * - Password
     *
     * Currently just throws an exception for client.
     * Works ok for embedded.
     *
     * This test tests DriverManager, XADataSource and ConnectionPoolDataSource
     * and is not run with J2ME.  Simple DataSource is tested with
     * InternationalConnectSimpleDSTest
     *
     */

    /* Keep track of the databases created in the fixtures to cleanup in tearDown() */
    private ArrayList databasesForCleanup;

    /**
     * @param name
     */
    public InternationalConnectTest(String name) {
        super(name);

        databasesForCleanup = new ArrayList();
    }

    public void testBoundaries() throws SQLException, UnsupportedEncodingException {
        if (usingEmbedded()) return; /* This test is only for Client/Server */

        /*
         * Sun's 1.4.2 JVM and IBM's JVM (any version) fail on Windows for this test
         * Thus, we skip it.
         *
         * Read JIRA's DERBY-4836 for more information.
         */
        if (getSystemProperty("os.name").startsWith("Windows")) {
            /* Skip with IBM */
            if (isIBMJVM()) return;

            /* Skip with Sun 1.4.2 */
            if (isSunJVM() && getSystemProperty("java.version").startsWith("1.4.2")) return;
        }

        /*
         * IBM's jvms on iseries have a bug that causes this fixture to fail
         * and leave behind a hard-to-remove file, see DERBY-4149.
         * Skip on that O.S.
         */
        if (getSystemProperty("os.name").startsWith("OS/400")) {
            return;
        }

        // Maximum length in bytes is 255. We subtract 14 to account for
        // ;create=true and ;shutdown=true
        int maxNameLength = 255 - 14;

        /**
         * \u0041 is the letter 'A' (1 byte)
         * \u00e7 is the letter 'c' with a cedilla (2 bytes)
         * \u4310 is a Chinese character (3 bytes)
         * \u1f030 is a domino tile (4 bytes)
         */
        String[] testCharacters = {"\u0041", "\u00e7", "\u4e10", "\u1f030"};

        for (int ch=0; ch<testCharacters.length; ch++) {
            StringBuffer dbName = new StringBuffer();

            /* max length in bytes divided by length of 1 chinese char */
            int maxChars = maxNameLength / testCharacters[ch].getBytes("UTF-8").length;
            for(int i=0; i<maxChars; i++) {
                dbName.append(testCharacters[ch]);
            }

            /* This time it should work as we're right at the limit */
            String url = TestConfiguration
                    .getCurrent().getJDBCUrl(dbName.toString()+ ";create=true");

            Connection conn = DriverManager.getConnection(url);
            conn.close();

            /* Add the database name for cleanup on tearDown() */
            databasesForCleanup.add(dbName.toString());

            /* Append three more characters to make it fail */
            for (int i = 0; i < 3; i++) {
                dbName.append(testCharacters[ch]);
            }

            url = TestConfiguration
                    .getCurrent().getJDBCUrl(dbName.toString()+ ";create=true");

            try {
                conn = DriverManager.getConnection(url);
                assertTrue("Used more characters than possible in database name",
                        false);
            } catch (SQLException e) {
                assertSQLState("08001", e); /* Check if it failed */
            }
        }
    }

    /**
     * Test Chinese character in database name, user and password, using
     * DriverManager methods.
     *
     * @throws SQLException
     */
    public void testDriverManagerConnect() throws SQLException {
        /*
         * IBM's jvms on iseries have a bug that causes this fixture to fail
         * and leave behind a hard-to-remove file, see DERBY-4149.
         * Skip on that O.S.
         */
        if (getSystemProperty("os.name").startsWith("OS/400")) {
            return;
        }

        //get a connection to load the driver
        getConnection();
        Connection conn = null;
        String url = null;

        //Test Chinese database name
        url = TestConfiguration.getCurrent().getJDBCUrl("\u4e10;create=true");

        conn = DriverManager.getConnection(url);
        conn.close();

        // Test Chinese user name
        url = TestConfiguration.getCurrent().getJDBCUrl("\u4e10;user=\u4e10");
        conn = DriverManager.getConnection(url);
        conn.close();

        // Test Chinese user name in parameter to getConnection
        url = TestConfiguration.getCurrent().getJDBCUrl("\u4e10");
        conn = DriverManager.getConnection(url,"\u4e10","pass");
        conn.close();

        // Test Chinese password in url
        url = TestConfiguration.getCurrent().getJDBCUrl("\u4e10;user=user;password=\u4e10");
        conn = DriverManager.getConnection(url);
        conn.close();

        // Test Chinese password in parameter to getConnection()
        url = TestConfiguration.getCurrent().getJDBCUrl("\u4e10");
        conn = DriverManager.getConnection(url,"\u4e10","\u4e10");
        conn.close();

        /* Add the created database for cleanup by tearDown() */
        databasesForCleanup.add("\u4e10");
    }

    /**
     * Test XA Connection for chinese database name, user and password.
     * @throws SQLException
     */
    public void testXADSConnect() throws SQLException {
        /*
         * IBM's jvms on iseries have a bug that causes this fixture to fail
         * and leave behind a hard-to-remove file, see DERBY-4149.
         * Skip on that O.S.
         */
        if (getSystemProperty("os.name").startsWith("OS/400")) {
            return;
        }

        // Test chinese database name.
        XADataSource ds = J2EEDataSource.getXADataSource();
        J2EEDataSource.setBeanProperty(ds, "databaseName", "\u4e10");
        J2EEDataSource.setBeanProperty(ds, "createDatabase", "create");

        XAConnection xaconn = ds.getXAConnection();
        Connection conn = xaconn.getConnection();
        conn.close();

        // Chinese user
        J2EEDataSource.setBeanProperty(ds, "user", "\u4e10");
        xaconn = ds.getXAConnection();
        conn = xaconn.getConnection();
        conn.close();

        // Chinese password
        J2EEDataSource.setBeanProperty(ds, "password", "\u4e10");
        xaconn = ds.getXAConnection();
        conn = xaconn.getConnection();
        conn.close();

        /* Add the created database for cleanup by tearDown() */
        databasesForCleanup.add("\u4e10");
    }

    /**
     * Test pooled connetion for chinese database name, user and password.
     * @throws SQLException
     */
    public void testCPDSConnect() throws SQLException {
        /*
         * IBM's jvms on iseries have a bug that causes this fixture to fail
         * and leave behind a hard-to-remove file, see DERBY-4149.
         * Skip on that O.S.
         */
        if (getSystemProperty("os.name").startsWith("OS/400")) {
            return;
        }

        // Test chinese database name.
        ConnectionPoolDataSource ds = J2EEDataSource.getConnectionPoolDataSource();
        J2EEDataSource.setBeanProperty(ds, "databaseName", "\u4e10");
        J2EEDataSource.setBeanProperty(ds, "createDatabase", "create");

        PooledConnection poolConn = ds.getPooledConnection();
        Connection conn = poolConn.getConnection();
        conn.close();

        // Chinese user
        J2EEDataSource.setBeanProperty(ds, "user", "\u4e10");
        poolConn = ds.getPooledConnection();
        conn = poolConn.getConnection();
        conn.close();

        // Chinese password
        J2EEDataSource.setBeanProperty(ds, "password", "\u4e10");
        poolConn= ds.getPooledConnection();
        conn = poolConn.getConnection();
        conn.close();

        /* Add the created database for cleanup by tearDown() */
        databasesForCleanup.add("\u4e10");
    }

    /**
     * Regression test case for DERBY-4799. Attempting to connect to a
     * database that doesn't exist used to cause a protocol error between
     * the network server and the client. This only happened if the
     * database name was at least 18 characters and the name contained at
     * least one non-ascii character.
     */
    public void testFailureOnNonExistentDatabase() throws SQLException {

        String url = TestConfiguration.getCurrent().getJDBCUrl(
                "abcdefghijklmnopq\u00E5");
        try {
            // This call used to fail with a protocol error with the
            // client driver. Check that it fails gracefully now.
            DriverManager.getConnection(url);
            fail(url + " should not exist");
        } catch (SQLException sqle) {
            // Embedded responds with XJ004 - database not found.
            // Client responds with 08004 - connection refused because
            // the database was not found.
            String expected = usingEmbedded() ? "XJ004" : "08004";
            assertSQLState(expected, sqle);
        }
    }

    public void tearDown() throws SQLException {
        /* Iterate through the databases for cleanup and delete them */
        for (int i=0; i<databasesForCleanup.size(); i++) {
            String shutdownUrl = TestConfiguration.getCurrent()
                                .getJDBCUrl(databasesForCleanup.get(i) + ";shutdown=true");
            try {
                DriverManager.getConnection(shutdownUrl);
                fail("Database didn't shut down");
            } catch (SQLException se) {
                // ignore shutdown exception
                assertSQLState("08006", se);
            }
            removeDirectory(getSystemProperty("derby.system.home") +  File.separator +
                    databasesForCleanup.get(i));
        }

        /* Clear the array list as new fixtures will add other databases */
        databasesForCleanup.clear();
    }

    public static Test suite() {
        return TestConfiguration.defaultSuite(InternationalConnectTest.class);
    }

}


text:
layout: page
title: Montoya Electronics Conference
date: 2016-05-24
author: Alexander Hurley
tags: weekly links, java
status: published
summary: Vestibulum ante ipsum primis in faucibus orci.
banner: images/banner/meeting-01.jpg
booking:
  startDate: 12/17/2017
  endDate: 12/20/2017
  ctyhocn: CONTNHX
  groupCode: MEC
published: true
---
Maecenas malesuada dolor id est malesuada ultrices. Ut quam libero, tincidunt et justo non, venenatis tincidunt libero. Curabitur consequat eros feugiat, sodales dui eget, tincidunt sem. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Cras tincidunt bibendum sem id accumsan. Donec vulputate semper odio, non convallis metus consectetur at. Nam ac libero vel mauris ultrices imperdiet quis eget ante. Mauris sed accumsan metus.

* Phasellus laoreet nibh nec aliquet tempor
* Donec at ligula sodales, pellentesque nunc non, consequat est
* Aenean in dolor rhoncus, scelerisque leo in, ullamcorper mauris
* Suspendisse hendrerit massa eu elit pulvinar maximus
* Integer consectetur lacus ac cursus condimentum
* Praesent hendrerit lorem id auctor dapibus.

Ut rhoncus ligula at turpis ultricies, id pellentesque quam posuere. Donec in dui tempor massa maximus sagittis quis nec arcu. Mauris id nisl id neque vulputate fringilla eget ut odio. Phasellus nec lacus sem. Cras tincidunt dapibus eleifend. Vivamus efficitur, diam a dapibus efficitur, justo dui facilisis dui, nec laoreet lacus mauris et erat. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin quis hendrerit leo, ac tincidunt lorem. Mauris venenatis eleifend purus, in vestibulum orci lacinia sit amet. Sed sagittis nisi ut augue egestas, id malesuada diam molestie. In a placerat nisi. In vulputate odio scelerisque neque faucibus dignissim. Nulla mattis venenatis sagittis. Mauris vitae mi sed ante blandit viverra. Nunc eget mi at leo sodales tincidunt. Phasellus posuere, dui quis vestibulum imperdiet, lorem urna consectetur velit, ut dapibus quam libero ac eros.
Fusce ut aliquam arcu, quis congue sapien. Aenean vitae felis quis dolor pellentesque dignissim. Etiam quis enim tincidunt quam sagittis vestibulum sit amet nec arcu. Nulla gravida metus ac nulla rhoncus faucibus mattis vel eros. Nam arcu urna, congue a purus at, ultricies congue orci. Cras suscipit, eros nec consequat elementum, ipsum est elementum lectus, et porta tellus leo ut diam. Etiam hendrerit, ex ut varius aliquam, elit lectus mattis neque, sed venenatis quam augue malesuada metus.


text:
title: Disponible NVDA 2019.3.1
permalink: "/nvda-2019-3/"
layout: post
author: Noelia
---

<footer>Lunes, 10 de febrero de 2020</footer>

Como se explica en esta [noticia de NV Access sobre NVDA 2019.3.1](https://www.nvaccess.org/post/nvda-2019-3-released/), se ha publicado esta nueva versión estable de NVDA.

La versión 2019.3.1 es una actualización de NVDA 2019.3, también publicada hoy, con traducciones actualizadas.

La infraestructura de NVDA 2019.3 incluye muchos cambios, como la actualización de Python 2 a Python 3 (necesaria por motivos de seguridad) y modificaciones significativas del subsistema responsable del habla (que pueden facilitar innovaciones interesantes).

Otros cambios destacados incluyen el soporte de 64 bits para máquinas virtuales Java, cortina de pantalla y ayudas visuales como el resaltado del foco, nuevo visualizador braille y más pantallas braille admitidas, y la corrección de muchos errores.

Puedes descargar la última versión de NVDA desde la [página de descarga en el sitio de NV Access](https://www.nvaccess.org/download/).

NV Access recuerda que es buena idea reiniciar el PC después de actualizar cualquier software, ya que las actualizaciones pueden modificar archivos en uso y esto puede ocasionar problemas que se resuelven al reiniciar.

Para ayuda en español sobre NVDA o el procedimiento de descarga, consulta la [página Ayuda y descarga](https://nvdaes.github.io/ayuda/) disponible en esta web.


text:
package util

import (
	"errors"
	"io/ioutil"
	"os"
	"path/filepath"
	"strings"
	"text/template"
)

// FileExists determines if path exists
func FileExists(filename string) bool {
	_, err := os.Stat(filename)
	return !os.IsNotExist(err)
}

// PackageName determines the package name from sourceFile if it is within $GOPATH
func PackageName(sourceFile string) (string, error) {
	if filepath.Ext(sourceFile) != ".go" {
		return "", errors.New("sourcefile must end with .go")
	}
	sourceFile, err := filepath.Abs(sourceFile)
	if err != nil {
		Panic("Could not convert to absolute path: %s", sourceFile)
	}

	gopath := os.Getenv("GOPATH")
	if gopath == "" {
		return "", errors.New("Environment variable GOPATH is not set")
	}
	paths := strings.Split(gopath, string(os.PathListSeparator))
	for _, path := range paths {
		srcDir := filepath.Join(path, "src")
		srcDir, err := filepath.Abs(srcDir)
		if err != nil {
			continue
		}

		//log.Printf("srcDir %s sourceFile %s\n", srcDir, sourceFile)
		rel, err := filepath.Rel(srcDir, sourceFile)
		if err != nil {
			continue
		}
		return filepath.Dir(rel), nil
	}
	return "", errors.New("sourceFile not reachable from GOPATH")
}

// Template reads a go template and writes it to dist given data.
func Template(src string, dest string, data map[string]interface{}) {
	content, err := ioutil.ReadFile(src)
	if err != nil {
		Panic("template", "Could not read file %s\n%v\n", src, err)
	}

	tpl := template.New("t")
	tpl, err = tpl.Parse(string(content))
	if err != nil {
		Panic("template", "Could not parse template %s\n%v\n", src, err)
	}

	f, err := os.Create(dest)
	if err != nil {
		Panic("template", "Could not create file for writing %s\n%v\n", dest, err)
	}
	defer f.Close()
	err = tpl.Execute(f, data)
	if err != nil {
		Panic("template", "Could not execute template %s\n%v\n", src, err)
	}
}


text:
package org.apache.ode.bpel.engine;

import java.util.Map;

import javax.wsdl.Fault;
import javax.wsdl.Operation;
import javax.xml.namespace.QName;

import org.apache.axiom.om.OMElement;
import org.apache.axis2.util.XMLUtils;
import org.apache.ode.bpel.engine.fc.FragmentCompositionAPI;
import org.apache.ode.bpel.iapi.Message;
import org.apache.ode.bpel.iapi.MyRoleMessageExchange;
import org.apache.ode.il.DynamicService;
import org.apache.ode.utils.fc.FCConstants;
import org.apache.xerces.dom.DocumentImpl;
import org.w3c.dom.Document;
import org.w3c.dom.Element;

/**
 *
 * @author Alex Hummel
 *
 */
public class FragmentCompositionResponse {
	private Operation operation;
	private MyRoleMessageExchange mex;
	private DynamicService<FragmentCompositionAPI> service;
	private String namespace;
	protected Runnable onSuccess;

	public FragmentCompositionResponse(Operation operation, String namespace,
			MyRoleMessageExchange mex,
			DynamicService<FragmentCompositionAPI> service) {
		this.operation = operation;
		this.mex = mex;
		this.service = service;
		this.namespace = namespace;
		onSuccess = null;
	}

	public void returnValue(Object value) {
		if (operation != null) {
			javax.wsdl.Message wsdlOutMess = operation.getOutput().getMessage();
			QName outMessageName = wsdlOutMess.getQName();
			Message odeResponse = mex.createMessage(outMessageName);

			OMElement result = service.convertResponse(operation.getName(),
					namespace, value);
			if (result != null) {
				try {
					odeResponse.setMessage(XMLUtils.toDOM(result));
				} catch (Exception e) {
					throwException(e);
				}
			}

			if (onSuccess != null) {
				onSuccess.run();
			}
			((MyRoleMessageExchangeImpl) mex).setResponse(odeResponse);
			((MyRoleMessageExchangeImpl) mex).responseReceived();

		}
	}

	public void throwException(Exception e) {
		if (operation != null) {
			Map faults = operation.getFaults();
			Fault fault = null;
			String message;
			if (e.getCause() != null) {
				fault = (Fault) faults.get(e.getCause().getClass()
						.getSimpleName());
				message = e.getCause().getMessage();
			} else {
				fault = (Fault) faults.get(e.getClass().getSimpleName());
				message = e.getMessage();
			}
			if (fault != null) {

				MyRoleMessageExchangeImpl mexImpl = (MyRoleMessageExchangeImpl) mex;
				QName faultMessageName = new QName(
						FCConstants.FC_TARGET_NAMESPACE, fault.getName());
				Message odeResponse = mex.createMessage(faultMessageName);

				Document xmldoc = new DocumentImpl();
				Element response = xmldoc.createElement("message");
				response.setTextContent(message);
				odeResponse.setMessage(response);

				mexImpl.setFault(faultMessageName, odeResponse);
				((MyRoleMessageExchangeImpl) mex).responseReceived();

			}
		}
	}

	public void setOnSuccessAction(Runnable onSuccess) {
		this.onSuccess = onSuccess;
	}
}


text:
/*
 * 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.
 */
package com.plan.persistencia.registrousuarios.daos;

import com.plan.persistencia.registrousuarios.modelos.Usuario;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;

/**
 *
 * @author usuario
 */
public class UsuarioDao {

    private final SessionFactory emf;

    public UsuarioDao(SessionFactory emf) {
        this.emf = emf;
    }

    public Integer contarUsuarios() {
        Session em = emf.getCurrentSession();
        em.getTransaction().begin();
        Integer n = em.createQuery("from Usuario").list().size();
        em.getTransaction().commit();
        return n;
    }

    public Usuario guardarUsuario(Usuario u) {
        Session em = emf.getCurrentSession();
        em.getTransaction().begin();
        em.persist(u);
        em.getTransaction().commit();
        return u;
    }

    public Boolean existe(Usuario usuario) {
        final String orden = "from Usuario u where u.nombre = :nombre and u.clave= :clave";
        Session em = emf.getCurrentSession();
        em.getTransaction().begin();
        Query q = em.createQuery(orden);
        q.setParameter("nombre", usuario.getNombre());
        q.setParameter("clave", usuario.getClave());
        Boolean n = !q.list().isEmpty();
        em.getTransaction().commit();
        return n;
    }

}


text:
Experiment
==========

.. automodule:: stratagemtools.experiment
   :members:


text:
package golog

import (
	"bytes"
	"fmt"
	"io"
	"sync"
	"time"

	"github.com/alexcesaro/log"
)

// A Logger represents an active logging object that generates lines of output
// to an io.Writer. Each logging operation makes a single call to the Writer's
// Write method. A Logger can be used simultaneously from multiple goroutines;
// it guarantees to serialize access to the Writer.
type Logger struct {
	out             io.Writer
	threshold       log.Level
	writeMutex      sync.Mutex
	Formatter       func(*bytes.Buffer, log.Level, ...interface{})
	Writer          func(io.Writer, []byte, log.Level)
	bufferList      *buffer
	bufferListMutex sync.Mutex
}

// New creates a new Logger. The out variable sets the destination to which log
// data will be written. The threshold variable defines the level under which
// logging will be ignored.
func New(out io.Writer, threshold log.Level) *Logger {
	return &Logger{
		out:       out,
		threshold: threshold,
		Formatter: defaultFormater,
		Writer:    defaultWriter,
	}
}

// Emergency logs with an emergency level.
func (logger *Logger) Emergency(args ...interface{}) {
	logger.output(log.Emergency, args...)
}

// Emergencyf logs with an emergency level.
// Arguments are handled in the manner of fmt.Printf.
func (logger *Logger) Emergencyf(format string, args ...interface{}) {
	logger.output(log.Emergency, fmt.Sprintf(format, args...))
}

// Alert logs with an alert level.
func (logger *Logger) Alert(args ...interface{}) {
	logger.output(log.Alert, args...)
}

// Alertf logs with an alert level.
// Arguments are handled in the manner of fmt.Printf.
func (logger *Logger) Alertf(format string, args ...interface{}) {
	logger.output(log.Alert, fmt.Sprintf(format, args...))
}

// Critical logs with a critical level.
func (logger *Logger) Critical(args ...interface{}) {
	logger.output(log.Critical, args...)
}

// Criticalf logs with a critical level.
// Arguments are handled in the manner of fmt.Printf.
func (logger *Logger) Criticalf(format string, args ...interface{}) {
	logger.output(log.Critical, fmt.Sprintf(format, args...))
}

// Error logs with an error level.
func (logger *Logger) Error(args ...interface{}) {
	logger.output(log.Error, args...)
}

// Errorf logs with an error level.
// Arguments are handled in the manner of fmt.Printf.
func (logger *Logger) Errorf(format string, args ...interface{}) {
	logger.output(log.Error, fmt.Sprintf(format, args...))
}

// Warning logs with a warning level.
func (logger *Logger) Warning(args ...interface{}) {
	logger.output(log.Warning, args...)
}

// Warningf logs with a warning level.
// Arguments are handled in the manner of fmt.Printf.
func (logger *Logger) Warningf(format string, args ...interface{}) {
	logger.output(log.Warning, fmt.Sprintf(format, args...))
}

// Notice logs with a notice level.
func (logger *Logger) Notice(args ...interface{}) {
	logger.output(log.Notice, args...)
}

// Noticef logs with a notice level.
// Arguments are handled in the manner of fmt.Printf.
func (logger *Logger) Noticef(format string, args ...interface{}) {
	logger.output(log.Notice, fmt.Sprintf(format, args...))
}

// Info logs with an info level.
func (logger *Logger) Info(args ...interface{}) {
	logger.output(log.Info, args...)
}

// Infof logs with an info level.
// Arguments are handled in the manner of fmt.Printf.
func (logger *Logger) Infof(format string, args ...interface{}) {
	logger.output(log.Info, fmt.Sprintf(format, args...))
}

// Debug logs with a debug level.
func (logger *Logger) Debug(args ...interface{}) {
	logger.output(log.Debug, args...)
}

// Debugf logs with a debug level.
// Arguments are handled in the manner of fmt.Printf.
func (logger *Logger) Debugf(format string, args ...interface{}) {
	logger.output(log.Debug, fmt.Sprintf(format, args...))
}

// Log logs at the level passed in argument.
func (logger *Logger) Log(level log.Level, args ...interface{}) {
	logger.output(level, args...)
}

// Logf logs at the level passed in argument.
// Arguments are handled in the manner of fmt.Printf.
func (logger *Logger) Logf(level log.Level, format string, args ...interface{}) {
	logger.output(level, fmt.Sprintf(format, args...))
}

// LogEmergency returns true if the log level is at emergency or lower.
func (logger *Logger) LogEmergency() bool {
	return logger.threshold >= log.Emergency
}

// LogAlert returns true if the log level is at alert or lower.
func (logger *Logger) LogAlert() bool {
	return logger.threshold >= log.Alert
}

// LogCritical returns true if the log level is at critical or lower.
func (logger *Logger) LogCritical() bool {
	return logger.threshold >= log.Critical
}

// LogError returns true if the log level is at error or lower.
func (logger *Logger) LogError() bool {
	return logger.threshold >= log.Error
}

// LogWarning returns true if the log level is at warning or lower.
func (logger *Logger) LogWarning() bool {
	return logger.threshold >= log.Warning
}

// LogNotice returns true if the log level is at notice or lower.
func (logger *Logger) LogNotice() bool {
	return logger.threshold >= log.Notice
}

// LogInfo returns true if the log level is at info or debug.
func (logger *Logger) LogInfo() bool {
	return logger.threshold >= log.Info
}

// LogDebug returns true only if the log level is at debug.
func (logger *Logger) LogDebug() bool {
	return logger.threshold >= log.Debug
}

// LogLevel returns true if the log level is at or below the level argument.
func (logger *Logger) LogLevel(level log.Level) bool {
	return logger.threshold >= level
}

// Close does nothing and is just here so that Logger satisfies the log.Logger
// interface.
func (logger *Logger) Close() error { return nil }

func (logger *Logger) output(level log.Level, args ...interface{}) {
	if level > logger.threshold {
		return
	}

	buffer := logger.getBuffer()
	logger.Formatter(&buffer.Buffer, level, args...)

	logger.writeMutex.Lock()
	logger.Writer(logger.out, buffer.Bytes(), level)
	logger.writeMutex.Unlock()

	logger.putBuffer(buffer)
}

var defaultFormater = func(buffer *bytes.Buffer, level log.Level, args ...interface{}) {
	addTimestamp(buffer)
	addLevel(buffer, level)
	addMessage(buffer, args...)
}

// Avoid Fprintf because it is expensive. Doing it manually is about six times
// faster and makes the entire call of a logging function to stdout two times
// faster.
func addTimestamp(buffer *bytes.Buffer) {
	now := now()
	year, month, day := now.Date()
	hour, minute, second := now.Clock()

	var tmp = new([23]byte)
	writeInt(tmp, 4, 0, year)
	tmp[4] = '-'
	writeInt(tmp, 2, 5, int(month))
	tmp[7] = '-'
	writeInt(tmp, 2, 8, day)
	tmp[10] = ' '
	writeInt(tmp, 2, 11, hour)
	tmp[13] = ':'
	writeInt(tmp, 2, 14, minute)
	tmp[16] = ':'
	writeInt(tmp, 2, 17, second)
	tmp[19] = '.'
	writeInt(tmp, 3, 20, now.Nanosecond()/1000000)
	buffer.Write(tmp[:])
}

// A custom tiny helper functions to print integers efficiently
const digits = "0123456789"

func writeInt(tmp *[23]byte, intLength, position, integer int) {
	for i := intLength - 1; i >= 0; i-- {
		tmp[position+i] = digits[integer%10]
		integer /= 10
	}
}

var levelPrefixes = []string{
	" EMERGENCY ",
	" ALERT ",
	" CRITICAL ",
	" ERROR ",
	" WARNING ",
	" NOTICE ",
	" INFO ",
	" DEBUG ",
}

func addLevel(buffer *bytes.Buffer, level log.Level) {
	buffer.WriteString(levelPrefixes[level])
}

func addMessage(buffer *bytes.Buffer, args ...interface{}) {
	fmt.Fprintln(buffer, args...)
}

var defaultWriter = func(out io.Writer, logLine []byte, level log.Level) {
	out.Write(logLine)
}

// Creating a bytes.Buffer is expensive so we will re-use existing ones.
type buffer struct {
	bytes.Buffer
	next *buffer
}

// getBuffer returns a new, ready-to-use buffer.
func (logger *Logger) getBuffer() *buffer {
	logger.bufferListMutex.Lock()
	b := logger.bufferList
	if b != nil {
		logger.bufferList = b.next
	}
	logger.bufferListMutex.Unlock()
	if b == nil {
		b = new(buffer)
	} else {
		b.next = nil
		b.Reset()
	}
	return b
}

// putBuffer returns a buffer to the list.
func (logger *Logger) putBuffer(b *buffer) {
	if b.Len() >= 256 {
		// Let big buffers die a natural death.
		return
	}
	logger.bufferListMutex.Lock()
	b.next = logger.bufferList
	logger.bufferList = b
	logger.bufferListMutex.Unlock()
}

// Stubbed out for testing.
var now = time.Now


text:
using FluentAssertions;
using JimBobBennett.JimLib.Events;
using NUnit.Framework;

namespace JimBobBennett.JimLib.Test.Events
{
    [TestFixture]
    public class EventArgsTest
    {
        [Test]
        public void ValueComesFromConstructor()
        {
            var args = new EventArgs<string>("FooBar");
            args.Value.Should().Be("FooBar");
        }
    }
}


text:
var hmm, cy;

var probs, graphWidth, numOfStates;
var arrows;
var observations, observationAlphabet;
var initialProbs;
var transitionProbabilities;
var observationProbabilities;
var numOfObservations;
var defaultNumberOfStates = 2;
var autoMode = true;
var currentCol = -1;
var animating = false;
var defaults;
var forwardMode = true;
var prevNodeRow = -1;
var prevNodeCol = -1;

var selectedStateCol;

$(function () { // on dom ready
    hmm = cytoscape({
        container: document.getElementById('hmm'),

        style: cytoscape.stylesheet()
            .selector('node')
            .css({
                'content': 'data(id)',
                'border-color': 'black',
                'font-size': 8,
                'width': 30,
                'height': 30,
                'text-valign': 'center',
                'text-halign': 'center'
            })
            .selector('edge')
            .css({
                'target-arrow-shape': 'triangle',
                'width': 2,
                'line-color': '#ddd',
                'target-arrow-color': '#ddd',
                'line-color': 'data(color)',
                'target-arrow-color': 'data(color)'
            })
            .selector(':selected')
            .css({
                'background-color': '#61bffc',
                'line-color': '#61bffc',
                'target-arrow-color': '#61bffc',
                'transition-property': 'background-color, line-color, target-arrow-color',
                'transition-duration': '0.5s'
            }),

        layout: {
            name: 'preset',
            directed: true,
            roots: '#a',
            padding: 10
        },
//                 userPanningEnabled: true
    });

    cy = cytoscape({
        container: document.getElementById('cy'),

        style: cytoscape.stylesheet()
            .selector('node')
            .css({
                'content': 'data(id)',
                'font-size': 8,
                'width': 30,
                'height': 30,
                'text-valign': 'center',
                'text-halign': 'center'
            })
            .selector('edge')
            .css({
                'target-arrow-shape': 'triangle',
                'width': 2,
                'line-color': '#ddd',
                'target-arrow-color': '#ddd'
            })
            .selector('.highlighted')
            .css({
                'background-color': '#61bffc',
                'width': 'mapData(weight, -10, 0, 10, 100)',
                'line-color': '#61bffc',
                'target-arrow-color': '#61bffc',
                'transition-property': 'background-color, line-color, target-arrow-color',
                'transition-duration': '0.5s'
            })
            .selector('.highlighted-node')
            .css({
                'content': 'data(prob)',
                'background-color': '#61bffc',
                'width': 'mapData(weight, -10, 0, 10, 100)',
                'height': 'mapData(weight, -10, 0, 10, 100)',
                'line-color': '#61bffc',
                'target-arrow-color': '#61bffc',
                'transition-property': 'background-color, line-color, target-arrow-color',
                'transition-duration': '0.5s'
            })
            .selector('.highlighted-edge')
            .css({
                'background-color': '#61bffc',
                'width': 'mapData(weight, 0, 30, 1, 30)',
                'line-color': '#61bffc',
                'target-arrow-color': '#61bffc',
                'transition-property': 'background-color, line-color, target-arrow-color',
                'transition-duration': '0.5s'
            })
            .selector('.viterbi-highlighted-node')
            .css({
                'background-color': '#e67e22',
                'line-color': '#e67e22',
                'target-arrow-color': '#e67e22',
                'transition-property': 'background-color, line-color, target-arrow-color',
                'transition-duration': '0.5s'
            })
            .selector('.viterbi-highlighted-edge')
            .css({
                'background-color': '#e67e22',
                'line-color': '#e67e22',
                'target-arrow-color': '#e67e22',
                'transition-property': 'background-color, line-color, target-arrow-color',
                'transition-duration': '0.5s'
            })
            .selector('.edge-with-info')
            .css({
                'background-color': '#2ecc71',
                'line-color': '#2ecc71',
                'target-arrow-color': '#2ecc71',
                'content': 'data(edgeLabel)',
                'font-size': 8
            })
            .selector(':selected')
            .css({
                'background-color': '#2ecc71',
                'line-color': '#2ecc71',
                'target-arrow-color': '#2ecc71',
                'transition-property': 'background-color, line-color, target-arrow-color',
                'transition-duration': '0.5s'
            }),

        layout: {
            name: 'preset',
            directed: true,
            roots: '#a',
            padding: 10
        },
        userPanningEnabled: true
    });

    hmm.on('select', 'node', {foo: 'bar'}, function (evt) {
//        console.log( evt.data.foo ); // 'bar'

        var node = evt.cyTarget;
        selectedStateCol = node.data('column');
        userSelectedNode(node);
        console.log('tapped ' + node.id());
    });

    hmm.on('unselect', 'node', {foo: 'bar'}, function (evt) {
//         console.log( evt.data.foo ); // 'bar'

        var node = evt.cyTarget;
        if (hmm.elements(":selected").length == 0) {
            userUnSelectedNode(node);
        }

        console.log('tapped ' + node.id());
    });

    cy.on('select', '.highlighted-node', {foo: 'bar'}, function (evt) {
        //        console.log( evt.data.foo ); // 'bar'
        //Remove higlighted edge class from all.
        cy.edges('.edge-with-info').removeClass('edge-with-info');
        var node = evt.cyTarget;
        selectedStateCol = node.data('column');

        document.getElementById("NodeCalcInfo").innerHTML = node.data('compLabel');

        edges = cy.edges("[target = '" + node.data().id + "']");
        edges.addClass('edge-with-info');
        console.log('tapped ' + node.id());
    });

    cy.on('unselect', '.highlighted-node', {foo: 'bar'}, function (evt) {
        //        console.log( evt.data.foo ); // 'bar'
        //Remove higlighted edge class from all.
        cy.edges('.edge-with-info').removeClass('edge-with-info');
    });

    document.getElementById("numberOfStatesInput").value = defaultNumberOfStates;
    numOfStates = defaultNumberOfStates;

    observations = ['a', 'b', 'c', 'd', 'e', 'a', 'c', 'e'];
    observationAlphabet = ['a', 'b', 'c', 'd', 'e'];
    numOfObservations = observations.length;

    document.getElementById("observationsInput").value = observations.join(',');
    document.getElementById("observationAlphabet").value = observationAlphabet.join(',');

    defaults = getRandomStartProbabilities(numOfStates, observationAlphabet);

    initialProbs = defaults[0];
    transitionProbabilities = defaults[1];
    observationProbabilities = defaults[2];

    setOriginalState();

}); // on dom ready

function initUIElements() {
    autoMode = document.getElementById("autoModeCheckBox").value;
    document.getElementById("numberOfStatesInput").value = defaultNumberOfStates;
    numOfStates = defaultNumberOfStates;
    setOriginalState();
}

function setOriginalState() {
//    cy.nodes().removeClass('highlighted-node');
//    cy.edges().removeClass('highlighted-edge');

    cy.remove(cy.nodes());
    cy.remove(cy.edges());

    hmm.remove(hmm.elements());

    userUnSelectedNode();

    animating = false;

    currentCol = -1;
    setNavButtonStatus();

    if (forwardMode) {
        document.getElementById("forwardInfo").className = "visibleAlgorithmInfo";
        document.getElementById("viterbiInfo").className = "hiddenAlgorithmInfo";
        forwardResults = forward(initialProbs, transitionProbabilities, observationProbabilities, observations);
        probs = forwardResults[0];
        computations = forwardResults[1];
        arrows = forwardResults[2];
    } else {
        document.getElementById("viterbiInfo").className = "visibleAlgorithmInfo";
        document.getElementById("forwardInfo").className = "hiddenAlgorithmInfo";
        viterbiResult = viterbi(initialProbs, transitionProbabilities, observationProbabilities, observations);
        stateSequence = viterbiResult[0];
        bestStateSequenceProbability = viterbiResult[1];
        probs = viterbiResult[2];
        phi = viterbiResult[3];
        computations = viterbiResult[4];
        arrows = viterbiResult[5];
    }

    graphWidth = math.size(probs).subset(math.index(0));

    addNodes(probs, computations, numOfStates, graphWidth);
    addEdges();

    initHMM();

    displayInitProbs();

    cy.fit();
    hmm.fit();
}

function addNodes(probs, compStrings, height, width) {

    xi = 200;
    yi = 200;

    for (i = 0; i < width; i++) {
        for (j = 0; j < height; j++) {
            cy.add({
                group: "nodes",
                data: {
                    id: 'S' + j + 'T' + (i + 1),
                    prob: round(probs.subset(math.index(i, j)), 6),
                    weight: math.log(probs.subset(math.index(i, j))) / (numOfObservations * numOfStates / 20.0),
                    row: j,
                    column: i + 1,
                    compLabel: compStrings.subset(math.index(i, j))
                },
                position: {x: xi + (i + 1) * 100, y: yi + j * 100}
            });
        }
    }
}

function addEdges() {
    for (var i = 0; i < numOfObservations; i++) {
        var sourceNodes = cy.elements("node[column =" + i + "]");
        var nextCol = i + 1;
        var destNodes = cy.elements("node[column = " + nextCol + "]");

        for (var j = 0; j < sourceNodes.length; j++) {
            for (var k = 0; k < destNodes.length; k++) {
                cy.add({
                    group: "edges",
                    data: {
                        id: '' + sourceNodes[j].data().id + '' + destNodes[k].data().id,
                        weight: 1,
                        source: sourceNodes[j].data().id,
                        target: destNodes[k].data().id
                    }
                });
            }
        }
    }
}

function initHMM() {
    for (i = 0; i < numOfStates; i++) {
        hmm.add({
            group: "nodes",
            data: {id: 'S' + i, weight: 1, row: 0, column: i},
            position: {x: 100 + i * 100, y: 100}
        });
    }

    hmm.nodes().forEach(function (node, i, nodes) {
        hmm.nodes().forEach(function (node2) {
            hmm.add({
                group: "edges",
                data: {
                    id: '' + node.data().id + '' + node2.data().id,
                    weight: 1,
                    source: node.data().id,
                    target: node2.data().id,
                    color: getRandomColor()
                }
            });
        });
    });
}

function startAnimating() {
    setOriginalState();
    var i = 0;
    animating = true;

    var highlightColumnAuto = function () {
        if (!animating)
            return;
        currentCol = i;
        highlightColumn(i);

        if (i < numOfObservations && animating) {
            i++;
            setTimeout(highlightColumnAuto, 1000);
        } else {
            //Animation is done
            //Change button name to restart
            if (!forwardMode) {
                startAnimatingViterbi();
            }
            animating = false;
        }
    };

    highlightColumnAuto();

}

function highlightColumn(col) {
    var edges;
    var nodes = cy.elements("node[column =" + col + "]");
    nodes.addClass('highlighted-node');

    if (col > 0) {
        nodes.forEach(function (node) {
            edges = cy.edges("[target = '" + node.data().id + "']");
            edges.addClass('highlighted-edge');
        });
    }
}

function startAnimatingViterbi() {
//    setOriginalState(numOfStates);
    var i = numOfObservations;
    animating = true;

    var highlightNodeAuto = function () {
        currentCol = i;
        var row = stateSequence.subset(math.index(i - 1, 0));
        highlightNode(i, row);

        if (i > 1) {
            i--;
            setTimeout(highlightNodeAuto, 100);
        } else {
            //Animation is done
            //Change button name to restart
            prevNodeCol = -1;
            prevNodeRow = -1;
        }
    };

    highlightNodeAuto();

}

function highlightNode(col, row) {
    var edges;
    var node = cy.elements("node[column =" + col + "][ row =" + row + "]");
    node.addClass('viterbi-highlighted-node');

    if (col > 0) {
        if (prevNodeCol > 0 && prevNodeRow > -1) {
            var prevNode = cy.elements("node[column =" + prevNodeCol + "][ row =" + prevNodeRow + "]");
            edges = cy.edges("[target = '" + prevNode.data().id + "'][source = '" + node.data().id + "']");
            edges.addClass('viterbi-highlighted-edge');
        }
    }
    prevNodeCol = col;
    prevNodeRow = row;
}

function dehighlightColumn(col) {
    var edges;
    var nodes = cy.elements("node[column =" + col + "]");
    nodes.removeClass('highlighted-node');

    if (col > 0) {
        nodes.forEach(function (node) {
            edges = cy.edges("[target = '" + node.data().id + "']");
            edges.removeClass('highlighted-edge');
        });
    }
}

function displayInitProbs() {
    //display prob values
    var probString = "";
    hmm.nodes().forEach(function (node, i, nodes) {
        var sInitProbs = round(initialProbs.subset(math.index(0, node.data('column'))), 5);
        probString += node.data('id') + ":" + sInitProbs;
        if (i != nodes.length - 1)
            probString += ",";
    });
    document.getElementById("initialProbInput").value = probString;
}

/************UI EVENT HANDLERS***********/

function algorithmChanged() {
    var selectedIndex = document.getElementById("algorithmSelector").selectedIndex;
    //TODO: change this when there are more than two options
    forwardMode = selectedIndex == 0;

    setOriginalState();
}

function evaluateButtonPressed() {
    if (autoMode) {
        startAnimating();
    } else {
        setOriginalState();
    }
}

function observationAlphabetChanged() {
    var newObservationAlphabet = document.getElementById("observationAlphabet").value;
    observationAlphabet = newObservationAlphabet.split(',');

    defaults = getRandomStartProbabilities(numOfStates, observationAlphabet);
    initialProbs = defaults[0];
    transitionProbabilities = defaults[1];
    observationProbabilities = defaults[2];

    // Not updating other states, because we don't want to show an error message to the user every time.
}

function observationsChanged() {
    //TODO: Validate observations are all alphabets

    var newObservations = document.getElementById("observationsInput").value;

    observations = newObservations.split(',');
    numOfObservations = observations.length;

//    defaults = getFlatStartProbabilities(numOfStates, observations);
//    initialProbs = defaults[0];
//    transitionProbabilities = defaults[1];
//    observationProbabilities = defaults[2];

    try {
        setOriginalState();
    }
    catch (err) {
        alert("Incorrect input. Check observation probability is defined for each state!\n" + err);
    }

}

function initialProbChanged() {
    //read the new prob
    var newStateInPro = document.getElementById("initialProbInput").value;
    var sInPros = newStateInPro.split(",");

    var probSum = 0;

    for (i = 0; i < sInPros.length; i++) {
        var prob = parseFloat(sInPros[i].split(":")[1]);
        var state = parseFloat(sInPros[i].split(":")[0].split("")[1]);

        initialProbs.set([0, state], prob);
        probSum += prob;
//        math.subset(initialProbs, math.index(0, state), prob);
    }
    if (probSum == 1)
        setOriginalState();
    else
        alert("Initial Probability Sum should be one");
}

function observationProbChanged() {
    var newObsProbs = document.getElementById("observationProbInputs").value;
    var sObsPros = newObsProbs.split(",");

    for (i = 0; i < sObsPros.length; i++) {
        var prob = parseFloat(sObsPros[i].split(":")[1]);
        var state = sObsPros[i].split(":")[0];

        observationProbabilities[state].set([0, selectedStateCol], prob);
    }

    //TODO: add the new observation if it doesnt exist in the list

    setOriginalState();
}

function transProbChanged() {
    var newTransProbs = document.getElementById("transitionProbInputs").value;
    var stransPros = newTransProbs.split(",");

    if (numOfStates != stransPros.length) {
        alert("Incorrect input. Number if transition probabilities should be the same as number of states");
        return;
    }

    for (i = 0; i < stransPros.length; i++) {
        var prob = parseFloat(stransPros[i].split(":")[1]);
        var state = parseFloat(stransPros[i].split(":")[0].split("")[1]);

        transitionProbabilities.set([selectedStateCol, state], prob);
    }

    setOriginalState();

}

function numberOfStatesChanged() {
    //TODO: Validate if number and max limit

    numOfStates = parseInt(document.getElementById("numberOfStatesInput").value);

    defaults = getRandomStartProbabilities(numOfStates, observationAlphabet);
    initialProbs = defaults[0];
    transitionProbabilities = defaults[1];
    observationProbabilities = defaults[2];
    setOriginalState();
}

function autoModeChanged() {
    autoMode = document.getElementById("autoModeCheckBox").checked;

    setNavButtonStatus();
}

function backButtonClicked() {
    //Clear selection for previous row
    if (currentCol >= 0) {
        dehighlightColumn(currentCol--);
    }

    setNavButtonStatus();
}

function nextButtonClicked() {
    if (currentCol < numOfObservations) {
        highlightColumn(++currentCol);
    }

    if (!forwardMode && currentCol == numOfObservations - 1) {
        startAnimatingViterbi();
    }

    setNavButtonStatus();
}

function setNavButtonStatus() {
    //Enable and disable navigation buttons
    if (autoMode) {
        document.getElementById("backNavButton").className = "disabled";
        document.getElementById("forwardNavButton").className = "disabled";
    } else {
        document.getElementById("backNavButton").className = "active";
        document.getElementById("forwardNavButton").className = "active";
    }

    if (currentCol >= numOfObservations) {
        document.getElementById("forwardNavButton").className = "disabled";
    }
    else if (currentCol < 0) {
        document.getElementById("backNavButton").className = "disabled";
    } else {
        document.getElementById("backNavButton").className = "active";
        document.getElementById("forwardNavButton").className = "active";
    }
}

/**********CYTOSCAPE EVENTS**************/
function userSelectedNode(node) {
    document.getElementById("hmmSettingsInf").className = "hiddenHmmSettingsInfo";
    document.getElementById("hmmSettings").className = "visibleHmmSettings";

    var obsProbString = "";
    for (var i = 0; i < observations.length; i++) {

        var sObsProbs = round(observationProbabilities[observations[i]].subset(math.index(0, node.data('column'))), 5);
        if (obsProbString.indexOf(observations[i]) < 0) {
            obsProbString += observations[i] + ":" + sObsProbs;
            if (i != observations.length - 1) {
                obsProbString += ",";
            }
        }

    }
    document.getElementById("observationProbInputs").value = obsProbString;

    var sTransProbwidth = math.size(transitionProbabilities).subset(math.index(0));
    var straProbs = transitionProbabilities.subset(math.index(node.data('column'), [0, sTransProbwidth]));

    var trasString = "";
    for (i = 0; i < math.size(straProbs).subset(math.index(1)); i++) {
        trasString += "S" + i + ":" + round(straProbs.subset(math.index(0, i)), 5);
        if (i != math.size(straProbs).subset(math.index(1)) - 1) {
            trasString += ",";
        }
    }

    document.getElementById("transitionProbInputs").value = trasString;
}

function userUnSelectedNode(node) {
    document.getElementById("hmmSettingsInf").className = "visibleHmmSettingsInfo";
    document.getElementById("hmmSettings").className = "hiddenHmmSettings";
}

/************HELPER METHODS**************/

function getRandomColor() {
    var letters = '0123456789ABCDEF'.split('');
    var color = '#';
    for (var i = 0; i < 6; i++) {
        color += letters[Math.floor(Math.random() * 16)];
    }
    return color;
}

function commaSeparatedList(matrix) {
    var string = "";
    for (i = 0; i < math.size(matrix).subset(math.index(1)); i++) {
        string += round(matrix.subset(math.index(0, i)), 5);
        if (i != math.size(matrix).subset(math.index(1)) - 1) {
            string += ",";
        }
    }

    return string;
}

function commaSeparatedListFromArray(array) {
    var string = "";
    for (i = 0; i < array.length; i++) {
        string += array[i];
        if (i != array.length - 1) {
            string += ",";
        }
    }

    return string;
}


text:
/*
 *  RoboPeak LIDAR System
 *  Driver Interface
 *
 *  Copyright 2009 - 2014 RoboPeak Team
 *  http://www.robopeak.com
 *
 */

#pragma once

#ifndef __cplusplus
#error "The RPlidar SDK requires a C++ compiler to be built"
#endif

namespace rp { namespace standalone{ namespace rplidar {

class RPlidarDriver {
public:
    enum {
        DEFAULT_TIMEOUT = 2000, //2000 ms
    };

    enum {
        DRIVER_TYPE_SERIALPORT = 0x0,
    };
public:
    /// Create an RPLIDAR Driver Instance
    /// This interface should be invoked first before any other operations
    ///
    /// \param drivertype the connection type used by the driver.
    static RPlidarDriver * CreateDriver(_u32 drivertype = DRIVER_TYPE_SERIALPORT);

    /// Dispose the RPLIDAR Driver Instance specified by the drv parameter
    /// Applications should invoke this interface when the driver instance is no longer used in order to free memory
    static void DisposeDriver(RPlidarDriver * drv);

public:
    /// Open the specified serial port and connect to a target RPLIDAR device
    ///
    /// \param port_path     the device path of the serial port
    ///        e.g. on Windows, it may be com3 or \\.\com10
    ///             on Unix-Like OS, it may be /dev/ttyS1, /dev/ttyUSB2, etc
    ///
    /// \param baudrate      the baudrate used
    ///        For most RPLIDAR models, the baudrate should be set to 115200
    ///
    /// \param flag          other flags
    ///        Reserved for future use, always set to Zero
    virtual u_result connect(const char * port_path, _u32 baudrate, _u32 flag = 0) = 0;

    /// Disconnect with the RPLIDAR and close the serial port
    virtual void disconnect() = 0;

    /// Returns TRUE when the connection has been established
    virtual bool isConnected() = 0;

    /// Ask the RPLIDAR core system to reset it self
    /// The host system can use the Reset operation to help RPLIDAR escape the self-protection mode.
    ///
    //  \param timeout       The operation timeout value (in millisecond) for the serial port communication
    virtual u_result reset(_u32 timeout = DEFAULT_TIMEOUT) = 0;

    /// Retrieve the health status of the RPLIDAR
    /// The host system can use this operation to check whether RPLIDAR is in the self-protection mode.
    ///
    /// \param health        The health status info returned from the RPLIDAR
    ///
    /// \param timeout       The operation timeout value (in millisecond) for the serial port communication
    virtual u_result getHealth(rplidar_response_device_health_t & health, _u32 timeout = DEFAULT_TIMEOUT) = 0;

    /// Get the device information of the RPLIDAR include the serial number, firmware version, device model etc.
    ///
    /// \param info          The device information returned from the RPLIDAR
    ///
    /// \param timeout       The operation timeout value (in millisecond) for the serial port communication
    virtual u_result getDeviceInfo(rplidar_response_device_info_t & info, _u32 timeout = DEFAULT_TIMEOUT) = 0;

    /// Calculate RPLIDAR's current scanning frequency from the given scan data
    /// Please refer to the application note doc for details
    /// Remark: the calculation will be incorrect if the specified scan data doesn't contain enough data
    ///
    /// \param nodebuffer    The buffer belongs to a 360degress scan data
    ///
    /// \param count         The number of sample nodes inside the given buffer
    ///
    //  \param frequency     The scanning frequency (in HZ) calcuated by the interface.
    virtual u_result getFrequency(rplidar_response_measurement_node_t * nodebuffer, size_t count, float & frequency) = 0;

    /// Ask the RPLIDAR core system to enter the scan mode
    /// A background thread will be created by the RPLIDAR driver to fetch the scan data continuously.
    /// User Application can use the grabScanData() interface to retrieved the scan data cached previous by this background thread.
    ///
    /// \param force         Force the core system to output scan data regardless whether the scanning motor is rotating or not.
    ///
    /// \param timeout       The operation timeout value (in millisecond) for the serial port communication
    virtual u_result startScan(bool force = false, _u32 timeout = DEFAULT_TIMEOUT) = 0;

    /// Ask the RPLIDAR core system to stop the current scan operation and enter idle state. The background thread will be terminated
    ///
    /// \param timeout       The operation timeout value (in millisecond) for the serial port communication
    virtual u_result stop(_u32 timeout = DEFAULT_TIMEOUT) = 0;

    /// Wait and grab a complete 0-360 degree scan data previously received.
    /// The grabbed scan data returned by this interface always has the following charactistics:
    ///
    /// 1) The first node of the grabbed data array (nodebuffer[0]) must be the first sample of a scan, i.e. the start_bit == 1
    /// 2) All data nodes are belong to exactly ONE complete 360-degrees's scan
    /// 3) Note, the angle data in one scan may not be ascending. You can use API ascendScanData to reorder the nodebuffer.
    ///
    /// \param nodebuffer     Buffer provided by the caller application to store the scan data
    ///
    /// \param count          The caller must initialize this parameter to set the max data count of the provided buffer (in unit of rplidar_response_measurement_node_t).
    ///                       Once the interface returns, this parameter will store the actual received data count.
    ///
    /// \param timeout        Max duration allowed to wait for a complete scan data, nothing will be stored to the nodebuffer if a complete 360-degrees' scan data cannot to be ready timely.
    ///
    /// The interface will return RESULT_OPERATION_TIMEOUT to indicate that no complete 360-degrees' scan can be retrieved withing the given timeout duration.
    ///
    /// \The caller application can set the timeout value to Zero(0) to make this interface always returns immediately to achieve non-block operation.
	virtual u_result grabScanData(rplidar_response_measurement_node_t * nodebuffer, size_t & count, _u32 timeout = DEFAULT_TIMEOUT) = 0;

    /// Ascending the scan data according to the angle value in the scan.
    ///
    /// \param nodebuffer     Buffer provided by the caller application to do the reorder. Should be retrived from the grabScanData
    ///
    /// \param count          The caller must initialize this parameter to set the max data count of the provided buffer (in unit of rplidar_response_measurement_node_t).
    ///                       Once the interface returns, this parameter will store the actual received data count.
    /// The interface will return RESULT_OPERATION_FAIL when all the scan data is invalid.
    virtual u_result ascendScanData(rplidar_response_measurement_node_t * nodebuffer, size_t count) = 0;

	virtual u_result stopMotor() = 0;
	virtual u_result startMotor() = 0;

protected:
    RPlidarDriver() {}
    virtual ~RPlidarDriver() {}
};

}}}


text:
<?php

defined('BASEPATH') OR exit('No direct script access allowed');

class Shop extends CI_Controller {

	public $data;
	public $view_path = 'user/shop/';

	function __construct()
	{
		parent::__construct();
		$this->data['message'] = '';
		$this->load->library(['ion_auth', 'user_lib']);
		if (!$this->ion_auth->logged_in())
		{
			//redirect them to the login page
			redirect('index/login', 'refresh');
		}
		$this->user_lib->init($this->ion_auth->get_user_id());
		$this->load->model('settings_model');
		$this->data['templates_path'] = base_url()  . 'templates/'. $this->settings_model->get('templates_path') . '/';
		$this->data['title']         = $this->settings_model->get('title');
	}

	public function index()
	{
		$this->load->view('shop/index', $this->data);
	}
}

/* End of file Shop.php */
/* Location: ./application/controllers/Shop.php */


text:
package dk.statsbiblioteket.medieplatform.newspaper.manualQA.mockers;

/**
 */
public class EditionModsMocker {

    public static String getEditionMods(String editionNumber) {
        String rawMods = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"+
        "<mods:mods xmlns:mods=\"http://www.loc.gov/mods/v3\">" +
                "<mods:titleInfo>" +
                "        <mods:title>Politiken</mods:title>" +
                "    </mods:titleInfo>" +
                "<mods:titleInfo type=\"uniform\" authority=\"Statens Avissamling\">" +
                "        <mods:title>politiken</mods:title>" +
                "    </mods:titleInfo>" +
                "    <mods:originInfo>" +
                "        <mods:place>" +
                "            <mods:placeTerm type=\"text\">København</mods:placeTerm>" +
                "        </mods:place>" +
                "        <!--required-->" +
                "        <mods:dateIssued encoding=\"iso8601\"><!--issueDate (required)--></mods:dateIssued>" +
                "        <mods:dateIssued encoding=\"iso8601\" qualifier=\"questionable\"><!--issueDateAsLabeled (optional)--></mods:dateIssued>" +
                "    </mods:originInfo>" +
                "    <mods:note type=\"noteAboutReproduction\">present</mods:note>" +
                "    <mods:note type=\"noteAboutReproduction\" displayLabel=\"comment\">present</mods:note>" +
                "    <mods:relatedItem type=\"host\">" +
                "        <mods:part>" +
                "            <mods:detail type=\"volume\">" +
                "                <mods:number>27</mods:number>" +
                "            </mods:detail>" +
                "            <mods:detail type=\"edition\">" +
                "                <mods:number>___EDITIONNUMBER___</mods:number>" +
                "                <mods:caption>Ekstra udgave</mods:caption>" +
                "            </mods:detail>" +
                "            <mods:detail type=\"issue\">" +
                "                <mods:number>212</mods:number>" +
                "            </mods:detail>" +
                "        </mods:part>" +
                "    </mods:relatedItem>" +
                "</mods:mods>";
        return rawMods.replace("___EDITIONNUMBER___", editionNumber);
    }

}


text:
ALTER TABLE environment DROP COLUMN if EXISTS tunnel;
ALTER TABLE environment DROP COLUMN if EXISTS idbroker_mapping_source;

-- //@UNDO
-- SQL to undo the change goes here.

ALTER TABLE environment ADD COLUMN IF NOT EXISTS idbroker_mapping_source VARCHAR(10);
UPDATE environment set idbroker_mapping_source='MOCK';

ALTER TABLE environment ADD COLUMN IF NOT EXISTS tunnel varchar(255) NOT NULL DEFAULT 'DIRECT';
UPDATE environment SET tunnel = 'DIRECT';


text:
<?php
namespace TYPO3\Flow\Mvc\Exception;

/**
 * An "invalid Route setup" exception
 *
 * @api
 */
class InvalidRouteSetupException extends \TYPO3\Flow\Mvc\Exception
{
}


text:
package com.jjcamera.apps.iosched.feedback;

import android.content.ContentResolver;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.net.Uri;

import com.jjcamera.apps.iosched.provider.ScheduleContract;

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

import static com.jjcamera.apps.iosched.util.LogUtils.*;

/**
 * Provides unidirectional sync from the feedback data provided by the user to the server feedback
 * API.
 */
public class FeedbackSyncHelper {
    private static final String TAG = makeLogTag(FeedbackSyncHelper.class);

    private static final HashMap<String, String> QUESTION_KEYS = new HashMap<String, String>();
    static {
        QUESTION_KEYS.put(ScheduleContract.Feedback.SESSION_RATING, "Q10");
        QUESTION_KEYS.put(ScheduleContract.Feedback.ANSWER_RELEVANCE, "Q20");
        QUESTION_KEYS.put(ScheduleContract.Feedback.ANSWER_CONTENT, "Q30");
        QUESTION_KEYS.put(ScheduleContract.Feedback.ANSWER_SPEAKER, "Q40");
        QUESTION_KEYS.put(ScheduleContract.Feedback.COMMENTS, "Q50");
    }

    private static final HashMap<String, String> RATING_ANSWERS = new HashMap<String, String>();
    static {
        RATING_ANSWERS.put("1", "aece21ff-2cbe-e411-b87f-00155d5066d7");
        RATING_ANSWERS.put("2", "afce21ff-2cbe-e411-b87f-00155d5066d7");
        RATING_ANSWERS.put("3", "b0ce21ff-2cbe-e411-b87f-00155d5066d7");
        RATING_ANSWERS.put("4", "b1ce21ff-2cbe-e411-b87f-00155d5066d7");
        RATING_ANSWERS.put("5", "b2ce21ff-2cbe-e411-b87f-00155d5066d7");
    }

    private static final HashMap<String, String> RELEVANCE_ANSWERS = new HashMap<String, String>();
    static {
        RELEVANCE_ANSWERS.put("1", "9bce21ff-2cbe-e411-b87f-00155d5066d7");
        RELEVANCE_ANSWERS.put("2", "9cce21ff-2cbe-e411-b87f-00155d5066d7");
        RELEVANCE_ANSWERS.put("3", "9dce21ff-2cbe-e411-b87f-00155d5066d7");
        RELEVANCE_ANSWERS.put("4", "9ece21ff-2cbe-e411-b87f-00155d5066d7");
        RELEVANCE_ANSWERS.put("5", "9fce21ff-2cbe-e411-b87f-00155d5066d7");
    }

    private static final HashMap<String, String> CONTENT_ANSWERS = new HashMap<String, String>();
    static {
        CONTENT_ANSWERS.put("1", "a1ce21ff-2cbe-e411-b87f-00155d5066d7");
        CONTENT_ANSWERS.put("2", "a2ce21ff-2cbe-e411-b87f-00155d5066d7");
        CONTENT_ANSWERS.put("3", "a3ce21ff-2cbe-e411-b87f-00155d5066d7");
        CONTENT_ANSWERS.put("4", "a4ce21ff-2cbe-e411-b87f-00155d5066d7");
        CONTENT_ANSWERS.put("5", "a5ce21ff-2cbe-e411-b87f-00155d5066d7");
    }

    private static final HashMap<String, String> SPEAKER_ANSWERS = new HashMap<String, String>();
    static {
        SPEAKER_ANSWERS.put("1", "a8ce21ff-2cbe-e411-b87f-00155d5066d7");
        SPEAKER_ANSWERS.put("2", "a9ce21ff-2cbe-e411-b87f-00155d5066d7");
        SPEAKER_ANSWERS.put("3", "aace21ff-2cbe-e411-b87f-00155d5066d7");
        SPEAKER_ANSWERS.put("4", "abce21ff-2cbe-e411-b87f-00155d5066d7");
        SPEAKER_ANSWERS.put("5", "acce21ff-2cbe-e411-b87f-00155d5066d7");
    }

    Context mContext;
    FeedbackApiHelper mFeedbackApiHelper;

    public FeedbackSyncHelper(Context context, FeedbackApiHelper feedbackApi) {
        mContext = context;
        mFeedbackApiHelper = feedbackApi;

    }

    public void sync() {
        final ContentResolver cr = mContext.getContentResolver();
        final Uri newFeedbackUri = ScheduleContract.Feedback.CONTENT_URI;
        Cursor c = cr.query(newFeedbackUri,
                null,
                ScheduleContract.Feedback.SYNCED + " = 0",
                null,
                null);
        LOGD(TAG, "Number of unsynced feedbacks: " + c.getCount());
        HashMap<String, String> questions = new HashMap<String, String>();
        List<String> updatedSessions = new ArrayList<String>();

        try {
            while (c.moveToNext()) {
                String localSessionId = c.getString(c.getColumnIndex(ScheduleContract.Feedback.SESSION_ID));
                String remoteSessionId = localSessionId;
                // EventPoint uses a different Session ID for the keynote than our backend
                if ("__keynote__".equals(remoteSessionId)) {
                    remoteSessionId = "14f5088b-d0e2-e411-b87f-00155d5066d7";
                }

                String data;

                data = c.getString(c.getColumnIndex(ScheduleContract.Feedback.SESSION_RATING));
                questions.put(
                        QUESTION_KEYS.get(ScheduleContract.Feedback.SESSION_RATING),
                        RATING_ANSWERS.get(data));

                data = c.getString(c.getColumnIndex(ScheduleContract.Feedback.ANSWER_RELEVANCE));
                questions.put(
                        QUESTION_KEYS.get(ScheduleContract.Feedback.ANSWER_RELEVANCE),
                        RELEVANCE_ANSWERS.get(data));

                data = c.getString(c.getColumnIndex(ScheduleContract.Feedback.ANSWER_CONTENT));
                questions.put(
                        QUESTION_KEYS.get(ScheduleContract.Feedback.ANSWER_CONTENT),
                        CONTENT_ANSWERS.get(data));

                data = c.getString(c.getColumnIndex(ScheduleContract.Feedback.ANSWER_SPEAKER));
                questions.put(
                        QUESTION_KEYS.get(ScheduleContract.Feedback.ANSWER_SPEAKER),
                        SPEAKER_ANSWERS.get(data));

                data = c.getString(c.getColumnIndex(ScheduleContract.Feedback.COMMENTS));
                questions.put(
                        QUESTION_KEYS.get(ScheduleContract.Feedback.COMMENTS),
                        data);

                if (mFeedbackApiHelper.sendSessionToServer(remoteSessionId, questions)) {
                    LOGI(TAG, "Successfully updated session " + remoteSessionId);
                    updatedSessions.add(localSessionId);
                } else {
                    LOGE(TAG, "Couldn't update session " + remoteSessionId);
                }
            }
        } catch (Exception e){
            LOGE(TAG, "Couldn't read from cursor " + e);
        } finally {
            c.close();
        }

        // Flip the "synced" flag to true for any successfully updated sessions, but leave them
        // in the database to prevent duplicate feedback
        ContentValues contentValues = new ContentValues();
        contentValues.put(ScheduleContract.Feedback.SYNCED, 1);
        for (String sessionId : updatedSessions) {
            cr.update(ScheduleContract.Feedback.buildFeedbackUri(sessionId), contentValues, null, null);
        }

    }
}


text:
//
//  MTLFMDBAdapter.h
//  Mantle
//
//  Created by Valerio Santinelli on 16/07/14.
//  Copyright (c) 2014 Valerio Santinelli. All rights reserved.
//

#import <Foundation/Foundation.h>

#define QUERY_PARAMS_KEY_QUERY  @"mtlfmdbadapter.queryparams.key.query"
#define QUERY_PARAMS_KEY_ARGS   @"mtlfmdbadapter.queryparams.key.args"

@class MTLModel;
@class FMResultSet;
@class FMDatabase;
@protocol MTLFMDBSerializing;

static const void *MTLFMDBRowIdKey = &MTLFMDBRowIdKey;

@interface MTLModel (MTLFMDBExtensions)

@property (nonatomic) NSInteger mtlfmdb_rowid;

/**
 Recupera tutti gli oggetti dal DB passato come parametro e li restituisce in modo asincrono nel blocco di completamento insieme al db stesso per eventuali operazioni da eseguire nello stesso thread sullo stesso DB
 */
+ (void) allObjectsFromDB:(FMDatabase *)db withCompletion:(void(^)(NSArray *objects, FMDatabase *db))completionBlock;

/**
 @result Statement per salvare l'oggetto sul DB
 */
- (NSString*) saveStatement;

/**
 @result Statement per eliminare l'oggetto dal DB
 */
- (NSString*) deleteStatement;

/**
 @result parametri per eliminare l'oggetto dal DB
 */
- (NSDictionary*) deleteParams;

@end

/**
 *  A MTLModel object that supports being parsed from and serialized to FMDB.
 */
@protocol MTLFMDBSerializing

@required

/**
 Specify how to map property keys to different columns in FMDB.

 Subclasses overriding this method should combine their values with those of
 `super`.

 Any property keys not present in the dictionary are assumed to match the column
 name that should be used.
 Any keys associated with NSNull will not participate
 in serialization.

 @return a dictionary mapping property keys to FMDB columns (as strings) or
 NSNull values.
 */
+ (NSDictionary *)FMDBColumnsByPropertyKey;

/**
 Specify the table name for this object.

 @return an NSString with the name of the table.
 */
+ (NSString *)FMDBTableName;

/*
 Methods for load operation.
 In this method you need to map all field to result set
 */
- (void) loadFromResultSet:(FMResultSet*)resultSet;

/**
 Methods for save operation.
 In this method you need to map all field to result set
 */
- (void) saveAsync:(BOOL)async
    withCompletion:(void(^)(BOOL result))completionBlock;

- (NSDictionary*) saveParams;

@optional

/**
 Specify the `NSValueTransformer` that should be used to transform values
 fetched from FMDB.

 @param key The key corresponding to the column in FMDB

 @return the `NSValueTransformer` that should be used
 */
- (NSValueTransformer *)FMDBTransformerForKey:(NSString *)key;

/**
 Metodo opzionale per restituire il tipo particolare legato ad una proprietà specifica
 */
+ (NSDictionary *)FMDBColumnsTypeByPropertyKey;

@end

/**
 The domain for errors originating from MTLFMDBAdapter.
 */
extern NSString * const MTLFMDBAdapterErrorDomain;

/**
 The provided FMDBDictionary is not valid.
 */
extern const NSInteger MTLFMDBAdapterErrorInvalidFMResultSet;

/**
 The model's implementation of +FMDBColumnsByPropertyKey included a key which
 does not actually exist in +propertyKeys.
 */
extern const NSInteger MTLFMDBAdapterErrorInvalidFMResultSetMapping;

/**
 Converts a MTLModel object from and FMResultSet and to a SQL query that can
 be fed to FMDB
 */
@interface MTLFMDBAdapter : NSObject

/**
 The model object that the receiver was initialized with, or that the receiver
 parsed from an FMResultSet.
 */
@property (nonatomic, strong, readonly) MTLModel<MTLFMDBSerializing> *model;

/**
 Attempts to parse an FMResultSet into a model object.

 @param modelClass The MTLModel subclass to attempt to parse from the FMResultSet.
 @param resultSet  An FMResultSet with the data to be converted to a MTLModel.
                   If this argument is nil, the method returns nil.
 @param error      If not NULL, this may be set to an error that occurs during
                   parsing or initializing an instance of `modelClass`

 @return an instance of `modelClass` upon success, or nil if a parsing error
 occurred.
 */
+ (id)modelOfClass:(Class)modelClass fromFMResultSet:(FMResultSet *)resultSet error:(NSError **)error;

/**
 Initializes the receiver by attempting to parse an FMResultSet into a model object.

 @param resultSet  The FMResultSet representing the data to be converted to a MTLModel. If this argument is nil, the method returns nil.
 @param modelClass The MTLModel subclass to attempt to parse from the FMResultSet.
 @param error      If not NULL, this may be set to an error that occurs during parsing or initializing an instance of `modelClass`

 @return an instance of `modelClass` upon success, or nil if a parsing error occurred.
 */
- (id)initWithFMResultSet:(FMResultSet *)resultSet modelClass:(Class)modelClass error:(NSError **)error;

// Serializes the receiver's `model` into an NSDictionary.
//
// Returns a JSON dictionary, or nil if a serialization error occurred.
- (NSDictionary *)FMDBDictionary;

// Looks up the FMDB column in the model's +propertyKeys.
//
// Subclasses may override this method to customize the adapter's seralizing
// behavior. You should not call this method directly.
//
// key - The property key to retrieve the corresponding column for. This
//       argument must not be nil.
//
// Returns a column to use, or nil to omit the property.
- (NSString *)FMDBColumnForPropertyKey:(NSString *)key;

/**
 Looks up the column names of the properties described in FMDBColumnsByPropertyKey and returns them as an NSArray

 @param modelClass the MTLModel class whose columns names should be returned

 @return an NSArray of columns names of the properties in the same order as described by FMDBColumnsByPropertyKey
 */
+ (NSArray*) columnsNamesForModelClass:(Class)modelClass;

/**
 Looks up the column names of the properties described in FMDBColumnsByPropertyKey and returns them as an NSDictionary

 @param modelClass the MTLModel class whose columns names should be returned

 @return an NSDictionary with keys as property name and value of effective columns names of the properties
 */
+ (NSDictionary*) columnsNamesDictionaryForModelClass:(Class)modelClass;

/**
 Looks up the values of the primary keys.

 @param model the MTLModel object whose primary keys values should be returned.

 @return an NSArray of values of the primary keys of `model`
 */
+ (NSArray *)primaryKeysValues:(MTLModel<MTLFMDBSerializing> *)model;

/**
 The SQL CREATE TABLE statement for the object passed in `model`

 @param model the MTLModel object we want to serialize to FMDB

 @return an NSString with the CREATE TABLE statement to use with FMDB.
 */
+ (NSString *)createStatementForModel:(Class)modelClass;

/**
 The SQL DELETE TABLE statement for the object passed in `model`

 @param model the MTLModel object we want to serialize to FMDB

 @return an NSString with the DELETE TABLE statement to use with FMDB.
 */
+ (NSString *)deleteStatementForModelClass:(Class)modelClass;

/**
 The SQL INSERT statement for the object passed in `model`

 @param model the MTLModel object we want to serialize to FMDB

 @return an NSString with the INSERT statement to use with FMDB.
 */
+ (NSString *)insertStatementForModel:(MTLModel<MTLFMDBSerializing> *)model;

/**
 The SQL UPDATE statement for the object passed in `model`

 @param model the MTLModel object we want to serialize to FMDB

 @return an NSString with the INSERT statement to use with FMDB.
 */
+ (NSString *)updateStatementForModel:(MTLModel<MTLFMDBSerializing> *)model;

/**
 The SQL DELETE statement for the object passed in `model`

 @param model the MTLModel object we want to serialize to FMDB

 @return an NSString with the INSERT statement to use with FMDB.
 */
+ (NSString *)deleteStatementForModel:(MTLModel<MTLFMDBSerializing> *)model;

/**
 The WHERE statement used for UPDATE and DELETE operations.

 @param model the MTLModel object we want to serialize to FMDB

 @return an NSString with the WHERE statement of the query.
 */
+ (NSString *)whereStatementForModel:(MTLModel<MTLFMDBSerializing> *)model;
@end


text:
<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/compute/v1/compute.proto

namespace Google\Cloud\Compute\V1;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * Describes a single physical circuit between the Customer and Google. CircuitInfo objects are created by Google, so all fields are output only.
 *
 * Generated from protobuf message google.cloud.compute.v1.InterconnectCircuitInfo
 */
class InterconnectCircuitInfo extends \Google\Protobuf\Internal\Message
{
    /**
     * Customer-side demarc ID for this circuit.
     *
     * Generated from protobuf field optional string customer_demarc_id = 28771859;
     */
    private $customer_demarc_id = null;
    /**
     * Google-assigned unique ID for this circuit. Assigned at circuit turn-up.
     *
     * Generated from protobuf field optional string google_circuit_id = 262014711;
     */
    private $google_circuit_id = null;
    /**
     * Google-side demarc ID for this circuit. Assigned at circuit turn-up and provided by Google to the customer in the LOA.
     *
     * Generated from protobuf field optional string google_demarc_id = 448196270;
     */
    private $google_demarc_id = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $customer_demarc_id
     *           Customer-side demarc ID for this circuit.
     *     @type string $google_circuit_id
     *           Google-assigned unique ID for this circuit. Assigned at circuit turn-up.
     *     @type string $google_demarc_id
     *           Google-side demarc ID for this circuit. Assigned at circuit turn-up and provided by Google to the customer in the LOA.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce();
        parent::__construct($data);
    }

    /**
     * Customer-side demarc ID for this circuit.
     *
     * Generated from protobuf field optional string customer_demarc_id = 28771859;
     * @return string
     */
    public function getCustomerDemarcId()
    {
        return isset($this->customer_demarc_id) ? $this->customer_demarc_id : '';
    }

    public function hasCustomerDemarcId()
    {
        return isset($this->customer_demarc_id);
    }

    public function clearCustomerDemarcId()
    {
        unset($this->customer_demarc_id);
    }

    /**
     * Customer-side demarc ID for this circuit.
     *
     * Generated from protobuf field optional string customer_demarc_id = 28771859;
     * @param string $var
     * @return $this
     */
    public function setCustomerDemarcId($var)
    {
        GPBUtil::checkString($var, True);
        $this->customer_demarc_id = $var;

        return $this;
    }

    /**
     * Google-assigned unique ID for this circuit. Assigned at circuit turn-up.
     *
     * Generated from protobuf field optional string google_circuit_id = 262014711;
     * @return string
     */
    public function getGoogleCircuitId()
    {
        return isset($this->google_circuit_id) ? $this->google_circuit_id : '';
    }

    public function hasGoogleCircuitId()
    {
        return isset($this->google_circuit_id);
    }

    public function clearGoogleCircuitId()
    {
        unset($this->google_circuit_id);
    }

    /**
     * Google-assigned unique ID for this circuit. Assigned at circuit turn-up.
     *
     * Generated from protobuf field optional string google_circuit_id = 262014711;
     * @param string $var
     * @return $this
     */
    public function setGoogleCircuitId($var)
    {
        GPBUtil::checkString($var, True);
        $this->google_circuit_id = $var;

        return $this;
    }

    /**
     * Google-side demarc ID for this circuit. Assigned at circuit turn-up and provided by Google to the customer in the LOA.
     *
     * Generated from protobuf field optional string google_demarc_id = 448196270;
     * @return string
     */
    public function getGoogleDemarcId()
    {
        return isset($this->google_demarc_id) ? $this->google_demarc_id : '';
    }

    public function hasGoogleDemarcId()
    {
        return isset($this->google_demarc_id);
    }

    public function clearGoogleDemarcId()
    {
        unset($this->google_demarc_id);
    }

    /**
     * Google-side demarc ID for this circuit. Assigned at circuit turn-up and provided by Google to the customer in the LOA.
     *
     * Generated from protobuf field optional string google_demarc_id = 448196270;
     * @param string $var
     * @return $this
     */
    public function setGoogleDemarcId($var)
    {
        GPBUtil::checkString($var, True);
        $this->google_demarc_id = $var;

        return $this;
    }

}


text:
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.1249332.svg)](https://doi.org/10.5281/zenodo.1249332)
![GitHub release](https://img.shields.io/github/release/saw-leipzig/csv2cmi.svg)
[![license](https://img.shields.io/github/license/saw-leipzig/csv2cmi.svg)](https://opensource.org/licenses/MIT)

## About

CSV2CMI is a little program to transform a table of letters (given as .csv) into the [CMI format](https://github.com/TEI-Correspondence-SIG/CMIF).
The CMI format is the underlying data format for the web service *[correspSearch](https://correspsearch.net)* which facilitates searching across diverse distributed letter repositories.

It is mainly intended for printed (print only) editions and catalogues of letters.

## Usage

You have to name your columns as follows:
* name of the sender: "sender"
* name of the addressee: "addressee"
* IDs of the named person or organization: "senderID" and "addresseeID" (this is essential for *correspSearch*)
* the date, when the letter has been sent: "senderDate"

You may provide additional information:
* where a letter has been sent: "senderPlace" (with the appropriate "senderPlaceID" as proper [GeoNames URL](http://www.geonames.org/))
* where a letter has been received: "addresseePlace" (with the appropriate "addresseePlaceID" as proper [GeoNames URL](http://www.geonames.org/))
* when a letter has been received: "addresseeDate"

Furthermore an "edition" column for a bibliographic record, a "key" column for the corresponding number of the edited letter, and even a "note" column can be added.

Various senders or addressees of a letter have to be written in the same cell with a separator that is specified with the `"--extra-delimiter"`-option (IDs have to follow the same order respectively).

Dates have to be entered in ISO format. Support for [EDTF](https://www.loc.gov/standards/datetime/edtf.html) is implemented to parse uncertain / approximate dates, intervals and sets.

For providing essential CMI information like the editor's name or the publisher an [INI file](https://en.wikipedia.org/wiki/INI_file) is needed.

*Check, that your table is using UTF8-encoding!*

For options and further information check the [wiki](https://github.com/saw-leipzig/csv2cmi/wiki).

## License

This program is available under [The MIT License (MIT)](https://opensource.org/licenses/MIT)

__If you use this software, please cite it!__


text:
require 'rails_helper'

RSpec.describe "clients/new", type: :view do
  before(:each) do
    assign(:client, Client.new(
      :username => "MyString",
      :email => "MyString",
      :name => "MyString",
      :password => "MyString",
      :photo => "MyString",
      :location => "MyString"
    ))
  end

  it "renders new client form" do
    render

    assert_select "form[action=?][method=?]", clients_path, "post" do

      assert_select "input#client_username[name=?]", "client[username]"

      assert_select "input#client_email[name=?]", "client[email]"

      assert_select "input#client_name[name=?]", "client[name]"

      assert_select "input#client_password[name=?]", "client[password]"

      assert_select "input#client_photo[name=?]", "client[photo]"

      assert_select "input#client_location[name=?]", "client[location]"
    end
  end
end


text:
package com.zugaldia.robocar.software.camera;

/**
 * Notifies the camera is ready to take pictures
 */
public interface CameraOperatorListener {

  void sessionStarted();

}


text:
@interface NWJSONResponseSerializer : AFJSONResponseSerializer

@end