code
stringlengths 3
1.05M
| repo_name
stringlengths 4
116
| path
stringlengths 3
942
| language
stringclasses 30
values | license
stringclasses 15
values | size
int32 3
1.05M
|
---|---|---|---|---|---|
using System.Web.Mvc;
using T7.ControleFinanceiro.Core.Web;
using T7.ControleFinanceiro.Domain.Interface.Service.Account.Settings;
namespace T7.ControleFinanceiro.UI.Areas.Account.Controllers
{
public class SettingsController : BaseController
{
#region Attibutes
private IProfileService _profileService;
#endregion
#region Ctor
public SettingsController(IProfileService profileService)
{
_profileService = profileService;
}
#endregion
#region Methods
/// <summary>
///
/// </summary>
/// <returns></returns>
public ActionResult Index()
{
var profile = _profileService.GetById(UserId);
return View(profile);
}
#endregion
}
} | t7tech/Controle-Financeiro | src/T7.ControleFinanceiro.UI/Areas/Account/Controllers/SettingsController.cs | C# | mit | 829 |
# generate a empty graph with k nodes
# get position from pygraphviz module
# link all (0,k) edges to get a star graph
# import packages
import networkx as nx
import numpy as np
import math
class GetInit:
def __init__(self):
pass
# initialize a graph that all the other nodes
# connect to node 0 and return the graph and position array
def init_graph(self, k):
g = nx.empty_graph(k)
# get and store positions into array 'pos'
pos = nx.spring_layout(g, dim=2)
for i in range(1, k):
g.add_edge(0, i)
return g, pos
# calculate the weight of all the possible edges and
# store the values into a matrix for future use
def calc_weight(self, pos, k):
# initialize empty 2D array
w = np.empty([k, k])
# loop over all nodes
for i in range(k):
for j in range(k):
square = 0
for m in range(2):
square += (pos[i][m] - pos[j][m])**2
w[i][j] = math.sqrt(square)
return w
| tautomer/mcmc | mcmc/graph_init.py | Python | mit | 1,063 |
package fr.upem.requests;
import java.sql.SQLException;
public class RightsUnitTests {
public static void main(String[] args) {
RequestsWithRoleCheck requestsWithRoleCheck;
try {
requestsWithRoleCheck = new RequestsWithRoleCheck("jdbc:mysql://localhost:3306/test?useSSL=false", "root", "", true);
} catch (ClassNotFoundException | IllegalAccessException | SQLException | InstantiationException e) {
e.printStackTrace();
return;
}
try {
requestsWithRoleCheck.getPatientInfosById("jmolina", 0);
} catch (NoRightToException e) {
System.err.println("The user jmolina is supposed to be able to use getPatientInfosById.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByDMPId("jmolina", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByFirstName("jmolina", "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByFirstName("jmolina", "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByLastName("jmolina", "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByPatientId("jmolina", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDossier("jmolina", "", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPPrescription("jmolina", 0, 0, "", "", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPEpisode("jmolina", 0, 0, "", "", "", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPAntecedent("jmolina", 0, 0, "", "", "", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPElements("jmolina", 0, 0, 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPDocument("jmolina", 0, 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getPrescriptions("jmolina", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getEpisode("jmolina", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getAntecedent("jmolina", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getElements("jmolina", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getDocument("jmolina", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addPrescription("jmolina", 0, "", "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addEpisode("jmolina", 0, "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addAntecedent("jmolina", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addElement("jmolina", 0, "", "", 0.0f, "", 0.0f, "", "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDocument("jmolina", 0, null, 0.0f, "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getPatientInfosById("porcel", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByDMPId("porcel", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByFirstName("porcel", "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByFirstName("porcel", "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByLastName("porcel", "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByPatientId("porcel", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDossier("porcel", "", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPPrescription("porcel", 0, 0, "", "", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPEpisode("porcel", 0, 0, "", "", "", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPAntecedent("porcel", 0, 0, "", "", "", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPElements("porcel", 0, 0, 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPDocument("porcel", 0, 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getPrescriptions("porcel", 0);
} catch (NoRightToException e) {
System.err.println("The user porcel is supposed to be able to use getPrescriptions.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getEpisode("porcel", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getAntecedent("porcel", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getElements("porcel", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getDocument("porcel", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addPrescription("porcel", 0, "", "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addEpisode("porcel", 0, "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addAntecedent("porcel", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addElement("porcel", 0, "", "", 0.0f, "", 0.0f, "", "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDocument("porcel", 0, null, 0.0f, "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getPatientInfosById("fsimon", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByDMPId("fsimon", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByFirstName("fsimon", "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByFirstName("fsimon", "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByLastName("fsimon", "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByPatientId("fsimon", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDossier("fsimon", "", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPPrescription("fsimon", 0, 0, "", "", 0);
} catch (NoRightToException e) {
System.err.println("The user fsimon is supposed to be able to use addDMPPrescription.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPEpisode("fsimon", 0, 0, "", "", "", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPAntecedent("fsimon", 0, 0, "", "", "", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPElements("fsimon", 0, 0, 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPDocument("fsimon", 0, 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getPrescriptions("fsimon", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getEpisode("fsimon", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getAntecedent("fsimon", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getElements("fsimon", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getDocument("fsimon", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addPrescription("fsimon", 0, "", "");
} catch (NoRightToException e) {
System.err.println("The user fsimon is supposed to be able to use addPrescription.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addEpisode("fsimon", 0, "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addAntecedent("fsimon", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addElement("fsimon", 0, "", "", 0.0f, "", 0.0f, "", "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDocument("fsimon", 0, null, 0.0f, "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getPatientInfosById("fdesgrandchamps", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByDMPId("fdesgrandchamps", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByFirstName("fdesgrandchamps", "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByFirstName("fdesgrandchamps", "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByLastName("fdesgrandchamps", "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByPatientId("fdesgrandchamps", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDossier("fdesgrandchamps", "", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPPrescription("fdesgrandchamps", 0, 0, "", "", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPEpisode("fdesgrandchamps", 0, 0, "", "", "", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPAntecedent("fdesgrandchamps", 0, 0, "", "", "", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPElements("fdesgrandchamps", 0, 0, 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPDocument("fdesgrandchamps", 0, 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getPrescriptions("fdesgrandchamps", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getEpisode("fdesgrandchamps", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getAntecedent("fdesgrandchamps", 0);
} catch (NoRightToException e) {
System.err.println("The user fdesgrandchamps is supposed to be able to use getAntecedent.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getElements("fdesgrandchamps", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getDocument("fdesgrandchamps", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addPrescription("fdesgrandchamps", 0, "", "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addEpisode("fdesgrandchamps", 0, "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addAntecedent("fdesgrandchamps", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addElement("fdesgrandchamps", 0, "", "", 0.0f, "", 0.0f, "", "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDocument("fdesgrandchamps", 0, null, 0.0f, "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getPatientInfosById("edekerviler", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByDMPId("edekerviler", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByFirstName("edekerviler", "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByFirstName("edekerviler", "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByLastName("edekerviler", "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByPatientId("edekerviler", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDossier("edekerviler", "", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPPrescription("edekerviler", 0, 0, "", "", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPEpisode("edekerviler", 0, 0, "", "", "", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPAntecedent("edekerviler", 0, 0, "", "", "", 0);
} catch (NoRightToException e) {
System.err.println("The user edekerviler is supposed to be able to use addDMPAntecedent.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPElements("edekerviler", 0, 0, 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPDocument("edekerviler", 0, 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getPrescriptions("edekerviler", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getEpisode("edekerviler", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getAntecedent("edekerviler", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getElements("edekerviler", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getDocument("edekerviler", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addPrescription("edekerviler", 0, "", "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addEpisode("edekerviler", 0, "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addAntecedent("edekerviler", 0);
} catch (NoRightToException e) {
System.err.println("The user edekerviler is supposed to be able to use addAntecedent.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addElement("edekerviler", 0, "", "", 0.0f, "", 0.0f, "", "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDocument("edekerviler", 0, null, 0.0f, "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getPatientInfosById("phenry", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByDMPId("phenry", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByFirstName("phenry", "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByFirstName("phenry", "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByLastName("phenry", "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByPatientId("phenry", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDossier("phenry", "", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPPrescription("phenry", 0, 0, "", "", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPEpisode("phenry", 0, 0, "", "", "", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPAntecedent("phenry", 0, 0, "", "", "", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPElements("phenry", 0, 0, 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPDocument("phenry", 0, 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getPrescriptions("phenry", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getEpisode("phenry", 0);
} catch (NoRightToException e) {
System.err.println("The user phenry is supposed to be able to use getEpisode.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getAntecedent("phenry", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getElements("phenry", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getDocument("phenry", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addPrescription("phenry", 0, "", "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addEpisode("phenry", 0, "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addAntecedent("phenry", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addElement("phenry", 0, "", "", 0.0f, "", 0.0f, "", "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDocument("phenry", 0, null, 0.0f, "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getPatientInfosById("pherman", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByDMPId("pherman", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByFirstName("pherman", "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByFirstName("pherman", "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByLastName("pherman", "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByPatientId("pherman", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDossier("pherman", "", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPPrescription("pherman", 0, 0, "", "", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPEpisode("pherman", 0, 0, "", "", "", 0);
} catch (NoRightToException e) {
System.err.println("The user pherman is supposed to be able to use addDMPEpisode.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPAntecedent("pherman", 0, 0, "", "", "", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPElements("pherman", 0, 0, 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPDocument("pherman", 0, 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getPrescriptions("pherman", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getEpisode("pherman", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getAntecedent("pherman", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getElements("pherman", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getDocument("pherman", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addPrescription("pherman", 0, "", "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addEpisode("pherman", 0, "");
} catch (NoRightToException e) {
System.err.println("The user pherman is supposed to be able to use addEpisode.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addAntecedent("pherman", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addElement("pherman", 0, "", "", 0.0f, "", 0.0f, "", "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDocument("pherman", 0, null, 0.0f, "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getPatientInfosById("hchabriat", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByDMPId("hchabriat", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByFirstName("hchabriat", "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByFirstName("hchabriat", "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByLastName("hchabriat", "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByPatientId("hchabriat", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDossier("hchabriat", "", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPPrescription("hchabriat", 0, 0, "", "", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPEpisode("hchabriat", 0, 0, "", "", "", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPAntecedent("hchabriat", 0, 0, "", "", "", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPElements("hchabriat", 0, 0, 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPDocument("hchabriat", 0, 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getPrescriptions("hchabriat", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getEpisode("hchabriat", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getAntecedent("hchabriat", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getElements("hchabriat", 0);
} catch (NoRightToException e) {
System.err.println("The user hchabriat is supposed to be able to use getElements.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getDocument("hchabriat", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addPrescription("hchabriat", 0, "", "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addEpisode("hchabriat", 0, "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addAntecedent("hchabriat", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addElement("hchabriat", 0, "", "", 0.0f, "", 0.0f, "", "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDocument("hchabriat", 0, null, 0.0f, "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getPatientInfosById("rtadayoni", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByDMPId("rtadayoni", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByFirstName("rtadayoni", "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByFirstName("rtadayoni", "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByLastName("rtadayoni", "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByPatientId("rtadayoni", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDossier("rtadayoni", "", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPPrescription("rtadayoni", 0, 0, "", "", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPEpisode("rtadayoni", 0, 0, "", "", "", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPAntecedent("rtadayoni", 0, 0, "", "", "", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPElements("rtadayoni", 0, 0, 0);
} catch (NoRightToException e) {
System.err.println("The user rtadayoni is supposed to be able to use addDMPElements.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPDocument("rtadayoni", 0, 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getPrescriptions("rtadayoni", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getEpisode("rtadayoni", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getAntecedent("rtadayoni", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getElements("rtadayoni", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getDocument("rtadayoni", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addPrescription("rtadayoni", 0, "", "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addEpisode("rtadayoni", 0, "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addAntecedent("rtadayoni", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addElement("rtadayoni", 0, "", "", 0.0f, "", 0.0f, "", "");
} catch (NoRightToException e) {
System.err.println("The user rtadayoni is supposed to be able to use addElement.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDocument("rtadayoni", 0, null, 0.0f, "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getPatientInfosById("acohensolal", 0);
} catch (NoRightToException e) {
System.err.println("The user acohensolal is supposed to be able to use getPatientInfosById.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByDMPId("acohensolal", 0);
} catch (NoRightToException e) {
System.err.println("The user acohensolal is supposed to be able to use getFullDMPByDMPId.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByFirstName("acohensolal", "");
} catch (NoRightToException e) {
System.err.println("The user acohensolal is supposed to be able to use getFullDMPByFirstName.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByFirstName("acohensolal", "");
} catch (NoRightToException e) {
System.err.println("The user acohensolal is supposed to be able to use getFullDMPByFirstName.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByLastName("acohensolal", "");
} catch (NoRightToException e) {
System.err.println("The user acohensolal is supposed to be able to use getFullDMPByLastName.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByPatientId("acohensolal", 0);
} catch (NoRightToException e) {
System.err.println("The user acohensolal is supposed to be able to use getFullDMPByPatientId.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDossier("acohensolal", "", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPPrescription("acohensolal", 0, 0, "", "", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPEpisode("acohensolal", 0, 0, "", "", "", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPAntecedent("acohensolal", 0, 0, "", "", "", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPElements("acohensolal", 0, 0, 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPDocument("acohensolal", 0, 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getPrescriptions("acohensolal", 0);
} catch (NoRightToException e) {
System.err.println("The user acohensolal is supposed to be able to use getPrescriptions.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getEpisode("acohensolal", 0);
} catch (NoRightToException e) {
System.err.println("The user acohensolal is supposed to be able to use getEpisode.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getAntecedent("acohensolal", 0);
} catch (NoRightToException e) {
System.err.println("The user acohensolal is supposed to be able to use getAntecedent.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getElements("acohensolal", 0);
} catch (NoRightToException e) {
System.err.println("The user acohensolal is supposed to be able to use getElements.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getDocument("acohensolal", 0);
} catch (NoRightToException e) {
System.err.println("The user acohensolal is supposed to be able to use getDocument.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addPrescription("acohensolal", 0, "", "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addEpisode("acohensolal", 0, "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addAntecedent("acohensolal", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addElement("acohensolal", 0, "", "", 0.0f, "", 0.0f, "", "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDocument("acohensolal", 0, null, 0.0f, "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getPatientInfosById("jbenifla", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByDMPId("jbenifla", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByFirstName("jbenifla", "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByFirstName("jbenifla", "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByLastName("jbenifla", "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByPatientId("jbenifla", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDossier("jbenifla", "", 0);
} catch (NoRightToException e) {
System.err.println("The user jbenifla is supposed to be able to use addDossier.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPPrescription("jbenifla", 0, 0, "", "", 0);
} catch (NoRightToException e) {
System.err.println("The user jbenifla is supposed to be able to use addDMPPrescription.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPEpisode("jbenifla", 0, 0, "", "", "", 0);
} catch (NoRightToException e) {
System.err.println("The user jbenifla is supposed to be able to use addDMPEpisode.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPAntecedent("jbenifla", 0, 0, "", "", "", 0);
} catch (NoRightToException e) {
System.err.println("The user jbenifla is supposed to be able to use addDMPAntecedent.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPElements("jbenifla", 0, 0, 0);
} catch (NoRightToException e) {
System.err.println("The user jbenifla is supposed to be able to use addDMPElements.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPDocument("jbenifla", 0, 0);
} catch (NoRightToException e) {
System.err.println("The user jbenifla is supposed to be able to use addDMPDocument.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getPrescriptions("jbenifla", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getEpisode("jbenifla", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getAntecedent("jbenifla", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getElements("jbenifla", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getDocument("jbenifla", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addPrescription("jbenifla", 0, "", "");
} catch (NoRightToException e) {
System.err.println("The user jbenifla is supposed to be able to use addPrescription.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addEpisode("jbenifla", 0, "");
} catch (NoRightToException e) {
System.err.println("The user jbenifla is supposed to be able to use addEpisode.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addAntecedent("jbenifla", 0);
} catch (NoRightToException e) {
System.err.println("The user jbenifla is supposed to be able to use addAntecedent.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addElement("jbenifla", 0, "", "", 0.0f, "", 0.0f, "", "");
} catch (NoRightToException e) {
System.err.println("The user jbenifla is supposed to be able to use addElement.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDocument("jbenifla", 0, null, 0.0f, "");
} catch (NoRightToException e) {
System.err.println("The user jbenifla is supposed to be able to use addDocument.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getPatientInfosById("mallez", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByDMPId("mallez", 0);
} catch (NoRightToException e) {
System.err.println("The user mallez is supposed to be able to use getFullDMPByDMPId.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByFirstName("mallez", "");
} catch (NoRightToException e) {
System.err.println("The user mallez is supposed to be able to use getFullDMPByFirstName.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByFirstName("mallez", "");
} catch (NoRightToException e) {
System.err.println("The user mallez is supposed to be able to use getFullDMPByFirstName.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByLastName("mallez", "");
} catch (NoRightToException e) {
System.err.println("The user mallez is supposed to be able to use getFullDMPByLastName.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByPatientId("mallez", 0);
} catch (NoRightToException e) {
System.err.println("The user mallez is supposed to be able to use getFullDMPByPatientId.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDossier("mallez", "", 0);
} catch (NoRightToException e) {
System.err.println("The user mallez is supposed to be able to use addDossier.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPPrescription("mallez", 0, 0, "", "", 0);
} catch (NoRightToException e) {
System.err.println("The user mallez is supposed to be able to use addDMPPrescription.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPEpisode("mallez", 0, 0, "", "", "", 0);
} catch (NoRightToException e) {
System.err.println("The user mallez is supposed to be able to use addDMPEpisode.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPAntecedent("mallez", 0, 0, "", "", "", 0);
} catch (NoRightToException e) {
System.err.println("The user mallez is supposed to be able to use addDMPAntecedent.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPElements("mallez", 0, 0, 0);
} catch (NoRightToException e) {
System.err.println("The user mallez is supposed to be able to use addDMPElements.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPDocument("mallez", 0, 0);
} catch (NoRightToException e) {
System.err.println("The user mallez is supposed to be able to use addDMPDocument.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getPrescriptions("mallez", 0);
} catch (NoRightToException e) {
System.err.println("The user mallez is supposed to be able to use getPrescriptions.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getEpisode("mallez", 0);
} catch (NoRightToException e) {
System.err.println("The user mallez is supposed to be able to use getEpisode.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getAntecedent("mallez", 0);
} catch (NoRightToException e) {
System.err.println("The user mallez is supposed to be able to use getAntecedent.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getElements("mallez", 0);
} catch (NoRightToException e) {
System.err.println("The user mallez is supposed to be able to use getElements.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getDocument("mallez", 0);
} catch (NoRightToException e) {
System.err.println("The user mallez is supposed to be able to use getDocument.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addPrescription("mallez", 0, "", "");
} catch (NoRightToException e) {
System.err.println("The user mallez is supposed to be able to use addPrescription.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addEpisode("mallez", 0, "");
} catch (NoRightToException e) {
System.err.println("The user mallez is supposed to be able to use addEpisode.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addAntecedent("mallez", 0);
} catch (NoRightToException e) {
System.err.println("The user mallez is supposed to be able to use addAntecedent.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addElement("mallez", 0, "", "", 0.0f, "", 0.0f, "", "");
} catch (NoRightToException e) {
System.err.println("The user mallez is supposed to be able to use addElement.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDocument("mallez", 0, null, 0.0f, "");
} catch (NoRightToException e) {
System.err.println("The user mallez is supposed to be able to use addDocument.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getPatientInfosById("bmegarbane", 0);
} catch (NoRightToException e) {
System.err.println("The user bmegarbane is supposed to be able to use getPatientInfosById.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByDMPId("bmegarbane", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByFirstName("bmegarbane", "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByFirstName("bmegarbane", "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByLastName("bmegarbane", "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByPatientId("bmegarbane", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDossier("bmegarbane", "", 0);
} catch (NoRightToException e) {
System.err.println("The user bmegarbane is supposed to be able to use addDossier.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPPrescription("bmegarbane", 0, 0, "", "", 0);
} catch (NoRightToException e) {
System.err.println("The user bmegarbane is supposed to be able to use addDMPPrescription.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPEpisode("bmegarbane", 0, 0, "", "", "", 0);
} catch (NoRightToException e) {
System.err.println("The user bmegarbane is supposed to be able to use addDMPEpisode.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPAntecedent("bmegarbane", 0, 0, "", "", "", 0);
} catch (NoRightToException e) {
System.err.println("The user bmegarbane is supposed to be able to use addDMPAntecedent.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPElements("bmegarbane", 0, 0, 0);
} catch (NoRightToException e) {
System.err.println("The user bmegarbane is supposed to be able to use addDMPElements.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPDocument("bmegarbane", 0, 0);
} catch (NoRightToException e) {
System.err.println("The user bmegarbane is supposed to be able to use addDMPDocument.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getPrescriptions("bmegarbane", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getEpisode("bmegarbane", 0);
} catch (NoRightToException e) {
System.err.println("The user bmegarbane is supposed to be able to use getEpisode.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getAntecedent("bmegarbane", 0);
} catch (NoRightToException e) {
System.err.println("The user bmegarbane is supposed to be able to use getAntecedent.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getElements("bmegarbane", 0);
} catch (NoRightToException e) {
System.err.println("The user bmegarbane is supposed to be able to use getElements.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getDocument("bmegarbane", 0);
} catch (NoRightToException e) {
System.err.println("The user bmegarbane is supposed to be able to use getDocument.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addPrescription("bmegarbane", 0, "", "");
} catch (NoRightToException e) {
System.err.println("The user bmegarbane is supposed to be able to use addPrescription.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addEpisode("bmegarbane", 0, "");
} catch (NoRightToException e) {
System.err.println("The user bmegarbane is supposed to be able to use addEpisode.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addAntecedent("bmegarbane", 0);
} catch (NoRightToException e) {
System.err.println("The user bmegarbane is supposed to be able to use addAntecedent.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addElement("bmegarbane", 0, "", "", 0.0f, "", 0.0f, "", "");
} catch (NoRightToException e) {
System.err.println("The user bmegarbane is supposed to be able to use addElement.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDocument("bmegarbane", 0, null, 0.0f, "");
} catch (NoRightToException e) {
System.err.println("The user bmegarbane is supposed to be able to use addDocument.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getPatientInfosById("dpayendelagaranderie", 0);
} catch (NoRightToException e) {
System.err.println("The user dpayendelagaranderie is supposed to be able to use getPatientInfosById.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByDMPId("dpayendelagaranderie", 0);
} catch (NoRightToException e) {
System.err.println("The user dpayendelagaranderie is supposed to be able to use getFullDMPByDMPId.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByFirstName("dpayendelagaranderie", "");
} catch (NoRightToException e) {
System.err.println("The user dpayendelagaranderie is supposed to be able to use getFullDMPByFirstName.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByFirstName("dpayendelagaranderie", "");
} catch (NoRightToException e) {
System.err.println("The user dpayendelagaranderie is supposed to be able to use getFullDMPByFirstName.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByLastName("dpayendelagaranderie", "");
} catch (NoRightToException e) {
System.err.println("The user dpayendelagaranderie is supposed to be able to use getFullDMPByLastName.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByPatientId("dpayendelagaranderie", 0);
} catch (NoRightToException e) {
System.err.println("The user dpayendelagaranderie is supposed to be able to use getFullDMPByPatientId.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDossier("dpayendelagaranderie", "", 0);
} catch (NoRightToException e) {
System.err.println("The user dpayendelagaranderie is supposed to be able to use addDossier.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPPrescription("dpayendelagaranderie", 0, 0, "", "", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPEpisode("dpayendelagaranderie", 0, 0, "", "", "", 0);
} catch (NoRightToException e) {
System.err.println("The user dpayendelagaranderie is supposed to be able to use addDMPEpisode.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPAntecedent("dpayendelagaranderie", 0, 0, "", "", "", 0);
} catch (NoRightToException e) {
System.err.println("The user dpayendelagaranderie is supposed to be able to use addDMPAntecedent.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPElements("dpayendelagaranderie", 0, 0, 0);
} catch (NoRightToException e) {
System.err.println("The user dpayendelagaranderie is supposed to be able to use addDMPElements.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPDocument("dpayendelagaranderie", 0, 0);
} catch (NoRightToException e) {
System.err.println("The user dpayendelagaranderie is supposed to be able to use addDMPDocument.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getPrescriptions("dpayendelagaranderie", 0);
} catch (NoRightToException e) {
System.err.println("The user dpayendelagaranderie is supposed to be able to use getPrescriptions.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getEpisode("dpayendelagaranderie", 0);
} catch (NoRightToException e) {
System.err.println("The user dpayendelagaranderie is supposed to be able to use getEpisode.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getAntecedent("dpayendelagaranderie", 0);
} catch (NoRightToException e) {
System.err.println("The user dpayendelagaranderie is supposed to be able to use getAntecedent.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getElements("dpayendelagaranderie", 0);
} catch (NoRightToException e) {
System.err.println("The user dpayendelagaranderie is supposed to be able to use getElements.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getDocument("dpayendelagaranderie", 0);
} catch (NoRightToException e) {
System.err.println("The user dpayendelagaranderie is supposed to be able to use getDocument.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addPrescription("dpayendelagaranderie", 0, "", "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addEpisode("dpayendelagaranderie", 0, "");
} catch (NoRightToException e) {
System.err.println("The user dpayendelagaranderie is supposed to be able to use addEpisode.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addAntecedent("dpayendelagaranderie", 0);
} catch (NoRightToException e) {
System.err.println("The user dpayendelagaranderie is supposed to be able to use addAntecedent.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addElement("dpayendelagaranderie", 0, "", "", 0.0f, "", 0.0f, "", "");
} catch (NoRightToException e) {
System.err.println("The user dpayendelagaranderie is supposed to be able to use addElement.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDocument("dpayendelagaranderie", 0, null, 0.0f, "");
} catch (NoRightToException e) {
System.err.println("The user dpayendelagaranderie is supposed to be able to use addDocument.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getPatientInfosById("hbarreteau", 0);
} catch (NoRightToException e) {
System.err.println("The user hbarreteau is supposed to be able to use getPatientInfosById.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByDMPId("hbarreteau", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByFirstName("hbarreteau", "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByFirstName("hbarreteau", "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByLastName("hbarreteau", "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByPatientId("hbarreteau", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDossier("hbarreteau", "", 0);
} catch (NoRightToException e) {
System.err.println("The user hbarreteau is supposed to be able to use addDossier.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPPrescription("hbarreteau", 0, 0, "", "", 0);
} catch (NoRightToException e) {
System.err.println("The user hbarreteau is supposed to be able to use addDMPPrescription.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPEpisode("hbarreteau", 0, 0, "", "", "", 0);
} catch (NoRightToException e) {
System.err.println("The user hbarreteau is supposed to be able to use addDMPEpisode.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPAntecedent("hbarreteau", 0, 0, "", "", "", 0);
} catch (NoRightToException e) {
System.err.println("The user hbarreteau is supposed to be able to use addDMPAntecedent.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPElements("hbarreteau", 0, 0, 0);
} catch (NoRightToException e) {
System.err.println("The user hbarreteau is supposed to be able to use addDMPElements.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPDocument("hbarreteau", 0, 0);
} catch (NoRightToException e) {
System.err.println("The user hbarreteau is supposed to be able to use addDMPDocument.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getPrescriptions("hbarreteau", 0);
} catch (NoRightToException e) {
System.err.println("The user hbarreteau is supposed to be able to use getPrescriptions.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getEpisode("hbarreteau", 0);
} catch (NoRightToException e) {
System.err.println("The user hbarreteau is supposed to be able to use getEpisode.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getAntecedent("hbarreteau", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getElements("hbarreteau", 0);
} catch (NoRightToException e) {
System.err.println("The user hbarreteau is supposed to be able to use getElements.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getDocument("hbarreteau", 0);
} catch (NoRightToException e) {
System.err.println("The user hbarreteau is supposed to be able to use getDocument.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addPrescription("hbarreteau", 0, "", "");
} catch (NoRightToException e) {
System.err.println("The user hbarreteau is supposed to be able to use addPrescription.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addEpisode("hbarreteau", 0, "");
} catch (NoRightToException e) {
System.err.println("The user hbarreteau is supposed to be able to use addEpisode.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addAntecedent("hbarreteau", 0);
} catch (NoRightToException e) {
System.err.println("The user hbarreteau is supposed to be able to use addAntecedent.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addElement("hbarreteau", 0, "", "", 0.0f, "", 0.0f, "", "");
} catch (NoRightToException e) {
System.err.println("The user hbarreteau is supposed to be able to use addElement.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDocument("hbarreteau", 0, null, 0.0f, "");
} catch (NoRightToException e) {
System.err.println("The user hbarreteau is supposed to be able to use addDocument.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getPatientInfosById("jlaredo", 0);
} catch (NoRightToException e) {
System.err.println("The user jlaredo is supposed to be able to use getPatientInfosById.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByDMPId("jlaredo", 0);
} catch (NoRightToException e) {
System.err.println("The user jlaredo is supposed to be able to use getFullDMPByDMPId.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByFirstName("jlaredo", "");
} catch (NoRightToException e) {
System.err.println("The user jlaredo is supposed to be able to use getFullDMPByFirstName.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByFirstName("jlaredo", "");
} catch (NoRightToException e) {
System.err.println("The user jlaredo is supposed to be able to use getFullDMPByFirstName.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByLastName("jlaredo", "");
} catch (NoRightToException e) {
System.err.println("The user jlaredo is supposed to be able to use getFullDMPByLastName.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByPatientId("jlaredo", 0);
} catch (NoRightToException e) {
System.err.println("The user jlaredo is supposed to be able to use getFullDMPByPatientId.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDossier("jlaredo", "", 0);
} catch (NoRightToException e) {
System.err.println("The user jlaredo is supposed to be able to use addDossier.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPPrescription("jlaredo", 0, 0, "", "", 0);
} catch (NoRightToException e) {
System.err.println("The user jlaredo is supposed to be able to use addDMPPrescription.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPEpisode("jlaredo", 0, 0, "", "", "", 0);
} catch (NoRightToException e) {
System.err.println("The user jlaredo is supposed to be able to use addDMPEpisode.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPAntecedent("jlaredo", 0, 0, "", "", "", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPElements("jlaredo", 0, 0, 0);
} catch (NoRightToException e) {
System.err.println("The user jlaredo is supposed to be able to use addDMPElements.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPDocument("jlaredo", 0, 0);
} catch (NoRightToException e) {
System.err.println("The user jlaredo is supposed to be able to use addDMPDocument.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getPrescriptions("jlaredo", 0);
} catch (NoRightToException e) {
System.err.println("The user jlaredo is supposed to be able to use getPrescriptions.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getEpisode("jlaredo", 0);
} catch (NoRightToException e) {
System.err.println("The user jlaredo is supposed to be able to use getEpisode.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getAntecedent("jlaredo", 0);
} catch (NoRightToException e) {
System.err.println("The user jlaredo is supposed to be able to use getAntecedent.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getElements("jlaredo", 0);
} catch (NoRightToException e) {
System.err.println("The user jlaredo is supposed to be able to use getElements.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getDocument("jlaredo", 0);
} catch (NoRightToException e) {
System.err.println("The user jlaredo is supposed to be able to use getDocument.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addPrescription("jlaredo", 0, "", "");
} catch (NoRightToException e) {
System.err.println("The user jlaredo is supposed to be able to use addPrescription.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addEpisode("jlaredo", 0, "");
} catch (NoRightToException e) {
System.err.println("The user jlaredo is supposed to be able to use addEpisode.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addAntecedent("jlaredo", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addElement("jlaredo", 0, "", "", 0.0f, "", 0.0f, "", "");
} catch (NoRightToException e) {
System.err.println("The user jlaredo is supposed to be able to use addElement.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDocument("jlaredo", 0, null, 0.0f, "");
} catch (NoRightToException e) {
System.err.println("The user jlaredo is supposed to be able to use addDocument.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getPatientInfosById("olaprevote", 0);
} catch (NoRightToException e) {
System.err.println("The user olaprevote is supposed to be able to use getPatientInfosById.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByDMPId("olaprevote", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByFirstName("olaprevote", "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByFirstName("olaprevote", "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByLastName("olaprevote", "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByPatientId("olaprevote", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDossier("olaprevote", "", 0);
} catch (NoRightToException e) {
System.err.println("The user olaprevote is supposed to be able to use addDossier.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPPrescription("olaprevote", 0, 0, "", "", 0);
} catch (NoRightToException e) {
System.err.println("The user olaprevote is supposed to be able to use addDMPPrescription.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPEpisode("olaprevote", 0, 0, "", "", "", 0);
} catch (NoRightToException e) {
System.err.println("The user olaprevote is supposed to be able to use addDMPEpisode.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPAntecedent("olaprevote", 0, 0, "", "", "", 0);
} catch (NoRightToException e) {
System.err.println("The user olaprevote is supposed to be able to use addDMPAntecedent.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPElements("olaprevote", 0, 0, 0);
} catch (NoRightToException e) {
System.err.println("The user olaprevote is supposed to be able to use addDMPElements.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPDocument("olaprevote", 0, 0);
} catch (NoRightToException e) {
System.err.println("The user olaprevote is supposed to be able to use addDMPDocument.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getPrescriptions("olaprevote", 0);
} catch (NoRightToException e) {
System.err.println("The user olaprevote is supposed to be able to use getPrescriptions.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getEpisode("olaprevote", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getAntecedent("olaprevote", 0);
} catch (NoRightToException e) {
System.err.println("The user olaprevote is supposed to be able to use getAntecedent.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getElements("olaprevote", 0);
} catch (NoRightToException e) {
System.err.println("The user olaprevote is supposed to be able to use getElements.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getDocument("olaprevote", 0);
} catch (NoRightToException e) {
System.err.println("The user olaprevote is supposed to be able to use getDocument.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addPrescription("olaprevote", 0, "", "");
} catch (NoRightToException e) {
System.err.println("The user olaprevote is supposed to be able to use addPrescription.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addEpisode("olaprevote", 0, "");
} catch (NoRightToException e) {
System.err.println("The user olaprevote is supposed to be able to use addEpisode.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addAntecedent("olaprevote", 0);
} catch (NoRightToException e) {
System.err.println("The user olaprevote is supposed to be able to use addAntecedent.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addElement("olaprevote", 0, "", "", 0.0f, "", 0.0f, "", "");
} catch (NoRightToException e) {
System.err.println("The user olaprevote is supposed to be able to use addElement.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDocument("olaprevote", 0, null, 0.0f, "");
} catch (NoRightToException e) {
System.err.println("The user olaprevote is supposed to be able to use addDocument.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getPatientInfosById("salifa", 0);
} catch (NoRightToException e) {
System.err.println("The user salifa is supposed to be able to use getPatientInfosById.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByDMPId("salifa", 0);
} catch (NoRightToException e) {
System.err.println("The user salifa is supposed to be able to use getFullDMPByDMPId.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByFirstName("salifa", "");
} catch (NoRightToException e) {
System.err.println("The user salifa is supposed to be able to use getFullDMPByFirstName.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByFirstName("salifa", "");
} catch (NoRightToException e) {
System.err.println("The user salifa is supposed to be able to use getFullDMPByFirstName.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByLastName("salifa", "");
} catch (NoRightToException e) {
System.err.println("The user salifa is supposed to be able to use getFullDMPByLastName.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByPatientId("salifa", 0);
} catch (NoRightToException e) {
System.err.println("The user salifa is supposed to be able to use getFullDMPByPatientId.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDossier("salifa", "", 0);
} catch (NoRightToException e) {
System.err.println("The user salifa is supposed to be able to use addDossier.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPPrescription("salifa", 0, 0, "", "", 0);
} catch (NoRightToException e) {
System.err.println("The user salifa is supposed to be able to use addDMPPrescription.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPEpisode("salifa", 0, 0, "", "", "", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPAntecedent("salifa", 0, 0, "", "", "", 0);
} catch (NoRightToException e) {
System.err.println("The user salifa is supposed to be able to use addDMPAntecedent.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPElements("salifa", 0, 0, 0);
} catch (NoRightToException e) {
System.err.println("The user salifa is supposed to be able to use addDMPElements.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPDocument("salifa", 0, 0);
} catch (NoRightToException e) {
System.err.println("The user salifa is supposed to be able to use addDMPDocument.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getPrescriptions("salifa", 0);
} catch (NoRightToException e) {
System.err.println("The user salifa is supposed to be able to use getPrescriptions.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getEpisode("salifa", 0);
} catch (NoRightToException e) {
System.err.println("The user salifa is supposed to be able to use getEpisode.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getAntecedent("salifa", 0);
} catch (NoRightToException e) {
System.err.println("The user salifa is supposed to be able to use getAntecedent.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getElements("salifa", 0);
} catch (NoRightToException e) {
System.err.println("The user salifa is supposed to be able to use getElements.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getDocument("salifa", 0);
} catch (NoRightToException e) {
System.err.println("The user salifa is supposed to be able to use getDocument.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addPrescription("salifa", 0, "", "");
} catch (NoRightToException e) {
System.err.println("The user salifa is supposed to be able to use addPrescription.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addEpisode("salifa", 0, "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addAntecedent("salifa", 0);
} catch (NoRightToException e) {
System.err.println("The user salifa is supposed to be able to use addAntecedent.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addElement("salifa", 0, "", "", 0.0f, "", 0.0f, "", "");
} catch (NoRightToException e) {
System.err.println("The user salifa is supposed to be able to use addElement.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDocument("salifa", 0, null, 0.0f, "");
} catch (NoRightToException e) {
System.err.println("The user salifa is supposed to be able to use addDocument.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getPatientInfosById("jbanas", 0);
} catch (NoRightToException e) {
System.err.println("The user jbanas is supposed to be able to use getPatientInfosById.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByDMPId("jbanas", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByFirstName("jbanas", "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByFirstName("jbanas", "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByLastName("jbanas", "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByPatientId("jbanas", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDossier("jbanas", "", 0);
} catch (NoRightToException e) {
System.err.println("The user jbanas is supposed to be able to use addDossier.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPPrescription("jbanas", 0, 0, "", "", 0);
} catch (NoRightToException e) {
System.err.println("The user jbanas is supposed to be able to use addDMPPrescription.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPEpisode("jbanas", 0, 0, "", "", "", 0);
} catch (NoRightToException e) {
System.err.println("The user jbanas is supposed to be able to use addDMPEpisode.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPAntecedent("jbanas", 0, 0, "", "", "", 0);
} catch (NoRightToException e) {
System.err.println("The user jbanas is supposed to be able to use addDMPAntecedent.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPElements("jbanas", 0, 0, 0);
} catch (NoRightToException e) {
System.err.println("The user jbanas is supposed to be able to use addDMPElements.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPDocument("jbanas", 0, 0);
} catch (NoRightToException e) {
System.err.println("The user jbanas is supposed to be able to use addDMPDocument.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getPrescriptions("jbanas", 0);
} catch (NoRightToException e) {
System.err.println("The user jbanas is supposed to be able to use getPrescriptions.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getEpisode("jbanas", 0);
} catch (NoRightToException e) {
System.err.println("The user jbanas is supposed to be able to use getEpisode.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getAntecedent("jbanas", 0);
} catch (NoRightToException e) {
System.err.println("The user jbanas is supposed to be able to use getAntecedent.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getElements("jbanas", 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getDocument("jbanas", 0);
} catch (NoRightToException e) {
System.err.println("The user jbanas is supposed to be able to use getDocument.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addPrescription("jbanas", 0, "", "");
} catch (NoRightToException e) {
System.err.println("The user jbanas is supposed to be able to use addPrescription.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addEpisode("jbanas", 0, "");
} catch (NoRightToException e) {
System.err.println("The user jbanas is supposed to be able to use addEpisode.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addAntecedent("jbanas", 0);
} catch (NoRightToException e) {
System.err.println("The user jbanas is supposed to be able to use addAntecedent.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addElement("jbanas", 0, "", "", 0.0f, "", 0.0f, "", "");
} catch (NoRightToException e) {
System.err.println("The user jbanas is supposed to be able to use addElement.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDocument("jbanas", 0, null, 0.0f, "");
} catch (NoRightToException e) {
System.err.println("The user jbanas is supposed to be able to use addDocument.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getPatientInfosById("abonet", 0);
} catch (NoRightToException e) {
System.err.println("The user abonet is supposed to be able to use getPatientInfosById.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByDMPId("abonet", 0);
} catch (NoRightToException e) {
System.err.println("The user abonet is supposed to be able to use getFullDMPByDMPId.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByFirstName("abonet", "");
} catch (NoRightToException e) {
System.err.println("The user abonet is supposed to be able to use getFullDMPByFirstName.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByFirstName("abonet", "");
} catch (NoRightToException e) {
System.err.println("The user abonet is supposed to be able to use getFullDMPByFirstName.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByLastName("abonet", "");
} catch (NoRightToException e) {
System.err.println("The user abonet is supposed to be able to use getFullDMPByLastName.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getFullDMPByPatientId("abonet", 0);
} catch (NoRightToException e) {
System.err.println("The user abonet is supposed to be able to use getFullDMPByPatientId.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDossier("abonet", "", 0);
} catch (NoRightToException e) {
System.err.println("The user abonet is supposed to be able to use addDossier.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPPrescription("abonet", 0, 0, "", "", 0);
} catch (NoRightToException e) {
System.err.println("The user abonet is supposed to be able to use addDMPPrescription.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPEpisode("abonet", 0, 0, "", "", "", 0);
} catch (NoRightToException e) {
System.err.println("The user abonet is supposed to be able to use addDMPEpisode.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPAntecedent("abonet", 0, 0, "", "", "", 0);
} catch (NoRightToException e) {
System.err.println("The user abonet is supposed to be able to use addDMPAntecedent.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPElements("abonet", 0, 0, 0);
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDMPDocument("abonet", 0, 0);
} catch (NoRightToException e) {
System.err.println("The user abonet is supposed to be able to use addDMPDocument.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getPrescriptions("abonet", 0);
} catch (NoRightToException e) {
System.err.println("The user abonet is supposed to be able to use getPrescriptions.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getEpisode("abonet", 0);
} catch (NoRightToException e) {
System.err.println("The user abonet is supposed to be able to use getEpisode.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getAntecedent("abonet", 0);
} catch (NoRightToException e) {
System.err.println("The user abonet is supposed to be able to use getAntecedent.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getElements("abonet", 0);
} catch (NoRightToException e) {
System.err.println("The user abonet is supposed to be able to use getElements.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.getDocument("abonet", 0);
} catch (NoRightToException e) {
System.err.println("The user abonet is supposed to be able to use getDocument.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addPrescription("abonet", 0, "", "");
} catch (NoRightToException e) {
System.err.println("The user abonet is supposed to be able to use addPrescription.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addEpisode("abonet", 0, "");
} catch (NoRightToException e) {
System.err.println("The user abonet is supposed to be able to use addEpisode.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addAntecedent("abonet", 0);
} catch (NoRightToException e) {
System.err.println("The user abonet is supposed to be able to use addAntecedent.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addElement("abonet", 0, "", "", 0.0f, "", 0.0f, "", "");
} catch (NoRightToException e) {
//Do nothing
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
try {
requestsWithRoleCheck.addDocument("abonet", 0, null, 0.0f, "");
} catch (NoRightToException e) {
System.err.println("The user abonet is supposed to be able to use addDocument.");
} catch (SQLException e) {
System.err.println("Failure with the database connection.");
}
}
} | JeremyBidet/DELIRE | src/fr/upem/requests/RightsUnitTests.java | Java | mit | 132,043 |
/**
* html5tooltips.js
* Light and clean tooltips with CSS3 animation.
* https://github.com/ytiurin/html5tooltipsjs
*
* Yevhen Tiurin <[email protected]>
* The MIT License (MIT)
* https://github.com/ytiurin/html5tooltipsjs/raw/master/LICENSE
*
* Contributors:
* nomiad https://github.com/nomiad
* Friedel Ziegelmayer https://github.com/Dignifiedquire
* Arend van Beelen jr. https://github.com/arendjr
* Peter Richmond https://github.com/Peripheral1994
* Bruno Wego https://github.com/brunowego
*
* July 28, 2015
**/
(function() {
var tt, tModels, options, activeElements, untieTooltips, safeTModels,
html5tooltipsPredefined = {
animateFunction: {
fadeIn: "fadein",
foldIn: "foldin",
foldOut: "foldout",
roll: "roll",
scaleIn: "scalein",
slideIn: "slidein",
spin: "spin"
},
color: {
"daffodil": {r: 255, g: 230, b: 23, a: 0.95},
"daisy": {r: 250, g: 211, b: 28, a: 0.95},
"mustard": {r: 253, g: 183, b: 23, a: 0.95},
"citrus zest": {r: 250, g: 170, b: 33, a: 0.95},
"pumpkin": {r: 241, g: 117, b: 63, a: 0.95},
"tangerine": {r: 237, g: 87, b: 36, a: 0.95},
"salmon": {r: 240, g: 70, b: 57, a: 0.95},
"persimmon": {r: 234, g: 40, b: 48, a: 0.95},
"rouge": {r: 188, g: 35, b: 38, a: 0.95},
"scarlet": {r: 140, g: 12, b: 3, a: 0.95},
"hot pink": {r: 229, g: 24, b: 93, a: 0.95},
"princess": {r: 243, g: 132, b: 174, a: 0.95},
"petal": {r: 250, g: 198, b: 210, a: 0.95},
"lilac": {r: 178, g: 150, b: 199, a: 0.95},
"lavender": {r: 123, g: 103, b: 174, a: 0.95},
"violet": {r: 95, g: 53, b: 119, a: 0.95},
"cloud": {r: 195, g: 222, b: 241, a: 0.95},
"dream": {r: 85, g: 190, b: 237, a: 0.95},
"gulf": {r: 49, g: 168, b: 224, a: 0.95},
"turquoise": {r: 35, g: 138, b: 204, a: 0.95},
"sky": {r: 13, g: 96, b: 174, a: 0.95},
"indigo": {r: 20, g: 59, b: 134, a: 0.95},
"navy": {r: 0, g: 27, b: 74, a: 0.95},
"sea foam": {r: 125, g: 205, b: 194, a: 0.95},
"teal": {r: 0, g: 168, b: 168, a: 0.95},
"peacock": {r: 18, g: 149, b: 159, a: 0.95},
"ceadon": {r: 193, g: 209, b: 138, a: 0.95},
"olive": {r: 121, g: 145, b: 85, a: 0.95},
"bamboo": {r: 128, g: 188, b: 66, a: 0.95},
"grass": {r: 74, g: 160, b: 63, a: 0.95},
"kelly": {r: 22, g: 136, b: 74, a: 0.95},
"forrest": {r: 0, g: 63, b: 46, a: 0.95},
"chocolate": {r: 56, g: 30, b: 17, a: 0.95},
"terra cotta": {r: 192, g: 92, b: 32, a: 0.95},
"camel": {r: 191, g: 155, b: 107, a: 0.95},
"linen": {r: 233, g: 212, b: 167, a: 0.95},
"stone": {r: 231, g: 230, b: 225, a: 0.95},
"smoke": {r: 207, g: 208, b: 210, a: 0.95},
"steel": {r: 138, g: 139, b: 143, a: 0.95},
"slate": {r: 119, g: 133, b: 144, a: 0.95},
"charcoal": {r: 71, g: 77, b: 77, a: 0.95},
"black": {r: 5, g: 6, b: 8, a: 0.95},
"white": {r: 255, g: 255, b: 255, a: 0.95},
"metalic silver": {r: 152, g: 162, b: 171, a: 0.95},
"metalic gold": {r: 159, g: 135, b: 89, a: 0.95},
"metalic copper": {r: 140, g: 102, b: 65, a: 0.95}
},
stickTo: {
bottom: "bottom",
left: "left",
right: "right",
top: "top"
}
},
typeTooltipModel = {
animateDuration: 300,
animateFunction: html5tooltipsPredefined.animateFunction.fadeIn,
color: null,
contentText: "",
contentMore: "",
disableAnimation: false,
stickTo: html5tooltipsPredefined.stickTo.bottom,
stickDistance: 10,
targetElements: [],
targetSelector: "",
targetXPath: "",
maxWidth: null
},
defaultOptions = {
animateDuration: null,
animateFunction: null,
color: null,
HTMLTemplate: null,
disableAnimation: null,
stickTo: null,
maxWidth: null
},
template = {
HTML: [
"<div class='html5tooltip' style='box-sizing:border-box;position:fixed;'>",
"<div class='html5tooltip-box'>",
"<div class='html5tooltip-text'></div>",
"<div class='html5tooltip-more' style='overflow:hidden;'>",
"<div class='html5tooltip-hr'></div>",
"<div class='html5tooltip-text'></div>",
"</div>",
"<div class='html5tooltip-pointer'><div class='html5tooltip-po'></div><div class='html5tooltip-pi'></div></div>",
"</div>",
"</div>"
].join(""),
hookClasses: {
tooltip: 'html5tooltip',
tooltipBox: 'html5tooltip-box',
tooltipText: 'html5tooltip-text',
tooltipMore: 'html5tooltip-more',
tooltipMoreText: 'html5tooltip-text',
tooltipPointer: 'html5tooltip-pointer'
}
};
function toArray(obj)
{
return Array.prototype.slice.call(obj);
}
function getElementsByXPath(xpath, context)
{
var nodes = [];
try {
var result = document.evaluate(xpath, (context || document), null,
XPathResult.ANY_TYPE, null);
for (var item = result.iterateNext(); item; item = result.iterateNext())
nodes.push(item);
}
catch (exc)
{
// Invalid xpath expressions make their way here sometimes. If that happens,
// we still want to return an empty set without an exception.
}
return nodes;
}
function getElementsBySelector(selector, context)
{
var nodes = [];
try {
nodes = toArray((context || document).querySelectorAll(selector));
}
catch (exc) {}
return nodes;
}
function getElementsByAttribute(attr, context)
{
var nodeList = (context || document).getElementsByTagName('*'),
nodes = [];
for (var i = 0, node; node = nodeList[i]; i++) {
if ( node.getAttribute(attr) )
nodes.push(node);
}
return nodes;
}
function extend(targetObj)
{
for (var i = 1; i < arguments.length; i++) {
if (typeof arguments[i] === "object") {
for (var property in arguments[i]) {
if (arguments[i].hasOwnProperty(property)) {
targetObj[property] = arguments[i][property];
}
}
}
}
return targetObj;
}
function Tooltip()
{
var ttElement, ttModel, targetElement, elBox, elText, elMore, elMoreText, elPointer;
function animateElementClass(el, updateHandler)
{
if (!ttModel.disableAnimation) {
// getBoundingClientRect refreshes element render box
el.getBoundingClientRect();
el.classList.add("animating");
updateHandler();
setTimeout(function() { el.classList.remove("animating"); }, ttModel.animateDuration);
}
else
updateHandler();
}
function applyAnimationClass(el, fromClass, toClass, updateHandler)
{
if (!ttModel.disableAnimation) {
el.classList.add(fromClass);
// getBoundingClientRect refreshes element render box
el.getBoundingClientRect();
el.classList.add("animating");
el.classList.remove(fromClass);
el.classList.add(toClass);
if (updateHandler)
updateHandler();
setTimeout(function() {
el.classList.remove("animating");
el.classList.remove(toClass);
}, ttModel.animateDuration);
}
else
if (updateHandler)
updateHandler();
}
function destroy()
{
document.removeChild(ttElement);
}
function hideAll()
{
if (ttElement.style.visibility !== 'collapse')
ttElement.style.visibility = 'collapse';
ttElement.style.left = '-9999px';
ttElement.style.top = '-9999px';
if (elMore.style.display !== 'none') {
elMore.style.display = 'none';
elMore.style.visibility = 'collapse';
elMore.style.height = 'auto';
}
return this;
}
function init()
{
var tmplNode = document.createElement("div");
tmplNode.innerHTML = options.HTMLTemplate ? options.HTMLTemplate : template.HTML;
ttElement = tmplNode.firstChild;
elBox = ttElement.getElementsByClassName(template.hookClasses.tooltipBox)[0];
elText = ttElement.getElementsByClassName(template.hookClasses.tooltipText)[0];
elMore = ttElement.getElementsByClassName(template.hookClasses.tooltipMore)[0];
elMoreText = elMore.getElementsByClassName(template.hookClasses.tooltipMoreText)[0];
elPointer = ttElement.getElementsByClassName(template.hookClasses.tooltipPointer)[0];
hideAll();
ttModel = extend({}, typeTooltipModel);
}
function model(userTTModel)
{
if (!userTTModel)
return ttModel;
if (ttModel !== userTTModel) {
ttModel = extend({}, typeTooltipModel, userTTModel);
updateModel();
}
return this;
}
function showBrief()
{
if (ttElement.style.visibility !== 'visible') {
ttElement.style.visibility = 'visible';
updatePos();
applyAnimationClass(elBox, ttModel.animateFunction + "-from",
ttModel.animateFunction + "-to");
}
return this;
}
function showAll()
{
if (ttElement.style.visibility !== 'visible') {
ttElement.style.visibility = 'visible';
applyAnimationClass(elBox, ttModel.animateFunction + "-from",
ttModel.animateFunction + "-to");
if (ttModel.contentMore) {
elMore.style.display = 'block';
elMore.style.visibility = 'visible';
}
updatePos();
}
else if (elMore.style.display !== 'block' && ttModel.contentMore) {
elMore.style.display = 'block';
updateTooltipPos();
// animate pointer
animateElementClass(elPointer, updatePointerPos);
var h = elMore.getBoundingClientRect().height;
elMore.style.visibility = 'visible';
elMore.style.height = '0px';
// animate more content
animateElementClass(elMore, function() {
elMore.style.height = h > 0 ? h + 'px' : "auto";
});
}
return this;
}
function target(userTargetElement)
{
if (!userTargetElement)
return targetElement;
if (targetElement !== userTargetElement) {
targetElement = userTargetElement;
}
return this;
}
function updatePos()
{
updateTooltipPos();
updatePointerPos();
}
function updatePointerPos()
{
var ttRect,pointerRect;
if (!targetElement)
return;
// position depend on target and tt width
ttRect = ttElement.getBoundingClientRect();
pointerRect = elPointer.getBoundingClientRect();
switch (ttModel.stickTo) {
case html5tooltipsPredefined.stickTo.bottom:
elPointer.style.left = parseInt((ttRect.width - pointerRect.width) / 2) + "px";
elPointer.style.top = -1 * pointerRect.height + "px";
break;
case html5tooltipsPredefined.stickTo.left:
elPointer.style.left = ttRect.width - 2 + "px";
elPointer.style.top = parseInt((ttRect.height - pointerRect.height) / 2) + "px";
break;
case html5tooltipsPredefined.stickTo.right:
elPointer.style.left = -1 * pointerRect.width + 1 + "px";
elPointer.style.top = parseInt((ttRect.height - pointerRect.height) / 2) + "px";
break;
case html5tooltipsPredefined.stickTo.top:
elPointer.style.left = parseInt((ttRect.width - pointerRect.width) / 2) + "px";
elPointer.style.top = ttRect.height - 2 + "px";
break;
}
}
function updateTooltipPos()
{
var targetRect, ttRect;
if (!targetElement)
return;
// update width
ttElement.style.width = "auto";
ttRect = ttElement.getBoundingClientRect();
var maxWidth = ttModel.maxWidth || options.maxWidth;
if (maxWidth)
ttElement.style.width = ttRect.width > maxWidth ? maxWidth + "px" : "auto";
// position depend on target and tt width
targetRect = targetElement.getBoundingClientRect();
ttRect = ttElement.getBoundingClientRect();
switch (ttModel.stickTo) {
case html5tooltipsPredefined.stickTo.bottom:
ttElement.style.left = targetRect.left + parseInt((targetRect.width - ttRect.width) / 2) + "px";
ttElement.style.top = targetRect.top + targetRect.height + parseInt(ttModel.stickDistance) + "px";
break;
case html5tooltipsPredefined.stickTo.left:
ttElement.style.left = targetRect.left - ttRect.width - parseInt(ttModel.stickDistance) + "px";
ttElement.style.top = targetRect.top + (targetRect.height - ttRect.height) / 2 + "px";
break;
case html5tooltipsPredefined.stickTo.right:
ttElement.style.left = targetRect.left + targetRect.width + parseInt(ttModel.stickDistance) + "px";
ttElement.style.top = targetRect.top + (targetRect.height - ttRect.height) / 2 + "px";
break;
case html5tooltipsPredefined.stickTo.top:
ttElement.style.left = targetRect.left + (targetRect.width - ttRect.width) / 2 + "px";
ttElement.style.top = targetRect.top - ttRect.height - parseInt(ttModel.stickDistance) + "px";
break;
}
}
function updateModel()
{
elText.innerHTML = ttModel.contentText ? ttModel.contentText : "";
elMoreText.innerHTML = ttModel.contentMore ? ttModel.contentMore : "";
// update animation
ttModel.animateDuration = options.animateDuration ? options.animateDuration : ttModel.animateDuration;
ttModel.animateFunction = options.animateFunction ? options.animateFunction : ttModel.animateFunction;
ttModel.disableAnimation = options.disableAnimation ? options.disableAnimation : ttModel.disableAnimation;
// update color
ttModel.color = options.color ? options.color : ttModel.color;
if (html5tooltipsPredefined.color[ttModel.color]) {
ttModel.color = html5tooltipsPredefined.color[ttModel.color];
ttModel.color = "rgba(" + ttModel.color.r + ", " + ttModel.color.g + ", " + ttModel.color.b + ", " + ttModel.color.a + ")";
}
elBox.style.backgroundColor = ttModel.color||'';
elPointer.style.borderColor = ttModel.color||'';
// update pointer
ttElement.className = template.hookClasses.tooltip + "-" + ttModel.stickTo;
if (document.body && ttElement.parentNode !== document.body)
document.body.appendChild(ttElement);
}
init();
return {
destroy: destroy,
hideAll: hideAll,
model: model,
showAll: showAll,
showBrief: showBrief,
target: target,
updatePos: updatePos
};
}
function pickDocumentDataTargets()
{
var pickedElements = getElementsByAttribute("data-tooltip");
tModels=safeTModels.slice();
pickedElements.forEach(function(elTarget) {
var tm = {
contentText: elTarget.getAttribute("data-tooltip"),
targetElements: [elTarget]
};
if (elTarget.getAttribute("data-tooltip-animate-function") !== null)
tm.animateFunction = elTarget.getAttribute("data-tooltip-animate-function");
if (elTarget.getAttribute("data-tooltip-color") !== null)
tm.color = elTarget.getAttribute("data-tooltip-color");
if (elTarget.getAttribute("data-tooltip-more") !== null)
tm.contentMore = elTarget.getAttribute("data-tooltip-more");
if (elTarget.getAttribute("data-tooltip-stickto") !== null)
tm.stickTo = elTarget.getAttribute("data-tooltip-stickto");
if (elTarget.getAttribute("data-tooltip-maxwidth") !== null)
tm.maxWidth = elTarget.getAttribute("data-tooltip-maxwidth");
tModels.push(extend({}, typeTooltipModel, tm));
});
}
function tieTooltips()
{
var destrStack=[];
tModels.forEach(function(tModel, i) {
function targetMousemove()
{
if (activeElements.hovered === this || activeElements.focused !== null)
return;
activeElements.hovered = this;
tt.target(this).model(tModel);
setTimeout(function() {
if (activeElements.hovered === this)
tt.showBrief();
}.bind(this), 300);
}
function targetMouseout()
{
activeElements.hovered = null;
if (activeElements.focused !== null)
return;
tt.hideAll();
}
function targetFocus()
{
if (["INPUT", "TEXTAREA"].indexOf(this.tagName) === -1 &&
this.getAttribute("contenteditable") === null)
return;
activeElements.focused = this;
tt.target(this).model(tModel);
tt.showAll();
}
function targetBlur()
{
activeElements.focused = null;
tt.hideAll();
}
tModels[i] = tModel = extend({}, typeTooltipModel, tModel);
if (!tModel.targetElements.length && tModel.targetSelector)
tModel.targetElements = getElementsBySelector(tModel.targetSelector);
if (!tModel.targetElements.length && tModel.targetXPath)
tModel.targetElements = getElementsByXPath(tModel.targetXPath);
tModel.targetElements.forEach(function(el) {
destrStack.push(function(){
el.removeEventListener("mouseover",targetMousemove);
el.removeEventListener("mouseout",targetMouseout);
el.removeEventListener("focus",targetFocus);
el.removeEventListener("blur",targetBlur);
});
el.addEventListener("mouseover",targetMousemove);
el.addEventListener("mouseout",targetMouseout);
el.addEventListener("focus",targetFocus);
el.addEventListener("blur",targetBlur);
});
});
return function(){
for(var i=destrStack.length;i--;)
destrStack[i]();
}
}
function init()
{
if (!tt) {
options = {};
tt = Tooltip();
safeTModels=[];
tModels = [];
}
activeElements = {
focused: null,
hovered: null
};
}
var html5tooltipsGlobal=function(userTModels, userOptions)
{
if (userTModels.length)
// merge arrays
Array.prototype.push.apply(safeTModels, userTModels);
else if (typeof userTModels === "object")
safeTModels.push(userTModels);
options = userOptions ? extend({}, userOptions) : options;
Array.prototype.push.apply(tModels,safeTModels);
untieTooltips&&untieTooltips();
untieTooltips=tieTooltips();
};
var html5tooltipsModule=function(userTModels, userOptions)
{
init();
html5tooltipsGlobal(userTModels, userOptions);
};
//Provides html property reading for AMD and CommonJS
html5tooltipsModule.autoinit=function(){
init();
html5tooltipsModule.refresh();
};
html5tooltipsGlobal.refresh=
html5tooltipsModule.refresh=function(){
pickDocumentDataTargets();
untieTooltips&&untieTooltips();
untieTooltips=tieTooltips();
};
function documentReadyHandler()
{
document.removeEventListener("DOMContentLoaded", documentReadyHandler, false);
window.removeEventListener("load", documentReadyHandler, false);
pickDocumentDataTargets();
untieTooltips&&untieTooltips();
untieTooltips=tieTooltips();
}
if (typeof exports === "object" && exports &&
typeof module === "object" && module && module.exports === exports) {
// CommonJS (Browserify)
module.exports = html5tooltipsModule;
} else if (window.define) {
// AMD
define(function () {
return html5tooltipsModule;
});
} else {
// global object
init();
if (document.readyState === "complete") {
documentReadyHandler();
} else {
document.addEventListener("DOMContentLoaded", documentReadyHandler, false);
window.addEventListener( "load", documentReadyHandler, false );
}
if (window.html5tooltips === undefined) {
window.html5tooltipsPredefined = html5tooltipsPredefined;
window.html5tooltips = html5tooltipsGlobal;
}
}
window.addEventListener("scroll", function()
{
tt.updatePos();
}, false );
})();
| daviferreira/html5tooltipsjs | html5tooltips.js | JavaScript | mit | 19,000 |
.normal {
display: flex;
margin-bottom: 20px; }
.search {
flex: 1;
text-align: left; }
/*# sourceMappingURL=index.css.map */
| yvanwangl/DvaApp | src/components/Users/UserSearch/index.css | CSS | mit | 135 |
#!/bin/env node
"use strict";
const aws = require("../index.js");
const { PutItemStatement } = aws.dynamodb;
var getopt = require('node-getopt').create([
['j', 'output-json', 'output a json to read'],
['J', 'output-json-oneline', 'output a json in oneline'],
['t', 'dry-run', 'Print options of the putItem and exit'],
['q', 'sql-ish', 'Query by SQL-ish-statement(beta)'],
['p', 'placeholder-values=JSON','Placeholder values. specify as JSON'],
['h', 'help', 'display this help']
]).bindHelp().parseSystem();
var param = [];
var placeholderValues = {};
if(getopt.options["sql-ish"]) {
let arg = require('hash-arg').get([ "string sqlish" ], getopt.argv);
param.push(arg.sqlish);
if(getopt.options["placeholder-values"]) {
placeholderValues = JSON.parse(getopt.options["placeholder-values"]);
}
} else {
let arg = require('hash-arg').get([
"string tableName",
"string[] item"
], getopt.argv);
if(arg.tableName == null) {
console.error("Error: tableName is required.");
process.exit(1);
}
if(arg.item == null || arg.item.length == 0) {
console.error("Error: item is required to put.");
process.exit(1);
}
arg.item.forEach(function(item) {
let params = {};
params["TableName"] = arg.tableName;
params["Item"] = item;
param.push(params);
});
}
param.forEach((params) => {
try {
const statement = new PutItemStatement(params);
aws.connect();
statement.dynamodb = aws.getService("DynamoDB");
// Dry-run Option
if(getopt.options["dry-run"]) {
console.log("// opts for aws.dynamodb.putItem:");
console.log(JSON.stringify(
statement.getParameter(placeholderValues), null, " "));
} else {
statement.run(placeholderValues, function(err, data) {
if(err) {
console.error("Error:", err);
process.exit(1);
}
if(getopt.options['output-json']) {
console.log(JSON.stringify(data, null, " "));
} else if(getopt.options['output-json-oneline']) {
console.log(JSON.stringify(data));
}
});
}
} catch (err) {
console.error(
"Error:" + err.stack);
process.exit(1);
}
});
| takamin/aws-node-util | bin/aws-dynamodb-put-item.js | JavaScript | mit | 2,507 |
module.exports = {
"extends": "airbnb-base",
"rules": {
"no-console": 0
}
}; | bmonty/docker-manifest | .eslintrc.js | JavaScript | mit | 96 |
---
layout: year
title: Limpopo Provincial Gazettes 2013
jurisdiction: ZA-LP
jurisdiction_name: Limpopo
provincial: true
year: "2013"
---
| Code4SA/opengazettes | _gazettes/ZA-LP/2013.md | Markdown | mit | 138 |
/*
* 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 trabajadores;
import centros.Centro;
import himevico.GestorBBDD;
import java.util.ArrayList;
import java.util.Date;
import partes.Parte;
/**
* Clase Trabajador
*
* @author Sheila y Asier
*/
public abstract class Trabajador {
/**
* Eliminar en BBDD este trbajador
*/
public void eliminar() {
GestorBBDD.eliminar(this);
}
private int idTrabajador;
private String dni;
private String nombre;
private String apellido1;
private String apellido2;
private String calle;
private int portal;
private int piso;
private char mano;
private String telPersonal;
private String telEmpresa;
private double salario;
private Date fechaNacimiento;
private String contrasena;
private Centro centro;
private ArrayList<Parte> partes = new ArrayList<>();
/**
*
* @return
*/
public Centro getCentro() {
return centro;
}
/**
*
* @param centro
*/
public void setCentro(Centro centro) {
this.centro = centro;
}
/**
* @return the idTrabajador
*/
public int getIdTrabajador() {
return idTrabajador;
}
/**
* @param idTrabajador the idTrabajador to set
*/
public void setIdTrabajador(int idTrabajador) {
this.idTrabajador = idTrabajador;
}
/**
* @return the dni
*/
public String getDni() {
return dni;
}
/**
* @param dni the dni to set
*/
public void setDni(String dni) {
this.dni = dni;
}
/**
* @return the nombre
*/
public String getNombre() {
return nombre;
}
/**
* @param nombre the nombre to set
*/
public void setNombre(String nombre) {
this.nombre = nombre;
}
/**
* @return the apellido1
*/
public String getApellido1() {
return apellido1;
}
/**
* @param apellido1 the apellido1 to set
*/
public void setApellido1(String apellido1) {
this.apellido1 = apellido1;
}
/**
* @return the apellido2
*/
public String getApellido2() {
return apellido2;
}
/**
* @param apellido2 the apellido2 to set
*/
public void setApellido2(String apellido2) {
this.apellido2 = apellido2;
}
/**
* @return the calle
*/
public String getCalle() {
return calle;
}
/**
* @param calle the calle to set
*/
public void setCalle(String calle) {
this.calle = calle;
}
/**
* @return the portal
*/
public int getPortal() {
return portal;
}
/**
* @param portal the portal to set
*/
public void setPortal(int portal) {
this.portal = portal;
}
/**
* @return the piso
*/
public int getPiso() {
return piso;
}
/**
* @param piso the piso to set
*/
public void setPiso(int piso) {
this.piso = piso;
}
/**
* @return the mano
*/
public char getMano() {
return mano;
}
/**
* @param mano the mano to set
*/
public void setMano(char mano) {
this.mano = mano;
}
/**
* @return the telPersonal
*/
public String getTelPersonal() {
return telPersonal;
}
/**
* @param telPersonal the telPersonal to set
*/
public void setTelPersonal(String telPersonal) {
this.telPersonal = telPersonal;
}
/**
* @return the telEmpresa
*/
public String getTelEmpresa() {
return telEmpresa;
}
/**
* @param telEmpresa the telEmpresa to set
*/
public void setTelEmpresa(String telEmpresa) {
this.telEmpresa = telEmpresa;
}
/**
* @return the salario
*/
public double getSalario() {
return salario;
}
/**
* @param salario the salario to set
*/
public void setSalario(double salario) {
this.salario = salario;
}
/**
* @return the fechaNacimiento
*/
public Date getFechaNacimiento() {
return fechaNacimiento;
}
/**
* @param fechaNacimiento the fechaNacimiento to set
*/
public void setFechaNacimiento(Date fechaNacimiento) {
this.fechaNacimiento = fechaNacimiento;
}
/**
* @return the contrasena
*/
public String getContrasena() {
return contrasena;
}
/**
* @param contrasena the contrasena to set
*/
public void setContrasena(String contrasena) {
this.contrasena = contrasena;
}
/**
* Actualizar en BBDD este trabajador
*/
public void actualizar() {
GestorBBDD.actualizarTrabajador(this);
}
}
| programGrupo7/grupo7 | java/himevico/src/trabajadores/Trabajador.java | Java | mit | 5,228 |
local hotkey = require "mjolnir.hotkey"
local grid = require "mjolnir.bg.grid"
local sizeUp = {}
local function snapWindow(direction)
grid.GRIDHEIGHT = 2
grid.GRIDWIDTH = 2
if direction == "left" or direction == "right" then
grid.resizewindow_thinner()
if direction == "left" then
grid.pushwindow_left()
elseif direction == "right" then
grid.pushwindow_right()
end
grid.pushwindow_up()
grid.resizewindow_taller()
elseif direction == "up" or direction == "down" then
grid.resizewindow_shorter()
if direction == "up" then
grid.pushwindow_up()
elseif direction == "down" then
grid.pushwindow_down()
end
grid.pushwindow_left()
grid.resizewindow_wider()
end
end
function sizeUp.init(modifier)
hotkey.bind(modifier, "left", function()
snapWindow("left")
end)
hotkey.bind(modifier, "right", function()
snapWindow("right")
end)
hotkey.bind(modifier, "up", function()
snapWindow("up")
end)
hotkey.bind(modifier, "down", function()
snapWindow("down")
end)
end
return sizeUp | Joeasaurus/mjolnir-sizeup | sizeUp.lua | Lua | mit | 1,028 |
class CreateBarbers < ActiveRecord::Migration
def change
create_table :barbers do |t|
t.text :name
t.timestamps
end
Barber.create :name => 'David Courtney'
Barber.create :name => 'Xaoc'
Barber.create :name => 'Aliaksandr Salenka'
end
end
| foogass/sbc_ar | db/migrate/20160418110838_create_barbers.rb | Ruby | mit | 274 |
#include <iostream>
#include <vector>
using namespace std;
class Mydata {
public:
Mydata & operator [] (initializer_list<int> l)
{
for (auto i = l.begin(); i != l.end(); ++i)
idx.push_back(*i);
return *this;
}
Mydata & operator = (int v)
{
if (idx.empty() != true) {
for (auto i = idx.begin(); i != idx.end(); ++i) {
d.resize((*i > d.size()) ? *i : d.size());
d[*i - 1] = v;
}
idx.clear();
}
return *this;
}
void Print() {
for (auto i = d.begin(); i != d.end(); ++i)
cout << *i << " ";
cout << endl;
}
private:
vector<int> idx; // 辅助数组,用于记录index
vector<int> d;
};
int main() {
Mydata d;
d[{2, 3, 5}] = 7;
d[{1, 4, 5, 8}] = 4;
d.Print(); // 4 7 7 4 4 0 0 4
}
| cuiwm/choe_lib | c++11/understanding-cpp11/chapter3/3-5-4.cpp | C++ | mit | 890 |
package srt
import (
"fmt"
"strings"
"testing"
)
const srtSource string = `
1
00:00:10,500 --> 00:00:13,000
Elephant's Dream
2
00:00:15,000 --> 00:00:18,000
At the left we can see...
`
func TestParse(t *testing.T) {
strips := make([]Strip, 0, 8)
input := strings.NewReader(srtSource)
res := Parse(input)
for r := range res {
if r.Error != nil {
t.Error(r.Error)
return
}
strips = append(strips, *r.Strip)
}
for _, s := range strips {
fmt.Print("strip: ", s)
}
}
| jims/srtool | srt/parse_test.go | GO | mit | 492 |
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.analytics.synapse.artifacts.models;
import com.azure.core.annotation.Fluent;
import com.azure.core.annotation.JsonFlatten;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;
/** SAP HANA Table properties. */
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type")
@JsonTypeName("SapHanaTable")
@JsonFlatten
@Fluent
public class SapHanaTableDataset extends Dataset {
/*
* The schema name of SAP HANA. Type: string (or Expression with resultType
* string).
*/
@JsonProperty(value = "typeProperties.schema")
private Object schemaTypePropertiesSchema;
/*
* The table name of SAP HANA. Type: string (or Expression with resultType
* string).
*/
@JsonProperty(value = "typeProperties.table")
private Object table;
/**
* Get the schemaTypePropertiesSchema property: The schema name of SAP HANA. Type: string (or Expression with
* resultType string).
*
* @return the schemaTypePropertiesSchema value.
*/
public Object getSchemaTypePropertiesSchema() {
return this.schemaTypePropertiesSchema;
}
/**
* Set the schemaTypePropertiesSchema property: The schema name of SAP HANA. Type: string (or Expression with
* resultType string).
*
* @param schemaTypePropertiesSchema the schemaTypePropertiesSchema value to set.
* @return the SapHanaTableDataset object itself.
*/
public SapHanaTableDataset setSchemaTypePropertiesSchema(Object schemaTypePropertiesSchema) {
this.schemaTypePropertiesSchema = schemaTypePropertiesSchema;
return this;
}
/**
* Get the table property: The table name of SAP HANA. Type: string (or Expression with resultType string).
*
* @return the table value.
*/
public Object getTable() {
return this.table;
}
/**
* Set the table property: The table name of SAP HANA. Type: string (or Expression with resultType string).
*
* @param table the table value to set.
* @return the SapHanaTableDataset object itself.
*/
public SapHanaTableDataset setTable(Object table) {
this.table = table;
return this;
}
}
| Azure/azure-sdk-for-java | sdk/synapse/azure-analytics-synapse-artifacts/src/main/java/com/azure/analytics/synapse/artifacts/models/SapHanaTableDataset.java | Java | mit | 2,494 |
var mongoose = require('mongoose'),
moment = require('moment'),
bcrypt = require('bcrypt');
var UserSchema = mongoose.Schema({
email: {type: String, required: true, unique: true},
password: {type: String, required: true}
});
UserSchema.path('password').set(function (value) {
if (!value) {
return this.password;
}
var salt = bcrypt.genSaltSync();
return bcrypt.hashSync(value, salt);
});
UserSchema.methods.checkPassword = function (value, success, failure) {
bcrypt.compare(value, this.password, function(err, result) {
if (result) {
success();
} else {
failure(err);
}
});
};
module.exports = mongoose.model('User', UserSchema);
| rtablada/express-shell | app/models/user.js | JavaScript | mit | 733 |
#!/bin/bash
#SBATCH -N 1
#SBATCH -c 1
#SBATCH --mem 50000
#SBATCH --gres=gpu:1
#SBATCH -t 4-23:00
#SBATCH [email protected]
cd /om/user/tejask/DeepSR
# ./pagekite.py $1 $(( $1 - 1804 )).mrkulk.pagekite.me &
# th -ldisplay.start $1 0.0.0.0 &
./run_gpu MovingGoalsMedium $1 dsr 1 5000 500 1 256
| Ardavans/DSR | slurm_runner.sh | Shell | mit | 302 |
using System;
using System.Collections.Generic;
using Xunit;
using Plivo.Http;
using Plivo.Resource;
using Plivo.Resource.Call;
using Plivo.Utilities;
namespace Plivo.NetCore.Test.Resources
{
public class TestCall : BaseTestCase
{
[Fact]
public void TestCallCreate()
{
var data = new Dictionary<string, object>()
{
{"from", "+919999999999"},
{"to", "+919898989898<+919090909090"},
{"answer_url", "http://answer.com"},
{"answer_method", "POST"},
{"is_voice_request", true},
{"new_send_on_preanswer", "<"},
{"new_time_limit", "<"},
{"new_hangup_on_ring", "<"}
};
var request =
new PlivoRequest(
"POST",
"Account/MAXXXXXXXXXXXXXXXXXX/Call/",
"",
data);
var response =
System.IO.File.ReadAllText(
SOURCE_DIR + @"../Mocks/callCreateResponse.json"
);
Setup<CallCreateResponse>(201, response);
Assert.Empty(
ComparisonUtilities.Compare(
response,
Api.Call.Create(
"+919999999999",
new List<string>()
{
{"+919898989898"},
{"+919090909090"}
},
"http://answer.com",
"POST"
)
)
);
AssertRequest(request);
}
[Fact]
public void TestCallDelete()
{
var id = "abcabcabc";
var data = new Dictionary<string, object>()
{
{"is_voice_request", true}
};
var request =
new PlivoRequest(
"DELETE",
"Account/MAXXXXXXXXXXXXXXXXXX/Call/" + id + "/",
"",
data);
var response = "";
Setup<DeleteResponse<Call>>(204, response);
Assert.Null(Api.Call.Delete("abcabcabc"));
AssertRequest(request);
}
[Fact]
public void TestCallList()
{
var request =
new PlivoRequest(
"GET",
"Account/MAXXXXXXXXXXXXXXXXXX/Call/",
"",
new Dictionary<string, object>()
{
{"end_time__gt", "2017-06-07 00:00:00.000000"},
{"is_voice_request", true}
});
var response =
System.IO.File.ReadAllText(
SOURCE_DIR + @"../Mocks/callListResponse.json"
);
Setup<ListResponse<Call>>(200, response);
Assert.Empty(
ComparisonUtilities.Compare(
response,
Api.Call.List(endTime_Gt: DateTime.Parse("2017-06-07"))
)
);
AssertRequest(request);
}
[Fact]
public void TestCallGet()
{
var id = "abcabcabc";
var data = new Dictionary<string, object>()
{
{"is_voice_request", true}
};
var request =
new PlivoRequest(
"GET",
"Account/MAXXXXXXXXXXXXXXXXXX/Call/" + id + "/",
"",
data);
var response =
System.IO.File.ReadAllText(
SOURCE_DIR + @"../Mocks/callGetResponse.json"
);
Assert.NotEmpty(response);
Setup<Call>(200, response);
Assert.Empty(
ComparisonUtilities.Compare(
response,
Api.Call.Get(id)
)
);
AssertRequest(request);
}
[Fact]
public void TestLiveCallList()
{
var request =
new PlivoRequest(
"GET",
"Account/MAXXXXXXXXXXXXXXXXXX/Call/",
"",
new Dictionary<string, object>()
{
{"status", "live"},
{"is_voice_request", true}
});
var response =
System.IO.File.ReadAllText(
SOURCE_DIR + @"../Mocks/liveCallListGetResponse.json"
);
Setup<LiveCallListResponse>(200, response);
Assert.Empty(
ComparisonUtilities.Compare(
response,
Api.Call.ListLive()
)
);
AssertRequest(request);
}
[Fact]
public void TestQueuedCallList()
{
var request =
new PlivoRequest(
"GET",
"Account/MAXXXXXXXXXXXXXXXXXX/Call/",
"",
new Dictionary<string, object>()
{
{"status", "queued"},
{"is_voice_request", true}
});
var response =
System.IO.File.ReadAllText(
SOURCE_DIR + @"../Mocks/liveCallListGetResponse.json"
);
Setup<QueuedCallListResponse>(200, response);
Assert.Empty(
ComparisonUtilities.Compare(
response,
Api.Call.ListQueued()
)
);
AssertRequest(request);
}
[Fact]
public void TestLiveCallGet()
{
var id = "abcabcabc";
var request =
new PlivoRequest(
"GET",
"Account/MAXXXXXXXXXXXXXXXXXX/Call/" + id + "/",
"",
new Dictionary<string, object>()
{
{"status", "live"},
{"is_voice_request", true}
});
var response =
System.IO.File.ReadAllText(
SOURCE_DIR + @"../Mocks/liveCallGetResponse.json"
);
Assert.NotEmpty(response);
Setup<LiveCall>(200, response);
Assert.Empty(
ComparisonUtilities.Compare(
response,
Api.Call.GetLive(id)
)
);
AssertRequest(request);
}
[Fact]
public void TestQueuedCallGet()
{
var id = "abcabcabc";
var request =
new PlivoRequest(
"GET",
"Account/MAXXXXXXXXXXXXXXXXXX/Call/" + id + "/",
"",
new Dictionary<string, object>()
{
{"status", "queued"},
{"is_voice_request", true}
});
var response =
System.IO.File.ReadAllText(
SOURCE_DIR + @"../Mocks/queuedCallGetResponse.json"
);
Assert.NotEmpty(response);
Setup<QueuedCall>(200, response);
Assert.Empty(
ComparisonUtilities.Compare(
response,
Api.Call.GetQueued(id)
)
);
AssertRequest(request);
}
[Fact]
public void TestCallTranfer()
{
var id = "abcabcabc";
var data = new Dictionary<string, object>()
{
{"legs", "aleg"},
{"aleg_url", "http://asdsa.asdsa"},
{"is_voice_request", true}
};
var request =
new PlivoRequest(
"POST",
"Account/MAXXXXXXXXXXXXXXXXXX/Call/" + id + "/",
"",
data);
var response =
System.IO.File.ReadAllText(
SOURCE_DIR + @"../Mocks/callUpdateResponse.json"
);
Setup<UpdateResponse<Call>>(202, response);
Assert.Empty(
ComparisonUtilities.Compare(
response,
Api.Call.Transfer(id, "aleg", "http://asdsa.asdsa")
)
);
AssertRequest(request);
}
[Fact]
public void TestCallRecord()
{
var id = "abcabcabc";
var data = new Dictionary<string, object>()
{
{"time_limit", 120},
{"file_format", "wav"},
{"callback_method", "http://a.a"},
{"callback_url", "http://s.s"},
{"is_voice_request", true}
};
var request =
new PlivoRequest(
"POST",
"Account/MAXXXXXXXXXXXXXXXXXX/Call/" + id + "/Record/",
"",
data);
var response =
System.IO.File.ReadAllText(
SOURCE_DIR + @"../Mocks/liveCallRecordCreateResponse.json"
);
Setup<UpdateResponse<Call>>(202, response);
Assert.Empty(
ComparisonUtilities.Compare(
response,
Api.Call.StartRecording(id, 120, "wav", callbackMethod: "http://a.a", callbackUrl: "http://s.s")
)
);
AssertRequest(request);
}
[Fact]
public void TestCallSpeak()
{
var id = "abcabcabc";
var data = new Dictionary<string, object>()
{
{"text", "120"},
{"voice", "WOMAN"},
{"is_voice_request", true}
};
var request =
new PlivoRequest(
"POST",
"Account/MAXXXXXXXXXXXXXXXXXX/Call/" + id + "/Speak/",
"",
data);
var response =
System.IO.File.ReadAllText(
SOURCE_DIR + @"../Mocks/liveCallSpeakCreateResponse.json"
);
Setup<UpdateResponse<Call>>(202, response);
Assert.Empty(
ComparisonUtilities.Compare(
response,
Api.Call.StartSpeaking(id, "120", voice: "WOMAN")
)
);
AssertRequest(request);
}
[Fact]
public void TestCallPlay()
{
var id = "abcabcabc";
var data = new Dictionary<string, object>()
{
{"urls", "http://wewewe.ewewew,http:/second.url"},
{"is_voice_request", true}
};
var request =
new PlivoRequest(
"POST",
"Account/MAXXXXXXXXXXXXXXXXXX/Call/" + id + "/Play/",
"",
data);
var response =
System.IO.File.ReadAllText(
SOURCE_DIR + @"../Mocks/liveCallPlayCreateResponse.json"
);
Setup<UpdateResponse<Call>>(202, response);
Assert.Empty(
ComparisonUtilities.Compare(
response,
Api.Call.StartPlaying(id, new List<string>() {"http://wewewe.ewewew", "http:/second.url"})
)
);
AssertRequest(request);
}
[Fact]
public void TestCallStopRecording()
{
var id = "abcabcabc";
var data = new Dictionary<string, object>()
{
{"URL", "http://wewewe.ewewew"},
{"is_voice_request", true}
};
var request =
new PlivoRequest(
"DELETE",
"Account/MAXXXXXXXXXXXXXXXXXX/Call/" + id + "/Record/",
"",
data);
var response = "";
Setup<DeleteResponse<Call>>(204, response);
Assert.Null(Api.Call.StopRecording(id, "http://wewewe.ewewew"));
AssertRequest(request);
}
[Fact]
public void TestCallStopPlaying()
{
var id = "abcabcabc";
var data = new Dictionary<string, object>()
{
{"is_voice_request", true}
};
var request =
new PlivoRequest(
"DELETE",
"Account/MAXXXXXXXXXXXXXXXXXX/Call/" + id + "/Play/",
"",
data);
var response = "";
Setup<DeleteResponse<Call>>(204, response);
Assert.Null(Api.Call.StopPlaying(id));
AssertRequest(request);
}
[Fact]
public void TestCallStopSpeaking()
{
var id = "abcabcabc";
var data = new Dictionary<string, object>()
{
{"is_voice_request", true}
};
var request =
new PlivoRequest(
"DELETE",
"Account/MAXXXXXXXXXXXXXXXXXX/Call/" + id + "/Speak/",
"",
data);
var response =
System.IO.File.ReadAllText(
SOURCE_DIR + @"../Mocks/liveCallSpeakDeleteResponse.json"
);
Setup<DeleteResponse<Call>>(204, response);
Assert.Empty(
ComparisonUtilities.Compare(
response,
Api.Call.StopSpeaking(id)));
AssertRequest(request);
}
}
} | plivo/plivo-dotnet | tests_netcore/Plivo.NetCore.Test/Resources/TestCall.cs | C# | mit | 14,160 |
package de.mm.android.longitude.base;
import android.support.annotation.NonNull;
import android.support.annotation.StringRes;
import android.support.v4.app.Fragment;
import android.widget.Toast;
import de.mm.android.longitude.util.NetworkUtil;
/**
* Base Fragment which provided Connectivity status value {@link #showMessage} Methods
*/
public abstract class BaseFragment extends Fragment {
protected boolean isInetAvailable;
@Override
public void onStart() {
super.onStart();
isInetAvailable = NetworkUtil.isInternetAvailable(getActivity());
}
protected void showMessage(@StringRes int errorMessage) {
Toast.makeText(getActivity(), errorMessage, Toast.LENGTH_SHORT).show();
}
protected void showMessage(@NonNull String message) {
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
}
}
| maiktheknife/Scout | app/src/main/java/de/mm/android/longitude/base/BaseFragment.java | Java | mit | 875 |
#include "Rational.hpp"
| NadzwyczajnaGrupaRobocza/papuc_exercises | lm/fmtgp/Rational.cpp | C++ | mit | 24 |
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("09.ExchangeVariableValues")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Hewlett-Packard")]
[assembly: AssemblyProduct("09.ExchangeVariableValues")]
[assembly: AssemblyCopyright("Copyright © Hewlett-Packard 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("bbc6ee52-0e31-4539-9601-82ce5f14c8f6")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| AYankova/CSharp | HomeworkPrimitiveDataTypesAndValuables/09.ExchangeVariableValues/Properties/AssemblyInfo.cs | C# | mit | 1,456 |
---
title: Mulgoa in July and August 2018
layout: post
---
June is drawing to a close, with the feast of Sts Peter and Paul.
July opens with the feast of the Most Precious Blood of Our Lord Jesus Christ on Sunday. This will also be Fr Klein's last Mass at Mulgoa before he leaves for his new appointment in Germany.
[Here is the schedule for Mulgoa July-August]({{ site.url }}/pdf/schedules/MulgoaJulyAug2018.pdf)
Lawson continues with Sung Masses on the first and third Sundays of the month.
God bless you and keep you!
Veronica Brandt
| veromary/repleatur | _posts/2018-06-28-mulgoa-jul-aug-2018.md | Markdown | mit | 544 |
package br.com.tdsis.lambda.forest.domain;
/**
* The ConstraintViolationDescription class
* <p>
* This class represents a constraint violation when
* a request body object is validated.
*
* @author nmelo
* @version 1.0.0
* @since 1.0.0
*/
public class ConstraintViolationDescription {
private String message;
private String attribute;
/**
* The default constructor
*/
public ConstraintViolationDescription() {
}
/**
* The constructor with message and attribute args to be set
*
* @param message The constraint violation message
* @param attribute The attribute name that failed on validate
*/
public ConstraintViolationDescription(String message, String attribute) {
this.message = message;
this.attribute = attribute;
}
/**
* Returns the constraint violation message
*
* @return message The constraint violation message
*/
public String getMessage() {
return message;
}
/**
* Sets the constraint violation message
*
* @param message The constraint violation message
*/
public void setMessage(String message) {
this.message = message;
}
/**
* Returns the attribute name
*
* @return attribute The attribute name
*/
public String getAttribute() {
return attribute;
}
/**
* Sets the attribute name
*
* @param attribute The attribute name
*/
public void setAttribute(String attribute) {
this.attribute = attribute;
}
}
| tdsis/lambda-forest | src/main/java/br/com/tdsis/lambda/forest/domain/ConstraintViolationDescription.java | Java | mit | 1,594 |
<div class="rzslider">
<span class="rz-bar-wrapper"><span class="rz-bar"></span></span> <!-- // 0 The slider bar -->
<span class="rz-bar-wrapper">
<span class="rz-bar rz-selection" ng-style="barStyle"></span>
</span> <!-- // 1 Highlight between two handles -->
<span class="rz-pointer rz-pointer-min" ng-style=minPointerStyle></span> <!-- // 2 Left slider handle -->
<span class="rz-pointer rz-pointer-max" ng-style=maxPointerStyle></span> <!-- // 3 Right slider handle -->
<span class="rz-bubble rz-limit"></span> <!-- // 4 Floor label -->
<span class="rz-bubble rz-limit"></span> <!-- // 5 Ceiling label -->
<span class="rz-bubble"></span> <!-- // 6 Label above left slider handle -->
<span class="rz-bubble"></span> <!-- // 7 Label above right slider handle -->
<span class="rz-bubble"></span> <!-- // 8 Range label when the slider handles are close ex. 15 - 17 -->
<ul ng-show="showTicks" class="rz-ticks"> <!-- // 9 The ticks -->
<li ng-repeat="t in ticks track by $index" class="rz-tick"
ng-class="{'rz-selected': t.selected}" ng-style="t.style"
ng-attr-uib-tooltip="{{ t.tooltip }}" ng-attr-tooltip-placement="{{t.tooltipPlacement}}"
ng-attr-tooltip-append-to-body="{{ t.tooltip ? true : undefined}}">
<span ng-if="t.value != null" class="rz-tick-value"
ng-attr-uib-tooltip="{{ t.valueTooltip }}"
ng-attr-tooltip-placement="{{t.valueTooltipPlacement}}">{{ t.value }}</span>
<span ng-if="t.legend != null" class="rz-tick-legend">{{ t.legend }}</span>
</li>
</ul>
</div>
| denisos/angularjs-slider | src/rzSliderTpl.html | HTML | mit | 1,528 |
$(document).on('click', '.on-card-click', function (e) {
window.location=$(this).data('url');
}); | osalabs/osafw-asp.net | www/App_Data/template/main/index/onload.js | JavaScript | mit | 101 |
'''
This module has functions for post-processing ANN results and preparing a
summary of them.
'''
from os.path import join as _join
def time_prediction(net, features):
'''
`timeit.timeit` returns the total time in seconds (float) to run the test,
not including the time used for setup. The time for each execution is the
total time divided by the number of executions `number`. The default value
for `number` is 1e6, but set here to `100000`.
'''
from timeit import timeit as tt
n = 100000
return tt('net.predict(features)', number=n, globals=locals())/n
def calculate_precision(cm):
'''Calculate the precision for each class in a confusion matrix'''
import numpy
n_classes = len(cm[0])
precision = numpy.zeros(n_classes)
for i in range(n_classes):
precision[i] = cm[i,i]/sum(cm[i,:])
return precision
def process(path_project, path_analysis, cfg_ann):
from collections import OrderedDict
import numpy
import os
import pandas
import pyotelem
import yamlord
from . import pre
from ..config import paths, fnames
print(path_analysis)
path_output = _join(path_project, paths['ann'], path_analysis)
file_field = _join(path_project, paths['csv'], fnames['csv']['field'])
file_isotope = _join(path_project, paths['csv'], fnames['csv']['isotope'])
field, isotope = pre.add_rhomod(file_field, file_isotope)
# EXPERIMENT INPUT
post = OrderedDict()
post['input_exp'] = OrderedDict()
# n experiments and animals
post['n_field'] = len(field)
post['n_animals'] = len(field['animal'].unique())
# Min max values of rho_mod and % lipid for each seal
post['exp'] = OrderedDict()
post['iso'] = OrderedDict()
for a in numpy.unique(field['animal']):
# Field experiment values
post['exp'][a] = OrderedDict()
mask = field['animal'] == a
post['exp'][a]['min_rhomod'] = field[mask]['rho_mod'].min()
post['exp'][a]['max_rhomod'] = field[mask]['rho_mod'].max()
# Isotope experiment values
post['iso'][a] = OrderedDict()
mask = isotope['animal'] == a.capitalize()
post['iso'][a]['min_mass'] = isotope[mask]['mass_kg'].min()
post['iso'][a]['max_mass'] = isotope[mask]['mass_kg'].max()
# ANN CONFIG
results = pandas.read_pickle(_join(path_output, fnames['ann']['tune']))
post['ann'] = OrderedDict()
# Number of network configurations
post['ann']['n_configs'] = len(results)
# Load training data
file_train = _join(path_output, 'data_train.p')
file_valid = _join(path_output, 'data_valid.p')
file_test = _join(path_output, 'data_test.p')
train = pandas.read_pickle(file_train)
valid = pandas.read_pickle(file_valid)
test = pandas.read_pickle(file_test)
# Number of samples compiled, train, valid, test
post['ann']['n'] = OrderedDict()
post['ann']['n']['train'] = len(train[0])
post['ann']['n']['valid'] = len(valid[0])
post['ann']['n']['test'] = len(test[0])
post['ann']['n']['all'] = len(train[0]) + len(valid[0]) + len(test[0])
# percentage of compiled dataset in train, valid, test
post['ann']['n']['perc_train'] = len(train[0])/post['ann']['n']['all']
post['ann']['n']['perc_valid'] = len(valid[0])/post['ann']['n']['all']
post['ann']['n']['perc_test'] = len(test[0])/post['ann']['n']['all']
# Total tuning time
post['ann']['total_train_time'] = results['train_time'].sum()
# POSTPROCESS VALUES
# Best/worst classification accuracies
mask_best = results['accuracy'] == results['accuracy'].max()
best_idx = results['train_time'][mask_best].idxmin()
mask_worst = results['accuracy'] == results['accuracy'].min()
worst_idx = results['train_time'][mask_worst].idxmax()
post['ann']['best_idx'] = best_idx
post['ann']['worst_idx'] = worst_idx
# Get min/max accuracy and training time for all configurations
post['ann']['metrics'] = OrderedDict()
for key in ['accuracy', 'train_time']:
post['ann']['metrics'][key] = OrderedDict()
post['ann']['metrics'][key]['max_idx'] = results[key].argmax()
post['ann']['metrics'][key]['min_idx'] = results[key].argmin()
post['ann']['metrics'][key]['max'] = results[key].max()
post['ann']['metrics'][key]['min'] = results[key].min()
post['ann']['metrics'][key]['best'] = results[key][best_idx]
post['ann']['metrics'][key]['worst'] = results[key][worst_idx]
# Optimal network results
post['ann']['opt'] = OrderedDict()
net = results['net'][best_idx]
# Loop 10 times taking mean prediction time
# Each loop, 100k iterations of timing
file_test = _join(path_output, fnames['ann']['test'])
test = pandas.read_pickle(file_test)
features = numpy.expand_dims(test[0][0], axis=0)
t_pred = time_prediction(net, features)
post['ann']['opt']['t_pred'] = t_pred
# Filesize of trained NN
file_net_best = './net.tmp'
pandas.to_pickle(net, file_net_best)
st = os.stat(file_net_best)
os.remove(file_net_best)
post['ann']['opt']['trained_size'] = st.st_size/1000 #kB
# %step between subsets of test for dataset size test
post['ann']['dataset'] = 'numpy.arange(0,1,0.03))[1:]'
# Tune confusion matrices (cms) from most optimal configuration
# one field per dataset `train`, `valid`, and `test`
# first level `targets` if for all datasets
post['ann']['bins'] = OrderedDict()
file_tune_cms = _join(path_output, fnames['ann']['cms_tune'])
tune_cms = pandas.read_pickle(file_tune_cms)
bins = tune_cms['targets']
# Range of each bin, density, lipid percent
bin_range = range(len(bins)-1)
rho_lo = numpy.array([bins[i] for i in bin_range])
rho_hi = numpy.array([bins[i+1] for i in bin_range])
# Note density is converted from kg/m^3 to g/cm^3 for `dens2lip`
lip_lo = pyotelem.physio_seal.dens2lip(rho_lo*0.001)
lip_hi = pyotelem.physio_seal.dens2lip(rho_hi*0.001)
# Generate bin ranges as strings
fmt_bin = r'{:7.2f} <= rho_mod < {:7.2f}'
fmt_lip = r'{:6.2f} >= lipid % > {:6.2f}'
str_bin = [fmt_bin.format(lo, hi) for lo, hi in zip(rho_lo, rho_hi)]
str_lip = [fmt_lip.format(lo, hi) for lo, hi in zip(lip_lo, lip_hi)]
path_sgls = _join(path_output, fnames['ann']['sgls'])
sgls_ann = pandas.read_pickle(path_sgls)
post['ann']['bins']['values'] = list(bins)
post['ann']['bins']['value_range'] = str_bin
post['ann']['bins']['value_diff'] = list(numpy.diff(bins))
# Note density is converted from kg/m^3 to g/cm^3 for `dens2lip`
lipid_perc = pyotelem.physio_seal.dens2lip(bins*0.001)
post['ann']['bins']['lipid_perc'] = list(lipid_perc)
post['ann']['bins']['lipid_range'] = str_lip
post['ann']['bins']['lipid_diff'] = list(numpy.diff(lipid_perc))
precision = calculate_precision(tune_cms['validation']['cm'])
post['ann']['bins']['precision'] = [None,] * len(bins)
targets = tune_cms['validation']['targets']
for i in range(len(bins)):
if bins[i] in targets:
post['ann']['bins']['precision'][i] = precision[bins[i]==targets]
else:
post['ann']['bins']['precision'][i] = 'None'
# Save post processing results as YAML
file_post = _join(path_output, fnames['ann']['post'])
yamlord.write_yaml(post, file_post)
return post
| ryanjdillon/smartmove | smartmove/ann/post.py | Python | mit | 7,430 |
import testlib
def run_test(env):
bc = env.bitcoind
lit = env.lits[0]
lit2 = env.lits[1]
# First figure out where we should send the money.
addr = lit.make_new_addr()
print('Got lit1 address:', addr)
# Send a bitcoin.
bc.rpc.sendtoaddress(addr, 1)
env.generate_block()
print('Sent and mined...')
# Log it to make sure we got it.
txo_total = lit.get_balance_info()['TxoTotal']
print('initial lit1 balance:', txo_total)
# Get an address for bitcoind.
addr2 = lit2.make_new_addr()
print('Got lit2 address:', addr2)
# Send some bitcoin back, and mine it.
lit.rpc.Send(DestAddrs=[ addr2 ], Amts=[ 50000000 ])
env.generate_block()
print('Sent and mined again...')
# Validate.
fbal1 = lit.get_balance_info()['TxoTotal']
print('lit1 balance:', fbal1)
fbal2 = lit2.get_balance_info()['TxoTotal']
print('lit2 balance:', fbal2)
if fbal2 != 50000000:
raise AssertionError("Didn't get the amount we expected in the final lit node.")
if __name__ == '__main__':
env = None
try:
env = testlib.TestEnv(2)
run_test(env)
finally:
if env is not None:
env.shutdown()
| mit-dci/lit | test/itest_send2.py | Python | mit | 1,214 |
from vision_api_utils import VisionApiUtils
__all__ = ["VisionApiUtils"]
| jensonjose/utilbox | utilbox/api_utils/googleapi_utils/__init__.py | Python | mit | 74 |
#!/usr/bin/env python
import os
import tornado.web
from baseHandler import BaseHandler
from traffic_cloud_utils.app_config import get_project_path, get_project_video_path
from traffic_cloud_utils.video import save_video_frame
from traffic_cloud_utils.plotting.visualization import road_user_traj, turn_icon_counts
from traffic_cloud_utils.turning_counts import trajectory_headings, get_objects_with_trajectory
from traffic_cloud_utils.statusHelper import StatusHelper, Status
import json
import traceback
class TurningCountsHandler(BaseHandler):
"""
@api {get} /turningCounts/ Turning Counts
@apiName TurningCounts
@apiVersion 0.1.0
@apiGroup Results
@apiDescription Calling this route will create an image detailing the counts of turning motions for a specified project. The image will then be sent back in the response body. This route requires running object tracking on the video, and then running safety analysis on the results of the object tracking beforehand.
@apiParam {String} identifier The identifier of the project to create a speed distribution for.
@apiSuccess {File} image_jpg The API will return the created graph upon success.
@apiError error_message The error message to display.
"""
def prepare(self):
self.identifier = self.find_argument('identifier', str)
self.project_exists(self.identifier)
status_dict = StatusHelper.get_status(self.identifier)
if status_dict[Status.Type.SAFETY_ANALYSIS] != Status.Flag.COMPLETE:
status_code = 412
self.error_message = "Safety analysis did not complete successfully, try re-running it."
def get(self):
status_code, reason = TurningCountsHandler.handler(self.identifier)
if status_code == 200:
image_path = os.path.join(\
get_project_path(self.identifier),\
'final_images',\
'turningCounts.jpg')
self.set_header('Content-Disposition',\
'attachment; filename=turningCounts.jpg')
self.set_header('Content-Type', 'application/octet-stream')
self.set_header('Content-Description', 'File Transfer')
self.write_file_stream(image_path)
self.finish("Create Turning Counts")
else:
self.error_message = reason
raise tornado.web.HTTPError(status_code=status_code)
@staticmethod
def handler(identifier, save_turns=False):
project_dir = get_project_path(identifier)
if not os.path.exists(project_dir):
return (500, 'Project directory does not exist. Check your identifier?')
db = os.path.join(project_dir, 'run', 'results.sqlite')
if not os.path.exists(db):
return (500, 'Database file does not exist. Trajectory analysis needs to be called first ')
homography = os.path.join(project_dir, 'homography', 'homography.txt')
# Save a frame in order to overlay trajectories
video_path = get_project_video_path(identifier)
if not os.path.exists(video_path):
return (500, 'Source video file does not exist. Was the video uploaded?')
image_path = os.path.join(project_dir, '.temp', 'frame.png')
save_video_frame(video_path, image_path)
final_images = os.path.join(project_dir, 'final_images')
if not os.path.exists(final_images):
os.mkdir(final_images)
if save_turns:
turn_images = os.path.join(final_images, 'turns')
if not os.path.exists(turn_images):
os.mkdir(turn_images)
obj_to_heading = trajectory_headings(db, homography)
out = {}
for turn in ['left', 'straight', 'right']:
objs = get_objects_with_trajectory(obj_to_heading, turn=turn)
if save_turns:
save_path = os.path.join(turn_images, 'turn_'+turn+'.png')
road_user_traj(db, homography, image_path, save_path, objs_to_plot=objs, plot_cars=True)
for direction in ['right', 'down', 'left', 'up']:
if direction not in out:
out[direction] = {}
objs = get_objects_with_trajectory(obj_to_heading, turn=turn, initial_heading=direction)
if save_turns:
save_path = os.path.join(turn_images, 'turn_'+turn+'_direction_'+direction+'.png')
road_user_traj(db, homography, image_path, save_path, objs_to_plot=objs, plot_cars=True)
out[direction][turn] = len(objs)
save_path = os.path.join(final_images, 'turningCounts.jpg')
turn_icon_counts(out, save_path)
return (200, "Success")
| santosfamilyfoundation/SantosCloud | app/handlers/turningCounts.py | Python | mit | 4,788 |
"""
Django settings for ave project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '^4-marsc68w=3o23f_ww(qi4j)m*1s@l7q-)g3v)7lv&cltsme'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
)
MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
)
ROOT_URLCONF = 'simple_auth.urls'
# WSGI_APPLICATION = 'app.wsgi.application'
# Database
# https://docs.djangoproject.com/en/1.7/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}
# Internationalization
# https://docs.djangoproject.com/en/1.7/topics/i18n/
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_L10N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.7/howto/static-files/
STATIC_URL = '/static/'
TEMPLATE_DIRS = (
"simple_auth/templates",
)
if DEBUG:
MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'static', 'media')
STATIC_ROOT = os.path.join(BASE_DIR, 'static', 'static_root')
STATICFILES_DIRS = (
os.path.join(BASE_DIR, 'static', 'static_types'),
)
| MateuszG/django_auth_example | simple_auth/settings.py | Python | mit | 2,345 |
package com.kwanzoo.recurly.exception;
import com.sun.jersey.api.client.ClientResponse;
public class ResourceNotFoundException
extends Base
{
private static final long serialVersionUID = 1L;
public ResourceNotFoundException( final ClientResponse response )
{
super( response );
}
}
| sonatype/recurly-client-java | src/main/java/com/kwanzoo/recurly/exception/ResourceNotFoundException.java | Java | mit | 327 |
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<title> smart meter </title>
<link rel="stylesheet" type="text/css" href="dj.css" />
<!-- -->
<script type="text/javascript">
/*
for debugging while using local files I'd like to set the baseURL to my
first smartmeter at home otherwise the baseURL should be an empty string
an all further requests relative to the original document
*/
var baseURL = "",
myUrl = document.URL.split("/index.html")[0];
if (!window.location.origin)
window.location.origin = window.location.protocol+"//"+window.location.host;
baseURL = window.location.origin;
console.log ("baseURL="+baseURL);
console.log ("document.URL: "+document.URL);
if (!document.URL.indexOf("file://")) {
console.log ("this is a dev system on "+document.URL);
baseURL="http://krukas.dyn.amicdns.de:42080";
}
</script>
<script src="http://code.jquery.com/jquery-1.11.0.min.js" type="text/javascript"></script>
<script src="http://mbostock.github.io/protovis/protovis-r3.2.js" type="text/javascript"></script>
</head>
<body>
<script src="getEnergyObject.js" type="text/javascript"></script>
<script src="getGlobals.js" type="text/javascript"></script>
<script src="renderDataInTable.js" type="text/javascript"></script>
<script src="renderPlot.js" type="text/javascript"></script>
<script src="renderDataSelector.js" type="text/javascript"></script>
<script type="text/javascript">
var global = getGlobals("gotGlobalData"),
dataFilter = localStorage.getItem("dataFilter");
$('body').append('<div id=dataSelectorId></div>');
$('body').append('<div id=summaryTableDivId></div>');
$('body').append('<div id=meterPlotDivId></div>');
// wait, until the global data is read (event )
$(document).on("gotGlobalData", function() {
console.log("event 'gotGlobalData' was triggered... ");
console.log(" dataFilter="+dataFilter);
renderDataSelector();
// now initialize the energyObject
var mouseDown = 0,
eo;
eo = getEnergyObject()
.getData(dataFilter)
.onGotInitialData( function () {
eo.listenOnWebSocket(baseURL, dataFilter)
renderDataInTable(eo);
renderPlot (eo.myData, "meterPlotDivId", global.location);
})
.onGotNewData(function () {
// check if mouse is down to lock refresh
document.body.onmousedown = function() {++mouseDown;}
document.body.onmouseup = function() {--mouseDown;}
renderDataInTable(eo);
if(!mouseDown)
renderPlot (eo.myData, "meterPlotDivId", global.location);
})
;
})
</script>
</body>
<script src="/socket.io/socket.io.js" type="text/javascript"></script>
</html>
| ahojsenn/smartMeter | src/main/client/index.html | HTML | mit | 2,796 |
package run_test
import (
"fmt"
"net/http"
"net/url"
"strconv"
"strings"
"testing"
"time"
)
// Ensure that HTTP responses include the InfluxDB version.
func TestServer_HTTPResponseVersion(t *testing.T) {
version := "v1234"
s := OpenServerWithVersion(NewConfig(), version)
defer s.Close()
resp, _ := http.Get(s.URL() + "/query")
got := resp.Header.Get("X-Influxdb-Version")
if got != version {
t.Errorf("Server responded with incorrect version, exp %s, got %s", version, got)
}
}
// Ensure the database commands work.
func TestServer_DatabaseCommands(t *testing.T) {
t.Parallel()
s := OpenServer(NewConfig(), "")
defer s.Close()
test := Test{
queries: []*Query{
&Query{
name: "create database should succeed",
command: `CREATE DATABASE db0`,
exp: `{"results":[{}]}`,
},
&Query{
name: "create database should error with bad name",
command: `CREATE DATABASE 0xdb0`,
exp: `{"error":"error parsing query: found 0, expected identifier at line 1, char 17"}`,
},
&Query{
name: "show database should succeed",
command: `SHOW DATABASES`,
exp: `{"results":[{"series":[{"name":"databases","columns":["name"],"values":[["db0"]]}]}]}`,
},
&Query{
name: "create database should error if it already exists",
command: `CREATE DATABASE db0`,
exp: `{"results":[{"error":"database already exists"}]}`,
},
&Query{
name: "drop database should succeed",
command: `DROP DATABASE db0`,
exp: `{"results":[{}]}`,
},
&Query{
name: "show database should have no results",
command: `SHOW DATABASES`,
exp: `{"results":[{"series":[{"name":"databases","columns":["name"]}]}]}`,
},
&Query{
name: "drop database should error if it doesn't exist",
command: `DROP DATABASE db0`,
exp: `{"results":[{"error":"database not found: db0"}]}`,
},
},
}
for _, query := range test.queries {
if query.skip {
t.Logf("SKIP:: %s", query.name)
continue
}
if err := query.Execute(s); err != nil {
t.Error(query.Error(err))
} else if !query.success() {
t.Error(query.failureMessage())
}
}
}
func TestServer_Query_DropAndRecreateDatabase(t *testing.T) {
t.Parallel()
s := OpenServer(NewConfig(), "")
defer s.Close()
if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 0)); err != nil {
t.Fatal(err)
}
if err := s.MetaStore.SetDefaultRetentionPolicy("db0", "rp0"); err != nil {
t.Fatal(err)
}
writes := []string{
fmt.Sprintf(`cpu,host=serverA,region=uswest val=23.2 %d`, mustParseTime(time.RFC3339Nano, "2000-01-01T00:00:00Z").UnixNano()),
}
test := NewTest("db0", "rp0")
test.write = strings.Join(writes, "\n")
test.addQueries([]*Query{
&Query{
name: "Drop database after data write",
command: `DROP DATABASE db0`,
exp: `{"results":[{}]}`,
},
&Query{
name: "Recreate database",
command: `CREATE DATABASE db0`,
exp: `{"results":[{}]}`,
},
&Query{
name: "Recreate retention policy",
command: `CREATE RETENTION POLICY rp0 ON db0 DURATION 365d REPLICATION 1 DEFAULT`,
exp: `{"results":[{}]}`,
},
&Query{
name: "Show measurements after recreate",
command: `SHOW MEASUREMENTS`,
exp: `{"results":[{}]}`,
params: url.Values{"db": []string{"db0"}},
},
&Query{
name: "Query data after recreate",
command: `SELECT * FROM cpu`,
exp: `{"results":[{}]}`,
params: url.Values{"db": []string{"db0"}},
},
}...)
for i, query := range test.queries {
if i == 0 {
if err := test.init(s); err != nil {
t.Fatalf("test init failed: %s", err)
}
}
if query.skip {
t.Logf("SKIP:: %s", query.name)
continue
}
if err := query.Execute(s); err != nil {
t.Error(query.Error(err))
} else if !query.success() {
t.Error(query.failureMessage())
}
}
}
func TestServer_Query_DropDatabaseIsolated(t *testing.T) {
t.Parallel()
s := OpenServer(NewConfig(), "")
defer s.Close()
if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 0)); err != nil {
t.Fatal(err)
}
if err := s.MetaStore.SetDefaultRetentionPolicy("db0", "rp0"); err != nil {
t.Fatal(err)
}
if err := s.CreateDatabaseAndRetentionPolicy("db1", newRetentionPolicyInfo("rp1", 1, 0)); err != nil {
t.Fatal(err)
}
writes := []string{
fmt.Sprintf(`cpu,host=serverA,region=uswest val=23.2 %d`, mustParseTime(time.RFC3339Nano, "2000-01-01T00:00:00Z").UnixNano()),
}
test := NewTest("db0", "rp0")
test.write = strings.Join(writes, "\n")
test.addQueries([]*Query{
&Query{
name: "Query data from 1st database",
command: `SELECT * FROM cpu`,
exp: `{"results":[{"series":[{"name":"cpu","tags":{"host":"serverA","region":"uswest"},"columns":["time","val"],"values":[["2000-01-01T00:00:00Z",23.2]]}]}]}`,
params: url.Values{"db": []string{"db0"}},
},
&Query{
name: "Drop other database",
command: `DROP DATABASE db1`,
exp: `{"results":[{}]}`,
},
&Query{
name: "Query data from 1st database and ensure it's still there",
command: `SELECT * FROM cpu`,
exp: `{"results":[{"series":[{"name":"cpu","tags":{"host":"serverA","region":"uswest"},"columns":["time","val"],"values":[["2000-01-01T00:00:00Z",23.2]]}]}]}`,
params: url.Values{"db": []string{"db0"}},
},
}...)
for i, query := range test.queries {
if i == 0 {
if err := test.init(s); err != nil {
t.Fatalf("test init failed: %s", err)
}
}
if query.skip {
t.Logf("SKIP:: %s", query.name)
continue
}
if err := query.Execute(s); err != nil {
t.Error(query.Error(err))
} else if !query.success() {
t.Error(query.failureMessage())
}
}
}
// Ensure retention policy commands work.
func TestServer_RetentionPolicyCommands(t *testing.T) {
t.Parallel()
c := NewConfig()
c.Meta.RetentionAutoCreate = false
s := OpenServer(c, "")
defer s.Close()
// Create a database.
if _, err := s.MetaStore.CreateDatabase("db0"); err != nil {
t.Fatal(err)
}
test := Test{
queries: []*Query{
&Query{
name: "create retention policy should succeed",
command: `CREATE RETENTION POLICY rp0 ON db0 DURATION 1h REPLICATION 1`,
exp: `{"results":[{}]}`,
},
&Query{
name: "create retention policy should error if it already exists",
command: `CREATE RETENTION POLICY rp0 ON db0 DURATION 1h REPLICATION 1`,
exp: `{"results":[{"error":"retention policy already exists"}]}`,
},
&Query{
name: "show retention policy should succeed",
command: `SHOW RETENTION POLICIES ON db0`,
exp: `{"results":[{"series":[{"columns":["name","duration","replicaN","default"],"values":[["rp0","1h0m0s",1,false]]}]}]}`,
},
&Query{
name: "alter retention policy should succeed",
command: `ALTER RETENTION POLICY rp0 ON db0 DURATION 2h REPLICATION 3 DEFAULT`,
exp: `{"results":[{}]}`,
},
&Query{
name: "show retention policy should have new altered information",
command: `SHOW RETENTION POLICIES ON db0`,
exp: `{"results":[{"series":[{"columns":["name","duration","replicaN","default"],"values":[["rp0","2h0m0s",3,true]]}]}]}`,
},
&Query{
name: "drop retention policy should succeed",
command: `DROP RETENTION POLICY rp0 ON db0`,
exp: `{"results":[{}]}`,
},
&Query{
name: "show retention policy should be empty after dropping them",
command: `SHOW RETENTION POLICIES ON db0`,
exp: `{"results":[{"series":[{"columns":["name","duration","replicaN","default"]}]}]}`,
},
&Query{
name: "Ensure retention policy with unacceptable retention cannot be created - FIXME issue #2991",
command: `CREATE RETENTION POLICY rp3 ON db0 DURATION 1s REPLICATION 1`,
exp: `{"results":[{"error":"retention policy duration must be at least 1h0m0s"}]}`,
},
&Query{
name: "Check error when deleting retention policy on non-existent database",
command: `DROP RETENTION POLICY rp1 ON mydatabase`,
exp: `{"results":[{"error":"database not found"}]}`,
},
},
}
for _, query := range test.queries {
if query.skip {
t.Logf("SKIP:: %s", query.name)
continue
}
if err := query.Execute(s); err != nil {
t.Error(query.Error(err))
} else if !query.success() {
t.Error(query.failureMessage())
}
}
}
// Ensure the autocreation of retention policy works.
func TestServer_DatabaseRetentionPolicyAutoCreate(t *testing.T) {
t.Parallel()
s := OpenServer(NewConfig(), "")
defer s.Close()
test := Test{
queries: []*Query{
&Query{
name: "create database should succeed",
command: `CREATE DATABASE db0`,
exp: `{"results":[{}]}`,
},
&Query{
name: "show retention policies should return auto-created policy",
command: `SHOW RETENTION POLICIES ON db0`,
exp: `{"results":[{"series":[{"columns":["name","duration","replicaN","default"],"values":[["default","0",1,true]]}]}]}`,
},
},
}
for _, query := range test.queries {
if query.skip {
t.Logf("SKIP:: %s", query.name)
continue
}
if err := query.Execute(s); err != nil {
t.Error(query.Error(err))
} else if !query.success() {
t.Error(query.failureMessage())
}
}
}
// Ensure user commands work.
func TestServer_UserCommands(t *testing.T) {
t.Parallel()
s := OpenServer(NewConfig(), "")
defer s.Close()
// Create a database.
if _, err := s.MetaStore.CreateDatabase("db0"); err != nil {
t.Fatal(err)
}
test := Test{
queries: []*Query{
&Query{
name: "show users, no actual users",
command: `SHOW USERS`,
exp: `{"results":[{"series":[{"columns":["user","admin"]}]}]}`,
},
&Query{
name: `create user`,
command: "CREATE USER jdoe WITH PASSWORD '1337'",
exp: `{"results":[{}]}`,
},
&Query{
name: "show users, 1 existing user",
command: `SHOW USERS`,
exp: `{"results":[{"series":[{"columns":["user","admin"],"values":[["jdoe",false]]}]}]}`,
},
&Query{
name: "grant all priviledges to jdoe",
command: `GRANT ALL PRIVILEGES TO jdoe`,
exp: `{"results":[{}]}`,
},
&Query{
skip: true,
name: "show users, existing user as admin - FIXME issue #2872",
command: `SHOW USERS`,
exp: `{"results":[{"series":[{"columns":["user","admin"],"values":[["jdoe",true]]}]}]}`,
},
&Query{
name: "grant DB privileges to user",
command: `GRANT READ ON db0 TO jdoe`,
exp: `{"results":[{}]}`,
},
&Query{
name: "revoke all privileges",
command: `REVOKE ALL PRIVILEGES FROM jdoe`,
exp: `{"results":[{}]}`,
},
&Query{
name: "bad create user request",
command: `CREATE USER 0xBAD WITH PASSWORD pwd1337`,
exp: `{"error":"error parsing query: found 0, expected identifier at line 1, char 13"}`,
},
&Query{
name: "bad create user request, no name",
command: `CREATE USER WITH PASSWORD pwd1337`,
exp: `{"error":"error parsing query: found WITH, expected identifier at line 1, char 13"}`,
},
&Query{
name: "bad create user request, no password",
command: `CREATE USER jdoe`,
exp: `{"error":"error parsing query: found EOF, expected WITH at line 1, char 18"}`,
},
&Query{
name: "drop user",
command: `DROP USER jdoe`,
exp: `{"results":[{}]}`,
},
&Query{
name: "make sure user was dropped",
command: `SHOW USERS`,
exp: `{"results":[{"series":[{"columns":["user","admin"]}]}]}`,
},
&Query{
name: "delete non existing user",
command: `DROP USER noone`,
exp: `{"results":[{"error":"user not found"}]}`,
},
},
}
for _, query := range test.queries {
if query.skip {
t.Logf("SKIP:: %s", query.name)
continue
}
if err := query.Execute(s); err != nil {
t.Error(fmt.Sprintf("command: %s - err: %s", query.command, query.Error(err)))
} else if !query.success() {
t.Error(query.failureMessage())
}
}
}
// Ensure the server can create a single point via json protocol and read it back.
func TestServer_Write_JSON(t *testing.T) {
t.Parallel()
s := OpenServer(NewConfig(), "")
defer s.Close()
if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 1*time.Hour)); err != nil {
t.Fatal(err)
}
now := now()
if res, err := s.Write("", "", fmt.Sprintf(`{"database" : "db0", "retentionPolicy" : "rp0", "points": [{"measurement": "cpu", "tags": {"host": "server02"},"fields": {"value": 1.0}}],"time":"%s"} `, now.Format(time.RFC3339Nano)), nil); err != nil {
t.Fatal(err)
} else if exp := ``; exp != res {
t.Fatalf("unexpected results\nexp: %s\ngot: %s\n", exp, res)
}
// Verify the data was written.
if res, err := s.Query(`SELECT * FROM db0.rp0.cpu`); err != nil {
t.Fatal(err)
} else if exp := fmt.Sprintf(`{"results":[{"series":[{"name":"cpu","tags":{"host":"server02"},"columns":["time","value"],"values":[["%s",1]]}]}]}`, now.Format(time.RFC3339Nano)); exp != res {
t.Fatalf("unexpected results\nexp: %s\ngot: %s\n", exp, res)
}
}
// Ensure the server can create a single point via line protocol with float type and read it back.
func TestServer_Write_LineProtocol_Float(t *testing.T) {
t.Parallel()
s := OpenServer(NewConfig(), "")
defer s.Close()
if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 1*time.Hour)); err != nil {
t.Fatal(err)
}
now := now()
if res, err := s.Write("db0", "rp0", `cpu,host=server01 value=1.0 `+strconv.FormatInt(now.UnixNano(), 10), nil); err != nil {
t.Fatal(err)
} else if exp := ``; exp != res {
t.Fatalf("unexpected results\nexp: %s\ngot: %s\n", exp, res)
}
// Verify the data was written.
if res, err := s.Query(`SELECT * FROM db0.rp0.cpu`); err != nil {
t.Fatal(err)
} else if exp := fmt.Sprintf(`{"results":[{"series":[{"name":"cpu","tags":{"host":"server01"},"columns":["time","value"],"values":[["%s",1]]}]}]}`, now.Format(time.RFC3339Nano)); exp != res {
t.Fatalf("unexpected results\nexp: %s\ngot: %s\n", exp, res)
}
}
// Ensure the server can create a single point via line protocol with bool type and read it back.
func TestServer_Write_LineProtocol_Bool(t *testing.T) {
t.Parallel()
s := OpenServer(NewConfig(), "")
defer s.Close()
if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 1*time.Hour)); err != nil {
t.Fatal(err)
}
now := now()
if res, err := s.Write("db0", "rp0", `cpu,host=server01 value=true `+strconv.FormatInt(now.UnixNano(), 10), nil); err != nil {
t.Fatal(err)
} else if exp := ``; exp != res {
t.Fatalf("unexpected results\nexp: %s\ngot: %s\n", exp, res)
}
// Verify the data was written.
if res, err := s.Query(`SELECT * FROM db0.rp0.cpu`); err != nil {
t.Fatal(err)
} else if exp := fmt.Sprintf(`{"results":[{"series":[{"name":"cpu","tags":{"host":"server01"},"columns":["time","value"],"values":[["%s",true]]}]}]}`, now.Format(time.RFC3339Nano)); exp != res {
t.Fatalf("unexpected results\nexp: %s\ngot: %s\n", exp, res)
}
}
// Ensure the server can create a single point via line protocol with string type and read it back.
func TestServer_Write_LineProtocol_String(t *testing.T) {
t.Parallel()
s := OpenServer(NewConfig(), "")
defer s.Close()
if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 1*time.Hour)); err != nil {
t.Fatal(err)
}
now := now()
if res, err := s.Write("db0", "rp0", `cpu,host=server01 value="disk full" `+strconv.FormatInt(now.UnixNano(), 10), nil); err != nil {
t.Fatal(err)
} else if exp := ``; exp != res {
t.Fatalf("unexpected results\nexp: %s\ngot: %s\n", exp, res)
}
// Verify the data was written.
if res, err := s.Query(`SELECT * FROM db0.rp0.cpu`); err != nil {
t.Fatal(err)
} else if exp := fmt.Sprintf(`{"results":[{"series":[{"name":"cpu","tags":{"host":"server01"},"columns":["time","value"],"values":[["%s","disk full"]]}]}]}`, now.Format(time.RFC3339Nano)); exp != res {
t.Fatalf("unexpected results\nexp: %s\ngot: %s\n", exp, res)
}
}
// Ensure the server can create a single point via line protocol with integer type and read it back.
func TestServer_Write_LineProtocol_Integer(t *testing.T) {
t.Parallel()
s := OpenServer(NewConfig(), "")
defer s.Close()
if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 1*time.Hour)); err != nil {
t.Fatal(err)
}
now := now()
if res, err := s.Write("db0", "rp0", `cpu,host=server01 value=100 `+strconv.FormatInt(now.UnixNano(), 10), nil); err != nil {
t.Fatal(err)
} else if exp := ``; exp != res {
t.Fatalf("unexpected results\nexp: %s\ngot: %s\n", exp, res)
}
// Verify the data was written.
if res, err := s.Query(`SELECT * FROM db0.rp0.cpu`); err != nil {
t.Fatal(err)
} else if exp := fmt.Sprintf(`{"results":[{"series":[{"name":"cpu","tags":{"host":"server01"},"columns":["time","value"],"values":[["%s",100]]}]}]}`, now.Format(time.RFC3339Nano)); exp != res {
t.Fatalf("unexpected results\nexp: %s\ngot: %s\n", exp, res)
}
}
// Ensure the server can query with default databases (via param) and default retention policy
func TestServer_Query_DefaultDBAndRP(t *testing.T) {
t.Parallel()
s := OpenServer(NewConfig(), "")
defer s.Close()
if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 1*time.Hour)); err != nil {
t.Fatal(err)
}
if err := s.MetaStore.SetDefaultRetentionPolicy("db0", "rp0"); err != nil {
t.Fatal(err)
}
test := NewTest("db0", "rp0")
test.write = fmt.Sprintf(`cpu value=1.0 %d`, mustParseTime(time.RFC3339Nano, "2000-01-01T01:00:00Z").UnixNano())
test.addQueries([]*Query{
&Query{
name: "default db and rp",
params: url.Values{"db": []string{"db0"}},
command: `SELECT * FROM cpu`,
exp: `{"results":[{"series":[{"name":"cpu","columns":["time","value"],"values":[["2000-01-01T01:00:00Z",1]]}]}]}`,
},
&Query{
name: "default rp exists",
command: `show retention policies ON db0`,
exp: `{"results":[{"series":[{"columns":["name","duration","replicaN","default"],"values":[["default","0",1,false],["rp0","1h0m0s",1,true]]}]}]}`,
},
&Query{
name: "default rp",
command: `SELECT * FROM db0..cpu`,
exp: `{"results":[{"series":[{"name":"cpu","columns":["time","value"],"values":[["2000-01-01T01:00:00Z",1]]}]}]}`,
},
&Query{
name: "default dp",
params: url.Values{"db": []string{"db0"}},
command: `SELECT * FROM rp0.cpu`,
exp: `{"results":[{"series":[{"name":"cpu","columns":["time","value"],"values":[["2000-01-01T01:00:00Z",1]]}]}]}`,
},
}...)
if err := test.init(s); err != nil {
t.Fatalf("test init failed: %s", err)
}
for _, query := range test.queries {
if query.skip {
t.Logf("SKIP:: %s", query.name)
continue
}
if err := query.Execute(s); err != nil {
t.Error(query.Error(err))
} else if !query.success() {
t.Error(query.failureMessage())
}
}
}
// Ensure the server can have a database with multiple measurements.
func TestServer_Query_Multiple_Measurements(t *testing.T) {
t.Parallel()
s := OpenServer(NewConfig(), "")
defer s.Close()
if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 1*time.Hour)); err != nil {
t.Fatal(err)
}
// Make sure we do writes for measurements that will span across shards
writes := []string{
fmt.Sprintf("cpu,host=server01 value=100,core=4 %d", mustParseTime(time.RFC3339Nano, "2000-01-01T00:00:00Z").UnixNano()),
fmt.Sprintf("cpu1,host=server02 value=50,core=2 %d", mustParseTime(time.RFC3339Nano, "2015-01-01T00:00:00Z").UnixNano()),
}
test := NewTest("db0", "rp0")
test.write = strings.Join(writes, "\n")
test.addQueries([]*Query{
&Query{
name: "measurement in one shard but not another shouldn't panic server",
command: `SELECT host,value FROM db0.rp0.cpu`,
exp: `{"results":[{"series":[{"name":"cpu","tags":{"host":"server01"},"columns":["time","value"],"values":[["2000-01-01T00:00:00Z",100]]}]}]}`,
},
}...)
if err := test.init(s); err != nil {
t.Fatalf("test init failed: %s", err)
}
for _, query := range test.queries {
if query.skip {
t.Logf("SKIP:: %s", query.name)
continue
}
if err := query.Execute(s); err != nil {
t.Error(query.Error(err))
} else if !query.success() {
t.Error(query.failureMessage())
}
}
}
// Ensure the server correctly supports data with identical tag values.
func TestServer_Query_IdenticalTagValues(t *testing.T) {
t.Parallel()
s := OpenServer(NewConfig(), "")
defer s.Close()
if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 1*time.Hour)); err != nil {
t.Fatal(err)
}
writes := []string{
fmt.Sprintf("cpu,t1=val1 value=1 %d", mustParseTime(time.RFC3339Nano, "2000-01-01T00:00:00Z").UnixNano()),
fmt.Sprintf("cpu,t2=val2 value=2 %d", mustParseTime(time.RFC3339Nano, "2000-01-01T00:01:00Z").UnixNano()),
fmt.Sprintf("cpu,t1=val2 value=3 %d", mustParseTime(time.RFC3339Nano, "2000-01-01T00:02:00Z").UnixNano()),
}
test := NewTest("db0", "rp0")
test.write = strings.Join(writes, "\n")
test.addQueries([]*Query{
&Query{
name: "measurements with identical tag values - SELECT *, no GROUP BY",
command: `SELECT * FROM db0.rp0.cpu`,
exp: `{"results":[{"series":[{"name":"cpu","tags":{"t1":"val1","t2":""},"columns":["time","value"],"values":[["2000-01-01T00:00:00Z",1]]},{"name":"cpu","tags":{"t1":"val2","t2":""},"columns":["time","value"],"values":[["2000-01-01T00:02:00Z",3]]},{"name":"cpu","tags":{"t1":"","t2":"val2"},"columns":["time","value"],"values":[["2000-01-01T00:01:00Z",2]]}]}]}`,
},
&Query{
name: "measurements with identical tag values - SELECT *, with GROUP BY",
command: `SELECT value FROM db0.rp0.cpu GROUP BY t1,t2`,
exp: `{"results":[{"series":[{"name":"cpu","tags":{"t1":"val1","t2":""},"columns":["time","value"],"values":[["2000-01-01T00:00:00Z",1]]},{"name":"cpu","tags":{"t1":"val2","t2":""},"columns":["time","value"],"values":[["2000-01-01T00:02:00Z",3]]},{"name":"cpu","tags":{"t1":"","t2":"val2"},"columns":["time","value"],"values":[["2000-01-01T00:01:00Z",2]]}]}]}`,
},
&Query{
name: "measurements with identical tag values - SELECT value no GROUP BY",
command: `SELECT value FROM db0.rp0.cpu`,
exp: `{"results":[{"series":[{"name":"cpu","columns":["time","value"],"values":[["2000-01-01T00:00:00Z",1],["2000-01-01T00:01:00Z",2],["2000-01-01T00:02:00Z",3]]}]}]}`,
},
}...)
if err := test.init(s); err != nil {
t.Fatalf("test init failed: %s", err)
}
for _, query := range test.queries {
if query.skip {
t.Logf("SKIP:: %s", query.name)
continue
}
if err := query.Execute(s); err != nil {
t.Error(query.Error(err))
} else if !query.success() {
t.Error(query.failureMessage())
}
}
}
// Ensure the server can handle a query that involves accessing no shards.
func TestServer_Query_NoShards(t *testing.T) {
t.Parallel()
s := OpenServer(NewConfig(), "")
defer s.Close()
if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 1*time.Hour)); err != nil {
t.Fatal(err)
}
now := now()
test := NewTest("db0", "rp0")
test.write = `cpu,host=server01 value=1 ` + strconv.FormatInt(now.UnixNano(), 10)
test.addQueries([]*Query{
&Query{
name: "selecting value should succeed",
command: `SELECT value FROM db0.rp0.cpu WHERE time < now() - 1d`,
exp: `{"results":[{}]}`,
},
}...)
if err := test.init(s); err != nil {
t.Fatalf("test init failed: %s", err)
}
for _, query := range test.queries {
if query.skip {
t.Logf("SKIP:: %s", query.name)
continue
}
if err := query.Execute(s); err != nil {
t.Error(query.Error(err))
} else if !query.success() {
t.Error(query.failureMessage())
}
}
}
// Ensure the server can query a non-existent field
func TestServer_Query_NonExistent(t *testing.T) {
t.Parallel()
s := OpenServer(NewConfig(), "")
defer s.Close()
if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 1*time.Hour)); err != nil {
t.Fatal(err)
}
now := now()
test := NewTest("db0", "rp0")
test.write = `cpu,host=server01 value=1 ` + strconv.FormatInt(now.UnixNano(), 10)
test.addQueries([]*Query{
&Query{
name: "selecting value should succeed",
command: `SELECT value FROM db0.rp0.cpu`,
exp: fmt.Sprintf(`{"results":[{"series":[{"name":"cpu","columns":["time","value"],"values":[["%s",1]]}]}]}`, now.Format(time.RFC3339Nano)),
},
&Query{
name: "selecting non-existent should succeed",
command: `SELECT foo FROM db0.rp0.cpu`,
exp: `{"results":[{}]}`,
},
}...)
if err := test.init(s); err != nil {
t.Fatalf("test init failed: %s", err)
}
for _, query := range test.queries {
if query.skip {
t.Logf("SKIP:: %s", query.name)
continue
}
if err := query.Execute(s); err != nil {
t.Error(query.Error(err))
} else if !query.success() {
t.Error(query.failureMessage())
}
}
}
// Ensure the server can perform basic math
func TestServer_Query_Math(t *testing.T) {
t.Parallel()
s := OpenServer(NewConfig(), "")
defer s.Close()
if err := s.CreateDatabaseAndRetentionPolicy("db", newRetentionPolicyInfo("rp", 1, 1*time.Hour)); err != nil {
t.Fatal(err)
}
now := now()
writes := []string{
"float value=42 " + strconv.FormatInt(now.UnixNano(), 10),
"integer value=42i " + strconv.FormatInt(now.UnixNano(), 10),
}
test := NewTest("db", "rp")
test.write = strings.Join(writes, "\n")
test.addQueries([]*Query{
&Query{
name: "SELECT multiple of float value",
command: `SELECT value * 2 from db.rp.float`,
exp: fmt.Sprintf(`{"results":[{"series":[{"name":"float","columns":["time",""],"values":[["%s",84]]}]}]}`, now.Format(time.RFC3339Nano)),
},
&Query{
name: "SELECT multiple of float value",
command: `SELECT 2 * value from db.rp.float`,
exp: fmt.Sprintf(`{"results":[{"series":[{"name":"float","columns":["time",""],"values":[["%s",84]]}]}]}`, now.Format(time.RFC3339Nano)),
},
&Query{
name: "SELECT multiple of integer value",
command: `SELECT value * 2 from db.rp.integer`,
exp: fmt.Sprintf(`{"results":[{"series":[{"name":"integer","columns":["time",""],"values":[["%s",84]]}]}]}`, now.Format(time.RFC3339Nano)),
},
&Query{
name: "SELECT float multiple of integer value",
command: `SELECT value * 2.0 from db.rp.integer`,
exp: fmt.Sprintf(`{"results":[{"series":[{"name":"integer","columns":["time",""],"values":[["%s",84]]}]}]}`, now.Format(time.RFC3339Nano)),
},
}...)
if err := test.init(s); err != nil {
t.Fatalf("test init failed: %s", err)
}
for _, query := range test.queries {
if query.skip {
t.Logf("SKIP:: %s", query.name)
continue
}
if err := query.Execute(s); err != nil {
t.Error(query.Error(err))
} else if !query.success() {
t.Error(query.failureMessage())
}
}
}
// Ensure the server can query with the count aggregate function
func TestServer_Query_Count(t *testing.T) {
t.Parallel()
s := OpenServer(NewConfig(), "")
defer s.Close()
if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 1*time.Hour)); err != nil {
t.Fatal(err)
}
now := now()
test := NewTest("db0", "rp0")
test.write = `cpu,host=server01 value=1.0 ` + strconv.FormatInt(now.UnixNano(), 10)
hour_ago := now.Add(-time.Hour).UTC()
test.addQueries([]*Query{
&Query{
name: "selecting count(value) should succeed",
command: `SELECT count(value) FROM db0.rp0.cpu`,
exp: `{"results":[{"series":[{"name":"cpu","columns":["time","count"],"values":[["1970-01-01T00:00:00Z",1]]}]}]}`,
},
&Query{
name: "selecting count(value) with where time should return result",
command: fmt.Sprintf(`SELECT count(value) FROM db0.rp0.cpu WHERE time >= '%s'`, hour_ago.Format(time.RFC3339Nano)),
exp: fmt.Sprintf(`{"results":[{"series":[{"name":"cpu","columns":["time","count"],"values":[["%s",1]]}]}]}`, hour_ago.Format(time.RFC3339Nano)),
},
&Query{
name: "selecting count(*) should error",
command: `SELECT count(*) FROM db0.rp0.cpu`,
exp: `{"results":[{"error":"expected field argument in count()"}]}`,
},
}...)
if err := test.init(s); err != nil {
t.Fatalf("test init failed: %s", err)
}
for _, query := range test.queries {
if query.skip {
t.Logf("SKIP:: %s", query.name)
continue
}
if err := query.Execute(s); err != nil {
t.Error(query.Error(err))
} else if !query.success() {
t.Error(query.failureMessage())
}
}
}
// Ensure the server can query with Now().
func TestServer_Query_Now(t *testing.T) {
t.Parallel()
s := OpenServer(NewConfig(), "")
defer s.Close()
if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 1*time.Hour)); err != nil {
t.Fatal(err)
}
now := now()
test := NewTest("db0", "rp0")
test.write = `cpu,host=server01 value=1.0 ` + strconv.FormatInt(now.UnixNano(), 10)
test.addQueries([]*Query{
&Query{
name: "where with time < now() should work",
command: `SELECT * FROM db0.rp0.cpu where time < now()`,
exp: fmt.Sprintf(`{"results":[{"series":[{"name":"cpu","tags":{"host":"server01"},"columns":["time","value"],"values":[["%s",1]]}]}]}`, now.Format(time.RFC3339Nano)),
},
&Query{
name: "where with time > now() should return an empty result - FIXME issue #2874",
command: `SELECT * FROM db0.rp0.cpu where time > now()`,
exp: `{"results":[{}]}`,
},
}...)
if err := test.init(s); err != nil {
t.Fatalf("test init failed: %s", err)
}
for _, query := range test.queries {
if query.skip {
t.Logf("SKIP:: %s", query.name)
continue
}
if err := query.Execute(s); err != nil {
t.Error(query.Error(err))
} else if !query.success() {
t.Error(query.failureMessage())
}
}
}
// Ensure the server can query with epoch precisions.
func TestServer_Query_EpochPrecision(t *testing.T) {
t.Parallel()
s := OpenServer(NewConfig(), "")
defer s.Close()
if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 1*time.Hour)); err != nil {
t.Fatal(err)
}
now := now()
test := NewTest("db0", "rp0")
test.write = `cpu,host=server01 value=1.0 ` + strconv.FormatInt(now.UnixNano(), 10)
test.addQueries([]*Query{
&Query{
name: "nanosecond precision",
command: `SELECT * FROM db0.rp0.cpu`,
params: url.Values{"epoch": []string{"n"}},
exp: fmt.Sprintf(`{"results":[{"series":[{"name":"cpu","tags":{"host":"server01"},"columns":["time","value"],"values":[[%d,1]]}]}]}`, now.UnixNano()),
},
&Query{
name: "microsecond precision",
command: `SELECT * FROM db0.rp0.cpu`,
params: url.Values{"epoch": []string{"u"}},
exp: fmt.Sprintf(`{"results":[{"series":[{"name":"cpu","tags":{"host":"server01"},"columns":["time","value"],"values":[[%d,1]]}]}]}`, now.UnixNano()/int64(time.Microsecond)),
},
&Query{
name: "millisecond precision",
command: `SELECT * FROM db0.rp0.cpu`,
params: url.Values{"epoch": []string{"ms"}},
exp: fmt.Sprintf(`{"results":[{"series":[{"name":"cpu","tags":{"host":"server01"},"columns":["time","value"],"values":[[%d,1]]}]}]}`, now.UnixNano()/int64(time.Millisecond)),
},
&Query{
name: "second precision",
command: `SELECT * FROM db0.rp0.cpu`,
params: url.Values{"epoch": []string{"s"}},
exp: fmt.Sprintf(`{"results":[{"series":[{"name":"cpu","tags":{"host":"server01"},"columns":["time","value"],"values":[[%d,1]]}]}]}`, now.UnixNano()/int64(time.Second)),
},
&Query{
name: "minute precision",
command: `SELECT * FROM db0.rp0.cpu`,
params: url.Values{"epoch": []string{"m"}},
exp: fmt.Sprintf(`{"results":[{"series":[{"name":"cpu","tags":{"host":"server01"},"columns":["time","value"],"values":[[%d,1]]}]}]}`, now.UnixNano()/int64(time.Minute)),
},
&Query{
name: "hour precision",
command: `SELECT * FROM db0.rp0.cpu`,
params: url.Values{"epoch": []string{"h"}},
exp: fmt.Sprintf(`{"results":[{"series":[{"name":"cpu","tags":{"host":"server01"},"columns":["time","value"],"values":[[%d,1]]}]}]}`, now.UnixNano()/int64(time.Hour)),
},
}...)
if err := test.init(s); err != nil {
t.Fatalf("test init failed: %s", err)
}
for _, query := range test.queries {
if query.skip {
t.Logf("SKIP:: %s", query.name)
continue
}
if err := query.Execute(s); err != nil {
t.Error(query.Error(err))
} else if !query.success() {
t.Error(query.failureMessage())
}
}
}
// Ensure the server works with tag queries.
func TestServer_Query_Tags(t *testing.T) {
t.Parallel()
s := OpenServer(NewConfig(), "")
defer s.Close()
if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 1*time.Hour)); err != nil {
t.Fatal(err)
}
now := now()
writes := []string{
fmt.Sprintf("cpu,host=server01 value=100,core=4 %d", now.UnixNano()),
fmt.Sprintf("cpu,host=server02 value=50,core=2 %d", now.Add(1).UnixNano()),
fmt.Sprintf("cpu1,host=server01,region=us-west value=100 %d", mustParseTime(time.RFC3339Nano, "2015-02-28T01:03:36.703820946Z").UnixNano()),
fmt.Sprintf("cpu1,host=server02 value=200 %d", mustParseTime(time.RFC3339Nano, "2010-02-28T01:03:37.703820946Z").UnixNano()),
fmt.Sprintf("cpu1,host=server03 value=300 %d", mustParseTime(time.RFC3339Nano, "2012-02-28T01:03:38.703820946Z").UnixNano()),
fmt.Sprintf("cpu2,host=server01 value=100 %d", mustParseTime(time.RFC3339Nano, "2015-02-28T01:03:36.703820946Z").UnixNano()),
fmt.Sprintf("cpu2 value=200 %d", mustParseTime(time.RFC3339Nano, "2012-02-28T01:03:38.703820946Z").UnixNano()),
fmt.Sprintf("cpu3,company=acme01 value=100 %d", mustParseTime(time.RFC3339Nano, "2015-02-28T01:03:36.703820946Z").UnixNano()),
fmt.Sprintf("cpu3 value=200 %d", mustParseTime(time.RFC3339Nano, "2012-02-28T01:03:38.703820946Z").UnixNano()),
}
test := NewTest("db0", "rp0")
test.write = strings.Join(writes, "\n")
test.addQueries([]*Query{
&Query{
name: "tag without field should return error",
command: `SELECT host FROM db0.rp0.cpu`,
exp: `{"results":[{}]}`,
},
&Query{
name: "field with tag should succeed",
command: `SELECT host, value FROM db0.rp0.cpu`,
exp: fmt.Sprintf(`{"results":[{"series":[{"name":"cpu","tags":{"host":"server01"},"columns":["time","value"],"values":[["%s",100]]},{"name":"cpu","tags":{"host":"server02"},"columns":["time","value"],"values":[["%s",50]]}]}]}`, now.Format(time.RFC3339Nano), now.Add(1).Format(time.RFC3339Nano)),
},
&Query{
name: "field with two tags should succeed",
command: `SELECT host, value, core FROM db0.rp0.cpu`,
exp: fmt.Sprintf(`{"results":[{"series":[{"name":"cpu","tags":{"host":"server01"},"columns":["time","value","core"],"values":[["%s",100,4]]},{"name":"cpu","tags":{"host":"server02"},"columns":["time","value","core"],"values":[["%s",50,2]]}]}]}`, now.Format(time.RFC3339Nano), now.Add(1).Format(time.RFC3339Nano)),
},
&Query{
name: "select * with tags should succeed",
command: `SELECT * FROM db0.rp0.cpu`,
exp: fmt.Sprintf(`{"results":[{"series":[{"name":"cpu","tags":{"host":"server01"},"columns":["time","core","value"],"values":[["%s",4,100]]},{"name":"cpu","tags":{"host":"server02"},"columns":["time","core","value"],"values":[["%s",2,50]]}]}]}`, now.Format(time.RFC3339Nano), now.Add(1).Format(time.RFC3339Nano)),
},
&Query{
name: "group by tag",
command: `SELECT value FROM db0.rp0.cpu GROUP by host`,
exp: fmt.Sprintf(`{"results":[{"series":[{"name":"cpu","tags":{"host":"server01"},"columns":["time","value"],"values":[["%s",100]]},{"name":"cpu","tags":{"host":"server02"},"columns":["time","value"],"values":[["%s",50]]}]}]}`, now.Format(time.RFC3339Nano), now.Add(1).Format(time.RFC3339Nano)),
},
&Query{
name: "single field (EQ tag value1)",
command: `SELECT value FROM db0.rp0.cpu1 WHERE host = 'server01'`,
exp: `{"results":[{"series":[{"name":"cpu1","columns":["time","value"],"values":[["2015-02-28T01:03:36.703820946Z",100]]}]}]}`,
},
&Query{
name: "single field (2 EQ tags)",
command: `SELECT value FROM db0.rp0.cpu1 WHERE host = 'server01' AND region = 'us-west'`,
exp: `{"results":[{"series":[{"name":"cpu1","columns":["time","value"],"values":[["2015-02-28T01:03:36.703820946Z",100]]}]}]}`,
},
&Query{
name: "single field (OR different tags)",
command: `SELECT value FROM db0.rp0.cpu1 WHERE host = 'server03' OR region = 'us-west'`,
exp: `{"results":[{"series":[{"name":"cpu1","columns":["time","value"],"values":[["2012-02-28T01:03:38.703820946Z",300],["2015-02-28T01:03:36.703820946Z",100]]}]}]}`,
},
&Query{
name: "single field (OR with non-existent tag value)",
command: `SELECT value FROM db0.rp0.cpu1 WHERE host = 'server01' OR host = 'server66'`,
exp: `{"results":[{"series":[{"name":"cpu1","columns":["time","value"],"values":[["2015-02-28T01:03:36.703820946Z",100]]}]}]}`,
},
&Query{
name: "single field (OR with all tag values)",
command: `SELECT value FROM db0.rp0.cpu1 WHERE host = 'server01' OR host = 'server02' OR host = 'server03'`,
exp: `{"results":[{"series":[{"name":"cpu1","columns":["time","value"],"values":[["2010-02-28T01:03:37.703820946Z",200],["2012-02-28T01:03:38.703820946Z",300],["2015-02-28T01:03:36.703820946Z",100]]}]}]}`,
},
&Query{
name: "single field (1 EQ and 1 NEQ tag)",
command: `SELECT value FROM db0.rp0.cpu1 WHERE host = 'server01' AND region != 'us-west'`,
exp: `{"results":[{}]}`,
},
&Query{
name: "single field (EQ tag value2)",
command: `SELECT value FROM db0.rp0.cpu1 WHERE host = 'server02'`,
exp: `{"results":[{"series":[{"name":"cpu1","columns":["time","value"],"values":[["2010-02-28T01:03:37.703820946Z",200]]}]}]}`,
},
&Query{
name: "single field (NEQ tag value1)",
command: `SELECT value FROM db0.rp0.cpu1 WHERE host != 'server01'`,
exp: `{"results":[{"series":[{"name":"cpu1","columns":["time","value"],"values":[["2010-02-28T01:03:37.703820946Z",200],["2012-02-28T01:03:38.703820946Z",300]]}]}]}`,
},
&Query{
name: "single field (NEQ tag value1 AND NEQ tag value2)",
command: `SELECT value FROM db0.rp0.cpu1 WHERE host != 'server01' AND host != 'server02'`,
exp: `{"results":[{"series":[{"name":"cpu1","columns":["time","value"],"values":[["2012-02-28T01:03:38.703820946Z",300]]}]}]}`,
},
&Query{
name: "single field (NEQ tag value1 OR NEQ tag value2)",
command: `SELECT value FROM db0.rp0.cpu1 WHERE host != 'server01' OR host != 'server02'`, // Yes, this is always true, but that's the point.
exp: `{"results":[{"series":[{"name":"cpu1","columns":["time","value"],"values":[["2010-02-28T01:03:37.703820946Z",200],["2012-02-28T01:03:38.703820946Z",300],["2015-02-28T01:03:36.703820946Z",100]]}]}]}`,
},
&Query{
name: "single field (NEQ tag value1 AND NEQ tag value2 AND NEQ tag value3)",
command: `SELECT value FROM db0.rp0.cpu1 WHERE host != 'server01' AND host != 'server02' AND host != 'server03'`,
exp: `{"results":[{}]}`,
},
&Query{
name: "single field (NEQ tag value1, point without any tags)",
command: `SELECT value FROM db0.rp0.cpu2 WHERE host != 'server01'`,
exp: `{"results":[{"series":[{"name":"cpu2","columns":["time","value"],"values":[["2012-02-28T01:03:38.703820946Z",200]]}]}]}`,
},
&Query{
name: "single field (NEQ tag value1, point without any tags)",
command: `SELECT value FROM db0.rp0.cpu3 WHERE company !~ /acme01/`,
exp: `{"results":[{"series":[{"name":"cpu3","columns":["time","value"],"values":[["2012-02-28T01:03:38.703820946Z",200]]}]}]}`,
},
&Query{
name: "single field (regex tag match)",
command: `SELECT value FROM db0.rp0.cpu3 WHERE company =~ /acme01/`,
exp: `{"results":[{"series":[{"name":"cpu3","columns":["time","value"],"values":[["2015-02-28T01:03:36.703820946Z",100]]}]}]}`,
},
&Query{
name: "single field (regex tag match)",
command: `SELECT value FROM db0.rp0.cpu3 WHERE company !~ /acme[23]/`,
exp: `{"results":[{"series":[{"name":"cpu3","columns":["time","value"],"values":[["2012-02-28T01:03:38.703820946Z",200],["2015-02-28T01:03:36.703820946Z",100]]}]}]}`,
},
}...)
if err := test.init(s); err != nil {
t.Fatalf("test init failed: %s", err)
}
for _, query := range test.queries {
if query.skip {
t.Logf("SKIP:: %s", query.name)
continue
}
if err := query.Execute(s); err != nil {
t.Error(query.Error(err))
} else if !query.success() {
t.Error(query.failureMessage())
}
}
}
// Ensure the server correctly queries with an alias.
func TestServer_Query_Alias(t *testing.T) {
t.Parallel()
s := OpenServer(NewConfig(), "")
defer s.Close()
if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 1*time.Hour)); err != nil {
t.Fatal(err)
}
writes := []string{
fmt.Sprintf("cpu value=1i,steps=3i %d", mustParseTime(time.RFC3339Nano, "2000-01-01T00:00:00Z").UnixNano()),
fmt.Sprintf("cpu value=2i,steps=4i %d", mustParseTime(time.RFC3339Nano, "2000-01-01T00:01:00Z").UnixNano()),
}
test := NewTest("db0", "rp0")
test.write = strings.Join(writes, "\n")
test.addQueries([]*Query{
&Query{
name: "baseline query - SELECT * FROM db0.rp0.cpu",
command: `SELECT * FROM db0.rp0.cpu`,
exp: `{"results":[{"series":[{"name":"cpu","columns":["time","steps","value"],"values":[["2000-01-01T00:00:00Z",3,1],["2000-01-01T00:01:00Z",4,2]]}]}]}`,
},
&Query{
name: "basic query with alias - SELECT steps, value as v FROM db0.rp0.cpu",
command: `SELECT steps, value as v FROM db0.rp0.cpu`,
exp: `{"results":[{"series":[{"name":"cpu","columns":["time","steps","v"],"values":[["2000-01-01T00:00:00Z",3,1],["2000-01-01T00:01:00Z",4,2]]}]}]}`,
},
&Query{
name: "double aggregate sum - SELECT sum(value), sum(steps) FROM db0.rp0.cpu",
command: `SELECT sum(value), sum(steps) FROM db0.rp0.cpu`,
exp: `{"results":[{"series":[{"name":"cpu","columns":["time","sum","sum"],"values":[["1970-01-01T00:00:00Z",3,7]]}]}]}`,
},
&Query{
name: "double aggregate sum reverse order - SELECT sum(steps), sum(value) FROM db0.rp0.cpu",
command: `SELECT sum(steps), sum(value) FROM db0.rp0.cpu`,
exp: `{"results":[{"series":[{"name":"cpu","columns":["time","sum","sum"],"values":[["1970-01-01T00:00:00Z",7,3]]}]}]}`,
},
&Query{
name: "double aggregate sum with alias - SELECT sum(value) as sumv, sum(steps) as sums FROM db0.rp0.cpu",
command: `SELECT sum(value) as sumv, sum(steps) as sums FROM db0.rp0.cpu`,
exp: `{"results":[{"series":[{"name":"cpu","columns":["time","sumv","sums"],"values":[["1970-01-01T00:00:00Z",3,7]]}]}]}`,
},
&Query{
name: "double aggregate with same value - SELECT sum(value), mean(value) FROM db0.rp0.cpu",
command: `SELECT sum(value), mean(value) FROM db0.rp0.cpu`,
exp: `{"results":[{"series":[{"name":"cpu","columns":["time","sum","mean"],"values":[["1970-01-01T00:00:00Z",3,1.5]]}]}]}`,
},
&Query{
name: "double aggregate with same value and same alias - SELECT mean(value) as mv, max(value) as mv FROM db0.rp0.cpu",
command: `SELECT mean(value) as mv, max(value) as mv FROM db0.rp0.cpu`,
exp: `{"results":[{"series":[{"name":"cpu","columns":["time","mv","mv"],"values":[["1970-01-01T00:00:00Z",1.5,2]]}]}]}`,
},
&Query{
name: "double aggregate with non-existent field - SELECT mean(value), max(foo) FROM db0.rp0.cpu",
command: `SELECT mean(value), max(foo) FROM db0.rp0.cpu`,
exp: `{"results":[{"series":[{"name":"cpu","columns":["time","mean","max"],"values":[["1970-01-01T00:00:00Z",1.5,null]]}]}]}`,
},
}...)
if err := test.init(s); err != nil {
t.Fatalf("test init failed: %s", err)
}
for _, query := range test.queries {
if query.skip {
t.Logf("SKIP:: %s", query.name)
continue
}
if err := query.Execute(s); err != nil {
t.Error(query.Error(err))
} else if !query.success() {
t.Error(query.failureMessage())
}
}
}
// Ensure the server will succeed and error for common scenarios.
func TestServer_Query_Common(t *testing.T) {
t.Parallel()
s := OpenServer(NewConfig(), "")
defer s.Close()
if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 1*time.Hour)); err != nil {
t.Fatal(err)
}
now := now()
test := NewTest("db0", "rp0")
test.write = fmt.Sprintf("cpu,host=server01 value=1 %s", strconv.FormatInt(now.UnixNano(), 10))
test.addQueries([]*Query{
&Query{
name: "selecting a from a non-existent database should error",
command: `SELECT value FROM db1.rp0.cpu`,
exp: `{"results":[{"error":"database not found: db1"}]}`,
},
&Query{
name: "selecting a from a non-existent retention policy should error",
command: `SELECT value FROM db0.rp1.cpu`,
exp: `{"results":[{"error":"retention policy not found"}]}`,
},
&Query{
name: "selecting a valid measurement and field should succeed",
command: `SELECT value FROM db0.rp0.cpu`,
exp: fmt.Sprintf(`{"results":[{"series":[{"name":"cpu","columns":["time","value"],"values":[["%s",1]]}]}]}`, now.Format(time.RFC3339Nano)),
},
&Query{
name: "selecting a measurement that doesn't exist should result in empty set",
command: `SELECT value FROM db0.rp0.idontexist`,
exp: `{"results":[{}]}`,
},
&Query{
name: "selecting a field that doesn't exist should result in empty set",
command: `SELECT idontexist FROM db0.rp0.cpu`,
exp: `{"results":[{}]}`,
},
&Query{
name: "selecting wildcard without specifying a database should error",
command: `SELECT * FROM cpu`,
exp: `{"results":[{"error":"database name required"}]}`,
},
&Query{
name: "selecting explicit field without specifying a database should error",
command: `SELECT value FROM cpu`,
exp: `{"results":[{"error":"database name required"}]}`,
},
}...)
if err := test.init(s); err != nil {
t.Fatalf("test init failed: %s", err)
}
for _, query := range test.queries {
if query.skip {
t.Logf("SKIP:: %s", query.name)
continue
}
if err := query.Execute(s); err != nil {
t.Error(query.Error(err))
} else if !query.success() {
t.Error(query.failureMessage())
}
}
}
// Ensure the server can query two points.
func TestServer_Query_SelectTwoPoints(t *testing.T) {
t.Parallel()
s := OpenServer(NewConfig(), "")
defer s.Close()
if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 1*time.Hour)); err != nil {
t.Fatal(err)
}
now := now()
test := NewTest("db0", "rp0")
test.write = fmt.Sprintf("cpu value=100 %s\ncpu value=200 %s", strconv.FormatInt(now.UnixNano(), 10), strconv.FormatInt(now.Add(1).UnixNano(), 10))
test.addQueries(&Query{
name: "selecting two points should result in two points",
command: `SELECT * FROM db0.rp0.cpu`,
exp: fmt.Sprintf(`{"results":[{"series":[{"name":"cpu","columns":["time","value"],"values":[["%s",100],["%s",200]]}]}]}`, now.Format(time.RFC3339Nano), now.Add(1).Format(time.RFC3339Nano)),
})
for i, query := range test.queries {
if i == 0 {
if err := test.init(s); err != nil {
t.Fatalf("test init failed: %s", err)
}
}
if query.skip {
t.Logf("SKIP:: %s", query.name)
continue
}
if err := query.Execute(s); err != nil {
t.Error(query.Error(err))
} else if !query.success() {
t.Error(query.failureMessage())
}
}
}
// Ensure the server can query two negative points.
func TestServer_Query_SelectTwoNegativePoints(t *testing.T) {
t.Parallel()
s := OpenServer(NewConfig(), "")
defer s.Close()
if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 1*time.Hour)); err != nil {
t.Fatal(err)
}
now := now()
test := NewTest("db0", "rp0")
test.write = fmt.Sprintf("cpu value=-100 %s\ncpu value=-200 %s", strconv.FormatInt(now.UnixNano(), 10), strconv.FormatInt(now.Add(1).UnixNano(), 10))
test.addQueries(&Query{
name: "selecting two negative points should succeed",
command: `SELECT * FROM db0.rp0.cpu`,
exp: fmt.Sprintf(`{"results":[{"series":[{"name":"cpu","columns":["time","value"],"values":[["%s",-100],["%s",-200]]}]}]}`, now.Format(time.RFC3339Nano), now.Add(1).Format(time.RFC3339Nano)),
})
for i, query := range test.queries {
if i == 0 {
if err := test.init(s); err != nil {
t.Fatalf("test init failed: %s", err)
}
}
if query.skip {
t.Logf("SKIP:: %s", query.name)
continue
}
if err := query.Execute(s); err != nil {
t.Error(query.Error(err))
} else if !query.success() {
t.Error(query.failureMessage())
}
}
}
// Ensure the server can query with relative time.
func TestServer_Query_SelectRelativeTime(t *testing.T) {
t.Parallel()
s := OpenServer(NewConfig(), "")
defer s.Close()
if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 1*time.Hour)); err != nil {
t.Fatal(err)
}
now := now()
yesterday := yesterday()
test := NewTest("db0", "rp0")
test.write = fmt.Sprintf("cpu,host=server01 value=100 %s\ncpu,host=server01 value=200 %s", strconv.FormatInt(yesterday.UnixNano(), 10), strconv.FormatInt(now.UnixNano(), 10))
test.addQueries([]*Query{
&Query{
name: "single point with time pre-calculated for past time queries yesterday",
command: `SELECT * FROM db0.rp0.cpu where time >= '` + yesterday.Add(-1*time.Minute).Format(time.RFC3339Nano) + `'`,
exp: fmt.Sprintf(`{"results":[{"series":[{"name":"cpu","tags":{"host":"server01"},"columns":["time","value"],"values":[["%s",100],["%s",200]]}]}]}`, yesterday.Format(time.RFC3339Nano), now.Format(time.RFC3339Nano)),
},
&Query{
name: "single point with time pre-calculated for relative time queries now",
command: `SELECT * FROM db0.rp0.cpu where time >= now() - 1m`,
exp: fmt.Sprintf(`{"results":[{"series":[{"name":"cpu","tags":{"host":"server01"},"columns":["time","value"],"values":[["%s",200]]}]}]}`, now.Format(time.RFC3339Nano)),
},
}...)
for i, query := range test.queries {
if i == 0 {
if err := test.init(s); err != nil {
t.Fatalf("test init failed: %s", err)
}
}
if query.skip {
t.Logf("SKIP:: %s", query.name)
continue
}
if err := query.Execute(s); err != nil {
t.Error(query.Error(err))
} else if !query.success() {
t.Error(query.failureMessage())
}
}
}
// Ensure the server can handle various simple calculus queries.
func TestServer_Query_SelectRawCalculus(t *testing.T) {
t.Parallel()
s := OpenServer(NewConfig(), "")
defer s.Close()
if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 1*time.Hour)); err != nil {
t.Fatal(err)
}
test := NewTest("db0", "rp0")
test.write = fmt.Sprintf("cpu value=210 1278010021000000000\ncpu value=10 1278010022000000000")
test.addQueries([]*Query{
&Query{
name: "calculate single derivate",
command: `SELECT derivative(value) from db0.rp0.cpu`,
exp: `{"results":[{"series":[{"name":"cpu","columns":["time","derivative"],"values":[["2010-07-01T18:47:02Z",-200]]}]}]}`,
},
}...)
for i, query := range test.queries {
if i == 0 {
if err := test.init(s); err != nil {
t.Fatalf("test init failed: %s", err)
}
}
if query.skip {
t.Logf("SKIP:: %s", query.name)
continue
}
if err := query.Execute(s); err != nil {
t.Error(query.Error(err))
} else if !query.success() {
t.Error(query.failureMessage())
}
}
}
// mergeMany ensures that when merging many series together and some of them have a different number
// of points than others in a group by interval the results are correct
func TestServer_Query_MergeMany(t *testing.T) {
t.Parallel()
s := OpenServer(NewConfig(), "")
defer s.Close()
// set infinite retention policy as we are inserting data in the past and don't want retention policy enforcement to make this test racy
if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 0)); err != nil {
t.Fatal(err)
}
test := NewTest("db0", "rp0")
writes := []string{}
for i := 1; i < 11; i++ {
for j := 1; j < 5+i%3; j++ {
data := fmt.Sprintf(`cpu,host=server_%d value=22 %d`, i, time.Unix(int64(j), int64(0)).UTC().UnixNano())
writes = append(writes, data)
}
}
test.write = strings.Join(writes, "\n")
test.addQueries([]*Query{
&Query{
name: "GROUP by time",
command: `SELECT count(value) FROM db0.rp0.cpu WHERE time >= '1970-01-01T00:00:01Z' AND time <= '1970-01-01T00:00:06Z' GROUP BY time(1s)`,
exp: `{"results":[{"series":[{"name":"cpu","columns":["time","count"],"values":[["1970-01-01T00:00:01Z",10],["1970-01-01T00:00:02Z",10],["1970-01-01T00:00:03Z",10],["1970-01-01T00:00:04Z",10],["1970-01-01T00:00:05Z",7],["1970-01-01T00:00:06Z",3]]}]}]}`,
},
&Query{
skip: true,
name: "GROUP by tag - FIXME issue #2875",
command: `SELECT count(value) FROM db0.rp0.cpu where time >= '2000-01-01T00:00:00Z' and time <= '2000-01-01T02:00:00Z' group by host`,
exp: `{"results":[{"series":[{"name":"cpu","tags":{"host":"server01"},"columns":["time","count"],"values":[["2000-01-01T00:00:00Z",1]]},{"name":"cpu","tags":{"host":"server02"},"columns":["time","count"],"values":[["2000-01-01T00:00:00Z",1]]},{"name":"cpu","tags":{"host":"server03"},"columns":["time","count"],"values":[["2000-01-01T00:00:00Z",1]]}]}]}`,
},
&Query{
name: "GROUP by field",
command: `SELECT count(value) FROM db0.rp0.cpu group by value`,
exp: `{"results":[{"error":"can not use field in GROUP BY clause: value"}]}`,
},
}...)
for i, query := range test.queries {
if i == 0 {
if err := test.init(s); err != nil {
t.Fatalf("test init failed: %s", err)
}
}
if query.skip {
t.Logf("SKIP:: %s", query.name)
continue
}
if err := query.Execute(s); err != nil {
t.Error(query.Error(err))
} else if !query.success() {
t.Error(query.failureMessage())
}
}
}
func TestServer_Query_SLimitAndSOffset(t *testing.T) {
t.Parallel()
s := OpenServer(NewConfig(), "")
defer s.Close()
// set infinite retention policy as we are inserting data in the past and don't want retention policy enforcement to make this test racy
if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 0)); err != nil {
t.Fatal(err)
}
test := NewTest("db0", "rp0")
writes := []string{}
for i := 1; i < 10; i++ {
data := fmt.Sprintf(`cpu,region=us-east,host=server-%d value=%d %d`, i, i, time.Unix(int64(i), int64(0)).UnixNano())
writes = append(writes, data)
}
test.write = strings.Join(writes, "\n")
test.addQueries([]*Query{
&Query{
name: "SLIMIT 2 SOFFSET 1",
command: `SELECT count(value) FROM db0.rp0.cpu GROUP BY * SLIMIT 2 SOFFSET 1`,
exp: `{"results":[{"series":[{"name":"cpu","tags":{"host":"server-2","region":"us-east"},"columns":["time","count"],"values":[["1970-01-01T00:00:00Z",1]]},{"name":"cpu","tags":{"host":"server-3","region":"us-east"},"columns":["time","count"],"values":[["1970-01-01T00:00:00Z",1]]}]}]}`,
},
&Query{
name: "SLIMIT 2 SOFFSET 3",
command: `SELECT count(value) FROM db0.rp0.cpu GROUP BY * SLIMIT 2 SOFFSET 3`,
exp: `{"results":[{"series":[{"name":"cpu","tags":{"host":"server-4","region":"us-east"},"columns":["time","count"],"values":[["1970-01-01T00:00:00Z",1]]},{"name":"cpu","tags":{"host":"server-5","region":"us-east"},"columns":["time","count"],"values":[["1970-01-01T00:00:00Z",1]]}]}]}`,
},
&Query{
name: "SLIMIT 3 SOFFSET 8",
command: `SELECT count(value) FROM db0.rp0.cpu GROUP BY * SLIMIT 3 SOFFSET 8`,
exp: `{"results":[{"series":[{"name":"cpu","tags":{"host":"server-9","region":"us-east"},"columns":["time","count"],"values":[["1970-01-01T00:00:00Z",1]]}]}]}`,
},
}...)
for i, query := range test.queries {
if i == 0 {
if err := test.init(s); err != nil {
t.Fatalf("test init failed: %s", err)
}
}
if query.skip {
t.Logf("SKIP:: %s", query.name)
continue
}
if err := query.Execute(s); err != nil {
t.Error(query.Error(err))
} else if !query.success() {
t.Error(query.failureMessage())
}
}
}
func TestServer_Query_Regex(t *testing.T) {
t.Parallel()
s := OpenServer(NewConfig(), "")
defer s.Close()
if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 0)); err != nil {
t.Fatal(err)
}
if err := s.MetaStore.SetDefaultRetentionPolicy("db0", "rp0"); err != nil {
t.Fatal(err)
}
writes := []string{
fmt.Sprintf(`cpu1,host=server01 value=10 %d`, mustParseTime(time.RFC3339Nano, "2015-02-28T01:03:36.703820946Z").UnixNano()),
fmt.Sprintf(`cpu2,host=server01 value=20 %d`, mustParseTime(time.RFC3339Nano, "2015-02-28T01:03:36.703820946Z").UnixNano()),
fmt.Sprintf(`cpu3,host=server01 value=30 %d`, mustParseTime(time.RFC3339Nano, "2015-02-28T01:03:36.703820946Z").UnixNano()),
}
test := NewTest("db0", "rp0")
test.write = strings.Join(writes, "\n")
test.addQueries([]*Query{
&Query{
name: "default db and rp",
command: `SELECT * FROM /cpu[13]/`,
params: url.Values{"db": []string{"db0"}},
exp: `{"results":[{"series":[{"name":"cpu1","tags":{"host":"server01"},"columns":["time","value"],"values":[["2015-02-28T01:03:36.703820946Z",10]]},{"name":"cpu3","tags":{"host":"server01"},"columns":["time","value"],"values":[["2015-02-28T01:03:36.703820946Z",30]]}]}]}`,
},
&Query{
name: "specifying db and rp",
command: `SELECT * FROM db0.rp0./cpu[13]/`,
exp: `{"results":[{"series":[{"name":"cpu1","tags":{"host":"server01"},"columns":["time","value"],"values":[["2015-02-28T01:03:36.703820946Z",10]]},{"name":"cpu3","tags":{"host":"server01"},"columns":["time","value"],"values":[["2015-02-28T01:03:36.703820946Z",30]]}]}]}`,
},
&Query{
name: "default db and specified rp",
command: `SELECT * FROM rp0./cpu[13]/`,
params: url.Values{"db": []string{"db0"}},
exp: `{"results":[{"series":[{"name":"cpu1","tags":{"host":"server01"},"columns":["time","value"],"values":[["2015-02-28T01:03:36.703820946Z",10]]},{"name":"cpu3","tags":{"host":"server01"},"columns":["time","value"],"values":[["2015-02-28T01:03:36.703820946Z",30]]}]}]}`,
},
&Query{
name: "specified db and default rp",
command: `SELECT * FROM db0../cpu[13]/`,
exp: `{"results":[{"series":[{"name":"cpu1","tags":{"host":"server01"},"columns":["time","value"],"values":[["2015-02-28T01:03:36.703820946Z",10]]},{"name":"cpu3","tags":{"host":"server01"},"columns":["time","value"],"values":[["2015-02-28T01:03:36.703820946Z",30]]}]}]}`,
},
}...)
for i, query := range test.queries {
if i == 0 {
if err := test.init(s); err != nil {
t.Fatalf("test init failed: %s", err)
}
}
if query.skip {
t.Logf("SKIP:: %s", query.name)
continue
}
if err := query.Execute(s); err != nil {
t.Error(query.Error(err))
} else if !query.success() {
t.Error(query.failureMessage())
}
}
}
func TestServer_Query_Aggregates(t *testing.T) {
t.Parallel()
s := OpenServer(NewConfig(), "")
defer s.Close()
if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 0)); err != nil {
t.Fatal(err)
}
if err := s.MetaStore.SetDefaultRetentionPolicy("db0", "rp0"); err != nil {
t.Fatal(err)
}
writes := []string{
fmt.Sprintf(`int value=45 %d`, mustParseTime(time.RFC3339Nano, "2000-01-01T00:00:00Z").UnixNano()),
fmt.Sprintf(`intmax value=%s %d`, maxInt64(), mustParseTime(time.RFC3339Nano, "2000-01-01T00:00:00Z").UnixNano()),
fmt.Sprintf(`intmax value=%s %d`, maxInt64(), mustParseTime(time.RFC3339Nano, "2000-01-01T01:00:00Z").UnixNano()),
fmt.Sprintf(`intmany,host=server01 value=2.0 %d`, mustParseTime(time.RFC3339Nano, "2000-01-01T00:00:00Z").UnixNano()),
fmt.Sprintf(`intmany,host=server02 value=4.0 %d`, mustParseTime(time.RFC3339Nano, "2000-01-01T00:00:10Z").UnixNano()),
fmt.Sprintf(`intmany,host=server03 value=4.0 %d`, mustParseTime(time.RFC3339Nano, "2000-01-01T00:00:20Z").UnixNano()),
fmt.Sprintf(`intmany,host=server04 value=4.0 %d`, mustParseTime(time.RFC3339Nano, "2000-01-01T00:00:30Z").UnixNano()),
fmt.Sprintf(`intmany,host=server05 value=5.0 %d`, mustParseTime(time.RFC3339Nano, "2000-01-01T00:00:40Z").UnixNano()),
fmt.Sprintf(`intmany,host=server06 value=5.0 %d`, mustParseTime(time.RFC3339Nano, "2000-01-01T00:00:50Z").UnixNano()),
fmt.Sprintf(`intmany,host=server07 value=7.0 %d`, mustParseTime(time.RFC3339Nano, "2000-01-01T00:01:00Z").UnixNano()),
fmt.Sprintf(`intmany,host=server08 value=9.0 %d`, mustParseTime(time.RFC3339Nano, "2000-01-01T00:01:10Z").UnixNano()),
fmt.Sprintf(`intoverlap,region=us-east value=20 %d`, mustParseTime(time.RFC3339Nano, "2000-01-01T00:00:00Z").UnixNano()),
fmt.Sprintf(`intoverlap,region=us-east value=30 %d`, mustParseTime(time.RFC3339Nano, "2000-01-01T00:00:10Z").UnixNano()),
fmt.Sprintf(`intoverlap,region=us-west value=100 %d`, mustParseTime(time.RFC3339Nano, "2000-01-01T00:00:00Z").UnixNano()),
fmt.Sprintf(`intoverlap,region=us-east otherVal=20 %d`, mustParseTime(time.RFC3339Nano, "2000-01-01T00:00:03Z").UnixNano()),
fmt.Sprintf(`floatsingle value=45.0 %d`, mustParseTime(time.RFC3339Nano, "2000-01-01T00:00:00Z").UnixNano()),
fmt.Sprintf(`floatmax value=%s %d`, maxFloat64(), mustParseTime(time.RFC3339Nano, "2000-01-01T00:00:00Z").UnixNano()),
fmt.Sprintf(`floatmax value=%s %d`, maxFloat64(), mustParseTime(time.RFC3339Nano, "2000-01-01T01:00:00Z").UnixNano()),
fmt.Sprintf(`floatmany,host=server01 value=2.0 %d`, mustParseTime(time.RFC3339Nano, "2000-01-01T00:00:00Z").UnixNano()),
fmt.Sprintf(`floatmany,host=server02 value=4.0 %d`, mustParseTime(time.RFC3339Nano, "2000-01-01T00:00:10Z").UnixNano()),
fmt.Sprintf(`floatmany,host=server03 value=4.0 %d`, mustParseTime(time.RFC3339Nano, "2000-01-01T00:00:20Z").UnixNano()),
fmt.Sprintf(`floatmany,host=server04 value=4.0 %d`, mustParseTime(time.RFC3339Nano, "2000-01-01T00:00:30Z").UnixNano()),
fmt.Sprintf(`floatmany,host=server05 value=5.0 %d`, mustParseTime(time.RFC3339Nano, "2000-01-01T00:00:40Z").UnixNano()),
fmt.Sprintf(`floatmany,host=server06 value=5.0 %d`, mustParseTime(time.RFC3339Nano, "2000-01-01T00:00:50Z").UnixNano()),
fmt.Sprintf(`floatmany,host=server07 value=7.0 %d`, mustParseTime(time.RFC3339Nano, "2000-01-01T00:01:00Z").UnixNano()),
fmt.Sprintf(`floatmany,host=server08 value=9.0 %d`, mustParseTime(time.RFC3339Nano, "2000-01-01T00:01:10Z").UnixNano()),
fmt.Sprintf(`floatoverlap,region=us-east value=20.0 %d`, mustParseTime(time.RFC3339Nano, "2000-01-01T00:00:00Z").UnixNano()),
fmt.Sprintf(`floatoverlap,region=us-east value=30.0 %d`, mustParseTime(time.RFC3339Nano, "2000-01-01T00:00:10Z").UnixNano()),
fmt.Sprintf(`floatoverlap,region=us-west value=100.0 %d`, mustParseTime(time.RFC3339Nano, "2000-01-01T00:00:00Z").UnixNano()),
fmt.Sprintf(`floatoverlap,region=us-east otherVal=20.0 %d`, mustParseTime(time.RFC3339Nano, "2000-01-01T00:00:03Z").UnixNano()),
fmt.Sprintf(`load,region=us-east,host=serverA value=20.0 %d`, mustParseTime(time.RFC3339Nano, "2000-01-01T00:00:00Z").UnixNano()),
fmt.Sprintf(`load,region=us-east,host=serverB value=30.0 %d`, mustParseTime(time.RFC3339Nano, "2000-01-01T00:00:10Z").UnixNano()),
fmt.Sprintf(`load,region=us-west,host=serverC value=100.0 %d`, mustParseTime(time.RFC3339Nano, "2000-01-01T00:00:00Z").UnixNano()),
fmt.Sprintf(`cpu,region=uk,host=serverZ,service=redis value=20.0 %d`, mustParseTime(time.RFC3339Nano, "2000-01-01T00:00:03Z").UnixNano()),
fmt.Sprintf(`cpu,region=uk,host=serverZ,service=mysql value=30.0 %d`, mustParseTime(time.RFC3339Nano, "2000-01-01T00:00:03Z").UnixNano()),
fmt.Sprintf(`stringdata value="first" %d`, mustParseTime(time.RFC3339Nano, "2000-01-01T00:00:03Z").UnixNano()),
fmt.Sprintf(`stringdata value="last" %d`, mustParseTime(time.RFC3339Nano, "2000-01-01T00:00:04Z").UnixNano()),
}
test := NewTest("db0", "rp0")
test.write = strings.Join(writes, "\n")
//FIXME add all of the int style tests once it is fixed.
test.addQueries([]*Query{
// int64
&Query{
name: "stddev with just one point - int",
params: url.Values{"db": []string{"db0"}},
command: `SELECT STDDEV(value) FROM int`,
exp: `{"results":[{"series":[{"name":"int","columns":["time","stddev"],"values":[["1970-01-01T00:00:00Z",null]]}]}]}`,
},
&Query{
name: "large mean and stddev - int",
params: url.Values{"db": []string{"db0"}},
command: `SELECT MEAN(value), STDDEV(value) FROM intmax`,
exp: `{"results":[{"series":[{"name":"intmax","columns":["time","mean","stddev"],"values":[["1970-01-01T00:00:00Z",` + maxInt64() + `,0]]}]}]}`,
},
&Query{
name: "mean and stddev - int",
params: url.Values{"db": []string{"db0"}},
command: `SELECT MEAN(value), STDDEV(value) FROM intmany WHERE time >= '2000-01-01' AND time < '2000-01-01T00:02:00Z' GROUP BY time(10m)`,
exp: `{"results":[{"series":[{"name":"intmany","columns":["time","mean","stddev"],"values":[["2000-01-01T00:00:00Z",5,2.138089935299395]]}]}]}`,
},
&Query{
name: "first - int",
params: url.Values{"db": []string{"db0"}},
command: `SELECT FIRST(value) FROM intmany`,
exp: `{"results":[{"series":[{"name":"intmany","columns":["time","first"],"values":[["1970-01-01T00:00:00Z",2]]}]}]}`,
},
&Query{
name: "last - int",
params: url.Values{"db": []string{"db0"}},
command: `SELECT LAST(value) FROM intmany`,
exp: `{"results":[{"series":[{"name":"intmany","columns":["time","last"],"values":[["1970-01-01T00:00:00Z",9]]}]}]}`,
},
&Query{
name: "spread - int",
params: url.Values{"db": []string{"db0"}},
command: `SELECT SPREAD(value) FROM intmany`,
exp: `{"results":[{"series":[{"name":"intmany","columns":["time","spread"],"values":[["1970-01-01T00:00:00Z",7]]}]}]}`,
},
&Query{
name: "median - even count - int",
params: url.Values{"db": []string{"db0"}},
command: `SELECT MEDIAN(value) FROM intmany`,
exp: `{"results":[{"series":[{"name":"intmany","columns":["time","median"],"values":[["1970-01-01T00:00:00Z",4.5]]}]}]}`,
},
&Query{
name: "median - odd count - int",
params: url.Values{"db": []string{"db0"}},
command: `SELECT MEDIAN(value) FROM intmany where time < '2000-01-01T00:01:10Z'`,
exp: `{"results":[{"series":[{"name":"intmany","columns":["time","median"],"values":[["1970-01-01T00:00:00Z",4]]}]}]}`,
},
&Query{
name: "distinct as call - int",
params: url.Values{"db": []string{"db0"}},
command: `SELECT DISTINCT(value) FROM intmany`,
exp: `{"results":[{"series":[{"name":"intmany","columns":["time","distinct"],"values":[["1970-01-01T00:00:00Z",[2,4,5,7,9]]]}]}]}`,
},
&Query{
name: "distinct alt syntax - int",
params: url.Values{"db": []string{"db0"}},
command: `SELECT DISTINCT value FROM intmany`,
exp: `{"results":[{"series":[{"name":"intmany","columns":["time","distinct"],"values":[["1970-01-01T00:00:00Z",[2,4,5,7,9]]]}]}]}`,
},
&Query{
name: "distinct select tag - int",
params: url.Values{"db": []string{"db0"}},
command: `SELECT DISTINCT(host) FROM intmany`,
exp: `{"results":[{}]}`,
},
&Query{
name: "distinct alt select tag - int",
params: url.Values{"db": []string{"db0"}},
command: `SELECT DISTINCT host FROM intmany`,
exp: `{"results":[{}]}`,
},
&Query{
name: "count distinct - int",
params: url.Values{"db": []string{"db0"}},
command: `SELECT COUNT(DISTINCT value) FROM intmany`,
exp: `{"results":[{"series":[{"name":"intmany","columns":["time","count"],"values":[["1970-01-01T00:00:00Z",5]]}]}]}`,
},
&Query{
name: "count distinct as call - int",
params: url.Values{"db": []string{"db0"}},
command: `SELECT COUNT(DISTINCT(value)) FROM intmany`,
exp: `{"results":[{"series":[{"name":"intmany","columns":["time","count"],"values":[["1970-01-01T00:00:00Z",5]]}]}]}`,
},
&Query{
name: "count distinct select tag - int",
params: url.Values{"db": []string{"db0"}},
command: `SELECT COUNT(DISTINCT host) FROM intmany`,
exp: `{"results":[{"series":[{"name":"intmany","columns":["time","count"],"values":[["1970-01-01T00:00:00Z",0]]}]}]}`,
},
&Query{
name: "count distinct as call select tag - int",
params: url.Values{"db": []string{"db0"}},
command: `SELECT COUNT(DISTINCT host) FROM intmany`,
exp: `{"results":[{"series":[{"name":"intmany","columns":["time","count"],"values":[["1970-01-01T00:00:00Z",0]]}]}]}`,
},
&Query{
name: "aggregation with no interval - int",
params: url.Values{"db": []string{"db0"}},
command: `SELECT count(value) FROM intoverlap WHERE time = '2000-01-01 00:00:00'`,
exp: `{"results":[{"series":[{"name":"intoverlap","columns":["time","count"],"values":[["2000-01-01T00:00:00Z",2]]}]}]}`,
},
&Query{
name: "sum - int",
params: url.Values{"db": []string{"db0"}},
command: `SELECT SUM(value) FROM intoverlap WHERE time >= '2000-01-01 00:00:05' AND time <= '2000-01-01T00:00:10Z' GROUP BY time(10s), region`,
exp: `{"results":[{"series":[{"name":"intoverlap","tags":{"region":"us-east"},"columns":["time","sum"],"values":[["2000-01-01T00:00:00Z",null],["2000-01-01T00:00:10Z",30]]}]}]}`,
},
&Query{
name: "aggregation with a null field value - int",
params: url.Values{"db": []string{"db0"}},
command: `SELECT SUM(value) FROM intoverlap GROUP BY region`,
exp: `{"results":[{"series":[{"name":"intoverlap","tags":{"region":"us-east"},"columns":["time","sum"],"values":[["1970-01-01T00:00:00Z",50]]},{"name":"intoverlap","tags":{"region":"us-west"},"columns":["time","sum"],"values":[["1970-01-01T00:00:00Z",100]]}]}]}`,
},
&Query{
name: "multiple aggregations - int",
params: url.Values{"db": []string{"db0"}},
command: `SELECT SUM(value), MEAN(value) FROM intoverlap GROUP BY region`,
exp: `{"results":[{"series":[{"name":"intoverlap","tags":{"region":"us-east"},"columns":["time","sum","mean"],"values":[["1970-01-01T00:00:00Z",50,25]]},{"name":"intoverlap","tags":{"region":"us-west"},"columns":["time","sum","mean"],"values":[["1970-01-01T00:00:00Z",100,100]]}]}]}`,
},
&Query{
skip: true,
name: "multiple aggregations with division - int FIXME issue #2879",
params: url.Values{"db": []string{"db0"}},
command: `SELECT sum(value), mean(value), sum(value) / mean(value) as div FROM intoverlap GROUP BY region`,
exp: `{"results":[{"series":[{"name":"intoverlap","tags":{"region":"us-east"},"columns":["time","sum","mean","div"],"values":[["1970-01-01T00:00:00Z",50,25,2]]},{"name":"intoverlap","tags":{"region":"us-west"},"columns":["time","div"],"values":[["1970-01-01T00:00:00Z",100,100,1]]}]}]}`,
},
// float64
&Query{
name: "stddev with just one point - float",
params: url.Values{"db": []string{"db0"}},
command: `SELECT STDDEV(value) FROM floatsingle`,
exp: `{"results":[{"series":[{"name":"floatsingle","columns":["time","stddev"],"values":[["1970-01-01T00:00:00Z",null]]}]}]}`,
},
&Query{
name: "large mean and stddev - float",
params: url.Values{"db": []string{"db0"}},
command: `SELECT MEAN(value), STDDEV(value) FROM floatmax`,
exp: `{"results":[{"series":[{"name":"floatmax","columns":["time","mean","stddev"],"values":[["1970-01-01T00:00:00Z",` + maxFloat64() + `,0]]}]}]}`,
},
&Query{
name: "mean and stddev - float",
params: url.Values{"db": []string{"db0"}},
command: `SELECT MEAN(value), STDDEV(value) FROM floatmany WHERE time >= '2000-01-01' AND time < '2000-01-01T00:02:00Z' GROUP BY time(10m)`,
exp: `{"results":[{"series":[{"name":"floatmany","columns":["time","mean","stddev"],"values":[["2000-01-01T00:00:00Z",5,2.138089935299395]]}]}]}`,
},
&Query{
name: "first - float",
params: url.Values{"db": []string{"db0"}},
command: `SELECT FIRST(value) FROM floatmany`,
exp: `{"results":[{"series":[{"name":"floatmany","columns":["time","first"],"values":[["1970-01-01T00:00:00Z",2]]}]}]}`,
},
&Query{
name: "last - float",
params: url.Values{"db": []string{"db0"}},
command: `SELECT LAST(value) FROM floatmany`,
exp: `{"results":[{"series":[{"name":"floatmany","columns":["time","last"],"values":[["1970-01-01T00:00:00Z",9]]}]}]}`,
},
&Query{
name: "spread - float",
params: url.Values{"db": []string{"db0"}},
command: `SELECT SPREAD(value) FROM floatmany`,
exp: `{"results":[{"series":[{"name":"floatmany","columns":["time","spread"],"values":[["1970-01-01T00:00:00Z",7]]}]}]}`,
},
&Query{
name: "median - even count - float",
params: url.Values{"db": []string{"db0"}},
command: `SELECT MEDIAN(value) FROM floatmany`,
exp: `{"results":[{"series":[{"name":"floatmany","columns":["time","median"],"values":[["1970-01-01T00:00:00Z",4.5]]}]}]}`,
},
&Query{
name: "median - odd count - float",
params: url.Values{"db": []string{"db0"}},
command: `SELECT MEDIAN(value) FROM floatmany where time < '2000-01-01T00:01:10Z'`,
exp: `{"results":[{"series":[{"name":"floatmany","columns":["time","median"],"values":[["1970-01-01T00:00:00Z",4]]}]}]}`,
},
&Query{
name: "distinct as call - float",
params: url.Values{"db": []string{"db0"}},
command: `SELECT DISTINCT(value) FROM floatmany`,
exp: `{"results":[{"series":[{"name":"floatmany","columns":["time","distinct"],"values":[["1970-01-01T00:00:00Z",[2,4,5,7,9]]]}]}]}`,
},
&Query{
name: "distinct alt syntax - float",
params: url.Values{"db": []string{"db0"}},
command: `SELECT DISTINCT value FROM floatmany`,
exp: `{"results":[{"series":[{"name":"floatmany","columns":["time","distinct"],"values":[["1970-01-01T00:00:00Z",[2,4,5,7,9]]]}]}]}`,
},
&Query{
name: "distinct select tag - float",
params: url.Values{"db": []string{"db0"}},
command: `SELECT DISTINCT(host) FROM floatmany`,
exp: `{"results":[{}]}`,
},
&Query{
name: "distinct alt select tag - float",
params: url.Values{"db": []string{"db0"}},
command: `SELECT DISTINCT host FROM floatmany`,
exp: `{"results":[{}]}`,
},
&Query{
name: "count distinct - float",
params: url.Values{"db": []string{"db0"}},
command: `SELECT COUNT(DISTINCT value) FROM floatmany`,
exp: `{"results":[{"series":[{"name":"floatmany","columns":["time","count"],"values":[["1970-01-01T00:00:00Z",5]]}]}]}`,
},
&Query{
name: "count distinct as call - float",
params: url.Values{"db": []string{"db0"}},
command: `SELECT COUNT(DISTINCT(value)) FROM floatmany`,
exp: `{"results":[{"series":[{"name":"floatmany","columns":["time","count"],"values":[["1970-01-01T00:00:00Z",5]]}]}]}`,
},
&Query{
name: "count distinct select tag - float",
params: url.Values{"db": []string{"db0"}},
command: `SELECT COUNT(DISTINCT host) FROM floatmany`,
exp: `{"results":[{"series":[{"name":"floatmany","columns":["time","count"],"values":[["1970-01-01T00:00:00Z",0]]}]}]}`,
},
&Query{
name: "count distinct as call select tag - float",
params: url.Values{"db": []string{"db0"}},
command: `SELECT COUNT(DISTINCT host) FROM floatmany`,
exp: `{"results":[{"series":[{"name":"floatmany","columns":["time","count"],"values":[["1970-01-01T00:00:00Z",0]]}]}]}`,
},
&Query{
name: "aggregation with no interval - float",
params: url.Values{"db": []string{"db0"}},
command: `SELECT count(value) FROM floatoverlap WHERE time = '2000-01-01 00:00:00'`,
exp: `{"results":[{"series":[{"name":"floatoverlap","columns":["time","count"],"values":[["2000-01-01T00:00:00Z",2]]}]}]}`,
},
&Query{
name: "sum - float",
params: url.Values{"db": []string{"db0"}},
command: `SELECT SUM(value) FROM floatoverlap WHERE time >= '2000-01-01 00:00:05' AND time <= '2000-01-01T00:00:10Z' GROUP BY time(10s), region`,
exp: `{"results":[{"series":[{"name":"floatoverlap","tags":{"region":"us-east"},"columns":["time","sum"],"values":[["2000-01-01T00:00:00Z",null],["2000-01-01T00:00:10Z",30]]}]}]}`,
},
&Query{
name: "aggregation with a null field value - float",
params: url.Values{"db": []string{"db0"}},
command: `SELECT SUM(value) FROM floatoverlap GROUP BY region`,
exp: `{"results":[{"series":[{"name":"floatoverlap","tags":{"region":"us-east"},"columns":["time","sum"],"values":[["1970-01-01T00:00:00Z",50]]},{"name":"floatoverlap","tags":{"region":"us-west"},"columns":["time","sum"],"values":[["1970-01-01T00:00:00Z",100]]}]}]}`,
},
&Query{
name: "multiple aggregations - float",
params: url.Values{"db": []string{"db0"}},
command: `SELECT SUM(value), MEAN(value) FROM floatoverlap GROUP BY region`,
exp: `{"results":[{"series":[{"name":"floatoverlap","tags":{"region":"us-east"},"columns":["time","sum","mean"],"values":[["1970-01-01T00:00:00Z",50,25]]},{"name":"floatoverlap","tags":{"region":"us-west"},"columns":["time","sum","mean"],"values":[["1970-01-01T00:00:00Z",100,100]]}]}]}`,
},
&Query{
name: "multiple aggregations with division - float",
params: url.Values{"db": []string{"db0"}},
command: `SELECT sum(value) / mean(value) as div FROM floatoverlap GROUP BY region`,
exp: `{"results":[{"series":[{"name":"floatoverlap","tags":{"region":"us-east"},"columns":["time","div"],"values":[["1970-01-01T00:00:00Z",2]]},{"name":"floatoverlap","tags":{"region":"us-west"},"columns":["time","div"],"values":[["1970-01-01T00:00:00Z",1]]}]}]}`,
},
// strings
&Query{
name: "STDDEV on string data - string",
params: url.Values{"db": []string{"db0"}},
command: `SELECT STDDEV(value) FROM stringdata`,
exp: `{"results":[{"series":[{"name":"stringdata","columns":["time","stddev"],"values":[["1970-01-01T00:00:00Z",null]]}]}]}`,
},
&Query{
name: "MEAN on string data - string",
params: url.Values{"db": []string{"db0"}},
command: `SELECT MEAN(value) FROM stringdata`,
exp: `{"results":[{"series":[{"name":"stringdata","columns":["time","mean"],"values":[["1970-01-01T00:00:00Z",0]]}]}]}`,
},
&Query{
name: "MEDIAN on string data - string",
params: url.Values{"db": []string{"db0"}},
command: `SELECT MEDIAN(value) FROM stringdata`,
exp: `{"results":[{"series":[{"name":"stringdata","columns":["time","median"],"values":[["1970-01-01T00:00:00Z",null]]}]}]}`,
},
&Query{
name: "COUNT on string data - string",
params: url.Values{"db": []string{"db0"}},
command: `SELECT COUNT(value) FROM stringdata`,
exp: `{"results":[{"series":[{"name":"stringdata","columns":["time","count"],"values":[["1970-01-01T00:00:00Z",2]]}]}]}`,
},
&Query{
name: "FIRST on string data - string",
params: url.Values{"db": []string{"db0"}},
command: `SELECT FIRST(value) FROM stringdata`,
exp: `{"results":[{"series":[{"name":"stringdata","columns":["time","first"],"values":[["1970-01-01T00:00:00Z","first"]]}]}]}`,
},
&Query{
name: "LAST on string data - string",
params: url.Values{"db": []string{"db0"}},
command: `SELECT LAST(value) FROM stringdata`,
exp: `{"results":[{"series":[{"name":"stringdata","columns":["time","last"],"values":[["1970-01-01T00:00:00Z","last"]]}]}]}`,
},
// general queries
&Query{
name: "group by multiple dimensions",
params: url.Values{"db": []string{"db0"}},
command: `SELECT sum(value) FROM load GROUP BY region, host`,
exp: `{"results":[{"series":[{"name":"load","tags":{"host":"serverA","region":"us-east"},"columns":["time","sum"],"values":[["1970-01-01T00:00:00Z",20]]},{"name":"load","tags":{"host":"serverB","region":"us-east"},"columns":["time","sum"],"values":[["1970-01-01T00:00:00Z",30]]},{"name":"load","tags":{"host":"serverC","region":"us-west"},"columns":["time","sum"],"values":[["1970-01-01T00:00:00Z",100]]}]}]}`,
},
&Query{
name: "aggregation with WHERE and AND",
params: url.Values{"db": []string{"db0"}},
command: `SELECT sum(value) FROM cpu WHERE region='uk' AND host='serverZ'`,
exp: `{"results":[{"series":[{"name":"cpu","columns":["time","sum"],"values":[["1970-01-01T00:00:00Z",50]]}]}]}`,
},
// Mathematics
&Query{
name: "group by multiple dimensions",
params: url.Values{"db": []string{"db0"}},
command: `SELECT sum(value)*2 FROM load`,
exp: `{"results":[{"series":[{"name":"load","columns":["time",""],"values":[["1970-01-01T00:00:00Z",300]]}]}]}`,
},
&Query{
name: "group by multiple dimensions",
params: url.Values{"db": []string{"db0"}},
command: `SELECT sum(value)/2 FROM load`,
exp: `{"results":[{"series":[{"name":"load","columns":["time",""],"values":[["1970-01-01T00:00:00Z",75]]}]}]}`,
},
}...)
for i, query := range test.queries {
if i == 0 {
if err := test.init(s); err != nil {
t.Fatalf("test init failed: %s", err)
}
}
if query.skip {
t.Logf("SKIP:: %s", query.name)
continue
}
if err := query.Execute(s); err != nil {
t.Error(query.Error(err))
} else if !query.success() {
t.Error(query.failureMessage())
}
}
}
func TestServer_Write_Precision(t *testing.T) {
t.Parallel()
s := OpenServer(NewConfig(), "")
defer s.Close()
if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 0)); err != nil {
t.Fatal(err)
}
if err := s.MetaStore.SetDefaultRetentionPolicy("db0", "rp0"); err != nil {
t.Fatal(err)
}
writes := []struct {
write string
params url.Values
}{
{
write: fmt.Sprintf("cpu_n0_precision value=1 %d", mustParseTime(time.RFC3339Nano, "2000-01-01T12:34:56.789012345Z").UnixNano()),
},
{
write: fmt.Sprintf("cpu_n1_precision value=1.1 %d", mustParseTime(time.RFC3339Nano, "2000-01-01T12:34:56.789012345Z").UnixNano()),
params: url.Values{"precision": []string{"n"}},
},
{
write: fmt.Sprintf("cpu_u_precision value=100 %d", mustParseTime(time.RFC3339Nano, "2000-01-01T12:34:56.789012345Z").Truncate(time.Microsecond).UnixNano()/int64(time.Microsecond)),
params: url.Values{"precision": []string{"u"}},
},
{
write: fmt.Sprintf("cpu_ms_precision value=200 %d", mustParseTime(time.RFC3339Nano, "2000-01-01T12:34:56.789012345Z").Truncate(time.Millisecond).UnixNano()/int64(time.Millisecond)),
params: url.Values{"precision": []string{"ms"}},
},
{
write: fmt.Sprintf("cpu_s_precision value=300 %d", mustParseTime(time.RFC3339Nano, "2000-01-01T12:34:56.789012345Z").Truncate(time.Second).UnixNano()/int64(time.Second)),
params: url.Values{"precision": []string{"s"}},
},
{
write: fmt.Sprintf("cpu_m_precision value=400 %d", mustParseTime(time.RFC3339Nano, "2000-01-01T12:34:56.789012345Z").Truncate(time.Minute).UnixNano()/int64(time.Minute)),
params: url.Values{"precision": []string{"m"}},
},
{
write: fmt.Sprintf("cpu_h_precision value=500 %d", mustParseTime(time.RFC3339Nano, "2000-01-01T12:34:56.789012345Z").Truncate(time.Hour).UnixNano()/int64(time.Hour)),
params: url.Values{"precision": []string{"h"}},
},
}
test := NewTest("db0", "rp0")
test.addQueries([]*Query{
&Query{
name: "point with nanosecond precision time - no precision specified on write",
command: `SELECT * FROM cpu_n0_precision`,
params: url.Values{"db": []string{"db0"}},
exp: `{"results":[{"series":[{"name":"cpu_n0_precision","columns":["time","value"],"values":[["2000-01-01T12:34:56.789012345Z",1]]}]}]}`,
},
&Query{
name: "point with nanosecond precision time",
command: `SELECT * FROM cpu_n1_precision`,
params: url.Values{"db": []string{"db0"}},
exp: `{"results":[{"series":[{"name":"cpu_n1_precision","columns":["time","value"],"values":[["2000-01-01T12:34:56.789012345Z",1.1]]}]}]}`,
},
&Query{
name: "point with microsecond precision time",
command: `SELECT * FROM cpu_u_precision`,
params: url.Values{"db": []string{"db0"}},
exp: `{"results":[{"series":[{"name":"cpu_u_precision","columns":["time","value"],"values":[["2000-01-01T12:34:56.789012Z",100]]}]}]}`,
},
&Query{
name: "point with millisecond precision time",
command: `SELECT * FROM cpu_ms_precision`,
params: url.Values{"db": []string{"db0"}},
exp: `{"results":[{"series":[{"name":"cpu_ms_precision","columns":["time","value"],"values":[["2000-01-01T12:34:56.789Z",200]]}]}]}`,
},
&Query{
name: "point with second precision time",
command: `SELECT * FROM cpu_s_precision`,
params: url.Values{"db": []string{"db0"}},
exp: `{"results":[{"series":[{"name":"cpu_s_precision","columns":["time","value"],"values":[["2000-01-01T12:34:56Z",300]]}]}]}`,
},
&Query{
name: "point with minute precision time",
command: `SELECT * FROM cpu_m_precision`,
params: url.Values{"db": []string{"db0"}},
exp: `{"results":[{"series":[{"name":"cpu_m_precision","columns":["time","value"],"values":[["2000-01-01T12:34:00Z",400]]}]}]}`,
},
&Query{
name: "point with hour precision time",
command: `SELECT * FROM cpu_h_precision`,
params: url.Values{"db": []string{"db0"}},
exp: `{"results":[{"series":[{"name":"cpu_h_precision","columns":["time","value"],"values":[["2000-01-01T12:00:00Z",500]]}]}]}`,
},
}...)
// we are doing writes that require parameter changes, so we are fighting the test harness a little to make this happen properly
for _, w := range writes {
test.write = w.write
test.params = w.params
test.initialized = false
if err := test.init(s); err != nil {
t.Fatalf("test init failed: %s", err)
}
}
for _, query := range test.queries {
if query.skip {
t.Logf("SKIP:: %s", query.name)
continue
}
if err := query.Execute(s); err != nil {
t.Error(query.Error(err))
} else if !query.success() {
t.Error(query.failureMessage())
}
}
}
func TestServer_Query_Wildcards(t *testing.T) {
t.Parallel()
s := OpenServer(NewConfig(), "")
defer s.Close()
if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 0)); err != nil {
t.Fatal(err)
}
if err := s.MetaStore.SetDefaultRetentionPolicy("db0", "rp0"); err != nil {
t.Fatal(err)
}
writes := []string{
fmt.Sprintf(`wildcard,region=us-east value=10 %d`, mustParseTime(time.RFC3339Nano, "2000-01-01T00:00:00Z").UnixNano()),
fmt.Sprintf(`wildcard,region=us-east valx=20 %d`, mustParseTime(time.RFC3339Nano, "2000-01-01T00:00:10Z").UnixNano()),
fmt.Sprintf(`wildcard,region=us-east value=30,valx=40 %d`, mustParseTime(time.RFC3339Nano, "2000-01-01T00:00:20Z").UnixNano()),
fmt.Sprintf(`wgroup,region=us-east value=10.0 %d`, mustParseTime(time.RFC3339Nano, "2000-01-01T00:00:00Z").UnixNano()),
fmt.Sprintf(`wgroup,region=us-east value=20.0 %d`, mustParseTime(time.RFC3339Nano, "2000-01-01T00:00:10Z").UnixNano()),
fmt.Sprintf(`wgroup,region=us-west value=30.0 %d`, mustParseTime(time.RFC3339Nano, "2000-01-01T00:00:20Z").UnixNano()),
}
test := NewTest("db0", "rp0")
test.write = strings.Join(writes, "\n")
test.addQueries([]*Query{
&Query{
name: "wildcard",
params: url.Values{"db": []string{"db0"}},
command: `SELECT * FROM wildcard`,
exp: `{"results":[{"series":[{"name":"wildcard","tags":{"region":"us-east"},"columns":["time","value","valx"],"values":[["2000-01-01T00:00:00Z",10,null],["2000-01-01T00:00:10Z",null,20],["2000-01-01T00:00:20Z",30,40]]}]}]}`,
},
&Query{
name: "GROUP BY queries",
params: url.Values{"db": []string{"db0"}},
command: `SELECT mean(value) FROM wgroup GROUP BY *`,
exp: `{"results":[{"series":[{"name":"wgroup","tags":{"region":"us-east"},"columns":["time","mean"],"values":[["1970-01-01T00:00:00Z",15]]},{"name":"wgroup","tags":{"region":"us-west"},"columns":["time","mean"],"values":[["1970-01-01T00:00:00Z",30]]}]}]}`,
},
&Query{
name: "GROUP BY queries with time",
params: url.Values{"db": []string{"db0"}},
command: `SELECT mean(value) FROM wgroup WHERE time >= '2000-01-01T00:00:00Z' AND time < '2000-01-01T00:01:00Z' GROUP BY *,TIME(1m)`,
exp: `{"results":[{"series":[{"name":"wgroup","tags":{"region":"us-east"},"columns":["time","mean"],"values":[["2000-01-01T00:00:00Z",15]]},{"name":"wgroup","tags":{"region":"us-west"},"columns":["time","mean"],"values":[["2000-01-01T00:00:00Z",30]]}]}]}`,
},
}...)
for i, query := range test.queries {
if i == 0 {
if err := test.init(s); err != nil {
t.Fatalf("test init failed: %s", err)
}
}
if query.skip {
t.Logf("SKIP:: %s", query.name)
continue
}
if err := query.Execute(s); err != nil {
t.Error(query.Error(err))
} else if !query.success() {
t.Error(query.failureMessage())
}
}
}
func TestServer_Query_AcrossShardsAndFields(t *testing.T) {
t.Parallel()
s := OpenServer(NewConfig(), "")
defer s.Close()
if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 0)); err != nil {
t.Fatal(err)
}
if err := s.MetaStore.SetDefaultRetentionPolicy("db0", "rp0"); err != nil {
t.Fatal(err)
}
writes := []string{
fmt.Sprintf(`cpu load=100 %d`, mustParseTime(time.RFC3339Nano, "2000-01-01T00:00:00Z").UnixNano()),
fmt.Sprintf(`cpu load=200 %d`, mustParseTime(time.RFC3339Nano, "2010-01-01T00:00:00Z").UnixNano()),
fmt.Sprintf(`cpu core=4 %d`, mustParseTime(time.RFC3339Nano, "2015-01-01T00:00:00Z").UnixNano()),
}
test := NewTest("db0", "rp0")
test.write = strings.Join(writes, "\n")
test.addQueries([]*Query{
&Query{
name: "two results for cpu",
params: url.Values{"db": []string{"db0"}},
command: `SELECT load FROM cpu`,
exp: `{"results":[{"series":[{"name":"cpu","columns":["time","load"],"values":[["2000-01-01T00:00:00Z",100],["2010-01-01T00:00:00Z",200]]}]}]}`,
},
&Query{
name: "two results for cpu, multi-select",
params: url.Values{"db": []string{"db0"}},
command: `SELECT core,load FROM cpu`,
exp: `{"results":[{"series":[{"name":"cpu","columns":["time","core","load"],"values":[["2000-01-01T00:00:00Z",null,100],["2010-01-01T00:00:00Z",null,200],["2015-01-01T00:00:00Z",4,null]]}]}]}`,
},
&Query{
name: "two results for cpu, wildcard select",
params: url.Values{"db": []string{"db0"}},
command: `SELECT * FROM cpu`,
exp: `{"results":[{"series":[{"name":"cpu","columns":["time","core","load"],"values":[["2000-01-01T00:00:00Z",null,100],["2010-01-01T00:00:00Z",null,200],["2015-01-01T00:00:00Z",4,null]]}]}]}`,
},
&Query{
name: "one result for core",
params: url.Values{"db": []string{"db0"}},
command: `SELECT core FROM cpu`,
exp: `{"results":[{"series":[{"name":"cpu","columns":["time","core"],"values":[["2015-01-01T00:00:00Z",4]]}]}]}`,
},
&Query{
name: "empty result set from non-existent field",
params: url.Values{"db": []string{"db0"}},
command: `SELECT foo FROM cpu`,
exp: `{"results":[{}]}`,
},
}...)
for i, query := range test.queries {
if i == 0 {
if err := test.init(s); err != nil {
t.Fatalf("test init failed: %s", err)
}
}
if query.skip {
t.Logf("SKIP:: %s", query.name)
continue
}
if err := query.Execute(s); err != nil {
t.Error(query.Error(err))
} else if !query.success() {
t.Error(query.failureMessage())
}
}
}
func TestServer_Query_Where_Fields(t *testing.T) {
t.Parallel()
s := OpenServer(NewConfig(), "")
defer s.Close()
if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 0)); err != nil {
t.Fatal(err)
}
if err := s.MetaStore.SetDefaultRetentionPolicy("db0", "rp0"); err != nil {
t.Fatal(err)
}
writes := []string{
fmt.Sprintf(`cpu alert_id="alert",tenant_id="tenant",_cust="johnson brothers" %d`, mustParseTime(time.RFC3339Nano, "2015-02-28T01:03:36.703820946Z").UnixNano()),
fmt.Sprintf(`cpu alert_id="alert",tenant_id="tenant",_cust="johnson brothers" %d`, mustParseTime(time.RFC3339Nano, "2015-02-28T01:03:36.703820946Z").UnixNano()),
fmt.Sprintf(`cpu load=100.0,core=4 %d`, mustParseTime(time.RFC3339Nano, "2009-11-10T23:00:02Z").UnixNano()),
fmt.Sprintf(`cpu load=80.0,core=2 %d`, mustParseTime(time.RFC3339Nano, "2009-11-10T23:01:02Z").UnixNano()),
fmt.Sprintf(`clicks local=true %d`, mustParseTime(time.RFC3339Nano, "2014-11-10T23:00:01Z").UnixNano()),
fmt.Sprintf(`clicks local=false %d`, mustParseTime(time.RFC3339Nano, "2014-11-10T23:00:02Z").UnixNano()),
}
test := NewTest("db0", "rp0")
test.write = strings.Join(writes, "\n")
test.addQueries([]*Query{
// non type specific
&Query{
name: "missing measurement with group by",
params: url.Values{"db": []string{"db0"}},
command: `SELECT load from missing group by *`,
exp: `{"results":[{}]}`,
},
// string
&Query{
name: "single string field",
params: url.Values{"db": []string{"db0"}},
command: `SELECT alert_id FROM cpu WHERE alert_id='alert'`,
exp: `{"results":[{"series":[{"name":"cpu","columns":["time","alert_id"],"values":[["2015-02-28T01:03:36.703820946Z","alert"]]}]}]}`,
},
&Query{
name: "string AND query, all fields in SELECT",
params: url.Values{"db": []string{"db0"}},
command: `SELECT alert_id,tenant_id,_cust FROM cpu WHERE alert_id='alert' AND tenant_id='tenant'`,
exp: `{"results":[{"series":[{"name":"cpu","columns":["time","alert_id","tenant_id","_cust"],"values":[["2015-02-28T01:03:36.703820946Z","alert","tenant","johnson brothers"]]}]}]}`,
},
&Query{
name: "string AND query, all fields in SELECT, one in parenthesis",
params: url.Values{"db": []string{"db0"}},
command: `SELECT alert_id,tenant_id FROM cpu WHERE alert_id='alert' AND (tenant_id='tenant')`,
exp: `{"results":[{"series":[{"name":"cpu","columns":["time","alert_id","tenant_id"],"values":[["2015-02-28T01:03:36.703820946Z","alert","tenant"]]}]}]}`,
},
&Query{
name: "string underscored field",
params: url.Values{"db": []string{"db0"}},
command: `SELECT alert_id FROM cpu WHERE _cust='johnson brothers'`,
exp: `{"results":[{"series":[{"name":"cpu","columns":["time","alert_id"],"values":[["2015-02-28T01:03:36.703820946Z","alert"]]}]}]}`,
},
&Query{
name: "string no match",
params: url.Values{"db": []string{"db0"}},
command: `SELECT alert_id FROM cpu WHERE _cust='acme'`,
exp: `{"results":[{}]}`,
},
// float64
&Query{
name: "float64 GT no match",
params: url.Values{"db": []string{"db0"}},
command: `select load from cpu where load > 100`,
exp: `{"results":[{}]}`,
},
&Query{
name: "float64 GTE match one",
params: url.Values{"db": []string{"db0"}},
command: `select load from cpu where load >= 100`,
exp: `{"results":[{"series":[{"name":"cpu","columns":["time","load"],"values":[["2009-11-10T23:00:02Z",100]]}]}]}`,
},
&Query{
name: "float64 EQ match upper bound",
params: url.Values{"db": []string{"db0"}},
command: `select load from cpu where load = 100`,
exp: `{"results":[{"series":[{"name":"cpu","columns":["time","load"],"values":[["2009-11-10T23:00:02Z",100]]}]}]}`,
},
&Query{
name: "float64 LTE match two",
params: url.Values{"db": []string{"db0"}},
command: `select load from cpu where load <= 100`,
exp: `{"results":[{"series":[{"name":"cpu","columns":["time","load"],"values":[["2009-11-10T23:00:02Z",100],["2009-11-10T23:01:02Z",80]]}]}]}`,
},
&Query{
name: "float64 GT match one",
params: url.Values{"db": []string{"db0"}},
command: `select load from cpu where load > 99`,
exp: `{"results":[{"series":[{"name":"cpu","columns":["time","load"],"values":[["2009-11-10T23:00:02Z",100]]}]}]}`,
},
&Query{
name: "float64 EQ no match",
params: url.Values{"db": []string{"db0"}},
command: `select load from cpu where load = 99`,
exp: `{"results":[{}]}`,
},
&Query{
name: "float64 LT match one",
params: url.Values{"db": []string{"db0"}},
command: `select load from cpu where load < 99`,
exp: `{"results":[{"series":[{"name":"cpu","columns":["time","load"],"values":[["2009-11-10T23:01:02Z",80]]}]}]}`,
},
&Query{
name: "float64 LT no match",
params: url.Values{"db": []string{"db0"}},
command: `select load from cpu where load < 80`,
exp: `{"results":[{}]}`,
},
&Query{
name: "float64 NE match one",
params: url.Values{"db": []string{"db0"}},
command: `select load from cpu where load != 100`,
exp: `{"results":[{"series":[{"name":"cpu","columns":["time","load"],"values":[["2009-11-10T23:01:02Z",80]]}]}]}`,
},
// int64
&Query{
name: "int64 GT no match",
params: url.Values{"db": []string{"db0"}},
command: `select core from cpu where core > 4`,
exp: `{"results":[{}]}`,
},
&Query{
name: "int64 GTE match one",
params: url.Values{"db": []string{"db0"}},
command: `select core from cpu where core >= 4`,
exp: `{"results":[{"series":[{"name":"cpu","columns":["time","core"],"values":[["2009-11-10T23:00:02Z",4]]}]}]}`,
},
&Query{
name: "int64 EQ match upper bound",
params: url.Values{"db": []string{"db0"}},
command: `select core from cpu where core = 4`,
exp: `{"results":[{"series":[{"name":"cpu","columns":["time","core"],"values":[["2009-11-10T23:00:02Z",4]]}]}]}`,
},
&Query{
name: "int64 LTE match two ",
params: url.Values{"db": []string{"db0"}},
command: `select core from cpu where core <= 4`,
exp: `{"results":[{"series":[{"name":"cpu","columns":["time","core"],"values":[["2009-11-10T23:00:02Z",4],["2009-11-10T23:01:02Z",2]]}]}]}`,
},
&Query{
name: "int64 GT match one",
params: url.Values{"db": []string{"db0"}},
command: `select core from cpu where core > 3`,
exp: `{"results":[{"series":[{"name":"cpu","columns":["time","core"],"values":[["2009-11-10T23:00:02Z",4]]}]}]}`,
},
&Query{
name: "int64 EQ no match",
params: url.Values{"db": []string{"db0"}},
command: `select core from cpu where core = 3`,
exp: `{"results":[{}]}`,
},
&Query{
name: "int64 LT match one",
params: url.Values{"db": []string{"db0"}},
command: `select core from cpu where core < 3`,
exp: `{"results":[{"series":[{"name":"cpu","columns":["time","core"],"values":[["2009-11-10T23:01:02Z",2]]}]}]}`,
},
&Query{
name: "int64 LT no match",
params: url.Values{"db": []string{"db0"}},
command: `select core from cpu where core < 2`,
exp: `{"results":[{}]}`,
},
&Query{
name: "int64 NE match one",
params: url.Values{"db": []string{"db0"}},
command: `select core from cpu where core != 4`,
exp: `{"results":[{"series":[{"name":"cpu","columns":["time","core"],"values":[["2009-11-10T23:01:02Z",2]]}]}]}`,
},
// bool
&Query{
name: "bool EQ match true",
params: url.Values{"db": []string{"db0"}},
command: `select local from clicks where local = true`,
exp: `{"results":[{"series":[{"name":"clicks","columns":["time","local"],"values":[["2014-11-10T23:00:01Z",true]]}]}]}`,
},
&Query{
name: "bool EQ match false",
params: url.Values{"db": []string{"db0"}},
command: `select local from clicks where local = false`,
exp: `{"results":[{"series":[{"name":"clicks","columns":["time","local"],"values":[["2014-11-10T23:00:02Z",false]]}]}]}`,
},
&Query{
name: "bool NE match one",
params: url.Values{"db": []string{"db0"}},
command: `select local from clicks where local != true`,
exp: `{"results":[{"series":[{"name":"clicks","columns":["time","local"],"values":[["2014-11-10T23:00:02Z",false]]}]}]}`,
},
}...)
for i, query := range test.queries {
if i == 0 {
if err := test.init(s); err != nil {
t.Fatalf("test init failed: %s", err)
}
}
if query.skip {
t.Logf("SKIP:: %s", query.name)
continue
}
if err := query.Execute(s); err != nil {
t.Error(query.Error(err))
} else if !query.success() {
t.Error(query.failureMessage())
}
}
}
func TestServer_Query_Where_With_Tags(t *testing.T) {
t.Parallel()
s := OpenServer(NewConfig(), "")
defer s.Close()
if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 0)); err != nil {
t.Fatal(err)
}
if err := s.MetaStore.SetDefaultRetentionPolicy("db0", "rp0"); err != nil {
t.Fatal(err)
}
writes := []string{
fmt.Sprintf(`where_events,tennant=paul foo="bar" %d`, mustParseTime(time.RFC3339Nano, "2009-11-10T23:00:02Z").UnixNano()),
fmt.Sprintf(`where_events,tennant=paul foo="baz" %d`, mustParseTime(time.RFC3339Nano, "2009-11-10T23:00:03Z").UnixNano()),
fmt.Sprintf(`where_events,tennant=paul foo="bat" %d`, mustParseTime(time.RFC3339Nano, "2009-11-10T23:00:04Z").UnixNano()),
fmt.Sprintf(`where_events,tennant=todd foo="bar" %d`, mustParseTime(time.RFC3339Nano, "2009-11-10T23:00:05Z").UnixNano()),
fmt.Sprintf(`where_events,tennant=david foo="bap" %d`, mustParseTime(time.RFC3339Nano, "2009-11-10T23:00:06Z").UnixNano()),
}
test := NewTest("db0", "rp0")
test.write = strings.Join(writes, "\n")
test.addQueries([]*Query{
&Query{
name: "tag field and time",
params: url.Values{"db": []string{"db0"}},
command: `select foo from where_events where (tennant = 'paul' OR tennant = 'david') AND time > 1s AND (foo = 'bar' OR foo = 'baz' OR foo = 'bap')`,
exp: `{"results":[{"series":[{"name":"where_events","columns":["time","foo"],"values":[["2009-11-10T23:00:02Z","bar"],["2009-11-10T23:00:03Z","baz"],["2009-11-10T23:00:06Z","bap"]]}]}]}`,
},
&Query{
name: "where on tag that should be double quoted but isn't",
params: url.Values{"db": []string{"db0"}},
command: `show series where data-center = 'foo'`,
exp: `{"results":[{"error":"invalid expression: data - center = 'foo'"}]}`,
},
}...)
for i, query := range test.queries {
if i == 0 {
if err := test.init(s); err != nil {
t.Fatalf("test init failed: %s", err)
}
}
if query.skip {
t.Logf("SKIP:: %s", query.name)
continue
}
if err := query.Execute(s); err != nil {
t.Error(query.Error(err))
} else if !query.success() {
t.Error(query.failureMessage())
}
}
}
func TestServer_Query_LimitAndOffset(t *testing.T) {
t.Parallel()
s := OpenServer(NewConfig(), "")
defer s.Close()
if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 0)); err != nil {
t.Fatal(err)
}
if err := s.MetaStore.SetDefaultRetentionPolicy("db0", "rp0"); err != nil {
t.Fatal(err)
}
writes := []string{
fmt.Sprintf(`limited,tennant=paul foo=2 %d`, mustParseTime(time.RFC3339Nano, "2009-11-10T23:00:02Z").UnixNano()),
fmt.Sprintf(`limited,tennant=paul foo=3 %d`, mustParseTime(time.RFC3339Nano, "2009-11-10T23:00:03Z").UnixNano()),
fmt.Sprintf(`limited,tennant=paul foo=4 %d`, mustParseTime(time.RFC3339Nano, "2009-11-10T23:00:04Z").UnixNano()),
fmt.Sprintf(`limited,tennant=todd foo=5 %d`, mustParseTime(time.RFC3339Nano, "2009-11-10T23:00:05Z").UnixNano()),
}
test := NewTest("db0", "rp0")
test.write = strings.Join(writes, "\n")
test.addQueries([]*Query{
&Query{
name: "limit on points",
params: url.Values{"db": []string{"db0"}},
command: `select foo from "limited" LIMIT 2`,
exp: `{"results":[{"series":[{"name":"limited","columns":["time","foo"],"values":[["2009-11-10T23:00:02Z",2],["2009-11-10T23:00:03Z",3]]}]}]}`,
},
&Query{
name: "limit higher than the number of data points",
params: url.Values{"db": []string{"db0"}},
command: `select foo from "limited" LIMIT 20`,
exp: `{"results":[{"series":[{"name":"limited","columns":["time","foo"],"values":[["2009-11-10T23:00:02Z",2],["2009-11-10T23:00:03Z",3],["2009-11-10T23:00:04Z",4],["2009-11-10T23:00:05Z",5]]}]}]}`,
},
&Query{
name: "limit and offset",
params: url.Values{"db": []string{"db0"}},
command: `select foo from "limited" LIMIT 2 OFFSET 1`,
exp: `{"results":[{"series":[{"name":"limited","columns":["time","foo"],"values":[["2009-11-10T23:00:03Z",3],["2009-11-10T23:00:04Z",4]]}]}]}`,
},
&Query{
name: "limit + offset equal to total number of points",
params: url.Values{"db": []string{"db0"}},
command: `select foo from "limited" LIMIT 3 OFFSET 3`,
exp: `{"results":[{"series":[{"name":"limited","columns":["time","foo"],"values":[["2009-11-10T23:00:05Z",5]]}]}]}`,
},
&Query{
name: "limit - offset higher than number of points",
command: `select foo from "limited" LIMIT 2 OFFSET 20`,
exp: `{"results":[{"series":[{"name":"limited","columns":["time","foo"]}]}]}`,
params: url.Values{"db": []string{"db0"}},
},
&Query{
name: "limit on points with group by time",
command: `select mean(foo) from "limited" WHERE time >= '2009-11-10T23:00:02Z' AND time < '2009-11-10T23:00:06Z' GROUP BY TIME(1s) LIMIT 2`,
exp: `{"results":[{"series":[{"name":"limited","columns":["time","mean"],"values":[["2009-11-10T23:00:02Z",2],["2009-11-10T23:00:03Z",3]]}]}]}`,
params: url.Values{"db": []string{"db0"}},
},
&Query{
name: "limit higher than the number of data points with group by time",
command: `select mean(foo) from "limited" WHERE time >= '2009-11-10T23:00:02Z' AND time < '2009-11-10T23:00:06Z' GROUP BY TIME(1s) LIMIT 20`,
exp: `{"results":[{"series":[{"name":"limited","columns":["time","mean"],"values":[["2009-11-10T23:00:02Z",2],["2009-11-10T23:00:03Z",3],["2009-11-10T23:00:04Z",4],["2009-11-10T23:00:05Z",5]]}]}]}`,
params: url.Values{"db": []string{"db0"}},
},
&Query{
name: "limit and offset with group by time",
command: `select mean(foo) from "limited" WHERE time >= '2009-11-10T23:00:02Z' AND time < '2009-11-10T23:00:06Z' GROUP BY TIME(1s) LIMIT 2 OFFSET 1`,
exp: `{"results":[{"series":[{"name":"limited","columns":["time","mean"],"values":[["2009-11-10T23:00:03Z",3],["2009-11-10T23:00:04Z",4]]}]}]}`,
params: url.Values{"db": []string{"db0"}},
},
&Query{
name: "limit + offset equal to the number of points with group by time",
command: `select mean(foo) from "limited" WHERE time >= '2009-11-10T23:00:02Z' AND time < '2009-11-10T23:00:06Z' GROUP BY TIME(1s) LIMIT 3 OFFSET 3`,
exp: `{"results":[{"series":[{"name":"limited","columns":["time","mean"],"values":[["2009-11-10T23:00:05Z",5]]}]}]}`,
params: url.Values{"db": []string{"db0"}},
},
&Query{
name: "limit - offset higher than number of points with group by time",
command: `select mean(foo) from "limited" WHERE time >= '2009-11-10T23:00:02Z' AND time < '2009-11-10T23:00:06Z' GROUP BY TIME(1s) LIMIT 2 OFFSET 20`,
exp: `{"results":[{}]}`,
params: url.Values{"db": []string{"db0"}},
},
&Query{
name: "limit higher than the number of data points should error",
command: `select mean(foo) from "limited" where time > '2000-01-01T00:00:00Z' group by time(1s), * fill(0) limit 2147483647`,
exp: `{"results":[{"error":"too many points in the group by interval. maybe you forgot to specify a where time clause?"}]}`,
params: url.Values{"db": []string{"db0"}},
},
&Query{
name: "limit1 higher than MaxGroupBy but the number of data points is less than MaxGroupBy",
command: `select mean(foo) from "limited" where time >= '2009-11-10T23:00:02Z' and time < '2009-11-10T23:00:03Z' group by time(1s), * fill(0) limit 2147483647`,
exp: `{"results":[{"series":[{"name":"limited","tags":{"tennant":"paul"},"columns":["time","mean"],"values":[["2009-11-10T23:00:02Z",2]]},{"name":"limited","tags":{"tennant":"todd"},"columns":["time","mean"],"values":[["2009-11-10T23:00:02Z",0]]}]}]}`,
params: url.Values{"db": []string{"db0"}},
},
}...)
for i, query := range test.queries {
if i == 0 {
if err := test.init(s); err != nil {
t.Fatalf("test init failed: %s", err)
}
}
if query.skip {
t.Logf("SKIP:: %s", query.name)
continue
}
if err := query.Execute(s); err != nil {
t.Error(query.Error(err))
} else if !query.success() {
t.Error(query.failureMessage())
}
}
}
func TestServer_Query_Fill(t *testing.T) {
t.Parallel()
s := OpenServer(NewConfig(), "")
defer s.Close()
if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 0)); err != nil {
t.Fatal(err)
}
if err := s.MetaStore.SetDefaultRetentionPolicy("db0", "rp0"); err != nil {
t.Fatal(err)
}
writes := []string{
fmt.Sprintf(`fills val=3 %d`, mustParseTime(time.RFC3339Nano, "2009-11-10T23:00:02Z").UnixNano()),
fmt.Sprintf(`fills val=5 %d`, mustParseTime(time.RFC3339Nano, "2009-11-10T23:00:03Z").UnixNano()),
fmt.Sprintf(`fills val=4 %d`, mustParseTime(time.RFC3339Nano, "2009-11-10T23:00:06Z").UnixNano()),
fmt.Sprintf(`fills val=10 %d`, mustParseTime(time.RFC3339Nano, "2009-11-10T23:00:16Z").UnixNano()),
}
test := NewTest("db0", "rp0")
test.write = strings.Join(writes, "\n")
test.addQueries([]*Query{
&Query{
name: "fill with value",
command: `select mean(val) from fills where time >= '2009-11-10T23:00:00Z' and time < '2009-11-10T23:00:20Z' group by time(5s) FILL(1)`,
exp: `{"results":[{"series":[{"name":"fills","columns":["time","mean"],"values":[["2009-11-10T23:00:00Z",4],["2009-11-10T23:00:05Z",4],["2009-11-10T23:00:10Z",1],["2009-11-10T23:00:15Z",10]]}]}]}`,
params: url.Values{"db": []string{"db0"}},
},
&Query{
name: "fill with previous",
command: `select mean(val) from fills where time >= '2009-11-10T23:00:00Z' and time < '2009-11-10T23:00:20Z' group by time(5s) FILL(previous)`,
exp: `{"results":[{"series":[{"name":"fills","columns":["time","mean"],"values":[["2009-11-10T23:00:00Z",4],["2009-11-10T23:00:05Z",4],["2009-11-10T23:00:10Z",4],["2009-11-10T23:00:15Z",10]]}]}]}`,
params: url.Values{"db": []string{"db0"}},
},
&Query{
name: "fill with none, i.e. clear out nulls",
command: `select mean(val) from fills where time >= '2009-11-10T23:00:00Z' and time < '2009-11-10T23:00:20Z' group by time(5s) FILL(none)`,
exp: `{"results":[{"series":[{"name":"fills","columns":["time","mean"],"values":[["2009-11-10T23:00:00Z",4],["2009-11-10T23:00:05Z",4],["2009-11-10T23:00:15Z",10]]}]}]}`,
params: url.Values{"db": []string{"db0"}},
},
&Query{
name: "fill defaults to null",
command: `select mean(val) from fills where time >= '2009-11-10T23:00:00Z' and time < '2009-11-10T23:00:20Z' group by time(5s)`,
exp: `{"results":[{"series":[{"name":"fills","columns":["time","mean"],"values":[["2009-11-10T23:00:00Z",4],["2009-11-10T23:00:05Z",4],["2009-11-10T23:00:10Z",null],["2009-11-10T23:00:15Z",10]]}]}]}`,
params: url.Values{"db": []string{"db0"}},
},
&Query{
name: "fill with count aggregate defaults to null",
command: `select count(val) from fills where time >= '2009-11-10T23:00:00Z' and time < '2009-11-10T23:00:20Z' group by time(5s)`,
exp: `{"results":[{"series":[{"name":"fills","columns":["time","count"],"values":[["2009-11-10T23:00:00Z",2],["2009-11-10T23:00:05Z",1],["2009-11-10T23:00:10Z",null],["2009-11-10T23:00:15Z",1]]}]}]}`,
params: url.Values{"db": []string{"db0"}},
},
&Query{
name: "fill with count aggregate specific value",
command: `select count(val) from fills where time >= '2009-11-10T23:00:00Z' and time < '2009-11-10T23:00:20Z' group by time(5s) fill(1234)`,
exp: `{"results":[{"series":[{"name":"fills","columns":["time","count"],"values":[["2009-11-10T23:00:00Z",2],["2009-11-10T23:00:05Z",1],["2009-11-10T23:00:10Z",1234],["2009-11-10T23:00:15Z",1]]}]}]}`,
params: url.Values{"db": []string{"db0"}},
},
}...)
for i, query := range test.queries {
if i == 0 {
if err := test.init(s); err != nil {
t.Fatalf("test init failed: %s", err)
}
}
if query.skip {
t.Logf("SKIP:: %s", query.name)
continue
}
if err := query.Execute(s); err != nil {
t.Error(query.Error(err))
} else if !query.success() {
t.Error(query.failureMessage())
}
}
}
func TestServer_Query_DropAndRecreateMeasurement(t *testing.T) {
t.Parallel()
s := OpenServer(NewConfig(), "")
defer s.Close()
if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 0)); err != nil {
t.Fatal(err)
}
if err := s.MetaStore.SetDefaultRetentionPolicy("db0", "rp0"); err != nil {
t.Fatal(err)
}
writes := []string{
fmt.Sprintf(`cpu,host=serverA,region=uswest val=23.2 %d`, mustParseTime(time.RFC3339Nano, "2000-01-01T00:00:00Z").UnixNano()),
fmt.Sprintf(`memory,host=serverB,region=uswest val=33.2 %d`, mustParseTime(time.RFC3339Nano, "2000-01-01T00:00:01Z").UnixNano()),
}
test := NewTest("db0", "rp0")
test.write = strings.Join(writes, "\n")
test.addQueries([]*Query{
&Query{
name: "Drop Measurement, series tags preserved tests",
command: `SHOW MEASUREMENTS`,
exp: `{"results":[{"series":[{"name":"measurements","columns":["name"],"values":[["cpu"],["memory"]]}]}]}`,
params: url.Values{"db": []string{"db0"}},
},
&Query{
name: "show series",
command: `SHOW SERIES`,
exp: `{"results":[{"series":[{"name":"cpu","columns":["_key","host","region"],"values":[["cpu,host=serverA,region=uswest","serverA","uswest"]]},{"name":"memory","columns":["_key","host","region"],"values":[["memory,host=serverB,region=uswest","serverB","uswest"]]}]}]}`,
params: url.Values{"db": []string{"db0"}},
},
&Query{
name: "ensure we can query for memory with both tags",
command: `SELECT * FROM memory where region='uswest' and host='serverB'`,
exp: `{"results":[{"series":[{"name":"memory","tags":{"host":"serverB","region":"uswest"},"columns":["time","val"],"values":[["2000-01-01T00:00:01Z",33.2]]}]}]}`,
params: url.Values{"db": []string{"db0"}},
},
&Query{
name: "drop measurement cpu",
command: `DROP MEASUREMENT cpu`,
exp: `{"results":[{}]}`,
params: url.Values{"db": []string{"db0"}},
},
&Query{
name: "verify measurements",
command: `SHOW MEASUREMENTS`,
exp: `{"results":[{"series":[{"name":"measurements","columns":["name"],"values":[["memory"]]}]}]}`,
params: url.Values{"db": []string{"db0"}},
},
&Query{
name: "verify series",
command: `SHOW SERIES`,
exp: `{"results":[{"series":[{"name":"memory","columns":["_key","host","region"],"values":[["memory,host=serverB,region=uswest","serverB","uswest"]]}]}]}`,
params: url.Values{"db": []string{"db0"}},
},
&Query{
name: "verify cpu measurement is gone",
command: `SELECT * FROM cpu`,
exp: `{"results":[{}]}`,
params: url.Values{"db": []string{"db0"}},
},
&Query{
name: "verify selecting from a tag 'host' still works",
command: `SELECT * FROM memory where host='serverB'`,
exp: `{"results":[{"series":[{"name":"memory","tags":{"host":"serverB","region":"uswest"},"columns":["time","val"],"values":[["2000-01-01T00:00:01Z",33.2]]}]}]}`,
params: url.Values{"db": []string{"db0"}},
},
&Query{
name: "verify selecting from a tag 'region' still works",
command: `SELECT * FROM memory where region='uswest'`,
exp: `{"results":[{"series":[{"name":"memory","tags":{"host":"serverB","region":"uswest"},"columns":["time","val"],"values":[["2000-01-01T00:00:01Z",33.2]]}]}]}`,
params: url.Values{"db": []string{"db0"}},
},
&Query{
name: "verify selecting from a tag 'host' and 'region' still works",
command: `SELECT * FROM memory where region='uswest' and host='serverB'`,
exp: `{"results":[{"series":[{"name":"memory","tags":{"host":"serverB","region":"uswest"},"columns":["time","val"],"values":[["2000-01-01T00:00:01Z",33.2]]}]}]}`,
params: url.Values{"db": []string{"db0"}},
},
&Query{
name: "Drop non-existant measurement",
command: `DROP MEASUREMENT doesntexist`,
exp: `{"results":[{"error":"measurement not found: doesntexist"}]}`,
params: url.Values{"db": []string{"db0"}},
},
}...)
// Test that re-inserting the measurement works fine.
for i, query := range test.queries {
if i == 0 {
if err := test.init(s); err != nil {
t.Fatalf("test init failed: %s", err)
}
}
if query.skip {
t.Logf("SKIP:: %s", query.name)
continue
}
if err := query.Execute(s); err != nil {
t.Error(query.Error(err))
} else if !query.success() {
t.Error(query.failureMessage())
}
}
test = NewTest("db0", "rp0")
test.write = strings.Join(writes, "\n")
test.addQueries([]*Query{
&Query{
name: "verify measurements after recreation",
command: `SHOW MEASUREMENTS`,
exp: `{"results":[{"series":[{"name":"measurements","columns":["name"],"values":[["cpu"],["memory"]]}]}]}`,
params: url.Values{"db": []string{"db0"}},
},
&Query{
name: "verify cpu measurement has been re-inserted",
command: `SELECT * FROM cpu`,
exp: `{"results":[{"series":[{"name":"cpu","tags":{"host":"serverA","region":"uswest"},"columns":["time","val"],"values":[["2000-01-01T00:00:00Z",23.2]]}]}]}`,
params: url.Values{"db": []string{"db0"}},
},
}...)
for i, query := range test.queries {
if i == 0 {
if err := test.init(s); err != nil {
t.Fatalf("test init failed: %s", err)
}
}
if query.skip {
t.Logf("SKIP:: %s", query.name)
continue
}
if err := query.Execute(s); err != nil {
t.Error(query.Error(err))
} else if !query.success() {
t.Error(query.failureMessage())
}
}
}
func TestServer_Query_ShowSeries(t *testing.T) {
t.Parallel()
s := OpenServer(NewConfig(), "")
defer s.Close()
if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 0)); err != nil {
t.Fatal(err)
}
if err := s.MetaStore.SetDefaultRetentionPolicy("db0", "rp0"); err != nil {
t.Fatal(err)
}
writes := []string{
fmt.Sprintf(`cpu,host=server01 value=100 %d`, mustParseTime(time.RFC3339Nano, "2009-11-10T23:00:01Z").UnixNano()),
fmt.Sprintf(`cpu,host=server01,region=uswest value=100 %d`, mustParseTime(time.RFC3339Nano, "2009-11-10T23:00:02Z").UnixNano()),
fmt.Sprintf(`cpu,host=server01,region=useast value=100 %d`, mustParseTime(time.RFC3339Nano, "2009-11-10T23:00:03Z").UnixNano()),
fmt.Sprintf(`cpu,host=server02,region=useast value=100 %d`, mustParseTime(time.RFC3339Nano, "2009-11-10T23:00:04Z").UnixNano()),
fmt.Sprintf(`gpu,host=server02,region=useast value=100 %d`, mustParseTime(time.RFC3339Nano, "2009-11-10T23:00:05Z").UnixNano()),
fmt.Sprintf(`gpu,host=server03,region=caeast value=100 %d`, mustParseTime(time.RFC3339Nano, "2009-11-10T23:00:06Z").UnixNano()),
fmt.Sprintf(`disk,host=server03,region=caeast value=100 %d`, mustParseTime(time.RFC3339Nano, "2009-11-10T23:00:07Z").UnixNano()),
}
test := NewTest("db0", "rp0")
test.write = strings.Join(writes, "\n")
test.addQueries([]*Query{
&Query{
name: `show series`,
command: "SHOW SERIES",
exp: `{"results":[{"series":[{"name":"cpu","columns":["_key","host","region"],"values":[["cpu,host=server01","server01",""],["cpu,host=server01,region=uswest","server01","uswest"],["cpu,host=server01,region=useast","server01","useast"],["cpu,host=server02,region=useast","server02","useast"]]},{"name":"disk","columns":["_key","host","region"],"values":[["disk,host=server03,region=caeast","server03","caeast"]]},{"name":"gpu","columns":["_key","host","region"],"values":[["gpu,host=server02,region=useast","server02","useast"],["gpu,host=server03,region=caeast","server03","caeast"]]}]}]}`,
params: url.Values{"db": []string{"db0"}},
},
&Query{
name: `show series from measurement - FIXME issue #2942`,
command: "SHOW SERIES FROM cpu",
exp: `{"results":[{"series":[{"name":"cpu","columns":["_key","host","region"],"values":[["cpu,host=server01","server01",""],["cpu,host=server01,region=uswest","server01","uswest"],["cpu,host=server01,region=useast","server01","useast"],["cpu,host=server02,region=useast","server02","useast"]]}]}]}`,
params: url.Values{"db": []string{"db0"}},
},
&Query{
name: `show series from regular expression - FIXME issue #2942`,
command: "SHOW SERIES FROM /[cg]pu/",
exp: `{"results":[{"series":[{"name":"cpu","columns":["_key","host","region"],"values":[["cpu,host=server01","server01",""],["cpu,host=server01,region=uswest","server01","uswest"],["cpu,host=server01,region=useast","server01","useast"],["cpu,host=server02,region=useast","server02","useast"]]},{"name":"gpu","columns":["_key","host","region"],"values":[["gpu,host=server02,region=useast","server02","useast"],["gpu,host=server03,region=caeast","server03","caeast"]]}]}]}`,
params: url.Values{"db": []string{"db0"}},
},
&Query{
name: `show series with where tag`,
command: "SHOW SERIES WHERE region = 'uswest'",
exp: `{"results":[{"series":[{"name":"cpu","columns":["_key","host","region"],"values":[["cpu,host=server01,region=uswest","server01","uswest"]]}]}]}`,
params: url.Values{"db": []string{"db0"}},
},
&Query{
name: `show series where tag matches regular expression`,
command: "SHOW SERIES WHERE region =~ /ca.*/",
exp: `{"results":[{"series":[{"name":"disk","columns":["_key","host","region"],"values":[["disk,host=server03,region=caeast","server03","caeast"]]},{"name":"gpu","columns":["_key","host","region"],"values":[["gpu,host=server03,region=caeast","server03","caeast"]]}]}]}`,
params: url.Values{"db": []string{"db0"}},
},
&Query{
name: `show series`,
command: "SHOW SERIES WHERE host !~ /server0[12]/",
exp: `{"results":[{"series":[{"name":"disk","columns":["_key","host","region"],"values":[["disk,host=server03,region=caeast","server03","caeast"]]},{"name":"gpu","columns":["_key","host","region"],"values":[["gpu,host=server03,region=caeast","server03","caeast"]]}]}]}`,
params: url.Values{"db": []string{"db0"}},
},
&Query{
name: `show series with from and where`,
command: "SHOW SERIES FROM cpu WHERE region = 'useast'",
exp: `{"results":[{"series":[{"name":"cpu","columns":["_key","host","region"],"values":[["cpu,host=server01,region=useast","server01","useast"],["cpu,host=server02,region=useast","server02","useast"]]}]}]}`,
params: url.Values{"db": []string{"db0"}},
},
}...)
for i, query := range test.queries {
if i == 0 {
if err := test.init(s); err != nil {
t.Fatalf("test init failed: %s", err)
}
}
if query.skip {
t.Logf("SKIP:: %s", query.name)
continue
}
if err := query.Execute(s); err != nil {
t.Error(query.Error(err))
} else if !query.success() {
t.Error(query.failureMessage())
}
}
}
func TestServer_Query_ShowMeasurements(t *testing.T) {
t.Parallel()
s := OpenServer(NewConfig(), "")
defer s.Close()
if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 0)); err != nil {
t.Fatal(err)
}
if err := s.MetaStore.SetDefaultRetentionPolicy("db0", "rp0"); err != nil {
t.Fatal(err)
}
writes := []string{
fmt.Sprintf(`cpu,host=server01 value=100 %d`, mustParseTime(time.RFC3339Nano, "2009-11-10T23:00:00Z").UnixNano()),
fmt.Sprintf(`cpu,host=server01,region=uswest value=100 %d`, mustParseTime(time.RFC3339Nano, "2009-11-10T23:00:00Z").UnixNano()),
fmt.Sprintf(`cpu,host=server01,region=useast value=100 %d`, mustParseTime(time.RFC3339Nano, "2009-11-10T23:00:00Z").UnixNano()),
fmt.Sprintf(`cpu,host=server02,region=useast value=100 %d`, mustParseTime(time.RFC3339Nano, "2009-11-10T23:00:00Z").UnixNano()),
fmt.Sprintf(`gpu,host=server02,region=useast value=100 %d`, mustParseTime(time.RFC3339Nano, "2009-11-10T23:00:00Z").UnixNano()),
fmt.Sprintf(`gpu,host=server02,region=caeast value=100 %d`, mustParseTime(time.RFC3339Nano, "2009-11-10T23:00:00Z").UnixNano()),
fmt.Sprintf(`other,host=server03,region=caeast value=100 %d`, mustParseTime(time.RFC3339Nano, "2009-11-10T23:00:00Z").UnixNano()),
}
test := NewTest("db0", "rp0")
test.write = strings.Join(writes, "\n")
test.addQueries([]*Query{
&Query{
name: `show measurements with limit 2`,
command: "SHOW MEASUREMENTS LIMIT 2",
exp: `{"results":[{"series":[{"name":"measurements","columns":["name"],"values":[["cpu"],["gpu"]]}]}]}`,
params: url.Values{"db": []string{"db0"}},
},
&Query{
name: `show measurements where tag matches regular expression`,
command: "SHOW MEASUREMENTS WHERE region =~ /ca.*/",
exp: `{"results":[{"series":[{"name":"measurements","columns":["name"],"values":[["gpu"],["other"]]}]}]}`,
params: url.Values{"db": []string{"db0"}},
},
&Query{
name: `show measurements where tag does not match a regular expression`,
command: "SHOW MEASUREMENTS WHERE region !~ /ca.*/",
exp: `{"results":[{"series":[{"name":"measurements","columns":["name"],"values":[["cpu"]]}]}]}`,
params: url.Values{"db": []string{"db0"}},
},
}...)
for i, query := range test.queries {
if i == 0 {
if err := test.init(s); err != nil {
t.Fatalf("test init failed: %s", err)
}
}
if query.skip {
t.Logf("SKIP:: %s", query.name)
continue
}
if err := query.Execute(s); err != nil {
t.Error(query.Error(err))
} else if !query.success() {
t.Error(query.failureMessage())
}
}
}
func TestServer_Query_ShowTagKeys(t *testing.T) {
t.Parallel()
s := OpenServer(NewConfig(), "")
defer s.Close()
if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 0)); err != nil {
t.Fatal(err)
}
if err := s.MetaStore.SetDefaultRetentionPolicy("db0", "rp0"); err != nil {
t.Fatal(err)
}
writes := []string{
fmt.Sprintf(`cpu,host=server01 value=100 %d`, mustParseTime(time.RFC3339Nano, "2009-11-10T23:00:00Z").UnixNano()),
fmt.Sprintf(`cpu,host=server01,region=uswest value=100 %d`, mustParseTime(time.RFC3339Nano, "2009-11-10T23:00:00Z").UnixNano()),
fmt.Sprintf(`cpu,host=server01,region=useast value=100 %d`, mustParseTime(time.RFC3339Nano, "2009-11-10T23:00:00Z").UnixNano()),
fmt.Sprintf(`cpu,host=server02,region=useast value=100 %d`, mustParseTime(time.RFC3339Nano, "2009-11-10T23:00:00Z").UnixNano()),
fmt.Sprintf(`gpu,host=server02,region=useast value=100 %d`, mustParseTime(time.RFC3339Nano, "2009-11-10T23:00:00Z").UnixNano()),
fmt.Sprintf(`gpu,host=server03,region=caeast value=100 %d`, mustParseTime(time.RFC3339Nano, "2009-11-10T23:00:00Z").UnixNano()),
fmt.Sprintf(`disk,host=server03,region=caeast value=100 %d`, mustParseTime(time.RFC3339Nano, "2009-11-10T23:00:00Z").UnixNano()),
}
test := NewTest("db0", "rp0")
test.write = strings.Join(writes, "\n")
test.addQueries([]*Query{
&Query{
name: `show tag keys`,
command: "SHOW TAG KEYS",
exp: `{"results":[{"series":[{"name":"cpu","columns":["tagKey"],"values":[["host"],["region"]]},{"name":"disk","columns":["tagKey"],"values":[["host"],["region"]]},{"name":"gpu","columns":["tagKey"],"values":[["host"],["region"]]}]}]}`,
params: url.Values{"db": []string{"db0"}},
},
&Query{
name: "show tag keys from",
command: "SHOW TAG KEYS FROM cpu",
exp: `{"results":[{"series":[{"name":"cpu","columns":["tagKey"],"values":[["host"],["region"]]}]}]}`,
params: url.Values{"db": []string{"db0"}},
},
&Query{
name: "show tag keys from regex",
command: "SHOW TAG KEYS FROM /[cg]pu/",
exp: `{"results":[{"series":[{"name":"cpu","columns":["tagKey"],"values":[["host"],["region"]]},{"name":"gpu","columns":["tagKey"],"values":[["host"],["region"]]}]}]}`,
params: url.Values{"db": []string{"db0"}},
},
&Query{
name: "show tag keys measurement not found",
command: "SHOW TAG KEYS FROM bad",
exp: `{"results":[{"error":"measurement not found: bad"}]}`,
params: url.Values{"db": []string{"db0"}},
},
&Query{
name: "show tag values with key",
command: "SHOW TAG VALUES WITH KEY = host",
exp: `{"results":[{"series":[{"name":"hostTagValues","columns":["host"],"values":[["server01"],["server02"],["server03"]]}]}]}`,
params: url.Values{"db": []string{"db0"}},
},
&Query{
name: `show tag values with key and where`,
command: `SHOW TAG VALUES FROM cpu WITH KEY = host WHERE region = 'uswest'`,
exp: `{"results":[{"series":[{"name":"hostTagValues","columns":["host"],"values":[["server01"]]}]}]}`,
params: url.Values{"db": []string{"db0"}},
},
&Query{
name: `show tag values with key and where matches regular expression`,
command: `SHOW TAG VALUES WITH KEY = host WHERE region =~ /ca.*/`,
exp: `{"results":[{"series":[{"name":"hostTagValues","columns":["host"],"values":[["server03"]]}]}]}`,
params: url.Values{"db": []string{"db0"}},
},
&Query{
name: `show tag values with key and where does not matche regular expression`,
command: `SHOW TAG VALUES WITH KEY = region WHERE host !~ /server0[12]/`,
exp: `{"results":[{"series":[{"name":"regionTagValues","columns":["region"],"values":[["caeast"]]}]}]}`,
params: url.Values{"db": []string{"db0"}},
},
&Query{
name: `show tag values with key in and where does not matche regular expression`,
command: `SHOW TAG VALUES FROM cpu WITH KEY IN (host, region) WHERE region = 'uswest'`,
exp: `{"results":[{"series":[{"name":"hostTagValues","columns":["host"],"values":[["server01"]]},{"name":"regionTagValues","columns":["region"],"values":[["uswest"]]}]}]}`,
params: url.Values{"db": []string{"db0"}},
},
&Query{
name: `show tag values with key and measurement matches regular expression`,
command: `SHOW TAG VALUES FROM /[cg]pu/ WITH KEY = host`,
exp: `{"results":[{"series":[{"name":"hostTagValues","columns":["host"],"values":[["server01"],["server02"],["server03"]]}]}]}`,
params: url.Values{"db": []string{"db0"}},
},
}...)
for i, query := range test.queries {
if i == 0 {
if err := test.init(s); err != nil {
t.Fatalf("test init failed: %s", err)
}
}
if query.skip {
t.Logf("SKIP:: %s", query.name)
continue
}
if err := query.Execute(s); err != nil {
t.Error(query.Error(err))
} else if !query.success() {
t.Error(query.failureMessage())
}
}
}
func TestServer_Query_ShowFieldKeys(t *testing.T) {
t.Parallel()
s := OpenServer(NewConfig(), "")
defer s.Close()
if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 0)); err != nil {
t.Fatal(err)
}
if err := s.MetaStore.SetDefaultRetentionPolicy("db0", "rp0"); err != nil {
t.Fatal(err)
}
writes := []string{
fmt.Sprintf(`cpu,host=server01 field1=100 %d`, mustParseTime(time.RFC3339Nano, "2009-11-10T23:00:00Z").UnixNano()),
fmt.Sprintf(`cpu,host=server01,region=uswest field1=200,field2=300,field3=400 %d`, mustParseTime(time.RFC3339Nano, "2009-11-10T23:00:00Z").UnixNano()),
fmt.Sprintf(`cpu,host=server01,region=useast field1=200,field2=300,field3=400 %d`, mustParseTime(time.RFC3339Nano, "2009-11-10T23:00:00Z").UnixNano()),
fmt.Sprintf(`cpu,host=server02,region=useast field1=200,field2=300,field3=400 %d`, mustParseTime(time.RFC3339Nano, "2009-11-10T23:00:00Z").UnixNano()),
fmt.Sprintf(`gpu,host=server01,region=useast field4=200,field5=300 %d`, mustParseTime(time.RFC3339Nano, "2009-11-10T23:00:00Z").UnixNano()),
fmt.Sprintf(`gpu,host=server03,region=caeast field6=200,field7=300 %d`, mustParseTime(time.RFC3339Nano, "2009-11-10T23:00:00Z").UnixNano()),
fmt.Sprintf(`disk,host=server03,region=caeast field8=200,field9=300 %d`, mustParseTime(time.RFC3339Nano, "2009-11-10T23:00:00Z").UnixNano()),
}
test := NewTest("db0", "rp0")
test.write = strings.Join(writes, "\n")
test.addQueries([]*Query{
&Query{
name: `show field keys`,
command: `SHOW FIELD KEYS`,
exp: `{"results":[{"series":[{"name":"cpu","columns":["fieldKey"],"values":[["field1"],["field2"],["field3"]]},{"name":"disk","columns":["fieldKey"],"values":[["field8"],["field9"]]},{"name":"gpu","columns":["fieldKey"],"values":[["field4"],["field5"],["field6"],["field7"]]}]}]}`,
params: url.Values{"db": []string{"db0"}},
},
&Query{
name: `show field keys from measurement`,
command: `SHOW FIELD KEYS FROM cpu`,
exp: `{"results":[{"series":[{"name":"cpu","columns":["fieldKey"],"values":[["field1"],["field2"],["field3"]]}]}]}`,
params: url.Values{"db": []string{"db0"}},
},
&Query{
name: `show field keys measurement with regex`,
command: `SHOW FIELD KEYS FROM /[cg]pu/`,
exp: `{"results":[{"series":[{"name":"cpu","columns":["fieldKey"],"values":[["field1"],["field2"],["field3"]]},{"name":"gpu","columns":["fieldKey"],"values":[["field4"],["field5"],["field6"],["field7"]]}]}]}`,
params: url.Values{"db": []string{"db0"}},
},
}...)
for i, query := range test.queries {
if i == 0 {
if err := test.init(s); err != nil {
t.Fatalf("test init failed: %s", err)
}
}
if query.skip {
t.Logf("SKIP:: %s", query.name)
continue
}
if err := query.Execute(s); err != nil {
t.Error(query.Error(err))
} else if !query.success() {
t.Error(query.failureMessage())
}
}
}
func TestServer_Query_CreateContinuousQuery(t *testing.T) {
t.Parallel()
s := OpenServer(NewConfig(), "")
defer s.Close()
if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 0)); err != nil {
t.Fatal(err)
}
if err := s.MetaStore.SetDefaultRetentionPolicy("db0", "rp0"); err != nil {
t.Fatal(err)
}
test := NewTest("db0", "rp0")
test.addQueries([]*Query{
&Query{
name: "create continuous query",
command: `CREATE CONTINUOUS QUERY "my.query" ON db0 BEGIN SELECT count(value) INTO measure1 FROM myseries GROUP BY time(10m) END`,
exp: `{"results":[{}]}`,
},
&Query{
name: `show continuous queries`,
command: `SHOW CONTINUOUS QUERIES`,
exp: `{"results":[{"series":[{"name":"db0","columns":["name","query"],"values":[["my.query","CREATE CONTINUOUS QUERY \"my.query\" ON db0 BEGIN SELECT count(value) INTO \"db0\".\"rp0\".measure1 FROM \"db0\".\"rp0\".myseries GROUP BY time(10m) END"]]}]}]}`,
},
}...)
for i, query := range test.queries {
if i == 0 {
if err := test.init(s); err != nil {
t.Fatalf("test init failed: %s", err)
}
}
if query.skip {
t.Logf("SKIP:: %s", query.name)
continue
}
if err := query.Execute(s); err != nil {
t.Error(query.Error(err))
} else if !query.success() {
t.Error(query.failureMessage())
}
}
}
func TestServer_Query_EvilIdentifiers(t *testing.T) {
t.Parallel()
s := OpenServer(NewConfig(), "")
defer s.Close()
if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0", 1, 0)); err != nil {
t.Fatal(err)
}
if err := s.MetaStore.SetDefaultRetentionPolicy("db0", "rp0"); err != nil {
t.Fatal(err)
}
test := NewTest("db0", "rp0")
test.write = fmt.Sprintf("cpu select=1,in-bytes=2 %d", mustParseTime(time.RFC3339Nano, "2000-01-01T00:00:00Z").UnixNano())
test.addQueries([]*Query{
&Query{
name: `query evil identifiers`,
command: `SELECT "select", "in-bytes" FROM cpu`,
exp: `{"results":[{"series":[{"name":"cpu","columns":["time","select","in-bytes"],"values":[["2000-01-01T00:00:00Z",1,2]]}]}]}`,
params: url.Values{"db": []string{"db0"}},
},
}...)
for i, query := range test.queries {
if i == 0 {
if err := test.init(s); err != nil {
t.Fatalf("test init failed: %s", err)
}
}
if query.skip {
t.Logf("SKIP:: %s", query.name)
continue
}
if err := query.Execute(s); err != nil {
t.Error(query.Error(err))
} else if !query.success() {
t.Error(query.failureMessage())
}
}
}
| mash0304/influxdb | cmd/influxd/run/server_test.go | GO | mit | 135,613 |
<?php
function podlove_camelcase_to_snakecase($string)
{
return preg_replace('/([a-z])([A-Z])/', '$1_$2', $string);
}
function podlove_camelsnakecase_to_camelcase($string)
{
return str_replace('_', '', $string);
}
function podlove_snakecase_to_camelsnakecase($string)
{
return ucwords(preg_replace_callback('/_\w/', function ($m) {
return strtoupper($m[0]);
}, $string));
}
// autoload all classes in /lib
function podlove_autoloader($class_name)
{
// get class name without namespace
$split = explode('\\', $class_name);
// remove <Plugin> namespace
$plugin = array_shift($split);
if (!strlen($plugin)) {
$plugin = array_shift($split);
}
// only load classes prefixed with <Plugin> namespace
if ($plugin != 'Podlove') {
return false;
}
// class name without namespace
$class_name = array_pop($split);
// CamelCase to snake_case
$class_name = podlove_camelcase_to_snakecase($class_name);
// the rest of the namespace, if any
$namespaces = $split;
// library directory
$lib = dirname(dirname(__FILE__)).'/lib/';
// register all possible paths for the class
$possibilities = [];
if (count($namespaces) >= 1) {
$possibilities[] = $lib.strtolower(implode('/', array_map('podlove_camelcase_to_snakecase', $namespaces)).'/'.$class_name.'.php');
} else {
$possibilities[] = $lib.strtolower($class_name.'.php');
}
// search for the class
foreach ($possibilities as $file) {
if (file_exists($file)) {
require_once $file;
return true;
}
}
if (defined('WP_DEBUG') && WP_DEBUG) {
$trace = debug_backtrace();
$functions = array_map(function ($t) {
return $t['function'];
}, $trace);
if (in_array('class_exists', $functions)) {
// don't log anything, we were just checking if that class exists
} else {
error_log(print_r([
'message' => 'Class Autoload failed for "'.$class_name.'"',
'attempts' => $possibilities,
'trace' => $functions,
], true));
}
}
return false;
}
spl_autoload_register('podlove_autoloader');
| podlove/podlove-publisher | bootstrap/autoload.php | PHP | mit | 2,265 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="robots" content="noindex, nofollow">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1">
<meta name="description" content="Klub českých turistů nabízí turistické akce pro veřejnost ve všech krajích republiky, věnujeme se také turistickému značení, provozujeme chaty, vydáváme vlastní řadu turistických map a také časopis TURISTA.">
<title>Turistické mapy | KČT</title>
<link rel="shortcut icon" href="img/kct.png" type="image/x-icon">
<!-- CSS Bootstrap -->
<link href="css/bootstrap.css" rel="stylesheet">
<!-- CSS custom -->
<link href="css/custom.css" rel="stylesheet">
<!-- Fonts -->
<link rel="stylesheet" href="font-awesome/css/font-awesome.min.css">
<link href='https://fonts.googleapis.com/css?family=Open+Sans:300,400,700&subset=latin,latin-ext,cyrillic' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Noto+Sans:400,700&subset=cyrillic,latin-ext,latin' rel='stylesheet' type='text/css'>
<!-- Other meta tags -->
<meta name="copyright" content="2015 Klub českých turistů">
<meta name="author" content="Klub českých turistů • www.kct.cz">
<meta property="og:title" content="KČT">
<meta name="description" property="og:description" content="Klub českých turistů nabízí turistické akce pro veřejnost ve všech krajích republiky, věnujeme se také turistickému značení, provozujeme chaty, vydáváme vlastní řadu turistických map a také časopis TURISTA.">
<meta property="og:type" content="article">
<meta property="og:url" content="http://www.kct.cz/">
<meta property="og:image" content="img/kct.png">
<meta property="article:publisher" content="https://www.facebook.com/kct.cz">
<meta name="twitter:site" content="@kct_cz">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image" content="img/kct.png">
<meta name="twitter:creator" content="@kct_cz">
<meta name="article:publisher" content="https://www.facebook.com/kct.cz">
</head>
<body>
<!-- Header -->
<div class="container-fluid header">
<div class="container">
<!-- Header right side -->
<div class="col-xs-12 col-sm-5 col-md-5 col-lg-3 col-sm-push-7 col-md-push-7 col-lg-push-9 social">
<!-- Social buttons -->
<div class="list pull-right">
<div>
<a target="_blank" href="https://www.facebook.com/kct.cz">
<i class="fa fa-facebook-f fa-2x"></i>
</a>
</div>
<div>
<a target="_blank" href="https://twitter.com/kct_cz">
<i class="fa fa-twitter fa-2x"></i>
</a>
</div>
<div>
<a href="mailto:[email protected]">
<i class="fa fa-envelope fa-2x"></i>
</a>
</div>
</div>
</div>
<!-- Logo -->
<a href="index.html">
<div class="col-xs-4 col-sm-2 col-md-2 col-lg-2 col-sm-pull-5 col-md-pull-5 col-lg-pull-3 social logo">
</div>
</a>
<!-- Logo-text -->
<div class="col-xs-8 col-sm-5 col-md-5 col-lg-7 col-sm-pull-5 col-md-pull-5 col-lg-pull-3 logotext">
<a href="index.html">
<h1 class="logoMaintext">Klub českých turistů</h1>
</a>
<h4>Vaše dobrá značka</h4>
<img src="img/znacky.png" alt="Logo značení">
</div>
</div>
</div>
<!-- Header End -->
<!-- Navigation -->
<div class="container-fluid">
<nav id="navbar-main" class="shift navbar-wrapper navbar-default" role="navigation">
<!-- hamburger -->
<button type="button" class="pull-right navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Menu</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav row">
<li><a href="index.html#Akce"><b class="caret"></b> Akce</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle disabled" data-toggle="dropdown"> O klubu</a>
<ul class="dropdown-menu">
<li><a href="historie.html"><h5>Historie</h5></a></li>
<li><a href="cinnost-klubu.html"><h5>Činnost klubu</h5></a></li>
<li><a href="rady-a-sekce.html"><h5>Rady a sekce</h5></a></li>
<li><a href="oblastni-rozdeleni.html"><h5>Oblastní rozdělení</h5></a></li>
<li><a href="partneri.html"><h5>Partneři</h5></a></li>
<li><a href="pro-media.html"><h5>Pro média</h5></a></li>
<li><a href="mezinarodni-organizace.html"><h5>Mezinárodní organizace</h5></a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle disabled" data-toggle="dropdown"> Turistika</a>
<ul class="dropdown-menu">
<li><a href="aktivity.html"><h5>Aktivity</h5></a></li>
<li><a href="znaceni.html"><h5>Značení</h5></a></li>
<li><a href="turisticke-mapy.html"><h5>Turistické mapy</h5></a></li>
<li><a href="publikace.html"><h5>Publikace</h5></a></li>
<li><a href="turisticke-chaty.html"><h5>Turistické chaty</h5></a></li>
<li><a href="vzdelavani.html"><h5>Vzdělávání</h5></a></li>
<li><a href="nase-projekty.html"><h5>Naše projekty</h5></a></li>
<li><a href="tipy-na-vylet.html"><h5>Tipy na výlet</h5></a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle disabled" data-toggle="dropdown"> Členství</a>
<ul class="dropdown-menu">
<li><a href="jak-se-stat-clenem.html"><h5>Jak se stát členem</h5></a></li>
<li><a href="vyhody-a-slevy.html"><h5>Výhody a slevy</h5></a></li>
<li><a href="eurobeds.html"><h5>Eurobeds</h5></a></li>
<li><a href="podporovatel-klubu.html"><h5>Podporovatel klubu</h5></a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle disabled" data-toggle="dropdown"> Kontakty</a>
<ul class="dropdown-menu">
<li><a href="kontaktni-informace.html"><h5>Kontaktní informace</h5></a></li>
<li><a href="infocentrum.html"><h5>Infocentrum</h5></a></li>
<li><a href="casto-kladene-otazky.html"><h5>Často kladené otázky</h5></a></li>
</ul>
</li>
<li><a href="http://turiblog.esy.es"> Blog »</a></li>
<li><a href="http://eshop.kct.cz/"> E-shop »</a></li>
</ul>
<!-- Right side -->
<ul class="nav navbar-nav navbar-right">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="glyphicon glyphicon-search"></i></a>
<ul class="dropdown-menu">
<form class="form-inline">
<input type="text" class="form-control" placeholder="Search">
<button type="submit" class="btn btn-info"><i class="glyphicon glyphicon-search"></i></button>
</form>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-user"></i><span class="hidden-sm hidden-md"> Login</span></a>
<ul class="dropdown-menu">
<li><a target="_blank" href="http://www.kct.cz/datovysklad/servis/login.php"><h5>Datový sklad</h5></a></li>
<li><a target="_blank" href="https://www.kct.cz/evidencekct/sign/in"><h5>Členská evidence</h5></a></li>
<li><a target="_blank" href="http://trasy.kct.cz/"><h5>Hledání značených tras</h5></a></li>
<li class="divider"></li>
<li><a href="http://www.kct.cz/cms/user"><h5><i class="fa fa-sign-out"></i> Login</h5></a></li>
</ul>
</li>
</ul>
<!-- /.navbar-collapse -->
</div>
</nav>
</div>
<!-- Navigation End -->
<!-- Crumbles -->
<!-- Zakladni obsah-->
<div class="container page turisticke-mapy">
<div class="col-xs-12 col-sm-12 col-md-9 col-lg-9">
<h1 class="page-content">Turistické mapy</h1>
<ol class="breadcrumb">
<li><a href="index.html">Domů</a></li>
<li class="active">Turistika</li>
<li class="active">Turistické mapy</li>
</ol>
<hr>
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 main-img"></div>
<p>V roce 1991 se Klub českých turistů stal po 42 letech opět vydavatelem turistických map. Již vydané tituly vycházejí v opakovaných vydáních tak, aby trh byl stále uspokojován aktualizovanými mapami.
<br> Edice map KČT pokrývá celé území ČR. Má jednotné měřítko 1:50 000, jednotný obsah i formu. Kartografický podklad tvoří mapy Zeměměřického úřadu.
<br> Klad listů a koncepci zpracovali značkaři KČT spolu s dalšími odborníky. Turistický obsah mapy sestává z turistických značených tras, ze značek, které znázorňují turisticko-vlastivědnou náplň, a z doprovodných textů.
<br> V současné době se na trhu vyskytují turistické mapy jiných vydavatelů téhož měřítka. Upozorňujeme turistickou veřejnost, že průběhy turistických značených tras nejsou v těchto mapách zpracovány podle aktualizovaných podkladů Klubu českých turistů a mohou vykazovat oproti našim mapám a hlavně oproti skutečnosti v terénu menší či větší rozdíly.
<br> Turistické mapy KČT obsahují kromě značených pěších tras také cyklotrasy a lyžařské běžecké trasy. Jsou tak vhodné nejen pro pěší turistiku ale také pro cykloturistiku a lyžařskou turistiku.
<br> Kromě papírových map jsou v nabídce vydavatelství Trasa také laminované mapy.</p>
<!-- Mapy prodej-->
<h2 class="page-content-section">Prodej map</h2>
<p>Všechny vydané tituly jsou v prodeji poměrně snadno dostupné, ve většině knihkupectví, v různých internetových obchodech – pro členy KČT se dají koupit za mimořádně výhodné ceny přímo u společnosti <a href="http://www.trasa.cz" target="_blank">TRASA</a> (zhotovitel map), v našem <a href="http://eshop.kct.cz" target="_blank">e-shopu</a>, v turistickém infocentru KČT v Praze 2, u regionálních prodejců a na oblastních sekretariátech KČT, pokud si je nechávají posílat. S kartou <a href="vyhody-a-slevy.html">EUROBEDS</a> můžete získat slevu při nákupu turistické mapy KČT ve výši cca 20% oproti běžné prodejní ceně. Běžné papírové mapy jsou pro členy KČT za cenu 75 Kč (běžná cena 99 Kč). U <a href="http://www.trasa.cz" target="_blank">Trasy</a> je možné si objednat také laminované mapy, které mají mnohem větší životnost (nedají se roztrhnout, odolají dešti) za cenu 118 Kč (běžná cena 139 Kč).</p>
<ul>
<p class="stronger">Kde lze mapy zakoupit:</p>
<li>
<p>Turistické infocentrum, Fügnerovo nám. 3, Praha 2</p>
</li>
<li>
<p>Společnost TRASA, spol. s r. o., Seydlerova 2451, Praha 5,<i class="glyphicon glyphicon-earphone"></i> 222 231 990,
<br><a href="mailto: [email protected]">[email protected]</a>, <a href="http://www.trasa.cz" target="_blank">www.trasa.cz</a></p>
</li>
<li>
<p>Regionalní prodejci</p>
</li>
<li>
<p>Ing. Ivan Press, Praha, <i class="glyphicon glyphicon-earphone"></i> 736 754 110, 284 690 136,
<br> <a href="mailto:[email protected]">[email protected]</a></p>
</li>
<li>
<p>Zdeněk Cabalka, Brno, <i class="glyphicon glyphicon-earphone"></i> 602 546 111, 546 215 814,
<br><a href="mailto:[email protected]">[email protected]</a>, <a href="http://www.mapycabalka.cz" target="_blank">www.mapycabalka.cz</a></p>
</li>
<li>
<p>Oblastní sekretariáty KČT</p>
</li>
</ul>
</div>
<!-- Col9 Zakladni obsah-->
<!-- Pravá strana -->
<div class="hidden-xs hidden-sm col-md-3 col-lg-3 page-sidebar">
<div class="list-group">
<a href="#" class="list-group-item">
<img src="img/thumbnail.jpg" class="img-responsive" alt="...">
<h4 class="list-group-item-heading">List group item heading</h4>
<p class="list-group-item-text">Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.</p>
</a>
<a href="#" class="list-group-item">
<img src="img/thumbnail.jpg" class="img-responsive" alt="...">
<h4 class="list-group-item-heading">List group item heading</h4>
<p class="list-group-item-text">Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.</p>
</a>
<a href="#" class="list-group-item">
<img src="img/thumbnail.jpg" class="img-responsive" alt="...">
<h4 class="list-group-item-heading">List group item heading</h4>
<p class="list-group-item-text">Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.</p>
</a>
<a href="#" class="list-group-item">
<img src="img/thumbnail.jpg" class="img-responsive" alt="...">
<h4 class="list-group-item-heading">List group item heading</h4>
<p class="list-group-item-text">Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.</p>
</a>
</div>
</div>
<!-- Pravá strana -->
</div>
<!-- Container-->
<!-- PartnersBottom -->
<div class="container-fluid partners-section">
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 logoPanel">
<h4 class="smallSection">Děkujeme našim partnerům</h4>
<div class="col-xs-6 col-md-2 col-sm-3 col-lg-2 itemLogo">
<a href="#"><img src="img/bottom_logo_cov.png" class="img responsive" alt="Český olympijský výbor"></a>
</div>
<div class="col-xs-6 col-md-2 col-sm-3 col-lg-2 itemLogo">
<a href="#"><img src="img/bottom_logo_msmt.png" class="img responsive" alt="Ministerstvo školství, mládeže a tělovýchovy"></a>
</div>
<div class="col-xs-6 col-md-2 col-sm-3 col-lg-2 itemLogo">
<a href="#"><img src="img/bottom_logo_tz.png" class="img responsive" alt="Turistické známky"></a>
</div>
<div class="col-xs-6 col-md-2 col-sm-3 col-lg-2 itemLogo">
<a href="#"><img src="img/bottom_logo_hame.jpg" class="img responsive" alt="Hamé"></a>
</div>
<div class="col-xs-6 col-md-2 col-sm-3 col-lg-2 col-sm-push-3 col-md-push-0 itemLogo">
<a href="#"><img src="img/boco_logo.png" class="img responsive" alt="BO CO spol. s r.o."></a>
</div>
<div class="col-xs-6 col-md-2 col-sm-3 col-lg-2 col-sm-push-3 col-md-push-0 itemLogo">
<a href="#"><img src="img/bottom_logo_mzp.png" class="img responsive" alt="Ministerstvo životního prostředí"></a>
</div>
</div>
</div>
<!-- Footer -->
<footer>
<div class="container footernav">
<div class="col-xs-12 col-md-4 col-sm-6 col-lg-4">
<h4 class="mainSection"><i class="fa fa-angle-right"></i> Mohlo by vás zajímat</h4>
<ul class="navTips">
<li>
<a href="#">
<i class="fa fa-calendar fa-2x"></i>
<h5>Kalendář turistických akcí</h5>
</a>
</li>
<li>
<a href="#">
<i class="fa fa-group fa-2x"></i>
<h5>Projekty</h5>
</a>
</li>
<li>
<a href="#">
<i class="fa fa-child fa-2x"></i>
<h5>Členství</h5>
</a>
</li>
<li>
<a href="#">
<i class="fa fa-map fa-2x"></i>
<h5>Turistické mapy</h5>
</a>
</li>
<li>
<a href="#">
<i class="fa fa-home fa-2x"></i>
<h5>Turistické chaty</h5>
</a>
</li>
<li>
<a href="#">
<i class="fa fa-map-marker fa-2x"></i>
<h5>Tipy na výlety</h5>
</a>
</li>
</ul>
</div>
<div class="col-xs-12 col-md-4 col-sm-6 col-lg-4 contacts">
<h4 class="mainSection"><i class="fa fa-angle-right"></i> Klub českých turistů</h4>
<ul>
<li>
<h5>Revoluční 1056/8a, 110 05 Praha 1</h5>
<a href="#">
<button type="button" class="btn btn-info" aria-label="Left Align">
<span class="fa fa-angle-double-right" aria-hidden="true"></span> Zobrazit na mapě
</button>
</a>
</li>
<li>
<h5>PO BOX 37</h5>
</li>
<li>
<h5>IČO: 00505609</h5>
</li>
<li>
<a href="tel:+420251610181"><h5><i class="fa fa-phone fa-2x"></i> 251 610 181</h5></a>
</li>
<li>
<a href="mailto:[email protected]"><h5><i class="fa fa-envelope-o fa-2x"></i> [email protected]</h5></a>
</li>
</ul>
</div>
<div class="col-xs-12 col-md-4 col-sm-6 col-lg-4 contacts">
<h4 class="mainSection"><i class="fa fa-angle-right"></i> Informační centrum</h4>
<ul>
<li>
<h5>Fügnerovo náměstí 3, 120 00 Praha 2</h5>
<a href="#">
<button type="button" class="btn btn-info" aria-label="Left Align">
<span class="fa fa-angle-double-right" aria-hidden="true"></span> Zobrazit na mapě
</button>
</a>
</li>
<li>
<h5>Otevírací doba:</h5>
</li>
<li>
<h5>Pondělí až čtvrtek: 10:00-18:00 hodin</h5>
</li>
<li>
<a href="tel:+420251610181"><h5><i class="fa fa-phone fa-2x"></i> 224 498 355</a><a href="tel:+420251610181"><h5><i class="fa fa-phone fa-2x"></i> 736 754 030</h5></a>
</li>
<li>
<a href="mailto:[email protected]"><h5><i class="fa fa-envelope-o fa-2x"></i> [email protected]</h5></a>
</li>
</ul>
</div>
</div>
<p class="copyright"><a href="#">Mapa stránek</a><span class="pull-right"><i class="fa fa-copyright"></i> 2016 Klub českých turistů</span></p>
</footer>
<!-- Modal gallery -->
<div class="modal" id="modal-gallery" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button class="close" type="button" data-dismiss="modal">×</button>
</div>
<div class="modal-body">
<div id="modal-carousel" class="carousel">
<div class="carousel-inner">
</div>
<a class="carousel-control left" href="#modal-carousel" data-slide="prev"><i class="glyphicon glyphicon-chevron-left"></i></a>
<a class="carousel-control right" href="#modal-carousel" data-slide="next"><i class="glyphicon glyphicon-chevron-right"></i></a>
</div>
</div>
<div class="modal-footer">
<h5 class="modal-title"></h5>
</div>
</div>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<!-- Disabled links in nav (remove for mobile)-->
<!-- Disabled links in nav (remove for mobile)-->
<script>
jQuery(document).ready(function($) {
$a = $('.dropdown-toggle.disabled');
if ($(window).width() < 768) {
$a.removeClass('disabled');
}
});
</script>
<!-- Disabled links in nav (remove for mobile)-->
<script>
$(window).on('resize', function() {
$a = $('.dropdown-toggle.disabled');
if ($(window).width() < 768) {
$a.removeClass('disabled');
}
});
</script>
<!-- Photogallery -->
<script>
$(document).ready(function() {
/* activate the carousel */
$("#modal-carousel").carousel({
interval: false
});
/* change modal title when slide changes */
$("#modal-carousel").on("slid.bs.carousel", function() {
$(".modal-title")
.html($(this)
.find(".active img")
.attr("title"));
});
/* when clicking a thumbnail */
$(".row .thumbnail").click(function() {
var content = $(".carousel-inner");
var title = $(".modal-title");
content.empty();
title.empty();
var id = this.id;
var repo = $("#img-repo .item");
var repoCopy = repo.filter("#" + id).clone();
var active = repoCopy.first();
active.addClass("active");
title.html(active.find("img").attr("title"));
content.append(repoCopy);
// show the modal
$("#modal-gallery").modal("show");
});
});
</script>
<!-- Navbar sticky -->
<!-- Navbar sticky -->
<script>
$(document).ready(function() {
if ($(window).width() > 768) {
var sticky = document.getElementById("navbar-main"),
sticky2 = sticky.cloneNode(true);
sticky2.style.position = "fixed";
document.body.appendChild(sticky2);
function stickIt() {
sticky2.style.visibility = sticky.getBoundingClientRect().top < 0 ? "visible" : "hidden";
}
stickIt();
window.addEventListener("scroll", stickIt, false);
}
}());
</script>
<script>
$(document).ready(function() {
function toggleNavbarMethod() {
if ($(window).width() > 768) {
$('.navbar .dropdown').on('mouseover', function() {
$('.dropdown-toggle', this).trigger('click');
}).on('mouseout', function() {
$('.dropdown-toggle', this).trigger('click').blur();
});
} else {
$('.navbar .dropdown').off('mouseover').off('mouseout');
}
}
toggleNavbarMethod();
$(window).resize(toggleNavbarMethod);
});
</script>
</body>
</html>
| tereza-kubatova/KCT | turisticke-mapy.html | HTML | mit | 26,618 |
window.pdfMake = window.pdfMake || {}; window.pdfMake.fonts = {"PT_Serif-Caption-Web":{"italics":"PT_Serif-Caption-Web-Italic.ttf","normal":"PT_Serif-Caption-Web-Regular.ttf","bold":"PT_Serif-Caption-Web-Regular.ttf","bolditalics":"PT_Serif-Caption-Web-Regular.ttf"}}; | xErik/pdfmake-fonts-google | build/script/ofl-folder2/ptserifcaption.map.js | JavaScript | mit | 268 |
# coding: utf-8
"""
Nordigen Account Information Services API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: 2.0 (v2)
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import nordigen
from nordigen.models.paginated_end_user_agreement_list import PaginatedEndUserAgreementList # noqa: E501
from nordigen.rest import ApiException
class TestPaginatedEndUserAgreementList(unittest.TestCase):
"""PaginatedEndUserAgreementList unit test stubs"""
def setUp(self):
pass
def tearDown(self):
pass
def testPaginatedEndUserAgreementList(self):
"""Test PaginatedEndUserAgreementList"""
# FIXME: construct object with mandatory attributes with example values
# model = nordigen.models.paginated_end_user_agreement_list.PaginatedEndUserAgreementList() # noqa: E501
pass
if __name__ == '__main__':
unittest.main()
| ltowarek/budget-supervisor | third_party/nordigen/test/test_paginated_end_user_agreement_list.py | Python | mit | 1,067 |
<?php
/**
* @package framework
* @subpackage tests
*/
class OptionsetFieldTest extends SapphireTest {
public function testSetDisabledItems() {
$f = new OptionsetField(
'Test',
false,
array(0 => 'Zero', 1 => 'One')
);
$f->setDisabledItems(array(0));
$p = new CSSContentParser($f->Field());
$item0 = $p->getBySelector('#Test_0');
$item1 = $p->getBySelector('#Test_1');
$this->assertEquals(
(string)$item0[0]['disabled'],
'disabled'
);
$this->assertEquals(
(string)$item1[0]['disabled'],
''
);
}
}
| harrymule/nairobi-webportal | framework/tests/forms/OptionsetFieldTest.php | PHP | mit | 546 |
//
// SYLJScanQRCodeViewController.h
// SYLJQRCode
//
// Created by 刘俊 on 2017/1/10.
// Copyright © 2017年 刘俊. All rights reserved.
//
#import <UIKit/UIKit.h>
/**
二维码扫描控制器
*/
@interface SYLJScanQRCodeViewController : UIViewController
/**
实例化扫描控制器
@param completion 完成回调
@return 扫描控制器
*/
- (instancetype)initWithCompletion:(void (^)(NSString *stringValue))completion;
/**
实例化扫描控制器
@param cardName 名片字符串
@param avatar 头像图片
@param completion 完成回调
@return 扫描控制器
*/
- (instancetype)initWithCardName:(NSString *)cardName avatar:(UIImage *)avatar completion:(void (^)(NSString *stringValue))completion;
@end
| liujungithup131477/SYLJQRCode | SYLJQRCode/SYLJQRCode/SYLJScanner/SYLJScanQRCodeViewController.h | C | mit | 739 |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Bot.Connector;
using Microsoft.Bot.Builder.Dialogs;
using Microsoft.Bot.Builder.FormFlow;
using PomodoroBot.Models;
using Microsoft.WindowsAzure.Storage.Queue;
using Newtonsoft.Json;
namespace PomodoroBot.Command
{
public class HelpCommand : ICommand
{
public bool DoHandle(Message message)
{
return message.Text.ToLower() == "help";
}
public async Task<Message> Reply(Message message)
{
return message.CreateReplyMessage($"visit {Settings.Get("Help")}");
}
}
}
| kheiakiyama/pomodoro-bot | Command/HelpCommand.cs | C# | mit | 691 |
package io.iansoft.blockchain.web.rest;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
@Controller
public class ClientForwardController {
/**
* Forwards any unmapped paths (except those containing a period) to the client {@code index.html}.
* @return forward to client {@code index.html}.
*/
@GetMapping(value = "/**/{path:[^\\.]*}")
public String forward() {
return "forward:/";
}
}
| iansoftdev/all-blockchain | src/main/java/io/iansoft/blockchain/web/rest/ClientForwardController.java | Java | mit | 488 |
using System;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.Data.Common;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration;
using System.Xml;
using System.Xml.Serialization;
using SubSonic;
using SubSonic.Utilities;
namespace DalSic
{
/// <summary>
/// Strongly-typed collection for the MamAnatomiaPatologica class.
/// </summary>
[Serializable]
public partial class MamAnatomiaPatologicaCollection : ActiveList<MamAnatomiaPatologica, MamAnatomiaPatologicaCollection>
{
public MamAnatomiaPatologicaCollection() {}
/// <summary>
/// Filters an existing collection based on the set criteria. This is an in-memory filter
/// Thanks to developingchris for this!
/// </summary>
/// <returns>MamAnatomiaPatologicaCollection</returns>
public MamAnatomiaPatologicaCollection Filter()
{
for (int i = this.Count - 1; i > -1; i--)
{
MamAnatomiaPatologica o = this[i];
foreach (SubSonic.Where w in this.wheres)
{
bool remove = false;
System.Reflection.PropertyInfo pi = o.GetType().GetProperty(w.ColumnName);
if (pi.CanRead)
{
object val = pi.GetValue(o, null);
switch (w.Comparison)
{
case SubSonic.Comparison.Equals:
if (!val.Equals(w.ParameterValue))
{
remove = true;
}
break;
}
}
if (remove)
{
this.Remove(o);
break;
}
}
}
return this;
}
}
/// <summary>
/// This is an ActiveRecord class which wraps the MAM_AnatomiaPatologica table.
/// </summary>
[Serializable]
public partial class MamAnatomiaPatologica : ActiveRecord<MamAnatomiaPatologica>, IActiveRecord
{
#region .ctors and Default Settings
public MamAnatomiaPatologica()
{
SetSQLProps();
InitSetDefaults();
MarkNew();
}
private void InitSetDefaults() { SetDefaults(); }
public MamAnatomiaPatologica(bool useDatabaseDefaults)
{
SetSQLProps();
if(useDatabaseDefaults)
ForceDefaults();
MarkNew();
}
public MamAnatomiaPatologica(object keyID)
{
SetSQLProps();
InitSetDefaults();
LoadByKey(keyID);
}
public MamAnatomiaPatologica(string columnName, object columnValue)
{
SetSQLProps();
InitSetDefaults();
LoadByParam(columnName,columnValue);
}
protected static void SetSQLProps() { GetTableSchema(); }
#endregion
#region Schema and Query Accessor
public static Query CreateQuery() { return new Query(Schema); }
public static TableSchema.Table Schema
{
get
{
if (BaseSchema == null)
SetSQLProps();
return BaseSchema;
}
}
private static void GetTableSchema()
{
if(!IsSchemaInitialized)
{
//Schema declaration
TableSchema.Table schema = new TableSchema.Table("MAM_AnatomiaPatologica", TableType.Table, DataService.GetInstance("sicProvider"));
schema.Columns = new TableSchema.TableColumnCollection();
schema.SchemaName = @"dbo";
//columns
TableSchema.TableColumn colvarIdAnatomiaPatologica = new TableSchema.TableColumn(schema);
colvarIdAnatomiaPatologica.ColumnName = "idAnatomiaPatologica";
colvarIdAnatomiaPatologica.DataType = DbType.Int32;
colvarIdAnatomiaPatologica.MaxLength = 0;
colvarIdAnatomiaPatologica.AutoIncrement = true;
colvarIdAnatomiaPatologica.IsNullable = false;
colvarIdAnatomiaPatologica.IsPrimaryKey = true;
colvarIdAnatomiaPatologica.IsForeignKey = false;
colvarIdAnatomiaPatologica.IsReadOnly = false;
colvarIdAnatomiaPatologica.DefaultSetting = @"";
colvarIdAnatomiaPatologica.ForeignKeyTableName = "";
schema.Columns.Add(colvarIdAnatomiaPatologica);
TableSchema.TableColumn colvarIdPaciente = new TableSchema.TableColumn(schema);
colvarIdPaciente.ColumnName = "idPaciente";
colvarIdPaciente.DataType = DbType.Int32;
colvarIdPaciente.MaxLength = 0;
colvarIdPaciente.AutoIncrement = false;
colvarIdPaciente.IsNullable = false;
colvarIdPaciente.IsPrimaryKey = false;
colvarIdPaciente.IsForeignKey = false;
colvarIdPaciente.IsReadOnly = false;
colvarIdPaciente.DefaultSetting = @"((0))";
colvarIdPaciente.ForeignKeyTableName = "";
schema.Columns.Add(colvarIdPaciente);
TableSchema.TableColumn colvarEdad = new TableSchema.TableColumn(schema);
colvarEdad.ColumnName = "edad";
colvarEdad.DataType = DbType.Int32;
colvarEdad.MaxLength = 0;
colvarEdad.AutoIncrement = false;
colvarEdad.IsNullable = false;
colvarEdad.IsPrimaryKey = false;
colvarEdad.IsForeignKey = false;
colvarEdad.IsReadOnly = false;
colvarEdad.DefaultSetting = @"((0))";
colvarEdad.ForeignKeyTableName = "";
schema.Columns.Add(colvarEdad);
TableSchema.TableColumn colvarGanglioAxilar = new TableSchema.TableColumn(schema);
colvarGanglioAxilar.ColumnName = "ganglioAxilar";
colvarGanglioAxilar.DataType = DbType.Int32;
colvarGanglioAxilar.MaxLength = 0;
colvarGanglioAxilar.AutoIncrement = false;
colvarGanglioAxilar.IsNullable = false;
colvarGanglioAxilar.IsPrimaryKey = false;
colvarGanglioAxilar.IsForeignKey = false;
colvarGanglioAxilar.IsReadOnly = false;
colvarGanglioAxilar.DefaultSetting = @"";
colvarGanglioAxilar.ForeignKeyTableName = "";
schema.Columns.Add(colvarGanglioAxilar);
TableSchema.TableColumn colvarNoduloMama = new TableSchema.TableColumn(schema);
colvarNoduloMama.ColumnName = "noduloMama";
colvarNoduloMama.DataType = DbType.Int32;
colvarNoduloMama.MaxLength = 0;
colvarNoduloMama.AutoIncrement = false;
colvarNoduloMama.IsNullable = false;
colvarNoduloMama.IsPrimaryKey = false;
colvarNoduloMama.IsForeignKey = false;
colvarNoduloMama.IsReadOnly = false;
colvarNoduloMama.DefaultSetting = @"('')";
colvarNoduloMama.ForeignKeyTableName = "";
schema.Columns.Add(colvarNoduloMama);
TableSchema.TableColumn colvarMicrocalcificaciones = new TableSchema.TableColumn(schema);
colvarMicrocalcificaciones.ColumnName = "microcalcificaciones";
colvarMicrocalcificaciones.DataType = DbType.Int32;
colvarMicrocalcificaciones.MaxLength = 0;
colvarMicrocalcificaciones.AutoIncrement = false;
colvarMicrocalcificaciones.IsNullable = false;
colvarMicrocalcificaciones.IsPrimaryKey = false;
colvarMicrocalcificaciones.IsForeignKey = false;
colvarMicrocalcificaciones.IsReadOnly = false;
colvarMicrocalcificaciones.DefaultSetting = @"((0))";
colvarMicrocalcificaciones.ForeignKeyTableName = "";
schema.Columns.Add(colvarMicrocalcificaciones);
TableSchema.TableColumn colvarPiel = new TableSchema.TableColumn(schema);
colvarPiel.ColumnName = "piel";
colvarPiel.DataType = DbType.Int32;
colvarPiel.MaxLength = 0;
colvarPiel.AutoIncrement = false;
colvarPiel.IsNullable = false;
colvarPiel.IsPrimaryKey = false;
colvarPiel.IsForeignKey = false;
colvarPiel.IsReadOnly = false;
colvarPiel.DefaultSetting = @"((0))";
colvarPiel.ForeignKeyTableName = "";
schema.Columns.Add(colvarPiel);
TableSchema.TableColumn colvarDerrame = new TableSchema.TableColumn(schema);
colvarDerrame.ColumnName = "derrame";
colvarDerrame.DataType = DbType.Int32;
colvarDerrame.MaxLength = 0;
colvarDerrame.AutoIncrement = false;
colvarDerrame.IsNullable = false;
colvarDerrame.IsPrimaryKey = false;
colvarDerrame.IsForeignKey = false;
colvarDerrame.IsReadOnly = false;
colvarDerrame.DefaultSetting = @"((0))";
colvarDerrame.ForeignKeyTableName = "";
schema.Columns.Add(colvarDerrame);
TableSchema.TableColumn colvarFechaTomaMuestra = new TableSchema.TableColumn(schema);
colvarFechaTomaMuestra.ColumnName = "fechaTomaMuestra";
colvarFechaTomaMuestra.DataType = DbType.DateTime;
colvarFechaTomaMuestra.MaxLength = 0;
colvarFechaTomaMuestra.AutoIncrement = false;
colvarFechaTomaMuestra.IsNullable = false;
colvarFechaTomaMuestra.IsPrimaryKey = false;
colvarFechaTomaMuestra.IsForeignKey = false;
colvarFechaTomaMuestra.IsReadOnly = false;
colvarFechaTomaMuestra.DefaultSetting = @"((0))";
colvarFechaTomaMuestra.ForeignKeyTableName = "";
schema.Columns.Add(colvarFechaTomaMuestra);
TableSchema.TableColumn colvarFechaRecepcionMuestra = new TableSchema.TableColumn(schema);
colvarFechaRecepcionMuestra.ColumnName = "fechaRecepcionMuestra";
colvarFechaRecepcionMuestra.DataType = DbType.DateTime;
colvarFechaRecepcionMuestra.MaxLength = 0;
colvarFechaRecepcionMuestra.AutoIncrement = false;
colvarFechaRecepcionMuestra.IsNullable = false;
colvarFechaRecepcionMuestra.IsPrimaryKey = false;
colvarFechaRecepcionMuestra.IsForeignKey = false;
colvarFechaRecepcionMuestra.IsReadOnly = false;
colvarFechaRecepcionMuestra.DefaultSetting = @"";
colvarFechaRecepcionMuestra.ForeignKeyTableName = "";
schema.Columns.Add(colvarFechaRecepcionMuestra);
TableSchema.TableColumn colvarFechaInformeMuestra = new TableSchema.TableColumn(schema);
colvarFechaInformeMuestra.ColumnName = "fechaInformeMuestra";
colvarFechaInformeMuestra.DataType = DbType.DateTime;
colvarFechaInformeMuestra.MaxLength = 0;
colvarFechaInformeMuestra.AutoIncrement = false;
colvarFechaInformeMuestra.IsNullable = false;
colvarFechaInformeMuestra.IsPrimaryKey = false;
colvarFechaInformeMuestra.IsForeignKey = false;
colvarFechaInformeMuestra.IsReadOnly = false;
colvarFechaInformeMuestra.DefaultSetting = @"";
colvarFechaInformeMuestra.ForeignKeyTableName = "";
schema.Columns.Add(colvarFechaInformeMuestra);
TableSchema.TableColumn colvarNumeroIngreso = new TableSchema.TableColumn(schema);
colvarNumeroIngreso.ColumnName = "numeroIngreso";
colvarNumeroIngreso.DataType = DbType.AnsiString;
colvarNumeroIngreso.MaxLength = 20;
colvarNumeroIngreso.AutoIncrement = false;
colvarNumeroIngreso.IsNullable = false;
colvarNumeroIngreso.IsPrimaryKey = false;
colvarNumeroIngreso.IsForeignKey = false;
colvarNumeroIngreso.IsReadOnly = false;
colvarNumeroIngreso.DefaultSetting = @"('')";
colvarNumeroIngreso.ForeignKeyTableName = "";
schema.Columns.Add(colvarNumeroIngreso);
TableSchema.TableColumn colvarIdResponsableMuestra = new TableSchema.TableColumn(schema);
colvarIdResponsableMuestra.ColumnName = "idResponsableMuestra";
colvarIdResponsableMuestra.DataType = DbType.Int32;
colvarIdResponsableMuestra.MaxLength = 0;
colvarIdResponsableMuestra.AutoIncrement = false;
colvarIdResponsableMuestra.IsNullable = false;
colvarIdResponsableMuestra.IsPrimaryKey = false;
colvarIdResponsableMuestra.IsForeignKey = true;
colvarIdResponsableMuestra.IsReadOnly = false;
colvarIdResponsableMuestra.DefaultSetting = @"((0))";
colvarIdResponsableMuestra.ForeignKeyTableName = "Sys_Profesional";
schema.Columns.Add(colvarIdResponsableMuestra);
TableSchema.TableColumn colvarIdCentroSaludMuestra = new TableSchema.TableColumn(schema);
colvarIdCentroSaludMuestra.ColumnName = "idCentroSaludMuestra";
colvarIdCentroSaludMuestra.DataType = DbType.Int32;
colvarIdCentroSaludMuestra.MaxLength = 0;
colvarIdCentroSaludMuestra.AutoIncrement = false;
colvarIdCentroSaludMuestra.IsNullable = false;
colvarIdCentroSaludMuestra.IsPrimaryKey = false;
colvarIdCentroSaludMuestra.IsForeignKey = true;
colvarIdCentroSaludMuestra.IsReadOnly = false;
colvarIdCentroSaludMuestra.DefaultSetting = @"((0))";
colvarIdCentroSaludMuestra.ForeignKeyTableName = "Sys_Efector";
schema.Columns.Add(colvarIdCentroSaludMuestra);
TableSchema.TableColumn colvarIdDiagnosticoCitologico = new TableSchema.TableColumn(schema);
colvarIdDiagnosticoCitologico.ColumnName = "idDiagnosticoCitologico";
colvarIdDiagnosticoCitologico.DataType = DbType.Int32;
colvarIdDiagnosticoCitologico.MaxLength = 0;
colvarIdDiagnosticoCitologico.AutoIncrement = false;
colvarIdDiagnosticoCitologico.IsNullable = false;
colvarIdDiagnosticoCitologico.IsPrimaryKey = false;
colvarIdDiagnosticoCitologico.IsForeignKey = true;
colvarIdDiagnosticoCitologico.IsReadOnly = false;
colvarIdDiagnosticoCitologico.DefaultSetting = @"((0))";
colvarIdDiagnosticoCitologico.ForeignKeyTableName = "MAM_DiagnosticoCitologico";
schema.Columns.Add(colvarIdDiagnosticoCitologico);
TableSchema.TableColumn colvarIdDiagnosticoHistologico = new TableSchema.TableColumn(schema);
colvarIdDiagnosticoHistologico.ColumnName = "idDiagnosticoHistologico";
colvarIdDiagnosticoHistologico.DataType = DbType.Int32;
colvarIdDiagnosticoHistologico.MaxLength = 0;
colvarIdDiagnosticoHistologico.AutoIncrement = false;
colvarIdDiagnosticoHistologico.IsNullable = false;
colvarIdDiagnosticoHistologico.IsPrimaryKey = false;
colvarIdDiagnosticoHistologico.IsForeignKey = true;
colvarIdDiagnosticoHistologico.IsReadOnly = false;
colvarIdDiagnosticoHistologico.DefaultSetting = @"((0))";
colvarIdDiagnosticoHistologico.ForeignKeyTableName = "MAM_DiagnoticoHistologico";
schema.Columns.Add(colvarIdDiagnosticoHistologico);
TableSchema.TableColumn colvarFechaInforme = new TableSchema.TableColumn(schema);
colvarFechaInforme.ColumnName = "fechaInforme";
colvarFechaInforme.DataType = DbType.DateTime;
colvarFechaInforme.MaxLength = 0;
colvarFechaInforme.AutoIncrement = false;
colvarFechaInforme.IsNullable = false;
colvarFechaInforme.IsPrimaryKey = false;
colvarFechaInforme.IsForeignKey = false;
colvarFechaInforme.IsReadOnly = false;
colvarFechaInforme.DefaultSetting = @"('')";
colvarFechaInforme.ForeignKeyTableName = "";
schema.Columns.Add(colvarFechaInforme);
TableSchema.TableColumn colvarIdResponsableInforme = new TableSchema.TableColumn(schema);
colvarIdResponsableInforme.ColumnName = "idResponsableInforme";
colvarIdResponsableInforme.DataType = DbType.Int32;
colvarIdResponsableInforme.MaxLength = 0;
colvarIdResponsableInforme.AutoIncrement = false;
colvarIdResponsableInforme.IsNullable = false;
colvarIdResponsableInforme.IsPrimaryKey = false;
colvarIdResponsableInforme.IsForeignKey = true;
colvarIdResponsableInforme.IsReadOnly = false;
colvarIdResponsableInforme.DefaultSetting = @"((0))";
colvarIdResponsableInforme.ForeignKeyTableName = "Sys_Profesional";
schema.Columns.Add(colvarIdResponsableInforme);
TableSchema.TableColumn colvarIdCentroSaludInforme = new TableSchema.TableColumn(schema);
colvarIdCentroSaludInforme.ColumnName = "idCentroSaludInforme";
colvarIdCentroSaludInforme.DataType = DbType.Int32;
colvarIdCentroSaludInforme.MaxLength = 0;
colvarIdCentroSaludInforme.AutoIncrement = false;
colvarIdCentroSaludInforme.IsNullable = false;
colvarIdCentroSaludInforme.IsPrimaryKey = false;
colvarIdCentroSaludInforme.IsForeignKey = true;
colvarIdCentroSaludInforme.IsReadOnly = false;
colvarIdCentroSaludInforme.DefaultSetting = @"((0))";
colvarIdCentroSaludInforme.ForeignKeyTableName = "Sys_Efector";
schema.Columns.Add(colvarIdCentroSaludInforme);
TableSchema.TableColumn colvarObservaciones = new TableSchema.TableColumn(schema);
colvarObservaciones.ColumnName = "observaciones";
colvarObservaciones.DataType = DbType.AnsiString;
colvarObservaciones.MaxLength = 1000;
colvarObservaciones.AutoIncrement = false;
colvarObservaciones.IsNullable = false;
colvarObservaciones.IsPrimaryKey = false;
colvarObservaciones.IsForeignKey = false;
colvarObservaciones.IsReadOnly = false;
colvarObservaciones.DefaultSetting = @"('')";
colvarObservaciones.ForeignKeyTableName = "";
schema.Columns.Add(colvarObservaciones);
TableSchema.TableColumn colvarActivo = new TableSchema.TableColumn(schema);
colvarActivo.ColumnName = "activo";
colvarActivo.DataType = DbType.Boolean;
colvarActivo.MaxLength = 0;
colvarActivo.AutoIncrement = false;
colvarActivo.IsNullable = false;
colvarActivo.IsPrimaryKey = false;
colvarActivo.IsForeignKey = false;
colvarActivo.IsReadOnly = false;
colvarActivo.DefaultSetting = @"((1))";
colvarActivo.ForeignKeyTableName = "";
schema.Columns.Add(colvarActivo);
TableSchema.TableColumn colvarCreatedBy = new TableSchema.TableColumn(schema);
colvarCreatedBy.ColumnName = "CreatedBy";
colvarCreatedBy.DataType = DbType.String;
colvarCreatedBy.MaxLength = 50;
colvarCreatedBy.AutoIncrement = false;
colvarCreatedBy.IsNullable = false;
colvarCreatedBy.IsPrimaryKey = false;
colvarCreatedBy.IsForeignKey = false;
colvarCreatedBy.IsReadOnly = false;
colvarCreatedBy.DefaultSetting = @"('')";
colvarCreatedBy.ForeignKeyTableName = "";
schema.Columns.Add(colvarCreatedBy);
TableSchema.TableColumn colvarCreatedOn = new TableSchema.TableColumn(schema);
colvarCreatedOn.ColumnName = "CreatedOn";
colvarCreatedOn.DataType = DbType.DateTime;
colvarCreatedOn.MaxLength = 0;
colvarCreatedOn.AutoIncrement = false;
colvarCreatedOn.IsNullable = false;
colvarCreatedOn.IsPrimaryKey = false;
colvarCreatedOn.IsForeignKey = false;
colvarCreatedOn.IsReadOnly = false;
colvarCreatedOn.DefaultSetting = @"(((1)/(1))/(1900))";
colvarCreatedOn.ForeignKeyTableName = "";
schema.Columns.Add(colvarCreatedOn);
TableSchema.TableColumn colvarModifiedBy = new TableSchema.TableColumn(schema);
colvarModifiedBy.ColumnName = "ModifiedBy";
colvarModifiedBy.DataType = DbType.String;
colvarModifiedBy.MaxLength = 50;
colvarModifiedBy.AutoIncrement = false;
colvarModifiedBy.IsNullable = false;
colvarModifiedBy.IsPrimaryKey = false;
colvarModifiedBy.IsForeignKey = false;
colvarModifiedBy.IsReadOnly = false;
colvarModifiedBy.DefaultSetting = @"('')";
colvarModifiedBy.ForeignKeyTableName = "";
schema.Columns.Add(colvarModifiedBy);
TableSchema.TableColumn colvarModifiedOn = new TableSchema.TableColumn(schema);
colvarModifiedOn.ColumnName = "ModifiedOn";
colvarModifiedOn.DataType = DbType.DateTime;
colvarModifiedOn.MaxLength = 0;
colvarModifiedOn.AutoIncrement = false;
colvarModifiedOn.IsNullable = false;
colvarModifiedOn.IsPrimaryKey = false;
colvarModifiedOn.IsForeignKey = false;
colvarModifiedOn.IsReadOnly = false;
colvarModifiedOn.DefaultSetting = @"(((1)/(1))/(1900))";
colvarModifiedOn.ForeignKeyTableName = "";
schema.Columns.Add(colvarModifiedOn);
TableSchema.TableColumn colvarGuia = new TableSchema.TableColumn(schema);
colvarGuia.ColumnName = "guia";
colvarGuia.DataType = DbType.AnsiString;
colvarGuia.MaxLength = 20;
colvarGuia.AutoIncrement = false;
colvarGuia.IsNullable = false;
colvarGuia.IsPrimaryKey = false;
colvarGuia.IsForeignKey = false;
colvarGuia.IsReadOnly = false;
colvarGuia.DefaultSetting = @"('')";
colvarGuia.ForeignKeyTableName = "";
schema.Columns.Add(colvarGuia);
TableSchema.TableColumn colvarMetodo = new TableSchema.TableColumn(schema);
colvarMetodo.ColumnName = "metodo";
colvarMetodo.DataType = DbType.AnsiString;
colvarMetodo.MaxLength = 20;
colvarMetodo.AutoIncrement = false;
colvarMetodo.IsNullable = false;
colvarMetodo.IsPrimaryKey = false;
colvarMetodo.IsForeignKey = false;
colvarMetodo.IsReadOnly = false;
colvarMetodo.DefaultSetting = @"('')";
colvarMetodo.ForeignKeyTableName = "";
schema.Columns.Add(colvarMetodo);
BaseSchema = schema;
//add this schema to the provider
//so we can query it later
DataService.Providers["sicProvider"].AddSchema("MAM_AnatomiaPatologica",schema);
}
}
#endregion
#region Props
[XmlAttribute("IdAnatomiaPatologica")]
[Bindable(true)]
public int IdAnatomiaPatologica
{
get { return GetColumnValue<int>(Columns.IdAnatomiaPatologica); }
set { SetColumnValue(Columns.IdAnatomiaPatologica, value); }
}
[XmlAttribute("IdPaciente")]
[Bindable(true)]
public int IdPaciente
{
get { return GetColumnValue<int>(Columns.IdPaciente); }
set { SetColumnValue(Columns.IdPaciente, value); }
}
[XmlAttribute("Edad")]
[Bindable(true)]
public int Edad
{
get { return GetColumnValue<int>(Columns.Edad); }
set { SetColumnValue(Columns.Edad, value); }
}
[XmlAttribute("GanglioAxilar")]
[Bindable(true)]
public int GanglioAxilar
{
get { return GetColumnValue<int>(Columns.GanglioAxilar); }
set { SetColumnValue(Columns.GanglioAxilar, value); }
}
[XmlAttribute("NoduloMama")]
[Bindable(true)]
public int NoduloMama
{
get { return GetColumnValue<int>(Columns.NoduloMama); }
set { SetColumnValue(Columns.NoduloMama, value); }
}
[XmlAttribute("Microcalcificaciones")]
[Bindable(true)]
public int Microcalcificaciones
{
get { return GetColumnValue<int>(Columns.Microcalcificaciones); }
set { SetColumnValue(Columns.Microcalcificaciones, value); }
}
[XmlAttribute("Piel")]
[Bindable(true)]
public int Piel
{
get { return GetColumnValue<int>(Columns.Piel); }
set { SetColumnValue(Columns.Piel, value); }
}
[XmlAttribute("Derrame")]
[Bindable(true)]
public int Derrame
{
get { return GetColumnValue<int>(Columns.Derrame); }
set { SetColumnValue(Columns.Derrame, value); }
}
[XmlAttribute("FechaTomaMuestra")]
[Bindable(true)]
public DateTime FechaTomaMuestra
{
get { return GetColumnValue<DateTime>(Columns.FechaTomaMuestra); }
set { SetColumnValue(Columns.FechaTomaMuestra, value); }
}
[XmlAttribute("FechaRecepcionMuestra")]
[Bindable(true)]
public DateTime FechaRecepcionMuestra
{
get { return GetColumnValue<DateTime>(Columns.FechaRecepcionMuestra); }
set { SetColumnValue(Columns.FechaRecepcionMuestra, value); }
}
[XmlAttribute("FechaInformeMuestra")]
[Bindable(true)]
public DateTime FechaInformeMuestra
{
get { return GetColumnValue<DateTime>(Columns.FechaInformeMuestra); }
set { SetColumnValue(Columns.FechaInformeMuestra, value); }
}
[XmlAttribute("NumeroIngreso")]
[Bindable(true)]
public string NumeroIngreso
{
get { return GetColumnValue<string>(Columns.NumeroIngreso); }
set { SetColumnValue(Columns.NumeroIngreso, value); }
}
[XmlAttribute("IdResponsableMuestra")]
[Bindable(true)]
public int IdResponsableMuestra
{
get { return GetColumnValue<int>(Columns.IdResponsableMuestra); }
set { SetColumnValue(Columns.IdResponsableMuestra, value); }
}
[XmlAttribute("IdCentroSaludMuestra")]
[Bindable(true)]
public int IdCentroSaludMuestra
{
get { return GetColumnValue<int>(Columns.IdCentroSaludMuestra); }
set { SetColumnValue(Columns.IdCentroSaludMuestra, value); }
}
[XmlAttribute("IdDiagnosticoCitologico")]
[Bindable(true)]
public int IdDiagnosticoCitologico
{
get { return GetColumnValue<int>(Columns.IdDiagnosticoCitologico); }
set { SetColumnValue(Columns.IdDiagnosticoCitologico, value); }
}
[XmlAttribute("IdDiagnosticoHistologico")]
[Bindable(true)]
public int IdDiagnosticoHistologico
{
get { return GetColumnValue<int>(Columns.IdDiagnosticoHistologico); }
set { SetColumnValue(Columns.IdDiagnosticoHistologico, value); }
}
[XmlAttribute("FechaInforme")]
[Bindable(true)]
public DateTime FechaInforme
{
get { return GetColumnValue<DateTime>(Columns.FechaInforme); }
set { SetColumnValue(Columns.FechaInforme, value); }
}
[XmlAttribute("IdResponsableInforme")]
[Bindable(true)]
public int IdResponsableInforme
{
get { return GetColumnValue<int>(Columns.IdResponsableInforme); }
set { SetColumnValue(Columns.IdResponsableInforme, value); }
}
[XmlAttribute("IdCentroSaludInforme")]
[Bindable(true)]
public int IdCentroSaludInforme
{
get { return GetColumnValue<int>(Columns.IdCentroSaludInforme); }
set { SetColumnValue(Columns.IdCentroSaludInforme, value); }
}
[XmlAttribute("Observaciones")]
[Bindable(true)]
public string Observaciones
{
get { return GetColumnValue<string>(Columns.Observaciones); }
set { SetColumnValue(Columns.Observaciones, value); }
}
[XmlAttribute("Activo")]
[Bindable(true)]
public bool Activo
{
get { return GetColumnValue<bool>(Columns.Activo); }
set { SetColumnValue(Columns.Activo, value); }
}
[XmlAttribute("CreatedBy")]
[Bindable(true)]
public string CreatedBy
{
get { return GetColumnValue<string>(Columns.CreatedBy); }
set { SetColumnValue(Columns.CreatedBy, value); }
}
[XmlAttribute("CreatedOn")]
[Bindable(true)]
public DateTime CreatedOn
{
get { return GetColumnValue<DateTime>(Columns.CreatedOn); }
set { SetColumnValue(Columns.CreatedOn, value); }
}
[XmlAttribute("ModifiedBy")]
[Bindable(true)]
public string ModifiedBy
{
get { return GetColumnValue<string>(Columns.ModifiedBy); }
set { SetColumnValue(Columns.ModifiedBy, value); }
}
[XmlAttribute("ModifiedOn")]
[Bindable(true)]
public DateTime ModifiedOn
{
get { return GetColumnValue<DateTime>(Columns.ModifiedOn); }
set { SetColumnValue(Columns.ModifiedOn, value); }
}
[XmlAttribute("Guia")]
[Bindable(true)]
public string Guia
{
get { return GetColumnValue<string>(Columns.Guia); }
set { SetColumnValue(Columns.Guia, value); }
}
[XmlAttribute("Metodo")]
[Bindable(true)]
public string Metodo
{
get { return GetColumnValue<string>(Columns.Metodo); }
set { SetColumnValue(Columns.Metodo, value); }
}
#endregion
#region ForeignKey Properties
/// <summary>
/// Returns a SysEfector ActiveRecord object related to this MamAnatomiaPatologica
///
/// </summary>
public DalSic.SysEfector SysEfector
{
get { return DalSic.SysEfector.FetchByID(this.IdCentroSaludInforme); }
set { SetColumnValue("idCentroSaludInforme", value.IdEfector); }
}
/// <summary>
/// Returns a SysEfector ActiveRecord object related to this MamAnatomiaPatologica
///
/// </summary>
public DalSic.SysEfector SysEfectorToIdCentroSaludMuestra
{
get { return DalSic.SysEfector.FetchByID(this.IdCentroSaludMuestra); }
set { SetColumnValue("idCentroSaludMuestra", value.IdEfector); }
}
/// <summary>
/// Returns a SysProfesional ActiveRecord object related to this MamAnatomiaPatologica
///
/// </summary>
public DalSic.SysProfesional SysProfesional
{
get { return DalSic.SysProfesional.FetchByID(this.IdResponsableMuestra); }
set { SetColumnValue("idResponsableMuestra", value.IdProfesional); }
}
/// <summary>
/// Returns a SysProfesional ActiveRecord object related to this MamAnatomiaPatologica
///
/// </summary>
public DalSic.SysProfesional SysProfesionalToIdResponsableInforme
{
get { return DalSic.SysProfesional.FetchByID(this.IdResponsableInforme); }
set { SetColumnValue("idResponsableInforme", value.IdProfesional); }
}
/// <summary>
/// Returns a MamDiagnoticoHistologico ActiveRecord object related to this MamAnatomiaPatologica
///
/// </summary>
public DalSic.MamDiagnoticoHistologico MamDiagnoticoHistologico
{
get { return DalSic.MamDiagnoticoHistologico.FetchByID(this.IdDiagnosticoHistologico); }
set { SetColumnValue("idDiagnosticoHistologico", value.IdDiagnosticoHistologico); }
}
/// <summary>
/// Returns a MamDiagnosticoCitologico ActiveRecord object related to this MamAnatomiaPatologica
///
/// </summary>
public DalSic.MamDiagnosticoCitologico MamDiagnosticoCitologico
{
get { return DalSic.MamDiagnosticoCitologico.FetchByID(this.IdDiagnosticoCitologico); }
set { SetColumnValue("idDiagnosticoCitologico", value.IdDiagnosticoCitologico); }
}
#endregion
//no ManyToMany tables defined (0)
#region ObjectDataSource support
/// <summary>
/// Inserts a record, can be used with the Object Data Source
/// </summary>
public static void Insert(int varIdPaciente,int varEdad,int varGanglioAxilar,int varNoduloMama,int varMicrocalcificaciones,int varPiel,int varDerrame,DateTime varFechaTomaMuestra,DateTime varFechaRecepcionMuestra,DateTime varFechaInformeMuestra,string varNumeroIngreso,int varIdResponsableMuestra,int varIdCentroSaludMuestra,int varIdDiagnosticoCitologico,int varIdDiagnosticoHistologico,DateTime varFechaInforme,int varIdResponsableInforme,int varIdCentroSaludInforme,string varObservaciones,bool varActivo,string varCreatedBy,DateTime varCreatedOn,string varModifiedBy,DateTime varModifiedOn,string varGuia,string varMetodo)
{
MamAnatomiaPatologica item = new MamAnatomiaPatologica();
item.IdPaciente = varIdPaciente;
item.Edad = varEdad;
item.GanglioAxilar = varGanglioAxilar;
item.NoduloMama = varNoduloMama;
item.Microcalcificaciones = varMicrocalcificaciones;
item.Piel = varPiel;
item.Derrame = varDerrame;
item.FechaTomaMuestra = varFechaTomaMuestra;
item.FechaRecepcionMuestra = varFechaRecepcionMuestra;
item.FechaInformeMuestra = varFechaInformeMuestra;
item.NumeroIngreso = varNumeroIngreso;
item.IdResponsableMuestra = varIdResponsableMuestra;
item.IdCentroSaludMuestra = varIdCentroSaludMuestra;
item.IdDiagnosticoCitologico = varIdDiagnosticoCitologico;
item.IdDiagnosticoHistologico = varIdDiagnosticoHistologico;
item.FechaInforme = varFechaInforme;
item.IdResponsableInforme = varIdResponsableInforme;
item.IdCentroSaludInforme = varIdCentroSaludInforme;
item.Observaciones = varObservaciones;
item.Activo = varActivo;
item.CreatedBy = varCreatedBy;
item.CreatedOn = varCreatedOn;
item.ModifiedBy = varModifiedBy;
item.ModifiedOn = varModifiedOn;
item.Guia = varGuia;
item.Metodo = varMetodo;
if (System.Web.HttpContext.Current != null)
item.Save(System.Web.HttpContext.Current.User.Identity.Name);
else
item.Save(System.Threading.Thread.CurrentPrincipal.Identity.Name);
}
/// <summary>
/// Updates a record, can be used with the Object Data Source
/// </summary>
public static void Update(int varIdAnatomiaPatologica,int varIdPaciente,int varEdad,int varGanglioAxilar,int varNoduloMama,int varMicrocalcificaciones,int varPiel,int varDerrame,DateTime varFechaTomaMuestra,DateTime varFechaRecepcionMuestra,DateTime varFechaInformeMuestra,string varNumeroIngreso,int varIdResponsableMuestra,int varIdCentroSaludMuestra,int varIdDiagnosticoCitologico,int varIdDiagnosticoHistologico,DateTime varFechaInforme,int varIdResponsableInforme,int varIdCentroSaludInforme,string varObservaciones,bool varActivo,string varCreatedBy,DateTime varCreatedOn,string varModifiedBy,DateTime varModifiedOn,string varGuia,string varMetodo)
{
MamAnatomiaPatologica item = new MamAnatomiaPatologica();
item.IdAnatomiaPatologica = varIdAnatomiaPatologica;
item.IdPaciente = varIdPaciente;
item.Edad = varEdad;
item.GanglioAxilar = varGanglioAxilar;
item.NoduloMama = varNoduloMama;
item.Microcalcificaciones = varMicrocalcificaciones;
item.Piel = varPiel;
item.Derrame = varDerrame;
item.FechaTomaMuestra = varFechaTomaMuestra;
item.FechaRecepcionMuestra = varFechaRecepcionMuestra;
item.FechaInformeMuestra = varFechaInformeMuestra;
item.NumeroIngreso = varNumeroIngreso;
item.IdResponsableMuestra = varIdResponsableMuestra;
item.IdCentroSaludMuestra = varIdCentroSaludMuestra;
item.IdDiagnosticoCitologico = varIdDiagnosticoCitologico;
item.IdDiagnosticoHistologico = varIdDiagnosticoHistologico;
item.FechaInforme = varFechaInforme;
item.IdResponsableInforme = varIdResponsableInforme;
item.IdCentroSaludInforme = varIdCentroSaludInforme;
item.Observaciones = varObservaciones;
item.Activo = varActivo;
item.CreatedBy = varCreatedBy;
item.CreatedOn = varCreatedOn;
item.ModifiedBy = varModifiedBy;
item.ModifiedOn = varModifiedOn;
item.Guia = varGuia;
item.Metodo = varMetodo;
item.IsNew = false;
if (System.Web.HttpContext.Current != null)
item.Save(System.Web.HttpContext.Current.User.Identity.Name);
else
item.Save(System.Threading.Thread.CurrentPrincipal.Identity.Name);
}
#endregion
#region Typed Columns
public static TableSchema.TableColumn IdAnatomiaPatologicaColumn
{
get { return Schema.Columns[0]; }
}
public static TableSchema.TableColumn IdPacienteColumn
{
get { return Schema.Columns[1]; }
}
public static TableSchema.TableColumn EdadColumn
{
get { return Schema.Columns[2]; }
}
public static TableSchema.TableColumn GanglioAxilarColumn
{
get { return Schema.Columns[3]; }
}
public static TableSchema.TableColumn NoduloMamaColumn
{
get { return Schema.Columns[4]; }
}
public static TableSchema.TableColumn MicrocalcificacionesColumn
{
get { return Schema.Columns[5]; }
}
public static TableSchema.TableColumn PielColumn
{
get { return Schema.Columns[6]; }
}
public static TableSchema.TableColumn DerrameColumn
{
get { return Schema.Columns[7]; }
}
public static TableSchema.TableColumn FechaTomaMuestraColumn
{
get { return Schema.Columns[8]; }
}
public static TableSchema.TableColumn FechaRecepcionMuestraColumn
{
get { return Schema.Columns[9]; }
}
public static TableSchema.TableColumn FechaInformeMuestraColumn
{
get { return Schema.Columns[10]; }
}
public static TableSchema.TableColumn NumeroIngresoColumn
{
get { return Schema.Columns[11]; }
}
public static TableSchema.TableColumn IdResponsableMuestraColumn
{
get { return Schema.Columns[12]; }
}
public static TableSchema.TableColumn IdCentroSaludMuestraColumn
{
get { return Schema.Columns[13]; }
}
public static TableSchema.TableColumn IdDiagnosticoCitologicoColumn
{
get { return Schema.Columns[14]; }
}
public static TableSchema.TableColumn IdDiagnosticoHistologicoColumn
{
get { return Schema.Columns[15]; }
}
public static TableSchema.TableColumn FechaInformeColumn
{
get { return Schema.Columns[16]; }
}
public static TableSchema.TableColumn IdResponsableInformeColumn
{
get { return Schema.Columns[17]; }
}
public static TableSchema.TableColumn IdCentroSaludInformeColumn
{
get { return Schema.Columns[18]; }
}
public static TableSchema.TableColumn ObservacionesColumn
{
get { return Schema.Columns[19]; }
}
public static TableSchema.TableColumn ActivoColumn
{
get { return Schema.Columns[20]; }
}
public static TableSchema.TableColumn CreatedByColumn
{
get { return Schema.Columns[21]; }
}
public static TableSchema.TableColumn CreatedOnColumn
{
get { return Schema.Columns[22]; }
}
public static TableSchema.TableColumn ModifiedByColumn
{
get { return Schema.Columns[23]; }
}
public static TableSchema.TableColumn ModifiedOnColumn
{
get { return Schema.Columns[24]; }
}
public static TableSchema.TableColumn GuiaColumn
{
get { return Schema.Columns[25]; }
}
public static TableSchema.TableColumn MetodoColumn
{
get { return Schema.Columns[26]; }
}
#endregion
#region Columns Struct
public struct Columns
{
public static string IdAnatomiaPatologica = @"idAnatomiaPatologica";
public static string IdPaciente = @"idPaciente";
public static string Edad = @"edad";
public static string GanglioAxilar = @"ganglioAxilar";
public static string NoduloMama = @"noduloMama";
public static string Microcalcificaciones = @"microcalcificaciones";
public static string Piel = @"piel";
public static string Derrame = @"derrame";
public static string FechaTomaMuestra = @"fechaTomaMuestra";
public static string FechaRecepcionMuestra = @"fechaRecepcionMuestra";
public static string FechaInformeMuestra = @"fechaInformeMuestra";
public static string NumeroIngreso = @"numeroIngreso";
public static string IdResponsableMuestra = @"idResponsableMuestra";
public static string IdCentroSaludMuestra = @"idCentroSaludMuestra";
public static string IdDiagnosticoCitologico = @"idDiagnosticoCitologico";
public static string IdDiagnosticoHistologico = @"idDiagnosticoHistologico";
public static string FechaInforme = @"fechaInforme";
public static string IdResponsableInforme = @"idResponsableInforme";
public static string IdCentroSaludInforme = @"idCentroSaludInforme";
public static string Observaciones = @"observaciones";
public static string Activo = @"activo";
public static string CreatedBy = @"CreatedBy";
public static string CreatedOn = @"CreatedOn";
public static string ModifiedBy = @"ModifiedBy";
public static string ModifiedOn = @"ModifiedOn";
public static string Guia = @"guia";
public static string Metodo = @"metodo";
}
#endregion
#region Update PK Collections
#endregion
#region Deep Save
#endregion
}
}
| saludnqn/consultorio | DalSic/generated/MamAnatomiaPatologica.cs | C# | mit | 39,669 |
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\HttpKernel\Tests\ControllerMetadata;
use Fake\ImportedAndFake;
use PHPUnit\Framework\TestCase;
use Symfony\Component\HttpKernel\ControllerMetadata\ArgumentMetadata;
use Symfony\Component\HttpKernel\ControllerMetadata\ArgumentMetadataFactory;
use Symfony\Component\HttpKernel\Tests\Fixtures\Attribute\Foo;
use Symfony\Component\HttpKernel\Tests\Fixtures\Controller\AttributeController;
use Symfony\Component\HttpKernel\Tests\Fixtures\Controller\BasicTypesController;
use Symfony\Component\HttpKernel\Tests\Fixtures\Controller\NullableController;
use Symfony\Component\HttpKernel\Tests\Fixtures\Controller\VariadicController;
class ArgumentMetadataFactoryTest extends TestCase
{
/**
* @var ArgumentMetadataFactory
*/
private $factory;
protected function setUp(): void
{
$this->factory = new ArgumentMetadataFactory();
}
public function testSignature1()
{
$arguments = $this->factory->createArgumentMetadata([$this, 'signature1']);
$this->assertEquals([
new ArgumentMetadata('foo', self::class, false, false, null),
new ArgumentMetadata('bar', 'array', false, false, null),
new ArgumentMetadata('baz', 'callable', false, false, null),
], $arguments);
}
public function testSignature2()
{
$arguments = $this->factory->createArgumentMetadata([$this, 'signature2']);
$this->assertEquals([
new ArgumentMetadata('foo', self::class, false, true, null, true),
new ArgumentMetadata('bar', FakeClassThatDoesNotExist::class, false, true, null, true),
new ArgumentMetadata('baz', 'Fake\ImportedAndFake', false, true, null, true),
], $arguments);
}
public function testSignature3()
{
$arguments = $this->factory->createArgumentMetadata([$this, 'signature3']);
$this->assertEquals([
new ArgumentMetadata('bar', FakeClassThatDoesNotExist::class, false, false, null),
new ArgumentMetadata('baz', 'Fake\ImportedAndFake', false, false, null),
], $arguments);
}
public function testSignature4()
{
$arguments = $this->factory->createArgumentMetadata([$this, 'signature4']);
$this->assertEquals([
new ArgumentMetadata('foo', null, false, true, 'default'),
new ArgumentMetadata('bar', null, false, true, 500),
new ArgumentMetadata('baz', null, false, true, []),
], $arguments);
}
public function testSignature5()
{
$arguments = $this->factory->createArgumentMetadata([$this, 'signature5']);
$this->assertEquals([
new ArgumentMetadata('foo', 'array', false, true, null, true),
new ArgumentMetadata('bar', null, false, true, null, true),
], $arguments);
}
public function testVariadicSignature()
{
$arguments = $this->factory->createArgumentMetadata([new VariadicController(), 'action']);
$this->assertEquals([
new ArgumentMetadata('foo', null, false, false, null),
new ArgumentMetadata('bar', null, true, false, null),
], $arguments);
}
public function testBasicTypesSignature()
{
$arguments = $this->factory->createArgumentMetadata([new BasicTypesController(), 'action']);
$this->assertEquals([
new ArgumentMetadata('foo', 'string', false, false, null),
new ArgumentMetadata('bar', 'int', false, false, null),
new ArgumentMetadata('baz', 'float', false, false, null),
], $arguments);
}
public function testNamedClosure()
{
$arguments = $this->factory->createArgumentMetadata(\Closure::fromCallable([$this, 'signature1']));
$this->assertEquals([
new ArgumentMetadata('foo', self::class, false, false, null),
new ArgumentMetadata('bar', 'array', false, false, null),
new ArgumentMetadata('baz', 'callable', false, false, null),
], $arguments);
}
public function testNullableTypesSignature()
{
$arguments = $this->factory->createArgumentMetadata([new NullableController(), 'action']);
$this->assertEquals([
new ArgumentMetadata('foo', 'string', false, false, null, true),
new ArgumentMetadata('bar', \stdClass::class, false, false, null, true),
new ArgumentMetadata('baz', 'string', false, true, 'value', true),
new ArgumentMetadata('last', 'string', false, true, '', false),
], $arguments);
}
public function testAttributeSignature()
{
$arguments = $this->factory->createArgumentMetadata([new AttributeController(), 'action']);
$this->assertEquals([
new ArgumentMetadata('baz', 'string', false, false, null, false, [new Foo('bar')]),
], $arguments);
}
public function testMultipleAttributes()
{
$this->factory->createArgumentMetadata([new AttributeController(), 'multiAttributeArg']);
$this->assertCount(1, $this->factory->createArgumentMetadata([new AttributeController(), 'multiAttributeArg'])[0]->getAttributes());
}
public function testIssue41478()
{
$arguments = $this->factory->createArgumentMetadata([new AttributeController(), 'issue41478']);
$this->assertEquals([
new ArgumentMetadata('baz', 'string', false, false, null, false, [new Foo('bar')]),
new ArgumentMetadata('bat', 'string', false, false, null, false, []),
], $arguments);
}
private function signature1(self $foo, array $bar, callable $baz)
{
}
private function signature2(self $foo = null, FakeClassThatDoesNotExist $bar = null, ImportedAndFake $baz = null)
{
}
private function signature3(FakeClassThatDoesNotExist $bar, ImportedAndFake $baz)
{
}
private function signature4($foo = 'default', $bar = 500, $baz = [])
{
}
private function signature5(array $foo = null, $bar = null)
{
}
}
| mpdude/symfony | src/Symfony/Component/HttpKernel/Tests/ControllerMetadata/ArgumentMetadataFactoryTest.php | PHP | mit | 6,286 |
package com.emop.client;
import android.os.Bundle;
public class TaokeItemImageActivity extends BaseActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.taoke_item_images);
}
}
| emop/EmopAndroid | src/com/emop/client/TaokeItemImageActivity.java | Java | mit | 304 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2021-04-14 21:30
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('o2', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='csrftoken',
name='token',
field=models.CharField(max_length=128, unique=True),
),
]
| anselmobd/fo2 | src/o2/migrations/0002_csrftoken_unique.py | Python | mit | 452 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2017-10-05 20:10
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('periodicals', '0013_auto_20171005_1514'),
]
operations = [
migrations.AddField(
model_name='page',
name='height',
field=models.PositiveIntegerField(null=True),
),
migrations.AddField(
model_name='page',
name='width',
field=models.PositiveIntegerField(null=True),
),
]
| kingsdigitallab/mpol-django | periodicals/migrations/0014_auto_20171005_2110.py | Python | mit | 613 |
---
layout: post
title: "Welcome to Jekyll!"
date: 2015-12-06 10:31:52 +0100
categories: jekyll update
---
You’ll find this post in your `_posts` directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run `jekyll serve`, which launches a web server and auto-regenerates your site when a file is updated.
To add new posts, simply add a file in the `_posts` directory that follows the convention `YYYY-MM-DD-name-of-post.ext` and includes the necessary front matter. Take a look at the source for this post to get an idea about how it works.
Jekyll also offers powerful support for code snippets:
{% highlight ruby %}
def print_hi(name)
puts "Hi, #{name}"
end
print_hi('Tom')
#=> prints 'Hi, Tom' to STDOUT.
{% endhighlight %}
Check out the [Jekyll docs][jekyll-docs] for more info on how to get the most out of Jekyll. File all bugs/feature requests at [Jekyll’s GitHub repo][jekyll-gh]. If you have questions, you can ask them on [Jekyll Talk][jekyll-talk].
[jekyll-docs]: http://jekyllrb.com/docs/home
[jekyll-gh]: https://github.com/jekyll/jekyll
[jekyll-talk]: https://talk.jekyllrb.com/
| bar-and-c/bar-and-c.github.io | _posts/2015-12-06-welcome-to-jekyll.markdown | Markdown | mit | 1,206 |
package spit.matrix17.HelperClasses;
import android.content.Context;
import android.support.v7.widget.CardView;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import com.bumptech.glide.Glide;
import java.util.ArrayList;
import spit.matrix17.R;
/**
* Created by Tejas on 16-08-2017.
*/
public class MyEventAdapter extends RecyclerView.Adapter<MyEventAdapter.CustomViewHolder>{
ArrayList<Event> eventdetailslist=new ArrayList<Event>();
Context context;
public MyEventAdapter(ArrayList<Event> eventdetailslist,Context context)
{
this.eventdetailslist=eventdetailslist;
this.context=context;
}
@Override
public CustomViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view = LayoutInflater.from(context).inflate(R.layout.event_thumbnail, parent, false);
return new MyEventAdapter.CustomViewHolder(view);
}
@Override
public void onBindViewHolder(CustomViewHolder holder, int position) {
holder.eventtitle.setText(eventdetailslist.get(position).getName());
Glide.with(context).load(eventdetailslist.get(position).getPosterUrl()).placeholder(R.drawable.download).override(400,400).into(holder.poster);
}
@Override
public int getItemCount() {
return eventdetailslist.size();
}
static class CustomViewHolder extends RecyclerView.ViewHolder{
CardView cardView;
TextView eventtitle;
ImageView poster;
public CustomViewHolder(View itemView) {
super(itemView);
cardView=(CardView)itemView.findViewById(R.id.myaccount_cardview);
eventtitle=(TextView)itemView.findViewById(R.id.event_title);
poster=(ImageView)itemView.findViewById(R.id.thumbnail);
}
}
}
| tejas4888/Matrix2k17 | app/src/main/java/spit/matrix17/HelperClasses/MyEventAdapter.java | Java | mit | 1,942 |
using System;
using System.Collections.Generic;
using System.IO;
using System.Xml;
using DtblProcessor.Main;
namespace DtblViewerClient.Misc {
public static class Descriptors {
private struct ColumnDescriptor {
public int Index;
public int Offset;
public int Size;
}
/// <summary>
/// Determines whether the descriptors are loaded from the file.
/// </summary>
public static bool IsFileLoaded { get; private set; }
private static Dictionary<string, Dictionary<int, ColumnDescriptor>> s_columnDescriptors;
private static bool s_initialized;
/// <summary>
/// Initializes descriptor management and allows descriptors to be loaded into memory.
/// </summary>
public static void Initialize() {
if (s_initialized)
return;
s_columnDescriptors = new Dictionary<string, Dictionary<int, ColumnDescriptor>>();
s_initialized = true;
}
/// <summary>
/// Loads descriptors from an XML file into memory.
/// </summary>
/// <param name="sFilePath">The path to the XML file.</param>
public static void Load(string sFilePath) {
if (!s_initialized)
return;
if (!File.Exists(sFilePath)) {
Settings.UseExternalDescriptors = false;
return;
}
s_columnDescriptors.Clear();
GC.Collect();
XmlReader fsDescriptors = null;
try {
fsDescriptors = XmlReader.Create(sFilePath);
while (fsDescriptors.Read()) {
if(fsDescriptors.NodeType != XmlNodeType.Element || fsDescriptors.Name != "Table")
continue;
string sTableName = fsDescriptors.GetAttribute("Name");
int nColumnCount = Int32.Parse(fsDescriptors.GetAttribute("Columns"));
s_columnDescriptors.Add(sTableName, new Dictionary<int, ColumnDescriptor>(nColumnCount));
for (int i = 0; i < nColumnCount; i++) {
while (fsDescriptors.NodeType != XmlNodeType.Element || fsDescriptors.Name != "Column") {
if (!fsDescriptors.Read())
throw new Exception("Descriptors::Load(): Element ended unexpectedly.");
}
int nIndex = Int32.Parse(fsDescriptors.GetAttribute("Index"));
int nOffset = Int32.Parse(fsDescriptors.GetAttribute("Offset"));
int nSize = Int32.Parse(fsDescriptors.GetAttribute("Size"));
if (nIndex < 0 || nIndex >= nColumnCount || s_columnDescriptors[sTableName].ContainsKey(nIndex))
throw new Exception("Descriptors::Load(): Encountered unexpected column index.");
ColumnDescriptor colColumnDescriptor = new ColumnDescriptor();
colColumnDescriptor.Index = nIndex;
colColumnDescriptor.Offset = nOffset;
colColumnDescriptor.Size = nSize;
s_columnDescriptors[sTableName].Add(nIndex, colColumnDescriptor);
if (!fsDescriptors.Read())
throw new Exception("Descriptors::Load(): Element ended unexpectedly.");
}
}
} catch { }
if (fsDescriptors != null)
fsDescriptors.Close();
IsFileLoaded = true;
}
/// <summary>
/// Unloads descriptors from memory.
/// </summary>
public static void Unload() {
s_columnDescriptors.Clear();
GC.Collect();
IsFileLoaded = false;
}
/// <summary>
/// Applies descriptors to a table. Rows are required to be re-read after external descriptors are applied.
/// </summary>
/// <param name="tblDataTable">The table to apply descriptor information to.</param>
public static void Apply(ref Table tblDataTable) {
if (!s_initialized || !IsFileLoaded || !ExistsForTable(ref tblDataTable))
throw new Exception("Descriptors::Apply(): Descriptors do not exist for this table.");
foreach (ColumnDescriptor colColumnDescriptor in s_columnDescriptors[tblDataTable.TableName].Values) {
tblDataTable.Columns[colColumnDescriptor.Index].Offset = colColumnDescriptor.Offset;
tblDataTable.Columns[colColumnDescriptor.Index].Size = colColumnDescriptor.Size;
}
}
public static bool ExistsForTable(ref Table tblDataTable) {
return s_initialized && IsFileLoaded &&
s_columnDescriptors.ContainsKey(tblDataTable.TableName);
}
}
}
| Jadd/DtblReader | DtblViewerClient/Misc/Descriptors.cs | C# | mit | 4,973 |
module Cinch
module Plugins
class RubyVersion
include Cinch::Plugin
match /(ruby)$/
match /(help ruby)$/, method: :help
def execute(m)
m.reply "ruby #{RUBY_VERSION}p#{RUBY_PATCHLEVEL} (#{RUBY_RELEASE_DATE} revision #{RUBY_REVISION}) [#{RUBY_PLATFORM}]"
end
def help(m)
m.reply "returns ruby version, patch level, release date, revision, and platform"
end
end
end
end
| dhanesana/yongBot | lib/plugins/ruby.rb | Ruby | mit | 441 |
<?php
include 'init_auth.php';
// First, we initialize the session, to see if we are already logged in
session_start();
fuckCookies();
?> | horowitz2009/Angie | php/check_cookies.php | PHP | mit | 149 |
---
date: 2019-03-08
type: service
headline: Joined [SyGuS-Comp][SyGuS] OC
---
I am joining the organizing committee of the annual SyGuS competition.
Preparations for the [6<sup>th</sup> SyGuS-Comp][SyGuS-Comp 2019],
to be held with [SYNT@CAV 2019](https://cs.nyu.edu/acsys/synt2019/), have already begun!
Please take a look at the [SyGuS language standard v2.0](https://sygus.org/assets/pdf/SyGuS-IF_2.0.pdf),
and submit your benchmarks and/or solvers.
<br>
<small>**[Deadlines](https://sygus.org/comp/2019/#important-dates):** 1<sup>st</sup> May (benchmarks) · 14<sup>th</sup> June (solvers)</small> | SaswatPadhi/saswatpadhi.github.io | _updates/2019-03_sygus_oc.md | Markdown | mit | 630 |
module.exports = {
processSignin: function(req, res){
userHandle = req.param('handle');
userRef = sails.config.firebase.users.push({handle: userHandle});
req.session.user = {id: userRef.key(), handle: userHandle};
return res.redirect('/sei-chat');
},
processLogout: function(req, res){
var userId = req.session.user.id;
sails.config.firebase.users.child(userId).remove()
req.session.user = undefined;
return res.redirect('/login');
}
} | marcelolebre/sei-chat | api/controllers/AuthController.js | JavaScript | mit | 484 |
<?php
error_reporting(0);
//$this->load->view('admin/header');
?>
<!DOCTYPE html>
<html class="no-js">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>FeelJoy</title>
<meta name="description" content="Material Design Mobile Template">
<meta name="HandheldFriendly" content="True">
<meta name="MobileOptimized" content="320">
<meta name="viewport" content="width=device-width, initial-scale=1, minimal-ui">
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="<?php echo base_url();?>img/touch/apple-touch-icon-144x144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="<?php echo base_url();?>img/touch/apple-touch-icon-114x114-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="<?php echo base_url();?>img/touch/apple-touch-icon-72x72-precomposed.png">
<link rel="apple-touch-icon-precomposed" href="<?php echo base_url();?>img/touch/apple-touch-icon-57x57-precomposed.png">
<link rel="shortcut icon" sizes="196x196" href="<?php echo base_url();?>img/touch/touch-icon-196x196.png">
<link rel="shortcut icon" href="<?php echo base_url();?>img/touch/apple-touch-icon.png">
<!-- Tile icon for Win8 (144x144 + tile color) -->
<meta name="msapplication-TileImage" content="<?php echo base_url();?>img/touch/apple-touch-icon-144x144-precomposed.png">
<meta name="msapplication-TileColor" content="#222222">
<!-- Add to homescreen for Chrome on Android -->
<meta name="mobile-web-app-capable" content="yes">
<!-- SEO: If mobile URL is different from desktop URL, add a canonical link to the desktop page -->
<!--
<link rel="canonical" href="http://www.example.com/" >
-->
<!-- For iOS web apps. Delete if not needed. https://github.com/h5bp/mobile-boilerplate/issues/94 -->
<!--
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-title" content="">
-->
<!-- Fonts -->
<link href='https://fonts.googleapis.com/css?family=Montserrat:400,700' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Roboto:400,700,100' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Varela+Round' rel='stylesheet' type='text/css'>
<!-- Icons -->
<link href="//code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css" media="all" rel="stylesheet" type="text/css">
<!-- Stylesheets -->
<link rel="stylesheet" href="<?php echo base_url();?>css/animate.css">
<link rel="stylesheet" href="<?php echo base_url();?>css/materialize.min.css">
<link rel="stylesheet" href="<?php echo base_url();?>css/swipebox.min.css">
<link rel="stylesheet" href="<?php echo base_url();?>css/swiper.min.css">
<link rel="stylesheet" href="<?php echo base_url();?>css/normalize.css">
<link rel="stylesheet" href="<?php echo base_url();?>css/main.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.0.0/jquery.min.js"></script>
<script src="<?php echo base_url();?>js/mobile.js"></script>
<script src="<?php echo base_url();?>js/vendor/modernizr-2.7.1.min.js"></script>
<style>
.primary-color {
background-color: #56B68B !important;
}
.meta_holder {
width: 100%;
height: 75px;
position: fixed;
;
bottom: 0;
padding: 10px;
margin-bottom: -9px;
}
.chat-text-holder {
border-radius: 6px;
height: 50px;
background-color: rgba(86, 182, 139, 0.80);
display: flex;
box-shadow: 0 1px 4px rgba(0,0,0,0.15), 0 1px 4px rgba(0,0,0,0.20);
}
.left {
flex: 0 1 85%;
height: 100%;
padding: 5px;
box-sizing: border-box;
}
.chat-text-box {
opacity: 1 !important;
width: 100%;
height: 100%;
resize: none;
padding: 5px 5px 5px 12px;
border: none;
/*box-shadow: 0px 1px 3px #fff;*/
border-radius: 3px;
background-color: #fff;
border-color: #fff;
border-width: 1px;
overflow: hidden;
}
.right {
flex: 0 1 15%;
width: 100%;
height: 100%;
}
.send-button {
background-image: url('<?php echo base_url();?>icon/send-1x.png');
background-repeat: no-repeat;
height: 100%;
width: 100%;
border: medium none;
background-color:rgb(119, 197, 162);
border-radius: 3px;
background-position: center;
background-size: 60%,60%;
}
</style>
<?php $this->load->view('user/theme-common');?>
</head>
<body>
<!-- Main Container -->
<div id="main" class="main">
<?php $this->load->view('user/main-nav');?>
<!-- Toolbar -->
<!-- link rel="stylesheet" type="text/css" href="<?php echo base_url();?>css/chat/style.css" media="screen"-->
<link href="<?php echo base_url();?>lib-emoji/emoji.css?cb=<?=time()?>" rel="stylesheet" type="text/css" />
<link href="<?php echo base_url();?>css/chat/jquery.cssemoticons.css" media="screen" rel="stylesheet" type="text/css" />
<div class="chatbar" id="chatbar">
<!-- div class="chatcontainer">
<div class="chat" id="chat">
<div class="close" onclick="removeChat()" title="Close">X</div>
<div class="stream" id="cstream">
</div>
</div>
<div class="chatmsg">
<form method="post" id="msenger" action="">
<textarea name="msg" id="msg-min"></textarea>
<input type="hidden" name="cbidn" value="">
<input type="submit" value="Send" id="sb-mt">
</form>
</div>
<div id="dataHelper" last-id=""></div>
</div-->
</div>
<script type="text/javascript">
function showChat(fid){
if(fid && fid != "undefined"){
var chatbox = '<div class="chatcontainer"><div class="chat" id="chat"><div class="close" onclick="removeChat()" title="Close">X</div><div class="stream" id="cstream"></div></div><div class="chatmsg"><form method="post" id="msenger" action="" onsubmit="return submitMsg();"><textarea name="msg" id="msg-min"></textarea><input type="hidden" name="fid" id="fid" value="'+fid+'"><input type="submit" value="Send" id="sb-mt"></form></div><div id="dataHelper" last-id=""></div></div>';
$('#chatbar').append(chatbox);
$('#msg-min').focus();
getOldChat(fid);
}
}
function removeChat(){
$( ".chatcontainer" ).remove();
}
$(document).keyup(function(e){
if(e.shiftKey && e.keyCode == 13){
$txtVal = $('#msenger textarea').val();
//$('#msenger textarea').val($txtVal +"\n\r");
}
if(!e.shiftKey && e.keyCode == 13){
if(!isMobile.any){
if($('#msenger textarea').val().trim() == ""){
$('#msenger textarea').val('');
}else{
$('#msenger textarea').attr('readonly', 'readonly');
$('#sb-mt').attr('disabled', 'disabled'); // Disable submit button
sendMsg();
}
}
}
});
function submitMsg() {
$('#msg-min').focus();
//$('#msenger textarea').attr('readonly', 'readonly');
$('#sb-mt').attr('disabled', 'disabled'); // Disable submit button
sendMsg();
return false;
}
function getOldChat(fid){
$.ajax({
type: 'post',
url: '<?php echo base_url();?>chat/chatM/index/?rq=oMsg',
data: {fid: fid},
dataType: 'json',
success: function(rsp){
if(parseInt(rsp.status) == 1){
$design = '';
$grpmsg = 0;
$.each( rsp.msgData, function( key, value ) {
//var match = value.time.match(/^(\d+)-(\d+)-(\d+) (\d+)\:(\d+)\:(\d+)$/);
//var date = new Date(match[1], match[2] - 1, match[3], match[4], match[5], match[6]);
console.log();
$num_child = value.length;
$clsrow = '';
if(value[0]['id']){
if($num_child > 1)
$clsrow = 'first';
$design += '<li class="message-'+(value[0]['clsname'] == 'm-rply'?'right':'left')+' animated fadeinright">'+
'<img alt="" src="<?php echo base_url();?>img/man.png">';
$rc = 0;
$.each(value, function(rkey, rvalue){
$rc++;
if($rc == $num_child && $num_child != 1){
$clsrow = 'last';
}
$design += '<div class="message '+$clsrow+'">'+
'<p>'+
rvalue.msg+
'</p>'+
'</div>';
$clsrow = '';
});
var rowid = value[$num_child-1];
var match = rowid['time'].match(/^(\d+)-(\d+)-(\d+) (\d+)\:(\d+)\:(\d+)$/);
var date = new Date(match[1], match[2] - 1, match[3], match[4], match[5], match[6]);
$design +='<span class="msg-time time-'+rowid.id+'" data-livestamp="'+((date.getTime() / 1000)+19800)+'"></span>'+
'</li>';
$('.time-'+rowid.id).livestamp();
$('#dataHelper').attr('last-id', rowid.id);
}
});
$('#cstream').prepend($design);
$('.message').emoticonize({
//delay: 800,
//animate: false,
//exclude: 'pre, code, .no-emoticons'
});
//$('#chat').scrollTop ($('#cstream').height());
//$(document).scrollTop($('#cstream').height());
$(function () {
$("html, body").animate({
scrollTop: $('html, body').get(0).scrollHeight + 2000}, 2500);});
}
}
});
}
function sendMsg(){
$.ajax({
type: 'post',
url: '<?php echo base_url();?>chat/chatM/index/?rq=new',
data: $('#msenger').serialize(),
dataType: 'json',
success: function(rsp){
$('#msenger textarea').removeAttr('readonly');
$('#sb-mt').removeAttr('disabled'); // Enable submit button
if(parseInt(rsp.status) == 0){
alert(rsp.msg);
}else if(parseInt(rsp.status) == 1){
$('#msenger textarea').val('');
$('#msenger textarea').focus();
//$design = '<div>'+rsp.msg+'<span class="time-'+rsp.lid+'"></span></div>';
$design = '<li class="message-right animated fadeinright">'+
'<img alt="" src="<?php echo base_url();?>img/man.png">'+
'<div class="message">'+
'<p>'+
rsp.msg+
'</p>'+
'</div>'+
'<span class="msg-time time-'+rsp.lid+'"></span>'+
'</li>';
$('#cstream').append($design);
$('.message').emoticonize({
//delay: 800,
//animate: false,
//exclude: 'pre, code, .no-emoticons'
});
$('.time-'+rsp.lid).livestamp();
$('#dataHelper').attr('last-id', rsp.lid);
$(document).scrollTop($(document).height() + 100);
}
}
});
}
function checkStatus(){
$fid = $('#fid').val();
$.ajax({
type: 'post',
url: '<?php echo base_url();?>chat/chatM/index/?rq=msg',
data: {fid: $fid, lid: $('#dataHelper').attr('last-id')},
dataType: 'json',
cache: false,
success: function(rsp){
if(parseInt(rsp.status) == 0){
return false;
}else if(parseInt(rsp.status) == 1){
getMsg();
}
}
});
}
// Check for latest message
setInterval(function(){checkStatus();}, 2000);
function getMsg(){
$fid = $('#fid').val();
$.ajax({
type: 'post',
url: '<?php echo base_url();?>chat/chatM/index/?rq=NewMsg',
data: {fid: $fid, lid: $('#dataHelper').attr('last-id')},
dataType: 'json',
success: function(rsp){
if(parseInt(rsp.status) == 0){
//alert(rsp.msg);
}else if(parseInt(rsp.status) == 1){
$design = '<li class="message-left animated fadeinright delay-1">'+
'<img alt="" src="<?php echo base_url();?>img/man.png">'+
'<div class="message">'+
'<p>'+
rsp.msg+
'<p>'+
'</div>'+
'<span class="msg-time time-'+rsp.lid+'"></span>'+
'</li>';
//open chat box if not already
//if($(".chatcontainer").length == 0){
//showChat(rsp.from);
//}
$('#cstream').append($design);
$('.message').emoticonize({
//delay: 800,
//animate: false,
//exclude: 'pre, code, .no-emoticons'
});
$('.time-'+rsp.lid).livestamp();
$('#dataHelper').attr('last-id', rsp.lid);
$(document).scrollTop($(document).height());
}
}
});
}
$(document).ready(function() {
var s = $("#chatbar");
var pos = s.offset().top+s.height(); //offset that you need is actually the div's top offset + it's height
$(window).scroll(function() {
var windowpos = $(window).scrollTop(); //current scroll position of the window
var windowheight = $(window).height(); //window height
if (windowpos+windowheight>pos) s.addClass('stick'); //Currently visible part of the window > greater than div offset + div height, add class
else s.removeClass('stick');
});
});
</script>
<div class="page animated fadeinup">
<div class="chat p-20" id="chat">
<ul id="cstream">
</ul>
</div>
</div>
<!-- End of Page Contents -->
<!-- End of Main Container -->
<div class="meta_holder theme">
<?php
if(isset($isSpamUser) && $isSpamUser){?>
<div style="background-color:white;height:50px;padding-top:10px;" align="center">Please contact admin to resume your services.</div>
<?php }else{?>
<form method="post" id="msenger" action="" onsubmit="return submitMsg();">
<div class="chat-text-holder theme">
<div class="left">
<input type="hidden" name="fid" id="fid" value="<?php echo $list_id;?>">
<textarea class="chat-text-box" placeholder="Type a message" name="msg" id="msg-min"></textarea>
</div>
<div class="right">
<!-- input type="submit" class="send-button theme ion-android-send" value="" id="sb-mt" /-->
<button class="theme" id="sb-mt" style="border:0px;padding:0 0 0 10px;margin:-2px;height:0px;" onclick="return submitMsg();">
<i class="ion-android-send" style="font-size:2.4em;color:white;"></i>
</button>
</div>
<div id="dataHelper" last-id=""></div>
</div>
</form>
<?php }?>
</div>
<!-- Scripts -->
<script src="<?php echo base_url();?>js/helper.js"></script>
<script src="<?php echo base_url();?>js/vendor/HeadsUp.js"></script>
<script src="<?php echo base_url();?>js/vendor/jquery.smoothState.js"></script>
<script src="<?php echo base_url();?>js/vendor/chart.min.js"></script>
<script src="<?php echo base_url();?>js/vendor/jquery.mixitup.min.js"></script>
<script src="<?php echo base_url();?>js/vendor/materialize.min.js"></script>
<script src="<?php echo base_url();?>js/main.js"></script>
<script src="<?php echo base_url();?>js/chat/moment.min.js"></script>
<script src="<?php echo base_url();?>js/chat/livestamp.js"></script>
<script src="<?php echo base_url();?>js/chat/jquery.cssemoticons.min.js" type="text/javascript"></script>
<script>
getOldChat(<?php echo $this->session->userdata('listenerid');?>);
_pcq.push(['APIReady', saveSubscriberID]);
if(isMobile.any){
var isMobile = 1;
}else{
var isMobile = 0;
}
function saveSubscriberID() {
if(pushcrew.subscriberId && pushcrew.subscriberId != -1){
$.ajax({
type: 'post',
url: '<?php echo base_url();?>crons/pushnotification/upsertNotificationUser',
data: {subid: pushcrew.subscriberId, d_type: isMobile},
//dataType: 'json',
success: function(rsp){
if(rsp == 1){
console.log('saved');
}else {
console.log('err');
}
}
});
}
}
</script>
</body>
</html>
| sky1086/feeljoyci | application/views/user/chat_view1.php | PHP | mit | 15,798 |
//
// Copyright 2014 Autodesk, Inc. All rights reserved.
//
// Use of this software is subject to the terms of the Autodesk license
// agreement provided at the time of installation or download, or which
// otherwise accompanies this software in either electronic or hard copy form.
//
// DESCRIPTION:
//
// Function prototype definitions for brdump.cpp.
#ifndef AC_BRDUMP_H
#define AC_BRDUMP_H 1
#include "adesk.h"
void dumpModel ();
#endif
| kevinzhwl/ObjectARXCore | 2015/utils/brep/samples/brepsamp/brdump.h | C | mit | 500 |
package Controller;
import Util.Teclado;
public class Ex08 {
public static void main(String[] args) {
try{
int a = Teclado.lerInt("Digite um número");
System.out.println("O número digitado foi: " + a);
} catch (NumberFormatException nfe){
try{
int a = Teclado.lerInt("Digite um número");
System.out.println("O número digitado foi: " + a);
} catch (NumberFormatException nfe1) {
try {
int a = Teclado.lerInt("Digite um número");
System.out.println("O número digitado foi: " + a);
} catch (NumberFormatException nfe2) {
System.out.println("Excedeu o número de tentativas");
}
}
}
}
}
| GiovanniSM20/Java | src/ExFicacao_02/src/Controller/Ex08.java | Java | mit | 655 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.16"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Wizard Parser: Члены пространств имен</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">Wizard Parser
 <span id="projectnumber">v4.4</span>
</div>
<div id="projectbrief">LL(*)-парсер на C++ с поддержкой DSL для описания грамматики в EBNF непосредственно в коде программы</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Создано системой Doxygen 1.8.16 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Поиск');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Поиск');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="contents">
 
<h3><a id="index_d"></a>- d -</h3><ul>
<li>dummy()
: <a class="el" href="namespacethewizardplusplus_1_1wizard__parser_1_1parser.html#a5b667fd2562982ea7d7a49e180b95c6b">thewizardplusplus::wizard_parser::parser</a>
</li>
</ul>
<h3><a id="index_f"></a>- f -</h3><ul>
<li>find_matched_token()
: <a class="el" href="namespacethewizardplusplus_1_1wizard__parser_1_1lexer.html#a45bfe8f6ab92b93f7f2d5fd195ef9c61">thewizardplusplus::wizard_parser::lexer</a>
</li>
</ul>
<h3><a id="index_g"></a>- g -</h3><ul>
<li>get_offset()
: <a class="el" href="namespacethewizardplusplus_1_1wizard__parser_1_1lexer.html#a18df1c98bc69fa3add28f5239717b4a5">thewizardplusplus::wizard_parser::lexer</a>
, <a class="el" href="namespacethewizardplusplus_1_1wizard__parser_1_1parser.html#afa58d936ff8aab0d96cdb87f4ea3ce41">thewizardplusplus::wizard_parser::parser</a>
</li>
</ul>
<h3><a id="index_j"></a>- j -</h3><ul>
<li>join_sequences()
: <a class="el" href="namespacethewizardplusplus_1_1wizard__parser_1_1transformers.html#aca544f69bb9acae3edb8dfafd673b9ee">thewizardplusplus::wizard_parser::transformers</a>
</li>
</ul>
<h3><a id="index_m"></a>- m -</h3><ul>
<li>match_lexeme()
: <a class="el" href="namespacethewizardplusplus_1_1wizard__parser_1_1lexer.html#ad2450cd6a741aa38d42b5f4ecbbd9a1c">thewizardplusplus::wizard_parser::lexer</a>
</li>
</ul>
<h3><a id="index_o"></a>- o -</h3><ul>
<li>operator &()
: <a class="el" href="namespacethewizardplusplus_1_1wizard__parser_1_1parser_1_1operators.html#a8f321b46e62b296c299d01f248919cdd">thewizardplusplus::wizard_parser::parser::operators</a>
</li>
<li>operator *()
: <a class="el" href="namespacethewizardplusplus_1_1wizard__parser_1_1parser_1_1operators.html#ad43ab88b737b8b8befadaedbc41b180f">thewizardplusplus::wizard_parser::parser::operators</a>
</li>
<li>operator!()
: <a class="el" href="namespacethewizardplusplus_1_1wizard__parser_1_1parser_1_1operators.html#aae8d89aaf0134ef3781cbe54d8f9c823">thewizardplusplus::wizard_parser::parser::operators</a>
</li>
<li>operator""_t()
: <a class="el" href="namespacethewizardplusplus_1_1wizard__parser_1_1parser_1_1operators.html#a98948ee0b928f43a1be2a512d177d402">thewizardplusplus::wizard_parser::parser::operators</a>
</li>
<li>operator""_v()
: <a class="el" href="namespacethewizardplusplus_1_1wizard__parser_1_1parser_1_1operators.html#a37e80053b930649363e120d5040c7049">thewizardplusplus::wizard_parser::parser::operators</a>
</li>
<li>operator%()
: <a class="el" href="namespacethewizardplusplus_1_1wizard__parser_1_1parser_1_1operators.html#a3d7e948329d535c998b0ed91fb025826">thewizardplusplus::wizard_parser::parser::operators</a>
</li>
<li>operator+()
: <a class="el" href="namespacethewizardplusplus_1_1wizard__parser_1_1parser_1_1operators.html#a272aa332bd625de5d547904db2115dd3">thewizardplusplus::wizard_parser::parser::operators</a>
</li>
<li>operator-()
: <a class="el" href="namespacethewizardplusplus_1_1wizard__parser_1_1parser_1_1operators.html#af850b1a041d3f03d0dd3026877c1d581">thewizardplusplus::wizard_parser::parser::operators</a>
</li>
<li>operator<<()
: <a class="el" href="namespacethewizardplusplus_1_1wizard__parser_1_1lexer.html#a1d80bcc9931b8b853c824cde07eda6ce">thewizardplusplus::wizard_parser::lexer</a>
, <a class="el" href="namespacethewizardplusplus_1_1wizard__parser_1_1parser.html#a2495761efd953ac185bc92615c358823">thewizardplusplus::wizard_parser::parser</a>
</li>
<li>operator==()
: <a class="el" href="namespacethewizardplusplus_1_1wizard__parser_1_1lexer.html#af829b1da9021e4dc4314f68fa8a723b5">thewizardplusplus::wizard_parser::lexer</a>
, <a class="el" href="namespacethewizardplusplus_1_1wizard__parser_1_1parser.html#af74e7cfabb6dfdc17787f42a10cf1b26">thewizardplusplus::wizard_parser::parser</a>
</li>
<li>operator>>()
: <a class="el" href="namespacethewizardplusplus_1_1wizard__parser_1_1parser_1_1operators.html#aa06b781d515a77b80bbbb860a328f285">thewizardplusplus::wizard_parser::parser::operators</a>
</li>
<li>operator|()
: <a class="el" href="namespacethewizardplusplus_1_1wizard__parser_1_1parser_1_1operators.html#a00c705b40a757264d028f01563e35087">thewizardplusplus::wizard_parser::parser::operators</a>
</li>
</ul>
<h3><a id="index_p"></a>- p -</h3><ul>
<li>parse()
: <a class="el" href="namespacethewizardplusplus_1_1wizard__parser_1_1parser.html#acd85c6a45573b68c58559c427b27050a">thewizardplusplus::wizard_parser::parser</a>
</li>
<li>parse_all()
: <a class="el" href="namespacethewizardplusplus_1_1wizard__parser_1_1parser.html#a6b4a53e1e6e1660d3121d2f6de34c4ed">thewizardplusplus::wizard_parser::parser</a>
</li>
</ul>
<h3><a id="index_r"></a>- r -</h3><ul>
<li>remove_nothings()
: <a class="el" href="namespacethewizardplusplus_1_1wizard__parser_1_1transformers.html#ab8bc3c43a7a807a5215bf2807ed3d500">thewizardplusplus::wizard_parser::transformers</a>
</li>
</ul>
<h3><a id="index_t"></a>- t -</h3><ul>
<li>to_json()
: <a class="el" href="namespacethewizardplusplus_1_1wizard__parser_1_1lexer.html#a914a1d10577f76faea41572b5ad49543">thewizardplusplus::wizard_parser::lexer</a>
, <a class="el" href="namespacethewizardplusplus_1_1wizard__parser_1_1parser.html#a647dbb58551edac637cba061b291109f">thewizardplusplus::wizard_parser::parser</a>
</li>
<li>to_tuple()
: <a class="el" href="namespacethewizardplusplus_1_1wizard__parser_1_1lexer.html#a35e01705bd8b2f56bd1825160126dd05">thewizardplusplus::wizard_parser::lexer</a>
, <a class="el" href="namespacethewizardplusplus_1_1wizard__parser_1_1parser.html#aee6fab85299f91b307360101b825179b">thewizardplusplus::wizard_parser::parser</a>
</li>
<li>tokenize()
: <a class="el" href="namespacethewizardplusplus_1_1wizard__parser_1_1lexer.html#a763b1e95607906f9ce4f42ec7f40943a">thewizardplusplus::wizard_parser::lexer</a>
</li>
<li>tokenize_all()
: <a class="el" href="namespacethewizardplusplus_1_1wizard__parser_1_1lexer.html#a6f121d4da0447fe0d4fecd54149bd6c4">thewizardplusplus::wizard_parser::lexer</a>
</li>
<li>transform()
: <a class="el" href="namespacethewizardplusplus_1_1wizard__parser_1_1transformers.html#a607fab59e3202b0260a7cd2e44d95994">thewizardplusplus::wizard_parser::transformers</a>
</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Документация по Wizard Parser. Последние изменения: Вт 25 Июн 2019 04:16:35. Создано системой  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.16
</small></address>
</body>
</html>
| thewizardplusplus/wizard-parser | docs/doxygen/html/namespacemembers_func.html | HTML | mit | 9,314 |
var path = require('path')
var _ = require('lodash')
var async = require('async')
var mongoose = require('mongoose')
var ProgressBar = require('progress')
var w2v = require('word2vec')
var format = require('string-format')
format.extend(String.prototype)
var settings = require('../conf/main.js')
var PackageInfo = require('./package-info.js')
mongoose.connect(settings.db)
var train = function (opts, cb) {
if (typeof opts === 'function') {
cb = opts
opts = {}
}
opts = opts || {}
console.log('Training word2vec model...')
w2v.word2vec(settings.sentencesFile, settings.outputFile, {
minCount: 0,
cbow: 0,
iter: 10
}, function (err) {
console.log('Finished training word2vec model')
if (cb) {
return cb(err)
}
})
}
var precomputeMostSimilar = function (opts, cb) {
var numSimilar = opts.numSimilar || 30
var loadModel = function (next) {
w2v.loadModel(settings.outputFile, function (err, model) {
if (err) return next(err)
return next(null, model)
})
}
var getCount = function (model, next) {
PackageInfo.count(function (err, total) {
if (err) return next(err)
return next(null, model, total)
})
}
var precompute = function (model, total, next) {
console.log('Precomputing {0} most similar packages for {1} packages'.format(numSimilar, total))
var bar = new ProgressBar(':bar :current/:total', { total: total, clear: true })
var processed = 0
var timer = setInterval(function () {
bar.tick(processed)
processed = 0
if (bar.complete) {
console.log('\n Finished precomputing most similar packages!\n')
clearInterval(timer)
}
}, 100)
console.log('finding all...')
var allPackages = PackageInfo.find().stream()
allPackages.on('data', function (doc) {
var name = doc.name
var mostSimilar = model.mostSimilar(name, numSimilar)
PackageInfo.find().where('name').in(_.map(mostSimilar, 'name')).exec(function (err, docs) {
if (err) return next(err)
var descriptions = _.zipObject(_.map(docs, 'name'), _.map(docs, 'description'))
_.forEach(mostSimilar, function (entry) {
entry.description = descriptions[entry.name]
})
PackageInfo.update({ name: name }, { similar: mostSimilar }, function (err) {
if (err) return next(err)
processed += 1
console.log('name: ' + name)
})
})
})
allPackages.on('error', function (err) {
return next(err)
})
allPackages.on('close', function () {
return next(null)
})
}
async.waterfall([
loadModel,
getCount,
precompute
], function (err) {
return cb(err)
})
}
if (require.main === module) {
train()
mongoose.disconnect()
} else {
module.exports = train
}
| andrewosh/npm-recommender | lib/train.js | JavaScript | mit | 2,830 |
<template name="spinners">
<!-- Spinner -->
<form class="form-horizontal" role="form" action="#">
<div class="panel panel-default">
<div class="panel-heading"><h6 class="panel-title"><i class="icon-calculate"></i> Spinner</h6></div>
<div class="panel-body">
<div class="alert alert-success fade in block-inner">
<button type="button" class="close" data-dismiss="alert">×</button>
Jquery UI spinner with mousewheel addition and globalization
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Default spinner: </label>
<div class="col-sm-10">
<input type="text" id="spinner-default" class="form-control" value="10">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Decimal: </label>
<div class="col-sm-10">
<div class="row">
<div class="col-sm-6">
<input type="text" class="form-control" id="spinner-decimal" name="spinner-decimal"
value="5.06">
</div>
<div class="col-sm-6">
<select data-placeholder="Change format" id="culture" class="select">
<option value=""></option>
<option value="en-EN">English</option>
<option value="de-DE">German</option>
<option value="ja-JP">Japanese</option>
</select>
</div>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Currency: </label>
<div class="col-sm-10">
<div class="row">
<div class="col-sm-6">
<input type="text" class="form-control" id="spinner-currency" name="spinner-currency" value="5">
</div>
<div class="col-sm-6">
<select data-placeholder="Currency" id="currency" name="currency" class="select">
<option value=""></option>
<option value="en-US">US $</option>
<option value="de-DE">EUR €</option>
<option value="ja-JP">YEN ¥</option>
</select>
</div>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Overflow: </label>
<div class="col-sm-10">
<input type="text" class="form-control" id="spinner-overflow" name="spinner-overflow" value="1">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Time: </label>
<div class="col-sm-10">
<div class="row">
<div class="col-sm-6">
<input type="text" class="form-control" id="spinner-time" name="spinner-time" value="08:30 PM">
</div>
<div class="col-sm-6">
<select data-placeholder="Time format" id="culture-time" class="select">
<option value=""></option>
<option value="en-EN">English</option>
<option value="de-DE">German</option>
</select>
</div>
</div>
</div>
</div>
</div>
</div>
</form>
<!-- /spinner -->
</template> | LumaPictures/meteor-luma-ui | example/client/views/pages/forms/form_components/form_elements/spinners.html | HTML | mit | 4,026 |
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Zend\Code\Generator;
use Zend\Code\Reflection\PropertyReflection;
use function sprintf;
use function str_replace;
use function strtolower;
class PropertyGenerator extends AbstractMemberGenerator
{
const FLAG_CONSTANT = 0x08;
/**
* @var bool
*/
protected $isConst;
/**
* @var PropertyValueGenerator
*/
protected $defaultValue;
/**
* @param PropertyReflection $reflectionProperty
* @return PropertyGenerator
*/
public static function fromReflection(PropertyReflection $reflectionProperty)
{
$property = new static();
$property->setName($reflectionProperty->getName());
$allDefaultProperties = $reflectionProperty->getDeclaringClass()->getDefaultProperties();
$property->setDefaultValue($allDefaultProperties[$reflectionProperty->getName()]);
if ($reflectionProperty->getDocComment() != '') {
$property->setDocBlock(DocBlockGenerator::fromReflection($reflectionProperty->getDocBlock()));
}
if ($reflectionProperty->isStatic()) {
$property->setStatic(true);
}
if ($reflectionProperty->isPrivate()) {
$property->setVisibility(self::VISIBILITY_PRIVATE);
} elseif ($reflectionProperty->isProtected()) {
$property->setVisibility(self::VISIBILITY_PROTECTED);
} else {
$property->setVisibility(self::VISIBILITY_PUBLIC);
}
$property->setSourceDirty(false);
return $property;
}
/**
* Generate from array
*
* @configkey name string [required] Class Name
* @configkey const bool
* @configkey defaultvalue null|bool|string|int|float|array|ValueGenerator
* @configkey flags int
* @configkey abstract bool
* @configkey final bool
* @configkey static bool
* @configkey visibility string
*
* @throws Exception\InvalidArgumentException
* @param array $array
* @return PropertyGenerator
*/
public static function fromArray(array $array)
{
if (! isset($array['name'])) {
throw new Exception\InvalidArgumentException(
'Property generator requires that a name is provided for this object'
);
}
$property = new static($array['name']);
foreach ($array as $name => $value) {
// normalize key
switch (strtolower(str_replace(['.', '-', '_'], '', $name))) {
case 'const':
$property->setConst($value);
break;
case 'defaultvalue':
$property->setDefaultValue($value);
break;
case 'docblock':
$docBlock = $value instanceof DocBlockGenerator ? $value : DocBlockGenerator::fromArray($value);
$property->setDocBlock($docBlock);
break;
case 'flags':
$property->setFlags($value);
break;
case 'abstract':
$property->setAbstract($value);
break;
case 'final':
$property->setFinal($value);
break;
case 'static':
$property->setStatic($value);
break;
case 'visibility':
$property->setVisibility($value);
break;
}
}
return $property;
}
/**
* @param string $name
* @param PropertyValueGenerator|string|array $defaultValue
* @param int $flags
*/
public function __construct($name = null, $defaultValue = null, $flags = self::FLAG_PUBLIC)
{
if (null !== $name) {
$this->setName($name);
}
if (null !== $defaultValue) {
$this->setDefaultValue($defaultValue);
}
if ($flags !== self::FLAG_PUBLIC) {
$this->setFlags($flags);
}
}
/**
* @param bool $const
* @return PropertyGenerator
*/
public function setConst($const)
{
if ($const) {
$this->removeFlag(self::FLAG_PUBLIC | self::FLAG_PRIVATE | self::FLAG_PROTECTED);
$this->setFlags(self::FLAG_CONSTANT);
} else {
$this->removeFlag(self::FLAG_CONSTANT);
}
return $this;
}
/**
* @return bool
*/
public function isConst()
{
return (bool) ($this->flags & self::FLAG_CONSTANT);
}
/**
* @param PropertyValueGenerator|mixed $defaultValue
* @param string $defaultValueType
* @param string $defaultValueOutputMode
*
* @return PropertyGenerator
*/
public function setDefaultValue(
$defaultValue,
$defaultValueType = PropertyValueGenerator::TYPE_AUTO,
$defaultValueOutputMode = PropertyValueGenerator::OUTPUT_MULTIPLE_LINE
) {
if (! $defaultValue instanceof PropertyValueGenerator) {
$defaultValue = new PropertyValueGenerator($defaultValue, $defaultValueType, $defaultValueOutputMode);
}
$this->defaultValue = $defaultValue;
return $this;
}
/**
* @return PropertyValueGenerator
*/
public function getDefaultValue()
{
return $this->defaultValue;
}
/**
* @throws Exception\RuntimeException
* @return string
*/
public function generate()
{
$name = $this->getName();
$defaultValue = $this->getDefaultValue();
$output = '';
if (($docBlock = $this->getDocBlock()) !== null) {
$docBlock->setIndentation(' ');
$output .= $docBlock->generate();
}
if ($this->isConst()) {
if ($defaultValue !== null && ! $defaultValue->isValidConstantType()) {
throw new Exception\RuntimeException(sprintf(
'The property %s is said to be '
. 'constant but does not have a valid constant value.',
$this->name
));
}
$output .= $this->indentation . 'const ' . $name . ' = '
. ($defaultValue !== null ? $defaultValue->generate() : 'null;');
} else {
$output .= $this->indentation
. $this->getVisibility()
. ($this->isStatic() ? ' static' : '')
. ' $' . $name . ' = '
. ($defaultValue !== null ? $defaultValue->generate() : 'null;');
}
return $output;
}
}
| rainlike/justshop | vendor/zendframework/zend-code/src/Generator/PropertyGenerator.php | PHP | mit | 7,074 |
require 'forwardable'
# TODO: - remove this file for future release
module Watir
class BaseDecorator
def initialize(element, timeout, message = nil)
@element = element
@timeout = timeout
@message = message
end
def respond_to_missing?(*args)
@element.respond_to?(*args)
end
def method_missing(method, *args, &block)
return super unless @element.respond_to?(method)
Wait.until(@timeout, @message) { wait_until }
@element.__send__(method, *args, &block)
end
end
#
# Wraps an Element so that any subsequent method calls are
# put on hold until the element is present (exists and is visible) on the page.
#
class WhenPresentDecorator < BaseDecorator
def present?
Wait.until(@timeout, @message) { wait_until }
true
rescue Wait::TimeoutError
false
end
private
def wait_until
@element.present?
end
end # WhenPresentDecorator
#
# Wraps an Element so that any subsequent method calls are
# put on hold until the element is enabled (exists and is enabled) on the page.
#
class WhenEnabledDecorator < BaseDecorator
private
def wait_until
@element.enabled?
end
end # WhenEnabledDecorator
#
# Convenience methods for things that eventually become present.
#
# Includers should implement a public #present? and a (possibly private) #selector_string method.
#
module EventuallyPresent
#
# Waits until the element is present.
#
# @example
# browser.text_field(name: "new_user_first_name").when_present.click
# browser.text_field(name: "new_user_first_name").when_present { |field| field.set "Watir" }
# browser.text_field(name: "new_user_first_name").when_present(60).text
#
# @param [Integer] timeout seconds to wait before timing out
#
# @see Watir::Wait
# @see Watir::Element#present?
#
def when_present(timeout = nil)
msg = '#when_present'
repl_msg = '#wait_until_present if a wait is still needed'
Watir.logger.deprecate msg, repl_msg, ids: [:when_present]
timeout ||= Watir.default_timeout
message = "waiting for #{selector_string} to become present"
if block_given?
Wait.until(timeout, message) { present? }
yield self
else
WhenPresentDecorator.new(self, timeout, message)
end
end
#
# Waits until the element is enabled.
#
# @example
# browser.button(name: "new_user_button_2").when_enabled.click
#
# @param [Integer] timeout seconds to wait before timing out
#
# @see Watir::Wait
# @see Watir::Element#enabled?
#
def when_enabled(timeout = nil)
msg = '#when_enabled'
repl_msg = 'wait_until(&:enabled?)'
Watir.logger.deprecate msg, repl_msg, ids: [:when_enabled]
timeout ||= Watir.default_timeout
message = "waiting for #{selector_string} to become enabled"
if block_given?
Wait.until(timeout, message) { enabled? }
yield self
else
WhenEnabledDecorator.new(self, timeout, message)
end
end
end # EventuallyPresent
end # Watir
| jkotests/watir-webdriver | lib/watir/legacy_wait.rb | Ruby | mit | 3,174 |


# geojson-lookup
ITS ALL ABOUT SPEED and no alteration to your GEOJSONs
Lookup Geojson feature collections by indexing them by feature properties (INDEX TABLES) and by a Geometry (R-TREE) all in memory.
###Usage
1) Install through npm
`npm install geojson-lookup`
2) Require the module
`var geoIndex = require("geojson-lookup");`
3) Initialize by passing Properties to indexBy and by passing a geoJson
`var geo = geoIndex.buildIndex([ PROPERTIES_TO_INDEX ],GEOJSON_OBJECT);`
example:
`var geo = geoIndex.buildIndex(["areaType","parentId"],geojs);`
4) Query your polygon by indexed property
- Start by creating an instance of the Querying mechanism `var geoQuery = new geoIndex.Queries();`
- Call the query method on the instantiated object as `.query(INDEXED_PROPERTY, OPERATOR("==" or "!="), VALUE_TO_QUERY)`
- Now you can chain `.and()` , `or.()` to your query with the same parameter as `.query()`
- Once done call the method `.get()` to get your results as an `[ ARRAY_OF_FEATURES ]`
example:
`var resByProp = (geoQuery.query("areaType", "!=" ,'1').and("parentId", "=", "null").or("areaType","=","3").get());`
5) You can query by Lattitude and Longitude
`geoQuery.getByPoint(LAT, LONG)`
example:
`var resByPoint = geoQuery.getByPoint(28.98066, 36.25222);`
returns `[ ARRAY_OF_FEATURES ]`
| nestrom/geojson-lookup | README.md | Markdown | mit | 1,474 |
#!/bin/bash
mkdir -p /build
rpm -qa --qf '%{name}\n' >/build/original_packages.list
yum install -y gcc wget tar pcre-devel.x86_64 zlib-devel.x86_64
| thefab/docker-autoclean-webdav | root/build/add_buildtime_dependencies.sh | Shell | mit | 150 |
<?php
class User_Model extends CI_Model {
public function __construct() {
$this->load->helper('url');
$this->load->database();
}
function login($email, $password) {
$query = $this->db->get_where('user', array('mail_US' => $email, 'password' => md5($password)));
if ($query->row_array()!= null) {
return $query->row_array();
}
return 0;
}
public function set_account($data) {
if($_SESSION['user']){
$this->db->where('id_US', $_SESSION['user']['id_US']);
return $this->db->update('user', $data);
}else
return $this->db->insert('user', $data);
}
}
| BrunoMarty/ComUneTv | application/models/User_Model.php | PHP | mit | 673 |
<?php
return array(
/*
|--------------------------------------------------------------------------
| Database Connections
|--------------------------------------------------------------------------
|
| Here are each of the database connections setup for your application.
| Of course, examples of configuring each database platform that is
| supported by Laravel is shown below to make development simple.
|
|
| All database work in Laravel is done through the PHP PDO facilities
| so make sure you have the driver for your particular database of
| choice installed on your machine before you begin development.
|
*/
'connections' => array(
'mysql' => array(
'driver' => 'mysql',
'host' => 'localhost',
'database' => 'autogarageooij',
'username' => 'root',
'password' => 'root',
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
)
),
);
| stefferd/autogarageooij | app/config/local/database.php | PHP | mit | 925 |
SET NAMES 'utf8';
/*Finder control; Code = 11*/
/*English*/
/*gvLirics*/
insert into site_interface (Text, Control_Id, Code, LangId, Comment, MultipleCont, ColumnIdx)
select "Title", "gvLirics", 11, site_language.Id , "Lirics page", 1, 0 from site_language where LangCode = "en";
insert into site_interface (Text, Control_Id, Code, LangId, Comment, MultipleCont, ColumnIdx)
select "Author", "gvLirics", 11, site_language.Id , "Lirics page", 1, 1 from site_language where LangCode = "en";
insert into site_interface (Text, Control_Id, Code, LangId, Comment, MultipleCont, ColumnIdx)
select "Style", "gvLirics", 11, site_language.Id , "Lirics page", 1, 2 from site_language where LangCode = "en";
insert into site_interface (Text, Control_Id, Code, LangId, Comment, MultipleCont, ColumnIdx)
select "Language", "gvLirics", 11, site_language.Id , "Lirics page", 1, 3 from site_language where LangCode = "en";
insert into site_interface (Text, Control_Id, Code, LangId, Comment, MultipleCont, ColumnIdx)
select "Created", "gvLirics", 11, site_language.Id , "Lirics page", 1, 4 from site_language where LangCode = "en";
insert into site_interface (Text, Control_Id, Code, LangId, Comment, MultipleCont, ColumnIdx)
select "Updated", "gvLirics", 11, site_language.Id , "Lirics page", 1, 5 from site_language where LangCode = "en";
/*Русский*/
/*gvLirics*/
insert into site_interface (Text, Control_Id, Code, LangId, Comment, MultipleCont, ColumnIdx)
select "Название", "gvLirics", 11, site_language.Id , "Lirics page", 1, 0 from site_language where LangCode = "ru";
insert into site_interface (Text, Control_Id, Code, LangId, Comment, MultipleCont, ColumnIdx)
select "Автор", "gvLirics", 11, site_language.Id , "Lirics page", 1, 1 from site_language where LangCode = "ru";
insert into site_interface (Text, Control_Id, Code, LangId, Comment, MultipleCont, ColumnIdx)
select "Стиль", "gvLirics", 11, site_language.Id , "Lirics page", 1, 2 from site_language where LangCode = "ru";
insert into site_interface (Text, Control_Id, Code, LangId, Comment, MultipleCont, ColumnIdx)
select "Язык", "gvLirics", 11, site_language.Id , "Lirics page", 1, 3 from site_language where LangCode = "ru";
insert into site_interface (Text, Control_Id, Code, LangId, Comment, MultipleCont, ColumnIdx)
select "Создано", "gvLirics", 11, site_language.Id , "Lirics page", 1, 4 from site_language where LangCode = "ru";
insert into site_interface (Text, Control_Id, Code, LangId, Comment, MultipleCont, ColumnIdx)
select "Обновлено", "gvLirics", 11, site_language.Id , "Lirics page", 1, 5 from site_language where LangCode = "ru";
| hardsky/music-head | db/Lyrics_Interface.sql | SQL | mit | 2,659 |
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>MTP-ADMIN-LOGIN</title>
<link rel="stylesheet" href="<?php echo base_url(); ?>asset/css/style-login-admin.css" />
<link type ="text/css" rel="stylesheet" href="<?php echo base_url() ?>asset/font-awesome/css/font-awesome.css" />
<script src="<?php echo base_url() ?>asset/js/jquery-1.11.2.min.js"></script>
</head>
<body>
<div class="navbar-admin">
<span style="margin-left:20px;">ADMIN PANEL</span>
</div>
<div class="login-form">
<?php echo form_open(base_url().'index.php/admin/login'); ?>
<i class="fa fa-user" style="margin-left:28px; margin-top:20px; margin-bottom:5px;"></i></br>
<input type="text" name='fadmin' placeholder="UserName" class='input' id='fname'></br>
<div class="err"><?php echo form_error('fadmin'); ?></div>
<i class="fa fa-unlock-alt" style="margin-left:28px; margin-top:15px;"></i></br>
<input type="password" name='fpass' placeholder='PassWord' class="input" id='fpass'></br>
<div class="err"><?php echo form_error('fpass'); ?></div>
<input type="submit" value="LOGIN" class='submit'>
</form>
</div>
<div class="caption">MTPB SHOP. Copyright © 2015 by MTPB-TEAM</div>
</body>
</html> | doananhtu/ShopMTP | application/views/admin/login-admin.php | PHP | mit | 1,271 |
/**
* (c) raptor_MVK, 2015. All rights reserved.
*/
package ru.mvk.iluvatar.descriptor.column;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.function.Function;
public interface ViewFormatter extends Function<Object, String> {
@NotNull
@Override
String apply(@Nullable Object argument);
}
| raptor-mvk/Iluvatar | src/ru/mvk/iluvatar/descriptor/column/ViewFormatter.java | Java | mit | 353 |
function objectSortableOn() {
$('#featured_documents_list').sortable({
update: function() {
$.ajax({
url: '/ajaxChangeFeaturedDocumentOrder.php',
type: 'post',
dataType: "text",
data: $('#featured_documents_list').sortable('serialize')
});
},
handle: '.handle',
revert: true,
scroll: true
});
}
function toggleActiveState(id) {
$.ajax({
url: '/ajaxToggleDocumentFeatureState.php',
type: 'post',
dataType: 'text',
data: {id: id}
}).done(function(data) {
$('#active_state_' + id).html(data);
});
}
function removeFeaturedDocument(id) {
$.ajax({
url: '/ajaxDeleteFeaturedDocument.php',
type: 'post',
dataType: 'text',
data: {id: id}
}).done(function() {
regenerateList();
});
}
function initEditFeaturedDocumentOptions(id) {
//handle existing editor (if necessary)
if ($('#edit_featured_document_options_in_place').length > 0 && editFeaturedDocumentOptionsViewLock == 1) {
cancelEditFeaturedDocumentOptions();
//if lastFeaturedDocumentOptions (last viewed) is being clicked again, just remove the list (above) and exit (return, below)
if (id == lastFeaturedDocumentOptions) {
return;
}
}
//only create a new viewer if there currently isn't one open
if ($('#edit_featured_document_options_in_place').length == 0) {
//keep track of last featured document being viewed
lastFeaturedDocumentOptions = id;
var showEditor = '<div id="edit_featured_document_options_in_place" style="display:none;"></div>';
//create the editable fields
$(showEditor).insertAfter('#featured_document_' + id);
$.ajax({
url: '/ajaxShowFeaturedDocumentOptions.php',
type: 'post',
dataType: 'text',
data: {id: id}
}).done(function(data) {
$('#edit_featured_document_options_in_place').html(data);
//set the lock
editFeaturedDocumentOptionsViewLock = 1;
//display editor
$('#edit_featured_document_options_in_place').fadeIn(500);
//watches the submit button
$('#edit_featured_document_options_form').bind('submit', function(e) {
//e.stop prevents the submit action from executing
e.preventDefault();
$.ajax({
url: this.action,
type: 'post',
dataType: 'script',
data: $(this).serialize()
});
});
$('#edit_featured_document_options_cancel').bind('click', function() {cancelEditFeaturedDocumentOptions();});
//watches the start date selector
$('#start_date_selector').bind('click', function(e) {
showSelectorCalendar(e, '#startMonth', '#startDay', '#startYear');
});
//watches the expire date selector
$('#expire_date_selector').bind('click', function(e) {
showSelectorCalendar(e, '#expireMonth', '#expireDay', '#expireYear');
});
});
}
}
function cancelEditFeaturedDocumentOptions() {
//remove all observers for edit_user and cancel
$('#edit_featured_document_options_form').unbind();
$('#edit_featured_document_options_cancel').unbind();
//remove the edit-in-place dom object
$('#edit_featured_document_options_in_place').remove();
//set the lock
editFeaturedDocumentOptionsViewLock = 0;
}
function regenerateList() {
//grab form fields
var documentType = $('#documentType').val();
var category = $('#categories').val();
var subcategory = $('#subcategories').val();
var subject = $('#subjects').val();
$.ajax({
url: '/ajaxFeaturedDocumentEditor.php',
type: 'post',
dataType: 'text',
data: {documentType: documentType, category: category, subcategory: subcategory, subject: subject}
}).done(function(data) {
$('#featured_documents_list').html(data);
objectSortableOn();
});
}
function updateDocumentType() {
regenerateList();
}
function updateCategories() {
if($('#categories').val() != "") {
updateSubcategories();
} else {
$('#subcategories').html('<option value="">All</option>');
$('#subjects').html('<option value="">All</option>');
regenerateList();
}
}
function updateSubcategories() {
$.ajax({
url: '/ajaxAdminSubcategorySelectList.php',
type: 'post',
dataType: 'text',
data: {category: $('#categories').val()}
}).done(function(data) {
$('#subcategories').html(data);
updateSubjects();
});
}
function updateSubjects() {
$.ajax({
url: '/ajaxAdminSubjectSelectList.php',
type: 'post',
dataType: 'text',
data: {category: $('#categories').val(), subcategory: $('#subcategories').val()}
}).done(function(data) {
$('#subjects').html(data);
regenerateList();
});
}
$(document).ready(function() {
//watches the category and subcategory fields
$('#documentType').bind('change', updateDocumentType);
$('#categories').bind('change', updateCategories);
$('#subcategories').bind('change', updateSubjects);
$('#subjects').bind('change', regenerateList);
regenerateList();
});
$.ajaxSetup({
beforeSend: function() {$('#loading').show()},
complete: function(){$('#loading').hide()},
success: function() {}
}); | omeganetresearch/SoNetCMS | assets/core/resources/javascript/featuredDocumentEditor.js | JavaScript | mit | 5,106 |
#include<Arduino.h>
/*
Fade
This example shows how to fade an LED on pin 9
using the analogWrite() function.
This example code is in the public domain.
*/
int led = 9; // the pin that the LED is attached to
int brightness = 0; // how bright the LED is
int fadeAmount = 5; // how many points to fade the LED by
// the setup routine runs once when you press reset:
void setup() {
// declare pin 9 to be an output:
pinMode(led, OUTPUT);
}
// the loop routine runs over and over again forever:
void loop() {
// set the brightness of pin 9:
analogWrite(led, brightness);
// change the brightness for next time through the loop:
brightness = brightness + fadeAmount;
// reverse the direction of the fading at the ends of the fade:
if (brightness == 0 || brightness == 255) {
fadeAmount = -fadeAmount ;
}
// wait for 30 milliseconds to see the dimming effect
delay(30);
}
| jailuthra/misc | ece/arduino/fade/src/fade.cpp | C++ | mit | 964 |
namespace MiX.Integrate.Shared.Entities.Drivers
{
public class DriverAdditionalDetailField
{
public int Id { get; set; }
public string Label { get; set; }
public string HelpText { get; set; }
public bool IsRequired { get; set; }
public string Value { get; set; }
}
}
| MiXTelematics/MiX.Integrate.Api.Client | MiX.Integrate.Shared/Entities/Drivers/DriverAdditionalDetailField.cs | C# | mit | 283 |
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Stacked Line</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="../../../styles.css" rel="stylesheet" />
<script src="../../../js/jquery-1.9.1.min.js"></script>
<script src="../../../js/knockout-2.2.1.js"></script>
<script src="../../../js/globalize.min.js"></script>
<script src="../../../js/dx.chartjs.js"></script>
</head>
<body>
<script type="text/javascript">
$(function ()
{
var dataSource = [
{ time: "January", food: 3970, capital: 15366, auto: 7818, goods: 9064 },
{ time: "March", food: 3875, capital: 15297, auto: 7518, goods: 9147 },
{ time: "June", food: 4181, capital: 15957, auto: 7603, goods: 9311 },
{ time: "August", food: 3826, capital: 15706, auto: 8046, goods: 9342 },
{ time: "October", food: 3899, capital: 14940, auto: 8233, goods: 9244 },
{ time: "December", food: 3941, capital: 15664, auto: 8642, goods: 10134 }
];
$("#chartContainer").dxChart({
dataSource: dataSource,
commonSeriesSettings: {
type: "stackedLine",
argumentField: "time"
},
commonPaneSettings: {
border: {
visible: true
}
},
commonAxisSettings: {
grid: {
visible: true
}
},
series: [
{ valueField: "food", name: "Food" },
{ valueField: "capital", name: "Capital Goods" },
{ valueField: "auto", name: "Automotive Vehicles" },
{ valueField: "goods", name: "Customer Goods" }
],
title: "Exports of Good in USA by End-Use Category (2005)",
legend: {
verticalAlignment: "bottom",
horizontalAlignment: "center"
},
tooltip:{
enabled: true
}
});
}
);
</script>
<div class="header">
<div class="content">
<a class="button" title="Online Demo Gallery" target="_blank" href="http://chartjs.devexpress.com/Demos/VizGallery/">Online Demo Gallery</a>
<div class = "logo">
<a class="logo" title="ChartJS Gallery" href="../../../index.html"></a>
</div>
</div>
</div>
<div class="line"></div>
<div class="title">
<h1>Charts</h1> <h2>Line And Point Series</h2>
</div>
<div class="content">
<div class="pane">
<div class="long-title"><h3></h3></div>
<div id="chartContainer" style="width: 100%; height: 440px;"></div>
<div class="credits">www.bea.gov</div>
</div>
</div>
</body>
</html> | erreze/jplayer | js/chart/Demos/demos/Charts/Line And Point Series/Stacked Line.html | HTML | mit | 2,544 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>User agent detail - NOKIA-7270</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.3/css/materialize.min.css">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="../circle.css" rel="stylesheet">
</head>
<body>
<div class="container">
<div class="section">
<h1 class="header center orange-text">User agent detail</h1>
<div class="row center">
<h5 class="header light">
NOKIA-7270
</h5>
</div>
</div>
<div class="section">
<table class="striped"><tr><th></th><th colspan="3">General</th><th colspan="5">Device</th><th colspan="3">Bot</th><th colspan="2"></th></tr><tr><th>Provider</th><th>Browser</th><th>Engine</th><th>OS</th><th>Brand</th><th>Model</th><th>Type</th><th>Is mobile</th><th>Is touch</th><th>Is bot</th><th>Name</th><th>Type</th><th>Parse time</th><th>Actions</th></tr><tr><th colspan="14" class="green lighten-3">Test suite</th></tr><tr><td>UAParser<br /><small>v0.5.0.2</small><br /><small>vendor/thadafinser/uap-core/tests/test_device.yaml</small></td><td> </td><td><i class="material-icons">close</i></td><td> </td><td style="border-left: 1px solid #555">Nokia</td><td>7270</td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-cfed3005-df48-4fa8-bf03-4f6ef8988f59">Detail</a>
<!-- Modal Structure -->
<div id="modal-cfed3005-df48-4fa8-bf03-4f6ef8988f59" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>UAParser result detail</h4>
<p><pre><code class="php">Array
(
[user_agent_string] => NOKIA-7270
[family] => Nokia 7270
[brand] => Nokia
[model] => 7270
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><th colspan="14" class="green lighten-3">Providers</th></tr><tr><td>BrowscapFull<br /><small>6014</small><br /></td><td>Nokia </td><td> </td><td> </td><td style="border-left: 1px solid #555">Nokia</td><td></td><td>Mobile Phone</td><td>yes</td><td></td><td style="border-left: 1px solid #555"></td><td></td><td></td><td>0.013</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-47a9cd06-e213-4882-bc34-db6aed664223">Detail</a>
<!-- Modal Structure -->
<div id="modal-47a9cd06-e213-4882-bc34-db6aed664223" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>BrowscapFull result detail</h4>
<p><pre><code class="php">stdClass Object
(
[browser_name_regex] => /^.*nokia.*$/
[browser_name_pattern] => *nokia*
[parent] => Nokia
[comment] => Nokia
[browser] => Nokia
[browser_type] => Browser
[browser_bits] => 0
[browser_maker] => Nokia
[browser_modus] => unknown
[version] => 0.0
[majorver] => 0
[minorver] => 0
[platform] => unknown
[platform_version] => unknown
[platform_description] => unknown
[platform_bits] => 0
[platform_maker] => unknown
[alpha] =>
[beta] =>
[win16] =>
[win32] =>
[win64] =>
[frames] => 1
[iframes] => 1
[tables] => 1
[cookies] => 1
[backgroundsounds] =>
[javascript] => 1
[vbscript] =>
[javaapplets] =>
[activexcontrols] =>
[ismobiledevice] => 1
[istablet] =>
[issyndicationreader] =>
[crawler] =>
[isfake] =>
[isanonymized] =>
[ismodified] =>
[cssversion] => 0
[aolversion] => 0
[device_name] => general Mobile Device
[device_maker] => Nokia
[device_type] => Mobile Phone
[device_pointing_method] => unknown
[device_code_name] => general Mobile Device
[device_brand_name] => Nokia
[renderingengine_name] => unknown
[renderingengine_version] => unknown
[renderingengine_description] => unknown
[renderingengine_maker] => unknown
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>BrowscapLite<br /><small>6014</small><br /></td>
<td colspan="12" class="center-align red lighten-1">
<strong>No result found</strong>
</td>
</tr><tr><td>BrowscapPhp<br /><small>6014</small><br /></td><td>Nokia </td><td><i class="material-icons">close</i></td><td> </td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>Mobile Phone</td><td>yes</td><td></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0.035</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-ad0041a2-b0f4-43f6-a70d-cad1443caa68">Detail</a>
<!-- Modal Structure -->
<div id="modal-ad0041a2-b0f4-43f6-a70d-cad1443caa68" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>BrowscapPhp result detail</h4>
<p><pre><code class="php">stdClass Object
(
[browser_name_regex] => /^.*nokia.*$/
[browser_name_pattern] => *nokia*
[parent] => Nokia
[comment] => Nokia
[browser] => Nokia
[browser_type] => unknown
[browser_bits] => 0
[browser_maker] => Nokia
[browser_modus] => unknown
[version] => 0.0
[majorver] => 0
[minorver] => 0
[platform] => unknown
[platform_version] => unknown
[platform_description] => unknown
[platform_bits] => 0
[platform_maker] => unknown
[alpha] => false
[beta] => false
[win16] => false
[win32] => false
[win64] => false
[frames] => false
[iframes] => false
[tables] => false
[cookies] => false
[backgroundsounds] => false
[javascript] => false
[vbscript] => false
[javaapplets] => false
[activexcontrols] => false
[ismobiledevice] => 1
[istablet] =>
[issyndicationreader] => false
[crawler] =>
[isfake] => false
[isanonymized] => false
[ismodified] => false
[cssversion] => 0
[aolversion] => 0
[device_name] => unknown
[device_maker] => unknown
[device_type] => Mobile Phone
[device_pointing_method] => unknown
[device_code_name] => unknown
[device_brand_name] => unknown
[renderingengine_name] => unknown
[renderingengine_version] => unknown
[renderingengine_description] => unknown
[renderingengine_maker] => unknown
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>DonatjUAParser<br /><small>v0.5.1</small><br /></td><td>NOKIA-7270 </td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-15fbc1f0-2615-4d42-b5d9-a30dd647b050">Detail</a>
<!-- Modal Structure -->
<div id="modal-15fbc1f0-2615-4d42-b5d9-a30dd647b050" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>DonatjUAParser result detail</h4>
<p><pre><code class="php">Array
(
[platform] =>
[browser] => NOKIA-7270
[version] =>
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>JenssegersAgent<br /><small>v2.3.3</small><br /></td><td> </td><td><i class="material-icons">close</i></td><td> </td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>yes</td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0.001</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-b85a2b91-6a55-4436-a82c-1ea0d46e2e51">Detail</a>
<!-- Modal Structure -->
<div id="modal-b85a2b91-6a55-4436-a82c-1ea0d46e2e51" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>JenssegersAgent result detail</h4>
<p><pre><code class="php">Array
(
[browserName] =>
[browserVersion] =>
[osName] =>
[osVersion] =>
[deviceModel] => GenericPhone
[isMobile] => 1
[isRobot] =>
[botName] =>
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>NeutrinoApiCom<br /><small></small><br /></td><td> </td><td><i class="material-icons">close</i></td><td> </td><td style="border-left: 1px solid #555">Nokia</td><td>7270</td><td>mobile-browser</td><td>yes</td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0.21101</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-8c2a7a4e-3fbf-4df2-8d61-5e730422f67b">Detail</a>
<!-- Modal Structure -->
<div id="modal-8c2a7a4e-3fbf-4df2-8d61-5e730422f67b" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>NeutrinoApiCom result detail</h4>
<p><pre><code class="php">stdClass Object
(
[mobile_screen_height] => 0
[is_mobile] => 1
[type] => mobile-browser
[mobile_brand] => Nokia
[mobile_model] => 7270
[version] =>
[is_android] =>
[browser_name] => unknown
[operating_system_family] => unknown
[operating_system_version] =>
[is_ios] =>
[producer] => Nokia
[operating_system] => unknown
[mobile_screen_width] => 0
[mobile_browser] =>
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>PiwikDeviceDetector<br /><small>3.6.1</small><br /></td><td>Nokia Browser </td><td> </td><td>Symbian </td><td style="border-left: 1px solid #555">Nokia</td><td>N7270</td><td>smartphone</td><td>yes</td><td></td><td style="border-left: 1px solid #555"></td><td></td><td></td><td>0.003</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-4a941d34-a8d3-4914-9724-346f60ad7046">Detail</a>
<!-- Modal Structure -->
<div id="modal-4a941d34-a8d3-4914-9724-346f60ad7046" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>PiwikDeviceDetector result detail</h4>
<p><pre><code class="php">Array
(
[client] => Array
(
[type] => browser
[name] => Nokia Browser
[short_name] => NB
[version] =>
[engine] =>
)
[operatingSystem] => Array
(
[name] => Symbian
[short_name] => SYM
[version] =>
[platform] =>
)
[device] => Array
(
[brand] => NK
[brandName] => Nokia
[model] => N7270
[device] => 1
[deviceName] => smartphone
)
[bot] =>
[extra] => Array
(
[isBot] =>
[isBrowser] => 1
[isFeedReader] =>
[isMobileApp] =>
[isPIM] =>
[isLibrary] =>
[isMediaPlayer] =>
[isCamera] =>
[isCarBrowser] =>
[isConsole] =>
[isFeaturePhone] =>
[isPhablet] =>
[isPortableMediaPlayer] =>
[isSmartDisplay] =>
[isSmartphone] => 1
[isTablet] =>
[isTV] =>
[isDesktop] =>
[isMobile] => 1
[isTouchEnabled] =>
)
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>SinergiBrowserDetector<br /><small>6.0.1</small><br /></td><td> </td><td><i class="material-icons">close</i></td><td>Nokia </td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td></td><td><i class="material-icons">close</i></td><td>yes</td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-ec1cd248-02b0-457e-8a9d-35bb99af008c">Detail</a>
<!-- Modal Structure -->
<div id="modal-ec1cd248-02b0-457e-8a9d-35bb99af008c" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>SinergiBrowserDetector result detail</h4>
<p><pre><code class="php">Array
(
[browser] => Sinergi\BrowserDetector\Browser Object
(
[userAgent:Sinergi\BrowserDetector\Browser:private] => Sinergi\BrowserDetector\UserAgent Object
(
[userAgentString:Sinergi\BrowserDetector\UserAgent:private] => NOKIA-7270
)
[name:Sinergi\BrowserDetector\Browser:private] => unknown
[version:Sinergi\BrowserDetector\Browser:private] => unknown
[isRobot:Sinergi\BrowserDetector\Browser:private] =>
[isChromeFrame:Sinergi\BrowserDetector\Browser:private] =>
[isFacebookWebView:Sinergi\BrowserDetector\Browser:private] =>
[isCompatibilityMode:Sinergi\BrowserDetector\Browser:private] =>
)
[operatingSystem] => Sinergi\BrowserDetector\Os Object
(
[name:Sinergi\BrowserDetector\Os:private] => Nokia
[version:Sinergi\BrowserDetector\Os:private] => unknown
[isMobile:Sinergi\BrowserDetector\Os:private] => 1
[userAgent:Sinergi\BrowserDetector\Os:private] => Sinergi\BrowserDetector\UserAgent Object
(
[userAgentString:Sinergi\BrowserDetector\UserAgent:private] => NOKIA-7270
)
)
[device] => Sinergi\BrowserDetector\Device Object
(
[name:Sinergi\BrowserDetector\Device:private] => unknown
[userAgent:Sinergi\BrowserDetector\Device:private] => Sinergi\BrowserDetector\UserAgent Object
(
[userAgentString:Sinergi\BrowserDetector\UserAgent:private] => NOKIA-7270
)
)
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>UAParser<br /><small>v3.4.5</small><br /></td><td> </td><td><i class="material-icons">close</i></td><td> </td><td style="border-left: 1px solid #555">Nokia</td><td>7270</td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0.004</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-3160e405-8a8f-46dd-8f47-5115f06462d2">Detail</a>
<!-- Modal Structure -->
<div id="modal-3160e405-8a8f-46dd-8f47-5115f06462d2" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>UAParser result detail</h4>
<p><pre><code class="php">UAParser\Result\Client Object
(
[ua] => UAParser\Result\UserAgent Object
(
[major] =>
[minor] =>
[patch] =>
[family] => Other
)
[os] => UAParser\Result\OperatingSystem Object
(
[major] =>
[minor] =>
[patch] =>
[patchMinor] =>
[family] => Other
)
[device] => UAParser\Result\Device Object
(
[brand] => Nokia
[model] => 7270
[family] => Nokia 7270
)
[originalUserAgent] => NOKIA-7270
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>UserAgentApiCom<br /><small></small><br /></td><td> </td><td> </td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>Mobile</td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0.15101</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-afeb05fb-26b9-4509-b8ac-0c604a9e97d6">Detail</a>
<!-- Modal Structure -->
<div id="modal-afeb05fb-26b9-4509-b8ac-0c604a9e97d6" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>UserAgentApiCom result detail</h4>
<p><pre><code class="php">stdClass Object
(
[platform_name] => Nokia
[platform_version] => 7270
[platform_type] => Mobile
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>UserAgentStringCom<br /><small></small><br /></td>
<td colspan="12" class="center-align red lighten-1">
<strong>No result found</strong>
</td>
</tr><tr><td>WhatIsMyBrowserCom<br /><small></small><br /></td><td>Nokia Browser </td><td> </td><td> </td><td style="border-left: 1px solid #555">Nokia</td><td></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0.24001</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-5fc1ff22-a74d-481b-9ad1-fcfde73ded9c">Detail</a>
<!-- Modal Structure -->
<div id="modal-5fc1ff22-a74d-481b-9ad1-fcfde73ded9c" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>WhatIsMyBrowserCom result detail</h4>
<p><pre><code class="php">stdClass Object
(
[operating_system_name] =>
[simple_sub_description_string] =>
[simple_browser_string] => Nokia Browser
[browser_version] =>
[extra_info] => Array
(
)
[operating_platform] =>
[extra_info_table] => Array
(
)
[layout_engine_name] =>
[detected_addons] => Array
(
)
[operating_system_flavour_code] =>
[hardware_architecture] =>
[operating_system_flavour] =>
[operating_system_frameworks] => Array
(
)
[browser_name_code] => nokia-browser
[operating_system_version] =>
[simple_operating_platform_string] => Nokia
[is_abusive] =>
[layout_engine_version] =>
[browser_capabilities] => Array
(
)
[operating_platform_vendor_name] => Nokia
[operating_system] =>
[operating_system_version_full] =>
[operating_platform_code] =>
[browser_name] => Nokia Browser
[operating_system_name_code] =>
[user_agent] => NOKIA-7270
[browser_version_full] =>
[browser] => Nokia Browser
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>WhichBrowser<br /><small>v2.0.18</small><br /></td><td> </td><td> </td><td> </td><td style="border-left: 1px solid #555">Nokia</td><td>7270</td><td>mobile:feature</td><td>yes</td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0.001</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-083a336f-5d73-4505-84f3-c5fc9bb78652">Detail</a>
<!-- Modal Structure -->
<div id="modal-083a336f-5d73-4505-84f3-c5fc9bb78652" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>WhichBrowser result detail</h4>
<p><pre><code class="php">Array
(
[device] => Array
(
[type] => mobile
[subtype] => feature
[manufacturer] => Nokia
[model] => 7270
)
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>Woothee<br /><small>v1.2.0</small><br /></td>
<td colspan="12" class="center-align red lighten-1">
<strong>No result found</strong>
</td>
</tr><tr><td>Wurfl<br /><small>1.7.1.0</small><br /></td><td> </td><td><i class="material-icons">close</i></td><td> </td><td style="border-left: 1px solid #555"></td><td></td><td>Feature Phone</td><td>yes</td><td></td><td style="border-left: 1px solid #555"></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0.016</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-a2bedf8c-4a95-42a7-96c5-aaf233b2ac50">Detail</a>
<!-- Modal Structure -->
<div id="modal-a2bedf8c-4a95-42a7-96c5-aaf233b2ac50" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>Wurfl result detail</h4>
<p><pre><code class="php">Array
(
[virtual] => Array
(
[is_android] => false
[is_ios] => false
[is_windows_phone] => false
[is_app] => false
[is_full_desktop] => false
[is_largescreen] => false
[is_mobile] => true
[is_robot] => false
[is_smartphone] => false
[is_touchscreen] => false
[is_wml_preferred] => false
[is_xhtmlmp_preferred] => true
[is_html_preferred] => false
[advertised_device_os] =>
[advertised_device_os_version] =>
[advertised_browser] =>
[advertised_browser_version] =>
[complete_device_name] =>
[device_name] =>
[form_factor] => Feature Phone
[is_phone] => true
[is_app_webview] => false
)
[all] => Array
(
[brand_name] =>
[model_name] =>
[unique] => true
[ununiqueness_handler] =>
[is_wireless_device] => true
[device_claims_web_support] => false
[has_qwerty_keyboard] => false
[can_skip_aligned_link_row] => false
[uaprof] =>
[uaprof2] =>
[uaprof3] =>
[nokia_series] => 0
[nokia_edition] => 0
[device_os] =>
[mobile_browser] =>
[mobile_browser_version] =>
[device_os_version] =>
[pointing_method] =>
[release_date] => 2002_january
[marketing_name] =>
[model_extra_info] =>
[nokia_feature_pack] => 0
[can_assign_phone_number] => true
[is_tablet] => false
[manufacturer_name] =>
[is_bot] => false
[is_google_glass] => false
[proportional_font] => false
[built_in_back_button_support] => false
[card_title_support] => true
[softkey_support] => false
[table_support] => true
[numbered_menus] => false
[menu_with_select_element_recommended] => false
[menu_with_list_of_links_recommended] => true
[icons_on_menu_items_support] => false
[break_list_of_links_with_br_element_recommended] => true
[access_key_support] => false
[wrap_mode_support] => false
[times_square_mode_support] => false
[deck_prefetch_support] => false
[elective_forms_recommended] => true
[wizards_recommended] => false
[image_as_link_support] => false
[insert_br_element_after_widget_recommended] => false
[wml_can_display_images_and_text_on_same_line] => false
[wml_displays_image_in_center] => false
[opwv_wml_extensions_support] => false
[wml_make_phone_call_string] => wtai://wp/mc;
[chtml_display_accesskey] => false
[emoji] => false
[chtml_can_display_images_and_text_on_same_line] => false
[chtml_displays_image_in_center] => false
[imode_region] => none
[chtml_make_phone_call_string] => tel:
[chtml_table_support] => false
[xhtml_honors_bgcolor] => false
[xhtml_supports_forms_in_table] => false
[xhtml_support_wml2_namespace] => false
[xhtml_autoexpand_select] => false
[xhtml_select_as_dropdown] => false
[xhtml_select_as_radiobutton] => false
[xhtml_select_as_popup] => false
[xhtml_display_accesskey] => false
[xhtml_supports_invisible_text] => false
[xhtml_supports_inline_input] => false
[xhtml_supports_monospace_font] => false
[xhtml_supports_table_for_layout] => false
[xhtml_supports_css_cell_table_coloring] => false
[xhtml_format_as_css_property] => false
[xhtml_format_as_attribute] => false
[xhtml_nowrap_mode] => false
[xhtml_marquee_as_css_property] => false
[xhtml_readable_background_color1] => #FFFFFF
[xhtml_readable_background_color2] => #FFFFFF
[xhtml_allows_disabled_form_elements] => false
[xhtml_document_title_support] => true
[xhtml_preferred_charset] => utf8
[opwv_xhtml_extensions_support] => false
[xhtml_make_phone_call_string] => tel:
[xhtmlmp_preferred_mime_type] => application/vnd.wap.xhtml+xml
[xhtml_table_support] => false
[xhtml_send_sms_string] => none
[xhtml_send_mms_string] => none
[xhtml_file_upload] => not_supported
[cookie_support] => true
[accept_third_party_cookie] => true
[xhtml_supports_iframe] => none
[xhtml_avoid_accesskeys] => false
[xhtml_can_embed_video] => none
[ajax_support_javascript] => false
[ajax_manipulate_css] => false
[ajax_support_getelementbyid] => false
[ajax_support_inner_html] => false
[ajax_xhr_type] => none
[ajax_manipulate_dom] => false
[ajax_support_events] => false
[ajax_support_event_listener] => false
[ajax_preferred_geoloc_api] => none
[xhtml_support_level] => 1
[preferred_markup] => html_wi_oma_xhtmlmp_1_0
[wml_1_1] => true
[wml_1_2] => false
[wml_1_3] => false
[html_wi_w3_xhtmlbasic] => true
[html_wi_oma_xhtmlmp_1_0] => true
[html_wi_imode_html_1] => false
[html_wi_imode_html_2] => false
[html_wi_imode_html_3] => false
[html_wi_imode_html_4] => false
[html_wi_imode_html_5] => false
[html_wi_imode_htmlx_1] => false
[html_wi_imode_htmlx_1_1] => false
[html_wi_imode_compact_generic] => false
[html_web_3_2] => false
[html_web_4_0] => false
[voicexml] => false
[multipart_support] => false
[total_cache_disable_support] => false
[time_to_live_support] => false
[resolution_width] => 90
[resolution_height] => 90
[columns] => 11
[max_image_width] => 90
[max_image_height] => 35
[rows] => 6
[physical_screen_width] => 27
[physical_screen_height] => 27
[dual_orientation] => false
[density_class] => 1.0
[wbmp] => true
[bmp] => false
[epoc_bmp] => false
[gif_animated] => false
[jpg] => false
[png] => false
[tiff] => false
[transparent_png_alpha] => false
[transparent_png_index] => false
[svgt_1_1] => false
[svgt_1_1_plus] => false
[greyscale] => false
[gif] => true
[colors] => 256
[webp_lossy_support] => false
[webp_lossless_support] => false
[post_method_support] => true
[basic_authentication_support] => true
[empty_option_value_support] => true
[emptyok] => false
[nokia_voice_call] => false
[wta_voice_call] => false
[wta_phonebook] => false
[wta_misc] => false
[wta_pdc] => false
[https_support] => true
[phone_id_provided] => false
[max_data_rate] => 9
[wifi] => false
[sdio] => false
[vpn] => false
[has_cellular_radio] => true
[max_deck_size] => 4000
[max_url_length_in_requests] => 128
[max_url_length_homepage] => 0
[max_url_length_bookmark] => 0
[max_url_length_cached_page] => 0
[max_no_of_connection_settings] => 0
[max_no_of_bookmarks] => 0
[max_length_of_username] => 0
[max_length_of_password] => 0
[max_object_size] => 0
[downloadfun_support] => false
[directdownload_support] => false
[inline_support] => false
[oma_support] => false
[ringtone] => false
[ringtone_3gpp] => false
[ringtone_midi_monophonic] => false
[ringtone_midi_polyphonic] => false
[ringtone_imelody] => false
[ringtone_digiplug] => false
[ringtone_compactmidi] => false
[ringtone_mmf] => false
[ringtone_rmf] => false
[ringtone_xmf] => false
[ringtone_amr] => false
[ringtone_awb] => false
[ringtone_aac] => false
[ringtone_wav] => false
[ringtone_mp3] => false
[ringtone_spmidi] => false
[ringtone_qcelp] => false
[ringtone_voices] => 1
[ringtone_df_size_limit] => 0
[ringtone_directdownload_size_limit] => 0
[ringtone_inline_size_limit] => 0
[ringtone_oma_size_limit] => 0
[wallpaper] => false
[wallpaper_max_width] => 0
[wallpaper_max_height] => 0
[wallpaper_preferred_width] => 0
[wallpaper_preferred_height] => 0
[wallpaper_resize] => none
[wallpaper_wbmp] => false
[wallpaper_bmp] => false
[wallpaper_gif] => false
[wallpaper_jpg] => false
[wallpaper_png] => false
[wallpaper_tiff] => false
[wallpaper_greyscale] => false
[wallpaper_colors] => 2
[wallpaper_df_size_limit] => 0
[wallpaper_directdownload_size_limit] => 0
[wallpaper_inline_size_limit] => 0
[wallpaper_oma_size_limit] => 0
[screensaver] => false
[screensaver_max_width] => 0
[screensaver_max_height] => 0
[screensaver_preferred_width] => 0
[screensaver_preferred_height] => 0
[screensaver_resize] => none
[screensaver_wbmp] => false
[screensaver_bmp] => false
[screensaver_gif] => false
[screensaver_jpg] => false
[screensaver_png] => false
[screensaver_greyscale] => false
[screensaver_colors] => 2
[screensaver_df_size_limit] => 0
[screensaver_directdownload_size_limit] => 0
[screensaver_inline_size_limit] => 0
[screensaver_oma_size_limit] => 0
[picture] => false
[picture_max_width] => 0
[picture_max_height] => 0
[picture_preferred_width] => 0
[picture_preferred_height] => 0
[picture_resize] => none
[picture_wbmp] => false
[picture_bmp] => false
[picture_gif] => false
[picture_jpg] => false
[picture_png] => false
[picture_greyscale] => false
[picture_colors] => 2
[picture_df_size_limit] => 0
[picture_directdownload_size_limit] => 0
[picture_inline_size_limit] => 0
[picture_oma_size_limit] => 0
[video] => false
[oma_v_1_0_forwardlock] => false
[oma_v_1_0_combined_delivery] => false
[oma_v_1_0_separate_delivery] => false
[streaming_video] => false
[streaming_3gpp] => false
[streaming_mp4] => false
[streaming_mov] => false
[streaming_video_size_limit] => 0
[streaming_real_media] => none
[streaming_flv] => false
[streaming_3g2] => false
[streaming_vcodec_h263_0] => -1
[streaming_vcodec_h263_3] => -1
[streaming_vcodec_mpeg4_sp] => -1
[streaming_vcodec_mpeg4_asp] => -1
[streaming_vcodec_h264_bp] => -1
[streaming_acodec_amr] => none
[streaming_acodec_aac] => none
[streaming_wmv] => none
[streaming_preferred_protocol] => rtsp
[streaming_preferred_http_protocol] => none
[wap_push_support] => false
[connectionless_service_indication] => false
[connectionless_service_load] => false
[connectionless_cache_operation] => false
[connectionoriented_unconfirmed_service_indication] => false
[connectionoriented_unconfirmed_service_load] => false
[connectionoriented_unconfirmed_cache_operation] => false
[connectionoriented_confirmed_service_indication] => false
[connectionoriented_confirmed_service_load] => false
[connectionoriented_confirmed_cache_operation] => false
[utf8_support] => false
[ascii_support] => false
[iso8859_support] => false
[expiration_date] => false
[j2me_cldc_1_0] => false
[j2me_cldc_1_1] => false
[j2me_midp_1_0] => false
[j2me_midp_2_0] => false
[doja_1_0] => false
[doja_1_5] => false
[doja_2_0] => false
[doja_2_1] => false
[doja_2_2] => false
[doja_3_0] => false
[doja_3_5] => false
[doja_4_0] => false
[j2me_jtwi] => false
[j2me_mmapi_1_0] => false
[j2me_mmapi_1_1] => false
[j2me_wmapi_1_0] => false
[j2me_wmapi_1_1] => false
[j2me_wmapi_2_0] => false
[j2me_btapi] => false
[j2me_3dapi] => false
[j2me_locapi] => false
[j2me_nokia_ui] => false
[j2me_motorola_lwt] => false
[j2me_siemens_color_game] => false
[j2me_siemens_extension] => false
[j2me_heap_size] => 0
[j2me_max_jar_size] => 0
[j2me_storage_size] => 0
[j2me_max_record_store_size] => 0
[j2me_screen_width] => 0
[j2me_screen_height] => 0
[j2me_canvas_width] => 0
[j2me_canvas_height] => 0
[j2me_bits_per_pixel] => 0
[j2me_audio_capture_enabled] => false
[j2me_video_capture_enabled] => false
[j2me_photo_capture_enabled] => false
[j2me_capture_image_formats] => none
[j2me_http] => false
[j2me_https] => false
[j2me_socket] => false
[j2me_udp] => false
[j2me_serial] => false
[j2me_gif] => false
[j2me_gif89a] => false
[j2me_jpg] => false
[j2me_png] => false
[j2me_bmp] => false
[j2me_bmp3] => false
[j2me_wbmp] => false
[j2me_midi] => false
[j2me_wav] => false
[j2me_amr] => false
[j2me_mp3] => false
[j2me_mp4] => false
[j2me_imelody] => false
[j2me_rmf] => false
[j2me_au] => false
[j2me_aac] => false
[j2me_realaudio] => false
[j2me_xmf] => false
[j2me_wma] => false
[j2me_3gpp] => false
[j2me_h263] => false
[j2me_svgt] => false
[j2me_mpeg4] => false
[j2me_realvideo] => false
[j2me_real8] => false
[j2me_realmedia] => false
[j2me_left_softkey_code] => 0
[j2me_right_softkey_code] => 0
[j2me_middle_softkey_code] => 0
[j2me_select_key_code] => 0
[j2me_return_key_code] => 0
[j2me_clear_key_code] => 0
[j2me_datefield_no_accepts_null_date] => false
[j2me_datefield_broken] => false
[receiver] => false
[sender] => false
[mms_max_size] => 0
[mms_max_height] => 0
[mms_max_width] => 0
[built_in_recorder] => false
[built_in_camera] => false
[mms_jpeg_baseline] => false
[mms_jpeg_progressive] => false
[mms_gif_static] => false
[mms_gif_animated] => false
[mms_png] => false
[mms_bmp] => false
[mms_wbmp] => false
[mms_amr] => false
[mms_wav] => false
[mms_midi_monophonic] => false
[mms_midi_polyphonic] => false
[mms_midi_polyphonic_voices] => 0
[mms_spmidi] => false
[mms_mmf] => false
[mms_mp3] => false
[mms_evrc] => false
[mms_qcelp] => false
[mms_ota_bitmap] => false
[mms_nokia_wallpaper] => false
[mms_nokia_operatorlogo] => false
[mms_nokia_3dscreensaver] => false
[mms_nokia_ringingtone] => false
[mms_rmf] => false
[mms_xmf] => false
[mms_symbian_install] => false
[mms_jar] => false
[mms_jad] => false
[mms_vcard] => false
[mms_vcalendar] => false
[mms_wml] => false
[mms_wbxml] => false
[mms_wmlc] => false
[mms_video] => false
[mms_mp4] => false
[mms_3gpp] => false
[mms_3gpp2] => false
[mms_max_frame_rate] => 0
[nokiaring] => false
[picturemessage] => false
[operatorlogo] => false
[largeoperatorlogo] => false
[callericon] => false
[nokiavcard] => false
[nokiavcal] => false
[sckl_ringtone] => false
[sckl_operatorlogo] => false
[sckl_groupgraphic] => false
[sckl_vcard] => false
[sckl_vcalendar] => false
[text_imelody] => false
[ems] => false
[ems_variablesizedpictures] => false
[ems_imelody] => false
[ems_odi] => false
[ems_upi] => false
[ems_version] => 0
[siemens_ota] => false
[siemens_logo_width] => 101
[siemens_logo_height] => 29
[siemens_screensaver_width] => 101
[siemens_screensaver_height] => 50
[gprtf] => false
[sagem_v1] => false
[sagem_v2] => false
[panasonic] => false
[sms_enabled] => true
[wav] => false
[mmf] => false
[smf] => false
[mld] => false
[midi_monophonic] => false
[midi_polyphonic] => false
[sp_midi] => false
[rmf] => false
[xmf] => false
[compactmidi] => false
[digiplug] => false
[nokia_ringtone] => false
[imelody] => false
[au] => false
[amr] => false
[awb] => false
[aac] => false
[mp3] => false
[voices] => 1
[qcelp] => false
[evrc] => false
[flash_lite_version] =>
[fl_wallpaper] => false
[fl_screensaver] => false
[fl_standalone] => false
[fl_browser] => false
[fl_sub_lcd] => false
[full_flash_support] => false
[css_supports_width_as_percentage] => true
[css_border_image] => none
[css_rounded_corners] => none
[css_gradient] => none
[css_spriting] => false
[css_gradient_linear] => none
[is_transcoder] => false
[transcoder_ua_header] => user-agent
[rss_support] => false
[pdf_support] => false
[progressive_download] => false
[playback_vcodec_h263_0] => -1
[playback_vcodec_h263_3] => -1
[playback_vcodec_mpeg4_sp] => -1
[playback_vcodec_mpeg4_asp] => -1
[playback_vcodec_h264_bp] => -1
[playback_real_media] => none
[playback_3gpp] => false
[playback_3g2] => false
[playback_mp4] => false
[playback_mov] => false
[playback_acodec_amr] => none
[playback_acodec_aac] => none
[playback_df_size_limit] => 0
[playback_directdownload_size_limit] => 0
[playback_inline_size_limit] => 0
[playback_oma_size_limit] => 0
[playback_acodec_qcelp] => false
[playback_wmv] => none
[hinted_progressive_download] => false
[html_preferred_dtd] => xhtml_mp1
[viewport_supported] => false
[viewport_width] =>
[viewport_userscalable] =>
[viewport_initial_scale] =>
[viewport_maximum_scale] =>
[viewport_minimum_scale] =>
[mobileoptimized] => false
[handheldfriendly] => false
[canvas_support] => none
[image_inlining] => false
[is_smarttv] => false
[is_console] => false
[nfc_support] => false
[ux_full_desktop] => false
[jqm_grade] => none
[is_sencha_touch_ok] => false
)
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>Zsxsoft<br /><small>1.3</small><br /></td><td>Nokia Web Browser </td><td><i class="material-icons">close</i></td><td> </td><td style="border-left: 1px solid #555">Nokia</td><td></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-5d43e024-b46c-44f6-8914-529b05569bc2">Detail</a>
<!-- Modal Structure -->
<div id="modal-5d43e024-b46c-44f6-8914-529b05569bc2" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>Zsxsoft result detail</h4>
<p><pre><code class="php">Array
(
[browser] => Array
(
[link] => http://www.nokia.com/browser
[title] => Nokia Web Browser
[name] => Nokia Web Browser
[version] =>
[code] => maemo
[image] => img/16/browser/maemo.png
)
[os] => Array
(
[link] =>
[name] =>
[version] =>
[code] => null
[x64] =>
[title] =>
[type] => os
[dir] => os
[image] => img/16/os/null.png
)
[device] => Array
(
[link] => http://www.nokia.com/
[title] => Nokia
[model] =>
[brand] => Nokia
[code] => nokia
[dir] => device
[type] => device
[image] => img/16/device/nokia.png
)
[platform] => Array
(
[link] => http://www.nokia.com/
[title] => Nokia
[model] =>
[brand] => Nokia
[code] => nokia
[dir] => device
[type] => device
[image] => img/16/device/nokia.png
)
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr></table>
</div>
<div class="section">
<h1 class="header center orange-text">About this comparison</h1>
<div class="row center">
<h5 class="header light">
The primary goal of this project is simple<br />
I wanted to know which user agent parser is the most accurate in each part - device detection, bot detection and so on...<br />
<br />
The secondary goal is to provide a source for all user agent parsers to improve their detection based on this results.<br />
<br />
You can also improve this further, by suggesting ideas at <a href="https://github.com/ThaDafinser/UserAgentParserComparison">ThaDafinser/UserAgentParserComparison</a><br />
<br />
The comparison is based on the abstraction by <a href="https://github.com/ThaDafinser/UserAgentParser">ThaDafinser/UserAgentParser</a>
</h5>
</div>
</div>
<div class="card">
<div class="card-content">
Comparison created <i>2016-05-10 08:10:04</i> | by
<a href="https://github.com/ThaDafinser">ThaDafinser</a>
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.3/js/materialize.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/list.js/1.2.0/list.min.js"></script>
<script>
$(document).ready(function(){
// the "href" attribute of .modal-trigger must specify the modal ID that wants to be triggered
$('.modal-trigger').leanModal();
});
</script>
</body>
</html> | ThaDafinser/UserAgentParserComparison | v5/user-agent-detail/e7/19/e71907cf-88e2-4e8e-a205-59563dc4ace5.html | HTML | mit | 48,864 |
<?xml version="1.0" ?><!DOCTYPE TS><TS language="ca" version="2.0">
<defaultcodec>UTF-8</defaultcodec>
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About Geocoin</source>
<translation>A prop de Geocoin</translation>
</message>
<message>
<location line="+39"/>
<source><b>Geocoin</b> version</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+57"/>
<source>
This is experimental software.
Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php.
This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young ([email protected]) and UPnP software written by Thomas Bernard.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../aboutdialog.cpp" line="+14"/>
<source>Copyright</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>The Geocoin developers</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>AddressBookPage</name>
<message>
<location filename="../forms/addressbookpage.ui" line="+14"/>
<source>Address Book</source>
<translation>Llibreta d'adreçes</translation>
</message>
<message>
<location line="+19"/>
<source>Double-click to edit address or label</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+27"/>
<source>Create a new address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>Copy the currently selected address to the system clipboard</source>
<translation>Copia la selecció actual al porta-retalls del sistema</translation>
</message>
<message>
<location line="-11"/>
<source>&New Address</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../addressbookpage.cpp" line="+63"/>
<source>These are your Geocoin addresses for receiving payments. You may want to give a different one to each sender so you can keep track of who is paying you.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/addressbookpage.ui" line="+14"/>
<source>&Copy Address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>Show &QR Code</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>Sign a message to prove you own a Geocoin address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Sign &Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+25"/>
<source>Delete the currently selected address from the list</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+27"/>
<source>Export the data in the current tab to a file</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Export</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-44"/>
<source>Verify a message to ensure it was signed with a specified Geocoin address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Verify Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>&Delete</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../addressbookpage.cpp" line="-5"/>
<source>These are your Geocoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>Copy &Label</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>&Edit</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Send &Coins</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+260"/>
<source>Export Address Book Data</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Comma separated file (*.csv)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>Error exporting</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Could not write to file %1.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>AddressTableModel</name>
<message>
<location filename="../addresstablemodel.cpp" line="+144"/>
<source>Label</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+36"/>
<source>(no label)</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>AskPassphraseDialog</name>
<message>
<location filename="../forms/askpassphrasedialog.ui" line="+26"/>
<source>Passphrase Dialog</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+21"/>
<source>Enter passphrase</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>New passphrase</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>Repeat new passphrase</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="+33"/>
<source>Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Encrypt wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>This operation needs your wallet passphrase to unlock the wallet.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Unlock wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>This operation needs your wallet passphrase to decrypt the wallet.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Decrypt wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Change passphrase</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Enter the old and new passphrase to the wallet.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+46"/>
<source>Confirm wallet encryption</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR BITCOINS</b>!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Are you sure you wish to encrypt your wallet?</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+100"/>
<location line="+24"/>
<source>Warning: The Caps Lock key is on!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-130"/>
<location line="+58"/>
<source>Wallet encrypted</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-56"/>
<source>Geocoin will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your geocoins from being stolen by malware infecting your computer.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<location line="+7"/>
<location line="+42"/>
<location line="+6"/>
<source>Wallet encryption failed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-54"/>
<source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<location line="+48"/>
<source>The supplied passphrases do not match.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-37"/>
<source>Wallet unlock failed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<location line="+11"/>
<location line="+19"/>
<source>The passphrase entered for the wallet decryption was incorrect.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-20"/>
<source>Wallet decryption failed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>Wallet passphrase was successfully changed.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>GeocoinGUI</name>
<message>
<location filename="../geocoingui.cpp" line="+233"/>
<source>Sign &message...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+280"/>
<source>Synchronizing with network...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-349"/>
<source>&Overview</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Show general overview of wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+20"/>
<source>&Transactions</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Browse transaction history</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Edit the list of stored addresses and labels</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-14"/>
<source>Show the list of addresses for receiving payments</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+31"/>
<source>E&xit</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Quit application</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Show information about Geocoin</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>About &Qt</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Show information about Qt</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>&Options...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>&Encrypt Wallet...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Backup Wallet...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>&Change Passphrase...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+285"/>
<source>Importing blocks from disk...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Reindexing blocks on disk...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-347"/>
<source>Send coins to a Geocoin address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+49"/>
<source>Modify configuration options for Geocoin</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+9"/>
<source>Backup wallet to another location</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Change the passphrase used for wallet encryption</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>&Debug window</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Open debugging and diagnostic console</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-4"/>
<source>&Verify message...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-165"/>
<location line="+530"/>
<source>Geocoin</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-530"/>
<source>Wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+101"/>
<source>&Send</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>&Receive</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>&Addresses</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+22"/>
<source>&About Geocoin</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+9"/>
<source>&Show / Hide</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Show or hide the main Window</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Encrypt the private keys that belong to your wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Sign messages with your Geocoin addresses to prove you own them</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Verify messages to ensure they were signed with specified Geocoin addresses</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+28"/>
<source>&File</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>&Settings</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>&Help</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+9"/>
<source>Tabs toolbar</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+17"/>
<location line="+10"/>
<source>[testnet]</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+47"/>
<source>Geocoin client</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="+141"/>
<source>%n active connection(s) to Geocoin network</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+22"/>
<source>No block source available...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+12"/>
<source>Processed %1 of %2 (estimated) blocks of transaction history.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Processed %1 blocks of transaction history.</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="+20"/>
<source>%n hour(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n day(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n week(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+4"/>
<source>%1 behind</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>Last received block was generated %1 ago.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Transactions after this will not yet be visible.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+22"/>
<source>Error</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Warning</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Information</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+70"/>
<source>This transaction is over the size limit. You can still send it for a fee of %1, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-140"/>
<source>Up to date</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+31"/>
<source>Catching up...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+113"/>
<source>Confirm transaction fee</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Sent transaction</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Incoming transaction</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Date: %1
Amount: %2
Type: %3
Address: %4
</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+33"/>
<location line="+23"/>
<source>URI handling</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-23"/>
<location line="+23"/>
<source>URI can not be parsed! This can be caused by an invalid Geocoin address or malformed URI parameters.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+17"/>
<source>Wallet is <b>encrypted</b> and currently <b>unlocked</b></source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Wallet is <b>encrypted</b> and currently <b>locked</b></source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../geocoin.cpp" line="+111"/>
<source>A fatal error occurred. Geocoin can no longer continue safely and will quit.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>ClientModel</name>
<message>
<location filename="../clientmodel.cpp" line="+104"/>
<source>Network Alert</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>EditAddressDialog</name>
<message>
<location filename="../forms/editaddressdialog.ui" line="+14"/>
<source>Edit Address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>&Label</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>The label associated with this address book entry</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>&Address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>The address associated with this address book entry. This can only be modified for sending addresses.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../editaddressdialog.cpp" line="+21"/>
<source>New receiving address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>New sending address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Edit receiving address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Edit sending address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+76"/>
<source>The entered address "%1" is already in the address book.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-5"/>
<source>The entered address "%1" is not a valid Geocoin address.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>Could not unlock wallet.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>New key generation failed.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>GUIUtil::HelpMessageBox</name>
<message>
<location filename="../guiutil.cpp" line="+424"/>
<location line="+12"/>
<source>Geocoin-Qt</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-12"/>
<source>version</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Usage:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>command-line options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>UI options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Set language, for example "de_DE" (default: system locale)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Start minimized</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Show splash screen on startup (default: 1)</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>OptionsDialog</name>
<message>
<location filename="../forms/optionsdialog.ui" line="+14"/>
<source>Options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>&Main</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>Pay transaction &fee</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+31"/>
<source>Automatically start Geocoin after logging in to the system.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Start Geocoin on system login</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+35"/>
<source>Reset all client options to default.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Reset Options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>&Network</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Automatically open the Geocoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Map port using &UPnP</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Connect to the Geocoin network through a SOCKS proxy (e.g. when connecting through Tor).</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Connect through SOCKS proxy:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+9"/>
<source>Proxy &IP:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>IP address of the proxy (e.g. 127.0.0.1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>&Port:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>Port of the proxy (e.g. 9050)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>SOCKS &Version:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>SOCKS version of the proxy (e.g. 5)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+36"/>
<source>&Window</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Show only a tray icon after minimizing the window.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Minimize to the tray instead of the taskbar</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>M&inimize on close</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+21"/>
<source>&Display</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>User Interface &language:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>The user interface language can be set here. This setting will take effect after restarting Geocoin.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>&Unit to show amounts in:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>Choose the default subdivision unit to show in the interface and when sending coins.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+9"/>
<source>Whether to show Geocoin addresses in the transaction list or not.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Display addresses in transaction list</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+71"/>
<source>&OK</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>&Cancel</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>&Apply</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../optionsdialog.cpp" line="+53"/>
<source>default</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+130"/>
<source>Confirm options reset</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Some settings may require a client restart to take effect.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Do you want to proceed?</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+42"/>
<location line="+9"/>
<source>Warning</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-9"/>
<location line="+9"/>
<source>This setting will take effect after restarting Geocoin.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+29"/>
<source>The supplied proxy address is invalid.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>OverviewPage</name>
<message>
<location filename="../forms/overviewpage.ui" line="+14"/>
<source>Form</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+50"/>
<location line="+166"/>
<source>The displayed information may be out of date. Your wallet automatically synchronizes with the Geocoin network after a connection is established, but this process has not completed yet.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-124"/>
<source>Balance:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+29"/>
<source>Unconfirmed:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-78"/>
<source>Wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+107"/>
<source>Immature:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>Mined balance that has not yet matured</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+46"/>
<source><b>Recent transactions</b></source>
<translation type="unfinished"/>
</message>
<message>
<location line="-101"/>
<source>Your current balance</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+29"/>
<source>Total of transactions that have yet to be confirmed, and do not yet count toward the current balance</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../overviewpage.cpp" line="+116"/>
<location line="+1"/>
<source>out of sync</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>PaymentServer</name>
<message>
<location filename="../paymentserver.cpp" line="+107"/>
<source>Cannot start geocoin: click-to-pay handler</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>QRCodeDialog</name>
<message>
<location filename="../forms/qrcodedialog.ui" line="+14"/>
<source>QR Code Dialog</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+59"/>
<source>Request Payment</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+56"/>
<source>Amount:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-44"/>
<source>Label:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>Message:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+71"/>
<source>&Save As...</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../qrcodedialog.cpp" line="+62"/>
<source>Error encoding URI into QR Code.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+40"/>
<source>The entered amount is invalid, please check.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>Resulting URI too long, try to reduce the text for label / message.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+25"/>
<source>Save QR Code</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>PNG Images (*.png)</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>RPCConsole</name>
<message>
<location filename="../forms/rpcconsole.ui" line="+46"/>
<source>Client name</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<location line="+23"/>
<location line="+26"/>
<location line="+23"/>
<location line="+23"/>
<location line="+36"/>
<location line="+53"/>
<location line="+23"/>
<location line="+23"/>
<location filename="../rpcconsole.cpp" line="+339"/>
<source>N/A</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-217"/>
<source>Client version</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-45"/>
<source>&Information</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+68"/>
<source>Using OpenSSL version</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+49"/>
<source>Startup time</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+29"/>
<source>Network</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Number of connections</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>On testnet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>Block chain</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Current number of blocks</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>Estimated total blocks</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>Last block time</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+52"/>
<source>&Open</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>Command-line options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Show the Geocoin-Qt help message to get a list with possible Geocoin command-line options.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Show</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+24"/>
<source>&Console</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-260"/>
<source>Build date</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-104"/>
<source>Geocoin - Debug window</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+25"/>
<source>Geocoin Core</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+279"/>
<source>Debug log file</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Open the Geocoin debug log file from the current data directory. This can take a few seconds for large log files.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+102"/>
<source>Clear console</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../rpcconsole.cpp" line="-30"/>
<source>Welcome to the Geocoin RPC console.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Type <b>help</b> for an overview of available commands.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>SendCoinsDialog</name>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="+14"/>
<location filename="../sendcoinsdialog.cpp" line="+124"/>
<location line="+5"/>
<location line="+5"/>
<location line="+5"/>
<location line="+6"/>
<location line="+5"/>
<location line="+5"/>
<source>Send Coins</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+50"/>
<source>Send to multiple recipients at once</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Add &Recipient</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+20"/>
<source>Remove all transaction fields</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Clear &All</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+22"/>
<source>Balance:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>123.456 GEO</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+31"/>
<source>Confirm the send action</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>S&end</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="-59"/>
<source><b>%1</b> to %2 (%3)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Confirm send coins</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Are you sure you want to send %1?</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source> and </source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>The recipient address is not valid, please recheck.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>The amount to pay must be larger than 0.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>The amount exceeds your balance.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>The total exceeds your balance when the %1 transaction fee is included.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Duplicate address found, can only send to each address once per send operation.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Error: Transaction creation failed!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>SendCoinsEntry</name>
<message>
<location filename="../forms/sendcoinsentry.ui" line="+14"/>
<source>Form</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>A&mount:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>Pay &To:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+34"/>
<source>The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+60"/>
<location filename="../sendcoinsentry.cpp" line="+26"/>
<source>Enter a label for this address to add it to your address book</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-78"/>
<source>&Label:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+28"/>
<source>Choose address from address book</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>Alt+A</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Paste address from clipboard</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>Alt+P</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Remove this recipient</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../sendcoinsentry.cpp" line="+1"/>
<source>Enter a Geocoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>SignVerifyMessageDialog</name>
<message>
<location filename="../forms/signverifymessagedialog.ui" line="+14"/>
<source>Signatures - Sign / Verify a Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>&Sign Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+18"/>
<source>The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<location line="+213"/>
<source>Choose an address from the address book</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-203"/>
<location line="+213"/>
<source>Alt+A</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-203"/>
<source>Paste address from clipboard</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>Alt+P</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+12"/>
<source>Enter the message you want to sign here</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Signature</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+27"/>
<source>Copy the current signature to the system clipboard</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+21"/>
<source>Sign the message to prove you own this Geocoin address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Sign &Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>Reset all sign message fields</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<location line="+146"/>
<source>Clear &All</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-87"/>
<source>&Verify Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+21"/>
<source>The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+40"/>
<source>Verify the message to ensure it was signed with the specified Geocoin address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Verify &Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>Reset all verify message fields</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../signverifymessagedialog.cpp" line="+27"/>
<location line="+3"/>
<source>Enter a Geocoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-2"/>
<source>Click "Sign Message" to generate signature</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Enter Geocoin signature</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+82"/>
<location line="+81"/>
<source>The entered address is invalid.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-81"/>
<location line="+8"/>
<location line="+73"/>
<location line="+8"/>
<source>Please check the address and try again.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-81"/>
<location line="+81"/>
<source>The entered address does not refer to a key.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-73"/>
<source>Wallet unlock was cancelled.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Private key for the entered address is not available.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+12"/>
<source>Message signing failed.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Message signed.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+59"/>
<source>The signature could not be decoded.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<location line="+13"/>
<source>Please check the signature and try again.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>The signature did not match the message digest.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Message verification failed.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Message verified.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>SplashScreen</name>
<message>
<location filename="../splashscreen.cpp" line="+22"/>
<source>The Geocoin developers</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>[testnet]</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>TransactionDesc</name>
<message>
<location filename="../transactiondesc.cpp" line="+20"/>
<source>Open until %1</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>%1/offline</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>%1/unconfirmed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>%1 confirmations</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+18"/>
<source>Status</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="+7"/>
<source>, broadcast through %n node(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+4"/>
<source>Date</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Source</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Generated</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<location line="+17"/>
<source>From</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<location line="+22"/>
<location line="+58"/>
<source>To</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-77"/>
<location line="+2"/>
<source>own address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-2"/>
<source>label</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+37"/>
<location line="+12"/>
<location line="+45"/>
<location line="+17"/>
<location line="+30"/>
<source>Credit</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="-102"/>
<source>matures in %n more block(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+2"/>
<source>not accepted</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+44"/>
<location line="+8"/>
<location line="+15"/>
<location line="+30"/>
<source>Debit</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-39"/>
<source>Transaction fee</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>Net amount</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Comment</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Transaction ID</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Generated coins must mature 120 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Debug information</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Transaction</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Inputs</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>Amount</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>true</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>false</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-209"/>
<source>, has not been successfully broadcast yet</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="-35"/>
<source>Open for %n more block(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+70"/>
<source>unknown</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>TransactionDescDialog</name>
<message>
<location filename="../forms/transactiondescdialog.ui" line="+14"/>
<source>Transaction details</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>This pane shows a detailed description of the transaction</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>TransactionTableModel</name>
<message>
<location filename="../transactiontablemodel.cpp" line="+225"/>
<source>Date</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Type</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Amount</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="+57"/>
<source>Open for %n more block(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+3"/>
<source>Open until %1</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Offline (%1 confirmations)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Unconfirmed (%1 of %2 confirmations)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Confirmed (%1 confirmations)</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="+8"/>
<source>Mined balance will be available when it matures in %n more block(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+5"/>
<source>This block was not received by any other nodes and will probably not be accepted!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Generated but not accepted</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+43"/>
<source>Received with</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Received from</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Sent to</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Payment to yourself</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Mined</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+38"/>
<source>(n/a)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+199"/>
<source>Transaction status. Hover over this field to show number of confirmations.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Date and time that the transaction was received.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Type of transaction.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Destination address of transaction.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Amount removed from or added to balance.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>TransactionView</name>
<message>
<location filename="../transactionview.cpp" line="+52"/>
<location line="+16"/>
<source>All</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-15"/>
<source>Today</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>This week</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>This month</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Last month</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>This year</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Range...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>Received with</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Sent to</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>To yourself</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Mined</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Other</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Enter address or label to search</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Min amount</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+34"/>
<source>Copy address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy label</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy amount</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy transaction ID</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Edit label</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Show transaction details</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+139"/>
<source>Export Transaction Data</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Comma separated file (*.csv)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Confirmed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Date</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Type</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Label</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Amount</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>ID</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Error exporting</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Could not write to file %1.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+100"/>
<source>Range:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>to</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>WalletModel</name>
<message>
<location filename="../walletmodel.cpp" line="+193"/>
<source>Send Coins</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>WalletView</name>
<message>
<location filename="../walletview.cpp" line="+42"/>
<source>&Export</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Export the data in the current tab to a file</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+193"/>
<source>Backup Wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Wallet Data (*.dat)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Backup Failed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>There was an error trying to save the wallet data to the new location.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Backup Successful</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>The wallet data was successfully saved to the new location.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>geocoin-core</name>
<message>
<location filename="../geocoinstrings.cpp" line="+94"/>
<source>Geocoin version</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+102"/>
<source>Usage:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-29"/>
<source>Send command to -server or geocoind</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-23"/>
<source>List commands</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-12"/>
<source>Get help for a command</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+24"/>
<source>Options:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+24"/>
<source>Specify configuration file (default: geocoin.conf)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Specify pid file (default: geocoind.pid)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-1"/>
<source>Specify data directory</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-9"/>
<source>Set database cache size in megabytes (default: 25)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-28"/>
<source>Listen for connections on <port> (default: 9335 or testnet: 19335)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Maintain at most <n> connections to peers (default: 125)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-48"/>
<source>Connect to a node to retrieve peer addresses, and disconnect</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+82"/>
<source>Specify your own public address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Threshold for disconnecting misbehaving peers (default: 100)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-134"/>
<source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-29"/>
<source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+27"/>
<source>Listen for JSON-RPC connections on <port> (default: 9334 or testnet: 19334)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+37"/>
<source>Accept command line and JSON-RPC commands</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+76"/>
<source>Run in the background as a daemon and accept commands</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+37"/>
<source>Use the test network</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-112"/>
<source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-80"/>
<source>%s, you must set a rpcpassword in the configuration file:
%s
It is recommended you use the following random password:
rpcuser=geocoinrpc
rpcpassword=%s
(you do not need to remember this password)
The username and password MUST NOT be the same.
If the file does not exist, create it with owner-readable-only file permissions.
It is also recommended to set alertnotify so you are notified of problems;
for example: alertnotify=echo %%s | mail -s "Geocoin Alert" [email protected]
</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+17"/>
<source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Cannot obtain a lock on data directory %s. Geocoin is probably already running.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Execute command when a relevant alert is received (%s in cmd is replaced by message)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Warning: Displayed transactions may not be correct! You may need to upgrade, or other nodes may need to upgrade.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Warning: Please check that your computer's date and time are correct! If your clock is wrong Geocoin will not work properly.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>Attempt to recover private keys from a corrupt wallet.dat</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Block creation options:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Connect only to the specified node(s)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Corrupted block database detected</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Discover own IP address (default: 1 when listening and no -externalip)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Do you want to rebuild the block database now?</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Error initializing block database</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Error initializing wallet database environment %s!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Error loading block database</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Error opening block database</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Error: Disk space is low!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Error: Wallet locked, unable to create transaction!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Error: system error: </source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to listen on any port. Use -listen=0 if you want this.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to read block info</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to read block</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to sync block index</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to write block index</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to write block info</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to write block</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to write file info</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to write to coin database</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to write transaction index</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to write undo data</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Find peers using DNS lookup (default: 1 unless -connect)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Generate coins (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>How many blocks to check at startup (default: 288, 0 = all)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>How thorough the block verification is (0-4, default: 3)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>Not enough file descriptors available.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Rebuild block chain index from current blk000??.dat files</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>Set the number of threads to service RPC calls (default: 4)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+26"/>
<source>Verifying blocks...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Verifying wallet...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-69"/>
<source>Imports blocks from external blk000??.dat file</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-76"/>
<source>Set the number of script verification threads (up to 16, 0 = auto, <0 = leave that many cores free, default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+77"/>
<source>Information</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Invalid -tor address: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Invalid amount for -minrelaytxfee=<amount>: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Invalid amount for -mintxfee=<amount>: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Maintain a full transaction index (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Maximum per-connection send buffer, <n>*1000 bytes (default: 1000)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Only accept block chain matching built-in checkpoints (default: 1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Only connect to nodes in network <net> (IPv4, IPv6 or Tor)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Output extra debugging information. Implies all other -debug* options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Output extra network debugging information</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Prepend debug output with timestamp</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>SSL options: (see the Geocoin Wiki for SSL setup instructions)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Select the version of socks proxy to use (4-5, default: 5)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Send trace/debug info to console instead of debug.log file</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Send trace/debug info to debugger</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Set maximum block size in bytes (default: 250000)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Set minimum block size in bytes (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Shrink debug.log file on client startup (default: 1 when no -debug)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Signing transaction failed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Specify connection timeout in milliseconds (default: 5000)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>System error: </source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Transaction amount too small</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Transaction amounts must be positive</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Transaction too large</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Use UPnP to map the listening port (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Use UPnP to map the listening port (default: 1 when listening)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Use proxy to reach tor hidden services (default: same as -proxy)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Username for JSON-RPC connections</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Warning</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Warning: This version is obsolete, upgrade required!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>You need to rebuild the databases using -reindex to change -txindex</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>wallet.dat corrupt, salvage failed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-50"/>
<source>Password for JSON-RPC connections</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-67"/>
<source>Allow JSON-RPC connections from specified IP address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+76"/>
<source>Send commands to node running on <ip> (default: 127.0.0.1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-120"/>
<source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+147"/>
<source>Upgrade wallet to latest format</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-21"/>
<source>Set key pool size to <n> (default: 100)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-12"/>
<source>Rescan the block chain for missing wallet transactions</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+35"/>
<source>Use OpenSSL (https) for JSON-RPC connections</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-26"/>
<source>Server certificate file (default: server.cert)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Server private key (default: server.pem)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-151"/>
<source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+165"/>
<source>This help message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Unable to bind to %s on this computer (bind returned error %d, %s)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-91"/>
<source>Connect through socks proxy</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-10"/>
<source>Allow DNS lookups for -addnode, -seednode and -connect</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+55"/>
<source>Loading addresses...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-35"/>
<source>Error loading wallet.dat: Wallet corrupted</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Error loading wallet.dat: Wallet requires newer version of Geocoin</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+93"/>
<source>Wallet needed to be rewritten: restart Geocoin to complete</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-95"/>
<source>Error loading wallet.dat</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+28"/>
<source>Invalid -proxy address: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+56"/>
<source>Unknown network specified in -onlynet: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-1"/>
<source>Unknown -socks proxy version requested: %i</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-96"/>
<source>Cannot resolve -bind address: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Cannot resolve -externalip address: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+44"/>
<source>Invalid amount for -paytxfee=<amount>: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Invalid amount</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-6"/>
<source>Insufficient funds</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>Loading block index...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-57"/>
<source>Add a node to connect to and attempt to keep the connection open</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-25"/>
<source>Unable to bind to %s on this computer. Geocoin is probably already running.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+64"/>
<source>Fee per KB to add to transactions you send</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>Loading wallet...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-52"/>
<source>Cannot downgrade wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Cannot write default address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+64"/>
<source>Rescanning...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-57"/>
<source>Done loading</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+82"/>
<source>To use the %s option</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-74"/>
<source>Error</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-31"/>
<source>You must set rpcpassword=<password> in the configuration file:
%s
If the file does not exist, create it with owner-readable-only file permissions.</source>
<translation type="unfinished"/>
</message>
</context>
</TS> | brettwittam/geocoin | src/qt/locale/bitcoin_ca.ts | TypeScript | mit | 96,480 |
<?php
if (empty($_SESSION)):
session_start();
endif;
if (empty($_SESSION['user'])):
$Validation['erro'] = "Sessão Expirada. Fazer login novamente.";
$this->load->view('login', $Validation);
die();
endif;
$Priv = $_SESSION['user']['Nv'] == 1 ? 'Operador TI' : 'Técnico Regional';
/* Permissão no Menu */
$Cadastros = "href=".base_url('manager')."";
$ADM = "href=".base_url('adm')."";
$Relatorios = "href=".base_url('relatorios')."";
$desativo = '';
if ($_SESSION['user']['Nv'] > 1):
$Cadastros = "href='#'";
$ADM = "href='#'";
$Relatorios = "href='#'";
$desativo = 'disabled';
endif;
?>
<div class="container-fluid menu-fixed">
<div class="left col-xs-8 hide menucanvas">
<div class="sidebar-nav">
<div class="custom-nav-offcanvas offcanvas-info-user">
<p><?= $_SESSION['user']['Nome'] ?></p>
<p><?= $Priv ?></p>
</div>
<ul class="nav nav-pills nav-stacked custom-nav-offcanvas offcanvas-menu">
<li class="custom-ancor"><a href="<?= base_url('menuprincipal') ?>">Home</a></li>
<li class="custom-ancor <?=$desativo?>"><a <?=$Relatorios?>>Relatórios</a></li>
<li class="custom-ancor"><a target="_blank" href="<?= base_url('dashboard') ?>">DashBoard</a></li>
<li class="custom-ancor <?=$desativo?>"><a <?=$ADM?>>ADM</a ></li>
<li class="custom-ancor"><a href="#">Sobre</a></li>
<li class="custom-ancor"><a href="logoff">Sair</a></li>
</ul>
</div>
</div>
<div class="row">
<div class="col-md-12 col-lg-12 menu-top">
<span class="menu-hamburger j-menu-hamburguer"><i class="fa fa-bars" aria-hidden="true"></i></span>
<a href="<?= base_url('menuprincipal') ?>"><img src="<?php echo base_url('assets/img/SNOC3.png') ?>" alt="SISNOC LOGO" class="img-responsive custom-nav custom-img"></a>
<ul class="nav nav-pills custom-nav custom-opc">
<li role="presentation" class="custom-ancor"><a href="<?= base_url('menuprincipal') ?>">Inicio</a></li>
<li role="presentation" class="custom-ancor <?=$desativo?>"><a <?=$Cadastros?>>Cadastros</a></li>
<li role="presentation" class="custom-ancor <?=$desativo?>"><a <?=$Relatorios?>>Relatórios</a></li>
<li role="presentation" class="custom-ancor"><a target="_blank" href="<?= base_url('dashboard') ?>">Painel</a></li>
<li role="presentation" class="custom-ancor <?=$desativo?>"><a <?=$ADM?>>ADM</a></li>
<li role="presentation" class="custom-ancor"><a href="#">Sobre</a></li>
<li class="custom-ancor"><a href="http://sisnoc.maquinadevendas.corp/CI_SISNOC/logoff">Sair</a></li>
</ul>
<form action="http://sisnoc.maquinadevendas.corp/CI_SISNOC/busca" method="POST" class="custom-nav hide-mobo">
<div class="form-group">
<input type="text" name="termo" required="" title="Informe algo para eu pesquisar" class="form-control j-termo-mP" placeholder="Busca rápida.">
</div>
<div class="form-group">
<button type="submit" class="btn btn-danger"><i class="fa fa-search" aria-hidden="true"></i></button>
</div>
</form>
<div class="custom-nav info-user esconde">
<p><?= $_SESSION['user']['Nome'] ?></p>
<p><?= $Priv ?></p>
</div>
</div>
</div>
</div> | masterzd/snoc | application/views/commom/menu.php | PHP | mit | 3,671 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_65) on Fri Feb 10 18:16:56 IST 2017 -->
<title>Constant Field Values</title>
<meta name="date" content="2017-02-10">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<script type="text/javascript" src="script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Constant Field Values";
}
}
catch(err) {
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="overview-summary.html">Overview</a></li>
<li>Package</li>
<li>Class</li>
<li><a href="overview-tree.html">Tree</a></li>
<li><a href="deprecated-list.html">Deprecated</a></li>
<li><a href="index-files/index-1.html">Index</a></li>
<li><a href="help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="index.html?constant-values.html" target="_top">Frames</a></li>
<li><a href="constant-values.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h1 title="Constant Field Values" class="title">Constant Field Values</h1>
<h2 title="Contents">Contents</h2>
<ul>
<li><a href="#com.nuvoex">com.nuvoex.*</a></li>
</ul>
</div>
<div class="constantValuesContainer"><a name="com.nuvoex">
<!-- -->
</a>
<h2 title="com.nuvoex">com.nuvoex.*</h2>
<ul class="blockList">
<li class="blockList">
<table class="constantsSummary" border="0" cellpadding="3" cellspacing="0" summary="Constant Field Values table, listing constant fields, and values">
<caption><span>com.nuvoex.fileuploader.<a href="com/nuvoex/fileuploader/UploadError.html" title="class in com.nuvoex.fileuploader">UploadError</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th scope="col">Constant Field</th>
<th class="colLast" scope="col">Value</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a name="com.nuvoex.fileuploader.UploadError.ERROR_NETWORK">
<!-- -->
</a><code>public static final int</code></td>
<td><code><a href="com/nuvoex/fileuploader/UploadError.html#ERROR_NETWORK">ERROR_NETWORK</a></code></td>
<td class="colLast"><code>2</code></td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a name="com.nuvoex.fileuploader.UploadError.ERROR_RESPONSE">
<!-- -->
</a><code>public static final int</code></td>
<td><code><a href="com/nuvoex/fileuploader/UploadError.html#ERROR_RESPONSE">ERROR_RESPONSE</a></code></td>
<td class="colLast"><code>1</code></td>
</tr>
</tbody>
</table>
</li>
</ul>
<ul class="blockList">
<li class="blockList">
<table class="constantsSummary" border="0" cellpadding="3" cellspacing="0" summary="Constant Field Values table, listing constant fields, and values">
<caption><span>com.nuvoex.fileuploader.utils.<a href="com/nuvoex/fileuploader/utils/Constants.html" title="class in com.nuvoex.fileuploader.utils">Constants</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th scope="col">Constant Field</th>
<th class="colLast" scope="col">Value</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a name="com.nuvoex.fileuploader.utils.Constants.TAG">
<!-- -->
</a><code>public static final <a href="http://d.android.com/reference/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td><code><a href="com/nuvoex/fileuploader/utils/Constants.html#TAG">TAG</a></code></td>
<td class="colLast"><code>"FILE_UPLOAD"</code></td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<table class="constantsSummary" border="0" cellpadding="3" cellspacing="0" summary="Constant Field Values table, listing constant fields, and values">
<caption><span>com.nuvoex.fileuploader.utils.<a href="com/nuvoex/fileuploader/utils/Constants.Actions.html" title="class in com.nuvoex.fileuploader.utils">Constants.Actions</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th scope="col">Constant Field</th>
<th class="colLast" scope="col">Value</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a name="com.nuvoex.fileuploader.utils.Constants.Actions.STATUS_CHANGE">
<!-- -->
</a><code>public static final <a href="http://d.android.com/reference/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td><code><a href="com/nuvoex/fileuploader/utils/Constants.Actions.html#STATUS_CHANGE">STATUS_CHANGE</a></code></td>
<td class="colLast"><code>"com.nuvoex.fileuploader.ACTION_STATUS_CHANGE"</code></td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<table class="constantsSummary" border="0" cellpadding="3" cellspacing="0" summary="Constant Field Values table, listing constant fields, and values">
<caption><span>com.nuvoex.fileuploader.utils.<a href="com/nuvoex/fileuploader/utils/Constants.Configs.html" title="class in com.nuvoex.fileuploader.utils">Constants.Configs</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th scope="col">Constant Field</th>
<th class="colLast" scope="col">Value</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a name="com.nuvoex.fileuploader.utils.Constants.Configs.TIMEOUT">
<!-- -->
</a><code>public static final int</code></td>
<td><code><a href="com/nuvoex/fileuploader/utils/Constants.Configs.html#TIMEOUT">TIMEOUT</a></code></td>
<td class="colLast"><code>60</code></td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<table class="constantsSummary" border="0" cellpadding="3" cellspacing="0" summary="Constant Field Values table, listing constant fields, and values">
<caption><span>com.nuvoex.fileuploader.utils.<a href="com/nuvoex/fileuploader/utils/Constants.Keys.html" title="class in com.nuvoex.fileuploader.utils">Constants.Keys</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th scope="col">Constant Field</th>
<th class="colLast" scope="col">Value</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a name="com.nuvoex.fileuploader.utils.Constants.Keys.EXTRA_DELETE_ON_UPLOAD">
<!-- -->
</a><code>public static final <a href="http://d.android.com/reference/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td><code><a href="com/nuvoex/fileuploader/utils/Constants.Keys.html#EXTRA_DELETE_ON_UPLOAD">EXTRA_DELETE_ON_UPLOAD</a></code></td>
<td class="colLast"><code>"com.nuvoex.fileuploader.DELETE_ON_UPLOAD"</code></td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a name="com.nuvoex.fileuploader.utils.Constants.Keys.EXTRA_EXTRAS">
<!-- -->
</a><code>public static final <a href="http://d.android.com/reference/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td><code><a href="com/nuvoex/fileuploader/utils/Constants.Keys.html#EXTRA_EXTRAS">EXTRA_EXTRAS</a></code></td>
<td class="colLast"><code>"com.nuvoex.fileuploader.EXTRAS"</code></td>
</tr>
<tr class="altColor">
<td class="colFirst"><a name="com.nuvoex.fileuploader.utils.Constants.Keys.EXTRA_FILE_PATH">
<!-- -->
</a><code>public static final <a href="http://d.android.com/reference/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td><code><a href="com/nuvoex/fileuploader/utils/Constants.Keys.html#EXTRA_FILE_PATH">EXTRA_FILE_PATH</a></code></td>
<td class="colLast"><code>"com.nuvoex.fileuploader.FILE_LOCAL_PATH"</code></td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a name="com.nuvoex.fileuploader.utils.Constants.Keys.EXTRA_UPLOAD_ERROR">
<!-- -->
</a><code>public static final <a href="http://d.android.com/reference/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td><code><a href="com/nuvoex/fileuploader/utils/Constants.Keys.html#EXTRA_UPLOAD_ERROR">EXTRA_UPLOAD_ERROR</a></code></td>
<td class="colLast"><code>"com.nuvoex.fileuploader.FILE_UPLOAD_ERROR"</code></td>
</tr>
<tr class="altColor">
<td class="colFirst"><a name="com.nuvoex.fileuploader.utils.Constants.Keys.EXTRA_UPLOAD_STATUS">
<!-- -->
</a><code>public static final <a href="http://d.android.com/reference/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td><code><a href="com/nuvoex/fileuploader/utils/Constants.Keys.html#EXTRA_UPLOAD_STATUS">EXTRA_UPLOAD_STATUS</a></code></td>
<td class="colLast"><code>"com.nuvoex.fileuploader.FILE_UPLOAD_STATUS"</code></td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a name="com.nuvoex.fileuploader.utils.Constants.Keys.EXTRA_UPLOAD_URL">
<!-- -->
</a><code>public static final <a href="http://d.android.com/reference/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td><code><a href="com/nuvoex/fileuploader/utils/Constants.Keys.html#EXTRA_UPLOAD_URL">EXTRA_UPLOAD_URL</a></code></td>
<td class="colLast"><code>"com.nuvoex.fileuploader.FILE_UPLOAD_URL"</code></td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<table class="constantsSummary" border="0" cellpadding="3" cellspacing="0" summary="Constant Field Values table, listing constant fields, and values">
<caption><span>com.nuvoex.fileuploader.utils.<a href="com/nuvoex/fileuploader/utils/Constants.Status.html" title="class in com.nuvoex.fileuploader.utils">Constants.Status</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th scope="col">Constant Field</th>
<th class="colLast" scope="col">Value</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a name="com.nuvoex.fileuploader.utils.Constants.Status.CANCELLED">
<!-- -->
</a><code>public static final int</code></td>
<td><code><a href="com/nuvoex/fileuploader/utils/Constants.Status.html#CANCELLED">CANCELLED</a></code></td>
<td class="colLast"><code>4</code></td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a name="com.nuvoex.fileuploader.utils.Constants.Status.COMPLETED">
<!-- -->
</a><code>public static final int</code></td>
<td><code><a href="com/nuvoex/fileuploader/utils/Constants.Status.html#COMPLETED">COMPLETED</a></code></td>
<td class="colLast"><code>3</code></td>
</tr>
<tr class="altColor">
<td class="colFirst"><a name="com.nuvoex.fileuploader.utils.Constants.Status.FAILED">
<!-- -->
</a><code>public static final int</code></td>
<td><code><a href="com/nuvoex/fileuploader/utils/Constants.Status.html#FAILED">FAILED</a></code></td>
<td class="colLast"><code>2</code></td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a name="com.nuvoex.fileuploader.utils.Constants.Status.STARTED">
<!-- -->
</a><code>public static final int</code></td>
<td><code><a href="com/nuvoex/fileuploader/utils/Constants.Status.html#STARTED">STARTED</a></code></td>
<td class="colLast"><code>1</code></td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<table class="constantsSummary" border="0" cellpadding="3" cellspacing="0" summary="Constant Field Values table, listing constant fields, and values">
<caption><span>com.nuvoex.fileuploader.utils.<a href="com/nuvoex/fileuploader/utils/Constants.Urls.html" title="class in com.nuvoex.fileuploader.utils">Constants.Urls</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th scope="col">Constant Field</th>
<th class="colLast" scope="col">Value</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a name="com.nuvoex.fileuploader.utils.Constants.Urls.BASE_URL">
<!-- -->
</a><code>public static final <a href="http://d.android.com/reference/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td><code><a href="com/nuvoex/fileuploader/utils/Constants.Urls.html#BASE_URL">BASE_URL</a></code></td>
<td class="colLast"><code>"https://nuvoex.com"</code></td>
</tr>
</tbody>
</table>
</li>
</ul>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="overview-summary.html">Overview</a></li>
<li>Package</li>
<li>Class</li>
<li><a href="overview-tree.html">Tree</a></li>
<li><a href="deprecated-list.html">Deprecated</a></li>
<li><a href="index-files/index-1.html">Index</a></li>
<li><a href="help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="index.html?constant-values.html" target="_top">Frames</a></li>
<li><a href="constant-values.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>
| Nuvoex/async-file-uploader | docs/constant-values.html | HTML | mit | 14,712 |
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import java.util.HashSet;
import redis.clients.jedis.HostAndPort;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisCluster;
import redis.clients.jedis.JedisPool;
/**
* Created by lujiahao on 2017/4/6.
*/
public class JedisTest {
String ipSingle = "192.168.2.30";
int portSingle = 6371;
String ipCluster = "192.168.2.30";
int portCluster = 6370;
@Test
public void testJedisSingle(){
Jedis jedis = new Jedis(ipSingle,portSingle);
jedis.set("key1","jedis test");
String str = jedis.get("key1");
System.out.println("获取到的数据 : " + str);
jedis.close();
}
@Test
public void testJedisPool(){
JedisPool jedisPool = new JedisPool(ipSingle,portSingle);
Jedis jedis = jedisPool.getResource();
String str = jedis.get("key1");
System.out.println("使用连接池获取 : " + str);
jedis.close();
jedisPool.close();
}
// @ComRespon
// public void testJedisCluster(){
// HashSet<HostAndPort> nodes = new HashSet<>();
// nodes.add(new HostAndPort(ipCluster,portCluster));
// JedisCluster cluster = new JedisCluster(nodes);
// cluster.set("key1","1000");
// String str = cluster.get("key1");
// System.out.println("集群获取数据 : " + str);
// cluster.close();
// }
@Test
public void testSpringJedisSingle(){
ApplicationContext applicationContext = new ClassPathXmlApplicationContext("classpath:spring/applicationContext-*.xml");
JedisPool pool = (JedisPool) applicationContext.getBean("redisClient");
Jedis jedis = pool.getResource();
String str = jedis.get("key1");
System.out.println(str);
jedis.close();
pool.close();
}
}
| chiahaolu/emall | emall-rest/src/test/JedisTest.java | Java | mit | 1,958 |
function openModalIframe(url){
jQuery.ajax({
method: 'GET',
url: url,
}).done(function(html){
$('#modal-content').html(html);
$('#modal-container').modal({show:true})
});
}
function deleteFile(url){
jQuery.ajax({
method: 'DELETE',
url: url,
}).done(function(html){
location.reload();
});
}
jQuery('button.delete').click(function(e){
var fileId = jQuery(this).closest('tr').find('a').data('id');
var fileRoute = jQuery(this).data('delete-confirm');
openModalIframe(fileRoute);
});
| mtils/file-db | resources/views/partials/javascript.blade.php | PHP | mit | 841 |
# :butterfly: Hyperaudio Lite :butterfly:
:high_brightness: To make media on the web more accessible we believe that every piece of spoken-word audio and video should come with an Interactive Transcript.:high_brightness:
Hyperaudio Lite - is an [Interactive Transcript](https://en.wikipedia.org/wiki/Interactive_transcripts) Viewer
You can use Hyperaudio Lite to provide Interactive Transcripts, this readme details why and how.
- lightweight (less than 8Kb minified)
- no framework dependencies
- MIT Licensed
## :tiger: Hyperaudio Lite in the Wild :tiger:
As demonstrated here [https://hyperaud.io/lab/halite/v28/](https://hyperaud.io/lab/halite/v28/) plus equivalent [multiplayer version](https://hyperaud.io/lab/halite/v28/multiplayer.html)
Alternatively styled version [https://lab.hyperaud.io/mozfest2021/interviews/lance_weiler/](https://lab.hyperaud.io/mozfest2021/interviews/lance_weiler/)
YouTube Integration [https://hyperaud.io/lab/halite/v28/youtube.html](https://hyperaud.io/lab/halite/v28/youtube.html)
SoundCloud Integration [https://hyperaud.io/lab/halite/v28/soundcloud.html](https://hyperaud.io/lab/halite/v28/soundcloud.html)
Vitorio's version [https://github.com/vitorio/hyperaudio-lite](https://github.com/vitorio/hyperaudio-lite)
## :star2: Hyper Powers :star2:
Interactive transcripts are transcripts with special powers. Hyperaudio's Interactive Transcripts are called Hypertranscripts and are infused with the following hyper-powers:
### :world_map: Navigate
Click on the text to navigate directly to the part of the audio where that word was said.
### :mag_right: Search
Find words and phrases inside your transcript and make your media search-engine friendly.
### :couple_with_heart_woman_woman: Share
Selecting part of a transcript creates a URL with timing data which when shared will take people directly to the corresponding piece of audio where the highlighted words are spoken.
## :vhs: Data Formats :vhs:
Hypertranscripts contain the following data:
- Paragraphs
- Words
- Word start time (`data-m` milliseconds)
- Word duration (`data-d` milliseconds)
That's it!
Here's an example:
```html
<p>
<span data-m="52890" data-d="0" class="speaker">Alexandra: </span>
<span data-m="52890" data-d="90">I </span>
<span data-m="52980" data-d="240">think </span>
<span data-m="53220" data-d="720">unfortunately </span>
<span data-m="53970" data-d="60">at </span>
<span data-m="54030" data-d="60">the </span>
<span data-m="54090" data-d="270">minute, </span>
<span data-m="54390" data-d="180">we </span>
<span data-m="54570" data-d="180">make </span>
<span data-m="54750" data-d="270">people </span>
<span data-m="55020" data-d="300">aware </span>
<span data-m="55320" data-d="90">of </span>
<span data-m="55410" data-d="150">their </span>
<span data-m="55560" data-d="480">personal </span>
<span data-m="56040" data-d="330">data </span>
<span data-m="56370" data-d="210">when </span>
<span data-m="56580" data-d="480">terrible </span>
<span data-m="57060" data-d="300">things </span>
<span data-m="57360" data-d="510">happen. </span>
</p>
```
Hyperaudio Lite is "tag agnostic" so for example, you could use other tags instead of `<span>` to wrap words.
You could also make headings link to chapter points using attributes, like this:
```html
<h5 data-m="214800">
What kind of help is available for people to manage their own data?
</h5>
```
We can see that a Hypertranscript is really just HTML, this helps keep it:
- :clap: extensible
- :clap: accessible
- :clap: readable
### How to make a Hypertranscript
One way is to use the [Hyperaudio Converter](https://hyperaud.io/converter/)
This currently takes 4 possible inputs:
- SRT (Subtitle format)
- [Speechmatics](https://www.speechmatics.com/) JSON\*
- [Gentle](https://github.com/lowerquality/gentle) JSON
- [Google Speech-to-Text](https://cloud.google.com/speech-to-text/) JSON
\*JavaScript Object Notation - a common data format
## :floppy_disk: Hyperaudio Lite Code :floppy_disk:
Essentially the Hyperaudio Lite library is made from 4 JavaScript files:
1. `hyperaudio-lite.js` - the core that deals with the linking of media to words
2. `hyperaudio-lite wrapper` - adds search, selection and playback rate functionality
3. `share-this.js` - a fork of [share-this](https://github.com/MaxArt2501/share-this) library
4. `share-this.twitter.js` - a fork of the Twitter sharing element of share-this
and the associated CSS files:
5. `hyperaudio-lite-player.css`
6. `share-this.css`
We also link to [Velocity 1.5](https://github.com/julianshapiro/velocity) for autoscroll and Twitter widget JS for Twitter sharing.
Add to your HTML file in the following way:
```HTML
<head>
<link rel="stylesheet" href="css/hyperaudio-lite-player.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/velocity/1.5.0/velocity.js"></script>
<script src="https://platform.twitter.com/widgets.js"></script>
</head>
```
and at the end of the `<body>`:
```html
<script src="js/hyperaudio-lite.js"></script>
<script src="js/hyperaudio-lite-wrapper.js"></script>
<script src="js/share-this.js"></script>
<script src="js/share-this-twitter.js"></script>
<script>
ShareThis({
sharers: [ ShareThisViaTwitter ],
selector: "article"
}).init();
</script>
</body>
```
Finally instantiate the Transcript Player:
```javascript
let minimizedMode = false;
let autoScroll = true;
let doubleClick = false;
let webMonetization = false;
new HyperaudioLite("hypertranscript", "hyperplayer", minimizedMode, autoScroll, doubleClick, webMonetization);
```
View the source code of [http://hyperaud.io/lab/halite/v28/](https://hyperaud.io/lab/halite/v28/) for a complete example.
See a version with multiple players in a single page [http://hyperaud.io/lab/halite/v28/multiplayer.html](https://hyperaud.io/lab/halite/v28/multiplayer.html)
## :tv: YouTube Support :tv:
In addition to supporting the web-native HTML `<audio>` and `<video>` elements we also support a YouTube `iframe` embed.
Example of YouTube `iframe` embed:
```html
<iframe
id="hyperplayer"
data-player-type="youtube"
width="400"
height="300"
frameborder="no"
allow="autoplay"
src="https://www.youtube.com/embed/xLcsdc823dg?enablejsapi=1"
>
</iframe>
```
## :sound: SoundCloud Support :sound:
We also support a SoundCloud `iframe` embed.
Example of Soundcloud API and `iframe` embed:
```html
<script src="https://w.soundcloud.com/player/api.js"></script>
<iframe
id="hyperplayer"
data-player-type="soundcloud"
width="100%"
height="166"
scrolling="no"
frameborder="no"
allow="autoplay"
src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/730479133&color=%23ff5500&auto_play=false&hide_related=false&show_comments=true&show_user=true&show_reposts=false&show_teaser=true"
></iframe>
```
You can get the snippet of code by visiting the page of the SoundCloud file you're interested in, clicking on _Share_ and then _Embed_.
## :money_with_wings: Web Monetization Support :money_with_wings:
[Web Monetization](https://webmonetization.org/) is a JavaScript browser API that allows the creation of a payment stream from the user agent to the website and a [proposed](https://discourse.wicg.io/t/proposal-web-monetization-a-new-revenue-model-for-the-web/3785) [W3C](https://www.w3.org/) standard.
You can use this with Hyperaudio Lite to apportion streaming funds (from viewers with Web Monetization compatible wallets and browser extensions) to different sources depending on the transcript or part of the transcript you are currently listening to.
To activate set the Web Monetization parameter when instantiating a new `HyperaudioLite` object to `true`, for example:
```javascript
let minimizedMode = false;
let autoScroll = true;
let doubleClick = false;
let webMonetization = true;
new HyperaudioLite("hypertranscript", "hyperplayer", minimizedMode, autoScroll, doubleClick, webMonetization);
```
If you then set the `data-wm` attributes in your transcript streaming will be switched to that payment pointer when encountered.
```html
<article data-wm="$ilp.uphold.com/123article">
<section data-wm="$ilp.uphold.com/123section">
<h5 data-m="0">How do we make people more aware of their personal data?</h5>
<p data-tc="00:00:04" data-wm="$ilp.uphold.com/123Doc">
<span data-m="4470" data-d="0" class="speaker">Doc: </span>
<span data-m="4470" data-d="270">We </span>
<span data-m="4740" data-d="240">have </span>
<span data-m="5010" data-d="300">two </span>
<span data-m="5310" data-d="600">selves </span>
...
```
*Note* – if a `data-wm` attribute is not present in an element Hyperaudio Lite will check the parent (and parent's parent etc) until it finds one.
## :construction_worker: Testing :construction_worker:
Currently we use [Jest](https://jestjs.io/) for testing.
Install Jest using yarn:
`yarn add --dev jest`
Or npm:
`npm install --save-dev jest`
To run the tests:
`yarn test` or `npm run test`
| hyperaudio/hyperaudio-lite | README.md | Markdown | mit | 9,099 |
using System.Collections.Generic;
using System.Windows.Forms;
using System.Drawing;
namespace RectangleGame.Gamestate
{
public class GameStateManager
{
/******** Variables ********/
/// <summary>
/// Enumerator encapsulating the different gamestates.
/// </summary>
public enum State
{
Menu,
Highscore,
Info,
Options,
Quit,
Time,
Rush
}
private State lastState;
private State currentState;
private List<GameState> gameStates;
/******** Constructor ********/
public GameStateManager()
{
// Initializing variables.
currentState = State.Menu;
lastState = State.Menu;
gameStates = new List<GameState>();
// Adding gamestates.
gameStates.Add(new MenuState(this));
gameStates.Add(new HighscoreState(this));
gameStates.Add(new InfoState(this));
gameStates.Add(new OptionState(this));
gameStates.Add(new QuitState(this));
gameStates.Add(new TimeState(this));
gameStates.Add(new RushState(this));
SetState(currentState);
}
/******** Functions ********/
// Passing update and draw on to the currently active gamestate.
public void Update() { gameStates[(int)currentState].Update(); }
public void Draw(Graphics g) { gameStates[(int)currentState].Draw(g); }
/******** Getter & Setter ********/
public State GetState() { return (currentState); }
public void SetState(State state)
{
lastState = currentState;
currentState = state;
gameStates[(int)currentState].Init();
}
/******** Keyboard ********/
// User input is passed to the currelty active gamestate.
public void KeyPressed(KeyEventArgs e) { gameStates[(int)currentState].KeyPressed(e); }
public void KeyReleased(KeyEventArgs e) { gameStates[(int)currentState].KeyReleased(e); }
public void CharPressed(KeyPressEventArgs e) { gameStates[(int)currentState].CharPressed(e); }
public void MousePressed(MouseEventArgs e) { gameStates[(int)currentState].MousePressed(e); }
public void MouseReleased(MouseEventArgs e) { gameStates[(int)currentState].MouseReleased(e); }
public void MouseMoved(MouseEventArgs e) { gameStates[(int)currentState].MouseMoved(e); }
}
} | Jeinzi/Rectangle-Game | Rectangle-Game/Gamestate/GameStateManager.cs | C# | mit | 2,174 |
//----------------------------------------------------------------------------------
// Microsoft Developer & Platform Evangelism
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
// EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES
// OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
//----------------------------------------------------------------------------------
// The example companies, organizations, products, domain names,
// e-mail addresses, logos, people, places, and events depicted
// herein are fictitious. No association with any real company,
// organization, product, domain name, email address, logo, person,
// places, or events is intended or should be inferred.
//----------------------------------------------------------------------------------
namespace DataBlobStorageSample
{
using Microsoft.WindowsAzure;
using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Blob;
using Microsoft.WindowsAzure.Storage.Auth;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
////// <summary>
/// Azure Blob存储的示例 - 演示如何使用Blob存储服务。
/// Blob存储主要是用来存储一些非结构化的数据,例如:文本、二进制数据、文档、媒体文件。
/// Blob能够通过HTTP或者HTTPS的方式从世界各地访问。
///
/// 注意:这个示例使用.NET 4.5异步编程模型来演示如何使用存储客户端库的异步API调用存储服务。 在实际的应用中这种方式
/// 可以提高程序的响应速度。存储服务需要在调用时前面添加关键字await。
/// 文档引用:
/// - 什么是存储账号- https://www.azure.cn/documentation/articles/storage-create-storage-account/
/// - Blob起步 - http://www.azure.cn/documentation/articles/storage-dotnet-how-to-use-blobs/
/// - Blob服务概念 - https://msdn.microsoft.com/zh-cn/library/dd179376.aspx
/// - Blob服务REST API - http://msdn.microsoft.com/zh-cn/library/dd135733.aspx
/// - Blob服务C# API - https://msdn.microsoft.com/zh-cn/library/azure/mt347887.aspx
/// - 使用共享访问签名(SAS)委托访问- http://www.azure.cn/documentation/articles/storage-dotnet-shared-access-signature-part-1/
/// - 存储模拟器 - https://www.azure.cn/documentation/articles/storage-use-emulator/
/// - 使用 Async 和 Await异步编程 - http://msdn.microsoft.com/zh-cn/library/hh191443.aspx
/// </summary>
///
public class Program
{
// *************************************************************************************************************************
// 使用说明: 这个示例可以在Azure存储模拟器(存储模拟器是Azure SDK安装的一部分)上运行,或者通过修改App.Config文档中的
// AccountName(存储账号)和Key(存储密钥)的方式来使用。
//
// 使用Azure存储模拟器来运行这个示例 (默认选项)
// 1. 点击开始按钮或者是键盘的Windows键,然后输入“Azure Storage Emulator”来寻找Azure存储模拟器,之后点击运行。
// 2. 设置断点,然后使用F10按钮运行这个示例.
//
// 使用Azure存储服务来运行这个示例
// 1. 打开app.config文件, 注释掉模拟器的那一部分连接字符串(UseDevelopmentStorage=True) ,然后删掉存储服务的连接字符串的注释 (AccountName=[]...)。
// 2. 在Azure门户网站上创建存储账号,然后修改App.Config的 [AccountName](存储账号)和 [AccountKey](存储密钥)。
// 3. 设置断点,使用F10运行该示例。
//
// *************************************************************************************************************************
static void Main(string[] args)
{
Console.WriteLine("Azure Blob存储示例\n ");
// 块blob基础
Console.WriteLine("块 Blob 示例");
BasicStorageBlockBlobOperationsAsync().Wait();
// 共享访问签名(SAS)使用块Blobs基础
BasicStorageBlockBlobOperationsWithAccountSASAsync().Wait();
// 页blob基础
Console.WriteLine("\n页 Blob 示例");
BasicStoragePageBlobOperationsAsync().Wait();
Console.WriteLine("按任意键退出");
Console.ReadLine();
}
/// <summary>
/// 块blobs的基本操作
/// </summary>
/// <returns>Task<returns>
private static async Task BasicStorageBlockBlobOperationsAsync()
{
const string imageToUpload = "HelloWorld.png";
string blockBlobContainerName = "demoblockblobcontainer-" + Guid.NewGuid();
// 通过连接字符串检索存储账号的信息
// 如何配置 Azure 存储空间连接字符串 - https://www.azure.cn/documentation/articles/storage-configure-connection-string/
CloudStorageAccount storageAccount = CreateStorageAccountFromConnectionString(CloudConfigurationManager.GetSetting("StorageConnectionString"));
// 创建一个blobClient来和blob服务交互。
CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();
// 创建一个容器来组织存储账号下的blob。
Console.WriteLine("1. 创建容器...");
CloudBlobContainer container = blobClient.GetContainerReference(blockBlobContainerName);
try
{
await container.CreateIfNotExistsAsync();
}
catch (StorageException)
{
Console.WriteLine("如果使用默认配置文件,请确保Azure模拟器已经启动。点击Windows键然后输入\"Azure Storage\",找到Azure模拟器然后点击运行,之后请重新启动该示例.");
Console.ReadLine();
throw;
}
// 我们有两个选择去查看已经上传的blob
// 1) 使用共享访问签名(SAS)来委托访问资源。更多详细内容请阅读上面提供的关于SAS的文档。
// 2) 公开容器下blobs的访问权限。取消下面代码的注释可以达到此目的。通过这样的设置我们可以使用下面的链接访问之前上传的图片
// https://[存储账号].blob.core.chinacloudapi.cn/democontainer/HelloWorld.png
// await container.SetPermissionsAsync(new BlobContainerPermissions { PublicAccess = BlobContainerPublicAccessType.Blob });
// 上传BlockBlob到最新创建的容器中
Console.WriteLine("2. 上传 BlockBlob");
CloudBlockBlob blockBlob = container.GetBlockBlobReference(imageToUpload);
await blockBlob.UploadFromFileAsync(imageToUpload, FileMode.Open);
// 列出容器内所有的blobs
Console.WriteLine("3. 列出容器内所有的blobs");
foreach (IListBlobItem blob in container.ListBlobs())
{
// Blob 的类型可能是 CloudBlockBlob, CloudPageBlob 或者 CloudBlobDirectory
// 使用 blob.GetType() 然后转换成适当的类型以获得访问每个类型下特别的属性
Console.WriteLine("- {0} (类型: {1})", blob.Uri, blob.GetType());
}
// 下载blob到您的文件系统
Console.WriteLine("4. 下载Blob,下载地址:{0}", blockBlob.Uri.AbsoluteUri);
await blockBlob.DownloadToFileAsync(string.Format("./CopyOf{0}", imageToUpload), FileMode.Create);
// 创建只读的blob快照
Console.WriteLine("5. 创建只读的blob快照");
CloudBlockBlob blockBlobSnapshot = await blockBlob.CreateSnapshotAsync(null, null, null, null);
// 示例后的一些清除工作
Console.WriteLine("6. 删除块Blob以及所有的快照");
await blockBlob.DeleteIfExistsAsync(DeleteSnapshotsOption.IncludeSnapshots,null,null,null);
Console.WriteLine("7. 删除容器");
await container.DeleteIfExistsAsync();
}
/// <summary>
/// 块blobs的基本操作
/// </summary>
/// <returns>Task<returns>
private static async Task BasicStorageBlockBlobOperationsWithAccountSASAsync()
{
const string imageToUpload = "HelloWorld.png";
string blockBlobContainerName = "demoblockblobcontainer-" + Guid.NewGuid();
// 调用GetAccountSASToken 来获得基于存储账号、存储密钥的sasToken
string sasToken = GetAccountSASToken();
// 通过SASToken创建AccountSAS
StorageCredentials accountSAS = new StorageCredentials(sasToken);
//信息: 打印账号SAS的签名和令牌
Console.WriteLine();
Console.WriteLine("账户SAS的签名: " + accountSAS.SASSignature);
Console.WriteLine("账户SAS的令牌: " + accountSAS.SASToken);
Console.WriteLine();
// 创建一个容器来组织存储账号下的blob
Console.WriteLine("1. 使用账户SAS创建容器");
// 通过传递存储账号和容器名来获得容器的Uri
Uri ContainerUri = GetContainerSASUri(blockBlobContainerName);
// 通过使用Uri和sasToken来创建CloudBlobContainer
CloudBlobContainer container = new CloudBlobContainer(ContainerUri, accountSAS);
try
{
await container.CreateIfNotExistsAsync();
}
catch (StorageException)
{
Console.WriteLine("如果使用默认配置文件,请确保Azure模拟器已经启动。点击Windows键然后输入\"Azure Storage\",找到Azure模拟器然后点击运行,之后请重新启动该示例.");
Console.ReadLine();
throw;
}
// 我们有两个选择去查看已经上传的blob
// 1) 使用共享访问签名(SAS)来委托访问资源。更多详细内容请阅读上面提供的关于SAS的文档。
// 2) 公开容器下blobs的访问权限。取消下面代码的注释可以达到此目的。通过这样的设置我们可以使用下面的链接访问之前上传的图片
// https://[存储账号].blob.core.chinacloudapi.cn/democontainer/HelloWorld.png
// await container.SetPermissionsAsync(new BlobContainerPermissions { PublicAccess = BlobContainerPublicAccessType.Blob });
// 上传BlockBlob到最新创建的容器中
Console.WriteLine("2. 上传 BlockBlob");
CloudBlockBlob blockBlob = container.GetBlockBlobReference(imageToUpload);
await blockBlob.UploadFromFileAsync(imageToUpload, FileMode.Open);
// 列出容器内所有的blob
Console.WriteLine("3. 列出容器内所有的blobs");
foreach (IListBlobItem blob in container.ListBlobs())
{
// Blob 的类型可能是 CloudBlockBlob, CloudPageBlob 或者 CloudBlobDirectory
// 使用 blob.GetType() 然后转换成适当的类型以获得访问每个类型下特别的属性
Console.WriteLine("- {0} (类型: {1})", blob.Uri, blob.GetType());
}
// 下载blob到你的文件系统
Console.WriteLine("4. 下载Blob,下载地址:{0}", blockBlob.Uri.AbsoluteUri);
await blockBlob.DownloadToFileAsync(string.Format("./CopyOf{0}", imageToUpload), FileMode.Create);
// 创建只读的blob快照
Console.WriteLine("5. 创建只读的blob快照");
CloudBlockBlob blockBlobSnapshot = await blockBlob.CreateSnapshotAsync(null, null, null, null);
// 示例后的一些清除工作
Console.WriteLine("6. 删除块Blob以及所有的快照");
await blockBlob.DeleteIfExistsAsync(DeleteSnapshotsOption.IncludeSnapshots, null, null, null);
Console.WriteLine("7. 删除容器");
await container.DeleteIfExistsAsync();
}
/// <summary>
/// 页blobs的基本操作
/// </summary>
/// <returns>Task</returns>
private static async Task BasicStoragePageBlobOperationsAsync()
{
const string PageBlobName = "samplepageblob";
string pageBlobContainerName = "demopageblobcontainer-" + Guid.NewGuid();
// 通过连接字符串检索存储账号的信息
// 如何配置 Azure 存储空间连接字符串 - https://www.azure.cn/documentation/articles/storage-configure-connection-string/
CloudStorageAccount storageAccount = CreateStorageAccountFromConnectionString(CloudConfigurationManager.GetSetting("StorageConnectionString"));
// 创建一个blobClient来和blob服务交互
CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();
// 创建一个容器来组织存储账号下的blobs。
Console.WriteLine("1. 创建容器...");
CloudBlobContainer container = blobClient.GetContainerReference(pageBlobContainerName);
await container.CreateIfNotExistsAsync();
// 创建一个页blob到新创建的容器中
Console.WriteLine("2. 创建页Blob");
CloudPageBlob pageBlob = container.GetPageBlobReference(PageBlobName);
await pageBlob.CreateAsync(512 * 2 /*size*/); // 大小必须是512 bytes的倍数
// 写页blob
Console.WriteLine("2. 写页blob");
byte[] samplePagedata = new byte[512];
Random random = new Random();
random.NextBytes(samplePagedata);
await pageBlob.UploadFromByteArrayAsync(samplePagedata, 0, samplePagedata.Length);
// 列出容器内的所有的blobs。因为一个容器包含很多的blob,页blob的返回结果可能会包含多个段,每个段最大可能有5000个blob。
// 你可以通过ListBlobsSegmentedAsync方法的参数maxResults定义一个更小的尺寸
Console.WriteLine("3. 列出容器内的Blobs");
BlobContinuationToken token = null;
do
{
BlobResultSegment resultSegment = await container.ListBlobsSegmentedAsync(token);
token = resultSegment.ContinuationToken;
foreach (IListBlobItem blob in resultSegment.Results)
{
// Blob 的类型可能是 CloudBlockBlob, CloudPageBlob 或者 CloudBlobDirectory
Console.WriteLine("{0} (类型: {1}", blob.Uri, blob.GetType());
}
} while (token != null);
// 从页blob中读取数据
// Console.WriteLine("4. 从页blob中读取数据");
int bytesRead = await pageBlob.DownloadRangeToByteArrayAsync(samplePagedata, 0, 0, samplePagedata.Count());
// 示例后的一些清除工作
Console.WriteLine("6. 删除页Blob");
await pageBlob.DeleteIfExistsAsync();
Console.WriteLine("7. 删除容器");
await container.DeleteIfExistsAsync();
}
/// <summary>
/// 创建一个容器的SAS Uri
/// </summary>
/// <param name="storageAccount">存储账号对象</param>
/// <param name="containerName"> BlockBlob 的容器名</param>
/// <returns>Uri</returns>
private static Uri GetContainerSASUri(string containerName)
{
// 通过连接字符串检索存储账号的信息
// 如何配置 Azure 存储空间连接字符串 - https://www.azure.cn/documentation/articles/storage-configure-connection-string/
CloudStorageAccount storageAccount = CreateStorageAccountFromConnectionString(CloudConfigurationManager.GetSetting("StorageConnectionString"));
return new Uri(storageAccount.BlobStorageUri.PrimaryUri.OriginalString + containerName);
}
/// <summary>
/// 创建存储账号的SAS 令牌
/// </summary>
/// <param name="storageAccount">存储账号对象</param>
/// <returns>sasToken</returns>
private static string GetAccountSASToken()
{
// 通过连接字符串检索存储账号的信息
// 如何配置 Azure 存储空间连接字符串 - https://www.azure.cn/documentation/articles/storage-configure-connection-string/
CloudStorageAccount storageAccount = CreateStorageAccountFromConnectionString(CloudConfigurationManager.GetSetting("StorageConnectionString"));
// 使用下述属性为存储账号创建一个新的访问策略:
// Permissions: Read, Write, List, Create, Delete
// ResourceType: Container
// Expires in 24 hours
// Protocols: Https or Http (模拟器还不支持Https)
SharedAccessAccountPolicy policy = new SharedAccessAccountPolicy()
{
Permissions = SharedAccessAccountPermissions.Read | SharedAccessAccountPermissions.Write | SharedAccessAccountPermissions.List | SharedAccessAccountPermissions.Create | SharedAccessAccountPermissions.Delete,
Services = SharedAccessAccountServices.Blob,
ResourceTypes = SharedAccessAccountResourceTypes.Container | SharedAccessAccountResourceTypes.Object,
SharedAccessExpiryTime = DateTime.UtcNow.AddHours(24),
Protocols = SharedAccessProtocol.HttpsOrHttp
};
// 使用SAS令牌创建一个新的存储凭证
string sasToken = storageAccount.GetSharedAccessSignature(policy);
// 返回SASToken
return sasToken;
}
/// <summary>
/// 验证App.Config文件中的连接字符串,当使用者没有更新有效的值时抛出错误提示
/// </summary>
/// <param name="storageConnectionString">连接字符串</param>
/// <returns>CloudStorageAccount 对象</returns>
private static CloudStorageAccount CreateStorageAccountFromConnectionString(string storageConnectionString)
{
CloudStorageAccount storageAccount;
try
{
storageAccount = CloudStorageAccount.Parse(storageConnectionString);
}
catch (FormatException)
{
Console.WriteLine("提供的存储信息无效,请确认App.Config文件中的AccountName和AccountKey有效后重新启动该示例");
Console.ReadLine();
throw;
}
catch (ArgumentException)
{
Console.WriteLine("提供的存储信息无效,请确认App.Config文件中的AccountName和AccountKey有效后重新启动该示例");
Console.ReadLine();
throw;
}
return storageAccount;
}
}
}
| wacn-samples/storage-blob-dotnet-getting-started | BlobStorage/Program.cs | C# | mit | 19,540 |
export class connection {
Identifier: string;
ConnectionString: string;
Reconnect: boolean;
}
| Sinthor/WSM | src/lib/Base/connection.ts | TypeScript | mit | 107 |
<?php
// Passando cabeçalho para JPEG, pois o retorno do arquivo será a imagem.
header("content-type: image/jpeg");
// Nome do álbum para as fotos
$fotosAlbum = @$_GET["a"];
if($fotosAlbum==""){
// Álbum padrão se o mesmo não for passado
$fotosAlbum="galeriateste";
}
$dirImgs = "img/$fotosAlbum/";
// forma antiga de ler arquivos
//Ler os arquivos no diretório e organiza em órdem natural
// $arquivos = scandir($dirImgs);
// array_splice($arquivos,0,2);
// natcasesort($arquivos);
// // loop para pegar arquivos jpg ou jpeg
// // e seus respectivos tamanhos
// foreach($arquivos as $arquivo){
// if(preg_match("/^.+\.jpe?g$/",$arquivo)){
// $imagens[]=$arquivo;
// list($imagemLargura,$imagemAltura)=getimagesize($dirImgs.$arquivo);
// $imagemTamanhos[]="$imagemLargura,$imagemAltura";
// }
// }
//Nova forma de ler os arquivos
$arquivos = glob("$dirImgs*.jp*g", GLOB_NOSORT);
// inicializa arrays
$imagens = $arquivos;
$imagemTamanhos = [];
// total de fotos
$fotoTotal = count($imagens);
// foto a ser exibida e tamanho
$foto = @$_GET["n"]-1;
$fotoTamanho = @$_GET["t"];
if(strpos($fotoTamanho,"-")!==false){
$fotoTamanho=explode("-",$fotoTamanho);
}elseif($fotoTamanho == ""){
$fotoTamanho="nrm";
}
// usa logo?
$logoUsa = false;
// se vai querer pegar metade da foto
// metade 1, esquerda, ou 2, direita
if(@$_GET["p"]==1){
$fotoParte=1;
}elseif(@$_GET["p"]==2){
$fotoParte=2;
}else{
$fotoParte=0;
}
// qualidade da foto
$fotoQualidade=@$_GET["q"];
if($fotoQualidade==""){
$fotoQualidade=75;
}
// arredonda tamnho no caso de usar foto dividida
// em partes
$fotoArredondaTamanho=false;
if(@$_GET["f"]==1){
$fotoArredondaTamanho=true;
}
// se irá fazer interlace na foto
$fotoInterlace=@$_GET["i"];
if($fotoInterlace==""||$fotoInterlace!=0){
$fotoInterlace=1;
}else{
$fotoInterlace=0;
}
// Tamanhos padrões de foto
// primeiro indice do array define a altura da imagem, a qual a logo original seguiu para ter seu tamanho definido.
$fotosTamanhos = array(1200
,150,100
,900,600
,720,480
,760,450
,800,600
,1280,720
,1920,1080
);
// verificando se vai ser usado tamanho $logoPadrao
// ou personalizado
$fotoLogo=$fotosTamanhos[0];
if(is_array($fotoTamanho)){
$fotoLargura=$fotoTamanho[0];
$fotoAltura=$fotoTamanho[1];
}elseif($fotoTamanho=="peq"||$fotoTamanho=="p"){
$fotoLargura=$fotosTamanhos[1];
$fotoAltura=$fotosTamanhos[2];
}elseif($fotoTamanho=="nrm"){
$fotoLargura=$fotosTamanhos[3];
$fotoAltura=$fotosTamanhos[4];
}elseif($fotoTamanho=="dvd"){
$fotoLargura=$fotosTamanhos[5];
$fotoAltura=$fotosTamanhos[6];
}elseif($fotoTamanho=="wb1"){
$fotoLargura=$fotosTamanhos[7];
$fotoAltura=$fotosTamanhos[8];
}elseif($fotoTamanho=="pc1"){
$fotoLargura=$fotosTamanhos[9];
$fotoAltura=$fotosTamanhos[10];
}elseif($fotoTamanho=="7hd"){
$fotoLargura=$fotosTamanhos[11];
$fotoAltura=$fotosTamanhos[12];
}elseif($fotoTamanho=="fhd"){
$fotoLargura=$fotosTamanhos[13];
$fotoAltura=$fotosTamanhos[14];
}
// verifica se a foto esta no intervalo
if($foto<0||$foto>$fotoTotal){
$foto=0;
}
// pegando a imagem requerida junto ao tamanho
$imagemOriginal = $imagens[$foto];
list($imagemLargura,$imagemAltura)=getimagesize($imagemOriginal);
$imagemTamanhos[]="$imagemLargura,$imagemAltura";
$imagemOriginalTamanhos = explode(",",$imagemTamanhos[0]);
// logo padrao para a foto
$logoPadrao = 0;
if(is_numeric(@$_GET["l"])){
$logoPadrao = @$_GET["l"];
}
if($logoPadrao>0&&$logoPadrao<10){
$logoUsa=true;
}
// ajustando imagens
list($imagemOriginalLargura,$imagemOriginalAltura) = $imagemOriginalTamanhos;
$imagemAltura = $fotoAltura;
$imagemLargura = round($imagemOriginalLargura * $imagemAltura / $imagemOriginalAltura);
if($imagemLargura>$fotoLargura){
$imagemLargura = $fotoLargura;
$imagemAltura = round($imagemOriginalAltura * $imagemLargura / $imagemOriginalLargura);
}
$imagemLarguraParte=$imagemLargura;
if($fotoParte>0){
$imagemLarguraParte = floor($imagemLargura/2);
}
if($fotoArredondaTamanho){
$imagemLarguraParte = floor($imagemLarguraParte/2)*2;
}elseif(@$_GET["f"]>10){
$imagemLarguraParte = $imagemLargura = @$_GET["f"];
}
$imgP = imagecreatetruecolor($imagemLarguraParte,$imagemAltura);
$imgPP = imagecreatefromjpeg($imagemOriginal);
$fotoParteX=0;
if($fotoParte==2){
$fotoParteX=$imagemLarguraParte*-1;
}
imagecopyresampled($imgP,$imgPP,$fotoParteX,0,0,0,$imagemLargura,$imagemAltura,$imagemOriginalLargura,$imagemOriginalAltura);
// se usa logo
if($logoUsa){
$imgLogoO = "logo.png";
list($imgLOW,$imgLOH) = getimagesize($imgLogoO);
$imagemLarguraL = $imgLOW * ($imagemAltura / $fotoLogo);
$imagemAlturaL = $imgLOH * ($imagemAltura / $fotoLogo);
$intPXY = 3;
$imgLogo = imagecreatefrompng($imgLogoO);
$logoPadraoX = $imagemLargura / ($intPXY-1) * (($intPXY - 1 + $logoPadrao) % $intPXY) - $imagemLarguraL / ($intPXY-1) * (($intPXY - 1 + $logoPadrao) % $intPXY);
$logoPadraoY = $imagemAltura / ($intPXY-1) * (ceil($logoPadrao / $intPXY) - 1) - $imagemAlturaL / ($intPXY-1) * (ceil($logoPadrao / $intPXY) - 1);
if($fotoParte==2){
$logoPadraoX -= $imagemLargura / 2;
}
imagecopyresampled($imgP,$imgLogo,$logoPadraoX,$logoPadraoY,0,0,$imagemLarguraL,$imagemAlturaL,$imgLOW,$imgLOH);
imagedestroy($imgLogo);
}
// Cria as imagens e depois destroi os objetos usados.
imageinterlace($imgP,$fotoInterlace);
imagejpeg($imgP,null,$fotoQualidade);
imagedestroy($imgP);
imagedestroy($imgPP);
?> | djmibpqt/sade-php-galeria-foto | imagens.php | PHP | mit | 5,423 |
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("_03.Styling_a_HTML_Form")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("_03.Styling_a_HTML_Form")]
[assembly: AssemblyCopyright("Copyright © 2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("813cd9f6-f95d-4b6f-b61c-9f23efe12745")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| kaizer04/SoftUni | HTML&CSS/CheckHW/07-CSS/03.Styling a HTML Form/03.Styling a HTML Form/Properties/AssemblyInfo.cs | C# | mit | 1,382 |
/*
* Copyright (c) 2016, Hisao Tamaki
*/
package tw.exact;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.Arrays;
/**
* This class provides a representation of tree-decompositions of graphs.
* It is based on the {@code Graph} class for the representation of graphs.
* Members representing the bags and tree edges are all public.
* Reading from and writing to files, in the .td format of PACE challeng,
* are provided.
*
* @author Hisao Tamaki
*/
public class TreeDecomposition {
/**
* number of bags
*/
public int nb;
/**
* intended width of this decomposition
*/
public int width;
/**
* the graph decomposed
*/
public Graph g;
/**
* array of bags, each of which is an int array listing vertices.
* The length of this array is {@code nb + 1} as the bag number (index)[
* starts from 1
*/
public int[][] bags;
/**
* array of bags, each of which is an {@code XBitSet} representing
* the set of vertices in the bag.
* The length of this array is {@code nb + 1} as the bag number (index)[
* starts from 1.
*/
public XBitSet[] bagSets;
/**
* array of node degrees. {@code degree[i]} is the number of bags adjacent
* to the ith bag.
* The length of this array is {@code nb + 1} as the bag number (index)[
* starts from 1.
*/
public int degree[];
/**
* array of int arrays representing neighbor lists.
* {@code neighbor[i][j]} is the bag index (in {@bags} array) of
* the jth bag adjacent to the ith bag.
* The length of this array is {@code nb + 1} as the bag number (index)[
* starts from 1.
*/
public int neighbor[][];
private static boolean debug = false;
// private static boolean debug = true;
/**
* Construct a tree decomposition with the specified number of bags,
* intended width, and the graph decomposed.
* @param nb the number of bags
* @param width the intended width
* @param g the graph decomposed
*/
public TreeDecomposition(int nb, int width, Graph g) {
this.nb = nb;
this.width = width;
this.g = g;
bags = new int[nb + 1][];
degree = new int[nb + 1];
neighbor = new int[nb + 1][];
}
/**
* Sets the ith bag to the given bag.
* @param i the index of the bag. 1 <= i <= nb must hold
* @param bag int array representing the bag
*/
public void setBag(int i, int[] bag) {
bags[i] = bag;
}
/**
* Adds the given bag. The number of bags {@code nb} is incremented.
* @param bag int array representing the bag to be added
*/
public int addBag(int[] bag) {
nb++;
if (debug) {
System.out.print(nb + "th bag:");
}
for (int i = 0; i < bag.length; i++) {
if (debug) {
System.out.print(" " + bag[i]);
}
}
if (debug) {
System.out.println();
}
bags = Arrays.copyOf(bags, nb + 1);
bags[nb] = bag;
degree = Arrays.copyOf(degree, nb + 1);
neighbor = Arrays.copyOf(neighbor, nb + 1);
if (bagSets != null) {
bagSets = Arrays.copyOf(bagSets, nb + 1);
bagSets[nb] = new XBitSet(bag);
}
return nb;
}
/**
* Adds and edge
* the neighbor lists of both bags, as well as the degrees,
* are updated
* @param i index of one bag of the edge
* @param j index of the other bag of the edge
*/
public void addEdge(int i, int j) {
if (debug) {
System.out.println("add deomposition edge (" + i + "," + j + ")");
}
addHalfEdge(i, j);
addHalfEdge(j, i);
}
/**
* Adds a bag to the neibhor list of another bag
* @param i index of the bag of which the neighbor list is updated
* @param j index of the bag to be added to {@code neighbor[i]}
*/
private void addHalfEdge(int i, int j) {
if (neighbor[i] == null) {
degree[i] = 1;
neighbor[i] = new int[]{j};
}
else if (indexOf(j, neighbor[i]) < 0){
degree[i]++;
neighbor[i] = Arrays.copyOf(neighbor[i], degree[i]);
neighbor[i][degree[i] - 1] = j;
}
}
/**
* Combine the given tree-decomposition into this target tree-decomposition.
* The following situation is assumed. Let G be the graph for which this
* target tree-decomposition is being constructed. Currently,
* this tree-decomposition contains bags for some subgraph of G.
* The tree-decomposition of some other part of G is given by the argument.
* The numbering of the vertices in the argument tree-decomposition differs
* from that in G and the conversion map is provided by another argument.
* @param td tree-decomposition to be combined
* @param conv the conversion map, that maps the vertex number in the graph of
* tree-decomposition {@code td} into the vertex number of the graph of this
* target tree-decomposition.
*/
public void combineWith(TreeDecomposition td, int conv[]) {
this.width = Math.max(this.width, td.width);
int nb0 = nb;
for (int i = 1; i <= td.nb; i++) {
addBag(convertBag(td.bags[i], conv));
}
for (int i = 1; i <= td.nb; i++) {
for (int j = 0; j < td.degree[i]; j++) {
int h = td.neighbor[i][j];
addHalfEdge(nb0 + i, nb0 + h);
}
}
}
/**
* Combine the given tree-decomposition into this target tree-decomposition.
* The assumptions are the same as in the method with two parameters.
* The third parameter specifies the way in which the two parts
* of the decompositions are connected by a tree edge of the decomposition.
*
* @param td tree-decomposition to be combined
* @param conv the conversion map, that maps the vertex number in the graph of
* tree-decomposition {@code td} into the vertex number of the graph of this
* target tree-decomposition.
* @param v int array listing vertices: an existing bag containing all of
* these vertices and a bag in the combined part containing all of
* these vertices are connected by a tree edge; if {@code v} is null
* then first bags of the two parts are connected
*/
public void combineWith(TreeDecomposition td, int conv[], int v[]) {
this.width = Math.max(this.width, td.width);
int nb0 = nb;
for (int i = 1; i <= td.nb; i++) {
addBag(convertBag(td.bags[i], conv));
}
for (int i = 1; i <= td.nb; i++) {
for (int j = 0; j < td.degree[i]; j++) {
int h = td.neighbor[i][j];
addEdge(nb0 + i, nb0 + h);
}
}
if (nb0 == 0) {
return;
}
if (v == null) {
addEdge(1, nb0 + 1);
}
else {
int k = findBagWith(v, 1, nb0);
int h = findBagWith(v, nb0 + 1, nb);
if (k < 0) {
System.out.println(Arrays.toString(v) + " not found in the first " + nb0 + " bags");
}
if (h < 0) {
System.out.println(Arrays.toString(v) + " not found in the last " + td.nb + " bags");
}
addEdge(k, h);
}
}
/**
* Converts the vetex number in the bag
* @param bag input bag
* @param conv conversion map of the vertices
* @return the bag resulting from the conversion,
* containing {@code conv[v]} for each v in the original bag
*/
private int[] convertBag(int bag[], int conv[]) {
int[] result = new int[bag.length];
for (int i = 0; i < bag.length; i++) {
result[i] = conv[bag[i]];
}
return result;
}
/**
* Find a bag containing all the listed vertices,
* with bag index in the specified range
* @param v int array listing vertices
* @param s the starting bag index
* @param t the ending bag index
* @return index of the bag containing all the
* vertices listed in {@code v}; -1 if none of the
* bags {@code bags[i]}, s <= i <= t, satisfies this
* condition.
*/
private int findBagWith(int v[], int s, int t) {
for (int i = s; i <= t; i++) {
boolean all = true;
for (int j = 0; j < v.length; j++) {
if (indexOf(v[j], bags[i]) < 0) {
all = false;
}
}
if (all) return i;
}
return -1;
}
/**
* write this tree decomposition to the given print stream
* in the PACE .td format
* @param ps print stream
*/
public void writeTo(PrintStream ps) {
ps.println("s td " + nb + " " + (width + 1) + " " + g.n);
for (int i = 1; i <= nb; i++) {
ps.print("b " + i);
for (int j = 0; j < bags[i].length; j++) {
ps.print(" " + (bags[i][j] + 1));
}
ps.println();
}
for (int i = 1; i <= nb; i++) {
for (int j = 0; j < degree[i]; j++) {
int h = neighbor[i][j];
if (i < h) {
ps.println(i + " " + h);
}
}
}
}
/**
* validates this target tree-decomposition
* checking the three required conditions
* The validation result is printed to the
* standard output
*/
public void validate() {
System.out.println("validating nb = " + nb + ", ne = " + numberOfEdges());
boolean error = false;
if (!isConnected()) {
System.out.println("is not connected ");
error = true;
}
if (isCyclic()) {
System.out.println("has a cycle ");
error = true;
}
if (tooLargeBag()) {
System.out.println("too Large bag ");
error = true;
}
int v = missinVertex();
if (v >= 0) {
System.out.println("a vertex " + v + " missing ");
error = true;
}
int edge[] = missingEdge();
if (edge != null) {
System.out.println("an edge " + Arrays.toString(edge) + " is missing ");
error = true;
}
if (violatesConnectivity()) {
System.out.println("connectivety property is violated ");
error = true;
}
if (!error) {
System.out.println("validation ok");
}
}
/**
* Checks if this tree-decomposition is connected as
* a graph of bags
* @return {@code true} if this tree-decomposition is connected
* {@cdoe false} otherwise
*/
private boolean isConnected() {
boolean mark[] = new boolean [nb + 1];
depthFirst(1, mark);
for (int i = 1; i <= nb; i++) {
if (!mark[i]) {
return false;
}
}
return true;
}
private void depthFirst(int i, boolean mark[]) {
mark[i] = true;
for (int a = 0; a < degree[i]; a++) {
int j = neighbor[i][a];
if (!mark[j]) {
depthFirst(j, mark);
}
}
}
/**
* Checks if this tree-decomposition is acyclic as
* a graph of bags
* @return {@code true} if this tree-decomposition is acyclic
* {@cdoe false} otherwise
*/
private boolean isCyclic() {
boolean mark[] = new boolean [nb + 1];
return isCyclic(1, mark, 0);
}
private boolean isCyclic(int i, boolean mark[],
int parent) {
mark[i] = true;
for (int a = 0; a < degree[i]; a++) {
int j = neighbor[i][a];
if (j == parent) {
continue;
}
if (mark[j]) {
return true;
}
else {
boolean b = isCyclic(j, mark, i);
if (b) return true;
}
}
return false;
}
/**
* Checks if the bag size is within the declared
* tree-width plus one
* @return {@code true} if there is some violating bag,
* {@cdoe false} otherwise
*/
private boolean tooLargeBag() {
for (int i = 1; i <= nb; i++) {
if (bags[i].length > width + 1) {
return true;
}
}
return false;
}
/**
* Finds a vertex of the graph that does not appear
* in any of the bags
* @return the missing vertex number; -1 if there is no
* missing vertex
*/
private int missinVertex() {
for (int i = 0; i < g.n; i++) {
if (!appears(i)) {
return i;
}
}
return -1;
}
/**
* Checks if the given vertex appears in some bag
* of this target tree-decomposition
* @param v vertex number
* @return {@cod true} if vertex {@code v} appears in
* some bag
*/
private boolean appears(int v) {
for (int i = 1; i <= nb; i++) {
if (indexOf(v, bags[i]) >= 0) {
return true;
}
}
return false;
}
/**
* Checks if there is some edge not appearing in any
* bag of this target tree-decomposition
* @return two element int array representing the
* missing edge; null if there is no missing edge
*/
private int[] missingEdge() {
for (int i = 0; i < g.n; i++) {
for (int j = 0; j < g.degree[i]; j++) {
int h = g.neighbor[i][j];
if (!appears(i, h)) {
return new int[]{i, h};
}
}
}
return null;
}
/**
* Checks if the edge between the two specified vertices
* appear in some bag of this target tree-decomposition
* @param u one endvertex of the edge
* @param v the other endvertex of the edge
* @return {@code true} if this edge appears in some bag;
* {@code false} otherwise
*/
private boolean appears(int u, int v) {
for (int i = 1; i <= nb; i++) {
if (indexOf(u, bags[i]) >= 0 &&
indexOf(v, bags[i]) >= 0) {
return true;
}
}
return false;
}
/**
* Checks if this target tree-decomposition violates
* the connectivity condition for some vertex of the graph
* @return {@code true} if the condition is violated
* for some vertex; {@code false} otherwise.
*/
private boolean violatesConnectivity() {
for (int v = 1; v <= g.n; v++) {
if (violatesConnectivity(v)) {
return true;
}
}
return false;
}
/**
* Checks if this target tree-decomposition violates
* the connectivity condition for the given vertex {@code v}
* @param v vertex number
* @return {@code true} it the connectivity condition is violated
* for vertex {@code v}
*/
private boolean violatesConnectivity(int v) {
boolean mark[] = new boolean[nb + 1];
for (int i = 1; i <= nb; i++) {
if (indexOf(v, bags[i]) >= 0) {
markFrom(i, v, mark);
break;
}
}
for (int i = 1; i <= nb; i++) {
if (!mark[i] && indexOf(v, bags[i]) >= 0) {
return true;
}
}
return false;
}
/**
* Mark the tree nodes (bags) containing the given vertex
* that are reachable from the bag numbered {@code i},
* without going through the nodes already marked
* @param i bag number
* @param v vertex number
* @param mark boolean array recording the marks:
* {@code mark[v]} represents if vertex {@code v} is marked
*/
private void markFrom(int i, int v, boolean mark[]) {
if (mark[i]) {
return;
}
mark[i] = true;
for (int j = 0; j < degree[i]; j++) {
int h = neighbor[i][j];
if (indexOf(v, bags[h]) >= 0) {
markFrom(h, v, mark);
}
}
}
/**
* Simplify this target tree-decomposition by
* forcing the intersection between each pair of
* adjacent bags to be a minimal separator
*/
public void minimalize() {
if (bagSets == null) {
bagSets = new XBitSet[nb + 1];
for (int i = 1; i <= nb; i++) {
bagSets[i] = new XBitSet(bags[i]);
}
}
for (int i = 1; i <= nb; i++) {
for (int a = 0; a < degree[i]; a++) {
int j = neighbor[i][a];
XBitSet separator = bagSets[i].intersectWith(bagSets[j]);
XBitSet iSide = new XBitSet(g.n);
collectVertices(i, j, iSide);
iSide.andNot(separator);
XBitSet neighbors = g.neighborSet(iSide);
XBitSet delta = separator.subtract(neighbors);
bagSets[i].andNot(delta);
}
}
for (int i = 1; i <= nb; i++) {
bags[i] = bagSets[i].toArray();
}
}
/**
* Collect vertices in the bags in the specified
* subtree of this target tree-decomposition
* @param i the bag index of the root of the subtree
* @param exclude the index in the adjacency list
* the specified bag, to be excluded from the subtree
* @param set the {@XBitSet} in which to collect the
* vertices
*/
private void collectVertices(int i, int exclude, XBitSet set) {
set.or(bagSets[i]);
for (int a = 0; a < degree[i]; a++) {
int j = neighbor[i][a];
if (j != exclude) {
collectVertices(j, i, set);
}
}
}
/**
* Canonicalize this target tree-decomposition by
* forcing every bag to be a potential maximal clique.
* A naive implementation with no efficiency considerations.
*/
public void canonicalize() {
if (bagSets == null) {
bagSets = new XBitSet[nb + 1];
for (int i = 1; i <= nb; i++) {
bagSets[i] = new XBitSet(bags[i]);
}
}
boolean moving = true;
while (moving) {
moving = false;
int i = 1;
while (i <= nb) {
if (trySplit(i)) {
moving = true;
}
i++;
}
}
}
private boolean trySplit(int i) {
XBitSet neighborSets[] = new XBitSet[g.n];
XBitSet b = bagSets[i];
ArrayList<XBitSet> components = g.getComponents(b);
XBitSet seps[] = new XBitSet[components.size()];
for (int j = 0; j < seps.length; j++) {
seps[j] = g.neighborSet(components.get(j)).intersectWith(b);
}
for (int v = b.nextSetBit(0); v >= 0;
v = b.nextSetBit(v + 1)) {
XBitSet ns = g.neighborSet[v].intersectWith(b);
for (XBitSet sep: seps) {
if (sep.get(v)) {
ns.or(sep);
}
}
ns.clear(v);
neighborSets[v] = ns.intersectWith(b);
}
for (int v = b.nextSetBit(0); v >= 0;
v = b.nextSetBit(v + 1)) {
XBitSet left = neighborSets[v];
left.set(v);
XBitSet right = b.subtract(left);
if (right.isEmpty()) {
continue;
}
XBitSet separator = new XBitSet(g.n);
for (int w = right.nextSetBit(0); w >= 0;
w = right.nextSetBit(w + 1)) {
separator.or(neighborSets[w]);
}
right.or(separator);
int j = addBag(right.toArray());
bags[i] = left.toArray();
bagSets[i] = left;
int ni = 0;
int nj = 0;
neighbor[j] = new int[degree[i]];
for (int k = 0; k < degree[i]; k++) {
int h = neighbor[i][k];
if (bagSets[h].intersects(left)) {
neighbor[i][ni++] = h;
}
else {
neighbor[j][nj++] = h;
}
}
degree[i] = ni;
degree[j] = nj;
neighbor[i] = Arrays.copyOf(neighbor[i], ni);
neighbor[j] = Arrays.copyOf(neighbor[j], nj);
addEdge(i, j);
for (int k = 0; k < nj; k++) {
int h = neighbor[j][k];
for (int l = 0; l < degree[h]; l++) {
if (neighbor[h][l] == i) {
neighbor[h][l] = j;
}
}
}
return true;
}
return false;
}
/**
* Tests if the target tree-decomposition is canonical,
* i.e., consists of potential maximal cliques.
*/
public boolean isCanonical() {
for (int i = 1; i <= nb; i++) {
if (!isCanonicalBag(new XBitSet(bags[i]))) {
return false;
}
}
return true;
}
private boolean isCanonicalBag(XBitSet b) {
ArrayList<XBitSet> components = g.getComponents(b);
for (int v = b.nextSetBit(0); v >= 0;
v = b.nextSetBit(v + 1)) {
for (int w = b.nextSetBit(v + 1); w >= 0;
w = b.nextSetBit(w + 1)) {
if (g.neighborSet[v].get(w)) {
continue;
}
boolean covered = false;
for (XBitSet compo: components) {
XBitSet ns = g.neighborSet(compo);
if (ns.get(v) && ns.get(w)) {
covered = true;
break;
}
}
if (!covered) {
return false;
}
}
}
return true;
}
public void analyze(int rootIndex) {
if (bagSets == null) {
bagSets = new XBitSet[nb + 1];
for (int i = 1; i <= nb; i++) {
bagSets[i] = new XBitSet(bags[i]);
}
}
analyze(rootIndex, -1);
}
private void analyze(int i, int exclude) {
System.out.println(i + ": " + bagSets[i]);
XBitSet separator = bagSets[i];
XBitSet set[] = new XBitSet[degree[i]];
ArrayList<XBitSet> components = g.getComponents(separator);
for (int a = 0; a < degree[i]; a++) {
int j = neighbor[i][a];
set[a] = new XBitSet(g.n);
collectVertices(j, i, set[a]);
}
for (int a = 0; a < degree[i]; a++) {
int j = neighbor[i][a];
if (j != exclude) {
System.out.println(" subtree at " + j);
for (XBitSet compo: components) {
if (compo.isSubset(set[a])) {
System.out.println(" contains " + compo);
}
else if (compo.intersects(set[a])) {
System.out.println(" intersects " + compo);
System.out.println(" but missing " +
compo.subtract(set[a]));
}
}
}
}
for (XBitSet compo: components) {
boolean intersecting = false;
for (int a = 0; a < degree[i]; a++) {
if (compo.intersects(set[a])) {
intersecting = true;
}
}
if (!intersecting) {
System.out.println(" component totally missing: " +
compo);
}
}
for (int a = 0; a < degree[i]; a++) {
int j = neighbor[i][a];
if (j != exclude) {
analyze(j, i);
}
}
}
/**
* Computes the number of tree edges of this tree-decomosition,
* which is the sum of the node degrees divides by 2
* @return the number of edges
*/
private int numberOfEdges() {
int count = 0;
for (int i = 1; i <= nb; i++) {
count += degree[i];
}
return count / 2;
}
/**
* Finds the index at which the given element
* is found in the given array.
* @param x int value to be searched
* @param a int array in which to find {@code x}
* @return {@code i} such that {@code a[i] == x};
* -1 if none such index exists
*/
private int indexOf(int x, int a[]) {
return indexOf(x, a, a.length);
}
/**
* Finds the index at which the given element
* is found in the given array.
* @param x int value to be searched
* @param a int array in which to find {@code x}
* @param n the number of elements to be searched
* in the array
* @return {@code i} such that {@code a[i] == x} and
* 0 <= i <= n; -1 if none such index exists
*/
private int indexOf(int x, int a[], int n) {
for (int i = 0; i < n; i++) {
if (x == a[i]) {
return i;
}
}
return -1;
}
/**
* Reads the tree-decomposition for a given graph from
* a file at a given path and with a given name, in the
* PACE .gr format; the extension .gr is added to the name.
* @param path path at which the file is found
* @param name file name, without the extension
* @param g graph
* @return the tree-decomposition read
*/
public static TreeDecomposition readDecomposition(String path, String name, Graph g) {
File file = new File(path + "/" + name + ".td");
try {
BufferedReader br = new BufferedReader(new FileReader(file));
String line = br.readLine();
while (line.startsWith("c")) {
line = br.readLine();
}
if (line.startsWith("s")) {
String s[] = line.split(" ");
if (!s[1].equals("td")) {
throw new RuntimeException("!!Not treewidth solution " + line);
}
int nb = Integer.parseInt(s[2]);
int width = Integer.parseInt(s[3]) - 1;
int n = Integer.parseInt(s[4]);
System.out.println("nb = " + nb + ", width = " + width + ", n = " + n);
TreeDecomposition td = new TreeDecomposition(0, width, g);
for (int i = 0; i < nb; i++) {
line = br.readLine();
while (line.startsWith("c")) {
line = br.readLine();
}
s = line.split(" ");
if (!s[0].equals("b")) {
throw new RuntimeException("!!line starting with 'b' expected");
}
if (!s[1].equals(Integer.toString(i + 1))) {
throw new RuntimeException("!!Bag number " + (i + 1) + " expected");
}
int bag[] = new int[s.length - 2];
for (int j = 0; j < bag.length; j++) {
bag[j] = Integer.parseInt(s[j + 2]) - 1;
}
td.addBag(bag);
}
while (true) {
line = br.readLine();
while (line != null && line.startsWith("c")) {
line = br.readLine();
}
if (line == null) {
break;
}
s = line.split(" ");
int j = Integer.parseInt(s[0]);
int k = Integer.parseInt(s[1]);
td.addEdge(j, k);
td.addEdge(k, j);
}
return td;
}
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
}
| TCS-Meiji/PACE2017-TrackA | tw/exact/TreeDecomposition.java | Java | mit | 25,944 |
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>the road to angular</title>
<meta name="description" content="Why you should be using angular">
<meta name="author" content="Kasper Reijnders">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link rel="stylesheet" href="css/reveal.min.css">
<link rel="stylesheet" href="css/theme/incentro.css" id="theme">
<!-- For syntax highlighting -->
<link rel="stylesheet" href="lib/css/zenburn.css">
<!-- If the query includes 'print-pdf', use the PDF print sheet -->
<script>
document.write( '<link rel="stylesheet" href="css/print/' + ( window.location.search.match( /print-pdf/gi ) ? 'pdf' : 'paper' ) + '.css" type="text/css" media="print">' );
</script>
<!--[if lt IE 9]>
<script src="lib/js/html5shiv.js"></script>
<![endif]-->
</head>
<body>
<div class="scripts">
<script charset="utf-8" src="slides/angular-conf/js/angular.js"></script>
<script charset="utf-8" src="slides/angular-conf/js/mustache.js"></script>
<script charset="utf-8">
var app1 = angular.module('exampleapp', []);
app1.controller('appCtrl', function ($scope) {
$scope.value = 'superhero';
});
app1.controller('listCtrl', function ($scope) {
$scope.carpark = {
volkswagen: ['golf', 'polo', 'up'],
toyota: ['aygo', 'yaris', 'auris', 'prius'],
opel: ['astra']
};
});
</script>
</div>
<div class="reveal">
<!-- Any section element inside of this container is displayed as a slide -->
<div class="slides" ng-app="exampleapp" >
<section>
<section id="introduction">
<h2>the road to angularjs</h2>
<small>Created by <a href="http://kasperreijnders.nl">Kasper Reijnders</a> / <a href="http://twitter.com/kaspereden">@kaspereden</a></small>
</section>
<section id="its-a-me">
<h3>/me</h3>
<p class="fragment"><a href="http://www.kasperreijnders.nl">Kasper Reijnders</a></p>
<p class="fragment"><a href="http://www.incentro.com">Incentro</a></p>
<p class="fragment">front-end hero</p>
<p class="fragment">musician</p>
<p class="fragment">scouting</p>
<p class="fragment">sports</p>
<p class="fragment">that guy with a yellow shirt on</p>
<aside class="notes">
asked colleagues
</aside>
</section>
</section>
<section>
<section id="project">
<h2>project</h2>
</section>
<section>
<img src="slides/angular-conf/images/box1.jpg" alt="cat">
<aside class="notes">
project outgrows boundaries
</aside>
</section>
<section>
<img src="slides/angular-conf/images/adding.jpg" alt="add">
<aside class="notes">
resources and more and more
</aside>
</section>
<section>
<img src="slides/angular-conf/images/box2.jpg" alt="cat box">
<aside class="notes">
not what you expected<br>
business adds more
</aside>
</section>
<section data-background="slides/angular-conf/images/pop-density-3.jpg">
<aside class="notes">
until its so complex
</aside>
</section>
<section>
<img src="slides/angular-conf/images/blackbox.jpeg" alt="bb">
<aside class="notes">
what is actually happening?<br>
new colleagues feel?<br>
and its getting worse
</aside>
</section>
<section>
<table>
<tr>
<td rowspan="2" style="width: 20px">
</td>
<td>
<img src="slides/angular-conf/images/cell-phones.jpg" alt="bb">
</td>
<td>
<img class="fragment" src="slides/angular-conf/images/watch.jpg" alt="bb">
</td>
<td rowspan="2" style="width: 20px">
</td>
</tr>
<tr class="fragment" >
<td>
<img src="slides/angular-conf/images/dk2-product.jpg" alt="bb">
</td>
<td>
<img src="slides/angular-conf/images/423989-google-glass.jpg" alt="bb">
</td>
</tr>
</table>
<aside class="notes">
business wants to optimize for devices (phones) then watches, or glasses
</aside>
</section>
<section data-background="slides/angular-conf/images/wires.JPG">
<aside class="notes">
once it was nice, all changes
</aside>
</section>
<section data-background="slides/angular-conf/images/wires_A_Server_Room_Nightmare-s600x383-12112-580.jpg">
<aside class="notes">
now its a mess<br>
-> refactor
</aside>
</section>
<section>
<h2>layers</h2>
<h2 class="fragment">applications</h2>
<aside class="notes">
split in layers<br>
data,<br>
modification (2/3)<br>
business logic<br>
presentation<br>
applications ipv 1 big thing
</aside>
</section>
<section>
<h2>layers</h2>
<aside class="notes">
layers and abstractions<br>
logic separated from presentation<br>
store data -> lowest level<br>
accessible for anyone<br>
lets put it to test
</aside>
</section>
<section data-background="slides/angular-conf/images/architecture.svg">
<aside class="notes">
split layers, explain model <br>
each application has an owner<br>
REST is click
</aside>
</section>
<section data-background="slides/angular-conf/images/architecture1.svg">
<aside class="notes">
start coding!
</aside>
</section>
<section data-background="slides/angular-conf/images/yay.jpg">
</section>
</section>
<section>
<section id="design-patterns">
<h2>design patterns</h2>
<aside class="notes">
1st explain patterns
</aside>
</section>
<section>
<img src="slides/angular-conf/images/noo.gif"/>
</section>
<section>
<h2>mvc</h2>
<h3 class="fragment">model view controller</h3>
<aside class="notes">
need to understand MVC
</aside>
</section>
<section data-background="slides/angular-conf/images/MCV.svg">
<img src="slides/angular-conf/images/MVC.png" class="fragment" />
</section>
<section data-background="slides/angular-conf/images/MCV.svg">
<aside class="notes">
MVC stands for model view controller. IMAGE The user sees a view, the view is typically some HTML, the HTML gets feeded by some data, the model. When a user changes something on the page the controller is used to update the model and alter the page.
</aside>
</section>
<section data-markdown data-background="#3F3F3F">
<script type="text/template">
```html
<p><a class="mine" href="#"></a> text</p>
<p class="mine"></p>
<div class="container">
<input class="mine mineInput"/>
</div>
```
</script>
</section>
<section data-markdown data-background="#3F3F3F">
<script type="text/template">
```javascript
var model = {
value: 'nothing'
};
```
</script>
</section>
<section data-markdown data-background="#3F3F3F">
<script type="text/template">
```javascript
function updateModel() {
var containers = example1.getElementsByClassName('mine');
for (var i = 0; i< containers.length; i = i+1) {
if (containers[i].value !== undefined) {
containers[i].value = model.value;
} else {
containers[i].textContent = model.value;
}
}
}
inputs[i].onchange = function() {
model.value=this.value;
updateModel();
};
```
</script>
</section>
<section id="example1">
<h2>plain js example</h2>
<p><a class="mine" href="#"></a> text</p>
<p class="mine"></p>
<div class="container">
<input class="mine mineInput"/>
</div>
<aside class="notes">
not workable<br>
big objects
</aside>
<script charset="utf-8" src="slides/angular-conf/js/1-plain.js"></script>
</section>
<section data-markdown data-background="#3F3F3F">
<script type="text/template">
```html
<div class="mine-container"></div>
```
</script>
</section>
<section data-markdown data-background="#3F3F3F">
<script type="text/template">
```javascript
var view = '<p><a href="#">{{value}}</a> text</p>' +
'<p>{{value}}</p>' +
'<div class="container">' +
'<input class="mineInput" value="{{value}}"/>' +
'</div>';
```
</script>
</section>
<section data-markdown data-background="#3F3F3F">
```javascript
example2.getElementsByClassName('mine-container')[0].innerHTML =
Mustache.render(view, model);
```
</section>
<section id="example2">
<h2>mustache example</h2>
<div class="mine-container"></div>
<script charset="utf-8" src="slides/angular-conf/js/2-mustache.js"></script>
</section>
<section>
<ul>
<li>Update data via MVC pattern</li>
<li class="fragment">Complex data in model</li>
<li class="fragment">No userhandling</li>
</ul>
<aside class="notes">
2klik<br>
updates, complex data, no handling<br>
(define on change events)
</aside>
</section>
<section data-background="#3F3F3F" data-markdown>
```javascript
inputs[i].onchange = function() {};
```
Note:
jquery not solve this
</section>
<section data-background="slides/angular-conf/images/MCV-circle.svg">
<aside class="notes">
recap missing 2-way data binding
</aside>
</section>
<section>
<h2>angular / ember</h2>
</section>
<section>
<h2>angular</h2>
</section>
<section data-background="slides/angular-conf/images/MVVM.svg">
<aside class="notes">
why it's cool<br>
remember plain JS?<br>
cool things like
</aside>
</section>
<section>
<code>$scope.value = "my first value";</code>
<aside class="notes">
</aside>
</section>
<section data-markdown data-background="#3F3F3F">
<script type="text/template">
```html
<p><a href="#">{{value}}</a> text</p>
<p>{{value}}</p>
<div>
<input ng-model="value"/>
</div>
```
</script>
</section>
<section>
<div ng-controller="appCtrl">
<p><a href="#">{{value}}</a> text</p>
<p>{{value}}</p>
<div>
<input ng-model="value"/>
</div>
</div>
</section>
<section>
<div ng-controller="listCtrl" >
<ul>
<li ng-repeat="(brand, cars) in carpark">
<b>{{brand}}</b>
<ul>
<li ng-repeat="car in cars">{{car}}</li>
</ul>
</li>
</ul>
</div>
</section>
<section data-markdown data-background="#3F3F3F">
<script type="text/template">
```html
<li ng-repeat="(brand, cars) in carpark">
<b>{{brand}}</b>
<ul>
<li ng-repeat="car in cars">{{car}}</li>
</ul>
</li>
```
```javascript
$scope.carpark = {
volkswagen: ['golf', 'polo', 'up'],
toyota: ['aygo', 'yaris', 'auris', 'prius'],
opel: ['astra']
};
```
</script>
</section>
</section>
<section>
<section id="modules">
<h2>modules</h2>
<aside class="notes">
besides this 2-way databinding<br>
modularity<br>
</aside>
</section>
<section data-background="slides/angular-conf/images/modular.jpg">
<aside class="notes">
build separated
</aside>
</section>
<section data-markdown data-background="#3F3F3F">
<script type="text/template">
```javascript
angular.module('search', []);
```
</script>
<aside class="notes">
define module, mention brackets
</aside>
</section>
<section data-markdown data-background="#3F3F3F">
<script type="text/template">
```javascript
angular.module('autoComplete', []);
angular.module('search', ['autoComplete']);
```
</script>
<aside class="notes">
add sub module
</aside>
</section>
<section>
<img src="slides/angular-conf/images/yeoman.png" alt="" />
<aside class="notes">
project management, git/grunt/bower
</aside>
</section>
<section>
<h2>yo</h2>
<h4 class="fragment"><a href="http://www.yeoman.io" target="_blank">yeoman</a></h4>
<aside class="notes">
click!
</aside>
</section>
<section>
<h2>single page</h2>
<aside class="notes">
so what if single page app?
</aside>
</section>
<section data-markdown data-background="#3F3F3F">
<script type="text/template">
```javascript
var spa = angular.module('SinglePageApplication', [
'module_1', 'module_2', 'module_3'
]);
spa.config(['$routeProvider',
function ($routeProvider) {
$routeProvider.otherwise({
templateUrl: 'spa/templates/404.html',
controller: '404Ctrl'
});
}
]);
```
</script>
</section>
<section data-markdown data-background="#3F3F3F">
<script type="text/template">
```javascript
var searchapp = angular.module('Search', []);
searchapp.config(['$routeProvider',
function ($routeProvider) {
$routeProvider.when('/search', {
templateUrl: 'search/templates/search.html',
controller: 'SearchCtrl'
});
$routeProvider.when('/search/:query', {
templateUrl: 'search/templates/results.html',
controller: 'SearchResultsCtrl',
reloadOnSearch: false
});
}
]);
```
</script>
<aside class="notes">
module as git repo<br>
module has own paths
</aside>
</section>
<section>
<ul>
<li>choose toolkit</li>
<li class="fragment">make it available</li>
<li class="fragment">define code standards</li>
</ul>
</section>
</section>
<section>
<section id="recap">
<h2>recap</h2>
</section>
<section>
<ul>
<li>build modular code</li>
<li class="fragment">split projects into small applications</li>
<li class="fragment">give them an owner</li>
<li class="fragment">2-way data binding is awesome</li>
<li class="fragment">build tools are king<br></li>
<li class="fragment">yo<br><br><br></li>
</ul>
<small>slides at <a href="http://kaspereden.github.io/angularconf-dec14">http://kaspereden.github.io/angularconf-dec14</a></small>
<aside class="notes">
6 li<br>
build tools explain jshint & autoprefixer
</aside>
</section>
</section>
<section id="worldofincentro">
<h4><a href="http://www.incentro.com" target="_blank" class="wof">#worldofincentro</a></h4>
<h4><a href="http://www.twitter.com/kaspereden" target="_blank" class="wof">@kaspereden</a></h4>
</section>
<section id="credits">
<h4>credits</h4>
<small>
<ul>
<li>Cat in box: <a target="_blank" href="http://www.urlesque.com/2010/11/19/maru-vs-increasingly-small-boxes/">http://www.urlesque.com/2010/11/19/maru-vs-increasingly-small-boxes/</a></li>
<li>Add people: <a target="_blank" href="http://www.property118.com/how-to-i-add-my-picture-or-a-business-logo-to-comments/40319/">http://www.property118.com/how-to-i-add-my-picture-or-a-business-logo-to-comments/40319/</a></li>
<li>Crowd: <a target="_blank" href="http://www.planetizen.com/node/71059">http://www.planetizen.com/node/71059</a></li>
<li>Oculus Rift: <a target="_blank" href="https://www.oculus.com/order/">https://www.oculus.com/order/</a></li>
<li>Google Glass: <a target="_blank" href="http://www.pcmag.com/article2/0,2817,2416488,00.asp">http://www.pcmag.com/article2/0,2817,2416488,00.asp</a></li>
<li>Phones: <a target="_blank" href="http://blogs.mcgill.ca/oss/2013/12/07/is-it-true-that-keeping-a-cell-phone-in-a-bra-can-cause-breast-cancer/">http://blogs.mcgill.ca/oss/2013/12/07/is-it-true-that-keeping-a-cell-phone-in-a-bra-can-cause-breast-cancer/</a></li>
<li>Watches: <a target="_blank" href="http://techzulu.com/rock-smartwatch-launches-99-hd-touchscreen-smartwatch/">http://techzulu.com/rock-smartwatch-launches-99-hd-touchscreen-smartwatch/</a></li>
<li>Wires: <a target="_blank" href="http://www.guru3d.com/articles-pages/inside-nvidia-hq,7.html">http://www.guru3d.com/articles-pages/inside-nvidia-hq,7.html</a></li>
<li>Wires2: <a target="_blank" href="http://helpdesk.csgliudger.nl/home/nieuws/nieuwsberichten/verhuizing-serverruimte.html">http://helpdesk.csgliudger.nl/home/nieuws/nieuwsberichten/verhuizing-serverruimte.html</a></li>
<li>Happy: <a target="_blank" href="http://www.huffingtonpost.com/tywan-wade/calling-all-teens-being-y_b_4856395.html">http://www.huffingtonpost.com/tywan-wade/calling-all-teens-being-y_b_4856395.html</a></li>
<li>Sad: <a target="_blank" href="http://marianna.booklikes.com/post/673691/currently-reading-stargazing-from-nowhere-by-isabel-thomas-and-marilyn-thomas">http://marianna.booklikes.com/post/673691/currently-reading-stargazing-from-nowhere-by-isabel-thomas-and-marilyn-thomas</a></li>
</ul>
</small>
</section>
<section id="end">
<h4><a href="http://www.incentro.com" target="_blank" class="wof">#worldofincentro</a></h4>
<h4><a href="http://www.twitter.com/kaspereden" target="_blank" class="wof">@kaspereden</a></h4>
</section>
</div>
</div>
<script src="lib/js/head.min.js"></script>
<script src="js/reveal.min.js"></script>
<script>
// Full list of configuration options available here:
// https://github.com/hakimel/reveal.js#configuration
Reveal.initialize({
controls: false,
progress: true,
history: true,
center: true,
margin: 0,
theme: Reveal.getQueryHash().theme, // available themes are in /css/theme
transition: Reveal.getQueryHash().transition || 'linear', // default/cube/page/concave/zoom/linear/fade/none
// Parallax scrolling
// parallaxBackgroundImage: 'https://s3.amazonaws.com/hakim-static/reveal-js/reveal-parallax-1.jpg',
// parallaxBackgroundSize: '2100px 900px',
// Optional libraries used to extend on reveal.js
dependencies: [
{ src: 'lib/js/classList.js', condition: function() { return !document.body.classList; } },
{ src: 'plugin/markdown/marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } },
// { src: 'plugin/zoom-js/zoom.js', async: true, condition: function() { return !!document.body.classList; } },
{ src: 'plugin/notes/notes.js', async: true, condition: function() { return !!document.body.classList; } }
]
});
</script>
</body>
</html>
| kaspereden/angularconf-dec14 | index.html | HTML | mit | 19,124 |
/**
* @fileoverview Don't use space-separated string to specify CSS classes in an array
* @author Benjamin Van Ryseghem and Damien Cassou
* @copyright 2022 finsit. All rights reserved.
* See LICENSE file in root directory for full license.
*/
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
const classNameKeywords = ["className"];
const MESSAGE = "Only one class per string allowed inside an array.";
function resolveMultipleClasses(node) {
return (fixer) => {
let values = node.value.split(" ").map((each) => `"${each}"`).join(", ");
return fixer.replaceText(node, values);
}
}
function handleArrayExpression(node, context) {
if (node.type !== "ArrayExpression") {
return;
}
node.elements.forEach((element) => {
if (element.type !== "Literal" || !element.value.includes(" ")) {
handleArrayExpression(element, context);
return;
}
context.report({
node: element,
message: MESSAGE,
fix: resolveMultipleClasses(element, context)
});
});
}
function getKeywordOption(options) {
if (!options || !options[0] || !options[0].keywords) {
return classNameKeywords
}
return options[0].keywords
}
module.exports = {
meta: {
fixable: "code"
},
create: function(context) {
return {
Property: function(node) {
let keywords = getKeywordOption(context.options);
if (!keywords.includes(node.key.name)) {
return;
}
handleArrayExpression(node.value, context)
}
}
}
}
| foretagsplatsen/ftgp-eslint | lib/rules/only-single-class-name-in-array.js | JavaScript | mit | 1,573 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>v-modal-dialog</title>
</head>
<body>
<app></app>
<script src="dist/build.js"></script>
</body>
</html>
| v-components/v-modal-dialog | index.html | HTML | mit | 198 |
# README
[https://www.hackerrank.com/challenges/find-median-1](https://www.hackerrank.com/challenges/find-median-1)
| andreimaximov/algorithms | hacker-rank/data-structures/heap/find-median/README.md | Markdown | mit | 117 |
exports.updatePitch = (map, newPitch) => {
if (newPitch && newPitch !== null) {
if (Number.isInteger(newPitch.value) && (newPitch.value >= 0 || newPitch.value <= 60)) {
map.setPitch(newPitch.value, newPitch.eventData);
} else {
throw new Error('Invalid pitch');
}
}
};
| abgordon/sexy-jesus-2 | src/managers/Pitch.js | JavaScript | mit | 297 |
module JPath
class Pointer
def self.parse(string)
new string.split(".").map { |str|
str =~ /\A\d+\z/ ? str.to_i : str
}.to_a
end
def initialize(*ary)
@ary = ary.flatten
end
def ==(other)
to_s == other.to_s
end
def +(string)
self.class.new(@ary + [string])
end
def each(&block)
@ary.each(&block)
end
def name
index? ? (parent.nil? ? nil : parent.name) : @ary.last
end
def grandparent
parent.nil? ? nil : parent.parent
end
def parent
top? ? nil : self.class.new(without_last)
end
def size
@ary.size
end
def index?
@ary.last.is_a?(Integer)
end
def top?
@ary.empty? or top_index?
end
def to_s
@ary.join(".")
end
private
def top_index?
index? && size == 1
end
def without_last
@ary[0...-1]
end
end
end | merimond/jpath | lib/jpath/pointer.rb | Ruby | mit | 994 |
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateAdminTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('superadmin', function (Blueprint $table) {
$table->increments('id');
$table->string('username')->unique();
$table->string('password');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('superadmin');
}
}
| aniruddha-chakraborty/tax | database/migrations/2016_04_02_202600_create_admin_table.php | PHP | mit | 639 |
using UnityEngine;
using UnityEditor;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using UnityEngine.UI;
using UnityEngine.EventSystems;
namespace ScreenMgr
{
/// <summary>
/// Editor for ScreenManager
/// </summary>
[CustomEditor(typeof(ScreenManager))]
public class ScreenManagerEditor : Editor
{
private double clickTime;
private bool filterScreens,filterPopups;
private string searchString = "";
private int selectedId = -99;
private double doubleClickTime = 0.3;
private bool spreadMode = false;
private bool showScreenManagerSettings,showNavigation;
[MenuItem("Window/Select ScreenManager %&t")]
static void ValidateLogSelectedTransformName() {
Selection.activeTransform = GameObject.FindObjectOfType<ScreenManager>().transform;
}
public void OnPlayModeEnter(PlayModeStateChange state) {
ScreenManager screenMgr = (target as ScreenManager);
spreadMode = false;
SpreadMode(false, screenMgr);
EditorApplication.playModeStateChanged -= OnPlayModeEnter;
this.Repaint();
}
public override void OnInspectorGUI()
{
// Get the transform of the object and use that to get all children in alphabetical order
ScreenManager screenMgr = (target as ScreenManager);
var transform = screenMgr.screensContainer == null ? screenMgr.transform : screenMgr.screensContainer;
// var children = (transform as IEnumerable).Cast<Transform>().OrderBy(t => t.gameObject.name).ToArray();
var children = screenMgr.GetComponentsInChildren<BaseScreen>(true);
Color slightGray = new Color(1f, 1f, 1f, 0.4f);
GUILayout.Space(10);
GUI.color = EditorGUIUtility.isProSkin ? Color.white : Color.black;
GUILayout.Toggle(false,"Screen Manager", GUI.skin.FindStyle("LODLevelNotifyText"));
GUI.color = Color.white;
if (!EditorApplication.isPlaying) {
GUILayout.BeginVertical();
bool newToggle = GUILayout.Toggle(spreadMode,"Spread", EditorStyles.miniButton);
if (newToggle != spreadMode) {
spreadMode = newToggle;
SpreadMode(spreadMode, screenMgr);
if (spreadMode) {
EditorApplication.playModeStateChanged += OnPlayModeEnter;
}
}
GUILayout.Space(10);
}
showScreenManagerSettings = EditorGUILayout.Foldout(showScreenManagerSettings, "Main Settings");
if (showScreenManagerSettings) {
screenMgr.touchMode = GUILayout.Toggle(screenMgr.touchMode, "Touch Mode ( disable auto-selection )");
if (!screenMgr.touchMode){
screenMgr.alwaysOnSelection = GUILayout.Toggle(screenMgr.alwaysOnSelection, "Always-on Selection");
screenMgr.instantCancelButton = GUILayout.Toggle(screenMgr.instantCancelButton, "Instant Cancel Button");
}
GUILayout.Space(10);
}
if (!EditorApplication.isPlaying) {
showNavigation = EditorGUILayout.Foldout(showNavigation, "Navigation Tools");
if (showNavigation) {
GUILayout.BeginHorizontal();
{
if (GUILayout.Button("Clear Navigation", EditorStyles.miniButtonLeft)) ClearNavigation(screenMgr, children);
if (GUILayout.Button("Update Navigation", EditorStyles.miniButtonRight)) UpdateNavigation(screenMgr, children);
}
GUILayout.EndHorizontal();
GUILayout.Space(10);
}
GUILayout.EndVertical();
}
GUILayout.Space(20);
// Show screen stack during Play mode
if (EditorApplication.isPlaying) {
GUILayout.Label("Stack :");
var e = screenMgr.Breadcrumbs;
GUILayout.BeginHorizontal();
{
while (e.MoveNext()) {
if (GUILayout.Button(e.Current.screen.name, GUI.skin.FindStyle("Tooltip"))) Selection.activeGameObject = e.Current.screen.gameObject;
GUILayout.Space(10);
}
}
GUILayout.EndHorizontal();
GUILayout.Space(10);
}
// Default Screen
if (screenMgr.defaultScreen!=null) {
GUILayout.Label("Default Screen :");
bool isEnabled = screenMgr.defaultScreen.gameObject.activeSelf;
GUI.color = isEnabled ? Color.white : slightGray;
GUILayout.BeginHorizontal();
{
GUILayout.Toggle(isEnabled, "");//, GUI.skin.FindStyle("VisibilityToggle"));
if (GUILayout.Button(screenMgr.defaultScreen.name, EditorStyles.label)) {
if (selectedId == -1 && (EditorApplication.timeSinceStartup - clickTime) < doubleClickTime) {
Selection.activeGameObject = screenMgr.defaultScreen.gameObject;
}
clickTime = EditorApplication.timeSinceStartup;
selectedId = -1;
if (!EditorApplication.isPlaying) {
foreach (var other in children) {
other.gameObject.SetActive(screenMgr.defaultScreen.transform == other);
}
}
}
// Check if class exists
if (selectedId == -1) {
GUI.color = Color.white;
if (!EditorApplication.isPlaying && GUILayout.Button("Clear Default", EditorStyles.miniButton, GUILayout.Width(100))) {
screenMgr.defaultScreen = null;
Repaint();
return;
}
}
}
GUILayout.EndHorizontal();
}
GUILayout.Space(10);
GUI.color = Color.white;
// Screen Management with that fancy list and all
GUILayout.Label("Screens :");
GUILayout.BeginHorizontal(EditorStyles.toolbar);
{
var allValue = GUILayout.Toggle((filterScreens && filterPopups) || (!filterScreens && !filterPopups), "All", EditorStyles.toolbarButton, GUILayout.Width(30));
if (allValue) filterScreens = filterPopups = true;
filterScreens = GUILayout.Toggle(filterScreens, "Screens", EditorStyles.toolbarButton, GUILayout.Width(70));
filterPopups = GUILayout.Toggle(filterPopups, "Popups", EditorStyles.toolbarButton, GUILayout.Width(70));
if (filterScreens && filterPopups) filterScreens = filterPopups = false;
GUILayout.BeginHorizontal(GUI.skin.FindStyle("Toolbar"));
GUILayout.FlexibleSpace();
searchString = GUILayout.TextField(searchString, GUI.skin.FindStyle("ToolbarSeachTextField"), GUILayout.MaxWidth(300));
if (GUILayout.Button("", GUI.skin.FindStyle("ToolbarSeachCancelButton"))) {
// Remove focus if cleared
searchString = "";
GUI.FocusControl(null);
}
GUILayout.EndHorizontal();
}
GUILayout.EndHorizontal();
GUILayout.BeginVertical();
// Make a button for each child. Pressing the button enables that child and disables all others
for (int i = 0; i < children.Length; i++) {
var child = children[i];
bool isEnabled = child.gameObject.activeSelf;
var screen = child.GetComponent<BaseScreen>();
if(screen == null) continue;
if (screenMgr.defaultScreen!=null && screenMgr.defaultScreen.transform==child) continue; // Ignore default screen since it's already shown up there
if (filterPopups && screen.layerPriority != ScreenManager.LayerPriority.Normal) continue;
if (filterScreens && screen.layerPriority == ScreenManager.LayerPriority.Normal) continue;
if (!string.IsNullOrEmpty(searchString) && !child.gameObject.name.ToLowerInvariant().Contains(searchString.ToLowerInvariant())) continue;
GUI.color = isEnabled ? Color.white : slightGray;
GUILayout.BeginHorizontal(EditorStyles.toolbar);// GUI.skin.FindStyle("TL tab mid"));
GUILayout.Toggle(isEnabled, "");//, GUI.skin.FindStyle("VisibilityToggle"));
string label = child.gameObject.name;
if (screenMgr.Current == screen) label = "CURRENT: " + label;
if (GUILayout.Button(label, EditorStyles.label)) {
if (selectedId==i && (EditorApplication.timeSinceStartup - clickTime) < doubleClickTime){
Selection.activeGameObject = child.gameObject;
}
clickTime = EditorApplication.timeSinceStartup;
selectedId = i;
if (!EditorApplication.isPlaying) {
foreach (var other in children) {
other.gameObject.SetActive(child == other);
}
}
break;
}
// Check if class exists
if (screen != null) {
if (selectedId == i) {
GUI.color = Color.white;
if (!EditorApplication.isPlaying && GUILayout.Button("Set Default", EditorStyles.miniButton, GUILayout.Width(100))) {
screenMgr.defaultScreen = screen;
selectedId = -1;
break;
}
}
} else {
GUILayout.Button("MISSING CLASS", GUI.skin.FindStyle("ChannelStripAttenuationMarkerSquare"), GUILayout.Width(150));
}
GUILayout.EndHorizontal();
}
GUILayout.EndVertical();
GUILayout.Space(10);
if (EditorApplication.isPlaying)
{
this.Repaint();
}
}
private void SpreadMode(bool active, ScreenManager screenMgr) {
RectTransform rectTScreenMgr = screenMgr.GetComponent<RectTransform>();
var screenList = screenMgr.GetComponentsInChildren<BaseScreen>(true);
if (active) {
// Spread
float screenCountX = 0, screenCountY = 0;
for (int i = 0; i < screenList.Length; i++) {
BaseScreen screen = screenList[i];
screen.gameObject.SetActive(true);
RectTransform rectT = screen.GetComponent<RectTransform>();
if (rectT != null) {
screenCountX += (rectTScreenMgr.rect.xMin - rectT.rect.xMin);
screenCountY += (rectTScreenMgr.rect.yMin - rectT.rect.yMin);
rectT.anchoredPosition = new Vector2(screenCountX, screenCountY);
screenCountY -= (rectTScreenMgr.rect.yMax - rectT.rect.yMax);
screenCountX += rectTScreenMgr.rect.width - (rectTScreenMgr.rect.xMax - rectT.rect.xMax);
if (i != 0 && (i % 4) == 0) {
screenCountX = 0;
screenCountY += rectT.rect.height;
}
}
}
} else {
// Unspread
for (int i = 0; i < screenList.Length; i++) {
BaseScreen screen = screenList[i];
screen.gameObject.SetActive(false);
RectTransform rectT = screen.GetComponent<RectTransform>();
if (rectT != null) {
rectT.anchoredPosition = Vector2.zero;
}
}
if (screenMgr.defaultScreen != null) screenMgr.defaultScreen.gameObject.SetActive(true);
}
}
/// <summary>
/// Clears navigation settings and removes CancelTrigger class from all selectables
/// </summary>
/// <param name="ScreenMgr"></param>
/// <param name="children"></param>
private void ClearNavigation(ScreenManager ScreenMgr, BaseScreen[] children) {
for (int i = 0; i < children.Length; i++) children[i].gameObject.SetActive(false);
List<Selectable> selectables = new List<Selectable>();
for (int i = 0; i < children.Length; i++) {
// Transform parent = children[i];
Transform parent = children[i].transform;
// BaseScreen screen = parent.GetComponent<BaseScreen>();
BaseScreen screen = children[i];
if (!screen.generateNavigation) continue;
parent.gameObject.SetActive(true);
selectables.Clear();
parent.GetComponentsInChildren<Selectable>(selectables);
foreach (Selectable selectableUI in selectables) {
selectableUI.navigation = new Navigation() { mode = Navigation.Mode.Automatic };
CancelTrigger sctrigger = selectableUI.gameObject.GetComponent<CancelTrigger>();
if (sctrigger != null) DestroyImmediate(sctrigger);
}
}
if (ScreenMgr.defaultScreen != null) ScreenMgr.defaultScreen.gameObject.SetActive(true);
}
/// <summary>
/// My black vodoo script, do not use outside
/// </summary>
/// <param name="ScreenMgr"></param>
/// <param name="children"></param>
private void UpdateNavigation(ScreenManager ScreenMgr, BaseScreen[] children) {
for (int i = 0; i < children.Length; i++) children[i].gameObject.SetActive(false);
List<Selectable> selectables = new List<Selectable>();
for (int i = 0; i < children.Length; i++) {
// Transform parent = children[i];
Transform parent = children[i].transform;
// BaseScreen screen = parent.GetComponent<BaseScreen>();
BaseScreen screen = children[i];
if (!screen.generateNavigation) continue;
parent.gameObject.SetActive(true);
selectables.Clear();
parent.GetComponentsInChildren<Selectable>(selectables);
Selectable[] directions = new Selectable[4];
foreach (Selectable selectableUI in selectables) {
//Debug.Log("<b>" + parent.name + "</b>." + selectableUI.name, selectableUI);
Transform t = selectableUI.transform;
directions[0] = FindSelectable(parent, t, selectables, t.rotation * Vector3.up);
directions[1] = FindSelectable(parent, t, selectables, t.rotation * Vector3.right);
directions[2] = FindSelectable(parent, t, selectables, t.rotation * Vector3.down);
directions[3] = FindSelectable(parent, t, selectables, t.rotation * Vector3.left);
if (selectableUI is Slider) {
Slider.Direction dir = (selectableUI as Slider).direction;
if (dir == Slider.Direction.TopToBottom || dir == Slider.Direction.BottomToTop) {
directions[0] = directions[2] = null;
} else {
directions[1] = directions[3] = null;
}
}
selectableUI.navigation = new Navigation() {
mode = Navigation.Mode.Explicit,
selectOnUp = directions[0],
selectOnRight = directions[1],
selectOnDown = directions[2],
selectOnLeft = directions[3],
};
CancelTrigger sctrigger = selectableUI.gameObject.GetComponent<CancelTrigger>();
if (sctrigger == null) {
var cancelHandlerAvailable = selectableUI.GetComponent<ICancelHandler>();
if (cancelHandlerAvailable == null) {
sctrigger = selectableUI.gameObject.AddComponent<CancelTrigger>();
sctrigger.disableCancelHandler = cancelHandlerAvailable != null;
}
}
}
parent.gameObject.SetActive(false);
}
if (ScreenMgr.defaultScreen != null) ScreenMgr.defaultScreen.gameObject.SetActive(true);
}
//----------------------- EVERTHING BELOW THIS LINE IS TAKEN FROM OFFICIAL UNITY UI SOURCES
// Find the next selectable object in the specified world-space direction.
private Selectable FindSelectable(Transform parent, Transform transform, List<Selectable> list, Vector3 dir) {
dir = dir.normalized;
Vector3 localDir = Quaternion.Inverse(transform.rotation) * dir;
Vector3 pos = transform.TransformPoint(GetPointOnRectEdge(transform as RectTransform, localDir));
float maxScore = Mathf.NegativeInfinity;
Selectable bestPick = null;
for (int i = 0; i < list.Count; ++i) {
Selectable sel = list[i];
if (sel == this || sel == null)
continue;
if (!sel.transform.IsChildOf(parent) || sel.navigation.mode == Navigation.Mode.None)
continue;
var selRect = sel.transform as RectTransform;
Vector3 selCenter = selRect != null ? (Vector3)selRect.rect.center : Vector3.zero;
Vector3 myVector = sel.transform.TransformPoint(selCenter) - pos;
// Value that is the distance out along the direction.
float dot = Vector3.Dot(dir, myVector);
// Skip elements that are in the wrong direction or which have zero distance.
// This also ensures that the scoring formula below will not have a division by zero error.
if (dot <= 0)
continue;
// This scoring function has two priorities:
// - Score higher for positions that are closer.
// - Score higher for positions that are located in the right direction.
// This scoring function combines both of these criteria.
// It can be seen as this:
// Dot (dir, myVector.normalized) / myVector.magnitude
// The first part equals 1 if the direction of myVector is the same as dir, and 0 if it's orthogonal.
// The second part scores lower the greater the distance is by dividing by the distance.
// The formula below is equivalent but more optimized.
//
// If a given score is chosen, the positions that evaluate to that score will form a circle
// that touches pos and whose center is located along dir. A way to visualize the resulting functionality is this:
// From the position pos, blow up a circular balloon so it grows in the direction of dir.
// The first Selectable whose center the circular balloon touches is the one that's chosen.
float score = dot / myVector.sqrMagnitude;
if (score > maxScore) {
maxScore = score;
bestPick = sel;
}
}
return bestPick;
}
private static Vector3 GetPointOnRectEdge(RectTransform rect, Vector2 dir) {
if (rect == null)
return Vector3.zero;
if (dir != Vector2.zero)
dir /= Mathf.Max(Mathf.Abs(dir.x), Mathf.Abs(dir.y));
dir = rect.rect.center + Vector2.Scale(rect.rect.size, dir * 0.5f);
return dir;
}
}
}
| Xerios/ScreenManager | Assets/ScreenManager/Editor/ScreenManagerEditor.cs | C# | mit | 20,691 |
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20161112231702 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE push_notification_subscription ADD user_browser_data LONGTEXT NOT NULL COMMENT \'(DC2Type:array)\'');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE push_notification_subscription DROP user_browser_data');
}
}
| deepmikoto/deepmikoto-com | app/DoctrineMigrations/Version20161112231702.php | PHP | mit | 1,124 |
# Micro-Responsive CSS Framework

**Micro-Responsive CSS Framework** is a set of **CSS** classes that helps fast-prototype responsive interfaces. It is **only 0.6kb** and includes support for *desktop, tablet and mobile mediaqueries*. The game is simple: add the proper class if you need/want a certain **HTML** tag be visible or not.
### Example:
```html
<div class="mobile-only">
this will be visible only in mobile devices with (max-width: 529px)
</div>
```
You can also combine them:
```html
<div class="desktop-only tablet-only">
this will be displayed in desktop & tablet breakpoints
</div>
```
### Use:
Place **microresponsive.min.css** or it content in your project. Use the **CSS** classes as needed:
- desktop-only: `@media only screen and (min-width: 950px)`
- tablet-only: `@media only screen and (min-width: 530px) and (max-width: 949px)`
- mobile-only: `@media only screen and (max-width: 529px)`
### Demo:
[https://github.com/juanbrujo/microresponsive/blob/master/dist/demo.html](https://github.com/juanbrujo/microresponsive/blob/master/dist/demo.html)
### Disclaimer:
I recommend use this only in prototype phase of a project, not in production. Why? Simple: showing and hiding **HTML** elements can damage your **SEO** intentions. But if you don't care about **SEO**, go and enjoy this.
| juanbrujo/microresponsive | README.md | Markdown | mit | 1,356 |
#ifndef INDUCED_SORTING_1_H
#define INDUCED_SORTING_1_H
void induced_sort_LMS_1(int * T, int * SA, int n);
void induced_sort_SA_1(int * T, int * SA, int n, int lms_count);
void induced_sort_S_1(int * T, int * SA, int n);
void induced_sort_L_1(int * T, int * SA, int n);
#endif | rela1/SACA-K | induced_sorting_1.hpp | C++ | mit | 281 |
# cart-app
a [Sails](http://sailsjs.org) application
| rahulteja16/sailsjs-cart-app | cart-app/README.md | Markdown | mit | 54 |
<?php
/**
* Enable theme features
*/
add_theme_support('root-relative-urls'); // Enable relative URLs
add_theme_support('bootstrap-top-navbar'); // Enable Bootstrap's top navbar
add_theme_support('bootstrap-gallery'); // Enable Bootstrap's thumbnails component on [gallery]
add_theme_support('nice-search'); // Enable /?s= to /search/ redirect
// add_theme_support('jquery-cdn'); // Enable to load jQuery from the Google CDN
/**
* Configuration values
*/
define('GOOGLE_ANALYTICS_ID', ''); // UA-XXXXX-Y (Note: Universal Analytics only, not Classic Analytics)
define('POST_EXCERPT_LENGTH', 40); // Length in words for excerpt_length filter (http://codex.wordpress.org/Plugin_API/Filter_Reference/excerpt_length)
/**
* .main classes
*/
function roots_main_class() {
if (roots_display_sidebar()) {
// Classes on pages with the sidebar
$class = 'col-sm-8';
} else {
// Classes on full width pages
$class = 'col-sm-12';
}
return $class;
}
/**
* .sidebar classes
*/
function roots_sidebar_class() {
return 'col-sm-4';
}
/**
* Define which pages shouldn't have the sidebar
*
* See lib/sidebar.php for more details
*/
function roots_display_sidebar() {
$sidebar_config = new Roots_Sidebar(
/**
* Conditional tag checks (http://codex.wordpress.org/Conditional_Tags)
* Any of these conditional tags that return true won't show the sidebar
*
* To use a function that accepts arguments, use the following format:
*
* array('function_name', array('arg1', 'arg2'))
*
* The second element must be an array even if there's only 1 argument.
*/
array(
'is_404',
'is_front_page'
),
/**
* Page template checks (via is_page_template())
* Any of these page templates that return true won't show the sidebar
*/
array(
'template-custom.php'
)
);
return apply_filters('roots_display_sidebar', $sidebar_config->display);
}
/**
* $content_width is a global variable used by WordPress for max image upload sizes
* and media embeds (in pixels).
*
* Example: If the content area is 640px wide, set $content_width = 620; so images and videos will not overflow.
* Default: 1140px is the default Bootstrap container width.
*/
if (!isset($content_width)) { $content_width = 1140; }
| nickdotreid/healthdesignbyus-wordpress-theme | lib/config.php | PHP | mit | 2,337 |
# Arduino_H-Bridge
How to use the motor controller provided with arduino basic kit.
| michardy/Arduino_H-Bridge | README.md | Markdown | mit | 86 |
using System.Reflection;
using System.Runtime.CompilerServices;
// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.
[assembly: AssemblyTitle ("Calculator.Core.Tests")]
[assembly: AssemblyDescription ("")]
[assembly: AssemblyConfiguration ("")]
[assembly: AssemblyCompany ("")]
[assembly: AssemblyProduct ("")]
[assembly: AssemblyCopyright ("Xamarin Inc. (http://xamarin.com)")]
[assembly: AssemblyTrademark ("")]
[assembly: AssemblyCulture ("")]
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
[assembly: AssemblyVersion ("1.0.*")]
// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.
//[assembly: AssemblyDelaySign(false)]
//[assembly: AssemblyKeyFile("")]
| mrward/xamarin-calculator | Calculator.Core.Tests/Properties/AssemblyInfo.cs | C# | mit | 1,030 |
module Mailcar
module ApplicationHelper
end
end
| heavysixer/mailcar | app/helpers/mailcar/application_helper.rb | Ruby | mit | 52 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.